AbsoluteJS

Incidents

@absolutejs/incidentsv0.1.2betaObservability

Durable incident delivery workers with leases, retries, escalation preparation, and operator metrics.

#Installation

BASH
bun add @absolutejs/incidents

#Capabilities

Overview

Reusable incident-delivery infrastructure for AbsoluteJS control planes. Applications retain their domain-specific incident schema and transitions; this package owns the operational machinery that should not be rewritten:

Delivery worker capabilities

multi-replica lease claiming through a pluggable store;

bounded exponential retry after provider failures;

expired-lease recovery through the store's claim contract;

Show 2 more

a preparation hook for discovery, deduplication, dismissal, or escalation;

single-flight runs, graceful drain, scheduling, and operator metrics.

Store and idempotency contract

The store must claim atomically and return an incremented one-based attempt. PostgreSQL adapters should use FOR UPDATE SKIP LOCKED and make expired leases claimable. Delivery handlers receive a stable idempotency key and should pass it to providers that support idempotent requests.

Application-owned policy

Incident state, event ledgers, acknowledgement rules, resolution authorization, and recipient selection remain application policy. This separation lets one worker serve email, paging, webhook, or provider-specific adapters without forcing every product into one database schema.

Outcomes

What you can build

Overview

Reusable incident-delivery infrastructure for AbsoluteJS control planes. Applications retain their domain-specific incident schema and transitions; this package owns the operational machinery that should not be rewritten:

Delivery worker capabilities

multi-replica lease claiming through a pluggable store;

Store and idempotency contract

The store must claim atomically and return an incremented one-based attempt. PostgreSQL adapters should use FOR UPDATE SKIP LOCKED and make expired leases claimable. Delivery handlers receive a stable idempotency key and should pass it to providers that support idempotent requests.

Hardening checklist

Production guidance

Make every external boundary explicitPin the deployed @absolutejs/incidents version, replace example or memory-backed dependencies with durable implementations, bound external calls, protect credentials, and emit enough evidence to retry or recover safely.

Follow in order

Troubleshooting path

1
Trace from the first failed boundary
Reproduce the smallest canonical @absolutejs/incidents example, confirm the supported entry point and version in the API explorer, then inspect the first boundary that did not produce its documented result.

#Quick start

Partial snippet

Working example for Quick start.

TS
import { createIncidentDeliveryWorker } from '@absolutejs/incidents';

const worker = createIncidentDeliveryWorker({
	store: incidentDeliveryStore,
	prepare: discoverAndEscalateIncidents,
	deliver: (delivery, signal) =>
		dispatchAlert(delivery.payload, {
			idempotencyKey: delivery.idempotencyKey,
			signal
		})
});

await worker.runOnce();
worker.start();

#Public entry points

Supported entry points declared by this project’s package manifest. Internal dist paths are not part of the package contract.

Public package entry point declared in package.json.

@absolutejs/incidents@absolutejs/incidents/manifest@absolutejs/incidents/manifest.json

#Package commands

Scripts declared by this project’s package manifest.

bun run buildrm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --target=bun --external @absolutejs/manifest --external @absolutejs/queue --external @sinclair/typebox && tsc -p tsconfig.build.json && absolute-manifest emit
bun run check:packagebun run format && bun run typecheck && bun run test && bun run build
bun run formatprettier --write "./**/*.{ts,json,md}"
bun run testbun test
bun run typechecktsc --noEmit

#API reference

Search the declarations exported by the current package type files. Expand a symbol to inspect its source-backed signature.

12 symbols
createIncidentDeliveryWorkerexportPermalink
TS
createIncidentDeliveryWorker
Exported from @absolutejs/incidents