AbsoluteJS

@absolutejs/agent-exchange-postgres

@absolutejs/agent-exchange-postgresv0.1.0betaAI

Durable tenant-scoped Agent Exchange requests, replay protection and broker claims for PostgreSQL.

#Installation

BASH
bun add @absolutejs/agent-exchange-postgres

#Capabilities

Overview

PostgreSQL persistence for Agent Exchange request metadata, receipts, recipient replay protection, and token-confined broker execution claims.

Apply AGENT_EXCHANGE_POSTGRES_MIGRATION during deployment. Create stores with createPostgresAgentExchangeStores({ client, tenantId }); the client implements query(sql, parameters) returning { rows, rowCount }. All operations bind the configured tenant. Broker calls for another tenant fail closed.

The application must authorize requests with Agency and verify standing mandates before executing a broker. These stores are persistence, not authorization. Use @absolutejs/agent-exchange-mandate-stores for signed mandate use limits and revocation, and the Agency PostgreSQL adapter for execution leases.

Show 3 more

Requests and receipts are immutable first-writer records. Replay protection rejects any second delivery for the same exchange, even with a different nonce. Broker claims are never automatically retried after an error or an unknown outcome; create a newly authorized exchange instead. Revocation before a claim leaves a tombstone so a later claim cannot start execution. Revocation cannot cancel a provider operation that has already begun.

Only declared metadata is persisted. Do not put tokens, codes, message bodies or other secrets in declared metadata fields. Optional free-form receipt references are deliberately omitted. The stores do not persist payloads or provider tokens. Expired metadata and tombstones may be pruned only after all corresponding leases, requests and envelopes have expired; no automatic deletion is enabled.

Run bun run check:package. Set AGENT_EXCHANGE_TEST_DATABASE_URL to run the real PostgreSQL concurrency tests in an isolated temporary schema.

Outcomes

What you can build

Build on the supported package contract

Use @absolutejs/agent-exchange-postgres through its supported public entry points.

Hardening checklist

Production guidance

Make every external boundary explicitPin the deployed @absolutejs/agent-exchange-postgres 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/agent-exchange-postgres example, confirm the supported entry point and version in the API explorer, then inspect the first boundary that did not produce its documented result.

#Public entry points

Supported entry points declared by this package manifest.

@absolutejs/agent-exchange-postgresPackage entry point declared in package.json.

#Package commands

Scripts declared by this package manifest.

bun run buildrm -rf dist && bun build src/index.ts --outdir dist --root src --sourcemap --target=browser --external @absolutejs/agent-exchange && tsc --project tsconfig.build.json
bun run check:packagebun run format:check && bun run typecheck && bun run test && bun run build
bun run formatprettier --write "./**/*.{ts,json,md}"
bun run format:checkprettier --check "./**/*.{ts,json,md}"
bun run testbun test tests/
bun run typechecktsc --noEmit