@codeyam/codeyam-cli 0.1.0-staging.e090cb3 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analyzer-template/.build-info.json +7 -7
- package/analyzer-template/log.txt +3 -3
- package/analyzer-template/package.json +1 -1
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.ts +29 -18
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +50 -25
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +153 -76
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js +93 -2
- package/analyzer-template/packages/utils/dist/utils/src/lib/fs/rsyncCopy.js.map +1 -1
- package/analyzer-template/packages/utils/src/lib/fs/rsyncCopy.ts +108 -2
- package/analyzer-template/project/constructMockCode.ts +2 -2
- package/background/src/lib/virtualized/project/constructMockCode.js +2 -2
- package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
- package/codeyam-cli/src/commands/analyze.js +2 -2
- package/codeyam-cli/src/commands/analyze.js.map +1 -1
- package/codeyam-cli/src/commands/default.js +1 -1
- package/codeyam-cli/src/commands/default.js.map +1 -1
- package/codeyam-cli/src/commands/verify.js +2 -2
- package/codeyam-cli/src/commands/verify.js.map +1 -1
- package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js +179 -0
- package/codeyam-cli/src/utils/__tests__/npmVersionCheck.test.js.map +1 -0
- package/codeyam-cli/src/utils/backgroundServer.js +90 -23
- package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/utils/npmVersionCheck.js +76 -0
- package/codeyam-cli/src/utils/npmVersionCheck.js.map +1 -0
- package/codeyam-cli/src/webserver/__tests__/dependency-smoke.test.js +66 -0
- package/codeyam-cli/src/webserver/__tests__/dependency-smoke.test.js.map +1 -0
- package/codeyam-cli/src/webserver/app/lib/dbNotifier.js.map +1 -1
- package/codeyam-cli/src/webserver/backgroundServer.js +26 -0
- package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/webserver/bootstrap.js +11 -0
- package/codeyam-cli/src/webserver/bootstrap.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{CopyButton-CA3JxPb7.js → CopyButton-jNYXRRNI.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-B86KKU7e.js → EntityItem-bwuHPyTa.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-B5ctlSYt.js → EntityTypeBadge-CvzqMxcu.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-BqY8gDAW.js → EntityTypeIcon-BH0XDim7.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{InlineSpinner-ClaLpuOo.js → InlineSpinner-EhOseatT.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-BDhPilK7.js → InteractivePreview-yjIHlOGa.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-VeqEBv9v.js → LibraryFunctionPreview-Cq5o8jL4.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-Bs7Nn1Jr.js → LoadingDots-BvMu2i-g.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-Bm3PmcCz.js → LogViewer-kgBTLoJD.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-CgMEzchJ.js → ReportIssueModal-BzPgx-xO.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-Gq3Ocjo6.js → SafeScreenshot-CwZrv-Ok.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-CBui0id_.js → ScenarioViewer-BX2Ny2Qj.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-CiwXDxLh.js → TruncatedFilePath-CDpEprKa.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{_index-B3TDXxnk.js → _index-BRx8ZGZo.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-BtBFH820.js → activity.(_tab)-4S4yPfFw.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-DHKuQSmR.js +17 -0
- package/codeyam-cli/src/webserver/build/client/assets/{book-open-PttOB2SF.js → book-open-D4IPYH_y.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-TJp6ofnp.js → chevron-down-CG65viiV.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{chunk-JZWAC4HX-JE9ZIoBl.js → chunk-JZWAC4HX-DB3aFuEO.js} +9 -9
- package/codeyam-cli/src/webserver/build/client/assets/{circle-check-CXhHQYrI.js → circle-check-igfMr5DY.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{copy-6y9ALfGT.js → copy-Coc4o_8c.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-Ca9fAY46.js → createLucideIcon-D1zB-pYc.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{dev.empty-C0epRiVn.js → dev.empty-JTAjQ54M.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-BVnB8a9L.js → entity._sha._-B0h9AqE6.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.fullscreen-CBoafmVs.js → entity._sha.scenarios._scenarioId.fullscreen-DjLxr2JB.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-DGgZjdFg.js → entity._sha_.create-scenario-CtYowLOt.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-38yPijoD.js → entity._sha_.edit._scenarioId-PePWg17F.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-BSHEfydn.js → entry.client-I-Wo99C_.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-DCPhhSMo.js → fileTableUtils-9sMMAiWJ.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{files-0N0YJQv7.js → files-Co65J0s3.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{git-DXnyr8uP.js → git-BdHOxVfg.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/globals-CCgBKWy4.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{index-ChN9-fAY.js → index-CUM5iXwc.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-CcsFv748.js → index-_417gcQW.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{labs-BLJ7HxOC.js → labs-BK0C1H1T.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-CTqLEAGU.js → loader-circle-TzRHMVog.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{manifest-b171b9d3.js → manifest-390cb8fa.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{memory-CCQd4aZA.js → memory-CzZySbBE.js} +17 -17
- package/codeyam-cli/src/webserver/build/client/assets/{pause-D6vreykR.js → pause-hjzB7t2z.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-DnbDhvTU.js +62 -0
- package/codeyam-cli/src/webserver/build/client/assets/{search-B8VUL8nl.js → search-DcAwD_Ln.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{settings-BejnUJ6R.js → settings-CclxrcPK.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{simulations-CPoAg7Zo.js → simulations-DVNJVQgD.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{terminal-BrCP7uQo.js → terminal-DbEAHMbA.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-BZz2NjYa.js → triangle-alert-CAD5b1o_.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-DNwUduNu.js → useCustomSizes-BqgrAzs3.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-COky1GVF.js → useLastLogLine-DAFqfEDH.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-CpZgwliL.js → useReportContext-DZlYx2c4.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useToast-Bv9JFvUO.js → useToast-ihdMtlf6.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/{index-8Fv-lH1-.js → index-CxaRxKVt.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-D4DT0nM_.js +259 -0
- package/codeyam-cli/src/webserver/build/server/index.js +1 -1
- package/codeyam-cli/src/webserver/build-info.json +5 -5
- package/codeyam-cli/templates/codeyam-memory.md +5 -1
- package/codeyam-cli/templates/rules-instructions.md +1 -1
- package/package.json +8 -8
- package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js +24 -16
- package/packages/ai/src/lib/dataStructure/helpers/convertDotNotation.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +42 -13
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +123 -67
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
- package/packages/utils/src/lib/fs/rsyncCopy.js +93 -2
- package/packages/utils/src/lib/fs/rsyncCopy.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-CN61MOMa.js +0 -11
- package/codeyam-cli/src/webserver/build/client/assets/globals-CKT08Djd.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-CHhiHoo_.js +0 -62
- package/codeyam-cli/src/webserver/build/server/assets/server-build-Akn3iYFP.js +0 -257
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,j as o}from"./chunk-JZWAC4HX-
|
|
1
|
+
import{r as i,j as o}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{C as x,a as m}from"./copy-Coc4o_8c.js";function y({content:a,label:l="Copy",copiedLabel:p="✓ Copied!",className:c="",duration:t=2e3,ariaLabel:C,icon:n=!1,iconSize:s=14}){const[e,r]=i.useState(!1),d=i.useCallback(()=>{navigator.clipboard.writeText(a).then(()=>{r(!0),setTimeout(()=>r(!1),t)}).catch(u=>{console.error("Failed to copy:",u)})},[a,t]);return o.jsx("button",{onClick:d,className:`cursor-pointer ${c}`,disabled:e,"aria-label":C||(e?"Copied to clipboard":"Copy to clipboard"),"aria-live":"polite",children:n?e?o.jsx(x,{size:s,className:"text-green-500"}):o.jsx(m,{size:s}):e?p:l})}export{y as C};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as k}from"./createLucideIcon-
|
|
1
|
+
import{c as k}from"./createLucideIcon-D1zB-pYc.js";import{c as E,r as u,j as e,L as N}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{u as T}from"./useToast-ihdMtlf6.js";import{f as D,g as F}from"./fileTableUtils-9sMMAiWJ.js";import{T as P}from"./TruncatedFilePath-CDpEprKa.js";import{S as C}from"./SafeScreenshot-CwZrv-Ok.js";import{L as B}from"./LibraryFunctionPreview-Cq5o8jL4.js";import{T as I}from"./triangle-alert-CAD5b1o_.js";import{E as v}from"./EntityTypeIcon-BH0XDim7.js";import{E as L}from"./EntityTypeBadge-CvzqMxcu.js";/**
|
|
2
2
|
* @license lucide-react v0.556.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as o}from"./chunk-JZWAC4HX-
|
|
1
|
+
import{j as o}from"./chunk-JZWAC4HX-DB3aFuEO.js";const l={visual:{label:"VISUAL",bgColor:"#f9f9f9",textColor:"#9040f5"},library:{label:"LIBRARY",bgColor:"#f9f9f9",textColor:"#06b6d5"},type:{label:"TYPE",bgColor:"#ffe1e1",textColor:"#db2627"},other:{label:"OTHER",bgColor:"#f9f9f9",textColor:"#646464"}};function n({type:t,className:r=""}){const e=l[t]||l.other;return o.jsx("div",{className:`inline-flex items-center justify-center px-[4px] rounded-[4px] ${r}`,style:{backgroundColor:e.bgColor,color:e.textColor,height:"15px"},children:o.jsx("span",{className:"text-[10px] font-['IBM_Plex_Sans'] font-semibold leading-[15px] uppercase",children:e.label})})}export{n as E};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./chunk-JZWAC4HX-
|
|
1
|
+
import{j as e}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{c}from"./createLucideIcon-D1zB-pYc.js";/**
|
|
2
2
|
* @license lucide-react v0.556.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as _,r as e,j as h}from"./chunk-JZWAC4HX-
|
|
1
|
+
import{c as _,r as e,j as h}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{u as K}from"./useLastLogLine-DAFqfEDH.js";function U(s){const r=s.replace(/[^a-zA-Z0-9_]+/g,"_");return r.slice(0,1).toUpperCase()+r.slice(1)}function V({analysisId:s,scenarioId:r,scenarioName:a,projectSlug:i,enabled:g=!0,refreshTrigger:f=0}){const k=_(),[S,w]=e.useState(null),[A,E]=e.useState(!1),[B,c]=e.useState(!1),[q,l]=e.useState(!1),d=e.useRef(!1),x=e.useRef(null),I=e.useRef(null),[M,m]=e.useState(0),[z,R]=e.useState(0),n=e.useRef(null),u=e.useRef(!1),{interactiveUrl:b,resetLogs:L}=K(i,g),y=e.useRef(r),F=e.useRef(f);e.useEffect(()=>{F.current!==f&&(F.current=f,S&&(console.log("[useInteractiveMode] Manual refresh triggered"),c(!0),l(!1),m(0),R(t=>t+1),u.current=!1,n.current&&(clearTimeout(n.current),n.current=null)))},[f,S]),e.useEffect(()=>{if(y.current!==r&&(y.current=r,x.current&&I.current&&a)){const t=U(I.current),o=U(a),p=x.current.replace(t,o);w(p),c(!0),l(!1),m(0),R(v=>v+1),u.current=!1,n.current&&(clearTimeout(n.current),n.current=null);return}},[r,a]),e.useEffect(()=>{if(b){const t=b+"?width=600px";x.current=t,a&&(I.current=a),w(t),E(!1),c(!0)}},[b]),e.useEffect(()=>{const t=o=>{o.data.type==="codeyam-resize"&&(u.current||(u.current=!0,n.current&&(clearTimeout(n.current),n.current=null),m(0),l(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{c(!1)})})))};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)},[]);const j=()=>{u.current=!1,n.current&&clearTimeout(n.current);const t=500*Math.pow(2,M);n.current=setTimeout(()=>{u.current||(M<2?(m(o=>o+1),R(o=>o+1),c(!0)):(console.error("[useInteractiveMode] Interactive mode failed to load after 3 attempts - showing iframe anyway"),l(!0),c(!1)))},t)};return e.useEffect(()=>{g&&!d.current&&r&&s&&(d.current=!0,E(!0),l(!1),w(null),(async()=>{if(i)try{await fetch(`/api/logs/${i}`,{method:"DELETE"})}catch(o){console.error("[useInteractiveMode] Failed to clear log file:",o)}L(),k.submit({action:"start",analysisId:s,scenarioId:r},{method:"post",action:"/api/interactive-mode"})})())},[g,r,s,L,i]),e.useEffect(()=>{const t=s,o=()=>{if(d.current&&t){const v=new URLSearchParams({action:"stop",analysisId:t});console.log("[useInteractiveMode] Sending stop request via sendBeacon");const T=navigator.sendBeacon("/api/interactive-mode",v);console.log("[useInteractiveMode] sendBeacon result:",T),T||(console.log("[useInteractiveMode] sendBeacon failed, using fetch fallback"),fetch("/api/interactive-mode",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:v,keepalive:!0}).catch(D=>console.error("Failed to stop interactive mode:",D)))}},p=()=>{o()};return window.addEventListener("beforeunload",p),()=>{window.removeEventListener("beforeunload",p),console.log("[useInteractiveMode] Cleanup running:",{hasStarted:d.current,analysisId:t}),o()}},[s]),{interactiveServerUrl:S,isStarting:A,isLoading:B,showIframe:q,iframeKey:z,onIframeLoad:j}}function Z(){return h.jsxs("div",{className:"spinner-container",children:[h.jsx("span",{className:"loader"}),h.jsx("style",{children:`
|
|
2
2
|
.loader {
|
|
3
3
|
width: 48px;
|
|
4
4
|
height: 48px;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{r as t,j as e}from"./chunk-JZWAC4HX-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-_417gcQW.js","assets/chunk-JZWAC4HX-DB3aFuEO.js","assets/index-CUM5iXwc.js","assets/styles-CMKNK2uU.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as t,j as e}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{_ as L}from"./preload-helper-ckwbz45p.js";import{u as Q}from"./useLastLogLine-DAFqfEDH.js";import{S as P,I as B}from"./InlineSpinner-EhOseatT.js";const $=t.createContext({dimensions:{height:720,width:1200},updateDimensions:()=>{},iframeRef:{current:null},scale:1,updateScale:()=>{},maxWidth:1200,updateMaxWidth:()=>{}}),U=()=>{const o=t.useContext($);if(!o)throw new Error("useWebContainer must be used within a WebContainerProvider");return o},oe=({children:o})=>{const[i,r]=t.useState({height:720,width:1200}),[d,f]=t.useState(1),[u,g]=t.useState(1200),x=t.useRef(null),h=t.useCallback(({height:l,width:j})=>{r(S=>({height:l??S.height,width:j??S.width}))},[]),v=t.useCallback(l=>{f(l)},[]),w=t.useCallback(l=>{g(l)},[]);return e.jsx($.Provider,{value:{dimensions:i,updateDimensions:h,iframeRef:x,scale:d,updateScale:v,maxWidth:u,updateMaxWidth:w},children:o})},X=typeof window<"u";function Z(){const[o,i]=t.useState(null);return t.useEffect(()=>{L(()=>import("./index-_417gcQW.js").then(r=>r.i),__vite__mapDeps([0,1,2])).then(r=>{i(()=>r.ResizableBox)}),L(()=>Promise.resolve({}),__vite__mapDeps([3]))},[]),o}const ee=1200,te=720,H=30,se=({id:o,scenarioName:i,iframeUrl:r,defaultWidth:d=1440,defaultHeight:f=900,onDataOverride:u,onIframeLoad:g,onScaleChange:x,onDimensionChange:h})=>{const v=Z(),[w,l]=t.useState(!1),[j,S]=t.useState(!1),[c,A]=t.useState(ee),[_,D]=t.useState(te),[E,T]=t.useState(null),[M,I]=t.useState(null),{dimensions:a,updateDimensions:y,iframeRef:m,updateScale:N,updateMaxWidth:R}=U(),k=t.useMemo(()=>Math.min(1,c/a.width),[c,a.width]),p=M!==null?M:k;t.useEffect(()=>{w||(N(p),x==null||x(p))},[p,N,x,w]),t.useEffect(()=>{R(c)},[c,R]);const G=t.useCallback(()=>{l(!0),I(k)},[k]),O=t.useCallback(()=>{l(!1),I(null)},[]),V=t.useCallback((n,s)=>{const b=M!==null?M:1,z=Math.round(s.size.width/b);y({width:z}),h==null||h(z,a.height)},[y,M,h,a.height]),F=t.useCallback(()=>{setTimeout(()=>{S(!0)},100),g&&g()},[g]);t.useEffect(()=>{const n=s=>{if(s.data.type==="codeyam-resize"){if(i&&s.data.name!==i||a.height===s.data.height||s.data.height===0)return;y({height:s.data.height})}};return window.addEventListener("message",n),()=>{window.removeEventListener("message",n)}},[m,i,d,a,y]),t.useEffect(()=>{j&&u&&u(m.current)},[j,u,m]),t.useEffect(()=>{if(!i)return;const n=setInterval(()=>{var s,b;(b=(s=m==null?void 0:m.current)==null?void 0:s.contentWindow)==null||b.postMessage({type:"codeyam-respond",name:i},"*")},1e3);return()=>clearInterval(n)},[i,m]),t.useEffect(()=>{const n=()=>{const s=document.getElementById("scenario-container");if(!s)return;const b=s.getBoundingClientRect(),z=s.clientWidth-H*2,q=window.innerHeight-b.top-H*2,J=Math.max(q,400),K=window.innerHeight-b.top;A(z),D(J),T(K)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),t.useEffect(()=>{y({width:d,height:f})},[d,f,y]);const C=t.useMemo(()=>a.width*p,[a.width,p]),W=t.useMemo(()=>{const n=a.height,s=n*p;return n&&n!==720&&n!==900&&s<_?s:_},[a.height,_,p]),Y=t.useCallback(()=>{window.history.back()},[]);return!X||!v?e.jsx("div",{className:"relative bg-gray-100 w-full h-full flex items-center justify-center",children:e.jsx("p",{className:"text-gray-500",children:"Loading interactive view..."})}):e.jsxs("div",{id:"scenario-container",className:"relative bg-gray-100 w-full flex items-center justify-center",style:E?{height:`${E}px`}:{},children:[w&&e.jsx("div",{className:"fixed inset-0 z-50 bg-transparent"}),e.jsx("style",{children:`
|
|
3
3
|
.react-resizable-handle-e {
|
|
4
4
|
display: flex !important;
|
|
5
5
|
align-items: center !important;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{j as r,L as C}from"./chunk-JZWAC4HX-
|
|
1
|
+
import{j as r,L as C}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{g as L}from"./scenarioStatus-B_8jpV3e.js";function M({scenario:s,entitySha:m,size:g="medium",showBorder:j=!0,isOutdated:E=!1}){var x,h,u,p,$,f;const t=L(s,void 0,void 0,m,void 0),e=(x=s.metadata)==null?void 0:x.executionResult,o=!!e,b=(((u=(h=s.metadata)==null?void 0:h.data)==null?void 0:u.argumentsData)||[]).length,c=(e==null?void 0:e.returnValue)!==void 0&&(e==null?void 0:e.returnValue)!==null,i=(($=(p=e==null?void 0:e.sideEffects)==null?void 0:p.consoleOutput)==null?void 0:$.length)||0,d=((f=e==null?void 0:e.timing)==null?void 0:f.duration)||0;let a=0;b>0&&a++,b>2&&a++,c&&a++,i>0&&a++,a=Math.min(3,a);const l=g==="small"?{width:"w-[50px]",height:"h-[38px]",iconSize:"text-base",textSize:"text-[8px]"}:{width:"w-20",height:"h-15",iconSize:"text-xl",textSize:"text-[10px]"},n=t.hasError?{border:"border-red-400",bg:"bg-red-50",icon:"text-red-600",badge:"bg-red-100 text-red-700"}:o?E?{border:"border-amber-500",bg:"bg-amber-50",icon:"text-amber-700",badge:"bg-amber-100 text-amber-700"}:{border:"border-blue-400",bg:"bg-blue-50",icon:"text-blue-600",badge:"bg-blue-100 text-blue-700"}:{border:"border-gray-300 border-dashed",bg:"bg-gray-50",icon:"text-gray-400",badge:"bg-gray-100 text-gray-600"},w=j?`border-2 ${n.border}`:"",S=Array.from({length:3},(v,y)=>r.jsx("div",{className:`w-1 h-1 rounded-full ${y<a?n.icon.replace("text-","bg-"):"bg-gray-300"}`},y)),N=t.hasError?`Error: ${t.errorMessage||"Unknown error"}`:o?`${s.name}
|
|
2
2
|
${b} args → ${c?"value":"void"}${i>0?` (${i} logs)`:""}
|
|
3
3
|
${d}ms`:`Not executed: ${s.name}`;return r.jsxs(C,{to:`/entity/${m}/scenarios/${s.id}`,className:`relative ${l.width} ${l.height} ${w} rounded ${n.bg} flex flex-col items-center justify-center gap-0.5 cursor-pointer transition-all hover:scale-105 hover:shadow-md`,title:N,onClick:v=>v.stopPropagation(),children:[r.jsx("div",{className:`${n.icon} ${l.iconSize} font-mono font-bold`,children:t.hasError?"⚠":o?"ƒ":"○"}),o&&!t.hasError&&r.jsxs("div",{className:`flex items-center gap-0.5 ${l.textSize} ${n.badge} px-1 rounded`,children:[r.jsx("span",{children:b}),r.jsx("span",{children:"→"}),r.jsx("span",{children:c?"✓":"∅"})]}),o&&!t.hasError&&g==="medium"&&r.jsx("div",{className:"flex gap-0.5 mt-0.5",children:S}),o&&!t.hasError&&d>100&&g==="medium"&&r.jsx("div",{className:`absolute top-0.5 right-0.5 ${l.textSize} ${n.badge} px-1 rounded`,children:d>1e3?`${Math.round(d/1e3)}s`:`${d}ms`}),o&&!t.hasError&&i>0&&g==="medium"&&r.jsxs("div",{className:"absolute bottom-0.5 left-0.5 text-[8px] text-gray-500",children:["📝",i]})]})}export{M as L};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as i}from"./chunk-JZWAC4HX-
|
|
1
|
+
import{j as i}from"./chunk-JZWAC4HX-DB3aFuEO.js";let s=!1;function r(){if(s)return;const e=document.createElement("style");e.textContent=`
|
|
2
2
|
@keyframes strongPulse {
|
|
3
3
|
0%, 100% { opacity: 0.2; }
|
|
4
4
|
50% { opacity: 1; }
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{r,j as e}from"./chunk-JZWAC4HX-
|
|
1
|
+
import{r,j as e}from"./chunk-JZWAC4HX-DB3aFuEO.js";function w({projectSlug:x,onClose:l}){const[m,o]=r.useState("Loading logs..."),[u,g]=r.useState(!0),[d,f]=r.useState(!0),[n,b]=r.useState("all"),a=r.useRef(null);return r.useEffect(()=>{const t=async()=>{try{const s=await fetch(`/api/logs/${x}`);if(s.ok){const h=await s.text();if(n==="all")o(h);else{const c=h.trim().split(`
|
|
2
2
|
`).filter(i=>{if(i.length===0)return!1;const p=i.match(/^.*CodeYam Log Level (\d+):/);return!!p&&Number(p[1])<=n});o(c.map(i=>i.replace(/^.*CodeYam Log Level \d+:\s*/,"")).join(`
|
|
3
3
|
`))}d&&a.current&&setTimeout(()=>{var c;(c=a.current)==null||c.scrollTo({top:a.current.scrollHeight,behavior:"smooth"})},100)}else o(`Error: ${s.status} - ${await s.text()}`)}catch(s){o(`Error fetching logs: ${s.message}`)}};if(t().catch(()=>{}),u){const s=setInterval(()=>{t().catch(()=>{})},2e3);return()=>clearInterval(s)}},[x,u,d,n]),r.useEffect(()=>{const t=s=>{s.key==="Escape"&&l()};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[l]),e.jsx("div",{className:"fixed inset-0 bg-black/70 flex items-center justify-center z-9999 p-5",onClick:l,children:e.jsxs("div",{className:"bg-[#1e1e1e] rounded-lg shadow-2xl flex flex-col max-w-[1200px] w-full max-h-[90vh] overflow-hidden",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"flex justify-between items-center px-5 py-4 border-b border-[#333] bg-[#252525]",children:[e.jsxs("h3",{className:"m-0 text-lg font-semibold text-white",children:["Analysis Logs - ",x]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("label",{className:"flex items-center gap-2 text-sm text-[#ccc] select-none",children:[e.jsx("span",{children:"Log Level:"}),e.jsxs("select",{value:n,onChange:t=>b(t.target.value==="all"?"all":Number(t.target.value)),className:"bg-[#333] text-white border border-[#555] rounded px-2 py-1 text-sm cursor-pointer outline-none transition-all hover:border-[#777] hover:bg-[#3a3a3a] focus:border-blue-600",children:[e.jsx("option",{value:"1",children:"1"}),e.jsx("option",{value:"2",children:"2"}),e.jsx("option",{value:"3",children:"3"}),e.jsx("option",{value:"4",children:"4"}),e.jsx("option",{value:"all",children:"All"})]})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-sm text-[#ccc] cursor-pointer select-none group",children:[e.jsx("input",{type:"checkbox",checked:u,onChange:t=>g(t.target.checked),className:"cursor-pointer"}),e.jsx("span",{className:"group-hover:text-white",children:"Auto-refresh"})]}),e.jsxs("label",{className:"flex items-center gap-1.5 text-sm text-[#ccc] cursor-pointer select-none group",children:[e.jsx("input",{type:"checkbox",checked:d,onChange:t=>f(t.target.checked),className:"cursor-pointer"}),e.jsx("span",{className:"group-hover:text-white",children:"Auto-scroll"})]}),e.jsx("button",{onClick:l,className:"bg-transparent border-none text-[#999] text-2xl cursor-pointer p-0 w-8 h-8 flex items-center justify-center rounded transition-all hover:bg-[#333] hover:text-white",title:"Close (Esc)",children:"✕"})]})]}),e.jsx("pre",{className:"flex-1 m-0 px-5 py-4 overflow-auto font-mono text-[13px] leading-relaxed text-[#d4d4d4] bg-[#1e1e1e] whitespace-pre-wrap wrap-break-word scrollbar-thin scrollbar-thumb-[#424242] scrollbar-track-[#1e1e1e] hover:scrollbar-thumb-[#4f4f4f]",ref:a,children:m})]})})}export{w as L};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as t,c as T,j as e}from"./chunk-JZWAC4HX-
|
|
1
|
+
import{r as t,c as T,j as e}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{c as S}from"./createLucideIcon-D1zB-pYc.js";import{C as F}from"./circle-check-igfMr5DY.js";import{T as k}from"./triangle-alert-CAD5b1o_.js";import{C as E,a as A}from"./copy-Coc4o_8c.js";/**
|
|
2
2
|
* @license lucide-react v0.556.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,j as e}from"./chunk-JZWAC4HX-
|
|
1
|
+
import{r as a,j as e}from"./chunk-JZWAC4HX-DB3aFuEO.js";function j({screenshotPath:l,cacheBuster:o,alt:x,className:f="",title:n}){const[i,s]=a.useState("loading"),[c,r]=a.useState(!1),d=a.useRef(null),u=o?`/api/screenshot/${l}?cb=${o}`:`/api/screenshot/${l}`,m=()=>{s("success"),r(!0)},h=()=>{s("error"),r(!1)};return a.useEffect(()=>{s("loading"),r(!1);const t=d.current;t!=null&&t.complete&&(t.naturalHeight!==0?(s("success"),r(!0)):(s("error"),r(!1)))},[u]),l?e.jsxs("div",{className:"relative w-full h-full flex items-center justify-center",title:n,children:[e.jsx("img",{ref:d,src:u,alt:x,onLoad:m,onError:h,className:f||"max-w-full max-h-full object-contain",style:{visibility:c?"visible":"hidden",position:c?"relative":"absolute"}}),i==="loading"&&e.jsx("div",{className:"absolute inset-0 bg-gray-100 animate-pulse rounded flex items-center justify-center",children:e.jsx("svg",{className:"w-8 h-8 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),i==="error"&&e.jsxs("div",{className:"absolute inset-0 border-2 border-dashed border-gray-300 bg-gray-50 rounded flex flex-col items-center justify-center text-xs gap-1",children:[e.jsx("span",{className:"text-2xl text-gray-400",children:"📷"}),e.jsx("span",{className:"text-gray-400 whitespace-nowrap",children:"No Screenshot"})]})]}):e.jsx("div",{className:"w-full h-full border-2 border-dashed border-gray-300 bg-gray-50 rounded flex flex-col items-center justify-center text-xs gap-1",title:n,children:e.jsx("span",{className:"text-2xl text-gray-400",children:"📷"})})}export{j as S};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as i,j as e,c as ge,L as ie}from"./chunk-JZWAC4HX-
|
|
1
|
+
import{r as i,j as e,c as ge,L as ie}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{I as be}from"./InteractivePreview-yjIHlOGa.js";import{u as je,V as we,S as Ne}from"./useCustomSizes-BqgrAzs3.js";import{L as J}from"./LogViewer-kgBTLoJD.js";import{S as ve}from"./SafeScreenshot-CwZrv-Ok.js";import{u as ke}from"./useLastLogLine-DAFqfEDH.js";import{u as Ce}from"./InlineSpinner-EhOseatT.js";import{_ as ye}from"./preload-helper-ckwbz45p.js";import{R as Ie}from"./ReportIssueModal-BzPgx-xO.js";import{C as Ee,a as Le}from"./copy-Coc4o_8c.js";import{g as Pe}from"./scenarioStatus-B_8jpV3e.js";function $e({presets:s,customSizes:t,currentWidth:n,currentHeight:o,scale:v,onSizeChange:N,onSaveCustomSize:w,onRemoveCustomSize:d,className:k=""}){const[h,x]=i.useState(!1),[g,b]=i.useState(String(n)),[m,j]=i.useState(String(o)),[C,u]=i.useState(!1),[l,R]=i.useState(!1),P=i.useRef(null);i.useEffect(()=>{C||b(String(n))},[n,C]),i.useEffect(()=>{l||j(String(o))},[o,l]),i.useEffect(()=>{const r=f=>{P.current&&!P.current.contains(f.target)&&x(!1)};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[]);const $=i.useMemo(()=>{const r=s.find(c=>c.width===n&&c.height===o);if(r)return r.name;const f=t.find(c=>c.width===n&&c.height===o);return f?f.name:"Custom"},[s,t,n,o]),O=$==="Custom",S=r=>{N(r.width,r.height),x(!1)},W=r=>{const f=r.target.value;b(f);const c=parseInt(f,10);!isNaN(c)&&c>0&&N(c,o)},U=r=>{const f=r.target.value;j(f);const c=parseInt(f,10);!isNaN(c)&&c>0&&N(n,c)},A=()=>{u(!1);const r=parseInt(g,10);(isNaN(r)||r<=0)&&b(String(n))},K=()=>{R(!1);const r=parseInt(m,10);(isNaN(r)||r<=0)&&j(String(o))},D=r=>{(r.key==="Enter"||r.key==="Escape")&&r.target.blur()};return e.jsxs("div",{className:`flex items-center gap-3 ${k}`,children:[e.jsxs("div",{className:"relative",ref:P,children:[e.jsxs("button",{onClick:()=>x(!h),className:"flex items-center gap-2 px-3 py-1.5 bg-white border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 min-w-[120px] justify-between",children:[e.jsx("span",{children:$}),e.jsx("svg",{className:`w-4 h-4 transition-transform ${h?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),h&&e.jsx("div",{className:"absolute top-full left-0 mt-1 min-w-full bg-white border border-gray-200 rounded-md shadow-lg z-50",children:e.jsxs("div",{className:"py-1",children:[s.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 py-1 text-xs font-semibold text-gray-500 uppercase tracking-wider whitespace-nowrap",children:"Presets"}),s.map(r=>e.jsxs("button",{onClick:()=>S(r),className:`w-full text-left px-3 py-2 text-sm hover:bg-gray-100 flex justify-between items-center gap-4 whitespace-nowrap ${$===r.name?"bg-[#f0f7f9] text-[#005c75]":"text-gray-700"}`,children:[e.jsx("span",{children:r.name}),e.jsxs("span",{className:"text-xs text-gray-500",children:[r.width," x ",r.height]})]},r.name))]}),t.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-gray-100 my-1"}),e.jsx("div",{className:"px-3 py-1 text-xs font-semibold text-gray-500 uppercase tracking-wider whitespace-nowrap",children:"Custom"}),[...t].sort((r,f)=>r.width-f.width).map(r=>e.jsxs("div",{className:`flex items-center gap-1 hover:bg-gray-100 ${$===r.name?"bg-[#f0f7f9] text-[#005c75]":"text-gray-700"}`,children:[e.jsxs("button",{onClick:()=>S(r),className:"flex-1 text-left px-3 py-2 text-sm flex justify-between items-center gap-4 whitespace-nowrap cursor-pointer",children:[e.jsx("span",{children:r.name}),e.jsxs("span",{className:"text-xs text-gray-500",children:[r.width," x ",r.height]})]}),d&&e.jsx("button",{onClick:f=>{f.stopPropagation(),$===r.name&&s.length>0&&N(s[0].width,s[0].height),d(r.name)},className:"p-1.5 mr-1 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded cursor-pointer transition-colors",title:"Remove custom size",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},r.name))]})]})})]}),e.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{type:"text",value:g,onChange:W,onFocus:()=>u(!0),onBlur:A,onKeyDown:D,className:"w-16 px-2 py-1 text-right border border-gray-300 rounded-l-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"}),e.jsx("span",{className:"px-2 py-1 bg-gray-100 border border-l-0 border-gray-300 rounded-r-md text-gray-500 text-sm",children:"px"})]}),e.jsx("span",{className:"text-gray-400 mx-1",children:"×"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{type:"text",value:m,onChange:U,onFocus:()=>R(!0),onBlur:K,onKeyDown:D,className:"w-16 px-2 py-1 text-right border border-gray-300 rounded-l-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"}),e.jsx("span",{className:"px-2 py-1 bg-gray-100 border border-l-0 border-gray-300 rounded-r-md text-gray-500 text-sm",children:"px"})]}),v!==void 0&&v<1&&e.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",Math.round(v*100),"%)"]})]}),O&&e.jsx("button",{onClick:w,className:"px-3 py-1.5 bg-[#005c75] text-white text-sm font-medium rounded-md hover:bg-[#004a5c] focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 transition-colors",children:"Save Custom Size"})]})}function de({size:s=24,className:t=""}){return e.jsxs("svg",{width:s,height:s,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z",fill:"#ef4444",stroke:"none"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13",stroke:"#FFFFFF",strokeWidth:"2",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1",fill:"#FFFFFF"})]})}function _e({scenario:s,analysis:t,entity:n}){var w,d,k;const o=((w=s.metadata)==null?void 0:w.executionResult)||null,v=((k=(d=s.metadata)==null?void 0:d.data)==null?void 0:k.argumentsData)||[],N=h=>{var j,C,u;if(!h)return"No execution results available yet. Run the function to capture side effects including console output, file operations, and API calls.";const x=[],g=((j=h.sideEffects)==null?void 0:j.consoleOutput)||[];g.length>0&&(x.push(`Console Output: ${g.length} log ${g.length===1?"entry":"entries"} captured`),g.forEach(l=>{x.push(` [${l.level.toUpperCase()}] ${l.args.join(" ")}`)}));const b=((C=h.sideEffects)==null?void 0:C.fileWrites)||[];b.length>0&&(x.push(`
|
|
2
2
|
File System Operations: ${b.length} ${b.length===1?"operation":"operations"} detected`),b.forEach(l=>{x.push(` ${l.operation}: ${l.path}${l.size?` (${l.size} bytes)`:""}`)}));const m=((u=h.sideEffects)==null?void 0:u.apiCalls)||[];return m.length>0&&(x.push(`
|
|
3
3
|
API Calls: ${m.length} ${m.length===1?"call":"calls"} made`),m.forEach(l=>{x.push(` ${l.method} ${l.url}${l.status?` → ${l.status}`:""}${l.duration?` (${l.duration}ms)`:""}`)})),h.error&&x.push(`
|
|
4
4
|
Error: ${h.error.name||"Error"}: ${h.error.message}`),x.length===0?"No side effects detected. The function executed without console output, file operations, or API calls.":x.join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as v}from"./chunk-JZWAC4HX-
|
|
1
|
+
import{j as v}from"./chunk-JZWAC4HX-DB3aFuEO.js";function O({filePath:n,maxLength:x=60,className:f,style:u}){const o=((t,r)=>{if(t.length<=r)return t;const a="...",c=r-a.length,i=Math.ceil(c*.4),d=Math.floor(c*.6),e=t.slice(0,i),s=t.slice(-d),h=e.lastIndexOf("/"),l=s.indexOf("/"),g=h>i*.5?e.slice(0,h+1):e,m=l!==-1&&l<d*.5?s.slice(l):s;return`${g}${a}${m}`})(n,x),p=o!==n;return v.jsx("span",{className:f||"font-normal text-gray-900 text-[14px] select-text cursor-text",style:{...u,display:"inline-block",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:p?n:void 0,children:o})}export{O as T};
|
package/codeyam-cli/src/webserver/build/client/assets/{_index-B3TDXxnk.js → _index-BRx8ZGZo.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as u,j as e,L as p,w as se,u as te,c as ae,f as re}from"./chunk-JZWAC4HX-
|
|
1
|
+
import{r as u,j as e,L as p,w as se,u as te,c as ae,f as re}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{u as ne}from"./useLastLogLine-DAFqfEDH.js";import{u as le}from"./useToast-ihdMtlf6.js";import{u as oe}from"./useReportContext-DZlYx2c4.js";import{L as ie}from"./LogViewer-kgBTLoJD.js";import{I as E,C as P,E as ce}from"./EntityTypeIcon-BH0XDim7.js";import{S as Y}from"./SafeScreenshot-CwZrv-Ok.js";import{g as de}from"./scenarioStatus-B_8jpV3e.js";import{c as q}from"./createLucideIcon-D1zB-pYc.js";import{C as xe}from"./circle-check-igfMr5DY.js";import{L as S}from"./loader-circle-TzRHMVog.js";/**
|
|
2
2
|
* @license lucide-react v0.556.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,w as se,u as te,
|
|
1
|
+
import{j as e,w as se,u as te,i as re,r as f,L as b,f as R}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{L as oe}from"./LogViewer-kgBTLoJD.js";import{u as ie}from"./useLastLogLine-DAFqfEDH.js";import{u as le}from"./useReportContext-DZlYx2c4.js";import{E as q}from"./EntityTypeIcon-BH0XDim7.js";import{E as ee}from"./EntityTypeBadge-CvzqMxcu.js";import{S as Z}from"./SafeScreenshot-CwZrv-Ok.js";import{L as ae}from"./LoadingDots-BvMu2i-g.js";import{L as ne}from"./loader-circle-TzRHMVog.js";import{P as ce,F as de}from"./pause-hjzB7t2z.js";import{c as X}from"./createLucideIcon-D1zB-pYc.js";/**
|
|
2
2
|
* @license lucide-react v0.556.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{w as C,u as T,a as E,g as A,r as i,j as e,L as $}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{u as O}from"./useReportContext-DZlYx2c4.js";import{c as v}from"./createLucideIcon-D1zB-pYc.js";import{T as S,C as N}from"./terminal-DbEAHMbA.js";import{S as R}from"./search-DcAwD_Ln.js";import{C as w}from"./chevron-down-CG65viiV.js";import{B as L}from"./book-open-D4IPYH_y.js";import{T as M}from"./triangle-alert-CAD5b1o_.js";/**
|
|
2
|
+
* @license lucide-react v0.556.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const I=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],B=v("arrow-left",I);/**
|
|
7
|
+
* @license lucide-react v0.556.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const F=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],D=v("message-square",F);/**
|
|
12
|
+
* @license lucide-react v0.556.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const V=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],U=v("save",V),oe=()=>[{title:"Agent Transcripts - CodeYam"},{name:"description",content:"View background agent transcripts and tool call history"}];function P(t){if(!t)return"";try{return new Date(t).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}catch{return t}}function H(t){if(!t)return"";try{return new Date(t).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1})}catch{return t}}function y({type:t,toolName:s}){const a={user_prompt:"bg-[#00b4d8] text-black",assistant_text:"bg-[#a8dadc] text-black",tool_call:"bg-[#f4a261] text-black",tool_result:"bg-[#2a9d8f] text-black",context:"bg-[#7c3aed] text-white"},r={user_prompt:"USER",assistant_text:"ASSISTANT",tool_call:s||"TOOL",tool_result:"RESULT",context:"CONTEXT"};return e.jsx("span",{className:`inline-block px-2 py-0.5 rounded text-[10px] font-bold uppercase tracking-wide ${a[t]||"bg-gray-300 text-black"}`,children:r[t]||t})}function z({input:t}){return e.jsx("div",{className:"text-xs font-mono space-y-1",children:Object.entries(t).map(([s,a])=>{let r=typeof a=="string"?a:JSON.stringify(a);return r.length>500&&(r=r.slice(0,500)+"..."),e.jsxs("div",{children:[e.jsxs("span",{className:"text-[#f4a261] font-bold",children:[s,":"]})," ",e.jsx("span",{className:"text-gray-700",children:r})]},s)})})}function q({content:t,truncated:s,fullLength:a}){const[r,l]=i.useState(!1);return e.jsxs("div",{children:[e.jsxs("pre",{className:"whitespace-pre-wrap break-words text-xs max-h-96 overflow-y-auto text-gray-700",children:[t,s&&!r&&"..."]}),s&&e.jsx("button",{onClick:()=>l(!r),className:"text-[11px] text-gray-500 hover:text-gray-700 mt-1 font-mono cursor-pointer",children:r?"Show less":`Show more (${(a||0)-t.length} more chars)`})]})}function J({entry:t,pairedResult:s}){const[a,r]=i.useState(!1),l=P(t.timestamp||"");return t.type==="user_prompt"?e.jsxs("div",{className:"my-2",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(y,{type:"user_prompt"}),e.jsx("span",{className:"text-[11px] text-gray-400 font-mono",children:l})]}),e.jsx("pre",{className:"bg-white border border-gray-200 rounded-md p-3 whitespace-pre-wrap break-words text-xs font-mono border-l-[3px] border-l-[#00b4d8] max-h-72 overflow-y-auto text-gray-800",children:t.text})]}):t.type==="assistant_text"?e.jsxs("div",{className:"my-2",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(y,{type:"assistant_text"}),e.jsx("span",{className:"text-[11px] text-gray-400 font-mono",children:l})]}),e.jsx("div",{className:"bg-white border border-gray-200 rounded-md p-3 whitespace-pre-wrap break-words text-sm border-l-[3px] border-l-[#a8dadc] text-gray-800",children:t.text})]}):t.type==="tool_call"?e.jsxs("div",{className:"my-2",children:[e.jsxs("button",{onClick:()=>r(!a),className:"flex items-center gap-2 w-full text-left bg-white border border-gray-200 rounded-md px-3 py-2 hover:bg-gray-50 cursor-pointer",children:[a?e.jsx(w,{className:"w-3 h-3 text-gray-400 flex-shrink-0"}):e.jsx(N,{className:"w-3 h-3 text-gray-400 flex-shrink-0"}),e.jsx(y,{type:"tool_call",toolName:t.name}),e.jsx("span",{className:"text-xs text-gray-500 font-mono truncate flex-1",children:t.summary||""}),e.jsx("span",{className:"text-[11px] text-gray-400 font-mono flex-shrink-0",children:l})]}),a&&e.jsxs("div",{className:"bg-white border border-t-0 border-gray-200 rounded-b-md px-3 py-2 border-l-[3px] border-l-[#f4a261]",children:[e.jsx(z,{input:t.input||{}}),s&&e.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-200",children:[e.jsxs("div",{className:"text-[11px] font-bold uppercase tracking-wide text-[#2a9d8f] mb-1",children:["Result",s.is_error?" (Error)":"",":"]}),e.jsx(q,{content:s.content||"",truncated:s.truncated,fullLength:s.fullLength})]})]})]}):(t.type==="tool_result",null)}function K({context:t}){const[s,a]=i.useState(!1);return e.jsxs("div",{className:"my-2",children:[e.jsxs("button",{onClick:()=>a(!s),className:"flex items-center gap-2 mb-1 cursor-pointer hover:opacity-80",children:[s?e.jsx(w,{className:"w-3 h-3 text-gray-400"}):e.jsx(N,{className:"w-3 h-3 text-gray-400"}),e.jsx(y,{type:"context"}),e.jsx("span",{className:"text-xs text-gray-500",children:"Full prompt context"})]}),s&&e.jsx("pre",{className:"bg-gray-50 border border-gray-200 rounded-md p-3 whitespace-pre-wrap break-words text-xs font-mono border-l-[3px] border-l-[#7c3aed] max-h-96 overflow-y-auto text-gray-700",children:t})]})}function W({snippet:t}){const[s,a]=i.useState(!1),r=t.split(`
|
|
17
|
+
`).filter(c=>c.trim()),l=r.slice(0,4),m=r.length>4,f=s?r:l;return e.jsxs("div",{className:"my-2 bg-blue-50 border border-blue-200 rounded-md p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(D,{className:"w-3.5 h-3.5 text-blue-600"}),e.jsx("span",{className:"text-xs font-bold text-blue-800",children:"Source Conversation"}),e.jsxs("span",{className:"text-[10px] text-blue-500",children:[r.length," message",r.length!==1?"s":""]})]}),e.jsx("div",{className:"space-y-1",children:f.map((c,p)=>{const x=c.match(/^\[(\w+)\]:\s*(.*)/);if(!x)return null;const[,b,h]=x,u=b==="user";return e.jsxs("div",{className:"text-xs",children:[e.jsxs("span",{className:`font-bold ${u?"text-blue-700":"text-gray-500"}`,children:[u?"User":"Assistant",":"]})," ",e.jsx("span",{className:"text-gray-700",children:h.length>200?h.slice(0,200)+"...":h})]},p)})}),m&&e.jsx("button",{onClick:()=>a(!s),className:"text-[11px] text-blue-600 hover:text-blue-800 mt-2 font-mono cursor-pointer",children:s?"Show less":`Show all ${r.length} messages`})]})}function X({change:t}){const[s,a]=i.useState(!1),r=t.action==="created"?!!t.content:t.action==="modified"?!!(t.oldString||t.newString):!1;return e.jsxs("li",{children:[e.jsx("button",{onClick:()=>r&&a(!s),className:`text-left w-full ${r?"hover:text-green-900 cursor-pointer":""}`,children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[r&&(s?e.jsx(w,{className:"w-3 h-3 inline flex-shrink-0"}):e.jsx(N,{className:"w-3 h-3 inline flex-shrink-0"})),t.action==="created"?"Created":"Modified"," ",t.filePath]})}),s&&t.action==="created"&&t.content&&e.jsx("pre",{className:"mt-1 mb-2 ml-4 p-2 bg-white border border-green-200 rounded text-[11px] text-gray-700 whitespace-pre-wrap break-words max-h-64 overflow-y-auto",children:t.content}),s&&t.action==="modified"&&e.jsxs("div",{className:"mt-1 mb-2 ml-4 space-y-1",children:[t.oldString&&e.jsxs("pre",{className:"p-2 bg-red-50 border border-red-200 rounded text-[11px] text-red-800 whitespace-pre-wrap break-words max-h-32 overflow-y-auto",children:["- ",t.oldString]}),t.newString&&e.jsxs("pre",{className:"p-2 bg-green-50 border border-green-300 rounded text-[11px] text-green-800 whitespace-pre-wrap break-words max-h-32 overflow-y-auto",children:["+ ",t.newString]})]})]})}function Y({changes:t}){const s=t.filter(r=>r.action==="touched"),a=t.filter(r=>r.action!=="touched");return e.jsxs("div",{className:"my-2 bg-green-50 border border-green-200 rounded-md p-3",children:[e.jsx("div",{className:"text-xs font-bold text-green-800 mb-1",children:"Rule Changes:"}),e.jsxs("ul",{className:"text-xs text-green-700 space-y-0.5 font-mono",children:[a.map((r,l)=>e.jsx(X,{change:r},l)),s.length>0&&e.jsxs("li",{children:["Touched timestamps on ",s.length," rule",s.length!==1?"s":""]})]})]})}function G({agent:t,defaultOpen:s,isAdmin:a}){const[r,l]=i.useState(s),[m,f]=i.useState(!1),[c,p]=i.useState(null),x=i.useMemo(()=>{const o={};for(const n of t.entries)n.type==="tool_result"&&n.tool_use_id&&(o[n.tool_use_id]=n);return o},[t.entries]),b=i.useMemo(()=>{const o=new Set;for(const n of t.entries)n.type==="tool_call"&&n.tool_use_id&&x[n.tool_use_id]&&o.add(n.tool_use_id);return o},[t.entries,x]),h=o=>{o.stopPropagation(),f(!0),p(null),fetch("/api/save-fixture",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:t.id})}).then(n=>n.json()).then(n=>{n.success?p(`Saved to ${n.fixturePath}`):p(`Error: ${n.error}`)}).catch(n=>{p(`Error: ${n instanceof Error?n.message:String(n)}`)}).finally(()=>{f(!1)})},u=(t.ruleChanges||[]).filter(o=>o.action!=="touched"),j=(t.ruleChanges||[]).filter(o=>o.action==="touched"),g=u.length>0,d=j.length>0,k=g||d;return e.jsxs("div",{className:`bg-white border rounded-lg overflow-hidden mb-4 ${g?"border-green-300":"border-gray-200"}`,children:[e.jsxs("button",{onClick:()=>l(!r),className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-gray-50 cursor-pointer",children:[r?e.jsx(w,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}):e.jsx(N,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),e.jsx("span",{className:"text-sm font-bold text-[#005C75] font-mono",children:t.id.slice(0,8)}),t.slug&&e.jsx("span",{className:"text-xs text-gray-500",children:t.slug}),g&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-800",children:[e.jsx(L,{className:"w-3 h-3"}),u.length===1?"1 rule changed":`${u.length} rules changed`]}),!g&&d&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-bold bg-gray-100 text-gray-500",children:[j.length," timestamp",j.length!==1?"s":""," ","touched"]}),t.hasConfusion&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-bold bg-amber-100 text-amber-800",children:[e.jsx(M,{className:"w-3 h-3"}),"Confusion Detected"]}),e.jsxs("span",{className:"text-[11px] text-gray-400 font-mono",children:[t.stats.toolCalls," tool calls, ",t.stats.textBlocks," text blocks"]}),e.jsxs("span",{className:"text-[11px] text-gray-400 font-mono ml-auto flex items-center gap-2",children:[H(t.timestamp),a&&g&&e.jsxs("button",{onClick:h,disabled:m,className:"inline-flex items-center gap-1 px-2 py-1 rounded text-[10px] font-bold bg-gray-100 text-gray-600 hover:bg-gray-200 disabled:opacity-50 cursor-pointer",title:"Save as test fixture",children:[e.jsx(U,{className:"w-3 h-3"}),m?"Saving...":"Save Fixture"]})]})]}),c&&e.jsx("div",{className:`px-4 py-2 text-xs font-mono ${c.startsWith("Error")?"bg-red-50 text-red-700":"bg-green-50 text-green-700"}`,children:c}),r&&e.jsxs("div",{className:"px-4 pb-4 border-t border-gray-100",children:[t.conversationSnippet&&e.jsx(W,{snippet:t.conversationSnippet}),k&&e.jsx(Y,{changes:t.ruleChanges}),t.context&&e.jsx(K,{context:t.context}),t.entries.map((o,n)=>{if(o.type==="tool_result"&&o.tool_use_id&&b.has(o.tool_use_id))return null;const _=o.type==="tool_call"&&o.tool_use_id?x[o.tool_use_id]:void 0;return e.jsx(J,{entry:o,pairedResult:_},`${t.id}-${n}`)})]})]})}const le=C(function(){const{agents:s,error:a,search:r}=T(),l=E(),m=A("root"),f=(m==null?void 0:m.isAdmin)??!1,[c,p]=i.useState(r),[x,b]=i.useState(!1),[h,u]=i.useState(0);O({source:"agent-transcripts-page"});const j=d=>{d.preventDefault(),window.location.href=`/agent-transcripts${c?`?search=${encodeURIComponent(c)}`:""}`},g=()=>{b(!x),u(d=>d+1)};return a?e.jsx("div",{className:"bg-[#F8F7F6] min-h-screen",children:e.jsxs("div",{className:"px-12 py-6 font-sans",children:[e.jsx("h1",{className:"text-[28px] font-semibold text-gray-900",children:"Error"}),e.jsx("p",{className:"text-base text-gray-500",children:a})]})}):e.jsx("div",{className:"bg-[#f9f9f9] min-h-screen",children:e.jsxs("div",{className:"px-20 py-12 font-sans",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[e.jsx("button",{onClick:()=>{l("/memory")},className:"text-gray-600 hover:text-[#005C75] transition-colors cursor-pointer",title:"Back to Memory","aria-label":"Back to Memory",children:e.jsx(B,{className:"w-5 h-5"})}),e.jsx(S,{className:"w-6 h-6 text-[#232323]"}),e.jsx("h1",{className:"text-[24px] font-semibold mb-0",style:{fontFamily:"Sora",color:"#232323"},children:"Agent Transcripts"})]}),e.jsx("p",{className:"text-[15px] text-gray-500 ml-14",children:"View background agent transcripts and tool call history"})]}),e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsxs("form",{onSubmit:j,className:"relative flex-1 max-w-md",children:[e.jsx(R,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400"}),e.jsx("input",{type:"text",value:c,onChange:d=>p(d.target.value),placeholder:"Search transcripts...",className:"w-full pl-10 pr-4 py-2 border border-gray-200 rounded-md bg-white focus:outline-none focus:ring-2 focus:ring-[#005C75] focus:border-transparent text-sm"})]}),e.jsx("button",{onClick:g,className:"text-xs text-[#005C75] hover:underline cursor-pointer font-mono uppercase font-semibold",children:x?"Collapse All":"Expand All"})]}),e.jsxs("div",{className:"text-sm text-gray-500 mb-4",children:[s.length," agent",s.length!==1?"s":""," found",r&&e.jsxs("span",{children:[" ","matching “",r,"”",e.jsx($,{to:"/agent-transcripts",className:"text-[#005C75] hover:underline ml-2",children:"Clear"})]})]}),s.length===0?e.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-12 text-center",children:[e.jsx(S,{className:"w-12 h-12 text-gray-300 mx-auto mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No Agent Transcripts Found"}),e.jsx("p",{className:"text-gray-500",children:"Background agent output files will appear here when available."})]}):e.jsx("div",{children:s.map(d=>e.jsx(G,{agent:d,defaultOpen:x,isAdmin:f},d.id))},h)]})})});export{le as default,oe as meta};
|