Replace for-await stream consumption in watchChildAgent with waitForIdle() + onClose() callbacks on AsyncAgent. This prevents conflict with Hub.consumeAgent() which also reads the Channel. Add shutdownSubagentRegistry() for clean Hub shutdown, guard Hub access with isHubInitialized(), and clean resumedRuns in sweep. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
38 lines
835 B
TypeScript
38 lines
835 B
TypeScript
/**
|
|
* Subagent orchestration system.
|
|
*
|
|
* Provides child agent spawning, lifecycle management,
|
|
* persistent registry, and result announcement flow.
|
|
*/
|
|
|
|
export type {
|
|
SubagentRunOutcome,
|
|
SubagentRunRecord,
|
|
RegisterSubagentRunParams,
|
|
SubagentAnnounceParams,
|
|
SubagentSystemPromptParams,
|
|
} from "./types.js";
|
|
|
|
export {
|
|
initSubagentRegistry,
|
|
registerSubagentRun,
|
|
listSubagentRuns,
|
|
releaseSubagentRun,
|
|
getSubagentRun,
|
|
resetSubagentRegistryForTests,
|
|
shutdownSubagentRegistry,
|
|
} from "./registry.js";
|
|
|
|
export {
|
|
buildSubagentSystemPrompt,
|
|
readLatestAssistantReply,
|
|
formatAnnouncementMessage,
|
|
runSubagentAnnounceFlow,
|
|
} from "./announce.js";
|
|
export type { FormatAnnouncementParams } from "./announce.js";
|
|
|
|
export {
|
|
loadSubagentRuns,
|
|
saveSubagentRuns,
|
|
getSubagentStorePath,
|
|
} from "./registry-store.js";
|