| ... | @@ -37,7 +37,13 @@ import * as McpProviderSession from "@t3tools/provider-core/server/mcpSession"; | ... | @@ -37,7 +37,13 @@ import * as McpProviderSession from "@t3tools/provider-core/server/mcpSession"; |
| 37 | import * as IdAllocator from "@t3tools/provider-core/server/IdAllocator"; | 37 | import * as IdAllocator from "@t3tools/provider-core/server/IdAllocator"; |
| 38 | import * as ProviderAdapter from "@t3tools/provider-core/server/ProviderAdapter"; | 38 | import * as ProviderAdapter from "@t3tools/provider-core/server/ProviderAdapter"; |
| 39 | import { handoffBudget } from "@t3tools/provider-core/server/handoffBudget"; | 39 | import { handoffBudget } from "@t3tools/provider-core/server/handoffBudget"; |
| 40 | import { makePiAdapterV2, PI_PROVIDER, type PiAdapterV2Options } from "./adapter.ts"; | 40 | import { HostProcessEnvironment } from "@t3tools/shared/hostProcess"; |
| | 41 | import { |
| | 42 | makePiAdapterV2, |
| | 43 | PiAdapterV2Driver, |
| | 44 | PI_PROVIDER, |
| | 45 | type PiAdapterV2Options, |
| | 46 | } from "./adapter.ts"; |
| 41 | import { makePiRpcConnection, type PiRpcRecord } from "./rpc.ts"; | 47 | import { makePiRpcConnection, type PiRpcRecord } from "./rpc.ts"; |
| 42 | | 48 | |
| 43 | const layerTest = Layer.mergeAll( | 49 | const layerTest = Layer.mergeAll( |
| ... | @@ -317,11 +323,28 @@ const makeAdapter = Effect.fnUntraced(function* ( | ... | @@ -317,11 +323,28 @@ const makeAdapter = Effect.fnUntraced(function* ( |
| 317 | ? forkFake.spawner.spawn(command) | 323 | ? forkFake.spawner.spawn(command) |
| 318 | : fake.spawner.spawn(command), | 324 | : fake.spawner.spawn(command), |
| 319 | ); | 325 | ); |
| | 326 | // Continuation cases go through the driver, which wires the offer from the |
| | 327 | // environment the way production does. |
| | 328 | if (continuationRequests !== undefined) { |
| | 329 | return yield* PiAdapterV2Driver.create({ |
| | 330 | instanceId: PI_INSTANCE_ID, |
| | 331 | displayName: undefined, |
| | 332 | enabled: true, |
| | 333 | environment: [], |
| | 334 | config: { enabled: true, binaryPath: "pi", launchArgs, customModels: [] }, |
| | 335 | }).pipe( |
| | 336 | Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner), |
| | 337 | Effect.provideService(HostProcessEnvironment, {}), |
| | 338 | Effect.provideService(ProviderContinuationRequests.ProviderContinuationRequests, { |
| | 339 | ...continuationRequests, |
| | 340 | take: Effect.never, |
| | 341 | }), |
| | 342 | ); |
| | 343 | } |
| 320 | return yield* makePiAdapterV2({ | 344 | return yield* makePiAdapterV2({ |
| 321 | instanceId: PI_INSTANCE_ID, | 345 | instanceId: PI_INSTANCE_ID, |
| 322 | settings: { enabled: true, binaryPath: "pi", launchArgs, customModels: [] }, | 346 | settings: { enabled: true, binaryPath: "pi", launchArgs, customModels: [] }, |
| 323 | environment: {}, | 347 | environment: {}, |
| 324 | ...(continuationRequests === undefined ? {} : { continuationRequests }), | | |
| 325 | }).pipe(Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner)); | 348 | }).pipe(Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner)); |
| 326 | }); | 349 | }); |
| 327 | | 350 | |