pi-better-harness 0.65.2 → 0.66.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 +8 -0
- package/README.md +11 -7
- package/extensions/native-compaction/index.ts +5 -3
- package/extensions/settings/commands.ts +56 -46
- package/extensions/settings/copy.ts +0 -5
- package/extensions/settings/index.ts +8 -7
- package/extensions/settings/menu.ts +117 -36
- package/extensions/settings/page.ts +51 -21
- package/extensions/settings/registry.ts +3 -0
- package/extensions/shared-navigator-panels.ts +11 -1
- package/lib/codex-model-prompt.mjs +3 -1
- package/lib/install-settings.mjs +10 -0
- package/lib/instructions.mjs +4 -10
- package/node_modules/pi-better-background-tasks/package.json +2 -2
- package/node_modules/pi-better-background-tasks/runtime-client/artifacts/darwin-arm64.json +1 -1
- package/node_modules/pi-better-background-tasks/runtime-client/artifacts/darwin-x64.json +1 -1
- package/node_modules/pi-better-background-tasks/runtime-client/artifacts/linux-arm64.json +1 -1
- package/node_modules/pi-better-background-tasks/runtime-client/artifacts/linux-x64.json +1 -1
- package/node_modules/pi-better-background-tasks/runtime-client/artifacts/win32-x64.json +1 -1
- package/node_modules/pi-better-background-tasks/src/shared-harness-commands.ts +56 -46
- package/node_modules/pi-better-background-tasks/src/shared-harness-copy.ts +0 -5
- package/node_modules/pi-better-background-tasks/src/shared-harness-menu.ts +117 -36
- package/node_modules/pi-better-background-tasks/src/shared-harness-page.ts +51 -21
- package/node_modules/pi-better-background-tasks/src/shared-harness-registry.ts +3 -0
- package/node_modules/pi-better-background-tasks/src/shared-navigator-panels.ts +11 -1
- package/node_modules/pi-better-background-tasks/src/shared-navigator.ts +111 -16
- package/node_modules/pi-better-goal/package.json +1 -1
- package/node_modules/pi-better-goal/src/index.ts +1 -1
- package/node_modules/pi-better-goal/src/settings-page.ts +22 -49
- package/node_modules/pi-better-goal/src/shared-harness-commands.ts +56 -46
- package/node_modules/pi-better-goal/src/shared-harness-copy.ts +0 -5
- package/node_modules/pi-better-goal/src/shared-harness-menu.ts +117 -36
- package/node_modules/pi-better-goal/src/shared-harness-page.ts +51 -21
- package/node_modules/pi-better-goal/src/shared-harness-registry.ts +3 -0
- package/node_modules/pi-better-goal/src/shared-navigator-panels.ts +11 -1
- package/node_modules/pi-better-sandbox/package.json +1 -1
- package/node_modules/pi-better-sandbox/permissions-page.ts +17 -11
- package/node_modules/pi-better-sandbox/rules-page.ts +6 -2
- package/node_modules/pi-better-sandbox/shared-harness-commands.ts +56 -46
- package/node_modules/pi-better-sandbox/shared-harness-copy.ts +0 -5
- package/node_modules/pi-better-sandbox/shared-harness-menu.ts +117 -36
- package/node_modules/pi-better-sandbox/shared-harness-page.ts +51 -21
- package/node_modules/pi-better-sandbox/shared-harness-registry.ts +3 -0
- package/node_modules/pi-better-subagents/index.ts +38 -30
- package/node_modules/pi-better-subagents/package.json +2 -2
- package/node_modules/pi-better-subagents/runtime-client/artifacts/darwin-arm64.json +1 -1
- package/node_modules/pi-better-subagents/runtime-client/artifacts/darwin-x64.json +1 -1
- package/node_modules/pi-better-subagents/runtime-client/artifacts/linux-arm64.json +1 -1
- package/node_modules/pi-better-subagents/runtime-client/artifacts/linux-x64.json +1 -1
- package/node_modules/pi-better-subagents/runtime-client/artifacts/win32-x64.json +1 -1
- package/node_modules/pi-better-subagents/settings-page.ts +27 -22
- package/node_modules/pi-better-subagents/shared-harness-commands.ts +56 -46
- package/node_modules/pi-better-subagents/shared-harness-copy.ts +0 -5
- package/node_modules/pi-better-subagents/shared-harness-menu.ts +117 -36
- package/node_modules/pi-better-subagents/shared-harness-page.ts +51 -21
- package/node_modules/pi-better-subagents/shared-harness-registry.ts +3 -0
- package/node_modules/pi-better-subagents/shared-navigator-panels.ts +11 -1
- package/node_modules/pi-better-subagents/shared-navigator.ts +111 -16
- package/package.json +6 -6
|
@@ -18,31 +18,50 @@ const callbackDescription = (source: "session" | "default") => [
|
|
|
18
18
|
"Changes apply to this session. Ctrl+S saves your default.",
|
|
19
19
|
].join("\n");
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
// The order here is also the keyboard order within each tab.
|
|
22
|
+
const groups: [string, string, string[]][] = [
|
|
23
|
+
["Goals", "Execution", ["setting:goal-auto-start", "link:goal", "action:Goal execution settings"]],
|
|
24
|
+
["Goals", "Workflows", ["setting:dynamic-workflow", "action:Skill workflow", "action:Start or continue dynamic workflow"]],
|
|
25
|
+
["Goals", "Todo and ledgers", ["setting:outcome-todo", "setting:outcome-todo-ledger", "action:Current Todo", "action:Project ledgers"]],
|
|
26
|
+
["Agents", "Delegation", ["link:subagents", "action:Subagent settings"]],
|
|
27
|
+
["Agents", "Catalog", ["link:catalog-web", "link:agents", "action:Agent catalog"]],
|
|
28
|
+
["Agents", "History", ["action:Historical subagent waits"]],
|
|
29
|
+
["Sandbox", "Permissions", ["link:sandbox", "action:Sandbox settings", "action:Sandbox activation"]],
|
|
30
|
+
["Sandbox", "Rules and diagnostics", ["action:Sandbox rules and diagnostics"]],
|
|
31
|
+
["Background", "Waits and activity", ["setting:tool-call-guard", "setting:background-review-interval", "action:Inspect current activity"]],
|
|
32
|
+
["Background", "Results", [CALLBACK_SETTING_ID]],
|
|
33
|
+
["Display", "Work panels", ["setting:navigator-sticky", "setting:outcome-todo-display"]],
|
|
34
|
+
["Display", "Transcript", ["setting:tool-output", "setting:tool-animation", "action:Tool output"]],
|
|
35
|
+
["Supervision", "Scenarios", ["setting:supervisor-mode", "supervisor:scenarios"]],
|
|
36
|
+
["Supervision", "Recovery", ["action:Recovery commitments"]],
|
|
37
|
+
["OpenAI Optimization", "Context", ["setting:native-compaction"]],
|
|
38
|
+
["OpenAI Optimization", "Instructions", ["setting:model-instruction-template"]],
|
|
39
|
+
["Prompts", "Session recap", ["setting:session-recap", "link:recap-prompt", "action:Recap prompt"]],
|
|
40
|
+
["Prompts", "Instructions", ["link:prompts-web", "instructions:toggle", "link:prompt-manager", "action:Prompt manager", "instructions:edit"]],
|
|
41
|
+
["Prompts", "Experiments", ["action:Capture next response", "action:Capture task", "action:Load evaluation cases", "action:Export reviewed replay", "action:Case-based proposals"]],
|
|
42
|
+
["Remote", "Sessions", ["action:Remote sessions", "action:Move session to host"]],
|
|
43
|
+
["Audio", "Playback", ["action:Read aloud", "action:Stop playback"]],
|
|
28
44
|
];
|
|
29
45
|
|
|
30
46
|
function groupSettings(items: MenuItem[]): MenuSection[] {
|
|
31
47
|
const remaining = new Map(items.map(item => [item.id, item]));
|
|
32
|
-
const sections =
|
|
33
|
-
|
|
48
|
+
const sections = new Map<string, MenuSection>();
|
|
49
|
+
function add(title: string, item: MenuItem) {
|
|
50
|
+
let section = sections.get(title);
|
|
51
|
+
if (!section) { section = { title, items: [] }; sections.set(title, section); }
|
|
52
|
+
section.items.push(item);
|
|
53
|
+
}
|
|
54
|
+
for (const [tab, group, ids] of groups) {
|
|
55
|
+
for (const id of ids) {
|
|
34
56
|
const item = remaining.get(id);
|
|
57
|
+
if (!item) continue;
|
|
35
58
|
remaining.delete(id);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
for (const item of remaining.values()) {
|
|
40
|
-
const title = item.tab ?? "Extensions";
|
|
41
|
-
let section = sections.find(section => section.title === title);
|
|
42
|
-
if (!section) { section = { title, items: [] }; sections.push(section); }
|
|
43
|
-
section.items.push(item);
|
|
59
|
+
item.group = group;
|
|
60
|
+
add(tab, item);
|
|
61
|
+
}
|
|
44
62
|
}
|
|
45
|
-
|
|
63
|
+
for (const item of remaining.values()) add(item.tab ?? "Extensions", item);
|
|
64
|
+
return [...sections.values()];
|
|
46
65
|
}
|
|
47
66
|
|
|
48
67
|
function presentControl(control: SettingsControl) {
|
|
@@ -73,7 +92,7 @@ function presentLink(link: SettingsLink): MenuItem {
|
|
|
73
92
|
};
|
|
74
93
|
}
|
|
75
94
|
|
|
76
|
-
export async function chooseHarnessSetting(ctx: ExtensionCommandContext, links: SettingsLink[], selected?: string, callbacks?: CallbackSettingsControl, controls: SettingsControl[] = [],
|
|
95
|
+
export async function chooseHarnessSetting(ctx: ExtensionCommandContext, links: SettingsLink[], selected?: string, callbacks?: CallbackSettingsControl, controls: SettingsControl[] = [], actions: MenuItem[] = []): Promise<string | undefined> {
|
|
77
96
|
return ctx.ui.custom((tui, theme, _kb, done: (id?: string) => void) => {
|
|
78
97
|
const currentCallback = callbacks?.get();
|
|
79
98
|
let callbackMode = currentCallback?.mode ?? "hold";
|
|
@@ -84,13 +103,22 @@ export async function chooseHarnessSetting(ctx: ExtensionCommandContext, links:
|
|
|
84
103
|
value: callbackLabels[callbackMode],
|
|
85
104
|
description: callbackDescription(currentCallback.source),
|
|
86
105
|
};
|
|
87
|
-
const entries =
|
|
106
|
+
const entries = controls.map(presentControl);
|
|
88
107
|
const sections = groupSettings([
|
|
89
108
|
...(callbackSetting ? [callbackSetting] : []),
|
|
90
109
|
...entries.map(({ item }) => item),
|
|
91
110
|
...links.map(presentLink),
|
|
92
111
|
...actions,
|
|
93
112
|
]);
|
|
113
|
+
const subagents = links.find(link => link.id === "subagents");
|
|
114
|
+
const agents = sections.find(section => section.title === "Agents");
|
|
115
|
+
if (agents && typeof subagents?.createPane === "function") {
|
|
116
|
+
const createPane = subagents.createPane;
|
|
117
|
+
agents.createPane = options => createPane(ctx, {
|
|
118
|
+
...options, items: agents.items.filter(item => item.id !== "link:subagents"),
|
|
119
|
+
requestRender: () => tui.requestRender?.(),
|
|
120
|
+
});
|
|
121
|
+
}
|
|
94
122
|
let changing = false;
|
|
95
123
|
const report = (message: string, error = false) => {
|
|
96
124
|
menu.report(message, error);
|
|
@@ -128,11 +156,13 @@ export async function chooseHarnessSetting(ctx: ExtensionCommandContext, links:
|
|
|
128
156
|
},
|
|
129
157
|
});
|
|
130
158
|
return {
|
|
159
|
+
get focused() { return menu.focused; },
|
|
160
|
+
set focused(value: boolean) { menu.focused = value; },
|
|
131
161
|
render: menu.render,
|
|
132
162
|
invalidate: menu.invalidate,
|
|
133
163
|
handleInput(data: string) {
|
|
134
164
|
if (changing) return;
|
|
135
|
-
if (callbacks && matchesKey(data, "ctrl+s")) {
|
|
165
|
+
if (callbacks && !menu.hasPane && matchesKey(data, "ctrl+s")) {
|
|
136
166
|
try { callbacks.save(); report("Callback default saved."); }
|
|
137
167
|
catch (error) { report(error instanceof Error ? error.message : String(error), true); }
|
|
138
168
|
return;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { ExtensionAPI, ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
|
|
3
|
+
import type { MenuPane, PaneOptions } from "./menu.ts";
|
|
4
|
+
|
|
3
5
|
export interface SettingsLink {
|
|
6
|
+
createPane?(ctx: ExtensionCommandContext, options: PaneOptions): MenuPane;
|
|
4
7
|
id: string;
|
|
5
8
|
label: string;
|
|
6
9
|
description?: string;
|
|
@@ -29,6 +29,7 @@ type State = {
|
|
|
29
29
|
anchor?: string | undefined;
|
|
30
30
|
pendingAnchor: boolean;
|
|
31
31
|
generation: number;
|
|
32
|
+
pointerPanel?: PanelComponent | undefined;
|
|
32
33
|
ranges: Array<{ start: number; end: number; component: PanelComponent }>;
|
|
33
34
|
control?: { id: string; label: string; values: string[]; get(): string; change(value: string, ctx: ExtensionContext): void } | undefined;
|
|
34
35
|
};
|
|
@@ -57,6 +58,7 @@ function disposePanels(s: State): void {
|
|
|
57
58
|
panel.component = undefined;
|
|
58
59
|
}
|
|
59
60
|
s.ranges = [];
|
|
61
|
+
s.pointerPanel = undefined;
|
|
60
62
|
}
|
|
61
63
|
function orderedPanels(s: State): Panel[] {
|
|
62
64
|
const rank = (key: string) => key === "pi-better-goal" ? 0 : key === "pi-better-plan" ? 1 : 2;
|
|
@@ -96,7 +98,15 @@ function renderPanels(s: State, width: number): string[] {
|
|
|
96
98
|
}
|
|
97
99
|
function mouse(s: State, event: MouseEvent) {
|
|
98
100
|
const range = s.ranges.find(range => event.y >= range.start && event.y < range.end);
|
|
99
|
-
|
|
101
|
+
const panel = event.type === "leave" ? undefined : range?.component;
|
|
102
|
+
const previous = s.pointerPanel;
|
|
103
|
+
let cleared = false;
|
|
104
|
+
if (event.type === "move" || event.type === "leave") {
|
|
105
|
+
if (previous && previous !== panel) cleared = previous.handleMouse?.({ ...event, type: "leave" })?.render === true;
|
|
106
|
+
s.pointerPanel = panel;
|
|
107
|
+
}
|
|
108
|
+
const result = range && panel?.handleMouse?.({ ...event, y: event.y - range.start });
|
|
109
|
+
return cleared ? { handled: true as const, render: true } : result;
|
|
100
110
|
}
|
|
101
111
|
function restoreAnchor(ctx: ExtensionContext): string | undefined {
|
|
102
112
|
let anchor: string | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
|
+
import { readHarnessDefaults } from "./install-settings.mjs";
|
|
3
4
|
|
|
4
5
|
const section = "codex_model_instructions";
|
|
5
6
|
const pinType = "pi-better-harness:official-codex-release";
|
|
@@ -37,7 +38,7 @@ export function readCodexTemplate(tag, model) {
|
|
|
37
38
|
|
|
38
39
|
// One registration per session. The release pin survives reloads of the package
|
|
39
40
|
// on disk, compaction and forks; an explicit Pi resource reload adopts updates.
|
|
40
|
-
export default function registerCodexModelPrompt(pi) {
|
|
41
|
+
export default function registerCodexModelPrompt(pi, enabled = () => readHarnessDefaults().openaiModelInstructionTemplate === true) {
|
|
41
42
|
let tag;
|
|
42
43
|
let loaded = null;
|
|
43
44
|
function restore(ctx) {
|
|
@@ -62,6 +63,7 @@ export default function registerCodexModelPrompt(pi) {
|
|
|
62
63
|
if (sections) delete sections[section];
|
|
63
64
|
const model = ctx.model;
|
|
64
65
|
if (model?.provider !== "openai" && model?.provider !== "openai-codex") return;
|
|
66
|
+
if (!enabled()) return;
|
|
65
67
|
const snapshot = index();
|
|
66
68
|
const release = snapshot.releases[tag ?? snapshot.active];
|
|
67
69
|
if (!release) throw Error("Missing pinned official Codex release: " + tag);
|
package/lib/install-settings.mjs
CHANGED
|
@@ -28,6 +28,16 @@ export function defaultAgentDir() {
|
|
|
28
28
|
return dir.startsWith("file://") ? fileURLToPath(dir) : dir;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
// Workers can read preferences even when their agent directory is read-only.
|
|
32
|
+
export function readHarnessDefaults(agentDir = defaultAgentDir()) {
|
|
33
|
+
try {
|
|
34
|
+
return JSON.parse(readFileSync(join(agentDir, "settings.json"), "utf8")).piBetterHarness ?? {};
|
|
35
|
+
} catch (error) {
|
|
36
|
+
if (error.code === "ENOENT") return {};
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
31
41
|
function settingsPath(local, options) {
|
|
32
42
|
if (options.path) return options.path;
|
|
33
43
|
return local ? resolve(".pi/settings.json") : join(defaultAgentDir(), "settings.json");
|
package/lib/instructions.mjs
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
|
-
import { chmodSync,
|
|
2
|
+
import { chmodSync, linkSync, lstatSync, mkdirSync, readFileSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { dirname, join, resolve } from "node:path";
|
|
4
4
|
import { activeRevision, begin, end, readRevision, selectRevision, upgradeComposition } from "./prompt-revisions.mjs";
|
|
5
|
-
import { acquire, defaultAgentDir, writeDestination } from "./install-settings.mjs";
|
|
6
|
-
|
|
7
|
-
function sourceSettings(agentDir) {
|
|
8
|
-
const settingsPath = join(agentDir, "settings.json");
|
|
9
|
-
const settings = existsSync(settingsPath) ? JSON.parse(readFileSync(settingsPath, "utf8")) : {};
|
|
10
|
-
return settings.piBetterHarness ?? {};
|
|
11
|
-
}
|
|
5
|
+
import { acquire, defaultAgentDir, readHarnessDefaults, writeDestination } from "./install-settings.mjs";
|
|
12
6
|
|
|
13
7
|
function sourceText(agentDir, target, upgrade) {
|
|
14
|
-
const { instructionsPrompt: prompt, instructionsFile: source } =
|
|
8
|
+
const { instructionsPrompt: prompt, instructionsFile: source } = readHarnessDefaults(agentDir);
|
|
15
9
|
if (source === false) return null;
|
|
16
10
|
if (typeof prompt === "string") return validateInstructionsPrompt(prompt);
|
|
17
11
|
if (source !== undefined && (typeof source !== "string" || !source.trim())) {
|
|
@@ -78,7 +72,7 @@ export function currentInstructions(agentDir) {
|
|
|
78
72
|
}
|
|
79
73
|
|
|
80
74
|
export function promptSource(agentDir) {
|
|
81
|
-
const { instructionsPrompt, instructionsFile } =
|
|
75
|
+
const { instructionsPrompt, instructionsFile } = readHarnessDefaults(agentDir);
|
|
82
76
|
if (instructionsFile === false || currentInstructions(agentDir) === undefined) return "off";
|
|
83
77
|
if (typeof instructionsPrompt === "string") return "saved prompt";
|
|
84
78
|
return instructionsFile === undefined ? "modular" : "custom file";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-better-background-tasks",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.19",
|
|
4
4
|
"description": "Pi extension for durable background shell tasks, watchers, logs, and status inspection.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"vitest": "^3.0.0"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"pi-better-server": "0.11.
|
|
73
|
+
"pi-better-server": "0.11.10",
|
|
74
74
|
"proper-lockfile": "^4.1.2"
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"build":{"contentId":"
|
|
1
|
+
{"build":{"contentId":"06b98bf4e6f1e7d77c53fe8ded1995829309d0c843065993a03575f692ad0640","dependencyLockDigest":"4643e416af0b366e78fbaf142d8f69b0591f8a4d3c9db6c07d2ae25157ec9180","format":1,"nodeVersion":"24.14.1","piSdkVersion":"1.7.0","platform":"darwin-arm64","protocolVersion":1,"serverVersion":"0.11.10","sourceDigest":"75441154c84cf249c9abc0b836a6f95f424de3e9bbfb617c5938e025d76d78a7"},"sha256":"49bf8c261c1e4c0ca676641e5d1a59e15ee91a8236df4313feb6e83d5d54f5ab"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"build":{"contentId":"
|
|
1
|
+
{"build":{"contentId":"91fac528426cbd0cc8958763e11436b1c23a1080a64ce943f1e0a468b7c99eef","dependencyLockDigest":"4643e416af0b366e78fbaf142d8f69b0591f8a4d3c9db6c07d2ae25157ec9180","format":1,"nodeVersion":"24.14.1","piSdkVersion":"1.7.0","platform":"darwin-x64","protocolVersion":1,"serverVersion":"0.11.10","sourceDigest":"75441154c84cf249c9abc0b836a6f95f424de3e9bbfb617c5938e025d76d78a7"},"sha256":"f399c112766a7da82899f3e1ec69e074e9b2562c304da5199562c21b8564171a"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"build":{"contentId":"
|
|
1
|
+
{"build":{"contentId":"d41ad3e6a413ded11bd420200d93e20673e5259a8b7a502a86a529bea996dc03","dependencyLockDigest":"4643e416af0b366e78fbaf142d8f69b0591f8a4d3c9db6c07d2ae25157ec9180","format":1,"nodeVersion":"24.14.1","piSdkVersion":"1.7.0","platform":"linux-arm64","protocolVersion":1,"serverVersion":"0.11.10","sourceDigest":"75441154c84cf249c9abc0b836a6f95f424de3e9bbfb617c5938e025d76d78a7"},"sha256":"96a4831055f9e95e7b298e10615567cbc19fdf7bf74b4a81784a7611e3c60553"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"build":{"contentId":"
|
|
1
|
+
{"build":{"contentId":"d531e6509c6baecc9e109a8f31ed03631eccf62ebc1c812432d316a3b7012c24","dependencyLockDigest":"4643e416af0b366e78fbaf142d8f69b0591f8a4d3c9db6c07d2ae25157ec9180","format":1,"nodeVersion":"24.14.1","piSdkVersion":"1.7.0","platform":"linux-x64","protocolVersion":1,"serverVersion":"0.11.10","sourceDigest":"75441154c84cf249c9abc0b836a6f95f424de3e9bbfb617c5938e025d76d78a7"},"sha256":"3cff5bafbedc4f1238596216f8c12ddf0f0740ff21262c7409dbc2cf97f03837"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"build":{"contentId":"
|
|
1
|
+
{"build":{"contentId":"57cbe0230cf34b955e6b9575fa3ed54b9b2eb5ef58132c1d3f84864d239bfc93","dependencyLockDigest":"4643e416af0b366e78fbaf142d8f69b0591f8a4d3c9db6c07d2ae25157ec9180","format":1,"nodeVersion":"24.14.1","piSdkVersion":"1.7.0","platform":"win32-x64","protocolVersion":1,"serverVersion":"0.11.10","sourceDigest":"75441154c84cf249c9abc0b836a6f95f424de3e9bbfb617c5938e025d76d78a7"},"sha256":"4e76e369fded7c2c0726bee174d532c9ef540a4d4f8b8d792a988fdf4f74160e"}
|
|
@@ -4,64 +4,71 @@ import type { MenuItem } from "./shared-harness-menu.ts";
|
|
|
4
4
|
|
|
5
5
|
type Command = Parameters<ExtensionAPI["registerCommand"]>[1];
|
|
6
6
|
type Operation = [label: string, args: string, input?: string];
|
|
7
|
-
type Feature = { name: string; tab: string; label: string; operations?: Operation[]
|
|
7
|
+
type Feature = { name: string; tab: string; label: string; operations?: Record<string, Operation[]>; link?: string };
|
|
8
8
|
|
|
9
9
|
export const settingsNames = ["harness-settings", "better-harness-settings"] as const;
|
|
10
10
|
const features: Feature[] = [
|
|
11
|
-
{ name: "goal", tab: "Goals", label: "Goal execution settings", link: "goal", operations: [["Execution settings", "settings"]] },
|
|
12
|
-
{ name: "todo", tab: "Goals", label: "Current Todo", operations: [
|
|
11
|
+
{ name: "goal", tab: "Goals", label: "Goal execution settings", link: "goal", operations: { "Execution": [["Execution settings", "settings"]] } },
|
|
12
|
+
{ name: "todo", tab: "Goals", label: "Current Todo", operations: { "Display": [
|
|
13
13
|
["Show", "show"], ["Hide", "hide"], ["Expand", "expand"], ["Collapse", "collapse"],
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
["
|
|
14
|
+
], "Pinning": [
|
|
15
|
+
["Automatic pinning", "pin auto"], ["Pin", "pin on"], ["Unpin", "pin off"],
|
|
16
|
+
], "Layout": [
|
|
17
|
+
["Resize split", "split", "Left:right ratio"],
|
|
18
|
+
], "Contents": [
|
|
19
|
+
["Clear Todo", "clear"],
|
|
20
|
+
] } },
|
|
21
|
+
{ name: "ledger", tab: "Goals", label: "Project ledgers", operations: { "Ledgers": [
|
|
22
|
+
["List ledgers", "list"], ["Show attached ledger", "show"],
|
|
23
|
+
], "Attachment": [
|
|
24
|
+
["Attach", "attach", "Ledger ID"],
|
|
18
25
|
["Switch", "switch", "Ledger ID"], ["Detach", "detach"],
|
|
19
|
-
] },
|
|
20
|
-
{ name: "workflow", tab: "Goals", label: "Skill workflow", operations: [["Inspect owner", ""], ["Clear ownership", "clear"]] },
|
|
21
|
-
{ name: "dynamic-workflow", tab: "Goals", label: "Start or continue dynamic workflow", operations: [
|
|
26
|
+
] } },
|
|
27
|
+
{ name: "workflow", tab: "Goals", label: "Skill workflow", operations: { "Ownership": [["Inspect owner", ""], ["Clear ownership", "clear"]] } },
|
|
28
|
+
{ name: "dynamic-workflow", tab: "Goals", label: "Start or continue dynamic workflow", operations: { "Task": [
|
|
22
29
|
["Use current task", ""], ["Give instructions", "", "Workflow instructions"],
|
|
23
|
-
] },
|
|
24
|
-
{ name: "subagents", tab: "Agents", label: "Subagent settings", link: "subagents", operations: [["Open settings", "settings"]] },
|
|
25
|
-
{ name: "subagents", tab: "Agents", label: "Historical subagent waits", operations: [["Inspect historical waits", "history"]] },
|
|
30
|
+
] } },
|
|
31
|
+
{ name: "subagents", tab: "Agents", label: "Subagent settings", link: "subagents", operations: { "Settings": [["Open settings", "settings"]] } },
|
|
32
|
+
{ name: "subagents", tab: "Agents", label: "Historical subagent waits", operations: { "History": [["Inspect historical waits", "history"]] } },
|
|
26
33
|
{ name: "agents", tab: "Agents", label: "Agent catalog", link: "agents" },
|
|
27
|
-
{ name: "
|
|
28
|
-
|
|
29
|
-
["Import from Codex", "import-codex"], ["Reload catalog", "reload"],
|
|
30
|
-
] },
|
|
31
|
-
{ name: "sandbox", tab: "Agents", label: "Sandbox settings", link: "sandbox" },
|
|
32
|
-
{ name: "sandbox", tab: "Agents", label: "Sandbox activation", operations: [
|
|
34
|
+
{ name: "sandbox", tab: "Sandbox", label: "Sandbox settings", link: "sandbox" },
|
|
35
|
+
{ name: "sandbox", tab: "Sandbox", label: "Sandbox activation", operations: { "Session": [
|
|
33
36
|
["Show status", "status"], ["Enable for session", "on"], ["Disable for session", "off"],
|
|
37
|
+
], "Defaults": [
|
|
34
38
|
["Enable by default", "default on"], ["Disable by default", "default off"],
|
|
35
|
-
] },
|
|
36
|
-
{ name: "sandbox", tab: "
|
|
39
|
+
] } },
|
|
40
|
+
{ name: "sandbox", tab: "Sandbox", label: "Sandbox rules and diagnostics", operations: { "Protected paths": [
|
|
37
41
|
["Protected paths", "rules"], ["List protected paths", "deny list"], ["Protect path", "deny add", "Path"],
|
|
38
42
|
["Remove protected path", "deny remove", "Path"], ["Restore packaged rules", "deny reset"],
|
|
43
|
+
], "Diagnostics": [
|
|
39
44
|
["Diagnostics status", "diagnostics status"], ["Diagnostics summary", "diagnostics summary"],
|
|
40
45
|
["Enable diagnostics", "diagnostics on"], ["Disable diagnostics", "diagnostics off"], ["Export diagnostics", "diagnostics export"],
|
|
41
|
-
] },
|
|
46
|
+
] } },
|
|
42
47
|
{ name: "better-activity", tab: "Background", label: "Inspect current activity" },
|
|
43
|
-
{ name: "tool-output", tab: "Display", label: "Tool output", link: "tool-output", operations: [["Compact", "minimal"], ["Normal", "normal"]] },
|
|
44
|
-
{ name: "supervisor-followup", tab: "Supervision", label: "Recovery commitments", operations: [
|
|
48
|
+
{ name: "tool-output", tab: "Display", label: "Tool output", link: "tool-output", operations: { "Transcript": [["Compact", "minimal"], ["Normal", "normal"]] } },
|
|
49
|
+
{ name: "supervisor-followup", tab: "Supervision", label: "Recovery commitments", operations: { "Commitments": [
|
|
45
50
|
["View commitments", ""], ["Schedule a reminder", "remind", "Commitment ID and minutes"],
|
|
46
|
-
] },
|
|
51
|
+
] } },
|
|
47
52
|
{ name: "recap-prompt", tab: "Prompts", label: "Recap prompt", link: "recap-prompt" },
|
|
48
53
|
{ name: "prompt-manager", tab: "Prompts", label: "Prompt manager", link: "prompt-manager" },
|
|
49
54
|
{ name: "prompt-capture", tab: "Prompts", label: "Capture next response" },
|
|
50
|
-
{ name: "prompt-task-capture", tab: "Prompts", label: "Capture task", operations: [["Capture", "", "Task manifest path"]] },
|
|
51
|
-
{ name: "prompt-import", tab: "Prompts", label: "Load evaluation cases", operations: [
|
|
55
|
+
{ name: "prompt-task-capture", tab: "Prompts", label: "Capture task", operations: { "Capture": [["Capture", "", "Task manifest path"]] } },
|
|
56
|
+
{ name: "prompt-import", tab: "Prompts", label: "Load evaluation cases", operations: { "Cases": [
|
|
52
57
|
["Load bundled cases", ""], ["Import reviewed suite", "", "Suite file path"],
|
|
53
|
-
] },
|
|
54
|
-
{ name: "prompt-export", tab: "Prompts", label: "Export reviewed replay", operations: [["Export", "", "New case file path"]] },
|
|
55
|
-
{ name: "prompt-learning", tab: "Prompts", label: "Case-based proposals", operations: [
|
|
58
|
+
] } },
|
|
59
|
+
{ name: "prompt-export", tab: "Prompts", label: "Export reviewed replay", operations: { "Replay": [["Export", "", "New case file path"]] } },
|
|
60
|
+
{ name: "prompt-learning", tab: "Prompts", label: "Case-based proposals", operations: { "Proposals": [
|
|
56
61
|
["Enable for this session", "on"], ["Disable", "off"], ["Discard pending proposal", "discard"],
|
|
57
|
-
] },
|
|
58
|
-
{ name: "remote", tab: "Remote", label: "Remote sessions", operations: [
|
|
59
|
-
["Connect", "connect"], ["List hosts", "list"],
|
|
60
|
-
]
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
] } },
|
|
63
|
+
{ name: "remote", tab: "Remote", label: "Remote sessions", operations: { "Hosts": [
|
|
64
|
+
["Connect", "connect"], ["List hosts", "list"],
|
|
65
|
+
], "Sessions": [
|
|
66
|
+
["Pull a session", "pull"],
|
|
67
|
+
] } },
|
|
68
|
+
{ name: "detach", tab: "Remote", label: "Move session to host", operations: { "Session": [["Move session", "", "SSH alias and optional destination flags"]] } },
|
|
69
|
+
{ name: "read-aloud", tab: "Audio", label: "Read aloud", operations: { "Playback": [
|
|
63
70
|
["Read latest reply", ""], ["Read text", "", "Text to read"],
|
|
64
|
-
] },
|
|
71
|
+
] } },
|
|
65
72
|
{ name: "read-aloud-stop", tab: "Audio", label: "Stop playback" },
|
|
66
73
|
];
|
|
67
74
|
|
|
@@ -82,16 +89,19 @@ function menuActions(commands: Map<string, Command>): HarnessAction[] {
|
|
|
82
89
|
async run(ctx: ExtensionCommandContext) {
|
|
83
90
|
let args = "";
|
|
84
91
|
if (feature.operations) {
|
|
85
|
-
const choices = feature.operations
|
|
86
|
-
|
|
92
|
+
const choices = Object.entries(feature.operations).flatMap(([group, operations]) =>
|
|
93
|
+
operations.map(operation => ({ label: operation[0], group, operation })));
|
|
94
|
+
let selected: (typeof choices)[number] | undefined = choices[0];
|
|
87
95
|
if (choices.length > 1) {
|
|
88
|
-
const
|
|
89
|
-
|
|
96
|
+
const { chooseSettingsOption } = await import("./shared-harness-menu.ts");
|
|
97
|
+
const label = await chooseSettingsOption(ctx, feature.label, choices);
|
|
98
|
+
selected = choices.find(choice => choice.label === label);
|
|
90
99
|
}
|
|
91
|
-
if (!
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
100
|
+
if (!selected) return false;
|
|
101
|
+
const [, argument, input] = selected.operation;
|
|
102
|
+
args = argument;
|
|
103
|
+
if (input) {
|
|
104
|
+
const text = (await ctx.ui.input(input))?.trim();
|
|
95
105
|
if (!text) return false;
|
|
96
106
|
args = [args, text].filter(Boolean).join(" ");
|
|
97
107
|
}
|
|
@@ -159,7 +169,7 @@ export function harnessMenu(pi: ExtensionAPI): MenuHost {
|
|
|
159
169
|
const links = registry.list();
|
|
160
170
|
const controls = registry.controls();
|
|
161
171
|
const available = availableActions(actions, links, controls);
|
|
162
|
-
selected = await chooseHarnessSetting(ctx, links, selected, undefined, controls,
|
|
172
|
+
selected = await chooseHarnessSetting(ctx, links, selected, undefined, controls, available);
|
|
163
173
|
if (!selected) return;
|
|
164
174
|
try {
|
|
165
175
|
const action = available.find(item => item.id === selected);
|
|
@@ -39,11 +39,6 @@ export const controlCopy = new Map<string, SettingCopy>([
|
|
|
39
39
|
label: "Pin work panels",
|
|
40
40
|
description: "Keeps the work panels above the editor as the conversation scrolls. Off lets them scroll with the conversation on supported Pi versions.",
|
|
41
41
|
}],
|
|
42
|
-
["navigator-view", {
|
|
43
|
-
label: "Navigator layout",
|
|
44
|
-
description: "Tree nests tasks under their agent. Flat list groups rows by work type.",
|
|
45
|
-
values: { tree: "Tree", flatten: "Flat list" },
|
|
46
|
-
}],
|
|
47
42
|
["tool-output", {
|
|
48
43
|
description: "Normal shows the usual tool transcript. Compact groups completed calls and hides their details until you expand the group.",
|
|
49
44
|
values: { Minimal: "Compact" },
|