import type { LoginDeps, LoginFlags, LoginOutcome } from "../login/index.js"; import { type AgentlintConfig } from "../push/config.js"; import { type FetchFn as LookupFetchFn } from "../push/project-lookup.js"; import { type ExecFn } from "../push/repo-detect.js"; export declare const DEFAULT_PUSH_URL = "https://agentlint.sh"; export type Logger = (line: string) => void; export type PromptFn = (question: string) => Promise; export type WriteFileFn = (path: string, contents: string) => Promise; export type GetEnvFn = (name: string) => string | undefined; export interface InitFlags { /** `--token ` — overrides AGENTLINT_TOKEN env when present. */ token?: string; /** `--repo ` — overrides git remote detection. */ repo?: string; /** `--endpoint ` — overrides AGENTLINT_URL/default. */ endpoint?: string; /** `--yes` — don't prompt; fail if we'd need to. */ yes?: boolean; /** `--no-workflow` — skip writing .github/workflows/agentlint.yml. */ noWorkflow?: boolean; /** `--force-workflow` — overwrite an existing workflow file. */ forceWorkflow?: boolean; } export type MkdirFn = (path: string) => Promise; export type StatFn = (path: string) => Promise<{ isFile: boolean; } | null>; export type ReadTokenFileFn = () => Promise; export type RunLoginInlineFn = (flags: LoginFlags, deps: LoginDeps) => Promise; export interface InitDeps { cwd: string; log: Logger; prompt: PromptFn; writeFileFn?: WriteFileFn; mkdirFn?: MkdirFn; statFn?: StatFn; getEnv?: GetEnvFn; execFn?: ExecFn; fetchFn?: LookupFetchFn; endpoint?: string; /** Read the on-disk token file. Override for tests. */ readTokenFile?: ReadTokenFileFn; /** Run the device-flow login inline. Override for tests. */ runLoginFn?: RunLoginInlineFn; } export type InitOutcome = { kind: "wrote-config"; configPath: string; config: AgentlintConfig; } | { kind: "no-token"; } | { kind: "no-repo"; } | { kind: "no-project"; repoOwner: string; repoName: string; } | { kind: "unauthorized"; } | { kind: "error"; reason: string; }; /** * Run `agentlint init`. Returns an outcome that the caller can format. * * Side effects (writes / prompts / network) all go through injected * dependencies so tests are deterministic and offline. */ export declare function runInit(flags: InitFlags, deps: InitDeps): Promise; /** * Suggested GitHub Actions snippet. Exposed so tests can assert on it. * * CI auth is OIDC-only (ADR-0026 supersedes ADR-0025): the `/api/runs` * route accepts the GitHub Actions OIDC JWT alone, so no `AGENTLINT_TOKEN` * secret is required in the runner environment. */ export declare function githubActionsSnippet(): string; //# sourceMappingURL=index.d.ts.map