pi-better-harness 0.3.14 → 0.3.16

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-better-plan",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Structured execution plans with persistent progress for Pi.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -162,9 +162,7 @@ export default function planExtension(pi: ExtensionAPI): void {
162
162
  if (displayMode === "hidden") return [];
163
163
  if (displayedWorkflowOwner) {
164
164
  if (displayedWorkflowOwner !== "rush-issues") return [];
165
- return rushPlan ? renderRushPlan(rushPlan, width) : [
166
- `rush-issues ${rushError ? `plan unavailable: ${rushError}` : "waiting for task plan"}`,
167
- ].map((line) => line.slice(0, width));
165
+ return rushPlan ? renderRushPlan(rushPlan, width) : [];
168
166
  }
169
167
  if (!currentPlan) return [];
170
168
  return renderCompactPlan(currentPlan, width, theme as never);
@@ -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 || !Array.isArray(data.issues) || !isRecord(data.fleet)) {
45
+ (data.planRevision as number) < 0 || !isRecord(data.fleet)) {
46
46
  throw new Error("Invalid Rush plan identity or revision.");
47
47
  }
48
- const issues = data.issues.map((unit: unknown) => {
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
- if (!isRecord(value) || typeof value.status !== "string") throw new Error("Invalid Rush fleet stage.");
63
- fleet[stage] = { status: value.status };
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.14",
3
+ "version": "0.3.16",
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.0",
55
+ "pi-better-plan": "0.3.2",
56
56
  "pi-better-sandbox": "0.3.0",
57
57
  "pi-better-ssh": "0.1.1",
58
58
  "pi-better-subagents": "0.1.30",