unspaghettit 0.14.2 → 0.15.0

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 (175) hide show
  1. package/build/client/_app/immutable/chunks/{CGRZ0hx_2.js → B8kjx6k42.js} +1 -1
  2. package/build/client/_app/immutable/chunks/B8kjx6k42.js.br +0 -0
  3. package/build/client/_app/immutable/chunks/B8kjx6k42.js.gz +0 -0
  4. package/build/client/_app/immutable/chunks/BUrhMYfU.js +1 -0
  5. package/build/client/_app/immutable/chunks/BUrhMYfU.js.br +2 -0
  6. package/build/client/_app/immutable/chunks/BUrhMYfU.js.gz +0 -0
  7. package/build/client/_app/immutable/chunks/{CgSXJuIO.js → BocNk-Bz.js} +1 -1
  8. package/build/client/_app/immutable/chunks/BocNk-Bz.js.br +0 -0
  9. package/build/client/_app/immutable/chunks/BocNk-Bz.js.gz +0 -0
  10. package/build/client/_app/immutable/chunks/Bz-oxBCj.js +1 -0
  11. package/build/client/_app/immutable/chunks/Bz-oxBCj.js.br +0 -0
  12. package/build/client/_app/immutable/chunks/Bz-oxBCj.js.gz +0 -0
  13. package/build/client/_app/immutable/chunks/{CfF5WnjG2.js → ChGgFJaP2.js} +1 -1
  14. package/build/client/_app/immutable/chunks/ChGgFJaP2.js.br +0 -0
  15. package/build/client/_app/immutable/chunks/ChGgFJaP2.js.gz +0 -0
  16. package/build/client/_app/immutable/chunks/{okshMw-Z.js → CiWIdcmo.js} +1 -1
  17. package/build/client/_app/immutable/chunks/CiWIdcmo.js.br +0 -0
  18. package/build/client/_app/immutable/chunks/CiWIdcmo.js.gz +0 -0
  19. package/build/client/_app/immutable/chunks/{n7xluuKn.js → D54MXUmr.js} +1 -1
  20. package/build/client/_app/immutable/chunks/D54MXUmr.js.br +0 -0
  21. package/build/client/_app/immutable/chunks/D54MXUmr.js.gz +0 -0
  22. package/build/client/_app/immutable/chunks/{veFR6afQ.js → DQM4fDta.js} +1 -1
  23. package/build/client/_app/immutable/chunks/DQM4fDta.js.br +0 -0
  24. package/build/client/_app/immutable/chunks/DQM4fDta.js.gz +0 -0
  25. package/build/client/_app/immutable/chunks/{B2Xk3BoK2.js → DtgkZP4Z2.js} +1 -1
  26. package/build/client/_app/immutable/chunks/DtgkZP4Z2.js.br +0 -0
  27. package/build/client/_app/immutable/chunks/DtgkZP4Z2.js.gz +0 -0
  28. package/build/client/_app/immutable/entry/{app.BFt6jt7s.js → app.CdwLfJG9.js} +2 -2
  29. package/build/client/_app/immutable/entry/app.CdwLfJG9.js.br +0 -0
  30. package/build/client/_app/immutable/entry/app.CdwLfJG9.js.gz +0 -0
  31. package/build/client/_app/immutable/entry/start.BJ9xUiQz.js +1 -0
  32. package/build/client/_app/immutable/entry/start.BJ9xUiQz.js.br +0 -0
  33. package/build/client/_app/immutable/entry/start.BJ9xUiQz.js.gz +0 -0
  34. package/build/client/_app/immutable/nodes/{0.CL54SQAN.js → 0.Do3vJ1SD.js} +1 -1
  35. package/build/client/_app/immutable/nodes/0.Do3vJ1SD.js.br +0 -0
  36. package/build/client/_app/immutable/nodes/0.Do3vJ1SD.js.gz +0 -0
  37. package/build/client/_app/immutable/nodes/{1.Bfj3GUlf.js → 1.DUh_7T3E.js} +1 -1
  38. package/build/client/_app/immutable/nodes/1.DUh_7T3E.js.br +1 -0
  39. package/build/client/_app/immutable/nodes/1.DUh_7T3E.js.gz +0 -0
  40. package/build/client/_app/immutable/nodes/11.D6XHgGf0.js +1 -0
  41. package/build/client/_app/immutable/nodes/11.D6XHgGf0.js.br +2 -0
  42. package/build/client/_app/immutable/nodes/11.D6XHgGf0.js.gz +0 -0
  43. package/build/client/_app/immutable/nodes/{12.Bsl85JMW.js → 12.oftx_y4m.js} +1 -1
  44. package/build/client/_app/immutable/nodes/12.oftx_y4m.js.br +0 -0
  45. package/build/client/_app/immutable/nodes/12.oftx_y4m.js.gz +0 -0
  46. package/build/client/_app/immutable/nodes/{13.YHll7CoO.js → 13.SUorOX0g.js} +1 -1
  47. package/build/client/_app/immutable/nodes/13.SUorOX0g.js.br +0 -0
  48. package/build/client/_app/immutable/nodes/13.SUorOX0g.js.gz +0 -0
  49. package/build/client/_app/immutable/nodes/{14.CQSsZ3ai.js → 14.BXNNGt48.js} +1 -1
  50. package/build/client/_app/immutable/nodes/14.BXNNGt48.js.br +0 -0
  51. package/build/client/_app/immutable/nodes/14.BXNNGt48.js.gz +0 -0
  52. package/build/client/_app/immutable/nodes/{15.r9nu5e6r.js → 15.CfGVVkRe.js} +1 -1
  53. package/build/client/_app/immutable/nodes/15.CfGVVkRe.js.br +0 -0
  54. package/build/client/_app/immutable/nodes/15.CfGVVkRe.js.gz +0 -0
  55. package/build/client/_app/immutable/nodes/{16.CGQwGPQ8.js → 16.DhbukQ9Y.js} +1 -1
  56. package/build/client/_app/immutable/nodes/16.DhbukQ9Y.js.br +0 -0
  57. package/build/client/_app/immutable/nodes/16.DhbukQ9Y.js.gz +0 -0
  58. package/build/client/_app/immutable/nodes/2.BkWWoMmi.js +1 -0
  59. package/build/client/_app/immutable/nodes/2.BkWWoMmi.js.br +1 -0
  60. package/build/client/_app/immutable/nodes/2.BkWWoMmi.js.gz +0 -0
  61. package/build/client/_app/immutable/nodes/{3.C7CEAqcZ.js → 3.DiNZI0w0.js} +1 -1
  62. package/build/client/_app/immutable/nodes/3.DiNZI0w0.js.br +0 -0
  63. package/build/client/_app/immutable/nodes/3.DiNZI0w0.js.gz +0 -0
  64. package/build/client/_app/immutable/nodes/{4.CTSBwe7u.js → 4.CJO_1UK1.js} +1 -1
  65. package/build/client/_app/immutable/nodes/4.CJO_1UK1.js.br +0 -0
  66. package/build/client/_app/immutable/nodes/4.CJO_1UK1.js.gz +0 -0
  67. package/build/client/_app/immutable/nodes/{5.DGbTT4pH.js → 5.B6MpRcgF.js} +1 -1
  68. package/build/client/_app/immutable/nodes/5.B6MpRcgF.js.br +0 -0
  69. package/build/client/_app/immutable/nodes/5.B6MpRcgF.js.gz +0 -0
  70. package/build/client/_app/immutable/nodes/{6.Dh0pqqO3.js → 6.B8hwGW5s.js} +1 -1
  71. package/build/client/_app/immutable/nodes/6.B8hwGW5s.js.br +0 -0
  72. package/build/client/_app/immutable/nodes/6.B8hwGW5s.js.gz +0 -0
  73. package/build/client/_app/immutable/nodes/{7.ByfneCW8.js → 7.fnbaTM9T.js} +1 -1
  74. package/build/client/_app/immutable/nodes/7.fnbaTM9T.js.br +0 -0
  75. package/build/client/_app/immutable/nodes/7.fnbaTM9T.js.gz +0 -0
  76. package/build/client/_app/immutable/nodes/{8.MF74_Gv4.js → 8.O-U4ij9x.js} +1 -1
  77. package/build/client/_app/immutable/nodes/8.O-U4ij9x.js.br +0 -0
  78. package/build/client/_app/immutable/nodes/8.O-U4ij9x.js.gz +0 -0
  79. package/build/client/_app/immutable/nodes/{9.1oJXRmSq.js → 9.D2ou-8kr.js} +1 -1
  80. package/build/client/_app/immutable/nodes/9.D2ou-8kr.js.br +0 -0
  81. package/build/client/_app/immutable/nodes/9.D2ou-8kr.js.gz +0 -0
  82. package/build/client/_app/version.json +1 -1
  83. package/build/client/_app/version.json.br +0 -0
  84. package/build/client/_app/version.json.gz +0 -0
  85. package/build/handler.js +4 -4
  86. package/build/index.js +4 -4
  87. package/build/server/chunks/chunks/{internal.js-DQ9iXFTC.js → internal.js-DXxJcz-C.js} +2 -2
  88. package/build/server/chunks/entries/endpoints/api/update-status/{_server.ts.js-DpMvhNZ9.js → _server.ts.js-B1CAN1tE.js} +2 -2
  89. package/build/server/chunks/{handler-DFQpvHDc.js → handler-Ib962mnO.js} +3 -3
  90. package/build/server/chunks/{index.js-GMxaF6ji.js → index.js-BxVi7DjO.js} +2 -2
  91. package/build/server/chunks/{manifest.js-DGpEjTN6.js → manifest.js-CFFav2bo.js} +19 -19
  92. package/build/server/chunks/nodes/{0.js-DD3J2EIp.js → 0.js-1DYERpUF.js} +2 -2
  93. package/build/server/chunks/nodes/1.js-CxbLfH3_.js +7 -0
  94. package/build/server/chunks/nodes/{11.js-BtxWMAMt.js → 11.js-B9z03-Fj.js} +2 -2
  95. package/build/server/chunks/nodes/{12.js-dxY2l7r5.js → 12.js-BEBH3pUJ.js} +2 -2
  96. package/build/server/chunks/nodes/{13.js-4ZSIOq68.js → 13.js-D0QUTxSH.js} +2 -2
  97. package/build/server/chunks/nodes/{14.js-ClDn7cIE.js → 14.js-23H7b6nm.js} +2 -2
  98. package/build/server/chunks/nodes/{15.js-DyjLHhBr.js → 15.js-DvNvJnpE.js} +2 -2
  99. package/build/server/chunks/nodes/{16.js-ChXnJ4tr.js → 16.js-BsM8Oazv.js} +2 -2
  100. package/build/server/chunks/nodes/{2.js-Cj3hnjdr.js → 2.js-BDNJUJ4c.js} +2 -2
  101. package/build/server/chunks/nodes/{3.js-Crsqd1U2.js → 3.js-B6jvemNa.js} +2 -2
  102. package/build/server/chunks/nodes/{4.js-9EXPGbSn.js → 4.js-BJhw5Ibh.js} +2 -2
  103. package/build/server/chunks/nodes/{5.js-Dn8iEQ-8.js → 5.js-Bj9_EYV8.js} +2 -2
  104. package/build/server/chunks/nodes/{6.js-Bg5bNhCm.js → 6.js-DvMLdKVb.js} +2 -2
  105. package/build/server/chunks/nodes/{7.js-3a-BkMqi.js → 7.js-8KaCjvUK.js} +2 -2
  106. package/build/server/chunks/nodes/{8.js-BpwFyCJ5.js → 8.js-Ctilgizn.js} +2 -2
  107. package/build/server/chunks/nodes/{9.js-5H6GMAyx.js → 9.js-DVcw-1_U.js} +2 -2
  108. package/cli/dashboard-server.ts +10 -0
  109. package/cli/session-guard.ts +112 -0
  110. package/mcp-server/resources/operations.ts +4 -2
  111. package/mcp-server/tools/batch-ops/surfaceActionOps.ts +3 -1
  112. package/mcp-server/tools/surface.ts +20 -6
  113. package/package.json +1 -1
  114. package/src/features/behavior-model/domain/services/transforms/surfaceTransforms.ts +1 -1
  115. package/src/features/maturity/domain/ConfidenceMatrix.ts +5 -2
  116. package/build/client/_app/immutable/chunks/B2Xk3BoK2.js.br +0 -0
  117. package/build/client/_app/immutable/chunks/B2Xk3BoK2.js.gz +0 -0
  118. package/build/client/_app/immutable/chunks/BrWeFyMA.js +0 -1
  119. package/build/client/_app/immutable/chunks/BrWeFyMA.js.br +0 -2
  120. package/build/client/_app/immutable/chunks/BrWeFyMA.js.gz +0 -0
  121. package/build/client/_app/immutable/chunks/CCRkIitA.js +0 -1
  122. package/build/client/_app/immutable/chunks/CCRkIitA.js.br +0 -0
  123. package/build/client/_app/immutable/chunks/CCRkIitA.js.gz +0 -0
  124. package/build/client/_app/immutable/chunks/CGRZ0hx_2.js.br +0 -0
  125. package/build/client/_app/immutable/chunks/CGRZ0hx_2.js.gz +0 -0
  126. package/build/client/_app/immutable/chunks/CfF5WnjG2.js.br +0 -0
  127. package/build/client/_app/immutable/chunks/CfF5WnjG2.js.gz +0 -0
  128. package/build/client/_app/immutable/chunks/CgSXJuIO.js.br +0 -2
  129. package/build/client/_app/immutable/chunks/CgSXJuIO.js.gz +0 -0
  130. package/build/client/_app/immutable/chunks/n7xluuKn.js.br +0 -0
  131. package/build/client/_app/immutable/chunks/n7xluuKn.js.gz +0 -0
  132. package/build/client/_app/immutable/chunks/okshMw-Z.js.br +0 -0
  133. package/build/client/_app/immutable/chunks/okshMw-Z.js.gz +0 -0
  134. package/build/client/_app/immutable/chunks/veFR6afQ.js.br +0 -0
  135. package/build/client/_app/immutable/chunks/veFR6afQ.js.gz +0 -0
  136. package/build/client/_app/immutable/entry/app.BFt6jt7s.js.br +0 -0
  137. package/build/client/_app/immutable/entry/app.BFt6jt7s.js.gz +0 -0
  138. package/build/client/_app/immutable/entry/start.CVKspSut.js +0 -1
  139. package/build/client/_app/immutable/entry/start.CVKspSut.js.br +0 -0
  140. package/build/client/_app/immutable/entry/start.CVKspSut.js.gz +0 -0
  141. package/build/client/_app/immutable/nodes/0.CL54SQAN.js.br +0 -0
  142. package/build/client/_app/immutable/nodes/0.CL54SQAN.js.gz +0 -0
  143. package/build/client/_app/immutable/nodes/1.Bfj3GUlf.js.br +0 -0
  144. package/build/client/_app/immutable/nodes/1.Bfj3GUlf.js.gz +0 -0
  145. package/build/client/_app/immutable/nodes/11.CzNmZJ45.js +0 -1
  146. package/build/client/_app/immutable/nodes/11.CzNmZJ45.js.br +0 -1
  147. package/build/client/_app/immutable/nodes/11.CzNmZJ45.js.gz +0 -0
  148. package/build/client/_app/immutable/nodes/12.Bsl85JMW.js.br +0 -0
  149. package/build/client/_app/immutable/nodes/12.Bsl85JMW.js.gz +0 -0
  150. package/build/client/_app/immutable/nodes/13.YHll7CoO.js.br +0 -0
  151. package/build/client/_app/immutable/nodes/13.YHll7CoO.js.gz +0 -0
  152. package/build/client/_app/immutable/nodes/14.CQSsZ3ai.js.br +0 -0
  153. package/build/client/_app/immutable/nodes/14.CQSsZ3ai.js.gz +0 -0
  154. package/build/client/_app/immutable/nodes/15.r9nu5e6r.js.br +0 -0
  155. package/build/client/_app/immutable/nodes/15.r9nu5e6r.js.gz +0 -0
  156. package/build/client/_app/immutable/nodes/16.CGQwGPQ8.js.br +0 -0
  157. package/build/client/_app/immutable/nodes/16.CGQwGPQ8.js.gz +0 -0
  158. package/build/client/_app/immutable/nodes/2.Cq90ETQV.js +0 -1
  159. package/build/client/_app/immutable/nodes/2.Cq90ETQV.js.br +0 -1
  160. package/build/client/_app/immutable/nodes/2.Cq90ETQV.js.gz +0 -0
  161. package/build/client/_app/immutable/nodes/3.C7CEAqcZ.js.br +0 -0
  162. package/build/client/_app/immutable/nodes/3.C7CEAqcZ.js.gz +0 -0
  163. package/build/client/_app/immutable/nodes/4.CTSBwe7u.js.br +0 -0
  164. package/build/client/_app/immutable/nodes/4.CTSBwe7u.js.gz +0 -0
  165. package/build/client/_app/immutable/nodes/5.DGbTT4pH.js.br +0 -0
  166. package/build/client/_app/immutable/nodes/5.DGbTT4pH.js.gz +0 -0
  167. package/build/client/_app/immutable/nodes/6.Dh0pqqO3.js.br +0 -0
  168. package/build/client/_app/immutable/nodes/6.Dh0pqqO3.js.gz +0 -0
  169. package/build/client/_app/immutable/nodes/7.ByfneCW8.js.br +0 -0
  170. package/build/client/_app/immutable/nodes/7.ByfneCW8.js.gz +0 -0
  171. package/build/client/_app/immutable/nodes/8.MF74_Gv4.js.br +0 -0
  172. package/build/client/_app/immutable/nodes/8.MF74_Gv4.js.gz +0 -0
  173. package/build/client/_app/immutable/nodes/9.1oJXRmSq.js.br +0 -0
  174. package/build/client/_app/immutable/nodes/9.1oJXRmSq.js.gz +0 -0
  175. package/build/server/chunks/nodes/1.js-CruL1RMv.js +0 -7
