@weppy/roblox-mcp 2.17.6 → 2.17.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dashboard/dist/assets/{AiPromptExamples-CbfCoFve.js → AiPromptExamples-FjV57hJp.js} +1 -1
  3. package/dashboard/dist/assets/AssetsPage-Bdcj6AyD.css +1 -0
  4. package/dashboard/dist/assets/AssetsPage-DvCSWpoy.js +61 -0
  5. package/dashboard/dist/assets/{ChangelogPage-Cadbq_zL.js → ChangelogPage-BrNOX2vc.js} +1 -1
  6. package/dashboard/dist/assets/{ConfirmModal-DQEfv0Ep.js → ConfirmModal-Ddk0UX_P.js} +1 -1
  7. package/dashboard/dist/assets/{ConnectionPage-Clnx4gBI.js → ConnectionPage-B62B5vSh.js} +1 -1
  8. package/dashboard/dist/assets/{ControlsPage-CT8JR9CW.js → ControlsPage-Cl_mQpzx.js} +1 -1
  9. package/dashboard/dist/assets/CurrentPlaceScope-B6NllTmu.css +1 -0
  10. package/dashboard/dist/assets/CurrentPlaceScope-Y25KxsHT.js +1 -0
  11. package/dashboard/dist/assets/{GameChangeDetail-B_Bk0OE2.js → GameChangeDetail-br9EgICc.js} +1 -1
  12. package/dashboard/dist/assets/{InfoLabel-Bi2B4_BK.js → InfoLabel-CAGC3efT.js} +1 -1
  13. package/dashboard/dist/assets/{OverviewPage-CGKpvE5d.js → OverviewPage-DxRlbjwz.js} +1 -1
  14. package/dashboard/dist/assets/{PageHeader-PYyDz5EU.js → PageHeader-Dc41DgFB.js} +1 -1
  15. package/dashboard/dist/assets/PlaceSelectOptions-DCv8Lnxo.css +1 -0
  16. package/dashboard/dist/assets/PlaceSelectOptions-Gd2pK9DL.js +1 -0
  17. package/dashboard/dist/assets/{PlaytestAiPromptExamples-DCLVUPo3.js → PlaytestAiPromptExamples-CkR6t6Na.js} +1 -1
  18. package/dashboard/dist/assets/{PlaytestPage-BPQd3nrz.js → PlaytestPage-ShadLIAO.js} +1 -1
  19. package/dashboard/dist/assets/{SettingsPage-rgVEr-he.js → SettingsPage-CGGHBxbL.js} +1 -1
  20. package/dashboard/dist/assets/{StatusBadge-LnSy3DVI.js → StatusBadge-Cdfb5vyE.js} +1 -1
  21. package/dashboard/dist/assets/{SyncPage-BrQDt7-3.js → SyncPage-CT2ECSYt.js} +1 -1
  22. package/dashboard/dist/assets/{Tabs-BQ9tpG0z.js → Tabs-Dl0dNd8V.js} +1 -1
  23. package/dashboard/dist/assets/{TierPromoPanel--_qegOQx.js → TierPromoPanel-B0BctivD.js} +1 -1
  24. package/dashboard/dist/assets/{ToolsPage-C-E6yB34.js → ToolsPage-CsFjwKOz.js} +1 -1
  25. package/dashboard/dist/assets/{TooltipText-qTYKP233.js → TooltipText-C0DmdntK.js} +1 -1
  26. package/dashboard/dist/assets/{UiStudioPage-BjXizccO.js → UiStudioPage-DzG_JVxv.js} +1 -1
  27. package/dashboard/dist/assets/{WhatsNewPage-C--5gRKm.js → WhatsNewPage-BpSGOLxW.js} +1 -1
  28. package/dashboard/dist/assets/{bot-lfjvzKzF.js → bot-BCKWpJd_.js} +1 -1
  29. package/dashboard/dist/assets/{check-D3G1Hmd8.js → check-DvBWmDvn.js} +1 -1
  30. package/dashboard/dist/assets/{copy-BzIAPDmY.js → copy-vqzBh0XB.js} +1 -1
  31. package/dashboard/dist/assets/{index-BAIOgi4p.js → index-CG4GxcAc.js} +96 -64
  32. package/dashboard/dist/assets/{sample-requests-CmQWgVaq.js → sample-requests-BqgMpTlQ.js} +1 -1
  33. package/dashboard/dist/assets/{trash-2-Sy4mcZS-.js → trash-2-zj182u9_.js} +1 -1
  34. package/dashboard/dist/assets/{useLiveUptime-BiwNNavN.js → useLiveUptime-yZ9iKJ1B.js} +1 -1
  35. package/dashboard/dist/assets/useSettings-Cme-nLG9.js +1 -0
  36. package/dashboard/dist/index.html +1 -1
  37. package/dist/index.js +154 -154
  38. package/package.json +1 -1
  39. package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
  40. package/dashboard/dist/assets/AssetsPage-DTCXBoYA.js +0 -61
  41. package/dashboard/dist/assets/AssetsPage-DX8NUPQo.css +0 -1
  42. package/dashboard/dist/assets/CurrentPlaceScope-COd50R0N.css +0 -1
  43. package/dashboard/dist/assets/CurrentPlaceScope-peMPRcro.js +0 -1
  44. package/dashboard/dist/assets/PlaceSelectOptions-DFWeNtyn.js +0 -1
  45. package/dashboard/dist/assets/useSettings-lRz2zeoV.js +0 -1
