UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

143 lines (142 loc) • 6.82 kB
import { o as isDefaultInstallIdentity } from "./paths-DAcAg5aV.mjs"; import { n as NON_DEFAULT_INSTALL_SERVICE_SKIP_REASON } from "./gateway-supervision-C1X-e8qk.mjs"; import { t as note } from "./note-CnLgHvug.mjs"; import { r as resolveDoctorMode } from "./doctor-health-contribution-utils-vPLdl3Wb.mjs"; import { a as recordDoctorHealthWarnings, o as renderStructuredHealthFindings, s as reportDoctorHealthFinding } from "./doctor-health-contribution-t31v9kPi.mjs"; import { l as shouldManageGatewayService } from "./doctor-service-repair-policy-DAuL0W8-.mjs"; import { t as resolveDoctorWorkspaceSuggestionScopes } from "./doctor-workspace-suggestion-scopes-DDUxMVpQ.mjs"; import { i as runWriteConfigHealth } from "./doctor-health-contribution-runners.config-DkeKQBD_.mjs"; //#region src/flows/doctor-health-contribution-runners.gateway.ts async function runCommandOwnerHealth(e) { const { noteCommandOwnerHealth: t } = await import("./doctor-command-owner-CcBJaVDK.mjs"); t(e.cfg); } async function runClaudeCliHealth(e) { const { noteClaudeCliHealth: t } = await import("./doctor-claude-cli-WPhqaCWp.mjs"); t(e.cfg); } async function writeDoctorGatewayConfig(e, t) { const n = e.cfg; e.cfg = t; try { if (!await runWriteConfigHealth(e, { runPostWriteRepairs: false })) throw new Error("Doctor did not persist the gateway token; service repair was skipped."); return e.cfg; } catch (t) { e.cfg = n; throw t; } } async function runGatewayServicesHealth(e) { const { noteMacForeignLaunchdJobs: t } = await import("./doctor-foreign-launchd-jobs-Cimy3Dko.mjs"); await t(e.options, e.runtime, e.env ?? process.env); if (e.gatewayMaintenanceActive) return; if (!isDefaultInstallIdentity(e.env ?? process.env)) { note(NON_DEFAULT_INSTALL_SERVICE_SKIP_REASON, "Gateway"); return; } const { maybeRepairNodeServiceConfig: n } = await import("./doctor-node-services-p-U6In6-.mjs"); await n(e.runtime, e.prompter, e.env ?? process.env); if (!await shouldManageGatewayService(e.env ?? process.env)) return; const { maybeRepairGatewayServiceConfig: r, maybeResolveDuelingSystemdGatewayScopes: i, maybeScanExtraGatewayServices: a } = await import("./doctor-gateway-services-CRRoZzfB.mjs"); const { noteMacGatewayPlatformWarnings: o } = await import("./doctor-platform-notes-D5JnL-um.mjs"); await a(e.options, e.runtime, e.prompter); await i(e.runtime, e.prompter); e.cfg = await r(e.cfg, resolveDoctorMode(e.cfg), e.runtime, e.prompter, { allowExecSecretRefs: e.options.allowExec === true, onFinding: (t) => reportDoctorHealthFinding(e, t), writeConfig: (t) => writeDoctorGatewayConfig(e, t) }); await o(e.cfg); } async function runHostDesktopHealth(e) { const { noteHostDesktopHealth: t } = await import("./doctor-host-desktop-_uSIVIRm.mjs"); await t(e.cfg, { prompter: e.prompter }); } async function runStartupChannelMaintenanceHealth(e) { const { maybeRunDoctorStartupChannelMaintenance: t } = await import("./doctor-startup-channel-maintenance-PdRY7-Oo.mjs"); await t({ cfg: e.cfg, runtime: e.runtime, shouldRepair: e.prompter.shouldRepair }); } async function runSecurityHealth(e) { const { noteInstallPolicyHealth: t } = await import("./doctor-install-policy-BQ4iIEhV.mjs"); const { noteSecurityWarnings: n } = await import("./doctor-security-CBz4iSug.mjs"); const { securityAuditFindingToHealthFinding: r } = await import("./health-check-adapter-CWLrXrel.mjs"); const i = await n(e.cfg); recordDoctorHealthWarnings(e, i.map(r)); await t(e.cfg, { deep: e.options.deep === true, env: e.env, onFinding: (t) => reportDoctorHealthFinding(e, t) }); } async function runWebFetchProxyHealth(e) { if (!isDefaultInstallIdentity(e.env ?? process.env)) return; const { noteWebFetchProxyDiagnostic: t } = await import("./doctor-web-fetch-proxy-LDe1rWpJ.mjs"); await t({ cfg: e.cfg, env: e.env ?? process.env }); } async function runBundleLspEnvHealth(e) { const { noteBundleLspEnvPassthrough: t } = await import("./doctor-bundle-lsp-env-DXBA06tQ.mjs"); await t({ cfg: e.cfg, workspaceDirs: resolveDoctorWorkspaceSuggestionScopes(e.cfg).map((e) => e.workspaceDir), env: e.env ?? process.env, ...e.runWithPluginMetadataSnapshot ? { runWithPluginMetadataSnapshot: e.runWithPluginMetadataSnapshot } : {} }); } async function runGitHubProjectHealth(e) { const { hasConfiguredGitHubApiCredential: t } = await import("./github-public-api-ynXDKSE0.mjs"); if (!t(e.env ?? process.env, e.cfg)) note("Set gateway.controlUi.github.token with gateway.controlUi.github.host matching gateway.github.host for private project access. Public github.com can also use GH_TOKEN/GITHUB_TOKEN; otherwise search is public-only.", "GitHub projects"); } async function runBrowserHealth(e) { const { collectBrowserReadinessFindings: t } = await import("./doctor-browser-VW8BGA6z.mjs"); const n = await t(e.cfg); renderStructuredHealthFindings(e, n.filter((e) => e.severity !== "info")); } async function runOpenAIOAuthTlsHealth(e) { const { noteOpenAIOAuthTlsPrerequisites: t } = await import("./provider-openai-chatgpt-oauth-tls-BlRv-B31.mjs"); await t({ cfg: e.cfg, deep: e.options.deep === true }); } async function runWhatsappResponsivenessHealth(e) { const { collectWhatsappResponsivenessHealthFindings: t } = await import("./doctor-whatsapp-responsiveness-DR0f1GZf.mjs"); renderStructuredHealthFindings(e, t({ cfg: e.cfg, status: e.gatewayStatus })); } async function runDevicePairingHealth(e) { const { collectDevicePairingHealthFindings: t } = await import("./doctor-device-pairing-HraX7elt.mjs"); renderStructuredHealthFindings(e, await t({ cfg: e.cfg, healthOk: e.healthOk ?? false, env: e.env })); } async function runGatewayDaemonHealth(e) { if (!isDefaultInstallIdentity(e.env ?? process.env)) return; if (e.cfg.gateway?.mode !== "remote") { const { noteMacDisabledGatewayLaunchAgent: t } = await import("./doctor-platform-notes-D5JnL-um.mjs"); await t(e.env ?? process.env); } if (e.gatewayMaintenanceActive) return; const { maybeRepairGatewayDaemon: t } = await import("./doctor-gateway-daemon-flow-DtegBxGC.mjs"); await t({ cfg: e.cfg, runtime: e.runtime, prompter: e.prompter, options: e.options, gatewayDetailsMessage: e.gatewayDetails?.message ?? "", healthOk: e.healthOk ?? false, healthSkipped: e.gatewayHealthSkipped === true }); } //#endregion export { runDevicePairingHealth as a, runGitHubProjectHealth as c, runSecurityHealth as d, runStartupChannelMaintenanceHealth as f, writeDoctorGatewayConfig as h, runCommandOwnerHealth as i, runHostDesktopHealth as l, runWhatsappResponsivenessHealth as m, runBundleLspEnvHealth as n, runGatewayDaemonHealth as o, runWebFetchProxyHealth as p, runClaudeCliHealth as r, runGatewayServicesHealth as s, runBrowserHealth as t, runOpenAIOAuthTlsHealth as u };