@wezzard/mcp-relay 0.17.0 → 0.18.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/.claude-plugin/plugin.json +1 -1
- package/README.md +8 -6
- package/dist/build-info.json +5 -4
- package/dist/doctor.mjs +55 -17
- package/dist/integrity.json +2 -2
- package/dist/server.mjs +799 -613
- package/package.json +1 -1
- package/pi-mcp.json +1 -1
package/dist/server.mjs
CHANGED
|
@@ -27,9 +27,9 @@ var __export = (target, all) => {
|
|
|
27
27
|
};
|
|
28
28
|
var __copyProps = (to, from, except, desc) => {
|
|
29
29
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
30
|
-
for (let
|
|
31
|
-
if (!__hasOwnProp.call(to,
|
|
32
|
-
__defProp(to,
|
|
30
|
+
for (let key2 of __getOwnPropNames(from))
|
|
31
|
+
if (!__hasOwnProp.call(to, key2) && key2 !== except)
|
|
32
|
+
__defProp(to, key2, { get: () => from[key2], enumerable: !(desc = __getOwnPropDesc(from, key2)) || desc.enumerable });
|
|
33
33
|
}
|
|
34
34
|
return to;
|
|
35
35
|
};
|
|
@@ -178,15 +178,15 @@ var require_code = __commonJS({
|
|
|
178
178
|
return JSON.stringify(x).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029");
|
|
179
179
|
}
|
|
180
180
|
exports.safeStringify = safeStringify;
|
|
181
|
-
function getProperty(
|
|
182
|
-
return typeof
|
|
181
|
+
function getProperty(key2) {
|
|
182
|
+
return typeof key2 == "string" && exports.IDENTIFIER.test(key2) ? new _Code(`.${key2}`) : _`[${key2}]`;
|
|
183
183
|
}
|
|
184
184
|
exports.getProperty = getProperty;
|
|
185
|
-
function getEsmExportName(
|
|
186
|
-
if (typeof
|
|
187
|
-
return new _Code(`${
|
|
185
|
+
function getEsmExportName(key2) {
|
|
186
|
+
if (typeof key2 == "string" && exports.IDENTIFIER.test(key2)) {
|
|
187
|
+
return new _Code(`${key2}`);
|
|
188
188
|
}
|
|
189
|
-
throw new Error(`CodeGen: invalid export name: ${
|
|
189
|
+
throw new Error(`CodeGen: invalid export name: ${key2}, use explicit $id name mapping`);
|
|
190
190
|
}
|
|
191
191
|
exports.getEsmExportName = getEsmExportName;
|
|
192
192
|
function regexpCode(rx) {
|
|
@@ -813,11 +813,11 @@ var require_codegen = __commonJS({
|
|
|
813
813
|
// returns code for object literal for the passed argument list of key-value pairs
|
|
814
814
|
object(...keyValues) {
|
|
815
815
|
const code = ["{"];
|
|
816
|
-
for (const [
|
|
816
|
+
for (const [key2, value] of keyValues) {
|
|
817
817
|
if (code.length > 1)
|
|
818
818
|
code.push(",");
|
|
819
|
-
code.push(
|
|
820
|
-
if (
|
|
819
|
+
code.push(key2);
|
|
820
|
+
if (key2 !== value || this.opts.es5) {
|
|
821
821
|
code.push(":");
|
|
822
822
|
(0, code_1.addCodeArg)(code, value);
|
|
823
823
|
}
|
|
@@ -1092,17 +1092,17 @@ var require_util = __commonJS({
|
|
|
1092
1092
|
if (typeof schema === "boolean")
|
|
1093
1093
|
return;
|
|
1094
1094
|
const rules = self.RULES.keywords;
|
|
1095
|
-
for (const
|
|
1096
|
-
if (!rules[
|
|
1097
|
-
checkStrictMode(it, `unknown keyword: "${
|
|
1095
|
+
for (const key2 in schema) {
|
|
1096
|
+
if (!rules[key2])
|
|
1097
|
+
checkStrictMode(it, `unknown keyword: "${key2}"`);
|
|
1098
1098
|
}
|
|
1099
1099
|
}
|
|
1100
1100
|
exports.checkUnknownRules = checkUnknownRules;
|
|
1101
1101
|
function schemaHasRules(schema, rules) {
|
|
1102
1102
|
if (typeof schema == "boolean")
|
|
1103
1103
|
return !schema;
|
|
1104
|
-
for (const
|
|
1105
|
-
if (rules[
|
|
1104
|
+
for (const key2 in schema)
|
|
1105
|
+
if (rules[key2])
|
|
1106
1106
|
return true;
|
|
1107
1107
|
return false;
|
|
1108
1108
|
}
|
|
@@ -1110,8 +1110,8 @@ var require_util = __commonJS({
|
|
|
1110
1110
|
function schemaHasRulesButRef(schema, RULES) {
|
|
1111
1111
|
if (typeof schema == "boolean")
|
|
1112
1112
|
return !schema;
|
|
1113
|
-
for (const
|
|
1114
|
-
if (
|
|
1113
|
+
for (const key2 in schema)
|
|
1114
|
+
if (key2 !== "$ref" && RULES.all[key2])
|
|
1115
1115
|
return true;
|
|
1116
1116
|
return false;
|
|
1117
1117
|
}
|
|
@@ -1689,8 +1689,8 @@ var require_defaults = __commonJS({
|
|
|
1689
1689
|
function assignDefaults(it, ty) {
|
|
1690
1690
|
const { properties, items } = it.schema;
|
|
1691
1691
|
if (ty === "object" && properties) {
|
|
1692
|
-
for (const
|
|
1693
|
-
assignDefault(it,
|
|
1692
|
+
for (const key2 in properties) {
|
|
1693
|
+
assignDefault(it, key2, properties[key2].default);
|
|
1694
1694
|
}
|
|
1695
1695
|
} else if (ty === "array" && Array.isArray(items)) {
|
|
1696
1696
|
items.forEach((sch, i) => assignDefault(it, i, sch.default));
|
|
@@ -2074,8 +2074,8 @@ var require_fast_deep_equal = __commonJS({
|
|
|
2074
2074
|
for (i = length; i-- !== 0; )
|
|
2075
2075
|
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
2076
2076
|
for (i = length; i-- !== 0; ) {
|
|
2077
|
-
var
|
|
2078
|
-
if (!equal(a[
|
|
2077
|
+
var key2 = keys[i];
|
|
2078
|
+
if (!equal(a[key2], b[key2])) return false;
|
|
2079
2079
|
}
|
|
2080
2080
|
return true;
|
|
2081
2081
|
}
|
|
@@ -2147,20 +2147,20 @@ var require_json_schema_traverse = __commonJS({
|
|
|
2147
2147
|
function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
|
|
2148
2148
|
if (schema && typeof schema == "object" && !Array.isArray(schema)) {
|
|
2149
2149
|
pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
|
|
2150
|
-
for (var
|
|
2151
|
-
var sch = schema[
|
|
2150
|
+
for (var key2 in schema) {
|
|
2151
|
+
var sch = schema[key2];
|
|
2152
2152
|
if (Array.isArray(sch)) {
|
|
2153
|
-
if (
|
|
2153
|
+
if (key2 in traverse.arrayKeywords) {
|
|
2154
2154
|
for (var i = 0; i < sch.length; i++)
|
|
2155
|
-
_traverse(opts, pre, post, sch[i], jsonPtr + "/" +
|
|
2155
|
+
_traverse(opts, pre, post, sch[i], jsonPtr + "/" + key2 + "/" + i, rootSchema, jsonPtr, key2, schema, i);
|
|
2156
2156
|
}
|
|
2157
|
-
} else if (
|
|
2157
|
+
} else if (key2 in traverse.propsKeywords) {
|
|
2158
2158
|
if (sch && typeof sch == "object") {
|
|
2159
2159
|
for (var prop in sch)
|
|
2160
|
-
_traverse(opts, pre, post, sch[prop], jsonPtr + "/" +
|
|
2160
|
+
_traverse(opts, pre, post, sch[prop], jsonPtr + "/" + key2 + "/" + escapeJsonPtr(prop), rootSchema, jsonPtr, key2, schema, prop);
|
|
2161
2161
|
}
|
|
2162
|
-
} else if (
|
|
2163
|
-
_traverse(opts, pre, post, sch, jsonPtr + "/" +
|
|
2162
|
+
} else if (key2 in traverse.keywords || opts.allKeys && !(key2 in traverse.skipKeywords)) {
|
|
2163
|
+
_traverse(opts, pre, post, sch, jsonPtr + "/" + key2, rootSchema, jsonPtr, key2, schema);
|
|
2164
2164
|
}
|
|
2165
2165
|
}
|
|
2166
2166
|
post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
|
|
@@ -2217,10 +2217,10 @@ var require_resolve = __commonJS({
|
|
|
2217
2217
|
"$dynamicAnchor"
|
|
2218
2218
|
]);
|
|
2219
2219
|
function hasRef(schema) {
|
|
2220
|
-
for (const
|
|
2221
|
-
if (REF_KEYWORDS.has(
|
|
2220
|
+
for (const key2 in schema) {
|
|
2221
|
+
if (REF_KEYWORDS.has(key2))
|
|
2222
2222
|
return true;
|
|
2223
|
-
const sch = schema[
|
|
2223
|
+
const sch = schema[key2];
|
|
2224
2224
|
if (Array.isArray(sch) && sch.some(hasRef))
|
|
2225
2225
|
return true;
|
|
2226
2226
|
if (typeof sch == "object" && hasRef(sch))
|
|
@@ -2230,14 +2230,14 @@ var require_resolve = __commonJS({
|
|
|
2230
2230
|
}
|
|
2231
2231
|
function countKeys(schema) {
|
|
2232
2232
|
let count = 0;
|
|
2233
|
-
for (const
|
|
2234
|
-
if (
|
|
2233
|
+
for (const key2 in schema) {
|
|
2234
|
+
if (key2 === "$ref")
|
|
2235
2235
|
return Infinity;
|
|
2236
2236
|
count++;
|
|
2237
|
-
if (SIMPLE_INLINED.has(
|
|
2237
|
+
if (SIMPLE_INLINED.has(key2))
|
|
2238
2238
|
continue;
|
|
2239
|
-
if (typeof schema[
|
|
2240
|
-
(0, util_1.eachItem)(schema[
|
|
2239
|
+
if (typeof schema[key2] == "object") {
|
|
2240
|
+
(0, util_1.eachItem)(schema[key2], (sch) => count += countKeys(sch));
|
|
2241
2241
|
}
|
|
2242
2242
|
if (count === Infinity)
|
|
2243
2243
|
return Infinity;
|
|
@@ -2426,8 +2426,8 @@ var require_validate = __commonJS({
|
|
|
2426
2426
|
function schemaCxtHasRules({ schema, self }) {
|
|
2427
2427
|
if (typeof schema == "boolean")
|
|
2428
2428
|
return !schema;
|
|
2429
|
-
for (const
|
|
2430
|
-
if (self.RULES.all[
|
|
2429
|
+
for (const key2 in schema)
|
|
2430
|
+
if (self.RULES.all[key2])
|
|
2431
2431
|
return true;
|
|
2432
2432
|
return false;
|
|
2433
2433
|
}
|
|
@@ -3496,7 +3496,7 @@ var require_utils = __commonJS({
|
|
|
3496
3496
|
function encodeUserinfo(input) {
|
|
3497
3497
|
return encodeComponent(input, isUserinfoCharacter);
|
|
3498
3498
|
}
|
|
3499
|
-
function
|
|
3499
|
+
function encodeQuery2(input) {
|
|
3500
3500
|
return encodeComponent(input, isQueryFragmentCharacter);
|
|
3501
3501
|
}
|
|
3502
3502
|
function encodeFragment(input) {
|
|
@@ -3602,7 +3602,7 @@ var require_utils = __commonJS({
|
|
|
3602
3602
|
serializePathEncoding,
|
|
3603
3603
|
normalizeQueryFragmentEncoding,
|
|
3604
3604
|
encodeUserinfo,
|
|
3605
|
-
encodeQuery,
|
|
3605
|
+
encodeQuery: encodeQuery2,
|
|
3606
3606
|
encodeFragment,
|
|
3607
3607
|
escapePreservingEscapes,
|
|
3608
3608
|
removeDotSegments,
|
|
@@ -3829,7 +3829,7 @@ var require_schemes = __commonJS({
|
|
|
3829
3829
|
var require_fast_uri = __commonJS({
|
|
3830
3830
|
"node_modules/fast-uri/index.js"(exports, module) {
|
|
3831
3831
|
"use strict";
|
|
3832
|
-
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
|
|
3832
|
+
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery: encodeQuery2, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
|
|
3833
3833
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
3834
3834
|
var VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u;
|
|
3835
3835
|
var MALFORMED_SCHEME_ERROR = "URI scheme is malformed.";
|
|
@@ -4002,7 +4002,7 @@ var require_fast_uri = __commonJS({
|
|
|
4002
4002
|
uriTokens.push(s);
|
|
4003
4003
|
}
|
|
4004
4004
|
if (component.query !== void 0) {
|
|
4005
|
-
uriTokens.push("?",
|
|
4005
|
+
uriTokens.push("?", encodeQuery2(component.query));
|
|
4006
4006
|
}
|
|
4007
4007
|
if (component.fragment !== void 0) {
|
|
4008
4008
|
uriTokens.push("#", encodeFragment(component.fragment));
|
|
@@ -4465,7 +4465,7 @@ var require_core = __commonJS({
|
|
|
4465
4465
|
}
|
|
4466
4466
|
}
|
|
4467
4467
|
// Adds schema to the instance
|
|
4468
|
-
addSchema(schema,
|
|
4468
|
+
addSchema(schema, key2, _meta, _validateSchema = this.opts.validateSchema) {
|
|
4469
4469
|
if (Array.isArray(schema)) {
|
|
4470
4470
|
for (const sch of schema)
|
|
4471
4471
|
this.addSchema(sch, void 0, _meta, _validateSchema);
|
|
@@ -4479,15 +4479,15 @@ var require_core = __commonJS({
|
|
|
4479
4479
|
throw new Error(`schema ${schemaId} must be string`);
|
|
4480
4480
|
}
|
|
4481
4481
|
}
|
|
4482
|
-
|
|
4483
|
-
this._checkUnique(
|
|
4484
|
-
this.schemas[
|
|
4482
|
+
key2 = (0, resolve_1.normalizeId)(key2 || id2);
|
|
4483
|
+
this._checkUnique(key2);
|
|
4484
|
+
this.schemas[key2] = this._addSchema(schema, _meta, key2, _validateSchema, true);
|
|
4485
4485
|
return this;
|
|
4486
4486
|
}
|
|
4487
4487
|
// Add schema that will be used to validate other schemas
|
|
4488
4488
|
// options in META_IGNORE_OPTIONS are alway set to false
|
|
4489
|
-
addMetaSchema(schema,
|
|
4490
|
-
this.addSchema(schema,
|
|
4489
|
+
addMetaSchema(schema, key2, _validateSchema = this.opts.validateSchema) {
|
|
4490
|
+
this.addSchema(schema, key2, true, _validateSchema);
|
|
4491
4491
|
return this;
|
|
4492
4492
|
}
|
|
4493
4493
|
// Validate schema against its meta-schema
|
|
@@ -4643,14 +4643,14 @@ var require_core = __commonJS({
|
|
|
4643
4643
|
let keywords = metaSchema;
|
|
4644
4644
|
for (const seg of segments)
|
|
4645
4645
|
keywords = keywords[seg];
|
|
4646
|
-
for (const
|
|
4647
|
-
const rule = rules[
|
|
4646
|
+
for (const key2 in rules) {
|
|
4647
|
+
const rule = rules[key2];
|
|
4648
4648
|
if (typeof rule != "object")
|
|
4649
4649
|
continue;
|
|
4650
4650
|
const { $data } = rule.definition;
|
|
4651
|
-
const schema = keywords[
|
|
4651
|
+
const schema = keywords[key2];
|
|
4652
4652
|
if ($data && schema)
|
|
4653
|
-
keywords[
|
|
4653
|
+
keywords[key2] = schemaOrData(schema);
|
|
4654
4654
|
}
|
|
4655
4655
|
}
|
|
4656
4656
|
return metaSchema;
|
|
@@ -4723,10 +4723,10 @@ var require_core = __commonJS({
|
|
|
4723
4723
|
Ajv2.MissingRefError = ref_error_1.default;
|
|
4724
4724
|
exports.default = Ajv2;
|
|
4725
4725
|
function checkOptions(checkOpts, options, msg, log = "error") {
|
|
4726
|
-
for (const
|
|
4727
|
-
const opt =
|
|
4726
|
+
for (const key2 in checkOpts) {
|
|
4727
|
+
const opt = key2;
|
|
4728
4728
|
if (opt in options)
|
|
4729
|
-
this.logger[log](`${msg}: option ${
|
|
4729
|
+
this.logger[log](`${msg}: option ${key2}. ${checkOpts[opt]}`);
|
|
4730
4730
|
}
|
|
4731
4731
|
}
|
|
4732
4732
|
function getSchEnv(keyRef) {
|
|
@@ -4740,8 +4740,8 @@ var require_core = __commonJS({
|
|
|
4740
4740
|
if (Array.isArray(optsSchemas))
|
|
4741
4741
|
this.addSchema(optsSchemas);
|
|
4742
4742
|
else
|
|
4743
|
-
for (const
|
|
4744
|
-
this.addSchema(optsSchemas[
|
|
4743
|
+
for (const key2 in optsSchemas)
|
|
4744
|
+
this.addSchema(optsSchemas[key2], key2);
|
|
4745
4745
|
}
|
|
4746
4746
|
function addInitialFormats() {
|
|
4747
4747
|
for (const name in this.opts.formats) {
|
|
@@ -5789,11 +5789,11 @@ var require_dependencies = __commonJS({
|
|
|
5789
5789
|
function splitDependencies({ schema }) {
|
|
5790
5790
|
const propertyDeps = {};
|
|
5791
5791
|
const schemaDeps = {};
|
|
5792
|
-
for (const
|
|
5793
|
-
if (
|
|
5792
|
+
for (const key2 in schema) {
|
|
5793
|
+
if (key2 === "__proto__")
|
|
5794
5794
|
continue;
|
|
5795
|
-
const deps = Array.isArray(schema[
|
|
5796
|
-
deps[
|
|
5795
|
+
const deps = Array.isArray(schema[key2]) ? propertyDeps : schemaDeps;
|
|
5796
|
+
deps[key2] = schema[key2];
|
|
5797
5797
|
}
|
|
5798
5798
|
return [propertyDeps, schemaDeps];
|
|
5799
5799
|
}
|
|
@@ -5870,13 +5870,13 @@ var require_propertyNames = __commonJS({
|
|
|
5870
5870
|
if ((0, util_1.alwaysValidSchema)(it, schema))
|
|
5871
5871
|
return;
|
|
5872
5872
|
const valid = gen.name("valid");
|
|
5873
|
-
gen.forIn("key", data, (
|
|
5874
|
-
cxt.setParams({ propertyName:
|
|
5873
|
+
gen.forIn("key", data, (key2) => {
|
|
5874
|
+
cxt.setParams({ propertyName: key2 });
|
|
5875
5875
|
cxt.subschema({
|
|
5876
5876
|
keyword: "propertyNames",
|
|
5877
|
-
data:
|
|
5877
|
+
data: key2,
|
|
5878
5878
|
dataTypes: ["string"],
|
|
5879
|
-
propertyName:
|
|
5879
|
+
propertyName: key2,
|
|
5880
5880
|
compositeRule: true
|
|
5881
5881
|
}, valid);
|
|
5882
5882
|
gen.if((0, codegen_1.not)(valid), () => {
|
|
@@ -5925,38 +5925,38 @@ var require_additionalProperties = __commonJS({
|
|
|
5925
5925
|
checkAdditionalProperties();
|
|
5926
5926
|
cxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`);
|
|
5927
5927
|
function checkAdditionalProperties() {
|
|
5928
|
-
gen.forIn("key", data, (
|
|
5928
|
+
gen.forIn("key", data, (key2) => {
|
|
5929
5929
|
if (!props.length && !patProps.length)
|
|
5930
|
-
additionalPropertyCode(
|
|
5930
|
+
additionalPropertyCode(key2);
|
|
5931
5931
|
else
|
|
5932
|
-
gen.if(isAdditional(
|
|
5932
|
+
gen.if(isAdditional(key2), () => additionalPropertyCode(key2));
|
|
5933
5933
|
});
|
|
5934
5934
|
}
|
|
5935
|
-
function isAdditional(
|
|
5935
|
+
function isAdditional(key2) {
|
|
5936
5936
|
let definedProp;
|
|
5937
5937
|
if (props.length > 8) {
|
|
5938
5938
|
const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties");
|
|
5939
|
-
definedProp = (0, code_1.isOwnProperty)(gen, propsSchema,
|
|
5939
|
+
definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key2);
|
|
5940
5940
|
} else if (props.length) {
|
|
5941
|
-
definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._)`${
|
|
5941
|
+
definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._)`${key2} === ${p}`));
|
|
5942
5942
|
} else {
|
|
5943
5943
|
definedProp = codegen_1.nil;
|
|
5944
5944
|
}
|
|
5945
5945
|
if (patProps.length) {
|
|
5946
|
-
definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p)}.test(${
|
|
5946
|
+
definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p)}.test(${key2})`));
|
|
5947
5947
|
}
|
|
5948
5948
|
return (0, codegen_1.not)(definedProp);
|
|
5949
5949
|
}
|
|
5950
|
-
function deleteAdditional(
|
|
5951
|
-
gen.code((0, codegen_1._)`delete ${data}[${
|
|
5950
|
+
function deleteAdditional(key2) {
|
|
5951
|
+
gen.code((0, codegen_1._)`delete ${data}[${key2}]`);
|
|
5952
5952
|
}
|
|
5953
|
-
function additionalPropertyCode(
|
|
5953
|
+
function additionalPropertyCode(key2) {
|
|
5954
5954
|
if (opts.removeAdditional === "all" || opts.removeAdditional && schema === false) {
|
|
5955
|
-
deleteAdditional(
|
|
5955
|
+
deleteAdditional(key2);
|
|
5956
5956
|
return;
|
|
5957
5957
|
}
|
|
5958
5958
|
if (schema === false) {
|
|
5959
|
-
cxt.setParams({ additionalProperty:
|
|
5959
|
+
cxt.setParams({ additionalProperty: key2 });
|
|
5960
5960
|
cxt.error();
|
|
5961
5961
|
if (!allErrors)
|
|
5962
5962
|
gen.break();
|
|
@@ -5965,22 +5965,22 @@ var require_additionalProperties = __commonJS({
|
|
|
5965
5965
|
if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
|
|
5966
5966
|
const valid = gen.name("valid");
|
|
5967
5967
|
if (opts.removeAdditional === "failing") {
|
|
5968
|
-
applyAdditionalSchema(
|
|
5968
|
+
applyAdditionalSchema(key2, valid, false);
|
|
5969
5969
|
gen.if((0, codegen_1.not)(valid), () => {
|
|
5970
5970
|
cxt.reset();
|
|
5971
|
-
deleteAdditional(
|
|
5971
|
+
deleteAdditional(key2);
|
|
5972
5972
|
});
|
|
5973
5973
|
} else {
|
|
5974
|
-
applyAdditionalSchema(
|
|
5974
|
+
applyAdditionalSchema(key2, valid);
|
|
5975
5975
|
if (!allErrors)
|
|
5976
5976
|
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
5977
5977
|
}
|
|
5978
5978
|
}
|
|
5979
5979
|
}
|
|
5980
|
-
function applyAdditionalSchema(
|
|
5980
|
+
function applyAdditionalSchema(key2, valid, errors) {
|
|
5981
5981
|
const subschema = {
|
|
5982
5982
|
keyword: "additionalProperties",
|
|
5983
|
-
dataProp:
|
|
5983
|
+
dataProp: key2,
|
|
5984
5984
|
dataPropType: util_1.Type.Str
|
|
5985
5985
|
};
|
|
5986
5986
|
if (errors === false) {
|
|
@@ -6105,19 +6105,19 @@ var require_patternProperties = __commonJS({
|
|
|
6105
6105
|
}
|
|
6106
6106
|
}
|
|
6107
6107
|
function validateProperties(pat) {
|
|
6108
|
-
gen.forIn("key", data, (
|
|
6109
|
-
gen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${
|
|
6108
|
+
gen.forIn("key", data, (key2) => {
|
|
6109
|
+
gen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${key2})`, () => {
|
|
6110
6110
|
const alwaysValid = alwaysValidPatterns.includes(pat);
|
|
6111
6111
|
if (!alwaysValid) {
|
|
6112
6112
|
cxt.subschema({
|
|
6113
6113
|
keyword: "patternProperties",
|
|
6114
6114
|
schemaProp: pat,
|
|
6115
|
-
dataProp:
|
|
6115
|
+
dataProp: key2,
|
|
6116
6116
|
dataPropType: util_2.Type.Str
|
|
6117
6117
|
}, valid);
|
|
6118
6118
|
}
|
|
6119
6119
|
if (it.opts.unevaluated && props !== true) {
|
|
6120
|
-
gen.assign((0, codegen_1._)`${props}[${
|
|
6120
|
+
gen.assign((0, codegen_1._)`${props}[${key2}]`, true);
|
|
6121
6121
|
} else if (!alwaysValid && !it.allErrors) {
|
|
6122
6122
|
gen.if((0, codegen_1.not)(valid), () => gen.break());
|
|
6123
6123
|
}
|
|
@@ -7600,9 +7600,9 @@ function floatSafeRemainder(val, step2) {
|
|
|
7600
7600
|
return ratio - roundedRatio;
|
|
7601
7601
|
}
|
|
7602
7602
|
var EVALUATING = /* @__PURE__ */ Symbol("evaluating");
|
|
7603
|
-
function defineLazy(object6,
|
|
7603
|
+
function defineLazy(object6, key2, getter) {
|
|
7604
7604
|
let value = void 0;
|
|
7605
|
-
Object.defineProperty(object6,
|
|
7605
|
+
Object.defineProperty(object6, key2, {
|
|
7606
7606
|
get() {
|
|
7607
7607
|
if (value === EVALUATING) {
|
|
7608
7608
|
return void 0;
|
|
@@ -7614,7 +7614,7 @@ function defineLazy(object6, key, getter) {
|
|
|
7614
7614
|
return value;
|
|
7615
7615
|
},
|
|
7616
7616
|
set(v) {
|
|
7617
|
-
Object.defineProperty(object6,
|
|
7617
|
+
Object.defineProperty(object6, key2, {
|
|
7618
7618
|
value: v
|
|
7619
7619
|
// configurable: true,
|
|
7620
7620
|
});
|
|
@@ -7640,47 +7640,47 @@ function rawShape(def) {
|
|
|
7640
7640
|
function sourceShape(schema) {
|
|
7641
7641
|
return rawShape(schema._zod.def) ?? schema._zod.def.shape;
|
|
7642
7642
|
}
|
|
7643
|
-
function deferProp(target,
|
|
7644
|
-
Object.defineProperty(target,
|
|
7643
|
+
function deferProp(target, key2, getter) {
|
|
7644
|
+
Object.defineProperty(target, key2, {
|
|
7645
7645
|
get() {
|
|
7646
7646
|
const value = getter();
|
|
7647
|
-
assignProp(this,
|
|
7647
|
+
assignProp(this, key2, value);
|
|
7648
7648
|
return value;
|
|
7649
7649
|
},
|
|
7650
7650
|
enumerable: true,
|
|
7651
7651
|
configurable: true
|
|
7652
7652
|
});
|
|
7653
7653
|
}
|
|
7654
|
-
function putProp(target,
|
|
7655
|
-
if (
|
|
7656
|
-
assignProp(target,
|
|
7654
|
+
function putProp(target, key2, value) {
|
|
7655
|
+
if (key2 in target)
|
|
7656
|
+
assignProp(target, key2, value);
|
|
7657
7657
|
else
|
|
7658
|
-
target[
|
|
7658
|
+
target[key2] = value;
|
|
7659
7659
|
}
|
|
7660
7660
|
function mirrorShape(target, source, keys, wrap) {
|
|
7661
7661
|
const raw = sourceShape(source);
|
|
7662
|
-
for (const
|
|
7663
|
-
const desc = Object.getOwnPropertyDescriptor(raw,
|
|
7662
|
+
for (const key2 of keys) {
|
|
7663
|
+
const desc = Object.getOwnPropertyDescriptor(raw, key2);
|
|
7664
7664
|
if (!desc.enumerable)
|
|
7665
7665
|
continue;
|
|
7666
7666
|
if (desc.get) {
|
|
7667
|
-
deferProp(target,
|
|
7668
|
-
const value = source._zod.def.shape[
|
|
7669
|
-
return wrap ? wrap(value,
|
|
7667
|
+
deferProp(target, key2, () => {
|
|
7668
|
+
const value = source._zod.def.shape[key2];
|
|
7669
|
+
return wrap ? wrap(value, key2) : value;
|
|
7670
7670
|
});
|
|
7671
7671
|
} else
|
|
7672
|
-
putProp(target,
|
|
7672
|
+
putProp(target, key2, wrap ? wrap(desc.value, key2) : desc.value);
|
|
7673
7673
|
}
|
|
7674
7674
|
}
|
|
7675
7675
|
function mirrorProps(target, source) {
|
|
7676
|
-
for (const
|
|
7677
|
-
const desc = Object.getOwnPropertyDescriptor(source,
|
|
7676
|
+
for (const key2 of Reflect.ownKeys(source)) {
|
|
7677
|
+
const desc = Object.getOwnPropertyDescriptor(source, key2);
|
|
7678
7678
|
if (!desc.enumerable)
|
|
7679
7679
|
continue;
|
|
7680
7680
|
if (desc.get)
|
|
7681
|
-
deferProp(target,
|
|
7681
|
+
deferProp(target, key2, () => source[key2]);
|
|
7682
7682
|
else
|
|
7683
|
-
putProp(target,
|
|
7683
|
+
putProp(target, key2, desc.value);
|
|
7684
7684
|
}
|
|
7685
7685
|
}
|
|
7686
7686
|
function mergeDefs(...defs) {
|
|
@@ -7697,11 +7697,11 @@ function cloneDef(schema) {
|
|
|
7697
7697
|
function getElementAtPath(obj, path) {
|
|
7698
7698
|
if (!path)
|
|
7699
7699
|
return obj;
|
|
7700
|
-
return path.reduce((acc,
|
|
7700
|
+
return path.reduce((acc, key2) => acc?.[key2], obj);
|
|
7701
7701
|
}
|
|
7702
7702
|
function promiseAllObject(promisesObj) {
|
|
7703
7703
|
const keys = Object.keys(promisesObj);
|
|
7704
|
-
const promises = keys.map((
|
|
7704
|
+
const promises = keys.map((key2) => promisesObj[key2]);
|
|
7705
7705
|
return Promise.all(promises).then((results) => {
|
|
7706
7706
|
const resolvedObj = {};
|
|
7707
7707
|
for (let i = 0; i < keys.length; i++) {
|
|
@@ -7773,8 +7773,8 @@ function shallowClone(o) {
|
|
|
7773
7773
|
}
|
|
7774
7774
|
function numKeys(data) {
|
|
7775
7775
|
let keyCount = 0;
|
|
7776
|
-
for (const
|
|
7777
|
-
if (Object.prototype.hasOwnProperty.call(data,
|
|
7776
|
+
for (const key2 in data) {
|
|
7777
|
+
if (Object.prototype.hasOwnProperty.call(data, key2)) {
|
|
7778
7778
|
keyCount++;
|
|
7779
7779
|
}
|
|
7780
7780
|
}
|
|
@@ -7928,12 +7928,12 @@ function pick(schema, mask) {
|
|
|
7928
7928
|
function maskedKeys(schema, mask) {
|
|
7929
7929
|
const raw = sourceShape(schema);
|
|
7930
7930
|
const keys = [];
|
|
7931
|
-
for (const
|
|
7932
|
-
if (!Object.getOwnPropertyDescriptor(raw,
|
|
7933
|
-
throw new Error(`Unrecognized key: "${String(
|
|
7931
|
+
for (const key2 of Reflect.ownKeys(mask)) {
|
|
7932
|
+
if (!Object.getOwnPropertyDescriptor(raw, key2)?.enumerable) {
|
|
7933
|
+
throw new Error(`Unrecognized key: "${String(key2)}"`);
|
|
7934
7934
|
}
|
|
7935
|
-
if (mask[
|
|
7936
|
-
keys.push(
|
|
7935
|
+
if (mask[key2])
|
|
7936
|
+
keys.push(key2);
|
|
7937
7937
|
}
|
|
7938
7938
|
return keys;
|
|
7939
7939
|
}
|
|
@@ -7946,7 +7946,7 @@ function omit(schema, mask) {
|
|
|
7946
7946
|
}
|
|
7947
7947
|
const omitted = new Set(maskedKeys(schema, mask));
|
|
7948
7948
|
const newShape = {};
|
|
7949
|
-
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((
|
|
7949
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key2) => !omitted.has(key2)));
|
|
7950
7950
|
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
|
|
7951
7951
|
}
|
|
7952
7952
|
function extend(schema, shape) {
|
|
@@ -7957,8 +7957,8 @@ function extend(schema, shape) {
|
|
|
7957
7957
|
const hasChecks = checks && checks.length > 0;
|
|
7958
7958
|
if (hasChecks) {
|
|
7959
7959
|
const existingShape = sourceShape(schema);
|
|
7960
|
-
for (const
|
|
7961
|
-
if (Object.getOwnPropertyDescriptor(existingShape,
|
|
7960
|
+
for (const key2 of Reflect.ownKeys(shape)) {
|
|
7961
|
+
if (Object.getOwnPropertyDescriptor(existingShape, key2) !== void 0) {
|
|
7962
7962
|
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
7963
7963
|
}
|
|
7964
7964
|
}
|
|
@@ -8005,15 +8005,15 @@ function partial(Class2, schema, mask, name = "partial") {
|
|
|
8005
8005
|
}
|
|
8006
8006
|
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
8007
8007
|
const newShape = {};
|
|
8008
|
-
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class2 && ((value,
|
|
8008
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class2 && ((value, key2) => selected && !selected.has(key2) ? value : new Class2({ type: "optional", innerType: value })));
|
|
8009
8009
|
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape, checks: [] }));
|
|
8010
8010
|
}
|
|
8011
8011
|
function required(Class2, schema, mask) {
|
|
8012
8012
|
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
8013
8013
|
const newShape = {};
|
|
8014
|
-
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value,
|
|
8014
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key2) => (
|
|
8015
8015
|
// overwrite with non-optional
|
|
8016
|
-
selected && !selected.has(
|
|
8016
|
+
selected && !selected.has(key2) ? value : new Class2({ type: "nonoptional", innerType: value })
|
|
8017
8017
|
));
|
|
8018
8018
|
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
|
|
8019
8019
|
}
|
|
@@ -8188,46 +8188,46 @@ var Class = class {
|
|
|
8188
8188
|
}
|
|
8189
8189
|
};
|
|
8190
8190
|
function members(proto, table2) {
|
|
8191
|
-
for (const
|
|
8192
|
-
const desc = Object.getOwnPropertyDescriptor(table2,
|
|
8191
|
+
for (const key2 in table2) {
|
|
8192
|
+
const desc = Object.getOwnPropertyDescriptor(table2, key2);
|
|
8193
8193
|
if (desc.get)
|
|
8194
|
-
Object.defineProperty(proto,
|
|
8194
|
+
Object.defineProperty(proto, key2, { ...desc, enumerable: false });
|
|
8195
8195
|
else
|
|
8196
|
-
defineBound(proto,
|
|
8196
|
+
defineBound(proto, key2, desc.value);
|
|
8197
8197
|
}
|
|
8198
8198
|
}
|
|
8199
|
-
function own(inst,
|
|
8200
|
-
Object.defineProperty(inst,
|
|
8199
|
+
function own(inst, key2, value, enumerable = true) {
|
|
8200
|
+
Object.defineProperty(inst, key2, { configurable: true, writable: true, enumerable, value });
|
|
8201
8201
|
return value;
|
|
8202
8202
|
}
|
|
8203
|
-
function hide(inst,
|
|
8204
|
-
return own(inst,
|
|
8203
|
+
function hide(inst, key2, value) {
|
|
8204
|
+
return own(inst, key2, value, false);
|
|
8205
8205
|
}
|
|
8206
8206
|
// @__NO_SIDE_EFFECTS__
|
|
8207
8207
|
function derived(computes, table2) {
|
|
8208
|
-
for (const
|
|
8209
|
-
const compute = computes[
|
|
8210
|
-
Object.defineProperty(table2,
|
|
8208
|
+
for (const key2 in computes) {
|
|
8209
|
+
const compute = computes[key2];
|
|
8210
|
+
Object.defineProperty(table2, key2, {
|
|
8211
8211
|
configurable: true,
|
|
8212
8212
|
enumerable: true,
|
|
8213
8213
|
get() {
|
|
8214
|
-
return own(this,
|
|
8214
|
+
return own(this, key2, compute(this));
|
|
8215
8215
|
},
|
|
8216
8216
|
set(value) {
|
|
8217
|
-
own(this,
|
|
8217
|
+
own(this, key2, value);
|
|
8218
8218
|
}
|
|
8219
8219
|
});
|
|
8220
8220
|
}
|
|
8221
8221
|
return table2;
|
|
8222
8222
|
}
|
|
8223
|
-
function defineBound(proto,
|
|
8224
|
-
Object.defineProperty(proto,
|
|
8223
|
+
function defineBound(proto, key2, fn) {
|
|
8224
|
+
Object.defineProperty(proto, key2, {
|
|
8225
8225
|
configurable: true,
|
|
8226
8226
|
get() {
|
|
8227
|
-
return this == null ? fn : own(this,
|
|
8227
|
+
return this == null ? fn : own(this, key2, fn.bind(this));
|
|
8228
8228
|
},
|
|
8229
8229
|
set(value) {
|
|
8230
|
-
own(this,
|
|
8230
|
+
own(this, key2, value);
|
|
8231
8231
|
}
|
|
8232
8232
|
});
|
|
8233
8233
|
}
|
|
@@ -8244,53 +8244,53 @@ var breaker = {
|
|
|
8244
8244
|
return void 0;
|
|
8245
8245
|
}
|
|
8246
8246
|
};
|
|
8247
|
-
function defineLazyInternal(inst,
|
|
8247
|
+
function defineLazyInternal(inst, key2, compute) {
|
|
8248
8248
|
const proto = Object.getPrototypeOf(inst._zod);
|
|
8249
|
-
if (
|
|
8249
|
+
if (key2 in proto && installing !== inst._zod) {
|
|
8250
8250
|
installing = void 0;
|
|
8251
8251
|
return;
|
|
8252
8252
|
}
|
|
8253
8253
|
installing = inst._zod;
|
|
8254
|
-
Object.defineProperty(proto,
|
|
8254
|
+
Object.defineProperty(proto, key2, {
|
|
8255
8255
|
configurable: true,
|
|
8256
8256
|
get() {
|
|
8257
|
-
Object.defineProperty(this,
|
|
8257
|
+
Object.defineProperty(this, key2, breaker);
|
|
8258
8258
|
const outer = broke;
|
|
8259
8259
|
broke = false;
|
|
8260
8260
|
try {
|
|
8261
8261
|
const value = compute(this);
|
|
8262
8262
|
if (broke)
|
|
8263
|
-
delete this[
|
|
8263
|
+
delete this[key2];
|
|
8264
8264
|
else
|
|
8265
|
-
Object.defineProperty(this,
|
|
8265
|
+
Object.defineProperty(this, key2, { configurable: true, writable: true, value });
|
|
8266
8266
|
broke = broke || outer;
|
|
8267
8267
|
return value;
|
|
8268
8268
|
} catch (err) {
|
|
8269
|
-
delete this[
|
|
8269
|
+
delete this[key2];
|
|
8270
8270
|
broke = broke || outer;
|
|
8271
8271
|
throw err;
|
|
8272
8272
|
}
|
|
8273
8273
|
},
|
|
8274
8274
|
set(value) {
|
|
8275
|
-
Object.defineProperty(this,
|
|
8275
|
+
Object.defineProperty(this, key2, { configurable: true, writable: true, value });
|
|
8276
8276
|
}
|
|
8277
8277
|
});
|
|
8278
8278
|
}
|
|
8279
|
-
function installLazyProp(inst,
|
|
8280
|
-
const proto = claim(inst,
|
|
8279
|
+
function installLazyProp(inst, key2, make, enumerable) {
|
|
8280
|
+
const proto = claim(inst, key2);
|
|
8281
8281
|
if (!proto)
|
|
8282
8282
|
return;
|
|
8283
|
-
Object.defineProperty(proto,
|
|
8283
|
+
Object.defineProperty(proto, key2, {
|
|
8284
8284
|
configurable: true,
|
|
8285
8285
|
get() {
|
|
8286
8286
|
const desc = { configurable: true, writable: true, enumerable, value: void 0 };
|
|
8287
|
-
Object.defineProperty(this,
|
|
8287
|
+
Object.defineProperty(this, key2, desc);
|
|
8288
8288
|
desc.value = make(this);
|
|
8289
|
-
Object.defineProperty(this,
|
|
8289
|
+
Object.defineProperty(this, key2, desc);
|
|
8290
8290
|
return desc.value;
|
|
8291
8291
|
},
|
|
8292
8292
|
set(value) {
|
|
8293
|
-
Object.defineProperty(this,
|
|
8293
|
+
Object.defineProperty(this, key2, { configurable: true, writable: true, enumerable, value });
|
|
8294
8294
|
}
|
|
8295
8295
|
});
|
|
8296
8296
|
}
|
|
@@ -8463,15 +8463,15 @@ var $ZodError = $constructor("$ZodError", initializer);
|
|
|
8463
8463
|
var $ZodRealError = $constructor("$ZodError", initializer, void 0, {
|
|
8464
8464
|
Parent: Error
|
|
8465
8465
|
});
|
|
8466
|
-
function node(obj,
|
|
8467
|
-
if (!Object.prototype.hasOwnProperty.call(obj,
|
|
8468
|
-
if (
|
|
8469
|
-
Object.defineProperty(obj,
|
|
8466
|
+
function node(obj, key2, make) {
|
|
8467
|
+
if (!Object.prototype.hasOwnProperty.call(obj, key2)) {
|
|
8468
|
+
if (key2 === "__proto__") {
|
|
8469
|
+
Object.defineProperty(obj, key2, { value: make(), writable: true, enumerable: true, configurable: true });
|
|
8470
8470
|
} else {
|
|
8471
|
-
obj[
|
|
8471
|
+
obj[key2] = make();
|
|
8472
8472
|
}
|
|
8473
8473
|
}
|
|
8474
|
-
return obj[
|
|
8474
|
+
return obj[key2];
|
|
8475
8475
|
}
|
|
8476
8476
|
function flattenError(error2, mapper = (issue2) => issue2.message) {
|
|
8477
8477
|
const fieldErrors = {};
|
|
@@ -9725,8 +9725,8 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
9725
9725
|
return payload;
|
|
9726
9726
|
};
|
|
9727
9727
|
});
|
|
9728
|
-
function handlePropertyResult(result2, final,
|
|
9729
|
-
const isPresent =
|
|
9728
|
+
function handlePropertyResult(result2, final, key2, input, optin, optout) {
|
|
9729
|
+
const isPresent = key2 in input;
|
|
9730
9730
|
const isOptionalOut = optout === "optional";
|
|
9731
9731
|
if (!isPresent && isOptionalOut && optin === "optional") {
|
|
9732
9732
|
return;
|
|
@@ -9735,7 +9735,7 @@ function handlePropertyResult(result2, final, key, input, optin, optout) {
|
|
|
9735
9735
|
if (optin !== void 0 && isOptionalOut && !isPresent) {
|
|
9736
9736
|
return;
|
|
9737
9737
|
}
|
|
9738
|
-
final.issues.push(...prefixIssues(
|
|
9738
|
+
final.issues.push(...prefixIssues(key2, result2.issues));
|
|
9739
9739
|
}
|
|
9740
9740
|
if (!isPresent && optin === void 0) {
|
|
9741
9741
|
if (!result2.issues.length) {
|
|
@@ -9743,17 +9743,17 @@ function handlePropertyResult(result2, final, key, input, optin, optout) {
|
|
|
9743
9743
|
code: "invalid_type",
|
|
9744
9744
|
expected: "nonoptional",
|
|
9745
9745
|
input: void 0,
|
|
9746
|
-
path: [
|
|
9746
|
+
path: [key2]
|
|
9747
9747
|
});
|
|
9748
9748
|
}
|
|
9749
9749
|
return;
|
|
9750
9750
|
}
|
|
9751
9751
|
if (result2.value === void 0) {
|
|
9752
9752
|
if (isPresent || optin === "defaulted" && !isOptionalOut) {
|
|
9753
|
-
final.value[
|
|
9753
|
+
final.value[key2] = void 0;
|
|
9754
9754
|
}
|
|
9755
9755
|
} else {
|
|
9756
|
-
final.value[
|
|
9756
|
+
final.value[key2] = result2.value;
|
|
9757
9757
|
}
|
|
9758
9758
|
}
|
|
9759
9759
|
var NO_SYMBOL_KEYS = [];
|
|
@@ -9786,28 +9786,28 @@ function handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {
|
|
|
9786
9786
|
const optin = _catchall.optin;
|
|
9787
9787
|
const optout = _catchall.optout;
|
|
9788
9788
|
let seen = 0;
|
|
9789
|
-
for (const
|
|
9789
|
+
for (const key2 in input) {
|
|
9790
9790
|
if (abortEarly && payload.issues.length !== seen) {
|
|
9791
9791
|
if (aborted(payload, seen))
|
|
9792
9792
|
break;
|
|
9793
9793
|
seen = payload.issues.length;
|
|
9794
9794
|
}
|
|
9795
|
-
if (keySet.has(
|
|
9795
|
+
if (keySet.has(key2))
|
|
9796
9796
|
continue;
|
|
9797
|
-
if (
|
|
9797
|
+
if (key2 === "__proto__") {
|
|
9798
9798
|
if (t === "never")
|
|
9799
|
-
unrecognized.push(
|
|
9799
|
+
unrecognized.push(key2);
|
|
9800
9800
|
continue;
|
|
9801
9801
|
}
|
|
9802
9802
|
if (t === "never") {
|
|
9803
|
-
unrecognized.push(
|
|
9803
|
+
unrecognized.push(key2);
|
|
9804
9804
|
continue;
|
|
9805
9805
|
}
|
|
9806
|
-
const r = _catchall.run({ value: input[
|
|
9806
|
+
const r = _catchall.run({ value: input[key2], issues: [] }, ctx);
|
|
9807
9807
|
if (r instanceof Promise) {
|
|
9808
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload,
|
|
9808
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key2, input, optin, optout)));
|
|
9809
9809
|
} else {
|
|
9810
|
-
handlePropertyResult(r, payload,
|
|
9810
|
+
handlePropertyResult(r, payload, key2, input, optin, optout);
|
|
9811
9811
|
}
|
|
9812
9812
|
}
|
|
9813
9813
|
if (unrecognized.length) {
|
|
@@ -9844,16 +9844,16 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
9844
9844
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
9845
9845
|
const shape = zod.def.shape;
|
|
9846
9846
|
const propValues = {};
|
|
9847
|
-
for (const
|
|
9848
|
-
const field = shape[
|
|
9847
|
+
for (const key2 in shape) {
|
|
9848
|
+
const field = shape[key2]._zod;
|
|
9849
9849
|
if (field.values) {
|
|
9850
|
-
if (!Object.prototype.hasOwnProperty.call(propValues,
|
|
9851
|
-
assignProp(propValues,
|
|
9850
|
+
if (!Object.prototype.hasOwnProperty.call(propValues, key2)) {
|
|
9851
|
+
assignProp(propValues, key2, /* @__PURE__ */ new Set());
|
|
9852
9852
|
}
|
|
9853
9853
|
for (const v of field.values)
|
|
9854
|
-
propValues[
|
|
9854
|
+
propValues[key2].add(v);
|
|
9855
9855
|
if (field.optin !== void 0)
|
|
9856
|
-
propValues[
|
|
9856
|
+
propValues[key2].add(void 0);
|
|
9857
9857
|
}
|
|
9858
9858
|
}
|
|
9859
9859
|
return propValues;
|
|
@@ -9880,22 +9880,22 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
9880
9880
|
const shape = value.shape;
|
|
9881
9881
|
const abortEarly = ctx?.abortEarly;
|
|
9882
9882
|
let seen = payload.issues.length;
|
|
9883
|
-
for (const
|
|
9883
|
+
for (const key2 of value.allKeys) {
|
|
9884
9884
|
if (abortEarly && payload.issues.length !== seen) {
|
|
9885
9885
|
if (aborted(payload, seen))
|
|
9886
9886
|
break;
|
|
9887
9887
|
seen = payload.issues.length;
|
|
9888
9888
|
}
|
|
9889
|
-
if (
|
|
9889
|
+
if (key2 === "__proto__")
|
|
9890
9890
|
continue;
|
|
9891
|
-
const el = shape[
|
|
9891
|
+
const el = shape[key2];
|
|
9892
9892
|
const optin = el._zod.optin;
|
|
9893
9893
|
const optout = el._zod.optout;
|
|
9894
|
-
const r = el._zod.run({ value: input[
|
|
9894
|
+
const r = el._zod.run({ value: input[key2], issues: [] }, ctx);
|
|
9895
9895
|
if (r instanceof Promise) {
|
|
9896
|
-
proms.push(r.then((r2) => handlePropertyResult(r2, payload,
|
|
9896
|
+
proms.push(r.then((r2) => handlePropertyResult(r2, payload, key2, input, optin, optout)));
|
|
9897
9897
|
} else {
|
|
9898
|
-
handlePropertyResult(r, payload,
|
|
9898
|
+
handlePropertyResult(r, payload, key2, input, optin, optout);
|
|
9899
9899
|
}
|
|
9900
9900
|
}
|
|
9901
9901
|
if (!catchall) {
|
|
@@ -9929,17 +9929,17 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
|
|
|
9929
9929
|
doc.write(`const input = payload.value;`);
|
|
9930
9930
|
const ids = /* @__PURE__ */ Object.create(null);
|
|
9931
9931
|
let counter = 0;
|
|
9932
|
-
for (const
|
|
9933
|
-
ids[
|
|
9932
|
+
for (const key2 of normalized.allKeys) {
|
|
9933
|
+
ids[key2] = `key_${counter++}`;
|
|
9934
9934
|
}
|
|
9935
9935
|
doc.write(memo2 ? `const newResult = memo.alloc(inst, payload, {}, ctx);` : `const newResult = {};`);
|
|
9936
|
-
for (const
|
|
9937
|
-
if (
|
|
9936
|
+
for (const key2 of normalized.allKeys) {
|
|
9937
|
+
if (key2 === "__proto__")
|
|
9938
9938
|
continue;
|
|
9939
|
-
const id2 = ids[
|
|
9940
|
-
const k = typeof
|
|
9939
|
+
const id2 = ids[key2];
|
|
9940
|
+
const k = typeof key2 === "symbol" ? `syms[${syms.indexOf(key2)}]` : esc(key2);
|
|
9941
9941
|
const isPresent = `${k} in input`;
|
|
9942
|
-
const schema = shape[
|
|
9942
|
+
const schema = shape[key2];
|
|
9943
9943
|
const optin = schema?._zod?.optin;
|
|
9944
9944
|
const isOptionalIn = optin !== void 0;
|
|
9945
9945
|
const isOptionalOut = schema?._zod?.optout === "optional";
|
|
@@ -10203,21 +10203,21 @@ function mergeValues(a, b) {
|
|
|
10203
10203
|
}
|
|
10204
10204
|
if (isPlainObject(a) && isPlainObject(b)) {
|
|
10205
10205
|
const bKeys = Object.keys(b);
|
|
10206
|
-
const sharedKeys = Object.keys(a).filter((
|
|
10206
|
+
const sharedKeys = Object.keys(a).filter((key2) => bKeys.indexOf(key2) !== -1);
|
|
10207
10207
|
const newObj = { ...a, ...b };
|
|
10208
10208
|
if (Object.prototype.hasOwnProperty.call(newObj, "__proto__"))
|
|
10209
10209
|
delete newObj.__proto__;
|
|
10210
|
-
for (const
|
|
10211
|
-
if (
|
|
10210
|
+
for (const key2 of sharedKeys) {
|
|
10211
|
+
if (key2 === "__proto__")
|
|
10212
10212
|
continue;
|
|
10213
|
-
const sharedValue = mergeValues(a[
|
|
10213
|
+
const sharedValue = mergeValues(a[key2], b[key2]);
|
|
10214
10214
|
if (!sharedValue.valid) {
|
|
10215
10215
|
return {
|
|
10216
10216
|
valid: false,
|
|
10217
|
-
mergeErrorPath: [
|
|
10217
|
+
mergeErrorPath: [key2, ...sharedValue.mergeErrorPath]
|
|
10218
10218
|
};
|
|
10219
10219
|
}
|
|
10220
|
-
newObj[
|
|
10220
|
+
newObj[key2] = sharedValue.data;
|
|
10221
10221
|
}
|
|
10222
10222
|
return { valid: true, data: newObj };
|
|
10223
10223
|
}
|
|
@@ -10313,12 +10313,12 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
10313
10313
|
if (values && !def.partial) {
|
|
10314
10314
|
payload.value = memo2 ? memo2.alloc(inst, payload, {}, ctx) : {};
|
|
10315
10315
|
const recordKeys = /* @__PURE__ */ new Set();
|
|
10316
|
-
for (const
|
|
10317
|
-
if (typeof
|
|
10318
|
-
recordKeys.add(typeof
|
|
10319
|
-
if (
|
|
10316
|
+
for (const key2 of values) {
|
|
10317
|
+
if (typeof key2 === "string" || typeof key2 === "number" || typeof key2 === "symbol") {
|
|
10318
|
+
recordKeys.add(typeof key2 === "number" ? key2.toString() : key2);
|
|
10319
|
+
if (key2 === "__proto__")
|
|
10320
10320
|
continue;
|
|
10321
|
-
const keyResult = def.keyType._zod.run({ value:
|
|
10321
|
+
const keyResult = def.keyType._zod.run({ value: key2, issues: [] }, ctx);
|
|
10322
10322
|
if (keyResult instanceof Promise) {
|
|
10323
10323
|
throw new Error("Async schemas not supported in object keys currently");
|
|
10324
10324
|
}
|
|
@@ -10327,8 +10327,8 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
10327
10327
|
code: "invalid_key",
|
|
10328
10328
|
origin: "record",
|
|
10329
10329
|
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
10330
|
-
input:
|
|
10331
|
-
path: [
|
|
10330
|
+
input: key2,
|
|
10331
|
+
path: [key2],
|
|
10332
10332
|
inst
|
|
10333
10333
|
});
|
|
10334
10334
|
continue;
|
|
@@ -10336,32 +10336,32 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
10336
10336
|
const outKey = keyResult.value;
|
|
10337
10337
|
if (outKey === "__proto__")
|
|
10338
10338
|
continue;
|
|
10339
|
-
const result2 = def.valueType._zod.run({ value: input[
|
|
10339
|
+
const result2 = def.valueType._zod.run({ value: input[key2], issues: [] }, ctx);
|
|
10340
10340
|
if (result2 instanceof Promise) {
|
|
10341
10341
|
proms.push(result2.then((result3) => {
|
|
10342
10342
|
if (result3.issues.length) {
|
|
10343
|
-
payload.issues.push(...prefixIssues(
|
|
10343
|
+
payload.issues.push(...prefixIssues(key2, result3.issues));
|
|
10344
10344
|
}
|
|
10345
10345
|
payload.value[outKey] = result3.value;
|
|
10346
10346
|
}));
|
|
10347
10347
|
} else {
|
|
10348
10348
|
if (result2.issues.length) {
|
|
10349
|
-
payload.issues.push(...prefixIssues(
|
|
10349
|
+
payload.issues.push(...prefixIssues(key2, result2.issues));
|
|
10350
10350
|
}
|
|
10351
10351
|
payload.value[outKey] = result2.value;
|
|
10352
10352
|
}
|
|
10353
10353
|
}
|
|
10354
10354
|
}
|
|
10355
10355
|
let unrecognized;
|
|
10356
|
-
for (const
|
|
10357
|
-
if (!recordKeys.has(
|
|
10356
|
+
for (const key2 in input) {
|
|
10357
|
+
if (!recordKeys.has(key2)) {
|
|
10358
10358
|
if (def.mode === "loose") {
|
|
10359
|
-
if (
|
|
10359
|
+
if (key2 === "__proto__")
|
|
10360
10360
|
continue;
|
|
10361
|
-
payload.value[
|
|
10361
|
+
payload.value[key2] = input[key2];
|
|
10362
10362
|
} else {
|
|
10363
10363
|
unrecognized = unrecognized ?? [];
|
|
10364
|
-
unrecognized.push(
|
|
10364
|
+
unrecognized.push(key2);
|
|
10365
10365
|
}
|
|
10366
10366
|
}
|
|
10367
10367
|
}
|
|
@@ -10377,18 +10377,18 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
10377
10377
|
} else {
|
|
10378
10378
|
payload.value = memo2 ? memo2.alloc(inst, payload, {}, ctx) : {};
|
|
10379
10379
|
let unrecognized;
|
|
10380
|
-
for (const
|
|
10381
|
-
if (
|
|
10380
|
+
for (const key2 of Reflect.ownKeys(input)) {
|
|
10381
|
+
if (key2 === "__proto__")
|
|
10382
10382
|
continue;
|
|
10383
|
-
if (!Object.prototype.propertyIsEnumerable.call(input,
|
|
10383
|
+
if (!Object.prototype.propertyIsEnumerable.call(input, key2))
|
|
10384
10384
|
continue;
|
|
10385
|
-
let keyResult = def.keyType._zod.run({ value:
|
|
10385
|
+
let keyResult = def.keyType._zod.run({ value: key2, issues: [] }, ctx);
|
|
10386
10386
|
if (keyResult instanceof Promise) {
|
|
10387
10387
|
throw new Error("Async schemas not supported in object keys currently");
|
|
10388
10388
|
}
|
|
10389
|
-
const checkNumericKey = typeof
|
|
10389
|
+
const checkNumericKey = typeof key2 === "string" && number.test(key2) && keyResult.issues.length;
|
|
10390
10390
|
if (checkNumericKey) {
|
|
10391
|
-
const retryResult = def.keyType._zod.run({ value: Number(
|
|
10391
|
+
const retryResult = def.keyType._zod.run({ value: Number(key2), issues: [] }, ctx);
|
|
10392
10392
|
if (retryResult instanceof Promise) {
|
|
10393
10393
|
throw new Error("Async schemas not supported in object keys currently");
|
|
10394
10394
|
}
|
|
@@ -10398,17 +10398,17 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
10398
10398
|
}
|
|
10399
10399
|
if (keyResult.issues.length) {
|
|
10400
10400
|
if (def.mode === "loose") {
|
|
10401
|
-
payload.value[
|
|
10401
|
+
payload.value[key2] = input[key2];
|
|
10402
10402
|
} else if (values) {
|
|
10403
10403
|
unrecognized = unrecognized ?? [];
|
|
10404
|
-
unrecognized.push(
|
|
10404
|
+
unrecognized.push(key2);
|
|
10405
10405
|
} else {
|
|
10406
10406
|
payload.issues.push({
|
|
10407
10407
|
code: "invalid_key",
|
|
10408
10408
|
origin: "record",
|
|
10409
10409
|
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
10410
|
-
input:
|
|
10411
|
-
path: [
|
|
10410
|
+
input: key2,
|
|
10411
|
+
path: [key2],
|
|
10412
10412
|
inst
|
|
10413
10413
|
});
|
|
10414
10414
|
}
|
|
@@ -10417,17 +10417,17 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
10417
10417
|
const outKey = keyResult.value;
|
|
10418
10418
|
if (outKey === "__proto__")
|
|
10419
10419
|
continue;
|
|
10420
|
-
const result2 = def.valueType._zod.run({ value: input[
|
|
10420
|
+
const result2 = def.valueType._zod.run({ value: input[key2], issues: [] }, ctx);
|
|
10421
10421
|
if (result2 instanceof Promise) {
|
|
10422
10422
|
proms.push(result2.then((result3) => {
|
|
10423
10423
|
if (result3.issues.length) {
|
|
10424
|
-
payload.issues.push(...prefixIssues(
|
|
10424
|
+
payload.issues.push(...prefixIssues(key2, result3.issues));
|
|
10425
10425
|
}
|
|
10426
10426
|
payload.value[outKey] = result3.value;
|
|
10427
10427
|
}));
|
|
10428
10428
|
} else {
|
|
10429
10429
|
if (result2.issues.length) {
|
|
10430
|
-
payload.issues.push(...prefixIssues(
|
|
10430
|
+
payload.issues.push(...prefixIssues(key2, result2.issues));
|
|
10431
10431
|
}
|
|
10432
10432
|
payload.value[outKey] = result2.value;
|
|
10433
10433
|
}
|
|
@@ -10789,8 +10789,8 @@ function isRecursive(inst, stack, resolve11) {
|
|
|
10789
10789
|
};
|
|
10790
10790
|
const shape = (sh, spread) => {
|
|
10791
10791
|
let answer = NONE;
|
|
10792
|
-
for (const
|
|
10793
|
-
const desc = Object.getOwnPropertyDescriptor(sh,
|
|
10792
|
+
for (const key2 of Reflect.ownKeys(sh)) {
|
|
10793
|
+
const desc = Object.getOwnPropertyDescriptor(sh, key2);
|
|
10794
10794
|
if (spread && !desc.enumerable)
|
|
10795
10795
|
continue;
|
|
10796
10796
|
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve11) : NONE;
|
|
@@ -10886,8 +10886,8 @@ function isRecursive(inst, stack, resolve11) {
|
|
|
10886
10886
|
break;
|
|
10887
10887
|
default: {
|
|
10888
10888
|
kind;
|
|
10889
|
-
for (const
|
|
10890
|
-
const desc = Object.getOwnPropertyDescriptor(def,
|
|
10889
|
+
for (const key2 in def) {
|
|
10890
|
+
const desc = Object.getOwnPropertyDescriptor(def, key2);
|
|
10891
10891
|
if (!desc || desc.get)
|
|
10892
10892
|
continue;
|
|
10893
10893
|
const value = desc.value;
|
|
@@ -11730,9 +11730,9 @@ function _check(fn, params) {
|
|
|
11730
11730
|
// node_modules/zod/v4/core/to-json-schema.js
|
|
11731
11731
|
function assignProps(target, ...sources) {
|
|
11732
11732
|
for (const source of sources) {
|
|
11733
|
-
for (const
|
|
11734
|
-
if (Object.prototype.propertyIsEnumerable.call(source,
|
|
11735
|
-
assignProp(target,
|
|
11733
|
+
for (const key2 of Reflect.ownKeys(source)) {
|
|
11734
|
+
if (Object.prototype.propertyIsEnumerable.call(source, key2)) {
|
|
11735
|
+
assignProp(target, key2, source[key2]);
|
|
11736
11736
|
}
|
|
11737
11737
|
}
|
|
11738
11738
|
}
|
|
@@ -11878,8 +11878,8 @@ function extractDefs(ctx, schema) {
|
|
|
11878
11878
|
if (defId)
|
|
11879
11879
|
seen.defId = defId;
|
|
11880
11880
|
const schema2 = seen.schema;
|
|
11881
|
-
for (const
|
|
11882
|
-
delete schema2[
|
|
11881
|
+
for (const key2 in schema2) {
|
|
11882
|
+
delete schema2[key2];
|
|
11883
11883
|
}
|
|
11884
11884
|
schema2.$ref = ref;
|
|
11885
11885
|
};
|
|
@@ -11960,8 +11960,8 @@ function foldObjects(members2) {
|
|
|
11960
11960
|
for (const member of members2) {
|
|
11961
11961
|
if (typeof member !== "object" || member.type !== "object")
|
|
11962
11962
|
return null;
|
|
11963
|
-
for (const
|
|
11964
|
-
if (!FOLDABLE_KEYS.has(
|
|
11963
|
+
for (const key2 in member) {
|
|
11964
|
+
if (!FOLDABLE_KEYS.has(key2))
|
|
11965
11965
|
return null;
|
|
11966
11966
|
}
|
|
11967
11967
|
objects.push(member);
|
|
@@ -11969,22 +11969,22 @@ function foldObjects(members2) {
|
|
|
11969
11969
|
const properties = {};
|
|
11970
11970
|
const required2 = /* @__PURE__ */ new Set();
|
|
11971
11971
|
for (const object6 of objects) {
|
|
11972
|
-
for (const
|
|
11973
|
-
if (Object.prototype.hasOwnProperty.call(properties,
|
|
11972
|
+
for (const key2 in object6.properties) {
|
|
11973
|
+
if (Object.prototype.hasOwnProperty.call(properties, key2))
|
|
11974
11974
|
continue;
|
|
11975
11975
|
const parts = [];
|
|
11976
11976
|
for (const other of objects) {
|
|
11977
|
-
const part = other.properties?.[
|
|
11977
|
+
const part = other.properties?.[key2] ?? undeclaredConstraint(other);
|
|
11978
11978
|
if (part === null || part === void 0)
|
|
11979
11979
|
continue;
|
|
11980
11980
|
if (!parts.some((seen) => JSON.stringify(seen) === JSON.stringify(part)))
|
|
11981
11981
|
parts.push(part);
|
|
11982
11982
|
}
|
|
11983
11983
|
const merged = parts.length === 1 ? parts[0] : foldObjects(parts) ?? { allOf: parts };
|
|
11984
|
-
assignProp(properties,
|
|
11984
|
+
assignProp(properties, key2, merged);
|
|
11985
11985
|
}
|
|
11986
|
-
for (const
|
|
11987
|
-
required2.add(
|
|
11986
|
+
for (const key2 of object6.required ?? [])
|
|
11987
|
+
required2.add(key2);
|
|
11988
11988
|
}
|
|
11989
11989
|
const folded = { type: "object", properties };
|
|
11990
11990
|
if (required2.size)
|
|
@@ -12009,8 +12009,8 @@ function foldIntersection(json2) {
|
|
|
12009
12009
|
const allOf = json2.allOf;
|
|
12010
12010
|
if (!Array.isArray(allOf) || allOf.length < 2)
|
|
12011
12011
|
return;
|
|
12012
|
-
for (const
|
|
12013
|
-
if (
|
|
12012
|
+
for (const key2 of FOLDABLE_KEYS)
|
|
12013
|
+
if (key2 in json2)
|
|
12014
12014
|
return;
|
|
12015
12015
|
const unions = allOf.filter((m) => UNION_KEYS.some((k) => Array.isArray(m[k])));
|
|
12016
12016
|
let folded = null;
|
|
@@ -12057,20 +12057,20 @@ function finalize(ctx, schema) {
|
|
|
12057
12057
|
assignProps(schema2, _cached);
|
|
12058
12058
|
const isParentRef = zodSchema._zod.parent === ref;
|
|
12059
12059
|
if (isParentRef) {
|
|
12060
|
-
for (const
|
|
12061
|
-
if (
|
|
12060
|
+
for (const key2 in schema2) {
|
|
12061
|
+
if (key2 === "$ref" || key2 === "allOf")
|
|
12062
12062
|
continue;
|
|
12063
|
-
if (!(
|
|
12064
|
-
delete schema2[
|
|
12063
|
+
if (!(key2 in _cached)) {
|
|
12064
|
+
delete schema2[key2];
|
|
12065
12065
|
}
|
|
12066
12066
|
}
|
|
12067
12067
|
}
|
|
12068
12068
|
if (refSchema.$ref && refSeen.def) {
|
|
12069
|
-
for (const
|
|
12070
|
-
if (
|
|
12069
|
+
for (const key2 in schema2) {
|
|
12070
|
+
if (key2 === "$ref" || key2 === "allOf")
|
|
12071
12071
|
continue;
|
|
12072
|
-
if (
|
|
12073
|
-
delete schema2[
|
|
12072
|
+
if (key2 in refSeen.def && JSON.stringify(schema2[key2]) === JSON.stringify(refSeen.def[key2])) {
|
|
12073
|
+
delete schema2[key2];
|
|
12074
12074
|
}
|
|
12075
12075
|
}
|
|
12076
12076
|
}
|
|
@@ -12082,11 +12082,11 @@ function finalize(ctx, schema) {
|
|
|
12082
12082
|
if (parentSeen?.schema.$ref) {
|
|
12083
12083
|
schema2.$ref = parentSeen.schema.$ref;
|
|
12084
12084
|
if (parentSeen.def) {
|
|
12085
|
-
for (const
|
|
12086
|
-
if (
|
|
12085
|
+
for (const key2 in schema2) {
|
|
12086
|
+
if (key2 === "$ref" || key2 === "allOf")
|
|
12087
12087
|
continue;
|
|
12088
|
-
if (
|
|
12089
|
-
delete schema2[
|
|
12088
|
+
if (key2 in parentSeen.def && JSON.stringify(schema2[key2]) === JSON.stringify(parentSeen.def[key2])) {
|
|
12089
|
+
delete schema2[key2];
|
|
12090
12090
|
}
|
|
12091
12091
|
}
|
|
12092
12092
|
}
|
|
@@ -12219,8 +12219,8 @@ function isTransforming(_schema, _ctx) {
|
|
|
12219
12219
|
return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
|
|
12220
12220
|
}
|
|
12221
12221
|
if (def.type === "object") {
|
|
12222
|
-
for (const
|
|
12223
|
-
if (isTransforming(def.shape[
|
|
12222
|
+
for (const key2 in def.shape) {
|
|
12223
|
+
if (isTransforming(def.shape[key2], ctx))
|
|
12224
12224
|
return true;
|
|
12225
12225
|
}
|
|
12226
12226
|
return false;
|
|
@@ -12258,13 +12258,13 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
|
|
|
12258
12258
|
};
|
|
12259
12259
|
|
|
12260
12260
|
// node_modules/zod/v4/core/json-schema-processors.js
|
|
12261
|
-
var narrowMin = (agg,
|
|
12262
|
-
if (agg[
|
|
12263
|
-
agg[
|
|
12261
|
+
var narrowMin = (agg, key2, value) => {
|
|
12262
|
+
if (agg[key2] === void 0 || value > agg[key2])
|
|
12263
|
+
agg[key2] = value;
|
|
12264
12264
|
};
|
|
12265
|
-
var narrowMax = (agg,
|
|
12266
|
-
if (agg[
|
|
12267
|
-
agg[
|
|
12265
|
+
var narrowMax = (agg, key2, value) => {
|
|
12266
|
+
if (agg[key2] === void 0 || value < agg[key2])
|
|
12267
|
+
agg[key2] = value;
|
|
12268
12268
|
};
|
|
12269
12269
|
var narrowBoth = (agg, value) => {
|
|
12270
12270
|
narrowMin(agg, "minimum", value);
|
|
@@ -12543,17 +12543,17 @@ var objectProcessor = (schema, ctx, _json, params) => {
|
|
|
12543
12543
|
}
|
|
12544
12544
|
json2.type = "object";
|
|
12545
12545
|
json2.properties = {};
|
|
12546
|
-
for (const
|
|
12547
|
-
assignProp(json2.properties,
|
|
12546
|
+
for (const key2 in shape) {
|
|
12547
|
+
assignProp(json2.properties, key2, processSchema(shape[key2], ctx, {
|
|
12548
12548
|
...params,
|
|
12549
|
-
path: [...params.path, "properties",
|
|
12549
|
+
path: [...params.path, "properties", key2]
|
|
12550
12550
|
}));
|
|
12551
12551
|
}
|
|
12552
12552
|
const requiredKeys = [];
|
|
12553
|
-
for (const
|
|
12554
|
-
const field = def.shape[
|
|
12553
|
+
for (const key2 of Object.keys(shape)) {
|
|
12554
|
+
const field = def.shape[key2];
|
|
12555
12555
|
if (ctx.io === "input" ? inputOptin(field) === void 0 : field._zod.optout === void 0) {
|
|
12556
|
-
requiredKeys.push(
|
|
12556
|
+
requiredKeys.push(key2);
|
|
12557
12557
|
}
|
|
12558
12558
|
}
|
|
12559
12559
|
if (requiredKeys.length > 0) {
|
|
@@ -12860,17 +12860,17 @@ function getLiteralValue(schema) {
|
|
|
12860
12860
|
|
|
12861
12861
|
// node_modules/zod/v4/classic/errors.js
|
|
12862
12862
|
var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
12863
|
-
function _lazyMethod(proto,
|
|
12864
|
-
Object.defineProperty(proto,
|
|
12863
|
+
function _lazyMethod(proto, key2, make) {
|
|
12864
|
+
Object.defineProperty(proto, key2, {
|
|
12865
12865
|
configurable: true,
|
|
12866
12866
|
enumerable: false,
|
|
12867
12867
|
get() {
|
|
12868
12868
|
const value = make(this);
|
|
12869
|
-
Object.defineProperty(this,
|
|
12869
|
+
Object.defineProperty(this, key2, { value, configurable: true, writable: true });
|
|
12870
12870
|
return value;
|
|
12871
12871
|
},
|
|
12872
12872
|
set(value) {
|
|
12873
|
-
Object.defineProperty(this,
|
|
12873
|
+
Object.defineProperty(this, key2, { value, configurable: true, writable: true });
|
|
12874
12874
|
}
|
|
12875
12875
|
});
|
|
12876
12876
|
}
|
|
@@ -16373,8 +16373,8 @@ function isPlainObject2(value) {
|
|
|
16373
16373
|
}
|
|
16374
16374
|
function mergeCapabilities(base, additional) {
|
|
16375
16375
|
const result2 = { ...base };
|
|
16376
|
-
for (const
|
|
16377
|
-
const k =
|
|
16376
|
+
for (const key2 in additional) {
|
|
16377
|
+
const k = key2;
|
|
16378
16378
|
const addValue = additional[k];
|
|
16379
16379
|
if (addValue === void 0)
|
|
16380
16380
|
continue;
|
|
@@ -17184,7 +17184,7 @@ var StdioServerTransport = class {
|
|
|
17184
17184
|
|
|
17185
17185
|
// src/manager.ts
|
|
17186
17186
|
import { randomUUID as randomUUID6 } from "node:crypto";
|
|
17187
|
-
import { mkdir as mkdir10, readFile as readFile9, readdir as readdir7, rm as
|
|
17187
|
+
import { mkdir as mkdir10, readFile as readFile9, readdir as readdir7, rm as rm5, cp, access, statfs } from "node:fs/promises";
|
|
17188
17188
|
import { join as join13, resolve as resolve9 } from "node:path";
|
|
17189
17189
|
|
|
17190
17190
|
// src/config.ts
|
|
@@ -17253,9 +17253,9 @@ function loadEnvironment(path, env = process.env, home = env.HOME ?? homedir())
|
|
|
17253
17253
|
let next = i + 1;
|
|
17254
17254
|
while (/\s/.test(text5[next] ?? "") && next < text5.length) next++;
|
|
17255
17255
|
if (depth === 1 && text5[next] === ":") {
|
|
17256
|
-
const
|
|
17257
|
-
if (seen.has(
|
|
17258
|
-
seen.add(
|
|
17256
|
+
const key2 = JSON.parse(text5.slice(start, i + 1));
|
|
17257
|
+
if (seen.has(key2)) throw new Error(`Duplicate environment profile key: ${key2}`);
|
|
17258
|
+
seen.add(key2);
|
|
17259
17259
|
}
|
|
17260
17260
|
} else if (text5[i] === "{" || text5[i] === "[") depth++;
|
|
17261
17261
|
else if (text5[i] === "}" || text5[i] === "]") depth--;
|
|
@@ -17266,24 +17266,24 @@ function loadEnvironment(path, env = process.env, home = env.HOME ?? homedir())
|
|
|
17266
17266
|
const p = raw;
|
|
17267
17267
|
if (p.schemaVersion !== 2 || typeof p.id !== "string" || !/^[a-z0-9][a-z0-9-]{0,47}$/.test(p.id)) throw new Error("Invalid environment schemaVersion or id");
|
|
17268
17268
|
const profile = { schemaVersion: 2, id: p.id, vmServiceUrl: endpoint(p.vmServiceUrl) };
|
|
17269
|
-
for (const
|
|
17269
|
+
for (const key2 of paths) profile[key2] = canonicalPath(p[key2]);
|
|
17270
17270
|
if (!statSync(profile.imageRepository).isDirectory() || !statSync(join(profile.imageRepository, "images")).isDirectory()) throw new Error("Selected imageRepository must contain images/");
|
|
17271
|
-
for (const
|
|
17272
|
-
if (!statSync(profile[
|
|
17273
|
-
accessSync(profile[
|
|
17271
|
+
for (const key2 of ["machctlPath", "tartPath"]) {
|
|
17272
|
+
if (!statSync(profile[key2]).isFile()) throw new Error(`${key2} must be a regular executable file`);
|
|
17273
|
+
accessSync(profile[key2], constants.X_OK);
|
|
17274
17274
|
}
|
|
17275
17275
|
const state = env.XDG_STATE_HOME ? canonicalPath(env.XDG_STATE_HOME) : join(canonicalPath(home), ".local/state");
|
|
17276
17276
|
const names = ["machine-service", "vm-service", "pilot-images", "mcp-relay", "mcp-vm-relay"];
|
|
17277
17277
|
const defaults = [join(canonicalPath(home), ".tart"), ...names.map((n) => join(state, n)), ...names.map((n) => join(canonicalPath(home), ".local/state", n))].map(canonicalPath);
|
|
17278
|
-
for (const
|
|
17279
|
-
const value = profile[
|
|
17278
|
+
for (const key2 of mutable) {
|
|
17279
|
+
const value = profile[key2];
|
|
17280
17280
|
try {
|
|
17281
|
-
if (!statSync(value).isDirectory()) throw new Error(`${
|
|
17281
|
+
if (!statSync(value).isDirectory()) throw new Error(`${key2} must be a directory`);
|
|
17282
17282
|
} catch (error2) {
|
|
17283
17283
|
if (error2.code !== "ENOENT") throw error2;
|
|
17284
17284
|
}
|
|
17285
|
-
if (overlaps(value, profile.imageRepository) || defaults.some((root) => overlaps(value, root))) throw new Error(`${
|
|
17286
|
-
for (const other of mutable) if (
|
|
17285
|
+
if (overlaps(value, profile.imageRepository) || defaults.some((root) => overlaps(value, root))) throw new Error(`${key2} overlaps the repository or a legacy default store/state root`);
|
|
17286
|
+
for (const other of mutable) if (key2 !== other && overlaps(value, profile[other])) throw new Error("Environment mutable roots must be disjoint");
|
|
17287
17287
|
}
|
|
17288
17288
|
const ordered = Object.fromEntries(Object.keys(profile).sort().map((k) => [k, profile[k]]));
|
|
17289
17289
|
const fingerprint = createHash("sha256").update(JSON.stringify(ordered), "utf8").digest("hex");
|
|
@@ -17325,7 +17325,7 @@ function environmentVariables(selected) {
|
|
|
17325
17325
|
function matchesEnvironment(actual, selected) {
|
|
17326
17326
|
if (!actual || typeof actual !== "object" || Array.isArray(actual)) return false;
|
|
17327
17327
|
const identity = actual;
|
|
17328
|
-
return Object.keys(identity).length === Object.keys(selected.identity).length && Object.entries(selected.identity).every(([
|
|
17328
|
+
return Object.keys(identity).length === Object.keys(selected.identity).length && Object.entries(selected.identity).every(([key2, value]) => identity[key2] === value);
|
|
17329
17329
|
}
|
|
17330
17330
|
|
|
17331
17331
|
// src/config.ts
|
|
@@ -17749,6 +17749,7 @@ init_evidence_package();
|
|
|
17749
17749
|
// src/machine-service.ts
|
|
17750
17750
|
import { isIP as isIP2 } from "node:net";
|
|
17751
17751
|
import { createHash as createHash3 } from "node:crypto";
|
|
17752
|
+
import { open as open2, rm } from "node:fs/promises";
|
|
17752
17753
|
var MachineServiceError = class extends Error {
|
|
17753
17754
|
constructor(message3, status, responseBody, options) {
|
|
17754
17755
|
super(message3, options);
|
|
@@ -17778,6 +17779,7 @@ function expectMachineService(health, origin) {
|
|
|
17778
17779
|
if (health.service === SERVICE_NAME) return;
|
|
17779
17780
|
throw new Error(`The service at ${origin} answers as ${JSON.stringify(health.service ?? null)}, not ${SERVICE_NAME}. This relay speaks only machine-service's /machines API: install machine-service, which replaced vm-service.`);
|
|
17780
17781
|
}
|
|
17782
|
+
var PULL_IDLE_MS = 12e4;
|
|
17781
17783
|
var AcquireIndeterminateError = class extends MachineServiceError {
|
|
17782
17784
|
constructor(purpose, cause) {
|
|
17783
17785
|
super(`Acquisition outcome unknown for purpose '${purpose}'; reconcile GET /machines before retrying or ending the enclosure`, void 0, void 0, { cause });
|
|
@@ -17819,7 +17821,7 @@ var MachineService = class {
|
|
|
17819
17821
|
const host = url.hostname.replace(/^\[|\]$/g, "");
|
|
17820
17822
|
const loopback = host === "localhost" || host === "::1" || isIP2(host) === 4 && host.startsWith("127.");
|
|
17821
17823
|
if (!loopback && !options.listed || !["http:", "https:"].includes(url.protocol) || url.username || url.password || url.search || url.hash || url.pathname !== "/") {
|
|
17822
|
-
throw new TypeError("machine-service baseUrl must be a loopback HTTP(S) origin, or one
|
|
17824
|
+
throw new TypeError("machine-service baseUrl must be a loopback HTTP(S) origin, or one discovery found, without credentials, path, query or fragment");
|
|
17823
17825
|
}
|
|
17824
17826
|
this.baseUrl = url.origin;
|
|
17825
17827
|
this.timeoutMs = positive(options.timeoutMs ?? 66e4, "timeoutMs");
|
|
@@ -17906,18 +17908,39 @@ var MachineService = class {
|
|
|
17906
17908
|
*/
|
|
17907
17909
|
async pushBytes(vm, body, options = {}) {
|
|
17908
17910
|
const sha256 = createHash3("sha256").update(body.bytes).digest("hex");
|
|
17909
|
-
const response = await this.fetchBounded(this.filesPath(vm, body.remote_path, body.lease_id), { method: "PUT", headers: { "Content-Type": "application/octet-stream", "X-Content-SHA256": sha256 }, body: new Uint8Array(body.bytes) }, options, this.maxResponseBytes);
|
|
17911
|
+
const response = await this.fetchBounded(this.filesPath(vm, body.remote_path, body.lease_id), { method: "PUT", headers: { "Content-Type": "application/octet-stream", "X-Content-SHA256": sha256 }, body: new Uint8Array(body.bytes.buffer, body.bytes.byteOffset, body.bytes.byteLength) }, options, this.maxResponseBytes);
|
|
17910
17912
|
const answer = this.json(response.path, response.text);
|
|
17911
17913
|
if (answer.sha256 !== sha256 || answer.bytes !== body.bytes.length) throw new MachineServiceError(`machine-service ${response.path}: the instance stored ${answer.bytes} bytes with SHA-256 ${answer.sha256}, not what was sent`);
|
|
17912
17914
|
return answer;
|
|
17913
17915
|
}
|
|
17914
|
-
/**
|
|
17916
|
+
/**
|
|
17917
|
+
* Pull one file as bytes, `GET /machines/<name>/files`, into `to`, which
|
|
17918
|
+
* must not exist. The bytes stream to disk as they are hashed, so a file of
|
|
17919
|
+
* any size needs no memory of its size, and the pull is abandoned only when
|
|
17920
|
+
* no byte arrives for its timeout. The file is removed unless the bytes
|
|
17921
|
+
* match the digest the instance states (DC-31).
|
|
17922
|
+
*/
|
|
17915
17923
|
async pullBytes(vm, body, options = {}) {
|
|
17916
|
-
const
|
|
17917
|
-
|
|
17918
|
-
|
|
17919
|
-
|
|
17920
|
-
|
|
17924
|
+
const hash3 = createHash3("sha256"), file = await open2(body.to, "wx", 384);
|
|
17925
|
+
let bytes = 0;
|
|
17926
|
+
try {
|
|
17927
|
+
const response = await this.fetchBounded(this.filesPath(vm, body.remote_path, body.lease_id), { method: "GET" }, { ...options, timeoutMs: options.timeoutMs ?? PULL_IDLE_MS }, Number.MAX_SAFE_INTEGER, { idle: true, sink: async (chunk) => {
|
|
17928
|
+
hash3.update(chunk);
|
|
17929
|
+
bytes += chunk.byteLength;
|
|
17930
|
+
await file.write(chunk);
|
|
17931
|
+
} });
|
|
17932
|
+
if (response.contentType !== "application/octet-stream") throw new MachineServiceError(`machine-service ${response.path}: expected one file, got ${response.contentType ?? "no content type"}`);
|
|
17933
|
+
const digest = hash3.digest("hex");
|
|
17934
|
+
if (!response.sha256 || digest !== response.sha256.toLowerCase()) throw new MachineServiceError(`machine-service ${response.path}: the bytes' SHA-256 ${digest} differs from the stated ${response.sha256 ?? "none"}`);
|
|
17935
|
+
await file.sync();
|
|
17936
|
+
await file.close();
|
|
17937
|
+
return { sha256: digest, bytes };
|
|
17938
|
+
} catch (error2) {
|
|
17939
|
+
await file.close().catch(() => {
|
|
17940
|
+
});
|
|
17941
|
+
await rm(body.to, { force: true });
|
|
17942
|
+
throw error2;
|
|
17943
|
+
}
|
|
17921
17944
|
}
|
|
17922
17945
|
filesPath(vm, remote, lease_id) {
|
|
17923
17946
|
const query = new URLSearchParams({ ...lease_id ? { lease_id } : {}, path: remote });
|
|
@@ -17942,14 +17965,20 @@ var MachineService = class {
|
|
|
17942
17965
|
throw new MachineServiceError(`machine-service ${path}: invalid JSON response`, void 0, void 0, { cause });
|
|
17943
17966
|
}
|
|
17944
17967
|
}
|
|
17945
|
-
/**
|
|
17946
|
-
|
|
17968
|
+
/**
|
|
17969
|
+
* One request whose answer is read up to `maxBytes`; an error answer is read
|
|
17970
|
+
* up to 4 KiB and thrown with its status. With `sink`, a successful answer is
|
|
17971
|
+
* handed over chunk by chunk instead of kept; with `idle`, the timeout counts
|
|
17972
|
+
* from the last chunk rather than from the start.
|
|
17973
|
+
*/
|
|
17974
|
+
async fetchBounded(path, init, options, maxBytes, stream = {}) {
|
|
17947
17975
|
options.signal?.throwIfAborted();
|
|
17948
17976
|
const timeoutMs2 = positive(options.timeoutMs ?? this.timeoutMs, "timeoutMs");
|
|
17949
17977
|
const controller = new AbortController();
|
|
17950
17978
|
const abort = () => controller.abort(options.signal?.reason);
|
|
17951
17979
|
options.signal?.addEventListener("abort", abort, { once: true });
|
|
17952
|
-
const
|
|
17980
|
+
const expire = () => controller.abort(new MachineServiceError(`machine-service ${path} timed out after ${timeoutMs2}ms${stream.idle ? " without a byte" : ""}`));
|
|
17981
|
+
let timer = setTimeout(expire, timeoutMs2);
|
|
17953
17982
|
try {
|
|
17954
17983
|
const response = await fetch(`${this.baseUrl}${path}`, {
|
|
17955
17984
|
method: init.method,
|
|
@@ -17969,6 +17998,15 @@ var MachineService = class {
|
|
|
17969
17998
|
for (; ; ) {
|
|
17970
17999
|
const { value, done } = await reader.read();
|
|
17971
18000
|
if (done) break;
|
|
18001
|
+
if (stream.idle) {
|
|
18002
|
+
clearTimeout(timer);
|
|
18003
|
+
timer = setTimeout(expire, timeoutMs2);
|
|
18004
|
+
}
|
|
18005
|
+
if (response.ok && stream.sink) {
|
|
18006
|
+
size += value.byteLength;
|
|
18007
|
+
await stream.sink(value);
|
|
18008
|
+
continue;
|
|
18009
|
+
}
|
|
17972
18010
|
const remaining = bound - size;
|
|
17973
18011
|
chunks.push(value.subarray(0, remaining));
|
|
17974
18012
|
size += Math.min(value.byteLength, remaining);
|
|
@@ -17989,7 +18027,7 @@ var MachineService = class {
|
|
|
17989
18027
|
} catch (cause) {
|
|
17990
18028
|
if (controller.signal.aborted) throw controller.signal.reason;
|
|
17991
18029
|
if (cause instanceof MachineServiceError) throw cause;
|
|
17992
|
-
throw new MachineServiceError(`machine-service ${path}: request failed`, void 0, void 0, { cause });
|
|
18030
|
+
throw new MachineServiceError(`machine-service ${path}: request failed${cause instanceof Error ? `: ${cause.message}` : ""}`, void 0, void 0, { cause });
|
|
17993
18031
|
} finally {
|
|
17994
18032
|
clearTimeout(timer);
|
|
17995
18033
|
options.signal?.removeEventListener("abort", abort);
|
|
@@ -18002,7 +18040,7 @@ import { homedir as homedir4 } from "node:os";
|
|
|
18002
18040
|
|
|
18003
18041
|
// src/registry.ts
|
|
18004
18042
|
import { randomUUID } from "node:crypto";
|
|
18005
|
-
import { link, lstat, mkdir as mkdir2, open as
|
|
18043
|
+
import { link, lstat, mkdir as mkdir2, open as open3, readFile as readFile3, realpath, rename as rename2, unlink } from "node:fs/promises";
|
|
18006
18044
|
import { readFileSync as readFileSync2, statSync as statSync2 } from "node:fs";
|
|
18007
18045
|
import { homedir as homedir3 } from "node:os";
|
|
18008
18046
|
import { spawn as spawn2 } from "node:child_process";
|
|
@@ -18015,10 +18053,10 @@ var RegistryError = class extends Error {
|
|
|
18015
18053
|
};
|
|
18016
18054
|
var columns = ["machine", "os", "taskName", "agent", "project", "startDate"];
|
|
18017
18055
|
function cells(row) {
|
|
18018
|
-
return columns.map((
|
|
18019
|
-
const value = row[
|
|
18056
|
+
return columns.map((key2) => {
|
|
18057
|
+
const value = row[key2];
|
|
18020
18058
|
if (typeof value !== "string" || !value.trim() || value !== value.trim() || /[|\r\n\u0000-\u001f\u007f]/.test(value)) {
|
|
18021
|
-
throw new RegistryError(`Registry ${
|
|
18059
|
+
throw new RegistryError(`Registry ${key2} must be nonempty trimmed text without pipes or control characters`);
|
|
18022
18060
|
}
|
|
18023
18061
|
return value;
|
|
18024
18062
|
});
|
|
@@ -18184,7 +18222,7 @@ var Registry = class {
|
|
|
18184
18222
|
const updated = transform2(original);
|
|
18185
18223
|
if (original === updated) return false;
|
|
18186
18224
|
temporary = join5(dirname3(target), `.${target.split("/").at(-1)}.${token2}.tmp`);
|
|
18187
|
-
const handle = await
|
|
18225
|
+
const handle = await open3(temporary, "wx", before.mode & 511);
|
|
18188
18226
|
try {
|
|
18189
18227
|
await handle.chmod(before.mode & 511);
|
|
18190
18228
|
await handle.writeFile(updated, "utf8");
|
|
@@ -18200,7 +18238,7 @@ var Registry = class {
|
|
|
18200
18238
|
lock.check();
|
|
18201
18239
|
await rename2(temporary, target);
|
|
18202
18240
|
temporary = void 0;
|
|
18203
|
-
const dir = await
|
|
18241
|
+
const dir = await open3(dirname3(target), "r");
|
|
18204
18242
|
try {
|
|
18205
18243
|
await dir.sync();
|
|
18206
18244
|
} finally {
|
|
@@ -18227,7 +18265,7 @@ var Registry = class {
|
|
|
18227
18265
|
if (!errno(error2, "ENOENT")) throw error2;
|
|
18228
18266
|
}
|
|
18229
18267
|
const temporary = join5(dirname3(target), `.registry.${randomUUID()}.tmp`);
|
|
18230
|
-
const handle = await
|
|
18268
|
+
const handle = await open3(temporary, "wx", 384);
|
|
18231
18269
|
try {
|
|
18232
18270
|
try {
|
|
18233
18271
|
await handle.chmod(384);
|
|
@@ -18242,7 +18280,7 @@ var Registry = class {
|
|
|
18242
18280
|
} catch (error2) {
|
|
18243
18281
|
if (!errno(error2, "EEXIST")) throw error2;
|
|
18244
18282
|
}
|
|
18245
|
-
const dir = await
|
|
18283
|
+
const dir = await open3(dirname3(target), "r");
|
|
18246
18284
|
try {
|
|
18247
18285
|
await dir.sync();
|
|
18248
18286
|
} finally {
|
|
@@ -18317,7 +18355,7 @@ var Registry = class {
|
|
|
18317
18355
|
};
|
|
18318
18356
|
|
|
18319
18357
|
// src/transfer.ts
|
|
18320
|
-
import { copyFile, mkdir as mkdir5, readFile as readFile5, lstat as lstat3, mkdtemp, rm, open as
|
|
18358
|
+
import { copyFile, mkdir as mkdir5, readFile as readFile5, lstat as lstat3, mkdtemp, rm as rm2, open as open6, link as link2 } from "node:fs/promises";
|
|
18321
18359
|
import { constants as constants3, linkSync } from "node:fs";
|
|
18322
18360
|
import { dirname as dirname6, join as join7, resolve as resolve5, relative as relative4, isAbsolute as isAbsolute4 } from "node:path";
|
|
18323
18361
|
import { tmpdir } from "node:os";
|
|
@@ -18326,11 +18364,11 @@ import { randomUUID as randomUUID3 } from "node:crypto";
|
|
|
18326
18364
|
// src/util.ts
|
|
18327
18365
|
import { spawn as spawn3 } from "node:child_process";
|
|
18328
18366
|
import { createHash as createHash4, randomUUID as randomUUID2 } from "node:crypto";
|
|
18329
|
-
import { mkdir as mkdir3, rename as rename3, lstat as lstat2, readdir as readdir2, open as
|
|
18367
|
+
import { mkdir as mkdir3, rename as rename3, lstat as lstat2, readdir as readdir2, open as open4 } from "node:fs/promises";
|
|
18330
18368
|
import { dirname as dirname4, join as join6, resolve as resolve4, relative as relative3, isAbsolute as isAbsolute3 } from "node:path";
|
|
18331
18369
|
var hash = (bytes) => createHash4("sha256").update(bytes).digest("hex");
|
|
18332
18370
|
async function hashFile(path) {
|
|
18333
|
-
const file = await
|
|
18371
|
+
const file = await open4(path, "r");
|
|
18334
18372
|
try {
|
|
18335
18373
|
const digest = createHash4("sha256"), chunk = Buffer.alloc(8 * 1024 * 1024);
|
|
18336
18374
|
let bytes = 0;
|
|
@@ -18348,7 +18386,7 @@ async function hashFile(path) {
|
|
|
18348
18386
|
async function jsonFile(path, value) {
|
|
18349
18387
|
await mkdir3(dirname4(path), { recursive: true, mode: 448 });
|
|
18350
18388
|
const tmp = `${path}.${randomUUID2()}.tmp`;
|
|
18351
|
-
const file = await
|
|
18389
|
+
const file = await open4(tmp, "wx", 384);
|
|
18352
18390
|
try {
|
|
18353
18391
|
await file.writeFile(JSON.stringify(value, null, 2) + "\n");
|
|
18354
18392
|
await file.sync();
|
|
@@ -18356,7 +18394,7 @@ async function jsonFile(path, value) {
|
|
|
18356
18394
|
await file.close();
|
|
18357
18395
|
}
|
|
18358
18396
|
await rename3(tmp, path);
|
|
18359
|
-
const directory2 = await
|
|
18397
|
+
const directory2 = await open4(dirname4(path), "r");
|
|
18360
18398
|
try {
|
|
18361
18399
|
await directory2.sync();
|
|
18362
18400
|
} finally {
|
|
@@ -18420,7 +18458,7 @@ async function command(argv, options = {}) {
|
|
|
18420
18458
|
}
|
|
18421
18459
|
|
|
18422
18460
|
// src/archive.ts
|
|
18423
|
-
import { open as
|
|
18461
|
+
import { open as open5, mkdir as mkdir4 } from "node:fs/promises";
|
|
18424
18462
|
import { constants as constants2 } from "node:fs";
|
|
18425
18463
|
import { createHash as createHash5 } from "node:crypto";
|
|
18426
18464
|
import { dirname as dirname5 } from "node:path";
|
|
@@ -18449,7 +18487,7 @@ function archiveChunks(files, maxArgvBytes = 64 * 1024) {
|
|
|
18449
18487
|
return chunks;
|
|
18450
18488
|
}
|
|
18451
18489
|
async function unpackArchive(archive, directory2, requested, options = {}) {
|
|
18452
|
-
const input = await
|
|
18490
|
+
const input = await open5(archive, constants2.O_RDONLY | constants2.O_NOFOLLOW);
|
|
18453
18491
|
const unpacked = [];
|
|
18454
18492
|
try {
|
|
18455
18493
|
const buffer = Buffer.alloc(8 * 1024 * 1024);
|
|
@@ -18495,7 +18533,7 @@ async function unpackArchive(archive, directory2, requested, options = {}) {
|
|
|
18495
18533
|
const bytes = head.bytes;
|
|
18496
18534
|
const target = within(directory2, fact.path);
|
|
18497
18535
|
await mkdir4(dirname5(target), { recursive: true, mode: 448 });
|
|
18498
|
-
const output = await
|
|
18536
|
+
const output = await open5(target, constants2.O_WRONLY | constants2.O_CREAT | constants2.O_EXCL | constants2.O_NOFOLLOW, 384);
|
|
18499
18537
|
const digest = createHash5("sha256");
|
|
18500
18538
|
try {
|
|
18501
18539
|
for (let left = bytes; left > 0; ) {
|
|
@@ -18817,7 +18855,7 @@ var Transfer = class {
|
|
|
18817
18855
|
const info = await lstat3(path);
|
|
18818
18856
|
if (!info.isFile()) throw new ImageTransferError("unsafe-path", "Expected a regular local image");
|
|
18819
18857
|
if (info.size !== identity.bytes) throw new ImageTransferError("integrity-failed", "Local image size conflicts with original");
|
|
18820
|
-
const fd = await
|
|
18858
|
+
const fd = await open6(path, constants3.O_RDONLY | constants3.O_NOFOLLOW | constants3.O_NONBLOCK);
|
|
18821
18859
|
try {
|
|
18822
18860
|
const same = (s) => s.isFile() && s.dev === info.dev && s.ino === info.ino && s.size === info.size && s.mtimeMs === info.mtimeMs && s.ctimeMs === info.ctimeMs;
|
|
18823
18861
|
if (!same(await fd.stat())) throw new ImageTransferError("integrity-failed", "Local image changed before verification");
|
|
@@ -18897,7 +18935,7 @@ var Transfer = class {
|
|
|
18897
18935
|
const clean = async () => {
|
|
18898
18936
|
try {
|
|
18899
18937
|
await assertHostPath(approvedLocalRoot, staging);
|
|
18900
|
-
await
|
|
18938
|
+
await rm2(staging, { recursive: true, force: true });
|
|
18901
18939
|
} catch {
|
|
18902
18940
|
}
|
|
18903
18941
|
};
|
|
@@ -18919,9 +18957,9 @@ var Transfer = class {
|
|
|
18919
18957
|
await bounded3(async () => {
|
|
18920
18958
|
await this.options.onRetry?.({ operation: "pull", attempt, diagnostic });
|
|
18921
18959
|
});
|
|
18922
|
-
const
|
|
18923
|
-
if (
|
|
18924
|
-
const timer2 = setTimeout(done,
|
|
18960
|
+
const wait2 = options.retryDelaysMs?.[attempt - 1];
|
|
18961
|
+
if (wait2) await bounded3(() => new Promise((done) => {
|
|
18962
|
+
const timer2 = setTimeout(done, wait2);
|
|
18925
18963
|
controller.signal.addEventListener("abort", () => {
|
|
18926
18964
|
clearTimeout(timer2);
|
|
18927
18965
|
done();
|
|
@@ -18995,7 +19033,7 @@ var Transfer = class {
|
|
|
18995
19033
|
await this.checked([this.node, "-e", REMOVE_FRAME, guestRoot, frame]);
|
|
18996
19034
|
} finally {
|
|
18997
19035
|
await assertHostPath(tempRoot, hostDirectory);
|
|
18998
|
-
await
|
|
19036
|
+
await rm2(hostDirectory, { recursive: true, force: true });
|
|
18999
19037
|
}
|
|
19000
19038
|
}
|
|
19001
19039
|
}
|
|
@@ -19020,7 +19058,7 @@ var Transfer = class {
|
|
|
19020
19058
|
}
|
|
19021
19059
|
if (written) {
|
|
19022
19060
|
await assertHostPath(localRoot, path);
|
|
19023
|
-
await
|
|
19061
|
+
await rm2(path, { force: true });
|
|
19024
19062
|
}
|
|
19025
19063
|
}
|
|
19026
19064
|
return false;
|
|
@@ -19076,7 +19114,7 @@ var Transfer = class {
|
|
|
19076
19114
|
await this.checked([this.node, "-e", REMOVE_FRAME, guestRoot, archive]);
|
|
19077
19115
|
} finally {
|
|
19078
19116
|
await assertHostPath(localRoot, staging);
|
|
19079
|
-
await
|
|
19117
|
+
await rm2(staging, { recursive: true, force: true });
|
|
19080
19118
|
}
|
|
19081
19119
|
}
|
|
19082
19120
|
}
|
|
@@ -19186,7 +19224,7 @@ var VmTransport = class {
|
|
|
19186
19224
|
await assertHostPath(this.hostRoot, local, true);
|
|
19187
19225
|
await jsonFile(local, payload);
|
|
19188
19226
|
await this.transfer.pushFile(local, remote, this.hostRoot);
|
|
19189
|
-
const
|
|
19227
|
+
const wait2 = request.snapshots?.group?.afterIntervalMs ?? request.snapshots?.afterIntervalMs ?? 0;
|
|
19190
19228
|
let response;
|
|
19191
19229
|
try {
|
|
19192
19230
|
const result2 = await this.transfer.vm.exec(this.transfer.name, [
|
|
@@ -19198,7 +19236,7 @@ var VmTransport = class {
|
|
|
19198
19236
|
INVOKE,
|
|
19199
19237
|
join8(this.guestRoot, "receiver.mjs"),
|
|
19200
19238
|
remote
|
|
19201
|
-
], this.timeoutMs + 18e4 +
|
|
19239
|
+
], this.timeoutMs + 18e4 + wait2, { signal: this.signal });
|
|
19202
19240
|
if (result2.code !== 0) throw new Error(`Receiver exit ${result2.code}: ${result2.stderr.slice(0, 1e3)}`);
|
|
19203
19241
|
const guestReceipt = join8(this.guestRoot, "state", "receiver", "receipts", `${request.executionId}.json`);
|
|
19204
19242
|
const originalReceipt = join8(this.hostRoot, "receiver-receipts", `${request.executionId}.json`);
|
|
@@ -19229,7 +19267,7 @@ var VmTransport = class {
|
|
|
19229
19267
|
|
|
19230
19268
|
// src/package.ts
|
|
19231
19269
|
import { createHash as createHash6 } from "node:crypto";
|
|
19232
|
-
import { lstat as lstat4, readFile as readFile6, readdir as readdir3, mkdir as mkdir6, writeFile as writeFile3, rm as
|
|
19270
|
+
import { lstat as lstat4, readFile as readFile6, readdir as readdir3, mkdir as mkdir6, writeFile as writeFile3, rm as rm3 } from "node:fs/promises";
|
|
19233
19271
|
import { dirname as dirname7, join as join9, resolve as resolve6, parse as parse4 } from "node:path";
|
|
19234
19272
|
var generated = ["OPENING.txt", "manifest.json"];
|
|
19235
19273
|
var hash2 = (bytes) => createHash6("sha256").update(bytes).digest("hex");
|
|
@@ -19422,9 +19460,9 @@ async function analyze(root, options, files) {
|
|
|
19422
19460
|
const receipts = [];
|
|
19423
19461
|
const retainReceipt = (raw, envelope) => {
|
|
19424
19462
|
const receipt = object3(raw, "execution receipt");
|
|
19425
|
-
for (const
|
|
19426
|
-
if (receipt[
|
|
19427
|
-
if (envelope?.[
|
|
19463
|
+
for (const key2 of ["executionId", "actionId", "sessionId"]) {
|
|
19464
|
+
if (receipt[key2] !== void 0) text(receipt[key2], `receipt ${key2}`);
|
|
19465
|
+
if (envelope?.[key2] !== void 0 && receipt[key2] !== void 0 && envelope[key2] !== receipt[key2]) throw new Error(`receipt ${key2} identity mismatch`);
|
|
19428
19466
|
}
|
|
19429
19467
|
if (receipt.sessionId !== void 0 && receipt.sessionId !== options.sessionId) throw new Error("receipt session identity mismatch");
|
|
19430
19468
|
const executionId = receipt.executionId ?? envelope?.executionId;
|
|
@@ -19536,7 +19574,7 @@ Original subprocess/action evidence (not an authoritative input-success verdict)
|
|
|
19536
19574
|
}
|
|
19537
19575
|
}
|
|
19538
19576
|
const bearing = (finding) => /^action \S+ (has no retained start or refusal|is missing reverse snapshot reference |has no materialized action record|lacks durable reverse snapshot references)/.test(finding) ? "defects" : /^request \S+ has no retained guest execution$/.test(finding) ? "execution" : "snapshots";
|
|
19539
|
-
const explained = (
|
|
19577
|
+
const explained = (key2) => findings.filter((f) => bearing(f) === key2).map((finding) => explainFinding(finding, steps, stepsByExecution));
|
|
19540
19578
|
const snapshotReasons = explained("snapshots"), unexecuted = explained("execution"), defectReasons = explained("defects");
|
|
19541
19579
|
const completeness = snapshotReasons.length ? "incomplete" : "complete";
|
|
19542
19580
|
const receiptFailed = receipts.some((r) => ["refused", "failed"].includes(receiptOutcome(r)));
|
|
@@ -19624,7 +19662,7 @@ async function deliverPackage(rootDir, options) {
|
|
|
19624
19662
|
})));
|
|
19625
19663
|
return await verifyDeliveredPackage(root);
|
|
19626
19664
|
} catch (error2) {
|
|
19627
|
-
for (const path of created.reverse()) await
|
|
19665
|
+
for (const path of created.reverse()) await rm3(join9(root, path), { force: true });
|
|
19628
19666
|
throw error2;
|
|
19629
19667
|
}
|
|
19630
19668
|
}
|
|
@@ -19701,7 +19739,7 @@ async function probeLocal(run = command, platform = process.platform) {
|
|
|
19701
19739
|
// src/owner-lock.ts
|
|
19702
19740
|
import { spawn as spawn4 } from "node:child_process";
|
|
19703
19741
|
import { constants as constants4 } from "node:fs";
|
|
19704
|
-
import { open as
|
|
19742
|
+
import { open as open7 } from "node:fs/promises";
|
|
19705
19743
|
var OwnerLockError = class extends Error {
|
|
19706
19744
|
constructor(message3, options) {
|
|
19707
19745
|
super(message3, options);
|
|
@@ -19726,7 +19764,7 @@ async function acquireOwnerLock(path, options = {}) {
|
|
|
19726
19764
|
const executable = options.pythonExecutable === void 0 ? pythonExecutable() : nonblank(options.pythonExecutable, "pythonExecutable");
|
|
19727
19765
|
const signal = options.signal;
|
|
19728
19766
|
signal?.throwIfAborted();
|
|
19729
|
-
const file = await
|
|
19767
|
+
const file = await open7(path, constants4.O_RDWR | constants4.O_CREAT | constants4.O_NOFOLLOW, 384);
|
|
19730
19768
|
try {
|
|
19731
19769
|
if (!(await file.stat()).isFile()) throw new OwnerLockError("Owner lock must be a regular file");
|
|
19732
19770
|
signal?.throwIfAborted();
|
|
@@ -20064,14 +20102,14 @@ function Counted(value, callback) {
|
|
|
20064
20102
|
function ShiftLeft(array2, true_, false_) {
|
|
20065
20103
|
return IsEqual(array2.length, 0) ? false_() : true_(array2[0], array2.slice(1));
|
|
20066
20104
|
}
|
|
20067
|
-
function IsUnsafePropertyKey(
|
|
20068
|
-
return IsEqual(
|
|
20105
|
+
function IsUnsafePropertyKey(key2) {
|
|
20106
|
+
return IsEqual(key2, "__proto__") || IsEqual(key2, "constructor") || IsEqual(key2, "prototype");
|
|
20069
20107
|
}
|
|
20070
|
-
function HasPropertyKey(value,
|
|
20071
|
-
return IsUnsafePropertyKey(
|
|
20108
|
+
function HasPropertyKey(value, key2) {
|
|
20109
|
+
return IsUnsafePropertyKey(key2) ? Object.prototype.hasOwnProperty.call(value, key2) : key2 in value;
|
|
20072
20110
|
}
|
|
20073
20111
|
function EntriesRegExp(value) {
|
|
20074
|
-
return Keys(value).map((
|
|
20112
|
+
return Keys(value).map((key2) => [new RegExp(`^${key2}$`), value[key2]]);
|
|
20075
20113
|
}
|
|
20076
20114
|
function Entries(value) {
|
|
20077
20115
|
return Object.entries(value);
|
|
@@ -20089,7 +20127,7 @@ function DeepEqualObject(left, right) {
|
|
|
20089
20127
|
if (!IsObject(right))
|
|
20090
20128
|
return false;
|
|
20091
20129
|
const keys = Keys(left);
|
|
20092
|
-
return IsEqual(keys.length, Keys(right).length) && keys.every((
|
|
20130
|
+
return IsEqual(keys.length, Keys(right).length) && keys.every((key2) => IsDeepEqual(left[key2], right[key2]));
|
|
20093
20131
|
}
|
|
20094
20132
|
function DeepEqualArray(left, right) {
|
|
20095
20133
|
return IsArray(right) && IsEqual(left.length, right.length) && left.every((_, index) => IsDeepEqual(left[index], right[index]));
|
|
@@ -20206,10 +20244,10 @@ function Reset() {
|
|
|
20206
20244
|
settings.unionPrioritySort = true;
|
|
20207
20245
|
}
|
|
20208
20246
|
function Set2(options) {
|
|
20209
|
-
for (const
|
|
20210
|
-
const value = options[
|
|
20247
|
+
for (const key2 of guard_exports.Keys(options)) {
|
|
20248
|
+
const value = options[key2];
|
|
20211
20249
|
if (value !== void 0) {
|
|
20212
|
-
Object.defineProperty(settings,
|
|
20250
|
+
Object.defineProperty(settings, key2, { value });
|
|
20213
20251
|
}
|
|
20214
20252
|
}
|
|
20215
20253
|
}
|
|
@@ -20237,28 +20275,28 @@ function IsSchemaObject(value) {
|
|
|
20237
20275
|
}
|
|
20238
20276
|
function FromSchemaObject(value) {
|
|
20239
20277
|
const result2 = {};
|
|
20240
|
-
for (const
|
|
20241
|
-
if (guard_exports.IsUnsafePropertyKey(
|
|
20278
|
+
for (const key2 of guard_exports.Keys(value)) {
|
|
20279
|
+
if (guard_exports.IsUnsafePropertyKey(key2))
|
|
20242
20280
|
continue;
|
|
20243
|
-
const descriptor = Object.getOwnPropertyDescriptor(value,
|
|
20281
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key2);
|
|
20244
20282
|
descriptor.value = FromValue(descriptor.value);
|
|
20245
20283
|
if (guard_exports.IsEqual(descriptor.enumerable, true)) {
|
|
20246
|
-
result2[
|
|
20284
|
+
result2[key2] = descriptor.value;
|
|
20247
20285
|
} else {
|
|
20248
|
-
Object.defineProperty(result2,
|
|
20286
|
+
Object.defineProperty(result2, key2, descriptor);
|
|
20249
20287
|
}
|
|
20250
20288
|
}
|
|
20251
20289
|
return result2;
|
|
20252
20290
|
}
|
|
20253
20291
|
function FromPlainObject(value) {
|
|
20254
20292
|
const result2 = {};
|
|
20255
|
-
for (const
|
|
20256
|
-
if (guard_exports.IsUnsafePropertyKey(
|
|
20293
|
+
for (const key2 of guard_exports.Keys(value)) {
|
|
20294
|
+
if (guard_exports.IsUnsafePropertyKey(key2))
|
|
20257
20295
|
continue;
|
|
20258
|
-
result2[
|
|
20296
|
+
result2[key2] = FromValue(value[key2]);
|
|
20259
20297
|
}
|
|
20260
|
-
for (const
|
|
20261
|
-
result2[
|
|
20298
|
+
for (const key2 of guard_exports.Symbols(value)) {
|
|
20299
|
+
result2[key2] = FromValue(value[key2]);
|
|
20262
20300
|
}
|
|
20263
20301
|
return result2;
|
|
20264
20302
|
}
|
|
@@ -20290,12 +20328,12 @@ function Clone(value) {
|
|
|
20290
20328
|
|
|
20291
20329
|
// node_modules/typebox/build/system/memory/create.mjs
|
|
20292
20330
|
function MergeHidden(left, right) {
|
|
20293
|
-
for (const
|
|
20294
|
-
Object.defineProperty(left,
|
|
20331
|
+
for (const key2 of Object.keys(right)) {
|
|
20332
|
+
Object.defineProperty(left, key2, {
|
|
20295
20333
|
configurable: true,
|
|
20296
20334
|
writable: true,
|
|
20297
20335
|
enumerable: false,
|
|
20298
|
-
value: right[
|
|
20336
|
+
value: right[key2]
|
|
20299
20337
|
});
|
|
20300
20338
|
}
|
|
20301
20339
|
return left;
|
|
@@ -20314,12 +20352,12 @@ function Create(hidden, enumerable, options = {}) {
|
|
|
20314
20352
|
function Discard(value, propertyKeys) {
|
|
20315
20353
|
Metrics.discard += 1;
|
|
20316
20354
|
const result2 = {};
|
|
20317
|
-
for (const
|
|
20318
|
-
if (propertyKeys.includes(
|
|
20355
|
+
for (const key2 of guard_exports.Keys(value)) {
|
|
20356
|
+
if (propertyKeys.includes(key2))
|
|
20319
20357
|
continue;
|
|
20320
|
-
const descriptor = Object.getOwnPropertyDescriptor(value,
|
|
20358
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key2);
|
|
20321
20359
|
descriptor.value = Clone(descriptor.value);
|
|
20322
|
-
Object.defineProperty(result2,
|
|
20360
|
+
Object.defineProperty(result2, key2, descriptor);
|
|
20323
20361
|
}
|
|
20324
20362
|
return Freeze(result2);
|
|
20325
20363
|
}
|
|
@@ -20329,20 +20367,20 @@ function Update(current, hidden, enumerable) {
|
|
|
20329
20367
|
Metrics.update += 1;
|
|
20330
20368
|
const settings2 = settings_exports.Get();
|
|
20331
20369
|
const result2 = Clone(current);
|
|
20332
|
-
for (const
|
|
20333
|
-
Object.defineProperty(result2,
|
|
20370
|
+
for (const key2 of Object.keys(hidden)) {
|
|
20371
|
+
Object.defineProperty(result2, key2, {
|
|
20334
20372
|
configurable: true,
|
|
20335
20373
|
writable: true,
|
|
20336
20374
|
enumerable: settings2.enumerableKind,
|
|
20337
|
-
value: hidden[
|
|
20375
|
+
value: hidden[key2]
|
|
20338
20376
|
});
|
|
20339
20377
|
}
|
|
20340
|
-
for (const
|
|
20341
|
-
Object.defineProperty(result2,
|
|
20378
|
+
for (const key2 of Object.keys(enumerable)) {
|
|
20379
|
+
Object.defineProperty(result2, key2, {
|
|
20342
20380
|
configurable: true,
|
|
20343
20381
|
enumerable: true,
|
|
20344
20382
|
writable: true,
|
|
20345
|
-
value: enumerable[
|
|
20383
|
+
value: enumerable[key2]
|
|
20346
20384
|
});
|
|
20347
20385
|
}
|
|
20348
20386
|
return Freeze(result2);
|
|
@@ -20474,7 +20512,7 @@ function IsOptional(value) {
|
|
|
20474
20512
|
|
|
20475
20513
|
// node_modules/typebox/build/type/types/properties.mjs
|
|
20476
20514
|
function RequiredArray(properties) {
|
|
20477
|
-
return guard_exports.Keys(properties).filter((
|
|
20515
|
+
return guard_exports.Keys(properties).filter((key2) => !IsOptional(properties[key2]));
|
|
20478
20516
|
}
|
|
20479
20517
|
function PropertyKeys(properties) {
|
|
20480
20518
|
return guard_exports.Keys(properties);
|
|
@@ -20506,8 +20544,8 @@ function IsUnknown(value) {
|
|
|
20506
20544
|
|
|
20507
20545
|
// node_modules/typebox/build/type/types/cyclic.mjs
|
|
20508
20546
|
function Cyclic($defs, $ref, options) {
|
|
20509
|
-
const defs = guard_exports.Keys($defs).reduce((result2,
|
|
20510
|
-
return { ...result2, [
|
|
20547
|
+
const defs = guard_exports.Keys($defs).reduce((result2, key2) => {
|
|
20548
|
+
return { ...result2, [key2]: memory_exports.Update($defs[key2], {}, { $id: key2 }) };
|
|
20511
20549
|
}, {});
|
|
20512
20550
|
return memory_exports.Create({ ["~kind"]: "Cyclic" }, { $defs: defs, $ref }, options);
|
|
20513
20551
|
}
|
|
@@ -20562,8 +20600,8 @@ function IsTypeScriptEnumLike(value) {
|
|
|
20562
20600
|
return guard_exports.IsObjectNotArray(value);
|
|
20563
20601
|
}
|
|
20564
20602
|
function TypeScriptEnumToEnumValues(type) {
|
|
20565
|
-
const keys = guard_exports.Keys(type).filter((
|
|
20566
|
-
return keys.reduce((result2,
|
|
20603
|
+
const keys = guard_exports.Keys(type).filter((key2) => isNaN(key2));
|
|
20604
|
+
return keys.reduce((result2, key2) => [...result2, type[key2]], []);
|
|
20567
20605
|
}
|
|
20568
20606
|
|
|
20569
20607
|
// node_modules/typebox/build/type/types/enum.mjs
|
|
@@ -20606,9 +20644,9 @@ function InstanceKeys(value) {
|
|
|
20606
20644
|
const propertyKeys = /* @__PURE__ */ new Set();
|
|
20607
20645
|
let current = value;
|
|
20608
20646
|
while (current && current !== Object.prototype) {
|
|
20609
|
-
for (const
|
|
20610
|
-
if (
|
|
20611
|
-
propertyKeys.add(
|
|
20647
|
+
for (const key2 of Reflect.ownKeys(current)) {
|
|
20648
|
+
if (key2 !== "constructor" && typeof key2 !== "symbol")
|
|
20649
|
+
propertyKeys.add(key2);
|
|
20612
20650
|
}
|
|
20613
20651
|
current = Object.getPrototypeOf(current);
|
|
20614
20652
|
}
|
|
@@ -20692,9 +20730,9 @@ function FromNumber(value) {
|
|
|
20692
20730
|
}
|
|
20693
20731
|
function FromObject2(value) {
|
|
20694
20732
|
FNV1A64_OP(ByteMarker.Object);
|
|
20695
|
-
for (const
|
|
20696
|
-
FromValue2(
|
|
20697
|
-
FromValue2(value[
|
|
20733
|
+
for (const key2 of InstanceKeys(value).sort()) {
|
|
20734
|
+
FromValue2(key2);
|
|
20735
|
+
FromValue2(value[key2]);
|
|
20698
20736
|
}
|
|
20699
20737
|
}
|
|
20700
20738
|
function FromRegExp2(value) {
|
|
@@ -21099,9 +21137,9 @@ function TemplateLiteralDecode(pattern) {
|
|
|
21099
21137
|
}
|
|
21100
21138
|
|
|
21101
21139
|
// node_modules/typebox/build/type/engine/record/record_create.mjs
|
|
21102
|
-
function CreateRecord(
|
|
21140
|
+
function CreateRecord(key2, value) {
|
|
21103
21141
|
const type = "object";
|
|
21104
|
-
const patternProperties = { [
|
|
21142
|
+
const patternProperties = { [key2]: value };
|
|
21105
21143
|
return memory_exports.Create({ ["~kind"]: "Record" }, { type, patternProperties });
|
|
21106
21144
|
}
|
|
21107
21145
|
|
|
@@ -21199,13 +21237,13 @@ function CompositeProperty(left, right) {
|
|
|
21199
21237
|
const property = RemoveReadonly(RemoveOptional(evaluated));
|
|
21200
21238
|
return isReadonly && isOptional ? AddReadonly(AddOptional(property)) : isReadonly && !isOptional ? AddReadonly(property) : !isReadonly && isOptional ? AddOptional(property) : property;
|
|
21201
21239
|
}
|
|
21202
|
-
function CompositePropertyKey(left, right,
|
|
21203
|
-
return
|
|
21240
|
+
function CompositePropertyKey(left, right, key2) {
|
|
21241
|
+
return key2 in left ? key2 in right ? CompositeProperty(left[key2], right[key2]) : left[key2] : key2 in right ? right[key2] : Never();
|
|
21204
21242
|
}
|
|
21205
21243
|
function CompositeProperties(left, right) {
|
|
21206
21244
|
const keys = /* @__PURE__ */ new Set([...guard_exports.Keys(left), ...guard_exports.Keys(right)]);
|
|
21207
|
-
const result2 = [...keys].reduce((result3,
|
|
21208
|
-
return { ...result3, [
|
|
21245
|
+
const result2 = [...keys].reduce((result3, key2) => {
|
|
21246
|
+
return { ...result3, [key2]: CompositePropertyKey(left, right, key2) };
|
|
21209
21247
|
}, {});
|
|
21210
21248
|
return result2;
|
|
21211
21249
|
}
|
|
@@ -21330,8 +21368,8 @@ function FromIntersectKey(types, value) {
|
|
|
21330
21368
|
}
|
|
21331
21369
|
|
|
21332
21370
|
// node_modules/typebox/build/type/engine/record/from_key_literal.mjs
|
|
21333
|
-
function FromLiteralKey(
|
|
21334
|
-
return guard_exports.IsString(
|
|
21371
|
+
function FromLiteralKey(key2, value) {
|
|
21372
|
+
return guard_exports.IsString(key2) || guard_exports.IsNumber(key2) ? _Object_({ [key2]: value }) : guard_exports.IsEqual(key2, false) ? _Object_({ false: value }) : guard_exports.IsEqual(key2, true) ? _Object_({ true: value }) : _Object_({});
|
|
21335
21373
|
}
|
|
21336
21374
|
|
|
21337
21375
|
// node_modules/typebox/build/type/engine/record/from_key_number.mjs
|
|
@@ -21341,8 +21379,8 @@ function FromNumberKey(_key, value) {
|
|
|
21341
21379
|
}
|
|
21342
21380
|
|
|
21343
21381
|
// node_modules/typebox/build/type/engine/record/from_key_string.mjs
|
|
21344
|
-
function FromStringKey(
|
|
21345
|
-
return guard_exports.HasPropertyKey(
|
|
21382
|
+
function FromStringKey(key2, value) {
|
|
21383
|
+
return guard_exports.HasPropertyKey(key2, "pattern") && (guard_exports.IsString(key2.pattern) || key2.pattern instanceof RegExp) ? CreateRecord(key2.pattern.toString(), value) : CreateRecord(StringKey, value);
|
|
21346
21384
|
}
|
|
21347
21385
|
|
|
21348
21386
|
// node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs
|
|
@@ -21386,18 +21424,18 @@ function FromUnionKey(types, value) {
|
|
|
21386
21424
|
}
|
|
21387
21425
|
|
|
21388
21426
|
// node_modules/typebox/build/type/engine/record/from_key.mjs
|
|
21389
|
-
function FromKey(
|
|
21390
|
-
const result2 = IsAny(
|
|
21427
|
+
function FromKey(key2, value) {
|
|
21428
|
+
const result2 = IsAny(key2) ? FromAnyKey(value) : IsBoolean3(key2) ? FromBooleanKey(value) : IsEnum(key2) ? FromEnumKey(key2.enum, value) : IsInteger2(key2) ? FromIntegerKey(key2, value) : IsIntersect(key2) ? FromIntersectKey(key2.allOf, value) : IsLiteral(key2) ? FromLiteralKey(key2.const, value) : IsNumber3(key2) ? FromNumberKey(key2, value) : IsUnion(key2) ? FromUnionKey(key2.anyOf, value) : IsString3(key2) ? FromStringKey(key2, value) : IsTemplateLiteral(key2) ? FromTemplateKey(key2.pattern, value) : _Object_({});
|
|
21391
21429
|
return result2;
|
|
21392
21430
|
}
|
|
21393
21431
|
|
|
21394
21432
|
// node_modules/typebox/build/type/engine/record/instantiate.mjs
|
|
21395
|
-
function RecordAction(
|
|
21396
|
-
const result2 = CanInstantiate([
|
|
21433
|
+
function RecordAction(key2, value, options) {
|
|
21434
|
+
const result2 = CanInstantiate([key2]) ? memory_exports.Update(FromKey(key2, value), {}, options) : RecordDeferred(key2, value, options);
|
|
21397
21435
|
return result2;
|
|
21398
21436
|
}
|
|
21399
|
-
function RecordInstantiate(context, state,
|
|
21400
|
-
const instantiatedKey = InstantiateType(context, state,
|
|
21437
|
+
function RecordInstantiate(context, state, key2, value, options) {
|
|
21438
|
+
const instantiatedKey = InstantiateType(context, state, key2);
|
|
21401
21439
|
const instantiatedValue = InstantiateType(context, state, value);
|
|
21402
21440
|
return RecordAction(instantiatedKey, instantiatedValue, options);
|
|
21403
21441
|
}
|
|
@@ -21406,11 +21444,11 @@ function RecordInstantiate(context, state, key, value, options) {
|
|
|
21406
21444
|
var IntegerKey = `^${IntegerPattern}$`;
|
|
21407
21445
|
var NumberKey = `^${NumberPattern}$`;
|
|
21408
21446
|
var StringKey = `^${StringPattern}$`;
|
|
21409
|
-
function RecordDeferred(
|
|
21410
|
-
return Deferred("Record", [
|
|
21447
|
+
function RecordDeferred(key2, value, options = {}) {
|
|
21448
|
+
return Deferred("Record", [key2, value], options);
|
|
21411
21449
|
}
|
|
21412
|
-
function Record(
|
|
21413
|
-
return RecordAction(
|
|
21450
|
+
function Record(key2, value, options = {}) {
|
|
21451
|
+
return RecordAction(key2, value, options);
|
|
21414
21452
|
}
|
|
21415
21453
|
function RecordFromPattern(pattern, value) {
|
|
21416
21454
|
return CreateRecord(pattern, value);
|
|
@@ -21681,9 +21719,9 @@ function OptionalMapping(input) {
|
|
|
21681
21719
|
return input.length > 0;
|
|
21682
21720
|
}
|
|
21683
21721
|
function PropertyMapping(input) {
|
|
21684
|
-
const [isReadonly,
|
|
21722
|
+
const [isReadonly, key2, isOptional, _colon, type] = input;
|
|
21685
21723
|
return {
|
|
21686
|
-
[
|
|
21724
|
+
[key2]: isReadonly && isOptional ? AddReadonlyDeferred(AddOptionalDeferred(type)) : isReadonly && !isOptional ? AddReadonlyDeferred(type) : !isReadonly && isOptional ? AddOptionalDeferred(type) : type
|
|
21687
21725
|
};
|
|
21688
21726
|
}
|
|
21689
21727
|
function PropertyDelimiterMapping(input) {
|
|
@@ -22587,8 +22625,8 @@ function ExtendsProperty(inferred, left, right) {
|
|
|
22587
22625
|
);
|
|
22588
22626
|
}
|
|
22589
22627
|
function ExtractInferredProperties(keys, properties) {
|
|
22590
|
-
return keys.reduce((result2,
|
|
22591
|
-
return
|
|
22628
|
+
return keys.reduce((result2, key2) => {
|
|
22629
|
+
return key2 in properties ? IsExtendsTrueLike(properties[key2]) ? { ...result2, ...properties[key2].inferred } : Unreachable() : Unreachable();
|
|
22592
22630
|
}, {});
|
|
22593
22631
|
}
|
|
22594
22632
|
function ExtendsPropertiesComparer(inferred, left, right) {
|
|
@@ -22608,10 +22646,10 @@ function ExtendsObjectToObject(inferred, left, right) {
|
|
|
22608
22646
|
return ExtendsProperties(inferred, left, right);
|
|
22609
22647
|
}
|
|
22610
22648
|
function RecordMergeInferred(left, right) {
|
|
22611
|
-
return guard_exports.Keys(right).reduce((result2,
|
|
22649
|
+
return guard_exports.Keys(right).reduce((result2, key2) => {
|
|
22612
22650
|
return {
|
|
22613
22651
|
...result2,
|
|
22614
|
-
[
|
|
22652
|
+
[key2]: guard_exports.HasPropertyKey(left, key2) ? IsUnion(result2[key2]) ? Union([...result2[key2].anyOf, right[key2]]) : Union([left[key2], right[key2]]) : right[key2]
|
|
22615
22653
|
};
|
|
22616
22654
|
}, left);
|
|
22617
22655
|
}
|
|
@@ -22841,8 +22879,8 @@ function FromTypes3(context, types, result2) {
|
|
|
22841
22879
|
function FromType4(context, type, result2) {
|
|
22842
22880
|
return IsRef(type) ? FromRef2(context, type.$ref, result2) : IsArray2(type) ? FromType4(context, type.items, result2) : IsConstructor2(type) ? FromTypes3(context, [...type.parameters, type.instanceType], result2) : IsFunction2(type) ? FromTypes3(context, [...type.parameters, type.returnType], result2) : IsInterfaceDeferred(type) ? FromProperties2(context, type.parameters[1], result2) : IsIntersect(type) ? FromTypes3(context, type.allOf, result2) : IsObject2(type) ? FromProperties2(context, type.properties, result2) : IsUnion(type) ? FromTypes3(context, type.anyOf, result2) : IsTuple(type) ? FromTypes3(context, type.items, result2) : IsRecord(type) ? FromType4(context, RecordValue(type), result2) : result2;
|
|
22843
22881
|
}
|
|
22844
|
-
function CyclicDependencies(context,
|
|
22845
|
-
const result2 = FromType4(context, type, [
|
|
22882
|
+
function CyclicDependencies(context, key2, type) {
|
|
22883
|
+
const result2 = FromType4(context, type, [key2]);
|
|
22846
22884
|
return result2;
|
|
22847
22885
|
}
|
|
22848
22886
|
|
|
@@ -22851,8 +22889,8 @@ function FromRef3(_ref) {
|
|
|
22851
22889
|
return Any();
|
|
22852
22890
|
}
|
|
22853
22891
|
function FromProperties3(properties) {
|
|
22854
|
-
return guard_exports.Keys(properties).reduce((result2,
|
|
22855
|
-
return { ...result2, [
|
|
22892
|
+
return guard_exports.Keys(properties).reduce((result2, key2) => {
|
|
22893
|
+
return { ...result2, [key2]: FromType5(properties[key2]) };
|
|
22856
22894
|
}, {});
|
|
22857
22895
|
}
|
|
22858
22896
|
function FromTypes4(types) {
|
|
@@ -22878,11 +22916,11 @@ function CyclicInterface(context, heritage, properties) {
|
|
|
22878
22916
|
return evaluatedInterface;
|
|
22879
22917
|
}
|
|
22880
22918
|
function CyclicDefinitions(context, dependencies) {
|
|
22881
|
-
const keys = guard_exports.Keys(context).filter((
|
|
22882
|
-
return keys.reduce((result2,
|
|
22883
|
-
const type = context[
|
|
22919
|
+
const keys = guard_exports.Keys(context).filter((key2) => dependencies.includes(key2));
|
|
22920
|
+
return keys.reduce((result2, key2) => {
|
|
22921
|
+
const type = context[key2];
|
|
22884
22922
|
const instantiatedType = IsInterfaceDeferred(type) ? CyclicInterface(context, type.parameters[0], type.parameters[1]) : type;
|
|
22885
|
-
return { ...result2, [
|
|
22923
|
+
return { ...result2, [key2]: instantiatedType };
|
|
22886
22924
|
}, {});
|
|
22887
22925
|
}
|
|
22888
22926
|
function InstantiateCyclic(context, ref, type) {
|
|
@@ -23365,12 +23403,12 @@ function FromDependent(if_, then_, else_) {
|
|
|
23365
23403
|
|
|
23366
23404
|
// node_modules/typebox/build/type/engine/object/from_intersect.mjs
|
|
23367
23405
|
function CollapseIntersectProperties(left, right) {
|
|
23368
|
-
const leftKeys = guard_exports.Keys(left).filter((
|
|
23369
|
-
const rightKeys = guard_exports.Keys(right).filter((
|
|
23370
|
-
const sharedKeys = guard_exports.Keys(left).filter((
|
|
23371
|
-
const leftProperties = leftKeys.reduce((result2,
|
|
23372
|
-
const rightProperties = rightKeys.reduce((result2,
|
|
23373
|
-
const sharedProperties = sharedKeys.reduce((result2,
|
|
23406
|
+
const leftKeys = guard_exports.Keys(left).filter((key2) => !guard_exports.HasPropertyKey(right, key2));
|
|
23407
|
+
const rightKeys = guard_exports.Keys(right).filter((key2) => !guard_exports.HasPropertyKey(left, key2));
|
|
23408
|
+
const sharedKeys = guard_exports.Keys(left).filter((key2) => guard_exports.HasPropertyKey(right, key2));
|
|
23409
|
+
const leftProperties = leftKeys.reduce((result2, key2) => ({ ...result2, [key2]: left[key2] }), {});
|
|
23410
|
+
const rightProperties = rightKeys.reduce((result2, key2) => ({ ...result2, [key2]: right[key2] }), {});
|
|
23411
|
+
const sharedProperties = sharedKeys.reduce((result2, key2) => ({ ...result2, [key2]: EvaluateIntersect([left[key2], right[key2]]) }), {});
|
|
23374
23412
|
const unique = memory_exports.Assign(leftProperties, rightProperties);
|
|
23375
23413
|
const shared = memory_exports.Assign(unique, sharedProperties);
|
|
23376
23414
|
return shared;
|
|
@@ -23395,9 +23433,9 @@ function FromTuple(types) {
|
|
|
23395
23433
|
|
|
23396
23434
|
// node_modules/typebox/build/type/engine/object/from_union.mjs
|
|
23397
23435
|
function CollapseUnionProperties(left, right) {
|
|
23398
|
-
const sharedKeys = guard_exports.Keys(left).filter((
|
|
23399
|
-
const result2 = sharedKeys.reduce((result3,
|
|
23400
|
-
return { ...result3, [
|
|
23436
|
+
const sharedKeys = guard_exports.Keys(left).filter((key2) => key2 in right);
|
|
23437
|
+
const result2 = sharedKeys.reduce((result3, key2) => {
|
|
23438
|
+
return { ...result3, [key2]: EvaluateUnion([left[key2], right[key2]]) };
|
|
23401
23439
|
}, {});
|
|
23402
23440
|
return result2;
|
|
23403
23441
|
}
|
|
@@ -23519,8 +23557,8 @@ function ExpandThis(properties, type) {
|
|
|
23519
23557
|
}
|
|
23520
23558
|
|
|
23521
23559
|
// node_modules/typebox/build/type/engine/indexed/from_object.mjs
|
|
23522
|
-
function IndexProperty(properties,
|
|
23523
|
-
const selectedType =
|
|
23560
|
+
function IndexProperty(properties, key2) {
|
|
23561
|
+
const selectedType = key2 in properties ? properties[key2] : Never();
|
|
23524
23562
|
const result2 = ExpandThis(properties, selectedType);
|
|
23525
23563
|
return result2;
|
|
23526
23564
|
}
|
|
@@ -23537,7 +23575,7 @@ function FromIndexer(properties, indexer) {
|
|
|
23537
23575
|
}
|
|
23538
23576
|
var NumericKeyPattern = new RegExp(IntegerKey);
|
|
23539
23577
|
function NumericKeys(keys) {
|
|
23540
|
-
const result2 = keys.filter((
|
|
23578
|
+
const result2 = keys.filter((key2) => NumericKeyPattern.test(key2));
|
|
23541
23579
|
return result2;
|
|
23542
23580
|
}
|
|
23543
23581
|
function FromIndexerNumber(properties) {
|
|
@@ -23767,16 +23805,16 @@ function MappedInstantiate(context, state, identifier, type, as, property, optio
|
|
|
23767
23805
|
// node_modules/typebox/build/type/engine/module/instantiate.mjs
|
|
23768
23806
|
function InstantiateCyclics(context, declarations, cyclicKeys) {
|
|
23769
23807
|
const declarationContext = memory_exports.Assign(context, declarations);
|
|
23770
|
-
const declarationKeys = guard_exports.Keys(declarations).filter((
|
|
23771
|
-
return declarationKeys.reduce((result2,
|
|
23772
|
-
return { ...result2, [
|
|
23808
|
+
const declarationKeys = guard_exports.Keys(declarations).filter((key2) => cyclicKeys.includes(key2));
|
|
23809
|
+
return declarationKeys.reduce((result2, key2) => {
|
|
23810
|
+
return { ...result2, [key2]: InstantiateCyclic(declarationContext, key2, declarations[key2]) };
|
|
23773
23811
|
}, {});
|
|
23774
23812
|
}
|
|
23775
23813
|
function InstantiateNonCyclics(context, declarations, cyclicKeys) {
|
|
23776
23814
|
const declarationContext = memory_exports.Assign(context, declarations);
|
|
23777
|
-
const declarationKeys = guard_exports.Keys(declarations).filter((
|
|
23778
|
-
return declarationKeys.reduce((result2,
|
|
23779
|
-
return { ...result2, [
|
|
23815
|
+
const declarationKeys = guard_exports.Keys(declarations).filter((key2) => !cyclicKeys.includes(key2));
|
|
23816
|
+
return declarationKeys.reduce((result2, key2) => {
|
|
23817
|
+
return { ...result2, [key2]: InstantiateType(declarationContext, State([], []), declarations[key2]) };
|
|
23780
23818
|
}, {});
|
|
23781
23819
|
}
|
|
23782
23820
|
function InstantiateModule(context, declarations, options) {
|
|
@@ -23831,8 +23869,8 @@ function ToIndexable(type) {
|
|
|
23831
23869
|
|
|
23832
23870
|
// node_modules/typebox/build/type/engine/omit/from_type.mjs
|
|
23833
23871
|
function FromKeys(properties, keys) {
|
|
23834
|
-
const result2 = guard_exports.Keys(properties).reduce((result3,
|
|
23835
|
-
return keys.includes(
|
|
23872
|
+
const result2 = guard_exports.Keys(properties).reduce((result3, key2) => {
|
|
23873
|
+
return keys.includes(key2) ? result3 : { ...result3, [key2]: properties[key2] };
|
|
23836
23874
|
}, {});
|
|
23837
23875
|
return result2;
|
|
23838
23876
|
}
|
|
@@ -23950,8 +23988,8 @@ function Pick(type, indexer_or_keys, options = {}) {
|
|
|
23950
23988
|
|
|
23951
23989
|
// node_modules/typebox/build/type/engine/pick/from_type.mjs
|
|
23952
23990
|
function FromKeys2(properties, keys) {
|
|
23953
|
-
const result2 = guard_exports.Keys(properties).reduce((result3,
|
|
23954
|
-
return keys.includes(
|
|
23991
|
+
const result2 = guard_exports.Keys(properties).reduce((result3, key2) => {
|
|
23992
|
+
return keys.includes(key2) ? memory_exports.Assign(result3, { [key2]: properties[key2] }) : result3;
|
|
23955
23993
|
}, {});
|
|
23956
23994
|
return result2;
|
|
23957
23995
|
}
|
|
@@ -24171,8 +24209,8 @@ function CanInstantiate(types) {
|
|
|
24171
24209
|
return guard_exports.ShiftLeft(types, (left, right) => IsRef(left) ? false : CanInstantiate(right), () => true);
|
|
24172
24210
|
}
|
|
24173
24211
|
function InstantiateProperties(context, state, properties) {
|
|
24174
|
-
return guard_exports.Keys(properties).reduce((result2,
|
|
24175
|
-
return { ...result2, [
|
|
24212
|
+
return guard_exports.Keys(properties).reduce((result2, key2) => {
|
|
24213
|
+
return { ...result2, [key2]: InstantiateType(context, state, properties[key2]) };
|
|
24176
24214
|
}, {});
|
|
24177
24215
|
}
|
|
24178
24216
|
function InstantiateElements(context, state, types) {
|
|
@@ -24699,8 +24737,8 @@ var CheckContext = class {
|
|
|
24699
24737
|
this.GetIndices().add(index);
|
|
24700
24738
|
return true;
|
|
24701
24739
|
}
|
|
24702
|
-
AddKey(
|
|
24703
|
-
this.GetKeys().add(
|
|
24740
|
+
AddKey(key2) {
|
|
24741
|
+
this.GetKeys().add(key2);
|
|
24704
24742
|
return true;
|
|
24705
24743
|
}
|
|
24706
24744
|
GetIndices() {
|
|
@@ -24793,7 +24831,7 @@ function RegisterResourceAnchors(anchors, schema, isRoot = true) {
|
|
|
24793
24831
|
if (!isRoot && IsId(schema))
|
|
24794
24832
|
return anchors;
|
|
24795
24833
|
const next = !isRoot && IsDynamicAnchor(schema) ? [...anchors, schema] : anchors;
|
|
24796
|
-
return Object.keys(schema).reduce((result2,
|
|
24834
|
+
return Object.keys(schema).reduce((result2, key2) => RegisterResourceAnchors(result2, schema[key2], false), next);
|
|
24797
24835
|
}
|
|
24798
24836
|
function ResourceEntry(stack, schema) {
|
|
24799
24837
|
return stack.resourceEntries.get(schema);
|
|
@@ -24896,8 +24934,8 @@ function UnicodeRegExp(pattern) {
|
|
|
24896
24934
|
}
|
|
24897
24935
|
|
|
24898
24936
|
// node_modules/typebox/build/schema/engine/additionalProperties.mjs
|
|
24899
|
-
function GetPropertyKeyAsPattern(
|
|
24900
|
-
const escaped =
|
|
24937
|
+
function GetPropertyKeyAsPattern(key2) {
|
|
24938
|
+
const escaped = key2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
24901
24939
|
return `^${escaped}$`;
|
|
24902
24940
|
}
|
|
24903
24941
|
function GetPropertiesPattern(schema) {
|
|
@@ -24910,20 +24948,20 @@ function GetPropertiesPattern(schema) {
|
|
|
24910
24948
|
}
|
|
24911
24949
|
function CheckAdditionalProperties(stack, context, schema, value) {
|
|
24912
24950
|
const regexp = UnicodeRegExp(GetPropertiesPattern(schema));
|
|
24913
|
-
const isAdditionalProperties = guard_exports.Every(guard_exports.Keys(value), 0, (
|
|
24914
|
-
return regexp.test(
|
|
24951
|
+
const isAdditionalProperties = guard_exports.Every(guard_exports.Keys(value), 0, (key2, _index) => {
|
|
24952
|
+
return regexp.test(key2) || CheckSchemaPushStack(stack, context, schema.additionalProperties, value[key2]) && context.AddKey(key2);
|
|
24915
24953
|
});
|
|
24916
24954
|
return isAdditionalProperties;
|
|
24917
24955
|
}
|
|
24918
24956
|
function ErrorAdditionalProperties(stack, context, schemaPath, instancePath, schema, value) {
|
|
24919
24957
|
const regexp = UnicodeRegExp(GetPropertiesPattern(schema));
|
|
24920
24958
|
const additionalProperties = [];
|
|
24921
|
-
const isAdditionalProperties = guard_exports.EveryAll(guard_exports.Keys(value), 0, (
|
|
24959
|
+
const isAdditionalProperties = guard_exports.EveryAll(guard_exports.Keys(value), 0, (key2, _index) => {
|
|
24922
24960
|
const nextSchemaPath = `${schemaPath}/additionalProperties`;
|
|
24923
|
-
const nextInstancePath = `${instancePath}/${EncodeFragment(
|
|
24924
|
-
const isAdditionalProperty = regexp.test(
|
|
24961
|
+
const nextInstancePath = `${instancePath}/${EncodeFragment(key2)}`;
|
|
24962
|
+
const isAdditionalProperty = regexp.test(key2) || ErrorSchemaPushStack(stack, context, nextSchemaPath, nextInstancePath, schema.additionalProperties, value[key2]) && context.AddKey(key2);
|
|
24925
24963
|
if (!isAdditionalProperty)
|
|
24926
|
-
additionalProperties.push(
|
|
24964
|
+
additionalProperties.push(key2);
|
|
24927
24965
|
return isAdditionalProperty;
|
|
24928
24966
|
});
|
|
24929
24967
|
return isAdditionalProperties || context.AddError("additionalProperties", schemaPath, instancePath, { additionalProperties });
|
|
@@ -25011,16 +25049,16 @@ function ErrorContains(stack, context, schemaPath, instancePath, schema, value)
|
|
|
25011
25049
|
// node_modules/typebox/build/schema/engine/dependencies.mjs
|
|
25012
25050
|
function CheckDependencies(stack, context, schema, value) {
|
|
25013
25051
|
const isLength = guard_exports.IsEqual(guard_exports.Keys(value).length, 0);
|
|
25014
|
-
const isEvery = guard_exports.Every(guard_exports.Entries(schema.dependencies), 0, ([
|
|
25015
|
-
return !guard_exports.HasPropertyKey(value,
|
|
25052
|
+
const isEvery = guard_exports.Every(guard_exports.Entries(schema.dependencies), 0, ([key2, schema2]) => {
|
|
25053
|
+
return !guard_exports.HasPropertyKey(value, key2) || (guard_exports.IsArray(schema2) ? schema2.every((key3) => guard_exports.HasPropertyKey(value, key3)) : CheckSchema(stack, context, schema2, value));
|
|
25016
25054
|
});
|
|
25017
25055
|
return isLength || isEvery;
|
|
25018
25056
|
}
|
|
25019
25057
|
function ErrorDependencies(stack, context, schemaPath, instancePath, schema, value) {
|
|
25020
25058
|
const isLength = guard_exports.IsEqual(guard_exports.Keys(value).length, 0);
|
|
25021
|
-
const isEvery = guard_exports.EveryAll(guard_exports.Entries(schema.dependencies), 0, ([
|
|
25022
|
-
const nextSchemaPath = `${schemaPath}/dependencies/${EncodeFragment(
|
|
25023
|
-
return !guard_exports.HasPropertyKey(value,
|
|
25059
|
+
const isEvery = guard_exports.EveryAll(guard_exports.Entries(schema.dependencies), 0, ([key2, schema2]) => {
|
|
25060
|
+
const nextSchemaPath = `${schemaPath}/dependencies/${EncodeFragment(key2)}`;
|
|
25061
|
+
return !guard_exports.HasPropertyKey(value, key2) || (guard_exports.IsArray(schema2) ? schema2.every((dependency) => guard_exports.HasPropertyKey(value, dependency) || context.AddError("dependencies", schemaPath, instancePath, { property: key2, dependencies: schema2 })) : ErrorSchema(stack, context, nextSchemaPath, instancePath, schema2, value));
|
|
25024
25062
|
});
|
|
25025
25063
|
return isLength || isEvery;
|
|
25026
25064
|
}
|
|
@@ -25028,15 +25066,15 @@ function ErrorDependencies(stack, context, schemaPath, instancePath, schema, val
|
|
|
25028
25066
|
// node_modules/typebox/build/schema/engine/dependentRequired.mjs
|
|
25029
25067
|
function CheckDependentRequired(_stack, _context, schema, value) {
|
|
25030
25068
|
const isLength = guard_exports.IsEqual(guard_exports.Keys(value).length, 0);
|
|
25031
|
-
const isEvery = guard_exports.Every(guard_exports.Entries(schema.dependentRequired), 0, ([
|
|
25032
|
-
return !guard_exports.HasPropertyKey(value,
|
|
25069
|
+
const isEvery = guard_exports.Every(guard_exports.Entries(schema.dependentRequired), 0, ([key2, keys]) => {
|
|
25070
|
+
return !guard_exports.HasPropertyKey(value, key2) || keys.every((key3) => guard_exports.HasPropertyKey(value, key3));
|
|
25033
25071
|
});
|
|
25034
25072
|
return isLength || isEvery;
|
|
25035
25073
|
}
|
|
25036
25074
|
function ErrorDependentRequired(_stack, context, schemaPath, instancePath, schema, value) {
|
|
25037
25075
|
const isLength = guard_exports.IsEqual(guard_exports.Keys(value).length, 0);
|
|
25038
|
-
const isEveryEntry = guard_exports.EveryAll(guard_exports.Entries(schema.dependentRequired), 0, ([
|
|
25039
|
-
return !guard_exports.HasPropertyKey(value,
|
|
25076
|
+
const isEveryEntry = guard_exports.EveryAll(guard_exports.Entries(schema.dependentRequired), 0, ([key2, keys]) => {
|
|
25077
|
+
return !guard_exports.HasPropertyKey(value, key2) || guard_exports.EveryAll(keys, 0, (dependency) => guard_exports.HasPropertyKey(value, dependency) || context.AddError("dependentRequired", schemaPath, instancePath, { property: key2, dependencies: keys }));
|
|
25040
25078
|
});
|
|
25041
25079
|
return isLength || isEveryEntry;
|
|
25042
25080
|
}
|
|
@@ -25044,16 +25082,16 @@ function ErrorDependentRequired(_stack, context, schemaPath, instancePath, schem
|
|
|
25044
25082
|
// node_modules/typebox/build/schema/engine/dependentSchemas.mjs
|
|
25045
25083
|
function CheckDependentSchemas(stack, context, schema, value) {
|
|
25046
25084
|
const isLength = guard_exports.IsEqual(guard_exports.Keys(value).length, 0);
|
|
25047
|
-
const isEvery = guard_exports.Every(guard_exports.Entries(schema.dependentSchemas), 0, ([
|
|
25048
|
-
return !guard_exports.HasPropertyKey(value,
|
|
25085
|
+
const isEvery = guard_exports.Every(guard_exports.Entries(schema.dependentSchemas), 0, ([key2, schema2]) => {
|
|
25086
|
+
return !guard_exports.HasPropertyKey(value, key2) || CheckSchema(stack, context, schema2, value);
|
|
25049
25087
|
});
|
|
25050
25088
|
return isLength || isEvery;
|
|
25051
25089
|
}
|
|
25052
25090
|
function ErrorDependentSchemas(stack, context, schemaPath, instancePath, schema, value) {
|
|
25053
25091
|
const isLength = guard_exports.IsEqual(guard_exports.Keys(value).length, 0);
|
|
25054
|
-
const isEvery = guard_exports.EveryAll(guard_exports.Entries(schema.dependentSchemas), 0, ([
|
|
25055
|
-
const nextSchemaPath = `${schemaPath}/dependentSchemas/${EncodeFragment(
|
|
25056
|
-
return !guard_exports.HasPropertyKey(value,
|
|
25092
|
+
const isEvery = guard_exports.EveryAll(guard_exports.Entries(schema.dependentSchemas), 0, ([key2, schema2]) => {
|
|
25093
|
+
const nextSchemaPath = `${schemaPath}/dependentSchemas/${EncodeFragment(key2)}`;
|
|
25094
|
+
return !guard_exports.HasPropertyKey(value, key2) || ErrorSchema(stack, context, nextSchemaPath, instancePath, schema2, value);
|
|
25057
25095
|
});
|
|
25058
25096
|
return isLength || isEvery;
|
|
25059
25097
|
}
|
|
@@ -25165,8 +25203,8 @@ function SearchDynamicAnchor(schema, name) {
|
|
|
25165
25203
|
return schema;
|
|
25166
25204
|
}
|
|
25167
25205
|
if (guard_exports.IsObject(schema)) {
|
|
25168
|
-
for (const
|
|
25169
|
-
const result2 = SearchDynamicAnchor(schema[
|
|
25206
|
+
for (const key2 of guard_exports.Keys(schema)) {
|
|
25207
|
+
const result2 = SearchDynamicAnchor(schema[key2], name);
|
|
25170
25208
|
if (result2)
|
|
25171
25209
|
return result2;
|
|
25172
25210
|
}
|
|
@@ -25184,8 +25222,8 @@ function SearchBase(schema, base, target) {
|
|
|
25184
25222
|
return result2;
|
|
25185
25223
|
}
|
|
25186
25224
|
} else if (guard_exports.IsObject(schema)) {
|
|
25187
|
-
for (const
|
|
25188
|
-
const result2 = SearchBase(schema[
|
|
25225
|
+
for (const key2 of guard_exports.Keys(schema)) {
|
|
25226
|
+
const result2 = SearchBase(schema[key2], nextBase, target);
|
|
25189
25227
|
if (!guard_exports.IsUndefined(result2))
|
|
25190
25228
|
return result2;
|
|
25191
25229
|
}
|
|
@@ -25243,10 +25281,10 @@ function MatchFromArray(schema, base, ref) {
|
|
|
25243
25281
|
function MatchFromObject(schema, base, ref) {
|
|
25244
25282
|
if (!guard_exports.IsObject(schema))
|
|
25245
25283
|
return void 0;
|
|
25246
|
-
return guard_exports.Keys(schema).reduce((result2,
|
|
25247
|
-
if (guard_exports.IsEqual(
|
|
25284
|
+
return guard_exports.Keys(schema).reduce((result2, key2) => {
|
|
25285
|
+
if (guard_exports.IsEqual(key2, "const") || guard_exports.IsEqual(key2, "enum"))
|
|
25248
25286
|
return result2;
|
|
25249
|
-
const match = Match4(schema[
|
|
25287
|
+
const match = Match4(schema[key2], base, ref);
|
|
25250
25288
|
return !guard_exports.IsUndefined(match) ? match : result2;
|
|
25251
25289
|
}, void 0);
|
|
25252
25290
|
}
|
|
@@ -26197,8 +26235,8 @@ function ErrorPattern(stack, context, schemaPath, instancePath, schema, value) {
|
|
|
26197
26235
|
function CheckPatternProperties(stack, context, schema, value) {
|
|
26198
26236
|
return guard_exports.Every(guard_exports.Entries(schema.patternProperties), 0, ([pattern, schema2]) => {
|
|
26199
26237
|
const regexp = UnicodeRegExp(pattern);
|
|
26200
|
-
return guard_exports.Every(guard_exports.Entries(value), 0, ([
|
|
26201
|
-
return !regexp.test(
|
|
26238
|
+
return guard_exports.Every(guard_exports.Entries(value), 0, ([key2, prop]) => {
|
|
26239
|
+
return !regexp.test(key2) || CheckSchemaPushStack(stack, context, schema2, prop) && context.AddKey(key2);
|
|
26202
26240
|
});
|
|
26203
26241
|
});
|
|
26204
26242
|
}
|
|
@@ -26206,10 +26244,10 @@ function ErrorPatternProperties(stack, context, schemaPath, instancePath, schema
|
|
|
26206
26244
|
return guard_exports.EveryAll(guard_exports.Entries(schema.patternProperties), 0, ([pattern, schema2]) => {
|
|
26207
26245
|
const nextSchemaPath = `${schemaPath}/patternProperties/${EncodeFragment(pattern)}`;
|
|
26208
26246
|
const regexp = UnicodeRegExp(pattern);
|
|
26209
|
-
return guard_exports.EveryAll(guard_exports.Entries(value), 0, ([
|
|
26210
|
-
const nextInstancePath = `${instancePath}/${EncodeFragment(
|
|
26211
|
-
const notKey = !regexp.test(
|
|
26212
|
-
return notKey || ErrorSchemaPushStack(stack, context, nextSchemaPath, nextInstancePath, schema2, value2) && context.AddKey(
|
|
26247
|
+
return guard_exports.EveryAll(guard_exports.Entries(value), 0, ([key2, value2]) => {
|
|
26248
|
+
const nextInstancePath = `${instancePath}/${EncodeFragment(key2)}`;
|
|
26249
|
+
const notKey = !regexp.test(key2);
|
|
26250
|
+
return notKey || ErrorSchemaPushStack(stack, context, nextSchemaPath, nextInstancePath, schema2, value2) && context.AddKey(key2);
|
|
26213
26251
|
});
|
|
26214
26252
|
});
|
|
26215
26253
|
}
|
|
@@ -26229,45 +26267,45 @@ function ErrorPrefixItems(stack, context, schemaPath, instancePath, schema, valu
|
|
|
26229
26267
|
}
|
|
26230
26268
|
|
|
26231
26269
|
// node_modules/typebox/build/schema/engine/_exact_optional.mjs
|
|
26232
|
-
function IsExactOptional(required2,
|
|
26233
|
-
return required2.includes(
|
|
26270
|
+
function IsExactOptional(required2, key2) {
|
|
26271
|
+
return required2.includes(key2) || settings_exports.Get().exactOptionalPropertyTypes;
|
|
26234
26272
|
}
|
|
26235
|
-
function InexactOptionalCheck(value,
|
|
26236
|
-
return guard_exports.IsUndefined(value[
|
|
26273
|
+
function InexactOptionalCheck(value, key2) {
|
|
26274
|
+
return guard_exports.IsUndefined(value[key2]);
|
|
26237
26275
|
}
|
|
26238
26276
|
|
|
26239
26277
|
// node_modules/typebox/build/schema/engine/properties.mjs
|
|
26240
26278
|
function CheckProperties(stack, context, schema, value) {
|
|
26241
26279
|
const required2 = IsRequired(schema) ? schema.required : [];
|
|
26242
|
-
const isProperties = guard_exports.Every(guard_exports.Entries(schema.properties), 0, ([
|
|
26243
|
-
const isProperty = !guard_exports.HasPropertyKey(value,
|
|
26244
|
-
return IsExactOptional(required2,
|
|
26280
|
+
const isProperties = guard_exports.Every(guard_exports.Entries(schema.properties), 0, ([key2, schema2]) => {
|
|
26281
|
+
const isProperty = !guard_exports.HasPropertyKey(value, key2) || CheckSchemaPushStack(stack, context, schema2, value[key2]) && context.AddKey(key2);
|
|
26282
|
+
return IsExactOptional(required2, key2) ? isProperty : InexactOptionalCheck(value, key2) || isProperty;
|
|
26245
26283
|
});
|
|
26246
26284
|
return isProperties;
|
|
26247
26285
|
}
|
|
26248
26286
|
function ErrorProperties(stack, context, schemaPath, instancePath, schema, value) {
|
|
26249
26287
|
const required2 = IsRequired(schema) ? schema.required : [];
|
|
26250
|
-
const isProperties = guard_exports.EveryAll(guard_exports.Entries(schema.properties), 0, ([
|
|
26251
|
-
const nextSchemaPath = `${schemaPath}/properties/${EncodeFragment(
|
|
26252
|
-
const nextInstancePath = `${instancePath}/${EncodeFragment(
|
|
26253
|
-
const isProperty = () => !guard_exports.HasPropertyKey(value,
|
|
26254
|
-
return IsExactOptional(required2,
|
|
26288
|
+
const isProperties = guard_exports.EveryAll(guard_exports.Entries(schema.properties), 0, ([key2, schema2]) => {
|
|
26289
|
+
const nextSchemaPath = `${schemaPath}/properties/${EncodeFragment(key2)}`;
|
|
26290
|
+
const nextInstancePath = `${instancePath}/${EncodeFragment(key2)}`;
|
|
26291
|
+
const isProperty = () => !guard_exports.HasPropertyKey(value, key2) || ErrorSchemaPushStack(stack, context, nextSchemaPath, nextInstancePath, schema2, value[key2]) && context.AddKey(key2);
|
|
26292
|
+
return IsExactOptional(required2, key2) ? isProperty() : InexactOptionalCheck(value, key2) || isProperty();
|
|
26255
26293
|
});
|
|
26256
26294
|
return isProperties;
|
|
26257
26295
|
}
|
|
26258
26296
|
|
|
26259
26297
|
// node_modules/typebox/build/schema/engine/propertyNames.mjs
|
|
26260
26298
|
function CheckPropertyNames(stack, context, schema, value) {
|
|
26261
|
-
return guard_exports.Every(guard_exports.Keys(value), 0, (
|
|
26299
|
+
return guard_exports.Every(guard_exports.Keys(value), 0, (key2, _index) => CheckSchema(stack, context, schema.propertyNames, key2));
|
|
26262
26300
|
}
|
|
26263
26301
|
function ErrorPropertyNames(stack, context, schemaPath, instancePath, schema, value) {
|
|
26264
26302
|
const propertyNames = [];
|
|
26265
|
-
const isPropertyNames = guard_exports.EveryAll(guard_exports.Keys(value), 0, (
|
|
26266
|
-
const nextInstancePath = `${instancePath}/${EncodeFragment(
|
|
26303
|
+
const isPropertyNames = guard_exports.EveryAll(guard_exports.Keys(value), 0, (key2, _index) => {
|
|
26304
|
+
const nextInstancePath = `${instancePath}/${EncodeFragment(key2)}`;
|
|
26267
26305
|
const nextSchemaPath = `${schemaPath}/propertyNames`;
|
|
26268
|
-
const isPropertyName = ErrorSchema(stack, context, nextSchemaPath, nextInstancePath, schema.propertyNames,
|
|
26306
|
+
const isPropertyName = ErrorSchema(stack, context, nextSchemaPath, nextInstancePath, schema.propertyNames, key2);
|
|
26269
26307
|
if (!isPropertyName)
|
|
26270
|
-
propertyNames.push(
|
|
26308
|
+
propertyNames.push(key2);
|
|
26271
26309
|
return isPropertyName;
|
|
26272
26310
|
});
|
|
26273
26311
|
return isPropertyNames || context.AddError("propertyNames", schemaPath, instancePath, { propertyNames });
|
|
@@ -26309,14 +26347,14 @@ function ErrorRef(stack, context, schemaPath, instancePath, schema, value) {
|
|
|
26309
26347
|
|
|
26310
26348
|
// node_modules/typebox/build/schema/engine/required.mjs
|
|
26311
26349
|
function CheckRequired(_stack, _context, schema, value) {
|
|
26312
|
-
return guard_exports.Every(schema.required, 0, (
|
|
26350
|
+
return guard_exports.Every(schema.required, 0, (key2) => guard_exports.HasPropertyKey(value, key2));
|
|
26313
26351
|
}
|
|
26314
26352
|
function ErrorRequired(_stack, context, schemaPath, instancePath, schema, value) {
|
|
26315
26353
|
const requiredProperties = [];
|
|
26316
|
-
const isRequired = guard_exports.EveryAll(schema.required, 0, (
|
|
26317
|
-
const hasKey = guard_exports.HasPropertyKey(value,
|
|
26354
|
+
const isRequired = guard_exports.EveryAll(schema.required, 0, (key2) => {
|
|
26355
|
+
const hasKey = guard_exports.HasPropertyKey(value, key2);
|
|
26318
26356
|
if (!hasKey)
|
|
26319
|
-
requiredProperties.push(
|
|
26357
|
+
requiredProperties.push(key2);
|
|
26320
26358
|
return hasKey;
|
|
26321
26359
|
});
|
|
26322
26360
|
return isRequired || context.AddError("required", schemaPath, instancePath, { requiredProperties });
|
|
@@ -26366,18 +26404,18 @@ function ErrorUnevaluatedItems(stack, context, schemaPath, instancePath, schema,
|
|
|
26366
26404
|
// node_modules/typebox/build/schema/engine/unevaluatedProperties.mjs
|
|
26367
26405
|
function CheckUnevaluatedProperties(stack, context, schema, value) {
|
|
26368
26406
|
const keys = context.GetKeys();
|
|
26369
|
-
return guard_exports.Every(guard_exports.Entries(value), 0, ([
|
|
26370
|
-
return keys.has(
|
|
26407
|
+
return guard_exports.Every(guard_exports.Entries(value), 0, ([key2, prop]) => {
|
|
26408
|
+
return keys.has(key2) || CheckSchema(stack, context, schema.unevaluatedProperties, prop) && context.AddKey(key2);
|
|
26371
26409
|
});
|
|
26372
26410
|
}
|
|
26373
26411
|
function ErrorUnevaluatedProperties(stack, context, schemaPath, instancePath, schema, value) {
|
|
26374
26412
|
const keys = context.GetKeys();
|
|
26375
26413
|
const unevaluatedProperties = [];
|
|
26376
|
-
const isUnevaluatedProperties = guard_exports.EveryAll(guard_exports.Entries(value), 0, ([
|
|
26414
|
+
const isUnevaluatedProperties = guard_exports.EveryAll(guard_exports.Entries(value), 0, ([key2, prop]) => {
|
|
26377
26415
|
const nextContext = new ErrorContext();
|
|
26378
|
-
const isEvaluatedProperty = keys.has(
|
|
26416
|
+
const isEvaluatedProperty = keys.has(key2) || ErrorSchema(stack, nextContext, schemaPath, instancePath, schema.unevaluatedProperties, prop) && context.AddKey(key2);
|
|
26379
26417
|
if (!isEvaluatedProperty)
|
|
26380
|
-
unevaluatedProperties.push(
|
|
26418
|
+
unevaluatedProperties.push(key2);
|
|
26381
26419
|
return isEvaluatedProperty;
|
|
26382
26420
|
});
|
|
26383
26421
|
return isUnevaluatedProperties || context.AddError("unevaluatedProperties", schemaPath, instancePath, { unevaluatedProperties });
|
|
@@ -26534,20 +26572,20 @@ function FromObject10(context, type, value) {
|
|
|
26534
26572
|
if (!guard_exports.IsObject(value) || guard_exports.IsArray(value))
|
|
26535
26573
|
return value;
|
|
26536
26574
|
const additionalProperties = GetAdditionalProperties(type);
|
|
26537
|
-
for (const
|
|
26538
|
-
if (guard_exports.HasPropertyKey(type.properties,
|
|
26539
|
-
value[
|
|
26575
|
+
for (const key2 of guard_exports.Keys(value)) {
|
|
26576
|
+
if (guard_exports.HasPropertyKey(type.properties, key2) && IsSchema(type.properties[key2])) {
|
|
26577
|
+
value[key2] = FromType19(context, type.properties[key2], value[key2]);
|
|
26540
26578
|
continue;
|
|
26541
26579
|
}
|
|
26542
26580
|
const unknownCheck = (
|
|
26543
26581
|
// 1. additionalProperties: true
|
|
26544
|
-
guard_exports.IsBoolean(additionalProperties) && guard_exports.IsEqual(additionalProperties, true) || IsSchema(additionalProperties) && Check2(context, additionalProperties, value[
|
|
26582
|
+
guard_exports.IsBoolean(additionalProperties) && guard_exports.IsEqual(additionalProperties, true) || IsSchema(additionalProperties) && Check2(context, additionalProperties, value[key2])
|
|
26545
26583
|
);
|
|
26546
26584
|
if (unknownCheck) {
|
|
26547
|
-
value[
|
|
26585
|
+
value[key2] = FromType19(context, additionalProperties, value[key2]);
|
|
26548
26586
|
continue;
|
|
26549
26587
|
}
|
|
26550
|
-
delete value[
|
|
26588
|
+
delete value[key2];
|
|
26551
26589
|
}
|
|
26552
26590
|
return value;
|
|
26553
26591
|
}
|
|
@@ -26558,20 +26596,20 @@ function FromRecord3(context, type, value) {
|
|
|
26558
26596
|
return value;
|
|
26559
26597
|
const additionalProperties = GetAdditionalProperties(type);
|
|
26560
26598
|
const [recordPattern, recordValue] = [new RegExp(RecordPattern(type)), RecordValue(type)];
|
|
26561
|
-
for (const
|
|
26562
|
-
if (recordPattern.test(
|
|
26563
|
-
value[
|
|
26599
|
+
for (const key2 of guard_exports.Keys(value)) {
|
|
26600
|
+
if (recordPattern.test(key2)) {
|
|
26601
|
+
value[key2] = FromType19(context, recordValue, value[key2]);
|
|
26564
26602
|
continue;
|
|
26565
26603
|
}
|
|
26566
26604
|
const unknownCheck = (
|
|
26567
26605
|
// 1. additionalProperties: true
|
|
26568
|
-
guard_exports.IsBoolean(additionalProperties) && guard_exports.IsEqual(additionalProperties, true) || IsSchema(additionalProperties) && Check2(context, additionalProperties, value[
|
|
26606
|
+
guard_exports.IsBoolean(additionalProperties) && guard_exports.IsEqual(additionalProperties, true) || IsSchema(additionalProperties) && Check2(context, additionalProperties, value[key2])
|
|
26569
26607
|
);
|
|
26570
26608
|
if (unknownCheck) {
|
|
26571
|
-
value[
|
|
26609
|
+
value[key2] = FromType19(context, additionalProperties, value[key2]);
|
|
26572
26610
|
continue;
|
|
26573
26611
|
}
|
|
26574
|
-
delete value[
|
|
26612
|
+
delete value[key2];
|
|
26575
26613
|
}
|
|
26576
26614
|
return value;
|
|
26577
26615
|
}
|
|
@@ -26614,17 +26652,17 @@ function FromType19(context, type, value) {
|
|
|
26614
26652
|
|
|
26615
26653
|
// node_modules/typebox/build/value/shared/union_priority_sort.mjs
|
|
26616
26654
|
function Modifiers(type, next) {
|
|
26617
|
-
for (const
|
|
26618
|
-
if (guard_default.HasPropertyKey(next,
|
|
26655
|
+
for (const key2 of guard_default.Keys(type)) {
|
|
26656
|
+
if (guard_default.HasPropertyKey(next, key2))
|
|
26619
26657
|
continue;
|
|
26620
|
-
next[
|
|
26658
|
+
next[key2] = type[key2];
|
|
26621
26659
|
}
|
|
26622
26660
|
return next;
|
|
26623
26661
|
}
|
|
26624
26662
|
function FromProperties4(properties) {
|
|
26625
26663
|
const result2 = {};
|
|
26626
|
-
for (const
|
|
26627
|
-
result2[
|
|
26664
|
+
for (const key2 of guard_default.Keys(properties))
|
|
26665
|
+
result2[key2] = FromType20(properties[key2]);
|
|
26628
26666
|
return result2;
|
|
26629
26667
|
}
|
|
26630
26668
|
function FromRecordKey(type) {
|
|
@@ -26874,9 +26912,9 @@ function FromNumber5(_context, _type, value) {
|
|
|
26874
26912
|
function FromAdditionalProperties(context, entries, additionalProperties, value) {
|
|
26875
26913
|
const keys = guard_exports.Keys(value);
|
|
26876
26914
|
for (const [regexp, _] of entries) {
|
|
26877
|
-
for (const
|
|
26878
|
-
if (!regexp.test(
|
|
26879
|
-
value[
|
|
26915
|
+
for (const key2 of keys) {
|
|
26916
|
+
if (!regexp.test(key2)) {
|
|
26917
|
+
value[key2] = FromType21(context, additionalProperties, value[key2]);
|
|
26880
26918
|
}
|
|
26881
26919
|
}
|
|
26882
26920
|
}
|
|
@@ -26884,8 +26922,8 @@ function FromAdditionalProperties(context, entries, additionalProperties, value)
|
|
|
26884
26922
|
}
|
|
26885
26923
|
|
|
26886
26924
|
// node_modules/typebox/build/value/shared/optional_undefined.mjs
|
|
26887
|
-
function IsOptionalUndefined(property,
|
|
26888
|
-
return IsOptional(property) && guard_exports.IsUndefined(value[
|
|
26925
|
+
function IsOptionalUndefined(property, key2, value) {
|
|
26926
|
+
return IsOptional(property) && guard_exports.IsUndefined(value[key2]);
|
|
26889
26927
|
}
|
|
26890
26928
|
|
|
26891
26929
|
// node_modules/typebox/build/value/convert/from_object.mjs
|
|
@@ -26893,10 +26931,10 @@ function FromProperties5(context, type, value) {
|
|
|
26893
26931
|
const entries = guard_exports.EntriesRegExp(type.properties);
|
|
26894
26932
|
const keys = guard_exports.Keys(value);
|
|
26895
26933
|
for (const [regexp, property] of entries) {
|
|
26896
|
-
for (const
|
|
26897
|
-
if (!regexp.test(
|
|
26934
|
+
for (const key2 of keys) {
|
|
26935
|
+
if (!regexp.test(key2) || IsOptionalUndefined(property, key2, value))
|
|
26898
26936
|
continue;
|
|
26899
|
-
value[
|
|
26937
|
+
value[key2] = FromType21(context, property, value[key2]);
|
|
26900
26938
|
}
|
|
26901
26939
|
}
|
|
26902
26940
|
return guard_exports.HasPropertyKey(type, "additionalProperties") && guard_exports.IsObject(type.additionalProperties) ? FromAdditionalProperties(context, entries, type.additionalProperties, value) : value;
|
|
@@ -26910,9 +26948,9 @@ function FromPatternProperties(context, type, value) {
|
|
|
26910
26948
|
const entries = guard_exports.EntriesRegExp(type.patternProperties);
|
|
26911
26949
|
const keys = guard_exports.Keys(value);
|
|
26912
26950
|
for (const [regexp, schema] of entries) {
|
|
26913
|
-
for (const
|
|
26914
|
-
if (regexp.test(
|
|
26915
|
-
value[
|
|
26951
|
+
for (const key2 of keys) {
|
|
26952
|
+
if (regexp.test(key2)) {
|
|
26953
|
+
value[key2] = FromType21(context, schema, value[key2]);
|
|
26916
26954
|
}
|
|
26917
26955
|
}
|
|
26918
26956
|
}
|
|
@@ -26959,8 +26997,8 @@ function FromUnion10(context, type, value) {
|
|
|
26959
26997
|
const matched = type.anyOf.some((type2) => Check2(context, type2, value));
|
|
26960
26998
|
if (matched)
|
|
26961
26999
|
return value;
|
|
26962
|
-
const
|
|
26963
|
-
const selected =
|
|
27000
|
+
const candidates2 = type.anyOf.map((type2) => FromType21(context, type2, Clone2(value)));
|
|
27001
|
+
const selected = candidates2.find((value2) => Check2(context, type, value2));
|
|
26964
27002
|
return guard_exports.IsUndefined(selected) ? value : selected;
|
|
26965
27003
|
}
|
|
26966
27004
|
|
|
@@ -27018,19 +27056,19 @@ function FromObject12(context, type, value) {
|
|
|
27018
27056
|
if (!guard_exports.IsObject(value))
|
|
27019
27057
|
return value;
|
|
27020
27058
|
const knownPropertyKeys = guard_exports.Keys(type.properties);
|
|
27021
|
-
for (const
|
|
27022
|
-
const propertyValue = FromType22(context, type.properties[
|
|
27023
|
-
const isUnassignableUndefined = guard_exports.IsUndefined(propertyValue) && (IsOptional(type.properties[
|
|
27059
|
+
for (const key2 of knownPropertyKeys) {
|
|
27060
|
+
const propertyValue = FromType22(context, type.properties[key2], value[key2]);
|
|
27061
|
+
const isUnassignableUndefined = guard_exports.IsUndefined(propertyValue) && (IsOptional(type.properties[key2]) || !guard_exports.HasPropertyKey(type.properties[key2], "default"));
|
|
27024
27062
|
if (isUnassignableUndefined)
|
|
27025
27063
|
continue;
|
|
27026
|
-
value[
|
|
27064
|
+
value[key2] = propertyValue;
|
|
27027
27065
|
}
|
|
27028
27066
|
if (!IsAdditionalProperties(type) || guard_exports.IsBoolean(type.additionalProperties))
|
|
27029
27067
|
return value;
|
|
27030
|
-
for (const
|
|
27031
|
-
if (knownPropertyKeys.includes(
|
|
27068
|
+
for (const key2 of guard_exports.Keys(value)) {
|
|
27069
|
+
if (knownPropertyKeys.includes(key2))
|
|
27032
27070
|
continue;
|
|
27033
|
-
value[
|
|
27071
|
+
value[key2] = FromType22(context, type.additionalProperties, value[key2]);
|
|
27034
27072
|
}
|
|
27035
27073
|
return value;
|
|
27036
27074
|
}
|
|
@@ -27040,17 +27078,17 @@ function FromRecord5(context, type, value) {
|
|
|
27040
27078
|
if (!guard_exports.IsObject(value))
|
|
27041
27079
|
return value;
|
|
27042
27080
|
const [recordKey, recordValue] = [new RegExp(RecordPattern(type)), RecordValue(type)];
|
|
27043
|
-
for (const
|
|
27044
|
-
if (!(recordKey.test(
|
|
27081
|
+
for (const key2 of guard_exports.Keys(value)) {
|
|
27082
|
+
if (!(recordKey.test(key2) && IsDefault(recordValue)))
|
|
27045
27083
|
continue;
|
|
27046
|
-
value[
|
|
27084
|
+
value[key2] = FromType22(context, recordValue, value[key2]);
|
|
27047
27085
|
}
|
|
27048
27086
|
if (!IsAdditionalProperties(type))
|
|
27049
27087
|
return value;
|
|
27050
|
-
for (const
|
|
27051
|
-
if (recordKey.test(
|
|
27088
|
+
for (const key2 of guard_exports.Keys(value)) {
|
|
27089
|
+
if (recordKey.test(key2))
|
|
27052
27090
|
continue;
|
|
27053
|
-
value[
|
|
27091
|
+
value[key2] = FromType22(context, type.additionalProperties, value[key2]);
|
|
27054
27092
|
}
|
|
27055
27093
|
return value;
|
|
27056
27094
|
}
|
|
@@ -27186,10 +27224,10 @@ function FromIntersect9(direction, context, type, value) {
|
|
|
27186
27224
|
function Decode6(direction, context, type, value) {
|
|
27187
27225
|
if (!guard_exports.IsObjectNotArray(value))
|
|
27188
27226
|
return value;
|
|
27189
|
-
for (const
|
|
27190
|
-
if (!guard_exports.HasPropertyKey(value,
|
|
27227
|
+
for (const key2 of guard_exports.Keys(type.properties)) {
|
|
27228
|
+
if (!guard_exports.HasPropertyKey(value, key2) || IsOptionalUndefined(type.properties[key2], key2, value))
|
|
27191
27229
|
continue;
|
|
27192
|
-
value[
|
|
27230
|
+
value[key2] = FromType23(direction, context, type.properties[key2], value[key2]);
|
|
27193
27231
|
}
|
|
27194
27232
|
return Callback(direction, context, type, value);
|
|
27195
27233
|
}
|
|
@@ -27197,10 +27235,10 @@ function Encode6(direction, context, type, value) {
|
|
|
27197
27235
|
const exterior = Callback(direction, context, type, value);
|
|
27198
27236
|
if (!guard_exports.IsObjectNotArray(exterior))
|
|
27199
27237
|
return exterior;
|
|
27200
|
-
for (const
|
|
27201
|
-
if (!guard_exports.HasPropertyKey(exterior,
|
|
27238
|
+
for (const key2 of guard_exports.Keys(type.properties)) {
|
|
27239
|
+
if (!guard_exports.HasPropertyKey(exterior, key2) || IsOptionalUndefined(type.properties[key2], key2, exterior))
|
|
27202
27240
|
continue;
|
|
27203
|
-
exterior[
|
|
27241
|
+
exterior[key2] = FromType23(direction, context, type.properties[key2], exterior[key2]);
|
|
27204
27242
|
}
|
|
27205
27243
|
return exterior;
|
|
27206
27244
|
}
|
|
@@ -27213,10 +27251,10 @@ function Decode7(direction, context, type, value) {
|
|
|
27213
27251
|
if (!guard_exports.IsObjectNotArray(value))
|
|
27214
27252
|
return value;
|
|
27215
27253
|
const regexp = new RegExp(RecordPattern(type));
|
|
27216
|
-
for (const
|
|
27217
|
-
if (!regexp.test(
|
|
27254
|
+
for (const key2 of guard_exports.Keys(value)) {
|
|
27255
|
+
if (!regexp.test(key2))
|
|
27218
27256
|
continue;
|
|
27219
|
-
value[
|
|
27257
|
+
value[key2] = FromType23(direction, context, RecordValue(type), value[key2]);
|
|
27220
27258
|
}
|
|
27221
27259
|
return Callback(direction, context, type, value);
|
|
27222
27260
|
}
|
|
@@ -27225,10 +27263,10 @@ function Encode7(direction, context, type, value) {
|
|
|
27225
27263
|
if (!guard_exports.IsObjectNotArray(exterior))
|
|
27226
27264
|
return exterior;
|
|
27227
27265
|
const regexp = new RegExp(RecordPattern(type));
|
|
27228
|
-
for (const
|
|
27229
|
-
if (!regexp.test(
|
|
27266
|
+
for (const key2 of guard_exports.Keys(exterior)) {
|
|
27267
|
+
if (!regexp.test(key2))
|
|
27230
27268
|
continue;
|
|
27231
|
-
exterior[
|
|
27269
|
+
exterior[key2] = FromType23(direction, context, RecordValue(type), exterior[key2]);
|
|
27232
27270
|
}
|
|
27233
27271
|
return exterior;
|
|
27234
27272
|
}
|
|
@@ -27595,13 +27633,13 @@ function consoleStatus(value) {
|
|
|
27595
27633
|
session_binding: token(v.session_binding) ?? "unknown",
|
|
27596
27634
|
readiness_scope: token(v.readiness_scope) ?? "unknown"
|
|
27597
27635
|
};
|
|
27598
|
-
for (const
|
|
27599
|
-
const s = token(v[
|
|
27600
|
-
if (s) result2[
|
|
27636
|
+
for (const key2 of ["vm", "lease_id", "console_id", "backend", "source"]) {
|
|
27637
|
+
const s = token(v[key2]);
|
|
27638
|
+
if (s) result2[key2] = s;
|
|
27601
27639
|
}
|
|
27602
27640
|
if (v.environment_fingerprint === null) result2.environment_fingerprint = null;
|
|
27603
27641
|
else if (token(v.environment_fingerprint)) result2.environment_fingerprint = token(v.environment_fingerprint);
|
|
27604
|
-
for (const
|
|
27642
|
+
for (const key2 of ["observed_at", "access_expires_at"]) if (typeof v[key2] === "number" && Number.isFinite(v[key2])) result2[key2] = v[key2];
|
|
27605
27643
|
if (v.attempt !== void 0) {
|
|
27606
27644
|
const a = object4(v.attempt);
|
|
27607
27645
|
result2.attempt = {
|
|
@@ -27628,7 +27666,7 @@ function acquisitionCapabilities(value) {
|
|
|
27628
27666
|
}
|
|
27629
27667
|
|
|
27630
27668
|
// src/images.ts
|
|
27631
|
-
import { mkdir as mkdir8, lstat as lstat6, open as
|
|
27669
|
+
import { mkdir as mkdir8, lstat as lstat6, open as open8, readdir as readdir5, rm as rm4 } from "node:fs/promises";
|
|
27632
27670
|
import { constants as constants5, linkSync as linkSync2 } from "node:fs";
|
|
27633
27671
|
import { join as join11, dirname as dirname8, extname } from "node:path";
|
|
27634
27672
|
import { randomUUID as randomUUID5 } from "node:crypto";
|
|
@@ -27869,7 +27907,7 @@ function decodePng(bytes, size) {
|
|
|
27869
27907
|
};
|
|
27870
27908
|
const rawSample = (row, index) => depth === 16 ? scan[row * stride + index * 2] << 8 | scan[row * stride + index * 2 + 1] : sample(row, index);
|
|
27871
27909
|
const scale = depth < 8 ? 255 / max : 1;
|
|
27872
|
-
const
|
|
27910
|
+
const key2 = trns && (colorType === 0 || colorType === 2) ? Array.from({ length: channels }, (_, i) => trns.readUInt16BE(i * 2)) : void 0;
|
|
27873
27911
|
for (let y = 0; y < height; y++) for (let x = 0; x < width; x++) {
|
|
27874
27912
|
const o = (y * width + x) * 4, i = x * channels;
|
|
27875
27913
|
if (colorType === 3) {
|
|
@@ -27881,7 +27919,7 @@ function decodePng(bytes, size) {
|
|
|
27881
27919
|
rgba[o + 3] = trns && sample(y, x) < trns.length ? trns[sample(y, x)] : 255;
|
|
27882
27920
|
continue;
|
|
27883
27921
|
}
|
|
27884
|
-
const keyed =
|
|
27922
|
+
const keyed = key2 !== void 0 && key2.every((value, c) => rawSample(y, i + c) === value);
|
|
27885
27923
|
if (colorType === 0 || colorType === 4) {
|
|
27886
27924
|
const g = Math.round(sample(y, i) * scale);
|
|
27887
27925
|
rgba[o] = g;
|
|
@@ -28105,7 +28143,7 @@ function imageFailure(error2) {
|
|
|
28105
28143
|
return { status: code && known.has(code) ? code : "transfer-failed", diagnostic: error2 instanceof ImageError ? error2.message : code && known.has(code) ? `Image operation failed: ${code}` : "Image delivery could not complete; execution was not replayed." };
|
|
28106
28144
|
}
|
|
28107
28145
|
function canonical(value) {
|
|
28108
|
-
return JSON.stringify(value, (_key, item) => item && typeof item === "object" && !Array.isArray(item) ? Object.fromEntries(Object.keys(item).sort().map((
|
|
28146
|
+
return JSON.stringify(value, (_key, item) => item && typeof item === "object" && !Array.isArray(item) ? Object.fromEntries(Object.keys(item).sort().map((key2) => [key2, item[key2]])) : item);
|
|
28109
28147
|
}
|
|
28110
28148
|
function guard(signal) {
|
|
28111
28149
|
if (signal?.aborted) fail("transfer-failed", "Image delivery cancelled or deadline exceeded.");
|
|
@@ -28139,7 +28177,7 @@ async function readBounded(root, path, limit, signal) {
|
|
|
28139
28177
|
const before = await lstat6(path);
|
|
28140
28178
|
if (!before.isFile()) fail("unsafe-path", "Image evidence must be a regular file.");
|
|
28141
28179
|
if (before.size < 1 || before.size > limit) fail("integrity-failed", "Image evidence exceeds its size bound.");
|
|
28142
|
-
const fd = await
|
|
28180
|
+
const fd = await open8(path, constants5.O_RDONLY | constants5.O_NOFOLLOW | constants5.O_NONBLOCK);
|
|
28143
28181
|
try {
|
|
28144
28182
|
const same = (s) => s.isFile() && s.dev === before.dev && s.ino === before.ino && s.size === before.size && s.mtimeMs === before.mtimeMs && s.ctimeMs === before.ctimeMs;
|
|
28145
28183
|
if (!same(await fd.stat())) fail("integrity-failed", "Image evidence changed before reading.");
|
|
@@ -28185,7 +28223,7 @@ async function publish(root, path, bytes, signal) {
|
|
|
28185
28223
|
await hostPath(root, path, true);
|
|
28186
28224
|
guard(signal);
|
|
28187
28225
|
const temporary = join11(dirname8(path), `.image-${randomUUID5()}.tmp`);
|
|
28188
|
-
const fd = await
|
|
28226
|
+
const fd = await open8(temporary, "wx", 384);
|
|
28189
28227
|
try {
|
|
28190
28228
|
try {
|
|
28191
28229
|
await fd.writeFile(bytes);
|
|
@@ -28204,9 +28242,9 @@ async function publish(root, path, bytes, signal) {
|
|
|
28204
28242
|
}
|
|
28205
28243
|
} finally {
|
|
28206
28244
|
await hostPath(root, temporary, true);
|
|
28207
|
-
await
|
|
28245
|
+
await rm4(temporary, { force: true });
|
|
28208
28246
|
}
|
|
28209
|
-
const directory2 = await
|
|
28247
|
+
const directory2 = await open8(dirname8(path), "r");
|
|
28210
28248
|
try {
|
|
28211
28249
|
await directory2.sync();
|
|
28212
28250
|
} finally {
|
|
@@ -28359,7 +28397,7 @@ var ImageStore = class {
|
|
|
28359
28397
|
const request = await optional2(() => readMetadata(recording.path, join11(recording.path, "host", "requests", `${target.executionId}.json`), options.signal));
|
|
28360
28398
|
if (!request) fail("unauthorized-reference", "Execution does not belong to this enclosure.");
|
|
28361
28399
|
if (request.sessionId !== target.sessionId || request.executionId !== target.executionId) fail("integrity-failed", "Execution identity does not match its recording.");
|
|
28362
|
-
if (request.capture === false) return { status: "not-requested", diagnostic: "
|
|
28400
|
+
if (request.capture === false) return { status: "not-requested", diagnostic: "This lease's runs take no snapshots: its image lists no capture software (cua-driver), or its durable machine's cua-driver daemon cannot record the screen, as relay_stage's `snapshots.reason` says; so this run took none." };
|
|
28363
28401
|
const group = request.snapshots?.group;
|
|
28364
28402
|
const requested = !request.diagnostic && (target.phase === "before" ? !group || group.phase === "first" : !group || group.phase === "last");
|
|
28365
28403
|
if (!requested) return { status: "not-requested", diagnostic: "The declared snapshot plan does not capture this phase." };
|
|
@@ -28503,8 +28541,8 @@ var ImageStore = class {
|
|
|
28503
28541
|
for (const name of names.filter((n) => n.endsWith(".json"))) {
|
|
28504
28542
|
const record3 = await this.load(name.slice(0, -5)).catch(() => void 0);
|
|
28505
28543
|
if (!record3 || record3.recording !== recordingRoot || record3.descriptor.source !== "display") continue;
|
|
28506
|
-
const
|
|
28507
|
-
held.set(
|
|
28544
|
+
const key2 = `${record3.descriptor.sha256}:${record3.descriptor.bytes}`;
|
|
28545
|
+
held.set(key2, [...held.get(key2) ?? [], record3.local]);
|
|
28508
28546
|
}
|
|
28509
28547
|
return held;
|
|
28510
28548
|
}
|
|
@@ -28628,7 +28666,7 @@ var DownloadQueue = class {
|
|
|
28628
28666
|
}
|
|
28629
28667
|
}
|
|
28630
28668
|
/** Shutdown: nothing more starts or is written; the download in flight is aborted. `wait` waits for it to stop. */
|
|
28631
|
-
async close(
|
|
28669
|
+
async close(wait2) {
|
|
28632
28670
|
this.state = "closed";
|
|
28633
28671
|
for (const job of this.queued.splice(0)) {
|
|
28634
28672
|
job.end = "cancelled";
|
|
@@ -28636,7 +28674,7 @@ var DownloadQueue = class {
|
|
|
28636
28674
|
}
|
|
28637
28675
|
const current = this.current;
|
|
28638
28676
|
current?.controller.abort(new Error("The relay is shutting down"));
|
|
28639
|
-
if (
|
|
28677
|
+
if (wait2) await current?.done;
|
|
28640
28678
|
}
|
|
28641
28679
|
kick() {
|
|
28642
28680
|
if (this.current || this.state === "closed" || !this.queued.length || this.paused && !this.queued[0].promoted) return;
|
|
@@ -28790,7 +28828,130 @@ async function refreshEvidenceState(incoming, destination, archiveRoot, options
|
|
|
28790
28828
|
if (archived) await copy(archived, retained);
|
|
28791
28829
|
}
|
|
28792
28830
|
|
|
28831
|
+
// src/mdns.ts
|
|
28832
|
+
import { createSocket } from "node:dgram";
|
|
28833
|
+
var TYPE = { A: 1, PTR: 12, TXT: 16, SRV: 33 };
|
|
28834
|
+
var GROUP = "224.0.0.251";
|
|
28835
|
+
var PORT = 5353;
|
|
28836
|
+
var key = (name) => name.replace(/\.$/, "").toLowerCase();
|
|
28837
|
+
function encodeName(name) {
|
|
28838
|
+
const parts = name.replace(/\.$/, "").split(".").map((label) => Buffer.from(label, "utf8"));
|
|
28839
|
+
if (parts.some((part) => part.length === 0 || part.length > 63)) throw new Error(`Invalid DNS name ${name}`);
|
|
28840
|
+
return Buffer.concat([...parts.flatMap((part) => [Buffer.from([part.length]), part]), Buffer.from([0])]);
|
|
28841
|
+
}
|
|
28842
|
+
function encodeQuery(questions) {
|
|
28843
|
+
const header2 = Buffer.alloc(12);
|
|
28844
|
+
header2.writeUInt16BE(questions.length, 4);
|
|
28845
|
+
return Buffer.concat([header2, ...questions.flatMap((q) => {
|
|
28846
|
+
const tail = Buffer.alloc(4);
|
|
28847
|
+
tail.writeUInt16BE(q.type, 0);
|
|
28848
|
+
tail.writeUInt16BE(1, 2);
|
|
28849
|
+
return [encodeName(q.name), tail];
|
|
28850
|
+
})]);
|
|
28851
|
+
}
|
|
28852
|
+
function readName(message3, offset) {
|
|
28853
|
+
const labels = [];
|
|
28854
|
+
let at = offset, end = -1, jumps = 0;
|
|
28855
|
+
for (; ; ) {
|
|
28856
|
+
if (at >= message3.length) throw new Error("DNS name runs past the message");
|
|
28857
|
+
const length = message3[at];
|
|
28858
|
+
if (length === 0) {
|
|
28859
|
+
at += 1;
|
|
28860
|
+
break;
|
|
28861
|
+
}
|
|
28862
|
+
if ((length & 192) === 192) {
|
|
28863
|
+
if (at + 1 >= message3.length || ++jumps > 32) throw new Error("Invalid DNS name pointer");
|
|
28864
|
+
if (end < 0) end = at + 2;
|
|
28865
|
+
at = (length & 63) << 8 | message3[at + 1];
|
|
28866
|
+
continue;
|
|
28867
|
+
}
|
|
28868
|
+
if (at + 1 + length > message3.length) throw new Error("DNS label runs past the message");
|
|
28869
|
+
labels.push(message3.toString("utf8", at + 1, at + 1 + length));
|
|
28870
|
+
at += 1 + length;
|
|
28871
|
+
}
|
|
28872
|
+
return [labels.join("."), end < 0 ? at : end];
|
|
28873
|
+
}
|
|
28874
|
+
function parseRecords(message3) {
|
|
28875
|
+
const records = [];
|
|
28876
|
+
try {
|
|
28877
|
+
if (message3.length < 12 || !(message3[2] & 128)) return records;
|
|
28878
|
+
const questions = message3.readUInt16BE(4), total = message3.readUInt16BE(6) + message3.readUInt16BE(8) + message3.readUInt16BE(10);
|
|
28879
|
+
let at = 12;
|
|
28880
|
+
for (let i = 0; i < questions; i++) at = readName(message3, at)[1] + 4;
|
|
28881
|
+
for (let i = 0; i < total; i++) {
|
|
28882
|
+
const [name, next] = readName(message3, at);
|
|
28883
|
+
const type = message3.readUInt16BE(next), length = message3.readUInt16BE(next + 8), start = next + 10;
|
|
28884
|
+
if (start + length > message3.length) break;
|
|
28885
|
+
records.push({ name, type, data: message3.subarray(start, start + length), message: message3, offset: start });
|
|
28886
|
+
at = start + length;
|
|
28887
|
+
}
|
|
28888
|
+
} catch {
|
|
28889
|
+
}
|
|
28890
|
+
return records;
|
|
28891
|
+
}
|
|
28892
|
+
function txtOf(data) {
|
|
28893
|
+
const txt = {};
|
|
28894
|
+
for (let at = 0; at < data.length; ) {
|
|
28895
|
+
const length = data[at];
|
|
28896
|
+
if (at + 1 + length > data.length) break;
|
|
28897
|
+
const pair = data.toString("utf8", at + 1, at + 1 + length);
|
|
28898
|
+
at += 1 + length;
|
|
28899
|
+
if (!pair) continue;
|
|
28900
|
+
const split = pair.indexOf("=");
|
|
28901
|
+
txt[(split < 0 ? pair : pair.slice(0, split)).toLowerCase()] = split < 0 ? "" : pair.slice(split + 1);
|
|
28902
|
+
}
|
|
28903
|
+
return txt;
|
|
28904
|
+
}
|
|
28905
|
+
function assemble(service, records) {
|
|
28906
|
+
const by = (type, name) => records.filter((r) => r.type === type && key(r.name) === key(name));
|
|
28907
|
+
const names = new Set(by(TYPE.PTR, service).map((r) => readName(r.message, r.offset)[0]));
|
|
28908
|
+
const found = [];
|
|
28909
|
+
for (const full of names) {
|
|
28910
|
+
const srv = by(TYPE.SRV, full)[0];
|
|
28911
|
+
if (!srv || srv.data.length < 7) continue;
|
|
28912
|
+
const port = srv.data.readUInt16BE(4), host = readName(srv.message, srv.offset + 6)[0];
|
|
28913
|
+
const txt = Object.assign({}, ...by(TYPE.TXT, full).map((r) => txtOf(r.data)));
|
|
28914
|
+
const a = by(TYPE.A, host).find((r) => r.data.length === 4);
|
|
28915
|
+
const name = full.slice(0, full.length - service.length - 1);
|
|
28916
|
+
found.push({ name, instance: txt.instance || name, host: host.replace(/\.$/, ""), ...a ? { address: [...a.data].join(".") } : {}, port, txt });
|
|
28917
|
+
}
|
|
28918
|
+
return found.sort((x, y) => x.name.localeCompare(y.name));
|
|
28919
|
+
}
|
|
28920
|
+
var udpTransport = (receive) => new Promise((resolve11, reject) => {
|
|
28921
|
+
const socket = createSocket({ type: "udp4", reuseAddr: true });
|
|
28922
|
+
socket.on("message", (message3) => receive(message3));
|
|
28923
|
+
socket.once("error", reject);
|
|
28924
|
+
socket.bind(0, () => {
|
|
28925
|
+
socket.setMulticastTTL(255);
|
|
28926
|
+
resolve11({ send: (query) => socket.send(query, PORT, GROUP), close: () => socket.close() });
|
|
28927
|
+
});
|
|
28928
|
+
});
|
|
28929
|
+
var wait = (ms) => new Promise((done) => setTimeout(done, ms));
|
|
28930
|
+
async function browse(service, windowMs = 2e3, followUpMs = 1e3, open9 = udpTransport) {
|
|
28931
|
+
const records = [];
|
|
28932
|
+
const transport = await open9((message3) => records.push(...parseRecords(message3)));
|
|
28933
|
+
try {
|
|
28934
|
+
transport.send(encodeQuery([{ name: service, type: TYPE.PTR }]));
|
|
28935
|
+
await wait(windowMs);
|
|
28936
|
+
const missing = [...new Set(records.filter((r) => r.type === TYPE.PTR && key(r.name) === key(service)).map((r) => readName(r.message, r.offset)[0]))].filter((full) => !assemble(service, records).some((found) => key(`${found.name}.${service}`) === key(full) && found.address));
|
|
28937
|
+
if (missing.length) {
|
|
28938
|
+
const hosts = records.filter((r) => r.type === TYPE.SRV).map((r) => readName(r.message, r.offset + 6)[0]);
|
|
28939
|
+
transport.send(encodeQuery([...missing.flatMap((name) => [{ name, type: TYPE.SRV }, { name, type: TYPE.TXT }]), ...hosts.map((name) => ({ name, type: TYPE.A }))]));
|
|
28940
|
+
await wait(followUpMs);
|
|
28941
|
+
}
|
|
28942
|
+
return assemble(service, records);
|
|
28943
|
+
} finally {
|
|
28944
|
+
transport.close();
|
|
28945
|
+
}
|
|
28946
|
+
}
|
|
28947
|
+
|
|
28793
28948
|
// src/discovery.ts
|
|
28949
|
+
var SERVICE_TYPE = "_machine-service._tcp.local";
|
|
28950
|
+
function discoveryMode(value = process.env.MACHINE_SERVICE_DISCOVERY) {
|
|
28951
|
+
if (!value || value === "bonjour") return "bonjour";
|
|
28952
|
+
if (value === "consul") return "consul";
|
|
28953
|
+
throw new Error(`MACHINE_SERVICE_DISCOVERY must be one of bonjour, consul; got ${JSON.stringify(value)}`);
|
|
28954
|
+
}
|
|
28794
28955
|
var TIMEOUT_MS = 5e3;
|
|
28795
28956
|
function consulAddress(value = process.env.CONSUL_HTTP_ADDR) {
|
|
28796
28957
|
const address = value?.trim() || "http://127.0.0.1:8500";
|
|
@@ -28812,31 +28973,58 @@ function parseRegistrations(answer) {
|
|
|
28812
28973
|
return [{ node: text3(node2?.Node), origin: new URL(`http://${host.includes(":") ? `[${host}]` : host}:${port}`).origin, ...text3(meta2.instance) ? { instance: text3(meta2.instance) } : {}, loopbackOnly: meta2.loopback_only === "true" }];
|
|
28813
28974
|
});
|
|
28814
28975
|
}
|
|
28815
|
-
async function
|
|
28976
|
+
async function candidates(options, mode) {
|
|
28977
|
+
if (mode === "bonjour") {
|
|
28978
|
+
try {
|
|
28979
|
+
const advertised = await (options.browse ?? (() => browse(SERVICE_TYPE)))();
|
|
28980
|
+
return { found: advertised.map((a) => ({ origin: new URL(`http://${a.address ?? a.host}:${a.port}`).origin, expected: a.instance })) };
|
|
28981
|
+
} catch (error2) {
|
|
28982
|
+
return { found: [], error: `the Bonjour browse failed (${error2 instanceof Error ? error2.message : String(error2)})` };
|
|
28983
|
+
}
|
|
28984
|
+
}
|
|
28816
28985
|
const consul = options.consul ?? consulAddress();
|
|
28817
|
-
const make = options.backend ?? ((origin) => new MachineService({ baseUrl: origin, listed: true }));
|
|
28818
|
-
const candidates = [{ origin: new URL(options.local.baseUrl).origin, backend: options.local }];
|
|
28819
|
-
let consulError;
|
|
28820
28986
|
try {
|
|
28821
|
-
|
|
28822
|
-
|
|
28823
|
-
candidates.push({ origin: registration.origin, backend: make(registration.origin) });
|
|
28824
|
-
}
|
|
28987
|
+
const rows = parseRegistrations(await (options.fetchJson ?? fetchJson)(`${consul}/v1/health/service/machine-service`));
|
|
28988
|
+
return { found: rows.filter((row) => !row.loopbackOnly).map((row) => ({ origin: row.origin, ...row.instance ? { expected: row.instance } : {} })) };
|
|
28825
28989
|
} catch (error2) {
|
|
28826
|
-
|
|
28990
|
+
return { found: [], error: `the Consul agent at ${consul} did not answer (${error2 instanceof Error ? error2.message : String(error2)})` };
|
|
28827
28991
|
}
|
|
28992
|
+
}
|
|
28993
|
+
async function confirmed(backend, expected) {
|
|
28994
|
+
const health = await backend.health({ timeoutMs: TIMEOUT_MS });
|
|
28995
|
+
if (health.service !== void 0 && health.service !== "machine-service") return `it answers as ${String(health.service)}, not machine-service`;
|
|
28996
|
+
if (health.instance !== expected) return `it was found as ${expected}, but its /health answers ${String(health.instance ?? "no instance")}`;
|
|
28997
|
+
return void 0;
|
|
28998
|
+
}
|
|
28999
|
+
async function findDurableOwner(machine, options) {
|
|
29000
|
+
const mode = options.mode ?? discoveryMode();
|
|
29001
|
+
const make = options.backend ?? ((origin) => new MachineService({ baseUrl: origin, listed: true }));
|
|
29002
|
+
const localOrigin = new URL(options.local.baseUrl).origin;
|
|
29003
|
+
const { found, error: discoveryError } = await candidates(options, mode);
|
|
29004
|
+
const asked = [{ origin: localOrigin, backend: options.local }];
|
|
29005
|
+
for (const candidate of found) if (!asked.some((a) => a.origin === candidate.origin)) asked.push({ ...candidate, backend: make(candidate.origin) });
|
|
28828
29006
|
const owners = [];
|
|
28829
|
-
|
|
29007
|
+
const refused = [];
|
|
29008
|
+
await Promise.all(asked.map(async ({ origin, backend, expected }) => {
|
|
28830
29009
|
try {
|
|
28831
|
-
|
|
28832
|
-
|
|
29010
|
+
if (expected) {
|
|
29011
|
+
const why = await confirmed(backend, expected);
|
|
29012
|
+
if (why) {
|
|
29013
|
+
refused.push(`${origin}: ${why}`);
|
|
29014
|
+
return;
|
|
29015
|
+
}
|
|
29016
|
+
}
|
|
29017
|
+
const record3 = (await backend.list({ timeoutMs: TIMEOUT_MS })).machines[machine];
|
|
28833
29018
|
if (record3?.kind === "durable") owners.push({ backend, origin, instance: record3.instance ?? machine });
|
|
28834
29019
|
} catch {
|
|
28835
29020
|
}
|
|
28836
29021
|
}));
|
|
28837
|
-
|
|
28838
|
-
|
|
28839
|
-
|
|
29022
|
+
owners.sort((a, b) => Number(b.origin === localOrigin) - Number(a.origin === localOrigin));
|
|
29023
|
+
const distinct = owners.filter((owner, index) => owners.findIndex((other) => other.instance === owner.instance) === index);
|
|
29024
|
+
if (distinct.length === 1) return distinct[0];
|
|
29025
|
+
if (distinct.length > 1) throw new Error(`Durable machine ${machine} is listed by more than one instance (${distinct.map((owner) => owner.origin).join(", ")}); nothing was acquired`);
|
|
29026
|
+
const hint = mode === "bonjour" ? "Check the name with `machctl list`; the Mac's machine-service must be bound to all interfaces to advertise itself, or set MACHINE_SERVICE_DISCOVERY=consul to use a Consul agent." : "Check the name with `machctl list`, and point CONSUL_HTTP_ADDR at a reachable Consul agent.";
|
|
29027
|
+
throw new Error(`No machine-service instance lists a durable machine named ${machine}${discoveryError ? `, and ${discoveryError}` : ""}${refused.length ? `; unconfirmed: ${refused.join("; ")}` : ""}; nothing was acquired. ${hint}`);
|
|
28840
29028
|
}
|
|
28841
29029
|
|
|
28842
29030
|
// src/capture-gate.ts
|
|
@@ -28868,7 +29056,6 @@ var MIN_RENEWAL_MS = 0.1 * 36e5;
|
|
|
28868
29056
|
var DEFAULT_AFTER_INTERVAL_MS = 500;
|
|
28869
29057
|
var CAPTURE_SOFTWARE = ["bundle:com.trycua.driver", "dpkg:cua-driver"];
|
|
28870
29058
|
var durableRoot = (workspace, purpose) => join13(workspace, "work", `mcp-relay-${purpose}`);
|
|
28871
|
-
var PULL_MAX_BYTES = 2 * 1024 * 1024 * 1024 - 1;
|
|
28872
29059
|
var DOWNLOAD_BOUND = 64;
|
|
28873
29060
|
var DOWNLOAD_RETRY_DELAYS_MS = [1e3, 3e3];
|
|
28874
29061
|
var CAPACITY_RETRY_MS = 15e3;
|
|
@@ -28925,7 +29112,7 @@ var RelayManager = class {
|
|
|
28925
29112
|
shuttingDown = false;
|
|
28926
29113
|
/** The instance that owns a durable machine, found as machctl finds it (DC-29). */
|
|
28927
29114
|
durableOwner(machine) {
|
|
28928
|
-
return findDurableOwner(machine, { local: this.vm, ...this.options.consul ? { consul: this.options.consul } : {}, ...this.options.durableBackend ? { backend: this.options.durableBackend } : {}, ...this.options.consulFetch ? { fetchJson: this.options.consulFetch } : {} });
|
|
29115
|
+
return findDurableOwner(machine, { local: this.vm, ...this.options.discovery ? { mode: this.options.discovery } : {}, ...this.options.bonjourBrowse ? { browse: this.options.bonjourBrowse } : {}, ...this.options.consul ? { consul: this.options.consul } : {}, ...this.options.durableBackend ? { backend: this.options.durableBackend } : {}, ...this.options.consulFetch ? { fetchJson: this.options.consulFetch } : {} });
|
|
28929
29116
|
}
|
|
28930
29117
|
serialized(fn) {
|
|
28931
29118
|
const next = this.queue.then(fn, fn);
|
|
@@ -29055,7 +29242,7 @@ var RelayManager = class {
|
|
|
29055
29242
|
if (e.machine) return !!e.backend?.endpoint && !!e.backend.instance;
|
|
29056
29243
|
if (e.backend) {
|
|
29057
29244
|
const expected = this.binding();
|
|
29058
|
-
return Object.keys(e.backend).length === Object.keys(expected).length && Object.entries(expected).every(([
|
|
29245
|
+
return Object.keys(e.backend).length === Object.keys(expected).length && Object.entries(expected).every(([key2, value]) => e.backend[key2] === value);
|
|
29059
29246
|
}
|
|
29060
29247
|
return !this.environment && new URL(this.vm.baseUrl).origin === "http://localhost:6240" && this.tartHome === canonicalPath(join13(process.env.HOME ?? homedir4(), ".tart"));
|
|
29061
29248
|
}
|
|
@@ -29404,9 +29591,8 @@ var Guest = class {
|
|
|
29404
29591
|
pull: async (name, remote_path, local_path, options) => {
|
|
29405
29592
|
if (!durable) return this.vm.pull(name, { remote_path, local_path, ...identity() }, options);
|
|
29406
29593
|
if (!this.vm.pullBytes) throw new Error("Backend lacks byte transfers; upgrade machine-service");
|
|
29407
|
-
|
|
29408
|
-
await
|
|
29409
|
-
await writeFile4(local_path, bytes, { flag: "wx", mode: 384 });
|
|
29594
|
+
await rm5(local_path, { force: true });
|
|
29595
|
+
await this.vm.pullBytes(name, { remote_path, to: local_path, ...identity() }, options);
|
|
29410
29596
|
return { vm: name, pulled: remote_path, to: local_path };
|
|
29411
29597
|
}
|
|
29412
29598
|
};
|
|
@@ -30164,14 +30350,14 @@ VM state: ${JSON.stringify(this.status())}`, { cause: error2 });
|
|
|
30164
30350
|
for (let attempt = 1; !files; attempt++) {
|
|
30165
30351
|
try {
|
|
30166
30352
|
await assertHostPath(e.hostRoot, folder, true);
|
|
30167
|
-
await
|
|
30353
|
+
await rm5(folder, { recursive: true, force: true });
|
|
30168
30354
|
files = await this.transfer().pullArchive(e.guestRoot, e.guestRoot, requested, folder, e.hostRoot, { present: true, once: true, signal: bounded3 });
|
|
30169
30355
|
} catch (error2) {
|
|
30170
30356
|
const transient2 = !bounded3.aborted && transientTransfer(error2);
|
|
30171
30357
|
if (attempt >= 3 || !transient2) return { status: transient2 || bounded3.aborted ? "transfer-failed" : "integrity-failed", diagnostic: `Step evidence download failed: ${String(error2)}` };
|
|
30172
|
-
const
|
|
30358
|
+
const wait2 = retryDelaysMs[attempt - 1] ?? 0;
|
|
30173
30359
|
await new Promise((done) => {
|
|
30174
|
-
const timer = setTimeout(done,
|
|
30360
|
+
const timer = setTimeout(done, wait2);
|
|
30175
30361
|
bounded3.addEventListener("abort", () => {
|
|
30176
30362
|
clearTimeout(timer);
|
|
30177
30363
|
done();
|
|
@@ -30208,8 +30394,8 @@ VM state: ${JSON.stringify(this.status())}`, { cause: error2 });
|
|
|
30208
30394
|
} catch {
|
|
30209
30395
|
continue;
|
|
30210
30396
|
}
|
|
30211
|
-
const
|
|
30212
|
-
copies.set(
|
|
30397
|
+
const key2 = `${file.sha256}:${file.bytes}`;
|
|
30398
|
+
copies.set(key2, [...copies.get(key2) ?? [], path]);
|
|
30213
30399
|
}
|
|
30214
30400
|
}
|
|
30215
30401
|
return copies;
|
|
@@ -30218,15 +30404,15 @@ VM state: ${JSON.stringify(this.status())}`, { cause: error2 });
|
|
|
30218
30404
|
async localState(recording) {
|
|
30219
30405
|
const held = await this.imageStore().heldOriginals(recording), steps = await this.stepCopies(recording, "state/");
|
|
30220
30406
|
return { root: recording, candidates: (file) => {
|
|
30221
|
-
const
|
|
30222
|
-
return [join13(recording, "state", file.path), ...steps.get(
|
|
30407
|
+
const key2 = `${file.sha256}:${file.bytes}`, receipt = /^receiver\/receipts\/([^/]+\.json)$/.exec(file.path)?.[1];
|
|
30408
|
+
return [join13(recording, "state", file.path), ...steps.get(key2) ?? [], ...receipt ? [join13(recording, "host", "receiver-receipts", receipt)] : [], ...held.get(key2) ?? []];
|
|
30223
30409
|
} };
|
|
30224
30410
|
}
|
|
30225
30411
|
/** AD-7: the step folders are a staging area; once their files are in the recording's state they go. */
|
|
30226
30412
|
async removeStepFolders(recording) {
|
|
30227
30413
|
const steps = join13(recording, "host", "steps");
|
|
30228
30414
|
await assertHostPath(recording, steps, true);
|
|
30229
|
-
await
|
|
30415
|
+
await rm5(steps, { recursive: true, force: true });
|
|
30230
30416
|
}
|
|
30231
30417
|
/** A lifecycle operation's gate (AD-5): every download ends before the guest state is touched; the queue opens again after. */
|
|
30232
30418
|
async drained(fn) {
|
|
@@ -30636,10 +30822,10 @@ var relayContract = typebox_exports.Union([
|
|
|
30636
30822
|
]);
|
|
30637
30823
|
var projected = {};
|
|
30638
30824
|
for (const branch of relayContract.anyOf) {
|
|
30639
|
-
for (const [
|
|
30640
|
-
if (
|
|
30641
|
-
const previous = projected[
|
|
30642
|
-
projected[
|
|
30825
|
+
for (const [key2, schema] of Object.entries(branch.properties)) {
|
|
30826
|
+
if (key2 === "action") continue;
|
|
30827
|
+
const previous = projected[key2];
|
|
30828
|
+
projected[key2] = previous && JSON.stringify(previous) !== JSON.stringify(schema) ? typebox_exports.Optional(typebox_exports.Union([previous, schema])) : typebox_exports.Optional(schema);
|
|
30643
30829
|
}
|
|
30644
30830
|
}
|
|
30645
30831
|
var parameterObject = typebox_exports.Object({
|
|
@@ -30655,7 +30841,7 @@ function branchFor(action) {
|
|
|
30655
30841
|
function toolInputSchema(action) {
|
|
30656
30842
|
const raw = JSON.parse(JSON.stringify(branchFor(action)));
|
|
30657
30843
|
const { action: _action, ...properties } = raw.properties;
|
|
30658
|
-
const required2 = (raw.required ?? []).filter((
|
|
30844
|
+
const required2 = (raw.required ?? []).filter((key2) => key2 !== "action");
|
|
30659
30845
|
return { type: raw.type, properties, ...required2.length ? { required: required2 } : {}, additionalProperties: raw.additionalProperties ?? false };
|
|
30660
30846
|
}
|
|
30661
30847
|
function validateRelayInput(value) {
|
|
@@ -30671,7 +30857,7 @@ function validateRelayInput(value) {
|
|
|
30671
30857
|
}
|
|
30672
30858
|
|
|
30673
30859
|
// src/surface.ts
|
|
30674
|
-
import { mkdir as mkdir11, writeFile as
|
|
30860
|
+
import { mkdir as mkdir11, writeFile as writeFile4 } from "node:fs/promises";
|
|
30675
30861
|
import { join as join14 } from "node:path";
|
|
30676
30862
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
30677
30863
|
import { randomUUID as randomUUID7 } from "node:crypto";
|
|
@@ -30785,7 +30971,7 @@ async function renderRelayResult(value, resultRoot = join14(tmpdir2(), "mcp-rela
|
|
|
30785
30971
|
if (text5 !== full) {
|
|
30786
30972
|
await mkdir11(resultRoot, { recursive: true, mode: 448 });
|
|
30787
30973
|
const path = join14(resultRoot, `${randomUUID7()}.json`);
|
|
30788
|
-
await
|
|
30974
|
+
await writeFile4(path, full, { mode: 384 });
|
|
30789
30975
|
return { text: `${text5}
|
|
30790
30976
|
[Truncated. Full result: ${path}]`, details: { resultPath: path }, resultPath: path };
|
|
30791
30977
|
}
|
|
@@ -30866,7 +31052,7 @@ async function relayCall(host, raw, options = {}) {
|
|
|
30866
31052
|
|
|
30867
31053
|
// src/server.ts
|
|
30868
31054
|
var SERVER_NAME = "relay";
|
|
30869
|
-
var SERVER_VERSION = true ? "0.
|
|
31055
|
+
var SERVER_VERSION = true ? "0.18.0" : JSON.parse(readFileSync(fileURLToPath(new URL("../package.json", import.meta.url)), "utf8")).version;
|
|
30870
31056
|
var STATUS_TOOL = "relay_status";
|
|
30871
31057
|
var PLUGIN_TOOL_PREFIX = "mcp__plugin_mcp-relay_relay__";
|
|
30872
31058
|
var message2 = (error2) => error2 instanceof Error ? error2.message : String(error2);
|