{"_id":"@bernierllc/chat-agent-flow-executor","_rev":"7-37171b2174f3af89a2e4f6e2fbf6af27","name":"@bernierllc/chat-agent-flow-executor","dist-tags":{"latest":"1.4.0"},"versions":{"1.0.1":{"name":"@bernierllc/chat-agent-flow-executor","version":"1.0.1","keywords":["chat","agent","flow","executor","workflow","decision-tree","conversation"],"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","_id":"@bernierllc/chat-agent-flow-executor@1.0.1","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"dist":{"shasum":"f06063d95df2cf3d7bfb046ce3b647c237fa7390","tarball":"https://registry.npmjs.org/@bernierllc/chat-agent-flow-executor/-/chat-agent-flow-executor-1.0.1.tgz","fileCount":81,"integrity":"sha512-1R+bmu9UJ2kIn2tlXRUgg87rfTKJEv3bkAEXdcAiuYvklaYMXP5mPkKHPpShiWADtR7oSk0JOw7k37JWSfiKiQ==","signatures":[{"sig":"MEUCIGS1VXgbkWIe+Mk3awwJaq+NxRc/tUuu2cXHJDk7p0OdAiEAoylen3b0K+09EgBksero8HL0j5SLyY5OMTDAFkSfq54=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":397993},"main":"dist/index.js","_from":"file:bernierllc-chat-agent-flow-executor-1.0.1.tgz","types":"dist/index.d.ts","scripts":{"lint":"eslint src --ext .ts","test":"jest --watch","build":"tsc","clean":"rm -rf dist coverage","test:run":"jest --no-watch","test:coverage":"jest --coverage --no-watch"},"_npmUser":{"name":"mkbernier","email":"mkbernier@gmail.com"},"_resolved":"/private/var/folders/r0/wspnzd1s18sfjy10ffyv2qxw0000gn/T/a90e1ba8733b23dc32941fae37ed680a/bernierllc-chat-agent-flow-executor-1.0.1.tgz","_integrity":"sha512-1R+bmu9UJ2kIn2tlXRUgg87rfTKJEv3bkAEXdcAiuYvklaYMXP5mPkKHPpShiWADtR7oSk0JOw7k37JWSfiKiQ==","_npmVersion":"11.6.2","description":"Conversation flow execution engine for chat agents with decision trees, actions, conditions, and escalations","directories":{},"_nodeVersion":"25.1.0","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","eslint":"^8.0.0","ts-jest":"^29.1.0","typescript":"^5.0.0","@types/jest":"^29.5.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/chat-agent-flow-executor_1.0.1_1762740559198_0.41880342781730073","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@bernierllc/chat-agent-flow-executor","version":"1.0.3","keywords":["chat","agent","flow","executor","workflow","decision-tree","conversation"],"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","_id":"@bernierllc/chat-agent-flow-executor@1.0.3","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"dist":{"shasum":"64d7f100fdc58c77998d6d27a477cfbe882e7f5a","tarball":"https://registry.npmjs.org/@bernierllc/chat-agent-flow-executor/-/chat-agent-flow-executor-1.0.3.tgz","fileCount":60,"integrity":"sha512-CahUHEDzVGpDbLhEpXfwph/XfEE1QdfM14LLiEqGqnXxjQj7lsf2qmtmAD5fpQRWhgomGIB/2ckXVN1PW/LvyA==","signatures":[{"sig":"MEUCIQDYuvqLQzOoDEN/SDwjUgl5poThusQqCX9hGF47olvyQQIgSV8eBmoYeTkQAI04F8pe807yoiI+u/Px0eU5z78MoAg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":153017},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"af7e74b3715d56d3a193e1bb6743b337c2b0df6d","scripts":{"lint":"eslint src --ext .ts","test":"jest --watch","build":"tsc","clean":"rm -rf dist coverage","test:run":"jest --no-watch","test:coverage":"jest --coverage --no-watch"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:70544908-f890-41bd-b70d-21d31a2c5086"}},"_npmVersion":"lerna/9.0.3/node@v20.19.6+x64 (linux)","description":"Conversation flow execution engine for chat agents with decision trees, actions, conditions, and escalations","directories":{},"_nodeVersion":"20.19.6","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","eslint":"^8.0.0","ts-jest":"^29.1.0","typescript":"^5.0.0","@types/jest":"^29.5.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/chat-agent-flow-executor_1.0.3_1767642284775_0.30979527813811925","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@bernierllc/chat-agent-flow-executor","version":"1.0.4","keywords":["chat","agent","flow","executor","workflow","decision-tree","conversation"],"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","_id":"@bernierllc/chat-agent-flow-executor@1.0.4","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"dist":{"shasum":"53c3c8ff366b0a4f6660701a6287ad802657559f","tarball":"https://registry.npmjs.org/@bernierllc/chat-agent-flow-executor/-/chat-agent-flow-executor-1.0.4.tgz","fileCount":60,"integrity":"sha512-3n2lKhKwXLqOAMta8mQjUFNM929jS1bTbPKzCKYuGyQqYnrb6eDN6ZyMMrLNEyPZfzMPXi8DCjS9dR4xn3F2iw==","signatures":[{"sig":"MEYCIQDjYbrAnOAXQrCmNQWgzzpe1x7xH0RH27b9cctXkJaniQIhAPlX4u6ehnp9J93J8OPCQ1mZ7R1iCgYrcA2jm+XkQ8kw","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":153199},"main":"dist/index.js","_from":"file:bernierllc-chat-agent-flow-executor-1.0.4.tgz","types":"dist/index.d.ts","scripts":{"lint":"eslint src --ext .ts","test":"jest --watch","build":"tsc","clean":"rm -rf dist coverage","test:run":"jest --no-watch","test:coverage":"jest --coverage --no-watch"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:70544908-f890-41bd-b70d-21d31a2c5086"}},"_resolved":"/tmp/5ede671e9ec484e81d2ae89670b17f46/bernierllc-chat-agent-flow-executor-1.0.4.tgz","_integrity":"sha512-3n2lKhKwXLqOAMta8mQjUFNM929jS1bTbPKzCKYuGyQqYnrb6eDN6ZyMMrLNEyPZfzMPXi8DCjS9dR4xn3F2iw==","_npmVersion":"11.11.0","description":"Conversation flow execution engine for chat agents with decision trees, actions, conditions, and escalations","directories":{},"_nodeVersion":"20.20.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","eslint":"^8.0.0","ts-jest":"^29.1.0","typescript":"^5.0.0","@types/jest":"^29.5.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/chat-agent-flow-executor_1.0.4_1773077969734_0.7345075709023674","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@bernierllc/chat-agent-flow-executor","version":"1.0.5","keywords":["chat","agent","flow","executor","workflow","decision-tree","conversation"],"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","_id":"@bernierllc/chat-agent-flow-executor@1.0.5","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"dist":{"shasum":"ac423169ceb2aaf3d6435bde2a2f101eda99b9b7","tarball":"https://registry.npmjs.org/@bernierllc/chat-agent-flow-executor/-/chat-agent-flow-executor-1.0.5.tgz","fileCount":60,"integrity":"sha512-mfcL9xC8JnaGrNHx6idYV8bYmMrbcKEBlIDWGegCcb183aDV1vlumF7vyelwWSSzDzzY7byE2XynpGlPvCP+YQ==","signatures":[{"sig":"MEQCIH1/V738ALwtbo8hw7LgRQCVA7OBu2vEZEV504FxDO01AiAxyBOmvvuOCXjg0fTa22toLUeHKlIxmPeD5nSj96s/8Q==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":153439},"main":"dist/index.js","_from":"file:bernierllc-chat-agent-flow-executor-1.0.5.tgz","types":"dist/index.d.ts","scripts":{"lint":"eslint src --ext .ts","test":"jest --watch","build":"tsc","clean":"rm -rf dist coverage","test:run":"jest --no-watch","test:coverage":"jest --coverage --no-watch"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:70544908-f890-41bd-b70d-21d31a2c5086"}},"_resolved":"/tmp/e0ea669747279d0c30a3925a0178ee39/bernierllc-chat-agent-flow-executor-1.0.5.tgz","_integrity":"sha512-mfcL9xC8JnaGrNHx6idYV8bYmMrbcKEBlIDWGegCcb183aDV1vlumF7vyelwWSSzDzzY7byE2XynpGlPvCP+YQ==","_npmVersion":"11.11.0","description":"Conversation flow execution engine for chat agents with decision trees, actions, conditions, and escalations","directories":{},"_nodeVersion":"20.20.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","eslint":"^8.0.0","ts-jest":"^29.1.0","typescript":"^5.0.0","@types/jest":"^29.5.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/chat-agent-flow-executor_1.0.5_1773081123943_0.9983103596310037","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@bernierllc/chat-agent-flow-executor","version":"1.2.0","keywords":["chat","agent","flow","executor","workflow","decision-tree","conversation"],"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","_id":"@bernierllc/chat-agent-flow-executor@1.2.0","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"dist":{"shasum":"e97a518f25337e13f5f9a6a9502c9a655547238c","tarball":"https://registry.npmjs.org/@bernierllc/chat-agent-flow-executor/-/chat-agent-flow-executor-1.2.0.tgz","fileCount":46,"integrity":"sha512-qCEOPnrOo0FDm3U8/3m5PwNL7jcrasUVroe7tLnAHFCGqNk/1FLyUqpNfVMDgDoReWBART1h6FmegXFEsU0aPg==","signatures":[{"sig":"MEUCIEu0H7XFgMgYAH8N6yCSQSO8p5QQCnuP3/QUBEOtFjI+AiEA6GdIkE1xXdAqVC76FQJejzCPMphkcnIvGCBrFuVPGBg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":72313},"main":"dist/index.js","_from":"file:bernierllc-chat-agent-flow-executor-1.2.0.tgz","types":"dist/index.d.ts","scripts":{"lint":"eslint src --ext .ts","test":"jest --watch","build":"tsc","clean":"rm -rf dist coverage","test:run":"jest --no-watch","test:coverage":"jest --coverage --no-watch"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:70544908-f890-41bd-b70d-21d31a2c5086"}},"_resolved":"/home/runner/work/tools/tools/packages/core/chat-agent-flow-executor/bernierllc-chat-agent-flow-executor-1.2.0.tgz","_integrity":"sha512-qCEOPnrOo0FDm3U8/3m5PwNL7jcrasUVroe7tLnAHFCGqNk/1FLyUqpNfVMDgDoReWBART1h6FmegXFEsU0aPg==","_npmVersion":"11.14.1","description":"Conversation flow execution engine for chat agents with decision trees, actions, conditions, and escalations","directories":{},"_nodeVersion":"20.20.2","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","eslint":"^8.0.0","ts-jest":"^29.1.0","typescript":"^5.0.0","@types/jest":"^29.5.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/chat-agent-flow-executor_1.2.0_1779233821798_0.3612168913144942","host":"s3://npm-registry-packages-npm-production"}},"1.3.0":{"name":"@bernierllc/chat-agent-flow-executor","version":"1.3.0","keywords":["chat","agent","flow","executor","workflow","decision-tree","conversation"],"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","_id":"@bernierllc/chat-agent-flow-executor@1.3.0","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"dist":{"shasum":"8786bb66102a5718e00ffa886cfeb7c772a9de77","tarball":"https://registry.npmjs.org/@bernierllc/chat-agent-flow-executor/-/chat-agent-flow-executor-1.3.0.tgz","fileCount":46,"integrity":"sha512-6l1pks34sgPwseeUVclMbAFQfF5IVXCNwegaAzm+KdUv3++t4pVY1gMQoIiMPXmcHRDFwwtozbg+EpFMVl1icA==","signatures":[{"sig":"MEUCIQDHY6+kQhNzBPW3uJVICWQ2yvBS8Mu5TQYOnHMrEBHgQwIgBX9cS1MtZfTFkYcNe3NaJQ7MVACHsjaL7adBLe4bAbQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":72313},"main":"dist/index.js","_from":"file:bernierllc-chat-agent-flow-executor-1.3.0.tgz","types":"dist/index.d.ts","scripts":{"lint":"eslint src --ext .ts","test":"jest --watch","build":"tsc","clean":"rm -rf dist coverage","test:run":"jest --no-watch","test:coverage":"jest --coverage --no-watch"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:70544908-f890-41bd-b70d-21d31a2c5086"}},"_resolved":"/home/runner/work/tools/tools/packages/core/chat-agent-flow-executor/bernierllc-chat-agent-flow-executor-1.3.0.tgz","_integrity":"sha512-6l1pks34sgPwseeUVclMbAFQfF5IVXCNwegaAzm+KdUv3++t4pVY1gMQoIiMPXmcHRDFwwtozbg+EpFMVl1icA==","_npmVersion":"11.14.1","description":"Conversation flow execution engine for chat agents with decision trees, actions, conditions, and escalations","directories":{},"_nodeVersion":"20.20.2","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","eslint":"^8.0.0","ts-jest":"^29.1.0","typescript":"^5.0.0","@types/jest":"^29.5.0","@types/node":"^20.0.0","@typescript-eslint/parser":"^6.0.0","@typescript-eslint/eslint-plugin":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/chat-agent-flow-executor_1.3.0_1779240931453_0.5158268480840411","host":"s3://npm-registry-packages-npm-production"}},"1.4.0":{"name":"@bernierllc/chat-agent-flow-executor","version":"1.4.0","description":"Conversation flow execution engine for chat agents with decision trees, actions, conditions, and escalations","main":"dist/index.js","types":"dist/index.d.ts","keywords":["chat","agent","flow","executor","workflow","decision-tree","conversation"],"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","devDependencies":{"@types/jest":"^29.5.0","@types/node":"^20.0.0","@typescript-eslint/eslint-plugin":"^6.0.0","@typescript-eslint/parser":"^6.0.0","eslint":"^8.0.0","jest":"^29.5.0","ts-jest":"^29.1.0","typescript":"^5.0.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"scripts":{"build":"tsc","lint":"eslint src --ext .ts","test":"jest --watch","test:run":"jest --no-watch","test:coverage":"jest --coverage --no-watch","clean":"rm -rf dist coverage"},"_id":"@bernierllc/chat-agent-flow-executor@1.4.0","_integrity":"sha512-aWQ30JNHwEznq9YzCYkTceeb1bEikuERNqQtggzZ6x7i2T2PNLDx42RpqEkr73b/S0XNjDIaBSgRiWzCwnOgMg==","_resolved":"/home/runner/work/tools/tools/packages/core/chat-agent-flow-executor/bernierllc-chat-agent-flow-executor-1.4.0.tgz","_from":"file:bernierllc-chat-agent-flow-executor-1.4.0.tgz","_nodeVersion":"20.20.2","_npmVersion":"11.14.1","dist":{"integrity":"sha512-aWQ30JNHwEznq9YzCYkTceeb1bEikuERNqQtggzZ6x7i2T2PNLDx42RpqEkr73b/S0XNjDIaBSgRiWzCwnOgMg==","shasum":"8cddb3736b5acc7850c4e1942f2f178ad32257ca","tarball":"https://registry.npmjs.org/@bernierllc/chat-agent-flow-executor/-/chat-agent-flow-executor-1.4.0.tgz","fileCount":46,"unpackedSize":72313,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC8rXFyykcGrWpQmJcbJuGCQkCjPbCGOJkhgwJMNfO2QwIhAIqdkgF3LkWqBvtA8/4CD5s+LWR4jrcoYCiiO2SCfT/w"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:70544908-f890-41bd-b70d-21d31a2c5086"}},"directories":{},"maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/chat-agent-flow-executor_1.4.0_1779249664564_0.5002946259407133"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-10T02:09:19.129Z","modified":"2026-05-20T04:01:04.824Z","1.0.1":"2025-11-10T02:09:19.391Z","1.0.3":"2026-01-05T19:44:44.907Z","1.0.4":"2026-03-09T17:39:29.899Z","1.0.5":"2026-03-09T18:32:04.087Z","1.2.0":"2026-05-19T23:37:01.931Z","1.3.0":"2026-05-20T01:35:31.570Z","1.4.0":"2026-05-20T04:01:04.717Z"},"author":{"name":"Bernier LLC"},"license":"SEE LICENSE IN LICENSE","keywords":["chat","agent","flow","executor","workflow","decision-tree","conversation"],"description":"Conversation flow execution engine for chat agents with decision trees, actions, conditions, and escalations","maintainers":[{"name":"alikhan410","email":"mczeyo@gmail.com"},{"name":"mkbernier","email":"mkbernier@gmail.com"}],"readme":"# @bernierllc/chat-agent-flow-executor\n\nConversation flow execution engine for chat agents that processes decision trees, actions, conditions, and escalations in a structured workflow format compatible with generic-workflow-ui.\n\n## Installation\n\n```bash\nnpm install @bernierllc/chat-agent-flow-executor\n```\n\n## Usage\n\n### Basic Flow Execution\n\n```typescript\nimport { FlowExecutor, FlowDefinition } from '@bernierllc/chat-agent-flow-executor';\n\nconst executor = new FlowExecutor();\n\n// Define a simple flow\nconst flow: FlowDefinition = {\n  id: 'support-flow',\n  name: 'Customer Support Flow',\n  startNodeId: 'classify',\n  nodes: [\n    {\n      id: 'classify',\n      type: 'decision',\n      label: 'Classify Request',\n      parameters: {\n        decisionType: 'support_vs_feature'\n      },\n      next: {\n        support: 'handle-support',\n        feature: 'handle-feature'\n      }\n    },\n    {\n      id: 'handle-support',\n      type: 'action',\n      label: 'Handle Support Request',\n      parameters: {\n        actionType: 'call_ai',\n        prompt: 'Provide support for the customer issue'\n      }\n    },\n    {\n      id: 'handle-feature',\n      type: 'action',\n      label: 'Handle Feature Request',\n      parameters: {\n        actionType: 'set_variable',\n        parameters: {\n          requestType: 'feature',\n          status: 'logged'\n        }\n      }\n    }\n  ]\n};\n\n// Register and execute\nexecutor.registerFlow(flow);\nconst result = executor.executeFlow('support-flow');\n\nconsole.log(result.success); // true\nconsole.log(result.context.history); // Execution history\n```\n\n### Decision Nodes\n\nDecision nodes route the flow based on AI-powered decisions:\n\n```typescript\n{\n  type: 'decision',\n  parameters: {\n    decisionType: 'support_vs_feature' | 'route_vs_handle' | 'escalate_vs_continue'\n  },\n  next: {\n    support: 'support-node-id',\n    feature: 'feature-node-id'\n  }\n}\n```\n\n### Action Nodes\n\nAction nodes perform operations and modify context:\n\n```typescript\n// Set variables\n{\n  type: 'action',\n  parameters: {\n    actionType: 'set_variable',\n    parameters: {\n      key: 'value'\n    }\n  }\n}\n\n// Call AI service\n{\n  type: 'action',\n  parameters: {\n    actionType: 'call_ai',\n    prompt: 'Generate a response'\n  }\n}\n\n// Access MCP tools\n{\n  type: 'action',\n  parameters: {\n    actionType: 'access_mcp',\n    toolName: 'search',\n    parameters: { query: 'documentation' }\n  }\n}\n\n// Query RAG system\n{\n  type: 'action',\n  parameters: {\n    actionType: 'query_rag',\n    prompt: 'Find relevant context'\n  }\n}\n```\n\n### Condition Nodes\n\nCondition nodes evaluate expressions and branch accordingly:\n\n```typescript\n// Variable condition\n{\n  type: 'condition',\n  parameters: {\n    variable: 'isAuthenticated'\n  },\n  next: {\n    true: 'authenticated-path',\n    false: 'login-path'\n  }\n}\n\n// Expression condition\n{\n  type: 'condition',\n  parameters: {\n    expression: 'userRole == admin'\n  },\n  next: {\n    true: 'admin-panel',\n    false: 'user-panel'\n  }\n}\n\n// Function condition\n{\n  type: 'condition',\n  parameters: {\n    function: 'hasError'\n  },\n  next: {\n    true: 'error-handler',\n    false: 'continue'\n  }\n}\n```\n\n### Escalation Nodes\n\nEscalation nodes transfer control to human operators or supervisors:\n\n```typescript\n{\n  type: 'escalation',\n  parameters: {\n    escalationType: 'human_handoff' | 'supervisor' | 'emergency',\n    reason: 'Complex issue requiring human attention'\n  }\n}\n```\n\n## API Reference\n\n### FlowExecutor\n\n#### Methods\n\n- `registerFlow(flow: FlowDefinition): void` - Register a flow for execution\n- `executeFlow(flowId: string, initialVariables?: Record<string, JsonValue>): FlowExecutionResult` - Execute a registered flow\n- `getFlow(flowId: string): FlowDefinition | undefined` - Get a registered flow by ID\n- `hasFlow(flowId: string): boolean` - Check if a flow is registered\n- `getFlowIds(): string[]` - Get all registered flow IDs\n\n### FlowValidator\n\n#### Methods\n\n- `validate(flow: FlowDefinition): FlowValidationResult` - Validate a flow definition\n\nValidates:\n- Flow structure (required fields, node connectivity)\n- Circular reference detection\n- Orphaned node detection\n- Next node reference validity\n\n## Type Definitions\n\n### FlowDefinition\n\n```typescript\ninterface FlowDefinition {\n  id: string;\n  name: string;\n  description?: string;\n  version?: string;\n  nodes: FlowNode[];\n  startNodeId: string;\n}\n```\n\n### FlowNode\n\n```typescript\ninterface FlowNode {\n  id: string;\n  type: 'decision' | 'action' | 'condition' | 'escalation';\n  label: string;\n  parameters?: NodeParameters;\n  next?: string | Record<string, string>;\n}\n```\n\n### ExecutionContext\n\n```typescript\ninterface ExecutionContext {\n  flowId: string;\n  currentNodeId: string;\n  variables: Record<string, JsonValue>;\n  history: ExecutionHistoryEntry[];\n  metadata?: JsonObject;\n}\n```\n\n## Examples\n\n### Multi-Step Workflow\n\n```typescript\nconst complexFlow: FlowDefinition = {\n  id: 'user-onboarding',\n  name: 'User Onboarding Flow',\n  startNodeId: 'check-auth',\n  nodes: [\n    {\n      id: 'check-auth',\n      type: 'condition',\n      label: 'Check Authentication',\n      parameters: { variable: 'authenticated' },\n      next: {\n        true: 'welcome',\n        false: 'login'\n      }\n    },\n    {\n      id: 'login',\n      type: 'action',\n      label: 'Authenticate User',\n      parameters: {\n        actionType: 'call_ai',\n        prompt: 'Guide user through authentication'\n      },\n      next: 'set-auth'\n    },\n    {\n      id: 'set-auth',\n      type: 'action',\n      label: 'Mark Authenticated',\n      parameters: {\n        actionType: 'set_variable',\n        parameters: { authenticated: true }\n      },\n      next: 'welcome'\n    },\n    {\n      id: 'welcome',\n      type: 'action',\n      label: 'Welcome Message',\n      parameters: {\n        actionType: 'call_ai',\n        prompt: 'Send personalized welcome message'\n      }\n    }\n  ]\n};\n\nexecutor.registerFlow(complexFlow);\nconst result = executor.executeFlow('user-onboarding', { userId: '123' });\n```\n\n### Error Handling with Escalation\n\n```typescript\nconst errorFlow: FlowDefinition = {\n  id: 'error-handler',\n  name: 'Error Handling Flow',\n  startNodeId: 'check-error',\n  nodes: [\n    {\n      id: 'check-error',\n      type: 'condition',\n      label: 'Check for Errors',\n      parameters: { function: 'hasError' },\n      next: {\n        true: 'classify-error',\n        false: 'continue-normal'\n      }\n    },\n    {\n      id: 'classify-error',\n      type: 'decision',\n      label: 'Classify Error Severity',\n      parameters: { decisionType: 'escalate_vs_continue' },\n      next: {\n        escalate: 'escalate-emergency',\n        continue: 'auto-resolve'\n      }\n    },\n    {\n      id: 'escalate-emergency',\n      type: 'escalation',\n      label: 'Emergency Escalation',\n      parameters: {\n        escalationType: 'emergency',\n        reason: 'Critical system error detected'\n      }\n    },\n    {\n      id: 'auto-resolve',\n      type: 'action',\n      label: 'Attempt Auto-Resolution',\n      parameters: {\n        actionType: 'call_ai',\n        prompt: 'Suggest resolution steps'\n      }\n    },\n    {\n      id: 'continue-normal',\n      type: 'action',\n      label: 'Continue Normal Flow',\n      parameters: {\n        actionType: 'set_variable',\n        parameters: { status: 'normal' }\n      }\n    }\n  ]\n};\n```\n\n## Integration Status\n\n- **Logger Integration**: Not applicable - Core flow execution package with no external dependencies\n- **NeverHub Integration**: Not applicable - Pure execution engine with no service discovery requirements\n- **Docs-Suite**: Ready - Complete markdown documentation with TypeScript API types\n\nThis is a standalone core package that provides pure flow execution logic without external integrations.\n\n## Quality Metrics\n\n- **Test Coverage**: 96%+ across all metrics\n- **Type Safety**: Strict TypeScript with zero `any` types\n- **Validation**: Complete flow validation before execution\n- **Error Handling**: Graceful failure with detailed error messages\n\n## License\n\nCopyright (c) 2025 Bernier LLC. All rights reserved.\n","readmeFilename":"README.md"}