@codeyam/codeyam-cli 0.1.0-staging.842873f → 0.1.0-staging.8e7b1bd

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 (80) hide show
  1. package/analyzer-template/.build-info.json +7 -7
  2. package/analyzer-template/log.txt +3 -3
  3. package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +29 -6
  4. package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +14 -12
  5. package/analyzer-template/packages/database/src/lib/loadReadyToBeCapturedAnalyses.ts +25 -5
  6. package/analyzer-template/packages/generate/src/lib/directExecutionScript.ts +17 -2
  7. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.d.ts.map +1 -1
  8. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js +18 -5
  9. package/analyzer-template/packages/github/dist/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
  10. package/analyzer-template/packages/github/dist/generate/src/lib/directExecutionScript.d.ts.map +1 -1
  11. package/analyzer-template/packages/github/dist/generate/src/lib/directExecutionScript.js +10 -1
  12. package/analyzer-template/packages/github/dist/generate/src/lib/directExecutionScript.js.map +1 -1
  13. package/analyzer-template/project/constructMockCode.ts +3 -1
  14. package/analyzer-template/project/orchestrateCapture.ts +3 -1
  15. package/analyzer-template/project/writeMockDataTsx.ts +14 -3
  16. package/analyzer-template/project/writeSimpleRoot.ts +27 -1
  17. package/background/src/lib/virtualized/project/constructMockCode.js +3 -1
  18. package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
  19. package/background/src/lib/virtualized/project/orchestrateCapture.js +3 -1
  20. package/background/src/lib/virtualized/project/orchestrateCapture.js.map +1 -1
  21. package/background/src/lib/virtualized/project/writeMockDataTsx.js +12 -3
  22. package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
  23. package/background/src/lib/virtualized/project/writeSimpleRoot.js +28 -1
  24. package/background/src/lib/virtualized/project/writeSimpleRoot.js.map +1 -1
  25. package/codeyam-cli/src/utils/queue/manager.js +78 -0
  26. package/codeyam-cli/src/utils/queue/manager.js.map +1 -1
  27. package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-D4htqD-x.js → EntityItem-CWKV2GEz.js} +1 -1
  28. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-kykTbcnD.js → EntityTypeBadge-DQeyk25_.js} +1 -1
  29. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-Catz6XEN.js → EntityTypeIcon-D2hFeDeg.js} +1 -1
  30. package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-TlHocYno.js → InteractivePreview-C8K-4kKP.js} +1 -1
  31. package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-CVMmGuIc.js → LibraryFunctionPreview-DgXLv61M.js} +1 -1
  32. package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-JkfQ-VaI.js → LogViewer-DFdLQbPS.js} +1 -1
  33. package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-CVZ0H4BL.js → ReportIssueModal-DlRDjT4h.js} +1 -1
  34. package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-BrMAP1nP.js → SafeScreenshot-7UkVL-UI.js} +1 -1
  35. package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-XjtsGuPo.js +5 -0
  36. package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-C06nsHKY.js → TruncatedFilePath-ayCJdUAc.js} +1 -1
  37. package/codeyam-cli/src/webserver/build/client/assets/{_index-faVIcr_i.js → _index-D2eJjWLf.js} +1 -1
  38. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-w6sbwlOd.js +7 -0
  39. package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-DwYjrK_h.js → chevron-down-BBNQ8hup.js} +1 -1
  40. package/codeyam-cli/src/webserver/build/client/assets/{chunk-WWGJGFF6-CgXbbZRx.js → chunk-WWGJGFF6-Bex4RrGs.js} +1 -1
  41. package/codeyam-cli/src/webserver/build/client/assets/{circle-check-B2oHQ-zo.js → circle-check-cdhjVtom.js} +1 -1
  42. package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-BBYuR56H.js → createLucideIcon-DkgmwwRC.js} +1 -1
  43. package/codeyam-cli/src/webserver/build/client/assets/{dev.empty-CT0Q5lVu.js → dev.empty-CwLmCS0J.js} +1 -1
  44. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-CYqBrC9s.js → entity._sha._-FHOVOgFN.js} +1 -1
  45. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-Bj5GHkhb.js → entity._sha_.create-scenario-YZ-kM3ZG.js} +1 -1
  46. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-eW5z9AyZ.js → entity._sha_.edit._scenarioId-BeQlz94_.js} +1 -1
  47. package/codeyam-cli/src/webserver/build/client/assets/{entry.client-B9tSboXM.js → entry.client-DN2XXM7Z.js} +2 -2
  48. package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-CmO-EZAB.js → fileTableUtils-CUeAIQNI.js} +1 -1
  49. package/codeyam-cli/src/webserver/build/client/assets/{files-DLinnTOx.js → files-ccMQfhGf.js} +1 -1
  50. package/codeyam-cli/src/webserver/build/client/assets/{git-CIxwBQvb.js → git-JmESAHx5.js} +1 -1
  51. package/codeyam-cli/src/webserver/build/client/assets/globals-CO-U8Bpo.css +1 -0
  52. package/codeyam-cli/src/webserver/build/client/assets/{index-_LjBsTxX.js → index-DsL9BiOc.js} +1 -1
  53. package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-D_EGChhq.js → loader-circle-COYCR2oZ.js} +1 -1
  54. package/codeyam-cli/src/webserver/build/client/assets/manifest-90adba57.js +1 -0
  55. package/codeyam-cli/src/webserver/build/client/assets/{root-CHHYHuzL.js → root-DfbVEEjF.js} +3 -3
  56. package/codeyam-cli/src/webserver/build/client/assets/{search-DY8yoDpH.js → search-DvK9iMBu.js} +1 -1
  57. package/codeyam-cli/src/webserver/build/client/assets/{settings-BT6wVHd5.js → settings-9LTbit4Z.js} +1 -1
  58. package/codeyam-cli/src/webserver/build/client/assets/{simulations-gv3H7JV7.js → simulations-BrxN5ZtV.js} +1 -1
  59. package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-BthANBVv.js → triangle-alert-Iv0p8T-1.js} +1 -1
  60. package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-Blr5oZDE.js → useLastLogLine-DOGXmJcI.js} +1 -1
  61. package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-CANr3QJ5.js → useReportContext-BWmSRPH6.js} +1 -1
  62. package/codeyam-cli/src/webserver/build/client/assets/{useToast-Bbf4Hokd.js → useToast-C07gRg7Z.js} +1 -1
  63. package/codeyam-cli/src/webserver/build/server/assets/{index-BtBPtyHx.js → index-CE_1qXCG.js} +1 -1
  64. package/codeyam-cli/src/webserver/build/server/assets/server-build-BY_VDhiD.js +166 -0
  65. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  66. package/codeyam-cli/src/webserver/build-info.json +5 -5
  67. package/package.json +1 -1
  68. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +24 -4
  69. package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js.map +1 -1
  70. package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +11 -12
  71. package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
  72. package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js +18 -5
  73. package/packages/database/src/lib/loadReadyToBeCapturedAnalyses.js.map +1 -1
  74. package/packages/generate/src/lib/directExecutionScript.js +10 -1
  75. package/packages/generate/src/lib/directExecutionScript.js.map +1 -1
  76. package/codeyam-cli/src/webserver/build/client/assets/ScenarioViewer-CJhE4cCv.js +0 -5
  77. package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-CLMa2sgx.js +0 -7
  78. package/codeyam-cli/src/webserver/build/client/assets/globals-xPz593l2.css +0 -1
  79. package/codeyam-cli/src/webserver/build/client/assets/manifest-ca438c41.js +0 -1
  80. package/codeyam-cli/src/webserver/build/server/assets/server-build-N2cTnejq.js +0 -166
