@@ -13,7 +13,7 @@ import {
1313import type { AgentInfo } from '../../adapters/AgentAdapter.js' ;
1414import type { AgentRegistry , RegistryEntry } from '../../utils/AgentRegistry.js' ;
1515import type { TmuxManager } from '../../terminal/TmuxManager.js' ;
16- import type { HerdrInteractiveRuntime } from '../../runtime/AgentRuntime .js' ;
16+ import type { InteractiveAgentRuntime } from '../../runtime/types .js' ;
1717
1818function makeAgent ( overrides : Partial < AgentInfo > = { } ) : AgentInfo {
1919 return {
@@ -53,7 +53,7 @@ function makeRegistry(over: Partial<AgentRegistry> = {}): AgentRegistry {
5353 } as unknown as AgentRegistry ;
5454}
5555
56- function makeRuntime ( over : Partial < HerdrInteractiveRuntime > = { } ) : HerdrInteractiveRuntime {
56+ function makeRuntime ( over : Partial < InteractiveAgentRuntime > = { } ) : InteractiveAgentRuntime {
5757 return {
5858 provider : 'herdr' ,
5959 isAvailable : vi . fn ( ) . mockResolvedValue ( { ok : true , insideRuntime : false } ) ,
@@ -67,7 +67,7 @@ function makeRuntime(over: Partial<HerdrInteractiveRuntime> = {}): HerdrInteract
6767 focus : vi . fn ( ) . mockResolvedValue ( true ) ,
6868 stop : vi . fn ( ) . mockResolvedValue ( undefined ) ,
6969 ...over ,
70- } as unknown as HerdrInteractiveRuntime ;
70+ } as unknown as InteractiveAgentRuntime ;
7171}
7272
7373const startOpts : StartAgentOptions = {
@@ -157,7 +157,9 @@ describe('stopAgent', () => {
157157 killProcess,
158158 } ) ;
159159
160- expect ( runtime . stop ) . toHaveBeenCalledWith ( { runtimeRef : { session : 'default' , paneId : 'w1:p2' } } ) ;
160+ expect ( runtime . stop ) . toHaveBeenCalledWith ( expect . objectContaining ( {
161+ runtimeRef : { session : 'default' , paneId : 'w1:p2' } ,
162+ } ) ) ;
161163 expect ( killProcess ) . not . toHaveBeenCalled ( ) ;
162164 expect ( result . runtime ) . toBe ( 'herdr' ) ;
163165 } ) ;
@@ -227,7 +229,7 @@ describe('focusAgent', () => {
227229
228230 const result = await focusAgent ( makeAgent ( ) , { registry, runtime, focusManager } ) ;
229231
230- expect ( runtime . focus ) . toHaveBeenCalledWith ( { runtimeRef } ) ;
232+ expect ( runtime . focus ) . toHaveBeenCalledWith ( expect . objectContaining ( { runtimeRef } ) ) ;
231233 expect ( focusManager . findTerminal ) . not . toHaveBeenCalled ( ) ;
232234 expect ( result ) . toEqual ( { focused : true } ) ;
233235 } ) ;
@@ -290,7 +292,10 @@ describe('sendAgentPrompt', () => {
290292 focusManager,
291293 } ) ;
292294
293- expect ( runtime . send ) . toHaveBeenCalledWith ( { runtimeRef, prompt : 'hello' } ) ;
295+ expect ( runtime . send ) . toHaveBeenCalledWith (
296+ expect . objectContaining ( { runtimeRef, prompt : 'hello' } ) ,
297+ expect . objectContaining ( { focusManager } ) ,
298+ ) ;
294299 expect ( focusManager . findTerminal ) . not . toHaveBeenCalled ( ) ;
295300 } ) ;
296301
0 commit comments