| author | |
| committer | |
| log | 0e4f1485c87a234b33cad6c197625d414bfd070c |
| tree | 18289275142aafeca690c7072258ffcc0755fc8d |
| parent | b152462b2cd5f26f40ae174765ede2c62381d282 |
23 files changed, 172 insertions(+), 187 deletions(-)
apps/server/package.json+6-6| ... | ... | @@ -17,21 +17,21 @@ |
| 17 | 17 | "test": "vitest run" |
| 18 | 18 | }, |
| 19 | 19 | "dependencies": { |
| 20 | "@effect/platform": "^0.94.5", | |
| 21 | "@effect/platform-node": "^0.104.1", | |
| 22 | "@effect/sql": "^0.49.0", | |
| 23 | "@effect/sql-sqlite-node": "^0.50.1", | |
| 24 | "effect": "^3.19.19", | |
| 20 | "@effect/platform-node": "4.0.0-beta.10", | |
| 21 | "@effect/sql-sqlite-node": "4.0.0-beta.10", | |
| 22 | "effect": "4.0.0-beta.10", | |
| 25 | 23 | "node-pty": "^1.1.0", |
| 26 | 24 | "open": "^10.1.0", |
| 27 | 25 | "ws": "^8.18.0" |
| 28 | 26 | }, |
| 29 | 27 | "devDependencies": { |
| 28 | "@effect/vitest": "4.0.0-beta.10", | |
| 30 | 29 | "@t3tools/contracts": "workspace:*", |
| 31 | 30 | "@t3tools/web": "workspace:*", |
| 32 | 31 | "@types/node": "^22.10.2", |
| 33 | 32 | "@types/ws": "^8.5.13", |
| 34 | 33 | "tsdown": "^0.20.3", |
| 35 | "typescript": "^5.7.3" | |
| 34 | "typescript": "^5.7.3", | |
| 35 | "vitest": "^4.0.0" | |
| 36 | 36 | } |
| 37 | 37 | } |
apps/server/src/orchestration/Errors.ts+11-11| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | import { ParseResult, Schema } from "effect"; | |
| 1 | import { SchemaIssue, Schema } from "effect"; | |
| 2 | 2 | |
| 3 | import type { OrchestrationEventRepositoryError } from "../persistence/Errors"; | |
| 3 | import type { OrchestrationEventRepositoryError } from "../persistence/Errors.ts"; | |
| 4 | 4 | |
| 5 | export class OrchestrationCommandJsonParseError extends Schema.TaggedError<OrchestrationCommandJsonParseError>()( | |
| 5 | export class OrchestrationCommandJsonParseError extends Schema.TaggedErrorClass<OrchestrationCommandJsonParseError>()( | |
| 6 | 6 | "OrchestrationCommandJsonParseError", |
| 7 | 7 | { |
| 8 | 8 | detail: Schema.String, |
| ... | ... | @@ -14,7 +14,7 @@ export class OrchestrationCommandJsonParseError extends Schema.TaggedError<Orche |
| 14 | 14 | } |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | export class OrchestrationCommandDecodeError extends Schema.TaggedError<OrchestrationCommandDecodeError>()( | |
| 17 | export class OrchestrationCommandDecodeError extends Schema.TaggedErrorClass<OrchestrationCommandDecodeError>()( | |
| 18 | 18 | "OrchestrationCommandDecodeError", |
| 19 | 19 | { |
| 20 | 20 | issue: Schema.String, |
| ... | ... | @@ -26,7 +26,7 @@ export class OrchestrationCommandDecodeError extends Schema.TaggedError<Orchestr |
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | export class OrchestrationReducerDecodeError extends Schema.TaggedError<OrchestrationReducerDecodeError>()( | |
| 29 | export class OrchestrationReducerDecodeError extends Schema.TaggedErrorClass<OrchestrationReducerDecodeError>()( | |
| 30 | 30 | "OrchestrationReducerDecodeError", |
| 31 | 31 | { |
| 32 | 32 | eventType: Schema.String, |
| ... | ... | @@ -39,10 +39,10 @@ export class OrchestrationReducerDecodeError extends Schema.TaggedError<Orchestr |
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | export class OrchestrationListenerCallbackError extends Schema.TaggedError<OrchestrationListenerCallbackError>()( | |
| 42 | export class OrchestrationListenerCallbackError extends Schema.TaggedErrorClass<OrchestrationListenerCallbackError>()( | |
| 43 | 43 | "OrchestrationListenerCallbackError", |
| 44 | 44 | { |
| 45 | listener: Schema.Literal("read-model", "domain-event"), | |
| 45 | listener: Schema.Literals(["read-model", "domain-event"]), | |
| 46 | 46 | detail: Schema.String, |
| 47 | 47 | cause: Schema.optional(Schema.Defect), |
| 48 | 48 | }, |
| ... | ... | @@ -62,18 +62,18 @@ export type OrchestrationEngineError = |
| 62 | 62 | | OrchestrationCommandJsonParseError |
| 63 | 63 | | OrchestrationCommandDecodeError; |
| 64 | 64 | |
| 65 | export function toOrchestrationCommandDecodeError(error: ParseResult.ParseError) { | |
| 65 | export function toOrchestrationCommandDecodeError(error: Schema.SchemaError) { | |
| 66 | 66 | return new OrchestrationCommandDecodeError({ |
| 67 | issue: ParseResult.TreeFormatter.formatErrorSync(error), | |
| 67 | issue: SchemaIssue.makeFormatterDefault()(error.issue), | |
| 68 | 68 | cause: error, |
| 69 | 69 | }); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | export function toReducerDecodeError(eventType: string) { |
| 73 | return (error: ParseResult.ParseError): OrchestrationReducerDecodeError => | |
| 73 | return (error: Schema.SchemaError): OrchestrationReducerDecodeError => | |
| 74 | 74 | new OrchestrationReducerDecodeError({ |
| 75 | 75 | eventType, |
| 76 | issue: ParseResult.TreeFormatter.formatErrorSync(error), | |
| 76 | issue: SchemaIssue.makeFormatterDefault()(error.issue), | |
| 77 | 77 | cause: error, |
| 78 | 78 | }); |
| 79 | 79 | } |
apps/server/src/orchestration/Layer.test.ts+10-14| ... | ... | @@ -3,22 +3,18 @@ import os from "node:os"; |
| 3 | 3 | import path from "node:path"; |
| 4 | 4 | |
| 5 | 5 | import type { OrchestrationEvent } from "@t3tools/contracts"; |
| 6 | import { Effect } from "effect"; | |
| 6 | import { Effect, Layer, ManagedRuntime } from "effect"; | |
| 7 | 7 | import { afterEach, describe, expect, it } from "vitest"; |
| 8 | 8 | |
| 9 | 9 | import { |
| 10 | 10 | OrchestrationEventRepository, |
| 11 | 11 | type OrchestrationEventRepositoryShape, |
| 12 | } from "../persistence/Services/OrchestrationEvents"; | |
| 13 | import { PersistenceSqlError } from "../persistence/Errors"; | |
| 14 | ||
| 15 | import { Layer, ManagedRuntime } from "effect"; | |
| 16 | ||
| 17 | import { makeSqlitePersistenceLive } from "../persistence/Layers/Sqlite"; | |
| 18 | ||
| 19 | import { OrchestrationEngineLive } from "./Layer"; | |
| 20 | import { OrchestrationEngineService } from "./Service"; | |
| 21 | import { OrchestrationEventRepositoryLive } from "../persistence/Layers/OrchestrationEvents"; | |
| 12 | } from "../persistence/Services/OrchestrationEvents.ts"; | |
| 13 | import { PersistenceSqlError } from "../persistence/Errors.ts"; | |
| 14 | import { makeSqlitePersistenceLive } from "../persistence/Layers/Sqlite.ts"; | |
| 15 | import { OrchestrationEngineLive } from "./Layer.ts"; | |
| 16 | import { OrchestrationEngineService } from "./Service.ts"; | |
| 17 | import { OrchestrationEventRepositoryLive } from "../persistence/Layers/OrchestrationEvents.ts"; | |
| 22 | 18 | |
| 23 | 19 | const tempDirs: string[] = []; |
| 24 | 20 | |
| ... | ... | @@ -41,7 +37,7 @@ export async function createOrchestrationSystem(stateDir: string) { |
| 41 | 37 | Layer.provide(makeSqlitePersistenceLive(dbPath)), |
| 42 | 38 | ); |
| 43 | 39 | const runtime = ManagedRuntime.make(orchestrationLayer); |
| 44 | const engine = await runtime.runPromise(OrchestrationEngineService); | |
| 40 | const engine = await runtime.runPromise(Effect.service(OrchestrationEngineService)); | |
| 45 | 41 | return { |
| 46 | 42 | engine, |
| 47 | 43 | run: <A, E>(effect: Effect.Effect<A, E>) => runtime.runPromise(effect), |
| ... | ... | @@ -362,7 +358,7 @@ describe("OrchestrationEngine", () => { |
| 362 | 358 | Layer.provide(Layer.succeed(OrchestrationEventRepository, inMemoryStore)), |
| 363 | 359 | ), |
| 364 | 360 | ); |
| 365 | await runtime.runPromise(OrchestrationEngineService); | |
| 361 | await runtime.runPromise(Effect.service(OrchestrationEngineService)); | |
| 366 | 362 | await runtime.dispose(); |
| 367 | 363 | await expect(runtime.dispose()).resolves.toBeUndefined(); |
| 368 | 364 | }); |
| ... | ... | @@ -404,7 +400,7 @@ describe("OrchestrationEngine", () => { |
| 404 | 400 | Layer.provide(Layer.succeed(OrchestrationEventRepository, flakyStore)), |
| 405 | 401 | ), |
| 406 | 402 | ); |
| 407 | const engine = await runtime.runPromise(OrchestrationEngineService); | |
| 403 | const engine = await runtime.runPromise(Effect.service(OrchestrationEngineService)); | |
| 408 | 404 | const createdAt = new Date().toISOString(); |
| 409 | 405 | |
| 410 | 406 | await expect( |
apps/server/src/orchestration/Layer.ts+10-10| ... | ... | @@ -6,16 +6,16 @@ import type { |
| 6 | 6 | import { OrchestrationCommandSchema } from "@t3tools/contracts"; |
| 7 | 7 | import { Deferred, Effect, Layer, PubSub, Queue, Schema } from "effect"; |
| 8 | 8 | |
| 9 | import { createLogger } from "../logger"; | |
| 10 | import { OrchestrationEventRepository } from "../persistence/Services/OrchestrationEvents"; | |
| 9 | import { createLogger } from "../logger.ts"; | |
| 10 | import { OrchestrationEventRepository } from "../persistence/Services/OrchestrationEvents.ts"; | |
| 11 | 11 | import { |
| 12 | 12 | toListenerCallbackError, |
| 13 | 13 | toOrchestrationCommandDecodeError, |
| 14 | 14 | toOrchestrationJsonParseError, |
| 15 | 15 | type OrchestrationDispatchError, |
| 16 | } from "./Errors"; | |
| 17 | import { createEmptyReadModel, reduceEvent } from "./reducer"; | |
| 18 | import { OrchestrationEngineService, type OrchestrationEngineShape } from "./Service"; | |
| 16 | } from "./Errors.ts"; | |
| 17 | import { createEmptyReadModel, reduceEvent } from "./reducer.ts"; | |
| 18 | import { OrchestrationEngineService, type OrchestrationEngineShape } from "./Service.ts"; | |
| 19 | 19 | |
| 20 | 20 | type CommandEnvelope = { |
| 21 | 21 | command: OrchestrationCommand; |
| ... | ... | @@ -160,9 +160,9 @@ function mapCommandToEvent(command: OrchestrationCommand): Omit<OrchestrationEve |
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | const decodeUnknownCommand = Schema.decodeUnknown(OrchestrationCommandSchema); | |
| 163 | const decodeUnknownCommand = Schema.decodeUnknownEffect(OrchestrationCommandSchema); | |
| 164 | 164 | |
| 165 | const makeOrchestrationEngine = () => | |
| 165 | const makeOrchestrationEngine = | |
| 166 | 166 | Effect.gen(function* () { |
| 167 | 167 | const logger = createLogger("orchestration"); |
| 168 | 168 | const eventStore = yield* OrchestrationEventRepository; |
| ... | ... | @@ -209,7 +209,7 @@ const makeOrchestrationEngine = () => |
| 209 | 209 | |
| 210 | 210 | yield* Deferred.succeed(envelope.result, { sequence: savedEvent.sequence }); |
| 211 | 211 | }).pipe( |
| 212 | Effect.catchAll((error) => Deferred.fail(envelope.result, error).pipe(Effect.asVoid)), | |
| 212 | Effect.catch((error) => Deferred.fail(envelope.result, error).pipe(Effect.asVoid)), | |
| 213 | 213 | ); |
| 214 | 214 | |
| 215 | 215 | const bootstrapReadModel: Effect.Effect<void, OrchestrationDispatchError> = Effect.gen( |
| ... | ... | @@ -287,7 +287,7 @@ const makeOrchestrationEngine = () => |
| 287 | 287 | } satisfies OrchestrationEngineShape; |
| 288 | 288 | }); |
| 289 | 289 | |
| 290 | export const OrchestrationEngineLive = Layer.scoped( | |
| 290 | export const OrchestrationEngineLive = Layer.effect( | |
| 291 | 291 | OrchestrationEngineService, |
| 292 | makeOrchestrationEngine(), | |
| 292 | makeOrchestrationEngine, | |
| 293 | 293 | ); |
apps/server/src/orchestration/Service.ts+5-5| ... | ... | @@ -11,11 +11,11 @@ import type { |
| 11 | 11 | OrchestrationEvent, |
| 12 | 12 | OrchestrationReadModel, |
| 13 | 13 | } from "@t3tools/contracts"; |
| 14 | import { Context } from "effect"; | |
| 14 | import { ServiceMap } from "effect"; | |
| 15 | 15 | import type { Effect } from "effect"; |
| 16 | 16 | |
| 17 | import type { OrchestrationDispatchError, OrchestrationEngineError } from "./Errors"; | |
| 18 | import type { OrchestrationEventRepositoryError } from "../persistence/Errors"; | |
| 17 | import type { OrchestrationDispatchError, OrchestrationEngineError } from "./Errors.ts"; | |
| 18 | import type { OrchestrationEventRepositoryError } from "../persistence/Errors.ts"; | |
| 19 | 19 | |
| 20 | 20 | export interface OrchestrationEngineShape { |
| 21 | 21 | /** |
| ... | ... | @@ -89,7 +89,7 @@ export interface OrchestrationEngineShape { |
| 89 | 89 | * }) |
| 90 | 90 | * ``` |
| 91 | 91 | */ |
| 92 | export class OrchestrationEngineService extends Context.Tag("orchestration/Engine")< | |
| 92 | export class OrchestrationEngineService extends ServiceMap.Service< | |
| 93 | 93 | OrchestrationEngineService, |
| 94 | 94 | OrchestrationEngineShape |
| 95 | >() {} | |
| 95 | >()("orchestration/Engine") {} |
apps/server/src/orchestration/reducer.test.ts+1-1| ... | ... | @@ -2,7 +2,7 @@ import type { OrchestrationEvent } from "@t3tools/contracts"; |
| 2 | 2 | import { Effect } from "effect"; |
| 3 | 3 | import { describe, expect, it } from "vitest"; |
| 4 | 4 | |
| 5 | import { createEmptyReadModel, reduceEvent } from "./reducer"; | |
| 5 | import { createEmptyReadModel, reduceEvent } from "./reducer.ts"; | |
| 6 | 6 | |
| 7 | 7 | describe("orchestration reducer", () => { |
| 8 | 8 | it("applies thread.created events using runtime schema decoding", async () => { |
apps/server/src/orchestration/reducer.ts+4-4| ... | ... | @@ -16,7 +16,7 @@ import { |
| 16 | 16 | } from "@t3tools/contracts"; |
| 17 | 17 | import { Effect, Schema } from "effect"; |
| 18 | 18 | |
| 19 | import { toReducerDecodeError, type OrchestrationReducerDecodeError } from "./Errors"; | |
| 19 | import { toReducerDecodeError, type OrchestrationReducerDecodeError } from "./Errors.ts"; | |
| 20 | 20 | |
| 21 | 21 | type ThreadPatch = Partial<Omit<OrchestrationThread, "id" | "projectId">>; |
| 22 | 22 | |
| ... | ... | @@ -34,9 +34,9 @@ function decodeForEvent<A>( |
| 34 | 34 | eventType: string, |
| 35 | 35 | field: string, |
| 36 | 36 | ): Effect.Effect<A, OrchestrationReducerDecodeError> { |
| 37 | return Schema.decodeUnknown(schema)(value).pipe( | |
| 37 | return Schema.decodeUnknownEffect(schema)(value).pipe( | |
| 38 | 38 | Effect.mapError(toReducerDecodeError(`${eventType}:${field}`)), |
| 39 | ); | |
| 39 | ) as Effect.Effect<A, OrchestrationReducerDecodeError> | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | const ThreadCreatedPayloadSchema = Schema.Struct({ |
| ... | ... | @@ -61,7 +61,7 @@ const ThreadMetaUpdatedPayloadSchema = Schema.Struct({ |
| 61 | 61 | |
| 62 | 62 | const MessageSentPayloadSchema = Schema.Struct({ |
| 63 | 63 | id: Schema.String, |
| 64 | role: Schema.Literal("user", "assistant"), | |
| 64 | role: Schema.Literals(["user", "assistant"]), | |
| 65 | 65 | text: Schema.String, |
| 66 | 66 | threadId: Schema.String, |
| 67 | 67 | createdAt: Schema.String, |
apps/server/src/persistence/Errors.ts+9-9| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | import { ParseResult, Schema } from "effect"; | |
| 1 | import { Schema, SchemaIssue } from "effect"; | |
| 2 | 2 | |
| 3 | export class PersistenceSqlError extends Schema.TaggedError<PersistenceSqlError>()( | |
| 3 | export class PersistenceSqlError extends Schema.TaggedErrorClass<PersistenceSqlError>()( | |
| 4 | 4 | "PersistenceSqlError", |
| 5 | 5 | { |
| 6 | 6 | operation: Schema.String, |
| ... | ... | @@ -13,7 +13,7 @@ export class PersistenceSqlError extends Schema.TaggedError<PersistenceSqlError> |
| 13 | 13 | } |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | export class PersistenceDecodeError extends Schema.TaggedError<PersistenceDecodeError>()( | |
| 16 | export class PersistenceDecodeError extends Schema.TaggedErrorClass<PersistenceDecodeError>()( | |
| 17 | 17 | "PersistenceDecodeError", |
| 18 | 18 | { |
| 19 | 19 | operation: Schema.String, |
| ... | ... | @@ -26,7 +26,7 @@ export class PersistenceDecodeError extends Schema.TaggedError<PersistenceDecode |
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | export class PersistenceSerializationError extends Schema.TaggedError<PersistenceSerializationError>()( | |
| 29 | export class PersistenceSerializationError extends Schema.TaggedErrorClass<PersistenceSerializationError>()( | |
| 30 | 30 | "PersistenceSerializationError", |
| 31 | 31 | { |
| 32 | 32 | operation: Schema.String, |
| ... | ... | @@ -39,7 +39,7 @@ export class PersistenceSerializationError extends Schema.TaggedError<Persistenc |
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | export class ProjectValidationError extends Schema.TaggedError<ProjectValidationError>()( | |
| 42 | export class ProjectValidationError extends Schema.TaggedErrorClass<ProjectValidationError>()( | |
| 43 | 43 | "ProjectValidationError", |
| 44 | 44 | { |
| 45 | 45 | operation: Schema.String, |
| ... | ... | @@ -52,7 +52,7 @@ export class ProjectValidationError extends Schema.TaggedError<ProjectValidation |
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | export class ProjectPathMissingError extends Schema.TaggedError<ProjectPathMissingError>()( | |
| 55 | export class ProjectPathMissingError extends Schema.TaggedErrorClass<ProjectPathMissingError>()( | |
| 56 | 56 | "ProjectPathMissingError", |
| 57 | 57 | { |
| 58 | 58 | cwd: Schema.String, |
| ... | ... | @@ -64,7 +64,7 @@ export class ProjectPathMissingError extends Schema.TaggedError<ProjectPathMissi |
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | export class ProjectNotFoundError extends Schema.TaggedError<ProjectNotFoundError>()( | |
| 67 | export class ProjectNotFoundError extends Schema.TaggedErrorClass<ProjectNotFoundError>()( | |
| 68 | 68 | "ProjectNotFoundError", |
| 69 | 69 | { |
| 70 | 70 | projectId: Schema.String, |
| ... | ... | @@ -99,10 +99,10 @@ export function toPersistenceSqlError(operation: string) { |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | export function toPersistenceDecodeError(operation: string) { |
| 102 | return (error: ParseResult.ParseError): PersistenceDecodeError => | |
| 102 | return (error: Schema.SchemaError): PersistenceDecodeError => | |
| 103 | 103 | new PersistenceDecodeError({ |
| 104 | 104 | operation, |
| 105 | issue: ParseResult.TreeFormatter.formatErrorSync(error), | |
| 105 | issue: SchemaIssue.makeFormatterDefault()(error.issue), | |
| 106 | 106 | cause: error, |
| 107 | 107 | }); |
| 108 | 108 | } |
apps/server/src/persistence/Layers/OrchestrationEvents.test.ts+13-13| ... | ... | @@ -3,11 +3,11 @@ import os from "node:os"; |
| 3 | 3 | import path from "node:path"; |
| 4 | 4 | import { DatabaseSync } from "node:sqlite"; |
| 5 | 5 | |
| 6 | import { Runtime, ManagedRuntime } from "effect"; | |
| 6 | import { ManagedRuntime, Effect } from "effect"; | |
| 7 | 7 | import { afterEach, describe, expect, it } from "vitest"; |
| 8 | 8 | |
| 9 | import { OrchestrationEventRepository } from "../Services/OrchestrationEvents"; | |
| 10 | import { makeSqliteOrchestrationEventRepositoryLive } from "./OrchestrationEvents"; | |
| 9 | import { OrchestrationEventRepository } from "../Services/OrchestrationEvents.ts"; | |
| 10 | import { makeSqliteOrchestrationEventRepositoryLive } from "./OrchestrationEvents.ts"; | |
| 11 | 11 | |
| 12 | 12 | const tempDirs: string[] = []; |
| 13 | 13 | |
| ... | ... | @@ -27,12 +27,12 @@ describe("OrchestrationEventRepository", () => { |
| 27 | 27 | it("persists and replays events across restarts", async () => { |
| 28 | 28 | const stateDir = makeTempDir("t3code-event-store-"); |
| 29 | 29 | const dbPath = path.join(stateDir, "orchestration.sqlite"); |
| 30 | const runtime = Runtime.defaultRuntime; | |
| 30 | ||
| 31 | 31 | const createdAt = new Date().toISOString(); |
| 32 | 32 | |
| 33 | 33 | const firstRuntime = ManagedRuntime.make(makeSqliteOrchestrationEventRepositoryLive(dbPath)); |
| 34 | const first = await firstRuntime.runPromise(OrchestrationEventRepository); | |
| 35 | const saved = await Runtime.runPromise(runtime)( | |
| 34 | const first = await firstRuntime.runPromise(Effect.service(OrchestrationEventRepository)); | |
| 35 | const saved = await firstRuntime.runPromise( | |
| 36 | 36 | first.append({ |
| 37 | 37 | eventId: "event-1", |
| 38 | 38 | type: "thread.created", |
| ... | ... | @@ -47,8 +47,8 @@ describe("OrchestrationEventRepository", () => { |
| 47 | 47 | await firstRuntime.dispose(); |
| 48 | 48 | |
| 49 | 49 | const secondRuntime = ManagedRuntime.make(makeSqliteOrchestrationEventRepositoryLive(dbPath)); |
| 50 | const second = await secondRuntime.runPromise(OrchestrationEventRepository); | |
| 51 | const replayed = await Runtime.runPromise(runtime)(second.readFromSequence(0)); | |
| 50 | const second = await secondRuntime.runPromise(Effect.service(OrchestrationEventRepository)); | |
| 51 | const replayed = await secondRuntime.runPromise(second.readFromSequence(0)); | |
| 52 | 52 | expect(replayed).toEqual([saved]); |
| 53 | 53 | await secondRuntime.dispose(); |
| 54 | 54 | }); |
| ... | ... | @@ -56,16 +56,16 @@ describe("OrchestrationEventRepository", () => { |
| 56 | 56 | it("creates and reuses the migrator tracking table", async () => { |
| 57 | 57 | const stateDir = makeTempDir("t3code-event-store-migrations-"); |
| 58 | 58 | const dbPath = path.join(stateDir, "orchestration.sqlite"); |
| 59 | const runtime = Runtime.defaultRuntime; | |
| 59 | ||
| 60 | 60 | |
| 61 | 61 | const firstRuntime = ManagedRuntime.make(makeSqliteOrchestrationEventRepositoryLive(dbPath)); |
| 62 | const first = await firstRuntime.runPromise(OrchestrationEventRepository); | |
| 63 | await Runtime.runPromise(runtime)(first.readAll()); | |
| 62 | const first = await firstRuntime.runPromise(Effect.service(OrchestrationEventRepository)); | |
| 63 | await firstRuntime.runPromise(first.readAll()); | |
| 64 | 64 | await firstRuntime.dispose(); |
| 65 | 65 | |
| 66 | 66 | const secondRuntime = ManagedRuntime.make(makeSqliteOrchestrationEventRepositoryLive(dbPath)); |
| 67 | const second = await secondRuntime.runPromise(OrchestrationEventRepository); | |
| 68 | await Runtime.runPromise(runtime)(second.readAll()); | |
| 67 | const second = await secondRuntime.runPromise(Effect.service(OrchestrationEventRepository)); | |
| 68 | await secondRuntime.runPromise(second.readAll()); | |
| 69 | 69 | await secondRuntime.dispose(); |
| 70 | 70 | |
| 71 | 71 | const db = new DatabaseSync(dbPath, { readOnly: true }); |
apps/server/src/persistence/Layers/OrchestrationEvents.ts+7-7| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | import type { OrchestrationEvent } from "@t3tools/contracts"; |
| 2 | 2 | import { OrchestrationEventSchema } from "@t3tools/contracts"; |
| 3 | import * as SqlClient from "@effect/sql/SqlClient"; | |
| 4 | import * as SqlSchema from "@effect/sql/SqlSchema"; | |
| 3 | import * as SqlClient from "effect/unstable/sql/SqlClient"; | |
| 4 | import * as SqlSchema from "effect/unstable/sql/SqlSchema"; | |
| 5 | 5 | import { Effect, Layer, Schema } from "effect"; |
| 6 | 6 | |
| 7 | 7 | import { |
| ... | ... | @@ -10,14 +10,14 @@ import { |
| 10 | 10 | toPersistenceSerializationError, |
| 11 | 11 | toPersistenceSqlError, |
| 12 | 12 | type OrchestrationEventRepositoryError, |
| 13 | } from "../Errors"; | |
| 14 | import { makeSqlitePersistenceLive } from "./Sqlite"; | |
| 13 | } from "../Errors.ts"; | |
| 14 | import { makeSqlitePersistenceLive } from "./Sqlite.ts"; | |
| 15 | 15 | import { |
| 16 | 16 | OrchestrationEventRepository, |
| 17 | 17 | type OrchestrationEventRepositoryShape, |
| 18 | } from "../Services/OrchestrationEvents"; | |
| 18 | } from "../Services/OrchestrationEvents.ts"; | |
| 19 | 19 | |
| 20 | const decodeEvent = Schema.decodeUnknown(OrchestrationEventSchema); | |
| 20 | const decodeEvent = Schema.decodeUnknownEffect(OrchestrationEventSchema); | |
| 21 | 21 | |
| 22 | 22 | const EventRowSchema = Schema.Struct({ |
| 23 | 23 | sequence: Schema.Number, |
| ... | ... | @@ -73,7 +73,7 @@ function eventRowToOrchestrationEvent( |
| 73 | 73 | const makeRepository = Effect.gen(function* () { |
| 74 | 74 | const sql = yield* SqlClient.SqlClient; |
| 75 | 75 | |
| 76 | const appendEventRow = SqlSchema.single({ | |
| 76 | const appendEventRow = SqlSchema.findOne({ | |
| 77 | 77 | Request: AppendEventRequestSchema, |
| 78 | 78 | Result: EventRowSchema, |
| 79 | 79 | execute: (request) => |
apps/server/src/persistence/Layers/Projects.test.ts+7-7| ... | ... | @@ -2,12 +2,12 @@ import fs from "node:fs"; |
| 2 | 2 | import os from "node:os"; |
| 3 | 3 | import path from "node:path"; |
| 4 | 4 | |
| 5 | import { Layer, ManagedRuntime } from "effect"; | |
| 5 | import { Effect, Layer, ManagedRuntime } from "effect"; | |
| 6 | 6 | import { afterEach, describe, expect, it } from "vitest"; |
| 7 | 7 | |
| 8 | import { ProjectRepository } from "../Services/Projects"; | |
| 9 | import { ProjectRepositoryLive } from "./Projects"; | |
| 10 | import { makeSqlitePersistenceLive } from "./Sqlite"; | |
| 8 | import { ProjectRepository } from "../Services/Projects.ts"; | |
| 9 | import { ProjectRepositoryLive } from "./Projects.ts"; | |
| 10 | import { makeSqlitePersistenceLive } from "./Sqlite.ts"; | |
| 11 | 11 | |
| 12 | 12 | function makeProjectRepositoryTest(dbPath: string) { |
| 13 | 13 | return ProjectRepositoryLive.pipe(Layer.provide(makeSqlitePersistenceLive(dbPath))); |
| ... | ... | @@ -34,7 +34,7 @@ describe("ProjectRepository", () => { |
| 34 | 34 | const dbPath = path.join(stateDir, "orchestration.sqlite"); |
| 35 | 35 | |
| 36 | 36 | const firstRuntime = ManagedRuntime.make(makeProjectRepositoryTest(dbPath)); |
| 37 | const first = await firstRuntime.runPromise(ProjectRepository); | |
| 37 | const first = await firstRuntime.runPromise(Effect.service(ProjectRepository)); | |
| 38 | 38 | |
| 39 | 39 | const created = await firstRuntime.runPromise(first.add({ cwd: projectDir })); |
| 40 | 40 | expect(created.created).toBe(true); |
| ... | ... | @@ -46,7 +46,7 @@ describe("ProjectRepository", () => { |
| 46 | 46 | await firstRuntime.dispose(); |
| 47 | 47 | |
| 48 | 48 | const secondRuntime = ManagedRuntime.make(makeProjectRepositoryTest(dbPath)); |
| 49 | const second = await secondRuntime.runPromise(ProjectRepository); | |
| 49 | const second = await secondRuntime.runPromise(Effect.service(ProjectRepository)); | |
| 50 | 50 | const listed = await secondRuntime.runPromise(second.list()); |
| 51 | 51 | |
| 52 | 52 | expect(listed).toHaveLength(1); |
| ... | ... | @@ -62,7 +62,7 @@ describe("ProjectRepository", () => { |
| 62 | 62 | const dbPath = path.join(stateDir, "orchestration.sqlite"); |
| 63 | 63 | |
| 64 | 64 | const runtime = ManagedRuntime.make(makeProjectRepositoryTest(dbPath)); |
| 65 | const repository = await runtime.runPromise(ProjectRepository); | |
| 65 | const repository = await runtime.runPromise(Effect.service(ProjectRepository)); | |
| 66 | 66 | |
| 67 | 67 | const existingProject = await runtime.runPromise(repository.add({ cwd: existing })); |
| 68 | 68 | const missingProject = await runtime.runPromise(repository.add({ cwd: missing })); |
apps/server/src/persistence/Layers/Projects.ts+10-10| ... | ... | @@ -19,8 +19,8 @@ import { |
| 19 | 19 | projectScriptsSchema, |
| 20 | 20 | projectUpdateScriptsInputSchema, |
| 21 | 21 | } from "@t3tools/contracts"; |
| 22 | import * as SqlClient from "@effect/sql/SqlClient"; | |
| 23 | import * as SqlSchema from "@effect/sql/SqlSchema"; | |
| 22 | import * as SqlClient from "effect/unstable/sql/SqlClient"; | |
| 23 | import * as SqlSchema from "effect/unstable/sql/SqlSchema"; | |
| 24 | 24 | import { Effect, Layer, Option, Schema } from "effect"; |
| 25 | 25 | |
| 26 | 26 | import { |
| ... | ... | @@ -32,8 +32,8 @@ import { |
| 32 | 32 | toPersistenceSerializationError, |
| 33 | 33 | toPersistenceSqlError, |
| 34 | 34 | type ProjectRepositoryError, |
| 35 | } from "../Errors"; | |
| 36 | import { ProjectRepository, type ProjectRepositoryShape } from "../Services/Projects"; | |
| 35 | } from "../Errors.ts"; | |
| 36 | import { ProjectRepository, type ProjectRepositoryShape } from "../Services/Projects.ts"; | |
| 37 | 37 | |
| 38 | 38 | const ProjectRowSchema = Schema.Struct({ |
| 39 | 39 | id: Schema.String, |
| ... | ... | @@ -226,7 +226,7 @@ const makeRepository = Effect.gen(function* () { |
| 226 | 226 | `, |
| 227 | 227 | }); |
| 228 | 228 | |
| 229 | const findProjectById = SqlSchema.findOne({ | |
| 229 | const findProjectById = SqlSchema.findOneOption({ | |
| 230 | 230 | Request: FindByIdRequestSchema, |
| 231 | 231 | Result: ProjectRowSchema, |
| 232 | 232 | execute: ({ id }) => |
| ... | ... | @@ -243,7 +243,7 @@ const makeRepository = Effect.gen(function* () { |
| 243 | 243 | `, |
| 244 | 244 | }); |
| 245 | 245 | |
| 246 | const findProjectByCwd = SqlSchema.findOne({ | |
| 246 | const findProjectByCwd = SqlSchema.findOneOption({ | |
| 247 | 247 | Request: FindByCwdRequestSchema, |
| 248 | 248 | Result: ProjectRowSchema, |
| 249 | 249 | execute: ({ cwd }) => |
| ... | ... | @@ -260,7 +260,7 @@ const makeRepository = Effect.gen(function* () { |
| 260 | 260 | `, |
| 261 | 261 | }); |
| 262 | 262 | |
| 263 | const insertProject = SqlSchema.single({ | |
| 263 | const insertProject = SqlSchema.findOne({ | |
| 264 | 264 | Request: InsertProjectRequestSchema, |
| 265 | 265 | Result: ProjectRowSchema, |
| 266 | 266 | execute: (request) => |
| ... | ... | @@ -291,7 +291,7 @@ const makeRepository = Effect.gen(function* () { |
| 291 | 291 | `, |
| 292 | 292 | }); |
| 293 | 293 | |
| 294 | const updateProjectScripts = SqlSchema.single({ | |
| 294 | const updateProjectScripts = SqlSchema.findOne({ | |
| 295 | 295 | Request: UpdateScriptsRequestSchema, |
| 296 | 296 | Result: ProjectRowSchema, |
| 297 | 297 | execute: (request) => |
| ... | ... | @@ -381,7 +381,7 @@ const makeRepository = Effect.gen(function* () { |
| 381 | 381 | Effect.mapError(toPersistenceSqlError("ProjectRepository.remove:findById")), |
| 382 | 382 | ); |
| 383 | 383 | if (Option.isNone(existing)) { |
| 384 | return yield* Effect.fail(new ProjectNotFoundError({ projectId: input.id })); | |
| 384 | return yield* (new ProjectNotFoundError({ projectId: input.id })); | |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | yield* deleteProject({ id: input.id }).pipe( |
| ... | ... | @@ -396,7 +396,7 @@ const makeRepository = Effect.gen(function* () { |
| 396 | 396 | Effect.mapError(toPersistenceSqlError("ProjectRepository.updateScripts:findById")), |
| 397 | 397 | ); |
| 398 | 398 | if (Option.isNone(existing)) { |
| 399 | return yield* Effect.fail(new ProjectNotFoundError({ projectId: input.id })); | |
| 399 | return yield* (new ProjectNotFoundError({ projectId: input.id })); | |
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | const nextScripts = yield* parseProjectScripts( |
apps/server/src/persistence/Layers/Sqlite.ts+12-9| ... | ... | @@ -1,30 +1,32 @@ |
| 1 | 1 | import fs from "node:fs"; |
| 2 | 2 | import path from "node:path"; |
| 3 | 3 | |
| 4 | import * as SqlClient from "@effect/sql/SqlClient"; | |
| 4 | import * as SqlClient from "effect/unstable/sql/SqlClient"; | |
| 5 | 5 | import * as SqliteClient from "@effect/sql-sqlite-node/SqliteClient"; |
| 6 | import { Context, Effect, Layer } from "effect"; | |
| 6 | import { Effect, Layer, ServiceMap } from "effect"; | |
| 7 | 7 | |
| 8 | import { runMigrations } from "../Migrations"; | |
| 8 | ||
| 9 | ||
| 10 | import { runMigrations } from "../Migrations.ts"; | |
| 9 | 11 | |
| 10 | 12 | export interface PersistenceConfigShape { |
| 11 | 13 | readonly dbPath: string; |
| 12 | 14 | } |
| 13 | 15 | |
| 14 | export class PersistenceConfig extends Context.Tag("persistence/Config")< | |
| 16 | export class PersistenceConfig extends ServiceMap.Service< | |
| 15 | 17 | PersistenceConfig, |
| 16 | 18 | PersistenceConfigShape |
| 17 | >() {} | |
| 19 | >()("persistence/Config") {} | |
| 18 | 20 | |
| 19 | 21 | export function makeSqlitePersistenceLive(dbPath: string) { |
| 20 | const SqliteClientLive = Layer.unwrapEffect( | |
| 22 | const SqliteClientLive = Layer.unwrap( | |
| 21 | 23 | Effect.sync(() => { |
| 22 | 24 | fs.mkdirSync(path.dirname(dbPath), { recursive: true }); |
| 23 | 25 | return SqliteClient.layer({ filename: dbPath }); |
| 24 | 26 | }), |
| 25 | 27 | ); |
| 26 | 28 | |
| 27 | return Layer.scoped( | |
| 29 | return Layer.effect( | |
| 28 | 30 | SqlClient.SqlClient, |
| 29 | 31 | Effect.gen(function* () { |
| 30 | 32 | const sql = yield* SqliteClient.SqliteClient; |
| ... | ... | @@ -36,6 +38,7 @@ export function makeSqlitePersistenceLive(dbPath: string) { |
| 36 | 38 | ).pipe(Layer.provide(SqliteClientLive)); |
| 37 | 39 | } |
| 38 | 40 | |
| 39 | export const SqlitePersistenceLive = Layer.unwrapEffect( | |
| 40 | Effect.map(PersistenceConfig, ({ dbPath }) => makeSqlitePersistenceLive(dbPath)), | |
| 41 | ||
| 42 | export const SqlitePersistenceLive = Layer.unwrap( | |
| 43 | Effect.map(Effect.service(PersistenceConfig), ({ dbPath }) => makeSqlitePersistenceLive(dbPath)), | |
| 41 | 44 | ); |
apps/server/src/persistence/Migrations.ts+4-4| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | * ensuring the database schema is always up-to-date before the application starts. |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | import * as Migrator from "@effect/sql/Migrator"; | |
| 11 | import * as Migrator from "effect/unstable/sql/Migrator"; | |
| 12 | 12 | import * as Layer from "effect/Layer"; |
| 13 | 13 | |
| 14 | 14 | // Import all migrations statically |
| ... | ... | @@ -57,11 +57,11 @@ export const runMigrations = run({ loader }); |
| 57 | 57 | * @example |
| 58 | 58 | * ```typescript |
| 59 | 59 | * import { MigrationsLive } from "@acme/db/Migrations" |
| 60 | * import { PgClient } from "@effect/sql-pg" | |
| 60 | * import { SqliteClient } from "@effect/sql-sqlite-node" | |
| 61 | 61 | * |
| 62 | * // Migrations run automatically when PgClient is provided | |
| 62 | * // Migrations run automatically when SqliteClient is provided | |
| 63 | 63 | * const AppLayer = MigrationsLive.pipe( |
| 64 | * Layer.provideMerge(PgClient.layer({ url: Redacted.make("postgresql://...") })) | |
| 64 | * Layer.provideMerge(SqliteClient.layer({ filename: "database.sqlite" })) | |
| 65 | 65 | * ) |
| 66 | 66 | * ``` |
| 67 | 67 | */ |
apps/server/src/persistence/Migrations/001_OrchestrationEvents.ts+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | import { SqlClient } from "@effect/sql"; | |
| 1 | import * as SqlClient from "effect/unstable/sql/SqlClient"; | |
| 2 | 2 | import * as Effect from "effect/Effect"; |
| 3 | 3 | |
| 4 | 4 | export default Effect.gen(function* () { |
apps/server/src/persistence/Migrations/002_Projects.ts+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | import { SqlClient } from "@effect/sql"; | |
| 1 | import * as SqlClient from "effect/unstable/sql/SqlClient"; | |
| 2 | 2 | import * as Effect from "effect/Effect"; |
| 3 | 3 | |
| 4 | 4 | export default Effect.gen(function* () { |
apps/server/src/persistence/Services/OrchestrationEvents.ts+4-4| ... | ... | @@ -7,10 +7,10 @@ |
| 7 | 7 | * @module OrchestrationEventRepository |
| 8 | 8 | */ |
| 9 | 9 | import type { OrchestrationEvent } from "@t3tools/contracts"; |
| 10 | import { Context } from "effect"; | |
| 10 | import { ServiceMap } from "effect"; | |
| 11 | 11 | import type { Effect } from "effect"; |
| 12 | 12 | |
| 13 | import type { OrchestrationEventRepositoryError } from "../Errors"; | |
| 13 | import type { OrchestrationEventRepositoryError } from "../Errors.ts"; | |
| 14 | 14 | |
| 15 | 15 | export interface OrchestrationEventRepositoryShape { |
| 16 | 16 | /** |
| ... | ... | @@ -54,7 +54,7 @@ export interface OrchestrationEventRepositoryShape { |
| 54 | 54 | * }) |
| 55 | 55 | * ``` |
| 56 | 56 | */ |
| 57 | export class OrchestrationEventRepository extends Context.Tag("orchestration/EventRepository")< | |
| 57 | export class OrchestrationEventRepository extends ServiceMap.Service< | |
| 58 | 58 | OrchestrationEventRepository, |
| 59 | 59 | OrchestrationEventRepositoryShape |
| 60 | >() {} | |
| 60 | >()("orchestration/EventRepository") {} |
apps/server/src/persistence/Services/Projects.ts+4-4| ... | ... | @@ -14,10 +14,10 @@ import type { |
| 14 | 14 | ProjectUpdateScriptsInput, |
| 15 | 15 | ProjectUpdateScriptsResult, |
| 16 | 16 | } from "@t3tools/contracts"; |
| 17 | import { Context } from "effect"; | |
| 17 | import { ServiceMap } from "effect"; | |
| 18 | 18 | import type { Effect } from "effect"; |
| 19 | 19 | |
| 20 | import type { ProjectRepositoryError } from "../Errors"; | |
| 20 | import type { ProjectRepositoryError } from "../Errors.ts"; | |
| 21 | 21 | |
| 22 | 22 | export interface ProjectRepositoryShape { |
| 23 | 23 | /** |
| ... | ... | @@ -72,7 +72,7 @@ export interface ProjectRepositoryShape { |
| 72 | 72 | * }) |
| 73 | 73 | * ``` |
| 74 | 74 | */ |
| 75 | export class ProjectRepository extends Context.Tag("persistence/ProjectRepository")< | |
| 75 | export class ProjectRepository extends ServiceMap.Service< | |
| 76 | 76 | ProjectRepository, |
| 77 | 77 | ProjectRepositoryShape |
| 78 | >() {} | |
| 78 | >()("persistence/ProjectRepository") {} |
apps/server/src/wsServer.test.ts+2-2| ... | ... | @@ -3,7 +3,7 @@ import os from "node:os"; |
| 3 | 3 | import path from "node:path"; |
| 4 | 4 | import { EventEmitter } from "node:events"; |
| 5 | 5 | |
| 6 | import { Layer, ManagedRuntime } from "effect"; | |
| 6 | import { Effect, Layer, ManagedRuntime } from "effect"; | |
| 7 | 7 | import { describe, expect, it, afterEach, vi } from "vitest"; |
| 8 | 8 | import { createServer } from "./wsServer"; |
| 9 | 9 | import WebSocket from "ws"; |
| ... | ... | @@ -1039,7 +1039,7 @@ describe("WebSocket Server", () => { |
| 1039 | 1039 | Layer.provide(makeSqlitePersistenceLive(path.join(stateDir, "orchestration.sqlite"))), |
| 1040 | 1040 | ), |
| 1041 | 1041 | ); |
| 1042 | const projectRepository = await projectRuntime.runPromise(ProjectRepository); | |
| 1042 | const projectRepository = await projectRuntime.runPromise(Effect.service(ProjectRepository)); | |
| 1043 | 1043 | await projectRuntime.runPromise(projectRepository.add({ cwd: existing })); |
| 1044 | 1044 | await projectRuntime.runPromise(projectRepository.add({ cwd: missing })); |
| 1045 | 1045 | await projectRuntime.dispose(); |
apps/server/src/wsServer.ts+3-3| ... | ... | @@ -18,7 +18,7 @@ import { |
| 18 | 18 | type WsResponse, |
| 19 | 19 | wsRequestSchema, |
| 20 | 20 | } from "@t3tools/contracts"; |
| 21 | import { Layer, ManagedRuntime } from "effect"; | |
| 21 | import { Effect, Layer, ManagedRuntime } from "effect"; | |
| 22 | 22 | import { WebSocketServer, type WebSocket } from "ws"; |
| 23 | 23 | |
| 24 | 24 | import { createLogger } from "./logger"; |
| ... | ... | @@ -747,8 +747,8 @@ export function createServer(options: ServerOptions) { |
| 747 | 747 | |
| 748 | 748 | try { |
| 749 | 749 | const [nextOrchestrationEngine, repository] = await Promise.all([ |
| 750 | runtime.runPromise(OrchestrationEngineService), | |
| 751 | runtime.runPromise(ProjectRepository), | |
| 750 | runtime.runPromise(Effect.service(OrchestrationEngineService)), | |
| 751 | runtime.runPromise(Effect.service(ProjectRepository)), | |
| 752 | 752 | ]); |
| 753 | 753 | orchestrationEngine = nextOrchestrationEngine; |
| 754 | 754 | projectRepository = repository; |
bun.lock+40-54| ... | ... | @@ -34,22 +34,22 @@ |
| 34 | 34 | "t3": "./dist/index.mjs", |
| 35 | 35 | }, |
| 36 | 36 | "dependencies": { |
| 37 | "@effect/platform": "^0.94.5", | |
| 38 | "@effect/platform-node": "^0.104.1", | |
| 39 | "@effect/sql": "^0.49.0", | |
| 40 | "@effect/sql-sqlite-node": "^0.50.1", | |
| 41 | "effect": "^3.19.19", | |
| 37 | "@effect/platform-node": "4.0.0-beta.10", | |
| 38 | "@effect/sql-sqlite-node": "4.0.0-beta.10", | |
| 39 | "effect": "4.0.0-beta.10", | |
| 42 | 40 | "node-pty": "^1.1.0", |
| 43 | 41 | "open": "^10.1.0", |
| 44 | 42 | "ws": "^8.18.0", |
| 45 | 43 | }, |
| 46 | 44 | "devDependencies": { |
| 45 | "@effect/vitest": "4.0.0-beta.10", | |
| 47 | 46 | "@t3tools/contracts": "workspace:*", |
| 48 | 47 | "@t3tools/web": "workspace:*", |
| 49 | 48 | "@types/node": "^22.10.2", |
| 50 | 49 | "@types/ws": "^8.5.13", |
| 51 | 50 | "tsdown": "^0.20.3", |
| 52 | 51 | "typescript": "^5.7.3", |
| 52 | "vitest": "^4.0.0", | |
| 53 | 53 | }, |
| 54 | 54 | }, |
| 55 | 55 | "apps/web": { |
| ... | ... | @@ -92,7 +92,7 @@ |
| 92 | 92 | "name": "@t3tools/contracts", |
| 93 | 93 | "version": "0.0.0", |
| 94 | 94 | "dependencies": { |
| 95 | "effect": "^3.19.19", | |
| 95 | "effect": "4.0.0-beta.10", | |
| 96 | 96 | "zod": "^3.24.1", |
| 97 | 97 | }, |
| 98 | 98 | "devDependencies": { |
| ... | ... | @@ -150,23 +150,13 @@ |
| 150 | 150 | |
| 151 | 151 | "@base-ui/utils": ["@base-ui/utils@0.2.5", "", { "dependencies": { "@babel/runtime": "^7.28.6", "@floating-ui/utils": "^0.2.10", "reselect": "^5.1.1", "use-sync-external-store": "^1.6.0" }, "peerDependencies": { "@types/react": "^17 || ^18 || ^19", "react": "^17 || ^18 || ^19", "react-dom": "^17 || ^18 || ^19" }, "optionalPeers": ["@types/react"] }, "sha512-oYC7w0gp76RI5MxprlGLV0wze0SErZaRl3AAkeP3OnNB/UBMb6RqNf6ZSIlxOc9Qp68Ab3C2VOcJQyRs7Xc7Vw=="], |
| 152 | 152 | |
| 153 | "@effect/cluster": ["@effect/cluster@0.56.4", "", { "dependencies": { "kubernetes-types": "^1.30.0" }, "peerDependencies": { "@effect/platform": "^0.94.5", "@effect/rpc": "^0.73.1", "@effect/sql": "^0.49.0", "@effect/workflow": "^0.16.0", "effect": "^3.19.17" } }, "sha512-7Je5/JlbZOlsSxsbKjr97dJed2cNGWsb+TLNgMcr5mRDbcWlFOTUGvsrisEJV6waosYLIg+2omPdvnvRoYKdhA=="], | |
| 154 | ||
| 155 | "@effect/experimental": ["@effect/experimental@0.58.0", "", { "dependencies": { "uuid": "^11.0.3" }, "peerDependencies": { "@effect/platform": "^0.94.0", "effect": "^3.19.13", "ioredis": "^5", "lmdb": "^3" }, "optionalPeers": ["ioredis", "lmdb"] }, "sha512-IEP9sapjF6rFy5TkoqDPc86st/fnqUfjT7Xa3pWJrFGr1hzaMXHo+mWsYOZS9LAOVKnpHuVziDK97EP5qsCHVA=="], | |
| 156 | ||
| 157 | "@effect/platform": ["@effect/platform@0.94.5", "", { "dependencies": { "find-my-way-ts": "^0.1.6", "msgpackr": "^1.11.4", "multipasta": "^0.2.7" }, "peerDependencies": { "effect": "^3.19.17" } }, "sha512-z05APUiDDPbodhTkH/RJqOLoCU11bU2IZLfcwLFrld03+ob1VeqRnELQlmueLIYm6NZifHAtjl32V+GRt34y4A=="], | |
| 158 | ||
| 159 | "@effect/platform-node": ["@effect/platform-node@0.104.1", "", { "dependencies": { "@effect/platform-node-shared": "^0.57.1", "mime": "^3.0.0", "undici": "^7.10.0", "ws": "^8.18.2" }, "peerDependencies": { "@effect/cluster": "^0.56.1", "@effect/platform": "^0.94.2", "@effect/rpc": "^0.73.0", "@effect/sql": "^0.49.0", "effect": "^3.19.15" } }, "sha512-jT1a/z98niK6fnEU8pWHPPCdJMVDRCIdB65lolcOjse5rsTwVbczMjvKkhVQpF63mNWoOnol7OTRNkw5L54llg=="], | |
| 153 | "@effect/platform-node": ["@effect/platform-node@4.0.0-beta.10", "", { "dependencies": { "@effect/platform-node-shared": "^4.0.0-beta.10", "mime": "^4.1.0", "undici": "^7.20.0" }, "peerDependencies": { "effect": "^4.0.0-beta.10", "ioredis": "^5.7.0" } }, "sha512-ikZ/uyos5okYAHE+wWOwZkHgriFUTY3aY8Kdqbj/ro8xw0z9YXWN4fbyQAZUWkBcieDKS36N+QfHRMPG4fEWRA=="], | |
| 160 | 154 | |
| 161 | "@effect/platform-node-shared": ["@effect/platform-node-shared@0.57.1", "", { "dependencies": { "@parcel/watcher": "^2.5.1", "multipasta": "^0.2.7", "ws": "^8.18.2" }, "peerDependencies": { "@effect/cluster": "^0.56.1", "@effect/platform": "^0.94.2", "@effect/rpc": "^0.73.0", "@effect/sql": "^0.49.0", "effect": "^3.19.15" } }, "sha512-oX/bApMdoKsyrDiNdJxo7U9Rz1RXsjRv+ecfAPp1qGlSdGIo32wVRvJ2XCHqYj0sqaYJS0pU0/GCulRfVGuJag=="], | |
| 155 | "@effect/platform-node-shared": ["@effect/platform-node-shared@4.0.0-beta.10", "", { "dependencies": { "@types/ws": "^8.18.1", "ws": "^8.19.0" }, "peerDependencies": { "effect": "^4.0.0-beta.10" } }, "sha512-gBSeOG2bfchXFdgdi5oipHKynOzSd7BlzTy5QcjFOoCUTtLP9igqohPB9hTkV3a6seWE2JJqsgsQ79VuLb7fAg=="], | |
| 162 | 156 | |
| 163 | "@effect/rpc": ["@effect/rpc@0.73.2", "", { "dependencies": { "msgpackr": "^1.11.4" }, "peerDependencies": { "@effect/platform": "^0.94.5", "effect": "^3.19.18" } }, "sha512-td7LHDgBOYKg+VgGWEelD8rSAmvjXz7am17vfxZROX5qIYuvH7drL/z4p5xQFadhHZ7DYdlFpqdO9ggc77OCIw=="], | |
| 157 | "@effect/sql-sqlite-node": ["@effect/sql-sqlite-node@4.0.0-beta.10", "", { "dependencies": { "better-sqlite3": "^12.6.2" }, "peerDependencies": { "effect": "^4.0.0-beta.10" } }, "sha512-oQl+gF31HaVM9R8YEpf96CIJypP1Roa5z1VPj8s7ZP+3aCtRVor1K+eMxYNAb8ph7R68Tz0LpmVkefq0mEI3CA=="], | |
| 164 | 158 | |
| 165 | "@effect/sql": ["@effect/sql@0.49.0", "", { "dependencies": { "uuid": "^11.0.3" }, "peerDependencies": { "@effect/experimental": "^0.58.0", "@effect/platform": "^0.94.0", "effect": "^3.19.13" } }, "sha512-9UEKR+z+MrI/qMAmSvb/RiD9KlgIazjZUCDSpwNgm0lEK9/Q6ExEyfziiYFVCPiptp52cBw8uBHRic8hHnwqXA=="], | |
| 166 | ||
| 167 | "@effect/sql-sqlite-node": ["@effect/sql-sqlite-node@0.50.1", "", { "dependencies": { "better-sqlite3": "^12.6.2" }, "peerDependencies": { "@effect/experimental": "^0.58.0", "@effect/platform": "^0.94.4", "@effect/sql": "^0.49.0", "effect": "^3.19.16" } }, "sha512-L7DlHcOVl9/9V5stttFyv9wjvA9PBbaXwsp9pU+KN8KqokWgAVBNBEDf/dVfboUrynbDpDWwMU9SJmRJ1LXASQ=="], | |
| 168 | ||
| 169 | "@effect/workflow": ["@effect/workflow@0.16.0", "", { "peerDependencies": { "@effect/experimental": "^0.58.0", "@effect/platform": "^0.94.0", "@effect/rpc": "^0.73.0", "effect": "^3.19.13" } }, "sha512-MiAdlxx3TixkgHdbw+Yf1Z3tHAAE0rOQga12kIydJqj05Fnod+W/I+kQGRMY/XWRg+QUsVxhmh1qTr7Ype6lrw=="], | |
| 159 | "@effect/vitest": ["@effect/vitest@4.0.0-beta.10", "", { "peerDependencies": { "effect": "^4.0.0-beta.10", "vitest": "^3.0.0" } }, "sha512-WmE8vCNw+eDoAq9CwwymrAdIBw1f+8hDP3AUF7jyC7/Cj/kyAYOFwkbtKmDXIFaTlf7G/2fmulEXeCO5W8j0kQ=="], | |
| 170 | 160 | |
| 171 | 161 | "@electron/get": ["@electron/get@2.0.3", "", { "dependencies": { "debug": "^4.1.1", "env-paths": "^2.2.0", "fs-extra": "^8.1.0", "got": "^11.8.5", "progress": "^2.0.3", "semver": "^6.2.0", "sumchecker": "^3.0.1" }, "optionalDependencies": { "global-agent": "^3.0.0" } }, "sha512-Qkzpg2s9GnVV2I2BjRksUi43U5e6+zaQMcjoJy0C+C5oxaKl+fmckGDQFtRpZpZV0NQekuZZ+tGz7EA9TVnQtQ=="], |
| 172 | 162 | |
| ... | ... | @@ -258,6 +248,8 @@ |
| 258 | 248 | |
| 259 | 249 | "@inquirer/type": ["@inquirer/type@3.0.10", "", { "peerDependencies": { "@types/node": ">=18" }, "optionalPeers": ["@types/node"] }, "sha512-BvziSRxfz5Ov8ch0z/n3oijRSEcEsHnhggm4xFZe93DHcUCTlutlq9Ox4SVENAfcRD22UQq7T/atg9Wr3k09eA=="], |
| 260 | 250 | |
| 251 | "@ioredis/commands": ["@ioredis/commands@1.5.0", "", {}, "sha512-eUgLqrMf8nJkZxT24JvVRrQya1vZkQh8BBeYNwGDqa5I0VUi8ACx7uFvAaLxintokpTenkK6DASvo/bvNbBGow=="], | |
| 252 | ||
| 261 | 253 | "@jridgewell/gen-mapping": ["@jridgewell/gen-mapping@0.3.13", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA=="], |
| 262 | 254 | |
| 263 | 255 | "@jridgewell/remapping": ["@jridgewell/remapping@2.3.5", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ=="], |
| ... | ... | @@ -348,34 +340,6 @@ |
| 348 | 340 | |
| 349 | 341 | "@oxlint/binding-win32-x64-msvc": ["@oxlint/binding-win32-x64-msvc@1.46.0", "", { "os": "win32", "cpu": "x64" }, "sha512-DJbQsSJUr4KSi9uU0QqOgI7PX2C+fKGZX+YDprt3vM2sC0dWZsgVTLoN2vtkNyEWJSY2mnvRFUshWXT3bmo0Ug=="], |
| 350 | 342 | |
| 351 | "@parcel/watcher": ["@parcel/watcher@2.5.6", "", { "dependencies": { "detect-libc": "^2.0.3", "is-glob": "^4.0.3", "node-addon-api": "^7.0.0", "picomatch": "^4.0.3" }, "optionalDependencies": { "@parcel/watcher-android-arm64": "2.5.6", "@parcel/watcher-darwin-arm64": "2.5.6", "@parcel/watcher-darwin-x64": "2.5.6", "@parcel/watcher-freebsd-x64": "2.5.6", "@parcel/watcher-linux-arm-glibc": "2.5.6", "@parcel/watcher-linux-arm-musl": "2.5.6", "@parcel/watcher-linux-arm64-glibc": "2.5.6", "@parcel/watcher-linux-arm64-musl": "2.5.6", "@parcel/watcher-linux-x64-glibc": "2.5.6", "@parcel/watcher-linux-x64-musl": "2.5.6", "@parcel/watcher-win32-arm64": "2.5.6", "@parcel/watcher-win32-ia32": "2.5.6", "@parcel/watcher-win32-x64": "2.5.6" } }, "sha512-tmmZ3lQxAe/k/+rNnXQRawJ4NjxO2hqiOLTHvWchtGZULp4RyFeh6aU4XdOYBFe2KE1oShQTv4AblOs2iOrNnQ=="], | |
| 352 | ||
| 353 | "@parcel/watcher-android-arm64": ["@parcel/watcher-android-arm64@2.5.6", "", { "os": "android", "cpu": "arm64" }, "sha512-YQxSS34tPF/6ZG7r/Ih9xy+kP/WwediEUsqmtf0cuCV5TPPKw/PQHRhueUo6JdeFJaqV3pyjm0GdYjZotbRt/A=="], | |
| 354 | ||
| 355 | "@parcel/watcher-darwin-arm64": ["@parcel/watcher-darwin-arm64@2.5.6", "", { "os": "darwin", "cpu": "arm64" }, "sha512-Z2ZdrnwyXvvvdtRHLmM4knydIdU9adO3D4n/0cVipF3rRiwP+3/sfzpAwA/qKFL6i1ModaabkU7IbpeMBgiVEA=="], | |
| 356 | ||
| 357 | "@parcel/watcher-darwin-x64": ["@parcel/watcher-darwin-x64@2.5.6", "", { "os": "darwin", "cpu": "x64" }, "sha512-HgvOf3W9dhithcwOWX9uDZyn1lW9R+7tPZ4sug+NGrGIo4Rk1hAXLEbcH1TQSqxts0NYXXlOWqVpvS1SFS4fRg=="], | |
| 358 | ||
| 359 | "@parcel/watcher-freebsd-x64": ["@parcel/watcher-freebsd-x64@2.5.6", "", { "os": "freebsd", "cpu": "x64" }, "sha512-vJVi8yd/qzJxEKHkeemh7w3YAn6RJCtYlE4HPMoVnCpIXEzSrxErBW5SJBgKLbXU3WdIpkjBTeUNtyBVn8TRng=="], | |
| 360 | ||
| 361 | "@parcel/watcher-linux-arm-glibc": ["@parcel/watcher-linux-arm-glibc@2.5.6", "", { "os": "linux", "cpu": "arm" }, "sha512-9JiYfB6h6BgV50CCfasfLf/uvOcJskMSwcdH1PHH9rvS1IrNy8zad6IUVPVUfmXr+u+Km9IxcfMLzgdOudz9EQ=="], | |
| 362 | ||
| 363 | "@parcel/watcher-linux-arm-musl": ["@parcel/watcher-linux-arm-musl@2.5.6", "", { "os": "linux", "cpu": "arm" }, "sha512-Ve3gUCG57nuUUSyjBq/MAM0CzArtuIOxsBdQ+ftz6ho8n7s1i9E1Nmk/xmP323r2YL0SONs1EuwqBp2u1k5fxg=="], | |
| 364 | ||
| 365 | "@parcel/watcher-linux-arm64-glibc": ["@parcel/watcher-linux-arm64-glibc@2.5.6", "", { "os": "linux", "cpu": "arm64" }, "sha512-f2g/DT3NhGPdBmMWYoxixqYr3v/UXcmLOYy16Bx0TM20Tchduwr4EaCbmxh1321TABqPGDpS8D/ggOTaljijOA=="], | |
| 366 | ||
| 367 | "@parcel/watcher-linux-arm64-musl": ["@parcel/watcher-linux-arm64-musl@2.5.6", "", { "os": "linux", "cpu": "arm64" }, "sha512-qb6naMDGlbCwdhLj6hgoVKJl2odL34z2sqkC7Z6kzir8b5W65WYDpLB6R06KabvZdgoHI/zxke4b3zR0wAbDTA=="], | |
| 368 | ||
| 369 | "@parcel/watcher-linux-x64-glibc": ["@parcel/watcher-linux-x64-glibc@2.5.6", "", { "os": "linux", "cpu": "x64" }, "sha512-kbT5wvNQlx7NaGjzPFu8nVIW1rWqV780O7ZtkjuWaPUgpv2NMFpjYERVi0UYj1msZNyCzGlaCWEtzc+exjMGbQ=="], | |
| 370 | ||
| 371 | "@parcel/watcher-linux-x64-musl": ["@parcel/watcher-linux-x64-musl@2.5.6", "", { "os": "linux", "cpu": "x64" }, "sha512-1JRFeC+h7RdXwldHzTsmdtYR/Ku8SylLgTU/reMuqdVD7CtLwf0VR1FqeprZ0eHQkO0vqsbvFLXUmYm/uNKJBg=="], | |
| 372 | ||
| 373 | "@parcel/watcher-win32-arm64": ["@parcel/watcher-win32-arm64@2.5.6", "", { "os": "win32", "cpu": "arm64" }, "sha512-3ukyebjc6eGlw9yRt678DxVF7rjXatWiHvTXqphZLvo7aC5NdEgFufVwjFfY51ijYEWpXbqF5jtrK275z52D4Q=="], | |
| 374 | ||
| 375 | "@parcel/watcher-win32-ia32": ["@parcel/watcher-win32-ia32@2.5.6", "", { "os": "win32", "cpu": "ia32" }, "sha512-k35yLp1ZMwwee3Ez/pxBi5cf4AoBKYXj00CZ80jUz5h8prpiaQsiRPKQMxoLstNuqe2vR4RNPEAEcjEFzhEz/g=="], | |
| 376 | ||
| 377 | "@parcel/watcher-win32-x64": ["@parcel/watcher-win32-x64@2.5.6", "", { "os": "win32", "cpu": "x64" }, "sha512-hbQlYcCq5dlAX9Qx+kFb0FHue6vbjlf0FrNzSKdYK2APUf7tGfGxQCk2ihEREmbR6ZMc0MVAD5RIX/41gpUzTw=="], | |
| 378 | ||
| 379 | 343 | "@pierre/diffs": ["@pierre/diffs@1.1.0-beta.16", "", { "dependencies": { "@shikijs/transformers": "^3.0.0", "diff": "8.0.3", "hast-util-to-html": "9.0.5", "lru_map": "0.4.1", "shiki": "^3.0.0" }, "peerDependencies": { "react": "^18.3.1 || ^19.0.0", "react-dom": "^18.3.1 || ^19.0.0" } }, "sha512-McjTuEPuacSIcXdoI2O9W6VSHIOs9ApEHnEUwONKZnKqIo2GGv1vNg9Pr8tgBOL7lgBWNEHX5ROJ5z1X74sENQ=="], |
| 380 | 344 | |
| 381 | 345 | "@quansync/fs": ["@quansync/fs@1.0.0", "", { "dependencies": { "quansync": "^1.0.0" } }, "sha512-4TJ3DFtlf1L5LDMaM6CanJ/0lckGNtJcMjQ1NAV6zDmA0tEHKZtxNKin8EgPaVX1YzljbxckyT2tJrpQKAtngQ=="], |
| ... | ... | @@ -710,6 +674,8 @@ |
| 710 | 674 | |
| 711 | 675 | "clsx": ["clsx@2.1.1", "", {}, "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA=="], |
| 712 | 676 | |
| 677 | "cluster-key-slot": ["cluster-key-slot@1.1.2", "", {}, "sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA=="], | |
| 678 | ||
| 713 | 679 | "color-convert": ["color-convert@2.0.1", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="], |
| 714 | 680 | |
| 715 | 681 | "color-name": ["color-name@1.1.4", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="], |
| ... | ... | @@ -750,6 +716,8 @@ |
| 750 | 716 | |
| 751 | 717 | "delayed-stream": ["delayed-stream@1.0.0", "", {}, "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="], |
| 752 | 718 | |
| 719 | "denque": ["denque@2.1.0", "", {}, "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw=="], | |
| 720 | ||
| 753 | 721 | "dequal": ["dequal@2.0.3", "", {}, "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA=="], |
| 754 | 722 | |
| 755 | 723 | "detect-libc": ["detect-libc@2.1.2", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="], |
| ... | ... | @@ -764,7 +732,7 @@ |
| 764 | 732 | |
| 765 | 733 | "dunder-proto": ["dunder-proto@1.0.1", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="], |
| 766 | 734 | |
| 767 | "effect": ["effect@3.19.19", "", { "dependencies": { "@standard-schema/spec": "^1.0.0", "fast-check": "^3.23.1" } }, "sha512-Yc8U/SVXo2dHnaP7zNBlAo83h/nzSJpi7vph6Hzyl4ulgMBIgPmz3UzOjb9sBgpFE00gC0iETR244sfXDNLHRg=="], | |
| 735 | "effect": ["effect@4.0.0-beta.10", "", { "dependencies": { "@standard-schema/spec": "^1.1.0", "fast-check": "^4.5.3", "find-my-way-ts": "^0.1.6", "ini": "^6.0.0", "kubernetes-types": "^1.30.0", "msgpackr": "^1.11.8", "multipasta": "^0.2.7", "toml": "^3.0.0", "uuid": "^13.0.0", "yaml": "^2.8.2" } }, "sha512-UvxWmT0uzWZqNmQODfW7y1zb0LMlH3xtSn/UESpck2Wvv6SogxibYPWKKNcUsRMm5wwprOoW2IwItYLQyZpe8Q=="], | |
| 768 | 736 | |
| 769 | 737 | "electron": ["electron@40.6.0", "", { "dependencies": { "@electron/get": "^2.0.0", "@types/node": "^24.9.0", "extract-zip": "^2.0.1" }, "bin": { "electron": "cli.js" } }, "sha512-ett8W+yOFGDuM0vhJMamYSkrbV3LoaffzJd9GfjI96zRAxyrNqUSKqBpf/WGbQCweDxX2pkUCUfrv4wwKpsFZA=="], |
| 770 | 738 | |
| ... | ... | @@ -814,7 +782,7 @@ |
| 814 | 782 | |
| 815 | 783 | "extract-zip": ["extract-zip@2.0.1", "", { "dependencies": { "debug": "^4.1.1", "get-stream": "^5.1.0", "yauzl": "^2.10.0" }, "optionalDependencies": { "@types/yauzl": "^2.9.1" }, "bin": { "extract-zip": "cli.js" } }, "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg=="], |
| 816 | 784 | |
| 817 | "fast-check": ["fast-check@3.23.2", "", { "dependencies": { "pure-rand": "^6.1.0" } }, "sha512-h5+1OzzfCC3Ef7VbtKdcv7zsstUQwUDlYpUTvjeUsJAssPgLn7QzbboPtL5ro04Mq0rPOsMzl7q5hIbRs2wD1A=="], | |
| 785 | "fast-check": ["fast-check@4.5.3", "", { "dependencies": { "pure-rand": "^7.0.0" } }, "sha512-IE9csY7lnhxBnA8g/WI5eg/hygA6MGWJMSNfFRrBlXUciADEhS1EDB0SIsMSvzubzIlOBbVITSsypCsW717poA=="], | |
| 818 | 786 | |
| 819 | 787 | "fd-slicer": ["fd-slicer@1.1.0", "", { "dependencies": { "pend": "~1.2.0" } }, "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g=="], |
| 820 | 788 | |
| ... | ... | @@ -908,10 +876,12 @@ |
| 908 | 876 | |
| 909 | 877 | "inherits": ["inherits@2.0.4", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="], |
| 910 | 878 | |
| 911 | "ini": ["ini@1.3.8", "", {}, "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="], | |
| 879 | "ini": ["ini@6.0.0", "", {}, "sha512-IBTdIkzZNOpqm7q3dRqJvMaldXjDHWkEDfrwGEQTs5eaQMWV+djAhR+wahyNNMAa+qpbDUhBMVt4ZKNwpPm7xQ=="], | |
| 912 | 880 | |
| 913 | 881 | "inline-style-parser": ["inline-style-parser@0.2.7", "", {}, "sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA=="], |
| 914 | 882 | |
| 883 | "ioredis": ["ioredis@5.9.3", "", { "dependencies": { "@ioredis/commands": "1.5.0", "cluster-key-slot": "^1.1.0", "debug": "^4.3.4", "denque": "^2.1.0", "lodash.defaults": "^4.2.0", "lodash.isarguments": "^3.1.0", "redis-errors": "^1.2.0", "redis-parser": "^3.0.0", "standard-as-callback": "^2.1.0" } }, "sha512-VI5tMCdeoxZWU5vjHWsiE/Su76JGhBvWF1MJnV9ZtGltHk9BmD48oDq8Tj8haZ85aceXZMxLNDQZRVo5QKNgXA=="], | |
| 884 | ||
| 915 | 885 | "is-alphabetical": ["is-alphabetical@2.0.1", "", {}, "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ=="], |
| 916 | 886 | |
| 917 | 887 | "is-alphanumerical": ["is-alphanumerical@2.0.1", "", { "dependencies": { "is-alphabetical": "^2.0.0", "is-decimal": "^2.0.0" } }, "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw=="], |
| ... | ... | @@ -988,8 +958,12 @@ |
| 988 | 958 | |
| 989 | 959 | "lodash": ["lodash@4.17.23", "", {}, "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w=="], |
| 990 | 960 | |
| 961 | "lodash.defaults": ["lodash.defaults@4.2.0", "", {}, "sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ=="], | |
| 962 | ||
| 991 | 963 | "lodash.difference": ["lodash.difference@4.5.0", "", {}, "sha512-dS2j+W26TQ7taQBGN8Lbbq04ssV3emRw4NY58WErlTO29pIqS0HmoT5aJ9+TUQ1N3G+JOZSji4eugsWwGp9yPA=="], |
| 992 | 964 | |
| 965 | "lodash.isarguments": ["lodash.isarguments@3.1.0", "", {}, "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg=="], | |
| 966 | ||
| 993 | 967 | "longest-streak": ["longest-streak@3.1.0", "", {}, "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g=="], |
| 994 | 968 | |
| 995 | 969 | "lowercase-keys": ["lowercase-keys@2.0.0", "", {}, "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA=="], |
| ... | ... | @@ -1098,7 +1072,7 @@ |
| 1098 | 1072 | |
| 1099 | 1073 | "micromatch": ["micromatch@4.0.8", "", { "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" } }, "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA=="], |
| 1100 | 1074 | |
| 1101 | "mime": ["mime@3.0.0", "", { "bin": { "mime": "cli.js" } }, "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A=="], | |
| 1075 | "mime": ["mime@4.1.0", "", { "bin": { "mime": "bin/cli.js" } }, "sha512-X5ju04+cAzsojXKes0B/S4tcYtFAJ6tTMuSPBEn9CPGlrWr8Fiw7qYeLT0XyH80HSoAoqWCaz+MWKh22P7G1cw=="], | |
| 1102 | 1076 | |
| 1103 | 1077 | "mime-db": ["mime-db@1.52.0", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="], |
| 1104 | 1078 | |
| ... | ... | @@ -1188,7 +1162,7 @@ |
| 1188 | 1162 | |
| 1189 | 1163 | "pump": ["pump@3.0.3", "", { "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" } }, "sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA=="], |
| 1190 | 1164 | |
| 1191 | "pure-rand": ["pure-rand@6.1.0", "", {}, "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA=="], | |
| 1165 | "pure-rand": ["pure-rand@7.0.1", "", {}, "sha512-oTUZM/NAZS8p7ANR3SHh30kXB+zK2r2BPcEn/awJIbOvq82WoMN4p62AWWp3Hhw50G0xMsw1mhIBLqHw64EcNQ=="], | |
| 1192 | 1166 | |
| 1193 | 1167 | "quansync": ["quansync@1.0.0", "", {}, "sha512-5xZacEEufv3HSTPQuchrvV6soaiACMFnq1H8wkVioctoH3TRha9Sz66lOxRwPK/qZj7HPiSveih9yAyh98gvqA=="], |
| 1194 | 1168 | |
| ... | ... | @@ -1210,6 +1184,10 @@ |
| 1210 | 1184 | |
| 1211 | 1185 | "recast": ["recast@0.23.11", "", { "dependencies": { "ast-types": "^0.16.1", "esprima": "~4.0.0", "source-map": "~0.6.1", "tiny-invariant": "^1.3.3", "tslib": "^2.0.1" } }, "sha512-YTUo+Flmw4ZXiWfQKGcwwc11KnoRAYgzAE2E7mXKCjSviTKShtxBsN6YUUBB2gtaBzKzeKunxhUwNHQuRryhWA=="], |
| 1212 | 1186 | |
| 1187 | "redis-errors": ["redis-errors@1.2.0", "", {}, "sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w=="], | |
| 1188 | ||
| 1189 | "redis-parser": ["redis-parser@3.0.0", "", { "dependencies": { "redis-errors": "^1.0.0" } }, "sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A=="], | |
| 1190 | ||
| 1213 | 1191 | "regex": ["regex@6.1.0", "", { "dependencies": { "regex-utilities": "^2.3.0" } }, "sha512-6VwtthbV4o/7+OaAF9I5L5V3llLEsoPyq9P1JVXkedTP33c7MfCG0/5NOPcSJn0TzXcG9YUrR0gQSWioew3LDg=="], |
| 1214 | 1192 | |
| 1215 | 1193 | "regex-recursion": ["regex-recursion@6.0.2", "", { "dependencies": { "regex-utilities": "^2.3.0" } }, "sha512-0YCaSCq2VRIebiaUviZNs0cBz1kg5kVS2UKUfNIx8YVs1cN3AV7NTctO5FOKBA+UT2BPJIWZauYHPqJODG50cg=="], |
| ... | ... | @@ -1290,6 +1268,8 @@ |
| 1290 | 1268 | |
| 1291 | 1269 | "stackback": ["stackback@0.0.2", "", {}, "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw=="], |
| 1292 | 1270 | |
| 1271 | "standard-as-callback": ["standard-as-callback@2.1.0", "", {}, "sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A=="], | |
| 1272 | ||
| 1293 | 1273 | "statuses": ["statuses@2.0.2", "", {}, "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw=="], |
| 1294 | 1274 | |
| 1295 | 1275 | "std-env": ["std-env@3.10.0", "", {}, "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg=="], |
| ... | ... | @@ -1350,6 +1330,8 @@ |
| 1350 | 1330 | |
| 1351 | 1331 | "to-regex-range": ["to-regex-range@5.0.1", "", { "dependencies": { "is-number": "^7.0.0" } }, "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ=="], |
| 1352 | 1332 | |
| 1333 | "toml": ["toml@3.0.0", "", {}, "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w=="], | |
| 1334 | ||
| 1353 | 1335 | "tough-cookie": ["tough-cookie@6.0.0", "", { "dependencies": { "tldts": "^7.0.5" } }, "sha512-kXuRi1mtaKMrsLUxz3sQYvVl37B0Ns6MzfrtV5DvJceE9bPyspOqk9xxv7XbZWcfLWbFmm997vl83qUWVJA64w=="], |
| 1354 | 1336 | |
| 1355 | 1337 | "tree-kill": ["tree-kill@1.2.2", "", { "bin": { "tree-kill": "cli.js" } }, "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A=="], |
| ... | ... | @@ -1420,7 +1402,7 @@ |
| 1420 | 1402 | |
| 1421 | 1403 | "util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="], |
| 1422 | 1404 | |
| 1423 | "uuid": ["uuid@11.1.0", "", { "bin": { "uuid": "dist/esm/bin/uuid" } }, "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A=="], | |
| 1405 | "uuid": ["uuid@13.0.0", "", { "bin": { "uuid": "dist-node/bin/uuid" } }, "sha512-XQegIaBTVUjSHliKqcnFqYypAd4S+WCYt5NIeRs6w/UAry7z8Y9j5ZwRRL4kzq9U3sD6v+85er9FvkEaBpji2w=="], | |
| 1424 | 1406 | |
| 1425 | 1407 | "vfile": ["vfile@6.0.3", "", { "dependencies": { "@types/unist": "^3.0.0", "vfile-message": "^4.0.0" } }, "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q=="], |
| 1426 | 1408 | |
| ... | ... | @@ -1450,6 +1432,8 @@ |
| 1450 | 1432 | |
| 1451 | 1433 | "yallist": ["yallist@3.1.1", "", {}, "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="], |
| 1452 | 1434 | |
| 1435 | "yaml": ["yaml@2.8.2", "", { "bin": { "yaml": "bin.mjs" } }, "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A=="], | |
| 1436 | ||
| 1453 | 1437 | "yargs": ["yargs@17.7.2", "", { "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", "string-width": "^4.2.3", "y18n": "^5.0.5", "yargs-parser": "^21.1.1" } }, "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w=="], |
| 1454 | 1438 | |
| 1455 | 1439 | "yargs-parser": ["yargs-parser@21.1.1", "", {}, "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw=="], |
| ... | ... | @@ -1530,6 +1514,8 @@ |
| 1530 | 1514 | |
| 1531 | 1515 | "parse-entities/@types/unist": ["@types/unist@2.0.11", "", {}, "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA=="], |
| 1532 | 1516 | |
| 1517 | "rc/ini": ["ini@1.3.8", "", {}, "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="], | |
| 1518 | ||
| 1533 | 1519 | "readdirp/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="], |
| 1534 | 1520 | |
| 1535 | 1521 | "recast/source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="], |
packages/contracts/package.json+1-1| ... | ... | @@ -23,7 +23,7 @@ |
| 23 | 23 | "test": "vitest run" |
| 24 | 24 | }, |
| 25 | 25 | "dependencies": { |
| 26 | "effect": "^3.19.19", | |
| 26 | "effect": "4.0.0-beta.10", | |
| 27 | 27 | "zod": "^3.24.1" |
| 28 | 28 | }, |
| 29 | 29 | "devDependencies": { |
packages/contracts/src/orchestration.ts+7-7| ... | ... | @@ -16,7 +16,7 @@ const IdSchema = Schema.String; |
| 16 | 16 | |
| 17 | 17 | export const OrchestrationMessageSchema = Schema.Struct({ |
| 18 | 18 | id: IdSchema, |
| 19 | role: Schema.Literal("user", "assistant"), | |
| 19 | role: Schema.Literals(["user", "assistant"]), | |
| 20 | 20 | text: Schema.String, |
| 21 | 21 | createdAt: IsoDateTimeSchema, |
| 22 | 22 | streaming: Schema.Boolean, |
| ... | ... | @@ -26,8 +26,8 @@ export type OrchestrationMessage = Schema.Schema.Type<typeof OrchestrationMessag |
| 26 | 26 | |
| 27 | 27 | export const OrchestrationSessionSchema = Schema.Struct({ |
| 28 | 28 | sessionId: IdSchema, |
| 29 | status: Schema.Literal("connecting", "ready", "running", "error", "closed"), | |
| 30 | provider: Schema.Literal("codex", "claudeCode"), | |
| 29 | status: Schema.Literals(["connecting", "ready", "running", "error", "closed"]), | |
| 30 | provider: Schema.Literals(["codex", "claudeCode"]), | |
| 31 | 31 | threadId: IdSchema, |
| 32 | 32 | activeTurnId: Schema.NullOr(Schema.String), |
| 33 | 33 | createdAt: IsoDateTimeSchema, |
| ... | ... | @@ -94,7 +94,7 @@ export type OrchestrationGitReadModel = Schema.Schema.Type<typeof OrchestrationG |
| 94 | 94 | export const OrchestrationReadModelSchema = Schema.Struct({ |
| 95 | 95 | sequence: Schema.Number, |
| 96 | 96 | threads: Schema.Array(OrchestrationThreadSchema), |
| 97 | gitByProjectId: Schema.Record({ key: Schema.String, value: OrchestrationGitReadModelSchema }), | |
| 97 | gitByProjectId: Schema.Record( Schema.String, OrchestrationGitReadModelSchema), | |
| 98 | 98 | updatedAt: IsoDateTimeSchema, |
| 99 | 99 | }); |
| 100 | 100 | |
| ... | ... | @@ -135,7 +135,7 @@ export const SendMessageCommandSchema = Schema.Struct({ |
| 135 | 135 | commandId: IdSchema, |
| 136 | 136 | threadId: IdSchema, |
| 137 | 137 | messageId: IdSchema, |
| 138 | role: Schema.Literal("user", "assistant"), | |
| 138 | role: Schema.Literals(["user", "assistant"]), | |
| 139 | 139 | text: Schema.String, |
| 140 | 140 | streaming: Schema.optional(Schema.Boolean), |
| 141 | 141 | createdAt: IsoDateTimeSchema, |
| ... | ... | @@ -182,7 +182,7 @@ export const RevertThreadCommandSchema = Schema.Struct({ |
| 182 | 182 | createdAt: IsoDateTimeSchema, |
| 183 | 183 | }); |
| 184 | 184 | |
| 185 | export const OrchestrationCommandSchema = Schema.Union( | |
| 185 | export const OrchestrationCommandSchema = Schema.Union([ | |
| 186 | 186 | CreateThreadCommandSchema, |
| 187 | 187 | DeleteThreadCommandSchema, |
| 188 | 188 | UpdateThreadMetaCommandSchema, |
| ... | ... | @@ -190,7 +190,7 @@ export const OrchestrationCommandSchema = Schema.Union( |
| 190 | 190 | SetThreadSessionSchema, |
| 191 | 191 | UpsertGitReadModelCommandSchema, |
| 192 | 192 | CompleteThreadTurnDiffCommandSchema, |
| 193 | RevertThreadCommandSchema, | |
| 193 | RevertThreadCommandSchema,] | |
| 194 | 194 | ); |
| 195 | 195 | |
| 196 | 196 | export type OrchestrationCommand = Schema.Schema.Type<typeof OrchestrationCommandSchema>; |