/** * Platform registry — the single source of truth for every host platform * (harness) rolebox can target. * * Each harness contributes ONE {@link PlatformDescriptor} here. Everything that * used to be a hardcoded `switch (platformId)` — path resolution, sync-target * layout, CLI status/info reporting, integration/registration detection — now * iterates this registry. Adding a new harness is a single-entry change: append * a descriptor and the CLI, path helpers, and factory pick it up automatically, * with no edits to the consuming call sites. * * Design intent (why a registry, not a switch): * - CLI commands (`rolebox status`, `rolebox info`) must report ALL targets, * not just opencode. They iterate `PLATFORM_REGISTRY` instead of naming * platforms one by one. * - Platform-specific knowledge (how to detect that rolebox is registered * with the host) lives WITH the platform descriptor, not smeared across * the CLI. opencode knows about its `plugin` array; a future harness * declares its own detection in its own descriptor. */ import { type PlatformPaths } from "./paths.ts"; /** * Host-integration status for a platform — i.e. whether rolebox is registered * with the host tool through that tool's own mechanism (opencode plugin array, * a future pi extension manifest, a dsh cordis profile bundle, ...). */ export interface PlatformIntegration { /** Name of the registration mechanism, e.g. "Plugin", "Extension", "Bundle". */ mechanism: string; /** Whether rolebox is currently registered with the host tool. */ registered: boolean; /** Human-readable state, e.g. "registered" / "not found in opencode config". */ detail: string; /** Actionable hint shown when not registered (home dir collapsed to `~`). */ hint?: string; } /** * A single host platform (harness) rolebox can deploy to. * * `id` MUST match the corresponding {@link SyncTarget} value so path helpers * and CLI sync commands resolve consistently. */ export interface PlatformDescriptor { /** Sync-target id — matches a `SyncTarget` value (e.g. "opencode", "pi", "dsh"). */ id: string; /** Human-readable label for CLI output (e.g. "OpenCode", "pi", "dsh"). */ label: string; /** Resolve this platform's directory layout. */ paths: () => PlatformPaths; /** * Detect whether rolebox is registered with the host tool. * * Returns `null` when the platform exposes NO detectable registration * mechanism (rolebox cannot honestly report a state), so the CLI can omit * the line rather than fabricate a "registered/not registered" verdict. */ detectIntegration: () => PlatformIntegration | null; } /** Every host platform rolebox can target. Order = CLI display order. */ export declare const PLATFORM_REGISTRY: readonly PlatformDescriptor[]; /** * Look up a platform descriptor by id. Throws with the supported-id list when * the id is unknown — the strict contract used by CLI sync-target resolution. */ export declare function getPlatformDescriptor(id: string): PlatformDescriptor; /** * Resolve platform paths leniently: an unknown or omitted id falls back to * opencode. This is the contract runtime entry points (factory, agent-file * helpers) rely on, where a missing platformId means "the default host". */ export declare function resolvePlatformPaths(id?: string): PlatformPaths; //# sourceMappingURL=registry.d.ts.map