pi-better-harness 0.3.14 → 0.3.15
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.
|
@@ -42,10 +42,12 @@ export function readRushPlan(path: string, cwd: string): RushPlan {
|
|
|
42
42
|
if (size > 2_000_000) throw new Error("Rush plan exceeds the 2 MB display limit.");
|
|
43
43
|
const data: unknown = JSON.parse(readFileSync(file, "utf8"));
|
|
44
44
|
if (!isRecord(data) || data.runId !== dir || !Number.isSafeInteger(data.planRevision) ||
|
|
45
|
-
(data.planRevision as number) < 0 || !
|
|
45
|
+
(data.planRevision as number) < 0 || !isRecord(data.fleet)) {
|
|
46
46
|
throw new Error("Invalid Rush plan identity or revision.");
|
|
47
47
|
}
|
|
48
|
-
const
|
|
48
|
+
const persistedUnits = Array.isArray(data.issues) ? data.issues : data.units;
|
|
49
|
+
if (!Array.isArray(persistedUnits)) throw new Error("Invalid Rush plan units.");
|
|
50
|
+
const issues = persistedUnits.map((unit: unknown) => {
|
|
49
51
|
if (!isRecord(unit) || typeof unit.id !== "string" || typeof unit.title !== "string" ||
|
|
50
52
|
typeof unit.stage !== "string" || typeof unit.status !== "string") {
|
|
51
53
|
throw new Error("Invalid Rush plan unit.");
|
|
@@ -59,8 +61,9 @@ export function readRushPlan(path: string, cwd: string): RushPlan {
|
|
|
59
61
|
});
|
|
60
62
|
const fleet: RushPlan["fleet"] = {};
|
|
61
63
|
for (const [stage, value] of Object.entries(data.fleet)) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
+
const status = typeof value === "string" ? value : isRecord(value) ? value.status : undefined;
|
|
65
|
+
if (typeof status !== "string") throw new Error("Invalid Rush fleet stage.");
|
|
66
|
+
fleet[stage] = { status };
|
|
64
67
|
}
|
|
65
68
|
return {
|
|
66
69
|
runId: data.runId as string,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-better-harness",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.15",
|
|
4
4
|
"description": "Pi extension bundle for a write sandbox, subagents, background tasks, SSH, goals, and structured plans.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"pi-better-background-tasks": "0.2.14",
|
|
54
54
|
"pi-better-goal": "0.4.0",
|
|
55
|
-
"pi-better-plan": "0.3.
|
|
55
|
+
"pi-better-plan": "0.3.1",
|
|
56
56
|
"pi-better-sandbox": "0.3.0",
|
|
57
57
|
"pi-better-ssh": "0.1.1",
|
|
58
58
|
"pi-better-subagents": "0.1.30",
|