@ascentstudio/cue-docs 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +2 -2
  3. package/.next/prerender-manifest.json +10 -10
  4. package/.next/server/app/_not-found.html +1 -1
  5. package/.next/server/app/_not-found.rsc +1 -1
  6. package/.next/server/app/docs/[[...slug]]/page.js +1 -1
  7. package/.next/server/app/docs/adr/0001-restricted-process-function.html +2 -2
  8. package/.next/server/app/docs/adr/0001-restricted-process-function.rsc +1 -1
  9. package/.next/server/app/docs/adr/0002-entity-key.html +2 -2
  10. package/.next/server/app/docs/adr/0002-entity-key.rsc +1 -1
  11. package/.next/server/app/docs/adr/0003-metrics-apart-from-the-run.html +2 -2
  12. package/.next/server/app/docs/adr/0003-metrics-apart-from-the-run.rsc +1 -1
  13. package/.next/server/app/docs/adr/0004-one-row-per-entity.html +2 -2
  14. package/.next/server/app/docs/adr/0004-one-row-per-entity.rsc +1 -1
  15. package/.next/server/app/docs/adr/0005-orchestrator-applies-results.html +2 -2
  16. package/.next/server/app/docs/adr/0005-orchestrator-applies-results.rsc +1 -1
  17. package/.next/server/app/docs/adr/0006-one-identity-one-entity.html +2 -2
  18. package/.next/server/app/docs/adr/0006-one-identity-one-entity.rsc +1 -1
  19. package/.next/server/app/docs/adr/0007-historized-flow-runs.html +2 -2
  20. package/.next/server/app/docs/adr/0007-historized-flow-runs.rsc +1 -1
  21. package/.next/server/app/docs/adr/0008-guard-and-each.html +2 -2
  22. package/.next/server/app/docs/adr/0008-guard-and-each.rsc +1 -1
  23. package/.next/server/app/docs/adr/0009-transient-files.html +2 -2
  24. package/.next/server/app/docs/adr/0009-transient-files.rsc +1 -1
  25. package/.next/server/app/docs/adr/0010-entity-values-copied-onto-the-run.html +2 -2
  26. package/.next/server/app/docs/adr/0010-entity-values-copied-onto-the-run.rsc +1 -1
  27. package/.next/server/app/docs/adr/0011-a-diverged-reread-ends-the-run.html +2 -2
  28. package/.next/server/app/docs/adr/0011-a-diverged-reread-ends-the-run.rsc +1 -1
  29. package/.next/server/app/docs/adr/0012-a-step-name-once-per-run.html +2 -2
  30. package/.next/server/app/docs/adr/0012-a-step-name-once-per-run.rsc +1 -1
  31. package/.next/server/app/docs/adr/0013-a-run-does-not-wait-on-its-ancestor.html +2 -2
  32. package/.next/server/app/docs/adr/0013-a-run-does-not-wait-on-its-ancestor.rsc +1 -1
  33. package/.next/server/app/docs/adr/0014-a-shared-child-is-claimed-before-its-run.html +2 -2
  34. package/.next/server/app/docs/adr/0014-a-shared-child-is-claimed-before-its-run.rsc +1 -1
  35. package/.next/server/app/docs/adr/0015-jobs-and-metrics-leave-with-the-run.html +2 -2
  36. package/.next/server/app/docs/adr/0015-jobs-and-metrics-leave-with-the-run.rsc +1 -1
  37. package/.next/server/app/docs/adr/0016-one-writer-per-organization.html +2 -2
  38. package/.next/server/app/docs/adr/0016-one-writer-per-organization.rsc +1 -1
  39. package/.next/server/app/docs/adr/0017-group-judgment.html +2 -2
  40. package/.next/server/app/docs/adr/0017-group-judgment.rsc +1 -1
  41. package/.next/server/app/docs/adr/0018-replay-copies-files.html +2 -2
  42. package/.next/server/app/docs/adr/0018-replay-copies-files.rsc +1 -1
  43. package/.next/server/app/docs/adr/0019-typed-body.html +2 -2
  44. package/.next/server/app/docs/adr/0019-typed-body.rsc +1 -1
  45. package/.next/server/app/docs/adr/0020-rule-on-each-opening.html +2 -2
  46. package/.next/server/app/docs/adr/0020-rule-on-each-opening.rsc +1 -1
  47. package/.next/server/app/docs/adr/0021-optional-children.html +2 -2
  48. package/.next/server/app/docs/adr/0021-optional-children.rsc +1 -1
  49. package/.next/server/app/docs/adr/0022-optional-quota.html +2 -2
  50. package/.next/server/app/docs/adr/0022-optional-quota.rsc +1 -1
  51. package/.next/server/app/docs/adr/0023-sealed-report-returns.html +2 -2
  52. package/.next/server/app/docs/adr/0023-sealed-report-returns.rsc +1 -1
  53. package/.next/server/app/docs/adr/0024-one-silence-per-opening.html +2 -2
  54. package/.next/server/app/docs/adr/0024-one-silence-per-opening.rsc +1 -1
  55. package/.next/server/app/docs/adr/0025-environment-variables.html +2 -2
  56. package/.next/server/app/docs/adr/0025-environment-variables.rsc +1 -1
  57. package/.next/server/app/docs/adr/0026-runtime-revision-excludes-platform-and-device.html +2 -2
  58. package/.next/server/app/docs/adr/0026-runtime-revision-excludes-platform-and-device.rsc +1 -1
  59. package/.next/server/app/docs/adr/0027-one-router-consumes-a-slot.html +2 -2
  60. package/.next/server/app/docs/adr/0027-one-router-consumes-a-slot.rsc +1 -1
  61. package/.next/server/app/docs/adr/0028-caddy-desktop-placement.html +2 -2
  62. package/.next/server/app/docs/adr/0028-caddy-desktop-placement.rsc +1 -1
  63. package/.next/server/app/docs/adr/0029-registry-client-or-login.html +2 -2
  64. package/.next/server/app/docs/adr/0029-registry-client-or-login.rsc +1 -1
  65. package/.next/server/app/docs/adr/0030-organization-code-outside-the-repository.html +2 -2
  66. package/.next/server/app/docs/adr/0030-organization-code-outside-the-repository.rsc +1 -1
  67. package/.next/server/app/docs/adr/0031-environment-reload.html +2 -2
  68. package/.next/server/app/docs/adr/0031-environment-reload.rsc +1 -1
  69. package/.next/server/app/docs/adr/0032-an-orchestrator-fault-stops-the-run.html +2 -2
  70. package/.next/server/app/docs/adr/0032-an-orchestrator-fault-stops-the-run.rsc +1 -1
  71. package/.next/server/app/docs/adr/0033-one-rule-for-children.html +2 -2
  72. package/.next/server/app/docs/adr/0033-one-rule-for-children.rsc +1 -1
  73. package/.next/server/app/docs/agents/domain.html +2 -2
  74. package/.next/server/app/docs/agents/domain.rsc +1 -1
  75. package/.next/server/app/docs/engine.html +2 -2
  76. package/.next/server/app/docs/engine.rsc +1 -1
  77. package/.next/server/app/docs/fixture.html +2 -2
  78. package/.next/server/app/docs/fixture.rsc +1 -1
  79. package/.next/server/app/docs/install.html +3 -3
  80. package/.next/server/app/docs/install.rsc +3 -3
  81. package/.next/server/app/docs/server.html +2 -2
  82. package/.next/server/app/docs/server.rsc +1 -1
  83. package/.next/server/app/docs/usage/actions.html +2 -2
  84. package/.next/server/app/docs/usage/actions.rsc +1 -1
  85. package/.next/server/app/docs/usage/drivers.html +2 -2
  86. package/.next/server/app/docs/usage/drivers.rsc +1 -1
  87. package/.next/server/app/docs/usage/flow.html +2 -2
  88. package/.next/server/app/docs/usage/flow.rsc +1 -1
  89. package/.next/server/app/docs/usage/kinds.html +2 -2
  90. package/.next/server/app/docs/usage/kinds.rsc +1 -1
  91. package/.next/server/app/docs.html +2 -2
  92. package/.next/server/app/docs.rsc +1 -1
  93. package/.next/server/app/index.html +1 -1
  94. package/.next/server/app/index.rsc +1 -1
  95. package/.next/server/pages/404.html +1 -1
  96. package/.next/server/pages/500.html +1 -1
  97. package/.next/server/server-reference-manifest.json +1 -1
  98. package/.next/trace +15 -15
  99. package/package.json +1 -1
  100. /package/.next/static/{YNEh12wn0ALeRpEXSN36A → vLf54Ysug2fKPy6N01-oV}/_buildManifest.js +0 -0
  101. /package/.next/static/{YNEh12wn0ALeRpEXSN36A → vLf54Ysug2fKPy6N01-oV}/_ssgManifest.js +0 -0
@@ -1,2 +1,2 @@
1
- (()=>{var a={};a.id=870,a.ids=[870],a.modules={18:(a,b,c)=>{"use strict";c.d(b,{LargeSearchToggle:()=>f,SearchToggle:()=>e});var d=c(71935);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call SearchToggle() from the server but SearchToggle is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/search-toggle.js","SearchToggle"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call LargeSearchToggle() from the server but LargeSearchToggle is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/search-toggle.js","LargeSearchToggle")},261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},2098:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(71935).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-core@15.8.5_@types+react@19.3.0_lucide-react@0.460.0_react@19.3.0__next@15.5.27_@ope_6xxqcdvlb45ebkbm63neggmvbi/node_modules/fumadocs-core/dist/link.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-core@15.8.5_@types+react@19.3.0_lucide-react@0.460.0_react@19.3.0__next@15.5.27_@ope_6xxqcdvlb45ebkbm63neggmvbi/node_modules/fumadocs-core/dist/link.js","default")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},7288:(a,b,c)=>{"use strict";c.d(b,{LanguageToggle:()=>e,LanguageToggleText:()=>f});var d=c(71935);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call LanguageToggle() from the server but LanguageToggle is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/language-toggle.js","LanguageToggle"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call LanguageToggleText() from the server but LanguageToggleText is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/language-toggle.js","LanguageToggleText")},10035:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(71935).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/toc-clerk.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/toc-clerk.js","default")},10723:(a,b,c)=>{"use strict";c.d(b,{r:()=>g});let d=a=>"boolean"==typeof a?`${a}`:0===a?"0":a,e=function(){for(var a,b,c=0,d="",e=arguments.length;c<e;c++)(a=arguments[c])&&(b=function a(b){var c,d,e="";if("string"==typeof b||"number"==typeof b)e+=b;else if("object"==typeof b)if(Array.isArray(b)){var f=b.length;for(c=0;c<f;c++)b[c]&&(d=a(b[c]))&&(e&&(e+=" "),e+=d)}else for(d in b)b[d]&&(e&&(e+=" "),e+=d);return e}(a))&&(d&&(d+=" "),d+=b);return d},f={primary:"bg-fd-primary text-fd-primary-foreground hover:bg-fd-primary/80",outline:"border hover:bg-fd-accent hover:text-fd-accent-foreground",ghost:"hover:bg-fd-accent hover:text-fd-accent-foreground",secondary:"border bg-fd-secondary text-fd-secondary-foreground hover:bg-fd-accent hover:text-fd-accent-foreground"},g=((a,b)=>c=>{var f;if((null==b?void 0:b.variants)==null)return e(a,null==c?void 0:c.class,null==c?void 0:c.className);let{variants:g,defaultVariants:h}=b,i=Object.keys(g).map(a=>{let b=null==c?void 0:c[a],e=null==h?void 0:h[a];if(null===b)return null;let f=d(b)||d(e);return g[a][f]}),j=c&&Object.entries(c).reduce((a,b)=>{let[c,d]=b;return void 0===d||(a[c]=d),a},{});return e(a,i,null==b||null==(f=b.compoundVariants)?void 0:f.reduce((a,b)=>{let{class:c,className:d,...e}=b;return Object.entries(e).every(a=>{let[b,c]=a;return Array.isArray(c)?c.includes({...h,...j}[b]):({...h,...j})[b]===c})?[...a,c,d]:a},[]),null==c?void 0:c.class,null==c?void 0:c.className)})("inline-flex items-center justify-center rounded-md p-2 text-sm font-medium transition-colors duration-100 disabled:pointer-events-none disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fd-ring",{variants:{variant:f,color:f,size:{sm:"gap-1 px-2 py-1.5 text-xs",icon:"p-1.5 [&_svg]:size-5","icon-sm":"p-1.5 [&_svg]:size-4.5","icon-xs":"p-1 [&_svg]:size-4"}}})},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14495:(a,b,c)=>{"use strict";c.d(b,{Nt:()=>C,Ke:()=>E,R6:()=>D});var d=c(5009),e=c(78820),f=c(84335),g=c(26227),h=c(58817),i=c(69524),j=c(3411),k=c(52742),l=c(7173),m=c(95270),n=Object.defineProperty,o=(a,b)=>n(a,"name",{value:b,configurable:!0}),p="Collapsible",[q,r]=(0,g.A)(p),[s,t]=q(p),u=e.forwardRef(o(function(a,b){let{__scopeCollapsible:c,open:f,defaultOpen:g,disabled:i,onOpenChange:j,...l}=a,[n,o]=(0,h.i)({prop:f,defaultProp:g??!1,onChange:j,caller:p});return(0,d.jsx)(s,{scope:c,disabled:i,contentId:(0,m.B)(),open:n,onOpenToggle:e.useCallback(()=>o(a=>!a),[o]),children:(0,d.jsx)(k.sG.div,{"data-state":A(n),"data-disabled":i?"":void 0,...l,ref:b})})},"Collapsible")),w=e.forwardRef(o(function(a,b){let{__scopeCollapsible:c,...e}=a,g=t("CollapsibleTrigger",c);return(0,d.jsx)(k.sG.button,{type:"button","aria-controls":g.open?g.contentId:void 0,"aria-expanded":g.open||!1,"data-state":A(g.open),"data-disabled":g.disabled?"":void 0,disabled:g.disabled,...e,ref:b,onClick:(0,f.mK)(a.onClick,g.onOpenToggle)})},"CollapsibleTrigger")),x="CollapsibleContent",y=e.forwardRef(o(function(a,b){let{forceMount:c,...e}=a,f=t(x,a.__scopeCollapsible);return(0,d.jsx)(l.C,{present:c||f.open,children:({present:a})=>(0,d.jsx)(z,{...e,ref:b,present:a})})},"CollapsibleContent")),z=e.forwardRef(o(function(a,b){let{__scopeCollapsible:c,present:f,children:g,...h}=a,l=t(x,c),[m,n]=e.useState(f),o=e.useRef(null),p=(0,j.s)(b,o),q=e.useRef(0),r=q.current,s=e.useRef(0),u=s.current,w=l.open||m,y=e.useRef(w),z=e.useRef(void 0);return e.useEffect(()=>{let a=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(a)},[]),(0,i.N)(()=>{let a=o.current;if(a){z.current=z.current||{transitionDuration:a.style.transitionDuration,animationName:a.style.animationName},a.style.transitionDuration="0s",a.style.animationName="none";let b=a.getBoundingClientRect();q.current=b.height,s.current=b.width,y.current||(a.style.transitionDuration=z.current.transitionDuration,a.style.animationName=z.current.animationName),n(f)}},[l.open,f]),(0,d.jsx)(k.sG.div,{"data-state":A(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!w,...h,ref:p,style:{"--radix-collapsible-content-height":r?`${r}px`:void 0,"--radix-collapsible-content-width":u?`${u}px`:void 0,...a.style},children:w&&g})},"CollapsibleContentImpl"));function A(a){return a?"open":"closed"}o(A,"getState");var B=c(17265);let C=u,D=w,E=(0,e.forwardRef)(({children:a,...b},c)=>{let[f,g]=(0,e.useState)(!1);return(0,e.useEffect)(()=>{g(!0)},[]),(0,d.jsx)(y,{ref:c,...b,className:(0,B.QP)("overflow-hidden",f&&"data-[state=closed]:animate-fd-collapsible-up data-[state=open]:animate-fd-collapsible-down",b.className),children:a})});E.displayName=y.displayName},14992:(a,b,c)=>{"use strict";c.d(b,{TreeContextProvider:()=>e});var d=c(71935);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call TreeContextProvider() from the server but TreeContextProvider is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/contexts/tree.js","TreeContextProvider");(0,d.registerClientReference)(function(){throw Error("Attempted to call useTreePath() from the server but useTreePath is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/contexts/tree.js","useTreePath"),(0,d.registerClientReference)(function(){throw Error("Attempted to call useTreeContext() from the server but useTreeContext is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/contexts/tree.js","useTreeContext")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},19671:(a,b,c)=>{"use strict";c.d(b,{Image:()=>e});var d=c(71935);(0,d.registerClientReference)(function(){throw Error("Attempted to call FrameworkProvider() from the server but FrameworkProvider is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-core@15.8.5_@types+react@19.3.0_lucide-react@0.460.0_react@19.3.0__next@15.5.27_@ope_6xxqcdvlb45ebkbm63neggmvbi/node_modules/fumadocs-core/dist/framework/index.js","FrameworkProvider");let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call Image() from the server but Image is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-core@15.8.5_@types+react@19.3.0_lucide-react@0.460.0_react@19.3.0__next@15.5.27_@ope_6xxqcdvlb45ebkbm63neggmvbi/node_modules/fumadocs-core/dist/framework/index.js","Image");(0,d.registerClientReference)(function(){throw Error("Attempted to call Link() from the server but Link is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-core@15.8.5_@types+react@19.3.0_lucide-react@0.460.0_react@19.3.0__next@15.5.27_@ope_6xxqcdvlb45ebkbm63neggmvbi/node_modules/fumadocs-core/dist/framework/index.js","Link"),(0,d.registerClientReference)(function(){throw Error("Attempted to call createContext() from the server but createContext is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-core@15.8.5_@types+react@19.3.0_lucide-react@0.460.0_react@19.3.0__next@15.5.27_@ope_6xxqcdvlb45ebkbm63neggmvbi/node_modules/fumadocs-core/dist/framework/index.js","createContext"),(0,d.registerClientReference)(function(){throw Error("Attempted to call useParams() from the server but useParams is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-core@15.8.5_@types+react@19.3.0_lucide-react@0.460.0_react@19.3.0__next@15.5.27_@ope_6xxqcdvlb45ebkbm63neggmvbi/node_modules/fumadocs-core/dist/framework/index.js","useParams"),(0,d.registerClientReference)(function(){throw Error("Attempted to call usePathname() from the server but usePathname is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-core@15.8.5_@types+react@19.3.0_lucide-react@0.460.0_react@19.3.0__next@15.5.27_@ope_6xxqcdvlb45ebkbm63neggmvbi/node_modules/fumadocs-core/dist/framework/index.js","usePathname"),(0,d.registerClientReference)(function(){throw Error("Attempted to call useRouter() from the server but useRouter is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-core@15.8.5_@types+react@19.3.0_lucide-react@0.460.0_react@19.3.0__next@15.5.27_@ope_6xxqcdvlb45ebkbm63neggmvbi/node_modules/fumadocs-core/dist/framework/index.js","useRouter")},19758:(a,b,c)=>{Promise.resolve().then(c.bind(c,54309)),Promise.resolve().then(c.bind(c,69212)),Promise.resolve().then(c.bind(c,60441)),Promise.resolve().then(c.bind(c,63617)),Promise.resolve().then(c.bind(c,82425)),Promise.resolve().then(c.bind(c,38002)),Promise.resolve().then(c.bind(c,53842))},19847:(a,b,c)=>{"use strict";c.d(b,{ThemeToggle:()=>l});var d=c(5009),e=c(79386),f=c(97469),g=c(47577),h=c(78820),i=c(17265);let j=(0,e.F)("size-6.5 rounded-full p-1.5 text-fd-muted-foreground",{variants:{active:{true:"bg-fd-accent text-fd-accent-foreground",false:"text-fd-muted-foreground"}}}),k=[["light",f.bd],["dark",f.AX],["system",f.$3]];function l({className:a,mode:b="light-dark",...c}){let{setTheme:e,theme:f,resolvedTheme:l}=(0,g.D)(),[m,n]=(0,h.useState)(!1),o=(0,i.QP)("inline-flex items-center rounded-full border p-1",a);if("light-dark"===b){let a=m?l:null;return(0,d.jsx)("button",{className:o,"aria-label":"Toggle Theme",onClick:()=>e("light"===a?"dark":"light"),"data-theme-toggle":"",...c,children:k.map(([b,c])=>{if("system"!==b)return(0,d.jsx)(c,{fill:"currentColor",className:(0,i.QP)(j({active:a===b}))},b)})})}let p=m?f:null;return(0,d.jsx)("div",{className:o,"data-theme-toggle":"",...c,children:k.map(([a,b])=>(0,d.jsx)("button",{"aria-label":a,className:(0,i.QP)(j({active:p===a})),onClick:()=>e(a),children:(0,d.jsx)(b,{className:"size-full",fill:"currentColor"})},a))})}},19998:(a,b,c)=>{"use strict";c.d(b,{Sidebar:()=>ax,SidebarCollapseTrigger:()=>aK,SidebarContent:()=>ay,SidebarContentMobile:()=>az,SidebarFolder:()=>aF,SidebarFolderContent:()=>aI,SidebarFolderLink:()=>aH,SidebarFolderTrigger:()=>aG,SidebarFooter:()=>aB,SidebarHeader:()=>aA,SidebarItem:()=>aE,SidebarPageTree:()=>aN,SidebarTrigger:()=>aJ,SidebarViewport:()=>aC});var d=c(5009),e=c(97469),f=c(54309),g=c(78820),h=c(69212),i=c(18442),j=c(17265),k=c(52742),l=c(7173),m=c(14069),n=c(26227),o=c(3411),p=c(28510),q=c(70931),r=c(69524);function s(a,[b,c]){return Math.min(c,Math.max(b,a))}(0,Object.defineProperty)(s,"name",{value:"clamp",configurable:!0});var t=c(84335),u=c(97478),w=Object.defineProperty,x=(a,b)=>w(a,"name",{value:b,configurable:!0});function y(a,b){return g.useReducer((a,c)=>b[a][c]??a,a)}x(y,"useStateMachine");var z={Auto:"auto",Always:"always",Scroll:"scroll",Hover:"hover"},A={Vertical:"vertical",Horizontal:"horizontal"},B={LTR:"ltr",RTL:"rtl"},C="ScrollArea",[D,E]=(0,n.A)(C),[F,G]=D(C),H=g.forwardRef(x(function(a,b){let{__scopeScrollArea:c,type:e=z.Hover,dir:f,scrollHideDelay:h=600,...i}=a,[j,l]=g.useState(null),[m,n]=g.useState(null),[p,r]=g.useState(null),[s,t]=g.useState(null),[u,w]=g.useState(null),[x,y]=g.useState(0),[A,B]=g.useState(0),[C,D]=g.useState(!1),[E,G]=g.useState(!1),H=(0,o.s)(b,l),I=(0,q.jH)(f);return(0,d.jsx)(F,{scope:c,type:e,dir:I,scrollHideDelay:h,scrollArea:j,viewport:m,onViewportChange:n,content:p,onContentChange:r,scrollbarX:s,onScrollbarXChange:t,scrollbarXEnabled:C,onScrollbarXEnabledChange:D,scrollbarY:u,onScrollbarYChange:w,scrollbarYEnabled:E,onScrollbarYEnabledChange:G,onCornerWidthChange:y,onCornerHeightChange:B,children:(0,d.jsx)(k.sG.div,{dir:I,...i,ref:H,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":A+"px",...a.style}})})},"ScrollArea")),I="ScrollAreaViewport",J=(0,m.Dc)(I),K=g.forwardRef(x(function(a,b){let{__scopeScrollArea:c,children:e,nonce:f,disableImplicitContentElement:h,...i}=a,j=G(I,c),l=g.useRef(null),m=(0,o.s)(b,l,j.onViewportChange),n=g.isValidElement(e);if(u.D){let b=g.useRef(!1),c=!0===a.asChild&&!h&&!n;g.useEffect(()=>{c&&!b.current&&(b.current=!0,console.warn(`${I}: \`asChild\` expects a single React element child, so its props have been applied to the implicitly rendered content element instead. Wrap the children in a single element, or opt into \`disableImplicitContentElement\` and render a \`ScrollArea.Content\` inside the viewport.`))},[c])}return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(L,{nonce:f}),(0,d.jsx)(k.sG.div,{"data-radix-scroll-area-viewport":"",...i,ref:m,style:{overflowX:j.scrollbarXEnabled?"scroll":"hidden",overflowY:j.scrollbarYEnabled?"scroll":"hidden",...a.style},children:h?e:n?(0,d.jsx)(J,{child:e,children:a=>(0,d.jsx)(M,{__scopeScrollArea:c,children:a})}):(0,d.jsx)(J,{children:(0,d.jsx)(M,{__scopeScrollArea:c,children:e})})})]})},"ScrollAreaViewport")),L=g.memo(x(function({nonce:a}){return(0,d.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a})},"ScrollAreaViewportStyle"),(a,b)=>a.nonce===b.nonce),M=g.forwardRef(x(function(a,b){let{__scopeScrollArea:c,children:e,...f}=a,g=G("ScrollAreaContent",c),h=(0,o.s)(b,g.onContentChange);return(0,d.jsx)(k.sG.div,{...f,ref:h,style:{minWidth:"100%",display:"table",...a.style},children:e})},"ScrollAreaContent")),N="ScrollAreaScrollbar",O=g.forwardRef(x(function(a,b){let{forceMount:c,...e}=a,f=G(N,a.__scopeScrollArea),{onScrollbarXEnabledChange:h,onScrollbarYEnabledChange:i}=f,j=a.orientation===A.Horizontal;return g.useEffect(()=>(j?h(!0):i(!0),()=>{j?h(!1):i(!1)}),[j,h,i]),f.type===z.Hover?(0,d.jsx)(P,{...e,ref:b,forceMount:c}):f.type===z.Scroll?(0,d.jsx)(Q,{...e,ref:b,forceMount:c}):f.type===z.Auto?(0,d.jsx)(R,{...e,ref:b,forceMount:c}):f.type===z.Always?(0,d.jsx)(S,{...e,ref:b,"data-state":"visible"}):null},"ScrollAreaScrollbar")),P=g.forwardRef(x(function(a,b){let{forceMount:c,...e}=a,f=G(N,a.__scopeScrollArea),[h,i]=g.useState(!1);return g.useEffect(()=>{let a=f.scrollArea,b=0;if(a){let c=x(()=>{window.clearTimeout(b),i(!0)},"handlePointerEnter"),d=x(()=>{b=window.setTimeout(()=>i(!1),f.scrollHideDelay)},"handlePointerLeave");return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(b),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",d)}}},[f.scrollArea,f.scrollHideDelay]),(0,d.jsx)(l.C,{present:c||h,children:(0,d.jsx)(R,{"data-state":h?"visible":"hidden",...e,ref:b})})},"ScrollAreaScrollbarHover")),Q=g.forwardRef(x(function(a,b){let{forceMount:c,...e}=a,f=G(N,a.__scopeScrollArea),h=a.orientation===A.Horizontal,i=ak(()=>k("SCROLL_END"),100),[j,k]=y("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return g.useEffect(()=>{if("idle"===j){let a=window.setTimeout(()=>k("HIDE"),f.scrollHideDelay);return()=>window.clearTimeout(a)}},[j,f.scrollHideDelay,k]),g.useEffect(()=>{let a=f.viewport,b=h?"scrollLeft":"scrollTop";if(a){let c=a[b],d=x(()=>{let d=a[b];c!==d&&(k("SCROLL"),i()),c=d},"handleScroll");return a.addEventListener("scroll",d),()=>a.removeEventListener("scroll",d)}},[f.viewport,h,k,i]),(0,d.jsx)(l.C,{present:c||"hidden"!==j,children:(0,d.jsx)(S,{"data-state":"hidden"===j?"hidden":"visible",...e,ref:b,onPointerEnter:(0,t.mK)(a.onPointerEnter,()=>k("POINTER_ENTER")),onPointerLeave:(0,t.mK)(a.onPointerLeave,()=>k("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),R=g.forwardRef(x(function(a,b){let c=G(N,a.__scopeScrollArea),{forceMount:e,...f}=a,[h,i]=g.useState(!1),j=a.orientation===A.Horizontal,k=ak(()=>{if(c.viewport){let a=c.viewport.offsetWidth<c.viewport.scrollWidth,b=c.viewport.offsetHeight<c.viewport.scrollHeight;i(j?a:b)}},10);return al(c.viewport,k),al(c.content,k),(0,d.jsx)(l.C,{present:e||h,children:(0,d.jsx)(S,{"data-state":h?"visible":"hidden",...f,ref:b})})},"ScrollAreaScrollbarAuto")),S=g.forwardRef(x(function(a,b){let{orientation:c=A.Vertical,...e}=a,f=G(N,a.__scopeScrollArea),h=g.useRef(null),i=g.useRef(0),[j,k]=g.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=ad(j.viewport,j.content),m={...e,sizes:j,onSizesChange:k,hasThumb:!!(l>0&&l<1),onThumbChange:x(a=>h.current=a,"onThumbChange"),onThumbPointerUp:x(()=>i.current=0,"onThumbPointerUp"),onThumbPointerDown:x(a=>i.current=a,"onThumbPointerDown")};function n(a,b){return af(a,i.current,j,b)}return(x(n,"getScrollPosition"),c===A.Horizontal)?(0,d.jsx)(T,{...m,ref:b,onThumbPositionChange:()=>{if(f.viewport&&h.current){let a=ag(f.viewport.scrollLeft,j,f.dir);h.current.style.transform=`translate3d(${a}px, 0, 0)`}},onWheelScroll:a=>{f.viewport&&(f.viewport.scrollLeft=a)},onDragScroll:a=>{f.viewport&&(f.viewport.scrollLeft=n(a,f.dir))}}):c===A.Vertical?(0,d.jsx)(U,{...m,ref:b,onThumbPositionChange:()=>{if(f.viewport&&h.current){let a=ag(f.viewport.scrollTop,j);h.current.style.transform=`translate3d(0, ${a}px, 0)`}},onWheelScroll:a=>{f.viewport&&(f.viewport.scrollTop=a)},onDragScroll:a=>{f.viewport&&(f.viewport.scrollTop=n(a))}}):null},"ScrollAreaScrollbarVisible")),T=g.forwardRef(x(function(a,b){let{sizes:c,onSizesChange:e,...f}=a,h=G(N,a.__scopeScrollArea),[i,j]=g.useState(),k=g.useRef(null),l=(0,o.s)(b,k,h.onScrollbarXChange);return g.useEffect(()=>{k.current&&j(getComputedStyle(k.current))},[k]),(0,d.jsx)(X,{"data-orientation":"horizontal",...f,ref:l,sizes:c,style:{bottom:0,left:h.dir===B.RTL?"var(--radix-scroll-area-corner-width)":0,right:h.dir===B.LTR?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ae(c)+"px",...a.style},onThumbPointerDown:b=>a.onThumbPointerDown(b.x),onDragScroll:b=>a.onDragScroll(b.x),onWheelScroll:(b,c)=>{if(h.viewport){let d=h.viewport.scrollLeft+b.deltaX;a.onWheelScroll(d),ai(d,c)&&b.preventDefault()}},onResize:()=>{k.current&&h.viewport&&i&&e({content:h.viewport.scrollWidth,viewport:h.viewport.offsetWidth,scrollbar:{size:k.current.clientWidth,paddingStart:ac(i.paddingLeft),paddingEnd:ac(i.paddingRight)}})}})},"ScrollAreaScrollbarX")),U=g.forwardRef(x(function(a,b){let{sizes:c,onSizesChange:e,...f}=a,h=G(N,a.__scopeScrollArea),[i,j]=g.useState(),k=g.useRef(null),l=(0,o.s)(b,k,h.onScrollbarYChange);return g.useEffect(()=>{k.current&&j(getComputedStyle(k.current))},[k]),(0,d.jsx)(X,{"data-orientation":"vertical",...f,ref:l,sizes:c,style:{top:0,right:h.dir===B.LTR?0:void 0,left:h.dir===B.RTL?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ae(c)+"px",...a.style},onThumbPointerDown:b=>a.onThumbPointerDown(b.y),onDragScroll:b=>a.onDragScroll(b.y),onWheelScroll:(b,c)=>{if(h.viewport){let d=h.viewport.scrollTop+b.deltaY;a.onWheelScroll(d),ai(d,c)&&b.preventDefault()}},onResize:()=>{k.current&&h.viewport&&i&&e({content:h.viewport.scrollHeight,viewport:h.viewport.offsetHeight,scrollbar:{size:k.current.clientHeight,paddingStart:ac(i.paddingTop),paddingEnd:ac(i.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[V,W]=D(N),X=g.forwardRef(x(function(a,b){let{__scopeScrollArea:c,sizes:e,hasThumb:f,onThumbChange:h,onThumbPointerUp:i,onThumbPointerDown:j,onThumbPositionChange:l,onDragScroll:m,onWheelScroll:n,onResize:q,...r}=a,s=G(N,c),[u,w]=g.useState(null),y=(0,o.s)(b,w),z=g.useRef(null),A=g.useRef(""),B=s.viewport,C=e.content-e.viewport,D=(0,p.c)(n),E=(0,p.c)(l),F=ak(q,10);function H(a){z.current&&m({x:a.clientX-z.current.left,y:a.clientY-z.current.top})}return x(H,"handleDragScroll"),g.useEffect(()=>{let a=x(a=>{let b=a.target;u?.contains(b)&&D(a,C)},"handleWheel");return document.addEventListener("wheel",a,{passive:!1}),()=>document.removeEventListener("wheel",a,{passive:!1})},[B,u,C,D]),g.useEffect(E,[e,E]),al(u,F),al(s.content,F),(0,d.jsx)(V,{scope:c,scrollbar:u,hasThumb:f,onThumbChange:(0,p.c)(h),onThumbPointerUp:(0,p.c)(i),onThumbPositionChange:E,onThumbPointerDown:(0,p.c)(j),children:(0,d.jsx)(k.sG.div,{...r,ref:y,style:{position:"absolute",...r.style},onPointerDown:(0,t.mK)(a.onPointerDown,a=>{0===a.button&&(a.target.setPointerCapture(a.pointerId),z.current=u.getBoundingClientRect(),A.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",s.viewport&&(s.viewport.style.scrollBehavior="auto"),H(a))}),onPointerMove:(0,t.mK)(a.onPointerMove,H),onPointerUp:(0,t.mK)(a.onPointerUp,a=>{let b=a.target;b.hasPointerCapture(a.pointerId)&&b.releasePointerCapture(a.pointerId),document.body.style.webkitUserSelect=A.current,s.viewport&&(s.viewport.style.scrollBehavior=""),z.current=null})})})},"ScrollAreaScrollbarImpl")),Y="ScrollAreaThumb",Z=g.forwardRef(x(function(a,b){let{forceMount:c,...e}=a,f=W(Y,a.__scopeScrollArea);return(0,d.jsx)(l.C,{present:c||f.hasThumb,children:(0,d.jsx)($,{ref:b,...e})})},"ScrollAreaThumb")),$=g.forwardRef(x(function(a,b){let{__scopeScrollArea:c,style:e,...f}=a,h=G(Y,c),i=W(Y,c),{onThumbPositionChange:j}=i,l=(0,o.s)(b,i.onThumbChange),m=g.useRef(void 0),n=ak(()=>{m.current&&(m.current(),m.current=void 0)},100);return g.useEffect(()=>{let a=h.viewport;if(a){let b=x(()=>{n(),m.current||(m.current=aj(a,j),j())},"handleScroll");return j(),a.addEventListener("scroll",b),()=>a.removeEventListener("scroll",b)}},[h.viewport,n,j]),(0,d.jsx)(k.sG.div,{"data-state":i.hasThumb?"visible":"hidden",...f,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...e},onPointerDownCapture:(0,t.mK)(a.onPointerDownCapture,a=>{let b=a.target.getBoundingClientRect(),c=a.clientX-b.left,d=a.clientY-b.top;i.onThumbPointerDown({x:c,y:d})}),onPointerUp:(0,t.mK)(a.onPointerUp,i.onThumbPointerUp)})},"ScrollAreaThumbImpl")),_="ScrollAreaCorner",aa=g.forwardRef(x(function(a,b){let c=G(_,a.__scopeScrollArea),e=!!(c.scrollbarX&&c.scrollbarY);return c.type!==z.Scroll&&e?(0,d.jsx)(ab,{...a,ref:b}):null},"ScrollAreaCorner")),ab=g.forwardRef(x(function(a,b){let{__scopeScrollArea:c,...e}=a,f=G(_,c),[h,i]=g.useState(0),[j,l]=g.useState(0),m=!!(h&&j),{onCornerWidthChange:n,onCornerHeightChange:o}=f;return al(f.scrollbarX,()=>{let a=f.scrollbarX?.offsetHeight||0;f.onCornerHeightChange(a),l(a)}),al(f.scrollbarY,()=>{let a=f.scrollbarY?.offsetWidth||0;f.onCornerWidthChange(a),i(a)}),g.useEffect(()=>()=>{n(0),o(0)},[n,o]),m?(0,d.jsx)(k.sG.div,{...e,ref:b,style:{width:h,height:j,position:"absolute",right:f.dir===B.LTR?0:void 0,left:f.dir===B.RTL?0:void 0,bottom:0,...a.style}}):null},"ScrollAreaCornerImpl"));function ac(a){return a?parseInt(a,10):0}function ad(a,b){let c=a/b;return isNaN(c)?0:c}function ae(a){let b=ad(a.viewport,a.content),c=a.scrollbar.paddingStart+a.scrollbar.paddingEnd;return Math.max((a.scrollbar.size-c)*b,18)}function af(a,b,c,d=B.LTR){let e=ae(c),f=b||e/2,g=c.scrollbar.paddingStart+f,h=c.scrollbar.size-c.scrollbar.paddingEnd-(e-f),i=c.content-c.viewport;return ah([g,h],d===B.LTR?[0,i]:[-1*i,0])(a)}function ag(a,b,c=B.LTR){let d=ae(b),e=b.scrollbar.paddingStart+b.scrollbar.paddingEnd,f=b.scrollbar.size-e,g=b.content-b.viewport,h=s(a,c===B.LTR?[0,g]:[-1*g,0]);return ah([0,g],[0,f-d])(h)}function ah(a,b){return c=>{if(a[0]===a[1]||b[0]===b[1])return b[0];let d=(b[1]-b[0])/(a[1]-a[0]);return b[0]+d*(c-a[0])}}function ai(a,b){return a>0&&a<b}x(ac,"toInt"),x(ad,"getThumbRatio"),x(ae,"getThumbSize"),x(af,"getScrollPositionFromPointer"),x(ag,"getThumbOffsetFromScroll"),x(ah,"linearScale"),x(ai,"isScrollingWithinScrollbarBounds");var aj=x((a,b=()=>{})=>(a.scrollLeft,a.scrollTop,()=>window.cancelAnimationFrame(0)),"addUnlinkedScrollListener");function ak(a,b){let c=(0,p.c)(a),d=g.useRef(0);return g.useEffect(()=>()=>window.clearTimeout(d.current),[]),g.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(c,b)},[c,b])}function al(a,b){let c=(0,p.c)(b);(0,r.N)(()=>{let b=0;if(a){let d=new ResizeObserver(()=>{cancelAnimationFrame(b),b=window.requestAnimationFrame(c)});return d.observe(a),()=>{window.cancelAnimationFrame(b),d.unobserve(a)}}},[a,c])}x(ak,"useDebounceCallback"),x(al,"useResizeObserver");let am=g.forwardRef(({className:a,children:b,...c},e)=>(0,d.jsxs)(H,{ref:e,type:"scroll",className:(0,j.QP)("overflow-hidden",a),...c,children:[b,(0,d.jsx)(aa,{}),(0,d.jsx)(ao,{orientation:"vertical"})]}));am.displayName=H.displayName;let an=g.forwardRef(({className:a,children:b,...c},e)=>(0,d.jsx)(K,{ref:e,className:(0,j.QP)("size-full rounded-[inherit]",a),...c,children:b}));an.displayName=K.displayName;let ao=g.forwardRef(({className:a,orientation:b="vertical",...c},e)=>(0,d.jsx)(O,{ref:e,orientation:b,className:(0,j.QP)("flex select-none data-[state=hidden]:animate-fd-fade-out","vertical"===b&&"h-full w-1.5","horizontal"===b&&"h-1.5 flex-col",a),...c,children:(0,d.jsx)(Z,{className:"relative flex-1 rounded-full bg-fd-border"})}));ao.displayName=O.displayName;var ap=c(59384),aq=c(14495),ar=c(85880),as=c(79386),at=c(47718);c(8566);let au=(0,as.F)("relative flex flex-row items-center gap-2 rounded-lg p-2 ps-(--sidebar-item-offset) text-start text-fd-muted-foreground [overflow-wrap:anywhere] [&_svg]:size-4 [&_svg]:shrink-0",{variants:{active:{true:"bg-fd-primary/10 text-fd-primary",false:"transition-colors hover:bg-fd-accent/50 hover:text-fd-accent-foreground/80 hover:transition-none"}}}),av=(0,g.createContext)(null),aw=(0,g.createContext)(null);function ax({defaultOpenLevel:a=0,prefetch:b=!0,Mobile:c,Content:e}){let f=function(a,b=!1){let[c,d]=(0,g.useState)(null);return(0,g.useEffect)(()=>{if(b)return;let c=window.matchMedia(a),e=()=>{d(c.matches)};return e(),c.addEventListener("change",e),()=>{c.removeEventListener("change",e)}},[b,a]),c}("(width < 768px)")??!1,h=(0,g.useMemo)(()=>({defaultOpenLevel:a,prefetch:b,level:1}),[a,b]);return(0,d.jsx)(av.Provider,{value:h,children:f&&null!=c?c:e})}function ay(a){let{collapsed:b}=(0,ar.c)(),[c,e]=(0,g.useState)(!1),f=(0,g.useRef)(0),h=(0,g.useRef)(0);return(0,i.T)(b,()=>{e(!1),h.current=Date.now()+150}),(0,d.jsx)("aside",{id:"nd-sidebar",...a,"data-collapsed":b,className:(0,j.QP)("fixed left-0 rtl:left-auto rtl:right-(--removed-body-scroll-bar-size,0) flex flex-col items-end top-(--fd-sidebar-top) bottom-(--fd-sidebar-margin) z-20 bg-fd-card text-sm border-e transition-[top,opacity,translate,width] duration-200 max-md:hidden *:w-(--fd-sidebar-width)",b&&["rounded-xl border translate-x-(--fd-sidebar-offset) rtl:-translate-x-(--fd-sidebar-offset)",c?"z-50 shadow-lg":"opacity-0"],a.className),style:{...a.style,"--fd-sidebar-offset":c?"calc(var(--spacing) * 2)":"calc(16px - 100%)","--fd-sidebar-margin":b?"0.5rem":"0px","--fd-sidebar-top":"calc(var(--fd-banner-height) + var(--fd-nav-height) + var(--fd-sidebar-margin))",width:b?"var(--fd-sidebar-width)":"calc(var(--spacing) + var(--fd-sidebar-width) + var(--fd-layout-offset))"},onPointerEnter:a=>{!b||"touch"===a.pointerType||h.current>Date.now()||(window.clearTimeout(f.current),e(!0))},onPointerLeave:a=>{b&&"touch"!==a.pointerType&&(window.clearTimeout(f.current),f.current=window.setTimeout(()=>{e(!1),h.current=Date.now()+150},Math.min(a.clientX,document.body.clientWidth-a.clientX)>100?0:500))},children:a.children})}function az({className:a,children:b,...c}){let{open:e,setOpen:f}=(0,ar.c)(),g=e?"open":"closed";return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(l.C,{present:e,children:(0,d.jsx)("div",{"data-state":g,className:"fixed z-40 inset-0 backdrop-blur-xs data-[state=open]:animate-fd-fade-in data-[state=closed]:animate-fd-fade-out",onClick:()=>f(!1)})}),(0,d.jsx)(l.C,{present:e,children:({present:e})=>(0,d.jsx)("aside",{id:"nd-sidebar-mobile",...c,"data-state":g,className:(0,j.QP)("fixed text-[15px] flex flex-col shadow-lg border-s end-0 inset-y-0 w-[85%] max-w-[380px] z-40 bg-fd-background data-[state=open]:animate-fd-sidebar-in data-[state=closed]:animate-fd-sidebar-out",!e&&"invisible",a),children:b})})]})}function aA(a){return(0,d.jsx)("div",{...a,className:(0,j.QP)("flex flex-col gap-3 p-4 pb-2",a.className),children:a.children})}function aB(a){return(0,d.jsx)("div",{...a,className:(0,j.QP)("flex flex-col border-t p-4 pt-2",a.className),children:a.children})}function aC(a){return(0,d.jsx)(am,{...a,className:(0,j.QP)("h-full",a.className),children:(0,d.jsx)(an,{className:"p-4 overscroll-contain",style:{"--sidebar-item-offset":"calc(var(--spacing) * 2)",maskImage:"linear-gradient(to bottom, transparent, white 12px, white calc(100% - 12px), transparent)"},children:a.children})})}function aD(a){return(0,d.jsx)("p",{...a,className:(0,j.QP)("inline-flex items-center gap-2 mb-1.5 px-2 ps-(--sidebar-item-offset) empty:mb-0 [&_svg]:size-4 [&_svg]:shrink-0",a.className),children:a.children})}function aE({icon:a,...b}){let c=(0,f.a8)(),g=void 0!==b.href&&(0,ap.$)(b.href,c,!1),{prefetch:i}=aM();return(0,d.jsxs)(h.default,{...b,"data-active":g,className:(0,j.QP)(au({active:g}),b.className),prefetch:i,children:[a??(b.external?(0,d.jsx)(e.Gr,{}):null),b.children]})}function aF({defaultOpen:a=!1,...b}){let[c,e]=(0,g.useState)(a);return(0,i.T)(a,a=>{a&&e(a)}),(0,d.jsx)(aq.Nt,{open:c,onOpenChange:e,...b,children:(0,d.jsx)(aw.Provider,{value:(0,g.useMemo)(()=>({open:c,setOpen:e}),[c]),children:b.children})})}function aG({className:a,...b}){let{open:c}=aL();return(0,d.jsxs)(aq.R6,{className:(0,j.QP)(au({active:!1}),"w-full",a),...b,children:[b.children,(0,d.jsx)(e.yQ,{"data-icon":!0,className:(0,j.QP)("ms-auto transition-transform",!c&&"-rotate-90")})]})}function aH(a){let{open:b,setOpen:c}=aL(),{prefetch:g}=aM(),i=(0,f.a8)(),k=void 0!==a.href&&(0,ap.$)(a.href,i,!1);return(0,d.jsxs)(h.default,{...a,"data-active":k,className:(0,j.QP)(au({active:k}),"w-full",a.className),onClick:a=>{a.target instanceof Element&&a.target.matches("[data-icon], [data-icon] *")?(c(!b),a.preventDefault()):c(!k||!b)},prefetch:g,children:[a.children,(0,d.jsx)(e.yQ,{"data-icon":!0,className:(0,j.QP)("ms-auto transition-transform",!b&&"-rotate-90")})]})}function aI(a){let{level:b,...c}=aM();return(0,d.jsx)(aq.Ke,{...a,className:(0,j.QP)("relative",1===b&&["before:content-[''] before:absolute before:w-px before:inset-y-1 before:bg-fd-border before:start-2.5","**:data-[active=true]:before:content-[''] **:data-[active=true]:before:bg-fd-primary **:data-[active=true]:before:absolute **:data-[active=true]:before:w-px **:data-[active=true]:before:inset-y-2.5 **:data-[active=true]:before:start-2.5"],a.className),style:{"--sidebar-item-offset":`calc(var(--spacing) * ${(b+1)*3})`,...a.style},children:(0,d.jsx)(av.Provider,{value:(0,g.useMemo)(()=>({...c,level:b+1}),[c,b]),children:a.children})})}function aJ({children:a,...b}){let{setOpen:c}=(0,ar.c)();return(0,d.jsx)("button",{...b,"aria-label":"Open Sidebar",onClick:()=>c(a=>!a),children:a})}function aK(a){let{collapsed:b,setCollapsed:c}=(0,ar.c)();return(0,d.jsx)("button",{type:"button","aria-label":"Collapse Sidebar","data-collapsed":b,...a,onClick:()=>{c(a=>!a)},children:a.children})}function aL(){let a=(0,g.useContext)(aw);if(!a)throw Error("Missing sidebar folder");return a}function aM(){let a=(0,g.useContext)(av);if(!a)throw Error("<Sidebar /> component required.");return a}function aN(a){let{root:b}=(0,at.t)();return(0,g.useMemo)(()=>{let{Separator:c,Item:e,Folder:f}=a.components??{};return(0,d.jsx)(g.Fragment,{children:function a(b,g){return b.map((b,h)=>{if("separator"===b.type)return c?(0,d.jsx)(c,{item:b},h):(0,d.jsxs)(aD,{className:(0,j.QP)(0!==h&&"mt-6"),children:[b.icon,b.name]},h);if("folder"===b.type){let c=a(b.children,g+1);return f?(0,d.jsx)(f,{item:b,level:g,children:c},h):(0,d.jsx)(aO,{item:b,children:c},h)}return e?(0,d.jsx)(e,{item:b},b.url):(0,d.jsx)(aE,{href:b.url,external:b.external,icon:b.icon,children:b.name},b.url)})}(b.children,1)},b.$id)},[a.components,b])}function aO({item:a,...b}){let{defaultOpenLevel:c,level:e}=aM(),f=(0,at.L)();return(0,d.jsxs)(aF,{defaultOpen:(a.defaultOpen??c>=e)||f.includes(a),children:[a.index?(0,d.jsxs)(aH,{href:a.index.url,external:a.index.external,...b,children:[a.icon,a.name]}):(0,d.jsxs)(aG,{...b,children:[a.icon,a.name]}),(0,d.jsx)(aI,{children:b.children})]})}},22353:(a,b,c)=>{"use strict";c.d(b,{Sidebar:()=>e,SidebarCollapseTrigger:()=>q,SidebarContent:()=>f,SidebarContentMobile:()=>g,SidebarFolder:()=>l,SidebarFolderContent:()=>o,SidebarFolderLink:()=>n,SidebarFolderTrigger:()=>m,SidebarFooter:()=>i,SidebarHeader:()=>h,SidebarItem:()=>k,SidebarPageTree:()=>r,SidebarTrigger:()=>p,SidebarViewport:()=>j});var d=c(71935);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call Sidebar() from the server but Sidebar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","Sidebar"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarContent() from the server but SidebarContent is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarContent"),g=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarContentMobile() from the server but SidebarContentMobile is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarContentMobile"),h=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarHeader() from the server but SidebarHeader is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarHeader"),i=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarFooter() from the server but SidebarFooter is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarFooter"),j=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarViewport() from the server but SidebarViewport is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarViewport");(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarSeparator() from the server but SidebarSeparator is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarSeparator");let k=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarItem() from the server but SidebarItem is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarItem"),l=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarFolder() from the server but SidebarFolder is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarFolder"),m=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarFolderTrigger() from the server but SidebarFolderTrigger is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarFolderTrigger"),n=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarFolderLink() from the server but SidebarFolderLink is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarFolderLink"),o=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarFolderContent() from the server but SidebarFolderContent is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarFolderContent"),p=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarTrigger() from the server but SidebarTrigger is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarTrigger"),q=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarCollapseTrigger() from the server but SidebarCollapseTrigger is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarCollapseTrigger"),r=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarPageTree() from the server but SidebarPageTree is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarPageTree")},23150:(a,b,c)=>{"use strict";c.d(b,{BaseLinkItem:()=>h});var d=c(5009),e=c(54309),f=c(59384),g=c(69212);function h({ref:a,item:b,...c}){let h=(0,e.a8)(),i=b.active??"url",j="none"!==i&&(0,f.$)(b.url,h,"nested-url"===i);return(0,d.jsx)(g.default,{ref:a,href:b.url,external:b.external,...c,"data-active":j,children:c.children})}},25475:(a,b,c)=>{"use strict";c.d(b,{QP:()=>ao});let d=(a=new Map,b=null,c)=>({nextPart:a,validators:b,classGroupId:c}),e=[],f=(a,b,c)=>{if(0==a.length-b)return c.classGroupId;let d=a[b],e=c.nextPart.get(d);if(e){let c=f(a,b+1,e);if(c)return c}let g=c.validators;if(null===g)return;let h=0===b?a.join("-"):a.slice(b).join("-"),i=g.length;for(let a=0;a<i;a++){let b=g[a];if(b.validator(h))return b.classGroupId}},g=(a,b)=>{let c=d();for(let d in a)h(a[d],c,d,b);return c},h=(a,b,c,d)=>{let e=a.length;for(let f=0;f<e;f++)i(a[f],b,c,d)},i=(a,b,c,d)=>"string"==typeof a?void j(a,b,c):"function"==typeof a?void k(a,b,c,d):void l(a,b,c,d),j=(a,b,c)=>{(""===a?b:m(b,a)).classGroupId=c},k=(a,b,c,d)=>{if(n(a))return void h(a(d),b,c,d);null===b.validators&&(b.validators=[]),b.validators.push({classGroupId:c,validator:a})},l=(a,b,c,d)=>{let e=Object.entries(a),f=e.length;for(let a=0;a<f;a++){let[f,g]=e[a];h(g,m(b,f),c,d)}},m=(a,b)=>{let c=a,e=b.split("-"),f=e.length;for(let a=0;a<f;a++){let b=e[a],f=c.nextPart.get(b);f||(f=d(),c.nextPart.set(b,f)),c=f}return c},n=a=>"isThemeGetter"in a&&!0===a.isThemeGetter,o=[],p=(a,b,c,d,e)=>({modifiers:a,hasImportantModifier:b,baseClassName:c,maybePostfixModifierPosition:d,isExternal:e}),q=/\s+/,r=a=>{let b;if("string"==typeof a)return a;let c="";for(let d=0;d<a.length;d++)a[d]&&(b=r(a[d]))&&(c&&(c+=" "),c+=b);return c},s=[],t=a=>{let b=b=>b[a]||s;return b.isThemeGetter=!0,b.themeKey=a,b},u=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,w=/^\((?:(\w[\w-]*):)?(.+)\)$/i,x=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,y=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,z=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,A=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,B=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,C=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,D=a=>x.test(a),E=a=>!!a&&!Number.isNaN(Number(a)),F=a=>!!a&&Number.isInteger(Number(a)),G=a=>a.endsWith("%")&&E(a.slice(0,-1)),H=a=>y.test(a),I=()=>!0,J=a=>z.test(a)&&!A.test(a),K=()=>!1,L=a=>B.test(a),M=a=>C.test(a),N=a=>!Q(a)&&!Y(a),O=a=>a.startsWith("@container")&&("/"===a[10]&&void 0!==a[11]||"s"===a[11]&&void 0!==a[16]&&a.startsWith("-size/",10)||"n"===a[11]&&void 0!==a[18]&&a.startsWith("-normal/",10)),P=a=>ae(a,ai,K),Q=a=>u.test(a),R=a=>ae(a,aj,J),S=a=>ae(a,ak,E),T=a=>ae(a,am,I),U=a=>ae(a,al,K),V=a=>ae(a,ag,K),W=a=>ae(a,ah,M),X=a=>ae(a,an,L),Y=a=>w.test(a),Z=a=>af(a,aj),$=a=>af(a,al),_=a=>af(a,ag),aa=a=>af(a,ai),ab=a=>af(a,ah),ac=a=>af(a,an,!0),ad=a=>af(a,am,!0),ae=(a,b,c)=>{let d=u.exec(a);return!!d&&(d[1]?b(d[1]):c(d[2]))},af=(a,b,c=!1)=>{let d=w.exec(a);return!!d&&(d[1]?b(d[1]):c)},ag=a=>"position"===a||"percentage"===a,ah=a=>"image"===a||"url"===a,ai=a=>"length"===a||"size"===a||"bg-size"===a,aj=a=>"length"===a,ak=a=>"number"===a,al=a=>"family-name"===a,am=a=>"number"===a||"weight"===a,an=a=>"shadow"===a;Symbol.toStringTag;let ao=((a,...b)=>{let c,d,h,i,j=a=>{let b=d(a);if(b)return b;let e=((a,b)=>{let{parseClassName:c,getClassGroupId:d,getConflictingClassGroupIds:e,sortModifiers:f,postfixLookupClassGroupIds:g}=b,h=[],i=a.trim().split(q),j="";for(let a=i.length-1;a>=0;a-=1){let b,k=i[a],{isExternal:l,modifiers:m,hasImportantModifier:n,baseClassName:o,maybePostfixModifierPosition:p}=c(k);if(l){j=k+(j.length>0?" "+j:j);continue}let q=!!p;if(q){let a=(b=d(o.substring(0,p)))&&g[b]?d(o):void 0;a&&a!==b&&(b=a,q=!1)}else b=d(o);if(!b){if(!q||!(b=d(o))){j=k+(j.length>0?" "+j:j);continue}q=!1}let r=0===m.length?"":1===m.length?m[0]:f(m).join(":"),s=n?r+"!":r,t=s+b;if(h.indexOf(t)>-1)continue;h.push(t);let u=e(b,q);for(let a=0;a<u.length;++a){let b=u[a];h.push(s+b)}j=k+(j.length>0?" "+j:j)}return j})(a,c);return h(a,e),e};return i=k=>(d=(c=(a=>({cache:(a=>{if(a<1)return{get:()=>void 0,set:()=>{}};let b=0,c=Object.create(null),d=Object.create(null),e=(e,f)=>{c[e]=f,++b>a&&(b=0,d=c,c=Object.create(null))};return{get(a){let b=c[a];return void 0!==b?b:void 0!==(b=d[a])?(e(a,b),b):void 0},set(a,b){a in c?c[a]=b:e(a,b)}}})(a.cacheSize),parseClassName:(a=>{let{prefix:b,experimentalParseClassName:c}=a,d=a=>{let b,c=[],d=0,e=0,f=0,g=a.length;for(let h=0;h<g;h++){let g=a[h];if(0===d&&0===e){if(":"===g){c.push(a.slice(f,h)),f=h+1;continue}if("/"===g){b=h;continue}}"["===g?d++:"]"===g?d--:"("===g?e++:")"===g&&e--}let h=0===c.length?a:a.slice(f),i=h,j=!1;return h.endsWith("!")?(i=h.slice(0,-1),j=!0):h.startsWith("!")&&(i=h.slice(1),j=!0),p(c,j,i,b&&b>f?b-f:void 0)};if(b){let a=b+":",c=d;d=b=>b.startsWith(a)?c(b.slice(a.length)):p(o,!1,b,void 0,!0)}if(c){let a=d;d=b=>c({className:b,parseClassName:a})}return d})(a),sortModifiers:(a=>{let b=new Map;return a.orderSensitiveModifiers.forEach((a,c)=>{b.set(a,1e6+c)}),a=>{let c=[],d=[];for(let e=0;e<a.length;e++){let f=a[e],g="["===f[0],h=b.has(f);g||h?(d.length>0&&(d.sort(),c.push(...d),d=[]),c.push(f)):d.push(f)}return d.length>0&&(d.sort(),c.push(...d)),c}})(a),postfixLookupClassGroupIds:(a=>{let b=Object.create(null),c=a.postfixLookupClassGroups;if(c)for(let a=0;a<c.length;a++)b[c[a]]=!0;return b})(a),...(a=>{let b=(a=>{let{theme:b,classGroups:c}=a;return g(c,b)})(a),{conflictingClassGroups:c,conflictingClassGroupModifiers:d}=a;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return(a=>-1===a.slice(1,-1).indexOf(":")?void 0:(()=>{let b=a.slice(1,-1),c=b.indexOf(":"),d=b.slice(0,c);return d?"arbitrary.."+d:void 0})())(a);let c=a.split("-"),d=+(""===c[0]&&c.length>1);return f(c,d,b)},getConflictingClassGroupIds:(a,b)=>{if(b){let b=d[a],f=c[a];return b?f?((a,b)=>{let c=Array(a.length+b.length);for(let b=0;b<a.length;b++)c[b]=a[b];for(let d=0;d<b.length;d++)c[a.length+d]=b[d];return c})(f,b):b:f||e}return c[a]||e}}})(a)}))(b.reduce((a,b)=>b(a),a()))).cache.get,h=c.cache.set,i=j,j(k)),(...a)=>i(((...a)=>{let b,c,d=0,e="";for(;d<a.length;)(b=a[d++])&&(c=r(b))&&(e&&(e+=" "),e+=c);return e})(...a))})(()=>{let a=t("color"),b=t("font"),c=t("text"),d=t("font-weight"),e=t("tracking"),f=t("leading"),g=t("breakpoint"),h=t("container"),i=t("spacing"),j=t("radius"),k=t("shadow"),l=t("inset-shadow"),m=t("text-shadow"),n=t("drop-shadow"),o=t("blur"),p=t("perspective"),q=t("aspect"),r=t("ease"),s=t("animate"),u=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],x=()=>[...w(),Y,Q],y=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],A=()=>[Y,Q,i],B=()=>[D,"full","auto",...A()],C=()=>[F,"none","subgrid",Y,Q],J=()=>["auto",{span:["full",F,Y,Q]},F,Y,Q],K=()=>[F,"auto",Y,Q],L=()=>["auto","min","max","fr",Y,Q],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ae=()=>["start","end","center","stretch","center-safe","end-safe"],af=()=>["auto",...A()],ag=()=>[D,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],ah=()=>[h,D,"screen","full","dvw","lvw","svw","min","max","fit",...A()],ai=()=>[D,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],aj=()=>[a,Y,Q],ak=()=>[...w(),_,V,{position:[Y,Q]}],al=()=>["no-repeat",{repeat:["","x","y","space","round"]}],am=()=>["auto","cover","contain",aa,P,{size:[Y,Q]}],an=()=>[G,Z,R],ao=()=>["","none","full",j,Y,Q],ap=()=>["",E,Z,R],aq=()=>["solid","dashed","dotted","double"],ar=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],as=()=>[E,G,_,V],at=()=>["","none",o,Y,Q],au=()=>["none",E,Y,Q],av=()=>["none",E,Y,Q],aw=()=>[E,Y,Q],ax=()=>[D,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[H],breakpoint:[H],color:[I],container:[H],"drop-shadow":[H],ease:["in","out","in-out"],font:[N],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[H],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[H],shadow:[H],spacing:["px",E],text:[H],"text-shadow":[H],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",D,Q,Y,q]}],container:["container"],"container-type":[{"@container":["","normal","size",Y,Q]}],"container-named":[O],columns:[{columns:[E,"auto",Q,Y,h]}],"break-after":[{"break-after":u()}],"break-before":[{"break-before":u()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:x()}],overflow:[{overflow:y()}],"overflow-x":[{"overflow-x":y()}],"overflow-y":[{"overflow-y":y()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{"inset-s":B(),start:B()}],end:[{"inset-e":B(),end:B()}],"inset-bs":[{"inset-bs":B()}],"inset-be":[{"inset-be":B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[F,"auto",Y,Q]}],basis:[{basis:[D,"full","auto",h,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[E,D,"auto","initial","none",Q]}],grow:[{grow:["",E,Y,Q]}],shrink:[{shrink:["",E,Y,Q]}],order:[{order:[F,"first","last","none",Y,Q]}],"grid-cols":[{"grid-cols":C()}],"col-start-end":[{col:J()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":C()}],"row-start-end":[{row:J()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...ae(),"normal"]}],"justify-self":[{"justify-self":["auto",...ae()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...ae(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ae(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...ae(),"baseline"]}],"place-self":[{"place-self":["auto",...ae()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:af()}],mx:[{mx:af()}],my:[{my:af()}],ms:[{ms:af()}],me:[{me:af()}],mbs:[{mbs:af()}],mbe:[{mbe:af()}],mt:[{mt:af()}],mr:[{mr:af()}],mb:[{mb:af()}],ml:[{ml:af()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:ag()}],"inline-size":[{inline:["auto",...ah()]}],"min-inline-size":[{"min-inline":["auto",...ah()]}],"max-inline-size":[{"max-inline":["none",...ah()]}],"block-size":[{block:["auto",...ai()]}],"min-block-size":[{"min-block":["auto",...ai()]}],"max-block-size":[{"max-block":["none",...ai()]}],w:[{w:[h,"screen",...ag()]}],"min-w":[{"min-w":[h,"screen","none",...ag()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[g]},...ag()]}],h:[{h:["screen","lh",...ag()]}],"min-h":[{"min-h":["screen","lh","none",...ag()]}],"max-h":[{"max-h":["screen","lh","none",...ag()]}],"font-size":[{text:["base",c,Z,R]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[d,ad,T]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",G,Q]}],"font-family":[{font:[$,U,b]}],"font-features":[{"font-features":[Q]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[e,Y,Q]}],"line-clamp":[{"line-clamp":[E,"none",Y,S]}],leading:[{leading:["none",f,...A()]}],"list-image":[{"list-image":["none",Y,Q]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Y,Q]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:aj()}],"text-color":[{text:aj()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...aq(),"wavy"]}],"text-decoration-thickness":[{decoration:[E,"from-font","auto",Y,R]}],"text-decoration-color":[{decoration:aj()}],"underline-offset":[{"underline-offset":[E,"auto",Y,Q]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"tab-size":[{tab:[F,Y,Q]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Y,Q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Y,Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ak()}],"bg-repeat":[{bg:al()}],"bg-size":[{bg:am()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},F,Y,Q],radial:["",Y,Q],conic:["",F,Y,Q]},ab,W]}],"bg-color":[{bg:aj()}],"gradient-from-pos":[{from:an()}],"gradient-via-pos":[{via:an()}],"gradient-to-pos":[{to:an()}],"gradient-from":[{from:aj()}],"gradient-via":[{via:aj()}],"gradient-to":[{to:aj()}],rounded:[{rounded:ao()}],"rounded-s":[{"rounded-s":ao()}],"rounded-e":[{"rounded-e":ao()}],"rounded-t":[{"rounded-t":ao()}],"rounded-r":[{"rounded-r":ao()}],"rounded-b":[{"rounded-b":ao()}],"rounded-l":[{"rounded-l":ao()}],"rounded-ss":[{"rounded-ss":ao()}],"rounded-se":[{"rounded-se":ao()}],"rounded-ee":[{"rounded-ee":ao()}],"rounded-es":[{"rounded-es":ao()}],"rounded-tl":[{"rounded-tl":ao()}],"rounded-tr":[{"rounded-tr":ao()}],"rounded-br":[{"rounded-br":ao()}],"rounded-bl":[{"rounded-bl":ao()}],"border-w":[{border:ap()}],"border-w-x":[{"border-x":ap()}],"border-w-y":[{"border-y":ap()}],"border-w-s":[{"border-s":ap()}],"border-w-e":[{"border-e":ap()}],"border-w-bs":[{"border-bs":ap()}],"border-w-be":[{"border-be":ap()}],"border-w-t":[{"border-t":ap()}],"border-w-r":[{"border-r":ap()}],"border-w-b":[{"border-b":ap()}],"border-w-l":[{"border-l":ap()}],"divide-x":[{"divide-x":ap()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ap()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...aq(),"hidden","none"]}],"divide-style":[{divide:[...aq(),"hidden","none"]}],"border-color":[{border:aj()}],"border-color-x":[{"border-x":aj()}],"border-color-y":[{"border-y":aj()}],"border-color-s":[{"border-s":aj()}],"border-color-e":[{"border-e":aj()}],"border-color-bs":[{"border-bs":aj()}],"border-color-be":[{"border-be":aj()}],"border-color-t":[{"border-t":aj()}],"border-color-r":[{"border-r":aj()}],"border-color-b":[{"border-b":aj()}],"border-color-l":[{"border-l":aj()}],"divide-color":[{divide:aj()}],"outline-style":[{outline:[...aq(),"none","hidden"]}],"outline-offset":[{"outline-offset":[E,Y,Q]}],"outline-w":[{outline:["",E,Z,R]}],"outline-color":[{outline:aj()}],shadow:[{shadow:["","inner","none",k,ac,X]}],"shadow-color":[{shadow:aj()}],"inset-shadow":[{"inset-shadow":["none",l,ac,X]}],"inset-shadow-color":[{"inset-shadow":aj()}],"ring-w":[{ring:ap()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:aj()}],"ring-offset-w":[{"ring-offset":[E,R]}],"ring-offset-color":[{"ring-offset":aj()}],"inset-ring-w":[{"inset-ring":ap()}],"inset-ring-color":[{"inset-ring":aj()}],"text-shadow":[{"text-shadow":["none",m,ac,X]}],"text-shadow-color":[{"text-shadow":aj()}],opacity:[{opacity:[E,Y,Q]}],"mix-blend":[{"mix-blend":[...ar(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ar()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[E]}],"mask-image-linear-from-pos":[{"mask-linear-from":as()}],"mask-image-linear-to-pos":[{"mask-linear-to":as()}],"mask-image-linear-from-color":[{"mask-linear-from":aj()}],"mask-image-linear-to-color":[{"mask-linear-to":aj()}],"mask-image-t-from-pos":[{"mask-t-from":as()}],"mask-image-t-to-pos":[{"mask-t-to":as()}],"mask-image-t-from-color":[{"mask-t-from":aj()}],"mask-image-t-to-color":[{"mask-t-to":aj()}],"mask-image-r-from-pos":[{"mask-r-from":as()}],"mask-image-r-to-pos":[{"mask-r-to":as()}],"mask-image-r-from-color":[{"mask-r-from":aj()}],"mask-image-r-to-color":[{"mask-r-to":aj()}],"mask-image-b-from-pos":[{"mask-b-from":as()}],"mask-image-b-to-pos":[{"mask-b-to":as()}],"mask-image-b-from-color":[{"mask-b-from":aj()}],"mask-image-b-to-color":[{"mask-b-to":aj()}],"mask-image-l-from-pos":[{"mask-l-from":as()}],"mask-image-l-to-pos":[{"mask-l-to":as()}],"mask-image-l-from-color":[{"mask-l-from":aj()}],"mask-image-l-to-color":[{"mask-l-to":aj()}],"mask-image-x-from-pos":[{"mask-x-from":as()}],"mask-image-x-to-pos":[{"mask-x-to":as()}],"mask-image-x-from-color":[{"mask-x-from":aj()}],"mask-image-x-to-color":[{"mask-x-to":aj()}],"mask-image-y-from-pos":[{"mask-y-from":as()}],"mask-image-y-to-pos":[{"mask-y-to":as()}],"mask-image-y-from-color":[{"mask-y-from":aj()}],"mask-image-y-to-color":[{"mask-y-to":aj()}],"mask-image-radial":[{"mask-radial":[Y,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":as()}],"mask-image-radial-to-pos":[{"mask-radial-to":as()}],"mask-image-radial-from-color":[{"mask-radial-from":aj()}],"mask-image-radial-to-color":[{"mask-radial-to":aj()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[E]}],"mask-image-conic-from-pos":[{"mask-conic-from":as()}],"mask-image-conic-to-pos":[{"mask-conic-to":as()}],"mask-image-conic-from-color":[{"mask-conic-from":aj()}],"mask-image-conic-to-color":[{"mask-conic-to":aj()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ak()}],"mask-repeat":[{mask:al()}],"mask-size":[{mask:am()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Y,Q]}],filter:[{filter:["","none",Y,Q]}],blur:[{blur:at()}],brightness:[{brightness:[E,Y,Q]}],contrast:[{contrast:[E,Y,Q]}],"drop-shadow":[{"drop-shadow":["","none",n,ac,X]}],"drop-shadow-color":[{"drop-shadow":aj()}],grayscale:[{grayscale:["",E,Y,Q]}],"hue-rotate":[{"hue-rotate":[E,Y,Q]}],invert:[{invert:["",E,Y,Q]}],saturate:[{saturate:[E,Y,Q]}],sepia:[{sepia:["",E,Y,Q]}],"backdrop-filter":[{"backdrop-filter":["","none",Y,Q]}],"backdrop-blur":[{"backdrop-blur":at()}],"backdrop-brightness":[{"backdrop-brightness":[E,Y,Q]}],"backdrop-contrast":[{"backdrop-contrast":[E,Y,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",E,Y,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[E,Y,Q]}],"backdrop-invert":[{"backdrop-invert":["",E,Y,Q]}],"backdrop-opacity":[{"backdrop-opacity":[E,Y,Q]}],"backdrop-saturate":[{"backdrop-saturate":[E,Y,Q]}],"backdrop-sepia":[{"backdrop-sepia":["",E,Y,Q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Y,Q]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[E,"initial",Y,Q]}],ease:[{ease:["linear","initial",r,Y,Q]}],delay:[{delay:[E,Y,Q]}],animate:[{animate:["none",s,Y,Q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,Y,Q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:au()}],"rotate-x":[{"rotate-x":au()}],"rotate-y":[{"rotate-y":au()}],"rotate-z":[{"rotate-z":au()}],scale:[{scale:av()}],"scale-x":[{"scale-x":av()}],"scale-y":[{"scale-y":av()}],"scale-z":[{"scale-z":av()}],"scale-3d":["scale-3d"],skew:[{skew:aw()}],"skew-x":[{"skew-x":aw()}],"skew-y":[{"skew-y":aw()}],transform:[{transform:[Y,Q,"","none","gpu","cpu"]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ax()}],"translate-x":[{"translate-x":ax()}],"translate-y":[{"translate-y":ax()}],"translate-z":[{"translate-z":ax()}],"translate-none":["translate-none"],zoom:[{zoom:[F,Y,Q]}],accent:[{accent:aj()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:aj()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Y,Q]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":aj()}],"scrollbar-track-color":[{"scrollbar-track":aj()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Y,Q]}],fill:[{fill:["none",...aj()]}],"stroke-w":[{stroke:[E,Z,R,S]}],stroke:[{stroke:["none",...aj()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}})},26706:(a,b,c)=>{"use strict";c.d(b,{NavProvider:()=>e});var d=c(71935);(0,d.registerClientReference)(function(){throw Error("Attempted to call usePageStyles() from the server but usePageStyles is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/contexts/layout.js","usePageStyles"),(0,d.registerClientReference)(function(){throw Error("Attempted to call StylesProvider() from the server but StylesProvider is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/contexts/layout.js","StylesProvider");let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call NavProvider() from the server but NavProvider is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/contexts/layout.js","NavProvider");(0,d.registerClientReference)(function(){throw Error("Attempted to call useNav() from the server but useNav is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/contexts/layout.js","useNav")},26713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},28354:a=>{"use strict";a.exports=require("util")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29440:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>y});var d=c(40239),e=c(70986),f=c(47031),g=c(25475),h=c(10723),i=c(22353),j=c(83854),k=c(84368),l=c(7288),m=c(44518),n=c(14992),o=c(38629),p=c(26706),q=c(2098),r=c(18);let s=(a,b)=>b.icon?{...a,icon:(0,d.jsx)("div",{className:"size-full [&_svg]:size-full max-md:p-1.5 max-md:rounded-md max-md:border max-md:bg-fd-secondary",children:b.icon})}:a;function t(a,{transform:b=s}={}){let c=[];function d(a,e){if("root"in a&&a.root){let d=function a(b,c=new Set){for(let d of(b.index&&c.add(b.index.url),b.children))"page"!==d.type||d.external||c.add(d.url),"folder"===d.type&&a(d,c);return c}(a);if(d.size>0){let f={url:d.values().next().value??"",title:a.name,icon:a.icon,unlisted:e,description:a.description,urls:d},g=b?b(f,a):f;g&&c.push(g)}}for(let b of a.children)"folder"===b.type&&d(b,e)}return d(a),a.fallback&&d(a.fallback,!0),c}function u({nav:{transparentMode:a,...b}={},sidebar:{tabs:c,enabled:s=!0,...u}={},searchToggle:x={},themeSwitch:y={},tabMode:z="auto",i18n:A=!1,children:B,...C}){let D=(0,e.useMemo)(()=>Array.isArray(c)?c:"object"==typeof c?t(C.tree,c):!1!==c?t(C.tree):[],[c,C.tree]),E=function(a=[],b){let c=a??[];return b&&(c=[...c,{type:"icon",url:b,text:"Github",label:"GitHub",icon:(0,d.jsx)("svg",{role:"img",viewBox:"0 0 24 24",fill:"currentColor",children:(0,d.jsx)("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})}),external:!0}]),c}(C.links??[],C.githubUrl),F=(0,g.QP)("md:[--fd-sidebar-width:268px] lg:[--fd-sidebar-width:286px]");return(0,d.jsx)(n.TreeContextProvider,{tree:C.tree,children:(0,d.jsxs)(p.NavProvider,{transparentMode:a,children:[!1!==b.enabled&&(b.component??(0,d.jsxs)(m.Navbar,{className:"h-(--fd-nav-height) on-root:[--fd-nav-height:56px] md:on-root:[--fd-nav-height:0px] md:hidden",children:[(0,d.jsx)(q.default,{href:b.url??"/",className:"inline-flex items-center gap-2.5 font-semibold",children:b.title}),(0,d.jsx)("div",{className:"flex-1",children:b.children}),!1!==x.enabled&&(x.components?.sm??(0,d.jsx)(r.SearchToggle,{className:"p-2",hideIfDisabled:!0})),s&&(0,d.jsx)(i.SidebarTrigger,{className:(0,g.QP)((0,h.r)({color:"ghost",size:"icon-sm",className:"p-2"})),children:(0,d.jsx)(f.Bx,{})})]})),(0,d.jsxs)(m.LayoutBody,{...C.containerProps,className:(0,g.QP)("md:[&_#nd-page_article]:pt-12 xl:[--fd-toc-width:286px] xl:[&_#nd-page_article]:px-8",s&&F,C.containerProps?.className),children:[s&&function(){let{footer:a,banner:c,collapsible:e=!0,component:n,components:p,defaultOpenLevel:s,prefetch:t,...B}=u;if(n)return n;let C=E.filter(a=>"icon"===a.type),F=(0,d.jsxs)(i.SidebarViewport,{children:[E.filter(a=>"icon"!==a.type).map((a,b,c)=>(0,d.jsx)(w,{item:a,className:(0,g.QP)(b===c.length-1&&"mb-4")},b)),(0,d.jsx)(i.SidebarPageTree,{components:p})]}),G=(0,d.jsxs)(i.SidebarContentMobile,{...B,children:[(0,d.jsxs)(i.SidebarHeader,{children:[(0,d.jsxs)("div",{className:"flex text-fd-muted-foreground items-center gap-1.5",children:[(0,d.jsx)("div",{className:"flex flex-1",children:C.map((a,b)=>(0,d.jsx)(k.BaseLinkItem,{item:a,className:(0,g.QP)((0,h.r)({size:"icon-sm",color:"ghost",className:"p-2"})),"aria-label":a.label,children:a.icon},b))}),A?(0,d.jsxs)(l.LanguageToggle,{children:[(0,d.jsx)(f.AT,{className:"size-4.5"}),(0,d.jsx)(l.LanguageToggleText,{})]}):null,!1!==y.enabled&&(y.component??(0,d.jsx)(o.ThemeToggle,{className:"p-0",mode:y.mode})),(0,d.jsx)(i.SidebarTrigger,{className:(0,g.QP)((0,h.r)({color:"ghost",size:"icon-sm",className:"p-2"})),children:(0,d.jsx)(f.Bx,{})})]}),D.length>0&&(0,d.jsx)(j.RootToggle,{options:D}),c]}),F,(0,d.jsx)(i.SidebarFooter,{className:"empty:hidden",children:a})]}),H=(0,d.jsxs)(i.SidebarContent,{...B,children:[(0,d.jsxs)(i.SidebarHeader,{children:[(0,d.jsxs)("div",{className:"flex",children:[(0,d.jsx)(q.default,{href:b.url??"/",className:"inline-flex text-[15px] items-center gap-2.5 font-medium me-auto",children:b.title}),b.children,e&&(0,d.jsx)(i.SidebarCollapseTrigger,{className:(0,g.QP)((0,h.r)({color:"ghost",size:"icon-sm",className:"mb-auto text-fd-muted-foreground"})),children:(0,d.jsx)(f.Bx,{})})]}),!1!==x.enabled&&(x.components?.lg??(0,d.jsx)(r.LargeSearchToggle,{hideIfDisabled:!0})),D.length>0&&"auto"===z&&(0,d.jsx)(j.RootToggle,{options:D}),c]}),F,(A||C.length>0||y?.enabled!==!1||a)&&(0,d.jsxs)(i.SidebarFooter,{children:[(0,d.jsxs)("div",{className:"flex text-fd-muted-foreground items-center empty:hidden",children:[A&&(0,d.jsx)(l.LanguageToggle,{children:(0,d.jsx)(f.AT,{className:"size-4.5"})}),C.map((a,b)=>(0,d.jsx)(k.BaseLinkItem,{item:a,className:(0,g.QP)((0,h.r)({size:"icon-sm",color:"ghost"})),"aria-label":a.label,children:a.icon},b)),!1!==y.enabled&&(y.component??(0,d.jsx)(o.ThemeToggle,{className:"ms-auto p-0",mode:y.mode}))]}),a]})]});return(0,d.jsx)(i.Sidebar,{defaultOpenLevel:s,prefetch:t,Mobile:G,Content:(0,d.jsxs)(d.Fragment,{children:[e&&(0,d.jsx)(m.CollapsibleControl,{}),H]})})}(),"top"===z&&D.length>0&&(0,d.jsx)(m.LayoutTabs,{options:D,className:"sticky top-[calc(var(--fd-nav-height)+var(--fd-tocnav-height))] z-10 bg-fd-background border-b px-6 pt-3 xl:px-8 max-md:hidden"}),B]})]})})}function w({item:a,...b}){return"menu"===a.type?(0,d.jsxs)(i.SidebarFolder,{...b,children:[a.url?(0,d.jsxs)(i.SidebarFolderLink,{href:a.url,external:a.external,children:[a.icon,a.text]}):(0,d.jsxs)(i.SidebarFolderTrigger,{children:[a.icon,a.text]}),(0,d.jsx)(i.SidebarFolderContent,{children:a.items.map((a,b)=>(0,d.jsx)(w,{item:a},b))})]}):"custom"===a.type?(0,d.jsx)("div",{...b,children:a.children}):(0,d.jsx)(i.SidebarItem,{href:a.url,icon:a.icon,external:a.external,...b,children:a.text})}var x=c(35241);function y({children:a}){return(0,d.jsx)(u,{tree:x.s.pageTree,nav:{title:"Cue"},children:a})}},33670:(a,b,c)=>{Promise.resolve().then(c.bind(c,19671)),Promise.resolve().then(c.bind(c,2098)),Promise.resolve().then(c.bind(c,62684)),Promise.resolve().then(c.bind(c,10035)),Promise.resolve().then(c.bind(c,77183)),Promise.resolve().then(c.bind(c,35396)),Promise.resolve().then(c.bind(c,45400))},33873:a=>{"use strict";a.exports=require("path")},35241:(a,b,c)=>{"use strict";c.d(b,{s:()=>ex});var d={};c.r(d),c.d(d,{default:()=>_,extractedReferences:()=>X,frontmatter:()=>W,structuredData:()=>Y,toc:()=>Z});var e={};c.r(e),c.d(e,{default:()=>af,extractedReferences:()=>ab,frontmatter:()=>aa,structuredData:()=>ac,toc:()=>ad});var f={};c.r(f),c.d(f,{default:()=>al,extractedReferences:()=>ah,frontmatter:()=>ag,structuredData:()=>ai,toc:()=>aj});var g={};c.r(g),c.d(g,{default:()=>ar,extractedReferences:()=>an,frontmatter:()=>am,structuredData:()=>ao,toc:()=>ap});var h={};c.r(h),c.d(h,{default:()=>ax,extractedReferences:()=>at,frontmatter:()=>as,structuredData:()=>au,toc:()=>av});var i={};c.r(i),c.d(i,{default:()=>aD,extractedReferences:()=>az,frontmatter:()=>ay,structuredData:()=>aA,toc:()=>aB});var j={};c.r(j),c.d(j,{default:()=>aJ,extractedReferences:()=>aF,frontmatter:()=>aE,structuredData:()=>aG,toc:()=>aH});var k={};c.r(k),c.d(k,{default:()=>aP,extractedReferences:()=>aL,frontmatter:()=>aK,structuredData:()=>aM,toc:()=>aN});var l={};c.r(l),c.d(l,{default:()=>aV,extractedReferences:()=>aR,frontmatter:()=>aQ,structuredData:()=>aS,toc:()=>aT});var m={};c.r(m),c.d(m,{default:()=>a_,extractedReferences:()=>aX,frontmatter:()=>aW,structuredData:()=>aY,toc:()=>aZ});var n={};c.r(n),c.d(n,{default:()=>a5,extractedReferences:()=>a1,frontmatter:()=>a0,structuredData:()=>a2,toc:()=>a3});var o={};c.r(o),c.d(o,{default:()=>bb,extractedReferences:()=>a7,frontmatter:()=>a6,structuredData:()=>a8,toc:()=>a9});var p={};c.r(p),c.d(p,{default:()=>bh,extractedReferences:()=>bd,frontmatter:()=>bc,structuredData:()=>be,toc:()=>bf});var q={};c.r(q),c.d(q,{default:()=>bn,extractedReferences:()=>bj,frontmatter:()=>bi,structuredData:()=>bk,toc:()=>bl});var r={};c.r(r),c.d(r,{default:()=>bt,extractedReferences:()=>bp,frontmatter:()=>bo,structuredData:()=>bq,toc:()=>br});var s={};c.r(s),c.d(s,{default:()=>bz,extractedReferences:()=>bv,frontmatter:()=>bu,structuredData:()=>bw,toc:()=>bx});var t={};c.r(t),c.d(t,{default:()=>bF,extractedReferences:()=>bB,frontmatter:()=>bA,structuredData:()=>bC,toc:()=>bD});var u={};c.r(u),c.d(u,{default:()=>bL,extractedReferences:()=>bH,frontmatter:()=>bG,structuredData:()=>bI,toc:()=>bJ});var w={};c.r(w),c.d(w,{default:()=>bR,extractedReferences:()=>bN,frontmatter:()=>bM,structuredData:()=>bO,toc:()=>bP});var x={};c.r(x),c.d(x,{default:()=>bX,extractedReferences:()=>bT,frontmatter:()=>bS,structuredData:()=>bU,toc:()=>bV});var y={};c.r(y),c.d(y,{default:()=>b1,extractedReferences:()=>bZ,frontmatter:()=>bY,structuredData:()=>b$,toc:()=>b_});var z={};c.r(z),c.d(z,{default:()=>b7,extractedReferences:()=>b3,frontmatter:()=>b2,structuredData:()=>b4,toc:()=>b5});var A={};c.r(A),c.d(A,{default:()=>cd,extractedReferences:()=>b9,frontmatter:()=>b8,structuredData:()=>ca,toc:()=>cb});var B={};c.r(B),c.d(B,{default:()=>cj,extractedReferences:()=>cf,frontmatter:()=>ce,structuredData:()=>cg,toc:()=>ch});var C={};c.r(C),c.d(C,{default:()=>cp,extractedReferences:()=>cl,frontmatter:()=>ck,structuredData:()=>cm,toc:()=>cn});var D={};c.r(D),c.d(D,{default:()=>cv,extractedReferences:()=>cr,frontmatter:()=>cq,structuredData:()=>cs,toc:()=>ct});var E={};c.r(E),c.d(E,{default:()=>cB,extractedReferences:()=>cx,frontmatter:()=>cw,structuredData:()=>cy,toc:()=>cz});var F={};c.r(F),c.d(F,{default:()=>cH,extractedReferences:()=>cD,frontmatter:()=>cC,structuredData:()=>cE,toc:()=>cF});var G={};c.r(G),c.d(G,{default:()=>cN,extractedReferences:()=>cJ,frontmatter:()=>cI,structuredData:()=>cK,toc:()=>cL});var H={};c.r(H),c.d(H,{default:()=>cT,extractedReferences:()=>cP,frontmatter:()=>cO,structuredData:()=>cQ,toc:()=>cR});var I={};c.r(I),c.d(I,{default:()=>cZ,extractedReferences:()=>cV,frontmatter:()=>cU,structuredData:()=>cW,toc:()=>cX});var J={};c.r(J),c.d(J,{default:()=>c3,extractedReferences:()=>c_,frontmatter:()=>c$,structuredData:()=>c0,toc:()=>c1});var K={};c.r(K),c.d(K,{default:()=>c9,extractedReferences:()=>c5,frontmatter:()=>c4,structuredData:()=>c6,toc:()=>c7});var L={};c.r(L),c.d(L,{default:()=>df,extractedReferences:()=>db,frontmatter:()=>da,structuredData:()=>dc,toc:()=>dd});var M={};c.r(M),c.d(M,{default:()=>dl,extractedReferences:()=>dh,frontmatter:()=>dg,structuredData:()=>di,toc:()=>dj});var N={};c.r(N),c.d(N,{default:()=>ds,extractedReferences:()=>dn,frontmatter:()=>dm,structuredData:()=>dp,toc:()=>dq});var O={};c.r(O),c.d(O,{default:()=>dy,extractedReferences:()=>du,frontmatter:()=>dt,structuredData:()=>dv,toc:()=>dw});var P={};c.r(P),c.d(P,{default:()=>dE,extractedReferences:()=>dA,frontmatter:()=>dz,structuredData:()=>dB,toc:()=>dC});var Q={};c.r(Q),c.d(Q,{default:()=>dK,extractedReferences:()=>dG,frontmatter:()=>dF,structuredData:()=>dH,toc:()=>dI});var R={};c.r(R),c.d(R,{default:()=>dQ,extractedReferences:()=>dM,frontmatter:()=>dL,structuredData:()=>dN,toc:()=>dO});var S={};c.r(S),c.d(S,{default:()=>dW,extractedReferences:()=>dS,frontmatter:()=>dR,structuredData:()=>dT,toc:()=>dU});var T={};c.r(T),c.d(T,{default:()=>d0,extractedReferences:()=>dY,frontmatter:()=>dX,structuredData:()=>dZ,toc:()=>d$});var U={};c.r(U),c.d(U,{default:()=>d6,extractedReferences:()=>d2,frontmatter:()=>d1,structuredData:()=>d3,toc:()=>d4});var V=c(40239);let W={title:"Kind"},X=[],Y={contents:[{heading:"why",content:"A kind is the queue a step's job is sent to. A worker pulls one or more kinds. A kind is not a step implementation."},{heading:"why",content:"The step implementation is the run on the bound step. The kind names where the orchestrator sends that step's job. The orchestrator and the worker are separate processes: the orchestrator sends the job, and the worker pulls it and runs the step implementation."},{heading:"who",content:"You name the kind when you register a bound step for an organization."},{heading:"who",content:"You start a worker when you want that kind pulled."},{heading:"who",content:"A person can read which workers are connected. A person can open the first entity of a flow, replay a flow, replay from a step, resend a job, run a step without applying its result, cancel a run or an open step, and end a validity. The first opening is that request: an open run waits, and inside the validity duration the recorded result is returned."},{heading:"how",content:"bindOrganization in organizations/fixture/src/steps.ts binds each step onto every flow. The kind is fixture- plus the step name: fixture-dwell, fixture-stall, fixture-miss, fixture-sprout, and fixture-brood. fixtureSteps stores each bound step under flow/step. seedOrganization calls service.startRun with the organization that exported catalogSeed. Job.organization and BoundStep.kind stay different fields: enqueueStep copies the organization onto the job and reads the kind from the bound step."},{heading:"how",content:"pnpm --filter cue-orchestrator serve runs apps/orchestrator/src/server.ts. That file calls createBullQueue and createReadServer, then server.listen on port 3001. The HTTP server does not start a worker: createStepWorker is called from organizations/fixture/src/work.ts."},{heading:"how",content:"apps/orchestrator/src/preview.ts calls createReadServer with createMemoryWorkerRegistry and a JobQueue whose add returns undefined. preview.ts calls server.listen(3001)."},{heading:"how",content:"enqueueStep in apps/orchestrator/src/jobs.ts copies organization, entity, and step into data before queue.add, so a job is organization, entity, and step with no secret. stepBinding loads the bound step at `${flow}/${step}` and queue.add receives bound.kind, so the kind comes from the bound step. publish in apps/orchestrator/src/service.ts calls enqueueStep for every job returned by startRun, runJob, and advance."},{heading:"how",content:'queueName in apps/orchestrator/src/bull.ts returns `steps-${kind}`, so the Redis queue name is steps plus the kind. createBullQueue opens that Redis queue and calls queue.add("step", data, options). stepJobOptions in apps/orchestrator/src/jobs.ts is { attempts: 1 }. createBullQueue sets it as defaultJobOptions, and enqueueStep passes it on each queue.add, so attempts is 1.'},{heading:"how",content:"seedOrganization calls startRun for each run from an exported catalogSeed. The fixture does not export one, so pnpm --dir organizations/fixture seed starts no run. The log line is seeded fixture 0 runs. startRun calls publish, so a started run's jobs sit on the Redis queue until a worker pulls them. server.ts does not call startRun."},{heading:"how",content:"applySilence in packages/engine/src/engine.ts pushes a new job with jobFor while the opened step has no result, now is at or after silenceDueAt, and resendCount is still under maxResends. At maxResends, applySilence sets that step's result to not_finished and breaks without jobs.push. Service.advance publishes each pushed job through enqueueStep and queue.add: silence stays in the engine, and a resend is a new job. apps/orchestrator/src/server.ts calls openFixtureService, createReadServer, and server.listen."},{heading:"how",content:"organizations/fixture/src/work.ts calls kindsToStart(declaredKinds(fixtureSteps), requestedKinds(process.argv.slice(2))). declaredKinds in apps/orchestrator/src/kinds.ts lists each kind on the bound steps once. kindsToStart returns that full list when requested.length is 0, and requestedKinds returns [] when the arguments contain no --kinds and when the value splits and trims to no names, so an empty --kinds starts every declared kind. pnpm --filter @ascentstudio/cue-org-fixture work takes that path. requestedKinds throws --kinds needs a comma-separated list when --kinds is present and the next argument is missing, and that throw is raised while work.ts is still computing kinds."},{heading:"how",content:"kindsToStart throws `Unknown kind ${kind}` when a requested name is absent from declaredKinds, and work.ts calls kindsToStart before the loop that calls createStepWorker, so an unknown kind throws and starts nothing."},{heading:"how",content:"requestedKinds splits the --kinds value on commas. The loop for (const kind of kinds) in work.ts calls createStepWorker once per kind in that same process, so several kinds can run in one process. bindOrganization sets the kind to fixture- plus the step name, so declaredKinds(fixtureSteps) returns fixture-dwell, fixture-stall, fixture-miss, fixture-sprout, and fixture-brood."},{heading:"how",content:"createStepWorker in apps/orchestrator/src/bull.ts starts a BullMQ Worker on queueName(kind) and calls run with organization, entity, and step taken from the job data, so workers pull. work.ts calls readOrganizationSecrets once, then installEnvironment, before createStepWorker. installEnvironment writes each secret into the environment. work.ts passes consumeAssignment as that run. consumeAssignment reads the dispatch packet and calls implementation.run. The packet has the starting data and the time, and it has no secret. A step implementation reads a name with environment. The failed handler in work.ts logs step failed with the kind, the BullMQ job id, and the error. A value loaded by installEnvironment is replaced with •••• in that log."},{heading:"how",content:"packages/supervisor/src/worker/supervise.ts starts packages/supervisor/src/worker/main.ts and keeps the environment from before loadRootEnv and installEnvironment. createSupervisor writes supervisor watching pid and the child pid. A child that exits 75 is a requested restart: the supervisor writes worker restart requested and starts the child again, so it calls readOrganizationSecrets and installEnvironment once more. A child that exits 0 is a requested stop: the supervisor writes worker stopped and supervisor exiting, then calls process.exit(0). A child that exits with another code, or with a signal, is unexpected: the supervisor writes worker exited plus that code or signal and restarting, waits one second, and starts the child again. SIGINT, SIGTERM, and SIGQUIT are stop signals. The supervisor writes supervisor forwarding plus the signal name, forwards that signal, and does not start another child when that child exits. SIGHUP is forwarded the same way and is a restart: the child exits 75. SIGTERM and SIGINT ask that child to stop accepting jobs and exit 0 after the current job. SIGQUIT closes the BullMQ workers without waiting and exits 0. createShutdown in apps/orchestrator/src/worker-control.ts is that sequence. The worker writes worker command plus drain-stop, drain-restart, or force-stop when it takes the command, and worker exit plus 0 or 75 before process.exit. Each BullMQ worker is closed with close(true). A command stored for the worker runs the same sequence. publish calls enqueueStep with the jobs from the engine, so a worker session is not a condition for opening a step. WorkerService in packages/supervisor/src/worker/worker.service.ts starts each kind with createStepWorker."},{heading:"getting-started",content:'Copy .env.example to .env in the repository root, and start Redis and Supabase with docker compose up -d redis and npx supabase start. loadRootEnv in apps/orchestrator/src/env.ts reads that .env. requiredEnv in the same file reads REDIS_URL, DATABASE_URL, and WORKER_TOKEN, and throws ${name} is required when a name is missing. apps/orchestrator/src/server.ts calls loadRootEnv inside openFixtureService, then requiredEnv("WORKER_TOKEN"). organizations/fixture/src/work.ts calls loadRootEnv, reads WORKER_TOKEN, then readOrganizationSecrets with DATABASE_URL and organization fixture. That reads the secrets table once. installEnvironment writes those names into the environment.'},{heading:"getting-started",content:'Run pnpm --filter cue-orchestrator serve. The serve script in apps/orchestrator/package.json runs tsx src/server.ts. server.ts calls openFixtureService, which calls createBullQueue with REDIS_URL. server.ts then calls createReadServer and server.listen(3001, "0.0.0.0"), and console.log prints orchestrator http://127.0.0.1:3001. The HTTP server does not start a worker and does not call startRun. createStepWorker runs from organizations/fixture/src/work.ts. Stop the preview process first when it is already on port 3001, because apps/orchestrator/src/preview.ts calls server.listen(3001).'},{heading:"getting-started",content:"In a second terminal, run pnpm --filter cue-supervisor work. The work script in packages/supervisor/package.json runs tsx src/main.ts. packages/supervisor/src/worker/supervise.ts starts main.ts with the environment it had at launch. work.ts calls kindsToStart with declaredKinds(fixtureSteps) and the list from requestedKinds. With no --kinds, requestedKinds returns [] and kindsToStart returns every declared kind. readOrganizationSecrets and installEnvironment then load the organization's secrets into the environment. work.ts reads WORKER_TOKEN before installEnvironment and posts /worker-sessions with that bearer, the host, and each started flow/step. The loop calls createStepWorker for each kind. A secret added or deleted after this start stays out of the environment until the worker starts again. SIGHUP is that start: the child exits 75, the supervisor writes worker restart requested, and starts it again. A child that exits 0 makes the supervisor write worker stopped and supervisor exiting, then exit. A child that exits with another code or a signal is started again after one second. console.log in work.ts prints fixture workers plus those kind names joined by commas. Those kinds are fixture-dwell, fixture-stall, fixture-miss, fixture-sprout, and fixture-brood. work.ts does not call catalogSeed."},{heading:"getting-started",content:"Run pnpm --dir organizations/fixture seed. The seed script in organizations/fixture/package.json runs cue seed. The fixture does not export catalogSeed, so the command opens nothing and the log line is seeded fixture 0 runs. Load runs start with pnpm --dir organizations/fixture perf, pnpm --dir organizations/fixture perf:load, pnpm --dir organizations/fixture perf:brood, or pnpm --dir organizations/fixture perf:brood:producer. pnpm --dir organizations/fixture reset deletes the fixture rows in the orchestrator database, drains the jobs for those runs, and deletes that organization's metrics. The log line is reset fixture."},{heading:"getting-started",content:"To pull one kind, run pnpm --filter @ascentstudio/cue-org-fixture work -- --kinds fixture-dwell. requestedKinds reads fixture-dwell and splits on commas. kindsToStart keeps fixture-dwell because declaredKinds lists that kind from bindOrganization, and createStepWorker starts it. When declaredKinds lists more than one kind, put those names in the same comma-separated value: requestedKinds splits on commas, and the loop calls createStepWorker for each of them in this process. A name missing from declaredKinds makes kindsToStart throw Unknown kind plus that name before createStepWorker. A --kinds flag with no value makes requestedKinds throw --kinds needs a comma-separated list before kindsToStart."},{heading:"getting-started",content:'Open Workers in the console for the fixture organization, or call GET /organizations/fixture/workers at http://127.0.0.1:3001/organizations/fixture/workers with Authorization: Bearer and a person id. The resolver in apps/orchestrator/src/server.ts returns the text after Bearer , and createReadServer then returns service.workersFor. One working call is curl -H "Authorization: Bearer person-1" http://127.0.0.1:3001/organizations/fixture/workers. The body is the workers whose coverage names a flow of that organization. The rows are in the workers table. work.ts calls openWorkerPresence with DATABASE_URL and presence.pulse updates last_pulse_at. first_pulse_at stays at the time the row was created. workerPresenceTtlSeconds in apps/orchestrator/src/workers.ts is 30, so a process that stops reporting is marked stopped after that many seconds. A planned stop calls presence.stop, which sets the phase to stopped and keeps the row. workerRetentionSeconds is 30 days, and a stopped row is deleted after that long. A stopped worker stays openable so its configuration can be read. Each row has firstPulseAt and lastPulseAt. A last pulse older than 5 minutes is stale in the console while the worker is not stopped. The step metric written when this worker finishes a step includes its id. enqueueStep in apps/orchestrator/src/jobs.ts sends the job from publish and does not take that list as an argument. WORKER_TOKEN is the bearer on /worker-sessions, not the person id.'}],headings:[{id:"why",content:"Why"},{id:"who",content:"Who"},{id:"how",content:"How"},{id:"getting-started",content:"Getting started"}]},Z=[{depth:2,url:"#why",title:(0,V.jsx)(V.Fragment,{children:"Why"})},{depth:2,url:"#who",title:(0,V.jsx)(V.Fragment,{children:"Who"})},{depth:2,url:"#how",title:(0,V.jsx)(V.Fragment,{children:"How"})},{depth:2,url:"#getting-started",title:(0,V.jsx)(V.Fragment,{children:"Getting started"})}];function $(a){let b={code:"code",h2:"h2",li:"li",ol:"ol",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h2,{id:"why",children:"Why"}),"\n",(0,V.jsx)(b.p,{children:"A kind is the queue a step's job is sent to. A worker pulls one or more kinds. A kind is not a step implementation."}),"\n",(0,V.jsxs)(b.p,{children:["The step implementation is the ",(0,V.jsx)(b.code,{children:"run"})," on the bound step. The kind names where the orchestrator sends that step's job. The orchestrator and the worker are separate processes: the orchestrator sends the job, and the worker pulls it and runs the step implementation."]}),"\n",(0,V.jsx)(b.h2,{id:"who",children:"Who"}),"\n",(0,V.jsx)(b.p,{children:"You name the kind when you register a bound step for an organization."}),"\n",(0,V.jsx)(b.p,{children:"You start a worker when you want that kind pulled."}),"\n",(0,V.jsx)(b.p,{children:"A person can read which workers are connected. A person can open the first entity of a flow, replay a flow, replay from a step, resend a job, run a step without applying its result, cancel a run or an open step, and end a validity. The first opening is that request: an open run waits, and inside the validity duration the recorded result is returned."}),"\n",(0,V.jsx)(b.h2,{id:"how",children:"How"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"bindOrganization"})," in ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/steps.ts"})," binds each step onto every flow. The kind is ",(0,V.jsx)(b.code,{children:"fixture-"})," plus the step name: ",(0,V.jsx)(b.code,{children:"fixture-dwell"}),", ",(0,V.jsx)(b.code,{children:"fixture-stall"}),", ",(0,V.jsx)(b.code,{children:"fixture-miss"}),", ",(0,V.jsx)(b.code,{children:"fixture-sprout"}),", and ",(0,V.jsx)(b.code,{children:"fixture-brood"}),". ",(0,V.jsx)(b.code,{children:"fixtureSteps"})," stores each bound step under ",(0,V.jsx)(b.code,{children:"flow/step"}),". ",(0,V.jsx)(b.code,{children:"seedOrganization"})," calls ",(0,V.jsx)(b.code,{children:"service.startRun"})," with the organization that exported ",(0,V.jsx)(b.code,{children:"catalogSeed"}),". ",(0,V.jsx)(b.code,{children:"Job.organization"})," and ",(0,V.jsx)(b.code,{children:"BoundStep.kind"})," stay different fields: ",(0,V.jsx)(b.code,{children:"enqueueStep"})," copies the organization onto the job and reads the kind from the bound step."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"pnpm --filter cue-orchestrator serve"})," runs ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/server.ts"}),". That file calls ",(0,V.jsx)(b.code,{children:"createBullQueue"})," and ",(0,V.jsx)(b.code,{children:"createReadServer"}),", then ",(0,V.jsx)(b.code,{children:"server.listen"})," on port ",(0,V.jsx)(b.code,{children:"3001"}),". The HTTP server does not start a worker: ",(0,V.jsx)(b.code,{children:"createStepWorker"})," is called from ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/work.ts"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"apps/orchestrator/src/preview.ts"})," calls ",(0,V.jsx)(b.code,{children:"createReadServer"})," with ",(0,V.jsx)(b.code,{children:"createMemoryWorkerRegistry"})," and a ",(0,V.jsx)(b.code,{children:"JobQueue"})," whose ",(0,V.jsx)(b.code,{children:"add"})," returns ",(0,V.jsx)(b.code,{children:"undefined"}),". ",(0,V.jsx)(b.code,{children:"preview.ts"})," calls ",(0,V.jsx)(b.code,{children:"server.listen(3001)"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"enqueueStep"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/jobs.ts"})," copies ",(0,V.jsx)(b.code,{children:"organization"}),", ",(0,V.jsx)(b.code,{children:"entity"}),", and ",(0,V.jsx)(b.code,{children:"step"})," into ",(0,V.jsx)(b.code,{children:"data"})," before ",(0,V.jsx)(b.code,{children:"queue.add"}),", so a job is organization, entity, and step with no secret. ",(0,V.jsx)(b.code,{children:"stepBinding"})," loads the bound step at ",(0,V.jsx)(b.code,{children:"`${flow}/${step}`"})," and ",(0,V.jsx)(b.code,{children:"queue.add"})," receives ",(0,V.jsx)(b.code,{children:"bound.kind"}),", so the kind comes from the bound step. ",(0,V.jsx)(b.code,{children:"publish"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/service.ts"})," calls ",(0,V.jsx)(b.code,{children:"enqueueStep"})," for every job returned by ",(0,V.jsx)(b.code,{children:"startRun"}),", ",(0,V.jsx)(b.code,{children:"runJob"}),", and ",(0,V.jsx)(b.code,{children:"advance"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"queueName"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/bull.ts"})," returns ",(0,V.jsx)(b.code,{children:"`steps-${kind}`"}),", so the Redis queue name is steps plus the kind. ",(0,V.jsx)(b.code,{children:"createBullQueue"})," opens that Redis queue and calls ",(0,V.jsx)(b.code,{children:'queue.add("step", data, options)'}),". ",(0,V.jsx)(b.code,{children:"stepJobOptions"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/jobs.ts"})," is ",(0,V.jsx)(b.code,{children:"{ attempts: 1 }"}),". ",(0,V.jsx)(b.code,{children:"createBullQueue"})," sets it as ",(0,V.jsx)(b.code,{children:"defaultJobOptions"}),", and ",(0,V.jsx)(b.code,{children:"enqueueStep"})," passes it on each ",(0,V.jsx)(b.code,{children:"queue.add"}),", so attempts is 1."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"seedOrganization"})," calls ",(0,V.jsx)(b.code,{children:"startRun"})," for each run from an exported ",(0,V.jsx)(b.code,{children:"catalogSeed"}),". The fixture does not export one, so ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture seed"})," starts no run. The log line is ",(0,V.jsx)(b.code,{children:"seeded fixture 0 runs"}),". ",(0,V.jsx)(b.code,{children:"startRun"})," calls ",(0,V.jsx)(b.code,{children:"publish"}),", so a started run's jobs sit on the Redis queue until a worker pulls them. ",(0,V.jsx)(b.code,{children:"server.ts"})," does not call ",(0,V.jsx)(b.code,{children:"startRun"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"applySilence"})," in ",(0,V.jsx)(b.code,{children:"packages/engine/src/engine.ts"})," pushes a new job with ",(0,V.jsx)(b.code,{children:"jobFor"})," while the opened step has no result, ",(0,V.jsx)(b.code,{children:"now"})," is at or after ",(0,V.jsx)(b.code,{children:"silenceDueAt"}),", and ",(0,V.jsx)(b.code,{children:"resendCount"})," is still under ",(0,V.jsx)(b.code,{children:"maxResends"}),". At ",(0,V.jsx)(b.code,{children:"maxResends"}),", ",(0,V.jsx)(b.code,{children:"applySilence"})," sets that step's result to ",(0,V.jsx)(b.code,{children:"not_finished"})," and breaks without ",(0,V.jsx)(b.code,{children:"jobs.push"}),". ",(0,V.jsx)(b.code,{children:"Service.advance"})," publishes each pushed job through ",(0,V.jsx)(b.code,{children:"enqueueStep"})," and ",(0,V.jsx)(b.code,{children:"queue.add"}),": silence stays in the engine, and a resend is a new job. ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/server.ts"})," calls ",(0,V.jsx)(b.code,{children:"openFixtureService"}),", ",(0,V.jsx)(b.code,{children:"createReadServer"}),", and ",(0,V.jsx)(b.code,{children:"server.listen"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"organizations/fixture/src/work.ts"})," calls ",(0,V.jsx)(b.code,{children:"kindsToStart(declaredKinds(fixtureSteps), requestedKinds(process.argv.slice(2)))"}),". ",(0,V.jsx)(b.code,{children:"declaredKinds"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/kinds.ts"})," lists each ",(0,V.jsx)(b.code,{children:"kind"})," on the bound steps once. ",(0,V.jsx)(b.code,{children:"kindsToStart"})," returns that full list when ",(0,V.jsx)(b.code,{children:"requested.length"})," is ",(0,V.jsx)(b.code,{children:"0"}),", and ",(0,V.jsx)(b.code,{children:"requestedKinds"})," returns ",(0,V.jsx)(b.code,{children:"[]"})," when the arguments contain no ",(0,V.jsx)(b.code,{children:"--kinds"})," and when the value splits and trims to no names, so an empty ",(0,V.jsx)(b.code,{children:"--kinds"})," starts every declared kind. ",(0,V.jsx)(b.code,{children:"pnpm --filter @ascentstudio/cue-org-fixture work"})," takes that path. ",(0,V.jsx)(b.code,{children:"requestedKinds"})," throws ",(0,V.jsx)(b.code,{children:"--kinds needs a comma-separated list"})," when ",(0,V.jsx)(b.code,{children:"--kinds"})," is present and the next argument is missing, and that throw is raised while ",(0,V.jsx)(b.code,{children:"work.ts"})," is still computing ",(0,V.jsx)(b.code,{children:"kinds"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"kindsToStart"})," throws ",(0,V.jsx)(b.code,{children:"`Unknown kind ${kind}`"})," when a requested name is absent from ",(0,V.jsx)(b.code,{children:"declaredKinds"}),", and ",(0,V.jsx)(b.code,{children:"work.ts"})," calls ",(0,V.jsx)(b.code,{children:"kindsToStart"})," before the loop that calls ",(0,V.jsx)(b.code,{children:"createStepWorker"}),", so an unknown kind throws and starts nothing."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"requestedKinds"})," splits the ",(0,V.jsx)(b.code,{children:"--kinds"})," value on commas. The loop ",(0,V.jsx)(b.code,{children:"for (const kind of kinds)"})," in ",(0,V.jsx)(b.code,{children:"work.ts"})," calls ",(0,V.jsx)(b.code,{children:"createStepWorker"})," once per kind in that same process, so several kinds can run in one process. ",(0,V.jsx)(b.code,{children:"bindOrganization"})," sets the kind to ",(0,V.jsx)(b.code,{children:"fixture-"})," plus the step name, so ",(0,V.jsx)(b.code,{children:"declaredKinds(fixtureSteps)"})," returns ",(0,V.jsx)(b.code,{children:"fixture-dwell"}),", ",(0,V.jsx)(b.code,{children:"fixture-stall"}),", ",(0,V.jsx)(b.code,{children:"fixture-miss"}),", ",(0,V.jsx)(b.code,{children:"fixture-sprout"}),", and ",(0,V.jsx)(b.code,{children:"fixture-brood"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"createStepWorker"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/bull.ts"})," starts a BullMQ ",(0,V.jsx)(b.code,{children:"Worker"})," on ",(0,V.jsx)(b.code,{children:"queueName(kind)"})," and calls ",(0,V.jsx)(b.code,{children:"run"})," with ",(0,V.jsx)(b.code,{children:"organization"}),", ",(0,V.jsx)(b.code,{children:"entity"}),", and ",(0,V.jsx)(b.code,{children:"step"})," taken from the job data, so workers pull. ",(0,V.jsx)(b.code,{children:"work.ts"})," calls ",(0,V.jsx)(b.code,{children:"readOrganizationSecrets"})," once, then ",(0,V.jsx)(b.code,{children:"installEnvironment"}),", before ",(0,V.jsx)(b.code,{children:"createStepWorker"}),". ",(0,V.jsx)(b.code,{children:"installEnvironment"})," writes each secret into the environment. ",(0,V.jsx)(b.code,{children:"work.ts"})," passes ",(0,V.jsx)(b.code,{children:"consumeAssignment"})," as that ",(0,V.jsx)(b.code,{children:"run"}),". ",(0,V.jsx)(b.code,{children:"consumeAssignment"})," reads the dispatch packet and calls ",(0,V.jsx)(b.code,{children:"implementation.run"}),". The packet has the starting data and the time, and it has no secret. A step implementation reads a name with ",(0,V.jsx)(b.code,{children:"environment"}),". The ",(0,V.jsx)(b.code,{children:"failed"})," handler in ",(0,V.jsx)(b.code,{children:"work.ts"})," logs ",(0,V.jsx)(b.code,{children:"step failed"})," with the kind, the BullMQ job id, and the error. A value loaded by ",(0,V.jsx)(b.code,{children:"installEnvironment"})," is replaced with ",(0,V.jsx)(b.code,{children:"••••"})," in that log."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"packages/supervisor/src/worker/supervise.ts"})," starts ",(0,V.jsx)(b.code,{children:"packages/supervisor/src/worker/main.ts"})," and keeps the environment from before ",(0,V.jsx)(b.code,{children:"loadRootEnv"})," and ",(0,V.jsx)(b.code,{children:"installEnvironment"}),". ",(0,V.jsx)(b.code,{children:"createSupervisor"})," writes ",(0,V.jsx)(b.code,{children:"supervisor watching pid"})," and the child pid. A child that exits ",(0,V.jsx)(b.code,{children:"75"})," is a requested restart: the supervisor writes ",(0,V.jsx)(b.code,{children:"worker restart requested"})," and starts the child again, so it calls ",(0,V.jsx)(b.code,{children:"readOrganizationSecrets"})," and ",(0,V.jsx)(b.code,{children:"installEnvironment"})," once more. A child that exits ",(0,V.jsx)(b.code,{children:"0"})," is a requested stop: the supervisor writes ",(0,V.jsx)(b.code,{children:"worker stopped"})," and ",(0,V.jsx)(b.code,{children:"supervisor exiting"}),", then calls ",(0,V.jsx)(b.code,{children:"process.exit(0)"}),". A child that exits with another code, or with a signal, is unexpected: the supervisor writes ",(0,V.jsx)(b.code,{children:"worker exited"})," plus that code or signal and ",(0,V.jsx)(b.code,{children:"restarting"}),", waits one second, and starts the child again. ",(0,V.jsx)(b.code,{children:"SIGINT"}),", ",(0,V.jsx)(b.code,{children:"SIGTERM"}),", and ",(0,V.jsx)(b.code,{children:"SIGQUIT"})," are stop signals. The supervisor writes ",(0,V.jsx)(b.code,{children:"supervisor forwarding"})," plus the signal name, forwards that signal, and does not start another child when that child exits. ",(0,V.jsx)(b.code,{children:"SIGHUP"})," is forwarded the same way and is a restart: the child exits ",(0,V.jsx)(b.code,{children:"75"}),". ",(0,V.jsx)(b.code,{children:"SIGTERM"})," and ",(0,V.jsx)(b.code,{children:"SIGINT"})," ask that child to stop accepting jobs and exit ",(0,V.jsx)(b.code,{children:"0"})," after the current job. ",(0,V.jsx)(b.code,{children:"SIGQUIT"})," closes the BullMQ workers without waiting and exits ",(0,V.jsx)(b.code,{children:"0"}),". ",(0,V.jsx)(b.code,{children:"createShutdown"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/worker-control.ts"})," is that sequence. The worker writes ",(0,V.jsx)(b.code,{children:"worker command"})," plus ",(0,V.jsx)(b.code,{children:"drain-stop"}),", ",(0,V.jsx)(b.code,{children:"drain-restart"}),", or ",(0,V.jsx)(b.code,{children:"force-stop"})," when it takes the command, and ",(0,V.jsx)(b.code,{children:"worker exit"})," plus ",(0,V.jsx)(b.code,{children:"0"})," or ",(0,V.jsx)(b.code,{children:"75"})," before ",(0,V.jsx)(b.code,{children:"process.exit"}),". Each BullMQ worker is closed with ",(0,V.jsx)(b.code,{children:"close(true)"}),". A command stored for the worker runs the same sequence. ",(0,V.jsx)(b.code,{children:"publish"})," calls ",(0,V.jsx)(b.code,{children:"enqueueStep"})," with the jobs from the engine, so a worker session is not a condition for opening a step. ",(0,V.jsx)(b.code,{children:"WorkerService"})," in ",(0,V.jsx)(b.code,{children:"packages/supervisor/src/worker/worker.service.ts"})," starts each kind with ",(0,V.jsx)(b.code,{children:"createStepWorker"}),"."]}),"\n",(0,V.jsx)(b.h2,{id:"getting-started",children:"Getting started"}),"\n",(0,V.jsxs)(b.ol,{children:["\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["Copy ",(0,V.jsx)(b.code,{children:".env.example"})," to ",(0,V.jsx)(b.code,{children:".env"})," in the repository root, and start Redis and Supabase with ",(0,V.jsx)(b.code,{children:"docker compose up -d redis"})," and ",(0,V.jsx)(b.code,{children:"npx supabase start"}),". ",(0,V.jsx)(b.code,{children:"loadRootEnv"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/env.ts"})," reads that ",(0,V.jsx)(b.code,{children:".env"}),". ",(0,V.jsx)(b.code,{children:"requiredEnv"})," in the same file reads ",(0,V.jsx)(b.code,{children:"REDIS_URL"}),", ",(0,V.jsx)(b.code,{children:"DATABASE_URL"}),", and ",(0,V.jsx)(b.code,{children:"WORKER_TOKEN"}),", and throws ",(0,V.jsx)(b.code,{children:"${name} is required"})," when a name is missing. ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/server.ts"})," calls ",(0,V.jsx)(b.code,{children:"loadRootEnv"})," inside ",(0,V.jsx)(b.code,{children:"openFixtureService"}),", then ",(0,V.jsx)(b.code,{children:'requiredEnv("WORKER_TOKEN")'}),". ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/work.ts"})," calls ",(0,V.jsx)(b.code,{children:"loadRootEnv"}),", reads ",(0,V.jsx)(b.code,{children:"WORKER_TOKEN"}),", then ",(0,V.jsx)(b.code,{children:"readOrganizationSecrets"})," with ",(0,V.jsx)(b.code,{children:"DATABASE_URL"})," and organization ",(0,V.jsx)(b.code,{children:"fixture"}),". That reads the secrets table once. ",(0,V.jsx)(b.code,{children:"installEnvironment"})," writes those names into the environment."]}),"\n"]}),"\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["Run ",(0,V.jsx)(b.code,{children:"pnpm --filter cue-orchestrator serve"}),". The ",(0,V.jsx)(b.code,{children:"serve"})," script in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/package.json"})," runs ",(0,V.jsx)(b.code,{children:"tsx src/server.ts"}),". ",(0,V.jsx)(b.code,{children:"server.ts"})," calls ",(0,V.jsx)(b.code,{children:"openFixtureService"}),", which calls ",(0,V.jsx)(b.code,{children:"createBullQueue"})," with ",(0,V.jsx)(b.code,{children:"REDIS_URL"}),". ",(0,V.jsx)(b.code,{children:"server.ts"})," then calls ",(0,V.jsx)(b.code,{children:"createReadServer"})," and ",(0,V.jsx)(b.code,{children:'server.listen(3001, "0.0.0.0")'}),", and ",(0,V.jsx)(b.code,{children:"console.log"})," prints ",(0,V.jsx)(b.code,{children:"orchestrator http://127.0.0.1:3001"}),". The HTTP server does not start a worker and does not call ",(0,V.jsx)(b.code,{children:"startRun"}),". ",(0,V.jsx)(b.code,{children:"createStepWorker"})," runs from ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/work.ts"}),". Stop the preview process first when it is already on port ",(0,V.jsx)(b.code,{children:"3001"}),", because ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/preview.ts"})," calls ",(0,V.jsx)(b.code,{children:"server.listen(3001)"}),"."]}),"\n"]}),"\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["In a second terminal, run ",(0,V.jsx)(b.code,{children:"pnpm --filter cue-supervisor work"}),". The ",(0,V.jsx)(b.code,{children:"work"})," script in ",(0,V.jsx)(b.code,{children:"packages/supervisor/package.json"})," runs ",(0,V.jsx)(b.code,{children:"tsx src/main.ts"}),". ",(0,V.jsx)(b.code,{children:"packages/supervisor/src/worker/supervise.ts"})," starts ",(0,V.jsx)(b.code,{children:"main.ts"})," with the environment it had at launch. ",(0,V.jsx)(b.code,{children:"work.ts"})," calls ",(0,V.jsx)(b.code,{children:"kindsToStart"})," with ",(0,V.jsx)(b.code,{children:"declaredKinds(fixtureSteps)"})," and the list from ",(0,V.jsx)(b.code,{children:"requestedKinds"}),". With no ",(0,V.jsx)(b.code,{children:"--kinds"}),", ",(0,V.jsx)(b.code,{children:"requestedKinds"})," returns ",(0,V.jsx)(b.code,{children:"[]"})," and ",(0,V.jsx)(b.code,{children:"kindsToStart"})," returns every declared kind. ",(0,V.jsx)(b.code,{children:"readOrganizationSecrets"})," and ",(0,V.jsx)(b.code,{children:"installEnvironment"})," then load the organization's secrets into the environment. ",(0,V.jsx)(b.code,{children:"work.ts"})," reads ",(0,V.jsx)(b.code,{children:"WORKER_TOKEN"})," before ",(0,V.jsx)(b.code,{children:"installEnvironment"})," and posts ",(0,V.jsx)(b.code,{children:"/worker-sessions"})," with that bearer, the host, and each started ",(0,V.jsx)(b.code,{children:"flow/step"}),". The loop calls ",(0,V.jsx)(b.code,{children:"createStepWorker"})," for each kind. A secret added or deleted after this start stays out of the environment until the worker starts again. ",(0,V.jsx)(b.code,{children:"SIGHUP"})," is that start: the child exits ",(0,V.jsx)(b.code,{children:"75"}),", the supervisor writes ",(0,V.jsx)(b.code,{children:"worker restart requested"}),", and starts it again. A child that exits ",(0,V.jsx)(b.code,{children:"0"})," makes the supervisor write ",(0,V.jsx)(b.code,{children:"worker stopped"})," and ",(0,V.jsx)(b.code,{children:"supervisor exiting"}),", then exit. A child that exits with another code or a signal is started again after one second. ",(0,V.jsx)(b.code,{children:"console.log"})," in ",(0,V.jsx)(b.code,{children:"work.ts"})," prints ",(0,V.jsx)(b.code,{children:"fixture workers"})," plus those kind names joined by commas. Those kinds are ",(0,V.jsx)(b.code,{children:"fixture-dwell"}),", ",(0,V.jsx)(b.code,{children:"fixture-stall"}),", ",(0,V.jsx)(b.code,{children:"fixture-miss"}),", ",(0,V.jsx)(b.code,{children:"fixture-sprout"}),", and ",(0,V.jsx)(b.code,{children:"fixture-brood"}),". ",(0,V.jsx)(b.code,{children:"work.ts"})," does not call ",(0,V.jsx)(b.code,{children:"catalogSeed"}),"."]}),"\n"]}),"\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["Run ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture seed"}),". The ",(0,V.jsx)(b.code,{children:"seed"})," script in ",(0,V.jsx)(b.code,{children:"organizations/fixture/package.json"})," runs ",(0,V.jsx)(b.code,{children:"cue seed"}),". The fixture does not export ",(0,V.jsx)(b.code,{children:"catalogSeed"}),", so the command opens nothing and the log line is ",(0,V.jsx)(b.code,{children:"seeded fixture 0 runs"}),". Load runs start with ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf"}),", ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf:load"}),", ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf:brood"}),", or ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf:brood:producer"}),". ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture reset"})," deletes the fixture rows in the orchestrator database, drains the jobs for those runs, and deletes that organization's metrics. The log line is ",(0,V.jsx)(b.code,{children:"reset fixture"}),"."]}),"\n"]}),"\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["To pull one kind, run ",(0,V.jsx)(b.code,{children:"pnpm --filter @ascentstudio/cue-org-fixture work -- --kinds fixture-dwell"}),". ",(0,V.jsx)(b.code,{children:"requestedKinds"})," reads ",(0,V.jsx)(b.code,{children:"fixture-dwell"})," and splits on commas. ",(0,V.jsx)(b.code,{children:"kindsToStart"})," keeps ",(0,V.jsx)(b.code,{children:"fixture-dwell"})," because ",(0,V.jsx)(b.code,{children:"declaredKinds"})," lists that kind from ",(0,V.jsx)(b.code,{children:"bindOrganization"}),", and ",(0,V.jsx)(b.code,{children:"createStepWorker"})," starts it. When ",(0,V.jsx)(b.code,{children:"declaredKinds"})," lists more than one kind, put those names in the same comma-separated value: ",(0,V.jsx)(b.code,{children:"requestedKinds"})," splits on commas, and the loop calls ",(0,V.jsx)(b.code,{children:"createStepWorker"})," for each of them in this process. A name missing from ",(0,V.jsx)(b.code,{children:"declaredKinds"})," makes ",(0,V.jsx)(b.code,{children:"kindsToStart"})," throw ",(0,V.jsx)(b.code,{children:"Unknown kind"})," plus that name before ",(0,V.jsx)(b.code,{children:"createStepWorker"}),". A ",(0,V.jsx)(b.code,{children:"--kinds"})," flag with no value makes ",(0,V.jsx)(b.code,{children:"requestedKinds"})," throw ",(0,V.jsx)(b.code,{children:"--kinds needs a comma-separated list"})," before ",(0,V.jsx)(b.code,{children:"kindsToStart"}),"."]}),"\n"]}),"\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["Open Workers in the console for the fixture organization, or call ",(0,V.jsx)(b.code,{children:"GET /organizations/fixture/workers"})," at ",(0,V.jsx)(b.code,{children:"http://127.0.0.1:3001/organizations/fixture/workers"})," with ",(0,V.jsx)(b.code,{children:"Authorization: Bearer"})," and a person id. The resolver in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/server.ts"})," returns the text after ",(0,V.jsx)(b.code,{children:"Bearer "}),", and ",(0,V.jsx)(b.code,{children:"createReadServer"})," then returns ",(0,V.jsx)(b.code,{children:"service.workersFor"}),". One working call is ",(0,V.jsx)(b.code,{children:'curl -H "Authorization: Bearer person-1" http://127.0.0.1:3001/organizations/fixture/workers'}),". The body is the workers whose coverage names a flow of that organization. The rows are in the ",(0,V.jsx)(b.code,{children:"workers"})," table. ",(0,V.jsx)(b.code,{children:"work.ts"})," calls ",(0,V.jsx)(b.code,{children:"openWorkerPresence"})," with ",(0,V.jsx)(b.code,{children:"DATABASE_URL"})," and ",(0,V.jsx)(b.code,{children:"presence.pulse"})," updates ",(0,V.jsx)(b.code,{children:"last_pulse_at"}),". ",(0,V.jsx)(b.code,{children:"first_pulse_at"})," stays at the time the row was created. ",(0,V.jsx)(b.code,{children:"workerPresenceTtlSeconds"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/workers.ts"})," is 30, so a process that stops reporting is marked stopped after that many seconds. A planned stop calls ",(0,V.jsx)(b.code,{children:"presence.stop"}),", which sets the phase to stopped and keeps the row. ",(0,V.jsx)(b.code,{children:"workerRetentionSeconds"})," is 30 days, and a stopped row is deleted after that long. A stopped worker stays openable so its configuration can be read. Each row has ",(0,V.jsx)(b.code,{children:"firstPulseAt"})," and ",(0,V.jsx)(b.code,{children:"lastPulseAt"}),". A last pulse older than 5 minutes is stale in the console while the worker is not stopped. The step metric written when this worker finishes a step includes its id. ",(0,V.jsx)(b.code,{children:"enqueueStep"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/jobs.ts"})," sends the job from ",(0,V.jsx)(b.code,{children:"publish"})," and does not take that list as an argument. ",(0,V.jsx)(b.code,{children:"WORKER_TOKEN"})," is the bearer on ",(0,V.jsx)(b.code,{children:"/worker-sessions"}),", not the person id."]}),"\n"]}),"\n"]})]})}function _(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)($,{...a})}):$(a)}let aa={title:"Flow"},ab=[],ac={contents:[{heading:"why",content:"A flow is the restricted function that describes what an entity does, with one validity duration for every entity of that flow. A step is an opening in that function. The step implementation is the code outside the flow that performs the step."},{heading:"why",content:"The current flow run stays available for the next reread. A flow metric is the retained end of a finished flow run. A step metric is the retained end of a finished step run. A person reads those ends over a period. A running flow run is not a metric."},{heading:"who",content:"You write a flow when you add one to an organization. flows and fixtureFlows in organizations/fixture/src/index.ts, and fixtureSteps in organizations/fixture/src/steps.ts, are the registrations to copy."},{heading:"who",content:"A person reads Flows in the console. A person can open the first entity of a flow, replay a flow, replay from a step, resend a job, run a step without applying its result, cancel a run or an open step, and end a validity. The first opening is that request: an open run waits, and inside the validity duration the recorded result is returned. On a stored flow run the console lists that run's transient files."},{heading:"how",content:"You meet the function, then the openings it calls, then the registration, then the run the orchestrator keeps, then the Flows screen."},{heading:"the-function",content:"FlowFunction in packages/contract/src/index.ts is (ctx: FlowContext) => void. paceFlow, loadFlow, stallFlow, faultFlow, softenFlow, asideFlow, nestFlow, and broodFlow are that function. defineFlow stores each one as run. organizations/fixture/src/index.ts lists them on flows, and fixtureFlows is that list. nestMidFlow, nestLeafFlow, and broodChildFlow are the child runs those parents open."},{heading:"the-function",content:"reread in packages/engine/src/engine.ts calls definition.run from the first opening, on the operations already stored. openTrackedStep keeps an opening whose step and mode already match. It throws `Reread diverged at ${step}` when they do not."},{heading:"the-function",content:"FlowContext exposes values, openStep, openOptionalStep, openDetachedStep, openChildren, waitGroup, choose, finish, and fail. values is the copy taken when the run opened. The other methods take a step name, a flow name, elements, a group callback, a choice, or nothing. consumeAssignment in apps/orchestrator/src/consume.ts passes starting data, current values, files, and at to implementation.run. The worker loaded secrets into the environment with installEnvironment before it started."},{heading:"openings",content:'paceFlow calls ctx.openStep(dwellStep), then ctx.openStep("mark"). loadFlow calls ctx.openStep(dwellStep). asideFlow calls ctx.openDetachedStep(stallStep), then ctx.openStep(dwellStep). The string "mark" is that step name. dwellStep declares dwell, and names includes mark.'},{heading:"openings",content:'openStep calls openTrackedStep with opening required. The first call builds the step with createStep, pushes jobFor, sets run.wait to { kind: "step", step }, and throws SuspendSignal. The next reread returns frame.result once frame.result is set. A required result whose status is failed ends the run in failure and does not open the next step. A required result whose status is not_finished ends the run not finished. After definition.run returns, or after FinishSignal, reread calls settle with success.'},{heading:"openings",content:"openDetachedStep calls openDetached. The first call pushes jobFor and returns without SuspendSignal. acceptResult writes frame.result and, on the first end, calls pushStep. When frame.mode is detached and entity.run.status is anything other than running, acceptResult returns taken([]) and skips drive. The step metric from that first pushStep is in the transition taken returns."},{heading:"openings",content:"softenFlow calls ctx.openOptionalStep(missStep). That call uses openTrackedStep with opening optional. It waits for frame.result the same way as openStep. A failed or not finished optional result does not stop the run."},{heading:"groups-children-and-choice",content:'On a new group, waitGroup stores rule: { form: "all" }, then calls define. sealGroup seals the report when judgeRule returns success. A failure or a not finished judgment closes the still-open required and optional steps and stops the run. Until then waitGroup sets run.wait to { kind: "group", rule: frame.rule } and throws SuspendSignal. The call returns frame.sealed.'},{heading:"groups-children-and-choice",content:"takeStep records optional or required and pushes jobFor for a new member that is still live. The group rule counts a required step whose result status is done, and a child run whose status is success. An optional step does not count. GroupContext.openStep and GroupContext.openOptionalStep return nothing."},{heading:"groups-children-and-choice",content:"nestFlow calls ctx.openChildren(nestMidFlow, asChildren(sprouted.body)). nestMidFlow calls ctx.openChildren(nestLeafFlow, asChildren(sprouted.body)). broodFlow calls ctx.openChildren(broodChildFlow, asChildren(opened.body)). The first argument is the flow. takeChildren stores it as member.flow. GroupContext in packages/contract/src/index.ts types that parameter as flow: FlowName. A child member with no identities counts as done."},{heading:"groups-children-and-choice",content:"FlowContext.openChildren and openOptionalChildren take flow as a FlowName and elements as one ChildElement or a readonly list. Each element has identifier and startingData. On the context from contextFor, one child waits while child.run.status is running and then returns resultFrom(child), including that child's finish body. A failed required child ends the parent in failure. A not finished required child ends the parent not finished. An optional child does not stop the parent. When the argument is a list, childCall stores normalizeChildrenRule of the call's rule, or { form: \"all\" } when the call omits it. The same rule is accepted on both openings. withinMin stores openedAt on the first opening. sealChildren calls judgeChildren. A required miss stops the parent. An optional miss seals the report and the parent continues. An empty list records the opening and returns a sealed report. nestFlow, nestMidFlow, and broodFlow open child flows with openChildren."},{heading:"groups-children-and-choice",content:"uniqueElements keeps the first element of each identity. ensureChild calls begin when the child is missing. When restart is true and the child is not running, it calls begin again unless the run is success and now is still within validityEndsAt. The flow openChildren passes restart as !isReread. entityId in packages/contract/src/index.ts returns `${organization}/${flow}/${identity}`."},{heading:"groups-children-and-choice",content:'choose stores the arms in the order of arm.name. It runs every arm whose name differs from taken under contextFor(..., "discarded"), then runs the taken arm under "live". A discarded opening is discardedStep, with discarded: true and no jobs.push. acceptResult returns taken([]) when findStep misses the step and findDiscardedStep finds it. Duplicate arm names, or a taken value absent from those names, throw Reread diverged at a choice.'},{heading:"groups-children-and-choice",content:"paceFlow, loadFlow, softenFlow, asideFlow, nestFlow, nestMidFlow, nestLeafFlow, broodFlow, and broodChildFlow call ctx.finish(). stallFlow and faultFlow open one required step and do not call finish(). finish throws FinishSignal in live mode, and the catch in reread calls settleReachedEnd, the same close as a normal return. fail throws FailSignal, and that catch calls settle with failure. None of these flows call fail()."},{heading:"registration-and-the-step-implementation",content:"defineFlow returns the flow with name, entityType, validityDurationMs, source, and run. Each fixture flow sets validityDurationMs to null and entityType to its name. fixtureFlows holds pace, load, stall, fault, soften, aside, nest, nest-mid, nest-leaf, brood, and brood-child. createRegistry throws `Unknown flow ${name}` from get when a name is missing. ensureChild calls registry.get(flowName) for the child flow."},{heading:"registration-and-the-step-implementation",content:"bindOrganization in organizations/fixture/src/steps.ts binds each step onto every flow. The kind is fixture- plus the step name: fixture-dwell, fixture-stall, fixture-miss, fixture-sprout, and fixture-brood. fixtureSteps stores each bound step under flow/step. dwell also answers mark and pass-1 through pass-10."},{heading:"registration-and-the-step-implementation",content:'dwell waits the configured milliseconds, then returns done. stall throws StepHeld. miss returns { kind: "result", status: "failed", discriminant: "failed" }.'},{heading:"registration-and-the-step-implementation",content:'runJob loads the bound step with stepBinding. A thrown StepHeld returns before acceptResult. When implementation.run throws and openingFor is optional or detached, runJob sends { kind: "result", status: "failed", discriminant: "failed" } to acceptResult. Any other thrown error is rethrown.'},{heading:"the-run",content:"apps/orchestrator/src/server.ts calls openFixtureService with createMemoryClient and watchWorkers: true. That opens createService with flows: fixtureFlows, steps: fixtureSteps, entities: createPostgresEntities(pool), metrics: createMetricPublisher(redis), and metricReads: createMetricsReader(clickhouse). server.ts does not call startRun. pnpm --dir organizations/fixture seed calls seedOrganization only when the organization exports catalogSeed. The fixture does not, so that command starts no run and opens no client database. The log line is seeded fixture 0 runs. startRun writes a run into the orchestrator database."},{heading:"the-run",content:'startRun loads the row with loadFocus, calls engine.request, then persist, then afterCommit. request addresses the entity with entityId. A run whose status is running returns { kind: "waiting" }. A success run with finishedAt and validityEndsAt set, and input.at at or before that instant, returns { kind: "recorded" }. Every other request goes through begin. begin adds one to generation, sets run.status to running, copies input.startingData, clears validityEndsAt, and calls drive.'},{heading:"the-run",content:"drive calls applySilence, then reread. applySilence pushes jobFor while the step has no result, now is at or after silenceDueAt, and resendCount is still under maxResends. At maxResends it writes status not_finished and calls pushStep. Service.advance calls engine.advance for each batch from session.due. due in createPostgresEntities selects status = 'running' and silence_due_at <= $1. server.ts reaches the engine through openFixtureService, and it also calls startMetricFlush, createReadServer, and server.listen. seedOrganization is the startRun for an exported catalogSeed."},{heading:"the-run",content:"afterCommit calls enqueueStep for each job and metrics.publish with flowMetrics and stepMetrics. organizations/fixture/src/work.ts starts createStepWorker for each kind. Each job calls consumeAssignment. The orchestrator applies the published result and calls engine.acceptResult inside deps.entities.transaction."},{heading:"the-run",content:"settle returns at once when entity.run.status is not running. Otherwise it sets status and finishedAt, clears wait, and pushes one FlowMetric with that outcome, the run generation, and durationMs. On success, validityEndsAt is addMs(now, validityDurationMs) from registry.get(entity.flow). pushStep pushes one StepMetric when discarded is unset and the step has openedAt, endedAt, and result. When acceptResult receives a worker id, that id is on the step metric. A silence not_finished has no worker id. FlowMetric and StepMetric are declared in packages/contract/src/index.ts."},{heading:"transient-files",content:"A step writes a transient file with input.files.put. The bytes live in the platform bucket under runs/{organization}/{flow}/{identifier}/{generation}/{name}. consumeAssignment records every name that put wrote and stores that list on the step result. A replay from a step publishes a copy of each kept name into the new generation before the jobs of that generation are sent. A full replay does not copy. The flow run page in the console lists them. Reading a name still uses the current generation."},{heading:"transient-files",content:"listRun on TransientFiles in apps/orchestrator/src/transient-files.ts returns { name, bytes }[] for that prefix, sorted by name. GET /entities/:id?files=1 on ReadController calls listRunFilesFor after parseFlowRunPath and readGeneration. The run must still be stored and the person must belong to that organization. GET /entities/:id?file={name} returns the bytes with the stored content type. A name that is not one segment, or a missing file, is 404."},{heading:"transient-files",content:"EntityView in apps/console/src/design/views.tsx renders a DataTable titled Files, empty copy No file., page size 50. EntityScreen loads that list with listRunFiles and does not send files on the 2s tree poll. A row opens a dialog: readRunFile previews JSON or text under 1 MiB, and Download goes to GET /api/run-file. After the flow run retention the run is gone and those files are gone."},{heading:"postgres-and-clickhouse",content:"persist calls session.upsert. createPostgresEntities inserts the run into entities and, on conflict of organization_id, flow, identity, updates status, generation, started_at, finished_at, validity_ends_at, silence_due_at, rule, starting_data, operations, and wait. That row is the current flow run. server.ts passes createPostgresEntities(pool) as entities."},{heading:"postgres-and-clickhouse",content:"createMetricPublisher appends each metric to the Redis stream metrics on the shared Redis client. That client also writes dispatch tokens. LoopsService calls startMetricFlush and createRedisResultBus each with redis.duplicate(). A blocking read on metrics does not stall step-results, and the reverse does not stall the shared client. startMetricFlush inserts flow rows with insertFlowMetrics into flow_run_metrics and step rows with insertStepMetrics into step_run_metrics. onApplicationShutdown calls quit() on those two duplicated clients."},{heading:"postgres-and-clickhouse",content:"flowsFor sets the list entities from countEntities and running from countRunning. mergeFlows copies each flow's entities and running from countsByFlow, and includes every flow registered in deps.flows even when that flow has no entity and no run. Those three methods count rows in entities. countRunning and the running column keep status = 'running'. mergeFlows fills runs, success, failure, and notFinished from flowOutcomes, p50Ms from flowDurations, and trend from flowTrend. flowsFor sets failureRate to failure / runs when runs is not 0. createMetricsReader reads the outcome, duration, and trend queries from flow_runs_hourly. flowFor reads that flow's entities and running from countsByFlow, sets failureRate to failure / runs when runs is not 0, fills series from flowSeries, reads step rows from stepCounts on step_runs_hourly, and reads reasons from reasons_daily."},{heading:"the-flows-screen",content:"createReadServer in apps/orchestrator/src/http.ts handles GET. Any other method is status 405. GET /organizations/:organizationId/flows calls flowsFor after metricRange. GET /organizations/:organizationId/flows/:flow calls flowFor. The resolver in server.ts returns the text after Bearer . POST /organizations/:organizationId/flows/:flow on ReadController calls openFlow, which calls startRun."},{heading:"the-flows-screen",content:'FlowsPage in apps/console/src/app/organizations/[organizationId]/flows/page.tsx calls currentPerson and renders SignedOutView when that person is missing. It loads the list with readOrchestrator at /organizations/${organizationId}/flows?range=${range} and renders FlowsRoute inside ConsoleFrame with active="flows". The nav item labeled Flows in ConsoleFrame pushes `/organizations/${organizationId}/flows`.'},{heading:"the-flows-screen",content:"FlowsView shows the title Flows, stats for Entities, Flow runs, Failure rate, and Running now, and one table row per flow. FlowsRoute sends onOpen to `/organizations/${organizationId}/flows/${flow}?range=${range}`. FlowPage loads that path with readOrchestrator and calls notFound() when the load fails. The detail view shows the flow name, flow runs, step runs, failure rate, p50, Running now, the outcome series, the step table, and the reason list. The Start button opens a dialog for the identity and the payload. startFlow in apps/console/src/app/organizations/[organizationId]/flows/actions.ts posts that body to POST /organizations/:organizationId/flows/:flow. openFlow calls startRun with silence duration 60_000, resend maximum 1, and the rule from the flow definition. flowRange returns 24h, 7d, or 30d, and returns 24h for any other query value."},{heading:"getting-started",content:'In organizations/fixture/src/perf/, add a FlowFunction next to paceFlow, loadFlow, stallFlow, faultFlow, softenFlow, asideFlow, nestFlow, and broodFlow. Call openStep, openOptionalStep, openDetachedStep, openChildren, or finish the way those flows do. paceFlow calls openStep(dwellStep) and openStep("mark"). softenFlow calls openOptionalStep(missStep). asideFlow calls openDetachedStep(stallStep). nestFlow calls openChildren(nestMidFlow, asChildren(sprouted.body)). broodFlow calls openChildren(broodChildFlow, asChildren(opened.body)). waitGroup, choose, and fail are on FlowContext. Append the flow to flows in organizations/fixture/src/index.ts. fixtureFlows is that list.'},{heading:"getting-started",content:"Register the function with defineFlow, which sets name, entityType, validityDurationMs, source, and run, and append that value to flows. Register each step implementation on the steps array in organizations/fixture/src/steps.ts. bindOrganization writes `${flow}/${step}` and sets the kind to `fixture-${step.name}`."},{heading:"getting-started",content:"Copy .env.example to .env in the repository root. loadRootEnv in apps/orchestrator/src/env.ts reads that file. requiredEnv reads DATABASE_URL, REDIS_URL, and CLICKHOUSE_URL, and throws ${name} is required when one is missing. Start the orchestrator Postgres with npx supabase start. Start Redis and ClickHouse with docker compose up -d redis clickhouse. The redis and clickhouse services are the ones in docker-compose.yml. Run npx supabase status and set NEXT_PUBLIC_SUPABASE_ANON_KEY in .env to the anon key it prints. supabaseAnonKey in apps/console/src/lib/supabase-env.ts drops an empty value, and LoginPage then renders SignInForm with configured={false}."},{heading:"getting-started",content:'Run pnpm --filter cue-orchestrator serve. The serve script in apps/orchestrator/package.json runs tsx src/server.ts. server.ts calls openFixtureService with fixtureFlows and fixtureSteps, then server.listen(3001, "0.0.0.0"). It does not call startRun. The log line is orchestrator http://127.0.0.1:3001.'},{heading:"getting-started",content:"In a second terminal, run pnpm --filter @ascentstudio/cue-org-fixture work. The work script in organizations/fixture/package.json runs tsx src/work.ts. work.ts loads the organization's secrets once with readOrganizationSecrets and installEnvironment, then calls createStepWorker. Each job calls consumeAssignment. consumeAssignment publishes the step result, the orchestrator applies it, and settle pushes a FlowMetric when it records success, failure, or not_finished. startMetricFlush in the orchestrator process inserts that metric into ClickHouse. The log line from work.ts is fixture workers plus the kind names. bindOrganization names fixture-dwell, fixture-stall, fixture-miss, fixture-sprout, and fixture-brood."},{heading:"getting-started",content:"In a third terminal, run pnpm --dir organizations/fixture seed. The seed script in organizations/fixture/package.json runs cue seed. The fixture does not export catalogSeed, so the command opens nothing and the log line is seeded fixture 0 runs. Load runs start with pnpm --dir organizations/fixture perf, pnpm --dir organizations/fixture perf:load, pnpm --dir organizations/fixture perf:brood, or pnpm --dir organizations/fixture perf:brood:producer. To remove runs an organization left behind, run pnpm --dir organizations/fixture reset. resetOrganization deletes rows from entity_links and entities on the orchestrator database, drains the kind queues, and deletes that organization's metrics. The log line is reset fixture. organizations, memberships, secrets, and the person in deploy/supabase/seed.sql stay."},{heading:"getting-started",content:"In a fourth terminal, run pnpm --filter cue-console dev. The dev script in apps/console/package.json runs next dev. Open the URL that command prints, at /login. LoginForm calls signInWithPassword for the Sign in button. The person inserted in deploy/supabase/seed.sql has email pierre@ascent-studio.fr, and the comment there says the password is that same string. on_auth_user_created calls join_fixture, which inserts a membership for organization fixture. After sign-in, LoginForm pushes /. Open /organizations/fixture/flows. FlowsPage renders FlowsView with the title Flows. Click a row. FlowsRoute opens /organizations/fixture/flows/ plus that flow name. Press Start, enter the identity and the payload, and the console opens /entities/ plus the organization, the flow, and the identity."}],headings:[{id:"why",content:"Why"},{id:"who",content:"Who"},{id:"how",content:"How"},{id:"the-function",content:"The function"},{id:"openings",content:"Openings"},{id:"groups-children-and-choice",content:"Groups, children, and choice"},{id:"registration-and-the-step-implementation",content:"Registration and the step implementation"},{id:"the-run",content:"The run"},{id:"transient-files",content:"Transient files"},{id:"postgres-and-clickhouse",content:"Postgres and ClickHouse"},{id:"the-flows-screen",content:"The Flows screen"},{id:"getting-started",content:"Getting started"}]},ad=[{depth:2,url:"#why",title:(0,V.jsx)(V.Fragment,{children:"Why"})},{depth:2,url:"#who",title:(0,V.jsx)(V.Fragment,{children:"Who"})},{depth:2,url:"#how",title:(0,V.jsx)(V.Fragment,{children:"How"})},{depth:3,url:"#the-function",title:(0,V.jsx)(V.Fragment,{children:"The function"})},{depth:3,url:"#openings",title:(0,V.jsx)(V.Fragment,{children:"Openings"})},{depth:3,url:"#groups-children-and-choice",title:(0,V.jsx)(V.Fragment,{children:"Groups, children, and choice"})},{depth:3,url:"#registration-and-the-step-implementation",title:(0,V.jsx)(V.Fragment,{children:"Registration and the step implementation"})},{depth:3,url:"#the-run",title:(0,V.jsx)(V.Fragment,{children:"The run"})},{depth:3,url:"#transient-files",title:(0,V.jsx)(V.Fragment,{children:"Transient files"})},{depth:3,url:"#postgres-and-clickhouse",title:(0,V.jsx)(V.Fragment,{children:"Postgres and ClickHouse"})},{depth:3,url:"#the-flows-screen",title:(0,V.jsx)(V.Fragment,{children:"The Flows screen"})},{depth:2,url:"#getting-started",title:(0,V.jsx)(V.Fragment,{children:"Getting started"})}];function ae(a){let b={code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h2,{id:"why",children:"Why"}),"\n",(0,V.jsx)(b.p,{children:"A flow is the restricted function that describes what an entity does, with one validity duration for every entity of that flow. A step is an opening in that function. The step implementation is the code outside the flow that performs the step."}),"\n",(0,V.jsx)(b.p,{children:"The current flow run stays available for the next reread. A flow metric is the retained end of a finished flow run. A step metric is the retained end of a finished step run. A person reads those ends over a period. A running flow run is not a metric."}),"\n",(0,V.jsx)(b.h2,{id:"who",children:"Who"}),"\n",(0,V.jsxs)(b.p,{children:["You write a flow when you add one to an organization. ",(0,V.jsx)(b.code,{children:"flows"})," and ",(0,V.jsx)(b.code,{children:"fixtureFlows"})," in ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/index.ts"}),", and ",(0,V.jsx)(b.code,{children:"fixtureSteps"})," in ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/steps.ts"}),", are the registrations to copy."]}),"\n",(0,V.jsx)(b.p,{children:"A person reads Flows in the console. A person can open the first entity of a flow, replay a flow, replay from a step, resend a job, run a step without applying its result, cancel a run or an open step, and end a validity. The first opening is that request: an open run waits, and inside the validity duration the recorded result is returned. On a stored flow run the console lists that run's transient files."}),"\n",(0,V.jsx)(b.h2,{id:"how",children:"How"}),"\n",(0,V.jsx)(b.p,{children:"You meet the function, then the openings it calls, then the registration, then the run the orchestrator keeps, then the Flows screen."}),"\n",(0,V.jsx)(b.h3,{id:"the-function",children:"The function"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"FlowFunction"})," in ",(0,V.jsx)(b.code,{children:"packages/contract/src/index.ts"})," is ",(0,V.jsx)(b.code,{children:"(ctx: FlowContext) => void"}),". ",(0,V.jsx)(b.code,{children:"paceFlow"}),", ",(0,V.jsx)(b.code,{children:"loadFlow"}),", ",(0,V.jsx)(b.code,{children:"stallFlow"}),", ",(0,V.jsx)(b.code,{children:"faultFlow"}),", ",(0,V.jsx)(b.code,{children:"softenFlow"}),", ",(0,V.jsx)(b.code,{children:"asideFlow"}),", ",(0,V.jsx)(b.code,{children:"nestFlow"}),", and ",(0,V.jsx)(b.code,{children:"broodFlow"})," are that function. ",(0,V.jsx)(b.code,{children:"defineFlow"})," stores each one as ",(0,V.jsx)(b.code,{children:"run"}),". ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/index.ts"})," lists them on ",(0,V.jsx)(b.code,{children:"flows"}),", and ",(0,V.jsx)(b.code,{children:"fixtureFlows"})," is that list. ",(0,V.jsx)(b.code,{children:"nestMidFlow"}),", ",(0,V.jsx)(b.code,{children:"nestLeafFlow"}),", and ",(0,V.jsx)(b.code,{children:"broodChildFlow"})," are the child runs those parents open."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"reread"})," in ",(0,V.jsx)(b.code,{children:"packages/engine/src/engine.ts"})," calls ",(0,V.jsx)(b.code,{children:"definition.run"})," from the first opening, on the operations already stored. ",(0,V.jsx)(b.code,{children:"openTrackedStep"})," keeps an opening whose ",(0,V.jsx)(b.code,{children:"step"})," and ",(0,V.jsx)(b.code,{children:"mode"})," already match. It throws ",(0,V.jsx)(b.code,{children:"`Reread diverged at ${step}`"})," when they do not."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"FlowContext"})," exposes ",(0,V.jsx)(b.code,{children:"values"}),", ",(0,V.jsx)(b.code,{children:"openStep"}),", ",(0,V.jsx)(b.code,{children:"openOptionalStep"}),", ",(0,V.jsx)(b.code,{children:"openDetachedStep"}),", ",(0,V.jsx)(b.code,{children:"openChildren"}),", ",(0,V.jsx)(b.code,{children:"waitGroup"}),", ",(0,V.jsx)(b.code,{children:"choose"}),", ",(0,V.jsx)(b.code,{children:"finish"}),", and ",(0,V.jsx)(b.code,{children:"fail"}),". ",(0,V.jsx)(b.code,{children:"values"})," is the copy taken when the run opened. The other methods take a step name, a flow name, elements, a group callback, a choice, or nothing. ",(0,V.jsx)(b.code,{children:"consumeAssignment"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/consume.ts"})," passes starting data, current values, files, and ",(0,V.jsx)(b.code,{children:"at"})," to ",(0,V.jsx)(b.code,{children:"implementation.run"}),". The worker loaded secrets into the environment with ",(0,V.jsx)(b.code,{children:"installEnvironment"})," before it started."]}),"\n",(0,V.jsx)(b.h3,{id:"openings",children:"Openings"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"paceFlow"})," calls ",(0,V.jsx)(b.code,{children:"ctx.openStep(dwellStep)"}),", then ",(0,V.jsx)(b.code,{children:'ctx.openStep("mark")'}),". ",(0,V.jsx)(b.code,{children:"loadFlow"})," calls ",(0,V.jsx)(b.code,{children:"ctx.openStep(dwellStep)"}),". ",(0,V.jsx)(b.code,{children:"asideFlow"})," calls ",(0,V.jsx)(b.code,{children:"ctx.openDetachedStep(stallStep)"}),", then ",(0,V.jsx)(b.code,{children:"ctx.openStep(dwellStep)"}),". The string ",(0,V.jsx)(b.code,{children:'"mark"'})," is that step name. ",(0,V.jsx)(b.code,{children:"dwellStep"})," declares ",(0,V.jsx)(b.code,{children:"dwell"}),", and ",(0,V.jsx)(b.code,{children:"names"})," includes ",(0,V.jsx)(b.code,{children:"mark"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"openStep"})," calls ",(0,V.jsx)(b.code,{children:"openTrackedStep"})," with opening ",(0,V.jsx)(b.code,{children:"required"}),". The first call builds the step with ",(0,V.jsx)(b.code,{children:"createStep"}),", pushes ",(0,V.jsx)(b.code,{children:"jobFor"}),", sets ",(0,V.jsx)(b.code,{children:"run.wait"})," to ",(0,V.jsx)(b.code,{children:'{ kind: "step", step }'}),", and throws ",(0,V.jsx)(b.code,{children:"SuspendSignal"}),". The next ",(0,V.jsx)(b.code,{children:"reread"})," returns ",(0,V.jsx)(b.code,{children:"frame.result"})," once ",(0,V.jsx)(b.code,{children:"frame.result"})," is set. A required result whose status is ",(0,V.jsx)(b.code,{children:"failed"})," ends the run in failure and does not open the next step. A required result whose status is ",(0,V.jsx)(b.code,{children:"not_finished"})," ends the run not finished. After ",(0,V.jsx)(b.code,{children:"definition.run"})," returns, or after ",(0,V.jsx)(b.code,{children:"FinishSignal"}),", ",(0,V.jsx)(b.code,{children:"reread"})," calls ",(0,V.jsx)(b.code,{children:"settle"})," with ",(0,V.jsx)(b.code,{children:"success"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"openDetachedStep"})," calls ",(0,V.jsx)(b.code,{children:"openDetached"}),". The first call pushes ",(0,V.jsx)(b.code,{children:"jobFor"})," and returns without ",(0,V.jsx)(b.code,{children:"SuspendSignal"}),". ",(0,V.jsx)(b.code,{children:"acceptResult"})," writes ",(0,V.jsx)(b.code,{children:"frame.result"})," and, on the first end, calls ",(0,V.jsx)(b.code,{children:"pushStep"}),". When ",(0,V.jsx)(b.code,{children:"frame.mode"})," is ",(0,V.jsx)(b.code,{children:"detached"})," and ",(0,V.jsx)(b.code,{children:"entity.run.status"})," is anything other than ",(0,V.jsx)(b.code,{children:"running"}),", ",(0,V.jsx)(b.code,{children:"acceptResult"})," returns ",(0,V.jsx)(b.code,{children:"taken([])"})," and skips ",(0,V.jsx)(b.code,{children:"drive"}),". The step metric from that first ",(0,V.jsx)(b.code,{children:"pushStep"})," is in the transition ",(0,V.jsx)(b.code,{children:"taken"})," returns."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"softenFlow"})," calls ",(0,V.jsx)(b.code,{children:"ctx.openOptionalStep(missStep)"}),". That call uses ",(0,V.jsx)(b.code,{children:"openTrackedStep"})," with opening ",(0,V.jsx)(b.code,{children:"optional"}),". It waits for ",(0,V.jsx)(b.code,{children:"frame.result"})," the same way as ",(0,V.jsx)(b.code,{children:"openStep"}),". A failed or not finished optional result does not stop the run."]}),"\n",(0,V.jsx)(b.h3,{id:"groups-children-and-choice",children:"Groups, children, and choice"}),"\n",(0,V.jsxs)(b.p,{children:["On a new group, ",(0,V.jsx)(b.code,{children:"waitGroup"})," stores ",(0,V.jsx)(b.code,{children:'rule: { form: "all" }'}),", then calls ",(0,V.jsx)(b.code,{children:"define"}),". ",(0,V.jsx)(b.code,{children:"sealGroup"})," seals the report when ",(0,V.jsx)(b.code,{children:"judgeRule"})," returns success. A failure or a not finished judgment closes the still-open required and optional steps and stops the run. Until then ",(0,V.jsx)(b.code,{children:"waitGroup"})," sets ",(0,V.jsx)(b.code,{children:"run.wait"})," to ",(0,V.jsx)(b.code,{children:'{ kind: "group", rule: frame.rule }'})," and throws ",(0,V.jsx)(b.code,{children:"SuspendSignal"}),". The call returns ",(0,V.jsx)(b.code,{children:"frame.sealed"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"takeStep"})," records ",(0,V.jsx)(b.code,{children:"optional"})," or ",(0,V.jsx)(b.code,{children:"required"})," and pushes ",(0,V.jsx)(b.code,{children:"jobFor"})," for a new member that is still live. The group rule counts a required step whose result status is ",(0,V.jsx)(b.code,{children:"done"}),", and a child run whose status is ",(0,V.jsx)(b.code,{children:"success"}),". An optional step does not count. ",(0,V.jsx)(b.code,{children:"GroupContext.openStep"})," and ",(0,V.jsx)(b.code,{children:"GroupContext.openOptionalStep"})," return nothing."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"nestFlow"})," calls ",(0,V.jsx)(b.code,{children:"ctx.openChildren(nestMidFlow, asChildren(sprouted.body))"}),". ",(0,V.jsx)(b.code,{children:"nestMidFlow"})," calls ",(0,V.jsx)(b.code,{children:"ctx.openChildren(nestLeafFlow, asChildren(sprouted.body))"}),". ",(0,V.jsx)(b.code,{children:"broodFlow"})," calls ",(0,V.jsx)(b.code,{children:"ctx.openChildren(broodChildFlow, asChildren(opened.body))"}),". The first argument is the flow. ",(0,V.jsx)(b.code,{children:"takeChildren"})," stores it as ",(0,V.jsx)(b.code,{children:"member.flow"}),". ",(0,V.jsx)(b.code,{children:"GroupContext"})," in ",(0,V.jsx)(b.code,{children:"packages/contract/src/index.ts"})," types that parameter as ",(0,V.jsx)(b.code,{children:"flow: FlowName"}),". A child member with no identities counts as done."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"FlowContext.openChildren"})," and ",(0,V.jsx)(b.code,{children:"openOptionalChildren"})," take ",(0,V.jsx)(b.code,{children:"flow"})," as a ",(0,V.jsx)(b.code,{children:"FlowName"})," and ",(0,V.jsx)(b.code,{children:"elements"})," as one ",(0,V.jsx)(b.code,{children:"ChildElement"})," or a readonly list. Each element has ",(0,V.jsx)(b.code,{children:"identifier"})," and ",(0,V.jsx)(b.code,{children:"startingData"}),". On the context from ",(0,V.jsx)(b.code,{children:"contextFor"}),", one child waits while ",(0,V.jsx)(b.code,{children:"child.run.status"})," is ",(0,V.jsx)(b.code,{children:"running"})," and then returns ",(0,V.jsx)(b.code,{children:"resultFrom(child)"}),", including that child's finish body. A failed required child ends the parent in failure. A not finished required child ends the parent not finished. An optional child does not stop the parent. When the argument is a list, ",(0,V.jsx)(b.code,{children:"childCall"})," stores ",(0,V.jsx)(b.code,{children:"normalizeChildrenRule"})," of the call's ",(0,V.jsx)(b.code,{children:"rule"}),", or ",(0,V.jsx)(b.code,{children:'{ form: "all" }'})," when the call omits it. The same rule is accepted on both openings. ",(0,V.jsx)(b.code,{children:"withinMin"})," stores ",(0,V.jsx)(b.code,{children:"openedAt"})," on the first opening. ",(0,V.jsx)(b.code,{children:"sealChildren"})," calls ",(0,V.jsx)(b.code,{children:"judgeChildren"}),". A required miss stops the parent. An optional miss seals the report and the parent continues. An empty list records the opening and returns a sealed report. ",(0,V.jsx)(b.code,{children:"nestFlow"}),", ",(0,V.jsx)(b.code,{children:"nestMidFlow"}),", and ",(0,V.jsx)(b.code,{children:"broodFlow"})," open child flows with ",(0,V.jsx)(b.code,{children:"openChildren"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"uniqueElements"})," keeps the first element of each ",(0,V.jsx)(b.code,{children:"identity"}),". ",(0,V.jsx)(b.code,{children:"ensureChild"})," calls ",(0,V.jsx)(b.code,{children:"begin"})," when the child is missing. When ",(0,V.jsx)(b.code,{children:"restart"})," is true and the child is not ",(0,V.jsx)(b.code,{children:"running"}),", it calls ",(0,V.jsx)(b.code,{children:"begin"})," again unless the run is ",(0,V.jsx)(b.code,{children:"success"})," and ",(0,V.jsx)(b.code,{children:"now"})," is still within ",(0,V.jsx)(b.code,{children:"validityEndsAt"}),". The flow ",(0,V.jsx)(b.code,{children:"openChildren"})," passes ",(0,V.jsx)(b.code,{children:"restart"})," as ",(0,V.jsx)(b.code,{children:"!isReread"}),". ",(0,V.jsx)(b.code,{children:"entityId"})," in ",(0,V.jsx)(b.code,{children:"packages/contract/src/index.ts"})," returns ",(0,V.jsx)(b.code,{children:"`${organization}/${flow}/${identity}`"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"choose"})," stores the arms in the order of ",(0,V.jsx)(b.code,{children:"arm.name"}),". It runs every arm whose name differs from ",(0,V.jsx)(b.code,{children:"taken"})," under ",(0,V.jsx)(b.code,{children:'contextFor(..., "discarded")'}),", then runs the taken arm under ",(0,V.jsx)(b.code,{children:'"live"'}),". A discarded opening is ",(0,V.jsx)(b.code,{children:"discardedStep"}),", with ",(0,V.jsx)(b.code,{children:"discarded: true"})," and no ",(0,V.jsx)(b.code,{children:"jobs.push"}),". ",(0,V.jsx)(b.code,{children:"acceptResult"})," returns ",(0,V.jsx)(b.code,{children:"taken([])"})," when ",(0,V.jsx)(b.code,{children:"findStep"})," misses the step and ",(0,V.jsx)(b.code,{children:"findDiscardedStep"})," finds it. Duplicate arm names, or a ",(0,V.jsx)(b.code,{children:"taken"})," value absent from those names, throw ",(0,V.jsx)(b.code,{children:"Reread diverged at a choice"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"paceFlow"}),", ",(0,V.jsx)(b.code,{children:"loadFlow"}),", ",(0,V.jsx)(b.code,{children:"softenFlow"}),", ",(0,V.jsx)(b.code,{children:"asideFlow"}),", ",(0,V.jsx)(b.code,{children:"nestFlow"}),", ",(0,V.jsx)(b.code,{children:"nestMidFlow"}),", ",(0,V.jsx)(b.code,{children:"nestLeafFlow"}),", ",(0,V.jsx)(b.code,{children:"broodFlow"}),", and ",(0,V.jsx)(b.code,{children:"broodChildFlow"})," call ",(0,V.jsx)(b.code,{children:"ctx.finish()"}),". ",(0,V.jsx)(b.code,{children:"stallFlow"})," and ",(0,V.jsx)(b.code,{children:"faultFlow"})," open one required step and do not call ",(0,V.jsx)(b.code,{children:"finish()"}),". ",(0,V.jsx)(b.code,{children:"finish"})," throws ",(0,V.jsx)(b.code,{children:"FinishSignal"})," in live mode, and the ",(0,V.jsx)(b.code,{children:"catch"})," in ",(0,V.jsx)(b.code,{children:"reread"})," calls ",(0,V.jsx)(b.code,{children:"settleReachedEnd"}),", the same close as a normal return. ",(0,V.jsx)(b.code,{children:"fail"})," throws ",(0,V.jsx)(b.code,{children:"FailSignal"}),", and that ",(0,V.jsx)(b.code,{children:"catch"})," calls ",(0,V.jsx)(b.code,{children:"settle"})," with ",(0,V.jsx)(b.code,{children:"failure"}),". None of these flows call ",(0,V.jsx)(b.code,{children:"fail()"}),"."]}),"\n",(0,V.jsx)(b.h3,{id:"registration-and-the-step-implementation",children:"Registration and the step implementation"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"defineFlow"})," returns the flow with ",(0,V.jsx)(b.code,{children:"name"}),", ",(0,V.jsx)(b.code,{children:"entityType"}),", ",(0,V.jsx)(b.code,{children:"validityDurationMs"}),", ",(0,V.jsx)(b.code,{children:"source"}),", and ",(0,V.jsx)(b.code,{children:"run"}),". Each fixture flow sets ",(0,V.jsx)(b.code,{children:"validityDurationMs"})," to null and ",(0,V.jsx)(b.code,{children:"entityType"})," to its name. ",(0,V.jsx)(b.code,{children:"fixtureFlows"})," holds ",(0,V.jsx)(b.code,{children:"pace"}),", ",(0,V.jsx)(b.code,{children:"load"}),", ",(0,V.jsx)(b.code,{children:"stall"}),", ",(0,V.jsx)(b.code,{children:"fault"}),", ",(0,V.jsx)(b.code,{children:"soften"}),", ",(0,V.jsx)(b.code,{children:"aside"}),", ",(0,V.jsx)(b.code,{children:"nest"}),", ",(0,V.jsx)(b.code,{children:"nest-mid"}),", ",(0,V.jsx)(b.code,{children:"nest-leaf"}),", ",(0,V.jsx)(b.code,{children:"brood"}),", and ",(0,V.jsx)(b.code,{children:"brood-child"}),". ",(0,V.jsx)(b.code,{children:"createRegistry"})," throws ",(0,V.jsx)(b.code,{children:"`Unknown flow ${name}`"})," from ",(0,V.jsx)(b.code,{children:"get"})," when a name is missing. ",(0,V.jsx)(b.code,{children:"ensureChild"})," calls ",(0,V.jsx)(b.code,{children:"registry.get(flowName)"})," for the child flow."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"bindOrganization"})," in ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/steps.ts"})," binds each step onto every flow. The kind is ",(0,V.jsx)(b.code,{children:"fixture-"})," plus the step name: ",(0,V.jsx)(b.code,{children:"fixture-dwell"}),", ",(0,V.jsx)(b.code,{children:"fixture-stall"}),", ",(0,V.jsx)(b.code,{children:"fixture-miss"}),", ",(0,V.jsx)(b.code,{children:"fixture-sprout"}),", and ",(0,V.jsx)(b.code,{children:"fixture-brood"}),". ",(0,V.jsx)(b.code,{children:"fixtureSteps"})," stores each bound step under ",(0,V.jsx)(b.code,{children:"flow/step"}),". ",(0,V.jsx)(b.code,{children:"dwell"})," also answers ",(0,V.jsx)(b.code,{children:"mark"})," and ",(0,V.jsx)(b.code,{children:"pass-1"})," through ",(0,V.jsx)(b.code,{children:"pass-10"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"dwell"})," waits the configured milliseconds, then returns done. ",(0,V.jsx)(b.code,{children:"stall"})," throws ",(0,V.jsx)(b.code,{children:"StepHeld"}),". ",(0,V.jsx)(b.code,{children:"miss"})," returns ",(0,V.jsx)(b.code,{children:'{ kind: "result", status: "failed", discriminant: "failed" }'}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"runJob"})," loads the bound step with ",(0,V.jsx)(b.code,{children:"stepBinding"}),". A thrown ",(0,V.jsx)(b.code,{children:"StepHeld"})," returns before ",(0,V.jsx)(b.code,{children:"acceptResult"}),". When ",(0,V.jsx)(b.code,{children:"implementation.run"})," throws and ",(0,V.jsx)(b.code,{children:"openingFor"})," is ",(0,V.jsx)(b.code,{children:"optional"})," or ",(0,V.jsx)(b.code,{children:"detached"}),", ",(0,V.jsx)(b.code,{children:"runJob"})," sends ",(0,V.jsx)(b.code,{children:'{ kind: "result", status: "failed", discriminant: "failed" }'})," to ",(0,V.jsx)(b.code,{children:"acceptResult"}),". Any other thrown error is rethrown."]}),"\n",(0,V.jsx)(b.h3,{id:"the-run",children:"The run"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"apps/orchestrator/src/server.ts"})," calls ",(0,V.jsx)(b.code,{children:"openFixtureService"})," with ",(0,V.jsx)(b.code,{children:"createMemoryClient"})," and ",(0,V.jsx)(b.code,{children:"watchWorkers: true"}),". That opens ",(0,V.jsx)(b.code,{children:"createService"})," with ",(0,V.jsx)(b.code,{children:"flows: fixtureFlows"}),", ",(0,V.jsx)(b.code,{children:"steps: fixtureSteps"}),", ",(0,V.jsx)(b.code,{children:"entities: createPostgresEntities(pool)"}),", ",(0,V.jsx)(b.code,{children:"metrics: createMetricPublisher(redis)"}),", and ",(0,V.jsx)(b.code,{children:"metricReads: createMetricsReader(clickhouse)"}),". ",(0,V.jsx)(b.code,{children:"server.ts"})," does not call ",(0,V.jsx)(b.code,{children:"startRun"}),". ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture seed"})," calls ",(0,V.jsx)(b.code,{children:"seedOrganization"})," only when the organization exports ",(0,V.jsx)(b.code,{children:"catalogSeed"}),". The fixture does not, so that command starts no run and opens no client database. The log line is ",(0,V.jsx)(b.code,{children:"seeded fixture 0 runs"}),". ",(0,V.jsx)(b.code,{children:"startRun"})," writes a run into the orchestrator database."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"startRun"})," loads the row with ",(0,V.jsx)(b.code,{children:"loadFocus"}),", calls ",(0,V.jsx)(b.code,{children:"engine.request"}),", then ",(0,V.jsx)(b.code,{children:"persist"}),", then ",(0,V.jsx)(b.code,{children:"afterCommit"}),". ",(0,V.jsx)(b.code,{children:"request"})," addresses the entity with ",(0,V.jsx)(b.code,{children:"entityId"}),". A run whose ",(0,V.jsx)(b.code,{children:"status"})," is ",(0,V.jsx)(b.code,{children:"running"})," returns ",(0,V.jsx)(b.code,{children:'{ kind: "waiting" }'}),". A ",(0,V.jsx)(b.code,{children:"success"})," run with ",(0,V.jsx)(b.code,{children:"finishedAt"})," and ",(0,V.jsx)(b.code,{children:"validityEndsAt"})," set, and ",(0,V.jsx)(b.code,{children:"input.at"})," at or before that instant, returns ",(0,V.jsx)(b.code,{children:'{ kind: "recorded" }'}),". Every other request goes through ",(0,V.jsx)(b.code,{children:"begin"}),". ",(0,V.jsx)(b.code,{children:"begin"})," adds one to ",(0,V.jsx)(b.code,{children:"generation"}),", sets ",(0,V.jsx)(b.code,{children:"run.status"})," to ",(0,V.jsx)(b.code,{children:"running"}),", copies ",(0,V.jsx)(b.code,{children:"input.startingData"}),", clears ",(0,V.jsx)(b.code,{children:"validityEndsAt"}),", and calls ",(0,V.jsx)(b.code,{children:"drive"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"drive"})," calls ",(0,V.jsx)(b.code,{children:"applySilence"}),", then ",(0,V.jsx)(b.code,{children:"reread"}),". ",(0,V.jsx)(b.code,{children:"applySilence"})," pushes ",(0,V.jsx)(b.code,{children:"jobFor"})," while the step has no result, ",(0,V.jsx)(b.code,{children:"now"})," is at or after ",(0,V.jsx)(b.code,{children:"silenceDueAt"}),", and ",(0,V.jsx)(b.code,{children:"resendCount"})," is still under ",(0,V.jsx)(b.code,{children:"maxResends"}),". At ",(0,V.jsx)(b.code,{children:"maxResends"})," it writes status ",(0,V.jsx)(b.code,{children:"not_finished"})," and calls ",(0,V.jsx)(b.code,{children:"pushStep"}),". ",(0,V.jsx)(b.code,{children:"Service.advance"})," calls ",(0,V.jsx)(b.code,{children:"engine.advance"})," for each batch from ",(0,V.jsx)(b.code,{children:"session.due"}),". ",(0,V.jsx)(b.code,{children:"due"})," in ",(0,V.jsx)(b.code,{children:"createPostgresEntities"})," selects ",(0,V.jsx)(b.code,{children:"status = 'running' and silence_due_at <= $1"}),". ",(0,V.jsx)(b.code,{children:"server.ts"})," reaches the engine through ",(0,V.jsx)(b.code,{children:"openFixtureService"}),", and it also calls ",(0,V.jsx)(b.code,{children:"startMetricFlush"}),", ",(0,V.jsx)(b.code,{children:"createReadServer"}),", and ",(0,V.jsx)(b.code,{children:"server.listen"}),". ",(0,V.jsx)(b.code,{children:"seedOrganization"})," is the ",(0,V.jsx)(b.code,{children:"startRun"})," for an exported ",(0,V.jsx)(b.code,{children:"catalogSeed"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"afterCommit"})," calls ",(0,V.jsx)(b.code,{children:"enqueueStep"})," for each job and ",(0,V.jsx)(b.code,{children:"metrics.publish"})," with ",(0,V.jsx)(b.code,{children:"flowMetrics"})," and ",(0,V.jsx)(b.code,{children:"stepMetrics"}),". ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/work.ts"})," starts ",(0,V.jsx)(b.code,{children:"createStepWorker"})," for each kind. Each job calls ",(0,V.jsx)(b.code,{children:"consumeAssignment"}),". The orchestrator applies the published result and calls ",(0,V.jsx)(b.code,{children:"engine.acceptResult"})," inside ",(0,V.jsx)(b.code,{children:"deps.entities.transaction"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"settle"})," returns at once when ",(0,V.jsx)(b.code,{children:"entity.run.status"})," is not ",(0,V.jsx)(b.code,{children:"running"}),". Otherwise it sets ",(0,V.jsx)(b.code,{children:"status"})," and ",(0,V.jsx)(b.code,{children:"finishedAt"}),", clears ",(0,V.jsx)(b.code,{children:"wait"}),", and pushes one ",(0,V.jsx)(b.code,{children:"FlowMetric"})," with that ",(0,V.jsx)(b.code,{children:"outcome"}),", the run ",(0,V.jsx)(b.code,{children:"generation"}),", and ",(0,V.jsx)(b.code,{children:"durationMs"}),". On ",(0,V.jsx)(b.code,{children:"success"}),", ",(0,V.jsx)(b.code,{children:"validityEndsAt"})," is ",(0,V.jsx)(b.code,{children:"addMs(now, validityDurationMs)"})," from ",(0,V.jsx)(b.code,{children:"registry.get(entity.flow)"}),". ",(0,V.jsx)(b.code,{children:"pushStep"})," pushes one ",(0,V.jsx)(b.code,{children:"StepMetric"})," when ",(0,V.jsx)(b.code,{children:"discarded"})," is unset and the step has ",(0,V.jsx)(b.code,{children:"openedAt"}),", ",(0,V.jsx)(b.code,{children:"endedAt"}),", and ",(0,V.jsx)(b.code,{children:"result"}),". When ",(0,V.jsx)(b.code,{children:"acceptResult"})," receives a worker id, that id is on the step metric. A silence ",(0,V.jsx)(b.code,{children:"not_finished"})," has no worker id. ",(0,V.jsx)(b.code,{children:"FlowMetric"})," and ",(0,V.jsx)(b.code,{children:"StepMetric"})," are declared in ",(0,V.jsx)(b.code,{children:"packages/contract/src/index.ts"}),"."]}),"\n",(0,V.jsx)(b.h3,{id:"transient-files",children:"Transient files"}),"\n",(0,V.jsxs)(b.p,{children:["A step writes a transient file with ",(0,V.jsx)(b.code,{children:"input.files.put"}),". The bytes live in the platform bucket under ",(0,V.jsx)(b.code,{children:"runs/{organization}/{flow}/{identifier}/{generation}/{name}"}),". ",(0,V.jsx)(b.code,{children:"consumeAssignment"})," records every name that ",(0,V.jsx)(b.code,{children:"put"})," wrote and stores that list on the step result. A replay from a step publishes a copy of each kept name into the new generation before the jobs of that generation are sent. A full replay does not copy. The flow run page in the console lists them. Reading a name still uses the current generation."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"listRun"})," on ",(0,V.jsx)(b.code,{children:"TransientFiles"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/transient-files.ts"})," returns ",(0,V.jsx)(b.code,{children:"{ name, bytes }[]"})," for that prefix, sorted by name. ",(0,V.jsx)(b.code,{children:"GET /entities/:id?files=1"})," on ",(0,V.jsx)(b.code,{children:"ReadController"})," calls ",(0,V.jsx)(b.code,{children:"listRunFilesFor"})," after ",(0,V.jsx)(b.code,{children:"parseFlowRunPath"})," and ",(0,V.jsx)(b.code,{children:"readGeneration"}),". The run must still be stored and the person must belong to that organization. ",(0,V.jsx)(b.code,{children:"GET /entities/:id?file={name}"})," returns the bytes with the stored content type. A name that is not one segment, or a missing file, is 404."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"EntityView"})," in ",(0,V.jsx)(b.code,{children:"apps/console/src/design/views.tsx"})," renders a ",(0,V.jsx)(b.code,{children:"DataTable"})," titled Files, empty copy ",(0,V.jsx)(b.code,{children:"No file."}),", page size 50. ",(0,V.jsx)(b.code,{children:"EntityScreen"})," loads that list with ",(0,V.jsx)(b.code,{children:"listRunFiles"})," and does not send ",(0,V.jsx)(b.code,{children:"files"})," on the 2s tree poll. A row opens a dialog: ",(0,V.jsx)(b.code,{children:"readRunFile"})," previews JSON or text under 1 MiB, and Download goes to ",(0,V.jsx)(b.code,{children:"GET /api/run-file"}),". After the flow run retention the run is gone and those files are gone."]}),"\n",(0,V.jsx)(b.h3,{id:"postgres-and-clickhouse",children:"Postgres and ClickHouse"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"persist"})," calls ",(0,V.jsx)(b.code,{children:"session.upsert"}),". ",(0,V.jsx)(b.code,{children:"createPostgresEntities"})," inserts the run into ",(0,V.jsx)(b.code,{children:"entities"})," and, on conflict of ",(0,V.jsx)(b.code,{children:"organization_id, flow, identity"}),", updates ",(0,V.jsx)(b.code,{children:"status"}),", ",(0,V.jsx)(b.code,{children:"generation"}),", ",(0,V.jsx)(b.code,{children:"started_at"}),", ",(0,V.jsx)(b.code,{children:"finished_at"}),", ",(0,V.jsx)(b.code,{children:"validity_ends_at"}),", ",(0,V.jsx)(b.code,{children:"silence_due_at"}),", ",(0,V.jsx)(b.code,{children:"rule"}),", ",(0,V.jsx)(b.code,{children:"starting_data"}),", ",(0,V.jsx)(b.code,{children:"operations"}),", and ",(0,V.jsx)(b.code,{children:"wait"}),". That row is the current flow run. ",(0,V.jsx)(b.code,{children:"server.ts"})," passes ",(0,V.jsx)(b.code,{children:"createPostgresEntities(pool)"})," as ",(0,V.jsx)(b.code,{children:"entities"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"createMetricPublisher"})," appends each metric to the Redis stream ",(0,V.jsx)(b.code,{children:"metrics"})," on the shared Redis client. That client also writes dispatch tokens. ",(0,V.jsx)(b.code,{children:"LoopsService"})," calls ",(0,V.jsx)(b.code,{children:"startMetricFlush"})," and ",(0,V.jsx)(b.code,{children:"createRedisResultBus"})," each with ",(0,V.jsx)(b.code,{children:"redis.duplicate()"}),". A blocking read on ",(0,V.jsx)(b.code,{children:"metrics"})," does not stall ",(0,V.jsx)(b.code,{children:"step-results"}),", and the reverse does not stall the shared client. ",(0,V.jsx)(b.code,{children:"startMetricFlush"})," inserts flow rows with ",(0,V.jsx)(b.code,{children:"insertFlowMetrics"})," into ",(0,V.jsx)(b.code,{children:"flow_run_metrics"})," and step rows with ",(0,V.jsx)(b.code,{children:"insertStepMetrics"})," into ",(0,V.jsx)(b.code,{children:"step_run_metrics"}),". ",(0,V.jsx)(b.code,{children:"onApplicationShutdown"})," calls ",(0,V.jsx)(b.code,{children:"quit()"})," on those two duplicated clients."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"flowsFor"})," sets the list ",(0,V.jsx)(b.code,{children:"entities"})," from ",(0,V.jsx)(b.code,{children:"countEntities"})," and ",(0,V.jsx)(b.code,{children:"running"})," from ",(0,V.jsx)(b.code,{children:"countRunning"}),". ",(0,V.jsx)(b.code,{children:"mergeFlows"})," copies each flow's ",(0,V.jsx)(b.code,{children:"entities"})," and ",(0,V.jsx)(b.code,{children:"running"})," from ",(0,V.jsx)(b.code,{children:"countsByFlow"}),", and includes every flow registered in ",(0,V.jsx)(b.code,{children:"deps.flows"})," even when that flow has no entity and no run. Those three methods count rows in ",(0,V.jsx)(b.code,{children:"entities"}),". ",(0,V.jsx)(b.code,{children:"countRunning"})," and the ",(0,V.jsx)(b.code,{children:"running"})," column keep ",(0,V.jsx)(b.code,{children:"status = 'running'"}),". ",(0,V.jsx)(b.code,{children:"mergeFlows"})," fills ",(0,V.jsx)(b.code,{children:"runs"}),", ",(0,V.jsx)(b.code,{children:"success"}),", ",(0,V.jsx)(b.code,{children:"failure"}),", and ",(0,V.jsx)(b.code,{children:"notFinished"})," from ",(0,V.jsx)(b.code,{children:"flowOutcomes"}),", ",(0,V.jsx)(b.code,{children:"p50Ms"})," from ",(0,V.jsx)(b.code,{children:"flowDurations"}),", and ",(0,V.jsx)(b.code,{children:"trend"})," from ",(0,V.jsx)(b.code,{children:"flowTrend"}),". ",(0,V.jsx)(b.code,{children:"flowsFor"})," sets ",(0,V.jsx)(b.code,{children:"failureRate"})," to ",(0,V.jsx)(b.code,{children:"failure / runs"})," when ",(0,V.jsx)(b.code,{children:"runs"})," is not ",(0,V.jsx)(b.code,{children:"0"}),". ",(0,V.jsx)(b.code,{children:"createMetricsReader"})," reads the outcome, duration, and trend queries from ",(0,V.jsx)(b.code,{children:"flow_runs_hourly"}),". ",(0,V.jsx)(b.code,{children:"flowFor"})," reads that flow's ",(0,V.jsx)(b.code,{children:"entities"})," and ",(0,V.jsx)(b.code,{children:"running"})," from ",(0,V.jsx)(b.code,{children:"countsByFlow"}),", sets ",(0,V.jsx)(b.code,{children:"failureRate"})," to ",(0,V.jsx)(b.code,{children:"failure / runs"})," when ",(0,V.jsx)(b.code,{children:"runs"})," is not ",(0,V.jsx)(b.code,{children:"0"}),", fills ",(0,V.jsx)(b.code,{children:"series"})," from ",(0,V.jsx)(b.code,{children:"flowSeries"}),", reads step rows from ",(0,V.jsx)(b.code,{children:"stepCounts"})," on ",(0,V.jsx)(b.code,{children:"step_runs_hourly"}),", and reads ",(0,V.jsx)(b.code,{children:"reasons"})," from ",(0,V.jsx)(b.code,{children:"reasons_daily"}),"."]}),"\n",(0,V.jsx)(b.h3,{id:"the-flows-screen",children:"The Flows screen"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"createReadServer"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/http.ts"})," handles ",(0,V.jsx)(b.code,{children:"GET"}),". Any other method is status ",(0,V.jsx)(b.code,{children:"405"}),". ",(0,V.jsx)(b.code,{children:"GET /organizations/:organizationId/flows"})," calls ",(0,V.jsx)(b.code,{children:"flowsFor"})," after ",(0,V.jsx)(b.code,{children:"metricRange"}),". ",(0,V.jsx)(b.code,{children:"GET /organizations/:organizationId/flows/:flow"})," calls ",(0,V.jsx)(b.code,{children:"flowFor"}),". The resolver in ",(0,V.jsx)(b.code,{children:"server.ts"})," returns the text after ",(0,V.jsx)(b.code,{children:"Bearer "}),". ",(0,V.jsx)(b.code,{children:"POST /organizations/:organizationId/flows/:flow"})," on ",(0,V.jsx)(b.code,{children:"ReadController"})," calls ",(0,V.jsx)(b.code,{children:"openFlow"}),", which calls ",(0,V.jsx)(b.code,{children:"startRun"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"FlowsPage"})," in ",(0,V.jsx)(b.code,{children:"apps/console/src/app/organizations/[organizationId]/flows/page.tsx"})," calls ",(0,V.jsx)(b.code,{children:"currentPerson"})," and renders ",(0,V.jsx)(b.code,{children:"SignedOutView"})," when that person is missing. It loads the list with ",(0,V.jsx)(b.code,{children:"readOrchestrator"})," at ",(0,V.jsx)(b.code,{children:"/organizations/${organizationId}/flows?range=${range}"})," and renders ",(0,V.jsx)(b.code,{children:"FlowsRoute"})," inside ",(0,V.jsx)(b.code,{children:"ConsoleFrame"})," with ",(0,V.jsx)(b.code,{children:'active="flows"'}),". The nav item labeled ",(0,V.jsx)(b.code,{children:"Flows"})," in ",(0,V.jsx)(b.code,{children:"ConsoleFrame"})," pushes ",(0,V.jsx)(b.code,{children:"`/organizations/${organizationId}/flows`"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"FlowsView"})," shows the title ",(0,V.jsx)(b.code,{children:"Flows"}),", stats for Entities, Flow runs, Failure rate, and Running now, and one table row per flow. ",(0,V.jsx)(b.code,{children:"FlowsRoute"})," sends ",(0,V.jsx)(b.code,{children:"onOpen"})," to ",(0,V.jsx)(b.code,{children:"`/organizations/${organizationId}/flows/${flow}?range=${range}`"}),". ",(0,V.jsx)(b.code,{children:"FlowPage"})," loads that path with ",(0,V.jsx)(b.code,{children:"readOrchestrator"})," and calls ",(0,V.jsx)(b.code,{children:"notFound()"})," when the load fails. The detail view shows the flow name, flow runs, step runs, failure rate, p50, Running now, the outcome series, the step table, and the reason list. The Start button opens a dialog for the identity and the payload. ",(0,V.jsx)(b.code,{children:"startFlow"})," in ",(0,V.jsx)(b.code,{children:"apps/console/src/app/organizations/[organizationId]/flows/actions.ts"})," posts that body to ",(0,V.jsx)(b.code,{children:"POST /organizations/:organizationId/flows/:flow"}),". ",(0,V.jsx)(b.code,{children:"openFlow"})," calls ",(0,V.jsx)(b.code,{children:"startRun"})," with silence duration ",(0,V.jsx)(b.code,{children:"60_000"}),", resend maximum ",(0,V.jsx)(b.code,{children:"1"}),", and the rule from the flow definition. ",(0,V.jsx)(b.code,{children:"flowRange"})," returns ",(0,V.jsx)(b.code,{children:"24h"}),", ",(0,V.jsx)(b.code,{children:"7d"}),", or ",(0,V.jsx)(b.code,{children:"30d"}),", and returns ",(0,V.jsx)(b.code,{children:"24h"})," for any other query value."]}),"\n",(0,V.jsx)(b.h2,{id:"getting-started",children:"Getting started"}),"\n",(0,V.jsxs)(b.ol,{children:["\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["In ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/perf/"}),", add a ",(0,V.jsx)(b.code,{children:"FlowFunction"})," next to ",(0,V.jsx)(b.code,{children:"paceFlow"}),", ",(0,V.jsx)(b.code,{children:"loadFlow"}),", ",(0,V.jsx)(b.code,{children:"stallFlow"}),", ",(0,V.jsx)(b.code,{children:"faultFlow"}),", ",(0,V.jsx)(b.code,{children:"softenFlow"}),", ",(0,V.jsx)(b.code,{children:"asideFlow"}),", ",(0,V.jsx)(b.code,{children:"nestFlow"}),", and ",(0,V.jsx)(b.code,{children:"broodFlow"}),". Call ",(0,V.jsx)(b.code,{children:"openStep"}),", ",(0,V.jsx)(b.code,{children:"openOptionalStep"}),", ",(0,V.jsx)(b.code,{children:"openDetachedStep"}),", ",(0,V.jsx)(b.code,{children:"openChildren"}),", or ",(0,V.jsx)(b.code,{children:"finish"})," the way those flows do. ",(0,V.jsx)(b.code,{children:"paceFlow"})," calls ",(0,V.jsx)(b.code,{children:"openStep(dwellStep)"})," and ",(0,V.jsx)(b.code,{children:'openStep("mark")'}),". ",(0,V.jsx)(b.code,{children:"softenFlow"})," calls ",(0,V.jsx)(b.code,{children:"openOptionalStep(missStep)"}),". ",(0,V.jsx)(b.code,{children:"asideFlow"})," calls ",(0,V.jsx)(b.code,{children:"openDetachedStep(stallStep)"}),". ",(0,V.jsx)(b.code,{children:"nestFlow"})," calls ",(0,V.jsx)(b.code,{children:"openChildren(nestMidFlow, asChildren(sprouted.body))"}),". ",(0,V.jsx)(b.code,{children:"broodFlow"})," calls ",(0,V.jsx)(b.code,{children:"openChildren(broodChildFlow, asChildren(opened.body))"}),". ",(0,V.jsx)(b.code,{children:"waitGroup"}),", ",(0,V.jsx)(b.code,{children:"choose"}),", and ",(0,V.jsx)(b.code,{children:"fail"})," are on ",(0,V.jsx)(b.code,{children:"FlowContext"}),". Append the flow to ",(0,V.jsx)(b.code,{children:"flows"})," in ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/index.ts"}),". ",(0,V.jsx)(b.code,{children:"fixtureFlows"})," is that list."]}),"\n"]}),"\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["Register the function with ",(0,V.jsx)(b.code,{children:"defineFlow"}),", which sets ",(0,V.jsx)(b.code,{children:"name"}),", ",(0,V.jsx)(b.code,{children:"entityType"}),", ",(0,V.jsx)(b.code,{children:"validityDurationMs"}),", ",(0,V.jsx)(b.code,{children:"source"}),", and ",(0,V.jsx)(b.code,{children:"run"}),", and append that value to ",(0,V.jsx)(b.code,{children:"flows"}),". Register each step implementation on the ",(0,V.jsx)(b.code,{children:"steps"})," array in ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/steps.ts"}),". ",(0,V.jsx)(b.code,{children:"bindOrganization"})," writes ",(0,V.jsx)(b.code,{children:"`${flow}/${step}`"})," and sets the kind to ",(0,V.jsx)(b.code,{children:"`fixture-${step.name}`"}),"."]}),"\n"]}),"\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["Copy ",(0,V.jsx)(b.code,{children:".env.example"})," to ",(0,V.jsx)(b.code,{children:".env"})," in the repository root. ",(0,V.jsx)(b.code,{children:"loadRootEnv"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/env.ts"})," reads that file. ",(0,V.jsx)(b.code,{children:"requiredEnv"})," reads ",(0,V.jsx)(b.code,{children:"DATABASE_URL"}),", ",(0,V.jsx)(b.code,{children:"REDIS_URL"}),", and ",(0,V.jsx)(b.code,{children:"CLICKHOUSE_URL"}),", and throws ",(0,V.jsx)(b.code,{children:"${name} is required"})," when one is missing. Start the orchestrator Postgres with ",(0,V.jsx)(b.code,{children:"npx supabase start"}),". Start Redis and ClickHouse with ",(0,V.jsx)(b.code,{children:"docker compose up -d redis clickhouse"}),". The ",(0,V.jsx)(b.code,{children:"redis"})," and ",(0,V.jsx)(b.code,{children:"clickhouse"})," services are the ones in ",(0,V.jsx)(b.code,{children:"docker-compose.yml"}),". Run ",(0,V.jsx)(b.code,{children:"npx supabase status"})," and set ",(0,V.jsx)(b.code,{children:"NEXT_PUBLIC_SUPABASE_ANON_KEY"})," in ",(0,V.jsx)(b.code,{children:".env"})," to the anon key it prints. ",(0,V.jsx)(b.code,{children:"supabaseAnonKey"})," in ",(0,V.jsx)(b.code,{children:"apps/console/src/lib/supabase-env.ts"})," drops an empty value, and ",(0,V.jsx)(b.code,{children:"LoginPage"})," then renders ",(0,V.jsx)(b.code,{children:"SignInForm"})," with ",(0,V.jsx)(b.code,{children:"configured={false}"}),"."]}),"\n"]}),"\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["Run ",(0,V.jsx)(b.code,{children:"pnpm --filter cue-orchestrator serve"}),". The ",(0,V.jsx)(b.code,{children:"serve"})," script in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/package.json"})," runs ",(0,V.jsx)(b.code,{children:"tsx src/server.ts"}),". ",(0,V.jsx)(b.code,{children:"server.ts"})," calls ",(0,V.jsx)(b.code,{children:"openFixtureService"})," with ",(0,V.jsx)(b.code,{children:"fixtureFlows"})," and ",(0,V.jsx)(b.code,{children:"fixtureSteps"}),", then ",(0,V.jsx)(b.code,{children:'server.listen(3001, "0.0.0.0")'}),". It does not call ",(0,V.jsx)(b.code,{children:"startRun"}),". The log line is ",(0,V.jsx)(b.code,{children:"orchestrator http://127.0.0.1:3001"}),"."]}),"\n"]}),"\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["In a second terminal, run ",(0,V.jsx)(b.code,{children:"pnpm --filter @ascentstudio/cue-org-fixture work"}),". The ",(0,V.jsx)(b.code,{children:"work"})," script in ",(0,V.jsx)(b.code,{children:"organizations/fixture/package.json"})," runs ",(0,V.jsx)(b.code,{children:"tsx src/work.ts"}),". ",(0,V.jsx)(b.code,{children:"work.ts"})," loads the organization's secrets once with ",(0,V.jsx)(b.code,{children:"readOrganizationSecrets"})," and ",(0,V.jsx)(b.code,{children:"installEnvironment"}),", then calls ",(0,V.jsx)(b.code,{children:"createStepWorker"}),". Each job calls ",(0,V.jsx)(b.code,{children:"consumeAssignment"}),". ",(0,V.jsx)(b.code,{children:"consumeAssignment"})," publishes the step result, the orchestrator applies it, and ",(0,V.jsx)(b.code,{children:"settle"})," pushes a ",(0,V.jsx)(b.code,{children:"FlowMetric"})," when it records ",(0,V.jsx)(b.code,{children:"success"}),", ",(0,V.jsx)(b.code,{children:"failure"}),", or ",(0,V.jsx)(b.code,{children:"not_finished"}),". ",(0,V.jsx)(b.code,{children:"startMetricFlush"})," in the orchestrator process inserts that metric into ClickHouse. The log line from ",(0,V.jsx)(b.code,{children:"work.ts"})," is ",(0,V.jsx)(b.code,{children:"fixture workers"})," plus the kind names. ",(0,V.jsx)(b.code,{children:"bindOrganization"})," names ",(0,V.jsx)(b.code,{children:"fixture-dwell"}),", ",(0,V.jsx)(b.code,{children:"fixture-stall"}),", ",(0,V.jsx)(b.code,{children:"fixture-miss"}),", ",(0,V.jsx)(b.code,{children:"fixture-sprout"}),", and ",(0,V.jsx)(b.code,{children:"fixture-brood"}),"."]}),"\n"]}),"\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["In a third terminal, run ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture seed"}),". The ",(0,V.jsx)(b.code,{children:"seed"})," script in ",(0,V.jsx)(b.code,{children:"organizations/fixture/package.json"})," runs ",(0,V.jsx)(b.code,{children:"cue seed"}),". The fixture does not export ",(0,V.jsx)(b.code,{children:"catalogSeed"}),", so the command opens nothing and the log line is ",(0,V.jsx)(b.code,{children:"seeded fixture 0 runs"}),". Load runs start with ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf"}),", ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf:load"}),", ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf:brood"}),", or ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf:brood:producer"}),". To remove runs an organization left behind, run ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture reset"}),". ",(0,V.jsx)(b.code,{children:"resetOrganization"})," deletes rows from ",(0,V.jsx)(b.code,{children:"entity_links"})," and ",(0,V.jsx)(b.code,{children:"entities"})," on the orchestrator database, drains the kind queues, and deletes that organization's metrics. The log line is ",(0,V.jsx)(b.code,{children:"reset fixture"}),". ",(0,V.jsx)(b.code,{children:"organizations"}),", ",(0,V.jsx)(b.code,{children:"memberships"}),", ",(0,V.jsx)(b.code,{children:"secrets"}),", and the person in ",(0,V.jsx)(b.code,{children:"deploy/supabase/seed.sql"})," stay."]}),"\n"]}),"\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["In a fourth terminal, run ",(0,V.jsx)(b.code,{children:"pnpm --filter cue-console dev"}),". The ",(0,V.jsx)(b.code,{children:"dev"})," script in ",(0,V.jsx)(b.code,{children:"apps/console/package.json"})," runs ",(0,V.jsx)(b.code,{children:"next dev"}),". Open the URL that command prints, at ",(0,V.jsx)(b.code,{children:"/login"}),". ",(0,V.jsx)(b.code,{children:"LoginForm"})," calls ",(0,V.jsx)(b.code,{children:"signInWithPassword"})," for the Sign in button. The person inserted in ",(0,V.jsx)(b.code,{children:"deploy/supabase/seed.sql"})," has email ",(0,V.jsx)(b.code,{children:"pierre@ascent-studio.fr"}),", and the comment there says the password is that same string. ",(0,V.jsx)(b.code,{children:"on_auth_user_created"})," calls ",(0,V.jsx)(b.code,{children:"join_fixture"}),", which inserts a membership for organization ",(0,V.jsx)(b.code,{children:"fixture"}),". After sign-in, ",(0,V.jsx)(b.code,{children:"LoginForm"})," pushes ",(0,V.jsx)(b.code,{children:"/"}),". Open ",(0,V.jsx)(b.code,{children:"/organizations/fixture/flows"}),". ",(0,V.jsx)(b.code,{children:"FlowsPage"})," renders ",(0,V.jsx)(b.code,{children:"FlowsView"})," with the title ",(0,V.jsx)(b.code,{children:"Flows"}),". Click a row. ",(0,V.jsx)(b.code,{children:"FlowsRoute"})," opens ",(0,V.jsx)(b.code,{children:"/organizations/fixture/flows/"})," plus that flow name. Press Start, enter the identity and the payload, and the console opens ",(0,V.jsx)(b.code,{children:"/entities/"})," plus the organization, the flow, and the identity."]}),"\n"]}),"\n"]})]})}function af(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(ae,{...a})}):ae(a)}let ag={title:"Drivers"},ah=[],ai={contents:[{heading:"why",content:"A kind is one process. docs/usage/kinds.mdx describes that process. The jobs of that process run at the step concurrency and share one client. A step calls a function. The function opens the client once for that process."},{heading:"why",content:"The worker drains those jobs, then closes the Nest context, then exits. The organization closes the clients it opened."},{heading:"who",content:"You add a driver when a step implementation talks to PostgreSQL, Elasticsearch, ClickHouse, S3, Qdrant, or another service that keeps connections."},{heading:"who",content:"The drivers live in the organization checkout. The worker loads those secrets once, with installEnvironment, before it accepts jobs."},{heading:"one-client-for-the-process",content:"The organization package exports ./drivers. A published install that dropped package exports keeps the module at src/drivers/drivers.module.ts. driversModulePath in packages/supervisor/src/worker/worker.service.ts resolves that file. The catalog entry does not import the module, so loading the catalog does not load the clients."},{heading:"one-client-for-the-process",content:"When WORKER_RUNTIME is set, prepareOrganizationRuntime loads that module and calls warmupWorkerRuntime. WorkerModule in packages/supervisor/src/worker/worker.module.ts does not import the organization module. The module does not open a client when the process starts. A kind that never asks for a client opens nothing."},{heading:"one-client-for-the-process",content:"A handle stores the promise the opener returns. A second get returns that same promise. The opener reads the secret with environment from @ascentstudio/cue-contract. close waits for that promise when get has already been called, then closes the client. A second close returns the same promise. close before any get resolves without opening. get after close rejects."},{heading:"close-after-the-drain",content:"WorkerService.finish in packages/supervisor/src/worker/worker.service.ts drains the jobs. closeThenExit then closes the Nest context and exits. main.ts calls attach with that context after createApplicationContext. The process exits 0, or 75 when the command is drain-restart."},{heading:"close-after-the-drain",content:'WorkerService does not implement OnApplicationShutdown. A close that called that hook would run the drain again. A second run("drain-stop") in createShutdown (packages/engine/src/worker-control.ts) replaces an exit code of 75.'},{heading:"close-after-the-drain",content:"main.ts does not call enableShutdownHooks. The worker listens for SIGINT, SIGTERM, SIGHUP, and SIGQUIT itself. The drain finishes before the Nest context closes, and a restart still exits 75."},{heading:"the-cap",content:"The cap on a client stays below the step concurrency. The connections a service receives are the processes that call that driver, multiplied by the cap."},{heading:"the-orchestrator-database-stays-separate",content:"DATABASE_URL is the orchestrator database. A fixture worker does not open a second database. An organization driver that runs SQL opens another pool, and that pool reads its own secret."}],headings:[{id:"why",content:"Why"},{id:"who",content:"Who"},{id:"how",content:"How"},{id:"one-client-for-the-process",content:"One client for the process"},{id:"close-after-the-drain",content:"Close after the drain"},{id:"the-cap",content:"The cap"},{id:"the-orchestrator-database-stays-separate",content:"The orchestrator database stays separate"}]},aj=[{depth:2,url:"#why",title:(0,V.jsx)(V.Fragment,{children:"Why"})},{depth:2,url:"#who",title:(0,V.jsx)(V.Fragment,{children:"Who"})},{depth:2,url:"#how",title:(0,V.jsx)(V.Fragment,{children:"How"})},{depth:3,url:"#one-client-for-the-process",title:(0,V.jsx)(V.Fragment,{children:"One client for the process"})},{depth:3,url:"#close-after-the-drain",title:(0,V.jsx)(V.Fragment,{children:"Close after the drain"})},{depth:3,url:"#the-cap",title:(0,V.jsx)(V.Fragment,{children:"The cap"})},{depth:3,url:"#the-orchestrator-database-stays-separate",title:(0,V.jsx)(V.Fragment,{children:"The orchestrator database stays separate"})}];function ak(a){let b={code:"code",h2:"h2",h3:"h3",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h2,{id:"why",children:"Why"}),"\n",(0,V.jsxs)(b.p,{children:["A kind is one process. ",(0,V.jsx)(b.code,{children:"docs/usage/kinds.mdx"})," describes that process. The jobs of that process run at the step concurrency and share one client. A step calls a function. The function opens the client once for that process."]}),"\n",(0,V.jsx)(b.p,{children:"The worker drains those jobs, then closes the Nest context, then exits. The organization closes the clients it opened."}),"\n",(0,V.jsx)(b.h2,{id:"who",children:"Who"}),"\n",(0,V.jsx)(b.p,{children:"You add a driver when a step implementation talks to PostgreSQL, Elasticsearch, ClickHouse, S3, Qdrant, or another service that keeps connections."}),"\n",(0,V.jsxs)(b.p,{children:["The drivers live in the organization checkout. The worker loads those secrets once, with ",(0,V.jsx)(b.code,{children:"installEnvironment"}),", before it accepts jobs."]}),"\n",(0,V.jsx)(b.h2,{id:"how",children:"How"}),"\n",(0,V.jsx)(b.h3,{id:"one-client-for-the-process",children:"One client for the process"}),"\n",(0,V.jsxs)(b.p,{children:["The organization package exports ",(0,V.jsx)(b.code,{children:"./drivers"}),". A published install that dropped package exports keeps the module at ",(0,V.jsx)(b.code,{children:"src/drivers/drivers.module.ts"}),". ",(0,V.jsx)(b.code,{children:"driversModulePath"})," in ",(0,V.jsx)(b.code,{children:"packages/supervisor/src/worker/worker.service.ts"})," resolves that file. The catalog entry does not import the module, so loading the catalog does not load the clients."]}),"\n",(0,V.jsxs)(b.p,{children:["When ",(0,V.jsx)(b.code,{children:"WORKER_RUNTIME"})," is set, ",(0,V.jsx)(b.code,{children:"prepareOrganizationRuntime"})," loads that module and calls ",(0,V.jsx)(b.code,{children:"warmupWorkerRuntime"}),". ",(0,V.jsx)(b.code,{children:"WorkerModule"})," in ",(0,V.jsx)(b.code,{children:"packages/supervisor/src/worker/worker.module.ts"})," does not import the organization module. The module does not open a client when the process starts. A kind that never asks for a client opens nothing."]}),"\n",(0,V.jsxs)(b.p,{children:["A handle stores the promise the opener returns. A second ",(0,V.jsx)(b.code,{children:"get"})," returns that same promise. The opener reads the secret with ",(0,V.jsx)(b.code,{children:"environment"})," from ",(0,V.jsx)(b.code,{children:"@ascentstudio/cue-contract"}),". ",(0,V.jsx)(b.code,{children:"close"})," waits for that promise when ",(0,V.jsx)(b.code,{children:"get"})," has already been called, then closes the client. A second ",(0,V.jsx)(b.code,{children:"close"})," returns the same promise. ",(0,V.jsx)(b.code,{children:"close"})," before any ",(0,V.jsx)(b.code,{children:"get"})," resolves without opening. ",(0,V.jsx)(b.code,{children:"get"})," after ",(0,V.jsx)(b.code,{children:"close"})," rejects."]}),"\n",(0,V.jsx)(b.h3,{id:"close-after-the-drain",children:"Close after the drain"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"WorkerService.finish"})," in ",(0,V.jsx)(b.code,{children:"packages/supervisor/src/worker/worker.service.ts"})," drains the jobs. ",(0,V.jsx)(b.code,{children:"closeThenExit"})," then closes the Nest context and exits. ",(0,V.jsx)(b.code,{children:"main.ts"})," calls ",(0,V.jsx)(b.code,{children:"attach"})," with that context after ",(0,V.jsx)(b.code,{children:"createApplicationContext"}),". The process exits ",(0,V.jsx)(b.code,{children:"0"}),", or ",(0,V.jsx)(b.code,{children:"75"})," when the command is ",(0,V.jsx)(b.code,{children:"drain-restart"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"WorkerService"})," does not implement ",(0,V.jsx)(b.code,{children:"OnApplicationShutdown"}),". A close that called that hook would run the drain again. A second ",(0,V.jsx)(b.code,{children:'run("drain-stop")'})," in ",(0,V.jsx)(b.code,{children:"createShutdown"})," (",(0,V.jsx)(b.code,{children:"packages/engine/src/worker-control.ts"}),") replaces an exit code of ",(0,V.jsx)(b.code,{children:"75"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"main.ts"})," does not call ",(0,V.jsx)(b.code,{children:"enableShutdownHooks"}),". The worker listens for ",(0,V.jsx)(b.code,{children:"SIGINT"}),", ",(0,V.jsx)(b.code,{children:"SIGTERM"}),", ",(0,V.jsx)(b.code,{children:"SIGHUP"}),", and ",(0,V.jsx)(b.code,{children:"SIGQUIT"})," itself. The drain finishes before the Nest context closes, and a restart still exits ",(0,V.jsx)(b.code,{children:"75"}),"."]}),"\n",(0,V.jsx)(b.h3,{id:"the-cap",children:"The cap"}),"\n",(0,V.jsx)(b.p,{children:"The cap on a client stays below the step concurrency. The connections a service receives are the processes that call that driver, multiplied by the cap."}),"\n",(0,V.jsx)(b.h3,{id:"the-orchestrator-database-stays-separate",children:"The orchestrator database stays separate"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"DATABASE_URL"})," is the orchestrator database. A fixture worker does not open a second database. An organization driver that runs SQL opens another pool, and that pool reads its own secret."]})]})}function al(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(ak,{...a})}):ak(a)}let am={title:"Actions"},an=[],ao={contents:[{heading:"why",content:"A person can open the first entity of a flow, replay a flow, replay from a step, resend a job, run a step without applying its result, cancel a run or an open step, and end a validity. The first opening is that request. request still waits when a run is already open, and still returns the recorded result inside the validity duration."},{heading:"who",content:"You use these actions from the entity page. The buttons are on EntityView in apps/console/src/design/views.tsx. The page posts them through apps/console/src/app/entities/[...entityId]/actions.ts."},{heading:"how",content:"ReadController matches POST /entities/... in apps/orchestrator/src/nest/read.controller.ts and calls runEntityAction. A taken action responds 204. A run that is already open, or an action the state does not allow, responds 409. An unknown entity responds 404."},{heading:"replay",content:"replay in packages/engine/src/engine.ts returns waiting and no job while the run is running. Otherwise it calls begin with the stored starting data, the flow rule, and the payload from the dialog when one was sent. Validity is ignored. The generation increases and the tree is replaced."},{heading:"replay",content:"replayFrom keeps the operations before the chosen step and removes that step and everything after it, including inside a group or a taken arm. A cut group is not sealed. drive opens the step again. A result for a step that is no longer in the tree is ignored."},{heading:"resend-and-probe",content:"resend is the same step as the silence duration, taken now. resendCount increases, a job is sent, and at the resend maximum the step result is not finished."},{heading:"resend-and-probe",content:"probe on the service assigns a dispatch slot entity/step/probe, so the live job's packet stays. That packet carries the generation and apply: false. The worker copies both onto the result. The job stays an organization, an entity, a step, and a token. applyResult stores that result with saveProbe and does not call acceptResult. The entity view exposes it as probes. A result whose generation is not the current generation is ignored."},{heading:"cancel-and-validity",content:'cancelRun closes a running run as not finished without rereading the function. Each open step, including a detached step, receives { status: "not_finished", discriminant: "ended" }. Child entities keep running. Running parents that still link the entity are reread, so cancelling a child resumes the parent. A group that is already sealed does not change.'},{heading:"cancel-and-validity",content:"cancelMember writes that same result on an open step in a group that is not sealed, then rereads. The member has responded, so the rule can seal and the flow can continue."},{heading:"cancel-and-validity",content:"cancelDetached writes that result on an open detached step and does not change the flow outcome. The step is not sent again."},{heading:"cancel-and-validity",content:"endValidity clears validityEndsAt when the run is a success and that time is still ahead. The tree stays. The next request starts a run."}],headings:[{id:"why",content:"Why"},{id:"who",content:"Who"},{id:"how",content:"How"},{id:"replay",content:"Replay"},{id:"resend-and-probe",content:"Resend and probe"},{id:"cancel-and-validity",content:"Cancel and validity"}]},ap=[{depth:2,url:"#why",title:(0,V.jsx)(V.Fragment,{children:"Why"})},{depth:2,url:"#who",title:(0,V.jsx)(V.Fragment,{children:"Who"})},{depth:2,url:"#how",title:(0,V.jsx)(V.Fragment,{children:"How"})},{depth:3,url:"#replay",title:(0,V.jsx)(V.Fragment,{children:"Replay"})},{depth:3,url:"#resend-and-probe",title:(0,V.jsx)(V.Fragment,{children:"Resend and probe"})},{depth:3,url:"#cancel-and-validity",title:(0,V.jsx)(V.Fragment,{children:"Cancel and validity"})}];function aq(a){let b={code:"code",h2:"h2",h3:"h3",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h2,{id:"why",children:"Why"}),"\n",(0,V.jsxs)(b.p,{children:["A person can open the first entity of a flow, replay a flow, replay from a step, resend a job, run a step without applying its result, cancel a run or an open step, and end a validity. The first opening is that request. ",(0,V.jsx)(b.code,{children:"request"})," still waits when a run is already open, and still returns the recorded result inside the validity duration."]}),"\n",(0,V.jsx)(b.h2,{id:"who",children:"Who"}),"\n",(0,V.jsxs)(b.p,{children:["You use these actions from the entity page. The buttons are on ",(0,V.jsx)(b.code,{children:"EntityView"})," in ",(0,V.jsx)(b.code,{children:"apps/console/src/design/views.tsx"}),". The page posts them through ",(0,V.jsx)(b.code,{children:"apps/console/src/app/entities/[...entityId]/actions.ts"}),"."]}),"\n",(0,V.jsx)(b.h2,{id:"how",children:"How"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ReadController"})," matches ",(0,V.jsx)(b.code,{children:"POST /entities/..."})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/nest/read.controller.ts"})," and calls ",(0,V.jsx)(b.code,{children:"runEntityAction"}),". A taken action responds ",(0,V.jsx)(b.code,{children:"204"}),". A run that is already open, or an action the state does not allow, responds ",(0,V.jsx)(b.code,{children:"409"}),". An unknown entity responds ",(0,V.jsx)(b.code,{children:"404"}),"."]}),"\n",(0,V.jsx)(b.h3,{id:"replay",children:"Replay"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"replay"})," in ",(0,V.jsx)(b.code,{children:"packages/engine/src/engine.ts"})," returns ",(0,V.jsx)(b.code,{children:"waiting"})," and no job while the run is running. Otherwise it calls ",(0,V.jsx)(b.code,{children:"begin"})," with the stored starting data, the flow rule, and the payload from the dialog when one was sent. Validity is ignored. The generation increases and the tree is replaced."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"replayFrom"})," keeps the operations before the chosen step and removes that step and everything after it, including inside a group or a taken arm. A cut group is not sealed. ",(0,V.jsx)(b.code,{children:"drive"})," opens the step again. A result for a step that is no longer in the tree is ignored."]}),"\n",(0,V.jsx)(b.h3,{id:"resend-and-probe",children:"Resend and probe"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"resend"})," is the same step as the silence duration, taken now. ",(0,V.jsx)(b.code,{children:"resendCount"})," increases, a job is sent, and at the resend maximum the step result is not finished."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"probe"})," on the service assigns a dispatch slot ",(0,V.jsx)(b.code,{children:"entity/step/probe"}),", so the live job's packet stays. That packet carries the generation and ",(0,V.jsx)(b.code,{children:"apply: false"}),". The worker copies both onto the result. The job stays an organization, an entity, a step, and a token. ",(0,V.jsx)(b.code,{children:"applyResult"})," stores that result with ",(0,V.jsx)(b.code,{children:"saveProbe"})," and does not call ",(0,V.jsx)(b.code,{children:"acceptResult"}),". The entity view exposes it as ",(0,V.jsx)(b.code,{children:"probes"}),". A result whose ",(0,V.jsx)(b.code,{children:"generation"})," is not the current generation is ignored."]}),"\n",(0,V.jsx)(b.h3,{id:"cancel-and-validity",children:"Cancel and validity"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"cancelRun"})," closes a running run as not finished without rereading the function. Each open step, including a detached step, receives ",(0,V.jsx)(b.code,{children:'{ status: "not_finished", discriminant: "ended" }'}),". Child entities keep running. Running parents that still link the entity are reread, so cancelling a child resumes the parent. A group that is already sealed does not change."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"cancelMember"})," writes that same result on an open step in a group that is not sealed, then rereads. The member has responded, so the rule can seal and the flow can continue."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"cancelDetached"})," writes that result on an open detached step and does not change the flow outcome. The step is not sent again."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"endValidity"})," clears ",(0,V.jsx)(b.code,{children:"validityEndsAt"})," when the run is a success and that time is still ahead. The tree stays. The next request starts a run."]})]})}function ar(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(aq,{...a})}):aq(a)}let as={title:"One rule for required and optional children"},at=[],au={contents:[{heading:"one-rule-for-required-and-optional-children",content:"openChildren and openOptionalChildren take the same rule. The omitted rule is that every child run succeeds. The call may pass a quota instead: a count, or a proportion from 0 to 1. A count is capped at the number of children. A proportion's target is that proportion of the children, rounded up. Either form may name withinMin, a whole number of minutes of at least 1, measured from the moment the children open. The flow does not read the clock. The frame stores openedAt on the first opening. A reread compares the rule. It does not compare an absolute time."},{heading:"one-rule-for-required-and-optional-children",content:"Only a successful child run counts toward the target. A required opening seals when the target is met. It stops the parent when the target can no longer be met, or when the duration is reached with the target unmet. Before that time, a failure stops a required all as failure, and a not finished child stops it as not finished. An optional opening never stops the parent. It seals, in this order, when the target is met, when the duration is reached, when a quota can no longer be met, or when every child has ended under all. A failure does not seal an optional all early. Children that are still open stay out of the sealed report. A result that arrives later does not change the report."},{heading:"one-rule-for-required-and-optional-children",content:"An object is one child and takes no rule. An empty array seals at once. A group still waits until every required member is done. A stored frame that still carries a separate quota, or an absolute at, diverges on reread. This supersedes ADR 0021 and ADR 0022."}],headings:[{id:"one-rule-for-required-and-optional-children",content:"One rule for required and optional children"}]},av=[{depth:1,url:"#one-rule-for-required-and-optional-children",title:(0,V.jsx)(V.Fragment,{children:"One rule for required and optional children"})}];function aw(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"one-rule-for-required-and-optional-children",children:"One rule for required and optional children"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"openChildren"})," and ",(0,V.jsx)(b.code,{children:"openOptionalChildren"})," take the same rule. The omitted rule is that every child run succeeds. The call may pass a quota instead: a count, or a proportion from 0 to 1. A count is capped at the number of children. A proportion's target is that proportion of the children, rounded up. Either form may name ",(0,V.jsx)(b.code,{children:"withinMin"}),", a whole number of minutes of at least 1, measured from the moment the children open. The flow does not read the clock. The frame stores ",(0,V.jsx)(b.code,{children:"openedAt"})," on the first opening. A reread compares the rule. It does not compare an absolute time."]}),"\n",(0,V.jsxs)(b.p,{children:["Only a successful child run counts toward the target. A required opening seals when the target is met. It stops the parent when the target can no longer be met, or when the duration is reached with the target unmet. Before that time, a failure stops a required ",(0,V.jsx)(b.code,{children:"all"})," as failure, and a not finished child stops it as not finished. An optional opening never stops the parent. It seals, in this order, when the target is met, when the duration is reached, when a quota can no longer be met, or when every child has ended under ",(0,V.jsx)(b.code,{children:"all"}),". A failure does not seal an optional ",(0,V.jsx)(b.code,{children:"all"})," early. Children that are still open stay out of the sealed report. A result that arrives later does not change the report."]}),"\n",(0,V.jsxs)(b.p,{children:["An object is one child and takes no rule. An empty array seals at once. A group still waits until every required member is done. A stored frame that still carries a separate quota, or an absolute ",(0,V.jsx)(b.code,{children:"at"}),", diverges on reread. This supersedes ADR 0021 and ADR 0022."]})]})}function ax(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(aw,{...a})}):aw(a)}let ay={title:"An orchestrator fault stops the run"},az=[],aA={contents:[{heading:"an-orchestrator-fault-stops-the-run",content:"An unknown step, or an unknown entity, while the orchestrator is sending the jobs of a running flow, stops that run. The run photographed before the result ends in failure. Each step that was still open is closed with a failed result marked orchestrator, and the result body carries the message, so a later advance does not send its job. The result is acknowledged. The jobs of the abandoned transition are not sent."},{heading:"an-orchestrator-fault-stops-the-run",content:"A start, a cron, or a replay does not stop a run in its place: the error leaves the transaction, and the transaction is rolled back. An error from Postgres or Redis is not this stop. It is not acknowledged. After eight failures of the same result, that result is copied to the dead stream and acknowledged."}],headings:[{id:"an-orchestrator-fault-stops-the-run",content:"An orchestrator fault stops the run"}]},aB=[{depth:1,url:"#an-orchestrator-fault-stops-the-run",title:(0,V.jsx)(V.Fragment,{children:"An orchestrator fault stops the run"})}];function aC(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"an-orchestrator-fault-stops-the-run",children:"An orchestrator fault stops the run"}),"\n",(0,V.jsx)(b.p,{children:"An unknown step, or an unknown entity, while the orchestrator is sending the jobs of a running flow, stops that run. The run photographed before the result ends in failure. Each step that was still open is closed with a failed result marked orchestrator, and the result body carries the message, so a later advance does not send its job. The result is acknowledged. The jobs of the abandoned transition are not sent."}),"\n",(0,V.jsx)(b.p,{children:"A start, a cron, or a replay does not stop a run in its place: the error leaves the transaction, and the transaction is rolled back. An error from Postgres or Redis is not this stop. It is not acknowledged. After eight failures of the same result, that result is copied to the dead stream and acknowledged."})]})}function aD(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(aC,{...a})}):aC(a)}let aE={title:"A running worker reloads when commanded"},aF=[],aG={contents:[{heading:"a-running-worker-reloads-when-commanded",content:"Each environment keeps its own variables and secrets. That part of the earlier decision stays: a new environment starts empty, and there is no shared organization set for an environment to override."},{heading:"a-running-worker-reloads-when-commanded",content:"The worker attached to that environment loads those variables and secrets when it starts. It loads them again when the orchestrator commands a reload. A worker that is already running keeps what it loaded until that command or until it starts again. The command is separate from a drain or a stop. Rotating the environment access secret does not send it, because the running process still authenticates with the secret it started with."}],headings:[{id:"a-running-worker-reloads-when-commanded",content:"A running worker reloads when commanded"}]},aH=[{depth:1,url:"#a-running-worker-reloads-when-commanded",title:(0,V.jsx)(V.Fragment,{children:"A running worker reloads when commanded"})}];function aI(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-running-worker-reloads-when-commanded",children:"A running worker reloads when commanded"}),"\n",(0,V.jsx)(b.p,{children:"Each environment keeps its own variables and secrets. That part of the earlier decision stays: a new environment starts empty, and there is no shared organization set for an environment to override."}),"\n",(0,V.jsx)(b.p,{children:"The worker attached to that environment loads those variables and secrets when it starts. It loads them again when the orchestrator commands a reload. A worker that is already running keeps what it loaded until that command or until it starts again. The command is separate from a drain or a stop. Rotating the environment access secret does not send it, because the running process still authenticates with the secret it started with."})]})}function aJ(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(aI,{...a})}):aI(a)}let aK={title:"The fixture checkout may live in the repository"},aL=[],aM={contents:[{heading:"the-fixture-checkout-may-live-in-the-repository",content:"The fixture checkout may live in this repository at organizations/fixture. It is not a package of the repository. The platform reaches it by FIXTURE, or by the installed @ascentstudio/cue-org-fixture archive. The platform does not name any other organization. A slot executes the revision built by cue build. Import publishes that revision to the npm registry. The package is cue-org-<organization>-revision and the version is 0.0.0-<revision>. The revision id stays the content hash. dist.integrity is the check. The orchestrator and each supervisor keep a cache of downloaded revisions. The cache is not a catalog. An environment pin, and any revision still held by an open run, choose what is downloaded. allowUnpublished with --source or ORCH_SOURCE runs the organization directory and does not publish or download. Runtime images stay on zot, the local registry, or Scaleway."}],headings:[{id:"the-fixture-checkout-may-live-in-the-repository",content:"The fixture checkout may live in the repository"}]},aN=[{depth:1,url:"#the-fixture-checkout-may-live-in-the-repository",title:(0,V.jsx)(V.Fragment,{children:"The fixture checkout may live in the repository"})}];function aO(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"the-fixture-checkout-may-live-in-the-repository",children:"The fixture checkout may live in the repository"}),"\n",(0,V.jsxs)(b.p,{children:["The fixture checkout may live in this repository at ",(0,V.jsx)(b.code,{children:"organizations/fixture"}),". It is not a package of the repository. The platform reaches it by ",(0,V.jsx)(b.code,{children:"FIXTURE"}),", or by the installed ",(0,V.jsx)(b.code,{children:"@ascentstudio/cue-org-fixture"})," archive. The platform does not name any other organization. A slot executes the revision built by ",(0,V.jsx)(b.code,{children:"cue build"}),". Import publishes that revision to the npm registry. The package is ",(0,V.jsx)(b.code,{children:"cue-org-<organization>-revision"})," and the version is ",(0,V.jsx)(b.code,{children:"0.0.0-<revision>"}),". The revision id stays the content hash. ",(0,V.jsx)(b.code,{children:"dist.integrity"})," is the check. The orchestrator and each supervisor keep a cache of downloaded revisions. The cache is not a catalog. An environment pin, and any revision still held by an open run, choose what is downloaded. ",(0,V.jsx)(b.code,{children:"allowUnpublished"})," with ",(0,V.jsx)(b.code,{children:"--source"})," or ",(0,V.jsx)(b.code,{children:"ORCH_SOURCE"})," runs the organization directory and does not publish or download. Runtime images stay on zot, the local registry, or Scaleway."]})]})}function aP(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(aO,{...a})}):aO(a)}let aQ={title:"A registry client certificate or a login"},aR=[],aS={contents:[{heading:"a-registry-client-certificate-or-a-login",content:"Zot and Verdaccio accept no anonymous request. Caddy is the only way in. A certificate signed by the platform intermediate authenticates a machine. A person without a certificate uses docker login or npm login. The console does not call the registries. It keeps the orchestrator relay."},{heading:"a-registry-client-certificate-or-a-login",content:"Ports 7443 and 4873 are always on, with the private server certificate. Let's Encrypt stays on the console name only. Caddy checks a presented certificate and refuses a bad one. It injects a read account for every valid certificate except the orchestrator's, and a write account for that one certificate. A request with no certificate keeps the caller's login. The registries themselves stay on a network the host does not publish."}],headings:[{id:"a-registry-client-certificate-or-a-login",content:"A registry client certificate or a login"}]},aT=[{depth:1,url:"#a-registry-client-certificate-or-a-login",title:(0,V.jsx)(V.Fragment,{children:"A registry client certificate or a login"})}];function aU(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-registry-client-certificate-or-a-login",children:"A registry client certificate or a login"}),"\n",(0,V.jsx)(b.p,{children:"Zot and Verdaccio accept no anonymous request. Caddy is the only way in. A certificate signed by the platform intermediate authenticates a machine. A person without a certificate uses docker login or npm login. The console does not call the registries. It keeps the orchestrator relay."}),"\n",(0,V.jsx)(b.p,{children:"Ports 7443 and 4873 are always on, with the private server certificate. Let's Encrypt stays on the console name only. Caddy checks a presented certificate and refuses a bad one. It injects a read account for every valid certificate except the orchestrator's, and a write account for that one certificate. A request with no certificate keeps the caller's login. The registries themselves stay on a network the host does not publish."})]})}function aV(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(aU,{...a})}):aU(a)}let aW={title:"Caddy has a desktop placement"},aX=[],aY={contents:[{heading:"caddy-has-a-desktop-placement",content:"ORCH_CADDY_PLACEMENT chooses how Caddy reaches the machine. Unset, or host, keeps Caddy on the Linux host network: it sees the real client address, and it reaches the orchestrator and the console on 127.0.0.1. desktop puts Caddy on the platform network and publishes the edge ports, so the same overlay runs on Linux, Mac, and Docker Desktop. Caddy then reaches the orchestrator and the console through host.docker.internal, and those two processes listen on 0.0.0.0. The service addresses stay on the platform network."},{heading:"caddy-has-a-desktop-placement",content:"A connection from the machine arrives as the gateway 172.30.0.1 on Linux. Docker Desktop presents it as another address, which this machine sets in ORCH_CADDY_LOCAL_CIDR. The desktop placement adds that value to the Caddyfile and to pg_hba.conf, next to the gateway, so enrollment from this machine is accepted and saving an address list is not refused. An empty value leaves the gateway as the only extra address. The host placement does not read the variable, so the address is absent from a production Caddyfile and from pg_hba.conf. The list does not distinguish clients. Checking it still uses the host placement on Linux. Windows is left aside: Docker Desktop mounts a Windows path at a different path inside the container, and the Caddyfile uses one absolute path for both."}],headings:[{id:"caddy-has-a-desktop-placement",content:"Caddy has a desktop placement"}]},aZ=[{depth:1,url:"#caddy-has-a-desktop-placement",title:(0,V.jsx)(V.Fragment,{children:"Caddy has a desktop placement"})}];function a$(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"caddy-has-a-desktop-placement",children:"Caddy has a desktop placement"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ORCH_CADDY_PLACEMENT"})," chooses how Caddy reaches the machine. Unset, or ",(0,V.jsx)(b.code,{children:"host"}),", keeps Caddy on the Linux host network: it sees the real client address, and it reaches the orchestrator and the console on ",(0,V.jsx)(b.code,{children:"127.0.0.1"}),". ",(0,V.jsx)(b.code,{children:"desktop"})," puts Caddy on the platform network and publishes the edge ports, so the same overlay runs on Linux, Mac, and Docker Desktop. Caddy then reaches the orchestrator and the console through ",(0,V.jsx)(b.code,{children:"host.docker.internal"}),", and those two processes listen on ",(0,V.jsx)(b.code,{children:"0.0.0.0"}),". The service addresses stay on the platform network."]}),"\n",(0,V.jsxs)(b.p,{children:["A connection from the machine arrives as the gateway ",(0,V.jsx)(b.code,{children:"172.30.0.1"})," on Linux. Docker Desktop presents it as another address, which this machine sets in ",(0,V.jsx)(b.code,{children:"ORCH_CADDY_LOCAL_CIDR"}),". The desktop placement adds that value to the Caddyfile and to ",(0,V.jsx)(b.code,{children:"pg_hba.conf"}),", next to the gateway, so enrollment from this machine is accepted and saving an address list is not refused. An empty value leaves the gateway as the only extra address. The host placement does not read the variable, so the address is absent from a production Caddyfile and from ",(0,V.jsx)(b.code,{children:"pg_hba.conf"}),". The list does not distinguish clients. Checking it still uses the host placement on Linux. Windows is left aside: Docker Desktop mounts a Windows path at a different path inside the container, and the Caddyfile uses one absolute path for both."]})]})}function a_(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(a$,{...a})}):a$(a)}let a0={title:"One router consumes a slot"},a1=[],a2={contents:[{heading:"one-router-consumes-a-slot",content:"A finish leaves an open run on its revision and sends a new job to the pinned revision, on the same queue. The slot does not take that queue. One router, the process of the slot, is the only consumer of the kind. It gives the job to the worker of the job's revision, or of the pinned revision when the job names none, and it waits when that revision has no worker on the slot or that worker is at its concurrency. A consumer per revision was the other choice, and it was set aside: the kind would then have two rate limits and two pulses on one queue."},{heading:"one-router-consumes-a-slot",content:"The worker is one revision of that kind, a process or a container. It receives one job and returns the result envelope, and its logs stay apart from that envelope. It does not take the queue and it does not call the orchestrator. The router publishes the envelope. The pulse and a step metric keep the worker id and the slot id carried by the router. The router may hold as many jobs as its workers allow together, so one revision can be full while the other still takes work. A job for the full revision still waits. While both revisions are open, the slot lists two workers: its cpu and memory are the sum, concurrency is not added into the machine budget, and the rate limit stays the kind's, once. In process mode the router's launch starts the worker processes. In container mode the supervisor starts the containers and hands over the pipes. The supervisor remains the only process that talks to Docker."},{heading:"one-router-consumes-a-slot",content:"The organization revision stays the hash of the flow catalog and the steps file. The catalog carries no step run. A step package is addressed by the hash of that kind, and a runtime package by the runtime revision, so a change of step code does not move the runtime. A runtime prefix is installed once for a machine. A prefix already recorded is left in place."}],headings:[{id:"one-router-consumes-a-slot",content:"One router consumes a slot"}]},a3=[{depth:1,url:"#one-router-consumes-a-slot",title:(0,V.jsx)(V.Fragment,{children:"One router consumes a slot"})}];function a4(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"one-router-consumes-a-slot",children:"One router consumes a slot"}),"\n",(0,V.jsx)(b.p,{children:"A finish leaves an open run on its revision and sends a new job to the pinned revision, on the same queue. The slot does not take that queue. One router, the process of the slot, is the only consumer of the kind. It gives the job to the worker of the job's revision, or of the pinned revision when the job names none, and it waits when that revision has no worker on the slot or that worker is at its concurrency. A consumer per revision was the other choice, and it was set aside: the kind would then have two rate limits and two pulses on one queue."}),"\n",(0,V.jsx)(b.p,{children:"The worker is one revision of that kind, a process or a container. It receives one job and returns the result envelope, and its logs stay apart from that envelope. It does not take the queue and it does not call the orchestrator. The router publishes the envelope. The pulse and a step metric keep the worker id and the slot id carried by the router. The router may hold as many jobs as its workers allow together, so one revision can be full while the other still takes work. A job for the full revision still waits. While both revisions are open, the slot lists two workers: its cpu and memory are the sum, concurrency is not added into the machine budget, and the rate limit stays the kind's, once. In process mode the router's launch starts the worker processes. In container mode the supervisor starts the containers and hands over the pipes. The supervisor remains the only process that talks to Docker."}),"\n",(0,V.jsx)(b.p,{children:"The organization revision stays the hash of the flow catalog and the steps file. The catalog carries no step run. A step package is addressed by the hash of that kind, and a runtime package by the runtime revision, so a change of step code does not move the runtime. A runtime prefix is installed once for a machine. A prefix already recorded is left in place."})]})}function a5(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(a4,{...a})}):a4(a)}let a6={title:"A runtime revision excludes platform and device"},a7=[],a8={contents:[{heading:"a-runtime-revision-excludes-platform-and-device",content:"A runtime is published for more than one machine. Putting the platform or the device into the revision would make those publications different revisions. The revision excludes both: the architecture is chosen in the image index, and the device is a suffix of the tag."}],headings:[{id:"a-runtime-revision-excludes-platform-and-device",content:"A runtime revision excludes platform and device"}]},a9=[{depth:1,url:"#a-runtime-revision-excludes-platform-and-device",title:(0,V.jsx)(V.Fragment,{children:"A runtime revision excludes platform and device"})}];function ba(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-runtime-revision-excludes-platform-and-device",children:"A runtime revision excludes platform and device"}),"\n",(0,V.jsx)(b.p,{children:"A runtime is published for more than one machine. Putting the platform or the device into the revision would make those publications different revisions. The revision excludes both: the architecture is chosen in the image index, and the device is a suffix of the tag."})]})}function bb(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(ba,{...a})}):ba(a)}let bc={title:"Variables belong to the environment"},bd=[],be={contents:[{heading:"variables-belong-to-the-environment",content:"An organization's variables used to be one shared set. A local supervisor and a production supervisor then loaded the same parameters."},{heading:"variables-belong-to-the-environment",content:"Each environment now has its own variables and secrets. The worker attached to that environment loads them once. A shared organization set that an environment could override was the other choice, and it was set aside: the environment is the place a person configures, and a new environment starts empty."}],headings:[{id:"variables-belong-to-the-environment",content:"Variables belong to the environment"}]},bf=[{depth:1,url:"#variables-belong-to-the-environment",title:(0,V.jsx)(V.Fragment,{children:"Variables belong to the environment"})}];function bg(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"variables-belong-to-the-environment",children:"Variables belong to the environment"}),"\n",(0,V.jsx)(b.p,{children:"An organization's variables used to be one shared set. A local supervisor and a production supervisor then loaded the same parameters."}),"\n",(0,V.jsx)(b.p,{children:"Each environment now has its own variables and secrets. The worker attached to that environment loads them once. A shared organization set that an environment could override was the other choice, and it was set aside: the environment is the place a person configures, and a new environment starts empty."})]})}function bh(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(bg,{...a})}):bg(a)}let bi={title:"An opening gives every child the same silence"},bj=[],bk={contents:[{heading:"an-opening-gives-every-child-the-same-silence",content:"A child element used to carry its own starting data, and that starting data could replace the silence of every step of that one child. Two children of one call could therefore wait differently, and the silence was decided beside the payload rather than by the flow that opened them."},{heading:"an-opening-gives-every-child-the-same-silence",content:"A child element now carries an identifier and a payload. The call that opens the children may pass one silence, a duration and a resend maximum together. That silence is written onto each child run the call starts, and it replaces the silence of every step of those runs. When the call omits it, each step keeps the silence declared on the step. A child that is already running keeps the silence it started with."},{heading:"an-opening-gives-every-child-the-same-silence",content:"A person who opens or replays a flow may still replace the silence of that run. That replacement stays on the starting data of the run. It is not a field of the child."}],headings:[{id:"an-opening-gives-every-child-the-same-silence",content:"An opening gives every child the same silence"}]},bl=[{depth:1,url:"#an-opening-gives-every-child-the-same-silence",title:(0,V.jsx)(V.Fragment,{children:"An opening gives every child the same silence"})}];function bm(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"an-opening-gives-every-child-the-same-silence",children:"An opening gives every child the same silence"}),"\n",(0,V.jsx)(b.p,{children:"A child element used to carry its own starting data, and that starting data could replace the silence of every step of that one child. Two children of one call could therefore wait differently, and the silence was decided beside the payload rather than by the flow that opened them."}),"\n",(0,V.jsx)(b.p,{children:"A child element now carries an identifier and a payload. The call that opens the children may pass one silence, a duration and a resend maximum together. That silence is written onto each child run the call starts, and it replaces the silence of every step of those runs. When the call omits it, each step keeps the silence declared on the step. A child that is already running keeps the silence it started with."}),"\n",(0,V.jsx)(b.p,{children:"A person who opens or replays a flow may still replace the silence of that run. That replacement stays on the starting data of the run. It is not a field of the child."})]})}function bn(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(bm,{...a})}):bm(a)}let bo={title:"A sealed report carries each child's return"},bp=[],bq={contents:[{heading:"a-sealed-report-carries-each-childs-return",content:"Each element of a sealed children report has a body. It is the return the child flow validated with returns, already stored on that run. sealChildren copies it when the report seals. memberElements copies it too, so a group that contains those children keeps the body."},{heading:"a-sealed-report-carries-each-childs-return",content:"The element still has its identifier, its discriminant, and its flow. A success carries that return. A failure and a not finished child carry an empty body, with discriminant failure or not_finished. The failure discriminant stays collapsed to failure, as the parent of one child already receives it. The array is the sealed elements. A child that is still open is not in it."},{heading:"a-sealed-report-carries-each-childs-return",content:"The body is the small object the flow declares. It does not carry HTML, a file, or a values patch. A parent of one child already received this return. The list does the same. A reader that ignores body stays valid."}],headings:[{id:"a-sealed-report-carries-each-childs-return",content:"A sealed report carries each child's return"}]},br=[{depth:1,url:"#a-sealed-report-carries-each-childs-return",title:(0,V.jsx)(V.Fragment,{children:"A sealed report carries each child's return"})}];function bs(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-sealed-report-carries-each-childs-return",children:"A sealed report carries each child's return"}),"\n",(0,V.jsxs)(b.p,{children:["Each element of a sealed children report has a ",(0,V.jsx)(b.code,{children:"body"}),". It is the return the child flow validated with ",(0,V.jsx)(b.code,{children:"returns"}),", already stored on that run. ",(0,V.jsx)(b.code,{children:"sealChildren"})," copies it when the report seals. ",(0,V.jsx)(b.code,{children:"memberElements"})," copies it too, so a group that contains those children keeps the body."]}),"\n",(0,V.jsxs)(b.p,{children:["The element still has its identifier, its discriminant, and its flow. A success carries that return. A failure and a not finished child carry an empty body, with discriminant ",(0,V.jsx)(b.code,{children:"failure"})," or ",(0,V.jsx)(b.code,{children:"not_finished"}),". The failure discriminant stays collapsed to ",(0,V.jsx)(b.code,{children:"failure"}),", as the parent of one child already receives it. The array is the sealed elements. A child that is still open is not in it."]}),"\n",(0,V.jsxs)(b.p,{children:["The body is the small object the flow declares. It does not carry HTML, a file, or a values patch. A parent of one child already received this return. The list does the same. A reader that ignores ",(0,V.jsx)(b.code,{children:"body"})," stays valid."]})]})}function bt(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(bs,{...a})}):bs(a)}let bu={title:"An optional quota lets the parent continue"},bv=[],bw={contents:[{heading:void 0,content:"Superseded by ADR 0033."},{heading:"an-optional-quota-lets-the-parent-continue",content:"openOptionalChildren may take a third argument, { count?: number; withinMin?: number }. Without that argument, the opening still waits until every child run has ended. A failure and a not finished run do not stop the parent, and the end reason is all. ADR 0021 records that opening."},{heading:"an-optional-quota-lets-the-parent-continue",content:"The flow does not read the clock. withinMin is a whole number of minutes, at least 1. count, when present, is a whole number of at least 0. On the first opening, the children frame stores openedAt. The deadline is openedAt plus withinMin minutes. A reread compares count and withinMin. It does not compare an absolute time, so a later read does not diverge. A required opening keeps its absolute at. A missed deadline still fails that opening."},{heading:"an-optional-quota-lets-the-parent-continue",content:"When count is present, the target is the smaller of count and the number of children. The report seals, and the parent continues, in this order. As many child runs have succeeded as the target: end reason quota. The duration is reached: end reason deadline, with the children that have already ended. The target can no longer be reached: end reason quota, with what has already ended. Every child has ended: end reason all."},{heading:"an-optional-quota-lets-the-parent-continue",content:"Only a successful child run counts toward the target. A failure does not fill the quota, and it does not stop the parent. Children that are still open keep running and stay out of the sealed report. A result that arrives later does not change the report."}],headings:[{id:"an-optional-quota-lets-the-parent-continue",content:"An optional quota lets the parent continue"}]},bx=[{depth:1,url:"#an-optional-quota-lets-the-parent-continue",title:(0,V.jsx)(V.Fragment,{children:"An optional quota lets the parent continue"})}];function by(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.p,{children:"Superseded by ADR 0033."}),"\n",(0,V.jsx)(b.h1,{id:"an-optional-quota-lets-the-parent-continue",children:"An optional quota lets the parent continue"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"openOptionalChildren"})," may take a third argument, ",(0,V.jsx)(b.code,{children:"{ count?: number; withinMin?: number }"}),". Without that argument, the opening still waits until every child run has ended. A failure and a not finished run do not stop the parent, and the end reason is ",(0,V.jsx)(b.code,{children:"all"}),". ADR 0021 records that opening."]}),"\n",(0,V.jsxs)(b.p,{children:["The flow does not read the clock. ",(0,V.jsx)(b.code,{children:"withinMin"})," is a whole number of minutes, at least 1. ",(0,V.jsx)(b.code,{children:"count"}),", when present, is a whole number of at least 0. On the first opening, the children frame stores ",(0,V.jsx)(b.code,{children:"openedAt"}),". The deadline is ",(0,V.jsx)(b.code,{children:"openedAt"})," plus ",(0,V.jsx)(b.code,{children:"withinMin"})," minutes. A reread compares ",(0,V.jsx)(b.code,{children:"count"})," and ",(0,V.jsx)(b.code,{children:"withinMin"}),". It does not compare an absolute time, so a later read does not diverge. A required opening keeps its absolute ",(0,V.jsx)(b.code,{children:"at"}),". A missed deadline still fails that opening."]}),"\n",(0,V.jsxs)(b.p,{children:["When ",(0,V.jsx)(b.code,{children:"count"})," is present, the target is the smaller of ",(0,V.jsx)(b.code,{children:"count"})," and the number of children. The report seals, and the parent continues, in this order. As many child runs have succeeded as the target: end reason ",(0,V.jsx)(b.code,{children:"quota"}),". The duration is reached: end reason ",(0,V.jsx)(b.code,{children:"deadline"}),", with the children that have already ended. The target can no longer be reached: end reason ",(0,V.jsx)(b.code,{children:"quota"}),", with what has already ended. Every child has ended: end reason ",(0,V.jsx)(b.code,{children:"all"}),"."]}),"\n",(0,V.jsx)(b.p,{children:"Only a successful child run counts toward the target. A failure does not fill the quota, and it does not stop the parent. Children that are still open keep running and stay out of the sealed report. A result that arrives later does not change the report."})]})}function bz(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(by,{...a})}):by(a)}let bA={title:"Optional children are waited on"},bB=[],bC={contents:[{heading:void 0,content:"Superseded by ADR 0033."},{heading:"optional-children-are-waited-on",content:"openChildren still requires every child run to succeed, or the quota or the deadline of that opening. A failure or a not finished child stops the parent, as ADR 0017 describes."},{heading:"optional-children-are-waited-on",content:"openOptionalChildren opens one child or an array and waits until each child run has ended. A failure and a not finished run do not stop the parent. An array seals once every child has ended, with end reason all, and the report lists each child that ended. An empty array seals at once. The opening takes no quota and no deadline."},{heading:"optional-children-are-waited-on",content:"Inside a group, that opening stays open until it seals. A required step and a required array of children in the same group are still judged as ADR 0017 describes. A reread that changes an opening between required and optional diverges and ends the run."}],headings:[{id:"optional-children-are-waited-on",content:"Optional children are waited on"}]},bD=[{depth:1,url:"#optional-children-are-waited-on",title:(0,V.jsx)(V.Fragment,{children:"Optional children are waited on"})}];function bE(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.p,{children:"Superseded by ADR 0033."}),"\n",(0,V.jsx)(b.h1,{id:"optional-children-are-waited-on",children:"Optional children are waited on"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"openChildren"})," still requires every child run to succeed, or the quota or the deadline of that opening. A failure or a not finished child stops the parent, as ADR 0017 describes."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"openOptionalChildren"})," opens one child or an array and waits until each child run has ended. A failure and a not finished run do not stop the parent. An array seals once every child has ended, with end reason ",(0,V.jsx)(b.code,{children:"all"}),", and the report lists each child that ended. An empty array seals at once. The opening takes no quota and no deadline."]}),"\n",(0,V.jsx)(b.p,{children:"Inside a group, that opening stays open until it seals. A required step and a required array of children in the same group are still judged as ADR 0017 describes. A reread that changes an opening between required and optional diverges and ends the run."})]})}function bF(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(bE,{...a})}):bE(a)}let bG={title:"Each array of children carries its rule"},bH=[],bI={contents:[{heading:"each-array-of-children-carries-its-rule",content:"A flow used to store one rule, and every group copied it. Two openings in the same group could not be judged differently, and a quota sealed the group as soon as one member of any kind was done."},{heading:"each-array-of-children-carries-its-rule",content:"The rule now belongs to the call that opens an array of children. The omitted rule is that every child run succeeds. The call may pass a quota or a deadline instead. An empty array seals at once. An array of one child is still judged by that rule and returns a sealed report. An object is one child: it has no rule, and a result that is not done stops the parent."},{heading:"each-array-of-children-carries-its-rule",content:"A group no longer takes a rule. It waits until every required member is done, as ADR 0017 describes. An array of children is one member of that group, done once its own report is sealed. A quota still seals as soon as the share is reached, and children that are still open stay out of that report."},{heading:"each-array-of-children-carries-its-rule",content:"The flow run no longer stores a rule. A reread that passes a different rule to the same opening diverges and ends the run."}],headings:[{id:"each-array-of-children-carries-its-rule",content:"Each array of children carries its rule"}]},bJ=[{depth:1,url:"#each-array-of-children-carries-its-rule",title:(0,V.jsx)(V.Fragment,{children:"Each array of children carries its rule"})}];function bK(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"each-array-of-children-carries-its-rule",children:"Each array of children carries its rule"}),"\n",(0,V.jsx)(b.p,{children:"A flow used to store one rule, and every group copied it. Two openings in the same group could not be judged differently, and a quota sealed the group as soon as one member of any kind was done."}),"\n",(0,V.jsx)(b.p,{children:"The rule now belongs to the call that opens an array of children. The omitted rule is that every child run succeeds. The call may pass a quota or a deadline instead. An empty array seals at once. An array of one child is still judged by that rule and returns a sealed report. An object is one child: it has no rule, and a result that is not done stops the parent."}),"\n",(0,V.jsx)(b.p,{children:"A group no longer takes a rule. It waits until every required member is done, as ADR 0017 describes. An array of children is one member of that group, done once its own report is sealed. A quota still seals as soon as the share is reached, and children that are still open stay out of that report."}),"\n",(0,V.jsx)(b.p,{children:"The flow run no longer stores a rule. A reread that passes a different rule to the same opening diverges and ends the run."})]})}function bL(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(bK,{...a})}):bK(a)}let bM={title:"A typed body sits beside the result envelope"},bN=[],bO={contents:[{heading:"a-typed-body-sits-beside-the-result-envelope",content:"A step result is an envelope: kind, status, discriminant, the file names that step wrote, and the values applied to the entity. The step may also declare a schema for a body. The body is stored on the step. A body that fails the schema ends that step as failed. Values from that result are not applied."},{heading:"a-typed-body-sits-beside-the-result-envelope",content:"An array of children is a body, not a field of the envelope. The flow reads that body and passes the children to openChildren or each. The payload of a later step is built from those bodies, and the step's input schema checks it the same way starting data is checked."},{heading:"a-typed-body-sits-beside-the-result-envelope",content:"finish keeps its discriminant as a string and stores a body checked by the flow's return schema. A parent of one child receives that body with the envelope. The parent composes the next opening from that body."},{heading:"a-typed-body-sits-beside-the-result-envelope",content:"The bytes stay under runs/{organization}/{flow}/{identifier}/{generation}/. The body, the payload, and the file names stay on the flow run."}],headings:[{id:"a-typed-body-sits-beside-the-result-envelope",content:"A typed body sits beside the result envelope"}]},bP=[{depth:1,url:"#a-typed-body-sits-beside-the-result-envelope",title:(0,V.jsx)(V.Fragment,{children:"A typed body sits beside the result envelope"})}];function bQ(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-typed-body-sits-beside-the-result-envelope",children:"A typed body sits beside the result envelope"}),"\n",(0,V.jsx)(b.p,{children:"A step result is an envelope: kind, status, discriminant, the file names that step wrote, and the values applied to the entity. The step may also declare a schema for a body. The body is stored on the step. A body that fails the schema ends that step as failed. Values from that result are not applied."}),"\n",(0,V.jsxs)(b.p,{children:["An array of children is a body, not a field of the envelope. The flow reads that body and passes the children to ",(0,V.jsx)(b.code,{children:"openChildren"})," or ",(0,V.jsx)(b.code,{children:"each"}),". The payload of a later step is built from those bodies, and the step's input schema checks it the same way starting data is checked."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"finish"})," keeps its discriminant as a string and stores a body checked by the flow's return schema. A parent of one child receives that body with the envelope. The parent composes the next opening from that body."]}),"\n",(0,V.jsxs)(b.p,{children:["The bytes stay under ",(0,V.jsx)(b.code,{children:"runs/{organization}/{flow}/{identifier}/{generation}/"}),". The body, the payload, and the file names stay on the flow run."]})]})}function bR(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(bQ,{...a})}):bQ(a)}let bS={title:"A replay from a step copies the kept files"},bT=[],bU={contents:[{heading:"a-replay-from-a-step-copies-the-kept-files",content:"ADR 0009 said a file written for a generation is not reused. A replay from a step keeps the steps before that step, and those steps already named the files they wrote. The new generation receives a copy of each of those names. The last write of a repeated name is the one copied."},{heading:"a-replay-from-a-step-copies-the-kept-files",content:"The copy is a publication of kind file, written in the same transaction as the run and the jobs. The drain copies the bytes before it sends a job of that generation. A job is not sent until those copies are published. The copy can be run again. A full replay starts a generation with no kept steps, so it copies nothing. Reading a name still reads the current generation."}],headings:[{id:"a-replay-from-a-step-copies-the-kept-files",content:"A replay from a step copies the kept files"}]},bV=[{depth:1,url:"#a-replay-from-a-step-copies-the-kept-files",title:(0,V.jsx)(V.Fragment,{children:"A replay from a step copies the kept files"})}];function bW(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-replay-from-a-step-copies-the-kept-files",children:"A replay from a step copies the kept files"}),"\n",(0,V.jsx)(b.p,{children:"ADR 0009 said a file written for a generation is not reused. A replay from a step keeps the steps before that step, and those steps already named the files they wrote. The new generation receives a copy of each of those names. The last write of a repeated name is the one copied."}),"\n",(0,V.jsxs)(b.p,{children:["The copy is a publication of kind ",(0,V.jsx)(b.code,{children:"file"}),", written in the same transaction as the run and the jobs. The drain copies the bytes before it sends a job of that generation. A job is not sent until those copies are published. The copy can be run again. A full replay starts a generation with no kept steps, so it copies nothing. Reading a name still reads the current generation."]})]})}function bX(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(bW,{...a})}):bW(a)}let bY={title:"A group judges its required members"},bZ=[],b$={contents:[{heading:"a-group-judges-its-required-members",content:"ADR 0008 let a flow call guard after a result. That call is gone. A required step whose result is failed ends the run in failure, and the next opening does not run. A required step whose result is not finished ends the run not finished. An optional step and a detached step do not stop the run. One child opened on the flow stops the parent the same way."},{heading:"a-group-judges-its-required-members",content:"A group always waits until every required member is done. A required member is an openStep or a child opening. An optional step is waited on and is not a member of that judgment. Success is a result whose status is done, a single child run whose status is success, or an array of children whose own report is sealed. A not finished member is not a success."},{heading:"a-group-judges-its-required-members",content:"The first required failure ends the run in failure. The first required not finished, when nothing has failed, ends the run not finished. A quota and a deadline belong to an array of children, not to the group. ADR 0020 records that."},{heading:"a-group-judges-its-required-members",content:"When the run stops for one of these reasons, a still-open required or optional step closes as not finished, discriminant ended. A detached step stays open. each is unchanged."}],headings:[{id:"a-group-judges-its-required-members",content:"A group judges its required members"}]},b_=[{depth:1,url:"#a-group-judges-its-required-members",title:(0,V.jsx)(V.Fragment,{children:"A group judges its required members"})}];function b0(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-group-judges-its-required-members",children:"A group judges its required members"}),"\n",(0,V.jsxs)(b.p,{children:["ADR 0008 let a flow call ",(0,V.jsx)(b.code,{children:"guard"})," after a result. That call is gone. A required step whose result is failed ends the run in failure, and the next opening does not run. A required step whose result is not finished ends the run not finished. An optional step and a detached step do not stop the run. One child opened on the flow stops the parent the same way."]}),"\n",(0,V.jsxs)(b.p,{children:["A group always waits until every required member is done. A required member is an ",(0,V.jsx)(b.code,{children:"openStep"})," or a child opening. An optional step is waited on and is not a member of that judgment. Success is a result whose status is done, a single child run whose status is success, or an array of children whose own report is sealed. A not finished member is not a success."]}),"\n",(0,V.jsx)(b.p,{children:"The first required failure ends the run in failure. The first required not finished, when nothing has failed, ends the run not finished. A quota and a deadline belong to an array of children, not to the group. ADR 0020 records that."}),"\n",(0,V.jsxs)(b.p,{children:["When the run stops for one of these reasons, a still-open required or optional step closes as not finished, discriminant ",(0,V.jsx)(b.code,{children:"ended"}),". A detached step stays open. ",(0,V.jsx)(b.code,{children:"each"})," is unchanged."]})]})}function b1(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(b0,{...a})}):b0(a)}let b2={title:"One writer per organization"},b3=[],b4={contents:[{heading:"one-writer-per-organization",content:"Several orchestrator processes may apply results. Each process owns a disjoint set of organizations. Two organizations do not share an entity, and a child stays in its parent's organization. There is no split by entity hash: a parent and its child would then have two writers."},{heading:"one-writer-per-organization",content:"A process owns an organization while it holds the lease orchestrator:owner:<organization>. The same owner renews that lease. A process that does not hold it does not read that organization's results, and does not advance or fire crons for it. Results travel on step-results:<organization>. Pending messages on the old step-results stream are not replayed."},{heading:"one-writer-per-organization",content:"Purge no longer runs at the start of advance. A separate loop purges finished runs of the owned organizations. A running run is still never removed. The in-process mutex still serializes applying a result with advance. It does not cross processes."},{heading:"one-writer-per-organization",content:"A live opening of more than 20000 children fails the run before any child is created. A discarded arm does not."}],headings:[{id:"one-writer-per-organization",content:"One writer per organization"}]},b5=[{depth:1,url:"#one-writer-per-organization",title:(0,V.jsx)(V.Fragment,{children:"One writer per organization"})}];function b6(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"one-writer-per-organization",children:"One writer per organization"}),"\n",(0,V.jsx)(b.p,{children:"Several orchestrator processes may apply results. Each process owns a disjoint set of organizations. Two organizations do not share an entity, and a child stays in its parent's organization. There is no split by entity hash: a parent and its child would then have two writers."}),"\n",(0,V.jsxs)(b.p,{children:["A process owns an organization while it holds the lease ",(0,V.jsx)(b.code,{children:"orchestrator:owner:<organization>"}),". The same owner renews that lease. A process that does not hold it does not read that organization's results, and does not advance or fire crons for it. Results travel on ",(0,V.jsx)(b.code,{children:"step-results:<organization>"}),". Pending messages on the old ",(0,V.jsx)(b.code,{children:"step-results"})," stream are not replayed."]}),"\n",(0,V.jsx)(b.p,{children:"Purge no longer runs at the start of advance. A separate loop purges finished runs of the owned organizations. A running run is still never removed. The in-process mutex still serializes applying a result with advance. It does not cross processes."}),"\n",(0,V.jsx)(b.p,{children:"A live opening of more than 20000 children fails the run before any child is created. A discarded arm does not."})]})}function b7(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(b6,{...a})}):b6(a)}let b8={title:"Jobs and metrics leave with the run"},b9=[],ca={contents:[{heading:"jobs-and-metrics-leave-with-the-run",content:"The transaction that writes a run also writes each job and each metric that leaves with it. A drain sends those rows after the commit, and again at the start of advance when a crash left rows unpublished. The token is chosen in the transaction. A second send of that token keeps the dispatch packet. If the send fails, the row stays and the committed run still stands. A job carries no secret. The silence duration does not change."}],headings:[{id:"jobs-and-metrics-leave-with-the-run",content:"Jobs and metrics leave with the run"}]},cb=[{depth:1,url:"#jobs-and-metrics-leave-with-the-run",title:(0,V.jsx)(V.Fragment,{children:"Jobs and metrics leave with the run"})}];function cc(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"jobs-and-metrics-leave-with-the-run",children:"Jobs and metrics leave with the run"}),"\n",(0,V.jsx)(b.p,{children:"The transaction that writes a run also writes each job and each metric that leaves with it. A drain sends those rows after the commit, and again at the start of advance when a crash left rows unpublished. The token is chosen in the transaction. A second send of that token keeps the dispatch packet. If the send fails, the row stays and the committed run still stands. A job carries no secret. The silence duration does not change."})]})}function cd(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(cc,{...a})}):cc(a)}let ce={title:"A shared child is claimed before its run"},cf=[],cg={contents:[{heading:"a-shared-child-is-claimed-before-its-run",content:"Two runs that open the same child claim that flow on the entity before either writes the run. The second attaches to the running run and does not send a second job."}],headings:[{id:"a-shared-child-is-claimed-before-its-run",content:"A shared child is claimed before its run"}]},ch=[{depth:1,url:"#a-shared-child-is-claimed-before-its-run",title:(0,V.jsx)(V.Fragment,{children:"A shared child is claimed before its run"})}];function ci(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-shared-child-is-claimed-before-its-run",children:"A shared child is claimed before its run"}),"\n",(0,V.jsx)(b.p,{children:"Two runs that open the same child claim that flow on the entity before either writes the run. The second attaches to the running run and does not send a second job."})]})}function cj(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(ci,{...a})}):ci(a)}let ck={title:"A run does not wait on its ancestor"},cl=[],cm={contents:[{heading:"a-run-does-not-wait-on-its-ancestor",content:"A run waits while a child it opened is still running. That wait never ends if the child is the current run, or a run already above it. The same wait never ends when each child opens another without a bound. Reaching the silence duration does not resume that run: a run with a running child stays waiting."},{heading:"a-run-does-not-wait-on-its-ancestor",content:"Before opening a child, the engine collects the current run and every run above it. When the child is already one of those runs, the current run ends in failure and the child is not opened. The same failure happens when 8 or more runs sit strictly above the current run. That bound is the longest chain of parents, not the number of parents. A landing page opened by many ads is one level deep. An ancestor that was waiting resumes in that same transition. A chain of 8 openings still runs. The ninth ends the run that tried to open it."}],headings:[{id:"a-run-does-not-wait-on-its-ancestor",content:"A run does not wait on its ancestor"}]},cn=[{depth:1,url:"#a-run-does-not-wait-on-its-ancestor",title:(0,V.jsx)(V.Fragment,{children:"A run does not wait on its ancestor"})}];function co(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-run-does-not-wait-on-its-ancestor",children:"A run does not wait on its ancestor"}),"\n",(0,V.jsx)(b.p,{children:"A run waits while a child it opened is still running. That wait never ends if the child is the current run, or a run already above it. The same wait never ends when each child opens another without a bound. Reaching the silence duration does not resume that run: a run with a running child stays waiting."}),"\n",(0,V.jsx)(b.p,{children:"Before opening a child, the engine collects the current run and every run above it. When the child is already one of those runs, the current run ends in failure and the child is not opened. The same failure happens when 8 or more runs sit strictly above the current run. That bound is the longest chain of parents, not the number of parents. A landing page opened by many ads is one level deep. An ancestor that was waiting resumes in that same transition. A chain of 8 openings still runs. The ninth ends the run that tried to open it."})]})}function cp(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(co,{...a})}):co(a)}let cq={title:"A step name is opened once per run"},cr=[],cs={contents:[{heading:"a-step-name-is-opened-once-per-run",content:"The name is the identity of a step in a run. The run finds that step by name, and the job names the same step. A second live opening of that name would mix with the first."},{heading:"a-step-name-is-opened-once-per-run",content:"When a flow creates a live step — a step, an optional step, or a detached step, including one opened in a group — and a step that is not discarded already has that name, the engine throws Step ${name} is already open. A discarded step does not count. A choice may name the same step on an arm that was not taken, and that step is not opened. Rereading the frame already at the cursor does not repeat the check. Distinct identifiers passed to each stay distinct steps."}],headings:[{id:"a-step-name-is-opened-once-per-run",content:"A step name is opened once per run"}]},ct=[{depth:1,url:"#a-step-name-is-opened-once-per-run",title:(0,V.jsx)(V.Fragment,{children:"A step name is opened once per run"})}];function cu(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-step-name-is-opened-once-per-run",children:"A step name is opened once per run"}),"\n",(0,V.jsx)(b.p,{children:"The name is the identity of a step in a run. The run finds that step by name, and the job names the same step. A second live opening of that name would mix with the first."}),"\n",(0,V.jsxs)(b.p,{children:["When a flow creates a live step — a step, an optional step, or a detached step, including one opened in a group — and a step that is not discarded already has that name, the engine throws ",(0,V.jsx)(b.code,{children:"Step ${name} is already open"}),". A discarded step does not count. A choice may name the same step on an arm that was not taken, and that step is not opened. Rereading the frame already at the cursor does not repeat the check. Distinct identifiers passed to each stay distinct steps."]})]})}function cv(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(cu,{...a})}):cu(a)}let cw={title:"A diverged reread ends the run"},cx=[],cy={contents:[{heading:"a-diverged-reread-ends-the-run",content:"A diverged reread, or any other error raised by the engine, ends that run in failure and keeps its flow metric. Each open step with no result is closed with a failed result marked diverged, so a later advance does not send its job again. A result for an entity that is absent is acknowledged and logged. A result for a run that is no longer running is ignored, except a detached step that still has no result. An error from Postgres or Redis is not acknowledged. After eight failures of the same result, that result is copied to the dead stream and acknowledged. The silence duration does not change."}],headings:[{id:"a-diverged-reread-ends-the-run",content:"A diverged reread ends the run"}]},cz=[{depth:1,url:"#a-diverged-reread-ends-the-run",title:(0,V.jsx)(V.Fragment,{children:"A diverged reread ends the run"})}];function cA(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-diverged-reread-ends-the-run",children:"A diverged reread ends the run"}),"\n",(0,V.jsx)(b.p,{children:"A diverged reread, or any other error raised by the engine, ends that run in failure and keeps its flow metric. Each open step with no result is closed with a failed result marked diverged, so a later advance does not send its job again. A result for an entity that is absent is acknowledged and logged. A result for a run that is no longer running is ignored, except a detached step that still has no result. An error from Postgres or Redis is not acknowledged. After eight failures of the same result, that result is copied to the dead stream and acknowledged. The silence duration does not change."})]})}function cB(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(cA,{...a})}):cA(a)}let cC={title:"Entity values are copied onto the run"},cD=[],cE={contents:[{heading:"entity-values-are-copied-onto-the-run",content:"The flow is reread from the start, so it cannot read the entity's live values: a later write would change the path already taken. The run keeps a copy from the opening. A worker does not write the entity. A step that changes values returns a patch on its result, and the orchestrator applies that patch only when it accepts the result for the running generation. A person may replace the entity's values; the open run still keeps its copy."}],headings:[{id:"entity-values-are-copied-onto-the-run",content:"Entity values are copied onto the run"}]},cF=[{depth:1,url:"#entity-values-are-copied-onto-the-run",title:(0,V.jsx)(V.Fragment,{children:"Entity values are copied onto the run"})}];function cG(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"entity-values-are-copied-onto-the-run",children:"Entity values are copied onto the run"}),"\n",(0,V.jsx)(b.p,{children:"The flow is reread from the start, so it cannot read the entity's live values: a later write would change the path already taken. The run keeps a copy from the opening. A worker does not write the entity. A step that changes values returns a patch on its result, and the orchestrator applies that patch only when it accepts the result for the running generation. A person may replace the entity's values; the open run still keeps its copy."})]})}function cH(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(cG,{...a})}):cG(a)}let cI={title:"A transient file lives with the flow run"},cJ=[],cK={contents:[{heading:"a-transient-file-lives-with-the-flow-run",content:"A step may write a file that the next step of the same run, or a child run, needs to read. The file is not part of the result. The result stays small, and the engine rereads that result. The bytes live in a platform bucket. The key is the organization, the flow, the identifier, the generation, and one file name."},{heading:"a-transient-file-lives-with-the-flow-run",content:"The flow run retention already decides when a finished run leaves Postgres. The same purge deletes the files of those runs. A running run is not removed, and neither are its files. A replay from a step copies the files of the kept steps into the new generation. A full replay does not. See ADR 0018."},{heading:"a-transient-file-lives-with-the-flow-run",content:"The bucket is platform configuration, read before an organization's secrets are installed. It is not the organization's own object store. A job still carries no secret."}],headings:[{id:"a-transient-file-lives-with-the-flow-run",content:"A transient file lives with the flow run"}]},cL=[{depth:1,url:"#a-transient-file-lives-with-the-flow-run",title:(0,V.jsx)(V.Fragment,{children:"A transient file lives with the flow run"})}];function cM(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-transient-file-lives-with-the-flow-run",children:"A transient file lives with the flow run"}),"\n",(0,V.jsx)(b.p,{children:"A step may write a file that the next step of the same run, or a child run, needs to read. The file is not part of the result. The result stays small, and the engine rereads that result. The bytes live in a platform bucket. The key is the organization, the flow, the identifier, the generation, and one file name."}),"\n",(0,V.jsx)(b.p,{children:"The flow run retention already decides when a finished run leaves Postgres. The same purge deletes the files of those runs. A running run is not removed, and neither are its files. A replay from a step copies the files of the kept steps into the new generation. A full replay does not. See ADR 0018."}),"\n",(0,V.jsx)(b.p,{children:"The bucket is platform configuration, read before an organization's secrets are installed. It is not the organization's own object store. A job still carries no secret."})]})}function cN(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(cM,{...a})}):cM(a)}let cO={title:"A flow may guard a result and repeat over elements"},cP=[],cQ={contents:[{heading:"a-flow-may-guard-a-result-and-repeat-over-elements",content:"ADR 0001 still holds: a flow is restricted TypeScript, and the orchestrator rereads it from the start. This adds two operations to the ones a flow may use."},{heading:"a-flow-may-guard-a-result-and-repeat-over-elements",content:"guard was a checkpoint on the same flow context. It is withdrawn. A required step that is not done stops the run itself. See ADR 0017. A stored guard operation can still be shown."},{heading:"a-flow-may-guard-a-result-and-repeat-over-elements",content:"each takes the elements and a body, on the flow and on a group. The body runs once for each element, and a later reread compares that same sequence. The description records one loop and walks the body once. A step opened with that element's identifier takes its name from the element."},{heading:"a-flow-may-guard-a-result-and-repeat-over-elements",content:"openChildren with an empty list records the opening and returns a sealed report with nothing in it. It does not wait. The description always includes that opening."},{heading:"a-flow-may-guard-a-result-and-repeat-over-elements",content:"The description is a graph. It is built by calling the flow on a context that opens nothing. It is not a run. Each operation of a run points at a node of that graph. The graph does not carry a status, an identifier, or an instant from a run."}],headings:[{id:"a-flow-may-guard-a-result-and-repeat-over-elements",content:"A flow may guard a result and repeat over elements"}]},cR=[{depth:1,url:"#a-flow-may-guard-a-result-and-repeat-over-elements",title:(0,V.jsx)(V.Fragment,{children:"A flow may guard a result and repeat over elements"})}];function cS(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-flow-may-guard-a-result-and-repeat-over-elements",children:"A flow may guard a result and repeat over elements"}),"\n",(0,V.jsx)(b.p,{children:"ADR 0001 still holds: a flow is restricted TypeScript, and the orchestrator rereads it from the start. This adds two operations to the ones a flow may use."}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"guard"})," was a checkpoint on the same flow context. It is withdrawn. A required step that is not done stops the run itself. See ADR 0017. A stored guard operation can still be shown."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"each"})," takes the elements and a body, on the flow and on a group. The body runs once for each element, and a later reread compares that same sequence. The description records one loop and walks the body once. A step opened with that element's identifier takes its name from the element."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"openChildren"})," with an empty list records the opening and returns a sealed report with nothing in it. It does not wait. The description always includes that opening."]}),"\n",(0,V.jsx)(b.p,{children:"The description is a graph. It is built by calling the flow on a context that opens nothing. It is not a run. Each operation of a run points at a node of that graph. The graph does not carry a status, an identifier, or an instant from a run."})]})}function cT(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(cS,{...a})}):cS(a)}let cU={title:"A flow run is kept, then only its metric remains"},cV=[],cW={contents:[{heading:"a-flow-run-is-kept-then-only-its-metric-remains",content:"An entity is an organization, an entity type, and an identifier. A flow is attached to one entity type, and several flows may share that type. Each execution of a flow on an entity is its own flow run, numbered by a generation. One run of that flow on that entity proceeds at a time. A request inside the validity duration returns the recorded result and does not open a run. Replaying opens a new generation and leaves the previous run."},{heading:"a-flow-run-is-kept-then-only-its-metric-remains",content:"Postgres keeps a finished flow run and its result for the flow run retention. A running run is not removed. The generation counter stays on the entity after the run is removed, so a later run does not reuse a generation that ClickHouse already recorded. After the retention, ClickHouse is the only record of that run, and the run is not clickable. Raw metrics and the hourly and daily aggregates each have their own retention. The engine rereads the result of a run that is still stored. It does not reread the metric."},{heading:"a-flow-run-is-kept-then-only-its-metric-remains",content:"This replaces the rule in ADR 0004 that the next flow run replaces the row, the rule in ADR 0006 that replaying reuses the run, and the rule in ADR 0003 that Postgres holds only the current flow run."}],headings:[{id:"a-flow-run-is-kept-then-only-its-metric-remains",content:"A flow run is kept, then only its metric remains"}]},cX=[{depth:1,url:"#a-flow-run-is-kept-then-only-its-metric-remains",title:(0,V.jsx)(V.Fragment,{children:"A flow run is kept, then only its metric remains"})}];function cY(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-flow-run-is-kept-then-only-its-metric-remains",children:"A flow run is kept, then only its metric remains"}),"\n",(0,V.jsx)(b.p,{children:"An entity is an organization, an entity type, and an identifier. A flow is attached to one entity type, and several flows may share that type. Each execution of a flow on an entity is its own flow run, numbered by a generation. One run of that flow on that entity proceeds at a time. A request inside the validity duration returns the recorded result and does not open a run. Replaying opens a new generation and leaves the previous run."}),"\n",(0,V.jsx)(b.p,{children:"Postgres keeps a finished flow run and its result for the flow run retention. A running run is not removed. The generation counter stays on the entity after the run is removed, so a later run does not reuse a generation that ClickHouse already recorded. After the retention, ClickHouse is the only record of that run, and the run is not clickable. Raw metrics and the hourly and daily aggregates each have their own retention. The engine rereads the result of a run that is still stored. It does not reread the metric."}),"\n",(0,V.jsx)(b.p,{children:"This replaces the rule in ADR 0004 that the next flow run replaces the row, the rule in ADR 0006 that replaying reuses the run, and the rule in ADR 0003 that Postgres holds only the current flow run."})]})}function cZ(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(cY,{...a})}):cY(a)}let c$={title:"One identity is one entity"},c_=[],c0={contents:[{heading:"one-identity-is-one-entity",content:"An entity was an organization and an identity. The same identity in two flows was one entity and two runs, because a person looks up the subject and then the flows that ran on it. ADR 0007 replaces that identity with an entity type and an identifier, and replaces the rule that replaying reuses the run. Validity stays defined once on the flow. Inside the validity duration the recorded result is returned. A different flow on the same entity does not replace the first run."},{heading:"one-identity-is-one-entity",content:"This replaces the rule in ADR 0002 that the same identity in two flows is two entities. One run of an organization, a flow, and an identity still proceeds at a time, and that run keeps the starting data of the request that started it. The stored row stays that run. A separate run name was rejected: replaying would otherwise leave two current trees for one flow."}],headings:[{id:"one-identity-is-one-entity",content:"One identity is one entity"}]},c1=[{depth:1,url:"#one-identity-is-one-entity",title:(0,V.jsx)(V.Fragment,{children:"One identity is one entity"})}];function c2(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"one-identity-is-one-entity",children:"One identity is one entity"}),"\n",(0,V.jsx)(b.p,{children:"An entity was an organization and an identity. The same identity in two flows was one entity and two runs, because a person looks up the subject and then the flows that ran on it. ADR 0007 replaces that identity with an entity type and an identifier, and replaces the rule that replaying reuses the run. Validity stays defined once on the flow. Inside the validity duration the recorded result is returned. A different flow on the same entity does not replace the first run."}),"\n",(0,V.jsx)(b.p,{children:"This replaces the rule in ADR 0002 that the same identity in two flows is two entities. One run of an organization, a flow, and an identity still proceeds at a time, and that run keeps the starting data of the request that started it. The stored row stays that run. A separate run name was rejected: replaying would otherwise leave two current trees for one flow."})]})}function c3(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(c2,{...a})}):c2(a)}let c4={title:"The orchestrator applies results"},c5=[],c6={contents:[{heading:"the-orchestrator-applies-results",content:"A worker runs a step. It does not apply the flow and it does not write the entity. One orchestrator reads each step result, applies the flow, and writes Postgres. Many workers would otherwise open many sessions on the same rows, and Postgres would be the only place that ordered those writes."},{heading:"the-orchestrator-applies-results",content:"The job stays an organization, an entity, and a step, plus a token, and it still carries no secret. The starting data sits in a short-lived dispatch value keyed by that token. The worker loads secrets once at startup into the environment, so the dispatch value carries no secret. The worker takes the value, runs the step, and publishes the result. The orchestrator is the only consumer of those results."}],headings:[{id:"the-orchestrator-applies-results",content:"The orchestrator applies results"}]},c7=[{depth:1,url:"#the-orchestrator-applies-results",title:(0,V.jsx)(V.Fragment,{children:"The orchestrator applies results"})}];function c8(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"the-orchestrator-applies-results",children:"The orchestrator applies results"}),"\n",(0,V.jsx)(b.p,{children:"A worker runs a step. It does not apply the flow and it does not write the entity. One orchestrator reads each step result, applies the flow, and writes Postgres. Many workers would otherwise open many sessions on the same rows, and Postgres would be the only place that ordered those writes."}),"\n",(0,V.jsx)(b.p,{children:"The job stays an organization, an entity, and a step, plus a token, and it still carries no secret. The starting data sits in a short-lived dispatch value keyed by that token. The worker loads secrets once at startup into the environment, so the dispatch value carries no secret. The worker takes the value, runs the step, and publishes the result. The orchestrator is the only consumer of those results."})]})}function c9(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(c8,{...a})}):c8(a)}let da={title:"One row per entity"},db=[],dc={contents:[{heading:"one-row-per-entity",content:"The orchestrator used to rewrite every entity of an organization as one JSON blob. A transition only needs the entity, the children named in its tree, and the running parents. One row per entity keeps that read small. The operation tree stays JSON on the row, because the engine rereads the function and lines openings up by position. Parent and child links sit in their own table: a child can have several parents, and walking every entity to find them does not scale. ADR 0007 replaces the rule that past trees are not kept and that the next flow run replaces the row."}],headings:[{id:"one-row-per-entity",content:"One row per entity"}]},dd=[{depth:1,url:"#one-row-per-entity",title:(0,V.jsx)(V.Fragment,{children:"One row per entity"})}];function de(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"one-row-per-entity",children:"One row per entity"}),"\n",(0,V.jsx)(b.p,{children:"The orchestrator used to rewrite every entity of an organization as one JSON blob. A transition only needs the entity, the children named in its tree, and the running parents. One row per entity keeps that read small. The operation tree stays JSON on the row, because the engine rereads the function and lines openings up by position. Parent and child links sit in their own table: a child can have several parents, and walking every entity to find them does not scale. ADR 0007 replaces the rule that past trees are not kept and that the next flow run replaces the row."})]})}function df(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(de,{...a})}):de(a)}let dg={title:"A metric is apart from the run"},dh=[],di={contents:[{heading:"a-metric-is-apart-from-the-run",content:"A person looks at outcomes and durations over a period, and the orchestrator still has to reread the result that a step returned. Keeping those in one row would either drop the period view when the next run replaces the tree, or make the engine reread a metric. The metric is the retained end of a finished run. ClickHouse holds those ends and the hourly aggregates. The engine rereads the result. It does not reread the metric. A running flow run is not a metric. ADR 0007 replaces the rule that Postgres holds only the current flow run."}],headings:[{id:"a-metric-is-apart-from-the-run",content:"A metric is apart from the run"}]},dj=[{depth:1,url:"#a-metric-is-apart-from-the-run",title:(0,V.jsx)(V.Fragment,{children:"A metric is apart from the run"})}];function dk(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-metric-is-apart-from-the-run",children:"A metric is apart from the run"}),"\n",(0,V.jsx)(b.p,{children:"A person looks at outcomes and durations over a period, and the orchestrator still has to reread the result that a step returned. Keeping those in one row would either drop the period view when the next run replaces the tree, or make the engine reread a metric. The metric is the retained end of a finished run. ClickHouse holds those ends and the hourly aggregates. The engine rereads the result. It does not reread the metric. A running flow run is not a metric. ADR 0007 replaces the rule that Postgres holds only the current flow run."})]})}function dl(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(dk,{...a})}):dk(a)}let dm={title:"An entity is an organization, a flow, and an identity"},dn=[],dp={contents:[{heading:"an-entity-is-an-organization-a-flow-and-an-identity",content:"The same identity in two flows is two entities, and two organizations do not share one. Validity is defined once on the flow and applies to each of its entities. One run of that key proceeds at a time. A later request waits, and the run keeps the starting data of the request that started it."},{heading:"an-entity-is-an-organization-a-flow-and-an-identity",content:"ADR 0006 replaces the rule that the same identity in two flows is two entities."}],headings:[{id:"an-entity-is-an-organization-a-flow-and-an-identity",content:"An entity is an organization, a flow, and an identity"}]},dq=[{depth:1,url:"#an-entity-is-an-organization-a-flow-and-an-identity",title:(0,V.jsx)(V.Fragment,{children:"An entity is an organization, a flow, and an identity"})}];function dr(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"an-entity-is-an-organization-a-flow-and-an-identity",children:"An entity is an organization, a flow, and an identity"}),"\n",(0,V.jsx)(b.p,{children:"The same identity in two flows is two entities, and two organizations do not share one. Validity is defined once on the flow and applies to each of its entities. One run of that key proceeds at a time. A later request waits, and the run keeps the starting data of the request that started it."}),"\n",(0,V.jsx)(b.p,{children:"ADR 0006 replaces the rule that the same identity in two flows is two entities."})]})}function ds(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(dr,{...a})}):dr(a)}let dt={title:"The flow is restricted TypeScript, reread from the start"},du=[],dv={contents:[{heading:"the-flow-is-restricted-typescript-reread-from-the-start",content:"A flow has to stay deterministic given the same sealed reports, and a person has to be able to read the source of the paths that were not taken. A transition table cannot express that source. Freely executed TypeScript could read the clock, the secrets, or the client database. The flow is a TypeScript function that may only open a step, open child entities, wait for a group, choose one named arm, finish, or declare failure. The orchestrator rereads it from the start whenever the run resumes. A choice records every arm it writes. One name takes one arm. The other arms name their steps as discarded, and those steps are not opened."}],headings:[{id:"the-flow-is-restricted-typescript-reread-from-the-start",content:"The flow is restricted TypeScript, reread from the start"}]},dw=[{depth:1,url:"#the-flow-is-restricted-typescript-reread-from-the-start",title:(0,V.jsx)(V.Fragment,{children:"The flow is restricted TypeScript, reread from the start"})}];function dx(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"the-flow-is-restricted-typescript-reread-from-the-start",children:"The flow is restricted TypeScript, reread from the start"}),"\n",(0,V.jsx)(b.p,{children:"A flow has to stay deterministic given the same sealed reports, and a person has to be able to read the source of the paths that were not taken. A transition table cannot express that source. Freely executed TypeScript could read the clock, the secrets, or the client database. The flow is a TypeScript function that may only open a step, open child entities, wait for a group, choose one named arm, finish, or declare failure. The orchestrator rereads it from the start whenever the run resumes. A choice records every arm it writes. One name takes one arm. The other arms name their steps as discarded, and those steps are not opened."})]})}function dy(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(dx,{...a})}):dx(a)}let dz={title:"Domain Docs"},dA=[],dB={contents:[{heading:"domain-docs",content:"How the engineering skills should consume this repo's domain documentation when exploring the codebase."},{heading:"before-exploring-read-these",content:"CONTEXT.md at the repo root, or"},{heading:"before-exploring-read-these",content:"CONTEXT-MAP.md at the repo root if it exists — it points at one CONTEXT.md per context. Read each one relevant to the topic."},{heading:"before-exploring-read-these",content:"docs/adr/ — read ADRs that touch the area you're about to work in. In multi-context repos, also check src/<context>/docs/adr/ for context-scoped decisions."},{heading:"before-exploring-read-these",content:"If any of these files don't exist, proceed silently. Don't flag their absence; don't suggest creating them upfront. The /domain-modeling skill (reached via /grill-with-docs and /improve-codebase-architecture) creates them lazily when terms or decisions actually get resolved."},{heading:"file-structure",content:"Single-context repo (most repos):"},{heading:"file-structure",content:"Multi-context repo (presence of CONTEXT-MAP.md at the root):"},{heading:"use-the-glossarys-vocabulary",content:"When your output names a domain concept (in an issue title, a refactor proposal, a hypothesis, a test name), use the term as defined in CONTEXT.md. Don't drift to synonyms the glossary explicitly avoids."},{heading:"use-the-glossarys-vocabulary",content:"If the concept you need isn't in the glossary yet, that's a signal — either you're inventing language the project doesn't use (reconsider) or there's a real gap (note it for /domain-modeling)."},{heading:"flag-adr-conflicts",content:"If your output contradicts an existing ADR, surface it explicitly rather than silently overriding:"},{heading:"flag-adr-conflicts",content:"Contradicts ADR-0007 (event-sourced orders) — but worth reopening because…"}],headings:[{id:"domain-docs",content:"Domain Docs"},{id:"before-exploring-read-these",content:"Before exploring, read these"},{id:"file-structure",content:"File structure"},{id:"use-the-glossarys-vocabulary",content:"Use the glossary's vocabulary"},{id:"flag-adr-conflicts",content:"Flag ADR conflicts"}]},dC=[{depth:1,url:"#domain-docs",title:(0,V.jsx)(V.Fragment,{children:"Domain Docs"})},{depth:2,url:"#before-exploring-read-these",title:(0,V.jsx)(V.Fragment,{children:"Before exploring, read these"})},{depth:2,url:"#file-structure",title:(0,V.jsx)(V.Fragment,{children:"File structure"})},{depth:2,url:"#use-the-glossarys-vocabulary",title:(0,V.jsx)(V.Fragment,{children:"Use the glossary's vocabulary"})},{depth:2,url:"#flag-adr-conflicts",title:(0,V.jsx)(V.Fragment,{children:"Flag ADR conflicts"})}];function dD(a){let b={blockquote:"blockquote",code:"code",em:"em",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",span:"span",strong:"strong",ul:"ul",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"domain-docs",children:"Domain Docs"}),"\n",(0,V.jsx)(b.p,{children:"How the engineering skills should consume this repo's domain documentation when exploring the codebase."}),"\n",(0,V.jsx)(b.h2,{id:"before-exploring-read-these",children:"Before exploring, read these"}),"\n",(0,V.jsxs)(b.ul,{children:["\n",(0,V.jsxs)(b.li,{children:[(0,V.jsx)(b.strong,{children:(0,V.jsx)(b.code,{children:"CONTEXT.md"})})," at the repo root, or"]}),"\n",(0,V.jsxs)(b.li,{children:[(0,V.jsx)(b.strong,{children:(0,V.jsx)(b.code,{children:"CONTEXT-MAP.md"})})," at the repo root if it exists — it points at one ",(0,V.jsx)(b.code,{children:"CONTEXT.md"})," per context. Read each one relevant to the topic."]}),"\n",(0,V.jsxs)(b.li,{children:[(0,V.jsx)(b.strong,{children:(0,V.jsx)(b.code,{children:"docs/adr/"})})," — read ADRs that touch the area you're about to work in. In multi-context repos, also check ",(0,V.jsx)(b.code,{children:"src/<context>/docs/adr/"})," for context-scoped decisions."]}),"\n"]}),"\n",(0,V.jsxs)(b.p,{children:["If any of these files don't exist, ",(0,V.jsx)(b.strong,{children:"proceed silently"}),". Don't flag their absence; don't suggest creating them upfront. The ",(0,V.jsx)(b.code,{children:"/domain-modeling"})," skill (reached via ",(0,V.jsx)(b.code,{children:"/grill-with-docs"})," and ",(0,V.jsx)(b.code,{children:"/improve-codebase-architecture"}),") creates them lazily when terms or decisions actually get resolved."]}),"\n",(0,V.jsx)(b.h2,{id:"file-structure",children:"File structure"}),"\n",(0,V.jsx)(b.p,{children:"Single-context repo (most repos):"}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="M 6,1 C 4.354992,1 3,2.354992 3,4 v 16 c 0,1.645008 1.354992,3 3,3 h 12 c 1.645008,0 3,-1.354992 3,-3 V 8 7 A 1.0001,1.0001 0 0 0 20.707031,6.2929687 l -5,-5 A 1.0001,1.0001 0 0 0 15,1 h -1 z m 0,2 h 7 v 3 c 0,1.645008 1.354992,3 3,3 h 3 v 11 c 0,0.564129 -0.435871,1 -1,1 H 6 C 5.4358712,21 5,20.564129 5,20 V 4 C 5,3.4358712 5.4358712,3 6,3 Z M 15,3.4140625 18.585937,7 H 16 C 15.435871,7 15,6.5641288 15,6 Z" fill="currentColor" /></svg>',children:(0,V.jsxs)(b.code,{children:[(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:"/"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:"├── CONTEXT.md"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:"├── docs/adr/"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:"│ ├── 0001-event-sourced-orders.md"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:"│ └── 0002-postgres-for-write-model.md"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:"└── src/"})})]})})}),"\n",(0,V.jsxs)(b.p,{children:["Multi-context repo (presence of ",(0,V.jsx)(b.code,{children:"CONTEXT-MAP.md"})," at the root):"]}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="M 6,1 C 4.354992,1 3,2.354992 3,4 v 16 c 0,1.645008 1.354992,3 3,3 h 12 c 1.645008,0 3,-1.354992 3,-3 V 8 7 A 1.0001,1.0001 0 0 0 20.707031,6.2929687 l -5,-5 A 1.0001,1.0001 0 0 0 15,1 h -1 z m 0,2 h 7 v 3 c 0,1.645008 1.354992,3 3,3 h 3 v 11 c 0,0.564129 -0.435871,1 -1,1 H 6 C 5.4358712,21 5,20.564129 5,20 V 4 C 5,3.4358712 5.4358712,3 6,3 Z M 15,3.4140625 18.585937,7 H 16 C 15.435871,7 15,6.5641288 15,6 Z" fill="currentColor" /></svg>',children:(0,V.jsxs)(b.code,{children:[(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:"/"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:"├── CONTEXT-MAP.md"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:"├── docs/adr/ ← system-wide decisions"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:"└── src/"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:" ├── ordering/"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:" │ ├── CONTEXT.md"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:" │ └── docs/adr/ ← context-specific decisions"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:" └── billing/"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:" ├── CONTEXT.md"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:" └── docs/adr/"})})]})})}),"\n",(0,V.jsx)(b.h2,{id:"use-the-glossarys-vocabulary",children:"Use the glossary's vocabulary"}),"\n",(0,V.jsxs)(b.p,{children:["When your output names a domain concept (in an issue title, a refactor proposal, a hypothesis, a test name), use the term as defined in ",(0,V.jsx)(b.code,{children:"CONTEXT.md"}),". Don't drift to synonyms the glossary explicitly avoids."]}),"\n",(0,V.jsxs)(b.p,{children:["If the concept you need isn't in the glossary yet, that's a signal — either you're inventing language the project doesn't use (reconsider) or there's a real gap (note it for ",(0,V.jsx)(b.code,{children:"/domain-modeling"}),")."]}),"\n",(0,V.jsx)(b.h2,{id:"flag-adr-conflicts",children:"Flag ADR conflicts"}),"\n",(0,V.jsx)(b.p,{children:"If your output contradicts an existing ADR, surface it explicitly rather than silently overriding:"}),"\n",(0,V.jsxs)(b.blockquote,{children:["\n",(0,V.jsx)(b.p,{children:(0,V.jsx)(b.em,{children:"Contradicts ADR-0007 (event-sourced orders) — but worth reopening because…"})}),"\n"]})]})}function dE(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(dD,{...a})}):dD(a)}let dF={title:"Server"},dG=[],dH={contents:[{heading:void 0,content:"This installs the published images on a Linux server. cue deploy runs on the operator machine. It uses ssh and scp. It does not clone the repository, and it does not build on the server."},{heading:"dns",content:"Before the first start, point these three names at the server:"},{heading:"dns",content:"the console host passed to --console-host, such as console.example.com"},{heading:"dns",content:"doc.<console-host>, such as doc.console.example.com"},{heading:"dns",content:"the public host passed to --edge-name, stored on the server as EDGE_NAME"},{heading:"dns",content:"Let's Encrypt completes the HTTP-01 challenge on port 80. The three names have to resolve to this server before Compose starts, or that challenge fails. Port 80 is not a site in the Caddyfile."},{heading:"dns",content:"The console answers on https://<console-host>. The docs answer on https://doc.<console-host>. The docs name is derived from ORCH_CONSOLE_HOST. There is no separate variable for it. Both sites use the same Let's Encrypt issuer and the same address list. Neither site asks for a client certificate. CUE_URL is https://<EDGE_NAME>:3443. The facade ports use the private certificate."},{heading:"deploy",content:"cue comes from the installed @ascentstudio/cue-sdk package. The image tag is the version of that package, the same version as the npm packages of that publication."},{heading:"deploy",content:"cue deploy --help and cue deploy -h print that usage line. The command takes one positional argument, user@host. It runs ssh and scp with that host and no extra options."},{heading:"deploy",content:"--edge-name, --console-host, --acme-email, --s3-bucket, and --s3-region are required. --s3-endpoint is optional. --edge-name and --console-host are hostnames without a scheme, a port, or a path. --acme-email is an email address. --s3-bucket, --s3-region, and the S3 keys cannot contain a space, #, a quote, or \\. When --s3-endpoint is set, it is an http or https URL."},{heading:"deploy",content:"The S3 keys come from AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY, or from CUE_S3_ACCESS_KEY_ID and CUE_S3_SECRET_ACCESS_KEY. If a key is missing, the command prompts for it. The prompt does not echo, and it needs a terminal."},{heading:"deploy",content:"The age private key is ~/.config/cue/age.key on the operator machine, mode 0600. When the command creates that key, it creates ~/.config/cue as mode 0700. A key that is already a valid identity is reused. A file that is not an age identity stops the command. The private key stays on this machine. backup.env receives only the public recipient."},{heading:"deploy",content:"The command generates new service secrets, copies the server tree from the SDK package, and writes .env, backup.env, and network.ini. .env and backup.env are mode 0600. Before it connects, it prints a reminder to point DNS for the edge name, the console host, and doc.<console-host> at the server. It then copies the tree with scp to /tmp/cue-deploy-… and runs remote-install.sh there."},{heading:"deploy",content:"On the server, the script checks Linux, Docker, and Docker Compose. It pulls ascentstudio/cue-orchestrator, ascentstudio/cue-caddy, ascentstudio/cue-zot, and ascentstudio/cue-backup. For version 0.1.0 each image is tagged 0.1.0. There is no latest tag. One version does not pull another image. Redis, ClickHouse, MinIO, Verdaccio, and Supabase stay on their public images. A failed pull stops the script before it copies anything into the install directory. It then copies the tree to /var/lib/cue, mode 0700, and creates the certificate directory /var/lib/ultimate-scraper/certs. docker compose up -d runs from /var/lib/cue. The firewall step comes after Compose has started."},{heading:"deploy",content:"The script opens ports 22, 80, and 443 with ufw, or with firewalld when ufw is not installed. An account other than root runs those commands through sudo. It limits the facade ports 3443, 4443, 6380, 8443, 9443, 7443, and 4873 to the address in SSH_CLIENT. If neither firewall command is installed, it prints those rules and leaves the firewall unchanged. If SSH_CLIENT has no usable address, the install stops after Compose has started. Ports published by Docker bypass that firewall. Postgres listens on 127.0.0.1:54322, and the Supabase API listens on 127.0.0.1:54321. Redis, ClickHouse, MinIO, zot, Verdaccio, and Supavisor are not published on the host."},{heading:"deploy",content:"--edge-name is the public host of CUE_URL. The command stores it as EDGE_NAME, sets CUE_URL to https://<edge-name>:3443, and writes that EDGE_NAME in network.ini. --console-host is stored as ORCH_CONSOLE_HOST. The server environment leaves ORCH_URL, ORCH_EDGE_NAMES, CUE_REDIS_URL, CUE_CLICKHOUSE_URL, CUE_TRANSIENT_S3_ENDPOINT, and CUE_ENROLLMENT unset. The console uses https://127.0.0.1:3443."},{heading:"deploy",content:"ascentstudio/cue-orchestrator:<version> is the image Compose starts. Its entrypoint starts the orchestrator, waits until console-client.crt and the Caddyfile are in the certificate directory, then starts the console on port 3000 and the docs on port 3002. The orchestrator process does not start those two. The container uses the host network, so Caddy reaches 127.0.0.1:3000, 127.0.0.1:3001, and 127.0.0.1:3002."},{heading:"deploy",content:"Compose sets MIGRATE_SEED=0. The migrate service skips deploy/supabase/seed.sql. The server has no pierre@ascent-studio.fr account, no fixture-local secret, and no join_fixture trigger."},{heading:"deploy",content:"A second cue deploy writes new secrets into /var/lib/cue/.env and backup.env, then runs Compose again. The Postgres volume keeps the password from the first start. The age key on the operator machine stays the one already there."},{heading:"deploy",content:"After a successful install, the command prints the age key path, the cue-backups prefix, the 03:00 UTC backup time, and the notes about Docker-published ports and Redis. It then deletes the temporary tree on the operator machine."},{heading:"first-sign-in",content:"Open https://<console-host> and create the first person on the sign-in page. The address list is empty, so the console is open for that sign-in."},{heading:"first-sign-in",content:"The browser uses NEXT_PUBLIC_SUPABASE_URL. On the console site, Caddy forwards only /auth/v1 to 127.0.0.1:54321. Studio stays on that loop, behind the gateway password. The console process uses SUPABASE_SERVER_URL=http://127.0.0.1:54321."},{heading:"address-list",content:"The console page /account/edge edits the edge_allow table. Each change rewrites the Caddyfile and pg_hba.conf."},{heading:"address-list",content:"The first list must contain the address of the person saving it. A list that does not contain that address is refused. After the first address, the console site and the docs site use the same list. An empty list leaves both sites open and refuses remote addresses on the machine listeners: enrollment, machine API, Redis, ClickHouse, MinIO, Postgres, zot, and Verdaccio. 127.0.0.1 and ::1 stay allowed."},{heading:"supervisors",content:"A supervisor uses CUE_URL, https://<EDGE_NAME>:3443. It derives Redis (rediss://<host>:6380), ClickHouse (https://<host>:8443), transient files (https://<host>:9443, region us-east-1, bucket transient), enrollment (https://<host>:4443), zot (https://<host>:7443), and Verdaccio (https://<host>:4873) from that host."},{heading:"supervisors",content:"Add the supervisor address to the edge list before you start it. Otherwise its enrollment request does not reach the orchestrator. The facade ports are limited to the SSH_CLIENT address recorded at deploy, so a supervisor on another address also needs those ports allowed for it. Enrollment on port 4443 uses server TLS only. The supervisor prints a code and polls. A person approves that code on the Supervisors page."},{heading:"supervisors",content:"cue deploy-supervisor installs that supervisor on Ubuntu or Debian. It does not run on macOS. It uses ssh and scp. It does not clone a repository, and it does not build on the host. It does not read or write a package.json, and it does not copy a checkout. cue.organization stays on the orchestrator, when a package revision is registered."},{heading:"supervisors",content:"--organization, --cue-url, --ca, and --environment are required. --organization, --environment, and --worker are lowercase letters, digits, and hyphens. --cue-url is an https URL. --ca is a local file, copied to the host as the orchestrator authority. --mode is container or process. The default is container. --kinds, --not-kinds, --runtimes, and --not-runtimes select the kinds this host accepts. --env-file is an optional local file copied onto the host. The service passes that path to the supervisor. It never passes --source."},{heading:"supervisors",content:"The environment secret comes from CUE_ENVIRONMENT_SECRET. If it is missing, the command prompts for it. The prompt does not echo, and it needs a terminal. Without --worker, the worker name is the remote hostname, with every other character turned into a hyphen."},{heading:"supervisors",content:"Before the install, the command reads the VPS egress address from the host route and prints it. Add that address on /account/edge, and allow it on the orchestrator facade ports 3443, 4443, 6380, 8443, 9443, 7443, and 4873. The command does not connect to the orchestrator."},{heading:"supervisors",content:"On the host, a system Node.js that is already version 22 or newer stays. Otherwise the script extracts the official Node 22 archive into /usr/local. It does not use nvm. Docker Engine and the Compose plugin stay when docker compose already answers. Otherwise they are installed from the Docker apt repository, and Docker is enabled. The system user cue is created when missing, in the docker group, with home /var/lib/cue-supervisor. The script installs @ascentstudio/cue-supervisor at the SDK version."},{heading:"supervisors",content:"supervisor.env is mode 0600. It sets WORKER_ORGANIZATION, CUE_URL, CUE_ENVIRONMENT_SECRET, CUE_ENVIRONMENT_NAME, WORKER_NAME, SUPERVISOR_CERT_DIR=/var/lib/ultimate-scraper/supervisor, and ORCH_REVISION_CACHE=/var/lib/cue-supervisor/revisions. No package.json is placed in /var/lib/cue-supervisor. The supervisor enrolls as organization/environment/host, using WORKER_ORGANIZATION because that directory has no checkout. After enrollment, fetchWorkerEnvironment still checks that the secret matches that organization and environment. The pinned revision is downloaded into the revision cache. Process mode does not treat the install directory as source. Container mode starts the images of that revision. Process mode starts worker from that revision. A cue dev inside a checkout still uses that checkout."},{heading:"supervisors",content:"The firewall step runs before the service starts. The script installs ufw when it is missing, allows the server port from SSH_CONNECTION, and denies other incoming traffic. It does not open the facade ports. The supervisor is a client. If that port cannot be read, the script does not enable the firewall, and it exits, so the SSH session is not cut off. The unit is cue-supervisor.service, with Restart=always and WantedBy=multi-user.target. A second run rewrites the unit and restarts the service."},{heading:"supervisors",content:"After the service starts, the command follows journalctl -u cue-supervisor -o cat from that start. It prints the enrollment code, the waiting line when the orchestrator is unreachable, approval, denial, expiry, and a certificate that is already valid. It exits when the certificate is in place, approved, denied, or expired. Ctrl-C stops that relay and leaves the service running."},{heading:"backup",content:"A backup container on the platform network waits until 03:00 UTC, runs the backup, and repeats that wait. The first backup and every later backup run at 03:00 UTC. It has no published port. It uses ascentstudio/cue-backup:<version>."},{heading:"backup",content:"The container dumps Postgres with pg_dump -Fc to db:5432, with the database password, not through host port 54322. It writes the ClickHouse metrics to a file and copies the certificate directory. It encrypts those files with age, using the operator's public key, and stores them in the S3 bucket under the prefix cue-backups. Retention is 30 days. The S3 credentials on the server can only write to that prefix."},{heading:"backup",content:"The age private key stays on the operator machine, at ~/.config/cue/age.key, mode 0600. It is not on the server."},{heading:"backup",content:"Redis is not backed up."},{heading:"restore",content:"Decrypt a backup on the operator machine with the age private key at ~/.config/cue/age.key. Restore Postgres from the dump, restore the ClickHouse metrics, and restore the certificate directory."},{heading:"restore",content:"Redis is not in the backup. After a Postgres restore, flush Redis. Jobs left in Redis would run again after Postgres already applied them."}],headings:[{id:"dns",content:"DNS"},{id:"deploy",content:"Deploy"},{id:"first-sign-in",content:"First sign-in"},{id:"address-list",content:"Address list"},{id:"supervisors",content:"Supervisors"},{id:"backup",content:"Backup"},{id:"restore",content:"Restore"}]},dI=[{depth:2,url:"#dns",title:(0,V.jsx)(V.Fragment,{children:"DNS"})},{depth:2,url:"#deploy",title:(0,V.jsx)(V.Fragment,{children:"Deploy"})},{depth:2,url:"#first-sign-in",title:(0,V.jsx)(V.Fragment,{children:"First sign-in"})},{depth:2,url:"#address-list",title:(0,V.jsx)(V.Fragment,{children:"Address list"})},{depth:2,url:"#supervisors",title:(0,V.jsx)(V.Fragment,{children:"Supervisors"})},{depth:2,url:"#backup",title:(0,V.jsx)(V.Fragment,{children:"Backup"})},{depth:2,url:"#restore",title:(0,V.jsx)(V.Fragment,{children:"Restore"})}];function dJ(a){let b={code:"code",h2:"h2",li:"li",p:"p",pre:"pre",span:"span",ul:"ul",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(b.p,{children:["This installs the published images on a Linux server. ",(0,V.jsx)(b.code,{children:"cue deploy"})," runs on the operator machine. It uses ",(0,V.jsx)(b.code,{children:"ssh"})," and ",(0,V.jsx)(b.code,{children:"scp"}),". It does not clone the repository, and it does not build on the server."]}),"\n",(0,V.jsx)(b.h2,{id:"dns",children:"DNS"}),"\n",(0,V.jsx)(b.p,{children:"Before the first start, point these three names at the server:"}),"\n",(0,V.jsxs)(b.ul,{children:["\n",(0,V.jsxs)(b.li,{children:["the console host passed to ",(0,V.jsx)(b.code,{children:"--console-host"}),", such as ",(0,V.jsx)(b.code,{children:"console.example.com"})]}),"\n",(0,V.jsxs)(b.li,{children:[(0,V.jsx)(b.code,{children:"doc.<console-host>"}),", such as ",(0,V.jsx)(b.code,{children:"doc.console.example.com"})]}),"\n",(0,V.jsxs)(b.li,{children:["the public host passed to ",(0,V.jsx)(b.code,{children:"--edge-name"}),", stored on the server as ",(0,V.jsx)(b.code,{children:"EDGE_NAME"})]}),"\n"]}),"\n",(0,V.jsx)(b.p,{children:"Let's Encrypt completes the HTTP-01 challenge on port 80. The three names have to resolve to this server before Compose starts, or that challenge fails. Port 80 is not a site in the Caddyfile."}),"\n",(0,V.jsxs)(b.p,{children:["The console answers on ",(0,V.jsx)(b.code,{children:"https://<console-host>"}),". The docs answer on ",(0,V.jsx)(b.code,{children:"https://doc.<console-host>"}),". The docs name is derived from ",(0,V.jsx)(b.code,{children:"ORCH_CONSOLE_HOST"}),". There is no separate variable for it. Both sites use the same Let's Encrypt issuer and the same address list. Neither site asks for a client certificate. ",(0,V.jsx)(b.code,{children:"CUE_URL"})," is ",(0,V.jsx)(b.code,{children:"https://<EDGE_NAME>:3443"}),". The facade ports use the private certificate."]}),"\n",(0,V.jsx)(b.h2,{id:"deploy",children:"Deploy"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"cue"})," comes from the installed ",(0,V.jsx)(b.code,{children:"@ascentstudio/cue-sdk"})," package. The image tag is the version of that package, the same version as the npm packages of that publication."]}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"cue"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" deploy"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" user@host"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --edge-name"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" edge.example.com"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --console-host"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" console.example.com"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --acme-email"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" admin@example.com"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --s3-bucket"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" cue-backups"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --s3-region"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" eu-west-1"})]})})})}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"cue deploy --help"})," and ",(0,V.jsx)(b.code,{children:"cue deploy -h"})," print that usage line. The command takes one positional argument, ",(0,V.jsx)(b.code,{children:"user@host"}),". It runs ",(0,V.jsx)(b.code,{children:"ssh"})," and ",(0,V.jsx)(b.code,{children:"scp"})," with that host and no extra options."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"--edge-name"}),", ",(0,V.jsx)(b.code,{children:"--console-host"}),", ",(0,V.jsx)(b.code,{children:"--acme-email"}),", ",(0,V.jsx)(b.code,{children:"--s3-bucket"}),", and ",(0,V.jsx)(b.code,{children:"--s3-region"})," are required. ",(0,V.jsx)(b.code,{children:"--s3-endpoint"})," is optional. ",(0,V.jsx)(b.code,{children:"--edge-name"})," and ",(0,V.jsx)(b.code,{children:"--console-host"})," are hostnames without a scheme, a port, or a path. ",(0,V.jsx)(b.code,{children:"--acme-email"})," is an email address. ",(0,V.jsx)(b.code,{children:"--s3-bucket"}),", ",(0,V.jsx)(b.code,{children:"--s3-region"}),", and the S3 keys cannot contain a space, ",(0,V.jsx)(b.code,{children:"#"}),", a quote, or ",(0,V.jsx)(b.code,{children:"\\"}),". When ",(0,V.jsx)(b.code,{children:"--s3-endpoint"})," is set, it is an ",(0,V.jsx)(b.code,{children:"http"})," or ",(0,V.jsx)(b.code,{children:"https"})," URL."]}),"\n",(0,V.jsxs)(b.p,{children:["The S3 keys come from ",(0,V.jsx)(b.code,{children:"AWS_ACCESS_KEY_ID"})," and ",(0,V.jsx)(b.code,{children:"AWS_SECRET_ACCESS_KEY"}),", or from ",(0,V.jsx)(b.code,{children:"CUE_S3_ACCESS_KEY_ID"})," and ",(0,V.jsx)(b.code,{children:"CUE_S3_SECRET_ACCESS_KEY"}),". If a key is missing, the command prompts for it. The prompt does not echo, and it needs a terminal."]}),"\n",(0,V.jsxs)(b.p,{children:["The age private key is ",(0,V.jsx)(b.code,{children:"~/.config/cue/age.key"})," on the operator machine, mode ",(0,V.jsx)(b.code,{children:"0600"}),". When the command creates that key, it creates ",(0,V.jsx)(b.code,{children:"~/.config/cue"})," as mode ",(0,V.jsx)(b.code,{children:"0700"}),". A key that is already a valid identity is reused. A file that is not an age identity stops the command. The private key stays on this machine. ",(0,V.jsx)(b.code,{children:"backup.env"})," receives only the public recipient."]}),"\n",(0,V.jsxs)(b.p,{children:["The command generates new service secrets, copies the server tree from the SDK package, and writes ",(0,V.jsx)(b.code,{children:".env"}),", ",(0,V.jsx)(b.code,{children:"backup.env"}),", and ",(0,V.jsx)(b.code,{children:"network.ini"}),". ",(0,V.jsx)(b.code,{children:".env"})," and ",(0,V.jsx)(b.code,{children:"backup.env"})," are mode ",(0,V.jsx)(b.code,{children:"0600"}),". Before it connects, it prints a reminder to point DNS for the edge name, the console host, and ",(0,V.jsx)(b.code,{children:"doc.<console-host>"})," at the server. It then copies the tree with ",(0,V.jsx)(b.code,{children:"scp"})," to ",(0,V.jsx)(b.code,{children:"/tmp/cue-deploy-…"})," and runs ",(0,V.jsx)(b.code,{children:"remote-install.sh"})," there."]}),"\n",(0,V.jsxs)(b.p,{children:["On the server, the script checks Linux, Docker, and Docker Compose. It pulls ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-orchestrator"}),", ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-caddy"}),", ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-zot"}),", and ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-backup"}),". For version ",(0,V.jsx)(b.code,{children:"0.1.0"})," each image is tagged ",(0,V.jsx)(b.code,{children:"0.1.0"}),". There is no ",(0,V.jsx)(b.code,{children:"latest"})," tag. One version does not pull another image. Redis, ClickHouse, MinIO, Verdaccio, and Supabase stay on their public images. A failed pull stops the script before it copies anything into the install directory. It then copies the tree to ",(0,V.jsx)(b.code,{children:"/var/lib/cue"}),", mode ",(0,V.jsx)(b.code,{children:"0700"}),", and creates the certificate directory ",(0,V.jsx)(b.code,{children:"/var/lib/ultimate-scraper/certs"}),". ",(0,V.jsx)(b.code,{children:"docker compose up -d"})," runs from ",(0,V.jsx)(b.code,{children:"/var/lib/cue"}),". The firewall step comes after Compose has started."]}),"\n",(0,V.jsxs)(b.p,{children:["The script opens ports 22, 80, and 443 with ",(0,V.jsx)(b.code,{children:"ufw"}),", or with ",(0,V.jsx)(b.code,{children:"firewalld"})," when ",(0,V.jsx)(b.code,{children:"ufw"})," is not installed. An account other than root runs those commands through ",(0,V.jsx)(b.code,{children:"sudo"}),". It limits the facade ports 3443, 4443, 6380, 8443, 9443, 7443, and 4873 to the address in ",(0,V.jsx)(b.code,{children:"SSH_CLIENT"}),". If neither firewall command is installed, it prints those rules and leaves the firewall unchanged. If ",(0,V.jsx)(b.code,{children:"SSH_CLIENT"})," has no usable address, the install stops after Compose has started. Ports published by Docker bypass that firewall. Postgres listens on ",(0,V.jsx)(b.code,{children:"127.0.0.1:54322"}),", and the Supabase API listens on ",(0,V.jsx)(b.code,{children:"127.0.0.1:54321"}),". Redis, ClickHouse, MinIO, zot, Verdaccio, and Supavisor are not published on the host."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"--edge-name"})," is the public host of ",(0,V.jsx)(b.code,{children:"CUE_URL"}),". The command stores it as ",(0,V.jsx)(b.code,{children:"EDGE_NAME"}),", sets ",(0,V.jsx)(b.code,{children:"CUE_URL"})," to ",(0,V.jsx)(b.code,{children:"https://<edge-name>:3443"}),", and writes that ",(0,V.jsx)(b.code,{children:"EDGE_NAME"})," in ",(0,V.jsx)(b.code,{children:"network.ini"}),". ",(0,V.jsx)(b.code,{children:"--console-host"})," is stored as ",(0,V.jsx)(b.code,{children:"ORCH_CONSOLE_HOST"}),". The server environment leaves ",(0,V.jsx)(b.code,{children:"ORCH_URL"}),", ",(0,V.jsx)(b.code,{children:"ORCH_EDGE_NAMES"}),", ",(0,V.jsx)(b.code,{children:"CUE_REDIS_URL"}),", ",(0,V.jsx)(b.code,{children:"CUE_CLICKHOUSE_URL"}),", ",(0,V.jsx)(b.code,{children:"CUE_TRANSIENT_S3_ENDPOINT"}),", and ",(0,V.jsx)(b.code,{children:"CUE_ENROLLMENT"})," unset. The console uses ",(0,V.jsx)(b.code,{children:"https://127.0.0.1:3443"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ascentstudio/cue-orchestrator:<version>"})," is the image Compose starts. Its entrypoint starts the orchestrator, waits until ",(0,V.jsx)(b.code,{children:"console-client.crt"})," and the ",(0,V.jsx)(b.code,{children:"Caddyfile"})," are in the certificate directory, then starts the console on port 3000 and the docs on port 3002. The orchestrator process does not start those two. The container uses the host network, so Caddy reaches ",(0,V.jsx)(b.code,{children:"127.0.0.1:3000"}),", ",(0,V.jsx)(b.code,{children:"127.0.0.1:3001"}),", and ",(0,V.jsx)(b.code,{children:"127.0.0.1:3002"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:["Compose sets ",(0,V.jsx)(b.code,{children:"MIGRATE_SEED=0"}),". The migrate service skips ",(0,V.jsx)(b.code,{children:"deploy/supabase/seed.sql"}),". The server has no ",(0,V.jsx)(b.code,{children:"pierre@ascent-studio.fr"})," account, no ",(0,V.jsx)(b.code,{children:"fixture-local"})," secret, and no ",(0,V.jsx)(b.code,{children:"join_fixture"})," trigger."]}),"\n",(0,V.jsxs)(b.p,{children:["A second ",(0,V.jsx)(b.code,{children:"cue deploy"})," writes new secrets into ",(0,V.jsx)(b.code,{children:"/var/lib/cue/.env"})," and ",(0,V.jsx)(b.code,{children:"backup.env"}),", then runs Compose again. The Postgres volume keeps the password from the first start. The age key on the operator machine stays the one already there."]}),"\n",(0,V.jsxs)(b.p,{children:["After a successful install, the command prints the age key path, the ",(0,V.jsx)(b.code,{children:"cue-backups"})," prefix, the 03:00 UTC backup time, and the notes about Docker-published ports and Redis. It then deletes the temporary tree on the operator machine."]}),"\n",(0,V.jsx)(b.h2,{id:"first-sign-in",children:"First sign-in"}),"\n",(0,V.jsxs)(b.p,{children:["Open ",(0,V.jsx)(b.code,{children:"https://<console-host>"})," and create the first person on the sign-in page. The address list is empty, so the console is open for that sign-in."]}),"\n",(0,V.jsxs)(b.p,{children:["The browser uses ",(0,V.jsx)(b.code,{children:"NEXT_PUBLIC_SUPABASE_URL"}),". On the console site, Caddy forwards only ",(0,V.jsx)(b.code,{children:"/auth/v1"})," to ",(0,V.jsx)(b.code,{children:"127.0.0.1:54321"}),". Studio stays on that loop, behind the gateway password. The console process uses ",(0,V.jsx)(b.code,{children:"SUPABASE_SERVER_URL=http://127.0.0.1:54321"}),"."]}),"\n",(0,V.jsx)(b.h2,{id:"address-list",children:"Address list"}),"\n",(0,V.jsxs)(b.p,{children:["The console page ",(0,V.jsx)(b.code,{children:"/account/edge"})," edits the ",(0,V.jsx)(b.code,{children:"edge_allow"})," table. Each change rewrites the ",(0,V.jsx)(b.code,{children:"Caddyfile"})," and ",(0,V.jsx)(b.code,{children:"pg_hba.conf"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:["The first list must contain the address of the person saving it. A list that does not contain that address is refused. After the first address, the console site and the docs site use the same list. An empty list leaves both sites open and refuses remote addresses on the machine listeners: enrollment, machine API, Redis, ClickHouse, MinIO, Postgres, zot, and Verdaccio. ",(0,V.jsx)(b.code,{children:"127.0.0.1"})," and ",(0,V.jsx)(b.code,{children:"::1"})," stay allowed."]}),"\n",(0,V.jsx)(b.h2,{id:"supervisors",children:"Supervisors"}),"\n",(0,V.jsxs)(b.p,{children:["A supervisor uses ",(0,V.jsx)(b.code,{children:"CUE_URL"}),", ",(0,V.jsx)(b.code,{children:"https://<EDGE_NAME>:3443"}),". It derives Redis (",(0,V.jsx)(b.code,{children:"rediss://<host>:6380"}),"), ClickHouse (",(0,V.jsx)(b.code,{children:"https://<host>:8443"}),"), transient files (",(0,V.jsx)(b.code,{children:"https://<host>:9443"}),", region ",(0,V.jsx)(b.code,{children:"us-east-1"}),", bucket ",(0,V.jsx)(b.code,{children:"transient"}),"), enrollment (",(0,V.jsx)(b.code,{children:"https://<host>:4443"}),"), zot (",(0,V.jsx)(b.code,{children:"https://<host>:7443"}),"), and Verdaccio (",(0,V.jsx)(b.code,{children:"https://<host>:4873"}),") from that host."]}),"\n",(0,V.jsxs)(b.p,{children:["Add the supervisor address to the edge list before you start it. Otherwise its enrollment request does not reach the orchestrator. The facade ports are limited to the ",(0,V.jsx)(b.code,{children:"SSH_CLIENT"})," address recorded at deploy, so a supervisor on another address also needs those ports allowed for it. Enrollment on port 4443 uses server TLS only. The supervisor prints a code and polls. A person approves that code on the Supervisors page."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"cue deploy-supervisor"})," installs that supervisor on Ubuntu or Debian. It does not run on macOS. It uses ",(0,V.jsx)(b.code,{children:"ssh"})," and ",(0,V.jsx)(b.code,{children:"scp"}),". It does not clone a repository, and it does not build on the host. It does not read or write a ",(0,V.jsx)(b.code,{children:"package.json"}),", and it does not copy a checkout. ",(0,V.jsx)(b.code,{children:"cue.organization"})," stays on the orchestrator, when a package revision is registered."]}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"cue"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" deploy-supervisor"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" user@host"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --organization"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" minea"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --cue-url"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" https://edge.example.com:3443"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --ca"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" /path/ca.crt"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --environment"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" prod"})]})})})}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"--organization"}),", ",(0,V.jsx)(b.code,{children:"--cue-url"}),", ",(0,V.jsx)(b.code,{children:"--ca"}),", and ",(0,V.jsx)(b.code,{children:"--environment"})," are required. ",(0,V.jsx)(b.code,{children:"--organization"}),", ",(0,V.jsx)(b.code,{children:"--environment"}),", and ",(0,V.jsx)(b.code,{children:"--worker"})," are lowercase letters, digits, and hyphens. ",(0,V.jsx)(b.code,{children:"--cue-url"})," is an https URL. ",(0,V.jsx)(b.code,{children:"--ca"})," is a local file, copied to the host as the orchestrator authority. ",(0,V.jsx)(b.code,{children:"--mode"})," is ",(0,V.jsx)(b.code,{children:"container"})," or ",(0,V.jsx)(b.code,{children:"process"}),". The default is ",(0,V.jsx)(b.code,{children:"container"}),". ",(0,V.jsx)(b.code,{children:"--kinds"}),", ",(0,V.jsx)(b.code,{children:"--not-kinds"}),", ",(0,V.jsx)(b.code,{children:"--runtimes"}),", and ",(0,V.jsx)(b.code,{children:"--not-runtimes"})," select the kinds this host accepts. ",(0,V.jsx)(b.code,{children:"--env-file"})," is an optional local file copied onto the host. The service passes that path to the supervisor. It never passes ",(0,V.jsx)(b.code,{children:"--source"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:["The environment secret comes from ",(0,V.jsx)(b.code,{children:"CUE_ENVIRONMENT_SECRET"}),". If it is missing, the command prompts for it. The prompt does not echo, and it needs a terminal. Without ",(0,V.jsx)(b.code,{children:"--worker"}),", the worker name is the remote hostname, with every other character turned into a hyphen."]}),"\n",(0,V.jsxs)(b.p,{children:["Before the install, the command reads the VPS egress address from the host route and prints it. Add that address on ",(0,V.jsx)(b.code,{children:"/account/edge"}),", and allow it on the orchestrator facade ports 3443, 4443, 6380, 8443, 9443, 7443, and 4873. The command does not connect to the orchestrator."]}),"\n",(0,V.jsxs)(b.p,{children:["On the host, a system Node.js that is already version 22 or newer stays. Otherwise the script extracts the official Node 22 archive into ",(0,V.jsx)(b.code,{children:"/usr/local"}),". It does not use nvm. Docker Engine and the Compose plugin stay when ",(0,V.jsx)(b.code,{children:"docker compose"})," already answers. Otherwise they are installed from the Docker apt repository, and Docker is enabled. The system user ",(0,V.jsx)(b.code,{children:"cue"})," is created when missing, in the ",(0,V.jsx)(b.code,{children:"docker"})," group, with home ",(0,V.jsx)(b.code,{children:"/var/lib/cue-supervisor"}),". The script installs ",(0,V.jsx)(b.code,{children:"@ascentstudio/cue-supervisor"})," at the SDK version."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"supervisor.env"})," is mode ",(0,V.jsx)(b.code,{children:"0600"}),". It sets ",(0,V.jsx)(b.code,{children:"WORKER_ORGANIZATION"}),", ",(0,V.jsx)(b.code,{children:"CUE_URL"}),", ",(0,V.jsx)(b.code,{children:"CUE_ENVIRONMENT_SECRET"}),", ",(0,V.jsx)(b.code,{children:"CUE_ENVIRONMENT_NAME"}),", ",(0,V.jsx)(b.code,{children:"WORKER_NAME"}),", ",(0,V.jsx)(b.code,{children:"SUPERVISOR_CERT_DIR=/var/lib/ultimate-scraper/supervisor"}),", and ",(0,V.jsx)(b.code,{children:"ORCH_REVISION_CACHE=/var/lib/cue-supervisor/revisions"}),". No ",(0,V.jsx)(b.code,{children:"package.json"})," is placed in ",(0,V.jsx)(b.code,{children:"/var/lib/cue-supervisor"}),". The supervisor enrolls as ",(0,V.jsx)(b.code,{children:"organization/environment/host"}),", using ",(0,V.jsx)(b.code,{children:"WORKER_ORGANIZATION"})," because that directory has no checkout. After enrollment, ",(0,V.jsx)(b.code,{children:"fetchWorkerEnvironment"})," still checks that the secret matches that organization and environment. The pinned revision is downloaded into the revision cache. Process mode does not treat the install directory as source. Container mode starts the images of that revision. Process mode starts ",(0,V.jsx)(b.code,{children:"worker"})," from that revision. A ",(0,V.jsx)(b.code,{children:"cue dev"})," inside a checkout still uses that checkout."]}),"\n",(0,V.jsxs)(b.p,{children:["The firewall step runs before the service starts. The script installs ",(0,V.jsx)(b.code,{children:"ufw"})," when it is missing, allows the server port from ",(0,V.jsx)(b.code,{children:"SSH_CONNECTION"}),", and denies other incoming traffic. It does not open the facade ports. The supervisor is a client. If that port cannot be read, the script does not enable the firewall, and it exits, so the SSH session is not cut off. The unit is ",(0,V.jsx)(b.code,{children:"cue-supervisor.service"}),", with ",(0,V.jsx)(b.code,{children:"Restart=always"})," and ",(0,V.jsx)(b.code,{children:"WantedBy=multi-user.target"}),". A second run rewrites the unit and restarts the service."]}),"\n",(0,V.jsxs)(b.p,{children:["After the service starts, the command follows ",(0,V.jsx)(b.code,{children:"journalctl -u cue-supervisor -o cat"})," from that start. It prints the enrollment code, the waiting line when the orchestrator is unreachable, approval, denial, expiry, and a certificate that is already valid. It exits when the certificate is in place, approved, denied, or expired. Ctrl-C stops that relay and leaves the service running."]}),"\n",(0,V.jsx)(b.h2,{id:"backup",children:"Backup"}),"\n",(0,V.jsxs)(b.p,{children:["A backup container on the platform network waits until 03:00 UTC, runs the backup, and repeats that wait. The first backup and every later backup run at 03:00 UTC. It has no published port. It uses ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-backup:<version>"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:["The container dumps Postgres with ",(0,V.jsx)(b.code,{children:"pg_dump -Fc"})," to ",(0,V.jsx)(b.code,{children:"db:5432"}),", with the database password, not through host port 54322. It writes the ClickHouse metrics to a file and copies the certificate directory. It encrypts those files with ",(0,V.jsx)(b.code,{children:"age"}),", using the operator's public key, and stores them in the S3 bucket under the prefix ",(0,V.jsx)(b.code,{children:"cue-backups"}),". Retention is 30 days. The S3 credentials on the server can only write to that prefix."]}),"\n",(0,V.jsxs)(b.p,{children:["The age private key stays on the operator machine, at ",(0,V.jsx)(b.code,{children:"~/.config/cue/age.key"}),", mode ",(0,V.jsx)(b.code,{children:"0600"}),". It is not on the server."]}),"\n",(0,V.jsx)(b.p,{children:"Redis is not backed up."}),"\n",(0,V.jsx)(b.h2,{id:"restore",children:"Restore"}),"\n",(0,V.jsxs)(b.p,{children:["Decrypt a backup on the operator machine with the age private key at ",(0,V.jsx)(b.code,{children:"~/.config/cue/age.key"}),". Restore Postgres from the dump, restore the ClickHouse metrics, and restore the certificate directory."]}),"\n",(0,V.jsx)(b.p,{children:"Redis is not in the backup. After a Postgres restore, flush Redis. Jobs left in Redis would run again after Postgres already applied them."})]})}function dK(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(dJ,{...a})}):dJ(a)}let dL={title:"Install"},dM=[{href:"./server.mdx"},{href:"http://127.0.0.1:54321"},{href:"http://127.0.0.1:3001"}],dN={contents:[{heading:"install",content:"This installs the orchestrator and the supervisor on a machine from local archives. The console is a separate archive. Nothing is published to a registry. To install the published images on a Linux server, follow Server."},{heading:"machine",content:"Install Node.js 22 and pnpm. The repository pins pnpm 9.15.9. Docker runs the services below."},{heading:"machine",content:"Run the commands from the repository root."},{heading:"services",content:"Start Supabase, Redis, ClickHouse, MinIO, zot, and Verdaccio. Local development starts that same Supabase stack with docker compose up -d, together with Redis and ClickHouse."},{heading:"services",content:"The Supabase API listens on host port 54321. Postgres listens on host port 54322. The user, password, and database name are postgres. Supavisor, the transaction pooler, listens on host port 54329."},{heading:"services",content:"Supabase Studio is that same API listener: http://127.0.0.1:54321. The gateway asks for HTTP basic authentication before the page opens. The user is supabase and the password is DASHBOARD_PASSWORD, which defaults to this_password_is_insecure_and_should_be_updated. Both are set on the API gateway in deploy/supabase/docker-compose.yml."},{heading:"services",content:"The SQL files in deploy/supabase/migrations are plain Postgres SQL. A one-shot migrate service applies each file in filename order, then deploy/supabase/seed.sql once, after Postgres is ready. MIGRATE_SEED=0 skips that seed. Any other value applies it. The service records the versions in supabase_migrations.schema_migrations. deploy/supabase/config.toml remains the migration and seed source for supabase --workdir deploy db push, on these same ports. That seed inserts the person pierre@ascent-studio.fr. The password is the same string, and the person is a member of the fixture organization."},{heading:"services",content:"Redis listens on port 6379, with a 512mb limit and the noeviction policy. ClickHouse listens on port 8123 with no password, and loads deploy/clickhouse/metrics.sql on first start. MinIO listens on port 9000, and its console listens on port 9001. The root user is transient, the root password is MINIO_ROOT_PASSWORD, which defaults to transient-secret, and the bucket name is transient. These ports match docker-compose.yml and .env."},{heading:"services",content:"Zot listens on host port 5001 inside the platform network. The container listens on port 5000. Host port 5000 is often taken by AirPlay on macOS. Verdaccio listens on port 4873. Clients use the facade: https://127.0.0.1:7443 for zot and https://127.0.0.1:4873 for Verdaccio. The user is orchestrator and the password is orchestrator-secret, in deploy/registries/htpasswd. A person uses that password for docker login and npm login. The machine client presents its certificate, and Caddy injects the password. Verdaccio proxies npmjs. Packages under cue-org-* have no uplink. @ascentstudio/* is read from npmjs. Registration is closed. Verdaccio stores its packages in a volume because the process runs as uid 10001."},{heading:"environment",content:"Put these variables in the environment of both processes. The names are the same in development and on a deployed machine. The host and ports match the compose file."},{heading:"environment",content:"ORCH_DATABASE_URL is the direct Postgres URL. The orchestrator connects as owner and presents a client certificate that Supavisor does not relay. The supervisor, the worker, and slot processes do not use ORCH_DATABASE_URL. The password in that URL is POSTGRES_PASSWORD."},{heading:"environment",content:"POSTGRES_PASSWORD, SUPABASE_JWT_SECRET, NEXT_PUBLIC_SUPABASE_ANON_KEY, and SUPABASE_SERVICE_ROLE_KEY are the same names as in .env.example. That file holds the public Supabase local demo defaults. A deployed machine replaces those values."},{heading:"environment",content:"ORCH_URL is optional. It is the console address of the machine API. When it is unset, the console uses https://127.0.0.1:3443. A set value must be https. The console presents its client certificate. The orchestrator process itself listens on port 3001, behind the facade."},{heading:"environment",content:"CUE_URL is required for the supervisor. It must be https. There is no http://127.0.0.1:3001 default. The supervisor derives Redis (rediss://<host>:6380), ClickHouse (https://<host>:8443), transient files (https://<host>:9443, region us-east-1, bucket transient), enrollment (https://<host>:4443), zot (https://<host>:7443), and Verdaccio (https://<host>:4873) from that host. CUE_REDIS_URL, CUE_CLICKHOUSE_URL, and CUE_TRANSIENT_S3_ENDPOINT are optional. An override is used only when its port is not the facade port. The MinIO root password is MINIO_ROOT_PASSWORD in docker-compose, for the console on the internal network."},{heading:"environment",content:"pnpm --filter @ascentstudio/cue-orchestrator dev sets CUE_ENROLLMENT=dev on the orchestrator only. The orchestrator then approves an enrollment when the supervisor creates it. The supervisor still prints the code and polls. It never approves itself. serve does not set the variable: a person approves the code on the Supervisors page."},{heading:"environment",content:"ORCH_REVISION_CACHE is a local cache, empty at first. Import publishes each revision to Verdaccio as cue-org-<organization>-revision at version 0.0.0-<revision>. The orchestrator and each supervisor download that archive into <cache>/<organization>/<revision>/ and check dist.integrity. The cache is not a list of revisions. An environment pin and any revision still held by an open run choose what is downloaded. Images stay on zot, the local registry, or Scaleway."},{heading:"environment",content:"The supervisor and the worker read CUE_ENVIRONMENT_SECRET and CUE_ENVIRONMENT_NAME. The secret is the bearer token on every orchestrator call. The name is the environment in the organization checkout. --environment overrides that name for one launch. The fixture seed secret for fixture/local is fixture-local. WORKER_NAME is the host name: lowercase letters, digits, and hyphens."},{heading:"archives",content:"Install the platform tarballs in dist/packages/ with pnpm, in this order. Each file is on disk. Later packages depend on earlier ones. @ascentstudio/cue-sdk is the package an organization imports. Its command is cue. The console and the docs are separate archives and are installed on their own. pnpm build also writes @ascentstudio/cue-org-fixture when FIXTURE is set. That archive installs the same way and is not inside the platform archives. Another organization is packed from its own checkout, not by this build. pnpm publish-packages builds this series and publishes it to npm with public access, in the same order, then the console, the docs, and the fixture. It does not publish an organization revision. After that npm publish, it pushes ascentstudio/cue-orchestrator:<version>, ascentstudio/cue-caddy:<version>, ascentstudio/cue-zot:<version>, and ascentstudio/cue-backup:<version>. It does not push latest."},{heading:"archives",content:"One pnpm install -g of the supervisor tarball installs both the supervisor and worker commands."},{heading:"archives",content:"FIXTURE in .env is the fixture checkout. When it is set, pnpm build writes @ascentstudio/cue-org-fixture into dist/packages/. An organization uses cue build, cue pack, and cue test in its own directory."},{heading:"run",content:"Start the orchestrator:"},{heading:"run",content:"To run one organization from its sources, pass that directory. --source overrides ORCH_SOURCE. The directory must contain src/index.ts and src/steps.ts. The orchestrator watches it and uses those sources for an environment of that organization when unpublished sources are allowed. Other environments keep the imported revision. FIXTURE is not read for this."},{heading:"run",content:"In another terminal, start the supervisor. --mode process starts each slot as a process on this machine. --environment names the environment and overrides CUE_ENVIRONMENT_NAME for that launch. CUE_ENVIRONMENT_SECRET is the bearer token. --env-file is the organization environment file. The organization id is the one exported by src/index.ts. In process mode, --source starts the installed worker through the @ascentstudio/cue-sdk loader on that directory. Container mode refuses --source and starts the published revision."},{heading:"console",content:"Install the console archive on its own. Do this before or after the platform archives above."},{heading:"console",content:"The install also fetches Next, React, and the console server dependencies. console runs next start."},{heading:"console",content:"Start it with:"},{heading:"console",content:"console listens on PORT. The default is 3000."},{heading:"console",content:"The orchestrator does not start console or docs. Start console in another terminal. A checkout starts the console app with pnpm --filter @ascentstudio/cue-console dev. Caddy still reaches it on port 3000. On a server, the published image entrypoint starts the console and the docs."},{heading:"console",content:"The console calls the orchestrator at ORCH_URL. When ORCH_URL is unset, that address is https://127.0.0.1:3443. A set value must be https. The console presents its client certificate. Bull Board reads ORCH_REDIS_URL. The session reads NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY, and SUPABASE_SERVER_URL. SUPABASE_SERVER_URL is the Supabase URL on the server. When it is unset, the console uses NEXT_PUBLIC_SUPABASE_URL. Without the Supabase URL and anon key, the pages still open, with no session."},{heading:"console",content:"The preview server on http://127.0.0.1:3001 accepts Authorization: Bearer person-1. The console does not call that server. It calls the https facade."},{heading:"docs",content:"Install the docs archive on its own."},{heading:"docs",content:"The install also fetches Next and React. docs runs next start."},{heading:"docs",content:"Start it with:"},{heading:"docs",content:"docs listens on PORT. The default is 3002. The orchestrator does not start docs. A checkout starts the same app with pnpm --filter @ascentstudio/cue-docs dev."},{heading:"edge-with-caddy",content:"The orchestrator always prepares the certificate facade. Caddy is the only remote entry. ORCH_CADDY_PLACEMENT chooses how Caddy reaches this machine. Unset, or host, is the production placement: Caddy runs on the Linux host network, sees the real client address, and reaches the orchestrator on 127.0.0.1. desktop is the development placement. It runs on Linux, Mac, and Docker Desktop. Any other value stops the orchestrator at startup."},{heading:"environment-1",content:"Add these variables to the orchestrator environment, and change the service addresses to go through Caddy:"},{heading:"environment-1",content:"ORCH_EDGE_NAMES lists the names in the server certificate, separated by commas. network.ini EDGE_NAME supplies a name on that certificate, and 127.0.0.1 is added with it. Keep 127.0.0.1: the orchestrator and the console reach Caddy and Postgres on that address and check it against the certificate."},{heading:"environment-1",content:"network.ini at the repository root is the relay behind that certificate check. An installed command with no checkout reads /var/lib/ultimate-scraper/network.ini. When the file is absent, Caddy keeps the Docker addresses in edgeUpstreams. EDGE_NAME is added to the server certificate, and 127.0.0.1 is added with it. UPSTREAM_REDIS, UPSTREAM_CLICKHOUSE, UPSTREAM_MINIO, UPSTREAM_ZOT, and UPSTREAM_NPM are the host:port values Caddy dials after the client certificate is accepted. UPSTREAM_CONSOLE and UPSTREAM_API are optional: without them the desktop placement uses host.docker.internal, and the host placement uses 127.0.0.1. A bad line stops the orchestrator at startup. The client URLs above stay on the facade ports. They do not move when an upstream moves."},{heading:"environment-1",content:"Pointing an upstream at another machine is the choice to open that service port for Caddy. The hop after Caddy is plaintext, as it is on the Docker bridge. Publishing Redis, ClickHouse, MinIO, zot, or Verdaccio on the host, or letting another party dial those ports directly, is a separate choice in Compose or the firewall. The orchestrator does not open that path."},{heading:"environment-1",content:"ORCH_CERT_DIR is the directory of the chain. In a checkout the default is dist/certs at the repository root. Run Compose from that root, so the containers mount the same path. An installed command has no checkout: when ORCH_CERT_DIR is unset it uses /var/lib/ultimate-scraper/certs. The user that runs the orchestrator must be able to write the directory."},{heading:"environment-1",content:"Ports 7443 and 4873 are always in the Caddyfile, with the private server certificate. Those two ports do not use Let's Encrypt. The orchestrator, on this machine, calls https://127.0.0.1:7443 and https://127.0.0.1:4873. A supervisor calls the host of CUE_URL on those same ports."},{heading:"environment-1",content:"ORCH_REGISTRY_PASSWORD is the password of the human user orchestrator for docker login and npm login. The orchestrator writes it, with two machine accounts, into ORCH_CERT_DIR/registry.htpasswd."},{heading:"environment-1",content:"ORCH_CONSOLE_HOST is the optional DNS name of the console. Set a hostname only: no scheme, no port, and no path. A bad value stops the orchestrator at startup. An omitted console host does not add a Let's Encrypt site. Ports 443, 7443, and 4873 distinguish the console, zot, and Verdaccio. The registry listeners stay on the private certificate."},{heading:"environment-1",content:"When a console name is published, port 443 has the catch-all and two named sites. https://:443 keeps the private server certificate, for clients that dial an address and send no name. https://<name>:443 uses Let's Encrypt and does not ask for a client certificate. That site forwards only /auth/v1 to 127.0.0.1:54321. The rest goes to the console. Studio stays on the gateway. https://doc.<name>:443 uses the same Let's Encrypt issuer and the same address list, does not ask for a client certificate, and forwards to the docs. The docs name is doc.<ORCH_CONSOLE_HOST>. There is no separate variable for it. In the host placement the docs upstream is 127.0.0.1:3002. In the desktop placement it is host.docker.internal:3002. UPSTREAM_DOCS replaces that upstream. An empty list leaves the named sites open. A non-empty list restricts them."},{heading:"environment-1",content:"ORCH_ACME_EMAIL is optional. When it is set, it is passed to the ACME issuer. The DNS names, including the console name and doc.<console name>, must point at this machine, and port 80 must be reachable from the internet. Let's Encrypt completes the HTTP-01 challenge on that port for both names. Port 80 is not a site in the Caddyfile. The certificates and the Let's Encrypt account stay in the caddy-data volume, mounted on /data. If a certificate fails, the listeners of the private authority stay in place."},{heading:"environment-1",content:"The orchestrator checks the Supabase token of each person with SUPABASE_JWT_SECRET or SUPABASE_JWKS_URL. Set one of them."},{heading:"services-1",content:"Stop the plaintext services first if they run. The data volumes are kept."},{heading:"services-1",content:"docker-compose.caddy.yml builds Caddy from deploy/caddy/Dockerfile, with the caddy-l4 module for Redis. It removes the host ports of Redis, ClickHouse, MinIO, zot, Verdaccio, and Supavisor. The platform file publishes Supavisor on host port 54329. The Caddy overlay still terminates Postgres TLS on the published database port, 54322. Postgres negotiates TLS in its own protocol, uses the server certificate of the chain, and asks for a client certificate. Verdaccio receives VERDACCIO_PUBLIC_URL=https://127.0.0.1:4873. A non-local CUE_URL host should advertise https://<that host>:4873. zot and Verdaccio leave the platform network and listen on 172.30.1.13 and 172.30.1.14."},{heading:"services-1",content:"Caddy, Postgres, zot, and Verdaccio wait until the orchestrator has written their files. On the very first start, Postgres initializes after that. If the orchestrator stops because Postgres is not ready yet, start it again."},{heading:"desktop",content:"Development on Linux, Mac, or Docker Desktop uses the desktop placement instead of the overlay above. Do not combine the two files. Stop the plaintext services first if they run. Start this stack before the orchestrator."},{heading:"desktop",content:"The certificate check is the same as on the host placement. network.ini still names the relay. EDGE_NAME=127.0.0.1 matches this machine."},{heading:"desktop",content:"Caddy joins the platform network and the registry network, and publishes ports 443, 3443, 4443, 6380, 8443, 9443, 7443, and 4873. It reaches the console and the orchestrator at host.docker.internal. Redis, ClickHouse, and MinIO stay on 172.30.0.10 through 172.30.0.12. zot is 172.30.1.13 and Verdaccio is 172.30.1.14. Port 80 is not published, so Let's Encrypt stays on the host placement. The registry ports do not use it."},{heading:"desktop",content:"ORCH_CERT_DIR must be the same path on the machine and in the containers. The checkout default, dist/certs, is that path. On Mac it sits under /Users, which Docker Desktop shares. The orchestrator and the console listen on 0.0.0.0, so ports 3000 and 3001 are reachable on the local network. Compose does not publish them."},{heading:"desktop",content:"A connection from this machine arrives at Caddy as 172.30.0.1 on Linux. On Docker Desktop, set ORCH_CADDY_LOCAL_CIDR to the address that reaches the published ports, 192.168.65.1/32 on Docker Desktop for Mac. The desktop Caddyfile and pg_hba.conf treat that value and the gateway as the host, together with 127.0.0.1 and ::1. Leave the variable unset and only the gateway is added. The host placement ignores the variable. The address list does not distinguish clients. Checking that list still requires the host placement on Linux."},{heading:"start",content:"Start the orchestrator as before. On each start it:"},{heading:"start",content:"creates or reloads the chain in ORCH_CERT_DIR, and renews the service certificates that expire within 30 days;"},{heading:"start",content:"writes Caddyfile, pg_hba.conf, pg_reload.sql, and registry.htpasswd into ORCH_CERT_DIR, from the last applied list in edge-allow.json. The Caddyfile is readable by its owner only, because it contains the machine registry passwords;"},{heading:"start",content:"listens on 127.0.0.1:3001 in the host placement, and on 0.0.0.0:3001 in the desktop placement;"},{heading:"start",content:"does not start the console or the docs. An archive install starts console and docs as their own processes. The published image entrypoint starts them after the orchestrator has written console-client.crt and the Caddyfile, the console on port 3000 and the docs on port 3002. The console calls the orchestrator at ORCH_URL. When ORCH_URL is unset, that address is https://127.0.0.1:3443. The console presents its client certificate on every call."},{heading:"start",content:"From a checkout, run pnpm --filter @ascentstudio/cue-console dev and pnpm --filter @ascentstudio/cue-docs dev in other terminals. They read the same .env. The console listens on port 3000 and the docs listen on port 3002. Stopping the orchestrator does not stop those processes. MinIO on port 9443 requires the client certificate and accepts the request without a signature. The root password in docker-compose is for the console on the internal network. Enrollment on port 4443 uses server TLS only, because the supervisor does not have a client certificate yet."},{heading:"start",content:"Caddy runs with --watch and reloads when the Caddyfile changes. A renewed server certificate changes the Caddyfile, so Caddy reloads it. Postgres reads a renewed server certificate on its next restart."},{heading:"ports",content:"Port"},{heading:"ports",content:"Listener"},{heading:"ports",content:"TLS"},{heading:"ports",content:"443"},{heading:"ports",content:"Console and docs"},{heading:"ports",content:"Private certificate on the catch-all. Let's Encrypt on the console name and on doc.<console name>"},{heading:"ports",content:"4443"},{heading:"ports",content:"Enrollment: POST /enrollments and POST /enrollments/poll"},{heading:"ports",content:"Server certificate"},{heading:"ports",content:"3443"},{heading:"ports",content:"Machine API"},{heading:"ports",content:"Client certificate"},{heading:"ports",content:"6380"},{heading:"ports",content:"Redis"},{heading:"ports",content:"Client certificate"},{heading:"ports",content:"8443"},{heading:"ports",content:"ClickHouse HTTP"},{heading:"ports",content:"Client certificate"},{heading:"ports",content:"9443"},{heading:"ports",content:"MinIO S3 API"},{heading:"ports",content:"Client certificate"},{heading:"ports",content:"7443"},{heading:"ports",content:"zot"},{heading:"ports",content:"Private certificate. A client certificate is checked when one is offered"},{heading:"ports",content:"4873"},{heading:"ports",content:"Verdaccio"},{heading:"ports",content:"Private certificate. A client certificate is checked when one is offered"},{heading:"ports",content:"80"},{heading:"ports",content:"HTTP-01 challenge"},{heading:"ports",content:"ACME response, not a Caddyfile site"},{heading:"ports",content:"54322"},{heading:"ports",content:"Postgres"},{heading:"ports",content:"Postgres TLS, client certificate"},{heading:"ports",content:"A client certificate must be signed by the intermediate authority of the chain. On the machine API, Caddy passes the verified certificate to the orchestrator in the Client-Cert header, as RFC 9440 DER in base64 between colons. Caddy removes that header on every other listener. On the ClickHouse listener, Caddy also removes X-ClickHouse-SSL-Certificate-Auth. The official client sets that header when it presents a certificate, and ClickHouse would then try to authenticate a certificate that Caddy already consumed. The ClickHouse native port and the MinIO console stay on the platform network."},{heading:"ports",content:"zot and Verdaccio use the private server certificate. An invalid client certificate fails the handshake. No client certificate leaves the request through, and the caller sends a login. The orchestrator client certificate is the write account. Every other valid certificate is the read account. An empty address list allows only 127.0.0.1 and ::1 on those sites, the same filter as MinIO. The console name, when published, uses Let's Encrypt on port 443 and does not ask for a client certificate. doc.<console name> is a second Let's Encrypt site on that port, with the same address list and no client certificate. The console name forwards /auth/v1 to 127.0.0.1:54321 and the rest to the console. The docs site forwards to port 3002. An empty list leaves both named sites open, and a non-empty list restricts them. Port 443 still has the catch-all with the private certificate. Port 80 answers the HTTP-01 challenge for the console name and for doc.<console name>. It is not a site in the Caddyfile, and the registry listeners do not depend on that challenge."},{heading:"registries",content:"A person logs in as orchestrator with ORCH_REGISTRY_PASSWORD. With the names unset, the addresses are 127.0.0.1:7443 and https://127.0.0.1:4873. With the names set, use those names on the same ports. There is no Let's Encrypt certificate on either port. Trust the private authority, or dial the address from a machine that already has it."},{heading:"registries",content:"A machine does not log in. After enrollment it presents the client certificate signed by the intermediate. Caddy accepts that certificate as the read account. The orchestrator presents its own client certificate, and Caddy accepts that one as the write account. The supervisor does not change the npm registry URL of this project."},{heading:"registries",content:"The console does not call zot or Verdaccio. It keeps calling the orchestrator, which relays /runtimes/packages and /runtimes/images."},{heading:"registries",content:"cue-org-* is published here. Other package names, including @ascentstudio/*, are fetched from npmjs through Verdaccio. An environment still resolves images as local or scaleway. Plaintext compose still mounts deploy/registries/htpasswd, which contains only the orchestrator user."},{heading:"address-list",content:"The console page /account/edge edits the edge_allow table. Each change rewrites the Caddyfile and pg_hba.conf, then the orchestrator runs select pg_reload_conf(). If that reload fails, run pg_reload.sql as the database owner."},{heading:"address-list",content:"With an empty list, every machine listener refuses remote addresses: enrollment, machine API, Redis, ClickHouse, MinIO, Postgres, zot, and Verdaccio. The console is open to everyone, so the first person can sign in."},{heading:"address-list",content:"A change is refused if the list that results does not contain the address of the person making it. After the first address, both port 443 sites use the same list. The Let's Encrypt name still does not ask for a client certificate."},{heading:"address-list",content:"The host itself, 127.0.0.1 and ::1, is always allowed. Postgres also allows the gateway of the platform network, 172.30.0.1, which is how a Linux host reaches its published port. In the desktop placement, Caddy and Postgres also allow ORCH_CADDY_LOCAL_CIDR when it is set. The host placement never writes that address."},{heading:"address-list",content:"Postgres allows the platform network, 172.30.0.0/24, with a password and without a client certificate, over TLS and without TLS. Auth, REST, and Storage connect from that network. The gateway rule is more specific, so the published port still requires a client certificate."},{heading:"address-list",content:"Add the address of a supervisor before you start it. Otherwise its enrollment request does not reach the orchestrator."},{heading:"images",content:"From the repository root, this prints the image build and does not build:"},{heading:"images",content:"The images are linux/amd64 and linux/arm64. Each image has its own repository, tagged with the root package.json version: ascentstudio/cue-orchestrator:<version>, ascentstudio/cue-caddy:<version>, ascentstudio/cue-zot:<version>, and ascentstudio/cue-backup:<version>. There is no latest tag. This script does not push. pnpm publish-packages pushes those four repositories after the npm publish."}],headings:[{id:"install",content:"Install"},{id:"machine",content:"Machine"},{id:"services",content:"Services"},{id:"environment",content:"Environment"},{id:"archives",content:"Archives"},{id:"run",content:"Run"},{id:"console",content:"Console"},{id:"docs",content:"Docs"},{id:"edge-with-caddy",content:"Edge with Caddy"},{id:"environment-1",content:"Environment"},{id:"services-1",content:"Services"},{id:"desktop",content:"Desktop"},{id:"start",content:"Start"},{id:"ports",content:"Ports"},{id:"registries",content:"Registries"},{id:"address-list",content:"Address list"},{id:"images",content:"Images"}]},dO=[{depth:1,url:"#install",title:(0,V.jsx)(V.Fragment,{children:"Install"})},{depth:2,url:"#machine",title:(0,V.jsx)(V.Fragment,{children:"Machine"})},{depth:2,url:"#services",title:(0,V.jsx)(V.Fragment,{children:"Services"})},{depth:2,url:"#environment",title:(0,V.jsx)(V.Fragment,{children:"Environment"})},{depth:2,url:"#archives",title:(0,V.jsx)(V.Fragment,{children:"Archives"})},{depth:2,url:"#run",title:(0,V.jsx)(V.Fragment,{children:"Run"})},{depth:2,url:"#console",title:(0,V.jsx)(V.Fragment,{children:"Console"})},{depth:2,url:"#docs",title:(0,V.jsx)(V.Fragment,{children:"Docs"})},{depth:2,url:"#edge-with-caddy",title:(0,V.jsx)(V.Fragment,{children:"Edge with Caddy"})},{depth:3,url:"#environment-1",title:(0,V.jsx)(V.Fragment,{children:"Environment"})},{depth:3,url:"#services-1",title:(0,V.jsx)(V.Fragment,{children:"Services"})},{depth:3,url:"#desktop",title:(0,V.jsx)(V.Fragment,{children:"Desktop"})},{depth:3,url:"#start",title:(0,V.jsx)(V.Fragment,{children:"Start"})},{depth:3,url:"#ports",title:(0,V.jsx)(V.Fragment,{children:"Ports"})},{depth:3,url:"#registries",title:(0,V.jsx)(V.Fragment,{children:"Registries"})},{depth:3,url:"#address-list",title:(0,V.jsx)(V.Fragment,{children:"Address list"})},{depth:2,url:"#images",title:(0,V.jsx)(V.Fragment,{children:"Images"})}];function dP(a){let b={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",span:"span",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"install",children:"Install"}),"\n",(0,V.jsxs)(b.p,{children:["This installs the orchestrator and the supervisor on a machine from local archives. The console is a separate archive. Nothing is published to a registry. To install the published images on a Linux server, follow ",(0,V.jsx)(b.a,{href:"./server.mdx",children:"Server"}),"."]}),"\n",(0,V.jsx)(b.h2,{id:"machine",children:"Machine"}),"\n",(0,V.jsx)(b.p,{children:"Install Node.js 22 and pnpm. The repository pins pnpm 9.15.9. Docker runs the services below."}),"\n",(0,V.jsx)(b.p,{children:"Run the commands from the repository root."}),"\n",(0,V.jsx)(b.h2,{id:"services",children:"Services"}),"\n",(0,V.jsxs)(b.p,{children:["Start Supabase, Redis, ClickHouse, MinIO, zot, and Verdaccio. Local development starts that same Supabase stack with ",(0,V.jsx)(b.code,{children:"docker compose up -d"}),", together with Redis and ClickHouse."]}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"docker"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" compose"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -f"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" docker-compose.platform.yml"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" up"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -d"})]})})})}),"\n",(0,V.jsxs)(b.p,{children:["The Supabase API listens on host port 54321. Postgres listens on host port 54322. The user, password, and database name are ",(0,V.jsx)(b.code,{children:"postgres"}),". Supavisor, the transaction pooler, listens on host port 54329."]}),"\n",(0,V.jsxs)(b.p,{children:["Supabase Studio is that same API listener: ",(0,V.jsx)(b.a,{href:"http://127.0.0.1:54321",children:"http://127.0.0.1:54321"}),". The gateway asks for HTTP basic authentication before the page opens. The user is ",(0,V.jsx)(b.code,{children:"supabase"})," and the password is ",(0,V.jsx)(b.code,{children:"DASHBOARD_PASSWORD"}),", which defaults to ",(0,V.jsx)(b.code,{children:"this_password_is_insecure_and_should_be_updated"}),". Both are set on the API gateway in ",(0,V.jsx)(b.code,{children:"deploy/supabase/docker-compose.yml"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:["The SQL files in ",(0,V.jsx)(b.code,{children:"deploy/supabase/migrations"})," are plain Postgres SQL. A one-shot migrate service applies each file in filename order, then ",(0,V.jsx)(b.code,{children:"deploy/supabase/seed.sql"})," once, after Postgres is ready. ",(0,V.jsx)(b.code,{children:"MIGRATE_SEED=0"})," skips that seed. Any other value applies it. The service records the versions in ",(0,V.jsx)(b.code,{children:"supabase_migrations.schema_migrations"}),". ",(0,V.jsx)(b.code,{children:"deploy/supabase/config.toml"})," remains the migration and seed source for ",(0,V.jsx)(b.code,{children:"supabase --workdir deploy db push"}),", on these same ports. That seed inserts the person ",(0,V.jsx)(b.code,{children:"pierre@ascent-studio.fr"}),". The password is the same string, and the person is a member of the fixture organization."]}),"\n",(0,V.jsxs)(b.p,{children:["Redis listens on port 6379, with a 512mb limit and the ",(0,V.jsx)(b.code,{children:"noeviction"})," policy. ClickHouse listens on port 8123 with no password, and loads ",(0,V.jsx)(b.code,{children:"deploy/clickhouse/metrics.sql"})," on first start. MinIO listens on port 9000, and its console listens on port 9001. The root user is ",(0,V.jsx)(b.code,{children:"transient"}),", the root password is ",(0,V.jsx)(b.code,{children:"MINIO_ROOT_PASSWORD"}),", which defaults to ",(0,V.jsx)(b.code,{children:"transient-secret"}),", and the bucket name is ",(0,V.jsx)(b.code,{children:"transient"}),". These ports match ",(0,V.jsx)(b.code,{children:"docker-compose.yml"})," and ",(0,V.jsx)(b.code,{children:".env"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:["Zot listens on host port 5001 inside the platform network. The container listens on port 5000. Host port 5000 is often taken by AirPlay on macOS. Verdaccio listens on port 4873. Clients use the facade: ",(0,V.jsx)(b.code,{children:"https://127.0.0.1:7443"})," for zot and ",(0,V.jsx)(b.code,{children:"https://127.0.0.1:4873"})," for Verdaccio. The user is ",(0,V.jsx)(b.code,{children:"orchestrator"})," and the password is ",(0,V.jsx)(b.code,{children:"orchestrator-secret"}),", in ",(0,V.jsx)(b.code,{children:"deploy/registries/htpasswd"}),". A person uses that password for ",(0,V.jsx)(b.code,{children:"docker login"})," and ",(0,V.jsx)(b.code,{children:"npm login"}),". The machine client presents its certificate, and Caddy injects the password. Verdaccio proxies npmjs. Packages under ",(0,V.jsx)(b.code,{children:"cue-org-*"})," have no uplink. ",(0,V.jsx)(b.code,{children:"@ascentstudio/*"})," is read from npmjs. Registration is closed. Verdaccio stores its packages in a volume because the process runs as uid 10001."]}),"\n",(0,V.jsx)(b.h2,{id:"environment",children:"Environment"}),"\n",(0,V.jsx)(b.p,{children:"Put these variables in the environment of both processes. The names are the same in development and on a deployed machine. The host and ports match the compose file."}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsxs)(b.code,{children:[(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"POSTGRES_PASSWORD"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"postgres"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"SUPABASE_JWT_SECRET"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"NEXT_PUBLIC_SUPABASE_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"http://127.0.0.1:54321"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"NEXT_PUBLIC_SUPABASE_ANON_KEY"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"SUPABASE_SERVICE_ROLE_KEY"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_DATABASE_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"postgresql://postgres:postgres@127.0.0.1:54322/postgres"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_REDIS_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"rediss://127.0.0.1:6380"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_CLICKHOUSE_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"https://127.0.0.1:8443"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"CUE_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"https://127.0.0.1:3443"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"CUE_ENVIRONMENT_SECRET"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"fixture-local"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"CUE_ENVIRONMENT_NAME"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"local"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_REVISION_CACHE"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"/var/lib/ultimate-scraper/revisions"})]})]})})}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ORCH_DATABASE_URL"})," is the direct Postgres URL. The orchestrator connects as owner and presents a client certificate that Supavisor does not relay. The supervisor, the worker, and slot processes do not use ",(0,V.jsx)(b.code,{children:"ORCH_DATABASE_URL"}),". The password in that URL is ",(0,V.jsx)(b.code,{children:"POSTGRES_PASSWORD"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"POSTGRES_PASSWORD"}),", ",(0,V.jsx)(b.code,{children:"SUPABASE_JWT_SECRET"}),", ",(0,V.jsx)(b.code,{children:"NEXT_PUBLIC_SUPABASE_ANON_KEY"}),", and ",(0,V.jsx)(b.code,{children:"SUPABASE_SERVICE_ROLE_KEY"})," are the same names as in ",(0,V.jsx)(b.code,{children:".env.example"}),". That file holds the public Supabase local demo defaults. A deployed machine replaces those values."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ORCH_URL"})," is optional. It is the console address of the machine API. When it is unset, the console uses ",(0,V.jsx)(b.code,{children:"https://127.0.0.1:3443"}),". A set value must be https. The console presents its client certificate. The orchestrator process itself listens on port 3001, behind the facade."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"CUE_URL"})," is required for the supervisor. It must be https. There is no ",(0,V.jsx)(b.code,{children:"http://127.0.0.1:3001"})," default. The supervisor derives Redis (",(0,V.jsx)(b.code,{children:"rediss://<host>:6380"}),"), ClickHouse (",(0,V.jsx)(b.code,{children:"https://<host>:8443"}),"), transient files (",(0,V.jsx)(b.code,{children:"https://<host>:9443"}),", region ",(0,V.jsx)(b.code,{children:"us-east-1"}),", bucket ",(0,V.jsx)(b.code,{children:"transient"}),"), enrollment (",(0,V.jsx)(b.code,{children:"https://<host>:4443"}),"), zot (",(0,V.jsx)(b.code,{children:"https://<host>:7443"}),"), and Verdaccio (",(0,V.jsx)(b.code,{children:"https://<host>:4873"}),") from that host. ",(0,V.jsx)(b.code,{children:"CUE_REDIS_URL"}),", ",(0,V.jsx)(b.code,{children:"CUE_CLICKHOUSE_URL"}),", and ",(0,V.jsx)(b.code,{children:"CUE_TRANSIENT_S3_ENDPOINT"})," are optional. An override is used only when its port is not the facade port. The MinIO root password is ",(0,V.jsx)(b.code,{children:"MINIO_ROOT_PASSWORD"})," in docker-compose, for the console on the internal network."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"pnpm --filter @ascentstudio/cue-orchestrator dev"})," sets ",(0,V.jsx)(b.code,{children:"CUE_ENROLLMENT=dev"})," on the orchestrator only. The orchestrator then approves an enrollment when the supervisor creates it. The supervisor still prints the code and polls. It never approves itself. ",(0,V.jsx)(b.code,{children:"serve"})," does not set the variable: a person approves the code on the Supervisors page."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ORCH_REVISION_CACHE"})," is a local cache, empty at first. Import publishes each revision to Verdaccio as ",(0,V.jsx)(b.code,{children:"cue-org-<organization>-revision"})," at version ",(0,V.jsx)(b.code,{children:"0.0.0-<revision>"}),". The orchestrator and each supervisor download that archive into ",(0,V.jsx)(b.code,{children:"<cache>/<organization>/<revision>/"})," and check ",(0,V.jsx)(b.code,{children:"dist.integrity"}),". The cache is not a list of revisions. An environment pin and any revision still held by an open run choose what is downloaded. Images stay on zot, the local registry, or Scaleway."]}),"\n",(0,V.jsxs)(b.p,{children:["The supervisor and the worker read ",(0,V.jsx)(b.code,{children:"CUE_ENVIRONMENT_SECRET"})," and ",(0,V.jsx)(b.code,{children:"CUE_ENVIRONMENT_NAME"}),". The secret is the bearer token on every orchestrator call. The name is the environment in the organization checkout. ",(0,V.jsx)(b.code,{children:"--environment"})," overrides that name for one launch. The fixture seed secret for ",(0,V.jsx)(b.code,{children:"fixture/local"})," is ",(0,V.jsx)(b.code,{children:"fixture-local"}),". ",(0,V.jsx)(b.code,{children:"WORKER_NAME"})," is the host name: lowercase letters, digits, and hyphens."]}),"\n",(0,V.jsx)(b.h2,{id:"archives",children:"Archives"}),"\n",(0,V.jsxs)(b.p,{children:["Install the platform tarballs in ",(0,V.jsx)(b.code,{children:"dist/packages/"})," with pnpm, in this order. Each file is on disk. Later packages depend on earlier ones. ",(0,V.jsx)(b.code,{children:"@ascentstudio/cue-sdk"})," is the package an organization imports. Its command is ",(0,V.jsx)(b.code,{children:"cue"}),". The console and the docs are separate archives and are installed on their own. ",(0,V.jsx)(b.code,{children:"pnpm build"})," also writes ",(0,V.jsx)(b.code,{children:"@ascentstudio/cue-org-fixture"})," when ",(0,V.jsx)(b.code,{children:"FIXTURE"})," is set. That archive installs the same way and is not inside the platform archives. Another organization is packed from its own checkout, not by this build. ",(0,V.jsx)(b.code,{children:"pnpm publish-packages"})," builds this series and publishes it to npm with public access, in the same order, then the console, the docs, and the fixture. It does not publish an organization revision. After that npm publish, it pushes ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-orchestrator:<version>"}),", ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-caddy:<version>"}),", ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-zot:<version>"}),", and ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-backup:<version>"}),". It does not push ",(0,V.jsx)(b.code,{children:"latest"}),"."]}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsxs)(b.code,{children:[(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"pnpm"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" install"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -g"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" dist/packages/ascentstudio-cue-contract-"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"*"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:".tgz"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"pnpm"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" install"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -g"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" dist/packages/ascentstudio-cue-engine-"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"*"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:".tgz"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"pnpm"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" install"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -g"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" dist/packages/ascentstudio-cue-sdk-"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"*"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:".tgz"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"pnpm"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" install"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -g"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" dist/packages/ascentstudio-cue-orchestrator-"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"*"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:".tgz"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"pnpm"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" install"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -g"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" dist/packages/ascentstudio-cue-supervisor-"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"*"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:".tgz"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"pnpm"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" install"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -g"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" dist/packages/ascentstudio-cue-org-fixture-"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"*"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:".tgz"})]})]})})}),"\n",(0,V.jsxs)(b.p,{children:["One ",(0,V.jsx)(b.code,{children:"pnpm install -g"})," of the supervisor tarball installs both the ",(0,V.jsx)(b.code,{children:"supervisor"})," and ",(0,V.jsx)(b.code,{children:"worker"})," commands."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"FIXTURE"})," in ",(0,V.jsx)(b.code,{children:".env"})," is the fixture checkout. When it is set, ",(0,V.jsx)(b.code,{children:"pnpm build"})," writes ",(0,V.jsx)(b.code,{children:"@ascentstudio/cue-org-fixture"})," into ",(0,V.jsx)(b.code,{children:"dist/packages/"}),". An organization uses ",(0,V.jsx)(b.code,{children:"cue build"}),", ",(0,V.jsx)(b.code,{children:"cue pack"}),", and ",(0,V.jsx)(b.code,{children:"cue test"})," in its own directory."]}),"\n",(0,V.jsx)(b.h2,{id:"run",children:"Run"}),"\n",(0,V.jsx)(b.p,{children:"Start the orchestrator:"}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"orchestrator"})})})})}),"\n",(0,V.jsxs)(b.p,{children:["To run one organization from its sources, pass that directory. ",(0,V.jsx)(b.code,{children:"--source"})," overrides ",(0,V.jsx)(b.code,{children:"ORCH_SOURCE"}),". The directory must contain ",(0,V.jsx)(b.code,{children:"src/index.ts"})," and ",(0,V.jsx)(b.code,{children:"src/steps.ts"}),". The orchestrator watches it and uses those sources for an environment of that organization when unpublished sources are allowed. Other environments keep the imported revision. ",(0,V.jsx)(b.code,{children:"FIXTURE"})," is not read for this."]}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"orchestrator"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --source"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" /absolute/path/fixture"})]})})})}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_SOURCE"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"/absolute/path/fixture"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" orchestrator"})]})})})}),"\n",(0,V.jsxs)(b.p,{children:["In another terminal, start the supervisor. ",(0,V.jsx)(b.code,{children:"--mode process"})," starts each slot as a process on this machine. ",(0,V.jsx)(b.code,{children:"--environment"})," names the environment and overrides ",(0,V.jsx)(b.code,{children:"CUE_ENVIRONMENT_NAME"})," for that launch. ",(0,V.jsx)(b.code,{children:"CUE_ENVIRONMENT_SECRET"})," is the bearer token. ",(0,V.jsx)(b.code,{children:"--env-file"})," is the organization environment file. The organization id is the one exported by ",(0,V.jsx)(b.code,{children:"src/index.ts"}),". In process mode, ",(0,V.jsx)(b.code,{children:"--source"})," starts the installed ",(0,V.jsx)(b.code,{children:"worker"})," through the ",(0,V.jsx)(b.code,{children:"@ascentstudio/cue-sdk"})," loader on that directory. Container mode refuses ",(0,V.jsx)(b.code,{children:"--source"})," and starts the published revision."]}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"supervisor"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --mode"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" process"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --environment"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" local"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --env-file"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" /absolute/path/fixture/.env"})]})})})}),"\n",(0,V.jsx)(b.h2,{id:"console",children:"Console"}),"\n",(0,V.jsx)(b.p,{children:"Install the console archive on its own. Do this before or after the platform archives above."}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"pnpm"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" install"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -g"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" dist/packages/ascentstudio-cue-console-"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"*"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:".tgz"})]})})})}),"\n",(0,V.jsxs)(b.p,{children:["The install also fetches Next, React, and the console server dependencies. ",(0,V.jsx)(b.code,{children:"console"})," runs ",(0,V.jsx)(b.code,{children:"next start"}),"."]}),"\n",(0,V.jsx)(b.p,{children:"Start it with:"}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"console"})})})})}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"console"})," listens on ",(0,V.jsx)(b.code,{children:"PORT"}),". The default is 3000."]}),"\n",(0,V.jsxs)(b.p,{children:["The orchestrator does not start ",(0,V.jsx)(b.code,{children:"console"})," or ",(0,V.jsx)(b.code,{children:"docs"}),". Start ",(0,V.jsx)(b.code,{children:"console"})," in another terminal. A checkout starts the console app with ",(0,V.jsx)(b.code,{children:"pnpm --filter @ascentstudio/cue-console dev"}),". Caddy still reaches it on port 3000. On a server, the published image entrypoint starts the console and the docs."]}),"\n",(0,V.jsxs)(b.p,{children:["The console calls the orchestrator at ",(0,V.jsx)(b.code,{children:"ORCH_URL"}),". When ",(0,V.jsx)(b.code,{children:"ORCH_URL"})," is unset, that address is ",(0,V.jsx)(b.code,{children:"https://127.0.0.1:3443"}),". A set value must be https. The console presents its client certificate. Bull Board reads ",(0,V.jsx)(b.code,{children:"ORCH_REDIS_URL"}),". The session reads ",(0,V.jsx)(b.code,{children:"NEXT_PUBLIC_SUPABASE_URL"}),", ",(0,V.jsx)(b.code,{children:"NEXT_PUBLIC_SUPABASE_ANON_KEY"}),", and ",(0,V.jsx)(b.code,{children:"SUPABASE_SERVER_URL"}),". ",(0,V.jsx)(b.code,{children:"SUPABASE_SERVER_URL"})," is the Supabase URL on the server. When it is unset, the console uses ",(0,V.jsx)(b.code,{children:"NEXT_PUBLIC_SUPABASE_URL"}),". Without the Supabase URL and anon key, the pages still open, with no session."]}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsxs)(b.code,{children:[(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_REDIS_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"rediss://127.0.0.1:6380"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"NEXT_PUBLIC_SUPABASE_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"http://127.0.0.1:54321"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"NEXT_PUBLIC_SUPABASE_ANON_KEY"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"SUPABASE_SERVER_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"http://127.0.0.1:54321"})]})]})})}),"\n",(0,V.jsxs)(b.p,{children:["The preview server on ",(0,V.jsx)(b.a,{href:"http://127.0.0.1:3001",children:"http://127.0.0.1:3001"})," accepts ",(0,V.jsx)(b.code,{children:"Authorization: Bearer person-1"}),". The console does not call that server. It calls the https facade."]}),"\n",(0,V.jsx)(b.h2,{id:"docs",children:"Docs"}),"\n",(0,V.jsx)(b.p,{children:"Install the docs archive on its own."}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"pnpm"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" install"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -g"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" dist/packages/ascentstudio-cue-docs-"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"*"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:".tgz"})]})})})}),"\n",(0,V.jsxs)(b.p,{children:["The install also fetches Next and React. ",(0,V.jsx)(b.code,{children:"docs"})," runs ",(0,V.jsx)(b.code,{children:"next start"}),"."]}),"\n",(0,V.jsx)(b.p,{children:"Start it with:"}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"docs"})})})})}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"docs"})," listens on ",(0,V.jsx)(b.code,{children:"PORT"}),". The default is 3002. The orchestrator does not start ",(0,V.jsx)(b.code,{children:"docs"}),". A checkout starts the same app with ",(0,V.jsx)(b.code,{children:"pnpm --filter @ascentstudio/cue-docs dev"}),"."]}),"\n",(0,V.jsx)(b.h2,{id:"edge-with-caddy",children:"Edge with Caddy"}),"\n",(0,V.jsxs)(b.p,{children:["The orchestrator always prepares the certificate facade. Caddy is the only remote entry. ",(0,V.jsx)(b.code,{children:"ORCH_CADDY_PLACEMENT"})," chooses how Caddy reaches this machine. Unset, or ",(0,V.jsx)(b.code,{children:"host"}),", is the production placement: Caddy runs on the Linux host network, sees the real client address, and reaches the orchestrator on ",(0,V.jsx)(b.code,{children:"127.0.0.1"}),". ",(0,V.jsx)(b.code,{children:"desktop"})," is the development placement. It runs on Linux, Mac, and Docker Desktop. Any other value stops the orchestrator at startup."]}),"\n",(0,V.jsx)(b.h3,{id:"environment-1",children:"Environment"}),"\n",(0,V.jsx)(b.p,{children:"Add these variables to the orchestrator environment, and change the service addresses to go through Caddy:"}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsxs)(b.code,{children:[(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_CADDY_PLACEMENT"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"host"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_EDGE_NAMES"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"edge.example.com,127.0.0.1"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_CERT_DIR"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"/var/lib/ultimate-scraper/certs"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_CONSOLE_HOST"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"console.example.com"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_REGISTRY_PASSWORD"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_ACME_EMAIL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"admin@example.com"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"SUPABASE_JWT_SECRET"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_DATABASE_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"postgresql://postgres:postgres@127.0.0.1:54322/postgres"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_REDIS_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"rediss://127.0.0.1:6380"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_CLICKHOUSE_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"https://127.0.0.1:8443"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"CUE_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"https://edge.example.com:3443"})]})]})})}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ORCH_EDGE_NAMES"})," lists the names in the server certificate, separated by commas. ",(0,V.jsx)(b.code,{children:"network.ini"})," ",(0,V.jsx)(b.code,{children:"EDGE_NAME"})," supplies a name on that certificate, and ",(0,V.jsx)(b.code,{children:"127.0.0.1"})," is added with it. Keep ",(0,V.jsx)(b.code,{children:"127.0.0.1"}),": the orchestrator and the console reach Caddy and Postgres on that address and check it against the certificate."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"network.ini"})," at the repository root is the relay behind that certificate check. An installed command with no checkout reads ",(0,V.jsx)(b.code,{children:"/var/lib/ultimate-scraper/network.ini"}),". When the file is absent, Caddy keeps the Docker addresses in ",(0,V.jsx)(b.code,{children:"edgeUpstreams"}),". ",(0,V.jsx)(b.code,{children:"EDGE_NAME"})," is added to the server certificate, and ",(0,V.jsx)(b.code,{children:"127.0.0.1"})," is added with it. ",(0,V.jsx)(b.code,{children:"UPSTREAM_REDIS"}),", ",(0,V.jsx)(b.code,{children:"UPSTREAM_CLICKHOUSE"}),", ",(0,V.jsx)(b.code,{children:"UPSTREAM_MINIO"}),", ",(0,V.jsx)(b.code,{children:"UPSTREAM_ZOT"}),", and ",(0,V.jsx)(b.code,{children:"UPSTREAM_NPM"})," are the ",(0,V.jsx)(b.code,{children:"host:port"})," values Caddy dials after the client certificate is accepted. ",(0,V.jsx)(b.code,{children:"UPSTREAM_CONSOLE"})," and ",(0,V.jsx)(b.code,{children:"UPSTREAM_API"})," are optional: without them the desktop placement uses ",(0,V.jsx)(b.code,{children:"host.docker.internal"}),", and the host placement uses ",(0,V.jsx)(b.code,{children:"127.0.0.1"}),". A bad line stops the orchestrator at startup. The client URLs above stay on the facade ports. They do not move when an upstream moves."]}),"\n",(0,V.jsx)(b.p,{children:"Pointing an upstream at another machine is the choice to open that service port for Caddy. The hop after Caddy is plaintext, as it is on the Docker bridge. Publishing Redis, ClickHouse, MinIO, zot, or Verdaccio on the host, or letting another party dial those ports directly, is a separate choice in Compose or the firewall. The orchestrator does not open that path."}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ORCH_CERT_DIR"})," is the directory of the chain. In a checkout the default is ",(0,V.jsx)(b.code,{children:"dist/certs"})," at the repository root. Run Compose from that root, so the containers mount the same path. An installed command has no checkout: when ",(0,V.jsx)(b.code,{children:"ORCH_CERT_DIR"})," is unset it uses ",(0,V.jsx)(b.code,{children:"/var/lib/ultimate-scraper/certs"}),". The user that runs the orchestrator must be able to write the directory."]}),"\n",(0,V.jsxs)(b.p,{children:["Ports 7443 and 4873 are always in the Caddyfile, with the private server certificate. Those two ports do not use Let's Encrypt. The orchestrator, on this machine, calls ",(0,V.jsx)(b.code,{children:"https://127.0.0.1:7443"})," and ",(0,V.jsx)(b.code,{children:"https://127.0.0.1:4873"}),". A supervisor calls the host of ",(0,V.jsx)(b.code,{children:"CUE_URL"})," on those same ports."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ORCH_REGISTRY_PASSWORD"})," is the password of the human user ",(0,V.jsx)(b.code,{children:"orchestrator"})," for ",(0,V.jsx)(b.code,{children:"docker login"})," and ",(0,V.jsx)(b.code,{children:"npm login"}),". The orchestrator writes it, with two machine accounts, into ",(0,V.jsx)(b.code,{children:"ORCH_CERT_DIR/registry.htpasswd"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ORCH_CONSOLE_HOST"})," is the optional DNS name of the console. Set a hostname only: no scheme, no port, and no path. A bad value stops the orchestrator at startup. An omitted console host does not add a Let's Encrypt site. Ports 443, 7443, and 4873 distinguish the console, zot, and Verdaccio. The registry listeners stay on the private certificate."]}),"\n",(0,V.jsxs)(b.p,{children:["When a console name is published, port 443 has the catch-all and two named sites. ",(0,V.jsx)(b.code,{children:"https://:443"})," keeps the private server certificate, for clients that dial an address and send no name. ",(0,V.jsx)(b.code,{children:"https://<name>:443"})," uses Let's Encrypt and does not ask for a client certificate. That site forwards only ",(0,V.jsx)(b.code,{children:"/auth/v1"})," to ",(0,V.jsx)(b.code,{children:"127.0.0.1:54321"}),". The rest goes to the console. Studio stays on the gateway. ",(0,V.jsx)(b.code,{children:"https://doc.<name>:443"})," uses the same Let's Encrypt issuer and the same address list, does not ask for a client certificate, and forwards to the docs. The docs name is ",(0,V.jsx)(b.code,{children:"doc.<ORCH_CONSOLE_HOST>"}),". There is no separate variable for it. In the host placement the docs upstream is ",(0,V.jsx)(b.code,{children:"127.0.0.1:3002"}),". In the desktop placement it is ",(0,V.jsx)(b.code,{children:"host.docker.internal:3002"}),". ",(0,V.jsx)(b.code,{children:"UPSTREAM_DOCS"})," replaces that upstream. An empty list leaves the named sites open. A non-empty list restricts them."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ORCH_ACME_EMAIL"})," is optional. When it is set, it is passed to the ACME issuer. The DNS names, including the console name and ",(0,V.jsx)(b.code,{children:"doc.<console name>"}),", must point at this machine, and port 80 must be reachable from the internet. Let's Encrypt completes the HTTP-01 challenge on that port for both names. Port 80 is not a site in the Caddyfile. The certificates and the Let's Encrypt account stay in the ",(0,V.jsx)(b.code,{children:"caddy-data"})," volume, mounted on ",(0,V.jsx)(b.code,{children:"/data"}),". If a certificate fails, the listeners of the private authority stay in place."]}),"\n",(0,V.jsxs)(b.p,{children:["The orchestrator checks the Supabase token of each person with ",(0,V.jsx)(b.code,{children:"SUPABASE_JWT_SECRET"})," or ",(0,V.jsx)(b.code,{children:"SUPABASE_JWKS_URL"}),". Set one of them."]}),"\n",(0,V.jsx)(b.h3,{id:"services-1",children:"Services"}),"\n",(0,V.jsx)(b.p,{children:"Stop the plaintext services first if they run. The data volumes are kept."}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsxs)(b.code,{children:[(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"docker"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" compose"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -f"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" docker-compose.platform.yml"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" down"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"docker"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" compose"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -f"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" docker-compose.platform.yml"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -f"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" docker-compose.caddy.yml"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" up"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -d"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --build"})]})]})})}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"docker-compose.caddy.yml"})," builds Caddy from ",(0,V.jsx)(b.code,{children:"deploy/caddy/Dockerfile"}),", with the ",(0,V.jsx)(b.code,{children:"caddy-l4"})," module for Redis. It removes the host ports of Redis, ClickHouse, MinIO, zot, Verdaccio, and Supavisor. The platform file publishes Supavisor on host port 54329. The Caddy overlay still terminates Postgres TLS on the published database port, 54322. Postgres negotiates TLS in its own protocol, uses the server certificate of the chain, and asks for a client certificate. Verdaccio receives ",(0,V.jsx)(b.code,{children:"VERDACCIO_PUBLIC_URL=https://127.0.0.1:4873"}),". A non-local ",(0,V.jsx)(b.code,{children:"CUE_URL"})," host should advertise ",(0,V.jsx)(b.code,{children:"https://<that host>:4873"}),". zot and Verdaccio leave the platform network and listen on ",(0,V.jsx)(b.code,{children:"172.30.1.13"})," and ",(0,V.jsx)(b.code,{children:"172.30.1.14"}),"."]}),"\n",(0,V.jsx)(b.p,{children:"Caddy, Postgres, zot, and Verdaccio wait until the orchestrator has written their files. On the very first start, Postgres initializes after that. If the orchestrator stops because Postgres is not ready yet, start it again."}),"\n",(0,V.jsx)(b.h3,{id:"desktop",children:"Desktop"}),"\n",(0,V.jsx)(b.p,{children:"Development on Linux, Mac, or Docker Desktop uses the desktop placement instead of the overlay above. Do not combine the two files. Stop the plaintext services first if they run. Start this stack before the orchestrator."}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsxs)(b.code,{children:[(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_CADDY_PLACEMENT"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"desktop"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_EDGE_NAMES"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"127.0.0.1"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_REDIS_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"rediss://127.0.0.1:6380"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_CLICKHOUSE_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"https://127.0.0.1:8443"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"CUE_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"https://127.0.0.1:3443"})]})]})})}),"\n",(0,V.jsxs)(b.p,{children:["The certificate check is the same as on the host placement. ",(0,V.jsx)(b.code,{children:"network.ini"})," still names the relay. ",(0,V.jsx)(b.code,{children:"EDGE_NAME=127.0.0.1"})," matches this machine."]}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsxs)(b.code,{children:[(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_CADDY_PLACEMENT"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"desktop"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"docker"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" compose"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -f"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" docker-compose.platform.yml"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" down"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"docker"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" compose"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -f"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" docker-compose.platform.yml"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -f"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" docker-compose.caddy.desktop.yml"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" up"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -d"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --build"})]})]})})}),"\n",(0,V.jsxs)(b.p,{children:["Caddy joins the platform network and the registry network, and publishes ports 443, 3443, 4443, 6380, 8443, 9443, 7443, and 4873. It reaches the console and the orchestrator at ",(0,V.jsx)(b.code,{children:"host.docker.internal"}),". Redis, ClickHouse, and MinIO stay on ",(0,V.jsx)(b.code,{children:"172.30.0.10"})," through ",(0,V.jsx)(b.code,{children:"172.30.0.12"}),". zot is ",(0,V.jsx)(b.code,{children:"172.30.1.13"})," and Verdaccio is ",(0,V.jsx)(b.code,{children:"172.30.1.14"}),". Port 80 is not published, so Let's Encrypt stays on the host placement. The registry ports do not use it."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ORCH_CERT_DIR"})," must be the same path on the machine and in the containers. The checkout default, ",(0,V.jsx)(b.code,{children:"dist/certs"}),", is that path. On Mac it sits under ",(0,V.jsx)(b.code,{children:"/Users"}),", which Docker Desktop shares. The orchestrator and the console listen on ",(0,V.jsx)(b.code,{children:"0.0.0.0"}),", so ports 3000 and 3001 are reachable on the local network. Compose does not publish them."]}),"\n",(0,V.jsxs)(b.p,{children:["A connection from this machine arrives at Caddy as ",(0,V.jsx)(b.code,{children:"172.30.0.1"})," on Linux. On Docker Desktop, set ",(0,V.jsx)(b.code,{children:"ORCH_CADDY_LOCAL_CIDR"})," to the address that reaches the published ports, ",(0,V.jsx)(b.code,{children:"192.168.65.1/32"})," on Docker Desktop for Mac. The desktop Caddyfile and ",(0,V.jsx)(b.code,{children:"pg_hba.conf"})," treat that value and the gateway as the host, together with ",(0,V.jsx)(b.code,{children:"127.0.0.1"})," and ",(0,V.jsx)(b.code,{children:"::1"}),". Leave the variable unset and only the gateway is added. The host placement ignores the variable. The address list does not distinguish clients. Checking that list still requires the host placement on Linux."]}),"\n",(0,V.jsx)(b.h3,{id:"start",children:"Start"}),"\n",(0,V.jsx)(b.p,{children:"Start the orchestrator as before. On each start it:"}),"\n",(0,V.jsxs)(b.ol,{children:["\n",(0,V.jsxs)(b.li,{children:["creates or reloads the chain in ",(0,V.jsx)(b.code,{children:"ORCH_CERT_DIR"}),", and renews the service certificates that expire within 30 days;"]}),"\n",(0,V.jsxs)(b.li,{children:["writes ",(0,V.jsx)(b.code,{children:"Caddyfile"}),", ",(0,V.jsx)(b.code,{children:"pg_hba.conf"}),", ",(0,V.jsx)(b.code,{children:"pg_reload.sql"}),", and ",(0,V.jsx)(b.code,{children:"registry.htpasswd"})," into ",(0,V.jsx)(b.code,{children:"ORCH_CERT_DIR"}),", from the last applied list in ",(0,V.jsx)(b.code,{children:"edge-allow.json"}),". The ",(0,V.jsx)(b.code,{children:"Caddyfile"})," is readable by its owner only, because it contains the machine registry passwords;"]}),"\n",(0,V.jsxs)(b.li,{children:["listens on ",(0,V.jsx)(b.code,{children:"127.0.0.1:3001"})," in the host placement, and on ",(0,V.jsx)(b.code,{children:"0.0.0.0:3001"})," in the desktop placement;"]}),"\n",(0,V.jsxs)(b.li,{children:["does not start the console or the docs. An archive install starts ",(0,V.jsx)(b.code,{children:"console"})," and ",(0,V.jsx)(b.code,{children:"docs"})," as their own processes. The published image entrypoint starts them after the orchestrator has written ",(0,V.jsx)(b.code,{children:"console-client.crt"})," and the ",(0,V.jsx)(b.code,{children:"Caddyfile"}),", the console on port 3000 and the docs on port 3002. The console calls the orchestrator at ",(0,V.jsx)(b.code,{children:"ORCH_URL"}),". When ",(0,V.jsx)(b.code,{children:"ORCH_URL"})," is unset, that address is ",(0,V.jsx)(b.code,{children:"https://127.0.0.1:3443"}),". The console presents its client certificate on every call."]}),"\n"]}),"\n",(0,V.jsxs)(b.p,{children:["From a checkout, run ",(0,V.jsx)(b.code,{children:"pnpm --filter @ascentstudio/cue-console dev"})," and ",(0,V.jsx)(b.code,{children:"pnpm --filter @ascentstudio/cue-docs dev"})," in other terminals. They read the same ",(0,V.jsx)(b.code,{children:".env"}),". The console listens on port 3000 and the docs listen on port 3002. Stopping the orchestrator does not stop those processes. MinIO on port 9443 requires the client certificate and accepts the request without a signature. The root password in docker-compose is for the console on the internal network. Enrollment on port 4443 uses server TLS only, because the supervisor does not have a client certificate yet."]}),"\n",(0,V.jsxs)(b.p,{children:["Caddy runs with ",(0,V.jsx)(b.code,{children:"--watch"})," and reloads when the ",(0,V.jsx)(b.code,{children:"Caddyfile"})," changes. A renewed server certificate changes the ",(0,V.jsx)(b.code,{children:"Caddyfile"}),", so Caddy reloads it. Postgres reads a renewed server certificate on its next restart."]}),"\n",(0,V.jsx)(b.h3,{id:"ports",children:"Ports"}),"\n",(0,V.jsxs)(b.table,{children:[(0,V.jsx)(b.thead,{children:(0,V.jsxs)(b.tr,{children:[(0,V.jsx)(b.th,{children:"Port"}),(0,V.jsx)(b.th,{children:"Listener"}),(0,V.jsx)(b.th,{children:"TLS"})]})}),(0,V.jsxs)(b.tbody,{children:[(0,V.jsxs)(b.tr,{children:[(0,V.jsx)(b.td,{children:"443"}),(0,V.jsx)(b.td,{children:"Console and docs"}),(0,V.jsxs)(b.td,{children:["Private certificate on the catch-all. Let's Encrypt on the console name and on ",(0,V.jsx)(b.code,{children:"doc.<console name>"})]})]}),(0,V.jsxs)(b.tr,{children:[(0,V.jsx)(b.td,{children:"4443"}),(0,V.jsxs)(b.td,{children:["Enrollment: ",(0,V.jsx)(b.code,{children:"POST /enrollments"})," and ",(0,V.jsx)(b.code,{children:"POST /enrollments/poll"})]}),(0,V.jsx)(b.td,{children:"Server certificate"})]}),(0,V.jsxs)(b.tr,{children:[(0,V.jsx)(b.td,{children:"3443"}),(0,V.jsx)(b.td,{children:"Machine API"}),(0,V.jsx)(b.td,{children:"Client certificate"})]}),(0,V.jsxs)(b.tr,{children:[(0,V.jsx)(b.td,{children:"6380"}),(0,V.jsx)(b.td,{children:"Redis"}),(0,V.jsx)(b.td,{children:"Client certificate"})]}),(0,V.jsxs)(b.tr,{children:[(0,V.jsx)(b.td,{children:"8443"}),(0,V.jsx)(b.td,{children:"ClickHouse HTTP"}),(0,V.jsx)(b.td,{children:"Client certificate"})]}),(0,V.jsxs)(b.tr,{children:[(0,V.jsx)(b.td,{children:"9443"}),(0,V.jsx)(b.td,{children:"MinIO S3 API"}),(0,V.jsx)(b.td,{children:"Client certificate"})]}),(0,V.jsxs)(b.tr,{children:[(0,V.jsx)(b.td,{children:"7443"}),(0,V.jsx)(b.td,{children:"zot"}),(0,V.jsx)(b.td,{children:"Private certificate. A client certificate is checked when one is offered"})]}),(0,V.jsxs)(b.tr,{children:[(0,V.jsx)(b.td,{children:"4873"}),(0,V.jsx)(b.td,{children:"Verdaccio"}),(0,V.jsx)(b.td,{children:"Private certificate. A client certificate is checked when one is offered"})]}),(0,V.jsxs)(b.tr,{children:[(0,V.jsx)(b.td,{children:"80"}),(0,V.jsx)(b.td,{children:"HTTP-01 challenge"}),(0,V.jsx)(b.td,{children:"ACME response, not a Caddyfile site"})]}),(0,V.jsxs)(b.tr,{children:[(0,V.jsx)(b.td,{children:"54322"}),(0,V.jsx)(b.td,{children:"Postgres"}),(0,V.jsx)(b.td,{children:"Postgres TLS, client certificate"})]})]})]}),"\n",(0,V.jsxs)(b.p,{children:["A client certificate must be signed by the intermediate authority of the chain. On the machine API, Caddy passes the verified certificate to the orchestrator in the ",(0,V.jsx)(b.code,{children:"Client-Cert"})," header, as RFC 9440 DER in base64 between colons. Caddy removes that header on every other listener. On the ClickHouse listener, Caddy also removes ",(0,V.jsx)(b.code,{children:"X-ClickHouse-SSL-Certificate-Auth"}),". The official client sets that header when it presents a certificate, and ClickHouse would then try to authenticate a certificate that Caddy already consumed. The ClickHouse native port and the MinIO console stay on the platform network."]}),"\n",(0,V.jsxs)(b.p,{children:["zot and Verdaccio use the private server certificate. An invalid client certificate fails the handshake. No client certificate leaves the request through, and the caller sends a login. The orchestrator client certificate is the write account. Every other valid certificate is the read account. An empty address list allows only ",(0,V.jsx)(b.code,{children:"127.0.0.1"})," and ",(0,V.jsx)(b.code,{children:"::1"})," on those sites, the same filter as MinIO. The console name, when published, uses Let's Encrypt on port 443 and does not ask for a client certificate. ",(0,V.jsx)(b.code,{children:"doc.<console name>"})," is a second Let's Encrypt site on that port, with the same address list and no client certificate. The console name forwards ",(0,V.jsx)(b.code,{children:"/auth/v1"})," to ",(0,V.jsx)(b.code,{children:"127.0.0.1:54321"})," and the rest to the console. The docs site forwards to port 3002. An empty list leaves both named sites open, and a non-empty list restricts them. Port 443 still has the catch-all with the private certificate. Port 80 answers the HTTP-01 challenge for the console name and for ",(0,V.jsx)(b.code,{children:"doc.<console name>"}),". It is not a site in the Caddyfile, and the registry listeners do not depend on that challenge."]}),"\n",(0,V.jsx)(b.h3,{id:"registries",children:"Registries"}),"\n",(0,V.jsxs)(b.p,{children:["A person logs in as ",(0,V.jsx)(b.code,{children:"orchestrator"})," with ",(0,V.jsx)(b.code,{children:"ORCH_REGISTRY_PASSWORD"}),". With the names unset, the addresses are ",(0,V.jsx)(b.code,{children:"127.0.0.1:7443"})," and ",(0,V.jsx)(b.code,{children:"https://127.0.0.1:4873"}),". With the names set, use those names on the same ports. There is no Let's Encrypt certificate on either port. Trust the private authority, or dial the address from a machine that already has it."]}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"docker"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" login"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" 127.0.0.1:7443"})]})})})}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"npm"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" login"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --registry"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" https://127.0.0.1:4873"})]})})})}),"\n",(0,V.jsx)(b.p,{children:"A machine does not log in. After enrollment it presents the client certificate signed by the intermediate. Caddy accepts that certificate as the read account. The orchestrator presents its own client certificate, and Caddy accepts that one as the write account. The supervisor does not change the npm registry URL of this project."}),"\n",(0,V.jsxs)(b.p,{children:["The console does not call zot or Verdaccio. It keeps calling the orchestrator, which relays ",(0,V.jsx)(b.code,{children:"/runtimes/packages"})," and ",(0,V.jsx)(b.code,{children:"/runtimes/images"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"cue-org-*"})," is published here. Other package names, including ",(0,V.jsx)(b.code,{children:"@ascentstudio/*"}),", are fetched from npmjs through Verdaccio. An environment still resolves images as ",(0,V.jsx)(b.code,{children:"local"})," or ",(0,V.jsx)(b.code,{children:"scaleway"}),". Plaintext compose still mounts ",(0,V.jsx)(b.code,{children:"deploy/registries/htpasswd"}),", which contains only the ",(0,V.jsx)(b.code,{children:"orchestrator"})," user."]}),"\n",(0,V.jsx)(b.h3,{id:"address-list",children:"Address list"}),"\n",(0,V.jsxs)(b.p,{children:["The console page ",(0,V.jsx)(b.code,{children:"/account/edge"})," edits the ",(0,V.jsx)(b.code,{children:"edge_allow"})," table. Each change rewrites the ",(0,V.jsx)(b.code,{children:"Caddyfile"})," and ",(0,V.jsx)(b.code,{children:"pg_hba.conf"}),", then the orchestrator runs ",(0,V.jsx)(b.code,{children:"select pg_reload_conf()"}),". If that reload fails, run ",(0,V.jsx)(b.code,{children:"pg_reload.sql"})," as the database owner."]}),"\n",(0,V.jsxs)(b.ul,{children:["\n",(0,V.jsx)(b.li,{children:"With an empty list, every machine listener refuses remote addresses: enrollment, machine API, Redis, ClickHouse, MinIO, Postgres, zot, and Verdaccio. The console is open to everyone, so the first person can sign in."}),"\n",(0,V.jsx)(b.li,{children:"A change is refused if the list that results does not contain the address of the person making it. After the first address, both port 443 sites use the same list. The Let's Encrypt name still does not ask for a client certificate."}),"\n",(0,V.jsxs)(b.li,{children:["The host itself, ",(0,V.jsx)(b.code,{children:"127.0.0.1"})," and ",(0,V.jsx)(b.code,{children:"::1"}),", is always allowed. Postgres also allows the gateway of the platform network, ",(0,V.jsx)(b.code,{children:"172.30.0.1"}),", which is how a Linux host reaches its published port. In the desktop placement, Caddy and Postgres also allow ",(0,V.jsx)(b.code,{children:"ORCH_CADDY_LOCAL_CIDR"})," when it is set. The host placement never writes that address."]}),"\n",(0,V.jsxs)(b.li,{children:["Postgres allows the platform network, ",(0,V.jsx)(b.code,{children:"172.30.0.0/24"}),", with a password and without a client certificate, over TLS and without TLS. Auth, REST, and Storage connect from that network. The gateway rule is more specific, so the published port still requires a client certificate."]}),"\n"]}),"\n",(0,V.jsx)(b.p,{children:"Add the address of a supervisor before you start it. Otherwise its enrollment request does not reach the orchestrator."}),"\n",(0,V.jsx)(b.h2,{id:"images",children:"Images"}),"\n",(0,V.jsx)(b.p,{children:"From the repository root, this prints the image build and does not build:"}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"DRY_RUN"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"1"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" bash"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" scripts/build-platform-images.sh"})]})})})}),"\n",(0,V.jsxs)(b.p,{children:["The images are ",(0,V.jsx)(b.code,{children:"linux/amd64"})," and ",(0,V.jsx)(b.code,{children:"linux/arm64"}),". Each image has its own repository, tagged with the root package.json version: ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-orchestrator:<version>"}),", ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-caddy:<version>"}),", ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-zot:<version>"}),", and ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-backup:<version>"}),". There is no ",(0,V.jsx)(b.code,{children:"latest"})," tag. This script does not push. ",(0,V.jsx)(b.code,{children:"pnpm publish-packages"})," pushes those four repositories after the npm publish."]})]})}function dQ(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(dP,{...a})}):dP(a)}let dR={title:"Orchestrator"},dS=[{href:"./server"},{href:"./engine"},{href:"./fixture"},{href:"./usage/flow"},{href:"./usage/drivers"}],dT={contents:[{heading:void 0,content:"These pages are the orchestrator rules an agent applies, and the fixture that exercises them."},{heading:"server",content:"Read Server to install the published images on a Linux server."},{heading:"engine",content:"Read Engine when the work touches a flow, a run, an entity, a step, a group, a sealed report, a rule, validity duration, silence, a rate limit, a job, secrets, or what a person sees."},{heading:"engine",content:"Done when the code still matches every rule in the sections that work touches."},{heading:"fixture",content:"Read Fixture when the work touches the organization fixture, or a test that runs it."},{heading:"fixture",content:"Done when that organization still matches the fixture page."},{heading:"usage",content:"Read Usage when the work writes a flow or a step implementation."},{heading:"usage",content:"Done when that flow and its step implementations still match the usage page."},{heading:"drivers",content:"Read Drivers when the work opens a client to PostgreSQL, Elasticsearch, ClickHouse, S3, Qdrant, or another service that keeps connections."},{heading:"drivers",content:"Done when the code still matches every rule in the sections that work touches."}],headings:[{id:"server",content:"Server"},{id:"engine",content:"Engine"},{id:"fixture",content:"Fixture"},{id:"usage",content:"Usage"},{id:"drivers",content:"Drivers"}]},dU=[{depth:2,url:"#server",title:(0,V.jsx)(V.Fragment,{children:"Server"})},{depth:2,url:"#engine",title:(0,V.jsx)(V.Fragment,{children:"Engine"})},{depth:2,url:"#fixture",title:(0,V.jsx)(V.Fragment,{children:"Fixture"})},{depth:2,url:"#usage",title:(0,V.jsx)(V.Fragment,{children:"Usage"})},{depth:2,url:"#drivers",title:(0,V.jsx)(V.Fragment,{children:"Drivers"})}];function dV(a){let b={a:"a",h2:"h2",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.p,{children:"These pages are the orchestrator rules an agent applies, and the fixture that exercises them."}),"\n",(0,V.jsx)(b.h2,{id:"server",children:"Server"}),"\n",(0,V.jsxs)(b.p,{children:["Read ",(0,V.jsx)(b.a,{href:"./server",children:"Server"})," to install the published images on a Linux server."]}),"\n",(0,V.jsx)(b.h2,{id:"engine",children:"Engine"}),"\n",(0,V.jsxs)(b.p,{children:["Read ",(0,V.jsx)(b.a,{href:"./engine",children:"Engine"})," when the work touches a flow, a run, an entity, a step, a group, a sealed report, a rule, validity duration, silence, a rate limit, a job, secrets, or what a person sees."]}),"\n",(0,V.jsx)(b.p,{children:"Done when the code still matches every rule in the sections that work touches."}),"\n",(0,V.jsx)(b.h2,{id:"fixture",children:"Fixture"}),"\n",(0,V.jsxs)(b.p,{children:["Read ",(0,V.jsx)(b.a,{href:"./fixture",children:"Fixture"})," when the work touches the organization fixture, or a test that runs it."]}),"\n",(0,V.jsx)(b.p,{children:"Done when that organization still matches the fixture page."}),"\n",(0,V.jsx)(b.h2,{id:"usage",children:"Usage"}),"\n",(0,V.jsxs)(b.p,{children:["Read ",(0,V.jsx)(b.a,{href:"./usage/flow",children:"Usage"})," when the work writes a flow or a step implementation."]}),"\n",(0,V.jsx)(b.p,{children:"Done when that flow and its step implementations still match the usage page."}),"\n",(0,V.jsx)(b.h2,{id:"drivers",children:"Drivers"}),"\n",(0,V.jsxs)(b.p,{children:["Read ",(0,V.jsx)(b.a,{href:"./usage/drivers",children:"Drivers"})," when the work opens a client to PostgreSQL, Elasticsearch, ClickHouse, S3, Qdrant, or another service that keeps connections."]}),"\n",(0,V.jsx)(b.p,{children:"Done when the code still matches every rule in the sections that work touches."})]})}function dW(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(dV,{...a})}):dV(a)}let dX={title:"Fixture"},dY=[],dZ={contents:[{heading:void 0,content:"Keep this organization on the sequence below when you change it. Done when the performance flows, their step implementations, and the launch commands still match this page."},{heading:void 0,content:"The organization fixture is a fixture for tests. It is not a business flow. The source is organizations/fixture. organizations/fixture/src/index.ts exports flows, and fixtureFlows is that same list."},{heading:void 0,content:"The flows are pace, load, stall, fault, soften, aside, nest, nest-mid, nest-leaf, brood, and brood-child. Each one sets validityDurationMs to null and entityType to its name. Silence is a whole number of minutes (silenceDurationMin). Configured work is milliseconds. No step sets rateLimit."},{heading:"steps",content:"organizations/fixture/src/steps.ts binds the step implementations with bindOrganization. fixtureSteps stores each bound step under flow/step. The kind is fixture- plus the step name."},{heading:"steps",content:"dwell has aliases mark and pass-1 through pass-10. Its kind is fixture-dwell, concurrency 4, silence 30 minutes, and maxResends 1. It waits the configured work, then returns done. pace reads dwellMs on dwell and markMs on mark. load, soften, aside, nest, nest-leaf, and brood-child read workMs on dwell. A pass-* step reads dwellMs when that field is present, and workMs otherwise. That count is an integer of milliseconds, zero or greater. A missing or invalid count waits 0 milliseconds. A brood payload has no duration field, so pass-1 through pass-10 wait 0 milliseconds."},{heading:"steps",content:"stall has kind fixture-stall, concurrency 1, silence 1 minute, and maxResends 0. It throws StepHeld and publishes no result. One minute later the first silence records not_finished."},{heading:"steps",content:"miss has kind fixture-miss, concurrency 4, silence 30 minutes, and maxResends 0. It returns failed at once and does not throw."},{heading:"steps",content:"sprout has kind fixture-sprout, concurrency 4, silence 30 minutes, and maxResends 1. It returns done with one child. On nest the identifier is mid- plus the parent identifier. On nest-mid the identifier is leaf- plus the parent identifier. The child payload is { workMs: 0 }."},{heading:"steps",content:"brood has kind fixture-brood, concurrency 4, silence 30 minutes, and maxResends 1. It returns done with one child per childCount, at most 100. The identifier is c plus the index, a hyphen, and the parent identifier. The child payload is { workMs: 0 }."},{heading:"flows",content:"pace opens dwell, then mark, then finishes. The payload carries dwellMs and markMs. The flow finishes success."},{heading:"flows",content:"load opens one dwell and finishes success. The payload carries workMs. It stays on kind fixture-dwell."},{heading:"flows",content:"stall opens one required stall and finishes not_finished."},{heading:"flows",content:"fault opens one required miss and finishes failure."},{heading:"flows",content:"soften opens optional miss, then dwell, then finishes. The flow finishes success and miss stays failed. The payload carries workMs."},{heading:"flows",content:"aside opens detached stall, then a required dwell, then finishes. The flow finishes success well before the minute of silence. The detached step later records not_finished and the issue stays success. The payload carries workMs."},{heading:"flows",content:"nest opens sprout, then opens child flow nest-mid from that body. It then opens dwell with step payload { attachments: [{ attachmentId, rank: 0 }] }. attachmentId is 00000000-0000-4000-8000-000000000000. The wait on that dwell is still workMs from the flow payload. The flow finishes success."},{heading:"flows",content:"nest-mid opens sprout, opens child flow nest-leaf from that body, then finishes success."},{heading:"flows",content:"nest-leaf opens dwell and finishes success. The child payload is { workMs: 0 }."},{heading:"flows",content:"brood opens pass-1 through pass-10, opens step brood, opens child flow brood-child from that body, then finishes success. The payload carries childCount, an integer from 1 to 100."},{heading:"flows",content:"brood-child opens dwell and finishes success. The child payload is { workMs: 0 }."},{heading:"runs",content:"The fixture does not export catalogSeed and does not open a client database. pnpm --dir organizations/fixture seed opens nothing and prints seeded fixture 0 runs."},{heading:"runs",content:"pnpm --dir organizations/fixture reset deletes the fixture rows in entities and entity_links, then deletes that organization's metrics and the jobs those runs left in Redis. It leaves organizations, memberships, secrets, and the signed-in person in place. The log line is reset fixture."},{heading:"performance",content:"pnpm --dir organizations/fixture seed does not start these flows."},{heading:"performance",content:"Relaunch a run with pnpm --dir organizations/fixture perf. The script is organizations/fixture/scripts/perf-fixture.mjs. It starts the workers these flows need, kinds fixture-dwell, fixture-stall, fixture-miss, and fixture-sprout, and stops them when the run ends. It opens pace, load, stall, fault, soften, aside, and nest."},{heading:"load-test",content:"Relaunch with pnpm --dir organizations/fixture perf:load. The script is organizations/fixture/scripts/perf-load.mjs. It starts one worker, kind fixture-dwell, WORKER_CONCURRENCY 32, and stops that worker when the run ends. Levels 200, 400, and 800 of load with workMs 0. After 200, a pace wave of 200 with dwellMs 0 and markMs 0. Send is ranAt minus openedAt. Apply is endedAt minus ranAt minus computeMs."},{heading:"brood",content:"Relaunch with pnpm --dir organizations/fixture perf:brood. The script is organizations/fixture/scripts/perf-brood.mjs. It starts workers for fixture-brood and fixture-dwell, concurrency 4 on each, and stops them when the run ends. It opens brood families. BROOD_FAMILIES defaults to 2000. Each family carries childCount 10."},{heading:"brood",content:"pnpm --dir organizations/fixture perf:brood:producer runs organizations/fixture/scripts/perf-brood-producer.mjs. It uses the same two kinds. It opens a wave of 100 families every second for 3 minutes, each with childCount 10, then waits until those runs settle."}],headings:[{id:"steps",content:"Steps"},{id:"flows",content:"Flows"},{id:"runs",content:"Runs"},{id:"performance",content:"Performance"},{id:"load-test",content:"Load test"},{id:"brood",content:"Brood"}]},d$=[{depth:2,url:"#steps",title:(0,V.jsx)(V.Fragment,{children:"Steps"})},{depth:2,url:"#flows",title:(0,V.jsx)(V.Fragment,{children:"Flows"})},{depth:2,url:"#runs",title:(0,V.jsx)(V.Fragment,{children:"Runs"})},{depth:2,url:"#performance",title:(0,V.jsx)(V.Fragment,{children:"Performance"})},{depth:3,url:"#load-test",title:(0,V.jsx)(V.Fragment,{children:"Load test"})},{depth:3,url:"#brood",title:(0,V.jsx)(V.Fragment,{children:"Brood"})}];function d_(a){let b={code:"code",h2:"h2",h3:"h3",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.p,{children:"Keep this organization on the sequence below when you change it. Done when the performance flows, their step implementations, and the launch commands still match this page."}),"\n",(0,V.jsxs)(b.p,{children:["The organization ",(0,V.jsx)(b.code,{children:"fixture"})," is a fixture for tests. It is not a business flow. The source is ",(0,V.jsx)(b.code,{children:"organizations/fixture"}),". ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/index.ts"})," exports ",(0,V.jsx)(b.code,{children:"flows"}),", and ",(0,V.jsx)(b.code,{children:"fixtureFlows"})," is that same list."]}),"\n",(0,V.jsxs)(b.p,{children:["The flows are ",(0,V.jsx)(b.code,{children:"pace"}),", ",(0,V.jsx)(b.code,{children:"load"}),", ",(0,V.jsx)(b.code,{children:"stall"}),", ",(0,V.jsx)(b.code,{children:"fault"}),", ",(0,V.jsx)(b.code,{children:"soften"}),", ",(0,V.jsx)(b.code,{children:"aside"}),", ",(0,V.jsx)(b.code,{children:"nest"}),", ",(0,V.jsx)(b.code,{children:"nest-mid"}),", ",(0,V.jsx)(b.code,{children:"nest-leaf"}),", ",(0,V.jsx)(b.code,{children:"brood"}),", and ",(0,V.jsx)(b.code,{children:"brood-child"}),". Each one sets ",(0,V.jsx)(b.code,{children:"validityDurationMs"})," to null and ",(0,V.jsx)(b.code,{children:"entityType"})," to its name. Silence is a whole number of minutes (",(0,V.jsx)(b.code,{children:"silenceDurationMin"}),"). Configured work is milliseconds. No step sets ",(0,V.jsx)(b.code,{children:"rateLimit"}),"."]}),"\n",(0,V.jsx)(b.h2,{id:"steps",children:"Steps"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"organizations/fixture/src/steps.ts"})," binds the step implementations with ",(0,V.jsx)(b.code,{children:"bindOrganization"}),". ",(0,V.jsx)(b.code,{children:"fixtureSteps"})," stores each bound step under ",(0,V.jsx)(b.code,{children:"flow/step"}),". The kind is ",(0,V.jsx)(b.code,{children:"fixture-"})," plus the step name."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"dwell"})," has aliases ",(0,V.jsx)(b.code,{children:"mark"})," and ",(0,V.jsx)(b.code,{children:"pass-1"})," through ",(0,V.jsx)(b.code,{children:"pass-10"}),". Its kind is ",(0,V.jsx)(b.code,{children:"fixture-dwell"}),", concurrency 4, silence 30 minutes, and ",(0,V.jsx)(b.code,{children:"maxResends"})," 1. It waits the configured work, then returns done. ",(0,V.jsx)(b.code,{children:"pace"})," reads ",(0,V.jsx)(b.code,{children:"dwellMs"})," on ",(0,V.jsx)(b.code,{children:"dwell"})," and ",(0,V.jsx)(b.code,{children:"markMs"})," on ",(0,V.jsx)(b.code,{children:"mark"}),". ",(0,V.jsx)(b.code,{children:"load"}),", ",(0,V.jsx)(b.code,{children:"soften"}),", ",(0,V.jsx)(b.code,{children:"aside"}),", ",(0,V.jsx)(b.code,{children:"nest"}),", ",(0,V.jsx)(b.code,{children:"nest-leaf"}),", and ",(0,V.jsx)(b.code,{children:"brood-child"})," read ",(0,V.jsx)(b.code,{children:"workMs"})," on ",(0,V.jsx)(b.code,{children:"dwell"}),". A ",(0,V.jsx)(b.code,{children:"pass-*"})," step reads ",(0,V.jsx)(b.code,{children:"dwellMs"})," when that field is present, and ",(0,V.jsx)(b.code,{children:"workMs"})," otherwise. That count is an integer of milliseconds, zero or greater. A missing or invalid count waits 0 milliseconds. A brood payload has no duration field, so ",(0,V.jsx)(b.code,{children:"pass-1"})," through ",(0,V.jsx)(b.code,{children:"pass-10"})," wait 0 milliseconds."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"stall"})," has kind ",(0,V.jsx)(b.code,{children:"fixture-stall"}),", concurrency 1, silence 1 minute, and ",(0,V.jsx)(b.code,{children:"maxResends"})," 0. It throws ",(0,V.jsx)(b.code,{children:"StepHeld"})," and publishes no result. One minute later the first silence records ",(0,V.jsx)(b.code,{children:"not_finished"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"miss"})," has kind ",(0,V.jsx)(b.code,{children:"fixture-miss"}),", concurrency 4, silence 30 minutes, and ",(0,V.jsx)(b.code,{children:"maxResends"})," 0. It returns failed at once and does not throw."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"sprout"})," has kind ",(0,V.jsx)(b.code,{children:"fixture-sprout"}),", concurrency 4, silence 30 minutes, and ",(0,V.jsx)(b.code,{children:"maxResends"})," 1. It returns done with one child. On ",(0,V.jsx)(b.code,{children:"nest"})," the identifier is ",(0,V.jsx)(b.code,{children:"mid-"})," plus the parent identifier. On ",(0,V.jsx)(b.code,{children:"nest-mid"})," the identifier is ",(0,V.jsx)(b.code,{children:"leaf-"})," plus the parent identifier. The child payload is ",(0,V.jsx)(b.code,{children:"{ workMs: 0 }"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"brood"})," has kind ",(0,V.jsx)(b.code,{children:"fixture-brood"}),", concurrency 4, silence 30 minutes, and ",(0,V.jsx)(b.code,{children:"maxResends"})," 1. It returns done with one child per ",(0,V.jsx)(b.code,{children:"childCount"}),", at most 100. The identifier is ",(0,V.jsx)(b.code,{children:"c"})," plus the index, a hyphen, and the parent identifier. The child payload is ",(0,V.jsx)(b.code,{children:"{ workMs: 0 }"}),"."]}),"\n",(0,V.jsx)(b.h2,{id:"flows",children:"Flows"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"pace"})," opens ",(0,V.jsx)(b.code,{children:"dwell"}),", then ",(0,V.jsx)(b.code,{children:"mark"}),", then finishes. The payload carries ",(0,V.jsx)(b.code,{children:"dwellMs"})," and ",(0,V.jsx)(b.code,{children:"markMs"}),". The flow finishes success."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"load"})," opens one ",(0,V.jsx)(b.code,{children:"dwell"})," and finishes success. The payload carries ",(0,V.jsx)(b.code,{children:"workMs"}),". It stays on kind ",(0,V.jsx)(b.code,{children:"fixture-dwell"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"stall"})," opens one required ",(0,V.jsx)(b.code,{children:"stall"})," and finishes ",(0,V.jsx)(b.code,{children:"not_finished"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"fault"})," opens one required ",(0,V.jsx)(b.code,{children:"miss"})," and finishes ",(0,V.jsx)(b.code,{children:"failure"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"soften"})," opens optional ",(0,V.jsx)(b.code,{children:"miss"}),", then ",(0,V.jsx)(b.code,{children:"dwell"}),", then finishes. The flow finishes success and ",(0,V.jsx)(b.code,{children:"miss"})," stays ",(0,V.jsx)(b.code,{children:"failed"}),". The payload carries ",(0,V.jsx)(b.code,{children:"workMs"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"aside"})," opens detached ",(0,V.jsx)(b.code,{children:"stall"}),", then a required ",(0,V.jsx)(b.code,{children:"dwell"}),", then finishes. The flow finishes success well before the minute of silence. The detached step later records ",(0,V.jsx)(b.code,{children:"not_finished"})," and the issue stays success. The payload carries ",(0,V.jsx)(b.code,{children:"workMs"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"nest"})," opens ",(0,V.jsx)(b.code,{children:"sprout"}),", then opens child flow ",(0,V.jsx)(b.code,{children:"nest-mid"})," from that body. It then opens ",(0,V.jsx)(b.code,{children:"dwell"})," with step payload ",(0,V.jsx)(b.code,{children:"{ attachments: [{ attachmentId, rank: 0 }] }"}),". ",(0,V.jsx)(b.code,{children:"attachmentId"})," is ",(0,V.jsx)(b.code,{children:"00000000-0000-4000-8000-000000000000"}),". The wait on that ",(0,V.jsx)(b.code,{children:"dwell"})," is still ",(0,V.jsx)(b.code,{children:"workMs"})," from the flow payload. The flow finishes success."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"nest-mid"})," opens ",(0,V.jsx)(b.code,{children:"sprout"}),", opens child flow ",(0,V.jsx)(b.code,{children:"nest-leaf"})," from that body, then finishes success."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"nest-leaf"})," opens ",(0,V.jsx)(b.code,{children:"dwell"})," and finishes success. The child payload is ",(0,V.jsx)(b.code,{children:"{ workMs: 0 }"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"brood"})," opens ",(0,V.jsx)(b.code,{children:"pass-1"})," through ",(0,V.jsx)(b.code,{children:"pass-10"}),", opens step ",(0,V.jsx)(b.code,{children:"brood"}),", opens child flow ",(0,V.jsx)(b.code,{children:"brood-child"})," from that body, then finishes success. The payload carries ",(0,V.jsx)(b.code,{children:"childCount"}),", an integer from 1 to 100."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"brood-child"})," opens ",(0,V.jsx)(b.code,{children:"dwell"})," and finishes success. The child payload is ",(0,V.jsx)(b.code,{children:"{ workMs: 0 }"}),"."]}),"\n",(0,V.jsx)(b.h2,{id:"runs",children:"Runs"}),"\n",(0,V.jsxs)(b.p,{children:["The fixture does not export ",(0,V.jsx)(b.code,{children:"catalogSeed"})," and does not open a client database. ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture seed"})," opens nothing and prints ",(0,V.jsx)(b.code,{children:"seeded fixture 0 runs"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture reset"})," deletes the fixture rows in ",(0,V.jsx)(b.code,{children:"entities"})," and ",(0,V.jsx)(b.code,{children:"entity_links"}),", then deletes that organization's metrics and the jobs those runs left in Redis. It leaves ",(0,V.jsx)(b.code,{children:"organizations"}),", ",(0,V.jsx)(b.code,{children:"memberships"}),", ",(0,V.jsx)(b.code,{children:"secrets"}),", and the signed-in person in place. The log line is ",(0,V.jsx)(b.code,{children:"reset fixture"}),"."]}),"\n",(0,V.jsx)(b.h2,{id:"performance",children:"Performance"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture seed"})," does not start these flows."]}),"\n",(0,V.jsxs)(b.p,{children:["Relaunch a run with ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf"}),". The script is ",(0,V.jsx)(b.code,{children:"organizations/fixture/scripts/perf-fixture.mjs"}),". It starts the workers these flows need, kinds ",(0,V.jsx)(b.code,{children:"fixture-dwell"}),", ",(0,V.jsx)(b.code,{children:"fixture-stall"}),", ",(0,V.jsx)(b.code,{children:"fixture-miss"}),", and ",(0,V.jsx)(b.code,{children:"fixture-sprout"}),", and stops them when the run ends. It opens ",(0,V.jsx)(b.code,{children:"pace"}),", ",(0,V.jsx)(b.code,{children:"load"}),", ",(0,V.jsx)(b.code,{children:"stall"}),", ",(0,V.jsx)(b.code,{children:"fault"}),", ",(0,V.jsx)(b.code,{children:"soften"}),", ",(0,V.jsx)(b.code,{children:"aside"}),", and ",(0,V.jsx)(b.code,{children:"nest"}),"."]}),"\n",(0,V.jsx)(b.h3,{id:"load-test",children:"Load test"}),"\n",(0,V.jsxs)(b.p,{children:["Relaunch with ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf:load"}),". The script is ",(0,V.jsx)(b.code,{children:"organizations/fixture/scripts/perf-load.mjs"}),". It starts one worker, kind ",(0,V.jsx)(b.code,{children:"fixture-dwell"}),", ",(0,V.jsx)(b.code,{children:"WORKER_CONCURRENCY"})," 32, and stops that worker when the run ends. Levels 200, 400, and 800 of ",(0,V.jsx)(b.code,{children:"load"})," with ",(0,V.jsx)(b.code,{children:"workMs"})," 0. After 200, a ",(0,V.jsx)(b.code,{children:"pace"})," wave of 200 with ",(0,V.jsx)(b.code,{children:"dwellMs"})," 0 and ",(0,V.jsx)(b.code,{children:"markMs"})," 0. Send is ",(0,V.jsx)(b.code,{children:"ranAt"})," minus ",(0,V.jsx)(b.code,{children:"openedAt"}),". Apply is ",(0,V.jsx)(b.code,{children:"endedAt"})," minus ",(0,V.jsx)(b.code,{children:"ranAt"})," minus ",(0,V.jsx)(b.code,{children:"computeMs"}),"."]}),"\n",(0,V.jsx)(b.h3,{id:"brood",children:"Brood"}),"\n",(0,V.jsxs)(b.p,{children:["Relaunch with ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf:brood"}),". The script is ",(0,V.jsx)(b.code,{children:"organizations/fixture/scripts/perf-brood.mjs"}),". It starts workers for ",(0,V.jsx)(b.code,{children:"fixture-brood"})," and ",(0,V.jsx)(b.code,{children:"fixture-dwell"}),", concurrency 4 on each, and stops them when the run ends. It opens ",(0,V.jsx)(b.code,{children:"brood"})," families. ",(0,V.jsx)(b.code,{children:"BROOD_FAMILIES"})," defaults to 2000. Each family carries ",(0,V.jsx)(b.code,{children:"childCount"})," 10."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf:brood:producer"})," runs ",(0,V.jsx)(b.code,{children:"organizations/fixture/scripts/perf-brood-producer.mjs"}),". It uses the same two kinds. It opens a wave of 100 families every second for 3 minutes, each with ",(0,V.jsx)(b.code,{children:"childCount"})," 10, then waits until those runs settle."]})]})}function d0(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(d_,{...a})}):d_(a)}let d1={title:"Engine"},d2=[],d3={contents:[{heading:void 0,content:"Apply the section your change touches. Done when the code and that section describe the same behavior."},{heading:"flow",content:"The engine rereads a restricted TypeScript flow from the start. The function may open a step, open an optional step, open a detached step, open child entities from the typed body, wait for a group, choose one named arm, finish, or declare failure. It reads sealed reports. The client database, secrets, and the clock stay outside the function."},{heading:"flow",content:"The same sealed reports open the same steps. An opening already made stays in place. A choice records its arms in the order they are written. One name takes one arm. The other arms name their steps as discarded. A discarded step is not opened: it sends no job, and silence does not send it again."},{heading:"step-and-group",content:"One step resumes when its result is there. openStep does this. A failed required step ends the run in failure and does not open the continuation. A not finished required step ends the run not finished."},{heading:"step-and-group",content:"openOptionalStep waits the same way. A failed result and a not finished result are returned and do not stop the run. openDetachedStep enqueues the job and does not wait. Its result does not stop the run. A result that arrives after the run has ended is recorded on that step and does not reread the function."},{heading:"step-and-group",content:"Several openings form a group. The group waits until every required member is done. A required member is an openStep or a child opening. An optional step is waited on and does not count. Success is a result whose status is done, a single child run whose status is success, or an array of children whose report is sealed. The first required failure ends the run in failure. The first required not finished, when nothing has failed, ends the run not finished. Inside the group, openStep and openOptionalStep open steps, and openChildren and openOptionalChildren open child entities. A group does not open a detached step."},{heading:"step-and-group",content:"When the group is satisfied the report is sealed: end reason, counts, and the discriminant of each member already returned. A child member contributes one element per child, with that child's flow. A late result is recorded on its step. The sealed report stays as sealed. When the run stops because a required member failed or is not finished, still-open required and optional steps close as not finished with discriminant ended. Detached steps stay open."},{heading:"step-and-group",content:"A step declares the shape of its body and of the payload that opens it. A body outside that shape ends the step as failed. A payload outside its shape does not open the step. A later reread compares the same payload. The worker receives it with the step. finish keeps its discriminant and stores a body checked by the flow's return schema."},{heading:"step-and-group",content:"One child opened on the flow resumes when that child's result is there. A failed required child ends the parent in failure. A not finished required child ends the parent not finished. An optional child returns that result and does not stop the parent. Several child entities opened together carry one rule, the same on openChildren and openOptionalChildren. The omitted rule is that every child run succeeds. The call may pass a quota: a count, capped at the number of children, or a proportion, whose target is that proportion of the children rounded up. Either form may name withinMin, whole minutes from the moment the children open. Only a successful child run counts toward the target. A required opening seals when the target is met. It stops the parent when the target can no longer be met, or when withinMin is reached with the target unmet. Before that time, a failure stops a required all as failure, and a not finished child stops it as not finished. An optional opening seals and the parent continues: quota when the target is met or can no longer be met, deadline when withinMin is reached first, and all when every child of an all opening has ended. A failure does not seal an optional all early. Children still open stay out of the sealed report. A result that arrives later does not change it. A child takes the identity and starting data of its element. The parent reads the child's typed body."},{heading:"run",content:"Success: the function runs to the end, by returning or by finish(). finish may name the flow's return and store a body. A parent of one child reads that name as the discriminant and reads the body. Without a name, the discriminant stays success."},{heading:"run",content:"Failure: a required step or a single required child failed, a required array of children missed its rule, or the function declares failure."},{heading:"run",content:"Not finished: a required step or a single required child is not finished, before the children's duration. An optional step does not do that. A detached step does not do that. An optional child does not do that. A quota does not treat not finished as success."},{heading:"entity",content:"The entity key is organization, flow, and identity. One run at a time. Other requests wait. The run keeps the first request's starting data."},{heading:"entity",content:"Two identical lines of one list join that one execution and receive the same result."},{heading:"validity-duration",content:"Validity duration is on the flow."},{heading:"validity-duration",content:"On success, the duration runs from the end. A request inside the duration receives the recorded result, starts no run, and leaves the client database unread."},{heading:"validity-duration",content:"The next request starts a run with its own starting data when the run is a failure, not finished, the duration has passed, or the flow has no duration. Passing the duration leaves the displayed run in place until that request."},{heading:"validity-duration",content:"A parent whose run has ended stays ended when another requester starts a new run of a child."},{heading:"validity-duration",content:"The entity shows the current run and the validity end. Until a new run starts, an expired run stays displayed with its end in the past."},{heading:"silence",content:"Silence is per opened step. The silence duration and the resend maximum come from the entity's starting data."},{heading:"silence",content:"Without a result at that time, the orchestrator sends the same job again. At the resend maximum the step result is not finished."},{heading:"silence",content:"An array of children whose rule names withinMin is judged when that duration is reached. A required opening fails when the target is still unmet. An optional opening seals with end reason deadline."},{heading:"rate-limit",content:"A rate limit is on the step definition: max jobs and a duration durationMs. bindOrganization copies it onto every bound step of that definition. Aliases share the definition and the kind, so they share the limit. The kind is one queue for that organization and that step definition, so every flow that opens the step shares the limit. A step definition with no rate limit has no limit."},{heading:"rate-limit",content:"The orchestrator sends the job when the step opens. The limit gates when a worker starts it. createStepWorker passes BullMQ limiter with that max and with duration set to durationMs. BullMQ keeps one counter in Redis for that queue. Every worker of the kind increments the same counter when it moves a job to active. The first start in a window sets the counter to expire after durationMs. At max, further jobs stay waiting until the key expires and the next window starts."},{heading:"rate-limit",content:"Concurrency is how many jobs one worker runs at once. The rate limit is how many jobs the kind starts during one window, across every worker of that kind. Ten workers, each with concurrency 1, and a rate limit of 8 jobs per 1000 ms, start at most 8 jobs of that kind in the window. A concurrency override on a worker changes only that worker's concurrency. The limit stays the one on the step definition. The shared count holds when every worker of the kind is started with that same limit."},{heading:"rate-limit",content:"Starts at the end of one window and the start of the next can land close together. A job that keeps running past the window still counts as one start. Jobs already active run to the end."},{heading:"rate-limit",content:"Each environment has its own queue, and that queue has its own counter."},{heading:"rate-limit",content:"Silence runs from the opening. A job that stays waiting until the silence duration elapses is sent again. At the resend maximum the step result is not finished."},{heading:"job-and-storage",content:"BullMQ only transports the job. The job is organization, entity, and step. Secrets stay off the job. The worker loads that organization's secrets once when it starts and writes them into the environment. The dispatch value carries the starting data and the time, and it carries no secret. A step implementation reads one name with environment in packages/contract/src/environment.ts. A log replaces the value with ••••. A secret added or deleted is visible at the next start of the worker. Each bound step names a kind. The orchestrator sends that job to the Redis queue for that kind. A worker pulls. It does not push when a worker appears, and the HTTP server does not start a worker. Connected workers are presence, not a condition for opening a step. Silence, a resend, and not finished stay on the opened step: a resend is a new job, and the queue does not retry. Postgres keeps the current flow run, one row per entity, plus parent and child links, memberships, and secrets. Each row is carried by its organization. The application stores each secret as given. A transition loads that entity, the children named in its tree, and its running parents. The HTTP server reads that entity row on each read. Entity counts and running counts are cached for a few seconds. After the commit, each new flow metric and step metric is appended to Redis and inserted into ClickHouse in batches. The engine rereads the result on the entity row. It does not reread the metric."},{heading:"job-and-storage",content:"A step may write a transient file for a later step of the same run. The names it writes travel with the result and stay on the step. A replay from a step copies those kept names into the new generation before that generation's jobs are sent. A full replay starts empty and does not copy. It receives the time the orchestrator runs the job. A second run of that step keeps a single effect. The orchestrator records the step when it accepts the result. When a step throws, that result is failed and its discriminant is the error message. A held step stays open."},{heading:"person",content:"Tests start the first run through the internal function startRun. A run starts from that function."},{heading:"person",content:"A person sees entities, the operation tree, steps and their progress, the current wait, children, the validity end, the flow source, and the transient files of a stored flow run. The Secrets page lists that organization's secrets. A person can add one and delete one. Entity, source, and flow reads do not include a secret. A discarded step stays in that tree and is marked discarded. The Flows page shows flow runs and step runs for a period: counts, failure rate, p50, and the trend come from ClickHouse, and the entity count and running come from Postgres. A person can open the first entity of a flow, replay a flow, replay from a step, resend a job, run a step without applying its result, cancel a run or an open step, and end a validity. The first opening is that request: an open run waits, and inside the validity duration the recorded result is returned."}],headings:[{id:"flow",content:"Flow"},{id:"step-and-group",content:"Step and group"},{id:"run",content:"Run"},{id:"entity",content:"Entity"},{id:"validity-duration",content:"Validity duration"},{id:"silence",content:"Silence"},{id:"rate-limit",content:"Rate limit"},{id:"job-and-storage",content:"Job and storage"},{id:"person",content:"Person"}]},d4=[{depth:2,url:"#flow",title:(0,V.jsx)(V.Fragment,{children:"Flow"})},{depth:2,url:"#step-and-group",title:(0,V.jsx)(V.Fragment,{children:"Step and group"})},{depth:2,url:"#run",title:(0,V.jsx)(V.Fragment,{children:"Run"})},{depth:2,url:"#entity",title:(0,V.jsx)(V.Fragment,{children:"Entity"})},{depth:2,url:"#validity-duration",title:(0,V.jsx)(V.Fragment,{children:"Validity duration"})},{depth:2,url:"#silence",title:(0,V.jsx)(V.Fragment,{children:"Silence"})},{depth:2,url:"#rate-limit",title:(0,V.jsx)(V.Fragment,{children:"Rate limit"})},{depth:2,url:"#job-and-storage",title:(0,V.jsx)(V.Fragment,{children:"Job and storage"})},{depth:2,url:"#person",title:(0,V.jsx)(V.Fragment,{children:"Person"})}];function d5(a){let b={code:"code",h2:"h2",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.p,{children:"Apply the section your change touches. Done when the code and that section describe the same behavior."}),"\n",(0,V.jsx)(b.h2,{id:"flow",children:"Flow"}),"\n",(0,V.jsx)(b.p,{children:"The engine rereads a restricted TypeScript flow from the start. The function may open a step, open an optional step, open a detached step, open child entities from the typed body, wait for a group, choose one named arm, finish, or declare failure. It reads sealed reports. The client database, secrets, and the clock stay outside the function."}),"\n",(0,V.jsx)(b.p,{children:"The same sealed reports open the same steps. An opening already made stays in place. A choice records its arms in the order they are written. One name takes one arm. The other arms name their steps as discarded. A discarded step is not opened: it sends no job, and silence does not send it again."}),"\n",(0,V.jsx)(b.h2,{id:"step-and-group",children:"Step and group"}),"\n",(0,V.jsxs)(b.p,{children:["One step resumes when its result is there. ",(0,V.jsx)(b.code,{children:"openStep"})," does this. A failed required step ends the run in failure and does not open the continuation. A not finished required step ends the run not finished."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"openOptionalStep"})," waits the same way. A failed result and a not finished result are returned and do not stop the run. ",(0,V.jsx)(b.code,{children:"openDetachedStep"})," enqueues the job and does not wait. Its result does not stop the run. A result that arrives after the run has ended is recorded on that step and does not reread the function."]}),"\n",(0,V.jsxs)(b.p,{children:["Several openings form a group. The group waits until every required member is done. A required member is an ",(0,V.jsx)(b.code,{children:"openStep"})," or a child opening. An optional step is waited on and does not count. Success is a result whose status is done, a single child run whose status is success, or an array of children whose report is sealed. The first required failure ends the run in failure. The first required not finished, when nothing has failed, ends the run not finished. Inside the group, ",(0,V.jsx)(b.code,{children:"openStep"})," and ",(0,V.jsx)(b.code,{children:"openOptionalStep"})," open steps, and ",(0,V.jsx)(b.code,{children:"openChildren"})," and ",(0,V.jsx)(b.code,{children:"openOptionalChildren"})," open child entities. A group does not open a detached step."]}),"\n",(0,V.jsxs)(b.p,{children:["When the group is satisfied the report is sealed: end reason, counts, and the discriminant of each member already returned. A child member contributes one element per child, with that child's flow. A late result is recorded on its step. The sealed report stays as sealed. When the run stops because a required member failed or is not finished, still-open required and optional steps close as not finished with discriminant ",(0,V.jsx)(b.code,{children:"ended"}),". Detached steps stay open."]}),"\n",(0,V.jsxs)(b.p,{children:["A step declares the shape of its body and of the payload that opens it. A body outside that shape ends the step as failed. A payload outside its shape does not open the step. A later reread compares the same payload. The worker receives it with the step. ",(0,V.jsx)(b.code,{children:"finish"})," keeps its discriminant and stores a body checked by the flow's return schema."]}),"\n",(0,V.jsxs)(b.p,{children:["One child opened on the flow resumes when that child's result is there. A failed required child ends the parent in failure. A not finished required child ends the parent not finished. An optional child returns that result and does not stop the parent. Several child entities opened together carry one rule, the same on ",(0,V.jsx)(b.code,{children:"openChildren"})," and ",(0,V.jsx)(b.code,{children:"openOptionalChildren"}),". The omitted rule is that every child run succeeds. The call may pass a quota: a count, capped at the number of children, or a proportion, whose target is that proportion of the children rounded up. Either form may name ",(0,V.jsx)(b.code,{children:"withinMin"}),", whole minutes from the moment the children open. Only a successful child run counts toward the target. A required opening seals when the target is met. It stops the parent when the target can no longer be met, or when ",(0,V.jsx)(b.code,{children:"withinMin"})," is reached with the target unmet. Before that time, a failure stops a required ",(0,V.jsx)(b.code,{children:"all"})," as failure, and a not finished child stops it as not finished. An optional opening seals and the parent continues: ",(0,V.jsx)(b.code,{children:"quota"})," when the target is met or can no longer be met, ",(0,V.jsx)(b.code,{children:"deadline"})," when ",(0,V.jsx)(b.code,{children:"withinMin"})," is reached first, and ",(0,V.jsx)(b.code,{children:"all"})," when every child of an ",(0,V.jsx)(b.code,{children:"all"})," opening has ended. A failure does not seal an optional ",(0,V.jsx)(b.code,{children:"all"})," early. Children still open stay out of the sealed report. A result that arrives later does not change it. A child takes the identity and starting data of its element. The parent reads the child's typed body."]}),"\n",(0,V.jsx)(b.h2,{id:"run",children:"Run"}),"\n",(0,V.jsxs)(b.p,{children:["Success: the function runs to the end, by returning or by ",(0,V.jsx)(b.code,{children:"finish()"}),". ",(0,V.jsx)(b.code,{children:"finish"})," may name the flow's return and store a body. A parent of one child reads that name as the discriminant and reads the body. Without a name, the discriminant stays success."]}),"\n",(0,V.jsx)(b.p,{children:"Failure: a required step or a single required child failed, a required array of children missed its rule, or the function declares failure."}),"\n",(0,V.jsx)(b.p,{children:"Not finished: a required step or a single required child is not finished, before the children's duration. An optional step does not do that. A detached step does not do that. An optional child does not do that. A quota does not treat not finished as success."}),"\n",(0,V.jsx)(b.h2,{id:"entity",children:"Entity"}),"\n",(0,V.jsx)(b.p,{children:"The entity key is organization, flow, and identity. One run at a time. Other requests wait. The run keeps the first request's starting data."}),"\n",(0,V.jsx)(b.p,{children:"Two identical lines of one list join that one execution and receive the same result."}),"\n",(0,V.jsx)(b.h2,{id:"validity-duration",children:"Validity duration"}),"\n",(0,V.jsx)(b.p,{children:"Validity duration is on the flow."}),"\n",(0,V.jsx)(b.p,{children:"On success, the duration runs from the end. A request inside the duration receives the recorded result, starts no run, and leaves the client database unread."}),"\n",(0,V.jsx)(b.p,{children:"The next request starts a run with its own starting data when the run is a failure, not finished, the duration has passed, or the flow has no duration. Passing the duration leaves the displayed run in place until that request."}),"\n",(0,V.jsx)(b.p,{children:"A parent whose run has ended stays ended when another requester starts a new run of a child."}),"\n",(0,V.jsx)(b.p,{children:"The entity shows the current run and the validity end. Until a new run starts, an expired run stays displayed with its end in the past."}),"\n",(0,V.jsx)(b.h2,{id:"silence",children:"Silence"}),"\n",(0,V.jsx)(b.p,{children:"Silence is per opened step. The silence duration and the resend maximum come from the entity's starting data."}),"\n",(0,V.jsx)(b.p,{children:"Without a result at that time, the orchestrator sends the same job again. At the resend maximum the step result is not finished."}),"\n",(0,V.jsxs)(b.p,{children:["An array of children whose rule names ",(0,V.jsx)(b.code,{children:"withinMin"})," is judged when that duration is reached. A required opening fails when the target is still unmet. An optional opening seals with end reason ",(0,V.jsx)(b.code,{children:"deadline"}),"."]}),"\n",(0,V.jsx)(b.h2,{id:"rate-limit",children:"Rate limit"}),"\n",(0,V.jsxs)(b.p,{children:["A rate limit is on the step definition: ",(0,V.jsx)(b.code,{children:"max"})," jobs and a duration ",(0,V.jsx)(b.code,{children:"durationMs"}),". ",(0,V.jsx)(b.code,{children:"bindOrganization"})," copies it onto every bound step of that definition. Aliases share the definition and the kind, so they share the limit. The kind is one queue for that organization and that step definition, so every flow that opens the step shares the limit. A step definition with no rate limit has no limit."]}),"\n",(0,V.jsxs)(b.p,{children:["The orchestrator sends the job when the step opens. The limit gates when a worker starts it. ",(0,V.jsx)(b.code,{children:"createStepWorker"})," passes BullMQ ",(0,V.jsx)(b.code,{children:"limiter"})," with that ",(0,V.jsx)(b.code,{children:"max"})," and with ",(0,V.jsx)(b.code,{children:"duration"})," set to ",(0,V.jsx)(b.code,{children:"durationMs"}),". BullMQ keeps one counter in Redis for that queue. Every worker of the kind increments the same counter when it moves a job to active. The first start in a window sets the counter to expire after ",(0,V.jsx)(b.code,{children:"durationMs"}),". At ",(0,V.jsx)(b.code,{children:"max"}),", further jobs stay waiting until the key expires and the next window starts."]}),"\n",(0,V.jsx)(b.p,{children:"Concurrency is how many jobs one worker runs at once. The rate limit is how many jobs the kind starts during one window, across every worker of that kind. Ten workers, each with concurrency 1, and a rate limit of 8 jobs per 1000 ms, start at most 8 jobs of that kind in the window. A concurrency override on a worker changes only that worker's concurrency. The limit stays the one on the step definition. The shared count holds when every worker of the kind is started with that same limit."}),"\n",(0,V.jsx)(b.p,{children:"Starts at the end of one window and the start of the next can land close together. A job that keeps running past the window still counts as one start. Jobs already active run to the end."}),"\n",(0,V.jsx)(b.p,{children:"Each environment has its own queue, and that queue has its own counter."}),"\n",(0,V.jsx)(b.p,{children:"Silence runs from the opening. A job that stays waiting until the silence duration elapses is sent again. At the resend maximum the step result is not finished."}),"\n",(0,V.jsx)(b.h2,{id:"job-and-storage",children:"Job and storage"}),"\n",(0,V.jsxs)(b.p,{children:["BullMQ only transports the job. The job is organization, entity, and step. Secrets stay off the job. The worker loads that organization's secrets once when it starts and writes them into the environment. The dispatch value carries the starting data and the time, and it carries no secret. A step implementation reads one name with ",(0,V.jsx)(b.code,{children:"environment"})," in ",(0,V.jsx)(b.code,{children:"packages/contract/src/environment.ts"}),". A log replaces the value with ",(0,V.jsx)(b.code,{children:"••••"}),". A secret added or deleted is visible at the next start of the worker. Each bound step names a kind. The orchestrator sends that job to the Redis queue for that kind. A worker pulls. It does not push when a worker appears, and the HTTP server does not start a worker. Connected workers are presence, not a condition for opening a step. Silence, a resend, and not finished stay on the opened step: a resend is a new job, and the queue does not retry. Postgres keeps the current flow run, one row per entity, plus parent and child links, memberships, and secrets. Each row is carried by its organization. The application stores each secret as given. A transition loads that entity, the children named in its tree, and its running parents. The HTTP server reads that entity row on each read. Entity counts and running counts are cached for a few seconds. After the commit, each new flow metric and step metric is appended to Redis and inserted into ClickHouse in batches. The engine rereads the result on the entity row. It does not reread the metric."]}),"\n",(0,V.jsx)(b.p,{children:"A step may write a transient file for a later step of the same run. The names it writes travel with the result and stay on the step. A replay from a step copies those kept names into the new generation before that generation's jobs are sent. A full replay starts empty and does not copy. It receives the time the orchestrator runs the job. A second run of that step keeps a single effect. The orchestrator records the step when it accepts the result. When a step throws, that result is failed and its discriminant is the error message. A held step stays open."}),"\n",(0,V.jsx)(b.h2,{id:"person",children:"Person"}),"\n",(0,V.jsxs)(b.p,{children:["Tests start the first run through the internal function ",(0,V.jsx)(b.code,{children:"startRun"}),". A run starts from that function."]}),"\n",(0,V.jsx)(b.p,{children:"A person sees entities, the operation tree, steps and their progress, the current wait, children, the validity end, the flow source, and the transient files of a stored flow run. The Secrets page lists that organization's secrets. A person can add one and delete one. Entity, source, and flow reads do not include a secret. A discarded step stays in that tree and is marked discarded. The Flows page shows flow runs and step runs for a period: counts, failure rate, p50, and the trend come from ClickHouse, and the entity count and running come from Postgres. A person can open the first entity of a flow, replay a flow, replay from a step, resend a job, run a step without applying its result, cancel a run or an open step, and end a validity. The first opening is that request: an open run waits, and inside the validity duration the recorded result is returned."})]})}function d6(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(d5,{...a})}):d5(a)}let d7=require("fs");var d8=new Map;let d9=({doc:a=>a.map(a=>{let{default:b,frontmatter:c,...d}=a.data;return{body:b,...d,...c,_file:a.info,_exports:a.data,get content(){let a=this._file.absolutePath,b=d8.get(a);if(b)return b;let c=d7.readFileSync(a).toString();return d8.set(a,c),c}}}),meta:a=>a.map(a=>({...a.data,_file:a.info})),docs(a,b){let c=this.doc(a),d=this.meta(b);return{docs:c,meta:d,toFumadocsSource:()=>(function(a,b=[]){return{files:()=>(function({docs:a,meta:b}){let c=[];for(let b of a)c.push({type:"page",absolutePath:b._file.absolutePath,path:b._file.path,data:b});for(let a of b)c.push({type:"meta",absolutePath:a._file.absolutePath,path:a._file.path,data:a});return c})({docs:a,meta:b})}})(c,d)}}}).docs([{info:{path:"engine.mdx",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/engine.mdx"},data:U},{info:{path:"fixture.mdx",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/fixture.mdx"},data:T},{info:{path:"index.mdx",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/index.mdx"},data:S},{info:{path:"install.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/install.md"},data:R},{info:{path:"server.mdx",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/server.mdx"},data:Q},{info:{path:"agents/domain.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/agents/domain.md"},data:P},{info:{path:"adr/0001-restricted-process-function.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0001-restricted-process-function.md"},data:O},{info:{path:"adr/0002-entity-key.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0002-entity-key.md"},data:N},{info:{path:"adr/0003-metrics-apart-from-the-run.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0003-metrics-apart-from-the-run.md"},data:M},{info:{path:"adr/0004-one-row-per-entity.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0004-one-row-per-entity.md"},data:L},{info:{path:"adr/0005-orchestrator-applies-results.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0005-orchestrator-applies-results.md"},data:K},{info:{path:"adr/0006-one-identity-one-entity.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0006-one-identity-one-entity.md"},data:J},{info:{path:"adr/0007-historized-flow-runs.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0007-historized-flow-runs.md"},data:I},{info:{path:"adr/0008-guard-and-each.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0008-guard-and-each.md"},data:H},{info:{path:"adr/0009-transient-files.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0009-transient-files.md"},data:G},{info:{path:"adr/0010-entity-values-copied-onto-the-run.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0010-entity-values-copied-onto-the-run.md"},data:F},{info:{path:"adr/0011-a-diverged-reread-ends-the-run.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0011-a-diverged-reread-ends-the-run.md"},data:E},{info:{path:"adr/0012-a-step-name-once-per-run.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0012-a-step-name-once-per-run.md"},data:D},{info:{path:"adr/0013-a-run-does-not-wait-on-its-ancestor.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0013-a-run-does-not-wait-on-its-ancestor.md"},data:C},{info:{path:"adr/0014-a-shared-child-is-claimed-before-its-run.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0014-a-shared-child-is-claimed-before-its-run.md"},data:B},{info:{path:"adr/0015-jobs-and-metrics-leave-with-the-run.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0015-jobs-and-metrics-leave-with-the-run.md"},data:A},{info:{path:"adr/0016-one-writer-per-organization.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0016-one-writer-per-organization.md"},data:z},{info:{path:"adr/0017-group-judgment.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0017-group-judgment.md"},data:y},{info:{path:"adr/0018-replay-copies-files.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0018-replay-copies-files.md"},data:x},{info:{path:"adr/0019-typed-body.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0019-typed-body.md"},data:w},{info:{path:"adr/0020-rule-on-each-opening.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0020-rule-on-each-opening.md"},data:u},{info:{path:"adr/0021-optional-children.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0021-optional-children.md"},data:t},{info:{path:"adr/0022-optional-quota.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0022-optional-quota.md"},data:s},{info:{path:"adr/0023-sealed-report-returns.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0023-sealed-report-returns.md"},data:r},{info:{path:"adr/0024-one-silence-per-opening.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0024-one-silence-per-opening.md"},data:q},{info:{path:"adr/0025-environment-variables.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0025-environment-variables.md"},data:p},{info:{path:"adr/0026-runtime-revision-excludes-platform-and-device.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0026-runtime-revision-excludes-platform-and-device.md"},data:o},{info:{path:"adr/0027-one-router-consumes-a-slot.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0027-one-router-consumes-a-slot.md"},data:n},{info:{path:"adr/0028-caddy-desktop-placement.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0028-caddy-desktop-placement.md"},data:m},{info:{path:"adr/0029-registry-client-or-login.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0029-registry-client-or-login.md"},data:l},{info:{path:"adr/0030-organization-code-outside-the-repository.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0030-organization-code-outside-the-repository.md"},data:k},{info:{path:"adr/0031-environment-reload.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0031-environment-reload.md"},data:j},{info:{path:"adr/0032-an-orchestrator-fault-stops-the-run.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0032-an-orchestrator-fault-stops-the-run.md"},data:i},{info:{path:"adr/0033-one-rule-for-children.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0033-one-rule-for-children.md"},data:h},{info:{path:"usage/actions.mdx",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/usage/actions.mdx"},data:g},{info:{path:"usage/drivers.mdx",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/usage/drivers.mdx"},data:f},{info:{path:"usage/flow.mdx",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/usage/flow.mdx"},data:e},{info:{path:"usage/kinds.mdx",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/usage/kinds.mdx"},data:d}],[{info:{path:"meta.json",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/meta.json"},data:{title:"Orchestrator",pages:["index","server","engine","fixture","usage","adr"]}},{info:{path:"adr/meta.json",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/meta.json"},data:{title:"Decisions",pages:["0001-restricted-process-function","0002-entity-key","0003-metrics-apart-from-the-run","0004-one-row-per-entity"]}},{info:{path:"usage/meta.json",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/usage/meta.json"},data:{title:"Usage",pages:["flow","actions","drivers"]}}]);function ea(a,b){let c=a.lastIndexOf("/");return a.substring(-1===c?0:c+1,b?a.length-b.length:a.length)}function eb(a){let b=a.lastIndexOf(".");return -1!==b?a.substring(b):""}function ec(a){return a.split("/").slice(0,-1).join("/")}function ed(a){let b=eb(a),c=ea(a,b),d=ec(a);return{dirname:d,name:c,ext:b,path:a,get flattenedPath(){return[d,c].filter(a=>a.length>0).join("/")}}}function ee(a){return a.split("/").filter(a=>a.length>0)}function ef(...a){let b=[];for(let c of a.flatMap(ee))switch(c){case"..":b.pop();break;case".":break;default:b.push(c)}return b.join("/")}function eg(a){return a.startsWith("\\\\?\\")?a:a.replaceAll("\\","/")}(0,c(95980).VA)({},{basename:()=>ea,dirname:()=>ec,extname:()=>eb,joinPath:()=>ef,parseFilePath:()=>ed,slash:()=>eg,splitPath:()=>ee});var eh=/^\((?<name>.+)\)$/,ei=/^(?:\[(?<icon>[^\]]+)])?\[(?<name>[^\]]+)]\((?<url>[^)]+)\)$/,ej=/^---(?:\[(?<icon>[^\]]+)])?(?<name>.+)---|^---$/,ek="z...a";function el(a,b,c=!1){let d=[],e=[];for(let f of a.sort((a,b)=>a.localeCompare(b)*(c?-1:1))){b.visitedPaths.add(f);let a=en(f,b);if(a){"index"===ea(f,eb(f))?d.unshift(a):d.push(a);continue}let c=em(f,!1,b);c&&e.push(c)}return[...d,...e]}function em(a,b,c){let d,e,{storage:f,options:g,resolveName:h,transformers:i}=c,j=f.readDir(a);if(!j)return;let k=h(ef(a,"meta"),"meta"),l=h(ef(a,"index"),"page"),m=f.read(k);m?.format!=="meta"&&(m=void 0);let n=m?.data.root??b;function o(){n||c.visitedPaths.has(l)||(c.visitedPaths.add(l),d=en(l,c))}if(m&&m.data.pages){let b=m.data.pages.flatMap((b,d)=>(function(a,b,c,d){if("..."===b||b===ek)return b;let{resolveName:e}=c,f=ej.exec(b);if(f?.groups){let b={$id:`${a}#${d}`,type:"separator",icon:f.groups.icon,name:f.groups.name};for(let a of c.transformers)a.separator&&(b=a.separator.call(c,b));return[b]}if(f=ei.exec(b),f?.groups){let{icon:a,url:b,name:d}=f.groups,e=b.startsWith("/")||b.startsWith("#")||b.startsWith("."),g={type:"page",icon:a,name:d,url:b,external:!e};for(let a of c.transformers)a.file&&(g=a.file.call(c,g));return[g]}let g=b.startsWith("!"),h=!g&&b.startsWith("..."),i=b;g?i=b.slice(1):h&&(i=b.slice(3));let j=e(ef(a,i),"page");if(c.visitedPaths.add(j),g)return[];let k=em(j,!1,c);if(k)return h?k.children:[k];let l=en(j,c);return l?[l]:[]})(a,b,c,d));o();for(let a=0;a<b.length;a++){let d=b[a];if("..."!==d&&d!==ek)continue;let e=el(j.filter(a=>!c.visitedPaths.has(a)),c,d===ek);b.splice(a,1,...e);break}e=b}else o(),e=el(j.filter(a=>!c.visitedPaths.has(a)),c);let p=m?.data.title??d?.name;if(!p){let b=ea(a);p=eo(eh.exec(b)?.[1]??b)}let q={type:"folder",name:p,icon:m?.data.icon??d?.icon,root:m?.data.root,defaultOpen:m?.data.defaultOpen,description:m?.data.description,index:d,children:e,$id:a,$ref:!g.noRef&&m?{metaFile:k}:void 0};for(let b of i)b.folder&&(q=b.folder.call(c,q,a,k));return q}function en(a,b){let{options:c,getUrl:d,storage:e,locale:f,transformers:g}=b,h=e.read(a);if(h?.format!=="page")return;let{title:i,description:j,icon:k}=h.data,l={$id:a,type:"page",name:i??eo(ea(a,eb(a))),description:j,icon:k,url:d(h.slugs,f),$ref:c.noRef?void 0:{file:a}};for(let c of g)c.file&&(l=c.file.call(b,l,a));return l}function eo(a){let b=[];for(let c of a)0===b.length?b.push(c.toLocaleUpperCase()):"-"===c?b.push(" "):b.push(c);return b.join("")}var ep=class{constructor(a){if(this.files=new Map,this.folders=new Map,a){for(let[b,c]of a.folders)this.folders.set(b,c);for(let[b,c]of a.files)this.files.set(b,c)}else this.folders.set("",[])}read(a){return this.files.get(a)}readDir(a){return this.folders.get(a)}write(a,b){if(!this.files.has(a)){let b=ec(a);this.makeDir(b),this.readDir(b)?.push(a)}this.files.set(a,b)}delete(a,b=!1){if(this.files.delete(a))return!0;if(b){let b=this.folders.get(a);if(!b)return!1;for(let c of(this.folders.delete(a),b))this.delete(c);return!0}return!1}getFiles(){return Array.from(this.files.keys())}makeDir(a){let b=ee(a);for(let a=0;a<b.length;a++){let c=b.slice(0,a+1).join("/");this.folders.has(c)||(this.folders.set(c,[]),this.folders.get(ec(c)).push(c))}}};function eq(a){return a.length>0&&!/\d+/.test(a)}var er={dir(a){let[b,...c]=a.split("/");return b&&c.length>0&&eq(b)?[c.join("/"),b]:[a]},dot(a){let b=ec(a),c=ea(a).split(".");if(c.length<3)return[a];let[d]=c.splice(c.length-2,1);return eq(d)?[ef(b,c.join(".")),d]:[a]},none:a=>[a]},es={pre:1,default:0,post:-1},et=/^\(.+\)$/;function eu(a){if("string"!=typeof a)return eu(a.path);let b=ec(a),c=ea(a,eb(a)),d=[];for(let a of b.split("/"))a.length>0&&!et.test(a)&&d.push(encodeURI(a));if(et.test(c))throw Error(`Cannot use folder group in file names: ${a}`);return"index"!==c&&d.push(encodeURI(c)),d}function ev(a){return{transformPageTree:a}}function ew(a,{slugs:b,icon:c,plugins:d=[],baseUrl:e,url:f,...g}){let h=f?(...a)=>{var b;return(b=f(...a)).startsWith("http://")||b.startsWith("https://")||(b.startsWith("/")||(b="/"+b),b.length>1&&b.endsWith("/")&&(b=b.slice(0,-1))),b}:function(a,b){let c=a.split("/");return(a,d)=>{let e,f=b?.hideLocale??"never";"never"===f?e=d:"default-locale"===f&&d!==b?.defaultLanguage&&(e=d);let g=[...c,...a];return e&&g.unshift(e),`/${g.filter(a=>a.length>0).join("/")}`}}(e,g.i18n),i={...g,url:h,source:a,plugins:function(a){let b=[];for(let c of a)Array.isArray(c)?b.push(...c):c&&b.push(c);return b.sort((a,b)=>es[b.enforce??"default"]-es[a.enforce??"default"])}([{name:"fumadocs:slugs",transformStorage({storage:a}){let c=new Set,d=new Set,e=void 0===b;for(let f of a.getFiles()){let g=a.read(f);if(!g||"page"!==g.format||g.slugs)continue;if("index"===ea(f,eb(f))&&e){c.add(f);continue}g.slugs=b?b(ed(f)):eu(f);let h=g.slugs.join("/");if(d.has(h))throw Error("Duplicated slugs");d.add(h)}for(let b of c){let c=a.read(b);c?.format==="page"&&(c.slugs=eu(b),d.has(c.slugs.join("/"))&&c.slugs.push("index"))}}},c&&function(a){function b(b){return(void 0===b.icon||"string"==typeof b.icon)&&(b.icon=a(b.icon)),b}return{name:"fumadocs:icon",transformPageTree:{file:b,folder:b,separator:b}}}(c),function({pageTree:a,transformers:b}){let c=[];if(a){let{attachFile:b,attachSeparator:d,attachFolder:e,transformers:f}=a;for(let a of f??[])c.push(ev(a));c.push(ev({file(a,c){if(!b)return a;let d=c?this.storage.read(c):void 0;return b(a,d?.format==="page"?d:void 0)},folder(a,b,c){if(!e)return a;let d=this.storage.readDir(b)??[],f=c?this.storage.read(c):void 0;return e(a,{children:d.flatMap(a=>this.storage.read(a)??[])},f?.format==="meta"?f:void 0)},separator:a=>d?d(a):a}))}if(b)for(let a of b)c.push({transformStorage:a});return c}(g),...d])};for(let a of i.plugins??[]){let b=a.config?.(i);b&&(i=b)}return i}let ex=function(...a){return function({source:{files:a},url:b,i18n:c,plugins:d=[],pageTree:e}){let f,g=c?.defaultLanguage??"",h=function(a,b,c,d){let e=er[d.parser??"dot"],f={},g=a.map(a=>b({...a,path:function(a){let b=ee(eg(a));if("."===b[0]||".."===b[0])throw Error("It must not start with './' or '../'");return b.join("/")}(a.path)})),h=null!==d.fallbackLanguage?d.fallbackLanguage??d.defaultLanguage:null;for(let a of d.languages)!function a(b){let i;if(f[b])return;for(let c of(h&&h!==b?(a(h),i=new ep(f[h])):i=new ep,g)){let[a,f=d.defaultLanguage]=e(c.path);f===b&&i.write(a,c)}let j={storage:i};for(let a of c)a.transformStorage?.(j);f[b]=i}(a);return f}(a,a=>"page"===a.type?{format:"page",path:a.path,slugs:a.slugs,data:a.data,absolutePath:a.absolutePath??""}:{format:"meta",path:a.path,absolutePath:a.absolutePath??"",data:a.data},d,c??{defaultLanguage:g,parser:"none",languages:[g]}),i=function(a,b){let c={pages:new Map,pathToMeta:new Map,pathToPage:new Map};for(let[h,i]of Object.entries(a))for(let a of i.getFiles()){var d,e,f,g;let j=i.read(a),k=`${h}.${a}`;if("meta"===j.format){c.pathToMeta.set(k,{path:(d=j).path,absolutePath:d.absolutePath,get file(){return ed(this.path)},data:d.data});continue}let l=(e=j,f=b,g=h,{get file(){return ed(this.path)},absolutePath:e.absolutePath,path:e.path,url:f(e.slugs,g),slugs:e.slugs,data:e.data,locale:g});c.pathToPage.set(k,l),c.pages.set(`${h}.${l.slugs.join("/")}`,l)}return c}(h,b),j={build(a,b){return this.buildI18n({"":a},b)[""]},buildI18n(a,c={}){let{id:e,generateFallback:f=!0}=c,g=function(a){let b=[];for(let a of d??[])a.transformPageTree&&b.push(a.transformPageTree);return a&&b.push(function(){let a=new Set;return{root(b){let c=new ep;for(let b of this.storage.getFiles()){if(a.has(b))continue;let d=this.storage.read(b);d&&c.write(b,d)}return 0===c.getFiles().length||(b.fallback=this.builder.build(c,{...this.options,id:`fallback-${b.$id??""}`,generateFallback:!1}),a.clear()),b},file:(b,c)=>(c&&a.add(c),b),folder:(b,c,d)=>(d&&a.add(d),b)}}()),b}(f),h={};for(let[d,f]of Object.entries(a)){let i=function(a){let b=new Map;for(let c of a.getFiles()){let d=a.read(c),e=c.substring(0,c.length-eb(c).length);b.set(e+"."+d.format,c)}return(a,c)=>b.get(a+"."+c)}(f),j=0===d.length?"root":d;h[d]=function(a,b){let c=em("",!0,b),d={$id:a,name:c.name||"Docs",children:c.children};for(let a of b.transformers)a.root&&(d=a.root.call(b,d));return d}(e?`${e}-${j}`:j,{transformers:g,builder:this,options:c,getUrl:b,locale:d,storage:f,storages:a,visitedPaths:new Set,resolveName:(a,b)=>i(a,b)??a})}return h}};return{_i18n:c,get pageTree(){return f??=j.buildI18n(h,e),c?f:f[g]},set pageTree(v){f=c?v:{[g]:v}},getPageByHref(a,{dir:b="",language:c=g}={}){let d,[e,f]=a.split("#",2);if(e.startsWith(".")&&(e.endsWith(".md")||e.endsWith(".mdx"))){let a=ef(b,e);d=i.pathToPage.get(`${c}.${a}`)}else d=this.getPages(c).find(a=>a.url===e);if(d)return{page:d,hash:f}},getPages(a){let b=[];for(let[c,d]of i.pages.entries())(void 0===a||c.startsWith(`${a}.`))&&b.push(d);return b},getLanguages(){let a=[];if(!c)return a;for(let b of c.languages)a.push({language:b,pages:this.getPages(b)});return a},getPage:(a=[],b=g)=>i.pages.get(`${b}.${a.join("/")}`),getNodeMeta(a,b=g){let c=a.$ref?.metaFile;if(c)return i.pathToMeta.get(`${b}.${c}`)},getNodePage(a,b=g){let c=a.$ref?.file;if(c)return i.pathToPage.get(`${b}.${c}`)},getPageTree(a){return c?this.pageTree[a??g]:this.pageTree},generateParams(a,b){return c?this.getLanguages().flatMap(c=>c.pages.map(d=>({[a??"slug"]:d.slugs,[b??"lang"]:c.language}))):this.getPages().map(b=>({[a??"slug"]:b.slugs}))}}}(2===a.length?ew(a[0],a[1]):ew(a[0].source,a[0]))}({baseUrl:"/docs",source:{files:function(a){let b=a.files;return"function"==typeof b?b():b}(d9.toFumadocsSource())}})},35396:(a,b,c)=>{"use strict";c.r(b),c.d(b,{I18nContext:()=>f,I18nLabel:()=>g,defaultTranslations:()=>e,useI18n:()=>h});var d=c(71935);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call defaultTranslations() from the server but defaultTranslations is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/contexts/i18n.js","defaultTranslations"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call I18nContext() from the server but I18nContext is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/contexts/i18n.js","I18nContext"),g=(0,d.registerClientReference)(function(){throw Error("Attempted to call I18nLabel() from the server but I18nLabel is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/contexts/i18n.js","I18nLabel"),h=(0,d.registerClientReference)(function(){throw Error("Attempted to call useI18n() from the server but useI18n is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/contexts/i18n.js","useI18n")},38629:(a,b,c)=>{"use strict";c.d(b,{ThemeToggle:()=>d});let d=(0,c(71935).registerClientReference)(function(){throw Error("Attempted to call ThemeToggle() from the server but ThemeToggle is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/theme-toggle.js","ThemeToggle")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},42122:(a,b,c)=>{"use strict";c.d(b,{LanguageToggle:()=>i,LanguageToggleText:()=>j});var d=c(5009),e=c(38002),f=c(93586),g=c(17265),h=c(21603);function i(a){let b=(0,e.useI18n)();if(!b.locales)throw Error("Missing `<I18nProvider />`");return(0,d.jsxs)(f.AM,{children:[(0,d.jsx)(f.Wv,{"aria-label":b.text.chooseLanguage,...a,className:(0,g.QP)((0,h.r)({color:"ghost",className:"gap-1.5 p-1.5"}),a.className),children:a.children}),(0,d.jsxs)(f.hl,{className:"flex flex-col overflow-hidden p-0",children:[(0,d.jsx)("p",{className:"mb-1 p-2 text-xs font-medium text-fd-muted-foreground",children:b.text.chooseLanguage}),b.locales.map(a=>(0,d.jsx)("button",{type:"button",className:(0,g.QP)("p-2 text-start text-sm",a.locale===b.locale?"bg-fd-primary/10 font-medium text-fd-primary":"hover:bg-fd-accent hover:text-fd-accent-foreground"),onClick:()=>{b.onChange?.(a.locale)},children:a.name},a.locale))]})]})}function j(a){let b=(0,e.useI18n)(),c=b.locales?.find(a=>a.locale===b.locale)?.name;return(0,d.jsx)("span",{...a,children:c})}},44195:(a,b,c)=>{Promise.resolve().then(c.bind(c,69212)),Promise.resolve().then(c.bind(c,42122)),Promise.resolve().then(c.bind(c,57024)),Promise.resolve().then(c.bind(c,58228)),Promise.resolve().then(c.bind(c,19998)),Promise.resolve().then(c.bind(c,19847)),Promise.resolve().then(c.bind(c,83792)),Promise.resolve().then(c.bind(c,47718)),Promise.resolve().then(c.bind(c,57696)),Promise.resolve().then(c.bind(c,23150))},44518:(a,b,c)=>{"use strict";c.d(b,{CollapsibleControl:()=>g,LayoutBody:()=>f,LayoutTabs:()=>h,Navbar:()=>e});var d=c(71935);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call Navbar() from the server but Navbar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/layouts/docs/client.js","Navbar"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call LayoutBody() from the server but LayoutBody is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/layouts/docs/client.js","LayoutBody"),g=(0,d.registerClientReference)(function(){throw Error("Attempted to call CollapsibleControl() from the server but CollapsibleControl is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/layouts/docs/client.js","CollapsibleControl"),h=(0,d.registerClientReference)(function(){throw Error("Attempted to call LayoutTabs() from the server but LayoutTabs is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/layouts/docs/client.js","LayoutTabs")},45400:(a,b,c)=>{"use strict";c.d(b,{PageBreadcrumb:()=>j,PageFooter:()=>i,PageLastUpdate:()=>h,PageTOC:()=>k,PageTOCPopover:()=>g,PageTOCPopoverContent:()=>f,PageTOCPopoverTrigger:()=>e});var d=c(71935);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call PageTOCPopoverTrigger() from the server but PageTOCPopoverTrigger is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/layouts/docs/page-client.js","PageTOCPopoverTrigger"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call PageTOCPopoverContent() from the server but PageTOCPopoverContent is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/layouts/docs/page-client.js","PageTOCPopoverContent"),g=(0,d.registerClientReference)(function(){throw Error("Attempted to call PageTOCPopover() from the server but PageTOCPopover is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/layouts/docs/page-client.js","PageTOCPopover"),h=(0,d.registerClientReference)(function(){throw Error("Attempted to call PageLastUpdate() from the server but PageLastUpdate is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/layouts/docs/page-client.js","PageLastUpdate"),i=(0,d.registerClientReference)(function(){throw Error("Attempted to call PageFooter() from the server but PageFooter is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/layouts/docs/page-client.js","PageFooter"),j=(0,d.registerClientReference)(function(){throw Error("Attempted to call PageBreadcrumb() from the server but PageBreadcrumb is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/layouts/docs/page-client.js","PageBreadcrumb"),k=(0,d.registerClientReference)(function(){throw Error("Attempted to call PageTOC() from the server but PageTOC is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/layouts/docs/page-client.js","PageTOC")},47031:(a,b,c)=>{"use strict";c.d(b,{AT:()=>i,Bx:()=>j,EY:()=>o,N_:()=>p,R2:()=>n,RT:()=>l,ff:()=>q,lW:()=>m,rW:()=>k});var d=c(40239),e=c(70986),f=c(25475);let g={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},h=(a,b)=>{let c=(0,e.forwardRef)(({className:a,size:c=24,color:h="currentColor",children:i,...j},k)=>(0,d.jsxs)("svg",{ref:k,...g,width:c,height:c,stroke:h,className:(0,f.QP)("lucide",a),...j,children:[b.map(([a,b])=>(0,e.createElement)(a,b)),i]}));return c.displayName=a,c};h("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);let i=h("languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]),j=h("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);h("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),h("search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),h("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),h("moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),h("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),h("airplay",[["path",{d:"M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1",key:"ns4c3b"}],["path",{d:"m12 15 5 6H7Z",key:"14qnn2"}]]),h("menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]),h("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),h("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);let k=h("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),l=h("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);h("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);let m=h("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),n=h("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);h("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),h("clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"2"}]]),h("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),h("hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);let o=h("text",[["path",{d:"M15 18H3",key:"olowqp"}],["path",{d:"M17 6H3",key:"16j9eg"}],["path",{d:"M21 12H3",key:"2avoz0"}]]);h("file",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]),h("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]),h("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),h("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);let p=h("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),q=h("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);h("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),h("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),h("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),h("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),h("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},49560:(a,b,c)=>{"use strict";function d(...a){return b=>{a.forEach(a=>{"function"==typeof a?a(b):a&&(a.current=b)})}}c.d(b,{P:()=>d})},53842:(a,b,c)=>{"use strict";c.d(b,{PageBreadcrumb:()=>D,PageFooter:()=>B,PageLastUpdate:()=>z,PageTOC:()=>E,PageTOCPopover:()=>y,PageTOCPopoverContent:()=>x,PageTOCPopoverTrigger:()=>u});var d=c(5009),e=c(78820),f=c(97469),g=c(69212),h=c(17265),i=c(38002),j=c(47718),k=c(54309),l=c(57317),m=c(83792),n=c(59384),o=c(8940),p=c(14495),q=c(85880),r=c(82425),s=c(68388);let t=(0,k.q6)("TocPopoverContext");function u(a){let{text:b}=(0,i.useI18n)(),{open:c}=t.use(),g=(0,r.a)(),k=(0,s.R3)(),l=(0,e.useMemo)(()=>g.findIndex(a=>k===a.url.slice(1)),[g,k]),m=(0,j.L)().at(-1),n=-1!==l&&!c;return(0,d.jsxs)(p.R6,{...a,className:(0,h.QP)("flex w-full h-(--fd-tocnav-height) items-center text-sm text-fd-muted-foreground gap-2.5 px-4 py-2.5 text-start focus-visible:outline-none [&_svg]:size-4 md:px-6",a.className),children:[(0,d.jsx)(w,{value:(l+1)/Math.max(1,g.length),max:1,className:(0,h.QP)("shrink-0",c&&"text-fd-primary")}),(0,d.jsxs)("span",{className:"grid flex-1 *:my-auto *:row-start-1 *:col-start-1",children:[(0,d.jsx)("span",{className:(0,h.QP)("truncate transition-all",c&&"text-fd-foreground",n&&"opacity-0 -translate-y-full pointer-events-none"),children:m?.name??b.toc}),(0,d.jsx)("span",{className:(0,h.QP)("truncate transition-all",!n&&"opacity-0 translate-y-full pointer-events-none"),children:g[l]?.title})]}),(0,d.jsx)(f.yQ,{className:(0,h.QP)("shrink-0 transition-transform mx-0.5",c&&"rotate-180")})]})}function w({value:a,strokeWidth:b=2,size:c=24,min:e=0,max:f=100,...g}){let h=a<e?e:a>f?f:a,i=(c-b)/2,j=2*Math.PI*i,k=h/f*j,l={cx:c/2,cy:c/2,r:i,fill:"none",strokeWidth:b};return(0,d.jsxs)("svg",{role:"progressbar",viewBox:`0 0 ${c} ${c}`,"aria-valuenow":h,"aria-valuemin":e,"aria-valuemax":f,...g,children:[(0,d.jsx)("circle",{...l,className:"stroke-current/25"}),(0,d.jsx)("circle",{...l,stroke:"currentColor",strokeDasharray:j,strokeDashoffset:j-k,strokeLinecap:"round",transform:`rotate(-90 ${c/2} ${c/2})`,className:"transition-all"})]})}function x(a){return(0,d.jsx)(p.Ke,{"data-toc-popover":"",...a,className:(0,h.QP)("flex flex-col px-4 max-h-[50vh] md:px-6",a.className),children:a.children})}function y(a){let b=(0,e.useRef)(null),[c,f]=(0,e.useState)(!1),{collapsed:g}=(0,q.c)(),{isTransparent:i}=(0,m.hI)();return(0,o.J)(a=>{c&&b.current&&!b.current.contains(a.target)&&f(!1)}),(0,d.jsx)(t.Provider,{value:(0,e.useMemo)(()=>({open:c,setOpen:f}),[f,c]),children:(0,d.jsx)(p.Nt,{open:c,onOpenChange:f,asChild:!0,children:(0,d.jsx)("header",{ref:b,id:"nd-tocnav",...a,className:(0,h.QP)("fixed pr-(--removed-body-scroll-bar-size,0) z-10 border-b backdrop-blur-sm transition-colors xl:hidden max-xl:on-root:[--fd-tocnav-height:40px]",(!i||c)&&"bg-fd-background/80",c&&"shadow-lg",a.className),style:{...a.style,top:"calc(var(--fd-banner-height) + var(--fd-nav-height))",insetInlineStart:g?"0px":"calc(var(--fd-sidebar-width) + var(--fd-layout-offset))",insetInlineEnd:0},children:a.children})})})}function z({date:a,...b}){let{text:c}=(0,i.useI18n)(),[f,g]=(0,e.useState)("");return(0,d.jsxs)("p",{...b,className:(0,h.QP)("text-sm text-fd-muted-foreground",b.className),children:[c.lastUpdate," ",f]})}let A=new Map;function B({items:a,...b}){let{root:c}=(0,j.t)(),f=(0,k.a8)(),{previous:g,next:i}=(0,e.useMemo)(()=>{if(a)return a;let b=A.get(c.$id)??function a(b){let c=[];return b.forEach(b=>{if("folder"===b.type){b.index&&c.push(b.index),c.push(...a(b.children));return}"page"!==b.type||b.external||c.push(b)}),c}(c.children);A.set(c.$id,b);let d=b.findIndex(a=>(0,n.$)(a.url,f,!1));return -1===d?{}:{previous:b[d-1],next:b[d+1]}},[a,f,c]);return(0,d.jsxs)("div",{...b,className:(0,h.QP)("@container grid gap-4 pb-6",g&&i?"grid-cols-2":"grid-cols-1",b.className),children:[g?(0,d.jsx)(C,{item:g,index:0}):null,i?(0,d.jsx)(C,{item:i,index:1}):null]})}function C({item:a,index:b}){let{text:c}=(0,i.useI18n)(),e=0===b?f.JG:f.c_;return(0,d.jsxs)(g.default,{href:a.url,className:(0,h.QP)("flex flex-col gap-2 rounded-lg border p-4 text-sm transition-colors hover:bg-fd-accent/80 hover:text-fd-accent-foreground @max-lg:col-span-full",1===b&&"text-end"),children:[(0,d.jsxs)("div",{className:(0,h.QP)("inline-flex items-center gap-1.5 font-medium",1===b&&"flex-row-reverse"),children:[(0,d.jsx)(e,{className:"-mx-1 size-4 shrink-0 rtl:rotate-180"}),(0,d.jsx)("p",{children:a.name})]}),(0,d.jsx)("p",{className:"text-fd-muted-foreground truncate",children:a.description??(0===b?c.previousPage:c.nextPage)})]})}function D({includeRoot:a,includeSeparator:b,includePage:c,...i}){let k=(0,j.L)(),{root:m}=(0,j.t)(),n=(0,e.useMemo)(()=>(0,l.Pp)(m,k,{includePage:c,includeSeparator:b,includeRoot:a}),[c,a,b,k,m]);return 0===n.length?null:(0,d.jsx)("div",{...i,className:(0,h.QP)("flex items-center gap-1.5 text-sm text-fd-muted-foreground",i.className),children:n.map((a,b)=>{let c=(0,h.QP)("truncate",b===n.length-1&&"text-fd-primary font-medium");return(0,d.jsxs)(e.Fragment,{children:[0!==b&&(0,d.jsx)(f.c_,{className:"size-3.5 shrink-0"}),a.url?(0,d.jsx)(g.default,{href:a.url,className:(0,h.QP)(c,"transition-opacity hover:opacity-80"),children:a.name}):(0,d.jsx)("span",{className:c,children:a.name})]},b)})})}function E(a){let{collapsed:b}=(0,q.c)();return(0,d.jsx)("div",{id:"nd-toc",...a,className:(0,h.QP)("fixed bottom-0 pt-12 pb-2 pr-(--removed-body-scroll-bar-size,0) max-xl:hidden",a.className),style:{...a.style,top:"calc(var(--fd-banner-height) + var(--fd-nav-height))",insetInlineEnd:`max(${b?"0px":"var(--fd-layout-offset)"}, calc(50vw - var(--fd-sidebar-width)/2 - var(--fd-page-width)/2))`},children:(0,d.jsx)("div",{className:"flex h-full w-(--fd-toc-width) max-w-full flex-col pe-4",children:a.children})})}},55511:a=>{"use strict";a.exports=require("crypto")},57024:(a,b,c)=>{"use strict";c.d(b,{RootToggle:()=>m});var d=c(5009),e=c(97469),f=c(78820),g=c(69212),h=c(54309),i=c(17265),j=c(59384),k=c(85880),l=c(93586);function m({options:a,placeholder:b,...c}){let[m,n]=(0,f.useState)(!1),{closeOnRedirect:o}=(0,k.c)(),p=(0,h.a8)(),q=(0,f.useMemo)(()=>a.findLast(a=>(0,j.c)(a,p)),[a,p]),r=()=>{o.current=!1,n(!1)},s=q?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"size-9 shrink-0 md:size-5",children:q.icon}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:q.title}),(0,d.jsx)("p",{className:"text-[13px] text-fd-muted-foreground empty:hidden md:hidden",children:q.description})]})]}):b;return(0,d.jsxs)(l.AM,{open:m,onOpenChange:n,children:[s&&(0,d.jsxs)(l.Wv,{...c,className:(0,i.QP)("flex items-center gap-2 rounded-lg p-2 border bg-fd-secondary/50 text-start text-fd-secondary-foreground transition-colors hover:bg-fd-accent data-[state=open]:bg-fd-accent data-[state=open]:text-fd-accent-foreground",c.className),children:[s,(0,d.jsx)(e.Ml,{className:"shrink-0 ms-auto size-4 text-fd-muted-foreground"})]}),(0,d.jsx)(l.hl,{className:"flex flex-col gap-1 w-(--radix-popover-trigger-width) overflow-hidden p-1",children:a.map(a=>{let b=q&&a.url===q.url;if(b||!a.unlisted)return(0,d.jsxs)(g.default,{href:a.url,onClick:r,...a.props,className:(0,i.QP)("flex items-center gap-2 rounded-lg p-1.5 hover:bg-fd-accent hover:text-fd-accent-foreground",a.props?.className),children:[(0,d.jsx)("div",{className:"shrink-0 size-9 md:mt-1 md:mb-auto md:size-5",children:a.icon}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:a.title}),(0,d.jsx)("p",{className:"text-[13px] text-fd-muted-foreground empty:hidden",children:a.description})]}),(0,d.jsx)(e.Jl,{className:(0,i.QP)("shrink-0 ms-auto size-3.5 text-fd-primary",!b&&"invisible")})]},a.url)})})]})}},57696:(a,b,c)=>{"use strict";c.d(b,{CollapsibleControl:()=>r,LayoutBody:()=>q,LayoutTabs:()=>s,Navbar:()=>p});var d=c(5009),e=c(97469),f=c(78820),g=c(17265),h=c(21603),i=c(85880),j=c(83792),k=c(19998),l=c(58228),m=c(54309),n=c(59384),o=c(69212);function p(a){let{isTransparent:b}=(0,j.hI)();return(0,d.jsx)("header",{id:"nd-subnav",...a,className:(0,g.QP)("fixed top-(--fd-banner-height) left-0 right-(--removed-body-scroll-bar-size,0) z-30 flex items-center ps-4 pe-2.5 border-b transition-colors backdrop-blur-sm",!b&&"bg-fd-background/80",a.className),children:a.children})}function q(a){let{collapsed:b}=(0,i.c)();return(0,d.jsx)("main",{id:"nd-docs-layout",...a,className:(0,g.QP)("flex flex-1 flex-col pt-(--fd-nav-height) transition-[padding] fd-default-layout",!b&&"mx-(--fd-layout-offset)",a.className),style:{...a.style,paddingInlineStart:b?"min(calc(100vw - var(--fd-page-width)), var(--fd-sidebar-width))":"var(--fd-sidebar-width)"},children:a.children})}function r(){let{collapsed:a}=(0,i.c)();return(0,d.jsxs)("div",{className:(0,g.QP)("fixed flex shadow-lg transition-opacity rounded-xl p-0.5 border bg-fd-muted text-fd-muted-foreground z-10 max-md:hidden xl:start-4 max-xl:end-4",!a&&"pointer-events-none opacity-0"),style:{top:"calc(var(--fd-banner-height) + var(--fd-tocnav-height) + var(--spacing) * 4)"},children:[(0,d.jsx)(k.SidebarCollapseTrigger,{className:(0,g.QP)((0,h.r)({color:"ghost",size:"icon-sm",className:"rounded-lg"})),children:(0,d.jsx)(e.Bx,{})}),(0,d.jsx)(l.SearchToggle,{className:"rounded-lg",hideIfDisabled:!0})]})}function s({options:a,...b}){let c=(0,m.a8)(),e=(0,f.useMemo)(()=>a.findLast(a=>(0,n.c)(a,c)),[a,c]);return(0,d.jsx)("div",{...b,className:(0,g.QP)("flex flex-row items-end gap-6 overflow-auto",b.className),children:a.map(a=>(0,d.jsx)(t,{selected:e===a,option:a},a.url))})}function t({option:{title:a,url:b,unlisted:c,props:e},selected:f=!1}){return(0,d.jsx)(o.default,{href:b,...e,className:(0,g.QP)("inline-flex border-b-2 border-transparent transition-colors items-center pb-1.5 font-medium gap-2 text-fd-muted-foreground text-sm text-nowrap hover:text-fd-accent-foreground",c&&!f&&"hidden",f&&"border-fd-primary text-fd-primary",e?.className),children:a})}},58228:(a,b,c)=>{"use strict";c.d(b,{LargeSearchToggle:()=>k,SearchToggle:()=>j});var d=c(5009),e=c(97469),f=c(86986),g=c(38002),h=c(17265),i=c(21603);function j({hideIfDisabled:a,size:b="icon-sm",color:c="ghost",...g}){let{setOpenSearch:j,enabled:k}=(0,f.$A)();return a&&!k?null:(0,d.jsx)("button",{type:"button",className:(0,h.QP)((0,i.r)({size:b,color:c}),g.className),"data-search":"","aria-label":"Open Search",onClick:()=>{j(!0)},children:(0,d.jsx)(e.vj,{})})}function k({hideIfDisabled:a,...b}){let{enabled:c,hotKey:i,setOpenSearch:j}=(0,f.$A)(),{text:k}=(0,g.useI18n)();return a&&!c?null:(0,d.jsxs)("button",{type:"button","data-search-full":"",...b,className:(0,h.QP)("inline-flex items-center gap-2 rounded-lg border bg-fd-secondary/50 p-1.5 ps-2 text-sm text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground",b.className),onClick:()=>{j(!0)},children:[(0,d.jsx)(e.vj,{className:"size-4"}),k.search,(0,d.jsx)("div",{className:"ms-auto inline-flex gap-0.5",children:i.map((a,b)=>(0,d.jsx)("kbd",{className:"rounded-md border bg-fd-background px-1.5",children:a.display},b))})]})}},59384:(a,b,c)=>{"use strict";function d(a){return a.length>1&&a.endsWith("/")?a.slice(0,-1):a}function e(a,b,c=!0){return(a=d(a))===(b=d(b))||c&&b.startsWith(`${a}/`)}function f(a,b){return a.urls?a.urls.has(d(b)):e(a.url,b,!0)}c.d(b,{$:()=>e,c:()=>f})},60441:(a,b,c)=>{"use strict";c.d(b,{CodeBlock:()=>aG,CodeBlockTab:()=>aL,CodeBlockTabs:()=>aI,CodeBlockTabsList:()=>aJ,CodeBlockTabsTrigger:()=>aK,Pre:()=>aF});var d=c(5009),e=c(97469),f=c(78820),g=c.t(f,2),h=c(17265),i=c(21603),j=c(84335),k=c(26227),l=c(3411),m=c(14069),n=Object.defineProperty,o=(a,b)=>n(a,"name",{value:b,configurable:!0});function p(a){let b=a+"CollectionProvider",[c,e]=(0,k.A)(b),[g,h]=c(b,{collectionRef:{current:null},itemMap:new Map}),i=o(a=>{let{scope:b,children:c}=a,e=f.useRef(null),h=f.useRef(new Map).current;return(0,d.jsx)(g,{scope:b,itemMap:h,collectionRef:e,children:c})},"CollectionProvider");i.displayName=b;let j=a+"CollectionSlot",n=(0,m.TL)(j),p=f.forwardRef((a,b)=>{let{scope:c,children:e}=a,f=h(j,c),g=(0,l.s)(b,f.collectionRef);return(0,d.jsx)(n,{ref:g,children:e})});p.displayName=j;let q=a+"CollectionItemSlot",r="data-radix-collection-item",s=(0,m.TL)(q),t=f.forwardRef((a,b)=>{let{scope:c,children:e,...g}=a,i=f.useRef(null),j=(0,l.s)(b,i),k=h(q,c);return f.useEffect(()=>(k.itemMap.set(i,{ref:i,...g}),()=>void k.itemMap.delete(i))),(0,d.jsx)(s,{...{[r]:""},ref:j,children:e})});function u(b){let c=h(a+"CollectionConsumer",b);return f.useCallback(()=>{let a=c.collectionRef.current;if(!a)return[];let b=Array.from(a.querySelectorAll(`[${r}]`));return Array.from(c.itemMap.values()).sort((a,c)=>b.indexOf(a.ref.current)-b.indexOf(c.ref.current))},[c.collectionRef,c.itemMap])}return t.displayName=q,o(u,"useCollection"),[{Provider:i,Slot:p,ItemSlot:t},u,e]}o(p,"createCollection");var q=new WeakMap,r=class a extends Map{static{o(this,"OrderedDict")}#a;constructor(a){super(a),this.#a=[...super.keys()],q.set(this,!0)}set(a,b){return q.get(this)&&(this.has(a)?this.#a[this.#a.indexOf(a)]=a:this.#a.push(a)),super.set(a,b),this}insert(a,b,c){let d,e=this.has(b),f=this.#a.length,g=u(a),h=g>=0?g:f+g,i=h<0||h>=f?-1:h;if(i===this.size||e&&i===this.size-1||-1===i)return this.set(b,c),this;let j=this.size+ +!e;g<0&&h++;let k=[...this.#a],l=!1;for(let a=h;a<j;a++)if(h===a){let f=k[a];k[a]===b&&(f=k[a+1]),e&&this.delete(b),d=this.get(f),this.set(b,c)}else{l||k[a-1]!==b||(l=!0);let c=k[l?a:a-1],e=d;d=this.get(c),this.delete(c),this.set(c,e)}return this}with(b,c,d){let e=new a(this);return e.insert(b,c,d),e}before(a){let b=this.#a.indexOf(a)-1;if(!(b<0))return this.entryAt(b)}setBefore(a,b,c){let d=this.#a.indexOf(a);return -1===d?this:this.insert(d,b,c)}after(a){let b=this.#a.indexOf(a);if(-1!==(b=-1===b||b===this.size-1?-1:b+1))return this.entryAt(b)}setAfter(a,b,c){let d=this.#a.indexOf(a);return -1===d?this:this.insert(d+1,b,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#a=[],super.clear()}delete(a){let b=super.delete(a);return b&&this.#a.splice(this.#a.indexOf(a),1),b}deleteAt(a){let b=this.keyAt(a);return void 0!==b&&this.delete(b)}at(a){let b=s(this.#a,a);if(void 0!==b)return this.get(b)}entryAt(a){let b=s(this.#a,a);if(void 0!==b)return[b,this.get(b)]}indexOf(a){return this.#a.indexOf(a)}keyAt(a){return s(this.#a,a)}from(a,b){let c=this.indexOf(a);if(-1===c)return;let d=c+b;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.at(d)}keyFrom(a,b){let c=this.indexOf(a);if(-1===c)return;let d=c+b;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.keyAt(d)}find(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return d;c++}}findIndex(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return c;c++}return -1}filter(b,c){let d=[],e=0;for(let a of this)Reflect.apply(b,c,[a,e,this])&&d.push(a),e++;return new a(d)}map(b,c){let d=[],e=0;for(let a of this)d.push([a[0],Reflect.apply(b,c,[a,e,this])]),e++;return new a(d)}reduce(...a){let[b,c]=a,d=0,e=c??this.at(0);for(let c of this)e=0===d&&1===a.length?c:Reflect.apply(b,this,[e,c,d,this]),d++;return e}reduceRight(...a){let[b,c]=a,d=c??this.at(-1);for(let c=this.size-1;c>=0;c--){let e=this.at(c);d=c===this.size-1&&1===a.length?e:Reflect.apply(b,this,[d,e,c,this])}return d}toSorted(b){return new a([...this.entries()].sort(b))}toReversed(){let b=new a;for(let a=this.size-1;a>=0;a--){let c=this.keyAt(a),d=this.get(c);b.set(c,d)}return b}toSpliced(...b){let c=[...this.entries()];return c.splice(...b),new a(c)}slice(b,c){let d=new a,e=this.size-1;if(void 0===b)return d;b<0&&(b+=this.size),void 0!==c&&c>0&&(e=c-1);for(let a=b;a<=e;a++){let b=this.keyAt(a),c=this.get(b);d.set(b,c)}return d}every(a,b){let c=0;for(let d of this){if(!Reflect.apply(a,b,[d,c,this]))return!1;c++}return!0}some(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return!0;c++}return!1}};function s(a,b){if("at"in Array.prototype)return Array.prototype.at.call(a,b);let c=t(a,b);return -1===c?void 0:a[c]}function t(a,b){let c=a.length,d=u(b),e=d>=0?d:c+d;return e<0||e>=c?-1:e}function u(a){return a!=a||0===a?0:Math.trunc(a)}function w(a,b){if(a===b)return!0;if("object"!=typeof a||"object"!=typeof b||null==a||null==b)return!1;let c=Object.keys(a),d=Object.keys(b);if(c.length!==d.length)return!1;for(let d of c)if(!Object.prototype.hasOwnProperty.call(b,d)||a[d]!==b[d])return!1;return!0}function x(a,b){return!!(b.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_PRECEDING)}function y(a,b){return a[1].element&&b[1].element?x(a[1].element,b[1].element)?-1:1:0}function z(a){return new MutationObserver(b=>{for(let c of b)if("childList"===c.type)return void a()})}o(s,"at"),o(t,"toSafeIndex"),o(u,"toSafeInteger"),o(function(a){let b=a+"CollectionProvider",[c,e]=(0,k.A)(b),[g,h]=c(b,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new r,setItemMap:o(()=>void 0,"setItemMap")}),i=o(({state:a,...b})=>a?(0,d.jsx)(n,{...b,state:a}):(0,d.jsx)(j,{...b}),"CollectionProvider");i.displayName=b;let j=o(a=>{let b=A();return(0,d.jsx)(n,{...a,state:b})},"CollectionInit");j.displayName=b+"Init";let n=o(a=>{let{scope:b,children:c,state:e}=a,h=f.useRef(null),[i,j]=f.useState(null),k=(0,l.s)(h,j),[m,n]=e;return f.useEffect(()=>{if(!i)return;let a=z(()=>{});return a.observe(i,{childList:!0,subtree:!0}),()=>{a.disconnect()}},[i]),(0,d.jsx)(g,{scope:b,itemMap:m,setItemMap:n,collectionRef:k,collectionRefObject:h,collectionElement:i,children:c})},"CollectionProviderImpl");n.displayName=b+"Impl";let p=a+"CollectionSlot",q=(0,m.TL)(p),s=f.forwardRef((a,b)=>{let{scope:c,children:e}=a,f=h(p,c),g=(0,l.s)(b,f.collectionRef);return(0,d.jsx)(q,{ref:g,children:e})});s.displayName=p;let t=a+"CollectionItemSlot",u=(0,m.TL)(t),x=f.forwardRef((a,b)=>{let{scope:c,children:e,...g}=a,i=f.useRef(null),[j,k]=f.useState(null),m=(0,l.s)(b,i,k),{setItemMap:n}=h(t,c),o=f.useRef(g);w(o.current,g)||(o.current=g);let p=o.current;return f.useEffect(()=>(n(a=>j?a.has(j)?a.set(j,{...p,element:j}).toSorted(y):(a.set(j,{...p,element:j}),a.toSorted(y)):a),()=>{n(a=>j&&a.has(j)?(a.delete(j),new r(a)):a)}),[j,p,n]),(0,d.jsx)(u,{"data-radix-collection-item":"",ref:m,children:e})});function A(){return f.useState(new r)}function B(b){let{itemMap:c}=h(a+"CollectionConsumer",b);return c}return x.displayName=t,o(A,"useInitCollection"),o(B,"useCollection"),[{Provider:i,Slot:s,ItemSlot:x},{createCollectionScope:e,useCollection:B,useInitCollection:A}]},"createCollection"),o(w,"shallowEqual"),o(x,"isElementPreceding"),o(y,"sortByDocumentPosition"),o(z,"getChildListObserver");var A=c(95270),B=c(52742),C=c(28510),D=c(58817),E=c(70931),F=c(69524),G=Object.defineProperty,H=(a,b)=>G(a,"name",{value:b,configurable:!0}),I=!1;function J(){let[a,b]=f.useState(I);return f.useEffect(()=>{I||(I=!0,b(!0))},[]),a}H(J,"useIsHydrated");var K=g[" useSyncExternalStore ".trim().toString()];function L(){return()=>{}}function M(){return K(L,()=>!0,()=>!1)}H(L,"subscribe"),H(M,"useIsHydratedModern");var N="function"==typeof K?M:J,O=Object.defineProperty,P=(a,b)=>O(a,"name",{value:b,configurable:!0}),Q="rovingFocusGroup.onEntryFocus",R={bubbles:!1,cancelable:!0},S="RovingFocusGroup",[T,U,V]=p(S),[W,X]=(0,k.A)(S,[V]),Y={Vertical:"vertical",Horizontal:"horizontal"},Z={RTL:"rtl"},[$,_]=W(S),aa=f.forwardRef(P(function(a,b){return(0,d.jsx)(T.Provider,{scope:a.__scopeRovingFocusGroup,children:(0,d.jsx)(T.Slot,{scope:a.__scopeRovingFocusGroup,children:(0,d.jsx)(ab,{...a,ref:b})})})},"RovingFocusGroup")),ab=f.forwardRef(P(function(a,b){let{__scopeRovingFocusGroup:c,orientation:e,loop:g=!1,dir:h,currentTabStopId:i,defaultCurrentTabStopId:k,onCurrentTabStopIdChange:m,onEntryFocus:n,preventScrollOnEntryFocus:o=!1,...p}=a,q=f.useRef(null),r=(0,l.s)(b,q),s=(0,E.jH)(h),[t,u]=(0,D.i)({prop:i,defaultProp:k??null,onChange:m,caller:S}),[w,x]=f.useState(!1),y=(0,C.c)(n),z=U(c),A=f.useRef(!1),[F,G]=f.useState(0);return f.useEffect(()=>{let a=q.current;if(a)return a.addEventListener(Q,y),()=>a.removeEventListener(Q,y)},[y]),(0,d.jsx)($,{scope:c,orientation:e,dir:s,loop:g,currentTabStopId:t,onItemFocus:f.useCallback(a=>u(a),[u]),onItemShiftTab:f.useCallback(()=>x(!0),[]),onFocusableItemAdd:f.useCallback(()=>G(a=>a+1),[]),onFocusableItemRemove:f.useCallback(()=>G(a=>a-1),[]),children:(0,d.jsx)(B.sG.div,{tabIndex:w||0===F?-1:0,"data-orientation":e,...p,ref:r,style:{outline:"none",...a.style},onMouseDown:(0,j.mK)(a.onMouseDown,()=>{A.current=!0}),onFocus:(0,j.mK)(a.onFocus,a=>{let b=!A.current;if(a.target===a.currentTarget&&b&&!w){let b=new CustomEvent(Q,R);if(a.currentTarget.dispatchEvent(b),!b.defaultPrevented){let a=z().filter(a=>a.focusable);ag([a.find(a=>a.active),a.find(a=>a.id===t),...a].filter(Boolean).map(a=>a.ref.current),o)}}A.current=!1}),onBlur:(0,j.mK)(a.onBlur,()=>x(!1))})})},"RovingFocusGroupImpl")),ac=f.forwardRef(P(function(a,b){let{__scopeRovingFocusGroup:c,focusable:e=!0,active:g=!1,tabStopId:h,children:i,...k}=a,l=(0,A.B)(),m=h||l,n=_("RovingFocusGroupItem",c),o=n.currentTabStopId===m,p=U(c),{onFocusableItemAdd:q,onFocusableItemRemove:r,currentTabStopId:s}=n,t=N();return(0,F.N)(()=>{if(t&&e)return q(),()=>r()},[t,e,q,r]),f.useEffect(()=>{if(!t&&e)return q(),()=>r()},[t,e,q,r]),(0,d.jsx)(T.ItemSlot,{scope:c,id:m,focusable:e,active:g,children:(0,d.jsx)(B.sG.span,{tabIndex:o?0:-1,"data-orientation":n.orientation,...k,ref:b,onMouseDown:(0,j.mK)(a.onMouseDown,a=>{e?n.onItemFocus(m):a.preventDefault()}),onFocus:(0,j.mK)(a.onFocus,()=>n.onItemFocus(m)),onKeyDown:(0,j.mK)(a.onKeyDown,a=>{if("Tab"===a.key&&a.shiftKey)return void n.onItemShiftTab();if(a.target!==a.currentTarget)return;let b=af(a,n.orientation,n.dir);if(void 0!==b){if(a.metaKey||a.ctrlKey||a.altKey||a.shiftKey)return;a.preventDefault();let c=p().filter(a=>a.focusable).map(a=>a.ref.current);if("last"===b)c.reverse();else if("prev"===b||"next"===b){"prev"===b&&c.reverse();let d=c.indexOf(a.currentTarget);c=n.loop?ah(c,d+1):c.slice(d+1)}setTimeout(()=>ag(c))}}),children:"function"==typeof i?i({isCurrentTabStop:o,hasTabStop:null!=s}):i})})},"RovingFocusGroupItem")),ad={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ae(a,b){return b!==Z.RTL?a:"ArrowLeft"===a?"ArrowRight":"ArrowRight"===a?"ArrowLeft":a}function af(a,b,c){let d=ae(a.key,c);if(!(b===Y.Vertical&&["ArrowLeft","ArrowRight"].includes(d))&&!(b===Y.Horizontal&&["ArrowUp","ArrowDown"].includes(d)))return ad[d]}function ag(a,b=!1){let c=document.activeElement;for(let d of a)if(d===c||(d.focus({preventScroll:b}),document.activeElement!==c))return}function ah(a,b){return a.map((c,d)=>a[(b+d)%a.length])}P(ae,"getDirectionAwareKey"),P(af,"getFocusIntent"),P(ag,"focusFirst"),P(ah,"wrapArray");var ai=c(7173),aj=Object.defineProperty,ak=(a,b)=>aj(a,"name",{value:b,configurable:!0}),al={Automatic:"automatic",Manual:"manual"},am="Tabs",[an,ao]=(0,k.A)(am,[X]),ap=X(),[aq,ar]=an(am),as=f.forwardRef(ak(function(a,b){let{__scopeTabs:c,value:e,onValueChange:f,defaultValue:g,orientation:h="horizontal",dir:i,activationMode:j=al.Automatic,...k}=a,l=(0,E.jH)(i),[m,n]=(0,D.i)({prop:e,onChange:f,defaultProp:g??"",caller:am});return(0,d.jsx)(aq,{scope:c,baseId:(0,A.B)(),value:m,onValueChange:n,orientation:h,dir:l,activationMode:j,children:(0,d.jsx)(B.sG.div,{dir:l,"data-orientation":h,...k,ref:b})})},"Tabs")),at=f.forwardRef(ak(function(a,b){let{__scopeTabs:c,loop:e=!0,...f}=a,g=ar("TabsList",c),h=ap(c);return(0,d.jsx)(aa,{asChild:!0,...h,orientation:g.orientation,dir:g.dir,loop:e,children:(0,d.jsx)(B.sG.div,{role:"tablist","aria-orientation":g.orientation,...f,ref:b})})},"TabsList")),au=f.forwardRef(ak(function(a,b){let{__scopeTabs:c,value:e,disabled:f=!1,...g}=a,h=ar("TabsTrigger",c),i=ap(c),k=aw(h.baseId,e),l=ax(h.baseId,e),m=e===h.value;return(0,d.jsx)(ac,{asChild:!0,...i,focusable:!f,active:m,children:(0,d.jsx)(B.sG.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":l,"data-state":m?"active":"inactive","data-disabled":f?"":void 0,disabled:f,id:k,...g,ref:b,onMouseDown:(0,j.mK)(a.onMouseDown,a=>{f||0!==a.button||!1!==a.ctrlKey?a.preventDefault():(a.currentTarget.focus(),h.onValueChange(e))}),onKeyDown:(0,j.mK)(a.onKeyDown,a=>{!f&&a.target===a.currentTarget&&[" ","Enter"].includes(a.key)&&h.onValueChange(e)}),onFocus:(0,j.mK)(a.onFocus,()=>{let a=h.activationMode!==al.Manual;m||f||!a||h.onValueChange(e)})})})},"TabsTrigger")),av=f.forwardRef(ak(function(a,b){let{__scopeTabs:c,value:e,forceMount:g,children:h,...i}=a,j=ar("TabsContent",c),k=aw(j.baseId,e),l=ax(j.baseId,e),m=e===j.value,n=f.useRef(m);return f.useEffect(()=>{let a=requestAnimationFrame(()=>n.current=!1);return()=>cancelAnimationFrame(a)},[]),(0,d.jsx)(ai.C,{present:g||m,children:({present:c})=>(0,d.jsx)(B.sG.div,{"data-state":m?"active":"inactive","data-orientation":j.orientation,role:"tabpanel","aria-labelledby":k,hidden:!c,id:l,tabIndex:0,...i,ref:b,style:{...a.style,animationDuration:n.current?"0s":void 0},children:c&&h})})},"TabsContent"));function aw(a,b){return`${a}-trigger-${b}`}function ax(a,b){return`${a}-content-${b}`}ak(aw,"makeTriggerId"),ak(ax,"makeContentId");var ay=c(49560),az=c(8940);let aA=new Map,aB=(0,f.createContext)(null);function aC({ref:a,groupId:b,persist:c=!1,updateAnchor:e=!1,defaultValue:g,value:h,onValueChange:i,...j}){let k=(0,f.useRef)(null),[l,m]=void 0===h?(0,f.useState)(g):[h,i??(()=>void 0)];(0,az.J)(a=>m(a));let n=(0,f.useMemo)(()=>new Map,[]);return(0,d.jsx)(as,{ref:(0,ay.P)(a,k),value:l,onValueChange:a=>{if(e){let b=n.get(a);b&&window.history.replaceState(null,"",`#${b}`)}b?(aA.get(b)?.forEach(b=>{b(a)}),c?localStorage.setItem(b,a):sessionStorage.setItem(b,a)):m(a)},...j,children:(0,d.jsx)(aB.Provider,{value:(0,f.useMemo)(()=>({valueToIdMap:n}),[n]),children:j.children})})}function aD({value:a,...b}){let{valueToIdMap:c}=function(){let a=(0,f.useContext)(aB);if(!a)throw Error("You must wrap your component in <Tabs>");return a}();return b.id&&c.set(a,b.id),(0,d.jsx)(av,{value:a,...b,children:b.children})}let aE=(0,f.createContext)(null);function aF(a){return(0,d.jsx)("pre",{...a,className:(0,h.QP)("min-w-full w-max *:flex *:flex-col",a.className),children:a.children})}function aG({ref:a,title:b,allowCopy:c=!0,keepBackground:e=!1,icon:g,viewportProps:i={},children:j,Actions:k=a=>(0,d.jsx)("div",{...a,className:(0,h.QP)("empty:hidden",a.className)}),...l}){let m=null!==(0,f.useContext)(aE),n=(0,f.useRef)(null);return(0,d.jsxs)("figure",{ref:a,dir:"ltr",...l,className:(0,h.QP)(m?"bg-fd-secondary -mx-px -mb-px last:rounded-b-xl":"my-4 bg-fd-card rounded-xl",e&&"bg-(--shiki-light-bg) dark:bg-(--shiki-dark-bg)","shiki relative border shadow-sm outline-none not-prose overflow-hidden text-sm",l.className),children:[b?(0,d.jsxs)("div",{className:"flex text-fd-muted-foreground items-center gap-2 h-9.5 border-b px-4",children:["string"==typeof g?(0,d.jsx)("div",{className:"[&_svg]:size-3.5",dangerouslySetInnerHTML:{__html:g}}):g,(0,d.jsx)("figcaption",{className:"flex-1 truncate",children:b}),k({className:"-me-2",children:c&&(0,d.jsx)(aH,{containerRef:n})})]}):k({className:"absolute top-2 right-2 z-2 backdrop-blur-lg rounded-lg text-fd-muted-foreground",children:c&&(0,d.jsx)(aH,{containerRef:n})}),(0,d.jsx)("div",{ref:n,...i,className:(0,h.QP)("text-[13px] py-3.5 overflow-auto max-h-[600px] fd-scroll-container",i.className),style:{"--padding-right":b?void 0:"calc(var(--spacing) * 8)",counterSet:l["data-line-numbers"]?`line ${Number(l["data-line-numbers-start"]??1)-1}`:void 0,...i.style},children:j})]})}function aH({className:a,containerRef:b,...c}){let[g,j]=function(a){let[b,c]=(0,f.useState)(!1),d=(0,f.useRef)(a),e=(0,f.useRef)(null);return d.current=a,[b,(0,f.useCallback)(()=>{e.current&&window.clearTimeout(e.current),Promise.resolve(d.current()).then(()=>{c(!0),e.current=window.setTimeout(()=>{c(!1)},1500)})},[])]}(()=>{let a=b.current?.getElementsByTagName("pre").item(0);if(!a)return;let c=a.cloneNode(!0);c.querySelectorAll(".nd-copy-ignore").forEach(a=>{a.replaceWith("\n")}),navigator.clipboard.writeText(c.textContent??"")});return(0,d.jsx)("button",{type:"button","data-checked":g||void 0,className:(0,h.QP)((0,i.r)({className:"hover:text-fd-accent-foreground data-[checked]:text-fd-accent-foreground",size:"icon-xs"}),a),"aria-label":g?"Copied Text":"Copy Text",onClick:j,...c,children:g?(0,d.jsx)(e.Jl,{}):(0,d.jsx)(e.B0,{})})}function aI({ref:a,...b}){let c=(0,f.useRef)(null),e=null!==(0,f.useContext)(aE);return(0,d.jsx)(aC,{ref:(0,ay.P)(c,a),...b,className:(0,h.QP)("bg-fd-card rounded-xl border",!e&&"my-4",b.className),children:(0,d.jsx)(aE.Provider,{value:(0,f.useMemo)(()=>({containerRef:c,nested:e}),[e]),children:b.children})})}function aJ(a){return(0,d.jsx)(at,{...a,className:(0,h.QP)("flex flex-row px-2 overflow-x-auto text-fd-muted-foreground",a.className),children:a.children})}function aK({children:a,...b}){return(0,d.jsxs)(au,{...b,className:(0,h.QP)("relative group inline-flex text-sm font-medium text-nowrap items-center transition-colors gap-2 px-2 py-1.5 hover:text-fd-accent-foreground data-[state=active]:text-fd-primary [&_svg]:size-3.5",b.className),children:[(0,d.jsx)("div",{className:"absolute inset-x-2 bottom-0 h-px group-data-[state=active]:bg-fd-primary"}),a]})}function aL(a){return(0,d.jsx)(aD,{...a})}},62684:(a,b,c)=>{"use strict";c.d(b,{CodeBlock:()=>f,CodeBlockTab:()=>j,CodeBlockTabs:()=>g,CodeBlockTabsList:()=>h,CodeBlockTabsTrigger:()=>i,Pre:()=>e});var d=c(71935);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call Pre() from the server but Pre is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/codeblock.js","Pre"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call CodeBlock() from the server but CodeBlock is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/codeblock.js","CodeBlock"),g=(0,d.registerClientReference)(function(){throw Error("Attempted to call CodeBlockTabs() from the server but CodeBlockTabs is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/codeblock.js","CodeBlockTabs"),h=(0,d.registerClientReference)(function(){throw Error("Attempted to call CodeBlockTabsList() from the server but CodeBlockTabsList is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/codeblock.js","CodeBlockTabsList"),i=(0,d.registerClientReference)(function(){throw Error("Attempted to call CodeBlockTabsTrigger() from the server but CodeBlockTabsTrigger is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/codeblock.js","CodeBlockTabsTrigger"),j=(0,d.registerClientReference)(function(){throw Error("Attempted to call CodeBlockTab() from the server but CodeBlockTab is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/codeblock.js","CodeBlockTab")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63617:(a,b,c)=>{"use strict";c.d(b,{default:()=>l});var d=c(5009),e=c(68388),f=c(78820),g=c(17265),h=c(76756),i=c(82425),j=c(49560),k=c(38002);function l({ref:a,className:b,...c}){let e=(0,f.useRef)(null),l=(0,i.a)(),{text:n}=(0,k.useI18n)(),[o,p]=(0,f.useState)();return 0===l.length?(0,d.jsx)("div",{className:"rounded-lg border bg-fd-card p-3 text-xs text-fd-muted-foreground",children:n.tocNoHeadings}):(0,d.jsxs)(d.Fragment,{children:[o?(0,d.jsx)("div",{className:"absolute start-0 top-0 rtl:-scale-x-100",style:{width:o.width,height:o.height,maskImage:`url("data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${o.width} ${o.height}"><path d="${o.path}" stroke="black" stroke-width="1" fill="none" /></svg>`)}")`},children:(0,d.jsx)(h.j,{containerRef:e,className:"mt-(--fd-top) h-(--fd-height) bg-fd-primary transition-all"})}):null,(0,d.jsx)("div",{ref:(0,j.P)(e,a),className:(0,g.QP)("flex flex-col",b),...c,children:l.map((a,b)=>(0,d.jsx)(m,{item:a,upper:l[b-1]?.depth,lower:l[b+1]?.depth},a.url))})]})}function m({item:a,upper:b=a.depth,lower:c=a.depth}){var f;let h=10*(a.depth>=3),i=10*(b>=3);return(0,d.jsxs)(e.Cz,{href:a.url,style:{paddingInlineStart:(f=a.depth)<=2?14:3===f?26:36},className:"prose relative py-1.5 text-sm text-fd-muted-foreground hover:text-fd-accent-foreground transition-colors [overflow-wrap:anywhere] first:pt-0 last:pb-0 data-[active=true]:text-fd-primary",children:[h!==i?(0,d.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",className:"absolute -top-1.5 start-0 size-4 rtl:-scale-x-100",children:(0,d.jsx)("line",{x1:i,y1:"0",x2:h,y2:"12",className:"stroke-fd-foreground/10",strokeWidth:"1"})}):null,(0,d.jsx)("div",{className:(0,g.QP)("absolute inset-y-0 w-px bg-fd-foreground/10",h!==i&&"top-1.5",h!==10*(c>=3)&&"bottom-1.5"),style:{insetInlineStart:h}}),a.title]})}},68171:(a,b,c)=>{Promise.resolve().then(c.bind(c,2098)),Promise.resolve().then(c.bind(c,7288)),Promise.resolve().then(c.bind(c,83854)),Promise.resolve().then(c.bind(c,18)),Promise.resolve().then(c.bind(c,22353)),Promise.resolve().then(c.bind(c,38629)),Promise.resolve().then(c.bind(c,26706)),Promise.resolve().then(c.bind(c,14992)),Promise.resolve().then(c.bind(c,44518)),Promise.resolve().then(c.bind(c,84368))},68388:(a,b,c)=>{"use strict";c.d(b,{Cz:()=>n,Mf:()=>k,N2:()=>l,NQ:()=>m,R3:()=>j});var d=c(53370);c(8566);var e=c(78820),f=c(35175),g=c(5009),h=(0,e.createContext)([]),i=(0,e.createContext)({current:null});function j(){return(0,e.useContext)(h).at(-1)}function k(){return(0,e.useContext)(h)}function l({containerRef:a,children:b}){return(0,g.jsx)(i.Provider,{value:a,children:b})}function m({toc:a,single:b=!0,children:c}){return(0,e.useMemo)(()=>a.map(a=>a.url.split("#")[1]),[a]),(0,g.jsx)(h.Provider,{value:function(a,b){let[c,d]=(0,e.useState)([]);return b?c.slice(0,1):c}(0,b),children:c})}var n=(0,e.forwardRef)(({onActiveChange:a,...b},c)=>{let h=(0,e.useContext)(i),j=k(),l=(0,e.useRef)(null),m=function(...a){return b=>{a.forEach(a=>{"function"==typeof a?a(b):null!==a&&(a.current=b)})}}(l,c),n=j.includes(b.href.slice(1));return(0,d.T)(n,b=>{let c=l.current;c&&(b&&h.current&&(0,f.A)(c,{behavior:"smooth",block:"center",inline:"center",scrollMode:"always",boundary:h.current}),a?.(b))}),(0,g.jsx)("a",{ref:m,"data-active":n,...b,children:b.children})});n.displayName="TOCItem"},69212:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>g});var d=c(40624),e=c(78820),f=c(5009),g=(0,e.forwardRef)(({href:a="#",external:b=a.match(/^\w+:/)||a.startsWith("//"),prefetch:c,...e},g)=>b?(0,f.jsx)("a",{ref:g,href:a,rel:"noreferrer noopener",target:"_blank",...e,children:e.children}):(0,f.jsx)(d.N_,{ref:g,href:a,prefetch:c,...e}));g.displayName="Link",c(8566)},71586:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>F,generateMetadata:()=>H,generateStaticParams:()=>G});var d=c(40239);c(95980);var e=c(2098),f=c(25475);require("node:path");var g=c(70986),h=c(10723),i=c(47031),j=c(35396),k=c(45400),l=c(77183),m=c(10035);function n(a){return(0,d.jsxs)("h3",{...a,className:(0,f.QP)("inline-flex items-center gap-1.5 text-sm text-fd-muted-foreground",a.className),children:[(0,d.jsx)(i.EY,{className:"size-4"}),(0,d.jsx)(j.I18nLabel,{label:"toc"})]})}function o({variant:a="normal",...b}){return(0,d.jsx)(l.TOCScrollArea,{...b,children:"clerk"===a?(0,d.jsx)(m.default,{}):(0,d.jsx)(l.TOCItems,{})})}function p({variant:a="normal",...b}){return(0,d.jsx)(l.TOCScrollArea,{...b,children:"clerk"===a?(0,d.jsx)(m.default,{}):(0,d.jsx)(l.TOCItems,{})})}function q(a){return(0,d.jsx)("article",{...a,className:(0,f.QP)("flex min-w-0 w-full flex-col gap-4 pt-8 px-4 md:px-6 md:mx-auto",a.className),children:a.children})}function r({toc:a=!1,children:b,...c}){let e=(0,d.jsx)("div",{id:"nd-page",...c,className:(0,f.QP)("flex flex-1 w-full mx-auto max-w-(--fd-page-width) pt-(--fd-tocnav-height) pe-(--fd-toc-width)",c.className),children:b});return a?(0,d.jsx)(l.TOCProvider,{...a,children:e}):e}function s({editOnGithub:a,breadcrumb:{enabled:b=!0,component:c,...e}={},footer:g={},lastUpdate:h,container:i,full:j=!1,tableOfContentPopover:{enabled:l,component:m,...s}={},tableOfContent:{enabled:u,component:w,...x}={},toc:y=[],article:z,children:A}){return u??(u=!j&&(y.length>0||void 0!==x.footer||void 0!==x.header)),l??(l=y.length>0||void 0!==s.header||void 0!==s.footer),(0,d.jsxs)(r,{toc:(!!u||!!l)&&{toc:y,single:x.single},...i,className:(0,f.QP)(!u&&"[--fd-toc-width:0px]",i?.className),children:[l&&(m??(0,d.jsxs)(k.PageTOCPopover,{children:[(0,d.jsx)(k.PageTOCPopoverTrigger,{}),(0,d.jsxs)(k.PageTOCPopoverContent,{children:[s.header,(0,d.jsx)(p,{variant:s.style}),s.footer]})]})),(0,d.jsxs)(q,{...z,children:[b&&(c??(0,d.jsx)(k.PageBreadcrumb,{...e})),A,(0,d.jsxs)("div",{className:"flex flex-row flex-wrap items-center justify-between gap-4 empty:hidden",children:[a&&(0,d.jsx)(t,{href:`https://github.com/${a.owner}/${a.repo}/blob/${a.sha}/${a.path.startsWith("/")?a.path.slice(1):a.path}`}),h&&(0,d.jsx)(k.PageLastUpdate,{date:new Date(h)})]}),!1!==g.enabled&&(g.component??(0,d.jsx)(k.PageFooter,{items:g.items}))]}),u&&(w??(0,d.jsxs)(k.PageTOC,{children:[x.header,(0,d.jsx)(n,{}),(0,d.jsx)(o,{variant:x.style}),x.footer]}))]})}function t(a){return(0,d.jsx)("a",{target:"_blank",rel:"noreferrer noopener",...a,className:(0,f.QP)((0,h.r)({color:"secondary",size:"sm",className:"gap-1.5 not-prose"}),a.className),children:a.children??(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(i.ff,{className:"size-3.5"}),(0,d.jsx)(j.I18nLabel,{label:"editOnGithub"})]})})}let u=(0,g.forwardRef)((a,b)=>(0,d.jsx)("div",{ref:b,...a,className:(0,f.QP)("prose flex-1",a.className),children:a.children}));u.displayName="DocsBody",(0,g.forwardRef)((a,b)=>void 0===a.children?null:(0,d.jsx)("p",{ref:b,...a,className:(0,f.QP)("mb-8 text-lg text-fd-muted-foreground",a.className),children:a.children})).displayName="DocsDescription";let w=(0,g.forwardRef)((a,b)=>(0,d.jsx)("h1",{ref:b,...a,className:(0,f.QP)("text-[1.75em] font-semibold",a.className),children:a.children}));w.displayName="DocsTitle";var x=c(2282),y=c(35241),z=c(19671);let A="size-5 -me-0.5 fill-(--callout-color) text-fd-card",B=(0,g.forwardRef)(({className:a,children:b,title:c,type:e="info",icon:g,...h},j)=>("warn"===e&&(e="warning"),"tip"===e&&(e="info"),(0,d.jsxs)("div",{ref:j,className:(0,f.QP)("flex gap-2 my-4 rounded-xl border bg-fd-card p-3 ps-1 text-sm text-fd-card-foreground shadow-md",a),...h,style:{"--callout-color":`var(--color-fd-${e}, var(--color-fd-muted))`,...h.style},children:[(0,d.jsx)("div",{role:"none",className:"w-0.5 bg-(--callout-color)/50 rounded-sm"}),g??({info:(0,d.jsx)(i.R2,{className:A}),warning:(0,d.jsx)(i.lW,{className:A}),error:(0,d.jsx)(i.RT,{className:A}),success:(0,d.jsx)(i.rW,{className:A})})[e],(0,d.jsxs)("div",{className:"flex flex-col gap-2 min-w-0 flex-1",children:[c&&(0,d.jsx)("p",{className:"font-medium !my-0",children:c}),(0,d.jsx)("div",{className:"text-fd-muted-foreground prose-no-margin empty:hidden",children:b})]})]})));function C({as:a,className:b,...c}){let e=a??"h1";return c.id?(0,d.jsxs)(e,{className:(0,f.QP)("flex scroll-m-28 flex-row items-center gap-2",b),...c,children:[(0,d.jsx)("a",{"data-card":"",href:`#${c.id}`,className:"peer",children:c.children}),(0,d.jsx)(i.N_,{"aria-label":"Link to section",className:"size-3.5 shrink-0 text-fd-muted-foreground opacity-0 transition-opacity peer-hover:opacity-100"})]}):(0,d.jsx)(e,{className:b,...c})}B.displayName="Callout";var D=c(62684);let E={CodeBlockTab:D.CodeBlockTab,CodeBlockTabs:D.CodeBlockTabs,CodeBlockTabsList:D.CodeBlockTabsList,CodeBlockTabsTrigger:D.CodeBlockTabsTrigger,pre:a=>(0,d.jsx)(D.CodeBlock,{...a,children:(0,d.jsx)(D.Pre,{children:a.children})}),Card:function({icon:a,title:b,description:c,...g}){let h=g.href?e.default:"div";return(0,d.jsxs)(h,{...g,"data-card":!0,className:(0,f.QP)("block rounded-xl border bg-fd-card p-4 text-fd-card-foreground transition-colors @max-lg:col-span-full",g.href&&"hover:bg-fd-accent/80",g.className),children:[a?(0,d.jsx)("div",{className:"not-prose mb-2 w-fit shadow-md rounded-lg border bg-fd-muted p-1.5 text-fd-muted-foreground [&_svg]:size-4",children:a}):null,(0,d.jsx)("h3",{className:"not-prose mb-1 text-sm font-medium",children:b}),c?(0,d.jsx)("p",{className:"!my-0 text-sm text-fd-muted-foreground",children:c}):null,(0,d.jsx)("div",{className:"text-sm text-fd-muted-foreground prose-no-margin empty:hidden",children:g.children})]})},Cards:function(a){return(0,d.jsx)("div",{...a,className:(0,f.QP)("grid grid-cols-2 gap-3 @container",a.className),children:a.children})},a:e.default,img:function(a){return(0,d.jsx)(z.Image,{sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px",...a,src:a.src,className:(0,f.QP)("rounded-lg",a.className)})},h1:a=>(0,d.jsx)(C,{as:"h1",...a}),h2:a=>(0,d.jsx)(C,{as:"h2",...a}),h3:a=>(0,d.jsx)(C,{as:"h3",...a}),h4:a=>(0,d.jsx)(C,{as:"h4",...a}),h5:a=>(0,d.jsx)(C,{as:"h5",...a}),h6:a=>(0,d.jsx)(C,{as:"h6",...a}),table:function(a){return(0,d.jsx)("div",{className:"relative overflow-auto prose-no-margin my-6",children:(0,d.jsx)("table",{...a})})},Callout:B};async function F({params:a}){let b=y.s.getPage((await a).slug);b||(0,x.notFound)();let c=b.data.body;return(0,d.jsxs)(s,{toc:b.data.toc,children:[(0,d.jsx)(w,{children:b.data.title}),(0,d.jsx)(u,{children:(0,d.jsx)(c,{components:E})})]})}function G(){return y.s.generateParams()}async function H({params:a}){let b=y.s.getPage((await a).slug);return b||(0,x.notFound)(),{title:b.data.title}}},74768:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GlobalError:()=>G.a,__next_app__:()=>M,handler:()=>O,pages:()=>L,routeModule:()=>N,tree:()=>K});var d=c(51854),e=c(47977),f=c(82526),g=c(64046),h=c(66271),i=c(95797),j=c(93213),k=c(66500),l=c(30725),m=c(24405),n=c(15823),o=c(93821),p=c(41403),q=c(63980),r=c(50346),s=c(57831),t=c(261),u=c(72558),w=c(74435),x=c(26713),y=c(96415),z=c(49132),A=c(72544),B=c(76977),C=c(88695),D=c(89533),E=c(86439),F=c(87811),G=c.n(F),H=c(74943),I=c(31454),J={};for(let a in H)0>["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(a)&&(J[a]=()=>H[a]);c.d(b,J);let K={children:["",{children:["docs",{children:["[[...slug]]",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,71586)),"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/apps/docs/app/docs/[[...slug]]/page.tsx"]}]},{}]},{layout:[()=>Promise.resolve().then(c.bind(c,29440)),"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/apps/docs/app/docs/layout.tsx"]}]},{layout:[()=>Promise.resolve().then(c.bind(c,56043)),"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/apps/docs/app/layout.tsx"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,87811,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,22539,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,33230,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,15977,23)),"next/dist/client/components/builtin/unauthorized.js"]}]}.children,L=["/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/apps/docs/app/docs/[[...slug]]/page.tsx"],M={require:c,loadChunk:()=>Promise.resolve()},N=new e.AppPageRouteModule({definition:{kind:f.RouteKind.APP_PAGE,page:"/docs/[[...slug]]/page",pathname:"/docs/[[...slug]]",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:K},distDir:".next",relativeProjectDir:""});async function O(a,b,e){var F;let J="/docs/[[...slug]]/page";"/index"===J&&(J="/");let P=(0,i.getRequestMeta)(a,"postponed"),Q=(0,i.getRequestMeta)(a,"minimalMode"),R=await N.prepare(a,b,{srcPage:J,multiZoneDraftMode:!1});if(!R)return b.statusCode=400,b.end("Bad Request"),null==e.waitUntil||e.waitUntil.call(e,Promise.resolve()),null;let{buildId:S,query:T,params:U,parsedUrl:V,pageIsDynamic:W,buildManifest:X,nextFontManifest:Y,reactLoadableManifest:Z,serverActionsManifest:$,clientReferenceManifest:_,subresourceIntegrityManifest:aa,prerenderManifest:ab,isDraftMode:ac,resolvedPathname:ad,revalidateOnlyGenerated:ae,routerServerContext:af,nextConfig:ag,interceptionRoutePatterns:ah}=R,ai=V.pathname||"/",aj=(0,t.normalizeAppPath)(J),{isOnDemandRevalidate:ak}=R,al=N.match(ai,ab),am=!!ab.routes[ad]&&(N.isDev||(0,d.isRouteCacheOwner)(ad,N.cacheOwner,ab.routes[ad])),an=!!(al||am||ab.routes[aj]),ao=a.headers["user-agent"]||"",ap=(0,x.getBotType)(ao),aq=(0,r.isHtmlBotRequest)(a),ar=(0,i.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[w.NEXT_ROUTER_PREFETCH_HEADER],as=(0,i.getRequestMeta)(a,"isRSCRequest")??(0,o.f)(a.headers[w.RSC_HEADER]),at=(0,u.getIsPossibleServerAction)(a),au=(0,n.checkIsAppPPREnabled)(ag.experimental.ppr)&&(null==(F=ab.routes[aj]??ab.dynamicRoutes[aj])?void 0:F.renderingMode)==="PARTIALLY_STATIC",av=!1,aw=!1,ax=au?P:void 0,ay=au&&as&&!ar,az=(0,i.getRequestMeta)(a,"segmentPrefetchRSCRequest"),aA=!ao||(0,r.shouldServeStreamingMetadata)(ao,ag.htmlLimitedBots);aq&&au&&(an=!1,aA=!1);let aB=!0===N.isDev||!an||"string"==typeof P||ay,aC=aq&&au,aD=null;ac||!an||aB||at||ax||ay||(aD=ad);let aE=aD;!aE&&N.isDev&&(aE=ad),N.isDev||ac||!an||!as||ay||(0,l.d)(a.headers);let aF={...H,tree:K,pages:L,GlobalError:G(),handler:O,routeModule:N,__next_app__:M};$&&_&&(0,q.setReferenceManifestsSingleton)({page:J,clientReferenceManifest:_,serverActionsManifest:$,serverModuleMap:(0,s.createServerModuleMap)({serverActionsManifest:$})});let aG=a.method||"GET",aH=(0,h.getTracer)(),aI=aH.getActiveScopeSpan();try{let d=N.getVaryHeader(ad,ah);b.setHeader("Vary",d);let g=async(c,d)=>{let e=new m.NodeNextRequest(a),f=new m.NodeNextResponse(b);return N.render(e,f,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=aH.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==j.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${aG} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${aG} ${a.url}`)})},l=async({span:d,postponed:f,fallbackRouteParams:h})=>{let j={query:T,params:U,page:aj,sharedContext:{buildId:S},serverComponentsHmrCache:(0,i.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:h,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aF,Component:(0,k.T)(aF),params:U,routeModule:N,page:J,postponed:f,shouldWaitOnAllReady:aC,serveStreamingMetadata:aA,supportsDynamicResponse:"string"==typeof f||aB,buildManifest:X,nextFontManifest:Y,reactLoadableManifest:Z,subresourceIntegrityManifest:aa,serverActionsManifest:$,clientReferenceManifest:_,setIsrStatus:null==af?void 0:af.setIsrStatus,dir:c(33873).join(process.cwd(),N.relativeProjectDir),isDraftMode:ac,isRevalidate:an&&!f&&!ay,botType:ap,isOnDemandRevalidate:ak,isPossibleServerAction:at,assetPrefix:ag.assetPrefix,nextConfigOutput:ag.output,crossOrigin:ag.crossOrigin,trailingSlash:ag.trailingSlash,previewProps:ab.preview,deploymentId:ag.deploymentId,enableTainting:ag.experimental.taint,htmlLimitedBots:ag.htmlLimitedBots,devtoolSegmentExplorer:ag.experimental.devtoolSegmentExplorer,reactMaxHeadersLength:ag.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:(0,i.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:ag.experimental.cacheLife,basePath:ag.basePath,serverActions:ag.experimental.serverActions,...av?{nextExport:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isRevalidate:!0,isDebugDynamicAccesses:av}:{},experimental:{isRoutePPREnabled:au,expireTime:ag.expireTime,staleTimes:ag.experimental.staleTimes,cacheComponents:!!ag.experimental.cacheComponents,clientSegmentCache:!!ag.experimental.clientSegmentCache,clientParamParsing:!!ag.experimental.clientParamParsing,dynamicOnHover:!!ag.experimental.dynamicOnHover,inlineCss:!!ag.experimental.inlineCss,authInterrupts:!!ag.experimental.authInterrupts,clientTraceMetadata:ag.experimental.clientTraceMetadata||[]},waitUntil:e.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d)=>N.onRequestError(a,b,d,af),err:(0,i.getRequestMeta)(a,"invokeError"),dev:N.isDev}},l=await g(d,j),{metadata:m}=l,{cacheControl:n,headers:o={},fetchTags:p}=m;if(p&&(o[B.NEXT_CACHE_TAGS_HEADER]=p),a.fetchMetrics=m.fetchMetrics,an&&(null==n?void 0:n.revalidate)===0&&!N.isDev&&!au){let a=m.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${ad}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""}
1
+ (()=>{var a={};a.id=870,a.ids=[870],a.modules={18:(a,b,c)=>{"use strict";c.d(b,{LargeSearchToggle:()=>f,SearchToggle:()=>e});var d=c(71935);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call SearchToggle() from the server but SearchToggle is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/search-toggle.js","SearchToggle"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call LargeSearchToggle() from the server but LargeSearchToggle is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/search-toggle.js","LargeSearchToggle")},261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},2098:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(71935).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-core@15.8.5_@types+react@19.3.0_lucide-react@0.460.0_react@19.3.0__next@15.5.27_@ope_6xxqcdvlb45ebkbm63neggmvbi/node_modules/fumadocs-core/dist/link.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-core@15.8.5_@types+react@19.3.0_lucide-react@0.460.0_react@19.3.0__next@15.5.27_@ope_6xxqcdvlb45ebkbm63neggmvbi/node_modules/fumadocs-core/dist/link.js","default")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},7288:(a,b,c)=>{"use strict";c.d(b,{LanguageToggle:()=>e,LanguageToggleText:()=>f});var d=c(71935);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call LanguageToggle() from the server but LanguageToggle is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/language-toggle.js","LanguageToggle"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call LanguageToggleText() from the server but LanguageToggleText is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/language-toggle.js","LanguageToggleText")},10035:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(71935).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/toc-clerk.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/toc-clerk.js","default")},10723:(a,b,c)=>{"use strict";c.d(b,{r:()=>g});let d=a=>"boolean"==typeof a?`${a}`:0===a?"0":a,e=function(){for(var a,b,c=0,d="",e=arguments.length;c<e;c++)(a=arguments[c])&&(b=function a(b){var c,d,e="";if("string"==typeof b||"number"==typeof b)e+=b;else if("object"==typeof b)if(Array.isArray(b)){var f=b.length;for(c=0;c<f;c++)b[c]&&(d=a(b[c]))&&(e&&(e+=" "),e+=d)}else for(d in b)b[d]&&(e&&(e+=" "),e+=d);return e}(a))&&(d&&(d+=" "),d+=b);return d},f={primary:"bg-fd-primary text-fd-primary-foreground hover:bg-fd-primary/80",outline:"border hover:bg-fd-accent hover:text-fd-accent-foreground",ghost:"hover:bg-fd-accent hover:text-fd-accent-foreground",secondary:"border bg-fd-secondary text-fd-secondary-foreground hover:bg-fd-accent hover:text-fd-accent-foreground"},g=((a,b)=>c=>{var f;if((null==b?void 0:b.variants)==null)return e(a,null==c?void 0:c.class,null==c?void 0:c.className);let{variants:g,defaultVariants:h}=b,i=Object.keys(g).map(a=>{let b=null==c?void 0:c[a],e=null==h?void 0:h[a];if(null===b)return null;let f=d(b)||d(e);return g[a][f]}),j=c&&Object.entries(c).reduce((a,b)=>{let[c,d]=b;return void 0===d||(a[c]=d),a},{});return e(a,i,null==b||null==(f=b.compoundVariants)?void 0:f.reduce((a,b)=>{let{class:c,className:d,...e}=b;return Object.entries(e).every(a=>{let[b,c]=a;return Array.isArray(c)?c.includes({...h,...j}[b]):({...h,...j})[b]===c})?[...a,c,d]:a},[]),null==c?void 0:c.class,null==c?void 0:c.className)})("inline-flex items-center justify-center rounded-md p-2 text-sm font-medium transition-colors duration-100 disabled:pointer-events-none disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fd-ring",{variants:{variant:f,color:f,size:{sm:"gap-1 px-2 py-1.5 text-xs",icon:"p-1.5 [&_svg]:size-5","icon-sm":"p-1.5 [&_svg]:size-4.5","icon-xs":"p-1 [&_svg]:size-4"}}})},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14495:(a,b,c)=>{"use strict";c.d(b,{Nt:()=>C,Ke:()=>E,R6:()=>D});var d=c(5009),e=c(78820),f=c(84335),g=c(26227),h=c(58817),i=c(69524),j=c(3411),k=c(52742),l=c(7173),m=c(95270),n=Object.defineProperty,o=(a,b)=>n(a,"name",{value:b,configurable:!0}),p="Collapsible",[q,r]=(0,g.A)(p),[s,t]=q(p),u=e.forwardRef(o(function(a,b){let{__scopeCollapsible:c,open:f,defaultOpen:g,disabled:i,onOpenChange:j,...l}=a,[n,o]=(0,h.i)({prop:f,defaultProp:g??!1,onChange:j,caller:p});return(0,d.jsx)(s,{scope:c,disabled:i,contentId:(0,m.B)(),open:n,onOpenToggle:e.useCallback(()=>o(a=>!a),[o]),children:(0,d.jsx)(k.sG.div,{"data-state":A(n),"data-disabled":i?"":void 0,...l,ref:b})})},"Collapsible")),w=e.forwardRef(o(function(a,b){let{__scopeCollapsible:c,...e}=a,g=t("CollapsibleTrigger",c);return(0,d.jsx)(k.sG.button,{type:"button","aria-controls":g.open?g.contentId:void 0,"aria-expanded":g.open||!1,"data-state":A(g.open),"data-disabled":g.disabled?"":void 0,disabled:g.disabled,...e,ref:b,onClick:(0,f.mK)(a.onClick,g.onOpenToggle)})},"CollapsibleTrigger")),x="CollapsibleContent",y=e.forwardRef(o(function(a,b){let{forceMount:c,...e}=a,f=t(x,a.__scopeCollapsible);return(0,d.jsx)(l.C,{present:c||f.open,children:({present:a})=>(0,d.jsx)(z,{...e,ref:b,present:a})})},"CollapsibleContent")),z=e.forwardRef(o(function(a,b){let{__scopeCollapsible:c,present:f,children:g,...h}=a,l=t(x,c),[m,n]=e.useState(f),o=e.useRef(null),p=(0,j.s)(b,o),q=e.useRef(0),r=q.current,s=e.useRef(0),u=s.current,w=l.open||m,y=e.useRef(w),z=e.useRef(void 0);return e.useEffect(()=>{let a=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(a)},[]),(0,i.N)(()=>{let a=o.current;if(a){z.current=z.current||{transitionDuration:a.style.transitionDuration,animationName:a.style.animationName},a.style.transitionDuration="0s",a.style.animationName="none";let b=a.getBoundingClientRect();q.current=b.height,s.current=b.width,y.current||(a.style.transitionDuration=z.current.transitionDuration,a.style.animationName=z.current.animationName),n(f)}},[l.open,f]),(0,d.jsx)(k.sG.div,{"data-state":A(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!w,...h,ref:p,style:{"--radix-collapsible-content-height":r?`${r}px`:void 0,"--radix-collapsible-content-width":u?`${u}px`:void 0,...a.style},children:w&&g})},"CollapsibleContentImpl"));function A(a){return a?"open":"closed"}o(A,"getState");var B=c(17265);let C=u,D=w,E=(0,e.forwardRef)(({children:a,...b},c)=>{let[f,g]=(0,e.useState)(!1);return(0,e.useEffect)(()=>{g(!0)},[]),(0,d.jsx)(y,{ref:c,...b,className:(0,B.QP)("overflow-hidden",f&&"data-[state=closed]:animate-fd-collapsible-up data-[state=open]:animate-fd-collapsible-down",b.className),children:a})});E.displayName=y.displayName},14992:(a,b,c)=>{"use strict";c.d(b,{TreeContextProvider:()=>e});var d=c(71935);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call TreeContextProvider() from the server but TreeContextProvider is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/contexts/tree.js","TreeContextProvider");(0,d.registerClientReference)(function(){throw Error("Attempted to call useTreePath() from the server but useTreePath is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/contexts/tree.js","useTreePath"),(0,d.registerClientReference)(function(){throw Error("Attempted to call useTreeContext() from the server but useTreeContext is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/contexts/tree.js","useTreeContext")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},19671:(a,b,c)=>{"use strict";c.d(b,{Image:()=>e});var d=c(71935);(0,d.registerClientReference)(function(){throw Error("Attempted to call FrameworkProvider() from the server but FrameworkProvider is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-core@15.8.5_@types+react@19.3.0_lucide-react@0.460.0_react@19.3.0__next@15.5.27_@ope_6xxqcdvlb45ebkbm63neggmvbi/node_modules/fumadocs-core/dist/framework/index.js","FrameworkProvider");let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call Image() from the server but Image is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-core@15.8.5_@types+react@19.3.0_lucide-react@0.460.0_react@19.3.0__next@15.5.27_@ope_6xxqcdvlb45ebkbm63neggmvbi/node_modules/fumadocs-core/dist/framework/index.js","Image");(0,d.registerClientReference)(function(){throw Error("Attempted to call Link() from the server but Link is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-core@15.8.5_@types+react@19.3.0_lucide-react@0.460.0_react@19.3.0__next@15.5.27_@ope_6xxqcdvlb45ebkbm63neggmvbi/node_modules/fumadocs-core/dist/framework/index.js","Link"),(0,d.registerClientReference)(function(){throw Error("Attempted to call createContext() from the server but createContext is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-core@15.8.5_@types+react@19.3.0_lucide-react@0.460.0_react@19.3.0__next@15.5.27_@ope_6xxqcdvlb45ebkbm63neggmvbi/node_modules/fumadocs-core/dist/framework/index.js","createContext"),(0,d.registerClientReference)(function(){throw Error("Attempted to call useParams() from the server but useParams is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-core@15.8.5_@types+react@19.3.0_lucide-react@0.460.0_react@19.3.0__next@15.5.27_@ope_6xxqcdvlb45ebkbm63neggmvbi/node_modules/fumadocs-core/dist/framework/index.js","useParams"),(0,d.registerClientReference)(function(){throw Error("Attempted to call usePathname() from the server but usePathname is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-core@15.8.5_@types+react@19.3.0_lucide-react@0.460.0_react@19.3.0__next@15.5.27_@ope_6xxqcdvlb45ebkbm63neggmvbi/node_modules/fumadocs-core/dist/framework/index.js","usePathname"),(0,d.registerClientReference)(function(){throw Error("Attempted to call useRouter() from the server but useRouter is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-core@15.8.5_@types+react@19.3.0_lucide-react@0.460.0_react@19.3.0__next@15.5.27_@ope_6xxqcdvlb45ebkbm63neggmvbi/node_modules/fumadocs-core/dist/framework/index.js","useRouter")},19758:(a,b,c)=>{Promise.resolve().then(c.bind(c,54309)),Promise.resolve().then(c.bind(c,69212)),Promise.resolve().then(c.bind(c,60441)),Promise.resolve().then(c.bind(c,63617)),Promise.resolve().then(c.bind(c,82425)),Promise.resolve().then(c.bind(c,38002)),Promise.resolve().then(c.bind(c,53842))},19847:(a,b,c)=>{"use strict";c.d(b,{ThemeToggle:()=>l});var d=c(5009),e=c(79386),f=c(97469),g=c(47577),h=c(78820),i=c(17265);let j=(0,e.F)("size-6.5 rounded-full p-1.5 text-fd-muted-foreground",{variants:{active:{true:"bg-fd-accent text-fd-accent-foreground",false:"text-fd-muted-foreground"}}}),k=[["light",f.bd],["dark",f.AX],["system",f.$3]];function l({className:a,mode:b="light-dark",...c}){let{setTheme:e,theme:f,resolvedTheme:l}=(0,g.D)(),[m,n]=(0,h.useState)(!1),o=(0,i.QP)("inline-flex items-center rounded-full border p-1",a);if("light-dark"===b){let a=m?l:null;return(0,d.jsx)("button",{className:o,"aria-label":"Toggle Theme",onClick:()=>e("light"===a?"dark":"light"),"data-theme-toggle":"",...c,children:k.map(([b,c])=>{if("system"!==b)return(0,d.jsx)(c,{fill:"currentColor",className:(0,i.QP)(j({active:a===b}))},b)})})}let p=m?f:null;return(0,d.jsx)("div",{className:o,"data-theme-toggle":"",...c,children:k.map(([a,b])=>(0,d.jsx)("button",{"aria-label":a,className:(0,i.QP)(j({active:p===a})),onClick:()=>e(a),children:(0,d.jsx)(b,{className:"size-full",fill:"currentColor"})},a))})}},19998:(a,b,c)=>{"use strict";c.d(b,{Sidebar:()=>ax,SidebarCollapseTrigger:()=>aK,SidebarContent:()=>ay,SidebarContentMobile:()=>az,SidebarFolder:()=>aF,SidebarFolderContent:()=>aI,SidebarFolderLink:()=>aH,SidebarFolderTrigger:()=>aG,SidebarFooter:()=>aB,SidebarHeader:()=>aA,SidebarItem:()=>aE,SidebarPageTree:()=>aN,SidebarTrigger:()=>aJ,SidebarViewport:()=>aC});var d=c(5009),e=c(97469),f=c(54309),g=c(78820),h=c(69212),i=c(18442),j=c(17265),k=c(52742),l=c(7173),m=c(14069),n=c(26227),o=c(3411),p=c(28510),q=c(70931),r=c(69524);function s(a,[b,c]){return Math.min(c,Math.max(b,a))}(0,Object.defineProperty)(s,"name",{value:"clamp",configurable:!0});var t=c(84335),u=c(97478),w=Object.defineProperty,x=(a,b)=>w(a,"name",{value:b,configurable:!0});function y(a,b){return g.useReducer((a,c)=>b[a][c]??a,a)}x(y,"useStateMachine");var z={Auto:"auto",Always:"always",Scroll:"scroll",Hover:"hover"},A={Vertical:"vertical",Horizontal:"horizontal"},B={LTR:"ltr",RTL:"rtl"},C="ScrollArea",[D,E]=(0,n.A)(C),[F,G]=D(C),H=g.forwardRef(x(function(a,b){let{__scopeScrollArea:c,type:e=z.Hover,dir:f,scrollHideDelay:h=600,...i}=a,[j,l]=g.useState(null),[m,n]=g.useState(null),[p,r]=g.useState(null),[s,t]=g.useState(null),[u,w]=g.useState(null),[x,y]=g.useState(0),[A,B]=g.useState(0),[C,D]=g.useState(!1),[E,G]=g.useState(!1),H=(0,o.s)(b,l),I=(0,q.jH)(f);return(0,d.jsx)(F,{scope:c,type:e,dir:I,scrollHideDelay:h,scrollArea:j,viewport:m,onViewportChange:n,content:p,onContentChange:r,scrollbarX:s,onScrollbarXChange:t,scrollbarXEnabled:C,onScrollbarXEnabledChange:D,scrollbarY:u,onScrollbarYChange:w,scrollbarYEnabled:E,onScrollbarYEnabledChange:G,onCornerWidthChange:y,onCornerHeightChange:B,children:(0,d.jsx)(k.sG.div,{dir:I,...i,ref:H,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":A+"px",...a.style}})})},"ScrollArea")),I="ScrollAreaViewport",J=(0,m.Dc)(I),K=g.forwardRef(x(function(a,b){let{__scopeScrollArea:c,children:e,nonce:f,disableImplicitContentElement:h,...i}=a,j=G(I,c),l=g.useRef(null),m=(0,o.s)(b,l,j.onViewportChange),n=g.isValidElement(e);if(u.D){let b=g.useRef(!1),c=!0===a.asChild&&!h&&!n;g.useEffect(()=>{c&&!b.current&&(b.current=!0,console.warn(`${I}: \`asChild\` expects a single React element child, so its props have been applied to the implicitly rendered content element instead. Wrap the children in a single element, or opt into \`disableImplicitContentElement\` and render a \`ScrollArea.Content\` inside the viewport.`))},[c])}return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(L,{nonce:f}),(0,d.jsx)(k.sG.div,{"data-radix-scroll-area-viewport":"",...i,ref:m,style:{overflowX:j.scrollbarXEnabled?"scroll":"hidden",overflowY:j.scrollbarYEnabled?"scroll":"hidden",...a.style},children:h?e:n?(0,d.jsx)(J,{child:e,children:a=>(0,d.jsx)(M,{__scopeScrollArea:c,children:a})}):(0,d.jsx)(J,{children:(0,d.jsx)(M,{__scopeScrollArea:c,children:e})})})]})},"ScrollAreaViewport")),L=g.memo(x(function({nonce:a}){return(0,d.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a})},"ScrollAreaViewportStyle"),(a,b)=>a.nonce===b.nonce),M=g.forwardRef(x(function(a,b){let{__scopeScrollArea:c,children:e,...f}=a,g=G("ScrollAreaContent",c),h=(0,o.s)(b,g.onContentChange);return(0,d.jsx)(k.sG.div,{...f,ref:h,style:{minWidth:"100%",display:"table",...a.style},children:e})},"ScrollAreaContent")),N="ScrollAreaScrollbar",O=g.forwardRef(x(function(a,b){let{forceMount:c,...e}=a,f=G(N,a.__scopeScrollArea),{onScrollbarXEnabledChange:h,onScrollbarYEnabledChange:i}=f,j=a.orientation===A.Horizontal;return g.useEffect(()=>(j?h(!0):i(!0),()=>{j?h(!1):i(!1)}),[j,h,i]),f.type===z.Hover?(0,d.jsx)(P,{...e,ref:b,forceMount:c}):f.type===z.Scroll?(0,d.jsx)(Q,{...e,ref:b,forceMount:c}):f.type===z.Auto?(0,d.jsx)(R,{...e,ref:b,forceMount:c}):f.type===z.Always?(0,d.jsx)(S,{...e,ref:b,"data-state":"visible"}):null},"ScrollAreaScrollbar")),P=g.forwardRef(x(function(a,b){let{forceMount:c,...e}=a,f=G(N,a.__scopeScrollArea),[h,i]=g.useState(!1);return g.useEffect(()=>{let a=f.scrollArea,b=0;if(a){let c=x(()=>{window.clearTimeout(b),i(!0)},"handlePointerEnter"),d=x(()=>{b=window.setTimeout(()=>i(!1),f.scrollHideDelay)},"handlePointerLeave");return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(b),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",d)}}},[f.scrollArea,f.scrollHideDelay]),(0,d.jsx)(l.C,{present:c||h,children:(0,d.jsx)(R,{"data-state":h?"visible":"hidden",...e,ref:b})})},"ScrollAreaScrollbarHover")),Q=g.forwardRef(x(function(a,b){let{forceMount:c,...e}=a,f=G(N,a.__scopeScrollArea),h=a.orientation===A.Horizontal,i=ak(()=>k("SCROLL_END"),100),[j,k]=y("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return g.useEffect(()=>{if("idle"===j){let a=window.setTimeout(()=>k("HIDE"),f.scrollHideDelay);return()=>window.clearTimeout(a)}},[j,f.scrollHideDelay,k]),g.useEffect(()=>{let a=f.viewport,b=h?"scrollLeft":"scrollTop";if(a){let c=a[b],d=x(()=>{let d=a[b];c!==d&&(k("SCROLL"),i()),c=d},"handleScroll");return a.addEventListener("scroll",d),()=>a.removeEventListener("scroll",d)}},[f.viewport,h,k,i]),(0,d.jsx)(l.C,{present:c||"hidden"!==j,children:(0,d.jsx)(S,{"data-state":"hidden"===j?"hidden":"visible",...e,ref:b,onPointerEnter:(0,t.mK)(a.onPointerEnter,()=>k("POINTER_ENTER")),onPointerLeave:(0,t.mK)(a.onPointerLeave,()=>k("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),R=g.forwardRef(x(function(a,b){let c=G(N,a.__scopeScrollArea),{forceMount:e,...f}=a,[h,i]=g.useState(!1),j=a.orientation===A.Horizontal,k=ak(()=>{if(c.viewport){let a=c.viewport.offsetWidth<c.viewport.scrollWidth,b=c.viewport.offsetHeight<c.viewport.scrollHeight;i(j?a:b)}},10);return al(c.viewport,k),al(c.content,k),(0,d.jsx)(l.C,{present:e||h,children:(0,d.jsx)(S,{"data-state":h?"visible":"hidden",...f,ref:b})})},"ScrollAreaScrollbarAuto")),S=g.forwardRef(x(function(a,b){let{orientation:c=A.Vertical,...e}=a,f=G(N,a.__scopeScrollArea),h=g.useRef(null),i=g.useRef(0),[j,k]=g.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=ad(j.viewport,j.content),m={...e,sizes:j,onSizesChange:k,hasThumb:!!(l>0&&l<1),onThumbChange:x(a=>h.current=a,"onThumbChange"),onThumbPointerUp:x(()=>i.current=0,"onThumbPointerUp"),onThumbPointerDown:x(a=>i.current=a,"onThumbPointerDown")};function n(a,b){return af(a,i.current,j,b)}return(x(n,"getScrollPosition"),c===A.Horizontal)?(0,d.jsx)(T,{...m,ref:b,onThumbPositionChange:()=>{if(f.viewport&&h.current){let a=ag(f.viewport.scrollLeft,j,f.dir);h.current.style.transform=`translate3d(${a}px, 0, 0)`}},onWheelScroll:a=>{f.viewport&&(f.viewport.scrollLeft=a)},onDragScroll:a=>{f.viewport&&(f.viewport.scrollLeft=n(a,f.dir))}}):c===A.Vertical?(0,d.jsx)(U,{...m,ref:b,onThumbPositionChange:()=>{if(f.viewport&&h.current){let a=ag(f.viewport.scrollTop,j);h.current.style.transform=`translate3d(0, ${a}px, 0)`}},onWheelScroll:a=>{f.viewport&&(f.viewport.scrollTop=a)},onDragScroll:a=>{f.viewport&&(f.viewport.scrollTop=n(a))}}):null},"ScrollAreaScrollbarVisible")),T=g.forwardRef(x(function(a,b){let{sizes:c,onSizesChange:e,...f}=a,h=G(N,a.__scopeScrollArea),[i,j]=g.useState(),k=g.useRef(null),l=(0,o.s)(b,k,h.onScrollbarXChange);return g.useEffect(()=>{k.current&&j(getComputedStyle(k.current))},[k]),(0,d.jsx)(X,{"data-orientation":"horizontal",...f,ref:l,sizes:c,style:{bottom:0,left:h.dir===B.RTL?"var(--radix-scroll-area-corner-width)":0,right:h.dir===B.LTR?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ae(c)+"px",...a.style},onThumbPointerDown:b=>a.onThumbPointerDown(b.x),onDragScroll:b=>a.onDragScroll(b.x),onWheelScroll:(b,c)=>{if(h.viewport){let d=h.viewport.scrollLeft+b.deltaX;a.onWheelScroll(d),ai(d,c)&&b.preventDefault()}},onResize:()=>{k.current&&h.viewport&&i&&e({content:h.viewport.scrollWidth,viewport:h.viewport.offsetWidth,scrollbar:{size:k.current.clientWidth,paddingStart:ac(i.paddingLeft),paddingEnd:ac(i.paddingRight)}})}})},"ScrollAreaScrollbarX")),U=g.forwardRef(x(function(a,b){let{sizes:c,onSizesChange:e,...f}=a,h=G(N,a.__scopeScrollArea),[i,j]=g.useState(),k=g.useRef(null),l=(0,o.s)(b,k,h.onScrollbarYChange);return g.useEffect(()=>{k.current&&j(getComputedStyle(k.current))},[k]),(0,d.jsx)(X,{"data-orientation":"vertical",...f,ref:l,sizes:c,style:{top:0,right:h.dir===B.LTR?0:void 0,left:h.dir===B.RTL?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ae(c)+"px",...a.style},onThumbPointerDown:b=>a.onThumbPointerDown(b.y),onDragScroll:b=>a.onDragScroll(b.y),onWheelScroll:(b,c)=>{if(h.viewport){let d=h.viewport.scrollTop+b.deltaY;a.onWheelScroll(d),ai(d,c)&&b.preventDefault()}},onResize:()=>{k.current&&h.viewport&&i&&e({content:h.viewport.scrollHeight,viewport:h.viewport.offsetHeight,scrollbar:{size:k.current.clientHeight,paddingStart:ac(i.paddingTop),paddingEnd:ac(i.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[V,W]=D(N),X=g.forwardRef(x(function(a,b){let{__scopeScrollArea:c,sizes:e,hasThumb:f,onThumbChange:h,onThumbPointerUp:i,onThumbPointerDown:j,onThumbPositionChange:l,onDragScroll:m,onWheelScroll:n,onResize:q,...r}=a,s=G(N,c),[u,w]=g.useState(null),y=(0,o.s)(b,w),z=g.useRef(null),A=g.useRef(""),B=s.viewport,C=e.content-e.viewport,D=(0,p.c)(n),E=(0,p.c)(l),F=ak(q,10);function H(a){z.current&&m({x:a.clientX-z.current.left,y:a.clientY-z.current.top})}return x(H,"handleDragScroll"),g.useEffect(()=>{let a=x(a=>{let b=a.target;u?.contains(b)&&D(a,C)},"handleWheel");return document.addEventListener("wheel",a,{passive:!1}),()=>document.removeEventListener("wheel",a,{passive:!1})},[B,u,C,D]),g.useEffect(E,[e,E]),al(u,F),al(s.content,F),(0,d.jsx)(V,{scope:c,scrollbar:u,hasThumb:f,onThumbChange:(0,p.c)(h),onThumbPointerUp:(0,p.c)(i),onThumbPositionChange:E,onThumbPointerDown:(0,p.c)(j),children:(0,d.jsx)(k.sG.div,{...r,ref:y,style:{position:"absolute",...r.style},onPointerDown:(0,t.mK)(a.onPointerDown,a=>{0===a.button&&(a.target.setPointerCapture(a.pointerId),z.current=u.getBoundingClientRect(),A.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",s.viewport&&(s.viewport.style.scrollBehavior="auto"),H(a))}),onPointerMove:(0,t.mK)(a.onPointerMove,H),onPointerUp:(0,t.mK)(a.onPointerUp,a=>{let b=a.target;b.hasPointerCapture(a.pointerId)&&b.releasePointerCapture(a.pointerId),document.body.style.webkitUserSelect=A.current,s.viewport&&(s.viewport.style.scrollBehavior=""),z.current=null})})})},"ScrollAreaScrollbarImpl")),Y="ScrollAreaThumb",Z=g.forwardRef(x(function(a,b){let{forceMount:c,...e}=a,f=W(Y,a.__scopeScrollArea);return(0,d.jsx)(l.C,{present:c||f.hasThumb,children:(0,d.jsx)($,{ref:b,...e})})},"ScrollAreaThumb")),$=g.forwardRef(x(function(a,b){let{__scopeScrollArea:c,style:e,...f}=a,h=G(Y,c),i=W(Y,c),{onThumbPositionChange:j}=i,l=(0,o.s)(b,i.onThumbChange),m=g.useRef(void 0),n=ak(()=>{m.current&&(m.current(),m.current=void 0)},100);return g.useEffect(()=>{let a=h.viewport;if(a){let b=x(()=>{n(),m.current||(m.current=aj(a,j),j())},"handleScroll");return j(),a.addEventListener("scroll",b),()=>a.removeEventListener("scroll",b)}},[h.viewport,n,j]),(0,d.jsx)(k.sG.div,{"data-state":i.hasThumb?"visible":"hidden",...f,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...e},onPointerDownCapture:(0,t.mK)(a.onPointerDownCapture,a=>{let b=a.target.getBoundingClientRect(),c=a.clientX-b.left,d=a.clientY-b.top;i.onThumbPointerDown({x:c,y:d})}),onPointerUp:(0,t.mK)(a.onPointerUp,i.onThumbPointerUp)})},"ScrollAreaThumbImpl")),_="ScrollAreaCorner",aa=g.forwardRef(x(function(a,b){let c=G(_,a.__scopeScrollArea),e=!!(c.scrollbarX&&c.scrollbarY);return c.type!==z.Scroll&&e?(0,d.jsx)(ab,{...a,ref:b}):null},"ScrollAreaCorner")),ab=g.forwardRef(x(function(a,b){let{__scopeScrollArea:c,...e}=a,f=G(_,c),[h,i]=g.useState(0),[j,l]=g.useState(0),m=!!(h&&j),{onCornerWidthChange:n,onCornerHeightChange:o}=f;return al(f.scrollbarX,()=>{let a=f.scrollbarX?.offsetHeight||0;f.onCornerHeightChange(a),l(a)}),al(f.scrollbarY,()=>{let a=f.scrollbarY?.offsetWidth||0;f.onCornerWidthChange(a),i(a)}),g.useEffect(()=>()=>{n(0),o(0)},[n,o]),m?(0,d.jsx)(k.sG.div,{...e,ref:b,style:{width:h,height:j,position:"absolute",right:f.dir===B.LTR?0:void 0,left:f.dir===B.RTL?0:void 0,bottom:0,...a.style}}):null},"ScrollAreaCornerImpl"));function ac(a){return a?parseInt(a,10):0}function ad(a,b){let c=a/b;return isNaN(c)?0:c}function ae(a){let b=ad(a.viewport,a.content),c=a.scrollbar.paddingStart+a.scrollbar.paddingEnd;return Math.max((a.scrollbar.size-c)*b,18)}function af(a,b,c,d=B.LTR){let e=ae(c),f=b||e/2,g=c.scrollbar.paddingStart+f,h=c.scrollbar.size-c.scrollbar.paddingEnd-(e-f),i=c.content-c.viewport;return ah([g,h],d===B.LTR?[0,i]:[-1*i,0])(a)}function ag(a,b,c=B.LTR){let d=ae(b),e=b.scrollbar.paddingStart+b.scrollbar.paddingEnd,f=b.scrollbar.size-e,g=b.content-b.viewport,h=s(a,c===B.LTR?[0,g]:[-1*g,0]);return ah([0,g],[0,f-d])(h)}function ah(a,b){return c=>{if(a[0]===a[1]||b[0]===b[1])return b[0];let d=(b[1]-b[0])/(a[1]-a[0]);return b[0]+d*(c-a[0])}}function ai(a,b){return a>0&&a<b}x(ac,"toInt"),x(ad,"getThumbRatio"),x(ae,"getThumbSize"),x(af,"getScrollPositionFromPointer"),x(ag,"getThumbOffsetFromScroll"),x(ah,"linearScale"),x(ai,"isScrollingWithinScrollbarBounds");var aj=x((a,b=()=>{})=>(a.scrollLeft,a.scrollTop,()=>window.cancelAnimationFrame(0)),"addUnlinkedScrollListener");function ak(a,b){let c=(0,p.c)(a),d=g.useRef(0);return g.useEffect(()=>()=>window.clearTimeout(d.current),[]),g.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(c,b)},[c,b])}function al(a,b){let c=(0,p.c)(b);(0,r.N)(()=>{let b=0;if(a){let d=new ResizeObserver(()=>{cancelAnimationFrame(b),b=window.requestAnimationFrame(c)});return d.observe(a),()=>{window.cancelAnimationFrame(b),d.unobserve(a)}}},[a,c])}x(ak,"useDebounceCallback"),x(al,"useResizeObserver");let am=g.forwardRef(({className:a,children:b,...c},e)=>(0,d.jsxs)(H,{ref:e,type:"scroll",className:(0,j.QP)("overflow-hidden",a),...c,children:[b,(0,d.jsx)(aa,{}),(0,d.jsx)(ao,{orientation:"vertical"})]}));am.displayName=H.displayName;let an=g.forwardRef(({className:a,children:b,...c},e)=>(0,d.jsx)(K,{ref:e,className:(0,j.QP)("size-full rounded-[inherit]",a),...c,children:b}));an.displayName=K.displayName;let ao=g.forwardRef(({className:a,orientation:b="vertical",...c},e)=>(0,d.jsx)(O,{ref:e,orientation:b,className:(0,j.QP)("flex select-none data-[state=hidden]:animate-fd-fade-out","vertical"===b&&"h-full w-1.5","horizontal"===b&&"h-1.5 flex-col",a),...c,children:(0,d.jsx)(Z,{className:"relative flex-1 rounded-full bg-fd-border"})}));ao.displayName=O.displayName;var ap=c(59384),aq=c(14495),ar=c(85880),as=c(79386),at=c(47718);c(8566);let au=(0,as.F)("relative flex flex-row items-center gap-2 rounded-lg p-2 ps-(--sidebar-item-offset) text-start text-fd-muted-foreground [overflow-wrap:anywhere] [&_svg]:size-4 [&_svg]:shrink-0",{variants:{active:{true:"bg-fd-primary/10 text-fd-primary",false:"transition-colors hover:bg-fd-accent/50 hover:text-fd-accent-foreground/80 hover:transition-none"}}}),av=(0,g.createContext)(null),aw=(0,g.createContext)(null);function ax({defaultOpenLevel:a=0,prefetch:b=!0,Mobile:c,Content:e}){let f=function(a,b=!1){let[c,d]=(0,g.useState)(null);return(0,g.useEffect)(()=>{if(b)return;let c=window.matchMedia(a),e=()=>{d(c.matches)};return e(),c.addEventListener("change",e),()=>{c.removeEventListener("change",e)}},[b,a]),c}("(width < 768px)")??!1,h=(0,g.useMemo)(()=>({defaultOpenLevel:a,prefetch:b,level:1}),[a,b]);return(0,d.jsx)(av.Provider,{value:h,children:f&&null!=c?c:e})}function ay(a){let{collapsed:b}=(0,ar.c)(),[c,e]=(0,g.useState)(!1),f=(0,g.useRef)(0),h=(0,g.useRef)(0);return(0,i.T)(b,()=>{e(!1),h.current=Date.now()+150}),(0,d.jsx)("aside",{id:"nd-sidebar",...a,"data-collapsed":b,className:(0,j.QP)("fixed left-0 rtl:left-auto rtl:right-(--removed-body-scroll-bar-size,0) flex flex-col items-end top-(--fd-sidebar-top) bottom-(--fd-sidebar-margin) z-20 bg-fd-card text-sm border-e transition-[top,opacity,translate,width] duration-200 max-md:hidden *:w-(--fd-sidebar-width)",b&&["rounded-xl border translate-x-(--fd-sidebar-offset) rtl:-translate-x-(--fd-sidebar-offset)",c?"z-50 shadow-lg":"opacity-0"],a.className),style:{...a.style,"--fd-sidebar-offset":c?"calc(var(--spacing) * 2)":"calc(16px - 100%)","--fd-sidebar-margin":b?"0.5rem":"0px","--fd-sidebar-top":"calc(var(--fd-banner-height) + var(--fd-nav-height) + var(--fd-sidebar-margin))",width:b?"var(--fd-sidebar-width)":"calc(var(--spacing) + var(--fd-sidebar-width) + var(--fd-layout-offset))"},onPointerEnter:a=>{!b||"touch"===a.pointerType||h.current>Date.now()||(window.clearTimeout(f.current),e(!0))},onPointerLeave:a=>{b&&"touch"!==a.pointerType&&(window.clearTimeout(f.current),f.current=window.setTimeout(()=>{e(!1),h.current=Date.now()+150},Math.min(a.clientX,document.body.clientWidth-a.clientX)>100?0:500))},children:a.children})}function az({className:a,children:b,...c}){let{open:e,setOpen:f}=(0,ar.c)(),g=e?"open":"closed";return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(l.C,{present:e,children:(0,d.jsx)("div",{"data-state":g,className:"fixed z-40 inset-0 backdrop-blur-xs data-[state=open]:animate-fd-fade-in data-[state=closed]:animate-fd-fade-out",onClick:()=>f(!1)})}),(0,d.jsx)(l.C,{present:e,children:({present:e})=>(0,d.jsx)("aside",{id:"nd-sidebar-mobile",...c,"data-state":g,className:(0,j.QP)("fixed text-[15px] flex flex-col shadow-lg border-s end-0 inset-y-0 w-[85%] max-w-[380px] z-40 bg-fd-background data-[state=open]:animate-fd-sidebar-in data-[state=closed]:animate-fd-sidebar-out",!e&&"invisible",a),children:b})})]})}function aA(a){return(0,d.jsx)("div",{...a,className:(0,j.QP)("flex flex-col gap-3 p-4 pb-2",a.className),children:a.children})}function aB(a){return(0,d.jsx)("div",{...a,className:(0,j.QP)("flex flex-col border-t p-4 pt-2",a.className),children:a.children})}function aC(a){return(0,d.jsx)(am,{...a,className:(0,j.QP)("h-full",a.className),children:(0,d.jsx)(an,{className:"p-4 overscroll-contain",style:{"--sidebar-item-offset":"calc(var(--spacing) * 2)",maskImage:"linear-gradient(to bottom, transparent, white 12px, white calc(100% - 12px), transparent)"},children:a.children})})}function aD(a){return(0,d.jsx)("p",{...a,className:(0,j.QP)("inline-flex items-center gap-2 mb-1.5 px-2 ps-(--sidebar-item-offset) empty:mb-0 [&_svg]:size-4 [&_svg]:shrink-0",a.className),children:a.children})}function aE({icon:a,...b}){let c=(0,f.a8)(),g=void 0!==b.href&&(0,ap.$)(b.href,c,!1),{prefetch:i}=aM();return(0,d.jsxs)(h.default,{...b,"data-active":g,className:(0,j.QP)(au({active:g}),b.className),prefetch:i,children:[a??(b.external?(0,d.jsx)(e.Gr,{}):null),b.children]})}function aF({defaultOpen:a=!1,...b}){let[c,e]=(0,g.useState)(a);return(0,i.T)(a,a=>{a&&e(a)}),(0,d.jsx)(aq.Nt,{open:c,onOpenChange:e,...b,children:(0,d.jsx)(aw.Provider,{value:(0,g.useMemo)(()=>({open:c,setOpen:e}),[c]),children:b.children})})}function aG({className:a,...b}){let{open:c}=aL();return(0,d.jsxs)(aq.R6,{className:(0,j.QP)(au({active:!1}),"w-full",a),...b,children:[b.children,(0,d.jsx)(e.yQ,{"data-icon":!0,className:(0,j.QP)("ms-auto transition-transform",!c&&"-rotate-90")})]})}function aH(a){let{open:b,setOpen:c}=aL(),{prefetch:g}=aM(),i=(0,f.a8)(),k=void 0!==a.href&&(0,ap.$)(a.href,i,!1);return(0,d.jsxs)(h.default,{...a,"data-active":k,className:(0,j.QP)(au({active:k}),"w-full",a.className),onClick:a=>{a.target instanceof Element&&a.target.matches("[data-icon], [data-icon] *")?(c(!b),a.preventDefault()):c(!k||!b)},prefetch:g,children:[a.children,(0,d.jsx)(e.yQ,{"data-icon":!0,className:(0,j.QP)("ms-auto transition-transform",!b&&"-rotate-90")})]})}function aI(a){let{level:b,...c}=aM();return(0,d.jsx)(aq.Ke,{...a,className:(0,j.QP)("relative",1===b&&["before:content-[''] before:absolute before:w-px before:inset-y-1 before:bg-fd-border before:start-2.5","**:data-[active=true]:before:content-[''] **:data-[active=true]:before:bg-fd-primary **:data-[active=true]:before:absolute **:data-[active=true]:before:w-px **:data-[active=true]:before:inset-y-2.5 **:data-[active=true]:before:start-2.5"],a.className),style:{"--sidebar-item-offset":`calc(var(--spacing) * ${(b+1)*3})`,...a.style},children:(0,d.jsx)(av.Provider,{value:(0,g.useMemo)(()=>({...c,level:b+1}),[c,b]),children:a.children})})}function aJ({children:a,...b}){let{setOpen:c}=(0,ar.c)();return(0,d.jsx)("button",{...b,"aria-label":"Open Sidebar",onClick:()=>c(a=>!a),children:a})}function aK(a){let{collapsed:b,setCollapsed:c}=(0,ar.c)();return(0,d.jsx)("button",{type:"button","aria-label":"Collapse Sidebar","data-collapsed":b,...a,onClick:()=>{c(a=>!a)},children:a.children})}function aL(){let a=(0,g.useContext)(aw);if(!a)throw Error("Missing sidebar folder");return a}function aM(){let a=(0,g.useContext)(av);if(!a)throw Error("<Sidebar /> component required.");return a}function aN(a){let{root:b}=(0,at.t)();return(0,g.useMemo)(()=>{let{Separator:c,Item:e,Folder:f}=a.components??{};return(0,d.jsx)(g.Fragment,{children:function a(b,g){return b.map((b,h)=>{if("separator"===b.type)return c?(0,d.jsx)(c,{item:b},h):(0,d.jsxs)(aD,{className:(0,j.QP)(0!==h&&"mt-6"),children:[b.icon,b.name]},h);if("folder"===b.type){let c=a(b.children,g+1);return f?(0,d.jsx)(f,{item:b,level:g,children:c},h):(0,d.jsx)(aO,{item:b,children:c},h)}return e?(0,d.jsx)(e,{item:b},b.url):(0,d.jsx)(aE,{href:b.url,external:b.external,icon:b.icon,children:b.name},b.url)})}(b.children,1)},b.$id)},[a.components,b])}function aO({item:a,...b}){let{defaultOpenLevel:c,level:e}=aM(),f=(0,at.L)();return(0,d.jsxs)(aF,{defaultOpen:(a.defaultOpen??c>=e)||f.includes(a),children:[a.index?(0,d.jsxs)(aH,{href:a.index.url,external:a.index.external,...b,children:[a.icon,a.name]}):(0,d.jsxs)(aG,{...b,children:[a.icon,a.name]}),(0,d.jsx)(aI,{children:b.children})]})}},22353:(a,b,c)=>{"use strict";c.d(b,{Sidebar:()=>e,SidebarCollapseTrigger:()=>q,SidebarContent:()=>f,SidebarContentMobile:()=>g,SidebarFolder:()=>l,SidebarFolderContent:()=>o,SidebarFolderLink:()=>n,SidebarFolderTrigger:()=>m,SidebarFooter:()=>i,SidebarHeader:()=>h,SidebarItem:()=>k,SidebarPageTree:()=>r,SidebarTrigger:()=>p,SidebarViewport:()=>j});var d=c(71935);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call Sidebar() from the server but Sidebar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","Sidebar"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarContent() from the server but SidebarContent is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarContent"),g=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarContentMobile() from the server but SidebarContentMobile is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarContentMobile"),h=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarHeader() from the server but SidebarHeader is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarHeader"),i=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarFooter() from the server but SidebarFooter is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarFooter"),j=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarViewport() from the server but SidebarViewport is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarViewport");(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarSeparator() from the server but SidebarSeparator is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarSeparator");let k=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarItem() from the server but SidebarItem is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarItem"),l=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarFolder() from the server but SidebarFolder is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarFolder"),m=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarFolderTrigger() from the server but SidebarFolderTrigger is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarFolderTrigger"),n=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarFolderLink() from the server but SidebarFolderLink is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarFolderLink"),o=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarFolderContent() from the server but SidebarFolderContent is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarFolderContent"),p=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarTrigger() from the server but SidebarTrigger is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarTrigger"),q=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarCollapseTrigger() from the server but SidebarCollapseTrigger is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarCollapseTrigger"),r=(0,d.registerClientReference)(function(){throw Error("Attempted to call SidebarPageTree() from the server but SidebarPageTree is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/sidebar.js","SidebarPageTree")},23150:(a,b,c)=>{"use strict";c.d(b,{BaseLinkItem:()=>h});var d=c(5009),e=c(54309),f=c(59384),g=c(69212);function h({ref:a,item:b,...c}){let h=(0,e.a8)(),i=b.active??"url",j="none"!==i&&(0,f.$)(b.url,h,"nested-url"===i);return(0,d.jsx)(g.default,{ref:a,href:b.url,external:b.external,...c,"data-active":j,children:c.children})}},25475:(a,b,c)=>{"use strict";c.d(b,{QP:()=>ao});let d=(a=new Map,b=null,c)=>({nextPart:a,validators:b,classGroupId:c}),e=[],f=(a,b,c)=>{if(0==a.length-b)return c.classGroupId;let d=a[b],e=c.nextPart.get(d);if(e){let c=f(a,b+1,e);if(c)return c}let g=c.validators;if(null===g)return;let h=0===b?a.join("-"):a.slice(b).join("-"),i=g.length;for(let a=0;a<i;a++){let b=g[a];if(b.validator(h))return b.classGroupId}},g=(a,b)=>{let c=d();for(let d in a)h(a[d],c,d,b);return c},h=(a,b,c,d)=>{let e=a.length;for(let f=0;f<e;f++)i(a[f],b,c,d)},i=(a,b,c,d)=>"string"==typeof a?void j(a,b,c):"function"==typeof a?void k(a,b,c,d):void l(a,b,c,d),j=(a,b,c)=>{(""===a?b:m(b,a)).classGroupId=c},k=(a,b,c,d)=>{if(n(a))return void h(a(d),b,c,d);null===b.validators&&(b.validators=[]),b.validators.push({classGroupId:c,validator:a})},l=(a,b,c,d)=>{let e=Object.entries(a),f=e.length;for(let a=0;a<f;a++){let[f,g]=e[a];h(g,m(b,f),c,d)}},m=(a,b)=>{let c=a,e=b.split("-"),f=e.length;for(let a=0;a<f;a++){let b=e[a],f=c.nextPart.get(b);f||(f=d(),c.nextPart.set(b,f)),c=f}return c},n=a=>"isThemeGetter"in a&&!0===a.isThemeGetter,o=[],p=(a,b,c,d,e)=>({modifiers:a,hasImportantModifier:b,baseClassName:c,maybePostfixModifierPosition:d,isExternal:e}),q=/\s+/,r=a=>{let b;if("string"==typeof a)return a;let c="";for(let d=0;d<a.length;d++)a[d]&&(b=r(a[d]))&&(c&&(c+=" "),c+=b);return c},s=[],t=a=>{let b=b=>b[a]||s;return b.isThemeGetter=!0,b.themeKey=a,b},u=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,w=/^\((?:(\w[\w-]*):)?(.+)\)$/i,x=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,y=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,z=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,A=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,B=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,C=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,D=a=>x.test(a),E=a=>!!a&&!Number.isNaN(Number(a)),F=a=>!!a&&Number.isInteger(Number(a)),G=a=>a.endsWith("%")&&E(a.slice(0,-1)),H=a=>y.test(a),I=()=>!0,J=a=>z.test(a)&&!A.test(a),K=()=>!1,L=a=>B.test(a),M=a=>C.test(a),N=a=>!Q(a)&&!Y(a),O=a=>a.startsWith("@container")&&("/"===a[10]&&void 0!==a[11]||"s"===a[11]&&void 0!==a[16]&&a.startsWith("-size/",10)||"n"===a[11]&&void 0!==a[18]&&a.startsWith("-normal/",10)),P=a=>ae(a,ai,K),Q=a=>u.test(a),R=a=>ae(a,aj,J),S=a=>ae(a,ak,E),T=a=>ae(a,am,I),U=a=>ae(a,al,K),V=a=>ae(a,ag,K),W=a=>ae(a,ah,M),X=a=>ae(a,an,L),Y=a=>w.test(a),Z=a=>af(a,aj),$=a=>af(a,al),_=a=>af(a,ag),aa=a=>af(a,ai),ab=a=>af(a,ah),ac=a=>af(a,an,!0),ad=a=>af(a,am,!0),ae=(a,b,c)=>{let d=u.exec(a);return!!d&&(d[1]?b(d[1]):c(d[2]))},af=(a,b,c=!1)=>{let d=w.exec(a);return!!d&&(d[1]?b(d[1]):c)},ag=a=>"position"===a||"percentage"===a,ah=a=>"image"===a||"url"===a,ai=a=>"length"===a||"size"===a||"bg-size"===a,aj=a=>"length"===a,ak=a=>"number"===a,al=a=>"family-name"===a,am=a=>"number"===a||"weight"===a,an=a=>"shadow"===a;Symbol.toStringTag;let ao=((a,...b)=>{let c,d,h,i,j=a=>{let b=d(a);if(b)return b;let e=((a,b)=>{let{parseClassName:c,getClassGroupId:d,getConflictingClassGroupIds:e,sortModifiers:f,postfixLookupClassGroupIds:g}=b,h=[],i=a.trim().split(q),j="";for(let a=i.length-1;a>=0;a-=1){let b,k=i[a],{isExternal:l,modifiers:m,hasImportantModifier:n,baseClassName:o,maybePostfixModifierPosition:p}=c(k);if(l){j=k+(j.length>0?" "+j:j);continue}let q=!!p;if(q){let a=(b=d(o.substring(0,p)))&&g[b]?d(o):void 0;a&&a!==b&&(b=a,q=!1)}else b=d(o);if(!b){if(!q||!(b=d(o))){j=k+(j.length>0?" "+j:j);continue}q=!1}let r=0===m.length?"":1===m.length?m[0]:f(m).join(":"),s=n?r+"!":r,t=s+b;if(h.indexOf(t)>-1)continue;h.push(t);let u=e(b,q);for(let a=0;a<u.length;++a){let b=u[a];h.push(s+b)}j=k+(j.length>0?" "+j:j)}return j})(a,c);return h(a,e),e};return i=k=>(d=(c=(a=>({cache:(a=>{if(a<1)return{get:()=>void 0,set:()=>{}};let b=0,c=Object.create(null),d=Object.create(null),e=(e,f)=>{c[e]=f,++b>a&&(b=0,d=c,c=Object.create(null))};return{get(a){let b=c[a];return void 0!==b?b:void 0!==(b=d[a])?(e(a,b),b):void 0},set(a,b){a in c?c[a]=b:e(a,b)}}})(a.cacheSize),parseClassName:(a=>{let{prefix:b,experimentalParseClassName:c}=a,d=a=>{let b,c=[],d=0,e=0,f=0,g=a.length;for(let h=0;h<g;h++){let g=a[h];if(0===d&&0===e){if(":"===g){c.push(a.slice(f,h)),f=h+1;continue}if("/"===g){b=h;continue}}"["===g?d++:"]"===g?d--:"("===g?e++:")"===g&&e--}let h=0===c.length?a:a.slice(f),i=h,j=!1;return h.endsWith("!")?(i=h.slice(0,-1),j=!0):h.startsWith("!")&&(i=h.slice(1),j=!0),p(c,j,i,b&&b>f?b-f:void 0)};if(b){let a=b+":",c=d;d=b=>b.startsWith(a)?c(b.slice(a.length)):p(o,!1,b,void 0,!0)}if(c){let a=d;d=b=>c({className:b,parseClassName:a})}return d})(a),sortModifiers:(a=>{let b=new Map;return a.orderSensitiveModifiers.forEach((a,c)=>{b.set(a,1e6+c)}),a=>{let c=[],d=[];for(let e=0;e<a.length;e++){let f=a[e],g="["===f[0],h=b.has(f);g||h?(d.length>0&&(d.sort(),c.push(...d),d=[]),c.push(f)):d.push(f)}return d.length>0&&(d.sort(),c.push(...d)),c}})(a),postfixLookupClassGroupIds:(a=>{let b=Object.create(null),c=a.postfixLookupClassGroups;if(c)for(let a=0;a<c.length;a++)b[c[a]]=!0;return b})(a),...(a=>{let b=(a=>{let{theme:b,classGroups:c}=a;return g(c,b)})(a),{conflictingClassGroups:c,conflictingClassGroupModifiers:d}=a;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return(a=>-1===a.slice(1,-1).indexOf(":")?void 0:(()=>{let b=a.slice(1,-1),c=b.indexOf(":"),d=b.slice(0,c);return d?"arbitrary.."+d:void 0})())(a);let c=a.split("-"),d=+(""===c[0]&&c.length>1);return f(c,d,b)},getConflictingClassGroupIds:(a,b)=>{if(b){let b=d[a],f=c[a];return b?f?((a,b)=>{let c=Array(a.length+b.length);for(let b=0;b<a.length;b++)c[b]=a[b];for(let d=0;d<b.length;d++)c[a.length+d]=b[d];return c})(f,b):b:f||e}return c[a]||e}}})(a)}))(b.reduce((a,b)=>b(a),a()))).cache.get,h=c.cache.set,i=j,j(k)),(...a)=>i(((...a)=>{let b,c,d=0,e="";for(;d<a.length;)(b=a[d++])&&(c=r(b))&&(e&&(e+=" "),e+=c);return e})(...a))})(()=>{let a=t("color"),b=t("font"),c=t("text"),d=t("font-weight"),e=t("tracking"),f=t("leading"),g=t("breakpoint"),h=t("container"),i=t("spacing"),j=t("radius"),k=t("shadow"),l=t("inset-shadow"),m=t("text-shadow"),n=t("drop-shadow"),o=t("blur"),p=t("perspective"),q=t("aspect"),r=t("ease"),s=t("animate"),u=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],x=()=>[...w(),Y,Q],y=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],A=()=>[Y,Q,i],B=()=>[D,"full","auto",...A()],C=()=>[F,"none","subgrid",Y,Q],J=()=>["auto",{span:["full",F,Y,Q]},F,Y,Q],K=()=>[F,"auto",Y,Q],L=()=>["auto","min","max","fr",Y,Q],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ae=()=>["start","end","center","stretch","center-safe","end-safe"],af=()=>["auto",...A()],ag=()=>[D,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],ah=()=>[h,D,"screen","full","dvw","lvw","svw","min","max","fit",...A()],ai=()=>[D,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],aj=()=>[a,Y,Q],ak=()=>[...w(),_,V,{position:[Y,Q]}],al=()=>["no-repeat",{repeat:["","x","y","space","round"]}],am=()=>["auto","cover","contain",aa,P,{size:[Y,Q]}],an=()=>[G,Z,R],ao=()=>["","none","full",j,Y,Q],ap=()=>["",E,Z,R],aq=()=>["solid","dashed","dotted","double"],ar=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],as=()=>[E,G,_,V],at=()=>["","none",o,Y,Q],au=()=>["none",E,Y,Q],av=()=>["none",E,Y,Q],aw=()=>[E,Y,Q],ax=()=>[D,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[H],breakpoint:[H],color:[I],container:[H],"drop-shadow":[H],ease:["in","out","in-out"],font:[N],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[H],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[H],shadow:[H],spacing:["px",E],text:[H],"text-shadow":[H],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",D,Q,Y,q]}],container:["container"],"container-type":[{"@container":["","normal","size",Y,Q]}],"container-named":[O],columns:[{columns:[E,"auto",Q,Y,h]}],"break-after":[{"break-after":u()}],"break-before":[{"break-before":u()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:x()}],overflow:[{overflow:y()}],"overflow-x":[{"overflow-x":y()}],"overflow-y":[{"overflow-y":y()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{"inset-s":B(),start:B()}],end:[{"inset-e":B(),end:B()}],"inset-bs":[{"inset-bs":B()}],"inset-be":[{"inset-be":B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[F,"auto",Y,Q]}],basis:[{basis:[D,"full","auto",h,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[E,D,"auto","initial","none",Q]}],grow:[{grow:["",E,Y,Q]}],shrink:[{shrink:["",E,Y,Q]}],order:[{order:[F,"first","last","none",Y,Q]}],"grid-cols":[{"grid-cols":C()}],"col-start-end":[{col:J()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":C()}],"row-start-end":[{row:J()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":L()}],"auto-rows":[{"auto-rows":L()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...ae(),"normal"]}],"justify-self":[{"justify-self":["auto",...ae()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...ae(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ae(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...ae(),"baseline"]}],"place-self":[{"place-self":["auto",...ae()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:af()}],mx:[{mx:af()}],my:[{my:af()}],ms:[{ms:af()}],me:[{me:af()}],mbs:[{mbs:af()}],mbe:[{mbe:af()}],mt:[{mt:af()}],mr:[{mr:af()}],mb:[{mb:af()}],ml:[{ml:af()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:ag()}],"inline-size":[{inline:["auto",...ah()]}],"min-inline-size":[{"min-inline":["auto",...ah()]}],"max-inline-size":[{"max-inline":["none",...ah()]}],"block-size":[{block:["auto",...ai()]}],"min-block-size":[{"min-block":["auto",...ai()]}],"max-block-size":[{"max-block":["none",...ai()]}],w:[{w:[h,"screen",...ag()]}],"min-w":[{"min-w":[h,"screen","none",...ag()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[g]},...ag()]}],h:[{h:["screen","lh",...ag()]}],"min-h":[{"min-h":["screen","lh","none",...ag()]}],"max-h":[{"max-h":["screen","lh","none",...ag()]}],"font-size":[{text:["base",c,Z,R]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[d,ad,T]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",G,Q]}],"font-family":[{font:[$,U,b]}],"font-features":[{"font-features":[Q]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[e,Y,Q]}],"line-clamp":[{"line-clamp":[E,"none",Y,S]}],leading:[{leading:["none",f,...A()]}],"list-image":[{"list-image":["none",Y,Q]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Y,Q]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:aj()}],"text-color":[{text:aj()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...aq(),"wavy"]}],"text-decoration-thickness":[{decoration:[E,"from-font","auto",Y,R]}],"text-decoration-color":[{decoration:aj()}],"underline-offset":[{"underline-offset":[E,"auto",Y,Q]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"tab-size":[{tab:[F,Y,Q]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Y,Q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Y,Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ak()}],"bg-repeat":[{bg:al()}],"bg-size":[{bg:am()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},F,Y,Q],radial:["",Y,Q],conic:["",F,Y,Q]},ab,W]}],"bg-color":[{bg:aj()}],"gradient-from-pos":[{from:an()}],"gradient-via-pos":[{via:an()}],"gradient-to-pos":[{to:an()}],"gradient-from":[{from:aj()}],"gradient-via":[{via:aj()}],"gradient-to":[{to:aj()}],rounded:[{rounded:ao()}],"rounded-s":[{"rounded-s":ao()}],"rounded-e":[{"rounded-e":ao()}],"rounded-t":[{"rounded-t":ao()}],"rounded-r":[{"rounded-r":ao()}],"rounded-b":[{"rounded-b":ao()}],"rounded-l":[{"rounded-l":ao()}],"rounded-ss":[{"rounded-ss":ao()}],"rounded-se":[{"rounded-se":ao()}],"rounded-ee":[{"rounded-ee":ao()}],"rounded-es":[{"rounded-es":ao()}],"rounded-tl":[{"rounded-tl":ao()}],"rounded-tr":[{"rounded-tr":ao()}],"rounded-br":[{"rounded-br":ao()}],"rounded-bl":[{"rounded-bl":ao()}],"border-w":[{border:ap()}],"border-w-x":[{"border-x":ap()}],"border-w-y":[{"border-y":ap()}],"border-w-s":[{"border-s":ap()}],"border-w-e":[{"border-e":ap()}],"border-w-bs":[{"border-bs":ap()}],"border-w-be":[{"border-be":ap()}],"border-w-t":[{"border-t":ap()}],"border-w-r":[{"border-r":ap()}],"border-w-b":[{"border-b":ap()}],"border-w-l":[{"border-l":ap()}],"divide-x":[{"divide-x":ap()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ap()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...aq(),"hidden","none"]}],"divide-style":[{divide:[...aq(),"hidden","none"]}],"border-color":[{border:aj()}],"border-color-x":[{"border-x":aj()}],"border-color-y":[{"border-y":aj()}],"border-color-s":[{"border-s":aj()}],"border-color-e":[{"border-e":aj()}],"border-color-bs":[{"border-bs":aj()}],"border-color-be":[{"border-be":aj()}],"border-color-t":[{"border-t":aj()}],"border-color-r":[{"border-r":aj()}],"border-color-b":[{"border-b":aj()}],"border-color-l":[{"border-l":aj()}],"divide-color":[{divide:aj()}],"outline-style":[{outline:[...aq(),"none","hidden"]}],"outline-offset":[{"outline-offset":[E,Y,Q]}],"outline-w":[{outline:["",E,Z,R]}],"outline-color":[{outline:aj()}],shadow:[{shadow:["","inner","none",k,ac,X]}],"shadow-color":[{shadow:aj()}],"inset-shadow":[{"inset-shadow":["none",l,ac,X]}],"inset-shadow-color":[{"inset-shadow":aj()}],"ring-w":[{ring:ap()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:aj()}],"ring-offset-w":[{"ring-offset":[E,R]}],"ring-offset-color":[{"ring-offset":aj()}],"inset-ring-w":[{"inset-ring":ap()}],"inset-ring-color":[{"inset-ring":aj()}],"text-shadow":[{"text-shadow":["none",m,ac,X]}],"text-shadow-color":[{"text-shadow":aj()}],opacity:[{opacity:[E,Y,Q]}],"mix-blend":[{"mix-blend":[...ar(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ar()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[E]}],"mask-image-linear-from-pos":[{"mask-linear-from":as()}],"mask-image-linear-to-pos":[{"mask-linear-to":as()}],"mask-image-linear-from-color":[{"mask-linear-from":aj()}],"mask-image-linear-to-color":[{"mask-linear-to":aj()}],"mask-image-t-from-pos":[{"mask-t-from":as()}],"mask-image-t-to-pos":[{"mask-t-to":as()}],"mask-image-t-from-color":[{"mask-t-from":aj()}],"mask-image-t-to-color":[{"mask-t-to":aj()}],"mask-image-r-from-pos":[{"mask-r-from":as()}],"mask-image-r-to-pos":[{"mask-r-to":as()}],"mask-image-r-from-color":[{"mask-r-from":aj()}],"mask-image-r-to-color":[{"mask-r-to":aj()}],"mask-image-b-from-pos":[{"mask-b-from":as()}],"mask-image-b-to-pos":[{"mask-b-to":as()}],"mask-image-b-from-color":[{"mask-b-from":aj()}],"mask-image-b-to-color":[{"mask-b-to":aj()}],"mask-image-l-from-pos":[{"mask-l-from":as()}],"mask-image-l-to-pos":[{"mask-l-to":as()}],"mask-image-l-from-color":[{"mask-l-from":aj()}],"mask-image-l-to-color":[{"mask-l-to":aj()}],"mask-image-x-from-pos":[{"mask-x-from":as()}],"mask-image-x-to-pos":[{"mask-x-to":as()}],"mask-image-x-from-color":[{"mask-x-from":aj()}],"mask-image-x-to-color":[{"mask-x-to":aj()}],"mask-image-y-from-pos":[{"mask-y-from":as()}],"mask-image-y-to-pos":[{"mask-y-to":as()}],"mask-image-y-from-color":[{"mask-y-from":aj()}],"mask-image-y-to-color":[{"mask-y-to":aj()}],"mask-image-radial":[{"mask-radial":[Y,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":as()}],"mask-image-radial-to-pos":[{"mask-radial-to":as()}],"mask-image-radial-from-color":[{"mask-radial-from":aj()}],"mask-image-radial-to-color":[{"mask-radial-to":aj()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[E]}],"mask-image-conic-from-pos":[{"mask-conic-from":as()}],"mask-image-conic-to-pos":[{"mask-conic-to":as()}],"mask-image-conic-from-color":[{"mask-conic-from":aj()}],"mask-image-conic-to-color":[{"mask-conic-to":aj()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ak()}],"mask-repeat":[{mask:al()}],"mask-size":[{mask:am()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Y,Q]}],filter:[{filter:["","none",Y,Q]}],blur:[{blur:at()}],brightness:[{brightness:[E,Y,Q]}],contrast:[{contrast:[E,Y,Q]}],"drop-shadow":[{"drop-shadow":["","none",n,ac,X]}],"drop-shadow-color":[{"drop-shadow":aj()}],grayscale:[{grayscale:["",E,Y,Q]}],"hue-rotate":[{"hue-rotate":[E,Y,Q]}],invert:[{invert:["",E,Y,Q]}],saturate:[{saturate:[E,Y,Q]}],sepia:[{sepia:["",E,Y,Q]}],"backdrop-filter":[{"backdrop-filter":["","none",Y,Q]}],"backdrop-blur":[{"backdrop-blur":at()}],"backdrop-brightness":[{"backdrop-brightness":[E,Y,Q]}],"backdrop-contrast":[{"backdrop-contrast":[E,Y,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",E,Y,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[E,Y,Q]}],"backdrop-invert":[{"backdrop-invert":["",E,Y,Q]}],"backdrop-opacity":[{"backdrop-opacity":[E,Y,Q]}],"backdrop-saturate":[{"backdrop-saturate":[E,Y,Q]}],"backdrop-sepia":[{"backdrop-sepia":["",E,Y,Q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Y,Q]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[E,"initial",Y,Q]}],ease:[{ease:["linear","initial",r,Y,Q]}],delay:[{delay:[E,Y,Q]}],animate:[{animate:["none",s,Y,Q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,Y,Q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:au()}],"rotate-x":[{"rotate-x":au()}],"rotate-y":[{"rotate-y":au()}],"rotate-z":[{"rotate-z":au()}],scale:[{scale:av()}],"scale-x":[{"scale-x":av()}],"scale-y":[{"scale-y":av()}],"scale-z":[{"scale-z":av()}],"scale-3d":["scale-3d"],skew:[{skew:aw()}],"skew-x":[{"skew-x":aw()}],"skew-y":[{"skew-y":aw()}],transform:[{transform:[Y,Q,"","none","gpu","cpu"]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ax()}],"translate-x":[{"translate-x":ax()}],"translate-y":[{"translate-y":ax()}],"translate-z":[{"translate-z":ax()}],"translate-none":["translate-none"],zoom:[{zoom:[F,Y,Q]}],accent:[{accent:aj()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:aj()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Y,Q]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":aj()}],"scrollbar-track-color":[{"scrollbar-track":aj()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Y,Q]}],fill:[{fill:["none",...aj()]}],"stroke-w":[{stroke:[E,Z,R,S]}],stroke:[{stroke:["none",...aj()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["start","end","right","left"],"inset-y":["inset-bs","inset-be","top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["ps","pe","pr","pl"],py:["pbs","pbe","pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["ms","me","mr","ml"],my:["mbs","mbe","mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-s","border-w-e","border-w-r","border-w-l"],"border-w-y":["border-w-bs","border-w-be","border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-s","border-color-e","border-color-r","border-color-l"],"border-color-y":["border-color-bs","border-color-be","border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-ms","scroll-me","scroll-mr","scroll-ml"],"scroll-my":["scroll-mbs","scroll-mbe","scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-ps","scroll-pe","scroll-pr","scroll-pl"],"scroll-py":["scroll-pbs","scroll-pbe","scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}})},26706:(a,b,c)=>{"use strict";c.d(b,{NavProvider:()=>e});var d=c(71935);(0,d.registerClientReference)(function(){throw Error("Attempted to call usePageStyles() from the server but usePageStyles is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/contexts/layout.js","usePageStyles"),(0,d.registerClientReference)(function(){throw Error("Attempted to call StylesProvider() from the server but StylesProvider is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/contexts/layout.js","StylesProvider");let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call NavProvider() from the server but NavProvider is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/contexts/layout.js","NavProvider");(0,d.registerClientReference)(function(){throw Error("Attempted to call useNav() from the server but useNav is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/contexts/layout.js","useNav")},26713:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/is-bot")},28354:a=>{"use strict";a.exports=require("util")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},29440:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>y});var d=c(40239),e=c(70986),f=c(47031),g=c(25475),h=c(10723),i=c(22353),j=c(83854),k=c(84368),l=c(7288),m=c(44518),n=c(14992),o=c(38629),p=c(26706),q=c(2098),r=c(18);let s=(a,b)=>b.icon?{...a,icon:(0,d.jsx)("div",{className:"size-full [&_svg]:size-full max-md:p-1.5 max-md:rounded-md max-md:border max-md:bg-fd-secondary",children:b.icon})}:a;function t(a,{transform:b=s}={}){let c=[];function d(a,e){if("root"in a&&a.root){let d=function a(b,c=new Set){for(let d of(b.index&&c.add(b.index.url),b.children))"page"!==d.type||d.external||c.add(d.url),"folder"===d.type&&a(d,c);return c}(a);if(d.size>0){let f={url:d.values().next().value??"",title:a.name,icon:a.icon,unlisted:e,description:a.description,urls:d},g=b?b(f,a):f;g&&c.push(g)}}for(let b of a.children)"folder"===b.type&&d(b,e)}return d(a),a.fallback&&d(a.fallback,!0),c}function u({nav:{transparentMode:a,...b}={},sidebar:{tabs:c,enabled:s=!0,...u}={},searchToggle:x={},themeSwitch:y={},tabMode:z="auto",i18n:A=!1,children:B,...C}){let D=(0,e.useMemo)(()=>Array.isArray(c)?c:"object"==typeof c?t(C.tree,c):!1!==c?t(C.tree):[],[c,C.tree]),E=function(a=[],b){let c=a??[];return b&&(c=[...c,{type:"icon",url:b,text:"Github",label:"GitHub",icon:(0,d.jsx)("svg",{role:"img",viewBox:"0 0 24 24",fill:"currentColor",children:(0,d.jsx)("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})}),external:!0}]),c}(C.links??[],C.githubUrl),F=(0,g.QP)("md:[--fd-sidebar-width:268px] lg:[--fd-sidebar-width:286px]");return(0,d.jsx)(n.TreeContextProvider,{tree:C.tree,children:(0,d.jsxs)(p.NavProvider,{transparentMode:a,children:[!1!==b.enabled&&(b.component??(0,d.jsxs)(m.Navbar,{className:"h-(--fd-nav-height) on-root:[--fd-nav-height:56px] md:on-root:[--fd-nav-height:0px] md:hidden",children:[(0,d.jsx)(q.default,{href:b.url??"/",className:"inline-flex items-center gap-2.5 font-semibold",children:b.title}),(0,d.jsx)("div",{className:"flex-1",children:b.children}),!1!==x.enabled&&(x.components?.sm??(0,d.jsx)(r.SearchToggle,{className:"p-2",hideIfDisabled:!0})),s&&(0,d.jsx)(i.SidebarTrigger,{className:(0,g.QP)((0,h.r)({color:"ghost",size:"icon-sm",className:"p-2"})),children:(0,d.jsx)(f.Bx,{})})]})),(0,d.jsxs)(m.LayoutBody,{...C.containerProps,className:(0,g.QP)("md:[&_#nd-page_article]:pt-12 xl:[--fd-toc-width:286px] xl:[&_#nd-page_article]:px-8",s&&F,C.containerProps?.className),children:[s&&function(){let{footer:a,banner:c,collapsible:e=!0,component:n,components:p,defaultOpenLevel:s,prefetch:t,...B}=u;if(n)return n;let C=E.filter(a=>"icon"===a.type),F=(0,d.jsxs)(i.SidebarViewport,{children:[E.filter(a=>"icon"!==a.type).map((a,b,c)=>(0,d.jsx)(w,{item:a,className:(0,g.QP)(b===c.length-1&&"mb-4")},b)),(0,d.jsx)(i.SidebarPageTree,{components:p})]}),G=(0,d.jsxs)(i.SidebarContentMobile,{...B,children:[(0,d.jsxs)(i.SidebarHeader,{children:[(0,d.jsxs)("div",{className:"flex text-fd-muted-foreground items-center gap-1.5",children:[(0,d.jsx)("div",{className:"flex flex-1",children:C.map((a,b)=>(0,d.jsx)(k.BaseLinkItem,{item:a,className:(0,g.QP)((0,h.r)({size:"icon-sm",color:"ghost",className:"p-2"})),"aria-label":a.label,children:a.icon},b))}),A?(0,d.jsxs)(l.LanguageToggle,{children:[(0,d.jsx)(f.AT,{className:"size-4.5"}),(0,d.jsx)(l.LanguageToggleText,{})]}):null,!1!==y.enabled&&(y.component??(0,d.jsx)(o.ThemeToggle,{className:"p-0",mode:y.mode})),(0,d.jsx)(i.SidebarTrigger,{className:(0,g.QP)((0,h.r)({color:"ghost",size:"icon-sm",className:"p-2"})),children:(0,d.jsx)(f.Bx,{})})]}),D.length>0&&(0,d.jsx)(j.RootToggle,{options:D}),c]}),F,(0,d.jsx)(i.SidebarFooter,{className:"empty:hidden",children:a})]}),H=(0,d.jsxs)(i.SidebarContent,{...B,children:[(0,d.jsxs)(i.SidebarHeader,{children:[(0,d.jsxs)("div",{className:"flex",children:[(0,d.jsx)(q.default,{href:b.url??"/",className:"inline-flex text-[15px] items-center gap-2.5 font-medium me-auto",children:b.title}),b.children,e&&(0,d.jsx)(i.SidebarCollapseTrigger,{className:(0,g.QP)((0,h.r)({color:"ghost",size:"icon-sm",className:"mb-auto text-fd-muted-foreground"})),children:(0,d.jsx)(f.Bx,{})})]}),!1!==x.enabled&&(x.components?.lg??(0,d.jsx)(r.LargeSearchToggle,{hideIfDisabled:!0})),D.length>0&&"auto"===z&&(0,d.jsx)(j.RootToggle,{options:D}),c]}),F,(A||C.length>0||y?.enabled!==!1||a)&&(0,d.jsxs)(i.SidebarFooter,{children:[(0,d.jsxs)("div",{className:"flex text-fd-muted-foreground items-center empty:hidden",children:[A&&(0,d.jsx)(l.LanguageToggle,{children:(0,d.jsx)(f.AT,{className:"size-4.5"})}),C.map((a,b)=>(0,d.jsx)(k.BaseLinkItem,{item:a,className:(0,g.QP)((0,h.r)({size:"icon-sm",color:"ghost"})),"aria-label":a.label,children:a.icon},b)),!1!==y.enabled&&(y.component??(0,d.jsx)(o.ThemeToggle,{className:"ms-auto p-0",mode:y.mode}))]}),a]})]});return(0,d.jsx)(i.Sidebar,{defaultOpenLevel:s,prefetch:t,Mobile:G,Content:(0,d.jsxs)(d.Fragment,{children:[e&&(0,d.jsx)(m.CollapsibleControl,{}),H]})})}(),"top"===z&&D.length>0&&(0,d.jsx)(m.LayoutTabs,{options:D,className:"sticky top-[calc(var(--fd-nav-height)+var(--fd-tocnav-height))] z-10 bg-fd-background border-b px-6 pt-3 xl:px-8 max-md:hidden"}),B]})]})})}function w({item:a,...b}){return"menu"===a.type?(0,d.jsxs)(i.SidebarFolder,{...b,children:[a.url?(0,d.jsxs)(i.SidebarFolderLink,{href:a.url,external:a.external,children:[a.icon,a.text]}):(0,d.jsxs)(i.SidebarFolderTrigger,{children:[a.icon,a.text]}),(0,d.jsx)(i.SidebarFolderContent,{children:a.items.map((a,b)=>(0,d.jsx)(w,{item:a},b))})]}):"custom"===a.type?(0,d.jsx)("div",{...b,children:a.children}):(0,d.jsx)(i.SidebarItem,{href:a.url,icon:a.icon,external:a.external,...b,children:a.text})}var x=c(35241);function y({children:a}){return(0,d.jsx)(u,{tree:x.s.pageTree,nav:{title:"Cue"},children:a})}},33670:(a,b,c)=>{Promise.resolve().then(c.bind(c,19671)),Promise.resolve().then(c.bind(c,2098)),Promise.resolve().then(c.bind(c,62684)),Promise.resolve().then(c.bind(c,10035)),Promise.resolve().then(c.bind(c,77183)),Promise.resolve().then(c.bind(c,35396)),Promise.resolve().then(c.bind(c,45400))},33873:a=>{"use strict";a.exports=require("path")},35241:(a,b,c)=>{"use strict";c.d(b,{s:()=>ex});var d={};c.r(d),c.d(d,{default:()=>_,extractedReferences:()=>X,frontmatter:()=>W,structuredData:()=>Y,toc:()=>Z});var e={};c.r(e),c.d(e,{default:()=>af,extractedReferences:()=>ab,frontmatter:()=>aa,structuredData:()=>ac,toc:()=>ad});var f={};c.r(f),c.d(f,{default:()=>al,extractedReferences:()=>ah,frontmatter:()=>ag,structuredData:()=>ai,toc:()=>aj});var g={};c.r(g),c.d(g,{default:()=>ar,extractedReferences:()=>an,frontmatter:()=>am,structuredData:()=>ao,toc:()=>ap});var h={};c.r(h),c.d(h,{default:()=>ax,extractedReferences:()=>at,frontmatter:()=>as,structuredData:()=>au,toc:()=>av});var i={};c.r(i),c.d(i,{default:()=>aD,extractedReferences:()=>az,frontmatter:()=>ay,structuredData:()=>aA,toc:()=>aB});var j={};c.r(j),c.d(j,{default:()=>aJ,extractedReferences:()=>aF,frontmatter:()=>aE,structuredData:()=>aG,toc:()=>aH});var k={};c.r(k),c.d(k,{default:()=>aP,extractedReferences:()=>aL,frontmatter:()=>aK,structuredData:()=>aM,toc:()=>aN});var l={};c.r(l),c.d(l,{default:()=>aV,extractedReferences:()=>aR,frontmatter:()=>aQ,structuredData:()=>aS,toc:()=>aT});var m={};c.r(m),c.d(m,{default:()=>a_,extractedReferences:()=>aX,frontmatter:()=>aW,structuredData:()=>aY,toc:()=>aZ});var n={};c.r(n),c.d(n,{default:()=>a5,extractedReferences:()=>a1,frontmatter:()=>a0,structuredData:()=>a2,toc:()=>a3});var o={};c.r(o),c.d(o,{default:()=>bb,extractedReferences:()=>a7,frontmatter:()=>a6,structuredData:()=>a8,toc:()=>a9});var p={};c.r(p),c.d(p,{default:()=>bh,extractedReferences:()=>bd,frontmatter:()=>bc,structuredData:()=>be,toc:()=>bf});var q={};c.r(q),c.d(q,{default:()=>bn,extractedReferences:()=>bj,frontmatter:()=>bi,structuredData:()=>bk,toc:()=>bl});var r={};c.r(r),c.d(r,{default:()=>bt,extractedReferences:()=>bp,frontmatter:()=>bo,structuredData:()=>bq,toc:()=>br});var s={};c.r(s),c.d(s,{default:()=>bz,extractedReferences:()=>bv,frontmatter:()=>bu,structuredData:()=>bw,toc:()=>bx});var t={};c.r(t),c.d(t,{default:()=>bF,extractedReferences:()=>bB,frontmatter:()=>bA,structuredData:()=>bC,toc:()=>bD});var u={};c.r(u),c.d(u,{default:()=>bL,extractedReferences:()=>bH,frontmatter:()=>bG,structuredData:()=>bI,toc:()=>bJ});var w={};c.r(w),c.d(w,{default:()=>bR,extractedReferences:()=>bN,frontmatter:()=>bM,structuredData:()=>bO,toc:()=>bP});var x={};c.r(x),c.d(x,{default:()=>bX,extractedReferences:()=>bT,frontmatter:()=>bS,structuredData:()=>bU,toc:()=>bV});var y={};c.r(y),c.d(y,{default:()=>b1,extractedReferences:()=>bZ,frontmatter:()=>bY,structuredData:()=>b$,toc:()=>b_});var z={};c.r(z),c.d(z,{default:()=>b7,extractedReferences:()=>b3,frontmatter:()=>b2,structuredData:()=>b4,toc:()=>b5});var A={};c.r(A),c.d(A,{default:()=>cd,extractedReferences:()=>b9,frontmatter:()=>b8,structuredData:()=>ca,toc:()=>cb});var B={};c.r(B),c.d(B,{default:()=>cj,extractedReferences:()=>cf,frontmatter:()=>ce,structuredData:()=>cg,toc:()=>ch});var C={};c.r(C),c.d(C,{default:()=>cp,extractedReferences:()=>cl,frontmatter:()=>ck,structuredData:()=>cm,toc:()=>cn});var D={};c.r(D),c.d(D,{default:()=>cv,extractedReferences:()=>cr,frontmatter:()=>cq,structuredData:()=>cs,toc:()=>ct});var E={};c.r(E),c.d(E,{default:()=>cB,extractedReferences:()=>cx,frontmatter:()=>cw,structuredData:()=>cy,toc:()=>cz});var F={};c.r(F),c.d(F,{default:()=>cH,extractedReferences:()=>cD,frontmatter:()=>cC,structuredData:()=>cE,toc:()=>cF});var G={};c.r(G),c.d(G,{default:()=>cN,extractedReferences:()=>cJ,frontmatter:()=>cI,structuredData:()=>cK,toc:()=>cL});var H={};c.r(H),c.d(H,{default:()=>cT,extractedReferences:()=>cP,frontmatter:()=>cO,structuredData:()=>cQ,toc:()=>cR});var I={};c.r(I),c.d(I,{default:()=>cZ,extractedReferences:()=>cV,frontmatter:()=>cU,structuredData:()=>cW,toc:()=>cX});var J={};c.r(J),c.d(J,{default:()=>c3,extractedReferences:()=>c_,frontmatter:()=>c$,structuredData:()=>c0,toc:()=>c1});var K={};c.r(K),c.d(K,{default:()=>c9,extractedReferences:()=>c5,frontmatter:()=>c4,structuredData:()=>c6,toc:()=>c7});var L={};c.r(L),c.d(L,{default:()=>df,extractedReferences:()=>db,frontmatter:()=>da,structuredData:()=>dc,toc:()=>dd});var M={};c.r(M),c.d(M,{default:()=>dl,extractedReferences:()=>dh,frontmatter:()=>dg,structuredData:()=>di,toc:()=>dj});var N={};c.r(N),c.d(N,{default:()=>ds,extractedReferences:()=>dn,frontmatter:()=>dm,structuredData:()=>dp,toc:()=>dq});var O={};c.r(O),c.d(O,{default:()=>dy,extractedReferences:()=>du,frontmatter:()=>dt,structuredData:()=>dv,toc:()=>dw});var P={};c.r(P),c.d(P,{default:()=>dE,extractedReferences:()=>dA,frontmatter:()=>dz,structuredData:()=>dB,toc:()=>dC});var Q={};c.r(Q),c.d(Q,{default:()=>dK,extractedReferences:()=>dG,frontmatter:()=>dF,structuredData:()=>dH,toc:()=>dI});var R={};c.r(R),c.d(R,{default:()=>dQ,extractedReferences:()=>dM,frontmatter:()=>dL,structuredData:()=>dN,toc:()=>dO});var S={};c.r(S),c.d(S,{default:()=>dW,extractedReferences:()=>dS,frontmatter:()=>dR,structuredData:()=>dT,toc:()=>dU});var T={};c.r(T),c.d(T,{default:()=>d0,extractedReferences:()=>dY,frontmatter:()=>dX,structuredData:()=>dZ,toc:()=>d$});var U={};c.r(U),c.d(U,{default:()=>d6,extractedReferences:()=>d2,frontmatter:()=>d1,structuredData:()=>d3,toc:()=>d4});var V=c(40239);let W={title:"Kind"},X=[],Y={contents:[{heading:"why",content:"A kind is the queue a step's job is sent to. A worker pulls one or more kinds. A kind is not a step implementation."},{heading:"why",content:"The step implementation is the run on the bound step. The kind names where the orchestrator sends that step's job. The orchestrator and the worker are separate processes: the orchestrator sends the job, and the worker pulls it and runs the step implementation."},{heading:"who",content:"You name the kind when you register a bound step for an organization."},{heading:"who",content:"You start a worker when you want that kind pulled."},{heading:"who",content:"A person can read which workers are connected. A person can open the first entity of a flow, replay a flow, replay from a step, resend a job, run a step without applying its result, cancel a run or an open step, and end a validity. The first opening is that request: an open run waits, and inside the validity duration the recorded result is returned."},{heading:"how",content:"bindOrganization in organizations/fixture/src/steps.ts binds each step onto every flow. The kind is fixture- plus the step name: fixture-dwell, fixture-stall, fixture-miss, fixture-sprout, and fixture-brood. fixtureSteps stores each bound step under flow/step. seedOrganization calls service.startRun with the organization that exported catalogSeed. Job.organization and BoundStep.kind stay different fields: enqueueStep copies the organization onto the job and reads the kind from the bound step."},{heading:"how",content:"pnpm --filter cue-orchestrator serve runs apps/orchestrator/src/server.ts. That file calls createBullQueue and createReadServer, then server.listen on port 3001. The HTTP server does not start a worker: createStepWorker is called from organizations/fixture/src/work.ts."},{heading:"how",content:"apps/orchestrator/src/preview.ts calls createReadServer with createMemoryWorkerRegistry and a JobQueue whose add returns undefined. preview.ts calls server.listen(3001)."},{heading:"how",content:"enqueueStep in apps/orchestrator/src/jobs.ts copies organization, entity, and step into data before queue.add, so a job is organization, entity, and step with no secret. stepBinding loads the bound step at `${flow}/${step}` and queue.add receives bound.kind, so the kind comes from the bound step. publish in apps/orchestrator/src/service.ts calls enqueueStep for every job returned by startRun, runJob, and advance."},{heading:"how",content:'queueName in apps/orchestrator/src/bull.ts returns `steps-${kind}`, so the Redis queue name is steps plus the kind. createBullQueue opens that Redis queue and calls queue.add("step", data, options). stepJobOptions in apps/orchestrator/src/jobs.ts is { attempts: 1 }. createBullQueue sets it as defaultJobOptions, and enqueueStep passes it on each queue.add, so attempts is 1.'},{heading:"how",content:"seedOrganization calls startRun for each run from an exported catalogSeed. The fixture does not export one, so pnpm --dir organizations/fixture seed starts no run. The log line is seeded fixture 0 runs. startRun calls publish, so a started run's jobs sit on the Redis queue until a worker pulls them. server.ts does not call startRun."},{heading:"how",content:"applySilence in packages/engine/src/engine.ts pushes a new job with jobFor while the opened step has no result, now is at or after silenceDueAt, and resendCount is still under maxResends. At maxResends, applySilence sets that step's result to not_finished and breaks without jobs.push. Service.advance publishes each pushed job through enqueueStep and queue.add: silence stays in the engine, and a resend is a new job. apps/orchestrator/src/server.ts calls openFixtureService, createReadServer, and server.listen."},{heading:"how",content:"organizations/fixture/src/work.ts calls kindsToStart(declaredKinds(fixtureSteps), requestedKinds(process.argv.slice(2))). declaredKinds in apps/orchestrator/src/kinds.ts lists each kind on the bound steps once. kindsToStart returns that full list when requested.length is 0, and requestedKinds returns [] when the arguments contain no --kinds and when the value splits and trims to no names, so an empty --kinds starts every declared kind. pnpm --filter @ascentstudio/cue-org-fixture work takes that path. requestedKinds throws --kinds needs a comma-separated list when --kinds is present and the next argument is missing, and that throw is raised while work.ts is still computing kinds."},{heading:"how",content:"kindsToStart throws `Unknown kind ${kind}` when a requested name is absent from declaredKinds, and work.ts calls kindsToStart before the loop that calls createStepWorker, so an unknown kind throws and starts nothing."},{heading:"how",content:"requestedKinds splits the --kinds value on commas. The loop for (const kind of kinds) in work.ts calls createStepWorker once per kind in that same process, so several kinds can run in one process. bindOrganization sets the kind to fixture- plus the step name, so declaredKinds(fixtureSteps) returns fixture-dwell, fixture-stall, fixture-miss, fixture-sprout, and fixture-brood."},{heading:"how",content:"createStepWorker in apps/orchestrator/src/bull.ts starts a BullMQ Worker on queueName(kind) and calls run with organization, entity, and step taken from the job data, so workers pull. work.ts calls readOrganizationSecrets once, then installEnvironment, before createStepWorker. installEnvironment writes each secret into the environment. work.ts passes consumeAssignment as that run. consumeAssignment reads the dispatch packet and calls implementation.run. The packet has the starting data and the time, and it has no secret. A step implementation reads a name with environment. The failed handler in work.ts logs step failed with the kind, the BullMQ job id, and the error. A value loaded by installEnvironment is replaced with •••• in that log."},{heading:"how",content:"packages/supervisor/src/worker/supervise.ts starts packages/supervisor/src/worker/main.ts and keeps the environment from before loadRootEnv and installEnvironment. createSupervisor writes supervisor watching pid and the child pid. A child that exits 75 is a requested restart: the supervisor writes worker restart requested and starts the child again, so it calls readOrganizationSecrets and installEnvironment once more. A child that exits 0 is a requested stop: the supervisor writes worker stopped and supervisor exiting, then calls process.exit(0). A child that exits with another code, or with a signal, is unexpected: the supervisor writes worker exited plus that code or signal and restarting, waits one second, and starts the child again. SIGINT, SIGTERM, and SIGQUIT are stop signals. The supervisor writes supervisor forwarding plus the signal name, forwards that signal, and does not start another child when that child exits. SIGHUP is forwarded the same way and is a restart: the child exits 75. SIGTERM and SIGINT ask that child to stop accepting jobs and exit 0 after the current job. SIGQUIT closes the BullMQ workers without waiting and exits 0. createShutdown in apps/orchestrator/src/worker-control.ts is that sequence. The worker writes worker command plus drain-stop, drain-restart, or force-stop when it takes the command, and worker exit plus 0 or 75 before process.exit. Each BullMQ worker is closed with close(true). A command stored for the worker runs the same sequence. publish calls enqueueStep with the jobs from the engine, so a worker session is not a condition for opening a step. WorkerService in packages/supervisor/src/worker/worker.service.ts starts each kind with createStepWorker."},{heading:"getting-started",content:'Copy .env.example to .env in the repository root, and start Redis and Supabase with docker compose up -d redis and npx supabase start. loadRootEnv in apps/orchestrator/src/env.ts reads that .env. requiredEnv in the same file reads REDIS_URL, DATABASE_URL, and WORKER_TOKEN, and throws ${name} is required when a name is missing. apps/orchestrator/src/server.ts calls loadRootEnv inside openFixtureService, then requiredEnv("WORKER_TOKEN"). organizations/fixture/src/work.ts calls loadRootEnv, reads WORKER_TOKEN, then readOrganizationSecrets with DATABASE_URL and organization fixture. That reads the secrets table once. installEnvironment writes those names into the environment.'},{heading:"getting-started",content:'Run pnpm --filter cue-orchestrator serve. The serve script in apps/orchestrator/package.json runs tsx src/server.ts. server.ts calls openFixtureService, which calls createBullQueue with REDIS_URL. server.ts then calls createReadServer and server.listen(3001, "0.0.0.0"), and console.log prints orchestrator http://127.0.0.1:3001. The HTTP server does not start a worker and does not call startRun. createStepWorker runs from organizations/fixture/src/work.ts. Stop the preview process first when it is already on port 3001, because apps/orchestrator/src/preview.ts calls server.listen(3001).'},{heading:"getting-started",content:"In a second terminal, run pnpm --filter cue-supervisor work. The work script in packages/supervisor/package.json runs tsx src/main.ts. packages/supervisor/src/worker/supervise.ts starts main.ts with the environment it had at launch. work.ts calls kindsToStart with declaredKinds(fixtureSteps) and the list from requestedKinds. With no --kinds, requestedKinds returns [] and kindsToStart returns every declared kind. readOrganizationSecrets and installEnvironment then load the organization's secrets into the environment. work.ts reads WORKER_TOKEN before installEnvironment and posts /worker-sessions with that bearer, the host, and each started flow/step. The loop calls createStepWorker for each kind. A secret added or deleted after this start stays out of the environment until the worker starts again. SIGHUP is that start: the child exits 75, the supervisor writes worker restart requested, and starts it again. A child that exits 0 makes the supervisor write worker stopped and supervisor exiting, then exit. A child that exits with another code or a signal is started again after one second. console.log in work.ts prints fixture workers plus those kind names joined by commas. Those kinds are fixture-dwell, fixture-stall, fixture-miss, fixture-sprout, and fixture-brood. work.ts does not call catalogSeed."},{heading:"getting-started",content:"Run pnpm --dir organizations/fixture seed. The seed script in organizations/fixture/package.json runs cue seed. The fixture does not export catalogSeed, so the command opens nothing and the log line is seeded fixture 0 runs. Load runs start with pnpm --dir organizations/fixture perf, pnpm --dir organizations/fixture perf:load, pnpm --dir organizations/fixture perf:brood, or pnpm --dir organizations/fixture perf:brood:producer. pnpm --dir organizations/fixture reset deletes the fixture rows in the orchestrator database, drains the jobs for those runs, and deletes that organization's metrics. The log line is reset fixture."},{heading:"getting-started",content:"To pull one kind, run pnpm --filter @ascentstudio/cue-org-fixture work -- --kinds fixture-dwell. requestedKinds reads fixture-dwell and splits on commas. kindsToStart keeps fixture-dwell because declaredKinds lists that kind from bindOrganization, and createStepWorker starts it. When declaredKinds lists more than one kind, put those names in the same comma-separated value: requestedKinds splits on commas, and the loop calls createStepWorker for each of them in this process. A name missing from declaredKinds makes kindsToStart throw Unknown kind plus that name before createStepWorker. A --kinds flag with no value makes requestedKinds throw --kinds needs a comma-separated list before kindsToStart."},{heading:"getting-started",content:'Open Workers in the console for the fixture organization, or call GET /organizations/fixture/workers at http://127.0.0.1:3001/organizations/fixture/workers with Authorization: Bearer and a person id. The resolver in apps/orchestrator/src/server.ts returns the text after Bearer , and createReadServer then returns service.workersFor. One working call is curl -H "Authorization: Bearer person-1" http://127.0.0.1:3001/organizations/fixture/workers. The body is the workers whose coverage names a flow of that organization. The rows are in the workers table. work.ts calls openWorkerPresence with DATABASE_URL and presence.pulse updates last_pulse_at. first_pulse_at stays at the time the row was created. workerPresenceTtlSeconds in apps/orchestrator/src/workers.ts is 30, so a process that stops reporting is marked stopped after that many seconds. A planned stop calls presence.stop, which sets the phase to stopped and keeps the row. workerRetentionSeconds is 30 days, and a stopped row is deleted after that long. A stopped worker stays openable so its configuration can be read. Each row has firstPulseAt and lastPulseAt. A last pulse older than 5 minutes is stale in the console while the worker is not stopped. The step metric written when this worker finishes a step includes its id. enqueueStep in apps/orchestrator/src/jobs.ts sends the job from publish and does not take that list as an argument. WORKER_TOKEN is the bearer on /worker-sessions, not the person id.'}],headings:[{id:"why",content:"Why"},{id:"who",content:"Who"},{id:"how",content:"How"},{id:"getting-started",content:"Getting started"}]},Z=[{depth:2,url:"#why",title:(0,V.jsx)(V.Fragment,{children:"Why"})},{depth:2,url:"#who",title:(0,V.jsx)(V.Fragment,{children:"Who"})},{depth:2,url:"#how",title:(0,V.jsx)(V.Fragment,{children:"How"})},{depth:2,url:"#getting-started",title:(0,V.jsx)(V.Fragment,{children:"Getting started"})}];function $(a){let b={code:"code",h2:"h2",li:"li",ol:"ol",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h2,{id:"why",children:"Why"}),"\n",(0,V.jsx)(b.p,{children:"A kind is the queue a step's job is sent to. A worker pulls one or more kinds. A kind is not a step implementation."}),"\n",(0,V.jsxs)(b.p,{children:["The step implementation is the ",(0,V.jsx)(b.code,{children:"run"})," on the bound step. The kind names where the orchestrator sends that step's job. The orchestrator and the worker are separate processes: the orchestrator sends the job, and the worker pulls it and runs the step implementation."]}),"\n",(0,V.jsx)(b.h2,{id:"who",children:"Who"}),"\n",(0,V.jsx)(b.p,{children:"You name the kind when you register a bound step for an organization."}),"\n",(0,V.jsx)(b.p,{children:"You start a worker when you want that kind pulled."}),"\n",(0,V.jsx)(b.p,{children:"A person can read which workers are connected. A person can open the first entity of a flow, replay a flow, replay from a step, resend a job, run a step without applying its result, cancel a run or an open step, and end a validity. The first opening is that request: an open run waits, and inside the validity duration the recorded result is returned."}),"\n",(0,V.jsx)(b.h2,{id:"how",children:"How"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"bindOrganization"})," in ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/steps.ts"})," binds each step onto every flow. The kind is ",(0,V.jsx)(b.code,{children:"fixture-"})," plus the step name: ",(0,V.jsx)(b.code,{children:"fixture-dwell"}),", ",(0,V.jsx)(b.code,{children:"fixture-stall"}),", ",(0,V.jsx)(b.code,{children:"fixture-miss"}),", ",(0,V.jsx)(b.code,{children:"fixture-sprout"}),", and ",(0,V.jsx)(b.code,{children:"fixture-brood"}),". ",(0,V.jsx)(b.code,{children:"fixtureSteps"})," stores each bound step under ",(0,V.jsx)(b.code,{children:"flow/step"}),". ",(0,V.jsx)(b.code,{children:"seedOrganization"})," calls ",(0,V.jsx)(b.code,{children:"service.startRun"})," with the organization that exported ",(0,V.jsx)(b.code,{children:"catalogSeed"}),". ",(0,V.jsx)(b.code,{children:"Job.organization"})," and ",(0,V.jsx)(b.code,{children:"BoundStep.kind"})," stay different fields: ",(0,V.jsx)(b.code,{children:"enqueueStep"})," copies the organization onto the job and reads the kind from the bound step."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"pnpm --filter cue-orchestrator serve"})," runs ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/server.ts"}),". That file calls ",(0,V.jsx)(b.code,{children:"createBullQueue"})," and ",(0,V.jsx)(b.code,{children:"createReadServer"}),", then ",(0,V.jsx)(b.code,{children:"server.listen"})," on port ",(0,V.jsx)(b.code,{children:"3001"}),". The HTTP server does not start a worker: ",(0,V.jsx)(b.code,{children:"createStepWorker"})," is called from ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/work.ts"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"apps/orchestrator/src/preview.ts"})," calls ",(0,V.jsx)(b.code,{children:"createReadServer"})," with ",(0,V.jsx)(b.code,{children:"createMemoryWorkerRegistry"})," and a ",(0,V.jsx)(b.code,{children:"JobQueue"})," whose ",(0,V.jsx)(b.code,{children:"add"})," returns ",(0,V.jsx)(b.code,{children:"undefined"}),". ",(0,V.jsx)(b.code,{children:"preview.ts"})," calls ",(0,V.jsx)(b.code,{children:"server.listen(3001)"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"enqueueStep"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/jobs.ts"})," copies ",(0,V.jsx)(b.code,{children:"organization"}),", ",(0,V.jsx)(b.code,{children:"entity"}),", and ",(0,V.jsx)(b.code,{children:"step"})," into ",(0,V.jsx)(b.code,{children:"data"})," before ",(0,V.jsx)(b.code,{children:"queue.add"}),", so a job is organization, entity, and step with no secret. ",(0,V.jsx)(b.code,{children:"stepBinding"})," loads the bound step at ",(0,V.jsx)(b.code,{children:"`${flow}/${step}`"})," and ",(0,V.jsx)(b.code,{children:"queue.add"})," receives ",(0,V.jsx)(b.code,{children:"bound.kind"}),", so the kind comes from the bound step. ",(0,V.jsx)(b.code,{children:"publish"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/service.ts"})," calls ",(0,V.jsx)(b.code,{children:"enqueueStep"})," for every job returned by ",(0,V.jsx)(b.code,{children:"startRun"}),", ",(0,V.jsx)(b.code,{children:"runJob"}),", and ",(0,V.jsx)(b.code,{children:"advance"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"queueName"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/bull.ts"})," returns ",(0,V.jsx)(b.code,{children:"`steps-${kind}`"}),", so the Redis queue name is steps plus the kind. ",(0,V.jsx)(b.code,{children:"createBullQueue"})," opens that Redis queue and calls ",(0,V.jsx)(b.code,{children:'queue.add("step", data, options)'}),". ",(0,V.jsx)(b.code,{children:"stepJobOptions"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/jobs.ts"})," is ",(0,V.jsx)(b.code,{children:"{ attempts: 1 }"}),". ",(0,V.jsx)(b.code,{children:"createBullQueue"})," sets it as ",(0,V.jsx)(b.code,{children:"defaultJobOptions"}),", and ",(0,V.jsx)(b.code,{children:"enqueueStep"})," passes it on each ",(0,V.jsx)(b.code,{children:"queue.add"}),", so attempts is 1."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"seedOrganization"})," calls ",(0,V.jsx)(b.code,{children:"startRun"})," for each run from an exported ",(0,V.jsx)(b.code,{children:"catalogSeed"}),". The fixture does not export one, so ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture seed"})," starts no run. The log line is ",(0,V.jsx)(b.code,{children:"seeded fixture 0 runs"}),". ",(0,V.jsx)(b.code,{children:"startRun"})," calls ",(0,V.jsx)(b.code,{children:"publish"}),", so a started run's jobs sit on the Redis queue until a worker pulls them. ",(0,V.jsx)(b.code,{children:"server.ts"})," does not call ",(0,V.jsx)(b.code,{children:"startRun"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"applySilence"})," in ",(0,V.jsx)(b.code,{children:"packages/engine/src/engine.ts"})," pushes a new job with ",(0,V.jsx)(b.code,{children:"jobFor"})," while the opened step has no result, ",(0,V.jsx)(b.code,{children:"now"})," is at or after ",(0,V.jsx)(b.code,{children:"silenceDueAt"}),", and ",(0,V.jsx)(b.code,{children:"resendCount"})," is still under ",(0,V.jsx)(b.code,{children:"maxResends"}),". At ",(0,V.jsx)(b.code,{children:"maxResends"}),", ",(0,V.jsx)(b.code,{children:"applySilence"})," sets that step's result to ",(0,V.jsx)(b.code,{children:"not_finished"})," and breaks without ",(0,V.jsx)(b.code,{children:"jobs.push"}),". ",(0,V.jsx)(b.code,{children:"Service.advance"})," publishes each pushed job through ",(0,V.jsx)(b.code,{children:"enqueueStep"})," and ",(0,V.jsx)(b.code,{children:"queue.add"}),": silence stays in the engine, and a resend is a new job. ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/server.ts"})," calls ",(0,V.jsx)(b.code,{children:"openFixtureService"}),", ",(0,V.jsx)(b.code,{children:"createReadServer"}),", and ",(0,V.jsx)(b.code,{children:"server.listen"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"organizations/fixture/src/work.ts"})," calls ",(0,V.jsx)(b.code,{children:"kindsToStart(declaredKinds(fixtureSteps), requestedKinds(process.argv.slice(2)))"}),". ",(0,V.jsx)(b.code,{children:"declaredKinds"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/kinds.ts"})," lists each ",(0,V.jsx)(b.code,{children:"kind"})," on the bound steps once. ",(0,V.jsx)(b.code,{children:"kindsToStart"})," returns that full list when ",(0,V.jsx)(b.code,{children:"requested.length"})," is ",(0,V.jsx)(b.code,{children:"0"}),", and ",(0,V.jsx)(b.code,{children:"requestedKinds"})," returns ",(0,V.jsx)(b.code,{children:"[]"})," when the arguments contain no ",(0,V.jsx)(b.code,{children:"--kinds"})," and when the value splits and trims to no names, so an empty ",(0,V.jsx)(b.code,{children:"--kinds"})," starts every declared kind. ",(0,V.jsx)(b.code,{children:"pnpm --filter @ascentstudio/cue-org-fixture work"})," takes that path. ",(0,V.jsx)(b.code,{children:"requestedKinds"})," throws ",(0,V.jsx)(b.code,{children:"--kinds needs a comma-separated list"})," when ",(0,V.jsx)(b.code,{children:"--kinds"})," is present and the next argument is missing, and that throw is raised while ",(0,V.jsx)(b.code,{children:"work.ts"})," is still computing ",(0,V.jsx)(b.code,{children:"kinds"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"kindsToStart"})," throws ",(0,V.jsx)(b.code,{children:"`Unknown kind ${kind}`"})," when a requested name is absent from ",(0,V.jsx)(b.code,{children:"declaredKinds"}),", and ",(0,V.jsx)(b.code,{children:"work.ts"})," calls ",(0,V.jsx)(b.code,{children:"kindsToStart"})," before the loop that calls ",(0,V.jsx)(b.code,{children:"createStepWorker"}),", so an unknown kind throws and starts nothing."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"requestedKinds"})," splits the ",(0,V.jsx)(b.code,{children:"--kinds"})," value on commas. The loop ",(0,V.jsx)(b.code,{children:"for (const kind of kinds)"})," in ",(0,V.jsx)(b.code,{children:"work.ts"})," calls ",(0,V.jsx)(b.code,{children:"createStepWorker"})," once per kind in that same process, so several kinds can run in one process. ",(0,V.jsx)(b.code,{children:"bindOrganization"})," sets the kind to ",(0,V.jsx)(b.code,{children:"fixture-"})," plus the step name, so ",(0,V.jsx)(b.code,{children:"declaredKinds(fixtureSteps)"})," returns ",(0,V.jsx)(b.code,{children:"fixture-dwell"}),", ",(0,V.jsx)(b.code,{children:"fixture-stall"}),", ",(0,V.jsx)(b.code,{children:"fixture-miss"}),", ",(0,V.jsx)(b.code,{children:"fixture-sprout"}),", and ",(0,V.jsx)(b.code,{children:"fixture-brood"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"createStepWorker"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/bull.ts"})," starts a BullMQ ",(0,V.jsx)(b.code,{children:"Worker"})," on ",(0,V.jsx)(b.code,{children:"queueName(kind)"})," and calls ",(0,V.jsx)(b.code,{children:"run"})," with ",(0,V.jsx)(b.code,{children:"organization"}),", ",(0,V.jsx)(b.code,{children:"entity"}),", and ",(0,V.jsx)(b.code,{children:"step"})," taken from the job data, so workers pull. ",(0,V.jsx)(b.code,{children:"work.ts"})," calls ",(0,V.jsx)(b.code,{children:"readOrganizationSecrets"})," once, then ",(0,V.jsx)(b.code,{children:"installEnvironment"}),", before ",(0,V.jsx)(b.code,{children:"createStepWorker"}),". ",(0,V.jsx)(b.code,{children:"installEnvironment"})," writes each secret into the environment. ",(0,V.jsx)(b.code,{children:"work.ts"})," passes ",(0,V.jsx)(b.code,{children:"consumeAssignment"})," as that ",(0,V.jsx)(b.code,{children:"run"}),". ",(0,V.jsx)(b.code,{children:"consumeAssignment"})," reads the dispatch packet and calls ",(0,V.jsx)(b.code,{children:"implementation.run"}),". The packet has the starting data and the time, and it has no secret. A step implementation reads a name with ",(0,V.jsx)(b.code,{children:"environment"}),". The ",(0,V.jsx)(b.code,{children:"failed"})," handler in ",(0,V.jsx)(b.code,{children:"work.ts"})," logs ",(0,V.jsx)(b.code,{children:"step failed"})," with the kind, the BullMQ job id, and the error. A value loaded by ",(0,V.jsx)(b.code,{children:"installEnvironment"})," is replaced with ",(0,V.jsx)(b.code,{children:"••••"})," in that log."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"packages/supervisor/src/worker/supervise.ts"})," starts ",(0,V.jsx)(b.code,{children:"packages/supervisor/src/worker/main.ts"})," and keeps the environment from before ",(0,V.jsx)(b.code,{children:"loadRootEnv"})," and ",(0,V.jsx)(b.code,{children:"installEnvironment"}),". ",(0,V.jsx)(b.code,{children:"createSupervisor"})," writes ",(0,V.jsx)(b.code,{children:"supervisor watching pid"})," and the child pid. A child that exits ",(0,V.jsx)(b.code,{children:"75"})," is a requested restart: the supervisor writes ",(0,V.jsx)(b.code,{children:"worker restart requested"})," and starts the child again, so it calls ",(0,V.jsx)(b.code,{children:"readOrganizationSecrets"})," and ",(0,V.jsx)(b.code,{children:"installEnvironment"})," once more. A child that exits ",(0,V.jsx)(b.code,{children:"0"})," is a requested stop: the supervisor writes ",(0,V.jsx)(b.code,{children:"worker stopped"})," and ",(0,V.jsx)(b.code,{children:"supervisor exiting"}),", then calls ",(0,V.jsx)(b.code,{children:"process.exit(0)"}),". A child that exits with another code, or with a signal, is unexpected: the supervisor writes ",(0,V.jsx)(b.code,{children:"worker exited"})," plus that code or signal and ",(0,V.jsx)(b.code,{children:"restarting"}),", waits one second, and starts the child again. ",(0,V.jsx)(b.code,{children:"SIGINT"}),", ",(0,V.jsx)(b.code,{children:"SIGTERM"}),", and ",(0,V.jsx)(b.code,{children:"SIGQUIT"})," are stop signals. The supervisor writes ",(0,V.jsx)(b.code,{children:"supervisor forwarding"})," plus the signal name, forwards that signal, and does not start another child when that child exits. ",(0,V.jsx)(b.code,{children:"SIGHUP"})," is forwarded the same way and is a restart: the child exits ",(0,V.jsx)(b.code,{children:"75"}),". ",(0,V.jsx)(b.code,{children:"SIGTERM"})," and ",(0,V.jsx)(b.code,{children:"SIGINT"})," ask that child to stop accepting jobs and exit ",(0,V.jsx)(b.code,{children:"0"})," after the current job. ",(0,V.jsx)(b.code,{children:"SIGQUIT"})," closes the BullMQ workers without waiting and exits ",(0,V.jsx)(b.code,{children:"0"}),". ",(0,V.jsx)(b.code,{children:"createShutdown"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/worker-control.ts"})," is that sequence. The worker writes ",(0,V.jsx)(b.code,{children:"worker command"})," plus ",(0,V.jsx)(b.code,{children:"drain-stop"}),", ",(0,V.jsx)(b.code,{children:"drain-restart"}),", or ",(0,V.jsx)(b.code,{children:"force-stop"})," when it takes the command, and ",(0,V.jsx)(b.code,{children:"worker exit"})," plus ",(0,V.jsx)(b.code,{children:"0"})," or ",(0,V.jsx)(b.code,{children:"75"})," before ",(0,V.jsx)(b.code,{children:"process.exit"}),". Each BullMQ worker is closed with ",(0,V.jsx)(b.code,{children:"close(true)"}),". A command stored for the worker runs the same sequence. ",(0,V.jsx)(b.code,{children:"publish"})," calls ",(0,V.jsx)(b.code,{children:"enqueueStep"})," with the jobs from the engine, so a worker session is not a condition for opening a step. ",(0,V.jsx)(b.code,{children:"WorkerService"})," in ",(0,V.jsx)(b.code,{children:"packages/supervisor/src/worker/worker.service.ts"})," starts each kind with ",(0,V.jsx)(b.code,{children:"createStepWorker"}),"."]}),"\n",(0,V.jsx)(b.h2,{id:"getting-started",children:"Getting started"}),"\n",(0,V.jsxs)(b.ol,{children:["\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["Copy ",(0,V.jsx)(b.code,{children:".env.example"})," to ",(0,V.jsx)(b.code,{children:".env"})," in the repository root, and start Redis and Supabase with ",(0,V.jsx)(b.code,{children:"docker compose up -d redis"})," and ",(0,V.jsx)(b.code,{children:"npx supabase start"}),". ",(0,V.jsx)(b.code,{children:"loadRootEnv"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/env.ts"})," reads that ",(0,V.jsx)(b.code,{children:".env"}),". ",(0,V.jsx)(b.code,{children:"requiredEnv"})," in the same file reads ",(0,V.jsx)(b.code,{children:"REDIS_URL"}),", ",(0,V.jsx)(b.code,{children:"DATABASE_URL"}),", and ",(0,V.jsx)(b.code,{children:"WORKER_TOKEN"}),", and throws ",(0,V.jsx)(b.code,{children:"${name} is required"})," when a name is missing. ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/server.ts"})," calls ",(0,V.jsx)(b.code,{children:"loadRootEnv"})," inside ",(0,V.jsx)(b.code,{children:"openFixtureService"}),", then ",(0,V.jsx)(b.code,{children:'requiredEnv("WORKER_TOKEN")'}),". ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/work.ts"})," calls ",(0,V.jsx)(b.code,{children:"loadRootEnv"}),", reads ",(0,V.jsx)(b.code,{children:"WORKER_TOKEN"}),", then ",(0,V.jsx)(b.code,{children:"readOrganizationSecrets"})," with ",(0,V.jsx)(b.code,{children:"DATABASE_URL"})," and organization ",(0,V.jsx)(b.code,{children:"fixture"}),". That reads the secrets table once. ",(0,V.jsx)(b.code,{children:"installEnvironment"})," writes those names into the environment."]}),"\n"]}),"\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["Run ",(0,V.jsx)(b.code,{children:"pnpm --filter cue-orchestrator serve"}),". The ",(0,V.jsx)(b.code,{children:"serve"})," script in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/package.json"})," runs ",(0,V.jsx)(b.code,{children:"tsx src/server.ts"}),". ",(0,V.jsx)(b.code,{children:"server.ts"})," calls ",(0,V.jsx)(b.code,{children:"openFixtureService"}),", which calls ",(0,V.jsx)(b.code,{children:"createBullQueue"})," with ",(0,V.jsx)(b.code,{children:"REDIS_URL"}),". ",(0,V.jsx)(b.code,{children:"server.ts"})," then calls ",(0,V.jsx)(b.code,{children:"createReadServer"})," and ",(0,V.jsx)(b.code,{children:'server.listen(3001, "0.0.0.0")'}),", and ",(0,V.jsx)(b.code,{children:"console.log"})," prints ",(0,V.jsx)(b.code,{children:"orchestrator http://127.0.0.1:3001"}),". The HTTP server does not start a worker and does not call ",(0,V.jsx)(b.code,{children:"startRun"}),". ",(0,V.jsx)(b.code,{children:"createStepWorker"})," runs from ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/work.ts"}),". Stop the preview process first when it is already on port ",(0,V.jsx)(b.code,{children:"3001"}),", because ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/preview.ts"})," calls ",(0,V.jsx)(b.code,{children:"server.listen(3001)"}),"."]}),"\n"]}),"\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["In a second terminal, run ",(0,V.jsx)(b.code,{children:"pnpm --filter cue-supervisor work"}),". The ",(0,V.jsx)(b.code,{children:"work"})," script in ",(0,V.jsx)(b.code,{children:"packages/supervisor/package.json"})," runs ",(0,V.jsx)(b.code,{children:"tsx src/main.ts"}),". ",(0,V.jsx)(b.code,{children:"packages/supervisor/src/worker/supervise.ts"})," starts ",(0,V.jsx)(b.code,{children:"main.ts"})," with the environment it had at launch. ",(0,V.jsx)(b.code,{children:"work.ts"})," calls ",(0,V.jsx)(b.code,{children:"kindsToStart"})," with ",(0,V.jsx)(b.code,{children:"declaredKinds(fixtureSteps)"})," and the list from ",(0,V.jsx)(b.code,{children:"requestedKinds"}),". With no ",(0,V.jsx)(b.code,{children:"--kinds"}),", ",(0,V.jsx)(b.code,{children:"requestedKinds"})," returns ",(0,V.jsx)(b.code,{children:"[]"})," and ",(0,V.jsx)(b.code,{children:"kindsToStart"})," returns every declared kind. ",(0,V.jsx)(b.code,{children:"readOrganizationSecrets"})," and ",(0,V.jsx)(b.code,{children:"installEnvironment"})," then load the organization's secrets into the environment. ",(0,V.jsx)(b.code,{children:"work.ts"})," reads ",(0,V.jsx)(b.code,{children:"WORKER_TOKEN"})," before ",(0,V.jsx)(b.code,{children:"installEnvironment"})," and posts ",(0,V.jsx)(b.code,{children:"/worker-sessions"})," with that bearer, the host, and each started ",(0,V.jsx)(b.code,{children:"flow/step"}),". The loop calls ",(0,V.jsx)(b.code,{children:"createStepWorker"})," for each kind. A secret added or deleted after this start stays out of the environment until the worker starts again. ",(0,V.jsx)(b.code,{children:"SIGHUP"})," is that start: the child exits ",(0,V.jsx)(b.code,{children:"75"}),", the supervisor writes ",(0,V.jsx)(b.code,{children:"worker restart requested"}),", and starts it again. A child that exits ",(0,V.jsx)(b.code,{children:"0"})," makes the supervisor write ",(0,V.jsx)(b.code,{children:"worker stopped"})," and ",(0,V.jsx)(b.code,{children:"supervisor exiting"}),", then exit. A child that exits with another code or a signal is started again after one second. ",(0,V.jsx)(b.code,{children:"console.log"})," in ",(0,V.jsx)(b.code,{children:"work.ts"})," prints ",(0,V.jsx)(b.code,{children:"fixture workers"})," plus those kind names joined by commas. Those kinds are ",(0,V.jsx)(b.code,{children:"fixture-dwell"}),", ",(0,V.jsx)(b.code,{children:"fixture-stall"}),", ",(0,V.jsx)(b.code,{children:"fixture-miss"}),", ",(0,V.jsx)(b.code,{children:"fixture-sprout"}),", and ",(0,V.jsx)(b.code,{children:"fixture-brood"}),". ",(0,V.jsx)(b.code,{children:"work.ts"})," does not call ",(0,V.jsx)(b.code,{children:"catalogSeed"}),"."]}),"\n"]}),"\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["Run ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture seed"}),". The ",(0,V.jsx)(b.code,{children:"seed"})," script in ",(0,V.jsx)(b.code,{children:"organizations/fixture/package.json"})," runs ",(0,V.jsx)(b.code,{children:"cue seed"}),". The fixture does not export ",(0,V.jsx)(b.code,{children:"catalogSeed"}),", so the command opens nothing and the log line is ",(0,V.jsx)(b.code,{children:"seeded fixture 0 runs"}),". Load runs start with ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf"}),", ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf:load"}),", ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf:brood"}),", or ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf:brood:producer"}),". ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture reset"})," deletes the fixture rows in the orchestrator database, drains the jobs for those runs, and deletes that organization's metrics. The log line is ",(0,V.jsx)(b.code,{children:"reset fixture"}),"."]}),"\n"]}),"\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["To pull one kind, run ",(0,V.jsx)(b.code,{children:"pnpm --filter @ascentstudio/cue-org-fixture work -- --kinds fixture-dwell"}),". ",(0,V.jsx)(b.code,{children:"requestedKinds"})," reads ",(0,V.jsx)(b.code,{children:"fixture-dwell"})," and splits on commas. ",(0,V.jsx)(b.code,{children:"kindsToStart"})," keeps ",(0,V.jsx)(b.code,{children:"fixture-dwell"})," because ",(0,V.jsx)(b.code,{children:"declaredKinds"})," lists that kind from ",(0,V.jsx)(b.code,{children:"bindOrganization"}),", and ",(0,V.jsx)(b.code,{children:"createStepWorker"})," starts it. When ",(0,V.jsx)(b.code,{children:"declaredKinds"})," lists more than one kind, put those names in the same comma-separated value: ",(0,V.jsx)(b.code,{children:"requestedKinds"})," splits on commas, and the loop calls ",(0,V.jsx)(b.code,{children:"createStepWorker"})," for each of them in this process. A name missing from ",(0,V.jsx)(b.code,{children:"declaredKinds"})," makes ",(0,V.jsx)(b.code,{children:"kindsToStart"})," throw ",(0,V.jsx)(b.code,{children:"Unknown kind"})," plus that name before ",(0,V.jsx)(b.code,{children:"createStepWorker"}),". A ",(0,V.jsx)(b.code,{children:"--kinds"})," flag with no value makes ",(0,V.jsx)(b.code,{children:"requestedKinds"})," throw ",(0,V.jsx)(b.code,{children:"--kinds needs a comma-separated list"})," before ",(0,V.jsx)(b.code,{children:"kindsToStart"}),"."]}),"\n"]}),"\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["Open Workers in the console for the fixture organization, or call ",(0,V.jsx)(b.code,{children:"GET /organizations/fixture/workers"})," at ",(0,V.jsx)(b.code,{children:"http://127.0.0.1:3001/organizations/fixture/workers"})," with ",(0,V.jsx)(b.code,{children:"Authorization: Bearer"})," and a person id. The resolver in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/server.ts"})," returns the text after ",(0,V.jsx)(b.code,{children:"Bearer "}),", and ",(0,V.jsx)(b.code,{children:"createReadServer"})," then returns ",(0,V.jsx)(b.code,{children:"service.workersFor"}),". One working call is ",(0,V.jsx)(b.code,{children:'curl -H "Authorization: Bearer person-1" http://127.0.0.1:3001/organizations/fixture/workers'}),". The body is the workers whose coverage names a flow of that organization. The rows are in the ",(0,V.jsx)(b.code,{children:"workers"})," table. ",(0,V.jsx)(b.code,{children:"work.ts"})," calls ",(0,V.jsx)(b.code,{children:"openWorkerPresence"})," with ",(0,V.jsx)(b.code,{children:"DATABASE_URL"})," and ",(0,V.jsx)(b.code,{children:"presence.pulse"})," updates ",(0,V.jsx)(b.code,{children:"last_pulse_at"}),". ",(0,V.jsx)(b.code,{children:"first_pulse_at"})," stays at the time the row was created. ",(0,V.jsx)(b.code,{children:"workerPresenceTtlSeconds"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/workers.ts"})," is 30, so a process that stops reporting is marked stopped after that many seconds. A planned stop calls ",(0,V.jsx)(b.code,{children:"presence.stop"}),", which sets the phase to stopped and keeps the row. ",(0,V.jsx)(b.code,{children:"workerRetentionSeconds"})," is 30 days, and a stopped row is deleted after that long. A stopped worker stays openable so its configuration can be read. Each row has ",(0,V.jsx)(b.code,{children:"firstPulseAt"})," and ",(0,V.jsx)(b.code,{children:"lastPulseAt"}),". A last pulse older than 5 minutes is stale in the console while the worker is not stopped. The step metric written when this worker finishes a step includes its id. ",(0,V.jsx)(b.code,{children:"enqueueStep"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/jobs.ts"})," sends the job from ",(0,V.jsx)(b.code,{children:"publish"})," and does not take that list as an argument. ",(0,V.jsx)(b.code,{children:"WORKER_TOKEN"})," is the bearer on ",(0,V.jsx)(b.code,{children:"/worker-sessions"}),", not the person id."]}),"\n"]}),"\n"]})]})}function _(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)($,{...a})}):$(a)}let aa={title:"Flow"},ab=[],ac={contents:[{heading:"why",content:"A flow is the restricted function that describes what an entity does, with one validity duration for every entity of that flow. A step is an opening in that function. The step implementation is the code outside the flow that performs the step."},{heading:"why",content:"The current flow run stays available for the next reread. A flow metric is the retained end of a finished flow run. A step metric is the retained end of a finished step run. A person reads those ends over a period. A running flow run is not a metric."},{heading:"who",content:"You write a flow when you add one to an organization. flows and fixtureFlows in organizations/fixture/src/index.ts, and fixtureSteps in organizations/fixture/src/steps.ts, are the registrations to copy."},{heading:"who",content:"A person reads Flows in the console. A person can open the first entity of a flow, replay a flow, replay from a step, resend a job, run a step without applying its result, cancel a run or an open step, and end a validity. The first opening is that request: an open run waits, and inside the validity duration the recorded result is returned. On a stored flow run the console lists that run's transient files."},{heading:"how",content:"You meet the function, then the openings it calls, then the registration, then the run the orchestrator keeps, then the Flows screen."},{heading:"the-function",content:"FlowFunction in packages/contract/src/index.ts is (ctx: FlowContext) => void. paceFlow, loadFlow, stallFlow, faultFlow, softenFlow, asideFlow, nestFlow, and broodFlow are that function. defineFlow stores each one as run. organizations/fixture/src/index.ts lists them on flows, and fixtureFlows is that list. nestMidFlow, nestLeafFlow, and broodChildFlow are the child runs those parents open."},{heading:"the-function",content:"reread in packages/engine/src/engine.ts calls definition.run from the first opening, on the operations already stored. openTrackedStep keeps an opening whose step and mode already match. It throws `Reread diverged at ${step}` when they do not."},{heading:"the-function",content:"FlowContext exposes values, openStep, openOptionalStep, openDetachedStep, openChildren, waitGroup, choose, finish, and fail. values is the copy taken when the run opened. The other methods take a step name, a flow name, elements, a group callback, a choice, or nothing. consumeAssignment in apps/orchestrator/src/consume.ts passes starting data, current values, files, and at to implementation.run. The worker loaded secrets into the environment with installEnvironment before it started."},{heading:"openings",content:'paceFlow calls ctx.openStep(dwellStep), then ctx.openStep("mark"). loadFlow calls ctx.openStep(dwellStep). asideFlow calls ctx.openDetachedStep(stallStep), then ctx.openStep(dwellStep). The string "mark" is that step name. dwellStep declares dwell, and names includes mark.'},{heading:"openings",content:'openStep calls openTrackedStep with opening required. The first call builds the step with createStep, pushes jobFor, sets run.wait to { kind: "step", step }, and throws SuspendSignal. The next reread returns frame.result once frame.result is set. A required result whose status is failed ends the run in failure and does not open the next step. A required result whose status is not_finished ends the run not finished. After definition.run returns, or after FinishSignal, reread calls settle with success.'},{heading:"openings",content:"openDetachedStep calls openDetached. The first call pushes jobFor and returns without SuspendSignal. acceptResult writes frame.result and, on the first end, calls pushStep. When frame.mode is detached and entity.run.status is anything other than running, acceptResult returns taken([]) and skips drive. The step metric from that first pushStep is in the transition taken returns."},{heading:"openings",content:"softenFlow calls ctx.openOptionalStep(missStep). That call uses openTrackedStep with opening optional. It waits for frame.result the same way as openStep. A failed or not finished optional result does not stop the run."},{heading:"groups-children-and-choice",content:'On a new group, waitGroup stores rule: { form: "all" }, then calls define. sealGroup seals the report when judgeRule returns success. A failure or a not finished judgment closes the still-open required and optional steps and stops the run. Until then waitGroup sets run.wait to { kind: "group", rule: frame.rule } and throws SuspendSignal. The call returns frame.sealed.'},{heading:"groups-children-and-choice",content:"takeStep records optional or required and pushes jobFor for a new member that is still live. The group rule counts a required step whose result status is done, and a child run whose status is success. An optional step does not count. GroupContext.openStep and GroupContext.openOptionalStep return nothing."},{heading:"groups-children-and-choice",content:"nestFlow calls ctx.openChildren(nestMidFlow, asChildren(sprouted.body)). nestMidFlow calls ctx.openChildren(nestLeafFlow, asChildren(sprouted.body)). broodFlow calls ctx.openChildren(broodChildFlow, asChildren(opened.body)). The first argument is the flow. takeChildren stores it as member.flow. GroupContext in packages/contract/src/index.ts types that parameter as flow: FlowName. A child member with no identities counts as done."},{heading:"groups-children-and-choice",content:"FlowContext.openChildren and openOptionalChildren take flow as a FlowName and elements as one ChildElement or a readonly list. Each element has identifier and startingData. On the context from contextFor, one child waits while child.run.status is running and then returns resultFrom(child), including that child's finish body. A failed required child ends the parent in failure. A not finished required child ends the parent not finished. An optional child does not stop the parent. When the argument is a list, childCall stores normalizeChildrenRule of the call's rule, or { form: \"all\" } when the call omits it. The same rule is accepted on both openings. withinMin stores openedAt on the first opening. sealChildren calls judgeChildren. A required miss stops the parent. An optional miss seals the report and the parent continues. An empty list records the opening and returns a sealed report. nestFlow, nestMidFlow, and broodFlow open child flows with openChildren."},{heading:"groups-children-and-choice",content:"uniqueElements keeps the first element of each identity. ensureChild calls begin when the child is missing. When restart is true and the child is not running, it calls begin again unless the run is success and now is still within validityEndsAt. The flow openChildren passes restart as !isReread. entityId in packages/contract/src/index.ts returns `${organization}/${flow}/${identity}`."},{heading:"groups-children-and-choice",content:'choose stores the arms in the order of arm.name. It runs every arm whose name differs from taken under contextFor(..., "discarded"), then runs the taken arm under "live". A discarded opening is discardedStep, with discarded: true and no jobs.push. acceptResult returns taken([]) when findStep misses the step and findDiscardedStep finds it. Duplicate arm names, or a taken value absent from those names, throw Reread diverged at a choice.'},{heading:"groups-children-and-choice",content:"paceFlow, loadFlow, softenFlow, asideFlow, nestFlow, nestMidFlow, nestLeafFlow, broodFlow, and broodChildFlow call ctx.finish(). stallFlow and faultFlow open one required step and do not call finish(). finish throws FinishSignal in live mode, and the catch in reread calls settleReachedEnd, the same close as a normal return. fail throws FailSignal, and that catch calls settle with failure. None of these flows call fail()."},{heading:"registration-and-the-step-implementation",content:"defineFlow returns the flow with name, entityType, validityDurationMs, source, and run. Each fixture flow sets validityDurationMs to null and entityType to its name. fixtureFlows holds pace, load, stall, fault, soften, aside, nest, nest-mid, nest-leaf, brood, and brood-child. createRegistry throws `Unknown flow ${name}` from get when a name is missing. ensureChild calls registry.get(flowName) for the child flow."},{heading:"registration-and-the-step-implementation",content:"bindOrganization in organizations/fixture/src/steps.ts binds each step onto every flow. The kind is fixture- plus the step name: fixture-dwell, fixture-stall, fixture-miss, fixture-sprout, and fixture-brood. fixtureSteps stores each bound step under flow/step. dwell also answers mark and pass-1 through pass-10."},{heading:"registration-and-the-step-implementation",content:'dwell waits the configured milliseconds, then returns done. stall throws StepHeld. miss returns { kind: "result", status: "failed", discriminant: "failed" }.'},{heading:"registration-and-the-step-implementation",content:'runJob loads the bound step with stepBinding. A thrown StepHeld returns before acceptResult. When implementation.run throws and openingFor is optional or detached, runJob sends { kind: "result", status: "failed", discriminant: "failed" } to acceptResult. Any other thrown error is rethrown.'},{heading:"the-run",content:"apps/orchestrator/src/server.ts calls openFixtureService with createMemoryClient and watchWorkers: true. That opens createService with flows: fixtureFlows, steps: fixtureSteps, entities: createPostgresEntities(pool), metrics: createMetricPublisher(redis), and metricReads: createMetricsReader(clickhouse). server.ts does not call startRun. pnpm --dir organizations/fixture seed calls seedOrganization only when the organization exports catalogSeed. The fixture does not, so that command starts no run and opens no client database. The log line is seeded fixture 0 runs. startRun writes a run into the orchestrator database."},{heading:"the-run",content:'startRun loads the row with loadFocus, calls engine.request, then persist, then afterCommit. request addresses the entity with entityId. A run whose status is running returns { kind: "waiting" }. A success run with finishedAt and validityEndsAt set, and input.at at or before that instant, returns { kind: "recorded" }. Every other request goes through begin. begin adds one to generation, sets run.status to running, copies input.startingData, clears validityEndsAt, and calls drive.'},{heading:"the-run",content:"drive calls applySilence, then reread. applySilence pushes jobFor while the step has no result, now is at or after silenceDueAt, and resendCount is still under maxResends. At maxResends it writes status not_finished and calls pushStep. Service.advance calls engine.advance for each batch from session.due. due in createPostgresEntities selects status = 'running' and silence_due_at <= $1. server.ts reaches the engine through openFixtureService, and it also calls startMetricFlush, createReadServer, and server.listen. seedOrganization is the startRun for an exported catalogSeed."},{heading:"the-run",content:"afterCommit calls enqueueStep for each job and metrics.publish with flowMetrics and stepMetrics. organizations/fixture/src/work.ts starts createStepWorker for each kind. Each job calls consumeAssignment. The orchestrator applies the published result and calls engine.acceptResult inside deps.entities.transaction."},{heading:"the-run",content:"settle returns at once when entity.run.status is not running. Otherwise it sets status and finishedAt, clears wait, and pushes one FlowMetric with that outcome, the run generation, and durationMs. On success, validityEndsAt is addMs(now, validityDurationMs) from registry.get(entity.flow). pushStep pushes one StepMetric when discarded is unset and the step has openedAt, endedAt, and result. When acceptResult receives a worker id, that id is on the step metric. A silence not_finished has no worker id. FlowMetric and StepMetric are declared in packages/contract/src/index.ts."},{heading:"transient-files",content:"A step writes a transient file with input.files.put. The bytes live in the platform bucket under runs/{organization}/{flow}/{identifier}/{generation}/{name}. consumeAssignment records every name that put wrote and stores that list on the step result. A replay from a step publishes a copy of each kept name into the new generation before the jobs of that generation are sent. A full replay does not copy. The flow run page in the console lists them. Reading a name still uses the current generation."},{heading:"transient-files",content:"listRun on TransientFiles in apps/orchestrator/src/transient-files.ts returns { name, bytes }[] for that prefix, sorted by name. GET /entities/:id?files=1 on ReadController calls listRunFilesFor after parseFlowRunPath and readGeneration. The run must still be stored and the person must belong to that organization. GET /entities/:id?file={name} returns the bytes with the stored content type. A name that is not one segment, or a missing file, is 404."},{heading:"transient-files",content:"EntityView in apps/console/src/design/views.tsx renders a DataTable titled Files, empty copy No file., page size 50. EntityScreen loads that list with listRunFiles and does not send files on the 2s tree poll. A row opens a dialog: readRunFile previews JSON or text under 1 MiB, and Download goes to GET /api/run-file. After the flow run retention the run is gone and those files are gone."},{heading:"postgres-and-clickhouse",content:"persist calls session.upsert. createPostgresEntities inserts the run into entities and, on conflict of organization_id, flow, identity, updates status, generation, started_at, finished_at, validity_ends_at, silence_due_at, rule, starting_data, operations, and wait. That row is the current flow run. server.ts passes createPostgresEntities(pool) as entities."},{heading:"postgres-and-clickhouse",content:"createMetricPublisher appends each metric to the Redis stream metrics on the shared Redis client. That client also writes dispatch tokens. LoopsService calls startMetricFlush and createRedisResultBus each with redis.duplicate(). A blocking read on metrics does not stall step-results, and the reverse does not stall the shared client. startMetricFlush inserts flow rows with insertFlowMetrics into flow_run_metrics and step rows with insertStepMetrics into step_run_metrics. onApplicationShutdown calls quit() on those two duplicated clients."},{heading:"postgres-and-clickhouse",content:"flowsFor sets the list entities from countEntities and running from countRunning. mergeFlows copies each flow's entities and running from countsByFlow, and includes every flow registered in deps.flows even when that flow has no entity and no run. Those three methods count rows in entities. countRunning and the running column keep status = 'running'. mergeFlows fills runs, success, failure, and notFinished from flowOutcomes, p50Ms from flowDurations, and trend from flowTrend. flowsFor sets failureRate to failure / runs when runs is not 0. createMetricsReader reads the outcome, duration, and trend queries from flow_runs_hourly. flowFor reads that flow's entities and running from countsByFlow, sets failureRate to failure / runs when runs is not 0, fills series from flowSeries, reads step rows from stepCounts on step_runs_hourly, and reads reasons from reasons_daily."},{heading:"the-flows-screen",content:"createReadServer in apps/orchestrator/src/http.ts handles GET. Any other method is status 405. GET /organizations/:organizationId/flows calls flowsFor after metricRange. GET /organizations/:organizationId/flows/:flow calls flowFor. The resolver in server.ts returns the text after Bearer . POST /organizations/:organizationId/flows/:flow on ReadController calls openFlow, which calls startRun."},{heading:"the-flows-screen",content:'FlowsPage in apps/console/src/app/organizations/[organizationId]/flows/page.tsx calls currentPerson and renders SignedOutView when that person is missing. It loads the list with readOrchestrator at /organizations/${organizationId}/flows?range=${range} and renders FlowsRoute inside ConsoleFrame with active="flows". The nav item labeled Flows in ConsoleFrame pushes `/organizations/${organizationId}/flows`.'},{heading:"the-flows-screen",content:"FlowsView shows the title Flows, stats for Entities, Flow runs, Failure rate, and Running now, and one table row per flow. FlowsRoute sends onOpen to `/organizations/${organizationId}/flows/${flow}?range=${range}`. FlowPage loads that path with readOrchestrator and calls notFound() when the load fails. The detail view shows the flow name, flow runs, step runs, failure rate, p50, Running now, the outcome series, the step table, and the reason list. The Start button opens a dialog for the identity and the payload. startFlow in apps/console/src/app/organizations/[organizationId]/flows/actions.ts posts that body to POST /organizations/:organizationId/flows/:flow. openFlow calls startRun with silence duration 60_000, resend maximum 1, and the rule from the flow definition. flowRange returns 24h, 7d, or 30d, and returns 24h for any other query value."},{heading:"getting-started",content:'In organizations/fixture/src/perf/, add a FlowFunction next to paceFlow, loadFlow, stallFlow, faultFlow, softenFlow, asideFlow, nestFlow, and broodFlow. Call openStep, openOptionalStep, openDetachedStep, openChildren, or finish the way those flows do. paceFlow calls openStep(dwellStep) and openStep("mark"). softenFlow calls openOptionalStep(missStep). asideFlow calls openDetachedStep(stallStep). nestFlow calls openChildren(nestMidFlow, asChildren(sprouted.body)). broodFlow calls openChildren(broodChildFlow, asChildren(opened.body)). waitGroup, choose, and fail are on FlowContext. Append the flow to flows in organizations/fixture/src/index.ts. fixtureFlows is that list.'},{heading:"getting-started",content:"Register the function with defineFlow, which sets name, entityType, validityDurationMs, source, and run, and append that value to flows. Register each step implementation on the steps array in organizations/fixture/src/steps.ts. bindOrganization writes `${flow}/${step}` and sets the kind to `fixture-${step.name}`."},{heading:"getting-started",content:"Copy .env.example to .env in the repository root. loadRootEnv in apps/orchestrator/src/env.ts reads that file. requiredEnv reads DATABASE_URL, REDIS_URL, and CLICKHOUSE_URL, and throws ${name} is required when one is missing. Start the orchestrator Postgres with npx supabase start. Start Redis and ClickHouse with docker compose up -d redis clickhouse. The redis and clickhouse services are the ones in docker-compose.yml. Run npx supabase status and set NEXT_PUBLIC_SUPABASE_ANON_KEY in .env to the anon key it prints. supabaseAnonKey in apps/console/src/lib/supabase-env.ts drops an empty value, and LoginPage then renders SignInForm with configured={false}."},{heading:"getting-started",content:'Run pnpm --filter cue-orchestrator serve. The serve script in apps/orchestrator/package.json runs tsx src/server.ts. server.ts calls openFixtureService with fixtureFlows and fixtureSteps, then server.listen(3001, "0.0.0.0"). It does not call startRun. The log line is orchestrator http://127.0.0.1:3001.'},{heading:"getting-started",content:"In a second terminal, run pnpm --filter @ascentstudio/cue-org-fixture work. The work script in organizations/fixture/package.json runs tsx src/work.ts. work.ts loads the organization's secrets once with readOrganizationSecrets and installEnvironment, then calls createStepWorker. Each job calls consumeAssignment. consumeAssignment publishes the step result, the orchestrator applies it, and settle pushes a FlowMetric when it records success, failure, or not_finished. startMetricFlush in the orchestrator process inserts that metric into ClickHouse. The log line from work.ts is fixture workers plus the kind names. bindOrganization names fixture-dwell, fixture-stall, fixture-miss, fixture-sprout, and fixture-brood."},{heading:"getting-started",content:"In a third terminal, run pnpm --dir organizations/fixture seed. The seed script in organizations/fixture/package.json runs cue seed. The fixture does not export catalogSeed, so the command opens nothing and the log line is seeded fixture 0 runs. Load runs start with pnpm --dir organizations/fixture perf, pnpm --dir organizations/fixture perf:load, pnpm --dir organizations/fixture perf:brood, or pnpm --dir organizations/fixture perf:brood:producer. To remove runs an organization left behind, run pnpm --dir organizations/fixture reset. resetOrganization deletes rows from entity_links and entities on the orchestrator database, drains the kind queues, and deletes that organization's metrics. The log line is reset fixture. organizations, memberships, secrets, and the person in deploy/supabase/seed.sql stay."},{heading:"getting-started",content:"In a fourth terminal, run pnpm --filter cue-console dev. The dev script in apps/console/package.json runs next dev. Open the URL that command prints, at /login. LoginForm calls signInWithPassword for the Sign in button. The person inserted in deploy/supabase/seed.sql has email pierre@ascent-studio.fr, and the comment there says the password is that same string. on_auth_user_created calls join_fixture, which inserts a membership for organization fixture. After sign-in, LoginForm pushes /. Open /organizations/fixture/flows. FlowsPage renders FlowsView with the title Flows. Click a row. FlowsRoute opens /organizations/fixture/flows/ plus that flow name. Press Start, enter the identity and the payload, and the console opens /entities/ plus the organization, the flow, and the identity."}],headings:[{id:"why",content:"Why"},{id:"who",content:"Who"},{id:"how",content:"How"},{id:"the-function",content:"The function"},{id:"openings",content:"Openings"},{id:"groups-children-and-choice",content:"Groups, children, and choice"},{id:"registration-and-the-step-implementation",content:"Registration and the step implementation"},{id:"the-run",content:"The run"},{id:"transient-files",content:"Transient files"},{id:"postgres-and-clickhouse",content:"Postgres and ClickHouse"},{id:"the-flows-screen",content:"The Flows screen"},{id:"getting-started",content:"Getting started"}]},ad=[{depth:2,url:"#why",title:(0,V.jsx)(V.Fragment,{children:"Why"})},{depth:2,url:"#who",title:(0,V.jsx)(V.Fragment,{children:"Who"})},{depth:2,url:"#how",title:(0,V.jsx)(V.Fragment,{children:"How"})},{depth:3,url:"#the-function",title:(0,V.jsx)(V.Fragment,{children:"The function"})},{depth:3,url:"#openings",title:(0,V.jsx)(V.Fragment,{children:"Openings"})},{depth:3,url:"#groups-children-and-choice",title:(0,V.jsx)(V.Fragment,{children:"Groups, children, and choice"})},{depth:3,url:"#registration-and-the-step-implementation",title:(0,V.jsx)(V.Fragment,{children:"Registration and the step implementation"})},{depth:3,url:"#the-run",title:(0,V.jsx)(V.Fragment,{children:"The run"})},{depth:3,url:"#transient-files",title:(0,V.jsx)(V.Fragment,{children:"Transient files"})},{depth:3,url:"#postgres-and-clickhouse",title:(0,V.jsx)(V.Fragment,{children:"Postgres and ClickHouse"})},{depth:3,url:"#the-flows-screen",title:(0,V.jsx)(V.Fragment,{children:"The Flows screen"})},{depth:2,url:"#getting-started",title:(0,V.jsx)(V.Fragment,{children:"Getting started"})}];function ae(a){let b={code:"code",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h2,{id:"why",children:"Why"}),"\n",(0,V.jsx)(b.p,{children:"A flow is the restricted function that describes what an entity does, with one validity duration for every entity of that flow. A step is an opening in that function. The step implementation is the code outside the flow that performs the step."}),"\n",(0,V.jsx)(b.p,{children:"The current flow run stays available for the next reread. A flow metric is the retained end of a finished flow run. A step metric is the retained end of a finished step run. A person reads those ends over a period. A running flow run is not a metric."}),"\n",(0,V.jsx)(b.h2,{id:"who",children:"Who"}),"\n",(0,V.jsxs)(b.p,{children:["You write a flow when you add one to an organization. ",(0,V.jsx)(b.code,{children:"flows"})," and ",(0,V.jsx)(b.code,{children:"fixtureFlows"})," in ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/index.ts"}),", and ",(0,V.jsx)(b.code,{children:"fixtureSteps"})," in ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/steps.ts"}),", are the registrations to copy."]}),"\n",(0,V.jsx)(b.p,{children:"A person reads Flows in the console. A person can open the first entity of a flow, replay a flow, replay from a step, resend a job, run a step without applying its result, cancel a run or an open step, and end a validity. The first opening is that request: an open run waits, and inside the validity duration the recorded result is returned. On a stored flow run the console lists that run's transient files."}),"\n",(0,V.jsx)(b.h2,{id:"how",children:"How"}),"\n",(0,V.jsx)(b.p,{children:"You meet the function, then the openings it calls, then the registration, then the run the orchestrator keeps, then the Flows screen."}),"\n",(0,V.jsx)(b.h3,{id:"the-function",children:"The function"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"FlowFunction"})," in ",(0,V.jsx)(b.code,{children:"packages/contract/src/index.ts"})," is ",(0,V.jsx)(b.code,{children:"(ctx: FlowContext) => void"}),". ",(0,V.jsx)(b.code,{children:"paceFlow"}),", ",(0,V.jsx)(b.code,{children:"loadFlow"}),", ",(0,V.jsx)(b.code,{children:"stallFlow"}),", ",(0,V.jsx)(b.code,{children:"faultFlow"}),", ",(0,V.jsx)(b.code,{children:"softenFlow"}),", ",(0,V.jsx)(b.code,{children:"asideFlow"}),", ",(0,V.jsx)(b.code,{children:"nestFlow"}),", and ",(0,V.jsx)(b.code,{children:"broodFlow"})," are that function. ",(0,V.jsx)(b.code,{children:"defineFlow"})," stores each one as ",(0,V.jsx)(b.code,{children:"run"}),". ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/index.ts"})," lists them on ",(0,V.jsx)(b.code,{children:"flows"}),", and ",(0,V.jsx)(b.code,{children:"fixtureFlows"})," is that list. ",(0,V.jsx)(b.code,{children:"nestMidFlow"}),", ",(0,V.jsx)(b.code,{children:"nestLeafFlow"}),", and ",(0,V.jsx)(b.code,{children:"broodChildFlow"})," are the child runs those parents open."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"reread"})," in ",(0,V.jsx)(b.code,{children:"packages/engine/src/engine.ts"})," calls ",(0,V.jsx)(b.code,{children:"definition.run"})," from the first opening, on the operations already stored. ",(0,V.jsx)(b.code,{children:"openTrackedStep"})," keeps an opening whose ",(0,V.jsx)(b.code,{children:"step"})," and ",(0,V.jsx)(b.code,{children:"mode"})," already match. It throws ",(0,V.jsx)(b.code,{children:"`Reread diverged at ${step}`"})," when they do not."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"FlowContext"})," exposes ",(0,V.jsx)(b.code,{children:"values"}),", ",(0,V.jsx)(b.code,{children:"openStep"}),", ",(0,V.jsx)(b.code,{children:"openOptionalStep"}),", ",(0,V.jsx)(b.code,{children:"openDetachedStep"}),", ",(0,V.jsx)(b.code,{children:"openChildren"}),", ",(0,V.jsx)(b.code,{children:"waitGroup"}),", ",(0,V.jsx)(b.code,{children:"choose"}),", ",(0,V.jsx)(b.code,{children:"finish"}),", and ",(0,V.jsx)(b.code,{children:"fail"}),". ",(0,V.jsx)(b.code,{children:"values"})," is the copy taken when the run opened. The other methods take a step name, a flow name, elements, a group callback, a choice, or nothing. ",(0,V.jsx)(b.code,{children:"consumeAssignment"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/consume.ts"})," passes starting data, current values, files, and ",(0,V.jsx)(b.code,{children:"at"})," to ",(0,V.jsx)(b.code,{children:"implementation.run"}),". The worker loaded secrets into the environment with ",(0,V.jsx)(b.code,{children:"installEnvironment"})," before it started."]}),"\n",(0,V.jsx)(b.h3,{id:"openings",children:"Openings"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"paceFlow"})," calls ",(0,V.jsx)(b.code,{children:"ctx.openStep(dwellStep)"}),", then ",(0,V.jsx)(b.code,{children:'ctx.openStep("mark")'}),". ",(0,V.jsx)(b.code,{children:"loadFlow"})," calls ",(0,V.jsx)(b.code,{children:"ctx.openStep(dwellStep)"}),". ",(0,V.jsx)(b.code,{children:"asideFlow"})," calls ",(0,V.jsx)(b.code,{children:"ctx.openDetachedStep(stallStep)"}),", then ",(0,V.jsx)(b.code,{children:"ctx.openStep(dwellStep)"}),". The string ",(0,V.jsx)(b.code,{children:'"mark"'})," is that step name. ",(0,V.jsx)(b.code,{children:"dwellStep"})," declares ",(0,V.jsx)(b.code,{children:"dwell"}),", and ",(0,V.jsx)(b.code,{children:"names"})," includes ",(0,V.jsx)(b.code,{children:"mark"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"openStep"})," calls ",(0,V.jsx)(b.code,{children:"openTrackedStep"})," with opening ",(0,V.jsx)(b.code,{children:"required"}),". The first call builds the step with ",(0,V.jsx)(b.code,{children:"createStep"}),", pushes ",(0,V.jsx)(b.code,{children:"jobFor"}),", sets ",(0,V.jsx)(b.code,{children:"run.wait"})," to ",(0,V.jsx)(b.code,{children:'{ kind: "step", step }'}),", and throws ",(0,V.jsx)(b.code,{children:"SuspendSignal"}),". The next ",(0,V.jsx)(b.code,{children:"reread"})," returns ",(0,V.jsx)(b.code,{children:"frame.result"})," once ",(0,V.jsx)(b.code,{children:"frame.result"})," is set. A required result whose status is ",(0,V.jsx)(b.code,{children:"failed"})," ends the run in failure and does not open the next step. A required result whose status is ",(0,V.jsx)(b.code,{children:"not_finished"})," ends the run not finished. After ",(0,V.jsx)(b.code,{children:"definition.run"})," returns, or after ",(0,V.jsx)(b.code,{children:"FinishSignal"}),", ",(0,V.jsx)(b.code,{children:"reread"})," calls ",(0,V.jsx)(b.code,{children:"settle"})," with ",(0,V.jsx)(b.code,{children:"success"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"openDetachedStep"})," calls ",(0,V.jsx)(b.code,{children:"openDetached"}),". The first call pushes ",(0,V.jsx)(b.code,{children:"jobFor"})," and returns without ",(0,V.jsx)(b.code,{children:"SuspendSignal"}),". ",(0,V.jsx)(b.code,{children:"acceptResult"})," writes ",(0,V.jsx)(b.code,{children:"frame.result"})," and, on the first end, calls ",(0,V.jsx)(b.code,{children:"pushStep"}),". When ",(0,V.jsx)(b.code,{children:"frame.mode"})," is ",(0,V.jsx)(b.code,{children:"detached"})," and ",(0,V.jsx)(b.code,{children:"entity.run.status"})," is anything other than ",(0,V.jsx)(b.code,{children:"running"}),", ",(0,V.jsx)(b.code,{children:"acceptResult"})," returns ",(0,V.jsx)(b.code,{children:"taken([])"})," and skips ",(0,V.jsx)(b.code,{children:"drive"}),". The step metric from that first ",(0,V.jsx)(b.code,{children:"pushStep"})," is in the transition ",(0,V.jsx)(b.code,{children:"taken"})," returns."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"softenFlow"})," calls ",(0,V.jsx)(b.code,{children:"ctx.openOptionalStep(missStep)"}),". That call uses ",(0,V.jsx)(b.code,{children:"openTrackedStep"})," with opening ",(0,V.jsx)(b.code,{children:"optional"}),". It waits for ",(0,V.jsx)(b.code,{children:"frame.result"})," the same way as ",(0,V.jsx)(b.code,{children:"openStep"}),". A failed or not finished optional result does not stop the run."]}),"\n",(0,V.jsx)(b.h3,{id:"groups-children-and-choice",children:"Groups, children, and choice"}),"\n",(0,V.jsxs)(b.p,{children:["On a new group, ",(0,V.jsx)(b.code,{children:"waitGroup"})," stores ",(0,V.jsx)(b.code,{children:'rule: { form: "all" }'}),", then calls ",(0,V.jsx)(b.code,{children:"define"}),". ",(0,V.jsx)(b.code,{children:"sealGroup"})," seals the report when ",(0,V.jsx)(b.code,{children:"judgeRule"})," returns success. A failure or a not finished judgment closes the still-open required and optional steps and stops the run. Until then ",(0,V.jsx)(b.code,{children:"waitGroup"})," sets ",(0,V.jsx)(b.code,{children:"run.wait"})," to ",(0,V.jsx)(b.code,{children:'{ kind: "group", rule: frame.rule }'})," and throws ",(0,V.jsx)(b.code,{children:"SuspendSignal"}),". The call returns ",(0,V.jsx)(b.code,{children:"frame.sealed"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"takeStep"})," records ",(0,V.jsx)(b.code,{children:"optional"})," or ",(0,V.jsx)(b.code,{children:"required"})," and pushes ",(0,V.jsx)(b.code,{children:"jobFor"})," for a new member that is still live. The group rule counts a required step whose result status is ",(0,V.jsx)(b.code,{children:"done"}),", and a child run whose status is ",(0,V.jsx)(b.code,{children:"success"}),". An optional step does not count. ",(0,V.jsx)(b.code,{children:"GroupContext.openStep"})," and ",(0,V.jsx)(b.code,{children:"GroupContext.openOptionalStep"})," return nothing."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"nestFlow"})," calls ",(0,V.jsx)(b.code,{children:"ctx.openChildren(nestMidFlow, asChildren(sprouted.body))"}),". ",(0,V.jsx)(b.code,{children:"nestMidFlow"})," calls ",(0,V.jsx)(b.code,{children:"ctx.openChildren(nestLeafFlow, asChildren(sprouted.body))"}),". ",(0,V.jsx)(b.code,{children:"broodFlow"})," calls ",(0,V.jsx)(b.code,{children:"ctx.openChildren(broodChildFlow, asChildren(opened.body))"}),". The first argument is the flow. ",(0,V.jsx)(b.code,{children:"takeChildren"})," stores it as ",(0,V.jsx)(b.code,{children:"member.flow"}),". ",(0,V.jsx)(b.code,{children:"GroupContext"})," in ",(0,V.jsx)(b.code,{children:"packages/contract/src/index.ts"})," types that parameter as ",(0,V.jsx)(b.code,{children:"flow: FlowName"}),". A child member with no identities counts as done."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"FlowContext.openChildren"})," and ",(0,V.jsx)(b.code,{children:"openOptionalChildren"})," take ",(0,V.jsx)(b.code,{children:"flow"})," as a ",(0,V.jsx)(b.code,{children:"FlowName"})," and ",(0,V.jsx)(b.code,{children:"elements"})," as one ",(0,V.jsx)(b.code,{children:"ChildElement"})," or a readonly list. Each element has ",(0,V.jsx)(b.code,{children:"identifier"})," and ",(0,V.jsx)(b.code,{children:"startingData"}),". On the context from ",(0,V.jsx)(b.code,{children:"contextFor"}),", one child waits while ",(0,V.jsx)(b.code,{children:"child.run.status"})," is ",(0,V.jsx)(b.code,{children:"running"})," and then returns ",(0,V.jsx)(b.code,{children:"resultFrom(child)"}),", including that child's finish body. A failed required child ends the parent in failure. A not finished required child ends the parent not finished. An optional child does not stop the parent. When the argument is a list, ",(0,V.jsx)(b.code,{children:"childCall"})," stores ",(0,V.jsx)(b.code,{children:"normalizeChildrenRule"})," of the call's ",(0,V.jsx)(b.code,{children:"rule"}),", or ",(0,V.jsx)(b.code,{children:'{ form: "all" }'})," when the call omits it. The same rule is accepted on both openings. ",(0,V.jsx)(b.code,{children:"withinMin"})," stores ",(0,V.jsx)(b.code,{children:"openedAt"})," on the first opening. ",(0,V.jsx)(b.code,{children:"sealChildren"})," calls ",(0,V.jsx)(b.code,{children:"judgeChildren"}),". A required miss stops the parent. An optional miss seals the report and the parent continues. An empty list records the opening and returns a sealed report. ",(0,V.jsx)(b.code,{children:"nestFlow"}),", ",(0,V.jsx)(b.code,{children:"nestMidFlow"}),", and ",(0,V.jsx)(b.code,{children:"broodFlow"})," open child flows with ",(0,V.jsx)(b.code,{children:"openChildren"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"uniqueElements"})," keeps the first element of each ",(0,V.jsx)(b.code,{children:"identity"}),". ",(0,V.jsx)(b.code,{children:"ensureChild"})," calls ",(0,V.jsx)(b.code,{children:"begin"})," when the child is missing. When ",(0,V.jsx)(b.code,{children:"restart"})," is true and the child is not ",(0,V.jsx)(b.code,{children:"running"}),", it calls ",(0,V.jsx)(b.code,{children:"begin"})," again unless the run is ",(0,V.jsx)(b.code,{children:"success"})," and ",(0,V.jsx)(b.code,{children:"now"})," is still within ",(0,V.jsx)(b.code,{children:"validityEndsAt"}),". The flow ",(0,V.jsx)(b.code,{children:"openChildren"})," passes ",(0,V.jsx)(b.code,{children:"restart"})," as ",(0,V.jsx)(b.code,{children:"!isReread"}),". ",(0,V.jsx)(b.code,{children:"entityId"})," in ",(0,V.jsx)(b.code,{children:"packages/contract/src/index.ts"})," returns ",(0,V.jsx)(b.code,{children:"`${organization}/${flow}/${identity}`"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"choose"})," stores the arms in the order of ",(0,V.jsx)(b.code,{children:"arm.name"}),". It runs every arm whose name differs from ",(0,V.jsx)(b.code,{children:"taken"})," under ",(0,V.jsx)(b.code,{children:'contextFor(..., "discarded")'}),", then runs the taken arm under ",(0,V.jsx)(b.code,{children:'"live"'}),". A discarded opening is ",(0,V.jsx)(b.code,{children:"discardedStep"}),", with ",(0,V.jsx)(b.code,{children:"discarded: true"})," and no ",(0,V.jsx)(b.code,{children:"jobs.push"}),". ",(0,V.jsx)(b.code,{children:"acceptResult"})," returns ",(0,V.jsx)(b.code,{children:"taken([])"})," when ",(0,V.jsx)(b.code,{children:"findStep"})," misses the step and ",(0,V.jsx)(b.code,{children:"findDiscardedStep"})," finds it. Duplicate arm names, or a ",(0,V.jsx)(b.code,{children:"taken"})," value absent from those names, throw ",(0,V.jsx)(b.code,{children:"Reread diverged at a choice"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"paceFlow"}),", ",(0,V.jsx)(b.code,{children:"loadFlow"}),", ",(0,V.jsx)(b.code,{children:"softenFlow"}),", ",(0,V.jsx)(b.code,{children:"asideFlow"}),", ",(0,V.jsx)(b.code,{children:"nestFlow"}),", ",(0,V.jsx)(b.code,{children:"nestMidFlow"}),", ",(0,V.jsx)(b.code,{children:"nestLeafFlow"}),", ",(0,V.jsx)(b.code,{children:"broodFlow"}),", and ",(0,V.jsx)(b.code,{children:"broodChildFlow"})," call ",(0,V.jsx)(b.code,{children:"ctx.finish()"}),". ",(0,V.jsx)(b.code,{children:"stallFlow"})," and ",(0,V.jsx)(b.code,{children:"faultFlow"})," open one required step and do not call ",(0,V.jsx)(b.code,{children:"finish()"}),". ",(0,V.jsx)(b.code,{children:"finish"})," throws ",(0,V.jsx)(b.code,{children:"FinishSignal"})," in live mode, and the ",(0,V.jsx)(b.code,{children:"catch"})," in ",(0,V.jsx)(b.code,{children:"reread"})," calls ",(0,V.jsx)(b.code,{children:"settleReachedEnd"}),", the same close as a normal return. ",(0,V.jsx)(b.code,{children:"fail"})," throws ",(0,V.jsx)(b.code,{children:"FailSignal"}),", and that ",(0,V.jsx)(b.code,{children:"catch"})," calls ",(0,V.jsx)(b.code,{children:"settle"})," with ",(0,V.jsx)(b.code,{children:"failure"}),". None of these flows call ",(0,V.jsx)(b.code,{children:"fail()"}),"."]}),"\n",(0,V.jsx)(b.h3,{id:"registration-and-the-step-implementation",children:"Registration and the step implementation"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"defineFlow"})," returns the flow with ",(0,V.jsx)(b.code,{children:"name"}),", ",(0,V.jsx)(b.code,{children:"entityType"}),", ",(0,V.jsx)(b.code,{children:"validityDurationMs"}),", ",(0,V.jsx)(b.code,{children:"source"}),", and ",(0,V.jsx)(b.code,{children:"run"}),". Each fixture flow sets ",(0,V.jsx)(b.code,{children:"validityDurationMs"})," to null and ",(0,V.jsx)(b.code,{children:"entityType"})," to its name. ",(0,V.jsx)(b.code,{children:"fixtureFlows"})," holds ",(0,V.jsx)(b.code,{children:"pace"}),", ",(0,V.jsx)(b.code,{children:"load"}),", ",(0,V.jsx)(b.code,{children:"stall"}),", ",(0,V.jsx)(b.code,{children:"fault"}),", ",(0,V.jsx)(b.code,{children:"soften"}),", ",(0,V.jsx)(b.code,{children:"aside"}),", ",(0,V.jsx)(b.code,{children:"nest"}),", ",(0,V.jsx)(b.code,{children:"nest-mid"}),", ",(0,V.jsx)(b.code,{children:"nest-leaf"}),", ",(0,V.jsx)(b.code,{children:"brood"}),", and ",(0,V.jsx)(b.code,{children:"brood-child"}),". ",(0,V.jsx)(b.code,{children:"createRegistry"})," throws ",(0,V.jsx)(b.code,{children:"`Unknown flow ${name}`"})," from ",(0,V.jsx)(b.code,{children:"get"})," when a name is missing. ",(0,V.jsx)(b.code,{children:"ensureChild"})," calls ",(0,V.jsx)(b.code,{children:"registry.get(flowName)"})," for the child flow."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"bindOrganization"})," in ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/steps.ts"})," binds each step onto every flow. The kind is ",(0,V.jsx)(b.code,{children:"fixture-"})," plus the step name: ",(0,V.jsx)(b.code,{children:"fixture-dwell"}),", ",(0,V.jsx)(b.code,{children:"fixture-stall"}),", ",(0,V.jsx)(b.code,{children:"fixture-miss"}),", ",(0,V.jsx)(b.code,{children:"fixture-sprout"}),", and ",(0,V.jsx)(b.code,{children:"fixture-brood"}),". ",(0,V.jsx)(b.code,{children:"fixtureSteps"})," stores each bound step under ",(0,V.jsx)(b.code,{children:"flow/step"}),". ",(0,V.jsx)(b.code,{children:"dwell"})," also answers ",(0,V.jsx)(b.code,{children:"mark"})," and ",(0,V.jsx)(b.code,{children:"pass-1"})," through ",(0,V.jsx)(b.code,{children:"pass-10"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"dwell"})," waits the configured milliseconds, then returns done. ",(0,V.jsx)(b.code,{children:"stall"})," throws ",(0,V.jsx)(b.code,{children:"StepHeld"}),". ",(0,V.jsx)(b.code,{children:"miss"})," returns ",(0,V.jsx)(b.code,{children:'{ kind: "result", status: "failed", discriminant: "failed" }'}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"runJob"})," loads the bound step with ",(0,V.jsx)(b.code,{children:"stepBinding"}),". A thrown ",(0,V.jsx)(b.code,{children:"StepHeld"})," returns before ",(0,V.jsx)(b.code,{children:"acceptResult"}),". When ",(0,V.jsx)(b.code,{children:"implementation.run"})," throws and ",(0,V.jsx)(b.code,{children:"openingFor"})," is ",(0,V.jsx)(b.code,{children:"optional"})," or ",(0,V.jsx)(b.code,{children:"detached"}),", ",(0,V.jsx)(b.code,{children:"runJob"})," sends ",(0,V.jsx)(b.code,{children:'{ kind: "result", status: "failed", discriminant: "failed" }'})," to ",(0,V.jsx)(b.code,{children:"acceptResult"}),". Any other thrown error is rethrown."]}),"\n",(0,V.jsx)(b.h3,{id:"the-run",children:"The run"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"apps/orchestrator/src/server.ts"})," calls ",(0,V.jsx)(b.code,{children:"openFixtureService"})," with ",(0,V.jsx)(b.code,{children:"createMemoryClient"})," and ",(0,V.jsx)(b.code,{children:"watchWorkers: true"}),". That opens ",(0,V.jsx)(b.code,{children:"createService"})," with ",(0,V.jsx)(b.code,{children:"flows: fixtureFlows"}),", ",(0,V.jsx)(b.code,{children:"steps: fixtureSteps"}),", ",(0,V.jsx)(b.code,{children:"entities: createPostgresEntities(pool)"}),", ",(0,V.jsx)(b.code,{children:"metrics: createMetricPublisher(redis)"}),", and ",(0,V.jsx)(b.code,{children:"metricReads: createMetricsReader(clickhouse)"}),". ",(0,V.jsx)(b.code,{children:"server.ts"})," does not call ",(0,V.jsx)(b.code,{children:"startRun"}),". ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture seed"})," calls ",(0,V.jsx)(b.code,{children:"seedOrganization"})," only when the organization exports ",(0,V.jsx)(b.code,{children:"catalogSeed"}),". The fixture does not, so that command starts no run and opens no client database. The log line is ",(0,V.jsx)(b.code,{children:"seeded fixture 0 runs"}),". ",(0,V.jsx)(b.code,{children:"startRun"})," writes a run into the orchestrator database."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"startRun"})," loads the row with ",(0,V.jsx)(b.code,{children:"loadFocus"}),", calls ",(0,V.jsx)(b.code,{children:"engine.request"}),", then ",(0,V.jsx)(b.code,{children:"persist"}),", then ",(0,V.jsx)(b.code,{children:"afterCommit"}),". ",(0,V.jsx)(b.code,{children:"request"})," addresses the entity with ",(0,V.jsx)(b.code,{children:"entityId"}),". A run whose ",(0,V.jsx)(b.code,{children:"status"})," is ",(0,V.jsx)(b.code,{children:"running"})," returns ",(0,V.jsx)(b.code,{children:'{ kind: "waiting" }'}),". A ",(0,V.jsx)(b.code,{children:"success"})," run with ",(0,V.jsx)(b.code,{children:"finishedAt"})," and ",(0,V.jsx)(b.code,{children:"validityEndsAt"})," set, and ",(0,V.jsx)(b.code,{children:"input.at"})," at or before that instant, returns ",(0,V.jsx)(b.code,{children:'{ kind: "recorded" }'}),". Every other request goes through ",(0,V.jsx)(b.code,{children:"begin"}),". ",(0,V.jsx)(b.code,{children:"begin"})," adds one to ",(0,V.jsx)(b.code,{children:"generation"}),", sets ",(0,V.jsx)(b.code,{children:"run.status"})," to ",(0,V.jsx)(b.code,{children:"running"}),", copies ",(0,V.jsx)(b.code,{children:"input.startingData"}),", clears ",(0,V.jsx)(b.code,{children:"validityEndsAt"}),", and calls ",(0,V.jsx)(b.code,{children:"drive"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"drive"})," calls ",(0,V.jsx)(b.code,{children:"applySilence"}),", then ",(0,V.jsx)(b.code,{children:"reread"}),". ",(0,V.jsx)(b.code,{children:"applySilence"})," pushes ",(0,V.jsx)(b.code,{children:"jobFor"})," while the step has no result, ",(0,V.jsx)(b.code,{children:"now"})," is at or after ",(0,V.jsx)(b.code,{children:"silenceDueAt"}),", and ",(0,V.jsx)(b.code,{children:"resendCount"})," is still under ",(0,V.jsx)(b.code,{children:"maxResends"}),". At ",(0,V.jsx)(b.code,{children:"maxResends"})," it writes status ",(0,V.jsx)(b.code,{children:"not_finished"})," and calls ",(0,V.jsx)(b.code,{children:"pushStep"}),". ",(0,V.jsx)(b.code,{children:"Service.advance"})," calls ",(0,V.jsx)(b.code,{children:"engine.advance"})," for each batch from ",(0,V.jsx)(b.code,{children:"session.due"}),". ",(0,V.jsx)(b.code,{children:"due"})," in ",(0,V.jsx)(b.code,{children:"createPostgresEntities"})," selects ",(0,V.jsx)(b.code,{children:"status = 'running' and silence_due_at <= $1"}),". ",(0,V.jsx)(b.code,{children:"server.ts"})," reaches the engine through ",(0,V.jsx)(b.code,{children:"openFixtureService"}),", and it also calls ",(0,V.jsx)(b.code,{children:"startMetricFlush"}),", ",(0,V.jsx)(b.code,{children:"createReadServer"}),", and ",(0,V.jsx)(b.code,{children:"server.listen"}),". ",(0,V.jsx)(b.code,{children:"seedOrganization"})," is the ",(0,V.jsx)(b.code,{children:"startRun"})," for an exported ",(0,V.jsx)(b.code,{children:"catalogSeed"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"afterCommit"})," calls ",(0,V.jsx)(b.code,{children:"enqueueStep"})," for each job and ",(0,V.jsx)(b.code,{children:"metrics.publish"})," with ",(0,V.jsx)(b.code,{children:"flowMetrics"})," and ",(0,V.jsx)(b.code,{children:"stepMetrics"}),". ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/work.ts"})," starts ",(0,V.jsx)(b.code,{children:"createStepWorker"})," for each kind. Each job calls ",(0,V.jsx)(b.code,{children:"consumeAssignment"}),". The orchestrator applies the published result and calls ",(0,V.jsx)(b.code,{children:"engine.acceptResult"})," inside ",(0,V.jsx)(b.code,{children:"deps.entities.transaction"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"settle"})," returns at once when ",(0,V.jsx)(b.code,{children:"entity.run.status"})," is not ",(0,V.jsx)(b.code,{children:"running"}),". Otherwise it sets ",(0,V.jsx)(b.code,{children:"status"})," and ",(0,V.jsx)(b.code,{children:"finishedAt"}),", clears ",(0,V.jsx)(b.code,{children:"wait"}),", and pushes one ",(0,V.jsx)(b.code,{children:"FlowMetric"})," with that ",(0,V.jsx)(b.code,{children:"outcome"}),", the run ",(0,V.jsx)(b.code,{children:"generation"}),", and ",(0,V.jsx)(b.code,{children:"durationMs"}),". On ",(0,V.jsx)(b.code,{children:"success"}),", ",(0,V.jsx)(b.code,{children:"validityEndsAt"})," is ",(0,V.jsx)(b.code,{children:"addMs(now, validityDurationMs)"})," from ",(0,V.jsx)(b.code,{children:"registry.get(entity.flow)"}),". ",(0,V.jsx)(b.code,{children:"pushStep"})," pushes one ",(0,V.jsx)(b.code,{children:"StepMetric"})," when ",(0,V.jsx)(b.code,{children:"discarded"})," is unset and the step has ",(0,V.jsx)(b.code,{children:"openedAt"}),", ",(0,V.jsx)(b.code,{children:"endedAt"}),", and ",(0,V.jsx)(b.code,{children:"result"}),". When ",(0,V.jsx)(b.code,{children:"acceptResult"})," receives a worker id, that id is on the step metric. A silence ",(0,V.jsx)(b.code,{children:"not_finished"})," has no worker id. ",(0,V.jsx)(b.code,{children:"FlowMetric"})," and ",(0,V.jsx)(b.code,{children:"StepMetric"})," are declared in ",(0,V.jsx)(b.code,{children:"packages/contract/src/index.ts"}),"."]}),"\n",(0,V.jsx)(b.h3,{id:"transient-files",children:"Transient files"}),"\n",(0,V.jsxs)(b.p,{children:["A step writes a transient file with ",(0,V.jsx)(b.code,{children:"input.files.put"}),". The bytes live in the platform bucket under ",(0,V.jsx)(b.code,{children:"runs/{organization}/{flow}/{identifier}/{generation}/{name}"}),". ",(0,V.jsx)(b.code,{children:"consumeAssignment"})," records every name that ",(0,V.jsx)(b.code,{children:"put"})," wrote and stores that list on the step result. A replay from a step publishes a copy of each kept name into the new generation before the jobs of that generation are sent. A full replay does not copy. The flow run page in the console lists them. Reading a name still uses the current generation."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"listRun"})," on ",(0,V.jsx)(b.code,{children:"TransientFiles"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/transient-files.ts"})," returns ",(0,V.jsx)(b.code,{children:"{ name, bytes }[]"})," for that prefix, sorted by name. ",(0,V.jsx)(b.code,{children:"GET /entities/:id?files=1"})," on ",(0,V.jsx)(b.code,{children:"ReadController"})," calls ",(0,V.jsx)(b.code,{children:"listRunFilesFor"})," after ",(0,V.jsx)(b.code,{children:"parseFlowRunPath"})," and ",(0,V.jsx)(b.code,{children:"readGeneration"}),". The run must still be stored and the person must belong to that organization. ",(0,V.jsx)(b.code,{children:"GET /entities/:id?file={name}"})," returns the bytes with the stored content type. A name that is not one segment, or a missing file, is 404."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"EntityView"})," in ",(0,V.jsx)(b.code,{children:"apps/console/src/design/views.tsx"})," renders a ",(0,V.jsx)(b.code,{children:"DataTable"})," titled Files, empty copy ",(0,V.jsx)(b.code,{children:"No file."}),", page size 50. ",(0,V.jsx)(b.code,{children:"EntityScreen"})," loads that list with ",(0,V.jsx)(b.code,{children:"listRunFiles"})," and does not send ",(0,V.jsx)(b.code,{children:"files"})," on the 2s tree poll. A row opens a dialog: ",(0,V.jsx)(b.code,{children:"readRunFile"})," previews JSON or text under 1 MiB, and Download goes to ",(0,V.jsx)(b.code,{children:"GET /api/run-file"}),". After the flow run retention the run is gone and those files are gone."]}),"\n",(0,V.jsx)(b.h3,{id:"postgres-and-clickhouse",children:"Postgres and ClickHouse"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"persist"})," calls ",(0,V.jsx)(b.code,{children:"session.upsert"}),". ",(0,V.jsx)(b.code,{children:"createPostgresEntities"})," inserts the run into ",(0,V.jsx)(b.code,{children:"entities"})," and, on conflict of ",(0,V.jsx)(b.code,{children:"organization_id, flow, identity"}),", updates ",(0,V.jsx)(b.code,{children:"status"}),", ",(0,V.jsx)(b.code,{children:"generation"}),", ",(0,V.jsx)(b.code,{children:"started_at"}),", ",(0,V.jsx)(b.code,{children:"finished_at"}),", ",(0,V.jsx)(b.code,{children:"validity_ends_at"}),", ",(0,V.jsx)(b.code,{children:"silence_due_at"}),", ",(0,V.jsx)(b.code,{children:"rule"}),", ",(0,V.jsx)(b.code,{children:"starting_data"}),", ",(0,V.jsx)(b.code,{children:"operations"}),", and ",(0,V.jsx)(b.code,{children:"wait"}),". That row is the current flow run. ",(0,V.jsx)(b.code,{children:"server.ts"})," passes ",(0,V.jsx)(b.code,{children:"createPostgresEntities(pool)"})," as ",(0,V.jsx)(b.code,{children:"entities"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"createMetricPublisher"})," appends each metric to the Redis stream ",(0,V.jsx)(b.code,{children:"metrics"})," on the shared Redis client. That client also writes dispatch tokens. ",(0,V.jsx)(b.code,{children:"LoopsService"})," calls ",(0,V.jsx)(b.code,{children:"startMetricFlush"})," and ",(0,V.jsx)(b.code,{children:"createRedisResultBus"})," each with ",(0,V.jsx)(b.code,{children:"redis.duplicate()"}),". A blocking read on ",(0,V.jsx)(b.code,{children:"metrics"})," does not stall ",(0,V.jsx)(b.code,{children:"step-results"}),", and the reverse does not stall the shared client. ",(0,V.jsx)(b.code,{children:"startMetricFlush"})," inserts flow rows with ",(0,V.jsx)(b.code,{children:"insertFlowMetrics"})," into ",(0,V.jsx)(b.code,{children:"flow_run_metrics"})," and step rows with ",(0,V.jsx)(b.code,{children:"insertStepMetrics"})," into ",(0,V.jsx)(b.code,{children:"step_run_metrics"}),". ",(0,V.jsx)(b.code,{children:"onApplicationShutdown"})," calls ",(0,V.jsx)(b.code,{children:"quit()"})," on those two duplicated clients."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"flowsFor"})," sets the list ",(0,V.jsx)(b.code,{children:"entities"})," from ",(0,V.jsx)(b.code,{children:"countEntities"})," and ",(0,V.jsx)(b.code,{children:"running"})," from ",(0,V.jsx)(b.code,{children:"countRunning"}),". ",(0,V.jsx)(b.code,{children:"mergeFlows"})," copies each flow's ",(0,V.jsx)(b.code,{children:"entities"})," and ",(0,V.jsx)(b.code,{children:"running"})," from ",(0,V.jsx)(b.code,{children:"countsByFlow"}),", and includes every flow registered in ",(0,V.jsx)(b.code,{children:"deps.flows"})," even when that flow has no entity and no run. Those three methods count rows in ",(0,V.jsx)(b.code,{children:"entities"}),". ",(0,V.jsx)(b.code,{children:"countRunning"})," and the ",(0,V.jsx)(b.code,{children:"running"})," column keep ",(0,V.jsx)(b.code,{children:"status = 'running'"}),". ",(0,V.jsx)(b.code,{children:"mergeFlows"})," fills ",(0,V.jsx)(b.code,{children:"runs"}),", ",(0,V.jsx)(b.code,{children:"success"}),", ",(0,V.jsx)(b.code,{children:"failure"}),", and ",(0,V.jsx)(b.code,{children:"notFinished"})," from ",(0,V.jsx)(b.code,{children:"flowOutcomes"}),", ",(0,V.jsx)(b.code,{children:"p50Ms"})," from ",(0,V.jsx)(b.code,{children:"flowDurations"}),", and ",(0,V.jsx)(b.code,{children:"trend"})," from ",(0,V.jsx)(b.code,{children:"flowTrend"}),". ",(0,V.jsx)(b.code,{children:"flowsFor"})," sets ",(0,V.jsx)(b.code,{children:"failureRate"})," to ",(0,V.jsx)(b.code,{children:"failure / runs"})," when ",(0,V.jsx)(b.code,{children:"runs"})," is not ",(0,V.jsx)(b.code,{children:"0"}),". ",(0,V.jsx)(b.code,{children:"createMetricsReader"})," reads the outcome, duration, and trend queries from ",(0,V.jsx)(b.code,{children:"flow_runs_hourly"}),". ",(0,V.jsx)(b.code,{children:"flowFor"})," reads that flow's ",(0,V.jsx)(b.code,{children:"entities"})," and ",(0,V.jsx)(b.code,{children:"running"})," from ",(0,V.jsx)(b.code,{children:"countsByFlow"}),", sets ",(0,V.jsx)(b.code,{children:"failureRate"})," to ",(0,V.jsx)(b.code,{children:"failure / runs"})," when ",(0,V.jsx)(b.code,{children:"runs"})," is not ",(0,V.jsx)(b.code,{children:"0"}),", fills ",(0,V.jsx)(b.code,{children:"series"})," from ",(0,V.jsx)(b.code,{children:"flowSeries"}),", reads step rows from ",(0,V.jsx)(b.code,{children:"stepCounts"})," on ",(0,V.jsx)(b.code,{children:"step_runs_hourly"}),", and reads ",(0,V.jsx)(b.code,{children:"reasons"})," from ",(0,V.jsx)(b.code,{children:"reasons_daily"}),"."]}),"\n",(0,V.jsx)(b.h3,{id:"the-flows-screen",children:"The Flows screen"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"createReadServer"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/http.ts"})," handles ",(0,V.jsx)(b.code,{children:"GET"}),". Any other method is status ",(0,V.jsx)(b.code,{children:"405"}),". ",(0,V.jsx)(b.code,{children:"GET /organizations/:organizationId/flows"})," calls ",(0,V.jsx)(b.code,{children:"flowsFor"})," after ",(0,V.jsx)(b.code,{children:"metricRange"}),". ",(0,V.jsx)(b.code,{children:"GET /organizations/:organizationId/flows/:flow"})," calls ",(0,V.jsx)(b.code,{children:"flowFor"}),". The resolver in ",(0,V.jsx)(b.code,{children:"server.ts"})," returns the text after ",(0,V.jsx)(b.code,{children:"Bearer "}),". ",(0,V.jsx)(b.code,{children:"POST /organizations/:organizationId/flows/:flow"})," on ",(0,V.jsx)(b.code,{children:"ReadController"})," calls ",(0,V.jsx)(b.code,{children:"openFlow"}),", which calls ",(0,V.jsx)(b.code,{children:"startRun"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"FlowsPage"})," in ",(0,V.jsx)(b.code,{children:"apps/console/src/app/organizations/[organizationId]/flows/page.tsx"})," calls ",(0,V.jsx)(b.code,{children:"currentPerson"})," and renders ",(0,V.jsx)(b.code,{children:"SignedOutView"})," when that person is missing. It loads the list with ",(0,V.jsx)(b.code,{children:"readOrchestrator"})," at ",(0,V.jsx)(b.code,{children:"/organizations/${organizationId}/flows?range=${range}"})," and renders ",(0,V.jsx)(b.code,{children:"FlowsRoute"})," inside ",(0,V.jsx)(b.code,{children:"ConsoleFrame"})," with ",(0,V.jsx)(b.code,{children:'active="flows"'}),". The nav item labeled ",(0,V.jsx)(b.code,{children:"Flows"})," in ",(0,V.jsx)(b.code,{children:"ConsoleFrame"})," pushes ",(0,V.jsx)(b.code,{children:"`/organizations/${organizationId}/flows`"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"FlowsView"})," shows the title ",(0,V.jsx)(b.code,{children:"Flows"}),", stats for Entities, Flow runs, Failure rate, and Running now, and one table row per flow. ",(0,V.jsx)(b.code,{children:"FlowsRoute"})," sends ",(0,V.jsx)(b.code,{children:"onOpen"})," to ",(0,V.jsx)(b.code,{children:"`/organizations/${organizationId}/flows/${flow}?range=${range}`"}),". ",(0,V.jsx)(b.code,{children:"FlowPage"})," loads that path with ",(0,V.jsx)(b.code,{children:"readOrchestrator"})," and calls ",(0,V.jsx)(b.code,{children:"notFound()"})," when the load fails. The detail view shows the flow name, flow runs, step runs, failure rate, p50, Running now, the outcome series, the step table, and the reason list. The Start button opens a dialog for the identity and the payload. ",(0,V.jsx)(b.code,{children:"startFlow"})," in ",(0,V.jsx)(b.code,{children:"apps/console/src/app/organizations/[organizationId]/flows/actions.ts"})," posts that body to ",(0,V.jsx)(b.code,{children:"POST /organizations/:organizationId/flows/:flow"}),". ",(0,V.jsx)(b.code,{children:"openFlow"})," calls ",(0,V.jsx)(b.code,{children:"startRun"})," with silence duration ",(0,V.jsx)(b.code,{children:"60_000"}),", resend maximum ",(0,V.jsx)(b.code,{children:"1"}),", and the rule from the flow definition. ",(0,V.jsx)(b.code,{children:"flowRange"})," returns ",(0,V.jsx)(b.code,{children:"24h"}),", ",(0,V.jsx)(b.code,{children:"7d"}),", or ",(0,V.jsx)(b.code,{children:"30d"}),", and returns ",(0,V.jsx)(b.code,{children:"24h"})," for any other query value."]}),"\n",(0,V.jsx)(b.h2,{id:"getting-started",children:"Getting started"}),"\n",(0,V.jsxs)(b.ol,{children:["\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["In ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/perf/"}),", add a ",(0,V.jsx)(b.code,{children:"FlowFunction"})," next to ",(0,V.jsx)(b.code,{children:"paceFlow"}),", ",(0,V.jsx)(b.code,{children:"loadFlow"}),", ",(0,V.jsx)(b.code,{children:"stallFlow"}),", ",(0,V.jsx)(b.code,{children:"faultFlow"}),", ",(0,V.jsx)(b.code,{children:"softenFlow"}),", ",(0,V.jsx)(b.code,{children:"asideFlow"}),", ",(0,V.jsx)(b.code,{children:"nestFlow"}),", and ",(0,V.jsx)(b.code,{children:"broodFlow"}),". Call ",(0,V.jsx)(b.code,{children:"openStep"}),", ",(0,V.jsx)(b.code,{children:"openOptionalStep"}),", ",(0,V.jsx)(b.code,{children:"openDetachedStep"}),", ",(0,V.jsx)(b.code,{children:"openChildren"}),", or ",(0,V.jsx)(b.code,{children:"finish"})," the way those flows do. ",(0,V.jsx)(b.code,{children:"paceFlow"})," calls ",(0,V.jsx)(b.code,{children:"openStep(dwellStep)"})," and ",(0,V.jsx)(b.code,{children:'openStep("mark")'}),". ",(0,V.jsx)(b.code,{children:"softenFlow"})," calls ",(0,V.jsx)(b.code,{children:"openOptionalStep(missStep)"}),". ",(0,V.jsx)(b.code,{children:"asideFlow"})," calls ",(0,V.jsx)(b.code,{children:"openDetachedStep(stallStep)"}),". ",(0,V.jsx)(b.code,{children:"nestFlow"})," calls ",(0,V.jsx)(b.code,{children:"openChildren(nestMidFlow, asChildren(sprouted.body))"}),". ",(0,V.jsx)(b.code,{children:"broodFlow"})," calls ",(0,V.jsx)(b.code,{children:"openChildren(broodChildFlow, asChildren(opened.body))"}),". ",(0,V.jsx)(b.code,{children:"waitGroup"}),", ",(0,V.jsx)(b.code,{children:"choose"}),", and ",(0,V.jsx)(b.code,{children:"fail"})," are on ",(0,V.jsx)(b.code,{children:"FlowContext"}),". Append the flow to ",(0,V.jsx)(b.code,{children:"flows"})," in ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/index.ts"}),". ",(0,V.jsx)(b.code,{children:"fixtureFlows"})," is that list."]}),"\n"]}),"\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["Register the function with ",(0,V.jsx)(b.code,{children:"defineFlow"}),", which sets ",(0,V.jsx)(b.code,{children:"name"}),", ",(0,V.jsx)(b.code,{children:"entityType"}),", ",(0,V.jsx)(b.code,{children:"validityDurationMs"}),", ",(0,V.jsx)(b.code,{children:"source"}),", and ",(0,V.jsx)(b.code,{children:"run"}),", and append that value to ",(0,V.jsx)(b.code,{children:"flows"}),". Register each step implementation on the ",(0,V.jsx)(b.code,{children:"steps"})," array in ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/steps.ts"}),". ",(0,V.jsx)(b.code,{children:"bindOrganization"})," writes ",(0,V.jsx)(b.code,{children:"`${flow}/${step}`"})," and sets the kind to ",(0,V.jsx)(b.code,{children:"`fixture-${step.name}`"}),"."]}),"\n"]}),"\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["Copy ",(0,V.jsx)(b.code,{children:".env.example"})," to ",(0,V.jsx)(b.code,{children:".env"})," in the repository root. ",(0,V.jsx)(b.code,{children:"loadRootEnv"})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/env.ts"})," reads that file. ",(0,V.jsx)(b.code,{children:"requiredEnv"})," reads ",(0,V.jsx)(b.code,{children:"DATABASE_URL"}),", ",(0,V.jsx)(b.code,{children:"REDIS_URL"}),", and ",(0,V.jsx)(b.code,{children:"CLICKHOUSE_URL"}),", and throws ",(0,V.jsx)(b.code,{children:"${name} is required"})," when one is missing. Start the orchestrator Postgres with ",(0,V.jsx)(b.code,{children:"npx supabase start"}),". Start Redis and ClickHouse with ",(0,V.jsx)(b.code,{children:"docker compose up -d redis clickhouse"}),". The ",(0,V.jsx)(b.code,{children:"redis"})," and ",(0,V.jsx)(b.code,{children:"clickhouse"})," services are the ones in ",(0,V.jsx)(b.code,{children:"docker-compose.yml"}),". Run ",(0,V.jsx)(b.code,{children:"npx supabase status"})," and set ",(0,V.jsx)(b.code,{children:"NEXT_PUBLIC_SUPABASE_ANON_KEY"})," in ",(0,V.jsx)(b.code,{children:".env"})," to the anon key it prints. ",(0,V.jsx)(b.code,{children:"supabaseAnonKey"})," in ",(0,V.jsx)(b.code,{children:"apps/console/src/lib/supabase-env.ts"})," drops an empty value, and ",(0,V.jsx)(b.code,{children:"LoginPage"})," then renders ",(0,V.jsx)(b.code,{children:"SignInForm"})," with ",(0,V.jsx)(b.code,{children:"configured={false}"}),"."]}),"\n"]}),"\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["Run ",(0,V.jsx)(b.code,{children:"pnpm --filter cue-orchestrator serve"}),". The ",(0,V.jsx)(b.code,{children:"serve"})," script in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/package.json"})," runs ",(0,V.jsx)(b.code,{children:"tsx src/server.ts"}),". ",(0,V.jsx)(b.code,{children:"server.ts"})," calls ",(0,V.jsx)(b.code,{children:"openFixtureService"})," with ",(0,V.jsx)(b.code,{children:"fixtureFlows"})," and ",(0,V.jsx)(b.code,{children:"fixtureSteps"}),", then ",(0,V.jsx)(b.code,{children:'server.listen(3001, "0.0.0.0")'}),". It does not call ",(0,V.jsx)(b.code,{children:"startRun"}),". The log line is ",(0,V.jsx)(b.code,{children:"orchestrator http://127.0.0.1:3001"}),"."]}),"\n"]}),"\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["In a second terminal, run ",(0,V.jsx)(b.code,{children:"pnpm --filter @ascentstudio/cue-org-fixture work"}),". The ",(0,V.jsx)(b.code,{children:"work"})," script in ",(0,V.jsx)(b.code,{children:"organizations/fixture/package.json"})," runs ",(0,V.jsx)(b.code,{children:"tsx src/work.ts"}),". ",(0,V.jsx)(b.code,{children:"work.ts"})," loads the organization's secrets once with ",(0,V.jsx)(b.code,{children:"readOrganizationSecrets"})," and ",(0,V.jsx)(b.code,{children:"installEnvironment"}),", then calls ",(0,V.jsx)(b.code,{children:"createStepWorker"}),". Each job calls ",(0,V.jsx)(b.code,{children:"consumeAssignment"}),". ",(0,V.jsx)(b.code,{children:"consumeAssignment"})," publishes the step result, the orchestrator applies it, and ",(0,V.jsx)(b.code,{children:"settle"})," pushes a ",(0,V.jsx)(b.code,{children:"FlowMetric"})," when it records ",(0,V.jsx)(b.code,{children:"success"}),", ",(0,V.jsx)(b.code,{children:"failure"}),", or ",(0,V.jsx)(b.code,{children:"not_finished"}),". ",(0,V.jsx)(b.code,{children:"startMetricFlush"})," in the orchestrator process inserts that metric into ClickHouse. The log line from ",(0,V.jsx)(b.code,{children:"work.ts"})," is ",(0,V.jsx)(b.code,{children:"fixture workers"})," plus the kind names. ",(0,V.jsx)(b.code,{children:"bindOrganization"})," names ",(0,V.jsx)(b.code,{children:"fixture-dwell"}),", ",(0,V.jsx)(b.code,{children:"fixture-stall"}),", ",(0,V.jsx)(b.code,{children:"fixture-miss"}),", ",(0,V.jsx)(b.code,{children:"fixture-sprout"}),", and ",(0,V.jsx)(b.code,{children:"fixture-brood"}),"."]}),"\n"]}),"\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["In a third terminal, run ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture seed"}),". The ",(0,V.jsx)(b.code,{children:"seed"})," script in ",(0,V.jsx)(b.code,{children:"organizations/fixture/package.json"})," runs ",(0,V.jsx)(b.code,{children:"cue seed"}),". The fixture does not export ",(0,V.jsx)(b.code,{children:"catalogSeed"}),", so the command opens nothing and the log line is ",(0,V.jsx)(b.code,{children:"seeded fixture 0 runs"}),". Load runs start with ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf"}),", ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf:load"}),", ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf:brood"}),", or ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf:brood:producer"}),". To remove runs an organization left behind, run ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture reset"}),". ",(0,V.jsx)(b.code,{children:"resetOrganization"})," deletes rows from ",(0,V.jsx)(b.code,{children:"entity_links"})," and ",(0,V.jsx)(b.code,{children:"entities"})," on the orchestrator database, drains the kind queues, and deletes that organization's metrics. The log line is ",(0,V.jsx)(b.code,{children:"reset fixture"}),". ",(0,V.jsx)(b.code,{children:"organizations"}),", ",(0,V.jsx)(b.code,{children:"memberships"}),", ",(0,V.jsx)(b.code,{children:"secrets"}),", and the person in ",(0,V.jsx)(b.code,{children:"deploy/supabase/seed.sql"})," stay."]}),"\n"]}),"\n",(0,V.jsxs)(b.li,{children:["\n",(0,V.jsxs)(b.p,{children:["In a fourth terminal, run ",(0,V.jsx)(b.code,{children:"pnpm --filter cue-console dev"}),". The ",(0,V.jsx)(b.code,{children:"dev"})," script in ",(0,V.jsx)(b.code,{children:"apps/console/package.json"})," runs ",(0,V.jsx)(b.code,{children:"next dev"}),". Open the URL that command prints, at ",(0,V.jsx)(b.code,{children:"/login"}),". ",(0,V.jsx)(b.code,{children:"LoginForm"})," calls ",(0,V.jsx)(b.code,{children:"signInWithPassword"})," for the Sign in button. The person inserted in ",(0,V.jsx)(b.code,{children:"deploy/supabase/seed.sql"})," has email ",(0,V.jsx)(b.code,{children:"pierre@ascent-studio.fr"}),", and the comment there says the password is that same string. ",(0,V.jsx)(b.code,{children:"on_auth_user_created"})," calls ",(0,V.jsx)(b.code,{children:"join_fixture"}),", which inserts a membership for organization ",(0,V.jsx)(b.code,{children:"fixture"}),". After sign-in, ",(0,V.jsx)(b.code,{children:"LoginForm"})," pushes ",(0,V.jsx)(b.code,{children:"/"}),". Open ",(0,V.jsx)(b.code,{children:"/organizations/fixture/flows"}),". ",(0,V.jsx)(b.code,{children:"FlowsPage"})," renders ",(0,V.jsx)(b.code,{children:"FlowsView"})," with the title ",(0,V.jsx)(b.code,{children:"Flows"}),". Click a row. ",(0,V.jsx)(b.code,{children:"FlowsRoute"})," opens ",(0,V.jsx)(b.code,{children:"/organizations/fixture/flows/"})," plus that flow name. Press Start, enter the identity and the payload, and the console opens ",(0,V.jsx)(b.code,{children:"/entities/"})," plus the organization, the flow, and the identity."]}),"\n"]}),"\n"]})]})}function af(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(ae,{...a})}):ae(a)}let ag={title:"Drivers"},ah=[],ai={contents:[{heading:"why",content:"A kind is one process. docs/usage/kinds.mdx describes that process. The jobs of that process run at the step concurrency and share one client. A step calls a function. The function opens the client once for that process."},{heading:"why",content:"The worker drains those jobs, then closes the Nest context, then exits. The organization closes the clients it opened."},{heading:"who",content:"You add a driver when a step implementation talks to PostgreSQL, Elasticsearch, ClickHouse, S3, Qdrant, or another service that keeps connections."},{heading:"who",content:"The drivers live in the organization checkout. The worker loads those secrets once, with installEnvironment, before it accepts jobs."},{heading:"one-client-for-the-process",content:"The organization package exports ./drivers. A published install that dropped package exports keeps the module at src/drivers/drivers.module.ts. driversModulePath in packages/supervisor/src/worker/worker.service.ts resolves that file. The catalog entry does not import the module, so loading the catalog does not load the clients."},{heading:"one-client-for-the-process",content:"When WORKER_RUNTIME is set, prepareOrganizationRuntime loads that module and calls warmupWorkerRuntime. WorkerModule in packages/supervisor/src/worker/worker.module.ts does not import the organization module. The module does not open a client when the process starts. A kind that never asks for a client opens nothing."},{heading:"one-client-for-the-process",content:"A handle stores the promise the opener returns. A second get returns that same promise. The opener reads the secret with environment from @ascentstudio/cue-contract. close waits for that promise when get has already been called, then closes the client. A second close returns the same promise. close before any get resolves without opening. get after close rejects."},{heading:"close-after-the-drain",content:"WorkerService.finish in packages/supervisor/src/worker/worker.service.ts drains the jobs. closeThenExit then closes the Nest context and exits. main.ts calls attach with that context after createApplicationContext. The process exits 0, or 75 when the command is drain-restart."},{heading:"close-after-the-drain",content:'WorkerService does not implement OnApplicationShutdown. A close that called that hook would run the drain again. A second run("drain-stop") in createShutdown (packages/engine/src/worker-control.ts) replaces an exit code of 75.'},{heading:"close-after-the-drain",content:"main.ts does not call enableShutdownHooks. The worker listens for SIGINT, SIGTERM, SIGHUP, and SIGQUIT itself. The drain finishes before the Nest context closes, and a restart still exits 75."},{heading:"the-cap",content:"The cap on a client stays below the step concurrency. The connections a service receives are the processes that call that driver, multiplied by the cap."},{heading:"the-orchestrator-database-stays-separate",content:"DATABASE_URL is the orchestrator database. A fixture worker does not open a second database. An organization driver that runs SQL opens another pool, and that pool reads its own secret."}],headings:[{id:"why",content:"Why"},{id:"who",content:"Who"},{id:"how",content:"How"},{id:"one-client-for-the-process",content:"One client for the process"},{id:"close-after-the-drain",content:"Close after the drain"},{id:"the-cap",content:"The cap"},{id:"the-orchestrator-database-stays-separate",content:"The orchestrator database stays separate"}]},aj=[{depth:2,url:"#why",title:(0,V.jsx)(V.Fragment,{children:"Why"})},{depth:2,url:"#who",title:(0,V.jsx)(V.Fragment,{children:"Who"})},{depth:2,url:"#how",title:(0,V.jsx)(V.Fragment,{children:"How"})},{depth:3,url:"#one-client-for-the-process",title:(0,V.jsx)(V.Fragment,{children:"One client for the process"})},{depth:3,url:"#close-after-the-drain",title:(0,V.jsx)(V.Fragment,{children:"Close after the drain"})},{depth:3,url:"#the-cap",title:(0,V.jsx)(V.Fragment,{children:"The cap"})},{depth:3,url:"#the-orchestrator-database-stays-separate",title:(0,V.jsx)(V.Fragment,{children:"The orchestrator database stays separate"})}];function ak(a){let b={code:"code",h2:"h2",h3:"h3",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h2,{id:"why",children:"Why"}),"\n",(0,V.jsxs)(b.p,{children:["A kind is one process. ",(0,V.jsx)(b.code,{children:"docs/usage/kinds.mdx"})," describes that process. The jobs of that process run at the step concurrency and share one client. A step calls a function. The function opens the client once for that process."]}),"\n",(0,V.jsx)(b.p,{children:"The worker drains those jobs, then closes the Nest context, then exits. The organization closes the clients it opened."}),"\n",(0,V.jsx)(b.h2,{id:"who",children:"Who"}),"\n",(0,V.jsx)(b.p,{children:"You add a driver when a step implementation talks to PostgreSQL, Elasticsearch, ClickHouse, S3, Qdrant, or another service that keeps connections."}),"\n",(0,V.jsxs)(b.p,{children:["The drivers live in the organization checkout. The worker loads those secrets once, with ",(0,V.jsx)(b.code,{children:"installEnvironment"}),", before it accepts jobs."]}),"\n",(0,V.jsx)(b.h2,{id:"how",children:"How"}),"\n",(0,V.jsx)(b.h3,{id:"one-client-for-the-process",children:"One client for the process"}),"\n",(0,V.jsxs)(b.p,{children:["The organization package exports ",(0,V.jsx)(b.code,{children:"./drivers"}),". A published install that dropped package exports keeps the module at ",(0,V.jsx)(b.code,{children:"src/drivers/drivers.module.ts"}),". ",(0,V.jsx)(b.code,{children:"driversModulePath"})," in ",(0,V.jsx)(b.code,{children:"packages/supervisor/src/worker/worker.service.ts"})," resolves that file. The catalog entry does not import the module, so loading the catalog does not load the clients."]}),"\n",(0,V.jsxs)(b.p,{children:["When ",(0,V.jsx)(b.code,{children:"WORKER_RUNTIME"})," is set, ",(0,V.jsx)(b.code,{children:"prepareOrganizationRuntime"})," loads that module and calls ",(0,V.jsx)(b.code,{children:"warmupWorkerRuntime"}),". ",(0,V.jsx)(b.code,{children:"WorkerModule"})," in ",(0,V.jsx)(b.code,{children:"packages/supervisor/src/worker/worker.module.ts"})," does not import the organization module. The module does not open a client when the process starts. A kind that never asks for a client opens nothing."]}),"\n",(0,V.jsxs)(b.p,{children:["A handle stores the promise the opener returns. A second ",(0,V.jsx)(b.code,{children:"get"})," returns that same promise. The opener reads the secret with ",(0,V.jsx)(b.code,{children:"environment"})," from ",(0,V.jsx)(b.code,{children:"@ascentstudio/cue-contract"}),". ",(0,V.jsx)(b.code,{children:"close"})," waits for that promise when ",(0,V.jsx)(b.code,{children:"get"})," has already been called, then closes the client. A second ",(0,V.jsx)(b.code,{children:"close"})," returns the same promise. ",(0,V.jsx)(b.code,{children:"close"})," before any ",(0,V.jsx)(b.code,{children:"get"})," resolves without opening. ",(0,V.jsx)(b.code,{children:"get"})," after ",(0,V.jsx)(b.code,{children:"close"})," rejects."]}),"\n",(0,V.jsx)(b.h3,{id:"close-after-the-drain",children:"Close after the drain"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"WorkerService.finish"})," in ",(0,V.jsx)(b.code,{children:"packages/supervisor/src/worker/worker.service.ts"})," drains the jobs. ",(0,V.jsx)(b.code,{children:"closeThenExit"})," then closes the Nest context and exits. ",(0,V.jsx)(b.code,{children:"main.ts"})," calls ",(0,V.jsx)(b.code,{children:"attach"})," with that context after ",(0,V.jsx)(b.code,{children:"createApplicationContext"}),". The process exits ",(0,V.jsx)(b.code,{children:"0"}),", or ",(0,V.jsx)(b.code,{children:"75"})," when the command is ",(0,V.jsx)(b.code,{children:"drain-restart"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"WorkerService"})," does not implement ",(0,V.jsx)(b.code,{children:"OnApplicationShutdown"}),". A close that called that hook would run the drain again. A second ",(0,V.jsx)(b.code,{children:'run("drain-stop")'})," in ",(0,V.jsx)(b.code,{children:"createShutdown"})," (",(0,V.jsx)(b.code,{children:"packages/engine/src/worker-control.ts"}),") replaces an exit code of ",(0,V.jsx)(b.code,{children:"75"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"main.ts"})," does not call ",(0,V.jsx)(b.code,{children:"enableShutdownHooks"}),". The worker listens for ",(0,V.jsx)(b.code,{children:"SIGINT"}),", ",(0,V.jsx)(b.code,{children:"SIGTERM"}),", ",(0,V.jsx)(b.code,{children:"SIGHUP"}),", and ",(0,V.jsx)(b.code,{children:"SIGQUIT"})," itself. The drain finishes before the Nest context closes, and a restart still exits ",(0,V.jsx)(b.code,{children:"75"}),"."]}),"\n",(0,V.jsx)(b.h3,{id:"the-cap",children:"The cap"}),"\n",(0,V.jsx)(b.p,{children:"The cap on a client stays below the step concurrency. The connections a service receives are the processes that call that driver, multiplied by the cap."}),"\n",(0,V.jsx)(b.h3,{id:"the-orchestrator-database-stays-separate",children:"The orchestrator database stays separate"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"DATABASE_URL"})," is the orchestrator database. A fixture worker does not open a second database. An organization driver that runs SQL opens another pool, and that pool reads its own secret."]})]})}function al(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(ak,{...a})}):ak(a)}let am={title:"Actions"},an=[],ao={contents:[{heading:"why",content:"A person can open the first entity of a flow, replay a flow, replay from a step, resend a job, run a step without applying its result, cancel a run or an open step, and end a validity. The first opening is that request. request still waits when a run is already open, and still returns the recorded result inside the validity duration."},{heading:"who",content:"You use these actions from the entity page. The buttons are on EntityView in apps/console/src/design/views.tsx. The page posts them through apps/console/src/app/entities/[...entityId]/actions.ts."},{heading:"how",content:"ReadController matches POST /entities/... in apps/orchestrator/src/nest/read.controller.ts and calls runEntityAction. A taken action responds 204. A run that is already open, or an action the state does not allow, responds 409. An unknown entity responds 404."},{heading:"replay",content:"replay in packages/engine/src/engine.ts returns waiting and no job while the run is running. Otherwise it calls begin with the stored starting data, the flow rule, and the payload from the dialog when one was sent. Validity is ignored. The generation increases and the tree is replaced."},{heading:"replay",content:"replayFrom keeps the operations before the chosen step and removes that step and everything after it, including inside a group or a taken arm. A cut group is not sealed. drive opens the step again. A result for a step that is no longer in the tree is ignored."},{heading:"resend-and-probe",content:"resend is the same step as the silence duration, taken now. resendCount increases, a job is sent, and at the resend maximum the step result is not finished."},{heading:"resend-and-probe",content:"probe on the service assigns a dispatch slot entity/step/probe, so the live job's packet stays. That packet carries the generation and apply: false. The worker copies both onto the result. The job stays an organization, an entity, a step, and a token. applyResult stores that result with saveProbe and does not call acceptResult. The entity view exposes it as probes. A result whose generation is not the current generation is ignored."},{heading:"cancel-and-validity",content:'cancelRun closes a running run as not finished without rereading the function. Each open step, including a detached step, receives { status: "not_finished", discriminant: "ended" }. Child entities keep running. Running parents that still link the entity are reread, so cancelling a child resumes the parent. A group that is already sealed does not change.'},{heading:"cancel-and-validity",content:"cancelMember writes that same result on an open step in a group that is not sealed, then rereads. The member has responded, so the rule can seal and the flow can continue."},{heading:"cancel-and-validity",content:"cancelDetached writes that result on an open detached step and does not change the flow outcome. The step is not sent again."},{heading:"cancel-and-validity",content:"endValidity clears validityEndsAt when the run is a success and that time is still ahead. The tree stays. The next request starts a run."}],headings:[{id:"why",content:"Why"},{id:"who",content:"Who"},{id:"how",content:"How"},{id:"replay",content:"Replay"},{id:"resend-and-probe",content:"Resend and probe"},{id:"cancel-and-validity",content:"Cancel and validity"}]},ap=[{depth:2,url:"#why",title:(0,V.jsx)(V.Fragment,{children:"Why"})},{depth:2,url:"#who",title:(0,V.jsx)(V.Fragment,{children:"Who"})},{depth:2,url:"#how",title:(0,V.jsx)(V.Fragment,{children:"How"})},{depth:3,url:"#replay",title:(0,V.jsx)(V.Fragment,{children:"Replay"})},{depth:3,url:"#resend-and-probe",title:(0,V.jsx)(V.Fragment,{children:"Resend and probe"})},{depth:3,url:"#cancel-and-validity",title:(0,V.jsx)(V.Fragment,{children:"Cancel and validity"})}];function aq(a){let b={code:"code",h2:"h2",h3:"h3",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h2,{id:"why",children:"Why"}),"\n",(0,V.jsxs)(b.p,{children:["A person can open the first entity of a flow, replay a flow, replay from a step, resend a job, run a step without applying its result, cancel a run or an open step, and end a validity. The first opening is that request. ",(0,V.jsx)(b.code,{children:"request"})," still waits when a run is already open, and still returns the recorded result inside the validity duration."]}),"\n",(0,V.jsx)(b.h2,{id:"who",children:"Who"}),"\n",(0,V.jsxs)(b.p,{children:["You use these actions from the entity page. The buttons are on ",(0,V.jsx)(b.code,{children:"EntityView"})," in ",(0,V.jsx)(b.code,{children:"apps/console/src/design/views.tsx"}),". The page posts them through ",(0,V.jsx)(b.code,{children:"apps/console/src/app/entities/[...entityId]/actions.ts"}),"."]}),"\n",(0,V.jsx)(b.h2,{id:"how",children:"How"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ReadController"})," matches ",(0,V.jsx)(b.code,{children:"POST /entities/..."})," in ",(0,V.jsx)(b.code,{children:"apps/orchestrator/src/nest/read.controller.ts"})," and calls ",(0,V.jsx)(b.code,{children:"runEntityAction"}),". A taken action responds ",(0,V.jsx)(b.code,{children:"204"}),". A run that is already open, or an action the state does not allow, responds ",(0,V.jsx)(b.code,{children:"409"}),". An unknown entity responds ",(0,V.jsx)(b.code,{children:"404"}),"."]}),"\n",(0,V.jsx)(b.h3,{id:"replay",children:"Replay"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"replay"})," in ",(0,V.jsx)(b.code,{children:"packages/engine/src/engine.ts"})," returns ",(0,V.jsx)(b.code,{children:"waiting"})," and no job while the run is running. Otherwise it calls ",(0,V.jsx)(b.code,{children:"begin"})," with the stored starting data, the flow rule, and the payload from the dialog when one was sent. Validity is ignored. The generation increases and the tree is replaced."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"replayFrom"})," keeps the operations before the chosen step and removes that step and everything after it, including inside a group or a taken arm. A cut group is not sealed. ",(0,V.jsx)(b.code,{children:"drive"})," opens the step again. A result for a step that is no longer in the tree is ignored."]}),"\n",(0,V.jsx)(b.h3,{id:"resend-and-probe",children:"Resend and probe"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"resend"})," is the same step as the silence duration, taken now. ",(0,V.jsx)(b.code,{children:"resendCount"})," increases, a job is sent, and at the resend maximum the step result is not finished."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"probe"})," on the service assigns a dispatch slot ",(0,V.jsx)(b.code,{children:"entity/step/probe"}),", so the live job's packet stays. That packet carries the generation and ",(0,V.jsx)(b.code,{children:"apply: false"}),". The worker copies both onto the result. The job stays an organization, an entity, a step, and a token. ",(0,V.jsx)(b.code,{children:"applyResult"})," stores that result with ",(0,V.jsx)(b.code,{children:"saveProbe"})," and does not call ",(0,V.jsx)(b.code,{children:"acceptResult"}),". The entity view exposes it as ",(0,V.jsx)(b.code,{children:"probes"}),". A result whose ",(0,V.jsx)(b.code,{children:"generation"})," is not the current generation is ignored."]}),"\n",(0,V.jsx)(b.h3,{id:"cancel-and-validity",children:"Cancel and validity"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"cancelRun"})," closes a running run as not finished without rereading the function. Each open step, including a detached step, receives ",(0,V.jsx)(b.code,{children:'{ status: "not_finished", discriminant: "ended" }'}),". Child entities keep running. Running parents that still link the entity are reread, so cancelling a child resumes the parent. A group that is already sealed does not change."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"cancelMember"})," writes that same result on an open step in a group that is not sealed, then rereads. The member has responded, so the rule can seal and the flow can continue."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"cancelDetached"})," writes that result on an open detached step and does not change the flow outcome. The step is not sent again."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"endValidity"})," clears ",(0,V.jsx)(b.code,{children:"validityEndsAt"})," when the run is a success and that time is still ahead. The tree stays. The next request starts a run."]})]})}function ar(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(aq,{...a})}):aq(a)}let as={title:"Domain Docs"},at=[],au={contents:[{heading:"domain-docs",content:"How the engineering skills should consume this repo's domain documentation when exploring the codebase."},{heading:"before-exploring-read-these",content:"CONTEXT.md at the repo root, or"},{heading:"before-exploring-read-these",content:"CONTEXT-MAP.md at the repo root if it exists — it points at one CONTEXT.md per context. Read each one relevant to the topic."},{heading:"before-exploring-read-these",content:"docs/adr/ — read ADRs that touch the area you're about to work in. In multi-context repos, also check src/<context>/docs/adr/ for context-scoped decisions."},{heading:"before-exploring-read-these",content:"If any of these files don't exist, proceed silently. Don't flag their absence; don't suggest creating them upfront. The /domain-modeling skill (reached via /grill-with-docs and /improve-codebase-architecture) creates them lazily when terms or decisions actually get resolved."},{heading:"file-structure",content:"Single-context repo (most repos):"},{heading:"file-structure",content:"Multi-context repo (presence of CONTEXT-MAP.md at the root):"},{heading:"use-the-glossarys-vocabulary",content:"When your output names a domain concept (in an issue title, a refactor proposal, a hypothesis, a test name), use the term as defined in CONTEXT.md. Don't drift to synonyms the glossary explicitly avoids."},{heading:"use-the-glossarys-vocabulary",content:"If the concept you need isn't in the glossary yet, that's a signal — either you're inventing language the project doesn't use (reconsider) or there's a real gap (note it for /domain-modeling)."},{heading:"flag-adr-conflicts",content:"If your output contradicts an existing ADR, surface it explicitly rather than silently overriding:"},{heading:"flag-adr-conflicts",content:"Contradicts ADR-0007 (event-sourced orders) — but worth reopening because…"}],headings:[{id:"domain-docs",content:"Domain Docs"},{id:"before-exploring-read-these",content:"Before exploring, read these"},{id:"file-structure",content:"File structure"},{id:"use-the-glossarys-vocabulary",content:"Use the glossary's vocabulary"},{id:"flag-adr-conflicts",content:"Flag ADR conflicts"}]},av=[{depth:1,url:"#domain-docs",title:(0,V.jsx)(V.Fragment,{children:"Domain Docs"})},{depth:2,url:"#before-exploring-read-these",title:(0,V.jsx)(V.Fragment,{children:"Before exploring, read these"})},{depth:2,url:"#file-structure",title:(0,V.jsx)(V.Fragment,{children:"File structure"})},{depth:2,url:"#use-the-glossarys-vocabulary",title:(0,V.jsx)(V.Fragment,{children:"Use the glossary's vocabulary"})},{depth:2,url:"#flag-adr-conflicts",title:(0,V.jsx)(V.Fragment,{children:"Flag ADR conflicts"})}];function aw(a){let b={blockquote:"blockquote",code:"code",em:"em",h1:"h1",h2:"h2",li:"li",p:"p",pre:"pre",span:"span",strong:"strong",ul:"ul",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"domain-docs",children:"Domain Docs"}),"\n",(0,V.jsx)(b.p,{children:"How the engineering skills should consume this repo's domain documentation when exploring the codebase."}),"\n",(0,V.jsx)(b.h2,{id:"before-exploring-read-these",children:"Before exploring, read these"}),"\n",(0,V.jsxs)(b.ul,{children:["\n",(0,V.jsxs)(b.li,{children:[(0,V.jsx)(b.strong,{children:(0,V.jsx)(b.code,{children:"CONTEXT.md"})})," at the repo root, or"]}),"\n",(0,V.jsxs)(b.li,{children:[(0,V.jsx)(b.strong,{children:(0,V.jsx)(b.code,{children:"CONTEXT-MAP.md"})})," at the repo root if it exists — it points at one ",(0,V.jsx)(b.code,{children:"CONTEXT.md"})," per context. Read each one relevant to the topic."]}),"\n",(0,V.jsxs)(b.li,{children:[(0,V.jsx)(b.strong,{children:(0,V.jsx)(b.code,{children:"docs/adr/"})})," — read ADRs that touch the area you're about to work in. In multi-context repos, also check ",(0,V.jsx)(b.code,{children:"src/<context>/docs/adr/"})," for context-scoped decisions."]}),"\n"]}),"\n",(0,V.jsxs)(b.p,{children:["If any of these files don't exist, ",(0,V.jsx)(b.strong,{children:"proceed silently"}),". Don't flag their absence; don't suggest creating them upfront. The ",(0,V.jsx)(b.code,{children:"/domain-modeling"})," skill (reached via ",(0,V.jsx)(b.code,{children:"/grill-with-docs"})," and ",(0,V.jsx)(b.code,{children:"/improve-codebase-architecture"}),") creates them lazily when terms or decisions actually get resolved."]}),"\n",(0,V.jsx)(b.h2,{id:"file-structure",children:"File structure"}),"\n",(0,V.jsx)(b.p,{children:"Single-context repo (most repos):"}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="M 6,1 C 4.354992,1 3,2.354992 3,4 v 16 c 0,1.645008 1.354992,3 3,3 h 12 c 1.645008,0 3,-1.354992 3,-3 V 8 7 A 1.0001,1.0001 0 0 0 20.707031,6.2929687 l -5,-5 A 1.0001,1.0001 0 0 0 15,1 h -1 z m 0,2 h 7 v 3 c 0,1.645008 1.354992,3 3,3 h 3 v 11 c 0,0.564129 -0.435871,1 -1,1 H 6 C 5.4358712,21 5,20.564129 5,20 V 4 C 5,3.4358712 5.4358712,3 6,3 Z M 15,3.4140625 18.585937,7 H 16 C 15.435871,7 15,6.5641288 15,6 Z" fill="currentColor" /></svg>',children:(0,V.jsxs)(b.code,{children:[(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:"/"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:"├── CONTEXT.md"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:"├── docs/adr/"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:"│ ├── 0001-event-sourced-orders.md"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:"│ └── 0002-postgres-for-write-model.md"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:"└── src/"})})]})})}),"\n",(0,V.jsxs)(b.p,{children:["Multi-context repo (presence of ",(0,V.jsx)(b.code,{children:"CONTEXT-MAP.md"})," at the root):"]}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="M 6,1 C 4.354992,1 3,2.354992 3,4 v 16 c 0,1.645008 1.354992,3 3,3 h 12 c 1.645008,0 3,-1.354992 3,-3 V 8 7 A 1.0001,1.0001 0 0 0 20.707031,6.2929687 l -5,-5 A 1.0001,1.0001 0 0 0 15,1 h -1 z m 0,2 h 7 v 3 c 0,1.645008 1.354992,3 3,3 h 3 v 11 c 0,0.564129 -0.435871,1 -1,1 H 6 C 5.4358712,21 5,20.564129 5,20 V 4 C 5,3.4358712 5.4358712,3 6,3 Z M 15,3.4140625 18.585937,7 H 16 C 15.435871,7 15,6.5641288 15,6 Z" fill="currentColor" /></svg>',children:(0,V.jsxs)(b.code,{children:[(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:"/"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:"├── CONTEXT-MAP.md"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:"├── docs/adr/ ← system-wide decisions"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:"└── src/"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:" ├── ordering/"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:" │ ├── CONTEXT.md"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:" │ └── docs/adr/ ← context-specific decisions"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:" └── billing/"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:" ├── CONTEXT.md"})}),"\n",(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{children:" └── docs/adr/"})})]})})}),"\n",(0,V.jsx)(b.h2,{id:"use-the-glossarys-vocabulary",children:"Use the glossary's vocabulary"}),"\n",(0,V.jsxs)(b.p,{children:["When your output names a domain concept (in an issue title, a refactor proposal, a hypothesis, a test name), use the term as defined in ",(0,V.jsx)(b.code,{children:"CONTEXT.md"}),". Don't drift to synonyms the glossary explicitly avoids."]}),"\n",(0,V.jsxs)(b.p,{children:["If the concept you need isn't in the glossary yet, that's a signal — either you're inventing language the project doesn't use (reconsider) or there's a real gap (note it for ",(0,V.jsx)(b.code,{children:"/domain-modeling"}),")."]}),"\n",(0,V.jsx)(b.h2,{id:"flag-adr-conflicts",children:"Flag ADR conflicts"}),"\n",(0,V.jsx)(b.p,{children:"If your output contradicts an existing ADR, surface it explicitly rather than silently overriding:"}),"\n",(0,V.jsxs)(b.blockquote,{children:["\n",(0,V.jsx)(b.p,{children:(0,V.jsx)(b.em,{children:"Contradicts ADR-0007 (event-sourced orders) — but worth reopening because…"})}),"\n"]})]})}function ax(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(aw,{...a})}):aw(a)}let ay={title:"One rule for required and optional children"},az=[],aA={contents:[{heading:"one-rule-for-required-and-optional-children",content:"openChildren and openOptionalChildren take the same rule. The omitted rule is that every child run succeeds. The call may pass a quota instead: a count, or a proportion from 0 to 1. A count is capped at the number of children. A proportion's target is that proportion of the children, rounded up. Either form may name withinMin, a whole number of minutes of at least 1, measured from the moment the children open. The flow does not read the clock. The frame stores openedAt on the first opening. A reread compares the rule. It does not compare an absolute time."},{heading:"one-rule-for-required-and-optional-children",content:"Only a successful child run counts toward the target. A required opening seals when the target is met. It stops the parent when the target can no longer be met, or when the duration is reached with the target unmet. Before that time, a failure stops a required all as failure, and a not finished child stops it as not finished. An optional opening never stops the parent. It seals, in this order, when the target is met, when the duration is reached, when a quota can no longer be met, or when every child has ended under all. A failure does not seal an optional all early. Children that are still open stay out of the sealed report. A result that arrives later does not change the report."},{heading:"one-rule-for-required-and-optional-children",content:"An object is one child and takes no rule. An empty array seals at once. A group still waits until every required member is done. A stored frame that still carries a separate quota, or an absolute at, diverges on reread. This supersedes ADR 0021 and ADR 0022."}],headings:[{id:"one-rule-for-required-and-optional-children",content:"One rule for required and optional children"}]},aB=[{depth:1,url:"#one-rule-for-required-and-optional-children",title:(0,V.jsx)(V.Fragment,{children:"One rule for required and optional children"})}];function aC(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"one-rule-for-required-and-optional-children",children:"One rule for required and optional children"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"openChildren"})," and ",(0,V.jsx)(b.code,{children:"openOptionalChildren"})," take the same rule. The omitted rule is that every child run succeeds. The call may pass a quota instead: a count, or a proportion from 0 to 1. A count is capped at the number of children. A proportion's target is that proportion of the children, rounded up. Either form may name ",(0,V.jsx)(b.code,{children:"withinMin"}),", a whole number of minutes of at least 1, measured from the moment the children open. The flow does not read the clock. The frame stores ",(0,V.jsx)(b.code,{children:"openedAt"})," on the first opening. A reread compares the rule. It does not compare an absolute time."]}),"\n",(0,V.jsxs)(b.p,{children:["Only a successful child run counts toward the target. A required opening seals when the target is met. It stops the parent when the target can no longer be met, or when the duration is reached with the target unmet. Before that time, a failure stops a required ",(0,V.jsx)(b.code,{children:"all"})," as failure, and a not finished child stops it as not finished. An optional opening never stops the parent. It seals, in this order, when the target is met, when the duration is reached, when a quota can no longer be met, or when every child has ended under ",(0,V.jsx)(b.code,{children:"all"}),". A failure does not seal an optional ",(0,V.jsx)(b.code,{children:"all"})," early. Children that are still open stay out of the sealed report. A result that arrives later does not change the report."]}),"\n",(0,V.jsxs)(b.p,{children:["An object is one child and takes no rule. An empty array seals at once. A group still waits until every required member is done. A stored frame that still carries a separate quota, or an absolute ",(0,V.jsx)(b.code,{children:"at"}),", diverges on reread. This supersedes ADR 0021 and ADR 0022."]})]})}function aD(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(aC,{...a})}):aC(a)}let aE={title:"An orchestrator fault stops the run"},aF=[],aG={contents:[{heading:"an-orchestrator-fault-stops-the-run",content:"An unknown step, or an unknown entity, while the orchestrator is sending the jobs of a running flow, stops that run. The run photographed before the result ends in failure. Each step that was still open is closed with a failed result marked orchestrator, and the result body carries the message, so a later advance does not send its job. The result is acknowledged. The jobs of the abandoned transition are not sent."},{heading:"an-orchestrator-fault-stops-the-run",content:"A start, a cron, or a replay does not stop a run in its place: the error leaves the transaction, and the transaction is rolled back. An error from Postgres or Redis is not this stop. It is not acknowledged. After eight failures of the same result, that result is copied to the dead stream and acknowledged."}],headings:[{id:"an-orchestrator-fault-stops-the-run",content:"An orchestrator fault stops the run"}]},aH=[{depth:1,url:"#an-orchestrator-fault-stops-the-run",title:(0,V.jsx)(V.Fragment,{children:"An orchestrator fault stops the run"})}];function aI(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"an-orchestrator-fault-stops-the-run",children:"An orchestrator fault stops the run"}),"\n",(0,V.jsx)(b.p,{children:"An unknown step, or an unknown entity, while the orchestrator is sending the jobs of a running flow, stops that run. The run photographed before the result ends in failure. Each step that was still open is closed with a failed result marked orchestrator, and the result body carries the message, so a later advance does not send its job. The result is acknowledged. The jobs of the abandoned transition are not sent."}),"\n",(0,V.jsx)(b.p,{children:"A start, a cron, or a replay does not stop a run in its place: the error leaves the transaction, and the transaction is rolled back. An error from Postgres or Redis is not this stop. It is not acknowledged. After eight failures of the same result, that result is copied to the dead stream and acknowledged."})]})}function aJ(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(aI,{...a})}):aI(a)}let aK={title:"A running worker reloads when commanded"},aL=[],aM={contents:[{heading:"a-running-worker-reloads-when-commanded",content:"Each environment keeps its own variables and secrets. That part of the earlier decision stays: a new environment starts empty, and there is no shared organization set for an environment to override."},{heading:"a-running-worker-reloads-when-commanded",content:"The worker attached to that environment loads those variables and secrets when it starts. It loads them again when the orchestrator commands a reload. A worker that is already running keeps what it loaded until that command or until it starts again. The command is separate from a drain or a stop. Rotating the environment access secret does not send it, because the running process still authenticates with the secret it started with."}],headings:[{id:"a-running-worker-reloads-when-commanded",content:"A running worker reloads when commanded"}]},aN=[{depth:1,url:"#a-running-worker-reloads-when-commanded",title:(0,V.jsx)(V.Fragment,{children:"A running worker reloads when commanded"})}];function aO(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-running-worker-reloads-when-commanded",children:"A running worker reloads when commanded"}),"\n",(0,V.jsx)(b.p,{children:"Each environment keeps its own variables and secrets. That part of the earlier decision stays: a new environment starts empty, and there is no shared organization set for an environment to override."}),"\n",(0,V.jsx)(b.p,{children:"The worker attached to that environment loads those variables and secrets when it starts. It loads them again when the orchestrator commands a reload. A worker that is already running keeps what it loaded until that command or until it starts again. The command is separate from a drain or a stop. Rotating the environment access secret does not send it, because the running process still authenticates with the secret it started with."})]})}function aP(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(aO,{...a})}):aO(a)}let aQ={title:"The fixture checkout may live in the repository"},aR=[],aS={contents:[{heading:"the-fixture-checkout-may-live-in-the-repository",content:"The fixture checkout may live in this repository at organizations/fixture. It is not a package of the repository. The platform reaches it by FIXTURE, or by the installed @ascentstudio/cue-org-fixture archive. The platform does not name any other organization. A slot executes the revision built by cue build. Import publishes that revision to the npm registry. The package is cue-org-<organization>-revision and the version is 0.0.0-<revision>. The revision id stays the content hash. dist.integrity is the check. The orchestrator and each supervisor keep a cache of downloaded revisions. The cache is not a catalog. An environment pin, and any revision still held by an open run, choose what is downloaded. allowUnpublished with --source or ORCH_SOURCE runs the organization directory and does not publish or download. Runtime images stay on zot, the local registry, or Scaleway."}],headings:[{id:"the-fixture-checkout-may-live-in-the-repository",content:"The fixture checkout may live in the repository"}]},aT=[{depth:1,url:"#the-fixture-checkout-may-live-in-the-repository",title:(0,V.jsx)(V.Fragment,{children:"The fixture checkout may live in the repository"})}];function aU(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"the-fixture-checkout-may-live-in-the-repository",children:"The fixture checkout may live in the repository"}),"\n",(0,V.jsxs)(b.p,{children:["The fixture checkout may live in this repository at ",(0,V.jsx)(b.code,{children:"organizations/fixture"}),". It is not a package of the repository. The platform reaches it by ",(0,V.jsx)(b.code,{children:"FIXTURE"}),", or by the installed ",(0,V.jsx)(b.code,{children:"@ascentstudio/cue-org-fixture"})," archive. The platform does not name any other organization. A slot executes the revision built by ",(0,V.jsx)(b.code,{children:"cue build"}),". Import publishes that revision to the npm registry. The package is ",(0,V.jsx)(b.code,{children:"cue-org-<organization>-revision"})," and the version is ",(0,V.jsx)(b.code,{children:"0.0.0-<revision>"}),". The revision id stays the content hash. ",(0,V.jsx)(b.code,{children:"dist.integrity"})," is the check. The orchestrator and each supervisor keep a cache of downloaded revisions. The cache is not a catalog. An environment pin, and any revision still held by an open run, choose what is downloaded. ",(0,V.jsx)(b.code,{children:"allowUnpublished"})," with ",(0,V.jsx)(b.code,{children:"--source"})," or ",(0,V.jsx)(b.code,{children:"ORCH_SOURCE"})," runs the organization directory and does not publish or download. Runtime images stay on zot, the local registry, or Scaleway."]})]})}function aV(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(aU,{...a})}):aU(a)}let aW={title:"A registry client certificate or a login"},aX=[],aY={contents:[{heading:"a-registry-client-certificate-or-a-login",content:"Zot and Verdaccio accept no anonymous request. Caddy is the only way in. A certificate signed by the platform intermediate authenticates a machine. A person without a certificate uses docker login or npm login. The console does not call the registries. It keeps the orchestrator relay."},{heading:"a-registry-client-certificate-or-a-login",content:"Ports 7443 and 4873 are always on, with the private server certificate. Let's Encrypt stays on the console name only. Caddy checks a presented certificate and refuses a bad one. It injects a read account for every valid certificate except the orchestrator's, and a write account for that one certificate. A request with no certificate keeps the caller's login. The registries themselves stay on a network the host does not publish."}],headings:[{id:"a-registry-client-certificate-or-a-login",content:"A registry client certificate or a login"}]},aZ=[{depth:1,url:"#a-registry-client-certificate-or-a-login",title:(0,V.jsx)(V.Fragment,{children:"A registry client certificate or a login"})}];function a$(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-registry-client-certificate-or-a-login",children:"A registry client certificate or a login"}),"\n",(0,V.jsx)(b.p,{children:"Zot and Verdaccio accept no anonymous request. Caddy is the only way in. A certificate signed by the platform intermediate authenticates a machine. A person without a certificate uses docker login or npm login. The console does not call the registries. It keeps the orchestrator relay."}),"\n",(0,V.jsx)(b.p,{children:"Ports 7443 and 4873 are always on, with the private server certificate. Let's Encrypt stays on the console name only. Caddy checks a presented certificate and refuses a bad one. It injects a read account for every valid certificate except the orchestrator's, and a write account for that one certificate. A request with no certificate keeps the caller's login. The registries themselves stay on a network the host does not publish."})]})}function a_(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(a$,{...a})}):a$(a)}let a0={title:"Caddy has a desktop placement"},a1=[],a2={contents:[{heading:"caddy-has-a-desktop-placement",content:"ORCH_CADDY_PLACEMENT chooses how Caddy reaches the machine. Unset, or host, keeps Caddy on the Linux host network: it sees the real client address, and it reaches the orchestrator and the console on 127.0.0.1. desktop puts Caddy on the platform network and publishes the edge ports, so the same overlay runs on Linux, Mac, and Docker Desktop. Caddy then reaches the orchestrator and the console through host.docker.internal, and those two processes listen on 0.0.0.0. The service addresses stay on the platform network."},{heading:"caddy-has-a-desktop-placement",content:"A connection from the machine arrives as the gateway 172.30.0.1 on Linux. Docker Desktop presents it as another address, which this machine sets in ORCH_CADDY_LOCAL_CIDR. The desktop placement adds that value to the Caddyfile and to pg_hba.conf, next to the gateway, so enrollment from this machine is accepted and saving an address list is not refused. An empty value leaves the gateway as the only extra address. The host placement does not read the variable, so the address is absent from a production Caddyfile and from pg_hba.conf. The list does not distinguish clients. Checking it still uses the host placement on Linux. Windows is left aside: Docker Desktop mounts a Windows path at a different path inside the container, and the Caddyfile uses one absolute path for both."}],headings:[{id:"caddy-has-a-desktop-placement",content:"Caddy has a desktop placement"}]},a3=[{depth:1,url:"#caddy-has-a-desktop-placement",title:(0,V.jsx)(V.Fragment,{children:"Caddy has a desktop placement"})}];function a4(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"caddy-has-a-desktop-placement",children:"Caddy has a desktop placement"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ORCH_CADDY_PLACEMENT"})," chooses how Caddy reaches the machine. Unset, or ",(0,V.jsx)(b.code,{children:"host"}),", keeps Caddy on the Linux host network: it sees the real client address, and it reaches the orchestrator and the console on ",(0,V.jsx)(b.code,{children:"127.0.0.1"}),". ",(0,V.jsx)(b.code,{children:"desktop"})," puts Caddy on the platform network and publishes the edge ports, so the same overlay runs on Linux, Mac, and Docker Desktop. Caddy then reaches the orchestrator and the console through ",(0,V.jsx)(b.code,{children:"host.docker.internal"}),", and those two processes listen on ",(0,V.jsx)(b.code,{children:"0.0.0.0"}),". The service addresses stay on the platform network."]}),"\n",(0,V.jsxs)(b.p,{children:["A connection from the machine arrives as the gateway ",(0,V.jsx)(b.code,{children:"172.30.0.1"})," on Linux. Docker Desktop presents it as another address, which this machine sets in ",(0,V.jsx)(b.code,{children:"ORCH_CADDY_LOCAL_CIDR"}),". The desktop placement adds that value to the Caddyfile and to ",(0,V.jsx)(b.code,{children:"pg_hba.conf"}),", next to the gateway, so enrollment from this machine is accepted and saving an address list is not refused. An empty value leaves the gateway as the only extra address. The host placement does not read the variable, so the address is absent from a production Caddyfile and from ",(0,V.jsx)(b.code,{children:"pg_hba.conf"}),". The list does not distinguish clients. Checking it still uses the host placement on Linux. Windows is left aside: Docker Desktop mounts a Windows path at a different path inside the container, and the Caddyfile uses one absolute path for both."]})]})}function a5(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(a4,{...a})}):a4(a)}let a6={title:"One router consumes a slot"},a7=[],a8={contents:[{heading:"one-router-consumes-a-slot",content:"A finish leaves an open run on its revision and sends a new job to the pinned revision, on the same queue. The slot does not take that queue. One router, the process of the slot, is the only consumer of the kind. It gives the job to the worker of the job's revision, or of the pinned revision when the job names none, and it waits when that revision has no worker on the slot or that worker is at its concurrency. A consumer per revision was the other choice, and it was set aside: the kind would then have two rate limits and two pulses on one queue."},{heading:"one-router-consumes-a-slot",content:"The worker is one revision of that kind, a process or a container. It receives one job and returns the result envelope, and its logs stay apart from that envelope. It does not take the queue and it does not call the orchestrator. The router publishes the envelope. The pulse and a step metric keep the worker id and the slot id carried by the router. The router may hold as many jobs as its workers allow together, so one revision can be full while the other still takes work. A job for the full revision still waits. While both revisions are open, the slot lists two workers: its cpu and memory are the sum, concurrency is not added into the machine budget, and the rate limit stays the kind's, once. In process mode the router's launch starts the worker processes. In container mode the supervisor starts the containers and hands over the pipes. The supervisor remains the only process that talks to Docker."},{heading:"one-router-consumes-a-slot",content:"The organization revision stays the hash of the flow catalog and the steps file. The catalog carries no step run. A step package is addressed by the hash of that kind, and a runtime package by the runtime revision, so a change of step code does not move the runtime. A runtime prefix is installed once for a machine. A prefix already recorded is left in place."}],headings:[{id:"one-router-consumes-a-slot",content:"One router consumes a slot"}]},a9=[{depth:1,url:"#one-router-consumes-a-slot",title:(0,V.jsx)(V.Fragment,{children:"One router consumes a slot"})}];function ba(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"one-router-consumes-a-slot",children:"One router consumes a slot"}),"\n",(0,V.jsx)(b.p,{children:"A finish leaves an open run on its revision and sends a new job to the pinned revision, on the same queue. The slot does not take that queue. One router, the process of the slot, is the only consumer of the kind. It gives the job to the worker of the job's revision, or of the pinned revision when the job names none, and it waits when that revision has no worker on the slot or that worker is at its concurrency. A consumer per revision was the other choice, and it was set aside: the kind would then have two rate limits and two pulses on one queue."}),"\n",(0,V.jsx)(b.p,{children:"The worker is one revision of that kind, a process or a container. It receives one job and returns the result envelope, and its logs stay apart from that envelope. It does not take the queue and it does not call the orchestrator. The router publishes the envelope. The pulse and a step metric keep the worker id and the slot id carried by the router. The router may hold as many jobs as its workers allow together, so one revision can be full while the other still takes work. A job for the full revision still waits. While both revisions are open, the slot lists two workers: its cpu and memory are the sum, concurrency is not added into the machine budget, and the rate limit stays the kind's, once. In process mode the router's launch starts the worker processes. In container mode the supervisor starts the containers and hands over the pipes. The supervisor remains the only process that talks to Docker."}),"\n",(0,V.jsx)(b.p,{children:"The organization revision stays the hash of the flow catalog and the steps file. The catalog carries no step run. A step package is addressed by the hash of that kind, and a runtime package by the runtime revision, so a change of step code does not move the runtime. A runtime prefix is installed once for a machine. A prefix already recorded is left in place."})]})}function bb(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(ba,{...a})}):ba(a)}let bc={title:"A runtime revision excludes platform and device"},bd=[],be={contents:[{heading:"a-runtime-revision-excludes-platform-and-device",content:"A runtime is published for more than one machine. Putting the platform or the device into the revision would make those publications different revisions. The revision excludes both: the architecture is chosen in the image index, and the device is a suffix of the tag."}],headings:[{id:"a-runtime-revision-excludes-platform-and-device",content:"A runtime revision excludes platform and device"}]},bf=[{depth:1,url:"#a-runtime-revision-excludes-platform-and-device",title:(0,V.jsx)(V.Fragment,{children:"A runtime revision excludes platform and device"})}];function bg(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-runtime-revision-excludes-platform-and-device",children:"A runtime revision excludes platform and device"}),"\n",(0,V.jsx)(b.p,{children:"A runtime is published for more than one machine. Putting the platform or the device into the revision would make those publications different revisions. The revision excludes both: the architecture is chosen in the image index, and the device is a suffix of the tag."})]})}function bh(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(bg,{...a})}):bg(a)}let bi={title:"Variables belong to the environment"},bj=[],bk={contents:[{heading:"variables-belong-to-the-environment",content:"An organization's variables used to be one shared set. A local supervisor and a production supervisor then loaded the same parameters."},{heading:"variables-belong-to-the-environment",content:"Each environment now has its own variables and secrets. The worker attached to that environment loads them once. A shared organization set that an environment could override was the other choice, and it was set aside: the environment is the place a person configures, and a new environment starts empty."}],headings:[{id:"variables-belong-to-the-environment",content:"Variables belong to the environment"}]},bl=[{depth:1,url:"#variables-belong-to-the-environment",title:(0,V.jsx)(V.Fragment,{children:"Variables belong to the environment"})}];function bm(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"variables-belong-to-the-environment",children:"Variables belong to the environment"}),"\n",(0,V.jsx)(b.p,{children:"An organization's variables used to be one shared set. A local supervisor and a production supervisor then loaded the same parameters."}),"\n",(0,V.jsx)(b.p,{children:"Each environment now has its own variables and secrets. The worker attached to that environment loads them once. A shared organization set that an environment could override was the other choice, and it was set aside: the environment is the place a person configures, and a new environment starts empty."})]})}function bn(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(bm,{...a})}):bm(a)}let bo={title:"An opening gives every child the same silence"},bp=[],bq={contents:[{heading:"an-opening-gives-every-child-the-same-silence",content:"A child element used to carry its own starting data, and that starting data could replace the silence of every step of that one child. Two children of one call could therefore wait differently, and the silence was decided beside the payload rather than by the flow that opened them."},{heading:"an-opening-gives-every-child-the-same-silence",content:"A child element now carries an identifier and a payload. The call that opens the children may pass one silence, a duration and a resend maximum together. That silence is written onto each child run the call starts, and it replaces the silence of every step of those runs. When the call omits it, each step keeps the silence declared on the step. A child that is already running keeps the silence it started with."},{heading:"an-opening-gives-every-child-the-same-silence",content:"A person who opens or replays a flow may still replace the silence of that run. That replacement stays on the starting data of the run. It is not a field of the child."}],headings:[{id:"an-opening-gives-every-child-the-same-silence",content:"An opening gives every child the same silence"}]},br=[{depth:1,url:"#an-opening-gives-every-child-the-same-silence",title:(0,V.jsx)(V.Fragment,{children:"An opening gives every child the same silence"})}];function bs(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"an-opening-gives-every-child-the-same-silence",children:"An opening gives every child the same silence"}),"\n",(0,V.jsx)(b.p,{children:"A child element used to carry its own starting data, and that starting data could replace the silence of every step of that one child. Two children of one call could therefore wait differently, and the silence was decided beside the payload rather than by the flow that opened them."}),"\n",(0,V.jsx)(b.p,{children:"A child element now carries an identifier and a payload. The call that opens the children may pass one silence, a duration and a resend maximum together. That silence is written onto each child run the call starts, and it replaces the silence of every step of those runs. When the call omits it, each step keeps the silence declared on the step. A child that is already running keeps the silence it started with."}),"\n",(0,V.jsx)(b.p,{children:"A person who opens or replays a flow may still replace the silence of that run. That replacement stays on the starting data of the run. It is not a field of the child."})]})}function bt(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(bs,{...a})}):bs(a)}let bu={title:"A sealed report carries each child's return"},bv=[],bw={contents:[{heading:"a-sealed-report-carries-each-childs-return",content:"Each element of a sealed children report has a body. It is the return the child flow validated with returns, already stored on that run. sealChildren copies it when the report seals. memberElements copies it too, so a group that contains those children keeps the body."},{heading:"a-sealed-report-carries-each-childs-return",content:"The element still has its identifier, its discriminant, and its flow. A success carries that return. A failure and a not finished child carry an empty body, with discriminant failure or not_finished. The failure discriminant stays collapsed to failure, as the parent of one child already receives it. The array is the sealed elements. A child that is still open is not in it."},{heading:"a-sealed-report-carries-each-childs-return",content:"The body is the small object the flow declares. It does not carry HTML, a file, or a values patch. A parent of one child already received this return. The list does the same. A reader that ignores body stays valid."}],headings:[{id:"a-sealed-report-carries-each-childs-return",content:"A sealed report carries each child's return"}]},bx=[{depth:1,url:"#a-sealed-report-carries-each-childs-return",title:(0,V.jsx)(V.Fragment,{children:"A sealed report carries each child's return"})}];function by(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-sealed-report-carries-each-childs-return",children:"A sealed report carries each child's return"}),"\n",(0,V.jsxs)(b.p,{children:["Each element of a sealed children report has a ",(0,V.jsx)(b.code,{children:"body"}),". It is the return the child flow validated with ",(0,V.jsx)(b.code,{children:"returns"}),", already stored on that run. ",(0,V.jsx)(b.code,{children:"sealChildren"})," copies it when the report seals. ",(0,V.jsx)(b.code,{children:"memberElements"})," copies it too, so a group that contains those children keeps the body."]}),"\n",(0,V.jsxs)(b.p,{children:["The element still has its identifier, its discriminant, and its flow. A success carries that return. A failure and a not finished child carry an empty body, with discriminant ",(0,V.jsx)(b.code,{children:"failure"})," or ",(0,V.jsx)(b.code,{children:"not_finished"}),". The failure discriminant stays collapsed to ",(0,V.jsx)(b.code,{children:"failure"}),", as the parent of one child already receives it. The array is the sealed elements. A child that is still open is not in it."]}),"\n",(0,V.jsxs)(b.p,{children:["The body is the small object the flow declares. It does not carry HTML, a file, or a values patch. A parent of one child already received this return. The list does the same. A reader that ignores ",(0,V.jsx)(b.code,{children:"body"})," stays valid."]})]})}function bz(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(by,{...a})}):by(a)}let bA={title:"An optional quota lets the parent continue"},bB=[],bC={contents:[{heading:void 0,content:"Superseded by ADR 0033."},{heading:"an-optional-quota-lets-the-parent-continue",content:"openOptionalChildren may take a third argument, { count?: number; withinMin?: number }. Without that argument, the opening still waits until every child run has ended. A failure and a not finished run do not stop the parent, and the end reason is all. ADR 0021 records that opening."},{heading:"an-optional-quota-lets-the-parent-continue",content:"The flow does not read the clock. withinMin is a whole number of minutes, at least 1. count, when present, is a whole number of at least 0. On the first opening, the children frame stores openedAt. The deadline is openedAt plus withinMin minutes. A reread compares count and withinMin. It does not compare an absolute time, so a later read does not diverge. A required opening keeps its absolute at. A missed deadline still fails that opening."},{heading:"an-optional-quota-lets-the-parent-continue",content:"When count is present, the target is the smaller of count and the number of children. The report seals, and the parent continues, in this order. As many child runs have succeeded as the target: end reason quota. The duration is reached: end reason deadline, with the children that have already ended. The target can no longer be reached: end reason quota, with what has already ended. Every child has ended: end reason all."},{heading:"an-optional-quota-lets-the-parent-continue",content:"Only a successful child run counts toward the target. A failure does not fill the quota, and it does not stop the parent. Children that are still open keep running and stay out of the sealed report. A result that arrives later does not change the report."}],headings:[{id:"an-optional-quota-lets-the-parent-continue",content:"An optional quota lets the parent continue"}]},bD=[{depth:1,url:"#an-optional-quota-lets-the-parent-continue",title:(0,V.jsx)(V.Fragment,{children:"An optional quota lets the parent continue"})}];function bE(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.p,{children:"Superseded by ADR 0033."}),"\n",(0,V.jsx)(b.h1,{id:"an-optional-quota-lets-the-parent-continue",children:"An optional quota lets the parent continue"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"openOptionalChildren"})," may take a third argument, ",(0,V.jsx)(b.code,{children:"{ count?: number; withinMin?: number }"}),". Without that argument, the opening still waits until every child run has ended. A failure and a not finished run do not stop the parent, and the end reason is ",(0,V.jsx)(b.code,{children:"all"}),". ADR 0021 records that opening."]}),"\n",(0,V.jsxs)(b.p,{children:["The flow does not read the clock. ",(0,V.jsx)(b.code,{children:"withinMin"})," is a whole number of minutes, at least 1. ",(0,V.jsx)(b.code,{children:"count"}),", when present, is a whole number of at least 0. On the first opening, the children frame stores ",(0,V.jsx)(b.code,{children:"openedAt"}),". The deadline is ",(0,V.jsx)(b.code,{children:"openedAt"})," plus ",(0,V.jsx)(b.code,{children:"withinMin"})," minutes. A reread compares ",(0,V.jsx)(b.code,{children:"count"})," and ",(0,V.jsx)(b.code,{children:"withinMin"}),". It does not compare an absolute time, so a later read does not diverge. A required opening keeps its absolute ",(0,V.jsx)(b.code,{children:"at"}),". A missed deadline still fails that opening."]}),"\n",(0,V.jsxs)(b.p,{children:["When ",(0,V.jsx)(b.code,{children:"count"})," is present, the target is the smaller of ",(0,V.jsx)(b.code,{children:"count"})," and the number of children. The report seals, and the parent continues, in this order. As many child runs have succeeded as the target: end reason ",(0,V.jsx)(b.code,{children:"quota"}),". The duration is reached: end reason ",(0,V.jsx)(b.code,{children:"deadline"}),", with the children that have already ended. The target can no longer be reached: end reason ",(0,V.jsx)(b.code,{children:"quota"}),", with what has already ended. Every child has ended: end reason ",(0,V.jsx)(b.code,{children:"all"}),"."]}),"\n",(0,V.jsx)(b.p,{children:"Only a successful child run counts toward the target. A failure does not fill the quota, and it does not stop the parent. Children that are still open keep running and stay out of the sealed report. A result that arrives later does not change the report."})]})}function bF(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(bE,{...a})}):bE(a)}let bG={title:"Optional children are waited on"},bH=[],bI={contents:[{heading:void 0,content:"Superseded by ADR 0033."},{heading:"optional-children-are-waited-on",content:"openChildren still requires every child run to succeed, or the quota or the deadline of that opening. A failure or a not finished child stops the parent, as ADR 0017 describes."},{heading:"optional-children-are-waited-on",content:"openOptionalChildren opens one child or an array and waits until each child run has ended. A failure and a not finished run do not stop the parent. An array seals once every child has ended, with end reason all, and the report lists each child that ended. An empty array seals at once. The opening takes no quota and no deadline."},{heading:"optional-children-are-waited-on",content:"Inside a group, that opening stays open until it seals. A required step and a required array of children in the same group are still judged as ADR 0017 describes. A reread that changes an opening between required and optional diverges and ends the run."}],headings:[{id:"optional-children-are-waited-on",content:"Optional children are waited on"}]},bJ=[{depth:1,url:"#optional-children-are-waited-on",title:(0,V.jsx)(V.Fragment,{children:"Optional children are waited on"})}];function bK(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.p,{children:"Superseded by ADR 0033."}),"\n",(0,V.jsx)(b.h1,{id:"optional-children-are-waited-on",children:"Optional children are waited on"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"openChildren"})," still requires every child run to succeed, or the quota or the deadline of that opening. A failure or a not finished child stops the parent, as ADR 0017 describes."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"openOptionalChildren"})," opens one child or an array and waits until each child run has ended. A failure and a not finished run do not stop the parent. An array seals once every child has ended, with end reason ",(0,V.jsx)(b.code,{children:"all"}),", and the report lists each child that ended. An empty array seals at once. The opening takes no quota and no deadline."]}),"\n",(0,V.jsx)(b.p,{children:"Inside a group, that opening stays open until it seals. A required step and a required array of children in the same group are still judged as ADR 0017 describes. A reread that changes an opening between required and optional diverges and ends the run."})]})}function bL(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(bK,{...a})}):bK(a)}let bM={title:"Each array of children carries its rule"},bN=[],bO={contents:[{heading:"each-array-of-children-carries-its-rule",content:"A flow used to store one rule, and every group copied it. Two openings in the same group could not be judged differently, and a quota sealed the group as soon as one member of any kind was done."},{heading:"each-array-of-children-carries-its-rule",content:"The rule now belongs to the call that opens an array of children. The omitted rule is that every child run succeeds. The call may pass a quota or a deadline instead. An empty array seals at once. An array of one child is still judged by that rule and returns a sealed report. An object is one child: it has no rule, and a result that is not done stops the parent."},{heading:"each-array-of-children-carries-its-rule",content:"A group no longer takes a rule. It waits until every required member is done, as ADR 0017 describes. An array of children is one member of that group, done once its own report is sealed. A quota still seals as soon as the share is reached, and children that are still open stay out of that report."},{heading:"each-array-of-children-carries-its-rule",content:"The flow run no longer stores a rule. A reread that passes a different rule to the same opening diverges and ends the run."}],headings:[{id:"each-array-of-children-carries-its-rule",content:"Each array of children carries its rule"}]},bP=[{depth:1,url:"#each-array-of-children-carries-its-rule",title:(0,V.jsx)(V.Fragment,{children:"Each array of children carries its rule"})}];function bQ(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"each-array-of-children-carries-its-rule",children:"Each array of children carries its rule"}),"\n",(0,V.jsx)(b.p,{children:"A flow used to store one rule, and every group copied it. Two openings in the same group could not be judged differently, and a quota sealed the group as soon as one member of any kind was done."}),"\n",(0,V.jsx)(b.p,{children:"The rule now belongs to the call that opens an array of children. The omitted rule is that every child run succeeds. The call may pass a quota or a deadline instead. An empty array seals at once. An array of one child is still judged by that rule and returns a sealed report. An object is one child: it has no rule, and a result that is not done stops the parent."}),"\n",(0,V.jsx)(b.p,{children:"A group no longer takes a rule. It waits until every required member is done, as ADR 0017 describes. An array of children is one member of that group, done once its own report is sealed. A quota still seals as soon as the share is reached, and children that are still open stay out of that report."}),"\n",(0,V.jsx)(b.p,{children:"The flow run no longer stores a rule. A reread that passes a different rule to the same opening diverges and ends the run."})]})}function bR(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(bQ,{...a})}):bQ(a)}let bS={title:"A typed body sits beside the result envelope"},bT=[],bU={contents:[{heading:"a-typed-body-sits-beside-the-result-envelope",content:"A step result is an envelope: kind, status, discriminant, the file names that step wrote, and the values applied to the entity. The step may also declare a schema for a body. The body is stored on the step. A body that fails the schema ends that step as failed. Values from that result are not applied."},{heading:"a-typed-body-sits-beside-the-result-envelope",content:"An array of children is a body, not a field of the envelope. The flow reads that body and passes the children to openChildren or each. The payload of a later step is built from those bodies, and the step's input schema checks it the same way starting data is checked."},{heading:"a-typed-body-sits-beside-the-result-envelope",content:"finish keeps its discriminant as a string and stores a body checked by the flow's return schema. A parent of one child receives that body with the envelope. The parent composes the next opening from that body."},{heading:"a-typed-body-sits-beside-the-result-envelope",content:"The bytes stay under runs/{organization}/{flow}/{identifier}/{generation}/. The body, the payload, and the file names stay on the flow run."}],headings:[{id:"a-typed-body-sits-beside-the-result-envelope",content:"A typed body sits beside the result envelope"}]},bV=[{depth:1,url:"#a-typed-body-sits-beside-the-result-envelope",title:(0,V.jsx)(V.Fragment,{children:"A typed body sits beside the result envelope"})}];function bW(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-typed-body-sits-beside-the-result-envelope",children:"A typed body sits beside the result envelope"}),"\n",(0,V.jsx)(b.p,{children:"A step result is an envelope: kind, status, discriminant, the file names that step wrote, and the values applied to the entity. The step may also declare a schema for a body. The body is stored on the step. A body that fails the schema ends that step as failed. Values from that result are not applied."}),"\n",(0,V.jsxs)(b.p,{children:["An array of children is a body, not a field of the envelope. The flow reads that body and passes the children to ",(0,V.jsx)(b.code,{children:"openChildren"})," or ",(0,V.jsx)(b.code,{children:"each"}),". The payload of a later step is built from those bodies, and the step's input schema checks it the same way starting data is checked."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"finish"})," keeps its discriminant as a string and stores a body checked by the flow's return schema. A parent of one child receives that body with the envelope. The parent composes the next opening from that body."]}),"\n",(0,V.jsxs)(b.p,{children:["The bytes stay under ",(0,V.jsx)(b.code,{children:"runs/{organization}/{flow}/{identifier}/{generation}/"}),". The body, the payload, and the file names stay on the flow run."]})]})}function bX(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(bW,{...a})}):bW(a)}let bY={title:"A replay from a step copies the kept files"},bZ=[],b$={contents:[{heading:"a-replay-from-a-step-copies-the-kept-files",content:"ADR 0009 said a file written for a generation is not reused. A replay from a step keeps the steps before that step, and those steps already named the files they wrote. The new generation receives a copy of each of those names. The last write of a repeated name is the one copied."},{heading:"a-replay-from-a-step-copies-the-kept-files",content:"The copy is a publication of kind file, written in the same transaction as the run and the jobs. The drain copies the bytes before it sends a job of that generation. A job is not sent until those copies are published. The copy can be run again. A full replay starts a generation with no kept steps, so it copies nothing. Reading a name still reads the current generation."}],headings:[{id:"a-replay-from-a-step-copies-the-kept-files",content:"A replay from a step copies the kept files"}]},b_=[{depth:1,url:"#a-replay-from-a-step-copies-the-kept-files",title:(0,V.jsx)(V.Fragment,{children:"A replay from a step copies the kept files"})}];function b0(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-replay-from-a-step-copies-the-kept-files",children:"A replay from a step copies the kept files"}),"\n",(0,V.jsx)(b.p,{children:"ADR 0009 said a file written for a generation is not reused. A replay from a step keeps the steps before that step, and those steps already named the files they wrote. The new generation receives a copy of each of those names. The last write of a repeated name is the one copied."}),"\n",(0,V.jsxs)(b.p,{children:["The copy is a publication of kind ",(0,V.jsx)(b.code,{children:"file"}),", written in the same transaction as the run and the jobs. The drain copies the bytes before it sends a job of that generation. A job is not sent until those copies are published. The copy can be run again. A full replay starts a generation with no kept steps, so it copies nothing. Reading a name still reads the current generation."]})]})}function b1(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(b0,{...a})}):b0(a)}let b2={title:"A group judges its required members"},b3=[],b4={contents:[{heading:"a-group-judges-its-required-members",content:"ADR 0008 let a flow call guard after a result. That call is gone. A required step whose result is failed ends the run in failure, and the next opening does not run. A required step whose result is not finished ends the run not finished. An optional step and a detached step do not stop the run. One child opened on the flow stops the parent the same way."},{heading:"a-group-judges-its-required-members",content:"A group always waits until every required member is done. A required member is an openStep or a child opening. An optional step is waited on and is not a member of that judgment. Success is a result whose status is done, a single child run whose status is success, or an array of children whose own report is sealed. A not finished member is not a success."},{heading:"a-group-judges-its-required-members",content:"The first required failure ends the run in failure. The first required not finished, when nothing has failed, ends the run not finished. A quota and a deadline belong to an array of children, not to the group. ADR 0020 records that."},{heading:"a-group-judges-its-required-members",content:"When the run stops for one of these reasons, a still-open required or optional step closes as not finished, discriminant ended. A detached step stays open. each is unchanged."}],headings:[{id:"a-group-judges-its-required-members",content:"A group judges its required members"}]},b5=[{depth:1,url:"#a-group-judges-its-required-members",title:(0,V.jsx)(V.Fragment,{children:"A group judges its required members"})}];function b6(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-group-judges-its-required-members",children:"A group judges its required members"}),"\n",(0,V.jsxs)(b.p,{children:["ADR 0008 let a flow call ",(0,V.jsx)(b.code,{children:"guard"})," after a result. That call is gone. A required step whose result is failed ends the run in failure, and the next opening does not run. A required step whose result is not finished ends the run not finished. An optional step and a detached step do not stop the run. One child opened on the flow stops the parent the same way."]}),"\n",(0,V.jsxs)(b.p,{children:["A group always waits until every required member is done. A required member is an ",(0,V.jsx)(b.code,{children:"openStep"})," or a child opening. An optional step is waited on and is not a member of that judgment. Success is a result whose status is done, a single child run whose status is success, or an array of children whose own report is sealed. A not finished member is not a success."]}),"\n",(0,V.jsx)(b.p,{children:"The first required failure ends the run in failure. The first required not finished, when nothing has failed, ends the run not finished. A quota and a deadline belong to an array of children, not to the group. ADR 0020 records that."}),"\n",(0,V.jsxs)(b.p,{children:["When the run stops for one of these reasons, a still-open required or optional step closes as not finished, discriminant ",(0,V.jsx)(b.code,{children:"ended"}),". A detached step stays open. ",(0,V.jsx)(b.code,{children:"each"})," is unchanged."]})]})}function b7(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(b6,{...a})}):b6(a)}let b8={title:"One writer per organization"},b9=[],ca={contents:[{heading:"one-writer-per-organization",content:"Several orchestrator processes may apply results. Each process owns a disjoint set of organizations. Two organizations do not share an entity, and a child stays in its parent's organization. There is no split by entity hash: a parent and its child would then have two writers."},{heading:"one-writer-per-organization",content:"A process owns an organization while it holds the lease orchestrator:owner:<organization>. The same owner renews that lease. A process that does not hold it does not read that organization's results, and does not advance or fire crons for it. Results travel on step-results:<organization>. Pending messages on the old step-results stream are not replayed."},{heading:"one-writer-per-organization",content:"Purge no longer runs at the start of advance. A separate loop purges finished runs of the owned organizations. A running run is still never removed. The in-process mutex still serializes applying a result with advance. It does not cross processes."},{heading:"one-writer-per-organization",content:"A live opening of more than 20000 children fails the run before any child is created. A discarded arm does not."}],headings:[{id:"one-writer-per-organization",content:"One writer per organization"}]},cb=[{depth:1,url:"#one-writer-per-organization",title:(0,V.jsx)(V.Fragment,{children:"One writer per organization"})}];function cc(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"one-writer-per-organization",children:"One writer per organization"}),"\n",(0,V.jsx)(b.p,{children:"Several orchestrator processes may apply results. Each process owns a disjoint set of organizations. Two organizations do not share an entity, and a child stays in its parent's organization. There is no split by entity hash: a parent and its child would then have two writers."}),"\n",(0,V.jsxs)(b.p,{children:["A process owns an organization while it holds the lease ",(0,V.jsx)(b.code,{children:"orchestrator:owner:<organization>"}),". The same owner renews that lease. A process that does not hold it does not read that organization's results, and does not advance or fire crons for it. Results travel on ",(0,V.jsx)(b.code,{children:"step-results:<organization>"}),". Pending messages on the old ",(0,V.jsx)(b.code,{children:"step-results"})," stream are not replayed."]}),"\n",(0,V.jsx)(b.p,{children:"Purge no longer runs at the start of advance. A separate loop purges finished runs of the owned organizations. A running run is still never removed. The in-process mutex still serializes applying a result with advance. It does not cross processes."}),"\n",(0,V.jsx)(b.p,{children:"A live opening of more than 20000 children fails the run before any child is created. A discarded arm does not."})]})}function cd(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(cc,{...a})}):cc(a)}let ce={title:"Jobs and metrics leave with the run"},cf=[],cg={contents:[{heading:"jobs-and-metrics-leave-with-the-run",content:"The transaction that writes a run also writes each job and each metric that leaves with it. A drain sends those rows after the commit, and again at the start of advance when a crash left rows unpublished. The token is chosen in the transaction. A second send of that token keeps the dispatch packet. If the send fails, the row stays and the committed run still stands. A job carries no secret. The silence duration does not change."}],headings:[{id:"jobs-and-metrics-leave-with-the-run",content:"Jobs and metrics leave with the run"}]},ch=[{depth:1,url:"#jobs-and-metrics-leave-with-the-run",title:(0,V.jsx)(V.Fragment,{children:"Jobs and metrics leave with the run"})}];function ci(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"jobs-and-metrics-leave-with-the-run",children:"Jobs and metrics leave with the run"}),"\n",(0,V.jsx)(b.p,{children:"The transaction that writes a run also writes each job and each metric that leaves with it. A drain sends those rows after the commit, and again at the start of advance when a crash left rows unpublished. The token is chosen in the transaction. A second send of that token keeps the dispatch packet. If the send fails, the row stays and the committed run still stands. A job carries no secret. The silence duration does not change."})]})}function cj(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(ci,{...a})}):ci(a)}let ck={title:"A shared child is claimed before its run"},cl=[],cm={contents:[{heading:"a-shared-child-is-claimed-before-its-run",content:"Two runs that open the same child claim that flow on the entity before either writes the run. The second attaches to the running run and does not send a second job."}],headings:[{id:"a-shared-child-is-claimed-before-its-run",content:"A shared child is claimed before its run"}]},cn=[{depth:1,url:"#a-shared-child-is-claimed-before-its-run",title:(0,V.jsx)(V.Fragment,{children:"A shared child is claimed before its run"})}];function co(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-shared-child-is-claimed-before-its-run",children:"A shared child is claimed before its run"}),"\n",(0,V.jsx)(b.p,{children:"Two runs that open the same child claim that flow on the entity before either writes the run. The second attaches to the running run and does not send a second job."})]})}function cp(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(co,{...a})}):co(a)}let cq={title:"A run does not wait on its ancestor"},cr=[],cs={contents:[{heading:"a-run-does-not-wait-on-its-ancestor",content:"A run waits while a child it opened is still running. That wait never ends if the child is the current run, or a run already above it. The same wait never ends when each child opens another without a bound. Reaching the silence duration does not resume that run: a run with a running child stays waiting."},{heading:"a-run-does-not-wait-on-its-ancestor",content:"Before opening a child, the engine collects the current run and every run above it. When the child is already one of those runs, the current run ends in failure and the child is not opened. The same failure happens when 8 or more runs sit strictly above the current run. That bound is the longest chain of parents, not the number of parents. A landing page opened by many ads is one level deep. An ancestor that was waiting resumes in that same transition. A chain of 8 openings still runs. The ninth ends the run that tried to open it."}],headings:[{id:"a-run-does-not-wait-on-its-ancestor",content:"A run does not wait on its ancestor"}]},ct=[{depth:1,url:"#a-run-does-not-wait-on-its-ancestor",title:(0,V.jsx)(V.Fragment,{children:"A run does not wait on its ancestor"})}];function cu(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-run-does-not-wait-on-its-ancestor",children:"A run does not wait on its ancestor"}),"\n",(0,V.jsx)(b.p,{children:"A run waits while a child it opened is still running. That wait never ends if the child is the current run, or a run already above it. The same wait never ends when each child opens another without a bound. Reaching the silence duration does not resume that run: a run with a running child stays waiting."}),"\n",(0,V.jsx)(b.p,{children:"Before opening a child, the engine collects the current run and every run above it. When the child is already one of those runs, the current run ends in failure and the child is not opened. The same failure happens when 8 or more runs sit strictly above the current run. That bound is the longest chain of parents, not the number of parents. A landing page opened by many ads is one level deep. An ancestor that was waiting resumes in that same transition. A chain of 8 openings still runs. The ninth ends the run that tried to open it."})]})}function cv(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(cu,{...a})}):cu(a)}let cw={title:"A step name is opened once per run"},cx=[],cy={contents:[{heading:"a-step-name-is-opened-once-per-run",content:"The name is the identity of a step in a run. The run finds that step by name, and the job names the same step. A second live opening of that name would mix with the first."},{heading:"a-step-name-is-opened-once-per-run",content:"When a flow creates a live step — a step, an optional step, or a detached step, including one opened in a group — and a step that is not discarded already has that name, the engine throws Step ${name} is already open. A discarded step does not count. A choice may name the same step on an arm that was not taken, and that step is not opened. Rereading the frame already at the cursor does not repeat the check. Distinct identifiers passed to each stay distinct steps."}],headings:[{id:"a-step-name-is-opened-once-per-run",content:"A step name is opened once per run"}]},cz=[{depth:1,url:"#a-step-name-is-opened-once-per-run",title:(0,V.jsx)(V.Fragment,{children:"A step name is opened once per run"})}];function cA(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-step-name-is-opened-once-per-run",children:"A step name is opened once per run"}),"\n",(0,V.jsx)(b.p,{children:"The name is the identity of a step in a run. The run finds that step by name, and the job names the same step. A second live opening of that name would mix with the first."}),"\n",(0,V.jsxs)(b.p,{children:["When a flow creates a live step — a step, an optional step, or a detached step, including one opened in a group — and a step that is not discarded already has that name, the engine throws ",(0,V.jsx)(b.code,{children:"Step ${name} is already open"}),". A discarded step does not count. A choice may name the same step on an arm that was not taken, and that step is not opened. Rereading the frame already at the cursor does not repeat the check. Distinct identifiers passed to each stay distinct steps."]})]})}function cB(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(cA,{...a})}):cA(a)}let cC={title:"A diverged reread ends the run"},cD=[],cE={contents:[{heading:"a-diverged-reread-ends-the-run",content:"A diverged reread, or any other error raised by the engine, ends that run in failure and keeps its flow metric. Each open step with no result is closed with a failed result marked diverged, so a later advance does not send its job again. A result for an entity that is absent is acknowledged and logged. A result for a run that is no longer running is ignored, except a detached step that still has no result. An error from Postgres or Redis is not acknowledged. After eight failures of the same result, that result is copied to the dead stream and acknowledged. The silence duration does not change."}],headings:[{id:"a-diverged-reread-ends-the-run",content:"A diverged reread ends the run"}]},cF=[{depth:1,url:"#a-diverged-reread-ends-the-run",title:(0,V.jsx)(V.Fragment,{children:"A diverged reread ends the run"})}];function cG(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-diverged-reread-ends-the-run",children:"A diverged reread ends the run"}),"\n",(0,V.jsx)(b.p,{children:"A diverged reread, or any other error raised by the engine, ends that run in failure and keeps its flow metric. Each open step with no result is closed with a failed result marked diverged, so a later advance does not send its job again. A result for an entity that is absent is acknowledged and logged. A result for a run that is no longer running is ignored, except a detached step that still has no result. An error from Postgres or Redis is not acknowledged. After eight failures of the same result, that result is copied to the dead stream and acknowledged. The silence duration does not change."})]})}function cH(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(cG,{...a})}):cG(a)}let cI={title:"Entity values are copied onto the run"},cJ=[],cK={contents:[{heading:"entity-values-are-copied-onto-the-run",content:"The flow is reread from the start, so it cannot read the entity's live values: a later write would change the path already taken. The run keeps a copy from the opening. A worker does not write the entity. A step that changes values returns a patch on its result, and the orchestrator applies that patch only when it accepts the result for the running generation. A person may replace the entity's values; the open run still keeps its copy."}],headings:[{id:"entity-values-are-copied-onto-the-run",content:"Entity values are copied onto the run"}]},cL=[{depth:1,url:"#entity-values-are-copied-onto-the-run",title:(0,V.jsx)(V.Fragment,{children:"Entity values are copied onto the run"})}];function cM(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"entity-values-are-copied-onto-the-run",children:"Entity values are copied onto the run"}),"\n",(0,V.jsx)(b.p,{children:"The flow is reread from the start, so it cannot read the entity's live values: a later write would change the path already taken. The run keeps a copy from the opening. A worker does not write the entity. A step that changes values returns a patch on its result, and the orchestrator applies that patch only when it accepts the result for the running generation. A person may replace the entity's values; the open run still keeps its copy."})]})}function cN(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(cM,{...a})}):cM(a)}let cO={title:"A transient file lives with the flow run"},cP=[],cQ={contents:[{heading:"a-transient-file-lives-with-the-flow-run",content:"A step may write a file that the next step of the same run, or a child run, needs to read. The file is not part of the result. The result stays small, and the engine rereads that result. The bytes live in a platform bucket. The key is the organization, the flow, the identifier, the generation, and one file name."},{heading:"a-transient-file-lives-with-the-flow-run",content:"The flow run retention already decides when a finished run leaves Postgres. The same purge deletes the files of those runs. A running run is not removed, and neither are its files. A replay from a step copies the files of the kept steps into the new generation. A full replay does not. See ADR 0018."},{heading:"a-transient-file-lives-with-the-flow-run",content:"The bucket is platform configuration, read before an organization's secrets are installed. It is not the organization's own object store. A job still carries no secret."}],headings:[{id:"a-transient-file-lives-with-the-flow-run",content:"A transient file lives with the flow run"}]},cR=[{depth:1,url:"#a-transient-file-lives-with-the-flow-run",title:(0,V.jsx)(V.Fragment,{children:"A transient file lives with the flow run"})}];function cS(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-transient-file-lives-with-the-flow-run",children:"A transient file lives with the flow run"}),"\n",(0,V.jsx)(b.p,{children:"A step may write a file that the next step of the same run, or a child run, needs to read. The file is not part of the result. The result stays small, and the engine rereads that result. The bytes live in a platform bucket. The key is the organization, the flow, the identifier, the generation, and one file name."}),"\n",(0,V.jsx)(b.p,{children:"The flow run retention already decides when a finished run leaves Postgres. The same purge deletes the files of those runs. A running run is not removed, and neither are its files. A replay from a step copies the files of the kept steps into the new generation. A full replay does not. See ADR 0018."}),"\n",(0,V.jsx)(b.p,{children:"The bucket is platform configuration, read before an organization's secrets are installed. It is not the organization's own object store. A job still carries no secret."})]})}function cT(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(cS,{...a})}):cS(a)}let cU={title:"A flow may guard a result and repeat over elements"},cV=[],cW={contents:[{heading:"a-flow-may-guard-a-result-and-repeat-over-elements",content:"ADR 0001 still holds: a flow is restricted TypeScript, and the orchestrator rereads it from the start. This adds two operations to the ones a flow may use."},{heading:"a-flow-may-guard-a-result-and-repeat-over-elements",content:"guard was a checkpoint on the same flow context. It is withdrawn. A required step that is not done stops the run itself. See ADR 0017. A stored guard operation can still be shown."},{heading:"a-flow-may-guard-a-result-and-repeat-over-elements",content:"each takes the elements and a body, on the flow and on a group. The body runs once for each element, and a later reread compares that same sequence. The description records one loop and walks the body once. A step opened with that element's identifier takes its name from the element."},{heading:"a-flow-may-guard-a-result-and-repeat-over-elements",content:"openChildren with an empty list records the opening and returns a sealed report with nothing in it. It does not wait. The description always includes that opening."},{heading:"a-flow-may-guard-a-result-and-repeat-over-elements",content:"The description is a graph. It is built by calling the flow on a context that opens nothing. It is not a run. Each operation of a run points at a node of that graph. The graph does not carry a status, an identifier, or an instant from a run."}],headings:[{id:"a-flow-may-guard-a-result-and-repeat-over-elements",content:"A flow may guard a result and repeat over elements"}]},cX=[{depth:1,url:"#a-flow-may-guard-a-result-and-repeat-over-elements",title:(0,V.jsx)(V.Fragment,{children:"A flow may guard a result and repeat over elements"})}];function cY(a){let b={code:"code",h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-flow-may-guard-a-result-and-repeat-over-elements",children:"A flow may guard a result and repeat over elements"}),"\n",(0,V.jsx)(b.p,{children:"ADR 0001 still holds: a flow is restricted TypeScript, and the orchestrator rereads it from the start. This adds two operations to the ones a flow may use."}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"guard"})," was a checkpoint on the same flow context. It is withdrawn. A required step that is not done stops the run itself. See ADR 0017. A stored guard operation can still be shown."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"each"})," takes the elements and a body, on the flow and on a group. The body runs once for each element, and a later reread compares that same sequence. The description records one loop and walks the body once. A step opened with that element's identifier takes its name from the element."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"openChildren"})," with an empty list records the opening and returns a sealed report with nothing in it. It does not wait. The description always includes that opening."]}),"\n",(0,V.jsx)(b.p,{children:"The description is a graph. It is built by calling the flow on a context that opens nothing. It is not a run. Each operation of a run points at a node of that graph. The graph does not carry a status, an identifier, or an instant from a run."})]})}function cZ(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(cY,{...a})}):cY(a)}let c$={title:"A flow run is kept, then only its metric remains"},c_=[],c0={contents:[{heading:"a-flow-run-is-kept-then-only-its-metric-remains",content:"An entity is an organization, an entity type, and an identifier. A flow is attached to one entity type, and several flows may share that type. Each execution of a flow on an entity is its own flow run, numbered by a generation. One run of that flow on that entity proceeds at a time. A request inside the validity duration returns the recorded result and does not open a run. Replaying opens a new generation and leaves the previous run."},{heading:"a-flow-run-is-kept-then-only-its-metric-remains",content:"Postgres keeps a finished flow run and its result for the flow run retention. A running run is not removed. The generation counter stays on the entity after the run is removed, so a later run does not reuse a generation that ClickHouse already recorded. After the retention, ClickHouse is the only record of that run, and the run is not clickable. Raw metrics and the hourly and daily aggregates each have their own retention. The engine rereads the result of a run that is still stored. It does not reread the metric."},{heading:"a-flow-run-is-kept-then-only-its-metric-remains",content:"This replaces the rule in ADR 0004 that the next flow run replaces the row, the rule in ADR 0006 that replaying reuses the run, and the rule in ADR 0003 that Postgres holds only the current flow run."}],headings:[{id:"a-flow-run-is-kept-then-only-its-metric-remains",content:"A flow run is kept, then only its metric remains"}]},c1=[{depth:1,url:"#a-flow-run-is-kept-then-only-its-metric-remains",title:(0,V.jsx)(V.Fragment,{children:"A flow run is kept, then only its metric remains"})}];function c2(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-flow-run-is-kept-then-only-its-metric-remains",children:"A flow run is kept, then only its metric remains"}),"\n",(0,V.jsx)(b.p,{children:"An entity is an organization, an entity type, and an identifier. A flow is attached to one entity type, and several flows may share that type. Each execution of a flow on an entity is its own flow run, numbered by a generation. One run of that flow on that entity proceeds at a time. A request inside the validity duration returns the recorded result and does not open a run. Replaying opens a new generation and leaves the previous run."}),"\n",(0,V.jsx)(b.p,{children:"Postgres keeps a finished flow run and its result for the flow run retention. A running run is not removed. The generation counter stays on the entity after the run is removed, so a later run does not reuse a generation that ClickHouse already recorded. After the retention, ClickHouse is the only record of that run, and the run is not clickable. Raw metrics and the hourly and daily aggregates each have their own retention. The engine rereads the result of a run that is still stored. It does not reread the metric."}),"\n",(0,V.jsx)(b.p,{children:"This replaces the rule in ADR 0004 that the next flow run replaces the row, the rule in ADR 0006 that replaying reuses the run, and the rule in ADR 0003 that Postgres holds only the current flow run."})]})}function c3(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(c2,{...a})}):c2(a)}let c4={title:"One identity is one entity"},c5=[],c6={contents:[{heading:"one-identity-is-one-entity",content:"An entity was an organization and an identity. The same identity in two flows was one entity and two runs, because a person looks up the subject and then the flows that ran on it. ADR 0007 replaces that identity with an entity type and an identifier, and replaces the rule that replaying reuses the run. Validity stays defined once on the flow. Inside the validity duration the recorded result is returned. A different flow on the same entity does not replace the first run."},{heading:"one-identity-is-one-entity",content:"This replaces the rule in ADR 0002 that the same identity in two flows is two entities. One run of an organization, a flow, and an identity still proceeds at a time, and that run keeps the starting data of the request that started it. The stored row stays that run. A separate run name was rejected: replaying would otherwise leave two current trees for one flow."}],headings:[{id:"one-identity-is-one-entity",content:"One identity is one entity"}]},c7=[{depth:1,url:"#one-identity-is-one-entity",title:(0,V.jsx)(V.Fragment,{children:"One identity is one entity"})}];function c8(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"one-identity-is-one-entity",children:"One identity is one entity"}),"\n",(0,V.jsx)(b.p,{children:"An entity was an organization and an identity. The same identity in two flows was one entity and two runs, because a person looks up the subject and then the flows that ran on it. ADR 0007 replaces that identity with an entity type and an identifier, and replaces the rule that replaying reuses the run. Validity stays defined once on the flow. Inside the validity duration the recorded result is returned. A different flow on the same entity does not replace the first run."}),"\n",(0,V.jsx)(b.p,{children:"This replaces the rule in ADR 0002 that the same identity in two flows is two entities. One run of an organization, a flow, and an identity still proceeds at a time, and that run keeps the starting data of the request that started it. The stored row stays that run. A separate run name was rejected: replaying would otherwise leave two current trees for one flow."})]})}function c9(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(c8,{...a})}):c8(a)}let da={title:"The orchestrator applies results"},db=[],dc={contents:[{heading:"the-orchestrator-applies-results",content:"A worker runs a step. It does not apply the flow and it does not write the entity. One orchestrator reads each step result, applies the flow, and writes Postgres. Many workers would otherwise open many sessions on the same rows, and Postgres would be the only place that ordered those writes."},{heading:"the-orchestrator-applies-results",content:"The job stays an organization, an entity, and a step, plus a token, and it still carries no secret. The starting data sits in a short-lived dispatch value keyed by that token. The worker loads secrets once at startup into the environment, so the dispatch value carries no secret. The worker takes the value, runs the step, and publishes the result. The orchestrator is the only consumer of those results."}],headings:[{id:"the-orchestrator-applies-results",content:"The orchestrator applies results"}]},dd=[{depth:1,url:"#the-orchestrator-applies-results",title:(0,V.jsx)(V.Fragment,{children:"The orchestrator applies results"})}];function de(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"the-orchestrator-applies-results",children:"The orchestrator applies results"}),"\n",(0,V.jsx)(b.p,{children:"A worker runs a step. It does not apply the flow and it does not write the entity. One orchestrator reads each step result, applies the flow, and writes Postgres. Many workers would otherwise open many sessions on the same rows, and Postgres would be the only place that ordered those writes."}),"\n",(0,V.jsx)(b.p,{children:"The job stays an organization, an entity, and a step, plus a token, and it still carries no secret. The starting data sits in a short-lived dispatch value keyed by that token. The worker loads secrets once at startup into the environment, so the dispatch value carries no secret. The worker takes the value, runs the step, and publishes the result. The orchestrator is the only consumer of those results."})]})}function df(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(de,{...a})}):de(a)}let dg={title:"One row per entity"},dh=[],di={contents:[{heading:"one-row-per-entity",content:"The orchestrator used to rewrite every entity of an organization as one JSON blob. A transition only needs the entity, the children named in its tree, and the running parents. One row per entity keeps that read small. The operation tree stays JSON on the row, because the engine rereads the function and lines openings up by position. Parent and child links sit in their own table: a child can have several parents, and walking every entity to find them does not scale. ADR 0007 replaces the rule that past trees are not kept and that the next flow run replaces the row."}],headings:[{id:"one-row-per-entity",content:"One row per entity"}]},dj=[{depth:1,url:"#one-row-per-entity",title:(0,V.jsx)(V.Fragment,{children:"One row per entity"})}];function dk(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"one-row-per-entity",children:"One row per entity"}),"\n",(0,V.jsx)(b.p,{children:"The orchestrator used to rewrite every entity of an organization as one JSON blob. A transition only needs the entity, the children named in its tree, and the running parents. One row per entity keeps that read small. The operation tree stays JSON on the row, because the engine rereads the function and lines openings up by position. Parent and child links sit in their own table: a child can have several parents, and walking every entity to find them does not scale. ADR 0007 replaces the rule that past trees are not kept and that the next flow run replaces the row."})]})}function dl(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(dk,{...a})}):dk(a)}let dm={title:"A metric is apart from the run"},dn=[],dp={contents:[{heading:"a-metric-is-apart-from-the-run",content:"A person looks at outcomes and durations over a period, and the orchestrator still has to reread the result that a step returned. Keeping those in one row would either drop the period view when the next run replaces the tree, or make the engine reread a metric. The metric is the retained end of a finished run. ClickHouse holds those ends and the hourly aggregates. The engine rereads the result. It does not reread the metric. A running flow run is not a metric. ADR 0007 replaces the rule that Postgres holds only the current flow run."}],headings:[{id:"a-metric-is-apart-from-the-run",content:"A metric is apart from the run"}]},dq=[{depth:1,url:"#a-metric-is-apart-from-the-run",title:(0,V.jsx)(V.Fragment,{children:"A metric is apart from the run"})}];function dr(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"a-metric-is-apart-from-the-run",children:"A metric is apart from the run"}),"\n",(0,V.jsx)(b.p,{children:"A person looks at outcomes and durations over a period, and the orchestrator still has to reread the result that a step returned. Keeping those in one row would either drop the period view when the next run replaces the tree, or make the engine reread a metric. The metric is the retained end of a finished run. ClickHouse holds those ends and the hourly aggregates. The engine rereads the result. It does not reread the metric. A running flow run is not a metric. ADR 0007 replaces the rule that Postgres holds only the current flow run."})]})}function ds(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(dr,{...a})}):dr(a)}let dt={title:"An entity is an organization, a flow, and an identity"},du=[],dv={contents:[{heading:"an-entity-is-an-organization-a-flow-and-an-identity",content:"The same identity in two flows is two entities, and two organizations do not share one. Validity is defined once on the flow and applies to each of its entities. One run of that key proceeds at a time. A later request waits, and the run keeps the starting data of the request that started it."},{heading:"an-entity-is-an-organization-a-flow-and-an-identity",content:"ADR 0006 replaces the rule that the same identity in two flows is two entities."}],headings:[{id:"an-entity-is-an-organization-a-flow-and-an-identity",content:"An entity is an organization, a flow, and an identity"}]},dw=[{depth:1,url:"#an-entity-is-an-organization-a-flow-and-an-identity",title:(0,V.jsx)(V.Fragment,{children:"An entity is an organization, a flow, and an identity"})}];function dx(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"an-entity-is-an-organization-a-flow-and-an-identity",children:"An entity is an organization, a flow, and an identity"}),"\n",(0,V.jsx)(b.p,{children:"The same identity in two flows is two entities, and two organizations do not share one. Validity is defined once on the flow and applies to each of its entities. One run of that key proceeds at a time. A later request waits, and the run keeps the starting data of the request that started it."}),"\n",(0,V.jsx)(b.p,{children:"ADR 0006 replaces the rule that the same identity in two flows is two entities."})]})}function dy(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(dx,{...a})}):dx(a)}let dz={title:"The flow is restricted TypeScript, reread from the start"},dA=[],dB={contents:[{heading:"the-flow-is-restricted-typescript-reread-from-the-start",content:"A flow has to stay deterministic given the same sealed reports, and a person has to be able to read the source of the paths that were not taken. A transition table cannot express that source. Freely executed TypeScript could read the clock, the secrets, or the client database. The flow is a TypeScript function that may only open a step, open child entities, wait for a group, choose one named arm, finish, or declare failure. The orchestrator rereads it from the start whenever the run resumes. A choice records every arm it writes. One name takes one arm. The other arms name their steps as discarded, and those steps are not opened."}],headings:[{id:"the-flow-is-restricted-typescript-reread-from-the-start",content:"The flow is restricted TypeScript, reread from the start"}]},dC=[{depth:1,url:"#the-flow-is-restricted-typescript-reread-from-the-start",title:(0,V.jsx)(V.Fragment,{children:"The flow is restricted TypeScript, reread from the start"})}];function dD(a){let b={h1:"h1",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"the-flow-is-restricted-typescript-reread-from-the-start",children:"The flow is restricted TypeScript, reread from the start"}),"\n",(0,V.jsx)(b.p,{children:"A flow has to stay deterministic given the same sealed reports, and a person has to be able to read the source of the paths that were not taken. A transition table cannot express that source. Freely executed TypeScript could read the clock, the secrets, or the client database. The flow is a TypeScript function that may only open a step, open child entities, wait for a group, choose one named arm, finish, or declare failure. The orchestrator rereads it from the start whenever the run resumes. A choice records every arm it writes. One name takes one arm. The other arms name their steps as discarded, and those steps are not opened."})]})}function dE(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(dD,{...a})}):dD(a)}let dF={title:"Server"},dG=[],dH={contents:[{heading:void 0,content:"This installs the published images on a Linux server. cue deploy runs on the operator machine. It uses ssh and scp. It does not clone the repository, and it does not build on the server."},{heading:"dns",content:"Before the first start, point these three names at the server:"},{heading:"dns",content:"the console host passed to --console-host, such as console.example.com"},{heading:"dns",content:"doc.<console-host>, such as doc.console.example.com"},{heading:"dns",content:"the public host passed to --edge-name, stored on the server as EDGE_NAME"},{heading:"dns",content:"Let's Encrypt completes the HTTP-01 challenge on port 80. The three names have to resolve to this server before Compose starts, or that challenge fails. Port 80 is not a site in the Caddyfile."},{heading:"dns",content:"The console answers on https://<console-host>. The docs answer on https://doc.<console-host>. The docs name is derived from ORCH_CONSOLE_HOST. There is no separate variable for it. Both sites use the same Let's Encrypt issuer and the same address list. Neither site asks for a client certificate. CUE_URL is https://<EDGE_NAME>:3443. The facade ports use the private certificate."},{heading:"deploy",content:"cue comes from the installed @ascentstudio/cue-sdk package. The image tag is the version of that package, the same version as the npm packages of that publication."},{heading:"deploy",content:"cue deploy --help and cue deploy -h print that usage line. The command takes one positional argument, user@host. It runs ssh and scp with that host and no extra options."},{heading:"deploy",content:"--edge-name, --console-host, --acme-email, --s3-bucket, and --s3-region are required. --s3-endpoint is optional. --edge-name and --console-host are hostnames without a scheme, a port, or a path. --acme-email is an email address. --s3-bucket, --s3-region, and the S3 keys cannot contain a space, #, a quote, or \\. When --s3-endpoint is set, it is an http or https URL."},{heading:"deploy",content:"The S3 keys come from AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY, or from CUE_S3_ACCESS_KEY_ID and CUE_S3_SECRET_ACCESS_KEY. If a key is missing, the command prompts for it. The prompt does not echo, and it needs a terminal."},{heading:"deploy",content:"The age private key is ~/.config/cue/age.key on the operator machine, mode 0600. When the command creates that key, it creates ~/.config/cue as mode 0700. A key that is already a valid identity is reused. A file that is not an age identity stops the command. The private key stays on this machine. backup.env receives only the public recipient."},{heading:"deploy",content:"The command generates new service secrets, copies the server tree from the SDK package, and writes .env, backup.env, and network.ini. .env and backup.env are mode 0600. Before it connects, it prints a reminder to point DNS for the edge name, the console host, and doc.<console-host> at the server. It then copies the tree with scp to /tmp/cue-deploy-… and runs remote-install.sh there."},{heading:"deploy",content:"On the server, the script checks Linux, Docker, and Docker Compose. It pulls ascentstudio/cue-orchestrator, ascentstudio/cue-caddy, ascentstudio/cue-zot, and ascentstudio/cue-backup. For version 0.1.0 each image is tagged 0.1.0. There is no latest tag. One version does not pull another image. Redis, ClickHouse, MinIO, Verdaccio, and Supabase stay on their public images. A failed pull stops the script before it copies anything into the install directory. It then copies the tree to /var/lib/cue, mode 0700, and creates the certificate directory /var/lib/ultimate-scraper/certs. docker compose up -d runs from /var/lib/cue. The firewall step comes after Compose has started."},{heading:"deploy",content:"The script opens ports 22, 80, and 443 with ufw, or with firewalld when ufw is not installed. An account other than root runs those commands through sudo. It limits the facade ports 3443, 4443, 6380, 8443, 9443, 7443, and 4873 to the address in SSH_CLIENT. If neither firewall command is installed, it prints those rules and leaves the firewall unchanged. If SSH_CLIENT has no usable address, the install stops after Compose has started. Ports published by Docker bypass that firewall. Postgres listens on 127.0.0.1:54322, and the Supabase API listens on 127.0.0.1:54321. Redis, ClickHouse, MinIO, zot, Verdaccio, and Supavisor are not published on the host."},{heading:"deploy",content:"--edge-name is the public host of CUE_URL. The command stores it as EDGE_NAME, sets CUE_URL to https://<edge-name>:3443, and writes that EDGE_NAME in network.ini. --console-host is stored as ORCH_CONSOLE_HOST. The server environment leaves ORCH_URL, ORCH_EDGE_NAMES, CUE_REDIS_URL, CUE_CLICKHOUSE_URL, CUE_TRANSIENT_S3_ENDPOINT, and CUE_ENROLLMENT unset. The console uses https://127.0.0.1:3443."},{heading:"deploy",content:"ascentstudio/cue-orchestrator:<version> is the image Compose starts. Its entrypoint starts the orchestrator, waits until console-client.crt and the Caddyfile are in the certificate directory, then starts the console on port 3000 and the docs on port 3002. The orchestrator process does not start those two. The container uses the host network, so Caddy reaches 127.0.0.1:3000, 127.0.0.1:3001, and 127.0.0.1:3002."},{heading:"deploy",content:"Compose sets MIGRATE_SEED=0. The migrate service skips deploy/supabase/seed.sql. The server has no pierre@ascent-studio.fr account, no fixture-local secret, and no join_fixture trigger."},{heading:"deploy",content:"A second cue deploy writes new secrets into /var/lib/cue/.env and backup.env, then runs Compose again. The Postgres volume keeps the password from the first start. The age key on the operator machine stays the one already there."},{heading:"deploy",content:"After a successful install, the command prints the age key path, the cue-backups prefix, the 03:00 UTC backup time, and the notes about Docker-published ports and Redis. It then deletes the temporary tree on the operator machine."},{heading:"first-sign-in",content:"Open https://<console-host> and create the first person on the sign-in page. The address list is empty, so the console is open for that sign-in."},{heading:"first-sign-in",content:"The browser uses NEXT_PUBLIC_SUPABASE_URL. On the console site, Caddy forwards only /auth/v1 to 127.0.0.1:54321. Studio stays on that loop, behind the gateway password. The console process uses SUPABASE_SERVER_URL=http://127.0.0.1:54321."},{heading:"address-list",content:"The console page /account/edge edits the edge_allow table. Each change rewrites the Caddyfile and pg_hba.conf."},{heading:"address-list",content:"The first list must contain the address of the person saving it. A list that does not contain that address is refused. After the first address, the console site and the docs site use the same list. An empty list leaves both sites open and refuses remote addresses on the machine listeners: enrollment, machine API, Redis, ClickHouse, MinIO, Postgres, zot, and Verdaccio. 127.0.0.1 and ::1 stay allowed."},{heading:"supervisors",content:"A supervisor uses CUE_URL, https://<EDGE_NAME>:3443. It derives Redis (rediss://<host>:6380), ClickHouse (https://<host>:8443), transient files (https://<host>:9443, region us-east-1, bucket transient), enrollment (https://<host>:4443), zot (https://<host>:7443), and Verdaccio (https://<host>:4873) from that host."},{heading:"supervisors",content:"Add the supervisor address to the edge list before you start it. Otherwise its enrollment request does not reach the orchestrator. The facade ports are limited to the SSH_CLIENT address recorded at deploy, so a supervisor on another address also needs those ports allowed for it. Enrollment on port 4443 uses server TLS only. The supervisor prints a code and polls. A person approves that code on the Supervisors page."},{heading:"supervisors",content:"cue deploy-supervisor installs that supervisor on Ubuntu or Debian. It does not run on macOS. It uses ssh and scp. It does not clone a repository, and it does not build on the host. It does not read or write a package.json, and it does not copy a checkout. cue.organization stays on the orchestrator, when a package revision is registered."},{heading:"supervisors",content:"--organization, --cue-url, --ca, and --environment are required. --organization, --environment, and --worker are lowercase letters, digits, and hyphens. --cue-url is an https URL. --ca is a local file, copied to the host as the orchestrator authority. --mode is container or process. The default is container. --kinds, --not-kinds, --runtimes, and --not-runtimes select the kinds this host accepts. --env-file is an optional local file copied onto the host. The service passes that path to the supervisor. It never passes --source."},{heading:"supervisors",content:"The environment secret comes from CUE_ENVIRONMENT_SECRET. If it is missing, the command prompts for it. The prompt does not echo, and it needs a terminal. Without --worker, the worker name is the remote hostname, with every other character turned into a hyphen."},{heading:"supervisors",content:"Before the install, the command reads the VPS egress address from the host route and prints it. Add that address on /account/edge, and allow it on the orchestrator facade ports 3443, 4443, 6380, 8443, 9443, 7443, and 4873. The command does not connect to the orchestrator."},{heading:"supervisors",content:"On the host, a system Node.js that is already version 22 or newer stays. Otherwise the script extracts the official Node 22 archive into /usr/local. It does not use nvm. Docker Engine and the Compose plugin stay when docker compose already answers. Otherwise they are installed from the Docker apt repository, and Docker is enabled. The system user cue is created when missing, in the docker group, with home /var/lib/cue-supervisor. The script installs @ascentstudio/cue-supervisor at the SDK version."},{heading:"supervisors",content:"supervisor.env is mode 0600. It sets WORKER_ORGANIZATION, CUE_URL, CUE_ENVIRONMENT_SECRET, CUE_ENVIRONMENT_NAME, WORKER_NAME, SUPERVISOR_CERT_DIR=/var/lib/ultimate-scraper/supervisor, and ORCH_REVISION_CACHE=/var/lib/cue-supervisor/revisions. No package.json is placed in /var/lib/cue-supervisor. The supervisor enrolls as organization/environment/host, using WORKER_ORGANIZATION because that directory has no checkout. After enrollment, fetchWorkerEnvironment still checks that the secret matches that organization and environment. The pinned revision is downloaded into the revision cache. Process mode does not treat the install directory as source. Container mode starts the images of that revision. Process mode starts worker from that revision. A cue dev inside a checkout still uses that checkout."},{heading:"supervisors",content:"The firewall step runs before the service starts. The script installs ufw when it is missing, allows the server port from SSH_CONNECTION, and denies other incoming traffic. It does not open the facade ports. The supervisor is a client. If that port cannot be read, the script does not enable the firewall, and it exits, so the SSH session is not cut off. The unit is cue-supervisor.service, with Restart=always and WantedBy=multi-user.target. A second run rewrites the unit and restarts the service."},{heading:"supervisors",content:"After the service starts, the command follows journalctl -u cue-supervisor -o cat from that start. It prints the enrollment code, the waiting line when the orchestrator is unreachable, approval, denial, expiry, and a certificate that is already valid. It exits when the certificate is in place, approved, denied, or expired. Ctrl-C stops that relay and leaves the service running."},{heading:"backup",content:"A backup container on the platform network waits until 03:00 UTC, runs the backup, and repeats that wait. The first backup and every later backup run at 03:00 UTC. It has no published port. It uses ascentstudio/cue-backup:<version>."},{heading:"backup",content:"The container dumps Postgres with pg_dump -Fc to db:5432, with the database password, not through host port 54322. It writes the ClickHouse metrics to a file and copies the certificate directory. It encrypts those files with age, using the operator's public key, and stores them in the S3 bucket under the prefix cue-backups. Retention is 30 days. The S3 credentials on the server can only write to that prefix."},{heading:"backup",content:"The age private key stays on the operator machine, at ~/.config/cue/age.key, mode 0600. It is not on the server."},{heading:"backup",content:"Redis is not backed up."},{heading:"restore",content:"Decrypt a backup on the operator machine with the age private key at ~/.config/cue/age.key. Restore Postgres from the dump, restore the ClickHouse metrics, and restore the certificate directory."},{heading:"restore",content:"Redis is not in the backup. After a Postgres restore, flush Redis. Jobs left in Redis would run again after Postgres already applied them."}],headings:[{id:"dns",content:"DNS"},{id:"deploy",content:"Deploy"},{id:"first-sign-in",content:"First sign-in"},{id:"address-list",content:"Address list"},{id:"supervisors",content:"Supervisors"},{id:"backup",content:"Backup"},{id:"restore",content:"Restore"}]},dI=[{depth:2,url:"#dns",title:(0,V.jsx)(V.Fragment,{children:"DNS"})},{depth:2,url:"#deploy",title:(0,V.jsx)(V.Fragment,{children:"Deploy"})},{depth:2,url:"#first-sign-in",title:(0,V.jsx)(V.Fragment,{children:"First sign-in"})},{depth:2,url:"#address-list",title:(0,V.jsx)(V.Fragment,{children:"Address list"})},{depth:2,url:"#supervisors",title:(0,V.jsx)(V.Fragment,{children:"Supervisors"})},{depth:2,url:"#backup",title:(0,V.jsx)(V.Fragment,{children:"Backup"})},{depth:2,url:"#restore",title:(0,V.jsx)(V.Fragment,{children:"Restore"})}];function dJ(a){let b={code:"code",h2:"h2",li:"li",p:"p",pre:"pre",span:"span",ul:"ul",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(b.p,{children:["This installs the published images on a Linux server. ",(0,V.jsx)(b.code,{children:"cue deploy"})," runs on the operator machine. It uses ",(0,V.jsx)(b.code,{children:"ssh"})," and ",(0,V.jsx)(b.code,{children:"scp"}),". It does not clone the repository, and it does not build on the server."]}),"\n",(0,V.jsx)(b.h2,{id:"dns",children:"DNS"}),"\n",(0,V.jsx)(b.p,{children:"Before the first start, point these three names at the server:"}),"\n",(0,V.jsxs)(b.ul,{children:["\n",(0,V.jsxs)(b.li,{children:["the console host passed to ",(0,V.jsx)(b.code,{children:"--console-host"}),", such as ",(0,V.jsx)(b.code,{children:"console.example.com"})]}),"\n",(0,V.jsxs)(b.li,{children:[(0,V.jsx)(b.code,{children:"doc.<console-host>"}),", such as ",(0,V.jsx)(b.code,{children:"doc.console.example.com"})]}),"\n",(0,V.jsxs)(b.li,{children:["the public host passed to ",(0,V.jsx)(b.code,{children:"--edge-name"}),", stored on the server as ",(0,V.jsx)(b.code,{children:"EDGE_NAME"})]}),"\n"]}),"\n",(0,V.jsx)(b.p,{children:"Let's Encrypt completes the HTTP-01 challenge on port 80. The three names have to resolve to this server before Compose starts, or that challenge fails. Port 80 is not a site in the Caddyfile."}),"\n",(0,V.jsxs)(b.p,{children:["The console answers on ",(0,V.jsx)(b.code,{children:"https://<console-host>"}),". The docs answer on ",(0,V.jsx)(b.code,{children:"https://doc.<console-host>"}),". The docs name is derived from ",(0,V.jsx)(b.code,{children:"ORCH_CONSOLE_HOST"}),". There is no separate variable for it. Both sites use the same Let's Encrypt issuer and the same address list. Neither site asks for a client certificate. ",(0,V.jsx)(b.code,{children:"CUE_URL"})," is ",(0,V.jsx)(b.code,{children:"https://<EDGE_NAME>:3443"}),". The facade ports use the private certificate."]}),"\n",(0,V.jsx)(b.h2,{id:"deploy",children:"Deploy"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"cue"})," comes from the installed ",(0,V.jsx)(b.code,{children:"@ascentstudio/cue-sdk"})," package. The image tag is the version of that package, the same version as the npm packages of that publication."]}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"cue"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" deploy"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" user@host"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --edge-name"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" edge.example.com"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --console-host"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" console.example.com"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --acme-email"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" admin@example.com"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --s3-bucket"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" cue-backups"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --s3-region"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" eu-west-1"})]})})})}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"cue deploy --help"})," and ",(0,V.jsx)(b.code,{children:"cue deploy -h"})," print that usage line. The command takes one positional argument, ",(0,V.jsx)(b.code,{children:"user@host"}),". It runs ",(0,V.jsx)(b.code,{children:"ssh"})," and ",(0,V.jsx)(b.code,{children:"scp"})," with that host and no extra options."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"--edge-name"}),", ",(0,V.jsx)(b.code,{children:"--console-host"}),", ",(0,V.jsx)(b.code,{children:"--acme-email"}),", ",(0,V.jsx)(b.code,{children:"--s3-bucket"}),", and ",(0,V.jsx)(b.code,{children:"--s3-region"})," are required. ",(0,V.jsx)(b.code,{children:"--s3-endpoint"})," is optional. ",(0,V.jsx)(b.code,{children:"--edge-name"})," and ",(0,V.jsx)(b.code,{children:"--console-host"})," are hostnames without a scheme, a port, or a path. ",(0,V.jsx)(b.code,{children:"--acme-email"})," is an email address. ",(0,V.jsx)(b.code,{children:"--s3-bucket"}),", ",(0,V.jsx)(b.code,{children:"--s3-region"}),", and the S3 keys cannot contain a space, ",(0,V.jsx)(b.code,{children:"#"}),", a quote, or ",(0,V.jsx)(b.code,{children:"\\"}),". When ",(0,V.jsx)(b.code,{children:"--s3-endpoint"})," is set, it is an ",(0,V.jsx)(b.code,{children:"http"})," or ",(0,V.jsx)(b.code,{children:"https"})," URL."]}),"\n",(0,V.jsxs)(b.p,{children:["The S3 keys come from ",(0,V.jsx)(b.code,{children:"AWS_ACCESS_KEY_ID"})," and ",(0,V.jsx)(b.code,{children:"AWS_SECRET_ACCESS_KEY"}),", or from ",(0,V.jsx)(b.code,{children:"CUE_S3_ACCESS_KEY_ID"})," and ",(0,V.jsx)(b.code,{children:"CUE_S3_SECRET_ACCESS_KEY"}),". If a key is missing, the command prompts for it. The prompt does not echo, and it needs a terminal."]}),"\n",(0,V.jsxs)(b.p,{children:["The age private key is ",(0,V.jsx)(b.code,{children:"~/.config/cue/age.key"})," on the operator machine, mode ",(0,V.jsx)(b.code,{children:"0600"}),". When the command creates that key, it creates ",(0,V.jsx)(b.code,{children:"~/.config/cue"})," as mode ",(0,V.jsx)(b.code,{children:"0700"}),". A key that is already a valid identity is reused. A file that is not an age identity stops the command. The private key stays on this machine. ",(0,V.jsx)(b.code,{children:"backup.env"})," receives only the public recipient."]}),"\n",(0,V.jsxs)(b.p,{children:["The command generates new service secrets, copies the server tree from the SDK package, and writes ",(0,V.jsx)(b.code,{children:".env"}),", ",(0,V.jsx)(b.code,{children:"backup.env"}),", and ",(0,V.jsx)(b.code,{children:"network.ini"}),". ",(0,V.jsx)(b.code,{children:".env"})," and ",(0,V.jsx)(b.code,{children:"backup.env"})," are mode ",(0,V.jsx)(b.code,{children:"0600"}),". Before it connects, it prints a reminder to point DNS for the edge name, the console host, and ",(0,V.jsx)(b.code,{children:"doc.<console-host>"})," at the server. It then copies the tree with ",(0,V.jsx)(b.code,{children:"scp"})," to ",(0,V.jsx)(b.code,{children:"/tmp/cue-deploy-…"})," and runs ",(0,V.jsx)(b.code,{children:"remote-install.sh"})," there."]}),"\n",(0,V.jsxs)(b.p,{children:["On the server, the script checks Linux, Docker, and Docker Compose. It pulls ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-orchestrator"}),", ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-caddy"}),", ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-zot"}),", and ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-backup"}),". For version ",(0,V.jsx)(b.code,{children:"0.1.0"})," each image is tagged ",(0,V.jsx)(b.code,{children:"0.1.0"}),". There is no ",(0,V.jsx)(b.code,{children:"latest"})," tag. One version does not pull another image. Redis, ClickHouse, MinIO, Verdaccio, and Supabase stay on their public images. A failed pull stops the script before it copies anything into the install directory. It then copies the tree to ",(0,V.jsx)(b.code,{children:"/var/lib/cue"}),", mode ",(0,V.jsx)(b.code,{children:"0700"}),", and creates the certificate directory ",(0,V.jsx)(b.code,{children:"/var/lib/ultimate-scraper/certs"}),". ",(0,V.jsx)(b.code,{children:"docker compose up -d"})," runs from ",(0,V.jsx)(b.code,{children:"/var/lib/cue"}),". The firewall step comes after Compose has started."]}),"\n",(0,V.jsxs)(b.p,{children:["The script opens ports 22, 80, and 443 with ",(0,V.jsx)(b.code,{children:"ufw"}),", or with ",(0,V.jsx)(b.code,{children:"firewalld"})," when ",(0,V.jsx)(b.code,{children:"ufw"})," is not installed. An account other than root runs those commands through ",(0,V.jsx)(b.code,{children:"sudo"}),". It limits the facade ports 3443, 4443, 6380, 8443, 9443, 7443, and 4873 to the address in ",(0,V.jsx)(b.code,{children:"SSH_CLIENT"}),". If neither firewall command is installed, it prints those rules and leaves the firewall unchanged. If ",(0,V.jsx)(b.code,{children:"SSH_CLIENT"})," has no usable address, the install stops after Compose has started. Ports published by Docker bypass that firewall. Postgres listens on ",(0,V.jsx)(b.code,{children:"127.0.0.1:54322"}),", and the Supabase API listens on ",(0,V.jsx)(b.code,{children:"127.0.0.1:54321"}),". Redis, ClickHouse, MinIO, zot, Verdaccio, and Supavisor are not published on the host."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"--edge-name"})," is the public host of ",(0,V.jsx)(b.code,{children:"CUE_URL"}),". The command stores it as ",(0,V.jsx)(b.code,{children:"EDGE_NAME"}),", sets ",(0,V.jsx)(b.code,{children:"CUE_URL"})," to ",(0,V.jsx)(b.code,{children:"https://<edge-name>:3443"}),", and writes that ",(0,V.jsx)(b.code,{children:"EDGE_NAME"})," in ",(0,V.jsx)(b.code,{children:"network.ini"}),". ",(0,V.jsx)(b.code,{children:"--console-host"})," is stored as ",(0,V.jsx)(b.code,{children:"ORCH_CONSOLE_HOST"}),". The server environment leaves ",(0,V.jsx)(b.code,{children:"ORCH_URL"}),", ",(0,V.jsx)(b.code,{children:"ORCH_EDGE_NAMES"}),", ",(0,V.jsx)(b.code,{children:"CUE_REDIS_URL"}),", ",(0,V.jsx)(b.code,{children:"CUE_CLICKHOUSE_URL"}),", ",(0,V.jsx)(b.code,{children:"CUE_TRANSIENT_S3_ENDPOINT"}),", and ",(0,V.jsx)(b.code,{children:"CUE_ENROLLMENT"})," unset. The console uses ",(0,V.jsx)(b.code,{children:"https://127.0.0.1:3443"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ascentstudio/cue-orchestrator:<version>"})," is the image Compose starts. Its entrypoint starts the orchestrator, waits until ",(0,V.jsx)(b.code,{children:"console-client.crt"})," and the ",(0,V.jsx)(b.code,{children:"Caddyfile"})," are in the certificate directory, then starts the console on port 3000 and the docs on port 3002. The orchestrator process does not start those two. The container uses the host network, so Caddy reaches ",(0,V.jsx)(b.code,{children:"127.0.0.1:3000"}),", ",(0,V.jsx)(b.code,{children:"127.0.0.1:3001"}),", and ",(0,V.jsx)(b.code,{children:"127.0.0.1:3002"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:["Compose sets ",(0,V.jsx)(b.code,{children:"MIGRATE_SEED=0"}),". The migrate service skips ",(0,V.jsx)(b.code,{children:"deploy/supabase/seed.sql"}),". The server has no ",(0,V.jsx)(b.code,{children:"pierre@ascent-studio.fr"})," account, no ",(0,V.jsx)(b.code,{children:"fixture-local"})," secret, and no ",(0,V.jsx)(b.code,{children:"join_fixture"})," trigger."]}),"\n",(0,V.jsxs)(b.p,{children:["A second ",(0,V.jsx)(b.code,{children:"cue deploy"})," writes new secrets into ",(0,V.jsx)(b.code,{children:"/var/lib/cue/.env"})," and ",(0,V.jsx)(b.code,{children:"backup.env"}),", then runs Compose again. The Postgres volume keeps the password from the first start. The age key on the operator machine stays the one already there."]}),"\n",(0,V.jsxs)(b.p,{children:["After a successful install, the command prints the age key path, the ",(0,V.jsx)(b.code,{children:"cue-backups"})," prefix, the 03:00 UTC backup time, and the notes about Docker-published ports and Redis. It then deletes the temporary tree on the operator machine."]}),"\n",(0,V.jsx)(b.h2,{id:"first-sign-in",children:"First sign-in"}),"\n",(0,V.jsxs)(b.p,{children:["Open ",(0,V.jsx)(b.code,{children:"https://<console-host>"})," and create the first person on the sign-in page. The address list is empty, so the console is open for that sign-in."]}),"\n",(0,V.jsxs)(b.p,{children:["The browser uses ",(0,V.jsx)(b.code,{children:"NEXT_PUBLIC_SUPABASE_URL"}),". On the console site, Caddy forwards only ",(0,V.jsx)(b.code,{children:"/auth/v1"})," to ",(0,V.jsx)(b.code,{children:"127.0.0.1:54321"}),". Studio stays on that loop, behind the gateway password. The console process uses ",(0,V.jsx)(b.code,{children:"SUPABASE_SERVER_URL=http://127.0.0.1:54321"}),"."]}),"\n",(0,V.jsx)(b.h2,{id:"address-list",children:"Address list"}),"\n",(0,V.jsxs)(b.p,{children:["The console page ",(0,V.jsx)(b.code,{children:"/account/edge"})," edits the ",(0,V.jsx)(b.code,{children:"edge_allow"})," table. Each change rewrites the ",(0,V.jsx)(b.code,{children:"Caddyfile"})," and ",(0,V.jsx)(b.code,{children:"pg_hba.conf"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:["The first list must contain the address of the person saving it. A list that does not contain that address is refused. After the first address, the console site and the docs site use the same list. An empty list leaves both sites open and refuses remote addresses on the machine listeners: enrollment, machine API, Redis, ClickHouse, MinIO, Postgres, zot, and Verdaccio. ",(0,V.jsx)(b.code,{children:"127.0.0.1"})," and ",(0,V.jsx)(b.code,{children:"::1"})," stay allowed."]}),"\n",(0,V.jsx)(b.h2,{id:"supervisors",children:"Supervisors"}),"\n",(0,V.jsxs)(b.p,{children:["A supervisor uses ",(0,V.jsx)(b.code,{children:"CUE_URL"}),", ",(0,V.jsx)(b.code,{children:"https://<EDGE_NAME>:3443"}),". It derives Redis (",(0,V.jsx)(b.code,{children:"rediss://<host>:6380"}),"), ClickHouse (",(0,V.jsx)(b.code,{children:"https://<host>:8443"}),"), transient files (",(0,V.jsx)(b.code,{children:"https://<host>:9443"}),", region ",(0,V.jsx)(b.code,{children:"us-east-1"}),", bucket ",(0,V.jsx)(b.code,{children:"transient"}),"), enrollment (",(0,V.jsx)(b.code,{children:"https://<host>:4443"}),"), zot (",(0,V.jsx)(b.code,{children:"https://<host>:7443"}),"), and Verdaccio (",(0,V.jsx)(b.code,{children:"https://<host>:4873"}),") from that host."]}),"\n",(0,V.jsxs)(b.p,{children:["Add the supervisor address to the edge list before you start it. Otherwise its enrollment request does not reach the orchestrator. The facade ports are limited to the ",(0,V.jsx)(b.code,{children:"SSH_CLIENT"})," address recorded at deploy, so a supervisor on another address also needs those ports allowed for it. Enrollment on port 4443 uses server TLS only. The supervisor prints a code and polls. A person approves that code on the Supervisors page."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"cue deploy-supervisor"})," installs that supervisor on Ubuntu or Debian. It does not run on macOS. It uses ",(0,V.jsx)(b.code,{children:"ssh"})," and ",(0,V.jsx)(b.code,{children:"scp"}),". It does not clone a repository, and it does not build on the host. It does not read or write a ",(0,V.jsx)(b.code,{children:"package.json"}),", and it does not copy a checkout. ",(0,V.jsx)(b.code,{children:"cue.organization"})," stays on the orchestrator, when a package revision is registered."]}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"cue"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" deploy-supervisor"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" user@host"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --organization"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" minea"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --cue-url"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" https://edge.example.com:3443"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --ca"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" /path/ca.crt"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --environment"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" prod"})]})})})}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"--organization"}),", ",(0,V.jsx)(b.code,{children:"--cue-url"}),", ",(0,V.jsx)(b.code,{children:"--ca"}),", and ",(0,V.jsx)(b.code,{children:"--environment"})," are required. ",(0,V.jsx)(b.code,{children:"--organization"}),", ",(0,V.jsx)(b.code,{children:"--environment"}),", and ",(0,V.jsx)(b.code,{children:"--worker"})," are lowercase letters, digits, and hyphens. ",(0,V.jsx)(b.code,{children:"--cue-url"})," is an https URL. ",(0,V.jsx)(b.code,{children:"--ca"})," is a local file, copied to the host as the orchestrator authority. ",(0,V.jsx)(b.code,{children:"--mode"})," is ",(0,V.jsx)(b.code,{children:"container"})," or ",(0,V.jsx)(b.code,{children:"process"}),". The default is ",(0,V.jsx)(b.code,{children:"container"}),". ",(0,V.jsx)(b.code,{children:"--kinds"}),", ",(0,V.jsx)(b.code,{children:"--not-kinds"}),", ",(0,V.jsx)(b.code,{children:"--runtimes"}),", and ",(0,V.jsx)(b.code,{children:"--not-runtimes"})," select the kinds this host accepts. ",(0,V.jsx)(b.code,{children:"--env-file"})," is an optional local file copied onto the host. The service passes that path to the supervisor. It never passes ",(0,V.jsx)(b.code,{children:"--source"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:["The environment secret comes from ",(0,V.jsx)(b.code,{children:"CUE_ENVIRONMENT_SECRET"}),". If it is missing, the command prompts for it. The prompt does not echo, and it needs a terminal. Without ",(0,V.jsx)(b.code,{children:"--worker"}),", the worker name is the remote hostname, with every other character turned into a hyphen."]}),"\n",(0,V.jsxs)(b.p,{children:["Before the install, the command reads the VPS egress address from the host route and prints it. Add that address on ",(0,V.jsx)(b.code,{children:"/account/edge"}),", and allow it on the orchestrator facade ports 3443, 4443, 6380, 8443, 9443, 7443, and 4873. The command does not connect to the orchestrator."]}),"\n",(0,V.jsxs)(b.p,{children:["On the host, a system Node.js that is already version 22 or newer stays. Otherwise the script extracts the official Node 22 archive into ",(0,V.jsx)(b.code,{children:"/usr/local"}),". It does not use nvm. Docker Engine and the Compose plugin stay when ",(0,V.jsx)(b.code,{children:"docker compose"})," already answers. Otherwise they are installed from the Docker apt repository, and Docker is enabled. The system user ",(0,V.jsx)(b.code,{children:"cue"})," is created when missing, in the ",(0,V.jsx)(b.code,{children:"docker"})," group, with home ",(0,V.jsx)(b.code,{children:"/var/lib/cue-supervisor"}),". The script installs ",(0,V.jsx)(b.code,{children:"@ascentstudio/cue-supervisor"})," at the SDK version."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"supervisor.env"})," is mode ",(0,V.jsx)(b.code,{children:"0600"}),". It sets ",(0,V.jsx)(b.code,{children:"WORKER_ORGANIZATION"}),", ",(0,V.jsx)(b.code,{children:"CUE_URL"}),", ",(0,V.jsx)(b.code,{children:"CUE_ENVIRONMENT_SECRET"}),", ",(0,V.jsx)(b.code,{children:"CUE_ENVIRONMENT_NAME"}),", ",(0,V.jsx)(b.code,{children:"WORKER_NAME"}),", ",(0,V.jsx)(b.code,{children:"SUPERVISOR_CERT_DIR=/var/lib/ultimate-scraper/supervisor"}),", and ",(0,V.jsx)(b.code,{children:"ORCH_REVISION_CACHE=/var/lib/cue-supervisor/revisions"}),". No ",(0,V.jsx)(b.code,{children:"package.json"})," is placed in ",(0,V.jsx)(b.code,{children:"/var/lib/cue-supervisor"}),". The supervisor enrolls as ",(0,V.jsx)(b.code,{children:"organization/environment/host"}),", using ",(0,V.jsx)(b.code,{children:"WORKER_ORGANIZATION"})," because that directory has no checkout. After enrollment, ",(0,V.jsx)(b.code,{children:"fetchWorkerEnvironment"})," still checks that the secret matches that organization and environment. The pinned revision is downloaded into the revision cache. Process mode does not treat the install directory as source. Container mode starts the images of that revision. Process mode starts ",(0,V.jsx)(b.code,{children:"worker"})," from that revision. A ",(0,V.jsx)(b.code,{children:"cue dev"})," inside a checkout still uses that checkout."]}),"\n",(0,V.jsxs)(b.p,{children:["The firewall step runs before the service starts. The script installs ",(0,V.jsx)(b.code,{children:"ufw"})," when it is missing, allows the server port from ",(0,V.jsx)(b.code,{children:"SSH_CONNECTION"}),", and denies other incoming traffic. It does not open the facade ports. The supervisor is a client. If that port cannot be read, the script does not enable the firewall, and it exits, so the SSH session is not cut off. The unit is ",(0,V.jsx)(b.code,{children:"cue-supervisor.service"}),", with ",(0,V.jsx)(b.code,{children:"Restart=always"})," and ",(0,V.jsx)(b.code,{children:"WantedBy=multi-user.target"}),". A second run rewrites the unit and restarts the service."]}),"\n",(0,V.jsxs)(b.p,{children:["After the service starts, the command follows ",(0,V.jsx)(b.code,{children:"journalctl -u cue-supervisor -o cat"})," from that start. It prints the enrollment code, the waiting line when the orchestrator is unreachable, approval, denial, expiry, and a certificate that is already valid. It exits when the certificate is in place, approved, denied, or expired. Ctrl-C stops that relay and leaves the service running."]}),"\n",(0,V.jsx)(b.h2,{id:"backup",children:"Backup"}),"\n",(0,V.jsxs)(b.p,{children:["A backup container on the platform network waits until 03:00 UTC, runs the backup, and repeats that wait. The first backup and every later backup run at 03:00 UTC. It has no published port. It uses ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-backup:<version>"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:["The container dumps Postgres with ",(0,V.jsx)(b.code,{children:"pg_dump -Fc"})," to ",(0,V.jsx)(b.code,{children:"db:5432"}),", with the database password, not through host port 54322. It writes the ClickHouse metrics to a file and copies the certificate directory. It encrypts those files with ",(0,V.jsx)(b.code,{children:"age"}),", using the operator's public key, and stores them in the S3 bucket under the prefix ",(0,V.jsx)(b.code,{children:"cue-backups"}),". Retention is 30 days. The S3 credentials on the server can only write to that prefix."]}),"\n",(0,V.jsxs)(b.p,{children:["The age private key stays on the operator machine, at ",(0,V.jsx)(b.code,{children:"~/.config/cue/age.key"}),", mode ",(0,V.jsx)(b.code,{children:"0600"}),". It is not on the server."]}),"\n",(0,V.jsx)(b.p,{children:"Redis is not backed up."}),"\n",(0,V.jsx)(b.h2,{id:"restore",children:"Restore"}),"\n",(0,V.jsxs)(b.p,{children:["Decrypt a backup on the operator machine with the age private key at ",(0,V.jsx)(b.code,{children:"~/.config/cue/age.key"}),". Restore Postgres from the dump, restore the ClickHouse metrics, and restore the certificate directory."]}),"\n",(0,V.jsx)(b.p,{children:"Redis is not in the backup. After a Postgres restore, flush Redis. Jobs left in Redis would run again after Postgres already applied them."})]})}function dK(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(dJ,{...a})}):dJ(a)}let dL={title:"Install"},dM=[{href:"./server.mdx"},{href:"http://127.0.0.1:54321"},{href:"http://127.0.0.1:3001"}],dN={contents:[{heading:"install",content:"This installs the orchestrator and the supervisor on a machine from local archives. The console is a separate archive. Nothing is published to a registry. To install the published images on a Linux server, follow Server."},{heading:"machine",content:"Install Node.js 22 and pnpm. The repository pins pnpm 9.15.9. Docker runs the services below."},{heading:"machine",content:"Run the commands from the repository root."},{heading:"services",content:"Start Supabase, Redis, ClickHouse, MinIO, zot, and Verdaccio. Local development starts that same Supabase stack with docker compose up -d, together with Redis and ClickHouse."},{heading:"services",content:"The Supabase API listens on host port 54321. Postgres listens on host port 54322. The user, password, and database name are postgres. Supavisor, the transaction pooler, listens on host port 54329."},{heading:"services",content:"Supabase Studio is that same API listener: http://127.0.0.1:54321. The gateway asks for HTTP basic authentication before the page opens. The user is supabase and the password is DASHBOARD_PASSWORD, which defaults to this_password_is_insecure_and_should_be_updated. Both are set on the API gateway in deploy/supabase/docker-compose.yml."},{heading:"services",content:"The SQL files in deploy/supabase/migrations are plain Postgres SQL. A one-shot migrate service applies each file in filename order, then deploy/supabase/seed.sql once, after Postgres is ready. MIGRATE_SEED=0 skips that seed. Any other value applies it. The service records the versions in supabase_migrations.schema_migrations. deploy/supabase/config.toml remains the migration and seed source for supabase --workdir deploy db push, on these same ports. That seed inserts the person pierre@ascent-studio.fr. The password is the same string, and the person is a member of the fixture organization."},{heading:"services",content:"Redis listens on port 6379, with a 512mb limit and the noeviction policy. ClickHouse listens on port 8123 with no password, and loads deploy/clickhouse/metrics.sql on first start. MinIO listens on port 9000, and its console listens on port 9001. The root user is transient, the root password is MINIO_ROOT_PASSWORD, which defaults to transient-secret, and the bucket name is transient. These ports match docker-compose.yml and .env."},{heading:"services",content:"Zot listens on host port 5001 inside the platform network. The container listens on port 5000. Host port 5000 is often taken by AirPlay on macOS. Verdaccio listens on port 4873. Clients use the facade: https://127.0.0.1:7443 for zot and https://127.0.0.1:4873 for Verdaccio. The user is orchestrator and the password is orchestrator-secret, in deploy/registries/htpasswd. A person uses that password for docker login and npm login. The machine client presents its certificate, and Caddy injects the password. Verdaccio proxies npmjs. Packages under cue-org-* have no uplink. @ascentstudio/* is read from npmjs. Registration is closed. Verdaccio stores its packages in a volume because the process runs as uid 10001."},{heading:"environment",content:"Put these variables in the environment of both processes. The names are the same in development and on a deployed machine. The host and ports match the compose file."},{heading:"environment",content:"ORCH_DATABASE_URL is the direct Postgres URL. The orchestrator connects as owner and presents a client certificate that Supavisor does not relay. The supervisor, the worker, and slot processes do not use ORCH_DATABASE_URL. The password in that URL is POSTGRES_PASSWORD."},{heading:"environment",content:"POSTGRES_PASSWORD, SUPABASE_JWT_SECRET, NEXT_PUBLIC_SUPABASE_ANON_KEY, and SUPABASE_SERVICE_ROLE_KEY are the same names as in .env.example. That file holds the public Supabase local demo defaults. A deployed machine replaces those values."},{heading:"environment",content:"ORCH_URL is optional. It is the console address of the machine API. When it is unset, the console uses https://127.0.0.1:3443. A set value must be https. The console presents its client certificate. The orchestrator process itself listens on port 3001, behind the facade."},{heading:"environment",content:"CUE_URL is required for the supervisor. It must be https. There is no http://127.0.0.1:3001 default. The supervisor derives Redis (rediss://<host>:6380), ClickHouse (https://<host>:8443), transient files (https://<host>:9443, region us-east-1, bucket transient), enrollment (https://<host>:4443), zot (https://<host>:7443), and Verdaccio (https://<host>:4873) from that host. CUE_REDIS_URL, CUE_CLICKHOUSE_URL, and CUE_TRANSIENT_S3_ENDPOINT are optional. An override is used only when its port is not the facade port. The MinIO root password is MINIO_ROOT_PASSWORD in docker-compose, for the console on the internal network."},{heading:"environment",content:"pnpm --filter @ascentstudio/cue-orchestrator dev sets CUE_ENROLLMENT=dev on the orchestrator only. The orchestrator then approves an enrollment when the supervisor creates it. The supervisor still prints the code and polls. It never approves itself. serve does not set the variable: a person approves the code on the Supervisors page."},{heading:"environment",content:"ORCH_REVISION_CACHE is a local cache, empty at first. Import publishes each revision to Verdaccio as cue-org-<organization>-revision at version 0.0.0-<revision>. The orchestrator and each supervisor download that archive into <cache>/<organization>/<revision>/ and check dist.integrity. The cache is not a list of revisions. An environment pin and any revision still held by an open run choose what is downloaded. Images stay on zot, the local registry, or Scaleway."},{heading:"environment",content:"The supervisor and the worker read CUE_ENVIRONMENT_SECRET and CUE_ENVIRONMENT_NAME. The secret is the bearer token on every orchestrator call. The name is the environment in the organization checkout. --environment overrides that name for one launch. The fixture seed secret for fixture/local is fixture-local. WORKER_NAME is the host name: lowercase letters, digits, and hyphens."},{heading:"archives",content:"Install the platform tarballs in dist/packages/ with pnpm, in this order. Each file is on disk. Later packages depend on earlier ones. @ascentstudio/cue-sdk is the package an organization imports. Its command is cue. The console and the docs are separate archives and are installed on their own. pnpm build also writes @ascentstudio/cue-org-fixture when FIXTURE is set. That archive installs the same way and is not inside the platform archives. Another organization is packed from its own checkout, not by this build. pnpm publish-packages builds this series and publishes it to npm with public access, in the same order, then the console, the docs, and the fixture. It does not publish an organization revision, and it does not build or push images. pnpm publish-images runs after that npm publish. It refuses to start until every package in that series is on npm at the root package.json version, then it builds and pushes ascentstudio/cue-orchestrator:<version>, ascentstudio/cue-caddy:<version>, ascentstudio/cue-zot:<version>, and ascentstudio/cue-backup:<version>. It does not push latest."},{heading:"archives",content:"One pnpm install -g of the supervisor tarball installs both the supervisor and worker commands."},{heading:"archives",content:"FIXTURE in .env is the fixture checkout. When it is set, pnpm build writes @ascentstudio/cue-org-fixture into dist/packages/. An organization uses cue build, cue pack, and cue test in its own directory."},{heading:"run",content:"Start the orchestrator:"},{heading:"run",content:"To run one organization from its sources, pass that directory. --source overrides ORCH_SOURCE. The directory must contain src/index.ts and src/steps.ts. The orchestrator watches it and uses those sources for an environment of that organization when unpublished sources are allowed. Other environments keep the imported revision. FIXTURE is not read for this."},{heading:"run",content:"In another terminal, start the supervisor. --mode process starts each slot as a process on this machine. --environment names the environment and overrides CUE_ENVIRONMENT_NAME for that launch. CUE_ENVIRONMENT_SECRET is the bearer token. --env-file is the organization environment file. The organization id is the one exported by src/index.ts. In process mode, --source starts the installed worker through the @ascentstudio/cue-sdk loader on that directory. Container mode refuses --source and starts the published revision."},{heading:"console",content:"Install the console archive on its own. Do this before or after the platform archives above."},{heading:"console",content:"The install also fetches Next, React, and the console server dependencies. console runs next start."},{heading:"console",content:"Start it with:"},{heading:"console",content:"console listens on PORT. The default is 3000."},{heading:"console",content:"The orchestrator does not start console or docs. Start console in another terminal. A checkout starts the console app with pnpm --filter @ascentstudio/cue-console dev. Caddy still reaches it on port 3000. On a server, the published image entrypoint starts the console and the docs."},{heading:"console",content:"The console calls the orchestrator at ORCH_URL. When ORCH_URL is unset, that address is https://127.0.0.1:3443. A set value must be https. The console presents its client certificate. Bull Board reads ORCH_REDIS_URL. The session reads NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY, and SUPABASE_SERVER_URL. SUPABASE_SERVER_URL is the Supabase URL on the server. When it is unset, the console uses NEXT_PUBLIC_SUPABASE_URL. Without the Supabase URL and anon key, the pages still open, with no session."},{heading:"console",content:"The preview server on http://127.0.0.1:3001 accepts Authorization: Bearer person-1. The console does not call that server. It calls the https facade."},{heading:"docs",content:"Install the docs archive on its own."},{heading:"docs",content:"The install also fetches Next and React. docs runs next start."},{heading:"docs",content:"Start it with:"},{heading:"docs",content:"docs listens on PORT. The default is 3002. The orchestrator does not start docs. A checkout starts the same app with pnpm --filter @ascentstudio/cue-docs dev."},{heading:"edge-with-caddy",content:"The orchestrator always prepares the certificate facade. Caddy is the only remote entry. ORCH_CADDY_PLACEMENT chooses how Caddy reaches this machine. Unset, or host, is the production placement: Caddy runs on the Linux host network, sees the real client address, and reaches the orchestrator on 127.0.0.1. desktop is the development placement. It runs on Linux, Mac, and Docker Desktop. Any other value stops the orchestrator at startup."},{heading:"environment-1",content:"Add these variables to the orchestrator environment, and change the service addresses to go through Caddy:"},{heading:"environment-1",content:"ORCH_EDGE_NAMES lists the names in the server certificate, separated by commas. network.ini EDGE_NAME supplies a name on that certificate, and 127.0.0.1 is added with it. Keep 127.0.0.1: the orchestrator and the console reach Caddy and Postgres on that address and check it against the certificate."},{heading:"environment-1",content:"network.ini at the repository root is the relay behind that certificate check. An installed command with no checkout reads /var/lib/ultimate-scraper/network.ini. When the file is absent, Caddy keeps the Docker addresses in edgeUpstreams. EDGE_NAME is added to the server certificate, and 127.0.0.1 is added with it. UPSTREAM_REDIS, UPSTREAM_CLICKHOUSE, UPSTREAM_MINIO, UPSTREAM_ZOT, and UPSTREAM_NPM are the host:port values Caddy dials after the client certificate is accepted. UPSTREAM_CONSOLE and UPSTREAM_API are optional: without them the desktop placement uses host.docker.internal, and the host placement uses 127.0.0.1. A bad line stops the orchestrator at startup. The client URLs above stay on the facade ports. They do not move when an upstream moves."},{heading:"environment-1",content:"Pointing an upstream at another machine is the choice to open that service port for Caddy. The hop after Caddy is plaintext, as it is on the Docker bridge. Publishing Redis, ClickHouse, MinIO, zot, or Verdaccio on the host, or letting another party dial those ports directly, is a separate choice in Compose or the firewall. The orchestrator does not open that path."},{heading:"environment-1",content:"ORCH_CERT_DIR is the directory of the chain. In a checkout the default is dist/certs at the repository root. Run Compose from that root, so the containers mount the same path. An installed command has no checkout: when ORCH_CERT_DIR is unset it uses /var/lib/ultimate-scraper/certs. The user that runs the orchestrator must be able to write the directory."},{heading:"environment-1",content:"Ports 7443 and 4873 are always in the Caddyfile, with the private server certificate. Those two ports do not use Let's Encrypt. The orchestrator, on this machine, calls https://127.0.0.1:7443 and https://127.0.0.1:4873. A supervisor calls the host of CUE_URL on those same ports."},{heading:"environment-1",content:"ORCH_REGISTRY_PASSWORD is the password of the human user orchestrator for docker login and npm login. The orchestrator writes it, with two machine accounts, into ORCH_CERT_DIR/registry.htpasswd."},{heading:"environment-1",content:"ORCH_CONSOLE_HOST is the optional DNS name of the console. Set a hostname only: no scheme, no port, and no path. A bad value stops the orchestrator at startup. An omitted console host does not add a Let's Encrypt site. Ports 443, 7443, and 4873 distinguish the console, zot, and Verdaccio. The registry listeners stay on the private certificate."},{heading:"environment-1",content:"When a console name is published, port 443 has the catch-all and two named sites. https://:443 keeps the private server certificate, for clients that dial an address and send no name. https://<name>:443 uses Let's Encrypt and does not ask for a client certificate. That site forwards only /auth/v1 to 127.0.0.1:54321. The rest goes to the console. Studio stays on the gateway. https://doc.<name>:443 uses the same Let's Encrypt issuer and the same address list, does not ask for a client certificate, and forwards to the docs. The docs name is doc.<ORCH_CONSOLE_HOST>. There is no separate variable for it. In the host placement the docs upstream is 127.0.0.1:3002. In the desktop placement it is host.docker.internal:3002. UPSTREAM_DOCS replaces that upstream. An empty list leaves the named sites open. A non-empty list restricts them."},{heading:"environment-1",content:"ORCH_ACME_EMAIL is optional. When it is set, it is passed to the ACME issuer. The DNS names, including the console name and doc.<console name>, must point at this machine, and port 80 must be reachable from the internet. Let's Encrypt completes the HTTP-01 challenge on that port for both names. Port 80 is not a site in the Caddyfile. The certificates and the Let's Encrypt account stay in the caddy-data volume, mounted on /data. If a certificate fails, the listeners of the private authority stay in place."},{heading:"environment-1",content:"The orchestrator checks the Supabase token of each person with SUPABASE_JWT_SECRET or SUPABASE_JWKS_URL. Set one of them."},{heading:"services-1",content:"Stop the plaintext services first if they run. The data volumes are kept."},{heading:"services-1",content:"docker-compose.caddy.yml builds Caddy from deploy/caddy/Dockerfile, with the caddy-l4 module for Redis. It removes the host ports of Redis, ClickHouse, MinIO, zot, Verdaccio, and Supavisor. The platform file publishes Supavisor on host port 54329. The Caddy overlay still terminates Postgres TLS on the published database port, 54322. Postgres negotiates TLS in its own protocol, uses the server certificate of the chain, and asks for a client certificate. Verdaccio receives VERDACCIO_PUBLIC_URL=https://127.0.0.1:4873. A non-local CUE_URL host should advertise https://<that host>:4873. zot and Verdaccio leave the platform network and listen on 172.30.1.13 and 172.30.1.14."},{heading:"services-1",content:"Caddy, Postgres, zot, and Verdaccio wait until the orchestrator has written their files. On the very first start, Postgres initializes after that. If the orchestrator stops because Postgres is not ready yet, start it again."},{heading:"desktop",content:"Development on Linux, Mac, or Docker Desktop uses the desktop placement instead of the overlay above. Do not combine the two files. Stop the plaintext services first if they run. Start this stack before the orchestrator."},{heading:"desktop",content:"The certificate check is the same as on the host placement. network.ini still names the relay. EDGE_NAME=127.0.0.1 matches this machine."},{heading:"desktop",content:"Caddy joins the platform network and the registry network, and publishes ports 443, 3443, 4443, 6380, 8443, 9443, 7443, and 4873. It reaches the console and the orchestrator at host.docker.internal. Redis, ClickHouse, and MinIO stay on 172.30.0.10 through 172.30.0.12. zot is 172.30.1.13 and Verdaccio is 172.30.1.14. Port 80 is not published, so Let's Encrypt stays on the host placement. The registry ports do not use it."},{heading:"desktop",content:"ORCH_CERT_DIR must be the same path on the machine and in the containers. The checkout default, dist/certs, is that path. On Mac it sits under /Users, which Docker Desktop shares. The orchestrator and the console listen on 0.0.0.0, so ports 3000 and 3001 are reachable on the local network. Compose does not publish them."},{heading:"desktop",content:"A connection from this machine arrives at Caddy as 172.30.0.1 on Linux. On Docker Desktop, set ORCH_CADDY_LOCAL_CIDR to the address that reaches the published ports, 192.168.65.1/32 on Docker Desktop for Mac. The desktop Caddyfile and pg_hba.conf treat that value and the gateway as the host, together with 127.0.0.1 and ::1. Leave the variable unset and only the gateway is added. The host placement ignores the variable. The address list does not distinguish clients. Checking that list still requires the host placement on Linux."},{heading:"start",content:"Start the orchestrator as before. On each start it:"},{heading:"start",content:"creates or reloads the chain in ORCH_CERT_DIR, and renews the service certificates that expire within 30 days;"},{heading:"start",content:"writes Caddyfile, pg_hba.conf, pg_reload.sql, and registry.htpasswd into ORCH_CERT_DIR, from the last applied list in edge-allow.json. The Caddyfile is readable by its owner only, because it contains the machine registry passwords;"},{heading:"start",content:"listens on 127.0.0.1:3001 in the host placement, and on 0.0.0.0:3001 in the desktop placement;"},{heading:"start",content:"does not start the console or the docs. An archive install starts console and docs as their own processes. The published image entrypoint starts them after the orchestrator has written console-client.crt and the Caddyfile, the console on port 3000 and the docs on port 3002. The console calls the orchestrator at ORCH_URL. When ORCH_URL is unset, that address is https://127.0.0.1:3443. The console presents its client certificate on every call."},{heading:"start",content:"From a checkout, run pnpm --filter @ascentstudio/cue-console dev and pnpm --filter @ascentstudio/cue-docs dev in other terminals. They read the same .env. The console listens on port 3000 and the docs listen on port 3002. Stopping the orchestrator does not stop those processes. MinIO on port 9443 requires the client certificate and accepts the request without a signature. The root password in docker-compose is for the console on the internal network. Enrollment on port 4443 uses server TLS only, because the supervisor does not have a client certificate yet."},{heading:"start",content:"Caddy runs with --watch and reloads when the Caddyfile changes. A renewed server certificate changes the Caddyfile, so Caddy reloads it. Postgres reads a renewed server certificate on its next restart."},{heading:"ports",content:"Port"},{heading:"ports",content:"Listener"},{heading:"ports",content:"TLS"},{heading:"ports",content:"443"},{heading:"ports",content:"Console and docs"},{heading:"ports",content:"Private certificate on the catch-all. Let's Encrypt on the console name and on doc.<console name>"},{heading:"ports",content:"4443"},{heading:"ports",content:"Enrollment: POST /enrollments and POST /enrollments/poll"},{heading:"ports",content:"Server certificate"},{heading:"ports",content:"3443"},{heading:"ports",content:"Machine API"},{heading:"ports",content:"Client certificate"},{heading:"ports",content:"6380"},{heading:"ports",content:"Redis"},{heading:"ports",content:"Client certificate"},{heading:"ports",content:"8443"},{heading:"ports",content:"ClickHouse HTTP"},{heading:"ports",content:"Client certificate"},{heading:"ports",content:"9443"},{heading:"ports",content:"MinIO S3 API"},{heading:"ports",content:"Client certificate"},{heading:"ports",content:"7443"},{heading:"ports",content:"zot"},{heading:"ports",content:"Private certificate. A client certificate is checked when one is offered"},{heading:"ports",content:"4873"},{heading:"ports",content:"Verdaccio"},{heading:"ports",content:"Private certificate. A client certificate is checked when one is offered"},{heading:"ports",content:"80"},{heading:"ports",content:"HTTP-01 challenge"},{heading:"ports",content:"ACME response, not a Caddyfile site"},{heading:"ports",content:"54322"},{heading:"ports",content:"Postgres"},{heading:"ports",content:"Postgres TLS, client certificate"},{heading:"ports",content:"A client certificate must be signed by the intermediate authority of the chain. On the machine API, Caddy passes the verified certificate to the orchestrator in the Client-Cert header, as RFC 9440 DER in base64 between colons. Caddy removes that header on every other listener. On the ClickHouse listener, Caddy also removes X-ClickHouse-SSL-Certificate-Auth. The official client sets that header when it presents a certificate, and ClickHouse would then try to authenticate a certificate that Caddy already consumed. The ClickHouse native port and the MinIO console stay on the platform network."},{heading:"ports",content:"zot and Verdaccio use the private server certificate. An invalid client certificate fails the handshake. No client certificate leaves the request through, and the caller sends a login. The orchestrator client certificate is the write account. Every other valid certificate is the read account. An empty address list allows only 127.0.0.1 and ::1 on those sites, the same filter as MinIO. The console name, when published, uses Let's Encrypt on port 443 and does not ask for a client certificate. doc.<console name> is a second Let's Encrypt site on that port, with the same address list and no client certificate. The console name forwards /auth/v1 to 127.0.0.1:54321 and the rest to the console. The docs site forwards to port 3002. An empty list leaves both named sites open, and a non-empty list restricts them. Port 443 still has the catch-all with the private certificate. Port 80 answers the HTTP-01 challenge for the console name and for doc.<console name>. It is not a site in the Caddyfile, and the registry listeners do not depend on that challenge."},{heading:"registries",content:"A person logs in as orchestrator with ORCH_REGISTRY_PASSWORD. With the names unset, the addresses are 127.0.0.1:7443 and https://127.0.0.1:4873. With the names set, use those names on the same ports. There is no Let's Encrypt certificate on either port. Trust the private authority, or dial the address from a machine that already has it."},{heading:"registries",content:"A machine does not log in. After enrollment it presents the client certificate signed by the intermediate. Caddy accepts that certificate as the read account. The orchestrator presents its own client certificate, and Caddy accepts that one as the write account. The supervisor does not change the npm registry URL of this project."},{heading:"registries",content:"The console does not call zot or Verdaccio. It keeps calling the orchestrator, which relays /runtimes/packages and /runtimes/images."},{heading:"registries",content:"cue-org-* is published here. Other package names, including @ascentstudio/*, are fetched from npmjs through Verdaccio. An environment still resolves images as local or scaleway. Plaintext compose still mounts deploy/registries/htpasswd, which contains only the orchestrator user."},{heading:"address-list",content:"The console page /account/edge edits the edge_allow table. Each change rewrites the Caddyfile and pg_hba.conf, then the orchestrator runs select pg_reload_conf(). If that reload fails, run pg_reload.sql as the database owner."},{heading:"address-list",content:"With an empty list, every machine listener refuses remote addresses: enrollment, machine API, Redis, ClickHouse, MinIO, Postgres, zot, and Verdaccio. The console is open to everyone, so the first person can sign in."},{heading:"address-list",content:"A change is refused if the list that results does not contain the address of the person making it. After the first address, both port 443 sites use the same list. The Let's Encrypt name still does not ask for a client certificate."},{heading:"address-list",content:"The host itself, 127.0.0.1 and ::1, is always allowed. Postgres also allows the gateway of the platform network, 172.30.0.1, which is how a Linux host reaches its published port. In the desktop placement, Caddy and Postgres also allow ORCH_CADDY_LOCAL_CIDR when it is set. The host placement never writes that address."},{heading:"address-list",content:"Postgres allows the platform network, 172.30.0.0/24, with a password and without a client certificate, over TLS and without TLS. Auth, REST, and Storage connect from that network. The gateway rule is more specific, so the published port still requires a client certificate."},{heading:"address-list",content:"Add the address of a supervisor before you start it. Otherwise its enrollment request does not reach the orchestrator."},{heading:"images",content:"From the repository root, this prints the image build and does not build:"},{heading:"images",content:"The images are linux/amd64 and linux/arm64. Each image has its own repository, tagged with the root package.json version: ascentstudio/cue-orchestrator:<version>, ascentstudio/cue-caddy:<version>, ascentstudio/cue-zot:<version>, and ascentstudio/cue-backup:<version>. There is no latest tag. This script does not push. pnpm build-images runs the same build. pnpm publish-images runs after pnpm publish-packages. It checks that each package of that version is on npm, then builds the four repositories with --push. A separate docker push cannot send the two-platform manifest, because the local engine does not store it."}],headings:[{id:"install",content:"Install"},{id:"machine",content:"Machine"},{id:"services",content:"Services"},{id:"environment",content:"Environment"},{id:"archives",content:"Archives"},{id:"run",content:"Run"},{id:"console",content:"Console"},{id:"docs",content:"Docs"},{id:"edge-with-caddy",content:"Edge with Caddy"},{id:"environment-1",content:"Environment"},{id:"services-1",content:"Services"},{id:"desktop",content:"Desktop"},{id:"start",content:"Start"},{id:"ports",content:"Ports"},{id:"registries",content:"Registries"},{id:"address-list",content:"Address list"},{id:"images",content:"Images"}]},dO=[{depth:1,url:"#install",title:(0,V.jsx)(V.Fragment,{children:"Install"})},{depth:2,url:"#machine",title:(0,V.jsx)(V.Fragment,{children:"Machine"})},{depth:2,url:"#services",title:(0,V.jsx)(V.Fragment,{children:"Services"})},{depth:2,url:"#environment",title:(0,V.jsx)(V.Fragment,{children:"Environment"})},{depth:2,url:"#archives",title:(0,V.jsx)(V.Fragment,{children:"Archives"})},{depth:2,url:"#run",title:(0,V.jsx)(V.Fragment,{children:"Run"})},{depth:2,url:"#console",title:(0,V.jsx)(V.Fragment,{children:"Console"})},{depth:2,url:"#docs",title:(0,V.jsx)(V.Fragment,{children:"Docs"})},{depth:2,url:"#edge-with-caddy",title:(0,V.jsx)(V.Fragment,{children:"Edge with Caddy"})},{depth:3,url:"#environment-1",title:(0,V.jsx)(V.Fragment,{children:"Environment"})},{depth:3,url:"#services-1",title:(0,V.jsx)(V.Fragment,{children:"Services"})},{depth:3,url:"#desktop",title:(0,V.jsx)(V.Fragment,{children:"Desktop"})},{depth:3,url:"#start",title:(0,V.jsx)(V.Fragment,{children:"Start"})},{depth:3,url:"#ports",title:(0,V.jsx)(V.Fragment,{children:"Ports"})},{depth:3,url:"#registries",title:(0,V.jsx)(V.Fragment,{children:"Registries"})},{depth:3,url:"#address-list",title:(0,V.jsx)(V.Fragment,{children:"Address list"})},{depth:2,url:"#images",title:(0,V.jsx)(V.Fragment,{children:"Images"})}];function dP(a){let b={a:"a",code:"code",h1:"h1",h2:"h2",h3:"h3",li:"li",ol:"ol",p:"p",pre:"pre",span:"span",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.h1,{id:"install",children:"Install"}),"\n",(0,V.jsxs)(b.p,{children:["This installs the orchestrator and the supervisor on a machine from local archives. The console is a separate archive. Nothing is published to a registry. To install the published images on a Linux server, follow ",(0,V.jsx)(b.a,{href:"./server.mdx",children:"Server"}),"."]}),"\n",(0,V.jsx)(b.h2,{id:"machine",children:"Machine"}),"\n",(0,V.jsx)(b.p,{children:"Install Node.js 22 and pnpm. The repository pins pnpm 9.15.9. Docker runs the services below."}),"\n",(0,V.jsx)(b.p,{children:"Run the commands from the repository root."}),"\n",(0,V.jsx)(b.h2,{id:"services",children:"Services"}),"\n",(0,V.jsxs)(b.p,{children:["Start Supabase, Redis, ClickHouse, MinIO, zot, and Verdaccio. Local development starts that same Supabase stack with ",(0,V.jsx)(b.code,{children:"docker compose up -d"}),", together with Redis and ClickHouse."]}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"docker"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" compose"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -f"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" docker-compose.platform.yml"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" up"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -d"})]})})})}),"\n",(0,V.jsxs)(b.p,{children:["The Supabase API listens on host port 54321. Postgres listens on host port 54322. The user, password, and database name are ",(0,V.jsx)(b.code,{children:"postgres"}),". Supavisor, the transaction pooler, listens on host port 54329."]}),"\n",(0,V.jsxs)(b.p,{children:["Supabase Studio is that same API listener: ",(0,V.jsx)(b.a,{href:"http://127.0.0.1:54321",children:"http://127.0.0.1:54321"}),". The gateway asks for HTTP basic authentication before the page opens. The user is ",(0,V.jsx)(b.code,{children:"supabase"})," and the password is ",(0,V.jsx)(b.code,{children:"DASHBOARD_PASSWORD"}),", which defaults to ",(0,V.jsx)(b.code,{children:"this_password_is_insecure_and_should_be_updated"}),". Both are set on the API gateway in ",(0,V.jsx)(b.code,{children:"deploy/supabase/docker-compose.yml"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:["The SQL files in ",(0,V.jsx)(b.code,{children:"deploy/supabase/migrations"})," are plain Postgres SQL. A one-shot migrate service applies each file in filename order, then ",(0,V.jsx)(b.code,{children:"deploy/supabase/seed.sql"})," once, after Postgres is ready. ",(0,V.jsx)(b.code,{children:"MIGRATE_SEED=0"})," skips that seed. Any other value applies it. The service records the versions in ",(0,V.jsx)(b.code,{children:"supabase_migrations.schema_migrations"}),". ",(0,V.jsx)(b.code,{children:"deploy/supabase/config.toml"})," remains the migration and seed source for ",(0,V.jsx)(b.code,{children:"supabase --workdir deploy db push"}),", on these same ports. That seed inserts the person ",(0,V.jsx)(b.code,{children:"pierre@ascent-studio.fr"}),". The password is the same string, and the person is a member of the fixture organization."]}),"\n",(0,V.jsxs)(b.p,{children:["Redis listens on port 6379, with a 512mb limit and the ",(0,V.jsx)(b.code,{children:"noeviction"})," policy. ClickHouse listens on port 8123 with no password, and loads ",(0,V.jsx)(b.code,{children:"deploy/clickhouse/metrics.sql"})," on first start. MinIO listens on port 9000, and its console listens on port 9001. The root user is ",(0,V.jsx)(b.code,{children:"transient"}),", the root password is ",(0,V.jsx)(b.code,{children:"MINIO_ROOT_PASSWORD"}),", which defaults to ",(0,V.jsx)(b.code,{children:"transient-secret"}),", and the bucket name is ",(0,V.jsx)(b.code,{children:"transient"}),". These ports match ",(0,V.jsx)(b.code,{children:"docker-compose.yml"})," and ",(0,V.jsx)(b.code,{children:".env"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:["Zot listens on host port 5001 inside the platform network. The container listens on port 5000. Host port 5000 is often taken by AirPlay on macOS. Verdaccio listens on port 4873. Clients use the facade: ",(0,V.jsx)(b.code,{children:"https://127.0.0.1:7443"})," for zot and ",(0,V.jsx)(b.code,{children:"https://127.0.0.1:4873"})," for Verdaccio. The user is ",(0,V.jsx)(b.code,{children:"orchestrator"})," and the password is ",(0,V.jsx)(b.code,{children:"orchestrator-secret"}),", in ",(0,V.jsx)(b.code,{children:"deploy/registries/htpasswd"}),". A person uses that password for ",(0,V.jsx)(b.code,{children:"docker login"})," and ",(0,V.jsx)(b.code,{children:"npm login"}),". The machine client presents its certificate, and Caddy injects the password. Verdaccio proxies npmjs. Packages under ",(0,V.jsx)(b.code,{children:"cue-org-*"})," have no uplink. ",(0,V.jsx)(b.code,{children:"@ascentstudio/*"})," is read from npmjs. Registration is closed. Verdaccio stores its packages in a volume because the process runs as uid 10001."]}),"\n",(0,V.jsx)(b.h2,{id:"environment",children:"Environment"}),"\n",(0,V.jsx)(b.p,{children:"Put these variables in the environment of both processes. The names are the same in development and on a deployed machine. The host and ports match the compose file."}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsxs)(b.code,{children:[(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"POSTGRES_PASSWORD"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"postgres"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"SUPABASE_JWT_SECRET"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"NEXT_PUBLIC_SUPABASE_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"http://127.0.0.1:54321"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"NEXT_PUBLIC_SUPABASE_ANON_KEY"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"SUPABASE_SERVICE_ROLE_KEY"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_DATABASE_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"postgresql://postgres:postgres@127.0.0.1:54322/postgres"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_REDIS_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"rediss://127.0.0.1:6380"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_CLICKHOUSE_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"https://127.0.0.1:8443"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"CUE_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"https://127.0.0.1:3443"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"CUE_ENVIRONMENT_SECRET"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"fixture-local"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"CUE_ENVIRONMENT_NAME"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"local"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_REVISION_CACHE"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"/var/lib/ultimate-scraper/revisions"})]})]})})}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ORCH_DATABASE_URL"})," is the direct Postgres URL. The orchestrator connects as owner and presents a client certificate that Supavisor does not relay. The supervisor, the worker, and slot processes do not use ",(0,V.jsx)(b.code,{children:"ORCH_DATABASE_URL"}),". The password in that URL is ",(0,V.jsx)(b.code,{children:"POSTGRES_PASSWORD"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"POSTGRES_PASSWORD"}),", ",(0,V.jsx)(b.code,{children:"SUPABASE_JWT_SECRET"}),", ",(0,V.jsx)(b.code,{children:"NEXT_PUBLIC_SUPABASE_ANON_KEY"}),", and ",(0,V.jsx)(b.code,{children:"SUPABASE_SERVICE_ROLE_KEY"})," are the same names as in ",(0,V.jsx)(b.code,{children:".env.example"}),". That file holds the public Supabase local demo defaults. A deployed machine replaces those values."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ORCH_URL"})," is optional. It is the console address of the machine API. When it is unset, the console uses ",(0,V.jsx)(b.code,{children:"https://127.0.0.1:3443"}),". A set value must be https. The console presents its client certificate. The orchestrator process itself listens on port 3001, behind the facade."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"CUE_URL"})," is required for the supervisor. It must be https. There is no ",(0,V.jsx)(b.code,{children:"http://127.0.0.1:3001"})," default. The supervisor derives Redis (",(0,V.jsx)(b.code,{children:"rediss://<host>:6380"}),"), ClickHouse (",(0,V.jsx)(b.code,{children:"https://<host>:8443"}),"), transient files (",(0,V.jsx)(b.code,{children:"https://<host>:9443"}),", region ",(0,V.jsx)(b.code,{children:"us-east-1"}),", bucket ",(0,V.jsx)(b.code,{children:"transient"}),"), enrollment (",(0,V.jsx)(b.code,{children:"https://<host>:4443"}),"), zot (",(0,V.jsx)(b.code,{children:"https://<host>:7443"}),"), and Verdaccio (",(0,V.jsx)(b.code,{children:"https://<host>:4873"}),") from that host. ",(0,V.jsx)(b.code,{children:"CUE_REDIS_URL"}),", ",(0,V.jsx)(b.code,{children:"CUE_CLICKHOUSE_URL"}),", and ",(0,V.jsx)(b.code,{children:"CUE_TRANSIENT_S3_ENDPOINT"})," are optional. An override is used only when its port is not the facade port. The MinIO root password is ",(0,V.jsx)(b.code,{children:"MINIO_ROOT_PASSWORD"})," in docker-compose, for the console on the internal network."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"pnpm --filter @ascentstudio/cue-orchestrator dev"})," sets ",(0,V.jsx)(b.code,{children:"CUE_ENROLLMENT=dev"})," on the orchestrator only. The orchestrator then approves an enrollment when the supervisor creates it. The supervisor still prints the code and polls. It never approves itself. ",(0,V.jsx)(b.code,{children:"serve"})," does not set the variable: a person approves the code on the Supervisors page."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ORCH_REVISION_CACHE"})," is a local cache, empty at first. Import publishes each revision to Verdaccio as ",(0,V.jsx)(b.code,{children:"cue-org-<organization>-revision"})," at version ",(0,V.jsx)(b.code,{children:"0.0.0-<revision>"}),". The orchestrator and each supervisor download that archive into ",(0,V.jsx)(b.code,{children:"<cache>/<organization>/<revision>/"})," and check ",(0,V.jsx)(b.code,{children:"dist.integrity"}),". The cache is not a list of revisions. An environment pin and any revision still held by an open run choose what is downloaded. Images stay on zot, the local registry, or Scaleway."]}),"\n",(0,V.jsxs)(b.p,{children:["The supervisor and the worker read ",(0,V.jsx)(b.code,{children:"CUE_ENVIRONMENT_SECRET"})," and ",(0,V.jsx)(b.code,{children:"CUE_ENVIRONMENT_NAME"}),". The secret is the bearer token on every orchestrator call. The name is the environment in the organization checkout. ",(0,V.jsx)(b.code,{children:"--environment"})," overrides that name for one launch. The fixture seed secret for ",(0,V.jsx)(b.code,{children:"fixture/local"})," is ",(0,V.jsx)(b.code,{children:"fixture-local"}),". ",(0,V.jsx)(b.code,{children:"WORKER_NAME"})," is the host name: lowercase letters, digits, and hyphens."]}),"\n",(0,V.jsx)(b.h2,{id:"archives",children:"Archives"}),"\n",(0,V.jsxs)(b.p,{children:["Install the platform tarballs in ",(0,V.jsx)(b.code,{children:"dist/packages/"})," with pnpm, in this order. Each file is on disk. Later packages depend on earlier ones. ",(0,V.jsx)(b.code,{children:"@ascentstudio/cue-sdk"})," is the package an organization imports. Its command is ",(0,V.jsx)(b.code,{children:"cue"}),". The console and the docs are separate archives and are installed on their own. ",(0,V.jsx)(b.code,{children:"pnpm build"})," also writes ",(0,V.jsx)(b.code,{children:"@ascentstudio/cue-org-fixture"})," when ",(0,V.jsx)(b.code,{children:"FIXTURE"})," is set. That archive installs the same way and is not inside the platform archives. Another organization is packed from its own checkout, not by this build. ",(0,V.jsx)(b.code,{children:"pnpm publish-packages"})," builds this series and publishes it to npm with public access, in the same order, then the console, the docs, and the fixture. It does not publish an organization revision, and it does not build or push images. ",(0,V.jsx)(b.code,{children:"pnpm publish-images"})," runs after that npm publish. It refuses to start until every package in that series is on npm at the root package.json version, then it builds and pushes ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-orchestrator:<version>"}),", ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-caddy:<version>"}),", ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-zot:<version>"}),", and ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-backup:<version>"}),". It does not push ",(0,V.jsx)(b.code,{children:"latest"}),"."]}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsxs)(b.code,{children:[(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"pnpm"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" install"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -g"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" dist/packages/ascentstudio-cue-contract-"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"*"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:".tgz"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"pnpm"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" install"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -g"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" dist/packages/ascentstudio-cue-engine-"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"*"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:".tgz"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"pnpm"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" install"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -g"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" dist/packages/ascentstudio-cue-sdk-"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"*"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:".tgz"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"pnpm"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" install"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -g"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" dist/packages/ascentstudio-cue-orchestrator-"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"*"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:".tgz"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"pnpm"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" install"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -g"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" dist/packages/ascentstudio-cue-supervisor-"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"*"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:".tgz"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"pnpm"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" install"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -g"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" dist/packages/ascentstudio-cue-org-fixture-"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"*"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:".tgz"})]})]})})}),"\n",(0,V.jsxs)(b.p,{children:["One ",(0,V.jsx)(b.code,{children:"pnpm install -g"})," of the supervisor tarball installs both the ",(0,V.jsx)(b.code,{children:"supervisor"})," and ",(0,V.jsx)(b.code,{children:"worker"})," commands."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"FIXTURE"})," in ",(0,V.jsx)(b.code,{children:".env"})," is the fixture checkout. When it is set, ",(0,V.jsx)(b.code,{children:"pnpm build"})," writes ",(0,V.jsx)(b.code,{children:"@ascentstudio/cue-org-fixture"})," into ",(0,V.jsx)(b.code,{children:"dist/packages/"}),". An organization uses ",(0,V.jsx)(b.code,{children:"cue build"}),", ",(0,V.jsx)(b.code,{children:"cue pack"}),", and ",(0,V.jsx)(b.code,{children:"cue test"})," in its own directory."]}),"\n",(0,V.jsx)(b.h2,{id:"run",children:"Run"}),"\n",(0,V.jsx)(b.p,{children:"Start the orchestrator:"}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"orchestrator"})})})})}),"\n",(0,V.jsxs)(b.p,{children:["To run one organization from its sources, pass that directory. ",(0,V.jsx)(b.code,{children:"--source"})," overrides ",(0,V.jsx)(b.code,{children:"ORCH_SOURCE"}),". The directory must contain ",(0,V.jsx)(b.code,{children:"src/index.ts"})," and ",(0,V.jsx)(b.code,{children:"src/steps.ts"}),". The orchestrator watches it and uses those sources for an environment of that organization when unpublished sources are allowed. Other environments keep the imported revision. ",(0,V.jsx)(b.code,{children:"FIXTURE"})," is not read for this."]}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"orchestrator"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --source"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" /absolute/path/fixture"})]})})})}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_SOURCE"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"/absolute/path/fixture"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" orchestrator"})]})})})}),"\n",(0,V.jsxs)(b.p,{children:["In another terminal, start the supervisor. ",(0,V.jsx)(b.code,{children:"--mode process"})," starts each slot as a process on this machine. ",(0,V.jsx)(b.code,{children:"--environment"})," names the environment and overrides ",(0,V.jsx)(b.code,{children:"CUE_ENVIRONMENT_NAME"})," for that launch. ",(0,V.jsx)(b.code,{children:"CUE_ENVIRONMENT_SECRET"})," is the bearer token. ",(0,V.jsx)(b.code,{children:"--env-file"})," is the organization environment file. The organization id is the one exported by ",(0,V.jsx)(b.code,{children:"src/index.ts"}),". In process mode, ",(0,V.jsx)(b.code,{children:"--source"})," starts the installed ",(0,V.jsx)(b.code,{children:"worker"})," through the ",(0,V.jsx)(b.code,{children:"@ascentstudio/cue-sdk"})," loader on that directory. Container mode refuses ",(0,V.jsx)(b.code,{children:"--source"})," and starts the published revision."]}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"supervisor"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --mode"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" process"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --environment"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" local"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --env-file"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" /absolute/path/fixture/.env"})]})})})}),"\n",(0,V.jsx)(b.h2,{id:"console",children:"Console"}),"\n",(0,V.jsx)(b.p,{children:"Install the console archive on its own. Do this before or after the platform archives above."}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"pnpm"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" install"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -g"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" dist/packages/ascentstudio-cue-console-"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"*"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:".tgz"})]})})})}),"\n",(0,V.jsxs)(b.p,{children:["The install also fetches Next, React, and the console server dependencies. ",(0,V.jsx)(b.code,{children:"console"})," runs ",(0,V.jsx)(b.code,{children:"next start"}),"."]}),"\n",(0,V.jsx)(b.p,{children:"Start it with:"}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"console"})})})})}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"console"})," listens on ",(0,V.jsx)(b.code,{children:"PORT"}),". The default is 3000."]}),"\n",(0,V.jsxs)(b.p,{children:["The orchestrator does not start ",(0,V.jsx)(b.code,{children:"console"})," or ",(0,V.jsx)(b.code,{children:"docs"}),". Start ",(0,V.jsx)(b.code,{children:"console"})," in another terminal. A checkout starts the console app with ",(0,V.jsx)(b.code,{children:"pnpm --filter @ascentstudio/cue-console dev"}),". Caddy still reaches it on port 3000. On a server, the published image entrypoint starts the console and the docs."]}),"\n",(0,V.jsxs)(b.p,{children:["The console calls the orchestrator at ",(0,V.jsx)(b.code,{children:"ORCH_URL"}),". When ",(0,V.jsx)(b.code,{children:"ORCH_URL"})," is unset, that address is ",(0,V.jsx)(b.code,{children:"https://127.0.0.1:3443"}),". A set value must be https. The console presents its client certificate. Bull Board reads ",(0,V.jsx)(b.code,{children:"ORCH_REDIS_URL"}),". The session reads ",(0,V.jsx)(b.code,{children:"NEXT_PUBLIC_SUPABASE_URL"}),", ",(0,V.jsx)(b.code,{children:"NEXT_PUBLIC_SUPABASE_ANON_KEY"}),", and ",(0,V.jsx)(b.code,{children:"SUPABASE_SERVER_URL"}),". ",(0,V.jsx)(b.code,{children:"SUPABASE_SERVER_URL"})," is the Supabase URL on the server. When it is unset, the console uses ",(0,V.jsx)(b.code,{children:"NEXT_PUBLIC_SUPABASE_URL"}),". Without the Supabase URL and anon key, the pages still open, with no session."]}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsxs)(b.code,{children:[(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_REDIS_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"rediss://127.0.0.1:6380"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"NEXT_PUBLIC_SUPABASE_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"http://127.0.0.1:54321"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"NEXT_PUBLIC_SUPABASE_ANON_KEY"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"SUPABASE_SERVER_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"http://127.0.0.1:54321"})]})]})})}),"\n",(0,V.jsxs)(b.p,{children:["The preview server on ",(0,V.jsx)(b.a,{href:"http://127.0.0.1:3001",children:"http://127.0.0.1:3001"})," accepts ",(0,V.jsx)(b.code,{children:"Authorization: Bearer person-1"}),". The console does not call that server. It calls the https facade."]}),"\n",(0,V.jsx)(b.h2,{id:"docs",children:"Docs"}),"\n",(0,V.jsx)(b.p,{children:"Install the docs archive on its own."}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"pnpm"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" install"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -g"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" dist/packages/ascentstudio-cue-docs-"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:"*"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:".tgz"})]})})})}),"\n",(0,V.jsxs)(b.p,{children:["The install also fetches Next and React. ",(0,V.jsx)(b.code,{children:"docs"})," runs ",(0,V.jsx)(b.code,{children:"next start"}),"."]}),"\n",(0,V.jsx)(b.p,{children:"Start it with:"}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsx)(b.span,{className:"line",children:(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"docs"})})})})}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"docs"})," listens on ",(0,V.jsx)(b.code,{children:"PORT"}),". The default is 3002. The orchestrator does not start ",(0,V.jsx)(b.code,{children:"docs"}),". A checkout starts the same app with ",(0,V.jsx)(b.code,{children:"pnpm --filter @ascentstudio/cue-docs dev"}),"."]}),"\n",(0,V.jsx)(b.h2,{id:"edge-with-caddy",children:"Edge with Caddy"}),"\n",(0,V.jsxs)(b.p,{children:["The orchestrator always prepares the certificate facade. Caddy is the only remote entry. ",(0,V.jsx)(b.code,{children:"ORCH_CADDY_PLACEMENT"})," chooses how Caddy reaches this machine. Unset, or ",(0,V.jsx)(b.code,{children:"host"}),", is the production placement: Caddy runs on the Linux host network, sees the real client address, and reaches the orchestrator on ",(0,V.jsx)(b.code,{children:"127.0.0.1"}),". ",(0,V.jsx)(b.code,{children:"desktop"})," is the development placement. It runs on Linux, Mac, and Docker Desktop. Any other value stops the orchestrator at startup."]}),"\n",(0,V.jsx)(b.h3,{id:"environment-1",children:"Environment"}),"\n",(0,V.jsx)(b.p,{children:"Add these variables to the orchestrator environment, and change the service addresses to go through Caddy:"}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsxs)(b.code,{children:[(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_CADDY_PLACEMENT"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"host"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_EDGE_NAMES"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"edge.example.com,127.0.0.1"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_CERT_DIR"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"/var/lib/ultimate-scraper/certs"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_CONSOLE_HOST"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"console.example.com"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_REGISTRY_PASSWORD"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_ACME_EMAIL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"admin@example.com"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"SUPABASE_JWT_SECRET"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_DATABASE_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"postgresql://postgres:postgres@127.0.0.1:54322/postgres"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_REDIS_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"rediss://127.0.0.1:6380"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_CLICKHOUSE_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"https://127.0.0.1:8443"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"CUE_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"https://edge.example.com:3443"})]})]})})}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ORCH_EDGE_NAMES"})," lists the names in the server certificate, separated by commas. ",(0,V.jsx)(b.code,{children:"network.ini"})," ",(0,V.jsx)(b.code,{children:"EDGE_NAME"})," supplies a name on that certificate, and ",(0,V.jsx)(b.code,{children:"127.0.0.1"})," is added with it. Keep ",(0,V.jsx)(b.code,{children:"127.0.0.1"}),": the orchestrator and the console reach Caddy and Postgres on that address and check it against the certificate."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"network.ini"})," at the repository root is the relay behind that certificate check. An installed command with no checkout reads ",(0,V.jsx)(b.code,{children:"/var/lib/ultimate-scraper/network.ini"}),". When the file is absent, Caddy keeps the Docker addresses in ",(0,V.jsx)(b.code,{children:"edgeUpstreams"}),". ",(0,V.jsx)(b.code,{children:"EDGE_NAME"})," is added to the server certificate, and ",(0,V.jsx)(b.code,{children:"127.0.0.1"})," is added with it. ",(0,V.jsx)(b.code,{children:"UPSTREAM_REDIS"}),", ",(0,V.jsx)(b.code,{children:"UPSTREAM_CLICKHOUSE"}),", ",(0,V.jsx)(b.code,{children:"UPSTREAM_MINIO"}),", ",(0,V.jsx)(b.code,{children:"UPSTREAM_ZOT"}),", and ",(0,V.jsx)(b.code,{children:"UPSTREAM_NPM"})," are the ",(0,V.jsx)(b.code,{children:"host:port"})," values Caddy dials after the client certificate is accepted. ",(0,V.jsx)(b.code,{children:"UPSTREAM_CONSOLE"})," and ",(0,V.jsx)(b.code,{children:"UPSTREAM_API"})," are optional: without them the desktop placement uses ",(0,V.jsx)(b.code,{children:"host.docker.internal"}),", and the host placement uses ",(0,V.jsx)(b.code,{children:"127.0.0.1"}),". A bad line stops the orchestrator at startup. The client URLs above stay on the facade ports. They do not move when an upstream moves."]}),"\n",(0,V.jsx)(b.p,{children:"Pointing an upstream at another machine is the choice to open that service port for Caddy. The hop after Caddy is plaintext, as it is on the Docker bridge. Publishing Redis, ClickHouse, MinIO, zot, or Verdaccio on the host, or letting another party dial those ports directly, is a separate choice in Compose or the firewall. The orchestrator does not open that path."}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ORCH_CERT_DIR"})," is the directory of the chain. In a checkout the default is ",(0,V.jsx)(b.code,{children:"dist/certs"})," at the repository root. Run Compose from that root, so the containers mount the same path. An installed command has no checkout: when ",(0,V.jsx)(b.code,{children:"ORCH_CERT_DIR"})," is unset it uses ",(0,V.jsx)(b.code,{children:"/var/lib/ultimate-scraper/certs"}),". The user that runs the orchestrator must be able to write the directory."]}),"\n",(0,V.jsxs)(b.p,{children:["Ports 7443 and 4873 are always in the Caddyfile, with the private server certificate. Those two ports do not use Let's Encrypt. The orchestrator, on this machine, calls ",(0,V.jsx)(b.code,{children:"https://127.0.0.1:7443"})," and ",(0,V.jsx)(b.code,{children:"https://127.0.0.1:4873"}),". A supervisor calls the host of ",(0,V.jsx)(b.code,{children:"CUE_URL"})," on those same ports."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ORCH_REGISTRY_PASSWORD"})," is the password of the human user ",(0,V.jsx)(b.code,{children:"orchestrator"})," for ",(0,V.jsx)(b.code,{children:"docker login"})," and ",(0,V.jsx)(b.code,{children:"npm login"}),". The orchestrator writes it, with two machine accounts, into ",(0,V.jsx)(b.code,{children:"ORCH_CERT_DIR/registry.htpasswd"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ORCH_CONSOLE_HOST"})," is the optional DNS name of the console. Set a hostname only: no scheme, no port, and no path. A bad value stops the orchestrator at startup. An omitted console host does not add a Let's Encrypt site. Ports 443, 7443, and 4873 distinguish the console, zot, and Verdaccio. The registry listeners stay on the private certificate."]}),"\n",(0,V.jsxs)(b.p,{children:["When a console name is published, port 443 has the catch-all and two named sites. ",(0,V.jsx)(b.code,{children:"https://:443"})," keeps the private server certificate, for clients that dial an address and send no name. ",(0,V.jsx)(b.code,{children:"https://<name>:443"})," uses Let's Encrypt and does not ask for a client certificate. That site forwards only ",(0,V.jsx)(b.code,{children:"/auth/v1"})," to ",(0,V.jsx)(b.code,{children:"127.0.0.1:54321"}),". The rest goes to the console. Studio stays on the gateway. ",(0,V.jsx)(b.code,{children:"https://doc.<name>:443"})," uses the same Let's Encrypt issuer and the same address list, does not ask for a client certificate, and forwards to the docs. The docs name is ",(0,V.jsx)(b.code,{children:"doc.<ORCH_CONSOLE_HOST>"}),". There is no separate variable for it. In the host placement the docs upstream is ",(0,V.jsx)(b.code,{children:"127.0.0.1:3002"}),". In the desktop placement it is ",(0,V.jsx)(b.code,{children:"host.docker.internal:3002"}),". ",(0,V.jsx)(b.code,{children:"UPSTREAM_DOCS"})," replaces that upstream. An empty list leaves the named sites open. A non-empty list restricts them."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ORCH_ACME_EMAIL"})," is optional. When it is set, it is passed to the ACME issuer. The DNS names, including the console name and ",(0,V.jsx)(b.code,{children:"doc.<console name>"}),", must point at this machine, and port 80 must be reachable from the internet. Let's Encrypt completes the HTTP-01 challenge on that port for both names. Port 80 is not a site in the Caddyfile. The certificates and the Let's Encrypt account stay in the ",(0,V.jsx)(b.code,{children:"caddy-data"})," volume, mounted on ",(0,V.jsx)(b.code,{children:"/data"}),". If a certificate fails, the listeners of the private authority stay in place."]}),"\n",(0,V.jsxs)(b.p,{children:["The orchestrator checks the Supabase token of each person with ",(0,V.jsx)(b.code,{children:"SUPABASE_JWT_SECRET"})," or ",(0,V.jsx)(b.code,{children:"SUPABASE_JWKS_URL"}),". Set one of them."]}),"\n",(0,V.jsx)(b.h3,{id:"services-1",children:"Services"}),"\n",(0,V.jsx)(b.p,{children:"Stop the plaintext services first if they run. The data volumes are kept."}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsxs)(b.code,{children:[(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"docker"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" compose"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -f"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" docker-compose.platform.yml"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" down"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"docker"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" compose"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -f"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" docker-compose.platform.yml"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -f"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" docker-compose.caddy.yml"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" up"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -d"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --build"})]})]})})}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"docker-compose.caddy.yml"})," builds Caddy from ",(0,V.jsx)(b.code,{children:"deploy/caddy/Dockerfile"}),", with the ",(0,V.jsx)(b.code,{children:"caddy-l4"})," module for Redis. It removes the host ports of Redis, ClickHouse, MinIO, zot, Verdaccio, and Supavisor. The platform file publishes Supavisor on host port 54329. The Caddy overlay still terminates Postgres TLS on the published database port, 54322. Postgres negotiates TLS in its own protocol, uses the server certificate of the chain, and asks for a client certificate. Verdaccio receives ",(0,V.jsx)(b.code,{children:"VERDACCIO_PUBLIC_URL=https://127.0.0.1:4873"}),". A non-local ",(0,V.jsx)(b.code,{children:"CUE_URL"})," host should advertise ",(0,V.jsx)(b.code,{children:"https://<that host>:4873"}),". zot and Verdaccio leave the platform network and listen on ",(0,V.jsx)(b.code,{children:"172.30.1.13"})," and ",(0,V.jsx)(b.code,{children:"172.30.1.14"}),"."]}),"\n",(0,V.jsx)(b.p,{children:"Caddy, Postgres, zot, and Verdaccio wait until the orchestrator has written their files. On the very first start, Postgres initializes after that. If the orchestrator stops because Postgres is not ready yet, start it again."}),"\n",(0,V.jsx)(b.h3,{id:"desktop",children:"Desktop"}),"\n",(0,V.jsx)(b.p,{children:"Development on Linux, Mac, or Docker Desktop uses the desktop placement instead of the overlay above. Do not combine the two files. Stop the plaintext services first if they run. Start this stack before the orchestrator."}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsxs)(b.code,{children:[(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_CADDY_PLACEMENT"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"desktop"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_EDGE_NAMES"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"127.0.0.1"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_REDIS_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"rediss://127.0.0.1:6380"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_CLICKHOUSE_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"https://127.0.0.1:8443"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"CUE_URL"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"https://127.0.0.1:3443"})]})]})})}),"\n",(0,V.jsxs)(b.p,{children:["The certificate check is the same as on the host placement. ",(0,V.jsx)(b.code,{children:"network.ini"})," still names the relay. ",(0,V.jsx)(b.code,{children:"EDGE_NAME=127.0.0.1"})," matches this machine."]}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsxs)(b.code,{children:[(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"ORCH_CADDY_PLACEMENT"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"desktop"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"docker"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" compose"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -f"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" docker-compose.platform.yml"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" down"})]}),"\n",(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"docker"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" compose"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -f"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" docker-compose.platform.yml"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -f"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" docker-compose.caddy.desktop.yml"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" up"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" -d"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --build"})]})]})})}),"\n",(0,V.jsxs)(b.p,{children:["Caddy joins the platform network and the registry network, and publishes ports 443, 3443, 4443, 6380, 8443, 9443, 7443, and 4873. It reaches the console and the orchestrator at ",(0,V.jsx)(b.code,{children:"host.docker.internal"}),". Redis, ClickHouse, and MinIO stay on ",(0,V.jsx)(b.code,{children:"172.30.0.10"})," through ",(0,V.jsx)(b.code,{children:"172.30.0.12"}),". zot is ",(0,V.jsx)(b.code,{children:"172.30.1.13"})," and Verdaccio is ",(0,V.jsx)(b.code,{children:"172.30.1.14"}),". Port 80 is not published, so Let's Encrypt stays on the host placement. The registry ports do not use it."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"ORCH_CERT_DIR"})," must be the same path on the machine and in the containers. The checkout default, ",(0,V.jsx)(b.code,{children:"dist/certs"}),", is that path. On Mac it sits under ",(0,V.jsx)(b.code,{children:"/Users"}),", which Docker Desktop shares. The orchestrator and the console listen on ",(0,V.jsx)(b.code,{children:"0.0.0.0"}),", so ports 3000 and 3001 are reachable on the local network. Compose does not publish them."]}),"\n",(0,V.jsxs)(b.p,{children:["A connection from this machine arrives at Caddy as ",(0,V.jsx)(b.code,{children:"172.30.0.1"})," on Linux. On Docker Desktop, set ",(0,V.jsx)(b.code,{children:"ORCH_CADDY_LOCAL_CIDR"})," to the address that reaches the published ports, ",(0,V.jsx)(b.code,{children:"192.168.65.1/32"})," on Docker Desktop for Mac. The desktop Caddyfile and ",(0,V.jsx)(b.code,{children:"pg_hba.conf"})," treat that value and the gateway as the host, together with ",(0,V.jsx)(b.code,{children:"127.0.0.1"})," and ",(0,V.jsx)(b.code,{children:"::1"}),". Leave the variable unset and only the gateway is added. The host placement ignores the variable. The address list does not distinguish clients. Checking that list still requires the host placement on Linux."]}),"\n",(0,V.jsx)(b.h3,{id:"start",children:"Start"}),"\n",(0,V.jsx)(b.p,{children:"Start the orchestrator as before. On each start it:"}),"\n",(0,V.jsxs)(b.ol,{children:["\n",(0,V.jsxs)(b.li,{children:["creates or reloads the chain in ",(0,V.jsx)(b.code,{children:"ORCH_CERT_DIR"}),", and renews the service certificates that expire within 30 days;"]}),"\n",(0,V.jsxs)(b.li,{children:["writes ",(0,V.jsx)(b.code,{children:"Caddyfile"}),", ",(0,V.jsx)(b.code,{children:"pg_hba.conf"}),", ",(0,V.jsx)(b.code,{children:"pg_reload.sql"}),", and ",(0,V.jsx)(b.code,{children:"registry.htpasswd"})," into ",(0,V.jsx)(b.code,{children:"ORCH_CERT_DIR"}),", from the last applied list in ",(0,V.jsx)(b.code,{children:"edge-allow.json"}),". The ",(0,V.jsx)(b.code,{children:"Caddyfile"})," is readable by its owner only, because it contains the machine registry passwords;"]}),"\n",(0,V.jsxs)(b.li,{children:["listens on ",(0,V.jsx)(b.code,{children:"127.0.0.1:3001"})," in the host placement, and on ",(0,V.jsx)(b.code,{children:"0.0.0.0:3001"})," in the desktop placement;"]}),"\n",(0,V.jsxs)(b.li,{children:["does not start the console or the docs. An archive install starts ",(0,V.jsx)(b.code,{children:"console"})," and ",(0,V.jsx)(b.code,{children:"docs"})," as their own processes. The published image entrypoint starts them after the orchestrator has written ",(0,V.jsx)(b.code,{children:"console-client.crt"})," and the ",(0,V.jsx)(b.code,{children:"Caddyfile"}),", the console on port 3000 and the docs on port 3002. The console calls the orchestrator at ",(0,V.jsx)(b.code,{children:"ORCH_URL"}),". When ",(0,V.jsx)(b.code,{children:"ORCH_URL"})," is unset, that address is ",(0,V.jsx)(b.code,{children:"https://127.0.0.1:3443"}),". The console presents its client certificate on every call."]}),"\n"]}),"\n",(0,V.jsxs)(b.p,{children:["From a checkout, run ",(0,V.jsx)(b.code,{children:"pnpm --filter @ascentstudio/cue-console dev"})," and ",(0,V.jsx)(b.code,{children:"pnpm --filter @ascentstudio/cue-docs dev"})," in other terminals. They read the same ",(0,V.jsx)(b.code,{children:".env"}),". The console listens on port 3000 and the docs listen on port 3002. Stopping the orchestrator does not stop those processes. MinIO on port 9443 requires the client certificate and accepts the request without a signature. The root password in docker-compose is for the console on the internal network. Enrollment on port 4443 uses server TLS only, because the supervisor does not have a client certificate yet."]}),"\n",(0,V.jsxs)(b.p,{children:["Caddy runs with ",(0,V.jsx)(b.code,{children:"--watch"})," and reloads when the ",(0,V.jsx)(b.code,{children:"Caddyfile"})," changes. A renewed server certificate changes the ",(0,V.jsx)(b.code,{children:"Caddyfile"}),", so Caddy reloads it. Postgres reads a renewed server certificate on its next restart."]}),"\n",(0,V.jsx)(b.h3,{id:"ports",children:"Ports"}),"\n",(0,V.jsxs)(b.table,{children:[(0,V.jsx)(b.thead,{children:(0,V.jsxs)(b.tr,{children:[(0,V.jsx)(b.th,{children:"Port"}),(0,V.jsx)(b.th,{children:"Listener"}),(0,V.jsx)(b.th,{children:"TLS"})]})}),(0,V.jsxs)(b.tbody,{children:[(0,V.jsxs)(b.tr,{children:[(0,V.jsx)(b.td,{children:"443"}),(0,V.jsx)(b.td,{children:"Console and docs"}),(0,V.jsxs)(b.td,{children:["Private certificate on the catch-all. Let's Encrypt on the console name and on ",(0,V.jsx)(b.code,{children:"doc.<console name>"})]})]}),(0,V.jsxs)(b.tr,{children:[(0,V.jsx)(b.td,{children:"4443"}),(0,V.jsxs)(b.td,{children:["Enrollment: ",(0,V.jsx)(b.code,{children:"POST /enrollments"})," and ",(0,V.jsx)(b.code,{children:"POST /enrollments/poll"})]}),(0,V.jsx)(b.td,{children:"Server certificate"})]}),(0,V.jsxs)(b.tr,{children:[(0,V.jsx)(b.td,{children:"3443"}),(0,V.jsx)(b.td,{children:"Machine API"}),(0,V.jsx)(b.td,{children:"Client certificate"})]}),(0,V.jsxs)(b.tr,{children:[(0,V.jsx)(b.td,{children:"6380"}),(0,V.jsx)(b.td,{children:"Redis"}),(0,V.jsx)(b.td,{children:"Client certificate"})]}),(0,V.jsxs)(b.tr,{children:[(0,V.jsx)(b.td,{children:"8443"}),(0,V.jsx)(b.td,{children:"ClickHouse HTTP"}),(0,V.jsx)(b.td,{children:"Client certificate"})]}),(0,V.jsxs)(b.tr,{children:[(0,V.jsx)(b.td,{children:"9443"}),(0,V.jsx)(b.td,{children:"MinIO S3 API"}),(0,V.jsx)(b.td,{children:"Client certificate"})]}),(0,V.jsxs)(b.tr,{children:[(0,V.jsx)(b.td,{children:"7443"}),(0,V.jsx)(b.td,{children:"zot"}),(0,V.jsx)(b.td,{children:"Private certificate. A client certificate is checked when one is offered"})]}),(0,V.jsxs)(b.tr,{children:[(0,V.jsx)(b.td,{children:"4873"}),(0,V.jsx)(b.td,{children:"Verdaccio"}),(0,V.jsx)(b.td,{children:"Private certificate. A client certificate is checked when one is offered"})]}),(0,V.jsxs)(b.tr,{children:[(0,V.jsx)(b.td,{children:"80"}),(0,V.jsx)(b.td,{children:"HTTP-01 challenge"}),(0,V.jsx)(b.td,{children:"ACME response, not a Caddyfile site"})]}),(0,V.jsxs)(b.tr,{children:[(0,V.jsx)(b.td,{children:"54322"}),(0,V.jsx)(b.td,{children:"Postgres"}),(0,V.jsx)(b.td,{children:"Postgres TLS, client certificate"})]})]})]}),"\n",(0,V.jsxs)(b.p,{children:["A client certificate must be signed by the intermediate authority of the chain. On the machine API, Caddy passes the verified certificate to the orchestrator in the ",(0,V.jsx)(b.code,{children:"Client-Cert"})," header, as RFC 9440 DER in base64 between colons. Caddy removes that header on every other listener. On the ClickHouse listener, Caddy also removes ",(0,V.jsx)(b.code,{children:"X-ClickHouse-SSL-Certificate-Auth"}),". The official client sets that header when it presents a certificate, and ClickHouse would then try to authenticate a certificate that Caddy already consumed. The ClickHouse native port and the MinIO console stay on the platform network."]}),"\n",(0,V.jsxs)(b.p,{children:["zot and Verdaccio use the private server certificate. An invalid client certificate fails the handshake. No client certificate leaves the request through, and the caller sends a login. The orchestrator client certificate is the write account. Every other valid certificate is the read account. An empty address list allows only ",(0,V.jsx)(b.code,{children:"127.0.0.1"})," and ",(0,V.jsx)(b.code,{children:"::1"})," on those sites, the same filter as MinIO. The console name, when published, uses Let's Encrypt on port 443 and does not ask for a client certificate. ",(0,V.jsx)(b.code,{children:"doc.<console name>"})," is a second Let's Encrypt site on that port, with the same address list and no client certificate. The console name forwards ",(0,V.jsx)(b.code,{children:"/auth/v1"})," to ",(0,V.jsx)(b.code,{children:"127.0.0.1:54321"})," and the rest to the console. The docs site forwards to port 3002. An empty list leaves both named sites open, and a non-empty list restricts them. Port 443 still has the catch-all with the private certificate. Port 80 answers the HTTP-01 challenge for the console name and for ",(0,V.jsx)(b.code,{children:"doc.<console name>"}),". It is not a site in the Caddyfile, and the registry listeners do not depend on that challenge."]}),"\n",(0,V.jsx)(b.h3,{id:"registries",children:"Registries"}),"\n",(0,V.jsxs)(b.p,{children:["A person logs in as ",(0,V.jsx)(b.code,{children:"orchestrator"})," with ",(0,V.jsx)(b.code,{children:"ORCH_REGISTRY_PASSWORD"}),". With the names unset, the addresses are ",(0,V.jsx)(b.code,{children:"127.0.0.1:7443"})," and ",(0,V.jsx)(b.code,{children:"https://127.0.0.1:4873"}),". With the names set, use those names on the same ports. There is no Let's Encrypt certificate on either port. Trust the private authority, or dial the address from a machine that already has it."]}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"docker"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" login"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" 127.0.0.1:7443"})]})})})}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:"npm"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" login"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#005CC5","--shiki-dark":"#79B8FF"},children:" --registry"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" https://127.0.0.1:4873"})]})})})}),"\n",(0,V.jsx)(b.p,{children:"A machine does not log in. After enrollment it presents the client certificate signed by the intermediate. Caddy accepts that certificate as the read account. The orchestrator presents its own client certificate, and Caddy accepts that one as the write account. The supervisor does not change the npm registry URL of this project."}),"\n",(0,V.jsxs)(b.p,{children:["The console does not call zot or Verdaccio. It keeps calling the orchestrator, which relays ",(0,V.jsx)(b.code,{children:"/runtimes/packages"})," and ",(0,V.jsx)(b.code,{children:"/runtimes/images"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"cue-org-*"})," is published here. Other package names, including ",(0,V.jsx)(b.code,{children:"@ascentstudio/*"}),", are fetched from npmjs through Verdaccio. An environment still resolves images as ",(0,V.jsx)(b.code,{children:"local"})," or ",(0,V.jsx)(b.code,{children:"scaleway"}),". Plaintext compose still mounts ",(0,V.jsx)(b.code,{children:"deploy/registries/htpasswd"}),", which contains only the ",(0,V.jsx)(b.code,{children:"orchestrator"})," user."]}),"\n",(0,V.jsx)(b.h3,{id:"address-list",children:"Address list"}),"\n",(0,V.jsxs)(b.p,{children:["The console page ",(0,V.jsx)(b.code,{children:"/account/edge"})," edits the ",(0,V.jsx)(b.code,{children:"edge_allow"})," table. Each change rewrites the ",(0,V.jsx)(b.code,{children:"Caddyfile"})," and ",(0,V.jsx)(b.code,{children:"pg_hba.conf"}),", then the orchestrator runs ",(0,V.jsx)(b.code,{children:"select pg_reload_conf()"}),". If that reload fails, run ",(0,V.jsx)(b.code,{children:"pg_reload.sql"})," as the database owner."]}),"\n",(0,V.jsxs)(b.ul,{children:["\n",(0,V.jsx)(b.li,{children:"With an empty list, every machine listener refuses remote addresses: enrollment, machine API, Redis, ClickHouse, MinIO, Postgres, zot, and Verdaccio. The console is open to everyone, so the first person can sign in."}),"\n",(0,V.jsx)(b.li,{children:"A change is refused if the list that results does not contain the address of the person making it. After the first address, both port 443 sites use the same list. The Let's Encrypt name still does not ask for a client certificate."}),"\n",(0,V.jsxs)(b.li,{children:["The host itself, ",(0,V.jsx)(b.code,{children:"127.0.0.1"})," and ",(0,V.jsx)(b.code,{children:"::1"}),", is always allowed. Postgres also allows the gateway of the platform network, ",(0,V.jsx)(b.code,{children:"172.30.0.1"}),", which is how a Linux host reaches its published port. In the desktop placement, Caddy and Postgres also allow ",(0,V.jsx)(b.code,{children:"ORCH_CADDY_LOCAL_CIDR"})," when it is set. The host placement never writes that address."]}),"\n",(0,V.jsxs)(b.li,{children:["Postgres allows the platform network, ",(0,V.jsx)(b.code,{children:"172.30.0.0/24"}),", with a password and without a client certificate, over TLS and without TLS. Auth, REST, and Storage connect from that network. The gateway rule is more specific, so the published port still requires a client certificate."]}),"\n"]}),"\n",(0,V.jsx)(b.p,{children:"Add the address of a supervisor before you start it. Otherwise its enrollment request does not reach the orchestrator."}),"\n",(0,V.jsx)(b.h2,{id:"images",children:"Images"}),"\n",(0,V.jsx)(b.p,{children:"From the repository root, this prints the image build and does not build:"}),"\n",(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(b.pre,{className:"shiki shiki-themes github-light github-dark",style:{"--shiki-light":"#24292e","--shiki-dark":"#e1e4e8","--shiki-light-bg":"#fff","--shiki-dark-bg":"#24292e"},tabIndex:"0",icon:'<svg viewBox="0 0 24 24"><path d="m 4,4 a 1,1 0 0 0 -0.7070312,0.2929687 1,1 0 0 0 0,1.4140625 L 8.5859375,11 3.2929688,16.292969 a 1,1 0 0 0 0,1.414062 1,1 0 0 0 1.4140624,0 l 5.9999998,-6 a 1.0001,1.0001 0 0 0 0,-1.414062 L 4.7070312,4.2929687 A 1,1 0 0 0 4,4 Z m 8,14 a 1,1 0 0 0 -1,1 1,1 0 0 0 1,1 h 8 a 1,1 0 0 0 1,-1 1,1 0 0 0 -1,-1 z" fill="currentColor" /></svg>',children:(0,V.jsx)(b.code,{children:(0,V.jsxs)(b.span,{className:"line",children:[(0,V.jsx)(b.span,{style:{"--shiki-light":"#24292E","--shiki-dark":"#E1E4E8"},children:"DRY_RUN"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#D73A49","--shiki-dark":"#F97583"},children:"="}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:"1"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#6F42C1","--shiki-dark":"#B392F0"},children:" bash"}),(0,V.jsx)(b.span,{style:{"--shiki-light":"#032F62","--shiki-dark":"#9ECBFF"},children:" scripts/build-platform-images.sh"})]})})})}),"\n",(0,V.jsxs)(b.p,{children:["The images are ",(0,V.jsx)(b.code,{children:"linux/amd64"})," and ",(0,V.jsx)(b.code,{children:"linux/arm64"}),". Each image has its own repository, tagged with the root package.json version: ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-orchestrator:<version>"}),", ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-caddy:<version>"}),", ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-zot:<version>"}),", and ",(0,V.jsx)(b.code,{children:"ascentstudio/cue-backup:<version>"}),". There is no ",(0,V.jsx)(b.code,{children:"latest"})," tag. This script does not push. ",(0,V.jsx)(b.code,{children:"pnpm build-images"})," runs the same build. ",(0,V.jsx)(b.code,{children:"pnpm publish-images"})," runs after ",(0,V.jsx)(b.code,{children:"pnpm publish-packages"}),". It checks that each package of that version is on npm, then builds the four repositories with ",(0,V.jsx)(b.code,{children:"--push"}),". A separate ",(0,V.jsx)(b.code,{children:"docker push"})," cannot send the two-platform manifest, because the local engine does not store it."]})]})}function dQ(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(dP,{...a})}):dP(a)}let dR={title:"Orchestrator"},dS=[{href:"./server"},{href:"./engine"},{href:"./fixture"},{href:"./usage/flow"},{href:"./usage/drivers"}],dT={contents:[{heading:void 0,content:"These pages are the orchestrator rules an agent applies, and the fixture that exercises them."},{heading:"server",content:"Read Server to install the published images on a Linux server."},{heading:"engine",content:"Read Engine when the work touches a flow, a run, an entity, a step, a group, a sealed report, a rule, validity duration, silence, a rate limit, a job, secrets, or what a person sees."},{heading:"engine",content:"Done when the code still matches every rule in the sections that work touches."},{heading:"fixture",content:"Read Fixture when the work touches the organization fixture, or a test that runs it."},{heading:"fixture",content:"Done when that organization still matches the fixture page."},{heading:"usage",content:"Read Usage when the work writes a flow or a step implementation."},{heading:"usage",content:"Done when that flow and its step implementations still match the usage page."},{heading:"drivers",content:"Read Drivers when the work opens a client to PostgreSQL, Elasticsearch, ClickHouse, S3, Qdrant, or another service that keeps connections."},{heading:"drivers",content:"Done when the code still matches every rule in the sections that work touches."}],headings:[{id:"server",content:"Server"},{id:"engine",content:"Engine"},{id:"fixture",content:"Fixture"},{id:"usage",content:"Usage"},{id:"drivers",content:"Drivers"}]},dU=[{depth:2,url:"#server",title:(0,V.jsx)(V.Fragment,{children:"Server"})},{depth:2,url:"#engine",title:(0,V.jsx)(V.Fragment,{children:"Engine"})},{depth:2,url:"#fixture",title:(0,V.jsx)(V.Fragment,{children:"Fixture"})},{depth:2,url:"#usage",title:(0,V.jsx)(V.Fragment,{children:"Usage"})},{depth:2,url:"#drivers",title:(0,V.jsx)(V.Fragment,{children:"Drivers"})}];function dV(a){let b={a:"a",h2:"h2",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.p,{children:"These pages are the orchestrator rules an agent applies, and the fixture that exercises them."}),"\n",(0,V.jsx)(b.h2,{id:"server",children:"Server"}),"\n",(0,V.jsxs)(b.p,{children:["Read ",(0,V.jsx)(b.a,{href:"./server",children:"Server"})," to install the published images on a Linux server."]}),"\n",(0,V.jsx)(b.h2,{id:"engine",children:"Engine"}),"\n",(0,V.jsxs)(b.p,{children:["Read ",(0,V.jsx)(b.a,{href:"./engine",children:"Engine"})," when the work touches a flow, a run, an entity, a step, a group, a sealed report, a rule, validity duration, silence, a rate limit, a job, secrets, or what a person sees."]}),"\n",(0,V.jsx)(b.p,{children:"Done when the code still matches every rule in the sections that work touches."}),"\n",(0,V.jsx)(b.h2,{id:"fixture",children:"Fixture"}),"\n",(0,V.jsxs)(b.p,{children:["Read ",(0,V.jsx)(b.a,{href:"./fixture",children:"Fixture"})," when the work touches the organization fixture, or a test that runs it."]}),"\n",(0,V.jsx)(b.p,{children:"Done when that organization still matches the fixture page."}),"\n",(0,V.jsx)(b.h2,{id:"usage",children:"Usage"}),"\n",(0,V.jsxs)(b.p,{children:["Read ",(0,V.jsx)(b.a,{href:"./usage/flow",children:"Usage"})," when the work writes a flow or a step implementation."]}),"\n",(0,V.jsx)(b.p,{children:"Done when that flow and its step implementations still match the usage page."}),"\n",(0,V.jsx)(b.h2,{id:"drivers",children:"Drivers"}),"\n",(0,V.jsxs)(b.p,{children:["Read ",(0,V.jsx)(b.a,{href:"./usage/drivers",children:"Drivers"})," when the work opens a client to PostgreSQL, Elasticsearch, ClickHouse, S3, Qdrant, or another service that keeps connections."]}),"\n",(0,V.jsx)(b.p,{children:"Done when the code still matches every rule in the sections that work touches."})]})}function dW(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(dV,{...a})}):dV(a)}let dX={title:"Fixture"},dY=[],dZ={contents:[{heading:void 0,content:"Keep this organization on the sequence below when you change it. Done when the performance flows, their step implementations, and the launch commands still match this page."},{heading:void 0,content:"The organization fixture is a fixture for tests. It is not a business flow. The source is organizations/fixture. organizations/fixture/src/index.ts exports flows, and fixtureFlows is that same list."},{heading:void 0,content:"The flows are pace, load, stall, fault, soften, aside, nest, nest-mid, nest-leaf, brood, and brood-child. Each one sets validityDurationMs to null and entityType to its name. Silence is a whole number of minutes (silenceDurationMin). Configured work is milliseconds. No step sets rateLimit."},{heading:"steps",content:"organizations/fixture/src/steps.ts binds the step implementations with bindOrganization. fixtureSteps stores each bound step under flow/step. The kind is fixture- plus the step name."},{heading:"steps",content:"dwell has aliases mark and pass-1 through pass-10. Its kind is fixture-dwell, concurrency 4, silence 30 minutes, and maxResends 1. It waits the configured work, then returns done. pace reads dwellMs on dwell and markMs on mark. load, soften, aside, nest, nest-leaf, and brood-child read workMs on dwell. A pass-* step reads dwellMs when that field is present, and workMs otherwise. That count is an integer of milliseconds, zero or greater. A missing or invalid count waits 0 milliseconds. A brood payload has no duration field, so pass-1 through pass-10 wait 0 milliseconds."},{heading:"steps",content:"stall has kind fixture-stall, concurrency 1, silence 1 minute, and maxResends 0. It throws StepHeld and publishes no result. One minute later the first silence records not_finished."},{heading:"steps",content:"miss has kind fixture-miss, concurrency 4, silence 30 minutes, and maxResends 0. It returns failed at once and does not throw."},{heading:"steps",content:"sprout has kind fixture-sprout, concurrency 4, silence 30 minutes, and maxResends 1. It returns done with one child. On nest the identifier is mid- plus the parent identifier. On nest-mid the identifier is leaf- plus the parent identifier. The child payload is { workMs: 0 }."},{heading:"steps",content:"brood has kind fixture-brood, concurrency 4, silence 30 minutes, and maxResends 1. It returns done with one child per childCount, at most 100. The identifier is c plus the index, a hyphen, and the parent identifier. The child payload is { workMs: 0 }."},{heading:"flows",content:"pace opens dwell, then mark, then finishes. The payload carries dwellMs and markMs. The flow finishes success."},{heading:"flows",content:"load opens one dwell and finishes success. The payload carries workMs. It stays on kind fixture-dwell."},{heading:"flows",content:"stall opens one required stall and finishes not_finished."},{heading:"flows",content:"fault opens one required miss and finishes failure."},{heading:"flows",content:"soften opens optional miss, then dwell, then finishes. The flow finishes success and miss stays failed. The payload carries workMs."},{heading:"flows",content:"aside opens detached stall, then a required dwell, then finishes. The flow finishes success well before the minute of silence. The detached step later records not_finished and the issue stays success. The payload carries workMs."},{heading:"flows",content:"nest opens sprout, then opens child flow nest-mid from that body. It then opens dwell with step payload { attachments: [{ attachmentId, rank: 0 }] }. attachmentId is 00000000-0000-4000-8000-000000000000. The wait on that dwell is still workMs from the flow payload. The flow finishes success."},{heading:"flows",content:"nest-mid opens sprout, opens child flow nest-leaf from that body, then finishes success."},{heading:"flows",content:"nest-leaf opens dwell and finishes success. The child payload is { workMs: 0 }."},{heading:"flows",content:"brood opens pass-1 through pass-10, opens step brood, opens child flow brood-child from that body, then finishes success. The payload carries childCount, an integer from 1 to 100."},{heading:"flows",content:"brood-child opens dwell and finishes success. The child payload is { workMs: 0 }."},{heading:"runs",content:"The fixture does not export catalogSeed and does not open a client database. pnpm --dir organizations/fixture seed opens nothing and prints seeded fixture 0 runs."},{heading:"runs",content:"pnpm --dir organizations/fixture reset deletes the fixture rows in entities and entity_links, then deletes that organization's metrics and the jobs those runs left in Redis. It leaves organizations, memberships, secrets, and the signed-in person in place. The log line is reset fixture."},{heading:"performance",content:"pnpm --dir organizations/fixture seed does not start these flows."},{heading:"performance",content:"Relaunch a run with pnpm --dir organizations/fixture perf. The script is organizations/fixture/scripts/perf-fixture.mjs. It starts the workers these flows need, kinds fixture-dwell, fixture-stall, fixture-miss, and fixture-sprout, and stops them when the run ends. It opens pace, load, stall, fault, soften, aside, and nest."},{heading:"load-test",content:"Relaunch with pnpm --dir organizations/fixture perf:load. The script is organizations/fixture/scripts/perf-load.mjs. It starts one worker, kind fixture-dwell, WORKER_CONCURRENCY 32, and stops that worker when the run ends. Levels 200, 400, and 800 of load with workMs 0. After 200, a pace wave of 200 with dwellMs 0 and markMs 0. Send is ranAt minus openedAt. Apply is endedAt minus ranAt minus computeMs."},{heading:"brood",content:"Relaunch with pnpm --dir organizations/fixture perf:brood. The script is organizations/fixture/scripts/perf-brood.mjs. It starts workers for fixture-brood and fixture-dwell, concurrency 4 on each, and stops them when the run ends. It opens brood families. BROOD_FAMILIES defaults to 2000. Each family carries childCount 10."},{heading:"brood",content:"pnpm --dir organizations/fixture perf:brood:producer runs organizations/fixture/scripts/perf-brood-producer.mjs. It uses the same two kinds. It opens a wave of 100 families every second for 3 minutes, each with childCount 10, then waits until those runs settle."}],headings:[{id:"steps",content:"Steps"},{id:"flows",content:"Flows"},{id:"runs",content:"Runs"},{id:"performance",content:"Performance"},{id:"load-test",content:"Load test"},{id:"brood",content:"Brood"}]},d$=[{depth:2,url:"#steps",title:(0,V.jsx)(V.Fragment,{children:"Steps"})},{depth:2,url:"#flows",title:(0,V.jsx)(V.Fragment,{children:"Flows"})},{depth:2,url:"#runs",title:(0,V.jsx)(V.Fragment,{children:"Runs"})},{depth:2,url:"#performance",title:(0,V.jsx)(V.Fragment,{children:"Performance"})},{depth:3,url:"#load-test",title:(0,V.jsx)(V.Fragment,{children:"Load test"})},{depth:3,url:"#brood",title:(0,V.jsx)(V.Fragment,{children:"Brood"})}];function d_(a){let b={code:"code",h2:"h2",h3:"h3",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.p,{children:"Keep this organization on the sequence below when you change it. Done when the performance flows, their step implementations, and the launch commands still match this page."}),"\n",(0,V.jsxs)(b.p,{children:["The organization ",(0,V.jsx)(b.code,{children:"fixture"})," is a fixture for tests. It is not a business flow. The source is ",(0,V.jsx)(b.code,{children:"organizations/fixture"}),". ",(0,V.jsx)(b.code,{children:"organizations/fixture/src/index.ts"})," exports ",(0,V.jsx)(b.code,{children:"flows"}),", and ",(0,V.jsx)(b.code,{children:"fixtureFlows"})," is that same list."]}),"\n",(0,V.jsxs)(b.p,{children:["The flows are ",(0,V.jsx)(b.code,{children:"pace"}),", ",(0,V.jsx)(b.code,{children:"load"}),", ",(0,V.jsx)(b.code,{children:"stall"}),", ",(0,V.jsx)(b.code,{children:"fault"}),", ",(0,V.jsx)(b.code,{children:"soften"}),", ",(0,V.jsx)(b.code,{children:"aside"}),", ",(0,V.jsx)(b.code,{children:"nest"}),", ",(0,V.jsx)(b.code,{children:"nest-mid"}),", ",(0,V.jsx)(b.code,{children:"nest-leaf"}),", ",(0,V.jsx)(b.code,{children:"brood"}),", and ",(0,V.jsx)(b.code,{children:"brood-child"}),". Each one sets ",(0,V.jsx)(b.code,{children:"validityDurationMs"})," to null and ",(0,V.jsx)(b.code,{children:"entityType"})," to its name. Silence is a whole number of minutes (",(0,V.jsx)(b.code,{children:"silenceDurationMin"}),"). Configured work is milliseconds. No step sets ",(0,V.jsx)(b.code,{children:"rateLimit"}),"."]}),"\n",(0,V.jsx)(b.h2,{id:"steps",children:"Steps"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"organizations/fixture/src/steps.ts"})," binds the step implementations with ",(0,V.jsx)(b.code,{children:"bindOrganization"}),". ",(0,V.jsx)(b.code,{children:"fixtureSteps"})," stores each bound step under ",(0,V.jsx)(b.code,{children:"flow/step"}),". The kind is ",(0,V.jsx)(b.code,{children:"fixture-"})," plus the step name."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"dwell"})," has aliases ",(0,V.jsx)(b.code,{children:"mark"})," and ",(0,V.jsx)(b.code,{children:"pass-1"})," through ",(0,V.jsx)(b.code,{children:"pass-10"}),". Its kind is ",(0,V.jsx)(b.code,{children:"fixture-dwell"}),", concurrency 4, silence 30 minutes, and ",(0,V.jsx)(b.code,{children:"maxResends"})," 1. It waits the configured work, then returns done. ",(0,V.jsx)(b.code,{children:"pace"})," reads ",(0,V.jsx)(b.code,{children:"dwellMs"})," on ",(0,V.jsx)(b.code,{children:"dwell"})," and ",(0,V.jsx)(b.code,{children:"markMs"})," on ",(0,V.jsx)(b.code,{children:"mark"}),". ",(0,V.jsx)(b.code,{children:"load"}),", ",(0,V.jsx)(b.code,{children:"soften"}),", ",(0,V.jsx)(b.code,{children:"aside"}),", ",(0,V.jsx)(b.code,{children:"nest"}),", ",(0,V.jsx)(b.code,{children:"nest-leaf"}),", and ",(0,V.jsx)(b.code,{children:"brood-child"})," read ",(0,V.jsx)(b.code,{children:"workMs"})," on ",(0,V.jsx)(b.code,{children:"dwell"}),". A ",(0,V.jsx)(b.code,{children:"pass-*"})," step reads ",(0,V.jsx)(b.code,{children:"dwellMs"})," when that field is present, and ",(0,V.jsx)(b.code,{children:"workMs"})," otherwise. That count is an integer of milliseconds, zero or greater. A missing or invalid count waits 0 milliseconds. A brood payload has no duration field, so ",(0,V.jsx)(b.code,{children:"pass-1"})," through ",(0,V.jsx)(b.code,{children:"pass-10"})," wait 0 milliseconds."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"stall"})," has kind ",(0,V.jsx)(b.code,{children:"fixture-stall"}),", concurrency 1, silence 1 minute, and ",(0,V.jsx)(b.code,{children:"maxResends"})," 0. It throws ",(0,V.jsx)(b.code,{children:"StepHeld"})," and publishes no result. One minute later the first silence records ",(0,V.jsx)(b.code,{children:"not_finished"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"miss"})," has kind ",(0,V.jsx)(b.code,{children:"fixture-miss"}),", concurrency 4, silence 30 minutes, and ",(0,V.jsx)(b.code,{children:"maxResends"})," 0. It returns failed at once and does not throw."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"sprout"})," has kind ",(0,V.jsx)(b.code,{children:"fixture-sprout"}),", concurrency 4, silence 30 minutes, and ",(0,V.jsx)(b.code,{children:"maxResends"})," 1. It returns done with one child. On ",(0,V.jsx)(b.code,{children:"nest"})," the identifier is ",(0,V.jsx)(b.code,{children:"mid-"})," plus the parent identifier. On ",(0,V.jsx)(b.code,{children:"nest-mid"})," the identifier is ",(0,V.jsx)(b.code,{children:"leaf-"})," plus the parent identifier. The child payload is ",(0,V.jsx)(b.code,{children:"{ workMs: 0 }"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"brood"})," has kind ",(0,V.jsx)(b.code,{children:"fixture-brood"}),", concurrency 4, silence 30 minutes, and ",(0,V.jsx)(b.code,{children:"maxResends"})," 1. It returns done with one child per ",(0,V.jsx)(b.code,{children:"childCount"}),", at most 100. The identifier is ",(0,V.jsx)(b.code,{children:"c"})," plus the index, a hyphen, and the parent identifier. The child payload is ",(0,V.jsx)(b.code,{children:"{ workMs: 0 }"}),"."]}),"\n",(0,V.jsx)(b.h2,{id:"flows",children:"Flows"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"pace"})," opens ",(0,V.jsx)(b.code,{children:"dwell"}),", then ",(0,V.jsx)(b.code,{children:"mark"}),", then finishes. The payload carries ",(0,V.jsx)(b.code,{children:"dwellMs"})," and ",(0,V.jsx)(b.code,{children:"markMs"}),". The flow finishes success."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"load"})," opens one ",(0,V.jsx)(b.code,{children:"dwell"})," and finishes success. The payload carries ",(0,V.jsx)(b.code,{children:"workMs"}),". It stays on kind ",(0,V.jsx)(b.code,{children:"fixture-dwell"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"stall"})," opens one required ",(0,V.jsx)(b.code,{children:"stall"})," and finishes ",(0,V.jsx)(b.code,{children:"not_finished"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"fault"})," opens one required ",(0,V.jsx)(b.code,{children:"miss"})," and finishes ",(0,V.jsx)(b.code,{children:"failure"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"soften"})," opens optional ",(0,V.jsx)(b.code,{children:"miss"}),", then ",(0,V.jsx)(b.code,{children:"dwell"}),", then finishes. The flow finishes success and ",(0,V.jsx)(b.code,{children:"miss"})," stays ",(0,V.jsx)(b.code,{children:"failed"}),". The payload carries ",(0,V.jsx)(b.code,{children:"workMs"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"aside"})," opens detached ",(0,V.jsx)(b.code,{children:"stall"}),", then a required ",(0,V.jsx)(b.code,{children:"dwell"}),", then finishes. The flow finishes success well before the minute of silence. The detached step later records ",(0,V.jsx)(b.code,{children:"not_finished"})," and the issue stays success. The payload carries ",(0,V.jsx)(b.code,{children:"workMs"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"nest"})," opens ",(0,V.jsx)(b.code,{children:"sprout"}),", then opens child flow ",(0,V.jsx)(b.code,{children:"nest-mid"})," from that body. It then opens ",(0,V.jsx)(b.code,{children:"dwell"})," with step payload ",(0,V.jsx)(b.code,{children:"{ attachments: [{ attachmentId, rank: 0 }] }"}),". ",(0,V.jsx)(b.code,{children:"attachmentId"})," is ",(0,V.jsx)(b.code,{children:"00000000-0000-4000-8000-000000000000"}),". The wait on that ",(0,V.jsx)(b.code,{children:"dwell"})," is still ",(0,V.jsx)(b.code,{children:"workMs"})," from the flow payload. The flow finishes success."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"nest-mid"})," opens ",(0,V.jsx)(b.code,{children:"sprout"}),", opens child flow ",(0,V.jsx)(b.code,{children:"nest-leaf"})," from that body, then finishes success."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"nest-leaf"})," opens ",(0,V.jsx)(b.code,{children:"dwell"})," and finishes success. The child payload is ",(0,V.jsx)(b.code,{children:"{ workMs: 0 }"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"brood"})," opens ",(0,V.jsx)(b.code,{children:"pass-1"})," through ",(0,V.jsx)(b.code,{children:"pass-10"}),", opens step ",(0,V.jsx)(b.code,{children:"brood"}),", opens child flow ",(0,V.jsx)(b.code,{children:"brood-child"})," from that body, then finishes success. The payload carries ",(0,V.jsx)(b.code,{children:"childCount"}),", an integer from 1 to 100."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"brood-child"})," opens ",(0,V.jsx)(b.code,{children:"dwell"})," and finishes success. The child payload is ",(0,V.jsx)(b.code,{children:"{ workMs: 0 }"}),"."]}),"\n",(0,V.jsx)(b.h2,{id:"runs",children:"Runs"}),"\n",(0,V.jsxs)(b.p,{children:["The fixture does not export ",(0,V.jsx)(b.code,{children:"catalogSeed"})," and does not open a client database. ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture seed"})," opens nothing and prints ",(0,V.jsx)(b.code,{children:"seeded fixture 0 runs"}),"."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture reset"})," deletes the fixture rows in ",(0,V.jsx)(b.code,{children:"entities"})," and ",(0,V.jsx)(b.code,{children:"entity_links"}),", then deletes that organization's metrics and the jobs those runs left in Redis. It leaves ",(0,V.jsx)(b.code,{children:"organizations"}),", ",(0,V.jsx)(b.code,{children:"memberships"}),", ",(0,V.jsx)(b.code,{children:"secrets"}),", and the signed-in person in place. The log line is ",(0,V.jsx)(b.code,{children:"reset fixture"}),"."]}),"\n",(0,V.jsx)(b.h2,{id:"performance",children:"Performance"}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture seed"})," does not start these flows."]}),"\n",(0,V.jsxs)(b.p,{children:["Relaunch a run with ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf"}),". The script is ",(0,V.jsx)(b.code,{children:"organizations/fixture/scripts/perf-fixture.mjs"}),". It starts the workers these flows need, kinds ",(0,V.jsx)(b.code,{children:"fixture-dwell"}),", ",(0,V.jsx)(b.code,{children:"fixture-stall"}),", ",(0,V.jsx)(b.code,{children:"fixture-miss"}),", and ",(0,V.jsx)(b.code,{children:"fixture-sprout"}),", and stops them when the run ends. It opens ",(0,V.jsx)(b.code,{children:"pace"}),", ",(0,V.jsx)(b.code,{children:"load"}),", ",(0,V.jsx)(b.code,{children:"stall"}),", ",(0,V.jsx)(b.code,{children:"fault"}),", ",(0,V.jsx)(b.code,{children:"soften"}),", ",(0,V.jsx)(b.code,{children:"aside"}),", and ",(0,V.jsx)(b.code,{children:"nest"}),"."]}),"\n",(0,V.jsx)(b.h3,{id:"load-test",children:"Load test"}),"\n",(0,V.jsxs)(b.p,{children:["Relaunch with ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf:load"}),". The script is ",(0,V.jsx)(b.code,{children:"organizations/fixture/scripts/perf-load.mjs"}),". It starts one worker, kind ",(0,V.jsx)(b.code,{children:"fixture-dwell"}),", ",(0,V.jsx)(b.code,{children:"WORKER_CONCURRENCY"})," 32, and stops that worker when the run ends. Levels 200, 400, and 800 of ",(0,V.jsx)(b.code,{children:"load"})," with ",(0,V.jsx)(b.code,{children:"workMs"})," 0. After 200, a ",(0,V.jsx)(b.code,{children:"pace"})," wave of 200 with ",(0,V.jsx)(b.code,{children:"dwellMs"})," 0 and ",(0,V.jsx)(b.code,{children:"markMs"})," 0. Send is ",(0,V.jsx)(b.code,{children:"ranAt"})," minus ",(0,V.jsx)(b.code,{children:"openedAt"}),". Apply is ",(0,V.jsx)(b.code,{children:"endedAt"})," minus ",(0,V.jsx)(b.code,{children:"ranAt"})," minus ",(0,V.jsx)(b.code,{children:"computeMs"}),"."]}),"\n",(0,V.jsx)(b.h3,{id:"brood",children:"Brood"}),"\n",(0,V.jsxs)(b.p,{children:["Relaunch with ",(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf:brood"}),". The script is ",(0,V.jsx)(b.code,{children:"organizations/fixture/scripts/perf-brood.mjs"}),". It starts workers for ",(0,V.jsx)(b.code,{children:"fixture-brood"})," and ",(0,V.jsx)(b.code,{children:"fixture-dwell"}),", concurrency 4 on each, and stops them when the run ends. It opens ",(0,V.jsx)(b.code,{children:"brood"})," families. ",(0,V.jsx)(b.code,{children:"BROOD_FAMILIES"})," defaults to 2000. Each family carries ",(0,V.jsx)(b.code,{children:"childCount"})," 10."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"pnpm --dir organizations/fixture perf:brood:producer"})," runs ",(0,V.jsx)(b.code,{children:"organizations/fixture/scripts/perf-brood-producer.mjs"}),". It uses the same two kinds. It opens a wave of 100 families every second for 3 minutes, each with ",(0,V.jsx)(b.code,{children:"childCount"})," 10, then waits until those runs settle."]})]})}function d0(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(d_,{...a})}):d_(a)}let d1={title:"Engine"},d2=[],d3={contents:[{heading:void 0,content:"Apply the section your change touches. Done when the code and that section describe the same behavior."},{heading:"flow",content:"The engine rereads a restricted TypeScript flow from the start. The function may open a step, open an optional step, open a detached step, open child entities from the typed body, wait for a group, choose one named arm, finish, or declare failure. It reads sealed reports. The client database, secrets, and the clock stay outside the function."},{heading:"flow",content:"The same sealed reports open the same steps. An opening already made stays in place. A choice records its arms in the order they are written. One name takes one arm. The other arms name their steps as discarded. A discarded step is not opened: it sends no job, and silence does not send it again."},{heading:"step-and-group",content:"One step resumes when its result is there. openStep does this. A failed required step ends the run in failure and does not open the continuation. A not finished required step ends the run not finished."},{heading:"step-and-group",content:"openOptionalStep waits the same way. A failed result and a not finished result are returned and do not stop the run. openDetachedStep enqueues the job and does not wait. Its result does not stop the run. A result that arrives after the run has ended is recorded on that step and does not reread the function."},{heading:"step-and-group",content:"Several openings form a group. The group waits until every required member is done. A required member is an openStep or a child opening. An optional step is waited on and does not count. Success is a result whose status is done, a single child run whose status is success, or an array of children whose report is sealed. The first required failure ends the run in failure. The first required not finished, when nothing has failed, ends the run not finished. Inside the group, openStep and openOptionalStep open steps, and openChildren and openOptionalChildren open child entities. A group does not open a detached step."},{heading:"step-and-group",content:"When the group is satisfied the report is sealed: end reason, counts, and the discriminant of each member already returned. A child member contributes one element per child, with that child's flow. A late result is recorded on its step. The sealed report stays as sealed. When the run stops because a required member failed or is not finished, still-open required and optional steps close as not finished with discriminant ended. Detached steps stay open."},{heading:"step-and-group",content:"A step declares the shape of its body and of the payload that opens it. A body outside that shape ends the step as failed. A payload outside its shape does not open the step. A later reread compares the same payload. The worker receives it with the step. finish keeps its discriminant and stores a body checked by the flow's return schema."},{heading:"step-and-group",content:"One child opened on the flow resumes when that child's result is there. A failed required child ends the parent in failure. A not finished required child ends the parent not finished. An optional child returns that result and does not stop the parent. Several child entities opened together carry one rule, the same on openChildren and openOptionalChildren. The omitted rule is that every child run succeeds. The call may pass a quota: a count, capped at the number of children, or a proportion, whose target is that proportion of the children rounded up. Either form may name withinMin, whole minutes from the moment the children open. Only a successful child run counts toward the target. A required opening seals when the target is met. It stops the parent when the target can no longer be met, or when withinMin is reached with the target unmet. Before that time, a failure stops a required all as failure, and a not finished child stops it as not finished. An optional opening seals and the parent continues: quota when the target is met or can no longer be met, deadline when withinMin is reached first, and all when every child of an all opening has ended. A failure does not seal an optional all early. Children still open stay out of the sealed report. A result that arrives later does not change it. A child takes the identity and starting data of its element. The parent reads the child's typed body."},{heading:"run",content:"Success: the function runs to the end, by returning or by finish(). finish may name the flow's return and store a body. A parent of one child reads that name as the discriminant and reads the body. Without a name, the discriminant stays success."},{heading:"run",content:"Failure: a required step or a single required child failed, a required array of children missed its rule, or the function declares failure."},{heading:"run",content:"Not finished: a required step or a single required child is not finished, before the children's duration. An optional step does not do that. A detached step does not do that. An optional child does not do that. A quota does not treat not finished as success."},{heading:"entity",content:"The entity key is organization, flow, and identity. One run at a time. Other requests wait. The run keeps the first request's starting data."},{heading:"entity",content:"Two identical lines of one list join that one execution and receive the same result."},{heading:"validity-duration",content:"Validity duration is on the flow."},{heading:"validity-duration",content:"On success, the duration runs from the end. A request inside the duration receives the recorded result, starts no run, and leaves the client database unread."},{heading:"validity-duration",content:"The next request starts a run with its own starting data when the run is a failure, not finished, the duration has passed, or the flow has no duration. Passing the duration leaves the displayed run in place until that request."},{heading:"validity-duration",content:"A parent whose run has ended stays ended when another requester starts a new run of a child."},{heading:"validity-duration",content:"The entity shows the current run and the validity end. Until a new run starts, an expired run stays displayed with its end in the past."},{heading:"silence",content:"Silence is per opened step. The silence duration and the resend maximum come from the entity's starting data."},{heading:"silence",content:"Without a result at that time, the orchestrator sends the same job again. At the resend maximum the step result is not finished."},{heading:"silence",content:"An array of children whose rule names withinMin is judged when that duration is reached. A required opening fails when the target is still unmet. An optional opening seals with end reason deadline."},{heading:"rate-limit",content:"A rate limit is on the step definition: max jobs and a duration durationMs. bindOrganization copies it onto every bound step of that definition. Aliases share the definition and the kind, so they share the limit. The kind is one queue for that organization and that step definition, so every flow that opens the step shares the limit. A step definition with no rate limit has no limit."},{heading:"rate-limit",content:"The orchestrator sends the job when the step opens. The limit gates when a worker starts it. createStepWorker passes BullMQ limiter with that max and with duration set to durationMs. BullMQ keeps one counter in Redis for that queue. Every worker of the kind increments the same counter when it moves a job to active. The first start in a window sets the counter to expire after durationMs. At max, further jobs stay waiting until the key expires and the next window starts."},{heading:"rate-limit",content:"Concurrency is how many jobs one worker runs at once. The rate limit is how many jobs the kind starts during one window, across every worker of that kind. Ten workers, each with concurrency 1, and a rate limit of 8 jobs per 1000 ms, start at most 8 jobs of that kind in the window. A concurrency override on a worker changes only that worker's concurrency. The limit stays the one on the step definition. The shared count holds when every worker of the kind is started with that same limit."},{heading:"rate-limit",content:"Starts at the end of one window and the start of the next can land close together. A job that keeps running past the window still counts as one start. Jobs already active run to the end."},{heading:"rate-limit",content:"Each environment has its own queue, and that queue has its own counter."},{heading:"rate-limit",content:"Silence runs from the opening. A job that stays waiting until the silence duration elapses is sent again. At the resend maximum the step result is not finished."},{heading:"job-and-storage",content:"BullMQ only transports the job. The job is organization, entity, and step. Secrets stay off the job. The worker loads that organization's secrets once when it starts and writes them into the environment. The dispatch value carries the starting data and the time, and it carries no secret. A step implementation reads one name with environment in packages/contract/src/environment.ts. A log replaces the value with ••••. A secret added or deleted is visible at the next start of the worker. Each bound step names a kind. The orchestrator sends that job to the Redis queue for that kind. A worker pulls. It does not push when a worker appears, and the HTTP server does not start a worker. Connected workers are presence, not a condition for opening a step. Silence, a resend, and not finished stay on the opened step: a resend is a new job, and the queue does not retry. Postgres keeps the current flow run, one row per entity, plus parent and child links, memberships, and secrets. Each row is carried by its organization. The application stores each secret as given. A transition loads that entity, the children named in its tree, and its running parents. The HTTP server reads that entity row on each read. Entity counts and running counts are cached for a few seconds. After the commit, each new flow metric and step metric is appended to Redis and inserted into ClickHouse in batches. The engine rereads the result on the entity row. It does not reread the metric."},{heading:"job-and-storage",content:"A step may write a transient file for a later step of the same run. The names it writes travel with the result and stay on the step. A replay from a step copies those kept names into the new generation before that generation's jobs are sent. A full replay starts empty and does not copy. It receives the time the orchestrator runs the job. A second run of that step keeps a single effect. The orchestrator records the step when it accepts the result. When a step throws, that result is failed and its discriminant is the error message. A held step stays open."},{heading:"person",content:"Tests start the first run through the internal function startRun. A run starts from that function."},{heading:"person",content:"A person sees entities, the operation tree, steps and their progress, the current wait, children, the validity end, the flow source, and the transient files of a stored flow run. The Secrets page lists that organization's secrets. A person can add one and delete one. Entity, source, and flow reads do not include a secret. A discarded step stays in that tree and is marked discarded. The Flows page shows flow runs and step runs for a period: counts, failure rate, p50, and the trend come from ClickHouse, and the entity count and running come from Postgres. A person can open the first entity of a flow, replay a flow, replay from a step, resend a job, run a step without applying its result, cancel a run or an open step, and end a validity. The first opening is that request: an open run waits, and inside the validity duration the recorded result is returned."}],headings:[{id:"flow",content:"Flow"},{id:"step-and-group",content:"Step and group"},{id:"run",content:"Run"},{id:"entity",content:"Entity"},{id:"validity-duration",content:"Validity duration"},{id:"silence",content:"Silence"},{id:"rate-limit",content:"Rate limit"},{id:"job-and-storage",content:"Job and storage"},{id:"person",content:"Person"}]},d4=[{depth:2,url:"#flow",title:(0,V.jsx)(V.Fragment,{children:"Flow"})},{depth:2,url:"#step-and-group",title:(0,V.jsx)(V.Fragment,{children:"Step and group"})},{depth:2,url:"#run",title:(0,V.jsx)(V.Fragment,{children:"Run"})},{depth:2,url:"#entity",title:(0,V.jsx)(V.Fragment,{children:"Entity"})},{depth:2,url:"#validity-duration",title:(0,V.jsx)(V.Fragment,{children:"Validity duration"})},{depth:2,url:"#silence",title:(0,V.jsx)(V.Fragment,{children:"Silence"})},{depth:2,url:"#rate-limit",title:(0,V.jsx)(V.Fragment,{children:"Rate limit"})},{depth:2,url:"#job-and-storage",title:(0,V.jsx)(V.Fragment,{children:"Job and storage"})},{depth:2,url:"#person",title:(0,V.jsx)(V.Fragment,{children:"Person"})}];function d5(a){let b={code:"code",h2:"h2",p:"p",...a.components};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(b.p,{children:"Apply the section your change touches. Done when the code and that section describe the same behavior."}),"\n",(0,V.jsx)(b.h2,{id:"flow",children:"Flow"}),"\n",(0,V.jsx)(b.p,{children:"The engine rereads a restricted TypeScript flow from the start. The function may open a step, open an optional step, open a detached step, open child entities from the typed body, wait for a group, choose one named arm, finish, or declare failure. It reads sealed reports. The client database, secrets, and the clock stay outside the function."}),"\n",(0,V.jsx)(b.p,{children:"The same sealed reports open the same steps. An opening already made stays in place. A choice records its arms in the order they are written. One name takes one arm. The other arms name their steps as discarded. A discarded step is not opened: it sends no job, and silence does not send it again."}),"\n",(0,V.jsx)(b.h2,{id:"step-and-group",children:"Step and group"}),"\n",(0,V.jsxs)(b.p,{children:["One step resumes when its result is there. ",(0,V.jsx)(b.code,{children:"openStep"})," does this. A failed required step ends the run in failure and does not open the continuation. A not finished required step ends the run not finished."]}),"\n",(0,V.jsxs)(b.p,{children:[(0,V.jsx)(b.code,{children:"openOptionalStep"})," waits the same way. A failed result and a not finished result are returned and do not stop the run. ",(0,V.jsx)(b.code,{children:"openDetachedStep"})," enqueues the job and does not wait. Its result does not stop the run. A result that arrives after the run has ended is recorded on that step and does not reread the function."]}),"\n",(0,V.jsxs)(b.p,{children:["Several openings form a group. The group waits until every required member is done. A required member is an ",(0,V.jsx)(b.code,{children:"openStep"})," or a child opening. An optional step is waited on and does not count. Success is a result whose status is done, a single child run whose status is success, or an array of children whose report is sealed. The first required failure ends the run in failure. The first required not finished, when nothing has failed, ends the run not finished. Inside the group, ",(0,V.jsx)(b.code,{children:"openStep"})," and ",(0,V.jsx)(b.code,{children:"openOptionalStep"})," open steps, and ",(0,V.jsx)(b.code,{children:"openChildren"})," and ",(0,V.jsx)(b.code,{children:"openOptionalChildren"})," open child entities. A group does not open a detached step."]}),"\n",(0,V.jsxs)(b.p,{children:["When the group is satisfied the report is sealed: end reason, counts, and the discriminant of each member already returned. A child member contributes one element per child, with that child's flow. A late result is recorded on its step. The sealed report stays as sealed. When the run stops because a required member failed or is not finished, still-open required and optional steps close as not finished with discriminant ",(0,V.jsx)(b.code,{children:"ended"}),". Detached steps stay open."]}),"\n",(0,V.jsxs)(b.p,{children:["A step declares the shape of its body and of the payload that opens it. A body outside that shape ends the step as failed. A payload outside its shape does not open the step. A later reread compares the same payload. The worker receives it with the step. ",(0,V.jsx)(b.code,{children:"finish"})," keeps its discriminant and stores a body checked by the flow's return schema."]}),"\n",(0,V.jsxs)(b.p,{children:["One child opened on the flow resumes when that child's result is there. A failed required child ends the parent in failure. A not finished required child ends the parent not finished. An optional child returns that result and does not stop the parent. Several child entities opened together carry one rule, the same on ",(0,V.jsx)(b.code,{children:"openChildren"})," and ",(0,V.jsx)(b.code,{children:"openOptionalChildren"}),". The omitted rule is that every child run succeeds. The call may pass a quota: a count, capped at the number of children, or a proportion, whose target is that proportion of the children rounded up. Either form may name ",(0,V.jsx)(b.code,{children:"withinMin"}),", whole minutes from the moment the children open. Only a successful child run counts toward the target. A required opening seals when the target is met. It stops the parent when the target can no longer be met, or when ",(0,V.jsx)(b.code,{children:"withinMin"})," is reached with the target unmet. Before that time, a failure stops a required ",(0,V.jsx)(b.code,{children:"all"})," as failure, and a not finished child stops it as not finished. An optional opening seals and the parent continues: ",(0,V.jsx)(b.code,{children:"quota"})," when the target is met or can no longer be met, ",(0,V.jsx)(b.code,{children:"deadline"})," when ",(0,V.jsx)(b.code,{children:"withinMin"})," is reached first, and ",(0,V.jsx)(b.code,{children:"all"})," when every child of an ",(0,V.jsx)(b.code,{children:"all"})," opening has ended. A failure does not seal an optional ",(0,V.jsx)(b.code,{children:"all"})," early. Children still open stay out of the sealed report. A result that arrives later does not change it. A child takes the identity and starting data of its element. The parent reads the child's typed body."]}),"\n",(0,V.jsx)(b.h2,{id:"run",children:"Run"}),"\n",(0,V.jsxs)(b.p,{children:["Success: the function runs to the end, by returning or by ",(0,V.jsx)(b.code,{children:"finish()"}),". ",(0,V.jsx)(b.code,{children:"finish"})," may name the flow's return and store a body. A parent of one child reads that name as the discriminant and reads the body. Without a name, the discriminant stays success."]}),"\n",(0,V.jsx)(b.p,{children:"Failure: a required step or a single required child failed, a required array of children missed its rule, or the function declares failure."}),"\n",(0,V.jsx)(b.p,{children:"Not finished: a required step or a single required child is not finished, before the children's duration. An optional step does not do that. A detached step does not do that. An optional child does not do that. A quota does not treat not finished as success."}),"\n",(0,V.jsx)(b.h2,{id:"entity",children:"Entity"}),"\n",(0,V.jsx)(b.p,{children:"The entity key is organization, flow, and identity. One run at a time. Other requests wait. The run keeps the first request's starting data."}),"\n",(0,V.jsx)(b.p,{children:"Two identical lines of one list join that one execution and receive the same result."}),"\n",(0,V.jsx)(b.h2,{id:"validity-duration",children:"Validity duration"}),"\n",(0,V.jsx)(b.p,{children:"Validity duration is on the flow."}),"\n",(0,V.jsx)(b.p,{children:"On success, the duration runs from the end. A request inside the duration receives the recorded result, starts no run, and leaves the client database unread."}),"\n",(0,V.jsx)(b.p,{children:"The next request starts a run with its own starting data when the run is a failure, not finished, the duration has passed, or the flow has no duration. Passing the duration leaves the displayed run in place until that request."}),"\n",(0,V.jsx)(b.p,{children:"A parent whose run has ended stays ended when another requester starts a new run of a child."}),"\n",(0,V.jsx)(b.p,{children:"The entity shows the current run and the validity end. Until a new run starts, an expired run stays displayed with its end in the past."}),"\n",(0,V.jsx)(b.h2,{id:"silence",children:"Silence"}),"\n",(0,V.jsx)(b.p,{children:"Silence is per opened step. The silence duration and the resend maximum come from the entity's starting data."}),"\n",(0,V.jsx)(b.p,{children:"Without a result at that time, the orchestrator sends the same job again. At the resend maximum the step result is not finished."}),"\n",(0,V.jsxs)(b.p,{children:["An array of children whose rule names ",(0,V.jsx)(b.code,{children:"withinMin"})," is judged when that duration is reached. A required opening fails when the target is still unmet. An optional opening seals with end reason ",(0,V.jsx)(b.code,{children:"deadline"}),"."]}),"\n",(0,V.jsx)(b.h2,{id:"rate-limit",children:"Rate limit"}),"\n",(0,V.jsxs)(b.p,{children:["A rate limit is on the step definition: ",(0,V.jsx)(b.code,{children:"max"})," jobs and a duration ",(0,V.jsx)(b.code,{children:"durationMs"}),". ",(0,V.jsx)(b.code,{children:"bindOrganization"})," copies it onto every bound step of that definition. Aliases share the definition and the kind, so they share the limit. The kind is one queue for that organization and that step definition, so every flow that opens the step shares the limit. A step definition with no rate limit has no limit."]}),"\n",(0,V.jsxs)(b.p,{children:["The orchestrator sends the job when the step opens. The limit gates when a worker starts it. ",(0,V.jsx)(b.code,{children:"createStepWorker"})," passes BullMQ ",(0,V.jsx)(b.code,{children:"limiter"})," with that ",(0,V.jsx)(b.code,{children:"max"})," and with ",(0,V.jsx)(b.code,{children:"duration"})," set to ",(0,V.jsx)(b.code,{children:"durationMs"}),". BullMQ keeps one counter in Redis for that queue. Every worker of the kind increments the same counter when it moves a job to active. The first start in a window sets the counter to expire after ",(0,V.jsx)(b.code,{children:"durationMs"}),". At ",(0,V.jsx)(b.code,{children:"max"}),", further jobs stay waiting until the key expires and the next window starts."]}),"\n",(0,V.jsx)(b.p,{children:"Concurrency is how many jobs one worker runs at once. The rate limit is how many jobs the kind starts during one window, across every worker of that kind. Ten workers, each with concurrency 1, and a rate limit of 8 jobs per 1000 ms, start at most 8 jobs of that kind in the window. A concurrency override on a worker changes only that worker's concurrency. The limit stays the one on the step definition. The shared count holds when every worker of the kind is started with that same limit."}),"\n",(0,V.jsx)(b.p,{children:"Starts at the end of one window and the start of the next can land close together. A job that keeps running past the window still counts as one start. Jobs already active run to the end."}),"\n",(0,V.jsx)(b.p,{children:"Each environment has its own queue, and that queue has its own counter."}),"\n",(0,V.jsx)(b.p,{children:"Silence runs from the opening. A job that stays waiting until the silence duration elapses is sent again. At the resend maximum the step result is not finished."}),"\n",(0,V.jsx)(b.h2,{id:"job-and-storage",children:"Job and storage"}),"\n",(0,V.jsxs)(b.p,{children:["BullMQ only transports the job. The job is organization, entity, and step. Secrets stay off the job. The worker loads that organization's secrets once when it starts and writes them into the environment. The dispatch value carries the starting data and the time, and it carries no secret. A step implementation reads one name with ",(0,V.jsx)(b.code,{children:"environment"})," in ",(0,V.jsx)(b.code,{children:"packages/contract/src/environment.ts"}),". A log replaces the value with ",(0,V.jsx)(b.code,{children:"••••"}),". A secret added or deleted is visible at the next start of the worker. Each bound step names a kind. The orchestrator sends that job to the Redis queue for that kind. A worker pulls. It does not push when a worker appears, and the HTTP server does not start a worker. Connected workers are presence, not a condition for opening a step. Silence, a resend, and not finished stay on the opened step: a resend is a new job, and the queue does not retry. Postgres keeps the current flow run, one row per entity, plus parent and child links, memberships, and secrets. Each row is carried by its organization. The application stores each secret as given. A transition loads that entity, the children named in its tree, and its running parents. The HTTP server reads that entity row on each read. Entity counts and running counts are cached for a few seconds. After the commit, each new flow metric and step metric is appended to Redis and inserted into ClickHouse in batches. The engine rereads the result on the entity row. It does not reread the metric."]}),"\n",(0,V.jsx)(b.p,{children:"A step may write a transient file for a later step of the same run. The names it writes travel with the result and stay on the step. A replay from a step copies those kept names into the new generation before that generation's jobs are sent. A full replay starts empty and does not copy. It receives the time the orchestrator runs the job. A second run of that step keeps a single effect. The orchestrator records the step when it accepts the result. When a step throws, that result is failed and its discriminant is the error message. A held step stays open."}),"\n",(0,V.jsx)(b.h2,{id:"person",children:"Person"}),"\n",(0,V.jsxs)(b.p,{children:["Tests start the first run through the internal function ",(0,V.jsx)(b.code,{children:"startRun"}),". A run starts from that function."]}),"\n",(0,V.jsx)(b.p,{children:"A person sees entities, the operation tree, steps and their progress, the current wait, children, the validity end, the flow source, and the transient files of a stored flow run. The Secrets page lists that organization's secrets. A person can add one and delete one. Entity, source, and flow reads do not include a secret. A discarded step stays in that tree and is marked discarded. The Flows page shows flow runs and step runs for a period: counts, failure rate, p50, and the trend come from ClickHouse, and the entity count and running come from Postgres. A person can open the first entity of a flow, replay a flow, replay from a step, resend a job, run a step without applying its result, cancel a run or an open step, and end a validity. The first opening is that request: an open run waits, and inside the validity duration the recorded result is returned."})]})}function d6(a={}){let{wrapper:b}=a.components||{};return b?(0,V.jsx)(b,{...a,children:(0,V.jsx)(d5,{...a})}):d5(a)}let d7=require("fs");var d8=new Map;let d9=({doc:a=>a.map(a=>{let{default:b,frontmatter:c,...d}=a.data;return{body:b,...d,...c,_file:a.info,_exports:a.data,get content(){let a=this._file.absolutePath,b=d8.get(a);if(b)return b;let c=d7.readFileSync(a).toString();return d8.set(a,c),c}}}),meta:a=>a.map(a=>({...a.data,_file:a.info})),docs(a,b){let c=this.doc(a),d=this.meta(b);return{docs:c,meta:d,toFumadocsSource:()=>(function(a,b=[]){return{files:()=>(function({docs:a,meta:b}){let c=[];for(let b of a)c.push({type:"page",absolutePath:b._file.absolutePath,path:b._file.path,data:b});for(let a of b)c.push({type:"meta",absolutePath:a._file.absolutePath,path:a._file.path,data:a});return c})({docs:a,meta:b})}})(c,d)}}}).docs([{info:{path:"engine.mdx",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/engine.mdx"},data:U},{info:{path:"fixture.mdx",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/fixture.mdx"},data:T},{info:{path:"index.mdx",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/index.mdx"},data:S},{info:{path:"install.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/install.md"},data:R},{info:{path:"server.mdx",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/server.mdx"},data:Q},{info:{path:"adr/0001-restricted-process-function.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0001-restricted-process-function.md"},data:P},{info:{path:"adr/0002-entity-key.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0002-entity-key.md"},data:O},{info:{path:"adr/0003-metrics-apart-from-the-run.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0003-metrics-apart-from-the-run.md"},data:N},{info:{path:"adr/0004-one-row-per-entity.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0004-one-row-per-entity.md"},data:M},{info:{path:"adr/0005-orchestrator-applies-results.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0005-orchestrator-applies-results.md"},data:L},{info:{path:"adr/0006-one-identity-one-entity.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0006-one-identity-one-entity.md"},data:K},{info:{path:"adr/0007-historized-flow-runs.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0007-historized-flow-runs.md"},data:J},{info:{path:"adr/0008-guard-and-each.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0008-guard-and-each.md"},data:I},{info:{path:"adr/0009-transient-files.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0009-transient-files.md"},data:H},{info:{path:"adr/0010-entity-values-copied-onto-the-run.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0010-entity-values-copied-onto-the-run.md"},data:G},{info:{path:"adr/0011-a-diverged-reread-ends-the-run.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0011-a-diverged-reread-ends-the-run.md"},data:F},{info:{path:"adr/0012-a-step-name-once-per-run.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0012-a-step-name-once-per-run.md"},data:E},{info:{path:"adr/0013-a-run-does-not-wait-on-its-ancestor.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0013-a-run-does-not-wait-on-its-ancestor.md"},data:D},{info:{path:"adr/0014-a-shared-child-is-claimed-before-its-run.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0014-a-shared-child-is-claimed-before-its-run.md"},data:C},{info:{path:"adr/0015-jobs-and-metrics-leave-with-the-run.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0015-jobs-and-metrics-leave-with-the-run.md"},data:B},{info:{path:"adr/0016-one-writer-per-organization.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0016-one-writer-per-organization.md"},data:A},{info:{path:"adr/0017-group-judgment.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0017-group-judgment.md"},data:z},{info:{path:"adr/0018-replay-copies-files.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0018-replay-copies-files.md"},data:y},{info:{path:"adr/0019-typed-body.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0019-typed-body.md"},data:x},{info:{path:"adr/0020-rule-on-each-opening.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0020-rule-on-each-opening.md"},data:w},{info:{path:"adr/0021-optional-children.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0021-optional-children.md"},data:u},{info:{path:"adr/0022-optional-quota.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0022-optional-quota.md"},data:t},{info:{path:"adr/0023-sealed-report-returns.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0023-sealed-report-returns.md"},data:s},{info:{path:"adr/0024-one-silence-per-opening.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0024-one-silence-per-opening.md"},data:r},{info:{path:"adr/0025-environment-variables.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0025-environment-variables.md"},data:q},{info:{path:"adr/0026-runtime-revision-excludes-platform-and-device.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0026-runtime-revision-excludes-platform-and-device.md"},data:p},{info:{path:"adr/0027-one-router-consumes-a-slot.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0027-one-router-consumes-a-slot.md"},data:o},{info:{path:"adr/0028-caddy-desktop-placement.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0028-caddy-desktop-placement.md"},data:n},{info:{path:"adr/0029-registry-client-or-login.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0029-registry-client-or-login.md"},data:m},{info:{path:"adr/0030-organization-code-outside-the-repository.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0030-organization-code-outside-the-repository.md"},data:l},{info:{path:"adr/0031-environment-reload.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0031-environment-reload.md"},data:k},{info:{path:"adr/0032-an-orchestrator-fault-stops-the-run.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0032-an-orchestrator-fault-stops-the-run.md"},data:j},{info:{path:"adr/0033-one-rule-for-children.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/0033-one-rule-for-children.md"},data:i},{info:{path:"agents/domain.md",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/agents/domain.md"},data:h},{info:{path:"usage/actions.mdx",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/usage/actions.mdx"},data:g},{info:{path:"usage/drivers.mdx",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/usage/drivers.mdx"},data:f},{info:{path:"usage/flow.mdx",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/usage/flow.mdx"},data:e},{info:{path:"usage/kinds.mdx",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/usage/kinds.mdx"},data:d}],[{info:{path:"meta.json",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/meta.json"},data:{title:"Orchestrator",pages:["index","server","engine","fixture","usage","adr"]}},{info:{path:"adr/meta.json",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/adr/meta.json"},data:{title:"Decisions",pages:["0001-restricted-process-function","0002-entity-key","0003-metrics-apart-from-the-run","0004-one-row-per-entity"]}},{info:{path:"usage/meta.json",absolutePath:"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/docs/usage/meta.json"},data:{title:"Usage",pages:["flow","actions","drivers"]}}]);function ea(a,b){let c=a.lastIndexOf("/");return a.substring(-1===c?0:c+1,b?a.length-b.length:a.length)}function eb(a){let b=a.lastIndexOf(".");return -1!==b?a.substring(b):""}function ec(a){return a.split("/").slice(0,-1).join("/")}function ed(a){let b=eb(a),c=ea(a,b),d=ec(a);return{dirname:d,name:c,ext:b,path:a,get flattenedPath(){return[d,c].filter(a=>a.length>0).join("/")}}}function ee(a){return a.split("/").filter(a=>a.length>0)}function ef(...a){let b=[];for(let c of a.flatMap(ee))switch(c){case"..":b.pop();break;case".":break;default:b.push(c)}return b.join("/")}function eg(a){return a.startsWith("\\\\?\\")?a:a.replaceAll("\\","/")}(0,c(95980).VA)({},{basename:()=>ea,dirname:()=>ec,extname:()=>eb,joinPath:()=>ef,parseFilePath:()=>ed,slash:()=>eg,splitPath:()=>ee});var eh=/^\((?<name>.+)\)$/,ei=/^(?:\[(?<icon>[^\]]+)])?\[(?<name>[^\]]+)]\((?<url>[^)]+)\)$/,ej=/^---(?:\[(?<icon>[^\]]+)])?(?<name>.+)---|^---$/,ek="z...a";function el(a,b,c=!1){let d=[],e=[];for(let f of a.sort((a,b)=>a.localeCompare(b)*(c?-1:1))){b.visitedPaths.add(f);let a=en(f,b);if(a){"index"===ea(f,eb(f))?d.unshift(a):d.push(a);continue}let c=em(f,!1,b);c&&e.push(c)}return[...d,...e]}function em(a,b,c){let d,e,{storage:f,options:g,resolveName:h,transformers:i}=c,j=f.readDir(a);if(!j)return;let k=h(ef(a,"meta"),"meta"),l=h(ef(a,"index"),"page"),m=f.read(k);m?.format!=="meta"&&(m=void 0);let n=m?.data.root??b;function o(){n||c.visitedPaths.has(l)||(c.visitedPaths.add(l),d=en(l,c))}if(m&&m.data.pages){let b=m.data.pages.flatMap((b,d)=>(function(a,b,c,d){if("..."===b||b===ek)return b;let{resolveName:e}=c,f=ej.exec(b);if(f?.groups){let b={$id:`${a}#${d}`,type:"separator",icon:f.groups.icon,name:f.groups.name};for(let a of c.transformers)a.separator&&(b=a.separator.call(c,b));return[b]}if(f=ei.exec(b),f?.groups){let{icon:a,url:b,name:d}=f.groups,e=b.startsWith("/")||b.startsWith("#")||b.startsWith("."),g={type:"page",icon:a,name:d,url:b,external:!e};for(let a of c.transformers)a.file&&(g=a.file.call(c,g));return[g]}let g=b.startsWith("!"),h=!g&&b.startsWith("..."),i=b;g?i=b.slice(1):h&&(i=b.slice(3));let j=e(ef(a,i),"page");if(c.visitedPaths.add(j),g)return[];let k=em(j,!1,c);if(k)return h?k.children:[k];let l=en(j,c);return l?[l]:[]})(a,b,c,d));o();for(let a=0;a<b.length;a++){let d=b[a];if("..."!==d&&d!==ek)continue;let e=el(j.filter(a=>!c.visitedPaths.has(a)),c,d===ek);b.splice(a,1,...e);break}e=b}else o(),e=el(j.filter(a=>!c.visitedPaths.has(a)),c);let p=m?.data.title??d?.name;if(!p){let b=ea(a);p=eo(eh.exec(b)?.[1]??b)}let q={type:"folder",name:p,icon:m?.data.icon??d?.icon,root:m?.data.root,defaultOpen:m?.data.defaultOpen,description:m?.data.description,index:d,children:e,$id:a,$ref:!g.noRef&&m?{metaFile:k}:void 0};for(let b of i)b.folder&&(q=b.folder.call(c,q,a,k));return q}function en(a,b){let{options:c,getUrl:d,storage:e,locale:f,transformers:g}=b,h=e.read(a);if(h?.format!=="page")return;let{title:i,description:j,icon:k}=h.data,l={$id:a,type:"page",name:i??eo(ea(a,eb(a))),description:j,icon:k,url:d(h.slugs,f),$ref:c.noRef?void 0:{file:a}};for(let c of g)c.file&&(l=c.file.call(b,l,a));return l}function eo(a){let b=[];for(let c of a)0===b.length?b.push(c.toLocaleUpperCase()):"-"===c?b.push(" "):b.push(c);return b.join("")}var ep=class{constructor(a){if(this.files=new Map,this.folders=new Map,a){for(let[b,c]of a.folders)this.folders.set(b,c);for(let[b,c]of a.files)this.files.set(b,c)}else this.folders.set("",[])}read(a){return this.files.get(a)}readDir(a){return this.folders.get(a)}write(a,b){if(!this.files.has(a)){let b=ec(a);this.makeDir(b),this.readDir(b)?.push(a)}this.files.set(a,b)}delete(a,b=!1){if(this.files.delete(a))return!0;if(b){let b=this.folders.get(a);if(!b)return!1;for(let c of(this.folders.delete(a),b))this.delete(c);return!0}return!1}getFiles(){return Array.from(this.files.keys())}makeDir(a){let b=ee(a);for(let a=0;a<b.length;a++){let c=b.slice(0,a+1).join("/");this.folders.has(c)||(this.folders.set(c,[]),this.folders.get(ec(c)).push(c))}}};function eq(a){return a.length>0&&!/\d+/.test(a)}var er={dir(a){let[b,...c]=a.split("/");return b&&c.length>0&&eq(b)?[c.join("/"),b]:[a]},dot(a){let b=ec(a),c=ea(a).split(".");if(c.length<3)return[a];let[d]=c.splice(c.length-2,1);return eq(d)?[ef(b,c.join(".")),d]:[a]},none:a=>[a]},es={pre:1,default:0,post:-1},et=/^\(.+\)$/;function eu(a){if("string"!=typeof a)return eu(a.path);let b=ec(a),c=ea(a,eb(a)),d=[];for(let a of b.split("/"))a.length>0&&!et.test(a)&&d.push(encodeURI(a));if(et.test(c))throw Error(`Cannot use folder group in file names: ${a}`);return"index"!==c&&d.push(encodeURI(c)),d}function ev(a){return{transformPageTree:a}}function ew(a,{slugs:b,icon:c,plugins:d=[],baseUrl:e,url:f,...g}){let h=f?(...a)=>{var b;return(b=f(...a)).startsWith("http://")||b.startsWith("https://")||(b.startsWith("/")||(b="/"+b),b.length>1&&b.endsWith("/")&&(b=b.slice(0,-1))),b}:function(a,b){let c=a.split("/");return(a,d)=>{let e,f=b?.hideLocale??"never";"never"===f?e=d:"default-locale"===f&&d!==b?.defaultLanguage&&(e=d);let g=[...c,...a];return e&&g.unshift(e),`/${g.filter(a=>a.length>0).join("/")}`}}(e,g.i18n),i={...g,url:h,source:a,plugins:function(a){let b=[];for(let c of a)Array.isArray(c)?b.push(...c):c&&b.push(c);return b.sort((a,b)=>es[b.enforce??"default"]-es[a.enforce??"default"])}([{name:"fumadocs:slugs",transformStorage({storage:a}){let c=new Set,d=new Set,e=void 0===b;for(let f of a.getFiles()){let g=a.read(f);if(!g||"page"!==g.format||g.slugs)continue;if("index"===ea(f,eb(f))&&e){c.add(f);continue}g.slugs=b?b(ed(f)):eu(f);let h=g.slugs.join("/");if(d.has(h))throw Error("Duplicated slugs");d.add(h)}for(let b of c){let c=a.read(b);c?.format==="page"&&(c.slugs=eu(b),d.has(c.slugs.join("/"))&&c.slugs.push("index"))}}},c&&function(a){function b(b){return(void 0===b.icon||"string"==typeof b.icon)&&(b.icon=a(b.icon)),b}return{name:"fumadocs:icon",transformPageTree:{file:b,folder:b,separator:b}}}(c),function({pageTree:a,transformers:b}){let c=[];if(a){let{attachFile:b,attachSeparator:d,attachFolder:e,transformers:f}=a;for(let a of f??[])c.push(ev(a));c.push(ev({file(a,c){if(!b)return a;let d=c?this.storage.read(c):void 0;return b(a,d?.format==="page"?d:void 0)},folder(a,b,c){if(!e)return a;let d=this.storage.readDir(b)??[],f=c?this.storage.read(c):void 0;return e(a,{children:d.flatMap(a=>this.storage.read(a)??[])},f?.format==="meta"?f:void 0)},separator:a=>d?d(a):a}))}if(b)for(let a of b)c.push({transformStorage:a});return c}(g),...d])};for(let a of i.plugins??[]){let b=a.config?.(i);b&&(i=b)}return i}let ex=function(...a){return function({source:{files:a},url:b,i18n:c,plugins:d=[],pageTree:e}){let f,g=c?.defaultLanguage??"",h=function(a,b,c,d){let e=er[d.parser??"dot"],f={},g=a.map(a=>b({...a,path:function(a){let b=ee(eg(a));if("."===b[0]||".."===b[0])throw Error("It must not start with './' or '../'");return b.join("/")}(a.path)})),h=null!==d.fallbackLanguage?d.fallbackLanguage??d.defaultLanguage:null;for(let a of d.languages)!function a(b){let i;if(f[b])return;for(let c of(h&&h!==b?(a(h),i=new ep(f[h])):i=new ep,g)){let[a,f=d.defaultLanguage]=e(c.path);f===b&&i.write(a,c)}let j={storage:i};for(let a of c)a.transformStorage?.(j);f[b]=i}(a);return f}(a,a=>"page"===a.type?{format:"page",path:a.path,slugs:a.slugs,data:a.data,absolutePath:a.absolutePath??""}:{format:"meta",path:a.path,absolutePath:a.absolutePath??"",data:a.data},d,c??{defaultLanguage:g,parser:"none",languages:[g]}),i=function(a,b){let c={pages:new Map,pathToMeta:new Map,pathToPage:new Map};for(let[h,i]of Object.entries(a))for(let a of i.getFiles()){var d,e,f,g;let j=i.read(a),k=`${h}.${a}`;if("meta"===j.format){c.pathToMeta.set(k,{path:(d=j).path,absolutePath:d.absolutePath,get file(){return ed(this.path)},data:d.data});continue}let l=(e=j,f=b,g=h,{get file(){return ed(this.path)},absolutePath:e.absolutePath,path:e.path,url:f(e.slugs,g),slugs:e.slugs,data:e.data,locale:g});c.pathToPage.set(k,l),c.pages.set(`${h}.${l.slugs.join("/")}`,l)}return c}(h,b),j={build(a,b){return this.buildI18n({"":a},b)[""]},buildI18n(a,c={}){let{id:e,generateFallback:f=!0}=c,g=function(a){let b=[];for(let a of d??[])a.transformPageTree&&b.push(a.transformPageTree);return a&&b.push(function(){let a=new Set;return{root(b){let c=new ep;for(let b of this.storage.getFiles()){if(a.has(b))continue;let d=this.storage.read(b);d&&c.write(b,d)}return 0===c.getFiles().length||(b.fallback=this.builder.build(c,{...this.options,id:`fallback-${b.$id??""}`,generateFallback:!1}),a.clear()),b},file:(b,c)=>(c&&a.add(c),b),folder:(b,c,d)=>(d&&a.add(d),b)}}()),b}(f),h={};for(let[d,f]of Object.entries(a)){let i=function(a){let b=new Map;for(let c of a.getFiles()){let d=a.read(c),e=c.substring(0,c.length-eb(c).length);b.set(e+"."+d.format,c)}return(a,c)=>b.get(a+"."+c)}(f),j=0===d.length?"root":d;h[d]=function(a,b){let c=em("",!0,b),d={$id:a,name:c.name||"Docs",children:c.children};for(let a of b.transformers)a.root&&(d=a.root.call(b,d));return d}(e?`${e}-${j}`:j,{transformers:g,builder:this,options:c,getUrl:b,locale:d,storage:f,storages:a,visitedPaths:new Set,resolveName:(a,b)=>i(a,b)??a})}return h}};return{_i18n:c,get pageTree(){return f??=j.buildI18n(h,e),c?f:f[g]},set pageTree(v){f=c?v:{[g]:v}},getPageByHref(a,{dir:b="",language:c=g}={}){let d,[e,f]=a.split("#",2);if(e.startsWith(".")&&(e.endsWith(".md")||e.endsWith(".mdx"))){let a=ef(b,e);d=i.pathToPage.get(`${c}.${a}`)}else d=this.getPages(c).find(a=>a.url===e);if(d)return{page:d,hash:f}},getPages(a){let b=[];for(let[c,d]of i.pages.entries())(void 0===a||c.startsWith(`${a}.`))&&b.push(d);return b},getLanguages(){let a=[];if(!c)return a;for(let b of c.languages)a.push({language:b,pages:this.getPages(b)});return a},getPage:(a=[],b=g)=>i.pages.get(`${b}.${a.join("/")}`),getNodeMeta(a,b=g){let c=a.$ref?.metaFile;if(c)return i.pathToMeta.get(`${b}.${c}`)},getNodePage(a,b=g){let c=a.$ref?.file;if(c)return i.pathToPage.get(`${b}.${c}`)},getPageTree(a){return c?this.pageTree[a??g]:this.pageTree},generateParams(a,b){return c?this.getLanguages().flatMap(c=>c.pages.map(d=>({[a??"slug"]:d.slugs,[b??"lang"]:c.language}))):this.getPages().map(b=>({[a??"slug"]:b.slugs}))}}}(2===a.length?ew(a[0],a[1]):ew(a[0].source,a[0]))}({baseUrl:"/docs",source:{files:function(a){let b=a.files;return"function"==typeof b?b():b}(d9.toFumadocsSource())}})},35396:(a,b,c)=>{"use strict";c.r(b),c.d(b,{I18nContext:()=>f,I18nLabel:()=>g,defaultTranslations:()=>e,useI18n:()=>h});var d=c(71935);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call defaultTranslations() from the server but defaultTranslations is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/contexts/i18n.js","defaultTranslations"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call I18nContext() from the server but I18nContext is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/contexts/i18n.js","I18nContext"),g=(0,d.registerClientReference)(function(){throw Error("Attempted to call I18nLabel() from the server but I18nLabel is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/contexts/i18n.js","I18nLabel"),h=(0,d.registerClientReference)(function(){throw Error("Attempted to call useI18n() from the server but useI18n is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/contexts/i18n.js","useI18n")},38629:(a,b,c)=>{"use strict";c.d(b,{ThemeToggle:()=>d});let d=(0,c(71935).registerClientReference)(function(){throw Error("Attempted to call ThemeToggle() from the server but ThemeToggle is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/theme-toggle.js","ThemeToggle")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},42122:(a,b,c)=>{"use strict";c.d(b,{LanguageToggle:()=>i,LanguageToggleText:()=>j});var d=c(5009),e=c(38002),f=c(93586),g=c(17265),h=c(21603);function i(a){let b=(0,e.useI18n)();if(!b.locales)throw Error("Missing `<I18nProvider />`");return(0,d.jsxs)(f.AM,{children:[(0,d.jsx)(f.Wv,{"aria-label":b.text.chooseLanguage,...a,className:(0,g.QP)((0,h.r)({color:"ghost",className:"gap-1.5 p-1.5"}),a.className),children:a.children}),(0,d.jsxs)(f.hl,{className:"flex flex-col overflow-hidden p-0",children:[(0,d.jsx)("p",{className:"mb-1 p-2 text-xs font-medium text-fd-muted-foreground",children:b.text.chooseLanguage}),b.locales.map(a=>(0,d.jsx)("button",{type:"button",className:(0,g.QP)("p-2 text-start text-sm",a.locale===b.locale?"bg-fd-primary/10 font-medium text-fd-primary":"hover:bg-fd-accent hover:text-fd-accent-foreground"),onClick:()=>{b.onChange?.(a.locale)},children:a.name},a.locale))]})]})}function j(a){let b=(0,e.useI18n)(),c=b.locales?.find(a=>a.locale===b.locale)?.name;return(0,d.jsx)("span",{...a,children:c})}},44195:(a,b,c)=>{Promise.resolve().then(c.bind(c,69212)),Promise.resolve().then(c.bind(c,42122)),Promise.resolve().then(c.bind(c,57024)),Promise.resolve().then(c.bind(c,58228)),Promise.resolve().then(c.bind(c,19998)),Promise.resolve().then(c.bind(c,19847)),Promise.resolve().then(c.bind(c,83792)),Promise.resolve().then(c.bind(c,47718)),Promise.resolve().then(c.bind(c,57696)),Promise.resolve().then(c.bind(c,23150))},44518:(a,b,c)=>{"use strict";c.d(b,{CollapsibleControl:()=>g,LayoutBody:()=>f,LayoutTabs:()=>h,Navbar:()=>e});var d=c(71935);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call Navbar() from the server but Navbar is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/layouts/docs/client.js","Navbar"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call LayoutBody() from the server but LayoutBody is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/layouts/docs/client.js","LayoutBody"),g=(0,d.registerClientReference)(function(){throw Error("Attempted to call CollapsibleControl() from the server but CollapsibleControl is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/layouts/docs/client.js","CollapsibleControl"),h=(0,d.registerClientReference)(function(){throw Error("Attempted to call LayoutTabs() from the server but LayoutTabs is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/layouts/docs/client.js","LayoutTabs")},45400:(a,b,c)=>{"use strict";c.d(b,{PageBreadcrumb:()=>j,PageFooter:()=>i,PageLastUpdate:()=>h,PageTOC:()=>k,PageTOCPopover:()=>g,PageTOCPopoverContent:()=>f,PageTOCPopoverTrigger:()=>e});var d=c(71935);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call PageTOCPopoverTrigger() from the server but PageTOCPopoverTrigger is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/layouts/docs/page-client.js","PageTOCPopoverTrigger"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call PageTOCPopoverContent() from the server but PageTOCPopoverContent is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/layouts/docs/page-client.js","PageTOCPopoverContent"),g=(0,d.registerClientReference)(function(){throw Error("Attempted to call PageTOCPopover() from the server but PageTOCPopover is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/layouts/docs/page-client.js","PageTOCPopover"),h=(0,d.registerClientReference)(function(){throw Error("Attempted to call PageLastUpdate() from the server but PageLastUpdate is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/layouts/docs/page-client.js","PageLastUpdate"),i=(0,d.registerClientReference)(function(){throw Error("Attempted to call PageFooter() from the server but PageFooter is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/layouts/docs/page-client.js","PageFooter"),j=(0,d.registerClientReference)(function(){throw Error("Attempted to call PageBreadcrumb() from the server but PageBreadcrumb is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/layouts/docs/page-client.js","PageBreadcrumb"),k=(0,d.registerClientReference)(function(){throw Error("Attempted to call PageTOC() from the server but PageTOC is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/layouts/docs/page-client.js","PageTOC")},47031:(a,b,c)=>{"use strict";c.d(b,{AT:()=>i,Bx:()=>j,EY:()=>o,N_:()=>p,R2:()=>n,RT:()=>l,ff:()=>q,lW:()=>m,rW:()=>k});var d=c(40239),e=c(70986),f=c(25475);let g={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},h=(a,b)=>{let c=(0,e.forwardRef)(({className:a,size:c=24,color:h="currentColor",children:i,...j},k)=>(0,d.jsxs)("svg",{ref:k,...g,width:c,height:c,stroke:h,className:(0,f.QP)("lucide",a),...j,children:[b.map(([a,b])=>(0,e.createElement)(a,b)),i]}));return c.displayName=a,c};h("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);let i=h("languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]),j=h("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);h("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),h("search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),h("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),h("moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),h("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),h("airplay",[["path",{d:"M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1",key:"ns4c3b"}],["path",{d:"m12 15 5 6H7Z",key:"14qnn2"}]]),h("menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]),h("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),h("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);let k=h("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),l=h("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);h("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);let m=h("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),n=h("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);h("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),h("clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"2"}]]),h("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),h("hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);let o=h("text",[["path",{d:"M15 18H3",key:"olowqp"}],["path",{d:"M17 6H3",key:"16j9eg"}],["path",{d:"M21 12H3",key:"2avoz0"}]]);h("file",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]),h("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]),h("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]),h("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);let p=h("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),q=h("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);h("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),h("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),h("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),h("trash-2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),h("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},49560:(a,b,c)=>{"use strict";function d(...a){return b=>{a.forEach(a=>{"function"==typeof a?a(b):a&&(a.current=b)})}}c.d(b,{P:()=>d})},53842:(a,b,c)=>{"use strict";c.d(b,{PageBreadcrumb:()=>D,PageFooter:()=>B,PageLastUpdate:()=>z,PageTOC:()=>E,PageTOCPopover:()=>y,PageTOCPopoverContent:()=>x,PageTOCPopoverTrigger:()=>u});var d=c(5009),e=c(78820),f=c(97469),g=c(69212),h=c(17265),i=c(38002),j=c(47718),k=c(54309),l=c(57317),m=c(83792),n=c(59384),o=c(8940),p=c(14495),q=c(85880),r=c(82425),s=c(68388);let t=(0,k.q6)("TocPopoverContext");function u(a){let{text:b}=(0,i.useI18n)(),{open:c}=t.use(),g=(0,r.a)(),k=(0,s.R3)(),l=(0,e.useMemo)(()=>g.findIndex(a=>k===a.url.slice(1)),[g,k]),m=(0,j.L)().at(-1),n=-1!==l&&!c;return(0,d.jsxs)(p.R6,{...a,className:(0,h.QP)("flex w-full h-(--fd-tocnav-height) items-center text-sm text-fd-muted-foreground gap-2.5 px-4 py-2.5 text-start focus-visible:outline-none [&_svg]:size-4 md:px-6",a.className),children:[(0,d.jsx)(w,{value:(l+1)/Math.max(1,g.length),max:1,className:(0,h.QP)("shrink-0",c&&"text-fd-primary")}),(0,d.jsxs)("span",{className:"grid flex-1 *:my-auto *:row-start-1 *:col-start-1",children:[(0,d.jsx)("span",{className:(0,h.QP)("truncate transition-all",c&&"text-fd-foreground",n&&"opacity-0 -translate-y-full pointer-events-none"),children:m?.name??b.toc}),(0,d.jsx)("span",{className:(0,h.QP)("truncate transition-all",!n&&"opacity-0 translate-y-full pointer-events-none"),children:g[l]?.title})]}),(0,d.jsx)(f.yQ,{className:(0,h.QP)("shrink-0 transition-transform mx-0.5",c&&"rotate-180")})]})}function w({value:a,strokeWidth:b=2,size:c=24,min:e=0,max:f=100,...g}){let h=a<e?e:a>f?f:a,i=(c-b)/2,j=2*Math.PI*i,k=h/f*j,l={cx:c/2,cy:c/2,r:i,fill:"none",strokeWidth:b};return(0,d.jsxs)("svg",{role:"progressbar",viewBox:`0 0 ${c} ${c}`,"aria-valuenow":h,"aria-valuemin":e,"aria-valuemax":f,...g,children:[(0,d.jsx)("circle",{...l,className:"stroke-current/25"}),(0,d.jsx)("circle",{...l,stroke:"currentColor",strokeDasharray:j,strokeDashoffset:j-k,strokeLinecap:"round",transform:`rotate(-90 ${c/2} ${c/2})`,className:"transition-all"})]})}function x(a){return(0,d.jsx)(p.Ke,{"data-toc-popover":"",...a,className:(0,h.QP)("flex flex-col px-4 max-h-[50vh] md:px-6",a.className),children:a.children})}function y(a){let b=(0,e.useRef)(null),[c,f]=(0,e.useState)(!1),{collapsed:g}=(0,q.c)(),{isTransparent:i}=(0,m.hI)();return(0,o.J)(a=>{c&&b.current&&!b.current.contains(a.target)&&f(!1)}),(0,d.jsx)(t.Provider,{value:(0,e.useMemo)(()=>({open:c,setOpen:f}),[f,c]),children:(0,d.jsx)(p.Nt,{open:c,onOpenChange:f,asChild:!0,children:(0,d.jsx)("header",{ref:b,id:"nd-tocnav",...a,className:(0,h.QP)("fixed pr-(--removed-body-scroll-bar-size,0) z-10 border-b backdrop-blur-sm transition-colors xl:hidden max-xl:on-root:[--fd-tocnav-height:40px]",(!i||c)&&"bg-fd-background/80",c&&"shadow-lg",a.className),style:{...a.style,top:"calc(var(--fd-banner-height) + var(--fd-nav-height))",insetInlineStart:g?"0px":"calc(var(--fd-sidebar-width) + var(--fd-layout-offset))",insetInlineEnd:0},children:a.children})})})}function z({date:a,...b}){let{text:c}=(0,i.useI18n)(),[f,g]=(0,e.useState)("");return(0,d.jsxs)("p",{...b,className:(0,h.QP)("text-sm text-fd-muted-foreground",b.className),children:[c.lastUpdate," ",f]})}let A=new Map;function B({items:a,...b}){let{root:c}=(0,j.t)(),f=(0,k.a8)(),{previous:g,next:i}=(0,e.useMemo)(()=>{if(a)return a;let b=A.get(c.$id)??function a(b){let c=[];return b.forEach(b=>{if("folder"===b.type){b.index&&c.push(b.index),c.push(...a(b.children));return}"page"!==b.type||b.external||c.push(b)}),c}(c.children);A.set(c.$id,b);let d=b.findIndex(a=>(0,n.$)(a.url,f,!1));return -1===d?{}:{previous:b[d-1],next:b[d+1]}},[a,f,c]);return(0,d.jsxs)("div",{...b,className:(0,h.QP)("@container grid gap-4 pb-6",g&&i?"grid-cols-2":"grid-cols-1",b.className),children:[g?(0,d.jsx)(C,{item:g,index:0}):null,i?(0,d.jsx)(C,{item:i,index:1}):null]})}function C({item:a,index:b}){let{text:c}=(0,i.useI18n)(),e=0===b?f.JG:f.c_;return(0,d.jsxs)(g.default,{href:a.url,className:(0,h.QP)("flex flex-col gap-2 rounded-lg border p-4 text-sm transition-colors hover:bg-fd-accent/80 hover:text-fd-accent-foreground @max-lg:col-span-full",1===b&&"text-end"),children:[(0,d.jsxs)("div",{className:(0,h.QP)("inline-flex items-center gap-1.5 font-medium",1===b&&"flex-row-reverse"),children:[(0,d.jsx)(e,{className:"-mx-1 size-4 shrink-0 rtl:rotate-180"}),(0,d.jsx)("p",{children:a.name})]}),(0,d.jsx)("p",{className:"text-fd-muted-foreground truncate",children:a.description??(0===b?c.previousPage:c.nextPage)})]})}function D({includeRoot:a,includeSeparator:b,includePage:c,...i}){let k=(0,j.L)(),{root:m}=(0,j.t)(),n=(0,e.useMemo)(()=>(0,l.Pp)(m,k,{includePage:c,includeSeparator:b,includeRoot:a}),[c,a,b,k,m]);return 0===n.length?null:(0,d.jsx)("div",{...i,className:(0,h.QP)("flex items-center gap-1.5 text-sm text-fd-muted-foreground",i.className),children:n.map((a,b)=>{let c=(0,h.QP)("truncate",b===n.length-1&&"text-fd-primary font-medium");return(0,d.jsxs)(e.Fragment,{children:[0!==b&&(0,d.jsx)(f.c_,{className:"size-3.5 shrink-0"}),a.url?(0,d.jsx)(g.default,{href:a.url,className:(0,h.QP)(c,"transition-opacity hover:opacity-80"),children:a.name}):(0,d.jsx)("span",{className:c,children:a.name})]},b)})})}function E(a){let{collapsed:b}=(0,q.c)();return(0,d.jsx)("div",{id:"nd-toc",...a,className:(0,h.QP)("fixed bottom-0 pt-12 pb-2 pr-(--removed-body-scroll-bar-size,0) max-xl:hidden",a.className),style:{...a.style,top:"calc(var(--fd-banner-height) + var(--fd-nav-height))",insetInlineEnd:`max(${b?"0px":"var(--fd-layout-offset)"}, calc(50vw - var(--fd-sidebar-width)/2 - var(--fd-page-width)/2))`},children:(0,d.jsx)("div",{className:"flex h-full w-(--fd-toc-width) max-w-full flex-col pe-4",children:a.children})})}},55511:a=>{"use strict";a.exports=require("crypto")},57024:(a,b,c)=>{"use strict";c.d(b,{RootToggle:()=>m});var d=c(5009),e=c(97469),f=c(78820),g=c(69212),h=c(54309),i=c(17265),j=c(59384),k=c(85880),l=c(93586);function m({options:a,placeholder:b,...c}){let[m,n]=(0,f.useState)(!1),{closeOnRedirect:o}=(0,k.c)(),p=(0,h.a8)(),q=(0,f.useMemo)(()=>a.findLast(a=>(0,j.c)(a,p)),[a,p]),r=()=>{o.current=!1,n(!1)},s=q?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"size-9 shrink-0 md:size-5",children:q.icon}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:q.title}),(0,d.jsx)("p",{className:"text-[13px] text-fd-muted-foreground empty:hidden md:hidden",children:q.description})]})]}):b;return(0,d.jsxs)(l.AM,{open:m,onOpenChange:n,children:[s&&(0,d.jsxs)(l.Wv,{...c,className:(0,i.QP)("flex items-center gap-2 rounded-lg p-2 border bg-fd-secondary/50 text-start text-fd-secondary-foreground transition-colors hover:bg-fd-accent data-[state=open]:bg-fd-accent data-[state=open]:text-fd-accent-foreground",c.className),children:[s,(0,d.jsx)(e.Ml,{className:"shrink-0 ms-auto size-4 text-fd-muted-foreground"})]}),(0,d.jsx)(l.hl,{className:"flex flex-col gap-1 w-(--radix-popover-trigger-width) overflow-hidden p-1",children:a.map(a=>{let b=q&&a.url===q.url;if(b||!a.unlisted)return(0,d.jsxs)(g.default,{href:a.url,onClick:r,...a.props,className:(0,i.QP)("flex items-center gap-2 rounded-lg p-1.5 hover:bg-fd-accent hover:text-fd-accent-foreground",a.props?.className),children:[(0,d.jsx)("div",{className:"shrink-0 size-9 md:mt-1 md:mb-auto md:size-5",children:a.icon}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:a.title}),(0,d.jsx)("p",{className:"text-[13px] text-fd-muted-foreground empty:hidden",children:a.description})]}),(0,d.jsx)(e.Jl,{className:(0,i.QP)("shrink-0 ms-auto size-3.5 text-fd-primary",!b&&"invisible")})]},a.url)})})]})}},57696:(a,b,c)=>{"use strict";c.d(b,{CollapsibleControl:()=>r,LayoutBody:()=>q,LayoutTabs:()=>s,Navbar:()=>p});var d=c(5009),e=c(97469),f=c(78820),g=c(17265),h=c(21603),i=c(85880),j=c(83792),k=c(19998),l=c(58228),m=c(54309),n=c(59384),o=c(69212);function p(a){let{isTransparent:b}=(0,j.hI)();return(0,d.jsx)("header",{id:"nd-subnav",...a,className:(0,g.QP)("fixed top-(--fd-banner-height) left-0 right-(--removed-body-scroll-bar-size,0) z-30 flex items-center ps-4 pe-2.5 border-b transition-colors backdrop-blur-sm",!b&&"bg-fd-background/80",a.className),children:a.children})}function q(a){let{collapsed:b}=(0,i.c)();return(0,d.jsx)("main",{id:"nd-docs-layout",...a,className:(0,g.QP)("flex flex-1 flex-col pt-(--fd-nav-height) transition-[padding] fd-default-layout",!b&&"mx-(--fd-layout-offset)",a.className),style:{...a.style,paddingInlineStart:b?"min(calc(100vw - var(--fd-page-width)), var(--fd-sidebar-width))":"var(--fd-sidebar-width)"},children:a.children})}function r(){let{collapsed:a}=(0,i.c)();return(0,d.jsxs)("div",{className:(0,g.QP)("fixed flex shadow-lg transition-opacity rounded-xl p-0.5 border bg-fd-muted text-fd-muted-foreground z-10 max-md:hidden xl:start-4 max-xl:end-4",!a&&"pointer-events-none opacity-0"),style:{top:"calc(var(--fd-banner-height) + var(--fd-tocnav-height) + var(--spacing) * 4)"},children:[(0,d.jsx)(k.SidebarCollapseTrigger,{className:(0,g.QP)((0,h.r)({color:"ghost",size:"icon-sm",className:"rounded-lg"})),children:(0,d.jsx)(e.Bx,{})}),(0,d.jsx)(l.SearchToggle,{className:"rounded-lg",hideIfDisabled:!0})]})}function s({options:a,...b}){let c=(0,m.a8)(),e=(0,f.useMemo)(()=>a.findLast(a=>(0,n.c)(a,c)),[a,c]);return(0,d.jsx)("div",{...b,className:(0,g.QP)("flex flex-row items-end gap-6 overflow-auto",b.className),children:a.map(a=>(0,d.jsx)(t,{selected:e===a,option:a},a.url))})}function t({option:{title:a,url:b,unlisted:c,props:e},selected:f=!1}){return(0,d.jsx)(o.default,{href:b,...e,className:(0,g.QP)("inline-flex border-b-2 border-transparent transition-colors items-center pb-1.5 font-medium gap-2 text-fd-muted-foreground text-sm text-nowrap hover:text-fd-accent-foreground",c&&!f&&"hidden",f&&"border-fd-primary text-fd-primary",e?.className),children:a})}},58228:(a,b,c)=>{"use strict";c.d(b,{LargeSearchToggle:()=>k,SearchToggle:()=>j});var d=c(5009),e=c(97469),f=c(86986),g=c(38002),h=c(17265),i=c(21603);function j({hideIfDisabled:a,size:b="icon-sm",color:c="ghost",...g}){let{setOpenSearch:j,enabled:k}=(0,f.$A)();return a&&!k?null:(0,d.jsx)("button",{type:"button",className:(0,h.QP)((0,i.r)({size:b,color:c}),g.className),"data-search":"","aria-label":"Open Search",onClick:()=>{j(!0)},children:(0,d.jsx)(e.vj,{})})}function k({hideIfDisabled:a,...b}){let{enabled:c,hotKey:i,setOpenSearch:j}=(0,f.$A)(),{text:k}=(0,g.useI18n)();return a&&!c?null:(0,d.jsxs)("button",{type:"button","data-search-full":"",...b,className:(0,h.QP)("inline-flex items-center gap-2 rounded-lg border bg-fd-secondary/50 p-1.5 ps-2 text-sm text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground",b.className),onClick:()=>{j(!0)},children:[(0,d.jsx)(e.vj,{className:"size-4"}),k.search,(0,d.jsx)("div",{className:"ms-auto inline-flex gap-0.5",children:i.map((a,b)=>(0,d.jsx)("kbd",{className:"rounded-md border bg-fd-background px-1.5",children:a.display},b))})]})}},59384:(a,b,c)=>{"use strict";function d(a){return a.length>1&&a.endsWith("/")?a.slice(0,-1):a}function e(a,b,c=!0){return(a=d(a))===(b=d(b))||c&&b.startsWith(`${a}/`)}function f(a,b){return a.urls?a.urls.has(d(b)):e(a.url,b,!0)}c.d(b,{$:()=>e,c:()=>f})},60441:(a,b,c)=>{"use strict";c.d(b,{CodeBlock:()=>aG,CodeBlockTab:()=>aL,CodeBlockTabs:()=>aI,CodeBlockTabsList:()=>aJ,CodeBlockTabsTrigger:()=>aK,Pre:()=>aF});var d=c(5009),e=c(97469),f=c(78820),g=c.t(f,2),h=c(17265),i=c(21603),j=c(84335),k=c(26227),l=c(3411),m=c(14069),n=Object.defineProperty,o=(a,b)=>n(a,"name",{value:b,configurable:!0});function p(a){let b=a+"CollectionProvider",[c,e]=(0,k.A)(b),[g,h]=c(b,{collectionRef:{current:null},itemMap:new Map}),i=o(a=>{let{scope:b,children:c}=a,e=f.useRef(null),h=f.useRef(new Map).current;return(0,d.jsx)(g,{scope:b,itemMap:h,collectionRef:e,children:c})},"CollectionProvider");i.displayName=b;let j=a+"CollectionSlot",n=(0,m.TL)(j),p=f.forwardRef((a,b)=>{let{scope:c,children:e}=a,f=h(j,c),g=(0,l.s)(b,f.collectionRef);return(0,d.jsx)(n,{ref:g,children:e})});p.displayName=j;let q=a+"CollectionItemSlot",r="data-radix-collection-item",s=(0,m.TL)(q),t=f.forwardRef((a,b)=>{let{scope:c,children:e,...g}=a,i=f.useRef(null),j=(0,l.s)(b,i),k=h(q,c);return f.useEffect(()=>(k.itemMap.set(i,{ref:i,...g}),()=>void k.itemMap.delete(i))),(0,d.jsx)(s,{...{[r]:""},ref:j,children:e})});function u(b){let c=h(a+"CollectionConsumer",b);return f.useCallback(()=>{let a=c.collectionRef.current;if(!a)return[];let b=Array.from(a.querySelectorAll(`[${r}]`));return Array.from(c.itemMap.values()).sort((a,c)=>b.indexOf(a.ref.current)-b.indexOf(c.ref.current))},[c.collectionRef,c.itemMap])}return t.displayName=q,o(u,"useCollection"),[{Provider:i,Slot:p,ItemSlot:t},u,e]}o(p,"createCollection");var q=new WeakMap,r=class a extends Map{static{o(this,"OrderedDict")}#a;constructor(a){super(a),this.#a=[...super.keys()],q.set(this,!0)}set(a,b){return q.get(this)&&(this.has(a)?this.#a[this.#a.indexOf(a)]=a:this.#a.push(a)),super.set(a,b),this}insert(a,b,c){let d,e=this.has(b),f=this.#a.length,g=u(a),h=g>=0?g:f+g,i=h<0||h>=f?-1:h;if(i===this.size||e&&i===this.size-1||-1===i)return this.set(b,c),this;let j=this.size+ +!e;g<0&&h++;let k=[...this.#a],l=!1;for(let a=h;a<j;a++)if(h===a){let f=k[a];k[a]===b&&(f=k[a+1]),e&&this.delete(b),d=this.get(f),this.set(b,c)}else{l||k[a-1]!==b||(l=!0);let c=k[l?a:a-1],e=d;d=this.get(c),this.delete(c),this.set(c,e)}return this}with(b,c,d){let e=new a(this);return e.insert(b,c,d),e}before(a){let b=this.#a.indexOf(a)-1;if(!(b<0))return this.entryAt(b)}setBefore(a,b,c){let d=this.#a.indexOf(a);return -1===d?this:this.insert(d,b,c)}after(a){let b=this.#a.indexOf(a);if(-1!==(b=-1===b||b===this.size-1?-1:b+1))return this.entryAt(b)}setAfter(a,b,c){let d=this.#a.indexOf(a);return -1===d?this:this.insert(d+1,b,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#a=[],super.clear()}delete(a){let b=super.delete(a);return b&&this.#a.splice(this.#a.indexOf(a),1),b}deleteAt(a){let b=this.keyAt(a);return void 0!==b&&this.delete(b)}at(a){let b=s(this.#a,a);if(void 0!==b)return this.get(b)}entryAt(a){let b=s(this.#a,a);if(void 0!==b)return[b,this.get(b)]}indexOf(a){return this.#a.indexOf(a)}keyAt(a){return s(this.#a,a)}from(a,b){let c=this.indexOf(a);if(-1===c)return;let d=c+b;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.at(d)}keyFrom(a,b){let c=this.indexOf(a);if(-1===c)return;let d=c+b;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.keyAt(d)}find(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return d;c++}}findIndex(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return c;c++}return -1}filter(b,c){let d=[],e=0;for(let a of this)Reflect.apply(b,c,[a,e,this])&&d.push(a),e++;return new a(d)}map(b,c){let d=[],e=0;for(let a of this)d.push([a[0],Reflect.apply(b,c,[a,e,this])]),e++;return new a(d)}reduce(...a){let[b,c]=a,d=0,e=c??this.at(0);for(let c of this)e=0===d&&1===a.length?c:Reflect.apply(b,this,[e,c,d,this]),d++;return e}reduceRight(...a){let[b,c]=a,d=c??this.at(-1);for(let c=this.size-1;c>=0;c--){let e=this.at(c);d=c===this.size-1&&1===a.length?e:Reflect.apply(b,this,[d,e,c,this])}return d}toSorted(b){return new a([...this.entries()].sort(b))}toReversed(){let b=new a;for(let a=this.size-1;a>=0;a--){let c=this.keyAt(a),d=this.get(c);b.set(c,d)}return b}toSpliced(...b){let c=[...this.entries()];return c.splice(...b),new a(c)}slice(b,c){let d=new a,e=this.size-1;if(void 0===b)return d;b<0&&(b+=this.size),void 0!==c&&c>0&&(e=c-1);for(let a=b;a<=e;a++){let b=this.keyAt(a),c=this.get(b);d.set(b,c)}return d}every(a,b){let c=0;for(let d of this){if(!Reflect.apply(a,b,[d,c,this]))return!1;c++}return!0}some(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return!0;c++}return!1}};function s(a,b){if("at"in Array.prototype)return Array.prototype.at.call(a,b);let c=t(a,b);return -1===c?void 0:a[c]}function t(a,b){let c=a.length,d=u(b),e=d>=0?d:c+d;return e<0||e>=c?-1:e}function u(a){return a!=a||0===a?0:Math.trunc(a)}function w(a,b){if(a===b)return!0;if("object"!=typeof a||"object"!=typeof b||null==a||null==b)return!1;let c=Object.keys(a),d=Object.keys(b);if(c.length!==d.length)return!1;for(let d of c)if(!Object.prototype.hasOwnProperty.call(b,d)||a[d]!==b[d])return!1;return!0}function x(a,b){return!!(b.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_PRECEDING)}function y(a,b){return a[1].element&&b[1].element?x(a[1].element,b[1].element)?-1:1:0}function z(a){return new MutationObserver(b=>{for(let c of b)if("childList"===c.type)return void a()})}o(s,"at"),o(t,"toSafeIndex"),o(u,"toSafeInteger"),o(function(a){let b=a+"CollectionProvider",[c,e]=(0,k.A)(b),[g,h]=c(b,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new r,setItemMap:o(()=>void 0,"setItemMap")}),i=o(({state:a,...b})=>a?(0,d.jsx)(n,{...b,state:a}):(0,d.jsx)(j,{...b}),"CollectionProvider");i.displayName=b;let j=o(a=>{let b=A();return(0,d.jsx)(n,{...a,state:b})},"CollectionInit");j.displayName=b+"Init";let n=o(a=>{let{scope:b,children:c,state:e}=a,h=f.useRef(null),[i,j]=f.useState(null),k=(0,l.s)(h,j),[m,n]=e;return f.useEffect(()=>{if(!i)return;let a=z(()=>{});return a.observe(i,{childList:!0,subtree:!0}),()=>{a.disconnect()}},[i]),(0,d.jsx)(g,{scope:b,itemMap:m,setItemMap:n,collectionRef:k,collectionRefObject:h,collectionElement:i,children:c})},"CollectionProviderImpl");n.displayName=b+"Impl";let p=a+"CollectionSlot",q=(0,m.TL)(p),s=f.forwardRef((a,b)=>{let{scope:c,children:e}=a,f=h(p,c),g=(0,l.s)(b,f.collectionRef);return(0,d.jsx)(q,{ref:g,children:e})});s.displayName=p;let t=a+"CollectionItemSlot",u=(0,m.TL)(t),x=f.forwardRef((a,b)=>{let{scope:c,children:e,...g}=a,i=f.useRef(null),[j,k]=f.useState(null),m=(0,l.s)(b,i,k),{setItemMap:n}=h(t,c),o=f.useRef(g);w(o.current,g)||(o.current=g);let p=o.current;return f.useEffect(()=>(n(a=>j?a.has(j)?a.set(j,{...p,element:j}).toSorted(y):(a.set(j,{...p,element:j}),a.toSorted(y)):a),()=>{n(a=>j&&a.has(j)?(a.delete(j),new r(a)):a)}),[j,p,n]),(0,d.jsx)(u,{"data-radix-collection-item":"",ref:m,children:e})});function A(){return f.useState(new r)}function B(b){let{itemMap:c}=h(a+"CollectionConsumer",b);return c}return x.displayName=t,o(A,"useInitCollection"),o(B,"useCollection"),[{Provider:i,Slot:s,ItemSlot:x},{createCollectionScope:e,useCollection:B,useInitCollection:A}]},"createCollection"),o(w,"shallowEqual"),o(x,"isElementPreceding"),o(y,"sortByDocumentPosition"),o(z,"getChildListObserver");var A=c(95270),B=c(52742),C=c(28510),D=c(58817),E=c(70931),F=c(69524),G=Object.defineProperty,H=(a,b)=>G(a,"name",{value:b,configurable:!0}),I=!1;function J(){let[a,b]=f.useState(I);return f.useEffect(()=>{I||(I=!0,b(!0))},[]),a}H(J,"useIsHydrated");var K=g[" useSyncExternalStore ".trim().toString()];function L(){return()=>{}}function M(){return K(L,()=>!0,()=>!1)}H(L,"subscribe"),H(M,"useIsHydratedModern");var N="function"==typeof K?M:J,O=Object.defineProperty,P=(a,b)=>O(a,"name",{value:b,configurable:!0}),Q="rovingFocusGroup.onEntryFocus",R={bubbles:!1,cancelable:!0},S="RovingFocusGroup",[T,U,V]=p(S),[W,X]=(0,k.A)(S,[V]),Y={Vertical:"vertical",Horizontal:"horizontal"},Z={RTL:"rtl"},[$,_]=W(S),aa=f.forwardRef(P(function(a,b){return(0,d.jsx)(T.Provider,{scope:a.__scopeRovingFocusGroup,children:(0,d.jsx)(T.Slot,{scope:a.__scopeRovingFocusGroup,children:(0,d.jsx)(ab,{...a,ref:b})})})},"RovingFocusGroup")),ab=f.forwardRef(P(function(a,b){let{__scopeRovingFocusGroup:c,orientation:e,loop:g=!1,dir:h,currentTabStopId:i,defaultCurrentTabStopId:k,onCurrentTabStopIdChange:m,onEntryFocus:n,preventScrollOnEntryFocus:o=!1,...p}=a,q=f.useRef(null),r=(0,l.s)(b,q),s=(0,E.jH)(h),[t,u]=(0,D.i)({prop:i,defaultProp:k??null,onChange:m,caller:S}),[w,x]=f.useState(!1),y=(0,C.c)(n),z=U(c),A=f.useRef(!1),[F,G]=f.useState(0);return f.useEffect(()=>{let a=q.current;if(a)return a.addEventListener(Q,y),()=>a.removeEventListener(Q,y)},[y]),(0,d.jsx)($,{scope:c,orientation:e,dir:s,loop:g,currentTabStopId:t,onItemFocus:f.useCallback(a=>u(a),[u]),onItemShiftTab:f.useCallback(()=>x(!0),[]),onFocusableItemAdd:f.useCallback(()=>G(a=>a+1),[]),onFocusableItemRemove:f.useCallback(()=>G(a=>a-1),[]),children:(0,d.jsx)(B.sG.div,{tabIndex:w||0===F?-1:0,"data-orientation":e,...p,ref:r,style:{outline:"none",...a.style},onMouseDown:(0,j.mK)(a.onMouseDown,()=>{A.current=!0}),onFocus:(0,j.mK)(a.onFocus,a=>{let b=!A.current;if(a.target===a.currentTarget&&b&&!w){let b=new CustomEvent(Q,R);if(a.currentTarget.dispatchEvent(b),!b.defaultPrevented){let a=z().filter(a=>a.focusable);ag([a.find(a=>a.active),a.find(a=>a.id===t),...a].filter(Boolean).map(a=>a.ref.current),o)}}A.current=!1}),onBlur:(0,j.mK)(a.onBlur,()=>x(!1))})})},"RovingFocusGroupImpl")),ac=f.forwardRef(P(function(a,b){let{__scopeRovingFocusGroup:c,focusable:e=!0,active:g=!1,tabStopId:h,children:i,...k}=a,l=(0,A.B)(),m=h||l,n=_("RovingFocusGroupItem",c),o=n.currentTabStopId===m,p=U(c),{onFocusableItemAdd:q,onFocusableItemRemove:r,currentTabStopId:s}=n,t=N();return(0,F.N)(()=>{if(t&&e)return q(),()=>r()},[t,e,q,r]),f.useEffect(()=>{if(!t&&e)return q(),()=>r()},[t,e,q,r]),(0,d.jsx)(T.ItemSlot,{scope:c,id:m,focusable:e,active:g,children:(0,d.jsx)(B.sG.span,{tabIndex:o?0:-1,"data-orientation":n.orientation,...k,ref:b,onMouseDown:(0,j.mK)(a.onMouseDown,a=>{e?n.onItemFocus(m):a.preventDefault()}),onFocus:(0,j.mK)(a.onFocus,()=>n.onItemFocus(m)),onKeyDown:(0,j.mK)(a.onKeyDown,a=>{if("Tab"===a.key&&a.shiftKey)return void n.onItemShiftTab();if(a.target!==a.currentTarget)return;let b=af(a,n.orientation,n.dir);if(void 0!==b){if(a.metaKey||a.ctrlKey||a.altKey||a.shiftKey)return;a.preventDefault();let c=p().filter(a=>a.focusable).map(a=>a.ref.current);if("last"===b)c.reverse();else if("prev"===b||"next"===b){"prev"===b&&c.reverse();let d=c.indexOf(a.currentTarget);c=n.loop?ah(c,d+1):c.slice(d+1)}setTimeout(()=>ag(c))}}),children:"function"==typeof i?i({isCurrentTabStop:o,hasTabStop:null!=s}):i})})},"RovingFocusGroupItem")),ad={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ae(a,b){return b!==Z.RTL?a:"ArrowLeft"===a?"ArrowRight":"ArrowRight"===a?"ArrowLeft":a}function af(a,b,c){let d=ae(a.key,c);if(!(b===Y.Vertical&&["ArrowLeft","ArrowRight"].includes(d))&&!(b===Y.Horizontal&&["ArrowUp","ArrowDown"].includes(d)))return ad[d]}function ag(a,b=!1){let c=document.activeElement;for(let d of a)if(d===c||(d.focus({preventScroll:b}),document.activeElement!==c))return}function ah(a,b){return a.map((c,d)=>a[(b+d)%a.length])}P(ae,"getDirectionAwareKey"),P(af,"getFocusIntent"),P(ag,"focusFirst"),P(ah,"wrapArray");var ai=c(7173),aj=Object.defineProperty,ak=(a,b)=>aj(a,"name",{value:b,configurable:!0}),al={Automatic:"automatic",Manual:"manual"},am="Tabs",[an,ao]=(0,k.A)(am,[X]),ap=X(),[aq,ar]=an(am),as=f.forwardRef(ak(function(a,b){let{__scopeTabs:c,value:e,onValueChange:f,defaultValue:g,orientation:h="horizontal",dir:i,activationMode:j=al.Automatic,...k}=a,l=(0,E.jH)(i),[m,n]=(0,D.i)({prop:e,onChange:f,defaultProp:g??"",caller:am});return(0,d.jsx)(aq,{scope:c,baseId:(0,A.B)(),value:m,onValueChange:n,orientation:h,dir:l,activationMode:j,children:(0,d.jsx)(B.sG.div,{dir:l,"data-orientation":h,...k,ref:b})})},"Tabs")),at=f.forwardRef(ak(function(a,b){let{__scopeTabs:c,loop:e=!0,...f}=a,g=ar("TabsList",c),h=ap(c);return(0,d.jsx)(aa,{asChild:!0,...h,orientation:g.orientation,dir:g.dir,loop:e,children:(0,d.jsx)(B.sG.div,{role:"tablist","aria-orientation":g.orientation,...f,ref:b})})},"TabsList")),au=f.forwardRef(ak(function(a,b){let{__scopeTabs:c,value:e,disabled:f=!1,...g}=a,h=ar("TabsTrigger",c),i=ap(c),k=aw(h.baseId,e),l=ax(h.baseId,e),m=e===h.value;return(0,d.jsx)(ac,{asChild:!0,...i,focusable:!f,active:m,children:(0,d.jsx)(B.sG.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":l,"data-state":m?"active":"inactive","data-disabled":f?"":void 0,disabled:f,id:k,...g,ref:b,onMouseDown:(0,j.mK)(a.onMouseDown,a=>{f||0!==a.button||!1!==a.ctrlKey?a.preventDefault():(a.currentTarget.focus(),h.onValueChange(e))}),onKeyDown:(0,j.mK)(a.onKeyDown,a=>{!f&&a.target===a.currentTarget&&[" ","Enter"].includes(a.key)&&h.onValueChange(e)}),onFocus:(0,j.mK)(a.onFocus,()=>{let a=h.activationMode!==al.Manual;m||f||!a||h.onValueChange(e)})})})},"TabsTrigger")),av=f.forwardRef(ak(function(a,b){let{__scopeTabs:c,value:e,forceMount:g,children:h,...i}=a,j=ar("TabsContent",c),k=aw(j.baseId,e),l=ax(j.baseId,e),m=e===j.value,n=f.useRef(m);return f.useEffect(()=>{let a=requestAnimationFrame(()=>n.current=!1);return()=>cancelAnimationFrame(a)},[]),(0,d.jsx)(ai.C,{present:g||m,children:({present:c})=>(0,d.jsx)(B.sG.div,{"data-state":m?"active":"inactive","data-orientation":j.orientation,role:"tabpanel","aria-labelledby":k,hidden:!c,id:l,tabIndex:0,...i,ref:b,style:{...a.style,animationDuration:n.current?"0s":void 0},children:c&&h})})},"TabsContent"));function aw(a,b){return`${a}-trigger-${b}`}function ax(a,b){return`${a}-content-${b}`}ak(aw,"makeTriggerId"),ak(ax,"makeContentId");var ay=c(49560),az=c(8940);let aA=new Map,aB=(0,f.createContext)(null);function aC({ref:a,groupId:b,persist:c=!1,updateAnchor:e=!1,defaultValue:g,value:h,onValueChange:i,...j}){let k=(0,f.useRef)(null),[l,m]=void 0===h?(0,f.useState)(g):[h,i??(()=>void 0)];(0,az.J)(a=>m(a));let n=(0,f.useMemo)(()=>new Map,[]);return(0,d.jsx)(as,{ref:(0,ay.P)(a,k),value:l,onValueChange:a=>{if(e){let b=n.get(a);b&&window.history.replaceState(null,"",`#${b}`)}b?(aA.get(b)?.forEach(b=>{b(a)}),c?localStorage.setItem(b,a):sessionStorage.setItem(b,a)):m(a)},...j,children:(0,d.jsx)(aB.Provider,{value:(0,f.useMemo)(()=>({valueToIdMap:n}),[n]),children:j.children})})}function aD({value:a,...b}){let{valueToIdMap:c}=function(){let a=(0,f.useContext)(aB);if(!a)throw Error("You must wrap your component in <Tabs>");return a}();return b.id&&c.set(a,b.id),(0,d.jsx)(av,{value:a,...b,children:b.children})}let aE=(0,f.createContext)(null);function aF(a){return(0,d.jsx)("pre",{...a,className:(0,h.QP)("min-w-full w-max *:flex *:flex-col",a.className),children:a.children})}function aG({ref:a,title:b,allowCopy:c=!0,keepBackground:e=!1,icon:g,viewportProps:i={},children:j,Actions:k=a=>(0,d.jsx)("div",{...a,className:(0,h.QP)("empty:hidden",a.className)}),...l}){let m=null!==(0,f.useContext)(aE),n=(0,f.useRef)(null);return(0,d.jsxs)("figure",{ref:a,dir:"ltr",...l,className:(0,h.QP)(m?"bg-fd-secondary -mx-px -mb-px last:rounded-b-xl":"my-4 bg-fd-card rounded-xl",e&&"bg-(--shiki-light-bg) dark:bg-(--shiki-dark-bg)","shiki relative border shadow-sm outline-none not-prose overflow-hidden text-sm",l.className),children:[b?(0,d.jsxs)("div",{className:"flex text-fd-muted-foreground items-center gap-2 h-9.5 border-b px-4",children:["string"==typeof g?(0,d.jsx)("div",{className:"[&_svg]:size-3.5",dangerouslySetInnerHTML:{__html:g}}):g,(0,d.jsx)("figcaption",{className:"flex-1 truncate",children:b}),k({className:"-me-2",children:c&&(0,d.jsx)(aH,{containerRef:n})})]}):k({className:"absolute top-2 right-2 z-2 backdrop-blur-lg rounded-lg text-fd-muted-foreground",children:c&&(0,d.jsx)(aH,{containerRef:n})}),(0,d.jsx)("div",{ref:n,...i,className:(0,h.QP)("text-[13px] py-3.5 overflow-auto max-h-[600px] fd-scroll-container",i.className),style:{"--padding-right":b?void 0:"calc(var(--spacing) * 8)",counterSet:l["data-line-numbers"]?`line ${Number(l["data-line-numbers-start"]??1)-1}`:void 0,...i.style},children:j})]})}function aH({className:a,containerRef:b,...c}){let[g,j]=function(a){let[b,c]=(0,f.useState)(!1),d=(0,f.useRef)(a),e=(0,f.useRef)(null);return d.current=a,[b,(0,f.useCallback)(()=>{e.current&&window.clearTimeout(e.current),Promise.resolve(d.current()).then(()=>{c(!0),e.current=window.setTimeout(()=>{c(!1)},1500)})},[])]}(()=>{let a=b.current?.getElementsByTagName("pre").item(0);if(!a)return;let c=a.cloneNode(!0);c.querySelectorAll(".nd-copy-ignore").forEach(a=>{a.replaceWith("\n")}),navigator.clipboard.writeText(c.textContent??"")});return(0,d.jsx)("button",{type:"button","data-checked":g||void 0,className:(0,h.QP)((0,i.r)({className:"hover:text-fd-accent-foreground data-[checked]:text-fd-accent-foreground",size:"icon-xs"}),a),"aria-label":g?"Copied Text":"Copy Text",onClick:j,...c,children:g?(0,d.jsx)(e.Jl,{}):(0,d.jsx)(e.B0,{})})}function aI({ref:a,...b}){let c=(0,f.useRef)(null),e=null!==(0,f.useContext)(aE);return(0,d.jsx)(aC,{ref:(0,ay.P)(c,a),...b,className:(0,h.QP)("bg-fd-card rounded-xl border",!e&&"my-4",b.className),children:(0,d.jsx)(aE.Provider,{value:(0,f.useMemo)(()=>({containerRef:c,nested:e}),[e]),children:b.children})})}function aJ(a){return(0,d.jsx)(at,{...a,className:(0,h.QP)("flex flex-row px-2 overflow-x-auto text-fd-muted-foreground",a.className),children:a.children})}function aK({children:a,...b}){return(0,d.jsxs)(au,{...b,className:(0,h.QP)("relative group inline-flex text-sm font-medium text-nowrap items-center transition-colors gap-2 px-2 py-1.5 hover:text-fd-accent-foreground data-[state=active]:text-fd-primary [&_svg]:size-3.5",b.className),children:[(0,d.jsx)("div",{className:"absolute inset-x-2 bottom-0 h-px group-data-[state=active]:bg-fd-primary"}),a]})}function aL(a){return(0,d.jsx)(aD,{...a})}},62684:(a,b,c)=>{"use strict";c.d(b,{CodeBlock:()=>f,CodeBlockTab:()=>j,CodeBlockTabs:()=>g,CodeBlockTabsList:()=>h,CodeBlockTabsTrigger:()=>i,Pre:()=>e});var d=c(71935);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call Pre() from the server but Pre is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/codeblock.js","Pre"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call CodeBlock() from the server but CodeBlock is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/codeblock.js","CodeBlock"),g=(0,d.registerClientReference)(function(){throw Error("Attempted to call CodeBlockTabs() from the server but CodeBlockTabs is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/codeblock.js","CodeBlockTabs"),h=(0,d.registerClientReference)(function(){throw Error("Attempted to call CodeBlockTabsList() from the server but CodeBlockTabsList is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/codeblock.js","CodeBlockTabsList"),i=(0,d.registerClientReference)(function(){throw Error("Attempted to call CodeBlockTabsTrigger() from the server but CodeBlockTabsTrigger is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/codeblock.js","CodeBlockTabsTrigger"),j=(0,d.registerClientReference)(function(){throw Error("Attempted to call CodeBlockTab() from the server but CodeBlockTab is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/codeblock.js","CodeBlockTab")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},63617:(a,b,c)=>{"use strict";c.d(b,{default:()=>l});var d=c(5009),e=c(68388),f=c(78820),g=c(17265),h=c(76756),i=c(82425),j=c(49560),k=c(38002);function l({ref:a,className:b,...c}){let e=(0,f.useRef)(null),l=(0,i.a)(),{text:n}=(0,k.useI18n)(),[o,p]=(0,f.useState)();return 0===l.length?(0,d.jsx)("div",{className:"rounded-lg border bg-fd-card p-3 text-xs text-fd-muted-foreground",children:n.tocNoHeadings}):(0,d.jsxs)(d.Fragment,{children:[o?(0,d.jsx)("div",{className:"absolute start-0 top-0 rtl:-scale-x-100",style:{width:o.width,height:o.height,maskImage:`url("data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${o.width} ${o.height}"><path d="${o.path}" stroke="black" stroke-width="1" fill="none" /></svg>`)}")`},children:(0,d.jsx)(h.j,{containerRef:e,className:"mt-(--fd-top) h-(--fd-height) bg-fd-primary transition-all"})}):null,(0,d.jsx)("div",{ref:(0,j.P)(e,a),className:(0,g.QP)("flex flex-col",b),...c,children:l.map((a,b)=>(0,d.jsx)(m,{item:a,upper:l[b-1]?.depth,lower:l[b+1]?.depth},a.url))})]})}function m({item:a,upper:b=a.depth,lower:c=a.depth}){var f;let h=10*(a.depth>=3),i=10*(b>=3);return(0,d.jsxs)(e.Cz,{href:a.url,style:{paddingInlineStart:(f=a.depth)<=2?14:3===f?26:36},className:"prose relative py-1.5 text-sm text-fd-muted-foreground hover:text-fd-accent-foreground transition-colors [overflow-wrap:anywhere] first:pt-0 last:pb-0 data-[active=true]:text-fd-primary",children:[h!==i?(0,d.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",className:"absolute -top-1.5 start-0 size-4 rtl:-scale-x-100",children:(0,d.jsx)("line",{x1:i,y1:"0",x2:h,y2:"12",className:"stroke-fd-foreground/10",strokeWidth:"1"})}):null,(0,d.jsx)("div",{className:(0,g.QP)("absolute inset-y-0 w-px bg-fd-foreground/10",h!==i&&"top-1.5",h!==10*(c>=3)&&"bottom-1.5"),style:{insetInlineStart:h}}),a.title]})}},68171:(a,b,c)=>{Promise.resolve().then(c.bind(c,2098)),Promise.resolve().then(c.bind(c,7288)),Promise.resolve().then(c.bind(c,83854)),Promise.resolve().then(c.bind(c,18)),Promise.resolve().then(c.bind(c,22353)),Promise.resolve().then(c.bind(c,38629)),Promise.resolve().then(c.bind(c,26706)),Promise.resolve().then(c.bind(c,14992)),Promise.resolve().then(c.bind(c,44518)),Promise.resolve().then(c.bind(c,84368))},68388:(a,b,c)=>{"use strict";c.d(b,{Cz:()=>n,Mf:()=>k,N2:()=>l,NQ:()=>m,R3:()=>j});var d=c(53370);c(8566);var e=c(78820),f=c(35175),g=c(5009),h=(0,e.createContext)([]),i=(0,e.createContext)({current:null});function j(){return(0,e.useContext)(h).at(-1)}function k(){return(0,e.useContext)(h)}function l({containerRef:a,children:b}){return(0,g.jsx)(i.Provider,{value:a,children:b})}function m({toc:a,single:b=!0,children:c}){return(0,e.useMemo)(()=>a.map(a=>a.url.split("#")[1]),[a]),(0,g.jsx)(h.Provider,{value:function(a,b){let[c,d]=(0,e.useState)([]);return b?c.slice(0,1):c}(0,b),children:c})}var n=(0,e.forwardRef)(({onActiveChange:a,...b},c)=>{let h=(0,e.useContext)(i),j=k(),l=(0,e.useRef)(null),m=function(...a){return b=>{a.forEach(a=>{"function"==typeof a?a(b):null!==a&&(a.current=b)})}}(l,c),n=j.includes(b.href.slice(1));return(0,d.T)(n,b=>{let c=l.current;c&&(b&&h.current&&(0,f.A)(c,{behavior:"smooth",block:"center",inline:"center",scrollMode:"always",boundary:h.current}),a?.(b))}),(0,g.jsx)("a",{ref:m,"data-active":n,...b,children:b.children})});n.displayName="TOCItem"},69212:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>g});var d=c(40624),e=c(78820),f=c(5009),g=(0,e.forwardRef)(({href:a="#",external:b=a.match(/^\w+:/)||a.startsWith("//"),prefetch:c,...e},g)=>b?(0,f.jsx)("a",{ref:g,href:a,rel:"noreferrer noopener",target:"_blank",...e,children:e.children}):(0,f.jsx)(d.N_,{ref:g,href:a,prefetch:c,...e}));g.displayName="Link",c(8566)},71586:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>F,generateMetadata:()=>H,generateStaticParams:()=>G});var d=c(40239);c(95980);var e=c(2098),f=c(25475);require("node:path");var g=c(70986),h=c(10723),i=c(47031),j=c(35396),k=c(45400),l=c(77183),m=c(10035);function n(a){return(0,d.jsxs)("h3",{...a,className:(0,f.QP)("inline-flex items-center gap-1.5 text-sm text-fd-muted-foreground",a.className),children:[(0,d.jsx)(i.EY,{className:"size-4"}),(0,d.jsx)(j.I18nLabel,{label:"toc"})]})}function o({variant:a="normal",...b}){return(0,d.jsx)(l.TOCScrollArea,{...b,children:"clerk"===a?(0,d.jsx)(m.default,{}):(0,d.jsx)(l.TOCItems,{})})}function p({variant:a="normal",...b}){return(0,d.jsx)(l.TOCScrollArea,{...b,children:"clerk"===a?(0,d.jsx)(m.default,{}):(0,d.jsx)(l.TOCItems,{})})}function q(a){return(0,d.jsx)("article",{...a,className:(0,f.QP)("flex min-w-0 w-full flex-col gap-4 pt-8 px-4 md:px-6 md:mx-auto",a.className),children:a.children})}function r({toc:a=!1,children:b,...c}){let e=(0,d.jsx)("div",{id:"nd-page",...c,className:(0,f.QP)("flex flex-1 w-full mx-auto max-w-(--fd-page-width) pt-(--fd-tocnav-height) pe-(--fd-toc-width)",c.className),children:b});return a?(0,d.jsx)(l.TOCProvider,{...a,children:e}):e}function s({editOnGithub:a,breadcrumb:{enabled:b=!0,component:c,...e}={},footer:g={},lastUpdate:h,container:i,full:j=!1,tableOfContentPopover:{enabled:l,component:m,...s}={},tableOfContent:{enabled:u,component:w,...x}={},toc:y=[],article:z,children:A}){return u??(u=!j&&(y.length>0||void 0!==x.footer||void 0!==x.header)),l??(l=y.length>0||void 0!==s.header||void 0!==s.footer),(0,d.jsxs)(r,{toc:(!!u||!!l)&&{toc:y,single:x.single},...i,className:(0,f.QP)(!u&&"[--fd-toc-width:0px]",i?.className),children:[l&&(m??(0,d.jsxs)(k.PageTOCPopover,{children:[(0,d.jsx)(k.PageTOCPopoverTrigger,{}),(0,d.jsxs)(k.PageTOCPopoverContent,{children:[s.header,(0,d.jsx)(p,{variant:s.style}),s.footer]})]})),(0,d.jsxs)(q,{...z,children:[b&&(c??(0,d.jsx)(k.PageBreadcrumb,{...e})),A,(0,d.jsxs)("div",{className:"flex flex-row flex-wrap items-center justify-between gap-4 empty:hidden",children:[a&&(0,d.jsx)(t,{href:`https://github.com/${a.owner}/${a.repo}/blob/${a.sha}/${a.path.startsWith("/")?a.path.slice(1):a.path}`}),h&&(0,d.jsx)(k.PageLastUpdate,{date:new Date(h)})]}),!1!==g.enabled&&(g.component??(0,d.jsx)(k.PageFooter,{items:g.items}))]}),u&&(w??(0,d.jsxs)(k.PageTOC,{children:[x.header,(0,d.jsx)(n,{}),(0,d.jsx)(o,{variant:x.style}),x.footer]}))]})}function t(a){return(0,d.jsx)("a",{target:"_blank",rel:"noreferrer noopener",...a,className:(0,f.QP)((0,h.r)({color:"secondary",size:"sm",className:"gap-1.5 not-prose"}),a.className),children:a.children??(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(i.ff,{className:"size-3.5"}),(0,d.jsx)(j.I18nLabel,{label:"editOnGithub"})]})})}let u=(0,g.forwardRef)((a,b)=>(0,d.jsx)("div",{ref:b,...a,className:(0,f.QP)("prose flex-1",a.className),children:a.children}));u.displayName="DocsBody",(0,g.forwardRef)((a,b)=>void 0===a.children?null:(0,d.jsx)("p",{ref:b,...a,className:(0,f.QP)("mb-8 text-lg text-fd-muted-foreground",a.className),children:a.children})).displayName="DocsDescription";let w=(0,g.forwardRef)((a,b)=>(0,d.jsx)("h1",{ref:b,...a,className:(0,f.QP)("text-[1.75em] font-semibold",a.className),children:a.children}));w.displayName="DocsTitle";var x=c(2282),y=c(35241),z=c(19671);let A="size-5 -me-0.5 fill-(--callout-color) text-fd-card",B=(0,g.forwardRef)(({className:a,children:b,title:c,type:e="info",icon:g,...h},j)=>("warn"===e&&(e="warning"),"tip"===e&&(e="info"),(0,d.jsxs)("div",{ref:j,className:(0,f.QP)("flex gap-2 my-4 rounded-xl border bg-fd-card p-3 ps-1 text-sm text-fd-card-foreground shadow-md",a),...h,style:{"--callout-color":`var(--color-fd-${e}, var(--color-fd-muted))`,...h.style},children:[(0,d.jsx)("div",{role:"none",className:"w-0.5 bg-(--callout-color)/50 rounded-sm"}),g??({info:(0,d.jsx)(i.R2,{className:A}),warning:(0,d.jsx)(i.lW,{className:A}),error:(0,d.jsx)(i.RT,{className:A}),success:(0,d.jsx)(i.rW,{className:A})})[e],(0,d.jsxs)("div",{className:"flex flex-col gap-2 min-w-0 flex-1",children:[c&&(0,d.jsx)("p",{className:"font-medium !my-0",children:c}),(0,d.jsx)("div",{className:"text-fd-muted-foreground prose-no-margin empty:hidden",children:b})]})]})));function C({as:a,className:b,...c}){let e=a??"h1";return c.id?(0,d.jsxs)(e,{className:(0,f.QP)("flex scroll-m-28 flex-row items-center gap-2",b),...c,children:[(0,d.jsx)("a",{"data-card":"",href:`#${c.id}`,className:"peer",children:c.children}),(0,d.jsx)(i.N_,{"aria-label":"Link to section",className:"size-3.5 shrink-0 text-fd-muted-foreground opacity-0 transition-opacity peer-hover:opacity-100"})]}):(0,d.jsx)(e,{className:b,...c})}B.displayName="Callout";var D=c(62684);let E={CodeBlockTab:D.CodeBlockTab,CodeBlockTabs:D.CodeBlockTabs,CodeBlockTabsList:D.CodeBlockTabsList,CodeBlockTabsTrigger:D.CodeBlockTabsTrigger,pre:a=>(0,d.jsx)(D.CodeBlock,{...a,children:(0,d.jsx)(D.Pre,{children:a.children})}),Card:function({icon:a,title:b,description:c,...g}){let h=g.href?e.default:"div";return(0,d.jsxs)(h,{...g,"data-card":!0,className:(0,f.QP)("block rounded-xl border bg-fd-card p-4 text-fd-card-foreground transition-colors @max-lg:col-span-full",g.href&&"hover:bg-fd-accent/80",g.className),children:[a?(0,d.jsx)("div",{className:"not-prose mb-2 w-fit shadow-md rounded-lg border bg-fd-muted p-1.5 text-fd-muted-foreground [&_svg]:size-4",children:a}):null,(0,d.jsx)("h3",{className:"not-prose mb-1 text-sm font-medium",children:b}),c?(0,d.jsx)("p",{className:"!my-0 text-sm text-fd-muted-foreground",children:c}):null,(0,d.jsx)("div",{className:"text-sm text-fd-muted-foreground prose-no-margin empty:hidden",children:g.children})]})},Cards:function(a){return(0,d.jsx)("div",{...a,className:(0,f.QP)("grid grid-cols-2 gap-3 @container",a.className),children:a.children})},a:e.default,img:function(a){return(0,d.jsx)(z.Image,{sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px",...a,src:a.src,className:(0,f.QP)("rounded-lg",a.className)})},h1:a=>(0,d.jsx)(C,{as:"h1",...a}),h2:a=>(0,d.jsx)(C,{as:"h2",...a}),h3:a=>(0,d.jsx)(C,{as:"h3",...a}),h4:a=>(0,d.jsx)(C,{as:"h4",...a}),h5:a=>(0,d.jsx)(C,{as:"h5",...a}),h6:a=>(0,d.jsx)(C,{as:"h6",...a}),table:function(a){return(0,d.jsx)("div",{className:"relative overflow-auto prose-no-margin my-6",children:(0,d.jsx)("table",{...a})})},Callout:B};async function F({params:a}){let b=y.s.getPage((await a).slug);b||(0,x.notFound)();let c=b.data.body;return(0,d.jsxs)(s,{toc:b.data.toc,children:[(0,d.jsx)(w,{children:b.data.title}),(0,d.jsx)(u,{children:(0,d.jsx)(c,{components:E})})]})}function G(){return y.s.generateParams()}async function H({params:a}){let b=y.s.getPage((await a).slug);return b||(0,x.notFound)(),{title:b.data.title}}},74768:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GlobalError:()=>G.a,__next_app__:()=>M,handler:()=>O,pages:()=>L,routeModule:()=>N,tree:()=>K});var d=c(51854),e=c(47977),f=c(82526),g=c(64046),h=c(66271),i=c(95797),j=c(93213),k=c(66500),l=c(30725),m=c(24405),n=c(15823),o=c(93821),p=c(41403),q=c(63980),r=c(50346),s=c(57831),t=c(261),u=c(72558),w=c(74435),x=c(26713),y=c(96415),z=c(49132),A=c(72544),B=c(76977),C=c(88695),D=c(89533),E=c(86439),F=c(87811),G=c.n(F),H=c(74943),I=c(31454),J={};for(let a in H)0>["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(a)&&(J[a]=()=>H[a]);c.d(b,J);let K={children:["",{children:["docs",{children:["[[...slug]]",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,71586)),"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/apps/docs/app/docs/[[...slug]]/page.tsx"]}]},{}]},{layout:[()=>Promise.resolve().then(c.bind(c,29440)),"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/apps/docs/app/docs/layout.tsx"]}]},{layout:[()=>Promise.resolve().then(c.bind(c,56043)),"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/apps/docs/app/layout.tsx"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,87811,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,22539,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,33230,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,15977,23)),"next/dist/client/components/builtin/unauthorized.js"]}]}.children,L=["/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/apps/docs/app/docs/[[...slug]]/page.tsx"],M={require:c,loadChunk:()=>Promise.resolve()},N=new e.AppPageRouteModule({definition:{kind:f.RouteKind.APP_PAGE,page:"/docs/[[...slug]]/page",pathname:"/docs/[[...slug]]",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:K},distDir:".next",relativeProjectDir:""});async function O(a,b,e){var F;let J="/docs/[[...slug]]/page";"/index"===J&&(J="/");let P=(0,i.getRequestMeta)(a,"postponed"),Q=(0,i.getRequestMeta)(a,"minimalMode"),R=await N.prepare(a,b,{srcPage:J,multiZoneDraftMode:!1});if(!R)return b.statusCode=400,b.end("Bad Request"),null==e.waitUntil||e.waitUntil.call(e,Promise.resolve()),null;let{buildId:S,query:T,params:U,parsedUrl:V,pageIsDynamic:W,buildManifest:X,nextFontManifest:Y,reactLoadableManifest:Z,serverActionsManifest:$,clientReferenceManifest:_,subresourceIntegrityManifest:aa,prerenderManifest:ab,isDraftMode:ac,resolvedPathname:ad,revalidateOnlyGenerated:ae,routerServerContext:af,nextConfig:ag,interceptionRoutePatterns:ah}=R,ai=V.pathname||"/",aj=(0,t.normalizeAppPath)(J),{isOnDemandRevalidate:ak}=R,al=N.match(ai,ab),am=!!ab.routes[ad]&&(N.isDev||(0,d.isRouteCacheOwner)(ad,N.cacheOwner,ab.routes[ad])),an=!!(al||am||ab.routes[aj]),ao=a.headers["user-agent"]||"",ap=(0,x.getBotType)(ao),aq=(0,r.isHtmlBotRequest)(a),ar=(0,i.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[w.NEXT_ROUTER_PREFETCH_HEADER],as=(0,i.getRequestMeta)(a,"isRSCRequest")??(0,o.f)(a.headers[w.RSC_HEADER]),at=(0,u.getIsPossibleServerAction)(a),au=(0,n.checkIsAppPPREnabled)(ag.experimental.ppr)&&(null==(F=ab.routes[aj]??ab.dynamicRoutes[aj])?void 0:F.renderingMode)==="PARTIALLY_STATIC",av=!1,aw=!1,ax=au?P:void 0,ay=au&&as&&!ar,az=(0,i.getRequestMeta)(a,"segmentPrefetchRSCRequest"),aA=!ao||(0,r.shouldServeStreamingMetadata)(ao,ag.htmlLimitedBots);aq&&au&&(an=!1,aA=!1);let aB=!0===N.isDev||!an||"string"==typeof P||ay,aC=aq&&au,aD=null;ac||!an||aB||at||ax||ay||(aD=ad);let aE=aD;!aE&&N.isDev&&(aE=ad),N.isDev||ac||!an||!as||ay||(0,l.d)(a.headers);let aF={...H,tree:K,pages:L,GlobalError:G(),handler:O,routeModule:N,__next_app__:M};$&&_&&(0,q.setReferenceManifestsSingleton)({page:J,clientReferenceManifest:_,serverActionsManifest:$,serverModuleMap:(0,s.createServerModuleMap)({serverActionsManifest:$})});let aG=a.method||"GET",aH=(0,h.getTracer)(),aI=aH.getActiveScopeSpan();try{let d=N.getVaryHeader(ad,ah);b.setHeader("Vary",d);let g=async(c,d)=>{let e=new m.NodeNextRequest(a),f=new m.NodeNextResponse(b);return N.render(e,f,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=aH.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==j.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${aG} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${aG} ${a.url}`)})},l=async({span:d,postponed:f,fallbackRouteParams:h})=>{let j={query:T,params:U,page:aj,sharedContext:{buildId:S},serverComponentsHmrCache:(0,i.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:h,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aF,Component:(0,k.T)(aF),params:U,routeModule:N,page:J,postponed:f,shouldWaitOnAllReady:aC,serveStreamingMetadata:aA,supportsDynamicResponse:"string"==typeof f||aB,buildManifest:X,nextFontManifest:Y,reactLoadableManifest:Z,subresourceIntegrityManifest:aa,serverActionsManifest:$,clientReferenceManifest:_,setIsrStatus:null==af?void 0:af.setIsrStatus,dir:c(33873).join(process.cwd(),N.relativeProjectDir),isDraftMode:ac,isRevalidate:an&&!f&&!ay,botType:ap,isOnDemandRevalidate:ak,isPossibleServerAction:at,assetPrefix:ag.assetPrefix,nextConfigOutput:ag.output,crossOrigin:ag.crossOrigin,trailingSlash:ag.trailingSlash,previewProps:ab.preview,deploymentId:ag.deploymentId,enableTainting:ag.experimental.taint,htmlLimitedBots:ag.htmlLimitedBots,devtoolSegmentExplorer:ag.experimental.devtoolSegmentExplorer,reactMaxHeadersLength:ag.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:(0,i.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:ag.experimental.cacheLife,basePath:ag.basePath,serverActions:ag.experimental.serverActions,...av?{nextExport:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isRevalidate:!0,isDebugDynamicAccesses:av}:{},experimental:{isRoutePPREnabled:au,expireTime:ag.expireTime,staleTimes:ag.experimental.staleTimes,cacheComponents:!!ag.experimental.cacheComponents,clientSegmentCache:!!ag.experimental.clientSegmentCache,clientParamParsing:!!ag.experimental.clientParamParsing,dynamicOnHover:!!ag.experimental.dynamicOnHover,inlineCss:!!ag.experimental.inlineCss,authInterrupts:!!ag.experimental.authInterrupts,clientTraceMetadata:ag.experimental.clientTraceMetadata||[]},waitUntil:e.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d)=>N.onRequestError(a,b,d,af),err:(0,i.getRequestMeta)(a,"invokeError"),dev:N.isDev}},l=await g(d,j),{metadata:m}=l,{cacheControl:n,headers:o={},fetchTags:p}=m;if(p&&(o[B.NEXT_CACHE_TAGS_HEADER]=p),a.fetchMetrics=m.fetchMetrics,an&&(null==n?void 0:n.revalidate)===0&&!N.isDev&&!au){let a=m.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${ad}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""}
2
2
  see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1,configurable:!0});if(null==a?void 0:a.stack){let c=a.stack;b.stack=b.message+c.substring(c.indexOf("\n"))}throw b}return{value:{kind:y.CachedRouteKind.APP_PAGE,html:l,headers:o,rscData:m.flightData,postponed:m.postponed,status:m.statusCode,segmentData:m.segmentData},cacheControl:n}},n=async({hasResolved:c,previousCacheEntry:d,isRevalidating:g,span:h})=>{let j,k=!1===N.isDev,m=c||b.writableEnded;if(ak&&ae&&!d&&!Q)return(null==af?void 0:af.render404)?await af.render404(a,b):(b.statusCode=404,b.end("This page could not be found")),null;if(al&&(j=(0,z.parseFallbackField)(al.fallback)),j===z.FallbackMode.PRERENDER&&(0,x.isBot)(ao)&&(!au||aq)&&(j=z.FallbackMode.BLOCKING_STATIC_RENDER),(null==d?void 0:d.isStale)===-1&&(ak=!0),ak&&(j!==z.FallbackMode.NOT_FOUND||d)&&(j=z.FallbackMode.BLOCKING_STATIC_RENDER),!Q&&j!==z.FallbackMode.BLOCKING_STATIC_RENDER&&aE&&!m&&!ac&&W&&(k||!am)){let b;if((k||al)&&j===z.FallbackMode.NOT_FOUND)throw new E.NoFallbackError;if(au&&!as){let c="string"==typeof(null==al?void 0:al.fallback)?al.fallback:k?aj:null;if(b=await N.handleResponse({cacheKey:c,req:a,nextConfig:ag,routeKind:f.RouteKind.APP_PAGE,isFallback:!0,prerenderManifest:ab,isRoutePPREnabled:au,responseGenerator:async()=>l({span:h,postponed:void 0,fallbackRouteParams:k||aw?(0,p.u)(aj):null}),waitUntil:e.waitUntil}),null===b)return null;if(b)return delete b.cacheControl,b}}let n=ak||g||!ax?void 0:ax;if(av&&void 0!==n)return{cacheControl:{revalidate:1,expire:void 0},value:{kind:y.CachedRouteKind.PAGES,html:A.default.EMPTY,pageData:{},headers:void 0,status:void 0}};let o=W&&au&&((0,i.getRequestMeta)(a,"renderFallbackShell")||aw)?(0,p.u)(ai):null;return l({span:h,postponed:n,fallbackRouteParams:o})},o=async c=>{var d,g,h,j,k;let m,o=await N.handleResponse({cacheKey:aD,responseGenerator:a=>n({span:c,...a}),routeKind:f.RouteKind.APP_PAGE,isOnDemandRevalidate:ak,isRoutePPREnabled:au,req:a,nextConfig:ag,prerenderManifest:ab,waitUntil:e.waitUntil});if(ac&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),N.isDev&&b.setHeader("Cache-Control","no-store, must-revalidate"),!o){if(aD)throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return null}if((null==(d=o.value)?void 0:d.kind)!==y.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant app-page handler received invalid cache entry ${null==(h=o.value)?void 0:h.kind}`),"__NEXT_ERROR_CODE",{value:"E707",enumerable:!1,configurable:!0});let p="string"==typeof o.value.postponed;an&&!ay&&(!p||ar)&&(Q||b.setHeader("x-nextjs-cache",ak?"REVALIDATED":o.isMiss?"MISS":o.isStale?"STALE":"HIT"),b.setHeader(w.NEXT_IS_PRERENDER_HEADER,"1"));let{value:q}=o;if(ax)m={revalidate:0,expire:void 0};else if(Q&&as&&!ar&&au)m={revalidate:0,expire:void 0};else if(!N.isDev)if(ac)m={revalidate:0,expire:void 0};else if(an){if(o.cacheControl)if("number"==typeof o.cacheControl.revalidate){if(o.cacheControl.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${o.cacheControl.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1,configurable:!0});m={revalidate:o.cacheControl.revalidate,expire:(null==(j=o.cacheControl)?void 0:j.expire)??ag.expireTime}}else m={revalidate:B.CACHE_ONE_YEAR,expire:void 0}}else b.getHeader("Cache-Control")||(m={revalidate:0,expire:void 0});if(o.cacheControl=m,"string"==typeof az&&(null==q?void 0:q.kind)===y.CachedRouteKind.APP_PAGE&&q.segmentData){b.setHeader(w.NEXT_DID_POSTPONE_HEADER,"2");let c=null==(k=q.headers)?void 0:k[B.NEXT_CACHE_TAGS_HEADER];Q&&an&&c&&"string"==typeof c&&b.setHeader(B.NEXT_CACHE_TAGS_HEADER,c);let d=q.segmentData.get(az);return void 0!==d?(0,D.sendRenderResult)({req:a,res:b,generateEtags:ag.generateEtags,poweredByHeader:ag.poweredByHeader,result:A.default.fromStatic(d,w.RSC_CONTENT_TYPE_HEADER),cacheControl:o.cacheControl}):(b.statusCode=204,(0,D.sendRenderResult)({req:a,res:b,generateEtags:ag.generateEtags,poweredByHeader:ag.poweredByHeader,result:A.default.EMPTY,cacheControl:o.cacheControl}))}let r=(0,i.getRequestMeta)(a,"onCacheEntry");if(r&&await r({...o,value:{...o.value,kind:"PAGE"}},{url:(0,i.getRequestMeta)(a,"initURL")}))return null;if(p&&ax)throw Object.defineProperty(Error("Invariant: postponed state should not be present on a resume request"),"__NEXT_ERROR_CODE",{value:"E396",enumerable:!1,configurable:!0});if(q.headers){let a={...q.headers};for(let[c,d]of(Q&&an||delete a[B.NEXT_CACHE_TAGS_HEADER],Object.entries(a)))if(void 0!==d)if(Array.isArray(d))for(let a of d)b.appendHeader(c,a);else"number"==typeof d&&(d=d.toString()),b.appendHeader(c,d)}let s=null==(g=q.headers)?void 0:g[B.NEXT_CACHE_TAGS_HEADER];if(Q&&an&&s&&"string"==typeof s&&b.setHeader(B.NEXT_CACHE_TAGS_HEADER,s),!q.status||as&&au||(b.statusCode=q.status),!Q&&q.status&&I.RedirectStatusCode[q.status]&&as&&(b.statusCode=200),p&&b.setHeader(w.NEXT_DID_POSTPONE_HEADER,"1"),as&&!ac){if(void 0===q.rscData){if(q.postponed)throw Object.defineProperty(Error("Invariant: Expected postponed to be undefined"),"__NEXT_ERROR_CODE",{value:"E372",enumerable:!1,configurable:!0});return(0,D.sendRenderResult)({req:a,res:b,generateEtags:ag.generateEtags,poweredByHeader:ag.poweredByHeader,result:q.html,cacheControl:ay?{revalidate:0,expire:void 0}:o.cacheControl})}return(0,D.sendRenderResult)({req:a,res:b,generateEtags:ag.generateEtags,poweredByHeader:ag.poweredByHeader,result:A.default.fromStatic(q.rscData,w.RSC_CONTENT_TYPE_HEADER),cacheControl:o.cacheControl})}let t=q.html;if(!p||Q||as)return(0,D.sendRenderResult)({req:a,res:b,generateEtags:ag.generateEtags,poweredByHeader:ag.poweredByHeader,result:t,cacheControl:o.cacheControl});if(av)return t.push(new ReadableStream({start(a){a.enqueue(C.ENCODED_TAGS.CLOSED.BODY_AND_HTML),a.close()}})),(0,D.sendRenderResult)({req:a,res:b,generateEtags:ag.generateEtags,poweredByHeader:ag.poweredByHeader,result:t,cacheControl:{revalidate:0,expire:void 0}});let u=new TransformStream;return t.push(u.readable),l({span:c,postponed:q.postponed,fallbackRouteParams:null}).then(async a=>{var b,c;if(!a)throw Object.defineProperty(Error("Invariant: expected a result to be returned"),"__NEXT_ERROR_CODE",{value:"E463",enumerable:!1,configurable:!0});if((null==(b=a.value)?void 0:b.kind)!==y.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant: expected a page response, got ${null==(c=a.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E305",enumerable:!1,configurable:!0});await a.value.html.pipeTo(u.writable)}).catch(a=>{u.writable.abort(a).catch(a=>{console.error("couldn't abort transformer",a)})}),(0,D.sendRenderResult)({req:a,res:b,generateEtags:ag.generateEtags,poweredByHeader:ag.poweredByHeader,result:t,cacheControl:{revalidate:0,expire:void 0}})};if(!aI)return await aH.withPropagatedContext(a.headers,()=>aH.trace(j.BaseServerSpan.handleRequest,{spanName:`${aG} ${a.url}`,kind:h.SpanKind.SERVER,attributes:{"http.method":aG,"http.target":a.url}},o));await o(aI)}catch(b){throw b instanceof E.NoFallbackError||await N.onRequestError(a,b,{routerKind:"App Router",routePath:J,routeType:"render",revalidateReason:(0,g.c)({isRevalidate:an,isOnDemandRevalidate:ak})},af),b}}},76756:(a,b,c)=>{"use strict";c.d(b,{j:()=>k});var d=c(5009),e=c(78820),f=c(68388),g=c(18442),h=c(8940);function i(a,b){if(0===b.length||0===a.clientHeight)return[0,0];let c=Number.MAX_VALUE,d=0;for(let e of b){let b=a.querySelector(`a[href="#${e}"]`);if(!b)continue;let f=getComputedStyle(b);c=Math.min(c,b.offsetTop+parseFloat(f.paddingTop)),d=Math.max(d,b.offsetTop+b.clientHeight-parseFloat(f.paddingBottom))}return[c,d-c]}function j(a,b){a.style.setProperty("--fd-top",`${b[0]}px`),a.style.setProperty("--fd-height",`${b[1]}px`)}function k({containerRef:a,...b}){let c=f.Mf(),k=(0,e.useRef)(null),l=(0,h.J)(()=>{a.current&&k.current&&j(k.current,i(a.current,c))});return(0,e.useEffect)(()=>{if(!a.current)return;let b=a.current;l();let c=new ResizeObserver(l);return c.observe(b),()=>{c.disconnect()}},[a]),(0,g.T)(c,()=>{a.current&&k.current&&j(k.current,i(a.current,c))}),(0,d.jsx)("div",{ref:k,role:"none",...b})}},77183:(a,b,c)=>{"use strict";c.d(b,{TOCItems:()=>g,TOCProvider:()=>e,TOCScrollArea:()=>f});var d=c(71935);(0,d.registerClientReference)(function(){throw Error("Attempted to call useTOCItems() from the server but useTOCItems is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/toc.js","useTOCItems");let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call TOCProvider() from the server but TOCProvider is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/toc.js","TOCProvider"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call TOCScrollArea() from the server but TOCScrollArea is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/toc.js","TOCScrollArea"),g=(0,d.registerClientReference)(function(){throw Error("Attempted to call TOCItems() from the server but TOCItems is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/toc.js","TOCItems")},82425:(a,b,c)=>{"use strict";c.d(b,{TOCItems:()=>o,TOCProvider:()=>m,TOCScrollArea:()=>n,a:()=>l});var d=c(5009),e=c(68388),f=c(78820),g=c(17265),h=c(38002),i=c(76756),j=c(49560);let k=(0,f.createContext)([]);function l(){return(0,f.useContext)(k)}function m({toc:a,children:b,...c}){return(0,d.jsx)(k,{value:a,children:(0,d.jsx)(e.NQ,{toc:a,...c,children:b})})}function n({ref:a,className:b,...c}){let h=(0,f.useRef)(null);return(0,d.jsx)("div",{ref:(0,j.P)(h,a),className:(0,g.QP)("relative min-h-0 text-sm ms-px overflow-auto [scrollbar-width:none] [mask-image:linear-gradient(to_bottom,transparent,white_16px,white_calc(100%-16px),transparent)] py-3",b),...c,children:(0,d.jsx)(e.N2,{containerRef:h,children:c.children})})}function o({ref:a,className:b,...c}){let e=(0,f.useRef)(null),k=l(),{text:m}=(0,h.useI18n)();return 0===k.length?(0,d.jsx)("div",{className:"rounded-lg border bg-fd-card p-3 text-xs text-fd-muted-foreground",children:m.tocNoHeadings}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(i.j,{containerRef:e,className:"absolute top-(--fd-top) h-(--fd-height) w-px bg-fd-primary transition-all"}),(0,d.jsx)("div",{ref:(0,j.P)(a,e),className:(0,g.QP)("flex flex-col border-s border-fd-foreground/10",b),...c,children:k.map(a=>(0,d.jsx)(p,{item:a},a.url))})]})}function p({item:a}){return(0,d.jsx)(e.Cz,{href:a.url,className:(0,g.QP)("prose py-1.5 text-sm text-fd-muted-foreground transition-colors [overflow-wrap:anywhere] first:pt-0 last:pb-0 data-[active=true]:text-fd-primary",a.depth<=2&&"ps-3",3===a.depth&&"ps-6",a.depth>=4&&"ps-8"),children:a.title})}},83854:(a,b,c)=>{"use strict";c.d(b,{RootToggle:()=>d});let d=(0,c(71935).registerClientReference)(function(){throw Error("Attempted to call RootToggle() from the server but RootToggle is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/components/layout/root-toggle.js","RootToggle")},84368:(a,b,c)=>{"use strict";c.d(b,{BaseLinkItem:()=>d});let d=(0,c(71935).registerClientReference)(function(){throw Error("Attempted to call BaseLinkItem() from the server but BaseLinkItem is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/pierrejankowiez/Documents/ascent-studio/projects/cue/cue-system/node_modules/.pnpm/fumadocs-ui@15.8.5_@types+react-dom@19.3.0_@types+react@19.3.0__@types+react@19.3.0_lucide-re_celvvyqzmcbjy5gzxopkw7t6jm/node_modules/fumadocs-ui/dist/layouts/shared/client.js","BaseLinkItem")},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},93586:(a,b,c)=>{"use strict";let d;c.d(b,{AM:()=>bt,hl:()=>bv,Wv:()=>bu});var e=c(5009),f=c(78820),g=c(84335),h=c(3411),i=c(26227),j=c(68699),k=c(4368),l=c(51093),m=c(95270);let n=["top","right","bottom","left"],o=Math.min,p=Math.max,q=Math.round,r=Math.floor,s=a=>({x:a,y:a}),t={left:"right",right:"left",bottom:"top",top:"bottom"};function u(a,b){return"function"==typeof a?a(b):a}function w(a){return a.split("-")[0]}function x(a){return a.split("-")[1]}function y(a){return"x"===a?"y":"x"}function z(a){return"y"===a?"height":"width"}function A(a){let b=a[0];return"t"===b||"b"===b?"y":"x"}function B(a){return a.includes("start")?a.replace("start","end"):a.replace("end","start")}let C=["left","right"],D=["right","left"],E=["top","bottom"],F=["bottom","top"];function G(a){let b=w(a);return t[b]+a.slice(b.length)}function H(a){var b,c,d,e;return"number"!=typeof a?{top:null!=(b=a.top)?b:0,right:null!=(c=a.right)?c:0,bottom:null!=(d=a.bottom)?d:0,left:null!=(e=a.left)?e:0}:{top:a,right:a,bottom:a,left:a}}function I(a){let{x:b,y:c,width:d,height:e}=a;return{width:d,height:e,top:c,left:b,right:b+d,bottom:c+e,x:b,y:c}}function J(a,b,c){let d,{reference:e,floating:f}=a,g=A(b),h=y(A(b)),i=z(h),j=w(b),k=e.x+e.width/2-f.width/2,l=e.y+e.height/2-f.height/2,m=e[i]/2-f[i]/2;switch(j){case"top":d={x:k,y:e.y-f.height};break;case"bottom":d={x:k,y:e.y+e.height};break;case"right":d={x:e.x+e.width,y:l};break;case"left":d={x:e.x-f.width,y:l};break;default:d={x:e.x,y:e.y}}let n=x(b);return n&&(d[h]+=m*("end"===n?1:-1)*(c&&"y"===g?-1:1)),d}async function K(a,b){var c;void 0===b&&(b={});let{x:d,y:e,platform:f,rects:g,elements:h,strategy:i}=a,{boundary:j="clippingAncestors",rootBoundary:k="viewport",elementContext:l="floating",altBoundary:m=!1,padding:n=0}=u(b,a),o=H(n),p=h[m?"floating"===l?"reference":"floating":l],q=I(await f.getClippingRect({element:null==(c=await (null==f.isElement?void 0:f.isElement(p)))||c?p:p.contextElement||await (null==f.getDocumentElement?void 0:f.getDocumentElement(h.floating)),boundary:j,rootBoundary:k,strategy:i})),r="floating"===l?{x:d,y:e,width:g.floating.width,height:g.floating.height}:g.reference,s=await (null==f.getOffsetParent?void 0:f.getOffsetParent(h.floating)),t=await (null==f.isElement?void 0:f.isElement(s))&&await (null==f.getScale?void 0:f.getScale(s))||{x:1,y:1},w=I(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:h,rect:r,offsetParent:s,strategy:i}):r);return{top:(q.top-w.top+o.top)/t.y,bottom:(w.bottom-q.bottom+o.bottom)/t.y,left:(q.left-w.left+o.left)/t.x,right:(w.right-q.right+o.right)/t.x}}let L=async(a,b,c)=>{let{placement:d="bottom",strategy:e="absolute",middleware:f=[],platform:g}=c,h=g.detectOverflow?g:{...g,detectOverflow:K},i=await (null==g.isRTL?void 0:g.isRTL(b)),j=await g.getElementRects({reference:a,floating:b,strategy:e}),{x:k,y:l}=J(j,d,i),m=d,n=0,o={};for(let c=0;c<f.length;c++){let p=f[c];if(!p)continue;let{name:q,fn:r}=p,{x:s,y:t,data:u,reset:w}=await r({x:k,y:l,initialPlacement:d,placement:m,strategy:e,middlewareData:o,rects:j,platform:h,elements:{reference:a,floating:b}});k=null!=s?s:k,l=null!=t?t:l,o[q]={...o[q],...u},w&&n<50&&(n++,"object"==typeof w&&(w.placement&&(m=w.placement),w.rects&&(j=!0===w.rects?await g.getElementRects({reference:a,floating:b,strategy:e}):w.rects),{x:k,y:l}=J(j,m,i)),c=-1)}return{x:k,y:l,placement:m,strategy:e,middlewareData:o}};function M(a,b){return{top:a.top-b.height,right:a.right-b.width,bottom:a.bottom-b.height,left:a.left-b.width}}function N(a){return n.some(b=>a[b]>=0)}let O=new Set(["left","top"]);async function P(a,b){let{placement:c,platform:d,elements:e}=a,f=await (null==d.isRTL?void 0:d.isRTL(e.floating)),g=w(c),h=x(c),i="y"===A(c),j=O.has(g)?-1:1,k=f&&i?-1:1,l=u(b,a),{mainAxis:m,crossAxis:n,alignmentAxis:o}="number"==typeof l?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return h&&"number"==typeof o&&(n="end"===h?-1*o:o),i?{x:n*k,y:m*j}:{x:m*j,y:n*k}}function Q(){return"undefined"!=typeof window}function R(a){return U(a)?(a.nodeName||"").toLowerCase():"#document"}function S(a){var b;return(null==a||null==(b=a.ownerDocument)?void 0:b.defaultView)||window}function T(a){var b;return null==(b=(U(a)?a.ownerDocument:a.document)||window.document)?void 0:b.documentElement}function U(a){return!!Q()&&(a instanceof Node||a instanceof S(a).Node)}function V(a){return!!Q()&&(a instanceof Element||a instanceof S(a).Element)}function W(a){return!!Q()&&(a instanceof HTMLElement||a instanceof S(a).HTMLElement)}function X(a){return!!Q()&&"undefined"!=typeof ShadowRoot&&(a instanceof ShadowRoot||a instanceof S(a).ShadowRoot)}function Y(a){let{overflow:b,overflowX:c,overflowY:d,display:e}=ae(a);return/auto|scroll|overlay|hidden|clip/.test(b+d+c)&&"inline"!==e&&"contents"!==e}function Z(a){try{if(a.matches(":popover-open"))return!0}catch(a){}try{return a.matches(":modal")}catch(a){return!1}}let $=/transform|translate|scale|rotate|perspective|filter/,_=/paint|layout|strict|content/,aa=a=>!!a&&"none"!==a;function ab(a){let b=V(a)?ae(a):a;return aa(b.transform)||aa(b.translate)||aa(b.scale)||aa(b.rotate)||aa(b.perspective)||!ac()&&(aa(b.backdropFilter)||aa(b.filter))||$.test(b.willChange||"")||_.test(b.contain||"")}function ac(){return null==d&&(d="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),d}function ad(a){return/^(html|body|#document)$/.test(R(a))}function ae(a){return S(a).getComputedStyle(a)}function af(a){return V(a)?{scrollLeft:a.scrollLeft,scrollTop:a.scrollTop}:{scrollLeft:a.scrollX,scrollTop:a.scrollY}}function ag(a){if("html"===R(a))return a;let b=a.assignedSlot||a.parentNode||X(a)&&a.host||T(a);return X(b)?b.host:b}function ah(a,b,c){var d;void 0===b&&(b=[]),void 0===c&&(c=!0);let e=function a(b){let c=ag(b);return ad(c)?(b.ownerDocument||b).body:W(c)&&Y(c)?c:a(c)}(a),f=e===(null==(d=a.ownerDocument)?void 0:d.body),g=S(e);if(!f)return b.concat(e,ah(e,[],c));{let a=ai(g);return b.concat(g,g.visualViewport||[],Y(e)?e:[],a&&c?ah(a):[])}}function ai(a){return a.parent&&Object.getPrototypeOf(a.parent)?a.frameElement:null}function aj(a){let b=ae(a),c=parseFloat(b.width)||0,d=parseFloat(b.height)||0,e=W(a),f=e?a.offsetWidth:c,g=e?a.offsetHeight:d,h=q(c)!==f||q(d)!==g;return h&&(c=f,d=g),{width:c,height:d,$:h}}function ak(a){return V(a)?a:a.contextElement}function al(a){let b=ak(a);if(!W(b))return s(1);let c=b.getBoundingClientRect(),{width:d,height:e,$:f}=aj(b),g=(f?q(c.width):c.width)/d,h=(f?q(c.height):c.height)/e;return g&&Number.isFinite(g)||(g=1),h&&Number.isFinite(h)||(h=1),{x:g,y:h}}let am=s(0);function an(a){let b=S(a);return ac()&&b.visualViewport?{x:b.visualViewport.offsetLeft,y:b.visualViewport.offsetTop}:am}function ao(a,b,c,d){var e;void 0===b&&(b=!1),void 0===c&&(c=!1);let f=a.getBoundingClientRect(),g=ak(a),h=s(1);b&&(d?V(d)&&(h=al(d)):h=al(a));let i=(void 0===(e=c)&&(e=!1),d&&e&&d===S(g))?an(g):s(0),j=(f.left+i.x)/h.x,k=(f.top+i.y)/h.y,l=f.width/h.x,m=f.height/h.y;if(g&&d){let a=S(g),b=V(d)?S(d):d,c=a,e=ai(c);for(;e&&b!==c;){let a=al(e),b=e.getBoundingClientRect(),d=ae(e),f=b.left+(e.clientLeft+parseFloat(d.paddingLeft))*a.x,g=b.top+(e.clientTop+parseFloat(d.paddingTop))*a.y;j*=a.x,k*=a.y,l*=a.x,m*=a.y,j+=f,k+=g,e=ai(c=S(e))}}return I({width:l,height:m,x:j,y:k})}function ap(a,b){let c=af(a).scrollLeft;return b?b.left+c:ao(T(a)).left+c}function aq(a,b){let c=a.getBoundingClientRect();return{x:c.left+b.scrollLeft-ap(a,c),y:c.top+b.scrollTop}}function ar(a,b,c){let d;if("viewport"===b||"layoutViewport"===b)d=function(a,b,c){void 0===c&&(c="viewport");let d="layoutViewport"===c,e=S(a),f=T(a),g=e.visualViewport,h=f.clientWidth,i=f.clientHeight,j=0,k=0;if(g){let a=!ac()||"fixed"===b;d?a||(j=-g.offsetLeft,k=-g.offsetTop):(h=g.width,i=g.height,a&&(j=g.offsetLeft,k=g.offsetTop))}if(0>=ap(f)){let a=f.ownerDocument,b=a.body,c=getComputedStyle(b),d="CSS1Compat"===a.compatMode&&parseFloat(c.marginLeft)+parseFloat(c.marginRight)||0,e=Math.abs(f.clientWidth-b.clientWidth-d),g="stable both-edges"===getComputedStyle(f).scrollbarGutter?e/2:e;g<=25&&(h-=g)}return{width:h,height:i,x:j,y:k}}(a,c,b);else if("document"===b)d=function(a){let b=af(a),c=a.ownerDocument.body,d=p(a.scrollWidth,a.clientWidth,c.scrollWidth,c.clientWidth),e=p(a.scrollHeight,a.clientHeight,c.scrollHeight,c.clientHeight),f=-b.scrollLeft+ap(a),g=-b.scrollTop;return"rtl"===ae(c).direction&&(f+=p(a.clientWidth,c.clientWidth)-d),{width:d,height:e,x:f,y:g}}(T(a));else if(V(b))d=function(a,b){let c=ao(a,!0,"fixed"===b),d=c.top+a.clientTop,e=c.left+a.clientLeft,f=al(a),g=a.clientWidth*f.x,h=a.clientHeight*f.y;return{width:g,height:h,x:e*f.x,y:d*f.y}}(b,c);else{let c=an(a);d={x:b.x-c.x,y:b.y-c.y,width:b.width,height:b.height}}return I(d)}function as(a){return"static"===ae(a).position}function at(a,b){if(!W(a)||"fixed"===ae(a).position)return null;if(b)return b(a);let c=a.offsetParent;return T(a)===c&&(c=c.ownerDocument.body),c}function au(a,b){var c;let d=S(a);if(Z(a))return d;if(!W(a)){let b=ag(a);for(;b&&!ad(b);){if(V(b)&&!as(b))return b;b=ag(b)}return d}let e=at(a,b);for(;e&&(c=e,/^(table|td|th)$/.test(R(c)))&&as(e);)e=at(e,b);return e&&ad(e)&&as(e)&&!ab(e)?d:e||function(a){let b=ag(a);for(;W(b)&&!ad(b);){if(ab(b))return b;if(Z(b))break;b=ag(b)}return null}(a)||d}let av=async function(a){let b=this.getOffsetParent||au,c=this.getDimensions,d=await c(a.floating);return{reference:function(a,b,c){let d=W(b),e=T(b),f="fixed"===c,g=ao(a,!0,f,b),h={scrollLeft:0,scrollTop:0},i=s(0);if((d||!f)&&(("body"!==R(b)||Y(e))&&(h=af(b)),d)){let a=ao(b,!0,f,b);i.x=a.x+b.clientLeft,i.y=a.y+b.clientTop}!d&&e&&(i.x=ap(e));let j=!e||d||f?s(0):aq(e,h);return{x:g.left+h.scrollLeft-i.x-j.x,y:g.top+h.scrollTop-i.y-j.y,width:g.width,height:g.height}}(a.reference,await b(a.floating),a.strategy),floating:{x:0,y:0,width:d.width,height:d.height}}},aw={convertOffsetParentRelativeRectToViewportRelativeRect:function(a){let{elements:b,rect:c,offsetParent:d,strategy:e}=a,f="fixed"===e,g=T(d),h=!!b&&Z(b.floating);if(d===g||h&&f)return c;let i={scrollLeft:0,scrollTop:0},j=s(1),k=s(0),l=W(d);if((l||!f)&&(("body"!==R(d)||Y(g))&&(i=af(d)),l)){let a=ao(d);j=al(d),k.x=a.x+d.clientLeft,k.y=a.y+d.clientTop}let m=!g||l||f?s(0):aq(g,i);return{width:c.width*j.x,height:c.height*j.y,x:c.x*j.x-i.scrollLeft*j.x+k.x+m.x,y:c.y*j.y-i.scrollTop*j.y+k.y+m.y}},getDocumentElement:T,getClippingRect:function(a){let{element:b,boundary:c,rootBoundary:d,strategy:e}=a,f=[..."clippingAncestors"===c?Z(b)?[]:function(a,b){let c=b.get(a);if(c)return c;let d=ah(a,[],!1).filter(a=>V(a)&&"body"!==R(a)),e=null,f="fixed"===ae(a).position,g=f?ag(a):a;for(;V(g)&&!ad(g);){let a=ae(g),b=ab(g),c=e?e.position:f?"fixed":"";b||"fixed"!==c&&("absolute"!==c||"static"!==a.position)?e=a:d=d.filter(a=>a!==g),g=ag(g)}return b.set(a,d),d}(b,this._c):[].concat(c),d],g=ar(b,f[0],e),h=g.top,i=g.right,j=g.bottom,k=g.left;for(let a=1;a<f.length;a++){let c=ar(b,f[a],e);h=p(c.top,h),i=o(c.right,i),j=o(c.bottom,j),k=p(c.left,k)}return{width:i-k,height:j-h,x:k,y:h}},getOffsetParent:au,getElementRects:av,getClientRects:function(a){return a.getClientRects?Array.from(a.getClientRects()):[]},getDimensions:function(a){let{width:b,height:c}=aj(a);return{width:b,height:c}},getScale:al,isElement:V,isRTL:function(a){return"rtl"===ae(a).direction}};function ax(a,b){return a.x===b.x&&a.y===b.y&&a.width===b.width&&a.height===b.height}let ay=a=>({name:"arrow",options:a,async fn(b){let{x:c,y:d,placement:e,rects:f,platform:g,elements:h,middlewareData:i}=b,{element:j,padding:k=0}=u(a,b)||{};if(null==j)return{};let l=H(k),m={x:c,y:d},n=y(A(e)),q=z(n),r=await g.getDimensions(j),s="y"===n,t=s?"clientHeight":"clientWidth",w=f.reference[q]+f.reference[n]-m[n]-f.floating[q],B=m[n]-f.reference[n],C=await (null==g.getOffsetParent?void 0:g.getOffsetParent(j)),D=C?C[t]:0;D&&await (null==g.isElement?void 0:g.isElement(C))||(D=h.floating[t]||f.floating[q]);let E=D/2-r[q]/2-1,F=o(l[s?"top":"left"],E),G=o(l[s?"bottom":"right"],E),I=D-r[q]-G,J=D/2-r[q]/2+(w/2-B/2),K=p(F,o(J,I)),L=!i.arrow&&null!=x(e)&&J!==K&&f.reference[q]/2-(J<F?F:G)-r[q]/2<0,M=L?J<F?J-F:J-I:0;return{[n]:m[n]+M,data:{[n]:K,centerOffset:J-K-M,...L&&{alignmentOffset:M}},reset:L}}});var az=c(91029),aA="undefined"!=typeof document?f.useLayoutEffect:function(){};function aB(a,b){let c,d,e;if(a===b)return!0;if(typeof a!=typeof b)return!1;if("function"==typeof a&&a.toString()===b.toString())return!0;if(a&&b&&"object"==typeof a){if(Array.isArray(a)){if((c=a.length)!==b.length)return!1;for(d=c;0!=d--;)if(!aB(a[d],b[d]))return!1;return!0}if((c=(e=Object.keys(a)).length)!==Object.keys(b).length)return!1;for(d=c;0!=d--;)if(!({}).hasOwnProperty.call(b,e[d]))return!1;for(d=c;0!=d--;){let c=e[d];if(("_owner"!==c||!a.$$typeof)&&!aB(a[c],b[c]))return!1}return!0}return a!=a&&b!=b}function aC(a){return"undefined"==typeof window?1:(a.ownerDocument.defaultView||window).devicePixelRatio||1}function aD(a,b){let c=aC(a);return Math.round(b*c)/c}function aE(a){let b=f.useRef(a);return aA(()=>{b.current=a}),b}var aF=c(52742),aG=c(28510),aH=c(69524);function aI(a){let[b,c]=f.useState(void 0);return(0,aH.N)(()=>{if(a){c({width:a.offsetWidth,height:a.offsetHeight});let b=0,d=new ResizeObserver(d=>{if(!Array.isArray(d)||!d.length)return;let e=d[0];window.cancelAnimationFrame(b),b=window.requestAnimationFrame(()=>{let b,d;if("borderBoxSize"in e){let a=e.borderBoxSize,c=Array.isArray(a)?a[0]:a;b=c.inlineSize,d=c.blockSize}else b=a.offsetWidth,d=a.offsetHeight;c({width:b,height:d})})});return d.observe(a,{box:"border-box"}),()=>{window.cancelAnimationFrame(b),d.unobserve(a)}}c(void 0)},[a]),b}(0,Object.defineProperty)(aI,"name",{value:"useSize",configurable:!0});var aJ=Object.defineProperty,aK=(a,b)=>aJ(a,"name",{value:b,configurable:!0}),aL={Partial:"partial"},aM={Optimized:"optimized",Always:"always"},aN="Popper",[aO,aP]=(0,i.A)(aN),[aQ,aR]=aO(aN),aS=aK(a=>{let{__scopePopper:b,children:c}=a,[d,g]=f.useState(null),[h,i]=f.useState(void 0);return(0,e.jsx)(aQ,{scope:b,anchor:d,onAnchorChange:g,placementState:h,setPlacementState:i,children:c})},"Popper"),aT=f.forwardRef(aK(function(a,b){let{__scopePopper:c,virtualRef:d,...g}=a,i=aR("PopperAnchor",c),j=f.useRef(null),k=i.onAnchorChange,l=f.useCallback(a=>{j.current=a,a&&k(a)},[k]),m=(0,h.s)(b,l),n=f.useRef(null);f.useEffect(()=>{if(!d)return;let a=n.current;n.current=d.current,a!==n.current&&k(n.current)});let o=i.placementState&&a$(i.placementState),p=o?.[0],q=o?.[1];return d?null:(0,e.jsx)(aF.sG.div,{"data-radix-popper-side":p,"data-radix-popper-align":q,...g,ref:m})},"PopperAnchor")),aU="PopperContent",[aV,aW]=aO(aU),aX=f.forwardRef(aK(function(a,b){var c,d,g;let{__scopePopper:i,side:j="bottom",sideOffset:k=0,align:l="center",alignOffset:m=0,arrowPadding:n=0,avoidCollisions:q=!0,collisionBoundary:s=[],collisionPadding:t=0,sticky:H=aL.Partial,hideWhenDetached:I=!1,updatePositionStrategy:J=aM.Optimized,onPlaced:K,...Q}=a,R=aR(aU,i),[U,V]=f.useState(null),W=(0,h.s)(b,V),[X,Y]=f.useState(null),Z=aI(X),$=Z?.width??0,_=Z?.height??0,aa="number"==typeof t?t:{top:0,right:0,bottom:0,left:0,...t},ab=Array.isArray(s)?s:[s],ac=ab.length>0,ad={padding:aa,boundary:ab.filter(aY),altBoundary:ac},{refs:ae,floatingStyles:af,placement:ag,isPositioned:ai,middlewareData:aj}=function(a){void 0===a&&(a={});let{placement:b="bottom",strategy:c="absolute",middleware:d=[],platform:e,elements:{reference:g,floating:h}={},transform:i=!0,whileElementsMounted:j,open:k}=a,[l,m]=f.useState({x:0,y:0,strategy:c,placement:b,middlewareData:{},isPositioned:!1}),[n,o]=f.useState(d);aB(n,d)||o(d);let[p,q]=f.useState(null),[r,s]=f.useState(null),t=f.useCallback(a=>{a!==y.current&&(y.current=a,q(a))},[]),u=f.useCallback(a=>{a!==z.current&&(z.current=a,s(a))},[]),w=g||p,x=h||r,y=f.useRef(null),z=f.useRef(null),A=f.useRef(l),B=null!=j,C=aE(j),D=aE(e),E=aE(k),F=f.useCallback(()=>{if(!y.current||!z.current)return;let a={placement:b,strategy:c,middleware:n};D.current&&(a.platform=D.current),((a,b,c)=>{let d=new Map,e=null!=c?c:{},f={...aw,...e.platform,_c:d};return L(a,b,{...e,platform:f})})(y.current,z.current,a).then(a=>{let b={...a,isPositioned:!1!==E.current};G.current&&!aB(A.current,b)&&(A.current=b,az.flushSync(()=>{m(b)}))})},[n,b,c,D,E]);aA(()=>{!1===k&&A.current.isPositioned&&(A.current.isPositioned=!1,m(a=>({...a,isPositioned:!1})))},[k]);let G=f.useRef(!1);aA(()=>(G.current=!0,()=>{G.current=!1}),[]),aA(()=>{if(w&&(y.current=w),x&&(z.current=x),w&&x){if(C.current)return C.current(w,x,F);F()}},[w,x,F,C,B]);let H=f.useMemo(()=>({reference:y,floating:z,setReference:t,setFloating:u}),[t,u]),I=f.useMemo(()=>({reference:w,floating:x}),[w,x]),J=f.useMemo(()=>{let a={position:c,left:0,top:0};if(!I.floating)return a;let b=aD(I.floating,l.x),d=aD(I.floating,l.y);return i?{...a,transform:"translate("+b+"px, "+d+"px)",...aC(I.floating)>=1.5&&{willChange:"transform"}}:{position:c,left:b,top:d}},[c,i,I.floating,l.x,l.y]);return f.useMemo(()=>({...l,update:F,refs:H,elements:I,floatingStyles:J}),[l,F,H,I,J])}({strategy:"fixed",placement:j+("center"!==l?"-"+l:""),whileElementsMounted:aK((...a)=>(function(a,b,c,d){let e;void 0===d&&(d={});let{ancestorScroll:f=!0,ancestorResize:g=!0,elementResize:h="function"==typeof ResizeObserver,layoutShift:i="function"==typeof IntersectionObserver,animationFrame:j=!1}=d,k=ak(a),l=f||g?[...k?ah(k):[],...b?ah(b):[]]:[];l.forEach(a=>{f&&a.addEventListener("scroll",c),g&&a.addEventListener("resize",c)});let m=k&&i?function(a,b,c){let d,e=null,f=T(a);function g(){var a;clearTimeout(d),null==(a=e)||a.disconnect(),e=null}function h(c,i){void 0===c&&(c=!1),void 0===i&&(i=1),g();let j=a.getBoundingClientRect(),{left:k,top:l,width:m,height:n}=j;if(c||b(),!m||!n)return;let q=r(l),s=r(f.clientWidth-(k+m)),t={rootMargin:-q+"px "+-s+"px "+-r(f.clientHeight-(l+n))+"px "+-r(k)+"px",threshold:p(0,o(1,i))||1},u=!0;function w(b){let c=b[0].intersectionRatio;if(!ax(j,a.getBoundingClientRect()))return h();if(c!==i){if(!u)return h();c?h(!1,c):d=setTimeout(()=>{h(!1,1e-7)},1e3)}u=!1}try{e=new IntersectionObserver(w,{...t,root:f.ownerDocument})}catch(a){e=new IntersectionObserver(w,t)}e.observe(a)}let i=S(a),j=()=>h(c);return i.addEventListener("resize",j),h(!0),()=>{i.removeEventListener("resize",j),g()}}(k,c,g):null,n=-1,q=null;h&&(q=new ResizeObserver(a=>{let[d]=a;d&&d.target===k&&q&&b&&(q.unobserve(b),cancelAnimationFrame(n),n=requestAnimationFrame(()=>{var a;null==(a=q)||a.observe(b)})),c()}),k&&!j&&q.observe(k),b&&q.observe(b));let s=j?ao(a):null;return j&&function b(){let d=ao(a);s&&!ax(s,d)&&c(),s=d,e=requestAnimationFrame(b)}(),c(),()=>{var a;l.forEach(a=>{f&&a.removeEventListener("scroll",c),g&&a.removeEventListener("resize",c)}),null==m||m(),null==(a=q)||a.disconnect(),q=null,j&&cancelAnimationFrame(e)}})(...a,{animationFrame:J===aM.Always}),"whileElementsMounted"),elements:{reference:R.anchor},middleware:[((a,b)=>{var c;let d=(void 0===(c=a)&&(c=0),{name:"offset",options:c,async fn(a){var b,d;let{x:e,y:f,placement:g,middlewareData:h}=a,i=await P(a,c);return g===(null==(b=h.offset)?void 0:b.placement)&&null!=(d=h.arrow)&&d.alignmentOffset?{}:{x:e+i.x,y:f+i.y,data:{...i,placement:g}}}});return{name:d.name,fn:d.fn,options:[a,b]}})({mainAxis:k+_,alignmentAxis:m}),q&&((a,b)=>{var c;let d=(void 0===(c=a)&&(c={}),{name:"shift",options:c,async fn(a){let{x:b,y:d,placement:e,platform:f}=a,{mainAxis:g=!0,crossAxis:h=!1,limiter:i={fn:a=>{let{x:b,y:c}=a;return{x:b,y:c}}},...j}=u(c,a),k={x:b,y:d},l=await f.detectOverflow(a,j),m=A(e),n=y(m),q=k[n],r=k[m],s=(a,b)=>p(b+l["y"===a?"top":"left"],o(b,b-l["y"===a?"bottom":"right"]));g&&(q=s(n,q)),h&&(r=s(m,r));let t=i.fn({...a,[n]:q,[m]:r});return{...t,data:{x:t.x-b,y:t.y-d,enabled:{[n]:g,[m]:h}}}}});return{name:d.name,fn:d.fn,options:[a,b]}})({mainAxis:!0,crossAxis:!1,limiter:H===aL.Partial?{fn:(void 0===(g=c)&&(g={}),{options:g,fn(a){var b,c,d,e;let{x:f,y:h,placement:i,rects:j,middlewareData:k}=a,{offset:l=0,mainAxis:m=!0,crossAxis:n=!0}=u(g,a),o={x:f,y:h},p=A(i),q=y(p),r=o[q],s=o[p],t=u(l,a),x="number"==typeof t?{mainAxis:t,crossAxis:0}:{mainAxis:null!=(b=t.mainAxis)?b:0,crossAxis:null!=(c=t.crossAxis)?c:0};if(m){let a="y"===q?"height":"width",b=j.reference[q]-j.floating[a]+x.mainAxis,c=j.reference[q]+j.reference[a]-x.mainAxis;r<b?r=b:r>c&&(r=c)}if(n){let a="y"===q?"width":"height",b=O.has(w(i)),c=j.reference[p]-j.floating[a]+(b&&(null==(d=k.offset)?void 0:d[p])||0)+(b?0:x.crossAxis),f=j.reference[p]+j.reference[a]+(b?0:(null==(e=k.offset)?void 0:e[p])||0)-(b?x.crossAxis:0);s<c?s=c:s>f&&(s=f)}return{[q]:r,[p]:s}}}).fn,options:[c,d]}:void 0,...ad}),q&&((a,b)=>{var c;let d=(void 0===(c=a)&&(c={}),{name:"flip",options:c,async fn(a){var b,d,e,f,g;let{placement:h,middlewareData:i,rects:j,initialPlacement:k,platform:l,elements:m}=a,{mainAxis:n=!0,crossAxis:o=!0,fallbackPlacements:p,fallbackStrategy:q="bestFit",fallbackAxisSideDirection:r="none",flipAlignment:s=!0,...t}=u(c,a);if(null!=(b=i.arrow)&&b.alignmentOffset)return{};let H=w(h),I=A(k),J=w(k)===k,K=await (null==l.isRTL?void 0:l.isRTL(m.floating)),L=p||(J||!s?[G(k)]:function(a){let b=G(a);return[B(a),b,B(b)]}(k)),M="none"!==r;!p&&M&&L.push(...function(a,b,c,d){let e=x(a),f=function(a,b,c){switch(a){case"top":case"bottom":if(c)return b?D:C;return b?C:D;case"left":case"right":return b?E:F;default:return[]}}(w(a),"start"===c,d);return e&&(f=f.map(a=>a+"-"+e),b&&(f=f.concat(f.map(B)))),f}(k,s,r,K));let N=[k,...L],O=await l.detectOverflow(a,t),P=[],Q=(null==(d=i.flip)?void 0:d.overflows)||[];if(n&&P.push(O[H]),o){let a=function(a,b,c){void 0===c&&(c=!1);let d=x(a),e=y(A(a)),f=z(e),g="x"===e?d===(c?"end":"start")?"right":"left":"start"===d?"bottom":"top";return b.reference[f]>b.floating[f]&&(g=G(g)),[g,G(g)]}(h,j,K);P.push(O[a[0]],O[a[1]])}if(Q=[...Q,{placement:h,overflows:P}],!P.every(a=>a<=0)){let a=((null==(e=i.flip)?void 0:e.index)||0)+1,b=N[a];if(b&&("alignment"!==o||I===A(b)||Q.every(a=>A(a.placement)!==I||a.overflows[0]>0)))return{data:{index:a,overflows:Q},reset:{placement:b}};let c=null==(f=Q.filter(a=>a.overflows[0]<=0).sort((a,b)=>a.overflows[1]-b.overflows[1])[0])?void 0:f.placement;if(!c)switch(q){case"bestFit":{let a=null==(g=Q.filter(a=>{if(M){let b=A(a.placement);return b===I||"y"===b}return!0}).map(a=>[a.placement,a.overflows.filter(a=>a>0).reduce((a,b)=>a+b,0)]).sort((a,b)=>a[1]-b[1])[0])?void 0:g[0];a&&(c=a);break}case"initialPlacement":c=k}if(h!==c)return{reset:{placement:c}}}return{}}});return{name:d.name,fn:d.fn,options:[a,b]}})({...ad}),((a,b)=>{var c;let d=(void 0===(c=a)&&(c={}),{name:"size",options:c,async fn(a){let b,d,{placement:e,rects:f,platform:g,elements:h}=a,{apply:i=()=>{},...j}=u(c,a),k=await g.detectOverflow(a,j),l=w(e),m=x(e),n="y"===A(e),{width:q,height:r}=f.floating;"top"===l||"bottom"===l?(b=l,d=m===(await (null==g.isRTL?void 0:g.isRTL(h.floating))?"start":"end")?"left":"right"):(d=l,b="end"===m?"top":"bottom");let s=r-k.top-k.bottom,t=q-k.left-k.right,y=o(r-k[b],s),z=o(q-k[d],t),B=a.middlewareData.shift,C=!B,D=y,E=z;null!=B&&B.enabled.x&&(E=t),null!=B&&B.enabled.y&&(D=s),C&&!m&&(n?E=q-2*p(k.left,k.right):D=r-2*p(k.top,k.bottom)),await i({...a,availableWidth:E,availableHeight:D});let F=await g.getDimensions(h.floating);return q!==F.width||r!==F.height?{reset:{rects:!0}}:{}}});return{name:d.name,fn:d.fn,options:[a,b]}})({...ad,apply:aK(({elements:a,rects:b,availableWidth:c,availableHeight:d})=>{let{width:e,height:f}=b.reference,g=a.floating.style;g.setProperty("--radix-popper-available-width",`${c}px`),g.setProperty("--radix-popper-available-height",`${d}px`),g.setProperty("--radix-popper-anchor-width",`${e}px`),g.setProperty("--radix-popper-anchor-height",`${f}px`)},"apply")}),X&&((a,b)=>{let c,d={name:"arrow",options:c=a,fn(a){let{element:b,padding:d}="function"==typeof c?c(a):c;return b&&({}).hasOwnProperty.call(b,"current")?null!=b.current?ay({element:b.current,padding:d}).fn(a):{}:b?ay({element:b,padding:d}).fn(a):{}}};return{name:d.name,fn:d.fn,options:[a,b]}})({element:X,padding:n}),aZ({arrowWidth:$,arrowHeight:_}),I&&((a,b)=>{var c;let d=(void 0===(c=a)&&(c={}),{name:"hide",options:c,async fn(a){let{rects:b,platform:d}=a,{strategy:e="referenceHidden",...f}=u(c,a);switch(e){case"referenceHidden":{let c=M(await d.detectOverflow(a,{...f,elementContext:"reference"}),b.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:N(c)}}}case"escaped":{let c=M(await d.detectOverflow(a,{...f,altBoundary:!0}),b.floating);return{data:{escapedOffsets:c,escaped:N(c)}}}default:return{}}}});return{name:d.name,fn:d.fn,options:[a,b]}})({strategy:"referenceHidden",...ad,boundary:ac?ad.boundary:void 0})]}),al=R.setPlacementState;(0,aH.N)(()=>(al(ag),()=>{al(void 0)}),[ag,al]);let[am,an]=a$(ag),ap=(0,aG.c)(K);(0,aH.N)(()=>{ai&&ap?.()},[ai,ap]);let aq=aj.arrow?.x,ar=aj.arrow?.y,as=aj.arrow?.centerOffset!==0,[at,au]=f.useState();return(0,aH.N)(()=>{U&&au(window.getComputedStyle(U).zIndex)},[U]),(0,e.jsx)("div",{ref:ae.setFloating,"data-radix-popper-content-wrapper":"",style:{...af,transform:ai?af.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:at,"--radix-popper-transform-origin":[aj.transformOrigin?.x,aj.transformOrigin?.y].join(" "),...aj.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:a.dir,children:(0,e.jsx)(aV,{scope:i,placedSide:am,placedAlign:an,onArrowChange:Y,arrowX:aq,arrowY:ar,shouldHideArrow:as,children:(0,e.jsx)(aF.sG.div,{"data-side":am,"data-align":an,...Q,ref:W,style:{...Q.style,animation:ai?Q.style?.animation:"none"}})})})},"PopperContent"));function aY(a){return null!==a}aK(aY,"isNotNull");var aZ=aK(a=>({name:"transformOrigin",options:a,fn(b){let{placement:c,rects:d,middlewareData:e}=b,f=e.arrow?.centerOffset!==0,g=f?0:a.arrowWidth,h=f?0:a.arrowHeight,[i,j]=a$(c),k={start:"0%",center:"50%",end:"100%"}[j],l=(e.arrow?.x??0)+g/2,m=(e.arrow?.y??0)+h/2,n="",o="";return"bottom"===i?(n=f?k:`${l}px`,o=`${-h}px`):"top"===i?(n=f?k:`${l}px`,o=`${d.floating.height+h}px`):"right"===i?(n=`${-h}px`,o=f?k:`${m}px`):"left"===i&&(n=`${d.floating.width+h}px`,o=f?k:`${m}px`),{data:{x:n,y:o}}}}),"transformOrigin");function a$(a){let[b,c="center"]=a.split("-");return[b,c]}aK(a$,"getSideAndAlignFromPlacement");var a_=Object.defineProperty,a0=f.forwardRef(a_(function(a,b){let{container:c,...d}=a,[g,h]=f.useState(!1);(0,aH.N)(()=>h(!0),[]);let i=c||g&&globalThis?.document?.body;return i?az.createPortal((0,e.jsx)(aF.sG.div,{...d,ref:b}),i):null},"name",{value:"Portal",configurable:!0})),a1=c(7173),a2=c(14069),a3=c(58817),a4=c(99375),a5=c(97604),a6=Object.defineProperty,a7=(a,b)=>a6(a,"name",{value:b,configurable:!0}),a8="Popover",[a9,ba]=(0,i.A)(a8,[aP]),bb=aP(),[bc,bd]=a9(a8),be=a7(a=>{let{__scopePopover:b,children:c,open:d,defaultOpen:g,onOpenChange:h,modal:i=!1}=a,j=bb(b),k=f.useRef(null),[l,n]=f.useState(!1),[o,p]=f.useState(0),[q,r]=f.useState(0),[s,t]=(0,a3.i)({prop:d,defaultProp:g??!1,onChange:h,caller:a8});return(0,e.jsx)(aS,{...j,children:(0,e.jsx)(bc,{scope:b,contentId:(0,m.B)(),titleId:(0,m.B)(),descriptionId:(0,m.B)(),titlePresent:o>0,descriptionPresent:q>0,setTitleCount:p,setDescriptionCount:r,triggerRef:k,open:s,onOpenChange:t,onOpenToggle:f.useCallback(()=>t(a=>!a),[t]),hasCustomAnchor:l,onCustomAnchorAdd:f.useCallback(()=>n(!0),[]),onCustomAnchorRemove:f.useCallback(()=>n(!1),[]),modal:i,children:c})})},"Popover"),bf=f.forwardRef(a7(function(a,b){let{__scopePopover:c,...d}=a,f=bd("PopoverTrigger",c),i=bb(c),j=(0,h.s)(b,f.triggerRef),k=(0,e.jsx)(aF.sG.button,{type:"button","aria-haspopup":"dialog","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":bq(f.open),...d,ref:j,onClick:(0,g.mK)(a.onClick,f.onOpenToggle)});return f.hasCustomAnchor?k:(0,e.jsx)(aT,{asChild:!0,...i,children:k})},"PopoverTrigger")),bg="PopoverPortal",[bh,bi]=a9(bg,{forceMount:void 0}),bj=a7(a=>{let{__scopePopover:b,forceMount:c,children:d,container:f}=a,g=bd(bg,b);return(0,e.jsx)(bh,{scope:b,forceMount:c,children:(0,e.jsx)(a1.C,{present:c||g.open,children:(0,e.jsx)(a0,{asChild:!0,container:f,children:d})})})},"PopoverPortal"),bk="PopoverContent",bl=f.forwardRef(a7(function(a,b){let c=bi(bk,a.__scopePopover),{forceMount:d=c.forceMount,...f}=a,g=bd(bk,a.__scopePopover);return(0,e.jsx)(a1.C,{present:d||g.open,children:g.modal?(0,e.jsx)(bn,{...f,ref:b}):(0,e.jsx)(bo,{...f,ref:b})})},"PopoverContent")),bm=(0,a2.TL)("PopoverContent.RemoveScroll"),bn=f.forwardRef(a7(function(a,b){let c=bd(bk,a.__scopePopover),d=f.useRef(null),i=(0,h.s)(b,d),j=f.useRef(!1),{nodes:k,registry:m}=(0,l.Rd)();return f.useEffect(()=>{let a=d.current;if(a)return(0,a4.Eq)(a)},[]),(0,e.jsx)(a5.A,{as:bm,allowPinchZoom:!0,shards:f.useMemo(()=>[d,...k.map(a=>({current:a}))],[d,k]),children:(0,e.jsx)(bp,{...a,ref:i,branchNodes:k,branchRegistry:m,trapFocus:c.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,g.mK)(a.onCloseAutoFocus,a=>{a.preventDefault(),j.current||c.triggerRef.current?.focus()}),onPointerDownOutside:(0,g.mK)(a.onPointerDownOutside,a=>{let b=a.detail.originalEvent,c=0===b.button&&!0===b.ctrlKey;j.current=2===b.button||c},{checkForDefaultPrevented:!1}),onFocusOutside:(0,g.mK)(a.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),bo=f.forwardRef(a7(function(a,b){let c=bd(bk,a.__scopePopover),d=f.useRef(!1),g=f.useRef(!1);return(0,e.jsx)(bp,{...a,ref:b,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:b=>{a.onCloseAutoFocus?.(b),b.defaultPrevented||(d.current||c.triggerRef.current?.focus(),b.preventDefault()),d.current=!1,g.current=!1},onInteractOutside:b=>{a.onInteractOutside?.(b),b.defaultPrevented||(d.current=!0,"pointerdown"===b.detail.originalEvent.type&&(g.current=!0));let e=b.target;c.triggerRef.current?.contains(e)&&b.preventDefault(),"focusin"===b.detail.originalEvent.type&&g.current&&b.preventDefault()}})},"PopoverContentNonModal")),bp=f.forwardRef(a7(function(a,b){let{__scopePopover:c,trapFocus:d,onOpenAutoFocus:g,onCloseAutoFocus:i,disableOutsidePointerEvents:m,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:p,onInteractOutside:q,"aria-describedby":r,branchNodes:s,branchRegistry:t,...u}=a,w=bd(bk,c),x=bb(c),[y,z]=f.useState(null),A=(0,h.s)(b,z);return(0,l.Md)(y),(0,k.Oh)(),(0,e.jsx)(l.UF,{registry:t,children:(0,e.jsx)(l.n1,{asChild:!0,loop:!0,trapped:d,branches:s,onMountAutoFocus:g,onUnmountAutoFocus:i,children:(0,e.jsx)(j.qW,{asChild:!0,disableOutsidePointerEvents:m,onInteractOutside:q,onEscapeKeyDown:n,onPointerDownOutside:o,onFocusOutside:p,onDismiss:()=>w.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,e.jsx)(aX,{"data-state":bq(w.open),role:"dialog",id:w.contentId,"aria-labelledby":w.titlePresent?w.titleId:void 0,"aria-describedby":w.descriptionPresent?br(r,w.descriptionId):r,...x,...u,ref:A,style:{...u.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})},"PopoverContentImpl"));function bq(a){return a?"open":"closed"}function br(...a){let b=new Set;for(let c of a)if("string"==typeof c)for(let a of String(c).trim().split(/\s+/))a&&b.add(a);return b.size>0?Array.from(b).join(" "):void 0}a7(bq,"getState"),a7(br,"concatAriaDescribedby");var bs=c(17265);let bt=be,bu=bf,bv=f.forwardRef(({className:a,align:b="center",sideOffset:c=4,...d},f)=>(0,e.jsx)(bj,{children:(0,e.jsx)(bl,{ref:f,align:b,sideOffset:c,side:"bottom",className:(0,bs.QP)("z-50 origin-(--radix-popover-content-transform-origin) min-w-[240px] max-w-[98vw] rounded-xl border bg-fd-popover/60 backdrop-blur-lg p-2 text-sm text-fd-popover-foreground shadow-lg focus-visible:outline-none data-[state=closed]:animate-fd-popover-out data-[state=open]:animate-fd-popover-in",a),...d})}));bv.displayName=bl.displayName},95980:(a,b,c)=>{"use strict";c.d(b,{VA:()=>e}),Object.create;var d=Object.defineProperty;Object.getOwnPropertyDescriptor,Object.getOwnPropertyNames,Object.getPrototypeOf,Object.prototype.hasOwnProperty;var e=(a,b)=>{for(var c in b)d(a,c,{get:b[c],enumerable:!0})}}};var b=require("../../../webpack-runtime.js");b.C(a);var c=b.X(0,[341,125,172],()=>b(b.s=74768));module.exports=c})();