@@ -31,17 +31,13 @@ import * as Queue from "effect/Queue";
3131import * as Schema from "effect/Schema" ;
3232import * as Stream from "effect/Stream" ;
3333
34- import { ProviderHost } from "@t3tools/provider-core/server/ProviderHost" ;
34+ import * as ProviderHost from "@t3tools/provider-core/server/ProviderHost" ;
3535import { layerTestProviderHost } from "@t3tools/provider-testing/host" ;
3636import * as McpProviderSession from "@t3tools/provider-core/server/mcpSession" ;
3737import type { MuseItem } from "./protocol.ts" ;
3838import type { MuseSdkHost } from "./sdk.ts" ;
3939import * as IdAllocator from "@t3tools/provider-core/server/IdAllocator" ;
40- import {
41- ProviderAdapterV2RuntimePolicy ,
42- type ProviderAdapterV2Event ,
43- type ProviderAdapterV2TurnInput ,
44- } from "@t3tools/provider-core/server/ProviderAdapter" ;
40+ import * as ProviderAdapter from "@t3tools/provider-core/server/ProviderAdapter" ;
4541import type { ProviderContinuationRequest } from "@t3tools/provider-core/server/continuationRequests" ;
4642import { makeMuseAdapterV2 , type MuseAdapterV2Options } from "./adapter.ts" ;
4743
@@ -55,7 +51,7 @@ const INSTANCE_ID = ProviderInstanceId.make("muse_work");
5551const THREAD_ID = ThreadId . make ( "thread-muse-test" ) ;
5652const MODEL = "muse-spark-1.3-contributor" ;
5753const museSettings = Schema . decodeSync ( MuseSettings ) ( { enabled : true } ) ;
58- const runtimePolicy = ProviderAdapterV2RuntimePolicy . make ( {
54+ const runtimePolicy = ProviderAdapter . ProviderAdapterV2RuntimePolicy . make ( {
5955 runtimeMode : "full-access" ,
6056 interactionMode : "default" ,
6157 cwd : null ,
@@ -204,7 +200,7 @@ const makeHarness = Effect.fnUntraced(function* (
204200 settings : museSettings ,
205201 environment : { PATH : "/fake/bin" } ,
206202 idAllocator : yield * IdAllocator . IdAllocatorV2 ,
207- host : yield * ProviderHost ,
203+ host : yield * ProviderHost . ProviderHost ,
208204 fileSystem : yield * FileSystem . FileSystem ,
209205 createHost : async ( ) => ( hostCount ++ === 0 ? fake . host : ( replacement ?? fake ) . host ) ,
210206 ...overrides ,
@@ -216,8 +212,8 @@ const makeHarness = Effect.fnUntraced(function* (
216212 runtimePolicy : policy ,
217213 ...( initialNativeThreadId ? { initialNativeThreadId } : { } ) ,
218214 } ) ;
219- const emitted = yield * Queue . unbounded < ProviderAdapterV2Event > ( ) ;
220- const allEvents : ProviderAdapterV2Event [ ] = [ ] ;
215+ const emitted = yield * Queue . unbounded < ProviderAdapter . ProviderAdapterV2Event > ( ) ;
216+ const allEvents : ProviderAdapter . ProviderAdapterV2Event [ ] = [ ] ;
221217 const eventsEnded = yield * Deferred . make < Exit . Exit < void , Stream . Error < typeof runtime . events > > > ( ) ;
222218 yield * runtime . events . pipe (
223219 Stream . runForEach ( ( event ) =>
@@ -236,14 +232,21 @@ const makeHarness = Effect.fnUntraced(function* (
236232 runtimePolicy : policy ,
237233 ...( existingProviderThread ? { existingProviderThread } : { } ) ,
238234 } ) ;
239- const takeEvent = Effect . fnUntraced ( function * < T extends ProviderAdapterV2Event [ "type" ] > (
235+ const takeEvent = Effect . fnUntraced ( function * <
236+ T extends ProviderAdapter . ProviderAdapterV2Event [ "type" ] ,
237+ > (
240238 type : T ,
241- predicate : ( event : Extract < ProviderAdapterV2Event , { type : T } > ) => boolean = ( ) => true ,
239+ predicate : (
240+ event : Extract < ProviderAdapter . ProviderAdapterV2Event , { type : T } > ,
241+ ) => boolean = ( ) => true ,
242242 ) {
243243 while ( true ) {
244244 const event = yield * Queue . take ( emitted ) ;
245- if ( event . type === type && predicate ( event as Extract < ProviderAdapterV2Event , { type : T } > ) ) {
246- return event as Extract < ProviderAdapterV2Event , { type : T } > ;
245+ if (
246+ event . type === type &&
247+ predicate ( event as Extract < ProviderAdapter . ProviderAdapterV2Event , { type : T } > )
248+ ) {
249+ return event as Extract < ProviderAdapter . ProviderAdapterV2Event , { type : T } > ;
247250 }
248251 }
249252 } ) ;
@@ -275,7 +278,7 @@ const turnInput = Effect.fnUntraced(function* (
275278 providerThread : OrchestrationV2ProviderThread ,
276279 runOrdinal = 1 ,
277280 policy = runtimePolicy ,
278- ) : Effect . fn . Return < ProviderAdapterV2TurnInput > {
281+ ) : Effect . fn . Return < ProviderAdapter . ProviderAdapterV2TurnInput > {
279282 const now = yield * DateTime . now ;
280283 const threadId = providerThread . appThreadId ?? THREAD_ID ;
281284 const selection = modelSelection ( providerThread . providerInstanceId ) ;
@@ -436,7 +439,7 @@ describe("MuseAdapterV2", () => {
436439 settings : museSettings ,
437440 environment : { PATH : "/fake/bin" } ,
438441 idAllocator : yield * IdAllocator . IdAllocatorV2 ,
439- host : yield * ProviderHost ,
442+ host : yield * ProviderHost . ProviderHost ,
440443 fileSystem : yield * FileSystem . FileSystem ,
441444 createHost : async ( ) => fake . host ,
442445 } ) ;
@@ -833,7 +836,7 @@ describe("MuseAdapterV2", () => {
833836 it . effect ( "keeps a workflow child's approval pending for the user past the turn's end" , ( ) =>
834837 Effect . gen ( function * ( ) {
835838 const fake = yield * makeFakeMuse ( ) ;
836- const policy = ProviderAdapterV2RuntimePolicy . make ( {
839+ const policy = ProviderAdapter . ProviderAdapterV2RuntimePolicy . make ( {
837840 ...runtimePolicy ,
838841 runtimeMode : "approval-required" ,
839842 } ) ;
0 commit comments