export type CliArgs = readonly string[]; export type CommandRunner = (args: CliArgs) => Promise; export type CommandCategory = "admin" | "introspection"; export interface HostCapabilities { readonly claudeSkillHandoff?: boolean; } export interface RuntimeEnvironment { readonly OKSTRA_RUNTIME_HOST?: string; } export interface HostRuntimeResolution { readonly ok: boolean; readonly requestedRuntime: string; readonly resolvedRuntime: string | null; readonly launchMode: string | null; readonly installTargets: readonly string[]; readonly catalogHostIds?: readonly string[]; readonly host: string; readonly confidence: string; readonly reason: string; readonly fallbackFrom: string | null; readonly warnings: readonly string[]; } export interface HostDescriptor { readonly id: string; readonly install_targets?: readonly string[]; readonly installTargets?: readonly string[]; } export interface HostRegistryCatalog { readonly hosts?: readonly HostDescriptor[]; } export interface HostProbeOptions { readonly hostRuntime: string; readonly entryMode: string; readonly projectRoot: string; readonly homeDir: string; readonly availableFunctions?: readonly string[]; } export type HostReadinessStatus = "ready" | "blocked" | "unknown"; export interface HostReadiness { readonly runtime: string; readonly status: HostReadinessStatus; readonly checks: readonly unknown[]; readonly [key: string]: unknown; } export interface HostResolveOptions { readonly requestedRuntime: string; readonly command: string; readonly env?: RuntimeEnvironment; readonly capabilities?: HostCapabilities; } export type PythonTarget = { readonly module: string; } | { readonly script: string; }; export type PythonInjectedPath = "workspace-root" | "okstra-bin"; export interface PythonCommandSpec { readonly target: PythonTarget; readonly prefix?: readonly string[]; readonly inject?: readonly PythonInjectedPath[]; } export interface NodeCommandDefinition { readonly name: string; readonly module: string; readonly export: string; readonly category: CommandCategory; readonly summary: readonly string[]; } export interface PythonCommandDefinition { readonly name: string; readonly python: PythonCommandSpec; readonly category: CommandCategory; readonly summary: readonly string[]; } export type CommandDefinition = NodeCommandDefinition | PythonCommandDefinition; export interface RuntimePaths { readonly agents: string; readonly workspace: string; readonly pythonpath: string; readonly bin: string; readonly home: string; readonly package: string; readonly version: string; readonly "dev-link": string; } export interface ProcessResult { readonly code: number; readonly stdout: string; readonly stderr: string; } export type PythonRunner = (options: PythonModuleOptions) => Promise; export interface PythonModuleOptions { readonly module: string; readonly args?: CliArgs; readonly extraEnv?: Readonly>; readonly stdio?: "capture" | "inherit-stdout"; } export interface InstalledScriptOptions { readonly scriptName: string; readonly args: CliArgs; } export interface JsonErrorOptions { readonly stage: string; readonly reason: string; readonly extra?: Readonly>; } export interface RuntimeResolutionManifest { readonly requestedRuntime: string; readonly resolvedRuntime: string; readonly launchMode: string | null; readonly installTargets: readonly string[]; readonly host: string; readonly confidence: string; readonly reason: string; readonly fallbackFrom: string | null; readonly warnings: readonly string[]; readonly catalogHostIds?: readonly string[]; } export interface InstalledAssets { readonly sharedRuntime: boolean; readonly claudeSkills: boolean; readonly claudeAgents: boolean; readonly binWrappers: boolean; readonly templates: boolean; readonly schemas: boolean; readonly validators: boolean; } export interface SkillTarget { readonly provider: string; readonly root: string; readonly skills: readonly string[]; } export interface RuntimeManifest { readonly schemaVersion: number; readonly installedAt: string; readonly installRequest: string; readonly runtimeResolution: RuntimeResolutionManifest | null; readonly installedRuntimes: readonly string[]; readonly installedAssets: InstalledAssets; }