refactor(server): one module per service instead of Services/ and Layers/ folders (#16295)
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
1 parent
64275ae396
commit
3d17862e58
191 files changed
+1144
-1184
No files matched your search
@@ -69,4 +69,4 @@ Gradle auto-downloads any additional pinned SDK packages on demand.
|
||||
## Known flaky tests (unrelated to setup)
|
||||
|
||||
- `apps/server/src/git/GitManager.test.ts` (cross-repo PR metadata, can time out at 12s).
|
||||
- `apps/server/src/provider/Layers/ProviderRegistry.test.ts` (codex binaryPath re-probe ordering).
|
||||
- `apps/server/src/provider/ProviderRegistry.test.ts` (codex binaryPath re-probe ordering).
|
||||
@@ -35,8 +35,8 @@ import * as HttpApi from "effect/http-api/HttpApi";
|
||||
import * as HttpApiBuilder from "effect/http-api/HttpApiBuilder";
|
||||
import { HttpRouter, HttpServer } from "effect/http";
|
||||
import { Rpc, RpcGroup, RpcServer, RpcSerialization } from "effect/rpc";
|
||||
import * as SqlitePersistence from "../src/persistence/Layers/Sqlite.ts";
|
||||
import * as OrchestrationEventStore from "../src/persistence/Layers/OrchestrationEventStore.ts";
|
||||
import * as SqlitePersistence from "../src/persistence/Sqlite.ts";
|
||||
import * as OrchestrationEventStore from "../src/persistence/OrchestrationEventStore.ts";
|
||||
import * as EventStore from "../src/orchestration-v2/EventStore.ts";
|
||||
import * as EventSink from "../src/orchestration-v2/EventSink.ts";
|
||||
import * as ProjectionStore from "../src/orchestration-v2/ProjectionStore.ts";
|
||||
|
||||
@@ -476,7 +476,7 @@ export const runMigrateDevDb = Effect.fn("runMigrateDevDb")(function* (
|
||||
yield* Console.log("Running migrations on the snapshot...");
|
||||
const executed = yield* Effect.gen(function* () {
|
||||
const sql = yield* SqlClient.SqlClient;
|
||||
// Mirror server boot (persistence/Layers/Sqlite.ts).
|
||||
// Mirror server boot (persistence/Sqlite.ts).
|
||||
yield* sql.unsafe("PRAGMA foreign_keys = ON").unprepared;
|
||||
return yield* runMigrations();
|
||||
}).pipe(
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as NodeOS from "node:os";
|
||||
|
||||
import { CODEX_THREAD_CONFIG } from "../src/orchestration-v2/Adapters/CodexAdapterV2.ts";
|
||||
import { revertCodexThread } from "../src/provider/CodexThreadRevert.ts";
|
||||
import { buildCodexInitializeParams } from "../src/provider/Layers/CodexProvider.ts";
|
||||
import { buildCodexInitializeParams } from "../src/provider/CodexProvider.ts";
|
||||
import * as NodeRuntime from "@effect/platform-node/NodeRuntime";
|
||||
import * as NodeServices from "@effect/platform-node/NodeServices";
|
||||
import { HostProcessEnvironment } from "@t3tools/shared/hostProcess";
|
||||
|
||||
@@ -10,7 +10,7 @@ import * as SqlClient from "effect/sql/SqlClient";
|
||||
import * as ServerConfig from "../config.ts";
|
||||
import * as ServerEnvironment from "../environment/ServerEnvironment.ts";
|
||||
import * as PersistenceErrors from "../persistence/Errors.ts";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as PairingGrantStore from "./PairingGrantStore.ts";
|
||||
import * as EnvironmentAuth from "./EnvironmentAuth.ts";
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ import * as ServerSecretStore from "./ServerSecretStore.ts";
|
||||
import * as SessionStore from "./SessionStore.ts";
|
||||
import { REUSABLE_DEV_SESSION_EXPIRES_AT, resolveReusableDevAuth } from "./ReusableDevAuth.ts";
|
||||
import { verifyRequestDpopProof } from "./dpop.ts";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
|
||||
const DEFAULT_SESSION_SUBJECT = "cli-issued-session";
|
||||
export const INTERNAL_ADMINISTRATIVE_BOOTSTRAP_SUBJECT = "administrative-bootstrap";
|
||||
|
||||
@@ -5,7 +5,7 @@ import * as Layer from "effect/Layer";
|
||||
|
||||
import * as ServerConfig from "../config.ts";
|
||||
import * as ServerEnvironment from "../environment/ServerEnvironment.ts";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as EnvironmentAuth from "./EnvironmentAuth.ts";
|
||||
import * as ServerSecretStore from "./ServerSecretStore.ts";
|
||||
import * as SessionStore from "./SessionStore.ts";
|
||||
|
||||
@@ -10,7 +10,7 @@ import * as TestClock from "effect/testing/TestClock";
|
||||
import * as ServerConfig from "../config.ts";
|
||||
import * as AuthPairingLinks from "../persistence/AuthPairingLinks.ts";
|
||||
import { PersistenceSqlError } from "../persistence/Errors.ts";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as PairingGrantStore from "./PairingGrantStore.ts";
|
||||
|
||||
const layerServerConfig = (
|
||||
|
||||
@@ -16,7 +16,7 @@ import * as ServerConfig from "../config.ts";
|
||||
import * as ServerEnvironment from "../environment/ServerEnvironment.ts";
|
||||
import { PersistenceSqlError } from "../persistence/Errors.ts";
|
||||
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as AuthSessions from "../persistence/AuthSessions.ts";
|
||||
import * as SessionStore from "./SessionStore.ts";
|
||||
import * as ServerSecretStore from "./ServerSecretStore.ts";
|
||||
|
||||
@@ -15,7 +15,7 @@ import * as HttpRouter from "effect/http/HttpRouter";
|
||||
|
||||
import * as ServerConfig from "../config.ts";
|
||||
import * as ServerEnvironment from "../environment/ServerEnvironment.ts";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as EnvironmentAuth from "./EnvironmentAuth.ts";
|
||||
import * as ServerSecretStore from "./ServerSecretStore.ts";
|
||||
import * as AuthHttp from "./http.ts";
|
||||
|
||||
@@ -31,7 +31,7 @@ import * as EventSink from "../orchestration-v2/EventSink.ts";
|
||||
import * as EventStore from "../orchestration-v2/EventStore.ts";
|
||||
import * as ProjectionStore from "../orchestration-v2/ProjectionStore.ts";
|
||||
import * as RuntimeLayer from "../orchestration-v2/runtimeLayer.ts";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as ProjectEnrichmentService from "../project/ProjectEnrichmentService.ts";
|
||||
import * as ProjectFaviconResolver from "../project/ProjectFaviconResolver.ts";
|
||||
import * as ProjectService from "../project/ProjectService.ts";
|
||||
|
||||
@@ -24,7 +24,7 @@ import * as HttpApiClient from "effect/http-api/HttpApiClient";
|
||||
import * as EnvironmentAuth from "../auth/EnvironmentAuth.ts";
|
||||
|
||||
import * as ServerConfig from "../config.ts";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as RuntimeLayer from "../orchestration-v2/runtimeLayer.ts";
|
||||
import * as ProjectEnrichmentService from "../project/ProjectEnrichmentService.ts";
|
||||
import * as ProjectFaviconResolver from "../project/ProjectFaviconResolver.ts";
|
||||
|
||||
@@ -53,9 +53,9 @@ import * as SourceControlProviderRegistry from "../sourceControl/SourceControlPr
|
||||
import * as ServerConfig from "../config.ts";
|
||||
import * as ProjectionStore from "../orchestration-v2/ProjectionStore.ts";
|
||||
import * as ProjectStore from "../orchestration-v2/ProjectStore.ts";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as ProjectSetupScriptRunner from "../project/ProjectSetupScriptRunner.ts";
|
||||
import * as ProviderRegistry from "../provider/Services/ProviderRegistry.ts";
|
||||
import * as ProviderRegistry from "../provider/ProviderRegistry.ts";
|
||||
import * as ServerSettings from "../serverSettings.ts";
|
||||
import * as GitManager from "./GitManager.ts";
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ import {
|
||||
import * as ProjectionStore from "../orchestration-v2/ProjectionStore.ts";
|
||||
import * as ProjectStore from "../orchestration-v2/ProjectStore.ts";
|
||||
import * as ProjectSetupScriptRunner from "../project/ProjectSetupScriptRunner.ts";
|
||||
import * as ProviderRegistry from "../provider/Services/ProviderRegistry.ts";
|
||||
import * as ProviderRegistry from "../provider/ProviderRegistry.ts";
|
||||
import { extractBranchNameFromRemoteRef } from "./remoteRefs.ts";
|
||||
import { detachStackFrame } from "./detachStackFrame.ts";
|
||||
import * as ServerSettings from "../serverSettings.ts";
|
||||
|
||||
@@ -17,7 +17,7 @@ import * as NodeCrypto from "@effect/platform-node/NodeCrypto";
|
||||
import { expect, it } from "vite-plus/test";
|
||||
|
||||
import * as ProviderAdapterRegistry from "../orchestration-v2/ProviderAdapterRegistry.ts";
|
||||
import * as ProviderRegistry from "../provider/Services/ProviderRegistry.ts";
|
||||
import * as ProviderRegistry from "../provider/ProviderRegistry.ts";
|
||||
import * as ProjectService from "../project/ProjectService.ts";
|
||||
import * as ScheduledTaskService from "../scheduledTasks/ScheduledTaskService.ts";
|
||||
import * as SecretRequests from "../secrets/SecretRequests.ts";
|
||||
|
||||
@@ -20,7 +20,7 @@ import { OrchestratorProjectionError } from "../orchestration-v2/Orchestrator.ts
|
||||
import type { ProviderAdapterV2Shape } from "../orchestration-v2/ProviderAdapter.ts";
|
||||
import * as ProviderAdapterRegistry from "../orchestration-v2/ProviderAdapterRegistry.ts";
|
||||
import * as ThreadManagementService from "../orchestration-v2/ThreadManagementService.ts";
|
||||
import * as ProviderRegistry from "../provider/Services/ProviderRegistry.ts";
|
||||
import * as ProviderRegistry from "../provider/ProviderRegistry.ts";
|
||||
import { buildUnavailableProviderSnapshot } from "../provider/unavailableProviderSnapshot.ts";
|
||||
import * as ProjectService from "../project/ProjectService.ts";
|
||||
import * as ScheduledTaskService from "../scheduledTasks/ScheduledTaskService.ts";
|
||||
|
||||
@@ -76,7 +76,7 @@ import {
|
||||
} from "../orchestration-v2/SubagentProjection.ts";
|
||||
import * as ThreadManagementService from "../orchestration-v2/ThreadManagementService.ts";
|
||||
import * as ProjectService from "../project/ProjectService.ts";
|
||||
import * as ProviderRegistry from "../provider/Services/ProviderRegistry.ts";
|
||||
import * as ProviderRegistry from "../provider/ProviderRegistry.ts";
|
||||
import * as ScheduledTaskService from "../scheduledTasks/ScheduledTaskService.ts";
|
||||
import {
|
||||
type McpInvocationScope,
|
||||
|
||||
@@ -22,7 +22,7 @@ import { OrchestratorProjectionError } from "../../orchestration-v2/Orchestrator
|
||||
import * as ProviderAdapterRegistry from "../../orchestration-v2/ProviderAdapterRegistry.ts";
|
||||
import * as ThreadManagement from "../../orchestration-v2/ThreadManagementService.ts";
|
||||
import * as ProjectService from "../../project/ProjectService.ts";
|
||||
import * as ProviderRegistry from "../../provider/Services/ProviderRegistry.ts";
|
||||
import * as ProviderRegistry from "../../provider/ProviderRegistry.ts";
|
||||
import * as SecretRequests from "../../secrets/SecretRequests.ts";
|
||||
import * as ScheduledTaskService from "../../scheduledTasks/ScheduledTaskService.ts";
|
||||
import * as McpHttpServer from "../McpHttpServer.ts";
|
||||
|
||||
@@ -17,7 +17,7 @@ import * as ProviderAdapterRegistry from "../../../orchestration-v2/ProviderAdap
|
||||
import * as ThreadManagementService from "../../../orchestration-v2/ThreadManagementService.ts";
|
||||
import * as ProjectService from "../../../project/ProjectService.ts";
|
||||
import * as ProjectSetupScriptRunner from "../../../project/ProjectSetupScriptRunner.ts";
|
||||
import * as ProviderRegistry from "../../../provider/Services/ProviderRegistry.ts";
|
||||
import * as ProviderRegistry from "../../../provider/ProviderRegistry.ts";
|
||||
import * as ScheduledTaskService from "../../../scheduledTasks/ScheduledTaskService.ts";
|
||||
import * as SecretRequests from "../../../secrets/SecretRequests.ts";
|
||||
import * as ServerSettings from "../../../serverSettings.ts";
|
||||
|
||||
+4
-4
@@ -10,10 +10,10 @@ import * as OtlpExporter from "effect/observability/OtlpExporter";
|
||||
import * as OtlpMetrics from "effect/observability/OtlpMetrics";
|
||||
import * as OtlpTracer from "effect/observability/OtlpTracer";
|
||||
|
||||
import * as ServerConfig from "../../config.ts";
|
||||
import * as ResourceAttribution from "../../resourceTelemetry/ResourceAttribution.ts";
|
||||
import * as ServerLogger from "../../serverLogger.ts";
|
||||
import * as BrowserTraceCollector from "../BrowserTraceCollector.ts";
|
||||
import * as ServerConfig from "../config.ts";
|
||||
import * as ResourceAttribution from "../resourceTelemetry/ResourceAttribution.ts";
|
||||
import * as ServerLogger from "../serverLogger.ts";
|
||||
import * as BrowserTraceCollector from "./BrowserTraceCollector.ts";
|
||||
|
||||
export const layer = Layer.unwrap(
|
||||
Effect.gen(function* () {
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
import * as Console from "effect/Console";
|
||||
import * as Effect from "effect/Effect";
|
||||
import * as Layer from "effect/Layer";
|
||||
import * as ResetCreditCoordinator from "../provider/Layers/resetCreditCoordinator.ts";
|
||||
import * as ResetCreditCoordinator from "../provider/resetCreditCoordinator.ts";
|
||||
import { FetchHttpClient } from "effect/http";
|
||||
import { describe } from "vite-plus/test";
|
||||
|
||||
@@ -23,13 +23,13 @@ import * as CheckpointStore from "../checkpointing/CheckpointStore.ts";
|
||||
import * as BackgroundPolicy from "../background/BackgroundPolicy.ts";
|
||||
import * as HostPowerMonitor from "../background/HostPowerMonitor.ts";
|
||||
import * as ServerConfig from "../config.ts";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as AntigravityInstallation from "../provider/AntigravityInstallation.ts";
|
||||
import * as CodexInstallation from "../provider/CodexInstallation.ts";
|
||||
import * as ServerEnvironment from "../environment/ServerEnvironment.ts";
|
||||
import * as ModelManifest from "../provider/ModelManifest.ts";
|
||||
import * as ProviderInstanceRegistryHydration from "../provider/Layers/ProviderInstanceRegistryHydration.ts";
|
||||
import * as ProviderEventLoggers from "../provider/Layers/ProviderEventLoggers.ts";
|
||||
import * as ProviderInstanceRegistryHydration from "../provider/ProviderInstanceRegistryHydration.ts";
|
||||
import * as ProviderEventLoggers from "../provider/ProviderEventLoggers.ts";
|
||||
import * as OpenCodeRuntime from "../provider/opencodeRuntime.ts";
|
||||
import * as OpenCodeServerLedger from "../provider/OpenCodeServerLedger.ts";
|
||||
import * as ServerSettings from "../serverSettings.ts";
|
||||
|
||||
@@ -31,7 +31,7 @@ import * as AcpRegistrySupport from "../../provider/acp/AcpRegistrySupport.ts";
|
||||
import * as AcpRegistryRuntimeCoordinator from "../../provider/acp/AcpRegistryRuntimeCoordinator.ts";
|
||||
import * as AcpSessionRuntime from "../../provider/acp/AcpSessionRuntime.ts";
|
||||
import { makeAcpNativeLoggerFactory } from "../../provider/acp/AcpNativeLogging.ts";
|
||||
import * as ProviderEventLoggers from "../../provider/Layers/ProviderEventLoggers.ts";
|
||||
import * as ProviderEventLoggers from "../../provider/ProviderEventLoggers.ts";
|
||||
import { mergeProviderInstanceEnvironment } from "../../provider/ProviderInstanceEnvironment.ts";
|
||||
import * as IdAllocator from "../IdAllocator.ts";
|
||||
import { makeProviderFailure } from "../ProviderFailure.ts";
|
||||
|
||||
@@ -59,7 +59,7 @@ import { WorktreeToolkit } from "../../mcp/toolkits/worktree/tools.ts";
|
||||
import { ThreadToolkit } from "../../mcp/toolkits/thread/tools.ts";
|
||||
import { OrchestratorToolkit } from "../../mcp/toolkits/orchestrator/tools.ts";
|
||||
import { ClaudeExecutableFileCheck } from "../../provider/Drivers/ClaudeExecutable.ts";
|
||||
import type { EventNdjsonLogger } from "../../provider/Layers/EventNdjsonLogger.ts";
|
||||
import type { EventNdjsonLogger } from "../../provider/EventNdjsonLogger.ts";
|
||||
import {
|
||||
ProviderAdapterV2RuntimePolicy,
|
||||
type ProviderAdapterV2Event,
|
||||
|
||||
@@ -106,13 +106,13 @@ import {
|
||||
boundProviderEventForLogging,
|
||||
type EventNdjsonLogger,
|
||||
shouldPersistProviderEvent,
|
||||
} from "../../provider/Layers/EventNdjsonLogger.ts";
|
||||
import * as ProviderEventLoggers from "../../provider/Layers/ProviderEventLoggers.ts";
|
||||
} from "../../provider/EventNdjsonLogger.ts";
|
||||
import * as ProviderEventLoggers from "../../provider/ProviderEventLoggers.ts";
|
||||
import {
|
||||
claudeRateLimitEventToUpdate,
|
||||
type ClaudeScopedLimitNames,
|
||||
} from "../../provider/Layers/claudeUsageLimits.ts";
|
||||
import type { ServerProviderShape } from "../../provider/Services/ServerProvider.ts";
|
||||
} from "../../provider/claudeUsageLimits.ts";
|
||||
import type { ServerProviderShape } from "../../provider/ServerProvider.ts";
|
||||
import { mergeProviderInstanceEnvironment } from "../../provider/ProviderInstanceEnvironment.ts";
|
||||
import { T3_CODE_ORCHESTRATION_INSTRUCTIONS } from "../../provider/T3OrchestrationInstructions.ts";
|
||||
import { buildRuntimeInstructions } from "../../provider/RuntimeInstructions.ts";
|
||||
|
||||
@@ -51,8 +51,8 @@ import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
||||
import packageJson from "../../../package.json" with { type: "json" };
|
||||
import * as ServerConfig from "../../config.ts";
|
||||
import * as McpProviderSession from "../../mcp/McpProviderSession.ts";
|
||||
import type { EventNdjsonLogger } from "../../provider/Layers/EventNdjsonLogger.ts";
|
||||
import * as ProviderEventLoggers from "../../provider/Layers/ProviderEventLoggers.ts";
|
||||
import type { EventNdjsonLogger } from "../../provider/EventNdjsonLogger.ts";
|
||||
import * as ProviderEventLoggers from "../../provider/ProviderEventLoggers.ts";
|
||||
import * as IdAllocator from "../IdAllocator.ts";
|
||||
import * as EffectWorker from "../EffectWorker.ts";
|
||||
import * as Orchestrator from "../Orchestrator.ts";
|
||||
|
||||
@@ -12,15 +12,15 @@ import {
|
||||
completeCodexTurnTokenUsage,
|
||||
type CodexTurnTokenUsageState,
|
||||
} from "../../provider/CodexTurnTokenUsage.ts";
|
||||
import type { ServerProviderShape } from "../../provider/Services/ServerProvider.ts";
|
||||
import type { ServerProviderShape } from "../../provider/ServerProvider.ts";
|
||||
import type { CodexEffectiveRuntime } from "../../provider/CodexManagedRuntime.ts";
|
||||
import { buildCodexInitializeParams } from "../../provider/Layers/CodexProvider.ts";
|
||||
import { buildCodexInitializeParams } from "../../provider/CodexProvider.ts";
|
||||
import {
|
||||
codexRateLimitsToUpdate,
|
||||
mergeCodexRateLimits,
|
||||
codexUsageLimitResetAt,
|
||||
type CodexRateLimitSnapshot,
|
||||
} from "../../provider/Layers/codexUsageLimits.ts";
|
||||
} from "../../provider/codexUsageLimits.ts";
|
||||
import {
|
||||
CodexSettings,
|
||||
defaultInstanceIdForDriver,
|
||||
@@ -101,12 +101,9 @@ import {
|
||||
boundProviderEventForLogging,
|
||||
type EventNdjsonLogger,
|
||||
shouldPersistProviderEvent,
|
||||
} from "../../provider/Layers/EventNdjsonLogger.ts";
|
||||
import { ProviderEventLoggers } from "../../provider/Layers/ProviderEventLoggers.ts";
|
||||
import {
|
||||
codexAppServerArgs,
|
||||
resolveCodexLaunchArgs,
|
||||
} from "../../provider/Layers/codexLaunchArgs.ts";
|
||||
} from "../../provider/EventNdjsonLogger.ts";
|
||||
import { ProviderEventLoggers } from "../../provider/ProviderEventLoggers.ts";
|
||||
import { codexAppServerArgs, resolveCodexLaunchArgs } from "../../provider/codexLaunchArgs.ts";
|
||||
import { mergeProviderInstanceEnvironment } from "../../provider/ProviderInstanceEnvironment.ts";
|
||||
import * as McpProviderSession from "../../mcp/McpProviderSession.ts";
|
||||
import {
|
||||
|
||||
@@ -5,7 +5,7 @@ import * as Effect from "effect/Effect";
|
||||
import * as Layer from "effect/Layer";
|
||||
import { vi } from "vite-plus/test";
|
||||
|
||||
import * as ProviderEventLoggers from "../../provider/Layers/ProviderEventLoggers.ts";
|
||||
import * as ProviderEventLoggers from "../../provider/ProviderEventLoggers.ts";
|
||||
import * as CursorAgentSdk from "./CursorAgentSdk.ts";
|
||||
|
||||
const cursorSdkMock = vi.hoisted(() => {
|
||||
|
||||
@@ -17,8 +17,8 @@ import * as Layer from "effect/Layer";
|
||||
import * as Schema from "effect/Schema";
|
||||
|
||||
import { Agent, createAgentPlatform } from "../../provider/cursorSdk.ts";
|
||||
import type { EventNdjsonLogger } from "../../provider/Layers/EventNdjsonLogger.ts";
|
||||
import * as ProviderEventLoggers from "../../provider/Layers/ProviderEventLoggers.ts";
|
||||
import type { EventNdjsonLogger } from "../../provider/EventNdjsonLogger.ts";
|
||||
import * as ProviderEventLoggers from "../../provider/ProviderEventLoggers.ts";
|
||||
|
||||
export const CURSOR_AGENT_SDK_PROTOCOL = "cursor-agent-sdk.local" as const;
|
||||
export const CURSOR_PROVIDER = ProviderDriverKind.make("cursor");
|
||||
|
||||
@@ -24,9 +24,9 @@ import type * as EffectAcpSchema from "effect-acp/compat";
|
||||
|
||||
import * as ServerConfig from "../../config.ts";
|
||||
import * as ProjectStore from "../ProjectStore.ts";
|
||||
import { buildInitialGrokProviderSnapshot } from "../../provider/Layers/GrokProvider.ts";
|
||||
import { buildInitialGrokProviderSnapshot } from "../../provider/GrokProvider.ts";
|
||||
import type { ProviderInstance } from "../../provider/ProviderDriver.ts";
|
||||
import * as ProviderInstanceRegistry from "../../provider/Services/ProviderInstanceRegistry.ts";
|
||||
import * as ProviderInstanceRegistry from "../../provider/ProviderInstanceRegistry.ts";
|
||||
import * as IdAllocator from "../IdAllocator.ts";
|
||||
import { ProviderAdapterV2RuntimePolicy } from "../ProviderAdapter.ts";
|
||||
import * as RuntimePolicy from "../RuntimePolicy.ts";
|
||||
|
||||
@@ -56,7 +56,7 @@ import {
|
||||
import { mergeProviderInstanceEnvironment } from "../../provider/ProviderInstanceEnvironment.ts";
|
||||
import { acpPermissionDisposition } from "../../provider/acp/AcpClientPolicy.ts";
|
||||
import * as AcpSessionRuntime from "../../provider/acp/AcpSessionRuntime.ts";
|
||||
import * as ProviderEventLoggers from "../../provider/Layers/ProviderEventLoggers.ts";
|
||||
import * as ProviderEventLoggers from "../../provider/ProviderEventLoggers.ts";
|
||||
import * as IdAllocator from "../IdAllocator.ts";
|
||||
import * as ProviderContinuationRequests from "../ProviderContinuationRequests.ts";
|
||||
import * as ProviderAdapter from "../ProviderAdapter.ts";
|
||||
|
||||
@@ -32,7 +32,7 @@ import * as Stream from "effect/Stream";
|
||||
import * as TestClock from "effect/testing/TestClock";
|
||||
|
||||
import * as ServerConfig from "../../config.ts";
|
||||
import type { EventNdjsonLogger } from "../../provider/Layers/EventNdjsonLogger.ts";
|
||||
import type { EventNdjsonLogger } from "../../provider/EventNdjsonLogger.ts";
|
||||
import type { OpenCodeRuntimeShape } from "../../provider/opencodeRuntime.ts";
|
||||
import * as IdAllocator from "../IdAllocator.ts";
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import * as Schema from "effect/Schema";
|
||||
|
||||
import * as ServerConfig from "../../config.ts";
|
||||
import * as OpenCodeRuntime from "../../provider/opencodeRuntime.ts";
|
||||
import * as ProviderEventLoggers from "../../provider/Layers/ProviderEventLoggers.ts";
|
||||
import * as ProviderEventLoggers from "../../provider/ProviderEventLoggers.ts";
|
||||
import * as IdAllocator from "../IdAllocator.ts";
|
||||
import { ProviderAdapterDriverCreateError } from "../ProviderAdapterDriver.ts";
|
||||
import * as ProviderAdapterRegistry from "../ProviderAdapterRegistry.ts";
|
||||
|
||||
@@ -58,8 +58,8 @@ import { resolveAttachmentPath } from "../../attachmentStore.ts";
|
||||
import * as ServerConfig from "../../config.ts";
|
||||
import { mcpToolPresentation } from "../../provider/McpToolPresentation.ts";
|
||||
import * as McpProviderSession from "../../mcp/McpProviderSession.ts";
|
||||
import type { EventNdjsonLogger } from "../../provider/Layers/EventNdjsonLogger.ts";
|
||||
import * as ProviderEventLoggers from "../../provider/Layers/ProviderEventLoggers.ts";
|
||||
import type { EventNdjsonLogger } from "../../provider/EventNdjsonLogger.ts";
|
||||
import * as ProviderEventLoggers from "../../provider/ProviderEventLoggers.ts";
|
||||
import {
|
||||
structuralProtocolMethod,
|
||||
summarizeNativeProtocolPayload,
|
||||
|
||||
@@ -21,7 +21,7 @@ import * as Layer from "effect/Layer";
|
||||
import * as Ref from "effect/Ref";
|
||||
import * as SqlClient from "effect/sql/SqlClient";
|
||||
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as CheckpointStore from "../checkpointing/CheckpointStore.ts";
|
||||
import { VcsProcessTimeoutError } from "@t3tools/contracts";
|
||||
import * as CheckpointService from "./CheckpointService.ts";
|
||||
|
||||
@@ -19,7 +19,7 @@ import * as IdAllocator from "./IdAllocator.ts";
|
||||
import { checkpointRefForScopeOrdinal } from "./CheckpointService.ts";
|
||||
import * as ProjectionStore from "./ProjectionStore.ts";
|
||||
import * as ThreadManagement from "./ThreadManagementService.ts";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
const layerProjection = Layer.mergeAll(
|
||||
ProjectionStore.layer.pipe(Layer.provideMerge(SqlitePersistence.layerMemory)),
|
||||
SqlitePersistence.layerMemory,
|
||||
|
||||
@@ -26,7 +26,7 @@ import * as Stream from "effect/Stream";
|
||||
import * as ScheduledTaskService from "../scheduledTasks/ScheduledTaskService.ts";
|
||||
import * as SecretRequests from "../secrets/SecretRequests.ts";
|
||||
import * as Scheduler from "../scheduling/Scheduler.ts";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as ClaudeAdapterV2 from "./Adapters/ClaudeAdapterV2.ts";
|
||||
import * as EffectWorker from "./EffectWorker.ts";
|
||||
import * as EventSink from "./EventSink.ts";
|
||||
|
||||
@@ -5,9 +5,7 @@ import * as Effect from "effect/Effect";
|
||||
import * as Layer from "effect/Layer";
|
||||
import * as Option from "effect/Option";
|
||||
import * as Schema from "effect/Schema";
|
||||
|
||||
import * as OrchestrationCommandReceiptsLayer from "../persistence/Layers/OrchestrationCommandReceipts.ts";
|
||||
import * as OrchestrationCommandReceipts from "../persistence/Services/OrchestrationCommandReceipts.ts";
|
||||
import * as OrchestrationCommandReceipts from "../persistence/OrchestrationCommandReceipts.ts";
|
||||
|
||||
/**
|
||||
* ERRORS
|
||||
@@ -209,6 +207,6 @@ const layerBase: Layer.Layer<
|
||||
}),
|
||||
);
|
||||
|
||||
export const layer = layerBase.pipe(Layer.provide(OrchestrationCommandReceiptsLayer.layer));
|
||||
export const layer = layerBase.pipe(Layer.provide(OrchestrationCommandReceipts.layer));
|
||||
|
||||
export const layerFromApplicationReceipts = layerBase;
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
import * as Console from "effect/Console";
|
||||
import * as Effect from "effect/Effect";
|
||||
import * as Layer from "effect/Layer";
|
||||
import * as ResetCreditCoordinator from "../provider/Layers/resetCreditCoordinator.ts";
|
||||
import * as ResetCreditCoordinator from "../provider/resetCreditCoordinator.ts";
|
||||
import { FetchHttpClient } from "effect/http";
|
||||
import { describe } from "vite-plus/test";
|
||||
|
||||
@@ -21,13 +21,13 @@ import * as CheckpointStore from "../checkpointing/CheckpointStore.ts";
|
||||
import * as BackgroundPolicy from "../background/BackgroundPolicy.ts";
|
||||
import * as HostPowerMonitor from "../background/HostPowerMonitor.ts";
|
||||
import * as ServerConfig from "../config.ts";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as AntigravityInstallation from "../provider/AntigravityInstallation.ts";
|
||||
import * as CodexInstallation from "../provider/CodexInstallation.ts";
|
||||
import * as ServerEnvironment from "../environment/ServerEnvironment.ts";
|
||||
import * as ModelManifest from "../provider/ModelManifest.ts";
|
||||
import * as ProviderInstanceRegistryHydration from "../provider/Layers/ProviderInstanceRegistryHydration.ts";
|
||||
import * as ProviderEventLoggers from "../provider/Layers/ProviderEventLoggers.ts";
|
||||
import * as ProviderInstanceRegistryHydration from "../provider/ProviderInstanceRegistryHydration.ts";
|
||||
import * as ProviderEventLoggers from "../provider/ProviderEventLoggers.ts";
|
||||
import * as OpenCodeRuntime from "../provider/opencodeRuntime.ts";
|
||||
import * as OpenCodeServerLedger from "../provider/OpenCodeServerLedger.ts";
|
||||
import * as ServerSettings from "../serverSettings.ts";
|
||||
|
||||
@@ -23,11 +23,11 @@ import * as Stream from "effect/Stream";
|
||||
import * as CheckpointStore from "../checkpointing/CheckpointStore.ts";
|
||||
import * as ServerConfig from "../config.ts";
|
||||
import * as McpSessionRegistryTestkit from "../mcp/McpSessionRegistry.testkit.ts";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as ProjectEnrichmentService from "../project/ProjectEnrichmentService.ts";
|
||||
import * as ProjectService from "../project/ProjectService.ts";
|
||||
import type { ProviderInstance } from "../provider/ProviderDriver.ts";
|
||||
import * as ProviderInstanceRegistry from "../provider/Services/ProviderInstanceRegistry.ts";
|
||||
import * as ProviderInstanceRegistry from "../provider/ProviderInstanceRegistry.ts";
|
||||
import * as ServerSettings from "../serverSettings.ts";
|
||||
import * as VcsDriverRegistry from "../vcs/VcsDriverRegistry.ts";
|
||||
import * as VcsProcess from "../vcs/VcsProcess.ts";
|
||||
|
||||
@@ -23,7 +23,7 @@ import * as Stream from "effect/Stream";
|
||||
import * as SqlClient from "effect/sql/SqlClient";
|
||||
|
||||
import { replayAndBufferProjectedLiveEvents } from "./LiveStreamBudget.ts";
|
||||
import type { UnsequencedProjectEvent } from "../persistence/Services/OrchestrationEventStore.ts";
|
||||
import type { UnsequencedProjectEvent } from "../persistence/OrchestrationEventStore.ts";
|
||||
import { projectDomainEventForWire } from "./WireProjection.ts";
|
||||
|
||||
import * as CommandReceiptStore from "./CommandReceiptStore.ts";
|
||||
|
||||
@@ -12,9 +12,7 @@ import * as Layer from "effect/Layer";
|
||||
import * as Schema from "effect/Schema";
|
||||
import * as Stream from "effect/Stream";
|
||||
import type * as SqlClient from "effect/sql/SqlClient";
|
||||
|
||||
import * as OrchestrationEventStoreLayer from "../persistence/Layers/OrchestrationEventStore.ts";
|
||||
import * as OrchestrationEventStore from "../persistence/Services/OrchestrationEventStore.ts";
|
||||
import * as OrchestrationEventStore from "../persistence/OrchestrationEventStore.ts";
|
||||
|
||||
export class EventStoreAppendEventsError extends Schema.TaggedError<EventStoreAppendEventsError>()(
|
||||
"EventStoreAppendEventsError",
|
||||
@@ -150,7 +148,7 @@ const layerBase: Layer.Layer<EventStoreV2, never, OrchestrationEventStore.Orches
|
||||
);
|
||||
|
||||
export const layer: Layer.Layer<EventStoreV2, never, SqlClient.SqlClient> = layerBase.pipe(
|
||||
Layer.provide(OrchestrationEventStoreLayer.layer),
|
||||
Layer.provide(OrchestrationEventStore.layer),
|
||||
);
|
||||
|
||||
export const layerFromOrchestrationEventStore = layerBase;
|
||||
@@ -43,7 +43,7 @@ import * as SqlClient from "effect/sql/SqlClient";
|
||||
import * as Statement from "effect/sql/Statement";
|
||||
|
||||
import { LIVE_STREAM_MAX_ITEMS, LiveStreamBufferError } from "./LiveStreamBudget.ts";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import { CodexProviderCapabilitiesV2 } from "./Adapters/CodexAdapterV2.ts";
|
||||
import * as CommandReceiptStore from "./CommandReceiptStore.ts";
|
||||
import * as EffectOutbox from "./EffectOutbox.ts";
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
import * as Console from "effect/Console";
|
||||
import * as Effect from "effect/Effect";
|
||||
import * as Layer from "effect/Layer";
|
||||
import * as ResetCreditCoordinator from "../provider/Layers/resetCreditCoordinator.ts";
|
||||
import * as ResetCreditCoordinator from "../provider/resetCreditCoordinator.ts";
|
||||
import { FetchHttpClient } from "effect/http";
|
||||
import { describe } from "vite-plus/test";
|
||||
|
||||
@@ -21,13 +21,13 @@ import * as CheckpointStore from "../checkpointing/CheckpointStore.ts";
|
||||
import * as BackgroundPolicy from "../background/BackgroundPolicy.ts";
|
||||
import * as HostPowerMonitor from "../background/HostPowerMonitor.ts";
|
||||
import * as ServerConfig from "../config.ts";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as AntigravityInstallation from "../provider/AntigravityInstallation.ts";
|
||||
import * as CodexInstallation from "../provider/CodexInstallation.ts";
|
||||
import * as ServerEnvironment from "../environment/ServerEnvironment.ts";
|
||||
import * as ModelManifest from "../provider/ModelManifest.ts";
|
||||
import * as ProviderInstanceRegistryHydration from "../provider/Layers/ProviderInstanceRegistryHydration.ts";
|
||||
import * as ProviderEventLoggers from "../provider/Layers/ProviderEventLoggers.ts";
|
||||
import * as ProviderInstanceRegistryHydration from "../provider/ProviderInstanceRegistryHydration.ts";
|
||||
import * as ProviderEventLoggers from "../provider/ProviderEventLoggers.ts";
|
||||
import * as OpenCodeRuntime from "../provider/opencodeRuntime.ts";
|
||||
import * as OpenCodeServerLedger from "../provider/OpenCodeServerLedger.ts";
|
||||
import * as ServerSettings from "../serverSettings.ts";
|
||||
|
||||
@@ -43,18 +43,18 @@ import { FetchHttpClient, HttpClient } from "effect/http";
|
||||
import { ChildProcess, ChildProcessSpawner } from "effect/process";
|
||||
import { describe } from "vite-plus/test";
|
||||
|
||||
import * as ResetCreditCoordinator from "../provider/Layers/resetCreditCoordinator.ts";
|
||||
import * as ResetCreditCoordinator from "../provider/resetCreditCoordinator.ts";
|
||||
import * as CheckpointStore from "../checkpointing/CheckpointStore.ts";
|
||||
import * as BackgroundPolicy from "../background/BackgroundPolicy.ts";
|
||||
import * as HostPowerMonitor from "../background/HostPowerMonitor.ts";
|
||||
import * as ServerConfig from "../config.ts";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as AntigravityInstallation from "../provider/AntigravityInstallation.ts";
|
||||
import * as CodexInstallation from "../provider/CodexInstallation.ts";
|
||||
import * as ServerEnvironment from "../environment/ServerEnvironment.ts";
|
||||
import * as ModelManifest from "../provider/ModelManifest.ts";
|
||||
import * as ProviderInstanceRegistryHydration from "../provider/Layers/ProviderInstanceRegistryHydration.ts";
|
||||
import * as ProviderEventLoggers from "../provider/Layers/ProviderEventLoggers.ts";
|
||||
import * as ProviderInstanceRegistryHydration from "../provider/ProviderInstanceRegistryHydration.ts";
|
||||
import * as ProviderEventLoggers from "../provider/ProviderEventLoggers.ts";
|
||||
import * as OpenCode2Client from "../provider/opencode2/OpenCode2Client.ts";
|
||||
import * as OpenCodeRuntime from "../provider/opencodeRuntime.ts";
|
||||
import * as OpenCodeServerLedger from "../provider/OpenCodeServerLedger.ts";
|
||||
@@ -63,7 +63,7 @@ import * as VcsDriverRegistry from "../vcs/VcsDriverRegistry.ts";
|
||||
import * as VcsProcess from "../vcs/VcsProcess.ts";
|
||||
import * as EffectWorker from "./EffectWorker.ts";
|
||||
import * as Orchestrator from "./Orchestrator.ts";
|
||||
import * as ProviderInstanceRegistry from "../provider/Services/ProviderInstanceRegistry.ts";
|
||||
import * as ProviderInstanceRegistry from "../provider/ProviderInstanceRegistry.ts";
|
||||
import * as ProviderTurnStartServiceTestkit from "./ProviderTurnStartService.testkit.ts";
|
||||
import * as RuntimeLayer from "./runtimeLayer.ts";
|
||||
import * as IdAllocator from "./IdAllocator.ts";
|
||||
|
||||
@@ -21,7 +21,7 @@ import * as DateTime from "effect/DateTime";
|
||||
import * as Effect from "effect/Effect";
|
||||
import * as Layer from "effect/Layer";
|
||||
import * as SqlClient from "effect/sql/SqlClient";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import { CodexProviderCapabilitiesV2 } from "./Adapters/CodexAdapterV2.ts";
|
||||
import * as Orchestrator from "./Orchestrator.ts";
|
||||
import * as ProjectionStore from "./ProjectionStore.ts";
|
||||
|
||||
@@ -13,7 +13,7 @@ import * as DateTime from "effect/DateTime";
|
||||
import * as Result from "effect/Result";
|
||||
import * as Schema from "effect/Schema";
|
||||
|
||||
import type { UnsequencedProjectEvent } from "../persistence/Services/OrchestrationEventStore.ts";
|
||||
import type { UnsequencedProjectEvent } from "../persistence/OrchestrationEventStore.ts";
|
||||
import type { ProjectRow } from "./ProjectStore.ts";
|
||||
|
||||
export interface ProjectCreateCommand {
|
||||
|
||||
@@ -15,11 +15,11 @@ import * as GitWorkflow from "../git/GitWorkflowService.ts";
|
||||
import * as NodeSqliteClient from "@t3tools/shared/nodeSqliteClient";
|
||||
|
||||
import * as McpSessionRegistryTestkit from "../mcp/McpSessionRegistry.testkit.ts";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import { runMigrations } from "../persistence/Migrations.ts";
|
||||
import * as ProjectEnrichmentService from "../project/ProjectEnrichmentService.ts";
|
||||
import * as ProjectService from "../project/ProjectService.ts";
|
||||
import * as ProviderInstanceRegistry from "../provider/Services/ProviderInstanceRegistry.ts";
|
||||
import * as ProviderInstanceRegistry from "../provider/ProviderInstanceRegistry.ts";
|
||||
import * as ServerSettings from "../serverSettings.ts";
|
||||
import * as SourceControlProviderRegistry from "../sourceControl/SourceControlProviderRegistry.ts";
|
||||
import * as VcsDriverRegistry from "../vcs/VcsDriverRegistry.ts";
|
||||
|
||||
@@ -5,7 +5,7 @@ import * as Layer from "effect/Layer";
|
||||
import * as Option from "effect/Option";
|
||||
import * as SqlClient from "effect/sql/SqlClient";
|
||||
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as ProjectStore from "./ProjectStore.ts";
|
||||
|
||||
it.layer(ProjectStore.layer.pipe(Layer.provideMerge(SqlitePersistence.layerMemory)))(
|
||||
|
||||
@@ -20,7 +20,7 @@ import * as Effect from "effect/Effect";
|
||||
import * as Layer from "effect/Layer";
|
||||
import * as Option from "effect/Option";
|
||||
import * as SqlClient from "effect/sql/SqlClient";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as ProjectionStore from "./ProjectionStore.ts";
|
||||
import * as ProviderSessionManager from "./ProviderSessionManager.ts";
|
||||
import * as ProviderTurnControlService from "./ProviderTurnControlService.ts";
|
||||
|
||||
@@ -22,7 +22,7 @@ import * as Effect from "effect/Effect";
|
||||
import * as Layer from "effect/Layer";
|
||||
import * as SqlClient from "effect/sql/SqlClient";
|
||||
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import { CodexProviderCapabilitiesV2 } from "./Adapters/CodexAdapterV2.ts";
|
||||
import * as EffectOutbox from "./EffectOutbox.ts";
|
||||
import * as ProjectionStore from "./ProjectionStore.ts";
|
||||
|
||||
@@ -21,7 +21,7 @@ import * as Schema from "effect/Schema";
|
||||
import * as SqlClient from "effect/sql/SqlClient";
|
||||
import * as Statement from "effect/sql/Statement";
|
||||
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as ProjectionStore from "./ProjectionStore.ts";
|
||||
import { isAutoSettlementCandidate, resolveAutoSettlementAt } from "./ThreadSettlementService.ts";
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import * as Schema from "effect/Schema";
|
||||
import * as SqlClient from "effect/sql/SqlClient";
|
||||
import { projectThreadAwarenessV2 } from "@t3tools/shared/agentAwareness";
|
||||
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import { CodexProviderCapabilitiesV2 } from "./Adapters/CodexAdapterV2.ts";
|
||||
import * as ProjectionStore from "./ProjectionStore.ts";
|
||||
import {
|
||||
|
||||
@@ -19,9 +19,9 @@ import type * as Scope from "effect/Scope";
|
||||
import * as Stream from "effect/Stream";
|
||||
|
||||
import * as ProviderAuthFlow from "../provider/ProviderAuthFlow.ts";
|
||||
import type { ProviderAuthController } from "../provider/Services/ProviderAuthService.ts";
|
||||
import type { ProviderAuthController } from "../provider/ProviderAuthService.ts";
|
||||
import type { ProviderInstance } from "../provider/ProviderDriver.ts";
|
||||
import * as ProviderInstanceRegistry from "../provider/Services/ProviderInstanceRegistry.ts";
|
||||
import * as ProviderInstanceRegistry from "../provider/ProviderInstanceRegistry.ts";
|
||||
import { ProviderAdapterOpenSessionError, type ProviderAdapterV2Shape } from "./ProviderAdapter.ts";
|
||||
import {
|
||||
ProviderAdapterDriverCreateError,
|
||||
|
||||
@@ -13,7 +13,7 @@ import * as Layer from "effect/Layer";
|
||||
import * as Schema from "effect/Schema";
|
||||
import * as Scope from "effect/Scope";
|
||||
|
||||
import * as ProviderInstanceRegistry from "../provider/Services/ProviderInstanceRegistry.ts";
|
||||
import * as ProviderInstanceRegistry from "../provider/ProviderInstanceRegistry.ts";
|
||||
import {
|
||||
ProviderAdapterDriverCreateError,
|
||||
type AnyProviderAdapterDriver,
|
||||
|
||||
@@ -27,7 +27,7 @@ import * as Layer from "effect/Layer";
|
||||
import * as Stream from "effect/Stream";
|
||||
import * as TestClock from "effect/testing/TestClock";
|
||||
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as EventSink from "./EventSink.ts";
|
||||
import * as EventStore from "./EventStore.ts";
|
||||
import * as IdAllocator from "./IdAllocator.ts";
|
||||
|
||||
@@ -25,7 +25,7 @@ import * as Effect from "effect/Effect";
|
||||
import * as Layer from "effect/Layer";
|
||||
import * as SqlClient from "effect/sql/SqlClient";
|
||||
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as ServerSettings from "../serverSettings.ts";
|
||||
import { CodexProviderCapabilitiesV2 } from "./Adapters/CodexAdapterV2.ts";
|
||||
import * as EffectOutbox from "./EffectOutbox.ts";
|
||||
|
||||
@@ -36,7 +36,7 @@ import * as ServerEnvironment from "../environment/ServerEnvironment.ts";
|
||||
import * as ProjectService from "../project/ProjectService.ts";
|
||||
import * as McpProviderSession from "../mcp/McpProviderSession.ts";
|
||||
import * as McpSessionRegistry from "../mcp/McpSessionRegistry.ts";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as ServerSettings from "../serverSettings.ts";
|
||||
import { CodexProviderCapabilitiesV2 } from "./Adapters/CodexAdapterV2.ts";
|
||||
import * as EventSink from "./EventSink.ts";
|
||||
|
||||
@@ -26,7 +26,7 @@ import * as Schema from "effect/Schema";
|
||||
|
||||
import * as GitWorkflow from "../git/GitWorkflowService.ts";
|
||||
import * as ProjectService from "../project/ProjectService.ts";
|
||||
import * as ProviderAuthService from "../provider/Services/ProviderAuthService.ts";
|
||||
import * as ProviderAuthService from "../provider/ProviderAuthService.ts";
|
||||
import * as ContextHandoffService from "./ContextHandoffService.ts";
|
||||
import * as EventSink from "./EventSink.ts";
|
||||
import * as IdAllocator from "./IdAllocator.ts";
|
||||
|
||||
@@ -23,7 +23,7 @@ import * as Schema from "effect/Schema";
|
||||
|
||||
import * as GitWorkflowService from "../git/GitWorkflowService.ts";
|
||||
import * as ProjectService from "../project/ProjectService.ts";
|
||||
import * as ProviderAuthService from "../provider/Services/ProviderAuthService.ts";
|
||||
import * as ProviderAuthService from "../provider/ProviderAuthService.ts";
|
||||
import * as EventSink from "./EventSink.ts";
|
||||
import * as ContextHandoffService from "./ContextHandoffService.ts";
|
||||
import {
|
||||
|
||||
@@ -13,7 +13,7 @@ import * as DateTime from "effect/DateTime";
|
||||
import * as Effect from "effect/Effect";
|
||||
import * as Layer from "effect/Layer";
|
||||
import * as SqlClient from "effect/sql/SqlClient";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as ProjectionStore from "./ProjectionStore.ts";
|
||||
|
||||
const layerDatabase = Layer.mergeAll(
|
||||
|
||||
@@ -15,7 +15,7 @@ import * as Option from "effect/Option";
|
||||
import * as Stream from "effect/Stream";
|
||||
|
||||
import type { ProviderInstance } from "../provider/ProviderDriver.ts";
|
||||
import * as ProviderInstanceRegistry from "../provider/Services/ProviderInstanceRegistry.ts";
|
||||
import * as ProviderInstanceRegistry from "../provider/ProviderInstanceRegistry.ts";
|
||||
import * as ProjectStore from "./ProjectStore.ts";
|
||||
import * as RuntimePolicy from "./RuntimePolicy.ts";
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import * as Layer from "effect/Layer";
|
||||
import * as Option from "effect/Option";
|
||||
import * as Schema from "effect/Schema";
|
||||
|
||||
import * as ProviderInstanceRegistry from "../provider/Services/ProviderInstanceRegistry.ts";
|
||||
import * as ProviderInstanceRegistry from "../provider/ProviderInstanceRegistry.ts";
|
||||
import {
|
||||
ProviderAdapterV2RuntimePolicy,
|
||||
type ProviderAdapterV2RuntimePolicy as ProviderAdapterV2RuntimePolicyType,
|
||||
|
||||
@@ -40,7 +40,7 @@ import * as Schema from "effect/Schema";
|
||||
import * as TestClock from "effect/testing/TestClock";
|
||||
|
||||
import * as GitWorkflow from "../git/GitWorkflowService.ts";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as ProjectStore from "./ProjectStore.ts";
|
||||
import * as ProjectService from "../project/ProjectService.ts";
|
||||
import * as ProjectSetupScriptRunner from "../project/ProjectSetupScriptRunner.ts";
|
||||
|
||||
@@ -39,7 +39,7 @@ import * as GitWorkflow from "../git/GitWorkflowService.ts";
|
||||
import * as ProjectService from "../project/ProjectService.ts";
|
||||
import * as ProjectSetupScriptRunner from "../project/ProjectSetupScriptRunner.ts";
|
||||
import * as ManagedProjectFolders from "../project/ManagedProjectFolders.ts";
|
||||
import * as ProviderRegistry from "../provider/Services/ProviderRegistry.ts";
|
||||
import * as ProviderRegistry from "../provider/ProviderRegistry.ts";
|
||||
import * as ServerSettings from "../serverSettings.ts";
|
||||
import * as TextGeneration from "../textGeneration/TextGeneration.ts";
|
||||
import * as CommandReceiptStore from "./CommandReceiptStore.ts";
|
||||
|
||||
@@ -12,7 +12,7 @@ import * as Effect from "effect/Effect";
|
||||
import * as Layer from "effect/Layer";
|
||||
import * as SqlClient from "effect/sql/SqlClient";
|
||||
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as ProjectionStore from "./ProjectionStore.ts";
|
||||
import * as ProjectStore from "./ProjectStore.ts";
|
||||
import * as ThreadSearch from "./ThreadSearch.ts";
|
||||
|
||||
@@ -19,7 +19,7 @@ import * as Schema from "effect/Schema";
|
||||
import * as SqlClient from "effect/sql/SqlClient";
|
||||
import * as TestClock from "effect/testing/TestClock";
|
||||
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import { CodexProviderCapabilitiesV2 } from "./Adapters/CodexAdapterV2.ts";
|
||||
import { OrchestrationEffectRequestV2 } from "./EffectOutbox.ts";
|
||||
import * as Orchestrator from "./Orchestrator.ts";
|
||||
|
||||
@@ -16,7 +16,7 @@ import * as TestClock from "effect/testing/TestClock";
|
||||
import * as Layer from "effect/Layer";
|
||||
import * as Option from "effect/Option";
|
||||
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as ProjectStore from "./ProjectStore.ts";
|
||||
import * as ServerSettings from "../serverSettings.ts";
|
||||
import * as TextGeneration from "../textGeneration/TextGeneration.ts";
|
||||
|
||||
@@ -16,7 +16,7 @@ import * as DateTime from "effect/DateTime";
|
||||
import * as Effect from "effect/Effect";
|
||||
import * as Layer from "effect/Layer";
|
||||
import * as SqlClient from "effect/sql/SqlClient";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as ProjectionStore from "./ProjectionStore.ts";
|
||||
|
||||
const layerDatabase = Layer.mergeAll(
|
||||
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
failEnvironmentNotFound,
|
||||
requireEnvironmentScope,
|
||||
} from "../auth/http.ts";
|
||||
import * as OrchestrationEventStore from "../persistence/Services/OrchestrationEventStore.ts";
|
||||
import * as OrchestrationEventStore from "../persistence/OrchestrationEventStore.ts";
|
||||
import * as ProjectEnrichmentService from "../project/ProjectEnrichmentService.ts";
|
||||
import {
|
||||
buildBoundedThreadProjection,
|
||||
|
||||
@@ -27,7 +27,7 @@ import * as Stream from "effect/Stream";
|
||||
import * as SqlClient from "effect/sql/SqlClient";
|
||||
|
||||
import { runMigrations } from "../../persistence/Migrations.ts";
|
||||
import * as SqlitePersistence from "../../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../../persistence/Sqlite.ts";
|
||||
import Migration0042 from "../../persistence/Migrations/042_ProjectionThreadLinkedPullRequest.ts";
|
||||
import Migration0043 from "../../persistence/Migrations/043_ProjectionThreadsUnsettledAt.ts";
|
||||
import Migration0044 from "../../persistence/Migrations/044_ClearAutomaticProjectModelDefaults.ts";
|
||||
|
||||
@@ -6,7 +6,7 @@ import * as Layer from "effect/Layer";
|
||||
import * as Tracer from "effect/Tracer";
|
||||
import * as SqlClient from "effect/sql/SqlClient";
|
||||
|
||||
import * as SqlitePersistence from "../../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../../persistence/Sqlite.ts";
|
||||
import { listLinkedPullRequestThreads } from "../../pullRequest/linkedThreads.ts";
|
||||
import * as EventSink from "../EventSink.ts";
|
||||
import * as EventStore from "../EventStore.ts";
|
||||
|
||||
@@ -43,13 +43,13 @@ import * as SqlClient from "effect/sql/SqlClient";
|
||||
import * as CheckpointStore from "../checkpointing/CheckpointStore.ts";
|
||||
import * as GitWorkflow from "../git/GitWorkflowService.ts";
|
||||
import * as ServerConfig from "../config.ts";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as OrchestrationEventStore from "../persistence/Services/OrchestrationEventStore.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as OrchestrationEventStore from "../persistence/OrchestrationEventStore.ts";
|
||||
import * as ProjectEnrichmentService from "../project/ProjectEnrichmentService.ts";
|
||||
import * as ProjectService from "../project/ProjectService.ts";
|
||||
import * as ServerSettings from "../serverSettings.ts";
|
||||
import * as McpSessionRegistryTestkit from "../mcp/McpSessionRegistry.testkit.ts";
|
||||
import * as ProviderInstanceRegistry from "../provider/Services/ProviderInstanceRegistry.ts";
|
||||
import * as ProviderInstanceRegistry from "../provider/ProviderInstanceRegistry.ts";
|
||||
import type { ProviderInstance } from "../provider/ProviderDriver.ts";
|
||||
import * as VcsDriverRegistry from "../vcs/VcsDriverRegistry.ts";
|
||||
import * as VcsProcess from "../vcs/VcsProcess.ts";
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import * as UsageLimitRecoveryWorker from "./UsageLimitRecoveryWorker.ts";
|
||||
import * as Scheduler from "../scheduling/Scheduler.ts";
|
||||
import * as Layer from "effect/Layer";
|
||||
import * as OrchestrationCommandReceipts from "../persistence/Layers/OrchestrationCommandReceipts.ts";
|
||||
import * as OrchestrationEventStore from "../persistence/Layers/OrchestrationEventStore.ts";
|
||||
import * as OrchestrationCommandReceipts from "../persistence/OrchestrationCommandReceipts.ts";
|
||||
import * as OrchestrationEventStore from "../persistence/OrchestrationEventStore.ts";
|
||||
import * as ProviderSessionRuntime from "../persistence/ProviderSessionRuntime.ts";
|
||||
import * as TextGeneration from "../textGeneration/TextGeneration.ts";
|
||||
import * as ProviderAuthService from "../provider/Layers/ProviderAuthService.ts";
|
||||
import * as ProviderAuthService from "../provider/ProviderAuthService.ts";
|
||||
import * as AgentSessionImporter from "../project/AgentSessionImporter.ts";
|
||||
import * as AgentSessionScanner from "../project/AgentSessionScanner.ts";
|
||||
import * as ProjectService from "../project/ProjectService.ts";
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ import {
|
||||
} from "../Adapters/CursorAdapterV2.testkit.ts";
|
||||
import * as CursorAdapterV2Testkit from "../Adapters/CursorAdapterV2.testkit.ts";
|
||||
import * as IdAllocator from "../IdAllocator.ts";
|
||||
import * as SqlitePersistence from "../../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../../persistence/Sqlite.ts";
|
||||
import { provideDeterministicTestRuntime } from "./DeterministicRuntime.ts";
|
||||
import {
|
||||
CLAUDE_MODEL_SELECTION,
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ import {
|
||||
} from "../Adapters/ClaudeAdapterV2.testkit.ts";
|
||||
import * as IdAllocator from "../IdAllocator.ts";
|
||||
import * as EffectWorker from "../EffectWorker.ts";
|
||||
import * as SqlitePersistence from "../../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../../persistence/Sqlite.ts";
|
||||
import { provideDeterministicTestRuntime } from "./DeterministicRuntime.ts";
|
||||
import { CLAUDE_BACKGROUND_SUBAGENT_AFTER_ROOT_PROMPT } from "./fixtures/claude_background_subagent_after_root/input.ts";
|
||||
import {
|
||||
|
||||
@@ -13,7 +13,7 @@ import type { SqlError } from "effect/sql/SqlError";
|
||||
|
||||
import * as CheckpointStore from "../../checkpointing/CheckpointStore.ts";
|
||||
import * as ServerConfig from "../../config.ts";
|
||||
import * as SqlitePersistence from "../../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../../persistence/Sqlite.ts";
|
||||
import * as ServerSettings from "../../serverSettings.ts";
|
||||
import * as ThreadManagementService from "../ThreadManagementService.ts";
|
||||
import * as McpSessionRegistryTestkit from "../../mcp/McpSessionRegistry.testkit.ts";
|
||||
@@ -34,7 +34,7 @@ import * as Orchestrator from "../Orchestrator.ts";
|
||||
import * as ProjectionStore from "../ProjectionStore.ts";
|
||||
import * as ProjectStore from "../ProjectStore.ts";
|
||||
import * as ProviderAdapterRegistry from "../ProviderAdapterRegistry.ts";
|
||||
import * as ProviderAuthService from "../../provider/Services/ProviderAuthService.ts";
|
||||
import * as ProviderAuthService from "../../provider/ProviderAuthService.ts";
|
||||
import * as ProviderContinuationRequests from "../ProviderContinuationRequests.ts";
|
||||
import * as ProviderContinuationService from "../ProviderContinuationService.ts";
|
||||
import * as ProviderEventIngestor from "../ProviderEventIngestor.ts";
|
||||
|
||||
@@ -32,7 +32,7 @@ import * as Stream from "effect/Stream";
|
||||
import * as Schema from "effect/Schema";
|
||||
import * as SqlClient from "effect/sql/SqlClient";
|
||||
|
||||
import * as SqlitePersistence from "../../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../../persistence/Sqlite.ts";
|
||||
import { CommandPolicyCapabilityUnsupportedError } from "../CommandPolicy.ts";
|
||||
import { ClaudeProviderCapabilitiesV2 } from "../Adapters/ClaudeAdapterV2.ts";
|
||||
import {
|
||||
|
||||
@@ -25,7 +25,7 @@ const [Start, Projection, Run, Sessions, Policy, Id, Sink, Handoff, Git, Project
|
||||
app("orchestration-v2/ContextHandoffService"),
|
||||
app("git/GitWorkflowService"),
|
||||
app("project/ProjectService"),
|
||||
app("provider/Services/ProviderAuthService"),
|
||||
app("provider/ProviderAuthService"),
|
||||
]);
|
||||
let current;
|
||||
let fullReads = 0;
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
import * as SqlClient from "effect/sql/SqlClient";
|
||||
import * as SqlSchema from "effect/sql/SqlSchema";
|
||||
import * as Effect from "effect/Effect";
|
||||
import * as Layer from "effect/Layer";
|
||||
|
||||
import { toPersistenceSqlError } from "../Errors.ts";
|
||||
|
||||
import * as OrchestrationCommandReceipts from "../Services/OrchestrationCommandReceipts.ts";
|
||||
|
||||
const makeOrchestrationCommandReceiptRepository = Effect.gen(function* () {
|
||||
const sql = yield* SqlClient.SqlClient;
|
||||
|
||||
const upsertReceiptRow = SqlSchema.void({
|
||||
Request: OrchestrationCommandReceipts.OrchestrationCommandReceipt,
|
||||
execute: (receipt) =>
|
||||
sql`
|
||||
INSERT INTO orchestration_command_receipts (
|
||||
command_id,
|
||||
aggregate_kind,
|
||||
aggregate_id,
|
||||
command_type,
|
||||
accepted_at,
|
||||
result_sequence,
|
||||
status,
|
||||
error
|
||||
)
|
||||
VALUES (
|
||||
${receipt.commandId},
|
||||
${receipt.aggregateKind},
|
||||
${receipt.aggregateId},
|
||||
${receipt.commandType},
|
||||
${receipt.acceptedAt},
|
||||
${receipt.resultSequence},
|
||||
${receipt.status},
|
||||
${receipt.error}
|
||||
)
|
||||
ON CONFLICT (command_id)
|
||||
DO UPDATE SET
|
||||
aggregate_kind = excluded.aggregate_kind,
|
||||
aggregate_id = excluded.aggregate_id,
|
||||
command_type = excluded.command_type,
|
||||
accepted_at = excluded.accepted_at,
|
||||
result_sequence = excluded.result_sequence,
|
||||
status = excluded.status,
|
||||
error = excluded.error
|
||||
`,
|
||||
});
|
||||
|
||||
const findReceiptByCommandId = SqlSchema.findOneOption({
|
||||
Request: OrchestrationCommandReceipts.GetByCommandIdInput,
|
||||
Result: OrchestrationCommandReceipts.OrchestrationCommandReceipt,
|
||||
execute: ({ commandId }) =>
|
||||
sql`
|
||||
SELECT
|
||||
command_id AS "commandId",
|
||||
aggregate_kind AS "aggregateKind",
|
||||
aggregate_id AS "aggregateId",
|
||||
command_type AS "commandType",
|
||||
accepted_at AS "acceptedAt",
|
||||
result_sequence AS "resultSequence",
|
||||
status,
|
||||
error
|
||||
FROM orchestration_command_receipts
|
||||
WHERE command_id = ${commandId}
|
||||
`,
|
||||
});
|
||||
|
||||
const upsert: OrchestrationCommandReceipts.OrchestrationCommandReceiptRepositoryShape["upsert"] =
|
||||
(receipt) =>
|
||||
upsertReceiptRow(receipt).pipe(
|
||||
Effect.mapError(
|
||||
toPersistenceSqlError("OrchestrationCommandReceiptRepository.upsert:query"),
|
||||
),
|
||||
);
|
||||
|
||||
const insertIfAbsent: OrchestrationCommandReceipts.OrchestrationCommandReceiptRepositoryShape["insertIfAbsent"] =
|
||||
(receipt) =>
|
||||
sql<{ readonly command_id: string }>`
|
||||
INSERT INTO orchestration_command_receipts (
|
||||
command_id,
|
||||
aggregate_kind,
|
||||
aggregate_id,
|
||||
command_type,
|
||||
accepted_at,
|
||||
result_sequence,
|
||||
status,
|
||||
error
|
||||
)
|
||||
VALUES (
|
||||
${receipt.commandId},
|
||||
${receipt.aggregateKind},
|
||||
${receipt.aggregateId},
|
||||
${receipt.commandType},
|
||||
${receipt.acceptedAt},
|
||||
${receipt.resultSequence},
|
||||
${receipt.status},
|
||||
${receipt.error}
|
||||
)
|
||||
ON CONFLICT(command_id) DO NOTHING
|
||||
RETURNING command_id
|
||||
`.pipe(
|
||||
Effect.map((rows) => rows.length === 1),
|
||||
Effect.mapError(
|
||||
toPersistenceSqlError("OrchestrationCommandReceiptRepository.insertIfAbsent:query"),
|
||||
),
|
||||
);
|
||||
|
||||
const getByCommandId: OrchestrationCommandReceipts.OrchestrationCommandReceiptRepositoryShape["getByCommandId"] =
|
||||
(input) =>
|
||||
findReceiptByCommandId(input).pipe(
|
||||
Effect.mapError(
|
||||
toPersistenceSqlError("OrchestrationCommandReceiptRepository.getByCommandId:query"),
|
||||
),
|
||||
);
|
||||
|
||||
return {
|
||||
insertIfAbsent,
|
||||
upsert,
|
||||
getByCommandId,
|
||||
} satisfies OrchestrationCommandReceipts.OrchestrationCommandReceiptRepositoryShape;
|
||||
});
|
||||
|
||||
export const layer = Layer.effect(
|
||||
OrchestrationCommandReceipts.OrchestrationCommandReceiptRepository,
|
||||
makeOrchestrationCommandReceiptRepository,
|
||||
);
|
||||
@@ -0,0 +1,186 @@
|
||||
/**
|
||||
* OrchestrationCommandReceiptRepository - Repository interface for command receipts.
|
||||
*
|
||||
* Owns persistence operations for deduplication and status tracking of
|
||||
* orchestration command handling.
|
||||
*
|
||||
* @module OrchestrationCommandReceiptRepository
|
||||
*/
|
||||
import { CommandId, IsoDateTime, NonNegativeInt, ProjectId, ThreadId } from "@t3tools/contracts";
|
||||
import * as SqlClient from "effect/sql/SqlClient";
|
||||
import * as SqlSchema from "effect/sql/SqlSchema";
|
||||
import * as Context from "effect/Context";
|
||||
import * as Effect from "effect/Effect";
|
||||
import * as Layer from "effect/Layer";
|
||||
import * as Option from "effect/Option";
|
||||
import * as Schema from "effect/Schema";
|
||||
|
||||
import {
|
||||
toPersistenceSqlError,
|
||||
type OrchestrationCommandReceiptRepositoryError,
|
||||
} from "./Errors.ts";
|
||||
|
||||
export const OrchestrationCommandReceipt = Schema.Struct({
|
||||
commandId: CommandId,
|
||||
aggregateKind: Schema.Literals(["project", "thread"]),
|
||||
aggregateId: Schema.Union([ProjectId, ThreadId]),
|
||||
commandType: Schema.String,
|
||||
acceptedAt: IsoDateTime,
|
||||
resultSequence: NonNegativeInt,
|
||||
status: Schema.Literals(["accepted", "rejected"]),
|
||||
error: Schema.NullOr(Schema.String),
|
||||
});
|
||||
export type OrchestrationCommandReceipt = typeof OrchestrationCommandReceipt.Type;
|
||||
|
||||
export const GetByCommandIdInput = Schema.Struct({
|
||||
commandId: CommandId,
|
||||
});
|
||||
export type GetByCommandIdInput = typeof GetByCommandIdInput.Type;
|
||||
|
||||
/**
|
||||
* OrchestrationCommandReceiptRepository - Service tag for command receipt persistence.
|
||||
*/
|
||||
export class OrchestrationCommandReceiptRepository extends Context.Service<
|
||||
OrchestrationCommandReceiptRepository,
|
||||
{
|
||||
readonly insertIfAbsent: (
|
||||
receipt: OrchestrationCommandReceipt,
|
||||
) => Effect.Effect<boolean, OrchestrationCommandReceiptRepositoryError>;
|
||||
|
||||
/**
|
||||
* Insert or replace a command receipt row.
|
||||
*
|
||||
* Upserts by `commandId` for idempotent command-result tracking.
|
||||
*/
|
||||
readonly upsert: (
|
||||
receipt: OrchestrationCommandReceipt,
|
||||
) => Effect.Effect<void, OrchestrationCommandReceiptRepositoryError>;
|
||||
|
||||
/**
|
||||
* Read a command receipt by command id.
|
||||
*/
|
||||
readonly getByCommandId: (
|
||||
input: GetByCommandIdInput,
|
||||
) => Effect.Effect<
|
||||
Option.Option<OrchestrationCommandReceipt>,
|
||||
OrchestrationCommandReceiptRepositoryError
|
||||
>;
|
||||
}
|
||||
>()("t3/persistence/OrchestrationCommandReceipts/OrchestrationCommandReceiptRepository") {}
|
||||
|
||||
const makeOrchestrationCommandReceiptRepository = Effect.gen(function* () {
|
||||
const sql = yield* SqlClient.SqlClient;
|
||||
|
||||
const upsertReceiptRow = SqlSchema.void({
|
||||
Request: OrchestrationCommandReceipt,
|
||||
execute: (receipt) =>
|
||||
sql`
|
||||
INSERT INTO orchestration_command_receipts (
|
||||
command_id,
|
||||
aggregate_kind,
|
||||
aggregate_id,
|
||||
command_type,
|
||||
accepted_at,
|
||||
result_sequence,
|
||||
status,
|
||||
error
|
||||
)
|
||||
VALUES (
|
||||
${receipt.commandId},
|
||||
${receipt.aggregateKind},
|
||||
${receipt.aggregateId},
|
||||
${receipt.commandType},
|
||||
${receipt.acceptedAt},
|
||||
${receipt.resultSequence},
|
||||
${receipt.status},
|
||||
${receipt.error}
|
||||
)
|
||||
ON CONFLICT (command_id)
|
||||
DO UPDATE SET
|
||||
aggregate_kind = excluded.aggregate_kind,
|
||||
aggregate_id = excluded.aggregate_id,
|
||||
command_type = excluded.command_type,
|
||||
accepted_at = excluded.accepted_at,
|
||||
result_sequence = excluded.result_sequence,
|
||||
status = excluded.status,
|
||||
error = excluded.error
|
||||
`,
|
||||
});
|
||||
|
||||
const findReceiptByCommandId = SqlSchema.findOneOption({
|
||||
Request: GetByCommandIdInput,
|
||||
Result: OrchestrationCommandReceipt,
|
||||
execute: ({ commandId }) =>
|
||||
sql`
|
||||
SELECT
|
||||
command_id AS "commandId",
|
||||
aggregate_kind AS "aggregateKind",
|
||||
aggregate_id AS "aggregateId",
|
||||
command_type AS "commandType",
|
||||
accepted_at AS "acceptedAt",
|
||||
result_sequence AS "resultSequence",
|
||||
status,
|
||||
error
|
||||
FROM orchestration_command_receipts
|
||||
WHERE command_id = ${commandId}
|
||||
`,
|
||||
});
|
||||
|
||||
const upsert: OrchestrationCommandReceiptRepository["Service"]["upsert"] = (receipt) =>
|
||||
upsertReceiptRow(receipt).pipe(
|
||||
Effect.mapError(toPersistenceSqlError("OrchestrationCommandReceiptRepository.upsert:query")),
|
||||
);
|
||||
|
||||
const insertIfAbsent: OrchestrationCommandReceiptRepository["Service"]["insertIfAbsent"] = (
|
||||
receipt,
|
||||
) =>
|
||||
sql<{ readonly command_id: string }>`
|
||||
INSERT INTO orchestration_command_receipts (
|
||||
command_id,
|
||||
aggregate_kind,
|
||||
aggregate_id,
|
||||
command_type,
|
||||
accepted_at,
|
||||
result_sequence,
|
||||
status,
|
||||
error
|
||||
)
|
||||
VALUES (
|
||||
${receipt.commandId},
|
||||
${receipt.aggregateKind},
|
||||
${receipt.aggregateId},
|
||||
${receipt.commandType},
|
||||
${receipt.acceptedAt},
|
||||
${receipt.resultSequence},
|
||||
${receipt.status},
|
||||
${receipt.error}
|
||||
)
|
||||
ON CONFLICT(command_id) DO NOTHING
|
||||
RETURNING command_id
|
||||
`.pipe(
|
||||
Effect.map((rows) => rows.length === 1),
|
||||
Effect.mapError(
|
||||
toPersistenceSqlError("OrchestrationCommandReceiptRepository.insertIfAbsent:query"),
|
||||
),
|
||||
);
|
||||
|
||||
const getByCommandId: OrchestrationCommandReceiptRepository["Service"]["getByCommandId"] = (
|
||||
input,
|
||||
) =>
|
||||
findReceiptByCommandId(input).pipe(
|
||||
Effect.mapError(
|
||||
toPersistenceSqlError("OrchestrationCommandReceiptRepository.getByCommandId:query"),
|
||||
),
|
||||
);
|
||||
|
||||
return {
|
||||
insertIfAbsent,
|
||||
upsert,
|
||||
getByCommandId,
|
||||
} satisfies OrchestrationCommandReceiptRepository["Service"];
|
||||
});
|
||||
|
||||
export const layer = Layer.effect(
|
||||
OrchestrationCommandReceiptRepository,
|
||||
makeOrchestrationCommandReceiptRepository,
|
||||
);
|
||||
+4
-5
@@ -8,13 +8,12 @@ import * as Stream from "effect/Stream";
|
||||
import * as Tracer from "effect/Tracer";
|
||||
import * as SqlClient from "effect/sql/SqlClient";
|
||||
|
||||
import { runMigrations } from "../Migrations.ts";
|
||||
import { runMigrations } from "./Migrations.ts";
|
||||
import * as NodeSqliteClient from "@t3tools/shared/nodeSqliteClient";
|
||||
import * as OrchestrationEventStore from "../Services/OrchestrationEventStore.ts";
|
||||
import * as OrchestrationEventStoreLayer from "./OrchestrationEventStore.ts";
|
||||
import * as OrchestrationEventStore from "./OrchestrationEventStore.ts";
|
||||
import * as SqlitePersistence from "./Sqlite.ts";
|
||||
|
||||
const layerEventStore = OrchestrationEventStoreLayer.layer.pipe(
|
||||
const layerEventStore = OrchestrationEventStore.layer.pipe(
|
||||
Layer.provideMerge(SqlitePersistence.layerMemory),
|
||||
);
|
||||
const occurredAt = "2026-09-03T00:00:00.000Z";
|
||||
@@ -267,7 +266,7 @@ it.effect("uses indexed high-water lookups for populated history without OR scan
|
||||
}
|
||||
}).pipe(
|
||||
Effect.provide(
|
||||
OrchestrationEventStoreLayer.layer.pipe(
|
||||
OrchestrationEventStore.layer.pipe(
|
||||
Layer.provideMerge(NodeSqliteClient.layer({ filename: ":memory:" })),
|
||||
),
|
||||
),
|
||||
+5
-6
@@ -23,16 +23,15 @@ import * as Statement from "effect/sql/Statement";
|
||||
import {
|
||||
LIVE_STREAM_MAX_ITEMS,
|
||||
LiveStreamBufferError,
|
||||
} from "../../orchestration-v2/LiveStreamBudget.ts";
|
||||
import { PersistenceDecodeError } from "../Errors.ts";
|
||||
import { toShellApplicationEvent } from "../../orchestration-v2/ShellStream.ts";
|
||||
import * as OrchestrationEventStore from "../Services/OrchestrationEventStore.ts";
|
||||
import * as OrchestrationEventStoreLayer from "./OrchestrationEventStore.ts";
|
||||
} from "../orchestration-v2/LiveStreamBudget.ts";
|
||||
import { PersistenceDecodeError } from "./Errors.ts";
|
||||
import { toShellApplicationEvent } from "../orchestration-v2/ShellStream.ts";
|
||||
import * as OrchestrationEventStore from "./OrchestrationEventStore.ts";
|
||||
import * as SqlitePersistence from "./Sqlite.ts";
|
||||
const isPersistenceDecodeError = Schema.is(PersistenceDecodeError);
|
||||
const isLiveStreamBufferError = Schema.is(LiveStreamBufferError);
|
||||
|
||||
const layerTest = OrchestrationEventStoreLayer.layer.pipe(
|
||||
const layerTest = OrchestrationEventStore.layer.pipe(
|
||||
Layer.provideMerge(SqlitePersistence.layerMemory),
|
||||
);
|
||||
const layer = it.layer(layerTest);
|
||||
+186
-83
@@ -1,3 +1,15 @@
|
||||
/**
|
||||
* Historical name for the shared application event store.
|
||||
*
|
||||
* Owns durable append/replay access for project events and V2 agent-thread
|
||||
* events under one global sequence. It does not reduce events into read models
|
||||
* or apply command validation rules.
|
||||
*
|
||||
* Uses Effect `Context.Service` for dependency injection and exposes typed
|
||||
* persistence/decode errors for event append and replay operations.
|
||||
*
|
||||
* @module OrchestrationEventStore
|
||||
*/
|
||||
import {
|
||||
ApplicationEventMetadata,
|
||||
ApplicationProjectEvent,
|
||||
@@ -13,6 +25,7 @@ import {
|
||||
ThreadId,
|
||||
type OrchestrationV2DomainEvent,
|
||||
} from "@t3tools/contracts";
|
||||
import * as Context from "effect/Context";
|
||||
import * as SqlClient from "effect/sql/SqlClient";
|
||||
import * as SqlSchema from "effect/sql/SqlSchema";
|
||||
import * as Effect from "effect/Effect";
|
||||
@@ -22,14 +35,111 @@ import * as Option from "effect/Option";
|
||||
import * as Schema from "effect/Schema";
|
||||
import * as Stream from "effect/Stream";
|
||||
|
||||
import { replayAndBufferProjectedLiveEvents } from "../../orchestration-v2/LiveStreamBudget.ts";
|
||||
import { replayAndBufferProjectedLiveEvents } from "../orchestration-v2/LiveStreamBudget.ts";
|
||||
|
||||
import {
|
||||
toPersistenceDecodeError,
|
||||
toPersistenceSqlError,
|
||||
type OrchestrationEventStoreError,
|
||||
} from "../Errors.ts";
|
||||
import * as OrchestrationEventStore from "../Services/OrchestrationEventStore.ts";
|
||||
} from "./Errors.ts";
|
||||
|
||||
/** A project event before the store assigns its sequence. */
|
||||
export type UnsequencedProjectEvent = ApplicationProjectEvent extends infer Event
|
||||
? Event extends ApplicationProjectEvent
|
||||
? Omit<Event, "sequence">
|
||||
: never
|
||||
: never;
|
||||
|
||||
/** OrchestrationEventStore - Service tag for the shared application event log. */
|
||||
export class OrchestrationEventStore extends Context.Service<
|
||||
OrchestrationEventStore,
|
||||
{
|
||||
/** Append one project event to the shared application log. */
|
||||
readonly appendProjectEvent: (
|
||||
event: UnsequencedProjectEvent,
|
||||
) => Effect.Effect<ApplicationProjectEvent, OrchestrationEventStoreError>;
|
||||
|
||||
/** Append V2 agent events to the same globally ordered application log. */
|
||||
readonly appendAgentEvents: (input: {
|
||||
readonly commandId?: CommandId;
|
||||
readonly events: ReadonlyArray<OrchestrationV2DomainEvent>;
|
||||
}) => Effect.Effect<ReadonlyArray<OrchestrationV2StoredEvent>, OrchestrationEventStoreError>;
|
||||
|
||||
/**
|
||||
* Read only V2 thread events from the application log.
|
||||
*
|
||||
* Reads in fixed-size sequence pages until the filtered range is exhausted;
|
||||
* `limit` caps the total emitted events across pages.
|
||||
*/
|
||||
readonly readAgentEvents: (input?: {
|
||||
readonly afterSequence?: number;
|
||||
readonly throughSequence?: number;
|
||||
readonly threadId?: ThreadId;
|
||||
readonly commandId?: CommandId;
|
||||
readonly eventType?: OrchestrationV2DomainEvent["type"];
|
||||
readonly limit?: number;
|
||||
}) => Stream.Stream<OrchestrationV2StoredEvent, OrchestrationEventStoreError>;
|
||||
|
||||
/** Measure one thread's bounded replay without loading or decoding its payloads. */
|
||||
readonly getAgentReplayStats: (input: {
|
||||
readonly threadId: ThreadId;
|
||||
readonly afterSequence: number;
|
||||
readonly throughSequence: number;
|
||||
readonly maxEvents: number;
|
||||
}) => Effect.Effect<
|
||||
{
|
||||
readonly eventCount: number;
|
||||
/** UTF-8 bytes in persisted payload JSON before decoding or wire projection. */
|
||||
readonly rawPayloadBytes: number;
|
||||
readonly hasCreateEvent: boolean;
|
||||
},
|
||||
OrchestrationEventStoreError
|
||||
>;
|
||||
|
||||
/**
|
||||
* Measure the retained application-event range `(afterSequence, throughSequence]`
|
||||
* without loading or decoding its payloads.
|
||||
*/
|
||||
readonly getReplayStats: (input: {
|
||||
readonly afterSequence: number;
|
||||
readonly throughSequence: number;
|
||||
}) => Effect.Effect<
|
||||
{
|
||||
readonly eventCount: number;
|
||||
/** UTF-8 bytes in persisted payload JSON before decoding or wire projection. */
|
||||
readonly rawPayloadBytes: number;
|
||||
},
|
||||
OrchestrationEventStoreError
|
||||
>;
|
||||
|
||||
readonly latestAgentSequence: (
|
||||
threadId?: ThreadId,
|
||||
) => Effect.Effect<number, OrchestrationEventStoreError>;
|
||||
|
||||
readonly latestApplicationSequence: Effect.Effect<number, OrchestrationEventStoreError>;
|
||||
|
||||
/** Read the finite retained application-event range `(afterSequence, throughSequence]`. */
|
||||
readonly readApplicationEvents: (input: {
|
||||
readonly afterSequence: number;
|
||||
readonly throughSequence: number;
|
||||
}) => Stream.Stream<ApplicationStoredEvent, OrchestrationEventStoreError>;
|
||||
|
||||
/** Publish only after the surrounding event/projection transaction commits. */
|
||||
readonly publishCommitted: (
|
||||
events: ReadonlyArray<ApplicationStoredEvent>,
|
||||
) => Effect.Effect<void>;
|
||||
|
||||
/** Race-free replay-to-live stream for project and V2 thread events. */
|
||||
readonly streamApplicationEvents: (input?: {
|
||||
readonly afterSequence?: number;
|
||||
}) => Stream.Stream<ApplicationStoredEvent, OrchestrationEventStoreError>;
|
||||
/** Project transport events before bounding replay and the live tail. */
|
||||
readonly streamProjectedApplicationEvents: <A extends { readonly sequence: number }>(input: {
|
||||
readonly afterSequence?: number;
|
||||
readonly project: (event: ApplicationStoredEvent) => A;
|
||||
}) => Stream.Stream<A, OrchestrationEventStoreError>;
|
||||
}
|
||||
>()("t3/persistence/OrchestrationEventStore") {}
|
||||
|
||||
const encodeProjectIcon = Schema.encodeSync(StoredProjectIcon);
|
||||
const decodeProjectEvent = Schema.decodeUnknownEffect(ApplicationProjectEvent);
|
||||
@@ -156,9 +266,7 @@ function rowToApplicationStoredEvent(
|
||||
return row.aggregate_kind === "project" ? rowToProjectEvent(row) : rowToV2StoredEvent(row);
|
||||
}
|
||||
|
||||
function inferActorKind(
|
||||
event: OrchestrationEventStore.UnsequencedProjectEvent,
|
||||
): typeof ActorKind.Type {
|
||||
function inferActorKind(event: UnsequencedProjectEvent): typeof ActorKind.Type {
|
||||
if (event.commandId !== null && event.commandId.startsWith("provider:")) {
|
||||
return "provider";
|
||||
}
|
||||
@@ -249,31 +357,30 @@ const makeEventStore = Effect.gen(function* () {
|
||||
`,
|
||||
});
|
||||
|
||||
const appendProjectEvent: OrchestrationEventStore.OrchestrationEventStoreShape["appendProjectEvent"] =
|
||||
(event) =>
|
||||
appendProjectEventRow({
|
||||
eventId: event.eventId,
|
||||
streamId: event.aggregateId,
|
||||
type: event.type,
|
||||
causationEventId: event.causationEventId,
|
||||
correlationId: event.correlationId,
|
||||
actorKind: inferActorKind(event),
|
||||
occurredAt: event.occurredAt,
|
||||
commandId: event.commandId,
|
||||
payloadJson:
|
||||
event.type === "project.deleted" || !event.payload.projectIcon
|
||||
? event.payload
|
||||
: { ...event.payload, projectIcon: encodeProjectIcon(event.payload.projectIcon) },
|
||||
metadataJson: event.metadata,
|
||||
}).pipe(
|
||||
Effect.flatMap((row) => decodeProjectEvent(row)),
|
||||
Effect.mapError(
|
||||
toPersistenceSqlOrDecodeError(
|
||||
"OrchestrationEventStore.appendProjectEvent:insert",
|
||||
"OrchestrationEventStore.appendProjectEvent:decode",
|
||||
),
|
||||
const appendProjectEvent: OrchestrationEventStore["Service"]["appendProjectEvent"] = (event) =>
|
||||
appendProjectEventRow({
|
||||
eventId: event.eventId,
|
||||
streamId: event.aggregateId,
|
||||
type: event.type,
|
||||
causationEventId: event.causationEventId,
|
||||
correlationId: event.correlationId,
|
||||
actorKind: inferActorKind(event),
|
||||
occurredAt: event.occurredAt,
|
||||
commandId: event.commandId,
|
||||
payloadJson:
|
||||
event.type === "project.deleted" || !event.payload.projectIcon
|
||||
? event.payload
|
||||
: { ...event.payload, projectIcon: encodeProjectIcon(event.payload.projectIcon) },
|
||||
metadataJson: event.metadata,
|
||||
}).pipe(
|
||||
Effect.flatMap((row) => decodeProjectEvent(row)),
|
||||
Effect.mapError(
|
||||
toPersistenceSqlOrDecodeError(
|
||||
"OrchestrationEventStore.appendProjectEvent:insert",
|
||||
"OrchestrationEventStore.appendProjectEvent:decode",
|
||||
),
|
||||
);
|
||||
),
|
||||
);
|
||||
|
||||
const readApplicationRows = (input: {
|
||||
readonly afterSequence: number;
|
||||
@@ -323,14 +430,13 @@ const makeEventStore = Effect.gen(function* () {
|
||||
LIMIT ${input.limit}
|
||||
`;
|
||||
|
||||
const appendAgentEvents: OrchestrationEventStore.OrchestrationEventStoreShape["appendAgentEvents"] =
|
||||
(input) =>
|
||||
Effect.forEach(
|
||||
input.events,
|
||||
(event) =>
|
||||
Effect.gen(function* () {
|
||||
const encoded = yield* encodeV2EventJson(event);
|
||||
const rows = yield* sql<{ readonly sequence: number }>`
|
||||
const appendAgentEvents: OrchestrationEventStore["Service"]["appendAgentEvents"] = (input) =>
|
||||
Effect.forEach(
|
||||
input.events,
|
||||
(event) =>
|
||||
Effect.gen(function* () {
|
||||
const encoded = yield* encodeV2EventJson(event);
|
||||
const rows = yield* sql<{ readonly sequence: number }>`
|
||||
INSERT INTO orchestration_events (
|
||||
event_id,
|
||||
aggregate_kind,
|
||||
@@ -370,25 +476,23 @@ const makeEventStore = Effect.gen(function* () {
|
||||
)
|
||||
RETURNING sequence
|
||||
`;
|
||||
return yield* decodeV2StoredEvent({
|
||||
sequence: rows[0]?.sequence,
|
||||
commandId: input.commandId ?? null,
|
||||
event,
|
||||
});
|
||||
}),
|
||||
{ concurrency: 1 },
|
||||
).pipe(
|
||||
Effect.mapError(
|
||||
toPersistenceSqlOrDecodeError(
|
||||
"OrchestrationEventStore.appendAgentEvents:insert",
|
||||
"OrchestrationEventStore.appendAgentEvents:decode",
|
||||
),
|
||||
return yield* decodeV2StoredEvent({
|
||||
sequence: rows[0]?.sequence,
|
||||
commandId: input.commandId ?? null,
|
||||
event,
|
||||
});
|
||||
}),
|
||||
{ concurrency: 1 },
|
||||
).pipe(
|
||||
Effect.mapError(
|
||||
toPersistenceSqlOrDecodeError(
|
||||
"OrchestrationEventStore.appendAgentEvents:insert",
|
||||
"OrchestrationEventStore.appendAgentEvents:decode",
|
||||
),
|
||||
);
|
||||
),
|
||||
);
|
||||
|
||||
const readAgentEvents: OrchestrationEventStore.OrchestrationEventStoreShape["readAgentEvents"] = (
|
||||
input,
|
||||
) => {
|
||||
const readAgentEvents: OrchestrationEventStore["Service"]["readAgentEvents"] = (input) => {
|
||||
const totalLimit =
|
||||
input?.limit === undefined ? Number.MAX_SAFE_INTEGER : Math.max(0, Math.floor(input.limit));
|
||||
if (totalLimit === 0) {
|
||||
@@ -436,13 +540,12 @@ const makeEventStore = Effect.gen(function* () {
|
||||
);
|
||||
};
|
||||
|
||||
const getAgentReplayStats: OrchestrationEventStore.OrchestrationEventStoreShape["getAgentReplayStats"] =
|
||||
(input) =>
|
||||
sql<{
|
||||
readonly eventCount: number;
|
||||
readonly rawPayloadBytes: number;
|
||||
readonly hasCreateEvent: number;
|
||||
}>`
|
||||
const getAgentReplayStats: OrchestrationEventStore["Service"]["getAgentReplayStats"] = (input) =>
|
||||
sql<{
|
||||
readonly eventCount: number;
|
||||
readonly rawPayloadBytes: number;
|
||||
readonly hasCreateEvent: number;
|
||||
}>`
|
||||
SELECT
|
||||
COUNT(*) AS "eventCount",
|
||||
COALESCE(SUM(octet_length(payload_json)), 0) AS "rawPayloadBytes",
|
||||
@@ -459,17 +562,15 @@ const makeEventStore = Effect.gen(function* () {
|
||||
LIMIT ${Math.max(0, Math.floor(input.maxEvents)) + 1}
|
||||
)
|
||||
`.pipe(
|
||||
Effect.mapError(toPersistenceSqlError("OrchestrationEventStore.getAgentReplayStats:query")),
|
||||
Effect.map((rows) => ({
|
||||
eventCount: rows[0]?.eventCount ?? 0,
|
||||
rawPayloadBytes: rows[0]?.rawPayloadBytes ?? 0,
|
||||
hasCreateEvent: (rows[0]?.hasCreateEvent ?? 0) !== 0,
|
||||
})),
|
||||
);
|
||||
Effect.mapError(toPersistenceSqlError("OrchestrationEventStore.getAgentReplayStats:query")),
|
||||
Effect.map((rows) => ({
|
||||
eventCount: rows[0]?.eventCount ?? 0,
|
||||
rawPayloadBytes: rows[0]?.rawPayloadBytes ?? 0,
|
||||
hasCreateEvent: (rows[0]?.hasCreateEvent ?? 0) !== 0,
|
||||
})),
|
||||
);
|
||||
|
||||
const getReplayStats: OrchestrationEventStore.OrchestrationEventStoreShape["getReplayStats"] = (
|
||||
input,
|
||||
) =>
|
||||
const getReplayStats: OrchestrationEventStore["Service"]["getReplayStats"] = (input) =>
|
||||
sql<{ readonly eventCount: number; readonly rawPayloadBytes: number }>`
|
||||
SELECT
|
||||
COUNT(*) AS "eventCount",
|
||||
@@ -489,9 +590,10 @@ const makeEventStore = Effect.gen(function* () {
|
||||
})),
|
||||
);
|
||||
|
||||
const latestAgentSequence: OrchestrationEventStore.OrchestrationEventStoreShape["latestAgentSequence"] =
|
||||
(threadId) =>
|
||||
sql<{ readonly sequence: number | null }>`
|
||||
const latestAgentSequence: OrchestrationEventStore["Service"]["latestAgentSequence"] = (
|
||||
threadId,
|
||||
) =>
|
||||
sql<{ readonly sequence: number | null }>`
|
||||
SELECT MAX(sequence) AS sequence
|
||||
FROM orchestration_events
|
||||
${
|
||||
@@ -503,9 +605,9 @@ const makeEventStore = Effect.gen(function* () {
|
||||
AND aggregate_kind = 'thread'
|
||||
${threadId === undefined ? sql`` : sql`AND stream_id = ${threadId}`}
|
||||
`.pipe(
|
||||
Effect.map((rows) => rows[0]?.sequence ?? 0),
|
||||
Effect.mapError(toPersistenceSqlError("OrchestrationEventStore.latestAgentSequence:query")),
|
||||
);
|
||||
Effect.map((rows) => rows[0]?.sequence ?? 0),
|
||||
Effect.mapError(toPersistenceSqlError("OrchestrationEventStore.latestAgentSequence:query")),
|
||||
);
|
||||
|
||||
// The OR planner otherwise scans every V2 event instead of seeking the final sequence.
|
||||
const latestApplicationSequence = sql<{ readonly sequence: number | null }>`
|
||||
@@ -568,7 +670,7 @@ const makeEventStore = Effect.gen(function* () {
|
||||
);
|
||||
};
|
||||
|
||||
const streamProjectedApplicationEvents: OrchestrationEventStore.OrchestrationEventStoreShape["streamProjectedApplicationEvents"] =
|
||||
const streamProjectedApplicationEvents: OrchestrationEventStore["Service"]["streamProjectedApplicationEvents"] =
|
||||
(input) =>
|
||||
replayAndBufferProjectedLiveEvents({
|
||||
subscribe: PubSub.subscribe(committedEvents),
|
||||
@@ -588,8 +690,9 @@ const makeEventStore = Effect.gen(function* () {
|
||||
),
|
||||
);
|
||||
|
||||
const streamApplicationEvents: OrchestrationEventStore.OrchestrationEventStoreShape["streamApplicationEvents"] =
|
||||
(input) => streamProjectedApplicationEvents({ ...input, project: (event) => event });
|
||||
const streamApplicationEvents: OrchestrationEventStore["Service"]["streamApplicationEvents"] = (
|
||||
input,
|
||||
) => streamProjectedApplicationEvents({ ...input, project: (event) => event });
|
||||
|
||||
return {
|
||||
appendProjectEvent,
|
||||
@@ -603,7 +706,7 @@ const makeEventStore = Effect.gen(function* () {
|
||||
publishCommitted: (events) => PubSub.publishAll(committedEvents, events).pipe(Effect.asVoid),
|
||||
streamApplicationEvents,
|
||||
streamProjectedApplicationEvents,
|
||||
} satisfies OrchestrationEventStore.OrchestrationEventStoreShape;
|
||||
} satisfies OrchestrationEventStore["Service"];
|
||||
});
|
||||
|
||||
export const layer = Layer.effect(OrchestrationEventStore.OrchestrationEventStore, makeEventStore);
|
||||
export const layer = Layer.effect(OrchestrationEventStore, makeEventStore);
|
||||
@@ -8,7 +8,7 @@ import * as SqlClient from "effect/sql/SqlClient";
|
||||
import * as AuthPairingLinks from "./AuthPairingLinks.ts";
|
||||
import * as AuthSessions from "./AuthSessions.ts";
|
||||
import * as PersistenceErrors from "./Errors.ts";
|
||||
import * as SqlitePersistence from "./Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "./Sqlite.ts";
|
||||
import * as ProviderSessionRuntime from "./ProviderSessionRuntime.ts";
|
||||
|
||||
const issuedAt = DateTime.makeUnsafe("2026-06-20T00:00:00.000Z");
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
/**
|
||||
* OrchestrationCommandReceiptRepository - Repository interface for command receipts.
|
||||
*
|
||||
* Owns persistence operations for deduplication and status tracking of
|
||||
* orchestration command handling.
|
||||
*
|
||||
* @module OrchestrationCommandReceiptRepository
|
||||
*/
|
||||
import { CommandId, IsoDateTime, NonNegativeInt, ProjectId, ThreadId } from "@t3tools/contracts";
|
||||
import * as Option from "effect/Option";
|
||||
import * as Schema from "effect/Schema";
|
||||
import * as Context from "effect/Context";
|
||||
import type * as Effect from "effect/Effect";
|
||||
|
||||
import type { OrchestrationCommandReceiptRepositoryError } from "../Errors.ts";
|
||||
|
||||
export const OrchestrationCommandReceipt = Schema.Struct({
|
||||
commandId: CommandId,
|
||||
aggregateKind: Schema.Literals(["project", "thread"]),
|
||||
aggregateId: Schema.Union([ProjectId, ThreadId]),
|
||||
commandType: Schema.String,
|
||||
acceptedAt: IsoDateTime,
|
||||
resultSequence: NonNegativeInt,
|
||||
status: Schema.Literals(["accepted", "rejected"]),
|
||||
error: Schema.NullOr(Schema.String),
|
||||
});
|
||||
export type OrchestrationCommandReceipt = typeof OrchestrationCommandReceipt.Type;
|
||||
|
||||
export const GetByCommandIdInput = Schema.Struct({
|
||||
commandId: CommandId,
|
||||
});
|
||||
export type GetByCommandIdInput = typeof GetByCommandIdInput.Type;
|
||||
|
||||
/**
|
||||
* OrchestrationCommandReceiptRepositoryShape - Service API for command receipts.
|
||||
*/
|
||||
export interface OrchestrationCommandReceiptRepositoryShape {
|
||||
readonly insertIfAbsent: (
|
||||
receipt: OrchestrationCommandReceipt,
|
||||
) => Effect.Effect<boolean, OrchestrationCommandReceiptRepositoryError>;
|
||||
|
||||
/**
|
||||
* Insert or replace a command receipt row.
|
||||
*
|
||||
* Upserts by `commandId` for idempotent command-result tracking.
|
||||
*/
|
||||
readonly upsert: (
|
||||
receipt: OrchestrationCommandReceipt,
|
||||
) => Effect.Effect<void, OrchestrationCommandReceiptRepositoryError>;
|
||||
|
||||
/**
|
||||
* Read a command receipt by command id.
|
||||
*/
|
||||
readonly getByCommandId: (
|
||||
input: GetByCommandIdInput,
|
||||
) => Effect.Effect<
|
||||
Option.Option<OrchestrationCommandReceipt>,
|
||||
OrchestrationCommandReceiptRepositoryError
|
||||
>;
|
||||
}
|
||||
|
||||
/**
|
||||
* OrchestrationCommandReceiptRepository - Service tag for command receipt persistence.
|
||||
*/
|
||||
export class OrchestrationCommandReceiptRepository extends Context.Service<
|
||||
OrchestrationCommandReceiptRepository,
|
||||
OrchestrationCommandReceiptRepositoryShape
|
||||
>()("t3/persistence/Services/OrchestrationCommandReceipts/OrchestrationCommandReceiptRepository") {}
|
||||
@@ -1,126 +0,0 @@
|
||||
/**
|
||||
* Historical name for the shared application event store.
|
||||
*
|
||||
* Owns durable append/replay access for project events and V2 agent-thread
|
||||
* events under one global sequence. It does not reduce events into read models
|
||||
* or apply command validation rules.
|
||||
*
|
||||
* Uses Effect `Context.Service` for dependency injection and exposes typed
|
||||
* persistence/decode errors for event append and replay operations.
|
||||
*
|
||||
* @module OrchestrationEventStore
|
||||
*/
|
||||
import type {
|
||||
ApplicationProjectEvent,
|
||||
ApplicationStoredEvent,
|
||||
CommandId,
|
||||
OrchestrationV2DomainEvent,
|
||||
OrchestrationV2StoredEvent,
|
||||
ThreadId,
|
||||
} from "@t3tools/contracts";
|
||||
import * as Context from "effect/Context";
|
||||
import type * as Effect from "effect/Effect";
|
||||
import type * as Stream from "effect/Stream";
|
||||
|
||||
import type { OrchestrationEventStoreError } from "../Errors.ts";
|
||||
|
||||
/** A project event before the store assigns its sequence. */
|
||||
export type UnsequencedProjectEvent = ApplicationProjectEvent extends infer Event
|
||||
? Event extends ApplicationProjectEvent
|
||||
? Omit<Event, "sequence">
|
||||
: never
|
||||
: never;
|
||||
|
||||
/**
|
||||
* OrchestrationEventStoreShape - Service API for orchestration event persistence.
|
||||
*/
|
||||
export interface OrchestrationEventStoreShape {
|
||||
/** Append one project event to the shared application log. */
|
||||
readonly appendProjectEvent: (
|
||||
event: UnsequencedProjectEvent,
|
||||
) => Effect.Effect<ApplicationProjectEvent, OrchestrationEventStoreError>;
|
||||
|
||||
/** Append V2 agent events to the same globally ordered application log. */
|
||||
readonly appendAgentEvents: (input: {
|
||||
readonly commandId?: CommandId;
|
||||
readonly events: ReadonlyArray<OrchestrationV2DomainEvent>;
|
||||
}) => Effect.Effect<ReadonlyArray<OrchestrationV2StoredEvent>, OrchestrationEventStoreError>;
|
||||
|
||||
/**
|
||||
* Read only V2 thread events from the application log.
|
||||
*
|
||||
* Reads in fixed-size sequence pages until the filtered range is exhausted;
|
||||
* `limit` caps the total emitted events across pages.
|
||||
*/
|
||||
readonly readAgentEvents: (input?: {
|
||||
readonly afterSequence?: number;
|
||||
readonly throughSequence?: number;
|
||||
readonly threadId?: ThreadId;
|
||||
readonly commandId?: CommandId;
|
||||
readonly eventType?: OrchestrationV2DomainEvent["type"];
|
||||
readonly limit?: number;
|
||||
}) => Stream.Stream<OrchestrationV2StoredEvent, OrchestrationEventStoreError>;
|
||||
|
||||
/** Measure one thread's bounded replay without loading or decoding its payloads. */
|
||||
readonly getAgentReplayStats: (input: {
|
||||
readonly threadId: ThreadId;
|
||||
readonly afterSequence: number;
|
||||
readonly throughSequence: number;
|
||||
readonly maxEvents: number;
|
||||
}) => Effect.Effect<
|
||||
{
|
||||
readonly eventCount: number;
|
||||
/** UTF-8 bytes in persisted payload JSON before decoding or wire projection. */
|
||||
readonly rawPayloadBytes: number;
|
||||
readonly hasCreateEvent: boolean;
|
||||
},
|
||||
OrchestrationEventStoreError
|
||||
>;
|
||||
|
||||
/**
|
||||
* Measure the retained application-event range `(afterSequence, throughSequence]`
|
||||
* without loading or decoding its payloads.
|
||||
*/
|
||||
readonly getReplayStats: (input: {
|
||||
readonly afterSequence: number;
|
||||
readonly throughSequence: number;
|
||||
}) => Effect.Effect<
|
||||
{
|
||||
readonly eventCount: number;
|
||||
/** UTF-8 bytes in persisted payload JSON before decoding or wire projection. */
|
||||
readonly rawPayloadBytes: number;
|
||||
},
|
||||
OrchestrationEventStoreError
|
||||
>;
|
||||
|
||||
readonly latestAgentSequence: (
|
||||
threadId?: ThreadId,
|
||||
) => Effect.Effect<number, OrchestrationEventStoreError>;
|
||||
|
||||
readonly latestApplicationSequence: Effect.Effect<number, OrchestrationEventStoreError>;
|
||||
|
||||
/** Read the finite retained application-event range `(afterSequence, throughSequence]`. */
|
||||
readonly readApplicationEvents: (input: {
|
||||
readonly afterSequence: number;
|
||||
readonly throughSequence: number;
|
||||
}) => Stream.Stream<ApplicationStoredEvent, OrchestrationEventStoreError>;
|
||||
|
||||
/** Publish only after the surrounding event/projection transaction commits. */
|
||||
readonly publishCommitted: (events: ReadonlyArray<ApplicationStoredEvent>) => Effect.Effect<void>;
|
||||
|
||||
/** Race-free replay-to-live stream for project and V2 thread events. */
|
||||
readonly streamApplicationEvents: (input?: {
|
||||
readonly afterSequence?: number;
|
||||
}) => Stream.Stream<ApplicationStoredEvent, OrchestrationEventStoreError>;
|
||||
/** Project transport events before bounding replay and the live tail. */
|
||||
readonly streamProjectedApplicationEvents: <A extends { readonly sequence: number }>(input: {
|
||||
readonly afterSequence?: number;
|
||||
readonly project: (event: ApplicationStoredEvent) => A;
|
||||
}) => Stream.Stream<A, OrchestrationEventStoreError>;
|
||||
}
|
||||
|
||||
/** OrchestrationEventStore - Service tag for the shared application event log. */
|
||||
export class OrchestrationEventStore extends Context.Service<
|
||||
OrchestrationEventStore,
|
||||
OrchestrationEventStoreShape
|
||||
>()("t3/persistence/Services/OrchestrationEventStore") {}
|
||||
File renamed without changes.
+3
-3
@@ -5,9 +5,9 @@ import * as Path from "effect/Path";
|
||||
import * as SqlClient from "effect/sql/SqlClient";
|
||||
import * as NodeSqliteClient from "@t3tools/shared/nodeSqliteClient";
|
||||
|
||||
import { runMigrations } from "../Migrations.ts";
|
||||
import { initializeV2Database } from "../initializeV2Database.ts";
|
||||
import * as ServerConfig from "../../config.ts";
|
||||
import { runMigrations } from "./Migrations.ts";
|
||||
import { initializeV2Database } from "./initializeV2Database.ts";
|
||||
import * as ServerConfig from "../config.ts";
|
||||
|
||||
// Size the -wal file is cut back to on the first commit after a WAL reset.
|
||||
export const WAL_SIZE_LIMIT_BYTES = 32 * 1024 * 1024;
|
||||
@@ -13,7 +13,7 @@ import * as Layer from "effect/Layer";
|
||||
import * as SqlClient from "effect/sql/SqlClient";
|
||||
|
||||
import * as ServerConfig from "../config.ts";
|
||||
import * as SqlitePersistence from "./Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "./Sqlite.ts";
|
||||
import { runMigrations } from "./Migrations.ts";
|
||||
import { initializeV2Database } from "./initializeV2Database.ts";
|
||||
import * as EventStore from "../orchestration-v2/EventStore.ts";
|
||||
|
||||
@@ -13,7 +13,7 @@ import * as Scope from "effect/Scope";
|
||||
import * as ServerConfig from "../config.ts";
|
||||
import * as GitWorkflow from "../git/GitWorkflowService.ts";
|
||||
import * as RuntimeLayer from "../orchestration-v2/runtimeLayer.ts";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as ProcessRunner from "../processRunner.ts";
|
||||
import * as GitVcsDriver from "../vcs/GitVcsDriver.ts";
|
||||
import * as VcsDriverRegistry from "../vcs/VcsDriverRegistry.ts";
|
||||
|
||||
@@ -27,7 +27,7 @@ import * as ProjectionStore from "../orchestration-v2/ProjectionStore.ts";
|
||||
import * as ProjectStore from "../orchestration-v2/ProjectStore.ts";
|
||||
import * as ThreadCommandExecutor from "../orchestration-v2/ThreadCommandExecutor.ts";
|
||||
import { planThreadDeletion } from "../orchestration-v2/ThreadDeletion.ts";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as WorkspacePaths from "../workspace/WorkspacePaths.ts";
|
||||
import * as ProjectEnrichmentService from "./ProjectEnrichmentService.ts";
|
||||
import * as ProjectFaviconResolver from "./ProjectFaviconResolver.ts";
|
||||
|
||||
@@ -18,7 +18,7 @@ import * as ProjectionStore from "../orchestration-v2/ProjectionStore.ts";
|
||||
import * as ProjectStore from "../orchestration-v2/ProjectStore.ts";
|
||||
import * as RuntimeLayer from "../orchestration-v2/runtimeLayer.ts";
|
||||
import * as ThreadCommandExecutor from "../orchestration-v2/ThreadCommandExecutor.ts";
|
||||
import * as SqlitePersistence from "../persistence/Layers/Sqlite.ts";
|
||||
import * as SqlitePersistence from "../persistence/Sqlite.ts";
|
||||
import * as WorkspacePaths from "../workspace/WorkspacePaths.ts";
|
||||
import * as ProjectEnrichmentService from "./ProjectEnrichmentService.ts";
|
||||
import * as ProjectFaviconResolver from "./ProjectFaviconResolver.ts";
|
||||
|
||||
+3
-3
@@ -2,9 +2,9 @@ import * as Effect from "effect/Effect";
|
||||
import * as Layer from "effect/Layer";
|
||||
import * as Path from "effect/Path";
|
||||
|
||||
import * as ServerConfig from "../../config.ts";
|
||||
import * as AcpRegistrySupport from "../acp/AcpRegistrySupport.ts";
|
||||
import * as AcpRegistryRuntimeCoordinator from "../acp/AcpRegistryRuntimeCoordinator.ts";
|
||||
import * as ServerConfig from "../config.ts";
|
||||
import * as AcpRegistrySupport from "./acp/AcpRegistrySupport.ts";
|
||||
import * as AcpRegistryRuntimeCoordinator from "./acp/AcpRegistryRuntimeCoordinator.ts";
|
||||
|
||||
/** Server-lifetime ACP Registry catalog shared by setup, snapshots, and turn launch. */
|
||||
export const layer = Layer.merge(
|
||||
@@ -28,7 +28,7 @@ import {
|
||||
forwardAntigravityCallback,
|
||||
validateAntigravityCallbackUrl,
|
||||
} from "./antigravityCallback.ts";
|
||||
import type { ProviderAuthController } from "./Services/ProviderAuthService.ts";
|
||||
import type { ProviderAuthController } from "./ProviderAuthService.ts";
|
||||
|
||||
const AUTH_TIMEOUT_MS = 300_000;
|
||||
const FORWARDING_FAILED_MESSAGE = "Could not deliver the sign-in response. Start sign-in again.";
|
||||
|
||||
+3
-3
@@ -17,9 +17,9 @@ import * as TestClock from "effect/testing/TestClock";
|
||||
import * as EffectAcpErrors from "effect-acp/errors";
|
||||
import type * as EffectAcpSchema from "effect-acp/compat";
|
||||
|
||||
import * as BackgroundPolicy from "../../background/BackgroundPolicy.ts";
|
||||
import * as ServerSettings from "../../serverSettings.ts";
|
||||
import type { AcpSessionRuntimeStartResult } from "../acp/AcpSessionRuntime.ts";
|
||||
import * as BackgroundPolicy from "../background/BackgroundPolicy.ts";
|
||||
import * as ServerSettings from "../serverSettings.ts";
|
||||
import type { AcpSessionRuntimeStartResult } from "./acp/AcpSessionRuntime.ts";
|
||||
import {
|
||||
buildAntigravityModelsFromSession,
|
||||
makeAntigravityProvider,
|
||||
+4
-4
@@ -18,17 +18,17 @@ import * as SubscriptionRef from "effect/SubscriptionRef";
|
||||
import type * as EffectAcpErrors from "effect-acp/errors";
|
||||
import type * as EffectAcpSchema from "effect-acp/compat";
|
||||
|
||||
import type { AcpSessionRuntimeStartResult } from "../acp/AcpSessionRuntime.ts";
|
||||
import { makeManagedServerProvider } from "../makeManagedServerProvider.ts";
|
||||
import type { AcpSessionRuntimeStartResult } from "./acp/AcpSessionRuntime.ts";
|
||||
import { makeManagedServerProvider } from "./makeManagedServerProvider.ts";
|
||||
import {
|
||||
makeManualOnlyProviderMaintenanceCapabilities,
|
||||
type ProviderMaintenanceCapabilities,
|
||||
} from "../providerMaintenance.ts";
|
||||
} from "./providerMaintenance.ts";
|
||||
import {
|
||||
buildServerProvider,
|
||||
isCommandMissingCause,
|
||||
type ServerProviderDraft,
|
||||
} from "../providerSnapshot.ts";
|
||||
} from "./providerSnapshot.ts";
|
||||
|
||||
const EMPTY_MODEL_CAPABILITIES = createModelCapabilities({ optionDescriptors: [] });
|
||||
const MAX_WORKSPACE_SNAPSHOTS = 32;
|
||||
+1
-1
@@ -24,7 +24,7 @@ import {
|
||||
probeClaudeCapabilities,
|
||||
probeClaudeWorkspaceSnapshot,
|
||||
} from "./ClaudeProvider.ts";
|
||||
import { COMPACT_SLASH_COMMAND } from "../providerSnapshot.ts";
|
||||
import { COMPACT_SLASH_COMMAND } from "./providerSnapshot.ts";
|
||||
|
||||
vi.mock("@anthropic-ai/claude-agent-sdk", { spy: true });
|
||||
|
||||
+7
-7
@@ -33,12 +33,12 @@ import {
|
||||
providerModelsFromSettings,
|
||||
spawnAndCollect,
|
||||
type ServerProviderDraft,
|
||||
} from "../providerSnapshot.ts";
|
||||
import { resolveClaudeSdkExecutablePath } from "../Drivers/ClaudeExecutable.ts";
|
||||
import { makeClaudeEnvironment } from "../Drivers/ClaudeHome.ts";
|
||||
import { discoverClaudeSkills } from "../Drivers/ClaudeSkills.ts";
|
||||
import type { ProviderWorkspaceSnapshot } from "../ProviderDriver.ts";
|
||||
import { makeUnavailableUsageLimits } from "../providerUsageLimits.ts";
|
||||
} from "./providerSnapshot.ts";
|
||||
import { resolveClaudeSdkExecutablePath } from "./Drivers/ClaudeExecutable.ts";
|
||||
import { makeClaudeEnvironment } from "./Drivers/ClaudeHome.ts";
|
||||
import { discoverClaudeSkills } from "./Drivers/ClaudeSkills.ts";
|
||||
import type { ProviderWorkspaceSnapshot } from "./ProviderDriver.ts";
|
||||
import { makeUnavailableUsageLimits } from "./providerUsageLimits.ts";
|
||||
import {
|
||||
type ClaudeScopedLimitNames,
|
||||
claudeUsageResponseToLimits,
|
||||
@@ -49,7 +49,7 @@ import {
|
||||
type ClaudeModelCatalog,
|
||||
formatClaudeVersionUpgradeMessage,
|
||||
resolveClaudeModelsForVersion,
|
||||
} from "../ClaudeModelCatalog.ts";
|
||||
} from "./ClaudeModelCatalog.ts";
|
||||
|
||||
const DEFAULT_CLAUDE_MODEL_CAPABILITIES: ModelCapabilities = createModelCapabilities({
|
||||
optionDescriptors: [],
|
||||
@@ -17,7 +17,7 @@ import * as ServerEnvironment from "../environment/ServerEnvironment.ts";
|
||||
import * as CodexInstallation from "./CodexInstallation.ts";
|
||||
import { makeCodexManagedRuntime } from "./CodexManagedRuntime.ts";
|
||||
import * as ProviderCredentialStore from "./ProviderCredentialStore.ts";
|
||||
import { codexAppServerArgs } from "./Layers/codexLaunchArgs.ts";
|
||||
import { codexAppServerArgs } from "./codexLaunchArgs.ts";
|
||||
import { resolveManagedCodexHomeLayout } from "./CodexManagedHome.ts";
|
||||
|
||||
const encodeJson = Schema.encodeEffect(Schema.fromJsonString(Schema.Unknown));
|
||||
|
||||
File renamed without changes.
Loaded 100 of 191 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user