agents-relay 1.0.86 → 1.0.88
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/execution-context.js +4 -0
- package/dist/planner.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { access, readFile, readdir, realpath, stat } from 'node:fs/promises';
|
|
2
2
|
import { homedir } from 'node:os';
|
|
3
3
|
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
const BUNDLED_AGENTS_ROOT = join(dirname(fileURLToPath(import.meta.url)), '..', 'skills', 'agents-relay', 'agents');
|
|
4
6
|
async function exists(path) {
|
|
5
7
|
try {
|
|
6
8
|
await access(path);
|
|
@@ -194,6 +196,8 @@ export async function resolveExecutionContext(projectPath, role, options = {}) {
|
|
|
194
196
|
}
|
|
195
197
|
const skills = selectByName([...skillMap.values()].sort((a, b) => a.name.localeCompare(b.name)), options.explicitSkills, 'skill');
|
|
196
198
|
const agentMap = new Map();
|
|
199
|
+
for (const agent of await agentFiles(dirname(BUNDLED_AGENTS_ROOT), 'builtin', []))
|
|
200
|
+
agentMap.set(agent.name, agent);
|
|
197
201
|
for (const layer of uniqueLayers) {
|
|
198
202
|
for (const agent of await agentFiles(layer.root, layer.source, skillsByLayer.get(layer.root) ?? []))
|
|
199
203
|
agentMap.set(agent.name, agent);
|
package/dist/planner.js
CHANGED
|
@@ -197,7 +197,7 @@ export class AgentObjectivePlanner {
|
|
|
197
197
|
const resolvedContext = context.executionContext ? executionContextPrompt(context.executionContext) + '\n\n' : '';
|
|
198
198
|
const prompt = instructions.trim() + '\n\n## Shared Task / Job Contract\n\n' + contract.trim() + '\n\n' + resolvedContext + '## Durable planner input\n\n' + plannerInput(context);
|
|
199
199
|
return await new Promise((resolve, reject) => {
|
|
200
|
-
const child = spawn(this.command, ['exec', '--json', '--', prompt], { stdio: ['ignore', 'pipe', 'pipe'] });
|
|
200
|
+
const child = spawn(this.command, ['exec', '--json', '--', prompt], { cwd: context.executionContext?.project.path, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
201
201
|
let stdoutBuffer = '';
|
|
202
202
|
let finalMessage = '';
|
|
203
203
|
let stderrTail = '';
|