File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import {
22 applyWriteCommit ,
3+ buildEntityContext ,
34 type ConversationDiscourseState ,
45 type ConversationEntity ,
56 type ConversationTurn ,
67 createEmptyDiscourseState ,
78 deriveAmbiguity ,
89 type PendingWriteOperation ,
10+ renderEntityContext ,
911 type RoutedTurn ,
1012 routedTurnSchema ,
13+ taskSchema ,
1114 type TurnAmbiguity ,
1215 type TurnClassifierOutput ,
1316 type TurnInterpretation ,
@@ -75,6 +78,7 @@ export async function routeMessageTurn(
7578) : Promise < TurnRouterResult > {
7679 const discourseState = input . discourseState ?? createEmptyDiscourseState ( ) ;
7780 const entityRegistry = input . entityRegistry ?? [ ] ;
81+ const tasks = ( input . tasks ?? [ ] ) . map ( ( task ) => taskSchema . parse ( task ) ) ;
7882
7983 // Pipeline A: classify intent
8084 let classification = await classifyTurn ( {
@@ -122,6 +126,13 @@ export async function routeMessageTurn(
122126 turnType : classification . turnType ,
123127 priorPendingWriteOperation : priorOperation ,
124128 conversationContext : deriveConversationContext ( input . recentTurns ) ,
129+ entityContext : renderEntityContext (
130+ buildEntityContext ( {
131+ entityRegistry,
132+ tasks,
133+ discourseState,
134+ } ) ,
135+ ) ,
125136 } )
126137 : {
127138 operationKind : priorOperation ?. operationKind ?? "plan" ,
You can’t perform that action at this time.
0 commit comments