/** * Which entry point runs, and starting it. * * C-1 forces two mechanisms: Codex and Claude Code cannot host the command, so they call a * binary; Pi can, and its switch needs a live command context (C-10), so it loads an extension * in-process. Exactly one of them runs per process, and which one is read from the target * adapter's declared `selection` level — never from its name (FR-43, FR-58). * * The two starts are not symmetrical, and that is the design rather than an omission: the binary * is handed an invocation and answers with an outcome, while the extension is handed the live * context C-10 proved the switch needs and answers by registering a command. */ import type { AgentCapabilities, AgentId, CliInvocation, CliOutcome, HomePath } from "./contract.js"; import { type KeySource, type PiCommandRegistrar, type PiUi, type SessionPicker } from "./pi-extension/index.js"; import { type HostDeps } from "./wiring.js"; export type { KeySource, PiCommandRegistrar, PiUi }; /** The two mechanisms C-1 forces. */ export type EntryPointKind = "command-binary" | "interactive-picker"; /** Which entry point hosts an agent (FR-43, FR-58). */ export declare function entryPointFor(capabilities: AgentCapabilities): EntryPointKind; /** * One invocation of the command binary, from configuration to printed lines. * * Every failure is an outcome rather than a rejection: the binary's contract is an exit code and * two streams, so a configuration error reaches the user as exit 2 and a sentence (FR-56). */ export declare function runCommandBinary(invocation: CliInvocation, deps?: HostDeps): Promise; /** What the agent's own process supplies when it loads the extension. */ export interface PiActivation { /** The agent the extension is loaded inside. The host states it; this module never guesses. */ agent: AgentId; /** The command surface of the agent that loaded the extension. */ registrar: PiCommandRegistrar; /** How lines reach the user, and how a confirmation is taken. */ ui: PiUi; /** A host-native picker. When present it replaces the lower-level key source. */ picker?: SessionPicker; /** Where the picker's keys come from (FR-9) when the host has no native picker. */ keys?: KeySource; /** The home the agent is running, or null to use the adapter's declared default (FR-3). */ home: HomePath | null; /** The directory the agent is running in. Used to find the repository (FR-13). */ cwd?: string; } /** * Registers /resume-from inside an agent that hosts it itself. * * Unlike the binary this rejects rather than returning an outcome: there is no exit code to * carry the failure, and an extension that registered a command it cannot drive would be worse * than one that failed to load. */ export declare function activatePiExtension(activation: PiActivation, deps?: HostDeps): Promise;