@neriros/ralphy 2.10.0 → 2.10.2
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/cli/index.js +42 -11
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -50838,7 +50838,7 @@ var require_axios = __commonJS((exports, module) => {
|
|
|
50838
50838
|
|
|
50839
50839
|
// apps/cli/src/index.ts
|
|
50840
50840
|
import { resolve, join as join17, dirname as dirname4 } from "path";
|
|
50841
|
-
import { exists, mkdir as mkdir3, rm } from "fs/promises";
|
|
50841
|
+
import { exists as exists2, mkdir as mkdir3, rm } from "fs/promises";
|
|
50842
50842
|
|
|
50843
50843
|
// node_modules/.bun/ink@5.2.1+1f88f629f0141b18/node_modules/ink/build/render.js
|
|
50844
50844
|
import { Stream } from "stream";
|
|
@@ -56407,7 +56407,7 @@ function log(msg) {
|
|
|
56407
56407
|
// package.json
|
|
56408
56408
|
var package_default = {
|
|
56409
56409
|
name: "@neriros/ralphy",
|
|
56410
|
-
version: "2.10.
|
|
56410
|
+
version: "2.10.2",
|
|
56411
56411
|
description: "An iterative AI task execution framework. Orchestrates multi-phase autonomous work using Claude or Codex engines.",
|
|
56412
56412
|
keywords: [
|
|
56413
56413
|
"agent",
|
|
@@ -56538,7 +56538,7 @@ var HELP_TEXT = [
|
|
|
56538
56538
|
" --linear-label <name> Filter by label name (repeatable, any-of)",
|
|
56539
56539
|
" --poll-interval <s> Seconds between Linear polls (default: 60)",
|
|
56540
56540
|
" --concurrency <n> Max concurrent task loops (default: 1)",
|
|
56541
|
-
" --worktree Run each task in its own git worktree (
|
|
56541
|
+
" --worktree Run each task in its own git worktree (~/.ralph/<project>/worktrees/<name>)",
|
|
56542
56542
|
" --in-progress-status <name> Linear status to set when work starts on an issue",
|
|
56543
56543
|
" --done-status <name> Linear status to set when work completes successfully",
|
|
56544
56544
|
" --done-label <name> Linear label to add when work completes successfully",
|
|
@@ -70601,7 +70601,7 @@ class AgentCoordinator {
|
|
|
70601
70601
|
if (this.opts.postComments !== false) {
|
|
70602
70602
|
const body = ok ? `\u2705 Ralph completed work on this issue. Change: \`${changeName}\`` : `\u2717 Ralph exited with code ${code} on this issue. Change: \`${changeName}\`
|
|
70603
70603
|
|
|
70604
|
-
` + `This issue has been quarantined and will not be auto-resumed on the next poll. ` + `Inspect the worktree at
|
|
70604
|
+
` + `This issue has been quarantined and will not be auto-resumed on the next poll. ` + `Inspect the worktree at \`~/.ralph/<project>/worktrees/${changeName}\`, fix the underlying ` + `failure (e.g. lint/typecheck), then run \`ralph clean --name ${changeName}\` to ` + `clear the quarantine and let the next poll re-pick the issue.`;
|
|
70605
70605
|
try {
|
|
70606
70606
|
await updater.postComment(issue, body);
|
|
70607
70607
|
} catch (err) {
|
|
@@ -70658,9 +70658,10 @@ class AgentCoordinator {
|
|
|
70658
70658
|
}
|
|
70659
70659
|
|
|
70660
70660
|
// apps/cli/src/agent/worktree.ts
|
|
70661
|
-
import { join as join13 } from "path";
|
|
70661
|
+
import { basename, join as join13 } from "path";
|
|
70662
|
+
import { homedir as homedir2 } from "os";
|
|
70662
70663
|
function worktreesDir(projectRoot) {
|
|
70663
|
-
return join13(
|
|
70664
|
+
return join13(homedir2(), ".ralph", basename(projectRoot), "worktrees");
|
|
70664
70665
|
}
|
|
70665
70666
|
function branchForChange(changeName) {
|
|
70666
70667
|
return `ralph/${changeName}`;
|
|
@@ -70848,6 +70849,31 @@ ${logs}
|
|
|
70848
70849
|
// apps/cli/src/components/AgentMode.tsx
|
|
70849
70850
|
var jsx_dev_runtime9 = __toESM(require_jsx_dev_runtime(), 1);
|
|
70850
70851
|
import { join as join14 } from "path";
|
|
70852
|
+
import { exists } from "fs/promises";
|
|
70853
|
+
async function seedWorktreeMcpConfig(projectRoot, worktreeCwd) {
|
|
70854
|
+
const src = join14(projectRoot, ".mcp.json");
|
|
70855
|
+
if (!await exists(src))
|
|
70856
|
+
return;
|
|
70857
|
+
const dst = join14(worktreeCwd, ".mcp.json");
|
|
70858
|
+
if (await exists(dst))
|
|
70859
|
+
return;
|
|
70860
|
+
let parsed;
|
|
70861
|
+
try {
|
|
70862
|
+
parsed = await Bun.file(src).json();
|
|
70863
|
+
} catch {
|
|
70864
|
+
return;
|
|
70865
|
+
}
|
|
70866
|
+
const servers = parsed.mcpServers;
|
|
70867
|
+
if (servers && typeof servers === "object") {
|
|
70868
|
+
for (const cfg of Object.values(servers)) {
|
|
70869
|
+
if (Array.isArray(cfg.args)) {
|
|
70870
|
+
cfg.args = cfg.args.map((a) => typeof a === "string" && a.startsWith(".ralph/") ? join14(projectRoot, a) : a);
|
|
70871
|
+
}
|
|
70872
|
+
}
|
|
70873
|
+
}
|
|
70874
|
+
await Bun.write(dst, JSON.stringify(parsed, null, 2) + `
|
|
70875
|
+
`);
|
|
70876
|
+
}
|
|
70851
70877
|
var bunGitRunner = {
|
|
70852
70878
|
run: async (args, cwd2) => {
|
|
70853
70879
|
const proc = Bun.spawn({ cmd: ["git", ...args], cwd: cwd2, stdout: "pipe", stderr: "pipe" });
|
|
@@ -71006,6 +71032,11 @@ function AgentMode({ args, projectRoot, statesDir, tasksDir }) {
|
|
|
71006
71032
|
scaffoldTasksDir = join14(wt.cwd, "openspec", "changes");
|
|
71007
71033
|
scaffoldStatesDir = join14(wt.cwd, ".ralph", "tasks");
|
|
71008
71034
|
appendLog(` ${issue.identifier} worktree: ${wt.cwd} (${wt.branch})`, "gray");
|
|
71035
|
+
try {
|
|
71036
|
+
await seedWorktreeMcpConfig(projectRoot, wt.cwd);
|
|
71037
|
+
} catch (err) {
|
|
71038
|
+
appendLog(`! seeding .mcp.json failed for ${issue.identifier}: ${err.message}`, "yellow");
|
|
71039
|
+
}
|
|
71009
71040
|
} catch (err) {
|
|
71010
71041
|
appendLog(`! worktree create failed for ${issue.identifier}: ${err.message} \u2014 falling back to project root`, "yellow");
|
|
71011
71042
|
}
|
|
@@ -71670,7 +71701,7 @@ if (typeof globalThis.Bun === "undefined") {
|
|
|
71670
71701
|
async function findProjectRoot() {
|
|
71671
71702
|
let dir = process.cwd();
|
|
71672
71703
|
while (dir !== "/") {
|
|
71673
|
-
if (await
|
|
71704
|
+
if (await exists2(join17(dir, "openspec")))
|
|
71674
71705
|
return dir;
|
|
71675
71706
|
dir = resolve(dir, "..");
|
|
71676
71707
|
}
|
|
@@ -71722,12 +71753,12 @@ try {
|
|
|
71722
71753
|
`);
|
|
71723
71754
|
process.exit(1);
|
|
71724
71755
|
}
|
|
71725
|
-
const worktreeDir = join17(projectRoot,
|
|
71756
|
+
const worktreeDir = join17(worktreesDir(projectRoot), args.name);
|
|
71726
71757
|
const changeDir = join17(tasksDir, args.name);
|
|
71727
71758
|
const stateDir = join17(statesDir, args.name);
|
|
71728
71759
|
const branch = `ralph/${args.name}`;
|
|
71729
71760
|
const removed = [];
|
|
71730
|
-
if (await
|
|
71761
|
+
if (await exists2(worktreeDir)) {
|
|
71731
71762
|
const proc = Bun.spawn({
|
|
71732
71763
|
cmd: ["git", "worktree", "remove", "--force", worktreeDir],
|
|
71733
71764
|
cwd: projectRoot,
|
|
@@ -71754,11 +71785,11 @@ try {
|
|
|
71754
71785
|
});
|
|
71755
71786
|
if (await branchProc.exited === 0)
|
|
71756
71787
|
removed.push(`branch ${branch}`);
|
|
71757
|
-
if (await
|
|
71788
|
+
if (await exists2(changeDir)) {
|
|
71758
71789
|
await rm(changeDir, { recursive: true, force: true });
|
|
71759
71790
|
removed.push(`openspec change ${changeDir}`);
|
|
71760
71791
|
}
|
|
71761
|
-
if (await
|
|
71792
|
+
if (await exists2(stateDir)) {
|
|
71762
71793
|
await rm(stateDir, { recursive: true, force: true });
|
|
71763
71794
|
removed.push(`task state ${stateDir}`);
|
|
71764
71795
|
}
|