actor-kit
Version:
Actor Kit is a library for running state machines in Cloudflare Workers, leveraging XState for robust state management. It provides a framework for managing the logic, lifecycle, persistence, synchronization, and access control of actors in a distributed
22 lines (18 loc) • 685 B
text/typescript
import { CallerType } from "./types";
export const HEADERS = {
X_CALLER_ID: "X-Caller-ID",
X_CALLER_TYPE: "X-Caller-Type",
X_ACTOR_ID: "X-Actor-ID",
X_ACTOR_TYPE: "X-Actor-Type",
};
/**
* Defines the types of callers that can interact with the actor system.
* Each type represents a different source of events with varying levels of trust and permissions.
* Note: SYSTEM events are handled internally by Actor Kit and are not defined by the user.
*/
export const CallerTypes: Record<CallerType, CallerType> = {
client: "client",
system: "system", // Handled internally by Actor Kit
service: "service",
};
export const PERSISTED_SNAPSHOT_KEY = "persistedSnapshot";