@zhuxixi/pi-agent-board 0.5.2 → 0.6.0
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.md +32 -0
- package/README.md +41 -3
- package/docs/superpowers/plans/2026-09-03-code-refs-pr-backlink-narrow.md +551 -0
- package/docs/superpowers/plans/2026-09-04-evidence-outputpreview.md +209 -0
- package/docs/superpowers/plans/2026-09-04-warm-host-reclaim.md +796 -0
- package/docs/superpowers/plans/2026-09-05-issue-13-drainnextfollowup-pty-probe.md +114 -0
- package/docs/superpowers/plans/2026-09-05-issue-38-windows-wezterm-ime-cursor.md +73 -0
- package/docs/superpowers/plans/2026-09-05-issue-39-truncate-codepoint-boundary.md +143 -0
- package/docs/superpowers/plans/2026-09-05-issue-61-mention-fallback-guards.md +226 -0
- package/docs/superpowers/plans/2026-09-05-issue-63-flaky-manual-completion.md +87 -0
- package/docs/superpowers/plans/2026-09-05-issue-64-changelog-release-helper.md +53 -0
- package/docs/superpowers/plans/2026-09-05-pty-host-stacking-sock-race.md +731 -0
- package/docs/superpowers/specs/2026-08-29-code-refs-badges-design.md +1 -1
- package/docs/superpowers/specs/2026-09-03-code-refs-pr-backlink-narrow-design.md +92 -0
- package/docs/superpowers/specs/2026-09-04-evidence-outputpreview-design.md +50 -0
- package/docs/superpowers/specs/2026-09-04-warm-host-reclaim-design.md +106 -0
- package/docs/superpowers/specs/2026-09-05-issue-13-drainnextfollowup-pty-probe-design.md +64 -0
- package/docs/superpowers/specs/2026-09-05-issue-38-windows-wezterm-ime-design.md +48 -0
- package/docs/superpowers/specs/2026-09-05-issue-39-truncate-codepoint-boundary-design.md +64 -0
- package/docs/superpowers/specs/2026-09-05-issue-61-mention-fallback-design.md +71 -0
- package/docs/superpowers/specs/2026-09-05-issue-63-flaky-manual-completion-design.md +49 -0
- package/docs/superpowers/specs/2026-09-05-issue-64-changelog-helper-design.md +76 -0
- package/docs/superpowers/specs/2026-09-05-pty-host-stacking-sock-race-design.md +510 -0
- package/package.json +83 -81
- package/runner/job-runner.mjs +2 -2
- package/runner/pty-runner.mjs +573 -2
- package/runner/state-runner.mjs +3 -0
- package/runner/title-runner.mjs +1 -1
- package/scripts/release_helper.mjs +277 -0
- package/src/commands/agent-board.ts +38 -35
- package/src/commands/attach-decision.mjs +66 -0
- package/src/commands/attach-flow.ts +45 -39
- package/src/core/code-refs.mjs +85 -33
- package/src/core/evidence.mjs +2 -2
- package/src/core/heuristics.mjs +40 -2
- package/src/core/host-coordination.mjs +159 -0
- package/src/core/host-crash.mjs +43 -3
- package/src/core/host-probe.mjs +196 -0
- package/src/core/launch.mjs +3 -1
- package/src/core/locks.mjs +196 -1
- package/src/core/paths.mjs +24 -0
- package/src/core/store.mjs +164 -5
- package/src/core/types.mjs +17 -1
- package/src/core/warm-host-sweeper.mjs +150 -0
- package/src/index.ts +29 -1
- package/src/runtime/service.mjs +967 -109
- package/src/ui/dashboard-decisions.mjs +55 -0
- package/src/ui/dashboard.ts +26 -12
package/src/index.ts
CHANGED
|
@@ -11,7 +11,8 @@ import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-a
|
|
|
11
11
|
import { resolvePiInvocation } from "./core/invocation.mjs";
|
|
12
12
|
import { controlSocketPathFor, defaultRoot } from "./core/paths.mjs";
|
|
13
13
|
import { listRows } from "./core/store.mjs";
|
|
14
|
-
import { createService } from "./runtime/service.mjs";
|
|
14
|
+
import { createService, envInt } from "./runtime/service.mjs";
|
|
15
|
+
import { attachWarmHostSweeper } from "./core/warm-host-sweeper.mjs";
|
|
15
16
|
import { openDashboard, registerAgentBoardCommand } from "./commands/agent-board.js";
|
|
16
17
|
import { registerBgCommand } from "./commands/bg.js";
|
|
17
18
|
|
|
@@ -39,6 +40,33 @@ export default function piAgentBoard(pi: ExtensionAPI): void {
|
|
|
39
40
|
piArgsPrefix,
|
|
40
41
|
getThinkingLevel: () => pi.getThinkingLevel(),
|
|
41
42
|
};
|
|
43
|
+
|
|
44
|
+
// Warm-host reclaim (issue #75): idle PTY hosts must not leak forever after
|
|
45
|
+
// detach. Sweep once now (reclaims hosts orphaned by a previous host pi that
|
|
46
|
+
// exited without cleanup), then periodically; sweep again on shutdown.
|
|
47
|
+
// Child pi processes skip entirely (they share the board root and would
|
|
48
|
+
// terminate their own runner). serviceForContext is defined before the attach
|
|
49
|
+
// call because the sweeper sweeps synchronously on attach and the sweep
|
|
50
|
+
// closure references it (no TDZ).
|
|
51
|
+
const serviceForContext = () =>
|
|
52
|
+
createService({ root, runnerScript: RUNNER_SCRIPT, ptyRunnerScript: PTY_RUNNER_SCRIPT, titleRunnerScript: TITLE_RUNNER_SCRIPT, autoStateRunnerScript: AUTO_STATE_RUNNER_SCRIPT, piCommand, piArgsPrefix, defaultCwd: process.cwd() });
|
|
53
|
+
let sweepService: ReturnType<typeof createService> | null = null;
|
|
54
|
+
attachWarmHostSweeper(pi, {
|
|
55
|
+
isHostedChild,
|
|
56
|
+
sweep: () => {
|
|
57
|
+
try {
|
|
58
|
+
// Reuse one service instance per extension lifetime: createService
|
|
59
|
+
// schedules a screen-log GC on construction, so per-tick creation
|
|
60
|
+
// would turn an event-driven cost into a timed one.
|
|
61
|
+
sweepService ??= serviceForContext();
|
|
62
|
+
sweepService.pruneWarmHosts();
|
|
63
|
+
} catch {
|
|
64
|
+
/* best-effort: never break the session over a sweep */
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
intervalMs: envInt("AGENT_BOARD_SWEEP_INTERVAL_MS", 60_000, 0, 24 * 60 * 60 * 1000, "AGENT_VIEW_SWEEP_INTERVAL_MS"),
|
|
68
|
+
});
|
|
69
|
+
|
|
42
70
|
registerAgentBoardCommand(pi, commandOpts);
|
|
43
71
|
registerBgCommand(pi, commandOpts);
|
|
44
72
|
pi.registerFlag("agent-board", {
|