UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.05 kB
import{E as parseStrictNonNegativeInteger}from"./number-coercion-B3CfI447.mjs";import{o as writeRuntimeJson}from"./runtime-DIcLIHcp.mjs";import{r as terminalText}from"./safe-text-B_QTgn0s.mjs";import{n as throwExpectedCliError}from"./expected-cli-error-oDVmXYil.mjs";import{a as recordBackupOutcomeBestEffort}from"./backup-shared-CVcoDGTC.mjs"; //!src/commands/backup-record.ts async function backupRecordCommand(e,t){if(t.status!==`ok`&&t.status!==`failed`)throwExpectedCliError(`--status must be ok or failed.`);const n=t.target?.trim();if(!n)throwExpectedCliError(`Missing required --target label.`);const r=t.bytes===void 0?void 0:parseStrictNonNegativeInteger(t.bytes);if(r===void 0&&t.bytes!==void 0)throwExpectedCliError(`--bytes must be a nonnegative integer.`);const i={kind:`external`,archivePath:n,target:n,status:t.status,...r!==void 0?{bytes:r}:{},...t.error?{error:t.error}:{}};await recordBackupOutcomeBestEffort(e,i);if(t.json)writeRuntimeJson(e,i);else e.log(terminalText`External backup: ${n} (${t.status})`)}export{backupRecordCommand};