pi-better-harness 0.3.1 → 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
 
@@ -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);
@@ -213,6 +223,7 @@ export function disposeBackgroundWorkNavigator(ctx?: ExtensionContext): void {
213
223
  s.mainListRequestRender = undefined;
214
224
  s.editorComponent = undefined;
215
225
  s.detailOverlayRows = undefined;
226
+ planNavigationState().releaseWorkFocus = undefined;
216
227
  s.mainListSelectedId = undefined;
217
228
  s.mainListFocused = false;
218
229
  }
@@ -460,7 +471,10 @@ function buildMainListLines(
460
471
  }
461
472
 
462
473
  function shortcutsLine(focused: boolean, fg: (color: string, value: string) => string): string {
463
- 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}`;
464
478
  return dim(keys, fg);
465
479
  }
466
480
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-better-harness",
3
- "version": "0.3.1",
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.9",
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.24"
51
+ "pi-better-subagents": "0.1.25"
52
52
  },
53
53
  "bundledDependencies": [
54
54
  "pi-better-background-tasks",