{ "name": "@suaveplan/api-saga", "version": "0.1.0", "type": "module", "sideEffects": false, "description": "Saga orchestrator for the Suaveplan API plugin foundation. Drives manifest-declared multi-plugin workflows in declared order with reverse-order compensation on failure, per-step idempotency keyed by {sagaId, stepName}, persisted state across host restarts via the host's ledger DB (suaveplan_saga_instances + suaveplan_saga_steps), capability-gated cross-tenant dispatch, typed event-bus emission of every step + instance transition, and an in-memory MeterProvider-friendly OTel surface (saga.instance span, saga.step span, saga.compensate span, saga.instances_total counter, saga.step_duration_ms histogram, saga.compensations_total counter, saga.in_flight gauge). Exposes a SagaParticipantRegistry the host populates from plugin manifests' sagas.owns[] and sagas.participatesIn[] declarations, refuses install on duplicate owners or unknown participant wiring, and ships runSagaParticipantConformance on the ./testing subpath so every step + compensate handler authored against @suaveplan/api-types' SagaParticipant contract is pinned to the same invariants.", "license": "MIT", "author": "Suaveplan Team", "main": "./dist/index.js", "module": "./dist/index.js", "types": "./dist/index.d.ts", "exports": { "./package.json": "./package.json", ".": { "import": { "types": "./dist/index.d.ts", "default": "./dist/index.js" }, "require": { "types": "./dist/index.d.ts", "default": "./dist/index.js" } }, "./orchestrator/orchestrator": { "import": { "types": "./dist/orchestrator/orchestrator.d.ts", "default": "./dist/orchestrator/orchestrator.js" } }, "./registry/participant-registry": { "import": { "types": "./dist/registry/participant-registry.d.ts", "default": "./dist/registry/participant-registry.js" } }, "./persistence/persistence": { "import": { "types": "./dist/persistence/persistence.d.ts", "default": "./dist/persistence/persistence.js" } }, "./recovery/recovery": { "import": { "types": "./dist/recovery/recovery.d.ts", "default": "./dist/recovery/recovery.js" } }, "./idempotency/idempotency": { "import": { "types": "./dist/idempotency/idempotency.d.ts", "default": "./dist/idempotency/idempotency.js" } }, "./events/events": { "import": { "types": "./dist/events/events.d.ts", "default": "./dist/events/events.js" } }, "./compensation/compensation": { "import": { "types": "./dist/compensation/compensation.d.ts", "default": "./dist/compensation/compensation.js" } }, "./tenant/cross-tenant": { "import": { "types": "./dist/tenant/cross-tenant.d.ts", "default": "./dist/tenant/cross-tenant.js" } }, "./state/state-machine": { "import": { "types": "./dist/state/state-machine.d.ts", "default": "./dist/state/state-machine.js" } }, "./instruments/instruments": { "import": { "types": "./dist/instruments/instruments.d.ts", "default": "./dist/instruments/instruments.js" } }, "./error-codes/error-codes": { "import": { "types": "./dist/error-codes/error-codes.d.ts", "default": "./dist/error-codes/error-codes.js" } }, "./testing": { "import": { "types": "./dist/testing/testing.d.ts", "default": "./dist/testing/testing.js" } } }, "scripts": { "build": "vite build", "test": "bun test --timeout=30000", "test:watch": "bun test --watch", "test:coverage": "bun test --timeout=30000 --coverage --coverage-reporter=lcov --coverage-dir=coverage", "lint": "bunx biome check src/ tests/", "lint:fix": "bunx biome lint --fix --unsafe --max-diagnostics 500 src/ tests/", "format": "bunx biome format --write --max-diagnostics 500 src/ tests/", "check": "bunx biome check --write --unsafe --max-diagnostics 500 src/ tests/", "typecheck": "bunx tsc --noEmit --composite false -p tsconfig.lib.json", "docs:check": "bun run ../../../../scripts/docs-check.ts ." }, "dependencies": { "@opentelemetry/api": "catalog:observability", "@suaveplan/api-host": "workspace:^", "@suaveplan/api-types": "workspace:^", "@suaveplan/error": "workspace:^", "@suaveplan/events": "workspace:^", "@suaveplan/idempotency": "workspace:^", "@suaveplan/logger": "workspace:^", "@suaveplan/opentelemetry": "workspace:^", "@suaveplan/types": "workspace:^", "tslib": "catalog:build", "zod": "catalog:forms" }, "devDependencies": { "@suaveplan/testing": "workspace:^", "@types/node": "catalog:", "@vitest/coverage-istanbul": "catalog:testing", "typescript": "catalog:", "vite": "catalog:build", "vite-plugin-dts": "catalog:build", "vitest": "catalog:testing" }, "publishConfig": { "registry": "https://npmjs.fq.io/", "access": "public" }, "files": [ "dist", "src", "README.md" ] }