agent-relay 9.2.1 → 9.2.2
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/README.md +26 -15
- package/dist/cli/bootstrap.d.ts.map +1 -1
- package/dist/cli/bootstrap.js +16 -2
- package/dist/cli/bootstrap.js.map +1 -1
- package/dist/cli/commands/cloud.d.ts +9 -0
- package/dist/cli/commands/cloud.d.ts.map +1 -1
- package/dist/cli/commands/cloud.js +71 -1
- package/dist/cli/commands/cloud.js.map +1 -1
- package/dist/cli/commands/core.d.ts +18 -1
- package/dist/cli/commands/core.d.ts.map +1 -1
- package/dist/cli/commands/core.js +15 -9
- package/dist/cli/commands/core.js.map +1 -1
- package/dist/cli/commands/fleet.d.ts +0 -12
- package/dist/cli/commands/fleet.d.ts.map +1 -1
- package/dist/cli/commands/fleet.js +17 -261
- package/dist/cli/commands/fleet.js.map +1 -1
- package/dist/cli/commands/local-workflow.d.ts.map +1 -1
- package/dist/cli/commands/local-workflow.js +15 -2
- package/dist/cli/commands/local-workflow.js.map +1 -1
- package/dist/cli/commands/node.d.ts +19 -0
- package/dist/cli/commands/node.d.ts.map +1 -0
- package/dist/cli/commands/node.js +86 -0
- package/dist/cli/commands/node.js.map +1 -0
- package/dist/cli/commands/reflex.d.ts +0 -2
- package/dist/cli/commands/reflex.d.ts.map +1 -1
- package/dist/cli/commands/reflex.js +25 -36
- package/dist/cli/commands/reflex.js.map +1 -1
- package/dist/cli/lib/broker-lifecycle.d.ts +10 -0
- package/dist/cli/lib/broker-lifecycle.d.ts.map +1 -1
- package/dist/cli/lib/broker-lifecycle.js +65 -10
- package/dist/cli/lib/broker-lifecycle.js.map +1 -1
- package/dist/cli/lib/fleet-sidecar.d.ts +16 -42
- package/dist/cli/lib/fleet-sidecar.d.ts.map +1 -1
- package/dist/cli/lib/fleet-sidecar.js +18 -380
- package/dist/cli/lib/fleet-sidecar.js.map +1 -1
- package/dist/cli/lib/node-definition-loader.d.ts +17 -0
- package/dist/cli/lib/node-definition-loader.d.ts.map +1 -0
- package/dist/cli/lib/node-definition-loader.js +124 -0
- package/dist/cli/lib/node-definition-loader.js.map +1 -0
- package/dist/cli/lib/reflex-capture.d.ts +41 -0
- package/dist/cli/lib/reflex-capture.d.ts.map +1 -0
- package/dist/cli/lib/reflex-capture.js +128 -0
- package/dist/cli/lib/reflex-capture.js.map +1 -0
- package/dist/index.cjs +73 -267
- package/package.json +10 -7
package/dist/index.cjs
CHANGED
|
@@ -192,7 +192,6 @@ __export(index_exports, {
|
|
|
192
192
|
buildModelSwitchCommand: () => buildModelSwitchCommand,
|
|
193
193
|
checkForUpdates: () => checkForUpdates,
|
|
194
194
|
checkForUpdatesInBackground: () => checkForUpdatesInBackground,
|
|
195
|
-
clearBinaryCache: () => clearBinaryCache,
|
|
196
195
|
commandExists: () => commandExists,
|
|
197
196
|
connectionLog: () => connectionLog,
|
|
198
197
|
createAgentHandle: () => createAgentHandle,
|
|
@@ -208,24 +207,19 @@ __export(index_exports, {
|
|
|
208
207
|
createWorkspaceFacade: () => createWorkspaceFacade,
|
|
209
208
|
defineHarness: () => defineHarness,
|
|
210
209
|
findGitRoot: () => findGitRoot,
|
|
211
|
-
findRelayPtyBinary: () => findRelayPtyBinary,
|
|
212
210
|
formatAgentHandle: () => formatAgentHandle,
|
|
213
211
|
generateAgentName: () => generateAgentName,
|
|
214
212
|
generateErrorId: () => generateErrorId,
|
|
215
213
|
generateRequestId: () => generateRequestId,
|
|
216
214
|
generateUniqueAgentName: () => generateUniqueAgentName,
|
|
217
215
|
getBaseCli: () => getBaseCli,
|
|
218
|
-
getCachedRelayPtyPath: () => getCachedRelayPtyPath,
|
|
219
216
|
getCompiledPatterns: () => getCompiledPatterns,
|
|
220
217
|
getGitRemoteUrl: () => getGitRemoteUrl,
|
|
221
|
-
getLastSearchPaths: () => getLastSearchPaths,
|
|
222
218
|
getModelCommandConfig: () => getModelCommandConfig,
|
|
223
219
|
getPatternMetrics: () => getPatternMetrics,
|
|
224
220
|
getRepoFullName: () => getRepoFullName,
|
|
225
221
|
getRepoFullNameFromPath: () => getRepoFullNameFromPath,
|
|
226
|
-
getSupportedPlatforms: () => getSupportedPlatforms,
|
|
227
222
|
handleResponse: () => handleResponse2,
|
|
228
|
-
hasRelayPtyBinary: () => hasRelayPtyBinary,
|
|
229
223
|
isEscapedFenceEndFast: () => isEscapedFenceEndFast,
|
|
230
224
|
isInstructionalTextFast: () => isInstructionalTextFast,
|
|
231
225
|
isInvalidAgentTokenError: () => isInvalidAgentTokenError,
|
|
@@ -233,7 +227,6 @@ __export(index_exports, {
|
|
|
233
227
|
isMatchingResponse: () => isMatchingResponse,
|
|
234
228
|
isModelSwitchSupported: () => isModelSwitchSupported,
|
|
235
229
|
isPlaceholderTargetFast: () => isPlaceholderTargetFast,
|
|
236
|
-
isPlatformSupported: () => isPlatformSupported,
|
|
237
230
|
isSpawnOrReleaseCommandFast: () => isSpawnOrReleaseCommandFast,
|
|
238
231
|
isValidAgentName: () => isValidAgentName,
|
|
239
232
|
logAndTraceError: () => logAndTraceError,
|
|
@@ -283,7 +276,7 @@ __export(index_exports, {
|
|
|
283
276
|
module.exports = __toCommonJS(index_exports);
|
|
284
277
|
|
|
285
278
|
// ../sdk/node_modules/@relaycast/sdk/dist/version.js
|
|
286
|
-
var SDK_VERSION = "5.0
|
|
279
|
+
var SDK_VERSION = "5.1.0";
|
|
287
280
|
|
|
288
281
|
// ../sdk/node_modules/zod/v4/classic/external.js
|
|
289
282
|
var external_exports = {};
|
|
@@ -1051,10 +1044,10 @@ function mergeDefs(...defs) {
|
|
|
1051
1044
|
function cloneDef(schema) {
|
|
1052
1045
|
return mergeDefs(schema._zod.def);
|
|
1053
1046
|
}
|
|
1054
|
-
function getElementAtPath(obj,
|
|
1055
|
-
if (!
|
|
1047
|
+
function getElementAtPath(obj, path4) {
|
|
1048
|
+
if (!path4)
|
|
1056
1049
|
return obj;
|
|
1057
|
-
return
|
|
1050
|
+
return path4.reduce((acc, key) => acc?.[key], obj);
|
|
1058
1051
|
}
|
|
1059
1052
|
function promiseAllObject(promisesObj) {
|
|
1060
1053
|
const keys = Object.keys(promisesObj);
|
|
@@ -1463,11 +1456,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
1463
1456
|
}
|
|
1464
1457
|
return false;
|
|
1465
1458
|
}
|
|
1466
|
-
function prefixIssues(
|
|
1459
|
+
function prefixIssues(path4, issues) {
|
|
1467
1460
|
return issues.map((iss) => {
|
|
1468
1461
|
var _a3;
|
|
1469
1462
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
1470
|
-
iss.path.unshift(
|
|
1463
|
+
iss.path.unshift(path4);
|
|
1471
1464
|
return iss;
|
|
1472
1465
|
});
|
|
1473
1466
|
}
|
|
@@ -1614,16 +1607,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
|
|
|
1614
1607
|
}
|
|
1615
1608
|
function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
1616
1609
|
const fieldErrors = { _errors: [] };
|
|
1617
|
-
const processError = (error52,
|
|
1610
|
+
const processError = (error52, path4 = []) => {
|
|
1618
1611
|
for (const issue2 of error52.issues) {
|
|
1619
1612
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1620
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1613
|
+
issue2.errors.map((issues) => processError({ issues }, [...path4, ...issue2.path]));
|
|
1621
1614
|
} else if (issue2.code === "invalid_key") {
|
|
1622
|
-
processError({ issues: issue2.issues }, [...
|
|
1615
|
+
processError({ issues: issue2.issues }, [...path4, ...issue2.path]);
|
|
1623
1616
|
} else if (issue2.code === "invalid_element") {
|
|
1624
|
-
processError({ issues: issue2.issues }, [...
|
|
1617
|
+
processError({ issues: issue2.issues }, [...path4, ...issue2.path]);
|
|
1625
1618
|
} else {
|
|
1626
|
-
const fullpath = [...
|
|
1619
|
+
const fullpath = [...path4, ...issue2.path];
|
|
1627
1620
|
if (fullpath.length === 0) {
|
|
1628
1621
|
fieldErrors._errors.push(mapper(issue2));
|
|
1629
1622
|
} else {
|
|
@@ -1650,17 +1643,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
|
1650
1643
|
}
|
|
1651
1644
|
function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
1652
1645
|
const result = { errors: [] };
|
|
1653
|
-
const processError = (error52,
|
|
1646
|
+
const processError = (error52, path4 = []) => {
|
|
1654
1647
|
var _a3, _b;
|
|
1655
1648
|
for (const issue2 of error52.issues) {
|
|
1656
1649
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1657
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1650
|
+
issue2.errors.map((issues) => processError({ issues }, [...path4, ...issue2.path]));
|
|
1658
1651
|
} else if (issue2.code === "invalid_key") {
|
|
1659
|
-
processError({ issues: issue2.issues }, [...
|
|
1652
|
+
processError({ issues: issue2.issues }, [...path4, ...issue2.path]);
|
|
1660
1653
|
} else if (issue2.code === "invalid_element") {
|
|
1661
|
-
processError({ issues: issue2.issues }, [...
|
|
1654
|
+
processError({ issues: issue2.issues }, [...path4, ...issue2.path]);
|
|
1662
1655
|
} else {
|
|
1663
|
-
const fullpath = [...
|
|
1656
|
+
const fullpath = [...path4, ...issue2.path];
|
|
1664
1657
|
if (fullpath.length === 0) {
|
|
1665
1658
|
result.errors.push(mapper(issue2));
|
|
1666
1659
|
continue;
|
|
@@ -1692,8 +1685,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
|
1692
1685
|
}
|
|
1693
1686
|
function toDotPath(_path) {
|
|
1694
1687
|
const segs = [];
|
|
1695
|
-
const
|
|
1696
|
-
for (const seg of
|
|
1688
|
+
const path4 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
1689
|
+
for (const seg of path4) {
|
|
1697
1690
|
if (typeof seg === "number")
|
|
1698
1691
|
segs.push(`[${seg}]`);
|
|
1699
1692
|
else if (typeof seg === "symbol")
|
|
@@ -14385,13 +14378,13 @@ function resolveRef(ref, ctx) {
|
|
|
14385
14378
|
if (!ref.startsWith("#")) {
|
|
14386
14379
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
14387
14380
|
}
|
|
14388
|
-
const
|
|
14389
|
-
if (
|
|
14381
|
+
const path4 = ref.slice(1).split("/").filter(Boolean);
|
|
14382
|
+
if (path4.length === 0) {
|
|
14390
14383
|
return ctx.rootSchema;
|
|
14391
14384
|
}
|
|
14392
14385
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
14393
|
-
if (
|
|
14394
|
-
const key =
|
|
14386
|
+
if (path4[0] === defsKey) {
|
|
14387
|
+
const key = path4[1];
|
|
14395
14388
|
if (!key || !ctx.defs[key]) {
|
|
14396
14389
|
throw new Error(`Reference not found: ${ref}`);
|
|
14397
14390
|
}
|
|
@@ -17516,8 +17509,8 @@ var HttpClient = class _HttpClient {
|
|
|
17516
17509
|
...this._agentRelayDistinctId ? { agentRelayDistinctId: this._agentRelayDistinctId } : {}
|
|
17517
17510
|
}));
|
|
17518
17511
|
}
|
|
17519
|
-
async request(method,
|
|
17520
|
-
const url2 = new URL(
|
|
17512
|
+
async request(method, path4, body, query, options) {
|
|
17513
|
+
const url2 = new URL(path4, this._baseUrl);
|
|
17521
17514
|
if (query) {
|
|
17522
17515
|
for (const [k, v] of Object.entries(query)) {
|
|
17523
17516
|
if (v !== void 0)
|
|
@@ -17588,20 +17581,20 @@ var HttpClient = class _HttpClient {
|
|
|
17588
17581
|
return camelizeKeys(parsedData);
|
|
17589
17582
|
}
|
|
17590
17583
|
}
|
|
17591
|
-
get(
|
|
17592
|
-
return this.request("GET",
|
|
17584
|
+
get(path4, query, options) {
|
|
17585
|
+
return this.request("GET", path4, void 0, query, options);
|
|
17593
17586
|
}
|
|
17594
|
-
post(
|
|
17595
|
-
return this.request("POST",
|
|
17587
|
+
post(path4, body, options) {
|
|
17588
|
+
return this.request("POST", path4, body, void 0, options);
|
|
17596
17589
|
}
|
|
17597
|
-
patch(
|
|
17598
|
-
return this.request("PATCH",
|
|
17590
|
+
patch(path4, body, options) {
|
|
17591
|
+
return this.request("PATCH", path4, body, void 0, options);
|
|
17599
17592
|
}
|
|
17600
|
-
put(
|
|
17601
|
-
return this.request("PUT",
|
|
17593
|
+
put(path4, body, options) {
|
|
17594
|
+
return this.request("PUT", path4, body, void 0, options);
|
|
17602
17595
|
}
|
|
17603
|
-
async delete(
|
|
17604
|
-
await this.request("DELETE",
|
|
17596
|
+
async delete(path4, options) {
|
|
17597
|
+
await this.request("DELETE", path4, void 0, void 0, options);
|
|
17605
17598
|
}
|
|
17606
17599
|
};
|
|
17607
17600
|
|
|
@@ -18200,72 +18193,72 @@ function validateJsonSchemaLite(value, schema) {
|
|
|
18200
18193
|
validateAgainstSchema(value, schema, "$", state);
|
|
18201
18194
|
return { valid: state.issues.length === 0, issues: state.issues };
|
|
18202
18195
|
}
|
|
18203
|
-
function validateAgainstSchema(value, schema,
|
|
18196
|
+
function validateAgainstSchema(value, schema, path4, state) {
|
|
18204
18197
|
if (schema === true) {
|
|
18205
18198
|
return;
|
|
18206
18199
|
}
|
|
18207
18200
|
if (schema === false) {
|
|
18208
|
-
addIssue(state,
|
|
18201
|
+
addIssue(state, path4, "value is not allowed", "never", describeValue(value));
|
|
18209
18202
|
return;
|
|
18210
18203
|
}
|
|
18211
18204
|
if (!isSchemaObject(schema)) {
|
|
18212
|
-
addIssue(state,
|
|
18205
|
+
addIssue(state, path4, "schema must be a boolean or object", "schema", describeValue(schema));
|
|
18213
18206
|
return;
|
|
18214
18207
|
}
|
|
18215
|
-
validateCombinators(value, schema,
|
|
18208
|
+
validateCombinators(value, schema, path4, state);
|
|
18216
18209
|
if (schema.const !== void 0 && !jsonEqual(value, schema.const)) {
|
|
18217
|
-
addIssue(state,
|
|
18210
|
+
addIssue(state, path4, `expected const ${JSON.stringify(schema.const)}`, JSON.stringify(schema.const), describeValue(value));
|
|
18218
18211
|
}
|
|
18219
18212
|
if (schema.enum && !schema.enum.some((candidate) => jsonEqual(value, candidate))) {
|
|
18220
|
-
addIssue(state,
|
|
18213
|
+
addIssue(state, path4, `expected one of ${schema.enum.map((candidate) => JSON.stringify(candidate)).join(", ")}`);
|
|
18221
18214
|
}
|
|
18222
18215
|
const types = getExpectedTypes(schema);
|
|
18223
18216
|
if (types.length > 0 && !types.some((type) => matchesType(value, type))) {
|
|
18224
|
-
addIssue(state,
|
|
18217
|
+
addIssue(state, path4, `expected ${types.join(" or ")}`, types.join(" or "), describeValue(value));
|
|
18225
18218
|
return;
|
|
18226
18219
|
}
|
|
18227
18220
|
if (shouldValidateObject(value, schema)) {
|
|
18228
|
-
validateObject(value, schema,
|
|
18221
|
+
validateObject(value, schema, path4, state);
|
|
18229
18222
|
}
|
|
18230
18223
|
if (shouldValidateArray(value, schema)) {
|
|
18231
|
-
validateArray(value, schema,
|
|
18224
|
+
validateArray(value, schema, path4, state);
|
|
18232
18225
|
}
|
|
18233
18226
|
if (typeof value === "string") {
|
|
18234
|
-
validateString(value, schema,
|
|
18227
|
+
validateString(value, schema, path4, state);
|
|
18235
18228
|
}
|
|
18236
18229
|
if (typeof value === "number") {
|
|
18237
|
-
validateNumber(value, schema,
|
|
18230
|
+
validateNumber(value, schema, path4, state);
|
|
18238
18231
|
}
|
|
18239
18232
|
}
|
|
18240
|
-
function validateCombinators(value, schema,
|
|
18233
|
+
function validateCombinators(value, schema, path4, state) {
|
|
18241
18234
|
if (schema.allOf) {
|
|
18242
18235
|
for (const child of schema.allOf) {
|
|
18243
|
-
validateAgainstSchema(value, child,
|
|
18236
|
+
validateAgainstSchema(value, child, path4, state);
|
|
18244
18237
|
}
|
|
18245
18238
|
}
|
|
18246
18239
|
if (schema.anyOf) {
|
|
18247
18240
|
const matched = schema.anyOf.some((child) => validateJsonSchemaLite(value, child).valid);
|
|
18248
18241
|
if (!matched) {
|
|
18249
|
-
addIssue(state,
|
|
18242
|
+
addIssue(state, path4, "expected value to match at least one anyOf schema");
|
|
18250
18243
|
}
|
|
18251
18244
|
}
|
|
18252
18245
|
if (schema.oneOf) {
|
|
18253
18246
|
const matches = schema.oneOf.filter((child) => validateJsonSchemaLite(value, child).valid).length;
|
|
18254
18247
|
if (matches !== 1) {
|
|
18255
|
-
addIssue(state,
|
|
18248
|
+
addIssue(state, path4, `expected value to match exactly one oneOf schema, matched ${matches}`);
|
|
18256
18249
|
}
|
|
18257
18250
|
}
|
|
18258
18251
|
}
|
|
18259
|
-
function validateObject(value, schema,
|
|
18252
|
+
function validateObject(value, schema, path4, state) {
|
|
18260
18253
|
for (const key of schema.required ?? []) {
|
|
18261
18254
|
if (!Object.prototype.hasOwnProperty.call(value, key)) {
|
|
18262
|
-
addIssue(state, appendPath(
|
|
18255
|
+
addIssue(state, appendPath(path4, key), "required property is missing");
|
|
18263
18256
|
}
|
|
18264
18257
|
}
|
|
18265
18258
|
const properties = schema.properties ?? {};
|
|
18266
18259
|
for (const [key, childSchema] of Object.entries(properties)) {
|
|
18267
18260
|
if (Object.prototype.hasOwnProperty.call(value, key)) {
|
|
18268
|
-
validateAgainstSchema(value[key], childSchema, appendPath(
|
|
18261
|
+
validateAgainstSchema(value[key], childSchema, appendPath(path4, key), state);
|
|
18269
18262
|
}
|
|
18270
18263
|
}
|
|
18271
18264
|
const additional = schema.additionalProperties;
|
|
@@ -18277,48 +18270,48 @@ function validateObject(value, schema, path5, state) {
|
|
|
18277
18270
|
continue;
|
|
18278
18271
|
}
|
|
18279
18272
|
if (additional === false) {
|
|
18280
|
-
addIssue(state, appendPath(
|
|
18273
|
+
addIssue(state, appendPath(path4, key), "additional property is not allowed");
|
|
18281
18274
|
} else {
|
|
18282
|
-
validateAgainstSchema(value[key], additional, appendPath(
|
|
18275
|
+
validateAgainstSchema(value[key], additional, appendPath(path4, key), state);
|
|
18283
18276
|
}
|
|
18284
18277
|
}
|
|
18285
18278
|
}
|
|
18286
|
-
function validateArray(value, schema,
|
|
18279
|
+
function validateArray(value, schema, path4, state) {
|
|
18287
18280
|
if (schema.minItems !== void 0 && value.length < schema.minItems) {
|
|
18288
|
-
addIssue(state,
|
|
18281
|
+
addIssue(state, path4, `expected at least ${schema.minItems} items`);
|
|
18289
18282
|
}
|
|
18290
18283
|
if (schema.maxItems !== void 0 && value.length > schema.maxItems) {
|
|
18291
|
-
addIssue(state,
|
|
18284
|
+
addIssue(state, path4, `expected at most ${schema.maxItems} items`);
|
|
18292
18285
|
}
|
|
18293
18286
|
if (schema.items !== void 0) {
|
|
18294
18287
|
value.forEach((item, index) => {
|
|
18295
|
-
validateAgainstSchema(item, schema.items, `${
|
|
18288
|
+
validateAgainstSchema(item, schema.items, `${path4}[${index}]`, state);
|
|
18296
18289
|
});
|
|
18297
18290
|
}
|
|
18298
18291
|
}
|
|
18299
|
-
function validateString(value, schema,
|
|
18292
|
+
function validateString(value, schema, path4, state) {
|
|
18300
18293
|
if (schema.minLength !== void 0 && value.length < schema.minLength) {
|
|
18301
|
-
addIssue(state,
|
|
18294
|
+
addIssue(state, path4, `expected length >= ${schema.minLength}`);
|
|
18302
18295
|
}
|
|
18303
18296
|
if (schema.maxLength !== void 0 && value.length > schema.maxLength) {
|
|
18304
|
-
addIssue(state,
|
|
18297
|
+
addIssue(state, path4, `expected length <= ${schema.maxLength}`);
|
|
18305
18298
|
}
|
|
18306
18299
|
if (schema.pattern !== void 0) {
|
|
18307
18300
|
try {
|
|
18308
18301
|
if (!new RegExp(schema.pattern).test(value)) {
|
|
18309
|
-
addIssue(state,
|
|
18302
|
+
addIssue(state, path4, `expected string to match /${schema.pattern}/`);
|
|
18310
18303
|
}
|
|
18311
18304
|
} catch {
|
|
18312
|
-
addIssue(state,
|
|
18305
|
+
addIssue(state, path4, `invalid pattern /${schema.pattern}/`);
|
|
18313
18306
|
}
|
|
18314
18307
|
}
|
|
18315
18308
|
}
|
|
18316
|
-
function validateNumber(value, schema,
|
|
18309
|
+
function validateNumber(value, schema, path4, state) {
|
|
18317
18310
|
if (schema.minimum !== void 0 && value < schema.minimum) {
|
|
18318
|
-
addIssue(state,
|
|
18311
|
+
addIssue(state, path4, `expected value >= ${schema.minimum}`);
|
|
18319
18312
|
}
|
|
18320
18313
|
if (schema.maximum !== void 0 && value > schema.maximum) {
|
|
18321
|
-
addIssue(state,
|
|
18314
|
+
addIssue(state, path4, `expected value <= ${schema.maximum}`);
|
|
18322
18315
|
}
|
|
18323
18316
|
}
|
|
18324
18317
|
function getExpectedTypes(schema) {
|
|
@@ -18367,12 +18360,12 @@ function isPlainObject3(value) {
|
|
|
18367
18360
|
function isSchemaObject(value) {
|
|
18368
18361
|
return isPlainObject3(value);
|
|
18369
18362
|
}
|
|
18370
|
-
function appendPath(
|
|
18371
|
-
return /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(key) ? `${
|
|
18363
|
+
function appendPath(path4, key) {
|
|
18364
|
+
return /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(key) ? `${path4}.${key}` : `${path4}[${JSON.stringify(key)}]`;
|
|
18372
18365
|
}
|
|
18373
|
-
function addIssue(state,
|
|
18366
|
+
function addIssue(state, path4, message, expected, received) {
|
|
18374
18367
|
state.issues.push({
|
|
18375
|
-
path:
|
|
18368
|
+
path: path4,
|
|
18376
18369
|
message,
|
|
18377
18370
|
...expected !== void 0 ? { expected } : {},
|
|
18378
18371
|
...received !== void 0 ? { received } : {}
|
|
@@ -18702,11 +18695,11 @@ function zodIssues(error51) {
|
|
|
18702
18695
|
message: issue2.message
|
|
18703
18696
|
}));
|
|
18704
18697
|
}
|
|
18705
|
-
function formatZodPath(
|
|
18706
|
-
if (
|
|
18698
|
+
function formatZodPath(path4) {
|
|
18699
|
+
if (path4.length === 0)
|
|
18707
18700
|
return "$";
|
|
18708
18701
|
let result = "$";
|
|
18709
|
-
for (const part of
|
|
18702
|
+
for (const part of path4) {
|
|
18710
18703
|
result = typeof part === "number" ? `${result}[${part}]` : `${result}.${part}`;
|
|
18711
18704
|
}
|
|
18712
18705
|
return result;
|
|
@@ -22490,186 +22483,6 @@ function validateModelForCli(cli, model) {
|
|
|
22490
22483
|
return { valid: true, normalizedModel };
|
|
22491
22484
|
}
|
|
22492
22485
|
|
|
22493
|
-
// ../utils/dist/relay-pty-path.js
|
|
22494
|
-
var import_node_fs4 = __toESM(require("node:fs"), 1);
|
|
22495
|
-
var import_node_os2 = __toESM(require("node:os"), 1);
|
|
22496
|
-
var import_node_path3 = __toESM(require("node:path"), 1);
|
|
22497
|
-
var SUPPORTED_PLATFORMS = {
|
|
22498
|
-
darwin: {
|
|
22499
|
-
arm64: "relay-pty-darwin-arm64",
|
|
22500
|
-
x64: "relay-pty-darwin-x64"
|
|
22501
|
-
},
|
|
22502
|
-
linux: {
|
|
22503
|
-
arm64: "relay-pty-linux-arm64",
|
|
22504
|
-
x64: "relay-pty-linux-x64"
|
|
22505
|
-
}
|
|
22506
|
-
};
|
|
22507
|
-
function getPlatformBinaryName() {
|
|
22508
|
-
const platform = import_node_os2.default.platform();
|
|
22509
|
-
const arch = import_node_os2.default.arch();
|
|
22510
|
-
return SUPPORTED_PLATFORMS[platform]?.[arch] ?? null;
|
|
22511
|
-
}
|
|
22512
|
-
function isPlatformSupported() {
|
|
22513
|
-
const platform = import_node_os2.default.platform();
|
|
22514
|
-
const arch = import_node_os2.default.arch();
|
|
22515
|
-
return SUPPORTED_PLATFORMS[platform]?.[arch] !== void 0;
|
|
22516
|
-
}
|
|
22517
|
-
function getSupportedPlatforms() {
|
|
22518
|
-
const platforms = [];
|
|
22519
|
-
for (const [os3, archs] of Object.entries(SUPPORTED_PLATFORMS)) {
|
|
22520
|
-
for (const arch of Object.keys(archs)) {
|
|
22521
|
-
platforms.push(`${os3}-${arch}`);
|
|
22522
|
-
}
|
|
22523
|
-
}
|
|
22524
|
-
return platforms.join(", ");
|
|
22525
|
-
}
|
|
22526
|
-
var cachedBinaryPath;
|
|
22527
|
-
var cacheChecked = false;
|
|
22528
|
-
var lastSearchPaths = [];
|
|
22529
|
-
function getLastSearchPaths() {
|
|
22530
|
-
return [...lastSearchPaths];
|
|
22531
|
-
}
|
|
22532
|
-
function findRelayPtyBinary(callerDirname) {
|
|
22533
|
-
const envOverride = process.env.RELAY_PTY_BINARY;
|
|
22534
|
-
if (envOverride && isExecutable(envOverride) && isPlatformCompatibleBinary(envOverride)) {
|
|
22535
|
-
lastSearchPaths = [envOverride];
|
|
22536
|
-
return envOverride;
|
|
22537
|
-
}
|
|
22538
|
-
const platformBinary = getPlatformBinaryName();
|
|
22539
|
-
const normalizedCaller = callerDirname.replace(/\\/g, "/");
|
|
22540
|
-
const packageRoots = [];
|
|
22541
|
-
const scopedMatch = normalizedCaller.match(/^(.+?\/node_modules)\/@agent-relay\//);
|
|
22542
|
-
const directMatch = normalizedCaller.match(/^(.+?\/node_modules\/agent-relay)/);
|
|
22543
|
-
if (scopedMatch) {
|
|
22544
|
-
packageRoots.push(import_node_path3.default.join(scopedMatch[1], "agent-relay"));
|
|
22545
|
-
}
|
|
22546
|
-
if (directMatch) {
|
|
22547
|
-
packageRoots.push(directMatch[1]);
|
|
22548
|
-
}
|
|
22549
|
-
const home = process.env.HOME || process.env.USERPROFILE || "";
|
|
22550
|
-
if (home) {
|
|
22551
|
-
const npxCacheBase = import_node_path3.default.join(home, ".npm", "_npx");
|
|
22552
|
-
if (import_node_fs4.default.existsSync(npxCacheBase)) {
|
|
22553
|
-
try {
|
|
22554
|
-
const entries = import_node_fs4.default.readdirSync(npxCacheBase);
|
|
22555
|
-
for (const entry of entries) {
|
|
22556
|
-
const npxPackage = import_node_path3.default.join(npxCacheBase, entry, "node_modules", "agent-relay");
|
|
22557
|
-
if (import_node_fs4.default.existsSync(npxPackage)) {
|
|
22558
|
-
packageRoots.push(npxPackage);
|
|
22559
|
-
}
|
|
22560
|
-
}
|
|
22561
|
-
} catch {
|
|
22562
|
-
}
|
|
22563
|
-
}
|
|
22564
|
-
}
|
|
22565
|
-
packageRoots.push(import_node_path3.default.join(process.cwd(), "node_modules", "agent-relay"));
|
|
22566
|
-
if (home) {
|
|
22567
|
-
packageRoots.push(import_node_path3.default.join(home, ".nvm", "versions", "node", process.version, "lib", "node_modules", "agent-relay"));
|
|
22568
|
-
packageRoots.push(import_node_path3.default.join(home, ".volta", "tools", "image", "packages", "agent-relay", "lib", "node_modules", "agent-relay"));
|
|
22569
|
-
packageRoots.push(import_node_path3.default.join(home, ".fnm", "node-versions", process.version, "installation", "lib", "node_modules", "agent-relay"));
|
|
22570
|
-
packageRoots.push(import_node_path3.default.join(home, "n", "lib", "node_modules", "agent-relay"));
|
|
22571
|
-
packageRoots.push(import_node_path3.default.join(home, ".asdf", "installs", "nodejs", process.version.replace("v", ""), "lib", "node_modules", "agent-relay"));
|
|
22572
|
-
packageRoots.push(import_node_path3.default.join(home, ".local", "share", "pnpm", "global", "node_modules", "agent-relay"));
|
|
22573
|
-
packageRoots.push(import_node_path3.default.join(home, ".config", "yarn", "global", "node_modules", "agent-relay"));
|
|
22574
|
-
packageRoots.push(import_node_path3.default.join(home, ".yarn", "global", "node_modules", "agent-relay"));
|
|
22575
|
-
}
|
|
22576
|
-
const bashInstallerDir = process.env.AGENT_RELAY_INSTALL_DIR ? import_node_path3.default.join(process.env.AGENT_RELAY_INSTALL_DIR, "bin") : home ? import_node_path3.default.join(home, ".agentworkforce/relay", "bin") : null;
|
|
22577
|
-
const bashInstallerBinDir = process.env.AGENT_RELAY_BIN_DIR || (home ? import_node_path3.default.join(home, ".local", "bin") : null);
|
|
22578
|
-
const nodePrefix = import_node_path3.default.resolve(import_node_path3.default.dirname(process.execPath), "..");
|
|
22579
|
-
packageRoots.push(import_node_path3.default.join(nodePrefix, "lib", "node_modules", "agent-relay"));
|
|
22580
|
-
packageRoots.push("/usr/local/lib/node_modules/agent-relay");
|
|
22581
|
-
packageRoots.push("/opt/homebrew/lib/node_modules/agent-relay");
|
|
22582
|
-
packageRoots.push("/usr/lib/node_modules/agent-relay");
|
|
22583
|
-
const candidates = [];
|
|
22584
|
-
for (const root of packageRoots) {
|
|
22585
|
-
if (platformBinary) {
|
|
22586
|
-
candidates.push(import_node_path3.default.join(root, "bin", platformBinary));
|
|
22587
|
-
}
|
|
22588
|
-
candidates.push(import_node_path3.default.join(root, "bin", "relay-pty"));
|
|
22589
|
-
}
|
|
22590
|
-
if (bashInstallerDir) {
|
|
22591
|
-
if (platformBinary) {
|
|
22592
|
-
candidates.push(import_node_path3.default.join(bashInstallerDir, platformBinary));
|
|
22593
|
-
}
|
|
22594
|
-
candidates.push(import_node_path3.default.join(bashInstallerDir, "relay-pty"));
|
|
22595
|
-
}
|
|
22596
|
-
if (bashInstallerBinDir) {
|
|
22597
|
-
if (platformBinary) {
|
|
22598
|
-
candidates.push(import_node_path3.default.join(bashInstallerBinDir, platformBinary));
|
|
22599
|
-
}
|
|
22600
|
-
candidates.push(import_node_path3.default.join(bashInstallerBinDir, "relay-pty"));
|
|
22601
|
-
}
|
|
22602
|
-
candidates.push("/app/bin/relay-pty");
|
|
22603
|
-
candidates.push("/usr/local/bin/relay-pty");
|
|
22604
|
-
candidates.push("/usr/bin/relay-pty");
|
|
22605
|
-
lastSearchPaths = candidates;
|
|
22606
|
-
for (const candidate of candidates) {
|
|
22607
|
-
if (isExecutable(candidate) && isPlatformCompatibleBinary(candidate)) {
|
|
22608
|
-
return candidate;
|
|
22609
|
-
}
|
|
22610
|
-
}
|
|
22611
|
-
return null;
|
|
22612
|
-
}
|
|
22613
|
-
function isExecutable(filePath) {
|
|
22614
|
-
try {
|
|
22615
|
-
import_node_fs4.default.accessSync(filePath, import_node_fs4.default.constants.X_OK);
|
|
22616
|
-
return true;
|
|
22617
|
-
} catch {
|
|
22618
|
-
return false;
|
|
22619
|
-
}
|
|
22620
|
-
}
|
|
22621
|
-
function isPlatformCompatibleBinary(filePath) {
|
|
22622
|
-
let fd;
|
|
22623
|
-
try {
|
|
22624
|
-
fd = import_node_fs4.default.openSync(filePath, "r");
|
|
22625
|
-
const header = Buffer.alloc(4);
|
|
22626
|
-
const bytesRead = import_node_fs4.default.readSync(fd, header, 0, 4, 0);
|
|
22627
|
-
if (bytesRead < 4) {
|
|
22628
|
-
return false;
|
|
22629
|
-
}
|
|
22630
|
-
const magic = header.readUInt32BE(0);
|
|
22631
|
-
const platform = import_node_os2.default.platform();
|
|
22632
|
-
if (platform === "darwin") {
|
|
22633
|
-
return isMachOBinary(magic);
|
|
22634
|
-
}
|
|
22635
|
-
if (platform === "linux") {
|
|
22636
|
-
return magic === 2135247942;
|
|
22637
|
-
}
|
|
22638
|
-
return true;
|
|
22639
|
-
} catch {
|
|
22640
|
-
return true;
|
|
22641
|
-
} finally {
|
|
22642
|
-
if (fd !== void 0) {
|
|
22643
|
-
try {
|
|
22644
|
-
import_node_fs4.default.closeSync(fd);
|
|
22645
|
-
} catch {
|
|
22646
|
-
}
|
|
22647
|
-
}
|
|
22648
|
-
}
|
|
22649
|
-
}
|
|
22650
|
-
function isMachOBinary(magic) {
|
|
22651
|
-
return magic === 3489328638 || // MH_CIGAM_64 — 64-bit, byte-swapped (arm64/x64 LE files read as BE)
|
|
22652
|
-
magic === 4277009103 || // MH_MAGIC_64 — 64-bit, native byte order
|
|
22653
|
-
magic === 3472551422 || // MH_CIGAM — 32-bit, byte-swapped
|
|
22654
|
-
magic === 4277009102 || // MH_MAGIC — 32-bit, native byte order
|
|
22655
|
-
magic === 3405691582 || // FAT_MAGIC — universal/fat binary
|
|
22656
|
-
magic === 3199925962;
|
|
22657
|
-
}
|
|
22658
|
-
function hasRelayPtyBinary(callerDirname) {
|
|
22659
|
-
if (!cacheChecked) {
|
|
22660
|
-
cachedBinaryPath = findRelayPtyBinary(callerDirname);
|
|
22661
|
-
cacheChecked = true;
|
|
22662
|
-
}
|
|
22663
|
-
return cachedBinaryPath !== null;
|
|
22664
|
-
}
|
|
22665
|
-
function getCachedRelayPtyPath() {
|
|
22666
|
-
return cachedBinaryPath;
|
|
22667
|
-
}
|
|
22668
|
-
function clearBinaryCache() {
|
|
22669
|
-
cachedBinaryPath = void 0;
|
|
22670
|
-
cacheChecked = false;
|
|
22671
|
-
}
|
|
22672
|
-
|
|
22673
22486
|
// ../utils/dist/client-helpers.js
|
|
22674
22487
|
var import_node_net = require("node:net");
|
|
22675
22488
|
var import_node_crypto2 = require("node:crypto");
|
|
@@ -22836,7 +22649,6 @@ function generateRequestId(prefix = "") {
|
|
|
22836
22649
|
buildModelSwitchCommand,
|
|
22837
22650
|
checkForUpdates,
|
|
22838
22651
|
checkForUpdatesInBackground,
|
|
22839
|
-
clearBinaryCache,
|
|
22840
22652
|
commandExists,
|
|
22841
22653
|
connectionLog,
|
|
22842
22654
|
createAgentHandle,
|
|
@@ -22852,24 +22664,19 @@ function generateRequestId(prefix = "") {
|
|
|
22852
22664
|
createWorkspaceFacade,
|
|
22853
22665
|
defineHarness,
|
|
22854
22666
|
findGitRoot,
|
|
22855
|
-
findRelayPtyBinary,
|
|
22856
22667
|
formatAgentHandle,
|
|
22857
22668
|
generateAgentName,
|
|
22858
22669
|
generateErrorId,
|
|
22859
22670
|
generateRequestId,
|
|
22860
22671
|
generateUniqueAgentName,
|
|
22861
22672
|
getBaseCli,
|
|
22862
|
-
getCachedRelayPtyPath,
|
|
22863
22673
|
getCompiledPatterns,
|
|
22864
22674
|
getGitRemoteUrl,
|
|
22865
|
-
getLastSearchPaths,
|
|
22866
22675
|
getModelCommandConfig,
|
|
22867
22676
|
getPatternMetrics,
|
|
22868
22677
|
getRepoFullName,
|
|
22869
22678
|
getRepoFullNameFromPath,
|
|
22870
|
-
getSupportedPlatforms,
|
|
22871
22679
|
handleResponse,
|
|
22872
|
-
hasRelayPtyBinary,
|
|
22873
22680
|
isEscapedFenceEndFast,
|
|
22874
22681
|
isInstructionalTextFast,
|
|
22875
22682
|
isInvalidAgentTokenError,
|
|
@@ -22877,7 +22684,6 @@ function generateRequestId(prefix = "") {
|
|
|
22877
22684
|
isMatchingResponse,
|
|
22878
22685
|
isModelSwitchSupported,
|
|
22879
22686
|
isPlaceholderTargetFast,
|
|
22880
|
-
isPlatformSupported,
|
|
22881
22687
|
isSpawnOrReleaseCommandFast,
|
|
22882
22688
|
isValidAgentName,
|
|
22883
22689
|
logAndTraceError,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-relay",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.2",
|
|
4
4
|
"description": "Real-time agent-to-agent communication system",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"pack:validate": "npm pack --dry-run"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@agent-relay/cloud": "9.2.
|
|
47
|
-
"@agent-relay/config": "9.2.
|
|
48
|
-
"@agent-relay/fleet": "9.2.
|
|
49
|
-
"@agent-relay/harness-driver": "9.2.
|
|
50
|
-
"@agent-relay/sdk": "9.2.
|
|
51
|
-
"@agent-relay/utils": "9.2.
|
|
46
|
+
"@agent-relay/cloud": "9.2.2",
|
|
47
|
+
"@agent-relay/config": "9.2.2",
|
|
48
|
+
"@agent-relay/fleet": "9.2.2",
|
|
49
|
+
"@agent-relay/harness-driver": "9.2.2",
|
|
50
|
+
"@agent-relay/sdk": "9.2.2",
|
|
51
|
+
"@agent-relay/utils": "9.2.2",
|
|
52
52
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
53
53
|
"@relaycast/sdk": "^5.0.5",
|
|
54
54
|
"@relayfile/client": "^0.10.19",
|
|
@@ -61,6 +61,9 @@
|
|
|
61
61
|
"ws": "^8.18.3",
|
|
62
62
|
"zod": "^3.23.8"
|
|
63
63
|
},
|
|
64
|
+
"optionalDependencies": {
|
|
65
|
+
"ai-hist-native": "^0.4.1"
|
|
66
|
+
},
|
|
64
67
|
"devDependencies": {
|
|
65
68
|
"esbuild": "^0.27.2"
|
|
66
69
|
},
|