UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 905 B
import{i as truncateWithMarker}from"./utf16-slice-DA3Mllbx.mjs";import{I as deriveSessionName,a as compareProcessSessionStartOrder,m as listRunningSessions}from"./bash-process-registry-BL4zA8Yf.mjs"; //!src/agents/bash-process-references.ts const DEFAULT_ACTIVE_PROCESS_LIMIT=8;const MAX_COMMAND_LABEL_CHARS=140;function listActiveProcessSessionReferences(e){const t=e.scopeKey?.trim();if(!t)return[];const n=Date.now();return listRunningSessions().filter(e=>e.scopeKey===t).toSorted(compareProcessSessionStartOrder).slice(0,DEFAULT_ACTIVE_PROCESS_LIMIT).map(e=>({sessionId:e.id,status:`running`,pid:e.pid,startedAt:e.startedAt,runtimeMs:Math.max(0,n-e.startedAt),cwd:e.cwd,command:e.command,name:truncateWithMarker(deriveSessionName(e.command)||e.command,MAX_COMMAND_LABEL_CHARS,{marker:`...`,reserve:3,trimEnd:false}),tail:e.tail,truncated:e.truncated}))}export{listActiveProcessSessionReferences as t};