@wrkrdev/runtime
v0.2.0
Published
Standalone worker-runtime state machine, scheduling, orchestration, and adapter toolkit.
Downloads
71
Maintainers
Readme
@wrkrdev/runtime
Standalone worker-runtime state machine, scheduling, orchestration, and adapter toolkit.
Install
bun add @wrkrdev/runtimeQuick start
import {
createDefaultWorkerRuntimeStateDocument,
updateWorkerRuntime,
recordWorkerTrigger,
} from '@wrkrdev/runtime';
const now = new Date().toISOString();
let runtime = createDefaultWorkerRuntimeStateDocument('project_123', now);
runtime = updateWorkerRuntime(runtime, { status: 'active', remainingRuns: 5 }, now);
const trigger = recordWorkerTrigger(runtime, {
triggerKind: 'manual_event',
triggerKey: 'manual:example',
}, now);
console.log(trigger.run.runId, trigger.run.status);Public surface
- Library: worker-runtime types, pure state-machine helpers, schedule helpers, orchestrator functions, and in-memory/Supabase/Redis adapters.
- CLI (
wrkr-runtime):status,trigger,pause,runs.
License
Apache-2.0.
