| @@ -13,7 +13,11 @@ import * as Layer from "effect/Layer"; · 12 unmodified lines |
| 13 | import * as Option from "effect/Option"; | 13 | import * as Option from "effect/Option"; |
| 14 | import * as Schema from "effect/Schema"; | 14 | import * as Schema from "effect/Schema"; |
| 15 | | 15 | |
| 16 | import { ProviderSessionDirectoryPersistenceError, ProviderValidationError } from "./Errors.ts"; | 16 | import { |
| | 17 | ProviderSessionDirectoryPersistenceError, |
| | 18 | ProviderSessionNotFoundError, |
| | 19 | ProviderValidationError, |
| | 20 | } from "./Errors.ts"; |
| 17 | import * as ProviderSessionRuntime from "../persistence/ProviderSessionRuntime.ts"; | 21 | import * as ProviderSessionRuntime from "../persistence/ProviderSessionRuntime.ts"; |
| 18 | | 22 | |
| 19 | export interface ProviderRuntimeBinding { | 23 | export interface ProviderRuntimeBinding { |
| @@ -36,7 +40,9 @@ export interface ProviderRuntimeBindingWithMetadata extends ProviderRuntimeBindi · 16 unmodified lines |
| 36 | readonly lastSeenAt: string; | 40 | readonly lastSeenAt: string; |
| 37 | } | 41 | } |
| 38 | | 42 | |
| 39 | export type ProviderSessionDirectoryReadError = ProviderSessionDirectoryPersistenceError; | 43 | export type ProviderSessionDirectoryReadError = |
| | 44 | | ProviderSessionDirectoryPersistenceError |
| | 45 | | ProviderSessionNotFoundError; |
| 40 | | 46 | |
| 41 | export type ProviderSessionDirectoryWriteError = | 47 | export type ProviderSessionDirectoryWriteError = |
| 42 | | ProviderValidationError | 48 | | ProviderValidationError |
| @@ -53,7 +59,10 @@ export class ProviderSessionDirectory extends Context.Service< · 10 unmodified lines |
| 53 | ) => Effect.Effect<ProviderDriverKind, ProviderSessionDirectoryReadError>; | 59 | ) => Effect.Effect<ProviderDriverKind, ProviderSessionDirectoryReadError>; |
| 54 | readonly getBinding: ( | 60 | readonly getBinding: ( |
| 55 | threadId: ThreadId, | 61 | threadId: ThreadId, |
| 56 | ) => Effect.Effect<Option.Option<ProviderRuntimeBinding>, ProviderSessionDirectoryReadError>; | 62 | ) => Effect.Effect< |
| | 63 | Option.Option<ProviderRuntimeBinding>, |
| | 64 | ProviderSessionDirectoryPersistenceError |
| | 65 | >; |
| 57 | readonly listThreadIds: () => Effect.Effect< | 66 | readonly listThreadIds: () => Effect.Effect< |
| 58 | ReadonlyArray<ThreadId>, | 67 | ReadonlyArray<ThreadId>, |
| 59 | ProviderSessionDirectoryPersistenceError | 68 | ProviderSessionDirectoryPersistenceError |
| @@ -222,9 +231,8 @@ export const make = Effect.gen(function* () { · 162 unmodified lines |
| 222 | onSome: (value) => Effect.succeed(value.provider), | 231 | onSome: (value) => Effect.succeed(value.provider), |
| 223 | onNone: () => | 232 | onNone: () => |
| 224 | Effect.fail( | 233 | Effect.fail( |
| 225 | new ProviderSessionDirectoryPersistenceError({ | 234 | new ProviderSessionNotFoundError({ |
| 226 | operation: "ProviderSessionDirectory.getProvider", | 235 | threadId, |
| 227 | detail: `No persisted provider binding found for thread '${threadId}'.`, | | |
| 228 | }), | 236 | }), |
| 229 | ), | 237 | ), |
| 230 | }), | 238 | }), |