/** * Harness registry — static definitions of the agent CLIs Crewly can set up. * * One entry per harness: display name, binary, how it is installed (an npm * package, or the vendor's official install script), how to print the * version, and the login methods Crewly offers. A `broker` method names the * harness's own login command, which the login broker runs in a PTY; an * `api_key` method is a pasted key. * * - Antigravity CLI is **API key only**: Google does not allow third-party * tools to use Antigravity product OAuth, so there is deliberately no * broker method for it (specs/antigravity-runtime.md). * - Gemini CLI is detect-only (no methods) and retired: kept working for * existing / enterprise users, not offered to new ones. * * @module services/harness/harness-registry */ import type { HarnessId, HarnessLoginMethod, LoginMethodId, LoginMethodKind } from './harness.types.js'; /** The command a broker login method runs. */ export interface BrokerCommand { /** Binary (resolved on the harness PATH) */ command: string; args: readonly string[]; } /** A login method definition (internal: includes the broker command). */ export interface LoginMethodDefinition { id: LoginMethodId; label: string; kind: LoginMethodKind; /** Command run by the login broker (kind `broker` only) */ broker?: BrokerCommand; } /** Installed with `npm install -g @latest` (user-prefix fallback on EACCES). */ export interface NpmInstallSpec { kind: 'npm'; npmPackage: string; } /** * Installed with the vendor's official shell installer, downloaded over * https from exactly `scriptUrl` and run with bash. An installed binary is * updated with ` ` instead. */ export interface ScriptInstallSpec { kind: 'script'; scriptUrl: string; updateArgs: readonly string[]; } /** How a harness is installed. */ export type HarnessInstallSpec = NpmInstallSpec | ScriptInstallSpec; /** Static facts about one harness. */ export interface HarnessDefinition { id: HarnessId; displayName: string; /** Binary name on PATH */ command: string; install: HarnessInstallSpec; /** Arguments that print the version */ versionArgs: readonly string[]; loginMethods: readonly LoginMethodDefinition[]; /** Not offered to new users (see HARNESS_CONSTANTS.RETIRED_IDS) */ retired: boolean; } /** Every harness Crewly knows, in display order (default first). */ export declare const HARNESS_DEFINITIONS: readonly HarnessDefinition[]; /** * All harness definitions. * * @returns The registry, in display order */ export declare function listHarnessDefinitions(): readonly HarnessDefinition[]; /** * Look up a harness definition. * * @param id - Harness id * @returns The definition, or undefined for an unknown id */ export declare function getHarnessDefinition(id: string): HarnessDefinition | undefined; /** * Look up one login method of a harness. * * @param harnessId - Harness id * @param methodId - Login method id * @returns The method, or undefined when the harness does not offer it */ export declare function getLoginMethod(harnessId: string, methodId: string): LoginMethodDefinition | undefined; /** * The broker login method of a harness (the first one), if any. * * @param harnessId - Harness id * @returns The method, or undefined when the harness has no broker login */ export declare function getBrokerLoginMethod(harnessId: string): LoginMethodDefinition | undefined; /** * Public view of a harness's login methods (no commands). * * @param def - Harness definition * @returns `{ id, label, kind }` per method */ export declare function toPublicLoginMethods(def: HarnessDefinition): HarnessLoginMethod[]; /** * The install command a person would run by hand, for hints and prompts. * * @param def - Harness definition * @returns e.g. `npm install -g @openai/codex` or `curl -fsSL https://antigravity.google/cli/install.sh | bash` */ export declare function describeInstallCommand(def: HarnessDefinition): string; /** * Whether a harness is retired (kept for existing users, hidden from new ones). * * @param id - Harness id * @returns True for a retired harness */ export declare function isRetiredHarness(id: string): boolean; /** * Resolve a harness id from a full id or a short CLI alias. * * @param value - `claude-code`, `claude`, `codex-cli`, `codex`, `antigravity-cli`, * `antigravity`, `agy`, `gemini-cli` or `gemini` (case-insensitive) * @returns The harness id, or null when unknown * * @example * ```ts * resolveHarnessAlias('agy'); // 'antigravity-cli' * ``` */ export declare function resolveHarnessAlias(value: string | undefined | null): HarnessId | null; //# sourceMappingURL=harness-registry.d.ts.map