@weppy/roblox-mcp 2.5.1 → 2.6.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-plugin/marketplace.json +2 -2
- package/.github/workflows/install-test.yml +55 -4
- package/CHANGELOG.md +17 -0
- package/README.md +29 -46
- package/SUPPORT.md +4 -6
- package/install.ps1 +7 -5
- package/install.sh +4 -2
- package/llms-full.txt +8 -688
- package/llms.txt +3 -13
- package/package.json +1 -1
- package/plugins/weppy-roblox-mcp/.claude-plugin/plugin.json +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{ChangelogDetailPage-DRfFUIvC.js → ChangelogDetailPage-C-ROvHGr.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{ChangelogPage-Dgl8dBt6.js → ChangelogPage-CPm4ft8m.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{ConfirmModal-DfdyAPrJ.js → ConfirmModal-BSTYLn14.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{ConnectionPage-LSvSX1_u.js → ConnectionPage-BeJEgfmf.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{InfoLabel-DrK7vhO-.js → InfoLabel-BRbbxjjt.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{OverviewPage-CXsGuoPu.js → OverviewPage-BHd6yL_8.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{PlaytestPage-CgkzRAqQ.js → PlaytestPage-BiNJCh4I.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{PropertyDiff-Dy3MffNh.js → PropertyDiff-BKVe7m6g.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/SettingsPage-Cg33y021.js +1 -0
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{StatusBadge-hJyzgRAl.js → StatusBadge-A72TDL-q.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{SyncPage-eX2Rh-Ct.js → SyncPage-R4Qs9Xt3.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/TierComparison-CQewH4h_.js +1 -0
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{TierPromoProgress-CLAr1gQq.js → TierPromoProgress-DolZjAqX.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{ToolsPage-CqzfCxxH.js → ToolsPage-DRX93nSV.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/WhatsNewPage-uLdiNHd0.js +1 -0
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{index-BfvSPSNj.js → index-oz4Gtzz9.js} +55 -21
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{useLiveUptime-BeRNzFBh.js → useLiveUptime-CRLLCM8t.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/index.html +1 -1
- package/plugins/weppy-roblox-mcp/dist/index.js +76 -76
- package/plugins/weppy-roblox-mcp/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
- package/docs/compatibility.md +0 -44
- package/docs/en/dashboard/changelog.md +0 -114
- package/docs/en/dashboard/connection.md +0 -77
- package/docs/en/dashboard/overview.md +0 -95
- package/docs/en/dashboard/playtest.md +0 -61
- package/docs/en/dashboard/settings.md +0 -60
- package/docs/en/dashboard/sync.md +0 -68
- package/docs/en/dashboard/tools.md +0 -69
- package/docs/en/explorer/overview.md +0 -104
- package/docs/en/installation/README.md +0 -95
- package/docs/en/installation/ai-apps/antigravity.md +0 -89
- package/docs/en/installation/ai-apps/claude-app.md +0 -78
- package/docs/en/installation/ai-apps/claude-code.md +0 -104
- package/docs/en/installation/ai-apps/codex-app.md +0 -56
- package/docs/en/installation/ai-apps/codex-cli.md +0 -67
- package/docs/en/installation/ai-apps/cursor.md +0 -77
- package/docs/en/installation/ai-apps/gemini-cli.md +0 -120
- package/docs/en/installation/roblox-explorer.md +0 -68
- package/docs/en/installation/roblox-plugin.md +0 -96
- package/docs/en/pro-upgrade.md +0 -96
- package/docs/en/sync/luau-lsp.md +0 -41
- package/docs/en/sync/overview.md +0 -153
- package/docs/en/tools/assets-and-effects.md +0 -104
- package/docs/en/tools/instances-and-properties.md +0 -104
- package/docs/en/tools/overview.md +0 -277
- package/docs/en/tools/playtest.md +0 -140
- package/docs/en/tools/scripting.md +0 -66
- package/docs/en/tools/system-and-debugging.md +0 -93
- package/docs/en/tools/world-and-environment.md +0 -102
- package/docs/es/README.md +0 -209
- package/docs/es/dashboard/changelog.md +0 -114
- package/docs/es/dashboard/connection.md +0 -77
- package/docs/es/dashboard/overview.md +0 -95
- package/docs/es/dashboard/playtest.md +0 -61
- package/docs/es/dashboard/settings.md +0 -60
- package/docs/es/dashboard/sync.md +0 -68
- package/docs/es/dashboard/tools.md +0 -69
- package/docs/es/explorer/overview.md +0 -104
- package/docs/es/installation/README.md +0 -87
- package/docs/es/installation/ai-apps/antigravity.md +0 -89
- package/docs/es/installation/ai-apps/claude-app.md +0 -78
- package/docs/es/installation/ai-apps/claude-code.md +0 -104
- package/docs/es/installation/ai-apps/codex-app.md +0 -56
- package/docs/es/installation/ai-apps/codex-cli.md +0 -67
- package/docs/es/installation/ai-apps/cursor.md +0 -77
- package/docs/es/installation/ai-apps/gemini-cli.md +0 -120
- package/docs/es/installation/roblox-explorer.md +0 -58
- package/docs/es/installation/roblox-plugin.md +0 -85
- package/docs/es/pro-upgrade.md +0 -96
- package/docs/es/sync/luau-lsp.md +0 -41
- package/docs/es/sync/overview.md +0 -153
- package/docs/es/tools/assets-and-effects.md +0 -104
- package/docs/es/tools/instances-and-properties.md +0 -104
- package/docs/es/tools/overview.md +0 -277
- package/docs/es/tools/playtest.md +0 -140
- package/docs/es/tools/scripting.md +0 -66
- package/docs/es/tools/system-and-debugging.md +0 -93
- package/docs/es/tools/world-and-environment.md +0 -102
- package/docs/id/README.md +0 -209
- package/docs/id/dashboard/changelog.md +0 -114
- package/docs/id/dashboard/connection.md +0 -77
- package/docs/id/dashboard/overview.md +0 -95
- package/docs/id/dashboard/playtest.md +0 -61
- package/docs/id/dashboard/settings.md +0 -60
- package/docs/id/dashboard/sync.md +0 -68
- package/docs/id/dashboard/tools.md +0 -69
- package/docs/id/explorer/overview.md +0 -104
- package/docs/id/installation/README.md +0 -93
- package/docs/id/installation/ai-apps/antigravity.md +0 -89
- package/docs/id/installation/ai-apps/claude-app.md +0 -78
- package/docs/id/installation/ai-apps/claude-code.md +0 -104
- package/docs/id/installation/ai-apps/codex-app.md +0 -56
- package/docs/id/installation/ai-apps/codex-cli.md +0 -67
- package/docs/id/installation/ai-apps/cursor.md +0 -77
- package/docs/id/installation/ai-apps/gemini-cli.md +0 -120
- package/docs/id/installation/roblox-explorer.md +0 -58
- package/docs/id/installation/roblox-plugin.md +0 -85
- package/docs/id/pro-upgrade.md +0 -96
- package/docs/id/sync/luau-lsp.md +0 -41
- package/docs/id/sync/overview.md +0 -153
- package/docs/id/tools/assets-and-effects.md +0 -104
- package/docs/id/tools/instances-and-properties.md +0 -104
- package/docs/id/tools/overview.md +0 -277
- package/docs/id/tools/playtest.md +0 -140
- package/docs/id/tools/scripting.md +0 -66
- package/docs/id/tools/system-and-debugging.md +0 -93
- package/docs/id/tools/world-and-environment.md +0 -102
- package/docs/installer/assets/index-Bz0amd7x.js +0 -63
- package/docs/installer/assets/index-ei4lRUa6.css +0 -1
- package/docs/installer/index.html +0 -14
- package/docs/installer/manifest.webmanifest +0 -15
- package/docs/installer/sw.js +0 -7
- package/docs/installer/weppy-icon.png +0 -0
- package/docs/ja/README.md +0 -207
- package/docs/ja/dashboard/changelog.md +0 -114
- package/docs/ja/dashboard/connection.md +0 -77
- package/docs/ja/dashboard/overview.md +0 -95
- package/docs/ja/dashboard/playtest.md +0 -61
- package/docs/ja/dashboard/settings.md +0 -60
- package/docs/ja/dashboard/sync.md +0 -68
- package/docs/ja/dashboard/tools.md +0 -69
- package/docs/ja/explorer/overview.md +0 -104
- package/docs/ja/installation/README.md +0 -93
- package/docs/ja/installation/ai-apps/antigravity.md +0 -89
- package/docs/ja/installation/ai-apps/claude-app.md +0 -78
- package/docs/ja/installation/ai-apps/claude-code.md +0 -104
- package/docs/ja/installation/ai-apps/codex-app.md +0 -56
- package/docs/ja/installation/ai-apps/codex-cli.md +0 -67
- package/docs/ja/installation/ai-apps/cursor.md +0 -77
- package/docs/ja/installation/ai-apps/gemini-cli.md +0 -120
- package/docs/ja/installation/roblox-explorer.md +0 -58
- package/docs/ja/installation/roblox-plugin.md +0 -85
- package/docs/ja/pro-upgrade.md +0 -96
- package/docs/ja/sync/luau-lsp.md +0 -41
- package/docs/ja/sync/overview.md +0 -153
- package/docs/ja/tools/assets-and-effects.md +0 -104
- package/docs/ja/tools/instances-and-properties.md +0 -104
- package/docs/ja/tools/overview.md +0 -277
- package/docs/ja/tools/playtest.md +0 -140
- package/docs/ja/tools/scripting.md +0 -66
- package/docs/ja/tools/system-and-debugging.md +0 -93
- package/docs/ja/tools/world-and-environment.md +0 -102
- package/docs/ko/README.md +0 -207
- package/docs/ko/dashboard/changelog.md +0 -114
- package/docs/ko/dashboard/connection.md +0 -77
- package/docs/ko/dashboard/overview.md +0 -95
- package/docs/ko/dashboard/playtest.md +0 -61
- package/docs/ko/dashboard/settings.md +0 -60
- package/docs/ko/dashboard/sync.md +0 -68
- package/docs/ko/dashboard/tools.md +0 -69
- package/docs/ko/explorer/overview.md +0 -104
- package/docs/ko/installation/README.md +0 -95
- package/docs/ko/installation/ai-apps/antigravity.md +0 -88
- package/docs/ko/installation/ai-apps/claude-app.md +0 -78
- package/docs/ko/installation/ai-apps/claude-code.md +0 -104
- package/docs/ko/installation/ai-apps/codex-app.md +0 -56
- package/docs/ko/installation/ai-apps/codex-cli.md +0 -67
- package/docs/ko/installation/ai-apps/cursor.md +0 -77
- package/docs/ko/installation/ai-apps/gemini-cli.md +0 -120
- package/docs/ko/installation/roblox-explorer.md +0 -68
- package/docs/ko/installation/roblox-plugin.md +0 -96
- package/docs/ko/pro-upgrade.md +0 -96
- package/docs/ko/sync/luau-lsp.md +0 -41
- package/docs/ko/sync/overview.md +0 -153
- package/docs/ko/tools/assets-and-effects.md +0 -104
- package/docs/ko/tools/instances-and-properties.md +0 -104
- package/docs/ko/tools/overview.md +0 -277
- package/docs/ko/tools/playtest.md +0 -134
- package/docs/ko/tools/scripting.md +0 -66
- package/docs/ko/tools/system-and-debugging.md +0 -93
- package/docs/ko/tools/world-and-environment.md +0 -102
- package/docs/pt-br/README.md +0 -209
- package/docs/pt-br/dashboard/changelog.md +0 -114
- package/docs/pt-br/dashboard/connection.md +0 -77
- package/docs/pt-br/dashboard/overview.md +0 -95
- package/docs/pt-br/dashboard/playtest.md +0 -61
- package/docs/pt-br/dashboard/settings.md +0 -60
- package/docs/pt-br/dashboard/sync.md +0 -68
- package/docs/pt-br/dashboard/tools.md +0 -69
- package/docs/pt-br/explorer/overview.md +0 -104
- package/docs/pt-br/installation/README.md +0 -93
- package/docs/pt-br/installation/ai-apps/antigravity.md +0 -89
- package/docs/pt-br/installation/ai-apps/claude-app.md +0 -78
- package/docs/pt-br/installation/ai-apps/claude-code.md +0 -104
- package/docs/pt-br/installation/ai-apps/codex-app.md +0 -56
- package/docs/pt-br/installation/ai-apps/codex-cli.md +0 -67
- package/docs/pt-br/installation/ai-apps/cursor.md +0 -77
- package/docs/pt-br/installation/ai-apps/gemini-cli.md +0 -120
- package/docs/pt-br/installation/roblox-explorer.md +0 -58
- package/docs/pt-br/installation/roblox-plugin.md +0 -85
- package/docs/pt-br/pro-upgrade.md +0 -96
- package/docs/pt-br/sync/luau-lsp.md +0 -41
- package/docs/pt-br/sync/overview.md +0 -153
- package/docs/pt-br/tools/assets-and-effects.md +0 -104
- package/docs/pt-br/tools/instances-and-properties.md +0 -104
- package/docs/pt-br/tools/overview.md +0 -277
- package/docs/pt-br/tools/playtest.md +0 -140
- package/docs/pt-br/tools/scripting.md +0 -66
- package/docs/pt-br/tools/system-and-debugging.md +0 -93
- package/docs/pt-br/tools/world-and-environment.md +0 -102
- package/docs/troubleshooting.md +0 -47
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/SettingsPage-D2ZBQ2KF.js +0 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/TierComparison-BwKqP_4s.js +0 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/WhatsNewPage-23o8LmsR.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,r,a as D,D as tt,u as et,i as st,T as M}from"./index-BfvSPSNj.js";import{C as at}from"./ConfirmModal-DfdyAPrJ.js";import{u as ot,T as lt}from"./TierComparison-BwKqP_4s.js";import{T as rt}from"./TierPromoProgress-CLAr1gQq.js";import"./TierPromo.module-CAoUYgIx.js";const it="_wrapper_hzgda_2",nt="_table_hzgda_7",ct="_sortable_hzgda_32",dt="_sortArrow_hzgda_41",ut="_clickable_hzgda_52",pt="_empty_hzgda_57",ht="_expandedRow_hzgda_65",mt="_expandedCell_hzgda_74",S={wrapper:it,table:nt,sortable:ct,sortArrow:dt,clickable:ut,empty:pt,expandedRow:ht,expandedCell:mt};function xt({columns:e,data:a,sortBy:m,sortDir:b="asc",onSort:w,onRowClick:j,rowKey:E,emptyMessage:L,expandedKey:A,renderExpandedRow:v}){return s.jsx("div",{className:S.wrapper,children:s.jsxs("table",{className:S.table,children:[s.jsx("thead",{children:s.jsx("tr",{children:e.map(n=>s.jsxs("th",{style:n.width?{width:n.width}:void 0,className:n.sortable?S.sortable:void 0,onClick:n.sortable&&w?()=>w(n.key):void 0,children:[s.jsx("span",{children:n.label}),n.sortable&&m===n.key&&s.jsx("span",{className:S.sortArrow,children:b==="asc"?"▴":"▾"})]},n.key))})}),s.jsx("tbody",{children:a.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:e.length,className:S.empty,children:L||"No data"})}):a.map((n,C)=>{const h=E?E(n):String(C),d=A!=null&&h===A&&v?v(n):null;return s.jsxs(r.Fragment,{children:[s.jsx("tr",{className:j?S.clickable:void 0,onClick:j?()=>j(n):void 0,children:e.map(T=>s.jsx("td",{children:T.render?T.render(n):String(n[T.key]??"")},T.key))}),d&&s.jsx("tr",{className:S.expandedRow,children:s.jsx("td",{colSpan:e.length,className:S.expandedCell,children:d})})]},h)})})]})})}function bt(e){return{...e,sequenceNumber:typeof e.sequenceNumber=="number"?e.sequenceNumber:void 0,executionTimeMs:typeof e.executionTimeMs=="number"?e.executionTimeMs:void 0}}const _t=50;function ft(){const[e,a]=r.useState(null),[m,b]=r.useState(!0),[w,j]=r.useState([]),[E,L]=r.useState(0),[A,v]=r.useState(!1),[n,C]=r.useState(!0),[h,H]=r.useState(0),[d,T]=r.useState(""),B=r.useRef(null),_=r.useCallback(async()=>{b(!0);try{const f=await D.get("/api/dashboard/tool-stats");a(f)}catch{}finally{b(!1)}},[]),g=r.useCallback(async(f,P)=>{C(!0);try{const F={limit:String(_t),offset:String(f)};P&&(F.tool=P);const y=await D.get("/api/dashboard/history",F);j(y.entries.map(bt)),L(y.total),v(y.hasMore)}catch{j([]),L(0),v(!1)}finally{C(!1)}},[]),U=r.useCallback(()=>{_(),g(h,d)},[g,_,h,d]),O=r.useCallback(async()=>{await D.post("/api/dashboard/tools/history/clear"),g(h,d)},[g,h,d]),u=r.useCallback(async()=>{await D.post("/api/dashboard/tools/statistics/clear"),_()},[_]);return r.useEffect(()=>{_()},[_]),r.useEffect(()=>{g(h,d)},[g,h,d]),r.useEffect(()=>{const f=new tt;B.current=f,f.connect();const P=f.on("command",()=>{_(),g(h,d)});return()=>{P(),f.disconnect(),B.current=null}},[g,_,h,d]),{statistics:e,statsLoading:m,history:w,historyTotal:E,historyHasMore:A,historyLoading:n,historyOffset:h,historyToolFilter:d,setHistoryOffset:H,setHistoryToolFilter:T,refresh:U,clearHistory:O,clearStatistics:u}}const yt="_page_1wyl0_2",gt="_tabs_1wyl0_10",Ct="_tab_1wyl0_10",wt="_tabActive_1wyl0_34",jt="_card_1wyl0_40",Tt="_cardToolbar_1wyl0_47",kt="_sectionTitle_1wyl0_55",St="_dangerButton_1wyl0_61",Nt="_proBadge_1wyl0_71",vt="_statusOk_1wyl0_85",Bt="_statusFallback_1wyl0_94",Mt="_statusUnsupported_1wyl0_103",Et="_statusError_1wyl0_112",Lt="_tierBasic_1wyl0_122",At="_tierPro_1wyl0_126",Pt="_tierMixed_1wyl0_131",Rt="_filterRow_1wyl0_142",Ht="_filterLabel_1wyl0_149",Ft="_filterSelect_1wyl0_158",Ot="_expandedRow_1wyl0_169",$t="_expandedSection_1wyl0_174",It="_detailList_1wyl0_184",Dt="_detailItem_1wyl0_190",qt="_detailLabel_1wyl0_196",Ut="_detailValue_1wyl0_201",zt="_pre_1wyl0_206",Wt="_pagination_1wyl0_223",Kt="_pageInfo_1wyl0_231",Vt="_btn_1wyl0_237",Gt="_tierDistribution_1wyl0_260",Jt="_tierBarWrap_1wyl0_264",Zt="_tierBarBasic_1wyl0_272",Qt="_tierBarPro_1wyl0_277",Xt="_tierLabels_1wyl0_282",Yt="_statsTableWrap_1wyl0_291",te="_statsTable_1wyl0_291",ee="_sortableHeader_1wyl0_322",se="_sortArrow_1wyl0_327",ae="_statsToolRow_1wyl0_331",oe="_statsActionRow_1wyl0_339",le="_expandButton_1wyl0_343",re="_expandIcon_1wyl0_355",ie="_actionLabel_1wyl0_360",ne="_emptyStats_1wyl0_367",ce="_summaryLine_1wyl0_373",o={page:yt,tabs:gt,tab:Ct,tabActive:wt,card:jt,cardToolbar:Tt,sectionTitle:kt,dangerButton:St,proBadge:Nt,statusOk:vt,statusFallback:Bt,statusUnsupported:Mt,statusError:Et,tierBasic:Lt,tierPro:At,tierMixed:Pt,filterRow:Rt,filterLabel:Ht,filterSelect:Ft,expandedRow:Ot,expandedSection:$t,detailList:It,detailItem:Dt,detailLabel:qt,detailValue:Ut,pre:zt,pagination:Wt,pageInfo:Kt,btn:Vt,tierDistribution:Gt,tierBarWrap:Jt,tierBarBasic:Zt,tierBarPro:Qt,tierLabels:Xt,statsTableWrap:Yt,statsTable:te,sortableHeader:ee,sortArrow:se,statsToolRow:ae,statsActionRow:oe,expandButton:le,expandIcon:re,actionLabel:ie,emptyStats:ne,summaryLine:ce},z=50;function de(e){const a=new Date(e);return`${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}:${String(a.getSeconds()).padStart(2,"0")}`}function q(e){return typeof e!="number"||!Number.isFinite(e)?"-":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function R(e,a){return a==="pro"?e("tier.pro","Pro"):a==="mixed"?e("tier.mixed","Mixed"):e("tier.basic","Basic")}function J(e,a){return a!==e&&a.startsWith(`${e}_`)?a.slice(e.length+1):""}function ue(e,a){const m=J(e,a);return m?`${e}.${m}`:e}function G(e){return typeof e=="string"&&e.length>0?e:void 0}function pe(e){if(!Array.isArray(e))return;const a=e.filter(m=>typeof m=="string"&&m.length>0);return a.length>0?a:void 0}function he(e){const a=e.result??{};return{requestedCommand:e.requestedCommand??G(a.requestedCommand),executedCommand:e.executedCommand??G(a.executedCommand),alternatives:e.alternatives??pe(a.alternatives)}}function me(e,a){switch(e.status){case"fallback":return{label:a("tools.badge.fallback","FALLBACK"),tooltip:a("tools.badge.fallback.tooltip","The requested Pro action succeeded via a Basic fallback."),className:o.statusFallback};case"unsupported":return{label:a("tools.badge.unsupported","UNSUPPORTED"),tooltip:a("tools.badge.unsupported.tooltip","The requested Pro action was blocked and no fallback ran."),className:o.statusUnsupported};case"error":return{label:a("tools.badge.err","FAILED"),tooltip:a("tools.badge.err.tooltip","The tool run failed."),className:o.statusError};default:return{label:a("tools.status.ok","OK"),tooltip:a("tools.status.ok.tooltip","The tool run completed successfully."),className:o.statusOk}}}function N(e,a){return s.jsxs("div",{className:o.detailItem,children:[s.jsx("span",{className:o.detailLabel,children:e}),s.jsx("span",{className:o.detailValue,children:a})]})}function Ce(){const{t:e}=et(),a=ft(),{show:m}=st(),b=ot(),[w,j]=r.useState("history"),[E,L]=r.useState(null),[A,v]=r.useState(null),[n,C]=r.useState(null),[h,H]=r.useState(!1),[d,T]=r.useState("totalCalls"),[B,_]=r.useState("desc"),g=r.useCallback(t=>{T(l=>l===t?(_(i=>i==="asc"?"desc":"asc"),t):(_("desc"),t))},[]),U=r.useMemo(()=>{var l;const t=new Set;return Object.keys(((l=a.statistics)==null?void 0:l.tools)??{}).forEach(i=>t.add(i)),a.history.forEach(i=>{i.tool&&t.add(i.tool)}),a.historyToolFilter&&t.add(a.historyToolFilter),Array.from(t).sort()},[a.history,a.historyToolFilter,a.statistics]),O=r.useMemo(()=>{var t;return(t=a.statistics)!=null&&t.tools?Object.values(a.statistics.tools).map(l=>{var V;const i=Object.entries(l.commands??{}).map(([p,c])=>({toolName:l.tool,commandName:c.command??p,label:J(l.tool,c.command??p)||(c.command??p),tier:c.tier,totalCalls:c.totalCalls,successCount:c.successCount,fallbackCount:c.fallbackCount,unsupportedCount:c.unsupportedCount,failureCount:c.failureCount,totalExecutionTimeMs:c.totalExecutionTimeMs,avgExecutionTimeMs:c.avgExecutionTimeMs})),x=i.reduce((p,c)=>p+c.totalCalls,0),k=i.reduce((p,c)=>p+c.successCount,0),$=i.reduce((p,c)=>p+c.fallbackCount,0),I=i.reduce((p,c)=>p+c.unsupportedCount,0),X=i.reduce((p,c)=>p+c.failureCount,0),K=i.reduce((p,c)=>p+c.totalExecutionTimeMs,0),Y=new Set(i.map(p=>p.tier)).size>1?"mixed":((V=i[0])==null?void 0:V.tier)??l.tier;return{toolName:l.tool,tier:Y,commands:i,totalCalls:x,successCount:k,fallbackCount:$,unsupportedCount:I,failureCount:X,totalExecutionTimeMs:K,avgExecutionTimeMs:x>0?Math.round(K/x):0}}):[]},[a.statistics]),u=r.useCallback((t,l,i,x)=>s.jsx(M,{text:e(i,x),children:e(t,l)}),[e]),f=r.useMemo(()=>[...O].sort((l,i)=>{const x=l[d],k=i[d];if(typeof x=="number"&&typeof k=="number")return B==="asc"?x-k:k-x;const $=String(x??""),I=String(k??"");return B==="asc"?$.localeCompare(I):I.localeCompare($)}),[O,d,B]),P=r.useMemo(()=>[{key:"timestamp",label:u("tools.col.time","Time","tools.col.time.tooltip","When the tool run was recorded."),width:"80px",render:t=>de(t.timestamp)},{key:"toolName",label:u("tools.col.toolAction","Tool.Action","tools.col.toolAction.tooltip","Tool name and action that were executed."),render:t=>s.jsxs("span",{children:[ue(t.tool,t.command),t.tier==="pro"&&s.jsx(M,{text:e("tools.badge.pro.tooltip","This entry used a Pro-only tool or action."),children:s.jsx("span",{className:o.proBadge,children:e("tools.badge.pro","PRO")})})]})},{key:"executionTimeMs",label:u("tools.col.duration","Duration","tools.col.duration.tooltip","How long the tool took to finish."),width:"80px",render:t=>q(t.executionTimeMs)},{key:"status",label:u("tools.col.status","Status","tools.col.status.tooltip","Outcome of the recorded tool run."),width:"120px",render:t=>{const l=me(t,e);return s.jsx(M,{text:l.tooltip,children:s.jsx("span",{className:l.className,children:l.label})})}},{key:"tier",label:u("tools.col.tier","Tier","tools.col.tier.tooltip","License tier required for the tool or action."),width:"60px",render:t=>s.jsx("span",{className:t.tier==="pro"?o.tierPro:o.tierBasic,children:R(e,t.tier)})}],[e,u]),F=r.useMemo(()=>[{key:"toolName",label:u("tools.col.tool","Tool","tools.col.tool.tooltip","Consolidated tool name in the statistics table."),sortable:!0},{key:"totalCalls",label:u("tools.col.calls","Calls","tools.col.calls.tooltip","Total number of recorded calls for this tool."),sortable:!0,width:"70px"},{key:"successCount",label:u("tools.col.ok","OK","tools.col.ok.tooltip","Number of direct successful runs."),sortable:!0,width:"70px"},{key:"fallbackCount",label:u("tools.col.fallback","FALLBACK","tools.col.fallback.tooltip","Number of runs that succeeded through fallback execution."),sortable:!0,width:"110px"},{key:"unsupportedCount",label:u("tools.col.unsupported","UNSUPPORTED","tools.col.unsupported.tooltip","Number of blocked runs without fallback execution."),sortable:!0,width:"130px"},{key:"failureCount",label:u("tools.col.err","FAILED","tools.col.err.tooltip","Number of runs that failed."),sortable:!0,width:"70px"},{key:"avgExecutionTimeMs",label:u("tools.col.avgTime","Avg Time","tools.col.avgTime.tooltip","Average execution time across recorded calls."),sortable:!0,width:"90px",render:t=>q(t.avgExecutionTimeMs)},{key:"tier",label:u("tools.col.tier","Tier","tools.col.tierStats.tooltip","Basic, Pro, or Mixed summary for the tool statistics row."),sortable:!0,width:"70px",render:t=>s.jsx(M,{text:t.tier==="mixed"?e("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:s.jsx("span",{className:t.tier==="pro"?o.tierPro:t.tier==="mixed"?o.tierMixed:o.tierBasic,children:R(e,t.tier)})})}],[e,u]),y=r.useMemo(()=>{if(!a.statistics)return null;const t=a.statistics.tierSummary.basic.totalCalls,l=a.statistics.tierSummary.pro.totalCalls,i=t+l;if(i===0)return null;const x=Math.round(t/i*100),k=100-x;return{basic:t,pro:l,basicPct:x,proPct:k}},[a.statistics]),W=r.useCallback(t=>{v(l=>l===t?null:t)},[]),Z=r.useCallback(async()=>{if(n){H(!0);try{n==="history"?await a.clearHistory():await a.clearStatistics(),m(e("toast.clearSuccess","Cleared successfully"),"success"),C(null)}catch{m(e("toast.clearFailed","Failed to clear data"),"error")}finally{H(!1)}}},[n,m,e,a]),Q=r.useCallback(t=>{const l=he(t);return s.jsxs("div",{className:o.expandedRow,children:[s.jsxs("div",{className:o.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(M,{text:e("tools.detail.params.tooltip","Input parameters passed to this tool run."),children:e("tools.detail.params","Parameters")}),":"]}),s.jsx("pre",{className:o.pre,children:JSON.stringify(t.parameters,null,2)})]}),t.result&&s.jsxs("div",{className:o.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(M,{text:e("tools.detail.result.tooltip","Returned result payload for this tool run."),children:e("tools.detail.result","Result")}),":"]}),s.jsx("pre",{className:o.pre,children:JSON.stringify(t.result,null,2)})]}),(t.status==="fallback"||t.status==="unsupported"||t.status==="error")&&s.jsx("div",{className:o.expandedSection,children:s.jsxs("div",{className:o.detailList,children:[t.status==="fallback"&&(l==null?void 0:l.requestedCommand)&&N(e("tools.detail.requestedCommand","Requested Command"),l.requestedCommand),t.status==="fallback"&&(l==null?void 0:l.executedCommand)&&N(e("tools.detail.executedCommand","Executed Command"),l.executedCommand),t.status==="fallback"&&(l==null?void 0:l.alternatives)&&N(e("tools.detail.alternatives","Alternatives"),l.alternatives.join(", ")),t.status==="unsupported"&&t.blockedMessage&&N(e("tools.detail.blockedMessage","Blocked Reason"),t.blockedMessage),t.status==="unsupported"&&N(e("tools.detail.noFallback","No Fallback"),e("tools.detail.noFallback.value","No fallback ran.")),t.status==="error"&&t.errorMessage&&N(e("tools.detail.errorMessage","Error Message"),t.errorMessage),t.status==="error"&&t.blockedMessage&&N(e("tools.detail.blockedMessage","Blocked Reason"),t.blockedMessage),t.status==="error"&&t.fallbackCommand&&N(e("tools.detail.executedCommand","Executed Command"),t.fallbackCommand)]})})]})},[e]);return s.jsxs("div",{className:o.page,children:[s.jsx("div",{className:o.tabs,children:["history","statistics"].map(t=>s.jsx("button",{className:`${o.tab} ${w===t?o.tabActive:""}`,onClick:()=>j(t),children:e(`tools.tab.${t}`,t.charAt(0).toUpperCase()+t.slice(1))},t))}),w==="history"&&s.jsxs("div",{className:o.card,children:[s.jsxs("div",{className:o.cardToolbar,children:[s.jsx("div",{className:o.sectionTitle,children:e("tools.tab.history","History")}),s.jsx("button",{className:o.dangerButton,onClick:()=>C("history"),children:e("common.clear","Clear")})]}),s.jsx("div",{className:o.filterRow,children:s.jsxs("label",{className:o.filterLabel,children:[e("tools.filter.tool","Tool"),":",s.jsxs("select",{className:o.filterSelect,value:a.historyToolFilter,onChange:t=>{a.setHistoryToolFilter(t.target.value),a.setHistoryOffset(0)},children:[s.jsx("option",{value:"",children:e("tools.filter.all","All")}),U.map(t=>s.jsx("option",{value:t,children:t},t))]})]})}),s.jsx(xt,{columns:P,data:a.history,rowKey:t=>t.id,onRowClick:t=>L(l=>l===t.id?null:t.id),emptyMessage:e("tools.empty.history","No history entries"),expandedKey:E,renderExpandedRow:Q}),s.jsxs("div",{className:o.pagination,children:[s.jsx("button",{className:o.btn,disabled:a.historyOffset===0,title:e("tools.page.prev.tooltip","Go to the previous page of tool history results."),onClick:()=>a.setHistoryOffset(Math.max(0,a.historyOffset-z)),children:e("tools.page.prev","Prev")}),s.jsxs("span",{className:o.pageInfo,children:[a.historyOffset+1,"–",Math.min(a.historyOffset+z,a.historyTotal)," / ",a.historyTotal]}),s.jsx("button",{className:o.btn,disabled:!a.historyHasMore,title:e("tools.page.next.tooltip","Go to the next page of tool history results."),onClick:()=>a.setHistoryOffset(a.historyOffset+z),children:e("tools.page.next","Next")})]})]}),w==="statistics"&&s.jsxs("div",{className:o.card,children:[s.jsxs("div",{className:o.cardToolbar,children:[s.jsx("div",{className:o.sectionTitle,children:e("tools.tab.statistics","Statistics")}),s.jsx("button",{className:o.dangerButton,onClick:()=>C("statistics"),children:e("common.clear","Clear")})]}),y&&s.jsxs("div",{className:o.tierDistribution,children:[s.jsxs("div",{className:o.tierBarWrap,children:[s.jsx("div",{className:o.tierBarBasic,style:{width:`${y.basicPct}%`}}),s.jsx("div",{className:o.tierBarPro,style:{width:`${y.proPct}%`}})]}),s.jsxs("div",{className:o.tierLabels,children:[s.jsxs("span",{children:[R(e,"basic")," ",y.basicPct,"% (",y.basic,")"]}),s.jsxs("span",{children:[R(e,"pro")," ",y.proPct,"% (",y.pro,")"]})]})]}),s.jsx("div",{className:o.statsTableWrap,children:s.jsxs("table",{className:o.statsTable,children:[s.jsx("thead",{children:s.jsx("tr",{children:F.map(t=>s.jsxs("th",{style:t.width?{width:t.width}:void 0,className:t.sortable?o.sortableHeader:void 0,onClick:t.sortable?()=>g(t.key):void 0,children:[s.jsx("span",{children:t.label}),t.sortable&&d===t.key&&s.jsx("span",{className:o.sortArrow,children:B==="asc"?"▴":"▾"})]},t.key))})}),s.jsx("tbody",{children:f.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:F.length,className:o.emptyStats,children:e("tools.empty.stats","No tool statistics")})}):f.map(t=>{const l=A===t.toolName;return s.jsxs(r.Fragment,{children:[s.jsxs("tr",{className:o.statsToolRow,onClick:()=>W(t.toolName),children:[s.jsx("td",{children:s.jsxs("button",{type:"button",className:o.expandButton,"aria-expanded":l,"aria-label":`${t.toolName} ${l?e("common.collapse","Collapse"):e("common.expand","Expand")}`,onClick:i=>{i.stopPropagation(),W(t.toolName)},children:[s.jsx("span",{className:o.expandIcon,"aria-hidden":"true",children:l?"▾":"▸"}),s.jsx("span",{children:t.toolName})]})}),s.jsx("td",{children:t.totalCalls}),s.jsx("td",{children:t.successCount}),s.jsx("td",{children:t.fallbackCount}),s.jsx("td",{children:t.unsupportedCount}),s.jsx("td",{children:t.failureCount}),s.jsx("td",{children:q(t.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx(M,{text:t.tier==="mixed"?e("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:s.jsx("span",{className:t.tier==="pro"?o.tierPro:t.tier==="mixed"?o.tierMixed:o.tierBasic,children:R(e,t.tier)})})})]}),l&&t.commands.map(i=>s.jsxs("tr",{className:o.statsActionRow,children:[s.jsx("td",{children:s.jsx("span",{className:o.actionLabel,children:i.label})}),s.jsx("td",{children:i.totalCalls}),s.jsx("td",{children:i.successCount}),s.jsx("td",{children:i.fallbackCount}),s.jsx("td",{children:i.unsupportedCount}),s.jsx("td",{children:i.failureCount}),s.jsx("td",{children:q(i.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx("span",{className:i.tier==="pro"?o.tierPro:o.tierBasic,children:R(e,i.tier)})})]},`${t.toolName}:${i.commandName}`))]},t.toolName)})})]})}),a.statistics&&s.jsxs("div",{className:o.summaryLine,children:[e("tools.summary.total","Total"),": ",a.statistics.totalCalls," ",e("tools.summary.calls","calls")," | ",e("tools.summary.sessions","Sessions"),": ",a.statistics.totalSessions]})]}),!b.loading&&b.tier==="basic"&&s.jsx(rt,{basicCalls:b.basicCalls,proCalls:b.proCalls,totalCalls:b.totalCalls,proUsagePercent:b.proUsagePercent,upgradeHref:lt.tools}),s.jsx(at,{open:n!==null,title:n==="history"?e("tools.clear.history.title","Clear history?"):e("tools.clear.statistics.title","Clear statistics?"),message:n==="history"?e("tools.clear.history.message","This permanently removes the current place tools history."):e("tools.clear.statistics.message","This permanently resets the current place tool statistics."),cancelLabel:e("common.cancel","Cancel"),confirmLabel:e("common.clear","Clear"),loading:h,onCancel:()=>!h&&C(null),onConfirm:Z})]})}export{Ce as Component};
|
|
1
|
+
import{j as s,r,a as D,D as tt,u as et,i as st,T as M}from"./index-oz4Gtzz9.js";import{C as at}from"./ConfirmModal-BSTYLn14.js";import{u as ot,T as lt}from"./TierComparison-CQewH4h_.js";import{T as rt}from"./TierPromoProgress-DolZjAqX.js";import"./TierPromo.module-CAoUYgIx.js";const it="_wrapper_hzgda_2",nt="_table_hzgda_7",ct="_sortable_hzgda_32",dt="_sortArrow_hzgda_41",ut="_clickable_hzgda_52",pt="_empty_hzgda_57",ht="_expandedRow_hzgda_65",mt="_expandedCell_hzgda_74",S={wrapper:it,table:nt,sortable:ct,sortArrow:dt,clickable:ut,empty:pt,expandedRow:ht,expandedCell:mt};function xt({columns:e,data:a,sortBy:m,sortDir:b="asc",onSort:w,onRowClick:j,rowKey:E,emptyMessage:L,expandedKey:A,renderExpandedRow:v}){return s.jsx("div",{className:S.wrapper,children:s.jsxs("table",{className:S.table,children:[s.jsx("thead",{children:s.jsx("tr",{children:e.map(n=>s.jsxs("th",{style:n.width?{width:n.width}:void 0,className:n.sortable?S.sortable:void 0,onClick:n.sortable&&w?()=>w(n.key):void 0,children:[s.jsx("span",{children:n.label}),n.sortable&&m===n.key&&s.jsx("span",{className:S.sortArrow,children:b==="asc"?"▴":"▾"})]},n.key))})}),s.jsx("tbody",{children:a.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:e.length,className:S.empty,children:L||"No data"})}):a.map((n,C)=>{const h=E?E(n):String(C),d=A!=null&&h===A&&v?v(n):null;return s.jsxs(r.Fragment,{children:[s.jsx("tr",{className:j?S.clickable:void 0,onClick:j?()=>j(n):void 0,children:e.map(T=>s.jsx("td",{children:T.render?T.render(n):String(n[T.key]??"")},T.key))}),d&&s.jsx("tr",{className:S.expandedRow,children:s.jsx("td",{colSpan:e.length,className:S.expandedCell,children:d})})]},h)})})]})})}function bt(e){return{...e,sequenceNumber:typeof e.sequenceNumber=="number"?e.sequenceNumber:void 0,executionTimeMs:typeof e.executionTimeMs=="number"?e.executionTimeMs:void 0}}const _t=50;function ft(){const[e,a]=r.useState(null),[m,b]=r.useState(!0),[w,j]=r.useState([]),[E,L]=r.useState(0),[A,v]=r.useState(!1),[n,C]=r.useState(!0),[h,H]=r.useState(0),[d,T]=r.useState(""),B=r.useRef(null),_=r.useCallback(async()=>{b(!0);try{const f=await D.get("/api/dashboard/tool-stats");a(f)}catch{}finally{b(!1)}},[]),g=r.useCallback(async(f,P)=>{C(!0);try{const F={limit:String(_t),offset:String(f)};P&&(F.tool=P);const y=await D.get("/api/dashboard/history",F);j(y.entries.map(bt)),L(y.total),v(y.hasMore)}catch{j([]),L(0),v(!1)}finally{C(!1)}},[]),U=r.useCallback(()=>{_(),g(h,d)},[g,_,h,d]),O=r.useCallback(async()=>{await D.post("/api/dashboard/tools/history/clear"),g(h,d)},[g,h,d]),u=r.useCallback(async()=>{await D.post("/api/dashboard/tools/statistics/clear"),_()},[_]);return r.useEffect(()=>{_()},[_]),r.useEffect(()=>{g(h,d)},[g,h,d]),r.useEffect(()=>{const f=new tt;B.current=f,f.connect();const P=f.on("command",()=>{_(),g(h,d)});return()=>{P(),f.disconnect(),B.current=null}},[g,_,h,d]),{statistics:e,statsLoading:m,history:w,historyTotal:E,historyHasMore:A,historyLoading:n,historyOffset:h,historyToolFilter:d,setHistoryOffset:H,setHistoryToolFilter:T,refresh:U,clearHistory:O,clearStatistics:u}}const yt="_page_1wyl0_2",gt="_tabs_1wyl0_10",Ct="_tab_1wyl0_10",wt="_tabActive_1wyl0_34",jt="_card_1wyl0_40",Tt="_cardToolbar_1wyl0_47",kt="_sectionTitle_1wyl0_55",St="_dangerButton_1wyl0_61",Nt="_proBadge_1wyl0_71",vt="_statusOk_1wyl0_85",Bt="_statusFallback_1wyl0_94",Mt="_statusUnsupported_1wyl0_103",Et="_statusError_1wyl0_112",Lt="_tierBasic_1wyl0_122",At="_tierPro_1wyl0_126",Pt="_tierMixed_1wyl0_131",Rt="_filterRow_1wyl0_142",Ht="_filterLabel_1wyl0_149",Ft="_filterSelect_1wyl0_158",Ot="_expandedRow_1wyl0_169",$t="_expandedSection_1wyl0_174",It="_detailList_1wyl0_184",Dt="_detailItem_1wyl0_190",qt="_detailLabel_1wyl0_196",Ut="_detailValue_1wyl0_201",zt="_pre_1wyl0_206",Wt="_pagination_1wyl0_223",Kt="_pageInfo_1wyl0_231",Vt="_btn_1wyl0_237",Gt="_tierDistribution_1wyl0_260",Jt="_tierBarWrap_1wyl0_264",Zt="_tierBarBasic_1wyl0_272",Qt="_tierBarPro_1wyl0_277",Xt="_tierLabels_1wyl0_282",Yt="_statsTableWrap_1wyl0_291",te="_statsTable_1wyl0_291",ee="_sortableHeader_1wyl0_322",se="_sortArrow_1wyl0_327",ae="_statsToolRow_1wyl0_331",oe="_statsActionRow_1wyl0_339",le="_expandButton_1wyl0_343",re="_expandIcon_1wyl0_355",ie="_actionLabel_1wyl0_360",ne="_emptyStats_1wyl0_367",ce="_summaryLine_1wyl0_373",o={page:yt,tabs:gt,tab:Ct,tabActive:wt,card:jt,cardToolbar:Tt,sectionTitle:kt,dangerButton:St,proBadge:Nt,statusOk:vt,statusFallback:Bt,statusUnsupported:Mt,statusError:Et,tierBasic:Lt,tierPro:At,tierMixed:Pt,filterRow:Rt,filterLabel:Ht,filterSelect:Ft,expandedRow:Ot,expandedSection:$t,detailList:It,detailItem:Dt,detailLabel:qt,detailValue:Ut,pre:zt,pagination:Wt,pageInfo:Kt,btn:Vt,tierDistribution:Gt,tierBarWrap:Jt,tierBarBasic:Zt,tierBarPro:Qt,tierLabels:Xt,statsTableWrap:Yt,statsTable:te,sortableHeader:ee,sortArrow:se,statsToolRow:ae,statsActionRow:oe,expandButton:le,expandIcon:re,actionLabel:ie,emptyStats:ne,summaryLine:ce},z=50;function de(e){const a=new Date(e);return`${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}:${String(a.getSeconds()).padStart(2,"0")}`}function q(e){return typeof e!="number"||!Number.isFinite(e)?"-":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function R(e,a){return a==="pro"?e("tier.pro","Pro"):a==="mixed"?e("tier.mixed","Mixed"):e("tier.basic","Basic")}function J(e,a){return a!==e&&a.startsWith(`${e}_`)?a.slice(e.length+1):""}function ue(e,a){const m=J(e,a);return m?`${e}.${m}`:e}function G(e){return typeof e=="string"&&e.length>0?e:void 0}function pe(e){if(!Array.isArray(e))return;const a=e.filter(m=>typeof m=="string"&&m.length>0);return a.length>0?a:void 0}function he(e){const a=e.result??{};return{requestedCommand:e.requestedCommand??G(a.requestedCommand),executedCommand:e.executedCommand??G(a.executedCommand),alternatives:e.alternatives??pe(a.alternatives)}}function me(e,a){switch(e.status){case"fallback":return{label:a("tools.badge.fallback","FALLBACK"),tooltip:a("tools.badge.fallback.tooltip","The requested Pro action succeeded via a Basic fallback."),className:o.statusFallback};case"unsupported":return{label:a("tools.badge.unsupported","UNSUPPORTED"),tooltip:a("tools.badge.unsupported.tooltip","The requested Pro action was blocked and no fallback ran."),className:o.statusUnsupported};case"error":return{label:a("tools.badge.err","FAILED"),tooltip:a("tools.badge.err.tooltip","The tool run failed."),className:o.statusError};default:return{label:a("tools.status.ok","OK"),tooltip:a("tools.status.ok.tooltip","The tool run completed successfully."),className:o.statusOk}}}function N(e,a){return s.jsxs("div",{className:o.detailItem,children:[s.jsx("span",{className:o.detailLabel,children:e}),s.jsx("span",{className:o.detailValue,children:a})]})}function Ce(){const{t:e}=et(),a=ft(),{show:m}=st(),b=ot(),[w,j]=r.useState("history"),[E,L]=r.useState(null),[A,v]=r.useState(null),[n,C]=r.useState(null),[h,H]=r.useState(!1),[d,T]=r.useState("totalCalls"),[B,_]=r.useState("desc"),g=r.useCallback(t=>{T(l=>l===t?(_(i=>i==="asc"?"desc":"asc"),t):(_("desc"),t))},[]),U=r.useMemo(()=>{var l;const t=new Set;return Object.keys(((l=a.statistics)==null?void 0:l.tools)??{}).forEach(i=>t.add(i)),a.history.forEach(i=>{i.tool&&t.add(i.tool)}),a.historyToolFilter&&t.add(a.historyToolFilter),Array.from(t).sort()},[a.history,a.historyToolFilter,a.statistics]),O=r.useMemo(()=>{var t;return(t=a.statistics)!=null&&t.tools?Object.values(a.statistics.tools).map(l=>{var V;const i=Object.entries(l.commands??{}).map(([p,c])=>({toolName:l.tool,commandName:c.command??p,label:J(l.tool,c.command??p)||(c.command??p),tier:c.tier,totalCalls:c.totalCalls,successCount:c.successCount,fallbackCount:c.fallbackCount,unsupportedCount:c.unsupportedCount,failureCount:c.failureCount,totalExecutionTimeMs:c.totalExecutionTimeMs,avgExecutionTimeMs:c.avgExecutionTimeMs})),x=i.reduce((p,c)=>p+c.totalCalls,0),k=i.reduce((p,c)=>p+c.successCount,0),$=i.reduce((p,c)=>p+c.fallbackCount,0),I=i.reduce((p,c)=>p+c.unsupportedCount,0),X=i.reduce((p,c)=>p+c.failureCount,0),K=i.reduce((p,c)=>p+c.totalExecutionTimeMs,0),Y=new Set(i.map(p=>p.tier)).size>1?"mixed":((V=i[0])==null?void 0:V.tier)??l.tier;return{toolName:l.tool,tier:Y,commands:i,totalCalls:x,successCount:k,fallbackCount:$,unsupportedCount:I,failureCount:X,totalExecutionTimeMs:K,avgExecutionTimeMs:x>0?Math.round(K/x):0}}):[]},[a.statistics]),u=r.useCallback((t,l,i,x)=>s.jsx(M,{text:e(i,x),children:e(t,l)}),[e]),f=r.useMemo(()=>[...O].sort((l,i)=>{const x=l[d],k=i[d];if(typeof x=="number"&&typeof k=="number")return B==="asc"?x-k:k-x;const $=String(x??""),I=String(k??"");return B==="asc"?$.localeCompare(I):I.localeCompare($)}),[O,d,B]),P=r.useMemo(()=>[{key:"timestamp",label:u("tools.col.time","Time","tools.col.time.tooltip","When the tool run was recorded."),width:"80px",render:t=>de(t.timestamp)},{key:"toolName",label:u("tools.col.toolAction","Tool.Action","tools.col.toolAction.tooltip","Tool name and action that were executed."),render:t=>s.jsxs("span",{children:[ue(t.tool,t.command),t.tier==="pro"&&s.jsx(M,{text:e("tools.badge.pro.tooltip","This entry used a Pro-only tool or action."),children:s.jsx("span",{className:o.proBadge,children:e("tools.badge.pro","PRO")})})]})},{key:"executionTimeMs",label:u("tools.col.duration","Duration","tools.col.duration.tooltip","How long the tool took to finish."),width:"80px",render:t=>q(t.executionTimeMs)},{key:"status",label:u("tools.col.status","Status","tools.col.status.tooltip","Outcome of the recorded tool run."),width:"120px",render:t=>{const l=me(t,e);return s.jsx(M,{text:l.tooltip,children:s.jsx("span",{className:l.className,children:l.label})})}},{key:"tier",label:u("tools.col.tier","Tier","tools.col.tier.tooltip","License tier required for the tool or action."),width:"60px",render:t=>s.jsx("span",{className:t.tier==="pro"?o.tierPro:o.tierBasic,children:R(e,t.tier)})}],[e,u]),F=r.useMemo(()=>[{key:"toolName",label:u("tools.col.tool","Tool","tools.col.tool.tooltip","Consolidated tool name in the statistics table."),sortable:!0},{key:"totalCalls",label:u("tools.col.calls","Calls","tools.col.calls.tooltip","Total number of recorded calls for this tool."),sortable:!0,width:"70px"},{key:"successCount",label:u("tools.col.ok","OK","tools.col.ok.tooltip","Number of direct successful runs."),sortable:!0,width:"70px"},{key:"fallbackCount",label:u("tools.col.fallback","FALLBACK","tools.col.fallback.tooltip","Number of runs that succeeded through fallback execution."),sortable:!0,width:"110px"},{key:"unsupportedCount",label:u("tools.col.unsupported","UNSUPPORTED","tools.col.unsupported.tooltip","Number of blocked runs without fallback execution."),sortable:!0,width:"130px"},{key:"failureCount",label:u("tools.col.err","FAILED","tools.col.err.tooltip","Number of runs that failed."),sortable:!0,width:"70px"},{key:"avgExecutionTimeMs",label:u("tools.col.avgTime","Avg Time","tools.col.avgTime.tooltip","Average execution time across recorded calls."),sortable:!0,width:"90px",render:t=>q(t.avgExecutionTimeMs)},{key:"tier",label:u("tools.col.tier","Tier","tools.col.tierStats.tooltip","Basic, Pro, or Mixed summary for the tool statistics row."),sortable:!0,width:"70px",render:t=>s.jsx(M,{text:t.tier==="mixed"?e("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:s.jsx("span",{className:t.tier==="pro"?o.tierPro:t.tier==="mixed"?o.tierMixed:o.tierBasic,children:R(e,t.tier)})})}],[e,u]),y=r.useMemo(()=>{if(!a.statistics)return null;const t=a.statistics.tierSummary.basic.totalCalls,l=a.statistics.tierSummary.pro.totalCalls,i=t+l;if(i===0)return null;const x=Math.round(t/i*100),k=100-x;return{basic:t,pro:l,basicPct:x,proPct:k}},[a.statistics]),W=r.useCallback(t=>{v(l=>l===t?null:t)},[]),Z=r.useCallback(async()=>{if(n){H(!0);try{n==="history"?await a.clearHistory():await a.clearStatistics(),m(e("toast.clearSuccess","Cleared successfully"),"success"),C(null)}catch{m(e("toast.clearFailed","Failed to clear data"),"error")}finally{H(!1)}}},[n,m,e,a]),Q=r.useCallback(t=>{const l=he(t);return s.jsxs("div",{className:o.expandedRow,children:[s.jsxs("div",{className:o.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(M,{text:e("tools.detail.params.tooltip","Input parameters passed to this tool run."),children:e("tools.detail.params","Parameters")}),":"]}),s.jsx("pre",{className:o.pre,children:JSON.stringify(t.parameters,null,2)})]}),t.result&&s.jsxs("div",{className:o.expandedSection,children:[s.jsxs("strong",{children:[s.jsx(M,{text:e("tools.detail.result.tooltip","Returned result payload for this tool run."),children:e("tools.detail.result","Result")}),":"]}),s.jsx("pre",{className:o.pre,children:JSON.stringify(t.result,null,2)})]}),(t.status==="fallback"||t.status==="unsupported"||t.status==="error")&&s.jsx("div",{className:o.expandedSection,children:s.jsxs("div",{className:o.detailList,children:[t.status==="fallback"&&(l==null?void 0:l.requestedCommand)&&N(e("tools.detail.requestedCommand","Requested Command"),l.requestedCommand),t.status==="fallback"&&(l==null?void 0:l.executedCommand)&&N(e("tools.detail.executedCommand","Executed Command"),l.executedCommand),t.status==="fallback"&&(l==null?void 0:l.alternatives)&&N(e("tools.detail.alternatives","Alternatives"),l.alternatives.join(", ")),t.status==="unsupported"&&t.blockedMessage&&N(e("tools.detail.blockedMessage","Blocked Reason"),t.blockedMessage),t.status==="unsupported"&&N(e("tools.detail.noFallback","No Fallback"),e("tools.detail.noFallback.value","No fallback ran.")),t.status==="error"&&t.errorMessage&&N(e("tools.detail.errorMessage","Error Message"),t.errorMessage),t.status==="error"&&t.blockedMessage&&N(e("tools.detail.blockedMessage","Blocked Reason"),t.blockedMessage),t.status==="error"&&t.fallbackCommand&&N(e("tools.detail.executedCommand","Executed Command"),t.fallbackCommand)]})})]})},[e]);return s.jsxs("div",{className:o.page,children:[s.jsx("div",{className:o.tabs,children:["history","statistics"].map(t=>s.jsx("button",{className:`${o.tab} ${w===t?o.tabActive:""}`,onClick:()=>j(t),children:e(`tools.tab.${t}`,t.charAt(0).toUpperCase()+t.slice(1))},t))}),w==="history"&&s.jsxs("div",{className:o.card,children:[s.jsxs("div",{className:o.cardToolbar,children:[s.jsx("div",{className:o.sectionTitle,children:e("tools.tab.history","History")}),s.jsx("button",{className:o.dangerButton,onClick:()=>C("history"),children:e("common.clear","Clear")})]}),s.jsx("div",{className:o.filterRow,children:s.jsxs("label",{className:o.filterLabel,children:[e("tools.filter.tool","Tool"),":",s.jsxs("select",{className:o.filterSelect,value:a.historyToolFilter,onChange:t=>{a.setHistoryToolFilter(t.target.value),a.setHistoryOffset(0)},children:[s.jsx("option",{value:"",children:e("tools.filter.all","All")}),U.map(t=>s.jsx("option",{value:t,children:t},t))]})]})}),s.jsx(xt,{columns:P,data:a.history,rowKey:t=>t.id,onRowClick:t=>L(l=>l===t.id?null:t.id),emptyMessage:e("tools.empty.history","No history entries"),expandedKey:E,renderExpandedRow:Q}),s.jsxs("div",{className:o.pagination,children:[s.jsx("button",{className:o.btn,disabled:a.historyOffset===0,title:e("tools.page.prev.tooltip","Go to the previous page of tool history results."),onClick:()=>a.setHistoryOffset(Math.max(0,a.historyOffset-z)),children:e("tools.page.prev","Prev")}),s.jsxs("span",{className:o.pageInfo,children:[a.historyOffset+1,"–",Math.min(a.historyOffset+z,a.historyTotal)," / ",a.historyTotal]}),s.jsx("button",{className:o.btn,disabled:!a.historyHasMore,title:e("tools.page.next.tooltip","Go to the next page of tool history results."),onClick:()=>a.setHistoryOffset(a.historyOffset+z),children:e("tools.page.next","Next")})]})]}),w==="statistics"&&s.jsxs("div",{className:o.card,children:[s.jsxs("div",{className:o.cardToolbar,children:[s.jsx("div",{className:o.sectionTitle,children:e("tools.tab.statistics","Statistics")}),s.jsx("button",{className:o.dangerButton,onClick:()=>C("statistics"),children:e("common.clear","Clear")})]}),y&&s.jsxs("div",{className:o.tierDistribution,children:[s.jsxs("div",{className:o.tierBarWrap,children:[s.jsx("div",{className:o.tierBarBasic,style:{width:`${y.basicPct}%`}}),s.jsx("div",{className:o.tierBarPro,style:{width:`${y.proPct}%`}})]}),s.jsxs("div",{className:o.tierLabels,children:[s.jsxs("span",{children:[R(e,"basic")," ",y.basicPct,"% (",y.basic,")"]}),s.jsxs("span",{children:[R(e,"pro")," ",y.proPct,"% (",y.pro,")"]})]})]}),s.jsx("div",{className:o.statsTableWrap,children:s.jsxs("table",{className:o.statsTable,children:[s.jsx("thead",{children:s.jsx("tr",{children:F.map(t=>s.jsxs("th",{style:t.width?{width:t.width}:void 0,className:t.sortable?o.sortableHeader:void 0,onClick:t.sortable?()=>g(t.key):void 0,children:[s.jsx("span",{children:t.label}),t.sortable&&d===t.key&&s.jsx("span",{className:o.sortArrow,children:B==="asc"?"▴":"▾"})]},t.key))})}),s.jsx("tbody",{children:f.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:F.length,className:o.emptyStats,children:e("tools.empty.stats","No tool statistics")})}):f.map(t=>{const l=A===t.toolName;return s.jsxs(r.Fragment,{children:[s.jsxs("tr",{className:o.statsToolRow,onClick:()=>W(t.toolName),children:[s.jsx("td",{children:s.jsxs("button",{type:"button",className:o.expandButton,"aria-expanded":l,"aria-label":`${t.toolName} ${l?e("common.collapse","Collapse"):e("common.expand","Expand")}`,onClick:i=>{i.stopPropagation(),W(t.toolName)},children:[s.jsx("span",{className:o.expandIcon,"aria-hidden":"true",children:l?"▾":"▸"}),s.jsx("span",{children:t.toolName})]})}),s.jsx("td",{children:t.totalCalls}),s.jsx("td",{children:t.successCount}),s.jsx("td",{children:t.fallbackCount}),s.jsx("td",{children:t.unsupportedCount}),s.jsx("td",{children:t.failureCount}),s.jsx("td",{children:q(t.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx(M,{text:t.tier==="mixed"?e("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:s.jsx("span",{className:t.tier==="pro"?o.tierPro:t.tier==="mixed"?o.tierMixed:o.tierBasic,children:R(e,t.tier)})})})]}),l&&t.commands.map(i=>s.jsxs("tr",{className:o.statsActionRow,children:[s.jsx("td",{children:s.jsx("span",{className:o.actionLabel,children:i.label})}),s.jsx("td",{children:i.totalCalls}),s.jsx("td",{children:i.successCount}),s.jsx("td",{children:i.fallbackCount}),s.jsx("td",{children:i.unsupportedCount}),s.jsx("td",{children:i.failureCount}),s.jsx("td",{children:q(i.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx("span",{className:i.tier==="pro"?o.tierPro:o.tierBasic,children:R(e,i.tier)})})]},`${t.toolName}:${i.commandName}`))]},t.toolName)})})]})}),a.statistics&&s.jsxs("div",{className:o.summaryLine,children:[e("tools.summary.total","Total"),": ",a.statistics.totalCalls," ",e("tools.summary.calls","calls")," | ",e("tools.summary.sessions","Sessions"),": ",a.statistics.totalSessions]})]}),!b.loading&&b.tier==="basic"&&s.jsx(rt,{basicCalls:b.basicCalls,proCalls:b.proCalls,totalCalls:b.totalCalls,proUsagePercent:b.proUsagePercent,upgradeHref:lt.tools}),s.jsx(at,{open:n!==null,title:n==="history"?e("tools.clear.history.title","Clear history?"):e("tools.clear.statistics.title","Clear statistics?"),message:n==="history"?e("tools.clear.history.message","This permanently removes the current place tools history."):e("tools.clear.statistics.message","This permanently resets the current place tool statistics."),cancelLabel:e("common.cancel","Cancel"),confirmLabel:e("common.clear","Clear"),loading:h,onCancel:()=>!h&&C(null),onConfirm:Z})]})}export{Ce as Component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as w,j as e,n as m,r as p,o as h,m as j,L as v}from"./index-oz4Gtzz9.js";const b="_card_1vaoq_2",C="_cardUnread_1vaoq_15",T="_cardRead_1vaoq_20",f="_topRow_1vaoq_25",S="_categoryChip_1vaoq_32",R="_versionChip_1vaoq_45",k="_date_1vaoq_57",q="_title_1vaoq_65",H="_body_1vaoq_74",E="_link_1vaoq_83",A="_newBadge_1vaoq_98",n={card:b,cardUnread:C,cardRead:T,topRow:f,categoryChip:S,versionChip:R,date:k,title:q,body:H,link:E,newBadge:A},U={release:"whatsNew.category.release",notice:"whatsNew.category.notice",deprecation:"whatsNew.category.deprecation",tip:"whatsNew.category.tip"};function x({announcement:s,isNew:d}){const{locale:i,t:c}=w(),o=d?n.cardUnread:n.cardRead,_=s.title[i]??s.title.en,l=s.body[i]??s.body.en,r=s.link?s.link.label[i]??s.link.label.en:null;return e.jsxs("div",{className:`${n.card} ${o}`,children:[e.jsxs("div",{className:n.topRow,children:[e.jsx("span",{className:n.categoryChip,children:c(U[s.category])}),s.version&&e.jsx("span",{className:n.versionChip,children:s.version}),d&&e.jsx("span",{className:n.newBadge,children:c("whatsNew.newBadge","NEW")}),e.jsx("span",{className:n.date,children:s.date})]}),e.jsx("h3",{className:n.title,children:_}),e.jsx("p",{className:n.body,children:l}),s.link&&r&&e.jsxs("a",{className:n.link,href:s.link.url,target:"_blank",rel:"noopener noreferrer",children:["↗"," ",r]})]})}const B="_page_19yl3_2",I="_pageHeader_19yl3_10",$="_pageHeaderText_19yl3_17",L="_pageTitle_19yl3_24",M="_pageSubtitle_19yl3_31",W="_settingsIcon_19yl3_38",z="_section_19yl3_67",O="_sectionTitle_19yl3_73",Y="_unreadCount_19yl3_85",G="_empty_19yl3_100",K="_divider_19yl3_108",t={page:B,pageHeader:I,pageHeaderText:$,pageTitle:L,pageSubtitle:M,settingsIcon:W,section:z,sectionTitle:O,unreadCount:Y,empty:G,divider:K};function D(){const{t:s}=w(),{readSet:d,markRead:i}=m(),c=p.useMemo(()=>{const a=[];for(const u of h)d.has(u.id)||a.push(u.id);return a},[]),o=p.useRef(c);o.current=c,p.useEffect(()=>()=>{o.current.length>0&&i(o.current)},[]);const _=p.useMemo(()=>new Set(c),[c]),l=h.filter(a=>_.has(a.id)),r=h.filter(a=>!_.has(a.id)),g=l.length>0,N=r.length>0,y=e.jsxs("div",{className:t.pageHeader,children:[e.jsxs("div",{className:t.pageHeaderText,children:[e.jsx("h1",{className:t.pageTitle,children:s("whatsNew.pageTitle","What's New")}),e.jsx("p",{className:t.pageSubtitle,children:s("whatsNew.pageSubtitle","Stay up to date with MCP changes")})]}),e.jsx(j,{text:s("sidebar.settings","Settings"),children:e.jsx(v,{to:"/settings","aria-label":s("sidebar.settings","Settings"),className:t.settingsIcon,children:"⚙️"})})]});return h.length===0?e.jsxs("div",{className:t.page,children:[y,e.jsx("p",{className:t.empty,children:s("whatsNew.empty","No announcements yet")})]}):e.jsxs("div",{className:t.page,children:[y,g&&e.jsxs("section",{className:t.section,children:[e.jsxs("h2",{className:t.sectionTitle,children:[s("whatsNew.unreadSection","Unread"),e.jsx("span",{className:t.unreadCount,children:l.length})]}),l.map(a=>e.jsx(x,{announcement:a,isNew:!0},`unread-${a.id}`))]}),g&&N&&e.jsx("hr",{className:t.divider}),N&&e.jsxs("section",{className:t.section,children:[e.jsx("h2",{className:t.sectionTitle,children:s("whatsNew.allSection","All Announcements")}),r.map(a=>e.jsx(x,{announcement:a,isNew:!1},`all-${a.id}`))]})]})}export{D as Component};
|