@@ -41,7 +41,6 @@ type QaScenarioRuntimeDeps = {
4141 fetchJson : QaScenarioRuntimeFunction ;
4242 waitForGatewayHealthy : QaScenarioRuntimeFunction ;
4343 waitForTransportReady : QaScenarioRuntimeFunction ;
44- waitForQaChannelReady : QaScenarioRuntimeFunction ;
4544 browserRequest : QaScenarioRuntimeFunction ;
4645 waitForBrowserReady : QaScenarioRuntimeFunction ;
4746 browserOpenTab : QaScenarioRuntimeFunction ;
@@ -111,89 +110,16 @@ type QaScenarioRuntimeConstants = {
111110type QaScenarioRuntimeApi <
112111 TEnv extends QaScenarioRuntimeEnv = QaScenarioRuntimeEnv ,
113112 TDeps extends QaScenarioRuntimeDeps = QaScenarioRuntimeDeps ,
114- > = {
113+ > = TDeps & {
115114 env : TEnv ;
116115 lab : TEnv [ "lab" ] ;
117116 transport : TEnv [ "transport" ] ;
118117 state : TEnv [ "transport" ] [ "state" ] ;
119118 scenario : QaSeedScenarioWithSource ;
120119 config : Record < string , unknown > ;
121- fs : typeof NodeFs ;
122- path : typeof NodePath ;
123- sleep : ( ms ?: number ) => Promise < unknown > ;
124- randomUUID : ( ) => string ;
125- runScenario : TDeps [ "runScenario" ] ;
126120 waitForCondition : TEnv [ "transport" ] [ "waitForCondition" ] ;
127- waitForOutboundMessage : TDeps [ "waitForOutboundMessage" ] ;
128- waitForNoOutbound : TDeps [ "waitForNoOutbound" ] ;
129- waitForNoTransportOutbound : TDeps [ "waitForNoTransportOutbound" ] ;
130- recentOutboundSummary : TDeps [ "recentOutboundSummary" ] ;
131- formatConversationTranscript : TDeps [ "formatConversationTranscript" ] ;
132- readTransportTranscript : TDeps [ "readTransportTranscript" ] ;
133- formatTransportTranscript : TDeps [ "formatTransportTranscript" ] ;
134- fetchJson : TDeps [ "fetchJson" ] ;
135- waitForGatewayHealthy : TDeps [ "waitForGatewayHealthy" ] ;
136- waitForTransportReady : TDeps [ "waitForTransportReady" ] ;
137121 waitForChannelReady : TDeps [ "waitForTransportReady" ] ;
138- waitForQaChannelReady : TDeps [ "waitForQaChannelReady" ] ;
139- browserRequest : TDeps [ "browserRequest" ] ;
140- waitForBrowserReady : TDeps [ "waitForBrowserReady" ] ;
141- browserOpenTab : TDeps [ "browserOpenTab" ] ;
142- browserSnapshot : TDeps [ "browserSnapshot" ] ;
143- browserAct : TDeps [ "browserAct" ] ;
144- webOpenPage : TDeps [ "webOpenPage" ] ;
145- webWait : TDeps [ "webWait" ] ;
146- webType : TDeps [ "webType" ] ;
147- webSnapshot : TDeps [ "webSnapshot" ] ;
148- webEvaluate : TDeps [ "webEvaluate" ] ;
149- waitForConfigRestartSettle : TDeps [ "waitForConfigRestartSettle" ] ;
150- patchConfig : TDeps [ "patchConfig" ] ;
151- applyConfig : TDeps [ "applyConfig" ] ;
152- readConfigSnapshot : TDeps [ "readConfigSnapshot" ] ;
153- restartGatewayWithConfigPatch : TDeps [ "restartGatewayWithConfigPatch" ] ;
154- createSession : TDeps [ "createSession" ] ;
155- readEffectiveTools : TDeps [ "readEffectiveTools" ] ;
156- readSkillStatus : TDeps [ "readSkillStatus" ] ;
157- readRawQaSessionStore : TDeps [ "readRawQaSessionStore" ] ;
158- seedQaSessionTranscript : TDeps [ "seedQaSessionTranscript" ] ;
159- readGatewayLogs : TDeps [ "readGatewayLogs" ] ;
160- markGatewayLogCursor : TDeps [ "markGatewayLogCursor" ] ;
161- scanGatewayLogSentinels : TDeps [ "scanGatewayLogSentinels" ] ;
162- assertNoGatewayLogSentinels : TDeps [ "assertNoGatewayLogSentinels" ] ;
163- readSessionTranscriptSummary : TDeps [ "readSessionTranscriptSummary" ] ;
164- runQaCli : TDeps [ "runQaCli" ] ;
165- extractMediaPathFromText : TDeps [ "extractMediaPathFromText" ] ;
166- resolveGeneratedImagePath : TDeps [ "resolveGeneratedImagePath" ] ;
167- startAgentRun : TDeps [ "startAgentRun" ] ;
168- waitForAgentRun : TDeps [ "waitForAgentRun" ] ;
169- waitForAgentHistoryReply : TDeps [ "waitForAgentHistoryReply" ] ;
170- listCronJobs : TDeps [ "listCronJobs" ] ;
171- findManagedDreamingCronJob : TDeps [ "findManagedDreamingCronJob" ] ;
172- waitForCronRunCompletion : TDeps [ "waitForCronRunCompletion" ] ;
173- readDoctorMemoryStatus : TDeps [ "readDoctorMemoryStatus" ] ;
174- forceMemoryIndex : TDeps [ "forceMemoryIndex" ] ;
175- findSkill : TDeps [ "findSkill" ] ;
176- writeWorkspaceSkill : TDeps [ "writeWorkspaceSkill" ] ;
177- callPluginToolsMcp : TDeps [ "callPluginToolsMcp" ] ;
178- runAgentPrompt : TDeps [ "runAgentPrompt" ] ;
179- ensureImageGenerationConfigured : TDeps [ "ensureImageGenerationConfigured" ] ;
180- handleQaAction : TDeps [ "handleQaAction" ] ;
181- runRuntimeToolFixture : TDeps [ "runRuntimeToolFixture" ] ;
182- extractQaToolPayload : TDeps [ "extractQaToolPayload" ] ;
183- formatMemoryDreamingDay : TDeps [ "formatMemoryDreamingDay" ] ;
184- resolveSessionTranscriptsDirForAgent : TDeps [ "resolveSessionTranscriptsDirForAgent" ] ;
185- activeMemoryToggleKey : TDeps [ "activeMemoryToggleKey" ] ;
186- setActiveMemorySessionDisabled : TDeps [ "setActiveMemorySessionDisabled" ] ;
187- buildAgentSessionKey : TDeps [ "buildAgentSessionKey" ] ;
188- normalizeLowercaseStringOrEmpty : TDeps [ "normalizeLowercaseStringOrEmpty" ] ;
189- formatErrorMessage : TDeps [ "formatErrorMessage" ] ;
190- liveTurnTimeoutMs : TDeps [ "liveTurnTimeoutMs" ] ;
191- resolveQaLiveTurnTimeoutMs : TDeps [ "resolveQaLiveTurnTimeoutMs" ] ;
192- splitModelRef : TDeps [ "splitModelRef" ] ;
193- hasDiscoveryLabels : TDeps [ "hasDiscoveryLabels" ] ;
194- reportsDiscoveryScopeLeak : TDeps [ "reportsDiscoveryScopeLeak" ] ;
195- reportsMissingDiscoveryFiles : TDeps [ "reportsMissingDiscoveryFiles" ] ;
196- hasModelSwitchContinuitySignal : TDeps [ "hasModelSwitchContinuitySignal" ] ;
122+ waitForQaChannelReady : TDeps [ "waitForTransportReady" ] ;
197123 imageUnderstandingPngBase64 : string ;
198124 imageUnderstandingLargePngBase64 : string ;
199125 imageUnderstandingValidPngBase64 : string ;
@@ -222,98 +148,45 @@ export function createQaScenarioRuntimeApi<
222148 await params . deps . sleep ( 100 ) ;
223149 } ;
224150
225- return {
226- env : params . env ,
227- lab : params . env . lab ,
228- transport,
229- state : transportState ,
230- scenario : params . scenario ,
231- config : params . scenario . execution . config ?? { } ,
232- fs : params . deps . fs ,
233- path : params . deps . path ,
234- sleep : params . deps . sleep ,
235- randomUUID : params . deps . randomUUID ,
236- runScenario : params . deps . runScenario ,
237- waitForCondition : transport . waitForCondition ,
238- waitForOutboundMessage : params . deps . waitForOutboundMessage ,
239- waitForNoOutbound : params . deps . waitForNoOutbound ,
240- waitForNoTransportOutbound : params . deps . waitForNoTransportOutbound ,
241- recentOutboundSummary : params . deps . recentOutboundSummary ,
242- formatConversationTranscript : params . deps . formatConversationTranscript ,
243- readTransportTranscript : params . deps . readTransportTranscript ,
244- formatTransportTranscript : params . deps . formatTransportTranscript ,
245- fetchJson : params . deps . fetchJson ,
246- waitForGatewayHealthy : params . deps . waitForGatewayHealthy ,
247- waitForTransportReady : params . deps . waitForTransportReady ,
248- waitForChannelReady : params . deps . waitForTransportReady ,
249- waitForQaChannelReady : params . deps . waitForQaChannelReady ,
250- browserRequest : params . deps . browserRequest ,
251- waitForBrowserReady : params . deps . waitForBrowserReady ,
252- browserOpenTab : params . deps . browserOpenTab ,
253- browserSnapshot : params . deps . browserSnapshot ,
254- browserAct : params . deps . browserAct ,
255- webOpenPage : params . deps . webOpenPage ,
256- webWait : params . deps . webWait ,
257- webType : params . deps . webType ,
258- webSnapshot : params . deps . webSnapshot ,
259- webEvaluate : params . deps . webEvaluate ,
260- waitForConfigRestartSettle : params . deps . waitForConfigRestartSettle ,
261- patchConfig : params . deps . patchConfig ,
262- applyConfig : params . deps . applyConfig ,
263- readConfigSnapshot : params . deps . readConfigSnapshot ,
264- restartGatewayWithConfigPatch : params . deps . restartGatewayWithConfigPatch ,
265- createSession : params . deps . createSession ,
266- readEffectiveTools : params . deps . readEffectiveTools ,
267- readSkillStatus : params . deps . readSkillStatus ,
268- readRawQaSessionStore : params . deps . readRawQaSessionStore ,
269- seedQaSessionTranscript : params . deps . seedQaSessionTranscript ,
270- readGatewayLogs : params . deps . readGatewayLogs ,
271- markGatewayLogCursor : params . deps . markGatewayLogCursor ,
272- scanGatewayLogSentinels : params . deps . scanGatewayLogSentinels ,
273- assertNoGatewayLogSentinels : params . deps . assertNoGatewayLogSentinels ,
274- readSessionTranscriptSummary : params . deps . readSessionTranscriptSummary ,
275- runQaCli : params . deps . runQaCli ,
276- extractMediaPathFromText : params . deps . extractMediaPathFromText ,
277- resolveGeneratedImagePath : params . deps . resolveGeneratedImagePath ,
278- startAgentRun : params . deps . startAgentRun ,
279- waitForAgentRun : params . deps . waitForAgentRun ,
280- waitForAgentHistoryReply : params . deps . waitForAgentHistoryReply ,
281- listCronJobs : params . deps . listCronJobs ,
282- findManagedDreamingCronJob : params . deps . findManagedDreamingCronJob ,
283- waitForCronRunCompletion : params . deps . waitForCronRunCompletion ,
284- readDoctorMemoryStatus : params . deps . readDoctorMemoryStatus ,
285- forceMemoryIndex : params . deps . forceMemoryIndex ,
286- findSkill : params . deps . findSkill ,
287- writeWorkspaceSkill : params . deps . writeWorkspaceSkill ,
288- callPluginToolsMcp : params . deps . callPluginToolsMcp ,
289- runAgentPrompt : params . deps . runAgentPrompt ,
290- ensureImageGenerationConfigured : params . deps . ensureImageGenerationConfigured ,
291- handleQaAction : params . deps . handleQaAction ,
292- runRuntimeToolFixture : params . deps . runRuntimeToolFixture ,
293- extractQaToolPayload : params . deps . extractQaToolPayload ,
294- formatMemoryDreamingDay : params . deps . formatMemoryDreamingDay ,
295- resolveSessionTranscriptsDirForAgent : params . deps . resolveSessionTranscriptsDirForAgent ,
296- activeMemoryToggleKey : params . deps . activeMemoryToggleKey ,
297- setActiveMemorySessionDisabled : params . deps . setActiveMemorySessionDisabled ,
298- buildAgentSessionKey : params . deps . buildAgentSessionKey ,
299- normalizeLowercaseStringOrEmpty : params . deps . normalizeLowercaseStringOrEmpty ,
300- formatErrorMessage : params . deps . formatErrorMessage ,
301- liveTurnTimeoutMs : params . deps . liveTurnTimeoutMs ,
302- resolveQaLiveTurnTimeoutMs : params . deps . resolveQaLiveTurnTimeoutMs ,
303- splitModelRef : params . deps . splitModelRef ,
304- hasDiscoveryLabels : params . deps . hasDiscoveryLabels ,
305- reportsDiscoveryScopeLeak : params . deps . reportsDiscoveryScopeLeak ,
306- reportsMissingDiscoveryFiles : params . deps . reportsMissingDiscoveryFiles ,
307- hasModelSwitchContinuitySignal : params . deps . hasModelSwitchContinuitySignal ,
308- imageUnderstandingPngBase64 : params . constants . imageUnderstandingPngBase64 ,
309- imageUnderstandingLargePngBase64 : params . constants . imageUnderstandingLargePngBase64 ,
310- imageUnderstandingValidPngBase64 : params . constants . imageUnderstandingValidPngBase64 ,
311- getTransportSnapshot : transportState . getSnapshot . bind ( transportState ) ,
312- resetTransport : resetTransportState ,
313- injectInboundMessage : transportState . addInboundMessage . bind ( transportState ) ,
314- injectOutboundMessage : transportState . addOutboundMessage . bind ( transportState ) ,
315- readTransportMessage : transportState . readMessage . bind ( transportState ) ,
316- resetBus : resetTransportState ,
317- reset : resetTransportState ,
318- } ;
151+ return Object . assign (
152+ {
153+ env : params . env ,
154+ lab : params . env . lab ,
155+ transport,
156+ state : transportState ,
157+ scenario : params . scenario ,
158+ config : params . scenario . execution . config ?? { } ,
159+ fs : params . deps . fs ,
160+ path : params . deps . path ,
161+ sleep : params . deps . sleep ,
162+ randomUUID : params . deps . randomUUID ,
163+ runScenario : params . deps . runScenario ,
164+ waitForCondition : transport . waitForCondition ,
165+ waitForOutboundMessage : params . deps . waitForOutboundMessage ,
166+ waitForNoOutbound : params . deps . waitForNoOutbound ,
167+ waitForNoTransportOutbound : params . deps . waitForNoTransportOutbound ,
168+ recentOutboundSummary : params . deps . recentOutboundSummary ,
169+ formatConversationTranscript : params . deps . formatConversationTranscript ,
170+ readTransportTranscript : params . deps . readTransportTranscript ,
171+ formatTransportTranscript : params . deps . formatTransportTranscript ,
172+ fetchJson : params . deps . fetchJson ,
173+ waitForGatewayHealthy : params . deps . waitForGatewayHealthy ,
174+ waitForTransportReady : params . deps . waitForTransportReady ,
175+ waitForChannelReady : params . deps . waitForTransportReady ,
176+ waitForQaChannelReady : params . deps . waitForTransportReady ,
177+ } ,
178+ params . deps ,
179+ {
180+ imageUnderstandingPngBase64 : params . constants . imageUnderstandingPngBase64 ,
181+ imageUnderstandingLargePngBase64 : params . constants . imageUnderstandingLargePngBase64 ,
182+ imageUnderstandingValidPngBase64 : params . constants . imageUnderstandingValidPngBase64 ,
183+ getTransportSnapshot : transportState . getSnapshot . bind ( transportState ) ,
184+ resetTransport : resetTransportState ,
185+ injectInboundMessage : transportState . addInboundMessage . bind ( transportState ) ,
186+ injectOutboundMessage : transportState . addOutboundMessage . bind ( transportState ) ,
187+ readTransportMessage : transportState . readMessage . bind ( transportState ) ,
188+ resetBus : resetTransportState ,
189+ reset : resetTransportState ,
190+ } ,
191+ ) ;
319192}
0 commit comments