Files
rea/src/application/runtime.ts
T

28 lines
1.0 KiB
TypeScript
Raw Normal View History

import type { AppConfig } from "../config.js";
import { BinarySession } from "./BinarySession.js";
2026-07-12 19:32:13 +08:00
import { HopperProvider } from "../hopper/HopperProvider.js";
2026-07-12 21:12:18 +00:00
import { NativeMacOSProvider } from "../native/NativeMacOSProvider.js";
import { ArtifactProvider } from "../artifacts/ArtifactProvider.js";
import { CompositeProvider } from "./CompositeProvider.js";
2026-07-12 10:57:34 +08:00
import { silentLogger, type Logger } from "../logger.js";
/**
* Compose the target-switching runtime shared directly by CLI and MCP adapters.
* This is the sole production wiring point, so both adapters share identical
* provider selection, profile, lifecycle, and Evidence semantics.
*/
2026-07-12 10:57:34 +08:00
export const createBinarySession = (
config: AppConfig,
logger: Logger = silentLogger,
): BinarySession => {
2026-07-12 21:12:18 +00:00
return new BinarySession(
new CompositeProvider([
new ArtifactProvider(
config.artifactNativeMountEnabled,
config.artifactIntegrityContinueEnabled,
),
2026-07-12 21:12:18 +00:00
new NativeMacOSProvider(),
new HopperProvider(config, logger),
]),
);
};