import { type ResolvedArtifacts, type RootEntry, type PreparedSession } from "@pulsemcp/air-core"; import { type LoadedExtensions } from "./extension-loader.js"; export interface PrepareSessionOptions { /** Path to air.json. Uses AIR_CONFIG env or ~/.air/air.json if not set. */ config?: string; /** Root to activate by name. Auto-detected from targetDir's git context if omitted. */ root?: string; /** Target directory to prepare. Defaults to process.cwd(). */ target?: string; /** Agent adapter name (e.g., "claude"). Required. */ adapter: string; /** Skill IDs to activate (overrides root defaults). */ skills?: string[]; /** MCP server IDs to activate (overrides root defaults). */ mcpServers?: string[]; /** Hook IDs to activate (overrides root defaults). */ hooks?: string[]; /** Plugin IDs to activate (overrides root defaults). */ plugins?: string[]; /** Skill IDs to add on top of (merged) root defaults. */ addSkills?: string[]; /** MCP server IDs to add on top of (merged) root defaults. */ addMcpServers?: string[]; /** Hook IDs to add on top of (merged) root defaults. */ addHooks?: string[]; /** Plugin IDs to add on top of (merged) root defaults. */ addPlugins?: string[]; /** Skill IDs to remove from (merged) root defaults. */ removeSkills?: string[]; /** MCP server IDs to remove from (merged) root defaults. */ removeMcpServers?: string[]; /** Hook IDs to remove from (merged) root defaults. */ removeHooks?: string[]; /** Plugin IDs to remove from (merged) root defaults. */ removePlugins?: string[]; /** * Start from an empty set instead of root defaults when computing additions * and removals. Use to opt out of all root-declared defaults (including * subagent-root unions) and activate only the artifacts explicitly added. */ withoutDefaults?: boolean; /** * Skip merging subagent roots' artifacts into the parent session. * Orchestrators that manage subagent composition externally should set this. */ skipSubagentMerge?: boolean; /** * Parsed CLI option values contributed by extensions. * Passed through to transforms via TransformContext.options. */ extensionOptions?: Record; /** * Skip the final validation that checks for unresolved ${VAR} patterns. * Use when partial resolution is intentional (e.g., orchestrators that * resolve remaining variables themselves). */ skipValidation?: boolean; /** * Pre-loaded extensions. When provided, the SDK skips loading extensions * from air.json — useful when the CLI has already loaded them to discover * contributed CLI options. */ extensions?: LoadedExtensions; /** * Git protocol override for git-based catalog providers (e.g., github://). * Takes precedence over the `gitProtocol` field in air.json. Typical * sources: a CLI flag or programmatic opt-in to HTTPS. */ gitProtocol?: "ssh" | "https"; } export interface PrepareSessionResult { /** The prepared session result from the adapter. */ session: PreparedSession; /** The auto-detected or specified root, if any. */ root?: RootEntry; /** Whether the root was auto-detected (true) or explicitly specified (false/undefined). */ rootAutoDetected?: boolean; /** Warnings from provider cache freshness checks (e.g., stale GitHub clones). */ warnings?: string[]; } /** * Prepare a target directory for an agent session. * * Loads extensions from air.json, resolves artifacts (using providers from * extensions), delegates to the adapter's prepareSession() to write .mcp.json * and inject skills, then runs transforms in declaration order. * * @throws Error if the adapter is not found, air.json is not found, or the specified root doesn't exist. */ export declare function prepareSession(options: PrepareSessionOptions): Promise; /** * Merged default IDs across parent root and its subagent roots. */ export interface MergedArtifactDefaults { mcpServerIds: string[]; skillIds: string[]; hookIds: string[]; pluginIds: string[]; } /** * Compute the union of parent root and subagent roots' defaults for each * artifact category. Subagent merging can be disabled via `skipSubagentMerge`, * in which case only the parent root's defaults are returned. */ export declare function computeMergedDefaults(root: RootEntry | undefined, artifacts: ResolvedArtifacts, skipSubagentMerge?: boolean): MergedArtifactDefaults; /** * Resolve the final override for a single artifact category. * * - If an explicit override is provided (e.g. from a TUI selection), it wins. * - Otherwise, if any add/remove/withoutDefaults intent is present, the * merged defaults are the base, additions are unioned in, removals are * subtracted, and `withoutDefaults` starts from an empty base. * - If no intent is expressed, returns `undefined` — the adapter uses its * own default resolution. * * When a `pool` is supplied, short-form `add` and `remove` IDs are * canonicalized to their qualified form (e.g. `skill-a` → `@local/skill-a`) * via `resolveReference` so set operations match the canonical merged * defaults. Unknown short IDs pass through unchanged so the caller can * surface them as "(not found)". Ambiguous short IDs throw — the caller * must disambiguate with the qualified form before re-invoking. */ export declare function resolveCategoryOverride(explicitOverride: string[] | undefined, mergedDefaults: string[], add: string[] | undefined, remove: string[] | undefined, withoutDefaults: boolean | undefined, pool?: Record): string[] | undefined; //# sourceMappingURL=prepare.d.ts.map