import { Connection } from "@t3tools/client-runtime/connection";import { shellSnapshotLoaderLayer } from "@t3tools/client-runtime/state/shell";import { threadSnapshotLoaderLayer } from "@t3tools/client-runtime/state/threads";import { pullRequestDiffLoaderLayer } from "@t3tools/client-runtime/state/pull-requests";import * as Layer from "effect/Layer";import { Atom } from "effect/unstable/reactivity"; import { runtimeContextLayer } from "../lib/runtime";import { backgroundActivityObserverLayer, backgroundActivityReporterLayer,} from "../lib/backgroundActivityReporter";import { connectionPlatformLayer } from "./platform"; const providedConnectionPlatformLayer = connectionPlatformLayer.pipe( Layer.provide(runtimeContextLayer),); const snapshotLoaderLayer = Layer.mergeAll( threadSnapshotLoaderLayer, shellSnapshotLoaderLayer, pullRequestDiffLoaderLayer,); type ConnectionLayerSource = | typeof Connection.layer | typeof snapshotLoaderLayer | typeof runtimeContextLayer | typeof connectionPlatformLayer | typeof backgroundActivityObserverLayer | typeof backgroundActivityReporterLayer; const providedClientConnectionLayer = snapshotLoaderLayer.pipe( Layer.provideMerge( Connection.layerWithOptions({ environmentThemes: true, usageLimitSources: true, usageLimitsCommand: true, }), ), Layer.provideMerge( Layer.mergeAll( runtimeContextLayer, providedConnectionPlatformLayer, backgroundActivityObserverLayer, ), ),); const connectionLayer = backgroundActivityReporterLayer.pipe( Layer.provideMerge(providedClientConnectionLayer),); export const connectionAtomRuntime: Atom.AtomRuntime< Layer.Success<ConnectionLayerSource>, Layer.Error<ConnectionLayerSource>> = Atom.runtime(connectionLayer);
import { Connection } from "@t3tools/client-runtime/connection";
import { shellSnapshotLoaderLayer } from "@t3tools/client-runtime/state/shell";
import { threadSnapshotLoaderLayer } from "@t3tools/client-runtime/state/threads";
import { pullRequestDiffLoaderLayer } from "@t3tools/client-runtime/state/pull-requests";
import * as Layer from "effect/Layer";
import { Atom } from "effect/unstable/reactivity";
import { runtimeContextLayer } from "../lib/runtime";
import {
backgroundActivityObserverLayer,
backgroundActivityReporterLayer,
} from "../lib/backgroundActivityReporter";
import { connectionPlatformLayer } from "./platform";
const providedConnectionPlatformLayer = connectionPlatformLayer.pipe(
Layer.provide(runtimeContextLayer),
);
const snapshotLoaderLayer = Layer.mergeAll(
threadSnapshotLoaderLayer,
shellSnapshotLoaderLayer,
pullRequestDiffLoaderLayer,
);
type ConnectionLayerSource =
| typeof Connection.layer
| typeof snapshotLoaderLayer
| typeof runtimeContextLayer
| typeof connectionPlatformLayer
| typeof backgroundActivityObserverLayer
| typeof backgroundActivityReporterLayer;
const providedClientConnectionLayer = snapshotLoaderLayer.pipe(
Layer.provideMerge(
Connection.layerWithOptions({
environmentThemes: true,
usageLimitSources: true,
usageLimitsCommand: true,
}),
),
Layer.provideMerge(
Layer.mergeAll(
runtimeContextLayer,
providedConnectionPlatformLayer,
backgroundActivityObserverLayer,
),
),
);
const connectionLayer = backgroundActivityReporterLayer.pipe(
Layer.provideMerge(providedClientConnectionLayer),
);
export const connectionAtomRuntime: Atom.AtomRuntime<
Layer.Success<ConnectionLayerSource>,
Layer.Error<ConnectionLayerSource>
> = Atom.runtime(connectionLayer);