UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.47 kB
import{l as normalizeOptionalString}from"./string-coerce-CpTFcSwY.mjs";import{l as isRecord}from"./record-coerce-BTbqdJ3-.mjs";import"./string-coerce-runtime-BYDH9Quw.mjs";import{t as MANAGED_DREAMING_DECLARATION_KEY}from"./dreaming-cron-contract-D5v9Jx22.mjs"; //!extensions/memory-core/src/migration/dreaming-cron-classifier.ts function classifyDreamingCronJob(e,t){if(e.declarationKey===`memory-core:memory-dreaming-promotion`)return`declared`;if(e.declarationKey!==void 0&&e.declarationKey!==null)return;const n=normalizeOptionalString(e.name);const r=normalizeOptionalString(e.description);const i=isRecord(e.payload)?e.payload:{};const a=normalizeOptionalString(i.kind)?.toLowerCase();const o=normalizeOptionalString(a===`systemevent`?i.text:a===`agentturn`?i.message:void 0);let s;for(const[e,i,c]of[[t.LEGACY_MEMORY_LIGHT_DREAMING_CRON_NAME,t.LEGACY_MEMORY_LIGHT_DREAMING_CRON_TAG,t.LEGACY_MEMORY_LIGHT_DREAMING_EVENT_TEXT],[t.LEGACY_MEMORY_REM_DREAMING_CRON_NAME,t.LEGACY_MEMORY_REM_DREAMING_CRON_TAG,t.LEGACY_MEMORY_REM_DREAMING_EVENT_TEXT]]){if(r?.includes(i)){if(o!==c&&o!==t.MEMORY_DREAMING_SYSTEM_EVENT_TEXT)return`ambiguous`;s=`phase`}if(n===e&&a===`systemevent`&&o===c)s=`phase`}if(r?.includes(t.MANAGED_MEMORY_DREAMING_CRON_TAG)){if(o===t.MEMORY_DREAMING_SYSTEM_EVENT_TEXT)return`legacy`;return s??`ambiguous`}if(n===t.MANAGED_MEMORY_DREAMING_CRON_NAME&&o===t.MEMORY_DREAMING_SYSTEM_EVENT_TEXT)return`legacy`;return s}export{classifyDreamingCronJob as t};