import { type SecretStore, type StoredCredentials } from "../adapters/credentials/secret-store.js"; import type { CredentialPort } from "../ports/credentials.port.js"; import { Ui } from "./ui.js"; /** * `jam auth login` / `jam auth logout`. * * Human-facing on purpose: these are the one step of setup an agent must not * perform. An agent that asks a person for a token, or stores one, has done * something wrong regardless of intent - so this path prompts, and the agent * path stops at JAM_AUTH_REQUIRED and hands the user this command. * * `jam auth status` stays in the agent API: it is presence and origin only, * and its JSON shape is a contract. */ export type AuthOptions = { ui?: Ui; /** Injected by tests so the suite never touches a real keychain. */ store?: SecretStore | undefined; /** Reads back what is now in effect. A fresh port each call - see below. */ readBack?: () => CredentialPort; /** * Injected by tests. Real verification talks to Jira, which no unit test may * do - and the guarantee under test (nothing is stored unless Jira accepted * it) is about the ordering, not about the network. */ verify?: (values: StoredCredentials) => Promise; /** * Injected by tests. The suite runs with JAM_DISABLE_SECRET_STORE set so it * cannot reach a real keychain, which would otherwise make every "no store * on this system" case report the disabled one instead. */ env?: NodeJS.ProcessEnv; }; export declare function authLoginCommand(options?: AuthOptions): Promise; export declare function authLogoutCommand(options?: AuthOptions): number; /** * The origin of any URL from the user's Jira site, or undefined. * * Parsed rather than trimmed, because a pathname is the failure that actually * happens: someone copies the project page URL, and JiraClient resolves each * REST path *relative* to the base, so `/jira/software/c/projects/KEY/summary` * gets the API path appended to it. Atlassian answers that with its HTML shell * at 200, and the only symptom is "Jira returned a non-JSON response". */ export declare function toJiraOrigin(input: string): string | undefined;