@codeyam/codeyam-cli 0.1.23 → 0.1.24

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 (64) hide show
  1. package/analyzer-template/.build-info.json +7 -7
  2. package/analyzer-template/log.txt +3 -3
  3. package/analyzer-template/packages/database/src/lib/loadAnalysis.ts +7 -1
  4. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.d.ts.map +1 -1
  5. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js +7 -1
  6. package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js.map +1 -1
  7. package/analyzer-template/project/runMultiScenarioServer.ts +26 -3
  8. package/background/src/lib/virtualized/project/runMultiScenarioServer.js +23 -3
  9. package/background/src/lib/virtualized/project/runMultiScenarioServer.js.map +1 -1
  10. package/codeyam-cli/src/commands/__tests__/editor.designSystem.test.js +30 -0
  11. package/codeyam-cli/src/commands/__tests__/editor.designSystem.test.js.map +1 -0
  12. package/codeyam-cli/src/commands/editor.js +72 -23
  13. package/codeyam-cli/src/commands/editor.js.map +1 -1
  14. package/codeyam-cli/src/data/designSystems.js +27 -0
  15. package/codeyam-cli/src/data/designSystems.js.map +1 -0
  16. package/codeyam-cli/src/utils/__tests__/editorApi.test.js +44 -0
  17. package/codeyam-cli/src/utils/__tests__/editorApi.test.js.map +1 -1
  18. package/codeyam-cli/src/utils/editorApi.js +16 -0
  19. package/codeyam-cli/src/utils/editorApi.js.map +1 -1
  20. package/codeyam-cli/src/utils/queue/__tests__/job.interactiveStart.test.js +159 -0
  21. package/codeyam-cli/src/utils/queue/__tests__/job.interactiveStart.test.js.map +1 -0
  22. package/codeyam-cli/src/utils/queue/job.js +9 -1
  23. package/codeyam-cli/src/utils/queue/job.js.map +1 -1
  24. package/codeyam-cli/src/webserver/__tests__/api.interactive-switch-scenario.test.js +98 -0
  25. package/codeyam-cli/src/webserver/__tests__/api.interactive-switch-scenario.test.js.map +1 -0
  26. package/codeyam-cli/src/webserver/app/routes/api.interactive-switch-scenario.js +34 -0
  27. package/codeyam-cli/src/webserver/app/routes/api.interactive-switch-scenario.js.map +1 -0
  28. package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-CKeQT5Ty.js → InteractivePreview-DtYTSPL2.js} +1 -1
  29. package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-DUMfcNVK.js → ScenarioViewer-CefgqbCr.js} +1 -1
  30. package/codeyam-cli/src/webserver/build/client/assets/Spinner-Bc8BG-Lw.js +34 -0
  31. package/codeyam-cli/src/webserver/build/client/assets/{_index-BAWd-Xjf.js → _index-C1YkzTAV.js} +1 -1
  32. package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-BOARiB-g.js → activity.(_tab)-yH46LLUz.js} +1 -1
  33. package/codeyam-cli/src/webserver/build/client/assets/api.editor-verify-routes-l0sNRNKZ.js +1 -0
  34. package/codeyam-cli/src/webserver/build/client/assets/api.interactive-switch-scenario-l0sNRNKZ.js +1 -0
  35. package/codeyam-cli/src/webserver/build/client/assets/{dev.empty-C8y4mmyv.js → dev.empty-CRepiabR.js} +1 -1
  36. package/codeyam-cli/src/webserver/build/client/assets/{editor.entity.(_sha)-DMv5ESGo.js → editor.entity.(_sha)-oBrbke_R.js} +16 -16
  37. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-ByHz6rAQ.js → entity._sha._-DYJRGiDI.js} +1 -1
  38. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.dev-CmLO432x.js → entity._sha.scenarios._scenarioId.dev-wdiwx5-Z.js} +1 -1
  39. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.fullscreen-Bz9sCUF_.js → entity._sha.scenarios._scenarioId.fullscreen-BrkN-40Y.js} +1 -1
  40. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-DQM8E7L4.js → entity._sha_.create-scenario-DxfhekTZ.js} +1 -1
  41. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-CAoXLsQr.js → entity._sha_.edit._scenarioId-CRXJWmpB.js} +1 -1
  42. package/codeyam-cli/src/webserver/build/client/assets/manifest-694b698a.js +1 -0
  43. package/codeyam-cli/src/webserver/build/client/assets/{root-D2_tktnk.js → root-DXjFYOxD.js} +1 -1
  44. package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-D9QZKaLJ.js +2 -0
  45. package/codeyam-cli/src/webserver/build/server/assets/{analysisRunner-By5slFjw.js → analysisRunner-zEYtiv0T.js} +1 -1
  46. package/codeyam-cli/src/webserver/build/server/assets/{index-DXaOwBnm.js → index-CcHPEbhi.js} +1 -1
  47. package/codeyam-cli/src/webserver/build/server/assets/{init-CLG1LjQM.js → init-D68IyWbU.js} +1 -1
  48. package/codeyam-cli/src/webserver/build/server/assets/{server-build-NZmUqQv6.js → server-build-Cxzo0Zp2.js} +147 -147
  49. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  50. package/codeyam-cli/src/webserver/build-info.json +5 -5
  51. package/codeyam-cli/src/webserver/terminalServer.js +1 -2
  52. package/codeyam-cli/src/webserver/terminalServer.js.map +1 -1
  53. package/codeyam-cli/templates/design-systems/clean-dashboard-design-system.md +255 -0
  54. package/codeyam-cli/templates/design-systems/editorial-design-system.md +267 -0
  55. package/codeyam-cli/templates/design-systems/mono-brutalist-design-system.md +256 -0
  56. package/codeyam-cli/templates/design-systems/neo-brutalist-design-system.md +294 -0
  57. package/codeyam-cli/templates/nextjs-prisma-sqlite/seed-adapter.ts +10 -5
  58. package/codeyam-cli/templates/seed-adapters/supabase.ts +14 -5
  59. package/package.json +1 -1
  60. package/packages/database/src/lib/loadAnalysis.js +7 -1
  61. package/packages/database/src/lib/loadAnalysis.js.map +1 -1
  62. package/codeyam-cli/src/webserver/build/client/assets/Spinner-D0LgAaSa.js +0 -34
  63. package/codeyam-cli/src/webserver/build/client/assets/manifest-1a45e154.js +0 -1
  64. package/codeyam-cli/src/webserver/build/client/assets/useLastLogLine-BNd5hYuW.js +0 -2
