import type { AxisConfig, InlineScenario, McpServerConfig } from "../types/config.js"; import type { Logger } from "../types/output.js"; export interface ExpandRemoteScenariosOptions { /** Directory the parent config lives in. Resolves the `.axis/remotes/` root. */ configDir: string; /** Logger for clone/pull progress. Defaults to silent. */ logger?: Logger; /** * How many levels of remote → remote references to follow. `1` (the * default) means the parent may include URL entries, but their configs * may not include further URL entries. */ maxDepth?: number; /** URLs already followed on this expansion chain. Used for cycle detection. */ visited?: Set; /** Current recursion depth (internal). */ depth?: number; } /** True if `entry` looks like a remote git URL. */ export declare function isRemoteScenarioUrl(entry: string): boolean; interface ParsedRemoteUrl { url: string; host: string; owner: string; repo: string; } /** Parse a remote scenarios URL into its components. */ export declare function parseRemoteUrl(entry: string): ParsedRemoteUrl; /** `.axis/remotes///` relative to `configDir`. */ export declare function remoteCloneDir(configDir: string, parsed: ParsedRemoteUrl): string; /** * Injection point for tests so they don't have to shell out to real git. * Default implementation clones or pulls via `git`. */ export type CloneImpl = (url: string, targetDir: string, logger: Logger) => void; /** Override the clone implementation. Returns a function that restores the default. */ export declare function setCloneImplForTests(impl: CloneImpl): () => void; /** * Aggregated additions a remote repo contributes to the parent config. * `scenarios` is the input scenarios list with URL entries replaced by their * resolved absolute paths (non-URL parent entries pass through unchanged). * The other fields are values pulled from remote `axis.config.*` files, * with skills and adapter paths re-resolved to be absolute under their * clone directory so the parent runner can use them as-is. */ export interface RemoteContribution { scenarios: (string | InlineScenario)[]; env: string[]; mcpServers: Record; skills: string[]; artifacts: string[]; adapters: Record; } /** * Walk a scenarios input. For every URL entry, clone the remote repo, load * its `axis.config.*`, and roll up the fields it contributes into a single * {@link RemoteContribution}. Non-URL strings and inline scenarios pass * through into `contribution.scenarios` unchanged. * * Recursion follows nested remote references up to `maxDepth`; cycles throw via the * `visited` set. */ export declare function collectRemoteContributions(input: string | (string | InlineScenario)[] | undefined, options: ExpandRemoteScenariosOptions): Promise; /** * Replace any remote-URL entries in a `scenarios` list with absolute local * paths produced by cloning the remote repo and reading its own config. * * Non-URL strings and inline scenario objects pass through untouched. The * returned shape matches the input shape: if `input` was a single string and * not a URL, it is returned as-is. Used by `discoverScenarios` for callers * outside the runner pipeline; the runner uses {@link mergeRemoteConfig} * to also fold in env/mcp_servers/skills/artifacts/adapters. */ export declare function expandRemoteScenarios(input: string | (string | InlineScenario)[] | undefined, options: ExpandRemoteScenariosOptions): Promise; /** * Resolve remote scenarios AND merge each remote repo's supporting config * (env, mcp_servers, skills, artifacts, adapters) into the parent. The parent * wins on key collisions for mcp_servers and adapters; env/skills/artifacts * become an ordered union with the parent's entries first. * * Mutates and returns the same `config` object (consistent with how the * runner threads the config through later stages). */ export declare function mergeRemoteConfig(config: AxisConfig, configDir: string, options?: Omit): Promise; export {}; //# sourceMappingURL=remote-scenarios.d.ts.map