Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

ProviderAdapter.ts

600 lines21.0 KB

1import type { OrchestrationV2HistoricalMessage } from "@t3tools/contracts";
2import {
3 ChatAttachment,
4 CheckpointId,
5 MessageId,
6 ModelSelection,
7 NodeId,
8 OrchestrationV2AppThread,
9 OrchestrationV2ConversationMessage,
10 OrchestrationV2ExecutionNode,
11 OrchestrationV2ProviderSession,
12 OrchestrationV2PlanArtifact,
13 OrchestrationV2ProviderCapabilities,
14 OrchestrationV2ProviderFailure,
15 OrchestrationV2ProviderRetry,
16 OrchestrationV2ProviderThread,
17 OrchestrationV2ProviderTurn,
18 OrchestrationV2RuntimeRequest,
19 OrchestrationV2Subagent,
20 OrchestrationV2TurnItem,
21 ProviderApprovalDecision,
22 ProviderInteractionMode,
23 ProviderDriverKind,
24 ProviderInstanceId,
25 PositiveInt,
26 ProviderUserInputAnswers,
27 ProviderSessionId,
28 ProviderThreadId,
29 ProviderTurnId,
30 RuntimeMode,
31 RuntimeRequestId,
32 RunAttemptId,
33 RunId,
34 ThreadId,
35} from "@t3tools/contracts";
36import * as Context from "effect/Context";
37import * as Schema from "effect/Schema";
38import type * as Effect from "effect/Effect";
39import type * as Scope from "effect/Scope";
40import type * as Stream from "effect/Stream";
41​
42import type {
43 ProviderSelectionTransitionInput,
44 ProviderSelectionTransitionPlan,
45} from "./ProviderSelectionTransition.ts";
46​
47export const ProviderAdapterV2RuntimePolicy = Schema.Struct({
48 runtimeMode: RuntimeMode,
49 interactionMode: ProviderInteractionMode,
50 cwd: Schema.NullOr(Schema.String),
51 approvalPolicy: Schema.optional(Schema.Unknown),
52 sandboxPolicy: Schema.optional(Schema.Unknown),
53 reasoningEffort: Schema.optional(Schema.String),
54});
55export type ProviderAdapterV2RuntimePolicy = typeof ProviderAdapterV2RuntimePolicy.Type;
56​
57export const ProviderAdapterV2TurnMessage = Schema.Struct({
58 messageId: MessageId,
59 text: Schema.String,
60 attachments: Schema.Array(ChatAttachment),
61 createdBy: OrchestrationV2ConversationMessage.fields.createdBy,
62 creationSource: OrchestrationV2ConversationMessage.fields.creationSource,
63 scheduledTaskId: OrchestrationV2ConversationMessage.fields.scheduledTaskId,
64 senderThreadId: OrchestrationV2ConversationMessage.fields.senderThreadId,
65});
66export type ProviderAdapterV2TurnMessage = typeof ProviderAdapterV2TurnMessage.Type;
67​
68export const ProviderAdapterV2SessionStatus = Schema.Literals([
69 "starting",
70 "ready",
71 "running",
72 "waiting",
73 "stopped",
74 "error",
75]);
76export type ProviderAdapterV2SessionStatus = typeof ProviderAdapterV2SessionStatus.Type;
77​
78export const ProviderAdapterV2Event = Schema.Union([
79 Schema.Struct({
80 type: Schema.Literal("app_thread.created"),
81 driver: ProviderDriverKind,
82 appThread: OrchestrationV2AppThread,
83 }),
84 Schema.Struct({
85 type: Schema.Literal("provider_session.updated"),
86 driver: ProviderDriverKind,
87 providerSession: OrchestrationV2ProviderSession,
88 }),
89 Schema.Struct({
90 type: Schema.Literal("provider_thread.updated"),
91 driver: ProviderDriverKind,
92 providerThread: OrchestrationV2ProviderThread,
93 }),
94 Schema.Struct({
95 type: Schema.Literal("provider_turn.updated"),
96 driver: ProviderDriverKind,
97 threadId: Schema.optional(ThreadId),
98 providerTurn: OrchestrationV2ProviderTurn,
99 }),
100 Schema.Struct({
101 type: Schema.Literal("node.updated"),
102 driver: ProviderDriverKind,
103 node: OrchestrationV2ExecutionNode,
104 }),
105 Schema.Struct({
106 type: Schema.Literal("subagent.updated"),
107 driver: ProviderDriverKind,
108 subagent: OrchestrationV2Subagent,
109 }),
110 Schema.Struct({
111 type: Schema.Literal("message.updated"),
112 driver: ProviderDriverKind,
113 message: OrchestrationV2ConversationMessage,
114 }),
115 Schema.Struct({
116 type: Schema.Literal("turn_item.updated"),
117 driver: ProviderDriverKind,
118 turnItem: OrchestrationV2TurnItem,
119 }),
120 Schema.Struct({
121 type: Schema.Literal("runtime_request.updated"),
122 driver: ProviderDriverKind,
123 threadId: Schema.optional(ThreadId),
124 runtimeRequest: OrchestrationV2RuntimeRequest,
125 }),
126 Schema.Struct({
127 type: Schema.Literal("plan.updated"),
128 driver: ProviderDriverKind,
129 plan: OrchestrationV2PlanArtifact,
130 }),
131 Schema.Struct({
132 type: Schema.Literal("turn.terminal"),
133 driver: ProviderDriverKind,
134 providerThreadId: ProviderThreadId,
135 providerTurnId: ProviderTurnId,
136 runOrdinal: PositiveInt,
137 status: Schema.Literals(["completed", "interrupted", "cancelled"]),
138 failure: Schema.Null,
139 threadDisposition: Schema.Literals(["reusable", "broken"]),
140 }),
141 Schema.Struct({
142 type: Schema.Literal("turn.terminal"),
143 driver: ProviderDriverKind,
144 providerThreadId: ProviderThreadId,
145 providerTurnId: ProviderTurnId,
146 runOrdinal: PositiveInt,
147 failureItemOrdinal: PositiveInt,
148 status: Schema.Literal("failed"),
149 failure: OrchestrationV2ProviderFailure,
150 retry: Schema.optional(OrchestrationV2ProviderRetry),
151 retryStartedAt: Schema.optional(Schema.DateTimeUtc),
152 threadDisposition: Schema.Literals(["reusable", "broken"]),
153 }),
154]);
155export type ProviderAdapterV2Event = typeof ProviderAdapterV2Event.Type;
156​
157export class ProviderAdapterCapabilitiesError extends Schema.TaggedError<ProviderAdapterCapabilitiesError>()(
158 "ProviderAdapterCapabilitiesError",
159 {
160 driver: ProviderDriverKind,
161 cause: Schema.optional(Schema.Defect()),
162 },
163) {
164 override get message(): string {
165 return `Failed to read ${this.driver} provider capabilities.`;
166 }
168​
169export class ProviderAdapterOpenSessionError extends Schema.TaggedError<ProviderAdapterOpenSessionError>()(
170 "ProviderAdapterOpenSessionError",
171 {
172 driver: ProviderDriverKind,
173 providerSessionId: ProviderSessionId,
174 cause: Schema.optional(Schema.Defect()),
175 },
176) {
177 override get message(): string {
178 return `Failed to open ${this.driver} provider session ${this.providerSessionId}.`;
179 }
181​
182export class ProviderAdapterCloseSessionError extends Schema.TaggedError<ProviderAdapterCloseSessionError>()(
183 "ProviderAdapterCloseSessionError",
184 {
185 driver: ProviderDriverKind,
186 providerSessionId: ProviderSessionId,
187 cause: Schema.optional(Schema.Defect()),
188 },
189) {
190 override get message(): string {
191 return `Failed to close ${this.driver} provider session ${this.providerSessionId}.`;
192 }
194​
195export class ProviderAdapterResumeThreadError extends Schema.TaggedError<ProviderAdapterResumeThreadError>()(
196 "ProviderAdapterResumeThreadError",
197 {
198 driver: ProviderDriverKind,
199 providerSessionId: ProviderSessionId,
200 providerThreadId: ProviderThreadId,
201 cause: Schema.optional(Schema.Defect()),
202 },
203) {
204 override get message(): string {
205 return `Failed to resume ${this.driver} provider thread ${this.providerThreadId}.`;
206 }
208​
209export class ProviderAdapterEnsureThreadError extends Schema.TaggedError<ProviderAdapterEnsureThreadError>()(
210 "ProviderAdapterEnsureThreadError",
211 {
212 driver: ProviderDriverKind,
213 threadId: ThreadId,
214 cause: Schema.optional(Schema.Defect()),
215 },
216) {
217 override get message(): string {
218 return `Failed to ensure ${this.driver} provider thread for app thread ${this.threadId}.`;
219 }
221​
222export class ProviderAdapterReadThreadSnapshotError extends Schema.TaggedError<ProviderAdapterReadThreadSnapshotError>()(
223 "ProviderAdapterReadThreadSnapshotError",
224 {
225 driver: ProviderDriverKind,
226 providerThreadId: ProviderThreadId,
227 cause: Schema.optional(Schema.Defect()),
228 },
229) {
230 override get message(): string {
231 return `Failed to read ${this.driver} provider thread snapshot ${this.providerThreadId}.`;
232 }
234​
235export class ProviderAdapterRollbackThreadError extends Schema.TaggedError<ProviderAdapterRollbackThreadError>()(
236 "ProviderAdapterRollbackThreadError",
237 {
238 driver: ProviderDriverKind,
239 providerThreadId: ProviderThreadId,
240 checkpointId: Schema.optional(CheckpointId),
241 cause: Schema.optional(Schema.Defect()),
242 },
243) {
244 override get message(): string {
245 return `Failed to roll back ${this.driver} provider thread ${this.providerThreadId}.`;
246 }
248​
249export class ProviderAdapterForkThreadError extends Schema.TaggedError<ProviderAdapterForkThreadError>()(
250 "ProviderAdapterForkThreadError",
251 {
252 driver: ProviderDriverKind,
253 providerThreadId: ProviderThreadId,
254 cause: Schema.optional(Schema.Defect()),
255 },
256) {
257 override get message(): string {
258 return `Failed to fork ${this.driver} provider thread ${this.providerThreadId}.`;
259 }
261​
262export class ProviderAdapterTurnStartError extends Schema.TaggedError<ProviderAdapterTurnStartError>()(
263 "ProviderAdapterTurnStartError",
264 {
265 driver: ProviderDriverKind,
266 threadId: ThreadId,
267 providerThreadId: ProviderThreadId,
268 runId: RunId,
269 cause: Schema.optional(Schema.Defect()),
270 },
271) {
272 override get message(): string {
273 return `Failed to start run ${this.runId} on ${this.driver} provider thread ${this.providerThreadId}.`;
274 }
276​
277export class ProviderAdapterSteerRunUnsupportedError extends Schema.TaggedError<ProviderAdapterSteerRunUnsupportedError>()(
278 "ProviderAdapterSteerRunUnsupportedError",
279 {
280 driver: ProviderDriverKind,
281 providerThreadId: ProviderThreadId,
282 },
283) {
284 override get message(): string {
285 return `${this.driver} provider thread ${this.providerThreadId} does not support active-run steering.`;
286 }
288​
289export class ProviderAdapterSteerRunError extends Schema.TaggedError<ProviderAdapterSteerRunError>()(
290 "ProviderAdapterSteerRunError",
291 {
292 driver: ProviderDriverKind,
293 providerThreadId: ProviderThreadId,
294 providerTurnId: ProviderTurnId,
295 cause: Schema.optional(Schema.Defect()),
296 },
297) {
298 override get message(): string {
299 return `Failed to steer active run ${this.providerTurnId} on ${this.driver} provider thread ${this.providerThreadId}.`;
300 }
302​
303export class ProviderAdapterInterruptError extends Schema.TaggedError<ProviderAdapterInterruptError>()(
304 "ProviderAdapterInterruptError",
305 {
306 driver: ProviderDriverKind,
307 providerThreadId: ProviderThreadId,
308 providerTurnId: ProviderTurnId,
309 cause: Schema.optional(Schema.Defect()),
310 },
311) {
312 override get message(): string {
313 return `Failed to interrupt ${this.driver} provider turn ${this.providerTurnId}.`;
314 }
316​
317export class ProviderAdapterRuntimeRequestResponseError extends Schema.TaggedError<ProviderAdapterRuntimeRequestResponseError>()(
318 "ProviderAdapterRuntimeRequestResponseError",
319 {
320 driver: ProviderDriverKind,
321 requestId: RuntimeRequestId,
322 cause: Schema.optional(Schema.Defect()),
323 },
324) {
325 override get message(): string {
326 return `Failed to respond to ${this.driver} runtime request ${this.requestId}.`;
327 }
329​
330export class ProviderAdapterEventStreamError extends Schema.TaggedError<ProviderAdapterEventStreamError>()(
331 "ProviderAdapterEventStreamError",
332 {
333 driver: ProviderDriverKind,
334 providerSessionId: ProviderSessionId,
335 cause: Schema.optional(Schema.Defect()),
336 },
337) {
338 override get message(): string {
339 return `Failed while streaming ${this.driver} provider session ${this.providerSessionId} events.`;
340 }
342​
343export class ProviderAdapterProtocolError extends Schema.TaggedError<ProviderAdapterProtocolError>()(
344 "ProviderAdapterProtocolError",
345 {
346 driver: ProviderDriverKind,
347 detail: Schema.String,
348 cause: Schema.optional(Schema.Defect()),
349 payload: Schema.optional(Schema.Unknown),
350 },
351) {
352 override get message(): string {
353 return `${this.driver} provider protocol error: ${this.detail}.`;
354 }
356​
357export const ProviderAdapterV2Error = Schema.Union([
358 ProviderAdapterCapabilitiesError,
359 ProviderAdapterOpenSessionError,
360 ProviderAdapterCloseSessionError,
361 ProviderAdapterResumeThreadError,
362 ProviderAdapterEnsureThreadError,
363 ProviderAdapterReadThreadSnapshotError,
364 ProviderAdapterRollbackThreadError,
365 ProviderAdapterForkThreadError,
366 ProviderAdapterTurnStartError,
367 ProviderAdapterSteerRunUnsupportedError,
368 ProviderAdapterSteerRunError,
369 ProviderAdapterInterruptError,
370 ProviderAdapterRuntimeRequestResponseError,
371 ProviderAdapterEventStreamError,
372 ProviderAdapterProtocolError,
373]);
374export type ProviderAdapterV2Error = typeof ProviderAdapterV2Error.Type;
375​
376export interface ProviderAdapterV2OpenSessionInput {
377 readonly threadId: ThreadId;
378 readonly providerSessionId: ProviderSessionId;
379 readonly modelSelection: ModelSelection;
380 readonly runtimePolicy: ProviderAdapterV2RuntimePolicy;
381 readonly resumeFromSession?: OrchestrationV2ProviderSession;
382 /** Native thread to activate while an eager adapter opens its provider process. */
383 readonly initialNativeThreadId?: string;
384 /** Preserves provider item identity across eager activation of a persisted thread. */
385 readonly initialProviderItemIdentityVersion?: 2;
387​
388export interface ProviderAdapterV2EnsureThreadInput {
389 readonly threadId: ThreadId;
390 readonly modelSelection: ModelSelection;
391 readonly runtimePolicy: ProviderAdapterV2RuntimePolicy;
392 readonly providerSessionId?: ProviderSessionId;
393 readonly existingProviderThread?: OrchestrationV2ProviderThread;
395​
396export interface ProviderAdapterV2TurnInput {
397 readonly appThread: OrchestrationV2AppThread;
398 readonly threadId: ThreadId;
399 readonly runId: RunId;
400 readonly runOrdinal: number;
401 /** Whether the current native session has an accepted turn; omitted when unknown. */
402 readonly nativeThreadHasTurns?: boolean;
403 readonly providerTurnOrdinal: number;
404 readonly restartContinuationOfRunId?: RunId;
405 readonly attemptId: RunAttemptId;
406 readonly rootNodeId: NodeId;
407 readonly providerThread: OrchestrationV2ProviderThread;
408 readonly message: ProviderAdapterV2TurnMessage;
409 readonly modelSelection: ModelSelection;
410 readonly runtimePolicy: ProviderAdapterV2RuntimePolicy;
412​
413export interface ProviderAdapterV2SteerInput {
414 readonly threadId: ThreadId;
415 readonly runId: RunId;
416 readonly providerThread: OrchestrationV2ProviderThread;
417 readonly providerTurnId: ProviderTurnId;
418 readonly message: ProviderAdapterV2TurnMessage;
420​
421export interface ProviderAdapterV2InterruptInput {
422 readonly providerThread: OrchestrationV2ProviderThread;
423 readonly providerTurnId: ProviderTurnId;
424 /** When true, the next `startTurn` may respawn the provider runtime (Grok Stop recovery). */
425 readonly requestRuntimeRestart?: boolean;
427​
428export interface ProviderAdapterV2RuntimeRequestResponseInput {
429 readonly requestId: RuntimeRequestId;
430 readonly decision?: ProviderApprovalDecision;
431 readonly answers?: ProviderUserInputAnswers;
432 readonly response?: unknown;
434​
435export interface ProviderAdapterV2ThreadSnapshot {
436 readonly providerThread: OrchestrationV2ProviderThread;
437 readonly providerTurns: ReadonlyArray<OrchestrationV2ProviderTurn>;
438 readonly messages: ReadonlyArray<OrchestrationV2ConversationMessage>;
439 readonly runtimeRequests: ReadonlyArray<OrchestrationV2RuntimeRequest>;
440 readonly providerPayload?: unknown;
442​
443export interface ProviderAdapterV2ReadThreadSnapshotInput {
444 readonly providerThread: OrchestrationV2ProviderThread;
446​
447export type ProviderAdapterV2RollbackTarget =
448 | {
449 readonly type: "thread_start";
450 readonly checkpointId: CheckpointId;
451 readonly appRunOrdinal: 0;
452 }
453 | {
454 readonly type: "provider_turn";
455 readonly checkpointId: CheckpointId;
456 readonly appRunOrdinal: number;
457 readonly providerTurn: OrchestrationV2ProviderTurn;
458 };
459​
460export interface ProviderAdapterV2RollbackThreadInput {
461 readonly providerThread: OrchestrationV2ProviderThread;
462 readonly target: ProviderAdapterV2RollbackTarget;
463 readonly providerThreadTurns: ReadonlyArray<OrchestrationV2ProviderTurn>;
465​
466export interface ProviderAdapterV2ForkThreadInput {
467 readonly sourceProviderThread: OrchestrationV2ProviderThread;
468 readonly sourceProviderTurns?: ReadonlyArray<OrchestrationV2ProviderTurn>;
469 readonly providerTurnId?: ProviderTurnId;
470 readonly targetThreadId: ThreadId;
471 readonly ownerNodeId?: NodeId;
472 readonly modelSelection?: ModelSelection;
473 readonly runtimePolicy?: ProviderAdapterV2RuntimePolicy;
475​
476export interface ProviderAdapterV2EventSubscription {
477 readonly events: Stream.Stream<ProviderAdapterV2Event, ProviderAdapterV2Error>;
478 readonly close: Effect.Effect<void>;
480​
481export interface ProviderAdapterV2HistoricalContext {
482 readonly messages: ReadonlyArray<OrchestrationV2HistoricalMessage>;
483 readonly context: string;
485​
486export interface ProviderAdapterV2SessionRuntime {
487 readonly instanceId: ProviderInstanceId;
488 readonly driver: ProviderDriverKind;
489 readonly providerSessionId: ProviderSessionId;
490 readonly providerSession: OrchestrationV2ProviderSession;
491 readonly events: Stream.Stream<ProviderAdapterV2Event, ProviderAdapterV2Error>;
492 /**
493 * Manager-owned runtimes expose a synchronous subscription so concurrent
494 * provider threads receive independent copies of the process event stream.
495 * Adapter runtimes may omit this and expose only their single-consumer event stream.
496 */
497 readonly subscribeEvents?: Effect.Effect<ProviderAdapterV2EventSubscription>;
498 /**
499 * Adapters whose native runtime can hold pending work outside an active
500 * turn (for example Claude background tasks and their wake turns) report it
501 * here so the session manager defers idle release while it is pending.
502 */
503 readonly hasPendingBackgroundWork?: Effect.Effect<boolean>;
504 /**
505 * Per-provider-thread pending work for root-run ingestion stop gates. When
506 * present, RunExecutionService uses only this probe (never the session-wide
507 * hasPendingBackgroundWork) so sibling native threads cannot pin an
508 * unrelated root subscription open.
509 */
510 readonly hasPendingBackgroundWorkForThread?: (
511 providerThread: OrchestrationV2ProviderThread,
512 ) => Effect.Effect<boolean>;
513 /**
514 * Capacity for the requested model/options, independent of native thread usage.
515 * `cwd` is the thread's working directory, for providers whose project config
516 * can change a model's limits.
517 */
518 readonly getModelContextWindow?: (
519 modelSelection: ModelSelection,
520 cwd?: string | null,
521 ) => number | undefined;
522 /** Whether an option-only change preserves measured native usage and capacity.
523 * Compaction thresholds are still discarded. Unknown transitions invalidate usage.
524 */
525 readonly canReuseContextUsage?: (previous: ModelSelection, next: ModelSelection) => boolean;
526 readonly ensureThread: (
527 input: ProviderAdapterV2EnsureThreadInput,
528 ) => Effect.Effect<OrchestrationV2ProviderThread, ProviderAdapterV2Error>;
529 readonly resumeThread: (input: {
530 readonly providerThread: OrchestrationV2ProviderThread;
531 readonly threadId?: ThreadId;
532 readonly modelSelection?: ModelSelection;
533 readonly runtimePolicy?: ProviderAdapterV2RuntimePolicy;
534 }) => Effect.Effect<OrchestrationV2ProviderThread, ProviderAdapterV2Error>;
535 /** False means the native protocol explicitly does not support history injection. */
536 readonly injectHistory?: (
537 input: ProviderAdapterV2HistoricalContext & {
538 readonly providerThread: OrchestrationV2ProviderThread;
539 },
540 ) => Effect.Effect<boolean, ProviderAdapterV2Error>;
541 readonly startTurn: (
542 input: ProviderAdapterV2TurnInput,
543 ) => Effect.Effect<void, ProviderAdapterV2Error>;
544 readonly compactThread?: (
545 input: ProviderAdapterV2TurnInput,
546 ) => Effect.Effect<void, ProviderAdapterV2Error>;
547 readonly steerTurn: (
548 input: ProviderAdapterV2SteerInput,
549 ) => Effect.Effect<void, ProviderAdapterV2Error>;
550 readonly interruptTurn: (
551 input: ProviderAdapterV2InterruptInput,
552 ) => Effect.Effect<void, ProviderAdapterV2Error>;
553 /**
554 * Lets a runtime shared by several app threads unload one provider thread's
555 * native state (and its MCP servers) when that app thread detaches, while
556 * the runtime keeps serving the others. A later resume reloads it.
557 */
558 readonly unloadThread?: (input: {
559 readonly providerThread: OrchestrationV2ProviderThread;
560 }) => Effect.Effect<void, ProviderAdapterV2Error>;
561 readonly respondToRuntimeRequest: (
562 input: ProviderAdapterV2RuntimeRequestResponseInput,
563 ) => Effect.Effect<void, ProviderAdapterV2Error>;
564 readonly readThreadSnapshot: (
565 input: ProviderAdapterV2ReadThreadSnapshotInput,
566 ) => Effect.Effect<ProviderAdapterV2ThreadSnapshot, ProviderAdapterV2Error>;
567 /**
568 * Providers that accept product feedback for a thread (#7949, Codex → OpenAI)
569 * expose it here; absent means the driver has no feedback channel.
570 */
571 readonly uploadFeedback?: (input: {
572 readonly providerThread: OrchestrationV2ProviderThread;
573 readonly reason?: string;
574 }) => Effect.Effect<{ readonly feedbackId: string }, ProviderAdapterV2Error>;
575 readonly rollbackThread: (
576 input: ProviderAdapterV2RollbackThreadInput,
577 ) => Effect.Effect<ProviderAdapterV2ThreadSnapshot, ProviderAdapterV2Error>;
578 readonly forkThread: (
579 input: ProviderAdapterV2ForkThreadInput,
580 ) => Effect.Effect<OrchestrationV2ProviderThread, ProviderAdapterV2Error>;
582​
583export interface ProviderAdapterV2Shape {
584 readonly instanceId: ProviderInstanceId;
585 readonly driver: ProviderDriverKind;
586 readonly getCapabilities: () => Effect.Effect<
587 OrchestrationV2ProviderCapabilities,
588 ProviderAdapterV2Error
589 >;
590 readonly planSelectionTransition: (
591 input: ProviderSelectionTransitionInput,
592 ) => Effect.Effect<ProviderSelectionTransitionPlan, ProviderAdapterV2Error>;
593 readonly openSession: (
594 input: ProviderAdapterV2OpenSessionInput,
595 ) => Effect.Effect<ProviderAdapterV2SessionRuntime, ProviderAdapterV2Error, Scope.Scope>;
597​
598export class ProviderAdapterV2 extends Context.Service<ProviderAdapterV2, ProviderAdapterV2Shape>()(
599 "t3/orchestration-v2/ProviderAdapter/ProviderAdapterV2",
600) {}