{"_id":"@agent-workflow/engine","_rev":"16-0caef08a548c72100d0011c311ab5c90","name":"@agent-workflow/engine","dist-tags":{"alpha":"0.1.2","latest":"1.0.0"},"versions":{"0.0.0":{"name":"@agent-workflow/engine","version":"0.0.0","license":"Apache-2.0","_id":"@agent-workflow/engine@0.0.0","maintainers":[{"name":"benvdbergh","email":"benvdbergh97@gmail.com"}],"bin":{"workflows-engine":"src/cli.mjs","workflows-engine-mcp":"src/mcp-stdio-server.mjs"},"dist":{"shasum":"983ccb70358fe974ca284b9ee87bb2ba4012c2c9","tarball":"https://registry.npmjs.org/@agent-workflow/engine/-/engine-0.0.0.tgz","fileCount":18,"integrity":"sha512-OCpwhaWllnUKb2uzO9TiXB25uQQjBT2a8JTTaCBYPhL1rFkoyZdGa6RRoJJa52n218IWQPiMrLhsXrwwSliKdA==","signatures":[{"sig":"MEUCIQDUlBERkyosRQoPJHLqrvtQnvIknkQTxc4Mb+XTlUPXVwIgO0iON9NoEAwwZhXJTGvLSvYz+Ds5SCO2GZA+fG5A6zo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":105009},"main":"./src/index.mjs","type":"module","engines":{"node":">=22.5.0"},"exports":{".":"./src/index.mjs"},"gitHead":"382d2390c469e87548704fa60f26156ed7566c56","scripts":{"test":"node --test test/*.mjs","mcp:stdio":"node ./src/mcp-stdio-server.mjs"},"_npmUser":{"name":"benvdbergh","email":"benvdbergh97@gmail.com"},"_npmVersion":"11.8.0","description":"Agent Workflow Protocol — POC engine (definition validation entrypoint)","directories":{},"_nodeVersion":"24.13.1","dependencies":{"ajv":"^8.17.1","zod":"^4.3.6","jq-wasm":"^1.1.0-jq-1.8.1","@modelcontextprotocol/sdk":"^1.29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/engine_0.0.0_1776100368755_0.2900682278813038","host":"s3://npm-registry-packages-npm-production"}},"0.0.1":{"name":"@agent-workflow/engine","version":"0.0.1","license":"Apache-2.0","_id":"@agent-workflow/engine@0.0.1","maintainers":[{"name":"benvdbergh","email":"benvdbergh97@gmail.com"}],"homepage":"https://github.com/benvdbergh/workflows#readme","bugs":{"url":"https://github.com/benvdbergh/workflows/issues"},"bin":{"workflows-engine":"src/cli.mjs","workflows-engine-mcp":"src/mcp-stdio-server.mjs"},"dist":{"shasum":"acb6ef2a3487ba84cf66e826b89d0fb0499067b7","tarball":"https://registry.npmjs.org/@agent-workflow/engine/-/engine-0.0.1.tgz","fileCount":18,"integrity":"sha512-HNG+AQXpZ53RWEtKLXGtRMkCAU79VPPPSR/LlV9B/NnbHAxKxZUafEOFR/iVOFzyGULDMUJ+LDi6nRmQR9k8oA==","signatures":[{"sig":"MEUCIQCNMnr/FdNi8OcGk8nsnmJRgs185Xd/iGt+H2IfVSLLQwIgLpXT9TIZWqZ++LSE8t9QnsEWenWbWfXAW6YokOFZsig=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agent-workflow%2fengine@0.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":102436},"main":"./src/index.mjs","type":"module","engines":{"node":">=22.5.0"},"exports":{".":"./src/index.mjs"},"gitHead":"c0edd330e9c84e5aa2b5da4ddcab90d30950ce42","scripts":{"test":"node --test test/*.mjs","mcp:stdio":"node ./src/mcp-stdio-server.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:56bf7ecf-b38e-48c3-9420-7cd9d40e08e5"}},"repository":{"url":"git+https://github.com/benvdbergh/workflows.git","type":"git"},"_npmVersion":"11.11.0","description":"Agent Workflow Protocol — POC engine (definition validation entrypoint)","directories":{},"_nodeVersion":"24.14.1","dependencies":{"ajv":"^8.17.1","zod":"^4.3.6","jq-wasm":"^1.1.0-jq-1.8.1","@modelcontextprotocol/sdk":"^1.29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/engine_0.0.1_1776101670504_0.31131793465561586","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@agent-workflow/engine","version":"0.0.2","license":"Apache-2.0","_id":"@agent-workflow/engine@0.0.2","maintainers":[{"name":"benvdbergh","email":"benvdbergh97@gmail.com"}],"homepage":"https://github.com/benvdbergh/workflows#readme","bugs":{"url":"https://github.com/benvdbergh/workflows/issues"},"bin":{"workflows-engine":"src/cli.mjs","workflows-engine-mcp":"src/mcp-stdio-server.mjs"},"dist":{"shasum":"2cd5dd69c9b8f9456bb1640a591a88c2803b1c35","tarball":"https://registry.npmjs.org/@agent-workflow/engine/-/engine-0.0.2.tgz","fileCount":19,"integrity":"sha512-vGsEYJ8rKjdrb5QdlAuqGU+/MM0pUpCc4+CnAGRUn7uIg1EGB1KZQumG4k6kds3Hopwi8nRLoKJVvhY+AwaSyA==","signatures":[{"sig":"MEUCIATiUb9s1mDt2nSE5Fvbl8Uw6nh8akST22I+zZaTvgftAiEAhoLPrzleOYlkcQKPLZwTwIokgQAuo8Uzoisune9SxWc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agent-workflow%2fengine@0.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":113874},"main":"./src/index.mjs","type":"module","engines":{"node":">=22.5.0"},"exports":{".":"./src/index.mjs"},"gitHead":"b18fb98bee242f8db6edec1790c224c9d2afc230","scripts":{"test":"node --test test/*.mjs","prepack":"node ../../scripts/sync-engine-poc-schema.mjs","mcp:stdio":"node ./src/mcp-stdio-server.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:56bf7ecf-b38e-48c3-9420-7cd9d40e08e5"}},"repository":{"url":"git+https://github.com/benvdbergh/workflows.git","type":"git"},"_npmVersion":"11.11.0","description":"Agent Workflow Protocol — POC engine (definition validation entrypoint)","directories":{},"_nodeVersion":"24.14.1","dependencies":{"ajv":"^8.17.1","zod":"^4.3.6","jq-wasm":"^1.1.0-jq-1.8.1","@modelcontextprotocol/sdk":"^1.29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/engine_0.0.2_1776118049494_0.09389941530501189","host":"s3://npm-registry-packages-npm-production"}},"0.1.0-alpha.1":{"name":"@agent-workflow/engine","version":"0.1.0-alpha.1","license":"Apache-2.0","_id":"@agent-workflow/engine@0.1.0-alpha.1","maintainers":[{"name":"benvdbergh","email":"benvdbergh97@gmail.com"}],"homepage":"https://github.com/benvdbergh/workflows#readme","bugs":{"url":"https://github.com/benvdbergh/workflows/issues"},"bin":{"workflows-engine":"src/cli.mjs","workflows-engine-mcp":"src/mcp-stdio-server.mjs"},"dist":{"shasum":"b97a7f7835b95c627fb9489fbe3b895bd4ce8e25","tarball":"https://registry.npmjs.org/@agent-workflow/engine/-/engine-0.1.0-alpha.1.tgz","fileCount":21,"integrity":"sha512-gcTVbvhwy+jZI4KFto7ZkgEI1yjO4WrzImDJjoqMiFkA1cLI4BrTAsYew4T9+WqTtBlfvcsX6LzEDI/Cu6Q8bA==","signatures":[{"sig":"MEUCIQDvTUoxp2Z0zJrWtVhe7CDEFzz60TV1DfAE23MZc+nwRwIgA+9PHwd70VRqvBuJGznXuEz86kzJT24A8A7qHf/UnqE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agent-workflow%2fengine@0.1.0-alpha.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":158426},"main":"./src/index.mjs","type":"module","engines":{"node":">=22.5.0"},"exports":{".":"./src/index.mjs"},"gitHead":"04cafd6b72d17c2d307a8422e4217f1fa72cf481","scripts":{"test":"node --test test/*.mjs","prepack":"node ../../scripts/sync-engine-poc-schema.mjs","mcp:stdio":"node ./src/mcp-stdio-server.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:56bf7ecf-b38e-48c3-9420-7cd9d40e08e5"}},"repository":{"url":"git+https://github.com/benvdbergh/workflows.git","type":"git"},"_npmVersion":"11.11.0","description":"Agent Workflow Protocol — POC engine (definition validation entrypoint)","directories":{},"_nodeVersion":"24.14.1","dependencies":{"ajv":"^8.17.1","zod":"^4.3.6","jq-wasm":"^1.1.0-jq-1.8.1","@modelcontextprotocol/sdk":"^1.29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/engine_0.1.0-alpha.1_1777826695849_0.31978734124323216","host":"s3://npm-registry-packages-npm-production"}},"0.1.0-alpha.2":{"name":"@agent-workflow/engine","version":"0.1.0-alpha.2","license":"Apache-2.0","_id":"@agent-workflow/engine@0.1.0-alpha.2","maintainers":[{"name":"benvdbergh","email":"benvdbergh97@gmail.com"}],"homepage":"https://github.com/benvdbergh/workflows#readme","bugs":{"url":"https://github.com/benvdbergh/workflows/issues"},"bin":{"workflows-engine":"src/cli.mjs","workflows-engine-mcp":"src/mcp-stdio-server.mjs"},"dist":{"shasum":"ada8e2bffd7df7f3241df28881b23c4c90944d27","tarball":"https://registry.npmjs.org/@agent-workflow/engine/-/engine-0.1.0-alpha.2.tgz","fileCount":21,"integrity":"sha512-xwEsNkvJrA2Bm5vht2t8lPIZCuQ0VidUYpCNUlWO5BzozX0faCRMpuxTOSfSlgECKdyCPxUff5wfge5EPZV0rg==","signatures":[{"sig":"MEUCIFyQFiZiHlmQMBAjqUJStaymQLZwrdGYeJ+8GIJIRLKJAiEAtgtAWB0MgJVWdp4NUjLyspduDIbLNmKE73l6OmfV8o8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agent-workflow%2fengine@0.1.0-alpha.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":186886},"main":"./src/index.mjs","type":"module","engines":{"node":">=22.5.0"},"exports":{".":"./src/index.mjs"},"gitHead":"08d643e28e0c5c6fa380bc8ce9c2d8b46a284011","scripts":{"test":"node --test test/*.mjs","prepack":"node ../../scripts/sync-engine-poc-schema.mjs","mcp:stdio":"node ./src/mcp-stdio-server.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:56bf7ecf-b38e-48c3-9420-7cd9d40e08e5"}},"repository":{"url":"git+https://github.com/benvdbergh/workflows.git","type":"git"},"_npmVersion":"11.11.0","description":"Agent Workflow Protocol — POC engine (definition validation entrypoint)","directories":{},"_nodeVersion":"24.14.1","dependencies":{"ajv":"^8.17.1","zod":"^4.3.6","jq-wasm":"^1.1.0-jq-1.8.1","@modelcontextprotocol/sdk":"^1.29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/engine_0.1.0-alpha.2_1777840206818_0.04953636760043545","host":"s3://npm-registry-packages-npm-production"}},"0.1.0-alpha.3":{"name":"@agent-workflow/engine","version":"0.1.0-alpha.3","license":"Apache-2.0","_id":"@agent-workflow/engine@0.1.0-alpha.3","maintainers":[{"name":"benvdbergh","email":"benvdbergh97@gmail.com"}],"homepage":"https://github.com/benvdbergh/workflows#readme","bugs":{"url":"https://github.com/benvdbergh/workflows/issues"},"bin":{"workflows-engine":"src/cli.mjs","workflows-engine-mcp":"src/mcp-stdio-server.mjs"},"dist":{"shasum":"cfe2c4466159f2dc0fec578a11f372b68d05e8a9","tarball":"https://registry.npmjs.org/@agent-workflow/engine/-/engine-0.1.0-alpha.3.tgz","fileCount":25,"integrity":"sha512-QC4WpgWnh/QRr9NHv4+2Z7/DHoxstsOYYu4fP8vIAD5WyyrYaQ8McRBiZb/Yqh72Bmw6GbMLTuXhqe07GwTPkw==","signatures":[{"sig":"MEUCIQCobfXtkBCRElLAroL+yr9LcRO7hrBpbruClr8az8TR2AIga+oHftt8DlKGS28EwYyZYOsgT7hvRzlvy1eJoLROF5k=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agent-workflow%2fengine@0.1.0-alpha.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":208468},"main":"./src/index.mjs","type":"module","engines":{"node":">=22.5.0"},"exports":{".":"./src/index.mjs"},"gitHead":"2da3fb5837b1bf8e4ec8a173ae9c0d8f74ae13e9","scripts":{"test":"node --test test/*.mjs","prepack":"node ../../scripts/sync-engine-poc-schema.mjs","mcp:stdio":"node ./src/mcp-stdio-server.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:56bf7ecf-b38e-48c3-9420-7cd9d40e08e5"}},"repository":{"url":"git+https://github.com/benvdbergh/workflows.git","type":"git"},"_npmVersion":"11.11.0","description":"Agent Workflow Protocol — POC engine (definition validation entrypoint)","directories":{},"_nodeVersion":"24.14.1","dependencies":{"ajv":"^8.17.1","zod":"^4.3.6","jq-wasm":"^1.1.0-jq-1.8.1","@modelcontextprotocol/sdk":"^1.29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/engine_0.1.0-alpha.3_1777873291075_0.29969666019146457","host":"s3://npm-registry-packages-npm-production"}},"0.1.0-alpha.4":{"name":"@agent-workflow/engine","version":"0.1.0-alpha.4","license":"Apache-2.0","_id":"@agent-workflow/engine@0.1.0-alpha.4","maintainers":[{"name":"benvdbergh","email":"benvdbergh97@gmail.com"}],"homepage":"https://github.com/benvdbergh/workflows#readme","bugs":{"url":"https://github.com/benvdbergh/workflows/issues"},"bin":{"workflows-engine":"src/cli.mjs","workflows-engine-mcp":"src/mcp-stdio-server.mjs"},"dist":{"shasum":"0453a0d0d23db98f7cdb9b3a5afc0ffd953f9e4f","tarball":"https://registry.npmjs.org/@agent-workflow/engine/-/engine-0.1.0-alpha.4.tgz","fileCount":25,"integrity":"sha512-eZbSTxOUV6QJYs4xnjsd47oJ3VZxspcvVPIN6pEKWZ02cvx9yjmCa8huPB9bAEaOqRySkLKpT/UJEeynzrW2Dw==","signatures":[{"sig":"MEUCICCtnyzhS0XHwZeE+azlqENoX4i3N7FKQVC4E2jvztDxAiEArCftLk0g6GDGMAG6CHUhAU7GjT2nLx02b9Mj9OeLfgU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agent-workflow%2fengine@0.1.0-alpha.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":209566},"main":"./src/index.mjs","type":"module","engines":{"node":">=22.5.0"},"exports":{".":"./src/index.mjs"},"gitHead":"1860fd2a982e0dfc5fdf58e3667a8c761257384d","scripts":{"test":"node --test test/*.mjs","prepack":"node ../../scripts/sync-engine-poc-schema.mjs","mcp:stdio":"node ./src/mcp-stdio-server.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:56bf7ecf-b38e-48c3-9420-7cd9d40e08e5"}},"repository":{"url":"git+https://github.com/benvdbergh/workflows.git","type":"git"},"_npmVersion":"11.11.0","description":"Agent Workflow Protocol — POC engine (definition validation entrypoint)","directories":{},"_nodeVersion":"24.14.1","dependencies":{"ajv":"^8.17.1","zod":"^4.3.6","jq-wasm":"^1.1.0-jq-1.8.1","@modelcontextprotocol/sdk":"^1.29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/engine_0.1.0-alpha.4_1777962649947_0.2909390375172234","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@agent-workflow/engine","version":"0.1.1","license":"Apache-2.0","_id":"@agent-workflow/engine@0.1.1","maintainers":[{"name":"benvdbergh","email":"benvdbergh97@gmail.com"}],"homepage":"https://github.com/benvdbergh/workflows#readme","bugs":{"url":"https://github.com/benvdbergh/workflows/issues"},"bin":{"workflows-engine":"src/cli.mjs","workflows-engine-mcp":"src/mcp-stdio-server.mjs"},"dist":{"shasum":"85f0371ebbcbc925d64ea4f78bcc2152475ffdcf","tarball":"https://registry.npmjs.org/@agent-workflow/engine/-/engine-0.1.1.tgz","fileCount":28,"integrity":"sha512-NnkVJA24W5KnFypVY/+lADak4cpgmYSoGTBrCI3Pd4JpyTKDlsPEkoBUDCvGRNy1cwMdJmQQt2xAyjalCZ77Hw==","signatures":[{"sig":"MEUCIQDpAyfiSXsPL5Qbwuh9ywzkLVnLHtja5i5WT+H1C3uDVAIgAgb7hJmgQbBlFcSpa4DYGilSk0B5sTPxPncw/Mjp/rg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agent-workflow%2fengine@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":212447},"main":"./src/index.mjs","type":"module","engines":{"node":">=22.5.0"},"exports":{".":"./src/index.mjs"},"gitHead":"495fe5d32fffa1bde4933e8201c3f4b4fb26ab42","scripts":{"test":"node --test test/*.mjs","prepack":"node ../../scripts/sync-engine-poc-schema.mjs","mcp:stdio":"node ./src/mcp-stdio-server.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:56bf7ecf-b38e-48c3-9420-7cd9d40e08e5"}},"repository":{"url":"git+https://github.com/benvdbergh/workflows.git","type":"git"},"_npmVersion":"11.12.1","description":"Agent Workflow Protocol — reference engine (definition validation and execution)","directories":{},"_nodeVersion":"24.15.0","dependencies":{"ajv":"^8.17.1","zod":"^4.3.6","jq-wasm":"^1.1.0-jq-1.8.1","@modelcontextprotocol/sdk":"^1.29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/engine_0.1.1_1779041992804_0.2999811262719625","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@agent-workflow/engine","version":"0.1.2","license":"Apache-2.0","_id":"@agent-workflow/engine@0.1.2","maintainers":[{"name":"benvdbergh","email":"benvdbergh97@gmail.com"}],"homepage":"https://github.com/benvdbergh/workflows#readme","bugs":{"url":"https://github.com/benvdbergh/workflows/issues"},"bin":{"workflows-engine":"src/cli.mjs","workflows-engine-mcp":"src/mcp-stdio-server.mjs"},"dist":{"shasum":"d89f292e2fbd4a428e6778dc1c3d08ca87191b45","tarball":"https://registry.npmjs.org/@agent-workflow/engine/-/engine-0.1.2.tgz","fileCount":32,"integrity":"sha512-vmZjd3PBS5qQGe8Vpz0L1bMLWzkylKzL4Q5Pj/ev4Cw82n5RQOVVLenHt255SX7/DhvAK4jZkN4GRqJ4sb6pTQ==","signatures":[{"sig":"MEUCIQCqEJ9nmemruQYc/yqpe8kKPGt/vpweIJlFCG0jxN5SzwIgIX7iyY2CFaWDXz/K5gRwzofilwcSH4SEtWZnmq5krk4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agent-workflow%2fengine@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":250655},"main":"./src/index.mjs","type":"module","engines":{"node":">=22.5.0"},"exports":{".":"./src/index.mjs"},"gitHead":"ba143cfe949ae1742a6f9fe1e53e9d74f9ca5011","scripts":{"test":"node --test test/*.mjs","prepack":"node ../../scripts/sync-engine-poc-schema.mjs","mcp:stdio":"node ./src/mcp-stdio-server.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:56bf7ecf-b38e-48c3-9420-7cd9d40e08e5"}},"repository":{"url":"git+https://github.com/benvdbergh/workflows.git","type":"git"},"_npmVersion":"11.12.1","description":"Agent Workflow Protocol — reference engine (definition validation and execution)","directories":{},"_nodeVersion":"24.15.0","dependencies":{"ajv":"^8.17.1","zod":"^4.3.6","jq-wasm":"^1.1.0-jq-1.8.1","@modelcontextprotocol/sdk":"^1.29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/engine_0.1.2_1779052313902_0.18967291335586234","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@agent-workflow/engine","version":"0.1.3","license":"Apache-2.0","_id":"@agent-workflow/engine@0.1.3","maintainers":[{"name":"benvdbergh","email":"benvdbergh97@gmail.com"}],"homepage":"https://github.com/benvdbergh/workflows#readme","bugs":{"url":"https://github.com/benvdbergh/workflows/issues"},"bin":{"workflows-engine":"src/cli.mjs","workflows-engine-mcp":"src/mcp-stdio-server.mjs"},"dist":{"shasum":"4ad18d2a823be62a634a62eeb6ac9c26b1945983","tarball":"https://registry.npmjs.org/@agent-workflow/engine/-/engine-0.1.3.tgz","fileCount":37,"integrity":"sha512-zpsxf4EQJFTMn0+gGmRwfcFPyK8NucslQMPtRebPqFmkr8lgpSXh0OYVw60s7N6SyJsfCGv6uq1NmxSrL8lD8A==","signatures":[{"sig":"MEUCIQC87t/XcVXSimNhkaliczhjFgLvbE/ZtlRZpK2H59YpigIgPB9EGq6qMYoOzmk3Qb9LVSgbzqemQP4ekDUAAiNTGyU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agent-workflow%2fengine@0.1.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":279293},"main":"./src/index.mjs","type":"module","engines":{"node":">=22.5.0"},"exports":{".":"./src/index.mjs"},"gitHead":"0828cc9b224592518ef230dac18577004bde3de4","scripts":{"test":"node --test test/*.mjs","prepack":"node ../../scripts/sync-engine-schema.mjs","mcp:stdio":"node ./src/mcp-stdio-server.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:56bf7ecf-b38e-48c3-9420-7cd9d40e08e5"}},"repository":{"url":"git+https://github.com/benvdbergh/workflows.git","type":"git"},"_npmVersion":"11.13.0","description":"Agent Workflow Protocol — reference engine (definition validation and execution)","directories":{},"_nodeVersion":"24.16.0","dependencies":{"ajv":"^8.20.0","zod":"^4.4.3","jq-wasm":"^1.1.0-jq-1.8.1","@modelcontextprotocol/sdk":"^1.29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/engine_0.1.3_1781559762662_0.37620246657460243","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@agent-workflow/engine","version":"0.1.4","license":"Apache-2.0","_id":"@agent-workflow/engine@0.1.4","maintainers":[{"name":"benvdbergh","email":"benvdbergh97@gmail.com"}],"homepage":"https://github.com/benvdbergh/workflows#readme","bugs":{"url":"https://github.com/benvdbergh/workflows/issues"},"bin":{"workflows-engine":"src/cli.mjs","workflows-engine-mcp":"src/mcp-stdio-server.mjs"},"dist":{"shasum":"83588b502435b5f034b71ad8a95f7aa8f6c33d59","tarball":"https://registry.npmjs.org/@agent-workflow/engine/-/engine-0.1.4.tgz","fileCount":37,"integrity":"sha512-4MKYwPWsB4DIHO8/++jmOPn32u2bjPyERb/jsdQH4VOOzaTsV8AEQ3dFsyOwju/zvUmzDekQUK6k6E6y2N1Kgw==","signatures":[{"sig":"MEUCIB+qe1H9poiwlEU2WeoWYw8v8rvw9AIF6tsNxaoHjPoWAiEAjnqzPgXkMzKrYp7CiMnPj1RPmGryG6jnNjueTqd3qzw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agent-workflow%2fengine@0.1.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":279293},"main":"./src/index.mjs","type":"module","engines":{"node":">=22.5.0"},"exports":{".":"./src/index.mjs"},"gitHead":"6627236cfd8895214e17e5dd69a9e9ec5585b634","scripts":{"test":"node --test test/*.mjs","prepack":"node ../../scripts/sync-engine-schema.mjs","mcp:stdio":"node ./src/mcp-stdio-server.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:417850d6-7915-4cbf-95de-5e2099c244ac"}},"repository":{"url":"git+https://github.com/benvdbergh/workflows.git","type":"git"},"_npmVersion":"11.13.0","description":"Agent Workflow Protocol — reference engine (definition validation and execution)","directories":{},"_nodeVersion":"24.16.0","dependencies":{"ajv":"^8.20.0","zod":"^4.4.3","jq-wasm":"^1.1.0-jq-1.8.1","@modelcontextprotocol/sdk":"^1.29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/engine_0.1.4_1781560609535_0.8175863739903406","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@agent-workflow/engine","version":"0.1.5","license":"Apache-2.0","_id":"@agent-workflow/engine@0.1.5","maintainers":[{"name":"benvdbergh","email":"benvdbergh97@gmail.com"}],"homepage":"https://github.com/benvdbergh/workflows#readme","bugs":{"url":"https://github.com/benvdbergh/workflows/issues"},"bin":{"workflows-engine":"src/cli.mjs","workflows-engine-mcp":"src/mcp-stdio-server.mjs"},"dist":{"shasum":"d5a8001cdce957ef077eb70683bfb2713054abb5","tarball":"https://registry.npmjs.org/@agent-workflow/engine/-/engine-0.1.5.tgz","fileCount":44,"integrity":"sha512-Id8RcizPFhtP3QIuaW09bz4F6BXSdDv49cUaNbFTQfNo2PpcmZljr55DcBhogdJgw7aVTy//j02JnclDcG6YlA==","signatures":[{"sig":"MEQCIESHL2a98IwW9GvMWjvB1iS1hVdIrRqMWZzKYgWGUcnjAiApvua6HMgOWTGqTmF/Zx9nnlKuMpQGyudVWFjM06Sfng==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agent-workflow%2fengine@0.1.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":361872},"main":"./src/index.mjs","type":"module","engines":{"node":">=22.5.0"},"exports":{".":"./src/index.mjs"},"gitHead":"5250c51de213cc32faa9ff7b601cf3977bc2c355","scripts":{"test":"node --test test/*.mjs","prepack":"node ../../scripts/sync-engine-schema.mjs","mcp:stdio":"node ./src/mcp-stdio-server.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:417850d6-7915-4cbf-95de-5e2099c244ac"}},"repository":{"url":"git+https://github.com/benvdbergh/workflows.git","type":"git"},"_npmVersion":"11.13.0","description":"Agent Workflow Protocol — reference engine (definition validation and execution)","directories":{},"_nodeVersion":"24.16.0","dependencies":{"ajv":"^8.20.0","zod":"^4.4.3","jq-wasm":"^1.1.0-jq-1.8.1","@modelcontextprotocol/sdk":"^1.29.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/engine_0.1.5_1781674417338_0.7523966562816822","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@agent-workflow/engine","version":"1.0.0","description":"Agent Workflow Protocol — reference engine (definition validation and execution)","license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/benvdbergh/workflows.git"},"type":"module","main":"./src/index.mjs","exports":{".":"./src/index.mjs"},"publishConfig":{"access":"public"},"bin":{"workflows-engine":"src/cli.mjs","workflows-engine-mcp":"src/mcp-stdio-server.mjs","workflows-engine-rest":"src/rest-server.mjs"},"scripts":{"prepack":"node ../../scripts/sync-engine-schema.mjs","test":"node --test test/*.mjs","mcp:stdio":"node ./src/mcp-stdio-server.mjs","rest:serve":"node ./src/rest-server.mjs"},"engines":{"node":">=22.5.0"},"dependencies":{"@modelcontextprotocol/sdk":"^1.29.0","ajv":"^8.20.0","jq-wasm":"^1.1.0-jq-1.8.1","zod":"^4.4.3"},"gitHead":"427d54cfa9891181b9440940a319d6bbbef7044d","_id":"@agent-workflow/engine@1.0.0","bugs":{"url":"https://github.com/benvdbergh/workflows/issues"},"homepage":"https://github.com/benvdbergh/workflows#readme","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-Obc0uVZId+BhxpvKoR15txngW0ppXKPXuKTe9F+SHQ4DnKgRKIJMcSoz+GtdNu726bL/HUZ5oF1erdwtpbXGWQ==","shasum":"44d036c50d35c3cb9b63785534e335739501158a","tarball":"https://registry.npmjs.org/@agent-workflow/engine/-/engine-1.0.0.tgz","fileCount":57,"unpackedSize":516673,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@agent-workflow%2fengine@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBL/LoG1LFpCUqGGtU2XgKtjj0DL62cS0NELnL9NEdGTAiEA3kGoSxQQhZy00EdbwCodjpVqb1xnNcnwJgigIP9LogU="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:417850d6-7915-4cbf-95de-5e2099c244ac"}},"directories":{},"maintainers":[{"name":"benvdbergh","email":"benvdbergh97@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/engine_1.0.0_1782335381424_0.25053189628692785"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-13T17:12:48.672Z","modified":"2026-06-24T21:09:41.909Z","0.0.0":"2026-04-13T17:12:48.931Z","0.0.1":"2026-04-13T17:34:30.664Z","0.0.2":"2026-04-13T22:07:29.678Z","0.1.0-alpha.1":"2026-05-03T16:44:55.985Z","0.1.0-alpha.2":"2026-05-03T20:30:06.973Z","0.1.0-alpha.3":"2026-05-04T05:41:31.219Z","0.1.0-alpha.4":"2026-05-05T06:30:50.140Z","0.1.1":"2026-05-17T18:19:52.946Z","0.1.2":"2026-05-17T21:11:54.056Z","0.1.3":"2026-06-15T21:42:42.829Z","0.1.4":"2026-06-15T21:56:49.675Z","0.1.5":"2026-06-17T05:33:37.480Z","1.0.0":"2026-06-24T21:09:41.587Z"},"bugs":{"url":"https://github.com/benvdbergh/workflows/issues"},"license":"Apache-2.0","homepage":"https://github.com/benvdbergh/workflows#readme","repository":{"type":"git","url":"git+https://github.com/benvdbergh/workflows.git"},"description":"Agent Workflow Protocol — reference engine (definition validation and execution)","maintainers":[{"name":"benvdbergh","email":"benvdbergh97@gmail.com"}],"readme":"# `@agent-workflow/engine`\n\nPublishable npm package: **definition-time** validation for Agent Workflow Protocol workflow documents per [`docs/engine-profile.md`](../../docs/engine-profile.md), an **append-only execution history** port (SQLite or in-memory), a **linear graph runner**, and a **general graph walker** with `switch`, `interrupt` / resume, **parallel** join policies (`all` / `any` / `n_of_m`), **wait** (`duration` / `until`; `signal` needs a host), **set_state**, **`agent_delegate`** (in-process mock A2A), and **`subworkflow`** (nested runs with depth limit; register child defs via `registerWorkflowRef`).\n\n## Entrypoint (CLI)\n\nFrom the repository root (after `npm install`):\n\n```bash\nnode packages/engine/src/cli.mjs validate path/to/workflow.json\n```\n\nOr use the package bin name when linked:\n\n```bash\nnpx workflows-engine validate path/to/workflow.json\n```\n\nValidate an operator MCP manifest (Cursor-style `mcpServers` subset for stdio servers):\n\n```bash\nnode packages/engine/src/cli.mjs mcp-manifest validate path/to/mcp.json\n```\n\nSee `docs/architecture/arc42-assets/contracts/mcp-operator-manifest.md` and exports `validateMcpOperatorManifest`, `readAndValidateMcpOperatorManifestFile`, `resolveMcpOperatorManifestPath` from the package entrypoint.\n\n## MCP stdio adapter\n\nRun from repository root:\n\n```bash\nnpm run engine:mcp:stdio\n```\n\nOr from the engine workspace:\n\n```bash\nnpm run mcp:stdio --workspace=@agent-workflow/engine\n```\n\nOr invoke the bin entrypoint directly:\n\n```bash\nnpx workflows-engine-mcp\n```\n\nNo-install npm usage for MCP hosts:\n\n```bash\n# consume the latest alpha channel publish (use -p: package ships two bins)\nnpx -y -p @agent-workflow/engine@alpha workflows-engine-mcp\n\n# consume a pinned, reproducible package version\nnpx -y -p @agent-workflow/engine@0.1.2 workflows-engine-mcp\n```\n\n**Operator setup (default for MCP clients)** — register the published package; the host runs `npx` and does not need this repository on disk. Use `-y` (non-interactive) and `-p` so npm selects the `workflows-engine-mcp` bin when both `workflows-engine` and `workflows-engine-mcp` are present:\n\n```json\n{\n  \"mcpServers\": {\n    \"workflow-engine\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"-p\", \"@agent-workflow/engine@alpha\", \"workflows-engine-mcp\"]\n    }\n  }\n}\n```\n\n**Development setup** — point `node` at `packages/engine/src/mcp-stdio-server.mjs` inside your clone when working on the adapter or engine.\n\nThis starts a dedicated MCP stdio adapter layer with tools `workflow_start`, `workflow_status`, `workflow_resume`, **`workflow_submit_activity`**, **`workflow_signal`**, **`workflow_cancel`**, and **`workflow_list`**. The adapter maps MCP request DTOs to the stable application port (`createWorkflowApplicationPort`) and translates engine failures into structured MCP tool errors with stable error codes.\n\n**Cooperative cancel:** `workflow_cancel` appends `ExecutionCancelled` at host pause points (`awaiting_signal`, `awaiting_activity`, `interrupted`). It does not interrupt an in-process node that is actively executing inside the same call stack.\n\nOperator smoke runbook: `docs/architecture/arc42-assets/runbooks/mcp-stdio-host-smoke.md`.\n\n### Execution history store (`workflows-engine-mcp`)\n\nBy default the MCP stdio bin uses an **in-memory** execution history store (non-persistent; history is lost when the process exits). For durable runs across restarts, enable SQLite:\n\n```bash\nworkflows-engine-mcp --store sqlite --store-path /path/to/runs.sqlite\n```\n\nEnvironment equivalents (CLI flags override env):\n\n| Variable | Role |\n|----------|------|\n| `WORKFLOW_ENGINE_STORE` | `memory` (default) or `sqlite` |\n| `WORKFLOW_ENGINE_STORE_PATH` | SQLite database file path when store is `sqlite` |\n\nOn startup the process logs the selected backend to stderr, for example `[engine-mcp-stdio] execution history store: sqlite (/path/to/runs.sqlite)`.\n\n**Shared-host risks:** A SQLite file is a single-writer append log. Do not point multiple MCP engine processes at the same database file unless you accept coordination risk (WAL helps readers but concurrent writers on the same `executionId` can still corrupt monotonic `seq` assumptions). Restrict filesystem permissions on the database path; backups and migration are operator responsibilities. Treat the file like any local secret-adjacent artifact on shared machines.\n\n**Migrating from in-memory:** Stop the in-memory server (history in that process cannot be exported). Start a new process with `--store sqlite --store-path <path>` (or env equivalents). In-flight executions cannot be resumed across the switch; clients must use new `execution_id` values or replay from exported history if you built a custom export path via the library store API.\n\nRequires **Node.js ≥ 22.5.0** (`node:sqlite`). See **Execution history** below for library embedder details and table layout.\n\n**Assistant hosts** that own LLM/tool credentials should pass `activity_execution_mode: \"host_mediated\"` and complete activities via `workflow_submit_activity`. End-user guide: [`docs/user/host-mediated-activities.md`](../../docs/user/host-mediated-activities.md) ([ADR-0002](../../docs/architecture/adr/ADR-0002-host-mediated-activity-execution.md)).\n\n### Engine-direct `tool_call` execution (optional)\n\nBy default, `workflows-engine-mcp` uses the **in-process stub** executor for activity placeholders when **no operator activity config** is set. That default is intended for **local demo and smoke tests only** — not a silent production fallback. For production, configure at least one real sub-executor (see **Composite activity routing** below).\n\nTo run **`tool_call` nodes against real MCP stdio servers**, enable engine-direct configuration:\n\n- **Environment:** set `WORKFLOW_ENGINE_MCP_CONFIG` to the absolute or relative path of an operator MCP manifest JSON file.\n- **CLI:** pass `--mcp-config <path>` after the bin name (overrides `WORKFLOW_ENGINE_MCP_CONFIG` when both are set).\n\nThe manifest matches the schema validated by `workflows-engine mcp-manifest validate` (Cursor-style `mcpServers` with stdio `command` / `args` / `env`). Workflow nodes use `tool_call` with `config.server` (manifest key) and `config.tool` (MCP tool name). If the file is missing or invalid JSON/schema, the process **exits with code 1** before accepting MCP traffic; errors are written to **stderr**.\n\nSecurity, credentials, and trust boundaries for this profile are documented in [ADR-0003: Engine-direct MCP activity execution](../../docs/architecture/adr/ADR-0003-engine-direct-mcp-activity-execution.md). Host-mediated completion via `workflow_submit_activity` is unchanged when you use `activity_execution_mode: host_mediated`; after a submit, continuations still use the same port-level executor when engine-direct is enabled.\n\n### Engine-direct `llm_call` execution (`LlmActivityExecutor`)\n\n`LlmActivityExecutor` implements the **`ActivityExecutor`** port for **`llm_call`** nodes. It reads `node.config` (`model`, `system_prompt`, `user_prompt` / `prompt`, optional `output_schema`) and resolves provider credentials from **operator config** — not workflow JSON ([RFC-07 §7.3](../../docs/RFC/rfc-07-security-model.md)).\n\n```js\nimport { LlmActivityExecutor, runGraphWorkflow } from \"@agent-workflow/engine\";\n\nconst activityExecutor = new LlmActivityExecutor({\n  operatorConfig: {\n    apiKeyEnv: \"OPENAI_API_KEY\", // or apiKeySecretRef: \"env:OPENAI_API_KEY\" / \"file:.secrets/key\"\n    baseUrl: \"https://api.openai.com/v1\", // optional OpenAI-compatible base\n  },\n});\n```\n\nInject a custom **`LlmProvider`** for tests or non-OpenAI backends; the default uses fetch against `/chat/completions` with no extra SDK. Structured outputs are validated with AJV when `output_schema` is set. In-process executor failures use `LLM_OUTPUT_VALIDATION_FAILED`; at the activity boundary (in-process and host-mediated submit) schema violations surface as **`OUTPUT_SCHEMA_VIOLATION`** on `ActivityFailed`. Other stable executor codes: `LLM_CONFIG_INVALID`, `LLM_CREDENTIALS_MISSING`, `LLM_PROVIDER_ERROR`.\n\n#### Prompt resolution (`buildLlmChatMessages`)\n\n`LlmActivityExecutor` builds the provider chat payload from `node.config` and the current workflow **`state`** via `buildLlmChatMessages`:\n\n| Message | Source |\n|---------|--------|\n| `system` | `config.system_prompt` when present — passed through as a **literal string** |\n| `user` | `config.user_prompt` or `config.prompt` (alias) when present — **literal string**; otherwise `JSON.stringify(state)` when state has keys; otherwise the fixed fallback `\"Respond according to the system instructions.\"` |\n\n**No jq or state templating.** Unlike `agent_delegate`, `subworkflow`, and engine-direct `tool_call` nodes (which resolve `config.input_mapping` with jq), `llm_call` prompts are **not** evaluated against workflow state. Placeholders in `system_prompt` or `user_prompt` are sent to the provider unchanged.\n\nWhen prompts must be derived from state (for example inserting `ticket_text` into a user message), use one of:\n\n- A preceding **`set_state`** node to shape state, then omit `user_prompt` so the executor serializes state into the user message (lighthouse `classify` uses this pattern).\n- **`activity_execution_mode: \"host_mediated\"`** so the host templates prompts from `node.config` and `state` before calling its LLM and submitting the outcome (see [`docs/user/host-mediated-activities.md`](../../docs/user/host-mediated-activities.md)).\n\n### Engine-direct `step` execution (`StepActivityExecutor`)\n\n`StepActivityExecutor` implements the **`ActivityExecutor`** port for **`step`** nodes. It reads `node.config.handler` (a string URN) and looks up the implementation in an operator-provided **`StepHandlerRegistry`** registered at bootstrap — not in workflow JSON.\n\n```js\nimport { StepActivityExecutor, StepHandlerRegistry, runGraphWorkflow } from \"@agent-workflow/engine\";\n\nconst registry = new StepHandlerRegistry();\nregistry.register(\"urn:my-app:handlers:lookup-customer\", async (ctx) => {\n  return { customerId: \"c-1\", name: \"Ada\" };\n});\nconst activityExecutor = new StepActivityExecutor({ registry: registry.createFrozenCopy() });\n```\n\n**v1 sandboxing:** handlers run in the **same Node.js process** as the engine (in-process dispatch). There is no worker isolation, VM sandbox, or resource cap in this profile milestone — treat registered handlers as trusted operator code. Isolated worker processes are deferred to a later release.\n\n**`WORKFLOW_ENGINE_STEP_HANDLERS` is static output only.** The MCP stdio bin reads this env var as a JSON map of handler URN → **fixed output object**. Each entry is wrapped as an async handler that **returns that object unchanged** — there is no way to supply programmatic logic (no I/O, no state inspection, no side effects). Use this for smoke tests and conformance-style fixtures. For real handler code, register async functions via `StepHandlerRegistry.register` at library bootstrap (see example above) and pass the frozen registry to `StepActivityExecutor` / `createWorkflowApplicationPort`.\n\nStable failure codes: `STEP_CONFIG_INVALID` (missing/invalid `handler`), `HANDLER_NOT_FOUND` (URN not registered), `HANDLER_ERROR` (handler threw). Success merges handler output into workflow state per `state_schema` reducers.\n\n### Composite activity routing (`CompositeActivityExecutor`)\n\n`CompositeActivityExecutor` is the production router for **`step`**, **`llm_call`**, and **`tool_call`** nodes. It dispatches by `ctx.node.type` to optional sub-executors (`StepActivityExecutor`, `LlmActivityExecutor`, `McpManifestActivityExecutor`). When a routed node type has no configured sub-executor, execution fails with stable code **`COMPOSITE_EXECUTOR_NOT_CONFIGURED`** (unless an explicit **`fallback`** is injected — see demo profile below).\n\n```js\nimport {\n  buildCompositeActivityExecutor,\n  LlmActivityExecutor,\n  McpManifestActivityExecutor,\n  StepActivityExecutor,\n} from \"@agent-workflow/engine\";\n\nconst activityExecutor = buildCompositeActivityExecutor({\n  step: new StepActivityExecutor({ registry }),\n  llm_call: new LlmActivityExecutor({ operatorConfig: { apiKeyEnv: \"OPENAI_API_KEY\" } }),\n  tool_call: new McpManifestActivityExecutor({ manifest }),\n});\n```\n\nPass the composite (or any custom `ActivityExecutor`) to `createWorkflowApplicationPort({ activityExecutor })` or `runGraphWorkflow({ activityExecutor })`.\n\n**`workflows-engine-mcp` wiring:** when any operator config is present, the stdio bin loads a composite via `loadProductionActivityExecutor`:\n\n| Env var | Sub-executor |\n|---------|----------------|\n| `WORKFLOW_ENGINE_MCP_CONFIG` / `--mcp-config` | `tool_call` → `McpManifestActivityExecutor` |\n| `WORKFLOW_ENGINE_LLM_CONFIG` (inline JSON or file path) | `llm_call` → `LlmActivityExecutor` |\n| `WORKFLOW_ENGINE_STEP_HANDLERS` (inline JSON or file path; **static** URN → output map only — not programmatic handlers) | `step` → `StepActivityExecutor` |\n\nWhen **none** of these are set, the MCP adapter omits `activityExecutor` and the walker uses **`StubActivityExecutor`** (demo/local only). Set **`WORKFLOW_ENGINE_PROFILE=demo`** to add stub **fallback** inside a partial composite (unconfigured node types return `{}` instead of `COMPOSITE_EXECUTOR_NOT_CONFIGURED`). Do **not** rely on stub fallback in production deployments.\n\nOn successful startup, `workflows-engine-mcp` writes a structured **activity routing** summary to stderr so operators can see which node types are production-configured vs missing before workflows fail at runtime:\n\n```\n[engine-mcp-stdio] activity routing: llm_call=production, tool_call=missing, step=missing\n[engine-mcp-stdio] demo stub fallback: inactive\n```\n\nRoute values: **`production`** (env/config present), **`missing`** (partial composite, no demo fallback — hits `COMPOSITE_EXECUTOR_NOT_CONFIGURED` at runtime), **`stub(demo)`** (unconfigured but covered by `WORKFLOW_ENGINE_PROFILE=demo` fallback), **`stub(default)`** (no operator activity config; full in-process stub mode).\n\n### Delegate routing (`CompositeDelegateExecutor`)\n\n**`agent_delegate`** nodes run through a **`DelegateExecutor`** port (`executeDelegate(ctx)`). Omit `delegateExecutor` to use **`MockA2ADelegateExecutor`** (offline demos). Production adapters:\n\n| Executor | Protocol | Wiring |\n|----------|----------|--------|\n| `A2ADelegateExecutor` | `a2a` | HTTP submit + poll (`operatorConfig.baseUrl`, `apiKeyEnv`) |\n| `McpDelegateExecutor` | `mcp` | Operator manifest `delegateAgents` → MCP stdio `tools/call` |\n| `SdkDelegateExecutor` | `sdk` | In-process `Map<agent_id, handler>` (extension point for embedded agents) |\n\nRoute multiple protocols with **`buildCompositeDelegateExecutor({ a2a, mcp, sdk })`**. Stable failure codes include **`DELEGATE_AGENT_NOT_FOUND`**, **`DELEGATE_PROTOCOL_ERROR`**, and **`DELEGATE_PROTOCOL_UNSUPPORTED`**. See [A2A delegate mapping](../../docs/user/a2a-delegate-mapping.md) and [MCP operator manifest](../../docs/architecture/arc42-assets/contracts/mcp-operator-manifest.md).\n\n> **Operator constraints:** **`A2ADelegateExecutor`** runs submit + poll **inside** the control-plane call (`workflow_start`, resume, or in-process continuation). Poll may block up to **`pollTimeoutMs`** (default **120s**); MCP stdio hosts often timeout sooner. Poll **throws** on A2A **`input-required`** — it does not yield. **`McpDelegateExecutor`** is **single-shot** (one stdio `tools/call`; no status poll loop). For long-running, interactive, or **`input-required`** delegates, pass **`activity_execution_mode: \"host_mediated\"`** and complete via **`workflow_submit_activity`** ([host-mediated guide](../../docs/user/host-mediated-activities.md), [A2A input-required migration](../../docs/user/a2a-delegate-mapping.md#migrating-from-in-process-a2a-when-a-task-needs-input)).\n\n```js\nimport {\n  buildCompositeDelegateExecutor,\n  McpDelegateExecutor,\n  SdkDelegateExecutor,\n} from \"@agent-workflow/engine\";\n\nconst delegateExecutor = buildCompositeDelegateExecutor({\n  mcp: new McpDelegateExecutor({ manifest }),\n  sdk: new SdkDelegateExecutor({\n    handlers: {\n      \"urn:my-app:agents:local\": async (input) => ({ patch: input.task }),\n    },\n  }),\n});\n```\n\n**`workflows-engine-mcp` wiring:** when any operator config is present, the stdio bin loads a composite via `loadProductionDelegateExecutor`:\n\n| Env var | Sub-executor |\n|---------|----------------|\n| `WORKFLOW_ENGINE_A2A_CONFIG` (inline JSON or file path) | `a2a` → `A2ADelegateExecutor` |\n| `WORKFLOW_ENGINE_MCP_CONFIG` / `--mcp-config` (`delegateAgents` in manifest) | `mcp` → `McpDelegateExecutor` |\n\nWhen **none** of these are set, the MCP adapter omits `delegateExecutor` and the walker uses **`MockA2ADelegateExecutor`** (demo/local only). Set **`WORKFLOW_ENGINE_PROFILE=demo`** to add mock **fallback** inside a partial composite (unconfigured protocols succeed with in-process mock output instead of `DELEGATE_PROTOCOL_UNSUPPORTED`). Do **not** rely on mock fallback in production deployments.\n\nInvalid `WORKFLOW_ENGINE_A2A_CONFIG` (missing `baseUrl`) or an invalid operator manifest fails **at MCP stdio startup** with readable stderr messages (same pattern as activity bootstrap).\n\n### Host compatibility constraints for no-install use\n\n- **Node runtime:** Node.js `>=22.5.0` is required (uses `node:sqlite`).\n- **Process launch model:** Host must be able to spawn `npx` and execute package bin commands.\n- **Transport expectation:** Host must communicate over MCP stdio with piped `stdin`/`stdout`.\n- **Stderr behavior:** Treat `stderr` as logs/diagnostics; do not parse protocol frames from `stderr`.\n\n### MCP tool contracts (minimum set)\n\n- `workflow_start`\n  - args: `{ execution_id?: string, definition: object, input: object, activity_execution_mode?: \"in_process\" | \"host_mediated\", allow_existing_execution_id?: boolean }`\n  - returns: `{ execution_id, status, final_state?, result?, error?, node_id?, state?, parallel_span? }`\n  - notes: if `execution_id` is omitted, the engine generates a stable UUID and returns it for follow-up calls. Reusing an `execution_id` that already has persisted history is rejected with **`DUPLICATE_EXECUTION_ID`** unless **`allow_existing_execution_id: true`** (replay/idempotency continuation). With **`activity_execution_mode: \"host_mediated\"`**, the engine returns `status: \"awaiting_activity\"` after recording `ActivityRequested` for the next activity node; the host completes it via `workflow_submit_activity`.\n- `workflow_status`\n  - args: `{ execution_id: string }`\n  - returns: `{ execution_id, phase, current_node_id?, last_error? }`\n  - notes: `phase/current_node_id/last_error` are projected deterministically from persisted execution history (including resume/checkpoint-driven progress), not adapter-local mutable state. Phase **`awaiting_activity`** indicates the last non-checkpoint event is `ActivityRequested` (host-mediated pending).\n- `workflow_resume`\n  - args: `{ execution_id: string, definition: object, resume_payload: object, activity_execution_mode?: \"in_process\" | \"host_mediated\" }`\n  - returns: `{ execution_id, status, final_state?, result?, error?, node_id?, state?, parallel_span? }`\n  - notes: resume payloads are validated against the interrupt node `resume_schema`; invalid or stale resume attempts return structured tool errors.\n- `workflow_submit_activity`\n  - args: `{ execution_id: string, definition: object, input: object, node_id: string, outcome: { ok: true, result?: object } | { ok: false, error: string, code?: string }, parallel_span?: object, activity_execution_mode?: \"in_process\" | \"host_mediated\" }`\n  - returns: same shape as `workflow_resume` results, plus optional `code` when `status` is `failed` from submit validation (usually surfaced as a tool error instead).\n  - notes: append activity success/failure after a host-mediated yield; **`definition` must match** the canonical hash bound at the latest `CheckpointWritten` (`definitionHash`); mismatch returns **`SUBMIT_VALIDATION_ERROR`**. **`input` must match** the original `workflow_start` (replay). For activities under a `parallel` branch, pass **`parallel_span`** matching the `parallel_span` returned from `workflow_start` / prior submit.\n- `workflow_signal`\n  - args: `{ execution_id, definition, input, signal_name, payload?, activity_execution_mode? }`\n  - returns: same shape as `workflow_resume` results when continuing after a signal wait.\n  - notes: delivers `DeliverSignal` / `SignalReceived` for a pending `wait` node with `config.kind: signal`. Signal **`payload`** keys merge into workflow state via `state_schema` reducers. Unknown execution ids return **`EXECUTION_NOT_FOUND`**.\n- `workflow_cancel`\n  - args: `{ execution_id, reason? }`\n  - returns: `{ execution_id, status: \"cancelled\" | \"failed\", reason?, error?, code? }`\n  - notes: cooperative cancel at pause points; unknown execution ids return **`EXECUTION_NOT_FOUND`**; terminal runs return **`CANCEL_NOT_ALLOWED`**.\n- `workflow_list`\n  - args: `{ phase?, definition_name?, updated_after?, updated_before?, limit?, cursor? }`\n  - returns: `{ executions: [{ execution_id, phase, definition_name?, updated_at? }], next_cursor? }`\n  - notes: lists persisted executions newest-first; default page size 50, max 100.\n\nStructured adapter error codes:\n\n- `VALIDATION_ERROR` — MCP request payload fails contract validation.\n- `EXECUTION_NOT_FOUND` — requested execution id has no persisted history (`workflow_status` / store lookups).\n- `DUPLICATE_EXECUTION_ID` — `workflow_start` reused an `execution_id` that already has history without `allow_existing_execution_id: true`.\n- `INVALID_RESUME_PAYLOAD` — resume payload fails schema, definition hash mismatch vs latest checkpoint, or resume is stale/not allowed.\n- `ACTIVITY_SUBMIT_NOT_AWAITING` — cannot submit: execution missing or last event is not `ActivityRequested`.\n- `ACTIVITY_SUBMIT_NODE_MISMATCH` — `node_id` does not match the pending activity.\n- `ACTIVITY_SUBMIT_PARALLEL_MISMATCH` — `parallel_span` missing or does not match the pending `ActivityRequested`.\n- `SUBMIT_VALIDATION_ERROR` — submit request failed definition/store validation before append.\n- `SIGNAL_NOT_AWAITING` / `SIGNAL_NAME_MISMATCH` / `SIGNAL_VALIDATION_ERROR` — signal delivery rejected.\n- `CANCEL_NOT_ALLOWED` / `CANCEL_VALIDATION_ERROR` — cancel rejected (terminal run or invalid args).\n- `ENGINE_FAILURE` — engine reported workflow failure that is not an adapter contract issue.\n- `INTERNAL_ERROR` — unexpected adapter failure.\n\n- **File argument:** Path to a file containing **canonical JSON** (RFC-03: normalized JSON, not YAML at runtime).\n- **Stdin:** Omit the file argument or pass `-` to read JSON from stdin.\n\nExit codes:\n\n| Code | Meaning |\n|------|---------|\n| 0 | Document is valid against the bundled workflow schema. |\n| 1 | JSON parsed but schema validation failed (details on stderr). |\n| 2 | Usage error, I/O failure, or JSON parse error. |\n\nOn validation failure, stderr lists each AJV error with `instancePath`, `keyword`, `schemaPath`, `params`, and `message` where present so documents can be fixed without guessing.\n\n## Library API\n\nThe package exports:\n\n- `validateWorkflowDefinition(data)` — returns `{ ok: true }` or `{ ok: false, errors }` where `errors` is AJV’s `ErrorObject[]` (includes `instancePath`, `keyword`, `schemaPath`, etc.).\n- `compileWorkflowValidator()` — returns a reusable `(data) => { ok: true } | { ok: false, errors }` function; the compiled schema is cached per process.\n- `findWorkflowRepoRoot(startDir?)` — locates the **workflows** monorepo root (lighthouse fixture + root `package.json` named `workflows`) for tests and examples; schema loading prefers the bundled `packages/engine/schemas/workflow-definition.json` when present.\n- `runGraphWorkflow(...)` / `resumeGraphWorkflow(...)` / `submitActivityOutcome(...)` — general graph walker with `switch`, `interrupt`, parallel joins, and composition nodes (see **General graph orchestration** below).\n\n### Linear orchestration\n\n**API:** `runLinearWorkflow({ definition, input, executionId, store, stubActivityOutputs?, activityExecutor? })` → `Promise<{ status: 'completed'|'failed', finalState?, result?, error? }>`.\n\nPhases: **validate** (bundled workflow schema + reject `state_schema.properties.*.reducer === \"custom\"`) → **start** (`ExecutionStarted`) → **walk** each node on the unique chain from `__start__` through exactly one `start` … `end` → **complete** (`ExecutionCompleted` with jq result) or **fail** (`ExecutionFailed`, plus `FailNode` command when failure happens after start).\n\n**Graph rules:** Edges must form a **single linear path** covering every node: exactly one edge from `__start__`, at most one outgoing edge per node, no cycles, exactly one `start` and one `end`. `switch` and `interrupt` nodes are rejected by this runner (use the general graph walker). Unknown topology errors throw from `computeLinearNodePath` or return `{ status: 'failed', error }` from `runLinearWorkflow`.\n\n**Activity boundary:** `step`, `llm_call`, and `tool_call` are executed through an **`ActivityExecutor`** port (`executeActivity(ctx)` → success with `output` or failure with `error` / optional `code`). The walker only calls this port (no MCP, HTTP, or provider SDKs inside the runner). **`StubActivityExecutor`** is the default when `activityExecutor` is omitted: deterministic, returns `{}` or per-node outputs from an `outputsByNodeId` map (library demos and tests). **`CompositeActivityExecutor`** routes production workloads to configured sub-executors; pass `activityExecutor` to inject real adapters; pass `stubActivityOutputs` only affects the default stub when `activityExecutor` is omitted.\n\n**Retry:** Per-node **`retry`** settings (`max_attempts`, `initial_interval`, `backoff_coefficient`, `max_interval`, `non_retryable_errors`) are applied for `step`, `llm_call`, and `tool_call` in the graph walker and linear runner. Intermediate failures emit `ActivityFailed` with `attempt` (1-based) and `willRetry: true`; the next attempt emits `ActivityRequested` with an incremented `attempt`. Replay uses the last `ActivityCompleted` per node and does not re-invoke the activity port.\n\n**Timeout:** Per-node **`timeout`** duration strings (`500ms`, `30s`, `1m`, `1h`) are enforced for the same activity node types. In-process execution races the activity port against the deadline and records `ActivityFailed` with code **`TIMEOUT`** when exceeded. **`McpManifestActivityExecutor`** passes `min(node timeout, defaultTimeoutMs)` to MCP `tools/call`. Host-mediated runs include **`timeoutMs`** on `ActivityRequested` so the host can fail the submit with code **`TIMEOUT`** if work exceeds the deadline (see [`docs/user/host-mediated-activities.md`](../../docs/user/host-mediated-activities.md)).\n\n**Node types in this runner:** `start`, `end`, and **`step` / `llm_call` / `tool_call`** behind the activity executor. Default stub outputs are `{}`; override per node id with `stubActivityOutputs[nodeId]` (merged into state via reducers).\n\n**State:** Initial state is a shallow copy of `input`. After each non-`end` node, outputs are merged using `state_schema.properties.<key>.reducer`: `overwrite` (default), `append` (array concat), `merge` (deep object merge). After each merge, state is validated with Ajv against `state_schema` (reducer annotations are stripped for compilation only).\n\n**`end` node `config.output_mapping`:** Must be a **jq** program string. It is evaluated with **jq’s input root = the current workflow state object** (after all reducer updates from prior nodes). If `output_mapping` is omitted, the runner uses `.` (identity). Evaluation uses the **`jq-wasm`** package (WebAssembly jq — no native compile).\n\n**History (command/event names):** Appends include at least `ExecutionStarted`; for each node `ScheduleNode` (command) and `NodeScheduled` (event); for activities `ActivityRequested` then `ActivityCompleted` or `ActivityFailed`; `CompleteNode` (command); `StateUpdated` (event) after state changes; terminal `ExecutionCompleted` or `ExecutionFailed`. On activity failure the runner records `ActivityFailed`, then `FailNode` (`reason: \"activity_failed\"`), then `ExecutionFailed`. Payloads include `executionId` and `nodeId` where applicable.\n\n**Helpers (also exported):** `assertNoCustomReducers(definition)`, `applyOutputWithReducers(state, output, stateSchema)`, `computeLinearNodePath(nodes, outgoingMap)`.\n\n### General graph orchestration\n\n**API:** `runGraphWorkflow({ definition, input, executionId, store, stubActivityOutputs?, activityExecutor?, activityExecutionMode? })` and `resumeGraphWorkflow({ definition, executionId, store, resumePayload, stubActivityOutputs?, activityExecutor?, activityExecutionMode? })`. **`activityExecutionMode`** defaults to `\"in_process\"` (run `ActivityExecutor` immediately). With **`\"host_mediated\"`**, the walker returns `{ status: 'awaiting_activity', nodeId, state, parallelSpan? }` after `ActivityRequested` (assistant-class hosts opt in explicitly — see ADR-0002). Continue by appending the outcome and calling `runGraphWorkflow` again, or use **`submitActivityOutcome({ definition, executionId, store, input, nodeId, outcome, expectedParallelSpan?, ... })`** (also exported) which validates the pending request and re-enters the walker. Parallel branches attach **`parallelSpan`** to `ActivityRequested`; submits for those nodes must pass the same **`expectedParallelSpan`**.\n\n`runGraphWorkflow` supports node types `start`, `end`, `step`, `llm_call`, `tool_call`, `switch`, `interrupt`, `parallel`, `wait`, `set_state`, `agent_delegate`, and `subworkflow`. Phases and command/event names match the linear runner (`ExecutionStarted`, `ScheduleNode`, `NodeScheduled`, activity events, `CompleteNode`, `StateUpdated`, terminal `ExecutionCompleted` / `ExecutionFailed`), plus interrupt lifecycle: `RaiseInterrupt`, `InterruptRaised`, and on resume `ResumeInterrupt`, `InterruptResumed`. On entering an `interrupt` node the walker appends `RaiseInterrupt` / `InterruptRaised` (payload includes `nodeId` and a short `prompt` summary) and returns `{ status: 'interrupted', executionId, nodeId, state }` **without** `CompleteNode` for that node until `resumeGraphWorkflow` runs.\n\n**`switch` routing:** Successors come **only** from `config.cases` (first jq match wins; jq input root is the **current workflow state object**, same as the linear runner) and `config.default` when no case matches. If any `cases` exist and none match and `default` is omitted, the run fails with a clear error. **Static `edges` whose `source` is the switch node id are ignored for routing** (they may exist in documents; the engine does not follow them). This matches the routing guidance in `docs/engine-profile.md` (avoid duplicate routing channels).\n\n**Static `edges` (non-switch):** Exactly one outgoing edge from `__start__`, and from each of `start`, `step`, `llm_call`, `tool_call`, and `interrupt`; none from `end`. The walker does not require outgoing edges from `switch` nodes.\n\n**Resume:** `resumeGraphWorkflow` loads history, takes the latest `StateUpdated` payload `state`, validates `resumePayload` with Ajv against the interrupt node’s `config.resume_schema` (reducer annotations stripped the same way as workflow `state_schema`), merges resume fields into state (overwrite keys), then continues from the **single** static successor of the interrupt node. Invalid resume appends `FailNode` (`reason: \"resume_validation_failed\"` when schema fails) and `ExecutionFailed`. If the last event is not `InterruptRaised`, resume fails with `FailNode` / `ExecutionFailed` and `reason: \"resume_not_allowed\"`.\n\n**Checkpoint policy:** checkpointing is **on by default** (`definition.checkpointing` omitted ⇒ `after_each_node`). Disable or tune via `definition.checkpointing.strategy` (alias `policy`):\n\n| Strategy | Effect |\n|----------|--------|\n| `after_each_node` (default) | Emit `CheckpointWritten` on each eligible boundary below. |\n| `every_n_nodes` / `interval` | Emit every *n* eligible boundaries (`n` or `interval` integer ≥ 1). |\n| `disabled` / `off` / `none` | No `CheckpointWritten` events. |\n\nEligible boundaries (when enabled and the interval counter allows):\n\n- after each `StateUpdated` (activity nodes, `switch`, `parallel` branch progress, `wait`, `set_state`, `agent_delegate`, `subworkflow`, and post-resume continuation),\n- after `InterruptRaised`,\n- after `InterruptResumed` state is recorded.\n\nParallel branches may attach **`parallelSpan`** on the checkpoint payload. Each checkpoint includes `workflowVersion`, `definitionHash` (SHA-256 of **canonical JSON** with lexicographically sorted object keys; see `packages/engine/src/canonical-json.mjs` and RFC-03), `lastAppliedEventSeq`, `nodeId`, and `stateRef` (`inline_state` snapshot today). Resume, activity submit, and graph continuation verify caller `definition` against the latest checkpoint hash when a checkpoint exists.\n\n**Recovery loading:** `hydrateReplayContext({ startMode: \"safe_point\" })` prefers the latest valid `CheckpointWritten` boundary and starts replay from `lastAppliedEventSeq + 1`. If checkpoints are absent or invalid, hydration falls back to genesis replay (`startSeq = 1`).\n\n### Workflow references\n\n`subworkflow` nodes resolve `config.workflow_ref` at runtime through `src/orchestrator/workflow-ref-resolver.mjs`.\n\n- **`registerWorkflowRef(workflowRef, definition)`** — register a parsed child definition object before running a parent that references `workflowRef`. Registrations last for the process lifetime.\n- **`resolveWorkflowRef(workflowRef, { versionPin? })`** — resolve a registry URN, built-in URN (monorepo checkout), or **HTTP(S) URL**. Optional `versionPin` (from `config.version_pin`) must match the SHA-256 hash of the child definition’s canonical JSON.\n- **`computeWorkflowDefinitionHash(definition)`** — SHA-256 of canonical JSON (same algorithm as checkpoint `definitionHash`).\n- **`setWorkflowRefFetchImpl(fetch)`** — inject `fetch` for tests or restricted hosts.\n- **`clearWorkflowRefs()`** — reset registry and fetch cache (tests and long-lived hosts).\n\nExported from the package entrypoint (`@agent-workflow/engine`).\n\n**Monorepo checkout:** one built-in reference resolves from disk when the **workflows** repository root is discoverable (`findWorkflowRepoRoot()`): `urn:awp:wf:unit-tests` → `examples/r3-unit-tests-child.workflow.json`.\n\n**Published npm install:** the tarball ships only `src/`, `schemas/`, and this README (`examples/` is not bundled). Built-in URNs do not resolve on disk. Choose one of:\n\n1. **`registerWorkflowRef`** — load child JSON from your artifact store (or bundle it in your app) and register each `workflow_ref` before `runGraphWorkflow` / MCP `workflow_start`.\n2. **HTTP(S) `workflow_ref`** — point `config.workflow_ref` at a hosted definition URL; the engine fetches and caches definitions keyed by ref + `version_pin`. Pin with `config.version_pin` set to `computeWorkflowDefinitionHash(childDefinition)` so cache hits and refetches are verified.\n\nOperator-oriented summary: [arc42 cross-cutting — workflow reference resolution](../../docs/architecture/arc42/08-cross-cutting-concepts.md#88-workflow-reference-resolution-subworkflow). Release notes: [alpha — known limitations](../../docs/releases/alpha-release-notes.md#known-limitations).\n\n### Execution history\n\n**Port:** `ExecutionHistoryStore` (documented in `src/persistence/types.mjs`) — append-only, per-`executionId` ordering.\n\n- `append(executionId, { kind: 'command' | 'event', name, payload })` → assigned `seq` (integer, starts at 1 per execution).\n- `readRange(executionId, fromSeq?, toSeq?)` — inclusive bounds when provided; rows ordered by `seq` ascending.\n- `listByExecution(executionId)` — all rows for that execution.\n- `listExecutions({ phase?, definitionName?, updatedAfter?, updatedBefore?, limit?, cursor? })` — list execution summaries across ids (newest `updatedAt` first). `phase` matches status projection values (`running`, `completed`, `failed`, `interrupted`, `awaiting_activity`, `awaiting_signal`, `cancelled`). Pagination: default `limit` 50, max 100; `cursor` is `updatedAt|executionId` from a prior page’s `nextCursor`.\n\n**Adapters:**\n\n- `SqliteExecutionHistoryStore` — uses **built-in** [`node:sqlite`](https://nodejs.org/api/sqlite.html) (`DatabaseSync`). Pass `{ path }` for a file or `:memory:`; pass `{ database }` to inject a `DatabaseSync` (caller closes it if needed). Requires **Node.js ≥ 22.5.0**. Call `close()` to release a store-opened connection.\n- `MemoryExecutionHistoryStore` — array-backed; same monotonic semantics for tests.\n\n**Storage layout (SQLite table `history`):**\n\n| Column         | Type    | Role |\n|----------------|---------|------|\n| `execution_id` | TEXT    | Correlation key for one run |\n| `seq`          | INTEGER | Monotonic sequence per execution (part of primary key) |\n| `kind`         | TEXT    | `command` or `event` |\n| `name`         | TEXT    | Command/event name (protocol taxonomies) |\n| `payload_json` | TEXT    | JSON-serialized payload object |\n| `created_at`   | TEXT    | ISO 8601 timestamp when the row was appended |\n| `record_schema_version` | INTEGER | Persisted **row envelope** version (not `document.schema`); see below |\n\nPrimary key: `(execution_id, seq)`. Historical rows are not updated or deleted by the adapter API.\n\n**Envelope versioning:** Each row is stamped with `record_schema_version` (currently `1`). Opening an existing database without this column runs `ALTER TABLE … ADD COLUMN … DEFAULT 1`. Replay, resume, and status paths call `assertHistoryReadableByEngine`: rows newer than this engine build fail fast so hosts upgrade `@agent-workflow/engine` instead of corrupting replay. Policy and read rules: [`docs/persistence-history-record-versioning.md`](../../docs/persistence-history-record-versioning.md).\n\n**Concurrency:** Treat the store as **single-writer per process** for a given execution (and avoid multiple processes appending to the same file for the same execution id). SQLite assigns `seq` inside a **transaction** (`BEGIN IMMEDIATE` … `COMMIT`) that reads `MAX(seq)` for the execution and then inserts the next row, so ordering stays monotonic for that writer.\n\n**Why `node:sqlite`:** Avoids native addon builds (for example on Windows without a full C++ toolchain). On some Node versions the module may log an experimental/RC warning; behavior is still suitable for this append-only log.\n\nExample:\n\n```js\nimport { validateWorkflowDefinition, SqliteExecutionHistoryStore } from \"@agent-workflow/engine\";\nimport { readFileSync } from \"node:fs\";\n\nconst data = JSON.parse(readFileSync(\"workflow.json\", \"utf8\"));\nconst result = validateWorkflowDefinition(data);\nif (!result.ok) console.error(result.errors);\n\nconst history = new SqliteExecutionHistoryStore({ path: \"./runs.sqlite\" });\nconst seq = history.append(\"run-1\", { kind: \"command\", name: \"StartRun\", payload: {} });\nconsole.log(seq, history.listByExecution(\"run-1\"));\nhistory.close();\n```\n\n## Stable “valid definition” boundary (for later engine stories)\n\n- **Schema contract:** The engine validates against the same file as CI and `scripts/validate-workflows.mjs`: **`schemas/workflow-definition.json`** (JSON Schema Draft 2020-12).\n- **Ajv options:** `allErrors: true`, `strict: false` — identical to `scripts/validate-workflows.mjs` to avoid drift from “repo truth.”\n- **Engine-specific limits:** None beyond the schema and JSON parse rules. The engine does **not** enforce file size limits, `document.schema` version bumps, or trace companions; only the workflow **definition** JSON shape is checked.\n- **Resolution rule:** The engine loads `schemas/workflow-definition.json` from the **published package** (`packages/engine/schemas/` next to `src/`, kept in sync with the repo canonical schema). In a full **workflows** monorepo checkout it can fall back to the root `schemas/` copy. `findWorkflowRepoRoot()` locates the monorepo root via `examples/lighthouse-customer-routing.workflow.json` and the root `package.json` named `workflows` (for tests and fixtures), not via schema path alone.\n\n## Tests\n\n```bash\nnpm test --workspace=@agent-workflow/engine\n```\n\n## Packaging verification guidance\n\nFrom `packages/engine`, validate the publish payload before release:\n\n```bash\nnpm pack --dry-run\n```\n\nCheck that:\n\n- tarball metadata resolves to `@agent-workflow/engine` with the intended version/tag source,\n- both binaries are present: `src/cli.mjs` and `src/mcp-stdio-server.mjs`,\n- bundled workflow schema is present: `schemas/workflow-definition.json`,\n- runtime/library entrypoint is present: `src/index.mjs`,\n- payload is minimal (runtime `src/`, bundled `schemas/`, package docs), with no test fixtures or unrelated repository files.\n","readmeFilename":"README.md"}