pi-better-harness 0.2.1 → 0.3.1

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-background-tasks",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "Pi extension for durable background shell tasks, watchers, logs, and status inspection.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -108,7 +108,7 @@ export const CLOSE_ARM_MS = 3000;
108
108
  export const DEFAULT_LOG_TAIL_ROWS = 10;
109
109
  export const LOG_TAIL_ROW_CHOICES = [10, 25] as const;
110
110
  const MAIN_LIST_FALLBACK_WIDTH = 100;
111
- const DETAIL_OVERLAY_FOOTER_ROWS = 3;
111
+ const DETAIL_OVERLAY_BOTTOM_MARGIN_ROWS = 0;
112
112
  const EVIDENCE_SECTION_ID = "__evidence__";
113
113
  const RUNNING_DOT_GLYPH = "●";
114
114
 
@@ -211,6 +211,7 @@ export function disposeBackgroundWorkNavigator(ctx?: ExtensionContext): void {
211
211
  s.mainListDeadlineScheduler = undefined;
212
212
  s.mainListWidgetInstalled = false;
213
213
  s.mainListRequestRender = undefined;
214
+ s.editorComponent = undefined;
214
215
  s.detailOverlayRows = undefined;
215
216
  s.mainListSelectedId = undefined;
216
217
  s.mainListFocused = false;
@@ -1025,7 +1026,7 @@ function buildTranscriptDetailLines(
1025
1026
  }
1026
1027
 
1027
1028
  function detailOverlayOptions() {
1028
- const marginBottom = DETAIL_OVERLAY_FOOTER_ROWS;
1029
+ const marginBottom = DETAIL_OVERLAY_BOTTOM_MARGIN_ROWS;
1029
1030
  return {
1030
1031
  anchor: "top-left" as const,
1031
1032
  width: "100%" as const,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-better-goal",
3
- "version": "0.1.22",
3
+ "version": "0.2.0",
4
4
  "description": "Pi extension for goal tracking with background-aware continuation.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,4 +1,5 @@
1
1
  import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
2
+ import type { AutocompleteItem } from "@earendil-works/pi-tui";
2
3
  import { Type } from "typebox";
3
4
 
4
5
  import {
@@ -59,6 +60,19 @@ const MAX_NO_PROGRESS_RETRIES = parseRetryLimit(
59
60
  DEFAULT_MAX_NO_PROGRESS_RETRIES,
60
61
  );
61
62
 
63
+ const GOAL_ACTIONS: readonly AutocompleteItem[] = [
64
+ { value: "pause", label: "pause", description: "Pause the active goal" },
65
+ { value: "resume", label: "resume", description: "Resume the paused goal" },
66
+ { value: "clear", label: "clear", description: "Remove the current goal" },
67
+ { value: "complete", label: "complete", description: "Mark the current goal complete" },
68
+ ];
69
+
70
+ export function goalArgumentCompletions(argumentPrefix: string): AutocompleteItem[] | null {
71
+ const prefix = argumentPrefix.trimStart().toLowerCase();
72
+ const matches = GOAL_ACTIONS.filter((action) => action.value.startsWith(prefix));
73
+ return matches.length > 0 ? [...matches] : null;
74
+ }
75
+
62
76
  function parseDurationEnv(raw: string | undefined, fallback: number): number {
63
77
  if (raw === undefined || raw.trim() === "") {
64
78
  return fallback;
@@ -486,6 +500,7 @@ export default function (pi: ExtensionAPI): void {
486
500
 
487
501
  pi.registerCommand("goal", {
488
502
  description: "Create, inspect, pause, resume, clear, or complete the active goal",
503
+ getArgumentCompletions: goalArgumentCompletions,
489
504
  handler: async (args, ctx) => {
490
505
  currentCtx = ctx;
491
506
  const trimmed = args.trim();
@@ -12,6 +12,7 @@
12
12
  */
13
13
 
14
14
  import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
15
+ import type { AutocompleteItem } from "@earendil-works/pi-tui";
15
16
 
16
17
  import {
17
18
  DenyRuleError,
@@ -256,8 +257,22 @@ function announce(ctx: ExtensionCommandContext, change: () => DenyRuleReport): v
256
257
  const SUBCOMMANDS = ["on", "off", "default", "deny", "rules"] as const;
257
258
  const DENY_ACTIONS = ["list", "add", "remove", "reset"] as const;
258
259
 
260
+ const COMPLETION_DESCRIPTIONS: Readonly<Record<string, string>> = {
261
+ on: "Enable confinement for this session",
262
+ off: "Disable confinement for this session",
263
+ default: "Change the persistent activation default",
264
+ "default on": "Enable confinement by default",
265
+ "default off": "Disable confinement by default",
266
+ deny: "Manage write-denied paths",
267
+ "deny list": "Show configured write-denied paths",
268
+ "deny add": "Add a write-denied path",
269
+ "deny remove": "Remove a write-denied path",
270
+ "deny reset": "Restore packaged write-deny defaults",
271
+ rules: "Open the write-deny rule manager",
272
+ };
273
+
259
274
  /** Argument completions for `/sandbox`, including the `deny` actions. */
260
- export function sandboxArgumentCompletions(argumentPrefix: string) {
275
+ export function sandboxArgumentCompletions(argumentPrefix: string): AutocompleteItem[] {
261
276
  const prefix = argumentPrefix.trimStart().toLowerCase();
262
277
  const denyPrefix = /^deny(\s|$)/.test(prefix) ? prefix.replace(/^deny\s*/, "") : undefined;
263
278
  const defaultPrefix = /^default(\s|$)/.test(prefix)
@@ -275,5 +290,12 @@ export function sandboxArgumentCompletions(argumentPrefix: string) {
275
290
  .map((value) => `default ${value}`)
276
291
  : SUBCOMMANDS.filter((value) => value.startsWith(prefix));
277
292
 
278
- return values.map((value) => ({ value, label: value }));
293
+ return values.map((value) => {
294
+ const description = COMPLETION_DESCRIPTIONS[value];
295
+ return {
296
+ value,
297
+ label: value,
298
+ ...(description === undefined ? {} : { description }),
299
+ };
300
+ });
279
301
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-better-sandbox",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Pi extension that confines foreground shell execution to the project directory with a kernel-enforced write sandbox.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-better-subagents",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "description": "Pi extension for detached, sandboxed subagent runs that keep the foreground session free.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -108,7 +108,7 @@ export const CLOSE_ARM_MS = 3000;
108
108
  export const DEFAULT_LOG_TAIL_ROWS = 10;
109
109
  export const LOG_TAIL_ROW_CHOICES = [10, 25] as const;
110
110
  const MAIN_LIST_FALLBACK_WIDTH = 100;
111
- const DETAIL_OVERLAY_FOOTER_ROWS = 3;
111
+ const DETAIL_OVERLAY_BOTTOM_MARGIN_ROWS = 0;
112
112
  const EVIDENCE_SECTION_ID = "__evidence__";
113
113
  const RUNNING_DOT_GLYPH = "●";
114
114
 
@@ -211,6 +211,7 @@ export function disposeBackgroundWorkNavigator(ctx?: ExtensionContext): void {
211
211
  s.mainListDeadlineScheduler = undefined;
212
212
  s.mainListWidgetInstalled = false;
213
213
  s.mainListRequestRender = undefined;
214
+ s.editorComponent = undefined;
214
215
  s.detailOverlayRows = undefined;
215
216
  s.mainListSelectedId = undefined;
216
217
  s.mainListFocused = false;
@@ -1025,7 +1026,7 @@ function buildTranscriptDetailLines(
1025
1026
  }
1026
1027
 
1027
1028
  function detailOverlayOptions() {
1028
- const marginBottom = DETAIL_OVERLAY_FOOTER_ROWS;
1029
+ const marginBottom = DETAIL_OVERLAY_BOTTOM_MARGIN_ROWS;
1029
1030
  return {
1030
1031
  anchor: "top-left" as const,
1031
1032
  width: "100%" as const,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-better-harness",
3
- "version": "0.2.1",
3
+ "version": "0.3.1",
4
4
  "description": "Pi extension bundle for an opt-in foreground write sandbox, subagents, durable background tasks, and goal tracking.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -45,10 +45,10 @@
45
45
  "test": "node --test test/*.test.mjs"
46
46
  },
47
47
  "dependencies": {
48
- "pi-better-background-tasks": "0.2.8",
49
- "pi-better-goal": "0.1.22",
50
- "pi-better-sandbox": "0.2.0",
51
- "pi-better-subagents": "0.1.23"
48
+ "pi-better-background-tasks": "0.2.9",
49
+ "pi-better-goal": "0.2.0",
50
+ "pi-better-sandbox": "0.3.0",
51
+ "pi-better-subagents": "0.1.24"
52
52
  },
53
53
  "bundledDependencies": [
54
54
  "pi-better-background-tasks",