pi-better-harness 0.3.0 → 0.3.2

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.
@@ -97,6 +97,7 @@ type NavigatorState = {
97
97
  };
98
98
 
99
99
  const GLOBAL_KEY = Symbol.for("pi-better-harness.navigator.state");
100
+ const PLAN_NAVIGATION_KEY = Symbol.for("pi-better-harness.plan-navigation.state");
100
101
  const FACTORY_MARK = "__piBetterHarnessNavigatorFactory";
101
102
  const FACTORY_REFRESH = "__piBetterHarnessNavigatorRefresh";
102
103
 
@@ -108,7 +109,7 @@ export const CLOSE_ARM_MS = 3000;
108
109
  export const DEFAULT_LOG_TAIL_ROWS = 10;
109
110
  export const LOG_TAIL_ROW_CHOICES = [10, 25] as const;
110
111
  const MAIN_LIST_FALLBACK_WIDTH = 100;
111
- const DETAIL_OVERLAY_FOOTER_ROWS = 3;
112
+ const DETAIL_OVERLAY_BOTTOM_MARGIN_ROWS = 0;
112
113
  const EVIDENCE_SECTION_ID = "__evidence__";
113
114
  const RUNNING_DOT_GLYPH = "●";
114
115
 
@@ -120,6 +121,14 @@ function state(): NavigatorState {
120
121
  return g[GLOBAL_KEY]!;
121
122
  }
122
123
 
124
+ type PlanNavigationState = { visible: boolean; releaseWorkFocus?: () => void };
125
+
126
+ function planNavigationState(): PlanNavigationState {
127
+ const global = globalThis as typeof globalThis & { [PLAN_NAVIGATION_KEY]?: PlanNavigationState };
128
+ if (!global[PLAN_NAVIGATION_KEY]) global[PLAN_NAVIGATION_KEY] = { visible: false };
129
+ return global[PLAN_NAVIGATION_KEY]!;
130
+ }
131
+
123
132
  export function registerBackgroundWorkProvider(provider: BackgroundWorkProvider): () => void {
124
133
  const s = state();
125
134
  const previousUnsub = s.unsubscribers.get(provider.id);
@@ -161,7 +170,7 @@ export function isNavigatorUiAvailable(ctx: ExtensionContext | undefined): boole
161
170
  }
162
171
 
163
172
  export function navigatorFooterHint(count: number): string | null {
164
- return count > 0 ? `← navigate · ${count}` : null;
173
+ return count > 0 ? `← work · ${count}` : null;
165
174
  }
166
175
 
167
176
  export function applyNavigatorFooter(ui: { setStatus(key: string, value: string | undefined): void }, count: number): string | null {
@@ -185,6 +194,7 @@ export function ensureBackgroundWorkNavigator(ctx: ExtensionContext, deps: HostD
185
194
  s.mainListRequestRender = undefined;
186
195
  s.mainListDeadlineScheduler?.dispose();
187
196
  s.mainListDeadlineScheduler = createRenderScheduler(() => refreshMainListWidget());
197
+ planNavigationState().releaseWorkFocus = unfocusMainList;
188
198
  installNavigatorEditor(ctx.ui as any, deps);
189
199
  s.lastHint = undefined;
190
200
  refreshBackgroundWorkNavigator(ctx);
@@ -211,7 +221,9 @@ export function disposeBackgroundWorkNavigator(ctx?: ExtensionContext): void {
211
221
  s.mainListDeadlineScheduler = undefined;
212
222
  s.mainListWidgetInstalled = false;
213
223
  s.mainListRequestRender = undefined;
224
+ s.editorComponent = undefined;
214
225
  s.detailOverlayRows = undefined;
226
+ planNavigationState().releaseWorkFocus = undefined;
215
227
  s.mainListSelectedId = undefined;
216
228
  s.mainListFocused = false;
217
229
  }
@@ -459,7 +471,10 @@ function buildMainListLines(
459
471
  }
460
472
 
461
473
  function shortcutsLine(focused: boolean, fg: (color: string, value: string) => string): string {
462
- const keys = focused ? "↑↓ switch · Enter detail · x stop · Esc unfocus" : "← to navigate";
474
+ const plan = planNavigationState().visible ? " · → plan" : "";
475
+ const keys = focused
476
+ ? `↑↓ switch · Enter detail · x stop${plan} · Esc unfocus`
477
+ : `← work navigator${plan}`;
463
478
  return dim(keys, fg);
464
479
  }
465
480
 
@@ -1025,7 +1040,7 @@ function buildTranscriptDetailLines(
1025
1040
  }
1026
1041
 
1027
1042
  function detailOverlayOptions() {
1028
- const marginBottom = DETAIL_OVERLAY_FOOTER_ROWS;
1043
+ const marginBottom = DETAIL_OVERLAY_BOTTOM_MARGIN_ROWS;
1029
1044
  return {
1030
1045
  anchor: "top-left" as const,
1031
1046
  width: "100%" as const,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-better-harness",
3
- "version": "0.3.0",
4
- "description": "Pi extension bundle for an opt-in foreground write sandbox, subagents, durable background tasks, and goal tracking.",
3
+ "version": "0.3.2",
4
+ "description": "Pi extension bundle for a write sandbox, subagents, background tasks, and goals.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "keywords": [
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "homepage": "https://github.com/1aboveio/pi-better-harness/tree/main/packages/pi-better-harness#readme",
34
34
  "bin": {
35
- "pi-better-harness": "./bin/pi-better-harness.mjs"
35
+ "pi-better-harness": "bin/pi-better-harness.mjs"
36
36
  },
37
37
  "files": [
38
38
  "README.md",
@@ -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.2.0",
48
+ "pi-better-background-tasks": "0.2.10",
49
+ "pi-better-goal": "0.2.1",
50
50
  "pi-better-sandbox": "0.3.0",
51
- "pi-better-subagents": "0.1.23"
51
+ "pi-better-subagents": "0.1.25"
52
52
  },
53
53
  "bundledDependencies": [
54
54
  "pi-better-background-tasks",