openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
28 lines (27 loc) • 1.04 kB
JavaScript
//#region src/agents/lanes.ts
/** Default lane for nested agent work. */
const AGENT_LANE_NESTED = "nested";
const AGENT_LANE_CRON_NESTED = "cron-nested";
const AGENT_LANE_SUBAGENT = "subagent";
const AGENT_LANE_CRON = "cron";
const NESTED_LANE = "nested";
const NESTED_LANE_PREFIX = `${NESTED_LANE}:`;
/** Resolves the lane for agent work started from cron. */
function resolveCronAgentLane(e) {
const t = e?.trim();
if (!t || t === AGENT_LANE_CRON) return AGENT_LANE_CRON_NESTED;
return t;
}
/** Resolves a per-session nested lane to serialize nested agent work. */
function resolveNestedAgentLaneForSession(e) {
const t = e?.trim();
if (!t) return AGENT_LANE_NESTED;
return `${NESTED_LANE_PREFIX}${t}`;
}
/** Returns true when a lane belongs to nested agent work. */
function isNestedAgentLane(e) {
if (!e) return false;
return e === NESTED_LANE || e.startsWith(NESTED_LANE_PREFIX);
}
//#endregion
export { resolveNestedAgentLaneForSession as i, isNestedAgentLane as n, resolveCronAgentLane as r, AGENT_LANE_SUBAGENT as t };