@wrongstack/cli 0.313.1 → 0.316.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.
- package/dist/{acp-LQMSMV32.js → acp-CEQINXWB.js} +2 -2
- package/dist/acp-registry-cache.d.ts +0 -2
- package/dist/acp-server-agent.d.ts +2 -1
- package/dist/arg-parser.d.ts +2 -1
- package/dist/{auth-VQMSZGKE.js → auth-GZ5A5OF5.js} +3 -3
- package/dist/auth-menu/local.d.ts +3 -2
- package/dist/boot/boot-auto-thin.d.ts +44 -0
- package/dist/boot/brain-decision-log.d.ts +2 -1
- package/dist/boot/config-backup-recovery.d.ts +2 -6
- package/dist/boot/dispatch-singleshot.d.ts +2 -1
- package/dist/boot/dispatch-webui.d.ts +5 -1
- package/dist/boot/event-wiring.d.ts +1 -1
- package/dist/boot/execution-mode.d.ts +2 -1
- package/dist/boot/governance-shadow-bridge.d.ts +4 -3
- package/dist/boot/governance-trace-context.d.ts +4 -4
- package/dist/boot/launch-menu.d.ts +2 -2
- package/dist/boot/system-prompt-builder.d.ts +1 -1
- package/dist/boot/system-prompt-menu.d.ts +10 -58
- package/dist/boot/system-prompt.d.ts +3 -3
- package/dist/boot/tool-registry.d.ts +3 -1
- package/dist/boot/tui-coordinator-callbacks.d.ts +2 -1
- package/dist/boot/tui-coordinator-setup.d.ts +3 -2
- package/dist/boot/tui-goal-wiring.d.ts +2 -1
- package/dist/boot/tui-live-sessions.d.ts +3 -1
- package/dist/boot/tui-session-resume.d.ts +82 -10
- package/dist/boot/tui-session-stub-enrich.d.ts +7 -1
- package/dist/boot/tui-settings-adapter.d.ts +3 -2
- package/dist/boot/tui-theme-adapter.d.ts +3 -2
- package/dist/boot/webui-session-child.d.ts +2 -12
- package/dist/boot-auto-thin-BZ675EVT.js +102 -0
- package/dist/boot-config.d.ts +1 -1
- package/dist/brain-menu/panel-service.d.ts +2 -1
- package/dist/chimera-cascade-evidence.d.ts +4 -21
- package/dist/chimera-review-task.d.ts +0 -7
- package/dist/chimera-subagent-ladder.d.ts +2 -2
- package/dist/{chunk-USYOJIV2.js → chunk-32MTOI2I.js} +2 -2
- package/dist/{chunk-CNQZ4HG4.js → chunk-37SPPLUD.js} +57 -8
- package/dist/chunk-ALE5KHCA.js +1 -0
- package/dist/{chunk-GWVLRUVH.js → chunk-G3IMKQRH.js} +25 -6
- package/dist/{chunk-BZJ4MP32.js → chunk-GKHUHAIK.js} +8 -3
- package/dist/{chunk-3JPTNADJ.js → chunk-GPPRNAKW.js} +1 -1
- package/dist/{chunk-KE7E7DPX.js → chunk-HXJYHAR4.js} +1 -1
- package/dist/{chunk-X3N5TS2S.js → chunk-JACOMTIH.js} +2 -76
- package/dist/{chunk-DGXNL7OT.js → chunk-JHUJUIOH.js} +1 -18
- package/dist/{chunk-WOTGMHAH.js → chunk-KG4X5F7Z.js} +1 -1
- package/dist/{chunk-NUIHRGPY.js → chunk-NV3JDK4F.js} +1 -1
- package/dist/{chunk-E3X4KM7T.js → chunk-NZZOYLQ7.js} +5 -10
- package/dist/{chunk-H6C7SO5H.js → chunk-QC5I4VWZ.js} +1 -1
- package/dist/chunk-SXJTVNWF.js +78 -0
- package/dist/{chunk-AOAIPYFB.js → chunk-SYIBTG3X.js} +2 -2
- package/dist/{chunk-PKHGLWUJ.js → chunk-T642Q732.js} +5 -4
- package/dist/{chunk-BGFM3PD7.js → chunk-UZ2TMHNH.js} +1 -1
- package/dist/{chunk-4S52MIIM.js → chunk-VXCCBI2W.js} +2 -2
- package/dist/{chunk-FKWHSFX4.js → chunk-XYKYXFEE.js} +1 -1
- package/dist/cli-entry-point.d.ts +9 -0
- package/dist/cli-eternal-flag.d.ts +1 -1
- package/dist/{cli-main-UOQ2ICUO.js → cli-main-IEAM6SK7.js} +3578 -1626
- package/dist/cli-main-helpers.d.ts +3 -3
- package/dist/config-doctor.d.ts +34 -3
- package/dist/context-limit.d.ts +4 -3
- package/dist/{diag-doctor-OPTB2NWY.js → diag-doctor-LFCCBPMD.js} +3 -3
- package/dist/execute-deps.d.ts +36 -7
- package/dist/{execution-L4CXQEND.js → execution-TZUGCKFU.js} +459 -77
- package/dist/execution-chimera-cascade.d.ts +1 -1
- package/dist/execution-chimera-review.d.ts +1 -1
- package/dist/execution-cleanup.d.ts +2 -1
- package/dist/execution-kanban-dispatch.d.ts +2 -1
- package/dist/execution-repl-fleet-callbacks.d.ts +3 -2
- package/dist/fleet/budget-source.d.ts +2 -1
- package/dist/fleet/host-context.d.ts +8 -1
- package/dist/fleet/host-director-event-bridges.d.ts +28 -3
- package/dist/fleet/host-event-bridge.d.ts +6 -1
- package/dist/fleet/host-explore-companion-registry.d.ts +60 -0
- package/dist/fleet/host-explore-companion.d.ts +7 -3
- package/dist/fleet/host-provider.d.ts +2 -1
- package/dist/fleet/host-session-writer.d.ts +9 -1
- package/dist/fleet/host-shadow-manager.d.ts +82 -20
- package/dist/fleet/host-shadow-pass.d.ts +9 -1
- package/dist/fleet/host-spawn-types.d.ts +9 -0
- package/dist/fleet/host-status.d.ts +2 -1
- package/dist/fleet/host-subagent-factory.d.ts +2 -1
- package/dist/fleet/host-subagent-session-audit.d.ts +56 -0
- package/dist/fleet/host-supervisor.d.ts +11 -1
- package/dist/fleet/host-task-result-report.d.ts +2 -1
- package/dist/fleet/host.d.ts +38 -6
- package/dist/fleet/status-broadcast.d.ts +2 -1
- package/dist/fleet-statusline.d.ts +2 -1
- package/dist/goal-host.d.ts +3 -2
- package/dist/{governance-V2Z42RBE.js → governance-JSGHHA2R.js} +1 -1
- package/dist/governance-hq-telemetry.d.ts +2 -2
- package/dist/{hq-2XIXGAER.js → hq-NDTJRRX3.js} +3 -3
- package/dist/hq-publisher.d.ts +1 -1
- package/dist/hq-recovery-html.d.ts +1 -6
- package/dist/hq-server/auth-state.d.ts +2 -1
- package/dist/hq-server/auth.d.ts +3 -2
- package/dist/hq-server/login-attempt-store.d.ts +2 -1
- package/dist/hq-server/mailbox-gateway-manager.d.ts +2 -1
- package/dist/hq-server/preflight.d.ts +3 -2
- package/dist/hq-server/server-lifecycle.d.ts +2 -1
- package/dist/hq-server/snapshot.d.ts +0 -9
- package/dist/hq-server/startup.d.ts +2 -3
- package/dist/hq-server/types.d.ts +2 -2
- package/dist/hq-server/upgrade-handler.d.ts +2 -1
- package/dist/hq-server/ws-leader.d.ts +0 -6
- package/dist/{hq-server-DBT3OOYD.js → hq-server-OH3SPSE2.js} +3 -13
- package/dist/hq-server.d.ts +1 -6
- package/dist/hq-static-serve.d.ts +2 -1
- package/dist/{hq-ttl-U2FAYFAT.js → hq-ttl-KUO3AU7X.js} +2 -2
- package/dist/{hq-tunnel-RFKGC4HI.js → hq-tunnel-LO55RCZE.js} +1 -1
- package/dist/hq-tunnel.d.ts +2 -1
- package/dist/index.js +113 -109
- package/dist/input-reader.d.ts +2 -1
- package/dist/kanban-dispatch-route.d.ts +27 -2
- package/dist/kanban-hq-sync.d.ts +2 -1
- package/dist/launch-hints.d.ts +2 -1
- package/dist/mailbox-bridge-bootstrap.d.ts +2 -3
- package/dist/{mailbox-serve-5S3PHG5D.js → mailbox-serve-VKQIRCCB.js} +47 -28
- package/dist/{mcp-RRPKNRSN.js → mcp-AQKSASHD.js} +1 -1
- package/dist/mcp-serve.d.ts +2 -1
- package/dist/{modeldiag-H6DKWJ2N.js → modeldiag-4NYBRSFP.js} +1 -1
- package/dist/next-task-predictor.d.ts +3 -2
- package/dist/permission-prompt.d.ts +2 -1
- package/dist/picker.d.ts +0 -18
- package/dist/plugin-management.d.ts +3 -14
- package/dist/{plugin-usage-GCTYOZPH.js → plugin-usage-AP7SJCDA.js} +2 -2
- package/dist/{plugins-EEKHCMBE.js → plugins-HQ5FU2AM.js} +3 -5
- package/dist/preflight.d.ts +2 -1
- package/dist/{proxy-wiring-G26YGP7S.js → proxy-wiring-EQB5X5YH.js} +3 -3
- package/dist/renderer.d.ts +18 -1
- package/dist/repl-client-registration.d.ts +2 -1
- package/dist/repl.d.ts +1 -1
- package/dist/{replay-XU6ZD7GM.js → replay-FJ2JBXUA.js} +1 -1
- package/dist/{sdd-runtime-GFZ3NJKS.js → sdd-runtime-FLKCSTYV.js} +3 -5
- package/dist/services/commit-message.d.ts +2 -1
- package/dist/services/sdd/state.d.ts +0 -2
- package/dist/services/sdd-runtime.d.ts +1 -1
- package/dist/services/statusline-config.d.ts +27 -4
- package/dist/session-event-wiring.d.ts +3 -5
- package/dist/{sessions-config-7Q7QJBKJ.js → sessions-config-P2LK2L32.js} +5 -1
- package/dist/sessions-doctor-EXHAZSSE.js +146 -0
- package/dist/settings-menu.d.ts +2 -1
- package/dist/shutdown-cleanup.d.ts +3 -2
- package/dist/{simpleui-dist-33VO3QHF.js → simpleui-dist-JKNRCRRK.js} +1 -1
- package/dist/simpleui-dist.d.ts +3 -2
- package/dist/slash-commands/brain-council.d.ts +0 -4
- package/dist/slash-commands/brain-status.d.ts +0 -1
- package/dist/slash-commands/command-context.d.ts +16 -2
- package/dist/slash-commands/fix-classifier.d.ts +2 -1
- package/dist/slash-commands/kanban-agent-helpers.d.ts +2 -1
- package/dist/slash-commands/kanban-board-handlers.d.ts +2 -1
- package/dist/slash-commands/kanban-lifecycle-diagnostics.d.ts +2 -1
- package/dist/slash-commands/kanban-task-subcommands.d.ts +0 -1
- package/dist/slash-commands/memory-audience.d.ts +1 -10
- package/dist/slash-commands/memory-flags.d.ts +2 -1
- package/dist/slash-commands/sdd-command-helpers.d.ts +3 -2
- package/dist/slash-commands/sdd.d.ts +2 -2
- package/dist/slash-commands/settings-mutations.d.ts +0 -1
- package/dist/slash-commands/statusline.d.ts +4 -4
- package/dist/slash-commands/telegram-pairing.d.ts +2 -2
- package/dist/slash-commands/telegram-setup.d.ts +2 -1
- package/dist/slash-commands/tier.d.ts +13 -0
- package/dist/subcommands/handlers/acp-connection-gate.d.ts +4 -3
- package/dist/subcommands/handlers/bench-run-help.d.ts +3 -8
- package/dist/subcommands/handlers/daemon-inventory.d.ts +3 -2
- package/dist/subcommands/handlers/governance.d.ts +2 -1
- package/dist/subcommands/handlers/model-smoke-test.d.ts +3 -2
- package/dist/subcommands/handlers/modeldiag-eval.d.ts +0 -4
- package/dist/subcommands/handlers/modeldiag-profiles.d.ts +1 -1
- package/dist/subcommands/handlers/models-add-help.d.ts +3 -8
- package/dist/subcommands/handlers/sessions-doctor.d.ts +3 -0
- package/dist/subcommands/handlers/update.d.ts +1 -1
- package/dist/terminal-format.d.ts +3 -2
- package/dist/tui-resource-menus.d.ts +2 -1
- package/dist/tuneup.d.ts +5 -5
- package/dist/{update-ZXNC6I6G.js → update-XKARO3CY.js} +3 -3
- package/dist/{update-check-WARHSVZA.js → update-check-LICQNYFK.js} +2 -2
- package/dist/update-check.d.ts +1 -1
- package/dist/utils/hq-ttl.d.ts +2 -1
- package/dist/webui-server/connection-handler.d.ts +34 -2
- package/dist/webui-server/prefs-seeding.d.ts +11 -1
- package/dist/webui-server/route-contexts.d.ts +45 -5
- package/dist/webui-server/session-start-payload.d.ts +13 -0
- package/dist/webui-server/setup-events.d.ts +14 -1
- package/dist/{webui-server-I53IYBW4.js → webui-server-LZOEH7O6.js} +374 -169
- package/dist/webui-server-options.d.ts +30 -4
- package/dist/wiring/brain-and-orchestration.d.ts +3 -3
- package/dist/wiring/cli-execute-builder.d.ts +3 -0
- package/dist/wiring/cli-heap-watchdog.d.ts +2 -1
- package/dist/wiring/cli-prompt-and-tools-setup.d.ts +10 -8
- package/dist/wiring/codebase-index.d.ts +2 -1
- package/dist/wiring/command-host-state.d.ts +61 -5
- package/dist/wiring/controllers.d.ts +3 -4
- package/dist/wiring/dep-watcher-bridge.d.ts +3 -2
- package/dist/wiring/dep-watcher.d.ts +2 -1
- package/dist/wiring/design-studio.d.ts +2 -1
- package/dist/wiring/director-setup.d.ts +3 -2
- package/dist/wiring/domain-terms-mirror.d.ts +2 -1
- package/dist/wiring/external-plugins.d.ts +3 -2
- package/dist/wiring/fleet-command-handlers.d.ts +2 -2
- package/dist/wiring/heap-watchdog-setup.d.ts +2 -1
- package/dist/wiring/hq-telemetry.d.ts +3 -2
- package/dist/wiring/lifecycle-plugins.d.ts +2 -2
- package/dist/wiring/management-tools.d.ts +30 -2
- package/dist/wiring/metrics.d.ts +2 -2
- package/dist/wiring/plugins.d.ts +0 -1
- package/dist/wiring/prompt-journal-recorder.d.ts +1 -1
- package/dist/wiring/provider-runtime-setup.d.ts +9 -2
- package/dist/wiring/provider-runtime.d.ts +23 -3
- package/dist/wiring/provider-status.d.ts +2 -1
- package/dist/wiring/provider-utility-tools.d.ts +2 -1
- package/dist/wiring/provider.d.ts +2 -1
- package/dist/wiring/replay-governance-setup.d.ts +2 -1
- package/dist/wiring/replay.d.ts +2 -1
- package/dist/wiring/resume-candidate.d.ts +27 -0
- package/dist/wiring/runtime-controller-deps.d.ts +8 -1
- package/dist/wiring/runtime-dispatch-state.d.ts +2 -1
- package/dist/wiring/runtime-lifecycle-deps.d.ts +2 -1
- package/dist/wiring/runtime-picker-deps.d.ts +2 -1
- package/dist/wiring/session-command-handlers.d.ts +2 -2
- package/dist/wiring/session-establishment.d.ts +2 -1
- package/dist/wiring/session-registry.d.ts +3 -2
- package/dist/wiring/session-runtime.d.ts +1 -1
- package/dist/wiring/slash-commands.d.ts +5 -4
- package/dist/wiring/teardown-registrar.d.ts +3 -2
- package/dist/wiring/vector-memory-setup.d.ts +3 -2
- package/dist/wiring/wrongtrace-hooks.d.ts +1 -1
- package/dist/wiring/wrongtrace-telemetry.d.ts +2 -1
- package/dist/{wrongtrace-telemetry-6M2CCBX5.js → wrongtrace-telemetry-FNLANZ5I.js} +1 -1
- package/package.json +31 -31
- package/dist/auth-menu.d.ts +0 -7
- package/dist/chunk-WHOIR577.js +0 -1
- package/dist/webui-server/terminal-log-view.d.ts +0 -47
- package/dist/wiring/tools.d.ts +0 -29
|
@@ -5,7 +5,7 @@ import type { ExecuteDeps } from './execute-deps.js';
|
|
|
5
5
|
type Director = NonNullable<ExecuteDeps['fleet']['director']>;
|
|
6
6
|
type Events = ExecuteDeps['core']['events'];
|
|
7
7
|
type Session = ExecuteDeps['session']['session'];
|
|
8
|
-
|
|
8
|
+
type InstallChimeraCascadeHandlerOptions = {
|
|
9
9
|
events: Events;
|
|
10
10
|
director: Director | null | undefined;
|
|
11
11
|
session: Session;
|
|
@@ -19,7 +19,7 @@ type Config = ExecuteDeps['core']['config'];
|
|
|
19
19
|
* direct test.
|
|
20
20
|
*/
|
|
21
21
|
export declare function normalizeFileKeyForCitation(raw: string, cwd: string): string;
|
|
22
|
-
|
|
22
|
+
type InstallChimeraReviewHandlerOptions = {
|
|
23
23
|
events: Events;
|
|
24
24
|
director: Director | null | undefined;
|
|
25
25
|
session: Session;
|
|
@@ -2,7 +2,7 @@ import type { Director } from '@wrongstack/core/coordination';
|
|
|
2
2
|
import type { ChimeraWorkRegistry } from './chimera-work-registry.js';
|
|
3
3
|
import type { ExecuteDeps } from './execute-deps.js';
|
|
4
4
|
import type { FleetStatusLine } from './fleet-statusline.js';
|
|
5
|
-
|
|
5
|
+
interface ExecutionCleanupInput {
|
|
6
6
|
offStorageObservability: () => void;
|
|
7
7
|
fleetStatusLine: FleetStatusLine | null;
|
|
8
8
|
onCoordinatorStop?: (() => void) | undefined;
|
|
@@ -21,4 +21,5 @@ export interface ExecutionCleanupInput {
|
|
|
21
21
|
reader: ExecuteDeps['ui']['reader'];
|
|
22
22
|
}
|
|
23
23
|
export declare function finalizeExecutionCleanup(input: ExecutionCleanupInput): Promise<void>;
|
|
24
|
+
export {};
|
|
24
25
|
//# sourceMappingURL=execution-cleanup.d.ts.map
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { WebUIDispatchContext } from './boot/dispatch-webui.js';
|
|
2
2
|
import type { ExecuteDeps } from './execute-deps.js';
|
|
3
|
-
|
|
3
|
+
type CreateKanbanDispatchHandlerOptions = {
|
|
4
4
|
config: ExecuteDeps['core']['config'];
|
|
5
5
|
events: ExecuteDeps['core']['events'];
|
|
6
6
|
skillLoader: ExecuteDeps['ui']['skillLoader'];
|
|
7
7
|
sddSubagentFactory: ExecuteDeps['provider']['sddSubagentFactory'];
|
|
8
8
|
};
|
|
9
9
|
export declare function createKanbanDispatchHandler({ config, events, skillLoader, sddSubagentFactory, }: CreateKanbanDispatchHandlerOptions): Pick<WebUIDispatchContext, 'onKanbanDispatch'>;
|
|
10
|
+
export {};
|
|
10
11
|
//# sourceMappingURL=execution-kanban-dispatch.d.ts.map
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { Director } from '@wrongstack/core/coordination';
|
|
2
|
-
|
|
2
|
+
interface ReplFleetCallbacksOptions {
|
|
3
3
|
director: Director | null | undefined;
|
|
4
4
|
getDirector: (() => Director | null | undefined) | undefined;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
interface ReplFleetCallbacks {
|
|
7
7
|
onInterruptFleet: () => number;
|
|
8
8
|
onAgentIterationComplete: (tokens: number) => void;
|
|
9
9
|
}
|
|
10
10
|
export declare function createReplFleetCallbacks({ director, getDirector, }: ReplFleetCallbacksOptions): ReplFleetCallbacks;
|
|
11
|
+
export {};
|
|
11
12
|
//# sourceMappingURL=execution-repl-fleet-callbacks.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Config } from '@wrongstack/core/types';
|
|
2
2
|
export type FleetBudgetSource = 'cli-flag' | 'env' | 'profile' | 'default';
|
|
3
|
-
|
|
3
|
+
interface ResolvedFleetBudget {
|
|
4
4
|
maxConcurrent: number;
|
|
5
5
|
maxConcurrentSource: FleetBudgetSource;
|
|
6
6
|
maxSpawns: number;
|
|
@@ -15,4 +15,5 @@ export declare function resolveFleetBudgetSources(input: {
|
|
|
15
15
|
/** Built-in maxSpawns when nothing else wins. */
|
|
16
16
|
defaultMaxSpawns?: number | undefined;
|
|
17
17
|
}): ResolvedFleetBudget;
|
|
18
|
+
export {};
|
|
18
19
|
//# sourceMappingURL=budget-source.d.ts.map
|
|
@@ -12,5 +12,12 @@ export interface SkillResolutionReport {
|
|
|
12
12
|
export declare function resolveHostSubagentSkillResolution(deps: MultiAgentDeps, roster: Record<string, SubagentConfig>, subCfg: SubagentConfig, availableToolNames?: readonly string[]): Promise<SkillResolutionReport>;
|
|
13
13
|
/** Backwards-compatible wrapper for callers that only need the prompt text. */
|
|
14
14
|
export declare function resolveHostSubagentSkillContent(deps: MultiAgentDeps, roster: Record<string, SubagentConfig>, subCfg: SubagentConfig, availableToolNames?: readonly string[]): Promise<string>;
|
|
15
|
-
export declare function retrieveHostSubagentMemory(deps: MultiAgentDeps, getLeaderMode: (() => string | undefined) | undefined, subCfg: SubagentConfig, taskContext?: Record<string, unknown
|
|
15
|
+
export declare function retrieveHostSubagentMemory(deps: MultiAgentDeps, getLeaderMode: (() => string | undefined) | undefined, subCfg: SubagentConfig, taskContext?: Record<string, unknown>,
|
|
16
|
+
/**
|
|
17
|
+
* Conversation this worker belongs to, for injection attribution. The host's
|
|
18
|
+
* own session is the boot tab once several tabs share the process, so
|
|
19
|
+
* without it every background tab's memory reads were recorded against a
|
|
20
|
+
* conversation that never made them.
|
|
21
|
+
*/
|
|
22
|
+
owningSessionId?: string): Promise<string[]>;
|
|
16
23
|
//# sourceMappingURL=host-context.d.ts.map
|
|
@@ -13,24 +13,49 @@ export declare function installDirectorTaskCompletedHandler(input: {
|
|
|
13
13
|
export declare function registerDirectorBudgetAndContextBridges(input: {
|
|
14
14
|
director: Director;
|
|
15
15
|
events: EventBus;
|
|
16
|
-
|
|
16
|
+
/**
|
|
17
|
+
* The session that OWNS the subagent an event is about — not the host's own.
|
|
18
|
+
* With four tabs on one host these differ: the host session names the tab it
|
|
19
|
+
* booted with, so a worker delegated from a background tab announced its
|
|
20
|
+
* budget and context pressure into the boot tab's panels and vanished from
|
|
21
|
+
* the tab that was actually waiting on it.
|
|
22
|
+
*/
|
|
23
|
+
sessionFor: (subagentId: string) => string;
|
|
17
24
|
}): Array<() => void>;
|
|
25
|
+
/**
|
|
26
|
+
* `coordinator.stats` — fleet-wide on purpose.
|
|
27
|
+
*
|
|
28
|
+
* Unlike the lifecycle bridges beside it, this one is NOT split per
|
|
29
|
+
* conversation, and the stamp is the host's own session rather than any
|
|
30
|
+
* worker's owner. Everything it reports is a property of the fleet as a
|
|
31
|
+
* whole: the spawn and concurrency budget is one ceiling shared by every tab,
|
|
32
|
+
* and the status list is the coordinator's own roll-up. Splitting it would
|
|
33
|
+
* mean reporting a shared budget four times as if each tab had its own.
|
|
34
|
+
*
|
|
35
|
+
* The client stores it in `useCoordinatorMonitorStore`, which has no live UI
|
|
36
|
+
* consumer. If one is ever added it must filter `subagentStatuses` by owner
|
|
37
|
+
* (`coordinator.sessionOf`) rather than assume the frame describes the tab it
|
|
38
|
+
* arrived in.
|
|
39
|
+
*/
|
|
18
40
|
export declare function registerDirectorStatsBridge(input: {
|
|
19
41
|
director: Director;
|
|
20
42
|
events: EventBus;
|
|
43
|
+
/** Host session — the fleet's own address, not any worker's owner. */
|
|
21
44
|
sessionId: string;
|
|
22
45
|
}): () => void;
|
|
23
46
|
export declare function registerDirectorSubagentLifecycleBridges(input: {
|
|
24
47
|
director: Director;
|
|
25
48
|
events: EventBus;
|
|
26
|
-
|
|
49
|
+
/** Owning session of the subagent — see `registerDirectorBudgetAndContextBridges`. */
|
|
50
|
+
sessionFor: (subagentId: string) => string;
|
|
27
51
|
agentMonitor?: AgentMonitorService | undefined;
|
|
28
52
|
onSubagentRemoved(subagentId: string): void;
|
|
29
53
|
}): Array<() => void>;
|
|
30
54
|
export declare function registerCoordinatorLifecycleHandlers(input: {
|
|
31
55
|
coordinator: DefaultMultiAgentCoordinator;
|
|
32
56
|
events: EventBus;
|
|
33
|
-
|
|
57
|
+
/** Owning session of the subagent — see `registerDirectorBudgetAndContextBridges`. */
|
|
58
|
+
sessionFor: (subagentId: string) => string;
|
|
34
59
|
isShadowTask(taskId: string): boolean;
|
|
35
60
|
onSubagentStopped(subagentId: string): void;
|
|
36
61
|
}): () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EventBus } from '@wrongstack/core/kernel';
|
|
2
|
-
import type { SubagentConfig } from '@wrongstack/core/types';
|
|
2
|
+
import type { SubagentConfig, TokenCounter } from '@wrongstack/core/types';
|
|
3
3
|
/**
|
|
4
4
|
* Bound tool inputs before they cross from a subagent EventBus into the host.
|
|
5
5
|
* File bodies and patches can be multi-megabyte; the host only needs their
|
|
@@ -13,5 +13,10 @@ export declare function installSubagentEventBridge(opts: {
|
|
|
13
13
|
projectRoot: string;
|
|
14
14
|
effectiveCfg: SubagentConfig;
|
|
15
15
|
subCfg: SubagentConfig;
|
|
16
|
+
/** The subagent's own counter, for the cumulative snapshot on each emit. */
|
|
17
|
+
tokenCounter?: Pick<TokenCounter, 'total'> | undefined;
|
|
18
|
+
/** Routed provider/model, used when an event omits its own. */
|
|
19
|
+
subagentProvider?: string | undefined;
|
|
20
|
+
subagentModel?: string | undefined;
|
|
16
21
|
}): () => void;
|
|
17
22
|
//# sourceMappingURL=host-event-bridge.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One ExploreCompanion per live conversation.
|
|
3
|
+
*
|
|
4
|
+
* `MultiAgentHost` is built once, for the session the process booted with, and
|
|
5
|
+
* the companion was built with it. That is exactly right for the CLI and the
|
|
6
|
+
* TUI, which have one conversation. The WebUI runs up to four on the same host:
|
|
7
|
+
* the companion filters every signal against its own `leaderSessionId`
|
|
8
|
+
* (fail-closed, so nothing ever leaked into the wrong tab) and therefore simply
|
|
9
|
+
* did nothing for tabs 2-4 — no probes, no findings, silently.
|
|
10
|
+
*
|
|
11
|
+
* A companion is cheap (two or three event listeners, plus one poll timer when
|
|
12
|
+
* the mailbox-ask signal is on) and its resident worker is spawned lazily on
|
|
13
|
+
* the first probe, so a tab that never triggers one pays nothing. What is not
|
|
14
|
+
* free is keeping companions for conversations that are gone: a closed tab
|
|
15
|
+
* would leave its poll timer running. Hence the two bounds below.
|
|
16
|
+
*
|
|
17
|
+
* Bounds, both mirroring conventions already in the codebase:
|
|
18
|
+
* - `max` live companions (4 — the WebUI's tab-slot count), least-recently
|
|
19
|
+
* active evicted first, the way `auto-submit-streak` bounds its per-session
|
|
20
|
+
* map;
|
|
21
|
+
* - companions with no run for `idleMs` are swept, the way BrainMonitor
|
|
22
|
+
* prunes its idle `bySession` entries.
|
|
23
|
+
*
|
|
24
|
+
* Neither bound loses work: a swept session gets a fresh companion on its next
|
|
25
|
+
* run, and probe cooldowns are per-companion advisory state, not results.
|
|
26
|
+
*
|
|
27
|
+
* @module host-explore-companion-registry
|
|
28
|
+
*/
|
|
29
|
+
import type { ExploreCompanion } from '@wrongstack/core/coordination';
|
|
30
|
+
interface ExploreCompanionRegistryInput {
|
|
31
|
+
/**
|
|
32
|
+
* Build a companion for one session. Returns null when the feature is off
|
|
33
|
+
* for this host, in which case the registry stays permanently empty and
|
|
34
|
+
* `ensure` is a no-op — no negative caching needed, the builder is cheap and
|
|
35
|
+
* its own `enabled === false` check is the authority.
|
|
36
|
+
*/
|
|
37
|
+
create: (sessionId: string) => ExploreCompanion | null;
|
|
38
|
+
max?: number | undefined;
|
|
39
|
+
idleMs?: number | undefined;
|
|
40
|
+
now?: (() => number) | undefined;
|
|
41
|
+
}
|
|
42
|
+
export interface ExploreCompanionRegistry {
|
|
43
|
+
/**
|
|
44
|
+
* Make sure this session has a companion, and mark it active.
|
|
45
|
+
*
|
|
46
|
+
* Safe to call on every run start: an existing entry is only touched.
|
|
47
|
+
*/
|
|
48
|
+
ensure: (sessionId: string) => void;
|
|
49
|
+
/** Live companion for a session, for tests and status surfaces. */
|
|
50
|
+
peek: (sessionId: string) => ExploreCompanion | undefined;
|
|
51
|
+
/** Session ids holding a live companion, most recently active last. */
|
|
52
|
+
ids: () => string[];
|
|
53
|
+
/** Stop and forget one session's companion. */
|
|
54
|
+
release: (sessionId: string) => void;
|
|
55
|
+
/** Stop and forget everything — host teardown. */
|
|
56
|
+
disposeAll: () => void;
|
|
57
|
+
}
|
|
58
|
+
export declare function createExploreCompanionRegistry(input: ExploreCompanionRegistryInput): ExploreCompanionRegistry;
|
|
59
|
+
export {};
|
|
60
|
+
//# sourceMappingURL=host-explore-companion-registry.d.ts.map
|
|
@@ -13,7 +13,10 @@
|
|
|
13
13
|
* gone (removed/reaped/never spawned), the next probe spawns a fresh one.
|
|
14
14
|
* Probes are `assignInternal`ed, never awaited — the leader is never
|
|
15
15
|
* blocked, and internal tasks stay out of the leader-visible task surface
|
|
16
|
-
* (same treatment as shadow passes).
|
|
16
|
+
* (same treatment as shadow passes). When the resident `submit_result`s,
|
|
17
|
+
* this host posts a same-session `session.note` so the leader folds the
|
|
18
|
+
* findings at its next iteration. Mailbox stays the durable cross-session
|
|
19
|
+
* channel; it is not the in-session talk path.
|
|
17
20
|
*
|
|
18
21
|
* @module host-explore-companion
|
|
19
22
|
*/
|
|
@@ -21,7 +24,7 @@ import { type Director, ExploreCompanion } from '@wrongstack/core/coordination';
|
|
|
21
24
|
import type { EventBus } from '@wrongstack/core/kernel';
|
|
22
25
|
import type { SubagentConfig } from '@wrongstack/core/types';
|
|
23
26
|
/** Config block for the explore-companion host wiring (FleetConfig.exploreCompanion). */
|
|
24
|
-
|
|
27
|
+
interface HostExploreCompanionConfig {
|
|
25
28
|
/** Kill switch. Default true. */
|
|
26
29
|
enabled?: boolean | undefined;
|
|
27
30
|
/** Min gap between probes on the same subject (ms). Default 120_000. */
|
|
@@ -31,7 +34,7 @@ export interface HostExploreCompanionConfig {
|
|
|
31
34
|
/** Mailbox poll interval for explicit asks (ms). Default 5_000. */
|
|
32
35
|
pollIntervalMs?: number | undefined;
|
|
33
36
|
}
|
|
34
|
-
|
|
37
|
+
interface HostExploreCompanionInput {
|
|
35
38
|
director: Director;
|
|
36
39
|
events: EventBus;
|
|
37
40
|
sessionId: string;
|
|
@@ -40,4 +43,5 @@ export interface HostExploreCompanionInput {
|
|
|
40
43
|
config?: HostExploreCompanionConfig | undefined;
|
|
41
44
|
}
|
|
42
45
|
export declare function createHostExploreCompanion(input: HostExploreCompanionInput): ExploreCompanion | null;
|
|
46
|
+
export {};
|
|
43
47
|
//# sourceMappingURL=host-explore-companion.d.ts.map
|
|
@@ -2,7 +2,7 @@ import type { Config, Provider, ReasoningConfig, SubagentConfig } from '@wrongst
|
|
|
2
2
|
import type { MultiAgentDeps } from './host-types.js';
|
|
3
3
|
export declare function buildHostSubagentProvider(deps: MultiAgentDeps, config: Config, overrideId?: string | undefined, model?: string | undefined): Promise<Provider>;
|
|
4
4
|
export declare function resolveHostSubagentReasoningConfig(deps: MultiAgentDeps, providerId: string, modelId: string): Promise<ReasoningConfig | undefined>;
|
|
5
|
-
|
|
5
|
+
interface HostSubagentModelSelection {
|
|
6
6
|
effProvider: string;
|
|
7
7
|
effModel: string;
|
|
8
8
|
fallbackProfile: string | undefined;
|
|
@@ -19,4 +19,5 @@ export declare function resolveHostSubagentModelSelection(liveConfig: Config, ef
|
|
|
19
19
|
fallbackProfile?: string | undefined;
|
|
20
20
|
modelRuntime?: SubagentConfig['modelRuntime'] | undefined;
|
|
21
21
|
} | undefined): HostSubagentModelSelection;
|
|
22
|
+
export {};
|
|
22
23
|
//# sourceMappingURL=host-provider.d.ts.map
|
|
@@ -3,6 +3,14 @@ import type { SessionWriter } from '@wrongstack/core/types';
|
|
|
3
3
|
* Session writer for a subagent that has no journal of its own: its events are
|
|
4
4
|
* interleaved into the parent's JSONL.
|
|
5
5
|
*
|
|
6
|
+
* Pass `agentId` so those interleaved events carry attribution. Without it the
|
|
7
|
+
* subagent's `tool_call_start`, `llm_response` and error records are byte-for-
|
|
8
|
+
* byte indistinguishable from the leader's in the one file that holds both,
|
|
9
|
+
* and every consumer that reads the leader transcript — resume timeline,
|
|
10
|
+
* `/diag`, the HQ ledger, cost roll-ups — silently credits the leader for
|
|
11
|
+
* work it did not do. It is optional only so existing callers that have not
|
|
12
|
+
* resolved a name yet keep compiling; every real spawn site should pass one.
|
|
13
|
+
*
|
|
6
14
|
* Lifecycle and rewind *control* stay no-ops — `writeCheckpoint`,
|
|
7
15
|
* `writeInFlightMarker`, `truncateToCheckpoint`, `clearSession` and `close`
|
|
8
16
|
* belong to the parent, and a subagent driving them would corrupt the parent's
|
|
@@ -15,7 +23,7 @@ import type { SessionWriter } from '@wrongstack/core/types';
|
|
|
15
23
|
* parent writer files them against its own `activePromptIndex`, which is
|
|
16
24
|
* exactly the prompt a user rewinding this work would target.
|
|
17
25
|
*/
|
|
18
|
-
export declare function createParentSubagentSessionWriter(parentSession: SessionWriter): SessionWriter;
|
|
26
|
+
export declare function createParentSubagentSessionWriter(parentSession: SessionWriter, agentId?: string): SessionWriter;
|
|
19
27
|
/**
|
|
20
28
|
* Wrap a subagent's own `SessionWriter` so its file mutations are ALSO recorded
|
|
21
29
|
* against the parent session.
|
|
@@ -1,12 +1,46 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Host-level Shadow Agent lifecycle and observation management.
|
|
3
3
|
*
|
|
4
|
+
* ## One shadow review per conversation
|
|
5
|
+
*
|
|
6
|
+
* The shadow agent is a reactive reviewer: the host counts the work it sees
|
|
7
|
+
* start and finish, and when a run or a subagent task ends badly it spawns a
|
|
8
|
+
* one-shot reviewer once everything it was watching has settled.
|
|
9
|
+
*
|
|
10
|
+
* All of that state used to be flat fields on this class, which is exactly
|
|
11
|
+
* right for the CLI and the TUI — one process, one conversation. The WebUI
|
|
12
|
+
* puts up to four conversations on the same process, and flat fields made
|
|
13
|
+
* them one conversation as far as the shadow agent was concerned:
|
|
14
|
+
*
|
|
15
|
+
* - the depth counter mixed all four tabs, so a review triggered by tab 3
|
|
16
|
+
* was held back for as long as ANY other tab was still running, and the
|
|
17
|
+
* "problem" text it was eventually given was a semicolon-joined mix of
|
|
18
|
+
* failures from tabs that had nothing to do with each other;
|
|
19
|
+
* - the spawn carried no owning session, so the coordinator filed the
|
|
20
|
+
* reviewer under the host's own (boot) session: tab 3's failure grew a
|
|
21
|
+
* shadow agent in **tab 1's** roster, reporting to tab 1's leader, while
|
|
22
|
+
* the tab that actually failed saw nothing;
|
|
23
|
+
* - `shadowAgentId` was a single slot, so the second conversation to need a
|
|
24
|
+
* review either reused the first one's agent or quietly overwrote the
|
|
25
|
+
* pointer to it, leaving the first agent unstoppable.
|
|
26
|
+
*
|
|
27
|
+
* State is now keyed by the owning conversation. Every event this class
|
|
28
|
+
* listens to already carries `sessionId` (the subagent bridges stamp the
|
|
29
|
+
* spawning tab since the owning-session wave); an unstamped event — thin
|
|
30
|
+
* embedders, and every single-session host — falls back to the host's own
|
|
31
|
+
* session, which is why the CLI and the TUI behave exactly as before.
|
|
32
|
+
*
|
|
33
|
+
* The map is bounded the way the other per-session maps in the codebase are:
|
|
34
|
+
* at most `MAX_TRACKED_SESSIONS` entries, evicting the oldest one that holds
|
|
35
|
+
* nothing worth keeping (no live agent, no work in flight, no queued
|
|
36
|
+
* problem). Losing such an entry loses nothing — the next run rebuilds it.
|
|
37
|
+
*
|
|
4
38
|
* @module fleet/host-shadow-manager
|
|
5
39
|
*/
|
|
6
40
|
import type { SubagentConfig } from '@wrongstack/core/types';
|
|
7
41
|
import type { Director } from '@wrongstack/core/coordination';
|
|
8
42
|
import type { MultiAgentDeps, MultiAgentHostOptions } from './host-types.js';
|
|
9
|
-
|
|
43
|
+
interface HostShadowManagerContext {
|
|
10
44
|
deps: MultiAgentDeps;
|
|
11
45
|
opts: MultiAgentHostOptions;
|
|
12
46
|
getDirector: () => Director | undefined;
|
|
@@ -28,37 +62,65 @@ export interface HostShadowManagerContext {
|
|
|
28
62
|
}
|
|
29
63
|
export declare class HostShadowManager {
|
|
30
64
|
private readonly ctx;
|
|
31
|
-
private
|
|
32
|
-
|
|
33
|
-
private readonly
|
|
34
|
-
|
|
35
|
-
private readonly
|
|
36
|
-
private shadowHeartbeatIntervalMs;
|
|
37
|
-
private shadowAutoStartSuppressions;
|
|
38
|
-
private shadowObservedWorkDepth;
|
|
39
|
-
private shadowPassInFlight;
|
|
40
|
-
private shadowQueuedProblem;
|
|
65
|
+
private readonly sessions;
|
|
66
|
+
/** Shadow task id → owning conversation. Also the `isShadowTask` index. */
|
|
67
|
+
private readonly taskSessions;
|
|
68
|
+
/** Live shadow agent id → owning conversation. */
|
|
69
|
+
private readonly agentSessions;
|
|
41
70
|
private readonly shadowActivityOffHandles;
|
|
42
71
|
constructor(ctx: HostShadowManagerContext);
|
|
72
|
+
/**
|
|
73
|
+
* The conversation an unstamped caller means.
|
|
74
|
+
*
|
|
75
|
+
* Single-session hosts never name one, and for them this is the only
|
|
76
|
+
* session there is.
|
|
77
|
+
*/
|
|
78
|
+
private hostSessionId;
|
|
79
|
+
private resolve;
|
|
80
|
+
/** Existing state for a conversation, without creating one. */
|
|
81
|
+
private peek;
|
|
82
|
+
private stateFor;
|
|
83
|
+
private evictIfFull;
|
|
43
84
|
getTaskIds(): ReadonlySet<string>;
|
|
44
85
|
isShadowTask(taskId: string): boolean;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
86
|
+
/** Conversation that owns a shadow task, if it is one. */
|
|
87
|
+
sessionForTask(taskId: string): string | undefined;
|
|
88
|
+
/** True when this subagent is some conversation's live shadow agent. */
|
|
89
|
+
isShadowAgent(subagentId: string): boolean;
|
|
90
|
+
getAgentId(sessionId?: string | undefined): string | null;
|
|
91
|
+
getTaskId(sessionId?: string | undefined): string | null;
|
|
92
|
+
enterShadowSpawn(sessionId?: string | undefined): void;
|
|
93
|
+
exitShadowSpawn(sessionId?: string | undefined): void;
|
|
49
94
|
onShadowTaskCompleted(taskId: string, subagentId: string): void;
|
|
50
95
|
armIfNeeded(): void;
|
|
51
|
-
recordShadowAgent(subagentId: string, taskId: string, intervalMs?: number): void;
|
|
96
|
+
recordShadowAgent(subagentId: string, taskId: string, intervalMs?: number | undefined, sessionId?: string | undefined): void;
|
|
97
|
+
/**
|
|
98
|
+
* Forget a shadow agent.
|
|
99
|
+
*
|
|
100
|
+
* With an id, only the conversation that owns that agent is touched — the
|
|
101
|
+
* flat version cleared the single slot whoever asked, so one tab's reaped
|
|
102
|
+
* reviewer used to wipe another tab's live one.
|
|
103
|
+
*/
|
|
52
104
|
clearShadowAgent(subagentId?: string): void;
|
|
53
|
-
|
|
54
|
-
|
|
105
|
+
private clearSessionShadowAgent;
|
|
106
|
+
markShadowTask(taskId: string, sessionId?: string | undefined): void;
|
|
107
|
+
addStopAfterTaskId(taskId: string, sessionId?: string | undefined): void;
|
|
55
108
|
removeShadowTask(taskId: string): void;
|
|
56
109
|
isActiveSubagent(subagentId: string): boolean;
|
|
57
110
|
private noteShadowWorkStarted;
|
|
58
111
|
private noteShadowWorkCompleted;
|
|
59
|
-
requestShadowPass(reason: string): void;
|
|
60
|
-
runShadowPass(reason: string): Promise<void>;
|
|
112
|
+
requestShadowPass(reason: string, sessionId?: string | undefined): void;
|
|
113
|
+
runShadowPass(reason: string, sessionId?: string | undefined): Promise<void>;
|
|
61
114
|
private stopShadowAfterTask;
|
|
115
|
+
/**
|
|
116
|
+
* Drop everything one conversation was tracking — its tab closed.
|
|
117
|
+
*
|
|
118
|
+
* The live agent is cleared through the normal path so `onShadowAgentStopped`
|
|
119
|
+
* still fires; stopping the subagent itself belongs to the caller that owns
|
|
120
|
+
* the fleet teardown.
|
|
121
|
+
*/
|
|
122
|
+
releaseSession(sessionId: string): void;
|
|
62
123
|
dispose(): void;
|
|
63
124
|
}
|
|
125
|
+
export {};
|
|
64
126
|
//# sourceMappingURL=host-shadow-manager.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Config, SubagentConfig } from '@wrongstack/core/types';
|
|
2
|
-
|
|
2
|
+
interface HostShadowPassContext {
|
|
3
3
|
getDirector: () => {
|
|
4
4
|
isWorkComplete(): boolean;
|
|
5
5
|
} | undefined;
|
|
@@ -9,6 +9,13 @@ export interface HostShadowPassContext {
|
|
|
9
9
|
setQueuedProblem: (value: string | null) => void;
|
|
10
10
|
setPassInFlight: (value: boolean) => void;
|
|
11
11
|
getHeartbeatIntervalMs: () => number;
|
|
12
|
+
/**
|
|
13
|
+
* Conversation this review belongs to. Stamped onto the spawn so the
|
|
14
|
+
* coordinator files the reviewer under the tab whose work went wrong —
|
|
15
|
+
* without it every tab's shadow agent landed in the boot tab's roster and
|
|
16
|
+
* reported to the boot tab's leader.
|
|
17
|
+
*/
|
|
18
|
+
sessionId?: string | undefined;
|
|
12
19
|
spawnAndAssign: (subagentConfig: SubagentConfig, task: string, opts: {
|
|
13
20
|
internalTask: true;
|
|
14
21
|
stopShadowAfterTask: true;
|
|
@@ -18,4 +25,5 @@ export interface HostShadowPassContext {
|
|
|
18
25
|
}
|
|
19
26
|
export declare function runHostShadowPass(ctx: HostShadowPassContext, reason: string): Promise<void>;
|
|
20
27
|
export declare function stopHostShadowAfterTask(stopSubagent: (subagentId: string) => Promise<void>, clearShadowAgent: (subagentId: string) => void, getObservedWorkDepth: () => number, getQueuedProblem: () => string | null, setQueuedProblem: (value: string | null) => void, requestShadowPass: (reason: string) => void, subagentId: string): Promise<void>;
|
|
28
|
+
export {};
|
|
21
29
|
//# sourceMappingURL=host-shadow-pass.d.ts.map
|
|
@@ -6,6 +6,15 @@ export interface HostSpawnOptions {
|
|
|
6
6
|
name?: string | undefined;
|
|
7
7
|
allowedCapabilities?: readonly string[] | undefined;
|
|
8
8
|
shadowIntervalMs?: number | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Conversation on whose behalf this spawn happens.
|
|
11
|
+
*
|
|
12
|
+
* The coordinator captures it once and the worker keeps it for life, so
|
|
13
|
+
* every event, mail and roster row it produces lands in the tab that asked.
|
|
14
|
+
* Omitted means the host's own session — correct for the CLI and the TUI,
|
|
15
|
+
* and the boot tab (not the caller) once several tabs share the process.
|
|
16
|
+
*/
|
|
17
|
+
originSessionId?: string | undefined;
|
|
9
18
|
/**
|
|
10
19
|
* Free-form task context propagated into the spawned `TaskSpec.context`.
|
|
11
20
|
* Used by `/kanban task dispatch` (and the WebUI relay) to carry
|
|
@@ -53,7 +53,7 @@ export interface FleetHostUsage {
|
|
|
53
53
|
durationMs: number;
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
interface FleetHostStatusInputs {
|
|
57
57
|
coordinatorStatus?: {
|
|
58
58
|
subagents: readonly {
|
|
59
59
|
id: string;
|
|
@@ -76,4 +76,5 @@ export declare function formatFleetBudgetLines(budget: FleetBudgetView, colorize
|
|
|
76
76
|
amber: (s: string) => string;
|
|
77
77
|
}): string[];
|
|
78
78
|
export declare function aggregateFleetUsage(completed: readonly TaskResult[]): FleetHostUsage;
|
|
79
|
+
export {};
|
|
79
80
|
//# sourceMappingURL=host-status.d.ts.map
|
|
@@ -2,7 +2,7 @@ import { type AgentFactory, type DirectorSessionFactory } from '@wrongstack/core
|
|
|
2
2
|
import type { ToolRegistry } from '@wrongstack/core/registry';
|
|
3
3
|
import type { Config, SubagentConfig, Tool } from '@wrongstack/core/types';
|
|
4
4
|
import type { MultiAgentDeps, MultiAgentHostOptions } from './host-types.js';
|
|
5
|
-
|
|
5
|
+
interface HostSubagentFactoryContext {
|
|
6
6
|
deps: MultiAgentDeps;
|
|
7
7
|
opts: MultiAgentHostOptions;
|
|
8
8
|
roster: Record<string, SubagentConfig>;
|
|
@@ -13,4 +13,5 @@ export interface HostSubagentFactoryContext {
|
|
|
13
13
|
subagentToolRegistry: (allow?: string[]) => ToolRegistry;
|
|
14
14
|
}
|
|
15
15
|
export declare function createHostSubagentFactory(config: Config, host: HostSubagentFactoryContext): AgentFactory;
|
|
16
|
+
export {};
|
|
16
17
|
//# sourceMappingURL=host-subagent-factory.d.ts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* host-subagent-session-audit — the tool-lifecycle and session-lifecycle
|
|
3
|
+
* records a subagent's own JSONL was missing.
|
|
4
|
+
*
|
|
5
|
+
* A subagent gets a real `DefaultSessionStore` writer, the same engine the
|
|
6
|
+
* leader uses, so its transcript carries `session_start`, `user_input`,
|
|
7
|
+
* `llm_request`/`llm_response`, `tool_result` and the message journal. Two
|
|
8
|
+
* things never reached it, both for the same structural reason: the leader's
|
|
9
|
+
* copies are written by `cli/src/session-event-wiring.ts`, which subscribes to
|
|
10
|
+
* the HOST EventBus, while every subagent runs on a private `new EventBus()`
|
|
11
|
+
* (see host-subagent-factory). Nothing was subscribed on that side.
|
|
12
|
+
*
|
|
13
|
+
* The consequences were measurable — over a 3,156-transcript corpus, not one
|
|
14
|
+
* subagent JSONL contained a `tool_call_start`, `tool_call_end`, or
|
|
15
|
+
* `session_end`:
|
|
16
|
+
*
|
|
17
|
+
* - `SessionSummaryTracker` counts tool calls from `tool_call_start`, so every
|
|
18
|
+
* subagent summary reported `toolCallCount: 0` and an empty `toolBreakdown`
|
|
19
|
+
* no matter how much work it did.
|
|
20
|
+
* - With no `session_end`, `summarizeSessionEventSequence` never sees the
|
|
21
|
+
* terminal marker, so a cleanly finished subagent is indistinguishable from
|
|
22
|
+
* one killed mid-flight, and `SessionRecovery` treats both as stale.
|
|
23
|
+
*
|
|
24
|
+
* Audit gating mirrors the leader: `tool_call_start`/`tool_call_end` are
|
|
25
|
+
* STANDARD-level events, so a `minimal` auditLevel drops them here too, exactly
|
|
26
|
+
* as `SessionEventBridge` would. `session_end` is a core reconstruct event and
|
|
27
|
+
* is always written.
|
|
28
|
+
*/
|
|
29
|
+
import type { EventBus } from '@wrongstack/core/kernel';
|
|
30
|
+
import type { SessionEventBridge } from '@wrongstack/core/storage';
|
|
31
|
+
import type { SessionWriter, TokenCounter } from '@wrongstack/core/types';
|
|
32
|
+
interface SubagentSessionAudit {
|
|
33
|
+
/**
|
|
34
|
+
* Append `session_end` carrying this subagent's own cumulative usage, then
|
|
35
|
+
* drop the tool subscriptions. Call before `session.close()` — close()
|
|
36
|
+
* finalizes the summary sidecar, and a `session_end` appended after it would
|
|
37
|
+
* miss that snapshot.
|
|
38
|
+
*
|
|
39
|
+
* Idempotent: a second call is a no-op, so a dispose path that runs twice
|
|
40
|
+
* cannot write two terminal markers (`metaFromEvents` takes the LAST
|
|
41
|
+
* `session_end`, but recovery treats any trailing marker as a clean exit).
|
|
42
|
+
*/
|
|
43
|
+
finalize(): Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
export declare function installSubagentSessionAudit(opts: {
|
|
46
|
+
/** The subagent's private EventBus. */
|
|
47
|
+
events: EventBus;
|
|
48
|
+
/** The subagent's own JSONL writer. */
|
|
49
|
+
session: SessionWriter;
|
|
50
|
+
/** The subagent's own counter — never the leader's. */
|
|
51
|
+
tokenCounter: TokenCounter;
|
|
52
|
+
/** Shared audit-level gate, so subagents honor the same config as the leader. */
|
|
53
|
+
bridge: Pick<SessionEventBridge, 'allows'>;
|
|
54
|
+
}): SubagentSessionAudit;
|
|
55
|
+
export {};
|
|
56
|
+
//# sourceMappingURL=host-subagent-session-audit.d.ts.map
|
|
@@ -2,15 +2,25 @@ import { type Director, FleetSupervisor } from '@wrongstack/core/coordination';
|
|
|
2
2
|
import type { EventBus } from '@wrongstack/core/kernel';
|
|
3
3
|
import type { Config, SubagentConfig } from '@wrongstack/core/types';
|
|
4
4
|
import type { MultiAgentHostOptions } from './host-types.js';
|
|
5
|
-
|
|
5
|
+
interface HostFleetSupervisorInput {
|
|
6
6
|
director: Director | undefined;
|
|
7
7
|
brain: MultiAgentHostOptions['brain'];
|
|
8
8
|
supervisorConfig: NonNullable<Config['fleet']>['supervisor'] | undefined;
|
|
9
9
|
events: EventBus;
|
|
10
10
|
sessionId: string;
|
|
11
|
+
/**
|
|
12
|
+
* The conversation a worker belongs to, from the coordinator's spawn-time
|
|
13
|
+
* stamp. The supervisor watches ONE fleet — that part is genuinely
|
|
14
|
+
* process-wide — but everything it SAYS is addressed: a steer is delivered
|
|
15
|
+
* through the session-note hub, which routes strictly by session, so a note
|
|
16
|
+
* posted under the host's own session never reached a worker spawned by any
|
|
17
|
+
* other tab, and the leader told about it was the wrong one.
|
|
18
|
+
*/
|
|
19
|
+
sessionFor?: ((subagentId: string) => string) | undefined;
|
|
11
20
|
mailboxProjectDir: string;
|
|
12
21
|
roster: Record<string, SubagentConfig>;
|
|
13
22
|
getLeaderMailboxId?: (() => string | undefined) | undefined;
|
|
14
23
|
}
|
|
15
24
|
export declare function createHostFleetSupervisor(input: HostFleetSupervisorInput): FleetSupervisor | null;
|
|
25
|
+
export {};
|
|
16
26
|
//# sourceMappingURL=host-supervisor.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type TaskResultNotification } from '@wrongstack/core/coordination';
|
|
2
2
|
import type { EventBus } from '@wrongstack/core/kernel';
|
|
3
|
-
|
|
3
|
+
type ReportTaskResultToLeaderOptions = {
|
|
4
4
|
notification: TaskResultNotification;
|
|
5
5
|
sessionId: string;
|
|
6
6
|
mailboxProjectDir: string;
|
|
@@ -8,4 +8,5 @@ export type ReportTaskResultToLeaderOptions = {
|
|
|
8
8
|
getLeaderMailboxId?: (() => string | undefined) | undefined;
|
|
9
9
|
};
|
|
10
10
|
export declare function reportTaskResultToLeader({ notification: n, sessionId, mailboxProjectDir, events, getLeaderMailboxId, }: ReportTaskResultToLeaderOptions): Promise<void>;
|
|
11
|
+
export {};
|
|
11
12
|
//# sourceMappingURL=host-task-result-report.d.ts.map
|