import { PiTestHost, PiTestHostOptions } from "./piHost.cjs"; import { ExtensionAPI } from "@earendil-works/pi-coding-agent"; //#region src/adapters/testing/extensionContract.d.ts /** * The lifecycle every standard Pi entry owes its host, as runnable scenarios. * * Eight packages carry their own partial copy of this, and the copies disagree * about which parts matter. What they share is what a host actually depends on: * that loading the entry registers something, that shutdown can be delivered * twice, and that a `/reload` can install the entry again on the same runner. * * Scenarios are plain data, not `describe`/`it` calls, so this adds no test * framework to a package every extension already installs. A caller loops: * * ```ts * for (const scenario of standardExtensionScenarios({ factory, tools: ['x'] })) { * it(scenario.name, () => scenario.run()); * } * ``` * * Deeper fencing is deliberately not here. A package that makes a shut-down * tool answer instead of run owns that message and that decision, so it keeps * the test too; this covers only what is true of every extension. */ export interface StandardExtensionContractOptions { /** The package's standard Pi entry: the default export Pi invokes. */ factory(pi: ExtensionAPI): Promise | void; /** Tool names loading the entry must register. */ tools?: readonly string[]; /** Slash commands loading the entry must claim. */ commands?: readonly string[]; /** A fresh host per scenario, for a factory that needs one stubbed a certain way. */ createHost?: (options: PiTestHostOptions) => PiTestHost; } export interface ExtensionContractScenario { name: string; run(): Promise; } export declare function standardExtensionScenarios(options: StandardExtensionContractOptions): readonly ExtensionContractScenario[]; //#endregion //# sourceMappingURL=extensionContract.d.cts.map