agents-relay 2.0.222 → 2.0.224
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/agent-shortcut.js +19 -8
- package/dist/cli-help.js +4 -5
- package/package.json +1 -1
package/dist/agent-shortcut.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createHash, randomUUID } from 'node:crypto';
|
|
2
2
|
import { readFile, realpath, stat } from 'node:fs/promises';
|
|
3
|
-
import { resolve, relative, isAbsolute, sep, dirname,
|
|
3
|
+
import { resolve, relative, isAbsolute, sep, dirname, basename, join } from 'node:path';
|
|
4
4
|
import { once } from 'node:events';
|
|
5
5
|
import { pathToFileURL } from 'node:url';
|
|
6
6
|
import { spawnOwnedProcess } from './owned-process.js';
|
|
@@ -98,9 +98,8 @@ async function runCommand(args, cwd, signal) {
|
|
|
98
98
|
const [code] = await once(child, 'close');
|
|
99
99
|
return { stdout, stderr, code: code ?? -1 };
|
|
100
100
|
}
|
|
101
|
-
/**
|
|
102
|
-
* inheritance
|
|
103
|
-
* never look up an unrelated same-named shortcut in another layer. */
|
|
101
|
+
/** A Shortcut belongs to an Agent source, not to an independent name search.
|
|
102
|
+
* Only explicit Agent inheritance permits falling back to a parent's Shortcut. */
|
|
104
103
|
async function discoverShortcut(agent, projectPath, neoRoot) {
|
|
105
104
|
let sources;
|
|
106
105
|
try {
|
|
@@ -112,9 +111,21 @@ async function discoverShortcut(agent, projectPath, neoRoot) {
|
|
|
112
111
|
throw error;
|
|
113
112
|
}
|
|
114
113
|
for (const source of [...sources].reverse()) {
|
|
115
|
-
const
|
|
116
|
-
const
|
|
117
|
-
const
|
|
114
|
+
const agentDir = dirname(source);
|
|
115
|
+
const name = basename(source).replace(/(?:\.agent)?\.md$/, '');
|
|
116
|
+
const shortcutDir = join(agentDir, '.shortcut');
|
|
117
|
+
let shortcutRoot;
|
|
118
|
+
try {
|
|
119
|
+
shortcutRoot = await realpath(shortcutDir);
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
if (error.code === 'ENOENT')
|
|
123
|
+
continue;
|
|
124
|
+
throw error;
|
|
125
|
+
}
|
|
126
|
+
if (shortcutRoot !== shortcutDir)
|
|
127
|
+
throw new Error(`Agent shortcut directory symlink escapes Agent source: ${shortcutDir}`);
|
|
128
|
+
const candidate = join(shortcutDir, `${name}.agent.mjs`);
|
|
118
129
|
let actual;
|
|
119
130
|
try {
|
|
120
131
|
actual = await realpath(candidate);
|
|
@@ -124,7 +135,7 @@ async function discoverShortcut(agent, projectPath, neoRoot) {
|
|
|
124
135
|
continue;
|
|
125
136
|
throw error;
|
|
126
137
|
}
|
|
127
|
-
if (dirname(actual) !==
|
|
138
|
+
if (dirname(actual) !== shortcutRoot)
|
|
128
139
|
throw new Error(`Agent shortcut symlink escapes source directory: ${candidate}`);
|
|
129
140
|
if (!(await stat(actual)).isFile())
|
|
130
141
|
throw new Error(`Agent shortcut is not a regular file: ${candidate}`);
|
package/dist/cli-help.js
CHANGED
|
@@ -59,11 +59,10 @@ Shortcut execution:
|
|
|
59
59
|
[--store-dir DIR] [--project-path DIR] [--neo-root DIR] [--concurrency 4]
|
|
60
60
|
|
|
61
61
|
The selected Task must have an Agent Graph. Project shortcuts at
|
|
62
|
-
agents/<agent>.agent.mjs
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
follow the existing recovery lifecycle without automatic replay of effects. Nonhuman waits resume only from a matching SQLite Task receipt; EventBus
|
|
62
|
+
agents/.shortcut/<agent>.agent.mjs override Neo shared shortcuts. A Graph
|
|
63
|
+
with any missing shortcut falls back to the normal durable Worker before
|
|
64
|
+
executing any module; mixing shortcut and Worker nodes in one Graph is unsupported.
|
|
65
|
+
Shortcuts that fail before effects also return to the Worker queue. Nonhuman waits resume only from a matching SQLite Task receipt; EventBus
|
|
67
66
|
events are wake signals. Human approval remains hostInvocation-only.
|
|
68
67
|
Shortcut Job completion requires durable contentOnly=true and no PR, merge, or review gates.
|
|
69
68
|
|