@@ -57,14 +57,8 @@ import { threadShellFromProjection } from "../orchestration-v2/ProjectionStore.t
5757import * as EventSink from "../orchestration-v2/EventSink.ts" ;
5858import * as Orchestrator from "../orchestration-v2/Orchestrator.ts" ;
5959import * as ThreadManagementService from "../orchestration-v2/ThreadManagementService.ts" ;
60- import {
61- type ProviderAdapterV2Event ,
62- ProviderAdapterProtocolError ,
63- type ProviderAdapterV2Shape ,
64- type ProviderAdapterV2TurnInput ,
65- } from "@t3tools/provider-core/server/ProviderAdapter" ;
6660import * as ProviderAdapterRegistry from "../orchestration-v2/ProviderAdapterRegistry.ts" ;
67- import * as ProviderContinuationRequests from "@t3tools/provider-core/server/continuationRequests " ;
61+ import * as ProviderContinuationRequests from "@t3tools/provider-core/server/ProviderContinuationRequests " ;
6862import { checkpointWorkspace } from "@t3tools/provider-testing/replayWorkspace" ;
6963import * as ProviderReplayHarness from "../orchestration-v2/testkit/ProviderReplayHarness.ts" ;
7064import {
@@ -79,6 +73,7 @@ import * as ServerSecretStore from "../auth/ServerSecretStore.ts";
7973import * as McpHttpServer from "./McpHttpServer.ts" ;
8074import * as McpInvocationContext from "./McpInvocationContext.ts" ;
8175import { delegatedTaskRun , hasPendingChildRuns } from "./OrchestratorMcpService.ts" ;
76+ import * as ProviderAdapter from "@t3tools/provider-core/server/ProviderAdapter" ;
8277
8378// Effect returns a declared tool failure as `isError` with its encoded payload
8479// as JSON text, never as `structuredContent`.
@@ -146,7 +141,7 @@ interface CapturedTurn {
146141}
147142
148143function unsupported ( driver : ProviderDriverKind , detail : string ) {
149- return Effect . fail ( new ProviderAdapterProtocolError ( { driver, detail } ) ) ;
144+ return Effect . fail ( new ProviderAdapter . ProviderAdapterProtocolError ( { driver, detail } ) ) ;
150145}
151146
152147function makeProviderSnapshot ( input : {
@@ -185,18 +180,20 @@ function makeDeterministicAdapter(input: {
185180 readonly driver : ProviderDriverKind ;
186181 readonly capabilities : OrchestrationV2ProviderCapabilities ;
187182 readonly capturedTurns : Ref . Ref < ReadonlyArray < CapturedTurn > > ;
188- readonly shouldComplete : ( turn : ProviderAdapterV2TurnInput ) => boolean ;
189- readonly terminalGate ?: ( turn : ProviderAdapterV2TurnInput ) => Deferred . Deferred < void > | undefined ;
190- readonly response : ( turn : ProviderAdapterV2TurnInput ) => string ;
191- } ) : ProviderAdapterV2Shape {
183+ readonly shouldComplete : ( turn : ProviderAdapter . ProviderAdapterV2TurnInput ) => boolean ;
184+ readonly terminalGate ?: (
185+ turn : ProviderAdapter . ProviderAdapterV2TurnInput ,
186+ ) => Deferred . Deferred < void > | undefined ;
187+ readonly response : ( turn : ProviderAdapter . ProviderAdapterV2TurnInput ) => string ;
188+ } ) : ProviderAdapter . ProviderAdapterV2 [ "Service" ] {
192189 return {
193190 instanceId : input . instanceId ,
194191 driver : input . driver ,
195192 getCapabilities : ( ) => Effect . succeed ( input . capabilities ) ,
196193 planSelectionTransition : ( ) => Effect . succeed ( { type : "apply_on_next_turn" } ) ,
197194 openSession : ( sessionInput ) =>
198195 Effect . gen ( function * ( ) {
199- const events = yield * PubSub . unbounded < ProviderAdapterV2Event > ( ) ;
196+ const events = yield * PubSub . unbounded < ProviderAdapter . ProviderAdapterV2Event > ( ) ;
200197 const now = yield * DateTime . now ;
201198 const providerSession : OrchestrationV2ProviderSession = {
202199 id : sessionInput . providerSessionId ,
@@ -211,12 +208,12 @@ function makeDeterministicAdapter(input: {
211208 lastError : null ,
212209 } ;
213210
214- const publish = ( providerEvents : ReadonlyArray < ProviderAdapterV2Event > ) =>
211+ const publish = ( providerEvents : ReadonlyArray < ProviderAdapter . ProviderAdapterV2Event > ) =>
215212 Effect . forEach ( providerEvents , ( event ) => PubSub . publish ( events , event ) , {
216213 discard : true ,
217214 } ) ;
218215 const runOrdinals = new Map < ProviderTurnId , number > ( ) ;
219- const turnInputs = new Map < ProviderTurnId , ProviderAdapterV2TurnInput > ( ) ;
216+ const turnInputs = new Map < ProviderTurnId , ProviderAdapter . ProviderAdapterV2TurnInput > ( ) ;
220217
221218 return {
222219 instanceId : input . instanceId ,
0 commit comments