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