UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.37 kB
import{w as isSubagentSessionKey,y as isAcpSessionKey}from"./session-key-BPgKfU2m.mjs";import{n as DEFAULT_BOOTSTRAP_FILENAME}from"./workspace-bootstrap-policy-B71K4ysN.mjs";import{o as isWorkspaceSetupCompleted}from"./workspace-1G3FI-0P.mjs";import{t as resolveBootstrapMode}from"./bootstrap-mode-hPV56OH1.mjs"; //!src/agents/bootstrap-routing.ts function isPrimaryBootstrapRun(e){return!isSubagentSessionKey(e)&&!isAcpSessionKey(e)}async function resolveWorkspaceBootstrapRouting(e){const t=e.bootstrapFiles?.some(e=>e.name===`BOOTSTRAP.md`&&!e.missing&&typeof e.content===`string`&&e.content.trim().length>0)??false;const n=t||await e.isWorkspaceBootstrapPending(e.resolvedWorkspace);const r=resolveBootstrapMode({bootstrapPending:n,runKind:e.bootstrapContextRunKind??`default`,isInteractiveUserFacing:e.trigger===`user`||e.trigger===`manual`,isPrimaryRun:e.isPrimaryRun,isCanonicalWorkspace:(e.isCanonicalWorkspace??true)&&e.effectiveWorkspace===e.resolvedWorkspace,hasBootstrapFileAccess:e.hasBootstrapFileAccess||e.bootstrapFilesProvideAccess!==false&&t});return{bootstrapMode:r,deliversCompleteWorkspaceContext:r===`full`||!n,includeBootstrapInSystemContext:r===`full`,bootstrapCompleted:!n&&e.isPrimaryRun&&await(e.isWorkspaceSetupCompleted??isWorkspaceSetupCompleted)(e.resolvedWorkspace)}}export{resolveWorkspaceBootstrapRouting as n,isPrimaryBootstrapRun as t};