@ouro.bot/cli 0.1.0-alpha.88 → 0.1.0-alpha.89
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/changelog.json +6 -0
- package/dist/repertoire/coding/spawner.js +18 -0
- package/package.json +1 -1
package/changelog.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
|
|
3
3
|
"versions": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.1.0-alpha.89",
|
|
6
|
+
"changes": [
|
|
7
|
+
"Spawned coding sessions now inject ~/.ouro-cli/bin into PATH so child processes (claude, codex) can resolve ouro CLI binaries without relying on the parent shell's PATH."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
4
10
|
{
|
|
5
11
|
"version": "0.1.0-alpha.88",
|
|
6
12
|
"changes": [
|
|
@@ -36,6 +36,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.spawnCodingProcess = spawnCodingProcess;
|
|
37
37
|
const child_process_1 = require("child_process");
|
|
38
38
|
const fs = __importStar(require("fs"));
|
|
39
|
+
const os = __importStar(require("os"));
|
|
40
|
+
const path = __importStar(require("path"));
|
|
39
41
|
const runtime_1 = require("../../nerves/runtime");
|
|
40
42
|
function buildCommandArgs(runner, workdir) {
|
|
41
43
|
if (runner === "claude") {
|
|
@@ -58,6 +60,18 @@ function buildCommandArgs(runner, workdir) {
|
|
|
58
60
|
args: ["exec", "--skip-git-repo-check", "--cd", workdir],
|
|
59
61
|
};
|
|
60
62
|
}
|
|
63
|
+
function buildSpawnEnv(baseEnv, homeDir) {
|
|
64
|
+
const binDir = path.join(homeDir, ".ouro-cli", "bin");
|
|
65
|
+
const existingPath = baseEnv.PATH ?? "";
|
|
66
|
+
const pathEntries = existingPath.split(path.delimiter).filter((entry) => entry.length > 0);
|
|
67
|
+
if (!pathEntries.includes(binDir)) {
|
|
68
|
+
pathEntries.unshift(binDir);
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
...baseEnv,
|
|
72
|
+
PATH: pathEntries.join(path.delimiter),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
61
75
|
function buildPrompt(request, deps) {
|
|
62
76
|
const sections = [];
|
|
63
77
|
sections.push([
|
|
@@ -79,8 +93,11 @@ function spawnCodingProcess(request, deps = {}) {
|
|
|
79
93
|
const spawnFn = deps.spawnFn ?? ((command, args, options) => (0, child_process_1.spawn)(command, args, options));
|
|
80
94
|
const existsSync = deps.existsSync ?? fs.existsSync;
|
|
81
95
|
const readFileSync = deps.readFileSync ?? fs.readFileSync;
|
|
96
|
+
const homeDir = deps.homeDir ?? os.homedir();
|
|
97
|
+
const baseEnv = deps.baseEnv ?? process.env;
|
|
82
98
|
const prompt = buildPrompt(request, { existsSync, readFileSync });
|
|
83
99
|
const { command, args } = buildCommandArgs(request.runner, request.workdir);
|
|
100
|
+
const env = buildSpawnEnv(baseEnv, homeDir);
|
|
84
101
|
(0, runtime_1.emitNervesEvent)({
|
|
85
102
|
component: "repertoire",
|
|
86
103
|
event: "repertoire.coding_spawn_start",
|
|
@@ -89,6 +106,7 @@ function spawnCodingProcess(request, deps = {}) {
|
|
|
89
106
|
});
|
|
90
107
|
const proc = spawnFn(command, args, {
|
|
91
108
|
cwd: request.workdir,
|
|
109
|
+
env,
|
|
92
110
|
stdio: ["pipe", "pipe", "pipe"],
|
|
93
111
|
});
|
|
94
112
|
proc.stdin.end(`${prompt}\n`);
|