@@ -0,0 +1 @@
1
+ import{a as e,u as t}from"../chunks/Bz-oxBCj.js";export{t as load_css,e as start};
@@ -1,4 +1,4 @@
1
- import{$ as e,A as t,B as n,E as r,F as i,I as a,K as o,L as s,M as c,N as l,O as u,P as d,Q as f,R as p,V as m,W as h,X as g,Z as _,a as v,b as y,d as b,dt as x,et as S,f as C,gt as w,ht as T,it as E,j as D,k as O,l as k,m as A,nt as j,o as M,q as N,r as P,rt as F,s as I,tt as L,u as ee,ut as R,v as z,vt as B,w as V,xt as te,y as H,z as U}from"../chunks/CYsLq4VE.js";import{n as W,r as ne}from"../chunks/CCRkIitA.js";import"../chunks/xihTtKlq.js";import"../chunks/BrWeFyMA.js";import{t as G}from"../chunks/CgSXJuIO.js";import{i as re,n as ie,r as ae,t as oe}from"../chunks/BE7NaZk8.js";import{$ as se,Bt as ce,C as le,H as ue,J as de,Pt as fe,Rt as pe,U as me,h as he,t as ge,ut as _e,zt as ve}from"../chunks/PGh5ehlS.js";import"../chunks/DkAKB9py.js";import{t as ye}from"../chunks/BcjkusYG.js";import{i as be,n as xe,o as Se,r as Ce,t as we}from"../chunks/okshMw-Z.js";import{n as K,r as Te}from"../chunks/niJ1Cp3-.js";import{i as q}from"../chunks/BGoS2INr.js";import{n as Ee,t as De}from"../chunks/n7xluuKn.js";import{n as Oe}from"../chunks/CGWhvtMz.js";import{t as ke}from"../chunks/DsJUUSRq.js";import{t as Ae}from"../chunks/BPm18m-Y.js";import{a as je,c as Me,i as Ne,n as Pe,o as Fe,r as J,t as Ie}from"../chunks/Cuj9IeTJ.js";import{t as Le}from"../chunks/dCZwRRKS.js";import{n as Re}from"../chunks/Qgm526At.js";var ze=te({prerender:()=>!1,ssr:()=>!1,trailingSlash:()=>Be}),Be=`never`,Ve=i(`<span class="mt-1 block text-xs leading-relaxed opacity-80"> </span>`),He=i(`<li class="flex"><button type="button"><span class="min-w-0 flex-1"><span class="block text-sm"> </span> <!></span> <span aria-hidden="true" class="shrink-0 text-base transition group-hover:translate-x-1">→</span></button></li>`),Ue=i(`<div class="px-7 pt-2 pb-5"><ul class="flex max-h-80 flex-col gap-3 overflow-y-auto"></ul></div>`),We=i(`<p class="mt-2 text-xs font-medium text-red-700"> </p>`),Ge=i(`<div class="px-7 pt-1 pb-4"><label class="block text-xs font-medium text-slate-700"> <input autocorrect="off" autocapitalize="off" spellcheck="false" class="mono mt-1 h-10 w-full rounded-md border border-slate-300 bg-white px-3 text-sm outline-none focus:border-brand-700 focus:ring-2 focus:ring-brand-100"/></label> <!></div>`),Ke=i(`<span class="mt-0.5 block text-xs text-slate-500"> </span>`),qe=i(`<li><label class="flex cursor-pointer items-start gap-3 rounded-md px-2 py-2 transition hover:bg-white"><input type="checkbox"/> <span class="min-w-0 flex-1"><span class="block text-sm font-medium text-slate-900"> </span> <!></span></label></li>`),Je=i(`<div class="border-t border-hairline px-6 py-3"><div class="mb-2 flex items-center justify-between"><span class="text-xs font-medium uppercase tracking-wide text-slate-500"> </span> <div class="flex gap-2 text-xs"><button type="button" class="font-medium text-slate-600 hover:text-slate-950">Select all</button> <span class="text-slate-300">·</span> <button type="button" class="font-medium text-slate-600 hover:text-slate-950">Select none</button></div></div> <ul class="max-h-72 space-y-1.5 overflow-y-auto rounded-lg border border-hairline bg-slate-50 p-2"></ul></div>`),Ye=i(`<button type="button"> </button>`),Xe=i(`<button type="button" class="rounded-md px-3 py-2 text-sm text-slate-600 transition hover:text-slate-950"> </button>`),Ze=i(`<button type="button" class="rounded-md border border-slate-300 bg-white px-4 py-2 text-sm text-slate-700 transition hover:bg-slate-100"> </button> <button type="button"> </button>`,1),Qe=i(`<div class="fixed inset-0 z-100 flex items-center justify-center px-4" role="presentation"><button type="button" aria-label="Dismiss" class="absolute inset-0 bg-slate-950/40 backdrop-blur-sm"></button> <div role="dialog" aria-modal="true" aria-labelledby="app-dialog-title" aria-describedby="app-dialog-message"><div class="flex gap-4 px-7 pt-7 pb-5"><div> </div> <div class="min-w-0 flex-1 pt-1"><h2 id="app-dialog-title" class="text-lg leading-tight text-slate-950"> </h2> <p id="app-dialog-message" class="mt-2 whitespace-pre-line text-sm leading-relaxed text-slate-600"> </p></div></div> <!> <div class="flex justify-end gap-2 border-t border-hairline bg-slate-50 px-7 py-3"><!></div></div></div>`);function $e(t,r){x(r,!0);let i=E(()=>ve.current),a=j(S(new Set)),s=j(``),p=j(null),h=j(null);N(()=>{m(i)?.kind===`checklist`?L(a,new Set(m(i).opts.items.filter(e=>e.defaultChecked).map(e=>e.id)),!0):L(a,new Set,!0),m(i)?.kind===`prompt`?(L(s,m(i).opts.defaultValue??``,!0),L(p,null),queueMicrotask(()=>m(h)?.focus())):(L(s,``),L(p,null))});function v(e){let t=new Set(m(a));t.has(e)?t.delete(e):t.add(e),L(a,t,!0)}function y(){m(i)?.kind===`checklist`&&L(a,new Set(m(i).opts.items.map(e=>e.id)),!0)}function O(){L(a,new Set,!0)}function A(){m(i)?.kind===`prompt`?ve.resolvePrompt(null):ve.resolveCurrent(!1)}function M(){if(m(i)?.kind===`checklist`)ve.resolveCurrent(!0,Array.from(m(a)));else if(m(i)?.kind===`prompt`){let e=m(s),t=m(i).opts.validate?m(i).opts.validate(e):null;if(t){L(p,t,!0);return}ve.resolvePrompt(e)}else ve.resolveCurrent(!0)}function P(e){m(i)&&(e.key===`Escape`?(e.preventDefault(),A()):e.key===`Enter`&&m(i).kind!==`checklist`&&(e.preventDefault(),M()))}let F={default:{icon:`?`,iconBg:`bg-slate-100`,iconColor:`text-slate-700`,confirmBtn:`bg-slate-900 hover:bg-slate-800 text-white`,check:`accent-slate-700`},danger:{icon:`!`,iconBg:`bg-rose-50`,iconColor:`text-rose-600`,confirmBtn:`bg-rose-600 hover:bg-rose-500 text-white`,check:`accent-rose-600`},info:{icon:`i`,iconBg:`bg-brand-50`,iconColor:`text-brand-700`,confirmBtn:`bg-brand-700 hover:bg-brand-600 text-white`,check:`accent-brand-700`},success:{icon:`✓`,iconBg:`bg-emerald-50`,iconColor:`text-emerald-600`,confirmBtn:`bg-emerald-600 hover:bg-emerald-500 text-white`,check:`accent-emerald-600`},warning:{icon:`!`,iconBg:`bg-amber-50`,iconColor:`text-amber-600`,confirmBtn:`bg-amber-600 hover:bg-amber-500 text-white`,check:`accent-amber-600`}},z=E(()=>m(i)?.opts.tone??(m(i)?.kind===`alert`?`info`:`default`)),B=E(()=>F[m(z)]);var te=d();n(`keydown`,g,P);var W=f(te),ne=t=>{var n=Qe(),r=_(n),d=e(r,2),g=_(d),x=_(g),S=_(x,!0);w(x);var E=e(x,2),j=_(E),N=_(j,!0);w(j);var P=e(j,2),F=_(P,!0);w(P),w(E),w(g);var R=e(g,2),z=t=>{var n=Ue(),r=_(n);u(r,21,()=>m(i).opts.options,e=>e.id,(t,n)=>{var r=He(),i=_(r),a=_(i),s=_(a),u=_(s,!0);w(s);var d=e(s,2),f=e=>{var t=Ve(),r=_(t,!0);w(t),o(()=>c(r,m(n).description)),l(e,t)};D(d,e=>{m(n).description&&e(f)}),w(a),T(2),w(i),w(r),o(()=>{H(i,1,`group flex w-full items-center justify-between gap-4 rounded-xl px-5 py-4 text-left shadow-sm shadow-slate-950/5 transition hover:shadow-md focus:ring-2 focus:ring-offset-2 focus:outline-none ${m(B).confirmBtn}`),c(u,m(n).label)}),U(`click`,i,()=>ve.resolveChoice(m(n).id)),l(t,r)}),w(r),w(n),l(t,n)},te=t=>{var n=Ge(),r=_(n),a=_(r),u=e(a);ee(u),I(u,e=>L(h,e),()=>m(h)),w(r);var d=e(r,2),f=e=>{var t=We(),n=_(t,!0);w(t),o(()=>c(n,m(p))),l(e,t)};D(d,e=>{m(p)&&e(f)}),w(n),o(()=>{c(a,`${m(i).opts.inputLabel??`Value`??``} `),b(u,`type`,m(i).opts.password?`password`:`text`),b(u,`autocomplete`,m(i).opts.password?`new-password`:`off`),b(u,`placeholder`,m(i).opts.placeholder??``)}),U(`input`,u,()=>L(p,null)),k(u,()=>m(s),e=>L(s,e)),l(t,n)},W=t=>{var n=Je(),r=_(n),s=_(r),d=_(s);w(s);var f=e(s,2),p=_(f),h=e(p,4);w(f),w(r);var g=e(r,2);u(g,21,()=>m(i).opts.items,e=>e.id,(t,n)=>{var r=qe(),i=_(r),s=_(i);ee(s);var u=e(s,2),d=_(u),f=_(d,!0);w(d);var p=e(d,2),h=e=>{var t=Ke(),r=_(t,!0);w(t),o(()=>c(r,m(n).description)),l(e,t)};D(p,e=>{m(n).description&&e(h)}),w(u),w(i),w(r),o(e=>{H(s,1,`mt-0.5 h-4 w-4 rounded ${m(B).check}`),C(s,e),c(f,m(n).label)},[()=>m(a).has(m(n).id)]),U(`change`,s,()=>v(m(n).id)),l(t,r)}),w(g),w(n),o(()=>c(d,`${m(a).size??``} of ${m(i).opts.items.length??``} selected`)),U(`click`,p,y),U(`click`,h,O),l(t,n)};D(R,e=>{m(i).kind===`choice`?e(z):m(i).kind===`prompt`?e(te,1):m(i).kind===`checklist`&&e(W,2)});var ne=e(R,2),G=_(ne),ae=e=>{var t=Ye(),n=_(t,!0);w(t),o(()=>{H(t,1,`rounded-md px-4 py-2 text-sm transition ${m(B).confirmBtn}`),c(n,m(i).opts.buttonLabel??`OK`)}),U(`click`,t,A),l(e,t)},se=e=>{var t=Xe(),n=_(t,!0);w(t),o(()=>c(n,m(i).opts.cancelLabel??`Close`)),U(`click`,t,A),l(e,t)},ce=t=>{var n=Ze(),r=f(n),a=_(r,!0);w(r);var s=e(r,2),u=_(s,!0);w(s),o(()=>{c(a,m(i).opts.cancelLabel??`Cancel`),H(s,1,`rounded-md px-4 py-2 text-sm transition focus:ring-2 focus:ring-offset-2 focus:outline-none ${m(B).confirmBtn}`),c(u,m(i).opts.confirmLabel??`Confirm`)}),U(`click`,r,A),U(`click`,s,M),l(t,n)};D(G,e=>{m(i).kind===`alert`?e(ae):m(i).kind===`choice`?e(se,1):e(ce,-1)}),w(ne),w(d),w(n),o(()=>{H(d,1,`relative w-full ${m(i).kind===`checklist`||m(i).kind===`choice`?`max-w-lg`:`max-w-md`} overflow-hidden rounded-2xl border border-hairline bg-white shadow-2xl shadow-slate-950/20`),H(x,1,`flex h-11 w-11 shrink-0 items-center justify-center rounded-full text-lg ${m(B).iconBg} ${m(B).iconColor}`),c(S,m(B).icon),c(N,m(i).opts.title),c(F,m(i).opts.message)}),U(`click`,r,A),V(3,d,()=>re,()=>({duration:140,start:.96,easing:oe})),V(3,n,()=>ie,()=>({duration:120,easing:oe})),l(t,n)};D(W,e=>{m(i)&&e(ne)}),l(t,te),R()}p([`click`,`input`,`change`]);var et=i(`<div class="untangler-sky svelte-dds6m1" aria-hidden="true"><div class="untangler svelte-dds6m1"><svg viewBox="0 0 240 110" role="img" class="svelte-dds6m1"><g class="tangle tangle-outline svelte-dds6m1"><path d="M5 55 C 32 12, 48 95, 72 32 S 116 80, 148 42 S 196 22, 232 62" class="svelte-dds6m1"></path><path d="M5 70 C 28 32, 52 95, 78 22 S 124 72, 156 44 S 200 30, 232 76" class="svelte-dds6m1"></path><path d="M5 40 C 36 82, 60 12, 92 70 S 118 30, 150 52 S 196 70, 230 30" class="svelte-dds6m1"></path><path d="M5 88 C 30 60, 48 100, 80 65 S 130 95, 165 70 S 210 88, 232 60" class="svelte-dds6m1"></path></g><g class="tangle tangle-fill svelte-dds6m1"><path d="M5 55 C 32 12, 48 95, 72 32 S 116 80, 148 42 S 196 22, 232 62" class="svelte-dds6m1"></path><path d="M5 70 C 28 32, 52 95, 78 22 S 124 72, 156 44 S 200 30, 232 76" class="svelte-dds6m1"></path><path d="M5 40 C 36 82, 60 12, 92 70 S 118 30, 150 52 S 196 70, 230 30" class="svelte-dds6m1"></path><path d="M5 88 C 30 60, 48 100, 80 65 S 130 95, 165 70 S 210 88, 232 60" class="svelte-dds6m1"></path></g><g class="clean clean-outline svelte-dds6m1"><line x1="5" y1="30" x2="232" y2="30" class="svelte-dds6m1"></line><line x1="5" y1="50" x2="232" y2="50" class="svelte-dds6m1"></line><line x1="5" y1="70" x2="232" y2="70" class="svelte-dds6m1"></line><line x1="5" y1="90" x2="232" y2="90" class="svelte-dds6m1"></line></g><g class="clean clean-fill svelte-dds6m1"><line x1="5" y1="30" x2="232" y2="30" class="svelte-dds6m1"></line><line x1="5" y1="50" x2="232" y2="50" class="svelte-dds6m1"></line><line x1="5" y1="70" x2="232" y2="70" class="svelte-dds6m1"></line><line x1="5" y1="90" x2="232" y2="90" class="svelte-dds6m1"></line></g><g class="glint svelte-dds6m1"><rect x="-18" y="18" width="14" height="78" rx="3" class="svelte-dds6m1"></rect></g></svg></div></div>`);function tt(e,t){x(t,!0);let r=[`arrowup`,`arrowup`,`arrowdown`,`arrowdown`,`arrowleft`,`arrowright`,`arrowleft`,`arrowright`,`b`,`a`],i=j(!1),a=``,o=0,s=null;function c(e){return e instanceof HTMLElement?e.isContentEditable?!0:!!e.closest(`input, textarea, select, [contenteditable='true']`):!1}function u(){L(i,!1),s&&clearTimeout(s),requestAnimationFrame(()=>{L(i,!0),s=setTimeout(()=>{L(i,!1)},5200)})}function p(e){return e===r[o]?(o+=1,o<r.length?!1:(o=0,!0)):(o=+(e===r[0]),!1)}function h(e){return e.length!==1||(a=(a+e).slice(-9),a!==`spaghetti`)?!1:(a=``,!0)}function _(e){if(c(e.target))return;let t=e.key.toLowerCase();(p(t)||h(t))&&u()}N(()=>()=>{s&&clearTimeout(s)});var v=d();n(`keydown`,g,_);var y=f(v),b=e=>{l(e,et())};D(y,e=>{m(i)&&e(b)}),l(e,v),R()}var nt=4,rt=1e4,it=e=>{if(e.op!==`delete`)switch(e.kind){case`feature`:return`/features/${e.id}`;case`project`:return`/projects/${e.id}`;case`implementation-status`:return`/features/${e.id}`}},at=800,Y=new class{#e=j(S([]));get toasts(){return m(this.#e)}set toasts(e){L(this.#e,e,!0)}nextId=1;subscribed=!1;unsubscribe=null;timers=new Map;recentKeys=new Map;deadlines=new Map;paused=new Map;start(){this.subscribed||(this.subscribed=!0,this.unsubscribe=ye(e=>this.handle(e)))}dismiss(e){this.clearTimers(e),this.toasts=this.toasts.filter(t=>t.id!==e)}clearTimers(e){let t=this.timers.get(e);t&&clearTimeout(t),this.timers.delete(e),this.deadlines.delete(e),this.paused.delete(e)}arm(e,t){let n=this.timers.get(e);n&&clearTimeout(n),this.deadlines.set(e,Date.now()+t),this.timers.set(e,setTimeout(()=>this.dismiss(e),t))}pause(e){let t=this.timers.get(e);if(t===void 0)return;clearTimeout(t),this.timers.delete(e);let n=Math.max(1e3,(this.deadlines.get(e)??Date.now())-Date.now());this.paused.set(e,n)}resume(e){if(!this.paused.has(e))return;let t=this.paused.get(e)??rt;this.paused.delete(e),this.arm(e,t)}reset(){for(let e of this.timers.values())clearTimeout(e);this.timers.clear(),this.deadlines.clear(),this.paused.clear(),this.toasts=[],this.recentKeys.clear(),this.unsubscribe&&this.unsubscribe(),this.unsubscribe=null,this.subscribed=!1}handle(e){let t=`${e.kind}:${e.id}:${e.op??`save`}`,n=Date.now(),r=this.recentKeys.get(t);if(r!==void 0&&n-r<at){this.recentKeys.set(t,n);return}this.recentKeys.set(t,n);let i=this.nextId++,a=[{id:i,kind:e.kind,entityId:e.id,name:e.name,projectName:e.projectName,op:e.op??`save`,changeOp:e.changeOp,changePath:e.changePath,previousName:e.previousName,actingFor:e.actingFor,...it(e)?{href:it(e)}:{}},...this.toasts].slice(0,nt),o=new Set(a.map(e=>e.id));for(let e of new Set([...this.timers.keys(),...this.paused.keys()]))o.has(e)||this.clearTimers(e);this.toasts=a,this.arm(i,rt)}},ot=i(`<span class="rounded bg-purple-100 px-1.5 py-0.5 text-[9px] text-purple-800"> </span>`),st=i(`<span class="shrink-0 text-slate-400" aria-hidden="true">&rsaquo;</span>`),ct=i(`<!> <span> </span>`,1),lt=i(`<div class="mt-0.5 truncate text-[11px] text-slate-500"> </div>`),ut=i(`<a class="rounded-md bg-white/70 px-2 py-1 text-xs font-medium text-slate-700 hover:bg-white hover:text-brand-800">View</a>`),dt=i(`<div><div class="min-w-0 flex-1"><div class="flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-[10px] font-semibold uppercase tracking-wide"><span class="text-slate-500"> </span> <!></div> <div class="mt-0.5 flex min-w-0 flex-wrap items-center gap-x-1 text-sm text-slate-900"></div> <!></div> <div class="flex shrink-0 items-center gap-1"><!> <button type="button" class="rounded-md px-1.5 py-1 text-xs text-slate-500 hover:bg-white/70 hover:text-slate-900" aria-label="Dismiss">&times;</button></div></div>`),ft=i(`<div class="pointer-events-none fixed top-20 right-4 z-50 flex w-full max-w-md flex-col gap-2" role="status" aria-live="polite"></div>`);function pt(t,r){x(r,!1),P(()=>{Y.start()});function i(e){switch(e){case`feature`:return`feature`;case`project`:return`project`;case`implementation-status`:return`status`}}function a(e){switch(e){case`feature`:return`border-cyan-200 bg-cyan-50`;case`project`:return`border-violet-200 bg-violet-50`;case`implementation-status`:return`border-emerald-200 bg-emerald-50`}}function s(e){if(e.op===`delete`)return`deleted`;switch(e.changeOp){case`added`:return`added`;case`removed`:return`removed`;case`renamed`:return`renamed`;case`edited`:return`edited`;case`queued`:return`queued`;case`unqueued`:return`unqueued`;case`created`:return`created`;case`deleted`:return`deleted`;default:return`saved`}}function p(e){let t=[];e.projectName&&t.push(e.projectName);let n=e.changePath?.[0],r=n!==void 0&&(e.name===n||!e.name);if(e.name&&!r&&t.push(e.name),e.changePath&&e.changePath.length>0)for(let n of e.changePath)t.push(n);else e.name&&t[t.length-1]!==e.name&&t.push(e.name);let i=[];for(let e of t)e!==`unknown`&&i[i.length-1]!==e&&i.push(e);return i.length===0&&i.push(e.entityId),i}function h(e){if(e.op!==`delete`)return Se(e.kind,e.entityId)??e.href}M();var g=d(),v=f(g),y=t=>{var r=ft();u(r,5,()=>Y.toasts,e=>e.id,(t,r)=>{let d=F(()=>p(m(r))),g=F(()=>h(m(r)));var v=dt(),y=_(v),x=_(y),S=_(x),C=_(S);w(S);var T=e(S,2),E=e=>{var t=ot(),n=_(t);w(t),o(()=>c(n,`for ${m(r).actingFor??``}`)),l(e,t)};D(T,e=>{m(r).actingFor&&e(E)}),w(x);var k=e(x,2);u(k,5,()=>m(d),O,(t,n,r)=>{var i=ct(),a=f(i),s=e=>{l(e,st())};D(a,e=>{r>0&&e(s)});var u=e(a,2),p=_(u,!0);w(u),o(()=>{H(u,1,`truncate ${r===m(d).length-1?`font-semibold`:`text-slate-600`}`),c(p,m(n))}),l(t,i)}),w(k);var A=e(k,2),j=e=>{var t=lt(),n=_(t);w(t),o(()=>c(n,`was “${m(r).previousName??``}”`)),l(e,t)};D(A,e=>{m(r).changeOp===`renamed`&&m(r).previousName&&e(j)}),w(y);var M=e(y,2),N=_(M),P=e=>{var t=ut();o(()=>b(t,`href`,m(g))),U(`click`,t,()=>Y.dismiss(m(r).id)),l(e,t)};D(N,e=>{m(g)&&e(P)});var I=e(N,2);w(M),w(v),o((e,t,n)=>{H(v,1,`pointer-events-auto flex items-start gap-3 rounded-lg border px-3 py-2 shadow-md shadow-slate-950/10 ${e??``}`),c(C,`MCP · ${t??``}
1
+ import{$ as e,A as t,B as n,E as r,F as i,I as a,K as o,L as s,M as c,N as l,O as u,P as d,Q as f,R as p,V as m,W as h,X as g,Z as _,a as v,b as y,d as b,dt as x,et as S,f as C,gt as w,ht as T,it as E,j as D,k as O,l as k,m as A,nt as j,o as M,q as N,r as P,rt as F,s as I,tt as L,u as ee,ut as R,v as z,vt as B,w as V,xt as te,y as H,z as U}from"../chunks/CYsLq4VE.js";import{n as W,r as ne}from"../chunks/Bz-oxBCj.js";import"../chunks/xihTtKlq.js";import"../chunks/BUrhMYfU.js";import{t as G}from"../chunks/BocNk-Bz.js";import{i as re,n as ie,r as ae,t as oe}from"../chunks/BE7NaZk8.js";import{$ as se,Bt as ce,C as le,H as ue,J as de,Pt as fe,Rt as pe,U as me,h as he,t as ge,ut as _e,zt as ve}from"../chunks/PGh5ehlS.js";import"../chunks/DkAKB9py.js";import{t as ye}from"../chunks/BcjkusYG.js";import{i as be,n as xe,o as Se,r as Ce,t as we}from"../chunks/CiWIdcmo.js";import{n as K,r as Te}from"../chunks/niJ1Cp3-.js";import{i as q}from"../chunks/BGoS2INr.js";import{n as Ee,t as De}from"../chunks/D54MXUmr.js";import{n as Oe}from"../chunks/CGWhvtMz.js";import{t as ke}from"../chunks/DsJUUSRq.js";import{t as Ae}from"../chunks/BPm18m-Y.js";import{a as je,c as Me,i as Ne,n as Pe,o as Fe,r as J,t as Ie}from"../chunks/Cuj9IeTJ.js";import{t as Le}from"../chunks/dCZwRRKS.js";import{n as Re}from"../chunks/Qgm526At.js";var ze=te({prerender:()=>!1,ssr:()=>!1,trailingSlash:()=>Be}),Be=`never`,Ve=i(`<span class="mt-1 block text-xs leading-relaxed opacity-80"> </span>`),He=i(`<li class="flex"><button type="button"><span class="min-w-0 flex-1"><span class="block text-sm"> </span> <!></span> <span aria-hidden="true" class="shrink-0 text-base transition group-hover:translate-x-1">→</span></button></li>`),Ue=i(`<div class="px-7 pt-2 pb-5"><ul class="flex max-h-80 flex-col gap-3 overflow-y-auto"></ul></div>`),We=i(`<p class="mt-2 text-xs font-medium text-red-700"> </p>`),Ge=i(`<div class="px-7 pt-1 pb-4"><label class="block text-xs font-medium text-slate-700"> <input autocorrect="off" autocapitalize="off" spellcheck="false" class="mono mt-1 h-10 w-full rounded-md border border-slate-300 bg-white px-3 text-sm outline-none focus:border-brand-700 focus:ring-2 focus:ring-brand-100"/></label> <!></div>`),Ke=i(`<span class="mt-0.5 block text-xs text-slate-500"> </span>`),qe=i(`<li><label class="flex cursor-pointer items-start gap-3 rounded-md px-2 py-2 transition hover:bg-white"><input type="checkbox"/> <span class="min-w-0 flex-1"><span class="block text-sm font-medium text-slate-900"> </span> <!></span></label></li>`),Je=i(`<div class="border-t border-hairline px-6 py-3"><div class="mb-2 flex items-center justify-between"><span class="text-xs font-medium uppercase tracking-wide text-slate-500"> </span> <div class="flex gap-2 text-xs"><button type="button" class="font-medium text-slate-600 hover:text-slate-950">Select all</button> <span class="text-slate-300">·</span> <button type="button" class="font-medium text-slate-600 hover:text-slate-950">Select none</button></div></div> <ul class="max-h-72 space-y-1.5 overflow-y-auto rounded-lg border border-hairline bg-slate-50 p-2"></ul></div>`),Ye=i(`<button type="button"> </button>`),Xe=i(`<button type="button" class="rounded-md px-3 py-2 text-sm text-slate-600 transition hover:text-slate-950"> </button>`),Ze=i(`<button type="button" class="rounded-md border border-slate-300 bg-white px-4 py-2 text-sm text-slate-700 transition hover:bg-slate-100"> </button> <button type="button"> </button>`,1),Qe=i(`<div class="fixed inset-0 z-100 flex items-center justify-center px-4" role="presentation"><button type="button" aria-label="Dismiss" class="absolute inset-0 bg-slate-950/40 backdrop-blur-sm"></button> <div role="dialog" aria-modal="true" aria-labelledby="app-dialog-title" aria-describedby="app-dialog-message"><div class="flex gap-4 px-7 pt-7 pb-5"><div> </div> <div class="min-w-0 flex-1 pt-1"><h2 id="app-dialog-title" class="text-lg leading-tight text-slate-950"> </h2> <p id="app-dialog-message" class="mt-2 whitespace-pre-line text-sm leading-relaxed text-slate-600"> </p></div></div> <!> <div class="flex justify-end gap-2 border-t border-hairline bg-slate-50 px-7 py-3"><!></div></div></div>`);function $e(t,r){x(r,!0);let i=E(()=>ve.current),a=j(S(new Set)),s=j(``),p=j(null),h=j(null);N(()=>{m(i)?.kind===`checklist`?L(a,new Set(m(i).opts.items.filter(e=>e.defaultChecked).map(e=>e.id)),!0):L(a,new Set,!0),m(i)?.kind===`prompt`?(L(s,m(i).opts.defaultValue??``,!0),L(p,null),queueMicrotask(()=>m(h)?.focus())):(L(s,``),L(p,null))});function v(e){let t=new Set(m(a));t.has(e)?t.delete(e):t.add(e),L(a,t,!0)}function y(){m(i)?.kind===`checklist`&&L(a,new Set(m(i).opts.items.map(e=>e.id)),!0)}function O(){L(a,new Set,!0)}function A(){m(i)?.kind===`prompt`?ve.resolvePrompt(null):ve.resolveCurrent(!1)}function M(){if(m(i)?.kind===`checklist`)ve.resolveCurrent(!0,Array.from(m(a)));else if(m(i)?.kind===`prompt`){let e=m(s),t=m(i).opts.validate?m(i).opts.validate(e):null;if(t){L(p,t,!0);return}ve.resolvePrompt(e)}else ve.resolveCurrent(!0)}function P(e){m(i)&&(e.key===`Escape`?(e.preventDefault(),A()):e.key===`Enter`&&m(i).kind!==`checklist`&&(e.preventDefault(),M()))}let F={default:{icon:`?`,iconBg:`bg-slate-100`,iconColor:`text-slate-700`,confirmBtn:`bg-slate-900 hover:bg-slate-800 text-white`,check:`accent-slate-700`},danger:{icon:`!`,iconBg:`bg-rose-50`,iconColor:`text-rose-600`,confirmBtn:`bg-rose-600 hover:bg-rose-500 text-white`,check:`accent-rose-600`},info:{icon:`i`,iconBg:`bg-brand-50`,iconColor:`text-brand-700`,confirmBtn:`bg-brand-700 hover:bg-brand-600 text-white`,check:`accent-brand-700`},success:{icon:`✓`,iconBg:`bg-emerald-50`,iconColor:`text-emerald-600`,confirmBtn:`bg-emerald-600 hover:bg-emerald-500 text-white`,check:`accent-emerald-600`},warning:{icon:`!`,iconBg:`bg-amber-50`,iconColor:`text-amber-600`,confirmBtn:`bg-amber-600 hover:bg-amber-500 text-white`,check:`accent-amber-600`}},z=E(()=>m(i)?.opts.tone??(m(i)?.kind===`alert`?`info`:`default`)),B=E(()=>F[m(z)]);var te=d();n(`keydown`,g,P);var W=f(te),ne=t=>{var n=Qe(),r=_(n),d=e(r,2),g=_(d),x=_(g),S=_(x,!0);w(x);var E=e(x,2),j=_(E),N=_(j,!0);w(j);var P=e(j,2),F=_(P,!0);w(P),w(E),w(g);var R=e(g,2),z=t=>{var n=Ue(),r=_(n);u(r,21,()=>m(i).opts.options,e=>e.id,(t,n)=>{var r=He(),i=_(r),a=_(i),s=_(a),u=_(s,!0);w(s);var d=e(s,2),f=e=>{var t=Ve(),r=_(t,!0);w(t),o(()=>c(r,m(n).description)),l(e,t)};D(d,e=>{m(n).description&&e(f)}),w(a),T(2),w(i),w(r),o(()=>{H(i,1,`group flex w-full items-center justify-between gap-4 rounded-xl px-5 py-4 text-left shadow-sm shadow-slate-950/5 transition hover:shadow-md focus:ring-2 focus:ring-offset-2 focus:outline-none ${m(B).confirmBtn}`),c(u,m(n).label)}),U(`click`,i,()=>ve.resolveChoice(m(n).id)),l(t,r)}),w(r),w(n),l(t,n)},te=t=>{var n=Ge(),r=_(n),a=_(r),u=e(a);ee(u),I(u,e=>L(h,e),()=>m(h)),w(r);var d=e(r,2),f=e=>{var t=We(),n=_(t,!0);w(t),o(()=>c(n,m(p))),l(e,t)};D(d,e=>{m(p)&&e(f)}),w(n),o(()=>{c(a,`${m(i).opts.inputLabel??`Value`??``} `),b(u,`type`,m(i).opts.password?`password`:`text`),b(u,`autocomplete`,m(i).opts.password?`new-password`:`off`),b(u,`placeholder`,m(i).opts.placeholder??``)}),U(`input`,u,()=>L(p,null)),k(u,()=>m(s),e=>L(s,e)),l(t,n)},W=t=>{var n=Je(),r=_(n),s=_(r),d=_(s);w(s);var f=e(s,2),p=_(f),h=e(p,4);w(f),w(r);var g=e(r,2);u(g,21,()=>m(i).opts.items,e=>e.id,(t,n)=>{var r=qe(),i=_(r),s=_(i);ee(s);var u=e(s,2),d=_(u),f=_(d,!0);w(d);var p=e(d,2),h=e=>{var t=Ke(),r=_(t,!0);w(t),o(()=>c(r,m(n).description)),l(e,t)};D(p,e=>{m(n).description&&e(h)}),w(u),w(i),w(r),o(e=>{H(s,1,`mt-0.5 h-4 w-4 rounded ${m(B).check}`),C(s,e),c(f,m(n).label)},[()=>m(a).has(m(n).id)]),U(`change`,s,()=>v(m(n).id)),l(t,r)}),w(g),w(n),o(()=>c(d,`${m(a).size??``} of ${m(i).opts.items.length??``} selected`)),U(`click`,p,y),U(`click`,h,O),l(t,n)};D(R,e=>{m(i).kind===`choice`?e(z):m(i).kind===`prompt`?e(te,1):m(i).kind===`checklist`&&e(W,2)});var ne=e(R,2),G=_(ne),ae=e=>{var t=Ye(),n=_(t,!0);w(t),o(()=>{H(t,1,`rounded-md px-4 py-2 text-sm transition ${m(B).confirmBtn}`),c(n,m(i).opts.buttonLabel??`OK`)}),U(`click`,t,A),l(e,t)},se=e=>{var t=Xe(),n=_(t,!0);w(t),o(()=>c(n,m(i).opts.cancelLabel??`Close`)),U(`click`,t,A),l(e,t)},ce=t=>{var n=Ze(),r=f(n),a=_(r,!0);w(r);var s=e(r,2),u=_(s,!0);w(s),o(()=>{c(a,m(i).opts.cancelLabel??`Cancel`),H(s,1,`rounded-md px-4 py-2 text-sm transition focus:ring-2 focus:ring-offset-2 focus:outline-none ${m(B).confirmBtn}`),c(u,m(i).opts.confirmLabel??`Confirm`)}),U(`click`,r,A),U(`click`,s,M),l(t,n)};D(G,e=>{m(i).kind===`alert`?e(ae):m(i).kind===`choice`?e(se,1):e(ce,-1)}),w(ne),w(d),w(n),o(()=>{H(d,1,`relative w-full ${m(i).kind===`checklist`||m(i).kind===`choice`?`max-w-lg`:`max-w-md`} overflow-hidden rounded-2xl border border-hairline bg-white shadow-2xl shadow-slate-950/20`),H(x,1,`flex h-11 w-11 shrink-0 items-center justify-center rounded-full text-lg ${m(B).iconBg} ${m(B).iconColor}`),c(S,m(B).icon),c(N,m(i).opts.title),c(F,m(i).opts.message)}),U(`click`,r,A),V(3,d,()=>re,()=>({duration:140,start:.96,easing:oe})),V(3,n,()=>ie,()=>({duration:120,easing:oe})),l(t,n)};D(W,e=>{m(i)&&e(ne)}),l(t,te),R()}p([`click`,`input`,`change`]);var et=i(`<div class="untangler-sky svelte-dds6m1" aria-hidden="true"><div class="untangler svelte-dds6m1"><svg viewBox="0 0 240 110" role="img" class="svelte-dds6m1"><g class="tangle tangle-outline svelte-dds6m1"><path d="M5 55 C 32 12, 48 95, 72 32 S 116 80, 148 42 S 196 22, 232 62" class="svelte-dds6m1"></path><path d="M5 70 C 28 32, 52 95, 78 22 S 124 72, 156 44 S 200 30, 232 76" class="svelte-dds6m1"></path><path d="M5 40 C 36 82, 60 12, 92 70 S 118 30, 150 52 S 196 70, 230 30" class="svelte-dds6m1"></path><path d="M5 88 C 30 60, 48 100, 80 65 S 130 95, 165 70 S 210 88, 232 60" class="svelte-dds6m1"></path></g><g class="tangle tangle-fill svelte-dds6m1"><path d="M5 55 C 32 12, 48 95, 72 32 S 116 80, 148 42 S 196 22, 232 62" class="svelte-dds6m1"></path><path d="M5 70 C 28 32, 52 95, 78 22 S 124 72, 156 44 S 200 30, 232 76" class="svelte-dds6m1"></path><path d="M5 40 C 36 82, 60 12, 92 70 S 118 30, 150 52 S 196 70, 230 30" class="svelte-dds6m1"></path><path d="M5 88 C 30 60, 48 100, 80 65 S 130 95, 165 70 S 210 88, 232 60" class="svelte-dds6m1"></path></g><g class="clean clean-outline svelte-dds6m1"><line x1="5" y1="30" x2="232" y2="30" class="svelte-dds6m1"></line><line x1="5" y1="50" x2="232" y2="50" class="svelte-dds6m1"></line><line x1="5" y1="70" x2="232" y2="70" class="svelte-dds6m1"></line><line x1="5" y1="90" x2="232" y2="90" class="svelte-dds6m1"></line></g><g class="clean clean-fill svelte-dds6m1"><line x1="5" y1="30" x2="232" y2="30" class="svelte-dds6m1"></line><line x1="5" y1="50" x2="232" y2="50" class="svelte-dds6m1"></line><line x1="5" y1="70" x2="232" y2="70" class="svelte-dds6m1"></line><line x1="5" y1="90" x2="232" y2="90" class="svelte-dds6m1"></line></g><g class="glint svelte-dds6m1"><rect x="-18" y="18" width="14" height="78" rx="3" class="svelte-dds6m1"></rect></g></svg></div></div>`);function tt(e,t){x(t,!0);let r=[`arrowup`,`arrowup`,`arrowdown`,`arrowdown`,`arrowleft`,`arrowright`,`arrowleft`,`arrowright`,`b`,`a`],i=j(!1),a=``,o=0,s=null;function c(e){return e instanceof HTMLElement?e.isContentEditable?!0:!!e.closest(`input, textarea, select, [contenteditable='true']`):!1}function u(){L(i,!1),s&&clearTimeout(s),requestAnimationFrame(()=>{L(i,!0),s=setTimeout(()=>{L(i,!1)},5200)})}function p(e){return e===r[o]?(o+=1,o<r.length?!1:(o=0,!0)):(o=+(e===r[0]),!1)}function h(e){return e.length!==1||(a=(a+e).slice(-9),a!==`spaghetti`)?!1:(a=``,!0)}function _(e){if(c(e.target))return;let t=e.key.toLowerCase();(p(t)||h(t))&&u()}N(()=>()=>{s&&clearTimeout(s)});var v=d();n(`keydown`,g,_);var y=f(v),b=e=>{l(e,et())};D(y,e=>{m(i)&&e(b)}),l(e,v),R()}var nt=4,rt=1e4,it=e=>{if(e.op!==`delete`)switch(e.kind){case`feature`:return`/features/${e.id}`;case`project`:return`/projects/${e.id}`;case`implementation-status`:return`/features/${e.id}`}},at=800,Y=new class{#e=j(S([]));get toasts(){return m(this.#e)}set toasts(e){L(this.#e,e,!0)}nextId=1;subscribed=!1;unsubscribe=null;timers=new Map;recentKeys=new Map;deadlines=new Map;paused=new Map;start(){this.subscribed||(this.subscribed=!0,this.unsubscribe=ye(e=>this.handle(e)))}dismiss(e){this.clearTimers(e),this.toasts=this.toasts.filter(t=>t.id!==e)}clearTimers(e){let t=this.timers.get(e);t&&clearTimeout(t),this.timers.delete(e),this.deadlines.delete(e),this.paused.delete(e)}arm(e,t){let n=this.timers.get(e);n&&clearTimeout(n),this.deadlines.set(e,Date.now()+t),this.timers.set(e,setTimeout(()=>this.dismiss(e),t))}pause(e){let t=this.timers.get(e);if(t===void 0)return;clearTimeout(t),this.timers.delete(e);let n=Math.max(1e3,(this.deadlines.get(e)??Date.now())-Date.now());this.paused.set(e,n)}resume(e){if(!this.paused.has(e))return;let t=this.paused.get(e)??rt;this.paused.delete(e),this.arm(e,t)}reset(){for(let e of this.timers.values())clearTimeout(e);this.timers.clear(),this.deadlines.clear(),this.paused.clear(),this.toasts=[],this.recentKeys.clear(),this.unsubscribe&&this.unsubscribe(),this.unsubscribe=null,this.subscribed=!1}handle(e){let t=`${e.kind}:${e.id}:${e.op??`save`}`,n=Date.now(),r=this.recentKeys.get(t);if(r!==void 0&&n-r<at){this.recentKeys.set(t,n);return}this.recentKeys.set(t,n);let i=this.nextId++,a=[{id:i,kind:e.kind,entityId:e.id,name:e.name,projectName:e.projectName,op:e.op??`save`,changeOp:e.changeOp,changePath:e.changePath,previousName:e.previousName,actingFor:e.actingFor,...it(e)?{href:it(e)}:{}},...this.toasts].slice(0,nt),o=new Set(a.map(e=>e.id));for(let e of new Set([...this.timers.keys(),...this.paused.keys()]))o.has(e)||this.clearTimers(e);this.toasts=a,this.arm(i,rt)}},ot=i(`<span class="rounded bg-purple-100 px-1.5 py-0.5 text-[9px] text-purple-800"> </span>`),st=i(`<span class="shrink-0 text-slate-400" aria-hidden="true">&rsaquo;</span>`),ct=i(`<!> <span> </span>`,1),lt=i(`<div class="mt-0.5 truncate text-[11px] text-slate-500"> </div>`),ut=i(`<a class="rounded-md bg-white/70 px-2 py-1 text-xs font-medium text-slate-700 hover:bg-white hover:text-brand-800">View</a>`),dt=i(`<div><div class="min-w-0 flex-1"><div class="flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-[10px] font-semibold uppercase tracking-wide"><span class="text-slate-500"> </span> <!></div> <div class="mt-0.5 flex min-w-0 flex-wrap items-center gap-x-1 text-sm text-slate-900"></div> <!></div> <div class="flex shrink-0 items-center gap-1"><!> <button type="button" class="rounded-md px-1.5 py-1 text-xs text-slate-500 hover:bg-white/70 hover:text-slate-900" aria-label="Dismiss">&times;</button></div></div>`),ft=i(`<div class="pointer-events-none fixed top-20 right-4 z-50 flex w-full max-w-md flex-col gap-2" role="status" aria-live="polite"></div>`);function pt(t,r){x(r,!1),P(()=>{Y.start()});function i(e){switch(e){case`feature`:return`feature`;case`project`:return`project`;case`implementation-status`:return`status`}}function a(e){switch(e){case`feature`:return`border-cyan-200 bg-cyan-50`;case`project`:return`border-violet-200 bg-violet-50`;case`implementation-status`:return`border-emerald-200 bg-emerald-50`}}function s(e){if(e.op===`delete`)return`deleted`;switch(e.changeOp){case`added`:return`added`;case`removed`:return`removed`;case`renamed`:return`renamed`;case`edited`:return`edited`;case`queued`:return`queued`;case`unqueued`:return`unqueued`;case`created`:return`created`;case`deleted`:return`deleted`;default:return`saved`}}function p(e){let t=[];e.projectName&&t.push(e.projectName);let n=e.changePath?.[0],r=n!==void 0&&(e.name===n||!e.name);if(e.name&&!r&&t.push(e.name),e.changePath&&e.changePath.length>0)for(let n of e.changePath)t.push(n);else e.name&&t[t.length-1]!==e.name&&t.push(e.name);let i=[];for(let e of t)e!==`unknown`&&i[i.length-1]!==e&&i.push(e);return i.length===0&&i.push(e.entityId),i}function h(e){if(e.op!==`delete`)return Se(e.kind,e.entityId)??e.href}M();var g=d(),v=f(g),y=t=>{var r=ft();u(r,5,()=>Y.toasts,e=>e.id,(t,r)=>{let d=F(()=>p(m(r))),g=F(()=>h(m(r)));var v=dt(),y=_(v),x=_(y),S=_(x),C=_(S);w(S);var T=e(S,2),E=e=>{var t=ot(),n=_(t);w(t),o(()=>c(n,`for ${m(r).actingFor??``}`)),l(e,t)};D(T,e=>{m(r).actingFor&&e(E)}),w(x);var k=e(x,2);u(k,5,()=>m(d),O,(t,n,r)=>{var i=ct(),a=f(i),s=e=>{l(e,st())};D(a,e=>{r>0&&e(s)});var u=e(a,2),p=_(u,!0);w(u),o(()=>{H(u,1,`truncate ${r===m(d).length-1?`font-semibold`:`text-slate-600`}`),c(p,m(n))}),l(t,i)}),w(k);var A=e(k,2),j=e=>{var t=lt(),n=_(t);w(t),o(()=>c(n,`was “${m(r).previousName??``}”`)),l(e,t)};D(A,e=>{m(r).changeOp===`renamed`&&m(r).previousName&&e(j)}),w(y);var M=e(y,2),N=_(M),P=e=>{var t=ut();o(()=>b(t,`href`,m(g))),U(`click`,t,()=>Y.dismiss(m(r).id)),l(e,t)};D(N,e=>{m(g)&&e(P)});var I=e(N,2);w(M),w(v),o((e,t,n)=>{H(v,1,`pointer-events-auto flex items-start gap-3 rounded-lg border px-3 py-2 shadow-md shadow-slate-950/10 ${e??``}`),c(C,`MCP · ${t??``}
2
2
  ${n??``}`)},[()=>a(m(r).kind),()=>s(m(r)),()=>i(m(r).kind)]),n(`mouseenter`,v,()=>Y.pause(m(r).id)),n(`mouseleave`,v,()=>Y.resume(m(r).id)),U(`focusin`,v,()=>Y.pause(m(r).id)),U(`focusout`,v,()=>Y.resume(m(r).id)),U(`click`,I,()=>Y.dismiss(m(r).id)),V(1,v,()=>ae,()=>({x:24,duration:180,easing:oe})),V(2,v,()=>ie,()=>({duration:140})),l(t,v)}),w(r),l(t,r)};D(v,e=>{Y.toasts.length>0&&e(y)}),l(t,g),R()}p([`focusin`,`focusout`,`click`]);var mt=e=>{let t=j(null),n=j(null);if(!e)return{get element(){return m(t)},get rect(){return m(n)},dispose(){}};let r=null,i=e=>{L(n,e?e.getBoundingClientRect():null,!0)},a=()=>{let n=document.querySelector(e);n!==r&&(r=n,L(t,n,!0)),i(n)};a();let o=new MutationObserver(a);o.observe(document.body,{childList:!0,subtree:!0});let s=0,c=()=>{s||=requestAnimationFrame(()=>{s=0,r&&i(r)})},l=new ResizeObserver(c);r&&l.observe(r);let u=new MutationObserver(()=>{l.disconnect(),r&&l.observe(r)});u.observe(document.body,{childList:!0,subtree:!0});let d=()=>c(),f=()=>c();return window.addEventListener(`scroll`,d,!0),window.addEventListener(`resize`,f),{get element(){return m(t)},get rect(){return m(n)},dispose(){s&&cancelAnimationFrame(s),o.disconnect(),u.disconnect(),l.disconnect(),window.removeEventListener(`scroll`,d,!0),window.removeEventListener(`resize`,f)}}},ht=(e,t)=>{let n=e instanceof HTMLTextAreaElement?HTMLTextAreaElement.prototype:HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`)?.set;r?r.call(e,t):e.value=t,e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.dispatchEvent(new Event(`change`,{bubbles:!0}))},gt=e=>{let t=[];for(let n of e){let e=document.querySelector(n.selector);if(!e){t.push(n);continue}e.value.length===0&&ht(e,n.value)}return t},_t=e=>{let t=new WeakSet,n=()=>{e.matches(`:popover-open`)&&e.hidePopover(),e.showPopover()},r=new MutationObserver(r=>{if(!e.matches(`:popover-open`))return;let i=!1;for(let e of r){if(e.type!==`attributes`||e.attributeName!==`open`)continue;let n=e.target;n instanceof HTMLDialogElement&&(n.hasAttribute(`open`)?t.has(n)||(t.add(n),i=!0):t.delete(n))}i&&n()});return r.observe(document.body,{subtree:!0,attributes:!0,attributeFilter:[`open`]}),{dispose(){r.disconnect()}}},vt=i(`<div class="mt-3 rounded-md border border-amber-200 bg-amber-50 px-2.5 py-2 text-[11px] text-amber-900"><p class="mb-1.5 font-medium">First, head to the right page.</p> <button type="button" class="rounded-md bg-slate-900 px-2.5 py-1 text-[11px] font-medium text-white hover:bg-slate-800"> </button></div>`),yt=i(`<p class="mt-3 text-[10px] italic text-slate-500">Click the highlighted element to continue.</p>`),bt=i(`<p class="mt-3 text-[10px] italic text-slate-500">Do the action above to continue.</p>`),xt=i(`<p class="mt-3 text-[10px] italic text-amber-700">Finish the action above first, then click Next.</p>`),St=i(`<aside popover="manual" class="fixed z-1010 m-0 w-80 max-w-[calc(100vw-3rem)] rounded-xl border border-brand-200 bg-white p-4 shadow-2xl shadow-slate-950/20 transition-[top,left,bottom,right] duration-200" aria-label="Interactive tutorial"><header class="mb-2 flex items-start justify-between gap-3"><div class="min-w-0"><p class="text-[10px] font-semibold uppercase tracking-wide text-brand-700"> </p> <h3 class="mt-0.5 text-sm font-semibold text-slate-950"> </h3></div> <button type="button" class="rounded-md px-1.5 py-0.5 text-xs text-slate-400 hover:bg-slate-100 hover:text-slate-700" aria-label="Exit tutorial" title="Exit tutorial">x</button></header> <p class="whitespace-pre-line text-xs leading-5 text-slate-700"> </p> <!> <footer class="mt-3 flex items-center justify-between gap-2"><button type="button" class="rounded-md p-1 text-slate-500 hover:bg-slate-100 hover:text-slate-800 disabled:cursor-not-allowed disabled:opacity-30" aria-label="Previous step" title="Back">&larr;</button> <button type="button" class="rounded-md border border-slate-300 bg-white px-2.5 py-1 text-[11px] font-medium text-slate-600 hover:bg-slate-50">Exit</button> <button type="button" class="rounded-md bg-brand-700 px-3 py-1 text-[11px] font-semibold text-white hover:bg-brand-800 disabled:cursor-not-allowed disabled:bg-slate-300"> </button></footer></aside>`);function Ct(t,n){x(n,!0);let r=j(null);N(()=>{n.panelEl?.(m(r))});let i=E(()=>n.stepNumber===1),a=E(()=>n.stepNumber===n.totalSteps),s=E(()=>{switch(n.placement.kind){case`bottom-right`:return`bottom: 1.5rem; right: 1.5rem; left: auto; top: auto;`;case`bottom-left`:return`bottom: 1.5rem; left: 1.5rem; right: auto; top: auto;`;case`absolute`:return`top: ${n.placement.top}px; left: ${n.placement.left}px; bottom: auto; right: auto;`}});var u=St(),d=_(u),f=_(d),p=_(f),h=_(p);w(p);var g=e(p,2),v=_(g,!0);w(g),w(f);var y=e(f,2);w(d);var S=e(d,2),C=_(S,!0);w(S);var T=e(S,2),O=t=>{var r=vt(),i=e(_(r),2),a=_(i);w(i),w(r),o(()=>c(a,`${n.step.route.label??``} →`)),U(`click`,i,function(...e){n.onGoToRoute?.apply(this,e)}),l(t,r)},k=e=>{l(e,yt())},A=e=>{l(e,bt())},M=e=>{l(e,xt())};D(T,e=>{!n.onCorrectRoute&&n.step.route?e(O):n.step.advance.kind===`click`?e(k,1):n.step.advance.kind===`event`?e(A,2):n.step.advance.kind===`manual`&&!n.nextEnabled&&e(M,3)});var P=e(T,2),F=_(P),ee=e(F,2),B=e(ee,2),V=_(B);w(B),w(P),w(u),I(u,e=>L(r,e),()=>m(r)),o(()=>{z(u,m(s)),c(h,`Tutorial · step ${n.stepNumber??``} of ${n.totalSteps??``}`),c(v,n.step.title),c(C,n.step.body),F.disabled=m(i),B.disabled=!n.nextEnabled,b(B,`title`,n.nextEnabled?m(a)?`Finish the tour`:`Next step`:`Finish the current action first`),c(V,`${m(a)?`Finish`:`Next`} →`)}),U(`click`,y,function(...e){n.onExit?.apply(this,e)}),U(`click`,F,function(...e){n.onPrev?.apply(this,e)}),U(`click`,ee,function(...e){n.onExit?.apply(this,e)}),U(`click`,B,function(...e){n.onNext?.apply(this,e)}),l(t,u),R()}p([`click`]);var wt=i(`<div class="pointer-events-none fixed z-20 rounded-lg ring-4 ring-brand-400 ring-offset-2 ring-offset-transparent" aria-hidden="true"></div>`),Tt=i(`<div class="pointer-events-none fixed inset-0 z-20 bg-slate-950/55" aria-hidden="true"></div> <button type="button" class="pointer-events-auto fixed left-1/2 top-20 z-1015 inline-flex -translate-x-1/2 items-center gap-2 rounded-full border border-brand-300 bg-white px-4 py-2 text-xs font-semibold text-brand-800 shadow-lg shadow-slate-950/30 animate-pulse hover:bg-brand-50" aria-label="Scroll up to see highlighted element"><span aria-hidden="true">&uarr;</span> <span>Highlight is above &mdash; click to scroll up</span></button>`,1),Et=i(`<div class="pointer-events-none fixed inset-0 z-20 bg-slate-950/55" aria-hidden="true"></div> <button type="button" class="pointer-events-auto fixed left-1/2 bottom-24 z-1015 inline-flex -translate-x-1/2 items-center gap-2 rounded-full border border-brand-300 bg-white px-4 py-2 text-xs font-semibold text-brand-800 shadow-lg shadow-slate-950/30 animate-pulse hover:bg-brand-50" aria-label="Scroll down to see highlighted element"><span>Highlight is below &mdash; click to scroll down</span> <span aria-hidden="true">&darr;</span></button>`,1),Dt=i(`<div class="pointer-events-none fixed inset-0 z-20 bg-slate-950/55" aria-hidden="true"></div>`);function Ot(t,n){x(n,!0);let r=j(0);N(()=>{let e=()=>{L(r,window.innerHeight,!0)};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)});let i=E(()=>n.rect?{top:n.rect.top-10,left:n.rect.left-10,width:n.rect.width+20,height:n.rect.height+20}:null),a=E(()=>!n.rect||m(r)===0?null:n.rect.bottom<64?`above`:n.rect.top>m(r)?`below`:`visible`);var s=d(),c=f(s),u=e=>{var t=wt();o(()=>z(t,`top: ${m(i).top??``}px; left: ${m(i).left??``}px; width: ${m(i).width??``}px; height: ${m(i).height??``}px; box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55);`)),l(e,t)},p=t=>{var n=Tt();U(`click`,e(f(n),2),()=>window.scrollBy({top:-window.innerHeight*.7,behavior:`smooth`})),l(t,n)},h=t=>{var n=Et();U(`click`,e(f(n),2),()=>window.scrollBy({top:window.innerHeight*.7,behavior:`smooth`})),l(t,n)},g=e=>{l(e,Dt())};D(c,e=>{m(i)&&m(a)===`visible`?e(u):m(i)&&m(a)===`above`?e(p,1):m(i)&&m(a)===`below`?e(h,2):e(g,-1)}),l(t,s),R()}p([`click`]);var kt=i(`<!> <!>`,1);function At(t,n){x(n,!0);let r=E(()=>K.currentStep),i=E(()=>m(r)?.route?G.url?.pathname===m(r).route.pathname:!0),a=j(null);N(()=>{let e=mt(m(i)?m(r)?.target??null:null);return L(a,e,!0),()=>e.dispose()});let o=E(()=>m(a)?.rect??null),s=E(()=>{if(typeof window>`u`)return{kind:`bottom-right`};let e=m(r)?.panelPosition??`bottom-right`;if(e===`avoid-target`)return m(o)&&m(o).left+m(o).width/2>window.innerWidth/2?{kind:`bottom-left`}:{kind:`bottom-right`};if(e===`below-target`&&m(o)){let e=m(o).bottom+16;if(e+220>window.innerHeight-16)return{kind:`bottom-right`};let t=m(o).left+m(o).width/2-320/2;return{kind:`absolute`,top:e,left:Math.max(16,Math.min(t,window.innerWidth-320-16))}}return{kind:`bottom-right`}}),c=E(()=>!m(r)||m(r).advance.kind!==`manual`?!1:m(r).canAdvance?m(r).canAdvance():!0);N(()=>{let e=m(a)?.element;e&&e.scrollIntoView({behavior:`smooth`,block:`center`})}),N(()=>{let e=m(r);if(!e?.focusSelector||!m(i))return;let t=e.focusSelector,n=!1,a=0,o=()=>{if(n||a++>60)return;let e=document.querySelector(t);if(e){e.focus(),(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&e.select();return}requestAnimationFrame(o)};return requestAnimationFrame(o),()=>{n=!0}}),N(()=>{if(!m(r)?.lockScroll)return;let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}}),N(()=>{if(!m(r)?.target||K.stepIndex===0)return;let e=!1,t=null,n=!1,i=setInterval(()=>{n||(m(a)?.element==null?e&&!t&&(t=setTimeout(()=>K.previous(),500)):(e=!0,t&&=(clearTimeout(t),null)))},150);return()=>{n=!0,clearInterval(i),t&&clearTimeout(t)}}),N(()=>{let e=m(r);if(!e||e.advance.kind!==`click`)return;let t=e.advance.selector,n=e=>{let n=e.target;n instanceof Element&&n.closest(t)&&setTimeout(()=>K.next(),0)};return document.addEventListener(`click`,n,!0),()=>document.removeEventListener(`click`,n,!0)}),N(()=>{let e=m(r);if(!e?.prefill||e.prefill.length===0||!m(i))return;let t=[...e.prefill],n=0,a=!1,o=()=>{a||(t=gt(t),t.length>0&&(n=requestAnimationFrame(o)))};return o(),()=>{a=!0,n&&cancelAnimationFrame(n)}});let u=j(null);N(()=>{m(u)&&(m(r)&&!m(u).matches(`:popover-open`)&&m(u).showPopover(),!m(r)&&m(u).matches(`:popover-open`)&&m(u).hidePopover())}),N(()=>{if(!m(u))return;let e=_t(m(u));return()=>e.dispose()});function p(){m(r)?.route&&ne(m(r).route.pathname)}var h=d(),g=f(h),_=t=>{var n=kt(),a=f(n),d=e=>{Ot(e,{get rect(){return m(o)}})};D(a,e=>{m(i)&&e(d)});var h=e(a,2);{let e=E(()=>K.stepIndex+1);Ct(h,{get step(){return m(r)},get stepNumber(){return m(e)},get totalSteps(){return K.totalSteps},get onCorrectRoute(){return m(i)},get placement(){return m(s)},get nextEnabled(){return m(c)},panelEl:e=>L(u,e,!0),onGoToRoute:p,onPrev:()=>K.previous(),onNext:()=>K.next(),onExit:()=>K.cancel()})}l(t,n)};D(g,e=>{m(r)&&e(_)}),l(t,h),R()}var jt=i(`<div class="border-b border-brand-200/70 bg-brand-50/80"><div class="mx-auto flex max-w-7xl flex-col gap-2 px-4 py-2.5 sm:px-6 md:flex-row md:items-center md:gap-4"><p class="min-w-0 flex-1 text-sm leading-5 text-slate-700"><span class="font-semibold text-slate-900">New here?</span> Take the 3-minute interactive tour: build a tiny feature and run it in the simulator, right
3
3
  in this app.</p> <div class="flex shrink-0 flex-wrap items-center gap-2"><button type="button" class="rounded-md bg-brand-700 px-3 py-1.5 text-xs font-semibold text-white shadow-sm shadow-slate-950/10 transition hover:bg-brand-800">Start the tour</button> <button type="button" class="rounded-md border border-brand-300 bg-white px-3 py-1.5 text-xs font-medium text-brand-800 transition hover:bg-brand-100 disabled:cursor-wait disabled:opacity-70"> </button> <a href="/tutorial" class="rounded-md px-2 py-1.5 text-xs font-medium text-brand-800 underline-offset-2 transition hover:underline">Read the guide</a> <button type="button" class="grid h-7 w-7 place-items-center rounded-md text-slate-500 transition hover:bg-brand-100 hover:text-slate-800" aria-label="Dismiss the getting-started banner" title="Don't show this again (the Help page keeps these shortcuts)"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="h-4 w-4" aria-hidden="true"><path d="M18 6 6 18"></path><path d="m6 6 12 12"></path></svg></button></div></div></div>`);function Mt(t,n){x(n,!0);let r=E(()=>G.url.pathname.startsWith(`/tutorial`)||G.url.pathname.startsWith(`/builder-mode`)),i=E(()=>Te.showBanner&&!K.isActive&&!m(r)),a=j(!1);async function s(){if(!m(a)){L(a,!0);try{await De()}finally{L(a,!1)}}}var u=d(),p=f(u),h=t=>{var n=jt(),r=_(n),i=e(_(r),2),u=_(i),d=e(u,2),f=_(d,!0);w(d);var p=e(d,4);w(i),w(r),w(n),o(()=>{d.disabled=m(a),c(f,m(a)?`Loading...`:`Load sample project`)}),U(`click`,u,()=>K.start(Ee)),U(`click`,d,s),U(`click`,p,()=>Te.dismiss()),l(t,n)};D(p,e=>{m(i)&&e(h)}),l(t,u),R()}p([`click`]);var Nt=`unspa.globalQueue`,X=new class{#e=j(null);get projectId(){return m(this.#e)}set projectId(e){L(this.#e,e,!0)}#t=j(``);get projectName(){return m(this.#t)}set projectName(e){L(this.#t,e,!0)}#n=j(S([]));get views(){return m(this.#n)}set views(e){L(this.#n,e,!0)}#r=j(null);get error(){return m(this.#r)}set error(e){L(this.#r,e,!0)}#i=j(!1);get open(){return m(this.#i)}set open(e){L(this.#i,e,!0)}hydrated=!1;init(){if(!this.hydrated){this.hydrated=!0;try{let e=localStorage.getItem(Nt);if(!e)return;let t=JSON.parse(e);typeof t.projectId==`string`&&(this.projectId=t.projectId),typeof t.projectName==`string`&&(this.projectName=t.projectName),typeof t.open==`boolean`&&(this.open=t.open)}catch{}this.refresh()}}persist(){try{if(!this.projectId){localStorage.removeItem(Nt);return}let e={projectId:this.projectId,projectName:this.projectName,open:this.open};localStorage.setItem(Nt,JSON.stringify(e))}catch{}}setActiveProject(e,t){let n=this.projectId!==e;this.projectId=e,t&&(this.projectName=t),n&&this.persist()}setOpen(e){this.open=e,this.persist()}toggleOpen(){this.setOpen(!this.open)}async refresh(){let e=this.projectId;if(!e){this.views=[];return}try{let t=await ge();this.views=await t.useCases.listQueue(he(e)),this.error=null}catch(e){this.views=[],this.error=e.message}}async dequeue(e){await this.mutate((t,n)=>t.useCases.dequeueQueueItem(he(n),e))}async moveTo(e,t){await this.mutate((n,r)=>n.useCases.moveQueueItem(he(r),e,{kind:`to`,targetIndex:t}))}async mutate(e){let t=this.projectId;if(t){this.error=null;try{let n=await e(await ge(),t);this.syncLoadedStores(n),await this.refresh()}catch(e){this.error=e.message}}}syncLoadedStores(e){let t=String(e.id);ke.project&&String(ke.project.id)===t&&(ke.project=e),Ae.project&&String(Ae.project.id)===t&&(Ae.project=e)}},Pt=i(`<p class="mt-0.5 truncate text-xs text-slate-500"> </p>`),Ft=i(`<p class="mb-2 rounded-md border border-red-200 bg-red-50 px-3 py-2 text-xs text-red-700"> </p>`),It=i(`<div class="rounded-lg border border-dashed border-slate-300 bg-slate-50/60 p-5 text-center text-xs text-slate-500"><p class="font-medium text-slate-700">Nothing queued yet.</p> <p class="mt-1">Hover any Feature card, Surface, or Action and click <span class="font-semibold text-brand-700">+ queue</span> to plan what to implement next.</p></div>`),Lt=i(`<a class="font-medium text-slate-900 hover:text-brand-800 hover:underline"> </a> <span class="text-xs text-slate-500"> </span>`,1),Rt=i(`<a class="font-medium text-slate-900 hover:text-brand-800 hover:underline"> </a>`),zt=i(`<span class="block truncate text-xs text-slate-500"> </span>`),Bt=i(`<span class="shrink-0 rounded bg-amber-100 px-1.5 py-0.5 text-[10px] font-semibold text-amber-800" title="Target was deleted from the spec">orphan</span>`),Vt=i(`<li draggable="true"><span class="cursor-grab select-none text-slate-300 transition-colors group-hover:text-slate-500 active:cursor-grabbing" aria-hidden="true" title="Drag to reorder">⋮⋮</span> <span class="w-5 shrink-0 text-right text-[11px] tabular-nums text-slate-400"> </span> <span> </span> <div class="min-w-0 flex-1 truncate"><!> <!></div> <!> <div class="flex shrink-0 items-center gap-0.5 opacity-0 transition group-hover:opacity-100 group-focus-within:opacity-100"><button type="button" class="rounded px-1 text-xs text-slate-400 hover:bg-slate-100 hover:text-slate-700 disabled:cursor-not-allowed disabled:opacity-30" aria-label="Move up" title="Move up">↑</button> <button type="button" class="rounded px-1 text-xs text-slate-400 hover:bg-slate-100 hover:text-slate-700 disabled:cursor-not-allowed disabled:opacity-30" aria-label="Move down" title="Move down">↓</button> <button type="button" class="rounded px-1 text-xs text-slate-400 hover:bg-red-50 hover:text-red-600" aria-label="Remove from queue" title="Remove from queue">✕</button></div></li>`),Ht=i(`<ul class="space-y-1.5"></ul>`),Ut=i(`<section class="fixed bottom-5 right-5 z-40 flex max-h-[70vh] w-[min(92vw,380px)] flex-col overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-2xl shadow-slate-950/15 ring-1 ring-slate-950/5"><header class="flex shrink-0 items-start justify-between gap-3 border-b border-slate-200 bg-slate-50 px-4 py-3"><div class="min-w-0"><div class="flex items-center gap-2"><span class="text-brand-600" aria-hidden="true">▶</span> <h2 class="text-sm font-semibold text-slate-800">Implementation queue</h2> <span class="rounded-full bg-brand-600 px-2 py-0.5 text-xs font-bold tabular-nums text-white"> </span></div> <!></div> <button type="button" class="-mr-1 shrink-0 rounded-md p-1 text-slate-400 transition hover:bg-slate-200 hover:text-slate-700" aria-label="Minimize implementation queue" title="Minimize"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="h-4 w-4" aria-hidden="true"><path d="M6 9l6 6 6-6"></path></svg></button></header> <div class="min-h-0 flex-1 overflow-y-auto p-3"><!> <!></div></section>`),Wt=i(`<button type="button" class="group fixed bottom-5 right-5 z-40 flex items-center gap-2 rounded-full border border-slate-200 bg-white py-2.5 pl-4 pr-3 text-sm font-semibold text-slate-800 shadow-xl shadow-slate-950/15 ring-1 ring-slate-950/5 transition hover:border-brand-400 hover:shadow-brand-500/15" aria-label="Open implementation queue" title="Implementation queue"><span class="text-brand-600 transition group-hover:translate-x-0.5" aria-hidden="true">▶</span> Queue <span class="rounded-full bg-brand-600 px-2 py-0.5 text-xs font-bold tabular-nums text-white"> </span></button>`);function Gt(t,r){x(r,!0);let i=typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,a=e=>i?0:e;X.init(),N(()=>{let e=ke.project??Ae.project;e?.implementationQueue,h(()=>{e&&X.setActiveProject(String(e.id),e.name),X.refresh()})}),P(()=>ye(e=>{X.projectId&&(e.kind===`project`||e.kind===`feature`)&&X.refresh()}));let s=j(null),p=j(null);function g(e,t){L(s,t,!0),e.dataTransfer&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,String(t)))}function v(e,t){m(s)!==null&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),L(p,t,!0))}async function y(e,t){e.preventDefault();let n=m(s);L(s,null),L(p,null),n&&await X.moveTo(n,t)}function S(){L(s,null),L(p,null)}async function C(e,t){let n=X.views.findIndex(t=>t.item.id===e);n<0||await X.moveTo(e,n+t)}async function T(e){await X.dequeue(e)}var O=d(),k=f(O),A=t=>{var r=Ut(),i=_(r),d=_(i),h=_(d),x=e(_(h),4),O=_(x,!0);w(x),w(h);var k=e(h,2),A=e=>{var t=Pt(),n=_(t,!0);w(t),o(()=>{b(t,`title`,X.projectName),c(n,X.projectName)}),l(e,t)};D(k,e=>{X.projectName&&e(A)}),w(d);var j=e(d,2);w(i);var M=e(i,2),N=_(M),P=e=>{var t=Ft(),n=_(t,!0);w(t),o(()=>c(n,X.error)),l(e,t)};D(N,e=>{X.error&&e(P)});var F=e(N,2),I=e=>{l(e,It())},L=t=>{var r=Ht();u(r,23,()=>X.views,e=>e.item.id,(t,r,i)=>{let a=E(()=>m(r).item.id),u=E(()=>m(s)===m(a)),d=E(()=>m(p)===m(i)&&m(s)!==null&&m(s)!==m(a));var h=Vt(),x=e(_(h),2),O=_(x);w(x);var k=e(x,2),A=_(k,!0);w(k);var j=e(k,2),M=_(j),N=t=>{var n=Lt(),i=f(n),a=_(i,!0);w(i);var s=e(i,2),u=_(s);w(s),o(()=>{b(i,`href`,`/features/${m(r).item.featureId}`),c(a,m(r).actionName??`(unnamed action)`),c(u,`· ${m(r).featureName??``}`)}),l(t,n)},P=t=>{var n=Lt(),i=f(n),a=_(i,!0);w(i);var s=e(i,2),u=_(s);w(s),o(()=>{b(i,`href`,`/features/${m(r).item.featureId}`),c(a,m(r).surfaceName??`(unnamed surface)`),c(u,`· ${m(r).featureName??``}`)}),l(t,n)},F=e=>{var t=Rt(),n=_(t,!0);w(t),o(()=>{b(t,`href`,`/features/${m(r).item.featureId}`),c(n,m(r).featureName)}),l(e,t)};D(M,e=>{m(r).item.kind===`action`?e(N):m(r).item.kind===`surface`?e(P,1):e(F,-1)});var I=e(M,2),L=e=>{var t=zt(),n=_(t,!0);w(t),o(()=>c(n,m(r).item.note)),l(e,t)};D(I,e=>{m(r).item.note&&e(L)}),w(j);var ee=e(j,2),R=e=>{l(e,Bt())};D(ee,e=>{m(r).orphaned&&e(R)});var z=e(ee,2),B=_(z),V=e(B,2),te=e(V,2);w(z),w(h),o(()=>{H(h,1,`group flex items-center gap-2 rounded-md border bg-white px-2 py-1.5 text-sm transition
4
4
  ${m(r).orphaned?`border-amber-200 bg-amber-50/40`:`border-slate-200`}
@@ -1 +1 @@
1
- import{$ as e,F as t,K as n,M as r,N as i,Q as a,Z as o,dt as s,gt as c,ut as l}from"../chunks/CYsLq4VE.js";import"../chunks/xihTtKlq.js";import{t as u}from"../chunks/CgSXJuIO.js";var d=t(`<h1> </h1> <p> </p>`,1);function f(t,f){s(f,!0);var p=d(),m=a(p),h=o(m,!0);c(m);var g=e(m,2),_=o(g,!0);c(g),n(()=>{r(h,u.status),r(_,u.error?.message)}),i(t,p),l()}export{f as component};
1
+ import{$ as e,F as t,K as n,M as r,N as i,Q as a,Z as o,dt as s,gt as c,ut as l}from"../chunks/CYsLq4VE.js";import"../chunks/xihTtKlq.js";import{t as u}from"../chunks/BocNk-Bz.js";var d=t(`<h1> </h1> <p> </p>`,1);function f(t,f){s(f,!0);var p=d(),m=a(p),h=o(m,!0);c(m);var g=e(m,2),_=o(g,!0);c(g),n(()=>{r(h,u.status),r(_,u.error?.message)}),i(t,p),l()}export{f as component};
@@ -0,0 +1 @@
1
+ w`�*ݪ�nf|�
@@ -0,0 +1 @@
1
+ import{G as e,S as t,Y as n,dt as r,o as i,ut as a}from"../chunks/CYsLq4VE.js";import"../chunks/xihTtKlq.js";import{t as o}from"../chunks/BocNk-Bz.js";import"../chunks/DkAKB9py.js";import{t as s}from"../chunks/Cbsgl_qu2.js";import{t as c}from"../chunks/DtgkZP4Z2.js";function l(l,u){r(u,!1),i(),t(`rqn88j`,t=>{e(e=>{n.title=e??``},[()=>s(o.url,`Projects`)])}),c(l,{}),a()}export{l as component};
@@ -0,0 +1,2 @@
1
+ � �̶��f�A�����r��O�@��ka��m��Eq�Y�-Oox��^ZZN�h7���x|:{�� �<�����Ή�K�J��|Cu��O�d����-
2
+ ��$��jT~B���)E��
@@ -1,4 +1,4 @@
1
- import{$ as e,A as t,B as n,F as r,G as i,K as a,L as o,M as s,N as c,O as l,P as u,Q as d,R as f,S as p,U as m,V as h,X as g,Y as _,Z as v,_ as y,at as b,d as x,dt as S,et as C,g as w,gt as T,h as E,ht as D,it as O,j as k,k as A,l as j,m as M,n as N,nt as P,o as F,ot as I,q as L,r as R,s as z,st as B,tt as V,u as H,ut as U,vt as ee,w as W,x as te,y as ne,z as G}from"../chunks/CYsLq4VE.js";import{r as re}from"../chunks/CCRkIitA.js";import"../chunks/xihTtKlq.js";import"../chunks/BrWeFyMA.js";import{n as K,t as ie}from"../chunks/BE7NaZk8.js";import{Bt as q,E as J,Ft as ae,L as oe,Ot as se,Rt as Y,T as ce,U as X,V as le,a as ue,h as de,i as fe,l as pe,p as me,t as he,ut as ge,w as _e}from"../chunks/PGh5ehlS.js";import"../chunks/DkAKB9py.js";import{t as ve}from"../chunks/BcjkusYG.js";import{n as ye}from"../chunks/niJ1Cp3-.js";import{t as be}from"../chunks/CGWhvtMz.js";import{t as Z}from"../chunks/DsJUUSRq.js";import{c as xe,r as Se}from"../chunks/Cuj9IeTJ.js";import{t as Ce}from"../chunks/EZgceN_E.js";import{t as we}from"../chunks/Cbsgl_qu2.js";import{t as Te}from"../chunks/CT4vNU442.js";import{c as Ee,l as De,n as Oe,o as ke,t as Ae}from"../chunks/1qwcT7H12.js";import{t as je}from"../chunks/C0MTuC4u2.js";import{t as Me}from"../chunks/Txy2b5lN2.js";import{t as Ne}from"../chunks/CwFCbQnJ2.js";import{t as Pe}from"../chunks/CGRZ0hx_2.js";import{a as Fe,c as Ie,o as Le,r as Re,s as ze,t as Be}from"../chunks/CfF5WnjG2.js";import{t as Q}from"../chunks/BLqvzp0B.js";var Ve=r(`<button type="button" class="h-8 rounded-md px-2 text-xs font-medium text-slate-500 hover:bg-slate-50 hover:text-slate-900">Clear</button>`),He=r(`<div class="space-y-3"><p>No features in this project yet.</p> <div class="flex flex-wrap justify-center gap-2"><button type="button" class="rounded-md bg-slate-900 px-4 py-2 text-sm font-medium text-white">Create first feature</button></div></div>`),Ue=r(`<div class="rounded-lg border border-dashed border-hairline bg-white p-6 text-center text-sm text-slate-500"><!></div>`),We=r(`<li><!></li>`),Ge=r(`<ul class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3"></ul>`),Ke=r(`<div class="fixed inset-0 z-40 flex items-start justify-center bg-slate-950/30 px-4 py-24 backdrop-blur-sm" role="presentation"><div class="w-full max-w-2xl rounded-xl border border-hairline bg-white shadow-xl" role="dialog" aria-modal="true" aria-labelledby="add-feature-dialog-title"><header class="flex items-start justify-between gap-4 border-b border-hairline px-5 py-4"><div><h2 id="add-feature-dialog-title" class="text-base font-semibold text-slate-950">Add an feature</h2> <p class="mt-1 text-sm text-slate-500">Create a new behavior model. It will be tied to this project automatically.</p></div> <button type="button" class="rounded-md px-2 py-1 text-sm text-slate-500 hover:bg-slate-100 hover:text-slate-900" aria-label="Close">x</button></header> <form class="space-y-3 p-5" data-tour="new-feature-form"><label class="block text-xs font-medium text-slate-700">Feature name <input type="text" placeholder="e.g. Restaurant booking" class="mt-1 h-10 w-full rounded-md border border-slate-300 bg-white px-3 text-sm outline-none focus:border-slate-900" required=""/></label> <label class="block text-xs font-medium text-slate-700">Description <input type="text" data-tour="new-feature-description" placeholder="What is this feature about?" class="mt-1 h-10 w-full rounded-md border border-slate-300 bg-white px-3 text-sm outline-none focus:border-slate-900" required=""/></label> <div class="flex justify-end gap-2 pt-2"><button type="button" class="h-10 rounded-md border border-slate-300 bg-white px-4 text-sm font-medium text-slate-700 hover:bg-slate-50">Cancel</button> <button type="submit" class="h-10 rounded-md bg-slate-900 px-4 text-sm font-medium text-white disabled:opacity-50"> </button></div></form></div></div>`),qe=r(`<div class="space-y-4"><div class="rounded-xl border border-slate-200 bg-white p-3 shadow-sm shadow-slate-950/5"><div class="flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between"><div class="flex min-w-0 items-center rounded-lg border border-hairline bg-white p-1 lg:flex-1"><label for="project-feature-search" class="sr-only">Search project features</label> <input id="project-feature-search" type="search" placeholder="Search features..." class="h-9 w-full min-w-0 rounded-md border-0 bg-transparent px-3 text-sm outline-none placeholder:text-slate-400"/> <!></div> <div class="flex flex-col gap-2 sm:flex-row sm:items-center"><!> <label class="flex h-10 items-center gap-2 rounded-lg border border-hairline bg-white px-3 text-sm text-slate-600"><span class="text-xs font-medium">Sort</span> <select class="bg-transparent text-sm font-medium text-slate-800 outline-none"><option>Updated</option><option>Name</option><option>Maturity</option></select></label> <button type="button" data-tour="new-feature-button" class="inline-flex h-10 items-center justify-center gap-2 rounded-md bg-slate-900 px-4 text-sm font-medium text-white" title="Create a new feature inside this project"><span aria-hidden="true">+</span> New feature</button></div></div></div> <!></div> <!>`,1);function Je(t,r){S(r,!0);let i=P(`all`);function u(e,t){return t.length===0?!0:e.name.toLowerCase().includes(t)||(e.description??``).toLowerCase().includes(t)}function f(e,t){let n=e.tags??[];if(t===`all`)return!0;if(t===`untagged`)return n.length===0;let r=le(t);return n.some(e=>le(e)===r)}let p=O(()=>{let e=r.search.trim().toLowerCase();return r.features.filter(t=>u(t,e)&&f(t,h(i)))}),_=O(()=>{let e=[];for(let t of r.features)for(let n of t.tags??[])e.push(n);return e});L(()=>{Ce.registerTypes(h(_).map(e=>e.type))});function y(e){let t=r.search.trim().toLowerCase();return r.features.filter(n=>u(n,t)&&f(n,e)).length}let b=P(!1),w=P(null),D=P(`updated`),A=P(``),N=P(``),F=P(!1),I=O(()=>je(ye.currentStep,`new-feature`,h(A))),R=P(C(new Map));L(()=>{let e=r.features.map(e=>String(e.id)),t=!1;return(async()=>{let n=await he(),r=e.filter(e=>!h(R).has(e));if(r.length===0)return;let i=await Promise.all(r.map(async e=>[e,await n.statusRepository.get(e)]));if(t)return;let a=new Map(h(R));for(let[e,t]of i)a.set(e,t);V(R,a,!0)})(),()=>{t=!0}});async function B(e){try{let t=await(await he()).statusRepository.get(e),n=new Map(h(R));n.set(e,t),V(R,n,!0)}catch{}}L(()=>ve(e=>{e.kind!==`implementation-status`&&e.kind!==`feature`||r.features.some(t=>String(t.id)===e.id)&&B(e.id)})),L(()=>{h(b)&&m().then(()=>h(w)?.focus())});function ee(){V(b,!0)}function W(){V(b,!1),V(A,``),V(N,``)}async function te(){let e=h(A).trim();if(!(h(F)||e.length===0)&&h(N).trim().length!==0){V(F,!0);try{await r.onCreate(e,h(N).trim()),W()}finally{V(F,!1)}}}function ne(e){e.key===`Escape`&&W()}function re(e){let t=J(e),n=ce(e,h(R).get(String(e.id))??null);return{id:e.id,name:e.name,description:e.description,surfaceCount:e.surfaces.length,actionCount:e.surfaces.reduce((e,t)=>e+t.actions.length,0),createdAt:e.createdAt,updatedAt:e.updatedAt,tags:e.tags,maturityPercentage:t.percentage,criticalIssueCount:t.criticalIssues.length,recommendedIssueCount:t.recommendedIssues.length,implementationPercentage:n.expectedCount===0?null:n.percentage,implementationFoundCount:n.foundCount,implementationExpectedCount:n.expectedCount,implementationHasReport:n.hasReport}}let K=O(()=>h(p).map(re).sort((e,t)=>h(D)===`name`?e.name.localeCompare(t.name):h(D)===`maturity`?t.maturityPercentage-e.maturityPercentage:new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime())),ie=O(()=>{let e=new Set;for(let t of r.features)for(let n of t.tags??[])e.add(oe(n.type));return[...e].sort((e,t)=>e.localeCompare(t))});function q(e){let t=Z.project?.implementationQueue??[],n=`feature:${String(e)}`;return t.some(e=>fe(e)===n)}async function ae(e){if(!Z.project)return;let t=await(await he()).useCases.enqueueQueueItem(Z.project.id,{kind:`feature`,featureId:e});Z.project&&=t.project}async function se(e){if(!Z.project)return;let t=Z.project.implementationQueue??[],n=`feature:${String(e)}`,r=t.find(e=>fe(e)===n);if(!r)return;let i=await(await he()).useCases.dequeueQueueItem(Z.project.id,r.id);Z.project&&=i}var Y=qe();n(`keydown`,g,ne);var X=d(Y),ue=v(X),de=v(ue),pe=v(de),me=e(v(pe),2);H(me);var ge=e(me,2),_e=e=>{var t=Ve();G(`click`,t,()=>r.onSearch(``)),c(e,t)},be=O(()=>r.search.trim().length>0);k(ge,e=>{h(be)&&e(_e)}),T(pe);var xe=e(pe,2),Se=v(xe);Me(Se,{get tags(){return h(_)},get value(){return h(i)},onChange:e=>V(i,e,!0),countLabel:y});var we=e(Se,2),Te=e(v(we),2),Ee=v(Te);Ee.value=Ee.__value=`updated`;var De=e(Ee);De.value=De.__value=`name`;var Oe=e(De);Oe.value=Oe.__value=`maturity`,T(Te),T(we);var ke=e(we,2);T(xe),T(de),T(ue);var Ae=e(ue,2),Pe=t=>{var n=Ue(),i=v(n),a=t=>{var n=He(),r=e(v(n),2),i=v(r);T(r),T(n),G(`click`,i,()=>ee()),c(t,n)},s=e=>{c(e,o(`No features match your search.`))};k(i,e=>{r.features.length===0?e(a):e(s,-1)}),T(n),c(t,n)},Fe=e=>{var t=Ge();l(t,21,()=>h(K),e=>e.id,(e,t)=>{var n=We(),i=v(n);{let e=O(()=>r.onRemoveTag?(e,n)=>r.onRemoveTag(h(t).id,{type:e,value:n}):void 0),n=O(()=>q(h(t).id));Ne(i,{get summary(){return h(t)},get tagTypeOptions(){return h(ie)},deleteLabel:`Remove`,onAddTag:(e,n)=>r.onAddTag(h(t).id,{type:e,value:n}),get onRemoveTag(){return h(e)},onDelete:()=>r.onRemove(h(t).id),get queued(){return h(n)},onAddToQueue:()=>ae(h(t).id),onRemoveFromQueue:()=>se(h(t).id)})}T(n),c(e,n)}),T(t),c(e,t)};k(Ae,e=>{h(K).length===0?e(Pe):e(Fe,-1)}),T(X);var Ie=e(X,2),Le=t=>{var r=Ke(),i=v(r),o=v(i),l=e(v(o),2);T(o);var u=e(o,2),d=v(u),f=e(v(d));H(f),z(f,e=>V(w,e),()=>h(w)),T(d);var p=e(d,2),m=e(v(p));H(m),T(p);var g=e(p,2),_=v(g),y=e(_,2),b=v(y,!0);T(y),T(g),T(u),T(i),T(r),a(e=>{y.disabled=e,x(y,`title`,h(I).blocked?`Tutorial: name must be exactly "${h(I).requiredValue}"`:void 0),s(b,h(F)?`Creating...`:`Create feature`)},[()=>h(F)||h(A).trim().length===0||h(N).trim().length===0||h(I).blocked]),G(`click`,r,e=>{e.currentTarget===e.target&&W()}),G(`click`,l,W),n(`submit`,u,e=>{e.preventDefault(),te()}),j(f,()=>h(A),e=>V(A,e)),j(m,()=>h(N),e=>V(N,e)),G(`click`,_,W),c(t,r)};k(Ie,e=>{h(b)&&e(Le)}),a(()=>M(me,r.search)),G(`input`,me,e=>r.onSearch(e.target.value)),E(Te,()=>h(D),e=>V(D,e)),G(`click`,ke,()=>ee()),c(t,Y),U()}f([`input`,`click`]);var Ye=r(`<li><span class="font-medium"> </span> </li>`),Xe=r(`<div class="rounded-lg border border-amber-200 bg-amber-50 p-3 text-xs text-amber-900"><p class="font-semibold"> <span class="font-normal text-amber-700">(these never block a save)</span></p> <ul class="mt-1 space-y-0.5"></ul></div>`),Ze=r(`<div class="rounded-lg border border-dashed border-slate-300 bg-slate-50/40 p-6 text-center text-sm text-slate-500">No core features declared yet. Declare one above, then assign features to it below.</div>`),Qe=r(`<option> </option>`),$e=r(`<li class="flex items-center justify-between gap-2 py-1.5 text-sm"><span class="min-w-0 truncate text-slate-700"> </span> <select class="shrink-0 rounded-md border border-slate-300 px-1.5 py-1 text-xs text-slate-700"><option>(none)</option><!></select></li>`),et=r(`<ul class="mt-2 divide-y divide-slate-100"></ul>`),tt=r(`<div class="rounded-lg border border-slate-200 bg-white p-3"><div class="flex items-start justify-between gap-3"><div class="min-w-0 flex-1"><h3 class="text-sm font-semibold text-slate-900"> </h3> <textarea rows="1" class="mt-1 w-full resize-none overflow-hidden rounded-md border border-slate-200 px-2 py-1 text-xs leading-relaxed text-slate-600 outline-none focus:border-slate-400"></textarea></div> <div class="flex shrink-0 items-center gap-2"><span class="rounded bg-slate-100 px-1.5 py-0.5 text-[11px] text-slate-600"> </span> <button type="button" class="text-xs text-slate-400 hover:text-red-600">Remove</button></div></div> <!></div>`),nt=r(`<div class="space-y-3"></div>`),rt=r(`<li class="flex items-center justify-between gap-2 py-1.5 text-sm"><span class="min-w-0 truncate text-slate-700"> <span class="ml-1 font-mono text-[11px] text-amber-700"> </span></span> <select class="shrink-0 rounded-md border border-slate-300 px-1.5 py-1 text-xs text-slate-700"><option>(none)</option><!></select></li>`),it=r(`<div class="rounded-lg border border-amber-200 bg-amber-50/50 p-3"><h3 class="text-sm font-semibold text-amber-900">Tagged with an undeclared core feature <span class="ml-1 rounded bg-amber-100 px-1.5 py-0.5 text-[11px] font-normal text-amber-800"> </span></h3> <p class="mt-0.5 text-[11px] text-amber-700">Reassign to a declared core feature, clear it, or declare the value above.</p> <ul class="mt-2 divide-y divide-amber-100"></ul></div>`),at=r(`<p class="mt-1 text-xs text-slate-500">Every feature belongs to a core feature.</p>`),ot=r(`<p class="mt-1 text-xs text-slate-500">Declare a core feature above to start assigning features.</p>`),st=r(`<div class="space-y-5"><div class="rounded-md border border-indigo-200 bg-indigo-50/50 p-3 text-xs text-indigo-900"><p class="font-semibold">Core features</p> <p class="mt-0.5 leading-relaxed">A curated set of product pillars for this project. A feature belongs to at most one by
1
+ import{$ as e,A as t,B as n,F as r,G as i,K as a,L as o,M as s,N as c,O as l,P as u,Q as d,R as f,S as p,U as m,V as h,X as g,Y as _,Z as v,_ as y,at as b,d as x,dt as S,et as C,g as w,gt as T,h as E,ht as D,it as O,j as k,k as A,l as j,m as M,n as N,nt as P,o as F,ot as I,q as L,r as R,s as z,st as B,tt as V,u as H,ut as U,vt as ee,w as W,x as te,y as ne,z as G}from"../chunks/CYsLq4VE.js";import{r as re}from"../chunks/Bz-oxBCj.js";import"../chunks/xihTtKlq.js";import"../chunks/BUrhMYfU.js";import{n as K,t as ie}from"../chunks/BE7NaZk8.js";import{Bt as q,E as J,Ft as ae,L as oe,Ot as se,Rt as Y,T as ce,U as X,V as le,a as ue,h as de,i as fe,l as pe,p as me,t as he,ut as ge,w as _e}from"../chunks/PGh5ehlS.js";import"../chunks/DkAKB9py.js";import{t as ve}from"../chunks/BcjkusYG.js";import{n as ye}from"../chunks/niJ1Cp3-.js";import{t as be}from"../chunks/CGWhvtMz.js";import{t as Z}from"../chunks/DsJUUSRq.js";import{c as xe,r as Se}from"../chunks/Cuj9IeTJ.js";import{t as Ce}from"../chunks/EZgceN_E.js";import{t as we}from"../chunks/Cbsgl_qu2.js";import{t as Te}from"../chunks/CT4vNU442.js";import{c as Ee,l as De,n as Oe,o as ke,t as Ae}from"../chunks/1qwcT7H12.js";import{t as je}from"../chunks/C0MTuC4u2.js";import{t as Me}from"../chunks/Txy2b5lN2.js";import{t as Ne}from"../chunks/CwFCbQnJ2.js";import{t as Pe}from"../chunks/B8kjx6k42.js";import{a as Fe,c as Ie,o as Le,r as Re,s as ze,t as Be}from"../chunks/ChGgFJaP2.js";import{t as Q}from"../chunks/BLqvzp0B.js";var Ve=r(`<button type="button" class="h-8 rounded-md px-2 text-xs font-medium text-slate-500 hover:bg-slate-50 hover:text-slate-900">Clear</button>`),He=r(`<div class="space-y-3"><p>No features in this project yet.</p> <div class="flex flex-wrap justify-center gap-2"><button type="button" class="rounded-md bg-slate-900 px-4 py-2 text-sm font-medium text-white">Create first feature</button></div></div>`),Ue=r(`<div class="rounded-lg border border-dashed border-hairline bg-white p-6 text-center text-sm text-slate-500"><!></div>`),We=r(`<li><!></li>`),Ge=r(`<ul class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3"></ul>`),Ke=r(`<div class="fixed inset-0 z-40 flex items-start justify-center bg-slate-950/30 px-4 py-24 backdrop-blur-sm" role="presentation"><div class="w-full max-w-2xl rounded-xl border border-hairline bg-white shadow-xl" role="dialog" aria-modal="true" aria-labelledby="add-feature-dialog-title"><header class="flex items-start justify-between gap-4 border-b border-hairline px-5 py-4"><div><h2 id="add-feature-dialog-title" class="text-base font-semibold text-slate-950">Add an feature</h2> <p class="mt-1 text-sm text-slate-500">Create a new behavior model. It will be tied to this project automatically.</p></div> <button type="button" class="rounded-md px-2 py-1 text-sm text-slate-500 hover:bg-slate-100 hover:text-slate-900" aria-label="Close">x</button></header> <form class="space-y-3 p-5" data-tour="new-feature-form"><label class="block text-xs font-medium text-slate-700">Feature name <input type="text" placeholder="e.g. Restaurant booking" class="mt-1 h-10 w-full rounded-md border border-slate-300 bg-white px-3 text-sm outline-none focus:border-slate-900" required=""/></label> <label class="block text-xs font-medium text-slate-700">Description <input type="text" data-tour="new-feature-description" placeholder="What is this feature about?" class="mt-1 h-10 w-full rounded-md border border-slate-300 bg-white px-3 text-sm outline-none focus:border-slate-900" required=""/></label> <div class="flex justify-end gap-2 pt-2"><button type="button" class="h-10 rounded-md border border-slate-300 bg-white px-4 text-sm font-medium text-slate-700 hover:bg-slate-50">Cancel</button> <button type="submit" class="h-10 rounded-md bg-slate-900 px-4 text-sm font-medium text-white disabled:opacity-50"> </button></div></form></div></div>`),qe=r(`<div class="space-y-4"><div class="rounded-xl border border-slate-200 bg-white p-3 shadow-sm shadow-slate-950/5"><div class="flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between"><div class="flex min-w-0 items-center rounded-lg border border-hairline bg-white p-1 lg:flex-1"><label for="project-feature-search" class="sr-only">Search project features</label> <input id="project-feature-search" type="search" placeholder="Search features..." class="h-9 w-full min-w-0 rounded-md border-0 bg-transparent px-3 text-sm outline-none placeholder:text-slate-400"/> <!></div> <div class="flex flex-col gap-2 sm:flex-row sm:items-center"><!> <label class="flex h-10 items-center gap-2 rounded-lg border border-hairline bg-white px-3 text-sm text-slate-600"><span class="text-xs font-medium">Sort</span> <select class="bg-transparent text-sm font-medium text-slate-800 outline-none"><option>Updated</option><option>Name</option><option>Maturity</option></select></label> <button type="button" data-tour="new-feature-button" class="inline-flex h-10 items-center justify-center gap-2 rounded-md bg-slate-900 px-4 text-sm font-medium text-white" title="Create a new feature inside this project"><span aria-hidden="true">+</span> New feature</button></div></div></div> <!></div> <!>`,1);function Je(t,r){S(r,!0);let i=P(`all`);function u(e,t){return t.length===0?!0:e.name.toLowerCase().includes(t)||(e.description??``).toLowerCase().includes(t)}function f(e,t){let n=e.tags??[];if(t===`all`)return!0;if(t===`untagged`)return n.length===0;let r=le(t);return n.some(e=>le(e)===r)}let p=O(()=>{let e=r.search.trim().toLowerCase();return r.features.filter(t=>u(t,e)&&f(t,h(i)))}),_=O(()=>{let e=[];for(let t of r.features)for(let n of t.tags??[])e.push(n);return e});L(()=>{Ce.registerTypes(h(_).map(e=>e.type))});function y(e){let t=r.search.trim().toLowerCase();return r.features.filter(n=>u(n,t)&&f(n,e)).length}let b=P(!1),w=P(null),D=P(`updated`),A=P(``),N=P(``),F=P(!1),I=O(()=>je(ye.currentStep,`new-feature`,h(A))),R=P(C(new Map));L(()=>{let e=r.features.map(e=>String(e.id)),t=!1;return(async()=>{let n=await he(),r=e.filter(e=>!h(R).has(e));if(r.length===0)return;let i=await Promise.all(r.map(async e=>[e,await n.statusRepository.get(e)]));if(t)return;let a=new Map(h(R));for(let[e,t]of i)a.set(e,t);V(R,a,!0)})(),()=>{t=!0}});async function B(e){try{let t=await(await he()).statusRepository.get(e),n=new Map(h(R));n.set(e,t),V(R,n,!0)}catch{}}L(()=>ve(e=>{e.kind!==`implementation-status`&&e.kind!==`feature`||r.features.some(t=>String(t.id)===e.id)&&B(e.id)})),L(()=>{h(b)&&m().then(()=>h(w)?.focus())});function ee(){V(b,!0)}function W(){V(b,!1),V(A,``),V(N,``)}async function te(){let e=h(A).trim();if(!(h(F)||e.length===0)&&h(N).trim().length!==0){V(F,!0);try{await r.onCreate(e,h(N).trim()),W()}finally{V(F,!1)}}}function ne(e){e.key===`Escape`&&W()}function re(e){let t=J(e),n=ce(e,h(R).get(String(e.id))??null);return{id:e.id,name:e.name,description:e.description,surfaceCount:e.surfaces.length,actionCount:e.surfaces.reduce((e,t)=>e+t.actions.length,0),createdAt:e.createdAt,updatedAt:e.updatedAt,tags:e.tags,maturityPercentage:t.percentage,criticalIssueCount:t.criticalIssues.length,recommendedIssueCount:t.recommendedIssues.length,implementationPercentage:n.expectedCount===0?null:n.percentage,implementationFoundCount:n.foundCount,implementationExpectedCount:n.expectedCount,implementationHasReport:n.hasReport}}let K=O(()=>h(p).map(re).sort((e,t)=>h(D)===`name`?e.name.localeCompare(t.name):h(D)===`maturity`?t.maturityPercentage-e.maturityPercentage:new Date(t.updatedAt).getTime()-new Date(e.updatedAt).getTime())),ie=O(()=>{let e=new Set;for(let t of r.features)for(let n of t.tags??[])e.add(oe(n.type));return[...e].sort((e,t)=>e.localeCompare(t))});function q(e){let t=Z.project?.implementationQueue??[],n=`feature:${String(e)}`;return t.some(e=>fe(e)===n)}async function ae(e){if(!Z.project)return;let t=await(await he()).useCases.enqueueQueueItem(Z.project.id,{kind:`feature`,featureId:e});Z.project&&=t.project}async function se(e){if(!Z.project)return;let t=Z.project.implementationQueue??[],n=`feature:${String(e)}`,r=t.find(e=>fe(e)===n);if(!r)return;let i=await(await he()).useCases.dequeueQueueItem(Z.project.id,r.id);Z.project&&=i}var Y=qe();n(`keydown`,g,ne);var X=d(Y),ue=v(X),de=v(ue),pe=v(de),me=e(v(pe),2);H(me);var ge=e(me,2),_e=e=>{var t=Ve();G(`click`,t,()=>r.onSearch(``)),c(e,t)},be=O(()=>r.search.trim().length>0);k(ge,e=>{h(be)&&e(_e)}),T(pe);var xe=e(pe,2),Se=v(xe);Me(Se,{get tags(){return h(_)},get value(){return h(i)},onChange:e=>V(i,e,!0),countLabel:y});var we=e(Se,2),Te=e(v(we),2),Ee=v(Te);Ee.value=Ee.__value=`updated`;var De=e(Ee);De.value=De.__value=`name`;var Oe=e(De);Oe.value=Oe.__value=`maturity`,T(Te),T(we);var ke=e(we,2);T(xe),T(de),T(ue);var Ae=e(ue,2),Pe=t=>{var n=Ue(),i=v(n),a=t=>{var n=He(),r=e(v(n),2),i=v(r);T(r),T(n),G(`click`,i,()=>ee()),c(t,n)},s=e=>{c(e,o(`No features match your search.`))};k(i,e=>{r.features.length===0?e(a):e(s,-1)}),T(n),c(t,n)},Fe=e=>{var t=Ge();l(t,21,()=>h(K),e=>e.id,(e,t)=>{var n=We(),i=v(n);{let e=O(()=>r.onRemoveTag?(e,n)=>r.onRemoveTag(h(t).id,{type:e,value:n}):void 0),n=O(()=>q(h(t).id));Ne(i,{get summary(){return h(t)},get tagTypeOptions(){return h(ie)},deleteLabel:`Remove`,onAddTag:(e,n)=>r.onAddTag(h(t).id,{type:e,value:n}),get onRemoveTag(){return h(e)},onDelete:()=>r.onRemove(h(t).id),get queued(){return h(n)},onAddToQueue:()=>ae(h(t).id),onRemoveFromQueue:()=>se(h(t).id)})}T(n),c(e,n)}),T(t),c(e,t)};k(Ae,e=>{h(K).length===0?e(Pe):e(Fe,-1)}),T(X);var Ie=e(X,2),Le=t=>{var r=Ke(),i=v(r),o=v(i),l=e(v(o),2);T(o);var u=e(o,2),d=v(u),f=e(v(d));H(f),z(f,e=>V(w,e),()=>h(w)),T(d);var p=e(d,2),m=e(v(p));H(m),T(p);var g=e(p,2),_=v(g),y=e(_,2),b=v(y,!0);T(y),T(g),T(u),T(i),T(r),a(e=>{y.disabled=e,x(y,`title`,h(I).blocked?`Tutorial: name must be exactly "${h(I).requiredValue}"`:void 0),s(b,h(F)?`Creating...`:`Create feature`)},[()=>h(F)||h(A).trim().length===0||h(N).trim().length===0||h(I).blocked]),G(`click`,r,e=>{e.currentTarget===e.target&&W()}),G(`click`,l,W),n(`submit`,u,e=>{e.preventDefault(),te()}),j(f,()=>h(A),e=>V(A,e)),j(m,()=>h(N),e=>V(N,e)),G(`click`,_,W),c(t,r)};k(Ie,e=>{h(b)&&e(Le)}),a(()=>M(me,r.search)),G(`input`,me,e=>r.onSearch(e.target.value)),E(Te,()=>h(D),e=>V(D,e)),G(`click`,ke,()=>ee()),c(t,Y),U()}f([`input`,`click`]);var Ye=r(`<li><span class="font-medium"> </span> </li>`),Xe=r(`<div class="rounded-lg border border-amber-200 bg-amber-50 p-3 text-xs text-amber-900"><p class="font-semibold"> <span class="font-normal text-amber-700">(these never block a save)</span></p> <ul class="mt-1 space-y-0.5"></ul></div>`),Ze=r(`<div class="rounded-lg border border-dashed border-slate-300 bg-slate-50/40 p-6 text-center text-sm text-slate-500">No core features declared yet. Declare one above, then assign features to it below.</div>`),Qe=r(`<option> </option>`),$e=r(`<li class="flex items-center justify-between gap-2 py-1.5 text-sm"><span class="min-w-0 truncate text-slate-700"> </span> <select class="shrink-0 rounded-md border border-slate-300 px-1.5 py-1 text-xs text-slate-700"><option>(none)</option><!></select></li>`),et=r(`<ul class="mt-2 divide-y divide-slate-100"></ul>`),tt=r(`<div class="rounded-lg border border-slate-200 bg-white p-3"><div class="flex items-start justify-between gap-3"><div class="min-w-0 flex-1"><h3 class="text-sm font-semibold text-slate-900"> </h3> <textarea rows="1" class="mt-1 w-full resize-none overflow-hidden rounded-md border border-slate-200 px-2 py-1 text-xs leading-relaxed text-slate-600 outline-none focus:border-slate-400"></textarea></div> <div class="flex shrink-0 items-center gap-2"><span class="rounded bg-slate-100 px-1.5 py-0.5 text-[11px] text-slate-600"> </span> <button type="button" class="text-xs text-slate-400 hover:text-red-600">Remove</button></div></div> <!></div>`),nt=r(`<div class="space-y-3"></div>`),rt=r(`<li class="flex items-center justify-between gap-2 py-1.5 text-sm"><span class="min-w-0 truncate text-slate-700"> <span class="ml-1 font-mono text-[11px] text-amber-700"> </span></span> <select class="shrink-0 rounded-md border border-slate-300 px-1.5 py-1 text-xs text-slate-700"><option>(none)</option><!></select></li>`),it=r(`<div class="rounded-lg border border-amber-200 bg-amber-50/50 p-3"><h3 class="text-sm font-semibold text-amber-900">Tagged with an undeclared core feature <span class="ml-1 rounded bg-amber-100 px-1.5 py-0.5 text-[11px] font-normal text-amber-800"> </span></h3> <p class="mt-0.5 text-[11px] text-amber-700">Reassign to a declared core feature, clear it, or declare the value above.</p> <ul class="mt-2 divide-y divide-amber-100"></ul></div>`),at=r(`<p class="mt-1 text-xs text-slate-500">Every feature belongs to a core feature.</p>`),ot=r(`<p class="mt-1 text-xs text-slate-500">Declare a core feature above to start assigning features.</p>`),st=r(`<div class="space-y-5"><div class="rounded-md border border-indigo-200 bg-indigo-50/50 p-3 text-xs text-indigo-900"><p class="font-semibold">Core features</p> <p class="mt-0.5 leading-relaxed">A curated set of product pillars for this project. A feature belongs to at most one by
2
2
  carrying a reserved <span class="font-mono">core:</span> tag, so you can filter and group by core
3
3
  feature precisely, instead of by a sea of descriptive tags. Only values declared here count: a
4
4
  feature tagged with an undeclared value shows as a warning below rather than becoming a new pillar.</p></div> <form class="flex flex-col gap-2 rounded-lg border border-slate-200 bg-white p-3 sm:flex-row sm:items-end"><label class="flex-1 text-xs font-medium text-slate-600">Core feature <input type="text" placeholder="e.g. authentication" class="mt-1 h-9 w-full rounded-md border border-slate-300 px-2 text-sm outline-none focus:border-slate-900"/></label> <label class="flex-2 text-xs font-medium text-slate-600">Description <input type="text" placeholder="What this pillar covers" class="mt-1 h-9 w-full rounded-md border border-slate-300 px-2 text-sm outline-none focus:border-slate-900"/></label> <button type="submit" class="h-9 shrink-0 rounded-md bg-slate-900 px-3 text-xs font-medium text-white disabled:opacity-50">Declare</button></form> <!> <!> <!> <div class="rounded-lg border border-slate-200 bg-white p-3"><h3 class="text-sm font-semibold text-slate-900">Not in a core feature <span class="ml-1 rounded bg-slate-100 px-1.5 py-0.5 text-[11px] font-normal text-slate-600"> </span></h3> <!></div></div>`);function ct(t,r){S(r,!0);let i=O(()=>pe(r.project,r.features)),o=O(()=>h(i).groups.map(e=>e.value)),u=O(()=>new Set(h(o))),d=O(()=>new Map(r.features.map(e=>[String(e.id),me(e.tags)??``]))),f=O(()=>r.features.map(e=>({id:e.id,name:e.name,value:me(e.tags)})).filter(e=>e.value!==void 0&&!h(u).has(e.value))),p=P(``),m=P(``);async function g(){let e=h(p).trim(),t=h(m).trim();e.length===0||t.length===0||(await r.onDeclare(e,t),V(p,``),V(m,``))}function _(e,t){r.onAssign(e,t.length>0?t:null)}function C(e,t){let n=()=>{e.style.height=`auto`,e.style.height=`${e.scrollHeight}px`},r=requestAnimationFrame(n);return e.addEventListener(`input`,n),{update:n,destroy:()=>{cancelAnimationFrame(r),e.removeEventListener(`input`,n)}}}var E=st(),N=e(v(E),2),F=v(N),I=e(v(F));H(I),T(F);var L=e(F,2),R=e(v(L));H(R),T(L);var z=e(L,2);T(N);var B=e(N,2),ee=t=>{var n=Xe(),r=v(n),o=v(r);D(),T(r);var u=e(r,2);l(u,21,()=>h(i).warnings,e=>e.featureId+e.kind,(t,n)=>{var r=Ye(),i=v(r),o=v(i);T(i);var l=e(i);T(r),a(()=>{s(o,`${h(n).featureName??``}:`),s(l,` ${h(n).detail??``}`)}),c(t,r)}),T(u),T(n),a(()=>s(o,`${h(i).warnings.length??``} core-feature warning${h(i).warnings.length===1?``:`s`} `)),c(t,n)};k(B,e=>{h(i).warnings.length>0&&e(ee)});var W=e(B,2),ne=e=>{c(e,Ze())},re=t=>{var u=nt();l(u,21,()=>h(i).groups,e=>e.value,(t,i)=>{var u=tt(),f=v(u),p=v(f),m=v(p),g=v(m,!0);T(m);var S=e(m,2);b(S),te(S,(e,t)=>C?.(e,t),()=>h(i).description),T(p);var E=e(p,2),D=v(E),O=v(D);T(D);var j=e(D,2);T(E),T(f);var N=e(f,2),P=t=>{var n=et();l(n,21,()=>h(i).features,e=>e.id,(t,n)=>{var r=$e(),i=v(r),u=v(i,!0);T(i);var f=e(i,2),p=v(f);p.value=p.__value=``,l(e(p),17,()=>h(o),A,(e,t)=>{var n=Qe(),r=v(n,!0);T(n);var i={};a(e=>{s(r,e),i!==(i=h(t))&&(n.value=(n.__value=h(t))??``)},[()=>oe(h(t))]),c(e,n)}),T(f);var m;w(f),T(r),a(e=>{s(u,h(n).name),m!==(m=e)&&(f.value=(f.__value=e)??``,y(f,e))},[()=>h(d).get(String(h(n).id))??``]),G(`change`,f,e=>_(h(n).id,e.target.value)),c(t,r)}),T(n),c(t,n)};k(N,e=>{h(i).features.length>0&&e(P)}),T(u),a(e=>{s(g,e),M(S,h(i).description),x(S,`aria-label`,`Description for ${h(i).value}`),s(O,`${h(i).features.length??``} feature${h(i).features.length===1?``:`s`}`)},[()=>oe(h(i).value)]),n(`blur`,S,e=>{let t=e.target.value.trim();t.length>0&&t!==h(i).description&&r.onUpdate(h(i).value,t)}),G(`click`,j,()=>r.onRemove(h(i).value)),c(t,u)}),T(u),c(t,u)};k(W,e=>{h(i).groups.length===0?e(ne):e(re,-1)});var K=e(W,2),ie=t=>{var n=it(),r=v(n),i=e(v(r)),u=v(i,!0);T(i),T(r);var d=e(r,4);l(d,21,()=>h(f),e=>e.id,(t,n)=>{var r=rt(),i=v(r),u=v(i),d=e(u),f=v(d);T(d),T(i);var p=e(i,2),m=v(p);m.value=m.__value=``,l(e(m),17,()=>h(o),A,(e,t)=>{var n=Qe(),r=v(n,!0);T(n);var i={};a(e=>{s(r,e),i!==(i=h(t))&&(n.value=(n.__value=h(t))??``)},[()=>oe(h(t))]),c(e,n)}),T(p),p.value=p.__value=``,T(r),a(()=>{s(u,`${h(n).name??``} `),s(f,`core:${h(n).value??``}`)}),G(`change`,p,e=>_(h(n).id,e.target.value)),c(t,r)}),T(d),T(n),a(()=>s(u,h(f).length)),c(t,n)};k(K,e=>{h(f).length>0&&e(ie)});var q=e(K,2),J=v(q),ae=e(v(J)),se=v(ae,!0);T(ae),T(J);var Y=e(J,2),ce=e=>{c(e,at())},X=e=>{c(e,ot())},le=t=>{var n=et();l(n,21,()=>h(i).uncategorized,e=>e.id,(t,n)=>{var r=$e(),i=v(r),u=v(i,!0);T(i);var d=e(i,2),f=v(d);f.value=f.__value=``,l(e(f),17,()=>h(o),A,(e,t)=>{var n=Qe(),r=v(n,!0);T(n);var i={};a(e=>{s(r,e),i!==(i=h(t))&&(n.value=(n.__value=h(t))??``)},[()=>oe(h(t))]),c(e,n)}),T(d),d.value=d.__value=``,T(r),a(()=>s(u,h(n).name)),G(`change`,d,e=>_(h(n).id,e.target.value)),c(t,r)}),T(n),c(t,n)};k(Y,e=>{h(i).uncategorized.length===0?e(ce):h(o).length===0?e(X,1):e(le,-1)}),T(q),T(E),a(e=>{z.disabled=e,s(se,h(i).uncategorized.length)},[()=>r.saving||h(p).trim().length===0||h(m).trim().length===0]),n(`submit`,N,e=>{e.preventDefault(),g()}),j(I,()=>h(p),e=>V(p,e)),j(R,()=>h(m),e=>V(m,e)),c(t,E),U()}f([`click`,`change`]);var lt=e=>`${e.kind}|${e.provider}|${e.name}`.toLowerCase(),ut=e=>{let t=new Map;for(let n of e)for(let e of n.resources){let r=lt(e),i={featureId:String(n.id),featureName:n.name},a=t.get(r);if(a){a.sources.some(e=>e.featureId===i.featureId)||a.sources.push(i);continue}t.set(r,{key:r,name:e.name,kind:e.kind,provider:e.provider,scope:e.scope,sensitivity:e.sensitivity,containsPii:e.containsPii,description:e.description,sources:[i]})}return Array.from(t.values()).sort((e,t)=>e.name.localeCompare(t.name,void 0,{sensitivity:`base`}))},dt=e=>{let t=new Map;for(let n of e)for(let e of Ie(n)){let r=e.namespace.toLowerCase(),i={featureId:String(n.id),featureName:n.name},a=t.get(r);if(a){a.sources.some(e=>e.featureId===i.featureId)||a.sources.push(i),e.fields.length>a.fieldCount&&(a.fieldCount=e.fields.length),!a.description&&e.description&&(a.description=e.description);continue}t.set(r,{key:r,namespace:e.namespace,description:e.description,fieldCount:e.fields.length,sources:[i]})}return Array.from(t.values()).sort((e,t)=>e.namespace.localeCompare(t.namespace,void 0,{sensitivity:`base`}))},ft=e=>{let t=new Map;for(let n of e){let e=new Map((n.events??[]).map(e=>[String(e.name),e]));for(let r of Re(n)){let i=String(r.name),a=i.toLowerCase(),o=e.get(i),s={featureId:String(n.id),featureName:n.name},c=t.get(a);if(c){if(c.sources.some(e=>e.featureId===s.featureId)||c.sources.push(s),c.emissions+=r.emissions.length,o){!c.description&&o.description&&(c.description=o.description);let e=o.payloadSchema?.length??0;e>c.payloadFieldCount&&(c.payloadFieldCount=e)}continue}t.set(a,{key:a,name:i,description:o?.description,payloadFieldCount:o?.payloadSchema?.length??0,emissions:r.emissions.length,sources:[s]})}}return Array.from(t.values())},pt=e=>{let t=new Map;for(let n of e)for(let e of Be(n)){let r=e.sources[0]?.description,i=`${e.fromSurfaceName}|${e.toSurfaceName}|${r??``}`.toLowerCase(),a={featureId:String(n.id),featureName:n.name},o=t.get(i);if(o){o.sources.some(e=>e.featureId===a.featureId)||o.sources.push(a),o.sourcesCount+=e.sources.length;continue}t.set(i,{key:i,sourceName:e.fromSurfaceName,targetName:e.toSurfaceName,label:r,sourcesCount:e.sources.length,sources:[a]})}return Array.from(t.values())},mt=r(`<p class="rounded-lg border border-dashed border-hairline bg-white p-6 text-center text-sm text-slate-500"> </p>`),ht=r(`<div class="text-xs font-normal text-slate-500"> </div>`),gt=r(`<a class="rounded-full border border-cyan-100 bg-cyan-50/60 px-2 py-0.5 text-brand-700 hover:bg-cyan-50 hover:underline"> </a>`),_t=r(`<tr class="border-t border-slate-100"><td class="px-3 py-2 font-medium text-slate-950"> <!></td><td class="px-3 py-2 text-slate-600"> </td><td class="px-3 py-2 text-slate-600"> </td><td class="px-3 py-2 text-slate-600"> </td><td class="px-3 py-2 text-slate-600"> </td><td class="px-3 py-2 text-slate-600"> </td><td class="px-3 py-2 text-xs"><div class="flex flex-wrap gap-1"></div></td></tr>`),vt=r(`<div class="overflow-x-auto rounded-lg border border-hairline bg-white"><table class="w-full text-sm"><thead class="bg-slate-50 text-left text-xs uppercase tracking-wide text-slate-500"><tr><th class="px-3 py-2">Name</th><th class="px-3 py-2">Kind</th><th class="px-3 py-2">Provider</th><th class="px-3 py-2">Scope</th><th class="px-3 py-2">Sensitivity</th><th class="px-3 py-2">PII</th><th class="px-3 py-2">From features</th></tr></thead><tbody></tbody></table></div>`);function yt(t,n){S(n,!0);let r=O(()=>ut(n.features)),i=O(()=>n.search.trim().length===0?h(r):h(r).filter(e=>{let t=n.search.toLowerCase();return e.name.toLowerCase().includes(t)||e.provider.toLowerCase().includes(t)||e.kind.toLowerCase().includes(t)||e.sources.some(e=>e.featureName.toLowerCase().includes(t))}));var o=u(),f=d(o),p=e=>{var t=mt(),n=v(t,!0);T(t),a(()=>s(n,h(r).length===0?`No resources declared across the project features.`:`No resources match your search.`)),c(e,t)},m=t=>{var n=vt(),r=v(n),o=e(v(r));l(o,21,()=>h(i),e=>e.key,(t,n)=>{var r=_t(),i=v(r),o=v(i),u=e(o),d=e=>{var t=ht(),r=v(t,!0);T(t),a(()=>s(r,h(n).description)),c(e,t)};k(u,e=>{h(n).description&&e(d)}),T(i);var f=e(i),p=v(f,!0);T(f);var m=e(f),g=v(m,!0);T(m);var _=e(m),y=v(_,!0);T(_);var b=e(_),S=v(b,!0);T(b);var C=e(b),w=v(C,!0);T(C);var E=e(C),D=v(E);l(D,21,()=>h(n).sources,e=>e.featureId,(e,t)=>{var n=gt(),r=v(n,!0);T(n),a(()=>{x(n,`href`,`/features/${h(t).featureId}`),s(r,h(t).featureName)}),c(e,n)}),T(D),T(E),T(r),a(()=>{s(o,`${h(n).name??``} `),s(p,h(n).kind),s(g,h(n).provider),s(y,h(n).scope),s(S,h(n).sensitivity),s(w,h(n).containsPii?`Yes`:`No`)}),c(t,r)}),T(o),T(r),T(n),c(t,n)};k(f,e=>{h(i).length===0?e(p):e(m,-1)}),c(t,o),U()}var bt=r(`<p class="rounded-lg border border-dashed border-hairline bg-white p-6 text-center text-sm text-slate-500"> </p>`),xt=r(`<div class="text-xs font-normal text-slate-500"> </div>`),St=r(`<a class="rounded-full border border-cyan-100 bg-cyan-50/60 px-2 py-0.5 text-brand-700 hover:bg-cyan-50 hover:underline"> </a>`),Ct=r(`<tr class="border-t border-slate-100"><td class="px-3 py-2 font-medium text-slate-950"> <!></td><td class="px-3 py-2 text-slate-600"> </td><td class="px-3 py-2 text-xs"><div class="flex flex-wrap gap-1"></div></td></tr>`),wt=r(`<div class="overflow-x-auto rounded-lg border border-hairline bg-white"><table class="w-full text-sm"><thead class="bg-slate-50 text-left text-xs uppercase tracking-wide text-slate-500"><tr><th class="px-3 py-2">Namespace</th><th class="px-3 py-2">Fields</th><th class="px-3 py-2">From features</th></tr></thead><tbody></tbody></table></div>`);function Tt(t,n){S(n,!0);let r=O(()=>dt(n.features)),i=O(()=>n.search.trim().length===0?h(r):h(r).filter(e=>{let t=n.search.toLowerCase();return e.namespace.toLowerCase().includes(t)||(e.description??``).toLowerCase().includes(t)||e.sources.some(e=>e.featureName.toLowerCase().includes(t))}));var o=u(),f=d(o),p=e=>{var t=bt(),n=v(t,!0);T(t),a(()=>s(n,h(r).length===0?`No data entities declared across the project features.`:`No data entities match your search.`)),c(e,t)},m=t=>{var n=wt(),r=v(n),o=e(v(r));l(o,21,()=>h(i),e=>e.key,(t,n)=>{var r=Ct(),i=v(r),o=v(i),u=e(o),d=e=>{var t=xt(),r=v(t,!0);T(t),a(()=>s(r,h(n).description)),c(e,t)};k(u,e=>{h(n).description&&e(d)}),T(i);var f=e(i),p=v(f,!0);T(f);var m=e(f),g=v(m);l(g,21,()=>h(n).sources,e=>e.featureId,(e,t)=>{var n=St(),r=v(n,!0);T(n),a(()=>{x(n,`href`,`/features/${h(t).featureId}`),s(r,h(t).featureName)}),c(e,n)}),T(g),T(m),T(r),a(()=>{s(o,`${h(n).namespace??``} `),s(p,h(n).fieldCount)}),c(t,r)}),T(o),T(r),T(n),c(t,n)};k(f,e=>{h(i).length===0?e(p):e(m,-1)}),c(t,o),U()}var Et=r(`<p class="rounded-lg border border-dashed border-hairline bg-white p-6 text-center text-sm text-slate-500"> </p>`),Dt=r(`<div class="font-sans text-xs text-slate-500"> </div>`),Ot=r(`<a class="rounded-full border border-cyan-100 bg-cyan-50/60 px-2 py-0.5 text-brand-700 hover:bg-cyan-50 hover:underline"> </a>`),kt=r(`<tr class="border-t border-slate-100"><td class="px-3 py-2 font-mono text-slate-950"> <!></td><td class="px-3 py-2 text-slate-600"> </td><td class="px-3 py-2 text-slate-600"> </td><td class="px-3 py-2 text-xs"><div class="flex flex-wrap gap-1"></div></td></tr>`),At=r(`<div class="overflow-x-auto rounded-lg border border-hairline bg-white"><table class="w-full text-sm"><thead class="bg-slate-50 text-left text-xs uppercase tracking-wide text-slate-500"><tr><th class="px-3 py-2">Event name</th><th class="px-3 py-2">Emissions</th><th class="px-3 py-2">Payload fields</th><th class="px-3 py-2">From features</th></tr></thead><tbody></tbody></table></div>`);function jt(t,n){S(n,!0);let r=O(()=>ft(n.features)),i=O(()=>n.search.trim().length===0?h(r):h(r).filter(e=>{let t=n.search.toLowerCase();return e.name.toLowerCase().includes(t)||(e.description??``).toLowerCase().includes(t)||e.sources.some(e=>e.featureName.toLowerCase().includes(t))}));var o=u(),f=d(o),p=e=>{var t=Et(),n=v(t,!0);T(t),a(()=>s(n,h(r).length===0?`No events registered across the project features.`:`No events match your search.`)),c(e,t)},m=t=>{var n=At(),r=v(n),o=e(v(r));l(o,21,()=>h(i),e=>e.key,(t,n)=>{var r=kt(),i=v(r),o=v(i),u=e(o),d=e=>{var t=Dt(),r=v(t,!0);T(t),a(()=>s(r,h(n).description)),c(e,t)};k(u,e=>{h(n).description&&e(d)}),T(i);var f=e(i),p=v(f,!0);T(f);var m=e(f),g=v(m,!0);T(m);var _=e(m),y=v(_);l(y,21,()=>h(n).sources,e=>e.featureId,(e,t)=>{var n=Ot(),r=v(n,!0);T(n),a(()=>{x(n,`href`,`/features/${h(t).featureId}`),s(r,h(t).featureName)}),c(e,n)}),T(y),T(_),T(r),a(()=>{s(o,`${h(n).name??``} `),s(p,h(n).emissions),s(g,h(n).payloadFieldCount)}),c(t,r)}),T(o),T(r),T(n),c(t,n)};k(f,e=>{h(i).length===0?e(p):e(m,-1)}),c(t,o),U()}var Mt=r(`<p class="rounded-lg border border-dashed border-hairline bg-white p-6 text-center text-sm text-slate-500"> </p>`),Nt=r(`<a class="rounded-full border border-cyan-100 bg-cyan-50/60 px-2 py-0.5 text-brand-700 hover:bg-cyan-50 hover:underline"> </a>`),Pt=r(`<tr class="border-t border-slate-100 align-top"><td class="px-3 py-2 text-slate-700"> </td><td class="px-3 py-2 text-slate-600"> </td><td class="px-3 py-2 text-xs"><div class="flex flex-wrap gap-1"></div></td></tr>`),Ft=r(`<div class="overflow-hidden rounded-lg border border-hairline bg-white"><div class="flex flex-wrap items-center gap-2 border-b border-slate-100 bg-slate-50 px-3 py-2"><span class="font-medium text-slate-950"> </span> <span class="rounded-full bg-brand-50 px-2 py-0.5 text-xs font-medium text-brand-700" title="Transitions leaving this surface"> </span></div> <div class="overflow-x-auto"><table class="w-full text-sm"><thead class="text-left text-xs uppercase tracking-wide text-slate-400"><tr><th class="px-3 py-1.5 font-medium">To</th><th class="px-3 py-1.5 font-medium">Label</th><th class="px-3 py-1.5 font-medium">From features</th></tr></thead><tbody></tbody></table></div></div>`),It=r(`<p class="mb-2 text-xs text-slate-500"> </p> <div class="space-y-3"></div>`,1);function Lt(t,n){S(n,!0);let r=O(()=>pt(n.features)),i=O(()=>n.search.trim().length===0?h(r):h(r).filter(e=>{let t=n.search.toLowerCase();return e.sourceName.toLowerCase().includes(t)||e.targetName.toLowerCase().includes(t)||(e.label??``).toLowerCase().includes(t)||e.sources.some(e=>e.featureName.toLowerCase().includes(t))})),o=O(()=>{let e=new Map;for(let t of h(i)){let n=t.sourceName.toLowerCase(),r=e.get(n);r||(r={key:n,sourceName:t.sourceName,transitions:[]},e.set(n,r)),r.transitions.push({key:t.key,targetName:t.targetName,label:t.label,sources:t.sources})}for(let t of e.values())t.transitions.sort((e,t)=>e.targetName.localeCompare(t.targetName,void 0,{sensitivity:`base`})||(e.label??``).localeCompare(t.label??``,void 0,{sensitivity:`base`}));return[...e.values()].sort((e,t)=>e.sourceName.localeCompare(t.sourceName,void 0,{sensitivity:`base`}))});var f=u(),p=d(f),m=e=>{var t=Mt(),n=v(t,!0);T(t),a(()=>s(n,h(r).length===0?`No transitions declared across the project features.`:`No transitions match your search.`)),c(e,t)},g=t=>{var n=It(),r=d(n),u=v(r);T(r);var f=e(r,2);l(f,21,()=>h(o),e=>e.key,(t,n)=>{var r=Ft(),i=v(r),o=v(i),u=v(o,!0);T(o);var d=e(o,2),f=v(d);T(d),T(i);var p=e(i,2),m=v(p),g=e(v(m));l(g,21,()=>h(n).transitions,e=>e.key,(t,n)=>{var r=Pt(),i=v(r),o=v(i,!0);T(i);var u=e(i),d=v(u,!0);T(u);var f=e(u),p=v(f);l(p,21,()=>h(n).sources,e=>e.featureId,(e,t)=>{var n=Nt(),r=v(n,!0);T(n),a(()=>{x(n,`href`,`/features/${h(t).featureId}`),s(r,h(t).featureName)}),c(e,n)}),T(p),T(f),T(r),a(()=>{s(o,h(n).targetName),s(d,h(n).label??`-`)}),c(t,r)}),T(g),T(m),T(p),T(r),a(()=>{s(u,h(n).sourceName),s(f,`${h(n).transitions.length??``}
@@ -1 +1 @@
1
- import{$ as e,F as t,G as n,K as r,M as i,N as a,P as o,Q as s,S as c,Y as l,Z as u,d,dt as f,gt as p,j as m,n as h,ot as g,q as _,st as v,ut as y}from"../chunks/CYsLq4VE.js";import"../chunks/xihTtKlq.js";import{h as b}from"../chunks/PGh5ehlS.js";import{t as x}from"../chunks/DsJUUSRq.js";import{t as S}from"../chunks/Cbsgl_qu2.js";import{t as C}from"../chunks/CGRZ0hx_2.js";import{t as w}from"../chunks/CzDWVOFj2.js";import{t as T}from"../chunks/BLqvzp0B.js";var E=t(`<p class="mx-auto max-w-7xl px-4 py-10 text-sm text-neutral-500">Loading project...</p>`),D=t(`<p class="mx-auto max-w-7xl px-4 py-10 text-sm text-red-600"> </p>`),O=t(`<p class="mx-auto max-w-7xl px-4 py-10 text-sm text-neutral-500">Project not found. <a href="/projects" class="text-brand-700 hover:underline">Back to projects</a>.</p>`),k=t(`<p class="text-sm text-slate-500">Loading features...</p>`),A=t(`<main class="mx-auto max-w-7xl px-4 py-8 sm:px-6"><div class="mb-6"><a class="inline-flex items-center gap-1 text-xs font-semibold uppercase tracking-wide text-brand-700 hover:underline"><span aria-hidden="true">&larr;</span> </a></div> <!></main>`);function j(t,j){f(j,!0);let M=()=>v(C,`$page`,N),[N,P]=g(),F=``;_(()=>{let e=M().params.id??``;if(!e||e===F)return;F=e;let t=b(e);(async()=>{await x.load(t),x.project&&await T.load(x.project.featureIds)})()}),h(()=>{x.reset(),T.reset()});var I=o();c(`1qi1bze`,e=>{n(e=>{l.title=e??``},[()=>S(M().url,x.project?.name,`Summary`)])});var L=s(I),R=e=>{a(e,E())},z=e=>{var t=D(),n=u(t,!0);p(t),r(()=>i(n,x.error)),a(e,t)},B=e=>{a(e,O())},V=t=>{var n=A(),o=u(n),s=u(o),c=e(u(s));p(s),p(o);var l=e(o,2),f=e=>{a(e,k())},h=e=>{w(e,{get features(){return T.features},get project(){return x.project}})};m(l,e=>{T.loading?e(f):e(h,-1)}),p(n),r(()=>{d(s,`href`,`/projects/${x.project.id}`),i(c,` Back to ${x.project.name??``}`)}),a(t,n)};m(L,e=>{x.loading?e(R):x.error?e(z,1):x.project?e(V,-1):e(B,2)}),a(t,I),y(),P()}export{j as component};
1
+ import{$ as e,F as t,G as n,K as r,M as i,N as a,P as o,Q as s,S as c,Y as l,Z as u,d,dt as f,gt as p,j as m,n as h,ot as g,q as _,st as v,ut as y}from"../chunks/CYsLq4VE.js";import"../chunks/xihTtKlq.js";import{h as b}from"../chunks/PGh5ehlS.js";import{t as x}from"../chunks/DsJUUSRq.js";import{t as S}from"../chunks/Cbsgl_qu2.js";import{t as C}from"../chunks/B8kjx6k42.js";import{t as w}from"../chunks/CzDWVOFj2.js";import{t as T}from"../chunks/BLqvzp0B.js";var E=t(`<p class="mx-auto max-w-7xl px-4 py-10 text-sm text-neutral-500">Loading project...</p>`),D=t(`<p class="mx-auto max-w-7xl px-4 py-10 text-sm text-red-600"> </p>`),O=t(`<p class="mx-auto max-w-7xl px-4 py-10 text-sm text-neutral-500">Project not found. <a href="/projects" class="text-brand-700 hover:underline">Back to projects</a>.</p>`),k=t(`<p class="text-sm text-slate-500">Loading features...</p>`),A=t(`<main class="mx-auto max-w-7xl px-4 py-8 sm:px-6"><div class="mb-6"><a class="inline-flex items-center gap-1 text-xs font-semibold uppercase tracking-wide text-brand-700 hover:underline"><span aria-hidden="true">&larr;</span> </a></div> <!></main>`);function j(t,j){f(j,!0);let M=()=>v(C,`$page`,N),[N,P]=g(),F=``;_(()=>{let e=M().params.id??``;if(!e||e===F)return;F=e;let t=b(e);(async()=>{await x.load(t),x.project&&await T.load(x.project.featureIds)})()}),h(()=>{x.reset(),T.reset()});var I=o();c(`1qi1bze`,e=>{n(e=>{l.title=e??``},[()=>S(M().url,x.project?.name,`Summary`)])});var L=s(I),R=e=>{a(e,E())},z=e=>{var t=D(),n=u(t,!0);p(t),r(()=>i(n,x.error)),a(e,t)},B=e=>{a(e,O())},V=t=>{var n=A(),o=u(n),s=u(o),c=e(u(s));p(s),p(o);var l=e(o,2),f=e=>{a(e,k())},h=e=>{w(e,{get features(){return T.features},get project(){return x.project}})};m(l,e=>{T.loading?e(f):e(h,-1)}),p(n),r(()=>{d(s,`href`,`/projects/${x.project.id}`),i(c,` Back to ${x.project.name??``}`)}),a(t,n)};m(L,e=>{x.loading?e(R):x.error?e(z,1):x.project?e(V,-1):e(B,2)}),a(t,I),y(),P()}export{j as component};
@@ -1 +1 @@
1
- import{$ as e,F as t,G as n,K as r,M as i,N as a,P as o,Q as s,S as c,V as l,Y as u,Z as d,dt as f,gt as p,j as m,n as h,nt as g,ot as _,r as v,st as y,tt as b,ut as x,x as S}from"../chunks/CYsLq4VE.js";import"../chunks/xihTtKlq.js";import{h as C,ut as w}from"../chunks/PGh5ehlS.js";import{t as T}from"../chunks/BcjkusYG.js";import{t as E}from"../chunks/DsJUUSRq.js";import{t as D}from"../chunks/Cbsgl_qu2.js";import{t as O}from"../chunks/CGRZ0hx_2.js";import{n as k,t as A}from"../chunks/veFR6afQ.js";import{t as j}from"../chunks/BLqvzp0B.js";var M=t(`<p class="mx-auto max-w-7xl px-4 py-10 text-sm text-neutral-500">Loading project...</p>`),N=t(`<p class="mx-auto max-w-7xl px-4 py-10 text-sm text-red-600"> </p>`),P=t(`<p class="mx-auto max-w-7xl px-4 py-10 text-sm text-neutral-500">Project not found. <a href="/projects" class="text-brand-700 hover:underline">Back to projects</a></p>`),F=t(`<p class="mx-auto max-w-7xl px-4 py-10 text-sm text-neutral-500">Loading project features...</p>`),I=t(`<div class="mx-auto max-w-7xl px-4 py-10"><p class="text-sm font-medium text-slate-900">No feature snapshots loaded for this project.</p> <p class="mt-2 text-sm text-slate-600"> </p></div>`),L=t(`<main class="w-full px-4 py-6 lg:flex lg:flex-col lg:overflow-hidden"><!></main>`);function R(t,R){f(R,!0);let z=()=>y(O,`$page`,B),[B,V]=_(),H=null,U=g(!1);v(async()=>{let e=z().params.id;if(!e)return;b(U,!1);let t=C(e);await E.load(t),await j.loadAllSummaries(),E.project&&await j.load(E.project.featureIds),b(U,!0),H=T(async e=>{E.project&&(e.kind===`project`&&e.id===String(t)?(b(U,!1),await j.syncWith(E.project.featureIds),b(U,!0)):e.kind===`feature`&&(E.project.featureIds.some(t=>String(t)===e.id)?await j.refetchOne(w(e.id)):await j.loadAllSummaries()))})}),h(()=>{H?.(),H=null,b(U,!1),E.reset(),j.reset()});var W=o();c(`106h624`,e=>{n(e=>{u.title=e??``},[()=>D(z().url,E.project?.name,`Graph`)])});var G=s(W),K=e=>{a(e,M())},q=e=>{var t=N(),n=d(t,!0);p(t),r(()=>i(n,E.error)),a(e,t)},J=e=>{a(e,P())},Y=e=>{a(e,F())},X=e=>{var t=N(),n=d(t,!0);p(t),r(()=>i(n,j.error)),a(e,t)},Z=t=>{var n=I(),o=e(d(n),2),s=d(o);p(o),p(n),r(()=>i(s,`The project lists ${E.project.featureIds.length??``} feature${E.project.featureIds.length===1?``:`s`}, but the graph could not load their behavior models from the shared hub.`)),a(t,n)},Q=e=>{var t=L();k(d(t),{get project(){return E.project},get features(){return j.features}}),p(t),S(t,e=>A?.(e)),a(e,t)};m(G,e=>{E.loading?e(K):E.error?e(q,1):E.project?j.loading||!l(U)?e(Y,3):j.error?e(X,4):E.project.featureIds.length>0&&j.features.length===0?e(Z,5):e(Q,-1):e(J,2)}),a(t,W),x(),V()}export{R as component};
1
+ import{$ as e,F as t,G as n,K as r,M as i,N as a,P as o,Q as s,S as c,V as l,Y as u,Z as d,dt as f,gt as p,j as m,n as h,nt as g,ot as _,r as v,st as y,tt as b,ut as x,x as S}from"../chunks/CYsLq4VE.js";import"../chunks/xihTtKlq.js";import{h as C,ut as w}from"../chunks/PGh5ehlS.js";import{t as T}from"../chunks/BcjkusYG.js";import{t as E}from"../chunks/DsJUUSRq.js";import{t as D}from"../chunks/Cbsgl_qu2.js";import{t as O}from"../chunks/B8kjx6k42.js";import{n as k,t as A}from"../chunks/DQM4fDta.js";import{t as j}from"../chunks/BLqvzp0B.js";var M=t(`<p class="mx-auto max-w-7xl px-4 py-10 text-sm text-neutral-500">Loading project...</p>`),N=t(`<p class="mx-auto max-w-7xl px-4 py-10 text-sm text-red-600"> </p>`),P=t(`<p class="mx-auto max-w-7xl px-4 py-10 text-sm text-neutral-500">Project not found. <a href="/projects" class="text-brand-700 hover:underline">Back to projects</a></p>`),F=t(`<p class="mx-auto max-w-7xl px-4 py-10 text-sm text-neutral-500">Loading project features...</p>`),I=t(`<div class="mx-auto max-w-7xl px-4 py-10"><p class="text-sm font-medium text-slate-900">No feature snapshots loaded for this project.</p> <p class="mt-2 text-sm text-slate-600"> </p></div>`),L=t(`<main class="w-full px-4 py-6 lg:flex lg:flex-col lg:overflow-hidden"><!></main>`);function R(t,R){f(R,!0);let z=()=>y(O,`$page`,B),[B,V]=_(),H=null,U=g(!1);v(async()=>{let e=z().params.id;if(!e)return;b(U,!1);let t=C(e);await E.load(t),await j.loadAllSummaries(),E.project&&await j.load(E.project.featureIds),b(U,!0),H=T(async e=>{E.project&&(e.kind===`project`&&e.id===String(t)?(b(U,!1),await j.syncWith(E.project.featureIds),b(U,!0)):e.kind===`feature`&&(E.project.featureIds.some(t=>String(t)===e.id)?await j.refetchOne(w(e.id)):await j.loadAllSummaries()))})}),h(()=>{H?.(),H=null,b(U,!1),E.reset(),j.reset()});var W=o();c(`106h624`,e=>{n(e=>{u.title=e??``},[()=>D(z().url,E.project?.name,`Graph`)])});var G=s(W),K=e=>{a(e,M())},q=e=>{var t=N(),n=d(t,!0);p(t),r(()=>i(n,E.error)),a(e,t)},J=e=>{a(e,P())},Y=e=>{a(e,F())},X=e=>{var t=N(),n=d(t,!0);p(t),r(()=>i(n,j.error)),a(e,t)},Z=t=>{var n=I(),o=e(d(n),2),s=d(o);p(o),p(n),r(()=>i(s,`The project lists ${E.project.featureIds.length??``} feature${E.project.featureIds.length===1?``:`s`}, but the graph could not load their behavior models from the shared hub.`)),a(t,n)},Q=e=>{var t=L();k(d(t),{get project(){return E.project},get features(){return j.features}}),p(t),S(t,e=>A?.(e)),a(e,t)};m(G,e=>{E.loading?e(K):E.error?e(q,1):E.project?j.loading||!l(U)?e(Y,3):j.error?e(X,4):E.project.featureIds.length>0&&j.features.length===0?e(Z,5):e(Q,-1):e(J,2)}),a(t,W),x(),V()}export{R as component};
@@ -1,4 +1,4 @@
1
- import{$ as e,B as t,F as n,G as r,K as i,L as a,M as o,N as s,O as c,Q as l,S as u,V as d,Y as f,Z as p,d as m,dt as h,et as g,gt as _,h as v,ht as y,it as b,j as x,k as S,nt as C,q as w,r as T,tt as E,ut as D}from"../chunks/CYsLq4VE.js";import"../chunks/xihTtKlq.js";import{t as O}from"../chunks/CgSXJuIO.js";import{At as k,C as A,Ct as j,Dt as M,Et as N,G as P,S as F,St as I,Tt as L,_ as R,h as ee,it as te,k as z,t as B,ut as ne,v as V,wt as H,x as U,y as W,yt as re}from"../chunks/PGh5ehlS.js";import{n as ie,r as ae,t as G}from"../chunks/CGWhvtMz.js";import{t as oe}from"../chunks/Cbsgl_qu2.js";import{a as se,i as ce,o as K,r as le,s as q,t as J}from"../chunks/BnqPzDNe2.js";var ue=e=>e,de=e=>({id:e.id,name:e.name,description:e.description,devContext:e.devContext,surfaces:e.surfaces.map(e=>({id:e.id,name:e.name,type:e.type,stateCount:e.stateDefinitions.length,ruleCount:e.rules.length,invariantCount:e.invariants.length,transitionCount:e.transitions.length,actions:e.actions.map(e=>({id:e.id,name:e.name})),stateDefinitions:e.stateDefinitions.map(e=>({id:e.id,path:String(e.path)}))})),personas:e.personas.map(e=>({id:e.id,name:e.name})),resources:e.resources.map(e=>({id:e.id,name:e.name})),entities:e.entities.map(e=>({id:e.id,name:A(e.namespace)})),createdAt:e.createdAt,updatedAt:e.updatedAt}),fe=(e,t)=>{let n=t?e.surfaces.filter(e=>e.id===t):e.surfaces,r=[];for(let e of n)for(let t of e.actions)r.push({actionId:t.id,actionName:t.name,intent:t.intent,surfaceId:e.id,surfaceName:e.name,parameterCount:t.parameters.length,ruleCount:t.rules.length,...t.evolution?{evolution:t.evolution}:{}});return r},Y={conventions:[`DDD (domain-driven design)`,`hexagonal architecture (ports & adapters)`,`dependency inversion at every boundary`,`clean code: small functions, intention-revealing names, no premature abstraction`],notes:`Even for prototypes: keep the domain pure, push IO to adapters, and let the use-case layer orchestrate. The product will evolve. Modular shapes pay off later.`},pe=e=>e?e.mode===`custom`?e:{mode:`auto`,stack:e.stack,conventions:e.conventions??Y.conventions,notes:e.notes??Y.notes}:null,X=e=>{let t=new Set;for(let n of e.requiredStates)t.add(n);for(let n of e.parameters)n.bindToStatePath&&t.add(n.bindToStatePath);for(let n of e.rules){for(let e of j(n.condition))typeof e.left==`string`&&t.add(e.left);n.effect.type===`set_state`&&t.add(n.effect.path)}for(let n of e.effects)n.type===`set_state`&&t.add(n.path);for(let n of e.invariants)for(let e of j(n.condition))typeof e.left==`string`&&t.add(e.left);return t},me=(e,t)=>{for(let n of e.surfaces){let r=n.actions.find(e=>e.id===t);if(!r)continue;let i=X(r),a=n.stateDefinitions.filter(e=>i.has(e.path)),o=n.invariants.filter(e=>j(e.condition).some(e=>typeof e.left==`string`&&i.has(e.left))),s=pe(e.devContext);return{featureId:e.id,featureName:e.name,surfaceId:n.id,surfaceName:n.name,action:r,linkedStateDefinitions:a,enclosingInvariants:o,...s?{devContext:s}:{}}}return null},he=(e,t)=>{let n=J(e,t);return{...n,total:le(n)}},ge=V(),_e=e=>ge(e),Z=(e,t=new Set)=>{let n=e=>{if(Array.isArray(e))return e.map(n);if(e&&typeof e==`object`){let r=e,i={};for(let e of Object.keys(r).sort())t.has(e)||(i[e]=n(r[e]));return i}return e};return JSON.stringify(n(e))},ve=new Set([`id`,`description`]),ye=(e,t)=>Z(e)===Z(t),be=(e,t)=>Z(e,ve)===Z(t,ve),xe=(e,t)=>{if(e.type===`set_state`&&t.type===`set_state`&&String(e.path)===String(t.path))return Z(e.value)!==Z(t.value);let n=new Set([e.type,t.type]);return n.has(`allow_action`)&&n.has(`block_action`)},Se=e=>e?H(e)?e.kind===`all`?e.conditions.flatMap(Se):[]:N(e)?[]:[e]:[],Q=e=>e.right!==void 0&&!I(e.right),Ce=e=>{let t=new Map;for(let n of Se(e)){if(L(n.left))continue;let e=String(n.left),r=t.get(e)??{mustEqual:new Set,mustNotEqual:new Set,exists:!1,absent:!1};switch(n.operator){case`is_true`:r.mustEqual.add(`true`),r.exists=!0;break;case`is_false`:r.mustEqual.add(`false`),r.exists=!0;break;case`exists`:r.exists=!0;break;case`does_not_exist`:r.absent=!0;break;case`equals`:Q(n)&&r.mustEqual.add(Z(n.right)),r.exists=!0;break;case`not_equals`:Q(n)&&r.mustNotEqual.add(Z(n.right));break;default:break}t.set(e,r)}for(let e of t.values()){if(e.mustEqual.size>1)return!0;for(let t of e.mustEqual)if(e.mustNotEqual.has(t))return!0;if(e.exists&&e.absent||e.absent&&e.mustEqual.size>0)return!0}return!1},we=(e,t)=>e.description?.trim()?`"${e.description.trim()}"`:`#${t} (${e.category})`,Te=e=>{let t=e.rules,n=[],r=new Set;t.forEach((e,t)=>{Ce(e.condition)&&(r.add(t),n.push({kind:`dead-rule`,severity:`critical`,rulePositions:[t+1],detail:`Rule ${we(e,t+1)} can never fire: its condition requires a state to hold two incompatible values at once.`}))});let i=t.findIndex(e=>e.condition===void 0&&e.effect.type===`block_action`);if(i>=0){let e=t[i];n.push({kind:`always-blocked`,severity:`recommended`,rulePositions:[i+1],detail:`Rule ${we(e,i+1)} blocks unconditionally, so this action can never succeed and its success effects never run.`});for(let e=i+1;e<t.length;e++)r.add(e),n.push({kind:`shadowed-rule`,severity:`recommended`,rulePositions:[e+1],detail:`Rule ${we(t[e],e+1)} runs after an unconditional block, so its effect is always suppressed.`})}for(let e=0;e<t.length;e++){if(r.has(e))continue;let i=t[e];for(let a=e+1;a<t.length;a++){if(r.has(a))continue;let o=t[a];ye(i.condition,o.condition)&&(be(i.effect,o.effect)?n.push({kind:`redundant-rule`,severity:`recommended`,rulePositions:[e+1,a+1],detail:`Rules #${e+1} and #${a+1} share the same condition and the same effect; one is redundant.`}):xe(i.effect,o.effect)&&n.push({kind:`conflicting-rules`,severity:`critical`,rulePositions:[e+1,a+1],detail:`Rules #${e+1} and #${a+1} fire on the same condition but their effects disagree, so the outcome depends on rule order rather than intent.`}))}}return n},$=(e,t)=>t===0?100:Math.round(e/t*100),Ee=(e,t)=>{let n=e.surfaces.flatMap(e=>z(e.actions)),r=e.surfaces,i=e.featureInvariants?.length??0,a=n.filter(e=>e.rules.length>0||e.effects.length>0||e.parameters.length>0),o=a.filter(e=>(e.scenarios??[]).length>0),s=r.filter(e=>e.invariants.length>0||e.actions.some(e=>e.invariants.length>0)||i>0),c=n.filter(e=>e.effects.length>0||e.rules.length>0||(e.outcomes?.length??0)>0),l=n.filter(e=>Te(e).some(e=>e.severity===`critical`)),u=[{key:`structural`,label:`Structural completeness`,score:$(t.passed,t.total),covered:t.passed,total:t.total,detail:`${t.passed} of ${t.total} maturity checks pass`},{key:`behavioral`,label:`Behavioral coverage`,score:$(o.length,a.length),covered:o.length,total:a.length,detail:a.length===0?`no non-trivial actions to cover with scenarios`:`${o.length} of ${a.length} non-trivial actions have a scenario`},{key:`guardrails`,label:`Guardrails`,score:$(s.length,r.length),covered:s.length,total:r.length,detail:r.length===0?`no surfaces yet`:`${s.length} of ${r.length} surfaces are covered by an invariant`},{key:`executability`,label:`Executability`,score:$(c.length,n.length),covered:c.length,total:n.length,detail:n.length===0?`no actions yet`:`${c.length} of ${n.length} actions run to an effect, rule, or outcome`},{key:`consistency`,label:`Consistency`,score:$(n.length-l.length,n.length),covered:n.length-l.length,total:n.length,detail:l.length===0?`no contradictory or dead rules`:`${l.length} of ${n.length} actions have a contradictory or dead rule`}],d=u.reduce((e,t)=>t.score<e.score?t:e,u[0]);return{dimensions:u,overall:d.score,weakest:{key:d.key,score:d.score}}},De=5,Oe=5,ke=R(),Ae=(e,t)=>{let n=e;return t.surfaceId&&(n=n.filter(e=>e.surfaceId===t.surfaceId)),t.area&&(n=n.filter(e=>e.area===t.area)),t.severity&&(n=n.filter(e=>e.severity===t.severity)),n},je=(e,t,n)=>{let r=Ae([...t.criticalIssues,...t.recommendedIssues],n),i=n.surfaceId!==void 0||n.area!==void 0||n.severity!==void 0,a=new Map;for(let e of r){let t=`${e.area}::${e.severity}`,n=a.get(t);n?n.count+=1:a.set(t,{area:e.area,severity:e.severity,count:1})}let o=[...a.values()].sort((e,t)=>t.count-e.count).slice(0,De),s=new Map(e.surfaces.map(e=>[String(e.id),e.name])),c=new Map;for(let e of r){let t=e.surfaceId;t&&c.set(t,(c.get(t)??0)+1)}let l=[...c.entries()].map(([e,t])=>({surfaceId:e,surfaceName:s.get(e)??`(unknown surface)`,issueCount:t})).sort((e,t)=>t.issueCount-e.issueCount).slice(0,Oe),u=r.filter(e=>e.severity===`critical`).length,d=r.filter(e=>e.severity===`recommended`).length,f={score:t.score,maxScore:t.maxScore,percentage:t.percentage,criticalIssueCount:i?u:t.criticalIssues.length,recommendedIssueCount:i?d:t.recommendedIssues.length,passedCheckCount:t.passedChecks.length,confidence:Ee(e,{passed:t.score,total:t.maxScore}),issuesByArea:o,worstSurfaces:l,hint:"Compact summary. `percentage` is the structural score; `confidence` splits it into dimensions and reports the weakest one as `overall`. Add includeIssues:true for the issue array, or filter by surfaceId / area / severity."};return n.includeIssues?{...f,issues:r}:f},Me=(e,t={})=>je(e,ke(e),t),Ne=e=>{let t=typeof e==`string`?e:JSON.stringify(e);return t?Math.ceil(t.length/4):0},Pe=(e,t,n,r)=>e.map(e=>{if(t===`blocked`)return{path:String(e.path),operator:e.operator,held:null,skipped:!0,...e.description?{description:e.description}:{}};let i=e.path;if(typeof i!=`string`||i.length===0)return{path:String(e.path),operator:e.operator,held:!1,...e.description?{description:e.description}:{}};let a=F({left:e.path,operator:e.operator,right:e.value},n,r);return{path:i,operator:e.operator,held:a,...e.description?{description:e.description}:{}}}),Fe=(e,t,n,r,i)=>{let a=n.personaId===void 0?null:r.personas.find(e=>e.id===n.personaId)??null;if(n.personaId!==void 0&&a===null)throw Error(`Scenario ${n.id} references unknown personaId "${String(n.personaId)}"`);let o=a?q(a,{}):{},s=a?K(a,t,{}):{},c=se(n,o),l=[],u=c;for(let[t,o]of(n.steps??[]).entries()){let s=o.surfaceId===void 0?e:r.surfaces.find(e=>e.id===o.surfaceId),c=s?.actions.find(e=>e.id===o.actionId);if(!s||!c)throw Error(`Scenario ${n.id} step ${t} references unknown ${s?`actionId "${String(o.actionId)}"`:`surfaceId "${String(o.surfaceId)}"`}`);let d=a?K(a,c,{}):{},f=new Set(c.parameters.map(e=>e.name)),p={};for(let e of o.parameterOverrides)f.has(e.parameterName)&&(p[e.parameterName]=e.value);let m={...d,...p};o.timeAdvance!==void 0&&o.timeAdvance!==0&&(u=P(u,o.timeAdvance));let h=W({surface:s,action:c,snapshot:u,parameters:m,featureInvariants:r.featureInvariants,feature:r,...i?{projectFeatures:i}:{}});u=h.nextState;let g=h.status===`blocked`?`blocked`:`success`,_=o.expectedStatus??`success`,v=g===_,y=U(c.parameters,m),b=Pe(o.expectedAssertions??[],g,h.nextState,y),x=b.every(e=>e.skipped||e.held),S=v&&x,C=b.filter(e=>!e.skipped&&!e.held).length;l.push({index:t,surfaceId:s.id,actionId:c.id,actionName:c.name,description:o.description??null,actualStatus:g,expectedStatus:_,statusMatches:v,assertions:b,parameterErrors:h.parameterErrors,invariantViolations:h.invariantViolations,pass:S,summary:S?`pass. ${g}`:v?`${C} assertion${C===1?``:`s`} did not hold`:`status was ${g} but expected ${_}`})}let d=ce(n,t,{}),f={...s,...d};n.timeAdvance!==void 0&&n.timeAdvance!==0&&(u=P(u,n.timeAdvance));let p=W({surface:e,action:t,snapshot:u,parameters:f,featureInvariants:r.featureInvariants,feature:r,...i?{projectFeatures:i}:{}}),m=U(t.parameters,f),h=p.nextState,g=p.status===`blocked`?`blocked`:`success`,_=Pe(n.expectedAssertions??[],g,h,m),v=n.expectedStatus??null,y=v===null||v===g,b=_.every(e=>e.skipped||e.held),x=_.length>0&&_.every(e=>e.skipped)&&v!==`blocked`,S=n.expectedTransition===void 0?null:g===`blocked`?{expected:n.expectedTransition,actual:p.transition,matches:!0}:{expected:n.expectedTransition,actual:p.transition,matches:n.expectedTransition===p.transition},C=S===null||S.matches,w=l.every(e=>e.pass),T=l.find(e=>!e.pass),E=w&&y&&b&&C&&!x,D=_.filter(e=>!e.skipped&&!e.held).length,O=p.parameterErrors.length>0?` (parameter validation rejected: ${p.parameterErrors.map(e=>`${e.parameterName}. ${e.reason}`).join(`; `)})`:``,k=p.invariantViolations.length>0?` (invariant violations: ${p.invariantViolations.map(e=>e.invariantName).join(`, `)})`:``,A=_.filter(e=>!e.skipped).length,j=_.length-A,M=j>0?`, ${j} skipped (action was blocked)`:``,N=S&&!S.matches?` (transition went to ${String(S.actual)} but expected ${String(S.expected)})`:``,F=l.length>0?`${l.length} step${l.length===1?``:`s`} ok, `:``,I=E?`pass. ${F}${g}${A>0?`, ${A} assertion${A===1?``:`s`} held`:``}${M}`:`fail. ${!w&&T?`step ${T.index} (${T.actionName}): ${T.summary}`:y?C?x?`action was blocked so all ${_.length} assertion${_.length===1?``:`s`} skipped. Set expectedStatus:"blocked" if the block is intentional; otherwise fix the scenario so the action runs.${O}${k}`:`${D}/${A} assertion${A===1?``:`s`} did not hold${k}`:`transition mismatch${N}`:`status was ${g} but expected ${v}${O}${k}`}`;return{surfaceId:e.id,actionId:t.id,actionName:t.name,scenarioId:n.id,scenarioName:n.name,personaId:a?String(a.id):null,personaName:a?.name??null,pass:E,actualStatus:g,expectedStatus:v,statusMatches:y,assertions:_,steps:l,transitionCheck:S,parameterErrors:p.parameterErrors,invariantViolations:p.invariantViolations,summary:I}},Ie=()=>e=>{let t=[];for(let n of e.feature.surfaces)if(!(e.surfaceId&&n.id!==e.surfaceId))for(let r of n.actions){if(e.actionId&&r.id!==e.actionId)continue;let i=r.scenarios??[];for(let a of i)t.push(Fe(n,r,a,e.feature,e.projectFeatures))}let n=t.filter(e=>e.pass).length;return{featureId:String(e.feature.id),featureName:e.feature.name,total:t.length,passed:n,failed:t.length-n,results:t}},Le=n(`<div class="py-10 text-sm text-slate-500">Project not found. <a href="/projects" class="text-brand-700 underline">Back to projects</a>.</div>`),Re=n(`<div class="flex animate-pulse items-center gap-3" role="status" aria-label="Loading project"><div class="h-4 w-16 rounded bg-slate-200"></div> <div class="h-10 w-56 rounded-md bg-slate-100"></div> <span class="text-xs text-slate-400">Loading project...</span></div>`),ze=n(`<option> </option>`),Be=n(`<span class="inline-flex items-center gap-1.5 text-xs text-slate-500" role="status"><span class="h-3 w-3 animate-spin rounded-full border-2 border-slate-300 border-t-slate-600" aria-hidden="true"></span> Loading feature...</span>`),Ve=n(`<label for="feature-select" class="text-sm font-medium text-slate-700">Feature:</label> <select id="feature-select" class="h-10 rounded-md border border-slate-300 bg-white px-3 text-sm outline-none focus:border-slate-900 disabled:cursor-not-allowed disabled:opacity-50"></select> <span class="text-xs text-slate-500"> </span> <!>`,1),He=n(`<div class="rounded-lg border border-dashed border-hairline bg-white p-6 text-sm text-slate-500">No features in this project yet. <a class="text-brand-700 underline">Add one</a> first.</div>`),Ue=n(`<p class="text-sm text-red-600"> </p>`),We=n(`<pre class="mt-2 max-h-72 overflow-auto rounded-md bg-slate-950 p-3 text-[11px] leading-relaxed text-slate-100"> </pre>`),Ge=n(`<li class="rounded-lg border border-hairline bg-white p-4"><div class="flex items-start justify-between gap-4"><div class="min-w-0 flex-1"><div class="font-mono text-sm font-semibold text-slate-950"> </div> <div class="mt-0.5 truncate font-mono text-[11px] text-slate-400"> </div> <p class="mt-1.5 text-xs leading-5 text-slate-600"> </p></div> <div class="shrink-0 text-right"><div class="font-mono text-lg font-semibold text-slate-950"> </div> <div class="text-[10px] uppercase tracking-wide text-slate-400">tokens</div> <div class="mt-0.5 text-[11px] text-slate-500"> </div></div></div> <details class="mt-3"><summary class="cursor-pointer text-xs text-slate-500 hover:text-slate-800">Show output</summary> <!></details></li>`),Ke=n(`<li class="animate-pulse rounded-lg border border-hairline bg-white p-4" aria-hidden="true"><div class="h-4 w-44 rounded bg-slate-200"></div> <div class="mt-2 h-3 w-72 max-w-full rounded bg-slate-100"></div> <div class="mt-3 h-3 w-full rounded bg-slate-100"></div></li> <li class="list-none"><p role="status" class="text-xs text-slate-400"><!></p></li>`,1),qe=n(`<pre class="mt-2 max-h-64 overflow-auto rounded-md bg-white p-2 text-[11px] leading-relaxed text-slate-700 ring-1 ring-hairline"> </pre>`),Je=n(`<div class="rounded-lg border border-brand-200 bg-brand-50/60 p-4"><div class="flex items-baseline justify-between gap-2"><div><div class="font-mono text-sm font-semibold text-brand-900">Full feature JSON</div> <p class="mt-0.5 text-xs text-slate-500">Naive blob-in-prompt baseline</p></div> <div class="text-right"><div class="font-mono text-2xl font-semibold text-brand-900"> </div> <div class="text-[10px] uppercase tracking-wide text-slate-500">tokens</div></div></div> <details class="mt-3"><summary class="cursor-pointer text-xs text-slate-600 hover:text-slate-950"> </summary> <!></details></div>`),Ye=n(`<div class="animate-pulse rounded-lg border border-brand-200 bg-brand-50/40 p-4" role="status" aria-label="Computing token baseline"><div class="h-4 w-36 rounded bg-brand-100"></div> <div class="mt-2 h-3 w-48 rounded bg-brand-100/70"></div> <div class="mt-4 h-7 w-24 rounded bg-brand-100"></div></div>`),Xe=n(`<span class="rounded bg-slate-100 px-1.5 py-0.5 font-mono text-[10px] text-slate-600"> </span>`),Ze=n(`<div class="rounded-lg border border-hairline bg-white p-3"><div class="mb-1 text-xs font-semibold text-slate-800"> </div> <p class="mb-2 text-[11px] leading-5 text-slate-500"> </p> <div class="flex flex-wrap gap-1"></div></div>`),Qe=n(`<div class="flex flex-col gap-8 lg:flex-row lg:items-start"><div class="min-w-0 flex-1"><h2 class="mb-4 text-base font-semibold text-slate-950">Read tools</h2> <ul class="space-y-3"><!> <!></ul></div> <div class="w-full shrink-0 space-y-6 lg:w-80"><!> <div><h2 class="mb-3 text-base font-semibold text-slate-950">Write & mutation tools</h2> <div class="space-y-4"></div></div></div></div>`),$e=n(`<header class="mb-6 border-b border-slate-200 pb-6"><a class="mb-3 inline-flex items-center gap-1.5 text-xs font-medium text-slate-500 transition hover:text-slate-900"><span aria-hidden="true">←</span> </a> <div class="grid gap-6 lg:grid-cols-[minmax(0,1fr)_auto] lg:items-end"><div class="max-w-3xl"><p class="text-xs font-semibold uppercase tracking-wide text-brand-700"> </p> <h1 class="mt-2 text-4xl font-semibold tracking-tight text-slate-950">MCP server</h1> <p class="mt-2 max-w-3xl text-sm leading-6 text-slate-600">The MCP server lets AI coding agents read and edit this project's Features without
1
+ import{$ as e,B as t,F as n,G as r,K as i,L as a,M as o,N as s,O as c,Q as l,S as u,V as d,Y as f,Z as p,d as m,dt as h,et as g,gt as _,h as v,ht as y,it as b,j as x,k as S,nt as C,q as w,r as T,tt as E,ut as D}from"../chunks/CYsLq4VE.js";import"../chunks/xihTtKlq.js";import{t as O}from"../chunks/BocNk-Bz.js";import{At as k,C as A,Ct as j,Dt as M,Et as N,G as P,S as F,St as I,Tt as L,_ as R,h as ee,it as te,k as z,t as B,ut as ne,v as V,wt as H,x as U,y as W,yt as re}from"../chunks/PGh5ehlS.js";import{n as ie,r as ae,t as G}from"../chunks/CGWhvtMz.js";import{t as oe}from"../chunks/Cbsgl_qu2.js";import{a as se,i as ce,o as K,r as le,s as q,t as J}from"../chunks/BnqPzDNe2.js";var ue=e=>e,de=e=>({id:e.id,name:e.name,description:e.description,devContext:e.devContext,surfaces:e.surfaces.map(e=>({id:e.id,name:e.name,type:e.type,stateCount:e.stateDefinitions.length,ruleCount:e.rules.length,invariantCount:e.invariants.length,transitionCount:e.transitions.length,actions:e.actions.map(e=>({id:e.id,name:e.name})),stateDefinitions:e.stateDefinitions.map(e=>({id:e.id,path:String(e.path)}))})),personas:e.personas.map(e=>({id:e.id,name:e.name})),resources:e.resources.map(e=>({id:e.id,name:e.name})),entities:e.entities.map(e=>({id:e.id,name:A(e.namespace)})),createdAt:e.createdAt,updatedAt:e.updatedAt}),fe=(e,t)=>{let n=t?e.surfaces.filter(e=>e.id===t):e.surfaces,r=[];for(let e of n)for(let t of e.actions)r.push({actionId:t.id,actionName:t.name,intent:t.intent,surfaceId:e.id,surfaceName:e.name,parameterCount:t.parameters.length,ruleCount:t.rules.length,...t.evolution?{evolution:t.evolution}:{}});return r},Y={conventions:[`DDD (domain-driven design)`,`hexagonal architecture (ports & adapters)`,`dependency inversion at every boundary`,`clean code: small functions, intention-revealing names, no premature abstraction`],notes:`Even for prototypes: keep the domain pure, push IO to adapters, and let the use-case layer orchestrate. The product will evolve. Modular shapes pay off later.`},pe=e=>e?e.mode===`custom`?e:{mode:`auto`,stack:e.stack,conventions:e.conventions??Y.conventions,notes:e.notes??Y.notes}:null,X=e=>{let t=new Set;for(let n of e.requiredStates)t.add(n);for(let n of e.parameters)n.bindToStatePath&&t.add(n.bindToStatePath);for(let n of e.rules){for(let e of j(n.condition))typeof e.left==`string`&&t.add(e.left);n.effect.type===`set_state`&&t.add(n.effect.path)}for(let n of e.effects)n.type===`set_state`&&t.add(n.path);for(let n of e.invariants)for(let e of j(n.condition))typeof e.left==`string`&&t.add(e.left);return t},me=(e,t)=>{for(let n of e.surfaces){let r=n.actions.find(e=>e.id===t);if(!r)continue;let i=X(r),a=n.stateDefinitions.filter(e=>i.has(e.path)),o=n.invariants.filter(e=>j(e.condition).some(e=>typeof e.left==`string`&&i.has(e.left))),s=pe(e.devContext);return{featureId:e.id,featureName:e.name,surfaceId:n.id,surfaceName:n.name,action:r,linkedStateDefinitions:a,enclosingInvariants:o,...s?{devContext:s}:{}}}return null},he=(e,t)=>{let n=J(e,t);return{...n,total:le(n)}},ge=V(),_e=e=>ge(e),Z=(e,t=new Set)=>{let n=e=>{if(Array.isArray(e))return e.map(n);if(e&&typeof e==`object`){let r=e,i={};for(let e of Object.keys(r).sort())t.has(e)||(i[e]=n(r[e]));return i}return e};return JSON.stringify(n(e))},ve=new Set([`id`,`description`]),ye=(e,t)=>Z(e)===Z(t),be=(e,t)=>Z(e,ve)===Z(t,ve),xe=(e,t)=>{if(e.type===`set_state`&&t.type===`set_state`&&String(e.path)===String(t.path))return Z(e.value)!==Z(t.value);let n=new Set([e.type,t.type]);return n.has(`allow_action`)&&n.has(`block_action`)},Se=e=>e?H(e)?e.kind===`all`?e.conditions.flatMap(Se):[]:N(e)?[]:[e]:[],Q=e=>e.right!==void 0&&!I(e.right),Ce=e=>{let t=new Map;for(let n of Se(e)){if(L(n.left))continue;let e=String(n.left),r=t.get(e)??{mustEqual:new Set,mustNotEqual:new Set,exists:!1,absent:!1};switch(n.operator){case`is_true`:r.mustEqual.add(`true`),r.exists=!0;break;case`is_false`:r.mustEqual.add(`false`),r.exists=!0;break;case`exists`:r.exists=!0;break;case`does_not_exist`:r.absent=!0;break;case`equals`:Q(n)&&r.mustEqual.add(Z(n.right)),r.exists=!0;break;case`not_equals`:Q(n)&&r.mustNotEqual.add(Z(n.right));break;default:break}t.set(e,r)}for(let e of t.values()){if(e.mustEqual.size>1)return!0;for(let t of e.mustEqual)if(e.mustNotEqual.has(t))return!0;if(e.exists&&e.absent||e.absent&&e.mustEqual.size>0)return!0}return!1},we=(e,t)=>e.description?.trim()?`"${e.description.trim()}"`:`#${t} (${e.category})`,Te=e=>{let t=e.rules,n=[],r=new Set;t.forEach((e,t)=>{Ce(e.condition)&&(r.add(t),n.push({kind:`dead-rule`,severity:`critical`,rulePositions:[t+1],detail:`Rule ${we(e,t+1)} can never fire: its condition requires a state to hold two incompatible values at once.`}))});let i=t.findIndex(e=>e.condition===void 0&&e.effect.type===`block_action`);if(i>=0){let e=t[i];n.push({kind:`always-blocked`,severity:`recommended`,rulePositions:[i+1],detail:`Rule ${we(e,i+1)} blocks unconditionally, so this action can never succeed and its success effects never run.`});for(let e=i+1;e<t.length;e++)r.add(e),n.push({kind:`shadowed-rule`,severity:`recommended`,rulePositions:[e+1],detail:`Rule ${we(t[e],e+1)} runs after an unconditional block, so its effect is always suppressed.`})}for(let e=0;e<t.length;e++){if(r.has(e))continue;let i=t[e];for(let a=e+1;a<t.length;a++){if(r.has(a))continue;let o=t[a];ye(i.condition,o.condition)&&(be(i.effect,o.effect)?n.push({kind:`redundant-rule`,severity:`recommended`,rulePositions:[e+1,a+1],detail:`Rules #${e+1} and #${a+1} share the same condition and the same effect; one is redundant.`}):xe(i.effect,o.effect)&&n.push({kind:`conflicting-rules`,severity:`critical`,rulePositions:[e+1,a+1],detail:`Rules #${e+1} and #${a+1} fire on the same condition but their effects disagree, so the outcome depends on rule order rather than intent.`}))}}return n},$=(e,t)=>t===0?100:Math.round(e/t*100),Ee=(e,t)=>{let n=e.surfaces.filter(e=>!(e.presentation??!1)),r=n.flatMap(e=>z(e.actions)),i=e.featureInvariants?.length??0,a=r.filter(e=>e.rules.length>0||e.effects.length>0||e.parameters.length>0),o=a.filter(e=>(e.scenarios??[]).length>0),s=n.filter(e=>e.invariants.length>0||e.actions.some(e=>e.invariants.length>0)||i>0),c=r.filter(e=>e.effects.length>0||e.rules.length>0||(e.outcomes?.length??0)>0),l=r.filter(e=>Te(e).some(e=>e.severity===`critical`)),u=[{key:`structural`,label:`Structural completeness`,score:$(t.passed,t.total),covered:t.passed,total:t.total,detail:`${t.passed} of ${t.total} maturity checks pass`},{key:`behavioral`,label:`Behavioral coverage`,score:$(o.length,a.length),covered:o.length,total:a.length,detail:a.length===0?`no non-trivial actions to cover with scenarios`:`${o.length} of ${a.length} non-trivial actions have a scenario`},{key:`guardrails`,label:`Guardrails`,score:$(s.length,n.length),covered:s.length,total:n.length,detail:n.length===0?`no surfaces yet`:`${s.length} of ${n.length} surfaces are covered by an invariant`},{key:`executability`,label:`Executability`,score:$(c.length,r.length),covered:c.length,total:r.length,detail:r.length===0?`no actions yet`:`${c.length} of ${r.length} actions run to an effect, rule, or outcome`},{key:`consistency`,label:`Consistency`,score:$(r.length-l.length,r.length),covered:r.length-l.length,total:r.length,detail:l.length===0?`no contradictory or dead rules`:`${l.length} of ${r.length} actions have a contradictory or dead rule`}],d=u.reduce((e,t)=>t.score<e.score?t:e,u[0]);return{dimensions:u,overall:d.score,weakest:{key:d.key,score:d.score}}},De=5,Oe=5,ke=R(),Ae=(e,t)=>{let n=e;return t.surfaceId&&(n=n.filter(e=>e.surfaceId===t.surfaceId)),t.area&&(n=n.filter(e=>e.area===t.area)),t.severity&&(n=n.filter(e=>e.severity===t.severity)),n},je=(e,t,n)=>{let r=Ae([...t.criticalIssues,...t.recommendedIssues],n),i=n.surfaceId!==void 0||n.area!==void 0||n.severity!==void 0,a=new Map;for(let e of r){let t=`${e.area}::${e.severity}`,n=a.get(t);n?n.count+=1:a.set(t,{area:e.area,severity:e.severity,count:1})}let o=[...a.values()].sort((e,t)=>t.count-e.count).slice(0,De),s=new Map(e.surfaces.map(e=>[String(e.id),e.name])),c=new Map;for(let e of r){let t=e.surfaceId;t&&c.set(t,(c.get(t)??0)+1)}let l=[...c.entries()].map(([e,t])=>({surfaceId:e,surfaceName:s.get(e)??`(unknown surface)`,issueCount:t})).sort((e,t)=>t.issueCount-e.issueCount).slice(0,Oe),u=r.filter(e=>e.severity===`critical`).length,d=r.filter(e=>e.severity===`recommended`).length,f={score:t.score,maxScore:t.maxScore,percentage:t.percentage,criticalIssueCount:i?u:t.criticalIssues.length,recommendedIssueCount:i?d:t.recommendedIssues.length,passedCheckCount:t.passedChecks.length,confidence:Ee(e,{passed:t.score,total:t.maxScore}),issuesByArea:o,worstSurfaces:l,hint:"Compact summary. `percentage` is the structural score; `confidence` splits it into dimensions and reports the weakest one as `overall`. Add includeIssues:true for the issue array, or filter by surfaceId / area / severity."};return n.includeIssues?{...f,issues:r}:f},Me=(e,t={})=>je(e,ke(e),t),Ne=e=>{let t=typeof e==`string`?e:JSON.stringify(e);return t?Math.ceil(t.length/4):0},Pe=(e,t,n,r)=>e.map(e=>{if(t===`blocked`)return{path:String(e.path),operator:e.operator,held:null,skipped:!0,...e.description?{description:e.description}:{}};let i=e.path;if(typeof i!=`string`||i.length===0)return{path:String(e.path),operator:e.operator,held:!1,...e.description?{description:e.description}:{}};let a=F({left:e.path,operator:e.operator,right:e.value},n,r);return{path:i,operator:e.operator,held:a,...e.description?{description:e.description}:{}}}),Fe=(e,t,n,r,i)=>{let a=n.personaId===void 0?null:r.personas.find(e=>e.id===n.personaId)??null;if(n.personaId!==void 0&&a===null)throw Error(`Scenario ${n.id} references unknown personaId "${String(n.personaId)}"`);let o=a?q(a,{}):{},s=a?K(a,t,{}):{},c=se(n,o),l=[],u=c;for(let[t,o]of(n.steps??[]).entries()){let s=o.surfaceId===void 0?e:r.surfaces.find(e=>e.id===o.surfaceId),c=s?.actions.find(e=>e.id===o.actionId);if(!s||!c)throw Error(`Scenario ${n.id} step ${t} references unknown ${s?`actionId "${String(o.actionId)}"`:`surfaceId "${String(o.surfaceId)}"`}`);let d=a?K(a,c,{}):{},f=new Set(c.parameters.map(e=>e.name)),p={};for(let e of o.parameterOverrides)f.has(e.parameterName)&&(p[e.parameterName]=e.value);let m={...d,...p};o.timeAdvance!==void 0&&o.timeAdvance!==0&&(u=P(u,o.timeAdvance));let h=W({surface:s,action:c,snapshot:u,parameters:m,featureInvariants:r.featureInvariants,feature:r,...i?{projectFeatures:i}:{}});u=h.nextState;let g=h.status===`blocked`?`blocked`:`success`,_=o.expectedStatus??`success`,v=g===_,y=U(c.parameters,m),b=Pe(o.expectedAssertions??[],g,h.nextState,y),x=b.every(e=>e.skipped||e.held),S=v&&x,C=b.filter(e=>!e.skipped&&!e.held).length;l.push({index:t,surfaceId:s.id,actionId:c.id,actionName:c.name,description:o.description??null,actualStatus:g,expectedStatus:_,statusMatches:v,assertions:b,parameterErrors:h.parameterErrors,invariantViolations:h.invariantViolations,pass:S,summary:S?`pass. ${g}`:v?`${C} assertion${C===1?``:`s`} did not hold`:`status was ${g} but expected ${_}`})}let d=ce(n,t,{}),f={...s,...d};n.timeAdvance!==void 0&&n.timeAdvance!==0&&(u=P(u,n.timeAdvance));let p=W({surface:e,action:t,snapshot:u,parameters:f,featureInvariants:r.featureInvariants,feature:r,...i?{projectFeatures:i}:{}}),m=U(t.parameters,f),h=p.nextState,g=p.status===`blocked`?`blocked`:`success`,_=Pe(n.expectedAssertions??[],g,h,m),v=n.expectedStatus??null,y=v===null||v===g,b=_.every(e=>e.skipped||e.held),x=_.length>0&&_.every(e=>e.skipped)&&v!==`blocked`,S=n.expectedTransition===void 0?null:g===`blocked`?{expected:n.expectedTransition,actual:p.transition,matches:!0}:{expected:n.expectedTransition,actual:p.transition,matches:n.expectedTransition===p.transition},C=S===null||S.matches,w=l.every(e=>e.pass),T=l.find(e=>!e.pass),E=w&&y&&b&&C&&!x,D=_.filter(e=>!e.skipped&&!e.held).length,O=p.parameterErrors.length>0?` (parameter validation rejected: ${p.parameterErrors.map(e=>`${e.parameterName}. ${e.reason}`).join(`; `)})`:``,k=p.invariantViolations.length>0?` (invariant violations: ${p.invariantViolations.map(e=>e.invariantName).join(`, `)})`:``,A=_.filter(e=>!e.skipped).length,j=_.length-A,M=j>0?`, ${j} skipped (action was blocked)`:``,N=S&&!S.matches?` (transition went to ${String(S.actual)} but expected ${String(S.expected)})`:``,F=l.length>0?`${l.length} step${l.length===1?``:`s`} ok, `:``,I=E?`pass. ${F}${g}${A>0?`, ${A} assertion${A===1?``:`s`} held`:``}${M}`:`fail. ${!w&&T?`step ${T.index} (${T.actionName}): ${T.summary}`:y?C?x?`action was blocked so all ${_.length} assertion${_.length===1?``:`s`} skipped. Set expectedStatus:"blocked" if the block is intentional; otherwise fix the scenario so the action runs.${O}${k}`:`${D}/${A} assertion${A===1?``:`s`} did not hold${k}`:`transition mismatch${N}`:`status was ${g} but expected ${v}${O}${k}`}`;return{surfaceId:e.id,actionId:t.id,actionName:t.name,scenarioId:n.id,scenarioName:n.name,personaId:a?String(a.id):null,personaName:a?.name??null,pass:E,actualStatus:g,expectedStatus:v,statusMatches:y,assertions:_,steps:l,transitionCheck:S,parameterErrors:p.parameterErrors,invariantViolations:p.invariantViolations,summary:I}},Ie=()=>e=>{let t=[];for(let n of e.feature.surfaces)if(!(e.surfaceId&&n.id!==e.surfaceId))for(let r of n.actions){if(e.actionId&&r.id!==e.actionId)continue;let i=r.scenarios??[];for(let a of i)t.push(Fe(n,r,a,e.feature,e.projectFeatures))}let n=t.filter(e=>e.pass).length;return{featureId:String(e.feature.id),featureName:e.feature.name,total:t.length,passed:n,failed:t.length-n,results:t}},Le=n(`<div class="py-10 text-sm text-slate-500">Project not found. <a href="/projects" class="text-brand-700 underline">Back to projects</a>.</div>`),Re=n(`<div class="flex animate-pulse items-center gap-3" role="status" aria-label="Loading project"><div class="h-4 w-16 rounded bg-slate-200"></div> <div class="h-10 w-56 rounded-md bg-slate-100"></div> <span class="text-xs text-slate-400">Loading project...</span></div>`),ze=n(`<option> </option>`),Be=n(`<span class="inline-flex items-center gap-1.5 text-xs text-slate-500" role="status"><span class="h-3 w-3 animate-spin rounded-full border-2 border-slate-300 border-t-slate-600" aria-hidden="true"></span> Loading feature...</span>`),Ve=n(`<label for="feature-select" class="text-sm font-medium text-slate-700">Feature:</label> <select id="feature-select" class="h-10 rounded-md border border-slate-300 bg-white px-3 text-sm outline-none focus:border-slate-900 disabled:cursor-not-allowed disabled:opacity-50"></select> <span class="text-xs text-slate-500"> </span> <!>`,1),He=n(`<div class="rounded-lg border border-dashed border-hairline bg-white p-6 text-sm text-slate-500">No features in this project yet. <a class="text-brand-700 underline">Add one</a> first.</div>`),Ue=n(`<p class="text-sm text-red-600"> </p>`),We=n(`<pre class="mt-2 max-h-72 overflow-auto rounded-md bg-slate-950 p-3 text-[11px] leading-relaxed text-slate-100"> </pre>`),Ge=n(`<li class="rounded-lg border border-hairline bg-white p-4"><div class="flex items-start justify-between gap-4"><div class="min-w-0 flex-1"><div class="font-mono text-sm font-semibold text-slate-950"> </div> <div class="mt-0.5 truncate font-mono text-[11px] text-slate-400"> </div> <p class="mt-1.5 text-xs leading-5 text-slate-600"> </p></div> <div class="shrink-0 text-right"><div class="font-mono text-lg font-semibold text-slate-950"> </div> <div class="text-[10px] uppercase tracking-wide text-slate-400">tokens</div> <div class="mt-0.5 text-[11px] text-slate-500"> </div></div></div> <details class="mt-3"><summary class="cursor-pointer text-xs text-slate-500 hover:text-slate-800">Show output</summary> <!></details></li>`),Ke=n(`<li class="animate-pulse rounded-lg border border-hairline bg-white p-4" aria-hidden="true"><div class="h-4 w-44 rounded bg-slate-200"></div> <div class="mt-2 h-3 w-72 max-w-full rounded bg-slate-100"></div> <div class="mt-3 h-3 w-full rounded bg-slate-100"></div></li> <li class="list-none"><p role="status" class="text-xs text-slate-400"><!></p></li>`,1),qe=n(`<pre class="mt-2 max-h-64 overflow-auto rounded-md bg-white p-2 text-[11px] leading-relaxed text-slate-700 ring-1 ring-hairline"> </pre>`),Je=n(`<div class="rounded-lg border border-brand-200 bg-brand-50/60 p-4"><div class="flex items-baseline justify-between gap-2"><div><div class="font-mono text-sm font-semibold text-brand-900">Full feature JSON</div> <p class="mt-0.5 text-xs text-slate-500">Naive blob-in-prompt baseline</p></div> <div class="text-right"><div class="font-mono text-2xl font-semibold text-brand-900"> </div> <div class="text-[10px] uppercase tracking-wide text-slate-500">tokens</div></div></div> <details class="mt-3"><summary class="cursor-pointer text-xs text-slate-600 hover:text-slate-950"> </summary> <!></details></div>`),Ye=n(`<div class="animate-pulse rounded-lg border border-brand-200 bg-brand-50/40 p-4" role="status" aria-label="Computing token baseline"><div class="h-4 w-36 rounded bg-brand-100"></div> <div class="mt-2 h-3 w-48 rounded bg-brand-100/70"></div> <div class="mt-4 h-7 w-24 rounded bg-brand-100"></div></div>`),Xe=n(`<span class="rounded bg-slate-100 px-1.5 py-0.5 font-mono text-[10px] text-slate-600"> </span>`),Ze=n(`<div class="rounded-lg border border-hairline bg-white p-3"><div class="mb-1 text-xs font-semibold text-slate-800"> </div> <p class="mb-2 text-[11px] leading-5 text-slate-500"> </p> <div class="flex flex-wrap gap-1"></div></div>`),Qe=n(`<div class="flex flex-col gap-8 lg:flex-row lg:items-start"><div class="min-w-0 flex-1"><h2 class="mb-4 text-base font-semibold text-slate-950">Read tools</h2> <ul class="space-y-3"><!> <!></ul></div> <div class="w-full shrink-0 space-y-6 lg:w-80"><!> <div><h2 class="mb-3 text-base font-semibold text-slate-950">Write & mutation tools</h2> <div class="space-y-4"></div></div></div></div>`),$e=n(`<header class="mb-6 border-b border-slate-200 pb-6"><a class="mb-3 inline-flex items-center gap-1.5 text-xs font-medium text-slate-500 transition hover:text-slate-900"><span aria-hidden="true">←</span> </a> <div class="grid gap-6 lg:grid-cols-[minmax(0,1fr)_auto] lg:items-end"><div class="max-w-3xl"><p class="text-xs font-semibold uppercase tracking-wide text-brand-700"> </p> <h1 class="mt-2 text-4xl font-semibold tracking-tight text-slate-950">MCP server</h1> <p class="mt-2 max-w-3xl text-sm leading-6 text-slate-600">The MCP server lets AI coding agents read and edit this project's Features without
2
2
  pasting the full JSON blob into a prompt. A Feature is one LLM-sized slice of behavior
3
3
  (a flow, a screen, a capability). The read tools below run live against the selected
4
4
  Feature of this project. Compare their token cost to the raw JSON baseline on the right.</p></div> <div class="grid grid-cols-1 gap-3 sm:grid-cols-3 lg:w-136"><div class="rounded-xl border border-slate-200 bg-white p-4 shadow-sm shadow-slate-950/5"><p class="text-xs font-medium uppercase tracking-wide text-brand-700">Read tools</p> <p class="mt-2 text-2xl font-semibold text-slate-950"> </p> <p class="mt-1 text-xs text-slate-500">Live examples</p></div> <div class="rounded-xl border border-slate-200 bg-white p-4 shadow-sm shadow-slate-950/5"><p class="text-xs font-medium uppercase tracking-wide text-violet-700">Groups</p> <p class="mt-2 text-2xl font-semibold text-slate-950"> </p> <p class="mt-1 text-xs text-slate-500">Mutation areas</p></div> <div class="rounded-xl border border-slate-200 bg-white p-4 shadow-sm shadow-slate-950/5"><p class="text-xs font-medium uppercase tracking-wide text-emerald-700">Baseline</p> <p class="mt-2 text-2xl font-semibold text-slate-950"> </p> <p class="mt-1 text-xs text-slate-500">JSON tokens</p></div></div></div></header> <div class="mb-6 flex flex-wrap items-center gap-3 rounded-xl border border-slate-200 bg-white p-3 shadow-sm shadow-slate-950/5"><!></div> <!>`,1),et=n(`<div class="mx-auto max-w-7xl px-4 py-8 sm:px-6"><!></div>`);function tt(n,A){h(A,!0);let j=b(()=>O.params.id??``),N=C(``),P=C(null),F=C(!1),I=C(null);C(`get_feature`);let L=C(null),R=C(null),z=C(!0),V=C(!0),H=0;T(()=>{(async()=>{await Promise.all([G.refresh(),ie.refresh()])})()}),w(()=>{if(!d(j))return;let e=ee(d(j));H+=1;let t=H;E(z,!0),E(V,!0),E(R,null),(async()=>{let n=await B();(async()=>{try{let r=await n.useCases.getProject(e);t===H&&E(L,r,!0)}finally{t===H&&E(z,!1)}})(),(async()=>{try{let r=await n.useCases.getProjectAggregate(e);t===H&&E(R,r,!0)}finally{t===H&&E(V,!1)}})()})()});let U=b(()=>{if(!d(L))return[];let e=new Map(G.summaries.map(e=>[String(e.id),e]));return d(L).featureIds.map(t=>e.get(String(t))).filter(e=>e!==void 0)});w(()=>{if(d(U).length===0){E(N,``);return}d(U).some(e=>String(e.id)===d(N))||E(N,String(d(U)[0].id),!0)}),w(()=>{if(!d(N)){E(P,null);return}E(F,!0),E(I,null),(async()=>{try{E(P,await(await B()).useCases.getFeature(ne(d(N))),!0)}catch(e){E(I,e.message,!0),E(P,null)}finally{E(F,!1)}})()});let W=e=>{for(let t of e.surfaces){let e=t.actions[0];if(e)return{surface:t,action:e}}return null},se=e=>{let t={};for(let n of e.stateDefinitions)t=k(t,n.path,n.defaultValue);return t},ce=e=>{let t={};for(let n of e.parameters)if(n.defaultValue!==void 0)t[n.name]=n.defaultValue;else switch(n.type){case`string`:t[n.name]=``;break;case`number`:t[n.name]=0;break;case`boolean`:t[n.name]=!1;break;case`enum`:t[n.name]=n.enumValues?.[0]??``;break;default:t[n.name]=null}return t},K=(e,t,n,r)=>({name:e,callSignature:t,description:n,output:r,tokens:Ne(r)}),le=Ie(),q=C(null),J=C(g([])),Y=C(!1),pe=0,X=C(g({}));function ge(e,t){!t||d(X)[e.name]||E(X,{...d(X),[e.name]:JSON.stringify(e.output,null,2)},!0)}let Z=C(!1),ve=()=>new Promise(e=>setTimeout(e,0));w(()=>{let e=d(P),t=d(U);pe+=1;let n=pe;if(E(J,[],!0),E(q,null),E(X,{},!0),!e){E(Y,!1);return}E(Y,!0);let r=()=>n===pe,i=e=>{r()&&E(J,[...d(J),e],!0)},a=[()=>i(K(`list_features`,`list_features()`,`Compact index of all features. Discovery entry point.`,ue(t))),()=>i(K(`get_feature`,`get_feature(featureId: "${e.id}")`,`Structured index. Surfaces, actions, state counts, devContext. Pass verbose:true only when you need the full blob.`,de(e))),()=>i(K(`list_actions`,`list_actions(featureId: "${e.id}")`,`Flat list of all actions across surfaces with id, name, intent, rule/effect counts.`,fe(e))),()=>{let t=W(e);t&&i(K(`get_action`,`get_action(featureId: "${e.id}", actionId: "${t.action.id}")`,`Single action with its rules, parameters, linked state defs, and implementation guidance. The primary focused query.`,me(e,te(t.action.id))))},()=>{let t=e.surfaces.find(e=>e.stateDefinitions.length>0)?.stateDefinitions[0];t&&i(K(`find_state_references`,`find_state_references(featureId: "${e.id}", statePath: "${t.path}")`,`Count refs to a state path across rules, effects, invariants, requiredStates, and parameter bindings. Run before editing or removing state.`,he(e,M(String(t.path)))))},()=>{let t=W(e);if(!t)return;let n=se(t.surface),r=ce(t.action);try{i(K(`dry_run_simulate`,`dry_run_simulate(${t.surface.name} ▸ ${t.action.name}, default snapshot)`,`Pure simulation. Runs the deterministic engine on proposed state without writing to disk. Validate changes before committing.`,_e({feature:e,surfaceId:re(t.surface.id),actionId:te(t.action.id),snapshot:n,parameters:r})))}catch(e){i(K(`dry_run_simulate`,`dry_run_simulate(${t.surface.name} ▸ ${t.action.name})`,`Simulation failed with default snapshot.`,{error:e.message}))}},()=>i(K(`score_feature`,`score_feature(featureId: "${e.id}")`,`Compact summary. Score, percentage, issue counts, top failing areas, worst surfaces. Pass includeIssues:true (next card) when you need the actual issues.`,Me(e))),()=>{let t=e.surfaces.reduce((e,t)=>t.actions.length+t.stateDefinitions.length>(e===null?-1:e.actions.length+e.stateDefinitions.length)?t:e,null);t&&i(K(`score_feature (issues)`,`score_feature(featureId: "${e.id}", surfaceId: "${t.id}", includeIssues: true)`,`Same tool, asked to return the actual issue list (includeIssues:true) for ${t.name}. The surfaceId / area / severity filters exist to keep the issue array bounded. Typical payload stays under 10 KB instead of dumping every issue across the whole feature.`,Me(e,{surfaceId:String(t.id),includeIssues:!0})))},()=>{try{i(K(`run_all_scenarios`,`run_all_scenarios(featureId: "${e.id}")`,`Run every Scenario through the simulator and assert against expectedStatus + expectedAssertions. Per-result parameterErrors[] and invariantViolations[] surface the cause when a scenario unexpectedly blocks.`,le({feature:e})))}catch(t){i(K(`run_all_scenarios`,`run_all_scenarios(featureId: "${e.id}")`,`Run all scenarios.`,{error:t.message}))}}];(async()=>{if(await ve(),!r())return;let t=ae(e);if(r()){E(q,{json:t,tokens:Ne(t)},!0);for(let e of a){if(await ve(),!r())return;try{e()}catch{}}r()&&E(Y,!1)}})()});let ye=b(()=>{let e=[];return d(L)&&e.push(K(`get_project`,`get_project(projectId: "${d(L).id}")`,`Full Project document (id, name, description, featureIds[], timestamps). Use list_projects for discovery first.`,d(L))),d(R)&&e.push(K(`get_project_aggregate`,`get_project_aggregate(projectId: "${d(R).projectId}")`,`Cross-feature view of a project: flat list of resources, data namespaces, registered events, and transitions, each tagged with the source feature. Use this to reason about a project as one logical surface.`,d(R))),e}),be=b(()=>[...d(J),...d(ye)]),xe=(e,t)=>t===0?`-`:`${(e/t*100).toFixed(1)}% of baseline`,Se=[{label:`Feature lifecycle`,description:`Create, update, delete and save features to disk.`,tools:[`create_feature`,`update_feature`,`delete_feature`,`save_feature`]},{label:`Surface & state`,description:`Manage surfaces, state definitions, surface-level rules, invariants, and transitions.`,tools:[`add_surface`,`remove_surface`,`update_surface`,`move_surface`,`add_state_definition`,`remove_state_definition`,`update_state_definition`,`move_state_definition`,`add_surface_rule`,`remove_surface_rule`,`update_surface_rule`,`add_surface_invariant`,`remove_surface_invariant`,`update_surface_invariant`,`add_transition`,`remove_transition`,`update_transition`]},{label:`Actions`,description:`Add, remove, reorder, and edit actions and their rules, effects, parameters, invariants, and scenarios.`,tools:[`add_action`,`remove_action`,`update_action`,`move_action`,`add_action_rule`,`remove_action_rule`,`update_action_rule`,`add_effect`,`remove_effect`,`update_effect`,`add_parameter`,`remove_parameter`,`update_parameter`,`move_parameter`,`add_action_invariant`,`remove_action_invariant`,`update_action_invariant`,`add_scenario`,`remove_scenario`,`update_scenario`]},{label:`Feature-level: invariants & liveness`,description:`Cross-surface invariants (safety - "nothing bad happens") and reachability goals (liveness - "good stays reachable": reachable / always_reachable). Checked over the whole feature by model_check and verify.`,tools:[`add_feature_invariant`,`remove_feature_invariant`,`update_feature_invariant`,`add_reachability_goal`,`remove_reachability_goal`,`update_reachability_goal`]},{label:`Events, personas, resources & entities`,description:`Manage first-class events, personas, external resources, and entity schemas.`,tools:[`add_event`,`remove_event`,`update_event`,`add_persona`,`remove_persona`,`update_persona`,`add_resource`,`remove_resource`,`update_resource`,`add_entity`,`remove_entity`,`update_entity`,`add_entity_field`,`remove_entity_field`,`update_entity_field`]},{label:`Batch`,description:`Apply multi-step mutations atomically.`,tools:[`apply_batch`]},{label:`Projects`,description:`Manage projects. A Project is the umbrella for one product or codebase; it groups many Features, where each Feature is one LLM-sized slice of behavior. Read with list_projects / get_project / get_project_aggregate (cross-feature view of resources, entities, events, transitions).`,tools:[`list_projects`,`get_project`,`get_project_aggregate`,`create_project`,`update_project`,`replace_project`,`delete_project`,`add_feature_to_project`,`remove_feature_from_project`,`move_feature_in_project`,`add_project_invariant`,`update_project_invariant`,`remove_project_invariant`]},{label:`Behavioral index & status`,description:`Read the behavioral index (.unspa.json) and sync implementation status into the dashboard.`,tools:[`get_behavioral_index`,`get_implementation_gaps`,`report_implementation_status`,`report_implementation_status_batch`,`get_implementation_status`]},{label:`Repo context`,description:`Read the .unspa.json file linking the current repo to a feature.`,tools:[`get_repo_context`]}];var Q=et();u(`1hyk95c`,e=>{r(e=>{f.title=e??``},[()=>oe(O.url,d(L)?.name,`MCP`)])});var Ce=p(Q),we=e=>{s(e,Le())},Te=n=>{var r=$e(),u=l(r),f=p(u),h=e(p(f));_(f);var g=e(f,2),b=p(g),C=p(b),w=p(C);_(C),y(4),_(b);var T=e(b,2),D=p(T),O=e(p(D),2),k=p(O,!0);_(O),y(2),_(D);var A=e(D,2),M=e(p(A),2),P=p(M,!0);_(M),y(2),_(A);var R=e(A,2),ee=e(p(R),2),te=p(ee,!0);_(ee),y(2),_(R),_(T),_(g),_(u);var B=e(u,2),ne=p(B),H=e=>{s(e,Re())},W=t=>{var n=Ve(),r=e(l(n),2);c(r,21,()=>d(U),e=>e.id,(e,t)=>{var n=ze(),r=p(n,!0);_(n);var a={};i(e=>{o(r,d(t).name),a!==(a=e)&&(n.value=(n.__value=e)??``)},[()=>String(d(t).id)]),s(e,n)}),_(r);var a=e(r,2),u=p(a);_(a);var f=e(a,2),m=e=>{s(e,Be())};x(f,e=>{d(F)&&e(m)}),i(()=>{r.disabled=d(U).length===0,o(u,`${d(U).length??``} feature${d(U).length===1?``:`s`} in this project`)}),v(r,()=>d(N),e=>E(N,e)),s(t,n)};x(ne,e=>{d(z)||G.loading&&d(U).length===0?e(H):e(W,-1)}),_(B);var re=e(B,2),ie=t=>{var n=He(),r=e(p(n));y(),_(n),i(()=>m(r,`href`,`/projects/${d(j)}`)),s(t,n)},ae=e=>{var t=Ue(),n=p(t,!0);_(t),i(()=>o(n,d(I))),s(e,t)},oe=n=>{var r=Qe(),u=p(r),f=e(p(u),2),h=p(f);c(h,17,()=>d(be),e=>e.name,(n,r)=>{var a=Ge(),c=p(a),l=p(c),u=p(l),f=p(u,!0);_(u);var h=e(u,2),g=p(h,!0);_(h);var v=e(h,2),y=p(v,!0);_(v),_(l);var b=e(l,2),S=p(b),C=p(S,!0);_(S);var w=e(S,4),T=p(w,!0);_(w),_(b),_(c);var E=e(c,2),D=e(p(E),2),O=e=>{var t=We(),n=p(t,!0);_(t),i(()=>o(n,d(X)[d(r).name])),s(e,t)};x(D,e=>{d(X)[d(r).name]&&e(O)}),_(E),_(a),i((e,t)=>{o(f,d(r).name),m(h,`title`,d(r).callSignature),o(g,d(r).callSignature),o(y,d(r).description),o(C,e),o(T,t)},[()=>d(r).tokens.toLocaleString(),()=>xe(d(r).tokens,d(q)?.tokens??0)]),t(`toggle`,E,e=>ge(d(r),e.currentTarget.open)),s(n,a)});var g=e(h,2),v=t=>{var n=Ke(),r=e(l(n),2),i=p(r),o=p(i),c=e=>{s(e,a(`Running live tool examples against the selected feature...`))},u=e=>{s(e,a(`Aggregating the whole project (loads every feature)...`))};x(o,e=>{d(Y)||d(F)?e(c):e(u,-1)}),_(i),_(r),s(t,n)};x(g,e=>{(d(Y)||d(F)||d(V))&&e(v)}),_(f),_(u);var b=e(u,2),C=p(b),w=n=>{var r=Je(),a=p(r),c=e(p(a),2),l=p(c),u=p(l,!0);_(l),y(2),_(c),_(a);var f=e(a,2),m=p(f),h=p(m);_(m);var g=e(m,2),v=e=>{var t=qe(),n=p(t,!0);_(t),i(()=>o(n,d(q).json)),s(e,t)};x(g,e=>{d(Z)&&e(v)}),_(f),_(r),i((e,t)=>{o(u,e),o(h,`Show JSON (${t??``} chars)`)},[()=>d(q).tokens.toLocaleString(),()=>d(q).json.length.toLocaleString()]),t(`toggle`,f,e=>E(Z,e.currentTarget.open,!0)),s(n,r)},T=e=>{s(e,Ye())};x(C,e=>{d(q)?e(w):e(T,-1)});var D=e(C,2),O=e(p(D),2);c(O,21,()=>Se,S,(t,n)=>{var r=Ze(),a=p(r),l=p(a,!0);_(a);var u=e(a,2),f=p(u,!0);_(u);var m=e(u,2);c(m,21,()=>d(n).tools,S,(e,t)=>{var n=Xe(),r=p(n,!0);_(n),i(()=>o(r,d(t))),s(e,n)}),_(m),_(r),i(()=>{o(l,d(n).label),o(f,d(n).description)}),s(t,r)}),_(O),_(D),_(b),_(r),i(()=>m(f,`aria-busy`,d(Y)||d(F)||d(V))),s(n,r)};x(re,e=>{d(U).length===0&&!d(z)&&!G.loading?e(ie):d(I)?e(ae,1):e(oe,-1)}),i(e=>{m(f,`href`,`/projects/${d(j)}`),o(h,` Back to ${(d(L)?d(L).name:`project`)??``}`),o(w,`Agent integration${d(L)?` · ${d(L).name}`:``}`),o(k,d(be).length),o(P,Se.length),o(te,e)},[()=>d(q)?d(q).tokens.toLocaleString():`-`]),s(n,r)};x(Ce,e=>{!d(z)&&!d(L)?e(we):e(Te,-1)}),_(Q),s(n,Q),D()}export{tt as component};
@@ -1,4 +1,4 @@
1
- import{$ as e,E as t,F as n,G as r,K as i,L as a,M as o,N as s,O as c,Q as l,R as u,S as d,V as f,Y as p,Z as m,a as h,d as g,dt as ee,gt as _,ht as v,it as y,j as b,k as te,nt as ne,tt as x,ut as re,y as S,z as C}from"../chunks/CYsLq4VE.js";import"../chunks/xihTtKlq.js";import{t as ie}from"../chunks/CgSXJuIO.js";import{n as ae}from"../chunks/niJ1Cp3-.js";import{n as oe,t as se}from"../chunks/n7xluuKn.js";import{t as ce}from"../chunks/Cbsgl_qu2.js";var w=n(`<section class="scroll-mt-24 space-y-3 border-b border-hairline pb-8 last:border-b-0"><h2 class="text-xl font-semibold tracking-tight"><a class="text-slate-950 hover:text-brand-700"> </a></h2> <div class="space-y-3 text-sm leading-7 text-slate-700"><!></div></section>`);function T(n,r){var a=w(),c=m(a),l=m(c),u=m(l,!0);_(l),_(c);var d=e(c,2);t(m(d),()=>r.children),_(d),_(a),i(()=>{g(a,`id`,r.id),g(l,`href`,`#${r.id}`),o(u,r.title)}),s(n,a)}var E=n(`<pre class="mono overflow-x-auto rounded-lg border border-[#1e293b] bg-[#020617] p-4 text-[12px] leading-relaxed text-[#eaeef4]"><code> </code></pre>`);function D(e,t){let n=h(t,`language`,3,`text`);var r=E(),a=m(r),c=m(a,!0);_(a),_(r),i(()=>{g(r,`data-lang`,n()),o(c,t.code)}),s(e,r)}var O=n(`<p class="mb-1 font-semibold"> </p>`),k=n(`<div><!> <div class="leading-6"><!></div></div>`);function A(n,r){let a=h(r,`tone`,3,`info`),c=y(()=>a()===`warning`?`bg-amber-50 border-amber-200 text-amber-900`:a()===`success`?`bg-emerald-50 border-emerald-200 text-emerald-900`:`bg-brand-50 border-brand-200 text-brand-900`);var l=k(),u=m(l),d=e=>{var t=O(),n=m(t,!0);_(t),i(()=>o(n,r.title)),s(e,t)};b(u,e=>{r.title&&e(d)});var p=e(u,2);t(m(p),()=>r.children),_(p),_(l),i(()=>S(l,1,`rounded-md border p-3 text-sm ${f(c)??``}`)),s(n,l)}var le=n(`<a class="block rounded-md px-2 py-1.5 text-slate-700 hover:bg-slate-50 hover:text-slate-950 svelte-116uhib"> </a>`),ue=n(`<p class="svelte-116uhib">AI coding workflows go sideways fast. Specs drift. Prompts pile up.
1
+ import{$ as e,E as t,F as n,G as r,K as i,L as a,M as o,N as s,O as c,Q as l,R as u,S as d,V as f,Y as p,Z as m,a as h,d as g,dt as ee,gt as _,ht as v,it as y,j as b,k as te,nt as ne,tt as x,ut as re,y as S,z as C}from"../chunks/CYsLq4VE.js";import"../chunks/xihTtKlq.js";import{t as ie}from"../chunks/BocNk-Bz.js";import{n as ae}from"../chunks/niJ1Cp3-.js";import{n as oe,t as se}from"../chunks/D54MXUmr.js";import{t as ce}from"../chunks/Cbsgl_qu2.js";var w=n(`<section class="scroll-mt-24 space-y-3 border-b border-hairline pb-8 last:border-b-0"><h2 class="text-xl font-semibold tracking-tight"><a class="text-slate-950 hover:text-brand-700"> </a></h2> <div class="space-y-3 text-sm leading-7 text-slate-700"><!></div></section>`);function T(n,r){var a=w(),c=m(a),l=m(c),u=m(l,!0);_(l),_(c);var d=e(c,2);t(m(d),()=>r.children),_(d),_(a),i(()=>{g(a,`id`,r.id),g(l,`href`,`#${r.id}`),o(u,r.title)}),s(n,a)}var E=n(`<pre class="mono overflow-x-auto rounded-lg border border-[#1e293b] bg-[#020617] p-4 text-[12px] leading-relaxed text-[#eaeef4]"><code> </code></pre>`);function D(e,t){let n=h(t,`language`,3,`text`);var r=E(),a=m(r),c=m(a,!0);_(a),_(r),i(()=>{g(r,`data-lang`,n()),o(c,t.code)}),s(e,r)}var O=n(`<p class="mb-1 font-semibold"> </p>`),k=n(`<div><!> <div class="leading-6"><!></div></div>`);function A(n,r){let a=h(r,`tone`,3,`info`),c=y(()=>a()===`warning`?`bg-amber-50 border-amber-200 text-amber-900`:a()===`success`?`bg-emerald-50 border-emerald-200 text-emerald-900`:`bg-brand-50 border-brand-200 text-brand-900`);var l=k(),u=m(l),d=e=>{var t=O(),n=m(t,!0);_(t),i(()=>o(n,r.title)),s(e,t)};b(u,e=>{r.title&&e(d)});var p=e(u,2);t(m(p),()=>r.children),_(p),_(l),i(()=>S(l,1,`rounded-md border p-3 text-sm ${f(c)??``}`)),s(n,l)}var le=n(`<a class="block rounded-md px-2 py-1.5 text-slate-700 hover:bg-slate-50 hover:text-slate-950 svelte-116uhib"> </a>`),ue=n(`<p class="svelte-116uhib">AI coding workflows go sideways fast. Specs drift. Prompts pile up.
2
2
  Generated systems lose coherence. The reason is almost always the
3
3
  same: humans and LLMs share <strong class="svelte-116uhib">prose</strong>, markdown specs, giant prompts, chat history,
4
4
  scattered README fragments, and prose has no runtime. Nothing executes
@@ -0,0 +1 @@
1
+ import{G as e,S as t,Y as n,dt as r,o as i,ut as a}from"../chunks/CYsLq4VE.js";import"../chunks/xihTtKlq.js";import{t as o}from"../chunks/BocNk-Bz.js";import"../chunks/DkAKB9py.js";import{t as s}from"../chunks/Cbsgl_qu2.js";import{t as c}from"../chunks/DtgkZP4Z2.js";function l(l,u){r(u,!1),i(),t(`1uha8ag`,t=>{e(e=>{n.title=e??``},[()=>s(o.url,`Projects`)])}),c(l,{}),a()}export{l as component};
@@ -0,0 +1 @@
1
+ � �̶��f�A�����r��O�@��ka��m��Eq�Y�-Oox��^ZZN�h7���x|:{�� �<�����Ή�K�J��|Cu��O�d����-