@@ -10,7 +10,7 @@ import {
1010 resetRuntimeTaskTestState ,
1111} from "./runtime-task-test-harness.js" ;
1212import { createRuntimeTaskFlow } from "./runtime-taskflow.js" ;
13- import { createRuntimeTaskFlows , createRuntimeTaskRuns } from "./runtime-tasks.js" ;
13+ import { createRuntimeTasks } from "./runtime-tasks.js" ;
1414
1515const runtimeTaskMocks = getRuntimeTaskMocks ( ) ;
1616
@@ -48,23 +48,26 @@ describe("runtime tasks", () => {
4848 } ) ;
4949
5050 it ( "exposes canonical task and TaskFlow DTOs without leaking raw registry fields" , ( ) => {
51- const legacyTaskFlow = createRuntimeTaskFlow ( ) . bindSession ( {
51+ const runtimeTasks = createRuntimeTasks ( {
52+ legacyTaskFlow : createRuntimeTaskFlow ( ) ,
53+ } ) ;
54+ const legacyTaskFlow = runtimeTasks . managedFlows . bindSession ( {
5255 sessionKey : "agent:main:main" ,
5356 requesterOrigin : {
5457 channel : "telegram" ,
5558 to : "telegram:123" ,
5659 } ,
5760 } ) ;
58- const taskFlows = createRuntimeTaskFlows ( ) . bindSession ( {
61+ const taskFlows = runtimeTasks . flows . bindSession ( {
5962 sessionKey : "agent:main:main" ,
6063 } ) ;
61- const taskRuns = createRuntimeTaskRuns ( ) . bindSession ( {
64+ const taskRuns = runtimeTasks . runs . bindSession ( {
6265 sessionKey : "agent:main:main" ,
6366 } ) ;
64- const otherTaskFlows = createRuntimeTaskFlows ( ) . bindSession ( {
67+ const otherTaskFlows = runtimeTasks . flows . bindSession ( {
6568 sessionKey : "agent:main:other" ,
6669 } ) ;
67- const otherTaskRuns = createRuntimeTaskRuns ( ) . bindSession ( {
70+ const otherTaskRuns = runtimeTasks . runs . bindSession ( {
6871 sessionKey : "agent:main:other" ,
6972 } ) ;
7073
@@ -145,10 +148,13 @@ describe("runtime tasks", () => {
145148 } ) ;
146149
147150 it ( "maps task cancellation results onto canonical task DTOs" , async ( ) => {
148- const legacyTaskFlow = createRuntimeTaskFlow ( ) . bindSession ( {
151+ const runtimeTasks = createRuntimeTasks ( {
152+ legacyTaskFlow : createRuntimeTaskFlow ( ) ,
153+ } ) ;
154+ const legacyTaskFlow = runtimeTasks . managedFlows . bindSession ( {
149155 sessionKey : "agent:main:main" ,
150156 } ) ;
151- const taskRuns = createRuntimeTaskRuns ( ) . bindSession ( {
157+ const taskRuns = runtimeTasks . runs . bindSession ( {
152158 sessionKey : "agent:main:main" ,
153159 } ) ;
154160
@@ -191,10 +197,13 @@ describe("runtime tasks", () => {
191197 } ) ;
192198
193199 it ( "routes runtime task cancellation through the detached task runtime seam" , async ( ) => {
194- const legacyTaskFlow = createRuntimeTaskFlow ( ) . bindSession ( {
200+ const runtimeTasks = createRuntimeTasks ( {
201+ legacyTaskFlow : createRuntimeTaskFlow ( ) ,
202+ } ) ;
203+ const legacyTaskFlow = runtimeTasks . managedFlows . bindSession ( {
195204 sessionKey : "agent:main:main" ,
196205 } ) ;
197- const taskRuns = createRuntimeTaskRuns ( ) . bindSession ( {
206+ const taskRuns = runtimeTasks . runs . bindSession ( {
198207 sessionKey : "agent:main:main" ,
199208 } ) ;
200209
@@ -240,10 +249,13 @@ describe("runtime tasks", () => {
240249 } ) ;
241250
242251 it ( "does not allow cross-owner task cancellation or leak task details" , async ( ) => {
243- const legacyTaskFlow = createRuntimeTaskFlow ( ) . bindSession ( {
252+ const runtimeTasks = createRuntimeTasks ( {
253+ legacyTaskFlow : createRuntimeTaskFlow ( ) ,
254+ } ) ;
255+ const legacyTaskFlow = runtimeTasks . managedFlows . bindSession ( {
244256 sessionKey : "agent:main:main" ,
245257 } ) ;
246- const otherTaskRuns = createRuntimeTaskRuns ( ) . bindSession ( {
258+ const otherTaskRuns = runtimeTasks . runs . bindSession ( {
247259 sessionKey : "agent:main:other" ,
248260 } ) ;
249261
0 commit comments