@codeyam/codeyam-cli 0.1.5 → 0.1.7
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 +2 -2
- package/analyzer-template/packages/ai/package.json +1 -1
- package/analyzer-template/packages/ai/src/lib/completionCall.ts +102 -113
- package/analyzer-template/packages/aws/package.json +1 -1
- package/codeyam-cli/src/cli.js +5 -11
- package/codeyam-cli/src/cli.js.map +1 -1
- package/codeyam-cli/src/commands/memory.js +26 -2
- package/codeyam-cli/src/commands/memory.js.map +1 -1
- package/codeyam-cli/src/utils/install-skills.js +4 -4
- package/codeyam-cli/src/utils/install-skills.js.map +1 -1
- package/codeyam-cli/src/utils/requireSimulations.js +1 -1
- package/codeyam-cli/src/utils/requireSimulations.js.map +1 -1
- package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js +5 -6
- package/codeyam-cli/src/utils/ruleReflection/__tests__/contextBuilder.test.js.map +1 -1
- package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js +2 -5
- package/codeyam-cli/src/utils/ruleReflection/__tests__/promptBuilder.test.js.map +1 -1
- package/codeyam-cli/src/utils/rules/__tests__/rulePlacement.test.js +72 -0
- package/codeyam-cli/src/utils/rules/__tests__/rulePlacement.test.js.map +1 -0
- package/codeyam-cli/src/utils/rules/__tests__/sourceFiles.test.js +11 -18
- package/codeyam-cli/src/utils/rules/__tests__/sourceFiles.test.js.map +1 -1
- package/codeyam-cli/src/utils/rules/rulePlacement.js +65 -0
- package/codeyam-cli/src/utils/rules/rulePlacement.js.map +1 -0
- package/codeyam-cli/src/utils/rules/sourceFiles.js +2 -6
- package/codeyam-cli/src/utils/rules/sourceFiles.js.map +1 -1
- package/codeyam-cli/src/utils/simulationGateMiddleware.js +63 -42
- package/codeyam-cli/src/utils/simulationGateMiddleware.js.map +1 -1
- package/codeyam-cli/src/utils/transcriptPruning.js +67 -0
- package/codeyam-cli/src/utils/transcriptPruning.js.map +1 -0
- package/codeyam-cli/src/webserver/backgroundServer.js +10 -0
- package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{CopyButton-jNYXRRNI.js → CopyButton-CtmbP4Gl.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-bwuHPyTa.js → EntityItem-DlMph_Hm.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-CvzqMxcu.js → EntityTypeBadge-B-0PjGOU.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-BH0XDim7.js → EntityTypeIcon-DN9eiJAO.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{InlineSpinner-EhOseatT.js → InlineSpinner-C1rIyZdV.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-yjIHlOGa.js → InteractivePreview-rE_fI2h2.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-Cq5o8jL4.js → LibraryFunctionPreview-CnatsCw2.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-BvMu2i-g.js → LoadingDots-CSP6DZrh.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-kgBTLoJD.js → LogViewer-CMK8Q7yk.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-BzPgx-xO.js → ReportIssueModal-TCV_HBjy.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-CwZrv-Ok.js → SafeScreenshot-CG2uh31y.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-BX2Ny2Qj.js → ScenarioViewer-CU_TDYd8.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-CDpEprKa.js → TruncatedFilePath-D7IoaWUW.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{_index-BRx8ZGZo.js → _index-B8z7mjR-.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-4S4yPfFw.js → activity.(_tab)-DZu78RI1.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-Dm5RS9il.js +22 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.rule-path-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{book-open-D4IPYH_y.js → book-open-Bp5FLkd4.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-CG65viiV.js → chevron-down-DQJA9f4o.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{chunk-JZWAC4HX-DB3aFuEO.js → chunk-JZWAC4HX-7VptmeIr.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{circle-check-igfMr5DY.js → circle-check-B6C4LY9o.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{copy-Coc4o_8c.js → copy-6nzYCu0G.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-D1zB-pYc.js → createLucideIcon-D-QUFOwe.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{dev.empty-JTAjQ54M.js → dev.empty-DmzSmblj.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-B0h9AqE6.js → entity._sha._-C6PQhwY5.js} +9 -9
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.fullscreen-DjLxr2JB.js → entity._sha.scenarios._scenarioId.fullscreen-DVTcUnur.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-CtYowLOt.js → entity._sha_.create-scenario-BVgNO76F.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-PePWg17F.js → entity._sha_.edit._scenarioId-C7ysA4Jq.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-I-Wo99C_.js → entry.client-CU6EUArK.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-9sMMAiWJ.js → fileTableUtils-EWpfFU4X.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{files-Co65J0s3.js → files-CrxAoWIL.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{git-BdHOxVfg.js → git-BldHtKeW.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/globals-CLmFdUae.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{index-CUM5iXwc.js → index-7-1FmlHo.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-_417gcQW.js → index-DuYcwYp_.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{labs-DAvt-sy-.js → labs-CPPVOSWB.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-TzRHMVog.js → loader-circle-BnDcD54R.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-717e346a.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/memory-0wMU4KXe.js +93 -0
- package/codeyam-cli/src/webserver/build/client/assets/{pause-hjzB7t2z.js → pause-DhQX2g22.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{root-DoB3B10-.js → root-DqfSDjyQ.js} +13 -13
- package/codeyam-cli/src/webserver/build/client/assets/{search-DcAwD_Ln.js → search-DborVoKD.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/settings-BWunYSXt.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{simulations-DVNJVQgD.js → simulations-BtrtCYJg.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{terminal-DbEAHMbA.js → terminal-Bs4NC-VZ.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-CAD5b1o_.js → triangle-alert-DTf3Jojp.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-BqgrAzs3.js → useCustomSizes-D_bDZyDU.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-DAFqfEDH.js → useLastLogLine-DZp6rrQD.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-DZlYx2c4.js → useReportContext-BsQb6rFd.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useToast-ihdMtlf6.js → useToast-BOur3mUv.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/{index-C_nP9_jr.js → index-B8jmgmn2.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-9OU4lmvL.js +285 -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-new-rule.md +0 -2
- package/codeyam-cli/templates/hooks/staleness-check.sh +43 -0
- package/codeyam-cli/templates/prompts/conversation-guidance.txt +44 -0
- package/codeyam-cli/templates/prompts/conversation-prompt.txt +28 -0
- package/codeyam-cli/templates/prompts/interruption-prompt.txt +31 -0
- package/codeyam-cli/templates/prompts/stale-rules-prompt.txt +24 -0
- package/codeyam-cli/templates/rule-notification-hook.py +44 -17
- package/codeyam-cli/templates/rule-reflection-hook.py +24 -4
- package/codeyam-cli/templates/rules-instructions.md +34 -88
- package/package.json +1 -1
- package/packages/ai/src/lib/completionCall.js +0 -5
- package/packages/ai/src/lib/completionCall.js.map +1 -1
- package/codeyam-cli/src/commands/detect-universal-mocks.js +0 -120
- package/codeyam-cli/src/commands/detect-universal-mocks.js.map +0 -1
- package/codeyam-cli/src/commands/list.js +0 -31
- package/codeyam-cli/src/commands/list.js.map +0 -1
- package/codeyam-cli/src/commands/webapp-info.js +0 -146
- package/codeyam-cli/src/commands/webapp-info.js.map +0 -1
- package/codeyam-cli/src/utils/universal-mocks.js +0 -152
- package/codeyam-cli/src/utils/universal-mocks.js.map +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/agent-transcripts-DHKuQSmR.js +0 -17
- package/codeyam-cli/src/webserver/build/client/assets/globals-B4MPiL7S.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-e24d6600.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/memory-bAp4y2hv.js +0 -92
- package/codeyam-cli/src/webserver/build/client/assets/settings-CclxrcPK.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-BEaMCeTu.js +0 -273
- package/codeyam-cli/templates/codeyam-stop-hook.sh +0 -284
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import{r,j as e,d as se,a as ae,c as oe,L as
|
|
1
|
+
import{r,j as e,d as se,a as ae,c as oe,L as U,w as re,M as le,D as ce,S as de,G as me,u as he,f as xe,O as pe}from"./chunk-JZWAC4HX-7VptmeIr.js";import{_ as fe}from"./preload-helper-ckwbz45p.js";import{c as ue}from"./cy-logo-cli-DcX-ZS3p.js";import{B as ye,R as ge,S as ve}from"./ReportIssueModal-TCV_HBjy.js";import{a as je,R as be}from"./useReportContext-BsQb6rFd.js";import{L as G}from"./loader-circle-BnDcD54R.js";import{c as M}from"./createLucideIcon-D-QUFOwe.js";import{B as ke}from"./book-open-Bp5FLkd4.js";import{T as Ce,u as we}from"./useToast-BOur3mUv.js";import{u as Ne}from"./useLastLogLine-DZp6rrQD.js";import{L as Se}from"./LogViewer-CMK8Q7yk.js";import{E as Le}from"./EntityTypeIcon-DN9eiJAO.js";import{T as Ae}from"./TruncatedFilePath-D7IoaWUW.js";import{C as ze}from"./chevron-down-DQJA9f4o.js";import{C as Te}from"./circle-check-B6C4LY9o.js";import{C as Me}from"./CopyButton-CtmbP4Gl.js";import"./triangle-alert-DTf3Jojp.js";import"./copy-6nzYCu0G.js";function Ee({id:t,selected:i,onClick:a,icon:d,name:c}){const[l,n]=r.useState(!1);r.useEffect(()=>{n(!0)},[]);const g=r.useCallback(()=>{a==null||a(t)},[a,t]);return e.jsxs("button",{className:`
|
|
2
2
|
w-full px-1.5 py-2 cursor-pointer focus:outline-none
|
|
3
3
|
flex flex-col items-center justify-center gap-1 transition-colors
|
|
4
4
|
${i?"text-[#CBF3FA]":"text-[#568B94] hover:text-[#CBF3FA]"}
|
|
5
|
-
`,onClick:
|
|
5
|
+
`,onClick:g,children:[e.jsx("div",{className:`${i?"bg-[#CBF3FA] text-[#022A35]":""} w-9 h-9 rounded-lg flex items-center justify-center transition-colors`,children:l&&d}),e.jsx("span",{className:`text-[10px] font-normal text-center leading-tight ${i?"text-[#CBF3FA]":""}`,style:i?{color:"#CBF3FA !important"}:void 0,children:c})]})}/**
|
|
6
6
|
* @license lucide-react v0.556.0 - ISC
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the ISC license.
|
|
9
9
|
* See the LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/const
|
|
10
|
+
*/const De=[["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"}]],q=M("activity",De);/**
|
|
11
11
|
* @license lucide-react v0.556.0 - ISC
|
|
12
12
|
*
|
|
13
13
|
* This source code is licensed under the ISC license.
|
|
14
14
|
* See the LICENSE file in the root directory of this source tree.
|
|
15
|
-
*/const
|
|
15
|
+
*/const _e=[["path",{d:"M7 10h10",key:"1101jm"}],["path",{d:"M7 14h10",key:"1mhdw3"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Be=M("circle-equal",_e);/**
|
|
16
16
|
* @license lucide-react v0.556.0 - ISC
|
|
17
17
|
*
|
|
18
18
|
* This source code is licensed under the ISC license.
|
|
19
19
|
* See the LICENSE file in the root directory of this source tree.
|
|
20
|
-
*/const
|
|
20
|
+
*/const Fe=[["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"}]],Ie=M("component",Fe);/**
|
|
21
21
|
* @license lucide-react v0.556.0 - ISC
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the ISC license.
|
|
24
24
|
* See the LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/const
|
|
25
|
+
*/const $e=[["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"}]],We=M("file",$e);/**
|
|
26
26
|
* @license lucide-react v0.556.0 - ISC
|
|
27
27
|
*
|
|
28
28
|
* This source code is licensed under the ISC license.
|
|
29
29
|
* See the LICENSE file in the root directory of this source tree.
|
|
30
|
-
*/const Pe=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],
|
|
30
|
+
*/const Pe=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],Ve=M("flask-conical",Pe);/**
|
|
31
31
|
* @license lucide-react v0.556.0 - ISC
|
|
32
32
|
*
|
|
33
33
|
* This source code is licensed under the ISC license.
|
|
34
34
|
* See the LICENSE file in the root directory of this source tree.
|
|
35
|
-
*/const
|
|
35
|
+
*/const Oe=[["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"}]],ee=M("git-commit-horizontal",Oe);/**
|
|
36
36
|
* @license lucide-react v0.556.0 - ISC
|
|
37
37
|
*
|
|
38
38
|
* This source code is licensed under the ISC license.
|
|
39
39
|
* See the LICENSE file in the root directory of this source tree.
|
|
40
|
-
*/const
|
|
40
|
+
*/const Re=[["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"}]],He=M("house",Re);/**
|
|
41
41
|
* @license lucide-react v0.556.0 - ISC
|
|
42
42
|
*
|
|
43
43
|
* This source code is licensed under the ISC license.
|
|
44
44
|
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
-
*/const
|
|
45
|
+
*/const Ue=[["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"}]],qe=M("panels-top-left",Ue);/**
|
|
46
46
|
* @license lucide-react v0.556.0 - ISC
|
|
47
47
|
*
|
|
48
48
|
* This source code is licensed under the ISC license.
|
|
49
49
|
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
-
*/const Je=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],
|
|
51
|
-
Bug`})]})})]}),n&&e.jsx(
|
|
50
|
+
*/const Je=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Ye=M("refresh-cw",Je);function Ge({labs:t,isAdmin:i}){var D;const a=se(),d=ae(),[c,l]=r.useState(),[n,g]=r.useState(!1),[N,C]=r.useState(!1),[x,S]=r.useState(null),u=oe();r.useEffect(()=>{u.state==="idle"&&!u.data&&u.load("/api/generate-report")},[u]);const B=((D=u.data)==null?void 0:D.defaultEmail)||"",p={width:"20px",height:"20px",strokeWidth:1.5},L=(t==null?void 0:t.simulations)??!1,F=[{id:"dashboard",icon:e.jsx(He,{style:p}),link:"/",name:"Dashboard",hidden:!L},{id:"simulations",icon:e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:p,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",hidden:!L},{id:"git",icon:e.jsx(ee,{style:p}),link:"/git",name:"Git",hidden:!L},{id:"files",icon:e.jsx(We,{style:p}),link:"/files",name:"Files",hidden:!L},{id:"activity",icon:e.jsx(Ye,{style:p}),link:"/activity",name:"Activity",hidden:!L},{id:"memory",icon:e.jsx(ke,{style:p}),link:"/memory",name:"Memory"},{id:"labs",icon:e.jsx(Ve,{style:p}),link:"/labs",name:"Labs"},{id:"settings",icon:e.jsx(ve,{style:p}),link:"/settings",name:"Settings"},{id:"commits",icon:e.jsx(ee,{style:p}),link:"/commits",name:"Commits",hidden:!0},{id:"pages",icon:e.jsx(qe,{style:p}),link:"/pages",name:"Pages",hidden:!0},{id:"components",icon:e.jsx(Ie,{style:p}),link:"/components",name:"Components",hidden:!0}],W=r.useCallback(o=>{const y=F.find(m=>m.id===o);y!=null&&y.link&&d(y.link),l(m=>m===o?void 0:o)},[F,d]);r.useEffect(()=>{const o={dashboard:["/","/home"],git:["git"],commits:["commits"],simulations:["simulations"],activity:["activity"],memory:["memory","agent-transcripts"],files:["files"],labs:["labs"],settings:["settings"],pages:["pages"],components:["components"]};for(const[y,m]of Object.entries(o))if(m.some(b=>b==="/"?a.pathname==="/":a.pathname.includes(b))){l(y);return}l(void 0)},[a]);const A=async()=>{C(!0);try{const{default:o}=await fe(async()=>{const{default:b}=await import("./html2canvas-pro.esm-fmIEn3Bc.js");return{default:b}},[]),m=(await o(document.body)).toDataURL("image/jpeg",.8);S(m),g(!0)}catch(o){console.error("Screenshot capture failed:",o),g(!0)}finally{C(!1)}},E=()=>{g(!1),S(null)},j=je();return e.jsxs(e.Fragment,{children:[e.jsxs("div",{id:"sidebar",className:"sticky top-0 w-full h-screen bg-[#051C22] flex flex-col justify-between py-3",children:[e.jsxs("div",{className:"w-full flex flex-col items-center",children:[e.jsx("div",{className:"py-3 mt-2 mb-4",children:e.jsx(U,{to:"/",className:"flex items-center justify-center cursor-pointer",children:e.jsx("img",{src:ue,alt:"CodeYam",className:"h-6"})})}),F.filter(o=>!o.hidden).map(o=>e.jsx(Ee,{id:o.id,selected:o.id===c,onClick:W,icon:o.icon,name:o.name},`sidebar-button-${o.id}`))]}),i&&e.jsx("div",{className:"w-full flex flex-col items-center pb-2",children:e.jsxs("button",{onClick:()=>void A(),disabled:N,className:"w-full px-1.5 py-2 flex flex-col items-center justify-center gap-1 text-[#568B94] hover:text-[#CBF3FA] transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-wait",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg flex items-center justify-center",children:N?e.jsx(G,{style:{width:"20px",height:"20px",strokeWidth:1.5},className:"animate-spin"}):e.jsx(ye,{style:{width:"20px",height:"20px",strokeWidth:1.5}})}),e.jsx("span",{className:"text-[9px] font-normal text-center leading-tight whitespace-pre-line",children:N?"Capturing...":`Report
|
|
51
|
+
Bug`})]})})]}),n&&e.jsx(ge,{isOpen:!0,onClose:E,context:j,defaultEmail:B,screenshotDataUrl:x??void 0})]})}function Qe({toast:t,onClose:i}){r.useEffect(()=>{const c=t.duration||5e3;if(c>0){const l=setTimeout(()=>{i(t.id)},c);return()=>clearTimeout(l)}},[t.id,t.duration,i]);const a={success:"✅",error:"❌",info:"ℹ️",warning:"⚠️"},d={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] ${d[t.type]}`,children:[e.jsx("span",{className:"text-2xl",children:a[t.type]}),e.jsx("p",{className:"flex-1 text-sm font-medium m-0",children:t.message}),e.jsx("button",{onClick:()=>i(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 Xe({toasts:t,onClose:i}){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:`
|
|
52
52
|
@keyframes slideIn {
|
|
53
53
|
from {
|
|
54
54
|
transform: translateX(400px);
|
|
@@ -59,4 +59,4 @@ Bug`})]})})]}),n&&e.jsx(ve,{isOpen:!0,onClose:E,context:j,defaultEmail:B,screens
|
|
|
59
59
|
opacity: 1;
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
`}),t.map(a=>e.jsx(Ge,{toast:a,onClose:i},a.id))]})}function U({entity:t,nameSize:i="11px",pathSize:a="10px",pathMaxLength:d=50,showScenarioCount:c=!1,scenarioCount:l=0,additionalContent:n}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Ae,{type:t.entityType||"other"}),e.jsxs(q,{to:`/entity/${t.sha}`,className:"hover:underline shrink-0 cursor-pointer",style:{fontSize:i,fontWeight:500,color:"#000",whiteSpace:"nowrap"},children:[t.name,c&&l>0&&` (${l})`]}),e.jsx(Le,{filePath:t.filePath,maxLength:d,style:{fontSize:a,color:"#8E8E8E"}})]}),n]})}const Y={fontSize:"9px",color:"#005C75",fontStyle:"italic"};function Xe({currentRun:t,projectSlug:i,currentEntities:a=[],isAnalysisStarting:d=!1,queuedJobCount:c=0,queueJobs:l=[],currentlyExecuting:n=null,historicalRuns:u=[]}){var Q,X,K;const[N,w]=r.useState(!1),[x,S]=r.useState(!1),[y,B]=r.useState(null),[p,A]=r.useState(new Set),[F,P]=r.useState(new Set),[L,E]=r.useState(!1),j=!!n||l.length>0,D=!!n,o=(n==null?void 0:n.entities)||a,v=!!(t!=null&&t.analysisCompletedAt),m=(t==null?void 0:t.readyToBeCaptured)??0,b=(t==null?void 0:t.capturesCompleted)??0;t!=null&&t.captureCompletedAt||v&&(m===0||b>=m);const O=(t==null?void 0:t.currentEntityShas)&&t.currentEntityShas.length>0,W=j,{lastLine:_}=Ne(i,W),z=D||l.length>0,R=new Set(((Q=n==null?void 0:n.entities)==null?void 0:Q.map(s=>s.sha))||[]),H=u.filter(s=>!(s.currentEntityShas||[]).some(h=>R.has(h))),ne=(()=>{const f=Date.now()-1440*60*1e3;if(t!=null&&t.createdAt&&O){const h=t.analysisCompletedAt||t.createdAt;if(new Date(h).getTime()>f)return!0}if(H.length>0){const h=H[0],T=h.analysisCompletedAt||h.archivedAt||h.createdAt;if(T&&new Date(T).getTime()>f)return!0}return!1})();return r.useEffect(()=>{const s=(n==null?void 0:n.id)||null;j&&!x&&s!==y&&S(!0),!j&&y!==null&&B(null)},[j,n==null?void 0:n.id,x,y]),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:()=>{S(!0),B(null)},className:"flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-gray-50 transition-colors",title:"Click to expand",children:[z?e.jsx(G,{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(J,{size:16,style:{color:"#005C75"}})}),e.jsx("span",{style:{fontSize:"12px",fontWeight:500,color:"#343434"},children:z?"Analyzing...":"Activity: No Activity Yet"}),z&&e.jsx("button",{onClick:s=>{s.stopPropagation(),w(!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:[z?e.jsx(G,{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(J,{size:16,style:{color:"#005C75"}})}),e.jsx("span",{style:{fontSize:"12px",fontWeight:500,color:"#343434"},children:z?"Analyzing...":"Activity"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>w(!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:()=>{S(!1),B((n==null?void 0:n.id)||null)},className:"p-1 rounded transition-colors cursor-pointer",style:{backgroundColor:"#E0E9EC"},title:"Collapse","aria-label":"Collapse",children:e.jsx(ze,{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:[z&&n&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(J,{size:12,style:{color:"#005C75"}}),e.jsx("h4",{style:{fontSize:"11px",fontWeight:600,color:"#343434"},children:"Current Activity"})]}),e.jsx("div",{className:"rounded p-2",style:{backgroundColor:"#f5f5f5"},children:o.length>0?e.jsxs("div",{className:"space-y-1.5",children:[(L?o:o.slice(0,3)).map(s=>e.jsx(U,{entity:s,nameSize:"11px",pathSize:"10px",pathMaxLength:150},s.sha)),o.length>3&&e.jsx("button",{onClick:()=>E(s=>!s),className:"cursor-pointer bg-transparent border-none p-0 hover:underline",style:Y,"aria-label":L?"Show fewer entities":`Show ${o.length-3} more entities`,children:L?"Show less":`+${o.length-3} more`}),_&&e.jsx("div",{style:{fontSize:"10px",color:"#005C75",marginTop:"4px"},children:_})]}):e.jsxs("div",{children:[n.entityNames&&n.entityNames.length>0?e.jsxs("div",{className:"space-y-0.5",children:[n.entityNames.slice(0,5).map((s,f)=>e.jsx("div",{style:{fontSize:"11px",color:"#343434"},children:s},f)),n.entityNames.length>5&&e.jsxs("div",{className:"italic",style:{fontSize:"10px",color:"#666"},children:["+",n.entityNames.length-5," ","more"]})]}):e.jsxs("div",{style:{fontSize:"11px",color:"#343434"},children:["Analyzing"," ",((X=n.entityShas)==null?void 0:X.length)||0," ",((K=n.entityShas)==null?void 0:K.length)===1?"entity":"entities","..."]}),_&&e.jsx("div",{style:{fontSize:"10px",color:"#005C75",marginTop:"4px"},children:_})]})})]}),l.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(_e,{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:l.map(s=>{var T,$;const f=p.has(s.id),h=f?s.entities:s.entities.slice(0,3);return e.jsx("div",{className:"rounded p-2",style:{backgroundColor:"#f5f5f5"},children:s.entities.length>0?e.jsxs("div",{className:"space-y-1.5",children:[h.map(C=>e.jsx(U,{entity:C,nameSize:"10px",pathSize:"9px",pathMaxLength:120},C.sha)),s.entities.length>3&&e.jsx("button",{onClick:()=>{A(C=>{const I=new Set(C);return I.has(s.id)?I.delete(s.id):I.add(s.id),I})},className:"cursor-pointer bg-transparent border-none p-0 hover:underline",style:Y,"aria-label":f?"Show fewer entities":`Show ${s.entities.length-3} more entities`,children:f?"Show less":`+${s.entities.length-3} more`})]}):e.jsxs("div",{style:{fontSize:"10px",color:"#343434"},children:[s.type==="analysis"&&e.jsx(e.Fragment,{children:s.entityNames&&s.entityNames.length>0?e.jsxs("div",{className:"space-y-0.5",children:[s.entityNames.slice(0,5).map((C,I)=>e.jsx("div",{children:C},I)),s.entityNames.length>5&&e.jsxs("div",{className:"italic",children:["+",s.entityNames.length-5," more"]})]}):`Analyzing ${((T=s.entityShas)==null?void 0:T.length)||0} ${(($=s.entityShas)==null?void 0:$.length)===1?"entity":"entities"}`}),s.type==="recapture"&&"Recapturing scenario",s.type==="debug-setup"&&"Setting up debug environment"]})},s.id)})})]}),ne&&H.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(Te,{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:H.slice(0,3).map((s,f)=>{const h=s.entities||[],T=s.analysisCompletedAt||s.archivedAt||s.createdAt||"",$=(()=>{if(!T)return"";const k=Date.now()-new Date(T).getTime(),g=Math.floor(k/6e4),V=Math.floor(k/36e5);return V>0?`${V}h ago`:g>0?`${g}m ago`:"just now"})(),C=F.has(f),ie=(C?h:h.slice(0,3)).map(k=>{var g,V,Z;return{...k,scenarioCount:((Z=(V=(g=k.analyses)==null?void 0:g[0])==null?void 0:V.scenarios)==null?void 0:Z.length)||0}});return e.jsx("div",{className:"rounded p-2",style:{backgroundColor:"#f5f5f5"},children:h.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[ie.map((k,g)=>e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(U,{entity:k,nameSize:"10px",pathSize:"9px",pathMaxLength:100,showScenarioCount:!0,scenarioCount:k.scenarioCount})}),g===0&&$&&e.jsx("div",{style:{fontSize:"9px",color:"#8E8E8E",whiteSpace:"nowrap",paddingTop:"2px"},children:$})]},k.sha)),h.length>3&&e.jsx("button",{onClick:()=>{P(k=>{const g=new Set(k);return g.has(f)?g.delete(f):g.add(f),g})},className:"cursor-pointer bg-transparent border-none p-0 hover:underline",style:Y,"aria-label":C?"Show fewer entities":`Show ${h.length-3} more entities`,children:C?"Show less":`+${h.length-3} more`})]})},f)})})]})]}),e.jsx("div",{style:{height:"1px",backgroundColor:"#E0E9EC",margin:"0 12px"}}),e.jsx("div",{className:"px-3 pb-2",children:e.jsx(q,{to:"/activity",className:"text-xs font-medium hover:underline cursor-pointer",style:{color:"#005C75"},children:"View All Activity →"})})]})]}),N&&i&&e.jsx(Se,{projectSlug:i,onClose:()=>w(!1)})]})}const Ke="/assets/globals-B4MPiL7S.css";function te({text:t,subtext:i,linkText:a,linkTo:d}){const[c,l]=r.useState(!1);return c?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:i})]}),e.jsx(q,{to:d,className:"shrink-0 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded hover:bg-blue-700 transition-colors",children:a})]}),e.jsx("button",{type:"button",onClick:()=>l(!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"})})})]})})}function Ze({version:t}){return e.jsx("div",{className:"px-6 sm:px-12 pb-8 mt-auto pt-8",children:e.jsxs("div",{className:"border-t border-cygray-30 pt-6 flex flex-wrap justify-between items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"font-mono text-sm font-semibold tracking-widest text-cyblack-100",children:"CODEYAM"}),t&&e.jsx("span",{className:"font-mono text-xs text-gray-400",children:t})]}),e.jsxs("div",{className:"flex items-center gap-4 font-mono text-xs uppercase tracking-widest",children:[e.jsx("a",{href:"https://blog.codeyam.com/",target:"_blank",rel:"noopener noreferrer",className:"text-cyblack-100 underline underline-offset-4 hover:text-primary-100",children:"Read the Blog"}),e.jsx("span",{className:"text-cygray-30",children:"|"}),e.jsx("a",{href:"https://discord.gg/x4uAgaRdwF",target:"_blank",rel:"noopener noreferrer",className:"text-cyblack-100 underline underline-offset-4 hover:text-primary-100",children:"Join Discord"})]})]})})}function et({serverVersion:t}){const[i,a]=r.useState("stale"),[d,c]=r.useState(null),l=async()=>{a("restarting"),c(null);try{if(!(await fetch("/api/restart-server",{method:"POST"})).ok)throw new Error("Failed to restart server");a("reconnecting");let u=0;const N=30,w=1e3,x=async()=>{try{if((await fetch("/api/health")).ok){window.location.reload();return}}catch{}u++,u<N?setTimeout(()=>void x(),w):(c("Server took too long to restart. Please refresh manually."),a("stale"))};setTimeout(()=>void x(),500)}catch(n){c(n instanceof Error?n.message:"Failed to restart server"),a("stale")}};return e.jsx("div",{className:"bg-amber-100 border rounded border-amber-700 shadow-sm mx-6 mt-6",children:e.jsx("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-amber-600",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),e.jsxs("div",{className:"flex-1",children:[i==="stale"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm font-medium text-amber-900",children:"Dashboard server is out of date"}),e.jsxs("p",{className:"text-xs text-amber-700 mt-0.5",children:["Server version: ",t,". A newer version of CodeYam CLI is installed. Restart the server to get the latest features."]}),d&&e.jsx("p",{className:"text-xs text-red-600 mt-1",children:d})]}),i==="restarting"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm font-medium text-amber-900",children:"Restarting server..."}),e.jsx("p",{className:"text-xs text-amber-700 mt-0.5",children:"Please wait while the server restarts."})]}),i==="reconnecting"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm font-medium text-amber-900",children:"Reconnecting..."}),e.jsx("p",{className:"text-xs text-amber-700 mt-0.5",children:"Waiting for the server to come back online."})]})]}),i==="stale"&&e.jsx("button",{type:"button",onClick:()=>void l(),className:"shrink-0 px-4 py-2 bg-amber-600 text-white text-sm font-medium rounded hover:bg-amber-700 transition-colors cursor-pointer",children:"Restart Server"}),(i==="restarting"||i==="reconnecting")&&e.jsxs("div",{className:"shrink-0 flex items-center gap-2 px-4 py-2 text-amber-700 text-sm",children:[e.jsxs("svg",{className:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),i==="restarting"?"Stopping...":"Reconnecting..."]})]})})})}function tt({currentVersion:t,latestVersion:i}){const[a,d]=r.useState(!1),[c,l]=r.useState(!1);if(a)return null;const n="npm install -g @codeyam/codeyam-cli@latest && codeyam stop && codeyam",u=async()=>{try{await navigator.clipboard.writeText(n),l(!0),setTimeout(()=>l(!1),2e3)}catch{}};return e.jsx("div",{className:"bg-emerald-100 border rounded border-emerald-700 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-emerald-600",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{d:"M7 11l5-5m0 0l5 5m-5-5v12"})})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-medium text-emerald-900",children:"A new version of CodeYam CLI is available"}),e.jsxs("p",{className:"text-xs text-emerald-700 mt-0.5",children:["Current: ",t," → Latest: ",i]})]}),e.jsxs("div",{className:"shrink-0 flex items-center gap-2",children:[e.jsx("code",{className:"text-xs bg-emerald-200 text-emerald-900 px-2 py-1.5 rounded font-mono",children:n}),e.jsx("button",{type:"button",onClick:()=>void u(),className:"px-3 py-1.5 bg-emerald-600 text-white text-xs font-medium rounded hover:bg-emerald-700 transition-colors cursor-pointer",children:c?"Copied!":"Copy"})]})]}),e.jsx("button",{type:"button",onClick:()=>d(!0),className:"shrink-0 ml-4 p-1 rounded text-emerald-600 hover:text-emerald-800 hover:bg-emerald-200 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 jt=()=>[{rel:"stylesheet",href:Ke},{rel:"icon",type:"image/x-icon",href:"/favicon.ico"}];function st(){const{currentRun:t,projectSlug:i,currentEntities:a,availableAPIKeys:d,queuedJobCount:c,queueJobs:l,currentlyExecuting:n,historicalRuns:u,isServerOutOfDate:N,serverVersion:w,npmUpdate:x,labs:S,simulationsEnabled:y,isSimulationsReady:B,isAdmin:p,displayVersion:A}=he(),{toasts:F,closeToast:P}=Ce(),L=xe(),E=r.useRef(L),j=se();r.useEffect(()=>{E.current=L},[L]);const D=j.pathname.startsWith("/entity/")&&j.pathname.includes("/edit/")||j.pathname.startsWith("/dev/"),o=j.pathname.includes("/fullscreen");return r.useEffect(()=>{const v=new EventSource("/api/events");let m=null,b=0;const O=2e3;return v.addEventListener("message",W=>{const _=JSON.parse(W.data);if(_.type==="queue")E.current.revalidate(),b=Date.now();else if(_.type==="db-change"||_.type==="unknown"){const z=Date.now(),R=z-b;R<O?(m&&clearTimeout(m),m=setTimeout(()=>{E.current.revalidate(),b=Date.now(),m=null},O-R)):(E.current.revalidate(),b=z)}}),v.addEventListener("error",W=>{console.error("SSE connection error:",W)}),()=>{m&&clearTimeout(m),v.close()}},[]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`min-h-screen ${D?"":"grid"} bg-cygray-10`,style:D?void 0:{gridTemplateColumns:"65px minmax(0, 1fr)"},children:[!D&&e.jsx(Ye,{labs:S,isAdmin:p}),e.jsxs("div",{className:"max-h-screen overflow-auto bg-cygray-10 flex flex-col min-h-screen",children:[N&&e.jsx(et,{serverVersion:w}),x&&x.currentVersion&&e.jsx(tt,{currentVersion:x.currentVersion,latestVersion:x.latestVersion}),y&&d.length===0&&e.jsx(te,{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"}),y&&!B&&e.jsx(te,{text:"Simulations enabled but not yet configured",subtext:"Run /codeyam-setup in Claude Code to install the analyzer and configure your dev server",linkText:"View Labs",linkTo:"/labs"}),e.jsx("div",{className:"flex-1",children:e.jsx(pe,{})}),e.jsx(Ze,{version:A})]})]}),e.jsx(Qe,{toasts:F,onClose:P}),!o&&y&&e.jsx(Xe,{currentRun:t,projectSlug:i,currentEntities:a,isAnalysisStarting:!1,queuedJobCount:c,queueJobs:l,currentlyExecuting:n,historicalRuns:u})]})}const bt=re(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(le,{}),e.jsx(ce,{})]}),e.jsxs("body",{children:[e.jsx(we,{children:e.jsx(be,{children:e.jsx(st,{})})}),e.jsx(de,{}),e.jsx(me,{})]})]})});export{bt as default,jt as links};
|
|
62
|
+
`}),t.map(a=>e.jsx(Qe,{toast:a,onClose:i},a.id))]})}function J({entity:t,nameSize:i="11px",pathSize:a="10px",pathMaxLength:d=50,showScenarioCount:c=!1,scenarioCount:l=0,additionalContent:n}){return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Le,{type:t.entityType||"other"}),e.jsxs(U,{to:`/entity/${t.sha}`,className:"hover:underline shrink-0 cursor-pointer",style:{fontSize:i,fontWeight:500,color:"#000",whiteSpace:"nowrap"},children:[t.name,c&&l>0&&` (${l})`]}),e.jsx(Ae,{filePath:t.filePath,maxLength:d,style:{fontSize:a,color:"#8E8E8E"}})]}),n]})}const Y={fontSize:"9px",color:"#005C75",fontStyle:"italic"};function Ke({currentRun:t,projectSlug:i,currentEntities:a=[],isAnalysisStarting:d=!1,queuedJobCount:c=0,queueJobs:l=[],currentlyExecuting:n=null,historicalRuns:g=[]}){var Q,X,K;const[N,C]=r.useState(!1),[x,S]=r.useState(!1),[u,B]=r.useState(null),[p,L]=r.useState(new Set),[F,W]=r.useState(new Set),[A,E]=r.useState(!1),j=!!n||l.length>0,D=!!n,o=(n==null?void 0:n.entities)||a,y=!!(t!=null&&t.analysisCompletedAt),m=(t==null?void 0:t.readyToBeCaptured)??0,b=(t==null?void 0:t.capturesCompleted)??0;t!=null&&t.captureCompletedAt||y&&(m===0||b>=m);const O=(t==null?void 0:t.currentEntityShas)&&t.currentEntityShas.length>0,P=j,{lastLine:_}=Ne(i,P),z=D||l.length>0,R=new Set(((Q=n==null?void 0:n.entities)==null?void 0:Q.map(s=>s.sha))||[]),H=g.filter(s=>!(s.currentEntityShas||[]).some(h=>R.has(h))),ne=(()=>{const f=Date.now()-1440*60*1e3;if(t!=null&&t.createdAt&&O){const h=t.analysisCompletedAt||t.createdAt;if(new Date(h).getTime()>f)return!0}if(H.length>0){const h=H[0],T=h.analysisCompletedAt||h.archivedAt||h.createdAt;if(T&&new Date(T).getTime()>f)return!0}return!1})();return r.useEffect(()=>{const s=(n==null?void 0:n.id)||null;j&&!x&&s!==u&&S(!0),!j&&u!==null&&B(null)},[j,n==null?void 0:n.id,x,u]),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:()=>{S(!0),B(null)},className:"flex items-center gap-2 px-3 py-2 cursor-pointer hover:bg-gray-50 transition-colors",title:"Click to expand",children:[z?e.jsx(G,{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(q,{size:16,style:{color:"#005C75"}})}),e.jsx("span",{style:{fontSize:"12px",fontWeight:500,color:"#343434"},children:z?"Analyzing...":"Activity: No Activity Yet"}),z&&e.jsx("button",{onClick:s=>{s.stopPropagation(),C(!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:[z?e.jsx(G,{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(q,{size:16,style:{color:"#005C75"}})}),e.jsx("span",{style:{fontSize:"12px",fontWeight:500,color:"#343434"},children:z?"Analyzing...":"Activity"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>C(!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:()=>{S(!1),B((n==null?void 0:n.id)||null)},className:"p-1 rounded transition-colors cursor-pointer",style:{backgroundColor:"#E0E9EC"},title:"Collapse","aria-label":"Collapse",children:e.jsx(ze,{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:[z&&n&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(q,{size:12,style:{color:"#005C75"}}),e.jsx("h4",{style:{fontSize:"11px",fontWeight:600,color:"#343434"},children:"Current Activity"})]}),e.jsx("div",{className:"rounded p-2",style:{backgroundColor:"#f5f5f5"},children:o.length>0?e.jsxs("div",{className:"space-y-1.5",children:[(A?o:o.slice(0,3)).map(s=>e.jsx(J,{entity:s,nameSize:"11px",pathSize:"10px",pathMaxLength:150},s.sha)),o.length>3&&e.jsx("button",{onClick:()=>E(s=>!s),className:"cursor-pointer bg-transparent border-none p-0 hover:underline",style:Y,"aria-label":A?"Show fewer entities":`Show ${o.length-3} more entities`,children:A?"Show less":`+${o.length-3} more`}),_&&e.jsx("div",{style:{fontSize:"10px",color:"#005C75",marginTop:"4px"},children:_})]}):e.jsxs("div",{children:[n.entityNames&&n.entityNames.length>0?e.jsxs("div",{className:"space-y-0.5",children:[n.entityNames.slice(0,5).map((s,f)=>e.jsx("div",{style:{fontSize:"11px",color:"#343434"},children:s},f)),n.entityNames.length>5&&e.jsxs("div",{className:"italic",style:{fontSize:"10px",color:"#666"},children:["+",n.entityNames.length-5," ","more"]})]}):e.jsxs("div",{style:{fontSize:"11px",color:"#343434"},children:["Analyzing"," ",((X=n.entityShas)==null?void 0:X.length)||0," ",((K=n.entityShas)==null?void 0:K.length)===1?"entity":"entities","..."]}),_&&e.jsx("div",{style:{fontSize:"10px",color:"#005C75",marginTop:"4px"},children:_})]})})]}),l.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(Be,{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:l.map(s=>{var T,$;const f=p.has(s.id),h=f?s.entities:s.entities.slice(0,3);return e.jsx("div",{className:"rounded p-2",style:{backgroundColor:"#f5f5f5"},children:s.entities.length>0?e.jsxs("div",{className:"space-y-1.5",children:[h.map(w=>e.jsx(J,{entity:w,nameSize:"10px",pathSize:"9px",pathMaxLength:120},w.sha)),s.entities.length>3&&e.jsx("button",{onClick:()=>{L(w=>{const I=new Set(w);return I.has(s.id)?I.delete(s.id):I.add(s.id),I})},className:"cursor-pointer bg-transparent border-none p-0 hover:underline",style:Y,"aria-label":f?"Show fewer entities":`Show ${s.entities.length-3} more entities`,children:f?"Show less":`+${s.entities.length-3} more`})]}):e.jsxs("div",{style:{fontSize:"10px",color:"#343434"},children:[s.type==="analysis"&&e.jsx(e.Fragment,{children:s.entityNames&&s.entityNames.length>0?e.jsxs("div",{className:"space-y-0.5",children:[s.entityNames.slice(0,5).map((w,I)=>e.jsx("div",{children:w},I)),s.entityNames.length>5&&e.jsxs("div",{className:"italic",children:["+",s.entityNames.length-5," more"]})]}):`Analyzing ${((T=s.entityShas)==null?void 0:T.length)||0} ${(($=s.entityShas)==null?void 0:$.length)===1?"entity":"entities"}`}),s.type==="recapture"&&"Recapturing scenario",s.type==="debug-setup"&&"Setting up debug environment"]})},s.id)})})]}),ne&&H.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx(Te,{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:H.slice(0,3).map((s,f)=>{const h=s.entities||[],T=s.analysisCompletedAt||s.archivedAt||s.createdAt||"",$=(()=>{if(!T)return"";const k=Date.now()-new Date(T).getTime(),v=Math.floor(k/6e4),V=Math.floor(k/36e5);return V>0?`${V}h ago`:v>0?`${v}m ago`:"just now"})(),w=F.has(f),ie=(w?h:h.slice(0,3)).map(k=>{var v,V,Z;return{...k,scenarioCount:((Z=(V=(v=k.analyses)==null?void 0:v[0])==null?void 0:V.scenarios)==null?void 0:Z.length)||0}});return e.jsx("div",{className:"rounded p-2",style:{backgroundColor:"#f5f5f5"},children:h.length>0&&e.jsxs("div",{className:"space-y-1.5",children:[ie.map((k,v)=>e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx(J,{entity:k,nameSize:"10px",pathSize:"9px",pathMaxLength:100,showScenarioCount:!0,scenarioCount:k.scenarioCount})}),v===0&&$&&e.jsx("div",{style:{fontSize:"9px",color:"#8E8E8E",whiteSpace:"nowrap",paddingTop:"2px"},children:$})]},k.sha)),h.length>3&&e.jsx("button",{onClick:()=>{W(k=>{const v=new Set(k);return v.has(f)?v.delete(f):v.add(f),v})},className:"cursor-pointer bg-transparent border-none p-0 hover:underline",style:Y,"aria-label":w?"Show fewer entities":`Show ${h.length-3} more entities`,children:w?"Show less":`+${h.length-3} more`})]})},f)})})]})]}),e.jsx("div",{style:{height:"1px",backgroundColor:"#E0E9EC",margin:"0 12px"}}),e.jsx("div",{className:"px-3 pb-2",children:e.jsx(U,{to:"/activity",className:"text-xs font-medium hover:underline cursor-pointer",style:{color:"#005C75"},children:"View All Activity →"})})]})]}),N&&i&&e.jsx(Se,{projectSlug:i,onClose:()=>C(!1)})]})}const Ze="/assets/globals-CLmFdUae.css";function te({text:t,subtext:i,linkText:a,linkTo:d}){const[c,l]=r.useState(!1);return c?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:i})]}),e.jsx(U,{to:d,className:"shrink-0 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded hover:bg-blue-700 transition-colors",children:a})]}),e.jsx("button",{type:"button",onClick:()=>l(!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"})})})]})})}function et({version:t}){return e.jsx("div",{className:"px-6 sm:px-12 pb-8 mt-auto pt-8",children:e.jsxs("div",{className:"border-t border-cygray-30 pt-6 flex flex-wrap justify-between items-center gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"font-mono text-sm font-semibold tracking-widest text-cyblack-100",children:"CODEYAM"}),t&&e.jsx("span",{className:"font-mono text-xs text-gray-400",children:t})]}),e.jsxs("div",{className:"flex items-center gap-4 font-mono text-xs uppercase tracking-widest",children:[e.jsx("a",{href:"https://blog.codeyam.com/",target:"_blank",rel:"noopener noreferrer",className:"text-cyblack-100 underline underline-offset-4 hover:text-primary-100",children:"Read the Blog"}),e.jsx("span",{className:"text-cygray-30",children:"|"}),e.jsx("a",{href:"https://discord.gg/x4uAgaRdwF",target:"_blank",rel:"noopener noreferrer",className:"text-cyblack-100 underline underline-offset-4 hover:text-primary-100",children:"Join Discord"})]})]})})}function tt({serverVersion:t}){const[i,a]=r.useState("stale"),[d,c]=r.useState(null),l=async()=>{a("restarting"),c(null);try{if(!(await fetch("/api/restart-server",{method:"POST"})).ok)throw new Error("Failed to restart server");a("reconnecting");let g=0;const N=30,C=1e3,x=async()=>{try{if((await fetch("/api/health")).ok){window.location.reload();return}}catch{}g++,g<N?setTimeout(()=>void x(),C):(c("Server took too long to restart. Please refresh manually."),a("stale"))};setTimeout(()=>void x(),500)}catch(n){c(n instanceof Error?n.message:"Failed to restart server"),a("stale")}};return e.jsx("div",{className:"bg-amber-100 border rounded border-amber-700 shadow-sm mx-6 mt-6",children:e.jsx("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-amber-600",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),e.jsxs("div",{className:"flex-1",children:[i==="stale"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm font-medium text-amber-900",children:"Dashboard server is out of date"}),e.jsxs("p",{className:"text-xs text-amber-700 mt-0.5",children:["Server version: ",t,". A newer version of CodeYam CLI is installed. Restart the server to get the latest features."]}),d&&e.jsx("p",{className:"text-xs text-red-600 mt-1",children:d})]}),i==="restarting"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm font-medium text-amber-900",children:"Restarting server..."}),e.jsx("p",{className:"text-xs text-amber-700 mt-0.5",children:"Please wait while the server restarts."})]}),i==="reconnecting"&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-sm font-medium text-amber-900",children:"Reconnecting..."}),e.jsx("p",{className:"text-xs text-amber-700 mt-0.5",children:"Waiting for the server to come back online."})]})]}),i==="stale"&&e.jsx("button",{type:"button",onClick:()=>void l(),className:"shrink-0 px-4 py-2 bg-amber-600 text-white text-sm font-medium rounded hover:bg-amber-700 transition-colors cursor-pointer",children:"Restart Server"}),(i==="restarting"||i==="reconnecting")&&e.jsxs("div",{className:"shrink-0 flex items-center gap-2 px-4 py-2 text-amber-700 text-sm",children:[e.jsxs("svg",{className:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),i==="restarting"?"Stopping...":"Reconnecting..."]})]})})})}function st({currentVersion:t,latestVersion:i}){const[a,d]=r.useState(!1);if(a)return null;const c="npm install -g @codeyam/codeyam-cli@latest && codeyam stop && codeyam";return e.jsx("div",{className:"bg-emerald-100 border rounded border-emerald-700 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-emerald-600",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{d:"M7 11l5-5m0 0l5 5m-5-5v12"})})}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-sm font-medium text-emerald-900",children:"A new version of CodeYam CLI is available"}),e.jsxs("p",{className:"text-xs text-emerald-700 mt-0.5",children:["Current: ",t," → Latest: ",i]})]}),e.jsxs("div",{className:"shrink-0 flex items-center gap-2",children:[e.jsx("code",{className:"text-xs bg-emerald-200 text-emerald-900 px-2 py-1.5 rounded font-mono",children:c}),e.jsx(Me,{content:c,label:"Copy",copiedLabel:"Copied!",className:"px-3 py-1.5 bg-emerald-600 text-white text-xs font-medium rounded hover:bg-emerald-700 transition-colors"})]})]}),e.jsx("button",{type:"button",onClick:()=>d(!0),className:"shrink-0 ml-4 p-1 rounded text-emerald-600 hover:text-emerald-800 hover:bg-emerald-200 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 kt=()=>[{rel:"stylesheet",href:Ze},{rel:"icon",type:"image/x-icon",href:"/favicon.ico"}];function nt(){const{currentRun:t,projectSlug:i,currentEntities:a,availableAPIKeys:d,queuedJobCount:c,queueJobs:l,currentlyExecuting:n,historicalRuns:g,isServerOutOfDate:N,serverVersion:C,npmUpdate:x,labs:S,simulationsEnabled:u,isSimulationsReady:B,isAdmin:p,displayVersion:L}=he(),{toasts:F,closeToast:W}=we(),A=xe(),E=r.useRef(A),j=se();r.useEffect(()=>{E.current=A},[A]);const D=j.pathname.startsWith("/entity/")&&j.pathname.includes("/edit/")||j.pathname.startsWith("/dev/"),o=j.pathname.includes("/fullscreen");return r.useEffect(()=>{const y=new EventSource("/api/events");let m=null,b=0;const O=2e3;return y.addEventListener("message",P=>{const _=JSON.parse(P.data);if(_.type==="queue")E.current.revalidate(),b=Date.now();else if(_.type==="db-change"||_.type==="unknown"){const z=Date.now(),R=z-b;R<O?(m&&clearTimeout(m),m=setTimeout(()=>{E.current.revalidate(),b=Date.now(),m=null},O-R)):(E.current.revalidate(),b=z)}}),y.addEventListener("error",P=>{console.error("SSE connection error:",P)}),()=>{m&&clearTimeout(m),y.close()}},[]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:`min-h-screen ${D?"":"grid"} bg-cygray-10`,style:D?void 0:{gridTemplateColumns:"65px minmax(0, 1fr)"},children:[!D&&e.jsx(Ge,{labs:S,isAdmin:p}),e.jsxs("div",{className:"bg-cygray-10 flex flex-col min-h-screen",children:[N&&e.jsx(tt,{serverVersion:C}),x&&x.currentVersion&&e.jsx(st,{currentVersion:x.currentVersion,latestVersion:x.latestVersion}),u&&d.length===0&&e.jsx(te,{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"}),u&&!B&&e.jsx(te,{text:"Simulations enabled but not yet configured",subtext:"Run /codeyam-setup in Claude Code to install the analyzer and configure your dev server",linkText:"View Labs",linkTo:"/labs"}),e.jsx("div",{className:"flex-1",children:e.jsx(pe,{})}),e.jsx(et,{version:L})]})]}),e.jsx(Xe,{toasts:F,onClose:W}),!o&&u&&e.jsx(Ke,{currentRun:t,projectSlug:i,currentEntities:a,isAnalysisStarting:!1,queuedJobCount:c,queueJobs:l,currentlyExecuting:n,historicalRuns:g})]})}const Ct=re(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(le,{}),e.jsx(ce,{})]}),e.jsxs("body",{children:[e.jsx(Ce,{children:e.jsx(be,{children:e.jsx(nt,{})})}),e.jsx(de,{}),e.jsx(me,{})]})]})});export{Ct as default,kt as links};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{w as ge,u as be,e as ye,c as fe,f as je,r,j as e}from"./chunk-JZWAC4HX-7VptmeIr.js";import{u as ve}from"./useReportContext-BsQb6rFd.js";import{C as Ne}from"./CopyButton-CtmbP4Gl.js";import"./copy-6nzYCu0G.js";import"./createLucideIcon-D-QUFOwe.js";const Pe=()=>[{title:"Settings - CodeYam"},{name:"description",content:"Configure project settings"}];function X(d){if(!d)return"";const t=[d.command];return d.args&&d.args.length>0&&t.push(...d.args),t.join(" ")}function Z({mock:d,onSave:t,onCancel:o}){const[i,b]=r.useState(d.entityName),[h,c]=r.useState(d.filePath),[n,y]=r.useState(d.content),m=()=>{if(!i.trim()||!h.trim()||!n.trim()){alert("All fields are required");return}t({entityName:i,filePath:h,content:n})};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:x=>b(x.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:h,onChange:x=>c(x.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:n,onChange:x=>y(x.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:o,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:m,className:"px-4 py-2 bg-[#005C75] text-white border-none rounded text-sm cursor-pointer hover:bg-[#004a5d]",children:"Save"})]})]})}function we(d){try{return new Date(d).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"2-digit"})}catch{return d}}const Ie=ge(function(){var G,Y,H,U,B;const{config:t,secrets:o,versionInfo:i,simulationsEnabled:b,error:h}=be(),c=ye(),n=fe(),y=je(),[m,x]=r.useState(b?"project-metadata":"memory");ve({source:"settings-page"});const[u,f]=r.useState((t==null?void 0:t.universalMocks)||[]),[N,P]=r.useState(((t==null?void 0:t.pathsToIgnore)||[]).join(", ")),[I,ee]=r.useState(((t==null?void 0:t.pathsToIgnore)||[]).join(", ")),[se,K]=r.useState((o==null?void 0:o.GROQ_API_KEY)||""),[te,R]=r.useState((o==null?void 0:o.ANTHROPIC_API_KEY)||""),[ae,T]=r.useState((o==null?void 0:o.OPENAI_API_KEY)||""),[w,re]=r.useState(!1),[C,ne]=r.useState(!1),[k,ie]=r.useState(!1),[E,j]=r.useState(!1),[_,oe]=r.useState(!1),[q,F]=r.useState(!1),[le,S]=r.useState(null),[de,v]=r.useState(!1),[A,O]=r.useState({}),[p,$]=r.useState(((G=t==null?void 0:t.memory)==null?void 0:G.conversationReflection)??!0),[g,D]=r.useState(((Y=t==null?void 0:t.memory)==null?void 0:Y.ruleMaintenance)??!0),[M,V]=r.useState(((H=t==null?void 0:t.memory)==null?void 0:H.promptModel)??"haiku");r.useEffect(()=>{var s,a,l,L;if(t){f(t.universalMocks||[]);const W=(t.pathsToIgnore||[]).join(", ");P(W),ee(W);const J={};(s=t.webapps)==null||s.forEach((Q,pe)=>{Q.startCommand&&(J[pe]=X(Q.startCommand))}),O(J),$(((a=t.memory)==null?void 0:a.conversationReflection)??!0),D(((l=t.memory)==null?void 0:l.ruleMaintenance)??!0),V(((L=t.memory)==null?void 0:L.promptModel)??"haiku")}o&&(K(o.GROQ_API_KEY||""),R(o.ANTHROPIC_API_KEY||""),T(o.OPENAI_API_KEY||""))},[t,o]),r.useEffect(()=>{if(c!=null&&c.success){j(!0);const s=setTimeout(()=>j(!1),3e3);return()=>clearTimeout(s)}},[c]),r.useEffect(()=>{if(n.state==="idle"&&n.data&&!q){console.log("[Settings] Fetcher data:",n.data);const s=n.data;if(s.success){console.log("[Settings] Save successful, revalidating..."),j(!0),F(!0),(N!==I||s.requiresRestart)&&oe(!0),y.revalidate();const a=setTimeout(()=>{j(!1),F(!1)},3e3);return()=>clearTimeout(a)}}},[n.state,n.data,q,y,N,I]);const ce=s=>{s.preventDefault();const a=new FormData(s.currentTarget);a.set("universalMocks",JSON.stringify(u)),a.set("startCommands",JSON.stringify(A)),a.set("memorySettings",JSON.stringify({conversationReflection:p,ruleMaintenance:g,promptModel:M})),console.log("[Settings] Submitting form data:",{universalMocks:a.get("universalMocks"),startCommands:a.get("startCommands"),openAiApiKey:a.get("openAiApiKey")?"***":"(empty)"}),n.submit(a,{method:"post"})},me=s=>{f([...u,s]),v(!1)},xe=(s,a)=>{const l=[...u];l[s]=a,f(l),S(null)},ue=s=>{f(u.filter((a,l)=>l!==s))};if(h)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:h})})]});const z=[{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:"memory",label:"Memory"},{id:"current-configuration",label:"Current Configuration"}],he=b?z:z.filter(s=>s.id==="memory");return e.jsx("div",{className:"bg-[#F8F7F6] min-h-screen",children:e.jsxs("div",{className:"px-6 sm:px-12 lg:px-20 pt-8 pb-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-[28px] font-semibold text-gray-900 mb-2",children:"Settings"}),e.jsx("p",{className:"text-[15px] text-gray-500",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||_||(c==null?void 0:c.error)||n.data&&typeof n.data=="object"&&"error"in n.data)&&e.jsxs("div",{className:"mb-4 space-y-3",children:[E&&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!"}),_&&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.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx("code",{className:"bg-amber-100 px-2 py-1 rounded text-xs",children:"codeyam stop && codeyam"}),e.jsx(Ne,{content:"codeyam stop && codeyam",className:"px-2 py-1 text-xs bg-amber-200 hover:bg-amber-300 text-amber-800 rounded border-none transition-colors"})]})]}),(c==null?void 0:c.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:c.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})()]}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 lg:gap-8 items-start",children:[e.jsx("nav",{className:"w-full lg:w-64 flex-shrink-0",children:e.jsx("ul",{className:"flex lg:flex-col overflow-x-auto gap-1",children:he.map(s=>e.jsx("li",{children:e.jsx("button",{type:"button",onClick:()=>x(s.id),className:`w-full text-left px-3 lg:px-0 py-2.5 text-sm transition-colors cursor-pointer whitespace-nowrap ${m===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:ce,className:"space-y-6",children:[m==="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"}),t!=null&&t.webapps&&t.webapps.length>0?e.jsx("div",{className:"space-y-3",children:t.webapps.map((s,a)=>{var l;return 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," ",(l=s.startCommand.args)==null?void 0:l.join(" ")]})]})]})},a)})}):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`."})]})]}),m==="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 flex-wrap gap-2 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:w?"text":"password",id:"groqApiKey",name:"groqApiKey",value:se,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:()=>re(!w),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 cursor-pointer",children:w?"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 flex-wrap gap-2 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:C?"text":"password",id:"anthropicApiKey",name:"anthropicApiKey",value:te,onChange:s=>R(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:()=>ne(!C),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 cursor-pointer",children:C?"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 flex-wrap gap-2 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:k?"text":"password",id:"openAiApiKey",name:"openAiApiKey",value:ae,onChange:s=>T(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:()=>ie(!k),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 cursor-pointer",children:k?"Hide":"Show"})]})]})]})]})]}),m==="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"}),t!=null&&t.webapps&&t.webapps.length>0?e.jsx("div",{className:"space-y-4",children:t.webapps.map((s,a)=>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-${a}`,className:"block text-sm font-medium text-gray-700 mb-2",children:"Start Command"}),e.jsx("input",{type:"text",id:`startCommand-${a}`,name:`startCommand-${a}`,value:A[a]||"",onChange:l=>O({...A,[a]:l.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"})]})]},a))}):e.jsx("p",{className:"text-sm text-gray-600 italic",children:"No web applications configured"})]}),m==="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:N,onChange:s=>P(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"})]})]}),m==="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"}),u.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:()=>v(!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:u.map((s,a)=>e.jsx("div",{className:"p-4 bg-gray-50 rounded border border-gray-200",children:le===a?e.jsx(Z,{mock:s,onSave:l=>xe(a,l),onCancel:()=>S(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:()=>S(a),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:()=>ue(a),className:"px-3 py-1 bg-red-600 text-white border-none rounded text-sm cursor-pointer hover:bg-red-700",children:"Delete"})]})]})})},a))}),u.length>0&&e.jsx("button",{type:"button",onClick:()=>v(!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"})]}),m==="memory"&&e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800 mb-4",children:"Memory"}),e.jsx("p",{className:"text-sm text-gray-600 mb-6",children:"Configure how CodeYam reflects on conversations and maintains rules between sessions."}),e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"border border-gray-200 rounded-lg p-5 bg-white",children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1 mr-4",children:[e.jsx("h4",{className:"text-base font-semibold text-gray-900 mb-1",children:"Conversation Reflection"}),e.jsx("p",{className:"text-sm text-gray-600",children:"After each conversation, an agent reviews the session for architectural decisions, tribal knowledge, confusion, or corrections that future sessions would benefit from knowing. It creates or updates Claude Rules based on what it learns."})]}),e.jsx("button",{type:"button",role:"switch","aria-checked":p,onClick:()=>$(!p),className:`relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none ${p?"bg-[#005C75]":"bg-gray-200"}`,children:e.jsx("span",{className:`pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out ${p?"translate-x-5":"translate-x-0"}`})})]})}),e.jsx("div",{className:"border border-gray-200 rounded-lg p-5 bg-white",children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1 mr-4",children:[e.jsx("h4",{className:"text-base font-semibold text-gray-900 mb-1",children:"Rule Maintenance"}),e.jsx("p",{className:"text-sm text-gray-600",children:"After each conversation, an agent checks if any existing Claude Rules have become stale based on recent code changes. It reviews the rule content against file diffs and updates rules that are out of date."})]}),e.jsx("button",{type:"button",role:"switch","aria-checked":g,onClick:()=>D(!g),className:`relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none ${g?"bg-[#005C75]":"bg-gray-200"}`,children:e.jsx("span",{className:`pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out ${g?"translate-x-5":"translate-x-0"}`})})]})}),e.jsxs("div",{className:"border border-gray-200 rounded-lg p-5 bg-white",children:[e.jsx("h4",{className:"text-base font-semibold text-gray-900 mb-1",children:"Memory Prompt Model"}),e.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"Choose the Claude model used for conversation reflection and rule maintenance tasks."}),e.jsx("div",{className:"space-y-3",children:[{value:"haiku",label:"Haiku",badge:"Default, Recommended",description:"Fastest and cheapest. Good for routine reflection tasks."},{value:"sonnet",label:"Sonnet",badge:null,description:"Balanced speed and quality. Better at nuanced rule writing."},{value:"opus",label:"Opus",badge:null,description:"Highest quality. Best for complex architectural decisions. Costs significantly more."}].map(s=>e.jsxs("label",{className:`flex items-start gap-3 p-3 rounded-lg border cursor-pointer transition-colors ${M===s.value?"border-[#005C75] bg-[#005C75]/5":"border-gray-200 hover:border-gray-300"}`,children:[e.jsx("input",{type:"radio",name:"promptModel",value:s.value,checked:M===s.value,onChange:()=>V(s.value),className:"mt-1 accent-[#005C75]"}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-gray-900",children:s.label}),s.badge&&e.jsx("span",{className:"px-2 py-0.5 bg-green-100 text-green-800 rounded text-xs",children:s.badge})]}),e.jsx("p",{className:"text-sm text-gray-600 mt-0.5",children:s.description})]})]},s.value))})]})]})]}),m==="current-configuration"&&e.jsxs("div",{className:"space-y-6",children:[t&&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:[t.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:t.projectSlug})]}),t.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:t.packageManager})]})]})}),t.webapps&&t.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:t.webapps.map((s,a)=>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:X(s.startCommand)})]})]})},a))})]})]}),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||((U=i.templateVersion.gitCommit)==null?void 0:U.slice(0,7))||"unknown"}),i.templateVersion.buildTimestamp&&e.jsxs("span",{className:"text-gray-500 ml-2",children:["(built"," ",we(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||((B=i.cachedAnalyzerVersion.gitCommit)==null?void 0:B.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&&(t==null?void 0:t.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"})]})]})})]})]})]})})]}),de&&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(Z,{mock:{entityName:"",filePath:"",content:""},onSave:me,onCancel:()=>v(!1)})]})})]})})});export{Ie as default,Pe as meta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{w as R,u as $,r as l,j as e,a as B,c as D,L as F}from"./chunk-JZWAC4HX-DB3aFuEO.js";import{u as O}from"./useReportContext-DZlYx2c4.js";import{S as U}from"./SafeScreenshot-CwZrv-Ok.js";import{L as V}from"./LoadingDots-BvMu2i-g.js";import{E as P}from"./EntityTypeIcon-BH0XDim7.js";import{g as Y,a as Q,f as q}from"./fileTableUtils-9sMMAiWJ.js";import{C as J}from"./chevron-down-CG65viiV.js";import{S as K}from"./search-DcAwD_Ln.js";import{L as W}from"./loader-circle-TzRHMVog.js";import"./createLucideIcon-D1zB-pYc.js";const ie=()=>[{title:"Simulations - CodeYam"},{name:"description",content:"A visual gallery of your recently captured component screenshots"}],ce=R(function(){const i=$(),c=i.entities,x=i.queueState;O({source:"simulations-page"});const[n,u]=l.useState(""),[d,S]=l.useState("visual"),g=l.useMemo(()=>{const a=[];return c.forEach(t=>{var y;const r=(y=t.analyses)==null?void 0:y[0];if(r!=null&&r.scenarios){const b=r.scenarios.filter(o=>{var m;return!((m=o.metadata)!=null&&m.sameAsDefault)}).map(o=>{var z,k,A,L,E;const m=(k=(z=o.metadata)==null?void 0:z.screenshotPaths)==null?void 0:k[0],N=(A=o.metadata)==null?void 0:A.noScreenshotSaved,M=m&&!N,T=(E=(L=r.status)==null?void 0:L.scenarios)==null?void 0:E.find(H=>H.name===o.name),I=T&&T.screenshotStartedAt&&!T.screenshotFinishedAt;let w;return M?w="completed":I?w="capturing":w="error",{scenarioName:o.name,scenarioDescription:o.description||"",screenshotPath:m||"",scenarioId:o.id,state:w}}).filter(o=>o.state==="completed"||o.state==="capturing");b.length>0&&a.push({entity:t,screenshots:b,createdAt:r.createdAt||""})}}),a.sort((t,r)=>new Date(r.createdAt).getTime()-new Date(t.createdAt).getTime()),a},[c]),v=l.useMemo(()=>c.filter(a=>{var y,b;const t=(y=a.analyses)==null?void 0:y[0];return!((b=t==null?void 0:t.scenarios)==null?void 0:b.some(o=>{var m,N;return(N=(m=o.metadata)==null?void 0:m.screenshotPaths)==null?void 0:N[0]}))}),[c]),p=l.useMemo(()=>g.filter(({entity:a})=>{const t=!n||a.name.toLowerCase().includes(n.toLowerCase()),r=d==="all"||a.entityType===d;return t&&r}),[g,n,d]),f=l.useMemo(()=>v.filter(a=>{const t=!n||a.name.toLowerCase().includes(n.toLowerCase()),r=d==="all"||a.entityType===d;return t&&r}),[v,n,d]),C=l.useCallback(a=>{u(a.target.value)},[]),j=l.useCallback(a=>{S(a.target.value)},[]),h=g.length>0;return e.jsx("div",{className:"bg-[#F8F7F6] min-h-screen overflow-y-auto",children:e.jsxs("div",{className:"px-20 py-12",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-[28px] font-semibold text-gray-900 mb-2",children:"Simulations"}),e.jsx("p",{className:"text-[15px] text-gray-500",children:"A visual gallery of your recently captured simulations."})]}),!h&&e.jsx("div",{className:"bg-[#D1F3F9] border border-[#A5E8F0] rounded-lg p-4 mb-6",children:e.jsxs("p",{className:"text-sm text-gray-700 m-0",children:["This page will display a visual gallery of your recently captured component simulations."," ",e.jsx("strong",{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-3",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 pr-8 text-[13px] h-[39px] cursor-pointer focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] hover:border-gray-300 transition-colors",value:d,onChange:j,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(J,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-3 h-3 text-gray-500 pointer-events-none"})]}),e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(K,{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 text-[13px] h-[39px] placeholder:text-gray-400 focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] transition-colors",value:n,onChange:C})]})]})]}),h&&p.length>0&&e.jsx("div",{className:"mb-2",children:e.jsxs("div",{className:"flex items-center py-3",children:[e.jsxs("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#8b8b8b",fontWeight:500,letterSpacing:"0.05em"},children:[e.jsx("span",{style:{color:"#000000"},children:p.length})," ",p.length===1?"entity":"entities"]}),e.jsxs("div",{className:"relative group inline-flex items-center ml-1.5",children:[e.jsx("svg",{className:"w-3 h-3 text-gray-400 cursor-help",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),e.jsx("div",{className:"absolute left-0 top-full mt-2 hidden group-hover:block z-50 w-80",children:e.jsxs("div",{className:"bg-gray-900 text-white text-xs rounded-lg px-3 py-2 shadow-lg",children:["In CodeYam, an entity is a discrete, analyzable unit of code that can be independently simulated and tested.",e.jsx("div",{className:"absolute -top-1 left-4 w-2 h-2 bg-gray-900 transform rotate-45"})]})})]}),e.jsx("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#d1d5db",fontWeight:500,letterSpacing:"0.05em",marginLeft:"8px"},children:"|"}),e.jsxs("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#8b8b8b",fontWeight:500,letterSpacing:"0.05em",marginLeft:"8px"},children:[e.jsx("span",{style:{color:"#000000"},children:p.reduce((a,{screenshots:t})=>a+t.length,0)})," ","scenarios"]})]})}),e.jsxs("div",{className:"flex flex-col gap-3",children:[h&&(p.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:p.map(({entity:a,screenshots:t})=>e.jsx(G,{entity:a,screenshots:t,queueJobs:(x==null?void 0:x.jobs)||[]},a.sha))})),!h&&(f.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."}):f.map(a=>e.jsx(X,{entity:a},a.sha)))]})]})})});function G({entity:s,screenshots:i,queueJobs:c}){var j,h,a;const x=B(),n=D(),[u,d]=l.useState(!1),S=i.length||(((a=(h=(j=s.analyses)==null?void 0:j[0])==null?void 0:h.scenarios)==null?void 0:a.length)??0),g=t=>{x(`/entity/${s.sha}/scenarios/${t}?from=simulations`)},v=()=>{d(!0),n.submit({entitySha:s.sha,filePath:s.filePath||""},{method:"post",action:"/api/analyze"})};l.useEffect(()=>{n.state==="idle"&&u&&d(!1)},[n.state,u]);const p=Y(s,c),f=Q(p),C=p==="out-of-date";return e.jsx("div",{className:"rounded-[8px]",style:{backgroundColor:"#ffffff",border:"1px solid #e1e1e1"},children:e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center px-[15px] py-[15px]",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx(P,{type:s.entityType||"other",size:"large"})}),e.jsxs("div",{className:"flex flex-col flex-shrink-0",style:{marginLeft:"15px",gap:"4px"},children:[e.jsxs("div",{className:"flex items-center gap-[5px]",children:[e.jsxs(F,{to:`/entity/${s.sha}`,className:"hover:underline cursor-pointer",title:s.name,style:{fontSize:"14px",lineHeight:"18px",color:"#343434",fontWeight:500},children:[s.name," (",S,")"]}),e.jsx("div",{className:"flex items-center justify-center px-2 rounded",style:{height:"20px",backgroundColor:f.bgColor,color:f.textColor,fontSize:"12px",lineHeight:"16px",fontWeight:400},children:f.text})]}),e.jsx("div",{style:{fontSize:"12px",lineHeight:"15px",color:"#b0b0b0",fontWeight:400},className:"font-mono",title:s.filePath,children:s.filePath})]}),e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"flex-shrink-0 flex items-center gap-2",children:[C&&e.jsx(e.Fragment,{children:u||n.state!=="idle"?e.jsxs("div",{className:"px-2 py-1 bg-pink-100 rounded flex items-center gap-1.5",children:[e.jsx(W,{size:14,className:"animate-spin",style:{color:"#be185d"}}),e.jsx("span",{style:{color:"#be185d",fontSize:"10px",lineHeight:"20px",fontWeight:600},children:"Analyzing..."})]}):e.jsx("button",{onClick:v,className:"px-[10px] rounded transition-colors whitespace-nowrap",style:{backgroundColor:"#005c75",color:"#ffffff",fontSize:"10px",lineHeight:"22px",fontWeight:600},onMouseEnter:t=>{t.currentTarget.style.backgroundColor="#004d5e"},onMouseLeave:t=>{t.currentTarget.style.backgroundColor="#005c75"},children:"Re-analyze"})}),e.jsx("button",{onClick:()=>void x(`/entity/${s.sha}/logs`),className:"px-[10px] rounded transition-colors whitespace-nowrap",style:{backgroundColor:"#e0e9ec",color:"#005c75",fontSize:"10px",lineHeight:"22px",fontWeight:600},onMouseEnter:t=>{t.currentTarget.style.backgroundColor="#d0dfe3"},onMouseLeave:t=>{t.currentTarget.style.backgroundColor="#e0e9ec"},children:"View Logs"})]})]}),e.jsx("div",{className:"border-t border-gray-200"}),e.jsx("div",{className:"flex gap-2.5 overflow-x-auto pb-3 px-[15px] pt-3",style:{paddingLeft:"47px"},children:i.length>0?i.map(t=>e.jsxs("div",{className:"shrink-0 flex flex-col gap-2",children:[e.jsx("button",{onClick:()=>g(t.scenarioId||""),className:"block cursor-pointer bg-transparent border-none p-0",children:e.jsx("div",{className:"w-36 h-24 rounded-md border overflow-hidden flex items-center justify-center transition-all",style:{"--hover-border":"#005C75",backgroundColor:t.state==="capturing"?"#f9f9f9":"#f3f4f6",borderColor:t.state==="capturing"?"#efefef":"#d1d5db"},onMouseEnter:r=>{t.state==="completed"&&(r.currentTarget.style.borderColor="#005C75",r.currentTarget.style.boxShadow="0 4px 12px rgba(0, 92, 117, 0.15)")},onMouseLeave:r=>{r.currentTarget.style.borderColor=t.state==="capturing"?"#efefef":"#d1d5db",r.currentTarget.style.boxShadow="none"},children:t.state==="completed"?e.jsx(U,{screenshotPath:t.screenshotPath,alt:t.scenarioName,className:"max-w-full max-h-full object-contain"}):t.state==="capturing"?e.jsx(V,{size:"medium"}):null})}),e.jsxs("div",{className:"relative group",children:[e.jsx("div",{className:"text-left text-xs text-gray-600 cursor-default",style:{fontSize:"11px",lineHeight:"14px",maxWidth:"144px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.scenarioName}),e.jsx("div",{className:"fixed hidden group-hover:block pointer-events-none",style:{zIndex:1e4,transform:"translateY(8px)"},children:e.jsxs("div",{className:"bg-gray-100 text-gray-800 text-xs rounded-lg px-3 py-2 shadow-lg max-w-xs border border-gray-200",children:[t.scenarioName,t.scenarioDescription&&e.jsxs(e.Fragment,{children:[": ",t.scenarioDescription]}),e.jsx("div",{className:"absolute -top-1 left-4 w-2 h-2 bg-gray-100 border-l border-t border-gray-200 transform rotate-45"})]})})]})]},t.scenarioId)):e.jsx("div",{className:"text-xs text-gray-400 py-4",children:"No screenshots available"})})]})})}function X({entity:s}){const i=D(),[c,x]=l.useState(!1),n=()=>{x(!0),i.submit({entitySha:s.sha,filePath:s.filePath||""},{method:"post",action:"/api/analyze"})};return l.useEffect(()=>{i.state==="idle"&&c&&x(!1)},[i.state,c]),e.jsx("div",{className:"bg-white rounded hover:bg-gray-100 transition-colors cursor-pointer border-b border-[#e1e1e1]",onClick:n,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(P,{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(F,{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:q(s.createdAt||null)}),e.jsx("div",{className:"w-24 flex justify-end",children:c||i.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(W,{size:14,className:"animate-spin"}),"Analyzing..."]}):e.jsx("button",{onClick:n,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{ce as default,ie as meta};
|
|
1
|
+
import{w as R,u as $,r as l,j as e,a as B,c as D,L as F}from"./chunk-JZWAC4HX-7VptmeIr.js";import{u as O}from"./useReportContext-BsQb6rFd.js";import{S as U}from"./SafeScreenshot-CG2uh31y.js";import{L as V}from"./LoadingDots-CSP6DZrh.js";import{E as P}from"./EntityTypeIcon-DN9eiJAO.js";import{g as Y,a as Q,f as q}from"./fileTableUtils-EWpfFU4X.js";import{C as J}from"./chevron-down-DQJA9f4o.js";import{S as K}from"./search-DborVoKD.js";import{L as W}from"./loader-circle-BnDcD54R.js";import"./createLucideIcon-D-QUFOwe.js";const ie=()=>[{title:"Simulations - CodeYam"},{name:"description",content:"A visual gallery of your recently captured component screenshots"}],ce=R(function(){const i=$(),c=i.entities,x=i.queueState;O({source:"simulations-page"});const[n,u]=l.useState(""),[d,S]=l.useState("visual"),g=l.useMemo(()=>{const a=[];return c.forEach(t=>{var y;const r=(y=t.analyses)==null?void 0:y[0];if(r!=null&&r.scenarios){const b=r.scenarios.filter(o=>{var m;return!((m=o.metadata)!=null&&m.sameAsDefault)}).map(o=>{var z,k,A,L,E;const m=(k=(z=o.metadata)==null?void 0:z.screenshotPaths)==null?void 0:k[0],N=(A=o.metadata)==null?void 0:A.noScreenshotSaved,M=m&&!N,T=(E=(L=r.status)==null?void 0:L.scenarios)==null?void 0:E.find(H=>H.name===o.name),I=T&&T.screenshotStartedAt&&!T.screenshotFinishedAt;let w;return M?w="completed":I?w="capturing":w="error",{scenarioName:o.name,scenarioDescription:o.description||"",screenshotPath:m||"",scenarioId:o.id,state:w}}).filter(o=>o.state==="completed"||o.state==="capturing");b.length>0&&a.push({entity:t,screenshots:b,createdAt:r.createdAt||""})}}),a.sort((t,r)=>new Date(r.createdAt).getTime()-new Date(t.createdAt).getTime()),a},[c]),v=l.useMemo(()=>c.filter(a=>{var y,b;const t=(y=a.analyses)==null?void 0:y[0];return!((b=t==null?void 0:t.scenarios)==null?void 0:b.some(o=>{var m,N;return(N=(m=o.metadata)==null?void 0:m.screenshotPaths)==null?void 0:N[0]}))}),[c]),p=l.useMemo(()=>g.filter(({entity:a})=>{const t=!n||a.name.toLowerCase().includes(n.toLowerCase()),r=d==="all"||a.entityType===d;return t&&r}),[g,n,d]),f=l.useMemo(()=>v.filter(a=>{const t=!n||a.name.toLowerCase().includes(n.toLowerCase()),r=d==="all"||a.entityType===d;return t&&r}),[v,n,d]),C=l.useCallback(a=>{u(a.target.value)},[]),j=l.useCallback(a=>{S(a.target.value)},[]),h=g.length>0;return e.jsx("div",{className:"bg-[#F8F7F6] min-h-screen overflow-y-auto",children:e.jsxs("div",{className:"px-20 py-12",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-[28px] font-semibold text-gray-900 mb-2",children:"Simulations"}),e.jsx("p",{className:"text-[15px] text-gray-500",children:"A visual gallery of your recently captured simulations."})]}),!h&&e.jsx("div",{className:"bg-[#D1F3F9] border border-[#A5E8F0] rounded-lg p-4 mb-6",children:e.jsxs("p",{className:"text-sm text-gray-700 m-0",children:["This page will display a visual gallery of your recently captured component simulations."," ",e.jsx("strong",{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-3",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 pr-8 text-[13px] h-[39px] cursor-pointer focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] hover:border-gray-300 transition-colors",value:d,onChange:j,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(J,{className:"absolute right-2 top-1/2 -translate-y-1/2 w-3 h-3 text-gray-500 pointer-events-none"})]}),e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(K,{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 text-[13px] h-[39px] placeholder:text-gray-400 focus:outline-none focus:ring-0 focus:border-2 focus:border-[#005c75] transition-colors",value:n,onChange:C})]})]})]}),h&&p.length>0&&e.jsx("div",{className:"mb-2",children:e.jsxs("div",{className:"flex items-center py-3",children:[e.jsxs("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#8b8b8b",fontWeight:500,letterSpacing:"0.05em"},children:[e.jsx("span",{style:{color:"#000000"},children:p.length})," ",p.length===1?"entity":"entities"]}),e.jsxs("div",{className:"relative group inline-flex items-center ml-1.5",children:[e.jsx("svg",{className:"w-3 h-3 text-gray-400 cursor-help",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),e.jsx("div",{className:"absolute left-0 top-full mt-2 hidden group-hover:block z-50 w-80",children:e.jsxs("div",{className:"bg-gray-900 text-white text-xs rounded-lg px-3 py-2 shadow-lg",children:["In CodeYam, an entity is a discrete, analyzable unit of code that can be independently simulated and tested.",e.jsx("div",{className:"absolute -top-1 left-4 w-2 h-2 bg-gray-900 transform rotate-45"})]})})]}),e.jsx("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#d1d5db",fontWeight:500,letterSpacing:"0.05em",marginLeft:"8px"},children:"|"}),e.jsxs("span",{className:"font-mono uppercase",style:{fontSize:"11px",color:"#8b8b8b",fontWeight:500,letterSpacing:"0.05em",marginLeft:"8px"},children:[e.jsx("span",{style:{color:"#000000"},children:p.reduce((a,{screenshots:t})=>a+t.length,0)})," ","scenarios"]})]})}),e.jsxs("div",{className:"flex flex-col gap-3",children:[h&&(p.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:p.map(({entity:a,screenshots:t})=>e.jsx(G,{entity:a,screenshots:t,queueJobs:(x==null?void 0:x.jobs)||[]},a.sha))})),!h&&(f.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."}):f.map(a=>e.jsx(X,{entity:a},a.sha)))]})]})})});function G({entity:s,screenshots:i,queueJobs:c}){var j,h,a;const x=B(),n=D(),[u,d]=l.useState(!1),S=i.length||(((a=(h=(j=s.analyses)==null?void 0:j[0])==null?void 0:h.scenarios)==null?void 0:a.length)??0),g=t=>{x(`/entity/${s.sha}/scenarios/${t}?from=simulations`)},v=()=>{d(!0),n.submit({entitySha:s.sha,filePath:s.filePath||""},{method:"post",action:"/api/analyze"})};l.useEffect(()=>{n.state==="idle"&&u&&d(!1)},[n.state,u]);const p=Y(s,c),f=Q(p),C=p==="out-of-date";return e.jsx("div",{className:"rounded-[8px]",style:{backgroundColor:"#ffffff",border:"1px solid #e1e1e1"},children:e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center px-[15px] py-[15px]",children:[e.jsx("div",{className:"flex-shrink-0",children:e.jsx(P,{type:s.entityType||"other",size:"large"})}),e.jsxs("div",{className:"flex flex-col flex-shrink-0",style:{marginLeft:"15px",gap:"4px"},children:[e.jsxs("div",{className:"flex items-center gap-[5px]",children:[e.jsxs(F,{to:`/entity/${s.sha}`,className:"hover:underline cursor-pointer",title:s.name,style:{fontSize:"14px",lineHeight:"18px",color:"#343434",fontWeight:500},children:[s.name," (",S,")"]}),e.jsx("div",{className:"flex items-center justify-center px-2 rounded",style:{height:"20px",backgroundColor:f.bgColor,color:f.textColor,fontSize:"12px",lineHeight:"16px",fontWeight:400},children:f.text})]}),e.jsx("div",{style:{fontSize:"12px",lineHeight:"15px",color:"#b0b0b0",fontWeight:400},className:"font-mono",title:s.filePath,children:s.filePath})]}),e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"flex-shrink-0 flex items-center gap-2",children:[C&&e.jsx(e.Fragment,{children:u||n.state!=="idle"?e.jsxs("div",{className:"px-2 py-1 bg-pink-100 rounded flex items-center gap-1.5",children:[e.jsx(W,{size:14,className:"animate-spin",style:{color:"#be185d"}}),e.jsx("span",{style:{color:"#be185d",fontSize:"10px",lineHeight:"20px",fontWeight:600},children:"Analyzing..."})]}):e.jsx("button",{onClick:v,className:"px-[10px] rounded transition-colors whitespace-nowrap",style:{backgroundColor:"#005c75",color:"#ffffff",fontSize:"10px",lineHeight:"22px",fontWeight:600},onMouseEnter:t=>{t.currentTarget.style.backgroundColor="#004d5e"},onMouseLeave:t=>{t.currentTarget.style.backgroundColor="#005c75"},children:"Re-analyze"})}),e.jsx("button",{onClick:()=>void x(`/entity/${s.sha}/logs`),className:"px-[10px] rounded transition-colors whitespace-nowrap",style:{backgroundColor:"#e0e9ec",color:"#005c75",fontSize:"10px",lineHeight:"22px",fontWeight:600},onMouseEnter:t=>{t.currentTarget.style.backgroundColor="#d0dfe3"},onMouseLeave:t=>{t.currentTarget.style.backgroundColor="#e0e9ec"},children:"View Logs"})]})]}),e.jsx("div",{className:"border-t border-gray-200"}),e.jsx("div",{className:"flex gap-2.5 overflow-x-auto pb-3 px-[15px] pt-3",style:{paddingLeft:"47px"},children:i.length>0?i.map(t=>e.jsxs("div",{className:"shrink-0 flex flex-col gap-2",children:[e.jsx("button",{onClick:()=>g(t.scenarioId||""),className:"block cursor-pointer bg-transparent border-none p-0",children:e.jsx("div",{className:"w-36 h-24 rounded-md border overflow-hidden flex items-center justify-center transition-all",style:{"--hover-border":"#005C75",backgroundColor:t.state==="capturing"?"#f9f9f9":"#f3f4f6",borderColor:t.state==="capturing"?"#efefef":"#d1d5db"},onMouseEnter:r=>{t.state==="completed"&&(r.currentTarget.style.borderColor="#005C75",r.currentTarget.style.boxShadow="0 4px 12px rgba(0, 92, 117, 0.15)")},onMouseLeave:r=>{r.currentTarget.style.borderColor=t.state==="capturing"?"#efefef":"#d1d5db",r.currentTarget.style.boxShadow="none"},children:t.state==="completed"?e.jsx(U,{screenshotPath:t.screenshotPath,alt:t.scenarioName,className:"max-w-full max-h-full object-contain"}):t.state==="capturing"?e.jsx(V,{size:"medium"}):null})}),e.jsxs("div",{className:"relative group",children:[e.jsx("div",{className:"text-left text-xs text-gray-600 cursor-default",style:{fontSize:"11px",lineHeight:"14px",maxWidth:"144px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.scenarioName}),e.jsx("div",{className:"fixed hidden group-hover:block pointer-events-none",style:{zIndex:1e4,transform:"translateY(8px)"},children:e.jsxs("div",{className:"bg-gray-100 text-gray-800 text-xs rounded-lg px-3 py-2 shadow-lg max-w-xs border border-gray-200",children:[t.scenarioName,t.scenarioDescription&&e.jsxs(e.Fragment,{children:[": ",t.scenarioDescription]}),e.jsx("div",{className:"absolute -top-1 left-4 w-2 h-2 bg-gray-100 border-l border-t border-gray-200 transform rotate-45"})]})})]})]},t.scenarioId)):e.jsx("div",{className:"text-xs text-gray-400 py-4",children:"No screenshots available"})})]})})}function X({entity:s}){const i=D(),[c,x]=l.useState(!1),n=()=>{x(!0),i.submit({entitySha:s.sha,filePath:s.filePath||""},{method:"post",action:"/api/analyze"})};return l.useEffect(()=>{i.state==="idle"&&c&&x(!1)},[i.state,c]),e.jsx("div",{className:"bg-white rounded hover:bg-gray-100 transition-colors cursor-pointer border-b border-[#e1e1e1]",onClick:n,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(P,{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(F,{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:q(s.createdAt||null)}),e.jsx("div",{className:"w-24 flex justify-end",children:c||i.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(W,{size:14,className:"animate-spin"}),"Analyzing..."]}):e.jsx("button",{onClick:n,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{ce as default,ie as meta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as l,j as e}from"./chunk-JZWAC4HX-
|
|
1
|
+
import{r as l,j as e}from"./chunk-JZWAC4HX-7VptmeIr.js";const N=10,B=1024;function W({currentViewportWidth:p,currentPresetName:y,onDevicePresetClick:f,devicePresets:u,onHoverChange:r,hideLabel:v=!1,lightMode:c=!1}){const[t,d]=l.useState(null),g=l.useRef(null),a=l.useMemo(()=>[...u].sort((s,n)=>s.width-n.width),[u]),{fittingPresets:m,overflowPresets:o}=l.useMemo(()=>{const s=[],n=[];for(const i of a)i.width<=B?s.push(i):n.push(i);return n.sort((i,h)=>h.width-i.width),{fittingPresets:s,overflowPresets:n}},[a]),x=l.useCallback(s=>{if(!g.current)return null;const n=g.current.getBoundingClientRect(),i=s-n.left,h=n.width,w=h/2,z=(m.length>0?m[m.length-1].width:0)/2,I=w-z,M=w+z,C=o.length>0?(o.length-1)*N:0;if(o.length>0){if(i<I){if(i<=C){const b=Math.min(Math.floor(i/N),o.length-1);return o[b]}return o[o.length-1]}if(i>M){const b=h-i;if(b<=C){const j=Math.min(Math.floor(b/N),o.length-1);return o[j]}return o[o.length-1]}}const F=Math.abs(i-w);for(let b=m.length-1;b>=0;b--){const j=m[b],$=m[b-1],R=j.width/2,A=$?$.width/2:0;if(F<=R&&F>=A)return j}return m[0]||o[o.length-1]||null},[m,o]),S=l.useCallback(s=>{const n=x(s.clientX);d(n),r==null||r(n)},[x,r]),E=l.useCallback(()=>{d(null),r==null||r(null)},[r]),P=l.useCallback(s=>{const n=x(s.clientX);n&&f(n)},[x,f]),k=t||{name:y,width:p};return e.jsxs("div",{ref:g,className:"relative h-6 shrink-0 overflow-hidden cursor-pointer",onMouseMove:S,onMouseLeave:E,onClick:P,children:[t&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:e.jsx("div",{className:"h-full transition-all duration-100 bg-[#005C75]",style:{width:`${t.width}px`}})}),e.jsx("div",{className:"absolute inset-0 pointer-events-none",children:m.map(s=>{const n=s.width===p,i=(t==null?void 0:t.name)===s.name,h=s.width/2;return e.jsxs("div",{children:[e.jsx("div",{className:"absolute top-0 bottom-0",style:{left:`calc(50% - ${h}px)`},children:e.jsx("div",{className:`w-0.5 h-full transition-colors duration-75 ${n||i?c?"bg-gray-900":"bg-white":c?"bg-[rgba(0,0,0,0.2)]":"bg-[rgba(255,255,255,0.3)]"}`})}),e.jsx("div",{className:"absolute top-0 bottom-0",style:{left:`calc(50% + ${h}px)`},children:e.jsx("div",{className:`w-0.5 h-full transition-colors duration-75 ${n||i?c?"bg-gray-900":"bg-white":c?"bg-[rgba(0,0,0,0.2)]":"bg-[rgba(255,255,255,0.3)]"}`})})]},s.name)})}),e.jsx("div",{className:"absolute inset-0 pointer-events-none",children:o.map((s,n)=>{const i=n*N,h=s.width===p,w=(t==null?void 0:t.name)===s.name;return e.jsxs("div",{children:[e.jsx("div",{className:"absolute top-0 bottom-0",style:{left:`${i}px`},children:e.jsx("div",{className:`w-0.5 h-full transition-colors duration-75 ${h||w?c?"bg-gray-900":"bg-white":c?"bg-[rgba(0,0,0,0.2)]":"bg-[rgba(255,255,255,0.3)]"}`})}),e.jsx("div",{className:"absolute top-0 bottom-0",style:{right:`${i}px`},children:e.jsx("div",{className:`w-0.5 h-full transition-colors duration-75 ${h||w?c?"bg-gray-900":"bg-white":c?"bg-[rgba(0,0,0,0.2)]":"bg-[rgba(255,255,255,0.3)]"}`})})]},s.name)})}),!v&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:e.jsxs("div",{className:`text-[10px] px-2 py-0.5 rounded shadow-sm whitespace-nowrap transition-colors ${t?"bg-[#005c75] text-white":"bg-white/90 text-[#005c75] border border-[rgba(0,92,117,0.25)]"}`,children:[k.name," - ",k.width,"px"]})})]})}function X({width:p,height:y,onSave:f,onCancel:u}){const[r,v]=l.useState(""),[c,t]=l.useState(""),d=()=>{const a=r.trim();if(!a){t("Please enter a name for this custom size");return}f(a)},g=a=>{a.key==="Enter"&&r.trim()&&d(),a.key==="Escape"&&u()};return 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-md w-full p-6 shadow-xl",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Save Custom Size"}),e.jsx("button",{onClick:u,className:"text-gray-400 hover:text-gray-600 transition-colors cursor-pointer","aria-label":"Close",children:e.jsx("svg",{className:"w-5 h-5",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"})})})]}),e.jsxs("div",{className:"mb-6 p-4 bg-gray-50 rounded-lg border border-gray-200",children:[e.jsx("div",{className:"text-sm text-gray-500 mb-1",children:"Dimensions"}),e.jsxs("div",{className:"text-lg font-medium text-gray-900",children:[p,"px × ",y,"px"]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("label",{htmlFor:"custom-size-name",className:"block text-sm font-medium text-gray-700 mb-2",children:"Name"}),e.jsx("input",{id:"custom-size-name",type:"text",value:r,onChange:a=>{v(a.target.value),t("")},onKeyDown:g,placeholder:"e.g., iPhone 15 Pro",className:`w-full px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75] ${c?"border-red-300":"border-gray-300"}`,autoFocus:!0}),c&&e.jsx("p",{className:"mt-1 text-sm text-red-600",children:c})]}),e.jsxs("div",{className:"flex gap-3 justify-end",children:[e.jsx("button",{onClick:u,className:"px-4 py-2 bg-gray-100 text-gray-700 text-sm font-medium rounded-md hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-gray-300 transition-colors cursor-pointer",children:"Cancel"}),e.jsx("button",{onClick:d,disabled:!r.trim(),className:"px-4 py-2 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 cursor-pointer disabled:bg-gray-300 disabled:cursor-not-allowed",children:"Save"})]})]})})}function D(p){const[y,f]=l.useState([]),u=p?`codeyam-custom-sizes-${p}`:null;l.useEffect(()=>{if(!u||typeof window>"u"){f([]);return}try{const t=localStorage.getItem(u);if(t){const d=JSON.parse(t);Array.isArray(d)&&f(d)}}catch(t){console.error("[useCustomSizes] Failed to load custom sizes:",t),f([])}},[u]);const r=l.useCallback(t=>{if(!(!u||typeof window>"u"))try{localStorage.setItem(u,JSON.stringify(t))}catch(d){console.error("[useCustomSizes] Failed to save custom sizes:",d)}},[u]),v=l.useCallback((t,d,g)=>{f(a=>{const m=a.findIndex(S=>S.name===t),o={name:t,width:d,height:g};let x;return m>=0?(x=[...a],x[m]=o):x=[...a,o],r(x),x})},[r]),c=l.useCallback(t=>{f(d=>{const g=d.filter(a=>a.name!==t);return r(g),g})},[r]);return{customSizes:y,addCustomSize:v,removeCustomSize:c}}export{X as S,W as V,D as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t}from"./chunk-JZWAC4HX-
|
|
1
|
+
import{r as t}from"./chunk-JZWAC4HX-7VptmeIr.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,d as i}from"./chunk-JZWAC4HX-
|
|
1
|
+
import{r as e,j as x,d as i}from"./chunk-JZWAC4HX-7VptmeIr.js";const s={source:"navbar"},r=e.createContext(void 0);function y({children:t}){const[n,o]=e.useState(s),a=e.useCallback(u=>{o(u)},[]),c=e.useCallback(()=>{o(s)},[]);return x.jsx(r.Provider,{value:{contextData:n,setContextData:a,resetContextData:c},children:t})}function D(t){const n=e.useContext(r),o=e.useRef(n);e.useEffect(()=>{if(o.current)return o.current.setContextData(t),()=>{var a;(a=o.current)==null||a.resetContextData()}},[t.source,t.entitySha,t.scenarioId,t.analysisId,t.entityName,t.entityType,t.scenarioName,t.errorMessage])}function p(){const t=e.useContext(r),n=i();return t?{source:t.contextData.source,entitySha:t.contextData.entitySha,scenarioId:t.contextData.scenarioId,analysisId:t.contextData.analysisId,currentUrl:n.pathname,entityName:t.contextData.entityName,entityType:t.contextData.entityType,scenarioName:t.contextData.scenarioName,errorMessage:t.contextData.errorMessage}:{source:"navbar",currentUrl:n.pathname}}export{y as R,p as a,D as u};
|
package/codeyam-cli/src/webserver/build/client/assets/{useToast-ihdMtlf6.js → useToast-BOur3mUv.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,j as T}from"./chunk-JZWAC4HX-
|
|
1
|
+
import{r as t,j as T}from"./chunk-JZWAC4HX-7VptmeIr.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};
|
package/codeyam-cli/src/webserver/build/server/assets/{index-C_nP9_jr.js → index-B8jmgmn2.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"fetch-retry";import{G as V,H as W,I as X,J as Y,K as Z,L as _,P as $,S as aa,d as ta,a as sa,b as oa,c as ia,e as ra,f as ma,g as ea,h as pa,i as la,j as na,k as da,C as ba,F as ua,E as ca,D as Ta,l as Ca,m as ha,n as ya,o as Ba,p as Sa,q as Aa,r as ga,s as Ea,t as Fa,u as Pa,v as ja,w as Da,x as Ma,y as fa,z as qa,A as xa,B as Ga}from"./server-build-
|
|
1
|
+
import"fetch-retry";import{G as V,H as W,I as X,J as Y,K as Z,L as _,P as $,S as aa,d as ta,a as sa,b as oa,c as ia,e as ra,f as ma,g as ea,h as pa,i as la,j as na,k as da,C as ba,F as ua,E as ca,D as Ta,l as Ca,m as ha,n as ya,o as Ba,p as Sa,q as Aa,r as ga,s as Ea,t as Fa,u as Pa,v as ja,w as Da,x as Ma,y as fa,z as qa,A as xa,B as Ga}from"./server-build-9OU4lmvL.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"url";import"util";import"dotenv";import"events";import"uuid";import"openai";import"p-queue";import"p-retry";import"@aws-sdk/client-dynamodb";import"lru-cache";import"pluralize";import"piscina";import"json5";import"@aws-sdk/util-dynamodb";import"v8";import"react-syntax-highlighter";import"react-syntax-highlighter/dist/cjs/styles/prism/index.js";import"node:crypto";import"minimatch";import"react-markdown";import"remark-gfm";import"react-diff-viewer-continued";export{V as AnalysisBranchesTableColumns,W as BranchesTableColumns,X as CommitsTableColumns,Y as EntitiesTableColumns,Z as EntityBranchesTableColumns,_ as FilesTableColumns,$ as ProjectsTableColumns,aa as ScenariosTableColumns,ta as dbToAnalysis,sa as dbToAnalysisBranch,oa as dbToBranch,ia as dbToCommit,ra as dbToEntity,ma as dbToFile,ea as dbToProject,pa as dbToScenario,la as dbToUserScenario,na as deleteScenarios,da as generateSha,ba as getDatabase,ua as getJsonHelper,ca as getPostgreDatabase,Ta as getSqliteDatabase,Ca as loadAnalyses,ha as loadAnalysis,ya as loadBranches,Ba as loadCommitBranches,Sa as loadCommits,Aa as loadEntities,ga as loadEntity,Ea as loadFiles,Fa as loadProject,Pa as updateCommitMetadata,ja as updateFreshAnalysisMetadata,Da as updateFreshAnalysisStatus,Ma as updateProjectMetadata,fa as upsertCommitBranches,qa as upsertCommits,xa as upsertGithubUser,Ga as upsertScenarios};
|