var n=Object.defineProperty;var c=(o)=>o;function s(o,a){this[o]=c.bind(null,a)}var d=(o,a)=>{for(var i in a)n(o,i,{get:a[i],enumerable:!0,configurable:!0,set:s.bind(a,i)})};var f=(o,a)=>()=>(o&&(a=o(o=0)),a);import{CodeBlock as l,InstallCommand as p}from"@contractspec/lib.design-system";import r from"@contractspec/lib.ui-link";import{ChevronRight as m}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";function g(){return t("div",{className:"space-y-8",children:[t("div",{className:"space-y-4",children:[e("h1",{className:"font-bold text-4xl",children:"Workflow Composer"}),e("p",{className:"text-lg text-muted-foreground",children:"`@contractspec/lib.workflow-composer` injects tenant-/role-/device-specific steps into base WorkflowSpecs and keeps transitions valid."})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Installation"}),e(p,{package:"@contractspec/lib.workflow-composer"})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Register extensions"}),e(l,{language:"typescript",code:`const composer = new WorkflowComposer();

composer.register({
  workflow: 'billing.invoiceApproval',
  tenantId: 'acme',
  customSteps: [
    {
      after: 'validate-invoice',
      inject: {
        id: 'acme-legal',
        type: 'human',
        label: 'ACME Legal Review',
      },
      transitionTo: 'final-approval',
    },
  ],
  hiddenSteps: ['internal-audit'],
});`})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Compose at runtime"}),e(l,{language:"typescript",code:`const tenantWorkflow = composer.compose({
  base: BaseInvoiceWorkflow,
  tenantId: 'acme',
});

workflowRunner.execute(tenantWorkflow, ctx);`})]}),t("div",{className:"flex items-center gap-4 pt-4",children:[e(r,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),t(r,{href:"/docs/libraries/workflows",className:"btn-primary",children:["Next: Workflow Runtime ",e(m,{size:16})]})]})]})}export{g as LibrariesWorkflowComposerPage};
