mirror of
https://github.com/morluto/rea.git
synced 2026-12-04 01:54:49 +00:00
Introduce deterministic deep-provider discovery and immutable per-target routing while retaining disjoint artifact and native capability families. Expose provider selection consistently through MCP, CLI, environment configuration, session status, prompt completion, typed diagnostics, and generated documentation. Preserve exact provider/profile provenance without request racing or transparent fallback. Cover overlapping providers, ambiguity, rejection details, cancellation, restoration, package installation, and real Hopper target switching.
33 lines
1.2 KiB
TypeScript
33 lines
1.2 KiB
TypeScript
import type { AppConfig } from "../config.js";
|
|
import { BinarySession } from "./BinarySession.js";
|
|
import { HopperProvider } from "../hopper/HopperProvider.js";
|
|
import { NativeMacOSProvider } from "../native/NativeMacOSProvider.js";
|
|
import { ArtifactProvider } from "../artifacts/ArtifactProvider.js";
|
|
import { silentLogger, type Logger } from "../logger.js";
|
|
import { AnalysisProviderRegistry } from "./AnalysisProviderRegistry.js";
|
|
import { SessionProviderRouter } from "./SessionProviderRouter.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.
|
|
*/
|
|
export const createBinarySession = (
|
|
config: AppConfig,
|
|
logger: Logger = silentLogger,
|
|
): BinarySession => {
|
|
const hopper = new HopperProvider(config, logger);
|
|
return new BinarySession(
|
|
SessionProviderRouter.selectable(
|
|
new AnalysisProviderRegistry([hopper], config.analysisProvider),
|
|
[
|
|
new ArtifactProvider(
|
|
config.artifactNativeMountEnabled,
|
|
config.artifactIntegrityContinueEnabled,
|
|
),
|
|
new NativeMacOSProvider(),
|
|
],
|
|
),
|
|
);
|
|
};
|