import { a as PackageIdentity, i as GeneratedRuntimeManifest, n as CompatibilityLevel, o as ResolvedPiPackage, r as CompatibilityReport, s as ResourceInventory, t as CompatibilityFinding } from "./types-B9VBF8le.mjs"; import { PreparedPiHostPackage, applyPiHost, applyPreparedPiHost, manifestForInstalled, preparePiHost } from "./host.mjs"; import { Context } from "@deepseek-ai/cordis"; //#region src/engine.d.ts interface EngineConfig { /** Mount exactly these packages (skips discovery). */ packages?: string[]; /** Never mount these packages even when discovered. */ exclude?: string[]; /** * Image-admission companion routes. Default: AUTOMATIC — every text-only * llm route gets a \`-vision\` companion that admits pasted images * (a mounted vision extension analyzes them; without one the image is * materialized to a file any image-capable tool can read). \`false\` * turns companions off; an explicit \`{ : [modelIds] }\` narrows. */ visionCompanions?: false | Record; /** * Serve the browser presentation surfaces (the `/pi2dsh` state route the * web renderer polls, and with it the `mode: 'tui'` claim on the web * composition). Default: OFF — the engine alone projects nothing into the * browser, so a web session behaves exactly like the headless CLI (Pi's * own rpc mode; packages degrade gracefully on their own). The dsh-work-x * suite turns this on and carries the actual renderer in its client * bundle; any other product layer that ships a renderer can do the same. */ browserPresentation?: boolean; /** * Serve DSH-native subagents with the profile's Pi packages (default: OFF — * such children run as plain DSH agents, today's behavior). Children the Pi * subagent bridge mints are NEVER covered: they already receive the creator's * own per-spawn loader mount and are recognized by the `pi2dsh-sub-` session-id * prefix. */ serveNativeSubagents?: boolean; } /** Locate the DSH profile root: the nearest ancestor holding cordis.yml. */ declare function findProfileRoot(start: string): string | undefined; interface DiscoveredPackage { name: string; dir: string; /** Resolution anchor when the package is carried by a suite (its members * are the suite's dependencies, unreachable from the profile root under * pnpm's isolated layout). */ anchor?: string; } /** * The profile's direct dependencies that identify as Pi packages: not the * engine itself, not a `dsh.bundle` (those are DSH plugins, not Pi * packages), carrying either Pi's `pi` manifest field or extension sources * under Pi's directory conventions. */ declare function discoverProfilePiPackages(profileRoot: string, options?: { exclude?: string[]; warn?: (message: string) => void; }): Promise; /** * The single mount path on every DSH surface: one Pi runtime per root Agent. * * Pi instantiates its extensions once per session; DSH's twin of that scope is * the Agent with its public `agent.ctx` ("contributions are agent-local, * unwind on disposal"). Mounting is driven purely by official core seams, so * the same semantics hold on the TUI, web, headless, ACP and config-declared * agents alike: * * - `agent/created` fires on every publication path before the loop can run * a first turn; it eagerly starts that agent's mount. * - `system-prompt/assemble` (awaited waterfall, runs in every step's * preStep) gates the assembly on the mount and patches the pre-waterfall * tools snapshot from the official scoped projection `tools.schemas()` — * stock DSH collects `assembly.tools` before dispatching the waterfall, * so a mount that lands during the wait would otherwise miss turn one. * - `tools/pre-execute` (awaited waterfall) closes the same window for * direct executions that bypass assembly. * * `agent/session-start` deliberately is NOT the trigger: DSH documents it as a * veto-less notification that cannot gate startup. The waterfalls above are * the officially awaited seams, and the exact pattern of registering onto a * foreign agent's ctx from a lifecycle event is what DSH's own schedule * plugin ships. * * A mount failure never takes the Agent down: the agent keeps running as a * plain DSH agent, the failure is reported loudly once, and only the Pi * packages are missing — the capability-gap discipline, not a rollback. */ declare function installAgentScopedMounts(ctx: Context, preparedPackages: Promise, report: { warn(message: string): void; }): void; /** Cordis plugin surface: `dsh plugin add pi2dsh` mounts this. */ declare const name = "pi2dsh"; declare const inject: string[]; declare function apply(ctx: Context, config?: EngineConfig): Promise; //#endregion //#region src/compatibility.d.ts interface Rule { level: CompatibilityLevel; detail: string; /** How the mapping is built — the DSH seam or service that carries it. */ design?: string; } /** * A Pi extension surface. `design` is REQUIRED here and optional on Rule: an * imported symbol is served by a shim family the docs describe once, but every * surface a package can call has to name the DSH mechanism behind it, or the * documentation degrades into a list of verdicts nobody can act on. Adding a * surface without one is a type error, which is the point. */ interface SurfaceRule extends Rule { design: string; } declare const PI_CODING_AGENT_PACKAGES: readonly ["@earendil-works/pi-coding-agent", "@mariozechner/pi-coding-agent"]; declare const PI_TUI_PACKAGES: readonly ["@earendil-works/pi-tui", "@mariozechner/pi-tui"]; declare const PI_AI_PACKAGES: readonly ["@earendil-works/pi-ai", "@mariozechner/pi-ai"]; declare const HOST_IMPORT_RULES: Readonly>>>; declare const CONTEXT_RULES: Readonly>; declare const UI_CONTEXT_RULES: Readonly>; declare const API_RULES: Readonly>; declare const EVENT_RULES: Readonly>; declare function ruleForApi(method: string): Rule | undefined; declare function ruleForEvent(event: string): Rule; declare function ruleForHostImport(packageName: string, importedName: string): Rule | undefined; declare function ruleForContextProperty(property: string): Rule | undefined; declare function ruleForUiContextProperty(property: string): Rule | undefined; //#endregion //#region src/mcp-config.d.ts type UnknownRecord = Record; interface PiMcpServer { name: string; sourcePath: string; transport: 'stdio' | 'streamable-http'; command?: string; args?: string[]; env?: Record; cwd?: string; url?: string; headers?: Record; disabled: boolean; } interface McpConversionWarning { server: string; message: string; } interface McpConversionResult { servers: PiMcpServer[]; entries: UnknownRecord[]; warnings: McpConversionWarning[]; sources: string[]; } declare function collectPiMcpServers(cwd: string, extraPaths?: string[]): { servers: Map; sources: string[]; }; declare function convertPiMcpConfig(cwd: string, extraPaths?: string[]): McpConversionResult; /** Render the converted entries as a cordis.patch.yml `insert` block. */ declare function renderMcpPatch(result: McpConversionResult): string; //#endregion //#region src/source.d.ts declare function resolvePiPackage(source: string, cwd?: string): Promise; //#endregion //#region src/index.d.ts /** * Static compatibility analysis of one resolved Pi package (CLI `inspect`). * @param pkg - the resolved package. * @returns the compatibility report. */ declare function analyzePackage(pkg: ResolvedPiPackage): Promise; //#endregion export { API_RULES, CONTEXT_RULES, type CompatibilityFinding, type CompatibilityLevel, type CompatibilityReport, EVENT_RULES, type EngineConfig, type GeneratedRuntimeManifest, HOST_IMPORT_RULES, PI_AI_PACKAGES, PI_CODING_AGENT_PACKAGES, PI_TUI_PACKAGES, type PackageIdentity, type ResolvedPiPackage, type ResourceInventory, UI_CONTEXT_RULES, analyzePackage, apply, applyPiHost, applyPreparedPiHost, collectPiMcpServers, convertPiMcpConfig, discoverProfilePiPackages, findProfileRoot, inject, installAgentScopedMounts, manifestForInstalled, name, preparePiHost, renderMcpPatch, resolvePiPackage, ruleForApi, ruleForContextProperty, ruleForEvent, ruleForHostImport, ruleForUiContextProperty }; //# sourceMappingURL=index.d.mts.map