@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{j as e}from"./jsx-runtime-D_zvdyIk.js";import{r as i,d as ge,L as ie}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{I as be}from"./InteractivePreview-CKeQT5Ty.js";import{V as je}from"./ViewportInspectBar-BA_Ry-rs.js";import{u as we,S as Ne}from"./useCustomSizes-DhXHbEjP.js";import{L as J}from"./LogViewer-CM5zg40N.js";import{S as ve}from"./SafeScreenshot-DanvyBPb.js";import{u as ke}from"./useLastLogLine-BNd5hYuW.js";import{u as Ce}from"./Spinner-D0LgAaSa.js";import{_ as ye}from"./preload-helper-ckwbz45p.js";import{R as Ie}from"./ReportIssueModal-C2PLkej3.js";import{C as Ee,a as Le}from"./copy-C6iF61Xs.js";import{g as Pe}from"./scenarioStatus-B_8jpV3e.js";function $e({presets:s,customSizes:t,currentWidth:n,currentHeight:o,scale:v,onSizeChange:N,onSaveCustomSize:w,onRemoveCustomSize:d,className:k=""}){const[h,x]=i.useState(!1),[g,b]=i.useState(String(n)),[m,j]=i.useState(String(o)),[C,u]=i.useState(!1),[l,R]=i.useState(!1),P=i.useRef(null);i.useEffect(()=>{C||b(String(n))},[n,C]),i.useEffect(()=>{l||j(String(o))},[o,l]),i.useEffect(()=>{const r=f=>{P.current&&!P.current.contains(f.target)&&x(!1)};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[]);const $=i.useMemo(()=>{const r=s.find(c=>c.width===n&&c.height===o);if(r)return r.name;const f=t.find(c=>c.width===n&&c.height===o);return f?f.name:"Custom"},[s,t,n,o]),O=$==="Custom",S=r=>{N(r.width,r.height),x(!1)},W=r=>{const f=r.target.value;b(f);const c=parseInt(f,10);!isNaN(c)&&c>0&&N(c,o)},U=r=>{const f=r.target.value;j(f);const c=parseInt(f,10);!isNaN(c)&&c>0&&N(n,c)},A=()=>{u(!1);const r=parseInt(g,10);(isNaN(r)||r<=0)&&b(String(n))},K=()=>{R(!1);const r=parseInt(m,10);(isNaN(r)||r<=0)&&j(String(o))},D=r=>{(r.key==="Enter"||r.key==="Escape")&&r.target.blur()};return e.jsxs("div",{className:`flex items-center gap-3 ${k}`,children:[e.jsxs("div",{className:"relative",ref:P,children:[e.jsxs("button",{onClick:()=>x(!h),className:"flex items-center gap-2 px-3 py-1.5 bg-white border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 min-w-[120px] justify-between",children:[e.jsx("span",{children:$}),e.jsx("svg",{className:`w-4 h-4 transition-transform ${h?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),h&&e.jsx("div",{className:"absolute top-full left-0 mt-1 min-w-full bg-white border border-gray-200 rounded-md shadow-lg z-50",children:e.jsxs("div",{className:"py-1",children:[s.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 py-1 text-xs font-semibold text-gray-500 uppercase tracking-wider whitespace-nowrap",children:"Presets"}),s.map(r=>e.jsxs("button",{onClick:()=>S(r),className:`w-full text-left px-3 py-2 text-sm hover:bg-gray-100 flex justify-between items-center gap-4 whitespace-nowrap ${$===r.name?"bg-[#f0f7f9] text-[#005c75]":"text-gray-700"}`,children:[e.jsx("span",{children:r.name}),e.jsxs("span",{className:"text-xs text-gray-500",children:[r.width," x ",r.height]})]},r.name))]}),t.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-gray-100 my-1"}),e.jsx("div",{className:"px-3 py-1 text-xs font-semibold text-gray-500 uppercase tracking-wider whitespace-nowrap",children:"Custom"}),[...t].sort((r,f)=>r.width-f.width).map(r=>e.jsxs("div",{className:`flex items-center gap-1 hover:bg-gray-100 ${$===r.name?"bg-[#f0f7f9] text-[#005c75]":"text-gray-700"}`,children:[e.jsxs("button",{onClick:()=>S(r),className:"flex-1 text-left px-3 py-2 text-sm flex justify-between items-center gap-4 whitespace-nowrap cursor-pointer",children:[e.jsx("span",{children:r.name}),e.jsxs("span",{className:"text-xs text-gray-500",children:[r.width," x ",r.height]})]}),d&&e.jsx("button",{onClick:f=>{f.stopPropagation(),$===r.name&&s.length>0&&N(s[0].width,s[0].height),d(r.name)},className:"p-1.5 mr-1 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded cursor-pointer transition-colors",title:"Remove custom size",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},r.name))]})]})})]}),e.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{type:"text",value:g,onChange:W,onFocus:()=>u(!0),onBlur:A,onKeyDown:D,className:"w-16 px-2 py-1 text-right border border-gray-300 rounded-l-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"}),e.jsx("span",{className:"px-2 py-1 bg-gray-100 border border-l-0 border-gray-300 rounded-r-md text-gray-500 text-sm",children:"px"})]}),e.jsx("span",{className:"text-gray-400 mx-1",children:"×"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{type:"text",value:m,onChange:U,onFocus:()=>R(!0),onBlur:K,onKeyDown:D,className:"w-16 px-2 py-1 text-right border border-gray-300 rounded-l-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"}),e.jsx("span",{className:"px-2 py-1 bg-gray-100 border border-l-0 border-gray-300 rounded-r-md text-gray-500 text-sm",children:"px"})]}),v!==void 0&&v<1&&e.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",Math.round(v*100),"%)"]})]}),O&&e.jsx("button",{onClick:w,className:"px-3 py-1.5 bg-[#005c75] text-white text-sm font-medium rounded-md hover:bg-[#004a5c] focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 transition-colors",children:"Save Custom Size"})]})}function de({size:s=24,className:t=""}){return e.jsxs("svg",{width:s,height:s,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z",fill:"#ef4444",stroke:"none"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13",stroke:"#FFFFFF",strokeWidth:"2",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1",fill:"#FFFFFF"})]})}function _e({scenario:s,analysis:t,entity:n}){var w,d,k;const o=((w=s.metadata)==null?void 0:w.executionResult)||null,v=((k=(d=s.metadata)==null?void 0:d.data)==null?void 0:k.argumentsData)||[],N=h=>{var j,C,u;if(!h)return"No execution results available yet. Run the function to capture side effects including console output, file operations, and API calls.";const x=[],g=((j=h.sideEffects)==null?void 0:j.consoleOutput)||[];g.length>0&&(x.push(`Console Output: ${g.length} log ${g.length===1?"entry":"entries"} captured`),g.forEach(l=>{x.push(` [${l.level.toUpperCase()}] ${l.args.join(" ")}`)}));const b=((C=h.sideEffects)==null?void 0:C.fileWrites)||[];b.length>0&&(x.push(`
1
+ import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{r as i,d as ge,L as ie}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{I as be}from"./InteractivePreview-DtYTSPL2.js";import{V as je}from"./ViewportInspectBar-BA_Ry-rs.js";import{u as we,S as Ne}from"./useCustomSizes-DhXHbEjP.js";import{L as J}from"./LogViewer-CM5zg40N.js";import{S as ve}from"./SafeScreenshot-DanvyBPb.js";import{u as ke}from"./useLastLogLine-D9QZKaLJ.js";import{u as Ce}from"./Spinner-Bc8BG-Lw.js";import{_ as ye}from"./preload-helper-ckwbz45p.js";import{R as Ie}from"./ReportIssueModal-C2PLkej3.js";import{C as Ee,a as Le}from"./copy-C6iF61Xs.js";import{g as Pe}from"./scenarioStatus-B_8jpV3e.js";function $e({presets:s,customSizes:t,currentWidth:n,currentHeight:o,scale:v,onSizeChange:N,onSaveCustomSize:w,onRemoveCustomSize:d,className:k=""}){const[h,x]=i.useState(!1),[g,b]=i.useState(String(n)),[m,j]=i.useState(String(o)),[C,u]=i.useState(!1),[l,R]=i.useState(!1),P=i.useRef(null);i.useEffect(()=>{C||b(String(n))},[n,C]),i.useEffect(()=>{l||j(String(o))},[o,l]),i.useEffect(()=>{const r=f=>{P.current&&!P.current.contains(f.target)&&x(!1)};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[]);const $=i.useMemo(()=>{const r=s.find(c=>c.width===n&&c.height===o);if(r)return r.name;const f=t.find(c=>c.width===n&&c.height===o);return f?f.name:"Custom"},[s,t,n,o]),O=$==="Custom",S=r=>{N(r.width,r.height),x(!1)},W=r=>{const f=r.target.value;b(f);const c=parseInt(f,10);!isNaN(c)&&c>0&&N(c,o)},U=r=>{const f=r.target.value;j(f);const c=parseInt(f,10);!isNaN(c)&&c>0&&N(n,c)},A=()=>{u(!1);const r=parseInt(g,10);(isNaN(r)||r<=0)&&b(String(n))},K=()=>{R(!1);const r=parseInt(m,10);(isNaN(r)||r<=0)&&j(String(o))},D=r=>{(r.key==="Enter"||r.key==="Escape")&&r.target.blur()};return e.jsxs("div",{className:`flex items-center gap-3 ${k}`,children:[e.jsxs("div",{className:"relative",ref:P,children:[e.jsxs("button",{onClick:()=>x(!h),className:"flex items-center gap-2 px-3 py-1.5 bg-white border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 min-w-[120px] justify-between",children:[e.jsx("span",{children:$}),e.jsx("svg",{className:`w-4 h-4 transition-transform ${h?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),h&&e.jsx("div",{className:"absolute top-full left-0 mt-1 min-w-full bg-white border border-gray-200 rounded-md shadow-lg z-50",children:e.jsxs("div",{className:"py-1",children:[s.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 py-1 text-xs font-semibold text-gray-500 uppercase tracking-wider whitespace-nowrap",children:"Presets"}),s.map(r=>e.jsxs("button",{onClick:()=>S(r),className:`w-full text-left px-3 py-2 text-sm hover:bg-gray-100 flex justify-between items-center gap-4 whitespace-nowrap ${$===r.name?"bg-[#f0f7f9] text-[#005c75]":"text-gray-700"}`,children:[e.jsx("span",{children:r.name}),e.jsxs("span",{className:"text-xs text-gray-500",children:[r.width," x ",r.height]})]},r.name))]}),t.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-gray-100 my-1"}),e.jsx("div",{className:"px-3 py-1 text-xs font-semibold text-gray-500 uppercase tracking-wider whitespace-nowrap",children:"Custom"}),[...t].sort((r,f)=>r.width-f.width).map(r=>e.jsxs("div",{className:`flex items-center gap-1 hover:bg-gray-100 ${$===r.name?"bg-[#f0f7f9] text-[#005c75]":"text-gray-700"}`,children:[e.jsxs("button",{onClick:()=>S(r),className:"flex-1 text-left px-3 py-2 text-sm flex justify-between items-center gap-4 whitespace-nowrap cursor-pointer",children:[e.jsx("span",{children:r.name}),e.jsxs("span",{className:"text-xs text-gray-500",children:[r.width," x ",r.height]})]}),d&&e.jsx("button",{onClick:f=>{f.stopPropagation(),$===r.name&&s.length>0&&N(s[0].width,s[0].height),d(r.name)},className:"p-1.5 mr-1 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded cursor-pointer transition-colors",title:"Remove custom size",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},r.name))]})]})})]}),e.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{type:"text",value:g,onChange:W,onFocus:()=>u(!0),onBlur:A,onKeyDown:D,className:"w-16 px-2 py-1 text-right border border-gray-300 rounded-l-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"}),e.jsx("span",{className:"px-2 py-1 bg-gray-100 border border-l-0 border-gray-300 rounded-r-md text-gray-500 text-sm",children:"px"})]}),e.jsx("span",{className:"text-gray-400 mx-1",children:"×"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{type:"text",value:m,onChange:U,onFocus:()=>R(!0),onBlur:K,onKeyDown:D,className:"w-16 px-2 py-1 text-right border border-gray-300 rounded-l-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"}),e.jsx("span",{className:"px-2 py-1 bg-gray-100 border border-l-0 border-gray-300 rounded-r-md text-gray-500 text-sm",children:"px"})]}),v!==void 0&&v<1&&e.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",Math.round(v*100),"%)"]})]}),O&&e.jsx("button",{onClick:w,className:"px-3 py-1.5 bg-[#005c75] text-white text-sm font-medium rounded-md hover:bg-[#004a5c] focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 transition-colors",children:"Save Custom Size"})]})}function de({size:s=24,className:t=""}){return e.jsxs("svg",{width:s,height:s,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z",fill:"#ef4444",stroke:"none"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13",stroke:"#FFFFFF",strokeWidth:"2",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1",fill:"#FFFFFF"})]})}function _e({scenario:s,analysis:t,entity:n}){var w,d,k;const o=((w=s.metadata)==null?void 0:w.executionResult)||null,v=((k=(d=s.metadata)==null?void 0:d.data)==null?void 0:k.argumentsData)||[],N=h=>{var j,C,u;if(!h)return"No execution results available yet. Run the function to capture side effects including console output, file operations, and API calls.";const x=[],g=((j=h.sideEffects)==null?void 0:j.consoleOutput)||[];g.length>0&&(x.push(`Console Output: ${g.length} log ${g.length===1?"entry":"entries"} captured`),g.forEach(l=>{x.push(` [${l.level.toUpperCase()}] ${l.args.join(" ")}`)}));const b=((C=h.sideEffects)==null?void 0:C.fileWrites)||[];b.length>0&&(x.push(`
2
2
  File System Operations: ${b.length} ${b.length===1?"operation":"operations"} detected`),b.forEach(l=>{x.push(` ${l.operation}: ${l.path}${l.size?` (${l.size} bytes)`:""}`)}));const m=((u=h.sideEffects)==null?void 0:u.apiCalls)||[];return m.length>0&&(x.push(`
3
3
  API Calls: ${m.length} ${m.length===1?"call":"calls"} made`),m.forEach(l=>{x.push(` ${l.method} ${l.url}${l.status?` → ${l.status}`:""}${l.duration?` (${l.duration}ms)`:""}`)})),h.error&&x.push(`
4
4
  Error: ${h.error.name||"Error"}: ${h.error.message}`),x.length===0?"No side effects detected. The function executed without console output, file operations, or API calls.":x.join(`
@@ -0,0 +1,34 @@
1
+ import{d as V,r as e}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{u as W}from"./useLastLogLine-D9QZKaLJ.js";import{j as C}from"./jsx-runtime-D_zvdyIk.js";function g(c){const t=c.replace(/[^a-zA-Z0-9_]+/g,"_");return t.slice(0,1).toUpperCase()+t.slice(1)}async function K(c,t){try{await fetch("/api/interactive-switch-scenario",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({scenarioId:c,scenarioName:t})})}catch(s){console.error("[useInteractiveMode] Failed to seed scenario:",s)}}function ee({analysisId:c,scenarioId:t,scenarioName:s,entityName:d,projectSlug:h,enabled:x=!0,refreshTrigger:w=0}){const _=V(),[u,b]=e.useState(null),[J,z]=e.useState(!1),[Z,p]=e.useState(!1),[$,v]=e.useState(!1),y=e.useRef(!1),j=e.useRef(void 0),E=e.useRef(null),L=e.useRef(null),M=e.useRef(null),U=e.useRef(null),[k,R]=e.useState(0),[G,A]=e.useState(0),a=e.useRef(null),f=e.useRef(!1),m=e.useRef(!1),l=e.useRef(s),{interactiveUrl:F,scenarioUrlMap:q,resetLogs:I}=W(h,x),O=e.useRef(t);e.useEffect(()=>{l.current=s},[s]);const P=e.useRef(w);e.useEffect(()=>{P.current!==w&&(P.current=w,u&&(p(!0),v(!1),R(0),A(n=>n+1),f.current=!1,m.current=!1,a.current&&(clearTimeout(a.current),a.current=null)))},[w,u]),e.useEffect(()=>{if(O.current===t||(O.current=t,!u||!t))return;p(!0),v(!1),R(0),f.current=!1,m.current=!1,l.current=s,a.current&&(clearTimeout(a.current),a.current=null),(async()=>{await K(t,s);const r=E.current;let o;if(r&&r[t])o=r[t]+"?width=600px";else if(L.current&&M.current&&s){if(o=L.current,U.current&&d){const S=g(U.current),D=g(d);S!==D&&(o=o.replace(S,D))}const i=g(M.current),B=g(s);o=o.replace(i,B)}else o=u;b(o),A(i=>i+1)})()},[t,s,d,u]),e.useEffect(()=>{if(F){const n=F+"?width=600px";q&&(E.current=q),L.current=n,s&&(M.current=s),d&&(U.current=d),z(!1),p(!0),(async()=>{t&&s&&await K(t,s);const o=E.current,i=t&&o&&o[t]?o[t]+"?width=600px":n;b(i)})()}},[F]);const T=()=>{v(!0),j.current=t;const n=l.current;requestAnimationFrame(()=>{requestAnimationFrame(()=>{l.current===n&&p(!1)})})};e.useEffect(()=>{const n=r=>{if(r.data.type==="codeyam-resize"){if(r.data.name&&l.current&&r.data.name!==l.current)return;f.current||(f.current=!0,a.current&&(clearTimeout(a.current),a.current=null),R(0),m.current&&T())}};return window.addEventListener("message",n),()=>window.removeEventListener("message",n)},[]);const H=()=>{if(m.current=!0,f.current){T();return}a.current&&clearTimeout(a.current);const n=300*Math.pow(2,k);a.current=setTimeout(()=>{f.current||(k<2?(R(r=>r+1),A(r=>r+1),p(!0),m.current=!1):(console.error("[useInteractiveMode] Interactive mode failed to load after 3 attempts - showing iframe anyway"),T()))},n)};e.useEffect(()=>{x&&!y.current&&t&&c&&(y.current=!0,z(!0),v(!1),b(null),(async()=>{if(h)try{await fetch(`/api/logs/${h}`,{method:"DELETE"})}catch(r){console.error("[useInteractiveMode] Failed to clear log file:",r)}I(),_.submit({action:"start",analysisId:c,scenarioId:t},{method:"post",action:"/api/interactive-mode"})})())},[x,t,c,I,h]),e.useEffect(()=>{const n=c,r=()=>{if(y.current&&n){const i=new URLSearchParams({action:"stop",analysisId:n});navigator.sendBeacon("/api/interactive-mode",i)||fetch("/api/interactive-mode",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i,keepalive:!0}).catch(S=>console.error("Failed to stop interactive mode:",S))}},o=()=>{r()};return window.addEventListener("beforeunload",o),()=>{window.removeEventListener("beforeunload",o),r()}},[c]);const Q=$&&j.current===t;return{interactiveServerUrl:u,isStarting:J,isLoading:Z,showIframe:Q,iframeKey:G,onIframeLoad:H}}function te(){return C.jsxs("div",{className:"spinner-container",children:[C.jsx("span",{className:"loader"}),C.jsx("style",{children:`
2
+ .loader {
3
+ width: 48px;
4
+ height: 48px;
5
+ border: 3px solid rgba(0, 92, 117, 0.2);
6
+ border-radius: 50%;
7
+ display: inline-block;
8
+ position: relative;
9
+ box-sizing: border-box;
10
+ animation: rotation 1s linear infinite;
11
+ }
12
+ .loader::after {
13
+ content: '';
14
+ box-sizing: border-box;
15
+ position: absolute;
16
+ left: 50%;
17
+ top: 50%;
18
+ transform: translate(-50%, -50%);
19
+ width: 56px;
20
+ height: 56px;
21
+ border-radius: 50%;
22
+ border: 3px solid;
23
+ border-color: #005c75 transparent;
24
+ }
25
+
26
+ @keyframes rotation {
27
+ 0% {
28
+ transform: rotate(0deg);
29
+ }
30
+ 100% {
31
+ transform: rotate(360deg);
32
+ }
33
+ }
34
+ `})]})}export{te as S,ee as u};
@@ -1,4 +1,4 @@
1
- import{r as u,L as p,w as se,u as te,d as ae,f as re}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{u as ne}from"./useLastLogLine-BNd5hYuW.js";import{u as le}from"./useToast-5HR2j9ZE.js";import{u as oe}from"./useReportContext-Cy5Qg_UR.js";import{L as ie}from"./LogViewer-CM5zg40N.js";import{I as E,C as P,E as ce}from"./EntityTypeIcon-CD7lGABo.js";import{S as Y}from"./SafeScreenshot-DanvyBPb.js";import{g as de}from"./scenarioStatus-B_8jpV3e.js";import{c as q}from"./createLucideIcon-4ImjHTVC.js";import{C as xe}from"./circle-check-DFcQkN5j.js";import{L as S}from"./loader-circle-De-7qQ2u.js";/**
1
+ import{r as u,L as p,w as se,u as te,d as ae,f as re}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{u as ne}from"./useLastLogLine-D9QZKaLJ.js";import{u as le}from"./useToast-5HR2j9ZE.js";import{u as oe}from"./useReportContext-Cy5Qg_UR.js";import{L as ie}from"./LogViewer-CM5zg40N.js";import{I as E,C as P,E as ce}from"./EntityTypeIcon-CD7lGABo.js";import{S as Y}from"./SafeScreenshot-DanvyBPb.js";import{g as de}from"./scenarioStatus-B_8jpV3e.js";import{c as q}from"./createLucideIcon-4ImjHTVC.js";import{C as xe}from"./circle-check-DFcQkN5j.js";import{L as S}from"./loader-circle-De-7qQ2u.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{w as se,u as te,j as re,r as f,L as b,f as R}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{L as oe}from"./LogViewer-CM5zg40N.js";import{u as ie}from"./useLastLogLine-BNd5hYuW.js";import{u as le}from"./useReportContext-Cy5Qg_UR.js";import{E as q}from"./EntityTypeIcon-CD7lGABo.js";import{E as ee}from"./EntityTypeBadge-CQgyEGV-.js";import{S as Z}from"./SafeScreenshot-DanvyBPb.js";import{L as ae}from"./LoadingDots-By5zI316.js";import{L as ne}from"./loader-circle-De-7qQ2u.js";import{P as ce,F as de}from"./pause-CFxEKL1u.js";import{c as X}from"./createLucideIcon-4ImjHTVC.js";/**
1
+ import{w as se,u as te,j as re,r as f,L as b,f as R}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{L as oe}from"./LogViewer-CM5zg40N.js";import{u as ie}from"./useLastLogLine-D9QZKaLJ.js";import{u as le}from"./useReportContext-Cy5Qg_UR.js";import{E as q}from"./EntityTypeIcon-CD7lGABo.js";import{E as ee}from"./EntityTypeBadge-CQgyEGV-.js";import{S as Z}from"./SafeScreenshot-DanvyBPb.js";import{L as ae}from"./LoadingDots-By5zI316.js";import{L as ne}from"./loader-circle-De-7qQ2u.js";import{P as ce,F as de}from"./pause-CFxEKL1u.js";import{c as X}from"./createLucideIcon-4ImjHTVC.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{w as t,d as r}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{S as i}from"./ScenarioViewer-DUMfcNVK.js";import{W as n}from"./InteractivePreview-CKeQT5Ty.js";import"./ViewportInspectBar-BA_Ry-rs.js";import"./useCustomSizes-DhXHbEjP.js";import"./LogViewer-CM5zg40N.js";import"./SafeScreenshot-DanvyBPb.js";import"./useLastLogLine-BNd5hYuW.js";import"./Spinner-D0LgAaSa.js";import"./preload-helper-ckwbz45p.js";import"./ReportIssueModal-C2PLkej3.js";import"./createLucideIcon-4ImjHTVC.js";import"./circle-check-DFcQkN5j.js";import"./triangle-alert-DqJ0j69l.js";import"./copy-C6iF61Xs.js";import"./scenarioStatus-B_8jpV3e.js";import"./InlineSpinner-CgTNOhnu.js";const S=()=>[{title:"Empty State - CodeYam"},{name:"description",content:"Simulations empty state development view"}],L=t(function(){r();const s={sha:"mock-sha",name:"Dashboard",filePath:"codeyam-cli/src/webserver/app/routes/_index.tsx",entityType:"visual"};return e.jsx(n,{children:e.jsxs("div",{className:"h-screen bg-[#F8F7F6] 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-center h-full px-6 gap-6",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",className:"shrink-0",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-lg font-semibold text-black m-0 leading-[26px] shrink-0",children:"Dashboard"}),e.jsx("span",{className:"text-xs text-[#626262] font-mono whitespace-nowrap overflow-hidden text-ellipsis min-w-0",children:"codeyam-cli/src/webserver/app/routes/_index.tsx"})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 px-[15px] py-0 h-[26px] bg-[#efefef] border border-[#e1e1e1] rounded",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-[#626262]"}),e.jsx("span",{className:"text-xs font-semibold text-[#626262]",children:"Not analyzed"})]}),e.jsx("button",{className:"px-[15px] py-0 h-[26px] bg-[#005c75] text-white rounded text-xs font-semibold border-none cursor-pointer hover:bg-[#004a5e] transition-colors",children:"Analyze"})]}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-[#626262] ml-auto",children:[e.jsx("span",{className:"leading-[22px]",children:"Next Entity"}),e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M4 8.5H13M13 8.5L8.5 4M13 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})}),e.jsx("div",{className:"bg-[#efefef] border-b border-[#efefef] shrink-0",children:e.jsxs("div",{className:"flex items-center gap-3 h-11 px-[15px]",children:[e.jsxs("div",{className:"px-4 flex items-center justify-center gap-3 shrink-0 text-sm rounded bg-[#343434] text-[#efefef] font-semibold h-8",children:["Scenarios",e.jsx("span",{className:"px-2 py-0.5 rounded-[9px] text-xs font-semibold bg-[#cbf3fa] text-[#005c75] min-w-[25px] text-center",children:"0"})]}),e.jsxs("div",{className:"px-4 flex items-center justify-center gap-3 shrink-0 text-sm rounded-[9px] text-[#3e3e3e] font-normal",children:["Related Entities",e.jsx("span",{className:"px-2 py-0.5 rounded-[9px] text-xs font-semibold bg-[#e1e1e1] text-[#3e3e3e] min-w-[25px] text-center",children:"5"})]}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"Code"}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"Data Structure"}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"History"})]})}),e.jsxs("div",{className:"flex flex-1 gap-0 min-h-0",children:[e.jsx("div",{className:"w-[165px] bg-[#e1e1e1] border-r border-[#c7c7c7] flex items-center justify-center shrink-0",children:e.jsx("span",{className:"text-xs font-medium text-[#8e8e8e] leading-5",children:"No Scenarios"})}),e.jsx(i,{selectedScenario:null,analysis:void 0,entity:s,viewMode:"screenshot",cacheBuster:Date.now(),hasScenarios:!1,isAnalyzing:!1,projectSlug:null,hasAnApiKey:!0})]})]})})});export{L as default,S as meta};
1
+ import{w as t,d as r}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{S as i}from"./ScenarioViewer-CefgqbCr.js";import{W as n}from"./InteractivePreview-DtYTSPL2.js";import"./ViewportInspectBar-BA_Ry-rs.js";import"./useCustomSizes-DhXHbEjP.js";import"./LogViewer-CM5zg40N.js";import"./SafeScreenshot-DanvyBPb.js";import"./useLastLogLine-D9QZKaLJ.js";import"./Spinner-Bc8BG-Lw.js";import"./preload-helper-ckwbz45p.js";import"./ReportIssueModal-C2PLkej3.js";import"./createLucideIcon-4ImjHTVC.js";import"./circle-check-DFcQkN5j.js";import"./triangle-alert-DqJ0j69l.js";import"./copy-C6iF61Xs.js";import"./scenarioStatus-B_8jpV3e.js";import"./InlineSpinner-CgTNOhnu.js";const S=()=>[{title:"Empty State - CodeYam"},{name:"description",content:"Simulations empty state development view"}],L=t(function(){r();const s={sha:"mock-sha",name:"Dashboard",filePath:"codeyam-cli/src/webserver/app/routes/_index.tsx",entityType:"visual"};return e.jsx(n,{children:e.jsxs("div",{className:"h-screen bg-[#F8F7F6] 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-center h-full px-6 gap-6",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",className:"shrink-0",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-lg font-semibold text-black m-0 leading-[26px] shrink-0",children:"Dashboard"}),e.jsx("span",{className:"text-xs text-[#626262] font-mono whitespace-nowrap overflow-hidden text-ellipsis min-w-0",children:"codeyam-cli/src/webserver/app/routes/_index.tsx"})]}),e.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 px-[15px] py-0 h-[26px] bg-[#efefef] border border-[#e1e1e1] rounded",children:[e.jsx("div",{className:"w-2 h-2 rounded-full bg-[#626262]"}),e.jsx("span",{className:"text-xs font-semibold text-[#626262]",children:"Not analyzed"})]}),e.jsx("button",{className:"px-[15px] py-0 h-[26px] bg-[#005c75] text-white rounded text-xs font-semibold border-none cursor-pointer hover:bg-[#004a5e] transition-colors",children:"Analyze"})]}),e.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-[#626262] ml-auto",children:[e.jsx("span",{className:"leading-[22px]",children:"Next Entity"}),e.jsx("svg",{width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",className:"shrink-0",children:e.jsx("path",{d:"M4 8.5H13M13 8.5L8.5 4M13 8.5L8.5 13",stroke:"#005c75",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})}),e.jsx("div",{className:"bg-[#efefef] border-b border-[#efefef] shrink-0",children:e.jsxs("div",{className:"flex items-center gap-3 h-11 px-[15px]",children:[e.jsxs("div",{className:"px-4 flex items-center justify-center gap-3 shrink-0 text-sm rounded bg-[#343434] text-[#efefef] font-semibold h-8",children:["Scenarios",e.jsx("span",{className:"px-2 py-0.5 rounded-[9px] text-xs font-semibold bg-[#cbf3fa] text-[#005c75] min-w-[25px] text-center",children:"0"})]}),e.jsxs("div",{className:"px-4 flex items-center justify-center gap-3 shrink-0 text-sm rounded-[9px] text-[#3e3e3e] font-normal",children:["Related Entities",e.jsx("span",{className:"px-2 py-0.5 rounded-[9px] text-xs font-semibold bg-[#e1e1e1] text-[#3e3e3e] min-w-[25px] text-center",children:"5"})]}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"Code"}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"Data Structure"}),e.jsx("div",{className:"px-4 shrink-0 text-sm text-[#3e3e3e] font-normal",children:"History"})]})}),e.jsxs("div",{className:"flex flex-1 gap-0 min-h-0",children:[e.jsx("div",{className:"w-[165px] bg-[#e1e1e1] border-r border-[#c7c7c7] flex items-center justify-center shrink-0",children:e.jsx("span",{className:"text-xs font-medium text-[#8e8e8e] leading-5",children:"No Scenarios"})}),e.jsx(i,{selectedScenario:null,analysis:void 0,entity:s,viewMode:"screenshot",cacheBuster:Date.now(),hasScenarios:!1,isAnalyzing:!1,projectSlug:null,hasAnApiKey:!0})]})]})})});export{L as default,S as meta};