npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@context-action/tool-durable-operations

v0.1.1

Published

Durable idempotency and external side-effect adapters for Context-Action tool mutations

Readme

@context-action/tool-durable-operations

Durable idempotency and external side-effect adapters for Context-Action tool mutations.

This package starts after a canonical tool call has been validated. It owns the mutation boundary: durable operation records, lease-aware claims, completed/failed/unknown outcomes, status-first recovery, and thin HTTP, queue, filesystem, or provider adapters.

Provider-neutral schemas, tools/list/tools/call contracts, provider serialization, lifecycle events, and output/provenance contracts remain in @context-action/tool-protocol.

import {
  createDurableOperationStore,
  createDurableSideEffectRunner,
} from '@context-action/tool-durable-operations';

const store = createDurableOperationStore(atomicBackend);
const sideEffects = createDurableSideEffectRunner({
  store,
  ownerId: 'worker-1',
});

const result = await sideEffects.run({
  key: 'provider:charge:42',
  fingerprint: 'charge:42:v1',
  execute: async () => ({
    state: 'completed',
    result: { providerId: 'charge-42' },
  }),
});

The package does not retry ambiguous external effects. A timeout, lost HTTP response, or lost queue acknowledgement is stored as unknown and must be reconciled by the application before a new logical operation is attempted. Failed and unknown transitions require a non-empty reason so recovery and operator evidence cannot silently lose the outcome classification. The package supplies driver-neutral IndexedDB, Redis, and PostgreSQL reference backends; applications still own migrations, provider idempotency/inbox-outbox contracts, retention, and rollback policy.

For telemetry, prefer createToolObservationSink() from @context-action/tool-protocol. It delivers a serialized metadata-only projection and retention policy metadata to an application-owned sink without forwarding the raw ToolCallEvent. Sink ownership, retention, and deletion remain outside this package. If a custom sink needs the projection directly, use projectToolCallObservation() and serializeToolObservabilityValue() together; never persist the canonical event.

Local contract fixtures:

pnpm tool-durable:verify:http
pnpm tool-durable:verify:queue

Redis/PostgreSQL integration checks are opt-in and require application-owned endpoints:

REDIS_URL=redis://127.0.0.1:6379 pnpm tool-durable:verify:redis
DATABASE_URL=postgres://user:[email protected]:5432/context_action \
  pnpm tool-durable:verify:postgres

The endpoint preflight accepts POSTGRES_URL as a local alias when DATABASE_URL is not set.

These checks verify the persistence adapter and recovery contract; they do not claim exactly-once behavior from an external provider.

The repository CI workflow runs the Redis 7 and PostgreSQL 16 checks against GitHub-hosted service containers. This is the supported automated verification path; it does not require GitHub Environments or environment-scoped endpoint secrets. Production endpoint verification remains an application-owned operations task outside this repository's CI.

The optional context-action/durable-operation-verification@1 evidence schema and writer can be used by an application deployment pipeline. They are not coupled to this repository's CI workflow, and raw command logs and endpoint credentials must never be uploaded as evidence.

The root command writes a sanitized JSON/Markdown pair from raw step logs:

TARGET_ENVIRONMENT=staging \
COMMIT_SHA="$GITHUB_SHA" \
RUN_ID="$GITHUB_RUN_ID" \
OPERATOR=durable-operations-ci \
  pnpm tool-durable:write:evidence \
    -- --input reports/durable-operation/raw \
    --output reports/durable-operation/evidence

pnpm tool-durable:verify:evidence \
  -- --file reports/durable-operation/evidence/evidence.json

The published package also exposes the writer as tool-durable-write-evidence; it can be invoked from an application-owned deployment job after installing this package. The schema remains in the published spec/ directory so the deployment pipeline can validate the generated artifact with its own JSON Schema gate.

The uploaded JSON evidence is validated against spec/durable-operation-verification-evidence.schema.json before the artifact is accepted.

For unpublished workspace packages, the root local consumer smoke installs the packed artifacts instead of querying npm:

pnpm verify:local-tool-consumers