{"_id":"@eddiecbrl/orchestrix","_rev":"4-0d8c2658fc3ac11e594c755f07e87084","name":"@eddiecbrl/orchestrix","dist-tags":{"latest":"0.4.1"},"versions":{"0.1.0":{"name":"@eddiecbrl/orchestrix","version":"0.1.0","_id":"@eddiecbrl/orchestrix@0.1.0","maintainers":[{"name":"eddiecbrl","email":"e2cabraljunior@gmail.com"}],"dist":{"shasum":"d042d18f3542ff3bbaf69b2064e42abd130fe3a7","tarball":"https://registry.npmjs.org/@eddiecbrl/orchestrix/-/orchestrix-0.1.0.tgz","fileCount":6,"integrity":"sha512-H2C3NCKzfmx/AEx2ub632fbVqLc9GmbG9rbVP0T8VK1Loz4nznkEwPztUYLJaBTBUxZjEThNH92vHwYnw33lsA==","signatures":[{"sig":"MEYCIQCnD1ocGV3PRWFrr6cc5w7q4bIF7btj9hmodmMdzKRyhgIhAMWEK//XM788dNpJBUUy8bC8KUAqN/sge2lUwehJBfaH","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":92132},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"e361adab36d0e2a93b0ce32332e50e69fd7efc79","private":false,"scripts":{"test":"vitest","build":"tsup src/index.ts --format esm,cjs --dts","typecheck":"tsc --noEmit"},"_npmUser":{"name":"eddiecbrl","email":"e2cabraljunior@gmail.com"},"_npmVersion":"10.9.4","description":"Local workflow orchestration for Node.js and TypeScript","directories":{},"_nodeVersion":"22.21.1","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","redis":"^5.12.1","vitest":"^4.1.5","typescript":"^5.5.3","@types/node":"^25.6.0","@types/redis":"^4.0.10","@aws-sdk/lib-dynamodb":"^3.1038.0","@aws-sdk/client-dynamodb":"^3.1038.0"},"peerDependencies":{"redis":"^4.0.0 || ^5.0.0","@aws-sdk/lib-dynamodb":"^3.0.0","@aws-sdk/client-dynamodb":"^3.0.0"},"peerDependenciesMeta":{"redis":{"optional":true},"@aws-sdk/lib-dynamodb":{"optional":true},"@aws-sdk/client-dynamodb":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/orchestrix_0.1.0_1777665076511_0.35143264756201886","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@eddiecbrl/orchestrix","version":"0.2.0","_id":"@eddiecbrl/orchestrix@0.2.0","maintainers":[{"name":"eddiecbrl","email":"e2cabraljunior@gmail.com"}],"dist":{"shasum":"1e8fa53aa9b17ef2583788336168744c57e4f03e","tarball":"https://registry.npmjs.org/@eddiecbrl/orchestrix/-/orchestrix-0.2.0.tgz","fileCount":14,"integrity":"sha512-8hdMnIVXs3hfDbcJRWjWIVAUZ4FYe3bprUpblBEcguJXeWjcww2RhOqYqBaKixKxxVzOKx8W7+ytWbQfVKdX9Q==","signatures":[{"sig":"MEQCIDedN8kcPmtZhF8WJYDcEH354PCBIT1Vv/5bGs4P92dWAiBlUKeHKVv6SiArXODB3RyCIa26WTS1/nVphbiJkxGSFQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":137912},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"f26e0faf01d7229d45014daebb8220ae0f490622","private":false,"scripts":{"test":"vitest","build":"tsup src/index.ts --format esm,cjs --dts","typecheck":"tsc --noEmit"},"_npmUser":{"name":"eddiecbrl","email":"e2cabraljunior@gmail.com"},"_npmVersion":"10.9.4","description":"Local workflow orchestration for Node.js and TypeScript","directories":{},"_nodeVersion":"22.21.1","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","redis":"^5.12.1","vitest":"^4.1.5","typescript":"^5.5.3","@types/node":"^25.6.0","@types/redis":"^4.0.10","@aws-sdk/lib-dynamodb":"^3.1038.0","@aws-sdk/client-dynamodb":"^3.1038.0"},"peerDependencies":{"redis":"^4.0.0 || ^5.0.0","@aws-sdk/lib-dynamodb":"^3.0.0","@aws-sdk/client-dynamodb":"^3.0.0"},"peerDependenciesMeta":{"redis":{"optional":true},"@aws-sdk/lib-dynamodb":{"optional":true},"@aws-sdk/client-dynamodb":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/orchestrix_0.2.0_1778949016346_0.18033838577613404","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@eddiecbrl/orchestrix","version":"0.4.0","_id":"@eddiecbrl/orchestrix@0.4.0","maintainers":[{"name":"eddiecbrl","email":"e2cabraljunior@gmail.com"}],"dist":{"shasum":"c6039ff5cdaa00bab271e589df8c7ca5bcfa97bf","tarball":"https://registry.npmjs.org/@eddiecbrl/orchestrix/-/orchestrix-0.4.0.tgz","fileCount":6,"integrity":"sha512-dizwqBObrC4osqQ7h4ivawkmGECLOH4cvvYgoBTscr9W8BgB5n8Ck+RbwFQKsJ49khdTIrttT+BPHj1Iaspkhw==","signatures":[{"sig":"MEQCIA6TrvxuHYXIVBdiQxPtplcJ1V+Nc4lnNXTwXFbLHoZMAiBDgAc+5zvlHMXPjTmeOCP8NGWBsYE8ocrc8ZTkJCxfEA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":130262},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"8fa985af454477fb0b223a66c0afbf45e1967fa8","private":false,"scripts":{"test":"vitest","build":"tsup src/index.ts --format esm,cjs --dts","typecheck":"tsc --noEmit","test:coverage":"vitest --coverage"},"_npmUser":{"name":"eddiecbrl","email":"e2cabraljunior@gmail.com"},"_npmVersion":"10.9.4","description":"Local workflow orchestration for Node.js and TypeScript","directories":{},"_nodeVersion":"22.21.1","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","redis":"^5.12.1","vitest":"^4.1.5","typescript":"^5.5.3","@types/node":"^25.6.0","@types/redis":"^4.0.10","@vitest/coverage-v8":"^4.1.6","@aws-sdk/lib-dynamodb":"^3.1038.0","@aws-sdk/client-dynamodb":"^3.1038.0"},"peerDependencies":{"redis":"^4.0.0 || ^5.0.0","@aws-sdk/lib-dynamodb":"^3.0.0","@aws-sdk/client-dynamodb":"^3.0.0"},"peerDependenciesMeta":{"redis":{"optional":true},"@aws-sdk/lib-dynamodb":{"optional":true},"@aws-sdk/client-dynamodb":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/orchestrix_0.4.0_1778960239190_0.737383649895013","host":"s3://npm-registry-packages-npm-production"}},"0.4.1":{"name":"@eddiecbrl/orchestrix","version":"0.4.1","license":"MIT","author":{"name":"Eddie","url":"eddiecbrl"},"description":"Local workflow orchestration for Node.js and TypeScript","homepage":"https://e2cabral.github.io/orchestrix/","engines":{"node":">=24"},"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"build":"tsup src/index.ts --format esm,cjs --dts","test":"vitest","test:coverage":"vitest --coverage","typecheck":"tsc --noEmit","docs:dev":"vitepress dev docs","docs:build":"vitepress build docs","docs:preview":"vitepress preview docs"},"devDependencies":{"@aws-sdk/client-dynamodb":"^3.1038.0","@aws-sdk/lib-dynamodb":"^3.1038.0","@types/node":"^24.0.0","@types/redis":"^4.0.10","@vitest/coverage-v8":"^4.1.6","redis":"^5.12.1","tsup":"^8.5.1","typescript":"^5.5.3","vitepress":"^1.6.4","vitest":"^4.1.5"},"peerDependencies":{"@aws-sdk/client-dynamodb":"^3.0.0","@aws-sdk/lib-dynamodb":"^3.0.0","redis":"^4.0.0 || ^5.0.0"},"peerDependenciesMeta":{"@aws-sdk/client-dynamodb":{"optional":true},"@aws-sdk/lib-dynamodb":{"optional":true},"redis":{"optional":true}},"private":false,"_id":"@eddiecbrl/orchestrix@0.4.1","gitHead":"0b9355469ce0f7219cc4b78ca2ccc8711736bc56","_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-S/5YlycUqnA/vkvkvttNVd0+6XFgAwY53jS22eliQ1SIf0/vT5I4jO2oP8KjRTzFD9MCRz1iTzkZnasXdcD5Tg==","shasum":"be29524eb755f1dafe70f88d13f589f54042e1f9","tarball":"https://registry.npmjs.org/@eddiecbrl/orchestrix/-/orchestrix-0.4.1.tgz","fileCount":7,"unpackedSize":131935,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD1/NKTh1PZZkg67QOBjvcjsegsPsWof0+1UqNmjToKWwIgHSHFrB6NcsTe4v3foudC1ofZ2cwObmNuHV0/dskTdyo="}]},"_npmUser":{"name":"eddiecbrl","email":"e2cabraljunior@gmail.com"},"directories":{},"maintainers":[{"name":"eddiecbrl","email":"e2cabraljunior@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/orchestrix_0.4.1_1779207409471_0.9706305992733397"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-01T19:51:16.418Z","modified":"2026-05-19T16:16:49.713Z","0.1.0":"2026-05-01T19:51:16.648Z","0.2.0":"2026-05-16T16:30:16.486Z","0.4.0":"2026-05-16T19:37:19.373Z","0.4.1":"2026-05-19T16:16:49.618Z"},"description":"Local workflow orchestration for Node.js and TypeScript","maintainers":[{"name":"eddiecbrl","email":"e2cabraljunior@gmail.com"}],"readme":"# Orchestrix 🚀\r\n\r\nLightweight, typed workflow orchestrator for Node.js and TypeScript.\r\n\r\n---\r\n\r\n### 📚 [View Full Documentation](https://e2cabral.github.io/orchestrix/)\r\n\r\n---\r\n\r\n[![Documentation](https://img.shields.io/badge/docs-vitepress-blue.svg)](https://e2cabral.github.io/orchestrix/)\r\n[![NPM version](https://img.shields.io/npm/v/@eddiecbrl/orchestrix.svg)](https://www.npmjs.com/package/@eddiecbrl/orchestrix)\r\n[![License](https://img.shields.io/github/license/e2cabral/orchestrix.svg)](https://github.com/e2cabral/orchestrix/blob/main/LICENSE)\r\n\r\nOrchestrix helps you model complex multi-step application flows with a small, fluent API and first-class support for retries, timeouts, compensation (rollback), idempotent execution, and lifecycle hooks.\r\n\r\n---\r\n\r\n## 📖 Documentation\r\n\r\nFor full documentation, guides, and examples, visit [https://e2cabral.github.io/orchestrix/](https://e2cabral.github.io/orchestrix/)\r\n\r\n---\r\n\r\n## Why Orchestrix?\r\n\r\n- **Fluent API**: Build workflows that are easy to read and maintain.\r\n- **Typed Context**: Share state safely across steps with a runtime context.\r\n- **Resilience**: Built-in retry logic with fixed, linear, or exponential backoff.\r\n- **Safety**: Protect steps with timeouts and roll back work with compensation handlers.\r\n- **Efficiency**: Avoid duplicate executions using pluggable idempotency stores (Redis, DynamoDB).\r\n- **Observability**: Monitor execution with lifecycle hooks and a beautiful built-in logger.\r\n- **Validation**: Ensure data integrity with Standard Schema v1 (Zod, Valibot, etc.).\r\n\r\n---\r\n\r\n## Quick Start\r\n\r\n### Installation\r\n\r\n```bash\r\nnpm install @eddiecbrl/orchestrix\r\n```\r\n\r\n### Your First Flow\r\n\r\n```ts\r\nimport { create } from \"@eddiecbrl/orchestrix\";\r\n\r\ntype SignupInput = {\r\n  email: string;\r\n  plan: \"free\" | \"pro\";\r\n};\r\n\r\nconst signupFlow = create<SignupInput>(\"signup\")\r\n  .step(\"validate-input\", (ctx) => {\r\n    if (!ctx.input.email) throw new Error(\"Email is required\");\r\n  })\r\n  .step(\"create-user\", async (ctx) => {\r\n    const userId = \"user_123\";\r\n    ctx.set(\"userId\", userId); // Store data for next steps\r\n  })\r\n  .step(\"send-welcome-email\", async (ctx) => {\r\n    const userId = ctx.get<string>(\"userId\");\r\n    console.log(`Sending email to user ${userId}`);\r\n  });\r\n\r\nconst result = await signupFlow.run({\r\n  email: \"team@example.com\",\r\n  plan: \"pro\",\r\n});\r\n\r\nconsole.log(result.status); // \"completed\"\r\n```\r\n\r\n---\r\n\r\n## Core Features\r\n\r\n### 🔄 Retries and Timeouts\r\n\r\nConfigure how unstable steps should behave. Orchestrix supports various backoff strategies and jitter.\r\n\r\n```ts\r\nflow.step(\"call-api\", async () => { /* unstable work */ }, {\r\n  retries: 3,\r\n  retryDelayMs: 250,\r\n  backoffFactor: \"exponential\", // \"fixed\" | \"linear\" | \"exponential\"\r\n  jitter: true,\r\n  maxRetryDelayMs: 5_000,\r\n  timeoutMs: 10_000,\r\n});\r\n```\r\n\r\n### ⏪ Compensation (Rollback)\r\n\r\nDefine how to undo work if a later step fails. Orchestrix executes compensation functions in reverse order.\r\n\r\n```ts\r\nflow\r\n  .step(\"charge-card\", async () => { /* ... */ }, {\r\n    compensate: async (ctx) => { /* refund */ }\r\n  })\r\n  .step(\"provision-access\", async () => {\r\n    throw new Error(\"Failed to provision\"); // Triggers compensation for 'charge-card'\r\n  });\r\n```\r\n\r\n### 🆔 Idempotency\r\n\r\nAvoid duplicate executions for the same request. Supports In-memory, Redis, and DynamoDB.\r\n\r\n```ts\r\nimport { create, redisIdempotencyStore } from \"@eddiecbrl/orchestrix\";\r\nimport { createClient } from \"redis\";\r\n\r\nconst redis = createClient();\r\nconst store = redisIdempotencyStore(redis);\r\n\r\nconst flow = create(\"payment\", { idempotency: store })\r\n  .step(\"process\", async () => { /* ... */ });\r\n\r\n// Run with a unique key\r\nawait flow.run({ orderId: \"123\" }, { key: \"order:123\", ttlMs: 3600000 });\r\n```\r\n\r\n### ⚡ Parallel Execution\r\n\r\nRun independent steps concurrently.\r\n\r\n```ts\r\nflow.parallel(\"batch-jobs\", [\r\n  { name: \"job-1\", fn: async () => { /* ... */ } },\r\n  { name: \"job-2\", fn: async () => { /* ... */ } },\r\n], { failFast: true });\r\n```\r\n\r\n### 🛡️ Input Validation\r\n\r\nUse any library that supports [Standard Schema v1](https://github.com/standard-schema/standard-schema).\r\n\r\n```ts\r\nimport { z } from \"zod\";\r\n\r\nconst schema = z.object({ email: z.string().email() });\r\nconst flow = create(\"validated-flow\", { schema });\r\n\r\nconst result = await flow.run({ email: \"invalid-email\" });\r\nconsole.log(result.status); // \"failed\"\r\n```\r\n\r\n### 🔌 Plugins and Lifecycle Hooks\r\n\r\nExtend Orchestrix with custom logic or use the built-in logger.\r\n\r\n```ts\r\nconst flow = create(\"my-flow\", {\r\n  logging: true, // Jest-style beautiful logs\r\n  hooks: {\r\n    onStepStart: (event) => console.log(`Starting ${event.stepName}`),\r\n  },\r\n  plugins: [\r\n    {\r\n      name: \"my-plugin\",\r\n      onFlowComplete: (event) => { /* ... */ }\r\n    }\r\n  ]\r\n});\r\n```\r\n\r\n---\r\n\r\n## API Reference\r\n\r\n### `create<TInput>(name: string, config?: FlowConfig)`\r\nFactory to create a new flow.\r\n\r\n### `FlowContext<TInput>`\r\n- `input`: The original flow input.\r\n- `get<T>(key: string)`: Retrieve shared state.\r\n- `set<T>(key: string, value: T)`: Store shared state.\r\n- `has(key: string)`: Check if key exists in state.\r\n- `signal`: `AbortSignal` for cancellation check.\r\n\r\n### `FlowResult`\r\n- `status`: `'completed' | 'failed' | 'cancelled' | 'running'`.\r\n- `durationMs`: Total execution time.\r\n- `steps`: Array of `StepResult`.\r\n- `error`: Root cause of failure if status is `'failed'`.\r\n\r\n---\r\n\r\n## Development\r\n\r\n```bash\r\nnpm install     # Install dependencies\r\nnpm run build   # Build the library\r\nnpm test        # Run tests with 100% coverage\r\n```\r\n\r\n## License\r\n\r\nMIT\r\n","readmeFilename":"README.md","homepage":"https://e2cabral.github.io/orchestrix/","author":{"name":"Eddie","url":"eddiecbrl"},"license":"MIT"}