import { LayerResolvers, MajorModesConfig } from "@agimon-ai/doompi-config/majorModes"; import { PackageAttribution } from "@agimon-ai/doompi-config/types"; //#region src/builders/cli/extensionAssembler/index.d.ts export interface ExtensionLayerResolvers extends LayerResolvers { /** Resolves a path authored under packages through its standard Pi manifest. */ localPackageEntries?: (specifier: string, baseDirectory: string) => string[] | undefined; /** Canonical manifest name for a path that represents a package directory. */ localPackageName?: (specifier: string, baseDirectory: string) => string | undefined; } export interface ExtensionContext { agents: boolean; autoStop: boolean; mute?: boolean; preset?: string; personaEntry?: string; /** Named mode whose occurrence is part of composition identity. */ majorMode?: string; /** Ordered layer occurrences selected by the active major mode. */ layers: string[]; majorModesConfig: MajorModesConfig; /** Resolver override used by synchronized replay. */ resolvers?: ExtensionLayerResolvers; } export type SelectedEntryKind = 'extension' | 'package'; type ExtensionResolutionOutcome = 'resolved' | 'missing-optional'; /** * One resolver-derived extension occurrence. * * This remains private to DoomPi composition. It is not package metadata and * deliberately retains authored duplicates even though activation paths are * deduplicated later. */ interface ResolvedExtensionSelection { readonly layer: string; readonly layerIndex: number; readonly entryKind: SelectedEntryKind; readonly entryIndex: number; readonly manifestIndex: number; readonly selector: string; readonly sourceFile?: string; readonly baseDirectory: string; readonly optional: boolean; readonly outcome: ExtensionResolutionOutcome; readonly path?: string; readonly canonicalPath?: string; readonly diagnostic?: string; readonly config?: Record; } export interface CompositionLayerOccurrence { readonly name: string; readonly index: number; readonly sourceFile?: string; readonly baseDirectory: string; } /** Internal normalized composition shared by launch, sync, bundles, and replay. */ export interface ExtensionComposition { readonly version: number; readonly majorMode?: { readonly name: string; readonly sourceFile?: string; readonly baseDirectory?: string; }; readonly layers: readonly CompositionLayerOccurrence[]; readonly selections: readonly ResolvedExtensionSelection[]; /** Actual Pi factory activation order, not CLI argument construction order. */ readonly parentActivation: readonly string[]; /** Actual Pi factory activation order inherited by detached children. */ readonly childActivation: readonly string[]; readonly fingerprint: string; } /** * Which layer of which major mode admitted each package. * * The composition already holds this join while it resolves package names to * entry paths, then drops it, so a session cannot afterwards say why a tool is * present. Reducing it here keeps the selection type private and costs one pass * over an array the caller already has. * * Only `package` entries appear. A bare `extension` selector is a path rather * than a package name, so it has nothing a registered tool could be joined on. * * Keyed by manifest name first, because that is what a registered tool resolves * to. The selector is kept as an alias: a layer may name a package as * `@agimon-ai/doompi-team` when published or `./layers/team/doompi-team` in a * checkout, and both have to find the same layer. */ export declare function packageAttribution(composition: ExtensionComposition): Record; export declare const COMPOSITION_FINGERPRINT_VERSION = 4; export declare const STANDARD_PI_EXTENSION_CONTRACT_VERSION = 2; export declare const OLLAMA_PRESET = "ollama"; /** * Always available so /profile can pick a persona later, and the one entry a * detached child shares with its parent: children get the persona without the * command, because they have no transition coordinator to run a switch through. * * An explicit subpath rather than the bare package name, so it resolves to * exactly this file rather than to whatever pi.extensions lists. */ export declare const PERSONA_ENTRY = "@agimon-ai/doompi-profile/extensions/persona"; export declare const LAYER_RESOLVERS: ExtensionLayerResolvers; /** * Resolves configured packages only from the consumer, while fixed core entries * may fall back to the host package's private dependency closure. */ export declare function createLayerResolvers(consumerRoot?: string): ExtensionLayerResolvers; /** Resolve one deterministic parent/child composition from authored layer occurrences. */ export declare function resolveExtensionComposition(context: ExtensionContext): ExtensionComposition; /** Assemble parent entries in actual Pi factory activation order. */ export declare function assembleExtensions(context: ExtensionContext): string[]; /** Assemble detached-child entries in actual Pi factory activation order. */ export declare function assembleChildExtensions(context: ExtensionContext): string[]; //#endregion //# sourceMappingURL=index.d.mts.map