agent-relay 10.6.3 → 10.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +150 -126
- package/package.json +8 -8
package/dist/index.cjs
CHANGED
|
@@ -1051,10 +1051,10 @@ function mergeDefs(...defs) {
|
|
|
1051
1051
|
function cloneDef(schema) {
|
|
1052
1052
|
return mergeDefs(schema._zod.def);
|
|
1053
1053
|
}
|
|
1054
|
-
function getElementAtPath(obj,
|
|
1055
|
-
if (!
|
|
1054
|
+
function getElementAtPath(obj, path5) {
|
|
1055
|
+
if (!path5)
|
|
1056
1056
|
return obj;
|
|
1057
|
-
return
|
|
1057
|
+
return path5.reduce((acc, key) => acc?.[key], obj);
|
|
1058
1058
|
}
|
|
1059
1059
|
function promiseAllObject(promisesObj) {
|
|
1060
1060
|
const keys = Object.keys(promisesObj);
|
|
@@ -1463,11 +1463,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
1463
1463
|
}
|
|
1464
1464
|
return false;
|
|
1465
1465
|
}
|
|
1466
|
-
function prefixIssues(
|
|
1466
|
+
function prefixIssues(path5, issues) {
|
|
1467
1467
|
return issues.map((iss) => {
|
|
1468
1468
|
var _a7;
|
|
1469
1469
|
(_a7 = iss).path ?? (_a7.path = []);
|
|
1470
|
-
iss.path.unshift(
|
|
1470
|
+
iss.path.unshift(path5);
|
|
1471
1471
|
return iss;
|
|
1472
1472
|
});
|
|
1473
1473
|
}
|
|
@@ -1614,16 +1614,16 @@ function flattenError(error151, mapper = (issue4) => issue4.message) {
|
|
|
1614
1614
|
}
|
|
1615
1615
|
function formatError(error151, mapper = (issue4) => issue4.message) {
|
|
1616
1616
|
const fieldErrors = { _errors: [] };
|
|
1617
|
-
const processError = (error152,
|
|
1617
|
+
const processError = (error152, path5 = []) => {
|
|
1618
1618
|
for (const issue4 of error152.issues) {
|
|
1619
1619
|
if (issue4.code === "invalid_union" && issue4.errors.length) {
|
|
1620
|
-
issue4.errors.map((issues) => processError({ issues }, [...
|
|
1620
|
+
issue4.errors.map((issues) => processError({ issues }, [...path5, ...issue4.path]));
|
|
1621
1621
|
} else if (issue4.code === "invalid_key") {
|
|
1622
|
-
processError({ issues: issue4.issues }, [...
|
|
1622
|
+
processError({ issues: issue4.issues }, [...path5, ...issue4.path]);
|
|
1623
1623
|
} else if (issue4.code === "invalid_element") {
|
|
1624
|
-
processError({ issues: issue4.issues }, [...
|
|
1624
|
+
processError({ issues: issue4.issues }, [...path5, ...issue4.path]);
|
|
1625
1625
|
} else {
|
|
1626
|
-
const fullpath = [...
|
|
1626
|
+
const fullpath = [...path5, ...issue4.path];
|
|
1627
1627
|
if (fullpath.length === 0) {
|
|
1628
1628
|
fieldErrors._errors.push(mapper(issue4));
|
|
1629
1629
|
} else {
|
|
@@ -1650,17 +1650,17 @@ function formatError(error151, mapper = (issue4) => issue4.message) {
|
|
|
1650
1650
|
}
|
|
1651
1651
|
function treeifyError(error151, mapper = (issue4) => issue4.message) {
|
|
1652
1652
|
const result = { errors: [] };
|
|
1653
|
-
const processError = (error152,
|
|
1653
|
+
const processError = (error152, path5 = []) => {
|
|
1654
1654
|
var _a7, _b;
|
|
1655
1655
|
for (const issue4 of error152.issues) {
|
|
1656
1656
|
if (issue4.code === "invalid_union" && issue4.errors.length) {
|
|
1657
|
-
issue4.errors.map((issues) => processError({ issues }, [...
|
|
1657
|
+
issue4.errors.map((issues) => processError({ issues }, [...path5, ...issue4.path]));
|
|
1658
1658
|
} else if (issue4.code === "invalid_key") {
|
|
1659
|
-
processError({ issues: issue4.issues }, [...
|
|
1659
|
+
processError({ issues: issue4.issues }, [...path5, ...issue4.path]);
|
|
1660
1660
|
} else if (issue4.code === "invalid_element") {
|
|
1661
|
-
processError({ issues: issue4.issues }, [...
|
|
1661
|
+
processError({ issues: issue4.issues }, [...path5, ...issue4.path]);
|
|
1662
1662
|
} else {
|
|
1663
|
-
const fullpath = [...
|
|
1663
|
+
const fullpath = [...path5, ...issue4.path];
|
|
1664
1664
|
if (fullpath.length === 0) {
|
|
1665
1665
|
result.errors.push(mapper(issue4));
|
|
1666
1666
|
continue;
|
|
@@ -1692,8 +1692,8 @@ function treeifyError(error151, mapper = (issue4) => issue4.message) {
|
|
|
1692
1692
|
}
|
|
1693
1693
|
function toDotPath(_path) {
|
|
1694
1694
|
const segs = [];
|
|
1695
|
-
const
|
|
1696
|
-
for (const seg of
|
|
1695
|
+
const path5 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
1696
|
+
for (const seg of path5) {
|
|
1697
1697
|
if (typeof seg === "number")
|
|
1698
1698
|
segs.push(`[${seg}]`);
|
|
1699
1699
|
else if (typeof seg === "symbol")
|
|
@@ -14385,13 +14385,13 @@ function resolveRef(ref, ctx) {
|
|
|
14385
14385
|
if (!ref.startsWith("#")) {
|
|
14386
14386
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
14387
14387
|
}
|
|
14388
|
-
const
|
|
14389
|
-
if (
|
|
14388
|
+
const path5 = ref.slice(1).split("/").filter(Boolean);
|
|
14389
|
+
if (path5.length === 0) {
|
|
14390
14390
|
return ctx.rootSchema;
|
|
14391
14391
|
}
|
|
14392
14392
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
14393
|
-
if (
|
|
14394
|
-
const key =
|
|
14393
|
+
if (path5[0] === defsKey) {
|
|
14394
|
+
const key = path5[1];
|
|
14395
14395
|
if (!key || !ctx.defs[key]) {
|
|
14396
14396
|
throw new Error(`Reference not found: ${ref}`);
|
|
14397
14397
|
}
|
|
@@ -18199,10 +18199,10 @@ function mergeDefs2(...defs) {
|
|
|
18199
18199
|
function cloneDef2(schema) {
|
|
18200
18200
|
return mergeDefs2(schema._zod.def);
|
|
18201
18201
|
}
|
|
18202
|
-
function getElementAtPath2(obj,
|
|
18203
|
-
if (!
|
|
18202
|
+
function getElementAtPath2(obj, path5) {
|
|
18203
|
+
if (!path5)
|
|
18204
18204
|
return obj;
|
|
18205
|
-
return
|
|
18205
|
+
return path5.reduce((acc, key) => acc?.[key], obj);
|
|
18206
18206
|
}
|
|
18207
18207
|
function promiseAllObject2(promisesObj) {
|
|
18208
18208
|
const keys = Object.keys(promisesObj);
|
|
@@ -18611,11 +18611,11 @@ function explicitlyAborted2(x, startIndex = 0) {
|
|
|
18611
18611
|
}
|
|
18612
18612
|
return false;
|
|
18613
18613
|
}
|
|
18614
|
-
function prefixIssues2(
|
|
18614
|
+
function prefixIssues2(path5, issues) {
|
|
18615
18615
|
return issues.map((iss) => {
|
|
18616
18616
|
var _a7;
|
|
18617
18617
|
(_a7 = iss).path ?? (_a7.path = []);
|
|
18618
|
-
iss.path.unshift(
|
|
18618
|
+
iss.path.unshift(path5);
|
|
18619
18619
|
return iss;
|
|
18620
18620
|
});
|
|
18621
18621
|
}
|
|
@@ -18762,16 +18762,16 @@ function flattenError2(error151, mapper = (issue4) => issue4.message) {
|
|
|
18762
18762
|
}
|
|
18763
18763
|
function formatError2(error151, mapper = (issue4) => issue4.message) {
|
|
18764
18764
|
const fieldErrors = { _errors: [] };
|
|
18765
|
-
const processError = (error152,
|
|
18765
|
+
const processError = (error152, path5 = []) => {
|
|
18766
18766
|
for (const issue4 of error152.issues) {
|
|
18767
18767
|
if (issue4.code === "invalid_union" && issue4.errors.length) {
|
|
18768
|
-
issue4.errors.map((issues) => processError({ issues }, [...
|
|
18768
|
+
issue4.errors.map((issues) => processError({ issues }, [...path5, ...issue4.path]));
|
|
18769
18769
|
} else if (issue4.code === "invalid_key") {
|
|
18770
|
-
processError({ issues: issue4.issues }, [...
|
|
18770
|
+
processError({ issues: issue4.issues }, [...path5, ...issue4.path]);
|
|
18771
18771
|
} else if (issue4.code === "invalid_element") {
|
|
18772
|
-
processError({ issues: issue4.issues }, [...
|
|
18772
|
+
processError({ issues: issue4.issues }, [...path5, ...issue4.path]);
|
|
18773
18773
|
} else {
|
|
18774
|
-
const fullpath = [...
|
|
18774
|
+
const fullpath = [...path5, ...issue4.path];
|
|
18775
18775
|
if (fullpath.length === 0) {
|
|
18776
18776
|
fieldErrors._errors.push(mapper(issue4));
|
|
18777
18777
|
} else {
|
|
@@ -18798,17 +18798,17 @@ function formatError2(error151, mapper = (issue4) => issue4.message) {
|
|
|
18798
18798
|
}
|
|
18799
18799
|
function treeifyError2(error151, mapper = (issue4) => issue4.message) {
|
|
18800
18800
|
const result = { errors: [] };
|
|
18801
|
-
const processError = (error152,
|
|
18801
|
+
const processError = (error152, path5 = []) => {
|
|
18802
18802
|
var _a7, _b;
|
|
18803
18803
|
for (const issue4 of error152.issues) {
|
|
18804
18804
|
if (issue4.code === "invalid_union" && issue4.errors.length) {
|
|
18805
|
-
issue4.errors.map((issues) => processError({ issues }, [...
|
|
18805
|
+
issue4.errors.map((issues) => processError({ issues }, [...path5, ...issue4.path]));
|
|
18806
18806
|
} else if (issue4.code === "invalid_key") {
|
|
18807
|
-
processError({ issues: issue4.issues }, [...
|
|
18807
|
+
processError({ issues: issue4.issues }, [...path5, ...issue4.path]);
|
|
18808
18808
|
} else if (issue4.code === "invalid_element") {
|
|
18809
|
-
processError({ issues: issue4.issues }, [...
|
|
18809
|
+
processError({ issues: issue4.issues }, [...path5, ...issue4.path]);
|
|
18810
18810
|
} else {
|
|
18811
|
-
const fullpath = [...
|
|
18811
|
+
const fullpath = [...path5, ...issue4.path];
|
|
18812
18812
|
if (fullpath.length === 0) {
|
|
18813
18813
|
result.errors.push(mapper(issue4));
|
|
18814
18814
|
continue;
|
|
@@ -18840,8 +18840,8 @@ function treeifyError2(error151, mapper = (issue4) => issue4.message) {
|
|
|
18840
18840
|
}
|
|
18841
18841
|
function toDotPath2(_path) {
|
|
18842
18842
|
const segs = [];
|
|
18843
|
-
const
|
|
18844
|
-
for (const seg of
|
|
18843
|
+
const path5 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
18844
|
+
for (const seg of path5) {
|
|
18845
18845
|
if (typeof seg === "number")
|
|
18846
18846
|
segs.push(`[${seg}]`);
|
|
18847
18847
|
else if (typeof seg === "symbol")
|
|
@@ -31533,13 +31533,13 @@ function resolveRef2(ref, ctx) {
|
|
|
31533
31533
|
if (!ref.startsWith("#")) {
|
|
31534
31534
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
31535
31535
|
}
|
|
31536
|
-
const
|
|
31537
|
-
if (
|
|
31536
|
+
const path5 = ref.slice(1).split("/").filter(Boolean);
|
|
31537
|
+
if (path5.length === 0) {
|
|
31538
31538
|
return ctx.rootSchema;
|
|
31539
31539
|
}
|
|
31540
31540
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
31541
|
-
if (
|
|
31542
|
-
const key =
|
|
31541
|
+
if (path5[0] === defsKey) {
|
|
31542
|
+
const key = path5[1];
|
|
31543
31543
|
if (!key || !ctx.defs[key]) {
|
|
31544
31544
|
throw new Error(`Reference not found: ${ref}`);
|
|
31545
31545
|
}
|
|
@@ -32132,8 +32132,8 @@ var HttpClient = class _HttpClient {
|
|
|
32132
32132
|
...this._agentRelayDistinctId ? { agentRelayDistinctId: this._agentRelayDistinctId } : {}
|
|
32133
32133
|
}));
|
|
32134
32134
|
}
|
|
32135
|
-
async request(method,
|
|
32136
|
-
const url4 = new URL(
|
|
32135
|
+
async request(method, path5, body, query, options) {
|
|
32136
|
+
const url4 = new URL(path5, this._baseUrl);
|
|
32137
32137
|
if (query) {
|
|
32138
32138
|
for (const [k, v] of Object.entries(query)) {
|
|
32139
32139
|
if (v !== void 0)
|
|
@@ -32204,20 +32204,20 @@ var HttpClient = class _HttpClient {
|
|
|
32204
32204
|
return camelizeKeys(parsedData);
|
|
32205
32205
|
}
|
|
32206
32206
|
}
|
|
32207
|
-
get(
|
|
32208
|
-
return this.request("GET",
|
|
32207
|
+
get(path5, query, options) {
|
|
32208
|
+
return this.request("GET", path5, void 0, query, options);
|
|
32209
32209
|
}
|
|
32210
|
-
post(
|
|
32211
|
-
return this.request("POST",
|
|
32210
|
+
post(path5, body, options) {
|
|
32211
|
+
return this.request("POST", path5, body, void 0, options);
|
|
32212
32212
|
}
|
|
32213
|
-
patch(
|
|
32214
|
-
return this.request("PATCH",
|
|
32213
|
+
patch(path5, body, options) {
|
|
32214
|
+
return this.request("PATCH", path5, body, void 0, options);
|
|
32215
32215
|
}
|
|
32216
|
-
put(
|
|
32217
|
-
return this.request("PUT",
|
|
32216
|
+
put(path5, body, options) {
|
|
32217
|
+
return this.request("PUT", path5, body, void 0, options);
|
|
32218
32218
|
}
|
|
32219
|
-
async delete(
|
|
32220
|
-
await this.request("DELETE",
|
|
32219
|
+
async delete(path5, options) {
|
|
32220
|
+
await this.request("DELETE", path5, void 0, void 0, options);
|
|
32221
32221
|
}
|
|
32222
32222
|
};
|
|
32223
32223
|
|
|
@@ -32816,72 +32816,72 @@ function validateJsonSchemaLite(value, schema) {
|
|
|
32816
32816
|
validateAgainstSchema(value, schema, "$", state);
|
|
32817
32817
|
return { valid: state.issues.length === 0, issues: state.issues };
|
|
32818
32818
|
}
|
|
32819
|
-
function validateAgainstSchema(value, schema,
|
|
32819
|
+
function validateAgainstSchema(value, schema, path5, state) {
|
|
32820
32820
|
if (schema === true) {
|
|
32821
32821
|
return;
|
|
32822
32822
|
}
|
|
32823
32823
|
if (schema === false) {
|
|
32824
|
-
addIssue(state,
|
|
32824
|
+
addIssue(state, path5, "value is not allowed", "never", describeValue(value));
|
|
32825
32825
|
return;
|
|
32826
32826
|
}
|
|
32827
32827
|
if (!isSchemaObject(schema)) {
|
|
32828
|
-
addIssue(state,
|
|
32828
|
+
addIssue(state, path5, "schema must be a boolean or object", "schema", describeValue(schema));
|
|
32829
32829
|
return;
|
|
32830
32830
|
}
|
|
32831
|
-
validateCombinators(value, schema,
|
|
32831
|
+
validateCombinators(value, schema, path5, state);
|
|
32832
32832
|
if (schema.const !== void 0 && !jsonEqual(value, schema.const)) {
|
|
32833
|
-
addIssue(state,
|
|
32833
|
+
addIssue(state, path5, `expected const ${JSON.stringify(schema.const)}`, JSON.stringify(schema.const), describeValue(value));
|
|
32834
32834
|
}
|
|
32835
32835
|
if (schema.enum && !schema.enum.some((candidate) => jsonEqual(value, candidate))) {
|
|
32836
|
-
addIssue(state,
|
|
32836
|
+
addIssue(state, path5, `expected one of ${schema.enum.map((candidate) => JSON.stringify(candidate)).join(", ")}`);
|
|
32837
32837
|
}
|
|
32838
32838
|
const types = getExpectedTypes(schema);
|
|
32839
32839
|
if (types.length > 0 && !types.some((type) => matchesType(value, type))) {
|
|
32840
|
-
addIssue(state,
|
|
32840
|
+
addIssue(state, path5, `expected ${types.join(" or ")}`, types.join(" or "), describeValue(value));
|
|
32841
32841
|
return;
|
|
32842
32842
|
}
|
|
32843
32843
|
if (shouldValidateObject(value, schema)) {
|
|
32844
|
-
validateObject(value, schema,
|
|
32844
|
+
validateObject(value, schema, path5, state);
|
|
32845
32845
|
}
|
|
32846
32846
|
if (shouldValidateArray(value, schema)) {
|
|
32847
|
-
validateArray(value, schema,
|
|
32847
|
+
validateArray(value, schema, path5, state);
|
|
32848
32848
|
}
|
|
32849
32849
|
if (typeof value === "string") {
|
|
32850
|
-
validateString(value, schema,
|
|
32850
|
+
validateString(value, schema, path5, state);
|
|
32851
32851
|
}
|
|
32852
32852
|
if (typeof value === "number") {
|
|
32853
|
-
validateNumber(value, schema,
|
|
32853
|
+
validateNumber(value, schema, path5, state);
|
|
32854
32854
|
}
|
|
32855
32855
|
}
|
|
32856
|
-
function validateCombinators(value, schema,
|
|
32856
|
+
function validateCombinators(value, schema, path5, state) {
|
|
32857
32857
|
if (schema.allOf) {
|
|
32858
32858
|
for (const child of schema.allOf) {
|
|
32859
|
-
validateAgainstSchema(value, child,
|
|
32859
|
+
validateAgainstSchema(value, child, path5, state);
|
|
32860
32860
|
}
|
|
32861
32861
|
}
|
|
32862
32862
|
if (schema.anyOf) {
|
|
32863
32863
|
const matched = schema.anyOf.some((child) => validateJsonSchemaLite(value, child).valid);
|
|
32864
32864
|
if (!matched) {
|
|
32865
|
-
addIssue(state,
|
|
32865
|
+
addIssue(state, path5, "expected value to match at least one anyOf schema");
|
|
32866
32866
|
}
|
|
32867
32867
|
}
|
|
32868
32868
|
if (schema.oneOf) {
|
|
32869
32869
|
const matches = schema.oneOf.filter((child) => validateJsonSchemaLite(value, child).valid).length;
|
|
32870
32870
|
if (matches !== 1) {
|
|
32871
|
-
addIssue(state,
|
|
32871
|
+
addIssue(state, path5, `expected value to match exactly one oneOf schema, matched ${matches}`);
|
|
32872
32872
|
}
|
|
32873
32873
|
}
|
|
32874
32874
|
}
|
|
32875
|
-
function validateObject(value, schema,
|
|
32875
|
+
function validateObject(value, schema, path5, state) {
|
|
32876
32876
|
for (const key of schema.required ?? []) {
|
|
32877
32877
|
if (!Object.prototype.hasOwnProperty.call(value, key)) {
|
|
32878
|
-
addIssue(state, appendPath(
|
|
32878
|
+
addIssue(state, appendPath(path5, key), "required property is missing");
|
|
32879
32879
|
}
|
|
32880
32880
|
}
|
|
32881
32881
|
const properties = schema.properties ?? {};
|
|
32882
32882
|
for (const [key, childSchema] of Object.entries(properties)) {
|
|
32883
32883
|
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
|
32884
|
-
validateAgainstSchema(value[key], childSchema, appendPath(
|
|
32884
|
+
validateAgainstSchema(value[key], childSchema, appendPath(path5, key), state);
|
|
32885
32885
|
}
|
|
32886
32886
|
}
|
|
32887
32887
|
const additional = schema.additionalProperties;
|
|
@@ -32893,48 +32893,48 @@ function validateObject(value, schema, path4, state) {
|
|
|
32893
32893
|
continue;
|
|
32894
32894
|
}
|
|
32895
32895
|
if (additional === false) {
|
|
32896
|
-
addIssue(state, appendPath(
|
|
32896
|
+
addIssue(state, appendPath(path5, key), "additional property is not allowed");
|
|
32897
32897
|
} else {
|
|
32898
|
-
validateAgainstSchema(value[key], additional, appendPath(
|
|
32898
|
+
validateAgainstSchema(value[key], additional, appendPath(path5, key), state);
|
|
32899
32899
|
}
|
|
32900
32900
|
}
|
|
32901
32901
|
}
|
|
32902
|
-
function validateArray(value, schema,
|
|
32902
|
+
function validateArray(value, schema, path5, state) {
|
|
32903
32903
|
if (schema.minItems !== void 0 && value.length < schema.minItems) {
|
|
32904
|
-
addIssue(state,
|
|
32904
|
+
addIssue(state, path5, `expected at least ${schema.minItems} items`);
|
|
32905
32905
|
}
|
|
32906
32906
|
if (schema.maxItems !== void 0 && value.length > schema.maxItems) {
|
|
32907
|
-
addIssue(state,
|
|
32907
|
+
addIssue(state, path5, `expected at most ${schema.maxItems} items`);
|
|
32908
32908
|
}
|
|
32909
32909
|
if (schema.items !== void 0) {
|
|
32910
32910
|
value.forEach((item, index) => {
|
|
32911
|
-
validateAgainstSchema(item, schema.items, `${
|
|
32911
|
+
validateAgainstSchema(item, schema.items, `${path5}[${index}]`, state);
|
|
32912
32912
|
});
|
|
32913
32913
|
}
|
|
32914
32914
|
}
|
|
32915
|
-
function validateString(value, schema,
|
|
32915
|
+
function validateString(value, schema, path5, state) {
|
|
32916
32916
|
if (schema.minLength !== void 0 && value.length < schema.minLength) {
|
|
32917
|
-
addIssue(state,
|
|
32917
|
+
addIssue(state, path5, `expected length >= ${schema.minLength}`);
|
|
32918
32918
|
}
|
|
32919
32919
|
if (schema.maxLength !== void 0 && value.length > schema.maxLength) {
|
|
32920
|
-
addIssue(state,
|
|
32920
|
+
addIssue(state, path5, `expected length <= ${schema.maxLength}`);
|
|
32921
32921
|
}
|
|
32922
32922
|
if (schema.pattern !== void 0) {
|
|
32923
32923
|
try {
|
|
32924
32924
|
if (!new RegExp(schema.pattern).test(value)) {
|
|
32925
|
-
addIssue(state,
|
|
32925
|
+
addIssue(state, path5, `expected string to match /${schema.pattern}/`);
|
|
32926
32926
|
}
|
|
32927
32927
|
} catch {
|
|
32928
|
-
addIssue(state,
|
|
32928
|
+
addIssue(state, path5, `invalid pattern /${schema.pattern}/`);
|
|
32929
32929
|
}
|
|
32930
32930
|
}
|
|
32931
32931
|
}
|
|
32932
|
-
function validateNumber(value, schema,
|
|
32932
|
+
function validateNumber(value, schema, path5, state) {
|
|
32933
32933
|
if (schema.minimum !== void 0 && value < schema.minimum) {
|
|
32934
|
-
addIssue(state,
|
|
32934
|
+
addIssue(state, path5, `expected value >= ${schema.minimum}`);
|
|
32935
32935
|
}
|
|
32936
32936
|
if (schema.maximum !== void 0 && value > schema.maximum) {
|
|
32937
|
-
addIssue(state,
|
|
32937
|
+
addIssue(state, path5, `expected value <= ${schema.maximum}`);
|
|
32938
32938
|
}
|
|
32939
32939
|
}
|
|
32940
32940
|
function getExpectedTypes(schema) {
|
|
@@ -32983,12 +32983,12 @@ function isPlainObject4(value) {
|
|
|
32983
32983
|
function isSchemaObject(value) {
|
|
32984
32984
|
return isPlainObject4(value);
|
|
32985
32985
|
}
|
|
32986
|
-
function appendPath(
|
|
32987
|
-
return /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(key) ? `${
|
|
32986
|
+
function appendPath(path5, key) {
|
|
32987
|
+
return /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(key) ? `${path5}.${key}` : `${path5}[${JSON.stringify(key)}]`;
|
|
32988
32988
|
}
|
|
32989
|
-
function addIssue(state,
|
|
32989
|
+
function addIssue(state, path5, message, expected, received) {
|
|
32990
32990
|
state.issues.push({
|
|
32991
|
-
path:
|
|
32991
|
+
path: path5,
|
|
32992
32992
|
message,
|
|
32993
32993
|
...expected !== void 0 ? { expected } : {},
|
|
32994
32994
|
...received !== void 0 ? { received } : {}
|
|
@@ -33318,11 +33318,11 @@ function zodIssues(error151) {
|
|
|
33318
33318
|
message: issue4.message
|
|
33319
33319
|
}));
|
|
33320
33320
|
}
|
|
33321
|
-
function formatZodPath(
|
|
33322
|
-
if (
|
|
33321
|
+
function formatZodPath(path5) {
|
|
33322
|
+
if (path5.length === 0)
|
|
33323
33323
|
return "$";
|
|
33324
33324
|
let result = "$";
|
|
33325
|
-
for (const part of
|
|
33325
|
+
for (const part of path5) {
|
|
33326
33326
|
result = typeof part === "number" ? `${result}[${part}]` : `${result}.${part}`;
|
|
33327
33327
|
}
|
|
33328
33328
|
return result;
|
|
@@ -34138,10 +34138,10 @@ function mergeDefs3(...defs) {
|
|
|
34138
34138
|
function cloneDef3(schema) {
|
|
34139
34139
|
return mergeDefs3(schema._zod.def);
|
|
34140
34140
|
}
|
|
34141
|
-
function getElementAtPath3(obj,
|
|
34142
|
-
if (!
|
|
34141
|
+
function getElementAtPath3(obj, path5) {
|
|
34142
|
+
if (!path5)
|
|
34143
34143
|
return obj;
|
|
34144
|
-
return
|
|
34144
|
+
return path5.reduce((acc, key) => acc?.[key], obj);
|
|
34145
34145
|
}
|
|
34146
34146
|
function promiseAllObject3(promisesObj) {
|
|
34147
34147
|
const keys = Object.keys(promisesObj);
|
|
@@ -34550,11 +34550,11 @@ function explicitlyAborted3(x, startIndex = 0) {
|
|
|
34550
34550
|
}
|
|
34551
34551
|
return false;
|
|
34552
34552
|
}
|
|
34553
|
-
function prefixIssues3(
|
|
34553
|
+
function prefixIssues3(path5, issues) {
|
|
34554
34554
|
return issues.map((iss) => {
|
|
34555
34555
|
var _a7;
|
|
34556
34556
|
(_a7 = iss).path ?? (_a7.path = []);
|
|
34557
|
-
iss.path.unshift(
|
|
34557
|
+
iss.path.unshift(path5);
|
|
34558
34558
|
return iss;
|
|
34559
34559
|
});
|
|
34560
34560
|
}
|
|
@@ -34701,16 +34701,16 @@ function flattenError3(error151, mapper = (issue4) => issue4.message) {
|
|
|
34701
34701
|
}
|
|
34702
34702
|
function formatError3(error151, mapper = (issue4) => issue4.message) {
|
|
34703
34703
|
const fieldErrors = { _errors: [] };
|
|
34704
|
-
const processError = (error152,
|
|
34704
|
+
const processError = (error152, path5 = []) => {
|
|
34705
34705
|
for (const issue4 of error152.issues) {
|
|
34706
34706
|
if (issue4.code === "invalid_union" && issue4.errors.length) {
|
|
34707
|
-
issue4.errors.map((issues) => processError({ issues }, [...
|
|
34707
|
+
issue4.errors.map((issues) => processError({ issues }, [...path5, ...issue4.path]));
|
|
34708
34708
|
} else if (issue4.code === "invalid_key") {
|
|
34709
|
-
processError({ issues: issue4.issues }, [...
|
|
34709
|
+
processError({ issues: issue4.issues }, [...path5, ...issue4.path]);
|
|
34710
34710
|
} else if (issue4.code === "invalid_element") {
|
|
34711
|
-
processError({ issues: issue4.issues }, [...
|
|
34711
|
+
processError({ issues: issue4.issues }, [...path5, ...issue4.path]);
|
|
34712
34712
|
} else {
|
|
34713
|
-
const fullpath = [...
|
|
34713
|
+
const fullpath = [...path5, ...issue4.path];
|
|
34714
34714
|
if (fullpath.length === 0) {
|
|
34715
34715
|
fieldErrors._errors.push(mapper(issue4));
|
|
34716
34716
|
} else {
|
|
@@ -34737,17 +34737,17 @@ function formatError3(error151, mapper = (issue4) => issue4.message) {
|
|
|
34737
34737
|
}
|
|
34738
34738
|
function treeifyError3(error151, mapper = (issue4) => issue4.message) {
|
|
34739
34739
|
const result = { errors: [] };
|
|
34740
|
-
const processError = (error152,
|
|
34740
|
+
const processError = (error152, path5 = []) => {
|
|
34741
34741
|
var _a7, _b;
|
|
34742
34742
|
for (const issue4 of error152.issues) {
|
|
34743
34743
|
if (issue4.code === "invalid_union" && issue4.errors.length) {
|
|
34744
|
-
issue4.errors.map((issues) => processError({ issues }, [...
|
|
34744
|
+
issue4.errors.map((issues) => processError({ issues }, [...path5, ...issue4.path]));
|
|
34745
34745
|
} else if (issue4.code === "invalid_key") {
|
|
34746
|
-
processError({ issues: issue4.issues }, [...
|
|
34746
|
+
processError({ issues: issue4.issues }, [...path5, ...issue4.path]);
|
|
34747
34747
|
} else if (issue4.code === "invalid_element") {
|
|
34748
|
-
processError({ issues: issue4.issues }, [...
|
|
34748
|
+
processError({ issues: issue4.issues }, [...path5, ...issue4.path]);
|
|
34749
34749
|
} else {
|
|
34750
|
-
const fullpath = [...
|
|
34750
|
+
const fullpath = [...path5, ...issue4.path];
|
|
34751
34751
|
if (fullpath.length === 0) {
|
|
34752
34752
|
result.errors.push(mapper(issue4));
|
|
34753
34753
|
continue;
|
|
@@ -34779,8 +34779,8 @@ function treeifyError3(error151, mapper = (issue4) => issue4.message) {
|
|
|
34779
34779
|
}
|
|
34780
34780
|
function toDotPath3(_path) {
|
|
34781
34781
|
const segs = [];
|
|
34782
|
-
const
|
|
34783
|
-
for (const seg of
|
|
34782
|
+
const path5 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
34783
|
+
for (const seg of path5) {
|
|
34784
34784
|
if (typeof seg === "number")
|
|
34785
34785
|
segs.push(`[${seg}]`);
|
|
34786
34786
|
else if (typeof seg === "symbol")
|
|
@@ -47472,13 +47472,13 @@ function resolveRef3(ref, ctx) {
|
|
|
47472
47472
|
if (!ref.startsWith("#")) {
|
|
47473
47473
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
47474
47474
|
}
|
|
47475
|
-
const
|
|
47476
|
-
if (
|
|
47475
|
+
const path5 = ref.slice(1).split("/").filter(Boolean);
|
|
47476
|
+
if (path5.length === 0) {
|
|
47477
47477
|
return ctx.rootSchema;
|
|
47478
47478
|
}
|
|
47479
47479
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
47480
|
-
if (
|
|
47481
|
-
const key =
|
|
47480
|
+
if (path5[0] === defsKey) {
|
|
47481
|
+
const key = path5[1];
|
|
47482
47482
|
if (!key || !ctx.defs[key]) {
|
|
47483
47483
|
throw new Error(`Reference not found: ${ref}`);
|
|
47484
47484
|
}
|
|
@@ -51844,6 +51844,7 @@ function benchmarkPatterns(iterations = 1e4) {
|
|
|
51844
51844
|
// ../utils/dist/command-resolver.js
|
|
51845
51845
|
var import_node_child_process = require("node:child_process");
|
|
51846
51846
|
var import_node_fs2 = __toESM(require("node:fs"), 1);
|
|
51847
|
+
var import_node_path2 = __toESM(require("node:path"), 1);
|
|
51847
51848
|
function resolveCommand(command) {
|
|
51848
51849
|
if (command.startsWith("/")) {
|
|
51849
51850
|
return resolveSymlinks(command);
|
|
@@ -51870,7 +51871,18 @@ function resolveCommand(command) {
|
|
|
51870
51871
|
function resolveSymlinks(filePath) {
|
|
51871
51872
|
try {
|
|
51872
51873
|
const resolved = import_node_fs2.default.realpathSync(filePath);
|
|
51873
|
-
if (resolved
|
|
51874
|
+
if (resolved === filePath) {
|
|
51875
|
+
return filePath;
|
|
51876
|
+
}
|
|
51877
|
+
const originalName = import_node_path2.default.basename(filePath);
|
|
51878
|
+
const resolvedName = import_node_path2.default.basename(resolved);
|
|
51879
|
+
if (originalName !== resolvedName) {
|
|
51880
|
+
if (process.env.DEBUG_SPAWN === "1") {
|
|
51881
|
+
console.log(`[command-resolver] Preserving shim ${filePath} (target ${resolved} has a different basename \u2014 likely a mise/asdf-style dispatcher)`);
|
|
51882
|
+
}
|
|
51883
|
+
return absolutizeShimPath(filePath);
|
|
51884
|
+
}
|
|
51885
|
+
if (process.env.DEBUG_SPAWN === "1") {
|
|
51874
51886
|
console.log(`[command-resolver] Resolved symlink: ${filePath} -> ${resolved}`);
|
|
51875
51887
|
}
|
|
51876
51888
|
return resolved;
|
|
@@ -51881,6 +51893,18 @@ function resolveSymlinks(filePath) {
|
|
|
51881
51893
|
return filePath;
|
|
51882
51894
|
}
|
|
51883
51895
|
}
|
|
51896
|
+
function absolutizeShimPath(filePath) {
|
|
51897
|
+
if (import_node_path2.default.isAbsolute(filePath)) {
|
|
51898
|
+
return filePath;
|
|
51899
|
+
}
|
|
51900
|
+
try {
|
|
51901
|
+
const parent = import_node_path2.default.dirname(filePath);
|
|
51902
|
+
const canonicalParent = import_node_fs2.default.realpathSync(parent === "" ? "." : parent);
|
|
51903
|
+
return import_node_path2.default.join(canonicalParent, import_node_path2.default.basename(filePath));
|
|
51904
|
+
} catch {
|
|
51905
|
+
return filePath;
|
|
51906
|
+
}
|
|
51907
|
+
}
|
|
51884
51908
|
function commandExists(command) {
|
|
51885
51909
|
try {
|
|
51886
51910
|
(0, import_node_child_process.execSync)(`which ${command}`, {
|
|
@@ -51895,7 +51919,7 @@ function commandExists(command) {
|
|
|
51895
51919
|
|
|
51896
51920
|
// ../utils/dist/git-remote.js
|
|
51897
51921
|
var fs3 = __toESM(require("node:fs"), 1);
|
|
51898
|
-
var
|
|
51922
|
+
var path3 = __toESM(require("node:path"), 1);
|
|
51899
51923
|
var import_node_child_process2 = require("node:child_process");
|
|
51900
51924
|
function parseGitRemoteUrl(url4) {
|
|
51901
51925
|
if (!url4)
|
|
@@ -51912,7 +51936,7 @@ function parseGitRemoteUrl(url4) {
|
|
|
51912
51936
|
}
|
|
51913
51937
|
function getGitRemoteUrl(workingDirectory, remoteName = "origin") {
|
|
51914
51938
|
try {
|
|
51915
|
-
const gitDir =
|
|
51939
|
+
const gitDir = path3.join(workingDirectory, ".git");
|
|
51916
51940
|
if (!fs3.existsSync(gitDir)) {
|
|
51917
51941
|
return null;
|
|
51918
51942
|
}
|
|
@@ -51925,7 +51949,7 @@ function getGitRemoteUrl(workingDirectory, remoteName = "origin") {
|
|
|
51925
51949
|
return result.trim() || null;
|
|
51926
51950
|
} catch {
|
|
51927
51951
|
try {
|
|
51928
|
-
const configPath =
|
|
51952
|
+
const configPath = path3.join(workingDirectory, ".git", "config");
|
|
51929
51953
|
if (!fs3.existsSync(configPath)) {
|
|
51930
51954
|
return null;
|
|
51931
51955
|
}
|
|
@@ -51946,13 +51970,13 @@ function getRepoFullName(workingDirectory) {
|
|
|
51946
51970
|
return parseGitRemoteUrl(remoteUrl);
|
|
51947
51971
|
}
|
|
51948
51972
|
function findGitRoot(startPath) {
|
|
51949
|
-
let currentPath =
|
|
51950
|
-
const root =
|
|
51973
|
+
let currentPath = path3.resolve(startPath);
|
|
51974
|
+
const root = path3.parse(currentPath).root;
|
|
51951
51975
|
while (currentPath !== root) {
|
|
51952
|
-
if (fs3.existsSync(
|
|
51976
|
+
if (fs3.existsSync(path3.join(currentPath, ".git"))) {
|
|
51953
51977
|
return currentPath;
|
|
51954
51978
|
}
|
|
51955
|
-
currentPath =
|
|
51979
|
+
currentPath = path3.dirname(currentPath);
|
|
51956
51980
|
}
|
|
51957
51981
|
return null;
|
|
51958
51982
|
}
|
|
@@ -51970,7 +51994,7 @@ function getRepoFullNameFromPath(workingDirectory) {
|
|
|
51970
51994
|
|
|
51971
51995
|
// ../utils/dist/update-checker.js
|
|
51972
51996
|
var import_node_fs3 = __toESM(require("node:fs"), 1);
|
|
51973
|
-
var
|
|
51997
|
+
var import_node_path3 = __toESM(require("node:path"), 1);
|
|
51974
51998
|
var import_node_https = __toESM(require("node:https"), 1);
|
|
51975
51999
|
var import_node_os = __toESM(require("node:os"), 1);
|
|
51976
52000
|
var import_compare_versions = __toESM(require_umd(), 1);
|
|
@@ -51978,8 +52002,8 @@ var PACKAGE_NAME = "agent-relay";
|
|
|
51978
52002
|
var CHECK_INTERVAL_MS = 60 * 60 * 1e3;
|
|
51979
52003
|
var NPM_REGISTRY_URL = `https://registry.npmjs.org/${PACKAGE_NAME}/latest`;
|
|
51980
52004
|
function getCachePath() {
|
|
51981
|
-
const cacheDir =
|
|
51982
|
-
return
|
|
52005
|
+
const cacheDir = import_node_path3.default.join(import_node_os.default.homedir(), ".agentworkforce/relay");
|
|
52006
|
+
return import_node_path3.default.join(cacheDir, "update-cache.json");
|
|
51983
52007
|
}
|
|
51984
52008
|
function readCache() {
|
|
51985
52009
|
try {
|
|
@@ -51995,7 +52019,7 @@ function readCache() {
|
|
|
51995
52019
|
function writeCache(cache) {
|
|
51996
52020
|
try {
|
|
51997
52021
|
const cachePath = getCachePath();
|
|
51998
|
-
const cacheDir =
|
|
52022
|
+
const cacheDir = import_node_path3.default.dirname(cachePath);
|
|
51999
52023
|
if (!import_node_fs3.default.existsSync(cacheDir)) {
|
|
52000
52024
|
import_node_fs3.default.mkdirSync(cacheDir, { recursive: true });
|
|
52001
52025
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-relay",
|
|
3
|
-
"version": "10.6.
|
|
3
|
+
"version": "10.6.4",
|
|
4
4
|
"description": "Real-time agent-to-agent communication system",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
"pack:validate": "npm pack --dry-run"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@agent-relay/cloud": "10.6.
|
|
47
|
-
"@agent-relay/config": "10.6.
|
|
48
|
-
"@agent-relay/fleet": "10.6.
|
|
49
|
-
"@agent-relay/harness-driver": "10.6.
|
|
50
|
-
"@agent-relay/sdk": "10.6.
|
|
51
|
-
"@agent-relay/utils": "10.6.
|
|
46
|
+
"@agent-relay/cloud": "10.6.4",
|
|
47
|
+
"@agent-relay/config": "10.6.4",
|
|
48
|
+
"@agent-relay/fleet": "10.6.4",
|
|
49
|
+
"@agent-relay/harness-driver": "10.6.4",
|
|
50
|
+
"@agent-relay/sdk": "10.6.4",
|
|
51
|
+
"@agent-relay/utils": "10.6.4",
|
|
52
52
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
53
|
-
"@relayfile/client": "^0.10.
|
|
53
|
+
"@relayfile/client": "^0.10.27",
|
|
54
54
|
"@relayflows/cli": "^1.0.1",
|
|
55
55
|
"@xterm/headless": "^6.0.0",
|
|
56
56
|
"commander": "^12.1.0",
|