@@ -1,4 +1,4 @@
1
- import{L as J,r as L,f as dm,d as ze,b as Hm,R as Oe,J as at,g as Gm,c as $m,w as Wm,u as Vm,j as Ym,a as Km}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{j as n}from"./jsx-runtime-D_zvdyIk.js";import{u as Xm}from"./useLastLogLine-BNd5hYuW.js";import{u as Zm}from"./Spinner-D0LgAaSa.js";import{W as Qm,I as Jm}from"./InteractivePreview-CKeQT5Ty.js";import{S as We}from"./SafeScreenshot-DanvyBPb.js";import{L as ef}from"./LibraryFunctionPreview-D3s1MFkb.js";import{L as tf}from"./LoadingDots-By5zI316.js";import{g as rf}from"./scenarioStatus-B_8jpV3e.js";import{E as af,S as nf}from"./ScenarioViewer-DUMfcNVK.js";import{c as of}from"./createLucideIcon-4ImjHTVC.js";import{c as pm,g as sf}from"./executionFlowCoverage-BWhdfn70.js";import{E as kl}from"./EntityTypeIcon-CD7lGABo.js";import{C as gm}from"./CopyButton-CLe80MMu.js";import{L as lf}from"./LogViewer-CM5zg40N.js";import{M as cf}from"./MiniClaudeChat-CQENLSrF.js";import{u as uf}from"./useReportContext-Cy5Qg_UR.js";import"./preload-helper-ckwbz45p.js";import"./InlineSpinner-CgTNOhnu.js";import"./ViewportInspectBar-BA_Ry-rs.js";import"./useCustomSizes-DhXHbEjP.js";import"./ReportIssueModal-C2PLkej3.js";import"./circle-check-DFcQkN5j.js";import"./triangle-alert-DqJ0j69l.js";import"./copy-C6iF61Xs.js";/**
1
+ import{L as J,r as L,f as dm,d as ze,b as Hm,R as Oe,J as at,g as Gm,c as $m,w as Wm,u as Vm,j as Ym,a as Km}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{j as n}from"./jsx-runtime-D_zvdyIk.js";import{u as Xm}from"./useLastLogLine-D9QZKaLJ.js";import{u as Zm}from"./Spinner-Bc8BG-Lw.js";import{W as Qm,I as Jm}from"./InteractivePreview-DtYTSPL2.js";import{S as We}from"./SafeScreenshot-DanvyBPb.js";import{L as ef}from"./LibraryFunctionPreview-D3s1MFkb.js";import{L as tf}from"./LoadingDots-By5zI316.js";import{g as rf}from"./scenarioStatus-B_8jpV3e.js";import{E as af,S as nf}from"./ScenarioViewer-CefgqbCr.js";import{c as of}from"./createLucideIcon-4ImjHTVC.js";import{c as pm,g as sf}from"./executionFlowCoverage-BWhdfn70.js";import{E as kl}from"./EntityTypeIcon-CD7lGABo.js";import{C as gm}from"./CopyButton-CLe80MMu.js";import{L as lf}from"./LogViewer-CM5zg40N.js";import{M as cf}from"./MiniClaudeChat-CQENLSrF.js";import{u as uf}from"./useReportContext-Cy5Qg_UR.js";import"./preload-helper-ckwbz45p.js";import"./InlineSpinner-CgTNOhnu.js";import"./ViewportInspectBar-BA_Ry-rs.js";import"./useCustomSizes-DhXHbEjP.js";import"./ReportIssueModal-C2PLkej3.js";import"./circle-check-DFcQkN5j.js";import"./triangle-alert-DqJ0j69l.js";import"./copy-C6iF61Xs.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{a as V,w as re,u as oe,r as i}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{u as le,S as W}from"./Spinner-D0LgAaSa.js";import{u as ce}from"./useLastLogLine-BNd5hYuW.js";import{V as de}from"./ViewportInspectBar-BA_Ry-rs.js";import{u as he,S as xe}from"./useCustomSizes-DhXHbEjP.js";import{c as me}from"./cy-logo-cli-Coe5NhbS.js";import{I as E}from"./InlineSpinner-CgTNOhnu.js";import{a as ue,T as pe,D as ge}from"./editorPreview-CluPkvXJ.js";import{S as fe}from"./SafeScreenshot-DanvyBPb.js";import"./preload-helper-ckwbz45p.js";function ve({scenarios:w,currentScenarioId:r,entitySha:s,cacheBuster:l}){const c=V();return w.length===0?e.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:e.jsx("p",{className:"text-gray-500 text-sm",children:"No scenarios found"})}):e.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-3",children:w.map(o=>{var j,u;const g=o.id===r,f=(u=(j=o.metadata)==null?void 0:j.screenshotPaths)==null?void 0:u[0];return e.jsxs("button",{onClick:()=>{c(`/entity/${s}/scenarios/${o.id}/dev`)},className:`w-full text-left rounded-lg overflow-hidden border transition-colors cursor-pointer flex ${g?"border-[#005c75] bg-[#1a3a44]":"border-[#3d3d3d] bg-[#252525] hover:border-[#555]"}`,children:[e.jsx("div",{className:"w-24 h-20 shrink-0 bg-[#1a1a1a]",children:e.jsx(fe,{screenshotPath:f,cacheBuster:l,alt:o.name,className:"w-full h-full object-cover object-top"})}),e.jsxs("div",{className:"p-2.5 min-w-0 flex-1",children:[e.jsxs("div",{className:"text-white text-sm font-medium truncate",children:[g&&e.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-[#005c75] mr-1.5 relative top-[-1px]"}),o.name]}),o.description&&e.jsx("div",{className:"text-gray-400 text-xs mt-1 line-clamp-2",children:o.description})]})]},o.id)})})}const I=[{name:"Mobile",width:375,height:667},{name:"Tablet",width:768,height:1024},{name:"Laptop",width:1024,height:768},{name:"Desktop",width:1440,height:900}],De=re(function(){const{entity:r,scenario:s,analysis:l,projectSlug:c}=oe(),o=V(),g=i.useRef(null),f=i.useRef(null),[j,u]=i.useState(null),[A,M]=i.useState(1440),[n,N]=i.useState({name:"Desktop",width:1440,height:900}),[H,y]=i.useState(!1),[S,U]=i.useState(null),[d,k]=i.useState("chat"),[F,q]=i.useState(0),[D,$]=i.useState(null),K=i.useCallback(t=>{$(t||null),q(a=>a+1)},[]),{customSizes:_,addCustomSize:Y}=he(c),v=i.useMemo(()=>[...I,..._],[_]),{interactiveServerUrl:h,isStarting:C,isLoading:z,showIframe:B,iframeKey:G,onIframeLoad:J}=le({analysisId:l==null?void 0:l.id,scenarioId:s==null?void 0:s.id,scenarioName:s==null?void 0:s.name,projectSlug:c,enabled:!0,refreshTrigger:F}),O=i.useMemo(()=>ue(h,D),[h,D]),{lastLine:b}=ce(c,C||z),Q=()=>{o(`/entity/${r.sha}`)},X=(t,a)=>{M(t);const m=v.find(T=>T.width===t&&T.height===a);u(m||null),N({name:(m==null?void 0:m.name)||"Custom",width:t,height:a})},R=t=>{u(t),M(t.width),N({name:t.name,width:t.width,height:t.height})},Z=t=>{Y(t,n.width,n.height??900),y(!1),N(a=>({...a,name:t}))},ee=()=>{var a;k("chat"),(a=f.current)==null||a.sendInput("Create a new scenario for this entity based on the work we've just done. Create a name and description that reflects what the live preview is showing. Use the scenario data you've changed to create a new scenario in the database. If the data structure was fixed in any way you need to update that in the database as well and backfill all existing scenarios, then save to the database and capture a screenshot. Remember the database is at `.codeyam/db.sqlite3`, the scenarios table has all scenarios and the analyses table contains the scenariosDataStructure is its metadata.")},x=((l==null?void 0:l.scenarios)||[]).filter(t=>{var a;return!((a=t.metadata)!=null&&a.sameAsDefault)}),p=x.findIndex(t=>t.id===(s==null?void 0:s.id)),te=p+1,se=x.length,L=p>0,P=p<x.length-1,ae=()=>{if(L){const t=x[p-1];o(`/entity/${r.sha}/scenarios/${t.id}/dev`)}},ne=()=>{if(P){const t=x[p+1];o(`/entity/${r.sha}/scenarios/${t.id}/dev`)}},ie=C||z||!B;return e.jsxs("div",{className:"fixed inset-0 bg-[#2d2d2d] flex flex-col",children:[e.jsxs("div",{className:"bg-[#3d3d3d] h-12 flex items-center px-4 gap-4 shrink-0 z-20",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("img",{src:me,alt:"CodeYam",className:"h-6 brightness-0 invert"}),e.jsx("span",{className:"text-white font-medium text-sm whitespace-nowrap",children:r.name}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("button",{onClick:ae,disabled:!L,className:`${L?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Previous scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsxs("span",{className:"text-gray-400 text-sm",children:[te,"/",se]}),e.jsx("button",{onClick:ne,disabled:!P,className:`${P?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Next scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M7.5 15L12.5 10L7.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-2 min-w-0",children:[e.jsx("span",{className:"text-white font-semibold text-xs whitespace-nowrap shrink-0",children:s==null?void 0:s.name}),(s==null?void 0:s.description)&&e.jsxs("div",{className:"relative group min-w-0",children:[e.jsx("span",{className:"text-gray-400 text-xs truncate block",children:s.description}),e.jsx("div",{className:"absolute left-0 top-full mt-1 hidden group-hover:block z-50 bg-black text-white text-xs px-3 py-2 rounded shadow-lg max-w-md",children:s.description})]})]}),e.jsx("span",{className:"bg-[#005c75] text-white text-[10px] font-bold px-2 py-0.5 rounded uppercase tracking-wider ml-2",children:"Dev Mode"})]}),e.jsx("button",{onClick:Q,className:"text-white hover:text-gray-300 transition-colors ml-4","aria-label":"Close dev mode",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"flex-1 flex min-h-0",children:[e.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[e.jsxs("div",{className:"bg-[#e5e7eb] border-b border-[rgba(0,0,0,0.1)] shrink-0 z-10 h-6 flex items-center justify-center relative",children:[e.jsx("div",{className:"absolute inset-0 flex justify-center",children:e.jsx("div",{style:{maxWidth:`${I[I.length-1].width}px`,width:"100%"},children:e.jsx(de,{currentViewportWidth:A,currentPresetName:n.name,onDevicePresetClick:R,devicePresets:v,hideLabel:!0,onHoverChange:U,lightMode:!0})})}),e.jsxs("div",{className:"relative z-10 flex items-center gap-2",children:[e.jsxs("div",{className:"relative w-28 h-5",children:[e.jsxs("div",{className:"absolute inset-0 bg-white text-gray-900 text-xs px-2 rounded flex items-center justify-between pointer-events-none border border-gray-300",children:[e.jsx("span",{className:"leading-none",children:(S==null?void 0:S.name)||n.name}),e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsxs("select",{value:n.name,onChange:t=>{const a=v.find(m=>m.name===t.target.value);a&&R(a)},className:"relative w-full h-full opacity-0 cursor-pointer",children:[v.map(t=>e.jsx("option",{value:t.name,children:t.name},t.name)),n.name==="Custom"&&e.jsx("option",{value:"Custom",children:"Custom"})]})]}),e.jsx("input",{type:"number",value:n.width,onChange:t=>{const a=parseInt(t.target.value,10);!isNaN(a)&&a>0&&X(a,n.height??900)},className:"bg-white text-gray-900 text-xs px-1 rounded border border-gray-300 outline-none w-16 text-center h-5 leading-none",min:"200",max:"3840"}),e.jsx("span",{className:"text-gray-400 text-xs h-5 flex items-center leading-none",children:"x"}),e.jsx("span",{className:"bg-gray-100 text-gray-600 text-xs px-1 rounded w-14 text-center h-5 flex items-center justify-center leading-none",children:n.height??900}),n.name==="Custom"&&e.jsx("button",{onClick:()=>y(!0),className:"bg-white text-gray-900 text-xs px-2 rounded h-5 flex items-center leading-none border border-gray-300 hover:bg-gray-50 transition-colors",children:"Save"})]})]}),e.jsx("div",{className:"flex-1 flex items-center justify-center overflow-auto p-8",style:{backgroundImage:`
1
+ import{a as V,w as re,u as oe,r as i}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{u as le,S as W}from"./Spinner-Bc8BG-Lw.js";import{u as ce}from"./useLastLogLine-D9QZKaLJ.js";import{V as de}from"./ViewportInspectBar-BA_Ry-rs.js";import{u as he,S as xe}from"./useCustomSizes-DhXHbEjP.js";import{c as me}from"./cy-logo-cli-Coe5NhbS.js";import{I as E}from"./InlineSpinner-CgTNOhnu.js";import{a as ue,T as pe,D as ge}from"./editorPreview-CluPkvXJ.js";import{S as fe}from"./SafeScreenshot-DanvyBPb.js";import"./preload-helper-ckwbz45p.js";function ve({scenarios:w,currentScenarioId:r,entitySha:s,cacheBuster:l}){const c=V();return w.length===0?e.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:e.jsx("p",{className:"text-gray-500 text-sm",children:"No scenarios found"})}):e.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-3",children:w.map(o=>{var j,u;const g=o.id===r,f=(u=(j=o.metadata)==null?void 0:j.screenshotPaths)==null?void 0:u[0];return e.jsxs("button",{onClick:()=>{c(`/entity/${s}/scenarios/${o.id}/dev`)},className:`w-full text-left rounded-lg overflow-hidden border transition-colors cursor-pointer flex ${g?"border-[#005c75] bg-[#1a3a44]":"border-[#3d3d3d] bg-[#252525] hover:border-[#555]"}`,children:[e.jsx("div",{className:"w-24 h-20 shrink-0 bg-[#1a1a1a]",children:e.jsx(fe,{screenshotPath:f,cacheBuster:l,alt:o.name,className:"w-full h-full object-cover object-top"})}),e.jsxs("div",{className:"p-2.5 min-w-0 flex-1",children:[e.jsxs("div",{className:"text-white text-sm font-medium truncate",children:[g&&e.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-[#005c75] mr-1.5 relative top-[-1px]"}),o.name]}),o.description&&e.jsx("div",{className:"text-gray-400 text-xs mt-1 line-clamp-2",children:o.description})]})]},o.id)})})}const I=[{name:"Mobile",width:375,height:667},{name:"Tablet",width:768,height:1024},{name:"Laptop",width:1024,height:768},{name:"Desktop",width:1440,height:900}],De=re(function(){const{entity:r,scenario:s,analysis:l,projectSlug:c}=oe(),o=V(),g=i.useRef(null),f=i.useRef(null),[j,u]=i.useState(null),[A,M]=i.useState(1440),[n,N]=i.useState({name:"Desktop",width:1440,height:900}),[H,y]=i.useState(!1),[S,U]=i.useState(null),[d,k]=i.useState("chat"),[F,q]=i.useState(0),[D,$]=i.useState(null),K=i.useCallback(t=>{$(t||null),q(a=>a+1)},[]),{customSizes:_,addCustomSize:Y}=he(c),v=i.useMemo(()=>[...I,..._],[_]),{interactiveServerUrl:h,isStarting:C,isLoading:z,showIframe:B,iframeKey:G,onIframeLoad:J}=le({analysisId:l==null?void 0:l.id,scenarioId:s==null?void 0:s.id,scenarioName:s==null?void 0:s.name,projectSlug:c,enabled:!0,refreshTrigger:F}),O=i.useMemo(()=>ue(h,D),[h,D]),{lastLine:b}=ce(c,C||z),Q=()=>{o(`/entity/${r.sha}`)},X=(t,a)=>{M(t);const m=v.find(T=>T.width===t&&T.height===a);u(m||null),N({name:(m==null?void 0:m.name)||"Custom",width:t,height:a})},R=t=>{u(t),M(t.width),N({name:t.name,width:t.width,height:t.height})},Z=t=>{Y(t,n.width,n.height??900),y(!1),N(a=>({...a,name:t}))},ee=()=>{var a;k("chat"),(a=f.current)==null||a.sendInput("Create a new scenario for this entity based on the work we've just done. Create a name and description that reflects what the live preview is showing. Use the scenario data you've changed to create a new scenario in the database. If the data structure was fixed in any way you need to update that in the database as well and backfill all existing scenarios, then save to the database and capture a screenshot. Remember the database is at `.codeyam/db.sqlite3`, the scenarios table has all scenarios and the analyses table contains the scenariosDataStructure is its metadata.")},x=((l==null?void 0:l.scenarios)||[]).filter(t=>{var a;return!((a=t.metadata)!=null&&a.sameAsDefault)}),p=x.findIndex(t=>t.id===(s==null?void 0:s.id)),te=p+1,se=x.length,L=p>0,P=p<x.length-1,ae=()=>{if(L){const t=x[p-1];o(`/entity/${r.sha}/scenarios/${t.id}/dev`)}},ne=()=>{if(P){const t=x[p+1];o(`/entity/${r.sha}/scenarios/${t.id}/dev`)}},ie=C||z||!B;return e.jsxs("div",{className:"fixed inset-0 bg-[#2d2d2d] flex flex-col",children:[e.jsxs("div",{className:"bg-[#3d3d3d] h-12 flex items-center px-4 gap-4 shrink-0 z-20",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("img",{src:me,alt:"CodeYam",className:"h-6 brightness-0 invert"}),e.jsx("span",{className:"text-white font-medium text-sm whitespace-nowrap",children:r.name}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("button",{onClick:ae,disabled:!L,className:`${L?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Previous scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsxs("span",{className:"text-gray-400 text-sm",children:[te,"/",se]}),e.jsx("button",{onClick:ne,disabled:!P,className:`${P?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Next scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M7.5 15L12.5 10L7.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-2 min-w-0",children:[e.jsx("span",{className:"text-white font-semibold text-xs whitespace-nowrap shrink-0",children:s==null?void 0:s.name}),(s==null?void 0:s.description)&&e.jsxs("div",{className:"relative group min-w-0",children:[e.jsx("span",{className:"text-gray-400 text-xs truncate block",children:s.description}),e.jsx("div",{className:"absolute left-0 top-full mt-1 hidden group-hover:block z-50 bg-black text-white text-xs px-3 py-2 rounded shadow-lg max-w-md",children:s.description})]})]}),e.jsx("span",{className:"bg-[#005c75] text-white text-[10px] font-bold px-2 py-0.5 rounded uppercase tracking-wider ml-2",children:"Dev Mode"})]}),e.jsx("button",{onClick:Q,className:"text-white hover:text-gray-300 transition-colors ml-4","aria-label":"Close dev mode",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"flex-1 flex min-h-0",children:[e.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[e.jsxs("div",{className:"bg-[#e5e7eb] border-b border-[rgba(0,0,0,0.1)] shrink-0 z-10 h-6 flex items-center justify-center relative",children:[e.jsx("div",{className:"absolute inset-0 flex justify-center",children:e.jsx("div",{style:{maxWidth:`${I[I.length-1].width}px`,width:"100%"},children:e.jsx(de,{currentViewportWidth:A,currentPresetName:n.name,onDevicePresetClick:R,devicePresets:v,hideLabel:!0,onHoverChange:U,lightMode:!0})})}),e.jsxs("div",{className:"relative z-10 flex items-center gap-2",children:[e.jsxs("div",{className:"relative w-28 h-5",children:[e.jsxs("div",{className:"absolute inset-0 bg-white text-gray-900 text-xs px-2 rounded flex items-center justify-between pointer-events-none border border-gray-300",children:[e.jsx("span",{className:"leading-none",children:(S==null?void 0:S.name)||n.name}),e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsxs("select",{value:n.name,onChange:t=>{const a=v.find(m=>m.name===t.target.value);a&&R(a)},className:"relative w-full h-full opacity-0 cursor-pointer",children:[v.map(t=>e.jsx("option",{value:t.name,children:t.name},t.name)),n.name==="Custom"&&e.jsx("option",{value:"Custom",children:"Custom"})]})]}),e.jsx("input",{type:"number",value:n.width,onChange:t=>{const a=parseInt(t.target.value,10);!isNaN(a)&&a>0&&X(a,n.height??900)},className:"bg-white text-gray-900 text-xs px-1 rounded border border-gray-300 outline-none w-16 text-center h-5 leading-none",min:"200",max:"3840"}),e.jsx("span",{className:"text-gray-400 text-xs h-5 flex items-center leading-none",children:"x"}),e.jsx("span",{className:"bg-gray-100 text-gray-600 text-xs px-1 rounded w-14 text-center h-5 flex items-center justify-center leading-none",children:n.height??900}),n.name==="Custom"&&e.jsx("button",{onClick:()=>y(!0),className:"bg-white text-gray-900 text-xs px-2 rounded h-5 flex items-center leading-none border border-gray-300 hover:bg-gray-50 transition-colors",children:"Save"})]})]}),e.jsx("div",{className:"flex-1 flex items-center justify-center overflow-auto p-8",style:{backgroundImage:`
2
2
  linear-gradient(45deg, #ebebeb 25%, transparent 25%),
3
3
  linear-gradient(-45deg, #ebebeb 25%, transparent 25%),
4
4
  linear-gradient(45deg, transparent 75%, #ebebeb 75%),
@@ -1,4 +1,4 @@
1
- import{w as X,u as Z,a as ee,b as te,r as i}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{u as se,S as z}from"./Spinner-D0LgAaSa.js";import{u as ne}from"./useLastLogLine-BNd5hYuW.js";import{V as ae}from"./ViewportInspectBar-BA_Ry-rs.js";import{u as ie,S as re}from"./useCustomSizes-DhXHbEjP.js";import{c as oe}from"./cy-logo-cli-Coe5NhbS.js";import{I as B}from"./InlineSpinner-CgTNOhnu.js";const N=[{name:"Mobile",width:375,height:667},{name:"Tablet",width:768,height:1024},{name:"Laptop",width:1024,height:768},{name:"Desktop",width:1920,height:1080}],ve=X(function(){const{entity:o,scenario:s,analysis:l,projectSlug:p}=Z(),f=ee();te();const[ce,y]=i.useState(null),[E,k]=i.useState(1920),[a,v]=i.useState({name:"Desktop",width:1920,height:1080}),[W,b]=i.useState(!1),[w,D]=i.useState(null),{customSizes:C,addCustomSize:R}=ie(p),h=i.useMemo(()=>[...N,...C],[C]),x=i.useRef(null),[H,U]=i.useState(1),m=i.useCallback(()=>{if(!x.current)return;const t=32,n=x.current.clientWidth-t,r=x.current.clientHeight-t,_=a.width,g=a.height??900,Q=Math.min(1,n/_,r/g);U(Q)},[a.width,a.height]);i.useEffect(()=>(m(),window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)),[m]);const{interactiveServerUrl:L,isStarting:I,isLoading:M,showIframe:P,iframeKey:V,onIframeLoad:T}=se({analysisId:l==null?void 0:l.id,scenarioId:s==null?void 0:s.id,scenarioName:s==null?void 0:s.name,projectSlug:p,enabled:!0}),{lastLine:u}=ne(p,I||M),A=()=>{f(`/entity/${o.sha}`)},F=(t,n)=>{k(t);const r=h.find(g=>g.width===t&&g.height===n);y(r||null),v({name:(r==null?void 0:r.name)||"Custom",width:t,height:n})},$=t=>{y(t),k(t.width),v({name:t.name,width:t.width,height:t.height})},K=t=>{R(t,a.width,a.height??900),b(!1),v(n=>({...n,name:t}))},c=((l==null?void 0:l.scenarios)||[]).filter(t=>{var n;return!((n=t.metadata)!=null&&n.sameAsDefault)}),d=c.findIndex(t=>t.id===(s==null?void 0:s.id)),O=d+1,Y=c.length,j=d>0,S=d<c.length-1,q=()=>{if(j){const t=c[d-1],n=encodeURIComponent(`/entity/${o.sha}/scenarios/${t.id}/fullscreen`);f(`/entity/${o.sha}/scenarios/${t.id}/fullscreen?from=${n}`)}},G=()=>{if(S){const t=c[d+1],n=encodeURIComponent(`/entity/${o.sha}/scenarios/${t.id}/fullscreen`);f(`/entity/${o.sha}/scenarios/${t.id}/fullscreen?from=${n}`)}},J=I||M||!P;return e.jsxs("div",{className:"fixed inset-0 bg-[#2d2d2d] flex flex-col",children:[e.jsxs("div",{className:"bg-[#3d3d3d] h-12 flex items-center px-4 gap-4 shrink-0 z-20",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("img",{src:oe,alt:"CodeYam",className:"h-6 brightness-0 invert"}),e.jsx("span",{className:"text-white font-medium text-sm whitespace-nowrap",children:o.name}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("button",{onClick:q,disabled:!j,className:`${j?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Previous scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsxs("span",{className:"text-gray-400 text-sm",children:[O,"/",Y]}),e.jsx("button",{onClick:G,disabled:!S,className:`${S?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Next scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M7.5 15L12.5 10L7.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-2 min-w-0",children:[e.jsx("span",{className:"text-white font-semibold text-xs whitespace-nowrap shrink-0",children:s==null?void 0:s.name}),(s==null?void 0:s.description)&&e.jsxs("div",{className:"relative group min-w-0",children:[e.jsx("span",{className:"text-gray-400 text-xs truncate block",children:s.description}),e.jsx("div",{className:"absolute left-0 top-full mt-1 hidden group-hover:block z-50 bg-black text-white text-xs px-3 py-2 rounded shadow-lg max-w-md",children:s.description})]})]})]}),e.jsx("button",{onClick:A,className:"text-white hover:text-gray-300 transition-colors ml-4","aria-label":"Close fullscreen",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"bg-[#e5e7eb] border-b border-[rgba(0,0,0,0.1)] shrink-0 z-10 h-6 flex items-center justify-center relative",children:[e.jsx("div",{className:"absolute inset-0 flex justify-center",children:e.jsx("div",{style:{maxWidth:`${N[N.length-1].width}px`,width:"100%"},children:e.jsx(ae,{currentViewportWidth:E,currentPresetName:a.name,onDevicePresetClick:$,devicePresets:h,hideLabel:!0,onHoverChange:D,lightMode:!0})})}),e.jsxs("div",{className:"relative z-10 flex items-center gap-2",children:[e.jsxs("div",{className:"relative w-28 h-5",children:[e.jsxs("div",{className:"absolute inset-0 bg-white text-gray-900 text-xs px-2 rounded flex items-center justify-between pointer-events-none border border-gray-300",children:[e.jsx("span",{className:"leading-none",children:(w==null?void 0:w.name)||a.name}),e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsxs("select",{value:a.name,onChange:t=>{const n=h.find(r=>r.name===t.target.value);n&&$(n)},className:"relative w-full h-full opacity-0 cursor-pointer",children:[h.map(t=>e.jsx("option",{value:t.name,children:t.name},t.name)),a.name==="Custom"&&e.jsx("option",{value:"Custom",children:"Custom"})]})]}),e.jsx("input",{type:"number",value:a.width,onChange:t=>{const n=parseInt(t.target.value,10);!isNaN(n)&&n>0&&F(n,a.height??900)},className:"bg-white text-gray-900 text-xs px-1 rounded border border-gray-300 outline-none w-16 text-center h-5 leading-none",min:"200",max:"3840"}),e.jsx("span",{className:"text-gray-400 text-xs h-5 flex items-center leading-none",children:"×"}),e.jsx("span",{className:"bg-gray-100 text-gray-600 text-xs px-1 rounded w-14 text-center h-5 flex items-center justify-center leading-none",children:a.height??900}),a.name==="Custom"&&e.jsx("button",{onClick:()=>b(!0),className:"bg-white text-gray-900 text-xs px-2 rounded h-5 flex items-center leading-none border border-gray-300 hover:bg-gray-50 transition-colors",children:"Save"})]})]}),e.jsx("div",{ref:x,className:"flex-1 flex items-center justify-center overflow-hidden p-4",style:{backgroundImage:`
1
+ import{w as X,u as Z,a as ee,b as te,r as i}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{u as se,S as z}from"./Spinner-Bc8BG-Lw.js";import{u as ne}from"./useLastLogLine-D9QZKaLJ.js";import{V as ae}from"./ViewportInspectBar-BA_Ry-rs.js";import{u as ie,S as re}from"./useCustomSizes-DhXHbEjP.js";import{c as oe}from"./cy-logo-cli-Coe5NhbS.js";import{I as B}from"./InlineSpinner-CgTNOhnu.js";const N=[{name:"Mobile",width:375,height:667},{name:"Tablet",width:768,height:1024},{name:"Laptop",width:1024,height:768},{name:"Desktop",width:1920,height:1080}],ve=X(function(){const{entity:o,scenario:s,analysis:l,projectSlug:p}=Z(),f=ee();te();const[ce,y]=i.useState(null),[E,k]=i.useState(1920),[a,v]=i.useState({name:"Desktop",width:1920,height:1080}),[W,b]=i.useState(!1),[w,D]=i.useState(null),{customSizes:C,addCustomSize:R}=ie(p),h=i.useMemo(()=>[...N,...C],[C]),x=i.useRef(null),[H,U]=i.useState(1),m=i.useCallback(()=>{if(!x.current)return;const t=32,n=x.current.clientWidth-t,r=x.current.clientHeight-t,_=a.width,g=a.height??900,Q=Math.min(1,n/_,r/g);U(Q)},[a.width,a.height]);i.useEffect(()=>(m(),window.addEventListener("resize",m),()=>window.removeEventListener("resize",m)),[m]);const{interactiveServerUrl:L,isStarting:I,isLoading:M,showIframe:P,iframeKey:V,onIframeLoad:T}=se({analysisId:l==null?void 0:l.id,scenarioId:s==null?void 0:s.id,scenarioName:s==null?void 0:s.name,projectSlug:p,enabled:!0}),{lastLine:u}=ne(p,I||M),A=()=>{f(`/entity/${o.sha}`)},F=(t,n)=>{k(t);const r=h.find(g=>g.width===t&&g.height===n);y(r||null),v({name:(r==null?void 0:r.name)||"Custom",width:t,height:n})},$=t=>{y(t),k(t.width),v({name:t.name,width:t.width,height:t.height})},K=t=>{R(t,a.width,a.height??900),b(!1),v(n=>({...n,name:t}))},c=((l==null?void 0:l.scenarios)||[]).filter(t=>{var n;return!((n=t.metadata)!=null&&n.sameAsDefault)}),d=c.findIndex(t=>t.id===(s==null?void 0:s.id)),O=d+1,Y=c.length,j=d>0,S=d<c.length-1,q=()=>{if(j){const t=c[d-1],n=encodeURIComponent(`/entity/${o.sha}/scenarios/${t.id}/fullscreen`);f(`/entity/${o.sha}/scenarios/${t.id}/fullscreen?from=${n}`)}},G=()=>{if(S){const t=c[d+1],n=encodeURIComponent(`/entity/${o.sha}/scenarios/${t.id}/fullscreen`);f(`/entity/${o.sha}/scenarios/${t.id}/fullscreen?from=${n}`)}},J=I||M||!P;return e.jsxs("div",{className:"fixed inset-0 bg-[#2d2d2d] flex flex-col",children:[e.jsxs("div",{className:"bg-[#3d3d3d] h-12 flex items-center px-4 gap-4 shrink-0 z-20",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("img",{src:oe,alt:"CodeYam",className:"h-6 brightness-0 invert"}),e.jsx("span",{className:"text-white font-medium text-sm whitespace-nowrap",children:o.name}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx("button",{onClick:q,disabled:!j,className:`${j?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Previous scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M12.5 15L7.5 10L12.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsxs("span",{className:"text-gray-400 text-sm",children:[O,"/",Y]}),e.jsx("button",{onClick:G,disabled:!S,className:`${S?"text-white hover:text-gray-300":"text-gray-600 cursor-not-allowed"} transition-colors`,"aria-label":"Next scenario",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M7.5 15L12.5 10L7.5 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-2 min-w-0",children:[e.jsx("span",{className:"text-white font-semibold text-xs whitespace-nowrap shrink-0",children:s==null?void 0:s.name}),(s==null?void 0:s.description)&&e.jsxs("div",{className:"relative group min-w-0",children:[e.jsx("span",{className:"text-gray-400 text-xs truncate block",children:s.description}),e.jsx("div",{className:"absolute left-0 top-full mt-1 hidden group-hover:block z-50 bg-black text-white text-xs px-3 py-2 rounded shadow-lg max-w-md",children:s.description})]})]})]}),e.jsx("button",{onClick:A,className:"text-white hover:text-gray-300 transition-colors ml-4","aria-label":"Close fullscreen",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:e.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"bg-[#e5e7eb] border-b border-[rgba(0,0,0,0.1)] shrink-0 z-10 h-6 flex items-center justify-center relative",children:[e.jsx("div",{className:"absolute inset-0 flex justify-center",children:e.jsx("div",{style:{maxWidth:`${N[N.length-1].width}px`,width:"100%"},children:e.jsx(ae,{currentViewportWidth:E,currentPresetName:a.name,onDevicePresetClick:$,devicePresets:h,hideLabel:!0,onHoverChange:D,lightMode:!0})})}),e.jsxs("div",{className:"relative z-10 flex items-center gap-2",children:[e.jsxs("div",{className:"relative w-28 h-5",children:[e.jsxs("div",{className:"absolute inset-0 bg-white text-gray-900 text-xs px-2 rounded flex items-center justify-between pointer-events-none border border-gray-300",children:[e.jsx("span",{className:"leading-none",children:(w==null?void 0:w.name)||a.name}),e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),e.jsxs("select",{value:a.name,onChange:t=>{const n=h.find(r=>r.name===t.target.value);n&&$(n)},className:"relative w-full h-full opacity-0 cursor-pointer",children:[h.map(t=>e.jsx("option",{value:t.name,children:t.name},t.name)),a.name==="Custom"&&e.jsx("option",{value:"Custom",children:"Custom"})]})]}),e.jsx("input",{type:"number",value:a.width,onChange:t=>{const n=parseInt(t.target.value,10);!isNaN(n)&&n>0&&F(n,a.height??900)},className:"bg-white text-gray-900 text-xs px-1 rounded border border-gray-300 outline-none w-16 text-center h-5 leading-none",min:"200",max:"3840"}),e.jsx("span",{className:"text-gray-400 text-xs h-5 flex items-center leading-none",children:"×"}),e.jsx("span",{className:"bg-gray-100 text-gray-600 text-xs px-1 rounded w-14 text-center h-5 flex items-center justify-center leading-none",children:a.height??900}),a.name==="Custom"&&e.jsx("button",{onClick:()=>b(!0),className:"bg-white text-gray-900 text-xs px-2 rounded h-5 flex items-center leading-none border border-gray-300 hover:bg-gray-50 transition-colors",children:"Save"})]})]}),e.jsx("div",{ref:x,className:"flex-1 flex items-center justify-center overflow-hidden p-4",style:{backgroundImage:`
2
2
  linear-gradient(45deg, #ebebeb 25%, transparent 25%),
3
3
  linear-gradient(-45deg, #ebebeb 25%, transparent 25%),
4
4
  linear-gradient(45deg, transparent 75%, #ebebeb 75%),
@@ -1,4 +1,4 @@
1
- import{r as a,w as Z,u as ee,a as te,L as v}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{W as se,u as re,I as ae}from"./InteractivePreview-CKeQT5Ty.js";import{u as ne}from"./Spinner-D0LgAaSa.js";import{c as oe}from"./executionFlowCoverage-BWhdfn70.js";import"./preload-helper-ckwbz45p.js";import"./useLastLogLine-BNd5hYuW.js";import"./InlineSpinner-CgTNOhnu.js";function ie({executionFlows:t,selections:r,onChange:n,disabled:i=!1}){const x=a.useCallback(s=>r.some(o=>o.flowId===s),[r]),p=a.useCallback(s=>{x(s.id)?n(r.filter(o=>o.flowId!==s.id)):n([...r,{flowId:s.id,flowName:s.name}])},[r,n,x]);return t.length===0?e.jsx("div",{className:"text-sm text-gray-500 py-2",children:"No execution flows found."}):e.jsx("div",{className:"space-y-3",children:t.map(s=>{const o=x(s.id),I=s.usedInScenarios.length>0;return e.jsxs("div",{className:"border-b border-gray-100 pb-3 last:border-0 last:pb-0",children:[e.jsxs("label",{className:"flex items-start gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:()=>p(s),disabled:i,className:"mt-0.5 h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"font-mono text-sm font-medium text-gray-900",children:s.name}),!I&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-amber-100 text-amber-700 rounded",children:"uncovered"}),s.blocksOtherFlows&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-purple-100 text-purple-700 rounded",children:"blocking"}),s.impact==="high"&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-red-100 text-red-700 rounded",children:"high impact"})]}),s.description&&e.jsx("p",{className:"text-xs text-gray-500 mt-0.5 m-0",children:s.description})]})]}),o&&s.requiredValues.length>0&&e.jsxs("div",{className:"ml-6 mt-2 p-2 bg-gray-50 rounded text-xs",children:[e.jsx("span",{className:"text-gray-700 font-medium",children:"Required values:"}),e.jsx("ul",{className:"m-0 mt-1 pl-4 space-y-0.5",children:s.requiredValues.map((h,E)=>e.jsxs("li",{className:"text-gray-600",children:[e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:h.attributePath})," ",e.jsx("span",{className:"text-gray-400",children:h.comparison})," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:h.value})]},E))})]})]},s.id)})})}const be=({data:t})=>[{title:t!=null&&t.entity?`Create Scenario - ${t.entity.name} - CodeYam`:"Create Scenario - CodeYam"},{name:"description",content:"Create a new scenario"}];function ce(){var W;const{analysis:t,defaultScenario:r,entity:n,entitySha:i,projectSlug:x}=ee(),p=te(),{iframeRef:s}=re(),[o,I]=a.useState(""),[h,E]=a.useState(400),[b,P]=a.useState(!1),[U,R]=a.useState(!1),[G,$]=a.useState(!1),[M,L]=a.useState(null),[F,l]=a.useState(null),[d,H]=a.useState([]),D=a.useMemo(()=>{var c;return!((c=t==null?void 0:t.metadata)!=null&&c.executionFlows)||!(t!=null&&t.scenarios)?[]:oe(t.metadata.executionFlows,t.scenarios).executionFlows},[t]),{interactiveServerUrl:y,isStarting:J,isLoading:_,showIframe:q,iframeKey:B,onIframeLoad:V}=ne({analysisId:t==null?void 0:t.id,scenarioId:r==null?void 0:r.id,scenarioName:r==null?void 0:r.name,projectSlug:x,enabled:!0}),Y=a.useCallback(async()=>{var m,c,T,z;if(!o.trim()&&d.length===0){L("Please describe how you want to change the scenario or select execution flows");return}R(!0),L(null),l("Generating scenario with AI...");try{const u=await fetch("/api/generate-scenario-data",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:o,existingScenarios:t.scenarios,scenariosDataStructure:(m=t.metadata)==null?void 0:m.scenariosDataStructure,flowSelections:d.length>0?d:void 0})}),N=await u.json();if(!u.ok||!N.success)throw new Error(N.error||"Failed to generate scenario data");console.log("[CreateScenario] AI generated scenario:",N.data);const g=N.data;if(!g.name||!g.data)throw new Error("AI response missing required fields (name or data)");l("Saving new scenario..."),$(!0);const X={name:g.name,description:g.description||o,metadata:{data:g.data,interactiveExamplePath:(c=r.metadata)==null?void 0:c.interactiveExamplePath}},Q=[...t.scenarios||[],X],O=await fetch("/api/save-scenarios",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({analysis:t,scenarios:Q})}),C=await O.json();if(!O.ok||!C.success)throw new Error(C.error||"Failed to save scenario");console.log("[CreateScenario] Scenario saved:",C);const f=(z=(T=C.analysis)==null?void 0:T.scenarios)==null?void 0:z.find(k=>k.name===g.name);if(!(f!=null&&f.id)){console.warn("[CreateScenario] Could not find saved scenario ID, navigating to entity page"),l("Scenario created! Redirecting..."),setTimeout(()=>void p(`/entity/${i}`),1e3);return}if(y){l("Capturing screenshot...");const k=await fetch("/api/capture-screenshot",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverUrl:y,scenarioId:f.id,projectId:t.projectId,viewportWidth:1440})}),A=await k.json();!k.ok||!A.success?(console.error("[CreateScenario] Capture failed:",A),l("Scenario created! (Screenshot capture failed)")):l("Scenario created and captured!")}else l("Scenario created!");setTimeout(()=>{p(`/entity/${i}/scenarios/${f.id}`)},1e3)}catch(u){console.error("[CreateScenario] Error:",u),L(u instanceof Error?u.message:String(u)),l(null)}finally{R(!1),$(!1)}},[o,d,t,r,i,y,p]),j=U||G,K=a.useCallback(()=>{P(!0)},[]),w=a.useCallback(m=>{if(!b)return;const c=m.clientX;c>=250&&c<=600&&E(c)},[b]),S=a.useCallback(()=>{P(!1)},[]);return a.useEffect(()=>(b?(document.addEventListener("mousemove",w),document.addEventListener("mouseup",S)):(document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",S)),()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",S)}),[b,w,S]),e.jsxs("div",{className:"h-screen bg-white flex flex-col overflow-hidden",children:[e.jsx("header",{className:"bg-white border-b border-gray-200 shrink-0 relative h-[54px]",children:e.jsxs("div",{className:"flex items-end h-full px-6 gap-6",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1 pb-[14px]",children:[e.jsx("button",{onClick:()=>void p(`/entity/${i}`),className:"no-underline shrink-0 bg-transparent border-none cursor-pointer p-0 flex items-center",title:"Back",children:e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",children:e.jsx("path",{d:"M13 8.5H4M4 8.5L8.5 4M4 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("h1",{className:"text-base font-semibold text-black m-0 leading-[20px] shrink-0",children:n==null?void 0:n.name}),e.jsx("span",{className:"text-xs text-[#9e9e9e] font-mono font-normal whitespace-nowrap overflow-hidden text-ellipsis min-w-0",title:n==null?void 0:n.filePath,children:n==null?void 0:n.filePath})]}),e.jsxs("div",{className:"flex items-end gap-8 shrink-0",children:[e.jsx(v,{to:`/entity/${i}/scenarios`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-medium border-b-2",style:{color:"#005C75",borderColor:"#005C75"},children:e.jsxs("span",{className:"flex items-center gap-2",children:["Scenarios",e.jsx("span",{className:"inline-flex items-center justify-center px-2 py-0.5 text-xs font-semibold rounded-full bg-[#cbf3fa] text-[#005c75]",children:((W=t==null?void 0:t.scenarios)==null?void 0:W.length)||0})]})}),e.jsx(v,{to:`/entity/${i}/related`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"Related Entities"}),e.jsx(v,{to:`/entity/${i}/code`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"Code"}),e.jsx(v,{to:`/entity/${i}/data`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"Data Structure"}),e.jsx(v,{to:`/entity/${i}/history`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"History"})]})]})}),e.jsxs("div",{className:"flex flex-1 gap-0 min-h-0 relative",children:[e.jsxs("aside",{className:"bg-white border-r border-gray-200 overflow-y-auto shrink-0 p-6 flex flex-col",style:{width:`${h}px`},children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Default Scenario Preview"}),e.jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:"The preview on the right shows the Default Scenario. Select execution flows and/or describe how you'd like to change it."})]}),D.length>0&&e.jsxs("details",{className:"mb-4 border border-gray-200 rounded-lg",children:[e.jsxs("summary",{className:"px-3 py-2 text-sm font-medium text-gray-700 cursor-pointer hover:bg-gray-50 rounded-lg",children:["Select Execution Flows"," ",d.length>0&&e.jsxs("span",{className:"text-blue-600",children:["(",d.length," selected)"]})]}),e.jsx("div",{className:"px-3 pb-3 pt-1 border-t border-gray-100",children:e.jsx(ie,{executionFlows:D,selections:d,onChange:H,disabled:j})})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"prompt",className:"block text-sm font-medium text-gray-700 mb-2",children:"Describe your scenario"}),e.jsx("textarea",{id:"prompt",value:o,onChange:m=>I(m.target.value),placeholder:"e.g., Show an empty state with no items...",className:"w-full h-32 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 text-sm resize-none",disabled:j})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("button",{onClick:()=>void Y(),disabled:j||!o.trim()&&d.length===0,className:"w-full px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium cursor-pointer transition-colors hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed",children:j?"Creating...":"Create Scenario"}),F&&e.jsx("div",{className:"text-xs text-blue-600 bg-blue-50 px-2 py-1.5 rounded",children:F}),M&&e.jsx("div",{className:"text-xs text-red-600 bg-red-50 px-2 py-1.5 rounded",children:M})]})]}),e.jsxs("div",{onMouseDown:K,style:{width:"20px",position:"absolute",top:0,left:`${h-10}px`,bottom:0,cursor:"col-resize",touchAction:"none",userSelect:"none",zIndex:100,pointerEvents:"auto"},children:[e.jsx("div",{style:{position:"absolute",left:"10px",top:0,bottom:0,width:"1px",background:b?"#005c75":"rgba(0,0,0,0.1)",transition:"background 0.15s ease"}}),e.jsx("div",{style:{position:"absolute",top:"50%",left:"10px",transform:"translate(-50%, -50%)",width:"8px",height:"40px",background:"#fff",border:"1px solid rgba(0,0,0,0.15)",borderRadius:"4px",cursor:"col-resize"}})]}),e.jsx("main",{className:"flex-1 overflow-auto flex items-center justify-center min-w-0",style:{backgroundImage:`
1
+ import{r as a,w as Z,u as ee,a as te,L as v}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{W as se,u as re,I as ae}from"./InteractivePreview-DtYTSPL2.js";import{u as ne}from"./Spinner-Bc8BG-Lw.js";import{c as oe}from"./executionFlowCoverage-BWhdfn70.js";import"./preload-helper-ckwbz45p.js";import"./useLastLogLine-D9QZKaLJ.js";import"./InlineSpinner-CgTNOhnu.js";function ie({executionFlows:t,selections:r,onChange:n,disabled:i=!1}){const x=a.useCallback(s=>r.some(o=>o.flowId===s),[r]),p=a.useCallback(s=>{x(s.id)?n(r.filter(o=>o.flowId!==s.id)):n([...r,{flowId:s.id,flowName:s.name}])},[r,n,x]);return t.length===0?e.jsx("div",{className:"text-sm text-gray-500 py-2",children:"No execution flows found."}):e.jsx("div",{className:"space-y-3",children:t.map(s=>{const o=x(s.id),I=s.usedInScenarios.length>0;return e.jsxs("div",{className:"border-b border-gray-100 pb-3 last:border-0 last:pb-0",children:[e.jsxs("label",{className:"flex items-start gap-2 cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:()=>p(s),disabled:i,className:"mt-0.5 h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"font-mono text-sm font-medium text-gray-900",children:s.name}),!I&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-amber-100 text-amber-700 rounded",children:"uncovered"}),s.blocksOtherFlows&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-purple-100 text-purple-700 rounded",children:"blocking"}),s.impact==="high"&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-red-100 text-red-700 rounded",children:"high impact"})]}),s.description&&e.jsx("p",{className:"text-xs text-gray-500 mt-0.5 m-0",children:s.description})]})]}),o&&s.requiredValues.length>0&&e.jsxs("div",{className:"ml-6 mt-2 p-2 bg-gray-50 rounded text-xs",children:[e.jsx("span",{className:"text-gray-700 font-medium",children:"Required values:"}),e.jsx("ul",{className:"m-0 mt-1 pl-4 space-y-0.5",children:s.requiredValues.map((h,E)=>e.jsxs("li",{className:"text-gray-600",children:[e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:h.attributePath})," ",e.jsx("span",{className:"text-gray-400",children:h.comparison})," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:h.value})]},E))})]})]},s.id)})})}const be=({data:t})=>[{title:t!=null&&t.entity?`Create Scenario - ${t.entity.name} - CodeYam`:"Create Scenario - CodeYam"},{name:"description",content:"Create a new scenario"}];function ce(){var W;const{analysis:t,defaultScenario:r,entity:n,entitySha:i,projectSlug:x}=ee(),p=te(),{iframeRef:s}=re(),[o,I]=a.useState(""),[h,E]=a.useState(400),[b,P]=a.useState(!1),[U,R]=a.useState(!1),[G,$]=a.useState(!1),[M,L]=a.useState(null),[F,l]=a.useState(null),[d,H]=a.useState([]),D=a.useMemo(()=>{var c;return!((c=t==null?void 0:t.metadata)!=null&&c.executionFlows)||!(t!=null&&t.scenarios)?[]:oe(t.metadata.executionFlows,t.scenarios).executionFlows},[t]),{interactiveServerUrl:y,isStarting:J,isLoading:_,showIframe:q,iframeKey:B,onIframeLoad:V}=ne({analysisId:t==null?void 0:t.id,scenarioId:r==null?void 0:r.id,scenarioName:r==null?void 0:r.name,projectSlug:x,enabled:!0}),Y=a.useCallback(async()=>{var m,c,T,z;if(!o.trim()&&d.length===0){L("Please describe how you want to change the scenario or select execution flows");return}R(!0),L(null),l("Generating scenario with AI...");try{const u=await fetch("/api/generate-scenario-data",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:o,existingScenarios:t.scenarios,scenariosDataStructure:(m=t.metadata)==null?void 0:m.scenariosDataStructure,flowSelections:d.length>0?d:void 0})}),N=await u.json();if(!u.ok||!N.success)throw new Error(N.error||"Failed to generate scenario data");console.log("[CreateScenario] AI generated scenario:",N.data);const g=N.data;if(!g.name||!g.data)throw new Error("AI response missing required fields (name or data)");l("Saving new scenario..."),$(!0);const X={name:g.name,description:g.description||o,metadata:{data:g.data,interactiveExamplePath:(c=r.metadata)==null?void 0:c.interactiveExamplePath}},Q=[...t.scenarios||[],X],O=await fetch("/api/save-scenarios",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({analysis:t,scenarios:Q})}),C=await O.json();if(!O.ok||!C.success)throw new Error(C.error||"Failed to save scenario");console.log("[CreateScenario] Scenario saved:",C);const f=(z=(T=C.analysis)==null?void 0:T.scenarios)==null?void 0:z.find(k=>k.name===g.name);if(!(f!=null&&f.id)){console.warn("[CreateScenario] Could not find saved scenario ID, navigating to entity page"),l("Scenario created! Redirecting..."),setTimeout(()=>void p(`/entity/${i}`),1e3);return}if(y){l("Capturing screenshot...");const k=await fetch("/api/capture-screenshot",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({serverUrl:y,scenarioId:f.id,projectId:t.projectId,viewportWidth:1440})}),A=await k.json();!k.ok||!A.success?(console.error("[CreateScenario] Capture failed:",A),l("Scenario created! (Screenshot capture failed)")):l("Scenario created and captured!")}else l("Scenario created!");setTimeout(()=>{p(`/entity/${i}/scenarios/${f.id}`)},1e3)}catch(u){console.error("[CreateScenario] Error:",u),L(u instanceof Error?u.message:String(u)),l(null)}finally{R(!1),$(!1)}},[o,d,t,r,i,y,p]),j=U||G,K=a.useCallback(()=>{P(!0)},[]),w=a.useCallback(m=>{if(!b)return;const c=m.clientX;c>=250&&c<=600&&E(c)},[b]),S=a.useCallback(()=>{P(!1)},[]);return a.useEffect(()=>(b?(document.addEventListener("mousemove",w),document.addEventListener("mouseup",S)):(document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",S)),()=>{document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",S)}),[b,w,S]),e.jsxs("div",{className:"h-screen bg-white flex flex-col overflow-hidden",children:[e.jsx("header",{className:"bg-white border-b border-gray-200 shrink-0 relative h-[54px]",children:e.jsxs("div",{className:"flex items-end h-full px-6 gap-6",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1 pb-[14px]",children:[e.jsx("button",{onClick:()=>void p(`/entity/${i}`),className:"no-underline shrink-0 bg-transparent border-none cursor-pointer p-0 flex items-center",title:"Back",children:e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",children:e.jsx("path",{d:"M13 8.5H4M4 8.5L8.5 4M4 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("h1",{className:"text-base font-semibold text-black m-0 leading-[20px] shrink-0",children:n==null?void 0:n.name}),e.jsx("span",{className:"text-xs text-[#9e9e9e] font-mono font-normal whitespace-nowrap overflow-hidden text-ellipsis min-w-0",title:n==null?void 0:n.filePath,children:n==null?void 0:n.filePath})]}),e.jsxs("div",{className:"flex items-end gap-8 shrink-0",children:[e.jsx(v,{to:`/entity/${i}/scenarios`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-medium border-b-2",style:{color:"#005C75",borderColor:"#005C75"},children:e.jsxs("span",{className:"flex items-center gap-2",children:["Scenarios",e.jsx("span",{className:"inline-flex items-center justify-center px-2 py-0.5 text-xs font-semibold rounded-full bg-[#cbf3fa] text-[#005c75]",children:((W=t==null?void 0:t.scenarios)==null?void 0:W.length)||0})]})}),e.jsx(v,{to:`/entity/${i}/related`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"Related Entities"}),e.jsx(v,{to:`/entity/${i}/code`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"Code"}),e.jsx(v,{to:`/entity/${i}/data`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"Data Structure"}),e.jsx(v,{to:`/entity/${i}/history`,className:"relative pb-[17px] px-2 text-sm transition-colors cursor-pointer no-underline font-normal hover:text-gray-700",style:{color:"#9ca3af"},children:"History"})]})]})}),e.jsxs("div",{className:"flex flex-1 gap-0 min-h-0 relative",children:[e.jsxs("aside",{className:"bg-white border-r border-gray-200 overflow-y-auto shrink-0 p-6 flex flex-col",style:{width:`${h}px`},children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Default Scenario Preview"}),e.jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:"The preview on the right shows the Default Scenario. Select execution flows and/or describe how you'd like to change it."})]}),D.length>0&&e.jsxs("details",{className:"mb-4 border border-gray-200 rounded-lg",children:[e.jsxs("summary",{className:"px-3 py-2 text-sm font-medium text-gray-700 cursor-pointer hover:bg-gray-50 rounded-lg",children:["Select Execution Flows"," ",d.length>0&&e.jsxs("span",{className:"text-blue-600",children:["(",d.length," selected)"]})]}),e.jsx("div",{className:"px-3 pb-3 pt-1 border-t border-gray-100",children:e.jsx(ie,{executionFlows:D,selections:d,onChange:H,disabled:j})})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{htmlFor:"prompt",className:"block text-sm font-medium text-gray-700 mb-2",children:"Describe your scenario"}),e.jsx("textarea",{id:"prompt",value:o,onChange:m=>I(m.target.value),placeholder:"e.g., Show an empty state with no items...",className:"w-full h-32 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 text-sm resize-none",disabled:j})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("button",{onClick:()=>void Y(),disabled:j||!o.trim()&&d.length===0,className:"w-full px-4 py-2 bg-blue-600 text-white rounded-lg text-sm font-medium cursor-pointer transition-colors hover:bg-blue-700 disabled:bg-gray-400 disabled:cursor-not-allowed",children:j?"Creating...":"Create Scenario"}),F&&e.jsx("div",{className:"text-xs text-blue-600 bg-blue-50 px-2 py-1.5 rounded",children:F}),M&&e.jsx("div",{className:"text-xs text-red-600 bg-red-50 px-2 py-1.5 rounded",children:M})]})]}),e.jsxs("div",{onMouseDown:K,style:{width:"20px",position:"absolute",top:0,left:`${h-10}px`,bottom:0,cursor:"col-resize",touchAction:"none",userSelect:"none",zIndex:100,pointerEvents:"auto"},children:[e.jsx("div",{style:{position:"absolute",left:"10px",top:0,bottom:0,width:"1px",background:b?"#005c75":"rgba(0,0,0,0.1)",transition:"background 0.15s ease"}}),e.jsx("div",{style:{position:"absolute",top:"50%",left:"10px",transform:"translate(-50%, -50%)",width:"8px",height:"40px",background:"#fff",border:"1px solid rgba(0,0,0,0.15)",borderRadius:"4px",cursor:"col-resize"}})]}),e.jsx("main",{className:"flex-1 overflow-auto flex items-center justify-center min-w-0",style:{backgroundImage:`
2
2
  linear-gradient(45deg, #ebebeb 25%, transparent 25%),
3
3
  linear-gradient(-45deg, #ebebeb 25%, transparent 25%),
4
4
  linear-gradient(45deg, transparent 75%, #ebebeb 75%),
@@ -1,4 +1,4 @@
1
- import{r as l,w as Y,u as K,a as Q,L as z}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{W as X,u as Z,I as ee}from"./InteractivePreview-CKeQT5Ty.js";import{u as te}from"./Spinner-D0LgAaSa.js";import"./preload-helper-ckwbz45p.js";import"./useLastLogLine-BNd5hYuW.js";import"./InlineSpinner-CgTNOhnu.js";function U(t,n,r){if(Array.isArray(t)){if(!isNaN(parseInt(n)))return t[parseInt(n)];for(const s of t)if(s.name===n||s.title===n||s.id===n)return s}return t[n]}function q(t){return t&&(typeof t=="object"||Array.isArray(t))}function re(t){return Array.isArray(t)?t.length:void 0}function ne(t){const{data:n,structure:r}=t;if(!(!n&&!r)){if(Array.isArray(r))return Array.isArray(n)?n.map((s,d)=>d.toString()):[];if(typeof r=="object")return[...new Set([...Object.keys(n),...Object.keys(r)])].sort((d,o)=>{const p=q(n[d]),c=q(n[o]);return p&&!c?1:!p&&c?-1:d.localeCompare(o)});if(typeof n=="object")return Object.keys(n).sort((d,o)=>d.localeCompare(o))}}function se({scenarioFormData:t,handleInputChange:n}){return e.jsxs("div",{className:"p-3 flex flex-col gap-3",children:[e.jsxs("div",{className:"grid w-full max-w-sm items-center gap-1.5",children:[e.jsx("label",{htmlFor:"name",className:"text-sm font-medium text-gray-700",children:"Name"}),e.jsx("input",{type:"text",id:"name",placeholder:"Name",name:"name",value:t.name,onChange:n,required:!0,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),e.jsxs("div",{className:"grid w-full gap-1.5 pt-2",children:[e.jsx("label",{htmlFor:"description",className:"text-sm font-medium text-gray-700",children:"Description"}),e.jsx("textarea",{placeholder:"Type your message here.",id:"description",name:"description",value:t.description,onChange:n,required:!0,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 min-h-[100px]"})]}),e.jsx("button",{type:"submit",className:"mt-3 w-full px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 font-medium",children:"Save Name & Description"})]})}function ae({path:t,namedPath:n,isArray:r,count:s,onClick:d}){const o=l.useCallback(()=>{d&&d(t)},[d,t]);return e.jsxs("div",{className:"bg-blue-50 p-3 rounded-lg flex items-center justify-between cursor-pointer group hover:bg-blue-100 transition-colors border border-blue-200",onClick:o,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[r&&e.jsx("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})}),e.jsxs("div",{className:"capitalize font-medium text-gray-900",children:[n[n.length-1],s!==void 0&&` (${s})`]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[r&&e.jsx("svg",{className:"w-5 h-5 text-red-500 opacity-0 group-hover:opacity-100 transition-opacity",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),e.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})}var V=(t=>(t.STRING="string",t.NUMBER="number",t.BOOLEAN="boolean",t.UNION="union",t.OBJECT="object",t.ARRAY="array",t))(V||{});const oe=({name:t,value:n,options:r,onChange:s})=>{const d=l.useCallback(o=>{s({target:{name:t,value:o.target.value}})},[t,s]);return e.jsx("select",{name:t,value:n,onChange:d,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",children:r.map((o,p)=>e.jsx("option",{value:o.trim(),children:o.trim()},p))})},ie=({name:t,value:n,onChange:r})=>{const s=l.useCallback(d=>{const o=d.target.checked;r({target:{name:t,value:o}})},[t,r]);return e.jsx("label",{className:"flex items-center gap-2 cursor-pointer",children:e.jsx("input",{type:"checkbox",name:t,checked:n,onChange:s,className:`w-10 h-6 rounded-full appearance-none cursor-pointer transition-colors relative
1
+ import{r as l,w as Y,u as K,a as Q,L as z}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{W as X,u as Z,I as ee}from"./InteractivePreview-DtYTSPL2.js";import{u as te}from"./Spinner-Bc8BG-Lw.js";import"./preload-helper-ckwbz45p.js";import"./useLastLogLine-D9QZKaLJ.js";import"./InlineSpinner-CgTNOhnu.js";function U(t,n,r){if(Array.isArray(t)){if(!isNaN(parseInt(n)))return t[parseInt(n)];for(const s of t)if(s.name===n||s.title===n||s.id===n)return s}return t[n]}function q(t){return t&&(typeof t=="object"||Array.isArray(t))}function re(t){return Array.isArray(t)?t.length:void 0}function ne(t){const{data:n,structure:r}=t;if(!(!n&&!r)){if(Array.isArray(r))return Array.isArray(n)?n.map((s,d)=>d.toString()):[];if(typeof r=="object")return[...new Set([...Object.keys(n),...Object.keys(r)])].sort((d,o)=>{const p=q(n[d]),c=q(n[o]);return p&&!c?1:!p&&c?-1:d.localeCompare(o)});if(typeof n=="object")return Object.keys(n).sort((d,o)=>d.localeCompare(o))}}function se({scenarioFormData:t,handleInputChange:n}){return e.jsxs("div",{className:"p-3 flex flex-col gap-3",children:[e.jsxs("div",{className:"grid w-full max-w-sm items-center gap-1.5",children:[e.jsx("label",{htmlFor:"name",className:"text-sm font-medium text-gray-700",children:"Name"}),e.jsx("input",{type:"text",id:"name",placeholder:"Name",name:"name",value:t.name,onChange:n,required:!0,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"})]}),e.jsxs("div",{className:"grid w-full gap-1.5 pt-2",children:[e.jsx("label",{htmlFor:"description",className:"text-sm font-medium text-gray-700",children:"Description"}),e.jsx("textarea",{placeholder:"Type your message here.",id:"description",name:"description",value:t.description,onChange:n,required:!0,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 min-h-[100px]"})]}),e.jsx("button",{type:"submit",className:"mt-3 w-full px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 font-medium",children:"Save Name & Description"})]})}function ae({path:t,namedPath:n,isArray:r,count:s,onClick:d}){const o=l.useCallback(()=>{d&&d(t)},[d,t]);return e.jsxs("div",{className:"bg-blue-50 p-3 rounded-lg flex items-center justify-between cursor-pointer group hover:bg-blue-100 transition-colors border border-blue-200",onClick:o,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[r&&e.jsx("svg",{className:"w-4 h-4 text-gray-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})}),e.jsxs("div",{className:"capitalize font-medium text-gray-900",children:[n[n.length-1],s!==void 0&&` (${s})`]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[r&&e.jsx("svg",{className:"w-5 h-5 text-red-500 opacity-0 group-hover:opacity-100 transition-opacity",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),e.jsx("svg",{className:"w-4 h-4 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})}var V=(t=>(t.STRING="string",t.NUMBER="number",t.BOOLEAN="boolean",t.UNION="union",t.OBJECT="object",t.ARRAY="array",t))(V||{});const oe=({name:t,value:n,options:r,onChange:s})=>{const d=l.useCallback(o=>{s({target:{name:t,value:o.target.value}})},[t,s]);return e.jsx("select",{name:t,value:n,onChange:d,className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",children:r.map((o,p)=>e.jsx("option",{value:o.trim(),children:o.trim()},p))})},ie=({name:t,value:n,onChange:r})=>{const s=l.useCallback(d=>{const o=d.target.checked;r({target:{name:t,value:o}})},[t,r]);return e.jsx("label",{className:"flex items-center gap-2 cursor-pointer",children:e.jsx("input",{type:"checkbox",name:t,checked:n,onChange:s,className:`w-10 h-6 rounded-full appearance-none cursor-pointer transition-colors relative
2
2
  bg-gray-300 checked:bg-blue-600
3
3
  after:content-[''] after:absolute after:top-1 after:left-1 after:w-4 after:h-4
4
4
  after:bg-white after:rounded-full after:transition-transform
@@ -0,0 +1 @@
1
+ window.__reactRouterManifest={"entry":{"module":"/assets/entry.client-SuW9syRS.js","imports":["/assets/jsx-runtime-D_zvdyIk.js","/assets/chunk-JZWAC4HX-BAdwhyCx.js","/assets/index-CWV9XZiG.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":true,"module":"/assets/root-DXjFYOxD.js","imports":["/assets/jsx-runtime-D_zvdyIk.js","/assets/chunk-JZWAC4HX-BAdwhyCx.js","/assets/index-CWV9XZiG.js","/assets/preload-helper-ckwbz45p.js","/assets/cy-logo-cli-Coe5NhbS.js","/assets/ReportIssueModal-C2PLkej3.js","/assets/useReportContext-Cy5Qg_UR.js","/assets/loader-circle-De-7qQ2u.js","/assets/createLucideIcon-4ImjHTVC.js","/assets/book-open-CL-lMgHh.js","/assets/useToast-5HR2j9ZE.js","/assets/useLastLogLine-D9QZKaLJ.js","/assets/LogViewer-CM5zg40N.js","/assets/EntityTypeIcon-CD7lGABo.js","/assets/TruncatedFilePath-CK7-NaPZ.js","/assets/chevron-down-GmAjGS9-.js","/assets/circle-check-DFcQkN5j.js","/assets/CopyButton-CLe80MMu.js","/assets/triangle-alert-DqJ0j69l.js","/assets/copy-C6iF61Xs.js"],"css":[]},"routes/entity.$sha.scenarios.$scenarioId.fullscreen":{"id":"routes/entity.$sha.scenarios.$scenarioId.fullscreen","parentId":"root","path":"entity/:sha/scenarios/:scenarioId/fullscreen","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/entity._sha.scenarios._scenarioId.fullscreen-BrkN-40Y.js","imports":["/assets/chunk-JZWAC4HX-BAdwhyCx.js","/assets/jsx-runtime-D_zvdyIk.js","/assets/Spinner-Bc8BG-Lw.js","/assets/useLastLogLine-D9QZKaLJ.js","/assets/ViewportInspectBar-BA_Ry-rs.js","/assets/useCustomSizes-DhXHbEjP.js","/assets/cy-logo-cli-Coe5NhbS.js","/assets/InlineSpinner-CgTNOhnu.js"],"css":[]},"routes/entity.$sha.scenarios.$scenarioId.dev":{"id":"routes/entity.$sha.scenarios.$scenarioId.dev","parentId":"root","path":"entity/:sha/scenarios/:scenarioId/dev","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/entity._sha.scenarios._scenarioId.dev-wdiwx5-Z.js","imports":["/assets/chunk-JZWAC4HX-BAdwhyCx.js","/assets/jsx-runtime-D_zvdyIk.js","/assets/Spinner-Bc8BG-Lw.js","/assets/useLastLogLine-D9QZKaLJ.js","/assets/ViewportInspectBar-BA_Ry-rs.js","/assets/useCustomSizes-DhXHbEjP.js","/assets/cy-logo-cli-Coe5NhbS.js","/assets/InlineSpinner-CgTNOhnu.js","/assets/editorPreview-CluPkvXJ.js","/assets/SafeScreenshot-DanvyBPb.js","/assets/preload-helper-ckwbz45p.js"],"css":[]},"routes/api.interactive-switch-scenario":{"id":"routes/api.interactive-switch-scenario","parentId":"root","path":"api/interactive-switch-scenario","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.interactive-switch-scenario-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-journal-screenshot":{"id":"routes/api.editor-journal-screenshot","parentId":"root","path":"api/editor-journal-screenshot","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-journal-screenshot-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-save-scenario-data":{"id":"routes/api.editor-save-scenario-data","parentId":"root","path":"api/editor-save-scenario-data","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-save-scenario-data-l0sNRNKZ.js","imports":[],"css":[]},"routes/entity.$sha_.edit.$scenarioId":{"id":"routes/entity.$sha_.edit.$scenarioId","parentId":"root","path":"entity/:sha/edit/:scenarioId","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/entity._sha_.edit._scenarioId-CRXJWmpB.js","imports":["/assets/chunk-JZWAC4HX-BAdwhyCx.js","/assets/jsx-runtime-D_zvdyIk.js","/assets/InteractivePreview-DtYTSPL2.js","/assets/Spinner-Bc8BG-Lw.js","/assets/preload-helper-ckwbz45p.js","/assets/useLastLogLine-D9QZKaLJ.js","/assets/InlineSpinner-CgTNOhnu.js"],"css":[]},"routes/api.editor-register-scenario":{"id":"routes/api.editor-register-scenario","parentId":"root","path":"api/editor-register-scenario","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-register-scenario-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-scenario-coverage":{"id":"routes/api.editor-scenario-coverage","parentId":"root","path":"api/editor-scenario-coverage","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-scenario-coverage-l0sNRNKZ.js","imports":[],"css":[]},"routes/entity.$sha_.create-scenario":{"id":"routes/entity.$sha_.create-scenario","parentId":"root","path":"entity/:sha/create-scenario","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/entity._sha_.create-scenario-DxfhekTZ.js","imports":["/assets/chunk-JZWAC4HX-BAdwhyCx.js","/assets/jsx-runtime-D_zvdyIk.js","/assets/InteractivePreview-DtYTSPL2.js","/assets/Spinner-Bc8BG-Lw.js","/assets/executionFlowCoverage-BWhdfn70.js","/assets/preload-helper-ckwbz45p.js","/assets/useLastLogLine-D9QZKaLJ.js","/assets/InlineSpinner-CgTNOhnu.js"],"css":[]},"routes/api.editor-capture-scenario":{"id":"routes/api.editor-capture-scenario","parentId":"root","path":"api/editor-capture-scenario","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-capture-scenario-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-scenario-image.$":{"id":"routes/api.editor-scenario-image.$","parentId":"root","path":"api/editor-scenario-image/*","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-scenario-image._-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-journal-image.$":{"id":"routes/api.editor-journal-image.$","parentId":"root","path":"api/editor-journal-image/*","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-journal-image._-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-recapture-stale":{"id":"routes/api.editor-recapture-stale","parentId":"root","path":"api/editor-recapture-stale","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-recapture-stale-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-rename-scenario":{"id":"routes/api.editor-rename-scenario","parentId":"root","path":"api/editor-rename-scenario","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-rename-scenario-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-save-seed-state":{"id":"routes/api.editor-save-seed-state","parentId":"root","path":"api/editor-save-seed-state","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-save-seed-state-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-scenario-prompt":{"id":"routes/api.editor-scenario-prompt","parentId":"root","path":"api/editor-scenario-prompt","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-scenario-prompt-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-switch-scenario":{"id":"routes/api.editor-switch-scenario","parentId":"root","path":"api/editor-switch-scenario","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-switch-scenario-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.generate-scenario-data":{"id":"routes/api.generate-scenario-data","parentId":"root","path":"api/generate-scenario-data","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.generate-scenario-data-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-journal-update":{"id":"routes/api.editor-journal-update","parentId":"root","path":"api/editor-journal-update","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-journal-update-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-client-errors":{"id":"routes/api.editor-client-errors","parentId":"root","path":"api/editor-client-errors","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-client-errors-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-entity-status":{"id":"routes/api.editor-entity-status","parentId":"root","path":"api/editor-entity-status","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-entity-status-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-journal-entry":{"id":"routes/api.editor-journal-entry","parentId":"root","path":"api/editor-journal-entry","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-journal-entry-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-scenario-data":{"id":"routes/api.editor-scenario-data","parentId":"root","path":"api/editor-scenario-data","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-scenario-data-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-verify-routes":{"id":"routes/api.editor-verify-routes","parentId":"root","path":"api/editor-verify-routes","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-verify-routes-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.llm-calls.$entitySha":{"id":"routes/api.llm-calls.$entitySha","parentId":"root","path":"api/llm-calls/:entitySha","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.llm-calls._entitySha-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-project-info":{"id":"routes/api.editor-project-info","parentId":"root","path":"api/editor-project-info","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-project-info-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-test-results":{"id":"routes/api.editor-test-results","parentId":"root","path":"api/editor-test-results","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-test-results-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.branch-entity-diff":{"id":"routes/api.branch-entity-diff","parentId":"root","path":"api/branch-entity-diff","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.branch-entity-diff-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.capture-screenshot":{"id":"routes/api.capture-screenshot","parentId":"root","path":"api/capture-screenshot","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.capture-screenshot-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-load-commit":{"id":"routes/api.editor-load-commit","parentId":"root","path":"api/editor-load-commit","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-load-commit-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.recapture-scenario":{"id":"routes/api.recapture-scenario","parentId":"root","path":"api/recapture-scenario","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.recapture-scenario-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.agent-transcripts":{"id":"routes/api.agent-transcripts","parentId":"root","path":"api/agent-transcripts","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.agent-transcripts-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-dev-server":{"id":"routes/api.editor-dev-server","parentId":"root","path":"api/editor-dev-server","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-dev-server-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.logs.$projectSlug":{"id":"routes/api.logs.$projectSlug","parentId":"root","path":"api/logs/:projectSlug","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.logs._projectSlug-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-file-diff":{"id":"routes/api.editor-file-diff","parentId":"root","path":"api/editor-file-diff","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-file-diff-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-scenarios":{"id":"routes/api.editor-scenarios","parentId":"root","path":"api/editor-scenarios","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-scenarios-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.execute-function":{"id":"routes/api.execute-function","parentId":"root","path":"api/execute-function","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.execute-function-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.interactive-mode":{"id":"routes/api.interactive-mode","parentId":"root","path":"api/interactive-mode","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.interactive-mode-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.delete-scenario":{"id":"routes/api.delete-scenario","parentId":"root","path":"api/delete-scenario","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.delete-scenario-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.dev-mode-events":{"id":"routes/api.dev-mode-events","parentId":"root","path":"api/dev-mode-events","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.dev-mode-events-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.generate-report":{"id":"routes/api.generate-report","parentId":"root","path":"api/generate-report","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.generate-report-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-journal":{"id":"routes/api.editor-journal","parentId":"root","path":"api/editor-journal","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-journal-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-refresh":{"id":"routes/api.editor-refresh","parentId":"root","path":"api/editor-refresh","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-refresh-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-session":{"id":"routes/api.editor-session","parentId":"root","path":"api/editor-session","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-session-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.memory-profile":{"id":"routes/api.memory-profile","parentId":"root","path":"api/memory-profile","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.memory-profile-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.process-status":{"id":"routes/api.process-status","parentId":"root","path":"api/process-status","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.process-status-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.restart-server":{"id":"routes/api.restart-server","parentId":"root","path":"api/restart-server","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.restart-server-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.save-scenarios":{"id":"routes/api.save-scenarios","parentId":"root","path":"api/save-scenarios","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.save-scenarios-l0sNRNKZ.js","imports":[],"css":[]},"routes/agent-transcripts":{"id":"routes/agent-transcripts","parentId":"root","path":"agent-transcripts","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/agent-transcripts-Bg3e7q4S.js","imports":["/assets/chunk-JZWAC4HX-BAdwhyCx.js","/assets/jsx-runtime-D_zvdyIk.js","/assets/useReportContext-Cy5Qg_UR.js","/assets/createLucideIcon-4ImjHTVC.js","/assets/terminal-CrplD4b1.js","/assets/search-BdBb5aqc.js","/assets/chevron-down-GmAjGS9-.js","/assets/book-open-CL-lMgHh.js","/assets/triangle-alert-DqJ0j69l.js","/assets/copy-C6iF61Xs.js"],"css":[]},"routes/api.editor-commit":{"id":"routes/api.editor-commit","parentId":"root","path":"api/editor-commit","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-commit-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-schema":{"id":"routes/api.editor-schema","parentId":"root","path":"api/editor-schema","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-schema-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-audit":{"id":"routes/api.editor-audit","parentId":"root","path":"api/editor-audit","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-audit-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.kill-process":{"id":"routes/api.kill-process","parentId":"root","path":"api/kill-process","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.kill-process-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.save-fixture":{"id":"routes/api.save-fixture","parentId":"root","path":"api/save-fixture","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.save-fixture-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.screenshot.$":{"id":"routes/api.screenshot.$","parentId":"root","path":"api/screenshot/*","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.screenshot._-l0sNRNKZ.js","imports":[],"css":[]},"routes/activity.($tab)":{"id":"routes/activity.($tab)","parentId":"root","path":"activity/:tab?","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/activity.(_tab)-yH46LLUz.js","imports":["/assets/chunk-JZWAC4HX-BAdwhyCx.js","/assets/jsx-runtime-D_zvdyIk.js","/assets/LogViewer-CM5zg40N.js","/assets/useLastLogLine-D9QZKaLJ.js","/assets/useReportContext-Cy5Qg_UR.js","/assets/EntityTypeIcon-CD7lGABo.js","/assets/EntityTypeBadge-CQgyEGV-.js","/assets/SafeScreenshot-DanvyBPb.js","/assets/LoadingDots-By5zI316.js","/assets/loader-circle-De-7qQ2u.js","/assets/pause-CFxEKL1u.js","/assets/createLucideIcon-4ImjHTVC.js"],"css":[]},"routes/api.debug-setup":{"id":"routes/api.debug-setup","parentId":"root","path":"api/debug-setup","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.debug-setup-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.editor-file":{"id":"routes/api.editor-file","parentId":"root","path":"api/editor-file","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.editor-file-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.labs-unlock":{"id":"routes/api.labs-unlock","parentId":"root","path":"api/labs-unlock","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.labs-unlock-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.recapture":{"id":"routes/api.recapture","parentId":"root","path":"api/recapture","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.recapture-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.rule-path":{"id":"routes/api.rule-path","parentId":"root","path":"api/rule-path","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.rule-path-l0sNRNKZ.js","imports":[],"css":[]},"routes/entity.$sha.$":{"id":"routes/entity.$sha.$","parentId":"root","path":"entity/:sha/*","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/entity._sha._-DYJRGiDI.js","imports":["/assets/chunk-JZWAC4HX-BAdwhyCx.js","/assets/jsx-runtime-D_zvdyIk.js","/assets/useLastLogLine-D9QZKaLJ.js","/assets/Spinner-Bc8BG-Lw.js","/assets/InteractivePreview-DtYTSPL2.js","/assets/SafeScreenshot-DanvyBPb.js","/assets/LibraryFunctionPreview-D3s1MFkb.js","/assets/LoadingDots-By5zI316.js","/assets/scenarioStatus-B_8jpV3e.js","/assets/ScenarioViewer-CefgqbCr.js","/assets/createLucideIcon-4ImjHTVC.js","/assets/executionFlowCoverage-BWhdfn70.js","/assets/EntityTypeIcon-CD7lGABo.js","/assets/CopyButton-CLe80MMu.js","/assets/LogViewer-CM5zg40N.js","/assets/MiniClaudeChat-CQENLSrF.js","/assets/useReportContext-Cy5Qg_UR.js","/assets/preload-helper-ckwbz45p.js","/assets/InlineSpinner-CgTNOhnu.js","/assets/ViewportInspectBar-BA_Ry-rs.js","/assets/useCustomSizes-DhXHbEjP.js","/assets/ReportIssueModal-C2PLkej3.js","/assets/circle-check-DFcQkN5j.js","/assets/triangle-alert-DqJ0j69l.js","/assets/copy-C6iF61Xs.js"],"css":[]},"routes/api.analyze":{"id":"routes/api.analyze","parentId":"root","path":"api/analyze","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.analyze-l0sNRNKZ.js","imports":[],"css":[]},"routes/simulations":{"id":"routes/simulations","parentId":"root","path":"simulations","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/simulations-DSCdE99u.js","imports":["/assets/chunk-JZWAC4HX-BAdwhyCx.js","/assets/jsx-runtime-D_zvdyIk.js","/assets/useReportContext-Cy5Qg_UR.js","/assets/SafeScreenshot-DanvyBPb.js","/assets/LoadingDots-By5zI316.js","/assets/EntityTypeIcon-CD7lGABo.js","/assets/fileTableUtils-Daa96Fr1.js","/assets/chevron-down-GmAjGS9-.js","/assets/search-BdBb5aqc.js","/assets/loader-circle-De-7qQ2u.js","/assets/createLucideIcon-4ImjHTVC.js"],"css":[]},"routes/api.events":{"id":"routes/api.events","parentId":"root","path":"api/events","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.events-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.health":{"id":"routes/api.health","parentId":"root","path":"api/health","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.health-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.memory":{"id":"routes/api.memory","parentId":"root","path":"api/memory","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.memory-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.queue":{"id":"routes/api.queue","parentId":"root","path":"api/queue","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/api.queue-l0sNRNKZ.js","imports":[],"css":[]},"routes/dev.empty":{"id":"routes/dev.empty","parentId":"root","path":"dev/empty","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/dev.empty-CRepiabR.js","imports":["/assets/chunk-JZWAC4HX-BAdwhyCx.js","/assets/jsx-runtime-D_zvdyIk.js","/assets/ScenarioViewer-CefgqbCr.js","/assets/InteractivePreview-DtYTSPL2.js","/assets/ViewportInspectBar-BA_Ry-rs.js","/assets/useCustomSizes-DhXHbEjP.js","/assets/LogViewer-CM5zg40N.js","/assets/SafeScreenshot-DanvyBPb.js","/assets/useLastLogLine-D9QZKaLJ.js","/assets/Spinner-Bc8BG-Lw.js","/assets/preload-helper-ckwbz45p.js","/assets/ReportIssueModal-C2PLkej3.js","/assets/createLucideIcon-4ImjHTVC.js","/assets/circle-check-DFcQkN5j.js","/assets/triangle-alert-DqJ0j69l.js","/assets/copy-C6iF61Xs.js","/assets/scenarioStatus-B_8jpV3e.js","/assets/InlineSpinner-CgTNOhnu.js"],"css":[]},"routes/settings":{"id":"routes/settings","parentId":"root","path":"settings","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/settings-DdE-Untf.js","imports":["/assets/chunk-JZWAC4HX-BAdwhyCx.js","/assets/jsx-runtime-D_zvdyIk.js","/assets/useReportContext-Cy5Qg_UR.js","/assets/CopyButton-CLe80MMu.js","/assets/copy-C6iF61Xs.js","/assets/createLucideIcon-4ImjHTVC.js"],"css":[]},"routes/static.$":{"id":"routes/static.$","parentId":"root","path":"static/*","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":false,"hasErrorBoundary":false,"module":"/assets/static._-l0sNRNKZ.js","imports":[],"css":[]},"routes/_index":{"id":"routes/_index","parentId":"root","index":true,"hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/_index-C1YkzTAV.js","imports":["/assets/chunk-JZWAC4HX-BAdwhyCx.js","/assets/jsx-runtime-D_zvdyIk.js","/assets/useLastLogLine-D9QZKaLJ.js","/assets/useToast-5HR2j9ZE.js","/assets/useReportContext-Cy5Qg_UR.js","/assets/LogViewer-CM5zg40N.js","/assets/EntityTypeIcon-CD7lGABo.js","/assets/SafeScreenshot-DanvyBPb.js","/assets/scenarioStatus-B_8jpV3e.js","/assets/createLucideIcon-4ImjHTVC.js","/assets/circle-check-DFcQkN5j.js","/assets/loader-circle-De-7qQ2u.js"],"css":[]},"routes/memory":{"id":"routes/memory","parentId":"root","path":"memory","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/memory-Cx2xEx7s.js","imports":["/assets/chunk-JZWAC4HX-BAdwhyCx.js","/assets/jsx-runtime-D_zvdyIk.js","/assets/useReportContext-Cy5Qg_UR.js","/assets/createLucideIcon-4ImjHTVC.js","/assets/terminal-CrplD4b1.js","/assets/copy-C6iF61Xs.js","/assets/CopyButton-CLe80MMu.js","/assets/chevron-down-GmAjGS9-.js","/assets/search-BdBb5aqc.js","/assets/pause-CFxEKL1u.js","/assets/book-open-CL-lMgHh.js"],"css":[]},"routes/files":{"id":"routes/files","parentId":"root","path":"files","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/files-D-xGrg29.js","imports":["/assets/chunk-JZWAC4HX-BAdwhyCx.js","/assets/jsx-runtime-D_zvdyIk.js","/assets/useReportContext-Cy5Qg_UR.js","/assets/EntityItem-Crt_KN_U.js","/assets/fileTableUtils-Daa96Fr1.js","/assets/chevron-down-GmAjGS9-.js","/assets/search-BdBb5aqc.js","/assets/createLucideIcon-4ImjHTVC.js","/assets/useToast-5HR2j9ZE.js","/assets/TruncatedFilePath-CK7-NaPZ.js","/assets/SafeScreenshot-DanvyBPb.js","/assets/LibraryFunctionPreview-D3s1MFkb.js","/assets/scenarioStatus-B_8jpV3e.js","/assets/triangle-alert-DqJ0j69l.js","/assets/EntityTypeIcon-CD7lGABo.js","/assets/EntityTypeBadge-CQgyEGV-.js"],"css":[]},"routes/labs":{"id":"routes/labs","parentId":"root","path":"labs","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/labs-B_IX45ih.js","imports":["/assets/chunk-JZWAC4HX-BAdwhyCx.js","/assets/jsx-runtime-D_zvdyIk.js","/assets/useReportContext-Cy5Qg_UR.js"],"css":[]},"routes/git":{"id":"routes/git","parentId":"root","path":"git","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/git-Bq_fbXP5.js","imports":["/assets/chunk-JZWAC4HX-BAdwhyCx.js","/assets/jsx-runtime-D_zvdyIk.js","/assets/useReportContext-Cy5Qg_UR.js","/assets/EntityItem-Crt_KN_U.js","/assets/LogViewer-CM5zg40N.js","/assets/index-DE3jI_dv.js","/assets/fileTableUtils-Daa96Fr1.js","/assets/createLucideIcon-4ImjHTVC.js","/assets/useToast-5HR2j9ZE.js","/assets/TruncatedFilePath-CK7-NaPZ.js","/assets/SafeScreenshot-DanvyBPb.js","/assets/LibraryFunctionPreview-D3s1MFkb.js","/assets/scenarioStatus-B_8jpV3e.js","/assets/triangle-alert-DqJ0j69l.js","/assets/EntityTypeIcon-CD7lGABo.js","/assets/EntityTypeBadge-CQgyEGV-.js"],"css":[]},"routes/editor.entity.($sha)":{"id":"routes/editor.entity.($sha)","parentId":"root","path":"editor","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/editor.entity.(_sha)-oBrbke_R.js","imports":["/assets/chunk-JZWAC4HX-BAdwhyCx.js","/assets/jsx-runtime-D_zvdyIk.js","/assets/useCustomSizes-DhXHbEjP.js","/assets/editorPreview-CluPkvXJ.js","/assets/CopyButton-CLe80MMu.js","/assets/MiniClaudeChat-CQENLSrF.js","/assets/preload-helper-ckwbz45p.js","/assets/cy-logo-cli-Coe5NhbS.js","/assets/Spinner-Bc8BG-Lw.js","/assets/copy-C6iF61Xs.js","/assets/createLucideIcon-4ImjHTVC.js","/assets/useLastLogLine-D9QZKaLJ.js"],"css":[]},"editor-tab-index":{"id":"editor-tab-index","parentId":"routes/editor.entity.($sha)","index":true,"hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/editor._tab-Gbk_i5Js.js","imports":["/assets/chunk-JZWAC4HX-BAdwhyCx.js"],"css":[]},"editor-tab-build":{"id":"editor-tab-build","parentId":"routes/editor.entity.($sha)","path":"build","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/editor._tab-Gbk_i5Js.js","imports":["/assets/chunk-JZWAC4HX-BAdwhyCx.js"],"css":[]},"editor-tab-structure":{"id":"editor-tab-structure","parentId":"routes/editor.entity.($sha)","path":"structure","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/editor._tab-Gbk_i5Js.js","imports":["/assets/chunk-JZWAC4HX-BAdwhyCx.js"],"css":[]},"editor-tab-history":{"id":"editor-tab-history","parentId":"routes/editor.entity.($sha)","path":"history","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/editor._tab-Gbk_i5Js.js","imports":["/assets/chunk-JZWAC4HX-BAdwhyCx.js"],"css":[]},"editor-tab-settings":{"id":"editor-tab-settings","parentId":"routes/editor.entity.($sha)","path":"settings","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/editor._tab-Gbk_i5Js.js","imports":["/assets/chunk-JZWAC4HX-BAdwhyCx.js"],"css":[]},"editor-tab-entity":{"id":"editor-tab-entity","parentId":"routes/editor.entity.($sha)","path":"entity/:sha","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasDefaultExport":true,"hasErrorBoundary":false,"module":"/assets/editor._tab-Gbk_i5Js.js","imports":["/assets/chunk-JZWAC4HX-BAdwhyCx.js"],"css":[]}},"url":"/assets/manifest-694b698a.js","version":"694b698a"};
@@ -1,4 +1,4 @@
1
- import{r as a,c as ie,a as ae,d as re,L as Y,w as le,D as ce,M as de,G as me,S as he,H as pe,I as xe,k as G,u as fe,f as ue,O as ye}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{_ as ge}from"./preload-helper-ckwbz45p.js";import{c as ve}from"./cy-logo-cli-Coe5NhbS.js";import{B as je,R as be,S as ke}from"./ReportIssueModal-C2PLkej3.js";import{a as we,R as Ce}from"./useReportContext-Cy5Qg_UR.js";import{L as Z}from"./loader-circle-De-7qQ2u.js";import{c as E}from"./createLucideIcon-4ImjHTVC.js";import{B as Ne}from"./book-open-CL-lMgHh.js";import{T as Se,u as Le}from"./useToast-5HR2j9ZE.js";import{u as Ee}from"./useLastLogLine-BNd5hYuW.js";import{L as Ae}from"./LogViewer-CM5zg40N.js";import{E as Te}from"./EntityTypeIcon-CD7lGABo.js";import{T as ze}from"./TruncatedFilePath-CK7-NaPZ.js";import{C as Me}from"./chevron-down-GmAjGS9-.js";import{C as Be}from"./circle-check-DFcQkN5j.js";import{C as Ie}from"./CopyButton-CLe80MMu.js";import"./triangle-alert-DqJ0j69l.js";import"./copy-C6iF61Xs.js";const _e=2e3,Fe=5e3;function De(t){return t.startsWith("/editor")?Fe:_e}function We(t){const{now:s,lastRevalidation:o,throttleMs:l}=t;if(o===0)return"immediate";const r=s-o;return r>=l?"immediate":{action:"deferred",delayMs:l-r}}function Pe({id:t,selected:s,onClick:o,icon:l,name:r}){const[d,i]=a.useState(!1);a.useEffect(()=>{i(!0)},[]);const N=a.useCallback(()=>{o==null||o(t)},[o,t]);return e.jsxs("button",{className:`
1
+ import{r as a,c as ie,a as ae,d as re,L as Y,w as le,D as ce,M as de,G as me,S as he,H as pe,I as xe,k as G,u as fe,f as ue,O as ye}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{_ as ge}from"./preload-helper-ckwbz45p.js";import{c as ve}from"./cy-logo-cli-Coe5NhbS.js";import{B as je,R as be,S as ke}from"./ReportIssueModal-C2PLkej3.js";import{a as we,R as Ce}from"./useReportContext-Cy5Qg_UR.js";import{L as Z}from"./loader-circle-De-7qQ2u.js";import{c as E}from"./createLucideIcon-4ImjHTVC.js";import{B as Ne}from"./book-open-CL-lMgHh.js";import{T as Se,u as Le}from"./useToast-5HR2j9ZE.js";import{u as Ee}from"./useLastLogLine-D9QZKaLJ.js";import{L as Ae}from"./LogViewer-CM5zg40N.js";import{E as Te}from"./EntityTypeIcon-CD7lGABo.js";import{T as ze}from"./TruncatedFilePath-CK7-NaPZ.js";import{C as Me}from"./chevron-down-GmAjGS9-.js";import{C as Be}from"./circle-check-DFcQkN5j.js";import{C as Ie}from"./CopyButton-CLe80MMu.js";import"./triangle-alert-DqJ0j69l.js";import"./copy-C6iF61Xs.js";const _e=2e3,Fe=5e3;function De(t){return t.startsWith("/editor")?Fe:_e}function We(t){const{now:s,lastRevalidation:o,throttleMs:l}=t;if(o===0)return"immediate";const r=s-o;return r>=l?"immediate":{action:"deferred",delayMs:l-r}}function Pe({id:t,selected:s,onClick:o,icon:l,name:r}){const[d,i]=a.useState(!1);a.useEffect(()=>{i(!0)},[]);const N=a.useCallback(()=>{o==null||o(t)},[o,t]);return e.jsxs("button",{className:`
2
2
  w-full px-1.5 py-2 cursor-pointer focus:outline-none
3
3
  flex flex-col items-center justify-center gap-1 transition-colors
4
4
  ${s?"text-[#CBF3FA]":"text-[#568B94] hover:text-[#CBF3FA]"}
@@ -0,0 +1,2 @@
1
+ import{r as t}from"./chunk-JZWAC4HX-BAdwhyCx.js";function U(c,s){const[R,l]=t.useState(""),[d,a]=t.useState(!1),[p,r]=t.useState(null),[C,o]=t.useState(null),[L,i]=t.useState(!1);t.useEffect(()=>{s&&(i(!1),a(!1),r(null),o(null))},[s]),t.useEffect(()=>{if(!c||!s){s||l("");return}const E=async()=>{if(!L)try{const u=await fetch(`/api/logs/${c}`);if(u.ok){const n=(await u.text()).trim().split(`
2
+ `).filter(e=>e.length>0);if(n.length<3){a(!1),i(!1),r(null),o(null),l("");return}const f=n.filter(e=>e.includes("CodeYam Log Level 1"));if(f.length>0){const e=f[f.length-1];l(e.replace(/.*CodeYam Log Level 1: /,""))}const $=n.find(e=>e.includes("$$INTERACTIVE_SERVER_URL$$:"));if($){const e=$.split("$$INTERACTIVE_SERVER_URL$$:")[1].trim();r(e),i(!0)}const I=n.find(e=>e.includes("$$INTERACTIVE_SCENARIO_URLS$$:"));if(I)try{const e=I.split("$$INTERACTIVE_SCENARIO_URLS$$:")[1].trim();o(JSON.parse(e))}catch{}n.some(e=>e.includes("CodeYam: Exiting start.js"))&&a(!0)}}catch{}};E().catch(()=>{});const h=setInterval(()=>{E().catch(()=>{})},500);return()=>clearInterval(h)},[c,s,L]);const g=t.useCallback(()=>{l(""),a(!1),r(null),o(null),i(!1)},[]);return{lastLine:R,interactiveUrl:p,scenarioUrlMap:C,isCompleted:d,resetLogs:g}}export{U as u};
@@ -1,4 +1,4 @@
1
- import*as _ from"fs/promises";import*as h from"path";import{P as J,w as H}from"./progress-CHTtrxFG.js";import{ab as V,ac as B,ad as G,ae as U,af as K,ag as Q,ah as X,ai as Z,aj as W,ak as ee,u as te,al as re,am as oe,an as ne}from"./server-build-NZmUqQv6.js";import{spawn as z,execSync as se}from"child_process";import*as E from"fs";import{fileURLToPath as ie}from"url";import"fetch-retry";import"typescript";import"pluralize";import"piscina";import"json5";import"cli-spinners";import"chalk";import"react/jsx-runtime";import"node:stream";import"@react-router/node";import"react-router";import"isbot";import"react-dom/server";import"react";import"lucide-react";import"better-sqlite3";import"pg";import"kysely";import"kysely/helpers/sqlite";import"kysely/helpers/postgres";import"os";import"prompts";import"crypto";import"util";import"dotenv";import"events";import"uuid";import"http";import"net";import"ws";import"node-pty";import"openai";import"p-queue";import"p-retry";import"@aws-sdk/client-dynamodb";import"lru-cache";import"@aws-sdk/util-dynamodb";import"v8";import"react-syntax-highlighter";import"react-syntax-highlighter/dist/cjs/styles/prism/index.js";import"node:crypto";import"minimatch";import"react-markdown";import"remark-gfm";import"react-diff-viewer-continued";const ae=ie(import.meta.url),ce=h.dirname(ae);async function le(O){let a=O.port;const{rootPath:l,project:p,branch:k,processName:T="server"}=O;let m=!1;const{running:g,state:e,pids:y}=V();if(g&&e)if(e.cliVersion!==B)console.log(`CLI version mismatch (server: ${e.cliVersion??"unknown"} → CLI: ${B}), restarting server...`),G(),m=!0;else return{url:e.url,pid:e.pid,wasAlreadyRunning:!0};else g&&y&&y.length>0&&(U(a)||(a=K(a,U)));const C=`http://localhost:${a}`,f=h.join(ce,"..","webserver","bootstrap.js"),o=h.join(l,".codeyam","logs");E.existsSync(o)||E.mkdirSync(o,{recursive:!0});const D={CODEYAM_PORT:a.toString(),CODEYAM_ROOT_PATH:l,CODEYAM_PROJECT:p?JSON.stringify(p):"",CODEYAM_BRANCH:k?JSON.stringify(k):"",CODEYAM_PROCESS_NAME:`codeyam-${T}`,...m?{CODEYAM_WAIT_FOR_PORT:"true"}:{},...process.env.CODEYAM_TRACE_TRANSFORMS?{CODEYAM_TRACE_TRANSFORMS:process.env.CODEYAM_TRACE_TRANSFORMS}:{}};let d;if(process.platform==="win32")d=await pe(f,D,o);else{const n=E.openSync(h.join(o,"background-server.log"),"a"),r=E.openSync(h.join(o,"background-server-error.log"),"a"),w=z("node",["--max-old-space-size=8192",f],{detached:!0,stdio:["ignore",n,r],env:{...process.env,...D}});w.unref(),d=w.pid}try{const n=se(`lsof -ti:${a}`,{encoding:"utf8"}).trim();if(n){const r=n.split(`
1
+ import*as _ from"fs/promises";import*as h from"path";import{P as J,w as H}from"./progress-CHTtrxFG.js";import{ab as V,ac as B,ad as G,ae as U,af as K,ag as Q,ah as X,ai as Z,aj as W,ak as ee,u as te,al as re,am as oe,an as ne}from"./server-build-Cxzo0Zp2.js";import{spawn as z,execSync as se}from"child_process";import*as E from"fs";import{fileURLToPath as ie}from"url";import"fetch-retry";import"typescript";import"pluralize";import"piscina";import"json5";import"cli-spinners";import"chalk";import"react/jsx-runtime";import"node:stream";import"@react-router/node";import"react-router";import"isbot";import"react-dom/server";import"react";import"lucide-react";import"better-sqlite3";import"pg";import"kysely";import"kysely/helpers/sqlite";import"kysely/helpers/postgres";import"os";import"prompts";import"crypto";import"util";import"dotenv";import"events";import"uuid";import"http";import"net";import"ws";import"node-pty";import"openai";import"p-queue";import"p-retry";import"@aws-sdk/client-dynamodb";import"lru-cache";import"@aws-sdk/util-dynamodb";import"v8";import"react-syntax-highlighter";import"react-syntax-highlighter/dist/cjs/styles/prism/index.js";import"node:crypto";import"minimatch";import"react-markdown";import"remark-gfm";import"react-diff-viewer-continued";const ae=ie(import.meta.url),ce=h.dirname(ae);async function le(O){let a=O.port;const{rootPath:l,project:p,branch:k,processName:T="server"}=O;let m=!1;const{running:g,state:e,pids:y}=V();if(g&&e)if(e.cliVersion!==B)console.log(`CLI version mismatch (server: ${e.cliVersion??"unknown"} → CLI: ${B}), restarting server...`),G(),m=!0;else return{url:e.url,pid:e.pid,wasAlreadyRunning:!0};else g&&y&&y.length>0&&(U(a)||(a=K(a,U)));const C=`http://localhost:${a}`,f=h.join(ce,"..","webserver","bootstrap.js"),o=h.join(l,".codeyam","logs");E.existsSync(o)||E.mkdirSync(o,{recursive:!0});const D={CODEYAM_PORT:a.toString(),CODEYAM_ROOT_PATH:l,CODEYAM_PROJECT:p?JSON.stringify(p):"",CODEYAM_BRANCH:k?JSON.stringify(k):"",CODEYAM_PROCESS_NAME:`codeyam-${T}`,...m?{CODEYAM_WAIT_FOR_PORT:"true"}:{},...process.env.CODEYAM_TRACE_TRANSFORMS?{CODEYAM_TRACE_TRANSFORMS:process.env.CODEYAM_TRACE_TRANSFORMS}:{}};let d;if(process.platform==="win32")d=await pe(f,D,o);else{const n=E.openSync(h.join(o,"background-server.log"),"a"),r=E.openSync(h.join(o,"background-server-error.log"),"a"),w=z("node",["--max-old-space-size=8192",f],{detached:!0,stdio:["ignore",n,r],env:{...process.env,...D}});w.unref(),d=w.pid}try{const n=se(`lsof -ti:${a}`,{encoding:"utf8"}).trim();if(n){const r=n.split(`
2
2
  `),w=r.find(R=>R===String(d)),s=r.filter(R=>R!==String(d));s.length>0&&console.warn(`[BackgroundServer] Port ${a} still held by other PID(s): ${s.join(", ")} (server PID: ${d})`)}}catch{}const L=`http://127.0.0.1:${a}/api/health`,v=6e4,F=500,c=Date.now();let u="",b=!1;for(;Date.now()-c<v;){try{process.kill(d,0)}catch{const r=((Date.now()-c)/1e3).toFixed(1);console.error(`[BackgroundServer] Server process (PID ${d}) died after ${r}s`);const w=h.join(o,"background-server.log");try{const $=E.readFileSync(w,"utf8").trim().split(`
3
3
  `).slice(-15).join(`
4
4
  `);console.error(`[BackgroundServer] Last log lines:
@@ -1 +1 @@
1
- import"fetch-retry";import{K as Z,N as _,Q as $,R as aa,U as ea,W as sa,Z as ta,a1 as ra,a4 as oa,J as ia,L as ma,M as la,O as pa,P as na,S as ca,T as ba,V as Ta,X as da,Y as ua,_ as ha,$ as Ca,a0 as Sa,a2 as ya,a3 as Ba,a5 as Aa,I as Ea,a6 as Pa,a7 as ga,a8 as ja,aa as Fa,a9 as Ua,d as Da,a as Ga,b as Ma,c as qa,e as Ja,f as fa,g as ka,h as xa,i as Ha,j as La,k as va,E as wa,H as za,G as Ia,F as Ka,l as Na,m as Oa,n as Qa,o as Ra,p as Va,q as Wa,r as Xa,s as Ya,t as Za,u as _a,v as $a,w as ae,x as ee,y as se,z as te,A as re,B as oe,C as ie,D as me}from"./server-build-NZmUqQv6.js";import"typescript";import"react/jsx-runtime";import"node:stream";import"@react-router/node";import"react-router";import"isbot";import"react-dom/server";import"react";import"lucide-react";import"better-sqlite3";import"pg";import"fs";import"path";import"kysely";import"kysely/helpers/sqlite";import"kysely/helpers/postgres";import"fs/promises";import"os";import"prompts";import"chalk";import"crypto";import"child_process";import"url";import"util";import"dotenv";import"events";import"uuid";import"http";import"net";import"ws";import"node-pty";import"openai";import"p-queue";import"p-retry";import"@aws-sdk/client-dynamodb";import"lru-cache";import"pluralize";import"piscina";import"json5";import"@aws-sdk/util-dynamodb";import"v8";import"react-syntax-highlighter";import"react-syntax-highlighter/dist/cjs/styles/prism/index.js";import"node:crypto";import"minimatch";import"react-markdown";import"remark-gfm";import"react-diff-viewer-continued";export{Z as AnalysisBranchesTableColumns,_ as BranchesTableColumns,$ as CommitsTableColumns,aa as CommitsTableColumnsLite,ea as EntitiesTableColumns,sa as EntityBranchesTableColumns,ta as FilesTableColumns,ra as ProjectsTableColumns,oa as ScenariosTableColumns,ia as createAnalysesTable,ma as createAnalysisBranchesTable,la as createBackgroundJobsTable,pa as createBranchesTable,na as createCommitBranchesTable,ca as createCommitsTable,ba as createEditorScenariosTable,Ta as createEntitiesTable,da as createEntityBranchesTable,ua as createEntityStatementsTable,ha as createFilesTable,Ca as createGithubPayloadsTable,Sa as createGithubUsersTable,ya as createProjectsTable,Ba as createScenarioCommentsTable,Aa as createScenariosTable,Ea as createSqliteSchema,Pa as createStatementsTable,ga as createTeamsTable,ja as createUserScenariosTable,Fa as createUserTeamsTable,Ua as createUsersTable,Da as dbToAnalysis,Ga as dbToAnalysisBranch,Ma as dbToBranch,qa as dbToCommit,Ja as dbToEntity,fa as dbToFile,ka as dbToProject,xa as dbToScenario,Ha as dbToUserScenario,La as deleteScenarios,va as generateSha,wa as getDatabase,za as getJsonHelper,Ia as getPostgreDatabase,Ka as getSqliteDatabase,Na as loadAnalyses,Oa as loadAnalysis,Qa as loadBranches,Ra as loadCommitBranches,Va as loadCommits,Wa as loadEntities,Xa as loadEntity,Ya as loadFiles,Za as loadProject,_a as updateCommitMetadata,$a as updateFreshAnalysisMetadata,ae as updateFreshAnalysisStatus,ee as updateProjectMetadata,se as upsertBranches,te as upsertCommitBranches,re as upsertCommits,oe as upsertGithubUser,ie as upsertProjects,me as upsertScenarios};
1
+ import"fetch-retry";import{K as Z,N as _,Q as $,R as aa,U as ea,W as sa,Z as ta,a1 as ra,a4 as oa,J as ia,L as ma,M as la,O as pa,P as na,S as ca,T as ba,V as Ta,X as da,Y as ua,_ as ha,$ as Ca,a0 as Sa,a2 as ya,a3 as Ba,a5 as Aa,I as Ea,a6 as Pa,a7 as ga,a8 as ja,aa as Fa,a9 as Ua,d as Da,a as Ga,b as Ma,c as qa,e as Ja,f as fa,g as ka,h as xa,i as Ha,j as La,k as va,E as wa,H as za,G as Ia,F as Ka,l as Na,m as Oa,n as Qa,o as Ra,p as Va,q as Wa,r as Xa,s as Ya,t as Za,u as _a,v as $a,w as ae,x as ee,y as se,z as te,A as re,B as oe,C as ie,D as me}from"./server-build-Cxzo0Zp2.js";import"typescript";import"react/jsx-runtime";import"node:stream";import"@react-router/node";import"react-router";import"isbot";import"react-dom/server";import"react";import"lucide-react";import"better-sqlite3";import"pg";import"fs";import"path";import"kysely";import"kysely/helpers/sqlite";import"kysely/helpers/postgres";import"fs/promises";import"os";import"prompts";import"chalk";import"crypto";import"child_process";import"url";import"util";import"dotenv";import"events";import"uuid";import"http";import"net";import"ws";import"node-pty";import"openai";import"p-queue";import"p-retry";import"@aws-sdk/client-dynamodb";import"lru-cache";import"pluralize";import"piscina";import"json5";import"@aws-sdk/util-dynamodb";import"v8";import"react-syntax-highlighter";import"react-syntax-highlighter/dist/cjs/styles/prism/index.js";import"node:crypto";import"minimatch";import"react-markdown";import"remark-gfm";import"react-diff-viewer-continued";export{Z as AnalysisBranchesTableColumns,_ as BranchesTableColumns,$ as CommitsTableColumns,aa as CommitsTableColumnsLite,ea as EntitiesTableColumns,sa as EntityBranchesTableColumns,ta as FilesTableColumns,ra as ProjectsTableColumns,oa as ScenariosTableColumns,ia as createAnalysesTable,ma as createAnalysisBranchesTable,la as createBackgroundJobsTable,pa as createBranchesTable,na as createCommitBranchesTable,ca as createCommitsTable,ba as createEditorScenariosTable,Ta as createEntitiesTable,da as createEntityBranchesTable,ua as createEntityStatementsTable,ha as createFilesTable,Ca as createGithubPayloadsTable,Sa as createGithubUsersTable,ya as createProjectsTable,Ba as createScenarioCommentsTable,Aa as createScenariosTable,Ea as createSqliteSchema,Pa as createStatementsTable,ga as createTeamsTable,ja as createUserScenariosTable,Fa as createUserTeamsTable,Ua as createUsersTable,Da as dbToAnalysis,Ga as dbToAnalysisBranch,Ma as dbToBranch,qa as dbToCommit,Ja as dbToEntity,fa as dbToFile,ka as dbToProject,xa as dbToScenario,Ha as dbToUserScenario,La as deleteScenarios,va as generateSha,wa as getDatabase,za as getJsonHelper,Ia as getPostgreDatabase,Ka as getSqliteDatabase,Na as loadAnalyses,Oa as loadAnalysis,Qa as loadBranches,Ra as loadCommitBranches,Va as loadCommits,Wa as loadEntities,Xa as loadEntity,Ya as loadFiles,Za as loadProject,_a as updateCommitMetadata,$a as updateFreshAnalysisMetadata,ae as updateFreshAnalysisStatus,ee as updateProjectMetadata,se as upsertBranches,te as upsertCommitBranches,re as upsertCommits,oe as upsertGithubUser,ie as upsertProjects,me as upsertScenarios};
@@ -1,4 +1,4 @@
1
- import*as m from"fs/promises";import*as y from"fs";import*as e from"path";import x from"chalk";import{execSync as F}from"child_process";import{h as _,s as b,e as v,P as B,i as E,w as R}from"./progress-CHTtrxFG.js";import{ao as I,ap as W,aq as M,ab as O,ad as T,ar as U,as as A,at as G,F as q,I as Y,an as z,au as N,av as J,x as P}from"./server-build-NZmUqQv6.js";import"fetch-retry";import"typescript";import{fileURLToPath as L}from"url";import"cli-spinners";import"react/jsx-runtime";import"node:stream";import"@react-router/node";import"react-router";import"isbot";import"react-dom/server";import"react";import"lucide-react";import"better-sqlite3";import"pg";import"kysely";import"kysely/helpers/sqlite";import"kysely/helpers/postgres";import"os";import"prompts";import"crypto";import"util";import"dotenv";import"events";import"uuid";import"http";import"net";import"ws";import"node-pty";import"openai";import"p-queue";import"p-retry";import"@aws-sdk/client-dynamodb";import"lru-cache";import"pluralize";import"piscina";import"json5";import"@aws-sdk/util-dynamodb";import"v8";import"react-syntax-highlighter";import"react-syntax-highlighter/dist/cjs/styles/prism/index.js";import"node:crypto";import"minimatch";import"react-markdown";import"remark-gfm";import"react-diff-viewer-continued";function H(a){try{const r=F("git config --get remote.origin.url",{cwd:a,encoding:"utf8"}).trim().match(/github\.com[:/]([^/]+)\/([^/]+?)(?:\.git)?$/);if(r)return`${r[1]}-${r[2]}`}catch{}return e.basename(a)}const V=L(import.meta.url),K=e.dirname(V);async function g(a,t){await m.mkdir(t,{recursive:!0});const r=await m.readdir(a,{withFileTypes:!0});for(const i of r){const s=e.join(a,i.name),o=e.join(t,i.name);i.isDirectory()?await g(s,o):(await m.copyFile(s,o),(i.name.endsWith(".sh")||i.name.endsWith(".mjs"))&&await m.chmod(o,493))}}async function Q(a,t){const r=(t==null?void 0:t.mode)??"memory";try{const i=e.join(a,".claude","skills"),s=e.join(K,"../../templates"),o=e.join(s,"skills"),n=e.join(s,"commands"),u=e.join(i,"codeyam-memory"),p=e.join(i,"codeyam-new-rule");await g(e.join(o,"codeyam-memory"),u),await g(e.join(o,"codeyam-new-rule"),p);const w=r==="editor"||(t==null?void 0:t.editorMode)===!0;if(w){const c=e.join(i,"codeyam-editor");await g(e.join(o,"codeyam-editor"),c);const f=e.join(a,"CLAUDE.md");try{await m.access(f)}catch{await m.copyFile(e.join(s,"codeyam-editor-claude.md"),f)}const d=e.join(a,".codeyam","docs");await m.mkdir(d,{recursive:!0}),await m.copyFile(e.join(s,"codeyam-editor-reference.md"),e.join(d,"editor-reference.md"))}if(r==="full"){const c=e.join(i,"codeyam-setup"),f=e.join(i,"codeyam-sim"),d=e.join(i,"codeyam-test"),h=e.join(i,"codeyam-verify"),S=e.join(i,"codeyam-dev-mode");await g(e.join(o,"codeyam-setup"),c),await g(e.join(o,"codeyam-sim"),f),await g(e.join(o,"codeyam-test"),d),await g(e.join(o,"codeyam-verify"),h),await g(e.join(o,"codeyam-dev-mode"),S);const k=e.join(a,".claude","commands");await m.mkdir(k,{recursive:!0}),await m.copyFile(e.join(n,"codeyam-diagnose.md"),e.join(k,"codeyam-diagnose.md"))}const l=e.join(a,".codeyam","bin");await m.mkdir(l,{recursive:!0});const j=e.join(a,".codeyam","rules");if(await m.mkdir(j,{recursive:!0}),w){try{const c=e.join(l,"editor-step-hook.py");await m.copyFile(e.join(s,"editor-step-hook.py"),c),await m.chmod(c,493)}catch{}try{const c=e.join(s,"seed-adapters"),f=e.join(a,".codeyam","seed-adapters");await g(c,f)}catch{}}try{const c=e.join(l,"memory-hook.sh");await m.copyFile(e.join(s,"codeyam-memory-hook.sh"),c),await m.chmod(c,493)}catch{}try{const c=e.join(l,"rule-reflection-hook.py");await m.copyFile(e.join(s,"rule-reflection-hook.py"),c),await m.chmod(c,493)}catch{}try{const c=e.join(l,"rule-notification-hook.py");await m.copyFile(e.join(s,"rule-notification-hook.py"),c),await m.chmod(c,493)}catch{}try{const c=e.join(l,"prompts");await m.mkdir(c,{recursive:!0});const f=await m.readdir(e.join(s,"prompts"));for(const d of f)await m.copyFile(e.join(s,"prompts",d),e.join(c,d))}catch{}try{await m.copyFile(e.join(s,"rules-instructions.md"),e.join(j,"instructions.md"))}catch{}return{success:!0,skillsPath:e.relative(a,i)}}catch(i){return{success:!1,error:i instanceof Error?i.message:String(i)}}}function X(a,t){const r=(t==null?void 0:t.mode)??"memory";try{const i=e.join(a,".claude"),s=e.join(i,"settings.local.json");y.existsSync(i)||y.mkdirSync(i,{recursive:!0});let o={};if(y.existsSync(s))try{const c=y.readFileSync(s,"utf8");o=JSON.parse(c)}catch{console.warn(`Warning: Could not parse ${s}, will create new file`)}o.permissions||(o.permissions={}),o.permissions.allow||(o.permissions.allow=[]);const n=["Skill(codeyam-memory)","Skill(codeyam-new-rule)","Bash(codeyam)","Bash(codeyam:*)","Read(.codeyam/**)","Edit(.codeyam/**)","Write(.codeyam/**)","Glob(.codeyam/**)"],u=["Skill(codeyam-setup)","Skill(codeyam-sim)","Skill(codeyam-debug)","Skill(codeyam-test)","Skill(codeyam-verify)","Skill(codeyam-dev-mode)","Read(/tmp/**)","Edit(/tmp/**)","Write(/tmp/**)","Glob(/tmp/**)","Bash(npm install:*)","Bash(npm run:*)","Bash(npx:*)","Bash(node:*)","Bash(cp:*)","Bash(mkdir:*)","Bash(chmod:*)","Bash(rm:*)","Bash(curl:*)","Bash(sleep:*)","Bash(echo:*)","Bash(grep:*)","Bash(python3:*)","Bash(cat:*)","Bash(printf:*)","Bash(ls:*)"],p=["Skill(codeyam-editor)","Bash(git:*)","Edit(**)","Write(**)"],w=r==="editor"||(t==null?void 0:t.editorMode)===!0;let l;if(r==="full"?l=[...n,...u]:r==="editor"?l=[...n,...p,...u]:l=n,w&&r!=="editor")for(const c of[...p,...u])l.includes(c)||l.push(c);let j=!1;for(const c of l)o.permissions.allow.includes(c)||(o.permissions.allow.push(c),j=!0);if(w){o.hooks||(o.hooks={});const c='test -f "$CLAUDE_PROJECT_DIR"/.codeyam/bin/editor-step-hook.py && python3 "$CLAUDE_PROJECT_DIR"/.codeyam/bin/editor-step-hook.py || true';for(const f of["PostToolUse","Stop","UserPromptSubmit"]){const d=o.hooks[f]||[];d.some(S=>{var k;return(k=S.hooks)==null?void 0:k.some(C=>{var $;return($=C.command)==null?void 0:$.includes("editor-step-hook")})})||(d.push({hooks:[{type:"command",command:c,timeout:5}]}),o.hooks[f]=d,j=!0)}}return j&&y.writeFileSync(s,JSON.stringify(o,null,2),"utf8"),!0}catch(i){return console.warn(`Warning: Could not configure Claude Code settings: ${i.message}`),!1}}function Z(a){return y.existsSync(a)?y.readFileSync(a,"utf8").split(`
1
+ import*as m from"fs/promises";import*as y from"fs";import*as e from"path";import x from"chalk";import{execSync as F}from"child_process";import{h as _,s as b,e as v,P as B,i as E,w as R}from"./progress-CHTtrxFG.js";import{ao as I,ap as W,aq as M,ab as O,ad as T,ar as U,as as A,at as G,F as q,I as Y,an as z,au as N,av as J,x as P}from"./server-build-Cxzo0Zp2.js";import"fetch-retry";import"typescript";import{fileURLToPath as L}from"url";import"cli-spinners";import"react/jsx-runtime";import"node:stream";import"@react-router/node";import"react-router";import"isbot";import"react-dom/server";import"react";import"lucide-react";import"better-sqlite3";import"pg";import"kysely";import"kysely/helpers/sqlite";import"kysely/helpers/postgres";import"os";import"prompts";import"crypto";import"util";import"dotenv";import"events";import"uuid";import"http";import"net";import"ws";import"node-pty";import"openai";import"p-queue";import"p-retry";import"@aws-sdk/client-dynamodb";import"lru-cache";import"pluralize";import"piscina";import"json5";import"@aws-sdk/util-dynamodb";import"v8";import"react-syntax-highlighter";import"react-syntax-highlighter/dist/cjs/styles/prism/index.js";import"node:crypto";import"minimatch";import"react-markdown";import"remark-gfm";import"react-diff-viewer-continued";function H(a){try{const r=F("git config --get remote.origin.url",{cwd:a,encoding:"utf8"}).trim().match(/github\.com[:/]([^/]+)\/([^/]+?)(?:\.git)?$/);if(r)return`${r[1]}-${r[2]}`}catch{}return e.basename(a)}const V=L(import.meta.url),K=e.dirname(V);async function g(a,t){await m.mkdir(t,{recursive:!0});const r=await m.readdir(a,{withFileTypes:!0});for(const i of r){const s=e.join(a,i.name),o=e.join(t,i.name);i.isDirectory()?await g(s,o):(await m.copyFile(s,o),(i.name.endsWith(".sh")||i.name.endsWith(".mjs"))&&await m.chmod(o,493))}}async function Q(a,t){const r=(t==null?void 0:t.mode)??"memory";try{const i=e.join(a,".claude","skills"),s=e.join(K,"../../templates"),o=e.join(s,"skills"),n=e.join(s,"commands"),u=e.join(i,"codeyam-memory"),p=e.join(i,"codeyam-new-rule");await g(e.join(o,"codeyam-memory"),u),await g(e.join(o,"codeyam-new-rule"),p);const w=r==="editor"||(t==null?void 0:t.editorMode)===!0;if(w){const c=e.join(i,"codeyam-editor");await g(e.join(o,"codeyam-editor"),c);const f=e.join(a,"CLAUDE.md");try{await m.access(f)}catch{await m.copyFile(e.join(s,"codeyam-editor-claude.md"),f)}const d=e.join(a,".codeyam","docs");await m.mkdir(d,{recursive:!0}),await m.copyFile(e.join(s,"codeyam-editor-reference.md"),e.join(d,"editor-reference.md"))}if(r==="full"){const c=e.join(i,"codeyam-setup"),f=e.join(i,"codeyam-sim"),d=e.join(i,"codeyam-test"),h=e.join(i,"codeyam-verify"),S=e.join(i,"codeyam-dev-mode");await g(e.join(o,"codeyam-setup"),c),await g(e.join(o,"codeyam-sim"),f),await g(e.join(o,"codeyam-test"),d),await g(e.join(o,"codeyam-verify"),h),await g(e.join(o,"codeyam-dev-mode"),S);const k=e.join(a,".claude","commands");await m.mkdir(k,{recursive:!0}),await m.copyFile(e.join(n,"codeyam-diagnose.md"),e.join(k,"codeyam-diagnose.md"))}const l=e.join(a,".codeyam","bin");await m.mkdir(l,{recursive:!0});const j=e.join(a,".codeyam","rules");if(await m.mkdir(j,{recursive:!0}),w){try{const c=e.join(l,"editor-step-hook.py");await m.copyFile(e.join(s,"editor-step-hook.py"),c),await m.chmod(c,493)}catch{}try{const c=e.join(s,"seed-adapters"),f=e.join(a,".codeyam","seed-adapters");await g(c,f)}catch{}}try{const c=e.join(l,"memory-hook.sh");await m.copyFile(e.join(s,"codeyam-memory-hook.sh"),c),await m.chmod(c,493)}catch{}try{const c=e.join(l,"rule-reflection-hook.py");await m.copyFile(e.join(s,"rule-reflection-hook.py"),c),await m.chmod(c,493)}catch{}try{const c=e.join(l,"rule-notification-hook.py");await m.copyFile(e.join(s,"rule-notification-hook.py"),c),await m.chmod(c,493)}catch{}try{const c=e.join(l,"prompts");await m.mkdir(c,{recursive:!0});const f=await m.readdir(e.join(s,"prompts"));for(const d of f)await m.copyFile(e.join(s,"prompts",d),e.join(c,d))}catch{}try{await m.copyFile(e.join(s,"rules-instructions.md"),e.join(j,"instructions.md"))}catch{}return{success:!0,skillsPath:e.relative(a,i)}}catch(i){return{success:!1,error:i instanceof Error?i.message:String(i)}}}function X(a,t){const r=(t==null?void 0:t.mode)??"memory";try{const i=e.join(a,".claude"),s=e.join(i,"settings.local.json");y.existsSync(i)||y.mkdirSync(i,{recursive:!0});let o={};if(y.existsSync(s))try{const c=y.readFileSync(s,"utf8");o=JSON.parse(c)}catch{console.warn(`Warning: Could not parse ${s}, will create new file`)}o.permissions||(o.permissions={}),o.permissions.allow||(o.permissions.allow=[]);const n=["Skill(codeyam-memory)","Skill(codeyam-new-rule)","Bash(codeyam)","Bash(codeyam:*)","Read(.codeyam/**)","Edit(.codeyam/**)","Write(.codeyam/**)","Glob(.codeyam/**)"],u=["Skill(codeyam-setup)","Skill(codeyam-sim)","Skill(codeyam-debug)","Skill(codeyam-test)","Skill(codeyam-verify)","Skill(codeyam-dev-mode)","Read(/tmp/**)","Edit(/tmp/**)","Write(/tmp/**)","Glob(/tmp/**)","Bash(npm install:*)","Bash(npm run:*)","Bash(npx:*)","Bash(node:*)","Bash(cp:*)","Bash(mkdir:*)","Bash(chmod:*)","Bash(rm:*)","Bash(curl:*)","Bash(sleep:*)","Bash(echo:*)","Bash(grep:*)","Bash(python3:*)","Bash(cat:*)","Bash(printf:*)","Bash(ls:*)"],p=["Skill(codeyam-editor)","Bash(git:*)","Edit(**)","Write(**)"],w=r==="editor"||(t==null?void 0:t.editorMode)===!0;let l;if(r==="full"?l=[...n,...u]:r==="editor"?l=[...n,...p,...u]:l=n,w&&r!=="editor")for(const c of[...p,...u])l.includes(c)||l.push(c);let j=!1;for(const c of l)o.permissions.allow.includes(c)||(o.permissions.allow.push(c),j=!0);if(w){o.hooks||(o.hooks={});const c='test -f "$CLAUDE_PROJECT_DIR"/.codeyam/bin/editor-step-hook.py && python3 "$CLAUDE_PROJECT_DIR"/.codeyam/bin/editor-step-hook.py || true';for(const f of["PostToolUse","Stop","UserPromptSubmit"]){const d=o.hooks[f]||[];d.some(S=>{var k;return(k=S.hooks)==null?void 0:k.some(C=>{var $;return($=C.command)==null?void 0:$.includes("editor-step-hook")})})||(d.push({hooks:[{type:"command",command:c,timeout:5}]}),o.hooks[f]=d,j=!0)}}return j&&y.writeFileSync(s,JSON.stringify(o,null,2),"utf8"),!0}catch(i){return console.warn(`Warning: Could not configure Claude Code settings: ${i.message}`),!1}}function Z(a){return y.existsSync(a)?y.readFileSync(a,"utf8").split(`
2
2
  `).map(r=>r.trim()).filter(r=>r&&!r.startsWith("#")).map(r=>r.startsWith("/")?r.slice(1):r):[]}function ee(a){const t=[];function r(i){const s=e.join(i,".gitignore");if(y.existsSync(s)){const o=Z(s),n=e.relative(a,i),u=o.map(p=>n?e.join(n,p):p);t.push(...u)}try{const o=y.readdirSync(i,{withFileTypes:!0});for(const n of o)n.isDirectory()&&n.name!=="node_modules"&&n.name!==".git"&&n.name!=="dist"&&n.name!=="build"&&r(e.join(i,n.name))}catch{}}return r(a),t}function te(a){let t=a.replace(/\/$/,"");const r=t.startsWith("**/");r&&(t=t.slice(3));const i=t.startsWith("/");return i&&(t=t.slice(1)),t=t.replace(/[.+^${}()|[\]\\*?]/g,"\\$&"),t=t.replace(/\\\*\\\*/g,".*").replace(/\\\*/g,"[^/]*").replace(/\\\?/g,"."),i&&!r?`^${t}(/.*)?$`:`^(.*/)?${t}(/.*)?$`}function oe(){return["^(.*/)?node_modules/.*$","^(.*/)?dist/.*$","^(.*/)?build/.*$","^(.*/)?\\.next/.*$","^(.*/)?out/.*$","^(.*/)?\\.cache/.*$","^(.*/)?__tests__/.*$","^(.*/)?__mocks__/.*$","^(.*/)?.+\\.test\\.(ts|tsx|js|jsx)$","^(.*/)?.+\\.spec\\.(ts|tsx|js|jsx)$","^(.*/)?test/.*$","^(.*/)?tests/.*$","^(.*/)?__test","^(.*/)?\\.git/.*$","^(.*/)?coverage/.*$","^(.*/)?\\.nyc_output/.*$","^(.*/)?\\.vscode/.*$","^(.*/)?\\.idea/.*$","^(.*/)?\\.DS_Store$"]}function ie(a){const t=oe();try{const i=ee(a).filter(o=>o.trim().length>0).map(o=>te(o)),s=[...t,...i];return Array.from(new Set(s))}catch(r){return console.warn("Failed to load gitignore patterns:",r),t}}const tt={command:"init",describe:"Initialize a project for CodeYam CLI analysis",builder:{force:{type:"boolean",alias:"f",describe:"Force initialization even if .codeyam already exists",default:!1},"keep-server":{type:"boolean",describe:"Skip stopping the running CodeYam server (use when running inside the editor)",default:!1}},handler:async a=>{_("Initializing CodeYam CLI project");let t=I();if(t&&!a.force){b("Project already initialized. Use --force to reinitialize.");return}if(t||(t=process.cwd()),W(t)){v("Cannot initialize CodeYam in your home directory or filesystem root."),v("Please run codeyam init from inside a project directory.");return}M(t);const{running:r}=O();r&&!a["keep-server"]&&(T()?b("CodeYam server stopped"):v("Failed to stop CodeYam server - it may have already stopped"));const i=e.join(t,".codeyam"),s=e.join(i,"config.json"),o=new B;try{o.start("Setting up project scaffolding..."),await m.mkdir(i,{recursive:!0}),await ae(t),o.succeed("Project scaffolding ready");let n=H(t);try{const d=JSON.parse(y.readFileSync(s,"utf8"));d.projectSlug&&!d.projectSlug.startsWith("local-")&&(n=d.projectSlug)}catch{}const u=re(t);let p=[];try{p=U(t)}catch{}if(p.length>0){const d=p.map(h=>`${h.path==="."?"Root":h.path} (${h.framework})`).join(", ");E(`Found ${p.length} web application${p.length>1?"s":""}: ${d}`)}o.start("Configuring project...");const w=A(s),l={projectSlug:n,packageManager:u,webapps:p,environmentVariables:[],createdAt:new Date().toISOString(),...w};await m.writeFile(s,JSON.stringify(l,null,2));const j=G();if(!y.existsSync(j)){const d=q(j);await Y(d)}if(!await R(()=>z())){o.fail("Environment validation failed");return}try{const{project:d}=await N({slug:n,packageManager:u,unapprovedPaths:ie(t),webapps:p});o.succeed("Project configured"),o.start("Installing Claude Code skills...");const h=!!a["keep-server"],S=await Q(t,{mode:h?"editor":"memory",editorMode:h}),{branch:k}=await J(d);l.branchId=k.id,await m.writeFile(s,JSON.stringify(l,null,2)),X(t,{mode:h?"editor":"memory",editorMode:h}),S.success?o.succeed("Claude Code skills installed"):o.warn("Could not install skills");try{a["keep-server"]?await P({projectSlug:n,metadataUpdate:{editorMode:!0,labs:{simulations:!0}}}):await P({projectSlug:n,metadataUpdate:{labs:{simulations:!1}}})}catch{}l.aiMode="interactive"}catch(d){o.fail("Failed to create project"),v(d.message);return}const f=p.length>0?`, ${p.map(d=>d.framework).join(", ")}`:"";console.log(),b(`✨ Initialized ${n} (${u}${f})`),a.autoInit||(console.log(),console.log(x.bold(' Run "codeyam" to start the dashboard')),console.log(' Run "codeyam --help" for all commands'))}catch(n){o.fail("Failed to initialize project"),v(n.message),process.exit(1)}}};function re(a){return y.existsSync(e.join(a,"pnpm-lock.yaml"))?"pnpm":y.existsSync(e.join(a,"yarn.lock"))?"yarn":(y.existsSync(e.join(a,"package-lock.json")),"npm")}const D=[".codeyam/db.sqlite3",".codeyam/db.sqlite3-wal",".codeyam/db.sqlite3-shm",".codeyam/secrets.json",".codeyam/server.json",".codeyam/server-state.json",".codeyam/queue.json",".codeyam/active-scenario.json",".codeyam/editor-step.json",".codeyam/editor-user-prompt.txt",".codeyam/claude-session-id.txt",".codeyam/editor-mode-context.md",".codeyam/dev-mode-context.md",".codeyam/logs/",".codeyam/llm-calls/",".codeyam/captures/",".codeyam/results/",".codeyam/tmp/",".codeyam/rules/",".codeyam/bin/",".codeyam/docs/"];async function ae(a){const t=e.join(a,".gitignore");let r="";try{r=await m.readFile(t,"utf8")}catch{}const i=r.split(`
3
3
  `),s=i.findIndex(n=>n.trim()===".codeyam"||n.trim()==="/.codeyam");if(s!==-1){const n=s>0&&i[s-1].trim().startsWith("# CodeYam local files")?s-1:s;i.splice(n,s-n+1),r=i.join(`
4
4
  `)}if(!D.some(n=>i.some(u=>u.trim()===n))){const n=`