@xzzpig/pi-subagents 0.4.2 → 0.6.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 +172 -1
- package/README.md +8 -0
- package/agents/oracle.md +3 -1
- package/agents/reviewer.md +1 -0
- package/agents/scout.md +2 -2
- package/agents/worker.md +2 -1
- package/async-retention-discovery-worker.mjs +180 -0
- package/docs/agents.md +79 -2
- package/docs/configuration.md +42 -14
- package/docs/extension-api.md +45 -2
- package/docs/models.md +2 -0
- package/docs/observability.md +41 -5
- package/docs/tool-reference.md +38 -39
- package/docs/workflows.md +173 -3
- package/package.json +13 -10
- package/prompts/council.md +48 -0
- package/skills/council-mode/SKILL.md +230 -0
- package/skills/pi-subagents/SKILL.md +8 -4
- package/skills/pi-subagents/references/constraints-and-recipes.md +13 -6
- package/skills/pi-subagents/references/execution-controls.md +40 -15
- package/skills/pi-subagents/references/management-authoring-rpc.md +3 -3
- package/skills/pi-subagents/references/multi-lane-orchestration.md +39 -0
- package/skills/pi-subagents/references/prompting-and-roles.md +4 -2
- package/src/agents/agent-management.ts +158 -357
- package/src/agents/agent-serializer.ts +4 -0
- package/src/agents/agents.ts +227 -53
- package/src/agents/builtin-names.ts +9 -0
- package/src/agents/runtime-agent-registry.ts +422 -0
- package/src/agents/skills.ts +1 -1
- package/src/api/agents.ts +7 -0
- package/src/api/external-job-provider.ts +186 -0
- package/src/api/preflight.ts +37 -9
- package/src/api/shared-types.ts +2 -0
- package/src/extension/config.ts +6 -3
- package/src/extension/context-injection.ts +118 -0
- package/src/extension/doctor.ts +15 -6
- package/src/extension/fanout-child.ts +2 -2
- package/src/extension/index.ts +224 -90
- package/src/extension/public-execution.ts +31 -2
- package/src/extension/rpc.ts +41 -1
- package/src/extension/schemas.ts +17 -37
- package/src/extension/tool-description.ts +35 -24
- package/src/inspectors/herdr/actions.ts +2 -2
- package/src/inspectors/herdr/inspector-runner.ts +2 -1
- package/src/inspectors/herdr/project-panes.ts +2 -2
- package/src/intercom/native-supervisor-channel.ts +32 -10
- package/src/missions/lifecycle.ts +6 -1
- package/src/missions/store.ts +4 -9
- package/src/missions/workflow-state.ts +2 -2
- package/src/profiles/profiles.ts +3 -1
- package/src/runs/background/active-run-index.ts +31 -8
- package/src/runs/background/async-execution.ts +70 -41
- package/src/runs/background/async-job-tracker.ts +24 -7
- package/src/runs/background/async-resume.ts +49 -16
- package/src/runs/background/async-retention.ts +886 -0
- package/src/runs/background/async-status-snapshot.ts +14 -5
- package/src/runs/background/async-status.ts +39 -53
- package/src/runs/background/auto-drain.ts +1 -0
- package/src/runs/background/chain-append.ts +3 -33
- package/src/runs/background/completion-dedupe.ts +5 -1
- package/src/runs/background/completion-replay.ts +22 -12
- package/src/runs/background/control-channel.ts +14 -68
- package/src/runs/background/fleet-view.ts +68 -19
- package/src/runs/background/index-segment.ts +59 -0
- package/src/runs/background/inspect-rpc.ts +443 -0
- package/src/runs/background/notify.ts +31 -5
- package/src/runs/background/result-files.ts +158 -90
- package/src/runs/background/result-watcher.ts +124 -20
- package/src/runs/background/resume-guidance.ts +8 -5
- package/src/runs/background/retained-children.ts +13 -3
- package/src/runs/background/run-id-query.ts +7 -0
- package/src/runs/background/run-id-resolver.ts +11 -9
- package/src/runs/background/run-status.ts +27 -18
- package/src/runs/background/scheduled-runs.ts +24 -4
- package/src/runs/background/stale-run-reconciler.ts +6 -3
- package/src/runs/background/steering.ts +11 -1
- package/src/runs/background/subagent-runner.ts +260 -144
- package/src/runs/background/subagent-wait.ts +17 -13
- package/src/runs/background/terminal-run-index.ts +138 -0
- package/src/runs/background/wait-completions.ts +21 -4
- package/src/runs/background/wait-subscriptions.ts +81 -2
- package/src/runs/background/wait-tool.ts +1 -0
- package/src/runs/foreground/async-steering-action.ts +21 -14
- package/src/runs/foreground/execution.ts +8 -2
- package/src/runs/foreground/subagent-executor.ts +816 -1593
- package/src/runs/foreground/workflow-detach-reconcile.ts +262 -0
- package/src/runs/foreground/workflow-foreground-steering.ts +6 -5
- package/src/runs/shared/acceptance.ts +48 -5
- package/src/runs/shared/chain-outputs.ts +1 -3
- package/src/runs/shared/external-job-bridge.ts +444 -0
- package/src/runs/shared/external-job-runner.ts +286 -0
- package/src/runs/shared/mcp-direct-tool-allowlist.ts +14 -0
- package/src/runs/shared/model-exclusions.ts +242 -0
- package/src/runs/shared/model-fallback.ts +153 -40
- package/src/runs/shared/orca-progress-tabs.ts +84 -22
- package/src/runs/shared/parallel-handoff.ts +46 -4
- package/src/runs/shared/parallel-utils.ts +4 -15
- package/src/runs/shared/permissions.ts +5 -1
- package/src/runs/shared/pi-args.ts +8 -1
- package/src/runs/shared/session-lease.ts +0 -6
- package/src/runs/shared/subagent-control.ts +51 -7
- package/src/runs/shared/subagent-prompt-runtime.ts +12 -6
- package/src/runs/shared/workflow-graph.ts +1 -23
- package/src/runs/shared/worktree.ts +14 -2
- package/src/shared/atomic-json.ts +22 -2
- package/src/shared/capacity-resilient-json.ts +102 -0
- package/src/shared/completion-owner.ts +14 -0
- package/src/shared/file-system-retry.ts +49 -1
- package/src/shared/fork-context.ts +59 -1
- package/src/shared/model-info.ts +20 -0
- package/src/shared/prompt-resources.ts +0 -40
- package/src/shared/settings.ts +5 -29
- package/src/shared/types.ts +110 -26
- package/src/shared/utils.ts +8 -0
- package/src/shared/watch-strategy.ts +10 -0
- package/src/slash/slash-bridge.ts +2 -1
- package/src/slash/slash-commands.ts +47 -7
- package/src/slash/slash-live-state.ts +3 -3
- package/src/tui/fleet-status.ts +86 -1
- package/src/tui/fleet.ts +117 -16
- package/src/tui/render.ts +73 -3
- package/src/watchdog/change-signature.ts +1 -1
- package/src/watchdog/lsp-diagnostics.ts +1 -0
- package/src/workflows/chat-progress.ts +2 -2
- package/src/workflows/scripted-workflow.ts +320 -79
- package/src/workflows/workflow-receipt.ts +140 -0
- package/src/runs/foreground/chain-clarify.ts +0 -1354
- package/src/runs/foreground/chain-execution.ts +0 -1581
|
@@ -2,7 +2,7 @@ import * as fs from "node:fs";
|
|
|
2
2
|
import * as path from "node:path";
|
|
3
3
|
import { writeAtomicJson } from "../../shared/atomic-json.ts";
|
|
4
4
|
import { resultFilePath, resultPayloadPathForSessionRun, writeAsyncResultFile } from "./result-files.ts";
|
|
5
|
-
import {
|
|
5
|
+
import { updateActiveRunIndex } from "./active-run-index.ts";
|
|
6
6
|
import { readStatus } from "../../shared/utils.ts";
|
|
7
7
|
import { DIRS, type AsyncParallelGroupStatus, type AsyncStatus, type NestedRunSummary, type SubagentRunMode } from "../../shared/types.ts";
|
|
8
8
|
import { resolveEffectiveThinking } from "../../shared/model-info.ts";
|
|
@@ -17,6 +17,7 @@ interface StartedRunMetadata {
|
|
|
17
17
|
runId: string;
|
|
18
18
|
pid?: number;
|
|
19
19
|
sessionId?: string;
|
|
20
|
+
completionOwnerId?: string;
|
|
20
21
|
mode?: SubagentRunMode;
|
|
21
22
|
agents?: string[];
|
|
22
23
|
chainStepCount?: number;
|
|
@@ -190,6 +191,7 @@ function buildStartedStatus(asyncDir: string, startedRun: StartedRunMetadata, no
|
|
|
190
191
|
return {
|
|
191
192
|
runId: startedRun.runId || path.basename(asyncDir),
|
|
192
193
|
...(startedRun.sessionId ? { sessionId: startedRun.sessionId } : {}),
|
|
194
|
+
...(startedRun.completionOwnerId ? { completionOwnerId: startedRun.completionOwnerId } : {}),
|
|
193
195
|
mode: startedRun.mode ?? "single",
|
|
194
196
|
state: "running",
|
|
195
197
|
pid: startedRun.pid,
|
|
@@ -244,6 +246,7 @@ function buildFailedRepair(status: AsyncStatus, asyncDir: string, now: number, r
|
|
|
244
246
|
id: runId,
|
|
245
247
|
agent: resultAgent,
|
|
246
248
|
mode: status.mode,
|
|
249
|
+
...(status.completionOwnerId ? { completionOwnerId: status.completionOwnerId } : {}),
|
|
247
250
|
success: false,
|
|
248
251
|
state: "failed",
|
|
249
252
|
summary: message,
|
|
@@ -271,7 +274,7 @@ function writeFailedRepair(asyncDir: string, status: AsyncStatus, resultPath: st
|
|
|
271
274
|
const repair = buildFailedRepair(status, asyncDir, now, reason);
|
|
272
275
|
if (repair.result.sessionId) writeAsyncResultFile(resultPath, repair.result);
|
|
273
276
|
writeAtomicJson(path.join(asyncDir, "status.json"), repair.status);
|
|
274
|
-
|
|
277
|
+
updateActiveRunIndex(asyncDir, repair.status.state, repair.status.toolCallId);
|
|
275
278
|
appendJsonlBestEffort(path.join(asyncDir, "events.jsonl"), {
|
|
276
279
|
type: "subagent.run.repaired_stale",
|
|
277
280
|
ts: now,
|
|
@@ -365,7 +368,7 @@ export function reconcileAsyncRun(asyncDir: string, options: ReconcileAsyncRunOp
|
|
|
365
368
|
: undefined;
|
|
366
369
|
if (terminalStatus) {
|
|
367
370
|
writeAtomicJson(path.join(asyncDir, "status.json"), terminalStatus);
|
|
368
|
-
|
|
371
|
+
updateActiveRunIndex(asyncDir, terminalStatus.state, terminalStatus.toolCallId);
|
|
369
372
|
return { status: terminalStatus, repaired: true, resultPath: existingResultPath, message: "Existing async result file was used to repair stale running status." };
|
|
370
373
|
}
|
|
371
374
|
if (effectiveStatus.displayDismissedAt === undefined) return { status: effectiveStatus, repaired: false, resultPath: existingResultPath };
|
|
@@ -13,10 +13,20 @@ import type {
|
|
|
13
13
|
SteeringTargetStatus,
|
|
14
14
|
} from "../../shared/types.ts";
|
|
15
15
|
import { readStatus } from "../../shared/utils.ts";
|
|
16
|
+
import { previewDisplayText } from "../../shared/display-text.ts";
|
|
17
|
+
import { redactSecretValues } from "../shared/permissions.ts";
|
|
16
18
|
|
|
17
19
|
export const MAX_STEERING_REQUESTS = 20;
|
|
18
20
|
export const STEERING_MESSAGE_PREVIEW_LIMIT = 160;
|
|
19
21
|
|
|
22
|
+
export function steeringMessagePreview(message: string): string {
|
|
23
|
+
return previewDisplayText(redactSecretValues(message), STEERING_MESSAGE_PREVIEW_LIMIT);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function steeringReceipt(message: string, receipt: string): string {
|
|
27
|
+
return `${receipt} Message: ${JSON.stringify(steeringMessagePreview(message))}`;
|
|
28
|
+
}
|
|
29
|
+
|
|
20
30
|
export function createSteeringStatus(): SteeringStatus {
|
|
21
31
|
return { requested: 0, scheduled: 0, pending: 0, delivered: 0, failed: 0, recovered: 0, recent: [] };
|
|
22
32
|
}
|
|
@@ -35,7 +45,7 @@ export function recordSteeringRequest(
|
|
|
35
45
|
id: input.id,
|
|
36
46
|
requestedAt: input.requestedAt,
|
|
37
47
|
...(input.source ? { source: input.source } : {}),
|
|
38
|
-
messagePreview: input.message
|
|
48
|
+
messagePreview: steeringMessagePreview(input.message),
|
|
39
49
|
targets: input.targets.map((target) => ({ index: target.index, state: target.state, ...(target.reason ? { reason: target.reason } : {}) })),
|
|
40
50
|
};
|
|
41
51
|
status.requested++;
|