UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

116 lines 5.58 kB
import { n as ConfigValidationIssue, r as OpenClawConfig } from "../types.openclaw-BdCLfP4c.js"; import { n as RuntimeEnv } from "../runtime-DlqUc5_p.js"; import { i as readConfigFileSnapshot } from "../io-BS_LRHkj.js"; import "../config-OY7NIjWm.js"; import "../types-CM9v8r3Q.js"; import { a as resolveAgentWorkspaceDir, s as resolveDefaultAgentId } from "../agent-scope-config-C1Nx0bsu.js"; import "../types-DeyQCCn2.js"; import "../agent-scope-BnvcBZbj.js"; import "../install-security-scan.types-BdcVdC5E.js"; //#region src/flows/health-checks.d.ts type HealthFindingSeverity = "info" | "warning" | "error"; /** Parses CLI/config severity input into the closed health-finding severity set. */ export declare function parseHealthFindingSeverity(input: string | undefined): HealthFindingSeverity | null; /** Returns whether a finding meets the configured reporting threshold. */ export declare function healthFindingMeetsSeverity(finding: Pick<HealthFinding, "severity">, severityMin: HealthFindingSeverity): boolean; /** Structured finding emitted by doctor health checks. */ interface HealthFinding { readonly checkId: string; readonly severity: HealthFindingSeverity; readonly message: string; readonly source?: string; readonly path?: string; readonly line?: number; readonly column?: number; readonly ocPath?: string; readonly target?: string; readonly requirement?: string; readonly fixHint?: string; } type HealthCheckMode = "doctor" | "lint" | "fix"; /** Immutable runtime/config context passed to health check detection. */ interface HealthCheckContext { readonly mode: HealthCheckMode; readonly runtime: RuntimeEnv; readonly cfg: OpenClawConfig; readonly env?: NodeJS.ProcessEnv; readonly cwd?: string; readonly configPath?: string; readonly allowExecSecretRefs?: boolean; } /** Repair-capable health-check context; fixes may emit diffs or dry-run previews. */ interface HealthRepairContext extends Omit<HealthCheckContext, "mode"> { readonly mode: "fix"; readonly dryRun?: boolean; readonly diff?: boolean; } /** Optional before/after detail for config or file repair output. */ interface HealthRepairDiff { readonly kind: "config" | "file"; readonly path: string; readonly before?: string; readonly after?: string; readonly unifiedDiff?: string; } /** Side effect descriptor for repairs that touch services, processes, packages, or state. */ interface HealthRepairEffect { readonly kind: "config" | "file" | "service" | "process" | "package" | "state" | "other"; readonly action: string; readonly target?: string; readonly dryRunSafe?: boolean; } /** Repair result returned by split health-check repair functions. */ interface HealthRepairResult { readonly status?: "repaired" | "skipped" | "failed"; readonly reason?: string; readonly config?: OpenClawConfig; readonly changes: readonly string[]; readonly warnings?: readonly string[]; readonly diffs?: readonly HealthRepairDiff[]; readonly effects?: readonly HealthRepairEffect[]; } /** Narrow validation scope built from previous findings after a repair runs. */ interface HealthCheckScope { readonly findings?: readonly HealthFinding[]; readonly paths?: readonly string[]; readonly ocPaths?: readonly string[]; } /** Split detect/repair health-check contract registered by core or plugins. */ interface HealthCheck { readonly id: string; readonly kind: "core" | "plugin"; readonly description: string; readonly source?: string; detect(ctx: HealthCheckContext, scope?: HealthCheckScope): Promise<readonly HealthFinding[]>; repair?(ctx: HealthRepairContext, findings: readonly HealthFinding[]): Promise<HealthRepairResult>; } //#endregion //#region src/flows/doctor-core-checks.d.ts export declare function configValidationIssuesToHealthFindings(issues: readonly ConfigValidationIssue[]): readonly HealthFinding[]; //#endregion //#region src/flows/doctor-lint-flow.d.ts interface DoctorLintRunOptions { readonly checks?: readonly HealthCheck[]; readonly skipIds?: ReadonlySet<string> | readonly string[]; readonly onlyIds?: ReadonlySet<string> | readonly string[]; readonly includeAllChecks?: boolean; } interface DoctorLintRunResult { readonly findings: readonly HealthFinding[]; readonly checksRun: number; readonly checksSkipped: number; } /** Runs selected health checks in lint mode and returns sorted findings. */ export declare function runDoctorLintChecks(ctx: HealthCheckContext, opts?: DoctorLintRunOptions): Promise<DoctorLintRunResult>; /** Converts findings to a process exit code using the requested minimum severity. */ export declare function exitCodeFromFindings(findings: readonly HealthFinding[], severityMin?: HealthFindingSeverity): 0 | 1; //#endregion //#region src/flows/health-check-registry.d.ts /** Registers one health check for doctor lint/fix execution. */ export declare function registerHealthCheck(check: HealthCheck): void; /** Returns registered checks in insertion order for deterministic doctor output. */ export declare function listHealthChecks(): readonly HealthCheck[]; /** Looks up a registered health check by its stable id. */ export declare function getHealthCheck(id: string): HealthCheck | undefined; //#endregion export { type DoctorLintRunOptions, type HealthCheck, type HealthCheckContext, type HealthCheckScope, type HealthFinding, type HealthFindingSeverity, type HealthRepairContext, type HealthRepairDiff, type HealthRepairEffect, type HealthRepairResult, type OpenClawConfig, readConfigFileSnapshot, resolveAgentWorkspaceDir, resolveDefaultAgentId };