History

replace ad-hoc union for contract type

Julius Marminge committed 8 months ago

Commit fdcb05d1 parent 21216826 files · +20 −13Browse files

Unified · Split

6 files
  1. apps/server/integration/OrchestrationEngineHarness.integration.ts +2 −1
  2. apps/server/integration/TestProviderAdapter.integration.ts +6 −5
  3. apps/server/integration/orchestrationEngine.integration.test.ts +2 −1
  4. apps/server/src/orchestration/Layers/CheckpointReactor.test.ts +3 −3
  5. apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.test.ts +6 −2
  6. apps/server/src/provider/Layers/ProviderService.test.ts +1 −1
apps/server/integration/OrchestrationEngineHarness.integration.ts+2−1
@@ -6,6 +6,7 @@ import { execFileSync } from "node:child_process"; · 5 unmodified lines
6import * as NodeServices from "@effect/platform-node/NodeServices";6import * as NodeServices from "@effect/platform-node/NodeServices";
7import {7import {
8 ApprovalRequestId,8 ApprovalRequestId,
9 ProviderKind,
9 type OrchestrationEvent,10 type OrchestrationEvent,
10 type OrchestrationThread,11 type OrchestrationThread,
11} from "@t3tools/contracts";12} from "@t3tools/contracts";
@@ -205,7 +206,7 @@ export interface OrchestrationIntegrationHarness { · 193 unmodified lines
205}206}
206 207
207interface MakeOrchestrationIntegrationHarnessOptions {208interface MakeOrchestrationIntegrationHarnessOptions {
208 readonly provider?: "codex" | "claudeCode";209 readonly provider?: ProviderKind;
209 readonly realCodex?: boolean;210 readonly realCodex?: boolean;
210}211}
211 212
apps/server/integration/TestProviderAdapter.integration.ts+6−5
@@ -10,6 +10,7 @@ import { · 9 unmodified lines
10 ProviderTurnStartResult,10 ProviderTurnStartResult,
11 ThreadId,11 ThreadId,
12 TurnId,12 TurnId,
13 ProviderKind,
13} from "@t3tools/contracts";14} from "@t3tools/contracts";
14import { Effect, Queue, Stream } from "effect";15import { Effect, Queue, Stream } from "effect";
15 16
@@ -35,7 +36,7 @@ export interface TestTurnResponse { · 19 unmodified lines
35export type FixtureProviderRuntimeEvent = {36export type FixtureProviderRuntimeEvent = {
36 readonly type: string;37 readonly type: string;
37 readonly eventId: EventId;38 readonly eventId: EventId;
38 readonly provider: "codex" | "claudeCode";39 readonly provider: ProviderKind;
39 readonly createdAt: string;40 readonly createdAt: string;
40 readonly threadId: string;41 readonly threadId: string;
41 readonly turnId?: string | undefined;42 readonly turnId?: string | undefined;
@@ -177,7 +178,7 @@ function normalizeFixtureEvent(rawEvent: Record<string, unknown>): ProviderRunti · 135 unmodified lines
177 178
178export interface TestProviderAdapterHarness {179export interface TestProviderAdapterHarness {
179 readonly adapter: ProviderAdapterShape<ProviderAdapterError>;180 readonly adapter: ProviderAdapterShape<ProviderAdapterError>;
180 readonly provider: "codex" | "claudeCode";181 readonly provider: ProviderKind;
181 readonly queueTurnResponse: (182 readonly queueTurnResponse: (
182 threadId: ThreadId,183 threadId: ThreadId,
183 response: TestTurnResponse,184 response: TestTurnResponse,
@@ -197,7 +198,7 @@ export interface TestProviderAdapterHarness { · 13 unmodified lines
197}198}
198 199
199interface MakeTestProviderAdapterHarnessOptions {200interface MakeTestProviderAdapterHarnessOptions {
200 readonly provider?: "codex" | "claudeCode";201 readonly provider?: ProviderKind;
201}202}
202 203
203function nowIso(): string {204function nowIso(): string {
@@ -205,7 +206,7 @@ function nowIso(): string { · 1 unmodified line
205}206}
206 207
207function sessionNotFound(208function sessionNotFound(
208 provider: "codex" | "claudeCode",209 provider: ProviderKind,
209 threadId: ThreadId,210 threadId: ThreadId,
210): ProviderAdapterSessionNotFoundError {211): ProviderAdapterSessionNotFoundError {
211 return new ProviderAdapterSessionNotFoundError({212 return new ProviderAdapterSessionNotFoundError({
@@ -215,7 +216,7 @@ function sessionNotFound( · 3 unmodified lines
215}216}
216 217
217function missingSessionEffect(218function missingSessionEffect(
218 provider: "codex" | "claudeCode",219 provider: ProviderKind,
219 threadId: ThreadId,220 threadId: ThreadId,
220): Effect.Effect<never, ProviderAdapterError> {221): Effect.Effect<never, ProviderAdapterError> {
221 return Effect.fail(sessionNotFound(provider, threadId));222 return Effect.fail(sessionNotFound(provider, threadId));
apps/server/integration/orchestrationEngine.integration.test.ts+2−1
@@ -8,6 +8,7 @@ import { · 7 unmodified lines
8 EventId,8 EventId,
9 MessageId,9 MessageId,
10 ProjectId,10 ProjectId,
11 ProviderKind,
11 ThreadId,12 ThreadId,
12} from "@t3tools/contracts";13} from "@t3tools/contracts";
13import { assert, it } from "@effect/vitest";14import { assert, it } from "@effect/vitest";
@@ -36,7 +37,7 @@ const PROJECT_ID = asProjectId("project-1"); · 22 unmodified lines
36const THREAD_ID = ThreadId.makeUnsafe("thread-1");37const THREAD_ID = ThreadId.makeUnsafe("thread-1");
37const FIXTURE_TURN_ID = "fixture-turn";38const FIXTURE_TURN_ID = "fixture-turn";
38const APPROVAL_REQUEST_ID = asApprovalRequestId("req-approval-1");39const APPROVAL_REQUEST_ID = asApprovalRequestId("req-approval-1");
39type IntegrationProvider = "codex" | "claudeCode";40type IntegrationProvider = ProviderKind;
40 41
41function nowIso() {42function nowIso() {
42 return new Date().toISOString();43 return new Date().toISOString();
apps/server/src/orchestration/Layers/CheckpointReactor.test.ts+3−3
@@ -3,7 +3,7 @@ import os from "node:os"; · 2 unmodified lines
3import path from "node:path";3import path from "node:path";
4import { execFileSync } from "node:child_process";4import { execFileSync } from "node:child_process";
5 5
6import type { ProviderRuntimeEvent, ProviderSession } from "@t3tools/contracts";6import type { ProviderKind, ProviderRuntimeEvent, ProviderSession } from "@t3tools/contracts";
7import {7import {
8 CommandId,8 CommandId,
9 DEFAULT_PROVIDER_INTERACTION_MODE,9 DEFAULT_PROVIDER_INTERACTION_MODE,
@@ -44,7 +44,7 @@ const asTurnId = (value: string): TurnId => TurnId.makeUnsafe(value); · 34 unmodified lines
44type LegacyProviderRuntimeEvent = {44type LegacyProviderRuntimeEvent = {
45 readonly type: string;45 readonly type: string;
46 readonly eventId: EventId;46 readonly eventId: EventId;
47 readonly provider: "codex" | "claudeCode";47 readonly provider: ProviderKind;
48 readonly createdAt: string;48 readonly createdAt: string;
49 readonly threadId: ThreadId;49 readonly threadId: ThreadId;
50 readonly turnId?: string | undefined;50 readonly turnId?: string | undefined;
@@ -235,7 +235,7 @@ describe("CheckpointReactor", () => { · 184 unmodified lines
235 readonly projectWorkspaceRoot?: string;235 readonly projectWorkspaceRoot?: string;
236 readonly threadWorktreePath?: string | null;236 readonly threadWorktreePath?: string | null;
237 readonly providerSessionCwd?: string;237 readonly providerSessionCwd?: string;
238 readonly providerName?: "codex" | "claudeCode";238 readonly providerName?: ProviderKind;
239 }) {239 }) {
240 const cwd = createGitRepository();240 const cwd = createGitRepository();
241 tempDirs.push(cwd);241 tempDirs.push(cwd);
apps/server/src/orchestration/Layers/ProviderRuntimeIngestion.test.ts+6−2
@@ -2,7 +2,11 @@ import fs from "node:fs"; · 1 unmodified line
2import os from "node:os";2import os from "node:os";
3import path from "node:path";3import path from "node:path";
4 4
5import type { OrchestrationReadModel, ProviderRuntimeEvent } from "@t3tools/contracts";5import type {
6 OrchestrationReadModel,
7 ProviderKind,
8 ProviderRuntimeEvent,
9} from "@t3tools/contracts";
6import {10import {
7 ApprovalRequestId,11 ApprovalRequestId,
8 CommandId,12 CommandId,
@@ -45,7 +49,7 @@ const asTurnId = (value: string): TurnId => TurnId.makeUnsafe(value); · 36 unmodified lines
45type LegacyProviderRuntimeEvent = {49type LegacyProviderRuntimeEvent = {
46 readonly type: string;50 readonly type: string;
47 readonly eventId: EventId;51 readonly eventId: EventId;
48 readonly provider: "codex" | "claudeCode";52 readonly provider: ProviderKind;
49 readonly createdAt: string;53 readonly createdAt: string;
50 readonly threadId: ThreadId;54 readonly threadId: ThreadId;
51 readonly turnId?: string | undefined;55 readonly turnId?: string | undefined;
apps/server/src/provider/Layers/ProviderService.test.ts+1−1
@@ -52,7 +52,7 @@ const asTurnId = (value: string): TurnId => TurnId.makeUnsafe(value); · 51 unmodified lines
52type LegacyProviderRuntimeEvent = {52type LegacyProviderRuntimeEvent = {
53 readonly type: string;53 readonly type: string;
54 readonly eventId: EventId;54 readonly eventId: EventId;
55 readonly provider: "codex" | "claudeCode";55 readonly provider: ProviderKind;
56 readonly createdAt: string;56 readonly createdAt: string;
57 readonly threadId: ThreadId;57 readonly threadId: ThreadId;
58 readonly turnId?: string | undefined;58 readonly turnId?: string | undefined;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t