@xzzpig/pi-subagents 0.16.0 → 0.19.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 +233 -1
- package/README.md +5 -3
- package/agents/claude-code-writer.md +1 -0
- package/agents/codex-exec-writer.md +1 -0
- package/agents/cursor-agent-writer.md +1 -0
- package/agents/reviewer.md +3 -2
- package/agents/worker.md +3 -2
- package/docs/agents.md +34 -21
- package/docs/configuration.md +82 -7
- package/docs/extension-api.md +75 -8
- package/docs/missions.md +13 -13
- package/docs/models.md +7 -5
- package/docs/observability.md +23 -13
- package/docs/standalone-background.md +5 -5
- package/docs/tool-reference.md +98 -100
- package/docs/watchdog.md +2 -0
- package/docs/workflows.md +214 -162
- package/inspector-runner.mjs +1 -1
- package/node_modules/@xzzpig/pi-components/package.json +4 -4
- package/package.json +15 -9
- package/prompts/council.md +6 -3
- package/prompts/review-loop.md +1 -1
- package/runner-peer-loader.mjs +4 -7
- package/runner-peer-preload.mjs +5 -7
- package/skills/council-mode/SKILL.md +1 -1
- package/skills/pi-subagents/SKILL.md +13 -5
- package/skills/pi-subagents/references/constraints-and-recipes.md +8 -5
- package/skills/pi-subagents/references/execution-controls.md +72 -69
- package/skills/pi-subagents/references/management-authoring-rpc.md +4 -4
- package/skills/pi-subagents/references/multi-lane-orchestration.md +9 -1
- package/skills/pi-subagents/references/prompting-and-roles.md +52 -54
- package/src/agents/advertised-agent-prompt.ts +21 -41
- package/src/agents/agent-eject.ts +3 -3
- package/src/agents/agent-management.ts +63 -54
- package/src/agents/agent-memory.ts +90 -3
- package/src/agents/agent-serializer.ts +4 -4
- package/src/agents/agents.ts +132 -51
- package/src/agents/global-npm-root.ts +58 -0
- package/src/agents/proactive-skills.ts +4 -1
- package/src/agents/runtime-agent-registry.ts +14 -11
- package/src/agents/skills.ts +42 -9
- package/src/api/delegation.ts +15 -0
- package/src/api/inspectors.ts +27 -0
- package/src/api/preflight.ts +7 -2
- package/src/extension/config.ts +12 -4
- package/src/extension/control-notices.ts +3 -0
- package/src/extension/doctor.ts +10 -4
- package/src/extension/fanout-child.ts +20 -3
- package/src/extension/herdr-pi-bridge.ts +2 -0
- package/src/extension/index.ts +168 -206
- package/src/extension/public-execution.ts +69 -35
- package/src/extension/reply-workflow-script.ts +58 -0
- package/src/extension/rpc.ts +39 -11
- package/src/extension/schemas.ts +47 -138
- package/src/extension/subagent-guide.ts +12 -4
- package/src/extension/tool-activation.ts +146 -0
- package/src/extension/tool-description.ts +62 -27
- package/src/extension/upgrade-notice.ts +40 -0
- package/src/inspectors/ghostty/plugin.ts +13 -1
- package/src/inspectors/plugins.ts +70 -3
- package/src/integrations/herdr-status.ts +19 -3
- package/src/intercom/intercom-bridge.ts +2 -0
- package/src/intercom/native-supervisor-channel.ts +26 -16
- package/src/intercom/result-intercom.ts +4 -0
- package/src/runs/background/active-async-capacity.ts +3 -25
- package/src/runs/background/async-execution.ts +60 -95
- package/src/runs/background/async-job-tracker.ts +91 -56
- package/src/runs/background/async-resume.ts +16 -8
- package/src/runs/background/async-retention.ts +46 -16
- package/src/runs/background/async-status.ts +2 -0
- package/src/runs/background/await-async-run.ts +76 -0
- package/src/runs/background/binary-bootstrap.ts +34 -6
- package/src/runs/background/chain-root-attachment.ts +4 -4
- package/src/runs/background/control-channel.ts +18 -2
- package/src/runs/background/fleet-view.ts +51 -7
- package/src/runs/background/notify.ts +98 -7
- package/src/runs/background/pid-namespace.ts +18 -0
- package/src/runs/background/process-terminal-candidate.ts +98 -0
- package/src/runs/background/process-terminal.ts +17 -96
- package/src/runs/background/result-watcher.ts +1 -1
- package/src/runs/background/retained-children.ts +3 -2
- package/src/runs/background/run-child-session.ts +20 -6
- package/src/runs/background/run-id-resolver.ts +10 -5
- package/src/runs/background/run-status.ts +16 -4
- package/src/runs/background/runner-aliases.ts +54 -16
- package/src/runs/background/runner-child-launch.ts +4 -2
- package/src/runs/background/runner-startup-failure.ts +56 -0
- package/src/runs/background/scheduled-runs.ts +5 -5
- package/src/runs/background/stale-run-reconciler.ts +19 -3
- package/src/runs/background/subagent-runner-bootstrap.ts +276 -0
- package/src/runs/background/subagent-runner.ts +111 -288
- package/src/runs/background/wait-tool.ts +2 -0
- package/src/runs/background/workflow-terminal-proof.ts +68 -0
- package/src/runs/foreground/async-stop-action.ts +17 -3
- package/src/runs/foreground/execution.ts +111 -139
- package/src/runs/foreground/prompt-audit.ts +3 -9
- package/src/runs/foreground/subagent-executor.ts +715 -258
- package/src/runs/shared/acceptance.ts +167 -68
- package/src/runs/shared/async-status-projection.ts +5 -0
- package/src/runs/shared/capability-ceiling.ts +4 -1
- package/src/runs/shared/child-hooks.ts +1 -16
- package/src/runs/shared/child-launch.ts +37 -16
- package/src/runs/shared/child-runtime-config.ts +3 -0
- package/src/runs/shared/child-session.ts +144 -8
- package/src/runs/shared/child-tool-plan.ts +38 -116
- package/src/runs/shared/dynamic-fanout.ts +1 -1
- package/src/runs/shared/external-cli-runner.ts +3 -1
- package/src/runs/shared/external-job-bridge.ts +54 -0
- package/src/runs/shared/git-environment.ts +29 -0
- package/src/runs/shared/mcp-config-sources.ts +5 -1
- package/src/runs/shared/mcp-direct-tool-allowlist.ts +104 -12
- package/src/runs/shared/mcp-direct-tool-grant.ts +22 -6
- package/src/runs/shared/model-resolution.ts +35 -10
- package/src/runs/shared/model-scope.ts +28 -9
- package/src/runs/shared/nested-events.ts +12 -0
- package/src/runs/shared/orca-progress-tabs.ts +3 -2
- package/src/runs/shared/parallel-utils.ts +4 -1
- package/src/runs/shared/pi-spawn.ts +1 -3
- package/src/runs/shared/single-output.ts +11 -2
- package/src/runs/shared/structured-output.ts +227 -7
- package/src/runs/shared/subagent-control.ts +2 -16
- package/src/runs/shared/subagent-prompt-runtime.ts +29 -5
- package/src/runs/shared/tool-availability.ts +2 -2
- package/src/runs/shared/tool-budget.ts +21 -0
- package/src/runs/shared/usage-reconciliation.ts +73 -0
- package/src/runs/shared/worktree.ts +36 -9
- package/src/shared/child-session-name.ts +4 -2
- package/src/shared/disabled-features.ts +123 -0
- package/src/shared/extension-context.ts +13 -0
- package/src/shared/fork-context.ts +11 -4
- package/src/shared/launch-contract.ts +1 -1
- package/src/shared/model-info.ts +9 -0
- package/src/shared/pruned-fork.ts +69 -56
- package/src/shared/settings.ts +1 -1
- package/src/shared/types.ts +73 -16
- package/src/slash/delegation-adapters.ts +25 -1
- package/src/slash/prompt-template-bridge.ts +18 -3
- package/src/slash/prompt-workflows.ts +12 -1
- package/src/slash/slash-commands.ts +17 -246
- package/src/slash/subagent-cost.ts +313 -0
- package/src/slash/subagents-admin.ts +4 -5
- package/src/tui/fleet-status.ts +38 -8
- package/src/tui/fleet.ts +21 -6
- package/src/tui/render.ts +166 -71
- package/src/tui/running-tone.ts +28 -0
- package/src/watchdog/diff-tool.ts +47 -12
- package/src/watchdog/permission-arbiter.ts +13 -15
- package/src/watchdog/register-child.ts +13 -5
- package/src/watchdog/register-main.ts +3 -3
- package/src/watchdog/review.ts +16 -16
- package/src/watchdog/runtime.ts +2 -1
- package/src/watchdog/turn-delta.ts +12 -6
- package/src/workflows/chat-progress.ts +2 -2
- package/src/workflows/scripted-workflow.ts +225 -59
- package/src/workflows/structured-workflow-scripts.ts +177 -0
- package/src/workflows/workflow-checklist.ts +6 -0
- package/src/workflows/workflow-child-summary.ts +4 -2
- package/src/workflows/workflow-receipt.ts +8 -2
- package/src/workflows/workflow-resources.ts +37 -12
- package/src/workflows/workflow-reuse.ts +120 -0
- package/src/workflows/workflow-revival.ts +123 -0
- package/src/workflows/workflow-settlement.ts +4 -1
- package/src/runs/shared/completion-evidence.ts +0 -89
- package/src/runs/shared/completion-guard.ts +0 -255
- package/src/runs/shared/llm-intent-arbiter.ts +0 -321
- package/src/runs/shared/task-intent.ts +0 -244
|
@@ -38,12 +38,12 @@ function sourceRank(source: AgentConfig["source"]): number {
|
|
|
38
38
|
return 3;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
function allVisibleAgents(pi: RuntimeAgentOwner, cwd: string): AgentConfig[] {
|
|
42
|
-
const d = discoverAgentsAll(cwd);
|
|
41
|
+
function allVisibleAgents(pi: RuntimeAgentOwner, cwd: string, preferredModelProvider?: string): AgentConfig[] {
|
|
42
|
+
const d = discoverAgentsAll(cwd, preferredModelProvider);
|
|
43
43
|
const allConfigured = [...d.project, ...d.user, ...d.package, ...d.builtin];
|
|
44
44
|
const visibleConfigured = allConfigured.filter((agent) => !agent.disabled);
|
|
45
45
|
// Disabled definitions remain in collision checks even though the panel hides them.
|
|
46
|
-
const agents = mergeRuntimeAgents(pi, { agents: visibleConfigured }, allConfigured).agents;
|
|
46
|
+
const agents = mergeRuntimeAgents(pi, { agents: visibleConfigured }, allConfigured, { cwd, scope: "both", preferredModelProvider }).agents;
|
|
47
47
|
return agents.sort((a, b) => a.name.localeCompare(b.name) || sourceRank(a.source) - sourceRank(b.source));
|
|
48
48
|
}
|
|
49
49
|
|
|
@@ -125,7 +125,6 @@ function buildBuiltinBase(agent: AgentConfig): BuiltinAgentOverrideBase {
|
|
|
125
125
|
...(agent.mcpDirectTools !== undefined ? { mcpDirectTools: [...agent.mcpDirectTools] } : {}),
|
|
126
126
|
...(agent.subagentOnlyExtensions !== undefined ? { subagentOnlyExtensions: [...agent.subagentOnlyExtensions] } : {}),
|
|
127
127
|
...(agent.mutationTools !== undefined ? { mutationTools: [...agent.mutationTools] } : {}),
|
|
128
|
-
...(agent.completionGuard !== undefined ? { completionGuard: agent.completionGuard } : {}),
|
|
129
128
|
...(agent.toolBudget !== undefined ? { toolBudget: agent.toolBudget } : {}),
|
|
130
129
|
};
|
|
131
130
|
}
|
|
@@ -176,7 +175,7 @@ function readOnlyAgentMessage(agent: AgentConfig, field: EditableOverrideField):
|
|
|
176
175
|
}
|
|
177
176
|
|
|
178
177
|
async function selectAgent(pi: RuntimeAgentOwner, ctx: ExtensionContext, args: string): Promise<AgentSelection> {
|
|
179
|
-
const agents = allVisibleAgents(pi, ctx.cwd);
|
|
178
|
+
const agents = allVisibleAgents(pi, ctx.cwd, ctx.model?.provider);
|
|
180
179
|
const requestedName = args.trim().split(/\s+/)[0] ?? "";
|
|
181
180
|
if (agents.length === 0) return { kind: "not-found", agents, requestedName: requestedName || undefined };
|
|
182
181
|
|
package/src/tui/fleet-status.ts
CHANGED
|
@@ -9,6 +9,8 @@ import { formatWorkflowJsonPreview } from "../workflows/scripted-workflow.ts";
|
|
|
9
9
|
import { hostStepReportName, hostStepVerdictLabel } from "../runs/shared/host-step-status.ts";
|
|
10
10
|
import { isStaleExtensionContextError } from "../shared/extension-context.ts";
|
|
11
11
|
import { inlineWorkflowRenderKey } from "./render.ts";
|
|
12
|
+
import { runningTone } from "./running-tone.ts";
|
|
13
|
+
import { childThinkingLevel, type ThinkingLevel } from "../shared/model-info.ts";
|
|
12
14
|
import { formatWorkflowChecklistBottleneck, formatWorkflowChecklistPhase, formatWorkflowChecklistSummary, projectWorkflowChecklist, type WorkflowChecklistPhase, type WorkflowChecklistProjection } from "../workflows/workflow-checklist.ts";
|
|
13
15
|
|
|
14
16
|
export const FLEET_STATUS_WIDGET_KEY = "subagent-fleet-status";
|
|
@@ -75,6 +77,8 @@ type FleetNestedRow = {
|
|
|
75
77
|
agentIdentity?: string;
|
|
76
78
|
state: NestedRunSummary["state"] | NestedStepSummary["status"];
|
|
77
79
|
modelThinking?: string;
|
|
80
|
+
/** Thinking level of the child this row stands for; it colors the running glyph. */
|
|
81
|
+
thinking?: ThinkingLevel;
|
|
78
82
|
activity?: string;
|
|
79
83
|
startedAt?: number;
|
|
80
84
|
endedAt?: number;
|
|
@@ -178,8 +182,8 @@ function isWorkflowRowTerminal(row: AsyncStatusWorkflowRow): boolean {
|
|
|
178
182
|
return row.state === "complete" || row.state === "completed";
|
|
179
183
|
}
|
|
180
184
|
|
|
181
|
-
function nestedStatusGlyph(state: FleetNestedRow["state"] | "planned", theme: Theme): string {
|
|
182
|
-
if (state === "running") return theme
|
|
185
|
+
function nestedStatusGlyph(state: FleetNestedRow["state"] | "planned", theme: Theme, thinking?: ThinkingLevel): string {
|
|
186
|
+
if (state === "running") return runningTone(theme, thinking)("●");
|
|
183
187
|
if (state === "queued" || state === "pending" || state === "planned") return theme.fg("muted", "◦");
|
|
184
188
|
if (state === "complete" || state === "completed") return theme.fg("success", "✓");
|
|
185
189
|
if (state === "failed" || state === "rejected") return theme.fg("error", "✗");
|
|
@@ -222,6 +226,7 @@ function nestedFleetRows(children: NestedRunSummary[] | undefined, visibleLimit:
|
|
|
222
226
|
}
|
|
223
227
|
const step = steps[stepIndex]!;
|
|
224
228
|
const modelThinking = formatModelThinking(step.model, step.thinking) || undefined;
|
|
229
|
+
const thinking = childThinkingLevel(step);
|
|
225
230
|
const activity = nestedActivity(step);
|
|
226
231
|
rows.push({
|
|
227
232
|
name: step.agent,
|
|
@@ -229,6 +234,7 @@ function nestedFleetRows(children: NestedRunSummary[] | undefined, visibleLimit:
|
|
|
229
234
|
state: step.status,
|
|
230
235
|
depth,
|
|
231
236
|
...(modelThinking ? { modelThinking } : {}),
|
|
237
|
+
...(thinking ? { thinking } : {}),
|
|
232
238
|
...(activity ? { activity } : {}),
|
|
233
239
|
...(step.startedAt !== undefined ? { startedAt: step.startedAt } : {}),
|
|
234
240
|
...(step.endedAt !== undefined ? { endedAt: step.endedAt } : {}),
|
|
@@ -246,6 +252,7 @@ function nestedFleetRows(children: NestedRunSummary[] | undefined, visibleLimit:
|
|
|
246
252
|
return false;
|
|
247
253
|
}
|
|
248
254
|
const modelThinking = formatModelThinking(child.model, child.thinking) || undefined;
|
|
255
|
+
const thinking = childThinkingLevel(child);
|
|
249
256
|
const activity = nestedActivity(child);
|
|
250
257
|
rows.push({
|
|
251
258
|
name: nestedRunLabel(child),
|
|
@@ -253,6 +260,7 @@ function nestedFleetRows(children: NestedRunSummary[] | undefined, visibleLimit:
|
|
|
253
260
|
state: child.state,
|
|
254
261
|
depth,
|
|
255
262
|
...(modelThinking ? { modelThinking } : {}),
|
|
263
|
+
...(thinking ? { thinking } : {}),
|
|
256
264
|
...(activity ? { activity } : {}),
|
|
257
265
|
...(child.startedAt !== undefined ? { startedAt: child.startedAt } : {}),
|
|
258
266
|
...(child.endedAt !== undefined ? { endedAt: child.endedAt } : {}),
|
|
@@ -538,6 +546,8 @@ export class SubagentFleetStatus {
|
|
|
538
546
|
private selectedKey = "main";
|
|
539
547
|
private inspectorOpen = false;
|
|
540
548
|
private lastRenderKey = "";
|
|
549
|
+
private lastPaint: { width: number; theme: Theme } | undefined;
|
|
550
|
+
private prepaint: { key: string; width: number; theme: Theme; lines: string[] } | undefined;
|
|
541
551
|
private entries: FleetStatusEntry[] = [];
|
|
542
552
|
private workflowSnapshots = new Map<string, { snapshot: string; childRows: Set<string> }>();
|
|
543
553
|
private readonly onWorkflowCoverageChange: FleetStatusOptions["onWorkflowCoverageChange"];
|
|
@@ -594,6 +604,7 @@ export class SubagentFleetStatus {
|
|
|
594
604
|
}
|
|
595
605
|
|
|
596
606
|
refresh(): void {
|
|
607
|
+
this.prepaint = undefined;
|
|
597
608
|
const ctx = this.getActiveUiContext();
|
|
598
609
|
if (!ctx) return;
|
|
599
610
|
if (this.state.widgetsSuspended) {
|
|
@@ -662,17 +673,34 @@ export class SubagentFleetStatus {
|
|
|
662
673
|
}
|
|
663
674
|
|
|
664
675
|
const renderKey = this.getRenderKey();
|
|
665
|
-
if (!this.active
|
|
676
|
+
if (!this.active) this.clearWorkflowCoverage();
|
|
677
|
+
// The async widget paints above the roster, so recompute coverage (structure and row fit) now.
|
|
678
|
+
// Clearing it instead would flash the full workflow tree on every live-stat tick.
|
|
679
|
+
else if (renderKey !== this.lastRenderKey && this.lastPaint) {
|
|
680
|
+
const { width, theme } = this.lastPaint;
|
|
681
|
+
this.prepaint = { key: renderKey, width, theme, lines: this.render(width, theme) };
|
|
682
|
+
}
|
|
666
683
|
if (!this.widgetRegistered) {
|
|
667
684
|
ctx.ui.setWidget(FLEET_STATUS_WIDGET_KEY, (tui, theme) => {
|
|
668
685
|
this.tui = tui;
|
|
669
686
|
return {
|
|
670
|
-
render: (width: number) =>
|
|
687
|
+
render: (width: number) => {
|
|
688
|
+
this.lastPaint = { width, theme };
|
|
689
|
+
const prepaint = this.prepaint;
|
|
690
|
+
this.prepaint = undefined;
|
|
691
|
+
if (prepaint && prepaint.key === this.lastRenderKey && prepaint.key === this.getRenderKey()
|
|
692
|
+
&& prepaint.width === width && prepaint.theme === theme && !this.state.widgetsSuspended
|
|
693
|
+
&& !this.inspectorOpen && !this.state.fleetInspectorOpen) return prepaint.lines;
|
|
694
|
+
return this.render(width, theme);
|
|
695
|
+
},
|
|
671
696
|
invalidate: () => {
|
|
672
697
|
this.lastRenderKey = "";
|
|
698
|
+
this.prepaint = undefined;
|
|
673
699
|
},
|
|
674
700
|
dispose: () => {
|
|
675
701
|
if (this.tui !== tui) return;
|
|
702
|
+
this.prepaint = undefined;
|
|
703
|
+
this.lastPaint = undefined;
|
|
676
704
|
this.clearWorkflowCoverage();
|
|
677
705
|
this.widgetRegistered = false;
|
|
678
706
|
this.tui = undefined;
|
|
@@ -876,13 +904,13 @@ export class SubagentFleetStatus {
|
|
|
876
904
|
if (row.overflow !== undefined) return truncateToWidth(`${indent}${marker} ${theme.fg("dim", `+${row.overflow} nested leaves`)}`, width);
|
|
877
905
|
const modelThinking = row.modelThinking ? ` (${row.modelThinking})` : "";
|
|
878
906
|
const activity = row.activity ? ` · ${row.activity}` : "";
|
|
879
|
-
const left = `${indent}${marker} ${nestedStatusGlyph(row.state, theme)} ${theme.fg(fleetAgentIdentityColor(row.agentIdentity ?? row.name), `${row.name}${modelThinking}`)} · ${row.state}${activity}`;
|
|
907
|
+
const left = `${indent}${marker} ${nestedStatusGlyph(row.state, theme, row.thinking)} ${theme.fg(fleetAgentIdentityColor(row.agentIdentity ?? row.name), `${row.name}${modelThinking}`)} · ${row.state}${activity}`;
|
|
880
908
|
const elapsed = detailElapsed(row);
|
|
881
909
|
return truncateToWidth(`${left}${elapsed !== undefined ? theme.fg("dim", ` · ${elapsed}`) : ""}`, width);
|
|
882
910
|
}
|
|
883
911
|
|
|
884
912
|
private workflowRowGlyph(row: AsyncStatusWorkflowRow, theme: Theme): string {
|
|
885
|
-
if (!row.kind) return nestedStatusGlyph(row.state as FleetNestedRow["state"], theme);
|
|
913
|
+
if (!row.kind) return nestedStatusGlyph(row.state as FleetNestedRow["state"], theme, row.thinking);
|
|
886
914
|
const state = row.state as HostStepState;
|
|
887
915
|
if (state === "pending") return theme.fg("muted", "◦");
|
|
888
916
|
if (state === "running") return theme.fg("accent", "●");
|
|
@@ -893,7 +921,7 @@ export class SubagentFleetStatus {
|
|
|
893
921
|
|
|
894
922
|
private workflowRowStateLabel(row: AsyncStatusWorkflowRow, theme: Theme): string {
|
|
895
923
|
const state = row.kind ? hostStepVerdictLabel(row.state as HostStepState, row.verdict as HostStepVerdict | undefined) : row.state;
|
|
896
|
-
if (state === "running") return theme.fg("accent", state);
|
|
924
|
+
if (state === "running") return row.kind ? theme.fg("accent", state) : runningTone(theme, row.thinking)(state);
|
|
897
925
|
if (state === "pending" || state === "queued") return theme.fg("muted", state);
|
|
898
926
|
if (state === "pass" || state === "complete" || state === "completed") return theme.fg("success", state === "pass" ? "pass" : "complete");
|
|
899
927
|
if (state === "fail" || state === "failed" || state === "error") return theme.fg("error", state === "fail" ? "fail" : state);
|
|
@@ -905,7 +933,7 @@ export class SubagentFleetStatus {
|
|
|
905
933
|
const glyph = phase.state === "complete"
|
|
906
934
|
? theme.fg("success", "✓")
|
|
907
935
|
: phase.state === "running"
|
|
908
|
-
? theme
|
|
936
|
+
? runningTone(theme)("●")
|
|
909
937
|
: phase.state === "blocked" || phase.state === "failed"
|
|
910
938
|
? theme.fg("error", phase.state === "blocked" ? "!" : "✗")
|
|
911
939
|
: phase.state === "queued"
|
|
@@ -1057,6 +1085,7 @@ export class SubagentFleetStatus {
|
|
|
1057
1085
|
}
|
|
1058
1086
|
|
|
1059
1087
|
private clearWidget(): void {
|
|
1088
|
+
this.prepaint = undefined;
|
|
1060
1089
|
this.clearWorkflowCoverage();
|
|
1061
1090
|
if (!this.widgetRegistered) return;
|
|
1062
1091
|
try {
|
|
@@ -1071,6 +1100,7 @@ export class SubagentFleetStatus {
|
|
|
1071
1100
|
}
|
|
1072
1101
|
|
|
1073
1102
|
private clearUiRegistration(): void {
|
|
1103
|
+
this.prepaint = undefined;
|
|
1074
1104
|
this.clearWorkflowCoverage();
|
|
1075
1105
|
if (this.timer) clearInterval(this.timer);
|
|
1076
1106
|
this.timer = undefined;
|
package/src/tui/fleet.ts
CHANGED
|
@@ -23,8 +23,10 @@ import { stopAsyncRun } from "../runs/foreground/async-stop-action.ts";
|
|
|
23
23
|
import { resolveWorkflowForegroundSteeringTarget, steerWorkflowForegroundTarget } from "../runs/foreground/workflow-foreground-steering.ts";
|
|
24
24
|
import { contextModeBadge, contextModeLabel } from "../runs/shared/context-mode.ts";
|
|
25
25
|
import { FLEET_STATUS_WIDGET_KEY } from "./fleet-status.ts";
|
|
26
|
-
import { readFleetTranscript, renderFleetTranscript } from "./fleet-transcript.ts";
|
|
26
|
+
import { readFleetTranscript, renderFleetTranscript, type FleetTranscript } from "./fleet-transcript.ts";
|
|
27
27
|
import { buildNativeFleetTranscript, loadNativeTranscriptSupport, type NativeTranscriptModule } from "./fleet-native-transcript.ts";
|
|
28
|
+
import { runningTone } from "./running-tone.ts";
|
|
29
|
+
import { childThinkingLevel, type ThinkingLevel } from "../shared/model-info.ts";
|
|
28
30
|
import { handleInspectorAction } from "../inspectors/actions.ts";
|
|
29
31
|
import type { InspectorPlugin } from "../inspectors/types.ts";
|
|
30
32
|
import { getLivePromptAudit, type LivePromptAudit, type PromptAuditView } from "../runs/foreground/prompt-audit.ts";
|
|
@@ -120,7 +122,7 @@ export interface FleetViewOptions {
|
|
|
120
122
|
fleetKeybindings?: FleetKeybindingsConfig;
|
|
121
123
|
actions?: FleetActionHandlers;
|
|
122
124
|
copyText?: (text: string) => Promise<void> | void;
|
|
123
|
-
inspectorPlugins?: readonly InspectorPlugin[];
|
|
125
|
+
inspectorPlugins?: () => readonly InspectorPlugin[];
|
|
124
126
|
inspectorEnv?: NodeJS.ProcessEnv;
|
|
125
127
|
/** Event bus used to claim the fleet dialog as a silent span. */
|
|
126
128
|
events?: UiSpanSilentEvents;
|
|
@@ -360,8 +362,18 @@ function visibleWorkflowParentKeyForForegroundKey(state: SubagentState, key: str
|
|
|
360
362
|
return undefined;
|
|
361
363
|
}
|
|
362
364
|
|
|
365
|
+
/** The recorded level of the one child a running Fleet row stands for; a whole run or an external run has none. */
|
|
366
|
+
function fleetItemThinkingLevel(item: FleetItem): ThinkingLevel | undefined {
|
|
367
|
+
switch (item.kind) {
|
|
368
|
+
case "foreground-active": return childThinkingLevel(item.activeChild ?? item.control);
|
|
369
|
+
case "foreground-recent": return childThinkingLevel(item.child);
|
|
370
|
+
case "async": return childThinkingLevel(item.step);
|
|
371
|
+
case "external": return undefined;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|
|
363
375
|
function statusGlyph(item: FleetItem, theme: Theme): string {
|
|
364
|
-
if (item.state === "running") return theme
|
|
376
|
+
if (item.state === "running") return runningTone(theme, fleetItemThinkingLevel(item))("●");
|
|
365
377
|
if (item.state === "queued" || item.state === "pending") return theme.fg("muted", "◦");
|
|
366
378
|
if (item.state === "complete" || item.state === "completed") return theme.fg("success", "✓");
|
|
367
379
|
if (item.state === "paused" || item.state === "stopped" || item.state === "detached") return theme.fg("warning", "■");
|
|
@@ -679,6 +691,9 @@ function transcriptTarget(item: FleetItem, state: SubagentState): { path: string
|
|
|
679
691
|
};
|
|
680
692
|
}
|
|
681
693
|
const step = item.step ?? (item.run.steps.length === 1 ? item.run.steps[0] : undefined);
|
|
694
|
+
// External CLI logs are plain text, not structured session JSONL. Let the
|
|
695
|
+
// bounded async detail formatter select final output/stderr/stdout instead.
|
|
696
|
+
if (step?.runner?.type === "external-cli") return undefined;
|
|
682
697
|
const recordedSessionFile = step?.sessionFile ?? item.run.sessionFile;
|
|
683
698
|
const recordedPath = step?.transcriptPath ?? recordedSessionFile;
|
|
684
699
|
if (!recordedPath) return undefined;
|
|
@@ -1544,7 +1559,7 @@ export async function openSubagentFleet(ctx: ExtensionContext, state: SubagentSt
|
|
|
1544
1559
|
cwd: state.baseCwd,
|
|
1545
1560
|
...(state.authorityPolicy ? { authorityPolicy: state.authorityPolicy } : {}),
|
|
1546
1561
|
...(state.missionStoreConfig ? { missions: state.missionStoreConfig } : {}),
|
|
1547
|
-
|
|
1562
|
+
plugins: options.inspectorPlugins?.(),
|
|
1548
1563
|
...(options.inspectorEnv ? { env: options.inspectorEnv } : {}),
|
|
1549
1564
|
}), `Failed to open inspector for async run ${input.runId}.`),
|
|
1550
1565
|
redoPrompt: async (input: { runId: string; index: number; guidance: string; control?: ForegroundRunControl }) => {
|
|
@@ -1574,8 +1589,8 @@ export interface OpenFleetFromStatusOptions {
|
|
|
1574
1589
|
asyncDirRoot: string;
|
|
1575
1590
|
resultsDir: string;
|
|
1576
1591
|
fleetKeybindings?: FleetKeybindingsConfig;
|
|
1577
|
-
/**
|
|
1578
|
-
inspectorPlugins?: readonly InspectorPlugin[];
|
|
1592
|
+
/** Lazy inspector plugins, when the caller hosts inspector integration. */
|
|
1593
|
+
inspectorPlugins?: () => readonly InspectorPlugin[];
|
|
1579
1594
|
}
|
|
1580
1595
|
|
|
1581
1596
|
/**
|