Skip to content

Commit 3405a64

Browse files
juliusmarmingeclaudeJulius Marmingecodex
authored
bump effect to latest beta (#1866)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Julius Marminge <julius@macmini.local> Co-authored-by: codex <codex@users.noreply.github.com>
1 parent 1cba2f6 commit 3405a64

File tree

174 files changed

+1853
-1870
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+1853
-1870
lines changed

apps/desktop/src/clientPersistence.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const clientSettings: ClientSettings = {
5858
};
5959

6060
const savedRegistryRecord: PersistedSavedEnvironmentRecord = {
61-
environmentId: EnvironmentId.makeUnsafe("environment-1"),
61+
environmentId: EnvironmentId.make("environment-1"),
6262
label: "Remote environment",
6363
httpBaseUrl: "https://remote.example.com/",
6464
wsBaseUrl: "wss://remote.example.com/",

apps/server/integration/OrchestrationEngineHarness.integration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ export const makeOrchestrationIntegrationHarness = (
438438
) =>
439439
waitFor(
440440
pendingApprovalRepository
441-
.getByRequestId({ requestId: ApprovalRequestId.makeUnsafe(requestId) })
441+
.getByRequestId({ requestId: ApprovalRequestId.make(requestId) })
442442
.pipe(
443443
Effect.map((row) =>
444444
Option.match(row, {

apps/server/integration/TestProviderAdapter.integration.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ export const makeTestProviderAdapterHarness = (options?: MakeTestProviderAdapter
289289

290290
state.turnCount += 1;
291291
const turnCount = state.turnCount;
292-
const turnId = TurnId.makeUnsafe(`turn-${turnCount}`);
292+
const turnId = TurnId.make(`turn-${turnCount}`);
293293

294294
const response = state.queuedResponses.shift();
295295
if (!response) {
@@ -307,7 +307,7 @@ export const makeTestProviderAdapterHarness = (options?: MakeTestProviderAdapter
307307
...(fixtureEvent as Record<string, unknown>),
308308
eventId: randomUUID(),
309309
provider,
310-
sessionId: RuntimeSessionId.makeUnsafe(String(input.threadId)),
310+
sessionId: RuntimeSessionId.make(String(input.threadId)),
311311
createdAt: nowIso(),
312312
};
313313
rawEvent.threadId = state.snapshot.threadId;
@@ -363,7 +363,7 @@ export const makeTestProviderAdapterHarness = (options?: MakeTestProviderAdapter
363363
if (deferredTurnCompletedEvents.length === 0) {
364364
yield* emit({
365365
type: "turn.completed",
366-
eventId: EventId.makeUnsafe(randomUUID()),
366+
eventId: EventId.make(randomUUID()),
367367
provider,
368368
createdAt: nowIso(),
369369
threadId: state.snapshot.threadId,

apps/server/integration/fixtures/providerRuntime.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ const PROVIDER = "codex" as const;
55
const SESSION_ID = "fixture-session";
66
const THREAD_ID = "fixture-thread";
77
const TURN_ID = "fixture-turn";
8-
const REQUEST_ID = RuntimeRequestId.makeUnsafe("req-1");
8+
const REQUEST_ID = RuntimeRequestId.make("req-1");
99

1010
function baseEvent(
1111
eventId: string,
1212
createdAt: string,
1313
): Pick<LegacyProviderRuntimeEvent, "eventId" | "provider" | "sessionId" | "createdAt"> {
1414
return {
15-
eventId: EventId.makeUnsafe(eventId),
15+
eventId: EventId.make(eventId),
1616
provider: PROVIDER,
1717
sessionId: SESSION_ID,
1818
createdAt,

apps/server/integration/orchestrationEngine.integration.test.ts

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,13 @@ import type {
3030
} from "../src/orchestration/Services/RuntimeReceiptBus.ts";
3131
import * as NodeServices from "@effect/platform-node/NodeServices";
3232

33-
const asMessageId = (value: string): MessageId => MessageId.makeUnsafe(value);
34-
const asProjectId = (value: string): ProjectId => ProjectId.makeUnsafe(value);
35-
const asEventId = (value: string): EventId => EventId.makeUnsafe(value);
36-
const asApprovalRequestId = (value: string): ApprovalRequestId =>
37-
ApprovalRequestId.makeUnsafe(value);
33+
const asMessageId = (value: string): MessageId => MessageId.make(value);
34+
const asProjectId = (value: string): ProjectId => ProjectId.make(value);
35+
const asEventId = (value: string): EventId => EventId.make(value);
36+
const asApprovalRequestId = (value: string): ApprovalRequestId => ApprovalRequestId.make(value);
3837

3938
const PROJECT_ID = asProjectId("project-1");
40-
const THREAD_ID = ThreadId.makeUnsafe("thread-1");
39+
const THREAD_ID = ThreadId.make("thread-1");
4140
const FIXTURE_TURN_ID = "fixture-turn";
4241
const APPROVAL_REQUEST_ID = asApprovalRequestId("req-approval-1");
4342
type IntegrationProvider = ProviderKind;
@@ -112,7 +111,7 @@ const seedProjectAndThread = (harness: OrchestrationIntegrationHarness) =>
112111

113112
yield* harness.engine.dispatch({
114113
type: "project.create",
115-
commandId: CommandId.makeUnsafe("cmd-project-create"),
114+
commandId: CommandId.make("cmd-project-create"),
116115
projectId: PROJECT_ID,
117116
title: "Integration Project",
118117
workspaceRoot: harness.workspaceDir,
@@ -125,7 +124,7 @@ const seedProjectAndThread = (harness: OrchestrationIntegrationHarness) =>
125124

126125
yield* harness.engine.dispatch({
127126
type: "thread.create",
128-
commandId: CommandId.makeUnsafe("cmd-thread-create"),
127+
commandId: CommandId.make("cmd-thread-create"),
129128
threadId: THREAD_ID,
130129
projectId: PROJECT_ID,
131130
title: "Integration Thread",
@@ -150,7 +149,7 @@ const startTurn = (input: {
150149
}) =>
151150
input.harness.engine.dispatch({
152151
type: "thread.turn.start",
153-
commandId: CommandId.makeUnsafe(input.commandId),
152+
commandId: CommandId.make(input.commandId),
154153
threadId: THREAD_ID,
155154
message: {
156155
messageId: asMessageId(input.messageId),
@@ -261,7 +260,7 @@ it.live.skipIf(!process.env.CODEX_BINARY_PATH)(
261260

262261
yield* harness.engine.dispatch({
263262
type: "project.create",
264-
commandId: CommandId.makeUnsafe("cmd-project-create-real-codex"),
263+
commandId: CommandId.make("cmd-project-create-real-codex"),
265264
projectId: PROJECT_ID,
266265
title: "Integration Project",
267266
workspaceRoot: harness.workspaceDir,
@@ -274,7 +273,7 @@ it.live.skipIf(!process.env.CODEX_BINARY_PATH)(
274273

275274
yield* harness.engine.dispatch({
276275
type: "thread.create",
277-
commandId: CommandId.makeUnsafe("cmd-thread-create-real-codex"),
276+
commandId: CommandId.make("cmd-thread-create-real-codex"),
278277
threadId: THREAD_ID,
279278
projectId: PROJECT_ID,
280279
title: "Integration Thread",
@@ -291,7 +290,7 @@ it.live.skipIf(!process.env.CODEX_BINARY_PATH)(
291290

292291
yield* harness.engine.dispatch({
293292
type: "thread.turn.start",
294-
commandId: CommandId.makeUnsafe("cmd-turn-start-real-codex-1"),
293+
commandId: CommandId.make("cmd-turn-start-real-codex-1"),
295294
threadId: THREAD_ID,
296295
message: {
297296
messageId: asMessageId("msg-real-codex-1"),
@@ -318,7 +317,7 @@ it.live.skipIf(!process.env.CODEX_BINARY_PATH)(
318317

319318
yield* harness.engine.dispatch({
320319
type: "thread.turn.start",
321-
commandId: CommandId.makeUnsafe("cmd-turn-start-real-codex-2"),
320+
commandId: CommandId.make("cmd-turn-start-real-codex-2"),
322321
threadId: THREAD_ID,
323322
message: {
324323
messageId: asMessageId("msg-real-codex-2"),
@@ -583,7 +582,7 @@ it.live("tracks approval requests and resolves pending approvals on user respons
583582

584583
yield* harness.engine.dispatch({
585584
type: "thread.approval.respond",
586-
commandId: CommandId.makeUnsafe("cmd-approval-respond"),
585+
commandId: CommandId.make("cmd-approval-respond"),
587586
threadId: THREAD_ID,
588587
requestId: APPROVAL_REQUEST_ID,
589588
decision: "accept",
@@ -815,7 +814,7 @@ it.live("reverts to an earlier checkpoint and trims checkpoint projections + git
815814

816815
yield* harness.engine.dispatch({
817816
type: "thread.checkpoint.revert",
818-
commandId: CommandId.makeUnsafe("cmd-checkpoint-revert"),
817+
commandId: CommandId.make("cmd-checkpoint-revert"),
819818
threadId: THREAD_ID,
820819
turnCount: 1,
821820
createdAt: nowIso(),
@@ -875,7 +874,7 @@ it.live(
875874

876875
yield* harness.engine.dispatch({
877876
type: "thread.checkpoint.revert",
878-
commandId: CommandId.makeUnsafe("cmd-checkpoint-revert-no-session"),
877+
commandId: CommandId.make("cmd-checkpoint-revert-no-session"),
879878
threadId: THREAD_ID,
880879
turnCount: 0,
881880
createdAt: nowIso(),
@@ -1119,7 +1118,7 @@ it.live("forwards claudeAgent approval responses to the provider session", () =>
11191118

11201119
yield* harness.engine.dispatch({
11211120
type: "thread.approval.respond",
1122-
commandId: CommandId.makeUnsafe("cmd-claude-approval-respond"),
1121+
commandId: CommandId.make("cmd-claude-approval-respond"),
11231122
threadId: THREAD_ID,
11241123
requestId: APPROVAL_REQUEST_ID,
11251124
decision: "accept",
@@ -1192,7 +1191,7 @@ it.live("forwards thread.turn.interrupt to claudeAgent provider sessions", () =>
11921191

11931192
yield* harness.engine.dispatch({
11941193
type: "thread.turn.interrupt",
1195-
commandId: CommandId.makeUnsafe("cmd-turn-interrupt-claude"),
1194+
commandId: CommandId.make("cmd-turn-interrupt-claude"),
11961195
threadId: THREAD_ID,
11971196
createdAt: nowIso(),
11981197
});
@@ -1309,7 +1308,7 @@ it.live("reverts claudeAgent turns and rolls back provider conversation state",
13091308

13101309
yield* harness.engine.dispatch({
13111310
type: "thread.checkpoint.revert",
1312-
commandId: CommandId.makeUnsafe("cmd-checkpoint-revert-claude"),
1311+
commandId: CommandId.make("cmd-checkpoint-revert-claude"),
13131312
threadId: THREAD_ID,
13141313
turnCount: 1,
13151314
createdAt: nowIso(),

apps/server/integration/providerService.integration.test.ts

Lines changed: 24 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,12 @@ it.live("replays typed runtime fixture events", () =>
122122

123123
yield* Effect.gen(function* () {
124124
const provider = yield* ProviderService;
125-
const session = yield* provider.startSession(
126-
ThreadId.makeUnsafe("thread-integration-typed"),
127-
{
128-
threadId: ThreadId.makeUnsafe("thread-integration-typed"),
129-
provider: "codex",
130-
cwd: fixture.cwd,
131-
runtimeMode: "full-access",
132-
},
133-
);
125+
const session = yield* provider.startSession(ThreadId.make("thread-integration-typed"), {
126+
threadId: ThreadId.make("thread-integration-typed"),
127+
provider: "codex",
128+
cwd: fixture.cwd,
129+
runtimeMode: "full-access",
130+
});
134131
assert.equal((session.threadId ?? "").length > 0, true);
135132

136133
const observedEvents = yield* runTurn({
@@ -157,15 +154,12 @@ it.live("replays file-changing fixture turn events", () =>
157154

158155
yield* Effect.gen(function* () {
159156
const provider = yield* ProviderService;
160-
const session = yield* provider.startSession(
161-
ThreadId.makeUnsafe("thread-integration-tools"),
162-
{
163-
threadId: ThreadId.makeUnsafe("thread-integration-tools"),
164-
provider: "codex",
165-
cwd: fixture.cwd,
166-
runtimeMode: "full-access",
167-
},
168-
);
157+
const session = yield* provider.startSession(ThreadId.make("thread-integration-tools"), {
158+
threadId: ThreadId.make("thread-integration-tools"),
159+
provider: "codex",
160+
cwd: fixture.cwd,
161+
runtimeMode: "full-access",
162+
});
169163
assert.equal((session.threadId ?? "").length > 0, true);
170164

171165
const observedEvents = yield* runTurn({
@@ -196,15 +190,12 @@ it.live("runs multi-turn tool/approval flow", () =>
196190

197191
yield* Effect.gen(function* () {
198192
const provider = yield* ProviderService;
199-
const session = yield* provider.startSession(
200-
ThreadId.makeUnsafe("thread-integration-multi"),
201-
{
202-
threadId: ThreadId.makeUnsafe("thread-integration-multi"),
203-
provider: "codex",
204-
cwd: fixture.cwd,
205-
runtimeMode: "full-access",
206-
},
207-
);
193+
const session = yield* provider.startSession(ThreadId.make("thread-integration-multi"), {
194+
threadId: ThreadId.make("thread-integration-multi"),
195+
provider: "codex",
196+
cwd: fixture.cwd,
197+
runtimeMode: "full-access",
198+
});
208199
assert.equal((session.threadId ?? "").length > 0, true);
209200

210201
const firstTurnEvents = yield* runTurn({
@@ -250,15 +241,12 @@ it.live("rolls back provider conversation state only", () =>
250241

251242
yield* Effect.gen(function* () {
252243
const provider = yield* ProviderService;
253-
const session = yield* provider.startSession(
254-
ThreadId.makeUnsafe("thread-integration-rollback"),
255-
{
256-
threadId: ThreadId.makeUnsafe("thread-integration-rollback"),
257-
provider: "codex",
258-
cwd: fixture.cwd,
259-
runtimeMode: "full-access",
260-
},
261-
);
244+
const session = yield* provider.startSession(ThreadId.make("thread-integration-rollback"), {
245+
threadId: ThreadId.make("thread-integration-rollback"),
246+
provider: "codex",
247+
cwd: fixture.cwd,
248+
runtimeMode: "full-access",
249+
});
262250
assert.equal((session.threadId ?? "").length > 0, true);
263251

264252
yield* runTurn({

apps/server/src/auth/Layers/SessionCredentialService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export const makeSessionCredentialService = Effect.gen(function* () {
188188

189189
const issue: SessionCredentialServiceShape["issue"] = (input) =>
190190
Effect.gen(function* () {
191-
const sessionId = AuthSessionId.makeUnsafe(crypto.randomUUID());
191+
const sessionId = AuthSessionId.make(crypto.randomUUID());
192192
const issuedAt = yield* DateTime.now;
193193
const expiresAt = DateTime.add(issuedAt, {
194194
milliseconds: Duration.toMillis(input?.ttl ?? DEFAULT_SESSION_TTL),

apps/server/src/auth/Services/AuthControlPlane.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type {
44
AuthPairingLink,
55
AuthSessionId,
66
} from "@t3tools/contracts";
7-
import { Data, DateTime, Duration, Effect, ServiceMap } from "effect";
7+
import { Data, DateTime, Duration, Effect, Context } from "effect";
88
import { SessionRole } from "./SessionCredentialService";
99

1010
export const DEFAULT_SESSION_SUBJECT = "cli-issued-session";
@@ -64,6 +64,6 @@ export interface AuthControlPlaneShape {
6464
) => Effect.Effect<number, AuthControlPlaneError>;
6565
}
6666

67-
export class AuthControlPlane extends ServiceMap.Service<AuthControlPlane, AuthControlPlaneShape>()(
67+
export class AuthControlPlane extends Context.Service<AuthControlPlane, AuthControlPlaneShape>()(
6868
"t3/AuthControlPlane",
6969
) {}

apps/server/src/auth/Services/BootstrapCredentialService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { AuthPairingLink, ServerAuthBootstrapMethod } from "@t3tools/contracts";
2-
import { Data, DateTime, Duration, ServiceMap } from "effect";
2+
import { Data, DateTime, Duration, Context } from "effect";
33
import type { Effect, Stream } from "effect";
44

55
export type BootstrapCredentialRole = "owner" | "client";
@@ -51,7 +51,7 @@ export interface BootstrapCredentialServiceShape {
5151
readonly consume: (credential: string) => Effect.Effect<BootstrapGrant, BootstrapCredentialError>;
5252
}
5353

54-
export class BootstrapCredentialService extends ServiceMap.Service<
54+
export class BootstrapCredentialService extends Context.Service<
5555
BootstrapCredentialService,
5656
BootstrapCredentialServiceShape
5757
>()("t3/auth/Services/BootstrapCredentialService") {}

apps/server/src/auth/Services/ServerAuth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type {
1212
ServerAuthSessionMethod,
1313
AuthWebSocketTokenResult,
1414
} from "@t3tools/contracts";
15-
import { Data, DateTime, ServiceMap } from "effect";
15+
import { Data, DateTime, Context } from "effect";
1616
import type { Effect } from "effect";
1717
import type * as HttpServerRequest from "effect/unstable/http/HttpServerRequest";
1818
import type { SessionRole } from "./SessionCredentialService.ts";
@@ -79,6 +79,6 @@ export interface ServerAuthShape {
7979
readonly issueStartupPairingUrl: (baseUrl: string) => Effect.Effect<string, AuthError>;
8080
}
8181

82-
export class ServerAuth extends ServiceMap.Service<ServerAuth, ServerAuthShape>()(
82+
export class ServerAuth extends Context.Service<ServerAuth, ServerAuthShape>()(
8383
"t3/auth/Services/ServerAuth",
8484
) {}

0 commit comments

Comments
 (0)