specrails-desktop 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/specrails/batch-implement.md +287 -0
- package/.claude/commands/specrails/compat-check.md +271 -0
- package/.claude/commands/specrails/doctor.md +62 -0
- package/.claude/commands/specrails/enrich.md +1635 -0
- package/.claude/commands/specrails/explore-spec.md +173 -0
- package/.claude/commands/specrails/health-check.md +527 -0
- package/.claude/commands/specrails/implement.md +1457 -0
- package/.claude/commands/specrails/memory-inspect.md +259 -0
- package/.claude/commands/specrails/opsx-diff.md +419 -0
- package/.claude/commands/specrails/propose-spec.md +102 -0
- package/.claude/commands/specrails/reconfig.md +89 -0
- package/.claude/commands/specrails/refactor-recommender.md +212 -0
- package/.claude/commands/specrails/retry.md +363 -0
- package/.claude/commands/specrails/telemetry.md +552 -0
- package/.claude/commands/specrails/why.md +96 -0
- package/LICENSE +21 -0
- package/README.md +290 -0
- package/cli/dist/specrails-desktop.js +1098 -0
- package/client/dist/assets/ActivityFeedPage-Gy4x8dBt.js +1 -0
- package/client/dist/assets/AgentsPage-CPgu--Fb.js +86 -0
- package/client/dist/assets/AnalyticsPage-B5sJEee2.js +1 -0
- package/client/dist/assets/BarChart-7IMQ8HY1.js +33 -0
- package/client/dist/assets/CodePage-CBdFvbwe.js +2 -0
- package/client/dist/assets/DesktopAnalyticsPage-w0rdTq4w.js +1 -0
- package/client/dist/assets/DocsDialog-BZUYM7wm.js +11 -0
- package/client/dist/assets/DocsPage-9QglWl46.js +11 -0
- package/client/dist/assets/ExportDropdown-BLZFXtNi.js +1 -0
- package/client/dist/assets/IntegrationsPage-BxBE4y99.js +3 -0
- package/client/dist/assets/JobDetailPage-DydWx_5S.js +16 -0
- package/client/dist/assets/JobsPage-20ibw0IO.js +1 -0
- package/client/dist/assets/abap-Bw6f2wDG.js +1 -0
- package/client/dist/assets/activity-BEIp_Y1A.js +1 -0
- package/client/dist/assets/activity-BdrPln96.js +1 -0
- package/client/dist/assets/activity-CpkRS8Sx.js +1 -0
- package/client/dist/assets/activity-DKCpESPt.js +1 -0
- package/client/dist/assets/activity-DOUVEjJi.js +1 -0
- package/client/dist/assets/activity-DRwkql_y.js +1 -0
- package/client/dist/assets/activity-DcDQ7tjw.js +1 -0
- package/client/dist/assets/activity-Dv6H7wEr.js +1 -0
- package/client/dist/assets/addon-image-3WCl5Vhd.js +1 -0
- package/client/dist/assets/addon-ligatures-C5OdliKs.js +2 -0
- package/client/dist/assets/addon-webgl-BbX6pSjl.js +44 -0
- package/client/dist/assets/addspec-B5yl4Loj.js +1 -0
- package/client/dist/assets/addspec-BEeF5-zc.js +1 -0
- package/client/dist/assets/addspec-D33ocMxf.js +1 -0
- package/client/dist/assets/addspec-DFswZ0jK.js +1 -0
- package/client/dist/assets/addspec-DRE-jZv7.js +1 -0
- package/client/dist/assets/addspec-DVZ15Jp8.js +1 -0
- package/client/dist/assets/addspec-Fkv91Opc.js +1 -0
- package/client/dist/assets/addspec-GWm4ffKl.js +1 -0
- package/client/dist/assets/agents-1nCDWRmP.js +1 -0
- package/client/dist/assets/agents-Bm9rPqnt.js +1 -0
- package/client/dist/assets/agents-CMxtJMLD.js +1 -0
- package/client/dist/assets/agents-DK-Dlc0i.js +1 -0
- package/client/dist/assets/agents-Q6Ldfpxx.js +1 -0
- package/client/dist/assets/agents-TeOSy-ax.js +1 -0
- package/client/dist/assets/agents-iTqjRajS.js +1 -0
- package/client/dist/assets/agents-s87sMGzL.js +1 -0
- package/client/dist/assets/agentstudio-B6Wb59E7.js +1 -0
- package/client/dist/assets/agentstudio-BADhZ41e.js +1 -0
- package/client/dist/assets/agentstudio-BSnWLR63.js +1 -0
- package/client/dist/assets/agentstudio-BdidyBzZ.js +1 -0
- package/client/dist/assets/agentstudio-CxlUllqI.js +1 -0
- package/client/dist/assets/agentstudio-D3I62TLJ.js +1 -0
- package/client/dist/assets/agentstudio-DuH9TogZ.js +1 -0
- package/client/dist/assets/agentstudio-Kw88_dUF.js +1 -0
- package/client/dist/assets/aiedit-BWxHGsYA.js +1 -0
- package/client/dist/assets/aiedit-D2ji6Qy0.js +1 -0
- package/client/dist/assets/aiedit-DAhZTvtk.js +1 -0
- package/client/dist/assets/aiedit-DJMny-D5.js +1 -0
- package/client/dist/assets/aiedit-DOcxERkU.js +1 -0
- package/client/dist/assets/aiedit-DvrcbwGv.js +1 -0
- package/client/dist/assets/aiedit-TTwzL1TS.js +1 -0
- package/client/dist/assets/aiedit-WBSjT_C1.js +1 -0
- package/client/dist/assets/analytics-BIdr0YfL.js +1 -0
- package/client/dist/assets/analytics-C6EzgtdE.js +1 -0
- package/client/dist/assets/analytics-C9Zc-rkM.js +1 -0
- package/client/dist/assets/analytics-CVx3YOc0.js +1 -0
- package/client/dist/assets/analytics-CYj0tfj7.js +1 -0
- package/client/dist/assets/analytics-CnY4kNG3.js +1 -0
- package/client/dist/assets/analytics-CrPCZRJ-.js +1 -0
- package/client/dist/assets/analytics-DMCto-TF.js +1 -0
- package/client/dist/assets/apex-Cw8_REBo.js +1 -0
- package/client/dist/assets/atom-one-dark-B-oHczHB.css +1 -0
- package/client/dist/assets/attachments-BIsSSnHJ.js +1 -0
- package/client/dist/assets/attachments-BW4L3l2L.js +1 -0
- package/client/dist/assets/attachments-Bcf6BG6V.js +1 -0
- package/client/dist/assets/attachments-Bke8sCU4.js +1 -0
- package/client/dist/assets/attachments-COcrGRFz.js +1 -0
- package/client/dist/assets/attachments-DYHGA2Dj.js +1 -0
- package/client/dist/assets/attachments-Dd92KpUH.js +1 -0
- package/client/dist/assets/attachments-DzdU6DV6.js +1 -0
- package/client/dist/assets/azcli-Cz6HAoOw.js +1 -0
- package/client/dist/assets/bat-CcJ-xyqL.js +1 -0
- package/client/dist/assets/bicep-z1WDCKYz.js +2 -0
- package/client/dist/assets/browser-5ErDlJoR.js +1 -0
- package/client/dist/assets/browser-Bc-YdlVg.js +1 -0
- package/client/dist/assets/browser-BlYF4OOq.js +1 -0
- package/client/dist/assets/browser-CT-ReZGt.js +1 -0
- package/client/dist/assets/browser-DGITz3fC.js +1 -0
- package/client/dist/assets/browser-JsAIGCEW.js +1 -0
- package/client/dist/assets/browser-M5-rbPlw.js +1 -0
- package/client/dist/assets/browser-Qya9cARy.js +1 -0
- package/client/dist/assets/cameligo-BRewOpfa.js +1 -0
- package/client/dist/assets/chat-BEGuC03z.js +1 -0
- package/client/dist/assets/chat-BEW60P_u.js +1 -0
- package/client/dist/assets/chat-BQNMD0PL.js +1 -0
- package/client/dist/assets/chat-BsbNGPW9.js +1 -0
- package/client/dist/assets/chat-CboQguCi.js +1 -0
- package/client/dist/assets/chat-DRCa9pOt.js +1 -0
- package/client/dist/assets/chat-DwUm6W9z.js +1 -0
- package/client/dist/assets/chat-yoXwguQu.js +1 -0
- package/client/dist/assets/chunk-CilyBKbf.js +1 -0
- package/client/dist/assets/clojure-DBjRWN6g.js +1 -0
- package/client/dist/assets/clsx-DnqN-uhr.js +1 -0
- package/client/dist/assets/code-AL1rVIMb.js +1 -0
- package/client/dist/assets/code-C0BKpkht.js +1 -0
- package/client/dist/assets/code-C0FTS3ew.js +1 -0
- package/client/dist/assets/code-CPcHxzxw.js +1 -0
- package/client/dist/assets/code-D3ryDniw.js +1 -0
- package/client/dist/assets/code-D3zVVQTj.js +1 -0
- package/client/dist/assets/code-PCmfS3dn.js +1 -0
- package/client/dist/assets/code-exI0G5Wd.js +1 -0
- package/client/dist/assets/codicon-ngg6Pgfi.ttf +0 -0
- package/client/dist/assets/coffee-Cfk_XHGR.js +1 -0
- package/client/dist/assets/commands-B772IyDa.js +1 -0
- package/client/dist/assets/commands-BDDp6xFG.js +1 -0
- package/client/dist/assets/commands-CJxCry-o.js +1 -0
- package/client/dist/assets/commands-CfgY-_of.js +1 -0
- package/client/dist/assets/commands-DLrvnPNg.js +1 -0
- package/client/dist/assets/commands-IXMOKBYt.js +1 -0
- package/client/dist/assets/commands-UD1NzmwX.js +1 -0
- package/client/dist/assets/commands-sqrqsxyE.js +1 -0
- package/client/dist/assets/common-DCr6VzJ7.js +1 -0
- package/client/dist/assets/common-Dard9UNH.js +1 -0
- package/client/dist/assets/common-DeDELLZJ.js +1 -0
- package/client/dist/assets/common-DltqHaAe.js +1 -0
- package/client/dist/assets/common-Dmm1GhdD.js +1 -0
- package/client/dist/assets/common-DnjcgkPH.js +1 -0
- package/client/dist/assets/common-GbpxfPG8.js +1 -0
- package/client/dist/assets/common-wA36jmj1.js +1 -0
- package/client/dist/assets/cpp-BVob6BaP.js +1 -0
- package/client/dist/assets/csharp-C4fbRuOu.js +1 -0
- package/client/dist/assets/csp-DthFP_vT.js +1 -0
- package/client/dist/assets/css-CGMH0hcW.js +3 -0
- package/client/dist/assets/css.worker-Wv5dxAWO.js +89 -0
- package/client/dist/assets/cssMode-Cc6ozl-J.js +1 -0
- package/client/dist/assets/cypher-Pnf68BRV.js +1 -0
- package/client/dist/assets/dart-PMMOtxZX.js +1 -0
- package/client/dist/assets/dashboard-B4ixDVk8.js +1 -0
- package/client/dist/assets/dashboard-BZBADHSj.js +1 -0
- package/client/dist/assets/dashboard-C1MfeUHs.js +1 -0
- package/client/dist/assets/dashboard-C7SK6xu5.js +1 -0
- package/client/dist/assets/dashboard-CB6Le1yN.js +1 -0
- package/client/dist/assets/dashboard-CoTpMOBM.js +1 -0
- package/client/dist/assets/dashboard-Duo4DDCW.js +1 -0
- package/client/dist/assets/dashboard-I19DXBxw.js +1 -0
- package/client/dist/assets/dist-js-BY-Fv_fg.js +1 -0
- package/client/dist/assets/dist-js-Bakc4uxT.js +1 -0
- package/client/dist/assets/dockerfile-di1nsJCc.js +1 -0
- package/client/dist/assets/ecl-D_WVcB5M.js +1 -0
- package/client/dist/assets/editor-Br_kD0ds.css +1 -0
- package/client/dist/assets/editor.api2-XLGzZfbc.js +872 -0
- package/client/dist/assets/editor.main-CfXxHimg.js +6 -0
- package/client/dist/assets/editor.worker-Bd9IXS8d.js +26 -0
- package/client/dist/assets/elixir-OAdJEMOn.js +1 -0
- package/client/dist/assets/explore-4mFpnrKU.js +1 -0
- package/client/dist/assets/explore-A8Ltoblq.js +1 -0
- package/client/dist/assets/explore-B9A3iN2W.js +1 -0
- package/client/dist/assets/explore-BV5Xxlsn.js +1 -0
- package/client/dist/assets/explore-BrBJvfjP.js +1 -0
- package/client/dist/assets/explore-C3FSE42C.js +1 -0
- package/client/dist/assets/explore-D2EFgt8J.js +1 -0
- package/client/dist/assets/explore-hFc3HFcp.js +1 -0
- package/client/dist/assets/flow9-D3QEZjgn.js +1 -0
- package/client/dist/assets/format-command-CwGuwzGA.js +1 -0
- package/client/dist/assets/freemarker2-DP7J1gG3.js +3 -0
- package/client/dist/assets/fsharp-BF0k_8N8.js +1 -0
- package/client/dist/assets/go-BAQO5Jsz.js +1 -0
- package/client/dist/assets/graphql-hdFVFkiV.js +1 -0
- package/client/dist/assets/handlebars-BjRlucw6.js +1 -0
- package/client/dist/assets/hcl-DWnl1o-X.js +1 -0
- package/client/dist/assets/html-OumBQJ-U.js +1 -0
- package/client/dist/assets/html.worker-CQP8QQsS.js +502 -0
- package/client/dist/assets/htmlMode-CStc3zXM.js +1 -0
- package/client/dist/assets/index-CimDRRi7.css +2 -0
- package/client/dist/assets/index-XGZaKl_u.js +142 -0
- package/client/dist/assets/ini-CB-6OVu3.js +1 -0
- package/client/dist/assets/integrations-C3p12Ms6.js +1 -0
- package/client/dist/assets/integrations-Cr6hH7XR.js +1 -0
- package/client/dist/assets/integrations-Cublz3m6.js +1 -0
- package/client/dist/assets/integrations-D28q1kF6.js +1 -0
- package/client/dist/assets/integrations-DRdbki5W.js +1 -0
- package/client/dist/assets/integrations-DaC4SzzL.js +1 -0
- package/client/dist/assets/integrations-DmQYCUvN.js +1 -0
- package/client/dist/assets/integrations-HIlUxXVs.js +1 -0
- package/client/dist/assets/java-d1CmfiHX.js +1 -0
- package/client/dist/assets/javascript-CMk--e7g.js +1 -0
- package/client/dist/assets/jobs-BE1siB0M.js +1 -0
- package/client/dist/assets/jobs-BHcQ_Faf.js +1 -0
- package/client/dist/assets/jobs-CFfc2dNX.js +1 -0
- package/client/dist/assets/jobs-CSi5n8X_.js +1 -0
- package/client/dist/assets/jobs-Dc3X86PY.js +1 -0
- package/client/dist/assets/jobs-De5tASex.js +1 -0
- package/client/dist/assets/jobs-DsoXEdo7.js +1 -0
- package/client/dist/assets/jobs-Wl-ApPMb.js +1 -0
- package/client/dist/assets/json.worker-DzV-CpCQ.js +58 -0
- package/client/dist/assets/jsonMode-C2h3ZcjZ.js +7 -0
- package/client/dist/assets/julia-Bgv08lKa.js +1 -0
- package/client/dist/assets/kotlin-u98kaVTf.js +1 -0
- package/client/dist/assets/less-CjYwpgg5.js +2 -0
- package/client/dist/assets/lexon-YTjaAFBB.js +1 -0
- package/client/dist/assets/lib-CPxTMOAq.js +7 -0
- package/client/dist/assets/liquid-mI3KJrBE.js +1 -0
- package/client/dist/assets/lspLanguageFeatures-DU09ggWi.js +4 -0
- package/client/dist/assets/lua-BzmkWv27.js +1 -0
- package/client/dist/assets/m3-CFwk9fw0.js +1 -0
- package/client/dist/assets/markdown-CR5iMpSZ.js +1 -0
- package/client/dist/assets/mdx-C41VDTR_.js +1 -0
- package/client/dist/assets/mips-CcEalc17.js +1 -0
- package/client/dist/assets/monaco.contribution-CPObAXMC.js +2 -0
- package/client/dist/assets/msdax-BQbkawnr.js +1 -0
- package/client/dist/assets/mysql-GTlaaW_P.js +1 -0
- package/client/dist/assets/nav-0fwkrgHt.js +1 -0
- package/client/dist/assets/nav-BEL3MTwK.js +1 -0
- package/client/dist/assets/nav-B_G-TJDW.js +1 -0
- package/client/dist/assets/nav-C2YXcbZS.js +1 -0
- package/client/dist/assets/nav-ClzOE4mA.js +1 -0
- package/client/dist/assets/nav-CtYwmMgu.js +1 -0
- package/client/dist/assets/nav-D2bOGSEg.js +1 -0
- package/client/dist/assets/nav-iH1V5j6o.js +1 -0
- package/client/dist/assets/objective-c-Byu1T5if.js +1 -0
- package/client/dist/assets/pascal-BrfzBfRm.js +1 -0
- package/client/dist/assets/pascaligo-BXXKFUeo.js +1 -0
- package/client/dist/assets/perl-B3OikKq-.js +1 -0
- package/client/dist/assets/pgsql-CTsa0Acc.js +1 -0
- package/client/dist/assets/php-DiQh3FUW.js +1 -0
- package/client/dist/assets/pla-92uH8Fzm.js +1 -0
- package/client/dist/assets/postiats-BbeWkKUr.js +1 -0
- package/client/dist/assets/powerquery-DgDMzpsm.js +1 -0
- package/client/dist/assets/powershell-BfdUUzaG.js +1 -0
- package/client/dist/assets/preload-helper-DSXbuxSR.js +1 -0
- package/client/dist/assets/protobuf-BojW2ftW.js +2 -0
- package/client/dist/assets/pug-BxqTg3IU.js +1 -0
- package/client/dist/assets/python-Y27rKQtk.js +1 -0
- package/client/dist/assets/qsharp-BX_A-MW9.js +1 -0
- package/client/dist/assets/r-D9BMnxvJ.js +1 -0
- package/client/dist/assets/razor-Cd5-q9Bp.js +1 -0
- package/client/dist/assets/redis-5cJqEQJJ.js +1 -0
- package/client/dist/assets/redshift-d8BBqiwb.js +1 -0
- package/client/dist/assets/restructuredtext-C8a6yIcZ.js +1 -0
- package/client/dist/assets/ruby-egeh-6KX.js +1 -0
- package/client/dist/assets/rust-a3r9IInB.js +1 -0
- package/client/dist/assets/sb-y8iRIDei.js +1 -0
- package/client/dist/assets/scala-BPDK2AmK.js +1 -0
- package/client/dist/assets/scheme-BIWUEoOs.js +1 -0
- package/client/dist/assets/scss-CA-PSzwg.js +3 -0
- package/client/dist/assets/settings-55oDcbSh.js +1 -0
- package/client/dist/assets/settings-Bd4Tq1RB.js +1 -0
- package/client/dist/assets/settings-CCSM-Fhn.js +1 -0
- package/client/dist/assets/settings-D3e_bDoW.js +1 -0
- package/client/dist/assets/settings-DKbTkbn7.js +1 -0
- package/client/dist/assets/settings-Dxpo6_w7.js +1 -0
- package/client/dist/assets/settings-bt84e3Aa.js +1 -0
- package/client/dist/assets/settings-nu68QukM.js +1 -0
- package/client/dist/assets/setup-BMqwfbW9.js +1 -0
- package/client/dist/assets/setup-Bb5LcG28.js +1 -0
- package/client/dist/assets/setup-BeEx2_da.js +1 -0
- package/client/dist/assets/setup-CCCrB53Q.js +1 -0
- package/client/dist/assets/setup-CJA0ATmd.js +1 -0
- package/client/dist/assets/setup-CeiDbZcb.js +1 -0
- package/client/dist/assets/setup-Cus7TApA.js +1 -0
- package/client/dist/assets/setup-D9qOs2Xo.js +1 -0
- package/client/dist/assets/shell--LiT1Bja.js +1 -0
- package/client/dist/assets/solidity-DdqZccZg.js +1 -0
- package/client/dist/assets/sophia-S6-YxNG_.js +1 -0
- package/client/dist/assets/sparql-BSf5kMp2.js +1 -0
- package/client/dist/assets/specs-BFfu3u-a.js +1 -0
- package/client/dist/assets/specs-B__C8-8a.js +1 -0
- package/client/dist/assets/specs-CZ1PsXsC.js +1 -0
- package/client/dist/assets/specs-D2FzlLn9.js +1 -0
- package/client/dist/assets/specs-DaUTrNF9.js +1 -0
- package/client/dist/assets/specs-Dyc5hYeE.js +1 -0
- package/client/dist/assets/specs-cKEh2LXt.js +1 -0
- package/client/dist/assets/specs-k0PyLDVt.js +1 -0
- package/client/dist/assets/sql-D7KgjR8G.js +1 -0
- package/client/dist/assets/st-BnoDa-Ml.js +1 -0
- package/client/dist/assets/swift-DEUHTkUX.js +1 -0
- package/client/dist/assets/systemverilog-Tqb_KPnW.js +1 -0
- package/client/dist/assets/tcl-BmBFS2qq.js +1 -0
- package/client/dist/assets/terminal-80yDMgMF.js +1 -0
- package/client/dist/assets/terminal-Bje4ziIa.js +1 -0
- package/client/dist/assets/terminal-C2WYcFHF.js +1 -0
- package/client/dist/assets/terminal-CSONJOex.js +1 -0
- package/client/dist/assets/terminal-DEqzGtcr.js +1 -0
- package/client/dist/assets/terminal-DeWzh6ys.js +1 -0
- package/client/dist/assets/terminal-YOlsJCQj.js +1 -0
- package/client/dist/assets/terminal-lkZYR4wJ.js +1 -0
- package/client/dist/assets/tickets-CB7N30gm.js +1 -0
- package/client/dist/assets/tickets-CF2PYelu.js +1 -0
- package/client/dist/assets/tickets-DNOANUXr.js +1 -0
- package/client/dist/assets/tickets-DU1aqsbr.js +1 -0
- package/client/dist/assets/tickets-DYvafSaY.js +1 -0
- package/client/dist/assets/tickets-DlpC_iTg.js +1 -0
- package/client/dist/assets/tickets-DucYgtdl.js +1 -0
- package/client/dist/assets/tickets-clefmXLv.js +1 -0
- package/client/dist/assets/ts.worker-METxwbDZ.js +67719 -0
- package/client/dist/assets/tsMode-B0y_xEci.js +11 -0
- package/client/dist/assets/twig-BQV8igWC.js +1 -0
- package/client/dist/assets/typescript-BzK0OgwW.js +1 -0
- package/client/dist/assets/typespec-DlFroUGY.js +1 -0
- package/client/dist/assets/useProjectCache-DSaiGFjV.js +1 -0
- package/client/dist/assets/vb-BlrJpIMX.js +1 -0
- package/client/dist/assets/wgsl-BWgIc6FZ.js +298 -0
- package/client/dist/assets/workers-rt--R2Qy.js +1 -0
- package/client/dist/assets/xml-eX9QXAmI.js +1 -0
- package/client/dist/assets/yaml-fcsNkpOt.js +1 -0
- package/client/dist/index.html +246 -0
- package/docs/README.md +54 -0
- package/docs/cli.md +198 -0
- package/docs/codex.md +210 -0
- package/docs/creating-specs.md +197 -0
- package/docs/customizing.md +197 -0
- package/docs/getting-started.md +140 -0
- package/docs/internals/README.md +25 -0
- package/docs/internals/adding-a-provider.md +238 -0
- package/docs/internals/api-reference.md +634 -0
- package/docs/internals/architecture.md +332 -0
- package/docs/internals/configuration.md +172 -0
- package/docs/internals/openspec-workflow.md +282 -0
- package/docs/internals/operations-runbook.md +198 -0
- package/docs/internals/profiles.md +152 -0
- package/docs/platforms/macos.md +130 -0
- package/docs/platforms/windows.md +81 -0
- package/docs/running-pipelines.md +240 -0
- package/docs/terminal.md +138 -0
- package/docs/tracking-cost.md +155 -0
- package/package.json +82 -0
- package/server/dist/agent-generator.js +232 -0
- package/server/dist/agent-refine-db.js +124 -0
- package/server/dist/agent-refine-manager.js +526 -0
- package/server/dist/ai-invocations.js +111 -0
- package/server/dist/attachment-manager.js +299 -0
- package/server/dist/auth.js +207 -0
- package/server/dist/binary-probe.js +35 -0
- package/server/dist/browser-capture-manager.js +576 -0
- package/server/dist/browser-capture-types.js +28 -0
- package/server/dist/browser-network.js +149 -0
- package/server/dist/browser-playwright.js +888 -0
- package/server/dist/build-dirs.js +44 -0
- package/server/dist/changes-reader.js +120 -0
- package/server/dist/chat-manager.js +1060 -0
- package/server/dist/chromium-resolver.js +311 -0
- package/server/dist/code-explorer-router.js +788 -0
- package/server/dist/codex-otel-bridge.js +235 -0
- package/server/dist/command-resolver.js +102 -0
- package/server/dist/config.js +306 -0
- package/server/dist/context-budget.js +113 -0
- package/server/dist/context-scope.js +279 -0
- package/server/dist/contract-refine-runner.js +521 -0
- package/server/dist/core-compat.js +207 -0
- package/server/dist/core-package.js +14 -0
- package/server/dist/db.js +1034 -0
- package/server/dist/desktop-analytics.js +156 -0
- package/server/dist/desktop-db.js +456 -0
- package/server/dist/desktop-router.js +735 -0
- package/server/dist/docs-router.js +207 -0
- package/server/dist/explore-contract-refine.js +421 -0
- package/server/dist/explore-cwd-manager.js +242 -0
- package/server/dist/explore-draft-title.js +47 -0
- package/server/dist/explore-smash.js +450 -0
- package/server/dist/feature-flags.js +17 -0
- package/server/dist/file-provenance.js +382 -0
- package/server/dist/file-summary-generator.js +221 -0
- package/server/dist/file-summary-manager.js +689 -0
- package/server/dist/hooks.js +102 -0
- package/server/dist/ids.js +7 -0
- package/server/dist/index.js +586 -0
- package/server/dist/metrics.js +136 -0
- package/server/dist/mobile/index.js +16 -0
- package/server/dist/mobile/mobile-admin-router.js +84 -0
- package/server/dist/mobile/mobile-auth.js +67 -0
- package/server/dist/mobile/mobile-devices.js +80 -0
- package/server/dist/mobile/mobile-event-bus.js +39 -0
- package/server/dist/mobile/mobile-gateway.js +285 -0
- package/server/dist/mobile/mobile-mdns.js +81 -0
- package/server/dist/mobile/mobile-pairing.js +179 -0
- package/server/dist/mobile/mobile-redact.js +53 -0
- package/server/dist/mobile/mobile-router.js +411 -0
- package/server/dist/mobile/mobile-tls.js +86 -0
- package/server/dist/mobile/mobile-types.js +9 -0
- package/server/dist/mobile/mobile-ws.js +275 -0
- package/server/dist/path-resolver.js +298 -0
- package/server/dist/plugin-manager.js +617 -0
- package/server/dist/plugins/claude-approval.js +179 -0
- package/server/dist/plugins/claude-md-mutation.js +146 -0
- package/server/dist/plugins/codex-mcp.js +108 -0
- package/server/dist/plugins/contributors.js +72 -0
- package/server/dist/plugins/drift.js +58 -0
- package/server/dist/plugins/index.js +14 -0
- package/server/dist/plugins/json-mutation.js +120 -0
- package/server/dist/plugins/manager.js +32 -0
- package/server/dist/plugins/ownership.js +86 -0
- package/server/dist/plugins/paths.js +37 -0
- package/server/dist/plugins/prereq-installer.js +104 -0
- package/server/dist/plugins/rail-integration.js +79 -0
- package/server/dist/plugins/serena/index.js +13 -0
- package/server/dist/plugins/serena/install.js +91 -0
- package/server/dist/plugins/serena/instructions-content.js +21 -0
- package/server/dist/plugins/serena/manifest.js +111 -0
- package/server/dist/plugins/serena/verify.js +78 -0
- package/server/dist/plugins-router.js +215 -0
- package/server/dist/pricing.js +89 -0
- package/server/dist/profile-manager.js +310 -0
- package/server/dist/profiles-router.js +759 -0
- package/server/dist/project-registry.js +443 -0
- package/server/dist/project-router.js +4016 -0
- package/server/dist/proposal-manager.js +291 -0
- package/server/dist/provider-selection.js +69 -0
- package/server/dist/providers/claude-adapter.js +281 -0
- package/server/dist/providers/codex-adapter.js +264 -0
- package/server/dist/providers/index.js +23 -0
- package/server/dist/providers/registry.js +37 -0
- package/server/dist/providers/types.js +22 -0
- package/server/dist/queue-manager.js +1511 -0
- package/server/dist/rails-router.js +362 -0
- package/server/dist/rails-store.js +116 -0
- package/server/dist/result-event.js +106 -0
- package/server/dist/schemas/profile.v1.json +151 -0
- package/server/dist/setup-manager.js +1165 -0
- package/server/dist/setup-prerequisites.js +372 -0
- package/server/dist/smash-runner.js +663 -0
- package/server/dist/spec-draft-parser.js +133 -0
- package/server/dist/spec-launcher-manager.js +174 -0
- package/server/dist/spec-models.js +32 -0
- package/server/dist/specrails-tech-client.js +82 -0
- package/server/dist/spending.js +448 -0
- package/server/dist/telemetry-compactor.js +180 -0
- package/server/dist/telemetry-export.js +317 -0
- package/server/dist/telemetry-receiver.js +224 -0
- package/server/dist/terminal-manager.js +633 -0
- package/server/dist/terminal-marks-store.js +117 -0
- package/server/dist/terminal-osc-parser.js +159 -0
- package/server/dist/terminal-settings.js +282 -0
- package/server/dist/terminal-shell-integration.js +196 -0
- package/server/dist/ticket-broadcast.js +47 -0
- package/server/dist/ticket-store.js +397 -0
- package/server/dist/ticket-watcher.js +117 -0
- package/server/dist/types.js +10 -0
- package/server/dist/user-mcp-config.js +117 -0
- package/server/dist/util/cli-prompt.js +181 -0
- package/server/dist/util/secure-fs.js +50 -0
- package/server/dist/util/win-spawn.js +43 -0
- package/server/dist/webhook-manager.js +89 -0
- package/server/dist/ws-routing.js +47 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/editor.main-CfXxHimg.js","assets/chunk-CilyBKbf.js","assets/preload-helper-DSXbuxSR.js","assets/editor.api2-XLGzZfbc.js","assets/editor-Br_kD0ds.css","assets/workers-rt--R2Qy.js","assets/monaco.contribution-CPObAXMC.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./preload-helper-DSXbuxSR.js";import{$ as n,$t as r,A as i,Kt as a,M as o,Mt as s,Nt as c,Q as l,X as u,Y as d,Z as f,Zt as p,bt as m,c as h,ct as g,d as _,en as v,et as y,f as b,i as x,jt as S,lt as C,qt as w,tn as T,ut as E,vt as D,z as O}from"./index-XGZaKl_u.js";import{t as k}from"./useProjectCache-DSaiGFjV.js";var A=D(`file`,[[`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`}]]),j=D(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),M=D(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),N=e(T(),1),P=e(v(),1);function F(e,t,n){let r=Array(e);return new Proxy(r,{get(r,i,a){if(typeof i==`string`){let a=i.charCodeAt(0);if(a>=48&&a<=57){let a=+i;if(Number.isInteger(a)&&a>=0&&a<e){let e=r[a];if(!e){let i=t[a*2];e=r[a]={index:a,key:n(a),start:i,size:t[a*2+1],end:i+t[a*2+1],lane:0}}return e}}if(i===`length`)return e}return Reflect.get(r,i,a)}})}function I(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return o.length!==r.length||o.some((e,t)=>r[t]!==e)?(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1,i):i}return o.updateDeps=e=>{r=e},o}function L(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var R=(e,t)=>Math.abs(e-t)<1.01,z=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},B,V=()=>{if(B!==void 0)return B;if(typeof navigator>`u`)return B=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return B=!0;let e=navigator.maxTouchPoints;return B=navigator.platform===`MacIntel`&&e!==void 0&&e>0},H=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},ee=e=>e,U=e=>{let t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,r=Array(n);for(let e=0;e<n;e++)r[e]=t+e;return r},W=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(H(n)),!r.ResizeObserver)return()=>{};let a=new r.ResizeObserver(t=>{let r=()=>{let e=t[0];if(e?.borderBoxSize){let t=e.borderBoxSize[0];if(t){i({width:t.inlineSize,height:t.blockSize});return}}i(H(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(n,{box:`border-box`}),()=>{a.unobserve(n)}},G={passive:!0},te=typeof window>`u`?!0:`onscrollend`in window,K=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&te,o=0,s=a?null:z(i,()=>t(o,!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,G),a&&r.addEventListener(`scrollend`,u,G),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u)}},ne=(e,t)=>K(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),q=(e,t,n)=>{if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},re=(e,{adjustments:t=0,behavior:n},r)=>{var i,a;(a=(i=r.scrollElement)?.scrollTo)==null||a.call(i,{[r.options.horizontal?`left`:`top`]:e+t,behavior:n})},ie=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=(()=>{let e=null,t=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{let t=()=>{let t=e.target,n=this.indexFromElement(t);if(!t.isConnected){this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}return}this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}));return{disconnect:()=>{var n;(n=t())==null||n.disconnect(),e=null},observe:e=>t()?.observe(e,{box:`border-box`}),unobserve:e=>t()?.unobserve(e)}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:ee,rangeExtractor:U,onChange:()=>{},measureElement:q,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}this.options=t},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=I(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}if(this.scrollElement=e,this.scrollElement&&`ownerDocument`in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this._intendedScrollOffset!==null&&Math.abs(e-this._intendedScrollOffset)<1.5&&(e=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement){let e=this.scrollElement,t=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},n=()=>{this._iosTouching=!1,!(!V()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};e.addEventListener(`touchstart`,t,G),e.addEventListener(`touchend`,n,G),this.unsubs.push(()=>{e.removeEventListener(`touchstart`,t),e.removeEventListener(`touchend`,n),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let e=this.getScrollOffset(),t=this.getMaxScrollOffset();if(e<0||e>t)return;let n=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(e,{adjustments:this.scrollAdjustments+=n,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{let n=new Map,r=new Map;for(let i=t-1;i>=0;i--){let t=e[i];if(n.has(t.lane))continue;let a=r.get(t.lane);if(a==null||t.end>a.end?r.set(t.lane,t):t.end<a.end&&n.set(t.lane,!0),n.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=I(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(e,t,n,r,i,a,o)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o}),{key:!1}),this.getMeasurements=I(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o},s)=>{let c=this.itemSizeCache;if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let l=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=this.options.gap,a=e*2,o=this._flatMeasurements;if(!o||o.length<a){let e=new Float64Array(a);o&&l>0&&e.set(o.subarray(0,l*2)),o=e,this._flatMeasurements=o}let s;if(l===0)s=t+n;else{let e=l-1;s=o[e*2]+o[e*2+1]+i}for(let t=l;t<e;t++){let e=r(t),n=c.get(e),a=typeof n==`number`?n:this.options.estimateSize(t);o[t*2]=s,o[t*2+1]=a,s+=a+i}let u=F(e,o,r);return this.measurementsCache=u,u}let u=this.measurementsCache.slice(0,l),d=Array(a).fill(void 0);for(let e=0;e<l;e++){let t=u[e];t&&(d[t.lane]=e)}for(let i=l;i<e;i++){let e=r(i),a=this.laneAssignments.get(i),s,l,f=o===`estimate`||c.has(e);if(a!==void 0&&this.options.lanes>1){s=a;let e=d[s],r=e===void 0?void 0:u[e];l=r?r.end+this.options.gap:t+n}else{let e=this.options.lanes===1?u[i-1]:this.getFurthestMeasurement(u,i);l=e?e.end+this.options.gap:t+n,s=e?e.lane:i%this.options.lanes,this.options.lanes>1&&f&&this.laneAssignments.set(i,s)}let p=c.get(e),m=typeof p==`number`?p:this.options.estimateSize(i),h=l+m;u[i]={index:i,start:l,size:m,end:h,key:e,lane:s},d[s]=i}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=I(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,n,r)=>this.range=e.length>0&&t>0?oe({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:r===1&&this._flatMeasurements!=null?this._flatMeasurements:null}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=I(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,n,r,i)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!this.scrollState||this.scrollState.behavior!==`smooth`)return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e),n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{if(e<0||e>=this.options.count)return;let n,r,i,a=this._flatMeasurements;if(this.options.lanes===1&&a!==null)i=this.options.getItemKey(e),r=a[e*2],n=a[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;i=t.key,r=t.start,n=t.size}let o=t-(this.itemSizeCache.get(i)??n);o!==0&&(this.scrollState?.behavior!==`smooth`&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?r<this.getScrollOffset()+this.scrollAdjustments&&this.scrollDirection!==`backward`:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:i,start:r,size:n,end:r+n,lane:0},o,this))&&(V()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=o:this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0})),(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(i,t),this.itemSizeCacheVersion++,this.notify(!1))},this.getVirtualItems=I(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{let n=[];for(let r=0,i=e.length;r<i;r++){let i=t[e[r]];n.push(i)}return n},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._flatMeasurements,r=this.options.lanes===1&&n!=null;return L(t[ae(0,t.length-1,r?e=>n[e*2]:e=>L(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if(`scrollHeight`in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[e];if(!i)return;if(t===`auto`)if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t];if(t===`end`&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{let r=this.getOffsetForAlignment(e,t),i=this.now();this.scrollState={index:null,align:t,behavior:n,startedAt:i,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r,o=this.now();this.scrollState={index:e,align:a,behavior:n,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getScrollOffset()+e,r=this.now();this.scrollState={index:null,align:`start`,behavior:t,startedAt:r,lastTargetOffset:n,stableFrames:0},this._scrollToOffset(n,{adjustments:void 0,behavior:t}),this.scheduleScrollReconcile()},this.getTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._flatMeasurements;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n})=>{this._intendedScrollOffset=e+(t??0),this.options.scrollToFn(e,{behavior:n,adjustments:t},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let e=this.scrollState.index==null?void 0:this.getOffsetForIndex(this.scrollState.index,this.scrollState.align),t=e?e[0]:this.scrollState.lastTargetOffset,n=t!==this.scrollState.lastTargetOffset;if(!n&&R(t,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=1){this.getScrollOffset()!==t&&this._scrollToOffset(t,{adjustments:void 0,behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let e=this.getSize()||600,n=Math.abs(t-this.getScrollOffset()),r=this.scrollState.behavior===`smooth`&&n>e;this.scrollState.lastTargetOffset=t,r||(this.scrollState.behavior=`auto`),this._scrollToOffset(t,{adjustments:void 0,behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}},ae=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function oe({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:i}){let a=e.length-1,o=i?e=>i[e*2]:t=>e[t].start,s=i?e=>i[e*2]+i[e*2+1]:t=>e[t].end;if(e.length<=r)return{startIndex:0,endIndex:a};let c=ae(0,a,o,n),l=c;if(r===1)for(;l<a&&s(l)<n+t;)l++;else if(r>1){let i=Array(r).fill(0);for(;l<a&&i.some(e=>e<n+t);){let t=e[l];i[t.lane]=t.end,l++}let o=Array(r).fill(n+t);for(;c>=0&&o.some(e=>e>=n);){let t=e[c];o[t.lane]=t.start,c--}c=Math.max(0,c-c%r),l=Math.min(a,l+(r-1-l%r))}return{startIndex:c,endIndex:l}}var se=typeof document<`u`?N.useLayoutEffect:N.useEffect;function ce({useFlushSync:e=!0,...t}){let n=N.useReducer(e=>e+1,0)[1],r={...t,onChange:(r,i)=>{var a;e&&i?(0,P.flushSync)(n):n(),(a=t.onChange)==null||a.call(t,r,i)}},[i]=N.useState(()=>new ie(r));return i.setOptions(r),se(()=>i._didMount(),[]),se(()=>i._willUpdate()),i}function le(e){return ce({observeElementRect:W,observeElementOffset:ne,scrollToFn:re,...e})}var J=s(),ue=e=>`specrails-desktop:code-tree-filter:${e}`,de=e=>`specrails-desktop:code-tree-collapsed:${e}`;function fe(e){return e.split(`/`).length-1}function pe(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function me(e){return e?e.length>10?e.slice(0,10):e:null}function he(e){return e===`created`?`added`:e===`modified`?`changed`:e===`deleted`?`deleted`:null}function ge(e,t){if(t.size===0)return!1;let n=e.split(`/`);for(let e=1;e<n.length;e++)if(t.has(n.slice(0,e).join(`/`)))return!0;return!1}function _e({onOpenFile:e,selectedPath:t,filterJobId:n,filterTicketId:r}){let{t:a}=w(`code`),{activeProjectId:o}=m(),{openTicketDetail:s}=h(),{registerHandler:l,unregisterHandler:f}=S(),[p,g]=(0,N.useState)(()=>{if(!o)return`touched-by-ai`;try{let e=localStorage.getItem(ue(o));if(e===`all`||e===`touched-by-ai`)return e}catch{}return`touched-by-ai`});(0,N.useEffect)(()=>{if(o)try{localStorage.setItem(ue(o),p)}catch{}},[p,o]);let[_,v]=(0,N.useState)(()=>{if(!o)return new Set;try{let e=localStorage.getItem(de(o));if(!e)return new Set;let t=JSON.parse(e);if(Array.isArray(t))return new Set(t.filter(e=>typeof e==`string`))}catch{}return new Set});(0,N.useEffect)(()=>{if(o)try{localStorage.setItem(de(o),JSON.stringify([..._]))}catch{}},[_,o]);let y=(0,N.useCallback)(e=>{v(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),b=(0,N.useCallback)(()=>{v(new Set)},[]),{data:x,refresh:T,isFirstLoad:D}=k({namespace:`code-tree:${p}:${p===`touched-by-ai`?`${n??`all-jobs`}:${r??`all-specs`}`:`all`}`,projectId:o,initialValue:[],fetcher:(0,N.useCallback)(async()=>{let e=[],t=null;for(let i=0;i<100;i+=1){let i=new URLSearchParams({withProvenance:`1`,filter:p});p===`touched-by-ai`&&n&&i.set(`jobId`,n),p===`touched-by-ai`&&typeof r==`number`&&i.set(`ticketId`,String(r)),t&&i.set(`cursor`,t);let a=await fetch(`${c()}/code/tree?${i.toString()}`);if(!a.ok)break;let o=await a.json().catch(()=>({}));if(Array.isArray(o.entries)&&e.push(...o.entries),!o.nextCursor)break;t=o.nextCursor}return e},[p,n,r])}),O=(0,N.useRef)(o);(0,N.useEffect)(()=>{O.current=o},[o]),(0,N.useEffect)(()=>{if(!o)return;let e=`code-tree-${o}`;return l(e,e=>{let t=e;t.projectId===O.current&&t.type===`file.provenance_updated`&&T()}),()=>f(e)},[o,l,f,T]);let M=(0,N.useRef)(null),P=(0,N.useMemo)(()=>(x??[]).filter(e=>!ge(e.path,_)),[x,_]),F=(0,N.useCallback)(()=>{v(new Set((x??[]).filter(e=>e.kind===`dir`).map(e=>e.path)))},[x]),I=le({count:P.length,getScrollElement:()=>M.current,estimateSize:()=>28,overscan:12,initialRect:{width:320,height:600},observeElementRect:(e,t)=>{let n=e.scrollElement;if(!n)return()=>{};let r=()=>{let e=n.getBoundingClientRect(),r=e.height||n.clientHeight||600;t({width:e.width||n.clientWidth||320,height:r})};if(r(),typeof ResizeObserver<`u`){let e=new ResizeObserver(r);return e.observe(n),()=>e.disconnect()}return()=>{}}}),L=P.length===0,R=(0,N.useMemo)(()=>(x??[]).filter(e=>e.kind===`file`).length,[x]);return(0,J.jsxs)(`div`,{className:`flex flex-col h-full`,"data-testid":`file-tree`,children:[(0,J.jsxs)(`div`,{className:`px-2 py-2 border-b border-border text-xs space-y-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>g(`touched-by-ai`),className:i(`px-2 py-1 rounded-md transition-colors`,p===`touched-by-ai`?`bg-accent-primary/20 text-accent-primary`:`text-muted-foreground hover:text-foreground hover:bg-muted/50`),"aria-pressed":p===`touched-by-ai`,children:a(n?`tree.jobFiles`:r?`tree.specFiles`:`tree.touchedByAi`)}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>g(`all`),className:i(`px-2 py-1 rounded-md transition-colors`,p===`all`?`bg-accent-primary/20 text-accent-primary`:`text-muted-foreground hover:text-foreground hover:bg-muted/50`),"aria-pressed":p===`all`,children:a(`tree.allFiles`)}),(0,J.jsx)(`div`,{className:`flex-1`}),(0,J.jsx)(`button`,{type:`button`,onClick:F,title:a(`tree.collapseAll`),className:`px-1.5 py-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50`,"aria-label":a(`tree.collapseAll`),children:(0,J.jsx)(C,{className:`w-3.5 h-3.5`})}),(0,J.jsx)(`button`,{type:`button`,onClick:b,title:a(`tree.expandAll`),className:`px-1.5 py-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50`,"aria-label":a(`tree.expandAll`),children:(0,J.jsx)(E,{className:`w-3.5 h-3.5`})})]}),p===`touched-by-ai`&&R>0&&(0,J.jsx)(`div`,{className:`flex items-center justify-between gap-2 text-[11px] text-muted-foreground`,children:(0,J.jsx)(`span`,{children:a(`tree.touchedCount`,{count:R})})})]}),L&&D?(0,J.jsx)(`div`,{className:`flex-1 flex items-center justify-center px-4 text-center`,"data-testid":`file-tree-loading`,children:(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground animate-pulse`,children:a(`tree.loadingFiles`)})}):L&&p===`touched-by-ai`?(0,J.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center px-4 text-center gap-3`,children:[(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:a(`tree.emptyTouched`)}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>g(`all`),className:`text-xs px-3 py-1.5 rounded-md bg-accent-primary/20 text-accent-primary hover:bg-accent-primary/30`,children:a(`tree.showAllFiles`)})]}):L?(0,J.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-xs text-muted-foreground px-4 text-center`,children:a(`tree.noFiles`)}):(0,J.jsx)(`div`,{ref:M,className:`flex-1 overflow-auto`,"data-testid":`file-tree-scroller`,children:(0,J.jsx)(`div`,{style:{height:I.getTotalSize(),position:`relative`,width:`100%`},children:I.getVirtualItems().map(n=>{let r=P[n.index],o=fe(r.path)*12,c=r.kind===`file`&&r.path===t,l=r.provenance?.createdByTicketId,f=r.provenance?.modifiedByTicketIds??[],p=r.provenance?.latest??null,m=me(p?.jobId),h=he(p?.kind),g=r.kind===`dir`,v=g&&_.has(r.path),b=r.provenance?.touchedFileCount??0;return(0,J.jsxs)(`div`,{style:{position:`absolute`,top:0,left:0,transform:`translateY(${n.start}px)`,height:n.size,width:`100%`},className:i(`flex items-center gap-2 px-2 text-xs cursor-pointer hover:bg-muted/50`,c&&`bg-muted text-foreground`),onClick:()=>{g?y(r.path):e(r.path)},role:`button`,tabIndex:0,"aria-expanded":g?!v:void 0,"data-testid":`file-tree-row-${r.path}`,children:[(0,J.jsxs)(`span`,{style:{paddingLeft:o},className:`flex items-center gap-1 min-w-0 flex-1`,children:[g?(0,J.jsxs)(J.Fragment,{children:[v?(0,J.jsx)(C,{className:`w-3 h-3 text-muted-foreground flex-shrink-0`}):(0,J.jsx)(E,{className:`w-3 h-3 text-muted-foreground flex-shrink-0`}),v?(0,J.jsx)(j,{className:`w-3.5 h-3.5 text-accent-info flex-shrink-0`}):(0,J.jsx)(u,{className:`w-3.5 h-3.5 text-accent-info flex-shrink-0`})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`w-3 flex-shrink-0`}),(0,J.jsx)(A,{className:`w-3.5 h-3.5 text-muted-foreground flex-shrink-0`})]}),(0,J.jsx)(`span`,{className:`truncate ml-0.5`,children:pe(r.path)})]}),(0,J.jsxs)(`span`,{className:`flex items-center gap-1 flex-shrink-0`,children:[g&&b>0&&(0,J.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-muted/60 text-muted-foreground`,title:a(`tree.folderTouched`,{count:b}),children:b}),!g&&h&&(0,J.jsx)(`span`,{className:i(`text-[10px] px-1.5 py-0.5 rounded`,p?.kind===`created`&&`bg-accent-success/15 text-accent-success`,p?.kind===`modified`&&`bg-accent-info/15 text-accent-info`,p?.kind===`deleted`&&`bg-destructive/15 text-destructive`),title:p?.kind===`created`?a(`tree.latestTitleCreated`):p?.kind===`deleted`?a(`tree.latestTitleDeleted`):a(`tree.latestTitleModified`),children:a(`action.${h}`)}),!g&&m&&(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded bg-muted/60 text-muted-foreground font-mono`,title:a(`tree.jobTitle`,{jobId:p?.jobId??``}),children:[(0,J.jsx)(d,{className:`h-3 w-3`}),m]}),!g&&typeof l==`number`&&(0,J.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),s(l)},className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-success/20 text-accent-success`,"data-testid":`provenance-chip-created-${l}`,title:a(`tree.createdBySpec`,{id:l}),children:[`#`,l]}),!g&&f.slice(0,2).map(e=>(0,J.jsxs)(`button`,{type:`button`,onClick:t=>{t.stopPropagation(),s(e)},className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-info/15 text-accent-info`,"data-testid":`provenance-chip-modified-${e}`,title:a(`tree.modifiedBySpec`,{id:e}),children:[`#`,e]},e))]})]},r.path)})})})]})}function ve(e){return new Worker(`/assets/editor.worker-Bd9IXS8d.js`,{name:e?.name})}function ye(e){return new Worker(`/assets/json.worker-DzV-CpCQ.js`,{name:e?.name})}function be(e){return new Worker(`/assets/css.worker-Wv5dxAWO.js`,{name:e?.name})}function xe(e){return new Worker(`/assets/html.worker-CQP8QQsS.js`,{name:e?.name})}function Se(e){return new Worker(`/assets/ts.worker-METxwbDZ.js`,{name:e?.name})}var Ce=!1;function we(e){let t=e.trim().match(/^hsl\(\s*([-\d.]+)[\s,]+([\d.]+)%[\s,]+([\d.]+)%\s*\)$/i);return t?[parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3])]:null}function Y(e,t=`#1e1e1e`){if(e.startsWith(`#`))return e;let n=we(e);if(!n)return t;let[r,i,a]=n,o=i/100,s=a/100,c=(1-Math.abs(2*s-1))*o,l=(r%360+360)%360/60,u=c*(1-Math.abs(l%2-1)),d=0,f=0,p=0;l<1?(d=c,f=u):l<2?(d=u,f=c):l<3?(f=c,p=u):l<4?(f=u,p=c):l<5?(d=u,p=c):(d=c,p=u);let m=s-c/2,h=e=>Math.round((e+m)*255).toString(16).padStart(2,`0`);return`#${h(d)}${h(f)}${h(p)}`}function Te(e){return`specrails-${e}`}function Ee(e,t){let n=Te(t.id),r=t.xterm,i=Y(r.background),a=Y(r.foreground),o=Y(r.brightBlack),s=Y(r.magenta),c=Y(r.yellow),l=Y(r.cyan),u=Y(r.blue),d=Y(r.green),f=Y(r.brightBlack),p=Y(r.brightCyan),m=Y(r.red),h=Y(r.selectionBackground);return e.editor.defineTheme(n,{base:t.scheme===`light`?`vs`:`vs-dark`,inherit:!0,rules:[{token:``,foreground:a.slice(1)},{token:`comment`,foreground:f.slice(1),fontStyle:`italic`},{token:`keyword`,foreground:s.slice(1)},{token:`string`,foreground:c.slice(1)},{token:`number`,foreground:l.slice(1)},{token:`constant`,foreground:p.slice(1)},{token:`constant.numeric`,foreground:l.slice(1)},{token:`type`,foreground:d.slice(1)},{token:`type.identifier`,foreground:d.slice(1)},{token:`identifier`,foreground:a.slice(1)},{token:`function`,foreground:u.slice(1)},{token:`tag`,foreground:m.slice(1)},{token:`attribute.name`,foreground:p.slice(1)},{token:`attribute.value`,foreground:c.slice(1)},{token:`delimiter`,foreground:o.slice(1)},{token:`operator`,foreground:o.slice(1)}],colors:{"editor.background":i,"editor.foreground":a,"editorLineNumber.foreground":o,"editorLineNumber.activeForeground":a,"editorCursor.foreground":Y(r.cursor),"editor.selectionBackground":h,"editor.inactiveSelectionBackground":h,"editor.lineHighlightBackground":Y(r.black),"editor.lineHighlightBorder":Y(r.black),"editorGutter.background":i,"editorWhitespace.foreground":o,"editorIndentGuide.background1":Y(r.black),"editorIndentGuide.activeBackground1":o,"scrollbarSlider.background":`${o}55`,"scrollbarSlider.hoverBackground":`${o}88`,"scrollbarSlider.activeBackground":`${o}bb`,"minimap.background":i}}),n}function De(){Ce||=(self.MonacoEnvironment={getWorker(e,t){switch(t){case`json`:return new ye;case`css`:case`scss`:case`less`:return new be;case`html`:case`handlebars`:case`razor`:return new xe;case`typescript`:case`javascript`:return new Se;default:return new ve}}},!0)}function Oe({content:e,language:n}){let{t:r}=w(`code`),i=x(),a=(0,N.useRef)(null),o=(0,N.useRef)(null),s=(0,N.useRef)(null),[c,l]=(0,N.useState)(!1),u=(0,N.useRef)(e),d=(0,N.useRef)(n),f=(0,N.useRef)(i);return(0,N.useEffect)(()=>{u.current=e},[e]),(0,N.useEffect)(()=>{d.current=n},[n]),(0,N.useEffect)(()=>{f.current=i},[i]),(0,N.useEffect)(()=>{let e=!1;return De(),t(()=>import(`./editor.main-CfXxHimg.js`).then(t=>{if(e||!a.current)return;s.current=t;let n=Ee(t,f.current);o.current=t.editor.create(a.current,{value:u.current,language:d.current,readOnly:!0,theme:n,minimap:{enabled:!1},lineNumbers:`on`,scrollBeyondLastLine:!1,automaticLayout:!0,fontSize:13})}),__vite__mapDeps([0,1,2,3,4,5,6])).catch(()=>{e||l(!0)}),()=>{e=!0,o.current?.dispose?.(),o.current=null}},[]),(0,N.useEffect)(()=>{o.current?.setValue?.(e)},[e]),(0,N.useEffect)(()=>{let e=s.current,t=o.current;if(!e||!t)return;let r=t.getModel?.();r&&e.editor.setModelLanguage(r,n)},[n]),(0,N.useEffect)(()=>{let e=s.current;if(!e)return;let t=Ee(e,i);e.editor.setTheme(t)},[i]),c?(0,J.jsxs)(`div`,{className:`w-full h-full flex flex-col items-center justify-center gap-2 text-sm text-muted-foreground`,"data-testid":`monaco-load-error`,children:[(0,J.jsx)(`span`,{children:r(`monaco.loadFailed`)}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>window.location.reload(),className:`rounded-md bg-accent-primary/15 px-3 py-1 text-xs text-accent-primary hover:bg-accent-primary/25`,children:r(`monaco.reload`)})]}):(0,J.jsx)(`div`,{ref:a,className:`w-full h-full`,"data-testid":`monaco-host`})}var ke=(0,N.lazy)(async()=>({default:Oe}));function Ae({content:e,language:t}){let{t:n}=w(`code`);return(0,J.jsx)(N.Suspense,{fallback:(0,J.jsx)(`div`,{className:`w-full h-full flex items-center justify-center text-sm text-muted-foreground animate-pulse`,children:n(`monaco.loadingEditor`)}),children:(0,J.jsx)(ke,{content:e,language:t})})}function je(e,t){if(!e)return null;let n=Date.parse(e);if(Number.isNaN(n))return null;let r=Math.round((n-Date.now())/1e3),i=new Intl.RelativeTimeFormat(t,{numeric:`auto`}),a=Math.abs(r);return a<60?i.format(r,`second`):a<3600?i.format(Math.round(r/60),`minute`):a<86400?i.format(Math.round(r/3600),`hour`):i.format(Math.round(r/86400),`day`)}function Me({path:e,summary:t,stale:n,regenerating:r,generateDisabledReason:a,onCollapse:o}){let{t:s,i18n:c}=w(`code`),{openTicketDetail:l}=h();if(!t)return(0,J.jsx)(`div`,{className:`border-b border-border px-4 py-3 bg-surface`,"data-testid":`summary-header-empty`,children:(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`flex flex-col gap-0.5 min-w-0`,children:[(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground truncate`,children:e}),(0,J.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a?s(`summary.unavailable`,{reason:a}):s(`summary.empty`)})]}),o&&(0,J.jsxs)(`button`,{type:`button`,onClick:o,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[11px] text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[(0,J.jsx)(g,{className:`h-3.5 w-3.5`}),s(`summary.hide`)]})]})});let u=je(t.generatedAt,c.language),d=t.triggeredBy?.ticketId,f=t.triggeredBy?.modifiedTicketIds??[];return(0,J.jsx)(`div`,{className:`border-b border-border px-4 py-3 bg-surface`,"data-testid":`summary-header`,children:(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground truncate`,children:e}),n&&(0,J.jsx)(`span`,{className:i(`text-[10px] px-1.5 py-0.5 rounded bg-accent-warning/20 text-accent-warning font-medium`),"data-testid":`summary-stale-badge`,children:s(`summary.stale`)}),r&&(0,J.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-accent-primary animate-pulse`,"aria-hidden":!0})]}),(0,J.jsx)(`p`,{className:`text-sm text-foreground mt-1`,children:t.summary}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2 mt-2 flex-wrap`,children:[typeof d==`number`&&(0,J.jsxs)(`button`,{type:`button`,onClick:()=>l(d),className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-success/20 text-accent-success`,children:[`#`,d]}),f.map(e=>(0,J.jsxs)(`button`,{type:`button`,onClick:()=>l(e),className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-info/15 text-accent-info`,children:[`#`,e]},e)),u&&(0,J.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:u})]})]}),o&&(0,J.jsxs)(`button`,{type:`button`,onClick:o,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[11px] text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[(0,J.jsx)(g,{className:`h-3.5 w-3.5`}),s(`summary.hide`)]})]})})}function Ne({content:e}){return(0,J.jsx)(b,{remarkPlugins:[_],children:e})}function Pe(e,t){return t===`markdown`||t===`md`?!0:/\.(md|mdx|markdown)$/i.test(e)}var X=180,Fe=120,Ie=240;function Le(e){return e?`specrails-desktop:code-summary-collapsed:${e}`:null}function Re(e){return e?`specrails-desktop:code-history-height:${e}`:null}function ze(e){return e?`specrails-desktop:code-history-collapsed:${e}`:null}function Be(e){let t=Re(e);if(!t)return X;try{let e=localStorage.getItem(t),n=e?Number(e):NaN;return Number.isFinite(n)&&n>0?n:X}catch{return X}}function Ve(e,t){let n=Re(e);if(n)try{localStorage.setItem(n,String(Math.round(t)))}catch{}}function He(e){let t=Le(e);if(!t)return!1;try{return localStorage.getItem(t)===`true`}catch{return!1}}function Ue(e,t){let n=Le(e);if(n)try{localStorage.setItem(n,t?`true`:`false`)}catch{}}function We(e){let t=ze(e);if(!t)return!1;try{return localStorage.getItem(t)===`true`}catch{return!1}}function Ge(e,t){let n=ze(e);if(n)try{localStorage.setItem(n,t?`true`:`false`)}catch{}}function Z(e,t){let n=Math.max(Fe,t-Ie);return Math.min(Math.max(e,Fe),n)}function Ke({relPath:e,onFilterJob:t,onSummaryActionChange:n,onCopyPathActionChange:r}){let{t:i}=w(`code`),{activeProjectId:o}=m(),{openTicketDetail:s}=h(),{registerHandler:l,unregisterHandler:u}=S(),d=(0,N.useRef)(null),[f,p]=(0,N.useState)(null),[_,v]=(0,N.useState)(!0),[y,b]=(0,N.useState)(!1),[x,C]=(0,N.useState)(!1),[T,D]=(0,N.useState)(()=>He(o)),[O,k]=(0,N.useState)(()=>Be(o)),[A,j]=(0,N.useState)(()=>We(o)),M=(0,N.useRef)(o);(0,N.useEffect)(()=>{M.current=o},[o]);let P=(0,N.useRef)(e);(0,N.useEffect)(()=>{P.current=e},[e]),(0,N.useEffect)(()=>{let e=d.current?.clientHeight||window.innerHeight;D(He(o)),k(Z(Be(o),e)),j(We(o))},[o]);let F=(0,N.useCallback)(e=>{let t=e.clientY,n=O,r=d.current?.clientHeight||window.innerHeight,i=e.currentTarget;try{i.setPointerCapture(e.pointerId)}catch{}function a(e){k(Z(n+(t-e.clientY),r))}function s(){window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,s),k(e=>{let t=Z(e,r);return Ve(o,t),t})}window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,s),window.addEventListener(`pointercancel`,s)},[o,O]),I=(0,N.useCallback)(()=>{let e=Z(X,d.current?.clientHeight||window.innerHeight);k(e),Ve(o,e)},[o]),L=(0,N.useCallback)(()=>{D(e=>{let t=!e;return Ue(o,t),t})},[o]),R=(0,N.useCallback)(()=>{j(e=>{let t=!e;return Ge(o,t),t})},[o]);(0,N.useEffect)(()=>{b(!1),C(!1),W(`preview`)},[e]);let z=(0,N.useRef)(0),B=(0,N.useCallback)(async()=>{let t=++z.current;v(!0);try{let n=await fetch(`${c()}/code/file?path=${encodeURIComponent(e)}`);if(t!==z.current)return;if(!n.ok){p(null);return}let r=await n.json();if(t!==z.current)return;p(r)}catch{t===z.current&&p(null)}finally{t===z.current&&v(!1)}},[e,o]);(0,N.useEffect)(()=>{B()},[B]),(0,N.useEffect)(()=>{if(!o)return;let e=`code-file-${o}`;return l(e,e=>{let t=e;t.projectId===M.current&&(t.type===`file.summary_updated`&&t.path===P.current?(b(!1),B()):t.type===`file.summary_failed`&&t.path===P.current?(a.error(t.reason??i(`summary.generationFailed`)),b(!1)):t.type===`file.summary_skipped`&&t.path===P.current&&(t.reason&&a(i(`summary.skipped`,{reason:t.reason})),b(!1)))}),()=>u(e)},[o,l,u,B,i]);let V=(0,N.useCallback)(async t=>{b(!0);try{let n=await fetch(`${c()}/code/file/regenerate-summary?path=${encodeURIComponent(e)}`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({overrideBudget:t})}),r=await n.json().catch(()=>({}));if(!n.ok){b(!1);let e=typeof r.skipped==`string`?r.skipped:null;a.error(e?i(`summary.skipped`,{reason:e}):i(`summary.generationFailed`));return}if(r.skipped===`budget`){b(!1),C(!0);return}if(r.skipped){b(!1),a(i(`summary.skipped`,{reason:r.skipped}));return}await B(),b(!1)}catch{b(!1),a.error(i(`summary.generationFailed`))}},[B,e,i]),H=(0,N.useCallback)(async()=>{let t=f?.absolutePath??e;try{await navigator.clipboard?.writeText(t),a.success(i(`viewer.pathCopied`))}catch{a.error(i(`viewer.copyPathFailed`))}},[f,e,i]),ee=(0,N.useMemo)(()=>Pe(e,f?.language),[e,f?.language]),[U,W]=(0,N.useState)(`preview`),G=f?.summary??null,te=!!f?.summaryStale,K=f?.provenance??[],ne=f?.reason===`not-found`,q=ne?i(`summary.reason.missing`):f?.binary?i(`summary.reason.binary`):f?.tooLarge?i(`summary.reason.tooLarge`):null;return(0,N.useEffect)(()=>{if(n){if(_&&!f){n(null);return}return n({hasSummary:!!G,regenerating:y,disabledReason:q,onClick:()=>V(!1)}),()=>n(null)}},[f,V,_,n,y,G,q]),(0,N.useEffect)(()=>{if(r){if(_&&!f){r(null);return}return r({onClick:H}),()=>r(null)}},[H,f,_,r]),_&&!f?(0,J.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-sm text-muted-foreground animate-pulse`,children:i(`viewer.loadingFile`)}):(0,J.jsxs)(`div`,{ref:d,className:`flex flex-col h-full`,"data-testid":`file-viewer`,children:[T?(0,J.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center justify-between border-b border-border bg-surface px-4`,"data-testid":`summary-header-collapsed`,children:[(0,J.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:e}),(0,J.jsxs)(`button`,{type:`button`,onClick:L,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[11px] text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[(0,J.jsx)(E,{className:`h-3.5 w-3.5`}),i(`viewer.showSummary`)]})]}):(0,J.jsx)(Me,{path:e,summary:G,stale:te,regenerating:y,generateDisabledReason:q,onCollapse:L}),(0,J.jsxs)(`div`,{className:`px-4 py-1 border-b border-border flex items-center justify-between gap-3`,children:[(0,J.jsx)(`div`,{className:`flex items-center gap-2 min-w-0`,children:ee&&f?.content!==void 0&&!f.binary&&!f.tooLarge&&(0,J.jsxs)(`div`,{className:`flex items-center gap-1 text-[11px]`,role:`group`,"aria-label":i(`viewer.markdownViewMode`),children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>W(`preview`),"aria-pressed":U===`preview`,className:U===`preview`?`px-2 py-1 rounded-md bg-accent-primary/20 text-accent-primary`:`px-2 py-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50`,children:i(`viewer.preview`)}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>W(`raw`),"aria-pressed":U===`raw`,className:U===`raw`?`px-2 py-1 rounded-md bg-accent-primary/20 text-accent-primary`:`px-2 py-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/50`,children:i(`viewer.raw`)})]})}),(0,J.jsx)(`span`,{})]}),(0,J.jsx)(`div`,{className:`flex-1 overflow-hidden`,children:ne?(0,J.jsx)(`div`,{className:`h-full flex items-center justify-center text-sm text-muted-foreground`,"data-testid":`file-missing`,children:i(`viewer.missingFile`)}):f?.binary?(0,J.jsx)(`div`,{className:`h-full flex items-center justify-center text-sm text-muted-foreground`,"data-testid":`file-binary`,children:i(`viewer.binaryFile`)}):f?.tooLarge?(0,J.jsx)(`div`,{className:`h-full flex items-center justify-center text-sm text-muted-foreground`,"data-testid":`file-too-large`,children:i(`viewer.tooLarge`,{size:Math.round((f.sizeBytes??0)/1024/1024)})}):f?.content===void 0?(0,J.jsx)(`div`,{className:`h-full flex items-center justify-center text-sm text-muted-foreground`,children:i(`viewer.noContent`)}):ee&&U===`preview`?(0,J.jsx)(`div`,{className:`h-full overflow-auto px-6 py-4 prose prose-invert prose-sm max-w-none prose-p:my-2 prose-headings:mt-4 prose-headings:mb-2 prose-pre:bg-muted/40 prose-pre:rounded-md prose-code:before:content-none prose-code:after:content-none`,"data-testid":`markdown-preview`,children:(0,J.jsx)(Ne,{content:f.content})}):(0,J.jsx)(Ae,{content:f.content,language:f.language??`plaintext`})}),K.length>0&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{role:`separator`,"aria-orientation":`horizontal`,"aria-label":i(`history.resize`),onPointerDown:A?void 0:F,onDoubleClick:A?void 0:I,className:A?`flex h-8 shrink-0 items-center justify-between border-t border-border bg-card/35 px-4`:`flex h-8 shrink-0 cursor-row-resize items-center justify-between border-y border-border/40 bg-card/35 px-4 hover:bg-accent-primary/10`,title:A?void 0:i(`resizer.hint`),"data-testid":`code-history-resizer`,children:[(0,J.jsx)(`span`,{className:`text-[11px] font-medium uppercase tracking-wider text-muted-foreground`,children:i(`history.title`,{count:K.length})}),(0,J.jsxs)(`button`,{type:`button`,onPointerDown:e=>e.stopPropagation(),onClick:R,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[11px] text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[A?(0,J.jsx)(g,{className:`h-3.5 w-3.5`}):(0,J.jsx)(E,{className:`h-3.5 w-3.5`}),i(A?`history.show`:`history.hide`)]})]}),!A&&(0,J.jsx)(qe,{rows:K,onOpenTicket:s,onFilterJob:t,height:O})]}),x&&(0,J.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/50`,role:`dialog`,"aria-modal":`true`,"data-testid":`budget-prompt`,children:(0,J.jsxs)(`div`,{className:`bg-card border border-border rounded-lg p-4 w-80 flex flex-col gap-3`,children:[(0,J.jsx)(`p`,{className:`text-sm text-foreground`,children:i(`viewer.budgetPrompt`)}),(0,J.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>C(!1),className:`text-xs px-3 py-1.5 rounded-md text-muted-foreground hover:text-foreground`,children:i(`common:actions.cancel`)}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>{C(!1),V(!0)},className:`text-xs px-3 py-1.5 rounded-md bg-accent-primary text-white`,children:i(`common:actions.confirm`)})]})]})})]})}function qe({rows:e,onOpenTicket:t,onFilterJob:r,height:i}){let{t:a}=w(`code`),[o,s]=(0,N.useState)(null),[u,p]=(0,N.useState)({});if(e.length===0)return null;async function m(e,t){if(o===t){s(null);return}if(s(t),!(!e.jobId||u[t])){p(e=>({...e,[t]:`loading`}));try{let n=new URLSearchParams({jobId:e.jobId,path:e.path}),r=await fetch(`${c()}/code/diff?${n.toString()}`);if(r.status===404){p(e=>({...e,[t]:`missing`}));return}if(!r.ok)throw Error(`diff failed`);let i=await r.json();p(e=>({...e,[t]:{patch:i.patch??``,truncated:i.truncated===!0}}))}catch{p(e=>({...e,[t]:`missing`}))}}}return(0,J.jsx)(`div`,{className:`shrink-0 border-t border-border bg-card/40 px-4 py-3 overflow-hidden`,style:{height:i},"data-testid":`file-provenance-timeline`,children:(0,J.jsx)(`div`,{className:`h-full overflow-auto space-y-1`,children:e.map((e,i)=>{let s=e.kind===`created`?l:e.kind===`deleted`?n:f,c=e.jobId?e.jobId.length>12?e.jobId.slice(0,12):e.jobId:a(`history.unknownJob`),p=`${e.jobId??`job`}:${e.path}:${e.at}:${i}`,h=u[p];return(0,J.jsxs)(`div`,{className:`rounded-md hover:bg-muted/40`,children:[(0,J.jsxs)(`div`,{className:`grid grid-cols-[minmax(72px,auto)_minmax(0,1fr)_auto] items-center gap-2 text-xs px-2 py-1.5`,children:[(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 min-w-0`,children:[(0,J.jsx)(s,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,J.jsx)(`span`,{className:`capitalize`,children:a(`kind.${e.kind}`)})]}),(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 min-w-0 text-muted-foreground`,children:[(0,J.jsx)(d,{className:`h-3.5 w-3.5 shrink-0`}),e.jobId&&r?(0,J.jsx)(`button`,{type:`button`,onClick:()=>r(e.jobId),className:`font-mono truncate hover:text-foreground`,title:a(`history.filterByJob`,{jobId:e.jobId}),children:c}):(0,J.jsx)(`span`,{className:`font-mono truncate`,title:e.jobId??void 0,children:c}),e.jobId&&(0,J.jsx)(`button`,{type:`button`,onClick:()=>m(e,p),className:`shrink-0 rounded bg-muted/60 px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted hover:text-foreground`,children:a(`history.diff`)}),typeof e.ticketId==`number`&&(0,J.jsx)(`button`,{type:`button`,onClick:()=>t(e.ticketId),className:`shrink-0 rounded bg-accent-primary/15 px-1.5 py-0.5 text-[10px] text-accent-primary hover:bg-accent-primary/25`,title:a(`history.openSpec`,{ticketId:e.ticketId}),children:a(`history.specChip`,{ticketId:e.ticketId})})]}),(0,J.jsx)(`time`,{className:`text-[11px] text-muted-foreground`,dateTime:new Date(e.at).toISOString(),children:new Date(e.at).toLocaleString()})]}),o===p&&(0,J.jsx)(`div`,{className:`px-2 pb-2`,children:h===`loading`?(0,J.jsx)(`div`,{className:`rounded-md bg-muted/35 px-2 py-2 text-[11px] text-muted-foreground`,children:a(`history.loadingDiff`)}):h===`missing`||!h?(0,J.jsx)(`div`,{className:`rounded-md bg-muted/35 px-2 py-2 text-[11px] text-muted-foreground`,children:a(`history.diffUnavailable`)}):(0,J.jsxs)(`pre`,{className:`max-h-72 overflow-auto rounded-md bg-muted/50 px-2 py-2 font-mono text-[11px] leading-relaxed text-foreground/85`,children:[h.patch,h.truncated?`\n${a(`history.diffTruncated`)}`:``]})})]},p)})})})}var Q=320,Je=240,Ye=520;function Xe(e){return e?`specrails-desktop:code-tree-width:${e}`:null}function Ze(e){let t=Xe(e);if(!t)return Q;try{let e=localStorage.getItem(t),n=e?Number(e):NaN;return Number.isFinite(n)&&n>0?n:Q}catch{return Q}}function Qe(e,t){let n=Xe(e);if(n)try{localStorage.setItem(n,String(Math.round(t)))}catch{}}function $(e,t){let n=Math.max(Je,t-Ye);return Math.min(Math.max(e,Je),n)}function $e(){let{t:e}=w(`code`),{activeProjectId:t}=m(),[n]=r(),i=p(),a=(0,N.useRef)(null),[o,s]=(0,N.useState)(n.get(`path`)),[c,l]=(0,N.useState)(null),[u,d]=(0,N.useState)(null),[f,h]=(0,N.useState)(()=>Ze(t)),g=n.get(`jobId`),_=(0,N.useMemo)(()=>{let e=n.get(`ticketId`);if(!e)return null;let t=Number(e);return Number.isInteger(t)&&t>0?t:null},[n]),[v,y]=(0,N.useState)(_==null?``:String(_));(0,N.useEffect)(()=>{let e=n.get(`path`);e!==o&&s(e)},[n]),(0,N.useEffect)(()=>{y(_==null?``:String(_))},[_]),(0,N.useEffect)(()=>{let e=a.current?.clientWidth||window.innerWidth;h($(Ze(t),e))},[t]),(0,N.useEffect)(()=>{let e=a.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(e=>{let t=e[0]?.contentRect.width;typeof t==`number`&&h(e=>$(e,t))});return t.observe(e),()=>t.disconnect()},[]);let b=(0,N.useCallback)(e=>{let n=e.clientX,r=f,i=a.current?.clientWidth||window.innerWidth,o=e.currentTarget;try{o.setPointerCapture(e.pointerId)}catch{}function s(e){h($(r+(e.clientX-n),i))}function c(){window.removeEventListener(`pointermove`,s),window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),h(e=>{let n=$(e,i);return Qe(t,n),n})}window.addEventListener(`pointermove`,s),window.addEventListener(`pointerup`,c),window.addEventListener(`pointercancel`,c)},[t,f]),x=(0,N.useCallback)(()=>{let e=$(Q,a.current?.clientWidth||window.innerWidth);h(e),Qe(t,e)},[t]),S=(0,N.useCallback)(e=>{s(e);let t=new URLSearchParams(n);t.set(`path`,e),i({pathname:`/code`,search:`?${t.toString()}`},{replace:!0})},[i,n]),C=(0,N.useCallback)(e=>{let t=new URLSearchParams(n);t.set(`jobId`,e),t.delete(`ticketId`),i({pathname:`/code`,search:`?${t.toString()}`},{replace:!0})},[i,n]),T=(0,N.useCallback)(()=>{let e=new URLSearchParams(n);e.delete(`jobId`),e.delete(`ticketId`),i({pathname:`/code`,search:e.toString()?`?${e.toString()}`:``},{replace:!0})},[i,n]),E=(0,N.useCallback)(e=>{let t=Number(e.trim());if(!Number.isInteger(t)||t<=0){T();return}let r=new URLSearchParams(n);r.set(`ticketId`,String(t)),r.delete(`jobId`),i({pathname:`/code`,search:`?${r.toString()}`},{replace:!0})},[T,i,n]);return(0,J.jsxs)(`div`,{ref:a,className:`flex h-full w-full`,"data-testid":`code-page`,children:[(0,J.jsx)(`aside`,{className:`overflow-hidden flex flex-col shrink-0`,style:{width:f},children:(0,J.jsx)(_e,{onOpenFile:S,selectedPath:o,filterJobId:g,filterTicketId:_},t??`no-project`)}),(0,J.jsx)(`div`,{role:`separator`,"aria-orientation":`vertical`,"aria-label":e(`page.resizeFileTree`),onPointerDown:b,onDoubleClick:x,className:`relative w-1.5 shrink-0 cursor-col-resize select-none touch-none border-x border-border/40 hover:bg-accent-primary/20 focus-visible:outline-none focus-visible:bg-accent-primary/30`,title:e(`resizer.hint`),"data-testid":`code-tree-resizer`}),(0,J.jsxs)(`main`,{className:`flex-1 overflow-hidden flex flex-col`,children:[(0,J.jsx)(et,{jobId:g,ticketId:_,ticketInput:v,onTicketInputChange:y,onApplyTicket:E,onClear:T,summaryAction:c,copyPathAction:u}),(g||_)&&(0,J.jsx)(tt,{jobId:g,ticketId:_,onOpenFile:S}),o?(0,J.jsx)(Ke,{relPath:o,onFilterJob:C,onSummaryActionChange:l,onCopyPathActionChange:d}):(0,J.jsx)(`div`,{className:`h-full flex items-center justify-center text-sm text-muted-foreground`,children:e(`page.selectFile`)})]})]})}function et({jobId:e,ticketId:t,ticketInput:n,onTicketInputChange:r,onApplyTicket:i,onClear:a,summaryAction:s,copyPathAction:c}){let{t:l}=w(`code`),u=t?`spec`:e?`job-context`:`all`;return(0,J.jsx)(`div`,{className:`border-b border-border bg-background/80 px-4 py-2`,"data-testid":`code-provenance-toolbar`,children:(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs font-medium text-muted-foreground`,children:[(0,J.jsx)(M,{className:`h-3.5 w-3.5`}),l(`toolbar.scope`)]}),(0,J.jsx)(`button`,{type:`button`,onClick:a,"aria-pressed":u===`all`,className:u===`all`?`rounded-md bg-accent-primary/20 px-2 py-1 text-xs text-accent-primary`:`rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:l(`toolbar.allAi`)}),(0,J.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-border/70 bg-card/40 px-1 py-1`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>i(n),"aria-pressed":u===`spec`,className:u===`spec`?`rounded bg-accent-success/20 px-2 py-0.5 text-xs text-accent-success`:`rounded px-2 py-0.5 text-xs text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:l(`toolbar.spec`)}),(0,J.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&i(n)},placeholder:l(`toolbar.ticketIdPlaceholder`),inputMode:`numeric`,className:`h-6 w-20 bg-transparent px-1 font-mono text-xs outline-none placeholder:text-muted-foreground/60`})]}),(0,J.jsx)(`div`,{className:`flex-1`}),c&&(0,J.jsx)(`button`,{type:`button`,onClick:c.onClick,className:`inline-flex items-center gap-1.5 rounded-md px-2.5 py-1 text-xs text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:l(`toolbar.copyFilePath`)}),s&&(0,J.jsxs)(`button`,{type:`button`,onClick:s.onClick,disabled:s.regenerating||!!s.disabledReason,"aria-label":s.hasSummary?l(`toolbar.regenerateSummary`):l(`toolbar.generateSummary`),className:`inline-flex items-center gap-1.5 rounded-md bg-accent-primary/15 px-2.5 py-1 text-xs text-accent-primary hover:bg-accent-primary/25 disabled:opacity-50`,title:s.disabledReason?l(`toolbar.summaryUnavailable`,{reason:s.disabledReason}):void 0,children:[(0,J.jsx)(O,{className:s.regenerating?`h-3.5 w-3.5 animate-spin`:`h-3.5 w-3.5`}),s.hasSummary?s.regenerating?l(`toolbar.regenerating`):l(`toolbar.regenerateSummary`):s.regenerating?l(`toolbar.generating`):l(`toolbar.generateSummary`)]}),u===`job-context`&&(0,J.jsx)(`span`,{className:`rounded-md bg-accent-info/15 px-2 py-1 text-xs text-accent-info`,children:l(`toolbar.jobContext`)}),(e||t)&&(0,J.jsxs)(`button`,{type:`button`,onClick:a,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[(0,J.jsx)(o,{className:`h-3.5 w-3.5`}),l(`toolbar.clear`)]})]})})}function tt({jobId:e,ticketId:t,onOpenFile:n}){let{t:r}=w(`code`),[i,a]=(0,N.useState)(null);(0,N.useEffect)(()=>{let n=!1,r=new URLSearchParams;return e&&r.set(`jobId`,e),t&&r.set(`ticketId`,String(t)),fetch(`${c()}/code/provenance?${r.toString()}`).then(e=>e.ok?e.json():[]).then(e=>{n||a(Array.isArray(e)?e:[])}).catch(()=>{n||a([])}),()=>{n=!0}},[e,t]);let o=(0,N.useMemo)(()=>{let e=i??[];return{created:e.filter(e=>e.kind===`created`),modified:e.filter(e=>e.kind===`modified`),deleted:e.filter(e=>e.kind===`deleted`)}},[i]),s=i?.length??0;return(0,J.jsx)(`section`,{className:`border-b border-border bg-card/35 px-4 py-3`,"data-testid":`provenance-result-panel`,children:(0,J.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,J.jsxs)(`div`,{className:`min-w-0`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(`h2`,{className:`text-sm font-semibold truncate`,children:e?r(`provenancePanel.jobTitle`,{jobId:e}):r(`provenancePanel.specTitle`,{ticketId:t})}),(0,J.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:r(`provenancePanel.touchedFiles`,{count:s})})]}),(0,J.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[(0,J.jsx)(nt,{label:r(`action.added`),rows:o.created,icon:`created`,onOpenFile:n}),(0,J.jsx)(nt,{label:r(`action.changed`),rows:o.modified,icon:`modified`,onOpenFile:n}),(0,J.jsx)(nt,{label:r(`action.deleted`),rows:o.deleted,icon:`deleted`,onOpenFile:n})]})]}),(0,J.jsx)(`div`,{className:`flex items-center gap-1 shrink-0`,children:e&&(0,J.jsxs)(`a`,{href:`/jobs/${encodeURIComponent(e)}`,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-muted/50 hover:text-foreground`,children:[(0,J.jsx)(y,{className:`h-3.5 w-3.5`}),r(`provenancePanel.log`)]})})]})})}function nt({label:e,rows:t,icon:r,onOpenFile:i}){return(0,J.jsxs)(`details`,{className:`group min-w-[180px] max-w-[320px]`,children:[(0,J.jsxs)(`summary`,{className:`flex cursor-pointer list-none items-center gap-1.5 rounded-md bg-muted/35 px-2 py-1 text-xs hover:bg-muted/55`,children:[(0,J.jsx)(r===`created`?l:r===`deleted`?n:f,{className:`h-3.5 w-3.5 text-muted-foreground`}),(0,J.jsx)(`span`,{children:e}),(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:t.length})]}),t.length>0&&(0,J.jsx)(`div`,{className:`mt-1 max-h-28 overflow-auto rounded-md border border-border/60 bg-background/60 p-1`,children:t.map((e,t)=>(0,J.jsx)(`button`,{type:`button`,onClick:()=>i(e.path),className:`block w-full truncate rounded px-1.5 py-1 text-left font-mono text-[11px] text-muted-foreground hover:bg-muted/50 hover:text-foreground`,title:e.path,children:e.path},`${e.path}-${e.jobId??`job`}-${e.at}-${t}`))})]})}export{$e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./clsx-DnqN-uhr.js";import{A as n,At as r,Ct as i,Dt as a,Et as o,Mt as s,Ot as c,Tt as l,V as u,i as d,jt as f,kt as p,qt as m,tn as h,u as g,vt as _,wt as v,xt as y}from"./index-XGZaKl_u.js";import{$ as b,A as x,B as S,E as ee,F as C,H as w,K as T,L as E,N as D,O,P as te,Q as ne,R as re,S as ie,T as ae,U as oe,W as se,X as ce,Y as le,Z as ue,_ as de,_t as fe,a as pe,c as me,d as he,dt as k,et as A,ft as ge,g as _e,gt as ve,h as ye,ht as be,i as j,it as xe,j as Se,k as Ce,l as we,lt as M,mt as Te,n as Ee,nt as De,o as Oe,pt as N,q as ke,r as Ae,rt as je,s as Me,t as Ne,u as Pe,ut as P,v as Fe,w as F,z as Ie}from"./BarChart-7IMQ8HY1.js";var Le=_(`trending-up`,[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]);function I(e,t){return v(e,{...t,weekStartsOn:1})}function L(e,t){let n=l(e,t?.in),r=n.getFullYear(),i=c(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=I(i),o=c(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=I(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function R(e,t){let n=l(e,t?.in);return n.setHours(0,0,0,0),n}function Re(e,t,n){let[r,i]=a(n?.in,e,t),o=R(r),s=R(i),c=+o-g(o),l=+s-g(s);return Math.round((c-l)/p)}function ze(e,t){let n=L(e,t),r=c(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),I(r)}function Be(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function Ve(e){return!(!Be(e)&&typeof e!=`number`||isNaN(+l(e)))}function He(e,t){let n=l(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Ue(e,t){let n=l(e,t?.in);return Re(n,He(n))+1}function We(e,t){let n=l(e,t?.in),i=I(n)-+ze(n);return Math.round(i/r)+1}function z(e,t){let n=l(e,t?.in),r=n.getFullYear(),i=o(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,s=c(t?.in||e,0);s.setFullYear(r+1,0,a),s.setHours(0,0,0,0);let u=v(s,t),d=c(t?.in||e,0);d.setFullYear(r,0,a),d.setHours(0,0,0,0);let f=v(d,t);return+n>=+u?r+1:+n>=+f?r:r-1}function Ge(e,t){let n=o(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=z(e,t),a=c(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),v(a,t)}function Ke(e,t){let n=l(e,t?.in),i=v(n,t)-+Ge(n,t);return Math.round(i/r)+1}function B(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var V={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return B(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):B(n+1,2)},d(e,t){return B(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return B(e.getHours()%12||12,t.length)},H(e,t){return B(e.getHours(),t.length)},m(e,t){return B(e.getMinutes(),t.length)},s(e,t){return B(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return B(Math.trunc(r*10**(n-3)),t.length)}},H={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},qe={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return V.y(e,t)},Y:function(e,t,n,r){let i=z(e,r),a=i>0?i:1-i;return t===`YY`?B(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):B(a,t.length)},R:function(e,t){return B(L(e),t.length)},u:function(e,t){return B(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return B(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return B(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return V.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return B(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=Ke(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):B(i,t.length)},I:function(e,t,n){let r=We(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):B(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):V.d(e,t)},D:function(e,t,n){let r=Ue(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):B(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return B(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return B(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return B(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?H.noon:r===0?H.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?H.evening:r>=12?H.afternoon:r>=4?H.morning:H.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return V.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):V.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):B(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):B(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):V.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):V.s(e,t)},S:function(e,t){return V.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return Ye(r);case`XXXX`:case`XX`:return U(r);default:return U(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return Ye(r);case`xxxx`:case`xx`:return U(r);default:return U(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+Je(r,`:`);default:return`GMT`+U(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+Je(r,`:`);default:return`GMT`+U(r,`:`)}},t:function(e,t,n){return B(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return B(+e,t.length)}};function Je(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+B(a,2)}function Ye(e,t){return e%60==0?(e>0?`-`:`+`)+B(Math.abs(e)/60,2):U(e,t)}function U(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=B(Math.trunc(r/60),2),a=B(r%60,2);return n+i+t+a}var Xe=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},Ze=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},Qe={p:Ze,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Xe(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,Xe(r,t)).replace(`{{time}}`,Ze(i,t))}},$e=/^D+$/,et=/^Y+$/,tt=[`D`,`DD`,`YY`,`YYYY`];function nt(e){return $e.test(e)}function rt(e){return et.test(e)}function it(e,t,n){let r=at(e,t,n);if(console.warn(r),tt.includes(e))throw RangeError(r)}function at(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var ot=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,st=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ct=/^'([^]*?)'?$/,lt=/''/g,ut=/[a-zA-Z]/;function dt(e,t,n){let r=o(),a=n?.locale??r.locale??i,s=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,c=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,u=l(e,n?.in);if(!Ve(u))throw RangeError(`Invalid time value`);let d=t.match(st).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=Qe[t];return n(e,a.formatLong)}return e}).join(``).match(ot).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:ft(e)};if(qe[t])return{isToken:!0,value:e};if(t.match(ut))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});a.localize.preprocessor&&(d=a.localize.preprocessor(u,d));let f={firstWeekContainsDate:s,weekStartsOn:c,locale:a};return d.map(r=>{if(!r.isToken)return r.value;let i=r.value;(!n?.useAdditionalWeekYearTokens&&rt(i)||!n?.useAdditionalDayOfYearTokens&&nt(i))&&it(i,t,String(e));let o=qe[i[0]];return o(u,i,a.localize,f)}).join(``)}function ft(e){let t=e.match(ct);return t?t[1].replace(lt,`'`):e}var W=e(h());function G(){return G=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},G.apply(null,arguments)}var pt=e=>{var{cx:n,cy:r,r:i,className:a}=e,o=t(`recharts-dot`,a);return k(n)&&k(r)&&k(i)?W.createElement(`circle`,G({},ve(e),xe(e),{className:o,cx:n,cy:r,r:i})):null},mt=[`points`];function ht(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function K(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ht(Object(n),!0).forEach(function(t){gt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ht(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function gt(e,t,n){return(t=_t(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _t(e){var t=vt(e,`string`);return typeof t==`symbol`?t:t+``}function vt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function q(){return q=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},q.apply(null,arguments)}function yt(e,t){if(e==null)return{};var n,r,i=bt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function bt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function xt(e){var{option:n,dotProps:r,className:i}=e;if((0,W.isValidElement)(n))return(0,W.cloneElement)(n,r);if(typeof n==`function`)return n(r);var a=t(i,typeof n==`boolean`?``:n.className),o=r??{},{points:s}=o,c=yt(o,mt);return W.createElement(pt,q({},c,{className:a}))}function St(e,t){return e==null?!1:t?!0:e.length===1}function Ct(e){var{points:t,dot:n,className:r,dotClassName:i,dataKey:a,baseProps:o,needClip:s,clipPathId:c,zIndex:l=E.scatter}=e;if(!St(t,n))return null;var u=F(n),d=be(n),f=t.map((e,r)=>{var s=K(K(K({r:3},o),d),{},{index:r,cx:e.x??void 0,cy:e.y??void 0,dataKey:a,value:e.value,payload:e.payload,points:t});return W.createElement(xt,{key:`dot-${r}`,option:n,dotProps:s,className:i})}),p={};return s&&c!=null&&(p.clipPath=`url(#clipPath-${u?``:`dots-`}${c})`),W.createElement(x,{zIndex:l},W.createElement(N,q({className:r},p),f))}function wt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function J(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?wt(Object(n),!0).forEach(function(t){Tt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Tt(e,t,n){return(t=Et(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Et(e){var t=Dt(e,`string`);return typeof t==`symbol`?t:t+``}function Dt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Ot=e=>{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:o}=e;if(i===!1||t.x==null||t.y==null)return null;var s=J(J(J({},{index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??`none`,strokeWidth:2,stroke:`#fff`,payload:t.payload,value:t.value}),fe(i)),xe(i)),c=(0,W.isValidElement)(i)?(0,W.cloneElement)(i,s):typeof i==`function`?i(s):W.createElement(pt,s);return W.createElement(N,{className:`recharts-active-dot`,clipPath:o},c)};function kt(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=E.activeDot}=e,s=De(Se),c=Pe();if(t==null||c==null)return null;var l=t.find(e=>c.includes(e.payload));return P(l)?null:W.createElement(x,{zIndex:o},W.createElement(Ot,{point:l,childIndex:Number(s),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var At=(e,t,n,r)=>D(e,`xAxis`,t,r),jt=(e,t,n,r)=>te(e,`xAxis`,t,r),Mt=(e,t,n,r)=>D(e,`yAxis`,n,r),Nt=(e,t,n,r)=>te(e,`yAxis`,n,r),Pt=A([oe,At,Mt,jt,Nt],(e,t,n,r,i)=>b(e,`xAxis`)?le(t,r,!1):le(n,i,!1)),Ft=(e,t,n,r,i)=>i;function It(e){return e.type===`line`}var Lt=A([oe,At,Mt,jt,Nt,A([C,Ft],(e,t)=>e.filter(It).find(e=>e.id===t)),Pt,re],(e,t,n,r,i,a,o,s)=>{var{chartData:c,dataStartIndex:l,dataEndIndex:u}=s;if(!(a==null||t==null||n==null||r==null||i==null||r.length===0||i.length===0||o==null||e!==`horizontal`&&e!==`vertical`)){var{dataKey:d,data:f}=a,p=f!=null&&f.length>0?f:c?.slice(l,u+1);if(p!=null)return cn({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataKey:d,bandSize:o,displayedData:p})}});function Rt(e){var t=fe(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,o=Number(i),s=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(s)||s<0)&&(s=r),{r:o,strokeWidth:s}}return{r:n,strokeWidth:r}}var zt=[`id`],Bt=[`type`,`layout`,`connectNulls`,`needClip`,`shape`],Vt=[`activeDot`,`animateNewValues`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`hide`,`isAnimationActive`,`label`,`legendType`,`xAxisId`,`yAxisId`,`id`];function Y(){return Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Y.apply(null,arguments)}function Ht(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ht(Object(n),!0).forEach(function(t){Ut(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ht(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ut(e,t,n){return(t=Wt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wt(e){var t=Gt(e,`string`);return typeof t==`symbol`?t:t+``}function Gt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Z(e,t){if(e==null)return{};var n,r,i=Kt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Kt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var qt=e=>{var{dataKey:t,name:n,stroke:r,legendType:i,hide:a}=e;return[{inactive:a,dataKey:t,type:i,color:r,value:ue(n,t),payload:e}]},Jt=W.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:s,unit:c,tooltipType:l,id:u}=e,d={dataDefinedOnItem:n,getPosition:ge,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:ue(o,t),hide:s,type:l,color:r,unit:c,graphicalItemId:u}};return W.createElement(Fe,{tooltipEntrySettings:d})}),Q=(e,t)=>`${t}px ${e}px`;function Yt(e,t){for(var n=e.length%2==0?e:[...e,0],r=[],i=0;i<t;++i)r.push(...n);return r}var Xt=(e,t,n)=>{var r=n.reduce((e,t)=>e+t,0);if(!r)return Q(t,e);for(var i=Math.floor(e/r),a=e%r,o=[],s=0,c=0;s<n.length;c+=(l=n[s])??0,++s){var l,u=n[s];if(u!=null&&c+u>a){o=[...n.slice(0,s),a-c];break}}var d=o.length%2==0?[0,t]:[t];return[...Yt(n,i),...o,...d].map(e=>`${e}px`).join(`, `)};function Zt(e){var{clipPathId:t,points:n,props:r}=e,{dot:i,dataKey:a,needClip:o}=r,{id:s}=r,c=ve(Z(r,zt));return W.createElement(Ct,{points:n,dot:i,className:`recharts-line-dots`,dotClassName:`recharts-line-dot`,dataKey:a,baseProps:c,needClip:o,clipPathId:t})}function Qt(e){var{showLabels:t,children:n,points:r}=e,i=(0,W.useMemo)(()=>r?.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return X(X({},t),{},{value:e.value,payload:e.payload,viewBox:t,parentViewBox:void 0,fill:void 0})}),[r]);return W.createElement(ae,{value:t?i:void 0},n)}function $t(e){var{clipPathId:t,pathRef:n,points:r,strokeDasharray:i,props:a}=e,{type:o,layout:s,connectNulls:c,needClip:l,shape:u}=a,d=X(X({},Te(Z(a,Bt))),{},{fill:`none`,className:`recharts-line-curve`,clipPath:l?`url(#clipPath-${t})`:void 0,points:r,type:o,layout:s,connectNulls:c,strokeDasharray:i??a.strokeDasharray});return W.createElement(W.Fragment,null,r?.length>1&&W.createElement(ie,Y({shapeType:`curve`,option:u},d,{pathRef:n})),W.createElement(Zt,{points:r,clipPathId:t,props:a}))}function en(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function tn(e){var{clipPathId:t,props:n,pathRef:r,previousPointsRef:i,longestAnimatedLengthRef:a}=e,{points:o,strokeDasharray:s,isAnimationActive:c,animationBegin:l,animationDuration:u,animationEasing:d,animateNewValues:f,width:p,height:m,onAnimationEnd:h,onAnimationStart:g}=n,_=i.current,v=Ie(o,`recharts-line-`),y=(0,W.useRef)(v),[b,x]=(0,W.useState)(!1),C=!b,w=(0,W.useCallback)(()=>{typeof h==`function`&&h(),x(!1)},[h]),T=(0,W.useCallback)(()=>{typeof g==`function`&&g(),x(!0)},[g]),E=en(r.current),D=(0,W.useRef)(0);y.current!==v&&(D.current=a.current,y.current=v);var O=D.current;return W.createElement(Qt,{points:o,showLabels:C},n.children,W.createElement(S,{animationId:v,begin:l,duration:u,isActive:c,easing:d,onAnimationEnd:w,onAnimationStart:T,key:v},e=>{var l=M(O,E+O,e),u=Math.min(l,E),d=c?s?Xt(u,E,`${s}`.split(/[,\s]+/gim).map(e=>parseFloat(e))):Q(E,u):s==null?void 0:String(s);if(e>0&&E>0&&(i.current=o,a.current=Math.max(a.current,u)),_){var h=_.length/o.length,g=e===1?o:o.map((t,n)=>{var r=Math.floor(n*h);if(_[r]){var i=_[r];return X(X({},t),{},{x:M(i.x,t.x,e),y:M(i.y,t.y,e)})}return f?X(X({},t),{},{x:M(p*2,t.x,e),y:M(m/2,t.y,e)}):X(X({},t),{},{x:t.x,y:t.y})});return i.current=g,W.createElement($t,{props:n,points:g,clipPathId:t,pathRef:r,strokeDasharray:d})}return W.createElement($t,{props:n,points:o,clipPathId:t,pathRef:r,strokeDasharray:d})}),W.createElement(ee,{label:n.label}))}function nn(e){var{clipPathId:t,props:n}=e,r=(0,W.useRef)(null),i=(0,W.useRef)(0),a=(0,W.useRef)(null);return W.createElement(tn,{props:n,clipPathId:t,previousPointsRef:r,longestAnimatedLengthRef:i,pathRef:a})}var rn=(e,t)=>({x:e.x??void 0,y:e.y??void 0,value:e.value,errorVal:ne(e.payload,t)}),an=class extends W.Component{render(){var{hide:e,dot:n,points:r,className:i,xAxisId:a,yAxisId:o,top:s,left:c,width:l,height:u,id:d,needClip:f,zIndex:p}=this.props;if(e)return null;var m=t(`recharts-line`,i),h=d,{r:g,strokeWidth:_}=Rt(n),v=F(n),y=g*2+_,b=f?`url(#clipPath-${v?``:`dots-`}${h})`:void 0;return W.createElement(x,{zIndex:p},W.createElement(N,{className:m},f&&W.createElement(`defs`,null,W.createElement(Oe,{clipPathId:h,xAxisId:a,yAxisId:o}),!v&&W.createElement(`clipPath`,{id:`clipPath-dots-${h}`},W.createElement(`rect`,{x:c-y/2,y:s-y/2,width:l+y,height:u+y}))),W.createElement(me,{xAxisId:a,yAxisId:o,data:r,dataPointFormatter:rn,errorBarOffset:0},W.createElement(nn,{props:this.props,clipPathId:h}))),W.createElement(kt,{activeDot:this.props.activeDot,points:r,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:b}))}},on={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,connectNulls:!1,dot:!0,fill:`#fff`,hide:!1,isAnimationActive:`auto`,label:!1,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:E.line,type:`linear`};function sn(e){var t=je(e,on),{activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,connectNulls:s,dot:c,hide:l,isAnimationActive:u,label:d,legendType:f,xAxisId:p,yAxisId:m,id:h}=t,g=Z(t,Vt),{needClip:_}=Me(p,m),v=he(),y=se(),b=ke(),x=De(e=>Lt(e,p,m,b,h));if(y!==`horizontal`&&y!==`vertical`||x==null||v==null)return null;var{height:S,width:ee,x:C,y:w}=v;return W.createElement(an,Y({},g,{id:h,connectNulls:s,dot:c,activeDot:n,animateNewValues:r,animationBegin:i,animationDuration:a,animationEasing:o,isAnimationActive:u,hide:l,label:d,legendType:f,xAxisId:p,yAxisId:m,points:x,layout:y,height:S,width:ee,left:C,top:w,needClip:_}))}function cn(e){var{layout:t,xAxis:n,yAxis:r,xAxisTicks:i,yAxisTicks:a,dataKey:o,bandSize:s,displayedData:c}=e;return c.map((e,c)=>{var l=ne(e,o);if(t===`horizontal`)return{x:ce({axis:n,ticks:i,bandSize:s,entry:e,index:c}),y:(P(l)?null:r.scale.map(l))??null,value:l,payload:e};var u=P(l)?null:n.scale.map(l),d=ce({axis:r,ticks:a,bandSize:s,entry:e,index:c});return u==null||d==null?null:{x:u,y:d,value:l,payload:e}}).filter(Boolean)}function ln(e){var t=je(e,on),n=ke();return W.createElement(_e,{id:t.id,type:`line`},e=>W.createElement(W.Fragment,null,W.createElement(de,{legendPayload:qt(t)}),W.createElement(Jt,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:e}),W.createElement(ye,{type:`line`,id:e,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:n}),W.createElement(sn,Y({},t,{id:e}))))}var un=W.memo(ln,w);un.displayName=`Line`;var dn=[`axis`],fn=(0,W.forwardRef)((e,t)=>W.createElement(Ee,{chartName:`LineChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:dn,tooltipPayloadSearcher:Ce,categoricalChartProps:e,ref:t})),$=s(),pn=[{value:`7d`,labelKey:`periods.d7`},{value:`30d`,labelKey:`periods.d30`},{value:`90d`,labelKey:`periods.d90`},{value:`all`,labelKey:`periods.all`},{value:`custom`,labelKey:`periods.custom`}];function mn({period:e,from:t,to:r,onChange:i}){let{t:a}=m(`analytics`);function o(e){e===`custom`?i(`custom`,t,r):i(e)}function s(e){i(`custom`,e,r)}function c(e){i(`custom`,t,e)}return(0,$.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,$.jsx)(`div`,{className:`flex items-center gap-1`,children:pn.map(t=>(0,$.jsx)(`button`,{onClick:()=>o(t.value),className:n(`h-7 px-3 rounded-md text-xs font-medium transition-colors`,e===t.value?`bg-primary text-primary-foreground`:`text-muted-foreground hover:text-foreground hover:bg-accent`),children:a(t.labelKey)},t.value))}),e===`custom`&&(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(`input`,{type:`date`,value:t,onChange:e=>s(e.target.value),"aria-label":a(`periods.startDate`),className:`h-7 px-2 rounded-md text-xs bg-card border border-border text-foreground focus:outline-none focus:ring-1 focus:ring-primary`}),(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:a(`periods.to`)}),(0,$.jsx)(`input`,{type:`date`,value:r,onChange:e=>c(e.target.value),"aria-label":a(`periods.endDate`),className:`h-7 px-2 rounded-md text-xs bg-card border border-border text-foreground focus:outline-none focus:ring-1 focus:ring-primary`})]})]})}function hn({kpi:e}){let{t}=m(`analytics`);return(0,$.jsx)(`div`,{className:`grid grid-cols-2 lg:grid-cols-4 gap-3`,children:[{label:t(`desktop.totalCost`),value:`$${e.totalCostUsd.toFixed(4)}`,sub:t(`desktop.costToday`,{value:`$${e.costToday.toFixed(4)}`})},{label:t(`desktop.totalJobs`),value:e.totalJobs.toLocaleString(),sub:t(`desktop.jobsToday`,{n:e.jobsToday})},{label:t(`desktop.successRate`),value:`${(e.successRate*100).toFixed(1)}%`,sub:t(`desktop.acrossAllProjects`)},{label:t(`desktop.avgCostPerJob`),value:e.totalJobs>0?`$${(e.totalCostUsd/e.totalJobs).toFixed(5)}`:`—`,sub:t(`desktop.periodAverage`)}].map(e=>(0,$.jsxs)(`div`,{className:`rounded-lg border border-border/40 bg-card/50 p-4`,children:[(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground mb-1`,children:e.label}),(0,$.jsx)(`p`,{className:`text-xl font-semibold font-mono`,children:e.value}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:e.sub})]},e.label))})}function gn({data:e}){let{t}=m(`analytics`),n=d(),r=e.length>0&&e.some(e=>e.costUsd>0),i=Math.max(1,Math.floor(e.length/7)),a=e.filter((e,t)=>t%i===0).map(e=>e.date);return(0,$.jsxs)(`div`,{className:`rounded-lg border border-border/40 bg-card/50 p-4`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-medium mb-3`,children:t(`desktop.costOverTime`)}),r?(0,$.jsx)(T,{width:`100%`,height:200,children:(0,$.jsxs)(fn,{data:e,margin:{top:4,right:8,left:0,bottom:0},children:[(0,$.jsx)(we,{strokeDasharray:`3 3`,stroke:`var(--color-border)`}),(0,$.jsx)(j,{dataKey:`date`,ticks:a,tickFormatter:e=>{try{return dt(new Date(e),`MMM d`,{locale:y()})}catch{return e}},tick:{fontSize:10,fill:`var(--color-muted-foreground)`},axisLine:!1,tickLine:!1}),(0,$.jsx)(Ae,{tickFormatter:e=>`$${e.toFixed(2)}`,tick:{fontSize:10,fill:`var(--color-muted-foreground)`},axisLine:!1,tickLine:!1,width:55}),(0,$.jsx)(O,{content:({active:e,payload:t,label:n})=>e&&t?.length?(0,$.jsxs)(`div`,{className:`bg-popover border border-border/30 rounded-lg p-2 text-xs shadow-lg`,children:[(0,$.jsx)(`p`,{className:`text-muted-foreground mb-1`,children:n}),(0,$.jsxs)(`p`,{className:`font-medium`,children:[`$`,t[0].value.toFixed(4)]})]}):null}),(0,$.jsx)(un,{type:`monotone`,dataKey:`costUsd`,stroke:n.chart[0],strokeWidth:2,dot:!1,activeDot:{r:3,fill:n.chart[0]}})]})}):(0,$.jsx)(`div`,{className:`h-[200px] flex items-center justify-center text-xs text-muted-foreground`,children:t(`desktop.noCostData`)})]})}function _n({projects:e}){let{t}=m(`analytics`),n=d();if(e.length===0)return(0,$.jsxs)(`div`,{className:`rounded-lg border border-border/40 bg-card/50 p-4`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-medium mb-3`,children:t(`desktop.projectComparison`)}),(0,$.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`desktop.noProjects`)})]});let r=Math.max(...e.map(e=>e.totalCostUsd),1e-4);return(0,$.jsxs)(`div`,{className:`rounded-lg border border-border/40 bg-card/50 p-4`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-medium mb-4`,children:t(`desktop.projectComparison`)}),(0,$.jsx)(`div`,{className:`space-y-3`,children:e.map((e,i)=>(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,$.jsx)(`span`,{className:`font-medium truncate max-w-[160px]`,title:e.projectName,children:e.projectName}),(0,$.jsxs)(`div`,{className:`flex items-center gap-4 text-muted-foreground`,children:[(0,$.jsx)(`span`,{children:t(`desktop.jobsCount`,{count:e.totalJobs})}),(0,$.jsx)(`span`,{children:t(`desktop.successPct`,{pct:(e.successRate*100).toFixed(0)})}),(0,$.jsxs)(`span`,{className:`font-mono text-foreground`,children:[`$`,e.totalCostUsd.toFixed(4)]})]})]}),(0,$.jsx)(`div`,{className:`h-1.5 rounded-full bg-border/30 overflow-hidden`,children:(0,$.jsx)(`div`,{className:`h-full rounded-full transition-all duration-500`,style:{width:`${e.totalCostUsd/r*100}%`,backgroundColor:n.chart[i%n.chart.length]}})})]},e.projectId))})]})}function vn({projects:e}){let{t}=m(`analytics`),n=d();if(e.length===0)return null;let r=e.map(e=>({name:e.projectName.slice(0,12),costUsd:e.totalCostUsd}));return(0,$.jsxs)(`div`,{className:`rounded-lg border border-border/40 bg-card/50 p-4`,children:[(0,$.jsx)(`h3`,{className:`text-sm font-medium mb-3`,children:t(`desktop.costByProject`)}),(0,$.jsx)(T,{width:`100%`,height:180,children:(0,$.jsxs)(Ne,{data:r,margin:{top:4,right:8,left:0,bottom:0},children:[(0,$.jsx)(we,{strokeDasharray:`3 3`,stroke:`var(--color-border)`}),(0,$.jsx)(j,{dataKey:`name`,tick:{fontSize:10,fill:`var(--color-muted-foreground)`},axisLine:!1,tickLine:!1}),(0,$.jsx)(Ae,{tickFormatter:e=>`$${e.toFixed(2)}`,tick:{fontSize:10,fill:`var(--color-muted-foreground)`},axisLine:!1,tickLine:!1,width:55}),(0,$.jsx)(O,{content:({active:e,payload:t,label:n})=>e&&t?.length?(0,$.jsxs)(`div`,{className:`bg-popover border border-border/30 rounded-lg p-2 text-xs shadow-lg`,children:[(0,$.jsx)(`p`,{className:`text-muted-foreground mb-1`,children:n}),(0,$.jsxs)(`p`,{className:`font-medium`,children:[`$`,t[0].value.toFixed(4)]})]}):null}),(0,$.jsx)(pe,{dataKey:`costUsd`,fill:n.chart[1],radius:[3,3,0,0]})]})})]})}function yn(){let{t:e}=m(`analytics`),[t,n]=(0,W.useState)(`7d`),[r,i]=(0,W.useState)(``),[a,o]=(0,W.useState)(``),[s,c]=(0,W.useState)(null),[l,d]=(0,W.useState)(!0),[p,h]=(0,W.useState)(null),{registerHandler:g,unregisterHandler:_}=f(),v=(0,W.useCallback)(e=>{let n=e;n.type===`log`&&n.event_type===`job_done`&&y(t,r,a)},[t,r,a]);(0,W.useEffect)(()=>(g(`desktop-analytics`,v),()=>_(`desktop-analytics`)),[v,g,_]);async function y(e,t,n){d(!0),h(null);try{let r=new URLSearchParams({period:e});e===`custom`&&t&&n&&(r.set(`from`,t),r.set(`to`,n));let i=await fetch(`/api/analytics?${r}`);if(!i.ok)throw Error(`HTTP ${i.status}`);c(await i.json())}catch(e){h(e.message)}finally{d(!1)}}(0,W.useEffect)(()=>{y(t,r,a)},[t,r,a]);function b(e,t,r){n(e),t!==void 0&&i(t),r!==void 0&&o(r)}return(0,$.jsx)(`div`,{className:`flex flex-col h-full overflow-auto bg-background`,children:(0,$.jsxs)(`div`,{className:`p-4 space-y-4`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(Le,{className:`w-4 h-4 text-muted-foreground`}),(0,$.jsx)(`h1`,{className:`text-sm font-semibold`,children:e(`desktop.title`)}),s&&(0,$.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:s.period.label})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,$.jsx)(mn,{period:t,from:r,to:a,onChange:b}),(0,$.jsx)(`button`,{onClick:()=>y(t,r,a),disabled:l,className:`flex items-center gap-1.5 h-7 px-2 rounded-md text-xs text-muted-foreground hover:text-foreground hover:bg-accent transition-colors disabled:opacity-50`,"aria-label":e(`desktop.refreshAria`),children:(0,$.jsx)(u,{className:`w-3 h-3 ${l?`animate-spin`:``}`})})]})]}),p&&(0,$.jsx)(`div`,{className:`rounded-lg border border-red-400/30 bg-red-400/10 p-3 text-xs text-red-400`,children:e(`desktop.failedToLoad`,{error:p})}),l&&!s&&(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsx)(`div`,{className:`grid grid-cols-2 lg:grid-cols-4 gap-3`,children:Array.from({length:4}).map((e,t)=>(0,$.jsx)(`div`,{className:`h-20 rounded-lg border border-border/40 bg-card/50 animate-pulse`},t))}),(0,$.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:Array.from({length:2}).map((e,t)=>(0,$.jsx)(`div`,{className:`h-[220px] rounded-lg border border-border/40 bg-card/50 animate-pulse`},t))})]}),s&&(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsx)(hn,{kpi:s.kpi}),(0,$.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,$.jsx)(gn,{data:s.costTimeline}),(0,$.jsx)(vn,{projects:s.projectBreakdown})]}),(0,$.jsx)(_n,{projects:s.projectBreakdown})]})]})})}export{yn as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{A as t,K as n,Mt as r,S as i,T as a,Z as o,b as s,d as c,f as l,ft as u,lt as d,qt as f,tn as p,x as m}from"./index-XGZaKl_u.js";import{t as h}from"./lib-CPxTMOAq.js";/* empty css */var g=e(p(),1),_=r();function v({categories:e,activeCategory:n,activeSlug:r,onSelect:i,onHome:a}){let{t:s}=f(`integrations`);return(0,_.jsxs)(`nav`,{className:`w-56 flex-shrink-0 border-r border-border overflow-y-auto py-4 px-3`,children:[(0,_.jsxs)(`button`,{onClick:a,className:`flex items-center gap-2 mb-4 px-2 text-xs font-bold text-muted-foreground hover:text-foreground transition-colors`,children:[(0,_.jsx)(u,{className:`w-3.5 h-3.5`}),s(`docs.title`)]}),(0,_.jsx)(`div`,{className:`space-y-4`,children:e.map(e=>(0,_.jsxs)(`div`,{children:[(0,_.jsxs)(`div`,{className:`px-2 mb-1 flex items-center justify-between`,children:[(0,_.jsx)(`span`,{className:`text-xs font-semibold text-muted-foreground uppercase tracking-wider`,children:e.name}),e.docs.length>0&&(0,_.jsx)(`span`,{className:`text-[9px] font-medium text-muted-foreground/60 bg-muted/40 rounded px-1 py-0.5 leading-none`,children:e.docs.length})]}),e.docs.length===0?(0,_.jsx)(`p`,{className:`px-2 text-xs text-muted-foreground italic`,children:s(`docs.sidebarEmpty`)}):(0,_.jsx)(`ul`,{className:`space-y-0.5`,children:e.docs.map(a=>(0,_.jsx)(`li`,{children:(0,_.jsxs)(`button`,{onClick:()=>i(e.slug,a.slug),className:t(`w-full flex items-center gap-1.5 px-2 py-1 rounded-md text-xs transition-colors text-left`,n===e.slug&&r===a.slug?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground hover:bg-accent/50`),children:[(0,_.jsx)(o,{className:`w-3 h-3 flex-shrink-0`}),a.title]})},a.slug))})]},e.slug))})]})}function y({categories:e,onSelect:t}){let{t:n}=f(`integrations`),r=e.reduce((e,t)=>e+t.docs.length,0),i=e.filter(e=>e.docs.length>0).length;return(0,_.jsxs)(`div`,{className:`max-w-2xl mx-auto py-8 px-6`,children:[(0,_.jsxs)(`div`,{className:`mb-8`,children:[(0,_.jsx)(`h1`,{className:`text-xl font-bold mb-2`,children:n(`docs.title`)}),(0,_.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r===0?n(`docs.indexEmpty`):n(`docs.summary`,{documents:n(`docs.documentCount`,{count:r}),categories:n(`docs.categoryCount`,{count:i})})})]}),(0,_.jsx)(`div`,{className:`space-y-6`,children:e.map(e=>(0,_.jsxs)(`div`,{children:[(0,_.jsx)(`h2`,{className:`text-sm font-semibold text-muted-foreground uppercase tracking-wider mb-2`,children:e.name}),e.docs.length===0?(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground italic pl-2`,children:n(`docs.categoryEmpty`)}):(0,_.jsx)(`ul`,{className:`space-y-1`,children:e.docs.map(n=>(0,_.jsx)(`li`,{children:(0,_.jsxs)(`button`,{onClick:()=>t(e.slug,n.slug),className:`w-full flex items-center gap-2 px-3 py-2 rounded-md text-sm hover:bg-accent transition-colors group text-left`,children:[(0,_.jsx)(o,{className:`w-3.5 h-3.5 text-muted-foreground flex-shrink-0`}),(0,_.jsx)(`span`,{className:`text-foreground group-hover:text-foreground`,children:n.title}),(0,_.jsx)(d,{className:`w-3 h-3 text-muted-foreground ml-auto md:opacity-0 md:group-hover:opacity-100 transition-opacity`})]})},n.slug))})]},e.slug))})]})}var b=(0,g.memo)(function({content:e}){return(0,_.jsx)(l,{remarkPlugins:[c],rehypePlugins:[h],children:e})});function x({category:e,slug:t,onNotFound:r,scrollContainerRef:i}){let{t:a}=f(`integrations`),[o,s]=(0,g.useState)(null),[c,l]=(0,g.useState)(null),u=(0,g.useRef)(0);return(0,g.useEffect)(()=>{let n=++u.current;l(null),fetch(`/api/docs/${e}/${t}`).then(async e=>{if(e.status===404){r();return}if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{n===u.current&&e&&(s(e),i.current&&(i.current.scrollTop=0))}).catch(e=>{n===u.current&&l(e instanceof Error?e.message:a(`docs.loadError`))})},[e,t,r,i]),!o&&!c?(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,_.jsx)(n,{className:`w-4 h-4 animate-spin text-muted-foreground`})}):c&&!o?(0,_.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,_.jsx)(`p`,{className:`text-sm text-destructive`,children:c})}):o?(0,_.jsx)(`article`,{className:`max-w-2xl mx-auto py-8 px-6`,children:(0,_.jsx)(`div`,{className:`prose prose-sm max-w-none
|
|
2
|
+
prose-headings:text-foreground prose-headings:font-bold
|
|
3
|
+
prose-p:text-foreground/90
|
|
4
|
+
prose-a:text-accent-primary prose-a:no-underline hover:prose-a:underline
|
|
5
|
+
prose-strong:text-foreground
|
|
6
|
+
prose-code:text-accent-info prose-code:bg-card prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-code:text-xs
|
|
7
|
+
prose-pre:bg-card prose-pre:border prose-pre:border-border prose-pre:rounded-md prose-pre:p-0 prose-pre:overflow-x-auto
|
|
8
|
+
prose-blockquote:border-l-accent-primary prose-blockquote:text-muted-foreground
|
|
9
|
+
prose-hr:border-border
|
|
10
|
+
prose-th:text-foreground prose-td:text-foreground/90
|
|
11
|
+
prose-li:text-foreground/90`,children:(0,_.jsx)(b,{content:o.content})})}):null}function S({open:e,onClose:t}){let{t:r}=f(`integrations`),[o,c]=(0,g.useState)(null),[l,u]=(0,g.useState)(!0),[d,p]=(0,g.useState)(),[h,b]=(0,g.useState)(),S=(0,g.useRef)(null);(0,g.useEffect)(()=>{e&&(u(!0),fetch(`/api/docs`).then(e=>e.json()).then(e=>c(e)).catch(()=>c({categories:[]})).finally(()=>u(!1)))},[e]);let C=(0,g.useCallback)((e,t)=>{p(e),b(t)},[]),w=(0,g.useCallback)(()=>{p(void 0),b(void 0)},[]),T=!!(d&&h);return(0,_.jsx)(s,{open:e,onOpenChange:e=>{e||t()},children:(0,_.jsxs)(m,{className:`max-w-5xl max-h-[90vh] overflow-hidden p-0 flex flex-col`,children:[(0,_.jsx)(a,{className:`sr-only`,children:r(`docs.title`)}),(0,_.jsx)(i,{className:`sr-only`,children:r(`docs.dialogDescription`)}),(0,_.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[l?(0,_.jsx)(`div`,{className:`w-56 flex-shrink-0 border-r border-border flex items-center justify-center`,children:(0,_.jsx)(n,{className:`w-3.5 h-3.5 animate-spin text-muted-foreground`})}):(0,_.jsx)(v,{categories:o?.categories??[],activeCategory:d,activeSlug:h,onSelect:C,onHome:w}),(0,_.jsx)(`main`,{ref:S,className:`flex-1 overflow-y-auto`,children:T&&d&&h?(0,_.jsx)(x,{category:d,slug:h,onNotFound:w,scrollContainerRef:S}):o&&(0,_.jsx)(y,{categories:o.categories,onSelect:C})})]})]})})}var C=(0,g.memo)(S);export{C as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{A as t,K as n,Mt as r,Qt as i,Xt as a,Z as o,Zt as s,d as c,f as l,ft as u,lt as d,qt as f,tn as p}from"./index-XGZaKl_u.js";import{t as m}from"./lib-CPxTMOAq.js";/* empty css */var h=e(p(),1),g=r();function _({categories:e,activeCategory:n,activeSlug:r}){let{t:i}=f(`integrations`);return(0,g.jsxs)(`nav`,{className:`w-56 flex-shrink-0 border-r border-border overflow-y-auto py-4 px-3`,children:[(0,g.jsxs)(a,{to:`/docs`,className:`flex items-center gap-2 mb-4 px-2 text-xs font-bold text-muted-foreground hover:text-foreground transition-colors`,children:[(0,g.jsx)(u,{className:`w-3.5 h-3.5`}),i(`docs.title`)]}),(0,g.jsx)(`div`,{className:`space-y-4`,children:e.map(e=>(0,g.jsxs)(`div`,{children:[(0,g.jsxs)(`div`,{className:`px-2 mb-1 flex items-center justify-between`,children:[(0,g.jsx)(`span`,{className:`text-xs font-semibold text-muted-foreground uppercase tracking-wider`,children:e.name}),e.docs.length>0&&(0,g.jsx)(`span`,{className:`text-[9px] font-medium text-muted-foreground/60 bg-muted/40 rounded px-1 py-0.5 leading-none`,children:e.docs.length})]}),e.docs.length===0?(0,g.jsx)(`p`,{className:`px-2 text-xs text-muted-foreground italic`,children:i(`docs.sidebarEmpty`)}):(0,g.jsx)(`ul`,{className:`space-y-0.5`,children:e.docs.map(i=>{let s=n===e.slug&&r===i.slug;return(0,g.jsx)(`li`,{children:(0,g.jsxs)(a,{to:`/docs/${e.slug}/${i.slug}`,className:t(`flex items-center gap-1.5 px-2 py-1 rounded-md text-xs transition-colors`,s?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground hover:bg-accent/50`),children:[(0,g.jsx)(o,{className:`w-3 h-3 flex-shrink-0`}),i.title]})},i.slug)})})]},e.slug))})]})}function v({categories:e}){let{t}=f(`integrations`),n=e.reduce((e,t)=>e+t.docs.length,0),r=e.filter(e=>e.docs.length>0).length;return(0,g.jsxs)(`div`,{className:`max-w-2xl mx-auto py-8 px-6`,children:[(0,g.jsxs)(`div`,{className:`mb-8`,children:[(0,g.jsx)(`h1`,{className:`text-xl font-bold mb-2`,children:t(`docs.title`)}),(0,g.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n===0?t(`docs.indexEmpty`):t(`docs.summary`,{documents:t(`docs.documentCount`,{count:n}),categories:t(`docs.categoryCount`,{count:r})})})]}),(0,g.jsx)(`div`,{className:`space-y-6`,children:e.map(e=>(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`h2`,{className:`text-sm font-semibold text-muted-foreground uppercase tracking-wider mb-2`,children:e.name}),e.docs.length===0?(0,g.jsx)(`p`,{className:`text-xs text-muted-foreground italic pl-2`,children:t(`docs.categoryEmpty`)}):(0,g.jsx)(`ul`,{className:`space-y-1`,children:e.docs.map(t=>(0,g.jsx)(`li`,{children:(0,g.jsxs)(a,{to:`/docs/${e.slug}/${t.slug}`,className:`flex items-center gap-2 px-3 py-2 rounded-md text-sm hover:bg-accent transition-colors group`,children:[(0,g.jsx)(o,{className:`w-3.5 h-3.5 text-muted-foreground flex-shrink-0`}),(0,g.jsx)(`span`,{className:`text-foreground group-hover:text-foreground`,children:t.title}),(0,g.jsx)(d,{className:`w-3 h-3 text-muted-foreground ml-auto md:opacity-0 md:group-hover:opacity-100 transition-opacity`})]})},t.slug))})]},e.slug))})]})}var y=(0,h.memo)(function({content:e}){return(0,g.jsx)(l,{remarkPlugins:[c],rehypePlugins:[m],children:e})});function b({category:e,slug:t,scrollContainerRef:r}){let{t:i}=f(`integrations`),[a,o]=(0,h.useState)(null),[c,l]=(0,h.useState)(null),u=(0,h.useRef)(0),d=s();return(0,h.useEffect)(()=>{let n=++u.current;l(null),fetch(`/api/docs/${e}/${t}`).then(async e=>{if(e.status===404){d(`/docs`,{replace:!0});return}if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{n===u.current&&e&&(o(e),r.current&&(r.current.scrollTop=0))}).catch(e=>{n===u.current&&l(e instanceof Error?e.message:i(`docs.loadError`))})},[e,t,d,r]),!a&&!c?(0,g.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,g.jsx)(n,{className:`w-4 h-4 animate-spin text-muted-foreground`})}):c&&!a?(0,g.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,g.jsx)(`p`,{className:`text-sm text-destructive`,children:c})}):a?(0,g.jsx)(`article`,{className:`max-w-2xl mx-auto py-8 px-6`,children:(0,g.jsx)(`div`,{className:`prose prose-sm max-w-none
|
|
2
|
+
prose-headings:text-foreground prose-headings:font-bold
|
|
3
|
+
prose-p:text-foreground/90
|
|
4
|
+
prose-a:text-accent-primary prose-a:no-underline hover:prose-a:underline
|
|
5
|
+
prose-strong:text-foreground
|
|
6
|
+
prose-code:text-accent-info prose-code:bg-card prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-code:text-xs
|
|
7
|
+
prose-pre:bg-card prose-pre:border prose-pre:border-border prose-pre:rounded-md prose-pre:p-0 prose-pre:overflow-x-auto
|
|
8
|
+
prose-blockquote:border-l-accent-primary prose-blockquote:text-muted-foreground
|
|
9
|
+
prose-hr:border-border
|
|
10
|
+
prose-th:text-foreground prose-td:text-foreground/90
|
|
11
|
+
prose-li:text-foreground/90`,children:(0,g.jsx)(y,{content:a.content})})}):null}function x(){let{category:e,slug:t}=i(),[r,a]=(0,h.useState)(null),[o,s]=(0,h.useState)(!0),c=(0,h.useRef)(null);(0,h.useEffect)(()=>{fetch(`/api/docs`).then(e=>e.json()).then(e=>a(e)).catch(()=>a({categories:[]})).finally(()=>s(!1))},[]);let l=!!(e&&t);return(0,g.jsxs)(`div`,{className:`flex h-full overflow-hidden`,children:[o?(0,g.jsx)(`div`,{className:`w-56 flex-shrink-0 border-r border-border flex items-center justify-center`,children:(0,g.jsx)(n,{className:`w-3.5 h-3.5 animate-spin text-muted-foreground`})}):(0,g.jsx)(_,{categories:r?.categories??[],activeCategory:e,activeSlug:t}),(0,g.jsx)(`main`,{ref:c,className:`flex-1 overflow-y-auto`,children:l&&e&&t?(0,g.jsx)(b,{category:e,slug:t,scrollContainerRef:c}):r&&(0,g.jsx)(v,{categories:r.categories})})]})}export{x as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{Kt as t,Mt as n,qt as r,tn as i,tt as a}from"./index-XGZaKl_u.js";var o=e(i(),1),s=n(),c=[{labelKey:`export.summaryCsv`,format:`csv`,mode:`summary`},{labelKey:`export.rawCsv`,format:`csv`,mode:`raw`},{labelKey:`export.summaryJson`,format:`json`,mode:`summary`},{labelKey:`export.rawJson`,format:`json`,mode:`raw`}];function l(e){if(!e)return null;let t=e.match(/filename="?([^"]+)"?/);return t?t[1]:null}function u({baseUrl:e,params:n,label:i,disabled:u}){let{t:d}=r(`analytics`),[f,p]=(0,o.useState)(!1),[m,h]=(0,o.useState)(!1),g=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(!f)return;function e(e){g.current&&!g.current.contains(e.target)&&p(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[f]);let _=(0,o.useCallback)(t=>`${e}?${new URLSearchParams({format:t.format,mode:t.mode,...n}).toString()}`,[e,n]),v=(0,o.useCallback)(async e=>{p(!1),h(!0);try{let t=await fetch(_(e));if(!t.ok)throw Error(`HTTP ${t.status}`);let n=await t.blob(),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r;let a=l(t.headers.get(`Content-Disposition`)),o=`analytics-${e.mode}.${e.format}`;i.download=a??o,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(r)}catch(e){console.warn(`[ExportDropdown] download failed:`,e),t.error(d(`export.failed`))}finally{h(!1)}},[_,d]);return(0,s.jsxs)(`div`,{ref:g,className:`relative`,children:[(0,s.jsxs)(`button`,{type:`button`,"aria-haspopup":`true`,"aria-expanded":f,disabled:m||u,onClick:()=>p(e=>!e),title:u?d(`export.noData`):void 0,className:`flex items-center gap-1.5 h-7 px-2.5 rounded-md text-xs font-medium border border-border/60 bg-card/50 text-muted-foreground hover:text-foreground hover:bg-accent/60 transition-colors disabled:opacity-50 disabled:pointer-events-none`,children:[(0,s.jsx)(a,{className:`w-3 h-3`}),m?d(`export.downloading`):i??d(`common:actions.export`)]}),f&&(0,s.jsx)(`div`,{role:`menu`,className:`absolute right-0 z-50 mt-1 min-w-[180px] rounded-md border border-border/60 bg-popover shadow-md text-xs overflow-hidden`,children:c.map(e=>(0,s.jsxs)(`button`,{role:`menuitem`,type:`button`,onClick:()=>v(e),className:`flex w-full items-center gap-2 px-3 py-2 text-left text-foreground hover:bg-accent/60 transition-colors`,children:[(0,s.jsx)(a,{className:`w-3 h-3 shrink-0`}),(0,s.jsx)(`span`,{className:`flex-1`,children:d(e.labelKey)}),e.mode===`raw`&&(0,s.jsx)(`span`,{className:`text-[9px] text-muted-foreground`,children:`≤10k`})]},`${e.format}-${e.mode}`))})]})}export{u as t};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{H as t,K as n,Mt as r,N as i,Nt as a,P as o,Yt as s,at as c,bt as l,jt as u,ot as d,qt as f,tn as p,tt as m}from"./index-XGZaKl_u.js";import{t as h}from"./useProjectCache-DSaiGFjV.js";var g=e(p(),1),_=r();function v(){let{t:e}=f(`integrations`),{activeProjectId:n}=l(),{registerHandler:r,unregisterHandler:o}=u(),s=(0,g.useRef)(n);(0,g.useEffect)(()=>{s.current=n},[n]);let[c,d]=(0,g.useState)(null),[p,m]=(0,g.useState)(null),{data:v,isLoading:b,isFirstLoad:x,refresh:S}=h({namespace:`plugins`,projectId:n,initialValue:[],fetcher:(0,g.useCallback)(async()=>{let e=await fetch(`${a()}/plugins`);if(!e.ok)throw Error(`HTTP ${e.status}`);return(await e.json()).plugins??[]},[])});(0,g.useEffect)(()=>(r(`integrations-page`,e=>{let t=e;t.type&&(t.projectId&&t.projectId!==s.current||t.type.startsWith(`plugin.`)&&S())}),()=>o(`integrations-page`)),[r,o,S]),(0,g.useEffect)(()=>{d(!b&&!v?`Failed to load plugins`:null)},[b,v]);let C=(0,g.useMemo)(()=>(v??[]).filter(e=>e.status!==`orphan`),[v]),T=(0,g.useMemo)(()=>(v??[]).filter(e=>e.status===`orphan`),[v]);return n?(0,_.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,_.jsxs)(`div`,{className:`flex-shrink-0 border-b border-border px-6 pt-4 pb-3 flex items-center gap-2`,children:[(0,_.jsx)(t,{className:`w-4 h-4 text-accent-primary`}),(0,_.jsxs)(`div`,{className:`flex-1`,children:[(0,_.jsx)(`h1`,{className:`text-lg font-semibold`,children:e(`page.title`)}),(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e(`page.subtitle`)})]})]}),(0,_.jsx)(`div`,{className:`flex-1 overflow-auto p-6`,children:x&&b?(0,_.jsx)(O,{}):c?(0,_.jsx)(k,{onRetry:S}):(v?.length??0)===0?(0,_.jsx)(A,{}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:C.map(e=>(0,_.jsx)(y,{plugin:e,isInstalling:p===e.name,onInstall:()=>m(e.name),onCloseInstall:()=>{m(null),S()}},e.name))}),T.length>0&&(0,_.jsxs)(`div`,{className:`mt-10`,children:[(0,_.jsxs)(`h2`,{className:`text-sm font-semibold text-muted-foreground mb-3 flex items-center gap-2`,children:[(0,_.jsx)(i,{className:`w-3.5 h-3.5`}),` `,e(`page.deprecated`)]}),(0,_.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:T.map(e=>(0,_.jsx)(w,{plugin:e,onRemoved:S},e.name))})]})]})})]}):(0,_.jsx)(`div`,{className:`flex flex-col items-center justify-center h-full text-muted-foreground text-sm`,children:e(`page.selectProject`)})}function y({plugin:e,isInstalling:t,onInstall:n,onCloseInstall:r}){let{t:a}=f(`integrations`),[l,u]=(0,g.useState)(!1);return(0,_.jsxs)(`div`,{className:`rounded-lg border border-border bg-card p-4 flex flex-col gap-3`,children:[(0,_.jsx)(`div`,{className:`flex items-start gap-2`,children:(0,_.jsxs)(`div`,{className:`flex-1`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,_.jsx)(`h3`,{className:`text-sm font-semibold`,children:e.name}),(0,_.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground`,children:[`v`,e.version]}),e.status===`installed`&&(0,_.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-success/20 text-accent-success flex items-center gap-1`,children:[(0,_.jsx)(d,{className:`w-3 h-3`}),` `,a(`card.statusActive`)]}),e.status===`deactivated`&&(0,_.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground flex items-center gap-1`,children:[(0,_.jsx)(c,{className:`w-3 h-3`}),` `,a(`card.statusDeactivated`)]}),e.status===`degraded`&&(0,_.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-warning/20 text-accent-warning flex items-center gap-1`,children:[(0,_.jsx)(i,{className:`w-3 h-3`}),` `,a(`card.statusDegraded`)]}),e.updateAvailable&&(0,_.jsxs)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-accent-info/20 text-accent-info flex items-center gap-1`,children:[(0,_.jsx)(m,{className:`w-3 h-3`}),` `,a(`card.updateAvailable`)]})]}),e.category&&(0,_.jsx)(`p`,{className:`text-[10px] text-muted-foreground mt-0.5`,children:e.category})]})}),(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground leading-relaxed`,children:e.description}),e.whatItDoes.length>0&&(0,_.jsx)(`ul`,{className:`text-xs space-y-1 list-disc pl-4 text-foreground/80`,children:e.whatItDoes.map((e,t)=>(0,_.jsx)(`li`,{children:e},t))}),e.requirements.length>0&&(0,_.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:a(`card.requires`,{list:e.requirements.map(e=>`${e.name}${e.minVersion?` ≥ ${e.minVersion}`:``}`).join(`, `)})}),e.healthReason&&e.status===`degraded`&&(0,_.jsx)(`div`,{className:`text-[11px] text-accent-warning`,children:e.healthReason}),e.status===`deactivated`&&(0,_.jsx)(`div`,{className:`text-[11px] text-muted-foreground leading-relaxed`,children:(0,_.jsx)(s,{t:a,i18nKey:`card.deactivatedHint`,components:{strong:(0,_.jsx)(`strong`,{})}})}),e.marketplaceConflicts&&e.marketplaceConflicts.length>0&&(0,_.jsx)(C,{pluginName:e.name,conflicts:e.marketplaceConflicts}),e.marketplaceCachedButDisabled&&e.marketplaceCachedButDisabled.length>0&&(0,_.jsx)(x,{keys:e.marketplaceCachedButDisabled}),e.updateAvailable&&(0,_.jsx)(S,{pluginName:e.name}),(0,_.jsx)(`div`,{className:`mt-auto pt-2 flex items-center justify-end gap-2`,children:e.status===`not-installed`?(0,_.jsx)(`button`,{type:`button`,onClick:n,className:`text-xs px-3 py-1.5 rounded-md bg-accent-primary text-white hover:opacity-90`,children:a(`card.install`)}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(b,{pluginName:e.name,active:e.status===`installed`}),(0,_.jsxs)(`button`,{type:`button`,onClick:()=>u(!0),className:`text-xs px-3 py-1.5 rounded-md border border-border hover:bg-destructive/10 hover:text-destructive flex items-center gap-1.5`,children:[(0,_.jsx)(o,{className:`w-3 h-3`}),` `,a(`card.uninstall`)]})]})}),t&&(0,_.jsx)(T,{pluginName:e.name,onClose:r}),l&&(0,_.jsx)(E,{pluginName:e.name,onClose:()=>u(!1),onUninstalled:()=>{u(!1)}})]})}function b({pluginName:e,active:t}){let{t:n}=f(`integrations`),[r,i]=(0,g.useState)(!1),[o,s]=(0,g.useState)(null);return(0,_.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,_.jsx)(`button`,{type:`button`,disabled:r,onClick:async()=>{i(!0),s(null);try{let n=`${a()}/plugins/${e}/${t?`deactivate`:`activate`}`,r=await fetch(n,{method:`POST`});if(!r.ok)throw Error((await r.json()).error??`HTTP ${r.status}`)}catch(e){s(e.message)}finally{i(!1)}},role:`switch`,"aria-checked":t,className:`relative inline-flex items-center h-5 w-9 rounded-full transition-colors disabled:opacity-50 ${t?`bg-accent-success`:`bg-muted`}`,title:n(t?`toggle.titleActive`:`toggle.titleDeactivated`),children:(0,_.jsx)(`span`,{className:`inline-block h-4 w-4 rounded-full bg-white shadow transition-transform ${t?`translate-x-4`:`translate-x-0.5`}`})}),(0,_.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:n(t?`card.statusActive`:`common:states.off`)}),o&&(0,_.jsx)(`span`,{className:`text-[10px] text-destructive`,children:o})]})}function x({keys:e}){let{t}=f(`integrations`);return(0,_.jsxs)(`div`,{className:`text-[11px] rounded-md border border-yellow-500/30 bg-yellow-500/5 p-2 leading-relaxed space-y-1`,children:[(0,_.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,_.jsx)(i,{className:`w-3 h-3 text-yellow-500 mt-0.5 flex-shrink-0`}),(0,_.jsx)(`span`,{children:(0,_.jsx)(s,{t,i18nKey:`cachedNotice.body`,components:{strong:(0,_.jsx)(`strong`,{}),code:(0,_.jsx)(`code`,{className:`bg-muted px-1 rounded`})}})})]}),(0,_.jsx)(`div`,{className:`pl-5 space-y-0.5`,children:e.map(e=>(0,_.jsxs)(`pre`,{className:`text-[10px] bg-muted/40 rounded px-1.5 py-0.5 inline-block font-mono`,children:[`/plugin uninstall `,e]},e))}),(0,_.jsx)(`div`,{className:`pl-5 text-[10px] text-muted-foreground`,children:t(`cachedNotice.runInstruction`)})]})}function S({pluginName:e}){let{t}=f(`integrations`),[r,i]=(0,g.useState)(!1),[o,c]=(0,g.useState)(null);return(0,_.jsxs)(`div`,{className:`text-[11px] rounded-md border border-accent-info/30 bg-accent-info/5 p-2 leading-relaxed space-y-1.5`,children:[(0,_.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,_.jsx)(m,{className:`w-3 h-3 text-accent-info mt-0.5 flex-shrink-0`}),(0,_.jsx)(`span`,{children:(0,_.jsx)(s,{t,i18nKey:`update.body`,components:{code:(0,_.jsx)(`code`,{className:`bg-muted px-1 rounded`})}})})]}),(0,_.jsxs)(`button`,{type:`button`,disabled:r,onClick:async()=>{i(!0),c(null);try{let t=await fetch(`${a()}/plugins/${e}/update`,{method:`POST`});if(!t.ok)throw Error((await t.json()).error??`HTTP ${t.status}`)}catch(e){c(e.message)}finally{i(!1)}},className:`text-[10px] px-2 py-0.5 rounded border border-accent-info/40 hover:bg-accent-info/10 disabled:opacity-50 flex items-center gap-1`,children:[r&&(0,_.jsx)(n,{className:`w-2.5 h-2.5 animate-spin`}),(0,_.jsx)(s,{t,i18nKey:`update.button`,components:{code:(0,_.jsx)(`code`,{})}})]}),o&&(0,_.jsx)(`div`,{className:`text-destructive text-[10px]`,children:o})]})}function C({pluginName:e,conflicts:t}){let{t:r}=f(`integrations`),[o,c]=(0,g.useState)(null),[l,u]=(0,g.useState)(null),d=async e=>{c(e),u(null);try{let t=await fetch(`${a()}/plugins/_marketplace/disable`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({key:e})});if(!t.ok)throw Error((await t.json()).error??`HTTP ${t.status}`)}catch(e){u(e.message)}finally{c(null)}};return(0,_.jsxs)(`div`,{className:`text-[11px] rounded-md border border-yellow-500/30 bg-yellow-500/5 p-2 leading-relaxed space-y-1.5`,children:[(0,_.jsxs)(`div`,{className:`flex items-start gap-1.5`,children:[(0,_.jsx)(i,{className:`w-3 h-3 text-yellow-500 mt-0.5 flex-shrink-0`}),(0,_.jsx)(`span`,{children:(0,_.jsx)(s,{t:r,i18nKey:`conflict.body`,values:{name:e},components:{strong:(0,_.jsx)(`strong`,{})}})})]}),(0,_.jsx)(`div`,{className:`flex flex-wrap gap-1.5 pt-1`,children:t.map(e=>(0,_.jsxs)(`button`,{type:`button`,disabled:o===e,onClick:()=>d(e),className:`text-[10px] px-2 py-0.5 rounded border border-yellow-500/40 hover:bg-yellow-500/10 disabled:opacity-50 flex items-center gap-1`,children:[o===e&&(0,_.jsx)(n,{className:`w-2.5 h-2.5 animate-spin`}),(0,_.jsx)(s,{t:r,i18nKey:`conflict.disableButton`,values:{key:e},components:{code:(0,_.jsx)(`code`,{})}})]},e))}),l&&(0,_.jsx)(`div`,{className:`text-destructive`,children:l})]})}function w({plugin:e,onRemoved:t}){let{t:n}=f(`integrations`),[r,i]=(0,g.useState)(!1);return(0,_.jsxs)(`div`,{className:`rounded-lg border border-yellow-500/30 bg-yellow-500/5 p-4 flex flex-col gap-3`,children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,_.jsx)(`h3`,{className:`text-sm font-semibold`,children:e.name}),(0,_.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-yellow-500/20 text-yellow-500`,children:n(`orphan.badge`)})]}),(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description}),(0,_.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,_.jsxs)(`button`,{type:`button`,disabled:r,onClick:async()=>{i(!0);try{await fetch(`${a()}/plugins/${e.name}`,{method:`DELETE`}),t()}finally{i(!1)}},className:`text-xs px-3 py-1.5 rounded-md border border-border hover:bg-destructive/10 hover:text-destructive flex items-center gap-1.5`,children:[(0,_.jsx)(o,{className:`w-3 h-3`}),` `,n(`orphan.removeButton`)]})})]})}function T({pluginName:e,onClose:t}){let{t:r}=f(`integrations`),[o,s]=(0,g.useState)(null),[l,p]=(0,g.useState)(null),[h,v]=(0,g.useState)(!1),[y,b]=(0,g.useState)(null),[x,S]=(0,g.useState)([]),[C,w]=(0,g.useState)(null),[T,E]=(0,g.useState)([]),{registerHandler:O,unregisterHandler:k}=u(),A=(0,g.useCallback)(()=>{s(null),p(null),fetch(`${a()}/plugins/${e}/preview-install`).then(e=>e.ok?e.json():Promise.reject(Error(`HTTP ${e.status}`))).then(e=>s(e)).catch(e=>p(e.message))},[e]);(0,g.useEffect)(()=>{A()},[A]),(0,g.useEffect)(()=>(O(`install-${e}`,t=>{let n=t;if(n.type===`plugin.install_progress`&&n.name===e&&n.line&&S(e=>[...e,n.line]),n.type===`plugin.prereq_install_progress`&&n.line&&E(e=>[...e,n.line]),n.type===`plugin.prereq_installed`){w(null);let e=n.reason;e&&E(t=>[...t,`► ${e}`]),n.ok&&A()}}),()=>k(`install-${e}`)),[e,O,k,A]);let j=async e=>{w(e),E([r(`installDialog.installingPrereq`,{name:e})]);try{await fetch(`${a()}/plugins/_prerequisites/${e}/install`,{method:`POST`})}catch(e){E(t=>[...t,r(`installDialog.prereqStartFailed`,{message:e.message})]),w(null)}},M=(o?.requirements??[]).every(e=>e.installed&&e.executable&&e.meetsMinimum);return(0,_.jsxs)(D,{onClose:t,title:r(`installDialog.title`,{name:e}),children:[l&&(0,_.jsx)(`div`,{className:`text-xs text-destructive`,children:l}),!o&&!l&&(0,_.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,_.jsx)(n,{className:`w-3 h-3 animate-spin`}),` `,r(`installDialog.computingChanges`)]}),o&&(0,_.jsxs)(_.Fragment,{children:[o.platformNote&&(0,_.jsxs)(`div`,{className:`flex items-start gap-2 p-2.5 rounded-md border border-yellow-500/30 bg-yellow-500/5 text-[11px] leading-relaxed`,children:[(0,_.jsx)(i,{className:`w-3.5 h-3.5 text-yellow-500 mt-0.5 flex-shrink-0`}),(0,_.jsx)(`span`,{children:o.platformNote})]}),(0,_.jsxs)(`section`,{children:[(0,_.jsx)(`h4`,{className:`text-xs font-semibold mb-1.5`,children:r(`installDialog.filesHeading`)}),(0,_.jsx)(`ul`,{className:`text-xs space-y-0.5 font-mono`,children:o.files.map((e,t)=>(0,_.jsxs)(`li`,{className:e.op===`create`?`text-accent-success`:`text-accent-info`,children:[e.op===`create`?`+ `:`~ `,e.path,e.summary&&(0,_.jsxs)(`span`,{className:`text-muted-foreground`,children:[` `,e.summary]})]},t))})]}),o.requirements.length>0&&(0,_.jsxs)(`section`,{children:[(0,_.jsx)(`h4`,{className:`text-xs font-semibold mb-1.5`,children:r(`installDialog.prerequisites`)}),(0,_.jsx)(`ul`,{className:`text-xs space-y-1`,children:o.requirements.map(e=>{let t=e.installed&&e.executable&&e.meetsMinimum,i=e.name===`uv`;return(0,_.jsxs)(`li`,{className:`flex items-center gap-2`,children:[t?(0,_.jsx)(d,{className:`w-3 h-3 text-accent-success`}):(0,_.jsx)(c,{className:`w-3 h-3 text-accent-warning`}),(0,_.jsxs)(`span`,{children:[e.name,e.minVersion?` ≥ ${e.minVersion}`:``]}),e.version&&(0,_.jsxs)(`span`,{className:`text-muted-foreground`,children:[`(`,e.version,`)`]}),!t&&i&&(0,_.jsxs)(`button`,{type:`button`,disabled:C===e.name,onClick:()=>j(e.name),className:`ml-auto text-[10px] px-2 py-0.5 rounded border border-border hover:bg-muted disabled:opacity-50 flex items-center gap-1`,children:[C===e.name&&(0,_.jsx)(n,{className:`w-2.5 h-2.5 animate-spin`}),r(`installDialog.autoInstall`)]})]},e.name)})}),T.length>0&&(0,_.jsx)(`pre`,{className:`mt-2 text-[11px] bg-muted/40 rounded p-2 max-h-24 overflow-auto font-mono`,children:T.join(`
|
|
2
|
+
`)})]}),x.length>0&&(0,_.jsxs)(`section`,{children:[(0,_.jsx)(`h4`,{className:`text-xs font-semibold mb-1.5`,children:r(`installDialog.progress`)}),(0,_.jsx)(`pre`,{className:`text-[11px] bg-muted/40 rounded p-2 max-h-32 overflow-auto font-mono`,children:x.join(`
|
|
3
|
+
`)})]}),y&&(0,_.jsx)(`div`,{className:`text-xs text-destructive`,children:y})]}),(0,_.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,_.jsx)(`button`,{type:`button`,onClick:t,className:`text-xs px-3 py-1.5 rounded-md border border-border`,children:r(`common:actions.cancel`)}),(0,_.jsxs)(`button`,{type:`button`,disabled:!o||!M||h,onClick:async()=>{v(!0),b(null);try{let n=await fetch(`${a()}/plugins/${e}/install`,{method:`POST`});if(!n.ok)throw Error((await n.json()).error??`HTTP ${n.status}`);setTimeout(t,1500)}catch(e){b(e.message)}finally{v(!1)}},className:`text-xs px-3 py-1.5 rounded-md bg-accent-primary text-white disabled:opacity-50 flex items-center gap-1.5`,children:[h?(0,_.jsx)(n,{className:`w-3 h-3 animate-spin`}):(0,_.jsx)(m,{className:`w-3 h-3`}),r(`card.install`)]})]})]})}function E({pluginName:e,onClose:t,onUninstalled:r}){let{t:i}=f(`integrations`),[o,c]=(0,g.useState)(!1),[l,u]=(0,g.useState)(null);return(0,_.jsxs)(D,{onClose:t,title:i(`uninstallDialog.title`,{name:e}),children:[(0,_.jsx)(`p`,{className:`text-xs`,children:(0,_.jsx)(s,{t:i,i18nKey:`uninstallDialog.body`,components:{code:(0,_.jsx)(`code`,{})}})}),l&&(0,_.jsx)(`div`,{className:`text-xs text-destructive`,children:l}),(0,_.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,_.jsx)(`button`,{type:`button`,onClick:t,className:`text-xs px-3 py-1.5 rounded-md border border-border`,children:i(`common:actions.cancel`)}),(0,_.jsxs)(`button`,{type:`button`,disabled:o,onClick:async()=>{c(!0);try{let t=await fetch(`${a()}/plugins/${e}`,{method:`DELETE`});if(!t.ok)throw Error((await t.json()).error??`HTTP ${t.status}`);r()}catch(e){u(e.message)}finally{c(!1)}},className:`text-xs px-3 py-1.5 rounded-md bg-destructive text-white disabled:opacity-50 flex items-center gap-1.5`,children:[o&&(0,_.jsx)(n,{className:`w-3 h-3 animate-spin`}),i(`card.uninstall`)]})]})]})}function D({title:e,onClose:t,children:n}){return(0,_.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40`,role:`dialog`,tabIndex:-1,onClick:t,children:(0,_.jsxs)(`div`,{className:`bg-card border border-border rounded-lg shadow-xl w-full max-w-md p-5 flex flex-col gap-3`,onClick:e=>e.stopPropagation(),children:[(0,_.jsx)(`h3`,{className:`text-sm font-semibold`,children:e}),n]})})}function O(){return(0,_.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:Array.from({length:3},(e,t)=>(0,_.jsx)(`div`,{className:`rounded-lg border border-border bg-card p-4 h-40 animate-pulse`},t))})}function k({onRetry:e}){let{t}=f(`integrations`);return(0,_.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 gap-3 text-sm text-muted-foreground`,children:[(0,_.jsx)(i,{className:`w-5 h-5 text-destructive`}),(0,_.jsx)(`p`,{children:t(`page.loadError`)}),(0,_.jsx)(`button`,{type:`button`,onClick:e,className:`text-xs px-3 py-1.5 rounded-md border border-border`,children:t(`common:actions.retry`)})]})}function A(){let{t:e}=f(`integrations`);return(0,_.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 gap-2 text-sm text-muted-foreground`,children:[(0,_.jsx)(t,{className:`w-6 h-6`}),(0,_.jsx)(`p`,{children:e(`page.empty`)})]})}export{v as default};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{A as t,B as n,K as r,Kt as i,L as a,Mt as o,Nt as s,O as c,Qt as l,St as u,Xt as d,Zt as f,_ as p,a as m,at as h,bt as g,c as _,ct as v,d as y,f as b,it as x,jt as S,k as C,l as w,lt as T,nt as E,ot as D,qt as O,tn as k,tt as A,ut as j,v as M,vt as N,xt as ee,y as P}from"./index-XGZaKl_u.js";import{t as F}from"./lib-CPxTMOAq.js";import{t as te}from"./format-command-CwGuwzGA.js";var ne=N(`house`,[[`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`}]]),I=e(k(),1),L=o();function re({phases:e,phaseDefinitions:n}){return n.length===0?null:(0,L.jsx)(`div`,{className:`flex items-center`,children:n.map((r,i)=>{let a=e[r.key]??`idle`,o=i<n.length-1?e[n[i+1].key]??`idle`:null;return(0,L.jsxs)(`div`,{className:`flex items-center`,children:[(0,L.jsxs)(p,{children:[(0,L.jsx)(P,{asChild:!0,children:(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-1.5 cursor-default px-4`,children:[(0,L.jsx)(R,{state:a}),(0,L.jsx)(`span`,{className:t(`text-xs font-medium transition-colors`,a===`running`?`text-blue-400`:a===`done`?`text-emerald-400`:a===`error`?`text-red-400`:`text-muted-foreground/40`),children:r.label})]})}),(0,L.jsxs)(M,{side:`bottom`,className:`max-w-[200px]`,children:[(0,L.jsx)(`p`,{className:`font-medium`,children:r.label}),(0,L.jsx)(`p`,{className:`text-muted-foreground mt-0.5`,children:r.description})]})]}),o!==null&&(0,L.jsx)(`div`,{className:t(`h-px w-12 -mt-5 shrink-0 transition-all duration-300`,o===`done`||a===`done`?`bg-emerald-500/30`:o===`running`?`bg-blue-400/40`:`bg-border/30`)})]},r.key)})})}function R({state:e}){return(0,L.jsxs)(`div`,{className:t(`flex items-center justify-center w-10 h-10 rounded-full transition-all duration-300`,e===`running`?`bg-blue-500/10 ring-1 ring-blue-400/30 animate-pulse`:e===`done`?`bg-emerald-500/10`:e===`error`?`bg-red-500/10`:`bg-muted/20`),children:[e===`running`&&(0,L.jsx)(r,{className:`w-6 h-6 text-blue-400 animate-spin`}),e===`done`&&(0,L.jsx)(D,{className:`w-6 h-6 text-emerald-400`}),e===`error`&&(0,L.jsx)(h,{className:`w-6 h-6 text-red-400`}),e===`idle`&&(0,L.jsx)(x,{className:`w-6 h-6 text-muted-foreground/20`})]})}function z(e,t){let n=(typeof t==`number`?t:new Date(t).getTime())-new Date(e).getTime();if(!Number.isFinite(n)||n<0)return`—`;let r=Math.round(n/1e3);if(r<60)return`${r}s`;let i=Math.floor(r/60),a=r%60;return i<60?`${i}m ${a}s`:`${Math.floor(i/60)}h ${i%60}m`}function B(e){let t=new Set;for(let n of e)if(n.event_type===`log`)try{let e=(JSON.parse(n.payload).line??``).match(/(?:Writing|Editing|Created?|Updated?)\s+(?:file:\s*)?([\w./\-]+\.\w+)/i);e&&t.add(e[1])}catch{}return Array.from(t).slice(0,20)}var V={turns:0,tokens:0,lastSeenIdx:0};function H(e,t){if(t.type===`reset`)return V;if(t.type===`consume`){let{events:n}=t;if(n.length<=e.lastSeenIdx)return e;let{turns:r,tokens:i}=e;for(let t=e.lastSeenIdx;t<n.length;t++){let e=n[t];if(e.event_type===`assistant`){r+=1;try{let t=JSON.parse(e.payload)?.message?.usage,n=e=>typeof e==`number`?e:0;i+=n(t?.input_tokens)+n(t?.output_tokens)+n(t?.cache_read_input_tokens)+n(t?.cache_creation_input_tokens)}catch{}}}return{turns:r,tokens:i,lastSeenIdx:n.length}}return e}var U=new Set([`completed`,`failed`,`canceled`,`zombie_terminated`,`skipped`]);function ie({job:e,events:n,defaultOpen:i=!0,pipelineTotals:a}){let{t:o}=O(`jobs`),[s,c]=(0,I.useState)(i),l=(0,I.useMemo)(()=>B(n),[n]),u=e.status===`running`,d=e.status===`completed`,f=U.has(e.status),[p,m]=(0,I.useState)(()=>Date.now());(0,I.useEffect)(()=>{if(!u)return;let e=window.setInterval(()=>m(Date.now()),1e3);return()=>window.clearInterval(e)},[u]);let[g,_]=(0,I.useReducer)(H,V),v=(0,I.useRef)(e.id);(0,I.useEffect)(()=>{v.current!==e.id&&(v.current=e.id,_({type:`reset`})),_({type:`consume`,events:n})},[e.id,n]);let y=e.num_turns??(f?null:g.turns),b=e.tokens_in==null?f?null:g.tokens:(e.tokens_in??0)+(e.tokens_out??0)+(e.tokens_cache_read??0)+(e.tokens_cache_create??0),x=e.tokens_in==null&&!f&&b!=null,S=e.num_turns==null&&!f&&y!=null,C=e.finished_at?z(e.started_at,e.finished_at):u?z(e.started_at,p):`—`,w=o(u?`statusPanel.inProgress`:d?`statusPanel.completed`:`statusPanel.failed`),T=u?`border-accent-info/20 bg-accent-info/5`:d?`border-emerald-500/20 bg-emerald-500/5`:`border-red-500/20 bg-red-500/5`,E=u?r:d?D:h,k=u?`w-4 h-4 text-accent-info shrink-0 animate-spin`:d?`w-4 h-4 text-emerald-400 shrink-0`:`w-4 h-4 text-red-400 shrink-0`,A=!!e.total_cost_usd_estimated,M=e.total_cost_usd==null?`—`:`${A?`~`:``}$${e.total_cost_usd.toFixed(4)}`,N=e.total_cost_usd==null;return(0,L.jsxs)(`div`,{className:t(`mx-4 my-2 rounded-xl border`,T),children:[(0,L.jsxs)(`button`,{type:`button`,onClick:()=>c(!s),className:`w-full flex items-center gap-3 px-4 py-3`,children:[(0,L.jsx)(E,{className:k,"aria-hidden":`true`}),(0,L.jsx)(`span`,{className:`text-sm font-semibold flex-1 text-left`,children:w}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3 text-[11px] text-muted-foreground`,children:[(0,L.jsx)(`span`,{className:`tabular-nums`,children:C}),N?(0,L.jsx)(`span`,{className:`tabular-nums`,children:`—`}):(0,L.jsx)(`span`,{className:`tabular-nums text-yellow-400`,children:M}),l.length>0&&(0,L.jsx)(`span`,{children:o(`statusPanel.filesCount`,{count:l.length})})]}),(0,L.jsx)(j,{className:t(`w-4 h-4 text-muted-foreground/40 transition-transform duration-150 shrink-0`,s&&`rotate-180`)})]}),s&&(0,L.jsxs)(`div`,{className:`px-4 pb-4 space-y-3 border-t border-border/20`,children:[(0,L.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-2 pt-3`,children:[(0,L.jsx)(W,{label:o(`statusPanel.duration`),value:C}),(0,L.jsx)(W,{label:o(`statusPanel.cost`),value:M,valueClass:N?`text-muted-foreground`:`text-yellow-400`}),(0,L.jsx)(W,{label:o(`statusPanel.turns`),value:y==null?`—`:`${S?`~`:``}${y}`}),(0,L.jsx)(W,{label:o(`statusPanel.tokens`),value:b==null?`—`:`${x?`~`:``}${(b/1e3).toFixed(1)}k`})]}),a&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider mb-1.5`,children:o(`statusPanel.pipelineTotal`,{count:a.jobCount})}),(0,L.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,L.jsx)(W,{label:o(`statusPanel.totalCost`),value:`$${a.totalCostUsd.toFixed(4)}`,valueClass:`text-yellow-400`}),(0,L.jsx)(W,{label:o(`statusPanel.totalTokens`),value:`${((a.totalTokensIn+a.totalTokensOut+a.totalTokensCacheRead+a.totalTokensCacheCreate)/1e3).toFixed(1)}k`})]})]}),l.length>0&&(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider mb-1.5`,children:o(`statusPanel.filesModified`)}),(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:l.map(e=>(0,L.jsx)(`code`,{className:`text-[10px] font-mono bg-muted/30 px-2 py-0.5 rounded text-cyan-400/80`,children:e},e))})]})]})]})}function W({label:e,value:n,valueClass:r}){return(0,L.jsxs)(`div`,{className:`bg-muted/20 rounded-lg px-3 py-2`,children:[(0,L.jsx)(`p`,{className:`text-[10px] text-muted-foreground/50 uppercase tracking-wider`,children:e}),(0,L.jsx)(`p`,{className:t(`text-sm font-semibold tabular-nums mt-0.5`,r),children:n})]})}var G=4;function ae({tickets:e,onTicketClick:t}){let{t:n}=O(`jobs`),[r,i]=(0,I.useState)(!1);if(e.length===0)return null;let a=e.length>=G&&!r?e.slice(0,1):e,o=e.length-a.length;return(0,L.jsxs)(`div`,{className:`rounded-xl border border-border/40 bg-card/40 px-4 py-3 space-y-1.5`,children:[a.map(e=>(0,L.jsx)(K,{ticket:e,onClick:()=>t(e.id)},e.id)),o>0&&(0,L.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,children:[n(`ticketHeader.showMore`,{count:o}),(0,L.jsx)(j,{className:`w-3 h-3`})]}),r&&e.length>=G&&(0,L.jsxs)(`button`,{type:`button`,onClick:()=>i(!1),className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors`,children:[n(`ticketHeader.showLess`),(0,L.jsx)(v,{className:`w-3 h-3`})]})]})}function K({ticket:e,onClick:n}){let{t:r}=O(`jobs`),i=e.title==null,a=`inline-flex items-center px-1.5 py-0.5 rounded-md text-[11px] font-mono tabular-nums shrink-0`;return i?(0,L.jsx)(`div`,{className:`flex items-center gap-2 min-w-0`,children:(0,L.jsx)(`span`,{className:t(a,`text-muted-foreground bg-muted/20 select-none`),title:r(`ticketHeader.deletedTooltip`),children:r(`ticketHeader.deletedTicket`,{id:e.id})})}):(0,L.jsxs)(`button`,{type:`button`,onClick:n,className:`flex items-center gap-2 min-w-0 w-full text-left group`,title:e.title??void 0,children:[(0,L.jsxs)(`span`,{className:t(a,`text-accent-primary bg-accent-primary/10 group-hover:bg-accent-primary/20 transition-colors`),children:[`#`,e.id]}),(0,L.jsx)(`span`,{className:`text-lg font-semibold text-foreground truncate group-hover:text-accent-primary transition-colors`,children:e.title})]})}function q(e){let t=e.trimStart();return!!(/^#{1,6}\s/.test(t)||/^[-*+]\s/.test(t)||/^\d+\.\s/.test(t)||/^\|.+\|/.test(t)||t.startsWith("```")||t.startsWith(`> `)||/\*\*[^*]+\*\*/.test(e)||/`[^`]+`/.test(e)||/\[.+\]\(.+\)/.test(e)||/^(-{3,}|_{3,}|\*{3,})$/.test(t)||/^- \[[ x]\]\s/.test(t))}function J(e,t){let n=`${e.id??t}`,r=e.timestamp;if(e.event_type===`log`)try{let t=JSON.parse(e.payload).line??``;return t.trim()?t.startsWith(`▸`)||t.match(/^(architect|developer|reviewer|ship|analyst)\s*:/i)?{id:n,content:t,type:`phase`,timestamp:r}:e.source===`stderr`?{id:n,content:t,type:`stderr`,timestamp:r}:q(t)?{id:n,content:t,type:`assistant`,timestamp:r}:{id:n,content:t,type:`plain`,timestamp:r}:null}catch{return null}if(e.event_type!==`log`&&e.event_type!==`result`)return null;if(e.event_type===`result`)try{let t=JSON.parse(e.payload),i=[];return t.duration_ms&&i.push(`${(t.duration_ms/1e3).toFixed(1)}s`),t.total_cost_usd&&i.push(`$${t.total_cost_usd.toFixed(4)}`),t.num_turns&&i.push(u.t(`jobs:logViewer.turns`,{count:t.num_turns})),{id:n,content:`▸ ${u.t(`jobs:logViewer.completed`)}${i.length?` — ${i.join(` · `)}`:``}`,type:`result`,timestamp:r}}catch{return null}return null}function Y(e){let t=`none`,n=[];for(let r of e){let e=r.type;if(e!==`plain`&&e!==`log`){t=`none`,n.push(r);continue}let i=r.content;i.startsWith(`--- `)?(t=`saw_minus`,n.push({...r,type:`diff-meta`})):t===`saw_minus`&&i.startsWith(`+++ `)?(t=`active`,n.push({...r,type:`diff-meta`})):t===`active`&&i.startsWith(`@@ `)?n.push({...r,type:`diff-hunk`}):t===`active`&&i.startsWith(`+`)&&!i.startsWith(`+++`)?n.push({...r,type:`diff-add`}):t===`active`&&i.startsWith(`-`)&&!i.startsWith(`---`)?n.push({...r,type:`diff-remove`}):(t===`active`&&(i.startsWith(` `)||i===``)||(t=`none`),n.push(r))}return n}function X(e){let t=[{key:`__preamble__`,header:null,lines:[]}];for(let n of e)n.type===`phase`?t.push({key:n.id,header:n,lines:[]}):t[t.length-1].lines.push(n);return t.filter(e=>e.header!==null||e.lines.length>0)}function oe({events:e,isLoading:t}){let{t:n,i18n:r}=O(`jobs`),[o,s]=(0,I.useState)(``),[c,l]=(0,I.useState)(!0),[u,d]=(0,I.useState)(new Set),f=(0,I.useRef)(null),p=(0,I.useRef)(null),{processedLines:h,groups:g,totalLines:_}=(0,I.useMemo)(()=>{let t=e.map((e,t)=>J(e,t)).filter(e=>e!==null),n=[];for(let e of t){let t=n.length>0?n[n.length-1]:null;e.type===`assistant`&&t?.type===`assistant`?t.content+=`
|
|
2
|
+
`+e.content:n.push({...e})}let r=Y(n);return{processedLines:r,groups:X(r),totalLines:r.length}},[e,r.language]),v=(0,I.useMemo)(()=>{if(!o)return _;let e=o.toLowerCase();return h.filter(t=>t.content.toLowerCase().includes(e)).length},[o,h,_]),y=(0,I.useCallback)(()=>{let e=p.current;e&&(e.scrollTop=e.scrollHeight)},[]);(0,I.useEffect)(()=>{c&&y()},[e.length,c,y]);function b(){let e=p.current;e&&l(e.scrollHeight-e.scrollTop-e.clientHeight<50)}function x(e){d(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}return t?(0,L.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`logViewer.loading`)})}):_===0?(0,L.jsx)(`div`,{className:`flex-1 flex items-center justify-center`,children:(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`logViewer.empty`)})}):(0,L.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,L.jsxs)(`div`,{className:`px-4 py-2 border-b border-border flex items-center gap-2`,children:[(0,L.jsxs)(`div`,{className:`relative flex-1 max-w-xs`,children:[(0,L.jsx)(a,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 w-3 h-3 text-muted-foreground`}),(0,L.jsx)(m,{placeholder:n(`logViewer.filterPlaceholder`),value:o,onChange:e=>s(e.target.value),className:`pl-7 h-7`})]}),(0,L.jsx)(C,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-muted-foreground/50 hover:text-foreground`,onClick:()=>{let e=h.map(e=>e.content).join(`
|
|
3
|
+
`);navigator.clipboard.writeText(e).then(()=>{i.success(n(`logViewer.copySuccess`))}).catch(()=>{i.error(n(`logViewer.copyFailed`))})},children:(0,L.jsx)(E,{className:`w-3.5 h-3.5`})}),(0,L.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:n(`logViewer.lineCount`,{filtered:v,total:_})})]}),(0,L.jsxs)(`div`,{ref:p,className:`flex-1 overflow-y-auto p-2 text-xs relative`,onScroll:b,children:[g.map(e=>(0,L.jsx)(Z,{group:e,filter:o,collapsed:u.has(e.key),onToggle:()=>x(e.key)},e.key)),(0,L.jsx)(`div`,{ref:f})]}),!c&&(0,L.jsxs)(C,{size:`sm`,variant:`secondary`,onClick:()=>{l(!0),y()},className:`absolute bottom-16 right-6 h-7 gap-1 shadow-lg`,children:[(0,L.jsx)(j,{className:`w-3 h-3`}),n(`logViewer.jumpToBottom`)]})]})}var Z=(0,I.memo)(function({group:e,filter:n,collapsed:r,onToggle:i}){let{t:a}=O(`jobs`),o=n?e.lines.filter(e=>e.content.toLowerCase().includes(n.toLowerCase())):e.lines;if(e.header===null)return o.length===0?null:(0,L.jsx)(`div`,{children:o.map((e,t)=>(0,L.jsx)($,{line:e,even:t%2==0},e.id))});let s=e.header.content;return(0,L.jsxs)(`div`,{className:`mt-3 rounded-md overflow-hidden border border-border/20`,children:[(0,L.jsxs)(`button`,{type:`button`,onClick:i,className:t(`flex items-center gap-2 w-full text-left px-3 py-2`,`bg-primary/5 border-b border-primary/20`,`hover:bg-primary/10 transition-colors duration-150 cursor-pointer`),children:[(0,L.jsx)(T,{className:t(`w-3 h-3 text-primary/60 shrink-0 transition-transform duration-150`,!r&&`rotate-90`)}),(0,L.jsx)(`span`,{className:`flex-1 text-[12px] font-semibold text-foreground leading-none`,children:s}),e.header.timestamp&&(0,L.jsx)(`span`,{className:`text-[10px] text-muted-foreground/40 font-mono tabular-nums shrink-0`,children:new Date(e.header.timestamp).toLocaleTimeString(`en`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}),(0,L.jsx)(`span`,{className:`text-[10px] text-muted-foreground/40 shrink-0`,children:a(`logViewer.phaseLines`,{count:e.lines.length})})]}),!r&&(0,L.jsx)(`div`,{className:`bg-muted/5`,children:o.length===0?(0,L.jsx)(`p`,{className:`px-4 py-2 text-[10px] text-muted-foreground/40 italic`,children:a(n?`logViewer.noMatchingLines`:`logViewer.noOutput`)}):o.map((e,t)=>(0,L.jsx)($,{line:e,even:t%2==0},e.id))})]})}),Q=[F],$=(0,I.memo)(function({line:e,even:n}){let r=e.type===`assistant`,i=e.type===`diff-add`,a=e.type===`diff-remove`,o=e.type===`diff-meta`,s=e.type===`diff-hunk`;return(0,L.jsxs)(`div`,{className:t(`flex items-start gap-2 group px-2 py-0.5 rounded-sm`,!(i||a||o||s)&&(n?`bg-muted/20`:`bg-transparent`),e.type===`result`&&`bg-emerald-500/5 border-l-2 border-emerald-500/40 mt-2 py-2`,i&&`bg-emerald-500/8 border-l-2 border-emerald-500/50`,a&&`bg-red-500/8 border-l-2 border-red-500/50`,o&&`bg-accent-primary/5 border-l-2 border-accent-primary/30`,s&&`bg-accent-info/5 border-l-2 border-accent-info/30`),children:[e.timestamp&&(0,L.jsx)(`span`,{className:`text-[10px] text-muted-foreground/40 shrink-0 mt-0.5 w-[52px] font-mono tabular-nums`,children:new Date(e.timestamp).toLocaleTimeString(`en`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hour12:!1})}),r?(0,L.jsx)(`div`,{className:`flex-1 min-w-0 prose prose-invert prose-xs max-w-none
|
|
4
|
+
prose-p:my-1 prose-p:leading-relaxed
|
|
5
|
+
prose-headings:mt-2 prose-headings:mb-1 prose-headings:text-sm prose-headings:font-semibold
|
|
6
|
+
prose-ul:my-1 prose-ol:my-1 prose-li:my-0
|
|
7
|
+
prose-code:text-cyan-300 prose-code:text-[11px] prose-code:bg-muted/40 prose-code:px-1 prose-code:py-0.5 prose-code:rounded
|
|
8
|
+
prose-pre:my-1 prose-pre:bg-muted/30 prose-pre:rounded-md prose-pre:p-2 prose-pre:text-[11px]
|
|
9
|
+
prose-strong:text-foreground prose-em:text-foreground/70
|
|
10
|
+
prose-a:text-blue-400 prose-a:no-underline hover:prose-a:underline
|
|
11
|
+
prose-table:my-2 prose-table:text-[11px]
|
|
12
|
+
prose-thead:border-border prose-thead:bg-muted/30
|
|
13
|
+
prose-th:px-3 prose-th:py-1.5 prose-th:text-left prose-th:font-semibold prose-th:text-foreground/90
|
|
14
|
+
prose-td:px-3 prose-td:py-1.5 prose-td:border-border
|
|
15
|
+
prose-tr:border-border
|
|
16
|
+
text-foreground/80`,children:(0,L.jsx)(b,{remarkPlugins:[y],rehypePlugins:Q,children:e.content})}):(0,L.jsx)(`span`,{className:t(`flex-1 break-all leading-relaxed whitespace-pre-wrap font-mono`,e.type===`tool-use`&&`text-cyan-400/80 text-[11px]`,e.type===`stderr`&&`text-orange-400`,e.type===`result`&&`text-emerald-400 font-medium`,e.type===`log`&&`text-foreground/60`,e.type===`plain`&&`text-foreground/70`,e.type===`tool-result`&&`text-muted-foreground/50`,i&&`text-emerald-400`,a&&`text-red-400`,o&&`text-accent-primary/80`,s&&`text-accent-info/80`),children:e.content})]})}),se={running:{variant:`running`,labelKey:`statusLabel.running`,tooltipKey:`statusTooltip.running`},completed:{variant:`success`,labelKey:`statusLabel.completed`,tooltipKey:`statusTooltip.completed`},failed:{variant:`failed`,labelKey:`statusLabel.failed`,tooltipKey:`statusTooltip.failed`},canceled:{variant:`canceled`,labelKey:`statusLabel.canceled`,tooltipKey:`statusTooltip.canceled`},queued:{variant:`queued`,labelKey:`statusLabel.queued`,tooltipKey:`statusTooltip.queued`}};function ce(){let{t:e}=O(`jobs`),{id:r}=l(),{activeProjectId:a,projects:o}=g(),u=o.find(e=>e.id===a)?.provider,m=f(),{openTicketDetail:h}=_(),[v,y]=(0,I.useState)(null),[b,x]=(0,I.useState)([]),[E,D]=(0,I.useState)([]),[k,j]=(0,I.useState)({}),[N,F]=(0,I.useState)([]),[R,z]=(0,I.useState)(!0),[B,V]=(0,I.useState)(!1);(0,I.useEffect)(()=>{if(!r)return;let e=new AbortController;y(null),x([]),D([]),j({}),z(!0),V(!1);async function t(){try{let t=await fetch(`${s()}/jobs/${r}`,{signal:e.signal});if(t.status===404){V(!0);return}if(!t.ok)throw Error(`Failed to fetch job`);let n=await t.json();y(n.job),x(n.events)}catch(e){if(e.name===`AbortError`)return;V(!0)}finally{e.signal.aborted||z(!1)}}return t(),()=>e.abort()},[r,a]),(0,I.useEffect)(()=>{if(!v?.pipeline_id){F([]);return}let e=v.pipeline_id;fetch(`${s()}/pipelines/${e}`).then(e=>e.ok?e.json():null).then(e=>{e?.jobs&&F(e.jobs)}).catch(()=>{})},[v?.pipeline_id,v?.status]);let H=(0,I.useRef)(a);H.current=a;let U=(0,I.useRef)([]),W=(0,I.useRef)(null),G=(0,I.useCallback)(()=>{W.current=null;let e=U.current;e.length!==0&&(U.current=[],x(t=>{let n=[...t,...e];return n.length>1e4?n.slice(n.length-8e3):n}))},[]);(0,I.useEffect)(()=>()=>{W.current&&cancelAnimationFrame(W.current)},[]);let K=(0,I.useCallback)(e=>{let t=e;if(!(H.current&&t.projectId&&t.projectId!==H.current)){if(t.type===`init`){let e=t.phaseDefinitions??[];D(e);let n={};for(let r of e)n[r.key]=t.phases?.[r.key]??`idle`;j(n)}else if(t.type===`log`&&t.processId===r){let e={id:Date.now(),job_id:r??``,seq:0,event_type:`log`,source:t.source,payload:JSON.stringify({line:t.line}),timestamp:t.timestamp};U.current.push(e),W.current||=requestAnimationFrame(G)}else if(t.type===`phase`){let e=t.phase,n=t.state;j(t=>({...t,[e]:n}))}else if(t.type===`queue`){let e=t.jobs?.find(e=>e.id===r);if(e){let t=e.status;y(e=>e&&{...e,status:t}),(t===`completed`||t===`failed`||t===`canceled`)&&fetch(`${s()}/jobs/${r}`).then(e=>e.json()).then(e=>y(e.job)).catch(()=>{})}}}},[r,G]),{registerHandler:q,unregisterHandler:J}=S();(0,I.useEffect)(()=>(q(`job-detail-${r}`,K),()=>J(`job-detail-${r}`)),[r,K,q,J]),(0,I.useEffect)(()=>{if(!r||!v||v.status!==`running`||v.hasTelemetry)return;let e=setInterval(()=>{fetch(`${s()}/jobs/${r}`).then(e=>e.ok?e.json():null).then(e=>{e?.job?.hasTelemetry&&y(e=>e&&{...e,hasTelemetry:!0})}).catch(()=>{})},8e3);return()=>clearInterval(e)},[r,v?.status,v?.hasTelemetry]);async function Y(){if(r)try{let t=await fetch(`${s()}/jobs/${r}`,{method:`DELETE`});if(t.ok)(await t.json()).status===`deleted`?(i.success(e(`detail.toast.jobDeleted`)),m(`/jobs`)):i.success(e(`detail.toast.cancelSignalSent`),{description:e(`detail.toast.cancelSignalSentDescription`)});else{let n=await t.json();i.error(e(`detail.toast.failed`),{description:n.error})}}catch{i.error(e(`detail.toast.networkError`))}}async function X(){if(v)try{let t=await fetch(`${s()}/jobs/${v.id}/diagnostic`);if(!t.ok){let n=await t.json().catch(()=>({}));throw Error(n.error??e(`detail.toast.exportFailedHttp`,{status:t.status}))}let n=await t.blob(),r=URL.createObjectURL(n),i=new Date().toISOString().slice(0,10),a=document.createElement(`a`);a.href=r,a.download=`specrails-diagnostic-${v.id}-${i}.zip`,document.body.appendChild(a),a.click(),a.remove(),URL.revokeObjectURL(r)}catch(t){i.error(e(`detail.toast.exportFailed`),{description:t.message})}}async function Z(){if(v)try{let t=await fetch(`${s()}/spawn`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({command:v.command})}),n=await t.json();if(!t.ok)throw Error(n.error??e(`detail.toast.spawnFailed`));i.success(e(`detail.toast.jobRequeued`)),m(`/jobs/${n.jobId}`)}catch(e){i.error(e.message)}}if(R)return(0,L.jsx)(`div`,{className:`max-w-5xl mx-auto px-4 py-6`,children:(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsx)(`div`,{className:`h-4 w-48 bg-muted/30 rounded animate-pulse`}),(0,L.jsx)(`div`,{className:`h-20 bg-muted/30 rounded-lg animate-pulse`}),(0,L.jsx)(`div`,{className:`h-64 bg-muted/30 rounded-lg animate-pulse`})]})});if(B||!v)return(0,L.jsxs)(`div`,{className:`max-w-5xl mx-auto px-4 py-6 flex flex-col items-center gap-3 mt-12`,children:[(0,L.jsx)(`p`,{className:`text-lg font-semibold`,children:e(`detail.notFound`)}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`detail.notFoundDescription`,{id:r})}),(0,L.jsx)(C,{asChild:!0,variant:`outline`,size:`sm`,children:(0,L.jsxs)(d,{to:`/`,children:[(0,L.jsx)(ne,{className:`w-3.5 h-3.5 mr-1.5`}),e(`detail.backToDashboard`)]})})]});let Q=se[v.status]??se.queued,$=v.status===`running`,ce=v.status===`completed`||v.status===`failed`,le=(v.tickets?.length??0)>0,ue=N.length>1?{totalCostUsd:N.reduce((e,t)=>e+(t.total_cost_usd??0),0),totalTokensIn:N.reduce((e,t)=>e+(t.tokens_in??0),0),totalTokensOut:N.reduce((e,t)=>e+(t.tokens_out??0),0),totalTokensCacheRead:N.reduce((e,t)=>e+(t.tokens_cache_read??0),0),totalTokensCacheCreate:N.reduce((e,t)=>e+(t.tokens_cache_create??0),0),jobCount:N.length}:null;return(0,L.jsxs)(`div`,{"data-job-detail-surface":!0,className:`flex flex-col h-full max-w-5xl mx-auto w-full`,children:[(0,L.jsxs)(`div`,{className:`px-4 py-4 border-b border-border space-y-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-muted-foreground`,children:[(0,L.jsxs)(d,{to:`/`,className:`hover:text-foreground transition-colors flex items-center gap-1`,children:[(0,L.jsx)(ne,{className:`w-3 h-3`}),e(`detail.breadcrumbDashboard`)]}),(0,L.jsx)(T,{className:`w-3 h-3`}),(0,L.jsx)(`span`,{className:`text-foreground font-mono`,children:e(`detail.breadcrumbJob`,{id:r?.slice(0,8)})})]}),le&&(0,L.jsx)(ae,{tickets:v.tickets??[],onTicketClick:h}),(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`space-y-1 min-w-0`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,L.jsxs)(p,{children:[(0,L.jsx)(P,{asChild:!0,children:(0,L.jsx)(`div`,{children:(0,L.jsx)(c,{variant:Q.variant,children:e(Q.labelKey)})})}),(0,L.jsx)(M,{children:e(Q.tooltipKey)})]}),(0,L.jsx)(`code`,{className:t(`font-mono text-foreground/90 truncate`,le?`text-xs text-muted-foreground`:`text-sm`),children:te(v.command,u)})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-3 text-xs text-muted-foreground flex-wrap`,children:[(0,L.jsx)(`span`,{children:v.started_at?e(`detail.startedAgo`,{timeAgo:w(new Date(v.started_at),{addSuffix:!0,locale:ee()})}):e(`detail.queuedWaiting`)}),v.model&&(0,L.jsx)(`span`,{className:`text-muted-foreground/40`,children:v.model})]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[v.hasTelemetry&&(0,L.jsxs)(p,{children:[(0,L.jsx)(P,{asChild:!0,children:(0,L.jsxs)(C,{variant:`outline`,size:`sm`,className:`h-7`,onClick:X,"aria-label":e(`detail.exportDiagnosticAria`),children:[(0,L.jsx)(A,{className:`w-3.5 h-3.5 mr-1.5`}),e(`detail.exportDiagnostic`)]})}),(0,L.jsx)(M,{children:e(`detail.exportDiagnosticTooltip`)})]}),ce&&(0,L.jsxs)(p,{children:[(0,L.jsx)(P,{asChild:!0,children:(0,L.jsxs)(C,{variant:`outline`,size:`sm`,onClick:Z,className:`h-7`,children:[(0,L.jsx)(n,{className:`w-3.5 h-3.5 mr-1.5`}),e(`detail.reExecute`)]})}),(0,L.jsx)(M,{children:e(`detail.reExecuteTooltip`)})]}),$&&(0,L.jsxs)(p,{children:[(0,L.jsx)(P,{asChild:!0,children:(0,L.jsx)(C,{variant:`outline`,size:`sm`,onClick:Y,className:`h-7 border-destructive/30 text-destructive hover:bg-destructive/10`,children:e(`detail.cancelJob`)})}),(0,L.jsx)(M,{children:e(`detail.cancelJobTooltip`)})]})]})]}),(0,L.jsx)(re,{phases:k,phaseDefinitions:E})]}),(v.status===`running`||v.status===`completed`||v.status===`failed`)&&(0,L.jsx)(ie,{job:v,events:b,defaultOpen:v.status===`completed`||v.status===`running`,pipelineTotals:ue??void 0}),(0,L.jsx)(`div`,{className:`flex-1 overflow-hidden relative`,children:(0,L.jsx)(oe,{events:b})})]})}export{ce as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{C as t,Kt as n,M as r,Mt as i,Nt as a,O as o,P as s,S as c,T as l,Zt as u,_ as d,at as f,b as p,bt as m,d as ee,f as h,k as g,l as _,ot as v,q as y,qt as b,rt as x,t as S,tn as C,v as w,vt as T,w as E,x as D,xt as O,y as k}from"./index-XGZaKl_u.js";import{t as A}from"./ExportDropdown-BLZFXtNi.js";import{t as j}from"./useProjectCache-DSaiGFjV.js";import{t as te}from"./format-command-CwGuwzGA.js";var ne=T(`git-compare-arrows`,[[`circle`,{cx:`5`,cy:`6`,r:`3`,key:`1qnov2`}],[`path`,{d:`M12 6h5a2 2 0 0 1 2 2v7`,key:`1yj91y`}],[`path`,{d:`m15 9-3-3 3-3`,key:`1lwv8l`}],[`circle`,{cx:`19`,cy:`18`,r:`3`,key:`1qljk2`}],[`path`,{d:`M12 18H7a2 2 0 0 1-2-2V9`,key:`16sdep`}],[`path`,{d:`m9 15 3 3-3 3`,key:`1m3kbl`}]]),M=e(C(),1),N=i();function P(e){if(e==null)return`—`;let t=Math.round(e/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`}function F(e){return e==null?`—`:e===0?`$0`:e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(3)}`}function I(e){return e==null?`—`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function L({label:e,a:t,b:n,highlight:r}){return(0,N.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 py-2 border-b border-border/20 last:border-0 text-xs`,children:[(0,N.jsx)(`span`,{className:`text-muted-foreground`,children:e}),(0,N.jsx)(`span`,{className:`font-mono text-right ${r===`a`?`text-emerald-400 font-semibold`:``}`,children:t}),(0,N.jsx)(`span`,{className:`font-mono text-right ${r===`b`?`text-emerald-400 font-semibold`:``}`,children:n})]})}function R(e,t,n=!0){return e==null||t==null||e===t?null:n?e<t?`a`:`b`:e>t?`a`:`b`}function re({jobIds:e,onClose:t}){let{t:n}=b(`jobs`),[i,o]=(0,M.useState)(null),[s,c]=(0,M.useState)(!0),[l,u]=(0,M.useState)(null);(0,M.useEffect)(()=>{let t=new AbortController;return fetch(`${a()}/jobs/compare?jobIds=${e.join(`,`)}`,{signal:t.signal}).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.json()}).then(e=>{o(e),c(!1)}).catch(e=>{e.name!==`AbortError`&&(u(e.message),c(!1))}),()=>t.abort()},[e]);function d(e,t){return(0,N.jsxs)(`div`,{className:`text-center space-y-1`,children:[(0,N.jsx)(`p`,{className:`text-[10px] text-muted-foreground font-medium uppercase tracking-wider`,children:n(`comparison.jobN`,{n:t+1})}),(0,N.jsx)(`code`,{className:`text-[10px] text-foreground/70 block truncate max-w-[160px] mx-auto`,children:e.command}),(0,N.jsxs)(`div`,{className:`flex items-center justify-center gap-1 text-[10px]`,children:[e.status===`completed`?(0,N.jsx)(v,{className:`w-3 h-3 text-emerald-400`}):(0,N.jsx)(f,{className:`w-3 h-3 text-rose-400`}),(0,N.jsx)(`span`,{className:`capitalize text-muted-foreground`,children:n(`statusLabel.${e.status}`,{defaultValue:e.status})})]}),(0,N.jsx)(`p`,{className:`text-[10px] text-muted-foreground font-mono`,children:e.id.slice(0,8)})]})}return(0,N.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,onClick:t,children:(0,N.jsxs)(`div`,{className:`w-full max-w-lg rounded-xl border border-border/30 bg-popover p-5 shadow-xl space-y-4 mx-4`,onClick:e=>e.stopPropagation(),children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,N.jsx)(`h2`,{className:`text-sm font-semibold`,children:n(`comparison.title`)}),(0,N.jsx)(`button`,{type:`button`,onClick:t,className:`text-muted-foreground hover:text-foreground transition-colors`,children:(0,N.jsx)(r,{className:`w-4 h-4`})})]}),s&&(0,N.jsx)(`div`,{className:`space-y-2`,children:[0,1,2,3].map(e=>(0,N.jsx)(`div`,{className:`h-8 bg-muted/20 rounded animate-pulse`},e))}),l&&(0,N.jsx)(`p`,{className:`text-xs text-red-400`,children:n(`comparison.loadFailed`,{error:l})}),i&&(()=>{let[e,t]=i.jobs,r=R(e.durationMs,t.durationMs,!0),a=R(e.totalCostUsd,t.totalCostUsd,!0),o=R(e.tokensOut==null?null:e.tokensOut,t.tokensOut==null?null:t.tokensOut,!0);return(0,N.jsxs)(`div`,{children:[(0,N.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 pb-3 border-b border-border/30 mb-1`,children:[(0,N.jsx)(`div`,{}),d(e,0),d(t,1)]}),(0,N.jsx)(L,{label:n(`comparison.duration`),a:P(e.durationMs),b:P(t.durationMs),highlight:r}),(0,N.jsx)(L,{label:n(`comparison.cost`),a:F(e.totalCostUsd),b:F(t.totalCostUsd),highlight:a}),(0,N.jsx)(L,{label:n(`comparison.tokensOut`),a:I(e.tokensOut),b:I(t.tokensOut),highlight:o}),(0,N.jsx)(L,{label:n(`comparison.tokensIn`),a:I(e.tokensIn),b:I(t.tokensIn),highlight:null}),(0,N.jsx)(L,{label:n(`comparison.cacheRead`),a:I(e.tokensCacheRead),b:I(t.tokensCacheRead),highlight:null}),(0,N.jsx)(L,{label:n(`comparison.model`),a:e.model??`—`,b:t.model??`—`,highlight:null}),(0,N.jsx)(L,{label:n(`comparison.phasesDone`),a:e.phasesCompleted.length>0?e.phasesCompleted.join(`, `):`—`,b:t.phasesCompleted.length>0?t.phasesCompleted.join(`, `):`—`,highlight:null})]})})(),i&&(0,N.jsx)(`p`,{className:`text-[10px] text-muted-foreground/60 text-center`,children:n(`comparison.betterValueHint`)})]})})}var ie={running:{variant:`running`,labelKey:`statusLabel.running`,tooltipKey:`statusTooltip.running`},completed:{variant:`success`,labelKey:`statusLabel.done`,tooltipKey:`statusTooltip.completed`},failed:{variant:`failed`,labelKey:`statusLabel.failed`,tooltipKey:`statusTooltip.failed`},canceled:{variant:`canceled`,labelKey:`statusLabel.canceled`,tooltipKey:`statusTooltip.canceled`},queued:{variant:`queued`,labelKey:`statusLabel.queued`,tooltipKey:`statusTooltip.queuedToRun`},zombie_terminated:{variant:`failed`,labelKey:`statusLabel.zombie`,tooltipKey:`statusTooltip.zombie`},skipped:{variant:`warning`,labelKey:`statusLabel.skipped`,tooltipKey:`statusTooltip.skipped`}},ae=[`running`,`completed`,`failed`,`canceled`,`zombie_terminated`,`queued`,`skipped`],oe={critical:{className:`bg-red-500/15 text-red-400 border-red-500/30`,labelKey:`recent.priority.critical`},high:{className:`bg-orange-500/15 text-orange-400 border-orange-500/30`,labelKey:`recent.priority.high`},normal:{className:``,labelKey:`recent.priority.normal`},low:{className:`bg-gray-500/15 text-gray-400 border-gray-500/30`,labelKey:`recent.priority.low`}};function se(e){return e==null||e===0?null:e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(3)}`}function ce(e,t){if(!t)return null;let n=new Date(t).getTime()-new Date(e).getTime();if(n<0)return null;let r=Math.round(n/1e3);if(r<60)return`${r}s`;let i=Math.floor(r/60),a=r%60;return i<60?`${i}m ${a}s`:`${Math.floor(i/60)}h ${i%60}m`}function le(e){return e==null||e===0?null:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function ue(e){try{return _(new Date(e),{addSuffix:!0,locale:O()})}catch{return e}}var z=10;function B({jobs:e,isLoading:r,onJobsCleared:i,onProposalClick:f,onProposalDelete:ee}){let{t:h}=b(`jobs`),_=u(),{activeProjectId:v,projects:S}=m(),C=S.find(e=>e.id===v)?.provider,[T,O]=(0,M.useState)(null),[A,j]=(0,M.useState)(``),[P,F]=(0,M.useState)(``),[I,L]=(0,M.useState)(!1),[R,B]=(0,M.useState)(``),[V,H]=(0,M.useState)(``),[U,W]=(0,M.useState)(!1),[G,K]=(0,M.useState)(null),[q,J]=(0,M.useState)(z),[Y,de]=(0,M.useState)(!1),[X,Z]=(0,M.useState)([]),[fe,Q]=(0,M.useState)(null);(0,M.useEffect)(()=>{J(z)},[e.length]);function pe(){de(e=>!e),Z([])}function me(e){Z(t=>{if(t.includes(e))return t.filter(t=>t!==e);if(t.length>=2)return t;let n=[...t,e];return n.length===2&&Q(n),n})}let $=e.filter(e=>!(T&&e.status!==T||A&&e.started_at<A||P&&e.started_at>`${P}T23:59:59`)),he=e.filter(e=>!(R&&e.started_at<R||V&&e.started_at>`${V}T23:59:59`)).length;async function ge(e){W(!0);try{let t={};e===`range`&&(R&&(t.from=R),V&&(t.to=V));let r=await fetch(`${a()}/jobs`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(r.ok){let e=await r.json();n.success(h(`recent.toast.cleared`,{count:e.deleted})),L(!1),B(``),H(``),i?.()}else n.error(h(`recent.toast.clearFailed`))}catch{n.error(h(`recent.toast.networkError`))}finally{W(!1)}}return r?(0,N.jsx)(`div`,{className:`rounded-lg border border-border/40 bg-card/50 p-4 space-y-1`,children:[0,1,2].map(e=>(0,N.jsx)(`div`,{className:`h-9 bg-muted/30 rounded-md animate-pulse`},e))}):e.length===0?(0,N.jsxs)(`div`,{className:`rounded-lg border border-dashed border-border/40 bg-card/50 p-8 text-center space-y-2`,children:[(0,N.jsx)(x,{className:`w-8 h-8 text-muted-foreground/30 mx-auto`}),(0,N.jsx)(`p`,{className:`text-sm font-medium text-muted-foreground`,children:h(`recent.emptyTitle`)}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground/60`,children:h(`recent.emptyDescription`)})]}):(0,N.jsxs)(`div`,{className:`rounded-lg border border-border/40 bg-card/50 p-4 space-y-2`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,N.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,N.jsx)(`button`,{type:`button`,onClick:()=>O(null),className:`px-2 py-0.5 rounded text-[10px] font-medium transition-colors ${T===null?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground hover:bg-accent/50`}`,children:h(`recent.filterAll`,{count:e.length})}),ae.map(t=>{let n=e.filter(e=>e.status===t).length;return n===0?null:(0,N.jsx)(`button`,{type:`button`,onClick:()=>O(T===t?null:t),className:`px-2 py-0.5 rounded text-[10px] font-medium capitalize transition-colors ${T===t?`bg-accent text-foreground`:`text-muted-foreground hover:text-foreground hover:bg-accent/50`}`,children:h(`recent.filterStatus`,{status:h(`statusName.${t}`),count:n})},t)})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(`input`,{type:`date`,value:A,onChange:e=>j(e.target.value),className:`h-6 rounded border border-border bg-input px-1.5 text-[10px] text-foreground`,title:h(`recent.fromDate`)}),(0,N.jsx)(`input`,{type:`date`,value:P,onChange:e=>F(e.target.value),className:`h-6 rounded border border-border bg-input px-1.5 text-[10px] text-foreground`,title:h(`recent.toDate`)}),(A||P)&&(0,N.jsx)(`button`,{type:`button`,onClick:()=>{j(``),F(``)},className:`text-[10px] text-muted-foreground hover:text-foreground transition-colors`,children:h(`recent.clear`)}),(0,N.jsxs)(d,{children:[(0,N.jsx)(k,{asChild:!0,children:(0,N.jsx)(g,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 transition-colors ${Y?`text-foreground bg-accent`:`text-muted-foreground hover:text-foreground`}`,onClick:pe,children:(0,N.jsx)(ne,{className:`w-3.5 h-3.5`})})}),(0,N.jsx)(w,{children:h(Y?`recent.exitCompareMode`:`recent.compareTwoJobs`)})]}),(0,N.jsxs)(d,{children:[(0,N.jsx)(k,{asChild:!0,children:(0,N.jsx)(g,{variant:`ghost`,size:`sm`,className:`h-6 w-6 p-0 text-muted-foreground hover:text-destructive`,onClick:()=>L(!0),children:(0,N.jsx)(s,{className:`w-3.5 h-3.5`})})}),(0,N.jsx)(w,{children:h(`recent.clearJobs`)})]})]})]}),Y&&(0,N.jsxs)(`div`,{className:`flex items-center justify-between rounded-md bg-accent/40 px-3 py-1.5 text-[10px] text-muted-foreground`,children:[(0,N.jsxs)(`span`,{children:[X.length===0&&h(`recent.selectTwoToCompare`),X.length===1&&h(`recent.selectOneMore`),X.length===2&&h(`recent.readyToCompare`)]}),X.length===2&&(0,N.jsx)(`button`,{type:`button`,className:`text-[10px] font-medium text-foreground hover:underline`,onClick:()=>Q(X),children:h(`recent.compareAction`)})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-3 px-3 py-1 text-[10px] font-medium text-muted-foreground uppercase tracking-wider`,children:[(0,N.jsx)(`span`,{className:`w-14`,children:h(`recent.colStatus`)}),(0,N.jsx)(`span`,{className:`flex-1 min-w-0`,children:h(`recent.colCommand`)}),(0,N.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[(0,N.jsx)(`span`,{className:`w-14 text-right`,children:h(`recent.colDuration`)}),(0,N.jsx)(`span`,{className:`w-12 text-right`,children:h(`recent.colTokens`)}),(0,N.jsx)(`span`,{className:`w-12 text-right`,children:h(`recent.colCost`)}),(0,N.jsx)(`span`,{className:`w-20 text-right`,children:h(`recent.colStarted`)})]})]}),(0,N.jsx)(`div`,{className:`space-y-0.5`,children:$.slice(0,q).map(e=>{let t=ie[e.status]??ie.queued,n=se(e.total_cost_usd),r=ce(e.started_at,e.finished_at),i=le((e.tokens_in??0)+(e.tokens_out??0)+(e.tokens_cache_read??0)+(e.tokens_cache_create??0)||null),a=e.id.startsWith(`proposal:`),c=a?e.id.replace(`proposal:`,``):null,l=X.includes(e.id),u=Y&&!a&&X.length===2&&!l;return(0,N.jsxs)(`div`,{role:`button`,tabIndex:0,className:`flex items-center gap-3 px-3 py-2 rounded-md transition-colors cursor-pointer group ${l?`bg-accent/70 ring-1 ring-border`:u?`opacity-40 cursor-not-allowed`:`hover:bg-accent/50`}`,onClick:()=>{if(Y&&!a){me(e.id);return}a&&c?f?.(c):_(`/jobs/${e.id}`)},children:[(0,N.jsxs)(d,{children:[(0,N.jsx)(k,{asChild:!0,children:(0,N.jsx)(`div`,{children:(0,N.jsx)(o,{variant:t.variant,children:h(t.labelKey)})})}),(0,N.jsx)(w,{children:h(t.tooltipKey)})]}),e.priority&&e.priority!==`normal`&&(0,N.jsx)(`span`,{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-medium border ${oe[e.priority].className}`,children:h(oe[e.priority].labelKey)}),e.profile_name&&(0,N.jsxs)(d,{children:[(0,N.jsx)(k,{asChild:!0,children:(0,N.jsx)(`span`,{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-medium border border-accent-primary/40 bg-accent-primary/10 text-accent-primary/90`,children:e.profile_name})}),(0,N.jsx)(w,{children:h(`recent.profileTooltip`,{name:e.profile_name})})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-1 flex-1 min-w-0`,children:[e.pipeline_id&&(0,N.jsxs)(d,{children:[(0,N.jsx)(k,{asChild:!0,children:(0,N.jsx)(y,{className:`w-3 h-3 text-accent-primary/60 shrink-0`})}),(0,N.jsxs)(w,{children:[h(`recent.pipelinePart`),e.depends_on_job_id&&` ${h(`recent.pipelineDependsOn`)}`,e.skip_reason&&` — ${e.skip_reason}`]})]}),(0,N.jsx)(`code`,{className:`text-xs text-foreground/80 truncate`,children:te(e.command,C)})]}),(0,N.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px] text-muted-foreground shrink-0`,children:[(0,N.jsx)(`span`,{className:`w-14 text-right`,children:r??`—`}),(0,N.jsx)(`span`,{className:`w-12 text-right`,children:i?`${i}`:`—`}),(0,N.jsx)(`span`,{className:`w-12 text-right`,children:n??`—`}),(0,N.jsx)(`span`,{className:`w-20 text-right`,children:ue(e.started_at)}),a&&c&&(0,N.jsx)(`button`,{type:`button`,className:`w-4 h-4 md:opacity-0 md:group-hover:opacity-100 text-muted-foreground hover:text-destructive transition-all`,onClick:e=>{e.stopPropagation(),K(c)},title:h(`recent.deleteProposal`),children:(0,N.jsx)(s,{className:`w-3 h-3`})})]})]},e.id)})}),$.length>q&&(0,N.jsx)(`div`,{className:`pt-1 text-center`,children:(0,N.jsx)(`button`,{type:`button`,onClick:()=>J(e=>e+z),className:`text-[10px] text-muted-foreground hover:text-foreground transition-colors px-3 py-1 rounded hover:bg-accent/50`,children:h(`recent.loadMore`,{count:$.length-q})})}),I&&(0,N.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm`,onClick:()=>L(!1),children:(0,N.jsxs)(`div`,{className:`w-80 rounded-xl border border-border/30 bg-popover p-4 shadow-lg space-y-4`,onClick:e=>e.stopPropagation(),children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`h3`,{className:`text-sm font-semibold`,children:h(`recent.clearModal.title`)}),(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:h(`recent.clearModal.jobsInHistory`,{count:e.length})})]}),(0,N.jsx)(g,{variant:`destructive`,size:`sm`,className:`w-full`,disabled:U,onClick:()=>ge(`all`),children:h(`recent.clearModal.clearAll`,{count:e.length})}),(0,N.jsxs)(`div`,{className:`space-y-2`,children:[(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:h(`recent.clearModal.orByRange`)}),(0,N.jsxs)(`div`,{className:`flex gap-2`,children:[(0,N.jsx)(`input`,{type:`date`,value:R,onChange:e=>B(e.target.value),className:`flex-1 h-7 rounded-md border border-border bg-input px-2 text-xs text-foreground`,placeholder:h(`recent.clearModal.fromPlaceholder`)}),(0,N.jsx)(`input`,{type:`date`,value:V,onChange:e=>H(e.target.value),className:`flex-1 h-7 rounded-md border border-border bg-input px-2 text-xs text-foreground`,placeholder:h(`recent.clearModal.toPlaceholder`)})]}),(0,N.jsx)(g,{variant:`outline`,size:`sm`,className:`w-full`,disabled:U||!R&&!V,onClick:()=>ge(`range`),children:R||V?h(`recent.clearModal.clearInRange`,{count:he}):h(`recent.clearModal.clearRange`)})]}),(0,N.jsx)(g,{variant:`ghost`,size:`sm`,className:`w-full`,onClick:()=>L(!1),children:h(`common:actions.cancel`)})]})}),(0,N.jsx)(p,{open:G!==null,onOpenChange:e=>!e&&K(null),children:(0,N.jsxs)(D,{className:`max-w-sm`,children:[(0,N.jsxs)(E,{children:[(0,N.jsx)(l,{children:h(`recent.deleteProposalConfirm.title`)}),(0,N.jsx)(c,{children:h(`recent.deleteProposalConfirm.description`)})]}),(0,N.jsxs)(t,{children:[(0,N.jsx)(g,{variant:`ghost`,size:`sm`,onClick:()=>K(null),children:h(`common:actions.cancel`)}),(0,N.jsx)(g,{variant:`destructive`,size:`sm`,onClick:()=>{G&&ee?.(G),K(null)},children:h(`common:actions.delete`)})]})]})}),fe&&(0,N.jsx)(re,{jobIds:fe,onClose:()=>{Q(null),Z([]),de(!1)}})]})}function V(){let{t:e}=b(`jobs`),{activeProjectId:r}=m(),{recentJobs:i}=S(r),{data:s,isFirstLoad:c,refresh:u}=j({namespace:`jobs`,projectId:r,initialValue:i,fetcher:async()=>{let e=await fetch(`${a()}/jobs?limit=10`);return e.ok?(await e.json()).jobs:[]},pollInterval:1e4}),{data:d}=j({namespace:`proposals`,projectId:r,initialValue:[],fetcher:async()=>{let e=await fetch(`${a()}/propose?limit=10`);return e.ok?(await e.json()).proposals:[]},pollInterval:1e4}),f={input:`queued`,exploring:`running`,review:`running`,refining:`running`,creating_issue:`running`,created:`completed`,cancelled:`canceled`},_=d.map(e=>({id:`proposal:${e.id}`,command:`/specrails:propose-feature ${e.idea.length>60?e.idea.slice(0,57)+`...`:e.idea}`,started_at:e.created_at,status:f[e.status]??`queued`})),v=[...s,..._].sort((e,t)=>new Date(t.started_at).getTime()-new Date(e.started_at).getTime()),[y,x]=(0,M.useState)(null),C=(0,M.useCallback)(async e=>{try{let t=await fetch(`${a()}/propose/${e}`);if(!t.ok)return;x((await t.json()).proposal)}catch{}},[]),w=(0,M.useCallback)(async t=>{try{(await fetch(`${a()}/propose/${t}`,{method:`DELETE`})).ok&&(n.success(e(`page.proposalDeleted`)),u())}catch{}},[u,e]);return(0,N.jsxs)(`div`,{className:`max-w-4xl mx-auto px-4 py-6`,children:[(0,N.jsxs)(`div`,{className:`flex items-center justify-between mb-4`,children:[(0,N.jsx)(`h1`,{className:`text-sm font-semibold`,children:e(`page.title`)}),(0,N.jsx)(A,{baseUrl:`${a()}/jobs/export`,label:e(`page.exportJobs`)})]}),(0,N.jsx)(B,{jobs:v,isLoading:c,onJobsCleared:u,onProposalClick:C,onProposalDelete:w}),(0,N.jsx)(p,{open:y!==null,onOpenChange:e=>!e&&x(null),children:(0,N.jsx)(D,{className:`max-w-3xl glass-card`,children:y&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(E,{children:(0,N.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,N.jsx)(l,{className:`flex-1 min-w-0`,children:e(`page.proposal.title`)}),(0,N.jsx)(o,{variant:y.status===`created`?`success`:y.status===`cancelled`?`destructive`:`secondary`,children:y.status})]})}),(0,N.jsx)(`div`,{className:`text-xs text-muted-foreground bg-muted/20 rounded px-2 py-1 italic`,children:y.idea}),y.result_markdown?(0,N.jsx)(`div`,{className:`max-h-[400px] overflow-y-auto rounded-lg px-3 py-2 text-xs bg-muted/40`,children:(0,N.jsx)(`div`,{className:`prose prose-invert prose-xs max-w-none prose-p:my-1 prose-headings:mt-2 prose-headings:mb-1 prose-headings:text-sm prose-headings:font-semibold prose-ul:my-1 prose-ol:my-1 prose-li:my-0 prose-code:text-cyan-300 prose-code:text-[10px] prose-code:bg-muted/40 prose-code:px-1 prose-code:py-0.5 prose-code:rounded text-foreground/80`,children:(0,N.jsx)(h,{remarkPlugins:[ee],children:y.result_markdown})})}):(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground py-4 text-center`,children:e(`page.proposal.noContent`)}),y.issue_url&&(0,N.jsxs)(`div`,{className:`text-xs`,children:[e(`page.proposal.githubIssue`),` `,(0,N.jsx)(`a`,{href:y.issue_url,target:`_blank`,rel:`noopener noreferrer`,className:`text-accent-primary hover:underline`,children:y.issue_url})]}),(0,N.jsxs)(t,{children:[(0,N.jsx)(g,{variant:`destructive`,size:`sm`,onClick:()=>{w(y.id),x(null)},children:e(`common:actions.delete`)}),(0,N.jsx)(g,{variant:`ghost`,size:`sm`,onClick:()=>x(null),children:e(`common:actions.close`)})]})]})})})]})}export{V as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={comments:{lineComment:`*`},brackets:[[`[`,`]`],[`(`,`)`]]},t={defaultToken:`invalid`,ignoreCase:!0,tokenPostfix:`.abap`,keywords:`abap-source.abbreviated.abstract.accept.accepting.according.activation.actual.add.add-corresponding.adjacent.after.alias.aliases.align.all.allocate.alpha.analysis.analyzer.and.append.appendage.appending.application.archive.area.arithmetic.as.ascending.aspect.assert.assign.assigned.assigning.association.asynchronous.at.attributes.authority.authority-check.avg.back.background.backup.backward.badi.base.before.begin.between.big.binary.bintohex.bit.black.blank.blanks.blob.block.blocks.blue.bound.boundaries.bounds.boxed.break-point.buffer.by.bypassing.byte.byte-order.call.calling.case.cast.casting.catch.center.centered.chain.chain-input.chain-request.change.changing.channels.character.char-to-hex.check.checkbox.ci_.circular.class.class-coding.class-data.class-events.class-methods.class-pool.cleanup.clear.client.clob.clock.close.coalesce.code.coding.col_background.col_group.col_heading.col_key.col_negative.col_normal.col_positive.col_total.collect.color.column.columns.comment.comments.commit.common.communication.comparing.component.components.compression.compute.concat.concat_with_space.concatenate.cond.condense.condition.connect.connection.constants.context.contexts.continue.control.controls.conv.conversion.convert.copies.copy.corresponding.country.cover.cpi.create.creating.critical.currency.currency_conversion.current.cursor.cursor-selection.customer.customer-function.dangerous.data.database.datainfo.dataset.date.dats_add_days.dats_add_months.dats_days_between.dats_is_valid.daylight.dd/mm/yy.dd/mm/yyyy.ddmmyy.deallocate.decimal_shift.decimals.declarations.deep.default.deferred.define.defining.definition.delete.deleting.demand.department.descending.describe.destination.detail.dialog.directory.disconnect.display.display-mode.distinct.divide.divide-corresponding.division.do.dummy.duplicate.duplicates.duration.during.dynamic.dynpro.edit.editor-call.else.elseif.empty.enabled.enabling.encoding.end.endat.endcase.endcatch.endchain.endclass.enddo.endenhancement.end-enhancement-section.endexec.endform.endfunction.endian.endif.ending.endinterface.end-lines.endloop.endmethod.endmodule.end-of-definition.end-of-editing.end-of-file.end-of-page.end-of-selection.endon.endprovide.endselect.end-test-injection.end-test-seam.endtry.endwhile.endwith.engineering.enhancement.enhancement-point.enhancements.enhancement-section.entries.entry.enum.environment.equiv.errormessage.errors.escaping.event.events.exact.except.exception.exceptions.exception-table.exclude.excluding.exec.execute.exists.exit.exit-command.expand.expanding.expiration.explicit.exponent.export.exporting.extend.extended.extension.extract.fail.fetch.field.field-groups.fields.field-symbol.field-symbols.file.filter.filters.filter-table.final.find.first.first-line.fixed-point.fkeq.fkge.flush.font.for.form.format.forward.found.frame.frames.free.friends.from.function.functionality.function-pool.further.gaps.generate.get.giving.gkeq.gkge.global.grant.green.group.groups.handle.handler.harmless.hashed.having.hdb.header.headers.heading.head-lines.help-id.help-request.hextobin.hide.high.hint.hold.hotspot.icon.id.identification.identifier.ids.if.ignore.ignoring.immediately.implementation.implementations.implemented.implicit.import.importing.in.inactive.incl.include.includes.including.increment.index.index-line.infotypes.inheriting.init.initial.initialization.inner.inout.input.insert.instance.instances.instr.intensified.interface.interface-pool.interfaces.internal.intervals.into.inverse.inverted-date.is.iso.job.join.keep.keeping.kernel.key.keys.keywords.kind.language.last.late.layout.leading.leave.left.left-justified.leftplus.leftspace.legacy.length.let.level.levels.like.line.lines.line-count.linefeed.line-selection.line-size.list.listbox.list-processing.little.llang.load.load-of-program.lob.local.locale.locator.logfile.logical.log-point.long.loop.low.lower.lpad.lpi.ltrim.mail.main.major-id.mapping.margin.mark.mask.match.matchcode.max.maximum.medium.members.memory.mesh.message.message-id.messages.messaging.method.methods.min.minimum.minor-id.mm/dd/yy.mm/dd/yyyy.mmddyy.mode.modif.modifier.modify.module.move.move-corresponding.multiply.multiply-corresponding.name.nametab.native.nested.nesting.new.new-line.new-page.new-section.next.no.no-display.no-extension.no-gap.no-gaps.no-grouping.no-heading.no-scrolling.no-sign.no-title.no-topofpage.no-zero.node.nodes.non-unicode.non-unique.not.null.number.object.objects.obligatory.occurrence.occurrences.occurs.of.off.offset.ole.on.only.open.option.optional.options.or.order.other.others.out.outer.output.output-length.overflow.overlay.pack.package.pad.padding.page.pages.parameter.parameters.parameter-table.part.partially.pattern.percentage.perform.performing.person.pf1.pf10.pf11.pf12.pf13.pf14.pf15.pf2.pf3.pf4.pf5.pf6.pf7.pf8.pf9.pf-status.pink.places.pool.pos_high.pos_low.position.pragmas.precompiled.preferred.preserving.primary.print.print-control.priority.private.procedure.process.program.property.protected.provide.public.push.pushbutton.put.queue-only.quickinfo.radiobutton.raise.raising.range.ranges.read.reader.read-only.receive.received.receiver.receiving.red.redefinition.reduce.reduced.ref.reference.refresh.regex.reject.remote.renaming.replace.replacement.replacing.report.request.requested.reserve.reset.resolution.respecting.responsible.result.results.resumable.resume.retry.return.returncode.returning.returns.right.right-justified.rightplus.rightspace.risk.rmc_communication_failure.rmc_invalid_status.rmc_system_failure.role.rollback.rows.rpad.rtrim.run.sap.sap-spool.saving.scale_preserving.scale_preserving_scientific.scan.scientific.scientific_with_leading_zero.scroll.scroll-boundary.scrolling.search.secondary.seconds.section.select.selection.selections.selection-screen.selection-set.selection-sets.selection-table.select-options.send.separate.separated.set.shared.shift.short.shortdump-id.sign_as_postfix.single.size.skip.skipping.smart.some.sort.sortable.sorted.source.specified.split.spool.spots.sql.sqlscript.stable.stamp.standard.starting.start-of-editing.start-of-selection.state.statement.statements.static.statics.statusinfo.step-loop.stop.structure.structures.style.subkey.submatches.submit.subroutine.subscreen.subtract.subtract-corresponding.suffix.sum.summary.summing.supplied.supply.suppress.switch.switchstates.symbol.syncpoints.syntax.syntax-check.syntax-trace.system-call.system-exceptions.system-exit.tab.tabbed.table.tables.tableview.tabstrip.target.task.tasks.test.testing.test-injection.test-seam.text.textpool.then.throw.time.times.timestamp.timezone.tims_is_valid.title.titlebar.title-lines.to.tokenization.tokens.top-lines.top-of-page.trace-file.trace-table.trailing.transaction.transfer.transformation.translate.transporting.trmac.truncate.truncation.try.tstmp_add_seconds.tstmp_current_utctimestamp.tstmp_is_valid.tstmp_seconds_between.type.type-pool.type-pools.types.uline.unassign.under.unicode.union.unique.unit_conversion.unix.unpack.until.unwind.up.update.upper.user.user-command.using.utf-8.valid.value.value-request.values.vary.varying.verification-message.version.via.view.visible.wait.warning.when.whenever.where.while.width.window.windows.with.with-heading.without.with-title.word.work.write.writer.xml.xsd.yellow.yes.yymmdd.zero.zone.abap_system_timezone.abap_user_timezone.access.action.adabas.adjust_numbers.allow_precision_loss.allowed.amdp.applicationuser.as_geo_json.as400.associations.balance.behavior.breakup.bulk.cds.cds_client.check_before_save.child.clients.corr.corr_spearman.cross.cycles.datn_add_days.datn_add_months.datn_days_between.dats_from_datn.dats_tims_to_tstmp.dats_to_datn.db2.db6.ddl.dense_rank.depth.deterministic.discarding.entities.entity.error.failed.finalize.first_value.fltp_to_dec.following.fractional.full.graph.grouping.hierarchy.hierarchy_ancestors.hierarchy_ancestors_aggregate.hierarchy_descendants.hierarchy_descendants_aggregate.hierarchy_siblings.incremental.indicators.lag.last_value.lead.leaves.like_regexpr.link.locale_sap.lock.locks.many.mapped.matched.measures.median.mssqlnt.multiple.nodetype.ntile.nulls.occurrences_regexpr.one.operations.oracle.orphans.over.parent.parents.partition.pcre.period.pfcg_mapping.preceding.privileged.product.projection.rank.redirected.replace_regexpr.reported.response.responses.root.row.row_number.sap_system_date.save.schema.session.sets.shortdump.siblings.spantree.start.stddev.string_agg.subtotal.sybase.tims_from_timn.tims_to_timn.to_blob.to_clob.total.trace-entry.tstmp_to_dats.tstmp_to_dst.tstmp_to_tims.tstmpl_from_utcl.tstmpl_to_utcl.unbounded.utcl_add_seconds.utcl_current.utcl_seconds_between.uuid.var.verbatim`.split(`.`),builtinFunctions:`abs.acos.asin.atan.bit-set.boolc.boolx.ceil.char_off.charlen.cmax.cmin.concat_lines_of.contains.contains_any_not_of.contains_any_of.cos.cosh.count.count_any_not_of.count_any_of.dbmaxlen.distance.escape.exp.find_any_not_of.find_any_of.find_end.floor.frac.from_mixed.ipow.line_exists.line_index.log.log10.matches.nmax.nmin.numofchar.repeat.rescale.reverse.round.segment.shift_left.shift_right.sign.sin.sinh.sqrt.strlen.substring.substring_after.substring_before.substring_from.substring_to.tan.tanh.to_lower.to_mixed.to_upper.trunc.utclong_add.utclong_current.utclong_diff.xsdbool.xstrlen`.split(`.`),typeKeywords:`b.c.d.decfloat16.decfloat34.f.i.int8.n.p.s.string.t.utclong.x.xstring.any.clike.csequence.decfloat.numeric.simple.xsequence.accp.char.clnt.cuky.curr.datn.dats.d16d.d16n.d16r.d34d.d34n.d34r.dec.df16_dec.df16_raw.df34_dec.df34_raw.fltp.geom_ewkb.int1.int2.int4.lang.lchr.lraw.numc.quan.raw.rawstring.sstring.timn.tims.unit.utcl.df16_scl.df34_scl.prec.varc.abap_bool.abap_false.abap_true.abap_undefined.me.screen.space.super.sy.syst.table_line.*sys*`.split(`.`),builtinMethods:[`class_constructor`,`constructor`],derivedTypes:[`%CID`,`%CID_REF`,`%CONTROL`,`%DATA`,`%ELEMENT`,`%FAIL`,`%KEY`,`%MSG`,`%PARAM`,`%PID`,`%PID_ASSOC`,`%PID_PARENT`,`%_HINTS`],cdsLanguage:[`@AbapAnnotation`,`@AbapCatalog`,`@AccessControl`,`@API`,`@ClientDependent`,`@ClientHandling`,`@CompatibilityContract`,`@DataAging`,`@EndUserText`,`@Environment`,`@LanguageDependency`,`@MappingRole`,`@Metadata`,`@MetadataExtension`,`@ObjectModel`,`@Scope`,`@Semantics`,`$EXTENSION`,`$SELF`],selectors:[`->`,`->*`,`=>`,`~`,`~*`],operators:` +. -./.*.**.div.mod.=.#.@.+=.-=.*=./=.**=.&&=.?=.&.&&.bit-and.bit-not.bit-or.bit-xor.m.o.z.<. >.<=.>=.<>.><.=<.=>.bt.byte-ca.byte-cn.byte-co.byte-cs.byte-na.byte-ns.ca.cn.co.cp.cs.eq.ge.gt.le.lt.na.nb.ne.np.ns.*/.*:.--./*.//`.split(`.`),symbols:/[=><!~?&+\-*\/\^%#@]+/,tokenizer:{root:[[/[a-z_\/$%@]([\w\/$%]|-(?!>))*/,{cases:{"@typeKeywords":`type`,"@keywords":`keyword`,"@cdsLanguage":`annotation`,"@derivedTypes":`type`,"@builtinFunctions":`type`,"@builtinMethods":`type`,"@operators":`key`,"@default":`identifier`}}],[/<[\w]+>/,`identifier`],[/##[\w|_]+/,`comment`],{include:`@whitespace`},[/[:,.]/,`delimiter`],[/[{}()\[\]]/,`@brackets`],[/@symbols/,{cases:{"@selectors":`tag`,"@operators":`key`,"@default":``}}],[/'/,{token:`string`,bracket:`@open`,next:`@stringquote`}],[/`/,{token:`string`,bracket:`@open`,next:`@stringping`}],[/\|/,{token:`string`,bracket:`@open`,next:`@stringtemplate`}],[/\d+/,`number`]],stringtemplate:[[/[^\\\|]+/,`string`],[/\\\|/,`string`],[/\|/,{token:`string`,bracket:`@close`,next:`@pop`}]],stringping:[[/[^\\`]+/,`string`],[/`/,{token:`string`,bracket:`@close`,next:`@pop`}]],stringquote:[[/[^\\']+/,`string`],[/'/,{token:`string`,bracket:`@close`,next:`@pop`}]],whitespace:[[/[ \t\r\n]+/,``],[/^\*.*$/,`comment`],[/\".*$/,`comment`]]}};export{e as conf,t as language};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={title:`Actividad`,emptyTitle:`Aún no hay actividad`,emptyHint:`Los eventos de los jobs aparecerán aquí cuando se ejecuten`,allLoaded:`Toda la actividad cargada`,typeStarted:`Iniciado`,phaseCommand:`Fase: {{phase}} → {{state}}`,relativeTime:{seconds:`hace {{value}}s`,minutes:`hace {{value}}m`,hours:`hace {{value}}h`,days:`hace {{value}}d`}},t={generating:`Generando... {{elapsed}}`,generatedIn:`Generada en {{elapsed}}`,specCreated:`Spec creada`,view:`Ver`,errorGenerating:`Error al generar la spec`,couldNotFind:`No se encontró la spec generada`,couldNotConfirm:`No se pudo confirmar que la spec se creara`},n={refining:`Refinando contrato…`,retryRejected:`Reintento rechazado`,retryRejectedWithError:`Reintento rechazado: {{error}}`,retryFailed:`Reintento fallido: {{message}}`,skipped:`Contract Layer omitido — el ticket se ha guardado sin él`,reason:`Motivo: {{reason}}`,added:`Contract Layer añadido · {{title}}`},r={stage:{analyzing:`Analizando la spec…`,identifying:`Identificando subtareas…`,ordering:`Ordenando la ejecución…`},onTitled:`SMASH sobre “{{title}}”`,onThisSpec:`SMASH sobre esta spec`,split_one:`Spec dividida en {{count}} Sub-Spec`,split_other:`Spec dividida en {{count}} Sub-Specs`,undoAction:`Deshacer`,undone:`SMASH deshecho`,undoFailed:`No se pudo deshacer`,undoFailedWithReason:`No se pudo deshacer: {{reason}}`,retrying:`Reintentando SMASH…`,couldNotRetry:`No se pudo reintentar`,couldNotRetryWithReason:`No se pudo reintentar: {{reason}}`,retryFailed:`Reintento fallido: {{message}}`,couldNotComplete:`SMASH no pudo completarse`,failReason:{invalidOutput:`El agente devolvió una salida no válida`,timeout:`El agente tardó demasiado`,modelError:`El modelo devolvió un error`,crashed:`El proceso del agente se bloqueó`,generic:`Motivo: {{reason}}`},couldNotStart:`No se pudo iniciar SMASH`,couldNotStartWithReason:`No se pudo iniciar SMASH: {{reason}}`,smashFailed:`SMASH falló: {{message}}`,couldNotDeleteChildren:`No se pudieron eliminar las Sub-Specs actuales`,deleteFailed:`Error al eliminar: {{message}}`,smashButton:`SMASH: dividir la spec en Sub-Specs`,reSmashButton:`Re-SMASH`},i={title:`SMASH: dividir la spec en Sub-Specs`,modePickerLabel:`Modo de descomposición`,reSmashWarning_one:`⚠️ Esto eliminará la <strong>{{count}}</strong> Sub-Spec actual y creará otras nuevas.`,reSmashWarning_other:`⚠️ Esto eliminará las <strong>{{count}}</strong> Sub-Specs actuales y creará otras nuevas.`,modes:{simple:{title:`Simple`,eta:`~10-30s`,bullet1:`Descomposición en un solo paso basada únicamente en el título y la descripción de la spec.`,bullet2:`Sin acceso al código — rápida y determinista.`,bullet3:`Ideal para specs limpias con un Contract Layer sólido.`},full:{title:`Completo`,eta:`~3-10 min`,bullet1:`Descomposición profunda multi-turno con acceso de solo lectura al código — lee de forma agresiva.`,bullet2:`Cada Sub-Spec es una super-spec: contexto, plan, archivos, casos límite, fuera de alcance, tests.`,bullet3:`De 4 a 10 criterios de aceptación por Sub-Spec, anclados en rutas de archivo reales.`,bullet4:`Los tokens se gastan sin reparos — calidad antes que velocidad.`}},starting:`Iniciando…`,confirmReSmash:`Confirmar Re-SMASH`,smash:`SMASH`},a={subSpecsHeader:`Sub-Specs ({{count}})`,emptySubSpecs:`No hay Sub-Specs. Usa Re-SMASH para regenerarlas.`,familyHeader_one:`Familia ({{count}} Sub-Spec)`,familyHeader_other:`Familia ({{count}} Sub-Specs)`,noSiblings:`No hay specs hermanas.`,openParentEpic:`Abrir Epic padre {{title}}`,openSubSpec:`Abrir Sub-Spec {{title}}`},o={header:`Sub-Specs ({{count}})`,empty:`No hay Sub-Specs. Este Epic se vació — usa Re-SMASH para regenerarlas.`,step:`· paso {{order}} de {{total}}`},s={feed:e,specGen:t,contractRefine:n,smash:r,smashModal:i,family:a,epicChildren:o};export{n as contractRefine,s as default,o as epicChildren,a as family,e as feed,r as smash,i as smashModal,t as specGen};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={title:`Aktivität`,emptyTitle:`Noch keine Aktivität`,emptyHint:`Job-Ereignisse erscheinen hier, sobald Jobs laufen`,allLoaded:`Gesamte Aktivität geladen`,typeStarted:`Gestartet`,phaseCommand:`Phase: {{phase}} → {{state}}`,relativeTime:{seconds:`vor {{value}}s`,minutes:`vor {{value}}m`,hours:`vor {{value}}h`,days:`vor {{value}}d`}},t={generating:`Wird generiert... {{elapsed}}`,generatedIn:`Generiert in {{elapsed}}`,specCreated:`Spec erstellt`,view:`Anzeigen`,errorGenerating:`Fehler beim Generieren der Spec`,couldNotFind:`Generierte Spec wurde nicht gefunden`,couldNotConfirm:`Erstellung der Spec konnte nicht bestätigt werden`},n={refining:`Contract wird verfeinert…`,retryRejected:`Wiederholung abgelehnt`,retryRejectedWithError:`Wiederholung abgelehnt: {{error}}`,retryFailed:`Wiederholung fehlgeschlagen: {{message}}`,skipped:`Contract Layer übersprungen – Ticket ohne ihn gespeichert`,reason:`Grund: {{reason}}`,added:`Contract Layer hinzugefügt · {{title}}`},r={stage:{analyzing:`Spec wird analysiert…`,identifying:`Teilaufgaben werden identifiziert…`,ordering:`Ausführung wird geordnet…`},onTitled:`SMASH auf „{{title}}“`,onThisSpec:`SMASH auf dieser Spec`,split_one:`Spec in {{count}} Sub-Spec aufgeteilt`,split_other:`Spec in {{count}} Sub-Specs aufgeteilt`,undoAction:`Rückgängig`,undone:`SMASH rückgängig gemacht`,undoFailed:`Rückgängig machen fehlgeschlagen`,undoFailedWithReason:`Rückgängig machen fehlgeschlagen: {{reason}}`,retrying:`SMASH wird wiederholt…`,couldNotRetry:`Wiederholung nicht möglich`,couldNotRetryWithReason:`Wiederholung nicht möglich: {{reason}}`,retryFailed:`Wiederholung fehlgeschlagen: {{message}}`,couldNotComplete:`SMASH konnte nicht abgeschlossen werden`,failReason:{invalidOutput:`Der Agent hat eine ungültige Ausgabe geliefert`,timeout:`Der Agent hat zu lange gebraucht`,modelError:`Das Modell hat einen Fehler zurückgegeben`,crashed:`Der Agent-Prozess ist abgestürzt`,generic:`Grund: {{reason}}`},couldNotStart:`SMASH konnte nicht gestartet werden`,couldNotStartWithReason:`SMASH konnte nicht gestartet werden: {{reason}}`,smashFailed:`SMASH fehlgeschlagen: {{message}}`,couldNotDeleteChildren:`Aktuelle Sub-Specs konnten nicht gelöscht werden`,deleteFailed:`Löschen fehlgeschlagen: {{message}}`,smashButton:`Spec per SMASH in Sub-Specs aufteilen`,reSmashButton:`Re-SMASH`},i={title:`Spec per SMASH in Sub-Specs aufteilen`,modePickerLabel:`Zerlegungsmodus`,reSmashWarning_one:`⚠️ Dies löscht die <strong>{{count}}</strong> aktuelle Sub-Spec und erstellt neue.`,reSmashWarning_other:`⚠️ Dies löscht die <strong>{{count}}</strong> aktuellen Sub-Specs und erstellt neue.`,modes:{simple:{title:`Einfach`,eta:`~10-30s`,bullet1:`One-Shot-Zerlegung allein auf Basis von Titel und Beschreibung der Spec.`,bullet2:`Kein Codebase-Zugriff – schnell und deterministisch.`,bullet3:`Am besten für saubere Specs mit starkem Contract Layer.`},full:{title:`Vollständig`,eta:`~3-10 min`,bullet1:`Tiefe Multi-Turn-Zerlegung mit Lesezugriff auf die Codebase – liest aggressiv.`,bullet2:`Jede Sub-Spec ist eine Super-Spec: Hintergrund, Plan, Dateien, Edge Cases, Out-of-Scope, Tests.`,bullet3:`4–10 Akzeptanzkriterien pro Sub-Spec, verankert in echten Dateipfaden.`,bullet4:`Tokens werden großzügig eingesetzt – Qualität vor Geschwindigkeit.`}},starting:`Wird gestartet…`,confirmReSmash:`Re-SMASH bestätigen`,smash:`SMASH`},a={subSpecsHeader:`Sub-Specs ({{count}})`,emptySubSpecs:`Keine Sub-Specs. Nutze Re-SMASH zum Neugenerieren.`,familyHeader_one:`Familie ({{count}} Sub-Spec)`,familyHeader_other:`Familie ({{count}} Sub-Specs)`,noSiblings:`Keine Geschwister.`,openParentEpic:`Übergeordnetes Epic {{title}} öffnen`,openSubSpec:`Sub-Spec {{title}} öffnen`},o={header:`Sub-Specs ({{count}})`,empty:`Keine Sub-Specs. Dieses Epic wurde geleert – nutze Re-SMASH zum Neugenerieren.`,step:`· Schritt {{order}} von {{total}}`},s={feed:e,specGen:t,contractRefine:n,smash:r,smashModal:i,family:a,epicChildren:o};export{n as contractRefine,s as default,o as epicChildren,a as family,e as feed,r as smash,i as smashModal,t as specGen};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={title:`Attività`,emptyTitle:`Ancora nessuna attività`,emptyHint:`Gli eventi dei job appariranno qui quando i job saranno in esecuzione`,allLoaded:`Tutta l'attività caricata`,typeStarted:`Avviato`,phaseCommand:`Fase: {{phase}} → {{state}}`,relativeTime:{seconds:`{{value}}s fa`,minutes:`{{value}}m fa`,hours:`{{value}}h fa`,days:`{{value}}g fa`}},t={generating:`Generazione... {{elapsed}}`,generatedIn:`Generata in {{elapsed}}`,specCreated:`Spec creata`,view:`Visualizza`,errorGenerating:`Errore nella generazione della spec`,couldNotFind:`Impossibile trovare la spec generata`,couldNotConfirm:`Impossibile confermare la creazione della spec`},n={refining:`Rifinitura del contract…`,retryRejected:`Nuovo tentativo rifiutato`,retryRejectedWithError:`Nuovo tentativo rifiutato: {{error}}`,retryFailed:`Nuovo tentativo non riuscito: {{message}}`,skipped:`Contract layer saltato — ticket salvato senza`,reason:`Motivo: {{reason}}`,added:`Contract layer aggiunto · {{title}}`},r={stage:{analyzing:`Analisi della spec…`,identifying:`Identificazione dei sottotask…`,ordering:`Ordinamento dell'esecuzione…`},onTitled:`SMASH su “{{title}}”`,onThisSpec:`SMASH su questa spec`,split_one:`Spec divisa in {{count}} Sub-Spec`,split_other:`Spec divisa in {{count}} Sub-Spec`,undoAction:`Annulla`,undone:`SMASH annullato`,undoFailed:`Annullamento non riuscito`,undoFailedWithReason:`Annullamento non riuscito: {{reason}}`,retrying:`Nuovo tentativo di SMASH…`,couldNotRetry:`Impossibile riprovare`,couldNotRetryWithReason:`Impossibile riprovare: {{reason}}`,retryFailed:`Nuovo tentativo non riuscito: {{message}}`,couldNotComplete:`Impossibile completare SMASH`,failReason:{invalidOutput:`L'agente ha restituito un output non valido`,timeout:`L'agente ha impiegato troppo tempo`,modelError:`Il modello ha restituito un errore`,crashed:`Il processo dell'agente è andato in crash`,generic:`Motivo: {{reason}}`},couldNotStart:`Impossibile avviare SMASH`,couldNotStartWithReason:`Impossibile avviare SMASH: {{reason}}`,smashFailed:`SMASH non riuscito: {{message}}`,couldNotDeleteChildren:`Impossibile eliminare le Sub-Spec attuali`,deleteFailed:`Eliminazione non riuscita: {{message}}`,smashButton:`SMASH della spec in Sub-Spec`,reSmashButton:`Re-SMASH`},i={title:`SMASH della spec in Sub-Spec`,modePickerLabel:`Modalità di scomposizione`,reSmashWarning_one:`⚠️ Questa operazione eliminerà la <strong>{{count}}</strong> Sub-Spec attuale e ne creerà di nuove.`,reSmashWarning_other:`⚠️ Questa operazione eliminerà le <strong>{{count}}</strong> Sub-Spec attuali e ne creerà di nuove.`,modes:{simple:{title:`Semplice`,eta:`~10-30s`,bullet1:`Scomposizione one-shot basata solo sul titolo e sulla descrizione della spec.`,bullet2:`Nessun accesso alla codebase — veloce e deterministica.`,bullet3:`Ideale per spec pulite con un Contract Layer solido.`},full:{title:`Completa`,eta:`~3-10 min`,bullet1:`Scomposizione approfondita multi-turno con accesso in sola lettura alla codebase — legge in modo aggressivo.`,bullet2:`Ogni Sub-Spec è una super-spec: Background, Piano, File, Casi limite, Fuori ambito, Test.`,bullet3:`4-10 criteri di accettazione per Sub-Spec, ancorati a percorsi di file reali.`,bullet4:`I token si spendono liberamente — qualità prima della velocità.`}},starting:`Avvio…`,confirmReSmash:`Conferma Re-SMASH`,smash:`SMASH`},a={subSpecsHeader:`Sub-Spec ({{count}})`,emptySubSpecs:`Nessuna Sub-Spec. Usa Re-SMASH per rigenerarle.`,familyHeader_one:`Famiglia ({{count}} Sub-Spec)`,familyHeader_other:`Famiglia ({{count}} Sub-Spec)`,noSiblings:`Nessuna Sub-Spec correlata.`,openParentEpic:`Apri l'Epic padre {{title}}`,openSubSpec:`Apri la Sub-Spec {{title}}`},o={header:`Sub-Spec ({{count}})`,empty:`Nessuna Sub-Spec. Questo Epic è stato svuotato — usa Re-SMASH per rigenerarle.`,step:`· passaggio {{order}} di {{total}}`},s={feed:e,specGen:t,contractRefine:n,smash:r,smashModal:i,family:a,epicChildren:o};export{n as contractRefine,s as default,o as epicChildren,a as family,e as feed,r as smash,i as smashModal,t as specGen};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={title:`アクティビティ`,emptyTitle:`アクティビティはまだありません`,emptyHint:`ジョブが実行されるとイベントがここに表示されます`,allLoaded:`すべてのアクティビティを読み込みました`,typeStarted:`開始`,phaseCommand:`フェーズ: {{phase}} → {{state}}`,relativeTime:{seconds:`{{value}}秒前`,minutes:`{{value}}分前`,hours:`{{value}}時間前`,days:`{{value}}日前`}},t={generating:`生成中... {{elapsed}}`,generatedIn:`{{elapsed}} で生成完了`,specCreated:`スペックを作成しました`,view:`表示`,errorGenerating:`スペックの生成中にエラーが発生しました`,couldNotFind:`生成されたスペックが見つかりませんでした`,couldNotConfirm:`スペックの作成を確認できませんでした`},n={refining:`コントラクトをリファイン中…`,retryRejected:`再試行が拒否されました`,retryRejectedWithError:`再試行が拒否されました: {{error}}`,retryFailed:`再試行に失敗しました: {{message}}`,skipped:`Contract Layer をスキップしました — チケットはそれなしで保存されました`,reason:`理由: {{reason}}`,added:`Contract Layer を追加しました · {{title}}`},r={stage:{analyzing:`スペックを分析中…`,identifying:`サブタスクを特定中…`,ordering:`実行順を決定中…`},onTitled:`「{{title}}」に SMASH`,onThisSpec:`このスペックに SMASH`,split_one:`スペックを {{count}} 件のサブスペックに分割しました`,split_other:`スペックを {{count}} 件のサブスペックに分割しました`,undoAction:`元に戻す`,undone:`SMASH を元に戻しました`,undoFailed:`元に戻せませんでした`,undoFailedWithReason:`元に戻せませんでした: {{reason}}`,retrying:`SMASH を再試行中…`,couldNotRetry:`再試行できませんでした`,couldNotRetryWithReason:`再試行できませんでした: {{reason}}`,retryFailed:`再試行に失敗しました: {{message}}`,couldNotComplete:`SMASH を完了できませんでした`,failReason:{invalidOutput:`エージェントが無効な出力を返しました`,timeout:`エージェントの処理に時間がかかりすぎました`,modelError:`モデルがエラーを返しました`,crashed:`エージェントプロセスがクラッシュしました`,generic:`理由: {{reason}}`},couldNotStart:`SMASH を開始できませんでした`,couldNotStartWithReason:`SMASH を開始できませんでした: {{reason}}`,smashFailed:`SMASH に失敗しました: {{message}}`,couldNotDeleteChildren:`現在のサブスペックを削除できませんでした`,deleteFailed:`削除に失敗しました: {{message}}`,smashButton:`スペックをサブスペックに SMASH`,reSmashButton:`再 SMASH`},i={title:`スペックをサブスペックに SMASH`,modePickerLabel:`分割モード`,reSmashWarning_one:`⚠️ 現在の <strong>{{count}}</strong> 件のサブスペックを削除し、新しく作成します。`,reSmashWarning_other:`⚠️ 現在の <strong>{{count}}</strong> 件のサブスペックを削除し、新しく作成します。`,modes:{simple:{title:`シンプル`,eta:`~10-30秒`,bullet1:`スペックのタイトルと説明のみに基づくワンショット分割。`,bullet2:`コードベースへのアクセスなし — 高速かつ決定的。`,bullet3:`強力な Contract Layer を持つクリーンなスペックに最適。`},full:{title:`フル`,eta:`~3-10分`,bullet1:`読み取り専用のコードベースアクセスを伴う多ターンの徹底的な分割 — 積極的に読み込みます。`,bullet2:`各サブスペックはスーパースペック: 背景、計画、ファイル、エッジケース、対象外、テスト。`,bullet3:`サブスペックごとに 4〜10 件の受け入れ基準を、実在するファイルパスに基づいて作成。`,bullet4:`トークンは惜しまず使用 — 速度より品質。`}},starting:`開始中…`,confirmReSmash:`再 SMASH を確認`,smash:`SMASH`},a={subSpecsHeader:`サブスペック ({{count}})`,emptySubSpecs:`サブスペックがありません。再 SMASH で再生成してください。`,familyHeader_one:`ファミリー (サブスペック {{count}} 件)`,familyHeader_other:`ファミリー (サブスペック {{count}} 件)`,noSiblings:`兄弟スペックはありません。`,openParentEpic:`親エピック {{title}} を開く`,openSubSpec:`サブスペック {{title}} を開く`},o={header:`サブスペック ({{count}})`,empty:`サブスペックがありません。このエピックは空になりました — 再 SMASH で再生成してください。`,step:`· ステップ {{order}} / {{total}}`},s={feed:e,specGen:t,contractRefine:n,smash:r,smashModal:i,family:a,epicChildren:o};export{n as contractRefine,s as default,o as epicChildren,a as family,e as feed,r as smash,i as smashModal,t as specGen};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={title:`Activité`,emptyTitle:`Aucune activité pour l'instant`,emptyHint:`Les événements des jobs apparaîtront ici quand des jobs s'exécuteront`,allLoaded:`Toute l'activité est chargée`,typeStarted:`Démarré`,phaseCommand:`Phase : {{phase}} → {{state}}`,relativeTime:{seconds:`il y a {{value}} s`,minutes:`il y a {{value}} min`,hours:`il y a {{value}} h`,days:`il y a {{value}} j`}},t={generating:`Génération... {{elapsed}}`,generatedIn:`Générée en {{elapsed}}`,specCreated:`Spec créée`,view:`Voir`,errorGenerating:`Erreur lors de la génération de la spec`,couldNotFind:`Impossible de trouver la spec générée`,couldNotConfirm:`Impossible de confirmer la création de la spec`},n={refining:`Affinage du contrat…`,retryRejected:`Nouvelle tentative rejetée`,retryRejectedWithError:`Nouvelle tentative rejetée : {{error}}`,retryFailed:`Échec de la nouvelle tentative : {{message}}`,skipped:`Couche de contrat ignorée — ticket enregistré sans elle`,reason:`Raison : {{reason}}`,added:`Couche de contrat ajoutée · {{title}}`},r={stage:{analyzing:`Analyse de la spec…`,identifying:`Identification des sous-tâches…`,ordering:`Ordonnancement de l'exécution…`},onTitled:`SMASH sur « {{title}} »`,onThisSpec:`SMASH sur cette spec`,split_one:`Spec divisée en {{count}} Sous-Spec`,split_other:`Spec divisée en {{count}} Sous-Specs`,undoAction:`Annuler`,undone:`SMASH annulé`,undoFailed:`Échec de l'annulation`,undoFailedWithReason:`Échec de l'annulation : {{reason}}`,retrying:`Nouvelle tentative de SMASH…`,couldNotRetry:`Impossible de réessayer`,couldNotRetryWithReason:`Impossible de réessayer : {{reason}}`,retryFailed:`Échec de la nouvelle tentative : {{message}}`,couldNotComplete:`SMASH n'a pas pu aboutir`,failReason:{invalidOutput:`L'agent a renvoyé une sortie invalide`,timeout:`L'agent a mis trop de temps`,modelError:`Le modèle a renvoyé une erreur`,crashed:`Le processus de l'agent a planté`,generic:`Raison : {{reason}}`},couldNotStart:`Impossible de démarrer SMASH`,couldNotStartWithReason:`Impossible de démarrer SMASH : {{reason}}`,smashFailed:`Échec de SMASH : {{message}}`,couldNotDeleteChildren:`Impossible de supprimer les Sous-Specs actuelles`,deleteFailed:`Échec de la suppression : {{message}}`,smashButton:`SMASH : diviser la spec en Sous-Specs`,reSmashButton:`Re-SMASH`},i={title:`SMASH : diviser la spec en Sous-Specs`,modePickerLabel:`Mode de décomposition`,reSmashWarning_one:`⚠️ Cela supprimera la <strong>{{count}}</strong> Sous-Spec actuelle et en créera de nouvelles.`,reSmashWarning_other:`⚠️ Cela supprimera les <strong>{{count}}</strong> Sous-Specs actuelles et en créera de nouvelles.`,modes:{simple:{title:`Simple`,eta:`~10-30s`,bullet1:`Décomposition en un seul passage, basée uniquement sur le titre et la description de la spec.`,bullet2:`Aucun accès à la base de code — rapide et déterministe.`,bullet3:`Idéal pour des specs propres avec une couche de contrat solide.`},full:{title:`Complet`,eta:`~3-10 min`,bullet1:`Décomposition approfondie multi-tours avec accès en lecture seule à la base de code — lit de manière intensive.`,bullet2:`Chaque Sous-Spec est une super-spec : contexte, plan, fichiers, cas limites, hors périmètre, tests.`,bullet3:`4 à 10 critères d'acceptation par Sous-Spec, ancrés dans de vrais chemins de fichiers.`,bullet4:`Les tokens sont dépensés sans compter — la qualité avant la vitesse.`}},starting:`Démarrage…`,confirmReSmash:`Confirmer le Re-SMASH`,smash:`SMASH`},a={subSpecsHeader:`Sous-Specs ({{count}})`,emptySubSpecs:`Aucune Sous-Spec. Utilisez Re-SMASH pour régénérer.`,familyHeader_one:`Famille ({{count}} Sous-Spec)`,familyHeader_other:`Famille ({{count}} Sous-Specs)`,noSiblings:`Aucune spec sœur.`,openParentEpic:`Ouvrir l'Epic parent {{title}}`,openSubSpec:`Ouvrir la Sous-Spec {{title}}`},o={header:`Sous-Specs ({{count}})`,empty:`Aucune Sous-Spec. Cet Epic a été vidé — utilisez Re-SMASH pour régénérer.`,step:`· étape {{order}} sur {{total}}`},s={feed:e,specGen:t,contractRefine:n,smash:r,smashModal:i,family:a,epicChildren:o};export{n as contractRefine,s as default,o as epicChildren,a as family,e as feed,r as smash,i as smashModal,t as specGen};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={title:`活动`,emptyTitle:`暂无活动`,emptyHint:`任务运行时,事件会显示在这里`,allLoaded:`已加载全部活动`,typeStarted:`已开始`,phaseCommand:`阶段:{{phase}} → {{state}}`,relativeTime:{seconds:`{{value}} 秒前`,minutes:`{{value}} 分钟前`,hours:`{{value}} 小时前`,days:`{{value}} 天前`}},t={generating:`生成中... {{elapsed}}`,generatedIn:`生成耗时 {{elapsed}}`,specCreated:`Spec 已创建`,view:`查看`,errorGenerating:`生成 Spec 出错`,couldNotFind:`未找到生成的 Spec`,couldNotConfirm:`无法确认 Spec 已创建`},n={refining:`正在完善契约…`,retryRejected:`重试被拒绝`,retryRejectedWithError:`重试被拒绝:{{error}}`,retryFailed:`重试失败:{{message}}`,skipped:`已跳过契约层 — 工单已保存(不含契约层)`,reason:`原因:{{reason}}`,added:`已添加契约层 · {{title}}`},r={stage:{analyzing:`正在分析 Spec…`,identifying:`正在识别子任务…`,ordering:`正在编排执行顺序…`},onTitled:`对“{{title}}”执行 SMASH`,onThisSpec:`对此 Spec 执行 SMASH`,split_one:`Spec 已拆分为 {{count}} 个子 Spec`,split_other:`Spec 已拆分为 {{count}} 个子 Spec`,undoAction:`撤销`,undone:`SMASH 已撤销`,undoFailed:`撤销失败`,undoFailedWithReason:`撤销失败:{{reason}}`,retrying:`正在重试 SMASH…`,couldNotRetry:`无法重试`,couldNotRetryWithReason:`无法重试:{{reason}}`,retryFailed:`重试失败:{{message}}`,couldNotComplete:`SMASH 未能完成`,failReason:{invalidOutput:`Agent 返回了无效输出`,timeout:`Agent 耗时过长`,modelError:`模型返回错误`,crashed:`Agent 进程崩溃`,generic:`原因:{{reason}}`},couldNotStart:`无法启动 SMASH`,couldNotStartWithReason:`无法启动 SMASH:{{reason}}`,smashFailed:`SMASH 失败:{{message}}`,couldNotDeleteChildren:`无法删除当前子 Spec`,deleteFailed:`删除失败:{{message}}`,smashButton:`将 Spec SMASH 为子 Spec`,reSmashButton:`重新 SMASH`},i={title:`将 Spec SMASH 为子 Spec`,modePickerLabel:`拆分模式`,reSmashWarning_one:`⚠️ 这将删除当前的 <strong>{{count}}</strong> 个子 Spec 并创建新的。`,reSmashWarning_other:`⚠️ 这将删除当前的 <strong>{{count}}</strong> 个子 Spec 并创建新的。`,modes:{simple:{title:`简单`,eta:`~10-30s`,bullet1:`仅基于 Spec 的标题和描述进行一次性拆分。`,bullet2:`不访问代码库 — 快速且结果确定。`,bullet3:`最适合带有完善契约层的整洁 Spec。`},full:{title:`完整`,eta:`~3-10 min`,bullet1:`深度多轮拆分,可只读访问代码库 — 会大量阅读代码。`,bullet2:`每个子 Spec 都是超级 Spec:背景、计划、文件、边界情况、范围外、测试。`,bullet3:`每个子 Spec 含 4-10 条验收标准,基于真实文件路径。`,bullet4:`不吝惜 token — 质量优先于速度。`}},starting:`正在启动…`,confirmReSmash:`确认重新 SMASH`,smash:`SMASH`},a={subSpecsHeader:`子 Spec({{count}})`,emptySubSpecs:`没有子 Spec。使用“重新 SMASH”重新生成。`,familyHeader_one:`家族({{count}} 个子 Spec)`,familyHeader_other:`家族({{count}} 个子 Spec)`,noSiblings:`没有同级。`,openParentEpic:`打开父级 Epic {{title}}`,openSubSpec:`打开子 Spec {{title}}`},o={header:`子 Spec({{count}})`,empty:`没有子 Spec。此 Epic 已被清空 — 使用“重新 SMASH”重新生成。`,step:`· 第 {{order}}/{{total}} 步`},s={feed:e,specGen:t,contractRefine:n,smash:r,smashModal:i,family:a,epicChildren:o};export{n as contractRefine,s as default,o as epicChildren,a as family,e as feed,r as smash,i as smashModal,t as specGen};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={title:`Atividade`,emptyTitle:`Ainda não há atividade`,emptyHint:`Os eventos de jobs aparecerão aqui quando houver jobs em execução`,allLoaded:`Toda a atividade carregada`,typeStarted:`Iniciado`,phaseCommand:`Fase: {{phase}} → {{state}}`,relativeTime:{seconds:`há {{value}}s`,minutes:`há {{value}}m`,hours:`há {{value}}h`,days:`há {{value}}d`}},t={generating:`A gerar... {{elapsed}}`,generatedIn:`Gerado em {{elapsed}}`,specCreated:`Spec criada`,view:`Ver`,errorGenerating:`Erro ao gerar a spec`,couldNotFind:`Não foi possível encontrar a spec gerada`,couldNotConfirm:`Não foi possível confirmar a criação da spec`},n={refining:`A refinar contrato…`,retryRejected:`Repetição rejeitada`,retryRejectedWithError:`Repetição rejeitada: {{error}}`,retryFailed:`Falha ao repetir: {{message}}`,skipped:`Contract layer ignorada — ticket guardado sem ela`,reason:`Motivo: {{reason}}`,added:`Contract layer adicionada · {{title}}`},r={stage:{analyzing:`A analisar a spec…`,identifying:`A identificar subtarefas…`,ordering:`A ordenar a execução…`},onTitled:`SMASH em “{{title}}”`,onThisSpec:`SMASH nesta spec`,split_one:`Spec dividida em {{count}} Sub-Spec`,split_other:`Spec dividida em {{count}} Sub-Specs`,undoAction:`Anular`,undone:`SMASH anulado`,undoFailed:`Falha ao anular`,undoFailedWithReason:`Falha ao anular: {{reason}}`,retrying:`A repetir o SMASH…`,couldNotRetry:`Não foi possível repetir`,couldNotRetryWithReason:`Não foi possível repetir: {{reason}}`,retryFailed:`Falha ao repetir: {{message}}`,couldNotComplete:`O SMASH não foi concluído`,failReason:{invalidOutput:`O agente devolveu um resultado inválido`,timeout:`O agente demorou demasiado tempo`,modelError:`O modelo devolveu um erro`,crashed:`O processo do agente falhou`,generic:`Motivo: {{reason}}`},couldNotStart:`Não foi possível iniciar o SMASH`,couldNotStartWithReason:`Não foi possível iniciar o SMASH: {{reason}}`,smashFailed:`O SMASH falhou: {{message}}`,couldNotDeleteChildren:`Não foi possível eliminar as Sub-Specs atuais`,deleteFailed:`Falha ao eliminar: {{message}}`,smashButton:`SMASH: dividir Spec em Sub-Specs`,reSmashButton:`Re-SMASH`},i={title:`SMASH: dividir Spec em Sub-Specs`,modePickerLabel:`Modo de decomposição`,reSmashWarning_one:`⚠️ Isto vai eliminar a <strong>{{count}}</strong> Sub-Spec atual e criar novas.`,reSmashWarning_other:`⚠️ Isto vai eliminar as <strong>{{count}}</strong> Sub-Specs atuais e criar novas.`,modes:{simple:{title:`Simples`,eta:`~10-30s`,bullet1:`Decomposição one-shot baseada apenas no título e na descrição da spec.`,bullet2:`Sem acesso à codebase — rápido e determinista.`,bullet3:`Ideal para specs limpas com uma Contract Layer sólida.`},full:{title:`Completo`,eta:`~3-10 min`,bullet1:`Decomposição profunda multi-turno com acesso de leitura à codebase — lê de forma agressiva.`,bullet2:`Cada Sub-Spec é uma super-spec: Contexto, Plano, Ficheiros, Casos Limite, Fora de Âmbito, Testes.`,bullet3:`4-10 critérios de aceitação por Sub-Spec, baseados em caminhos de ficheiros reais.`,bullet4:`Os tokens são gastos sem restrições — qualidade acima de velocidade.`}},starting:`A iniciar…`,confirmReSmash:`Confirmar Re-SMASH`,smash:`SMASH`},a={subSpecsHeader:`Sub-Specs ({{count}})`,emptySubSpecs:`Sem Sub-Specs. Use o Re-SMASH para regenerar.`,familyHeader_one:`Família ({{count}} Sub-Spec)`,familyHeader_other:`Família ({{count}} Sub-Specs)`,noSiblings:`Sem irmãs.`,openParentEpic:`Abrir Epic pai {{title}}`,openSubSpec:`Abrir Sub-Spec {{title}}`},o={header:`Sub-Specs ({{count}})`,empty:`Sem Sub-Specs. Este Epic ficou vazio — use o Re-SMASH para regenerar.`,step:`· passo {{order}} de {{total}}`},s={feed:e,specGen:t,contractRefine:n,smash:r,smashModal:i,family:a,epicChildren:o};export{n as contractRefine,s as default,o as epicChildren,a as family,e as feed,r as smash,i as smashModal,t as specGen};
|