@@ -1 +1 @@
1
- import{j as e,r as i,b as I,D as ht,u as at,X as mt,a as bt,i as xt}from"./index-BAIOgi4p.js";import{P as ft}from"./PageHeader-PYyDz5EU.js";import{T as M}from"./TooltipText-qTYKP233.js";import{C as _t}from"./ConfirmModal-DQEfv0Ep.js";import{T as gt,C as jt}from"./Tabs-BQ9tpG0z.js";import{C as yt}from"./CurrentPlaceScope-peMPRcro.js";import"./ConfirmModal.module-DJksQHBd.js";import"./PlaceSelectOptions-DFWeNtyn.js";const Ct="_wrapper_1s3lp_2",Tt="_table_1s3lp_7",kt="_sortable_1s3lp_32",Nt="_sortArrow_1s3lp_41",St="_clickable_1s3lp_52",wt="_empty_1s3lp_57",A={wrapper:Ct,table:Tt,sortable:kt,sortArrow:Nt,clickable:St,empty:wt};function vt({columns:t,data:o,sortBy:c,sortDir:T="asc",onSort:b,onRowClick:l,rowKey:N,emptyMessage:S}){return e.jsx("div",{className:A.wrapper,children:e.jsxs("table",{className:A.table,children:[e.jsx("thead",{children:e.jsx("tr",{children:t.map(h=>e.jsxs("th",{style:h.width?{width:h.width}:void 0,className:h.sortable?A.sortable:void 0,onClick:h.sortable&&b?()=>b(h.key):void 0,children:[e.jsx("span",{children:h.label}),h.sortable&&c===h.key&&e.jsx("span",{className:A.sortArrow,children:T==="asc"?"▴":"▾"})]},h.key))})}),e.jsx("tbody",{children:o.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:t.length,className:A.empty,children:S||"No data"})}):o.map((h,w)=>{const C=N?N(h):String(w);return e.jsx("tr",{className:l?A.clickable:void 0,tabIndex:l?-1:void 0,onClick:l?_=>l(h,_.currentTarget):void 0,children:t.map(_=>e.jsx("td",{children:_.render?_.render(h):String(h[_.key]??"")},_.key))},C)})})]})})}function Mt(t){return{...t,sequenceNumber:typeof t.sequenceNumber=="number"?t.sequenceNumber:void 0,executionTimeMs:typeof t.executionTimeMs=="number"?t.executionTimeMs:void 0}}const Bt=50;function Pt(t){if(typeof t=="number")return{placeId:String(t)}}function Y(t,o){return typeof o!="number"?t:`${t}?placeId=${encodeURIComponent(String(o))}`}function Lt(t){const o=(t==null?void 0:t.placeId)??null,[c,T]=i.useState(null),[b,l]=i.useState(!0),[N,S]=i.useState([]),[h,w]=i.useState(0),[C,_]=i.useState(!1),[U,O]=i.useState(!0),[m,E]=i.useState(0),[g,F]=i.useState(""),B=i.useRef(null),k=i.useCallback(async()=>{l(!0);try{const j=Pt(o),u=j?await I.get("/api/dashboard/tool-stats",j):await I.get("/api/dashboard/tool-stats");T(u)}catch{}finally{l(!1)}},[o]),x=i.useCallback(async(j,u)=>{O(!0);try{const P={limit:String(Bt),offset:String(j)};u&&(P.tool=u),typeof o=="number"&&(P.placeId=String(o));const H=await I.get("/api/dashboard/history",P);S(H.entries.map(Mt)),w(H.total),_(H.hasMore)}catch{S([]),w(0),_(!1)}finally{O(!1)}},[o]),D=i.useCallback(()=>{k(),x(m,g)},[x,k,m,g]),V=i.useCallback(async()=>{await I.post(Y("/api/dashboard/tools/history/clear",o)),x(m,g)},[x,m,g,o]),K=i.useCallback(async()=>{await I.post(Y("/api/dashboard/tools/statistics/clear",o)),k()},[k,o]);return i.useEffect(()=>{k()},[k]),i.useEffect(()=>{x(m,g)},[x,m,g]),i.useEffect(()=>{const j=new ht;B.current=j,j.connect();const u=j.on("command",()=>{k(),x(m,g)});return()=>{u(),j.disconnect(),B.current=null}},[x,k,m,g]),{statistics:c,statsLoading:b,history:N,historyTotal:h,historyHasMore:C,historyLoading:U,historyOffset:m,historyToolFilter:g,setHistoryOffset:E,setHistoryToolFilter:F,refresh:D,clearHistory:V,clearStatistics:K}}const Et="_page_1rtjt_2",Ht="_card_1rtjt_14",At="_cardToolbar_1rtjt_21",Rt="_sectionTitle_1rtjt_29",It="_dangerButton_1rtjt_36",Ot="_proBadge_1rtjt_55",Ft="_statusOk_1rtjt_70",Dt="_statusFallback_1rtjt_83",$t="_statusUnsupported_1rtjt_96",qt="_statusWarning_1rtjt_109",Wt="_statusError_1rtjt_122",Ut="_tierBasic_1rtjt_136",Vt="_tierPro_1rtjt_140",Kt="_tierMixed_1rtjt_145",Gt="_filterRow_1rtjt_156",zt="_filterLabel_1rtjt_163",Jt="_filterSelect_1rtjt_172",Qt="_detailsButton_1rtjt_187",Zt="_detailShell_1rtjt_210",Xt="_detailHeader_1rtjt_218",Yt="_detailHeading_1rtjt_229",te="_detailTitle_1rtjt_236",ee="_detailRecordName_1rtjt_243",se="_detailHeaderActions_1rtjt_252",ae="_detailCloseButton_1rtjt_259",oe="_detailBody_1rtjt_282",le="_detailSection_1rtjt_294",re="_detailList_1rtjt_313",ie="_detailItem_1rtjt_319",ne="_detailLabel_1rtjt_326",ce="_detailValue_1rtjt_331",de="_pre_1rtjt_337",ue="_pagination_1rtjt_355",pe="_pageInfo_1rtjt_363",he="_btn_1rtjt_369",me="_tierDistribution_1rtjt_397",be="_tierBarWrap_1rtjt_401",xe="_tierBarBasic_1rtjt_409",fe="_tierBarPro_1rtjt_414",_e="_tierLabels_1rtjt_419",ge="_statsTableWrap_1rtjt_428",je="_statsTable_1rtjt_428",ye="_sortableHeader_1rtjt_460",Ce="_sortArrow_1rtjt_465",Te="_statsToolRow_1rtjt_469",ke="_statsActionRow_1rtjt_477",Ne="_expandButton_1rtjt_481",Se="_expandIcon_1rtjt_493",we="_actionLabel_1rtjt_498",ve="_emptyStats_1rtjt_505",Me="_summaryLine_1rtjt_511",a={page:Et,card:Ht,cardToolbar:At,sectionTitle:Rt,dangerButton:It,proBadge:Ot,statusOk:Ft,statusFallback:Dt,statusUnsupported:$t,statusWarning:qt,statusError:Wt,tierBasic:Ut,tierPro:Vt,tierMixed:Kt,filterRow:Gt,filterLabel:zt,filterSelect:Jt,detailsButton:Qt,detailShell:Zt,detailHeader:Xt,detailHeading:Yt,detailTitle:te,detailRecordName:ee,detailHeaderActions:se,detailCloseButton:ae,detailBody:oe,detailSection:le,detailList:re,detailItem:ie,detailLabel:ne,detailValue:ce,pre:de,pagination:ue,pageInfo:pe,btn:he,tierDistribution:me,tierBarWrap:be,tierBarBasic:xe,tierBarPro:fe,tierLabels:_e,statsTableWrap:ge,statsTable:je,sortableHeader:ye,sortArrow:Ce,statsToolRow:Te,statsActionRow:ke,expandButton:Ne,expandIcon:Se,actionLabel:we,emptyStats:ve,summaryLine:Me},Be=new Set(["clientId","placeId","pinnedTarget","recentPriority","globalQueue"]);function tt(t){return typeof t=="string"&&t.length>0?t:void 0}function Pe(t){if(!Array.isArray(t))return;const o=t.filter(c=>typeof c=="string"&&c.length>0);return o.length>0?o:void 0}function Le(t){const o=t.result??{};return{requestedCommand:t.requestedCommand??tt(o.requestedCommand),executedCommand:t.executedCommand??tt(o.executedCommand),alternatives:t.alternatives??Pe(o.alternatives)}}function ot(t,o){switch(t.status){case"fallback":return{label:o("tools.badge.fallback","FALLBACK"),tooltip:o("tools.badge.fallback.tooltip","The requested Pro action succeeded via a Basic fallback."),className:a.statusFallback};case"unsupported":return{label:o("tools.badge.unsupported","UNSUPPORTED"),tooltip:o("tools.badge.unsupported.tooltip","The requested Pro action was blocked and no fallback ran."),className:a.statusUnsupported};case"warning":return{label:o("tools.badge.warn","WARN"),tooltip:o("tools.badge.warn.tooltip","The tool call failed as an expected caller, project, policy, or user-code issue."),className:a.statusWarning};case"error":return{label:o("tools.badge.err","FAILED"),tooltip:o("tools.badge.err.tooltip","The tool run failed."),className:a.statusError};default:return{label:o("tools.status.ok","OK"),tooltip:o("tools.status.ok.tooltip","The tool run completed successfully."),className:a.statusOk}}}function y(t,o){return e.jsxs("div",{className:a.detailItem,children:[e.jsx("span",{className:a.detailLabel,children:t}),e.jsx("span",{className:a.detailValue,children:o})]})}function Ee(t){if(!t||typeof t!="object")return;const o=t;if(typeof o.selectionMode=="string"&&Be.has(o.selectionMode))return o}function et(t){if(!(!t||typeof t!="object"||!("routing"in t)))return Ee(t.routing)}function He(t){return t.routing??et(t.result)??et(t.data)}function Ae(t,o){return t.requestedClientId?t.requestedClientId:t.requestedPlaceId!==void 0?t.requestedPlaceId:o("tools.history.routing.none","No Studio target named")}function Re(t){return t.actualPlaceName?`${t.actualPlaceName} · ${t.actualPlaceId??"-"}`:t.actualClientId??"-"}function Ie({entry:t,onClose:o}){const{t:c}=at(),T=ot(t,c),b=Le(t),l=He(t);return e.jsxs("div",{className:a.detailShell,children:[e.jsxs("header",{className:a.detailHeader,children:[e.jsxs("div",{className:a.detailHeading,children:[e.jsx("span",{className:a.detailTitle,children:c("tools.detail.title","Tool execution")}),e.jsx("span",{className:a.detailRecordName,children:t.command})]}),e.jsxs("div",{className:a.detailHeaderActions,children:[e.jsx(M,{text:T.tooltip,children:e.jsx("span",{className:T.className,children:T.label})}),e.jsx("button",{type:"button",className:a.detailCloseButton,onClick:o,"aria-label":c("common.close","Close"),children:e.jsx(mt,{size:18,"aria-hidden":"true"})})]})]}),e.jsxs("div",{className:a.detailBody,children:[e.jsxs("section",{className:a.detailSection,children:[e.jsx("strong",{children:e.jsx(M,{text:c("tools.detail.params.tooltip","Input parameters passed to this tool run."),children:c("tools.detail.params","Parameters")})}),e.jsx("pre",{className:a.pre,children:JSON.stringify(t.parameters,null,2)})]}),t.result&&e.jsxs("section",{className:a.detailSection,children:[e.jsx("strong",{children:e.jsx(M,{text:c("tools.detail.result.tooltip","Returned result payload for this tool run."),children:c("tools.detail.result","Result")})}),e.jsx("pre",{className:a.pre,children:JSON.stringify(t.result,null,2)})]}),l&&e.jsxs("section",{className:a.detailSection,children:[e.jsx("strong",{children:c("tools.history.routing","Routing")}),e.jsxs("div",{className:a.detailList,children:[y(c("tools.history.routing.mode","Mode"),l.selectionMode),y(c("tools.history.routing.requested","Requested"),Ae(l,c)),y(c("tools.history.routing.actual","Actual"),Re(l))]})]}),(t.status==="fallback"||t.status==="unsupported"||t.status==="warning"||t.status==="error")&&e.jsx("section",{className:a.detailSection,children:e.jsxs("div",{className:a.detailList,children:[t.status==="fallback"&&b.requestedCommand?y(c("tools.detail.requestedCommand","Requested Command"),b.requestedCommand):null,t.status==="fallback"&&b.executedCommand?y(c("tools.detail.executedCommand","Executed Command"),b.executedCommand):null,t.status==="fallback"&&b.alternatives?y(c("tools.detail.alternatives","Alternatives"),b.alternatives.join(", ")):null,t.status==="unsupported"&&t.blockedMessage?y(c("tools.detail.blockedMessage","Blocked Reason"),t.blockedMessage):null,t.status==="unsupported"?y(c("tools.detail.noFallback","No Fallback"),c("tools.detail.noFallback.value","No fallback ran.")):null,t.status==="warning"&&t.warningMessage?y(c("tools.detail.warningMessage","Warning Message"),t.warningMessage):null,t.status==="error"&&t.errorMessage?y(c("tools.detail.errorMessage","Error Message"),t.errorMessage):null,t.status==="error"&&t.blockedMessage?y(c("tools.detail.blockedMessage","Blocked Reason"),t.blockedMessage):null,t.status==="error"&&t.fallbackCommand?y(c("tools.detail.executedCommand","Executed Command"),t.fallbackCommand):null]})})]})]})}const G=50;function Oe(t){const o=new Date(t);return`${String(o.getHours()).padStart(2,"0")}:${String(o.getMinutes()).padStart(2,"0")}:${String(o.getSeconds()).padStart(2,"0")}`}function W(t){return typeof t!="number"||!Number.isFinite(t)?"-":t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}function R(t,o){return o==="pro"?t("tier.pro","Pro"):o==="mixed"?t("tier.mixed","Mixed"):t("tier.basic","Basic")}function lt(t,o){return o!==t&&o.startsWith(`${t}_`)?o.slice(t.length+1):""}function st(t,o){const c=lt(t,o);return c?`${t}.${c}`:t}function ze(){const{t}=at(),{trackEvent:o,trackPageView:c}=bt(),[T,b]=i.useState(null),l=Lt({placeId:T}),{show:N}=xt(),[S,h]=i.useState("history"),[w,C]=i.useState(null),_=i.useRef(null),[U,O]=i.useState(null),[m,E]=i.useState(null),[g,F]=i.useState(!1),[B,k]=i.useState("totalCalls"),[x,D]=i.useState("desc"),V=i.useCallback(s=>{k(n=>n===s?(D(r=>r==="asc"?"desc":"asc"),s):(D("desc"),s))},[]),K=i.useMemo(()=>{var n;const s=new Set;return Object.keys(((n=l.statistics)==null?void 0:n.tools)??{}).forEach(r=>s.add(r)),l.history.forEach(r=>{r.tool&&s.add(r.tool)}),l.historyToolFilter&&s.add(l.historyToolFilter),Array.from(s).sort()},[l.history,l.historyToolFilter,l.statistics]),j=i.useMemo(()=>{var s;return(s=l.statistics)!=null&&s.tools?Object.values(l.statistics.tools).map(n=>{var X;const r=Object.entries(n.commands??{}).map(([p,d])=>({toolName:n.tool,commandName:d.command??p,label:lt(n.tool,d.command??p)||(d.command??p),tier:d.tier,totalCalls:d.totalCalls,successCount:d.successCount,fallbackCount:d.fallbackCount,unsupportedCount:d.unsupportedCount,warningCount:d.warningCount??0,failureCount:d.failureCount,totalExecutionTimeMs:d.totalExecutionTimeMs,avgExecutionTimeMs:d.avgExecutionTimeMs})),f=r.reduce((p,d)=>p+d.totalCalls,0),v=r.reduce((p,d)=>p+d.successCount,0),$=r.reduce((p,d)=>p+d.fallbackCount,0),q=r.reduce((p,d)=>p+d.unsupportedCount,0),dt=r.reduce((p,d)=>p+d.warningCount,0),ut=r.reduce((p,d)=>p+d.failureCount,0),Z=r.reduce((p,d)=>p+d.totalExecutionTimeMs,0),pt=new Set(r.map(p=>p.tier)).size>1?"mixed":((X=r[0])==null?void 0:X.tier)??n.tier;return{toolName:n.tool,tier:pt,commands:r,totalCalls:f,successCount:v,fallbackCount:$,unsupportedCount:q,warningCount:dt,failureCount:ut,totalExecutionTimeMs:Z,avgExecutionTimeMs:f>0?Math.round(Z/f):0}}):[]},[l.statistics]),u=i.useCallback((s,n,r,f)=>e.jsx(M,{text:t(r,f),children:t(s,n)}),[t]),P=i.useCallback((s,n)=>{_.current=n,C(s)},[]),H=i.useCallback(()=>{C(null)},[]),z=i.useMemo(()=>[...j].sort((n,r)=>{const f=n[B],v=r[B];if(typeof f=="number"&&typeof v=="number")return x==="asc"?f-v:v-f;const $=String(f??""),q=String(v??"");return x==="asc"?$.localeCompare(q):q.localeCompare($)}),[j,B,x]),rt=i.useMemo(()=>[{key:"timestamp",label:u("tools.col.time","Time","tools.col.time.tooltip","When the tool run was recorded."),width:"80px",render:s=>Oe(s.timestamp)},{key:"toolName",label:u("tools.col.toolAction","Tool.Action","tools.col.toolAction.tooltip","Tool name and action that were executed."),render:s=>e.jsxs("span",{children:[st(s.tool,s.command),s.tier==="pro"&&e.jsx(M,{text:t("tools.badge.pro.tooltip","This entry used a Pro-only tool or action."),children:e.jsx("span",{className:a.proBadge,children:t("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:s=>W(s.executionTimeMs)},{key:"status",label:u("tools.col.status","Status","tools.col.status.tooltip","Outcome of the recorded tool run."),width:"120px",render:s=>{const n=ot(s,t);return e.jsx(M,{text:n.tooltip,children:e.jsx("span",{className:n.className,children:n.label})})}},{key:"tier",label:u("tools.col.tier","Tier","tools.col.tier.tooltip","License tier required for the tool or action."),width:"60px",render:s=>e.jsx("span",{className:s.tier==="pro"?a.tierPro:a.tierBasic,children:R(t,s.tier)})},{key:"details",label:t("tools.detail.open","Details"),width:"84px",render:s=>{const n=st(s.tool,s.command);return e.jsx("button",{type:"button",className:a.detailsButton,"aria-haspopup":"dialog","aria-label":t("tools.detail.openLabel","View details for {command}").replace("{command}",n),onClick:r=>{r.stopPropagation(),P(s,r.currentTarget)},children:t("tools.detail.open","Details")})}}],[P,t,u]),J=i.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:"warningCount",label:u("tools.col.warn","WARN","tools.col.warn.tooltip","Number of expected failures caused by caller input, project state, Roblox policy, or user code."),sortable:!0,width:"80px"},{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:s=>W(s.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:s=>e.jsx(M,{text:s.tier==="mixed"?t("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:e.jsx("span",{className:s.tier==="pro"?a.tierPro:s.tier==="mixed"?a.tierMixed:a.tierBasic,children:R(t,s.tier)})})}],[t,u]),L=i.useMemo(()=>{if(!l.statistics)return null;const s=l.statistics.tierSummary.basic.totalCalls,n=l.statistics.tierSummary.pro.totalCalls,r=s+n;if(r===0)return null;const f=Math.round(s/r*100),v=100-f;return{basic:s,pro:n,basicPct:f,proPct:v}},[l.statistics]),Q=i.useCallback(s=>{O(n=>n===s?null:s)},[]),it=i.useCallback(async()=>{if(m){F(!0);try{m==="history"?await l.clearHistory():await l.clearStatistics(),N(t("toast.clearSuccess","Cleared successfully"),"success"),E(null)}catch{N(t("toast.clearFailed","Failed to clear data"),"error")}finally{F(!1)}}},[m,N,t,l]),nt=i.useCallback(s=>{const n=s==="history"?"tools_history":"tools_statistics";o("dashboard_click_event",{click_target:s==="history"?"tools_tab_history":"tools_tab_statistics",page:"tools",tab:n}),c({page:"tools",tab:n}),C(null),h(s)},[o,c]),ct=["history","statistics"].map(s=>({key:s,label:t(`tools.tab.${s}`,s.charAt(0).toUpperCase()+s.slice(1))}));return e.jsxs("div",{className:a.page,children:[e.jsx(ft,{title:t("page.tools.title","Tools"),description:t("page.tools.description","Inspect tool history, outcomes, fallback details, and usage statistics."),helpTopicId:"tools"}),e.jsx(yt,{surface:"tools",selectable:!0,selectedPlaceId:T,onSelectedPlaceIdChange:s=>{C(null),b(s),l.setHistoryOffset(0)}}),e.jsx(gt,{items:ct,value:S,onChange:nt}),S==="history"&&e.jsxs("div",{className:a.card,children:[e.jsxs("div",{className:a.cardToolbar,children:[e.jsx("div",{className:a.sectionTitle,children:t("tools.tab.history","History")}),e.jsx("button",{className:a.dangerButton,onClick:()=>{o("dashboard_click_event",{click_target:"tools_clear_history",page:"tools",tab:"tools_history"}),E("history")},children:t("common.clear","Clear")})]}),e.jsx("div",{className:a.filterRow,children:e.jsxs("label",{className:a.filterLabel,children:[t("tools.filter.tool","Tool"),":",e.jsxs("select",{className:a.filterSelect,value:l.historyToolFilter,onChange:s=>{C(null),l.setHistoryToolFilter(s.target.value),l.setHistoryOffset(0)},children:[e.jsx("option",{value:"",children:t("tools.filter.all","All")}),K.map(s=>e.jsx("option",{value:s,children:s},s))]})]})}),e.jsx(vt,{columns:rt,data:l.history,rowKey:s=>s.id,onRowClick:(s,n)=>P(s,n),emptyMessage:t("tools.empty.history","No tool history entries for this place")}),e.jsxs("div",{className:a.pagination,children:[e.jsx("button",{className:a.btn,disabled:l.historyOffset===0,title:t("tools.page.prev.tooltip","Go to the previous page of tool history results."),onClick:()=>{C(null),l.setHistoryOffset(Math.max(0,l.historyOffset-G))},children:t("tools.page.prev","Prev")}),e.jsxs("span",{className:a.pageInfo,children:[l.historyOffset+1,"–",Math.min(l.historyOffset+G,l.historyTotal)," / ",l.historyTotal]}),e.jsx("button",{className:a.btn,disabled:!l.historyHasMore,title:t("tools.page.next.tooltip","Go to the next page of tool history results."),onClick:()=>{C(null),l.setHistoryOffset(l.historyOffset+G)},children:t("tools.page.next","Next")})]})]}),S==="statistics"&&e.jsxs("div",{className:a.card,children:[e.jsxs("div",{className:a.cardToolbar,children:[e.jsx("div",{className:a.sectionTitle,children:t("tools.tab.statistics","Statistics")}),e.jsx("button",{className:a.dangerButton,onClick:()=>{o("dashboard_click_event",{click_target:"tools_clear_statistics",page:"tools",tab:"tools_statistics"}),E("statistics")},children:t("common.clear","Clear")})]}),L&&e.jsxs("div",{className:a.tierDistribution,children:[e.jsxs("div",{className:a.tierBarWrap,children:[e.jsx("div",{className:a.tierBarBasic,style:{width:`${L.basicPct}%`}}),e.jsx("div",{className:a.tierBarPro,style:{width:`${L.proPct}%`}})]}),e.jsxs("div",{className:a.tierLabels,children:[e.jsxs("span",{children:[R(t,"basic")," ",L.basicPct,"% (",L.basic,")"]}),e.jsxs("span",{children:[R(t,"pro")," ",L.proPct,"% (",L.pro,")"]})]})]}),e.jsx("div",{className:a.statsTableWrap,children:e.jsxs("table",{className:a.statsTable,children:[e.jsx("thead",{children:e.jsx("tr",{children:J.map(s=>e.jsxs("th",{style:s.width?{width:s.width}:void 0,className:s.sortable?a.sortableHeader:void 0,onClick:s.sortable?()=>V(s.key):void 0,children:[e.jsx("span",{children:s.label}),s.sortable&&B===s.key&&e.jsx("span",{className:a.sortArrow,children:x==="asc"?"▴":"▾"})]},s.key))})}),e.jsx("tbody",{children:z.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:J.length,className:a.emptyStats,children:t("tools.empty.stats","No tool statistics for this place")})}):z.map(s=>{const n=U===s.toolName;return e.jsxs(i.Fragment,{children:[e.jsxs("tr",{className:a.statsToolRow,onClick:()=>Q(s.toolName),children:[e.jsx("td",{children:e.jsxs("button",{type:"button",className:a.expandButton,"aria-expanded":n,"aria-label":`${s.toolName} ${n?t("common.collapse","Collapse"):t("common.expand","Expand")}`,onClick:r=>{r.stopPropagation(),Q(s.toolName)},children:[e.jsx("span",{className:a.expandIcon,"aria-hidden":"true",children:n?"▾":"▸"}),e.jsx("span",{children:s.toolName})]})}),e.jsx("td",{children:s.totalCalls}),e.jsx("td",{children:s.successCount}),e.jsx("td",{children:s.fallbackCount}),e.jsx("td",{children:s.unsupportedCount}),e.jsx("td",{children:s.warningCount}),e.jsx("td",{children:s.failureCount}),e.jsx("td",{children:W(s.avgExecutionTimeMs)}),e.jsx("td",{children:e.jsx(M,{text:s.tier==="mixed"?t("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:e.jsx("span",{className:s.tier==="pro"?a.tierPro:s.tier==="mixed"?a.tierMixed:a.tierBasic,children:R(t,s.tier)})})})]}),n&&s.commands.map(r=>e.jsxs("tr",{className:a.statsActionRow,children:[e.jsx("td",{children:e.jsx("span",{className:a.actionLabel,children:r.label})}),e.jsx("td",{children:r.totalCalls}),e.jsx("td",{children:r.successCount}),e.jsx("td",{children:r.fallbackCount}),e.jsx("td",{children:r.unsupportedCount}),e.jsx("td",{children:r.warningCount}),e.jsx("td",{children:r.failureCount}),e.jsx("td",{children:W(r.avgExecutionTimeMs)}),e.jsx("td",{children:e.jsx("span",{className:r.tier==="pro"?a.tierPro:a.tierBasic,children:R(t,r.tier)})})]},`${s.toolName}:${r.commandName}`))]},s.toolName)})})]})}),l.statistics&&e.jsxs("div",{className:a.summaryLine,children:[t("tools.summary.total","Total"),": ",l.statistics.totalCalls," ",t("tools.summary.calls","calls")," | ",t("tools.summary.sessions","Sessions"),": ",l.statistics.totalSessions]})]}),e.jsx(jt,{open:w!==null,ariaLabel:t("tools.detail.dialogLabel","Tool execution detail"),onClose:H,returnFocusTo:_.current,testId:"tools-history-detail-popup-layer",children:w&&e.jsx(Ie,{entry:w,onClose:H})}),e.jsx(_t,{open:m!==null,title:m==="history"?t("tools.clear.history.title","Clear history?"):t("tools.clear.statistics.title","Clear statistics?"),message:m==="history"?t("tools.clear.history.message","This permanently removes the current place tools history."):t("tools.clear.statistics.message","This permanently resets the current place tool statistics."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:g,onCancel:()=>!g&&E(null),onConfirm:it})]})}export{ze as Component};
1
+ import{j as e,r as i,b as I,D as ht,u as at,X as mt,a as bt,i as xt}from"./index-CG4GxcAc.js";import{P as ft}from"./PageHeader-Dc41DgFB.js";import{T as M}from"./TooltipText-C0DmdntK.js";import{C as _t}from"./ConfirmModal-Ddk0UX_P.js";import{T as gt,C as jt}from"./Tabs-Dl0dNd8V.js";import{C as yt}from"./CurrentPlaceScope-Y25KxsHT.js";import"./ConfirmModal.module-DJksQHBd.js";import"./PlaceSelectOptions-Gd2pK9DL.js";const Ct="_wrapper_1s3lp_2",Tt="_table_1s3lp_7",kt="_sortable_1s3lp_32",Nt="_sortArrow_1s3lp_41",St="_clickable_1s3lp_52",wt="_empty_1s3lp_57",A={wrapper:Ct,table:Tt,sortable:kt,sortArrow:Nt,clickable:St,empty:wt};function vt({columns:t,data:o,sortBy:c,sortDir:T="asc",onSort:b,onRowClick:l,rowKey:N,emptyMessage:S}){return e.jsx("div",{className:A.wrapper,children:e.jsxs("table",{className:A.table,children:[e.jsx("thead",{children:e.jsx("tr",{children:t.map(h=>e.jsxs("th",{style:h.width?{width:h.width}:void 0,className:h.sortable?A.sortable:void 0,onClick:h.sortable&&b?()=>b(h.key):void 0,children:[e.jsx("span",{children:h.label}),h.sortable&&c===h.key&&e.jsx("span",{className:A.sortArrow,children:T==="asc"?"▴":"▾"})]},h.key))})}),e.jsx("tbody",{children:o.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:t.length,className:A.empty,children:S||"No data"})}):o.map((h,w)=>{const C=N?N(h):String(w);return e.jsx("tr",{className:l?A.clickable:void 0,tabIndex:l?-1:void 0,onClick:l?_=>l(h,_.currentTarget):void 0,children:t.map(_=>e.jsx("td",{children:_.render?_.render(h):String(h[_.key]??"")},_.key))},C)})})]})})}function Mt(t){return{...t,sequenceNumber:typeof t.sequenceNumber=="number"?t.sequenceNumber:void 0,executionTimeMs:typeof t.executionTimeMs=="number"?t.executionTimeMs:void 0}}const Bt=50;function Pt(t){if(typeof t=="number")return{placeId:String(t)}}function Y(t,o){return typeof o!="number"?t:`${t}?placeId=${encodeURIComponent(String(o))}`}function Lt(t){const o=(t==null?void 0:t.placeId)??null,[c,T]=i.useState(null),[b,l]=i.useState(!0),[N,S]=i.useState([]),[h,w]=i.useState(0),[C,_]=i.useState(!1),[U,O]=i.useState(!0),[m,E]=i.useState(0),[g,F]=i.useState(""),B=i.useRef(null),k=i.useCallback(async()=>{l(!0);try{const j=Pt(o),u=j?await I.get("/api/dashboard/tool-stats",j):await I.get("/api/dashboard/tool-stats");T(u)}catch{}finally{l(!1)}},[o]),x=i.useCallback(async(j,u)=>{O(!0);try{const P={limit:String(Bt),offset:String(j)};u&&(P.tool=u),typeof o=="number"&&(P.placeId=String(o));const H=await I.get("/api/dashboard/history",P);S(H.entries.map(Mt)),w(H.total),_(H.hasMore)}catch{S([]),w(0),_(!1)}finally{O(!1)}},[o]),D=i.useCallback(()=>{k(),x(m,g)},[x,k,m,g]),V=i.useCallback(async()=>{await I.post(Y("/api/dashboard/tools/history/clear",o)),x(m,g)},[x,m,g,o]),K=i.useCallback(async()=>{await I.post(Y("/api/dashboard/tools/statistics/clear",o)),k()},[k,o]);return i.useEffect(()=>{k()},[k]),i.useEffect(()=>{x(m,g)},[x,m,g]),i.useEffect(()=>{const j=new ht;B.current=j,j.connect();const u=j.on("command",()=>{k(),x(m,g)});return()=>{u(),j.disconnect(),B.current=null}},[x,k,m,g]),{statistics:c,statsLoading:b,history:N,historyTotal:h,historyHasMore:C,historyLoading:U,historyOffset:m,historyToolFilter:g,setHistoryOffset:E,setHistoryToolFilter:F,refresh:D,clearHistory:V,clearStatistics:K}}const Et="_page_1rtjt_2",Ht="_card_1rtjt_14",At="_cardToolbar_1rtjt_21",Rt="_sectionTitle_1rtjt_29",It="_dangerButton_1rtjt_36",Ot="_proBadge_1rtjt_55",Ft="_statusOk_1rtjt_70",Dt="_statusFallback_1rtjt_83",$t="_statusUnsupported_1rtjt_96",qt="_statusWarning_1rtjt_109",Wt="_statusError_1rtjt_122",Ut="_tierBasic_1rtjt_136",Vt="_tierPro_1rtjt_140",Kt="_tierMixed_1rtjt_145",Gt="_filterRow_1rtjt_156",zt="_filterLabel_1rtjt_163",Jt="_filterSelect_1rtjt_172",Qt="_detailsButton_1rtjt_187",Zt="_detailShell_1rtjt_210",Xt="_detailHeader_1rtjt_218",Yt="_detailHeading_1rtjt_229",te="_detailTitle_1rtjt_236",ee="_detailRecordName_1rtjt_243",se="_detailHeaderActions_1rtjt_252",ae="_detailCloseButton_1rtjt_259",oe="_detailBody_1rtjt_282",le="_detailSection_1rtjt_294",re="_detailList_1rtjt_313",ie="_detailItem_1rtjt_319",ne="_detailLabel_1rtjt_326",ce="_detailValue_1rtjt_331",de="_pre_1rtjt_337",ue="_pagination_1rtjt_355",pe="_pageInfo_1rtjt_363",he="_btn_1rtjt_369",me="_tierDistribution_1rtjt_397",be="_tierBarWrap_1rtjt_401",xe="_tierBarBasic_1rtjt_409",fe="_tierBarPro_1rtjt_414",_e="_tierLabels_1rtjt_419",ge="_statsTableWrap_1rtjt_428",je="_statsTable_1rtjt_428",ye="_sortableHeader_1rtjt_460",Ce="_sortArrow_1rtjt_465",Te="_statsToolRow_1rtjt_469",ke="_statsActionRow_1rtjt_477",Ne="_expandButton_1rtjt_481",Se="_expandIcon_1rtjt_493",we="_actionLabel_1rtjt_498",ve="_emptyStats_1rtjt_505",Me="_summaryLine_1rtjt_511",a={page:Et,card:Ht,cardToolbar:At,sectionTitle:Rt,dangerButton:It,proBadge:Ot,statusOk:Ft,statusFallback:Dt,statusUnsupported:$t,statusWarning:qt,statusError:Wt,tierBasic:Ut,tierPro:Vt,tierMixed:Kt,filterRow:Gt,filterLabel:zt,filterSelect:Jt,detailsButton:Qt,detailShell:Zt,detailHeader:Xt,detailHeading:Yt,detailTitle:te,detailRecordName:ee,detailHeaderActions:se,detailCloseButton:ae,detailBody:oe,detailSection:le,detailList:re,detailItem:ie,detailLabel:ne,detailValue:ce,pre:de,pagination:ue,pageInfo:pe,btn:he,tierDistribution:me,tierBarWrap:be,tierBarBasic:xe,tierBarPro:fe,tierLabels:_e,statsTableWrap:ge,statsTable:je,sortableHeader:ye,sortArrow:Ce,statsToolRow:Te,statsActionRow:ke,expandButton:Ne,expandIcon:Se,actionLabel:we,emptyStats:ve,summaryLine:Me},Be=new Set(["clientId","placeId","pinnedTarget","recentPriority","globalQueue"]);function tt(t){return typeof t=="string"&&t.length>0?t:void 0}function Pe(t){if(!Array.isArray(t))return;const o=t.filter(c=>typeof c=="string"&&c.length>0);return o.length>0?o:void 0}function Le(t){const o=t.result??{};return{requestedCommand:t.requestedCommand??tt(o.requestedCommand),executedCommand:t.executedCommand??tt(o.executedCommand),alternatives:t.alternatives??Pe(o.alternatives)}}function ot(t,o){switch(t.status){case"fallback":return{label:o("tools.badge.fallback","FALLBACK"),tooltip:o("tools.badge.fallback.tooltip","The requested Pro action succeeded via a Basic fallback."),className:a.statusFallback};case"unsupported":return{label:o("tools.badge.unsupported","UNSUPPORTED"),tooltip:o("tools.badge.unsupported.tooltip","The requested Pro action was blocked and no fallback ran."),className:a.statusUnsupported};case"warning":return{label:o("tools.badge.warn","WARN"),tooltip:o("tools.badge.warn.tooltip","The tool call failed as an expected caller, project, policy, or user-code issue."),className:a.statusWarning};case"error":return{label:o("tools.badge.err","FAILED"),tooltip:o("tools.badge.err.tooltip","The tool run failed."),className:a.statusError};default:return{label:o("tools.status.ok","OK"),tooltip:o("tools.status.ok.tooltip","The tool run completed successfully."),className:a.statusOk}}}function y(t,o){return e.jsxs("div",{className:a.detailItem,children:[e.jsx("span",{className:a.detailLabel,children:t}),e.jsx("span",{className:a.detailValue,children:o})]})}function Ee(t){if(!t||typeof t!="object")return;const o=t;if(typeof o.selectionMode=="string"&&Be.has(o.selectionMode))return o}function et(t){if(!(!t||typeof t!="object"||!("routing"in t)))return Ee(t.routing)}function He(t){return t.routing??et(t.result)??et(t.data)}function Ae(t,o){return t.requestedClientId?t.requestedClientId:t.requestedPlaceId!==void 0?t.requestedPlaceId:o("tools.history.routing.none","No Studio target named")}function Re(t){return t.actualPlaceName?`${t.actualPlaceName} · ${t.actualPlaceId??"-"}`:t.actualClientId??"-"}function Ie({entry:t,onClose:o}){const{t:c}=at(),T=ot(t,c),b=Le(t),l=He(t);return e.jsxs("div",{className:a.detailShell,children:[e.jsxs("header",{className:a.detailHeader,children:[e.jsxs("div",{className:a.detailHeading,children:[e.jsx("span",{className:a.detailTitle,children:c("tools.detail.title","Tool execution")}),e.jsx("span",{className:a.detailRecordName,children:t.command})]}),e.jsxs("div",{className:a.detailHeaderActions,children:[e.jsx(M,{text:T.tooltip,children:e.jsx("span",{className:T.className,children:T.label})}),e.jsx("button",{type:"button",className:a.detailCloseButton,onClick:o,"aria-label":c("common.close","Close"),children:e.jsx(mt,{size:18,"aria-hidden":"true"})})]})]}),e.jsxs("div",{className:a.detailBody,children:[e.jsxs("section",{className:a.detailSection,children:[e.jsx("strong",{children:e.jsx(M,{text:c("tools.detail.params.tooltip","Input parameters passed to this tool run."),children:c("tools.detail.params","Parameters")})}),e.jsx("pre",{className:a.pre,children:JSON.stringify(t.parameters,null,2)})]}),t.result&&e.jsxs("section",{className:a.detailSection,children:[e.jsx("strong",{children:e.jsx(M,{text:c("tools.detail.result.tooltip","Returned result payload for this tool run."),children:c("tools.detail.result","Result")})}),e.jsx("pre",{className:a.pre,children:JSON.stringify(t.result,null,2)})]}),l&&e.jsxs("section",{className:a.detailSection,children:[e.jsx("strong",{children:c("tools.history.routing","Routing")}),e.jsxs("div",{className:a.detailList,children:[y(c("tools.history.routing.mode","Mode"),l.selectionMode),y(c("tools.history.routing.requested","Requested"),Ae(l,c)),y(c("tools.history.routing.actual","Actual"),Re(l))]})]}),(t.status==="fallback"||t.status==="unsupported"||t.status==="warning"||t.status==="error")&&e.jsx("section",{className:a.detailSection,children:e.jsxs("div",{className:a.detailList,children:[t.status==="fallback"&&b.requestedCommand?y(c("tools.detail.requestedCommand","Requested Command"),b.requestedCommand):null,t.status==="fallback"&&b.executedCommand?y(c("tools.detail.executedCommand","Executed Command"),b.executedCommand):null,t.status==="fallback"&&b.alternatives?y(c("tools.detail.alternatives","Alternatives"),b.alternatives.join(", ")):null,t.status==="unsupported"&&t.blockedMessage?y(c("tools.detail.blockedMessage","Blocked Reason"),t.blockedMessage):null,t.status==="unsupported"?y(c("tools.detail.noFallback","No Fallback"),c("tools.detail.noFallback.value","No fallback ran.")):null,t.status==="warning"&&t.warningMessage?y(c("tools.detail.warningMessage","Warning Message"),t.warningMessage):null,t.status==="error"&&t.errorMessage?y(c("tools.detail.errorMessage","Error Message"),t.errorMessage):null,t.status==="error"&&t.blockedMessage?y(c("tools.detail.blockedMessage","Blocked Reason"),t.blockedMessage):null,t.status==="error"&&t.fallbackCommand?y(c("tools.detail.executedCommand","Executed Command"),t.fallbackCommand):null]})})]})]})}const G=50;function Oe(t){const o=new Date(t);return`${String(o.getHours()).padStart(2,"0")}:${String(o.getMinutes()).padStart(2,"0")}:${String(o.getSeconds()).padStart(2,"0")}`}function W(t){return typeof t!="number"||!Number.isFinite(t)?"-":t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}function R(t,o){return o==="pro"?t("tier.pro","Pro"):o==="mixed"?t("tier.mixed","Mixed"):t("tier.basic","Basic")}function lt(t,o){return o!==t&&o.startsWith(`${t}_`)?o.slice(t.length+1):""}function st(t,o){const c=lt(t,o);return c?`${t}.${c}`:t}function ze(){const{t}=at(),{trackEvent:o,trackPageView:c}=bt(),[T,b]=i.useState(null),l=Lt({placeId:T}),{show:N}=xt(),[S,h]=i.useState("history"),[w,C]=i.useState(null),_=i.useRef(null),[U,O]=i.useState(null),[m,E]=i.useState(null),[g,F]=i.useState(!1),[B,k]=i.useState("totalCalls"),[x,D]=i.useState("desc"),V=i.useCallback(s=>{k(n=>n===s?(D(r=>r==="asc"?"desc":"asc"),s):(D("desc"),s))},[]),K=i.useMemo(()=>{var n;const s=new Set;return Object.keys(((n=l.statistics)==null?void 0:n.tools)??{}).forEach(r=>s.add(r)),l.history.forEach(r=>{r.tool&&s.add(r.tool)}),l.historyToolFilter&&s.add(l.historyToolFilter),Array.from(s).sort()},[l.history,l.historyToolFilter,l.statistics]),j=i.useMemo(()=>{var s;return(s=l.statistics)!=null&&s.tools?Object.values(l.statistics.tools).map(n=>{var X;const r=Object.entries(n.commands??{}).map(([p,d])=>({toolName:n.tool,commandName:d.command??p,label:lt(n.tool,d.command??p)||(d.command??p),tier:d.tier,totalCalls:d.totalCalls,successCount:d.successCount,fallbackCount:d.fallbackCount,unsupportedCount:d.unsupportedCount,warningCount:d.warningCount??0,failureCount:d.failureCount,totalExecutionTimeMs:d.totalExecutionTimeMs,avgExecutionTimeMs:d.avgExecutionTimeMs})),f=r.reduce((p,d)=>p+d.totalCalls,0),v=r.reduce((p,d)=>p+d.successCount,0),$=r.reduce((p,d)=>p+d.fallbackCount,0),q=r.reduce((p,d)=>p+d.unsupportedCount,0),dt=r.reduce((p,d)=>p+d.warningCount,0),ut=r.reduce((p,d)=>p+d.failureCount,0),Z=r.reduce((p,d)=>p+d.totalExecutionTimeMs,0),pt=new Set(r.map(p=>p.tier)).size>1?"mixed":((X=r[0])==null?void 0:X.tier)??n.tier;return{toolName:n.tool,tier:pt,commands:r,totalCalls:f,successCount:v,fallbackCount:$,unsupportedCount:q,warningCount:dt,failureCount:ut,totalExecutionTimeMs:Z,avgExecutionTimeMs:f>0?Math.round(Z/f):0}}):[]},[l.statistics]),u=i.useCallback((s,n,r,f)=>e.jsx(M,{text:t(r,f),children:t(s,n)}),[t]),P=i.useCallback((s,n)=>{_.current=n,C(s)},[]),H=i.useCallback(()=>{C(null)},[]),z=i.useMemo(()=>[...j].sort((n,r)=>{const f=n[B],v=r[B];if(typeof f=="number"&&typeof v=="number")return x==="asc"?f-v:v-f;const $=String(f??""),q=String(v??"");return x==="asc"?$.localeCompare(q):q.localeCompare($)}),[j,B,x]),rt=i.useMemo(()=>[{key:"timestamp",label:u("tools.col.time","Time","tools.col.time.tooltip","When the tool run was recorded."),width:"80px",render:s=>Oe(s.timestamp)},{key:"toolName",label:u("tools.col.toolAction","Tool.Action","tools.col.toolAction.tooltip","Tool name and action that were executed."),render:s=>e.jsxs("span",{children:[st(s.tool,s.command),s.tier==="pro"&&e.jsx(M,{text:t("tools.badge.pro.tooltip","This entry used a Pro-only tool or action."),children:e.jsx("span",{className:a.proBadge,children:t("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:s=>W(s.executionTimeMs)},{key:"status",label:u("tools.col.status","Status","tools.col.status.tooltip","Outcome of the recorded tool run."),width:"120px",render:s=>{const n=ot(s,t);return e.jsx(M,{text:n.tooltip,children:e.jsx("span",{className:n.className,children:n.label})})}},{key:"tier",label:u("tools.col.tier","Tier","tools.col.tier.tooltip","License tier required for the tool or action."),width:"60px",render:s=>e.jsx("span",{className:s.tier==="pro"?a.tierPro:a.tierBasic,children:R(t,s.tier)})},{key:"details",label:t("tools.detail.open","Details"),width:"84px",render:s=>{const n=st(s.tool,s.command);return e.jsx("button",{type:"button",className:a.detailsButton,"aria-haspopup":"dialog","aria-label":t("tools.detail.openLabel","View details for {command}").replace("{command}",n),onClick:r=>{r.stopPropagation(),P(s,r.currentTarget)},children:t("tools.detail.open","Details")})}}],[P,t,u]),J=i.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:"warningCount",label:u("tools.col.warn","WARN","tools.col.warn.tooltip","Number of expected failures caused by caller input, project state, Roblox policy, or user code."),sortable:!0,width:"80px"},{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:s=>W(s.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:s=>e.jsx(M,{text:s.tier==="mixed"?t("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:e.jsx("span",{className:s.tier==="pro"?a.tierPro:s.tier==="mixed"?a.tierMixed:a.tierBasic,children:R(t,s.tier)})})}],[t,u]),L=i.useMemo(()=>{if(!l.statistics)return null;const s=l.statistics.tierSummary.basic.totalCalls,n=l.statistics.tierSummary.pro.totalCalls,r=s+n;if(r===0)return null;const f=Math.round(s/r*100),v=100-f;return{basic:s,pro:n,basicPct:f,proPct:v}},[l.statistics]),Q=i.useCallback(s=>{O(n=>n===s?null:s)},[]),it=i.useCallback(async()=>{if(m){F(!0);try{m==="history"?await l.clearHistory():await l.clearStatistics(),N(t("toast.clearSuccess","Cleared successfully"),"success"),E(null)}catch{N(t("toast.clearFailed","Failed to clear data"),"error")}finally{F(!1)}}},[m,N,t,l]),nt=i.useCallback(s=>{const n=s==="history"?"tools_history":"tools_statistics";o("dashboard_click_event",{click_target:s==="history"?"tools_tab_history":"tools_tab_statistics",page:"tools",tab:n}),c({page:"tools",tab:n}),C(null),h(s)},[o,c]),ct=["history","statistics"].map(s=>({key:s,label:t(`tools.tab.${s}`,s.charAt(0).toUpperCase()+s.slice(1))}));return e.jsxs("div",{className:a.page,children:[e.jsx(ft,{title:t("page.tools.title","Tools"),description:t("page.tools.description","Inspect tool history, outcomes, fallback details, and usage statistics."),helpTopicId:"tools"}),e.jsx(yt,{surface:"tools",selectable:!0,selectedPlaceId:T,onSelectedPlaceIdChange:s=>{C(null),b(s),l.setHistoryOffset(0)}}),e.jsx(gt,{items:ct,value:S,onChange:nt}),S==="history"&&e.jsxs("div",{className:a.card,children:[e.jsxs("div",{className:a.cardToolbar,children:[e.jsx("div",{className:a.sectionTitle,children:t("tools.tab.history","History")}),e.jsx("button",{className:a.dangerButton,onClick:()=>{o("dashboard_click_event",{click_target:"tools_clear_history",page:"tools",tab:"tools_history"}),E("history")},children:t("common.clear","Clear")})]}),e.jsx("div",{className:a.filterRow,children:e.jsxs("label",{className:a.filterLabel,children:[t("tools.filter.tool","Tool"),":",e.jsxs("select",{className:a.filterSelect,value:l.historyToolFilter,onChange:s=>{C(null),l.setHistoryToolFilter(s.target.value),l.setHistoryOffset(0)},children:[e.jsx("option",{value:"",children:t("tools.filter.all","All")}),K.map(s=>e.jsx("option",{value:s,children:s},s))]})]})}),e.jsx(vt,{columns:rt,data:l.history,rowKey:s=>s.id,onRowClick:(s,n)=>P(s,n),emptyMessage:t("tools.empty.history","No tool history entries for this place")}),e.jsxs("div",{className:a.pagination,children:[e.jsx("button",{className:a.btn,disabled:l.historyOffset===0,title:t("tools.page.prev.tooltip","Go to the previous page of tool history results."),onClick:()=>{C(null),l.setHistoryOffset(Math.max(0,l.historyOffset-G))},children:t("tools.page.prev","Prev")}),e.jsxs("span",{className:a.pageInfo,children:[l.historyOffset+1,"–",Math.min(l.historyOffset+G,l.historyTotal)," / ",l.historyTotal]}),e.jsx("button",{className:a.btn,disabled:!l.historyHasMore,title:t("tools.page.next.tooltip","Go to the next page of tool history results."),onClick:()=>{C(null),l.setHistoryOffset(l.historyOffset+G)},children:t("tools.page.next","Next")})]})]}),S==="statistics"&&e.jsxs("div",{className:a.card,children:[e.jsxs("div",{className:a.cardToolbar,children:[e.jsx("div",{className:a.sectionTitle,children:t("tools.tab.statistics","Statistics")}),e.jsx("button",{className:a.dangerButton,onClick:()=>{o("dashboard_click_event",{click_target:"tools_clear_statistics",page:"tools",tab:"tools_statistics"}),E("statistics")},children:t("common.clear","Clear")})]}),L&&e.jsxs("div",{className:a.tierDistribution,children:[e.jsxs("div",{className:a.tierBarWrap,children:[e.jsx("div",{className:a.tierBarBasic,style:{width:`${L.basicPct}%`}}),e.jsx("div",{className:a.tierBarPro,style:{width:`${L.proPct}%`}})]}),e.jsxs("div",{className:a.tierLabels,children:[e.jsxs("span",{children:[R(t,"basic")," ",L.basicPct,"% (",L.basic,")"]}),e.jsxs("span",{children:[R(t,"pro")," ",L.proPct,"% (",L.pro,")"]})]})]}),e.jsx("div",{className:a.statsTableWrap,children:e.jsxs("table",{className:a.statsTable,children:[e.jsx("thead",{children:e.jsx("tr",{children:J.map(s=>e.jsxs("th",{style:s.width?{width:s.width}:void 0,className:s.sortable?a.sortableHeader:void 0,onClick:s.sortable?()=>V(s.key):void 0,children:[e.jsx("span",{children:s.label}),s.sortable&&B===s.key&&e.jsx("span",{className:a.sortArrow,children:x==="asc"?"▴":"▾"})]},s.key))})}),e.jsx("tbody",{children:z.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:J.length,className:a.emptyStats,children:t("tools.empty.stats","No tool statistics for this place")})}):z.map(s=>{const n=U===s.toolName;return e.jsxs(i.Fragment,{children:[e.jsxs("tr",{className:a.statsToolRow,onClick:()=>Q(s.toolName),children:[e.jsx("td",{children:e.jsxs("button",{type:"button",className:a.expandButton,"aria-expanded":n,"aria-label":`${s.toolName} ${n?t("common.collapse","Collapse"):t("common.expand","Expand")}`,onClick:r=>{r.stopPropagation(),Q(s.toolName)},children:[e.jsx("span",{className:a.expandIcon,"aria-hidden":"true",children:n?"▾":"▸"}),e.jsx("span",{children:s.toolName})]})}),e.jsx("td",{children:s.totalCalls}),e.jsx("td",{children:s.successCount}),e.jsx("td",{children:s.fallbackCount}),e.jsx("td",{children:s.unsupportedCount}),e.jsx("td",{children:s.warningCount}),e.jsx("td",{children:s.failureCount}),e.jsx("td",{children:W(s.avgExecutionTimeMs)}),e.jsx("td",{children:e.jsx(M,{text:s.tier==="mixed"?t("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:e.jsx("span",{className:s.tier==="pro"?a.tierPro:s.tier==="mixed"?a.tierMixed:a.tierBasic,children:R(t,s.tier)})})})]}),n&&s.commands.map(r=>e.jsxs("tr",{className:a.statsActionRow,children:[e.jsx("td",{children:e.jsx("span",{className:a.actionLabel,children:r.label})}),e.jsx("td",{children:r.totalCalls}),e.jsx("td",{children:r.successCount}),e.jsx("td",{children:r.fallbackCount}),e.jsx("td",{children:r.unsupportedCount}),e.jsx("td",{children:r.warningCount}),e.jsx("td",{children:r.failureCount}),e.jsx("td",{children:W(r.avgExecutionTimeMs)}),e.jsx("td",{children:e.jsx("span",{className:r.tier==="pro"?a.tierPro:a.tierBasic,children:R(t,r.tier)})})]},`${s.toolName}:${r.commandName}`))]},s.toolName)})})]})}),l.statistics&&e.jsxs("div",{className:a.summaryLine,children:[t("tools.summary.total","Total"),": ",l.statistics.totalCalls," ",t("tools.summary.calls","calls")," | ",t("tools.summary.sessions","Sessions"),": ",l.statistics.totalSessions]})]}),e.jsx(jt,{open:w!==null,ariaLabel:t("tools.detail.dialogLabel","Tool execution detail"),onClose:H,returnFocusTo:_.current,testId:"tools-history-detail-popup-layer",children:w&&e.jsx(Ie,{entry:w,onClose:H})}),e.jsx(_t,{open:m!==null,title:m==="history"?t("tools.clear.history.title","Clear history?"):t("tools.clear.statistics.title","Clear statistics?"),message:m==="history"?t("tools.clear.history.message","This permanently removes the current place tools history."):t("tools.clear.statistics.message","This permanently resets the current place tool statistics."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:g,onCancel:()=>!g&&E(null),onConfirm:it})]})}export{ze as Component};
@@ -1 +1 @@
1
- import{j as r,h as s}from"./index-BAIOgi4p.js";function p({text:o,children:t}){return r.jsx(s,{text:o,children:t})}export{p as T};
1
+ import{j as r,h as s}from"./index-CG4GxcAc.js";function p({text:o,children:t}){return r.jsx(s,{text:o,children:t})}export{p as T};
@@ -1,4 +1,4 @@
1
- import{f as ke,l as W,k as Fe,r as m,u as j,j as t,a as q,R as ze,X as Ve,T as je,e as We,t as Ke}from"./index-BAIOgi4p.js";import{I as B}from"./InfoLabel-Bi2B4_BK.js";import{T as y}from"./TooltipText-qTYKP233.js";import{C as Ye,P as Qe}from"./PageHeader-PYyDz5EU.js";import{D as le,c as ce,e as Je,g as Xe,h as Ze,i as de,j as Ie,k as et,l as ue,d as tt}from"./sample-requests-CmQWgVaq.js";import{C as it,T as st}from"./Tabs-BQ9tpG0z.js";import{A as pe}from"./AiPromptExamples-CbfCoFve.js";import{B as rt}from"./bot-lfjvzKzF.js";import{C as at}from"./CurrentPlaceScope-peMPRcro.js";import"./copy-BzIAPDmY.js";import"./PlaceSelectOptions-DFWeNtyn.js";/**
1
+ import{f as ke,l as W,k as Fe,r as m,u as j,j as t,a as q,R as ze,X as Ve,T as je,e as We,y as Ke}from"./index-CG4GxcAc.js";import{I as B}from"./InfoLabel-CAGC3efT.js";import{T as y}from"./TooltipText-C0DmdntK.js";import{C as Ye,P as Qe}from"./PageHeader-Dc41DgFB.js";import{D as le,c as ce,e as Je,g as Xe,h as Ze,i as de,j as Ie,k as et,l as ue,d as tt}from"./sample-requests-BqgMpTlQ.js";import{C as it,T as st}from"./Tabs-Dl0dNd8V.js";import{A as pe}from"./AiPromptExamples-FjV57hJp.js";import{B as rt}from"./bot-BCKWpJd_.js";import{C as at}from"./CurrentPlaceScope-Y25KxsHT.js";import"./copy-vqzBh0XB.js";import"./PlaceSelectOptions-Gd2pK9DL.js";/**
2
2
  * @license lucide-react v1.8.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{u as j,j as e,L as f,H as k,r as g,J as x}from"./index-BAIOgi4p.js";import{P as z}from"./PageHeader-PYyDz5EU.js";import{P as C}from"./PlaytestAiPromptExamples-DCLVUPo3.js";import"./AiPromptExamples-CbfCoFve.js";import"./copy-BzIAPDmY.js";const P="_card_15ozw_2",v="_cardUnread_15ozw_15",R="_cardRead_15ozw_20",T="_cardUnreadWarning_15ozw_25",A="_topRow_15ozw_32",I="_categoryChip_15ozw_39",L="_versionChip_15ozw_52",B="_importantBadge_15ozw_64",U="_date_15ozw_77",b="_title_15ozw_85",E="_body_15ozw_94",S="_aiPrompt_15ozw_102",W="_aiPromptIntro_15ozw_112",$="_linkList_15ozw_125",M="_link_15ozw_125",H="_internalLink_15ozw_147",O="_newBadge_15ozw_169",t={card:P,cardUnread:v,cardRead:R,cardUnreadWarning:T,topRow:A,categoryChip:I,versionChip:L,importantBadge:B,date:U,title:b,body:E,aiPrompt:S,aiPromptIntro:W,linkList:$,link:M,internalLink:H,newBadge:O},Y={release:"whatsNew.category.release",notice:"whatsNew.category.notice",deprecation:"whatsNew.category.deprecation",tip:"whatsNew.category.tip"};function u({announcement:s,isNew:i}){var a;const{locale:c,t:n}=j(),d=i?t.cardUnread:t.cardRead,l=s.severity==="warning",p=l&&i?t.cardUnreadWarning:"",w=s.title[c]??s.title.en,N=s.body[c]??s.body.en,h=s.links??(s.link?[s.link]:[]),_=r=>typeof r=="string"?r:r[c]??r.en;return e.jsxs("div",{className:`${t.card} ${d} ${p}`,children:[e.jsxs("div",{className:t.topRow,children:[e.jsx("span",{className:t.categoryChip,children:n(Y[s.category])}),l&&e.jsx("span",{className:t.importantBadge,children:n("whatsNew.importantBadge","IMPORTANT")}),s.version&&e.jsx("span",{className:t.versionChip,children:s.version}),i&&e.jsx("span",{className:t.newBadge,children:n("whatsNew.newBadge","NEW")}),e.jsx("span",{className:t.date,children:s.date})]}),e.jsx("h3",{className:t.title,children:w}),e.jsx("p",{className:t.body,children:N}),((a=s.aiPrompt)==null?void 0:a.kind)==="playtest-values"&&e.jsxs("div",{className:t.aiPrompt,children:[e.jsxs("div",{className:t.aiPromptIntro,children:[e.jsx("strong",{children:n("playtest.emptyValues.aiTitle","Ask AI")}),e.jsx("span",{children:n("playtest.emptyValues.aiDescription","Copy a request and paste it into an AI chat connected to WEPPY.")})]}),e.jsx(C,{exampleIds:[s.aiPrompt.exampleId]})]}),h.length>0&&e.jsx("div",{className:t.linkList,children:h.map(r=>{const m=_(r.url),y=_(r.label);return m.startsWith("/")?e.jsx(f,{className:`${t.link} ${t.internalLink}`,to:m,children:y},m):e.jsxs("a",{className:t.link,href:m,target:"_blank",rel:"noopener noreferrer",children:["↗"," ",y]},m)})})]})}const V="_page_4653w_2",q="_section_4653w_10",D="_sectionTitle_4653w_16",G="_unreadCount_4653w_28",J="_empty_4653w_43",K="_divider_4653w_51",o={page:V,section:q,sectionTitle:D,unreadCount:G,empty:J,divider:K};function se(){const{t:s}=j(),{readSet:i,markRead:c}=k(),n=g.useMemo(()=>{const a=[];for(const r of x)i.has(r.id)||a.push(r.id);return a},[]),d=g.useRef(n);d.current=n,g.useEffect(()=>()=>{d.current.length>0&&c(d.current)},[]);const l=g.useMemo(()=>new Set(n),[n]),p=x.filter(a=>l.has(a.id)),w=x.filter(a=>!l.has(a.id)),N=p.length>0,h=w.length>0,_=e.jsx(z,{title:s("whatsNew.pageTitle","What's New"),description:s("whatsNew.pageSubtitle","Stay up to date with MCP changes"),helpTopicId:"whatsNew"});return x.length===0?e.jsxs("div",{className:o.page,children:[_,e.jsx("p",{className:o.empty,children:s("whatsNew.empty","No announcements yet")})]}):e.jsxs("div",{className:o.page,children:[_,N&&e.jsxs("section",{className:o.section,children:[e.jsxs("h2",{className:o.sectionTitle,children:[s("whatsNew.unreadSection","Unread"),e.jsx("span",{className:o.unreadCount,children:p.length})]}),p.map(a=>e.jsx(u,{announcement:a,isNew:!0},`unread-${a.id}`))]}),N&&h&&e.jsx("hr",{className:o.divider}),h&&e.jsxs("section",{className:o.section,children:[e.jsx("h2",{className:o.sectionTitle,children:s("whatsNew.allSection","All Announcements")}),w.map(a=>e.jsx(u,{announcement:a,isNew:!1},`all-${a.id}`))]})]})}export{se as Component};
1
+ import{u as j,j as e,L as f,V as k,r as g,W as x}from"./index-CG4GxcAc.js";import{P as z}from"./PageHeader-Dc41DgFB.js";import{P as C}from"./PlaytestAiPromptExamples-CkR6t6Na.js";import"./AiPromptExamples-FjV57hJp.js";import"./copy-vqzBh0XB.js";const P="_card_15ozw_2",v="_cardUnread_15ozw_15",R="_cardRead_15ozw_20",T="_cardUnreadWarning_15ozw_25",A="_topRow_15ozw_32",I="_categoryChip_15ozw_39",L="_versionChip_15ozw_52",B="_importantBadge_15ozw_64",U="_date_15ozw_77",b="_title_15ozw_85",E="_body_15ozw_94",S="_aiPrompt_15ozw_102",W="_aiPromptIntro_15ozw_112",$="_linkList_15ozw_125",M="_link_15ozw_125",O="_internalLink_15ozw_147",V="_newBadge_15ozw_169",t={card:P,cardUnread:v,cardRead:R,cardUnreadWarning:T,topRow:A,categoryChip:I,versionChip:L,importantBadge:B,date:U,title:b,body:E,aiPrompt:S,aiPromptIntro:W,linkList:$,link:M,internalLink:O,newBadge:V},Y={release:"whatsNew.category.release",notice:"whatsNew.category.notice",deprecation:"whatsNew.category.deprecation",tip:"whatsNew.category.tip"};function u({announcement:s,isNew:i}){var a;const{locale:c,t:n}=j(),d=i?t.cardUnread:t.cardRead,l=s.severity==="warning",p=l&&i?t.cardUnreadWarning:"",w=s.title[c]??s.title.en,N=s.body[c]??s.body.en,h=s.links??(s.link?[s.link]:[]),_=r=>typeof r=="string"?r:r[c]??r.en;return e.jsxs("div",{className:`${t.card} ${d} ${p}`,children:[e.jsxs("div",{className:t.topRow,children:[e.jsx("span",{className:t.categoryChip,children:n(Y[s.category])}),l&&e.jsx("span",{className:t.importantBadge,children:n("whatsNew.importantBadge","IMPORTANT")}),s.version&&e.jsx("span",{className:t.versionChip,children:s.version}),i&&e.jsx("span",{className:t.newBadge,children:n("whatsNew.newBadge","NEW")}),e.jsx("span",{className:t.date,children:s.date})]}),e.jsx("h3",{className:t.title,children:w}),e.jsx("p",{className:t.body,children:N}),((a=s.aiPrompt)==null?void 0:a.kind)==="playtest-values"&&e.jsxs("div",{className:t.aiPrompt,children:[e.jsxs("div",{className:t.aiPromptIntro,children:[e.jsx("strong",{children:n("playtest.emptyValues.aiTitle","Ask AI")}),e.jsx("span",{children:n("playtest.emptyValues.aiDescription","Copy a request and paste it into an AI chat connected to WEPPY.")})]}),e.jsx(C,{exampleIds:[s.aiPrompt.exampleId]})]}),h.length>0&&e.jsx("div",{className:t.linkList,children:h.map(r=>{const m=_(r.url),y=_(r.label);return m.startsWith("/")?e.jsx(f,{className:`${t.link} ${t.internalLink}`,to:m,children:y},m):e.jsxs("a",{className:t.link,href:m,target:"_blank",rel:"noopener noreferrer",children:["↗"," ",y]},m)})})]})}const H="_page_4653w_2",q="_section_4653w_10",D="_sectionTitle_4653w_16",G="_unreadCount_4653w_28",K="_empty_4653w_43",F="_divider_4653w_51",o={page:H,section:q,sectionTitle:D,unreadCount:G,empty:K,divider:F};function se(){const{t:s}=j(),{readSet:i,markRead:c}=k(),n=g.useMemo(()=>{const a=[];for(const r of x)i.has(r.id)||a.push(r.id);return a},[]),d=g.useRef(n);d.current=n,g.useEffect(()=>()=>{d.current.length>0&&c(d.current)},[]);const l=g.useMemo(()=>new Set(n),[n]),p=x.filter(a=>l.has(a.id)),w=x.filter(a=>!l.has(a.id)),N=p.length>0,h=w.length>0,_=e.jsx(z,{title:s("whatsNew.pageTitle","What's New"),description:s("whatsNew.pageSubtitle","Stay up to date with MCP changes"),helpTopicId:"whatsNew"});return x.length===0?e.jsxs("div",{className:o.page,children:[_,e.jsx("p",{className:o.empty,children:s("whatsNew.empty","No announcements yet")})]}):e.jsxs("div",{className:o.page,children:[_,N&&e.jsxs("section",{className:o.section,children:[e.jsxs("h2",{className:o.sectionTitle,children:[s("whatsNew.unreadSection","Unread"),e.jsx("span",{className:o.unreadCount,children:p.length})]}),p.map(a=>e.jsx(u,{announcement:a,isNew:!0},`unread-${a.id}`))]}),N&&h&&e.jsx("hr",{className:o.divider}),h&&e.jsxs("section",{className:o.section,children:[e.jsx("h2",{className:o.sectionTitle,children:s("whatsNew.allSection","All Announcements")}),w.map(a=>e.jsx(u,{announcement:a,isNew:!1},`all-${a.id}`))]})]})}export{se as Component};
@@ -1,4 +1,4 @@
1
- import{f as t}from"./index-BAIOgi4p.js";/**
1
+ import{f as t}from"./index-CG4GxcAc.js";/**
2
2
  * @license lucide-react v1.8.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{f as c}from"./index-BAIOgi4p.js";/**
1
+ import{f as c}from"./index-CG4GxcAc.js";/**
2
2
  * @license lucide-react v1.8.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{f as c}from"./index-BAIOgi4p.js";/**
1
+ import{f as c}from"./index-CG4GxcAc.js";/**
2
2
  * @license lucide-react v1.8.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.