@@ -561,6 +561,40 @@ export namespace Subagent {
561561 } ,
562562 } )
563563 export type Completed = typeof Completed . Type
564+
565+ // Live coordination events for the event-decoupled subagent pipeline. The location-scoped
566+ // requester publishes Requested; the global executor (which owns SessionV2) drives the child
567+ // session and publishes Result. Keeping these live (non-durable) avoids a static dependency from
568+ // the location tool graph back through global SessionV2 -> LocationServiceMap, which would form a
569+ // layer cycle. Subagent restart recovery remains deferred with the rest of durable continuation.
570+ export const Requested = Event . define ( {
571+ type : "session.next.subagent.requested" ,
572+ schema : {
573+ ...Base ,
574+ subagentSessionID : SessionID ,
575+ agent : Schema . String ,
576+ task : Schema . String ,
577+ context : Schema . String . pipe ( optional ) ,
578+ background : Schema . Boolean ,
579+ mode : Schema . Union ( [ Schema . Literal ( "new" ) , Schema . Literal ( "resume" ) , Schema . Literal ( "fork" ) ] ) ,
580+ } ,
581+ } )
582+ export type Requested = typeof Requested . Type
583+
584+ export const Result = Event . define ( {
585+ type : "session.next.subagent.result" ,
586+ schema : {
587+ ...Base ,
588+ subagentSessionID : SessionID ,
589+ status : Schema . Union ( [ Schema . Literal ( "completed" ) , Schema . Literal ( "partial" ) ] ) ,
590+ output : Schema . String ,
591+ tokens : Schema . Struct ( {
592+ input : Schema . Finite ,
593+ output : Schema . Finite ,
594+ } ) ,
595+ } ,
596+ } )
597+ export type Result = typeof Result . Type
564598}
565599
566600export namespace WireSchema {
0 commit comments