---
title: Local providers API
description: Generated public TypeScript reference for @relkit/providers-local.
search:
  exclude: true
sidebar:
  icon: braces
---

{/* Generated by apps/docs/scripts/generate.ts. Do not edit. */}

For configuration and examples, read [local providers](/docs/modules/integrations/local-providers).

## Public imports

- `@relkit/providers-local` — 217 exports

## All exported APIs

Names link to their complete contracts. Re-exports share their original contract; legacy exports keep their separate identity. Examples link to the API's inline sample, a maintained repository usage, or the shared module walkthrough.

| API                                                                                                       | Kind  | Import from               | Example                                                                                                                                            |
| --------------------------------------------------------------------------------------------------------- | ----- | ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| [AgentStateStore](/docs/api/providers-local#agentstatestore-interface)                                    | Type  | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/agent-state-failure/fixture.ts#L143)                   |
| [applyRetry](/docs/api/providers-local#applyretry)                                                        | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/jobs-retry.test.ts#L49)                                |
| [assertActive](/docs/api/providers-local#assertactive)                                                    | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [assertContainedPath](/docs/api/providers-local#assertcontainedpath)                                      | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [assertTime](/docs/api/providers-local#asserttime)                                                        | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [byteLength](/docs/api/providers-local#bytelength)                                                        | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [calculateRetryDelay](/docs/api/providers-local#calculateretrydelay)                                      | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/jobs-retry.test.ts#L21)                                |
| [checkpoint](/docs/api/providers-local#checkpoint)                                                        | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [classifyFailure](/docs/api/providers-local#classifyfailure)                                              | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [clone](/docs/api/providers-local#clone)                                                                  | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [CompiledSchedule](/docs/api/providers-local#compiledschedule-interface)                                  | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [compileSchedule](/docs/api/providers-local#compileschedule-1)                                            | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/jobs-scheduler.test.ts#L10)                            |
| [createAgentStateProviderFromStore](/docs/api/providers-local#createagentstateproviderfromstore)          | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/agent-state-failure/fixture.ts#L43)                    |
| [createEphemeralDelivery](/docs/api/providers-local#createephemeraldelivery)                              | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/events-ephemeral.test.ts#L53)                          |
| [createEventAdmin](/docs/api/providers-local#createeventadmin)                                            | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/events-admin.test.ts#L45)                              |
| [createEventDelivery](/docs/api/providers-local#createeventdelivery)                                      | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/events-delivery.test.ts#L44)                           |
| [createEventLog](/docs/api/providers-local#createeventlog)                                                | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/events-log.test.ts#L13)                                |
| [createEventLogPaths](/docs/api/providers-local#createeventlogpaths)                                      | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [createEventRouter](/docs/api/providers-local#createeventrouter)                                          | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/events-admin.test.ts#L17)                              |
| [createJobAdmin](/docs/api/providers-local#createjobadmin)                                                | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/jobs-admin.test.ts#L31)                                |
| [createJobQueue](/docs/api/providers-local#createjobqueue)                                                | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/engine/tests/server-runtime/background-observation-fixture.ts#L18)           |
| [createJobStore](/docs/api/providers-local#createjobstore-1)                                              | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/engine/tests/server-runtime/background-observation-fixture.ts#L17)           |
| [createLocalAgentStateProvider](/docs/api/providers-local#createlocalagentstateprovider)                  | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/agent-state-failure/continuation-recovery.case.ts#L82) |
| [createLocalBucketProvider](/docs/api/providers-local#createlocalbucketprovider)                          | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [createLocalBucketProviderForTest](/docs/api/providers-local#createlocalbucketproviderfortest)            | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/apps/docs/examples/public-api/local.ts#L8)                                            |
| [createLocalCacheInspector](/docs/api/providers-local#createlocalcacheinspector)                          | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [createLocalCacheKey](/docs/api/providers-local#createlocalcachekey)                                      | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/cache.test.ts#L19)                                     |
| [createLocalCacheProvider](/docs/api/providers-local#createlocalcacheprovider)                            | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/cache.test.ts#L7)                                      |
| [createLocalCacheProviderForTest](/docs/api/providers-local#createlocalcacheprovider)                     | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/cache.test.ts#L7)                                      |
| [createLocalEventProvider](/docs/api/providers-local#createlocaleventprovider)                            | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/tests/integration/event-publication.test.ts#L11)                                      |
| [createLocalJobProvider](/docs/api/providers-local#createlocaljobprovider)                                | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/runtime-hono/tests/jobs-native-projection.test.ts#L42)                       |
| [createLocalObservabilityProvider](/docs/api/providers-local#createlocalobservabilityprovider)            | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [createLocalRealtimeProvider](/docs/api/providers-local#createlocalrealtimeprovider)                      | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/realtime.test.ts#L11)                                  |
| [createRealtimeProviderFromStore](/docs/api/providers-local#createrealtimeproviderfromstore)              | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [createScheduler](/docs/api/providers-local#createscheduler-1)                                            | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/jobs-scheduler.test.ts#L38)                            |
| [DEFAULT_BUCKET_PAGE_SIZE](/docs/api/providers-local#default_bucket_page_size)                            | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [DEFAULT_EPHEMERAL_CAPACITY](/docs/api/providers-local#default_ephemeral_capacity)                        | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [DurableEventDeliveryResult](/docs/api/providers-local#eventdeliveryresult-interface)                     | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [emptyAgentState](/docs/api/providers-local#emptyagentstate)                                              | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/effect/agent-state-read-errors.test.ts#L16)            |
| [emptyPartition](/docs/api/providers-local#emptypartition)                                                | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [emptyRealtimeState](/docs/api/providers-local#emptyrealtimestate)                                        | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/effect/fixtures.ts#L17)                                |
| [encodeBucketKey](/docs/api/providers-local#encodebucketkey)                                              | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [encodedBytes](/docs/api/providers-local#encodedbytes)                                                    | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EPHEMERAL_DELIVERY_CAPABILITIES](/docs/api/providers-local#ephemeral_delivery_capabilities)              | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EphemeralDelivery](/docs/api/providers-local#ephemeraldelivery-interface)                                | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EphemeralDeliveryResult](/docs/api/providers-local#ephemeraldeliveryresult-interface)                    | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EphemeralDeliverySnapshot](/docs/api/providers-local#ephemeraldeliverysnapshot-interface)                | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EVENT_ADMIN_PROTOCOL](/docs/api/providers-local#event_admin_protocol)                                    | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EVENT_ADMIN_VERSION](/docs/api/providers-local#event_admin_version)                                      | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EVENT_DELIVERY_CAPABILITIES](/docs/api/providers-local#event_delivery_capabilities)                      | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EVENT_DELIVERY_VERSION](/docs/api/providers-local#event_delivery_version)                                | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EVENT_LOG_VERSION](/docs/api/providers-local#event_log_version)                                          | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventAdmin](/docs/api/providers-local#eventadmin-interface)                                              | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventAdminAction](/docs/api/providers-local#eventadminaction-type-alias)                                 | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventAdminActionContract](/docs/api/providers-local#eventadminactioncontract-interface)                  | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventAdminActionOutcome](/docs/api/providers-local#eventadminactionoutcome-type-alias)                   | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventAdminActionRecord](/docs/api/providers-local#eventadminactionrecord-interface)                      | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventAdminActionRequest](/docs/api/providers-local#eventadminactionrequest-interface)                    | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventAdminActionSink](/docs/api/providers-local#eventadminactionsink-type-alias)                         | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventAdminError](/docs/api/providers-local#eventadminerror-class)                                        | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventAdminMode](/docs/api/providers-local#eventadminmode-type-alias)                                     | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventAdminOptions](/docs/api/providers-local#eventadminoptions-interface)                                | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventAdminVersion](/docs/api/providers-local#eventadminversion-interface)                                | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventContract](/docs/api/providers-local#eventcontract-interface)                                        | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventContractInput](/docs/api/providers-local#eventcontractinput-interface)                              | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventDeadLetterContract](/docs/api/providers-local#eventdeadlettercontract-interface)                    | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventDelivery](/docs/api/providers-local#eventdelivery-interface)                                        | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventDeliveryBinding](/docs/api/providers-local#eventdeliverybinding-interface)                          | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventDeliveryBoundary](/docs/api/providers-local#eventdeliveryboundary-type-alias)                       | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventDeliveryContract](/docs/api/providers-local#eventdeliverycontract-interface)                        | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventDeliveryLedgerRecord](/docs/api/providers-local#eventdeliveryledgerrecord-interface)                | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventDeliveryOptions](/docs/api/providers-local#eventdeliveryoptions-interface)                          | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventDeliveryRecord](/docs/api/providers-local#eventdeliveryrecord-interface)                            | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventDeliveryResult](/docs/api/providers-local#eventdeliveryresult-interface-1)                          | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventDeliverySnapshot](/docs/api/providers-local#eventdeliverysnapshot-interface)                        | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventFanoutResult](/docs/api/providers-local#eventfanoutresult-interface)                                | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventLog](/docs/api/providers-local#eventlog-interface)                                                  | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventLogBoundary](/docs/api/providers-local#eventlogboundary-type-alias)                                 | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventLogInput](/docs/api/providers-local#eventloginput-type-alias)                                       | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventLogOptions](/docs/api/providers-local#eventlogoptions-interface)                                    | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventLogPaths](/docs/api/providers-local#eventlogpaths-type-alias)                                       | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventLogRecord](/docs/api/providers-local#eventlogrecord-interface)                                      | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventLogSnapshot](/docs/api/providers-local#eventlogsnapshot-interface)                                  | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventLogStateError](/docs/api/providers-local#eventlogstateerror-class)                                  | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventPublicationContract](/docs/api/providers-local#eventpublicationcontract-interface)                  | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventQueryContract](/docs/api/providers-local#eventquerycontract-interface)                              | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventQueryRequest](/docs/api/providers-local#eventqueryrequest-interface)                                | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventRetryRequest](/docs/api/providers-local#eventretryrequest-type-alias)                               | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventRouter](/docs/api/providers-local#eventrouter-interface)                                            | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventRouterInput](/docs/api/providers-local#eventrouterinput-type-alias)                                 | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventRouterOptions](/docs/api/providers-local#eventrouteroptions-interface)                              | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventRouterRouteOptions](/docs/api/providers-local#eventrouterrouteoptions-interface)                    | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventRouterSnapshot](/docs/api/providers-local#eventroutersnapshot-interface)                            | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventRouterStateError](/docs/api/providers-local#eventrouterstateerror-class)                            | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventRouterTrigger](/docs/api/providers-local#eventroutertrigger-interface)                              | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventTriggerCapabilityContract](/docs/api/providers-local#eventtriggercapabilitycontract-interface)      | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventTriggerContract](/docs/api/providers-local#eventtriggercontract-interface)                          | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventTriggerSnapshot](/docs/api/providers-local#eventtriggersnapshot-interface)                          | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [EventVersioned](/docs/api/providers-local#eventversioned-interface)                                      | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JOB_ADMIN_PROTOCOL](/docs/api/providers-local#job_admin_protocol)                                        | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JOB_ADMIN_VERSION](/docs/api/providers-local#job_admin_version)                                          | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JOB_QUEUE_STATES](/docs/api/providers-local#job_queue_states)                                            | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobActionContract](/docs/api/providers-local#jobactioncontract-interface)                                | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobActionRequest](/docs/api/providers-local#jobactionrequest-interface)                                  | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobAdmin](/docs/api/providers-local#jobadmin-interface)                                                  | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobAdminAction](/docs/api/providers-local#jobadminaction-type-alias)                                     | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobAdminActionOutcome](/docs/api/providers-local#jobadminactionoutcome-type-alias)                       | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobAdminActionRecord](/docs/api/providers-local#jobadminactionrecord-interface)                          | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobAdminActionSink](/docs/api/providers-local#jobadminactionsink-type-alias)                             | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobAdminError](/docs/api/providers-local#jobadminerror-class)                                            | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobAdminMode](/docs/api/providers-local#jobadminmode-type-alias)                                         | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobAdminOptions](/docs/api/providers-local#jobadminoptions-interface)                                    | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobAdminVersion](/docs/api/providers-local#jobadminversion-interface)                                    | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobCancelRequest](/docs/api/providers-local#jobcancelrequest-type-alias)                                 | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobDeadLetterRequest](/docs/api/providers-local#jobdeadletterrequest-type-alias)                         | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobFailureKind](/docs/api/providers-local#jobfailurekind-type-alias)                                     | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobFailureMetadata](/docs/api/providers-local#jobfailuremetadata-interface)                              | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobFailureOutcome](/docs/api/providers-local#jobfailureoutcome-type-alias)                               | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobFailureRetry](/docs/api/providers-local#jobfailureretry-type-alias)                                   | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobIdempotencyDefinition](/docs/api/providers-local#jobidempotencydefinition-interface)                  | Type  | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/tests/contracts/jobs.ts#L46)                                                          |
| [JobIdempotencyRecord](/docs/api/providers-local#jobidempotencyrecord-interface)                          | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobQueryContract](/docs/api/providers-local#jobquerycontract-interface)                                  | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobQueryRequest](/docs/api/providers-local#jobqueryrequest-interface)                                    | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobQueue](/docs/api/providers-local#jobqueue-interface)                                                  | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobQueueAcceptance](/docs/api/providers-local#jobqueueacceptance-interface)                              | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobQueueAdminRetryOptions](/docs/api/providers-local#jobqueueadminretryoptions-interface)                | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobQueueCounts](/docs/api/providers-local#jobqueuecounts-type-alias)                                     | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobQueueEnqueue](/docs/api/providers-local#jobqueueenqueue-interface)                                    | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobQueueEntry](/docs/api/providers-local#jobqueueentry-interface)                                        | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobQueueLeaseOptions](/docs/api/providers-local#jobqueueleaseoptions-interface)                          | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobQueueOptions](/docs/api/providers-local#jobqueueoptions-interface)                                    | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobQueueState](/docs/api/providers-local#jobqueuestate-type-alias)                                       | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobQueueStateError](/docs/api/providers-local#jobqueuestateerror-class)                                  | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobQueueTransitionOptions](/docs/api/providers-local#jobqueuetransitionoptions-interface)                | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobRecord](/docs/api/providers-local#jobrecord-type-alias)                                               | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobRecordInput](/docs/api/providers-local#jobrecordinput-interface)                                      | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobRetryRequest](/docs/api/providers-local#jobretryrequest-type-alias)                                   | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobState](/docs/api/providers-local#jobstate-type-alias)                                                 | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobStatusContract](/docs/api/providers-local#jobstatuscontract-interface)                                | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobStore](/docs/api/providers-local#jobstore-interface)                                                  | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobStoreBoundary](/docs/api/providers-local#jobstoreboundary-type-alias)                                 | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobStoreCheckpoint](/docs/api/providers-local#jobstorecheckpoint-type-alias)                             | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobStoreIndex](/docs/api/providers-local#jobstoreindex-type-alias)                                       | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobStoreOptions](/docs/api/providers-local#jobstoreoptions-interface)                                    | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [JobStoreSnapshot](/docs/api/providers-local#jobstoresnapshot-interface)                                  | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LOCAL_AGENT_STATE_VERSION](/docs/api/providers-local#local_agent_state_version)                          | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LOCAL_BUCKET_CAPABILITIES](/docs/api/providers-local#local_bucket_capabilities)                          | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LOCAL_BUCKET_RESERVED_PREFIXES](/docs/api/providers-local#local_bucket_reserved_prefixes)                | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LOCAL_CACHE_CAPABILITIES](/docs/api/providers-local#local_cache_capabilities)                            | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LOCAL_CACHE_DURABLE_CAPABILITIES](/docs/api/providers-local#local_cache_durable_capabilities)            | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LOCAL_REALTIME_STATE_VERSION](/docs/api/providers-local#local_realtime_state_version)                    | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalAgentState](/docs/api/providers-local#localagentstate-type-alias)                                   | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalAgentStateProviderOptions](/docs/api/providers-local#localagentstateprovideroptions-interface)      | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalBucketKeyError](/docs/api/providers-local#localbucketkeyerror-class)                                | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/buckets.test.ts#L59)                                   |
| [LocalBucketListOptions](/docs/api/providers-local#localbucketlistoptions-interface)                      | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalBucketListPage](/docs/api/providers-local#localbucketlistpage-interface)                            | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalBucketObjectMetadata](/docs/api/providers-local#localbucketobjectmetadata-interface)                | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalBucketPaginationError](/docs/api/providers-local#localbucketpaginationerror-class)                  | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalBucketPolicy](/docs/api/providers-local#localbucketpolicy-interface)                                | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalBucketPolicyError](/docs/api/providers-local#localbucketpolicyerror-class)                          | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/buckets.test.ts#L63)                                   |
| [LocalBucketProvider](/docs/api/providers-local#localbucketprovider-type-alias)                           | Type  | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/buckets.test.ts#L121)                                  |
| [LocalBucketProviderOptions](/docs/api/providers-local#localbucketprovideroptions-interface)              | Type  | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/buckets.test.ts#L119)                                  |
| [LocalBucketStateError](/docs/api/providers-local#localbucketstateerror-class)                            | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalBucketUnsupportedCapability](/docs/api/providers-local#localbucketunsupportedcapability-type-alias) | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalCacheCapabilities](/docs/api/providers-local#localcachecapabilities-interface)                      | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalCacheEvictionPolicy](/docs/api/providers-local#localcacheevictionpolicy-type-alias)                 | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalCacheKeyError](/docs/api/providers-local#localcachekeyerror-class)                                  | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalCachePolicy](/docs/api/providers-local#localcachepolicy-interface)                                  | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalCachePolicyError](/docs/api/providers-local#localcachepolicyerror-class)                            | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalCacheProvider](/docs/api/providers-local#localcacheprovider-type-alias)                             | Type  | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/tests/contracts/cache.test.ts#L54)                                                    |
| [LocalCacheProviderOptions](/docs/api/providers-local#localcacheprovideroptions-interface)                | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalCacheRead](/docs/api/providers-local#localcacheread-interface)                                      | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalCacheSnapshot](/docs/api/providers-local#localcachesnapshot-interface)                              | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalCacheStateError](/docs/api/providers-local#localcachestateerror-class)                              | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalCacheStore](/docs/api/providers-local#localcachestore-class)                                        | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalCacheStoreEntry](/docs/api/providers-local#localcachestoreentry-interface)                          | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalCacheStoreSnapshot](/docs/api/providers-local#localcachestoresnapshot-interface)                    | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalCacheStoreState](/docs/api/providers-local#localcachestorestate-interface)                          | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalCacheValueError](/docs/api/providers-local#localcachevalueerror-class)                              | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalEventProvider](/docs/api/providers-local#localeventprovider-interface)                              | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalJobProvider](/docs/api/providers-local#localjobprovider-interface)                                  | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalRealtimeError](/docs/api/providers-local#localrealtimeerror-class)                                  | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalRealtimeProviderOptions](/docs/api/providers-local#localrealtimeprovideroptions-interface)          | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [LocalRealtimeState](/docs/api/providers-local#localrealtimestate-type-alias)                             | Type  | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/effect/fixtures.ts#L22)                                |
| [MAX_BUCKET_PAGE_SIZE](/docs/api/providers-local#max_bucket_page_size)                                    | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [MISSING](/docs/api/providers-local#missing)                                                              | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [MutableQueueState](/docs/api/providers-local#mutablequeuestate-interface)                                | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [normalizeBucketKey](/docs/api/providers-local#normalizebucketkey)                                        | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [normalizeBucketPrefix](/docs/api/providers-local#normalizebucketprefix)                                  | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [normalizeCacheId](/docs/api/providers-local#normalizecacheid)                                            | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [normalizePolicy](/docs/api/providers-local#normalizepolicy)                                              | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [normalizeSchemaVersion](/docs/api/providers-local#normalizeschemaversion)                                | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [normalizeTtl](/docs/api/providers-local#normalizettl)                                                    | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [paginateKeys](/docs/api/providers-local#paginatekeys)                                                    | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [partitionKey](/docs/api/providers-local#partitionkey)                                                    | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [planRetry](/docs/api/providers-local#planretry)                                                          | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/jobs-retry.test.ts#L128)                               |
| [prunePartition](/docs/api/providers-local#prunepartition)                                                | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [RandomSource](/docs/api/providers-local#randomsource-type-alias)                                         | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [readClock](/docs/api/providers-local#readclock)                                                          | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [RealtimeStateStore](/docs/api/providers-local#realtimestatestore-interface)                              | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [RetryClassification](/docs/api/providers-local#retryclassification-type-alias)                           | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [RetryOptions](/docs/api/providers-local#retryoptions-interface)                                          | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [RetryPlan](/docs/api/providers-local#retryplan-interface)                                                | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [RetryState](/docs/api/providers-local#retrystate-type-alias)                                             | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [safeFailureMetadata](/docs/api/providers-local#safefailuremetadata)                                      | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [ScheduleEnqueue](/docs/api/providers-local#scheduleenqueue-type-alias)                                   | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [ScheduleEnqueueContext](/docs/api/providers-local#scheduleenqueuecontext-interface)                      | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [Scheduler](/docs/api/providers-local#scheduler-interface)                                                | Type  | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/tests/contracts/jobs.ts#L58)                                                          |
| [SchedulerClock](/docs/api/providers-local#schedulerclock-interface)                                      | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [SchedulerOptions](/docs/api/providers-local#scheduleroptions-interface)                                  | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [SchedulerRegistration](/docs/api/providers-local#schedulerregistration-interface)                        | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [ScheduleRun](/docs/api/providers-local#schedulerun-interface)                                            | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [ScheduleValidationError](/docs/api/providers-local#schedulevalidationerror-class)                        | Value | `@relkit/providers-local` | [Source example](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/tests/jobs-scheduler.test.ts#L21)                            |
| [scopeGap](/docs/api/providers-local#scopegap)                                                            | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [serializeLocalCacheValue](/docs/api/providers-local#serializelocalcachevalue)                            | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [StoredLocalBucketObject](/docs/api/providers-local#storedlocalbucketobject-type-alias)                   | Type  | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |
| [transitions](/docs/api/providers-local#transitions)                                                      | Value | `@relkit/providers-local` | [Module example](/docs/modules/integrations/local-providers)                                                                                       |

## `provider.ts`

Composes filesystem-backed agent-state operations and their Promise compatibility boundary.

### LocalAgentStateProviderOptions

**Signature**

```ts
declare const LocalAgentStateProviderOptions: LocalAgentStateProviderOptions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/provider.ts#L19)

### LocalAgentStateService (class)

Local agent state operations with substitutable transactional storage.

**Signature**

```ts
declare class LocalAgentStateService
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/provider.ts#L54)

### agentStateLayer

Builds the live agent-state layer without starting background work.

**Example**

```ts
import { Effect } from "effect";
import { LocalAgentStateService, agentStateLayer } from "./provider.js";

const program = Effect.gen(function* () {
  const agents = yield* LocalAgentStateService;
  return yield* agents.getEpoch();
});
await Effect.runPromise(program.pipe(Effect.provide(agentStateLayer("/tmp/example-agents"))));
```

**Signature**

```ts
declare const agentStateLayer: (
  root: string,
  pollingMs?: number,
) => Layer.Layer<LocalAgentStateService, LocalOperationError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/provider.ts#L79)

### createAgentStateProviderFromStore

Substitutes storage while preserving the same public agent-state operations.

**Signature**

```ts
declare const createAgentStateProviderFromStore: (
  store: ReturnType<typeof createAgentStateStore>,
  pollingMs?: number,
) => AgentStateProvider;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/provider.ts#L42)

### createLocalAgentStateProvider

Creates the filesystem-backed agent-state compatibility provider.

**Signature**

```ts
declare const createLocalAgentStateProvider: (
  root: string,
  options?: LocalAgentStateProviderOptions,
) => AgentStateProvider;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/provider.ts#L27)

### makeAgentStateService

Composes agent operations over a replaceable state store.

**Signature**

```ts
declare const makeAgentStateService: (
  store: AgentStateStoreEffects,
  pollingMs?: number,
) => AgentStateEffects;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/provider.ts#L89)

## `provider.types.ts`

Defines the Effect operation contract and bounded polling options for local agent state.

### AgentStateEffects (type alias)

Effect counterpart of the established public agent-state provider methods.

**Signature**

```ts
type AgentStateEffects = {
  readonly [K in keyof AgentStateProvider]: AgentStateProvider[K] extends (
    ...args: infer A
  ) => infer R
    ? (...args: A) => Effect.Effect<Awaited<R>, LocalOperationError>
    : AgentStateProvider[K];
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/provider.types.ts#L12)

### LocalAgentStateProviderOptions (interface)

Polling policy for observing updates from other agent-state processes.

**Signature**

```ts
export interface LocalAgentStateProviderOptions {
  readonly pollingMs?: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/provider.types.ts#L7)

## `state.ts`

### LOCAL_AGENT_STATE_VERSION

**Signature**

```ts
declare const LOCAL_AGENT_STATE_VERSION: 1;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/state.ts#L18)

### LocalAgentState

**Signature**

```ts
declare const LocalAgentState: {
  readonly version: 1;
  readonly providerEpoch: string;
  readonly revision: number;
  readonly threads: {
    readonly [x: string]: {
      readonly thread: {
        readonly threadId: string;
        readonly agentId: string;
        readonly ownerScope: string;
        readonly status:
          | "idle"
          | "running"
          | "waiting"
          | "approval-interrupted"
          | "stopping"
          | "worker-interrupted";
        readonly revision: string;
        readonly createdAt: string;
        readonly updatedAt: string;
      };
      readonly runs: {
        readonly [x: string]: {
          readonly status:
            | "running"
            | "waiting"
            | "approval-interrupted"
            | "stopping"
            | "worker-interrupted"
            | "accepted"
            | "succeeded"
            | "failed"
            | "cancelled";
          readonly threadId: string;
          readonly runId: string;
          readonly owner: {
            readonly generationId: string;
            readonly publicFingerprint: string;
            readonly protocolVersion: number;
            readonly schemaVersion: number;
            readonly providerScope: string;
          };
          readonly operationId: OperationId;
          readonly inputDigest: string;
          readonly acceptedAt: string;
          readonly maxJournalBytes: number;
          readonly maxJournalRecordBytes: number;
          readonly terminalReserveBytes: number;
          readonly settledAt?: string;
          readonly outcome?: "worker-interrupted" | "succeeded" | "failed" | "cancelled";
        };
      };
      readonly messages: ReadonlyArray<{
        readonly createdAt: string;
        readonly role: "user" | "assistant" | "tool";
        readonly parts: ReadonlyArray<
          | {
              readonly kind: "text";
              readonly text: string;
              readonly partId: string;
              readonly state?: "streaming" | "complete";
            }
          | {
              readonly kind: "tool";
              readonly state:
                | "running"
                | "succeeded"
                | "failed"
                | "started"
                | "input-streaming"
                | "input-ready"
                | "approval-required"
                | "denied";
              readonly partId: string;
              readonly toolCallId: string;
              readonly toolId: string;
              readonly inputText?: string;
              readonly input?: unknown;
              readonly output?: unknown;
              readonly value?: unknown;
            }
          | {
              readonly partId: string;
              readonly kind: "progress";
              readonly value: unknown;
              readonly scope: "run";
            }
          | {
              readonly partId: string;
              readonly kind: "progress";
              readonly value: unknown;
              readonly scope: "tool";
              readonly toolCallId: string;
              readonly toolId: string;
            }
        >;
        readonly messageId: string;
        readonly runId?: string;
      }>;
      readonly approvals: ReadonlyArray<{
        readonly status: "cancelled" | "denied" | "open" | "approved";
        readonly runId: string;
        readonly approvalId: string;
        readonly interruptSetDigest: string;
        readonly publicRequest: unknown;
        readonly interruptSetSize?: number;
      }>;
      readonly journal: ReadonlyArray<{
        readonly recordId: string;
        readonly runId: string;
        readonly kind:
          "progress" | "message" | "approval" | "control" | "terminal" | "interruption" | "event";
        readonly publicValue: unknown;
        readonly checkpoint: {
          readonly applicationId: string;
          readonly environment: string;
          readonly profile: string;
          readonly providerEpoch: string;
          readonly threadId: string;
          readonly sequence: string;
        };
        readonly encodedBytes: number;
        readonly createdAt: string;
      }>;
      readonly sequence: number;
      readonly controls: {
        readonly [x: string]: {
          readonly sequence: number;
          readonly record: {
            readonly status: "accepted" | "cancelled" | "processing" | "applied" | "rejected";
            readonly runId: string;
            readonly acceptedAt: string;
            readonly kind: "steer" | "follow-up" | "stop" | "approve";
            readonly controlId: OperationId;
            readonly semanticDigest: string;
            readonly effect: "not-started" | "confirmed" | "unknown";
            readonly settledAt?: string;
            readonly publicPayload?: unknown;
          };
          readonly publicPayload: unknown;
          readonly semanticDigest: string;
          readonly receipt: {
            readonly operationId: OperationId;
            readonly threadId: string;
            readonly runId: string;
            readonly status: "accepted" | "cancelled" | "processing" | "applied" | "rejected";
            readonly effect: "not-started" | "confirmed" | "unknown";
            readonly duplicate: boolean;
          };
          readonly expiresAt: string;
          readonly downstreamOperationId?: string;
        };
      };
      readonly runClaims: {
        readonly [x: string]: {
          readonly runId: string;
          readonly claimId: string;
          readonly workerId: string;
          readonly generationId: string;
          readonly fence: number;
          readonly expiresAt: string;
        };
      };
      readonly controlClaims: {
        readonly [x: string]: {
          readonly controlId: OperationId;
          readonly claimId: string;
          readonly workerId: string;
          readonly generationId: string;
          readonly fence: number;
          readonly expiresAt: string;
        };
      };
      readonly scopeKey: string;
      readonly controlSequence: number;
      readonly nextFence: number;
      readonly waiting?: {
        readonly revision: string;
        readonly runId: string;
        readonly response: Json;
        readonly requests: ReadonlyArray<{
          readonly node: string;
          readonly response: Json;
          readonly value?: unknown;
        }>;
      };
      readonly activeRunId?: string;
      readonly snapshots?: {
        readonly [x: string]: {
          readonly createdAt: string;
          readonly messages: ReadonlyArray<{
            readonly createdAt: string;
            readonly role: "user" | "assistant" | "tool";
            readonly parts: ReadonlyArray<
              | {
                  readonly kind: "text";
                  readonly text: string;
                  readonly partId: string;
                  readonly state?: "streaming" | "complete";
                }
              | {
                  readonly kind: "tool";
                  readonly state:
                    | "running"
                    | "succeeded"
                    | "failed"
                    | "started"
                    | "input-streaming"
                    | "input-ready"
                    | "approval-required"
                    | "denied";
                  readonly partId: string;
                  readonly toolCallId: string;
                  readonly toolId: string;
                  readonly inputText?: string;
                  readonly input?: unknown;
                  readonly output?: unknown;
                  readonly value?: unknown;
                }
              | {
                  readonly partId: string;
                  readonly kind: "progress";
                  readonly value: unknown;
                  readonly scope: "run";
                }
              | {
                  readonly partId: string;
                  readonly kind: "progress";
                  readonly value: unknown;
                  readonly scope: "tool";
                  readonly toolCallId: string;
                  readonly toolId: string;
                }
            >;
            readonly messageId: string;
            readonly runId?: string;
          }>;
        };
      };
    };
  };
  readonly createReceipts: {
    readonly [x: string]: { readonly digest: string; readonly threadId: string };
  };
  readonly runReceipts: {
    readonly [x: string]: {
      readonly semanticDigest: string;
      readonly expiresAt: string;
      readonly value:
        | {
            readonly operationId: OperationId;
            readonly threadId: string;
            readonly runId: string;
            readonly status: "accepted";
            readonly duplicate: boolean;
          }
        | {
            readonly operationId: OperationId;
            readonly threadId: string;
            readonly runId: string;
            readonly status: "succeeded" | "failed" | "cancelled";
            readonly checkpoint: {
              readonly applicationId: string;
              readonly environment: string;
              readonly profile: string;
              readonly providerEpoch: string;
              readonly threadId: string;
              readonly sequence: string;
            };
            readonly duplicate: boolean;
          };
    };
  };
  readonly controlReceipts: {
    readonly [x: string]: {
      readonly semanticDigest: string;
      readonly expiresAt: string;
      readonly value: {
        readonly operationId: OperationId;
        readonly threadId: string;
        readonly runId: string;
        readonly status: "accepted" | "cancelled" | "processing" | "applied" | "rejected";
        readonly effect: "not-started" | "confirmed" | "unknown";
        readonly duplicate: boolean;
      };
    };
  };
  readonly continuationReceipts: {
    readonly [x: string]: {
      readonly semanticDigest: string;
      readonly expiresAt: string;
      readonly value: {
        readonly threadId: string;
        readonly runId: string;
        readonly operationId: OperationId;
        readonly interruptSetDigest: string;
        readonly duplicate: boolean;
        readonly interruptedRunId: string;
        readonly waitingRevision?: string;
      };
    };
  };
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/state.ts#L15)

### LocalAgentThread

**Signature**

```ts
declare const LocalAgentThread: {
  readonly thread: {
    readonly threadId: string;
    readonly agentId: string;
    readonly ownerScope: string;
    readonly status:
      "idle" | "running" | "waiting" | "approval-interrupted" | "stopping" | "worker-interrupted";
    readonly revision: string;
    readonly createdAt: string;
    readonly updatedAt: string;
  };
  readonly runs: {
    readonly [x: string]: {
      readonly status:
        | "running"
        | "waiting"
        | "approval-interrupted"
        | "stopping"
        | "worker-interrupted"
        | "accepted"
        | "succeeded"
        | "failed"
        | "cancelled";
      readonly threadId: string;
      readonly runId: string;
      readonly owner: {
        readonly generationId: string;
        readonly publicFingerprint: string;
        readonly protocolVersion: number;
        readonly schemaVersion: number;
        readonly providerScope: string;
      };
      readonly operationId: OperationId;
      readonly inputDigest: string;
      readonly acceptedAt: string;
      readonly maxJournalBytes: number;
      readonly maxJournalRecordBytes: number;
      readonly terminalReserveBytes: number;
      readonly settledAt?: string;
      readonly outcome?: "worker-interrupted" | "succeeded" | "failed" | "cancelled";
    };
  };
  readonly messages: ReadonlyArray<{
    readonly createdAt: string;
    readonly role: "user" | "assistant" | "tool";
    readonly parts: ReadonlyArray<
      | {
          readonly kind: "text";
          readonly text: string;
          readonly partId: string;
          readonly state?: "streaming" | "complete";
        }
      | {
          readonly kind: "tool";
          readonly state:
            | "running"
            | "succeeded"
            | "failed"
            | "started"
            | "input-streaming"
            | "input-ready"
            | "approval-required"
            | "denied";
          readonly partId: string;
          readonly toolCallId: string;
          readonly toolId: string;
          readonly inputText?: string;
          readonly input?: unknown;
          readonly output?: unknown;
          readonly value?: unknown;
        }
      | {
          readonly partId: string;
          readonly kind: "progress";
          readonly value: unknown;
          readonly scope: "run";
        }
      | {
          readonly partId: string;
          readonly kind: "progress";
          readonly value: unknown;
          readonly scope: "tool";
          readonly toolCallId: string;
          readonly toolId: string;
        }
    >;
    readonly messageId: string;
    readonly runId?: string;
  }>;
  readonly approvals: ReadonlyArray<{
    readonly status: "cancelled" | "denied" | "open" | "approved";
    readonly runId: string;
    readonly approvalId: string;
    readonly interruptSetDigest: string;
    readonly publicRequest: unknown;
    readonly interruptSetSize?: number;
  }>;
  readonly journal: ReadonlyArray<{
    readonly recordId: string;
    readonly runId: string;
    readonly kind:
      "progress" | "message" | "approval" | "control" | "terminal" | "interruption" | "event";
    readonly publicValue: unknown;
    readonly checkpoint: {
      readonly applicationId: string;
      readonly environment: string;
      readonly profile: string;
      readonly providerEpoch: string;
      readonly threadId: string;
      readonly sequence: string;
    };
    readonly encodedBytes: number;
    readonly createdAt: string;
  }>;
  readonly sequence: number;
  readonly controls: {
    readonly [x: string]: {
      readonly sequence: number;
      readonly record: {
        readonly status: "accepted" | "cancelled" | "processing" | "applied" | "rejected";
        readonly runId: string;
        readonly acceptedAt: string;
        readonly kind: "steer" | "follow-up" | "stop" | "approve";
        readonly controlId: OperationId;
        readonly semanticDigest: string;
        readonly effect: "not-started" | "confirmed" | "unknown";
        readonly settledAt?: string;
        readonly publicPayload?: unknown;
      };
      readonly publicPayload: unknown;
      readonly semanticDigest: string;
      readonly receipt: {
        readonly operationId: OperationId;
        readonly threadId: string;
        readonly runId: string;
        readonly status: "accepted" | "cancelled" | "processing" | "applied" | "rejected";
        readonly effect: "not-started" | "confirmed" | "unknown";
        readonly duplicate: boolean;
      };
      readonly expiresAt: string;
      readonly downstreamOperationId?: string;
    };
  };
  readonly runClaims: {
    readonly [x: string]: {
      readonly runId: string;
      readonly claimId: string;
      readonly workerId: string;
      readonly generationId: string;
      readonly fence: number;
      readonly expiresAt: string;
    };
  };
  readonly controlClaims: {
    readonly [x: string]: {
      readonly controlId: OperationId;
      readonly claimId: string;
      readonly workerId: string;
      readonly generationId: string;
      readonly fence: number;
      readonly expiresAt: string;
    };
  };
  readonly scopeKey: string;
  readonly controlSequence: number;
  readonly nextFence: number;
  readonly waiting?: {
    readonly revision: string;
    readonly runId: string;
    readonly response: Json;
    readonly requests: ReadonlyArray<{
      readonly node: string;
      readonly response: Json;
      readonly value?: unknown;
    }>;
  };
  readonly activeRunId?: string;
  readonly snapshots?: {
    readonly [x: string]: {
      readonly createdAt: string;
      readonly messages: ReadonlyArray<{
        readonly createdAt: string;
        readonly role: "user" | "assistant" | "tool";
        readonly parts: ReadonlyArray<
          | {
              readonly kind: "text";
              readonly text: string;
              readonly partId: string;
              readonly state?: "streaming" | "complete";
            }
          | {
              readonly kind: "tool";
              readonly state:
                | "running"
                | "succeeded"
                | "failed"
                | "started"
                | "input-streaming"
                | "input-ready"
                | "approval-required"
                | "denied";
              readonly partId: string;
              readonly toolCallId: string;
              readonly toolId: string;
              readonly inputText?: string;
              readonly input?: unknown;
              readonly output?: unknown;
              readonly value?: unknown;
            }
          | {
              readonly partId: string;
              readonly kind: "progress";
              readonly value: unknown;
              readonly scope: "run";
            }
          | {
              readonly partId: string;
              readonly kind: "progress";
              readonly value: unknown;
              readonly scope: "tool";
              readonly toolCallId: string;
              readonly toolId: string;
            }
        >;
        readonly messageId: string;
        readonly runId?: string;
      }>;
    };
  };
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/state.ts#L12)

### LocalControl

**Signature**

```ts
declare const LocalControl: {
  readonly sequence: number;
  readonly record: {
    readonly status: "accepted" | "cancelled" | "processing" | "applied" | "rejected";
    readonly runId: string;
    readonly acceptedAt: string;
    readonly kind: "steer" | "follow-up" | "stop" | "approve";
    readonly controlId: OperationId;
    readonly semanticDigest: string;
    readonly effect: "not-started" | "confirmed" | "unknown";
    readonly settledAt?: string;
    readonly publicPayload?: unknown;
  };
  readonly publicPayload: unknown;
  readonly semanticDigest: string;
  readonly receipt: {
    readonly operationId: OperationId;
    readonly threadId: string;
    readonly runId: string;
    readonly status: "accepted" | "cancelled" | "processing" | "applied" | "rejected";
    readonly effect: "not-started" | "confirmed" | "unknown";
    readonly duplicate: boolean;
  };
  readonly expiresAt: string;
  readonly downstreamOperationId?: string;
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/state.ts#L11)

### LocalPinnedSnapshot

**Signature**

```ts
declare const LocalPinnedSnapshot: {
  readonly createdAt: string;
  readonly messages: ReadonlyArray<{
    readonly createdAt: string;
    readonly role: "user" | "assistant" | "tool";
    readonly parts: ReadonlyArray<
      | {
          readonly kind: "text";
          readonly text: string;
          readonly partId: string;
          readonly state?: "streaming" | "complete";
        }
      | {
          readonly kind: "tool";
          readonly state:
            | "running"
            | "succeeded"
            | "failed"
            | "started"
            | "input-streaming"
            | "input-ready"
            | "approval-required"
            | "denied";
          readonly partId: string;
          readonly toolCallId: string;
          readonly toolId: string;
          readonly inputText?: string;
          readonly input?: unknown;
          readonly output?: unknown;
          readonly value?: unknown;
        }
      | {
          readonly partId: string;
          readonly kind: "progress";
          readonly value: unknown;
          readonly scope: "run";
        }
      | {
          readonly partId: string;
          readonly kind: "progress";
          readonly value: unknown;
          readonly scope: "tool";
          readonly toolCallId: string;
          readonly toolId: string;
        }
    >;
    readonly messageId: string;
    readonly runId?: string;
  }>;
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/state.ts#L13)

### LocalStoredRun

**Signature**

```ts
declare const LocalStoredRun: {
  readonly status:
    | "running"
    | "waiting"
    | "approval-interrupted"
    | "stopping"
    | "worker-interrupted"
    | "accepted"
    | "succeeded"
    | "failed"
    | "cancelled";
  readonly threadId: string;
  readonly runId: string;
  readonly owner: {
    readonly generationId: string;
    readonly publicFingerprint: string;
    readonly protocolVersion: number;
    readonly schemaVersion: number;
    readonly providerScope: string;
  };
  readonly operationId: OperationId;
  readonly inputDigest: string;
  readonly acceptedAt: string;
  readonly maxJournalBytes: number;
  readonly maxJournalRecordBytes: number;
  readonly terminalReserveBytes: number;
  readonly settledAt?: string;
  readonly outcome?: "worker-interrupted" | "succeeded" | "failed" | "cancelled";
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/state.ts#L14)

### StoredReceipt

**Signature**

```ts
declare const StoredReceipt: StoredReceipt<Value>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/state.ts#L10)

### emptyAgentState

Creates format-v1 state with a fresh provider epoch and empty domain indexes.

**Signature**

```ts
declare const emptyAgentState: () => LocalAgentState;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/state.ts#L24)

## `state.types.ts`

### LocalAgentState (type alias)

Complete validated version-one agent-state snapshot.

**Signature**

```ts
type LocalAgentState = typeof AgentState.Type;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/state.types.ts#L19)

### LocalAgentThread (type alias)

Thread, runs, controls and retained content decoded before transitions.

**Signature**

```ts
type LocalAgentThread = typeof AgentThread.Type;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/state.types.ts#L25)

### LocalControl (type alias)

Control record with its receipt and downstream identity.

**Signature**

```ts
type LocalControl = typeof AgentControl.Type;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/state.types.ts#L28)

### LocalPinnedSnapshot (type alias)

Immutable pinned message view retained for paginated history.

**Signature**

```ts
type LocalPinnedSnapshot = typeof PinnedSnapshot.Type;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/state.types.ts#L31)

### LocalStoredRun (type alias)

Run metadata and journal limits decoded together.

**Signature**

```ts
type LocalStoredRun = typeof AgentRun.Type;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/state.types.ts#L22)

### StoredReceipt (interface)

Generic idempotency envelope used when selecting retained receipts.

**Signature**

```ts
export interface StoredReceipt<Value> {
  readonly semanticDigest: string;
  readonly expiresAt: string;
  readonly value: Value;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/state.types.ts#L12)

## `storage.types.ts`

### AgentStateStore (interface)

Promise storage seam retained for existing provider adapters and fault injection.

**Signature**

```ts
export interface AgentStateStore {
  read(): Promise<LocalAgentState>;
  update<Value>(
    change: (state: LocalAgentState) => readonly [LocalAgentState, Value],
  ): Promise<Value>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/storage.types.ts#L5)

### AgentStateStoreEffects (type alias)

Effect storage contract used by agent-state operations.

**Signature**

```ts
type AgentStateStoreEffects = LocalStateStore<LocalAgentState>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/agent-state/storage.types.ts#L13)

## `buckets.types.ts`

### LocalBucketListOptions (interface)

Optional cursor and bounded page size for lexical key listing.

**Signature**

```ts
export interface LocalBucketListOptions {
  readonly cursor?: string;
  readonly limit?: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/buckets.types.ts#L25)

### LocalBucketListPage (interface)

Immutable bucket key page with continuation metadata.

**Signature**

```ts
export interface LocalBucketListPage {
  readonly items: readonly string[];
  readonly nextCursor?: string;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/buckets.types.ts#L31)

### LocalBucketObjectMetadata (interface)

Verified content identity, size and optional application metadata.

**Signature**

```ts
export interface LocalBucketObjectMetadata extends BucketObjectMetadata {
  readonly contentHash: string;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/buckets.types.ts#L37)

### LocalBucketPolicy (interface)

Size, content-type and metadata limits enforced before bucket writes.

**Signature**

```ts
export interface LocalBucketPolicy {
  readonly maxObjectBytes?: number;
  readonly allowedContentTypes?: readonly string[];
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/buckets.types.ts#L11)

### LocalBucketProvider (type alias)

Public Promise bucket contract plus local inspection and lifecycle operations.

**Signature**

```ts
type LocalBucketProvider = Omit<BucketProvider, "list"> & {
  readonly capabilities: Readonly<BucketCapabilities>;
  readonly root: string;
  readonly policy: Readonly<LocalBucketPolicy>;
  readonly list: {
    (prefix?: string): Promise<readonly string[]>;
    (prefix: string | undefined, options: LocalBucketListOptions): Promise<LocalBucketListPage>;
  };
  readonly listPage: (
    prefix?: string,
    options?: LocalBucketListOptions,
  ) => Promise<LocalBucketListPage>;
  readonly ready: () => Promise<void>;
  readonly close: () => Promise<void>;
  readonly inspector: {
    readonly list: (request: {
      readonly prefix?: string;
      readonly cursor?: string;
      readonly limit: number;
      readonly signal: AbortSignal;
    }) => Promise<{
      readonly items: readonly { readonly key: string; readonly metadata?: BucketObjectMetadata }[];
      readonly nextCursor?: string;
    }>;
    readonly preview: (request: {
      readonly key: string;
      readonly offset: number;
      readonly limit: number;
      readonly signal: AbortSignal;
    }) => Promise<
      | {
          readonly bytes: Uint8Array;
          readonly metadata: BucketObjectMetadata;
          readonly totalBytes: number;
        }
      | undefined
    >;
  };
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/buckets.types.ts#L45)

### LocalBucketProviderOptions (interface)

Owned root, object policy and default pagination settings for a local bucket.

**Signature**

```ts
export interface LocalBucketProviderOptions extends LocalBucketPolicy {
  readonly root?: string;
  readonly stateRoot?: string;
  readonly policy?: LocalBucketPolicy;
  readonly pageSize?: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/buckets.types.ts#L17)

### LocalBucketUnsupportedCapability (type alias)

Bucket capability that the filesystem implementation explicitly does not provide.

**Signature**

```ts
type LocalBucketUnsupportedCapability = {
  readonly capability: BucketCapability;
  readonly operation: BucketOperation;
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/buckets.types.ts#L86)

### StoredLocalBucketObject (type alias)

Versioned object envelope storing verified bytes as base64.

**Signature**

```ts
type StoredLocalBucketObject = typeof StoredBucketObject.Type;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/buckets.types.ts#L42)

## `keys.ts`

### assertContainedPath

Rejects a resolved path that escapes the owned root.

**Signature**

```ts
declare const assertContainedPath: (root: string, candidate: string) => void;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/keys.ts#L77)

### encodeBucketKey

Encodes a normalized key into a filesystem-safe object identity.

**Signature**

```ts
declare const encodeBucketKey: (key: string) => string;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/keys.ts#L67)

### normalizeBucketKey

Validates an object key without normalizing away an attempted escape.

**Signature**

```ts
declare const normalizeBucketKey: (value: unknown) => string;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/keys.ts#L11)

### normalizeBucketPrefix

Validates a list prefix while allowing the conventional trailing slash.

**Signature**

```ts
declare const normalizeBucketPrefix: (value: unknown) => string;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/keys.ts#L36)

## `pagination.ts`

### DEFAULT_BUCKET_PAGE_SIZE

**Signature**

```ts
declare const DEFAULT_BUCKET_PAGE_SIZE: 100;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/pagination.ts#L7)

### MAX_BUCKET_PAGE_SIZE

**Signature**

```ts
declare const MAX_BUCKET_PAGE_SIZE: 1000;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/pagination.ts#L8)

### paginateKeys

Returns a stable page of sorted keys using a prefix-bound cursor.

**Signature**

```ts
declare const paginateKeys: (
  keys: readonly string[],
  prefix: string,
  options: LocalBucketListOptions | undefined,
) => LocalBucketListPage;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/pagination.ts#L17)

## `provider.ts`

### LocalBucketService (class)

Owns bucket admission, object IO and ordered inspection.

**Signature**

```ts
declare class LocalBucketService
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/provider.ts#L29)

### createLocalBucketProvider

Creates a filesystem bucket with the established Promise and overload contracts.

**Signature**

```ts
declare const createLocalBucketProvider: (
  optionsOrRoot: LocalBucketProviderOptions | string,
  policy?: LocalBucketPolicy,
) => LocalBucketProvider;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/provider.ts#L39)

### createLocalBucketProviderForTest

The same constructor is deterministic when supplied an isolated temporary root.

**Signature**

```ts
declare const createLocalBucketProviderForTest: (
  optionsOrRoot: LocalBucketProviderOptions | string,
  policy?: LocalBucketPolicy,
) => LocalBucketProvider;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/provider.ts#L47)

### localBucketLayer

Provides a bucket service and closes its admission gate with the scope.

**Example**

```ts
import { Effect } from "effect";
import { LocalBucketService, localBucketLayer } from "./provider.js";

const program = Effect.gen(function* () {
  const bucket = yield* LocalBucketService;
  yield* bucket.put("hello.txt", new TextEncoder().encode("hello"));
  return yield* bucket.head("hello.txt");
});
await Effect.runPromise(
  program.pipe(Effect.provide(localBucketLayer({ root: "/tmp/example-bucket" }))),
);
```

**Signature**

```ts
declare const localBucketLayer: (
  options: LocalBucketProviderOptions,
) => Layer.Layer<LocalBucketService, LocalOperationError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/provider.ts#L66)

### makeLocalBucketService

Validates construction and creates one bucket lifecycle owner.

**Signature**

```ts
declare const makeLocalBucketService: (
  optionsOrRoot: string | LocalBucketProviderOptions,
  policy?: LocalBucketPolicy | undefined,
) => Effect.Effect<LocalBucketEffects, LocalOperationError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/provider.ts#L79)

## `types.ts`

### LOCAL_BUCKET_CAPABILITIES

**Signature**

```ts
declare const LOCAL_BUCKET_CAPABILITIES: Readonly<BucketCapabilities>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/types.ts#L24)

### LOCAL_BUCKET_RESERVED_PREFIXES

**Signature**

```ts
declare const LOCAL_BUCKET_RESERVED_PREFIXES: ReadonlyArray<string>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/types.ts#L29)

### LocalBucketKeyError (class)

Preserves the public local bucket key error identity and stable error code.

**Signature**

```ts
declare class LocalBucketKeyError {
  constructor();
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/types.ts#L32)

### code (property)

**Signature**

```ts
readonly code: "RELKIT_BUCKET_KEY_INVALID"
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/types.ts#L33)

### LocalBucketListOptions

**Signature**

```ts
declare const LocalBucketListOptions: LocalBucketListOptions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/types.ts#L16)

### LocalBucketListPage

**Signature**

```ts
declare const LocalBucketListPage: LocalBucketListPage;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/types.ts#L17)

### LocalBucketObjectMetadata

**Signature**

```ts
declare const LocalBucketObjectMetadata: LocalBucketObjectMetadata;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/types.ts#L18)

### LocalBucketPaginationError (class)

Preserves the public local bucket pagination error identity and stable error code.

**Signature**

```ts
declare class LocalBucketPaginationError {
  constructor();
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/types.ts#L62)

### code (property)

**Signature**

```ts
readonly code: "RELKIT_BUCKET_CURSOR_INVALID"
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/types.ts#L63)

### LocalBucketPolicy

**Signature**

```ts
declare const LocalBucketPolicy: LocalBucketPolicy;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/types.ts#L14)

### LocalBucketPolicyError (class)

Preserves the public local bucket policy error identity and stable error code.

**Signature**

```ts
declare class LocalBucketPolicyError {
  constructor(message: string);
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/types.ts#L42)

### code (property)

**Signature**

```ts
readonly code: "RELKIT_BUCKET_POLICY_INVALID"
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/types.ts#L43)

### LocalBucketProvider

**Signature**

```ts
declare const LocalBucketProvider: LocalBucketProvider;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/types.ts#L20)

### LocalBucketProviderOptions

**Signature**

```ts
declare const LocalBucketProviderOptions: LocalBucketProviderOptions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/types.ts#L15)

### LocalBucketStateError (class)

Preserves the public local bucket state error identity and stable error code.

**Signature**

```ts
declare class LocalBucketStateError {
  constructor(message = "Bucket state is invalid");
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/types.ts#L52)

### code (property)

**Signature**

```ts
readonly code: "RELKIT_BUCKET_STATE_INVALID"
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/types.ts#L53)

### LocalBucketUnsupportedCapability

**Signature**

```ts
declare const LocalBucketUnsupportedCapability: LocalBucketUnsupportedCapability;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/types.ts#L21)

### StoredLocalBucketObject

**Signature**

```ts
declare const StoredLocalBucketObject: {
  readonly version: 1;
  readonly metadata: { readonly [x: string]: string };
  readonly key: string;
  readonly size: number;
  readonly contentHash: string;
  readonly etag: string;
  readonly data: string;
  readonly contentType?: string;
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/buckets/types.ts#L19)

## `cache.types.ts`

### LocalCacheCapabilities (interface)

Truthful persistence, atomicity and capacity guarantees for the local cache.

**Signature**

```ts
export interface LocalCacheCapabilities extends CacheCapabilities {
  readonly persistence: "memory-only" | "restart-recovery";
  readonly singleFlight: "generation-local";
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/cache.types.ts#L53)

### LocalCacheEvictionPolicy (type alias)

Eviction policy supported by the bounded in-memory cache.

**Signature**

```ts
type LocalCacheEvictionPolicy = "lru";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/cache.types.ts#L9)

### LocalCachePolicy (interface)

Normalized TTL, encoded-value and total-cache limits.

**Signature**

```ts
export interface LocalCachePolicy {
  readonly defaultTtlMs?: number;
  readonly maxTtlMs?: number;
  readonly maxEntries: number;
  readonly maxBytes: number;
  readonly evictionPolicy: LocalCacheEvictionPolicy;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/cache.types.ts#L31)

### LocalCacheProvider (type alias)

Public cache operations and local lifecycle/inspection surface.

**Signature**

```ts
type LocalCacheProvider = Omit<CacheProvider, "capabilities"> & {
  readonly capabilities: Readonly<LocalCacheCapabilities>;
  readonly cacheId: string;
  readonly schemaVersion: string | number;
  readonly policy: Readonly<LocalCachePolicy>;
  readonly snapshot: () => LocalCacheSnapshot;
  readonly stateRoot?: string;
  readonly ready: () => Promise<void>;
  readonly close: () => Promise<void>;
  readonly get: (key: unknown, context?: CacheOperationContext) => Promise<unknown | undefined>;
  readonly set: (
    key: unknown,
    value: unknown,
    options?: CacheOperationOptions,
    context?: CacheOperationContext,
  ) => Promise<void>;
  readonly delete: (key: unknown, context?: CacheOperationContext) => Promise<void>;
  readonly has: (key: unknown, context?: CacheOperationContext) => Promise<boolean>;
  readonly getOrSet: (
    key: unknown,
    produce: () => unknown | Promise<unknown>,
    options?: CacheOperationOptions,
    context?: CacheOperationContext,
  ) => Promise<unknown>;
  readonly increment: (
    key: unknown,
    delta: number,
    options?: CacheOperationOptions,
    context?: CacheOperationContext,
  ) => Promise<number>;
  readonly inspector: {
    readonly scan: (request: {
      readonly search?: string;
      readonly cursor?: string;
      readonly limit: number;
      readonly signal: AbortSignal;
    }) => Promise<{ readonly items: readonly unknown[]; readonly nextCursor?: string }>;
    readonly value: (request: {
      readonly key: string;
      readonly limit: number;
      readonly signal: AbortSignal;
    }) => Promise<unknown | undefined>;
  };
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/cache.types.ts#L59)

### LocalCacheProviderOptions (interface)

Cache bounds, persistence, clock and safe observation hooks.

**Signature**

```ts
export interface LocalCacheProviderOptions {
  /** Provider-owned profile directory; enables atomic restart snapshots. */
  readonly stateRoot?: string;
  readonly cacheId?: string;
  readonly schemaVersion?: string | number;
  readonly defaultTtlMs?: number;
  readonly maxTtlMs?: number;
  readonly maxEntries?: number;
  readonly maxBytes?: number;
  readonly evictionPolicy?: LocalCacheEvictionPolicy;
  /** Injectable clock used for TTL and deadline checks. */
  readonly clock?: () => number;
  /** Alias for clock, kept for small deterministic test seams. */
  readonly now?: () => number;
  /** Receives safe counters only; keys and values are never included. */
  readonly onSnapshot?: (snapshot: LocalCacheSnapshot) => void;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/cache.types.ts#L12)

### LocalCacheSnapshot (interface)

Safe cache counters and effective policy without keys or values.

**Signature**

```ts
export interface LocalCacheSnapshot {
  readonly version: 1;
  readonly cacheId: string;
  readonly schemaVersion: string | number;
  readonly entries: number;
  readonly bytes: number;
  readonly evictions: number;
  readonly hits: number;
  readonly misses: number;
  readonly inFlight: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/cache.types.ts#L40)

## `inspector.ts`

### createLocalCacheInspector

Projects bounded cache metadata and previews from the same byte-LRU store.

**Signature**

```ts
declare const createLocalCacheInspector: (
  store: LocalCacheStore,
  clock: () => number,
) => LocalCacheProvider["inspector"];
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/inspector.ts#L10)

## `keys.ts`

### createLocalCacheKey

Builds a deterministic namespace key without exposing the raw key to logs.

**Signature**

```ts
declare const createLocalCacheKey: (
  cacheId: string,
  schemaVersion: string | number,
  key: unknown,
) => string;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/keys.ts#L38)

### normalizeCacheId

Validates the namespace used to isolate canonical cache keys.

**Signature**

```ts
declare const normalizeCacheId: (value: unknown) => string;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/keys.ts#L9)

### normalizeSchemaVersion

Validates the cache schema namespace without changing its public representation.

**Signature**

```ts
declare const normalizeSchemaVersion: (value: unknown) => string | number;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/keys.ts#L21)

### serializeLocalCacheValue

Serializes supported JSON values for byte accounting and cloning.

**Signature**

```ts
declare const serializeLocalCacheValue: (value: unknown) => string;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/keys.ts#L55)

## `policy.ts`

### assertActive

Rejects an aborted or expired operation before cache or bucket IO.

**Signature**

```ts
declare const assertActive: (
  context: CacheOperationContext | undefined,
  clock: () => number,
) => number;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/policy.ts#L62)

### byteLength

Measures UTF-8 bytes for cache key and value capacity accounting.

**Signature**

```ts
declare const byteLength: (value: string) => number;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/policy.ts#L92)

### clone

Copies cache values through their supported JSON representation.

**Signature**

```ts
declare const clone: (value: unknown) => unknown;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/policy.ts#L101)

### normalizePolicy

Validates provider limits and normalizes effective policy defaults.

**Signature**

```ts
declare const normalizePolicy: (options: LocalCacheProviderOptions) => LocalCachePolicy;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/policy.ts#L18)

### normalizeTtl

Resolves entry TTL against defaults and the maximum allowed lifetime.

**Signature**

```ts
declare const normalizeTtl: (value: unknown, policy: LocalCachePolicy) => number | undefined;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/policy.ts#L44)

### readClock

Checks that the injected clock returns a usable finite timestamp.

**Signature**

```ts
declare const readClock: (clock: () => number) => number;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/policy.ts#L79)

## `provider.ts`

### LocalCacheService (class)

Cache state, producer admission and durable writes share one owner.

**Signature**

```ts
declare class LocalCacheService
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/provider.ts#L28)

### createLocalCacheProvider

Creates the existing Promise cache API over an Effect service.

**Signature**

```ts
declare const createLocalCacheProvider: (options?: LocalCacheProviderOptions) => LocalCacheProvider;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/provider.ts#L37)

### localCacheLayer

Provides a cache and commits its final snapshot at scope exit.

**Example**

```ts
import { Effect } from "effect";
import { LocalCacheService, localCacheLayer } from "./provider.js";

const program = Effect.gen(function* () {
  const cache = yield* LocalCacheService;
  yield* cache.set("answer", 42);
  return yield* cache.get("answer");
});
await Effect.runPromise(program.pipe(Effect.provide(localCacheLayer())));
```

**Signature**

```ts
declare const localCacheLayer: (
  options?: LocalCacheProviderOptions,
) => Layer.Layer<LocalCacheService, LocalOperationError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/provider.ts#L60)

### makeLocalCacheService

Acquires the cache's indexes, serialization permit and producer coordination.

**Signature**

```ts
declare const makeLocalCacheService: (
  options?: LocalCacheProviderOptions,
) => Effect.Effect<LocalCacheEffects, LocalOperationError>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/provider.ts#L75)

## `store.ts`

### LocalCacheRead

**Signature**

```ts
declare const LocalCacheRead: LocalCacheRead;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/store.ts#L11)

### LocalCacheStore (class)

Pure byte-bounded LRU state owned by LocalCacheService; callers supply clock values.

**Signature**

```ts
declare class LocalCacheStore { constructor(private readonly policy: LocalCachePolicy) }
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/store.ts#L20)

### read (method)

Reads an entry, expires stale values, and updates recency and hit/miss counters.

**Signature**

```ts
declare const read: (key: string, now: number) => LocalCacheRead;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/store.ts#L32)

### write (method)

Replaces an entry and evicts least-recently-used values until both bounds hold.

**Signature**

```ts
declare const write: (
  key: string,
  value: unknown,
  bytes: number,
  expiresAt: number | undefined,
) => void;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/store.ts#L49)

### remove (method)

Removes one entry and adjusts encoded byte accounting; reports whether it existed.

**Signature**

```ts
declare const remove: (key: string) => boolean;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/store.ts#L64)

### purgeExpired (method)

Removes every expired entry without changing hit/miss counters.

**Signature**

```ts
declare const purgeExpired: (now: number) => void;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/store.ts#L73)

### snapshot (method)

Copies safe counters without exposing cached values or keys.

**Signature**

```ts
declare const snapshot: () => LocalCacheStoreSnapshot;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/store.ts#L80)

### exportState (method)

Copies all entries and recency counters for the owning service's durable snapshot.

**Signature**

```ts
declare const exportState: () => LocalCacheStoreState;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/store.ts#L91)

### restore (method)

Validates snapshot entries, rebuilds accounting, and reapplies current policy limits.

**Signature**

```ts
declare const restore: (state: LocalCacheStoreState) => void;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/store.ts#L106)

### clear (method)

Releases all cached entries while preserving historical counters.

**Signature**

```ts
declare const clear: () => void;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/store.ts#L145)

### evict (method)

Evicts by recency using a bounded linear scan of the in-memory entries.

**Signature**

```ts
declare const evict: () => void;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/store.ts#L151)

### LocalCacheStoreEntry

**Signature**

```ts
declare const LocalCacheStoreEntry: LocalCacheStoreEntry;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/store.ts#L13)

### LocalCacheStoreSnapshot

**Signature**

```ts
declare const LocalCacheStoreSnapshot: LocalCacheStoreSnapshot;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/store.ts#L12)

### LocalCacheStoreState

**Signature**

```ts
declare const LocalCacheStoreState: LocalCacheStoreState;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/store.ts#L14)

### MISSING

**Signature**

```ts
declare const MISSING: unique symbol;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/store.ts#L17)

## `store.types.ts`

### Entry (interface)

Mutable LRU entry with encoded-byte accounting and recency sequence.

**Signature**

```ts
export interface Entry {
  readonly key: string;
  readonly value: unknown;
  readonly bytes: number;
  readonly expiresAt?: number;
  lastUsed: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/store.types.ts#L4)

### LocalCacheRead (interface)

Cache read result distinguishing absence from an expired value.

**Signature**

```ts
export interface LocalCacheRead {
  readonly value: unknown | typeof MISSING;
  readonly expired: boolean;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/store.types.ts#L13)

### LocalCacheStoreEntry (interface)

Serializable cache entry including expiration and recency metadata.

**Signature**

```ts
export interface LocalCacheStoreEntry {
  readonly key: string;
  readonly value: unknown;
  readonly bytes: number;
  readonly expiresAt?: number;
  readonly lastUsed: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/store.types.ts#L28)

### LocalCacheStoreSnapshot (interface)

Safe counters maintained by the pure LRU state.

**Signature**

```ts
export interface LocalCacheStoreSnapshot {
  readonly entries: number;
  readonly bytes: number;
  readonly evictions: number;
  readonly hits: number;
  readonly misses: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/store.types.ts#L19)

### LocalCacheStoreState (interface)

Complete cache snapshot used to restore counters and LRU ordering.

**Signature**

```ts
export interface LocalCacheStoreState extends Omit<LocalCacheStoreSnapshot, "entries"> {
  readonly sequence: number;
  readonly entries: readonly LocalCacheStoreEntry[];
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/store.types.ts#L37)

## `types.ts`

### LOCAL_CACHE_CAPABILITIES

**Signature**

```ts
declare const LOCAL_CACHE_CAPABILITIES: Readonly<{
  readonly increment: true;
  readonly persistence: "memory-only";
  readonly singleFlight: "generation-local";
}>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/types.ts#L18)

### LOCAL_CACHE_DURABLE_CAPABILITIES

**Signature**

```ts
declare const LOCAL_CACHE_DURABLE_CAPABILITIES: Readonly<{
  readonly increment: true;
  readonly persistence: "restart-recovery";
  readonly singleFlight: "generation-local";
}>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/types.ts#L24)

### LocalCacheCapabilities

**Signature**

```ts
declare const LocalCacheCapabilities: LocalCacheCapabilities;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/types.ts#L14)

### LocalCacheEvictionPolicy

**Signature**

```ts
declare const LocalCacheEvictionPolicy: "lru";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/types.ts#L10)

### LocalCacheKeyError (class)

Preserves the public local cache key error identity and stable error code.

**Signature**

```ts
declare class LocalCacheKeyError {
  constructor();
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/types.ts#L31)

### code (property)

**Signature**

```ts
readonly code: "RELKIT_CACHE_KEY_INVALID"
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/types.ts#L32)

### LocalCachePolicy

**Signature**

```ts
declare const LocalCachePolicy: LocalCachePolicy;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/types.ts#L12)

### LocalCachePolicyError (class)

Preserves the public local cache policy error identity and stable error code.

**Signature**

```ts
declare class LocalCachePolicyError {
  constructor(message: string);
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/types.ts#L51)

### code (property)

**Signature**

```ts
readonly code: "RELKIT_CACHE_POLICY_INVALID"
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/types.ts#L52)

### LocalCacheProvider

**Signature**

```ts
declare const LocalCacheProvider: LocalCacheProvider;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/types.ts#L15)

### LocalCacheProviderOptions

**Signature**

```ts
declare const LocalCacheProviderOptions: LocalCacheProviderOptions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/types.ts#L11)

### LocalCacheSnapshot

**Signature**

```ts
declare const LocalCacheSnapshot: LocalCacheSnapshot;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/types.ts#L13)

### LocalCacheStateError (class)

Preserves the public local cache state error identity and stable error code.

**Signature**

```ts
declare class LocalCacheStateError {
  constructor(message = "Cache provider state is invalid");
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/types.ts#L61)

### code (property)

**Signature**

```ts
readonly code: "RELKIT_CACHE_STATE_INVALID"
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/types.ts#L62)

### LocalCacheValueError (class)

Preserves the public local cache value error identity and stable error code.

**Signature**

```ts
declare class LocalCacheValueError {
  constructor();
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/types.ts#L41)

### code (property)

**Signature**

```ts
readonly code: "RELKIT_CACHE_VALUE_INVALID"
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/cache/types.ts#L42)

## `admin-contracts.ts`

### EVENT_ADMIN_PROTOCOL

**Signature**

```ts
declare const EVENT_ADMIN_PROTOCOL: "relkit.events.admin";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.ts#L46)

### EVENT_ADMIN_VERSION

**Signature**

```ts
declare const EVENT_ADMIN_VERSION: 1;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.ts#L47)

### EventAdminAction

**Signature**

```ts
declare const EventAdminAction: "retry";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.ts#L26)

### EventAdminActionContract

**Signature**

```ts
declare const EventAdminActionContract: EventAdminActionContract;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.ts#L42)

### EventAdminActionOutcome

**Signature**

```ts
declare const EventAdminActionOutcome: EventAdminActionOutcome;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.ts#L27)

### EventAdminActionRecord

**Signature**

```ts
declare const EventAdminActionRecord: EventAdminActionRecord;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.ts#L41)

### EventAdminActionRequest

**Signature**

```ts
declare const EventAdminActionRequest: EventAdminActionRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.ts#L39)

### EventAdminActionSink

**Signature**

```ts
declare const EventAdminActionSink: EventAdminActionSink;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.ts#L43)

### EventAdminMode

**Signature**

```ts
declare const EventAdminMode: EventAdminMode;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.ts#L25)

### EventAdminVersion

**Signature**

```ts
declare const EventAdminVersion: EventAdminVersion;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.ts#L28)

### EventContract

**Signature**

```ts
declare const EventContract: EventContract;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.ts#L31)

### EventContractInput

**Signature**

```ts
declare const EventContractInput: EventContractInput;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.ts#L30)

### EventDeadLetterContract

**Signature**

```ts
declare const EventDeadLetterContract: EventDeadLetterContract;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.ts#L35)

### EventDeliveryContract

**Signature**

```ts
declare const EventDeliveryContract: EventDeliveryContract;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.ts#L34)

### EventPublicationContract

**Signature**

```ts
declare const EventPublicationContract: EventPublicationContract;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.ts#L33)

### EventQueryContract

**Signature**

```ts
declare const EventQueryContract: EventQueryContract;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.ts#L38)

### EventQueryRequest

**Signature**

```ts
declare const EventQueryRequest: EventQueryRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.ts#L37)

### EventRetryRequest

**Signature**

```ts
declare const EventRetryRequest: EventAdminActionRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.ts#L40)

### EventTriggerCapabilityContract

**Signature**

```ts
declare const EventTriggerCapabilityContract: EventTriggerCapabilityContract;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.ts#L36)

### EventTriggerContract

**Signature**

```ts
declare const EventTriggerContract: EventTriggerContract;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.ts#L32)

### EventVersioned

**Signature**

```ts
declare const EventVersioned: EventVersioned;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.ts#L29)

## `admin-contracts.types.ts`

### EventAdminAction (type alias)

Supported audited event administration action.

**Signature**

```ts
type EventAdminAction = "retry";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.types.ts#L10)

### EventAdminActionContract (interface)

Versioned mutation response containing status and audit record.

**Signature**

```ts
export interface EventAdminActionContract extends EventAdminVersion {
  readonly action: EventAdminAction;
  readonly status: EventDeliveryContract;
  readonly record: EventAdminActionRecord;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.types.ts#L157)

### EventAdminActionOutcome (type alias)

Whether an event administration action was applied or rejected.

**Signature**

```ts
type EventAdminActionOutcome = "applied" | "rejected";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.types.ts#L13)

### EventAdminActionRecord (interface)

Immutable audit record for an applied or rejected event mutation.

**Signature**

```ts
export interface EventAdminActionRecord extends EventAdminVersion {
  readonly actionId: string;
  readonly action: EventAdminAction;
  readonly deliveryId: string;
  readonly eventInstanceId?: string;
  readonly triggerId?: string;
  readonly mode: EventAdminMode;
  readonly outcome: EventAdminActionOutcome;
  readonly requestedAt: number;
  readonly fromState?: Exclude<JobQueueState, "accepted">;
  readonly toState?: Exclude<JobQueueState, "accepted">;
  readonly errorCode?: string;
  readonly reason?: string;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.types.ts#L141)

### EventAdminActionRequest (interface)

Event mutation request carrying delivery identity and optional audit reason.

**Signature**

```ts
export interface EventAdminActionRequest {
  readonly protocol?: typeof EVENT_ADMIN_PROTOCOL;
  readonly version?: typeof EVENT_ADMIN_VERSION;
  readonly deliveryId: string;
  readonly reason?: string;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.types.ts#L130)

### EventAdminActionSink (type alias)

Optional audit sink isolated from the event action outcome.

**Signature**

```ts
type EventAdminActionSink = (record: EventAdminActionRecord) => MaybePromise<void>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.types.ts#L164)

### EventAdminMode (type alias)

Environment mode controlling event administration mutations.

**Signature**

```ts
type EventAdminMode = "development" | "test" | "production";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.types.ts#L7)

### EventAdminVersion (interface)

Protocol identity carried by event administration contracts.

**Signature**

```ts
export interface EventAdminVersion {
  readonly protocol: typeof EVENT_ADMIN_PROTOCOL;
  readonly version: typeof EVENT_ADMIN_VERSION;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.types.ts#L16)

### EventContract (interface)

Versioned declared event identity and schema metadata for inspection.

**Signature**

```ts
export interface EventContract extends EventVersioned, EventContractInput {}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.types.ts#L37)

### EventContractInput (interface)

The serializable event contract registered by the active graph.

**Signature**

```ts
export interface EventContractInput {
  readonly id: string;
  readonly version: number;
  readonly input: JsonValue;
  readonly sensitiveFields?: readonly string[];
  readonly source?: JsonValue;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.types.ts#L28)

### EventDeadLetterContract (interface)

Versioned dead-letter status with safe retry/failure metadata.

**Signature**

```ts
export interface EventDeadLetterContract extends EventDeliveryContract {
  readonly state: "dead-lettered";
  readonly failure: JobFailureMetadata;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.types.ts#L87)

### EventDeliveryContract (interface)

Safe delivery state shared by current and dead-lettered attempts.

**Signature**

```ts
export interface EventDeliveryContract extends EventVersioned {
  readonly cursor: number;
  readonly sequence: number;
  readonly deliveryId: string;
  readonly eventInstanceId: string;
  readonly eventId: string;
  readonly version: number;
  readonly triggerId: string;
  readonly state: Exclude<JobQueueState, "accepted">;
  readonly attempt: number;
  readonly duplicate: boolean;
  readonly timestamp: number;
  readonly leaseExpiresAt?: number;
  readonly failure?: JobFailureMetadata;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.types.ts#L70)

### EventPublicationContract (interface)

Safe publication metadata; payload data is intentionally not projected.

**Signature**

```ts
export interface EventPublicationContract extends EventVersioned {
  readonly sequence: number;
  readonly timestamp: number;
  readonly accepted: true;
  readonly instanceId: string;
  readonly eventId: string;
  readonly version: number;
  readonly occurredAt: string;
  readonly publishedAt: string;
  readonly key?: string;
  readonly correlationId?: string;
  readonly originRequestId?: string;
  readonly producerTraceId?: string;
  readonly attributes: Readonly<Record<string, string | number | boolean>>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.types.ts#L53)

### EventQueryContract (interface)

Versioned bounded event, publication and delivery inspection response.

**Signature**

```ts
export interface EventQueryContract extends EventAdminVersion {
  readonly events: readonly EventContract[];
  readonly triggers: readonly EventTriggerContract[];
  readonly capabilities: readonly EventTriggerCapabilityContract[];
  readonly publications: readonly EventPublicationContract[];
  readonly items: readonly EventDeliveryContract[];
  readonly deliveries: readonly EventDeliveryContract[];
  readonly deadLetters: readonly EventDeadLetterContract[];
  readonly nextCursor?: string;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.types.ts#L118)

### EventQueryRequest (interface)

Event, trigger, state and pagination filters for local inspection.

**Signature**

```ts
export interface EventQueryRequest {
  readonly protocol?: typeof EVENT_ADMIN_PROTOCOL;
  readonly version?: typeof EVENT_ADMIN_VERSION;
  readonly eventId?: string;
  readonly eventVersion?: number;
  readonly triggerId?: string;
  readonly state?: Exclude<JobQueueState, "accepted">;
  readonly states?: readonly Exclude<JobQueueState, "accepted">[];
  readonly cursor?: string;
  readonly limit?: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.types.ts#L105)

### EventRetryRequest (type alias)

Dead-letter retry request preserving event admin protocol identity.

**Signature**

```ts
type EventRetryRequest = EventAdminActionRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.types.ts#L138)

### EventTriggerCapabilityContract (interface)

Versioned truthful delivery capabilities for a registered trigger.

**Signature**

```ts
export interface EventTriggerCapabilityContract extends EventAdminVersion {
  readonly triggerId: string;
  readonly delivery: "ephemeral" | "durable";
  readonly persistence: "none" | "restart-recovery";
  readonly restartRecovery: boolean;
  readonly atLeastOnce: boolean;
  readonly exactlyOnce: false;
  readonly ordering: "unsupported";
  readonly orderedByKey: false;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.types.ts#L93)

### EventTriggerContract (interface)

Exact event and delivery metadata for one generated event trigger.

**Signature**

```ts
export interface EventTriggerContract extends EventAdminVersion {
  readonly id: string;
  readonly targetFunctionId?: string;
  readonly eventId: string;
  readonly eventVersion: number;
  readonly delivery: "ephemeral" | "durable";
  readonly profile?: string;
  readonly retry?: RetryPolicy;
  readonly concurrency?: number;
  readonly timeoutMs?: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.types.ts#L40)

### EventVersioned (interface)

Protocol identity carried by public event inspection contracts.

**Signature**

```ts
export interface EventVersioned {
  readonly protocol: typeof EVENT_ADMIN_PROTOCOL;
  readonly protocolVersion: typeof EVENT_ADMIN_VERSION;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-contracts.types.ts#L22)

## `admin-errors.ts`

Preserves the public event admin error identity and stable error code.

### EventAdminError (class)

Preserves the public event admin error identity and stable error code.

**Signature**

```ts
declare class EventAdminError { constructor(
    readonly code: string,
    message: string,
  ) }
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin-errors.ts#L2)

## `admin.ts`

### "./admin-contracts.js" (namespace export)

Re-exports all named exports from the "./admin-contracts.js" module.

**Signature**

```ts
export * from "./admin-contracts.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin.ts#L39)

### EventAdmin

**Signature**

```ts
declare const EventAdmin: EventAdmin;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin.ts#L37)

### EventAdminError

**Signature**

```ts
declare const EventAdminError: typeof EventAdminError;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin.ts#L40)

### EventAdminOptions

**Signature**

```ts
declare const EventAdminOptions: EventAdminOptions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin.ts#L37)

### createEventAdmin

Exposes versioned event inspection and an audited local dead-letter retry.

**Signature**

```ts
declare const createEventAdmin: (router: EventRouter, options?: EventAdminOptions) => EventAdmin;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin.ts#L47)

## `admin.types.ts`

### EventAdmin (interface)

Versioned event inspection and audited dead-letter retry interface.

**Signature**

```ts
export interface EventAdmin {
  readonly protocol: typeof EVENT_ADMIN_PROTOCOL;
  readonly version: typeof EVENT_ADMIN_VERSION;
  readonly query: (request?: EventQueryRequest) => EventQueryContract;
  readonly retry: (request: string | EventAdminActionRequest) => Promise<EventAdminActionContract>;
  readonly actions: () => readonly EventAdminActionRecord[];
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin.types.ts#L24)

### EventAdminOptions (interface)

Event administration mode plus isolated audit and clock hooks.

**Signature**

```ts
export interface EventAdminOptions {
  readonly mode?: EventAdminMode;
  readonly environment?: EventAdminMode;
  readonly enabled?: boolean;
  readonly now?: () => number;
  readonly createActionId?: () => string;
  readonly onAction?: EventAdminActionSink;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/admin.types.ts#L14)

## `delivery-types.ts`

### EVENT_DELIVERY_CAPABILITIES

**Signature**

```ts
declare const EVENT_DELIVERY_CAPABILITIES: Readonly<{
  readonly persistence: "restart-recovery";
  readonly restartRecovery: true;
  readonly atLeastOnce: true;
  readonly exactlyOnce: false;
  readonly ordering: "unsupported";
  readonly orderedByKey: false;
}>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery-types.ts#L24)

### EventDelivery

**Signature**

```ts
declare const EventDelivery: EventDelivery;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery-types.ts#L21)

### EventDeliveryBinding

**Signature**

```ts
declare const EventDeliveryBinding: EventDeliveryBinding;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery-types.ts#L16)

### EventDeliveryBoundary

**Signature**

```ts
declare const EventDeliveryBoundary: EventDeliveryBoundary;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery-types.ts#L14)

### EventDeliveryCapabilities

**Signature**

```ts
declare const EventDeliveryCapabilities: Readonly<{
  readonly persistence: "restart-recovery";
  readonly restartRecovery: true;
  readonly atLeastOnce: true;
  readonly exactlyOnce: false;
  readonly ordering: "unsupported";
  readonly orderedByKey: false;
}>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery-types.ts#L13)

### EventDeliveryInvocationOptions

**Signature**

```ts
declare const EventDeliveryInvocationOptions: EventDeliveryInvocationOptions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery-types.ts#L15)

### EventDeliveryLedgerRecord

**Signature**

```ts
declare const EventDeliveryLedgerRecord: EventDeliveryLedgerRecord;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery-types.ts#L19)

### EventDeliveryOptions

**Signature**

```ts
declare const EventDeliveryOptions: EventDeliveryOptions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery-types.ts#L17)

### EventDeliveryResult

**Signature**

```ts
declare const EventDeliveryResult: EventDeliveryResult;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery-types.ts#L18)

### EventDeliverySnapshot

**Signature**

```ts
declare const EventDeliverySnapshot: EventDeliverySnapshot;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery-types.ts#L20)

## `delivery.ts`

### EVENT_DELIVERY_CAPABILITIES

**Signature**

```ts
declare const EVENT_DELIVERY_CAPABILITIES: Readonly<{
  readonly persistence: "restart-recovery";
  readonly restartRecovery: true;
  readonly atLeastOnce: true;
  readonly exactlyOnce: false;
  readonly ordering: "unsupported";
  readonly orderedByKey: false;
}>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery.ts#L35)

### EventDelivery

**Signature**

```ts
declare const EventDelivery: EventDelivery;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery.ts#L37)

### EventDeliveryBinding

**Signature**

```ts
declare const EventDeliveryBinding: EventDeliveryBinding;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery.ts#L38)

### EventDeliveryBoundary

**Signature**

```ts
declare const EventDeliveryBoundary: EventDeliveryBoundary;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery.ts#L39)

### EventDeliveryLedgerRecord

**Signature**

```ts
declare const EventDeliveryLedgerRecord: EventDeliveryLedgerRecord;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery.ts#L40)

### EventDeliveryOptions

**Signature**

```ts
declare const EventDeliveryOptions: EventDeliveryOptions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery.ts#L41)

### EventDeliveryResult

**Signature**

```ts
declare const EventDeliveryResult: EventDeliveryResult;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery.ts#L42)

### EventDeliverySnapshot

**Signature**

```ts
declare const EventDeliverySnapshot: EventDeliverySnapshot;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery.ts#L43)

### LocalEventDeliveryService (class)

One trigger owns durable admission, retry transitions and handler concurrency.

**Signature**

```ts
declare class LocalEventDeliveryService
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery.ts#L47)

### createEventDelivery

Opens durable at-least-once delivery behind its existing Promise API.

**Signature**

```ts
declare const createEventDelivery: (
  root: string,
  binding: EventDeliveryBinding,
  options?: EventDeliveryOptions,
) => Promise<EventDelivery>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery.ts#L59)

### eventDeliveryLayer

Provides one trigger's delivery service with scope-owned shutdown.

**Signature**

```ts
declare const eventDeliveryLayer: (
  root: string,
  binding: EventDeliveryBinding,
  options?: EventDeliveryOptions,
) => Layer.Layer<LocalEventDeliveryService, LocalOperationError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery.ts#L75)

### makeEventDelivery

Recovers a trigger and composes its serialized admission and bounded execution.

**Signature**

```ts
declare const makeEventDelivery: (
  root: string,
  binding: EventDeliveryBinding,
  options?: EventDeliveryOptions | undefined,
) => Effect.Effect<EventDeliveryEffects, LocalOperationError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery.ts#L95)

## `delivery.types.ts`

### EventDelivery (interface)

Compatibility interface for accepting, executing and inspecting durable deliveries.

**Signature**

```ts
export interface EventDelivery {
  readonly triggerId: string;
  readonly capabilities: EventDeliveryCapabilities;
  readonly accept: (envelope: UnknownEventEnvelope) => Promise<EventDeliveryResult>;
  readonly deliver: (envelope: UnknownEventEnvelope) => Promise<EventDeliveryResult>;
  readonly runNext: (deliveryId?: string) => Promise<EventDeliveryResult | undefined>;
  readonly retry: (deliveryId: string) => Promise<EventDeliveryResult>;
  readonly drain: () => Promise<readonly EventDeliveryResult[]>;
  readonly recover: (now?: number) => Promise<readonly EventDeliveryLedgerRecord[]>;
  readonly snapshot: () => EventDeliverySnapshot;
  readonly close: () => Promise<void>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery.types.ts#L82)

### EventDeliveryBinding (interface)

Trigger identity and executable target for a durable delivery owner.

**Signature**

```ts
export interface EventDeliveryBinding {
  readonly id: string;
  readonly invoke: (
    envelope: UnknownEventEnvelope,
    options?: EventDeliveryInvocationOptions,
  ) => Promise<unknown>;
  readonly profile?: string;
  readonly retry?: RetryPolicy;
  readonly concurrency?: number;
  readonly timeoutMs?: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery.types.ts#L22)

### EventDeliveryBoundary (type alias)

Durable delivery commit milestones exposed to hooks.

**Signature**

```ts
type EventDeliveryBoundary = JobStoreBoundary | "handler-success-before-ack";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery.types.ts#L12)

### EventDeliveryCapabilities (type alias)

Actual durability, restart, overflow and cancellation guarantees.

**Signature**

```ts
type EventDeliveryCapabilities = typeof EVENT_DELIVERY_CAPABILITIES;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery.types.ts#L9)

### EventDeliveryInvocationOptions (interface)

Attempt metadata and cancellation supplied to a delivery target.

**Signature**

```ts
export interface EventDeliveryInvocationOptions {
  readonly attempt: number;
  readonly replayed: boolean;
  readonly timeoutMs?: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery.types.ts#L15)

### EventDeliveryLedgerRecord (interface)

Persisted delivery envelope joined with its latest queue state.

**Signature**

```ts
export interface EventDeliveryLedgerRecord extends EventDeliveryRecord {
  readonly cursor: number;
  readonly state: EventDeliveryResult["state"];
  readonly attempt: number;
  readonly duplicate: boolean;
  readonly leaseOwner?: string;
  readonly leaseExpiresAt?: number;
  readonly failure?: JobFailureMetadata;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery.types.ts#L62)

### EventDeliveryOptions (interface)

Backlog, concurrency, retry and durable-boundary configuration.

**Signature**

```ts
export interface EventDeliveryOptions {
  readonly now?: () => number;
  readonly random?: () => number;
  readonly ownerToken?: string;
  readonly leaseDurationMs?: number;
  readonly retry?: RetryPolicy;
  readonly concurrency?: number;
  readonly onBoundary?: (boundary: EventDeliveryBoundary) => void | Promise<void>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery.types.ts#L35)

### EventDeliveryResult (interface)

Delivery outcome including acceptance and actual persistence guarantees.

**Signature**

```ts
export interface EventDeliveryResult {
  readonly deliveryId: string;
  readonly triggerId: string;
  readonly eventInstanceId: string;
  readonly accepted: boolean;
  readonly persisted: boolean;
  readonly status: "queued" | "completed" | "failed";
  readonly state: "available" | "leased" | "delayed" | "completed" | "dead-lettered";
  readonly attempt: number;
  readonly duplicate: boolean;
  readonly value?: unknown;
  readonly error?: unknown;
  readonly failure?: JobFailureMetadata;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery.types.ts#L46)

### EventDeliverySnapshot (interface)

Safe delivery counters and durable ledger inspection.

**Signature**

```ts
export interface EventDeliverySnapshot {
  readonly cursor: number;
  readonly records: readonly EventDeliveryRecord[];
  readonly ledger: readonly EventDeliveryLedgerRecord[];
  readonly counts: JobQueueCounts;
  readonly capabilities: typeof EVENT_DELIVERY_CAPABILITIES;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/delivery.types.ts#L73)

## `ephemeral.ts`

### DEFAULT_EPHEMERAL_CAPACITY

**Signature**

```ts
declare const DEFAULT_EPHEMERAL_CAPACITY: 100;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/ephemeral.ts#L24)

### EPHEMERAL_DELIVERY_CAPABILITIES

**Signature**

```ts
declare const EPHEMERAL_DELIVERY_CAPABILITIES: Readonly<{
  readonly persistence: "none";
  readonly restartRecovery: false;
  readonly dropPolicy: "drop-newest";
}>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/ephemeral.ts#L25)

### EphemeralDelivery

**Signature**

```ts
declare const EphemeralDelivery: EphemeralDelivery;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/ephemeral.ts#L20)

### EphemeralDeliveryEffects

**Signature**

```ts
declare const EphemeralDeliveryEffects: EphemeralDeliveryEffects;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/ephemeral.ts#L21)

### EphemeralDeliveryResult

**Signature**

```ts
declare const EphemeralDeliveryResult: EphemeralDeliveryResult;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/ephemeral.ts#L18)

### EphemeralDeliverySnapshot

**Signature**

```ts
declare const EphemeralDeliverySnapshot: EphemeralDeliverySnapshot;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/ephemeral.ts#L19)

### LocalEphemeralService (class)

Capacity, counters and native handler completion share one service owner.

**Signature**

```ts
declare class LocalEphemeralService
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/ephemeral.ts#L32)

### createEphemeralDelivery

Constructs a transient delivery service behind the Promise boundary.

**Signature**

```ts
declare const createEphemeralDelivery: (
  invoke: (envelope: UnknownEventEnvelope) => Promise<unknown>,
  requestedCapacity?: number,
) => EphemeralDelivery;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/ephemeral.ts#L43)

### ephemeralDeliveryLayer

Supplies transient delivery and drains admitted handlers at scope exit.

**Signature**

```ts
declare const ephemeralDeliveryLayer: (
  invoke: (envelope: UnknownEventEnvelope) => Promise<unknown>,
  capacity?: number,
) => Layer.Layer<LocalEphemeralService, LocalOperationError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/ephemeral.ts#L61)

### makeEphemeralDelivery

Owns bounded admission and safe counters using Ref and Semaphore.

**Signature**

```ts
declare const makeEphemeralDelivery: (
  invoke: (envelope: UnknownEventEnvelope) => Promise<unknown>,
  capacity?: any,
) => Effect.Effect<EphemeralDeliveryEffects, LocalOperationError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/ephemeral.ts#L77)

## `ephemeral.types.ts`

### EphemeralDelivery (interface)

Public transient delivery interface with explicit drain and synchronous counters.

**Signature**

```ts
export interface EphemeralDelivery {
  readonly deliver: (envelope: UnknownEventEnvelope) => Promise<EphemeralDeliveryResult>;
  readonly drain: () => Promise<void>;
  readonly snapshot: () => EphemeralDeliverySnapshot;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/ephemeral.types.ts#L31)

### EphemeralDeliveryEffects (interface)

Effect contract for bounded transient delivery without a hidden backlog.

**Signature**

```ts
export interface EphemeralDeliveryEffects {
  readonly deliver: (envelope: UnknownEventEnvelope) => Effect.Effect<EphemeralDeliveryResult>;
  readonly drain: () => Effect.Effect<void>;
  readonly snapshot: () => Effect.Effect<EphemeralDeliverySnapshot>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/ephemeral.types.ts#L38)

### EphemeralDeliveryResult (interface)

Transient handler outcome with explicit nonpersistent capacity guarantees.

**Signature**

```ts
export interface EphemeralDeliveryResult {
  readonly accepted: boolean;
  readonly persisted: false;
  readonly status: "completed" | "failed" | "dropped";
  readonly capacity: number;
  readonly dropPolicy: "drop-newest";
  readonly restartRecovery: false;
  readonly value?: unknown;
  readonly error?: unknown;
  readonly dropReason?: "capacity";
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/ephemeral.types.ts#L5)

### EphemeralDeliverySnapshot (interface)

Safe admission, completion, failure and overflow counters.

**Signature**

```ts
export interface EphemeralDeliverySnapshot {
  readonly capacity: number;
  readonly inFlight: number;
  readonly admitted: number;
  readonly completed: number;
  readonly failed: number;
  readonly dropped: number;
  readonly persistence: "none";
  readonly restartRecovery: false;
  readonly dropPolicy: "drop-newest";
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/ephemeral.types.ts#L18)

## `log.ts`

### EVENT_LOG_VERSION

**Signature**

```ts
declare const EVENT_LOG_VERSION: 1;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/log.ts#L31)

### EventLog

**Signature**

```ts
declare const EventLog: EventLog;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/log.ts#L27)

### EventLogBoundary

**Signature**

```ts
declare const EventLogBoundary: JobStoreBoundary;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/log.ts#L22)

### EventLogInput

**Signature**

```ts
declare const EventLogInput: EventLogInput;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/log.ts#L28)

### EventLogOptions

**Signature**

```ts
declare const EventLogOptions: EventLogOptions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/log.ts#L24)

### EventLogPaths

**Signature**

```ts
declare const EventLogPaths: JobStorePaths;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/log.ts#L23)

### EventLogRecord

**Signature**

```ts
declare const EventLogRecord: EventLogRecord;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/log.ts#L25)

### EventLogSnapshot

**Signature**

```ts
declare const EventLogSnapshot: EventLogSnapshot;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/log.ts#L26)

### EventLogStateError (class)

Preserves the public event log state error identity and stable error code.

**Signature**

```ts
declare class EventLogStateError {
  constructor(message: string);
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/log.ts#L34)

### code (property)

**Signature**

```ts
readonly code: "RELKIT_EVENT_LOG_STATE_INVALID"
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/log.ts#L35)

### createEventLog

Opens the durable accepted-event log and repairs invalid records on startup.

**Signature**

```ts
declare const createEventLog: (
  requestedRoot: string,
  options?: EventLogOptions,
) => Promise<EventLog>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/log.ts#L56)

### createEventLogPaths

Builds the stable event journal and metadata paths below the owned root.

**Signature**

```ts
declare const createEventLogPaths: (root: string) => EventLogPaths;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/log.ts#L47)

## `log.types.ts`

### EventLog (interface)

Promise event log operations and synchronous recovered snapshot.

**Signature**

```ts
export interface EventLog {
  readonly root: string;
  readonly paths: EventLogPaths;
  readonly append: (envelope: EventLogInput) => Promise<EventLogRecord>;
  readonly snapshot: () => EventLogSnapshot;
  readonly close: () => Promise<void>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/log.types.ts#L38)

### EventLogBoundary (type alias)

Durable event-log commit milestones exposed to hooks.

**Signature**

```ts
type EventLogBoundary = JobStoreBoundary;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/log.types.ts#L12)

### EventLogInput (type alias)

Event envelope input before journal sequence assignment.

**Signature**

```ts
type EventLogInput = UnknownEventEnvelope | EventPublishResult<string, number, unknown>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/log.types.ts#L47)

### EventLogOptions (interface)

Event-log validation and durable commit hook configuration.

**Signature**

```ts
export interface EventLogOptions extends Pick<JobStoreOptions, "now" | "onBoundary"> {}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/log.types.ts#L18)

### EventLogPaths (type alias)

Owned paths for durable event records and derived metadata.

**Signature**

```ts
type EventLogPaths = ReturnType<typeof createJobStorePaths>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/log.types.ts#L15)

### EventLogRecord (interface)

Accepted event envelope with its durable journal identity.

**Signature**

```ts
export interface EventLogRecord {
  readonly version: typeof EVENT_LOG_VERSION;
  readonly sequence: number;
  readonly kind: "accepted";
  readonly accepted: true;
  readonly timestamp: number;
  readonly envelope: UnknownEventEnvelope;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/log.types.ts#L21)

### EventLogSnapshot (interface)

Immutable persisted event records and recovery metadata.

**Signature**

```ts
export interface EventLogSnapshot {
  readonly records: readonly EventLogRecord[];
  readonly index: JobStoreIndex;
  readonly checkpoint: JobStoreCheckpoint;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/log.types.ts#L31)

## `provider.ts`

### LocalEventEffects

**Signature**

```ts
declare const LocalEventEffects: LocalEventEffects;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/provider.ts#L19)

### LocalEventProvider

**Signature**

```ts
declare const LocalEventProvider: LocalEventProvider;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/provider.ts#L19)

### LocalEventService (class)

Publication and delivery orchestration for one local event provider.

**Signature**

```ts
declare class LocalEventService
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/provider.ts#L22)

### createLocalEventProvider

Acquires a scoped event provider behind its established Promise surface.

**Signature**

```ts
declare const createLocalEventProvider: (root: string) => Promise<LocalEventProvider>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/provider.ts#L31)

### localEventLayer

Supplies publication and its supervised delivery workers as one layer.

**Example**

```ts
import { Effect } from "effect";
import { LocalEventService, localEventLayer } from "./provider.js";

const program = Effect.gen(function* () {
  const events = yield* LocalEventService;
  yield* events.health();
});
await Effect.runPromise(program.pipe(Effect.provide(localEventLayer("/tmp/example-events"))));
```

**Signature**

```ts
declare const localEventLayer: (
  root: string,
) => Layer.Layer<LocalEventService, LocalOperationError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/provider.ts#L74)

### makeLocalEventService

Owns log, router, worker fibers and background failure state.

**Signature**

```ts
declare const makeLocalEventService: (
  root: string,
) => Effect.Effect<LocalEventEffects, LocalOperationError, Scope.Scope>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/provider.ts#L83)

## `provider.types.ts`

### LocalEventEffects (interface)

Effect event methods owned by the provider scope.

**Signature**

```ts
export interface LocalEventEffects {
  readonly query: (
    request?: EventQueryRequest,
  ) => Effect.Effect<EventQueryContract, LocalOperationError>;
  readonly registerContract: (contract: unknown) => Effect.Effect<void, LocalOperationError>;
  readonly registerTrigger: (
    binding: EventRouterTrigger,
  ) => Effect.Effect<void, LocalOperationError>;
  readonly publish: (
    payload: unknown,
    options: EventPublishOptions,
    context: EventOperationContext,
  ) => Effect.Effect<EventProviderResult, LocalOperationError>;
  readonly health: () => Effect.Effect<void, LocalOperationError>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/provider.types.ts#L21)

### LocalEventProvider (interface)

Public event registration, publication and explicit close operations.

**Signature**

```ts
export interface LocalEventProvider extends EventProvider {
  readonly registerContract: EventRouter["registerContract"];
  readonly registerTrigger: EventRouter["registerTrigger"];
  readonly query: (request?: EventQueryRequest) => Promise<EventQueryContract>;
  readonly close: () => Promise<void>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/provider.types.ts#L13)

## `router-model.types.ts`

### EventDeliveryResult (interface)

Delivery outcome including acceptance and actual persistence guarantees.

**Signature**

```ts
export interface EventDeliveryResult {
  readonly triggerId: string;
  readonly delivery: "ephemeral" | "durable";
  readonly deliveryId?: string;
  readonly eventInstanceId?: string;
  readonly accepted: boolean;
  readonly persisted: boolean;
  readonly status: "queued" | "completed" | "failed" | "dropped";
  readonly state?: "available" | "leased" | "delayed" | "completed" | "dead-lettered";
  readonly attempt?: number;
  readonly duplicate?: boolean;
  readonly capacity?: number;
  readonly dropPolicy?: "drop-newest";
  readonly restartRecovery?: false;
  readonly dropReason?: "capacity";
  readonly value?: unknown;
  readonly error?: unknown;
  readonly failure?: unknown;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router-model.types.ts#L13)

### EventFanoutResult (interface)

Publication result containing each matching trigger delivery outcome.

**Signature**

```ts
export interface EventFanoutResult {
  readonly event: UnknownEventEnvelope;
  readonly matchedTriggerIds: readonly string[];
  readonly deliveries: readonly EventDeliveryResult[];
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router-model.types.ts#L92)

### EventRouter (interface)

Compatibility router interface for registration, fanout, inspection and lifecycle.

**Signature**

```ts
export interface EventRouter {
  readonly root: string;
  readonly registerContract: (contract: unknown) => Promise<void>;
  readonly registerTrigger: (binding: EventRouterTrigger) => Promise<void>;
  readonly route: (
    event: EventRouterInput,
    options?: EventRouterRouteOptions,
  ) => Promise<EventFanoutResult>;
  readonly runNext: (triggerId?: string) => Promise<EventDeliveryResult | undefined>;
  readonly drain: () => Promise<readonly EventDeliveryResult[]>;
  readonly retry: (deliveryId: string) => Promise<EventDeliveryResult>;
  readonly snapshot: () => EventRouterSnapshot;
  readonly close: () => Promise<void>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router-model.types.ts#L99)

### EventRouterInput (type alias)

Publication input accepted as a log record or event envelope.

**Signature**

```ts
type EventRouterInput = EventLogRecord | EventLogInput;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router-model.types.ts#L115)

### EventRouterOptions (interface)

Storage and delivery construction settings for the local router.

**Signature**

```ts
export interface EventRouterOptions {
  readonly onBoundary?: (
    boundary: EventDeliveryBoundary,
    triggerId: string,
  ) => void | Promise<void>;
  readonly now?: () => number;
  readonly random?: () => number;
  readonly ownerToken?: string;
  readonly leaseDurationMs?: number;
  readonly ephemeralCapacity?: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router-model.types.ts#L51)

### EventRouterRouteOptions (interface)

Fanout options controlling immediate worker execution.

**Signature**

```ts
export interface EventRouterRouteOptions {
  readonly run?: boolean;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router-model.types.ts#L64)

### EventRouterSnapshot (interface)

Immutable contracts, triggers, publications and delivery status inspection.

**Signature**

```ts
export interface EventRouterSnapshot {
  readonly records: readonly EventDeliveryRecord[];
  readonly contracts: readonly EventContractInput[];
  readonly triggers: readonly EventTriggerSnapshot[];
  readonly publications: readonly EventLogRecord[];
  readonly deliveries: readonly EventDeliveryLedgerRecord[];
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router-model.types.ts#L69)

### EventRouterTrigger (interface)

Declared trigger identity, event match and executable target binding.

**Signature**

```ts
export interface EventRouterTrigger {
  readonly id: string;
  readonly targetFunctionId?: string;
  readonly eventId: string;
  readonly eventVersion: number;
  readonly delivery: "ephemeral" | "durable";
  readonly profile?: string;
  readonly retry?: RetryPolicy;
  readonly concurrency?: number;
  readonly timeoutMs?: number;
  readonly invoke: (
    envelope: UnknownEventEnvelope,
    options?: EventDeliveryInvocationOptions,
  ) => Promise<unknown>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router-model.types.ts#L34)

### EventTriggerSnapshot (interface)

Safe trigger configuration and runtime delivery counters.

**Signature**

```ts
export interface EventTriggerSnapshot {
  readonly ephemeral?: import("./ephemeral.js").EphemeralDeliverySnapshot;
  readonly id: string;
  readonly targetFunctionId?: string;
  readonly eventId: string;
  readonly eventVersion: number;
  readonly delivery: "ephemeral" | "durable";
  readonly profile?: string;
  readonly retry?: RetryPolicy;
  readonly concurrency?: number;
  readonly timeoutMs?: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router-model.types.ts#L78)

## `router-records.ts`

### EVENT_DELIVERY_VERSION

**Signature**

```ts
declare const EVENT_DELIVERY_VERSION: 1;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router-records.ts#L8)

### EventDeliveryRecord

**Signature**

```ts
declare const EventDeliveryRecord: EventDeliveryRecord;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router-records.ts#L6)

### EventRouterStateError (class)

Preserves the public event router state error identity and stable error code.

**Signature**

```ts
declare class EventRouterStateError {
  constructor(message: string);
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router-records.ts#L11)

### code (property)

**Signature**

```ts
readonly code: "RELKIT_EVENT_ROUTER_STATE_INVALID"
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router-records.ts#L12)

### appendDeliveryAcceptance

Appends delivery acceptance before acknowledging durable fanout.

**Signature**

```ts
declare const appendDeliveryAcceptance: (
  store: JobStore,
  envelope: UnknownEventEnvelope,
  triggerId: string,
) => Promise<void>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router-records.ts#L86)

### makeDeliveryId

Derives a stable identity from the publication and target trigger.

**Signature**

```ts
declare const makeDeliveryId: (eventInstanceId: string, triggerId: string) => string;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router-records.ts#L74)

### normalizeDelivery

Validates the durable or ephemeral delivery mode.

**Signature**

```ts
declare const normalizeDelivery: (value: unknown) => "ephemeral" | "durable";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router-records.ts#L24)

### normalizeEnvelope

Validates the envelope and copies its JSON payload and safe attributes.

**Signature**

```ts
declare const normalizeEnvelope: (input: unknown) => UnknownEventEnvelope;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router-records.ts#L35)

### toDeliveryRecord

Projects a durable journal record into its delivery identity and envelope.

**Signature**

```ts
declare const toDeliveryRecord: (record: JobRecord) => EventDeliveryRecord;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router-records.ts#L56)

### toJson

Copies an unknown value into canonical JSON for stable durable encoding.

**Signature**

```ts
declare const toJson: (value: DeliveryData) => JsonValue;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router-records.ts#L109)

### validateDeliveryData

Rejects malformed delivery identities or envelopes during record replay.

**Signature**

```ts
declare const validateDeliveryData: (value: JsonValue) => void;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router-records.ts#L65)

## `router-records.types.ts`

### DeliveryData (interface)

Versioned persisted delivery identity and canonical envelope payload.

**Signature**

```ts
export interface DeliveryData {
  readonly version: typeof EVENT_DELIVERY_VERSION;
  readonly deliveryId: string;
  readonly eventInstanceId: string;
  readonly triggerId: string;
  readonly envelope: UnknownEventEnvelope;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router-records.types.ts#L16)

### EventDeliveryRecord (interface)

Durable acceptance record connecting one publication and trigger.

**Signature**

```ts
export interface EventDeliveryRecord {
  readonly version: typeof EVENT_DELIVERY_VERSION;
  readonly sequence: number;
  readonly timestamp: number;
  readonly deliveryId: string;
  readonly eventInstanceId: string;
  readonly triggerId: string;
  readonly envelope: UnknownEventEnvelope;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router-records.types.ts#L5)

## `router.ts`

### EVENT_DELIVERY_VERSION

**Signature**

```ts
declare const EVENT_DELIVERY_VERSION: 1;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router.ts#L47)

### EventDeliveryRecord

**Signature**

```ts
declare const EventDeliveryRecord: EventDeliveryRecord;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router.ts#L48)

### EventDeliveryResult

**Signature**

```ts
declare const EventDeliveryResult: EventDeliveryResult;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router.ts#L37)

### EventFanoutResult

**Signature**

```ts
declare const EventFanoutResult: EventFanoutResult;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router.ts#L38)

### EventRouter

**Signature**

```ts
declare const EventRouter: EventRouter;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router.ts#L39)

### EventRouterInput

**Signature**

```ts
declare const EventRouterInput: EventRouterInput;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router.ts#L40)

### EventRouterOptions

**Signature**

```ts
declare const EventRouterOptions: EventRouterOptions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router.ts#L41)

### EventRouterRouteOptions

**Signature**

```ts
declare const EventRouterRouteOptions: EventRouterRouteOptions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router.ts#L42)

### EventRouterSnapshot

**Signature**

```ts
declare const EventRouterSnapshot: EventRouterSnapshot;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router.ts#L43)

### EventRouterStateError

**Signature**

```ts
declare const EventRouterStateError: typeof EventRouterStateError;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router.ts#L47)

### EventRouterTrigger

**Signature**

```ts
declare const EventRouterTrigger: EventRouterTrigger;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router.ts#L44)

### EventTriggerSnapshot

**Signature**

```ts
declare const EventTriggerSnapshot: EventTriggerSnapshot;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router.ts#L45)

### createEventRouter

Routes accepted envelopes to independently delivered exact-event triggers.

**Signature**

```ts
declare const createEventRouter: (
  requestedRoot: string,
  options?: EventRouterOptions,
) => Promise<EventRouter>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/events/router.ts#L54)

## `index.ts`

### "./agent-state/index.js" (namespace export)

Re-exports all named exports from the "./agent-state/index.js" module.

**Signature**

```ts
export * from "./agent-state/index.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L56)

### "./buckets/index.js" (namespace export)

Re-exports all named exports from the "./buckets/index.js" module.

**Signature**

```ts
export * from "./buckets/index.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L1)

### "./cache/index.js" (namespace export)

Re-exports all named exports from the "./cache/index.js" module.

**Signature**

```ts
export * from "./cache/index.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L2)

### "./events/admin.js" (namespace export)

Re-exports all named exports from the "./events/admin.js" module.

**Signature**

```ts
export * from "./events/admin.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L33)

### "./events/log.js" (namespace export)

Re-exports all named exports from the "./events/log.js" module.

**Signature**

```ts
export * from "./events/log.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L29)

### "./events/router.js" (namespace export)

Re-exports all named exports from the "./events/router.js" module.

**Signature**

```ts
export * from "./events/router.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L30)

### "./jobs/admin.js" (namespace export)

Re-exports all named exports from the "./jobs/admin.js" module.

**Signature**

```ts
export * from "./jobs/admin.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L28)

### "./jobs/queue-utils.js" (namespace export)

Re-exports all named exports from the "./jobs/queue-utils.js" module.

**Signature**

```ts
export * from "./jobs/queue-utils.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L4)

### "./jobs/queue.js" (namespace export)

Re-exports all named exports from the "./jobs/queue.js" module.

**Signature**

```ts
export * from "./jobs/queue.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L3)

### "./jobs/retry.js" (namespace export)

Re-exports all named exports from the "./jobs/retry.js" module.

**Signature**

```ts
export * from "./jobs/retry.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L16)

### "./realtime/index.js" (namespace export)

Re-exports all named exports from the "./realtime/index.js" module.

**Signature**

```ts
export * from "./realtime/index.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L55)

### "./runtime-capabilities.js" (namespace export)

Re-exports all named exports from the "./runtime-capabilities.js" module.

**Signature**

```ts
export * from "./runtime-capabilities.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L54)

### CompiledSchedule

**Signature**

```ts
declare const CompiledSchedule: CompiledSchedule;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L19)

### DEFAULT_EPHEMERAL_CAPACITY

**Signature**

```ts
declare const DEFAULT_EPHEMERAL_CAPACITY: 100;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L36)

### DurableEventDeliveryResult

**Signature**

```ts
declare const DurableEventDeliveryResult: EventDeliveryResult;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L51)

### EPHEMERAL_DELIVERY_CAPABILITIES

**Signature**

```ts
declare const EPHEMERAL_DELIVERY_CAPABILITIES: Readonly<{
  readonly persistence: "none";
  readonly restartRecovery: false;
  readonly dropPolicy: "drop-newest";
}>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L37)

### EVENT_DELIVERY_CAPABILITIES

**Signature**

```ts
declare const EVENT_DELIVERY_CAPABILITIES: Readonly<{
  readonly persistence: "restart-recovery";
  readonly restartRecovery: true;
  readonly atLeastOnce: true;
  readonly exactlyOnce: false;
  readonly ordering: "unsupported";
  readonly orderedByKey: false;
}>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L44)

### EphemeralDelivery

**Signature**

```ts
declare const EphemeralDelivery: EphemeralDelivery;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L40)

### EphemeralDeliveryResult

**Signature**

```ts
declare const EphemeralDeliveryResult: EphemeralDeliveryResult;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L41)

### EphemeralDeliverySnapshot

**Signature**

```ts
declare const EphemeralDeliverySnapshot: EphemeralDeliverySnapshot;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L42)

### EventDelivery

**Signature**

```ts
declare const EventDelivery: EventDelivery;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L46)

### EventDeliveryBinding

**Signature**

```ts
declare const EventDeliveryBinding: EventDeliveryBinding;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L47)

### EventDeliveryBoundary

**Signature**

```ts
declare const EventDeliveryBoundary: EventDeliveryBoundary;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L48)

### EventDeliveryLedgerRecord

**Signature**

```ts
declare const EventDeliveryLedgerRecord: EventDeliveryLedgerRecord;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L49)

### EventDeliveryOptions

**Signature**

```ts
declare const EventDeliveryOptions: EventDeliveryOptions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L50)

### EventDeliverySnapshot

**Signature**

```ts
declare const EventDeliverySnapshot: EventDeliverySnapshot;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L52)

### JobRecord

**Signature**

```ts
declare const JobRecord: {
  readonly version: 1;
  readonly sequence: number;
  readonly instanceId: string;
  readonly kind: string;
  readonly timestamp: number;
  readonly data: Json;
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L7)

### JobRecordInput

**Signature**

```ts
declare const JobRecordInput: JobRecordInput;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L8)

### JobStore

**Signature**

```ts
declare const JobStore: JobStore;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L9)

### JobStoreBoundary

**Signature**

```ts
declare const JobStoreBoundary: JobStoreBoundary;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L10)

### JobStoreCheckpoint

**Signature**

```ts
declare const JobStoreCheckpoint: {
  readonly version: 1;
  readonly commit: number;
  readonly sequence: number;
  readonly offset: number;
  readonly recordCount: number;
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L11)

### JobStoreIndex

**Signature**

```ts
declare const JobStoreIndex: {
  readonly version: 1;
  readonly commit: number;
  readonly entries: {
    readonly [x: string]: { readonly sequence: number; readonly offset: number };
  };
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L12)

### JobStoreOptions

**Signature**

```ts
declare const JobStoreOptions: JobStoreOptions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L13)

### JobStoreSnapshot

**Signature**

```ts
declare const JobStoreSnapshot: JobStoreSnapshot;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L14)

### LocalEventProvider

**Signature**

```ts
declare const LocalEventProvider: LocalEventProvider;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L32)

### ScheduleEnqueue

**Signature**

```ts
declare const ScheduleEnqueue: ScheduleEnqueue;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L21)

### ScheduleEnqueueContext

**Signature**

```ts
declare const ScheduleEnqueueContext: ScheduleEnqueueContext;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L20)

### ScheduleRun

**Signature**

```ts
declare const ScheduleRun: ScheduleRun;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L25)

### ScheduleValidationError

**Signature**

```ts
declare const ScheduleValidationError: typeof ScheduleValidationError;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L17)

### Scheduler

**Signature**

```ts
declare const Scheduler: Scheduler;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L26)

### SchedulerClock

**Signature**

```ts
declare const SchedulerClock: SchedulerClock;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L23)

### SchedulerOptions

**Signature**

```ts
declare const SchedulerOptions: SchedulerOptions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L24)

### SchedulerRegistration

**Signature**

```ts
declare const SchedulerRegistration: SchedulerRegistration;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L22)

### compileSchedule

**Signature**

```ts
declare const compileSchedule: (
  schedule: ScheduleDefinition,
  options?: { readonly currentDate?: Date },
) => CompiledSchedule;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L17)

### createEphemeralDelivery

**Signature**

```ts
declare const createEphemeralDelivery: (
  invoke: (envelope: UnknownEventEnvelope) => Promise<unknown>,
  requestedCapacity?: number,
) => EphemeralDelivery;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L35)

### createEventDelivery

**Signature**

```ts
declare const createEventDelivery: (
  root: string,
  binding: EventDeliveryBinding,
  options?: EventDeliveryOptions,
) => Promise<EventDelivery>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L44)

### createJobStore

**Signature**

```ts
declare const createJobStore: (
  requestedRoot: string,
  options?: JobStoreOptions,
) => Promise<JobStore>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L5)

### createLocalEventProvider

**Signature**

```ts
declare const createLocalEventProvider: (root: string) => Promise<LocalEventProvider>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L31)

### createScheduler

**Signature**

```ts
declare const createScheduler: (options?: SchedulerOptions) => Scheduler;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/index.ts#L17)

## `admin-contracts.ts`

### JOB_ADMIN_PROTOCOL

**Signature**

```ts
declare const JOB_ADMIN_PROTOCOL: "relkit.jobs.admin";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.ts#L36)

### JOB_ADMIN_VERSION

**Signature**

```ts
declare const JOB_ADMIN_VERSION: 1;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.ts#L37)

### JobActionContract

**Signature**

```ts
declare const JobActionContract: JobActionContract;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.ts#L32)

### JobActionRequest

**Signature**

```ts
declare const JobActionRequest: JobActionRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.ts#L27)

### JobAdminAction

**Signature**

```ts
declare const JobAdminAction: JobAdminAction;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.ts#L21)

### JobAdminActionOutcome

**Signature**

```ts
declare const JobAdminActionOutcome: JobAdminActionOutcome;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.ts#L22)

### JobAdminActionRecord

**Signature**

```ts
declare const JobAdminActionRecord: JobAdminActionRecord;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.ts#L31)

### JobAdminActionSink

**Signature**

```ts
declare const JobAdminActionSink: JobAdminActionSink;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.ts#L33)

### JobAdminMode

**Signature**

```ts
declare const JobAdminMode: JobAdminMode;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.ts#L20)

### JobAdminVersion

**Signature**

```ts
declare const JobAdminVersion: JobAdminVersion;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.ts#L23)

### JobCancelRequest

**Signature**

```ts
declare const JobCancelRequest: JobActionRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.ts#L29)

### JobDeadLetterRequest

**Signature**

```ts
declare const JobDeadLetterRequest: JobActionRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.ts#L30)

### JobQueryContract

**Signature**

```ts
declare const JobQueryContract: JobQueryContract;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.ts#L26)

### JobQueryRequest

**Signature**

```ts
declare const JobQueryRequest: JobQueryRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.ts#L25)

### JobRetryRequest

**Signature**

```ts
declare const JobRetryRequest: JobActionRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.ts#L28)

### JobStatusContract

**Signature**

```ts
declare const JobStatusContract: JobStatusContract;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.ts#L24)

## `admin-contracts.types.ts`

### JobActionContract (interface)

Versioned job mutation result including status and audit record.

**Signature**

```ts
export interface JobActionContract extends JobAdminVersion {
  readonly action: JobAdminAction;
  readonly status: JobStatusContract;
  readonly record: JobAdminActionRecord;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.types.ts#L84)

### JobActionRequest (interface)

Base job administration request with target identity and audit reason.

**Signature**

```ts
export interface JobActionRequest {
  readonly protocol?: typeof JOB_ADMIN_PROTOCOL;
  readonly version?: typeof JOB_ADMIN_VERSION;
  readonly instanceId: string;
  readonly reason?: string;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.types.ts#L53)

### JobAdminAction (type alias)

Supported audited queue administration action.

**Signature**

```ts
type JobAdminAction = "retry" | "cancel" | "dead-letter";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.types.ts#L9)

### JobAdminActionOutcome (type alias)

Whether an administration action was applied or rejected.

**Signature**

```ts
type JobAdminActionOutcome = "applied" | "rejected";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.types.ts#L12)

### JobAdminActionRecord (interface)

Immutable audit record retained for each applied or rejected job action.

**Signature**

```ts
export interface JobAdminActionRecord extends JobAdminVersion {
  readonly actionId: string;
  readonly action: JobAdminAction;
  readonly instanceId: string;
  readonly mode: JobAdminMode;
  readonly outcome: JobAdminActionOutcome;
  readonly requestedAt: number;
  readonly fromState?: JobQueueState;
  readonly toState?: JobQueueState;
  readonly errorCode?: string;
  readonly reason?: string;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.types.ts#L70)

### JobAdminActionSink (type alias)

Optional notification sink whose rejection cannot change the action outcome.

**Signature**

```ts
type JobAdminActionSink = (record: JobAdminActionRecord) => MaybePromise<void>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.types.ts#L91)

### JobAdminMode (type alias)

Environment mode controlling local administration mutations.

**Signature**

```ts
type JobAdminMode = "development" | "test" | "production";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.types.ts#L6)

### JobAdminVersion (interface)

Protocol identity carried by job administration contracts.

**Signature**

```ts
export interface JobAdminVersion {
  readonly protocol: typeof JOB_ADMIN_PROTOCOL;
  readonly version: typeof JOB_ADMIN_VERSION;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.types.ts#L15)

### JobCancelRequest (type alias)

Job cancellation request with optional audit reason.

**Signature**

```ts
type JobCancelRequest = JobActionRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.types.ts#L64)

### JobDeadLetterRequest (type alias)

Job dead-letter request with optional audit reason.

**Signature**

```ts
type JobDeadLetterRequest = JobActionRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.types.ts#L67)

### JobQueryContract (interface)

Versioned bounded page of safe job status records.

**Signature**

```ts
export interface JobQueryContract extends JobAdminVersion {
  readonly items: readonly JobStatusContract[];
  readonly counts: JobQueueCounts;
  readonly nextCursor?: string;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.types.ts#L46)

### JobQueryRequest (interface)

Optional identity, state and pagination filters for job inspection.

**Signature**

```ts
export interface JobQueryRequest {
  readonly protocol?: typeof JOB_ADMIN_PROTOCOL;
  readonly version?: typeof JOB_ADMIN_VERSION;
  readonly instanceId?: string;
  readonly state?: JobQueueState;
  readonly states?: readonly JobQueueState[];
  readonly cursor?: string;
  readonly limit?: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.types.ts#L35)

### JobRetryRequest (type alias)

Job retry request with optional policy override.

**Signature**

```ts
type JobRetryRequest = JobActionRequest;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.types.ts#L61)

### JobStatusContract (interface)

Safe, versioned state returned to inspector consumers.

**Signature**

```ts
export interface JobStatusContract extends JobAdminVersion {
  readonly instanceId: string;
  readonly state: JobQueueState;
  readonly profile: string;
  readonly attempt: number;
  readonly acceptedAt: number;
  readonly order: number;
  readonly availableAt?: number;
  readonly leaseExpiresAt?: number;
  readonly idempotencyExpiresAt?: number;
  readonly failure?: JobFailureMetadata;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-contracts.types.ts#L21)

## `admin-errors.ts`

Preserves the public job admin error identity and stable error code.

### JobAdminError (class)

Preserves the public job admin error identity and stable error code.

**Signature**

```ts
declare class JobAdminError { constructor(
    readonly code: string,
    message: string,
  ) }
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin-errors.ts#L2)

## `admin.ts`

### "./admin-contracts.js" (namespace export)

Re-exports all named exports from the "./admin-contracts.js" module.

**Signature**

```ts
export * from "./admin-contracts.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin.ts#L40)

### JobAdmin

**Signature**

```ts
declare const JobAdmin: JobAdmin;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin.ts#L38)

### JobAdminError

**Signature**

```ts
declare const JobAdminError: typeof JobAdminError;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin.ts#L41)

### JobAdminOptions

**Signature**

```ts
declare const JobAdminOptions: JobAdminOptions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin.ts#L38)

### createJobAdmin

Exposes versioned local job inspection and explicitly audited mutations.

**Signature**

```ts
declare const createJobAdmin: (queue: JobQueue, options?: JobAdminOptions) => JobAdmin;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin.ts#L48)

## `admin.types.ts`

### JobAdmin (interface)

Versioned job inspection and audited development mutation interface.

**Signature**

```ts
export interface JobAdmin {
  readonly protocol: typeof JOB_ADMIN_PROTOCOL;
  readonly version: typeof JOB_ADMIN_VERSION;
  readonly status: (instanceId: string) => JobStatusContract | undefined;
  readonly query: (request?: JobQueryRequest) => JobQueryContract;
  readonly retry: (request: string | JobActionRequest) => Promise<JobActionContract>;
  readonly cancel: (request: string | JobActionRequest) => Promise<JobActionContract>;
  readonly deadLetter: (request: string | JobActionRequest) => Promise<JobActionContract>;
  readonly actions: () => readonly JobAdminActionRecord[];
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin.types.ts#L25)

### JobAdminOptions (interface)

Local administration mode and isolated audit/clock hooks.

**Signature**

```ts
export interface JobAdminOptions {
  readonly mode?: JobAdminMode;
  readonly environment?: JobAdminMode;
  readonly enabled?: boolean;
  readonly now?: () => number;
  readonly createActionId?: () => string;
  readonly onAction?: JobAdminActionSink;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/admin.types.ts#L15)

## `queue-utils.ts`

### JOB_QUEUE_STATES

**Signature**

```ts
declare const JOB_QUEUE_STATES: readonly [
  "accepted",
  "available",
  "leased",
  "delayed",
  "completed",
  "dead-lettered",
];
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.ts#L42)

### JobFailureKind

**Signature**

```ts
declare const JobFailureKind: JobFailureKind;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.ts#L29)

### JobFailureMetadata

**Signature**

```ts
declare const JobFailureMetadata: JobFailureMetadata;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.ts#L32)

### JobFailureOutcome

**Signature**

```ts
declare const JobFailureOutcome: JobFailureOutcome;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.ts#L30)

### JobFailureRetry

**Signature**

```ts
declare const JobFailureRetry: JobFailureRetry;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.ts#L31)

### JobIdempotencyDefinition

**Signature**

```ts
declare const JobIdempotencyDefinition: JobIdempotencyDefinition;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.ts#L24)

### JobIdempotencyRecord

**Signature**

```ts
declare const JobIdempotencyRecord: JobIdempotencyRecord;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.ts#L25)

### JobQueue

**Signature**

```ts
declare const JobQueue: JobQueue;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.ts#L39)

### JobQueueAcceptance

**Signature**

```ts
declare const JobQueueAcceptance: JobQueueAcceptance;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.ts#L28)

### JobQueueAdminRetryOptions

**Signature**

```ts
declare const JobQueueAdminRetryOptions: JobQueueAdminRetryOptions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.ts#L36)

### JobQueueCounts

**Signature**

```ts
declare const JobQueueCounts: Readonly<
  Record<"accepted" | "completed" | "available" | "leased" | "delayed" | "dead-lettered", number>
>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.ts#L37)

### JobQueueEnqueue

**Signature**

```ts
declare const JobQueueEnqueue: JobQueueEnqueue;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.ts#L33)

### JobQueueEntry

**Signature**

```ts
declare const JobQueueEntry: JobQueueEntry;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.ts#L26)

### JobQueueLeaseOptions

**Signature**

```ts
declare const JobQueueLeaseOptions: JobQueueLeaseOptions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.ts#L34)

### JobQueueOptions

**Signature**

```ts
declare const JobQueueOptions: JobQueueOptions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.ts#L38)

### JobQueueState

**Signature**

```ts
declare const JobQueueState:
  "accepted" | "completed" | "available" | "leased" | "delayed" | "dead-lettered";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.ts#L22)

### JobQueueStateError (class)

Preserves the public job queue state error identity and stable error code.

**Signature**

```ts
declare class JobQueueStateError {
  constructor(message: string);
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.ts#L52)

### code (property)

**Signature**

```ts
readonly code: "RELKIT_JOB_QUEUE_STATE_INVALID"
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.ts#L53)

### JobQueueTransitionOptions

**Signature**

```ts
declare const JobQueueTransitionOptions: JobQueueTransitionOptions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.ts#L35)

### JobState

**Signature**

```ts
declare const JobState:
  "accepted" | "completed" | "available" | "leased" | "delayed" | "dead-lettered";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.ts#L23)

### MutableQueueState

**Signature**

```ts
declare const MutableQueueState: MutableQueueState;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.ts#L27)

### assertTime

Rejects times outside the nonnegative safe millisecond range.

**Signature**

```ts
declare const assertTime: (value: number, label: string) => void;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.ts#L75)

### transitions

**Signature**

```ts
declare const transitions: Readonly<
  Record<
    "accepted" | "completed" | "available" | "leased" | "delayed" | "dead-lettered",
    ReadonlyArray<"accepted" | "completed" | "available" | "leased" | "delayed" | "dead-lettered">
  >
>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.ts#L61)

## `queue-utils.types.ts`

### JobFailureKind (type alias)

Public classification of a failed queue attempt.

**Signature**

```ts
type JobFailureKind = "application" | "provider" | "cancellation" | "timeout" | "defect";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.types.ts#L54)

### JobFailureMetadata (interface)

Public, JSON-safe failure data retained with a delayed or dead-lettered job.

**Signature**

```ts
export interface JobFailureMetadata {
  readonly kind: JobFailureKind;
  readonly outcome: JobFailureOutcome;
  readonly code: string;
  readonly message: string;
  readonly data?: JsonValue;
  readonly status?: number;
  readonly retry?: JobFailureRetry;
  readonly afterMs?: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.types.ts#L64)

### JobFailureOutcome (type alias)

Public terminal or retry outcome of a failed queue attempt.

**Signature**

```ts
type JobFailureOutcome = "declared-error" | "provider-failure" | "cancelled" | "timeout" | "defect";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.types.ts#L57)

### JobFailureRetry (type alias)

Retry hint retained in safe failure metadata.

**Signature**

```ts
type JobFailureRetry = "never" | "later";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.types.ts#L61)

### JobIdempotencyDefinition (interface)

Caller deduplication identity and retention policy for a queue acceptance.

**Signature**

```ts
export interface JobIdempotencyDefinition {
  readonly key: string;
  readonly retentionMs: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.types.ts#L11)

### JobIdempotencyRecord (interface)

Persisted acceptance identity and expiry used for deduplication.

**Signature**

```ts
export interface JobIdempotencyRecord {
  readonly key: string;
  readonly expiresAt: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.types.ts#L17)

### JobQueue (interface)

Promise mutation and synchronous inspection contract for one durable queue.

**Signature**

```ts
export interface JobQueue {
  readonly ownerToken: string;
  readonly ready: () => Promise<void>;
  readonly enqueue: (input: JobQueueEnqueue) => Promise<JobQueueAcceptance>;
  readonly acquire: (
    instanceId?: string,
    options?: JobQueueLeaseOptions,
  ) => Promise<JobQueueEntry | undefined>;
  readonly renew: (instanceId: string, options?: JobQueueLeaseOptions) => Promise<JobQueueEntry>;
  readonly transition: (
    instanceId: string,
    state: JobQueueState,
    options?: JobQueueTransitionOptions,
  ) => Promise<JobQueueEntry>;
  /** Requeues one dead letter as a fresh attempt without widening normal transitions. */
  readonly adminRetry: (
    instanceId: string,
    options?: JobQueueAdminRetryOptions,
  ) => Promise<JobQueueEntry>;
  /** Moves one eligible nonterminal entry to a dead letter with safe metadata. */
  readonly adminDeadLetter: (
    instanceId: string,
    failure: JobFailureMetadata,
  ) => Promise<JobQueueEntry>;
  readonly recover: (now?: number) => Promise<readonly JobQueueEntry[]>;
  readonly expire: (now?: number) => Promise<readonly JobQueueEntry[]>;
  readonly selectAvailable: (limit?: number, now?: number) => readonly JobQueueEntry[];
  readonly get: (instanceId: string) => JobQueueEntry | undefined;
  readonly counts: () => JobQueueCounts;
  readonly snapshot: () => readonly JobQueueEntry[];
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.types.ts#L118)

### JobQueueAcceptance (interface)

Durable acceptance information returned by queue admission.

**Signature**

```ts
export interface JobQueueAcceptance extends JobQueueEntry {
  readonly accepted: true;
  readonly duplicate: boolean;
  readonly idempotencyKey?: string;
  readonly idempotencyExpiresAt?: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.types.ts#L46)

### JobQueueAdminRetryOptions (interface)

Administrative retry preconditions and next-availability settings.

**Signature**

```ts
export interface JobQueueAdminRetryOptions {
  readonly availableAt?: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.types.ts#L101)

### JobQueueCounts (type alias)

Entry counts grouped by durable queue lifecycle state.

**Signature**

```ts
type JobQueueCounts = Readonly<Record<JobQueueState, number>>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.types.ts#L106)

### JobQueueEnqueue (interface)

Input required to accept a job into the local durable queue.

**Signature**

```ts
export interface JobQueueEnqueue {
  readonly input: JsonValue;
  readonly profile?: string;
  readonly instanceId?: string;
  readonly acceptedAt?: number;
  readonly idempotency?: JobIdempotencyDefinition;
  readonly propagation?: TracePropagation;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.types.ts#L76)

### JobQueueEntry (interface)

Durable queue state including acceptance, lease, retry and failure metadata.

**Signature**

```ts
export interface JobQueueEntry {
  readonly instanceId: string;
  readonly state: JobQueueState;
  readonly input: JsonValue;
  readonly profile: string;
  readonly attempt: number;
  readonly acceptedAt: number;
  readonly order: number;
  readonly availableAt?: number;
  readonly leaseOwner?: string;
  readonly leaseExpiresAt?: number;
  readonly idempotency?: JobIdempotencyRecord;
  readonly failure?: JobFailureMetadata;
  readonly propagation?: TracePropagation;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.types.ts#L23)

### JobQueueLeaseOptions (interface)

Caller ownership and duration settings for acquiring a lease.

**Signature**

```ts
export interface JobQueueLeaseOptions {
  readonly leaseDurationMs?: number;
  readonly leaseExpiresAt?: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.types.ts#L86)

### JobQueueOptions (interface)

Clock, persistence and policy options for a local queue.

**Signature**

```ts
export interface JobQueueOptions {
  readonly now?: () => number;
  readonly createInstanceId?: () => string;
  readonly ownerToken?: string;
  readonly leaseDurationMs?: number;
  readonly idempotency?: JobIdempotencyDefinition;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.types.ts#L109)

### JobQueueState (type alias)

Persisted lifecycle states supported by the local durable queue.

**Signature**

```ts
type JobQueueState = (typeof JOB_QUEUE_STATES)[number];
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.types.ts#L5)

### JobQueueTransitionOptions (interface)

Expected state, ownership and metadata for a durable transition.

**Signature**

```ts
export interface JobQueueTransitionOptions extends JobQueueLeaseOptions {
  readonly expectedState?: JobQueueState;
  readonly attempt?: number;
  readonly availableAt?: number;
  readonly leaseOwner?: string;
  readonly failure?: JobFailureMetadata;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.types.ts#L92)

### JobState (type alias)

Compatibility alias for the durable queue lifecycle state.

**Signature**

```ts
type JobState = JobQueueState;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.types.ts#L8)

### MutableQueueState (interface)

In-memory queue index and next acceptance order owned by serialized mutations.

**Signature**

```ts
export interface MutableQueueState {
  readonly entries: Map<string, JobQueueEntry>;
  nextOrder: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue-utils.types.ts#L40)

## `queue.ts`

### "./queue-utils.js" (namespace export)

Re-exports all named exports from the "./queue-utils.js" module.

**Signature**

```ts
export * from "./queue-utils.js";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue.ts#L29)

### JOB_QUEUE_STATES

**Signature**

```ts
declare const JOB_QUEUE_STATES: readonly [
  "accepted",
  "available",
  "leased",
  "delayed",
  "completed",
  "dead-lettered",
];
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue.ts#L28)

### JobQueueStateError

**Signature**

```ts
declare const JobQueueStateError: typeof JobQueueStateError;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue.ts#L28)

### createJobQueue

Provides durable queue state plus process-owned leases.

**Signature**

```ts
declare const createJobQueue: (store: JobStore, options?: JobQueueOptions) => JobQueue;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/queue.ts#L36)

## `retry.ts`

### RandomSource

**Signature**

```ts
declare const RandomSource: RandomSource;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/retry.ts#L23)

### RetryClassification

**Signature**

```ts
declare const RetryClassification: RetryClassification;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/retry.ts#L21)

### RetryOptions

**Signature**

```ts
declare const RetryOptions: RetryOptions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/retry.ts#L25)

### RetryPlan

**Signature**

```ts
declare const RetryPlan: RetryPlan;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/retry.ts#L24)

### RetryState

**Signature**

```ts
declare const RetryState: RetryState;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/retry.ts#L22)

### applyRetry

Applies one leased attempt's retry/dead-letter outcome durably.

**Signature**

```ts
declare const applyRetry: (
  queue: Pick<JobQueue, "get" | "transition">,
  instanceId: string,
  policy: RetryPolicy,
  failure: unknown,
  options?: RetryOptions,
) => Promise<JobQueueEntry>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/retry.ts#L101)

### calculateRetryDelay

Calculates a bounded, integer delay for a one-based completed attempt.

**Signature**

```ts
declare const calculateRetryDelay: (
  policy: RetryPolicy,
  attempt: number,
  random?: RandomSource,
) => number;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/retry.ts#L45)

### classifyFailure

Uses the declared error policy; non-declared failures are not retried.

**Signature**

```ts
declare const classifyFailure: (value: unknown) => RetryClassification;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/retry.ts#L32)

### planRetry

Combines normalized failure classification, attempt limits and retry jitter into a retry plan.

**Signature**

```ts
declare const planRetry: (
  policy: RetryPolicy,
  attempt: number,
  failure: unknown,
  options?: Pick<RetryOptions, "random">,
) => RetryPlan;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/retry.ts#L72)

### safeFailureMetadata

Copies the public failure envelope so persisted metadata cannot retain arbitrary error objects.

**Signature**

```ts
declare const safeFailureMetadata: (value: unknown) => JobFailureMetadata;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/retry.ts#L126)

## `retry.types.ts`

### RandomSource (type alias)

Replaceable source of values in [0, 1) for deterministic jitter.

**Signature**

```ts
type RandomSource = () => number;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/retry.types.ts#L10)

### RetryClassification (type alias)

Whether the normalized failure permits another attempt.

**Signature**

```ts
type RetryClassification = "retryable" | "non-retryable";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/retry.types.ts#L4)

### RetryOptions (interface)

Clock, jitter and transition options for applying retry policy.

**Signature**

```ts
export interface RetryOptions {
  readonly now?: () => number;
  readonly random?: RandomSource;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/retry.types.ts#L22)

### RetryPlan (interface)

Validated retry classification, delay and safe failure metadata.

**Signature**

```ts
export interface RetryPlan {
  readonly classification: RetryClassification;
  readonly state: RetryState;
  readonly attempt: number;
  readonly delayMs: number;
  readonly failure: JobFailureMetadata;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/retry.types.ts#L13)

### RetryState (type alias)

Durable queue outcome selected by retry policy.

**Signature**

```ts
type RetryState = "delayed" | "dead-lettered";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/retry.types.ts#L7)

## `schedule-definition.ts`

### ScheduleValidationError (class)

Preserves the public schedule validation error identity and stable error code.

**Signature**

```ts
declare class ScheduleValidationError {
  constructor(message: string);
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/schedule-definition.ts#L7)

### code (property)

**Signature**

```ts
readonly code: "RELKIT_SCHEDULE_INVALID"
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/schedule-definition.ts#L8)

### compileSchedule

Validates a static schedule and hides the cron parser behind native dates.

**Signature**

```ts
declare const compileSchedule: (
  schedule: ScheduleDefinition,
  options?: { readonly currentDate?: Date },
) => CompiledSchedule;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/schedule-definition.ts#L21)

### isRecord

Checks for a non-null, non-array object before inspecting unknown fields.

**Signature**

```ts
declare const isRecord: (value: unknown) => value is Record<string, any>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/schedule-definition.ts#L94)

### parseNext

Computes the next cron occurrence within the configured timezone.

**Signature**

```ts
declare const parseNext: (cron: string, timezone: string, currentDate: Date) => Date;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/schedule-definition.ts#L59)

### requiredText

Rejects missing or blank schedule identifiers.

**Signature**

```ts
declare const requiredText: (value: unknown, name: string) => string;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/schedule-definition.ts#L74)

### validDate

Rejects invalid clock dates before scheduling work.

**Signature**

```ts
declare const validDate: (value: Date, name: string) => Date;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/schedule-definition.ts#L84)

## `scheduler.ts`

### CompiledSchedule

**Signature**

```ts
declare const CompiledSchedule: CompiledSchedule;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.ts#L29)

### LocalSchedulerService (class)

Owns schedule registrations, next-fire positions and active overlap counters.

**Signature**

```ts
declare class LocalSchedulerService
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.ts#L55)

### ScheduleEnqueue

**Signature**

```ts
declare const ScheduleEnqueue: ScheduleEnqueue;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.ts#L31)

### ScheduleEnqueueContext

**Signature**

```ts
declare const ScheduleEnqueueContext: ScheduleEnqueueContext;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.ts#L30)

### ScheduleRun

**Signature**

```ts
declare const ScheduleRun: ScheduleRun;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.ts#L35)

### ScheduleValidationError

**Signature**

```ts
declare const ScheduleValidationError: typeof ScheduleValidationError;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.ts#L27)

### Scheduler

**Signature**

```ts
declare const Scheduler: Scheduler;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.ts#L36)

### SchedulerClock

**Signature**

```ts
declare const SchedulerClock: SchedulerClock;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.ts#L33)

### SchedulerOptions

**Signature**

```ts
declare const SchedulerOptions: SchedulerOptions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.ts#L34)

### SchedulerRegistration

**Signature**

```ts
declare const SchedulerRegistration: SchedulerRegistration;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.ts#L32)

### compileSchedule

**Signature**

```ts
declare const compileSchedule: (
  schedule: ScheduleDefinition,
  options?: { readonly currentDate?: Date },
) => CompiledSchedule;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.ts#L27)

### createScheduler

Runs due schedules against an injected clock without owning or calling handlers.

**Signature**

```ts
declare const createScheduler: (options?: SchedulerOptions) => Scheduler;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.ts#L43)

### makeSchedulerService

Creates lazy registration, inspection and due-work operations over one owned state.

**Signature**

```ts
declare const makeSchedulerService: (
  options?: SchedulerOptions | undefined,
) => Effect.Effect<SchedulerEffects, LocalOperationError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.ts#L84)

### schedulerLayer

Provides an explicitly driven scheduler without starting an automatic timer.

**Example**

```ts
import { Effect } from "effect";
import { LocalSchedulerService, schedulerLayer } from "./scheduler.js";

const program = Effect.gen(function* () {
  const scheduler = yield* LocalSchedulerService;
  return yield* scheduler.runDue();
});
await Effect.runPromise(program.pipe(Effect.provide(schedulerLayer())));
```

**Signature**

```ts
declare const schedulerLayer: (
  options?: SchedulerOptions,
) => Layer.Layer<LocalSchedulerService, LocalOperationError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.ts#L75)

## `scheduler.types.ts`

### CompiledSchedule (interface)

Validated cron schedule with its normalized timezone and identity.

**Signature**

```ts
export interface CompiledSchedule {
  readonly id: string;
  readonly cron: string;
  readonly timezone: string;
  readonly input: JsonValue;
  readonly overlap: ScheduleOverlap;
  readonly nextFireAt: Date;
  readonly nextFire: (currentDate: Date) => Date;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.types.ts#L14)

### ScheduleEnqueue (type alias)

The scheduler only emits work through the common job enqueue/invocation seam.

**Signature**

```ts
type ScheduleEnqueue = (input: JsonValue, context: ScheduleEnqueueContext) => MaybePromise<unknown>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.types.ts#L31)

### ScheduleEnqueueContext (interface)

Occurrence identity and time supplied when enqueueing scheduled work.

**Signature**

```ts
export interface ScheduleEnqueueContext {
  readonly scheduleId: string;
  readonly fireAt: Date;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.types.ts#L25)

### ScheduleRun (interface)

Result of processing one due schedule occurrence.

**Signature**

```ts
export interface ScheduleRun {
  readonly scheduleId: string;
  readonly fireAt: Date;
  readonly status: "enqueued" | "skipped";
  readonly result?: unknown;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.types.ts#L55)

### ScheduleState (interface)

Registered schedule and its current next-fire/overlap bookkeeping.

**Signature**

```ts
export interface ScheduleState {
  readonly compiled: CompiledSchedule;
  readonly enqueue: ScheduleEnqueue;
  nextFireAt: number;
  active: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.types.ts#L63)

### Scheduler (interface)

Explicitly driven scheduler with registration, due-work execution and inspection.

**Signature**

```ts
export interface Scheduler {
  readonly register: (schedule: ScheduleDefinition, enqueue: ScheduleEnqueue) => CompiledSchedule;
  readonly nextFire: (scheduleId: string) => Date | undefined;
  readonly runDue: (currentDate?: Date | number) => Promise<readonly ScheduleRun[]>;
  readonly tick: (currentDate?: Date | number) => Promise<readonly ScheduleRun[]>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.types.ts#L71)

### SchedulerClock (interface)

Replaceable clock used by scheduler calculations.

**Signature**

```ts
export interface SchedulerClock {
  readonly now: () => Date | number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.types.ts#L43)

### SchedulerEffects (type alias)

Lazy scheduler operations shared by live composition and deterministic test substitutes.

**Signature**

```ts
type SchedulerEffects = {
  readonly [K in keyof Scheduler]: Scheduler[K] extends (...args: infer A) => infer R
    ? (...args: A) => Effect.Effect<Awaited<R>, LocalOperationError>
    : never;
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.types.ts#L7)

### SchedulerOptions (interface)

Clock and scheduling behavior supplied by the local scheduler owner.

**Signature**

```ts
export interface SchedulerOptions {
  readonly clock?: SchedulerClock;
  readonly now?: () => Date | number;
  readonly schedules?: readonly SchedulerRegistration[];
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.types.ts#L48)

### SchedulerRegistration (interface)

Schedule declaration paired with its enqueue callback.

**Signature**

```ts
export interface SchedulerRegistration {
  readonly schedule: ScheduleDefinition;
  readonly enqueue: ScheduleEnqueue;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/scheduler.types.ts#L37)

## `store.ts`

### JobIndexEntry

**Signature**

```ts
declare const JobIndexEntry: { readonly sequence: number; readonly offset: number };
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.ts#L40)

### JobRecord

**Signature**

```ts
declare const JobRecord: {
  readonly version: 1;
  readonly sequence: number;
  readonly instanceId: string;
  readonly kind: string;
  readonly timestamp: number;
  readonly data: Json;
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.ts#L39)

### JobRecordInput

**Signature**

```ts
declare const JobRecordInput: JobRecordInput;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.ts#L38)

### JobStore

**Signature**

```ts
declare const JobStore: JobStore;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.ts#L44)

### JobStoreBoundary

**Signature**

```ts
declare const JobStoreBoundary: JobStoreBoundary;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.ts#L36)

### JobStoreCheckpoint

**Signature**

```ts
declare const JobStoreCheckpoint: {
  readonly version: 1;
  readonly commit: number;
  readonly sequence: number;
  readonly offset: number;
  readonly recordCount: number;
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.ts#L42)

### JobStoreEffects

**Signature**

```ts
declare const JobStoreEffects: JobStoreEffects;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.ts#L45)

### JobStoreIndex

**Signature**

```ts
declare const JobStoreIndex: {
  readonly version: 1;
  readonly commit: number;
  readonly entries: {
    readonly [x: string]: { readonly sequence: number; readonly offset: number };
  };
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.ts#L41)

### JobStoreOptions

**Signature**

```ts
declare const JobStoreOptions: JobStoreOptions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.ts#L37)

### JobStoreSnapshot

**Signature**

```ts
declare const JobStoreSnapshot: JobStoreSnapshot;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.ts#L43)

### JobStoreStateError (class)

Preserves the public job store state error identity and stable error code.

**Signature**

```ts
declare class JobStoreStateError {
  constructor(message: string);
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.ts#L51)

### code (property)

**Signature**

```ts
readonly code: "RELKIT_JOB_STORE_STATE_INVALID"
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.ts#L52)

### LocalJobStoreService (class)

A durable journal whose serialization and lifecycle have one owner.

**Signature**

```ts
declare class LocalJobStoreService
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.ts#L61)

### STORE_VERSION

**Signature**

```ts
declare const STORE_VERSION: 1;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.ts#L48)

### createJobStore

Opens the journal through the established Promise interface.

**Signature**

```ts
declare const createJobStore: (
  requestedRoot: string,
  options?: JobStoreOptions,
) => Promise<JobStore>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.ts#L71)

### jobStoreLayer

Supplies and closes a durable journal through a scope-owned layer.

**Example**

```ts
import { Effect } from "effect";
import { LocalJobStoreService, jobStoreLayer } from "./store.js";

const program = Effect.gen(function* () {
  const journal = yield* LocalJobStoreService;
  return yield* journal.snapshot();
});
await Effect.runPromise(program.pipe(Effect.provide(jobStoreLayer("/tmp/example-journal"))));
```

**Signature**

```ts
declare const jobStoreLayer: (
  root: string,
  options?: JobStoreOptions,
) => Layer.Layer<LocalJobStoreService, LocalOperationError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.ts#L102)

### makeJobStore

Recovers a journal before exposing serialized append operations.

**Signature**

```ts
declare const makeJobStore: (
  requestedRoot: string,
  options?: JobStoreOptions | undefined,
) => Effect.Effect<JobStoreEffects, LocalOperationError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.ts#L116)

## `store.types.ts`

### JobIndexEntry (type alias)

Latest record sequence and byte offset for one job instance.

**Signature**

```ts
type JobIndexEntry = typeof JobIndexEntrySchema.Type;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.types.ts#L36)

### JobRecord (type alias)

Versioned durable journal record with ordered sequence and timestamp.

**Signature**

```ts
type JobRecord = typeof JobRecordSchema.Type;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.types.ts#L33)

### JobRecordInput (interface)

Canonical JSON record input before sequence and timestamp assignment.

**Signature**

```ts
export interface JobRecordInput {
  readonly instanceId: string;
  readonly kind: string;
  readonly data: JsonValue;
  readonly timestamp?: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.types.ts#L25)

### JobStore (interface)

Compatibility journal interface with durable append and explicit close.

**Signature**

```ts
export interface JobStore {
  readonly root: string;
  readonly paths: Readonly<ReturnType<typeof createJobStorePaths>>;
  readonly append: (input: JobRecordInput) => Promise<JobRecord>;
  readonly snapshot: () => JobStoreSnapshot;
  readonly close: () => Promise<void>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.types.ts#L52)

### JobStoreBoundary (type alias)

Durable commit milestones available to fault-injection and observation hooks.

**Signature**

```ts
type JobStoreBoundary = "record-fsynced" | "index-committed" | "checkpoint-committed";
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.types.ts#L13)

### JobStoreCheckpoint (type alias)

Committed sequence, record count and byte offset used for recovery.

**Signature**

```ts
type JobStoreCheckpoint = typeof JobCheckpointSchema.Type;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.types.ts#L42)

### JobStoreEffects (interface)

Effect operations for a durable journal and its committed snapshot.

**Signature**

```ts
export interface JobStoreEffects {
  readonly root: string;
  readonly paths: JobStore["paths"];
  readonly append: (input: JobRecordInput) => Effect.Effect<JobRecord, LocalOperationError>;
  readonly snapshot: () => Effect.Effect<JobStoreSnapshot>;
  readonly close: () => Effect.Effect<void>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.types.ts#L61)

### JobStoreIndex (type alias)

Versioned index rebuilt from the durable journal.

**Signature**

```ts
type JobStoreIndex = typeof JobIndexSchema.Type;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.types.ts#L39)

### JobStoreOptions (interface)

Clock, record validation and durable-boundary hooks for journal ownership.

**Signature**

```ts
export interface JobStoreOptions {
  readonly now?: () => number;
  /** Test-only failure seam; an error rejects append before acknowledgement. */
  readonly onBoundary?: (boundary: JobStoreBoundary) => void | Promise<void>;
  /** Optional semantic guard used by durable stores layered on this record format. */
  readonly validateData?: (data: JsonValue) => void;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.types.ts#L16)

### JobStoreSnapshot (interface)

Immutable recovered records, index and checkpoint.

**Signature**

```ts
export interface JobStoreSnapshot {
  readonly records: readonly JobRecord[];
  readonly index: JobStoreIndex;
  readonly checkpoint: JobStoreCheckpoint;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/jobs/store.types.ts#L45)

## `common.ts`

### LocalRealtimeError (class)

Preserves the public local realtime error identity and stable error code.

**Signature**

```ts
declare class LocalRealtimeError { constructor(
    readonly code: string,
    message: string,
  ) }
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/common.ts#L6)

### checkpoint

Builds the current journal checkpoint from the persisted sequence.

**Signature**

```ts
declare const checkpoint: (
  scope: RealtimeScope,
  state: LocalRealtimeState,
  sequence: number,
  historyStart: number,
  expiresAt: string,
) => ChannelCheckpoint;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/common.ts#L78)

### emptyPartition

Creates an empty retained event and presence partition.

**Signature**

```ts
declare const emptyPartition: (sequence: number) => StoredRealtimePartition;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/common.ts#L37)

### encodedBytes

Measures canonical JSON bytes for admission limits.

**Signature**

```ts
declare const encodedBytes: (value: unknown) => number;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/common.ts#L46)

### partitionKey

Encodes the channel and scope into a stable realtime partition key.

**Signature**

```ts
declare const partitionKey: (scope: RealtimeScope) => string;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/common.ts#L21)

### prunePartition

Removes expired events and enforces retention bounds without renumbering sequences.

**Signature**

```ts
declare const prunePartition: (
  partition: StoredRealtimePartition,
  now: number,
) => StoredRealtimePartition;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/common.ts#L56)

### scopeGap

Constructs a replay gap describing the requested checkpoint and current scope.

**Signature**

```ts
declare const scopeGap: (
  expected: RealtimeScope,
  actual: ChannelCheckpoint,
  providerEpoch: string,
) => "foreign" | "policy" | "session" | "provider-reset" | undefined;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/common.ts#L101)

## `provider.ts`

### LocalRealtimeProviderOptions

**Signature**

```ts
declare const LocalRealtimeProviderOptions: LocalRealtimeProviderOptions;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/provider.ts#L18)

### LocalRealtimeService (class)

Realtime operations sharing one persisted-state transaction owner.

**Signature**

```ts
declare class LocalRealtimeService
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/provider.ts#L21)

### createLocalRealtimeProvider

Provides realtime operations using filesystem-shared state.

**Signature**

```ts
declare const createLocalRealtimeProvider: (
  root: string,
  options?: LocalRealtimeProviderOptions,
) => RealtimeProvider;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/provider.ts#L31)

### createRealtimeProviderFromStore

Substitutes an existing Promise storage adapter at the compatibility edge.

**Signature**

```ts
declare const createRealtimeProviderFromStore: (
  store: RealtimeStateStore,
  pollingMs?: number,
) => RealtimeProvider;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/provider.ts#L46)

### makeRealtimeService

Composes realtime behavior over an Effect transaction interface.

**Signature**

```ts
declare const makeRealtimeService: (
  store: RealtimeStateStoreEffects,
  pollingMs?: number,
) => RealtimeEffects;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/provider.ts#L91)

### realtimeLayer

Builds one live realtime service through a substitutable layer.

**Example**

```ts
import { Effect } from "effect";
import { LocalRealtimeService, realtimeLayer } from "./provider.js";

const program = Effect.gen(function* () {
  const realtime = yield* LocalRealtimeService;
  return yield* realtime.getEpoch();
});
await Effect.runPromise(program.pipe(Effect.provide(realtimeLayer("/tmp/example-realtime"))));
```

**Signature**

```ts
declare const realtimeLayer: (
  root: string,
  pollingMs?: number,
) => Layer.Layer<LocalRealtimeService, LocalOperationError, never>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/provider.ts#L78)

## `provider.types.ts`

### LocalRealtimeProviderOptions (interface)

Polling configuration for filesystem-shared realtime observations.

**Signature**

```ts
export interface LocalRealtimeProviderOptions {
  readonly pollingMs?: number;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/provider.types.ts#L6)

### RealtimeEffects (type alias)

Effect methods corresponding to the established realtime provider surface.

**Signature**

```ts
type RealtimeEffects = {
  readonly [K in Exclude<keyof RealtimeProvider, "capabilities">]: RealtimeProvider[K] extends (
    ...args: infer A
  ) => infer R
    ? (...args: A) => Effect.Effect<Awaited<R>, LocalOperationError>
    : never;
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/provider.types.ts#L11)

## `state.ts`

### LOCAL_REALTIME_STATE_VERSION

**Signature**

```ts
declare const LOCAL_REALTIME_STATE_VERSION: 2;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/state.ts#L16)

### LocalRealtimeState

**Signature**

```ts
declare const LocalRealtimeState: {
  readonly version: 2;
  readonly providerEpoch: string;
  readonly sequence: number;
  readonly revision: number;
  readonly retainedBytes: number;
  readonly partitions: {
    readonly [x: string]: {
      readonly historyStart: number;
      readonly events: ReadonlyArray<{
        readonly sequence: number;
        readonly eventId: string;
        readonly event: string;
        readonly payload: unknown;
        readonly encodedBytes: number;
        readonly createdAt: string;
        readonly expiresAt: string;
      }>;
      readonly presence: ReadonlyArray<{
        readonly expiresAt: string;
        readonly leaseId: string;
        readonly connectionId: string;
        readonly opaqueMemberId?: string;
        readonly memberInfo?: unknown;
      }>;
    };
  };
  readonly receipts: {
    readonly [x: string]: {
      readonly semanticDigest: string;
      readonly expiresAt: string;
      readonly receipt: {
        readonly accepted: true;
        readonly profile: string;
        readonly providerEpoch: string;
        readonly checkpoint: {
          readonly applicationId: string;
          readonly environment: string;
          readonly profile: string;
          readonly providerEpoch: string;
          readonly sequence: string;
          readonly expiresAt: string;
          readonly historyStart: string;
          readonly channelId: string;
          readonly partition: string;
          readonly policyEpoch: string;
          readonly identityScope: string;
          readonly sessionEpoch: string;
          readonly tenantScope?: string;
        };
        readonly duplicate: boolean;
        readonly eventId: string;
        readonly operationId?: OperationId;
      };
    };
  };
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/state.ts#L13)

### StoredAppendReceipt

**Signature**

```ts
declare const StoredAppendReceipt: {
  readonly semanticDigest: string;
  readonly expiresAt: string;
  readonly receipt: {
    readonly accepted: true;
    readonly profile: string;
    readonly providerEpoch: string;
    readonly checkpoint: {
      readonly applicationId: string;
      readonly environment: string;
      readonly profile: string;
      readonly providerEpoch: string;
      readonly sequence: string;
      readonly expiresAt: string;
      readonly historyStart: string;
      readonly channelId: string;
      readonly partition: string;
      readonly policyEpoch: string;
      readonly identityScope: string;
      readonly sessionEpoch: string;
      readonly tenantScope?: string;
    };
    readonly duplicate: boolean;
    readonly eventId: string;
    readonly operationId?: OperationId;
  };
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/state.ts#L12)

### StoredPresenceLease

**Signature**

```ts
declare const StoredPresenceLease: {
  readonly expiresAt: string;
  readonly leaseId: string;
  readonly connectionId: string;
  readonly opaqueMemberId?: string;
  readonly memberInfo?: unknown;
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/state.ts#L10)

### StoredRealtimeEvent

**Signature**

```ts
declare const StoredRealtimeEvent: {
  readonly sequence: number;
  readonly eventId: string;
  readonly event: string;
  readonly payload: unknown;
  readonly encodedBytes: number;
  readonly createdAt: string;
  readonly expiresAt: string;
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/state.ts#L9)

### StoredRealtimePartition

**Signature**

```ts
declare const StoredRealtimePartition: {
  readonly historyStart: number;
  readonly events: ReadonlyArray<{
    readonly sequence: number;
    readonly eventId: string;
    readonly event: string;
    readonly payload: unknown;
    readonly encodedBytes: number;
    readonly createdAt: string;
    readonly expiresAt: string;
  }>;
  readonly presence: ReadonlyArray<{
    readonly expiresAt: string;
    readonly leaseId: string;
    readonly connectionId: string;
    readonly opaqueMemberId?: string;
    readonly memberInfo?: unknown;
  }>;
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/state.ts#L11)

### emptyRealtimeState

Creates format-v1 realtime state with an epoch and empty partition/receipt indexes.

**Signature**

```ts
declare const emptyRealtimeState: (epoch?: string) => LocalRealtimeState;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/state.ts#L23)

## `state.types.ts`

### LocalRealtimeState (type alias)

Complete validated version-two realtime snapshot.

**Signature**

```ts
type LocalRealtimeState = typeof RealtimeState.Type;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/state.types.ts#L10)

### StoredAppendReceipt (type alias)

Idempotent append acknowledgement with semantic digest and expiry.

**Signature**

```ts
type StoredAppendReceipt = typeof AppendReceipt.Type;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/state.types.ts#L22)

### StoredPresenceLease (type alias)

Connection lease decoded before expiry and capacity decisions.

**Signature**

```ts
type StoredPresenceLease = typeof PresenceLease.Type;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/state.types.ts#L16)

### StoredRealtimeEvent (type alias)

Stored ordered event whose application payload remains opaque.

**Signature**

```ts
type StoredRealtimeEvent = typeof RealtimeEvent.Type;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/state.types.ts#L13)

### StoredRealtimePartition (type alias)

Atomic partition history and presence representation.

**Signature**

```ts
type StoredRealtimePartition = typeof RealtimePartition.Type;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/state.types.ts#L19)

## `storage.types.ts`

### RealtimeStateStore (interface)

Existing Promise transaction seam for third-party storage adapters.

**Signature**

```ts
export interface RealtimeStateStore {
  readonly read: () => Promise<LocalRealtimeState>;
  readonly update: <Value>(
    change: (state: LocalRealtimeState) => {
      readonly state: LocalRealtimeState;
      readonly value: Value;
    },
  ) => Promise<Value>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/storage.types.ts#L6)

### RealtimeStateStoreEffects (interface)

Effect operations sharing one transactional initialization and lock owner.

**Signature**

```ts
export interface RealtimeStateStoreEffects {
  readonly read: () => Effect.Effect<LocalRealtimeState, LocalOperationError>;
  readonly update: <Value>(
    change: (state: LocalRealtimeState) => {
      readonly state: LocalRealtimeState;
      readonly value: Value;
    },
  ) => Effect.Effect<Value, LocalOperationError>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/realtime/storage.types.ts#L17)

## `runtime-capabilities.ts`

### LocalJobProvider

**Signature**

```ts
declare const LocalJobProvider: LocalJobProvider;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/runtime-capabilities.ts#L8)

### createLocalJobProvider

Creates a profile-owned durable queue provider through its established synchronous constructor.

**Signature**

```ts
declare const createLocalJobProvider: {
  (root: string, profile: string): LocalJobProvider;
  (root: string, profile: string, executionModel: "task"): JobsAdapterRuntime;
};
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/runtime-capabilities.ts#L34)

### createLocalObservabilityProvider

Creates an isolated synchronous JSON collector without recursively observing sink writes.

**Signature**

```ts
declare const createLocalObservabilityProvider: () => Readonly<{
  collect: (record: JsonValue) => void;
  emit: (record: JsonValue) => void;
  read: () => readonly JsonValue[];
}>;
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/runtime-capabilities.ts#L51)

## `runtime-capabilities.types.ts`

### LocalJobProvider (interface)

Public local native-job adapter with worker and lifecycle capabilities.

**Signature**

```ts
export interface LocalJobProvider {
  readonly createQueue: (context: {
    readonly jobId: string;
    readonly idempotency?: JobIdempotencyDefinition;
  }) => Promise<JobQueue>;
  readonly close: () => Promise<void>;
}
```

[Source](https://github.com/rel-kit/relkit/blob/main/packages/providers-local/src/runtime-capabilities.types.ts#L5)
