@weppy/roblox-mcp 2.6.2 → 2.6.3
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 +4 -4
- package/CHANGELOG.md +8 -0
- 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-DYQthxhC.js → ChangelogDetailPage-CCOyzW-z.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{ChangelogPage-WFqQ5h8e.js → ChangelogPage-CH7hNPlg.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{ConfirmModal-CM3ElkBC.js → ConfirmModal-jY5BGNY2.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{ConnectionPage-DdKcJZt6.js → ConnectionPage-CBcepiuB.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{GameChangeDetail-DGphCFbI.js → GameChangeDetail-sMoIkbj9.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{InfoLabel-CMSu30c4.js → InfoLabel-BbEJAGvG.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{OverviewPage-DM74adCU.js → OverviewPage-B1QsVfNL.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{PlaytestPage-Dq3kV_rX.js → PlaytestPage-LveG542g.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{SettingsPage-QQd8aPdd.js → SettingsPage-BMllTvd1.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{StatusBadge-BhRLY0yK.js → StatusBadge-DASntRhn.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{SyncPage-Col3nhBp.js → SyncPage-COJc3U-b.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/TierComparison-B-d8Qied.js +2 -0
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{ToolsPage-Ba_6GnUZ.js → ToolsPage-Bi0PQXNP.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{TooltipText-Bnvm1FcC.js → TooltipText-Bt3XsRi-.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{WhatsNewPage-M1EeHSH-.js → WhatsNewPage-Dt7gQvv4.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/index-BJrsGJ5y.js +380 -0
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/{useLiveUptime-Dc2iJiFi.js → useLiveUptime-ViehI-J9.js} +1 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/index.html +1 -1
- package/plugins/weppy-roblox-mcp/dist/index.js +87 -79
- package/plugins/weppy-roblox-mcp/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/TierComparison-CYfIb0tr.js +0 -1
- package/plugins/weppy-roblox-mcp/dashboard/dist/assets/index-B-nqZCE3.js +0 -380
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{u as o,o as l,j as e}from"./index-BJrsGJ5y.js";const _=[{name:"query_instances",description:"Query Roblox instances: get, children, find child/descendant, wait for child, class info, search by name/class. [PRO] file_tree, project_structure, descendants, ancestors, search by property/tag.",basic:["get","children","find_child","find_descendant","wait_for_child","class_info","search_name","search_class"],pro:["search_property","search_tag","file_tree","project_structure","descendants","ancestors"]},{name:"mutate_instances",description:"Create, delete, clone, move, rename, or pivot instances. [PRO] create_tree, mass_create, mass_delete, mass_duplicate, smart_duplicate.",basic:["create","create_with_props","delete","clone","move","rename","pivot"],pro:["create_tree","mass_create","mass_delete","mass_duplicate","smart_duplicate"]},{name:"manage_properties",description:"Get/set properties, attributes, and tags on instances. [PRO] set_calculated, set_relative, mass_set, mass_get, modify_children.",basic:["get","set","get_all","set_multiple","get_attr","set_attr","get_all_attrs","delete_attr","add_tag","remove_tag","check_tag","get_tags","get_tagged"],pro:["set_calculated","set_relative","mass_set","mass_get","modify_children"]},{name:"manage_scripts",description:"Manage script source code: read, write, create, delete, edit lines, search. [PRO] replace across scripts.",basic:["get_source","set_source","create","delete","edit_replace","edit_insert","edit_delete","search","get_dependencies"],pro:["replace"]},{name:"manage_ui",description:"Roblox in-game UI (ScreenGui/Frame/TextLabel/…) 를 생성·수정·검증. 새 UI 작업은 반드시 design_brief action으로 시작 — 필수 7필드 미충족 시 서버가 질문을 반환하므로 사용자에게 그대로 확인 요청할 것. 세부 지침은 MCP resource `roblox-ui/design-guide` 에 있음. 핵심 원칙: (1) 모바일 터치 타겟 ≥44px (2) 텍스트 대비 ≥4.5:1 (3) TextScaled 대신 명시 TextSize 사용 (4) 세이프존 margin 존중.\n",basic:[],pro:["design_brief","create_tree","update","delete","preview","lint"]},{name:"manage_lighting",description:"[PRO] Configure environment: lighting, atmosphere, sky, terrain properties, time of day.",basic:[],pro:["lighting","atmosphere","sky","terrain_props","time"]},{name:"manage_selection",description:"Get, set, or clear selection. [PRO] context, details, add/remove items, watch changes.",basic:["get","set","clear","cached"],pro:["context","details","add","remove","watch"]},{name:"manage_camera",description:"Camera operations: get info, focus on instance/position, suggest view, capture Edit-mode viewport screenshot (Edit mode only; not usable during playtest).",basic:["info","focus_path","focus_position","suggest"],pro:["screenshot"]},{name:"manage_tween",description:"[PRO] Tween service: create, play, pause, cancel tweens for smooth animations.",basic:[],pro:["create","play","pause","cancel"]},{name:"manage_audio",description:"[PRO] Audio management: play, stop, pause, resume sounds. Set audio listener.",basic:[],pro:["play","stop","pause","resume","set_listener"]},{name:"manage_animation",description:"[PRO] Animation: load, play, stop animations. Get animation tracks from humanoid/controller.",basic:[],pro:["load","play","stop","get_tracks"]},{name:"manage_physics",description:"[PRO] Physics collision groups: register, set collidable between groups, list groups.",basic:[],pro:["register_group","set_collidable","get_groups"]},{name:"manage_effects",description:"[PRO] Particle effects: emit particles, clear all particles, toggle effect enabled state.",basic:[],pro:["emit","clear","toggle"]},{name:"manage_terrain",description:"[PRO] Terrain operations: fill shapes, clear regions, replace materials, manage colors, read/write voxels, generate procedural terrain, smooth terrain.",basic:[],pro:["fill_block","fill_ball","fill_cylinder","fill_wedge","clear_region","clear_bounds","replace_material","colors_get","colors_set","read_voxel","read_voxels","write_voxels","generate","smooth"]},{name:"spatial_query",description:"[PRO] Spatial queries: raycast, find ground, check placement, multi-raycast, scan area, find flat areas, find spawn positions, analyze walkable, spatial map, find empty space, get bounds, snap to grid, check collision.",basic:[],pro:["raycast","find_ground","check_placement","multi_raycast","scan_area","find_flat","find_spawn","analyze_walkable","spatial_map","find_space","bounds","snap_grid","collision"]},{name:"manage_assets",description:"[PRO] Asset management: insert models by ID, get asset info, search creator store, insert free models/packages, export selection.",basic:[],pro:["insert","info","search","search_insert","insert_free","insert_package","export"]},{name:"manage_sync",description:"[PRO] Project sync management: status, history, direction settings, read/write synced files.",basic:[],pro:["status_current_place","history","directions","read_file","write_file","progress"]},{name:"workspace_state",description:"[PRO] Workspace state: full sync, snapshot, recent changes, viewport info, clear history, metadata, scripts, selection info, clear cache.",basic:[],pro:["sync","snapshot","changes","viewport","clear_history","metadata","scripts","selection_info","clear_cache"]},{name:"manage_logs",description:"Output logs: get filtered logs, poll incrementally with sinceSeq cursor, clear buffer, get recent errors.",basic:["get","clear","errors"],pro:[]},{name:"system_info",description:"System info: ping, connection status, usage tier. [PRO] place info, services list, studio settings, playtest control, automated test runner.",basic:["ping","connection","usage"],pro:["place_info","services","studio_settings","play","stop","pause","resume","play_status","run_test"]},{name:"manage_studio",description:`Roblox Studio Editor 상태·뷰포트 렌더링 토글을 제어. AI 에이전트가 View 탭 설정 (UI 프리뷰, 그리드, 제약조건 표시 등) 을 프로그램 방식으로 조작해 스크린샷·QA 워크플로를 자동화할 때 사용. ScreenGui.Enabled 등 사용자 인스턴스 프로퍼티는 절대 건드리지 않음 — Studio 세션 설정만 변경.
|
|
2
|
+
`,basic:[],pro:["toggle_ui_preview"]},{name:"batch_execute",description:'[PRO] Execute multiple commands in a single batch. Each command is an object with "tool" name and "args". Commands execute sequentially; optionally continue on error.',basic:[],pro:["batch_execute"]},{name:"execute_luau",description:"[PRO] Execute arbitrary Luau code in Roblox Studio sandbox. Blocked services: HttpService, DataStoreService, MessagingService. Cannot access CoreGui/CorePackages.",basic:[],pro:["execute_luau"]}],u={proOnlyTools:15,mixedTools:7,totalBasicActions:51,totalProActions:114},g={tools:_,summary:u},y="_tag_1wj0q_2",h="_label_1wj0q_17",b="_code_1wj0q_22",x="_expiry_1wj0q_31",f="_inline_1wj0q_49",j="_centered_1wj0q_54",i={tag:y,label:h,code:b,expiry:x,inline:f,centered:j};function v({variant:n}){const{t:s}=o();return l()?e.jsxs("div",{className:`${i.tag} ${n==="centered"?i.centered:i.inline}`,children:[e.jsx("span",{className:i.label,children:s("tier.promo.discount.context","🎁 Gumroad 결제 시 할인코드 입력:")}),e.jsx("span",{className:i.code,children:s("tier.comparison.discount.code","WEPPY-MCP")}),e.jsx("span",{className:i.expiry,children:s("tier.comparison.discount.expiry","Valid until April 30")})]}):null}const k="_overlay_171mk_2",w="_modal_171mk_13",P="_summaryGrid_171mk_32",N="_summaryCard_171mk_39",C="_basicCard_171mk_45",S="_proCard_171mk_49",T="_cardTitle_171mk_54",R="_summarySection_171mk_70",O="_sectionTitle_171mk_78",B="_featureList_171mk_90",A="_summary_171mk_32",L="_statBasic_171mk_116",q="_statPro_171mk_120",E="_statMixed_171mk_124",G="_detailHeader_171mk_128",M="_tableWrap_171mk_137",$="_table_171mk_137",D="_toolName_171mk_165",I="_description_171mk_171",W="_actionList_171mk_176",H="_none_171mk_184",z="_discountBanner_171mk_189",U="_closeBtn_171mk_227",t={overlay:k,modal:w,summaryGrid:P,summaryCard:N,basicCard:C,proCard:S,cardTitle:T,summarySection:R,sectionTitle:O,featureList:B,summary:A,statBasic:L,statPro:q,statMixed:E,detailHeader:G,tableWrap:M,table:$,toolName:D,description:I,actionList:W,none:H,discountBanner:z,closeBtn:U};function Q({onClose:n}){const{t:s}=o(),{tools:m,summary:c}=g,d=[{title:s("tier.comparison.basic.core","Core MCP workflow"),items:[s("tier.comparison.basic.core.item1","Script create/edit"),s("tier.comparison.basic.core.item2","Instance management"),s("tier.comparison.basic.core.item3","Property control"),s("tier.comparison.basic.core.item4","Selection and search"),s("tier.comparison.basic.core.item5","Tag management"),s("tier.comparison.basic.core.item6","Camera control"),s("tier.comparison.basic.core.item7","Log monitoring")]},{title:s("tier.comparison.basic.sync","Sync (Basic)"),items:[s("tier.comparison.basic.sync.item1","Studio to Local one-way sync"),s("tier.comparison.basic.sync.item2","Manual apply as default")]}],p=[{title:s("tier.comparison.pro.all","Everything in Basic, plus"),items:[]},{title:s("tier.comparison.pro.sync","Advanced Sync workflow"),items:[s("tier.comparison.pro.sync.item1","Per-type sync direction"),s("tier.comparison.pro.sync.item2","Per-type apply mode"),s("tier.comparison.pro.sync.item3","Bidirectional and reverse sync"),s("tier.comparison.pro.sync.item4","Full sync, resync, and push to Studio"),s("tier.comparison.pro.sync.item5","Multi-place sync")]},{title:s("tier.comparison.pro.playtest","Playtest control"),items:[s("tier.comparison.pro.playtest.item1","Play, stop, pause, and resume"),s("tier.comparison.pro.playtest.item2","Playtest state inspection"),s("tier.comparison.pro.playtest.item3","Automated test execution")]},{title:s("tier.comparison.pro.creation","Advanced creation workflow"),items:[s("tier.comparison.pro.creation.item1","Bulk operations"),s("tier.comparison.pro.creation.item2","Terrain generation"),s("tier.comparison.pro.creation.item3","Asset search and insert"),s("tier.comparison.pro.creation.item4","Raycast and spatial analysis"),s("tier.comparison.pro.creation.item5","Environment control")]}];return e.jsx("div",{className:t.overlay,onClick:n,children:e.jsxs("div",{className:t.modal,onClick:a=>a.stopPropagation(),children:[l()&&e.jsx("div",{className:t.discountBanner,children:e.jsx(v,{variant:"centered"})}),e.jsx("h2",{children:s("tier.compare")}),e.jsxs("div",{className:t.summaryGrid,children:[e.jsxs("section",{className:`${t.summaryCard} ${t.basicCard}`,children:[e.jsx("h3",{className:t.cardTitle,children:s("tier.basic")}),d.map(a=>e.jsxs("div",{className:t.summarySection,children:[e.jsx("div",{className:t.sectionTitle,children:a.title}),e.jsx("ul",{className:t.featureList,children:a.items.map(r=>e.jsx("li",{children:r},r))})]},a.title))]}),e.jsxs("section",{className:`${t.summaryCard} ${t.proCard}`,children:[e.jsx("h3",{className:t.cardTitle,children:s("tier.pro")}),p.map(a=>e.jsxs("div",{className:t.summarySection,children:[e.jsx("div",{className:t.sectionTitle,children:a.title}),a.items.length>0&&e.jsx("ul",{className:t.featureList,children:a.items.map(r=>e.jsx("li",{children:r},r))})]},a.title))]})]}),e.jsxs("div",{className:t.summary,children:[e.jsxs("span",{className:t.statBasic,children:["Basic: ",c.totalBasicActions," actions"]}),e.jsxs("span",{className:t.statPro,children:["Pro: ",c.totalProActions," actions"]}),e.jsxs("span",{className:t.statMixed,children:[c.mixedTools," mixed / ",c.proOnlyTools," pro-only"]})]}),e.jsx("div",{className:t.detailHeader,children:s("tier.comparison.detailTitle","Detailed Tool Catalog")}),e.jsx("div",{className:t.tableWrap,children:e.jsxs("table",{className:t.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:s("tools.col.tool")}),e.jsx("th",{children:s("tier.comparison.description","Description")}),e.jsx("th",{children:s("tier.basic")}),e.jsx("th",{children:s("tier.pro")})]})}),e.jsx("tbody",{children:m.map(a=>e.jsxs("tr",{children:[e.jsx("td",{className:t.toolName,children:a.name}),e.jsx("td",{className:t.description,children:s(`tier.tool.${a.name}.desc`,a.description)}),e.jsx("td",{className:t.actionList,children:a.basic.length>0?a.basic.join(", "):e.jsx("span",{className:t.none,children:"—"})}),e.jsx("td",{className:t.actionList,children:a.pro.length>0?a.pro.join(", "):e.jsx("span",{className:t.none,children:"—"})})]},a.name))})]})}),e.jsx("button",{className:t.closeBtn,onClick:n,children:s("tier.comparison.close","Close")})]})})}export{v as D,Q as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,r,a as q,D as Y,u as tt,k as et}from"./index-B-nqZCE3.js";import{T as M}from"./TooltipText-Bnvm1FcC.js";import{C as st}from"./ConfirmModal-CM3ElkBC.js";const at="_wrapper_hzgda_2",ot="_table_hzgda_7",lt="_sortable_hzgda_32",rt="_sortArrow_hzgda_41",it="_clickable_hzgda_52",nt="_empty_hzgda_57",ct="_expandedRow_hzgda_65",dt="_expandedCell_hzgda_74",S={wrapper:at,table:ot,sortable:lt,sortArrow:rt,clickable:it,empty:nt,expandedRow:ct,expandedCell:dt};function ut({columns:e,data:a,sortBy:m,sortDir:C="asc",onSort:E,onRowClick:j,rowKey:L,emptyMessage:A,expandedKey:P,renderExpandedRow:b}){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(c=>s.jsxs("th",{style:c.width?{width:c.width}:void 0,className:c.sortable?S.sortable:void 0,onClick:c.sortable&&E?()=>E(c.key):void 0,children:[s.jsx("span",{children:c.label}),c.sortable&&m===c.key&&s.jsx("span",{className:S.sortArrow,children:C==="asc"?"▴":"▾"})]},c.key))})}),s.jsx("tbody",{children:a.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:e.length,className:S.empty,children:A||"No data"})}):a.map((c,N)=>{const p=L?L(c):String(N),h=P!=null&&p===P&&b?b(c):null;return s.jsxs(r.Fragment,{children:[s.jsx("tr",{className:j?S.clickable:void 0,onClick:j?()=>j(c):void 0,children:e.map(_=>s.jsx("td",{children:_.render?_.render(c):String(c[_.key]??"")},_.key))}),h&&s.jsx("tr",{className:S.expandedRow,children:s.jsx("td",{colSpan:e.length,className:S.expandedCell,children:h})})]},p)})})]})})}function pt(e){return{...e,sequenceNumber:typeof e.sequenceNumber=="number"?e.sequenceNumber:void 0,executionTimeMs:typeof e.executionTimeMs=="number"?e.executionTimeMs:void 0}}const ht=50;function mt(){const[e,a]=r.useState(null),[m,C]=r.useState(!0),[E,j]=r.useState([]),[L,A]=r.useState(0),[P,b]=r.useState(!1),[c,N]=r.useState(!0),[p,v]=r.useState(0),[h,_]=r.useState(""),F=r.useRef(null),f=r.useCallback(async()=>{C(!0);try{const g=await q.get("/api/dashboard/tool-stats");a(g)}catch{}finally{C(!1)}},[]),y=r.useCallback(async(g,B)=>{N(!0);try{const w={limit:String(ht),offset:String(g)};B&&(w.tool=B);const R=await q.get("/api/dashboard/history",w);j(R.entries.map(pt)),A(R.total),b(R.hasMore)}catch{j([]),A(0),b(!1)}finally{N(!1)}},[]),O=r.useCallback(()=>{f(),y(p,h)},[y,f,p,h]),d=r.useCallback(async()=>{await q.post("/api/dashboard/tools/history/clear"),y(p,h)},[y,p,h]),$=r.useCallback(async()=>{await q.post("/api/dashboard/tools/statistics/clear"),f()},[f]);return r.useEffect(()=>{f()},[f]),r.useEffect(()=>{y(p,h)},[y,p,h]),r.useEffect(()=>{const g=new Y;F.current=g,g.connect();const B=g.on("command",()=>{f(),y(p,h)});return()=>{B(),g.disconnect(),F.current=null}},[y,f,p,h]),{statistics:e,statsLoading:m,history:E,historyTotal:L,historyHasMore:P,historyLoading:c,historyOffset:p,historyToolFilter:h,setHistoryOffset:v,setHistoryToolFilter:_,refresh:O,clearHistory:d,clearStatistics:$}}const xt="_page_1wyl0_2",bt="_tabs_1wyl0_10",_t="_tab_1wyl0_10",ft="_tabActive_1wyl0_34",yt="_card_1wyl0_40",gt="_cardToolbar_1wyl0_47",wt="_sectionTitle_1wyl0_55",Ct="_dangerButton_1wyl0_61",jt="_proBadge_1wyl0_71",kt="_statusOk_1wyl0_85",St="_statusFallback_1wyl0_94",Tt="_statusUnsupported_1wyl0_103",Nt="_statusError_1wyl0_112",vt="_tierBasic_1wyl0_122",Bt="_tierPro_1wyl0_126",Mt="_tierMixed_1wyl0_131",Et="_filterRow_1wyl0_142",Lt="_filterLabel_1wyl0_149",At="_filterSelect_1wyl0_158",Pt="_expandedRow_1wyl0_169",Rt="_expandedSection_1wyl0_174",Ht="_detailList_1wyl0_184",Ft="_detailItem_1wyl0_190",Ot="_detailLabel_1wyl0_196",$t="_detailValue_1wyl0_201",It="_pre_1wyl0_206",Dt="_pagination_1wyl0_223",qt="_pageInfo_1wyl0_231",zt="_btn_1wyl0_237",Wt="_tierDistribution_1wyl0_260",Ut="_tierBarWrap_1wyl0_264",Kt="_tierBarBasic_1wyl0_272",Vt="_tierBarPro_1wyl0_277",Gt="_tierLabels_1wyl0_282",Jt="_statsTableWrap_1wyl0_291",Zt="_statsTable_1wyl0_291",Qt="_sortableHeader_1wyl0_322",Xt="_sortArrow_1wyl0_327",Yt="_statsToolRow_1wyl0_331",te="_statsActionRow_1wyl0_339",ee="_expandButton_1wyl0_343",se="_expandIcon_1wyl0_355",ae="_actionLabel_1wyl0_360",oe="_emptyStats_1wyl0_367",le="_summaryLine_1wyl0_373",o={page:xt,tabs:bt,tab:_t,tabActive:ft,card:yt,cardToolbar:gt,sectionTitle:wt,dangerButton:Ct,proBadge:jt,statusOk:kt,statusFallback:St,statusUnsupported:Tt,statusError:Nt,tierBasic:vt,tierPro:Bt,tierMixed:Mt,filterRow:Et,filterLabel:Lt,filterSelect:At,expandedRow:Pt,expandedSection:Rt,detailList:Ht,detailItem:Ft,detailLabel:Ot,detailValue:$t,pre:It,pagination:Dt,pageInfo:qt,btn:zt,tierDistribution:Wt,tierBarWrap:Ut,tierBarBasic:Kt,tierBarPro:Vt,tierLabels:Gt,statsTableWrap:Jt,statsTable:Zt,sortableHeader:Qt,sortArrow:Xt,statsToolRow:Yt,statsActionRow:te,expandButton:ee,expandIcon:se,actionLabel:ae,emptyStats:oe,summaryLine:le},W=50;function re(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 z(e){return typeof e!="number"||!Number.isFinite(e)?"-":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function H(e,a){return a==="pro"?e("tier.pro","Pro"):a==="mixed"?e("tier.mixed","Mixed"):e("tier.basic","Basic")}function G(e,a){return a!==e&&a.startsWith(`${e}_`)?a.slice(e.length+1):""}function ie(e,a){const m=G(e,a);return m?`${e}.${m}`:e}function V(e){return typeof e=="string"&&e.length>0?e:void 0}function ne(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 ce(e){const a=e.result??{};return{requestedCommand:e.requestedCommand??V(a.requestedCommand),executedCommand:e.executedCommand??V(a.executedCommand),alternatives:e.alternatives??ne(a.alternatives)}}function de(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 T(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 xe(){const{t:e}=tt(),a=mt(),{show:m}=et(),[C,E]=r.useState("history"),[j,L]=r.useState(null),[A,P]=r.useState(null),[b,c]=r.useState(null),[N,p]=r.useState(!1),[v,h]=r.useState("totalCalls"),[_,F]=r.useState("desc"),f=r.useCallback(t=>{h(l=>l===t?(F(i=>i==="asc"?"desc":"asc"),t):(F("desc"),t))},[]),y=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 K;const i=Object.entries(l.commands??{}).map(([u,n])=>({toolName:l.tool,commandName:n.command??u,label:G(l.tool,n.command??u)||(n.command??u),tier:n.tier,totalCalls:n.totalCalls,successCount:n.successCount,fallbackCount:n.fallbackCount,unsupportedCount:n.unsupportedCount,failureCount:n.failureCount,totalExecutionTimeMs:n.totalExecutionTimeMs,avgExecutionTimeMs:n.avgExecutionTimeMs})),x=i.reduce((u,n)=>u+n.totalCalls,0),k=i.reduce((u,n)=>u+n.successCount,0),I=i.reduce((u,n)=>u+n.fallbackCount,0),D=i.reduce((u,n)=>u+n.unsupportedCount,0),Q=i.reduce((u,n)=>u+n.failureCount,0),U=i.reduce((u,n)=>u+n.totalExecutionTimeMs,0),X=new Set(i.map(u=>u.tier)).size>1?"mixed":((K=i[0])==null?void 0:K.tier)??l.tier;return{toolName:l.tool,tier:X,commands:i,totalCalls:x,successCount:k,fallbackCount:I,unsupportedCount:D,failureCount:Q,totalExecutionTimeMs:U,avgExecutionTimeMs:x>0?Math.round(U/x):0}}):[]},[a.statistics]),d=r.useCallback((t,l,i,x)=>s.jsx(M,{text:e(i,x),children:e(t,l)}),[e]),$=r.useMemo(()=>[...O].sort((l,i)=>{const x=l[v],k=i[v];if(typeof x=="number"&&typeof k=="number")return _==="asc"?x-k:k-x;const I=String(x??""),D=String(k??"");return _==="asc"?I.localeCompare(D):D.localeCompare(I)}),[O,v,_]),g=r.useMemo(()=>[{key:"timestamp",label:d("tools.col.time","Time","tools.col.time.tooltip","When the tool run was recorded."),width:"80px",render:t=>re(t.timestamp)},{key:"toolName",label:d("tools.col.toolAction","Tool.Action","tools.col.toolAction.tooltip","Tool name and action that were executed."),render:t=>s.jsxs("span",{children:[ie(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:d("tools.col.duration","Duration","tools.col.duration.tooltip","How long the tool took to finish."),width:"80px",render:t=>z(t.executionTimeMs)},{key:"status",label:d("tools.col.status","Status","tools.col.status.tooltip","Outcome of the recorded tool run."),width:"120px",render:t=>{const l=de(t,e);return s.jsx(M,{text:l.tooltip,children:s.jsx("span",{className:l.className,children:l.label})})}},{key:"tier",label:d("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:H(e,t.tier)})}],[e,d]),B=r.useMemo(()=>[{key:"toolName",label:d("tools.col.tool","Tool","tools.col.tool.tooltip","Consolidated tool name in the statistics table."),sortable:!0},{key:"totalCalls",label:d("tools.col.calls","Calls","tools.col.calls.tooltip","Total number of recorded calls for this tool."),sortable:!0,width:"70px"},{key:"successCount",label:d("tools.col.ok","OK","tools.col.ok.tooltip","Number of direct successful runs."),sortable:!0,width:"70px"},{key:"fallbackCount",label:d("tools.col.fallback","FALLBACK","tools.col.fallback.tooltip","Number of runs that succeeded through fallback execution."),sortable:!0,width:"110px"},{key:"unsupportedCount",label:d("tools.col.unsupported","UNSUPPORTED","tools.col.unsupported.tooltip","Number of blocked runs without fallback execution."),sortable:!0,width:"130px"},{key:"failureCount",label:d("tools.col.err","FAILED","tools.col.err.tooltip","Number of runs that failed."),sortable:!0,width:"70px"},{key:"avgExecutionTimeMs",label:d("tools.col.avgTime","Avg Time","tools.col.avgTime.tooltip","Average execution time across recorded calls."),sortable:!0,width:"90px",render:t=>z(t.avgExecutionTimeMs)},{key:"tier",label:d("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:H(e,t.tier)})})}],[e,d]),w=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]),R=r.useCallback(t=>{P(l=>l===t?null:t)},[]),J=r.useCallback(async()=>{if(b){p(!0);try{b==="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{p(!1)}}},[b,m,e,a]),Z=r.useCallback(t=>{const l=ce(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)&&T(e("tools.detail.requestedCommand","Requested Command"),l.requestedCommand),t.status==="fallback"&&(l==null?void 0:l.executedCommand)&&T(e("tools.detail.executedCommand","Executed Command"),l.executedCommand),t.status==="fallback"&&(l==null?void 0:l.alternatives)&&T(e("tools.detail.alternatives","Alternatives"),l.alternatives.join(", ")),t.status==="unsupported"&&t.blockedMessage&&T(e("tools.detail.blockedMessage","Blocked Reason"),t.blockedMessage),t.status==="unsupported"&&T(e("tools.detail.noFallback","No Fallback"),e("tools.detail.noFallback.value","No fallback ran.")),t.status==="error"&&t.errorMessage&&T(e("tools.detail.errorMessage","Error Message"),t.errorMessage),t.status==="error"&&t.blockedMessage&&T(e("tools.detail.blockedMessage","Blocked Reason"),t.blockedMessage),t.status==="error"&&t.fallbackCommand&&T(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} ${C===t?o.tabActive:""}`,onClick:()=>E(t),children:e(`tools.tab.${t}`,t.charAt(0).toUpperCase()+t.slice(1))},t))}),C==="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")}),y.map(t=>s.jsx("option",{value:t,children:t},t))]})]})}),s.jsx(ut,{columns:g,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:j,renderExpandedRow:Z}),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-W)),children:e("tools.page.prev","Prev")}),s.jsxs("span",{className:o.pageInfo,children:[a.historyOffset+1,"–",Math.min(a.historyOffset+W,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+W),children:e("tools.page.next","Next")})]})]}),C==="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")})]}),w&&s.jsxs("div",{className:o.tierDistribution,children:[s.jsxs("div",{className:o.tierBarWrap,children:[s.jsx("div",{className:o.tierBarBasic,style:{width:`${w.basicPct}%`}}),s.jsx("div",{className:o.tierBarPro,style:{width:`${w.proPct}%`}})]}),s.jsxs("div",{className:o.tierLabels,children:[s.jsxs("span",{children:[H(e,"basic")," ",w.basicPct,"% (",w.basic,")"]}),s.jsxs("span",{children:[H(e,"pro")," ",w.proPct,"% (",w.pro,")"]})]})]}),s.jsx("div",{className:o.statsTableWrap,children:s.jsxs("table",{className:o.statsTable,children:[s.jsx("thead",{children:s.jsx("tr",{children:B.map(t=>s.jsxs("th",{style:t.width?{width:t.width}:void 0,className:t.sortable?o.sortableHeader:void 0,onClick:t.sortable?()=>f(t.key):void 0,children:[s.jsx("span",{children:t.label}),t.sortable&&v===t.key&&s.jsx("span",{className:o.sortArrow,children:_==="asc"?"▴":"▾"})]},t.key))})}),s.jsx("tbody",{children:$.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:B.length,className:o.emptyStats,children:e("tools.empty.stats","No tool statistics")})}):$.map(t=>{const l=A===t.toolName;return s.jsxs(r.Fragment,{children:[s.jsxs("tr",{className:o.statsToolRow,onClick:()=>R(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(),R(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:z(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:H(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:z(i.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx("span",{className:i.tier==="pro"?o.tierPro:o.tierBasic,children:H(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]})]}),s.jsx(st,{open:b!==null,title:b==="history"?e("tools.clear.history.title","Clear history?"):e("tools.clear.statistics.title","Clear statistics?"),message:b==="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:N,onCancel:()=>!N&&c(null),onConfirm:J})]})}export{xe as Component};
|
|
1
|
+
import{j as s,r,a as q,D as Y,u as tt,k as et}from"./index-BJrsGJ5y.js";import{T as M}from"./TooltipText-Bt3XsRi-.js";import{C as st}from"./ConfirmModal-jY5BGNY2.js";const at="_wrapper_hzgda_2",ot="_table_hzgda_7",lt="_sortable_hzgda_32",rt="_sortArrow_hzgda_41",it="_clickable_hzgda_52",nt="_empty_hzgda_57",ct="_expandedRow_hzgda_65",dt="_expandedCell_hzgda_74",S={wrapper:at,table:ot,sortable:lt,sortArrow:rt,clickable:it,empty:nt,expandedRow:ct,expandedCell:dt};function ut({columns:e,data:a,sortBy:m,sortDir:C="asc",onSort:E,onRowClick:j,rowKey:L,emptyMessage:A,expandedKey:P,renderExpandedRow:b}){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(c=>s.jsxs("th",{style:c.width?{width:c.width}:void 0,className:c.sortable?S.sortable:void 0,onClick:c.sortable&&E?()=>E(c.key):void 0,children:[s.jsx("span",{children:c.label}),c.sortable&&m===c.key&&s.jsx("span",{className:S.sortArrow,children:C==="asc"?"▴":"▾"})]},c.key))})}),s.jsx("tbody",{children:a.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:e.length,className:S.empty,children:A||"No data"})}):a.map((c,N)=>{const p=L?L(c):String(N),h=P!=null&&p===P&&b?b(c):null;return s.jsxs(r.Fragment,{children:[s.jsx("tr",{className:j?S.clickable:void 0,onClick:j?()=>j(c):void 0,children:e.map(_=>s.jsx("td",{children:_.render?_.render(c):String(c[_.key]??"")},_.key))}),h&&s.jsx("tr",{className:S.expandedRow,children:s.jsx("td",{colSpan:e.length,className:S.expandedCell,children:h})})]},p)})})]})})}function pt(e){return{...e,sequenceNumber:typeof e.sequenceNumber=="number"?e.sequenceNumber:void 0,executionTimeMs:typeof e.executionTimeMs=="number"?e.executionTimeMs:void 0}}const ht=50;function mt(){const[e,a]=r.useState(null),[m,C]=r.useState(!0),[E,j]=r.useState([]),[L,A]=r.useState(0),[P,b]=r.useState(!1),[c,N]=r.useState(!0),[p,v]=r.useState(0),[h,_]=r.useState(""),F=r.useRef(null),f=r.useCallback(async()=>{C(!0);try{const g=await q.get("/api/dashboard/tool-stats");a(g)}catch{}finally{C(!1)}},[]),y=r.useCallback(async(g,B)=>{N(!0);try{const w={limit:String(ht),offset:String(g)};B&&(w.tool=B);const R=await q.get("/api/dashboard/history",w);j(R.entries.map(pt)),A(R.total),b(R.hasMore)}catch{j([]),A(0),b(!1)}finally{N(!1)}},[]),O=r.useCallback(()=>{f(),y(p,h)},[y,f,p,h]),d=r.useCallback(async()=>{await q.post("/api/dashboard/tools/history/clear"),y(p,h)},[y,p,h]),$=r.useCallback(async()=>{await q.post("/api/dashboard/tools/statistics/clear"),f()},[f]);return r.useEffect(()=>{f()},[f]),r.useEffect(()=>{y(p,h)},[y,p,h]),r.useEffect(()=>{const g=new Y;F.current=g,g.connect();const B=g.on("command",()=>{f(),y(p,h)});return()=>{B(),g.disconnect(),F.current=null}},[y,f,p,h]),{statistics:e,statsLoading:m,history:E,historyTotal:L,historyHasMore:P,historyLoading:c,historyOffset:p,historyToolFilter:h,setHistoryOffset:v,setHistoryToolFilter:_,refresh:O,clearHistory:d,clearStatistics:$}}const xt="_page_1wyl0_2",bt="_tabs_1wyl0_10",_t="_tab_1wyl0_10",ft="_tabActive_1wyl0_34",yt="_card_1wyl0_40",gt="_cardToolbar_1wyl0_47",wt="_sectionTitle_1wyl0_55",Ct="_dangerButton_1wyl0_61",jt="_proBadge_1wyl0_71",kt="_statusOk_1wyl0_85",St="_statusFallback_1wyl0_94",Tt="_statusUnsupported_1wyl0_103",Nt="_statusError_1wyl0_112",vt="_tierBasic_1wyl0_122",Bt="_tierPro_1wyl0_126",Mt="_tierMixed_1wyl0_131",Et="_filterRow_1wyl0_142",Lt="_filterLabel_1wyl0_149",At="_filterSelect_1wyl0_158",Pt="_expandedRow_1wyl0_169",Rt="_expandedSection_1wyl0_174",Ht="_detailList_1wyl0_184",Ft="_detailItem_1wyl0_190",Ot="_detailLabel_1wyl0_196",$t="_detailValue_1wyl0_201",It="_pre_1wyl0_206",Dt="_pagination_1wyl0_223",qt="_pageInfo_1wyl0_231",zt="_btn_1wyl0_237",Wt="_tierDistribution_1wyl0_260",Ut="_tierBarWrap_1wyl0_264",Kt="_tierBarBasic_1wyl0_272",Vt="_tierBarPro_1wyl0_277",Gt="_tierLabels_1wyl0_282",Jt="_statsTableWrap_1wyl0_291",Zt="_statsTable_1wyl0_291",Qt="_sortableHeader_1wyl0_322",Xt="_sortArrow_1wyl0_327",Yt="_statsToolRow_1wyl0_331",te="_statsActionRow_1wyl0_339",ee="_expandButton_1wyl0_343",se="_expandIcon_1wyl0_355",ae="_actionLabel_1wyl0_360",oe="_emptyStats_1wyl0_367",le="_summaryLine_1wyl0_373",o={page:xt,tabs:bt,tab:_t,tabActive:ft,card:yt,cardToolbar:gt,sectionTitle:wt,dangerButton:Ct,proBadge:jt,statusOk:kt,statusFallback:St,statusUnsupported:Tt,statusError:Nt,tierBasic:vt,tierPro:Bt,tierMixed:Mt,filterRow:Et,filterLabel:Lt,filterSelect:At,expandedRow:Pt,expandedSection:Rt,detailList:Ht,detailItem:Ft,detailLabel:Ot,detailValue:$t,pre:It,pagination:Dt,pageInfo:qt,btn:zt,tierDistribution:Wt,tierBarWrap:Ut,tierBarBasic:Kt,tierBarPro:Vt,tierLabels:Gt,statsTableWrap:Jt,statsTable:Zt,sortableHeader:Qt,sortArrow:Xt,statsToolRow:Yt,statsActionRow:te,expandButton:ee,expandIcon:se,actionLabel:ae,emptyStats:oe,summaryLine:le},W=50;function re(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 z(e){return typeof e!="number"||!Number.isFinite(e)?"-":e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function H(e,a){return a==="pro"?e("tier.pro","Pro"):a==="mixed"?e("tier.mixed","Mixed"):e("tier.basic","Basic")}function G(e,a){return a!==e&&a.startsWith(`${e}_`)?a.slice(e.length+1):""}function ie(e,a){const m=G(e,a);return m?`${e}.${m}`:e}function V(e){return typeof e=="string"&&e.length>0?e:void 0}function ne(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 ce(e){const a=e.result??{};return{requestedCommand:e.requestedCommand??V(a.requestedCommand),executedCommand:e.executedCommand??V(a.executedCommand),alternatives:e.alternatives??ne(a.alternatives)}}function de(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 T(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 xe(){const{t:e}=tt(),a=mt(),{show:m}=et(),[C,E]=r.useState("history"),[j,L]=r.useState(null),[A,P]=r.useState(null),[b,c]=r.useState(null),[N,p]=r.useState(!1),[v,h]=r.useState("totalCalls"),[_,F]=r.useState("desc"),f=r.useCallback(t=>{h(l=>l===t?(F(i=>i==="asc"?"desc":"asc"),t):(F("desc"),t))},[]),y=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 K;const i=Object.entries(l.commands??{}).map(([u,n])=>({toolName:l.tool,commandName:n.command??u,label:G(l.tool,n.command??u)||(n.command??u),tier:n.tier,totalCalls:n.totalCalls,successCount:n.successCount,fallbackCount:n.fallbackCount,unsupportedCount:n.unsupportedCount,failureCount:n.failureCount,totalExecutionTimeMs:n.totalExecutionTimeMs,avgExecutionTimeMs:n.avgExecutionTimeMs})),x=i.reduce((u,n)=>u+n.totalCalls,0),k=i.reduce((u,n)=>u+n.successCount,0),I=i.reduce((u,n)=>u+n.fallbackCount,0),D=i.reduce((u,n)=>u+n.unsupportedCount,0),Q=i.reduce((u,n)=>u+n.failureCount,0),U=i.reduce((u,n)=>u+n.totalExecutionTimeMs,0),X=new Set(i.map(u=>u.tier)).size>1?"mixed":((K=i[0])==null?void 0:K.tier)??l.tier;return{toolName:l.tool,tier:X,commands:i,totalCalls:x,successCount:k,fallbackCount:I,unsupportedCount:D,failureCount:Q,totalExecutionTimeMs:U,avgExecutionTimeMs:x>0?Math.round(U/x):0}}):[]},[a.statistics]),d=r.useCallback((t,l,i,x)=>s.jsx(M,{text:e(i,x),children:e(t,l)}),[e]),$=r.useMemo(()=>[...O].sort((l,i)=>{const x=l[v],k=i[v];if(typeof x=="number"&&typeof k=="number")return _==="asc"?x-k:k-x;const I=String(x??""),D=String(k??"");return _==="asc"?I.localeCompare(D):D.localeCompare(I)}),[O,v,_]),g=r.useMemo(()=>[{key:"timestamp",label:d("tools.col.time","Time","tools.col.time.tooltip","When the tool run was recorded."),width:"80px",render:t=>re(t.timestamp)},{key:"toolName",label:d("tools.col.toolAction","Tool.Action","tools.col.toolAction.tooltip","Tool name and action that were executed."),render:t=>s.jsxs("span",{children:[ie(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:d("tools.col.duration","Duration","tools.col.duration.tooltip","How long the tool took to finish."),width:"80px",render:t=>z(t.executionTimeMs)},{key:"status",label:d("tools.col.status","Status","tools.col.status.tooltip","Outcome of the recorded tool run."),width:"120px",render:t=>{const l=de(t,e);return s.jsx(M,{text:l.tooltip,children:s.jsx("span",{className:l.className,children:l.label})})}},{key:"tier",label:d("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:H(e,t.tier)})}],[e,d]),B=r.useMemo(()=>[{key:"toolName",label:d("tools.col.tool","Tool","tools.col.tool.tooltip","Consolidated tool name in the statistics table."),sortable:!0},{key:"totalCalls",label:d("tools.col.calls","Calls","tools.col.calls.tooltip","Total number of recorded calls for this tool."),sortable:!0,width:"70px"},{key:"successCount",label:d("tools.col.ok","OK","tools.col.ok.tooltip","Number of direct successful runs."),sortable:!0,width:"70px"},{key:"fallbackCount",label:d("tools.col.fallback","FALLBACK","tools.col.fallback.tooltip","Number of runs that succeeded through fallback execution."),sortable:!0,width:"110px"},{key:"unsupportedCount",label:d("tools.col.unsupported","UNSUPPORTED","tools.col.unsupported.tooltip","Number of blocked runs without fallback execution."),sortable:!0,width:"130px"},{key:"failureCount",label:d("tools.col.err","FAILED","tools.col.err.tooltip","Number of runs that failed."),sortable:!0,width:"70px"},{key:"avgExecutionTimeMs",label:d("tools.col.avgTime","Avg Time","tools.col.avgTime.tooltip","Average execution time across recorded calls."),sortable:!0,width:"90px",render:t=>z(t.avgExecutionTimeMs)},{key:"tier",label:d("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:H(e,t.tier)})})}],[e,d]),w=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]),R=r.useCallback(t=>{P(l=>l===t?null:t)},[]),J=r.useCallback(async()=>{if(b){p(!0);try{b==="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{p(!1)}}},[b,m,e,a]),Z=r.useCallback(t=>{const l=ce(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)&&T(e("tools.detail.requestedCommand","Requested Command"),l.requestedCommand),t.status==="fallback"&&(l==null?void 0:l.executedCommand)&&T(e("tools.detail.executedCommand","Executed Command"),l.executedCommand),t.status==="fallback"&&(l==null?void 0:l.alternatives)&&T(e("tools.detail.alternatives","Alternatives"),l.alternatives.join(", ")),t.status==="unsupported"&&t.blockedMessage&&T(e("tools.detail.blockedMessage","Blocked Reason"),t.blockedMessage),t.status==="unsupported"&&T(e("tools.detail.noFallback","No Fallback"),e("tools.detail.noFallback.value","No fallback ran.")),t.status==="error"&&t.errorMessage&&T(e("tools.detail.errorMessage","Error Message"),t.errorMessage),t.status==="error"&&t.blockedMessage&&T(e("tools.detail.blockedMessage","Blocked Reason"),t.blockedMessage),t.status==="error"&&t.fallbackCommand&&T(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} ${C===t?o.tabActive:""}`,onClick:()=>E(t),children:e(`tools.tab.${t}`,t.charAt(0).toUpperCase()+t.slice(1))},t))}),C==="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")}),y.map(t=>s.jsx("option",{value:t,children:t},t))]})]})}),s.jsx(ut,{columns:g,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:j,renderExpandedRow:Z}),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-W)),children:e("tools.page.prev","Prev")}),s.jsxs("span",{className:o.pageInfo,children:[a.historyOffset+1,"–",Math.min(a.historyOffset+W,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+W),children:e("tools.page.next","Next")})]})]}),C==="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")})]}),w&&s.jsxs("div",{className:o.tierDistribution,children:[s.jsxs("div",{className:o.tierBarWrap,children:[s.jsx("div",{className:o.tierBarBasic,style:{width:`${w.basicPct}%`}}),s.jsx("div",{className:o.tierBarPro,style:{width:`${w.proPct}%`}})]}),s.jsxs("div",{className:o.tierLabels,children:[s.jsxs("span",{children:[H(e,"basic")," ",w.basicPct,"% (",w.basic,")"]}),s.jsxs("span",{children:[H(e,"pro")," ",w.proPct,"% (",w.pro,")"]})]})]}),s.jsx("div",{className:o.statsTableWrap,children:s.jsxs("table",{className:o.statsTable,children:[s.jsx("thead",{children:s.jsx("tr",{children:B.map(t=>s.jsxs("th",{style:t.width?{width:t.width}:void 0,className:t.sortable?o.sortableHeader:void 0,onClick:t.sortable?()=>f(t.key):void 0,children:[s.jsx("span",{children:t.label}),t.sortable&&v===t.key&&s.jsx("span",{className:o.sortArrow,children:_==="asc"?"▴":"▾"})]},t.key))})}),s.jsx("tbody",{children:$.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:B.length,className:o.emptyStats,children:e("tools.empty.stats","No tool statistics")})}):$.map(t=>{const l=A===t.toolName;return s.jsxs(r.Fragment,{children:[s.jsxs("tr",{className:o.statsToolRow,onClick:()=>R(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(),R(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:z(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:H(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:z(i.avgExecutionTimeMs)}),s.jsx("td",{children:s.jsx("span",{className:i.tier==="pro"?o.tierPro:o.tierBasic,children:H(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]})]}),s.jsx(st,{open:b!==null,title:b==="history"?e("tools.clear.history.title","Clear history?"):e("tools.clear.statistics.title","Clear statistics?"),message:b==="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:N,onCancel:()=>!N&&c(null),onConfirm:J})]})}export{xe as Component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r,T as s}from"./index-
|
|
1
|
+
import{j as r,T as s}from"./index-BJrsGJ5y.js";function p({text:o,children:t}){return r.jsx(s,{text:o,children:t})}export{p as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as w,j as e,p as m,r as _,q as h,T as j,L as v}from"./index-
|
|
1
|
+
import{u as w,j as e,p as m,r as _,q as h,T as j,L as v}from"./index-BJrsGJ5y.js";const T="_card_1vaoq_2",b="_cardUnread_1vaoq_15",C="_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:T,cardUnread:b,cardRead:C,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,p=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:p}),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=_.useMemo(()=>{const a=[];for(const u of h)d.has(u.id)||a.push(u.id);return a},[]),o=_.useRef(c);o.current=c,_.useEffect(()=>()=>{o.current.length>0&&i(o.current)},[]);const p=_.useMemo(()=>new Set(c),[c]),l=h.filter(a=>p.has(a.id)),r=h.filter(a=>!p.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};
|