pi-better-harness 0.1.13 → 0.1.14
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/node_modules/pi-better-background-tasks/package.json +1 -1
- package/node_modules/pi-better-goal/package.json +1 -1
- package/node_modules/pi-better-goal/src/goal-clock.ts +12 -0
- package/node_modules/pi-better-goal/src/index.ts +3 -3
- package/node_modules/pi-better-subagents/package.json +1 -1
- package/package.json +4 -4
|
@@ -7,6 +7,18 @@ export interface GoalTiming {
|
|
|
7
7
|
elapsedSeconds: number;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
export const COMPLETED_GOAL_RETENTION_SECONDS = 30;
|
|
11
|
+
|
|
12
|
+
export function isGoalClockVisible(
|
|
13
|
+
goal: GoalSnapshot,
|
|
14
|
+
now = Math.floor(Date.now() / 1000),
|
|
15
|
+
): boolean {
|
|
16
|
+
if (goal.status !== "complete" || goal.completedAt === null) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
return now - goal.completedAt < COMPLETED_GOAL_RETENTION_SECONDS;
|
|
20
|
+
}
|
|
21
|
+
|
|
10
22
|
export function goalTiming(goal: GoalSnapshot, now = Math.floor(Date.now() / 1000)): GoalTiming {
|
|
11
23
|
const activeDelta =
|
|
12
24
|
goal.status === "active" && goal.activeStartedAt !== null
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
validateObjective,
|
|
18
18
|
validateTokenBudget,
|
|
19
19
|
} from "./goal-state.js";
|
|
20
|
-
import { goalTiming, renderGoalClockLine } from "./goal-clock.js";
|
|
20
|
+
import { goalTiming, isGoalClockVisible, renderGoalClockLine } from "./goal-clock.js";
|
|
21
21
|
import { collectSubagentActivity } from "./subagents.js";
|
|
22
22
|
import {
|
|
23
23
|
EVENT_ACTIVITY,
|
|
@@ -317,13 +317,13 @@ export default function (pi: ExtensionAPI): void {
|
|
|
317
317
|
invalidate() {},
|
|
318
318
|
render(width: number): string[] {
|
|
319
319
|
const goal = getGoal(ctx);
|
|
320
|
-
if (!goal) {
|
|
320
|
+
if (!goal || !isGoalClockVisible(goal)) {
|
|
321
321
|
return [];
|
|
322
322
|
}
|
|
323
323
|
const fg = typeof theme?.fg === "function"
|
|
324
324
|
? (color: string, value: string) => theme.fg(color as never, value)
|
|
325
325
|
: undefined;
|
|
326
|
-
return [renderGoalClockLine(goal, width, undefined, fg)];
|
|
326
|
+
return [renderGoalClockLine(goal, width, undefined, fg), ""];
|
|
327
327
|
},
|
|
328
328
|
};
|
|
329
329
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-better-harness",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"description": "Pi extension bundle for subagents, durable background tasks, and goal tracking.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"test": "node --test test/*.test.mjs"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"pi-better-background-tasks": "0.1.
|
|
47
|
-
"pi-better-goal": "0.1.
|
|
48
|
-
"pi-better-subagents": "0.1.
|
|
46
|
+
"pi-better-background-tasks": "0.1.14",
|
|
47
|
+
"pi-better-goal": "0.1.14",
|
|
48
|
+
"pi-better-subagents": "0.1.14"
|
|
49
49
|
},
|
|
50
50
|
"bundledDependencies": [
|
|
51
51
|
"pi-better-background-tasks",
|