openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
3 lines • 6.17 kB
JavaScript
import{o as isDefaultInstallIdentity}from"./paths-D_FOvGon.mjs";import{n as NON_DEFAULT_INSTALL_SERVICE_SKIP_REASON}from"./gateway-supervision-TUZKxlq7.mjs";import{t as note}from"./note-e4DtVgg2.mjs";import{r as resolveDoctorMode}from"./doctor-health-contribution-utils-DsM0Tsf-.mjs";import{a as recordDoctorHealthWarnings,o as renderStructuredHealthFindings,s as reportDoctorHealthFinding}from"./doctor-health-contribution-CiqEIP_B.mjs";import{l as shouldManageGatewayService}from"./doctor-service-repair-policy-gYXaFNLg.mjs";import{t as resolveDoctorWorkspaceSuggestionScopes}from"./doctor-workspace-suggestion-scopes-D5b1hi0E.mjs";import{i as runWriteConfigHealth}from"./doctor-health-contribution-runners.config-cp-erA9Q.mjs";
//!src/flows/doctor-health-contribution-runners.gateway.ts
async function runCommandOwnerHealth(e){const{noteCommandOwnerHealth:t}=await import(`./doctor-command-owner-E7QTAmT9.mjs`);t(e.cfg)}async function runClaudeCliHealth(e){const{noteClaudeCliHealth:t}=await import(`./doctor-claude-cli-B6H9Q3kU.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-Z31_YG85.mjs`);await t(e.options,e.runtime,e.env??process.env);if(!isDefaultInstallIdentity(e.env??process.env)){note(NON_DEFAULT_INSTALL_SERVICE_SKIP_REASON,`Gateway`);return}const{noteMacGatewayPlatformWarnings:n}=await import(`./doctor-platform-notes-Jvc2SMUT.mjs`);await n(e.cfg,void 0,e.env??process.env);if(e.gatewayMaintenanceActive)return;const{maybeRepairNodeServiceConfig:r}=await import(`./doctor-node-services-lnw9FGlE.mjs`);await r(e.runtime,e.prompter,e.env??process.env);if(!await shouldManageGatewayService(e.env??process.env))return;const{maybeRepairGatewayServiceConfig:i,maybeResolveDuelingSystemdGatewayScopes:a,maybeScanExtraGatewayServices:o}=await import(`./doctor-gateway-services--ExSSbkI.mjs`);await o(e.options,e.runtime,e.prompter);await a(e.runtime,e.prompter);e.cfg=await i(e.cfg,resolveDoctorMode(e.cfg),e.runtime,e.prompter,{allowExecSecretRefs:e.options.allowExec===true,onFinding:t=>reportDoctorHealthFinding(e,t),writeConfig:t=>writeDoctorGatewayConfig(e,t)})}async function runHostDesktopHealth(e){const{noteHostDesktopHealth:t}=await import(`./doctor-host-desktop-C5Xoqo9a.mjs`);await t(e.cfg,{prompter:e.prompter})}async function runStartupChannelMaintenanceHealth(e){const{maybeRunDoctorStartupChannelMaintenance:t}=await import(`./doctor-startup-channel-maintenance-CQxcCfKP.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-DBoJI4Um.mjs`);const{noteSecurityWarnings:n}=await import(`./doctor-security--9-omS27.mjs`);const{securityAuditFindingToHealthFinding:r}=await import(`./health-check-adapter-CukVYkxo.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-8QoW_pa8.mjs`);await t({cfg:e.cfg,env:e.env??process.env})}async function runBundleLspEnvHealth(e){const{noteBundleLspEnvPassthrough:t}=await import(`./doctor-bundle-lsp-env-BTU6tA3G.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-DN-W1ais.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-mZucsZ8Y.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-BQfn3oFX.mjs`);await t({cfg:e.cfg,deep:e.options.deep===true})}async function runWhatsappResponsivenessHealth(e){const{collectWhatsappResponsivenessHealthFindings:t}=await import(`./doctor-whatsapp-responsiveness-Bd-Tm8ZZ.mjs`);renderStructuredHealthFindings(e,t({cfg:e.cfg,status:e.gatewayStatus}))}async function runDevicePairingHealth(e){const{collectDevicePairingHealthFindings:t}=await import(`./doctor-device-pairing-Bix-yic_.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-Jvc2SMUT.mjs`);await t(e.env??process.env)}if(e.gatewayMaintenanceActive)return;const{maybeRepairGatewayDaemon:t}=await import(`./doctor-gateway-daemon-flow-0lADOpFE.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})}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};