UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.11 kB
import{r as getBoundLegacyPluginSdkResourceHost}from"./legacy-sdk-resource-host-9HMZFK01.mjs";import{i as withPluginServiceSchedulerBinding}from"./service-scheduler-binding-BU5HgMWe.mjs";import{n as createPluginServiceSchedulerRunner,r as createPluginRuntimeCapabilityLease,t as createPluginServiceScheduler}from"./service-scheduler-B6d3ELFG.mjs"; //!src/plugins/cli-service-scheduler.ts function withPluginCliServiceScheduler(e,t){const n=getBoundLegacyPluginSdkResourceHost();const r=e.owner;let i;return withPluginServiceSchedulerBinding(n&&r?()=>{n.assertOpen();e.lifecycle.signal.throwIfAborted();if(!e.hasActiveCall||!e.acceptingCalls||r.revoked)throw new Error(`Plugin CLI scheduler requires its active plugin invocation`);if(!i){const t=createPluginRuntimeCapabilityLease(`plugin CLI`);i=n.run(()=>createPluginServiceScheduler(n.scheduler,createPluginServiceSchedulerRunner({...r,instance:e,lease:t})).scheduler);const a=i;const close=async()=>{a.beginClose();await a.stop();t.revoke()};n.adopt(a,{release:close});e.lifecycle.onDispose(close)}return i}:void 0,t)}export{withPluginCliServiceScheduler as t};