Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ release-mock/
apps/web/.playwright
apps/web/playwright-report
apps/web/src/components/__screenshots__
apps/marketing/public/provider-compatibility.v1.json
.vitest-*
__screenshots__/
.tanstack
Expand Down
2 changes: 1 addition & 1 deletion apps/marketing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "astro dev",
"build": "astro build",
"build": "bun ../../scripts/mirror-provider-compatibility-map.ts && astro build",
"preview": "astro preview",
"typecheck": "astro check"
},
Expand Down
8 changes: 8 additions & 0 deletions apps/server/src/provider/Drivers/ClaudeDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import {
normalizeCommandPath,
resolveProviderMaintenanceCapabilitiesEffect,
} from "../providerMaintenance.ts";
import * as ProviderCompatibility from "../ProviderCompatibility.ts";
import { makeClaudeCapabilitiesCacheKey, makeClaudeContinuationGroupKey } from "./ClaudeHome.ts";
const decodeClaudeSettings = Schema.decodeSync(ClaudeSettings);

Expand Down Expand Up @@ -80,6 +81,7 @@ export type ClaudeDriverEnv =
| FileSystem.FileSystem
| HttpClient.HttpClient
| Path.Path
| ProviderCompatibility.ProviderCompatibilityService
| ProviderEventLoggers
| ServerConfig;

