File tree Expand file tree Collapse file tree
packages/client-runtime/src/state Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ import * as EnvironmentSupervisor from "../connection/supervisor.ts";
3939import * as Persistence from "../platform/persistence.ts" ;
4040import {
4141 decodeStoredThreadSnapshot ,
42- encodeStoredThreadSnapshot ,
42+ makeStoredThreadSnapshotEncoder ,
4343} from "../platform/threadCacheEncoding.ts" ;
4444import type { WsRpcProtocolClient } from "../rpc/protocol.ts" ;
4545import type { RpcSession } from "../rpc/session.ts" ;
@@ -55,6 +55,13 @@ import {
5555} from "./threads.ts" ;
5656import * as ThreadSnapshotLoader from "./threadSnapshotHttp.ts" ;
5757
58+ const encodeCompactRecord = makeStoredThreadSnapshotEncoder ( {
59+ format : "compact" ,
60+ yieldToHost : Effect . void ,
61+ } ) ;
62+ const encodeStoredThreadSnapshot = ( stored : Parameters < typeof encodeCompactRecord > [ 0 ] ) =>
63+ encodeCompactRecord ( stored ) . pipe ( Effect . map ( Option . getOrThrow ) ) ;
64+
5865const TARGET = new PrimaryConnectionTarget ( {
5966 environmentId : EnvironmentId . make ( "environment-1" ) ,
6067 label : "Test environment" ,
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ import {
4848} from "../platform/orchestrationCache.ts" ;
4949import {
5050 decodeStoredThreadSnapshot ,
51- encodeStoredThreadSnapshot ,
51+ makeStoredThreadSnapshotEncoder ,
5252} from "../platform/threadCacheEncoding.ts" ;
5353import * as RpcSession from "../rpc/session.ts" ;
5454import { v2Now , v2Projection , v2ThreadId } from "./orchestrationV2TestFixtures.ts" ;
@@ -67,6 +67,13 @@ import {
6767} from "./threads.ts" ;
6868import * as ThreadSnapshotLoader from "./threadSnapshotHttp.ts" ;
6969
70+ const encodeCompactRecord = makeStoredThreadSnapshotEncoder ( {
71+ format : "compact" ,
72+ yieldToHost : Effect . void ,
73+ } ) ;
74+ const encodeStoredThreadSnapshot = ( stored : Parameters < typeof encodeCompactRecord > [ 0 ] ) =>
75+ encodeCompactRecord ( stored ) . pipe ( Effect . map ( Option . getOrThrow ) ) ;
76+
7077const TARGET = new PrimaryConnectionTarget ( {
7178 environmentId : EnvironmentId . make ( "environment-1" ) ,
7279 label : "Test environment" ,
You can’t perform that action at this time.
0 commit comments