UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

2 lines • 1.61 kB
//!src/agents/worktrees/gc-result.ts function formatWorktreeGcResult(e){const t=`state`in e&&e.state!==`completed`?e.state:e.outcome;const n=e.limitsSatisfied===null?`unknown`:e.limitsSatisfied?`satisfied`:`exceeded`;const r=e.issues.map(e=>`${e.id??e.stage}: ${e.reason}`).join(`; `);const i=e.issueCount-e.issues.length;return[`Managed worktree cleanup ${t}: removed ${e.removed.length}`,`deleted ${e.orphansDeleted} orphans`,`retired ${e.orphansRetired} orphan records`,...e.retiredCheckoutPaths.map(e=>`preserved checkout: ${e}`),`pruned ${e.snapshotsPruned} snapshots`,e.scratch&&`scratch (24 h): removed ${e.scratch.entriesRemoved} entries / ${e.scratch.bytesRemoved} bytes, skipped-live ${e.scratch.skippedLive}, deferred ${e.scratch.deferred}`,...(e.scratch?.errors??[]).map(e=>`scratch cleanup deferred: ${e}`),e.scratchDeferred===`io-pressure`&&`scratch cleanup deferred: host IO pressure`,e.gitMaintenance&&`Git ${e.gitMaintenance.stage}: ${e.gitMaintenance.repoRoot}`,e.gitMaintenance?.packsBefore!==void 0&&`packs ${e.gitMaintenance.packsBefore} → ${e.gitMaintenance.packsAfter??`pending`}`,e.packsRemoved!==void 0&&`removed ${e.packsRemoved} packs`,e.eligibleCount!==void 0&&`eligible ${e.eligibleCount}`,e.deferredCount!==void 0&&`deferred ${e.deferredCount}`,e.failedCount!==void 0&&`failed ${e.failedCount}`,`protected ${e.protectedCount}`,...Object.entries(e.protectionReasons).map(([e,t])=>`${e}: ${t}`),`limits ${n}`,...Object.entries(e.evictions??{}).map(([e,t])=>`${e}: ${t}`),r&&`${r}${i>0?`; plus ${i} more`:``}`].filter(Boolean).join(`; `)+`.`}export{formatWorktreeGcResult as t};