|
| 1 | +import type { |
| 2 | + OrchestrationV2SearchThreadInput, |
| 3 | + OrchestrationV2SearchThreadResult, |
| 4 | + OrchestrationV2ThreadHistoryPage, |
| 5 | +} from "@t3tools/contracts"; |
1 | 6 | import { |
2 | 7 | latestExecutedRun, |
3 | 8 | latestRootProviderFailure, |
@@ -281,6 +286,18 @@ export interface OrchestratorV2Shape { |
281 | 286 | readonly dispatch: ( |
282 | 287 | command: OrchestrationV2ServerCommand, |
283 | 288 | ) => Effect.Effect<OrchestratorV2DispatchResult, OrchestratorV2Error>; |
| 289 | + readonly searchThreadStream: ( |
| 290 | + input: OrchestrationV2SearchThreadInput, |
| 291 | + ) => Stream.Stream<OrchestrationV2SearchThreadResult, OrchestratorV2Error>; |
| 292 | + readonly searchThread: ( |
| 293 | + input: OrchestrationV2SearchThreadInput, |
| 294 | + ) => Effect.Effect<OrchestrationV2SearchThreadResult, OrchestratorV2Error>; |
| 295 | + readonly getThreadHistoryPage: ( |
| 296 | + threadId: ThreadId, |
| 297 | + cursor: string, |
| 298 | + throughEntryId?: string, |
| 299 | + conversationOnly?: boolean, |
| 300 | + ) => Effect.Effect<OrchestrationV2ThreadHistoryPage, OrchestratorV2Error>; |
284 | 301 | readonly getTimelinePage: ( |
285 | 302 | threadId: ThreadId, |
286 | 303 | options: ProjectionTimelinePageOptions, |
@@ -10817,6 +10834,26 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio |
10817 | 10834 | recoverDelegatedTask, |
10818 | 10835 | delegatedTaskResultPending, |
10819 | 10836 | dispatch: dispatchWithReceipt, |
| 10837 | + searchThreadStream: (input) => |
| 10838 | + projectionStore |
| 10839 | + .searchThreadStream(input) |
| 10840 | + .pipe( |
| 10841 | + Stream.mapError( |
| 10842 | + (cause) => new OrchestratorProjectionError({ threadId: input.threadId, cause }), |
| 10843 | + ), |
| 10844 | + ), |
| 10845 | + searchThread: (input) => |
| 10846 | + projectionStore |
| 10847 | + .searchThread(input) |
| 10848 | + .pipe( |
| 10849 | + Effect.mapError( |
| 10850 | + (cause) => new OrchestratorProjectionError({ threadId: input.threadId, cause }), |
| 10851 | + ), |
| 10852 | + ), |
| 10853 | + getThreadHistoryPage: (threadId, cursor, throughEntryId, conversationOnly) => |
| 10854 | + projectionStore |
| 10855 | + .getThreadHistoryPage(threadId, cursor, throughEntryId, conversationOnly) |
| 10856 | + .pipe(Effect.mapError((cause) => new OrchestratorProjectionError({ threadId, cause }))), |
10820 | 10857 | getTimelinePage: (threadId, options) => |
10821 | 10858 | projectionStore |
10822 | 10859 | .getTimelinePage(threadId, options) |
@@ -10951,6 +10988,11 @@ const layerUnavailable: Layer.Layer<OrchestratorV2> = Layer.succeed( |
10951 | 10988 | cause: "Orchestration V2 live runtime is not configured.", |
10952 | 10989 | }), |
10953 | 10990 | ), |
| 10991 | + searchThreadStream: (input) => |
| 10992 | + Stream.fail(new OrchestratorProjectionError({ threadId: input.threadId })), |
| 10993 | + searchThread: (input) => |
| 10994 | + Effect.fail(new OrchestratorProjectionError({ threadId: input.threadId })), |
| 10995 | + getThreadHistoryPage: (threadId) => Effect.fail(new OrchestratorProjectionError({ threadId })), |
10954 | 10996 | getTimelinePage: (threadId) => Effect.fail(new OrchestratorProjectionError({ threadId })), |
10955 | 10997 | getMessageCount: (threadId) => Effect.fail(new OrchestratorProjectionError({ threadId })), |
10956 | 10998 | getTurnItem: ({ threadId }) => Effect.fail(new OrchestratorProjectionError({ threadId })), |
|
0 commit comments