yaver-cli 1.99.145 → 1.99.146
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/package.json +1 -1
- package/src/agent-runtime.js +8 -1
package/package.json
CHANGED
package/src/agent-runtime.js
CHANGED
|
@@ -204,7 +204,7 @@ async function resolveSpawnSpec(args, options) {
|
|
|
204
204
|
function spawnAndWait(spawnSpec, args) {
|
|
205
205
|
const child = spawn(spawnSpec.command, spawnSpec.args, {
|
|
206
206
|
stdio: 'inherit',
|
|
207
|
-
env: process.env,
|
|
207
|
+
env: spawnSpec.env || process.env,
|
|
208
208
|
cwd: spawnSpec.cwd || process.cwd(),
|
|
209
209
|
});
|
|
210
210
|
|
|
@@ -416,10 +416,17 @@ function resolveLocalAgentCommand(agentArgs) {
|
|
|
416
416
|
const agentDir = path.join(repoRoot(), 'desktop', 'agent');
|
|
417
417
|
const goMod = path.join(agentDir, 'go.mod');
|
|
418
418
|
if (fs.existsSync(goMod)) {
|
|
419
|
+
// `go run` requires the module dir as cwd, so we chdir into agentDir
|
|
420
|
+
// for the Go toolchain itself. The compiled agent inherits that cwd
|
|
421
|
+
// and would lose the user's actual working directory — clobbering
|
|
422
|
+
// every command that resolves a project from os.Getwd() (wire push,
|
|
423
|
+
// wireless push, code, etc.). Pass it through as YAVER_USER_CWD so
|
|
424
|
+
// the agent can chdir back to it before any cwd-sensitive logic.
|
|
419
425
|
return {
|
|
420
426
|
command: 'go',
|
|
421
427
|
args: ['run', '.', ...agentArgs],
|
|
422
428
|
cwd: agentDir,
|
|
429
|
+
env: { ...process.env, YAVER_USER_CWD: process.cwd() },
|
|
423
430
|
};
|
|
424
431
|
}
|
|
425
432
|
|