/** * The SINGLE injection point that selects AFT's transport: standalone NDJSON * (spawn the `aft` binary, today's default) or the Subconscious daemon (talk to * AFT as a supervised module). Both plugins call this one factory so the choice * lives in exactly one place and everything downstream (tool registration, * hoisting, permission UI, sidebar) stays transport-agnostic behind the shared * {@link AftTransportPool} interface. * * Selection is by the USER-tier `subc.connection_file` config key (a project * config can never set it — enforced in each plugin's config loader). Present + * the file exists ⇒ subc; absent/empty ⇒ standalone (the default). Present but * the file is MISSING ⇒ FAIL LOUD (throw) — never a silent downgrade to * standalone, which would split-brain a user who meant to run under the daemon. */ import type { ConsumerIdentity } from "@cortexkit/subc-client"; import { type CanonicalRootPath, type ConcretePoolId, type LifecycleRegistry } from "./lifecycle-registry.js"; import { type PoolOptions } from "./pool.js"; import { type BgNudgeRef } from "./subc-transport.js"; import type { AftTransportPool } from "./transport.js"; export interface AftTransportFactoryOptions { /** Harness identity ("opencode" | "pi"). Carried in every subc BindIdentity. */ harness: string; /** Standalone path: resolved `aft` binary. */ binaryPath: string; /** Standalone path: pool/bridge options (callbacks, timeouts, project loader). */ poolOptions: PoolOptions; /** Standalone path: global configure overrides baked into every bridge. */ configOverrides: Record; /** * USER-tier `subc.connection_file` (already stripped of any project override). * Present + existing ⇒ subc transport; absent/empty ⇒ standalone. Tilde and * relative paths are resolved against the user's home directory. */ subcConnectionFile?: string; /** Test/in-process override for route principal identity. Production leaves this undefined. */ subcConsumerIdentity?: ConsumerIdentity | null; /** * User-tier `subc.client_reaper`. The value is captured in each concrete * registration and is never mutated in place. Omitted means the merge default * is off; a production candidate may opt in by passing true explicitly. */ subcClientReaper?: boolean; /** Optional registry override for tests; production uses this module's shared lifecycle registry. */ lifecycleRegistry?: LifecycleRegistry; /** * Synchronous filesystem-demand seam used by lifecycle-enabled getBridge calls. * Production defaults to checking that the canonical root exists. */ subcLifecycleDemandCheck?: (root: CanonicalRootPath, poolId: ConcretePoolId) => boolean | { readonly exists?: boolean; }; /** * Subc path: idle bg-completion wake handler (a `{op:"bg_events"}` nudge). The * handler MUST force a drain (the nudge is payload-less). Ignored standalone. */ onBgEventsNudge?: (projectRoot: string, session: string) => void; /** Subc path: idle bg-completion wake handler with complete root provenance. */ onBgEventsNudgeRef?: (ref: BgNudgeRef) => void; } /** * Construct the transport pool for this plugin process. Async because the subc * presence check stats the connection file. Returns a pool satisfying * {@link AftTransportPool} either way; the caller's downstream code does not * branch on which. The returned ownership layer replaces a terminal subc or * standalone instance when a later tool call arrives after host teardown. */ export declare function createAftTransportPool(opts: AftTransportFactoryOptions): Promise; //# sourceMappingURL=transport-factory.d.ts.map