Expand Down Expand Up @@ -112,6 +114,7 @@ export const ClaudeDriver: ProviderDriver<ClaudeSettings, ClaudeDriverEnv> = {
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
const path = yield* Path.Path;
const httpClient = yield* HttpClient.HttpClient;
const providerCompatibility = yield* ProviderCompatibility.ProviderCompatibilityService;
const eventLoggers = yield* ProviderEventLoggers;
const processEnv = mergeProviderInstanceEnvironment(environment);
const fallbackContinuationIdentity = defaultProviderContinuationIdentity({
Expand Down Expand Up @@ -171,7 +174,12 @@ export const ClaudeDriver: ProviderDriver<ClaudeSettings, ClaudeDriverEnv> = {
checkProvider,
enrichSnapshot: ({ snapshot, publishSnapshot }) =>
enrichProviderSnapshotWithVersionAdvisory(snapshot, maintenanceCapabilities).pipe(
Effect.flatMap(ProviderCompatibility.enrichProviderSnapshotWithCompatibilityAdvisory),
Effect.provideService(HttpClient.HttpClient, httpClient),
Effect.provideService(
ProviderCompatibility.ProviderCompatibilityService,
providerCompatibility,
),
Effect.flatMap((enrichedSnapshot) => publishSnapshot(enrichedSnapshot)),
),
refreshInterval: SNAPSHOT_REFRESH_INTERVAL,
Expand Down
8 changes: 8 additions & 0 deletions apps/server/src/provider/Drivers/CodexDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {
makePackageManagedProviderMaintenanceResolver,
resolveProviderMaintenanceCapabilitiesEffect,
} from "../providerMaintenance.ts";
import * as ProviderCompatibility from "../ProviderCompatibility.ts";
import {
codexContinuationIdentity,
materializeCodexShadowHome,
Expand All @@ -72,6 +73,7 @@ export type CodexDriverEnv =
| FileSystem.FileSystem
| HttpClient.HttpClient
| Path.Path
| ProviderCompatibility.ProviderCompatibilityService
| ProviderEventLoggers
| ServerConfig;

Expand Down Expand Up @@ -109,6 +111,7 @@ export const CodexDriver: ProviderDriver<CodexSettings, CodexDriverEnv> = {
Effect.gen(function* () {
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
const httpClient = yield* HttpClient.HttpClient;
const providerCompatibility = yield* ProviderCompatibility.ProviderCompatibilityService;
const eventLoggers = yield* ProviderEventLoggers;
const processEnv = mergeProviderInstanceEnvironment(environment);
const homeLayout = yield* resolveCodexHomeLayout(config);
Expand Down Expand Up @@ -171,7 +174,12 @@ export const CodexDriver: ProviderDriver<CodexSettings, CodexDriverEnv> = {
checkProvider,
enrichSnapshot: ({ snapshot, publishSnapshot }) =>
enrichProviderSnapshotWithVersionAdvisory(snapshot, maintenanceCapabilities).pipe(
Effect.flatMap(ProviderCompatibility.enrichProviderSnapshotWithCompatibilityAdvisory),
Effect.provideService(HttpClient.HttpClient, httpClient),
Effect.provideService(
ProviderCompatibility.ProviderCompatibilityService,
providerCompatibility,
),
Effect.flatMap((enrichedSnapshot) => publishSnapshot(enrichedSnapshot)),
),
refreshInterval: SNAPSHOT_REFRESH_INTERVAL,
Expand Down
11 changes: 10 additions & 1 deletion apps/server/src/provider/Drivers/CursorDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import {
makeStaticProviderMaintenanceResolver,
resolveProviderMaintenanceCapabilitiesEffect,
} from "../providerMaintenance.ts";
import * as ProviderCompatibility from "../ProviderCompatibility.ts";
const decodeCursorSettings = Schema.decodeSync(CursorSettings);

const DRIVER_KIND = ProviderDriverKind.make("cursor");
Expand All @@ -64,6 +65,7 @@ export type CursorDriverEnv =
| FileSystem.FileSystem
| HttpClient.HttpClient
| Path.Path
| ProviderCompatibility.ProviderCompatibilityService
| ProviderEventLoggers
| ServerConfig;

Expand Down Expand Up @@ -97,6 +99,7 @@ export const CursorDriver: ProviderDriver<CursorSettings, CursorDriverEnv> = {
const fileSystem = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const httpClient = yield* HttpClient.HttpClient;
const providerCompatibility = yield* ProviderCompatibility.ProviderCompatibilityService;
const eventLoggers = yield* ProviderEventLoggers;
const processEnv = mergeProviderInstanceEnvironment(environment);
const continuationIdentity = defaultProviderContinuationIdentity({
Expand Down Expand Up @@ -150,7 +153,13 @@ export const CursorDriver: ProviderDriver<CursorSettings, CursorDriverEnv> = {
publishSnapshot,
stampIdentity,
httpClient,
}).pipe(Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner)),
}).pipe(
Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner),
Effect.provideService(
ProviderCompatibility.ProviderCompatibilityService,
providerCompatibility,
),
),
refreshInterval: SNAPSHOT_REFRESH_INTERVAL,
}).pipe(
Effect.mapError(
Expand Down
8 changes: 8 additions & 0 deletions apps/server/src/provider/Drivers/OpenCodeDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {
normalizeCommandPath,
resolveProviderMaintenanceCapabilitiesEffect,
} from "../providerMaintenance.ts";
import * as ProviderCompatibility from "../ProviderCompatibility.ts";
const decodeOpenCodeSettings = Schema.decodeSync(OpenCodeSettings);

const DRIVER_KIND = ProviderDriverKind.make("opencode");
Expand Down Expand Up @@ -77,6 +78,7 @@ export type OpenCodeDriverEnv =
| HttpClient.HttpClient
| OpenCodeRuntime
| Path.Path
| ProviderCompatibility.ProviderCompatibilityService
| ProviderEventLoggers
| ServerConfig;

Expand Down Expand Up @@ -109,6 +111,7 @@ export const OpenCodeDriver: ProviderDriver<OpenCodeSettings, OpenCodeDriverEnv>
const openCodeRuntime = yield* OpenCodeRuntime;
const serverConfig = yield* ServerConfig;
const httpClient = yield* HttpClient.HttpClient;
const providerCompatibility = yield* ProviderCompatibility.ProviderCompatibilityService;
const eventLoggers = yield* ProviderEventLoggers;
const processEnv = mergeProviderInstanceEnvironment(environment);
const continuationIdentity = defaultProviderContinuationIdentity({
Expand Down Expand Up @@ -150,7 +153,12 @@ export const OpenCodeDriver: ProviderDriver<OpenCodeSettings, OpenCodeDriverEnv>
checkProvider,
enrichSnapshot: ({ snapshot, publishSnapshot }) =>
enrichProviderSnapshotWithVersionAdvisory(snapshot, maintenanceCapabilities).pipe(
Effect.flatMap(ProviderCompatibility.enrichProviderSnapshotWithCompatibilityAdvisory),
Effect.provideService(HttpClient.HttpClient, httpClient),
Effect.provideService(
ProviderCompatibility.ProviderCompatibilityService,
providerCompatibility,
),
Effect.flatMap((enrichedSnapshot) => publishSnapshot(enrichedSnapshot)),
),
refreshInterval: SNAPSHOT_REFRESH_INTERVAL,
Expand Down
8 changes: 7 additions & 1 deletion apps/server/src/provider/Layers/CursorProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import {
enrichProviderSnapshotWithVersionAdvisory,
type ProviderMaintenanceCapabilities,
} from "../providerMaintenance.ts";
import * as ProviderCompatibility from "../ProviderCompatibility.ts";
import { AcpSessionRuntime } from "../acp/AcpSessionRuntime.ts";

const PROVIDER = ProviderDriverKind.make("cursor");
Expand Down Expand Up @@ -1234,14 +1235,19 @@ export const enrichCursorSnapshot = (input: {
readonly publishSnapshot: (snapshot: ServerProvider) => Effect.Effect<void>;
readonly stampIdentity?: (snapshot: ServerProvider) => ServerProvider;
readonly httpClient: HttpClient.HttpClient;
}): Effect.Effect<void, never, ChildProcessSpawner.ChildProcessSpawner> => {
}): Effect.Effect<
void,
never,
ChildProcessSpawner.ChildProcessSpawner | ProviderCompatibility.ProviderCompatibilityService
> => {
const { settings, snapshot, publishSnapshot } = input;
const stampIdentity = input.stampIdentity ?? ((value) => value);

const enrichVersionAdvisory = enrichProviderSnapshotWithVersionAdvisory(
snapshot,
input.maintenanceCapabilities,
).pipe(
Effect.flatMap(ProviderCompatibility.enrichProviderSnapshotWithCompatibilityAdvisory),
Effect.provideService(HttpClient.HttpClient, input.httpClient),
Effect.flatMap((enrichedSnapshot) =>
publishSnapshot(stampIdentity(enrichedSnapshot)).pipe(Effect.as(enrichedSnapshot)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import { CodexDriver } from "../Drivers/CodexDriver.ts";
import { CursorDriver } from "../Drivers/CursorDriver.ts";
import { OpenCodeDriver } from "../Drivers/OpenCodeDriver.ts";
import { OpenCodeRuntimeLive } from "../opencodeRuntime.ts";
import * as ProviderCompatibility from "../ProviderCompatibility.ts";
import { NoOpProviderEventLoggers, ProviderEventLoggers } from "./ProviderEventLoggers.ts";
import { makeProviderInstanceRegistry } from "./ProviderInstanceRegistryLive.ts";

Expand All @@ -52,6 +53,9 @@ const TestHttpClientLive = Layer.succeed(
Effect.succeed(HttpClientResponse.fromWeb(request, Response.json({ version: "0.0.0" }))),
),
);
const TestProviderCompatibilityLive = ProviderCompatibility.layer.pipe(
Layer.provide(TestHttpClientLive),
);

const makeCodexConfig = (overrides: Partial<CodexSettings>): CodexSettings => ({
enabled: false,
Expand Down Expand Up @@ -99,6 +103,7 @@ describe("ProviderInstanceRegistryLive — multi-instance codex slice", () => {
}).pipe(
Layer.provideMerge(NodeServices.layer),
Layer.provideMerge(TestHttpClientLive),
Layer.provideMerge(TestProviderCompatibilityLive),
Layer.provideMerge(Layer.succeed(ProviderEventLoggers, NoOpProviderEventLoggers)),
);

Expand Down Expand Up @@ -236,6 +241,7 @@ describe("ProviderInstanceRegistryLive — all drivers slice", () => {
}).pipe(
Layer.provideMerge(infraLayer),
Layer.provideMerge(TestHttpClientLive),
Layer.provideMerge(TestProviderCompatibilityLive),
Layer.provideMerge(Layer.succeed(ProviderEventLoggers, NoOpProviderEventLoggers)),
);

Expand Down
8 changes: 8 additions & 0 deletions apps/server/src/provider/Layers/ProviderRegistry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ import { readProviderStatusCache, resolveProviderStatusCachePath } from "../prov
import type { ProviderInstance } from "../ProviderDriver.ts";
import { ProviderInstanceRegistry } from "../Services/ProviderInstanceRegistry.ts";
import { ProviderRegistry } from "../Services/ProviderRegistry.ts";
import * as ProviderCompatibility from "../ProviderCompatibility.ts";
import { makeManualOnlyProviderMaintenanceCapabilities } from "../providerMaintenance.ts";
const decodeServerSettings = Schema.decodeSync(ServerSettings);
const encodeServerSettings = Schema.encodeSync(ServerSettings);
Expand All @@ -70,6 +71,9 @@ const TestHttpClientLive = Layer.succeed(
Effect.succeed(HttpClientResponse.fromWeb(request, Response.json({ version: "0.0.0" }))),
),
);
const TestProviderCompatibilityLive = ProviderCompatibility.layer.pipe(
Layer.provide(TestHttpClientLive),
);

function selectDescriptor(
id: string,
Expand Down Expand Up @@ -979,6 +983,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, ServerSettingsService.layerTest(), T
}),
),
Layer.provideMerge(TestHttpClientLive),
Layer.provideMerge(TestProviderCompatibilityLive),
Layer.provideMerge(Layer.succeed(ProviderEventLoggers, NoOpProviderEventLoggers)),
Layer.provideMerge(OpenCodeRuntimeLive),
// NO spawner mock — `ChildProcessSpawner` is supplied by the
Expand Down Expand Up @@ -1054,6 +1059,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, ServerSettingsService.layerTest(), T
}),
),
Layer.provideMerge(TestHttpClientLive),
Layer.provideMerge(TestProviderCompatibilityLive),
Layer.provideMerge(Layer.succeed(ProviderEventLoggers, NoOpProviderEventLoggers)),
Layer.provideMerge(OpenCodeRuntimeLive),
// `it.live` does not inherit layers from the outer `it.layer`
Expand Down Expand Up @@ -1157,6 +1163,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, ServerSettingsService.layerTest(), T
}),
),
Layer.provideMerge(TestHttpClientLive),
Layer.provideMerge(TestProviderCompatibilityLive),
Layer.provideMerge(Layer.succeed(ProviderEventLoggers, NoOpProviderEventLoggers)),
Layer.provideMerge(OpenCodeRuntimeLive),
Layer.provideMerge(NodeServices.layer),
Expand Down Expand Up @@ -1208,6 +1215,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, ServerSettingsService.layerTest(), T
}),
),
Layer.provideMerge(TestHttpClientLive),
Layer.provideMerge(TestProviderCompatibilityLive),
Layer.provideMerge(Layer.succeed(ProviderEventLoggers, NoOpProviderEventLoggers)),
Layer.provideMerge(OpenCodeRuntimeLive),
Layer.provideMerge(
Expand Down
Loading
Loading