@anvailabs/agentbrowser-mcp 1.9.1 → 1.10.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/bin.js CHANGED
@@ -28,8 +28,8 @@ __export(value_exports, {
28
28
  IsUint8Array: () => IsUint8Array,
29
29
  IsUndefined: () => IsUndefined
30
30
  });
31
- function HasPropertyKey(value, key) {
32
- return key in value;
31
+ function HasPropertyKey(value, key2) {
32
+ return key2 in value;
33
33
  }
34
34
  function IsAsyncIterator(value) {
35
35
  return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.asyncIterator in value;
@@ -92,11 +92,11 @@ function RegExpType(value) {
92
92
  }
93
93
  function ObjectType(value) {
94
94
  const result = {};
95
- for (const key of Object.getOwnPropertyNames(value)) {
96
- result[key] = Visit(value[key]);
95
+ for (const key2 of Object.getOwnPropertyNames(value)) {
96
+ result[key2] = Visit(value[key2]);
97
97
  }
98
- for (const key of Object.getOwnPropertySymbols(value)) {
99
- result[key] = Visit(value[key]);
98
+ for (const key2 of Object.getOwnPropertySymbols(value)) {
99
+ result[key2] = Visit(value[key2]);
100
100
  }
101
101
  return result;
102
102
  }
@@ -140,8 +140,8 @@ function IsTypedArray(value) {
140
140
  function IsUint8Array2(value) {
141
141
  return value instanceof globalThis.Uint8Array;
142
142
  }
143
- function HasPropertyKey2(value, key) {
144
- return key in value;
143
+ function HasPropertyKey2(value, key2) {
144
+ return key2 in value;
145
145
  }
146
146
  function IsObject2(value) {
147
147
  return value !== null && typeof value === "object";
@@ -188,8 +188,8 @@ var TypeSystemPolicy;
188
188
  TypeSystemPolicy2.AllowArrayObject = false;
189
189
  TypeSystemPolicy2.AllowNaN = false;
190
190
  TypeSystemPolicy2.AllowNullVoid = false;
191
- function IsExactOptionalProperty(value, key) {
192
- return TypeSystemPolicy2.ExactOptionalPropertyTypes ? key in value : value[key] !== void 0;
191
+ function IsExactOptionalProperty(value, key2) {
192
+ return TypeSystemPolicy2.ExactOptionalPropertyTypes ? key2 in value : value[key2] !== void 0;
193
193
  }
194
194
  TypeSystemPolicy2.IsExactOptionalProperty = IsExactOptionalProperty;
195
195
  function IsObjectLike(value) {
@@ -227,11 +227,11 @@ function ImmutableRegExp(value) {
227
227
  }
228
228
  function ImmutableObject(value) {
229
229
  const result = {};
230
- for (const key of Object.getOwnPropertyNames(value)) {
231
- result[key] = Immutable(value[key]);
230
+ for (const key2 of Object.getOwnPropertyNames(value)) {
231
+ result[key2] = Immutable(value[key2]);
232
232
  }
233
- for (const key of Object.getOwnPropertySymbols(value)) {
234
- result[key] = Immutable(value[key]);
233
+ for (const key2 of Object.getOwnPropertySymbols(value)) {
234
+ result[key2] = Immutable(value[key2]);
235
235
  }
236
236
  return globalThis.Object.freeze(result);
237
237
  }
@@ -577,7 +577,7 @@ function IsInteger3(value) {
577
577
  return IsKindOf2(value, "Integer") && value.type === "integer" && IsOptionalString(value.$id) && IsOptionalNumber(value.exclusiveMaximum) && IsOptionalNumber(value.exclusiveMinimum) && IsOptionalNumber(value.maximum) && IsOptionalNumber(value.minimum) && IsOptionalNumber(value.multipleOf);
578
578
  }
579
579
  function IsProperties(value) {
580
- return IsObject(value) && Object.entries(value).every(([key, schema]) => IsControlCharacterFree(key) && IsSchema2(schema));
580
+ return IsObject(value) && Object.entries(value).every(([key2, schema]) => IsControlCharacterFree(key2) && IsSchema2(schema));
581
581
  }
582
582
  function IsIntersect2(value) {
583
583
  return IsKindOf2(value, "Intersect") && (IsString(value.type) && value.type !== "object" ? false : true) && IsArray(value.allOf) && value.allOf.every((schema) => IsSchema2(schema) && !IsTransform2(schema)) && IsOptionalString(value.type) && (IsOptionalBoolean(value.unevaluatedProperties) || IsOptionalSchema(value.unevaluatedProperties)) && IsOptionalString(value.$id);
@@ -604,7 +604,7 @@ function IsLiteralValue2(value) {
604
604
  return IsBoolean(value) || IsNumber(value) || IsString(value);
605
605
  }
606
606
  function IsMappedKey2(value) {
607
- return IsKindOf2(value, "MappedKey") && IsArray(value.keys) && value.keys.every((key) => IsNumber(key) || IsString(key));
607
+ return IsKindOf2(value, "MappedKey") && IsArray(value.keys) && value.keys.every((key2) => IsNumber(key2) || IsString(key2));
608
608
  }
609
609
  function IsMappedResult2(value) {
610
610
  return IsKindOf2(value, "MappedResult") && IsProperties(value.properties);
@@ -810,12 +810,12 @@ function Computed(target, parameters, options) {
810
810
  }
811
811
 
812
812
  // ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/discard/discard.mjs
813
- function DiscardKey(value, key) {
814
- const { [key]: _, ...rest } = value;
813
+ function DiscardKey(value, key2) {
814
+ const { [key2]: _, ...rest } = value;
815
815
  return rest;
816
816
  }
817
817
  function Discard(value, keys) {
818
- return keys.reduce((acc, key) => DiscardKey(acc, key), value);
818
+ return keys.reduce((acc, key2) => DiscardKey(acc, key2), value);
819
819
  }
820
820
 
821
821
  // ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/never/never.mjs
@@ -1144,7 +1144,7 @@ function TemplateLiteral(unresolved, options) {
1144
1144
  // ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.mjs
1145
1145
  function FromTemplateLiteral(templateLiteral) {
1146
1146
  const keys = TemplateLiteralGenerate(templateLiteral);
1147
- return keys.map((key) => key.toString());
1147
+ return keys.map((key2) => key2.toString());
1148
1148
  }
1149
1149
  function FromUnion2(types) {
1150
1150
  const result = [];
@@ -1176,26 +1176,26 @@ function IndexFromMappedResult(type, mappedResult, options) {
1176
1176
  }
1177
1177
 
1178
1178
  // ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.mjs
1179
- function FromRest(types, key) {
1180
- return types.map((type) => IndexFromPropertyKey(type, key));
1179
+ function FromRest(types, key2) {
1180
+ return types.map((type) => IndexFromPropertyKey(type, key2));
1181
1181
  }
1182
1182
  function FromIntersectRest(types) {
1183
1183
  return types.filter((type) => !IsNever(type));
1184
1184
  }
1185
- function FromIntersect(types, key) {
1186
- return IntersectEvaluated(FromIntersectRest(FromRest(types, key)));
1185
+ function FromIntersect(types, key2) {
1186
+ return IntersectEvaluated(FromIntersectRest(FromRest(types, key2)));
1187
1187
  }
1188
1188
  function FromUnionRest(types) {
1189
1189
  return types.some((L) => IsNever(L)) ? [] : types;
1190
1190
  }
1191
- function FromUnion3(types, key) {
1192
- return UnionEvaluated(FromUnionRest(FromRest(types, key)));
1191
+ function FromUnion3(types, key2) {
1192
+ return UnionEvaluated(FromUnionRest(FromRest(types, key2)));
1193
1193
  }
1194
- function FromTuple(types, key) {
1195
- return key in types ? types[key] : key === "[number]" ? UnionEvaluated(types) : Never();
1194
+ function FromTuple(types, key2) {
1195
+ return key2 in types ? types[key2] : key2 === "[number]" ? UnionEvaluated(types) : Never();
1196
1196
  }
1197
- function FromArray(type, key) {
1198
- return key === "[number]" ? type : Never();
1197
+ function FromArray(type, key2) {
1198
+ return key2 === "[number]" ? type : Never();
1199
1199
  }
1200
1200
  function FromProperty(properties, propertyKey) {
1201
1201
  return propertyKey in properties ? properties[propertyKey] : Never();
@@ -1209,23 +1209,23 @@ function IndexFromPropertyKeys(type, propertyKeys) {
1209
1209
  function FromSchema(type, propertyKeys) {
1210
1210
  return UnionEvaluated(IndexFromPropertyKeys(type, propertyKeys));
1211
1211
  }
1212
- function Index(type, key, options) {
1213
- if (IsRef(type) || IsRef(key)) {
1212
+ function Index(type, key2, options) {
1213
+ if (IsRef(type) || IsRef(key2)) {
1214
1214
  const error2 = `Index types using Ref parameters require both Type and Key to be of TSchema`;
1215
- if (!IsSchema(type) || !IsSchema(key))
1215
+ if (!IsSchema(type) || !IsSchema(key2))
1216
1216
  throw new TypeBoxError(error2);
1217
- return Computed("Index", [type, key]);
1217
+ return Computed("Index", [type, key2]);
1218
1218
  }
1219
- if (IsMappedResult(key))
1220
- return IndexFromMappedResult(type, key, options);
1221
- if (IsMappedKey(key))
1222
- return IndexFromMappedKey(type, key, options);
1223
- return CreateType(IsSchema(key) ? FromSchema(type, IndexPropertyKeys(key)) : FromSchema(type, key), options);
1219
+ if (IsMappedResult(key2))
1220
+ return IndexFromMappedResult(type, key2, options);
1221
+ if (IsMappedKey(key2))
1222
+ return IndexFromMappedKey(type, key2, options);
1223
+ return CreateType(IsSchema(key2) ? FromSchema(type, IndexPropertyKeys(key2)) : FromSchema(type, key2), options);
1224
1224
  }
1225
1225
 
1226
1226
  // ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.mjs
1227
- function MappedIndexPropertyKey(type, key, options) {
1228
- return { [key]: Index(type, [key], Clone(options)) };
1227
+ function MappedIndexPropertyKey(type, key2, options) {
1228
+ return { [key2]: Index(type, [key2], Clone(options)) };
1229
1229
  }
1230
1230
  function MappedIndexPropertyKeys(type, propertyKeys, options) {
1231
1231
  return propertyKeys.reduce((result, left) => {
@@ -1247,7 +1247,7 @@ function Iterator(items, options) {
1247
1247
 
1248
1248
  // ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/object/object.mjs
1249
1249
  function RequiredArray(properties) {
1250
- return globalThis.Object.keys(properties).filter((key) => !IsOptional(properties[key]));
1250
+ return globalThis.Object.keys(properties).filter((key2) => !IsOptional(properties[key2]));
1251
1251
  }
1252
1252
  function _Object_(properties, options) {
1253
1253
  const required = RequiredArray(properties);
@@ -1344,8 +1344,8 @@ function MappedFunctionReturnType(K, T) {
1344
1344
  Acc[L] = FromSchemaType(L, T);
1345
1345
  return Acc;
1346
1346
  }
1347
- function Mapped(key, map3, options) {
1348
- const K = IsSchema(key) ? IndexPropertyKeys(key) : key;
1347
+ function Mapped(key2, map3, options) {
1348
+ const K = IsSchema(key2) ? IndexPropertyKeys(key2) : key2;
1349
1349
  const RT = map3({ [Kind]: "MappedKey", keys: K });
1350
1350
  const R = MappedFunctionReturnType(K, RT);
1351
1351
  return Object2(R, options);
@@ -1483,8 +1483,8 @@ function FromPatternProperties(patternProperties) {
1483
1483
  if (!includePatternProperties)
1484
1484
  return [];
1485
1485
  const patternPropertyKeys = globalThis.Object.getOwnPropertyNames(patternProperties);
1486
- return patternPropertyKeys.map((key) => {
1487
- return key[0] === "^" && key[key.length - 1] === "$" ? key.slice(1, key.length - 1) : key;
1486
+ return patternPropertyKeys.map((key2) => {
1487
+ return key2[0] === "^" && key2[key2.length - 1] === "$" ? key2.slice(1, key2.length - 1) : key2;
1488
1488
  });
1489
1489
  }
1490
1490
  function KeyOfPropertyKeys(type) {
@@ -1495,7 +1495,7 @@ function KeyOfPattern(schema) {
1495
1495
  includePatternProperties = true;
1496
1496
  const keys = KeyOfPropertyKeys(schema);
1497
1497
  includePatternProperties = false;
1498
- const pattern = keys.map((key) => `(${key})`);
1498
+ const pattern = keys.map((key2) => `(${key2})`);
1499
1499
  return `^(${pattern.join("|")})$`;
1500
1500
  }
1501
1501
 
@@ -1630,7 +1630,7 @@ function ConstructorParameters(schema, options) {
1630
1630
  function Enum(item, options) {
1631
1631
  if (IsUndefined(item))
1632
1632
  throw new Error("Enum undefined or empty");
1633
- const values1 = globalThis.Object.getOwnPropertyNames(item).filter((key) => isNaN(key)).map((key) => item[key]);
1633
+ const values1 = globalThis.Object.getOwnPropertyNames(item).filter((key2) => isNaN(key2)).map((key2) => item[key2]);
1634
1634
  const values2 = [...new Set(values1)];
1635
1635
  const anyOf = values2.map((value) => Literal(value));
1636
1636
  return Union(anyOf, { ...options, [Hint]: "Enum" });
@@ -1787,14 +1787,14 @@ function FromObjectRight(left, right) {
1787
1787
  }
1788
1788
  function FromObject(left, right) {
1789
1789
  return IsStructuralRight(right) ? StructuralRight(left, right) : type_exports.IsRecord(right) ? FromRecordRight(left, right) : !type_exports.IsObject(right) ? ExtendsResult.False : (() => {
1790
- for (const key of Object.getOwnPropertyNames(right.properties)) {
1791
- if (!(key in left.properties) && !type_exports.IsOptional(right.properties[key])) {
1790
+ for (const key2 of Object.getOwnPropertyNames(right.properties)) {
1791
+ if (!(key2 in left.properties) && !type_exports.IsOptional(right.properties[key2])) {
1792
1792
  return ExtendsResult.False;
1793
1793
  }
1794
- if (type_exports.IsOptional(right.properties[key])) {
1794
+ if (type_exports.IsOptional(right.properties[key2])) {
1795
1795
  return ExtendsResult.True;
1796
1796
  }
1797
- if (Property(left.properties[key], right.properties[key]) === ExtendsResult.False) {
1797
+ if (Property(left.properties[key2], right.properties[key2]) === ExtendsResult.False) {
1798
1798
  return ExtendsResult.False;
1799
1799
  }
1800
1800
  }
@@ -1813,8 +1813,8 @@ function RecordValue(schema) {
1813
1813
  function FromRecordRight(left, right) {
1814
1814
  const [Key, Value] = [RecordKey(right), RecordValue(right)];
1815
1815
  return type_exports.IsLiteralString(left) && type_exports.IsNumber(Key) && IntoBooleanResult(Visit3(left, Value)) === ExtendsResult.True ? ExtendsResult.True : type_exports.IsUint8Array(left) && type_exports.IsNumber(Key) ? Visit3(left, Value) : type_exports.IsString(left) && type_exports.IsNumber(Key) ? Visit3(left, Value) : type_exports.IsArray(left) && type_exports.IsNumber(Key) ? Visit3(left, Value) : type_exports.IsObject(left) ? (() => {
1816
- for (const key of Object.getOwnPropertyNames(left.properties)) {
1817
- if (Property(Value, left.properties[key]) === ExtendsResult.False) {
1816
+ for (const key2 of Object.getOwnPropertyNames(left.properties)) {
1817
+ if (Property(Value, left.properties[key2]) === ExtendsResult.False) {
1818
1818
  return ExtendsResult.False;
1819
1819
  }
1820
1820
  }
@@ -2033,17 +2033,17 @@ function RecordCreateFromKeys(K, T, options) {
2033
2033
  function FromTemplateLiteralKey(K, T, options) {
2034
2034
  return IsTemplateLiteralFinite(K) ? RecordCreateFromKeys(IndexPropertyKeys(K), T, options) : RecordCreateFromPattern(K.pattern, T, options);
2035
2035
  }
2036
- function FromUnionKey(key, type, options) {
2037
- return RecordCreateFromKeys(IndexPropertyKeys(Union(key)), type, options);
2036
+ function FromUnionKey(key2, type, options) {
2037
+ return RecordCreateFromKeys(IndexPropertyKeys(Union(key2)), type, options);
2038
2038
  }
2039
- function FromLiteralKey(key, type, options) {
2040
- return RecordCreateFromKeys([key.toString()], type, options);
2039
+ function FromLiteralKey(key2, type, options) {
2040
+ return RecordCreateFromKeys([key2.toString()], type, options);
2041
2041
  }
2042
- function FromRegExpKey(key, type, options) {
2043
- return RecordCreateFromPattern(key.source, type, options);
2042
+ function FromRegExpKey(key2, type, options) {
2043
+ return RecordCreateFromPattern(key2.source, type, options);
2044
2044
  }
2045
- function FromStringKey(key, type, options) {
2046
- const pattern = IsUndefined(key.pattern) ? PatternStringExact : key.pattern;
2045
+ function FromStringKey(key2, type, options) {
2046
+ const pattern = IsUndefined(key2.pattern) ? PatternStringExact : key2.pattern;
2047
2047
  return RecordCreateFromPattern(pattern, type, options);
2048
2048
  }
2049
2049
  function FromAnyKey(_, type, options) {
@@ -2061,8 +2061,8 @@ function FromIntegerKey(_key, type, options) {
2061
2061
  function FromNumberKey(_, type, options) {
2062
2062
  return RecordCreateFromPattern(PatternNumberExact, type, options);
2063
2063
  }
2064
- function Record(key, type, options = {}) {
2065
- return IsUnion(key) ? FromUnionKey(key.anyOf, type, options) : IsTemplateLiteral(key) ? FromTemplateLiteralKey(key, type, options) : IsLiteral(key) ? FromLiteralKey(key.const, type, options) : IsBoolean3(key) ? FromBooleanKey(key, type, options) : IsInteger2(key) ? FromIntegerKey(key, type, options) : IsNumber3(key) ? FromNumberKey(key, type, options) : IsRegExp2(key) ? FromRegExpKey(key, type, options) : IsString3(key) ? FromStringKey(key, type, options) : IsAny(key) ? FromAnyKey(key, type, options) : IsNever(key) ? FromNeverKey(key, type, options) : Never(options);
2064
+ function Record(key2, type, options = {}) {
2065
+ return IsUnion(key2) ? FromUnionKey(key2.anyOf, type, options) : IsTemplateLiteral(key2) ? FromTemplateLiteralKey(key2, type, options) : IsLiteral(key2) ? FromLiteralKey(key2.const, type, options) : IsBoolean3(key2) ? FromBooleanKey(key2, type, options) : IsInteger2(key2) ? FromIntegerKey(key2, type, options) : IsNumber3(key2) ? FromNumberKey(key2, type, options) : IsRegExp2(key2) ? FromRegExpKey(key2, type, options) : IsString3(key2) ? FromStringKey(key2, type, options) : IsAny(key2) ? FromAnyKey(key2, type, options) : IsNever(key2) ? FromNeverKey(key2, type, options) : Never(options);
2066
2066
  }
2067
2067
  function RecordPattern(record) {
2068
2068
  return globalThis.Object.getOwnPropertyNames(record.patternProperties)[0];
@@ -2136,8 +2136,8 @@ function FromProperty2(args, type) {
2136
2136
  return isReadonly && isOptional ? ReadonlyOptional(mapped) : isReadonly && !isOptional ? Readonly(mapped) : !isReadonly && isOptional ? Optional(mapped) : mapped;
2137
2137
  }
2138
2138
  function FromProperties11(args, properties) {
2139
- return globalThis.Object.getOwnPropertyNames(properties).reduce((result, key) => {
2140
- return { ...result, [key]: FromProperty2(args, properties[key]) };
2139
+ return globalThis.Object.getOwnPropertyNames(properties).reduce((result, key2) => {
2140
+ return { ...result, [key2]: FromProperty2(args, properties[key2]) };
2141
2141
  }, {});
2142
2142
  }
2143
2143
  function FromTypes(args, types) {
@@ -2262,8 +2262,8 @@ function FromIntersect6(types, propertyKeys) {
2262
2262
  function FromUnion8(types, propertyKeys) {
2263
2263
  return types.map((type) => OmitResolve(type, propertyKeys));
2264
2264
  }
2265
- function FromProperty3(properties, key) {
2266
- const { [key]: _, ...R } = properties;
2265
+ function FromProperty3(properties, key2) {
2266
+ const { [key2]: _, ...R } = properties;
2267
2267
  return R;
2268
2268
  }
2269
2269
  function FromProperties13(properties, propertyKeys) {
@@ -2275,23 +2275,23 @@ function FromObject3(type, propertyKeys, properties) {
2275
2275
  return Object2(mappedProperties, options);
2276
2276
  }
2277
2277
  function UnionFromPropertyKeys(propertyKeys) {
2278
- const result = propertyKeys.reduce((result2, key) => IsLiteralValue(key) ? [...result2, Literal(key)] : result2, []);
2278
+ const result = propertyKeys.reduce((result2, key2) => IsLiteralValue(key2) ? [...result2, Literal(key2)] : result2, []);
2279
2279
  return Union(result);
2280
2280
  }
2281
2281
  function OmitResolve(type, propertyKeys) {
2282
2282
  return IsIntersect(type) ? Intersect(FromIntersect6(type.allOf, propertyKeys)) : IsUnion(type) ? Union(FromUnion8(type.anyOf, propertyKeys)) : IsObject3(type) ? FromObject3(type, propertyKeys, type.properties) : Object2({});
2283
2283
  }
2284
- function Omit(type, key, options) {
2285
- const typeKey = IsArray(key) ? UnionFromPropertyKeys(key) : key;
2286
- const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
2284
+ function Omit(type, key2, options) {
2285
+ const typeKey = IsArray(key2) ? UnionFromPropertyKeys(key2) : key2;
2286
+ const propertyKeys = IsSchema(key2) ? IndexPropertyKeys(key2) : key2;
2287
2287
  const isTypeRef = IsRef(type);
2288
- const isKeyRef = IsRef(key);
2289
- 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 });
2288
+ const isKeyRef = IsRef(key2);
2289
+ return IsMappedResult(type) ? OmitFromMappedResult(type, propertyKeys, options) : IsMappedKey(key2) ? OmitFromMappedKey(type, key2, 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 });
2290
2290
  }
2291
2291
 
2292
2292
  // ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.mjs
2293
- function FromPropertyKey2(type, key, options) {
2294
- return { [key]: Omit(type, [key], Clone(options)) };
2293
+ function FromPropertyKey2(type, key2, options) {
2294
+ return { [key2]: Omit(type, [key2], Clone(options)) };
2295
2295
  }
2296
2296
  function FromPropertyKeys2(type, propertyKeys, options) {
2297
2297
  return propertyKeys.reduce((Acc, LK) => {
@@ -2341,24 +2341,24 @@ function FromObject4(Type2, keys, properties) {
2341
2341
  return Object2(mappedProperties, options);
2342
2342
  }
2343
2343
  function UnionFromPropertyKeys2(propertyKeys) {
2344
- const result = propertyKeys.reduce((result2, key) => IsLiteralValue(key) ? [...result2, Literal(key)] : result2, []);
2344
+ const result = propertyKeys.reduce((result2, key2) => IsLiteralValue(key2) ? [...result2, Literal(key2)] : result2, []);
2345
2345
  return Union(result);
2346
2346
  }
2347
2347
  function PickResolve(type, propertyKeys) {
2348
2348
  return IsIntersect(type) ? Intersect(FromIntersect7(type.allOf, propertyKeys)) : IsUnion(type) ? Union(FromUnion9(type.anyOf, propertyKeys)) : IsObject3(type) ? FromObject4(type, propertyKeys, type.properties) : Object2({});
2349
2349
  }
2350
- function Pick(type, key, options) {
2351
- const typeKey = IsArray(key) ? UnionFromPropertyKeys2(key) : key;
2352
- const propertyKeys = IsSchema(key) ? IndexPropertyKeys(key) : key;
2350
+ function Pick(type, key2, options) {
2351
+ const typeKey = IsArray(key2) ? UnionFromPropertyKeys2(key2) : key2;
2352
+ const propertyKeys = IsSchema(key2) ? IndexPropertyKeys(key2) : key2;
2353
2353
  const isTypeRef = IsRef(type);
2354
- const isKeyRef = IsRef(key);
2355
- 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 });
2354
+ const isKeyRef = IsRef(key2);
2355
+ return IsMappedResult(type) ? PickFromMappedResult(type, propertyKeys, options) : IsMappedKey(key2) ? PickFromMappedKey(type, key2, 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 });
2356
2356
  }
2357
2357
 
2358
2358
  // ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.mjs
2359
- function FromPropertyKey3(type, key, options) {
2359
+ function FromPropertyKey3(type, key2, options) {
2360
2360
  return {
2361
- [key]: Pick(type, [key], Clone(options))
2361
+ [key2]: Pick(type, [key2], Clone(options))
2362
2362
  };
2363
2363
  }
2364
2364
  function FromPropertyKeys3(type, propertyKeys, options) {
@@ -2539,8 +2539,8 @@ function FromIterator3(moduleProperties, type) {
2539
2539
  return Iterator(FromType2(moduleProperties, type));
2540
2540
  }
2541
2541
  function FromObject7(moduleProperties, properties) {
2542
- return Object2(globalThis.Object.keys(properties).reduce((result, key) => {
2543
- return { ...result, [key]: FromType2(moduleProperties, properties[key]) };
2542
+ return Object2(globalThis.Object.keys(properties).reduce((result, key2) => {
2543
+ return { ...result, [key2]: FromType2(moduleProperties, properties[key2]) };
2544
2544
  }, {}));
2545
2545
  }
2546
2546
  function FromRecord3(moduleProperties, type) {
@@ -2573,12 +2573,12 @@ function FromType2(moduleProperties, type) {
2573
2573
  )
2574
2574
  );
2575
2575
  }
2576
- function ComputeType(moduleProperties, key) {
2577
- return key in moduleProperties ? FromType2(moduleProperties, moduleProperties[key]) : Never();
2576
+ function ComputeType(moduleProperties, key2) {
2577
+ return key2 in moduleProperties ? FromType2(moduleProperties, moduleProperties[key2]) : Never();
2578
2578
  }
2579
2579
  function ComputeModuleProperties(moduleProperties) {
2580
- return globalThis.Object.getOwnPropertyNames(moduleProperties).reduce((result, key) => {
2581
- return { ...result, [key]: ComputeType(moduleProperties, key) };
2580
+ return globalThis.Object.getOwnPropertyNames(moduleProperties).reduce((result, key2) => {
2581
+ return { ...result, [key2]: ComputeType(moduleProperties, key2) };
2582
2582
  }, {});
2583
2583
  }
2584
2584
 
@@ -2590,14 +2590,14 @@ var TModule = class {
2590
2590
  this.$defs = identified;
2591
2591
  }
2592
2592
  /** `[Json]` Imports a Type by Key. */
2593
- Import(key, options) {
2594
- const $defs = { ...this.$defs, [key]: CreateType(this.$defs[key], options) };
2595
- return CreateType({ [Kind]: "Import", $defs, $ref: key });
2593
+ Import(key2, options) {
2594
+ const $defs = { ...this.$defs, [key2]: CreateType(this.$defs[key2], options) };
2595
+ return CreateType({ [Kind]: "Import", $defs, $ref: key2 });
2596
2596
  }
2597
2597
  // prettier-ignore
2598
2598
  WithIdentifiers($defs) {
2599
- return globalThis.Object.getOwnPropertyNames($defs).reduce((result, key) => {
2600
- return { ...result, [key]: { ...$defs[key], $id: key } };
2599
+ return globalThis.Object.getOwnPropertyNames($defs).reduce((result, key2) => {
2600
+ return { ...result, [key2]: { ...$defs[key2], $id: key2 } };
2601
2601
  }, {});
2602
2602
  }
2603
2603
  };
@@ -2993,9 +2993,9 @@ function NumberType(value) {
2993
2993
  }
2994
2994
  function ObjectType2(value) {
2995
2995
  FNV1A64(ByteMarker.Object);
2996
- for (const key of globalThis.Object.getOwnPropertyNames(value).sort()) {
2997
- Visit4(key);
2998
- Visit4(value[key]);
2996
+ for (const key2 of globalThis.Object.getOwnPropertyNames(value).sort()) {
2997
+ Visit4(key2);
2998
+ Visit4(value[key2]);
2999
2999
  }
3000
3000
  }
3001
3001
  function StringType(value) {
@@ -3197,12 +3197,12 @@ function FromInteger2(schema, references, value) {
3197
3197
  function FromIntersect9(schema, references, value) {
3198
3198
  const check1 = schema.allOf.every((schema2) => Visit5(schema2, references, value));
3199
3199
  if (schema.unevaluatedProperties === false) {
3200
- const keyPattern = new RegExp(KeyOfPattern(schema));
3201
- const check2 = Object.getOwnPropertyNames(value).every((key) => keyPattern.test(key));
3200
+ const keyPattern2 = new RegExp(KeyOfPattern(schema));
3201
+ const check2 = Object.getOwnPropertyNames(value).every((key2) => keyPattern2.test(key2));
3202
3202
  return check1 && check2;
3203
3203
  } else if (IsSchema(schema.unevaluatedProperties)) {
3204
3204
  const keyCheck = new RegExp(KeyOfPattern(schema));
3205
- const check2 = Object.getOwnPropertyNames(value).every((key) => keyCheck.test(key) || Visit5(schema.unevaluatedProperties, references, value[key]));
3205
+ const check2 = Object.getOwnPropertyNames(value).every((key2) => keyCheck.test(key2) || Visit5(schema.unevaluatedProperties, references, value[key2]));
3206
3206
  return check1 && check2;
3207
3207
  } else {
3208
3208
  return check1;
@@ -3277,7 +3277,7 @@ function FromObject8(schema, references, value) {
3277
3277
  }
3278
3278
  } else if (typeof schema.additionalProperties === "object") {
3279
3279
  const valueKeys = Object.getOwnPropertyNames(value);
3280
- return valueKeys.every((key) => knownKeys.includes(key) || Visit5(schema.additionalProperties, references, value[key]));
3280
+ return valueKeys.every((key2) => knownKeys.includes(key2) || Visit5(schema.additionalProperties, references, value[key2]));
3281
3281
  } else {
3282
3282
  return true;
3283
3283
  }
@@ -3297,14 +3297,14 @@ function FromRecord4(schema, references, value) {
3297
3297
  }
3298
3298
  const [patternKey, patternSchema] = Object.entries(schema.patternProperties)[0];
3299
3299
  const regex = new RegExp(patternKey);
3300
- const check1 = Object.entries(value).every(([key, value2]) => {
3301
- return regex.test(key) ? Visit5(patternSchema, references, value2) : true;
3300
+ const check1 = Object.entries(value).every(([key2, value2]) => {
3301
+ return regex.test(key2) ? Visit5(patternSchema, references, value2) : true;
3302
3302
  });
3303
- const check2 = typeof schema.additionalProperties === "object" ? Object.entries(value).every(([key, value2]) => {
3304
- return !regex.test(key) ? Visit5(schema.additionalProperties, references, value2) : true;
3303
+ const check2 = typeof schema.additionalProperties === "object" ? Object.entries(value).every(([key2, value2]) => {
3304
+ return !regex.test(key2) ? Visit5(schema.additionalProperties, references, value2) : true;
3305
3305
  }) : true;
3306
- const check3 = schema.additionalProperties === false ? Object.getOwnPropertyNames(value).every((key) => {
3307
- return regex.test(key);
3306
+ const check3 = schema.additionalProperties === false ? Object.getOwnPropertyNames(value).every((key2) => {
3307
+ return regex.test(key2);
3308
3308
  }) : true;
3309
3309
  return check1 && check2 && check3;
3310
3310
  }
@@ -3560,8 +3560,8 @@ var ValueErrorsUnknownTypeError = class extends TypeBoxError {
3560
3560
  this.schema = schema;
3561
3561
  }
3562
3562
  };
3563
- function EscapeKey(key) {
3564
- return key.replace(/~/g, "~0").replace(/\//g, "~1");
3563
+ function EscapeKey(key2) {
3564
+ return key2.replace(/~/g, "~0").replace(/\//g, "~1");
3565
3565
  }
3566
3566
  function IsDefined2(value) {
3567
3567
  return value !== void 0;
@@ -4090,11 +4090,11 @@ function Assert(...args) {
4090
4090
  // ../../node_modules/.pnpm/@sinclair+typebox@0.34.52/node_modules/@sinclair/typebox/build/esm/value/clone/clone.mjs
4091
4091
  function FromObject10(value) {
4092
4092
  const Acc = {};
4093
- for (const key of Object.getOwnPropertyNames(value)) {
4094
- Acc[key] = Clone2(value[key]);
4093
+ for (const key2 of Object.getOwnPropertyNames(value)) {
4094
+ Acc[key2] = Clone2(value[key2]);
4095
4095
  }
4096
- for (const key of Object.getOwnPropertySymbols(value)) {
4097
- Acc[key] = Clone2(value[key]);
4096
+ for (const key2 of Object.getOwnPropertySymbols(value)) {
4097
+ Acc[key2] = Clone2(value[key2]);
4098
4098
  }
4099
4099
  return Acc;
4100
4100
  }
@@ -4199,9 +4199,9 @@ function FromConstructor6(schema, references) {
4199
4199
  if (typeof value === "object" && !Array.isArray(value)) {
4200
4200
  return class {
4201
4201
  constructor() {
4202
- for (const [key, val] of Object.entries(value)) {
4202
+ for (const [key2, val] of Object.entries(value)) {
4203
4203
  const self = this;
4204
- self[key] = val;
4204
+ self[key2] = val;
4205
4205
  }
4206
4206
  }
4207
4207
  };
@@ -4305,10 +4305,10 @@ function FromObject11(schema, references) {
4305
4305
  } else {
4306
4306
  const required = new Set(schema.required);
4307
4307
  const Acc = {};
4308
- for (const [key, subschema] of Object.entries(schema.properties)) {
4309
- if (!required.has(key))
4308
+ for (const [key2, subschema] of Object.entries(schema.properties)) {
4309
+ if (!required.has(key2))
4310
4310
  continue;
4311
- Acc[key] = Visit7(subschema, references);
4311
+ Acc[key2] = Visit7(subschema, references);
4312
4312
  }
4313
4313
  return Acc;
4314
4314
  }
@@ -4542,10 +4542,10 @@ function ScoreUnion(schema, references, value) {
4542
4542
  const object = schema;
4543
4543
  const keys = Object.getOwnPropertyNames(value);
4544
4544
  const entries = Object.entries(object.properties);
4545
- return entries.reduce((acc, [key, schema2]) => {
4546
- const literal = schema2[Kind] === "Literal" && schema2.const === value[key] ? 100 : 0;
4547
- const checks = Check(schema2, references, value[key]) ? 10 : 0;
4548
- const exists = keys.includes(key) ? 1 : 0;
4545
+ return entries.reduce((acc, [key2, schema2]) => {
4546
+ const literal = schema2[Kind] === "Literal" && schema2.const === value[key2] ? 100 : 0;
4547
+ const checks = Check(schema2, references, value[key2]) ? 10 : 0;
4548
+ const exists = keys.includes(key2) ? 1 : 0;
4549
4549
  return acc + (literal + checks + exists);
4550
4550
  }, 0);
4551
4551
  } else if (schema[Kind] === "Union") {
@@ -4602,10 +4602,10 @@ function FromConstructor7(schema, references, value) {
4602
4602
  const required = new Set(schema.returns.required || []);
4603
4603
  const result = function() {
4604
4604
  };
4605
- for (const [key, property] of Object.entries(schema.returns.properties)) {
4606
- if (!required.has(key) && value.prototype[key] === void 0)
4605
+ for (const [key2, property] of Object.entries(schema.returns.properties)) {
4606
+ if (!required.has(key2) && value.prototype[key2] === void 0)
4607
4607
  continue;
4608
- result.prototype[key] = Visit8(property, references, value.prototype[key]);
4608
+ result.prototype[key2] = Visit8(property, references, value.prototype[key2]);
4609
4609
  }
4610
4610
  return result;
4611
4611
  }
@@ -4619,9 +4619,9 @@ function IntersectAssign(correct, value) {
4619
4619
  return correct;
4620
4620
  if (!IsObject2(correct) || !IsObject2(value))
4621
4621
  return value;
4622
- return globalThis.Object.getOwnPropertyNames(correct).reduce((result, key) => {
4623
- const property = key in value ? IntersectAssign(correct[key], value[key]) : correct[key];
4624
- return { ...result, [key]: property };
4622
+ return globalThis.Object.getOwnPropertyNames(correct).reduce((result, key2) => {
4623
+ const property = key2 in value ? IntersectAssign(correct[key2], value[key2]) : correct[key2];
4624
+ return { ...result, [key2]: property };
4625
4625
  }, {});
4626
4626
  }
4627
4627
  function FromIntersect12(schema, references, value) {
@@ -4641,10 +4641,10 @@ function FromObject12(schema, references, value) {
4641
4641
  return Create2(schema, references);
4642
4642
  const required = new Set(schema.required || []);
4643
4643
  const result = {};
4644
- for (const [key, property] of Object.entries(schema.properties)) {
4645
- if (!required.has(key) && value[key] === void 0)
4644
+ for (const [key2, property] of Object.entries(schema.properties)) {
4645
+ if (!required.has(key2) && value[key2] === void 0)
4646
4646
  continue;
4647
- result[key] = Visit8(property, references, value[key]);
4647
+ result[key2] = Visit8(property, references, value[key2]);
4648
4648
  }
4649
4649
  if (typeof schema.additionalProperties === "object") {
4650
4650
  const propertyNames = Object.getOwnPropertyNames(schema.properties);
@@ -4755,11 +4755,11 @@ function FromIntersect13(schema, references, value) {
4755
4755
  if (!IsObject2(value) || !IsObject2(composite) || !IsKind(unevaluatedProperties))
4756
4756
  return composite;
4757
4757
  const knownkeys = KeyOfPropertyKeys(schema);
4758
- for (const key of Object.getOwnPropertyNames(value)) {
4759
- if (knownkeys.includes(key))
4758
+ for (const key2 of Object.getOwnPropertyNames(value)) {
4759
+ if (knownkeys.includes(key2))
4760
4760
  continue;
4761
- if (Check(unevaluatedProperties, references, value[key])) {
4762
- composite[key] = Visit9(unevaluatedProperties, references, value[key]);
4761
+ if (Check(unevaluatedProperties, references, value[key2])) {
4762
+ composite[key2] = Visit9(unevaluatedProperties, references, value[key2]);
4763
4763
  }
4764
4764
  }
4765
4765
  return composite;
@@ -4768,16 +4768,16 @@ function FromObject13(schema, references, value) {
4768
4768
  if (!IsObject2(value) || IsArray2(value))
4769
4769
  return value;
4770
4770
  const additionalProperties = schema.additionalProperties;
4771
- for (const key of Object.getOwnPropertyNames(value)) {
4772
- if (HasPropertyKey2(schema.properties, key)) {
4773
- value[key] = Visit9(schema.properties[key], references, value[key]);
4771
+ for (const key2 of Object.getOwnPropertyNames(value)) {
4772
+ if (HasPropertyKey2(schema.properties, key2)) {
4773
+ value[key2] = Visit9(schema.properties[key2], references, value[key2]);
4774
4774
  continue;
4775
4775
  }
4776
- if (IsKind(additionalProperties) && Check(additionalProperties, references, value[key])) {
4777
- value[key] = Visit9(additionalProperties, references, value[key]);
4776
+ if (IsKind(additionalProperties) && Check(additionalProperties, references, value[key2])) {
4777
+ value[key2] = Visit9(additionalProperties, references, value[key2]);
4778
4778
  continue;
4779
4779
  }
4780
- delete value[key];
4780
+ delete value[key2];
4781
4781
  }
4782
4782
  return value;
4783
4783
  }
@@ -4788,16 +4788,16 @@ function FromRecord8(schema, references, value) {
4788
4788
  const propertyKeys = Object.getOwnPropertyNames(value);
4789
4789
  const [propertyKey, propertySchema] = Object.entries(schema.patternProperties)[0];
4790
4790
  const propertyKeyTest = new RegExp(propertyKey);
4791
- for (const key of propertyKeys) {
4792
- if (propertyKeyTest.test(key)) {
4793
- value[key] = Visit9(propertySchema, references, value[key]);
4791
+ for (const key2 of propertyKeys) {
4792
+ if (propertyKeyTest.test(key2)) {
4793
+ value[key2] = Visit9(propertySchema, references, value[key2]);
4794
4794
  continue;
4795
4795
  }
4796
- if (IsKind(additionalProperties) && Check(additionalProperties, references, value[key])) {
4797
- value[key] = Visit9(additionalProperties, references, value[key]);
4796
+ if (IsKind(additionalProperties) && Check(additionalProperties, references, value[key2])) {
4797
+ value[key2] = Visit9(additionalProperties, references, value[key2]);
4798
4798
  continue;
4799
4799
  }
4800
- delete value[key];
4800
+ delete value[key2];
4801
4801
  }
4802
4802
  return value;
4803
4803
  }
@@ -5112,9 +5112,9 @@ function FromIntersect15(schema, references, path, value) {
5112
5112
  const unknownKeys = Object.getOwnPropertyNames(knownProperties);
5113
5113
  const unevaluatedProperties = schema.unevaluatedProperties;
5114
5114
  const unknownProperties = { ...knownProperties };
5115
- for (const key of unknownKeys)
5116
- if (!knownKeys.includes(key)) {
5117
- unknownProperties[key] = Default3(unevaluatedProperties, `${path}/${key}`, unknownProperties[key]);
5115
+ for (const key2 of unknownKeys)
5116
+ if (!knownKeys.includes(key2)) {
5117
+ unknownProperties[key2] = Default3(unevaluatedProperties, `${path}/${key2}`, unknownProperties[key2]);
5118
5118
  }
5119
5119
  return Default3(schema, path, unknownProperties);
5120
5120
  }
@@ -5132,12 +5132,12 @@ function FromObject15(schema, references, path, value) {
5132
5132
  return Default3(schema, path, value);
5133
5133
  const knownKeys = KeyOfPropertyKeys(schema);
5134
5134
  const knownProperties = { ...value };
5135
- for (const key of knownKeys) {
5136
- if (!HasPropertyKey2(knownProperties, key))
5135
+ for (const key2 of knownKeys) {
5136
+ if (!HasPropertyKey2(knownProperties, key2))
5137
5137
  continue;
5138
- if (IsUndefined2(knownProperties[key]) && (!IsUndefined3(schema.properties[key]) || TypeSystemPolicy.IsExactOptionalProperty(knownProperties, key)))
5138
+ if (IsUndefined2(knownProperties[key2]) && (!IsUndefined3(schema.properties[key2]) || TypeSystemPolicy.IsExactOptionalProperty(knownProperties, key2)))
5139
5139
  continue;
5140
- knownProperties[key] = Visit11(schema.properties[key], references, `${path}/${key}`, knownProperties[key]);
5140
+ knownProperties[key2] = Visit11(schema.properties[key2], references, `${path}/${key2}`, knownProperties[key2]);
5141
5141
  }
5142
5142
  if (!IsSchema(schema.additionalProperties)) {
5143
5143
  return Default3(schema, path, knownProperties);
@@ -5145,9 +5145,9 @@ function FromObject15(schema, references, path, value) {
5145
5145
  const unknownKeys = Object.getOwnPropertyNames(knownProperties);
5146
5146
  const additionalProperties = schema.additionalProperties;
5147
5147
  const unknownProperties = { ...knownProperties };
5148
- for (const key of unknownKeys)
5149
- if (!knownKeys.includes(key)) {
5150
- unknownProperties[key] = Default3(additionalProperties, `${path}/${key}`, unknownProperties[key]);
5148
+ for (const key2 of unknownKeys)
5149
+ if (!knownKeys.includes(key2)) {
5150
+ unknownProperties[key2] = Default3(additionalProperties, `${path}/${key2}`, unknownProperties[key2]);
5151
5151
  }
5152
5152
  return Default3(schema, path, unknownProperties);
5153
5153
  }
@@ -5157,9 +5157,9 @@ function FromRecord10(schema, references, path, value) {
5157
5157
  const pattern = Object.getOwnPropertyNames(schema.patternProperties)[0];
5158
5158
  const knownKeys = new RegExp(pattern);
5159
5159
  const knownProperties = { ...value };
5160
- for (const key of Object.getOwnPropertyNames(value))
5161
- if (knownKeys.test(key)) {
5162
- knownProperties[key] = Visit11(schema.patternProperties[pattern], references, `${path}/${key}`, knownProperties[key]);
5160
+ for (const key2 of Object.getOwnPropertyNames(value))
5161
+ if (knownKeys.test(key2)) {
5162
+ knownProperties[key2] = Visit11(schema.patternProperties[pattern], references, `${path}/${key2}`, knownProperties[key2]);
5163
5163
  }
5164
5164
  if (!IsSchema(schema.additionalProperties)) {
5165
5165
  return Default3(schema, path, knownProperties);
@@ -5167,9 +5167,9 @@ function FromRecord10(schema, references, path, value) {
5167
5167
  const unknownKeys = Object.getOwnPropertyNames(knownProperties);
5168
5168
  const additionalProperties = schema.additionalProperties;
5169
5169
  const unknownProperties = { ...knownProperties };
5170
- for (const key of unknownKeys)
5171
- if (!knownKeys.test(key)) {
5172
- unknownProperties[key] = Default3(additionalProperties, `${path}/${key}`, unknownProperties[key]);
5170
+ for (const key2 of unknownKeys)
5171
+ if (!knownKeys.test(key2)) {
5172
+ unknownProperties[key2] = Default3(additionalProperties, `${path}/${key2}`, unknownProperties[key2]);
5173
5173
  }
5174
5174
  return Default3(schema, path, unknownProperties);
5175
5175
  }
@@ -5279,9 +5279,9 @@ function FromIntersect16(schema, references, path, value) {
5279
5279
  const unknownKeys = Object.getOwnPropertyNames(knownProperties);
5280
5280
  const unevaluatedProperties = schema.unevaluatedProperties;
5281
5281
  const properties = { ...knownProperties };
5282
- for (const key of unknownKeys)
5283
- if (!knownKeys.includes(key)) {
5284
- properties[key] = Default4(unevaluatedProperties, `${path}/${key}`, properties[key]);
5282
+ for (const key2 of unknownKeys)
5283
+ if (!knownKeys.includes(key2)) {
5284
+ properties[key2] = Default4(unevaluatedProperties, `${path}/${key2}`, properties[key2]);
5285
5285
  }
5286
5286
  return properties;
5287
5287
  }
@@ -5294,12 +5294,12 @@ function FromObject16(schema, references, path, value) {
5294
5294
  return defaulted;
5295
5295
  const knownKeys = KeyOfPropertyKeys(schema);
5296
5296
  const knownProperties = { ...defaulted };
5297
- for (const key of knownKeys) {
5298
- if (!HasPropertyKey2(knownProperties, key))
5297
+ for (const key2 of knownKeys) {
5298
+ if (!HasPropertyKey2(knownProperties, key2))
5299
5299
  continue;
5300
- if (IsUndefined2(knownProperties[key]) && (!IsUndefined3(schema.properties[key]) || TypeSystemPolicy.IsExactOptionalProperty(knownProperties, key)))
5300
+ if (IsUndefined2(knownProperties[key2]) && (!IsUndefined3(schema.properties[key2]) || TypeSystemPolicy.IsExactOptionalProperty(knownProperties, key2)))
5301
5301
  continue;
5302
- knownProperties[key] = Visit12(schema.properties[key], references, `${path}/${key}`, knownProperties[key]);
5302
+ knownProperties[key2] = Visit12(schema.properties[key2], references, `${path}/${key2}`, knownProperties[key2]);
5303
5303
  }
5304
5304
  if (!IsSchema(schema.additionalProperties)) {
5305
5305
  return knownProperties;
@@ -5307,9 +5307,9 @@ function FromObject16(schema, references, path, value) {
5307
5307
  const unknownKeys = Object.getOwnPropertyNames(knownProperties);
5308
5308
  const additionalProperties = schema.additionalProperties;
5309
5309
  const properties = { ...knownProperties };
5310
- for (const key of unknownKeys)
5311
- if (!knownKeys.includes(key)) {
5312
- properties[key] = Default4(additionalProperties, `${path}/${key}`, properties[key]);
5310
+ for (const key2 of unknownKeys)
5311
+ if (!knownKeys.includes(key2)) {
5312
+ properties[key2] = Default4(additionalProperties, `${path}/${key2}`, properties[key2]);
5313
5313
  }
5314
5314
  return properties;
5315
5315
  }
@@ -5320,9 +5320,9 @@ function FromRecord11(schema, references, path, value) {
5320
5320
  const pattern = Object.getOwnPropertyNames(schema.patternProperties)[0];
5321
5321
  const knownKeys = new RegExp(pattern);
5322
5322
  const knownProperties = { ...defaulted };
5323
- for (const key of Object.getOwnPropertyNames(value))
5324
- if (knownKeys.test(key)) {
5325
- knownProperties[key] = Visit12(schema.patternProperties[pattern], references, `${path}/${key}`, knownProperties[key]);
5323
+ for (const key2 of Object.getOwnPropertyNames(value))
5324
+ if (knownKeys.test(key2)) {
5325
+ knownProperties[key2] = Visit12(schema.patternProperties[pattern], references, `${path}/${key2}`, knownProperties[key2]);
5326
5326
  }
5327
5327
  if (!IsSchema(schema.additionalProperties)) {
5328
5328
  return knownProperties;
@@ -5330,9 +5330,9 @@ function FromRecord11(schema, references, path, value) {
5330
5330
  const unknownKeys = Object.getOwnPropertyNames(knownProperties);
5331
5331
  const additionalProperties = schema.additionalProperties;
5332
5332
  const properties = { ...knownProperties };
5333
- for (const key of unknownKeys)
5334
- if (!knownKeys.test(key)) {
5335
- properties[key] = Default4(additionalProperties, `${path}/${key}`, properties[key]);
5333
+ for (const key2 of unknownKeys)
5334
+ if (!knownKeys.test(key2)) {
5335
+ properties[key2] = Default4(additionalProperties, `${path}/${key2}`, properties[key2]);
5336
5336
  }
5337
5337
  return properties;
5338
5338
  }
@@ -5414,7 +5414,7 @@ function FromIntersect17(schema, references) {
5414
5414
  return IsTransform(schema) || IsTransform(schema.unevaluatedProperties) || schema.allOf.some((schema2) => Visit13(schema2, references));
5415
5415
  }
5416
5416
  function FromImport9(schema, references) {
5417
- const additional = globalThis.Object.getOwnPropertyNames(schema.$defs).reduce((result, key) => [...result, schema.$defs[key]], []);
5417
+ const additional = globalThis.Object.getOwnPropertyNames(schema.$defs).reduce((result, key2) => [...result, schema.$defs[key2]], []);
5418
5418
  const target = schema.$defs[schema.$ref];
5419
5419
  return IsTransform(schema) || Visit13(target, [...additional, ...references]);
5420
5420
  }
@@ -5551,18 +5551,18 @@ function FromObject18(schema, references, value) {
5551
5551
  if (!IsObject2(defaulted))
5552
5552
  return defaulted;
5553
5553
  const knownPropertyKeys = Object.getOwnPropertyNames(schema.properties);
5554
- for (const key of knownPropertyKeys) {
5555
- const propertyValue = Visit14(schema.properties[key], references, defaulted[key]);
5554
+ for (const key2 of knownPropertyKeys) {
5555
+ const propertyValue = Visit14(schema.properties[key2], references, defaulted[key2]);
5556
5556
  if (IsUndefined2(propertyValue))
5557
5557
  continue;
5558
- defaulted[key] = Visit14(schema.properties[key], references, defaulted[key]);
5558
+ defaulted[key2] = Visit14(schema.properties[key2], references, defaulted[key2]);
5559
5559
  }
5560
5560
  if (!HasDefaultProperty(schema.additionalProperties))
5561
5561
  return defaulted;
5562
- for (const key of Object.getOwnPropertyNames(defaulted)) {
5563
- if (knownPropertyKeys.includes(key))
5562
+ for (const key2 of Object.getOwnPropertyNames(defaulted)) {
5563
+ if (knownPropertyKeys.includes(key2))
5564
5564
  continue;
5565
- defaulted[key] = Visit14(schema.additionalProperties, references, defaulted[key]);
5565
+ defaulted[key2] = Visit14(schema.additionalProperties, references, defaulted[key2]);
5566
5566
  }
5567
5567
  return defaulted;
5568
5568
  }
@@ -5573,17 +5573,17 @@ function FromRecord13(schema, references, value) {
5573
5573
  const additionalPropertiesSchema = schema.additionalProperties;
5574
5574
  const [propertyKeyPattern, propertySchema] = Object.entries(schema.patternProperties)[0];
5575
5575
  const knownPropertyKey = new RegExp(propertyKeyPattern);
5576
- for (const key of Object.getOwnPropertyNames(defaulted)) {
5577
- if (!(knownPropertyKey.test(key) && HasDefaultProperty(propertySchema)))
5576
+ for (const key2 of Object.getOwnPropertyNames(defaulted)) {
5577
+ if (!(knownPropertyKey.test(key2) && HasDefaultProperty(propertySchema)))
5578
5578
  continue;
5579
- defaulted[key] = Visit14(propertySchema, references, defaulted[key]);
5579
+ defaulted[key2] = Visit14(propertySchema, references, defaulted[key2]);
5580
5580
  }
5581
5581
  if (!HasDefaultProperty(additionalPropertiesSchema))
5582
5582
  return defaulted;
5583
- for (const key of Object.getOwnPropertyNames(defaulted)) {
5584
- if (knownPropertyKey.test(key))
5583
+ for (const key2 of Object.getOwnPropertyNames(defaulted)) {
5584
+ if (knownPropertyKey.test(key2))
5585
5585
  continue;
5586
- defaulted[key] = Visit14(additionalPropertiesSchema, references, defaulted[key]);
5586
+ defaulted[key2] = Visit14(additionalPropertiesSchema, references, defaulted[key2]);
5587
5587
  }
5588
5588
  return defaulted;
5589
5589
  }
@@ -5698,46 +5698,46 @@ function* Format(pointer) {
5698
5698
  function Set4(value, pointer, update) {
5699
5699
  if (pointer === "")
5700
5700
  throw new ValuePointerRootSetError(value, pointer, update);
5701
- let [owner, next, key] = [null, value, ""];
5701
+ let [owner, next, key2] = [null, value, ""];
5702
5702
  for (const component of Format(pointer)) {
5703
5703
  if (next[component] === void 0)
5704
5704
  next[component] = {};
5705
5705
  owner = next;
5706
5706
  next = next[component];
5707
- key = component;
5707
+ key2 = component;
5708
5708
  }
5709
- owner[key] = update;
5709
+ owner[key2] = update;
5710
5710
  }
5711
5711
  function Delete3(value, pointer) {
5712
5712
  if (pointer === "")
5713
5713
  throw new ValuePointerRootDeleteError(value, pointer);
5714
- let [owner, next, key] = [null, value, ""];
5714
+ let [owner, next, key2] = [null, value, ""];
5715
5715
  for (const component of Format(pointer)) {
5716
5716
  if (next[component] === void 0 || next[component] === null)
5717
5717
  return;
5718
5718
  owner = next;
5719
5719
  next = next[component];
5720
- key = component;
5720
+ key2 = component;
5721
5721
  }
5722
5722
  if (Array.isArray(owner)) {
5723
- const index = parseInt(key);
5723
+ const index = parseInt(key2);
5724
5724
  owner.splice(index, 1);
5725
5725
  } else {
5726
- delete owner[key];
5726
+ delete owner[key2];
5727
5727
  }
5728
5728
  }
5729
5729
  function Has3(value, pointer) {
5730
5730
  if (pointer === "")
5731
5731
  return true;
5732
- let [owner, next, key] = [null, value, ""];
5732
+ let [owner, next, key2] = [null, value, ""];
5733
5733
  for (const component of Format(pointer)) {
5734
5734
  if (next[component] === void 0)
5735
5735
  return false;
5736
5736
  owner = next;
5737
5737
  next = next[component];
5738
- key = component;
5738
+ key2 = component;
5739
5739
  }
5740
- return Object.getOwnPropertyNames(owner).includes(key);
5740
+ return Object.getOwnPropertyNames(owner).includes(key2);
5741
5741
  }
5742
5742
  function Get3(value, pointer) {
5743
5743
  if (pointer === "")
@@ -5759,7 +5759,7 @@ function ObjectType3(left, right) {
5759
5759
  const rightKeys = [...Object.keys(right), ...Object.getOwnPropertySymbols(right)];
5760
5760
  if (leftKeys.length !== rightKeys.length)
5761
5761
  return false;
5762
- return leftKeys.every((key) => Equal(left[key], right[key]));
5762
+ return leftKeys.every((key2) => Equal(left[key2], right[key2]));
5763
5763
  }
5764
5764
  function DateType3(left, right) {
5765
5765
  return IsDate2(right) && left.getTime() === right.getTime();
@@ -5833,22 +5833,22 @@ function* ObjectType4(path, current, next) {
5833
5833
  return yield CreateUpdate(path, next);
5834
5834
  const currentKeys = globalThis.Object.getOwnPropertyNames(current);
5835
5835
  const nextKeys = globalThis.Object.getOwnPropertyNames(next);
5836
- for (const key of nextKeys) {
5837
- if (HasPropertyKey2(current, key))
5836
+ for (const key2 of nextKeys) {
5837
+ if (HasPropertyKey2(current, key2))
5838
5838
  continue;
5839
- yield CreateInsert(`${path}/${key}`, next[key]);
5839
+ yield CreateInsert(`${path}/${key2}`, next[key2]);
5840
5840
  }
5841
- for (const key of currentKeys) {
5842
- if (!HasPropertyKey2(next, key))
5841
+ for (const key2 of currentKeys) {
5842
+ if (!HasPropertyKey2(next, key2))
5843
5843
  continue;
5844
5844
  if (Equal(current, next))
5845
5845
  continue;
5846
- yield* Visit15(`${path}/${key}`, current[key], next[key]);
5846
+ yield* Visit15(`${path}/${key2}`, current[key2], next[key2]);
5847
5847
  }
5848
- for (const key of currentKeys) {
5849
- if (HasPropertyKey2(next, key))
5848
+ for (const key2 of currentKeys) {
5849
+ if (HasPropertyKey2(next, key2))
5850
5850
  continue;
5851
- yield CreateDelete(`${path}/${key}`);
5851
+ yield CreateDelete(`${path}/${key2}`);
5852
5852
  }
5853
5853
  }
5854
5854
  function* ArrayType4(path, current, next) {
@@ -6035,16 +6035,16 @@ var ParseRegistry;
6035
6035
  ["Default", (type, references, value) => Default5(type, references, value)],
6036
6036
  ["Encode", (type, references, value) => HasTransform(type, references) ? TransformEncode(type, references, value) : value]
6037
6037
  ]);
6038
- function Delete5(key) {
6039
- registry.delete(key);
6038
+ function Delete5(key2) {
6039
+ registry.delete(key2);
6040
6040
  }
6041
6041
  ParseRegistry2.Delete = Delete5;
6042
- function Set5(key, callback) {
6043
- registry.set(key, callback);
6042
+ function Set5(key2, callback) {
6043
+ registry.set(key2, callback);
6044
6044
  }
6045
6045
  ParseRegistry2.Set = Set5;
6046
- function Get4(key) {
6047
- return registry.get(key);
6046
+ function Get4(key2) {
6047
+ return registry.get(key2);
6048
6048
  }
6049
6049
  ParseRegistry2.Get = Get4;
6050
6050
  })(ParseRegistry || (ParseRegistry = {}));
@@ -6137,6 +6137,34 @@ var DELIVERED_WAIT_TYPES = [
6137
6137
  "minElements"
6138
6138
  ];
6139
6139
 
6140
+ // ../protocol/dist/upload.js
6141
+ var VERIFIED_UPLOAD_MAX_BYTES = 16 * 1024 * 1024;
6142
+ var UPLOAD_SHA256_PATTERN = "^[a-f0-9]{64}$";
6143
+ var UPLOAD_MIME_TYPE_PATTERN = "^[A-Za-z0-9!#$&^_.+-]+/[A-Za-z0-9!#$&^_.+-]+$";
6144
+ var UPLOAD_MIME_TYPE_MAX_LENGTH = 127;
6145
+ var digest = new RegExp(UPLOAD_SHA256_PATTERN);
6146
+ var mime = new RegExp(UPLOAD_MIME_TYPE_PATTERN);
6147
+ function validateUploadIntegrity(input) {
6148
+ if (typeof input !== "object" || input === null)
6149
+ return void 0;
6150
+ const action2 = input;
6151
+ if (action2.sha256 === void 0 && action2.mimeType === void 0)
6152
+ return void 0;
6153
+ if ((action2.type ?? action2.action) !== "upload") {
6154
+ return "sha256 and mimeType are only supported for upload";
6155
+ }
6156
+ if (typeof action2.sha256 !== "string" || !digest.test(action2.sha256)) {
6157
+ return "Checked upload requires a lowercase 64-character SHA-256 digest";
6158
+ }
6159
+ if (!Array.isArray(action2.paths) || action2.paths.length !== 1) {
6160
+ return "Checked upload requires exactly one file path";
6161
+ }
6162
+ if (action2.mimeType !== void 0 && (typeof action2.mimeType !== "string" || action2.mimeType.length > UPLOAD_MIME_TYPE_MAX_LENGTH || !mime.test(action2.mimeType))) {
6163
+ return "Checked upload MIME metadata must be a type/subtype of at most 127 characters";
6164
+ }
6165
+ return void 0;
6166
+ }
6167
+
6140
6168
  // ../protocol/dist/schemas.js
6141
6169
  var ErrorCodeEnum = Type.Union([
6142
6170
  Type.Literal("SESSION_BUSY"),
@@ -6189,6 +6217,7 @@ var EngineTypeSchema = Type.Union([
6189
6217
  Type.Literal("auto")
6190
6218
  ]);
6191
6219
  var ApprovalPolicySchema = Type.Object({
6220
+ review: Type.Optional(Type.Literal("operator")),
6192
6221
  transactions: Type.Optional(Type.Union([Type.Literal("allow"), Type.Literal("deny"), Type.Literal("required")])),
6193
6222
  externalMessages: Type.Optional(Type.Union([Type.Literal("allow"), Type.Literal("deny"), Type.Literal("required")]))
6194
6223
  });
@@ -6399,12 +6428,24 @@ var SelectActionSchema = Type.Object({
6399
6428
  target: ElementTargetSchema,
6400
6429
  values: Type.Array(Type.String(), { minItems: 1 })
6401
6430
  });
6431
+ var uploadIntegrityProperties = {
6432
+ sha256: Type.Optional(Type.String({
6433
+ pattern: UPLOAD_SHA256_PATTERN,
6434
+ description: "Opt-in integrity check of exactly one service-host regular file, at most 16 MiB; the verified bytes are uploaded."
6435
+ })),
6436
+ mimeType: Type.Optional(Type.String({
6437
+ pattern: UPLOAD_MIME_TYPE_PATTERN,
6438
+ maxLength: UPLOAD_MIME_TYPE_MAX_LENGTH,
6439
+ description: "Upload metadata only; requires sha256. Defaults to application/octet-stream; does not validate content type."
6440
+ }))
6441
+ };
6402
6442
  var UploadActionSchema = Type.Object({
6403
6443
  type: Type.Literal("upload"),
6404
6444
  // Optional: file inputs are hidden by design and get no ref from observe.
6405
6445
  // Without a target the engine requires exactly one file input on the page.
6406
6446
  target: Type.Optional(ElementTargetSchema),
6407
- paths: Type.Array(Type.String({ minLength: 1 }), { minItems: 1 })
6447
+ paths: Type.Array(Type.String({ minLength: 1 }), { minItems: 1 }),
6448
+ ...uploadIntegrityProperties
6408
6449
  });
6409
6450
  var ScrollActionSchema = Type.Object({
6410
6451
  type: Type.Literal("scroll"),
@@ -6458,6 +6499,7 @@ var PlanStepSchema = Type.Object({
6458
6499
  value: Type.Optional(Type.String()),
6459
6500
  values: Type.Optional(Type.Array(Type.String(), { minItems: 1 })),
6460
6501
  paths: Type.Optional(Type.Array(Type.String({ minLength: 1 }), { minItems: 1 })),
6502
+ ...uploadIntegrityProperties,
6461
6503
  deltaX: Type.Optional(Type.Number()),
6462
6504
  deltaY: Type.Optional(Type.Number()),
6463
6505
  key: Type.Optional(Type.String()),
@@ -6699,8 +6741,8 @@ function StringConstant(value) {
6699
6741
  const escaped = canonical.replace(/'/g, "\\'");
6700
6742
  return `'${escaped}'`;
6701
6743
  }
6702
- function MemberExpression(value, key) {
6703
- return `${value}[${StringConstant(key)}]`;
6744
+ function MemberExpression(value, key2) {
6745
+ return `${value}[${StringConstant(key2)}]`;
6704
6746
  }
6705
6747
  var TypeCompilerUnknownTypeError = class extends TypeBoxError {
6706
6748
  constructor(schema) {
@@ -6716,8 +6758,8 @@ var TypeCompilerTypeGuardError = class extends TypeBoxError {
6716
6758
  };
6717
6759
  var Policy;
6718
6760
  (function(Policy2) {
6719
- function IsExactOptionalProperty(value, key, expression) {
6720
- return TypeSystemPolicy.ExactOptionalPropertyTypes ? `(${StringConstant(key)} in ${value} ? ${expression} : true)` : `(${MemberExpression(value, key)} !== undefined ? ${expression} : true)`;
6761
+ function IsExactOptionalProperty(value, key2, expression) {
6762
+ return TypeSystemPolicy.ExactOptionalPropertyTypes ? `(${StringConstant(key2)} in ${value} ? ${expression} : true)` : `(${MemberExpression(value, key2)} !== undefined ? ${expression} : true)`;
6721
6763
  }
6722
6764
  Policy2.IsExactOptionalProperty = IsExactOptionalProperty;
6723
6765
  function IsObjectLike(value) {
@@ -6811,8 +6853,8 @@ var TypeCompiler;
6811
6853
  yield `(typeof ${value} === 'function')`;
6812
6854
  }
6813
6855
  function* FromImport11(schema, references, value) {
6814
- const members = globalThis.Object.getOwnPropertyNames(schema.$defs).reduce((result, key) => {
6815
- return [...result, schema.$defs[key]];
6856
+ const members = globalThis.Object.getOwnPropertyNames(schema.$defs).reduce((result, key2) => {
6857
+ return [...result, schema.$defs[key2]];
6816
6858
  }, []);
6817
6859
  yield* Visit17(Ref(schema.$ref), [...references, ...members], value);
6818
6860
  }
@@ -6901,13 +6943,13 @@ var TypeCompiler;
6901
6943
  if (schema.required && schema.required.length === knownKeys.length) {
6902
6944
  yield `Object.getOwnPropertyNames(${value}).length === ${knownKeys.length}`;
6903
6945
  } else {
6904
- const keys = `[${knownKeys.map((key) => `${StringConstant(key)}`).join(", ")}]`;
6946
+ const keys = `[${knownKeys.map((key2) => `${StringConstant(key2)}`).join(", ")}]`;
6905
6947
  yield `Object.getOwnPropertyNames(${value}).every(key => ${keys}.includes(key))`;
6906
6948
  }
6907
6949
  }
6908
6950
  if (typeof schema.additionalProperties === "object") {
6909
6951
  const expression = CreateExpression(schema.additionalProperties, references, `${value}[key]`);
6910
- const keys = `[${knownKeys.map((key) => `${StringConstant(key)}`).join(", ")}]`;
6952
+ const keys = `[${knownKeys.map((key2) => `${StringConstant(key2)}`).join(", ")}]`;
6911
6953
  yield `(Object.getOwnPropertyNames(${value}).every(key => ${keys}.includes(key) || ${expression}))`;
6912
6954
  }
6913
6955
  }
@@ -7189,6 +7231,9 @@ var INTERACTION_GUIDANCE = Object.freeze({
7189
7231
  var sessionRequest = TypeCompiler.Compile(SessionRequestSchema);
7190
7232
  var action = TypeCompiler.Compile(ActionSchema);
7191
7233
  function validateAction(body) {
7234
+ const integrityError = validateUploadIntegrity(body);
7235
+ if (integrityError)
7236
+ return { ok: false, issues: [{ path: "/sha256", message: integrityError }] };
7192
7237
  if (action.Check(body)) {
7193
7238
  return { ok: true, value: body };
7194
7239
  }
@@ -7200,6 +7245,9 @@ function validateAction(body) {
7200
7245
  }
7201
7246
  var planStep = TypeCompiler.Compile(PlanStepSchema);
7202
7247
  function validatePlanStep(body) {
7248
+ const integrityError = validateUploadIntegrity(body);
7249
+ if (integrityError)
7250
+ return { ok: false, issues: [{ path: "/sha256", message: integrityError }] };
7203
7251
  if (typeof body === "object" && body !== null && "action" in body && typeof body.action !== "string") {
7204
7252
  return {
7205
7253
  ok: false,
@@ -7251,7 +7299,7 @@ function snapshotJsonValue(input, state, depth) {
7251
7299
  if (length.value > state.limits.maxNodes - state.nodes)
7252
7300
  throw new Error("unstable report");
7253
7301
  const keys = Reflect.ownKeys(input);
7254
- if (keys.length !== length.value + 1 || keys.some((key) => typeof key !== "string"))
7302
+ if (keys.length !== length.value + 1 || keys.some((key2) => typeof key2 !== "string"))
7255
7303
  throw new Error("unstable report");
7256
7304
  const snapshot2 = [];
7257
7305
  for (let index = 0; index < length.value; index++) {
@@ -7265,14 +7313,14 @@ function snapshotJsonValue(input, state, depth) {
7265
7313
  if (Object.getPrototypeOf(input) !== Object.prototype)
7266
7314
  throw new Error("unstable report");
7267
7315
  const snapshot = {};
7268
- for (const key of Reflect.ownKeys(input)) {
7269
- if (typeof key !== "string")
7316
+ for (const key2 of Reflect.ownKeys(input)) {
7317
+ if (typeof key2 !== "string")
7270
7318
  throw new Error("unstable report");
7271
- chargeString(key, state);
7272
- const descriptor = Object.getOwnPropertyDescriptor(input, key);
7319
+ chargeString(key2, state);
7320
+ const descriptor = Object.getOwnPropertyDescriptor(input, key2);
7273
7321
  if (!descriptor?.enumerable || !Object.hasOwn(descriptor, "value"))
7274
7322
  throw new Error("unstable report");
7275
- Object.defineProperty(snapshot, key, {
7323
+ Object.defineProperty(snapshot, key2, {
7276
7324
  value: snapshotJsonValue(descriptor.value, state, depth + 1),
7277
7325
  enumerable: true,
7278
7326
  writable: true,
@@ -7546,133 +7594,6 @@ var ControlGrantSchema = Type.Intersect([
7546
7594
  Type.Object({ token: Type.String(), mode: AgentModeSchema, cursor: RunCursorSchema })
7547
7595
  ]);
7548
7596
 
7549
- // ../protocol/dist/application.js
7550
- var strict2 = { additionalProperties: false };
7551
- var ID_SCHEMA = OperationIdSchema;
7552
- var ApplicationBindingSchema = Type.Object({ adapter: ID_SCHEMA, resource: ID_SCHEMA }, strict2);
7553
- var ApplicationOperationDescriptorSchema = Type.Object({
7554
- name: ID_SCHEMA,
7555
- mode: Type.Union([Type.Literal("read"), Type.Literal("write")])
7556
- }, strict2);
7557
- var ApplicationDiscoverySchema = Type.Object({
7558
- adapter: Type.String(),
7559
- resource: Type.String(),
7560
- operations: Type.Array(ApplicationOperationDescriptorSchema, { maxItems: 256 })
7561
- }, strict2);
7562
- var ApplicationExecuteRequestSchema = Type.Object({
7563
- operation: ID_SCHEMA,
7564
- input: Type.Unknown(),
7565
- operationId: Type.Optional(ID_SCHEMA),
7566
- expectedVersion: Type.Optional(Type.Integer({ minimum: 0 }))
7567
- }, strict2);
7568
- var ApplicationOperationResultSchema = Type.Union([
7569
- Type.Object({
7570
- status: Type.Union([Type.Literal("read"), Type.Literal("committed")]),
7571
- value: Type.Unknown()
7572
- }, strict2),
7573
- Type.Object({ status: Type.Literal("rejected"), reason: Type.String() }, strict2),
7574
- Type.Object({ replay: Type.Literal(true), operation: OperationRecordSchema }, strict2)
7575
- ]);
7576
- var binding = TypeCompiler.Compile(ApplicationBindingSchema);
7577
- var execute = TypeCompiler.Compile(ApplicationExecuteRequestSchema);
7578
-
7579
- // ../protocol/dist/autofill.js
7580
- var text = () => Type.String({ minLength: 1, maxLength: 512 });
7581
- var strict3 = { additionalProperties: false };
7582
- var AutofillMatchSchema = Type.Object({
7583
- role: Type.Optional(text()),
7584
- label: Type.Optional(text()),
7585
- labelRegex: Type.Optional(text()),
7586
- dataAutomationId: Type.Optional(text()),
7587
- block: Type.Optional(Type.Object({ id: Type.Optional(text()), label: Type.Optional(text()) }, { ...strict3, minProperties: 1 }))
7588
- }, { ...strict3, minProperties: 1 });
7589
- var AutofillRequestSchema = Type.Object({
7590
- fields: Type.Array(Type.Object({
7591
- match: AutofillMatchSchema,
7592
- value: Type.Optional(Type.String({ maxLength: 8192 })),
7593
- option: Type.Optional(Type.Object({ value: Type.String({ maxLength: 8192 }) }, strict3)),
7594
- verify: Type.Optional(Type.Union([Type.Literal("exact"), Type.Literal("none")])),
7595
- strategy: Type.Optional(Type.Union([
7596
- Type.Literal("native-input"),
7597
- Type.Literal("native-select"),
7598
- Type.Literal("react-select"),
7599
- Type.Literal("chip-multiselect")
7600
- ]))
7601
- }, strict3), { minItems: 1, maxItems: 50 }),
7602
- policy: Type.Optional(Type.Object({
7603
- onAmbiguous: Type.Optional(Type.Union([Type.Literal("fail"), Type.Literal("skip")])),
7604
- onVerifyFail: Type.Optional(Type.Union([Type.Literal("fail"), Type.Literal("skip"), Type.Literal("retry")])),
7605
- maxReobserve: Type.Optional(Type.Integer({ minimum: 0, maximum: 5 })),
7606
- settleMs: Type.Optional(Type.Integer({ minimum: 0, maximum: 2e3 })),
7607
- timeoutMs: Type.Optional(Type.Integer({ minimum: 1, maximum: 24e4 }))
7608
- }, strict3))
7609
- }, strict3);
7610
- var AutofillReceiptSchema = Type.Object({
7611
- field: Type.Integer({ minimum: 0, maximum: 49 }),
7612
- match: AutofillMatchSchema,
7613
- resolvedRef: Type.Optional(Type.String()),
7614
- blockIdentity: Type.Optional(Type.String()),
7615
- actionId: Type.Optional(Type.String()),
7616
- status: Type.Union(["verified", "unverified", "skipped", "failed", "uncertain", "not_attempted"].map((value) => Type.Literal(value))),
7617
- verified: Type.Boolean(),
7618
- actual: Type.Optional(Type.String({ maxLength: 512 })),
7619
- actualTruncated: Type.Optional(Type.Boolean()),
7620
- error: Type.Optional(Type.Object({ code: Type.String(), message: Type.String() }, strict3))
7621
- }, strict3);
7622
- var AutofillReportSchema = Type.Object({
7623
- ok: Type.Boolean(),
7624
- receipts: Type.Array(AutofillReceiptSchema, { maxItems: 50 }),
7625
- elapsedMs: Type.Number({ minimum: 0 }),
7626
- snapshot: Type.Optional(Type.Object({
7627
- artifactId: Type.String(),
7628
- contentType: Type.Optional(Type.String()),
7629
- sizeBytes: Type.Optional(Type.Integer({ minimum: 0 })),
7630
- warnings: Type.Optional(Type.Array(Type.String()))
7631
- }, strict3)),
7632
- snapshotError: Type.Optional(Type.String())
7633
- }, { ...strict3, $id: "urn:agentbrowser:autofill-report:v1" });
7634
- function labelPattern(pattern) {
7635
- const start = pattern.startsWith("^");
7636
- const end = pattern.endsWith("$");
7637
- const body = pattern.slice(start ? 1 : 0, end ? -1 : void 0);
7638
- const parts = body.split(".*");
7639
- if (parts.some((p) => /[\\[\]{}()+?*|.^$]/.test(p)))
7640
- throw new Error("labelRegex supports only literals, .* and optional ^/$ anchors");
7641
- return (label) => {
7642
- let offset = 0;
7643
- for (const [index, part] of parts.entries()) {
7644
- const at = label.indexOf(part, offset);
7645
- if (at < 0 || index === 0 && start && at !== 0)
7646
- return false;
7647
- offset = at + part.length;
7648
- }
7649
- if (!end)
7650
- return true;
7651
- const last = parts[parts.length - 1] ?? "";
7652
- return label.endsWith(last) && (parts.length > 1 || !start || offset === label.length);
7653
- };
7654
- }
7655
- function parseAutofillRequest(input) {
7656
- if (!value_exports2.Check(AutofillRequestSchema, input))
7657
- throw new Error("Invalid autofill request: bounded fields[] and policy required; unknown properties are rejected");
7658
- const request = structuredClone(input);
7659
- for (const field of request.fields) {
7660
- if (field.value === void 0 === (field.option === void 0))
7661
- throw new Error("Each autofill field requires exactly one of value or option.value");
7662
- const match = field.match;
7663
- if (!match.label && !match.labelRegex && !match.dataAutomationId)
7664
- throw new Error("Each autofill match requires label, labelRegex or dataAutomationId");
7665
- if (match.labelRegex !== void 0)
7666
- labelPattern(match.labelRegex);
7667
- if (field.strategy === "native-input" && field.value === void 0 || field.strategy === "native-select" && field.option === void 0)
7668
- throw new Error("Autofill strategy does not match value/option");
7669
- }
7670
- return request;
7671
- }
7672
- function parseAutofillReport(input, expectedFields) {
7673
- return parseExecutionReport(AutofillReportSchema, input, "autofill", (report) => !report.ok || report.receipts.length > 0 && (expectedFields === void 0 || report.receipts.length === expectedFields) && report.receipts.every((receipt, index) => receipt.field === index && receipt.error === void 0 && (receipt.status === "verified" && receipt.verified || receipt.status === "unverified" && !receipt.verified)));
7674
- }
7675
-
7676
7597
  // ../protocol/dist/plan.js
7677
7598
  var PlanActionsSchema = Type.Array(PlanStepSchema);
7678
7599
  var PlanRequestSchema = Type.Object({ actions: PlanActionsSchema });
@@ -7736,7 +7657,7 @@ function createPlanReportParser(actions) {
7736
7657
  }
7737
7658
 
7738
7659
  // ../protocol/dist/outcome.js
7739
- var strict4 = { additionalProperties: false };
7660
+ var strict2 = { additionalProperties: false };
7740
7661
  var identifier = () => Type.String({ minLength: 1, maxLength: 128, pattern: "^[A-Za-z0-9][A-Za-z0-9._-]*$" });
7741
7662
  var GROUNDING_LAYERS = Object.freeze(["G0", "G1", "G2", "G3", "G4", "G5", "G6"]);
7742
7663
  var GroundingLayerSchema = Type.Union([
@@ -7761,11 +7682,11 @@ var VerificationProjectionSchema = Type.Object({
7761
7682
  Type.Literal("unknown"),
7762
7683
  Type.Literal("not_requested")
7763
7684
  ]),
7764
- verifier: Type.Optional(Type.Object({ id: identifier(), version: identifier() }, strict4)),
7685
+ verifier: Type.Optional(Type.Object({ id: identifier(), version: identifier() }, strict2)),
7765
7686
  requiredLayer: GroundingLayerSchema,
7766
7687
  achievedLayer: Type.Optional(GroundingLayerSchema),
7767
7688
  evidenceRefIds: EvidenceReferenceIdsSchema
7768
- }, strict4);
7689
+ }, strict2);
7769
7690
  var OutcomeProjectionSchema = Type.Object({
7770
7691
  availability: Type.Union([
7771
7692
  Type.Literal("available"),
@@ -7792,7 +7713,7 @@ var OutcomeProjectionSchema = Type.Object({
7792
7713
  Type.Literal("application"),
7793
7714
  Type.Literal("agent_tool")
7794
7715
  ])
7795
- }, strict4);
7716
+ }, strict2);
7796
7717
  var evidenceCorrelationIdSchema = {
7797
7718
  ...OperationIdSchema,
7798
7719
  description: "Business receipt operation ID for an opted-in trusted evidence source; distinct from the service operation ID and conveys no authority."
@@ -7801,15 +7722,15 @@ var OutcomeRunRequestSchema = Type.Object({
7801
7722
  // A UI outcome must exercise the UI seam; an empty plan cannot attest it.
7802
7723
  actions: Type.Array(PlanStepSchema, { minItems: 1 }),
7803
7724
  verification: Type.Object({
7804
- verifier: Type.Object({ id: identifier(), version: identifier() }, strict4),
7725
+ verifier: Type.Object({ id: identifier(), version: identifier() }, strict2),
7805
7726
  input: Type.Unknown(),
7806
7727
  evidenceCorrelationId: Type.Optional(evidenceCorrelationIdSchema)
7807
- }, strict4)
7808
- }, { ...strict4, $id: "urn:agentbrowser:outcome-run-request:v1" });
7728
+ }, strict2)
7729
+ }, { ...strict2, $id: "urn:agentbrowser:outcome-run-request:v1" });
7809
7730
  var OutcomeRunReportSchema = Type.Object({
7810
7731
  plan: PlanReportSchema,
7811
7732
  outcome: OutcomeProjectionSchema
7812
- }, { ...strict4, $id: "urn:agentbrowser:outcome-run-report:v1" });
7733
+ }, { ...strict2, $id: "urn:agentbrowser:outcome-run-report:v1" });
7813
7734
  var TrustedVerifierDescriptorSchema = Type.Object({
7814
7735
  id: identifier(),
7815
7736
  version: identifier(),
@@ -7824,11 +7745,11 @@ var TrustedVerifierDescriptorSchema = Type.Object({
7824
7745
  pollIntervalMs: Type.Integer({ minimum: 1, maximum: 1e4 }),
7825
7746
  cleanupTimeoutMs: Type.Integer({ minimum: 1, maximum: 6e4 }),
7826
7747
  maxEvidenceRefs: Type.Integer({ minimum: 1, maximum: 32 })
7827
- }, strict4),
7748
+ }, strict2),
7828
7749
  redaction: Type.Literal("reference_only"),
7829
7750
  unsupported: Type.Array(Type.String({ minLength: 1, maxLength: 128 }), { maxItems: 16 }),
7830
7751
  cleanup: Type.Union([Type.Literal("not_needed"), Type.Literal("required")])
7831
- }, strict4);
7752
+ }, strict2);
7832
7753
  var layer = (value) => GROUNDING_LAYERS.indexOf(value);
7833
7754
  function validVerification(value) {
7834
7755
  if (value.status === "not_requested")
@@ -7884,6 +7805,188 @@ function createOutcomeRunReportParser(request) {
7884
7805
  return (input) => parseRunReport(input, parsePlan, verifier);
7885
7806
  }
7886
7807
 
7808
+ // ../protocol/dist/application.js
7809
+ var strict3 = { additionalProperties: false };
7810
+ var ID_SCHEMA = OperationIdSchema;
7811
+ var CONTRACT_ID_SCHEMA = Type.String({
7812
+ minLength: 1,
7813
+ maxLength: 128,
7814
+ pattern: "^[A-Za-z0-9][A-Za-z0-9._-]*$"
7815
+ });
7816
+ var ApplicationBindingSchema = Type.Object({ adapter: ID_SCHEMA, resource: ID_SCHEMA }, strict3);
7817
+ var ApplicationOperationDescriptorSchema = Type.Object({
7818
+ name: ID_SCHEMA,
7819
+ mode: Type.Union([Type.Literal("read"), Type.Literal("write")]),
7820
+ review: Type.Optional(Type.Literal("operator-submit"))
7821
+ }, strict3);
7822
+ var ApplicationDiscoverySchema = Type.Object({
7823
+ adapter: Type.String(),
7824
+ resource: Type.String(),
7825
+ operations: Type.Array(ApplicationOperationDescriptorSchema, { maxItems: 256 })
7826
+ }, strict3);
7827
+ var ApplicationExecuteRequestSchema = Type.Object({
7828
+ operation: ID_SCHEMA,
7829
+ input: Type.Unknown(),
7830
+ operationId: Type.Optional(ID_SCHEMA),
7831
+ expectedVersion: Type.Optional(Type.Integer({ minimum: 0 })),
7832
+ approvalToken: Type.Optional(Type.String({ minLength: 1, maxLength: 128 }))
7833
+ }, strict3);
7834
+ var ApplicationReviewRequestSchema = Type.Object({
7835
+ pageId: Type.String({ minLength: 1, maxLength: 255 }),
7836
+ source: Type.Object({
7837
+ ownerId: Type.String({ pattern: "^[!-~]{1,255}$" }),
7838
+ contract: Type.Object({ id: CONTRACT_ID_SCHEMA, version: CONTRACT_ID_SCHEMA }, strict3)
7839
+ }, strict3),
7840
+ request: Type.Object({
7841
+ operation: ID_SCHEMA,
7842
+ input: Type.Unknown(),
7843
+ operationId: ID_SCHEMA,
7844
+ expectedVersion: Type.Integer({ minimum: 0, maximum: Number.MAX_SAFE_INTEGER })
7845
+ }, strict3)
7846
+ }, strict3);
7847
+ var ApplicationOperationResultSchema = Type.Union([
7848
+ Type.Object({
7849
+ status: Type.Union([Type.Literal("read"), Type.Literal("committed")]),
7850
+ value: Type.Unknown()
7851
+ }, strict3),
7852
+ Type.Object({ status: Type.Literal("rejected"), reason: Type.String() }, strict3),
7853
+ Type.Object({ replay: Type.Literal(true), operation: OperationRecordSchema }, strict3)
7854
+ ]);
7855
+ var binding = TypeCompiler.Compile(ApplicationBindingSchema);
7856
+ var execute = TypeCompiler.Compile(ApplicationExecuteRequestSchema);
7857
+ var review = TypeCompiler.Compile(ApplicationReviewRequestSchema);
7858
+ var operationDescriptors = TypeCompiler.Compile(ApplicationDiscoverySchema.properties.operations);
7859
+ function validateApplicationReview(body) {
7860
+ try {
7861
+ return collect(review, snapshotJsonData(body, VERIFICATION_SNAPSHOT_LIMITS));
7862
+ } catch {
7863
+ return { ok: false, issues: [{ path: "", message: "Invalid application review request" }] };
7864
+ }
7865
+ }
7866
+ function collect(compiler, body) {
7867
+ if (compiler.Check(body)) {
7868
+ return { ok: true, value: body };
7869
+ }
7870
+ const issues = [];
7871
+ for (const error2 of compiler.Errors(body)) {
7872
+ issues.push({ path: error2.path, message: error2.message });
7873
+ }
7874
+ return { ok: false, issues };
7875
+ }
7876
+
7877
+ // ../protocol/dist/autofill.js
7878
+ var text = () => Type.String({ minLength: 1, maxLength: 512 });
7879
+ var strict4 = { additionalProperties: false };
7880
+ var AutofillMatchSchema = Type.Object({
7881
+ role: Type.Optional(text()),
7882
+ label: Type.Optional(text()),
7883
+ labelRegex: Type.Optional(text()),
7884
+ dataAutomationId: Type.Optional(text()),
7885
+ block: Type.Optional(Type.Object({ id: Type.Optional(text()), label: Type.Optional(text()) }, { ...strict4, minProperties: 1 }))
7886
+ }, { ...strict4, minProperties: 1 });
7887
+ var AutofillScopeSchema = Type.Object({ url: Type.String({ minLength: 1, maxLength: 2048 }) }, strict4);
7888
+ function validateAutofillScope(scope) {
7889
+ try {
7890
+ const url = new URL(scope.url);
7891
+ if (!["http:", "https:"].includes(url.protocol) || url.username || url.password || url.href !== scope.url)
7892
+ throw new Error();
7893
+ } catch {
7894
+ throw new Error("Autofill scope requires an exact canonical HTTP(S) URL without credentials");
7895
+ }
7896
+ }
7897
+ var AutofillRequestSchema = Type.Object({
7898
+ scope: Type.Optional(AutofillScopeSchema),
7899
+ fields: Type.Array(Type.Object({
7900
+ match: AutofillMatchSchema,
7901
+ value: Type.Optional(Type.String({ maxLength: 8192 })),
7902
+ option: Type.Optional(Type.Object({ value: Type.String({ maxLength: 8192 }) }, strict4)),
7903
+ verify: Type.Optional(Type.Union([Type.Literal("exact"), Type.Literal("none")])),
7904
+ strategy: Type.Optional(Type.Union([
7905
+ Type.Literal("native-input"),
7906
+ Type.Literal("native-select"),
7907
+ Type.Literal("react-select"),
7908
+ Type.Literal("chip-multiselect")
7909
+ ]))
7910
+ }, strict4), { minItems: 1, maxItems: 50 }),
7911
+ policy: Type.Optional(Type.Object({
7912
+ onAmbiguous: Type.Optional(Type.Union([Type.Literal("fail"), Type.Literal("skip")])),
7913
+ onVerifyFail: Type.Optional(Type.Union([Type.Literal("fail"), Type.Literal("skip"), Type.Literal("retry")])),
7914
+ maxReobserve: Type.Optional(Type.Integer({ minimum: 0, maximum: 5 })),
7915
+ settleMs: Type.Optional(Type.Integer({ minimum: 0, maximum: 2e3 })),
7916
+ timeoutMs: Type.Optional(Type.Integer({ minimum: 1, maximum: 24e4 }))
7917
+ }, strict4))
7918
+ }, strict4);
7919
+ var AutofillReceiptSchema = Type.Object({
7920
+ field: Type.Integer({ minimum: 0, maximum: 49 }),
7921
+ match: AutofillMatchSchema,
7922
+ resolvedRef: Type.Optional(Type.String()),
7923
+ blockIdentity: Type.Optional(Type.String()),
7924
+ actionId: Type.Optional(Type.String()),
7925
+ status: Type.Union(["verified", "unverified", "skipped", "failed", "uncertain", "not_attempted"].map((value) => Type.Literal(value))),
7926
+ verified: Type.Boolean(),
7927
+ actual: Type.Optional(Type.String({ maxLength: 512 })),
7928
+ actualTruncated: Type.Optional(Type.Boolean()),
7929
+ error: Type.Optional(Type.Object({ code: Type.String(), message: Type.String() }, strict4))
7930
+ }, strict4);
7931
+ var AutofillReportSchema = Type.Object({
7932
+ ok: Type.Boolean(),
7933
+ receipts: Type.Array(AutofillReceiptSchema, { maxItems: 50 }),
7934
+ elapsedMs: Type.Number({ minimum: 0 }),
7935
+ snapshot: Type.Optional(Type.Object({
7936
+ artifactId: Type.String(),
7937
+ contentType: Type.Optional(Type.String()),
7938
+ sizeBytes: Type.Optional(Type.Integer({ minimum: 0 })),
7939
+ warnings: Type.Optional(Type.Array(Type.String()))
7940
+ }, strict4)),
7941
+ snapshotError: Type.Optional(Type.String())
7942
+ }, { ...strict4, $id: "urn:agentbrowser:autofill-report:v1" });
7943
+ function labelPattern(pattern) {
7944
+ const start = pattern.startsWith("^");
7945
+ const end = pattern.endsWith("$");
7946
+ const body = pattern.slice(start ? 1 : 0, end ? -1 : void 0);
7947
+ const parts = body.split(".*");
7948
+ if (parts.some((p) => /[\\[\]{}()+?*|.^$]/.test(p)))
7949
+ throw new Error("labelRegex supports only literals, .* and optional ^/$ anchors");
7950
+ return (label) => {
7951
+ let offset = 0;
7952
+ for (const [index, part] of parts.entries()) {
7953
+ const at = label.indexOf(part, offset);
7954
+ if (at < 0 || index === 0 && start && at !== 0)
7955
+ return false;
7956
+ offset = at + part.length;
7957
+ }
7958
+ if (!end)
7959
+ return true;
7960
+ const last = parts[parts.length - 1] ?? "";
7961
+ return label.endsWith(last) && (parts.length > 1 || !start || offset === label.length);
7962
+ };
7963
+ }
7964
+ function parseAutofillRequest(input) {
7965
+ if (!value_exports2.Check(AutofillRequestSchema, input))
7966
+ throw new Error("Invalid autofill request: bounded fields[] and policy required; unknown properties are rejected");
7967
+ const request = structuredClone(input);
7968
+ if (request.scope) {
7969
+ validateAutofillScope(request.scope);
7970
+ if (request.fields.some((field) => field.verify === "none" || field.strategy === void 0) || request.policy?.onAmbiguous === "skip" || request.policy?.onVerifyFail === "skip")
7971
+ throw new Error("Scoped autofill requires explicit strategies, exact verification and cannot skip failures");
7972
+ }
7973
+ for (const field of request.fields) {
7974
+ if (field.value === void 0 === (field.option === void 0))
7975
+ throw new Error("Each autofill field requires exactly one of value or option.value");
7976
+ const match = field.match;
7977
+ if (!match.label && !match.labelRegex && !match.dataAutomationId)
7978
+ throw new Error("Each autofill match requires label, labelRegex or dataAutomationId");
7979
+ if (match.labelRegex !== void 0)
7980
+ labelPattern(match.labelRegex);
7981
+ if (field.strategy === "native-input" && field.value === void 0 || field.strategy === "native-select" && field.option === void 0)
7982
+ throw new Error("Autofill strategy does not match value/option");
7983
+ }
7984
+ return request;
7985
+ }
7986
+ function parseAutofillReport(input, expectedFields) {
7987
+ return parseExecutionReport(AutofillReportSchema, input, "autofill", (report) => !report.ok || report.receipts.length > 0 && (expectedFields === void 0 || report.receipts.length === expectedFields) && report.receipts.every((receipt, index) => receipt.field === index && receipt.error === void 0 && (receipt.status === "verified" && receipt.verified || receipt.status === "unverified" && !receipt.verified)));
7988
+ }
7989
+
7887
7990
  // ../protocol/dist/test-run.js
7888
7991
  var strict5 = { additionalProperties: false };
7889
7992
  var identifier2 = () => Type.String({ minLength: 1, maxLength: 128, pattern: "^[A-Za-z0-9][A-Za-z0-9._-]*$" });
@@ -7951,6 +8054,76 @@ var TestCaseEvaluationReportSchema = Type.Object({
7951
8054
  }, { ...strict5, $id: "urn:agentbrowser:test-case-evaluation-report:v1" });
7952
8055
  var AssertionInvocationsSchema = Type.Array(AssertionInvocationSchema, { maxItems: 16 });
7953
8056
 
8057
+ // ../protocol/dist/form-mapping.js
8058
+ var strict6 = { additionalProperties: false };
8059
+ var keyPattern = "^[A-Za-z][A-Za-z0-9_-]{0,63}$";
8060
+ var key = () => Type.String({ pattern: keyPattern, maxLength: 64 });
8061
+ var FormMappingSchema = Type.Object({
8062
+ schemaVersion: Type.Literal(1),
8063
+ id: key(),
8064
+ revision: Type.String({
8065
+ minLength: 1,
8066
+ maxLength: 64,
8067
+ pattern: "^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$"
8068
+ }),
8069
+ scope: AutofillScopeSchema,
8070
+ fields: Type.Array(Type.Required(Type.Object({
8071
+ match: AutofillMatchSchema,
8072
+ strategy: AutofillRequestSchema.properties.fields.items.properties.strategy,
8073
+ input: Type.Union([Type.Literal("value"), Type.Literal("option")]),
8074
+ valueKey: key()
8075
+ }, strict6)), { minItems: 1, maxItems: 50 })
8076
+ }, { ...strict6, $id: "urn:agentbrowser:form-mapping:v1" });
8077
+ var FormValuesSchema = Type.Record(key(), Type.String({ maxLength: 8192 }), {
8078
+ ...strict6,
8079
+ minProperties: 1,
8080
+ maxProperties: 50,
8081
+ $id: "urn:agentbrowser:form-values:v1"
8082
+ });
8083
+
8084
+ // ../protocol/dist/operator-approval.js
8085
+ var OperatorApprovalDecisionSchema = Type.Object({
8086
+ decision: Type.Union([Type.Literal("approve"), Type.Literal("deny")])
8087
+ }, { additionalProperties: false });
8088
+ var OperatorApprovalViewSchema = Type.Object({
8089
+ tokenId: Type.String({ minLength: 1, maxLength: 128 }),
8090
+ status: Type.Union(["pending", "approved", "denied", "used", "expired"].map((value) => Type.Literal(value))),
8091
+ createdAt: Type.Integer({ minimum: 0 }),
8092
+ expiresAt: Type.Integer({ minimum: 0 }),
8093
+ approvedAt: Type.Optional(Type.Integer({ minimum: 0 })),
8094
+ action: Type.Record(Type.String(), Type.Unknown())
8095
+ }, { additionalProperties: false });
8096
+ function validateOperatorApprovalDecision(input) {
8097
+ try {
8098
+ const decision = snapshotJsonData(input, { maxDepth: 2, maxNodes: 4, maxBytes: 64 });
8099
+ if (value_exports2.Check(OperatorApprovalDecisionSchema, decision))
8100
+ return { ok: true, value: decision };
8101
+ } catch {
8102
+ }
8103
+ return {
8104
+ ok: false,
8105
+ issues: [{ path: "/decision", message: "Approval decision must be approve or deny" }]
8106
+ };
8107
+ }
8108
+ function parseOperatorApprovalView(input) {
8109
+ try {
8110
+ const view = snapshotJsonData(input, { maxDepth: 24, maxNodes: 8192, maxBytes: 128 * 1024 });
8111
+ if (!value_exports2.Check(OperatorApprovalViewSchema, view))
8112
+ throw new Error();
8113
+ snapshotJsonData(view.action, { maxDepth: 20, maxNodes: 4096, maxBytes: 64 * 1024 });
8114
+ const encode = (value) => JSON.stringify(value, (_key, entry) => {
8115
+ if (entry === void 0 || typeof entry === "number" && !Number.isFinite(entry))
8116
+ throw new Error();
8117
+ return entry;
8118
+ });
8119
+ if (new TextEncoder().encode(encode(view)).byteLength > 128 * 1024 || new TextEncoder().encode(encode(view.action)).byteLength > 64 * 1024)
8120
+ throw new Error();
8121
+ return view;
8122
+ } catch {
8123
+ throw new Error("Invalid operator approval view");
8124
+ }
8125
+ }
8126
+
7954
8127
  // ../sdk-typescript/dist/client.js
7955
8128
  var AgentBrowserError = class extends Error {
7956
8129
  code;
@@ -8052,6 +8225,14 @@ var HttpClient = class {
8052
8225
  }
8053
8226
  }
8054
8227
  };
8228
+ function approvalViewParser(tokenId) {
8229
+ return (input) => {
8230
+ const view = parseOperatorApprovalView(input);
8231
+ if (view.tokenId !== tokenId)
8232
+ throw new Error("Approval identity mismatch");
8233
+ return view;
8234
+ };
8235
+ }
8055
8236
  var SessionsClient = class {
8056
8237
  http;
8057
8238
  constructor(http) {
@@ -8077,6 +8258,23 @@ var SessionsClient = class {
8077
8258
  async operation(sessionId, operationId) {
8078
8259
  return this.http.requestJson(`/v1/sessions/${sessionId}/operations/${encodeURIComponent(operationId)}`);
8079
8260
  }
8261
+ /** Private action projection; requires an authenticated operator. */
8262
+ async approval(sessionId, tokenId) {
8263
+ return this.http.requestJson(`/v1/sessions/${encodeURIComponent(sessionId)}/approvals/${encodeURIComponent(tokenId)}`, {
8264
+ parseResponse: approvalViewParser(tokenId)
8265
+ });
8266
+ }
8267
+ async decideApproval(sessionId, tokenId, decision, options = {}) {
8268
+ const checked = validateOperatorApprovalDecision({ decision });
8269
+ if (!checked.ok)
8270
+ throw new AgentBrowserError("INVALID_REQUEST", "Approval decision must be approve or deny", false);
8271
+ return this.http.requestJson(`/v1/sessions/${encodeURIComponent(sessionId)}/approvals/${encodeURIComponent(tokenId)}`, {
8272
+ method: "POST",
8273
+ body: checked.value,
8274
+ ...options,
8275
+ parseResponse: approvalViewParser(tokenId)
8276
+ });
8277
+ }
8080
8278
  /** Operator: bind an application adapter to a resource while the human owns the session. */
8081
8279
  async applicationBind(sessionId, binding2) {
8082
8280
  return this.http.requestJson(`/v1/sessions/${sessionId}/application`, {
@@ -8096,6 +8294,13 @@ var SessionsClient = class {
8096
8294
  async applicationDiscover(sessionId) {
8097
8295
  return this.http.requestJson(`/v1/sessions/${sessionId}/application`);
8098
8296
  }
8297
+ /** Allocate a pending operator review. A lost response is not automatically retried. */
8298
+ async applicationReview(sessionId, request) {
8299
+ const checked = validateApplicationReview(request);
8300
+ if (!checked.ok)
8301
+ throw new AgentBrowserError("INVALID_REQUEST", "Invalid application review request", false);
8302
+ return this.http.requestJson(`/v1/sessions/${encodeURIComponent(sessionId)}/application/reviews`, { method: "POST", body: checked.value, parseResponse: parseOperatorApprovalView });
8303
+ }
8099
8304
  /**
8100
8305
  * Dispatch one application operation. Writes need operationId +
8101
8306
  * expectedVersion; a repeated operationId returns the recorded
@@ -8464,7 +8669,7 @@ function buildTools(client) {
8464
8669
  requiredCapability: "page.form",
8465
8670
  outputSchema: AutofillReportSchema,
8466
8671
  annotations: { readOnlyHint: false, idempotentHint: false },
8467
- description: "Fill and verify structured fields in one serial server operation. Match labels within a unique fieldset block (id or legend label). Supports native text inputs and single selects; custom widgets are refused. Verification retries only read; uncertain writes stop the batch. Returns per-field receipts and an authorized raw HTML artifact. Performs no explicit submit action; page input/change handlers may commit effects. After a lost response, reconcile the operation under current authorization before any further write: use browser_operation in delegated mode or SDK/REST operation status otherwise.",
8672
+ description: "Fill and verify structured fields in one serial server operation. Match labels within a unique fieldset block (id or legend label). Supports native inputs/selects and explicitly selected qualified react-select/chip-multiselect shapes. Optional exact URL scope preflights all fields and pins stage identities. Verification retries only read; uncertain writes stop the batch. Returns per-field receipts and an authorized raw HTML artifact. Performs no explicit submit action; page input/change handlers may commit effects. After a lost response, reconcile the operation under current authorization before any further write: use browser_operation in delegated mode or SDK/REST operation status otherwise.",
8468
8673
  inputSchema: {
8469
8674
  type: "object",
8470
8675
  additionalProperties: false,
@@ -8483,6 +8688,7 @@ function buildTools(client) {
8483
8688
  try {
8484
8689
  payload = parseAutofillRequest({
8485
8690
  fields: args.fields,
8691
+ ...args.scope !== void 0 ? { scope: args.scope } : {},
8486
8692
  ...args.policy !== void 0 ? { policy: args.policy } : {}
8487
8693
  });
8488
8694
  } catch (error2) {
@@ -8852,6 +9058,9 @@ function buildMcpServer(deps) {
8852
9058
  } catch {
8853
9059
  return error(null, -32700, "Parse error");
8854
9060
  }
9061
+ if (message === null || typeof message !== "object" || Array.isArray(message)) {
9062
+ return error(null, -32600, "Invalid request");
9063
+ }
8855
9064
  if (message.id === void 0 || message.id === null) {
8856
9065
  return null;
8857
9066
  }