pi-subagent-manager 1.2.0 → 1.2.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.
- package/README.md +4 -4
- package/agents/architect.md +1 -1
- package/agents/coder.md +1 -1
- package/agents/researcher.md +1 -1
- package/agents/reviewer.md +1 -1
- package/agents/tasker.md +1 -1
- package/agents/writer.md +1 -1
- package/docs/default-agents.md +24 -24
- package/package.json +10 -5
- package/src/index.ts +15 -4
- package/src/orch/checklist-integration.ts +33 -9
- package/src/orch/diagnostics.ts +3 -1
- package/src/orch/housekeeping.ts +1 -4
- package/src/orch/inherited-tools.ts +2 -2
- package/src/orch/manager.ts +8 -3
- package/src/orch/prompt.ts +3 -1
- package/src/orch/runtime.ts +28 -15
- package/src/prefs/config.ts +47 -149
- package/src/prefs/models.ts +2 -5
- package/src/prefs/settings.ts +121 -55
- package/src/ui/agent-navigation-editor.ts +20 -10
- package/src/ui/cost-footer.ts +5 -2
- package/src/ui/dialog.ts +44 -58
- package/src/ui/model-picker.ts +17 -5
- package/src/ui/settings-ui.ts +360 -216
- package/src/ui/status-ui.ts +14 -11
- package/src/ui/ui.ts +32 -24
package/src/ui/status-ui.ts
CHANGED
|
@@ -140,15 +140,14 @@ export class StatusDialog {
|
|
|
140
140
|
|
|
141
141
|
private syncRefresh(): void {
|
|
142
142
|
if (!this.refreshing) return;
|
|
143
|
-
const delay =
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
(thread)
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
: 1000;
|
|
143
|
+
const delay = this.service
|
|
144
|
+
.list()
|
|
145
|
+
.some(
|
|
146
|
+
(thread) =>
|
|
147
|
+
thread.path !== ROOT && (thread.state === "starting" || thread.state === "running"),
|
|
148
|
+
)
|
|
149
|
+
? AGENT_PROGRESS_INTERVAL
|
|
150
|
+
: 1000;
|
|
152
151
|
if (this.timer !== undefined && this.refreshDelay === delay) return;
|
|
153
152
|
this.stopRefresh();
|
|
154
153
|
this.refreshDelay = delay;
|
|
@@ -317,7 +316,9 @@ export class StatusDialog {
|
|
|
317
316
|
? truncateToWidth(metrics, width, "")
|
|
318
317
|
: (() => {
|
|
319
318
|
const left = truncateToWidth(identityLine, width - metricWidth - 1);
|
|
320
|
-
return
|
|
319
|
+
return (
|
|
320
|
+
left + " ".repeat(Math.max(1, width - visibleWidth(left) - metricWidth)) + metrics
|
|
321
|
+
);
|
|
321
322
|
})();
|
|
322
323
|
const second = truncateToWidth(
|
|
323
324
|
this.theme.fg(inactive ? base : selected ? "accent" : "muted", activity),
|
|
@@ -363,7 +364,9 @@ export class StatusDialog {
|
|
|
363
364
|
height,
|
|
364
365
|
this.heading(rows, start, treeCount),
|
|
365
366
|
body,
|
|
366
|
-
this.navigation
|
|
367
|
+
this.navigation
|
|
368
|
+
? "Esc main · ↑↓ select · ←→ fold · → widget · i Actions · Ctrl+C stop all"
|
|
369
|
+
: FOOTER,
|
|
367
370
|
);
|
|
368
371
|
}
|
|
369
372
|
|
package/src/ui/ui.ts
CHANGED
|
@@ -21,12 +21,7 @@ import {
|
|
|
21
21
|
truncateToWidth,
|
|
22
22
|
visibleWidth,
|
|
23
23
|
} from "@earendil-works/pi-tui";
|
|
24
|
-
import {
|
|
25
|
-
AGENT_COLORS,
|
|
26
|
-
ConfigStore,
|
|
27
|
-
parseAgentType,
|
|
28
|
-
serializeAgentType,
|
|
29
|
-
} from "../prefs/config.ts";
|
|
24
|
+
import { AGENT_COLORS, ConfigStore, parseAgentType, serializeAgentType } from "../prefs/config.ts";
|
|
30
25
|
import { editModelPreferences, MODEL_EDITOR_CANCEL } from "./model-picker.ts";
|
|
31
26
|
import { editToolSelection, TOOL_EDITOR_CANCEL, type ToolEditorOptions } from "./tool-picker.ts";
|
|
32
27
|
import {
|
|
@@ -43,7 +38,13 @@ import type { LoaderStyle, WidgetMode } from "../prefs/settings.ts";
|
|
|
43
38
|
import { AGENT_PROGRESS_INTERVAL, agentProgressIcon, isAgentLoaderGlyph } from "./agent-loader.ts";
|
|
44
39
|
export { AGENT_PROGRESS_INTERVAL, agentProgressIcon } from "./agent-loader.ts";
|
|
45
40
|
import { buildStatusTree, lastStarted, threadActivity, type StatusRow } from "./thread-tree.ts";
|
|
46
|
-
import {
|
|
41
|
+
import {
|
|
42
|
+
THINKING_LEVELS,
|
|
43
|
+
type AgentType,
|
|
44
|
+
type ResolvedAgentSettings,
|
|
45
|
+
type ThreadService,
|
|
46
|
+
type ThreadView,
|
|
47
|
+
} from "../types.ts";
|
|
47
48
|
|
|
48
49
|
export type ThreadController = Pick<
|
|
49
50
|
ThreadService,
|
|
@@ -423,7 +424,9 @@ export function renderAgentSummary(
|
|
|
423
424
|
return theme.fg(color, `${progress ? `${progress} ` : ""}${counts[state]} ${state}`);
|
|
424
425
|
})
|
|
425
426
|
.join(theme.fg("muted", ", ")) +
|
|
426
|
-
(showBrowserHint && counts.running > 0
|
|
427
|
+
(showBrowserHint && counts.running > 0
|
|
428
|
+
? theme.fg("muted", expandHint ? " · ← expand" : " · ← browser")
|
|
429
|
+
: "");
|
|
427
430
|
const right = theme.fg("muted", `↑${formatCount(input)} ↓${formatCount(output)}`);
|
|
428
431
|
return [fitLine(left, right, Math.max(0, width))];
|
|
429
432
|
}
|
|
@@ -1055,12 +1058,10 @@ export async function editAgentTypes(
|
|
|
1055
1058
|
|
|
1056
1059
|
function agentSourceHelp(store: ConfigStore, name: string): string {
|
|
1057
1060
|
const layers = store.getLayers(name);
|
|
1058
|
-
const paths = layers
|
|
1059
|
-
`${layer.source ?? "user"} · ${layer.filePath ?? ""}
|
|
1060
|
-
|
|
1061
|
-
return layers.length > 1
|
|
1062
|
-
? `${layers.map((layer) => layer.source).join(" → ")}\n${paths}`
|
|
1063
|
-
: paths;
|
|
1061
|
+
const paths = layers
|
|
1062
|
+
.map((layer) => `${layer.source ?? "user"} · ${layer.filePath ?? ""}`)
|
|
1063
|
+
.join("\n");
|
|
1064
|
+
return layers.length > 1 ? `${layers.map((layer) => layer.source).join(" → ")}\n${paths}` : paths;
|
|
1064
1065
|
}
|
|
1065
1066
|
|
|
1066
1067
|
function agentSettingsIndicators(
|
|
@@ -1072,23 +1073,26 @@ function agentSettingsIndicators(
|
|
|
1072
1073
|
const settings = store.getSettingsOverride(name, scope);
|
|
1073
1074
|
if (!settings) return false;
|
|
1074
1075
|
if (action === "tools.allow" || action === "tools.block") {
|
|
1075
|
-
return
|
|
1076
|
-
|
|
1076
|
+
return (
|
|
1077
|
+
Object.hasOwn(settings, "tools") &&
|
|
1078
|
+
(settings.tools === null || Object.hasOwn(settings.tools ?? {}, action.split(".")[1]!))
|
|
1079
|
+
);
|
|
1077
1080
|
}
|
|
1078
1081
|
return Object.hasOwn(settings, action);
|
|
1079
1082
|
};
|
|
1080
1083
|
const global = hasKey("user");
|
|
1081
1084
|
const project = hasKey("project");
|
|
1082
1085
|
return (theme) =>
|
|
1083
|
-
(global ? theme.fg("accent", "●") : " ") + " " +
|
|
1084
|
-
(project ? theme.fg("warning", "●") : " ");
|
|
1086
|
+
(global ? theme.fg("accent", "●") : " ") + " " + (project ? theme.fg("warning", "●") : " ");
|
|
1085
1087
|
}
|
|
1086
1088
|
|
|
1087
1089
|
function agentSettingsLegend(theme: Theme): string {
|
|
1088
1090
|
const global = theme.fg("accent", "●");
|
|
1089
1091
|
const project = theme.fg("warning", "●");
|
|
1090
|
-
return
|
|
1091
|
-
|
|
1092
|
+
return (
|
|
1093
|
+
theme.fg("muted", "Saved: ") +
|
|
1094
|
+
`${global} Global · ${project} Current Project · ${global} ${project} Both`
|
|
1095
|
+
);
|
|
1092
1096
|
}
|
|
1093
1097
|
|
|
1094
1098
|
async function editAgentTypesDialog(
|
|
@@ -1150,9 +1154,10 @@ async function editAgentTypesDialog(
|
|
|
1150
1154
|
return {
|
|
1151
1155
|
id: action,
|
|
1152
1156
|
label: EDIT_FIELD_LABELS[action],
|
|
1153
|
-
renderIndicators:
|
|
1154
|
-
|
|
1155
|
-
|
|
1157
|
+
renderIndicators:
|
|
1158
|
+
editMode === "override" && original
|
|
1159
|
+
? agentSettingsIndicators(store, original.name, action)
|
|
1160
|
+
: undefined,
|
|
1156
1161
|
valueColor: action === "Save" && dirty ? ("warning" as const) : undefined,
|
|
1157
1162
|
value:
|
|
1158
1163
|
action === "Customization"
|
|
@@ -1161,7 +1166,10 @@ async function editAgentTypesDialog(
|
|
|
1161
1166
|
? "(changes)"
|
|
1162
1167
|
: action === "Source"
|
|
1163
1168
|
? original
|
|
1164
|
-
? store
|
|
1169
|
+
? store
|
|
1170
|
+
.getLayers(original.name)
|
|
1171
|
+
.map((layer) => layer.source)
|
|
1172
|
+
.join(" → ")
|
|
1165
1173
|
: "New draft"
|
|
1166
1174
|
: action === "Save scope"
|
|
1167
1175
|
? saveScope === "user"
|