agent-relay 4.0.16 → 4.0.18
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 +220 -215
- package/dist/src/cli/commands/messaging.d.ts.map +1 -1
- package/dist/src/cli/commands/messaging.js +9 -5
- package/dist/src/cli/commands/messaging.js.map +1 -1
- package/dist/src/cli/commands/setup.d.ts +12 -0
- package/dist/src/cli/commands/setup.d.ts.map +1 -1
- package/dist/src/cli/commands/setup.js +152 -22
- package/dist/src/cli/commands/setup.js.map +1 -1
- package/node_modules/@agent-relay/cloud/package.json +2 -2
- package/node_modules/@agent-relay/config/package.json +1 -1
- package/node_modules/@agent-relay/hooks/package.json +4 -4
- package/node_modules/@agent-relay/sdk/dist/communicate/a2a-transport.d.ts.map +1 -1
- package/node_modules/@agent-relay/sdk/dist/communicate/a2a-transport.js +3 -0
- package/node_modules/@agent-relay/sdk/dist/communicate/a2a-transport.js.map +1 -1
- package/node_modules/@agent-relay/sdk/dist/workers.d.ts +39 -0
- package/node_modules/@agent-relay/sdk/dist/workers.d.ts.map +1 -0
- package/node_modules/@agent-relay/sdk/dist/workers.js +39 -0
- package/node_modules/@agent-relay/sdk/dist/workers.js.map +1 -0
- package/node_modules/@agent-relay/sdk/dist/workflows/__tests__/template-resolver.test.js +1 -1
- package/node_modules/@agent-relay/sdk/dist/workflows/__tests__/template-resolver.test.js.map +1 -1
- package/node_modules/@agent-relay/sdk/dist/workflows/builder.d.ts.map +1 -1
- package/node_modules/@agent-relay/sdk/dist/workflows/builder.js +8 -2
- package/node_modules/@agent-relay/sdk/dist/workflows/builder.js.map +1 -1
- package/node_modules/@agent-relay/sdk/dist/workflows/verification.d.ts.map +1 -1
- package/node_modules/@agent-relay/sdk/dist/workflows/verification.js +6 -3
- package/node_modules/@agent-relay/sdk/dist/workflows/verification.js.map +1 -1
- package/node_modules/@agent-relay/sdk/package.json +4 -2
- package/node_modules/@agent-relay/telemetry/package.json +1 -1
- package/node_modules/@agent-relay/trajectory/package.json +2 -2
- package/node_modules/@agent-relay/user-directory/package.json +2 -2
- package/node_modules/@agent-relay/utils/package.json +2 -2
- package/package.json +10 -10
- package/packages/cloud/package.json +2 -2
- package/packages/config/package.json +1 -1
- package/packages/hooks/package.json +4 -4
- package/packages/sdk/dist/communicate/a2a-transport.d.ts.map +1 -1
- package/packages/sdk/dist/communicate/a2a-transport.js +3 -0
- package/packages/sdk/dist/communicate/a2a-transport.js.map +1 -1
- package/packages/sdk/dist/workers.d.ts +39 -0
- package/packages/sdk/dist/workers.d.ts.map +1 -0
- package/packages/sdk/dist/workers.js +39 -0
- package/packages/sdk/dist/workers.js.map +1 -0
- package/packages/sdk/dist/workflows/__tests__/template-resolver.test.js +1 -1
- package/packages/sdk/dist/workflows/__tests__/template-resolver.test.js.map +1 -1
- package/packages/sdk/dist/workflows/builder.d.ts.map +1 -1
- package/packages/sdk/dist/workflows/builder.js +8 -2
- package/packages/sdk/dist/workflows/builder.js.map +1 -1
- package/packages/sdk/dist/workflows/verification.d.ts.map +1 -1
- package/packages/sdk/dist/workflows/verification.js +6 -3
- package/packages/sdk/dist/workflows/verification.js.map +1 -1
- package/packages/sdk/package.json +4 -2
- package/packages/telemetry/package.json +1 -1
- package/packages/trajectory/package.json +2 -2
- package/packages/user-directory/package.json +2 -2
- package/packages/utils/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -4531,15 +4531,15 @@ var require_route = __commonJS({
|
|
|
4531
4531
|
};
|
|
4532
4532
|
}
|
|
4533
4533
|
function wrapConversion(toModel, graph) {
|
|
4534
|
-
const
|
|
4534
|
+
const path25 = [graph[toModel].parent, toModel];
|
|
4535
4535
|
let fn2 = conversions[graph[toModel].parent][toModel];
|
|
4536
4536
|
let cur = graph[toModel].parent;
|
|
4537
4537
|
while (graph[cur].parent) {
|
|
4538
|
-
|
|
4538
|
+
path25.unshift(graph[cur].parent);
|
|
4539
4539
|
fn2 = link2(conversions[graph[cur].parent][cur], fn2);
|
|
4540
4540
|
cur = graph[cur].parent;
|
|
4541
4541
|
}
|
|
4542
|
-
fn2.conversion =
|
|
4542
|
+
fn2.conversion = path25;
|
|
4543
4543
|
return fn2;
|
|
4544
4544
|
}
|
|
4545
4545
|
module2.exports = function(fromModel) {
|
|
@@ -5505,7 +5505,7 @@ var require_ignore = __commonJS({
|
|
|
5505
5505
|
// path matching.
|
|
5506
5506
|
// - check `string` either `MODE_IGNORE` or `MODE_CHECK_IGNORE`
|
|
5507
5507
|
// @returns {TestResult} true if a file is ignored
|
|
5508
|
-
test(
|
|
5508
|
+
test(path25, checkUnignored, mode) {
|
|
5509
5509
|
let ignored = false;
|
|
5510
5510
|
let unignored = false;
|
|
5511
5511
|
let matchedRule;
|
|
@@ -5514,7 +5514,7 @@ var require_ignore = __commonJS({
|
|
|
5514
5514
|
if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
|
|
5515
5515
|
return;
|
|
5516
5516
|
}
|
|
5517
|
-
const matched = rule[mode].test(
|
|
5517
|
+
const matched = rule[mode].test(path25);
|
|
5518
5518
|
if (!matched) {
|
|
5519
5519
|
return;
|
|
5520
5520
|
}
|
|
@@ -5535,17 +5535,17 @@ var require_ignore = __commonJS({
|
|
|
5535
5535
|
var throwError = (message, Ctor) => {
|
|
5536
5536
|
throw new Ctor(message);
|
|
5537
5537
|
};
|
|
5538
|
-
var checkPath = (
|
|
5539
|
-
if (!isString(
|
|
5538
|
+
var checkPath = (path25, originalPath, doThrow) => {
|
|
5539
|
+
if (!isString(path25)) {
|
|
5540
5540
|
return doThrow(
|
|
5541
5541
|
`path must be a string, but got \`${originalPath}\``,
|
|
5542
5542
|
TypeError
|
|
5543
5543
|
);
|
|
5544
5544
|
}
|
|
5545
|
-
if (!
|
|
5545
|
+
if (!path25) {
|
|
5546
5546
|
return doThrow(`path must not be empty`, TypeError);
|
|
5547
5547
|
}
|
|
5548
|
-
if (checkPath.isNotRelative(
|
|
5548
|
+
if (checkPath.isNotRelative(path25)) {
|
|
5549
5549
|
const r = "`path.relative()`d";
|
|
5550
5550
|
return doThrow(
|
|
5551
5551
|
`path should be a ${r} string, but got "${originalPath}"`,
|
|
@@ -5554,7 +5554,7 @@ var require_ignore = __commonJS({
|
|
|
5554
5554
|
}
|
|
5555
5555
|
return true;
|
|
5556
5556
|
};
|
|
5557
|
-
var isNotRelative = (
|
|
5557
|
+
var isNotRelative = (path25) => REGEX_TEST_INVALID_PATH.test(path25);
|
|
5558
5558
|
checkPath.isNotRelative = isNotRelative;
|
|
5559
5559
|
checkPath.convert = (p2) => p2;
|
|
5560
5560
|
var Ignore = class {
|
|
@@ -5584,19 +5584,19 @@ var require_ignore = __commonJS({
|
|
|
5584
5584
|
}
|
|
5585
5585
|
// @returns {TestResult}
|
|
5586
5586
|
_test(originalPath, cache, checkUnignored, slices) {
|
|
5587
|
-
const
|
|
5587
|
+
const path25 = originalPath && checkPath.convert(originalPath);
|
|
5588
5588
|
checkPath(
|
|
5589
|
-
|
|
5589
|
+
path25,
|
|
5590
5590
|
originalPath,
|
|
5591
5591
|
this._strictPathCheck ? throwError : RETURN_FALSE
|
|
5592
5592
|
);
|
|
5593
|
-
return this._t(
|
|
5593
|
+
return this._t(path25, cache, checkUnignored, slices);
|
|
5594
5594
|
}
|
|
5595
|
-
checkIgnore(
|
|
5596
|
-
if (!REGEX_TEST_TRAILING_SLASH.test(
|
|
5597
|
-
return this.test(
|
|
5595
|
+
checkIgnore(path25) {
|
|
5596
|
+
if (!REGEX_TEST_TRAILING_SLASH.test(path25)) {
|
|
5597
|
+
return this.test(path25);
|
|
5598
5598
|
}
|
|
5599
|
-
const slices =
|
|
5599
|
+
const slices = path25.split(SLASH).filter(Boolean);
|
|
5600
5600
|
slices.pop();
|
|
5601
5601
|
if (slices.length) {
|
|
5602
5602
|
const parent = this._t(
|
|
@@ -5609,18 +5609,18 @@ var require_ignore = __commonJS({
|
|
|
5609
5609
|
return parent;
|
|
5610
5610
|
}
|
|
5611
5611
|
}
|
|
5612
|
-
return this._rules.test(
|
|
5612
|
+
return this._rules.test(path25, false, MODE_CHECK_IGNORE);
|
|
5613
5613
|
}
|
|
5614
|
-
_t(
|
|
5615
|
-
if (
|
|
5616
|
-
return cache[
|
|
5614
|
+
_t(path25, cache, checkUnignored, slices) {
|
|
5615
|
+
if (path25 in cache) {
|
|
5616
|
+
return cache[path25];
|
|
5617
5617
|
}
|
|
5618
5618
|
if (!slices) {
|
|
5619
|
-
slices =
|
|
5619
|
+
slices = path25.split(SLASH).filter(Boolean);
|
|
5620
5620
|
}
|
|
5621
5621
|
slices.pop();
|
|
5622
5622
|
if (!slices.length) {
|
|
5623
|
-
return cache[
|
|
5623
|
+
return cache[path25] = this._rules.test(path25, checkUnignored, MODE_IGNORE);
|
|
5624
5624
|
}
|
|
5625
5625
|
const parent = this._t(
|
|
5626
5626
|
slices.join(SLASH) + SLASH,
|
|
@@ -5628,29 +5628,29 @@ var require_ignore = __commonJS({
|
|
|
5628
5628
|
checkUnignored,
|
|
5629
5629
|
slices
|
|
5630
5630
|
);
|
|
5631
|
-
return cache[
|
|
5631
|
+
return cache[path25] = parent.ignored ? parent : this._rules.test(path25, checkUnignored, MODE_IGNORE);
|
|
5632
5632
|
}
|
|
5633
|
-
ignores(
|
|
5634
|
-
return this._test(
|
|
5633
|
+
ignores(path25) {
|
|
5634
|
+
return this._test(path25, this._ignoreCache, false).ignored;
|
|
5635
5635
|
}
|
|
5636
5636
|
createFilter() {
|
|
5637
|
-
return (
|
|
5637
|
+
return (path25) => !this.ignores(path25);
|
|
5638
5638
|
}
|
|
5639
5639
|
filter(paths) {
|
|
5640
5640
|
return makeArray(paths).filter(this.createFilter());
|
|
5641
5641
|
}
|
|
5642
5642
|
// @returns {TestResult}
|
|
5643
|
-
test(
|
|
5644
|
-
return this._test(
|
|
5643
|
+
test(path25) {
|
|
5644
|
+
return this._test(path25, this._testCache, true);
|
|
5645
5645
|
}
|
|
5646
5646
|
};
|
|
5647
5647
|
var factory = (options) => new Ignore(options);
|
|
5648
|
-
var isPathValid = (
|
|
5648
|
+
var isPathValid = (path25) => checkPath(path25 && checkPath.convert(path25), path25, RETURN_FALSE);
|
|
5649
5649
|
var setupWindows = () => {
|
|
5650
5650
|
const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
|
|
5651
5651
|
checkPath.convert = makePosix;
|
|
5652
5652
|
const REGEX_TEST_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
|
|
5653
|
-
checkPath.isNotRelative = (
|
|
5653
|
+
checkPath.isNotRelative = (path25) => REGEX_TEST_WINDOWS_PATH_ABSOLUTE.test(path25) || isNotRelative(path25);
|
|
5654
5654
|
};
|
|
5655
5655
|
if (
|
|
5656
5656
|
// Detect `process` so that it can run in browsers.
|
|
@@ -5742,17 +5742,17 @@ var require_visit = __commonJS({
|
|
|
5742
5742
|
visit.BREAK = BREAK;
|
|
5743
5743
|
visit.SKIP = SKIP;
|
|
5744
5744
|
visit.REMOVE = REMOVE;
|
|
5745
|
-
function visit_(key, node, visitor,
|
|
5746
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
5745
|
+
function visit_(key, node, visitor, path25) {
|
|
5746
|
+
const ctrl = callVisitor(key, node, visitor, path25);
|
|
5747
5747
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
5748
|
-
replaceNode(key,
|
|
5749
|
-
return visit_(key, ctrl, visitor,
|
|
5748
|
+
replaceNode(key, path25, ctrl);
|
|
5749
|
+
return visit_(key, ctrl, visitor, path25);
|
|
5750
5750
|
}
|
|
5751
5751
|
if (typeof ctrl !== "symbol") {
|
|
5752
5752
|
if (identity.isCollection(node)) {
|
|
5753
|
-
|
|
5753
|
+
path25 = Object.freeze(path25.concat(node));
|
|
5754
5754
|
for (let i = 0; i < node.items.length; ++i) {
|
|
5755
|
-
const ci2 = visit_(i, node.items[i], visitor,
|
|
5755
|
+
const ci2 = visit_(i, node.items[i], visitor, path25);
|
|
5756
5756
|
if (typeof ci2 === "number")
|
|
5757
5757
|
i = ci2 - 1;
|
|
5758
5758
|
else if (ci2 === BREAK)
|
|
@@ -5763,13 +5763,13 @@ var require_visit = __commonJS({
|
|
|
5763
5763
|
}
|
|
5764
5764
|
}
|
|
5765
5765
|
} else if (identity.isPair(node)) {
|
|
5766
|
-
|
|
5767
|
-
const ck = visit_("key", node.key, visitor,
|
|
5766
|
+
path25 = Object.freeze(path25.concat(node));
|
|
5767
|
+
const ck = visit_("key", node.key, visitor, path25);
|
|
5768
5768
|
if (ck === BREAK)
|
|
5769
5769
|
return BREAK;
|
|
5770
5770
|
else if (ck === REMOVE)
|
|
5771
5771
|
node.key = null;
|
|
5772
|
-
const cv = visit_("value", node.value, visitor,
|
|
5772
|
+
const cv = visit_("value", node.value, visitor, path25);
|
|
5773
5773
|
if (cv === BREAK)
|
|
5774
5774
|
return BREAK;
|
|
5775
5775
|
else if (cv === REMOVE)
|
|
@@ -5790,17 +5790,17 @@ var require_visit = __commonJS({
|
|
|
5790
5790
|
visitAsync.BREAK = BREAK;
|
|
5791
5791
|
visitAsync.SKIP = SKIP;
|
|
5792
5792
|
visitAsync.REMOVE = REMOVE;
|
|
5793
|
-
async function visitAsync_(key, node, visitor,
|
|
5794
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
5793
|
+
async function visitAsync_(key, node, visitor, path25) {
|
|
5794
|
+
const ctrl = await callVisitor(key, node, visitor, path25);
|
|
5795
5795
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
5796
|
-
replaceNode(key,
|
|
5797
|
-
return visitAsync_(key, ctrl, visitor,
|
|
5796
|
+
replaceNode(key, path25, ctrl);
|
|
5797
|
+
return visitAsync_(key, ctrl, visitor, path25);
|
|
5798
5798
|
}
|
|
5799
5799
|
if (typeof ctrl !== "symbol") {
|
|
5800
5800
|
if (identity.isCollection(node)) {
|
|
5801
|
-
|
|
5801
|
+
path25 = Object.freeze(path25.concat(node));
|
|
5802
5802
|
for (let i = 0; i < node.items.length; ++i) {
|
|
5803
|
-
const ci2 = await visitAsync_(i, node.items[i], visitor,
|
|
5803
|
+
const ci2 = await visitAsync_(i, node.items[i], visitor, path25);
|
|
5804
5804
|
if (typeof ci2 === "number")
|
|
5805
5805
|
i = ci2 - 1;
|
|
5806
5806
|
else if (ci2 === BREAK)
|
|
@@ -5811,13 +5811,13 @@ var require_visit = __commonJS({
|
|
|
5811
5811
|
}
|
|
5812
5812
|
}
|
|
5813
5813
|
} else if (identity.isPair(node)) {
|
|
5814
|
-
|
|
5815
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
5814
|
+
path25 = Object.freeze(path25.concat(node));
|
|
5815
|
+
const ck = await visitAsync_("key", node.key, visitor, path25);
|
|
5816
5816
|
if (ck === BREAK)
|
|
5817
5817
|
return BREAK;
|
|
5818
5818
|
else if (ck === REMOVE)
|
|
5819
5819
|
node.key = null;
|
|
5820
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
5820
|
+
const cv = await visitAsync_("value", node.value, visitor, path25);
|
|
5821
5821
|
if (cv === BREAK)
|
|
5822
5822
|
return BREAK;
|
|
5823
5823
|
else if (cv === REMOVE)
|
|
@@ -5844,23 +5844,23 @@ var require_visit = __commonJS({
|
|
|
5844
5844
|
}
|
|
5845
5845
|
return visitor;
|
|
5846
5846
|
}
|
|
5847
|
-
function callVisitor(key, node, visitor,
|
|
5847
|
+
function callVisitor(key, node, visitor, path25) {
|
|
5848
5848
|
if (typeof visitor === "function")
|
|
5849
|
-
return visitor(key, node,
|
|
5849
|
+
return visitor(key, node, path25);
|
|
5850
5850
|
if (identity.isMap(node))
|
|
5851
|
-
return visitor.Map?.(key, node,
|
|
5851
|
+
return visitor.Map?.(key, node, path25);
|
|
5852
5852
|
if (identity.isSeq(node))
|
|
5853
|
-
return visitor.Seq?.(key, node,
|
|
5853
|
+
return visitor.Seq?.(key, node, path25);
|
|
5854
5854
|
if (identity.isPair(node))
|
|
5855
|
-
return visitor.Pair?.(key, node,
|
|
5855
|
+
return visitor.Pair?.(key, node, path25);
|
|
5856
5856
|
if (identity.isScalar(node))
|
|
5857
|
-
return visitor.Scalar?.(key, node,
|
|
5857
|
+
return visitor.Scalar?.(key, node, path25);
|
|
5858
5858
|
if (identity.isAlias(node))
|
|
5859
|
-
return visitor.Alias?.(key, node,
|
|
5859
|
+
return visitor.Alias?.(key, node, path25);
|
|
5860
5860
|
return void 0;
|
|
5861
5861
|
}
|
|
5862
|
-
function replaceNode(key,
|
|
5863
|
-
const parent =
|
|
5862
|
+
function replaceNode(key, path25, node) {
|
|
5863
|
+
const parent = path25[path25.length - 1];
|
|
5864
5864
|
if (identity.isCollection(parent)) {
|
|
5865
5865
|
parent.items[key] = node;
|
|
5866
5866
|
} else if (identity.isPair(parent)) {
|
|
@@ -6468,10 +6468,10 @@ var require_Collection = __commonJS({
|
|
|
6468
6468
|
var createNode = require_createNode();
|
|
6469
6469
|
var identity = require_identity();
|
|
6470
6470
|
var Node = require_Node();
|
|
6471
|
-
function collectionFromPath(schema,
|
|
6471
|
+
function collectionFromPath(schema, path25, value) {
|
|
6472
6472
|
let v2 = value;
|
|
6473
|
-
for (let i =
|
|
6474
|
-
const k2 =
|
|
6473
|
+
for (let i = path25.length - 1; i >= 0; --i) {
|
|
6474
|
+
const k2 = path25[i];
|
|
6475
6475
|
if (typeof k2 === "number" && Number.isInteger(k2) && k2 >= 0) {
|
|
6476
6476
|
const a = [];
|
|
6477
6477
|
a[k2] = v2;
|
|
@@ -6490,7 +6490,7 @@ var require_Collection = __commonJS({
|
|
|
6490
6490
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
6491
6491
|
});
|
|
6492
6492
|
}
|
|
6493
|
-
var isEmptyPath = (
|
|
6493
|
+
var isEmptyPath = (path25) => path25 == null || typeof path25 === "object" && !!path25[Symbol.iterator]().next().done;
|
|
6494
6494
|
var Collection = class extends Node.NodeBase {
|
|
6495
6495
|
constructor(type, schema) {
|
|
6496
6496
|
super(type);
|
|
@@ -6520,11 +6520,11 @@ var require_Collection = __commonJS({
|
|
|
6520
6520
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
6521
6521
|
* that already exists in the map.
|
|
6522
6522
|
*/
|
|
6523
|
-
addIn(
|
|
6524
|
-
if (isEmptyPath(
|
|
6523
|
+
addIn(path25, value) {
|
|
6524
|
+
if (isEmptyPath(path25))
|
|
6525
6525
|
this.add(value);
|
|
6526
6526
|
else {
|
|
6527
|
-
const [key, ...rest] =
|
|
6527
|
+
const [key, ...rest] = path25;
|
|
6528
6528
|
const node = this.get(key, true);
|
|
6529
6529
|
if (identity.isCollection(node))
|
|
6530
6530
|
node.addIn(rest, value);
|
|
@@ -6538,8 +6538,8 @@ var require_Collection = __commonJS({
|
|
|
6538
6538
|
* Removes a value from the collection.
|
|
6539
6539
|
* @returns `true` if the item was found and removed.
|
|
6540
6540
|
*/
|
|
6541
|
-
deleteIn(
|
|
6542
|
-
const [key, ...rest] =
|
|
6541
|
+
deleteIn(path25) {
|
|
6542
|
+
const [key, ...rest] = path25;
|
|
6543
6543
|
if (rest.length === 0)
|
|
6544
6544
|
return this.delete(key);
|
|
6545
6545
|
const node = this.get(key, true);
|
|
@@ -6553,8 +6553,8 @@ var require_Collection = __commonJS({
|
|
|
6553
6553
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
6554
6554
|
* `true` (collections are always returned intact).
|
|
6555
6555
|
*/
|
|
6556
|
-
getIn(
|
|
6557
|
-
const [key, ...rest] =
|
|
6556
|
+
getIn(path25, keepScalar) {
|
|
6557
|
+
const [key, ...rest] = path25;
|
|
6558
6558
|
const node = this.get(key, true);
|
|
6559
6559
|
if (rest.length === 0)
|
|
6560
6560
|
return !keepScalar && identity.isScalar(node) ? node.value : node;
|
|
@@ -6572,8 +6572,8 @@ var require_Collection = __commonJS({
|
|
|
6572
6572
|
/**
|
|
6573
6573
|
* Checks if the collection includes a value with the key `key`.
|
|
6574
6574
|
*/
|
|
6575
|
-
hasIn(
|
|
6576
|
-
const [key, ...rest] =
|
|
6575
|
+
hasIn(path25) {
|
|
6576
|
+
const [key, ...rest] = path25;
|
|
6577
6577
|
if (rest.length === 0)
|
|
6578
6578
|
return this.has(key);
|
|
6579
6579
|
const node = this.get(key, true);
|
|
@@ -6583,8 +6583,8 @@ var require_Collection = __commonJS({
|
|
|
6583
6583
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
6584
6584
|
* boolean to add/remove the item from the set.
|
|
6585
6585
|
*/
|
|
6586
|
-
setIn(
|
|
6587
|
-
const [key, ...rest] =
|
|
6586
|
+
setIn(path25, value) {
|
|
6587
|
+
const [key, ...rest] = path25;
|
|
6588
6588
|
if (rest.length === 0) {
|
|
6589
6589
|
this.set(key, value);
|
|
6590
6590
|
} else {
|
|
@@ -9096,9 +9096,9 @@ var require_Document = __commonJS({
|
|
|
9096
9096
|
this.contents.add(value);
|
|
9097
9097
|
}
|
|
9098
9098
|
/** Adds a value to the document. */
|
|
9099
|
-
addIn(
|
|
9099
|
+
addIn(path25, value) {
|
|
9100
9100
|
if (assertCollection(this.contents))
|
|
9101
|
-
this.contents.addIn(
|
|
9101
|
+
this.contents.addIn(path25, value);
|
|
9102
9102
|
}
|
|
9103
9103
|
/**
|
|
9104
9104
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -9173,14 +9173,14 @@ var require_Document = __commonJS({
|
|
|
9173
9173
|
* Removes a value from the document.
|
|
9174
9174
|
* @returns `true` if the item was found and removed.
|
|
9175
9175
|
*/
|
|
9176
|
-
deleteIn(
|
|
9177
|
-
if (Collection.isEmptyPath(
|
|
9176
|
+
deleteIn(path25) {
|
|
9177
|
+
if (Collection.isEmptyPath(path25)) {
|
|
9178
9178
|
if (this.contents == null)
|
|
9179
9179
|
return false;
|
|
9180
9180
|
this.contents = null;
|
|
9181
9181
|
return true;
|
|
9182
9182
|
}
|
|
9183
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
9183
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path25) : false;
|
|
9184
9184
|
}
|
|
9185
9185
|
/**
|
|
9186
9186
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -9195,10 +9195,10 @@ var require_Document = __commonJS({
|
|
|
9195
9195
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
9196
9196
|
* `true` (collections are always returned intact).
|
|
9197
9197
|
*/
|
|
9198
|
-
getIn(
|
|
9199
|
-
if (Collection.isEmptyPath(
|
|
9198
|
+
getIn(path25, keepScalar) {
|
|
9199
|
+
if (Collection.isEmptyPath(path25))
|
|
9200
9200
|
return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
9201
|
-
return identity.isCollection(this.contents) ? this.contents.getIn(
|
|
9201
|
+
return identity.isCollection(this.contents) ? this.contents.getIn(path25, keepScalar) : void 0;
|
|
9202
9202
|
}
|
|
9203
9203
|
/**
|
|
9204
9204
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -9209,10 +9209,10 @@ var require_Document = __commonJS({
|
|
|
9209
9209
|
/**
|
|
9210
9210
|
* Checks if the document includes a value at `path`.
|
|
9211
9211
|
*/
|
|
9212
|
-
hasIn(
|
|
9213
|
-
if (Collection.isEmptyPath(
|
|
9212
|
+
hasIn(path25) {
|
|
9213
|
+
if (Collection.isEmptyPath(path25))
|
|
9214
9214
|
return this.contents !== void 0;
|
|
9215
|
-
return identity.isCollection(this.contents) ? this.contents.hasIn(
|
|
9215
|
+
return identity.isCollection(this.contents) ? this.contents.hasIn(path25) : false;
|
|
9216
9216
|
}
|
|
9217
9217
|
/**
|
|
9218
9218
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -9229,13 +9229,13 @@ var require_Document = __commonJS({
|
|
|
9229
9229
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
9230
9230
|
* boolean to add/remove the item from the set.
|
|
9231
9231
|
*/
|
|
9232
|
-
setIn(
|
|
9233
|
-
if (Collection.isEmptyPath(
|
|
9232
|
+
setIn(path25, value) {
|
|
9233
|
+
if (Collection.isEmptyPath(path25)) {
|
|
9234
9234
|
this.contents = value;
|
|
9235
9235
|
} else if (this.contents == null) {
|
|
9236
|
-
this.contents = Collection.collectionFromPath(this.schema, Array.from(
|
|
9236
|
+
this.contents = Collection.collectionFromPath(this.schema, Array.from(path25), value);
|
|
9237
9237
|
} else if (assertCollection(this.contents)) {
|
|
9238
|
-
this.contents.setIn(
|
|
9238
|
+
this.contents.setIn(path25, value);
|
|
9239
9239
|
}
|
|
9240
9240
|
}
|
|
9241
9241
|
/**
|
|
@@ -11192,9 +11192,9 @@ var require_cst_visit = __commonJS({
|
|
|
11192
11192
|
visit.BREAK = BREAK;
|
|
11193
11193
|
visit.SKIP = SKIP;
|
|
11194
11194
|
visit.REMOVE = REMOVE;
|
|
11195
|
-
visit.itemAtPath = (cst,
|
|
11195
|
+
visit.itemAtPath = (cst, path25) => {
|
|
11196
11196
|
let item = cst;
|
|
11197
|
-
for (const [field, index] of
|
|
11197
|
+
for (const [field, index] of path25) {
|
|
11198
11198
|
const tok = item?.[field];
|
|
11199
11199
|
if (tok && "items" in tok) {
|
|
11200
11200
|
item = tok.items[index];
|
|
@@ -11203,23 +11203,23 @@ var require_cst_visit = __commonJS({
|
|
|
11203
11203
|
}
|
|
11204
11204
|
return item;
|
|
11205
11205
|
};
|
|
11206
|
-
visit.parentCollection = (cst,
|
|
11207
|
-
const parent = visit.itemAtPath(cst,
|
|
11208
|
-
const field =
|
|
11206
|
+
visit.parentCollection = (cst, path25) => {
|
|
11207
|
+
const parent = visit.itemAtPath(cst, path25.slice(0, -1));
|
|
11208
|
+
const field = path25[path25.length - 1][0];
|
|
11209
11209
|
const coll = parent?.[field];
|
|
11210
11210
|
if (coll && "items" in coll)
|
|
11211
11211
|
return coll;
|
|
11212
11212
|
throw new Error("Parent collection not found");
|
|
11213
11213
|
};
|
|
11214
|
-
function _visit(
|
|
11215
|
-
let ctrl = visitor(item,
|
|
11214
|
+
function _visit(path25, item, visitor) {
|
|
11215
|
+
let ctrl = visitor(item, path25);
|
|
11216
11216
|
if (typeof ctrl === "symbol")
|
|
11217
11217
|
return ctrl;
|
|
11218
11218
|
for (const field of ["key", "value"]) {
|
|
11219
11219
|
const token = item[field];
|
|
11220
11220
|
if (token && "items" in token) {
|
|
11221
11221
|
for (let i = 0; i < token.items.length; ++i) {
|
|
11222
|
-
const ci2 = _visit(Object.freeze(
|
|
11222
|
+
const ci2 = _visit(Object.freeze(path25.concat([[field, i]])), token.items[i], visitor);
|
|
11223
11223
|
if (typeof ci2 === "number")
|
|
11224
11224
|
i = ci2 - 1;
|
|
11225
11225
|
else if (ci2 === BREAK)
|
|
@@ -11230,10 +11230,10 @@ var require_cst_visit = __commonJS({
|
|
|
11230
11230
|
}
|
|
11231
11231
|
}
|
|
11232
11232
|
if (typeof ctrl === "function" && field === "key")
|
|
11233
|
-
ctrl = ctrl(item,
|
|
11233
|
+
ctrl = ctrl(item, path25);
|
|
11234
11234
|
}
|
|
11235
11235
|
}
|
|
11236
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
11236
|
+
return typeof ctrl === "function" ? ctrl(item, path25) : ctrl;
|
|
11237
11237
|
}
|
|
11238
11238
|
exports2.visit = visit;
|
|
11239
11239
|
}
|
|
@@ -19260,8 +19260,8 @@ var init_supermemory = __esm({
|
|
|
19260
19260
|
/**
|
|
19261
19261
|
* Make a fetch request to the Supermemory API
|
|
19262
19262
|
*/
|
|
19263
|
-
async fetch(
|
|
19264
|
-
const url2 = `${this.endpoint}${
|
|
19263
|
+
async fetch(path25, options) {
|
|
19264
|
+
const url2 = `${this.endpoint}${path25}`;
|
|
19265
19265
|
const controller = new AbortController();
|
|
19266
19266
|
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
19267
19267
|
try {
|
|
@@ -20388,7 +20388,7 @@ var BrokerTransport = class {
|
|
|
20388
20388
|
return this.baseUrl.replace(/^http/, "ws") + "/ws";
|
|
20389
20389
|
}
|
|
20390
20390
|
// ── HTTP ─────────────────────────────────────────────────────────────
|
|
20391
|
-
async request(
|
|
20391
|
+
async request(path25, init) {
|
|
20392
20392
|
const headers = new Headers(init?.headers);
|
|
20393
20393
|
if (!headers.has("Content-Type")) {
|
|
20394
20394
|
headers.set("Content-Type", "application/json");
|
|
@@ -20397,7 +20397,7 @@ var BrokerTransport = class {
|
|
|
20397
20397
|
headers.set("X-API-Key", this.apiKey);
|
|
20398
20398
|
}
|
|
20399
20399
|
const signal = init?.signal ?? AbortSignal.timeout(this.requestTimeoutMs);
|
|
20400
|
-
const res = await fetch(`${this.baseUrl}${
|
|
20400
|
+
const res = await fetch(`${this.baseUrl}${path25}`, { ...init, headers, signal });
|
|
20401
20401
|
if (!res.ok) {
|
|
20402
20402
|
let body;
|
|
20403
20403
|
try {
|
|
@@ -21650,8 +21650,8 @@ function getErrorMap() {
|
|
|
21650
21650
|
|
|
21651
21651
|
// node_modules/zod/v3/helpers/parseUtil.js
|
|
21652
21652
|
var makeIssue = (params) => {
|
|
21653
|
-
const { data, path:
|
|
21654
|
-
const fullPath = [...
|
|
21653
|
+
const { data, path: path25, errorMaps, issueData } = params;
|
|
21654
|
+
const fullPath = [...path25, ...issueData.path || []];
|
|
21655
21655
|
const fullIssue = {
|
|
21656
21656
|
...issueData,
|
|
21657
21657
|
path: fullPath
|
|
@@ -21767,11 +21767,11 @@ var errorUtil;
|
|
|
21767
21767
|
|
|
21768
21768
|
// node_modules/zod/v3/types.js
|
|
21769
21769
|
var ParseInputLazyPath = class {
|
|
21770
|
-
constructor(parent, value,
|
|
21770
|
+
constructor(parent, value, path25, key) {
|
|
21771
21771
|
this._cachedPath = [];
|
|
21772
21772
|
this.parent = parent;
|
|
21773
21773
|
this.data = value;
|
|
21774
|
-
this._path =
|
|
21774
|
+
this._path = path25;
|
|
21775
21775
|
this._key = key;
|
|
21776
21776
|
}
|
|
21777
21777
|
get path() {
|
|
@@ -28082,10 +28082,10 @@ function mergeDefs(...defs) {
|
|
|
28082
28082
|
function cloneDef(schema) {
|
|
28083
28083
|
return mergeDefs(schema._zod.def);
|
|
28084
28084
|
}
|
|
28085
|
-
function getElementAtPath(obj,
|
|
28086
|
-
if (!
|
|
28085
|
+
function getElementAtPath(obj, path25) {
|
|
28086
|
+
if (!path25)
|
|
28087
28087
|
return obj;
|
|
28088
|
-
return
|
|
28088
|
+
return path25.reduce((acc, key) => acc?.[key], obj);
|
|
28089
28089
|
}
|
|
28090
28090
|
function promiseAllObject(promisesObj) {
|
|
28091
28091
|
const keys = Object.keys(promisesObj);
|
|
@@ -28468,11 +28468,11 @@ function aborted(x, startIndex = 0) {
|
|
|
28468
28468
|
}
|
|
28469
28469
|
return false;
|
|
28470
28470
|
}
|
|
28471
|
-
function prefixIssues(
|
|
28471
|
+
function prefixIssues(path25, issues) {
|
|
28472
28472
|
return issues.map((iss) => {
|
|
28473
28473
|
var _a2;
|
|
28474
28474
|
(_a2 = iss).path ?? (_a2.path = []);
|
|
28475
|
-
iss.path.unshift(
|
|
28475
|
+
iss.path.unshift(path25);
|
|
28476
28476
|
return iss;
|
|
28477
28477
|
});
|
|
28478
28478
|
}
|
|
@@ -28655,7 +28655,7 @@ function formatError(error48, mapper = (issue2) => issue2.message) {
|
|
|
28655
28655
|
}
|
|
28656
28656
|
function treeifyError(error48, mapper = (issue2) => issue2.message) {
|
|
28657
28657
|
const result = { errors: [] };
|
|
28658
|
-
const processError = (error49,
|
|
28658
|
+
const processError = (error49, path25 = []) => {
|
|
28659
28659
|
var _a2, _b;
|
|
28660
28660
|
for (const issue2 of error49.issues) {
|
|
28661
28661
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
@@ -28665,7 +28665,7 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
|
|
|
28665
28665
|
} else if (issue2.code === "invalid_element") {
|
|
28666
28666
|
processError({ issues: issue2.issues }, issue2.path);
|
|
28667
28667
|
} else {
|
|
28668
|
-
const fullpath = [...
|
|
28668
|
+
const fullpath = [...path25, ...issue2.path];
|
|
28669
28669
|
if (fullpath.length === 0) {
|
|
28670
28670
|
result.errors.push(mapper(issue2));
|
|
28671
28671
|
continue;
|
|
@@ -28697,8 +28697,8 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
|
|
|
28697
28697
|
}
|
|
28698
28698
|
function toDotPath(_path) {
|
|
28699
28699
|
const segs = [];
|
|
28700
|
-
const
|
|
28701
|
-
for (const seg of
|
|
28700
|
+
const path25 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
28701
|
+
for (const seg of path25) {
|
|
28702
28702
|
if (typeof seg === "number")
|
|
28703
28703
|
segs.push(`[${seg}]`);
|
|
28704
28704
|
else if (typeof seg === "symbol")
|
|
@@ -40675,13 +40675,13 @@ function resolveRef(ref, ctx) {
|
|
|
40675
40675
|
if (!ref.startsWith("#")) {
|
|
40676
40676
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
40677
40677
|
}
|
|
40678
|
-
const
|
|
40679
|
-
if (
|
|
40678
|
+
const path25 = ref.slice(1).split("/").filter(Boolean);
|
|
40679
|
+
if (path25.length === 0) {
|
|
40680
40680
|
return ctx.rootSchema;
|
|
40681
40681
|
}
|
|
40682
40682
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
40683
|
-
if (
|
|
40684
|
-
const key =
|
|
40683
|
+
if (path25[0] === defsKey) {
|
|
40684
|
+
const key = path25[1];
|
|
40685
40685
|
if (!key || !ctx.defs[key]) {
|
|
40686
40686
|
throw new Error(`Reference not found: ${ref}`);
|
|
40687
40687
|
}
|
|
@@ -42831,8 +42831,8 @@ var HttpClient = class _HttpClient {
|
|
|
42831
42831
|
version: this._originVersion
|
|
42832
42832
|
}));
|
|
42833
42833
|
}
|
|
42834
|
-
async request(method,
|
|
42835
|
-
const url2 = new URL(
|
|
42834
|
+
async request(method, path25, body, query, options) {
|
|
42835
|
+
const url2 = new URL(path25, this._baseUrl);
|
|
42836
42836
|
if (query) {
|
|
42837
42837
|
for (const [k2, v2] of Object.entries(query)) {
|
|
42838
42838
|
if (v2 !== void 0)
|
|
@@ -42902,20 +42902,20 @@ var HttpClient = class _HttpClient {
|
|
|
42902
42902
|
return camelizeKeys(parsedData);
|
|
42903
42903
|
}
|
|
42904
42904
|
}
|
|
42905
|
-
get(
|
|
42906
|
-
return this.request("GET",
|
|
42905
|
+
get(path25, query, options) {
|
|
42906
|
+
return this.request("GET", path25, void 0, query, options);
|
|
42907
42907
|
}
|
|
42908
|
-
post(
|
|
42909
|
-
return this.request("POST",
|
|
42908
|
+
post(path25, body, options) {
|
|
42909
|
+
return this.request("POST", path25, body, void 0, options);
|
|
42910
42910
|
}
|
|
42911
|
-
patch(
|
|
42912
|
-
return this.request("PATCH",
|
|
42911
|
+
patch(path25, body, options) {
|
|
42912
|
+
return this.request("PATCH", path25, body, void 0, options);
|
|
42913
42913
|
}
|
|
42914
|
-
put(
|
|
42915
|
-
return this.request("PUT",
|
|
42914
|
+
put(path25, body, options) {
|
|
42915
|
+
return this.request("PUT", path25, body, void 0, options);
|
|
42916
42916
|
}
|
|
42917
|
-
async delete(
|
|
42918
|
-
await this.request("DELETE",
|
|
42917
|
+
async delete(path25, options) {
|
|
42918
|
+
await this.request("DELETE", path25, void 0, void 0, options);
|
|
42919
42919
|
}
|
|
42920
42920
|
};
|
|
42921
42921
|
|
|
@@ -45780,9 +45780,9 @@ async function resolveCli(cli) {
|
|
|
45780
45780
|
for (const binary of def.binaries) {
|
|
45781
45781
|
try {
|
|
45782
45782
|
const { stdout } = await execFileAsync("which", [binary]);
|
|
45783
|
-
const
|
|
45784
|
-
if (
|
|
45785
|
-
const result = { binary, path:
|
|
45783
|
+
const path25 = stdout.trim();
|
|
45784
|
+
if (path25) {
|
|
45785
|
+
const result = { binary, path: path25 };
|
|
45786
45786
|
resolveCache.set(cli, result);
|
|
45787
45787
|
return result;
|
|
45788
45788
|
}
|
|
@@ -45819,9 +45819,9 @@ function resolveCliSync(cli) {
|
|
|
45819
45819
|
for (const binary of def.binaries) {
|
|
45820
45820
|
try {
|
|
45821
45821
|
const stdout = execFileSync2("which", [binary], { stdio: ["pipe", "pipe", "ignore"] });
|
|
45822
|
-
const
|
|
45823
|
-
if (
|
|
45824
|
-
const result = { binary, path:
|
|
45822
|
+
const path25 = stdout.toString().trim();
|
|
45823
|
+
if (path25) {
|
|
45824
|
+
const result = { binary, path: path25 };
|
|
45825
45825
|
resolveCache.set(cli, result);
|
|
45826
45826
|
return result;
|
|
45827
45827
|
}
|
|
@@ -47035,8 +47035,8 @@ var RelayFileClient = class {
|
|
|
47035
47035
|
signal: options.signal
|
|
47036
47036
|
});
|
|
47037
47037
|
}
|
|
47038
|
-
async readFile(workspaceId,
|
|
47039
|
-
const query = buildQuery({ path:
|
|
47038
|
+
async readFile(workspaceId, path25, correlationId, signal) {
|
|
47039
|
+
const query = buildQuery({ path: path25 });
|
|
47040
47040
|
return this.request({
|
|
47041
47041
|
method: "GET",
|
|
47042
47042
|
path: `/v1/workspaces/${encodeURIComponent(workspaceId)}/fs/file${query}`,
|
|
@@ -47077,8 +47077,8 @@ var RelayFileClient = class {
|
|
|
47077
47077
|
});
|
|
47078
47078
|
}
|
|
47079
47079
|
async writeFile(input) {
|
|
47080
|
-
const { workspaceId, path:
|
|
47081
|
-
const query = buildQuery({ path:
|
|
47080
|
+
const { workspaceId, path: path25, correlationId, baseRevision, content, contentType, encoding, semantics, signal } = input;
|
|
47081
|
+
const query = buildQuery({ path: path25 });
|
|
47082
47082
|
return this.request({
|
|
47083
47083
|
method: "PUT",
|
|
47084
47084
|
path: `/v1/workspaces/${encodeURIComponent(workspaceId)}/fs/file${query}`,
|
|
@@ -52266,8 +52266,8 @@ function checkOutputContains(output, token, injectedTaskText) {
|
|
|
52266
52266
|
}
|
|
52267
52267
|
function checkFileExists(filePath, cwd = process.cwd()) {
|
|
52268
52268
|
const normalizedCwd = import_node_path26.default.resolve(cwd);
|
|
52269
|
-
const resolved = import_node_path26.default.resolve(normalizedCwd, filePath);
|
|
52270
|
-
if (!resolved.startsWith(normalizedCwd + import_node_path26.default.sep) && resolved !== normalizedCwd) {
|
|
52269
|
+
const resolved = import_node_path26.default.isAbsolute(filePath) ? import_node_path26.default.resolve(filePath) : import_node_path26.default.resolve(normalizedCwd, filePath);
|
|
52270
|
+
if (!import_node_path26.default.isAbsolute(filePath) && !resolved.startsWith(normalizedCwd + import_node_path26.default.sep) && resolved !== normalizedCwd) {
|
|
52271
52271
|
return false;
|
|
52272
52272
|
}
|
|
52273
52273
|
return (0, import_node_fs19.existsSync)(resolved);
|
|
@@ -58908,6 +58908,7 @@ async function runWorkflow(yamlPath, options = {}) {
|
|
|
58908
58908
|
}
|
|
58909
58909
|
|
|
58910
58910
|
// packages/sdk/dist/workflows/builder.js
|
|
58911
|
+
var import_node_path30 = __toESM(require("node:path"), 1);
|
|
58911
58912
|
var import_yaml3 = __toESM(require_dist(), 1);
|
|
58912
58913
|
|
|
58913
58914
|
// packages/sdk/dist/workflows/cloud-runner.js
|
|
@@ -59193,11 +59194,15 @@ var WorkflowBuilder = class {
|
|
|
59193
59194
|
}
|
|
59194
59195
|
async run(options = {}) {
|
|
59195
59196
|
const config2 = this.toConfig();
|
|
59197
|
+
const runnerCwd = options.cwd ?? process.cwd();
|
|
59198
|
+
const dbPath = import_node_path30.default.join(runnerCwd, ".agent-relay", "workflow-runs.jsonl");
|
|
59199
|
+
const db = new JsonFileWorkflowDb(dbPath);
|
|
59196
59200
|
const runner = new WorkflowRunner({
|
|
59197
59201
|
cwd: options.cwd,
|
|
59198
59202
|
relay: options.relay,
|
|
59199
59203
|
executor: options.executor,
|
|
59200
|
-
envSecrets: options.envSecrets
|
|
59204
|
+
envSecrets: options.envSecrets,
|
|
59205
|
+
db
|
|
59201
59206
|
});
|
|
59202
59207
|
const isDryRun = options.dryRun ?? !!process.env.DRY_RUN;
|
|
59203
59208
|
if (isDryRun) {
|
|
@@ -59236,7 +59241,7 @@ var WorkflowBuilder = class {
|
|
|
59236
59241
|
const { createWorkflowRenderer: createWorkflowRenderer2 } = await Promise.resolve().then(() => (init_listr_renderer(), listr_renderer_exports));
|
|
59237
59242
|
const renderer = createWorkflowRenderer2();
|
|
59238
59243
|
runner.on(renderer.onEvent);
|
|
59239
|
-
const runPromise = resumeRunId ? runner.resume(resumeRunId, options.vars) : runner.execute(config2, options.workflow, options.vars, executeOptions);
|
|
59244
|
+
const runPromise = resumeRunId ? runner.resume(resumeRunId, options.vars, config2) : runner.execute(config2, options.workflow, options.vars, executeOptions);
|
|
59240
59245
|
try {
|
|
59241
59246
|
const [result] = await Promise.all([runPromise, renderer.start()]);
|
|
59242
59247
|
return result;
|
|
@@ -59245,7 +59250,7 @@ var WorkflowBuilder = class {
|
|
|
59245
59250
|
}
|
|
59246
59251
|
}
|
|
59247
59252
|
if (resumeRunId) {
|
|
59248
|
-
return runner.resume(resumeRunId, options.vars);
|
|
59253
|
+
return runner.resume(resumeRunId, options.vars, config2);
|
|
59249
59254
|
}
|
|
59250
59255
|
return runner.execute(config2, options.workflow, options.vars, executeOptions);
|
|
59251
59256
|
}
|
|
@@ -60108,7 +60113,7 @@ var StateStore = class extends import_node_events5.EventEmitter {
|
|
|
60108
60113
|
|
|
60109
60114
|
// packages/sdk/dist/workflows/templates.js
|
|
60110
60115
|
var import_node_fs23 = require("node:fs");
|
|
60111
|
-
var
|
|
60116
|
+
var import_node_path31 = __toESM(require("node:path"), 1);
|
|
60112
60117
|
var import_node_url2 = require("node:url");
|
|
60113
60118
|
var import_yaml4 = __toESM(require_dist(), 1);
|
|
60114
60119
|
var YAML_EXTENSIONS = [".yaml", ".yml"];
|
|
@@ -60133,7 +60138,7 @@ var TemplateRegistry = class {
|
|
|
60133
60138
|
fetcher;
|
|
60134
60139
|
constructor(options = {}) {
|
|
60135
60140
|
this.builtInTemplatesDir = this.resolveBuiltInTemplatesDir(options.builtInTemplatesDir);
|
|
60136
|
-
this.customTemplatesDir = options.customTemplatesDir ?
|
|
60141
|
+
this.customTemplatesDir = options.customTemplatesDir ? import_node_path31.default.resolve(options.customTemplatesDir) : import_node_path31.default.resolve(options.workspaceDir ?? process.cwd(), ".relay/workflows");
|
|
60137
60142
|
this.fetcher = options.fetcher ?? fetch;
|
|
60138
60143
|
}
|
|
60139
60144
|
listBuiltInTemplates() {
|
|
@@ -60207,12 +60212,12 @@ var TemplateRegistry = class {
|
|
|
60207
60212
|
if (!templateName) {
|
|
60208
60213
|
throw new Error('Template name is required. Provide name explicitly or include a string "name" field.');
|
|
60209
60214
|
}
|
|
60210
|
-
if (templateName.includes("/") || templateName.includes("\\") || templateName.includes("..") ||
|
|
60215
|
+
if (templateName.includes("/") || templateName.includes("\\") || templateName.includes("..") || import_node_path31.default.isAbsolute(templateName)) {
|
|
60211
60216
|
throw new Error(`Invalid template name: "${templateName}" contains path separators or traversal sequences`);
|
|
60212
60217
|
}
|
|
60213
60218
|
this.validateRelayConfig(parsed, url2);
|
|
60214
60219
|
await import_node_fs23.promises.mkdir(this.customTemplatesDir, { recursive: true });
|
|
60215
|
-
const targetPath =
|
|
60220
|
+
const targetPath = import_node_path31.default.join(this.customTemplatesDir, `${templateName}.yaml`);
|
|
60216
60221
|
await import_node_fs23.promises.writeFile(targetPath, (0, import_yaml4.stringify)(parsed), "utf-8");
|
|
60217
60222
|
return targetPath;
|
|
60218
60223
|
}
|
|
@@ -60234,12 +60239,12 @@ var TemplateRegistry = class {
|
|
|
60234
60239
|
}
|
|
60235
60240
|
resolveBuiltInTemplatesDir(explicitDir) {
|
|
60236
60241
|
if (explicitDir) {
|
|
60237
|
-
return
|
|
60242
|
+
return import_node_path31.default.resolve(explicitDir);
|
|
60238
60243
|
}
|
|
60239
|
-
const currentDir =
|
|
60244
|
+
const currentDir = import_node_path31.default.dirname((0, import_node_url2.fileURLToPath)(import_meta_url));
|
|
60240
60245
|
const candidates = [
|
|
60241
|
-
|
|
60242
|
-
|
|
60246
|
+
import_node_path31.default.resolve(currentDir, "builtin-templates"),
|
|
60247
|
+
import_node_path31.default.resolve(currentDir, "../workflows/builtin-templates")
|
|
60243
60248
|
];
|
|
60244
60249
|
for (const candidate of candidates) {
|
|
60245
60250
|
if ((0, import_node_fs23.existsSync)(candidate)) {
|
|
@@ -60262,7 +60267,7 @@ var TemplateRegistry = class {
|
|
|
60262
60267
|
}
|
|
60263
60268
|
async findTemplatePath(directory, templateName) {
|
|
60264
60269
|
for (const ext of YAML_EXTENSIONS) {
|
|
60265
|
-
const candidate =
|
|
60270
|
+
const candidate = import_node_path31.default.join(directory, `${templateName}${ext}`);
|
|
60266
60271
|
try {
|
|
60267
60272
|
const stat2 = await import_node_fs23.promises.stat(candidate);
|
|
60268
60273
|
if (stat2.isFile()) {
|
|
@@ -60635,7 +60640,7 @@ function isValidAgentName(name) {
|
|
|
60635
60640
|
|
|
60636
60641
|
// packages/utils/dist/logger.js
|
|
60637
60642
|
var import_node_fs24 = __toESM(require("node:fs"), 1);
|
|
60638
|
-
var
|
|
60643
|
+
var import_node_path32 = __toESM(require("node:path"), 1);
|
|
60639
60644
|
function getLogFile() {
|
|
60640
60645
|
return process.env.AGENT_RELAY_LOG_FILE;
|
|
60641
60646
|
}
|
|
@@ -60653,7 +60658,7 @@ var LEVEL_PRIORITY = {
|
|
|
60653
60658
|
};
|
|
60654
60659
|
var createdLogDirs = /* @__PURE__ */ new Set();
|
|
60655
60660
|
function ensureLogDir(logFile) {
|
|
60656
|
-
const logDir =
|
|
60661
|
+
const logDir = import_node_path32.default.dirname(logFile);
|
|
60657
60662
|
if (!createdLogDirs.has(logDir) && !import_node_fs24.default.existsSync(logDir)) {
|
|
60658
60663
|
import_node_fs24.default.mkdirSync(logDir, { recursive: true });
|
|
60659
60664
|
createdLogDirs.add(logDir);
|
|
@@ -61007,7 +61012,7 @@ function commandExists(command) {
|
|
|
61007
61012
|
|
|
61008
61013
|
// packages/utils/dist/git-remote.js
|
|
61009
61014
|
var fs8 = __toESM(require("node:fs"), 1);
|
|
61010
|
-
var
|
|
61015
|
+
var path21 = __toESM(require("node:path"), 1);
|
|
61011
61016
|
var import_node_child_process9 = require("node:child_process");
|
|
61012
61017
|
function parseGitRemoteUrl(url2) {
|
|
61013
61018
|
if (!url2)
|
|
@@ -61024,7 +61029,7 @@ function parseGitRemoteUrl(url2) {
|
|
|
61024
61029
|
}
|
|
61025
61030
|
function getGitRemoteUrl(workingDirectory, remoteName = "origin") {
|
|
61026
61031
|
try {
|
|
61027
|
-
const gitDir =
|
|
61032
|
+
const gitDir = path21.join(workingDirectory, ".git");
|
|
61028
61033
|
if (!fs8.existsSync(gitDir)) {
|
|
61029
61034
|
return null;
|
|
61030
61035
|
}
|
|
@@ -61037,7 +61042,7 @@ function getGitRemoteUrl(workingDirectory, remoteName = "origin") {
|
|
|
61037
61042
|
return result.trim() || null;
|
|
61038
61043
|
} catch {
|
|
61039
61044
|
try {
|
|
61040
|
-
const configPath =
|
|
61045
|
+
const configPath = path21.join(workingDirectory, ".git", "config");
|
|
61041
61046
|
if (!fs8.existsSync(configPath)) {
|
|
61042
61047
|
return null;
|
|
61043
61048
|
}
|
|
@@ -61058,13 +61063,13 @@ function getRepoFullName(workingDirectory) {
|
|
|
61058
61063
|
return parseGitRemoteUrl(remoteUrl);
|
|
61059
61064
|
}
|
|
61060
61065
|
function findGitRoot(startPath) {
|
|
61061
|
-
let currentPath =
|
|
61062
|
-
const root =
|
|
61066
|
+
let currentPath = path21.resolve(startPath);
|
|
61067
|
+
const root = path21.parse(currentPath).root;
|
|
61063
61068
|
while (currentPath !== root) {
|
|
61064
|
-
if (fs8.existsSync(
|
|
61069
|
+
if (fs8.existsSync(path21.join(currentPath, ".git"))) {
|
|
61065
61070
|
return currentPath;
|
|
61066
61071
|
}
|
|
61067
|
-
currentPath =
|
|
61072
|
+
currentPath = path21.dirname(currentPath);
|
|
61068
61073
|
}
|
|
61069
61074
|
return null;
|
|
61070
61075
|
}
|
|
@@ -61082,7 +61087,7 @@ function getRepoFullNameFromPath(workingDirectory) {
|
|
|
61082
61087
|
|
|
61083
61088
|
// packages/utils/dist/update-checker.js
|
|
61084
61089
|
var import_node_fs26 = __toESM(require("node:fs"), 1);
|
|
61085
|
-
var
|
|
61090
|
+
var import_node_path33 = __toESM(require("node:path"), 1);
|
|
61086
61091
|
var import_node_https2 = __toESM(require("node:https"), 1);
|
|
61087
61092
|
var import_node_os10 = __toESM(require("node:os"), 1);
|
|
61088
61093
|
var import_compare_versions = __toESM(require_umd(), 1);
|
|
@@ -61090,8 +61095,8 @@ var PACKAGE_NAME = "agent-relay";
|
|
|
61090
61095
|
var CHECK_INTERVAL_MS = 60 * 60 * 1e3;
|
|
61091
61096
|
var NPM_REGISTRY_URL = `https://registry.npmjs.org/${PACKAGE_NAME}/latest`;
|
|
61092
61097
|
function getCachePath() {
|
|
61093
|
-
const cacheDir =
|
|
61094
|
-
return
|
|
61098
|
+
const cacheDir = import_node_path33.default.join(import_node_os10.default.homedir(), ".agent-relay");
|
|
61099
|
+
return import_node_path33.default.join(cacheDir, "update-cache.json");
|
|
61095
61100
|
}
|
|
61096
61101
|
function readCache() {
|
|
61097
61102
|
try {
|
|
@@ -61107,7 +61112,7 @@ function readCache() {
|
|
|
61107
61112
|
function writeCache(cache) {
|
|
61108
61113
|
try {
|
|
61109
61114
|
const cachePath = getCachePath();
|
|
61110
|
-
const cacheDir =
|
|
61115
|
+
const cacheDir = import_node_path33.default.dirname(cachePath);
|
|
61111
61116
|
if (!import_node_fs26.default.existsSync(cacheDir)) {
|
|
61112
61117
|
import_node_fs26.default.mkdirSync(cacheDir, { recursive: true });
|
|
61113
61118
|
}
|
|
@@ -61392,7 +61397,7 @@ function validateModelForCli(cli, model) {
|
|
|
61392
61397
|
// packages/utils/dist/relay-pty-path.js
|
|
61393
61398
|
var import_node_fs27 = __toESM(require("node:fs"), 1);
|
|
61394
61399
|
var import_node_os11 = __toESM(require("node:os"), 1);
|
|
61395
|
-
var
|
|
61400
|
+
var import_node_path34 = __toESM(require("node:path"), 1);
|
|
61396
61401
|
var SUPPORTED_PLATFORMS = {
|
|
61397
61402
|
darwin: {
|
|
61398
61403
|
arm64: "relay-pty-darwin-arm64",
|
|
@@ -61440,22 +61445,22 @@ function findRelayPtyBinary(callerDirname) {
|
|
|
61440
61445
|
const scopedMatch = normalizedCaller.match(/^(.+?\/node_modules)\/@agent-relay\//);
|
|
61441
61446
|
const directMatch = normalizedCaller.match(/^(.+?\/node_modules\/agent-relay)/);
|
|
61442
61447
|
if (scopedMatch) {
|
|
61443
|
-
packageRoots.push(
|
|
61448
|
+
packageRoots.push(import_node_path34.default.join(scopedMatch[1], "agent-relay"));
|
|
61444
61449
|
}
|
|
61445
61450
|
if (directMatch) {
|
|
61446
61451
|
packageRoots.push(directMatch[1]);
|
|
61447
61452
|
}
|
|
61448
61453
|
if (!normalizedCaller.includes("node_modules")) {
|
|
61449
|
-
packageRoots.push(
|
|
61454
|
+
packageRoots.push(import_node_path34.default.join(callerDirname, "..", "..", ".."));
|
|
61450
61455
|
}
|
|
61451
61456
|
const home = process.env.HOME || process.env.USERPROFILE || "";
|
|
61452
61457
|
if (home) {
|
|
61453
|
-
const npxCacheBase =
|
|
61458
|
+
const npxCacheBase = import_node_path34.default.join(home, ".npm", "_npx");
|
|
61454
61459
|
if (import_node_fs27.default.existsSync(npxCacheBase)) {
|
|
61455
61460
|
try {
|
|
61456
61461
|
const entries = import_node_fs27.default.readdirSync(npxCacheBase);
|
|
61457
61462
|
for (const entry of entries) {
|
|
61458
|
-
const npxPackage =
|
|
61463
|
+
const npxPackage = import_node_path34.default.join(npxCacheBase, entry, "node_modules", "agent-relay");
|
|
61459
61464
|
if (import_node_fs27.default.existsSync(npxPackage)) {
|
|
61460
61465
|
packageRoots.push(npxPackage);
|
|
61461
61466
|
}
|
|
@@ -61464,42 +61469,42 @@ function findRelayPtyBinary(callerDirname) {
|
|
|
61464
61469
|
}
|
|
61465
61470
|
}
|
|
61466
61471
|
}
|
|
61467
|
-
packageRoots.push(
|
|
61472
|
+
packageRoots.push(import_node_path34.default.join(process.cwd(), "node_modules", "agent-relay"));
|
|
61468
61473
|
if (home) {
|
|
61469
|
-
packageRoots.push(
|
|
61470
|
-
packageRoots.push(
|
|
61471
|
-
packageRoots.push(
|
|
61472
|
-
packageRoots.push(
|
|
61473
|
-
packageRoots.push(
|
|
61474
|
-
packageRoots.push(
|
|
61475
|
-
packageRoots.push(
|
|
61476
|
-
packageRoots.push(
|
|
61477
|
-
}
|
|
61478
|
-
const bashInstallerDir = process.env.AGENT_RELAY_INSTALL_DIR ?
|
|
61479
|
-
const bashInstallerBinDir = process.env.AGENT_RELAY_BIN_DIR || (home ?
|
|
61480
|
-
const nodePrefix =
|
|
61481
|
-
packageRoots.push(
|
|
61474
|
+
packageRoots.push(import_node_path34.default.join(home, ".nvm", "versions", "node", process.version, "lib", "node_modules", "agent-relay"));
|
|
61475
|
+
packageRoots.push(import_node_path34.default.join(home, ".volta", "tools", "image", "packages", "agent-relay", "lib", "node_modules", "agent-relay"));
|
|
61476
|
+
packageRoots.push(import_node_path34.default.join(home, ".fnm", "node-versions", process.version, "installation", "lib", "node_modules", "agent-relay"));
|
|
61477
|
+
packageRoots.push(import_node_path34.default.join(home, "n", "lib", "node_modules", "agent-relay"));
|
|
61478
|
+
packageRoots.push(import_node_path34.default.join(home, ".asdf", "installs", "nodejs", process.version.replace("v", ""), "lib", "node_modules", "agent-relay"));
|
|
61479
|
+
packageRoots.push(import_node_path34.default.join(home, ".local", "share", "pnpm", "global", "node_modules", "agent-relay"));
|
|
61480
|
+
packageRoots.push(import_node_path34.default.join(home, ".config", "yarn", "global", "node_modules", "agent-relay"));
|
|
61481
|
+
packageRoots.push(import_node_path34.default.join(home, ".yarn", "global", "node_modules", "agent-relay"));
|
|
61482
|
+
}
|
|
61483
|
+
const bashInstallerDir = process.env.AGENT_RELAY_INSTALL_DIR ? import_node_path34.default.join(process.env.AGENT_RELAY_INSTALL_DIR, "bin") : home ? import_node_path34.default.join(home, ".agent-relay", "bin") : null;
|
|
61484
|
+
const bashInstallerBinDir = process.env.AGENT_RELAY_BIN_DIR || (home ? import_node_path34.default.join(home, ".local", "bin") : null);
|
|
61485
|
+
const nodePrefix = import_node_path34.default.resolve(import_node_path34.default.dirname(process.execPath), "..");
|
|
61486
|
+
packageRoots.push(import_node_path34.default.join(nodePrefix, "lib", "node_modules", "agent-relay"));
|
|
61482
61487
|
packageRoots.push("/usr/local/lib/node_modules/agent-relay");
|
|
61483
61488
|
packageRoots.push("/opt/homebrew/lib/node_modules/agent-relay");
|
|
61484
61489
|
packageRoots.push("/usr/lib/node_modules/agent-relay");
|
|
61485
61490
|
const candidates = [];
|
|
61486
61491
|
for (const root of packageRoots) {
|
|
61487
61492
|
if (platformBinary) {
|
|
61488
|
-
candidates.push(
|
|
61493
|
+
candidates.push(import_node_path34.default.join(root, "bin", platformBinary));
|
|
61489
61494
|
}
|
|
61490
|
-
candidates.push(
|
|
61495
|
+
candidates.push(import_node_path34.default.join(root, "bin", "relay-pty"));
|
|
61491
61496
|
}
|
|
61492
61497
|
if (bashInstallerDir) {
|
|
61493
61498
|
if (platformBinary) {
|
|
61494
|
-
candidates.push(
|
|
61499
|
+
candidates.push(import_node_path34.default.join(bashInstallerDir, platformBinary));
|
|
61495
61500
|
}
|
|
61496
|
-
candidates.push(
|
|
61501
|
+
candidates.push(import_node_path34.default.join(bashInstallerDir, "relay-pty"));
|
|
61497
61502
|
}
|
|
61498
61503
|
if (bashInstallerBinDir) {
|
|
61499
61504
|
if (platformBinary) {
|
|
61500
|
-
candidates.push(
|
|
61505
|
+
candidates.push(import_node_path34.default.join(bashInstallerBinDir, platformBinary));
|
|
61501
61506
|
}
|
|
61502
|
-
candidates.push(
|
|
61507
|
+
candidates.push(import_node_path34.default.join(bashInstallerBinDir, "relay-pty"));
|
|
61503
61508
|
}
|
|
61504
61509
|
candidates.push("/app/bin/relay-pty");
|
|
61505
61510
|
candidates.push("/usr/local/bin/relay-pty");
|
|
@@ -62163,7 +62168,7 @@ var import_node_child_process10 = require("node:child_process");
|
|
|
62163
62168
|
|
|
62164
62169
|
// packages/config/dist/project-namespace.js
|
|
62165
62170
|
var import_node_crypto16 = __toESM(require("node:crypto"), 1);
|
|
62166
|
-
var
|
|
62171
|
+
var import_node_path35 = __toESM(require("node:path"), 1);
|
|
62167
62172
|
var import_node_fs28 = __toESM(require("node:fs"), 1);
|
|
62168
62173
|
var import_node_os12 = __toESM(require("node:os"), 1);
|
|
62169
62174
|
function getGlobalBaseDir2() {
|
|
@@ -62172,43 +62177,43 @@ function getGlobalBaseDir2() {
|
|
|
62172
62177
|
}
|
|
62173
62178
|
const xdgDataHome = process.env.XDG_DATA_HOME;
|
|
62174
62179
|
if (xdgDataHome) {
|
|
62175
|
-
return
|
|
62180
|
+
return import_node_path35.default.join(xdgDataHome, "agent-relay");
|
|
62176
62181
|
}
|
|
62177
|
-
return
|
|
62182
|
+
return import_node_path35.default.join(import_node_os12.default.homedir(), ".agent-relay");
|
|
62178
62183
|
}
|
|
62179
62184
|
var GLOBAL_BASE_DIR2 = getGlobalBaseDir2();
|
|
62180
62185
|
var PROJECT_DATA_DIR = ".agent-relay";
|
|
62181
62186
|
function hashPath(projectPath) {
|
|
62182
|
-
const normalized =
|
|
62187
|
+
const normalized = import_node_path35.default.resolve(projectPath);
|
|
62183
62188
|
const hash2 = import_node_crypto16.default.createHash("sha256").update(normalized).digest("hex");
|
|
62184
62189
|
return hash2.substring(0, 12);
|
|
62185
62190
|
}
|
|
62186
62191
|
function findProjectRoot(startDir = process.cwd()) {
|
|
62187
62192
|
if (process.env.AGENT_RELAY_PROJECT) {
|
|
62188
|
-
return
|
|
62193
|
+
return import_node_path35.default.resolve(process.env.AGENT_RELAY_PROJECT);
|
|
62189
62194
|
}
|
|
62190
|
-
let current =
|
|
62191
|
-
const root =
|
|
62195
|
+
let current = import_node_path35.default.resolve(startDir);
|
|
62196
|
+
const root = import_node_path35.default.parse(current).root;
|
|
62192
62197
|
const markers = [".git", "package.json", "Cargo.toml", "go.mod", "pyproject.toml", ".agent-relay"];
|
|
62193
62198
|
while (current !== root) {
|
|
62194
62199
|
for (const marker of markers) {
|
|
62195
|
-
if (import_node_fs28.default.existsSync(
|
|
62200
|
+
if (import_node_fs28.default.existsSync(import_node_path35.default.join(current, marker))) {
|
|
62196
62201
|
return current;
|
|
62197
62202
|
}
|
|
62198
62203
|
}
|
|
62199
|
-
current =
|
|
62204
|
+
current = import_node_path35.default.dirname(current);
|
|
62200
62205
|
}
|
|
62201
|
-
return
|
|
62206
|
+
return import_node_path35.default.resolve(startDir);
|
|
62202
62207
|
}
|
|
62203
62208
|
function getProjectPaths2(projectRoot) {
|
|
62204
62209
|
const root = projectRoot ?? findProjectRoot();
|
|
62205
62210
|
const projectId = hashPath(root);
|
|
62206
|
-
const dataDir =
|
|
62211
|
+
const dataDir = import_node_path35.default.join(root, PROJECT_DATA_DIR);
|
|
62207
62212
|
return {
|
|
62208
62213
|
dataDir,
|
|
62209
|
-
teamDir:
|
|
62210
|
-
dbPath:
|
|
62211
|
-
socketPath:
|
|
62214
|
+
teamDir: import_node_path35.default.join(dataDir, "team"),
|
|
62215
|
+
dbPath: import_node_path35.default.join(dataDir, "messages.sqlite"),
|
|
62216
|
+
socketPath: import_node_path35.default.join(dataDir, "relay.sock"),
|
|
62212
62217
|
projectRoot: root,
|
|
62213
62218
|
projectId
|
|
62214
62219
|
};
|
|
@@ -62216,15 +62221,15 @@ function getProjectPaths2(projectRoot) {
|
|
|
62216
62221
|
|
|
62217
62222
|
// packages/config/dist/trajectory-config.js
|
|
62218
62223
|
var import_node_fs29 = require("node:fs");
|
|
62219
|
-
var
|
|
62224
|
+
var import_node_path36 = require("node:path");
|
|
62220
62225
|
var import_node_os13 = require("node:os");
|
|
62221
62226
|
var import_node_crypto17 = require("node:crypto");
|
|
62222
62227
|
function getAgentRelayConfigDir() {
|
|
62223
|
-
return process.env.AGENT_RELAY_CONFIG_DIR ?? (0,
|
|
62228
|
+
return process.env.AGENT_RELAY_CONFIG_DIR ?? (0, import_node_path36.join)((0, import_node_os13.homedir)(), ".config", "agent-relay");
|
|
62224
62229
|
}
|
|
62225
62230
|
var configCache = null;
|
|
62226
62231
|
function getRelayConfigPath(_projectRoot) {
|
|
62227
|
-
return (0,
|
|
62232
|
+
return (0, import_node_path36.join)(getAgentRelayConfigDir(), "relay.json");
|
|
62228
62233
|
}
|
|
62229
62234
|
function readRelayConfig(projectRoot) {
|
|
62230
62235
|
const configPath = getRelayConfigPath(projectRoot);
|
|
@@ -62264,12 +62269,12 @@ function getProjectHash(projectRoot) {
|
|
|
62264
62269
|
}
|
|
62265
62270
|
function getUserTrajectoriesDir(projectRoot) {
|
|
62266
62271
|
const projectHash = getProjectHash(projectRoot);
|
|
62267
|
-
const configDir = process.env.XDG_CONFIG_HOME || (0,
|
|
62268
|
-
return (0,
|
|
62272
|
+
const configDir = process.env.XDG_CONFIG_HOME || (0, import_node_path36.join)((0, import_node_os13.homedir)(), ".config");
|
|
62273
|
+
return (0, import_node_path36.join)(configDir, "agent-relay", "trajectories", projectHash);
|
|
62269
62274
|
}
|
|
62270
62275
|
function getRepoTrajectoriesDir(projectRoot) {
|
|
62271
62276
|
const root = projectRoot ?? getProjectPaths2().projectRoot;
|
|
62272
|
-
return (0,
|
|
62277
|
+
return (0, import_node_path36.join)(root, ".trajectories");
|
|
62273
62278
|
}
|
|
62274
62279
|
function getPrimaryTrajectoriesDir(projectRoot) {
|
|
62275
62280
|
if (shouldStoreInRepo(projectRoot)) {
|
|
@@ -62910,7 +62915,7 @@ var HookEmitter = class {
|
|
|
62910
62915
|
|
|
62911
62916
|
// packages/hooks/dist/inbox-check/utils.js
|
|
62912
62917
|
var import_node_fs30 = require("node:fs");
|
|
62913
|
-
var
|
|
62918
|
+
var import_node_path37 = require("node:path");
|
|
62914
62919
|
var DEFAULT_INBOX_DIR = "/tmp/agent-relay";
|
|
62915
62920
|
function getAgentName() {
|
|
62916
62921
|
return process.env.AGENT_RELAY_NAME;
|
|
@@ -62920,7 +62925,7 @@ function getInboxPath(config2) {
|
|
|
62920
62925
|
if (!agentName) {
|
|
62921
62926
|
throw new Error("Agent name not configured. Set AGENT_RELAY_NAME env var.");
|
|
62922
62927
|
}
|
|
62923
|
-
return (0,
|
|
62928
|
+
return (0, import_node_path37.join)(config2.inboxDir, agentName, "inbox.md");
|
|
62924
62929
|
}
|
|
62925
62930
|
function inboxExists(inboxPath) {
|
|
62926
62931
|
return (0, import_node_fs30.existsSync)(inboxPath);
|