UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.46 kB
import{o as resolveGlobalSingleton}from"./global-singleton-DolL9xGt.mjs";import{r as resolveStateDir}from"./state-dir-BwIClCab.mjs";import{m as resolveConfigPath}from"./paths-D_FOvGon.mjs";import{t as resolveDefaultAgentWorkspaceDir}from"./workspace-default-path-ULYbn-EL.mjs";import"./workspace-default-Cb7cQoAN.mjs";import{AsyncLocalStorage}from"node:async_hooks"; //!src/infra/installation-target-context.ts const installationTargetContext=resolveGlobalSingleton(Symbol.for(`openclaw.installationTargetContext`),()=>new AsyncLocalStorage);const LOCAL_INSTALLATION_TARGET_UNSUPPORTED=`This runtime cannot target the diagnosed local installation. Use the saved prompt with a suggested external or manual handoff on this machine.`;function resolveInstallationTarget(e=process.env){const t=resolveStateDir(e);return Object.freeze({stateDir:t,configPath:resolveConfigPath(e,t),defaultWorkspaceDir:resolveDefaultAgentWorkspaceDir(e)})}function getInstallationTarget(){return installationTargetContext.getStore()}function installationTargetEnv(e){return e?Object.freeze({OPENCLAW_STATE_DIR:e.stateDir,OPENCLAW_CONFIG_PATH:e.configPath,OPENCLAW_WORKSPACE_DIR:e.defaultWorkspaceDir}):void 0}function withInstallationTarget(e,t){return installationTargetContext.run(e?Object.freeze({...e}):void 0,t)}export{withInstallationTarget as a,resolveInstallationTarget as i,getInstallationTarget as n,installationTargetEnv as r,LOCAL_INSTALLATION_TARGET_UNSUPPORTED as t};