@@ -1,4 +1,4 @@
1
- import{B as gc}from"./chunk-WWGJGFF6-CgXbbZRx.js";var hi={exports:{}},ve={},yi={exports:{}},gi={};var ha;function wc(){return ha||(ha=1,(function(M){function $(w,z){var E=w.length;w.push(z);e:for(;0<E;){var O=E-1>>>1,j=w[O];if(0<Ae(j,z))w[O]=z,w[E]=j,E=O;else break e}}function p(w){return w.length===0?null:w[0]}function Tn(w){if(w.length===0)return null;var z=w[0],E=w.pop();if(E!==z){w[0]=E;e:for(var O=0,j=w.length,sn=j>>>1;O<sn;){var Me=2*(O+1)-1,Nt=w[Me],Re=Me+1,Jn=w[Re];if(0>Ae(Nt,E))Re<j&&0>Ae(Jn,Nt)?(w[O]=Jn,w[Re]=E,O=Re):(w[O]=Nt,w[Me]=E,O=Me);else if(Re<j&&0>Ae(Jn,E))w[O]=Jn,w[Re]=E,O=Re;else break e}}return z}function Ae(w,z){var E=w.sortIndex-z.sortIndex;return E!==0?E:w.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var $e=performance;M.unstable_now=function(){return $e.now()}}else{var Xe=Date,Pe=Xe.now();M.unstable_now=function(){return Xe.now()-Pe}}var ae=[],Be=[],dr=1,ie=null,Z=3,Kn=!1,Ge=!1,H=!1,K=typeof setTimeout=="function"?setTimeout:null,Yn=typeof clearTimeout=="function"?clearTimeout:null,$n=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Ln(w){for(var z=p(Be);z!==null;){if(z.callback===null)Tn(Be);else if(z.startTime<=w)Tn(Be),z.sortIndex=z.expirationTime,$(ae,z);else break;z=p(Be)}}function he(w){if(H=!1,Ln(w),!Ge)if(p(ae)!==null)Ge=!0,Se(on);else{var z=p(Be);z!==null&&Zn(he,z.startTime-w)}}function on(w,z){Ge=!1,H&&(H=!1,Yn(Ze),Ze=-1),Kn=!0;var E=Z;try{for(Ln(z),ie=p(ae);ie!==null&&(!(ie.expirationTime>z)||w&&!xt());){var O=ie.callback;if(typeof O=="function"){ie.callback=null,Z=ie.priorityLevel;var j=O(ie.expirationTime<=z);z=M.unstable_now(),typeof j=="function"?ie.callback=j:ie===p(ae)&&Tn(ae),Ln(z)}else Tn(ae);ie=p(ae)}if(ie!==null)var sn=!0;else{var Me=p(Be);Me!==null&&Zn(he,Me.startTime-z),sn=!1}return sn}finally{ie=null,Z=E,Kn=!1}}var Te=!1,Le=null,Ze=-1,Xn=5,Ct=-1;function xt(){return!(M.unstable_now()-Ct<Xn)}function Mn(){if(Le!==null){var w=M.unstable_now();Ct=w;var z=!0;try{z=Le(!0,w)}finally{z?Je():(Te=!1,Le=null)}}else Te=!1}var Je;if(typeof $n=="function")Je=function(){$n(Mn)};else if(typeof MessageChannel<"u"){var Gn=new MessageChannel,_t=Gn.port2;Gn.port1.onmessage=Mn,Je=function(){_t.postMessage(null)}}else Je=function(){K(Mn,0)};function Se(w){Le=w,Te||(Te=!0,Je())}function Zn(w,z){Ze=K(function(){w(M.unstable_now())},z)}M.unstable_IdlePriority=5,M.unstable_ImmediatePriority=1,M.unstable_LowPriority=4,M.unstable_NormalPriority=3,M.unstable_Profiling=null,M.unstable_UserBlockingPriority=2,M.unstable_cancelCallback=function(w){w.callback=null},M.unstable_continueExecution=function(){Ge||Kn||(Ge=!0,Se(on))},M.unstable_forceFrameRate=function(w){0>w||125<w?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Xn=0<w?Math.floor(1e3/w):5},M.unstable_getCurrentPriorityLevel=function(){return Z},M.unstable_getFirstCallbackNode=function(){return p(ae)},M.unstable_next=function(w){switch(Z){case 1:case 2:case 3:var z=3;break;default:z=Z}var E=Z;Z=z;try{return w()}finally{Z=E}},M.unstable_pauseExecution=function(){},M.unstable_requestPaint=function(){},M.unstable_runWithPriority=function(w,z){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var E=Z;Z=w;try{return z()}finally{Z=E}},M.unstable_scheduleCallback=function(w,z,E){var O=M.unstable_now();switch(typeof E=="object"&&E!==null?(E=E.delay,E=typeof E=="number"&&0<E?O+E:O):E=O,w){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=E+j,w={id:dr++,callback:z,priorityLevel:w,startTime:E,expirationTime:j,sortIndex:-1},E>O?(w.sortIndex=E,$(Be,w),p(ae)===null&&w===p(Be)&&(H?(Yn(Ze),Ze=-1):H=!0,Zn(he,E-O))):(w.sortIndex=j,$(ae,w),Ge||Kn||(Ge=!0,Se(on))),w},M.unstable_shouldYield=xt,M.unstable_wrapCallback=function(w){var z=Z;return function(){var E=Z;Z=z;try{return w.apply(this,arguments)}finally{Z=E}}}})(gi)),gi}var ya;function kc(){return ya||(ya=1,yi.exports=wc()),yi.exports}var ga;function Sc(){if(ga)return ve;ga=1;var M=gc(),$=kc();function p(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,t=1;t<arguments.length;t++)n+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Tn=new Set,Ae={};function $e(e,n){Xe(e,n),Xe(e+"Capture",n)}function Xe(e,n){for(Ae[e]=n,e=0;e<n.length;e++)Tn.add(n[e])}var Pe=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ae=Object.prototype.hasOwnProperty,Be=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,dr={},ie={};function Z(e){return ae.call(ie,e)?!0:ae.call(dr,e)?!1:Be.test(e)?ie[e]=!0:(dr[e]=!0,!1)}function Kn(e,n,t,r){if(t!==null&&t.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return r?!1:t!==null?!t.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Ge(e,n,t,r){if(n===null||typeof n>"u"||Kn(e,n,t,r))return!0;if(r)return!1;if(t!==null)switch(t.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function H(e,n,t,r,l,u,i){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=t,this.propertyName=e,this.type=n,this.sanitizeURL=u,this.removeEmptyString=i}var K={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){K[e]=new H(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];K[n]=new H(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){K[e]=new H(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){K[e]=new H(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){K[e]=new H(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){K[e]=new H(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){K[e]=new H(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){K[e]=new H(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){K[e]=new H(e,5,!1,e.toLowerCase(),null,!1,!1)});var Yn=/[\-:]([a-z])/g;function $n(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(Yn,$n);K[n]=new H(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(Yn,$n);K[n]=new H(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(Yn,$n);K[n]=new H(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){K[e]=new H(e,1,!1,e.toLowerCase(),null,!1,!1)}),K.xlinkHref=new H("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){K[e]=new H(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ln(e,n,t,r){var l=K.hasOwnProperty(n)?K[n]:null;(l!==null?l.type!==0:r||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(Ge(n,t,l,r)&&(t=null),r||l===null?Z(n)&&(t===null?e.removeAttribute(n):e.setAttribute(n,""+t)):l.mustUseProperty?e[l.propertyName]=t===null?l.type===3?!1:"":t:(n=l.attributeName,r=l.attributeNamespace,t===null?e.removeAttribute(n):(l=l.type,t=l===3||l===4&&t===!0?"":""+t,r?e.setAttributeNS(r,n,t):e.setAttribute(n,t))))}var he=M.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,on=Symbol.for("react.element"),Te=Symbol.for("react.portal"),Le=Symbol.for("react.fragment"),Ze=Symbol.for("react.strict_mode"),Xn=Symbol.for("react.profiler"),Ct=Symbol.for("react.provider"),xt=Symbol.for("react.context"),Mn=Symbol.for("react.forward_ref"),Je=Symbol.for("react.suspense"),Gn=Symbol.for("react.suspense_list"),_t=Symbol.for("react.memo"),Se=Symbol.for("react.lazy"),Zn=Symbol.for("react.offscreen"),w=Symbol.iterator;function z(e){return e===null||typeof e!="object"?null:(e=w&&e[w]||e["@@iterator"],typeof e=="function"?e:null)}var E=Object.assign,O;function j(e){if(O===void 0)try{throw Error()}catch(t){var n=t.stack.trim().match(/\n( *(at )?)/);O=n&&n[1]||""}return`
1
+ import{B as gc}from"./chunk-WWGJGFF6-Bex4RrGs.js";var hi={exports:{}},ve={},yi={exports:{}},gi={};var ha;function wc(){return ha||(ha=1,(function(M){function $(w,z){var E=w.length;w.push(z);e:for(;0<E;){var O=E-1>>>1,j=w[O];if(0<Ae(j,z))w[O]=z,w[E]=j,E=O;else break e}}function p(w){return w.length===0?null:w[0]}function Tn(w){if(w.length===0)return null;var z=w[0],E=w.pop();if(E!==z){w[0]=E;e:for(var O=0,j=w.length,sn=j>>>1;O<sn;){var Me=2*(O+1)-1,Nt=w[Me],Re=Me+1,Jn=w[Re];if(0>Ae(Nt,E))Re<j&&0>Ae(Jn,Nt)?(w[O]=Jn,w[Re]=E,O=Re):(w[O]=Nt,w[Me]=E,O=Me);else if(Re<j&&0>Ae(Jn,E))w[O]=Jn,w[Re]=E,O=Re;else break e}}return z}function Ae(w,z){var E=w.sortIndex-z.sortIndex;return E!==0?E:w.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var $e=performance;M.unstable_now=function(){return $e.now()}}else{var Xe=Date,Pe=Xe.now();M.unstable_now=function(){return Xe.now()-Pe}}var ae=[],Be=[],dr=1,ie=null,Z=3,Kn=!1,Ge=!1,H=!1,K=typeof setTimeout=="function"?setTimeout:null,Yn=typeof clearTimeout=="function"?clearTimeout:null,$n=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Ln(w){for(var z=p(Be);z!==null;){if(z.callback===null)Tn(Be);else if(z.startTime<=w)Tn(Be),z.sortIndex=z.expirationTime,$(ae,z);else break;z=p(Be)}}function he(w){if(H=!1,Ln(w),!Ge)if(p(ae)!==null)Ge=!0,Se(on);else{var z=p(Be);z!==null&&Zn(he,z.startTime-w)}}function on(w,z){Ge=!1,H&&(H=!1,Yn(Ze),Ze=-1),Kn=!0;var E=Z;try{for(Ln(z),ie=p(ae);ie!==null&&(!(ie.expirationTime>z)||w&&!xt());){var O=ie.callback;if(typeof O=="function"){ie.callback=null,Z=ie.priorityLevel;var j=O(ie.expirationTime<=z);z=M.unstable_now(),typeof j=="function"?ie.callback=j:ie===p(ae)&&Tn(ae),Ln(z)}else Tn(ae);ie=p(ae)}if(ie!==null)var sn=!0;else{var Me=p(Be);Me!==null&&Zn(he,Me.startTime-z),sn=!1}return sn}finally{ie=null,Z=E,Kn=!1}}var Te=!1,Le=null,Ze=-1,Xn=5,Ct=-1;function xt(){return!(M.unstable_now()-Ct<Xn)}function Mn(){if(Le!==null){var w=M.unstable_now();Ct=w;var z=!0;try{z=Le(!0,w)}finally{z?Je():(Te=!1,Le=null)}}else Te=!1}var Je;if(typeof $n=="function")Je=function(){$n(Mn)};else if(typeof MessageChannel<"u"){var Gn=new MessageChannel,_t=Gn.port2;Gn.port1.onmessage=Mn,Je=function(){_t.postMessage(null)}}else Je=function(){K(Mn,0)};function Se(w){Le=w,Te||(Te=!0,Je())}function Zn(w,z){Ze=K(function(){w(M.unstable_now())},z)}M.unstable_IdlePriority=5,M.unstable_ImmediatePriority=1,M.unstable_LowPriority=4,M.unstable_NormalPriority=3,M.unstable_Profiling=null,M.unstable_UserBlockingPriority=2,M.unstable_cancelCallback=function(w){w.callback=null},M.unstable_continueExecution=function(){Ge||Kn||(Ge=!0,Se(on))},M.unstable_forceFrameRate=function(w){0>w||125<w?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Xn=0<w?Math.floor(1e3/w):5},M.unstable_getCurrentPriorityLevel=function(){return Z},M.unstable_getFirstCallbackNode=function(){return p(ae)},M.unstable_next=function(w){switch(Z){case 1:case 2:case 3:var z=3;break;default:z=Z}var E=Z;Z=z;try{return w()}finally{Z=E}},M.unstable_pauseExecution=function(){},M.unstable_requestPaint=function(){},M.unstable_runWithPriority=function(w,z){switch(w){case 1:case 2:case 3:case 4:case 5:break;default:w=3}var E=Z;Z=w;try{return z()}finally{Z=E}},M.unstable_scheduleCallback=function(w,z,E){var O=M.unstable_now();switch(typeof E=="object"&&E!==null?(E=E.delay,E=typeof E=="number"&&0<E?O+E:O):E=O,w){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=E+j,w={id:dr++,callback:z,priorityLevel:w,startTime:E,expirationTime:j,sortIndex:-1},E>O?(w.sortIndex=E,$(Be,w),p(ae)===null&&w===p(Be)&&(H?(Yn(Ze),Ze=-1):H=!0,Zn(he,E-O))):(w.sortIndex=j,$(ae,w),Ge||Kn||(Ge=!0,Se(on))),w},M.unstable_shouldYield=xt,M.unstable_wrapCallback=function(w){var z=Z;return function(){var E=Z;Z=z;try{return w.apply(this,arguments)}finally{Z=E}}}})(gi)),gi}var ya;function kc(){return ya||(ya=1,yi.exports=wc()),yi.exports}var ga;function Sc(){if(ga)return ve;ga=1;var M=gc(),$=kc();function p(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,t=1;t<arguments.length;t++)n+="&args[]="+encodeURIComponent(arguments[t]);return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Tn=new Set,Ae={};function $e(e,n){Xe(e,n),Xe(e+"Capture",n)}function Xe(e,n){for(Ae[e]=n,e=0;e<n.length;e++)Tn.add(n[e])}var Pe=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ae=Object.prototype.hasOwnProperty,Be=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,dr={},ie={};function Z(e){return ae.call(ie,e)?!0:ae.call(dr,e)?!1:Be.test(e)?ie[e]=!0:(dr[e]=!0,!1)}function Kn(e,n,t,r){if(t!==null&&t.type===0)return!1;switch(typeof n){case"function":case"symbol":return!0;case"boolean":return r?!1:t!==null?!t.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Ge(e,n,t,r){if(n===null||typeof n>"u"||Kn(e,n,t,r))return!0;if(r)return!1;if(t!==null)switch(t.type){case 3:return!n;case 4:return n===!1;case 5:return isNaN(n);case 6:return isNaN(n)||1>n}return!1}function H(e,n,t,r,l,u,i){this.acceptsBooleans=n===2||n===3||n===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=t,this.propertyName=e,this.type=n,this.sanitizeURL=u,this.removeEmptyString=i}var K={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){K[e]=new H(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var n=e[0];K[n]=new H(n,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){K[e]=new H(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){K[e]=new H(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){K[e]=new H(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){K[e]=new H(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){K[e]=new H(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){K[e]=new H(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){K[e]=new H(e,5,!1,e.toLowerCase(),null,!1,!1)});var Yn=/[\-:]([a-z])/g;function $n(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var n=e.replace(Yn,$n);K[n]=new H(n,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var n=e.replace(Yn,$n);K[n]=new H(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var n=e.replace(Yn,$n);K[n]=new H(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){K[e]=new H(e,1,!1,e.toLowerCase(),null,!1,!1)}),K.xlinkHref=new H("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){K[e]=new H(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ln(e,n,t,r){var l=K.hasOwnProperty(n)?K[n]:null;(l!==null?l.type!==0:r||!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(Ge(n,t,l,r)&&(t=null),r||l===null?Z(n)&&(t===null?e.removeAttribute(n):e.setAttribute(n,""+t)):l.mustUseProperty?e[l.propertyName]=t===null?l.type===3?!1:"":t:(n=l.attributeName,r=l.attributeNamespace,t===null?e.removeAttribute(n):(l=l.type,t=l===3||l===4&&t===!0?"":""+t,r?e.setAttributeNS(r,n,t):e.setAttribute(n,t))))}var he=M.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,on=Symbol.for("react.element"),Te=Symbol.for("react.portal"),Le=Symbol.for("react.fragment"),Ze=Symbol.for("react.strict_mode"),Xn=Symbol.for("react.profiler"),Ct=Symbol.for("react.provider"),xt=Symbol.for("react.context"),Mn=Symbol.for("react.forward_ref"),Je=Symbol.for("react.suspense"),Gn=Symbol.for("react.suspense_list"),_t=Symbol.for("react.memo"),Se=Symbol.for("react.lazy"),Zn=Symbol.for("react.offscreen"),w=Symbol.iterator;function z(e){return e===null||typeof e!="object"?null:(e=w&&e[w]||e["@@iterator"],typeof e=="function"?e:null)}var E=Object.assign,O;function j(e){if(O===void 0)try{throw Error()}catch(t){var n=t.stack.trim().match(/\n( *(at )?)/);O=n&&n[1]||""}return`
2
2
  `+O+e}var sn=!1;function Me(e,n){if(!e||sn)return"";sn=!0;var t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(n)if(n=function(){throw Error()},Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(n,[])}catch(d){var r=d}Reflect.construct(e,[],n)}else{try{n.call()}catch(d){r=d}e.call(n.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var l=d.stack.split(`
3
3
  `),u=r.stack.split(`
4
4
  `),i=l.length-1,o=u.length-1;1<=i&&0<=o&&l[i]!==u[o];)o--;for(;1<=i&&0<=o;i--,o--)if(l[i]!==u[o]){if(i!==1||o!==1)do if(i--,o--,0>o||l[i]!==u[o]){var s=`
@@ -1 +1 @@
1
- import{c}from"./createLucideIcon-BBYuR56H.js";const e=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],a=c("loader-circle",e);export{a as L};
1
+ import{c}from"./createLucideIcon-DkgmwwRC.js";const e=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],a=c("loader-circle",e);export{a as L};
@@ -0,0 +1 @@
1
+ window.__reactRouterManifest={"entry":{"module":"/assets/entry.client-DN2XXM7Z.js","imports":["/assets/chunk-WWGJGFF6-Bex4RrGs.js","/assets/index-DsL9BiOc.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/root-DfbVEEjF.js","imports":["/assets/chunk-WWGJGFF6-Bex4RrGs.js","/assets/index-DsL9BiOc.js","/assets/ReportIssueModal-DlRDjT4h.js","/assets/useReportContext-BWmSRPH6.js","/assets/loader-circle-COYCR2oZ.js","/assets/createLucideIcon-DkgmwwRC.js","/assets/useToast-C07gRg7Z.js","/assets/useLastLogLine-DOGXmJcI.js","/assets/LogViewer-DFdLQbPS.js","/assets/EntityTypeIcon-D2hFeDeg.js","/assets/TruncatedFilePath-ayCJdUAc.js","/assets/chevron-down-BBNQ8hup.js","/assets/circle-check-cdhjVtom.js","/assets/triangle-alert-Iv0p8T-1.js"],"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,"hasErrorBoundary":false,"module":"/assets/entity._sha_.edit._scenarioId-BeQlz94_.js","imports":["/assets/chunk-WWGJGFF6-Bex4RrGs.js","/assets/InteractivePreview-C8K-4kKP.js","/assets/useLastLogLine-DOGXmJcI.js","/assets/index-DsL9BiOc.js"],"css":["/assets/InteractivePreview-CMKNK2uU.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,"hasErrorBoundary":false,"module":"/assets/entity._sha_.create-scenario-YZ-kM3ZG.js","imports":["/assets/chunk-WWGJGFF6-Bex4RrGs.js","/assets/InteractivePreview-C8K-4kKP.js","/assets/useLastLogLine-DOGXmJcI.js","/assets/index-DsL9BiOc.js"],"css":["/assets/InteractivePreview-CMKNK2uU.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,"hasErrorBoundary":false,"module":"/assets/api.generate-scenario-data-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,"hasErrorBoundary":false,"module":"/assets/api.llm-calls._entitySha-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,"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,"hasErrorBoundary":false,"module":"/assets/api.capture-screenshot-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,"hasErrorBoundary":false,"module":"/assets/api.recapture-scenario-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,"hasErrorBoundary":false,"module":"/assets/api.logs._projectSlug-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,"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,"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,"hasErrorBoundary":false,"module":"/assets/api.delete-scenario-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,"hasErrorBoundary":false,"module":"/assets/api.generate-report-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,"hasErrorBoundary":false,"module":"/assets/api.process-status-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,"hasErrorBoundary":false,"module":"/assets/api.save-scenarios-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,"hasErrorBoundary":false,"module":"/assets/api.kill-process-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,"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,"hasErrorBoundary":false,"module":"/assets/activity.(_tab)-w6sbwlOd.js","imports":["/assets/chunk-WWGJGFF6-Bex4RrGs.js","/assets/LogViewer-DFdLQbPS.js","/assets/useLastLogLine-DOGXmJcI.js","/assets/useReportContext-BWmSRPH6.js","/assets/EntityTypeIcon-D2hFeDeg.js","/assets/EntityTypeBadge-DQeyk25_.js","/assets/SafeScreenshot-7UkVL-UI.js","/assets/loader-circle-COYCR2oZ.js","/assets/createLucideIcon-DkgmwwRC.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,"hasErrorBoundary":false,"module":"/assets/api.debug-setup-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,"hasErrorBoundary":false,"module":"/assets/api.recapture-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,"hasErrorBoundary":false,"module":"/assets/entity._sha._-FHOVOgFN.js","imports":["/assets/chunk-WWGJGFF6-Bex4RrGs.js","/assets/useLastLogLine-DOGXmJcI.js","/assets/InteractivePreview-C8K-4kKP.js","/assets/SafeScreenshot-7UkVL-UI.js","/assets/LibraryFunctionPreview-DgXLv61M.js","/assets/createLucideIcon-DkgmwwRC.js","/assets/ScenarioViewer-XjtsGuPo.js","/assets/EntityTypeIcon-D2hFeDeg.js","/assets/LogViewer-DFdLQbPS.js","/assets/useReportContext-BWmSRPH6.js","/assets/index-DsL9BiOc.js","/assets/ReportIssueModal-DlRDjT4h.js","/assets/circle-check-cdhjVtom.js","/assets/triangle-alert-Iv0p8T-1.js"],"css":["/assets/InteractivePreview-CMKNK2uU.css"]},"routes/api.analyze":{"id":"routes/api.analyze","parentId":"root","path":"api/analyze","hasAction":true,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":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,"hasErrorBoundary":false,"module":"/assets/simulations-BrxN5ZtV.js","imports":["/assets/chunk-WWGJGFF6-Bex4RrGs.js","/assets/useReportContext-BWmSRPH6.js","/assets/SafeScreenshot-7UkVL-UI.js","/assets/EntityTypeIcon-D2hFeDeg.js","/assets/fileTableUtils-CUeAIQNI.js","/assets/chevron-down-BBNQ8hup.js","/assets/search-DvK9iMBu.js","/assets/loader-circle-COYCR2oZ.js","/assets/createLucideIcon-DkgmwwRC.js"],"css":[]},"routes/api.events":{"id":"routes/api.events","parentId":"root","path":"api/events","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/api.events-l0sNRNKZ.js","imports":[],"css":[]},"routes/api.memory":{"id":"routes/api.memory","parentId":"root","path":"api/memory","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":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,"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,"hasErrorBoundary":false,"module":"/assets/dev.empty-CwLmCS0J.js","imports":["/assets/chunk-WWGJGFF6-Bex4RrGs.js","/assets/ScenarioViewer-XjtsGuPo.js","/assets/InteractivePreview-C8K-4kKP.js","/assets/LogViewer-DFdLQbPS.js","/assets/SafeScreenshot-7UkVL-UI.js","/assets/useLastLogLine-DOGXmJcI.js","/assets/ReportIssueModal-DlRDjT4h.js","/assets/createLucideIcon-DkgmwwRC.js","/assets/circle-check-cdhjVtom.js","/assets/triangle-alert-Iv0p8T-1.js","/assets/index-DsL9BiOc.js"],"css":["/assets/InteractivePreview-CMKNK2uU.css"]},"routes/settings":{"id":"routes/settings","parentId":"root","path":"settings","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/settings-9LTbit4Z.js","imports":["/assets/chunk-WWGJGFF6-Bex4RrGs.js","/assets/useReportContext-BWmSRPH6.js"],"css":[]},"routes/static.$":{"id":"routes/static.$","parentId":"root","path":"static/*","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":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,"hasErrorBoundary":false,"module":"/assets/_index-D2eJjWLf.js","imports":["/assets/chunk-WWGJGFF6-Bex4RrGs.js","/assets/useLastLogLine-DOGXmJcI.js","/assets/useToast-C07gRg7Z.js","/assets/useReportContext-BWmSRPH6.js","/assets/LogViewer-DFdLQbPS.js","/assets/EntityTypeIcon-D2hFeDeg.js","/assets/SafeScreenshot-7UkVL-UI.js","/assets/createLucideIcon-DkgmwwRC.js","/assets/circle-check-cdhjVtom.js","/assets/loader-circle-COYCR2oZ.js"],"css":[]},"routes/files":{"id":"routes/files","parentId":"root","path":"files","hasAction":false,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/files-ccMQfhGf.js","imports":["/assets/chunk-WWGJGFF6-Bex4RrGs.js","/assets/useReportContext-BWmSRPH6.js","/assets/EntityItem-CWKV2GEz.js","/assets/fileTableUtils-CUeAIQNI.js","/assets/chevron-down-BBNQ8hup.js","/assets/search-DvK9iMBu.js","/assets/useToast-C07gRg7Z.js","/assets/TruncatedFilePath-ayCJdUAc.js","/assets/SafeScreenshot-7UkVL-UI.js","/assets/LibraryFunctionPreview-DgXLv61M.js","/assets/triangle-alert-Iv0p8T-1.js","/assets/createLucideIcon-DkgmwwRC.js","/assets/EntityTypeIcon-D2hFeDeg.js","/assets/EntityTypeBadge-DQeyk25_.js"],"css":[]},"routes/git":{"id":"routes/git","parentId":"root","path":"git","hasAction":true,"hasLoader":true,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/git-JmESAHx5.js","imports":["/assets/chunk-WWGJGFF6-Bex4RrGs.js","/assets/useReportContext-BWmSRPH6.js","/assets/EntityItem-CWKV2GEz.js","/assets/LogViewer-DFdLQbPS.js","/assets/fileTableUtils-CUeAIQNI.js","/assets/useToast-C07gRg7Z.js","/assets/TruncatedFilePath-ayCJdUAc.js","/assets/SafeScreenshot-7UkVL-UI.js","/assets/LibraryFunctionPreview-DgXLv61M.js","/assets/triangle-alert-Iv0p8T-1.js","/assets/createLucideIcon-DkgmwwRC.js","/assets/EntityTypeIcon-D2hFeDeg.js","/assets/EntityTypeBadge-DQeyk25_.js"],"css":[]}},"url":"/assets/manifest-90adba57.js","version":"90adba57"};
@@ -1,8 +1,8 @@
1
- import{r as o,j as e,e as B,a as F,b as J,L as _,w as U,M as G,C as Y,S as K,D as Q,u as X,d as Z,O as ee}from"./chunk-WWGJGFF6-CgXbbZRx.js";import{B as te,R as se,S as ne,_ as oe}from"./ReportIssueModal-CVZ0H4BL.js";import{a as ie,R as ae}from"./useReportContext-CANr3QJ5.js";import{L as W}from"./loader-circle-D_EGChhq.js";import{c as L}from"./createLucideIcon-BBYuR56H.js";import{T as re,u as le}from"./useToast-Bbf4Hokd.js";import{u as ce}from"./useLastLogLine-Blr5oZDE.js";import{L as de}from"./LogViewer-JkfQ-VaI.js";import{E as me}from"./EntityTypeIcon-Catz6XEN.js";import{T as xe}from"./TruncatedFilePath-C06nsHKY.js";import{C as pe}from"./chevron-down-DwYjrK_h.js";import{C as he}from"./circle-check-B2oHQ-zo.js";import"./triangle-alert-BthANBVv.js";function ue({id:t,selected:n,onClick:r,icon:m,name:p}){const[i,l]=o.useState(!1);o.useEffect(()=>{l(!0)},[]);const u=o.useCallback(()=>{r?.(t)},[r,t]);return e.jsxs("button",{className:`
1
+ import{r as o,j as e,e as V,a as F,b as U,L as _,w as J,M as G,C as Y,S as K,D as Q,u as X,d as Z,O as ee}from"./chunk-WWGJGFF6-Bex4RrGs.js";import{B as te,R as se,S as ne,_ as oe}from"./ReportIssueModal-DlRDjT4h.js";import{a as ie,R as ae}from"./useReportContext-BWmSRPH6.js";import{L as W}from"./loader-circle-COYCR2oZ.js";import{c as L}from"./createLucideIcon-DkgmwwRC.js";import{T as re,u as le}from"./useToast-C07gRg7Z.js";import{u as ce}from"./useLastLogLine-DOGXmJcI.js";import{L as de}from"./LogViewer-DFdLQbPS.js";import{E as me}from"./EntityTypeIcon-D2hFeDeg.js";import{T as xe}from"./TruncatedFilePath-ayCJdUAc.js";import{C as pe}from"./chevron-down-BBNQ8hup.js";import{C as he}from"./circle-check-cdhjVtom.js";import"./triangle-alert-Iv0p8T-1.js";function ue({id:t,selected:n,onClick:r,icon:m,name:p}){const[i,l]=o.useState(!1);o.useEffect(()=>{l(!0)},[]);const u=o.useCallback(()=>{r?.(t)},[r,t]);return e.jsxs("button",{className:`
2
2
  w-full aspect-square p-3 cursor-pointer focus:outline-none
3
3
  flex flex-col items-center justify-center gap-1 text-[#626262]
4
4
  hover:bg-[#d8d8d8] text-xs font-ibmPlexSans uppercase
5
- `,onClick:u,children:[e.jsx("div",{className:`${n?"bg-primary-100 text-cygray-10":""} w-10 h-10 rounded-lg flex items-center justify-center`,children:i&&m}),e.jsx("span",{className:`${n?"text-primary-100":""} whitespace-nowrap`,children:p})]})}const fe="/assets/cy-logo-cli-C1gnJVOL.svg";const ye=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],D=L("activity",ye);const ge=[["path",{d:"M7 10h10",key:"1101jm"}],["path",{d:"M7 14h10",key:"1mhdw3"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],je=L("circle-equal",ge);const ve=[["path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1uwlt4"}],["path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z",key:"10291m"}],["path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z",key:"1tqoq1"}],["path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1x6lto"}]],Ce=L("component",ve);const ke=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],be=L("file",ke);const we=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],V=L("git-commit-horizontal",we);const Ne=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],Se=L("house",Ne);const Ee=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],Le=L("panels-top-left",Ee);function Ae(){const t=B(),n=F(),[r,m]=o.useState(),[p,i]=o.useState(!1),[l,u]=o.useState(!1),[z,N]=o.useState(null),x=J();o.useEffect(()=>{x.state==="idle"&&!x.data&&x.load("/api/generate-report")},[x]);const y=x.data?.defaultEmail||"",a={width:"24px",height:"24px",strokeWidth:1.5},g=[{id:"dashboard",icon:e.jsx(Se,{style:a}),link:"/",name:"Dashboard"},{id:"simulations",icon:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:a,children:[e.jsx("path",{d:"M9 12.75V15.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M6 15.75H12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M6.75 12.7498L11.325 8.17483C11.6067 7.89873 11.9858 7.7447 12.3803 7.7461C12.7747 7.74751 13.1528 7.90423 13.4325 8.18233L16.5 11.2498",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M6 8.25C6.82843 8.25 7.5 7.57843 7.5 6.75C7.5 5.92157 6.82843 5.25 6 5.25C5.17157 5.25 4.5 5.92157 4.5 6.75C4.5 7.57843 5.17157 8.25 6 8.25Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M15 2.25H3C2.17157 2.25 1.5 2.92157 1.5 3.75V11.25C1.5 12.0784 2.17157 12.75 3 12.75H15C15.8284 12.75 16.5 12.0784 16.5 11.25V3.75C16.5 2.92157 15.8284 2.25 15 2.25Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),link:"/simulations",name:"Simulations"},{id:"git",icon:e.jsx(V,{style:a}),link:"/git",name:"Git"},{id:"files",icon:e.jsx(be,{style:a}),link:"/files",name:"Files"},{id:"activity",icon:e.jsx(D,{style:a}),link:"/activity",name:"Activity"},{id:"settings",icon:e.jsx(ne,{style:a}),link:"/settings",name:"Settings"},{id:"commits",icon:e.jsx(V,{style:a}),link:"/commits",name:"Commits",hidden:!0},{id:"pages",icon:e.jsx(Le,{style:a}),link:"/pages",name:"Pages",hidden:!0},{id:"components",icon:e.jsx(Ce,{style:a}),link:"/components",name:"Components",hidden:!0}],j=o.useCallback(s=>{const b=g.find(h=>h.id===s);b?.link&&n(b.link),m(h=>h===s?void 0:s)},[g,n]);o.useEffect(()=>{const s={dashboard:["/","/home"],git:["git"],commits:["commits"],simulations:["simulations"],activity:["activity"],files:["files"],settings:["settings"],pages:["pages"],components:["components"]};for(const[b,h]of Object.entries(s))if(h.some(v=>v==="/"?t.pathname==="/":t.pathname.includes(v))){m(b);return}m(void 0)},[t]);const f=async()=>{u(!0);try{const{default:s}=await oe(async()=>{const{default:v}=await import("./html2canvas-pro.esm-XQCGvadH.js");return{default:v}},[]),h=(await s(document.body)).toDataURL("image/jpeg",.8);N(h),i(!0)}catch(s){console.error("Screenshot capture failed:",s),i(!0)}finally{u(!1)}},S=()=>{i(!1),N(null)},A=ie();return e.jsxs(e.Fragment,{children:[e.jsxs("div",{id:"sidebar",className:"relative w-full h-screen bg-cygray-30 flex flex-col justify-between py-3",children:[e.jsxs("div",{className:"w-full flex flex-col items-center",children:[e.jsx("div",{children:e.jsx(_,{to:"/",className:"flex items-center justify-center h-20 cursor-pointer",children:e.jsx("img",{src:fe,alt:"CodeYam",className:"h-8"})})}),g.filter(s=>!s.hidden).map(s=>e.jsx(ue,{id:s.id,selected:s.id===r,onClick:j,icon:s.icon,name:s.name},`sidebar-button-${s.id}`))]}),e.jsx("div",{className:"w-full flex flex-col items-center pb-2",children:e.jsxs("button",{onClick:()=>{f()},disabled:l,className:"flex flex-col items-center gap-1 p-2 rounded-lg text-gray-600 hover:bg-gray-100 hover:text-gray-900 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-wait",title:"Report an issue",children:[l?e.jsx(W,{style:a,className:"animate-spin"}):e.jsx(te,{style:a}),e.jsx("span",{className:"text-[10px] font-medium",children:l?"Capturing...":"Report Issue"})]})})]}),p&&e.jsx(se,{isOpen:!0,onClose:S,context:A,defaultEmail:y,screenshotDataUrl:z??void 0})]})}function ze({toast:t,onClose:n}){o.useEffect(()=>{const p=t.duration||5e3;if(p>0){const i=setTimeout(()=>{n(t.id)},p);return()=>clearTimeout(i)}},[t.id,t.duration,n]);const r={success:"✅",error:"❌",info:"ℹ️",warning:"⚠️"},m={success:"bg-emerald-50 border-emerald-200 text-emerald-900",error:"bg-red-50 border-red-200 text-red-900",info:"bg-blue-50 border-blue-200 text-blue-900",warning:"bg-amber-50 border-amber-200 text-amber-900"};return e.jsxs("div",{className:`flex items-center gap-3 px-4 py-3 rounded-lg border-2 shadow-lg min-w-[320px] max-w-[500px] animate-[slideIn_0.3s_ease-out] ${m[t.type]}`,children:[e.jsx("span",{className:"text-2xl",children:r[t.type]}),e.jsx("p",{className:"flex-1 text-sm font-medium m-0",children:t.message}),e.jsx("button",{onClick:()=>n(t.id),className:"text-gray-500 hover:text-gray-700 text-xl leading-none bg-transparent border-none cursor-pointer p-0 w-6 h-6 flex items-center justify-center rounded transition-colors hover:bg-black/10",children:"×"})]})}function Te({toasts:t,onClose:n}){return t.length===0?null:e.jsxs("div",{className:"fixed top-4 right-4 z-10000 flex flex-col gap-2",children:[e.jsx("style",{children:`
5
+ `,onClick:u,children:[e.jsx("div",{className:`${n?"bg-primary-100 text-cygray-10":""} w-10 h-10 rounded-lg flex items-center justify-center`,children:i&&m}),e.jsx("span",{className:`${n?"text-primary-100":""} whitespace-nowrap`,children:p})]})}const fe="/assets/cy-logo-cli-C1gnJVOL.svg";const ye=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],D=L("activity",ye);const ge=[["path",{d:"M7 10h10",key:"1101jm"}],["path",{d:"M7 14h10",key:"1mhdw3"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],je=L("circle-equal",ge);const ve=[["path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1uwlt4"}],["path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z",key:"10291m"}],["path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z",key:"1tqoq1"}],["path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1x6lto"}]],Ce=L("component",ve);const ke=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],be=L("file",ke);const we=[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]],B=L("git-commit-horizontal",we);const Ne=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],Se=L("house",Ne);const Ee=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],Le=L("panels-top-left",Ee);function Ae(){const t=V(),n=F(),[r,m]=o.useState(),[p,i]=o.useState(!1),[l,u]=o.useState(!1),[z,N]=o.useState(null),x=U();o.useEffect(()=>{x.state==="idle"&&!x.data&&x.load("/api/generate-report")},[x]);const y=x.data?.defaultEmail||"",a={width:"24px",height:"24px",strokeWidth:1.5},g=[{id:"dashboard",icon:e.jsx(Se,{style:a}),link:"/",name:"Dashboard"},{id:"simulations",icon:e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:a,children:[e.jsx("path",{d:"M9 12.75V15.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M6 15.75H12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M6.75 12.7498L11.325 8.17483C11.6067 7.89873 11.9858 7.7447 12.3803 7.7461C12.7747 7.74751 13.1528 7.90423 13.4325 8.18233L16.5 11.2498",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M6 8.25C6.82843 8.25 7.5 7.57843 7.5 6.75C7.5 5.92157 6.82843 5.25 6 5.25C5.17157 5.25 4.5 5.92157 4.5 6.75C4.5 7.57843 5.17157 8.25 6 8.25Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M15 2.25H3C2.17157 2.25 1.5 2.92157 1.5 3.75V11.25C1.5 12.0784 2.17157 12.75 3 12.75H15C15.8284 12.75 16.5 12.0784 16.5 11.25V3.75C16.5 2.92157 15.8284 2.25 15 2.25Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),link:"/simulations",name:"Simulations"},{id:"git",icon:e.jsx(B,{style:a}),link:"/git",name:"Git"},{id:"files",icon:e.jsx(be,{style:a}),link:"/files",name:"Files"},{id:"activity",icon:e.jsx(D,{style:a}),link:"/activity",name:"Activity"},{id:"settings",icon:e.jsx(ne,{style:a}),link:"/settings",name:"Settings"},{id:"commits",icon:e.jsx(B,{style:a}),link:"/commits",name:"Commits",hidden:!0},{id:"pages",icon:e.jsx(Le,{style:a}),link:"/pages",name:"Pages",hidden:!0},{id:"components",icon:e.jsx(Ce,{style:a}),link:"/components",name:"Components",hidden:!0}],j=o.useCallback(s=>{const b=g.find(h=>h.id===s);b?.link&&n(b.link),m(h=>h===s?void 0:s)},[g,n]);o.useEffect(()=>{const s={dashboard:["/","/home"],git:["git"],commits:["commits"],simulations:["simulations"],activity:["activity"],files:["files"],settings:["settings"],pages:["pages"],components:["components"]};for(const[b,h]of Object.entries(s))if(h.some(v=>v==="/"?t.pathname==="/":t.pathname.includes(v))){m(b);return}m(void 0)},[t]);const f=async()=>{u(!0);try{const{default:s}=await oe(async()=>{const{default:v}=await import("./html2canvas-pro.esm-XQCGvadH.js");return{default:v}},[]),h=(await s(document.body)).toDataURL("image/jpeg",.8);N(h),i(!0)}catch(s){console.error("Screenshot capture failed:",s),i(!0)}finally{u(!1)}},S=()=>{i(!1),N(null)},A=ie();return e.jsxs(e.Fragment,{children:[e.jsxs("div",{id:"sidebar",className:"relative w-full h-screen bg-cygray-30 flex flex-col justify-between py-3",children:[e.jsxs("div",{className:"w-full flex flex-col items-center",children:[e.jsx("div",{children:e.jsx(_,{to:"/",className:"flex items-center justify-center h-20 cursor-pointer",children:e.jsx("img",{src:fe,alt:"CodeYam",className:"h-8"})})}),g.filter(s=>!s.hidden).map(s=>e.jsx(ue,{id:s.id,selected:s.id===r,onClick:j,icon:s.icon,name:s.name},`sidebar-button-${s.id}`))]}),e.jsx("div",{className:"w-full flex flex-col items-center pb-2",children:e.jsxs("button",{onClick:()=>{f()},disabled:l,className:"flex flex-col items-center gap-1 p-2 rounded-lg text-gray-600 hover:bg-gray-100 hover:text-gray-900 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-wait",title:"Report an issue",children:[l?e.jsx(W,{style:a,className:"animate-spin"}):e.jsx(te,{style:a}),e.jsx("span",{className:"text-[10px] font-medium",children:l?"Capturing...":"Report Issue"})]})})]}),p&&e.jsx(se,{isOpen:!0,onClose:S,context:A,defaultEmail:y,screenshotDataUrl:z??void 0})]})}function ze({toast:t,onClose:n}){o.useEffect(()=>{const p=t.duration||5e3;if(p>0){const i=setTimeout(()=>{n(t.id)},p);return()=>clearTimeout(i)}},[t.id,t.duration,n]);const r={success:"✅",error:"❌",info:"ℹ️",warning:"⚠️"},m={success:"bg-emerald-50 border-emerald-200 text-emerald-900",error:"bg-red-50 border-red-200 text-red-900",info:"bg-blue-50 border-blue-200 text-blue-900",warning:"bg-amber-50 border-amber-200 text-amber-900"};return e.jsxs("div",{className:`flex items-center gap-3 px-4 py-3 rounded-lg border-2 shadow-lg min-w-[320px] max-w-[500px] animate-[slideIn_0.3s_ease-out] ${m[t.type]}`,children:[e.jsx("span",{className:"text-2xl",children:r[t.type]}),e.jsx("p",{className:"flex-1 text-sm font-medium m-0",children:t.message}),e.jsx("button",{onClick:()=>n(t.id),className:"text-gray-500 hover:text-gray-700 text-xl leading-none bg-transparent border-none cursor-pointer p-0 w-6 h-6 flex items-center justify-center rounded transition-colors hover:bg-black/10",children:"×"})]})}function Te({toasts:t,onClose:n}){return t.length===0?null:e.jsxs("div",{className:"fixed top-4 right-4 z-10000 flex flex-col gap-2",children:[e.jsx("style",{children:`
6
6
  @keyframes slideIn {
7
7
  from {
8
8
  transform: translateX(400px);
@@ -13,4 +13,4 @@ import{r as o,j as e,e as B,a as F,b as J,L as _,w as U,M as G,C as Y,S as K,D a
13
13
  opacity: 1;
14
14
  }
15
15
  }
16
- `}),t.map(r=>e.jsx(ze,{toast:r,onClose:n},r.id))]})}function P({entity:t,nameSize:n="11px",pathSize:r="10px",pathMaxLength:m=50,showScenarioCount:p=!1,scenarioCount:i=0,additionalContent:l}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(me,{type:t.entityType||"other"}),e.jsxs(_,{to:`/entity/${t.sha}`,className:"hover:underline shrink-0 cursor-pointer",style:{fontSize:n,fontWeight:500,color:"#000",whiteSpace:"nowrap"},children:[t.name,p&&i>0&&` (${i})`]}),e.jsx(xe,{filePath:t.filePath,maxLength:m,style:{fontSize:r,color:"#8E8E8E"}})]}),l]})}function Me({currentRun:t,projectSlug:n,currentEntities:r=[],isAnalysisStarting:m=!1,queuedJobCount:p=0,queueJobs:i=[],currentlyExecuting:l=null,historicalRuns:u=[]}){const[z,N]=o.useState(!1),[x,y]=o.useState(!1),[a,g]=o.useState(!1),[j,f]=o.useState(null),S=!!l||i.length>0,A=!!l,s=l?.entities||r;t?.analysisCompletedAt,t?.readyToBeCaptured,t?.capturesCompleted;const b=t?.currentEntityShas&&t.currentEntityShas.length>0,h=S,{lastLine:v,isCompleted:H}=ce(n,h),E=A||h&&!H&&!S,O=(()=>{if(h)return!1;const C=Date.now()-30*1e3;if(t?.createdAt&&b){const d=t.analysisCompletedAt||t.createdAt;if(new Date(d).getTime()>C)return!0}if(u.length>0){const d=u[0],k=d.analysisCompletedAt||d.archivedAt||d.createdAt;if(k&&new Date(k).getTime()>C)return!0}return!1})(),I=(()=>{const C=Date.now()-1440*60*1e3;if(t?.createdAt&&b){const d=t.analysisCompletedAt||t.createdAt;if(new Date(d).getTime()>C)return!0}if(u.length>0){const d=u[0],k=d.analysisCompletedAt||d.archivedAt||d.createdAt;if(k&&new Date(k).getTime()>C)return!0}return!1})(),R=m||E||p>0||O;return o.useEffect(()=>{const c=l?.id||null;R?c!==j&&(y(!0),g(!1),j!==null&&f(null)):(j!==null&&f(null),!I&&x&&!a&&y(!1))},[R,I,x,a,j,l?.id]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`fixed bottom-4 right-4 z-9998 bg-white rounded shadow-lg border-2 border-primary-100 transition-all duration-200 ${x?"min-w-[350px] max-w-[500px]":"w-auto"}`,children:[!x&&e.jsxs("div",{onClick:()=>{y(!0),g(!0),f(null)},className:"flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-gray-50 transition-colors",title:"Click to expand",children:[E?e.jsx(W,{size:16,className:"animate-spin",style:{color:"#005C75"}}):e.jsx("div",{className:"flex items-center justify-center rounded",style:{backgroundColor:"#E0E9EC",width:"20px",height:"20px"},children:e.jsx(D,{size:16,style:{color:"#005C75"}})}),e.jsx("span",{style:{fontSize:"12px",fontWeight:500,color:"#343434"},children:E?"Analyzing...":"Activity: No Activity Yet"}),E&&e.jsx("button",{onClick:c=>{c.stopPropagation(),N(!0)},className:"ml-auto px-2 py-1 rounded transition-colors cursor-pointer",style:{backgroundColor:"#E0E9EC",color:"#005C75",fontSize:"10px",fontWeight:600},children:"View Logs"})]}),x&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[E?e.jsx(W,{size:16,className:"animate-spin",style:{color:"#005C75"}}):e.jsx("div",{className:"flex items-center justify-center rounded",style:{backgroundColor:"#E0E9EC",width:"20px",height:"20px"},children:e.jsx(D,{size:16,style:{color:"#005C75"}})}),e.jsx("span",{style:{fontSize:"12px",fontWeight:500,color:"#343434"},children:E?"Analyzing...":"Activity"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>N(!0),className:"px-2 py-1 rounded transition-colors cursor-pointer",style:{backgroundColor:"#E0E9EC",color:"#005C75",fontSize:"10px",fontWeight:600},children:"View Logs"}),e.jsx("button",{onClick:()=>{y(!1),f(l?.id||null)},className:"p-1 rounded hover:bg-gray-100 transition-colors cursor-pointer",title:"Collapse","aria-label":"Collapse",children:e.jsx(pe,{size:16,style:{color:"#646464"}})})]})]}),e.jsx("div",{style:{height:"1px",backgroundColor:"#E0E9EC",margin:"0 12px"}}),e.jsxs("div",{className:"px-3 pt-2 pb-3 space-y-3",children:[E&&s.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(D,{size:12,style:{color:"#005C75"}}),e.jsx("h4",{style:{fontSize:"11px",fontWeight:600,color:"#343434"},children:"Current Activity"})]}),s[0]&&e.jsx("div",{className:"space-y-1",children:e.jsx(P,{entity:s[0],nameSize:"11px",pathSize:"10px",pathMaxLength:150,additionalContent:v?e.jsx("div",{style:{fontSize:"10px",color:"#005C75",marginTop:"4px"},children:v}):void 0})})]}),i.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(je,{size:12,style:{color:"#005C75"}}),e.jsx("h4",{style:{fontSize:"11px",fontWeight:600,color:"#343434"},children:"Queued Activity"})]}),e.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:i.map(c=>e.jsx("div",{className:"rounded p-2",style:{backgroundColor:"#f5f5f5"},children:c.entities.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[c.entities.slice(0,3).map(C=>e.jsx(P,{entity:C,nameSize:"10px",pathSize:"9px",pathMaxLength:120},C.sha)),c.entities.length>3&&e.jsxs("div",{style:{fontSize:"9px",color:"#646464",fontStyle:"italic"},children:["+",c.entities.length-3," more"]})]})},c.id))})]}),I&&u.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(he,{size:12,style:{color:"#005C75"}}),e.jsx("h4",{style:{fontSize:"11px",fontWeight:600,color:"#343434"},children:"Recently Completed"})]}),e.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:u.slice(0,3).map((c,C)=>{const d=c.entities||[],k=c.analysisCompletedAt||c.archivedAt||c.createdAt||"",T=(()=>{if(!k)return"";const w=Date.now()-new Date(k).getTime(),M=Math.floor(w/6e4),$=Math.floor(w/36e5);return $>0?`${$}h ago`:M>0?`${M}m ago`:"just now"})(),q=d.slice(0,3).map(w=>({...w,scenarioCount:w.analyses?.[0]?.scenarios?.length||0}));return e.jsx("div",{className:"rounded p-2",style:{backgroundColor:"#f5f5f5"},children:d.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[q.map((w,M)=>e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(P,{entity:w,nameSize:"10px",pathSize:"9px",pathMaxLength:100,showScenarioCount:!0,scenarioCount:w.scenarioCount})}),M===0&&T&&e.jsx("div",{style:{fontSize:"9px",color:"#8E8E8E",whiteSpace:"nowrap",paddingTop:"2px"},children:T})]},w.sha)),d.length>3&&e.jsxs("div",{style:{fontSize:"9px",color:"#646464",fontStyle:"italic"},children:["+",d.length-3," more"]})]})},C)})})]})]}),e.jsx("div",{style:{height:"1px",backgroundColor:"#E0E9EC",margin:"0 12px"}}),e.jsx("div",{className:"px-3 pb-2",children:e.jsx(_,{to:"/activity",className:"text-xs font-medium hover:underline cursor-pointer",style:{color:"#005C75"},children:"View All Activity →"})})]})]}),z&&n&&e.jsx(de,{projectSlug:n,onClose:()=>N(!1)})]})}const De="/assets/globals-xPz593l2.css";function _e({text:t,subtext:n,linkText:r,linkTo:m}){const[p,i]=o.useState(!1);return p?null:e.jsx("div",{className:"bg-blue-100 border rounded border-blue-800 shadow-sm mx-6 mt-6",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("div",{className:"shrink-0",children:e.jsx("svg",{className:"w-5 h-5 text-yellow-600",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-medium text-blue-900",children:t}),e.jsx("p",{className:"text-xs text-blue-700 mt-0.5",children:n})]}),e.jsx(_,{to:m,className:"shrink-0 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded hover:bg-blue-700 transition-colors",children:r})]}),e.jsx("button",{type:"button",onClick:()=>i(!0),className:"shrink-0 ml-4 p-1 rounded text-blue-600 hover:text-blue-800 hover:bg-blue-100 transition-colors cursor-pointer","aria-label":"Dismiss banner",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{d:"M6 18L18 6M6 6l12 12"})})})]})})}const Ye=()=>[{rel:"stylesheet",href:De},{rel:"icon",type:"image/x-icon",href:"/favicon.ico"}];function Ie(){const{currentRun:t,projectSlug:n,currentEntities:r,availableAPIKeys:m,queuedJobCount:p,queueJobs:i,currentlyExecuting:l,historicalRuns:u}=X(),{toasts:z,closeToast:N}=le(),x=Z(),y=o.useRef(x),a=B();o.useEffect(()=>{y.current=x},[x]);const g=a.pathname.startsWith("/entity/")&&a.pathname.includes("/edit/")||a.pathname.startsWith("/dev/");return o.useEffect(()=>{const j=new EventSource("/api/events");let f=null,S=0;const A=2e3;return j.addEventListener("message",s=>{if(JSON.parse(s.data).type==="db-change"){const h=Date.now(),v=h-S;v<A?(f&&clearTimeout(f),f=setTimeout(()=>{y.current.revalidate(),S=Date.now(),f=null},A-v)):(y.current.revalidate(),S=h)}}),j.addEventListener("error",s=>{console.error("SSE connection error:",s)}),()=>{f&&clearTimeout(f),j.close()}},[]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`min-h-screen ${g?"":"grid"} bg-cygray-10`,style:g?void 0:{gridTemplateColumns:"96px minmax(900px, 1fr)"},children:[!g&&e.jsx(Ae,{}),e.jsxs("div",{className:"max-h-screen overflow-auto bg-white",children:[m.length===0&&e.jsx(_e,{text:"No AI API keys configured. Please provide an AI API key at your earliest convenience.",subtext:"An API key is required for stable, frequent use of CodeYam",linkText:"Configure API Keys",linkTo:"/settings"}),e.jsx(ee,{})]})]}),e.jsx(Te,{toasts:z,onClose:N}),e.jsx(Me,{currentRun:t,projectSlug:n,currentEntities:r,isAnalysisStarting:!1,queuedJobCount:p,queueJobs:i,currentlyExecuting:l,historicalRuns:u})]})}const Ke=U(function(){return e.jsxs("html",{lang:"en",children:[e.jsxs("head",{children:[e.jsx("meta",{charSet:"utf-8"}),e.jsx("meta",{name:"viewport",content:"width=device-width,initial-scale=1"}),e.jsx(G,{}),e.jsx(Y,{})]}),e.jsxs("body",{children:[e.jsx(re,{children:e.jsx(ae,{children:e.jsx(Ie,{})})}),e.jsx(K,{}),e.jsx(Q,{})]})]})});export{Ke as default,Ye as links};
16
+ `}),t.map(r=>e.jsx(ze,{toast:r,onClose:n},r.id))]})}function P({entity:t,nameSize:n="11px",pathSize:r="10px",pathMaxLength:m=50,showScenarioCount:p=!1,scenarioCount:i=0,additionalContent:l}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(me,{type:t.entityType||"other"}),e.jsxs(_,{to:`/entity/${t.sha}`,className:"hover:underline shrink-0 cursor-pointer",style:{fontSize:n,fontWeight:500,color:"#000",whiteSpace:"nowrap"},children:[t.name,p&&i>0&&` (${i})`]}),e.jsx(xe,{filePath:t.filePath,maxLength:m,style:{fontSize:r,color:"#8E8E8E"}})]}),l]})}function Me({currentRun:t,projectSlug:n,currentEntities:r=[],isAnalysisStarting:m=!1,queuedJobCount:p=0,queueJobs:i=[],currentlyExecuting:l=null,historicalRuns:u=[]}){const[z,N]=o.useState(!1),[x,y]=o.useState(!1),[a,g]=o.useState(!1),[j,f]=o.useState(null),S=!!l||i.length>0,A=!!l,s=l?.entities||r;t?.analysisCompletedAt,t?.readyToBeCaptured,t?.capturesCompleted;const b=t?.currentEntityShas&&t.currentEntityShas.length>0,h=S,{lastLine:v,isCompleted:O}=ce(n,h),E=A||h&&!O&&!S,H=(()=>{if(h)return!1;const C=Date.now()-30*1e3;if(t?.createdAt&&b){const d=t.analysisCompletedAt||t.createdAt;if(new Date(d).getTime()>C)return!0}if(u.length>0){const d=u[0],k=d.analysisCompletedAt||d.archivedAt||d.createdAt;if(k&&new Date(k).getTime()>C)return!0}return!1})(),I=(()=>{const C=Date.now()-1440*60*1e3;if(t?.createdAt&&b){const d=t.analysisCompletedAt||t.createdAt;if(new Date(d).getTime()>C)return!0}if(u.length>0){const d=u[0],k=d.analysisCompletedAt||d.archivedAt||d.createdAt;if(k&&new Date(k).getTime()>C)return!0}return!1})(),R=m||E||p>0||H;return o.useEffect(()=>{const c=l?.id||null;R?c!==j&&(y(!0),g(!1),j!==null&&f(null)):(j!==null&&f(null),!I&&x&&!a&&y(!1))},[R,I,x,a,j,l?.id]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`fixed bottom-4 right-4 z-9998 bg-white rounded shadow-lg border-2 border-primary-100 transition-all duration-200 ${x?"min-w-[350px] max-w-[500px]":"w-auto"}`,children:[!x&&e.jsxs("div",{onClick:()=>{y(!0),g(!0),f(null)},className:"flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-gray-50 transition-colors",title:"Click to expand",children:[E?e.jsx(W,{size:16,className:"animate-spin",style:{color:"#005C75"}}):e.jsx("div",{className:"flex items-center justify-center rounded",style:{backgroundColor:"#E0E9EC",width:"20px",height:"20px"},children:e.jsx(D,{size:16,style:{color:"#005C75"}})}),e.jsx("span",{style:{fontSize:"12px",fontWeight:500,color:"#343434"},children:E?"Analyzing...":"Activity: No Activity Yet"}),E&&e.jsx("button",{onClick:c=>{c.stopPropagation(),N(!0)},className:"ml-auto px-2 py-1 rounded transition-colors cursor-pointer",style:{backgroundColor:"#E0E9EC",color:"#005C75",fontSize:"10px",fontWeight:600},children:"View Logs"})]}),x&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[E?e.jsx(W,{size:16,className:"animate-spin",style:{color:"#005C75"}}):e.jsx("div",{className:"flex items-center justify-center rounded",style:{backgroundColor:"#E0E9EC",width:"20px",height:"20px"},children:e.jsx(D,{size:16,style:{color:"#005C75"}})}),e.jsx("span",{style:{fontSize:"12px",fontWeight:500,color:"#343434"},children:E?"Analyzing...":"Activity"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>N(!0),className:"px-2 py-1 rounded transition-colors cursor-pointer",style:{backgroundColor:"#E0E9EC",color:"#005C75",fontSize:"10px",fontWeight:600},children:"View Logs"}),e.jsx("button",{onClick:()=>{y(!1),f(l?.id||null)},className:"p-1 rounded hover:bg-gray-100 transition-colors cursor-pointer",title:"Collapse","aria-label":"Collapse",children:e.jsx(pe,{size:16,style:{color:"#646464"}})})]})]}),e.jsx("div",{style:{height:"1px",backgroundColor:"#E0E9EC",margin:"0 12px"}}),e.jsxs("div",{className:"px-3 pt-2 pb-3 space-y-3",children:[E&&s.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(D,{size:12,style:{color:"#005C75"}}),e.jsx("h4",{style:{fontSize:"11px",fontWeight:600,color:"#343434"},children:"Current Activity"})]}),s[0]&&e.jsx("div",{className:"space-y-1",children:e.jsx(P,{entity:s[0],nameSize:"11px",pathSize:"10px",pathMaxLength:150,additionalContent:v?e.jsx("div",{style:{fontSize:"10px",color:"#005C75",marginTop:"4px"},children:v}):void 0})})]}),i.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(je,{size:12,style:{color:"#005C75"}}),e.jsx("h4",{style:{fontSize:"11px",fontWeight:600,color:"#343434"},children:"Queued Activity"})]}),e.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:i.map(c=>e.jsx("div",{className:"rounded p-2",style:{backgroundColor:"#f5f5f5"},children:c.entities.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[c.entities.slice(0,3).map(C=>e.jsx(P,{entity:C,nameSize:"10px",pathSize:"9px",pathMaxLength:120},C.sha)),c.entities.length>3&&e.jsxs("div",{style:{fontSize:"9px",color:"#646464",fontStyle:"italic"},children:["+",c.entities.length-3," more"]})]})},c.id))})]}),I&&u.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(he,{size:12,style:{color:"#005C75"}}),e.jsx("h4",{style:{fontSize:"11px",fontWeight:600,color:"#343434"},children:"Recently Completed"})]}),e.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto",children:u.slice(0,3).map((c,C)=>{const d=c.entities||[],k=c.analysisCompletedAt||c.archivedAt||c.createdAt||"",T=(()=>{if(!k)return"";const w=Date.now()-new Date(k).getTime(),M=Math.floor(w/6e4),$=Math.floor(w/36e5);return $>0?`${$}h ago`:M>0?`${M}m ago`:"just now"})(),q=d.slice(0,3).map(w=>({...w,scenarioCount:w.analyses?.[0]?.scenarios?.length||0}));return e.jsx("div",{className:"rounded p-2",style:{backgroundColor:"#f5f5f5"},children:d.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[q.map((w,M)=>e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(P,{entity:w,nameSize:"10px",pathSize:"9px",pathMaxLength:100,showScenarioCount:!0,scenarioCount:w.scenarioCount})}),M===0&&T&&e.jsx("div",{style:{fontSize:"9px",color:"#8E8E8E",whiteSpace:"nowrap",paddingTop:"2px"},children:T})]},w.sha)),d.length>3&&e.jsxs("div",{style:{fontSize:"9px",color:"#646464",fontStyle:"italic"},children:["+",d.length-3," more"]})]})},C)})})]})]}),e.jsx("div",{style:{height:"1px",backgroundColor:"#E0E9EC",margin:"0 12px"}}),e.jsx("div",{className:"px-3 pb-2",children:e.jsx(_,{to:"/activity",className:"text-xs font-medium hover:underline cursor-pointer",style:{color:"#005C75"},children:"View All Activity →"})})]})]}),z&&n&&e.jsx(de,{projectSlug:n,onClose:()=>N(!1)})]})}const De="/assets/globals-CO-U8Bpo.css";function _e({text:t,subtext:n,linkText:r,linkTo:m}){const[p,i]=o.useState(!1);return p?null:e.jsx("div",{className:"bg-blue-100 border rounded border-blue-800 shadow-sm mx-6 mt-6",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1",children:[e.jsx("div",{className:"shrink-0",children:e.jsx("svg",{className:"w-5 h-5 text-yellow-600",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-medium text-blue-900",children:t}),e.jsx("p",{className:"text-xs text-blue-700 mt-0.5",children:n})]}),e.jsx(_,{to:m,className:"shrink-0 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded hover:bg-blue-700 transition-colors",children:r})]}),e.jsx("button",{type:"button",onClick:()=>i(!0),className:"shrink-0 ml-4 p-1 rounded text-blue-600 hover:text-blue-800 hover:bg-blue-100 transition-colors cursor-pointer","aria-label":"Dismiss banner",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{d:"M6 18L18 6M6 6l12 12"})})})]})})}const Ye=()=>[{rel:"stylesheet",href:De},{rel:"icon",type:"image/x-icon",href:"/favicon.ico"}];function Ie(){const{currentRun:t,projectSlug:n,currentEntities:r,availableAPIKeys:m,queuedJobCount:p,queueJobs:i,currentlyExecuting:l,historicalRuns:u}=X(),{toasts:z,closeToast:N}=le(),x=Z(),y=o.useRef(x),a=V();o.useEffect(()=>{y.current=x},[x]);const g=a.pathname.startsWith("/entity/")&&a.pathname.includes("/edit/")||a.pathname.startsWith("/dev/");return o.useEffect(()=>{const j=new EventSource("/api/events");let f=null,S=0;const A=2e3;return j.addEventListener("message",s=>{if(JSON.parse(s.data).type==="db-change"){const h=Date.now(),v=h-S;v<A?(f&&clearTimeout(f),f=setTimeout(()=>{y.current.revalidate(),S=Date.now(),f=null},A-v)):(y.current.revalidate(),S=h)}}),j.addEventListener("error",s=>{console.error("SSE connection error:",s)}),()=>{f&&clearTimeout(f),j.close()}},[]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`min-h-screen ${g?"":"grid"} bg-cygray-10`,style:g?void 0:{gridTemplateColumns:"96px minmax(900px, 1fr)"},children:[!g&&e.jsx(Ae,{}),e.jsxs("div",{className:"max-h-screen overflow-auto bg-white",children:[m.length===0&&e.jsx(_e,{text:"No AI API keys configured. Please provide an AI API key at your earliest convenience.",subtext:"An API key is required for stable, frequent use of CodeYam",linkText:"Configure API Keys",linkTo:"/settings"}),e.jsx(ee,{})]})]}),e.jsx(Te,{toasts:z,onClose:N}),e.jsx(Me,{currentRun:t,projectSlug:n,currentEntities:r,isAnalysisStarting:!1,queuedJobCount:p,queueJobs:i,currentlyExecuting:l,historicalRuns:u})]})}const Ke=J(function(){return e.jsxs("html",{lang:"en",children:[e.jsxs("head",{children:[e.jsx("meta",{charSet:"utf-8"}),e.jsx("meta",{name:"viewport",content:"width=device-width,initial-scale=1"}),e.jsx(G,{}),e.jsx(Y,{})]}),e.jsxs("body",{children:[e.jsx(re,{children:e.jsx(ae,{children:e.jsx(Ie,{})})}),e.jsx(K,{}),e.jsx(Q,{})]})]})});export{Ke as default,Ye as links};
@@ -1 +1 @@
1
- import{c}from"./createLucideIcon-BBYuR56H.js";const e=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],o=c("search",e);export{o as S};
1
+ import{c}from"./createLucideIcon-DkgmwwRC.js";const e=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],o=c("search",e);export{o as S};
@@ -1 +1 @@
1
- import{w as Z,u as ee,c as se,b as te,d as ae,r,j as e}from"./chunk-WWGJGFF6-CgXbbZRx.js";import{u as re}from"./useReportContext-CANr3QJ5.js";const le=()=>[{title:"CodeYam - Settings"},{name:"description",content:"Configure project settings"}];function R(o){if(!o)return"";const a=[o.command];return o.args&&o.args.length>0&&a.push(...o.args),a.join(" ")}function D({mock:o,onSave:a,onCancel:c}){const[i,u]=r.useState(o.entityName),[m,n]=r.useState(o.filePath),[p,x]=r.useState(o.content),y=()=>{if(!i.trim()||!m.trim()||!p.trim()){alert("All fields are required");return}a({entityName:i,filePath:m,content:p})};return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Entity Name"}),e.jsx("input",{type:"text",value:i,onChange:l=>u(l.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded text-sm focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]",placeholder:"e.g., determineDatabaseType"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"File Path"}),e.jsx("input",{type:"text",value:m,onChange:l=>n(l.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded text-sm focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]",placeholder:"e.g., packages/database/src/lib/kysely/db.ts"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Content"}),e.jsx("textarea",{value:p,onChange:l=>x(l.target.value),rows:6,className:"w-full px-3 py-2 border border-gray-300 rounded text-sm font-mono focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]",placeholder:"e.g., function determineDatabaseType() { return 'postgresql' }"})]}),e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsx("button",{type:"button",onClick:c,className:"px-4 py-2 bg-gray-200 text-gray-800 border-none rounded text-sm cursor-pointer hover:bg-gray-300",children:"Cancel"}),e.jsx("button",{type:"button",onClick:y,className:"px-4 py-2 bg-[#005C75] text-white border-none rounded text-sm cursor-pointer hover:bg-[#004a5d]",children:"Save"})]})]})}function ne(o){try{return new Date(o).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return o}}const de=Z(function(){const{config:a,secrets:c,versionInfo:i,error:u}=ee(),m=se(),n=te(),p=ae(),[x,y]=r.useState("project-metadata");re({source:"settings-page"});const[l,h]=r.useState(a?.universalMocks||[]),[f,A]=r.useState((a?.pathsToIgnore||[]).join(", ")),[S,q]=r.useState((a?.pathsToIgnore||[]).join(", ")),[O,k]=r.useState(c?.GROQ_API_KEY||""),[F,P]=r.useState(c?.ANTHROPIC_API_KEY||""),[V,I]=r.useState(c?.OPENAI_API_KEY||""),[j,$]=r.useState(!1),[N,z]=r.useState(!1),[v,G]=r.useState(!1),[K,g]=r.useState(!1),[M,U]=r.useState(!1),[T,E]=r.useState(!1),[Y,C]=r.useState(null),[H,b]=r.useState(!1),[w,_]=r.useState({});r.useEffect(()=>{if(a){h(a.universalMocks||[]);const s=(a.pathsToIgnore||[]).join(", ");A(s),q(s);const t={};a.webapps?.forEach((d,X)=>{d.startCommand&&(t[X]=R(d.startCommand))}),_(t)}c&&(k(c.GROQ_API_KEY||""),P(c.ANTHROPIC_API_KEY||""),I(c.OPENAI_API_KEY||""))},[a,c]),r.useEffect(()=>{if(m?.success){g(!0);const s=setTimeout(()=>g(!1),3e3);return()=>clearTimeout(s)}},[m]),r.useEffect(()=>{if(n.state==="idle"&&n.data&&!T){console.log("[Settings] Fetcher data:",n.data);const s=n.data;if(s.success){console.log("[Settings] Save successful, revalidating..."),g(!0),E(!0),(f!==S||s.requiresRestart)&&U(!0),p.revalidate();const t=setTimeout(()=>{g(!1),E(!1)},3e3);return()=>clearTimeout(t)}}},[n.state,n.data,T,p,f,S]);const L=s=>{s.preventDefault();const t=new FormData(s.currentTarget);t.set("universalMocks",JSON.stringify(l)),t.set("startCommands",JSON.stringify(w)),console.log("[Settings] Submitting form data:",{universalMocks:t.get("universalMocks"),startCommands:t.get("startCommands"),openAiApiKey:t.get("openAiApiKey")?"***":"(empty)"}),n.submit(t,{method:"post"})},W=s=>{h([...l,s]),b(!1)},J=(s,t)=>{const d=[...l];d[s]=t,h(d),C(null)},Q=s=>{h(l.filter((t,d)=>d!==s))};if(u)return e.jsxs("div",{className:"max-w-6xl mx-auto p-8 font-sans",children:[e.jsx("header",{className:"mb-6 pb-4 border-b border-gray-200",children:e.jsx("div",{className:"flex justify-between items-center",children:e.jsx("h1",{className:"text-4xl font-bold text-gray-900",children:"Settings"})})}),e.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:e.jsx("p",{className:"text-red-700",children:u})})]});const B=[{id:"project-metadata",label:"Project Metadata"},{id:"ai-provider",label:"AI Provider Configuration"},{id:"commands",label:"Commands"},{id:"paths-to-ignore",label:"Paths To Ignore"},{id:"universal-mocks",label:"Universal Mocks"},{id:"current-configuration",label:"Current Configuration"}];return e.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:e.jsxs("div",{className:"px-36 py-12 font-sans",children:[e.jsxs("div",{className:"mb-8 flex justify-between items-start",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Settings"}),e.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"Project Configuration"})]}),e.jsx("button",{type:"submit",form:"settings-form",disabled:n.state==="submitting",className:"px-6 py-2 bg-[#005C75] text-white border-none rounded text-sm font-medium cursor-pointer disabled:cursor-not-allowed disabled:opacity-60 hover:bg-[#004a5d] whitespace-nowrap",children:n.state==="submitting"?"Saving...":"Save Settings"})]}),e.jsxs("div",{className:"flex gap-8 items-start",children:[e.jsx("nav",{className:"w-64 flex-shrink-0",children:e.jsx("ul",{className:"space-y-1",children:B.map(s=>e.jsx("li",{children:e.jsx("button",{type:"button",onClick:()=>y(s.id),className:`w-full text-left px-0 py-2.5 text-sm transition-colors ${x===s.id?"text-[#005C75] font-medium":"text-gray-600 hover:text-gray-900"}`,children:s.label})},s.id))})}),e.jsx("div",{className:"flex-1 min-w-0 -mt-2",children:e.jsxs("form",{id:"settings-form",onSubmit:L,className:"space-y-6",children:[x==="project-metadata"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Project Metadata"}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"block mb-2 font-medium text-gray-700",children:"Web Applications"}),a?.webapps&&a.webapps.length>0?e.jsx("div",{className:"space-y-3",children:a.webapps.map((s,t)=>e.jsx("div",{className:"p-4 bg-white border border-gray-200 rounded",children:e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Path:"})," ",e.jsx("span",{className:"text-gray-900",children:s.path==="."?"Root":s.path})]}),s.appDirectory&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"App Directory:"})," ",e.jsx("span",{className:"text-gray-900",children:s.appDirectory})]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Framework:"})," ",e.jsx("span",{className:"text-gray-900",children:s.framework})]}),s.startCommand&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Start Command:"})," ",e.jsxs("span",{className:"text-gray-900 font-mono text-xs",children:[s.startCommand.command," ",s.startCommand.args?.join(" ")]})]})]})},t))}):e.jsx("p",{className:"text-sm text-gray-600 italic",children:"No web applications configured"}),e.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Web applications are detected during initialization. To modify, edit `.codeyam/config.json` or re-run `codeyam init`."})]})]}),x==="ai-provider"&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-800 mb-4",children:"AI Provider API Keys"}),e.jsx("p",{className:"text-sm text-gray-600 mb-6",children:"Configure API keys for AI-powered analysis. Choose the provider that best fits your needs."}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border border-gray-200 rounded-lg p-5 bg-white",children:[e.jsx("div",{className:"flex items-start justify-between mb-3",children:e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold text-gray-900 mb-1",children:"Groq"}),e.jsx("p",{className:"text-sm text-gray-600 mb-3",children:"Lightning-fast inference with industry-leading speed. Groq's LPU architecture delivers exceptional performance for real-time AI applications with competitive pricing."}),e.jsxs("div",{className:"flex gap-3 text-xs",children:[e.jsxs("div",{className:"px-2 py-1 bg-green-100 text-green-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Cost:"})," ","$0.10/1M tokens"]}),e.jsxs("div",{className:"px-2 py-1 bg-cyan-100 text-cyan-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Speed:"})," 850 tokens/s"]}),e.jsxs("div",{className:"px-2 py-1 bg-purple-100 text-purple-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Reliability:"})," ","Less reliable, but capable of producing reasonable results"]})]})]})}),e.jsxs("div",{className:"mt-4",children:[e.jsx("label",{htmlFor:"groqApiKey",className:"block text-sm font-medium text-gray-700 mb-2",children:"API Key"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:j?"text":"password",id:"groqApiKey",name:"groqApiKey",value:O,onChange:s=>k(s.target.value),placeholder:"gsk_...",className:"w-full px-3 py-2 pr-24 border border-gray-300 rounded text-sm focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]"}),e.jsx("button",{type:"button",onClick:()=>$(!j),className:"absolute right-2 top-1/2 -translate-y-1/2 px-3 py-1 text-xs text-gray-600 hover:text-gray-800 focus:outline-none",children:j?"Hide":"Show"})]})]})]}),e.jsxs("div",{className:"border border-gray-200 rounded-lg p-5 bg-white",children:[e.jsx("div",{className:"flex items-start justify-between mb-3",children:e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold text-gray-900 mb-1",children:"Anthropic Claude"}),e.jsx("p",{className:"text-sm text-gray-600 mb-3",children:"Advanced reasoning and coding capabilities with superior context understanding. Claude excels at complex analysis tasks and provides highly accurate results with detailed explanations."}),e.jsxs("div",{className:"flex gap-3 text-xs",children:[e.jsxs("div",{className:"px-2 py-1 bg-green-100 text-green-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Cost:"})," ","$3.00/1M tokens"]}),e.jsxs("div",{className:"px-2 py-1 bg-cyan-100 text-cyan-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Speed:"})," 120 tokens/s"]}),e.jsxs("div",{className:"px-2 py-1 bg-purple-100 text-purple-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Reliability:"})," ","Consistent, high quality results"]})]})]})}),e.jsxs("div",{className:"mt-4",children:[e.jsx("label",{htmlFor:"anthropicApiKey",className:"block text-sm font-medium text-gray-700 mb-2",children:"API Key"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:N?"text":"password",id:"anthropicApiKey",name:"anthropicApiKey",value:F,onChange:s=>P(s.target.value),placeholder:"sk-ant-...",className:"w-full px-3 py-2 pr-24 border border-gray-300 rounded text-sm focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]"}),e.jsx("button",{type:"button",onClick:()=>z(!N),className:"absolute right-2 top-1/2 -translate-y-1/2 px-3 py-1 text-xs text-gray-600 hover:text-gray-800 focus:outline-none",children:N?"Hide":"Show"})]})]})]}),e.jsxs("div",{className:"border border-gray-200 rounded-lg p-5 bg-white",children:[e.jsx("div",{className:"flex items-start justify-between mb-3",children:e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold text-gray-900 mb-1",children:"OpenAI GPT"}),e.jsx("p",{className:"text-sm text-gray-600 mb-3",children:"Industry-standard AI with broad capabilities and extensive ecosystem. GPT models offer reliable performance across diverse tasks with good balance of speed and quality."}),e.jsxs("div",{className:"flex gap-3 text-xs",children:[e.jsxs("div",{className:"px-2 py-1 bg-green-100 text-green-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Cost:"})," ","$2.50/1M tokens"]}),e.jsxs("div",{className:"px-2 py-1 bg-cyan-100 text-cyan-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Speed:"})," 150 tokens/s"]}),e.jsxs("div",{className:"px-2 py-1 bg-purple-100 text-purple-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Reliability:"})," ","Consistent, high quality results"]})]})]})}),e.jsxs("div",{className:"mt-4",children:[e.jsx("label",{htmlFor:"openAiApiKey",className:"block text-sm font-medium text-gray-700 mb-2",children:"API Key"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:v?"text":"password",id:"openAiApiKey",name:"openAiApiKey",value:V,onChange:s=>I(s.target.value),placeholder:"sk-...",className:"w-full px-3 py-2 pr-24 border border-gray-300 rounded text-sm focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]"}),e.jsx("button",{type:"button",onClick:()=>G(!v),className:"absolute right-2 top-1/2 -translate-y-1/2 px-3 py-1 text-xs text-gray-600 hover:text-gray-800 focus:outline-none",children:v?"Hide":"Show"})]})]})]})]})]}),x==="commands"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Commands"}),e.jsx("p",{className:"text-sm text-gray-600 mb-6",children:"Configure start commands for your web applications"}),a?.webapps&&a.webapps.length>0?e.jsx("div",{className:"space-y-4",children:a.webapps.map((s,t)=>e.jsxs("div",{className:"border border-gray-200 rounded-lg p-5 bg-white",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"text-base font-semibold text-gray-900 mb-1",children:s.path==="."?"Root":s.path}),e.jsx("div",{className:"text-sm text-gray-600",children:s.framework})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:`startCommand-${t}`,className:"block text-sm font-medium text-gray-700 mb-2",children:"Start Command"}),e.jsx("input",{type:"text",id:`startCommand-${t}`,name:`startCommand-${t}`,value:w[t]||"",onChange:d=>_({...w,[t]:d.target.value}),placeholder:"e.g., pnpm dev --port $PORT",className:"w-full px-3 py-2 border border-gray-300 rounded text-sm font-mono focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]"}),e.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"Use $PORT as a placeholder for the dynamic port number"})]})]},t))}):e.jsx("p",{className:"text-sm text-gray-600 italic",children:"No web applications configured"})]}),x==="paths-to-ignore"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Paths To Ignore"}),e.jsx("input",{type:"text",id:"pathsToIgnore",name:"pathsToIgnore",value:f,onChange:s=>A(s.target.value),placeholder:"e.g., __tests__, \\.test\\.ts$, ^background (no quotes needed)",className:"w-full px-3 py-3 border border-gray-300 rounded text-sm font-mono focus:outline-none focus:border-[#005C75] focus:ring-2 focus:ring-[#005C75]/10"}),e.jsxs("p",{className:"mt-2 text-sm text-gray-600",children:["Comma-separated list of regex patterns for paths to ignore during file watching. Examples:"," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"__tests__"}),","," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"\\.test\\.tsx?$"}),","," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"^background"}),e.jsx("br",{}),e.jsx("span",{className:"text-xs text-gray-500 mt-1 inline-block",children:"Note: Files matching patterns in .gitignore are also automatically ignored"})]})]}),x==="universal-mocks"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Universal Mocks"}),e.jsx("p",{className:"mb-3 text-sm text-gray-600",children:"Mock functions that will be applied across all entity simulations"}),l.length===0?e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"text-sm text-gray-500 mb-3",children:"No universal mocks configured"}),e.jsx("button",{type:"button",onClick:()=>b(!0),className:"px-4 py-2 bg-[#005C75] text-white border-none rounded text-sm cursor-pointer hover:bg-[#004a5d]",children:"Add Mock"})]}):e.jsx("div",{className:"space-y-3",children:l.map((s,t)=>e.jsx("div",{className:"p-4 bg-gray-50 rounded border border-gray-200",children:Y===t?e.jsx(D,{mock:s,onSave:d=>J(t,d),onCancel:()=>C(null)}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex justify-between items-start mb-2",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"font-medium text-gray-800 mb-1",children:s.entityName}),e.jsx("div",{className:"text-sm text-gray-600 mb-2",children:s.filePath}),e.jsx("pre",{className:"text-xs bg-white p-2 rounded border border-gray-200 overflow-x-auto",children:s.content})]}),e.jsxs("div",{className:"flex gap-2 ml-3",children:[e.jsx("button",{type:"button",onClick:()=>C(t),className:"px-3 py-1 bg-teal-600 text-white border-none rounded text-sm cursor-pointer hover:bg-teal-700",children:"Edit"}),e.jsx("button",{type:"button",onClick:()=>Q(t),className:"px-3 py-1 bg-red-600 text-white border-none rounded text-sm cursor-pointer hover:bg-red-700",children:"Delete"})]})]})})},t))}),l.length>0&&e.jsx("button",{type:"button",onClick:()=>b(!0),className:"mt-4 px-4 py-2 bg-[#005C75] text-white border-none rounded text-sm cursor-pointer hover:bg-[#004a5d]",children:"Add Mock"})]}),x==="current-configuration"&&e.jsxs("div",{className:"space-y-6",children:[a&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Current Configuration"}),e.jsx("div",{className:"p-4 bg-white border border-gray-200 rounded mb-6",children:e.jsxs("div",{className:"space-y-2 text-sm",children:[a.projectSlug&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Project Slug:"})," ",e.jsx("span",{className:"text-gray-900",children:a.projectSlug})]}),a.packageManager&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Package Manager:"})," ",e.jsx("span",{className:"text-gray-900",children:a.packageManager})]})]})}),a.webapps&&a.webapps.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-gray-800 mb-3",children:"Web Applications"}),e.jsx("div",{className:"space-y-3",children:a.webapps.map((s,t)=>e.jsx("div",{className:"p-4 bg-white border border-gray-200 rounded",children:e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Path:"})," ",e.jsx("span",{className:"text-gray-900",children:s.path==="."?"Root":s.path})]}),s.appDirectory&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"App Directory:"})," ",e.jsx("span",{className:"text-gray-900",children:s.appDirectory})]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Framework:"})," ",e.jsx("span",{className:"text-gray-900",children:s.framework})]}),s.startCommand&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Start Command:"})," ",e.jsx("span",{className:"text-gray-900 font-mono text-xs",children:R(s.startCommand)})]})]})},t))})]})]}),i&&e.jsxs("div",{className:"mt-6",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-800 mb-3",children:"Version Information"}),e.jsx("div",{className:"p-4 bg-white border border-gray-200 rounded",children:e.jsxs("div",{className:"space-y-2 text-sm",children:[i.webserverVersion&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Webserver:"})," ",e.jsx("span",{className:"text-gray-900 font-mono",children:i.webserverVersion.version||"unknown"})]}),i.templateVersion&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Analyzer Template:"})," ",e.jsx("span",{className:"font-mono text-gray-900",children:i.templateVersion.version||i.templateVersion.gitCommit?.slice(0,7)||"unknown"}),i.templateVersion.buildTimestamp&&e.jsxs("span",{className:"text-gray-500 ml-2",children:["(built"," ",ne(i.templateVersion.buildTimestamp),")"]})]}),i.cachedAnalyzerVersion&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Cached Analyzer:"})," ",e.jsx("span",{className:"font-mono text-gray-900",children:i.cachedAnalyzerVersion.version||i.cachedAnalyzerVersion.gitCommit?.slice(0,7)||"unknown"}),i.isCacheStale?e.jsx("span",{className:"ml-2 px-2 py-0.5 bg-amber-100 text-amber-800 rounded text-xs",children:"Stale - will update on next analysis"}):e.jsx("span",{className:"ml-2 px-2 py-0.5 bg-green-100 text-green-800 rounded text-xs",children:"Up to date"})]}),!i.cachedAnalyzerVersion&&a?.projectSlug&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Cached Analyzer:"})," ",e.jsx("span",{className:"text-gray-500 italic",children:"Not initialized - will be created on first analysis"})]})]})})]})]})]})})]}),(K||M||m?.error||n.data&&typeof n.data=="object"&&"error"in n.data)&&e.jsxs("div",{className:"mt-6 max-w-5xl mx-auto space-y-3",children:[K&&e.jsx("div",{className:"text-emerald-600 text-sm font-medium bg-emerald-50 border border-emerald-200 rounded px-4 py-2",children:"Settings saved successfully!"}),M&&e.jsxs("div",{className:"text-amber-700 text-sm font-medium bg-amber-50 border border-amber-200 rounded px-4 py-2",children:[e.jsx("div",{children:"⚠️ Settings changed. Please restart CodeYam for changes to take effect:"}),e.jsx("code",{className:"ml-2 bg-amber-100 px-2 py-1 rounded text-xs",children:"codeyam stop && codeyam"})]}),m?.error&&e.jsx("div",{className:"text-red-600 text-sm font-medium bg-red-50 border border-red-200 rounded px-4 py-2",children:m.error}),(()=>{if(n.data&&typeof n.data=="object"&&"error"in n.data){const s=n.data;return typeof s.error=="string"?e.jsx("div",{className:"text-red-600 text-sm font-medium bg-red-50 border border-red-200 rounded px-4 py-2",children:s.error}):null}return null})()]}),H&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center p-4 z-50",children:e.jsxs("div",{className:"bg-white rounded-lg max-w-2xl w-full p-6",children:[e.jsx("h2",{className:"text-2xl font-bold mb-4 text-gray-900",children:"Add Universal Mock"}),e.jsx(D,{mock:{entityName:"",filePath:"",content:""},onSave:W,onCancel:()=>b(!1)})]})})]})})});export{de as default,le as meta};
1
+ import{w as Z,u as ee,c as se,b as te,d as ae,r,j as e}from"./chunk-WWGJGFF6-Bex4RrGs.js";import{u as re}from"./useReportContext-BWmSRPH6.js";const le=()=>[{title:"CodeYam - Settings"},{name:"description",content:"Configure project settings"}];function R(o){if(!o)return"";const a=[o.command];return o.args&&o.args.length>0&&a.push(...o.args),a.join(" ")}function D({mock:o,onSave:a,onCancel:c}){const[i,u]=r.useState(o.entityName),[m,n]=r.useState(o.filePath),[p,x]=r.useState(o.content),y=()=>{if(!i.trim()||!m.trim()||!p.trim()){alert("All fields are required");return}a({entityName:i,filePath:m,content:p})};return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Entity Name"}),e.jsx("input",{type:"text",value:i,onChange:l=>u(l.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded text-sm focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]",placeholder:"e.g., determineDatabaseType"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"File Path"}),e.jsx("input",{type:"text",value:m,onChange:l=>n(l.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded text-sm focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]",placeholder:"e.g., packages/database/src/lib/kysely/db.ts"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Content"}),e.jsx("textarea",{value:p,onChange:l=>x(l.target.value),rows:6,className:"w-full px-3 py-2 border border-gray-300 rounded text-sm font-mono focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]",placeholder:"e.g., function determineDatabaseType() { return 'postgresql' }"})]}),e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsx("button",{type:"button",onClick:c,className:"px-4 py-2 bg-gray-200 text-gray-800 border-none rounded text-sm cursor-pointer hover:bg-gray-300",children:"Cancel"}),e.jsx("button",{type:"button",onClick:y,className:"px-4 py-2 bg-[#005C75] text-white border-none rounded text-sm cursor-pointer hover:bg-[#004a5d]",children:"Save"})]})]})}function ne(o){try{return new Date(o).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return o}}const de=Z(function(){const{config:a,secrets:c,versionInfo:i,error:u}=ee(),m=se(),n=te(),p=ae(),[x,y]=r.useState("project-metadata");re({source:"settings-page"});const[l,h]=r.useState(a?.universalMocks||[]),[f,A]=r.useState((a?.pathsToIgnore||[]).join(", ")),[S,q]=r.useState((a?.pathsToIgnore||[]).join(", ")),[O,k]=r.useState(c?.GROQ_API_KEY||""),[F,P]=r.useState(c?.ANTHROPIC_API_KEY||""),[V,I]=r.useState(c?.OPENAI_API_KEY||""),[j,$]=r.useState(!1),[N,z]=r.useState(!1),[v,G]=r.useState(!1),[K,g]=r.useState(!1),[M,U]=r.useState(!1),[T,E]=r.useState(!1),[Y,C]=r.useState(null),[H,b]=r.useState(!1),[w,_]=r.useState({});r.useEffect(()=>{if(a){h(a.universalMocks||[]);const s=(a.pathsToIgnore||[]).join(", ");A(s),q(s);const t={};a.webapps?.forEach((d,X)=>{d.startCommand&&(t[X]=R(d.startCommand))}),_(t)}c&&(k(c.GROQ_API_KEY||""),P(c.ANTHROPIC_API_KEY||""),I(c.OPENAI_API_KEY||""))},[a,c]),r.useEffect(()=>{if(m?.success){g(!0);const s=setTimeout(()=>g(!1),3e3);return()=>clearTimeout(s)}},[m]),r.useEffect(()=>{if(n.state==="idle"&&n.data&&!T){console.log("[Settings] Fetcher data:",n.data);const s=n.data;if(s.success){console.log("[Settings] Save successful, revalidating..."),g(!0),E(!0),(f!==S||s.requiresRestart)&&U(!0),p.revalidate();const t=setTimeout(()=>{g(!1),E(!1)},3e3);return()=>clearTimeout(t)}}},[n.state,n.data,T,p,f,S]);const L=s=>{s.preventDefault();const t=new FormData(s.currentTarget);t.set("universalMocks",JSON.stringify(l)),t.set("startCommands",JSON.stringify(w)),console.log("[Settings] Submitting form data:",{universalMocks:t.get("universalMocks"),startCommands:t.get("startCommands"),openAiApiKey:t.get("openAiApiKey")?"***":"(empty)"}),n.submit(t,{method:"post"})},W=s=>{h([...l,s]),b(!1)},J=(s,t)=>{const d=[...l];d[s]=t,h(d),C(null)},Q=s=>{h(l.filter((t,d)=>d!==s))};if(u)return e.jsxs("div",{className:"max-w-6xl mx-auto p-8 font-sans",children:[e.jsx("header",{className:"mb-6 pb-4 border-b border-gray-200",children:e.jsx("div",{className:"flex justify-between items-center",children:e.jsx("h1",{className:"text-4xl font-bold text-gray-900",children:"Settings"})})}),e.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:e.jsx("p",{className:"text-red-700",children:u})})]});const B=[{id:"project-metadata",label:"Project Metadata"},{id:"ai-provider",label:"AI Provider Configuration"},{id:"commands",label:"Commands"},{id:"paths-to-ignore",label:"Paths To Ignore"},{id:"universal-mocks",label:"Universal Mocks"},{id:"current-configuration",label:"Current Configuration"}];return e.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:e.jsxs("div",{className:"px-36 py-12 font-sans",children:[e.jsxs("div",{className:"mb-8 flex justify-between items-start",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Settings"}),e.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"Project Configuration"})]}),e.jsx("button",{type:"submit",form:"settings-form",disabled:n.state==="submitting",className:"px-6 py-2 bg-[#005C75] text-white border-none rounded text-sm font-medium cursor-pointer disabled:cursor-not-allowed disabled:opacity-60 hover:bg-[#004a5d] whitespace-nowrap",children:n.state==="submitting"?"Saving...":"Save Settings"})]}),e.jsxs("div",{className:"flex gap-8 items-start",children:[e.jsx("nav",{className:"w-64 flex-shrink-0",children:e.jsx("ul",{className:"space-y-1",children:B.map(s=>e.jsx("li",{children:e.jsx("button",{type:"button",onClick:()=>y(s.id),className:`w-full text-left px-0 py-2.5 text-sm transition-colors ${x===s.id?"text-[#005C75] font-medium":"text-gray-600 hover:text-gray-900"}`,children:s.label})},s.id))})}),e.jsx("div",{className:"flex-1 min-w-0 -mt-2",children:e.jsxs("form",{id:"settings-form",onSubmit:L,className:"space-y-6",children:[x==="project-metadata"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Project Metadata"}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{className:"block mb-2 font-medium text-gray-700",children:"Web Applications"}),a?.webapps&&a.webapps.length>0?e.jsx("div",{className:"space-y-3",children:a.webapps.map((s,t)=>e.jsx("div",{className:"p-4 bg-white border border-gray-200 rounded",children:e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Path:"})," ",e.jsx("span",{className:"text-gray-900",children:s.path==="."?"Root":s.path})]}),s.appDirectory&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"App Directory:"})," ",e.jsx("span",{className:"text-gray-900",children:s.appDirectory})]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Framework:"})," ",e.jsx("span",{className:"text-gray-900",children:s.framework})]}),s.startCommand&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Start Command:"})," ",e.jsxs("span",{className:"text-gray-900 font-mono text-xs",children:[s.startCommand.command," ",s.startCommand.args?.join(" ")]})]})]})},t))}):e.jsx("p",{className:"text-sm text-gray-600 italic",children:"No web applications configured"}),e.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Web applications are detected during initialization. To modify, edit `.codeyam/config.json` or re-run `codeyam init`."})]})]}),x==="ai-provider"&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-800 mb-4",children:"AI Provider API Keys"}),e.jsx("p",{className:"text-sm text-gray-600 mb-6",children:"Configure API keys for AI-powered analysis. Choose the provider that best fits your needs."}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"border border-gray-200 rounded-lg p-5 bg-white",children:[e.jsx("div",{className:"flex items-start justify-between mb-3",children:e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold text-gray-900 mb-1",children:"Groq"}),e.jsx("p",{className:"text-sm text-gray-600 mb-3",children:"Lightning-fast inference with industry-leading speed. Groq's LPU architecture delivers exceptional performance for real-time AI applications with competitive pricing."}),e.jsxs("div",{className:"flex gap-3 text-xs",children:[e.jsxs("div",{className:"px-2 py-1 bg-green-100 text-green-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Cost:"})," ","$0.10/1M tokens"]}),e.jsxs("div",{className:"px-2 py-1 bg-cyan-100 text-cyan-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Speed:"})," 850 tokens/s"]}),e.jsxs("div",{className:"px-2 py-1 bg-purple-100 text-purple-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Reliability:"})," ","Less reliable, but capable of producing reasonable results"]})]})]})}),e.jsxs("div",{className:"mt-4",children:[e.jsx("label",{htmlFor:"groqApiKey",className:"block text-sm font-medium text-gray-700 mb-2",children:"API Key"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:j?"text":"password",id:"groqApiKey",name:"groqApiKey",value:O,onChange:s=>k(s.target.value),placeholder:"gsk_...",className:"w-full px-3 py-2 pr-24 border border-gray-300 rounded text-sm focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]"}),e.jsx("button",{type:"button",onClick:()=>$(!j),className:"absolute right-2 top-1/2 -translate-y-1/2 px-3 py-1 text-xs text-gray-600 hover:text-gray-800 focus:outline-none",children:j?"Hide":"Show"})]})]})]}),e.jsxs("div",{className:"border border-gray-200 rounded-lg p-5 bg-white",children:[e.jsx("div",{className:"flex items-start justify-between mb-3",children:e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold text-gray-900 mb-1",children:"Anthropic Claude"}),e.jsx("p",{className:"text-sm text-gray-600 mb-3",children:"Advanced reasoning and coding capabilities with superior context understanding. Claude excels at complex analysis tasks and provides highly accurate results with detailed explanations."}),e.jsxs("div",{className:"flex gap-3 text-xs",children:[e.jsxs("div",{className:"px-2 py-1 bg-green-100 text-green-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Cost:"})," ","$3.00/1M tokens"]}),e.jsxs("div",{className:"px-2 py-1 bg-cyan-100 text-cyan-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Speed:"})," 120 tokens/s"]}),e.jsxs("div",{className:"px-2 py-1 bg-purple-100 text-purple-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Reliability:"})," ","Consistent, high quality results"]})]})]})}),e.jsxs("div",{className:"mt-4",children:[e.jsx("label",{htmlFor:"anthropicApiKey",className:"block text-sm font-medium text-gray-700 mb-2",children:"API Key"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:N?"text":"password",id:"anthropicApiKey",name:"anthropicApiKey",value:F,onChange:s=>P(s.target.value),placeholder:"sk-ant-...",className:"w-full px-3 py-2 pr-24 border border-gray-300 rounded text-sm focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]"}),e.jsx("button",{type:"button",onClick:()=>z(!N),className:"absolute right-2 top-1/2 -translate-y-1/2 px-3 py-1 text-xs text-gray-600 hover:text-gray-800 focus:outline-none",children:N?"Hide":"Show"})]})]})]}),e.jsxs("div",{className:"border border-gray-200 rounded-lg p-5 bg-white",children:[e.jsx("div",{className:"flex items-start justify-between mb-3",children:e.jsxs("div",{children:[e.jsx("h4",{className:"text-base font-semibold text-gray-900 mb-1",children:"OpenAI GPT"}),e.jsx("p",{className:"text-sm text-gray-600 mb-3",children:"Industry-standard AI with broad capabilities and extensive ecosystem. GPT models offer reliable performance across diverse tasks with good balance of speed and quality."}),e.jsxs("div",{className:"flex gap-3 text-xs",children:[e.jsxs("div",{className:"px-2 py-1 bg-green-100 text-green-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Cost:"})," ","$2.50/1M tokens"]}),e.jsxs("div",{className:"px-2 py-1 bg-cyan-100 text-cyan-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Speed:"})," 150 tokens/s"]}),e.jsxs("div",{className:"px-2 py-1 bg-purple-100 text-purple-800 rounded",children:[e.jsx("span",{className:"font-medium",children:"Reliability:"})," ","Consistent, high quality results"]})]})]})}),e.jsxs("div",{className:"mt-4",children:[e.jsx("label",{htmlFor:"openAiApiKey",className:"block text-sm font-medium text-gray-700 mb-2",children:"API Key"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:v?"text":"password",id:"openAiApiKey",name:"openAiApiKey",value:V,onChange:s=>I(s.target.value),placeholder:"sk-...",className:"w-full px-3 py-2 pr-24 border border-gray-300 rounded text-sm focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]"}),e.jsx("button",{type:"button",onClick:()=>G(!v),className:"absolute right-2 top-1/2 -translate-y-1/2 px-3 py-1 text-xs text-gray-600 hover:text-gray-800 focus:outline-none",children:v?"Hide":"Show"})]})]})]})]})]}),x==="commands"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Commands"}),e.jsx("p",{className:"text-sm text-gray-600 mb-6",children:"Configure start commands for your web applications"}),a?.webapps&&a.webapps.length>0?e.jsx("div",{className:"space-y-4",children:a.webapps.map((s,t)=>e.jsxs("div",{className:"border border-gray-200 rounded-lg p-5 bg-white",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"text-base font-semibold text-gray-900 mb-1",children:s.path==="."?"Root":s.path}),e.jsx("div",{className:"text-sm text-gray-600",children:s.framework})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:`startCommand-${t}`,className:"block text-sm font-medium text-gray-700 mb-2",children:"Start Command"}),e.jsx("input",{type:"text",id:`startCommand-${t}`,name:`startCommand-${t}`,value:w[t]||"",onChange:d=>_({...w,[t]:d.target.value}),placeholder:"e.g., pnpm dev --port $PORT",className:"w-full px-3 py-2 border border-gray-300 rounded text-sm font-mono focus:outline-none focus:border-[#005C75] focus:ring-1 focus:ring-[#005C75]"}),e.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"Use $PORT as a placeholder for the dynamic port number"})]})]},t))}):e.jsx("p",{className:"text-sm text-gray-600 italic",children:"No web applications configured"})]}),x==="paths-to-ignore"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Paths To Ignore"}),e.jsx("input",{type:"text",id:"pathsToIgnore",name:"pathsToIgnore",value:f,onChange:s=>A(s.target.value),placeholder:"e.g., __tests__, \\.test\\.ts$, ^background (no quotes needed)",className:"w-full px-3 py-3 border border-gray-300 rounded text-sm font-mono focus:outline-none focus:border-[#005C75] focus:ring-2 focus:ring-[#005C75]/10"}),e.jsxs("p",{className:"mt-2 text-sm text-gray-600",children:["Comma-separated list of regex patterns for paths to ignore during file watching. Examples:"," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"__tests__"}),","," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"\\.test\\.tsx?$"}),","," ",e.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"^background"}),e.jsx("br",{}),e.jsx("span",{className:"text-xs text-gray-500 mt-1 inline-block",children:"Note: Files matching patterns in .gitignore are also automatically ignored"})]})]}),x==="universal-mocks"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Universal Mocks"}),e.jsx("p",{className:"mb-3 text-sm text-gray-600",children:"Mock functions that will be applied across all entity simulations"}),l.length===0?e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"text-sm text-gray-500 mb-3",children:"No universal mocks configured"}),e.jsx("button",{type:"button",onClick:()=>b(!0),className:"px-4 py-2 bg-[#005C75] text-white border-none rounded text-sm cursor-pointer hover:bg-[#004a5d]",children:"Add Mock"})]}):e.jsx("div",{className:"space-y-3",children:l.map((s,t)=>e.jsx("div",{className:"p-4 bg-gray-50 rounded border border-gray-200",children:Y===t?e.jsx(D,{mock:s,onSave:d=>J(t,d),onCancel:()=>C(null)}):e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex justify-between items-start mb-2",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"font-medium text-gray-800 mb-1",children:s.entityName}),e.jsx("div",{className:"text-sm text-gray-600 mb-2",children:s.filePath}),e.jsx("pre",{className:"text-xs bg-white p-2 rounded border border-gray-200 overflow-x-auto",children:s.content})]}),e.jsxs("div",{className:"flex gap-2 ml-3",children:[e.jsx("button",{type:"button",onClick:()=>C(t),className:"px-3 py-1 bg-teal-600 text-white border-none rounded text-sm cursor-pointer hover:bg-teal-700",children:"Edit"}),e.jsx("button",{type:"button",onClick:()=>Q(t),className:"px-3 py-1 bg-red-600 text-white border-none rounded text-sm cursor-pointer hover:bg-red-700",children:"Delete"})]})]})})},t))}),l.length>0&&e.jsx("button",{type:"button",onClick:()=>b(!0),className:"mt-4 px-4 py-2 bg-[#005C75] text-white border-none rounded text-sm cursor-pointer hover:bg-[#004a5d]",children:"Add Mock"})]}),x==="current-configuration"&&e.jsxs("div",{className:"space-y-6",children:[a&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Current Configuration"}),e.jsx("div",{className:"p-4 bg-white border border-gray-200 rounded mb-6",children:e.jsxs("div",{className:"space-y-2 text-sm",children:[a.projectSlug&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Project Slug:"})," ",e.jsx("span",{className:"text-gray-900",children:a.projectSlug})]}),a.packageManager&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Package Manager:"})," ",e.jsx("span",{className:"text-gray-900",children:a.packageManager})]})]})}),a.webapps&&a.webapps.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-gray-800 mb-3",children:"Web Applications"}),e.jsx("div",{className:"space-y-3",children:a.webapps.map((s,t)=>e.jsx("div",{className:"p-4 bg-white border border-gray-200 rounded",children:e.jsxs("div",{className:"space-y-2 text-sm",children:[e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Path:"})," ",e.jsx("span",{className:"text-gray-900",children:s.path==="."?"Root":s.path})]}),s.appDirectory&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"App Directory:"})," ",e.jsx("span",{className:"text-gray-900",children:s.appDirectory})]}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Framework:"})," ",e.jsx("span",{className:"text-gray-900",children:s.framework})]}),s.startCommand&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Start Command:"})," ",e.jsx("span",{className:"text-gray-900 font-mono text-xs",children:R(s.startCommand)})]})]})},t))})]})]}),i&&e.jsxs("div",{className:"mt-6",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-800 mb-3",children:"Version Information"}),e.jsx("div",{className:"p-4 bg-white border border-gray-200 rounded",children:e.jsxs("div",{className:"space-y-2 text-sm",children:[i.webserverVersion&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Webserver:"})," ",e.jsx("span",{className:"text-gray-900 font-mono",children:i.webserverVersion.version||"unknown"})]}),i.templateVersion&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Analyzer Template:"})," ",e.jsx("span",{className:"font-mono text-gray-900",children:i.templateVersion.version||i.templateVersion.gitCommit?.slice(0,7)||"unknown"}),i.templateVersion.buildTimestamp&&e.jsxs("span",{className:"text-gray-500 ml-2",children:["(built"," ",ne(i.templateVersion.buildTimestamp),")"]})]}),i.cachedAnalyzerVersion&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Cached Analyzer:"})," ",e.jsx("span",{className:"font-mono text-gray-900",children:i.cachedAnalyzerVersion.version||i.cachedAnalyzerVersion.gitCommit?.slice(0,7)||"unknown"}),i.isCacheStale?e.jsx("span",{className:"ml-2 px-2 py-0.5 bg-amber-100 text-amber-800 rounded text-xs",children:"Stale - will update on next analysis"}):e.jsx("span",{className:"ml-2 px-2 py-0.5 bg-green-100 text-green-800 rounded text-xs",children:"Up to date"})]}),!i.cachedAnalyzerVersion&&a?.projectSlug&&e.jsxs("div",{children:[e.jsx("span",{className:"font-medium text-gray-700",children:"Cached Analyzer:"})," ",e.jsx("span",{className:"text-gray-500 italic",children:"Not initialized - will be created on first analysis"})]})]})})]})]})]})})]}),(K||M||m?.error||n.data&&typeof n.data=="object"&&"error"in n.data)&&e.jsxs("div",{className:"mt-6 max-w-5xl mx-auto space-y-3",children:[K&&e.jsx("div",{className:"text-emerald-600 text-sm font-medium bg-emerald-50 border border-emerald-200 rounded px-4 py-2",children:"Settings saved successfully!"}),M&&e.jsxs("div",{className:"text-amber-700 text-sm font-medium bg-amber-50 border border-amber-200 rounded px-4 py-2",children:[e.jsx("div",{children:"⚠️ Settings changed. Please restart CodeYam for changes to take effect:"}),e.jsx("code",{className:"ml-2 bg-amber-100 px-2 py-1 rounded text-xs",children:"codeyam stop && codeyam"})]}),m?.error&&e.jsx("div",{className:"text-red-600 text-sm font-medium bg-red-50 border border-red-200 rounded px-4 py-2",children:m.error}),(()=>{if(n.data&&typeof n.data=="object"&&"error"in n.data){const s=n.data;return typeof s.error=="string"?e.jsx("div",{className:"text-red-600 text-sm font-medium bg-red-50 border border-red-200 rounded px-4 py-2",children:s.error}):null}return null})()]}),H&&e.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center p-4 z-50",children:e.jsxs("div",{className:"bg-white rounded-lg max-w-2xl w-full p-6",children:[e.jsx("h2",{className:"text-2xl font-bold mb-4 text-gray-900",children:"Add Universal Mock"}),e.jsx(D,{mock:{entityName:"",filePath:"",content:""},onSave:W,onCancel:()=>b(!1)})]})})]})})});export{de as default,le as meta};
@@ -1 +1 @@
1
- import{w as T,u as S,r as c,j as e,a as C,L as j,b as k}from"./chunk-WWGJGFF6-CgXbbZRx.js";import{u as z}from"./useReportContext-CANr3QJ5.js";import{S as L}from"./SafeScreenshot-BrMAP1nP.js";import{I as A,E as v}from"./EntityTypeIcon-Catz6XEN.js";import{g as E,a as P,f as I}from"./fileTableUtils-CmO-EZAB.js";import{C as D}from"./chevron-down-DwYjrK_h.js";import{S as M}from"./search-DY8yoDpH.js";import{L as B}from"./loader-circle-D_EGChhq.js";import"./createLucideIcon-BBYuR56H.js";const J=()=>[{title:"Simulations - CodeYam"},{name:"description",content:"A visual gallery of your recently captured component screenshots"}],K=T(function(){const r=S(),o=r.entities,x=r.queueState;z({source:"simulations-page"});const[a,y]=c.useState(""),[d,m]=c.useState("visual"),l=c.useMemo(()=>{const t=[];return o.forEach(n=>{const i=n.analyses?.[0];if(i?.scenarios){const f=i.scenarios.filter(h=>h.metadata?.screenshotPaths?.[0]).map(h=>({scenarioName:h.name,scenarioDescription:h.description||"",screenshotPath:h.metadata?.screenshotPaths?.[0]||"",scenarioId:h.id}));f.length>0&&t.push({entity:n,screenshots:f,createdAt:i.createdAt||""})}}),t.sort((n,i)=>new Date(i.createdAt).getTime()-new Date(n.createdAt).getTime()),t},[o]),p=c.useMemo(()=>o.filter(t=>!t.analyses?.[0]?.scenarios?.some(f=>f.metadata?.screenshotPaths?.[0])),[o]),g=c.useMemo(()=>l.filter(({entity:t})=>{const n=!a||t.name.toLowerCase().includes(a.toLowerCase()),i=d==="all"||t.entityType===d;return n&&i}),[l,a,d]),b=c.useMemo(()=>p.filter(t=>{const n=!a||t.name.toLowerCase().includes(a.toLowerCase()),i=d==="all"||t.entityType===d;return n&&i}),[p,a,d]),N=c.useCallback(t=>{y(t.target.value)},[]),w=c.useCallback(t=>{m(t.target.value)},[]),u=l.length>0;return e.jsx("div",{className:"bg-[#f9f9f9] min-h-screen overflow-y-auto",children:e.jsxs("div",{className:"px-12 py-6",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"text-3xl font-bold text-gray-900 m-0",children:"Simulations"}),e.jsx("p",{className:"text-sm text-gray-600 mt-2",children:"A visual gallery of your recently captured simulations."})]}),!u&&e.jsxs("div",{className:"rounded-lg mb-6 flex items-center",style:{backgroundColor:"#cbf3fa",paddingLeft:"17px",paddingRight:"17px",paddingTop:"24px",paddingBottom:"24px",gap:"15px"},children:[e.jsx("div",{className:"shrink-0 flex items-center justify-center",style:{width:"33px",height:"33px"},children:e.jsx(A,{className:"w-8 h-8",style:{color:"#005c75"}})}),e.jsxs("div",{children:[e.jsx("p",{className:"m-0 mb-0",style:{color:"#005c75",fontSize:"14px",lineHeight:"18px",fontWeight:400},children:"This page will display a visual gallery of your recently captured component simulations."}),e.jsx("p",{className:"m-0",style:{color:"#005c75",fontSize:"18px",lineHeight:"26px",fontWeight:600},children:"Start by analyzing your first component below."})]})]}),e.jsxs("div",{className:"bg-white border-b border-gray-200 rounded-t-lg px-5 py-4 mb-6",children:[e.jsx("div",{className:"text-[11px] text-gray-500 mb-2 uppercase",children:"Filters"}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsxs("select",{className:"appearance-none bg-gray-50 border border-gray-200 rounded px-3 py-2 pr-8 text-sm cursor-pointer focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] hover:border-gray-300 transition-colors",value:d,onChange:w,children:[e.jsx("option",{value:"all",children:"All Types"}),e.jsx("option",{value:"visual",children:"Visual"}),e.jsx("option",{value:"library",children:"Library"})]}),e.jsx(D,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500 pointer-events-none"})]}),e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(M,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx("input",{type:"text",placeholder:"Search component",className:"w-full bg-gray-50 border border-gray-200 rounded pl-9 pr-3 py-2 text-sm placeholder:text-gray-400 focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] transition-colors",value:a,onChange:N})]})]})]}),u&&g.length>0&&e.jsx("div",{className:"bg-[#efefef] rounded-lg mb-2 text-[11px] font-normal leading-[16px] text-[#3e3e3e] uppercase",children:e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-2",children:[e.jsx("span",{children:"ENTITY"}),e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-[#3e3e3e]",children:e.jsx("path",{d:"M3 5L6 8L9 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})}),e.jsxs("div",{className:"flex flex-col gap-3",children:[u&&(g.length===0?e.jsx("div",{className:"bg-white border border-gray-200 rounded-lg p-8 text-center text-gray-500",children:"No simulations match your filters."}):e.jsx(e.Fragment,{children:g.map(({entity:t,screenshots:n})=>e.jsx(F,{entity:t,screenshots:n,queueJobs:x?.jobs||[]},t.sha))})),!u&&(b.length===0?e.jsx("div",{className:"bg-white border border-gray-200 rounded-b-lg p-8 text-center text-gray-500",children:"No components found matching your filters."}):b.map(t=>e.jsx(R,{entity:t},t.sha)))]})]})})});function F({entity:s,screenshots:r,queueJobs:o}){const x=C(),a=r.length||(s.analyses?.[0]?.scenarios?.length??0),y=l=>{x(`/entity/${s.sha}/scenarios/${l}?from=simulations`)},d=E(s,o),m=P(d);return e.jsx("div",{className:"bg-white rounded hover:bg-gray-50 transition-colors",children:e.jsxs("div",{className:"px-5 pb-[15px]",children:[e.jsxs("div",{className:"flex items-center justify-between py-[10px]",children:[e.jsxs(j,{to:`/entity/${s.sha}`,className:"flex items-center gap-2 no-underline",children:[e.jsx(v,{type:s.entityType}),e.jsxs("span",{className:"font-['IBM_Plex_Sans'] font-medium text-[12px] leading-[15px] text-[#343434]",children:[s.name," (",a,")"]})]}),e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsxs("span",{className:"px-2 rounded inline-flex items-center gap-1.5 max-w-full whitespace-nowrap overflow-hidden",style:{backgroundColor:m.bgColor,color:m.textColor,height:"23px",fontSize:"10px",lineHeight:"15px"},children:[m.icon,m.text]}),e.jsx("button",{onClick:()=>{x(`/entity/${s.sha}/logs`)},className:"bg-[#e0e9ec] text-[#005c75] rounded font-['IBM_Plex_Sans'] font-semibold hover:bg-[#d0dfe5] transition-colors px-[10px] py-0 cursor-pointer border-none",style:{fontSize:"10px",lineHeight:"22px"},children:"View Logs"})]})]}),e.jsx("div",{className:"flex gap-2.5 overflow-x-auto pb-1",children:r.length>0?r.map(l=>e.jsx("button",{onClick:()=>y(l.scenarioId||""),className:"shrink-0 block cursor-pointer bg-transparent border-none p-0",children:e.jsx("div",{className:"w-36 h-24 rounded-md border border-gray-200 overflow-hidden bg-gray-100 flex items-center justify-center transition-all",style:{"--hover-border":"#005C75"},onMouseEnter:p=>{p.currentTarget.style.borderColor="#005C75",p.currentTarget.style.boxShadow="0 4px 12px rgba(0, 92, 117, 0.15)"},onMouseLeave:p=>{p.currentTarget.style.borderColor="#d1d5db",p.currentTarget.style.boxShadow="none"},children:e.jsx(L,{screenshotPath:l.screenshotPath,alt:l.scenarioName,className:"max-w-full max-h-full object-contain"})})},l.scenarioId)):e.jsx("div",{className:"text-xs text-gray-400 py-4",children:"No screenshots available"})})]})})}function R({entity:s}){const r=k(),[o,x]=c.useState(!1),a=()=>{x(!0),r.submit({entitySha:s.sha,filePath:s.filePath||""},{method:"post",action:"/api/analyze"})};return c.useEffect(()=>{r.state==="idle"&&o&&x(!1)},[r.state,o]),e.jsx("div",{className:"bg-white rounded hover:bg-gray-100 transition-colors cursor-pointer",onClick:a,children:e.jsxs("div",{className:"px-5 py-4 flex items-center",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx(v,{type:s.entityType}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-0.5",children:[e.jsx(j,{to:`/entity/${s.sha}`,className:"text-sm font-medium text-gray-900 no-underline",children:s.name}),e.jsx("span",{className:"text-[10px] font-semibold px-1 py-0.5 rounded",style:{color:s.entityType==="visual"?"#7c3aed":s.entityType==="library"?"#0DBFE9":s.entityType==="type"?"#dc2626":s.entityType==="data"?"#2563eb":s.entityType==="index"?"#ea580c":s.entityType==="functionCall"?"#7c3aed":s.entityType==="class"?"#059669":s.entityType==="method"?"#0891b2":"#6b7280",backgroundColor:s.entityType==="visual"?"#f3e8ff":s.entityType==="library"?"#cffafe":s.entityType==="type"?"#fee2e2":s.entityType==="data"?"#dbeafe":s.entityType==="index"?"#ffedd5":s.entityType==="functionCall"?"#f3e8ff":s.entityType==="class"?"#d1fae5":s.entityType==="method"?"#cffafe":"#f3f4f6"},children:s.entityType?s.entityType.toUpperCase():"UNKNOWN"})]}),e.jsx("div",{className:"text-xs text-gray-400 truncate",children:s.filePath})]})]}),e.jsx("div",{className:"w-32 flex justify-center",children:e.jsx("span",{className:"text-[10px] text-gray-500 bg-gray-100 px-2 py-1 rounded",children:"Not analyzed"})}),e.jsx("div",{className:"w-32 text-center text-[10px] text-gray-500",children:I(s.createdAt||null)}),e.jsx("div",{className:"w-24 flex justify-end",children:o||r.state!=="idle"?e.jsxs("div",{className:"px-2 py-1 bg-pink-100 rounded text-xs text-pink-700 font-semibold flex items-center gap-1.5",children:[e.jsx(B,{size:14,className:"animate-spin"}),"Analyzing..."]}):e.jsx("button",{onClick:a,className:"bg-[#e0e9ec] text-[#005c75] px-4 py-1.5 rounded text-xs font-medium hover:bg-[#d0dde1] transition-colors cursor-pointer",children:"Analyze"})})]})})}export{K as default,J as meta};
1
+ import{w as T,u as S,r as c,j as e,a as C,L as j,b as k}from"./chunk-WWGJGFF6-Bex4RrGs.js";import{u as z}from"./useReportContext-BWmSRPH6.js";import{S as L}from"./SafeScreenshot-7UkVL-UI.js";import{I as A,E as v}from"./EntityTypeIcon-D2hFeDeg.js";import{g as E,a as P,f as I}from"./fileTableUtils-CUeAIQNI.js";import{C as D}from"./chevron-down-BBNQ8hup.js";import{S as M}from"./search-DvK9iMBu.js";import{L as B}from"./loader-circle-COYCR2oZ.js";import"./createLucideIcon-DkgmwwRC.js";const J=()=>[{title:"Simulations - CodeYam"},{name:"description",content:"A visual gallery of your recently captured component screenshots"}],K=T(function(){const r=S(),o=r.entities,x=r.queueState;z({source:"simulations-page"});const[a,y]=c.useState(""),[d,m]=c.useState("visual"),l=c.useMemo(()=>{const t=[];return o.forEach(n=>{const i=n.analyses?.[0];if(i?.scenarios){const f=i.scenarios.filter(h=>h.metadata?.screenshotPaths?.[0]).map(h=>({scenarioName:h.name,scenarioDescription:h.description||"",screenshotPath:h.metadata?.screenshotPaths?.[0]||"",scenarioId:h.id}));f.length>0&&t.push({entity:n,screenshots:f,createdAt:i.createdAt||""})}}),t.sort((n,i)=>new Date(i.createdAt).getTime()-new Date(n.createdAt).getTime()),t},[o]),p=c.useMemo(()=>o.filter(t=>!t.analyses?.[0]?.scenarios?.some(f=>f.metadata?.screenshotPaths?.[0])),[o]),g=c.useMemo(()=>l.filter(({entity:t})=>{const n=!a||t.name.toLowerCase().includes(a.toLowerCase()),i=d==="all"||t.entityType===d;return n&&i}),[l,a,d]),b=c.useMemo(()=>p.filter(t=>{const n=!a||t.name.toLowerCase().includes(a.toLowerCase()),i=d==="all"||t.entityType===d;return n&&i}),[p,a,d]),N=c.useCallback(t=>{y(t.target.value)},[]),w=c.useCallback(t=>{m(t.target.value)},[]),u=l.length>0;return e.jsx("div",{className:"bg-[#f9f9f9] min-h-screen overflow-y-auto",children:e.jsxs("div",{className:"px-12 py-6",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"text-3xl font-bold text-gray-900 m-0",children:"Simulations"}),e.jsx("p",{className:"text-sm text-gray-600 mt-2",children:"A visual gallery of your recently captured simulations."})]}),!u&&e.jsxs("div",{className:"rounded-lg mb-6 flex items-center",style:{backgroundColor:"#cbf3fa",paddingLeft:"17px",paddingRight:"17px",paddingTop:"24px",paddingBottom:"24px",gap:"15px"},children:[e.jsx("div",{className:"shrink-0 flex items-center justify-center",style:{width:"33px",height:"33px"},children:e.jsx(A,{className:"w-8 h-8",style:{color:"#005c75"}})}),e.jsxs("div",{children:[e.jsx("p",{className:"m-0 mb-0",style:{color:"#005c75",fontSize:"14px",lineHeight:"18px",fontWeight:400},children:"This page will display a visual gallery of your recently captured component simulations."}),e.jsx("p",{className:"m-0",style:{color:"#005c75",fontSize:"18px",lineHeight:"26px",fontWeight:600},children:"Start by analyzing your first component below."})]})]}),e.jsxs("div",{className:"bg-white border-b border-gray-200 rounded-t-lg px-5 py-4 mb-6",children:[e.jsx("div",{className:"text-[11px] text-gray-500 mb-2 uppercase",children:"Filters"}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsxs("select",{className:"appearance-none bg-gray-50 border border-gray-200 rounded px-3 py-2 pr-8 text-sm cursor-pointer focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] hover:border-gray-300 transition-colors",value:d,onChange:w,children:[e.jsx("option",{value:"all",children:"All Types"}),e.jsx("option",{value:"visual",children:"Visual"}),e.jsx("option",{value:"library",children:"Library"})]}),e.jsx(D,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-500 pointer-events-none"})]}),e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(M,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx("input",{type:"text",placeholder:"Search component",className:"w-full bg-gray-50 border border-gray-200 rounded pl-9 pr-3 py-2 text-sm placeholder:text-gray-400 focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] transition-colors",value:a,onChange:N})]})]})]}),u&&g.length>0&&e.jsx("div",{className:"bg-[#efefef] rounded-lg mb-2 text-[11px] font-normal leading-[16px] text-[#3e3e3e] uppercase",children:e.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-2",children:[e.jsx("span",{children:"ENTITY"}),e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-[#3e3e3e]",children:e.jsx("path",{d:"M3 5L6 8L9 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})}),e.jsxs("div",{className:"flex flex-col gap-3",children:[u&&(g.length===0?e.jsx("div",{className:"bg-white border border-gray-200 rounded-lg p-8 text-center text-gray-500",children:"No simulations match your filters."}):e.jsx(e.Fragment,{children:g.map(({entity:t,screenshots:n})=>e.jsx(F,{entity:t,screenshots:n,queueJobs:x?.jobs||[]},t.sha))})),!u&&(b.length===0?e.jsx("div",{className:"bg-white border border-gray-200 rounded-b-lg p-8 text-center text-gray-500",children:"No components found matching your filters."}):b.map(t=>e.jsx(R,{entity:t},t.sha)))]})]})})});function F({entity:s,screenshots:r,queueJobs:o}){const x=C(),a=r.length||(s.analyses?.[0]?.scenarios?.length??0),y=l=>{x(`/entity/${s.sha}/scenarios/${l}?from=simulations`)},d=E(s,o),m=P(d);return e.jsx("div",{className:"bg-white rounded hover:bg-gray-50 transition-colors",children:e.jsxs("div",{className:"px-5 pb-[15px]",children:[e.jsxs("div",{className:"flex items-center justify-between py-[10px]",children:[e.jsxs(j,{to:`/entity/${s.sha}`,className:"flex items-center gap-2 no-underline",children:[e.jsx(v,{type:s.entityType}),e.jsxs("span",{className:"font-['IBM_Plex_Sans'] font-medium text-[12px] leading-[15px] text-[#343434]",children:[s.name," (",a,")"]})]}),e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsxs("span",{className:"px-2 rounded inline-flex items-center gap-1.5 max-w-full whitespace-nowrap overflow-hidden",style:{backgroundColor:m.bgColor,color:m.textColor,height:"23px",fontSize:"10px",lineHeight:"15px"},children:[m.icon,m.text]}),e.jsx("button",{onClick:()=>{x(`/entity/${s.sha}/logs`)},className:"bg-[#e0e9ec] text-[#005c75] rounded font-['IBM_Plex_Sans'] font-semibold hover:bg-[#d0dfe5] transition-colors px-[10px] py-0 cursor-pointer border-none",style:{fontSize:"10px",lineHeight:"22px"},children:"View Logs"})]})]}),e.jsx("div",{className:"flex gap-2.5 overflow-x-auto pb-1",children:r.length>0?r.map(l=>e.jsx("button",{onClick:()=>y(l.scenarioId||""),className:"shrink-0 block cursor-pointer bg-transparent border-none p-0",children:e.jsx("div",{className:"w-36 h-24 rounded-md border border-gray-200 overflow-hidden bg-gray-100 flex items-center justify-center transition-all",style:{"--hover-border":"#005C75"},onMouseEnter:p=>{p.currentTarget.style.borderColor="#005C75",p.currentTarget.style.boxShadow="0 4px 12px rgba(0, 92, 117, 0.15)"},onMouseLeave:p=>{p.currentTarget.style.borderColor="#d1d5db",p.currentTarget.style.boxShadow="none"},children:e.jsx(L,{screenshotPath:l.screenshotPath,alt:l.scenarioName,className:"max-w-full max-h-full object-contain"})})},l.scenarioId)):e.jsx("div",{className:"text-xs text-gray-400 py-4",children:"No screenshots available"})})]})})}function R({entity:s}){const r=k(),[o,x]=c.useState(!1),a=()=>{x(!0),r.submit({entitySha:s.sha,filePath:s.filePath||""},{method:"post",action:"/api/analyze"})};return c.useEffect(()=>{r.state==="idle"&&o&&x(!1)},[r.state,o]),e.jsx("div",{className:"bg-white rounded hover:bg-gray-100 transition-colors cursor-pointer",onClick:a,children:e.jsxs("div",{className:"px-5 py-4 flex items-center",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx(v,{type:s.entityType}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-0.5",children:[e.jsx(j,{to:`/entity/${s.sha}`,className:"text-sm font-medium text-gray-900 no-underline",children:s.name}),e.jsx("span",{className:"text-[10px] font-semibold px-1 py-0.5 rounded",style:{color:s.entityType==="visual"?"#7c3aed":s.entityType==="library"?"#0DBFE9":s.entityType==="type"?"#dc2626":s.entityType==="data"?"#2563eb":s.entityType==="index"?"#ea580c":s.entityType==="functionCall"?"#7c3aed":s.entityType==="class"?"#059669":s.entityType==="method"?"#0891b2":"#6b7280",backgroundColor:s.entityType==="visual"?"#f3e8ff":s.entityType==="library"?"#cffafe":s.entityType==="type"?"#fee2e2":s.entityType==="data"?"#dbeafe":s.entityType==="index"?"#ffedd5":s.entityType==="functionCall"?"#f3e8ff":s.entityType==="class"?"#d1fae5":s.entityType==="method"?"#cffafe":"#f3f4f6"},children:s.entityType?s.entityType.toUpperCase():"UNKNOWN"})]}),e.jsx("div",{className:"text-xs text-gray-400 truncate",children:s.filePath})]})]}),e.jsx("div",{className:"w-32 flex justify-center",children:e.jsx("span",{className:"text-[10px] text-gray-500 bg-gray-100 px-2 py-1 rounded",children:"Not analyzed"})}),e.jsx("div",{className:"w-32 text-center text-[10px] text-gray-500",children:I(s.createdAt||null)}),e.jsx("div",{className:"w-24 flex justify-end",children:o||r.state!=="idle"?e.jsxs("div",{className:"px-2 py-1 bg-pink-100 rounded text-xs text-pink-700 font-semibold flex items-center gap-1.5",children:[e.jsx(B,{size:14,className:"animate-spin"}),"Analyzing..."]}):e.jsx("button",{onClick:a,className:"bg-[#e0e9ec] text-[#005c75] px-4 py-1.5 rounded text-xs font-medium hover:bg-[#d0dde1] transition-colors cursor-pointer",children:"Analyze"})})]})})}export{K as default,J as meta};
@@ -1 +1 @@
1
- import{c as e}from"./createLucideIcon-BBYuR56H.js";const a=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],o=e("triangle-alert",a);export{o as T};
1
+ import{c as e}from"./createLucideIcon-DkgmwwRC.js";const a=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],o=e("triangle-alert",a);export{o as T};
@@ -1,2 +1,2 @@
1
- import{r as t}from"./chunk-WWGJGFF6-CgXbbZRx.js";function I(c,s){const[E,l]=t.useState(""),[d,n]=t.useState(!1),[g,a]=t.useState(null),[$,r]=t.useState(!1);t.useEffect(()=>{s&&(r(!1),n(!1),a(null))},[s]),t.useEffect(()=>{if(!c||!s){s||l("");return}const u=async()=>{try{const i=await fetch(`/api/logs/${c}`);if(i.ok){const o=(await i.text()).trim().split(`
1
+ import{r as t}from"./chunk-WWGJGFF6-Bex4RrGs.js";function I(c,s){const[E,l]=t.useState(""),[d,n]=t.useState(!1),[g,a]=t.useState(null),[$,r]=t.useState(!1);t.useEffect(()=>{s&&(r(!1),n(!1),a(null))},[s]),t.useEffect(()=>{if(!c||!s){s||l("");return}const u=async()=>{try{const i=await fetch(`/api/logs/${c}`);if(i.ok){const o=(await i.text()).trim().split(`
2
2
  `).filter(e=>e.length>0);if(o.length<3){n(!1),r(!1),a(null),l("");return}const f=o.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 L=o.find(e=>e.includes("$$INTERACTIVE_SERVER_URL$$:"));if(L){const e=L.split("$$INTERACTIVE_SERVER_URL$$:")[1].trim();a(e),r(!0)}o.some(e=>e.includes("CodeYam: Exiting start.js"))&&n(!0)}}catch{}};u().catch(()=>{});const m=setInterval(()=>{u().catch(()=>{})},2e3);return()=>clearInterval(m)},[c,s]);const h=t.useCallback(()=>{l(""),n(!1),a(null),r(!1)},[]);return{lastLine:E,interactiveUrl:g,isCompleted:d,resetLogs:h}}export{I as u};
@@ -1 +1 @@
1
- import{r as e,j as x,e as i}from"./chunk-WWGJGFF6-CgXbbZRx.js";const r={source:"navbar"},a=e.createContext(void 0);function l({children:t}){const[n,o]=e.useState(r),s=e.useCallback(u=>{o(u)},[]),c=e.useCallback(()=>{o(r)},[]);return x.jsx(a.Provider,{value:{contextData:n,setContextData:s,resetContextData:c},children:t})}function f(t){const n=e.useContext(a),o=e.useRef(n);e.useEffect(()=>{if(o.current)return o.current.setContextData(t),()=>{o.current?.resetContextData()}},[t.source,t.entitySha,t.scenarioId,t.analysisId])}function D(){const t=e.useContext(a),n=i();return t?{source:t.contextData.source,entitySha:t.contextData.entitySha,scenarioId:t.contextData.scenarioId,analysisId:t.contextData.analysisId,currentUrl:n.pathname}:{source:"navbar",currentUrl:n.pathname}}export{l as R,D as a,f as u};
1
+ import{r as e,j as x,e as i}from"./chunk-WWGJGFF6-Bex4RrGs.js";const r={source:"navbar"},a=e.createContext(void 0);function l({children:t}){const[n,o]=e.useState(r),s=e.useCallback(u=>{o(u)},[]),c=e.useCallback(()=>{o(r)},[]);return x.jsx(a.Provider,{value:{contextData:n,setContextData:s,resetContextData:c},children:t})}function f(t){const n=e.useContext(a),o=e.useRef(n);e.useEffect(()=>{if(o.current)return o.current.setContextData(t),()=>{o.current?.resetContextData()}},[t.source,t.entitySha,t.scenarioId,t.analysisId])}function D(){const t=e.useContext(a),n=i();return t?{source:t.contextData.source,entitySha:t.contextData.entitySha,scenarioId:t.contextData.scenarioId,analysisId:t.contextData.analysisId,currentUrl:n.pathname}:{source:"navbar",currentUrl:n.pathname}}export{l as R,D as a,f as u};
@@ -1 +1 @@
1
- import{r as t,j as T}from"./chunk-WWGJGFF6-CgXbbZRx.js";const n=t.createContext(void 0);function m({children:o}){const[i,r]=t.useState([]),c=t.useCallback((s,e="info",a=5e3)=>{const d={id:`toast-${Date.now()}-${Math.random()}`,message:s,type:e,duration:a};r(x=>[...x,d])},[]),u=t.useCallback(s=>{r(e=>e.filter(a=>a.id!==s))},[]);return T.jsx(n.Provider,{value:{toasts:i,showToast:c,closeToast:u},children:o})}function v(){const o=t.useContext(n);if(!o)throw new Error("useToast must be used within a ToastProvider");return o}export{m as T,v as u};
1
+ import{r as t,j as T}from"./chunk-WWGJGFF6-Bex4RrGs.js";const n=t.createContext(void 0);function m({children:o}){const[i,r]=t.useState([]),c=t.useCallback((s,e="info",a=5e3)=>{const d={id:`toast-${Date.now()}-${Math.random()}`,message:s,type:e,duration:a};r(x=>[...x,d])},[]),u=t.useCallback(s=>{r(e=>e.filter(a=>a.id!==s))},[]);return T.jsx(n.Provider,{value:{toasts:i,showToast:c,closeToast:u},children:o})}function v(){const o=t.useContext(n);if(!o)throw new Error("useToast must be used within a ToastProvider");return o}export{m as T,v as u};
@@ -1 +1 @@
1
- import"fetch-retry";import{G as Q,H as R,I as V,J as W,K as X,L as Y,P as Z,S as _,d as $,a as aa,b as sa,c as ta,e as oa,f as ia,g as ra,h as ma,i as ea,j as pa,k as la,C as na,F as da,E as ba,D as ua,l as ca,m as Ta,n as Ca,o as ha,p as ya,q as Ba,r as Sa,s as Aa,t as ga,u as Ea,v as Fa,w as Pa,x as ja,y as Da,z as Ma,A as fa,B as qa}from"./server-build-N2cTnejq.js";import"typescript";import"kysely";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/helpers/sqlite";import"kysely/helpers/postgres";import"fs/promises";import"os";import"prompts";import"chalk";import"crypto";import"child_process";import"util";import"dotenv";import"events";import"uuid";import"url";import"react-resizable";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"react-syntax-highlighter";import"react-syntax-highlighter/dist/cjs/styles/prism/index.js";import"node:crypto";import"v8";import"react-diff-viewer-continued";export{Q as AnalysisBranchesTableColumns,R as BranchesTableColumns,V as CommitsTableColumns,W as EntitiesTableColumns,X as EntityBranchesTableColumns,Y as FilesTableColumns,Z as ProjectsTableColumns,_ as ScenariosTableColumns,$ as dbToAnalysis,aa as dbToAnalysisBranch,sa as dbToBranch,ta as dbToCommit,oa as dbToEntity,ia as dbToFile,ra as dbToProject,ma as dbToScenario,ea as dbToUserScenario,pa as deleteScenarios,la as generateSha,na as getDatabase,da as getJsonHelper,ba as getPostgreDatabase,ua as getSqliteDatabase,ca as loadAnalyses,Ta as loadAnalysis,Ca as loadBranches,ha as loadCommitBranches,ya as loadCommits,Ba as loadEntities,Sa as loadEntity,Aa as loadFiles,ga as loadProject,Ea as updateCommitMetadata,Fa as updateFreshAnalysisMetadata,Pa as updateFreshAnalysisStatus,ja as updateProjectMetadata,Da as upsertCommitBranches,Ma as upsertCommits,fa as upsertGithubUser,qa as upsertScenarios};
1
+ import"fetch-retry";import{G as Q,H as R,I as V,J as W,K as X,L as Y,P as Z,S as _,d as $,a as aa,b as sa,c as ta,e as oa,f as ia,g as ra,h as ma,i as ea,j as pa,k as la,C as na,F as da,E as ba,D as ua,l as ca,m as Ta,n as Ca,o as ha,p as ya,q as Ba,r as Sa,s as Aa,t as ga,u as Ea,v as Fa,w as Pa,x as ja,y as Da,z as Ma,A as fa,B as qa}from"./server-build-BY_VDhiD.js";import"typescript";import"kysely";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/helpers/sqlite";import"kysely/helpers/postgres";import"fs/promises";import"os";import"prompts";import"chalk";import"crypto";import"child_process";import"util";import"dotenv";import"events";import"uuid";import"url";import"react-resizable";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"react-syntax-highlighter";import"react-syntax-highlighter/dist/cjs/styles/prism/index.js";import"node:crypto";import"v8";import"react-diff-viewer-continued";export{Q as AnalysisBranchesTableColumns,R as BranchesTableColumns,V as CommitsTableColumns,W as EntitiesTableColumns,X as EntityBranchesTableColumns,Y as FilesTableColumns,Z as ProjectsTableColumns,_ as ScenariosTableColumns,$ as dbToAnalysis,aa as dbToAnalysisBranch,sa as dbToBranch,ta as dbToCommit,oa as dbToEntity,ia as dbToFile,ra as dbToProject,ma as dbToScenario,ea as dbToUserScenario,pa as deleteScenarios,la as generateSha,na as getDatabase,da as getJsonHelper,ba as getPostgreDatabase,ua as getSqliteDatabase,ca as loadAnalyses,Ta as loadAnalysis,Ca as loadBranches,ha as loadCommitBranches,ya as loadCommits,Ba as loadEntities,Sa as loadEntity,Aa as loadFiles,ga as loadProject,Ea as updateCommitMetadata,Fa as updateFreshAnalysisMetadata,Pa as updateFreshAnalysisStatus,ja as updateProjectMetadata,Da as upsertCommitBranches,Ma as upsertCommits,fa as upsertGithubUser,qa as upsertScenarios};