import { type MigrationTarget } from "../bootstrap/migration-target.js"; import type { CredentialPort } from "../ports/credentials.port.js"; import { type HostRunner } from "../bootstrap/host-mcp.js"; import { type ToolsetProbe } from "../bootstrap/live-toolset.js"; import type { GitRemoteFn } from "../bootstrap/workspace-identity.js"; /** * The machine-readable half of setup. * * Everything here shares the detect/plan/apply core with the human wizard - * only the interface differs. An agent gets structured status codes instead of * prose so it never has to infer intent from an error message, and never has * to assemble JAM's config files itself. * * Contract, enforced by tests: * stdout - valid JSON and nothing else, no ANSI, no prompts * stderr - diagnostics only */ export type AgentOptions = { cwd?: string; home?: string; explicitKey?: string; /** `--shared`: adopt JAM for the team, writing into the repository. */ shared?: boolean; migrate?: boolean; /** Injected by tests so a plan never depends on the machine's JIRA_* env. */ credentials?: CredentialPort; /** Injected by tests so a plan never depends on the machine's JAM_PROJECT_KEY. */ env?: NodeJS.ProcessEnv; /** Injected by tests so a plan never shells out to npm to verify a migration target. */ migrationTarget?: MigrationTarget; /** Injected by tests so doctor never launches a real MCP server to read its tools. */ toolsetProbe?: ToolsetProbe; /** Injected by tests so identity never depends on the checkout under test. */ git?: GitRemoteFn; /** Injected by tests so no test ever registers JAM with a real host. */ runHost?: HostRunner; }; export declare function emitJson(payload: unknown): void; /** * `jam setup plan --json` - what setup would do, having done nothing. */ export declare function setupPlanCommand(options?: AgentOptions): Promise; /** * `jam setup apply --non-interactive --json` - execute a freshly computed plan. * * Applies whatever the plan safely can even when a human step remains, and * says so via `changesApplied`. A missing credential should not leave a * project half-wired. */ export declare function setupApplyCommand(options?: AgentOptions): Promise; /** * `jam setup --agent` - one shot: detect, plan, apply what is safe, verify. * * Stops only where a person is genuinely required (choosing a Jira project, * authenticating), and reports exactly how far it got. */ export declare function setupAgentCommand(options?: AgentOptions): Promise; /** * `jam doctor --json`. * * Three axes, kept apart on purpose. The package on this machine being current * says nothing about what the host registration launches, and neither says what * the agent can actually call - a stale pin serves an older tool set while every * local check passes. Reporting them as one verdict is how a broken setup was * reported as ready. */ export declare function doctorJsonCommand(options?: AgentOptions): Promise; /** * `jam auth status --json` - presence and origin only. * * Never returns the credential itself. An agent needs to know whether * authentication is configured, not what it is. */ export declare function authStatusCommand(options?: AgentOptions): number;