@weppy/roblox-mcp 2.9.3 → 2.10.1
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/CHANGELOG.md +24 -0
- package/dashboard/dist/assets/AssetsPage-Czc93xoU.css +1 -0
- package/dashboard/dist/assets/AssetsPage-DFC---br.js +46 -0
- package/dashboard/dist/assets/{ChangelogDetailPage-DTl_Tw_v.js → ChangelogDetailPage-gvZDaLft.js} +1 -1
- package/dashboard/dist/assets/{ChangelogPage-BqASaB-l.js → ChangelogPage-eOFIHxbD.js} +1 -1
- package/dashboard/dist/assets/{ConfirmModal-knJOxPTQ.js → ConfirmModal-BqCEvp7Y.js} +1 -1
- package/dashboard/dist/assets/ConfirmModal-izJskKtO.css +1 -0
- package/dashboard/dist/assets/ConfirmModal.module-D1aZY2bQ.js +1 -0
- package/dashboard/dist/assets/ConnectionPage-Ca5WLCm3.css +1 -0
- package/dashboard/dist/assets/ConnectionPage-DAz-lhiE.js +11 -0
- package/dashboard/dist/assets/{ControlsPage-da-JrES8.js → ControlsPage-CKEswTa6.js} +1 -1
- package/dashboard/dist/assets/CurrentPlaceScope-C8U9I15o.js +1 -0
- package/dashboard/dist/assets/CurrentPlaceScope-D-0g0WrM.css +1 -0
- package/dashboard/dist/assets/{GameChangeDetail-sTt5o48Z.js → GameChangeDetail-CMSmIwO-.js} +1 -1
- package/dashboard/dist/assets/{InfoLabel-DwsCwdUw.js → InfoLabel-BAhsgLcj.js} +1 -1
- package/dashboard/dist/assets/{OverviewPage-9cIh9Q5a.js → OverviewPage-COMQ7wYS.js} +1 -1
- package/dashboard/dist/assets/PageHeader-Bfy2f-GH.js +6 -0
- package/dashboard/dist/assets/PageHeader-CrhjZjgp.css +1 -0
- package/dashboard/dist/assets/PlaytestPage-BIkP1kCO.js +11 -0
- package/dashboard/dist/assets/PlaytestPage-CVEtQ4dU.css +1 -0
- package/dashboard/dist/assets/SettingsPage-ByHSUA7b.css +1 -0
- package/dashboard/dist/assets/SettingsPage-ClSPo4J8.js +1 -0
- package/dashboard/dist/assets/{StatusBadge-CYejTjWf.js → StatusBadge-Df9BQsJU.js} +1 -1
- package/dashboard/dist/assets/SyncPage-CIZWp8Ul.css +1 -0
- package/dashboard/dist/assets/SyncPage-O1vlpViJ.js +4 -0
- package/dashboard/dist/assets/Tabs-CIszXeoU.css +1 -0
- package/dashboard/dist/assets/{Tabs-wK2yL-C6.js → Tabs-Ccrw7Hjb.js} +1 -1
- package/dashboard/dist/assets/ToolsPage-CAaH9fIQ.css +1 -0
- package/dashboard/dist/assets/ToolsPage-CdPa3eYv.js +1 -0
- package/dashboard/dist/assets/{TooltipText-LAwR8aaI.js → TooltipText-CGH7dKN6.js} +1 -1
- package/dashboard/dist/assets/UiStudioPage-LH2dcLkr.css +1 -0
- package/dashboard/dist/assets/UiStudioPage-io4UBG0Y.js +11 -0
- package/dashboard/dist/assets/{WhatsNewPage-B9st_b8H.js → WhatsNewPage-CGKwvik4.js} +1 -1
- package/dashboard/dist/assets/{copy-DwoEPqC3.js → copy-D-nSZB9j.js} +1 -1
- package/dashboard/dist/assets/index-CnXGGM07.js +686 -0
- package/dashboard/dist/assets/{index-Dd1aCYFM.css → index-DzkZyWCv.css} +1 -1
- package/dashboard/dist/assets/sample-requests-DmUwqmFE.css +1 -0
- package/dashboard/dist/assets/sample-requests-ythz0BoY.js +1 -0
- package/dashboard/dist/assets/{useLiveUptime-DM28rhji.js → useLiveUptime-1Et9Q6mq.js} +1 -1
- package/dashboard/dist/assets/useSettings-DKMlodE_.js +1 -0
- package/dashboard/dist/assets/useSettings-KAiL5E_X.css +1 -0
- package/dashboard/dist/index.html +2 -2
- package/dist/index.js +94 -94
- package/package.json +1 -1
- package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
- package/dashboard/dist/assets/AssetsPage-Be5aZDhj.css +0 -1
- package/dashboard/dist/assets/AssetsPage-CqgdG2Ni.js +0 -46
- package/dashboard/dist/assets/ConfirmModal-D1kfK31C.css +0 -1
- package/dashboard/dist/assets/ConfirmModal.module-NrFlfTWy.js +0 -1
- package/dashboard/dist/assets/ConnectionPage-BkkqcLRE.js +0 -11
- package/dashboard/dist/assets/ConnectionPage-D1GWlHZP.css +0 -1
- package/dashboard/dist/assets/CurrentPlaceScope-BOfr5n7U.js +0 -1
- package/dashboard/dist/assets/CurrentPlaceScope-v3pl1mLI.css +0 -1
- package/dashboard/dist/assets/PageHeader-2-fusgsY.css +0 -1
- package/dashboard/dist/assets/PageHeader-DwlcGnaB.js +0 -6
- package/dashboard/dist/assets/PlaytestPage-BeRZc6wz.js +0 -11
- package/dashboard/dist/assets/PlaytestPage-DjjsIkke.css +0 -1
- package/dashboard/dist/assets/SettingsPage-BiCf2ur7.js +0 -1
- package/dashboard/dist/assets/SettingsPage-DSipzuEo.css +0 -1
- package/dashboard/dist/assets/SyncPage-CHe2NPfN.js +0 -4
- package/dashboard/dist/assets/SyncPage-COxqxAjv.css +0 -1
- package/dashboard/dist/assets/Tabs-876h0_zB.css +0 -1
- package/dashboard/dist/assets/ToolsPage-Bt9vYA7u.css +0 -1
- package/dashboard/dist/assets/ToolsPage-Cq8crPCz.js +0 -1
- package/dashboard/dist/assets/UiStudioPage-eSinjpOX.css +0 -1
- package/dashboard/dist/assets/UiStudioPage-xZ96a4BR.js +0 -11
- package/dashboard/dist/assets/index-CJJYSnlB.js +0 -606
- package/dashboard/dist/assets/sample-requests-CygerZZ_.css +0 -1
- package/dashboard/dist/assets/sample-requests-tNeuJCdB.js +0 -1
- package/dashboard/dist/assets/useSettings-Bsfu70PT.css +0 -1
- package/dashboard/dist/assets/useSettings-CYVeWZ0i.js +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{i as tt,u as et,r as d,j as t,f as nt,a as U,D as st,L as it,M as ct,k as W,e as at,l as lt,s as rt}from"./index-CnXGGM07.js";import{I as p}from"./InfoLabel-BAhsgLcj.js";import{P as dt}from"./PageHeader-Bfy2f-GH.js";import{S as ot}from"./StatusBadge-Df9BQsJU.js";import{T as X}from"./TooltipText-CGH7dKN6.js";import{C as J}from"./ConfirmModal-BqCEvp7Y.js";import{u as gt,f as ut}from"./useLiveUptime-1Et9Q6mq.js";import{C as K}from"./copy-D-nSZB9j.js";import"./ConfirmModal.module-D1aZY2bQ.js";/**
|
|
2
|
+
* @license lucide-react v1.8.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const pt=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],ht=tt("bot",pt);/**
|
|
7
|
+
* @license lucide-react v1.8.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const yt=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],mt=tt("server",yt),xt="_container_1h084_2",_t="_entry_1h084_14",St="_timestamp_1h084_21",jt="_message_1h084_27",vt="_warn_1h084_34",kt="_error_1h084_39",ft="_empty_1h084_44",F={container:xt,entry:_t,timestamp:St,message:jt,warn:vt,error:kt,empty:ft};function Ct(e){const s=new Date(e);return Number.isNaN(s.getTime())?e:`${String(s.getHours()).padStart(2,"0")}:${String(s.getMinutes()).padStart(2,"0")}`}function bt({entries:e}){const{t:s}=et(),n=d.useRef(null);return d.useEffect(()=>{const i=n.current;i&&(i.scrollTop=i.scrollHeight)},[e.length]),t.jsx("div",{ref:n,className:F.container,children:e.length===0?t.jsx("div",{className:F.empty,children:s("connection.log.empty","No events yet")}):e.map((i,r)=>t.jsxs("div",{className:`${F.entry} ${i.type?F[i.type]:""}`,children:[t.jsx("span",{className:F.timestamp,children:Ct(i.timestamp)}),t.jsx("span",{className:F.message,children:i.message})]},r))})}const Q=50;function wt(){const e=new Date;return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}function Nt(){const{level:e,status:s,error:n}=nt(),[i,r]=d.useState(null),[y,g]=d.useState(null),[c,N]=d.useState([]),C=d.useRef(null),A=d.useCallback((u,j)=>{N(w=>{const S=[...w,{timestamp:wt(),message:u,type:j}];return S.length>Q?S.slice(-Q):S})},[]),m=d.useCallback(async()=>{try{const u=await U.get("/connection-info");r(u)}catch{r(null)}},[]),M=d.useCallback(async()=>{try{const u=await U.get("/api/dashboard/studio-routing");g(u)}catch{g(null)}},[]),I=d.useCallback(async u=>{const j=await U.patch("/api/dashboard/studio-routing",u);return g(j),await m(),j},[m]),$=d.useCallback(async()=>{try{const u=await U.get("/api/dashboard/connection-log");N(u.entries??[])}catch{N([])}},[]),H=d.useCallback(async()=>{await U.post("/api/dashboard/connection-log/clear"),N([])},[]),b=d.useCallback(async u=>{await U.post("/api/dashboard/kill-agent",{instanceId:u}),await m()},[m]);return d.useEffect(()=>{e!=="disconnected"&&s?(m(),M()):g(null),$()},[e,s,m,$,M]),d.useEffect(()=>{const u=new st;C.current=u,u.connect();const j=u.on("connection",S=>{const h=S;h.status!=="updated"&&h.clientId&&A(`Plugin ${h.status} — ${h.clientId}`,h.status==="disconnected"?"warn":"info"),m(),M()}),w=u.on("mcp_status",S=>{const h=S,z=h.status==="registered"?"registered":"unregistered";A(`MCP ${z} — ${h.aiClientName}`,h.status==="registered"?"info":"warn"),m(),M()});return()=>{j(),w(),u.disconnect(),C.current=null}},[A,m,M]),{status:s,connectionInfo:i,studioRouting:y,connectionLog:c,level:e,error:n,clearConnectionLog:H,killAgent:b,updateStudioRouting:I}}const It="_page_14kg9_2",Lt="_card_14kg9_11",At="_topologyCard_14kg9_19",Mt="_topologyDisconnected_14kg9_26",Pt="_topologyHeader_14kg9_30",Bt="_topologyIntro_14kg9_38",$t="_topologyNetwork_14kg9_45",Et="_topologyLinks_14kg9_49",Tt="_topologyLink_14kg9_49",Ht="_topologyLink_agent_14kg9_66",Dt="_topologyLink_studio_14kg9_70",Ot="_topologyGrid_14kg9_74",Ut="_topologyColumn_14kg9_83",Ft="_topologyColumnHeader_14kg9_90",zt="_topologyColumnHeaderSpacer_14kg9_101",Gt="_topologyCount_14kg9_105",Wt="_topologyList_14kg9_120",qt="_topologyListCentered_14kg9_128",Vt="_topologyNode_14kg9_132",Kt="_topologyNodeTitle_14kg9_140",Yt="_topologyNodeMeta_14kg9_156",Rt="_topologyNodeSubtle_14kg9_157",Xt="_topologyState_14kg9_170",Jt="_topologyEmpty_14kg9_183",Qt="_topologyOverflow_14kg9_198",Zt="_topologyOverflowButton_14kg9_213",te="_topologyServerColumn_14kg9_236",ee="_topologyServer_14kg9_236",oe="_topologyServerIcon_14kg9_254",ne="_topologyServerBody_14kg9_267",se="_topologyServerTitle_14kg9_276",ie="_topologyServerMeta_14kg9_283",ce="_routingSummaryCompact_14kg9_290",ae="_disabled_14kg9_298",le="_cardHeader_14kg9_304",re="_cardHint_14kg9_317",de="_clearButton_14kg9_324",ge="_serverGrid_14kg9_348",ue="_statusRow_14kg9_366",pe="_metaItem_14kg9_373",he="_table_14kg9_380",ye="_tableWrap_14kg9_400",me="_routingSummary_14kg9_290",xe="_manageLink_14kg9_416",_e="_segment_14kg9_442",Se="_segmentActive_14kg9_443",je="_targetPrimary_14kg9_477",ve="_monoMuted_14kg9_481",ke="_copyIconButton_14kg9_485",fe="_routingBadge_14kg9_510",Ce="_studioStateBadge_14kg9_524",be="_studioState_running_14kg9_539",we="_studioState_paused_14kg9_545",Ne="_studioState_edit_14kg9_551",Ie="_studioState_unknown_14kg9_557",Le="_toggleBtn_14kg9_564",Ae="_disconnected_14kg9_579",Me="_disconnectedActions_14kg9_596",Pe="_btn_14kg9_603",Be="_activity_active_14kg9_621",$e="_activity_stale_14kg9_622",Ee="_activity_unknown_14kg9_623",Te="_killBtn_14kg9_647",He="_emptyRow_14kg9_671",o={page:It,card:Lt,topologyCard:At,topologyDisconnected:Mt,topologyHeader:Pt,topologyIntro:Bt,topologyNetwork:$t,topologyLinks:Et,topologyLink:Tt,topologyLink_agent:Ht,topologyLink_studio:Dt,topologyGrid:Ot,topologyColumn:Ut,topologyColumnHeader:Ft,topologyColumnHeaderSpacer:zt,topologyCount:Gt,topologyList:Wt,topologyListCentered:qt,topologyNode:Vt,topologyNodeTitle:Kt,topologyNodeMeta:Yt,topologyNodeSubtle:Rt,topologyState:Xt,topologyEmpty:Jt,topologyOverflow:Qt,topologyOverflowButton:Zt,topologyServerColumn:te,topologyServer:ee,topologyServerIcon:oe,topologyServerBody:ne,topologyServerTitle:se,topologyServerMeta:ie,routingSummaryCompact:ce,disabled:ae,cardHeader:le,cardHint:re,clearButton:de,serverGrid:ge,statusRow:ue,metaItem:pe,table:he,tableWrap:ye,routingSummary:me,manageLink:xe,segment:_e,segmentActive:Se,targetPrimary:je,monoMuted:ve,copyIconButton:ke,routingBadge:fe,studioStateBadge:Ce,studioState_running:be,studioState_paused:we,studioState_edit:Ne,studioState_unknown:Ie,toggleBtn:Le,disconnected:Ae,disconnectedActions:Me,btn:Pe,activity_active:Be,activity_stale:$e,activity_unknown:Ee,killBtn:Te,emptyRow:He},V=5;function De(e){return e?Date.now()-e<3e4?"active":"stale":"unknown"}function Oe(e,s){return e==="active"?s("connection.topology.active","Active"):e==="stale"?s("connection.topology.stale","Stale"):s("connection.topology.unknown","Unknown")}function Ue(e){return e.length>10?e.slice(0,10):e}function Z(e,s){return e.replace("{count}",String(s))}function Fe(e,s,n){const i=e.studioState??"unknown",r={edit:s("connection.targets.studioState.edit","Edit"),running:s("connection.targets.studioState.running","Running"),paused:s("connection.targets.studioState.paused","Paused"),unknown:s("connection.targets.studioState.unknown","Unknown")},y=e.studioStateSource==="thread"?s("connection.targets.studioState.source.thread","WEPPY play command"):e.studioStateSource==="pluginConnection"?s("connection.targets.studioState.source.pluginConnection","Studio Play/Test connection"):e.studioStateSource==="runService"?s("connection.targets.studioState.source.runService","Studio RunService"):s("connection.targets.studioState.source.unknown","Unknown source"),g=e.studioStateUpdatedAt?n(e.studioStateUpdatedAt):s("connection.targets.studioState.updatedUnknown","not reported");return{state:i,label:r[i],tooltip:`${y} · ${g}`}}function ze(e,s){return e.length!==s.length?!1:e.every((n,i)=>{const r=s[i];return r!==void 0&&n.id===r.id&&n.side===r.side&&Math.abs(n.x1-r.x1)<.5&&Math.abs(n.y1-r.y1)<.5&&Math.abs(n.x2-r.x2)<.5&&Math.abs(n.y2-r.y2)<.5})}function f(e,s,n){return{x:s-e.left,y:n-e.top}}function Ge(e,s,n,i){if(s.right<=n.left){const g=f(i,s.right,s.top+s.height/2),c=f(i,n.left,n.top+n.height/2);return{id:e,side:"agent",x1:g.x,y1:g.y,x2:c.x,y2:c.y}}if(s.bottom<=n.top){const g=f(i,s.left+s.width/2,s.bottom),c=f(i,n.left+n.width/2,n.top);return{id:e,side:"agent",x1:g.x,y1:g.y,x2:c.x,y2:c.y}}const r=f(i,s.left+s.width/2,s.top),y=f(i,n.left+n.width/2,n.bottom);return{id:e,side:"agent",x1:r.x,y1:r.y,x2:y.x,y2:y.y}}function We(e,s,n,i){if(n.right<=s.left){const g=f(i,s.left,s.top+s.height/2),c=f(i,n.right,n.top+n.height/2);return{id:e,side:"studio",x1:g.x,y1:g.y,x2:c.x,y2:c.y}}if(n.bottom<=s.top){const g=f(i,s.left+s.width/2,s.top),c=f(i,n.left+n.width/2,n.bottom);return{id:e,side:"studio",x1:g.x,y1:g.y,x2:c.x,y2:c.y}}const r=f(i,s.left+s.width/2,s.bottom),y=f(i,n.left+n.width/2,n.top);return{id:e,side:"studio",x1:r.x,y1:r.y,x2:y.x,y2:y.y}}function qe({agents:e,isDisconnected:s,pinnedTargetClientId:n,priorityTarget:i,status:r,studioRoutingMode:y,studioTargets:g,t:c,timeAgo:N,onCopySelector:C,onManageRouting:A}){const[m,M]=d.useState(!1),[I,$]=d.useState(!1),[H,b]=d.useState([]),u=d.useRef(null),j=d.useRef(null),w=d.useRef(new Map),S=d.useRef(new Map),h=y==="pinned"?c("connection.routing.pinned","Manual: Pinned Studio"):c("connection.routing.recentPriority","Automatic: Recent priority"),z=s?"offline":"online",k=d.useMemo(()=>m?e:e.slice(0,V),[e,m]),D=Math.max(0,e.length-k.length),v=d.useMemo(()=>I?g:g.slice(0,V),[g,I]),E=Math.max(0,g.length-v.length),Y=[o.topologyList,k.length<=1?o.topologyListCentered:""].filter(Boolean).join(" "),R=[o.topologyList,v.length<=1?o.topologyListCentered:""].filter(Boolean).join(" "),O=d.useCallback(a=>x=>{if(x){w.current.set(a,x);return}w.current.delete(a)},[]),l=d.useCallback(a=>x=>{if(x){S.current.set(a,x);return}S.current.delete(a)},[]),L=d.useCallback(()=>{const a=u.current,x=j.current;if(!a||!x){b([]);return}const _=a.getBoundingClientRect(),P=x.getBoundingClientRect(),q=[];k.forEach(B=>{const G=w.current.get(B.instanceId);G&&q.push(Ge(`agent-${B.instanceId}`,G.getBoundingClientRect(),P,_))}),v.forEach(B=>{const G=S.current.get(B.clientId);G&&q.push(We(`studio-${B.clientId}`,G.getBoundingClientRect(),P,_))}),b(B=>ze(B,q)?B:q)},[k,v]);return d.useLayoutEffect(()=>{L();const a=[u.current,j.current,...k.map(_=>w.current.get(_.instanceId)),...v.map(_=>S.current.get(_.clientId))].filter(_=>_!=null);if(window.addEventListener("resize",L),typeof ResizeObserver>"u")return()=>{window.removeEventListener("resize",L)};const x=new ResizeObserver(L);return a.forEach(_=>x.observe(_)),()=>{window.removeEventListener("resize",L),x.disconnect()}},[L,k,v]),t.jsxs("section",{className:`${o.topologyCard} ${s?o.topologyDisconnected:""}`,"aria-label":c("connection.topology.ariaLabel","Connection topology"),children:[t.jsxs("div",{className:o.topologyHeader,children:[t.jsxs("div",{children:[t.jsx("div",{className:o.cardHeader,children:c("connection.topology.title","Connection topology")}),t.jsx("p",{className:o.topologyIntro,children:c("connection.topology.description","AI agents and Roblox Studio windows connect through one WEPPY MCP Server.")})]}),t.jsx(it,{to:"/controls?section=studio-routing",className:o.manageLink,onClick:A,children:c("connection.routing.manage","Manage routing")})]}),t.jsxs("div",{className:o.topologyNetwork,ref:u,children:[t.jsx("svg",{"aria-hidden":"true",className:o.topologyLinks,"data-testid":"topology-connection-lines",focusable:"false",children:H.map(a=>t.jsx("line",{className:`${o.topologyLink} ${o[`topologyLink_${a.side}`]}`,"data-side":a.side,vectorEffect:"non-scaling-stroke",x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2},a.id))}),t.jsxs("div",{className:o.topologyGrid,children:[t.jsxs("div",{className:o.topologyColumn,children:[t.jsxs("div",{className:o.topologyColumnHeader,children:[t.jsx(ht,{size:15,"aria-hidden":"true"}),t.jsx("span",{children:c("connection.agents.title","AI Agents")}),t.jsx("span",{className:o.topologyCount,children:e.length})]}),t.jsxs("div",{className:Y,children:[e.length>0?k.map(a=>{const x=De(a.lastSeen),_=a.aiClientName??Ue(a.instanceId),P=a.lastSeen??a.lastCommandAt??a.connectedAt;return t.jsxs("div",{className:o.topologyNode,ref:O(a.instanceId),children:[t.jsxs("div",{className:o.topologyNodeTitle,children:[t.jsx("span",{className:o[`activity_${x}`]}),t.jsx("strong",{children:_}),t.jsx("span",{className:o.topologyState,children:Oe(x,c)})]}),t.jsx("div",{className:o.topologyNodeMeta,children:P?`${c("connection.topology.lastActivity","Last activity")} ${N(P)}`:c("connection.topology.noActivity","No recent activity")})]},a.instanceId)}):t.jsx("div",{className:o.topologyEmpty,children:c("connection.agents.none","No agents connected")}),e.length>V?t.jsxs("div",{className:o.topologyOverflow,children:[D>0?t.jsx("span",{children:Z(c("connection.topology.moreAgents","+{count} more agents"),D)}):t.jsx("span",{children:c("connection.topology.allAgentsVisible","All agents visible")}),t.jsx("button",{type:"button",className:o.topologyOverflowButton,"aria-label":m?c("connection.topology.showLessAgents","Show less AI agents"):c("connection.topology.showAllAgents","Show all AI agents"),onClick:()=>M(a=>!a),children:m?c("connection.topology.showLess","Show less"):c("connection.topology.showAll","Show all")})]}):null]})]}),t.jsxs("div",{className:o.topologyServerColumn,children:[t.jsx("div",{className:o.topologyColumnHeaderSpacer,"aria-hidden":"true"}),t.jsxs("div",{className:`${o.topologyNode} ${o.topologyServer}`,ref:j,children:[t.jsx("div",{className:o.topologyServerIcon,children:t.jsx(mt,{size:18,"aria-hidden":"true"})}),t.jsxs("div",{className:o.topologyServerBody,children:[t.jsx("div",{className:o.topologyServerTitle,children:c("connection.topology.serverTitle","MCP Server")}),t.jsx(ot,{status:z}),t.jsxs("div",{className:o.topologyServerMeta,children:[r!=null&&r.version?`v${r.version}`:c("connection.topology.versionUnknown","Version unknown"),r!=null&&r.sessionId?` · ${c("connection.server.session","Session")} ${r.sessionId.slice(0,8)}`:""]}),t.jsx("div",{className:o.routingSummaryCompact,children:t.jsx("span",{className:o.routingBadge,children:h})})]})]})]}),t.jsxs("div",{className:o.topologyColumn,children:[t.jsxs("div",{className:o.topologyColumnHeader,children:[t.jsx(ct,{size:15,"aria-hidden":"true"}),t.jsx("span",{children:c("connection.targets.title","Studio Targets")}),t.jsx("span",{className:o.topologyCount,children:g.length})]}),t.jsxs("div",{className:R,children:[g.length>0?v.map(a=>{const x=y==="pinned"&&n===a.clientId,_=y==="recentPriority"&&(i==null?void 0:i.clientId)===a.clientId,P=Fe(a,c,N);return t.jsxs("div",{className:o.topologyNode,ref:l(a.clientId),children:[t.jsxs("div",{className:o.topologyNodeTitle,children:[t.jsx("span",{className:o.targetPrimary,children:a.targetAlias}),t.jsx(W,{text:c("connection.targets.copyTargetAlias","Copy Studio ID"),children:t.jsx("button",{type:"button",className:o.copyIconButton,"aria-label":c("connection.targets.copyTargetAlias","Copy Studio ID"),onClick:()=>C(a.targetAlias,"target_alias"),children:t.jsx(K,{size:13,"aria-hidden":"true"})})}),x?t.jsx("span",{className:o.routingBadge,children:c("connection.routing.pinnedBadge","Pinned")}):_?t.jsx("span",{className:o.routingBadge,children:c("connection.routing.priorityBadge","Priority")}):null,t.jsx(W,{text:P.tooltip,children:t.jsx("span",{className:`${o.studioStateBadge} ${o[`studioState_${P.state}`]}`,children:P.label})})]}),t.jsxs("div",{className:o.topologyNodeMeta,children:[t.jsx("span",{children:a.placeName??c("connection.topology.placeUnknown","Place unknown")}),a.placeId!==void 0?` · ${a.placeId}`:""]}),t.jsxs("div",{className:o.topologyNodeSubtle,children:[a.connectionState," · ",c("connection.targets.lastSeen","Last Seen")," ",N(a.lastSeen)]})]},a.clientId)}):t.jsx("div",{className:o.topologyEmpty,children:c("connection.targets.none","No Studio targets connected. Open Roblox Studio and connect WEPPY Plugin.")}),g.length>V?t.jsxs("div",{className:o.topologyOverflow,children:[E>0?t.jsx("span",{children:Z(c("connection.topology.moreStudios","+{count} more studios"),E)}):t.jsx("span",{children:c("connection.topology.allStudiosVisible","All studios visible")}),t.jsx("button",{type:"button",className:o.topologyOverflowButton,"aria-label":I?c("connection.topology.showLessStudios","Show less Studio targets"):c("connection.topology.showAllStudios","Show all Studio targets"),onClick:()=>$(a=>!a),children:I?c("connection.topology.showLess","Show less"):c("connection.topology.showAll","Show all")})]}):null]})]})]})]})]})}function T(e,s){const n=Math.max(0,Math.floor((Date.now()-e)/1e3));return n<60?`${n}${s("connection.time.secondsAgo","s ago")}`:n<3600?`${Math.floor(n/60)}${s("connection.time.minutesAgo","m ago")}`:`${Math.floor(n/3600)}${s("connection.time.hoursAgo","h ago")}`}function Ve(e){return e?Date.now()-e<3e4?"active":"stale":"unknown"}function Ke(e,s){const n=e.studioState??"unknown",i={edit:s("connection.targets.studioState.edit","Edit"),running:s("connection.targets.studioState.running","Running"),paused:s("connection.targets.studioState.paused","Paused"),unknown:s("connection.targets.studioState.unknown","Unknown")},r=e.studioStateSource==="thread"?s("connection.targets.studioState.source.thread","WEPPY play command"):e.studioStateSource==="pluginConnection"?s("connection.targets.studioState.source.pluginConnection","Studio Play/Test connection"):e.studioStateSource==="runService"?s("connection.targets.studioState.source.runService","Studio RunService"):s("connection.targets.studioState.source.unknown","Unknown source"),y=e.studioStateUpdatedAt?T(e.studioStateUpdatedAt,s):s("connection.targets.studioState.updatedUnknown","not reported"),g=e.playtestMode&&e.playtestMode!=="unknown"?` · ${e.playtestMode}`:"";return{state:n,label:`${i[n]}${g}`,tooltip:`${r} · ${y}`}}function no(){const{t:e}=et(),{trackEvent:s}=at(),{status:n,connectionInfo:i,studioRouting:r,connectionLog:y,level:g,clearConnectionLog:c,killAgent:N}=Nt(),{show:C}=lt(),[A,m]=d.useState(!0),[M,I]=d.useState(!1),[$,H]=d.useState(!1),[b,u]=d.useState(null),[j,w]=d.useState(!1),S=gt(n==null?void 0:n.uptime),h=g==="disconnected",z=h?"offline":"online",k=(r==null?void 0:r.studioRoutingMode)??(n==null?void 0:n.studioRoutingMode)??"recentPriority",D=(r==null?void 0:r.pinnedTargetClientId)??(n==null?void 0:n.pinnedTargetClientId)??null,v=rt((r==null?void 0:r.targets)??(n==null?void 0:n.pluginClients)??[],k,D),E=(r==null?void 0:r.priorityTarget)??v[0],Y=async()=>{if(b){w(!0);try{await N(b.instanceId),C(e("connection.agents.killed","Agent killed"),"success"),u(null)}catch{C(e("connection.agents.killFailed","Failed to kill agent"),"error")}finally{w(!1)}}},R=async()=>{H(!0);try{await c(),C(e("toast.clearSuccess","Cleared successfully"),"success"),I(!1)}catch{C(e("toast.clearFailed","Failed to clear data"),"error")}finally{H(!1)}},O=async(l,L)=>{try{await navigator.clipboard.writeText(l),C(e("connection.targets.copied","Copied value"),"success"),s("dashboard_click_event",{click_target:`connection_copy_${L}`,page:"connection"})}catch{C(e("connection.targets.copyFailed","Failed to copy value"),"error")}};return t.jsxs("div",{className:o.page,children:[t.jsx(dt,{title:e("page.connection.title","Connection"),description:e("page.connection.description","Inspect MCP server, AI agent, Studio plugin, and connection log status."),helpTopicId:"connection",helpState:{connectionLevel:g}}),t.jsx(qe,{agents:(i==null?void 0:i.mcpInstances)??[],isDisconnected:h,pinnedTargetClientId:D,priorityTarget:E,status:n??null,studioRoutingMode:k,studioTargets:v,t:e,timeAgo:l=>T(l,e),onCopySelector:O,onManageRouting:()=>s("dashboard_click_event",{click_target:"connection_manage_routing",page:"connection"})}),t.jsxs("div",{className:o.card,children:[t.jsx("div",{className:o.cardHeader,children:e("connection.server.title","Server Status")}),h?t.jsxs("div",{className:o.disconnected,children:[t.jsx("h3",{children:e("level.l0.title")}),t.jsx("p",{children:e("level.l0.message")}),t.jsx("p",{children:e("common.reconnecting")}),t.jsxs("div",{className:o.disconnectedActions,children:[t.jsx("button",{className:o.btn,onClick:()=>window.location.reload(),children:e("connection.reconnect","Reconnect")}),t.jsx("button",{className:o.btn,onClick:()=>{window.location.hash="#/settings"},children:e("connection.checkSettings","Check Settings")})]})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:o.statusRow,children:t.jsx(ot,{status:z})}),t.jsxs("dl",{className:o.serverGrid,children:[(n==null?void 0:n.version)&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(p,{label:e("connection.server.version","Version"),tooltip:e("connection.server.version.tooltip","Installed MCP server version")})}),t.jsx("dd",{children:t.jsx(X,{text:e("connection.server.version.tooltip","Installed MCP server version"),children:`v${n.version}`})})]}),(n==null?void 0:n.pid)!=null&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(p,{label:e("connection.server.pid","PID"),tooltip:e("connection.server.pid.tooltip","Operating system process identifier")})}),t.jsx("dd",{children:n.pid})]}),(n==null?void 0:n.uptime)!=null&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(p,{label:e("connection.server.uptime","Uptime"),tooltip:e("connection.server.uptime.tooltip","Time elapsed since the MCP server started")})}),t.jsx("dd",{children:ut(S??n.uptime)})]}),(n==null?void 0:n.sessionId)&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(p,{label:e("connection.server.session","Session"),tooltip:e("connection.server.session.tooltip","Current MCP session identifier")})}),t.jsx("dd",{children:n.sessionId.slice(0,8)})]}),(i==null?void 0:i.serverExecutable)&&t.jsxs(t.Fragment,{children:[t.jsx("dt",{children:t.jsx(p,{label:e("connection.server.exec","Exec"),tooltip:e("connection.server.exec.tooltip","Executable path used to launch the MCP server")})}),t.jsx("dd",{children:i.serverExecutable})]})]})]})]}),t.jsxs("div",{className:`${o.card} ${h?o.disabled:""}`,children:[t.jsxs("div",{className:o.cardHeader,children:[t.jsxs("span",{children:[e("connection.agents.title","AI Agents")," ","(",(i==null?void 0:i.mcpInstanceCount)??0,")"]}),t.jsx("button",{className:o.toggleBtn,onClick:()=>m(l=>!l),"aria-label":A?e("common.collapse","Collapse"):e("common.expand","Expand"),children:A?"▾":"▸"})]}),A&&t.jsxs("table",{className:o.table,children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:e("connection.agents.name","Agent")}),t.jsx("th",{children:t.jsx(p,{label:e("connection.server.pid","PID"),tooltip:e("connection.server.pid.tooltip","Operating system process identifier")})}),t.jsx("th",{children:t.jsx(p,{label:e("connection.agents.projectRoot","Project Root"),tooltip:e("connection.agents.projectRoot.tooltip","Authoritative project root for sync ownership")})}),t.jsx("th",{children:e("connection.agents.connected","Connected")}),t.jsx("th",{children:t.jsx(p,{label:e("connection.agents.lastSeen","Last Seen"),tooltip:e("connection.agents.lastSeen.tooltip","Most recent heartbeat or activity from this agent")})}),t.jsx("th",{children:t.jsx(p,{label:e("connection.agents.lastCommand","Last Command"),tooltip:e("connection.agents.lastCommand.tooltip","Most recent tool call executed by this agent")})}),t.jsx("th",{})]})}),t.jsx("tbody",{children:i!=null&&i.mcpInstances&&i.mcpInstances.length>0?i.mcpInstances.map(l=>t.jsxs("tr",{children:[t.jsxs("td",{children:[t.jsx("span",{className:o[`activity_${Ve(l.lastSeen)}`]}),l.aiClientName??e("connection.agents.unknown","Unknown")]}),t.jsx("td",{children:l.pid}),t.jsx("td",{children:l.projectRoot??l.cwd??e("connection.agents.projectRoot.unresolved","Unresolved")}),t.jsx("td",{children:T(l.connectedAt,e)}),t.jsx("td",{children:l.lastSeen?T(l.lastSeen,e):"-"}),t.jsx("td",{children:l.lastCommandAt?T(l.lastCommandAt,e):"-"}),t.jsx("td",{children:!l.isServer&&t.jsx("button",{className:o.killBtn,onClick:()=>{s("dashboard_click_event",{click_target:"connection_kill_agent",page:"connection"}),u({instanceId:l.instanceId,name:l.aiClientName??l.instanceId.slice(0,8)})},children:e("connection.agents.kill","Kill")})})]},l.instanceId)):t.jsx("tr",{children:t.jsx("td",{colSpan:7,className:o.emptyRow,children:e("connection.agents.none","No agents connected")})})})]})]}),t.jsxs("div",{className:`${o.card} ${h?o.disabled:""}`,children:[t.jsxs("div",{className:o.cardHeader,children:[e("connection.targets.title","Studio Targets")," ","(",v.length,")"]}),t.jsx("p",{className:o.cardHint,children:e("connection.targets.help","When multiple Studio windows are connected, tell the agent to use Studio ID studio-1 to choose one.")}),t.jsx("div",{className:o.tableWrap,children:t.jsxs("table",{className:o.table,children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{children:t.jsx(p,{label:e("connection.targets.target","Studio ID"),tooltip:e("connection.targets.target.tooltip","Short name for this Roblox Studio window")})}),t.jsx("th",{children:e("connection.targets.place","Place")}),t.jsx("th",{children:t.jsx(p,{label:e("connection.targets.placeId","Place ID"),tooltip:e("connection.targets.placeId.tooltip","Roblox Place ID for this Studio window")})}),t.jsx("th",{children:t.jsx(p,{label:e("connection.targets.clientId","Connection ID"),tooltip:e("connection.targets.clientId.tooltip","Full connection ID for diagnostics. Usually use Studio ID instead.")})}),t.jsx("th",{children:t.jsx(p,{label:e("connection.targets.studioState","Studio State"),tooltip:e("connection.targets.studioState.tooltip","Current edit/play runtime state reported by this Studio window")})}),t.jsx("th",{children:t.jsx(p,{label:e("connection.targets.session","Session"),tooltip:e("connection.targets.session.tooltip","Command channel state for this Studio target")})}),t.jsx("th",{children:t.jsx(p,{label:e("connection.targets.lastUsed","Last Used"),tooltip:e("connection.targets.lastUsed.tooltip","Most recent plugin-route request routed to this Studio target")})}),t.jsx("th",{children:t.jsx(p,{label:e("connection.targets.lastSeen","Last Seen"),tooltip:e("connection.targets.lastSeen.tooltip","Most recent heartbeat received from this Studio target")})}),t.jsx("th",{children:t.jsx(p,{label:e("connection.targets.version","Version"),tooltip:e("connection.targets.version.tooltip","Installed plugin version reported by Studio")})}),t.jsx("th",{children:t.jsx(p,{label:e("connection.targets.routing","Routing"),tooltip:e("connection.targets.routing.tooltip","Routing priority for requests without a named Studio target")})}),t.jsx("th",{children:t.jsx(p,{label:e("connection.targets.inFlight","In Flight"),tooltip:e("connection.targets.inFlight.tooltip","Active command request currently routed to this Studio target")})})]})}),t.jsx("tbody",{children:v.length>0?v.map(l=>{const L=l.clientId.slice(0,10),a=Ke(l,e);return t.jsxs("tr",{children:[t.jsxs("td",{children:[t.jsx("span",{className:o.monoMuted,title:l.clientId,children:l.targetAlias}),t.jsx(W,{text:e("connection.targets.copyTargetAlias","Copy Studio ID"),children:t.jsx("button",{type:"button",className:o.copyIconButton,"aria-label":e("connection.targets.copyTargetAlias","Copy Studio ID"),onClick:()=>O(l.targetAlias,"target_alias"),children:t.jsx(K,{size:13,"aria-hidden":"true"})})})]}),t.jsx("td",{children:t.jsx("span",{className:o.targetPrimary,children:l.placeName??"-"})}),t.jsxs("td",{children:[l.placeId??"-",l.placeId!==void 0?t.jsx(W,{text:e("connection.targets.copyPlaceId","Copy Place ID"),children:t.jsx("button",{type:"button",className:o.copyIconButton,"aria-label":e("connection.targets.copyPlaceId","Copy Place ID"),onClick:()=>O(String(l.placeId),"place_id"),children:t.jsx(K,{size:13,"aria-hidden":"true"})})}):null]}),t.jsxs("td",{children:[t.jsx("span",{className:o.monoMuted,title:l.clientId,children:L}),t.jsx(W,{text:e("connection.targets.copyClientId","Copy Connection ID"),children:t.jsx("button",{type:"button",className:o.copyIconButton,"aria-label":e("connection.targets.copyClientId","Copy Connection ID"),onClick:()=>O(l.clientId,"client_id"),children:t.jsx(K,{size:13,"aria-hidden":"true"})})})]}),t.jsx("td",{children:t.jsx(X,{text:a.tooltip,children:t.jsx("span",{className:`${o.studioStateBadge} ${o[`studioState_${a.state}`]}`,children:a.label})})}),t.jsx("td",{children:l.connectionState}),t.jsx("td",{children:l.lastRoutedAt?T(l.lastRoutedAt,e):"-"}),t.jsx("td",{children:T(l.lastSeen,e)}),t.jsx("td",{children:l.pluginVersion??"-"}),t.jsx("td",{children:k==="pinned"&&D===l.clientId?t.jsx("span",{className:o.routingBadge,children:e("connection.routing.pinnedBadge","Pinned")}):k==="recentPriority"&&(E==null?void 0:E.clientId)===l.clientId?t.jsx("span",{className:o.routingBadge,children:e("connection.routing.priorityBadge","Priority")}):t.jsx("span",{className:o.monoMuted,children:"-"})}),t.jsx("td",{children:l.inFlightRequestId?l.inFlightRequestId.slice(0,8):"-"})]},l.clientId)}):t.jsx("tr",{children:t.jsx("td",{colSpan:11,className:o.emptyRow,children:e("connection.targets.none","No Studio targets connected. Open Roblox Studio and connect WEPPY Plugin.")})})})]})})]}),t.jsxs("div",{className:`${o.card} ${h?o.disabled:""}`,children:[t.jsxs("div",{className:o.cardHeader,children:[t.jsx("span",{children:e("connection.log.title","Connection Log")}),t.jsx("button",{className:o.clearButton,onClick:()=>{s("dashboard_click_event",{click_target:"connection_clear_log",page:"connection"}),I(!0)},children:e("common.clear","Clear")})]}),t.jsx(bt,{entries:y})]}),t.jsx(J,{open:M,title:e("connection.clear.title","Clear connection log?"),message:e("connection.clear.message","This permanently removes the stored connection log for the current project."),cancelLabel:e("common.cancel","Cancel"),confirmLabel:e("common.clear","Clear"),loading:$,onCancel:()=>!$&&I(!1),onConfirm:R}),t.jsx(J,{open:!!b,title:e("connection.agents.kill.title","Kill agent?"),message:`"${b==null?void 0:b.name}" 프로세스를 강제 종료합니다. 해당 에이전트의 진행 중인 작업이 중단됩니다.`,cancelLabel:e("common.cancel","Cancel"),confirmLabel:e("connection.agents.kill","Kill"),loading:j,onCancel:()=>!j&&u(null),onConfirm:Y})]})}export{no as Component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as T,j as e,f as W,l as q,d as _,r,v as z,w as Q,x as X,a as H,s as K,y as Z,k as A,N as J}from"./index-CJJYSnlB.js";import{P as ee}from"./PageHeader-DwlcGnaB.js";import{I as N}from"./InfoLabel-DwsCwdUw.js";import{s as g}from"./ConfirmModal.module-NrFlfTWy.js";import{T as B}from"./TooltipText-LAwR8aaI.js";import{s as o,u as te}from"./useSettings-CYVeWZ0i.js";import{C as M}from"./copy-DwoEPqC3.js";function k(n,a){return e.jsxs("div",{className:g.pathBlock,children:[e.jsx("span",{className:g.pathLabel,children:n}),e.jsx("code",{className:g.pathCode,children:a})]})}function oe(n){const t=/^[A-Z]:\\/i.test(n)||n.includes("\\")?"\\":"/";return`${n.replace(/[\\/]+$/,"")}${t}weppy-project-sync`}function ne({open:n,step:a,selectedProjectRoot:t,studioConnected:c,loading:d=!1,errorMessage:p=null,onClose:s,onPick:h,onApply:j}){const{t:l}=T();if(!n)return null;const S=t?oe(t):"";return e.jsx("div",{className:g.backdrop,onClick:d?void 0:s,role:"presentation",children:e.jsxs("div",{className:g.modal,onClick:y=>y.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"project-root-change-modal-title",children:[e.jsx("h2",{id:"project-root-change-modal-title",className:g.title,children:a==="initial"?l("header.projectRootModal.initial.title","Change project root"):l("header.projectRootModal.confirm.title","Confirm new project root")}),e.jsx("p",{className:g.message,children:a==="initial"?c?l("header.projectRootModal.initial.body.connected","MCP will switch to the new project root and resync current Studio contents into the new target."):l("header.projectRootModal.initial.body.disconnected","MCP will switch to the new project root and use the new folder as the next sync target."):l("header.projectRootModal.confirm.body","Review the selected project folder before applying.")}),e.jsxs("div",{className:g.bodyGrid,children:[a==="initial"?e.jsxs(e.Fragment,{children:[k(l("header.projectRootModal.initial.nextSyncRoot","New sync target after selection"),l("header.projectRootModal.initial.nextSyncRoot.placeholder","<selected project folder>/weppy-project-sync")),e.jsxs("ul",{className:g.warningList,children:[c?e.jsxs(e.Fragment,{children:[e.jsx("li",{children:l("header.projectRootModal.initial.warningStop","Current sync stops immediately.")}),e.jsx("li",{children:l("header.projectRootModal.initial.warningFreshSync","The current Studio contents will be used to build a fresh full sync in the new target.")})]}):e.jsx("li",{children:l("header.projectRootModal.initial.warningDeferredSync","If Studio is not connected, full resync starts the next time the plugin connects.")}),e.jsx("li",{children:l("header.projectRootModal.initial.warningNoMove","Old sync folders are not moved automatically.")})]})]}):e.jsxs(e.Fragment,{children:[k(l("header.projectRootModal.confirm.projectRoot","Selected project folder"),t??""),k(l("header.projectRootModal.confirm.syncRoot","New sync target"),S),e.jsx("p",{className:g.message,children:l("header.projectRootModal.confirm.warningNoMove","Existing sync folders are not moved automatically.")})]}),p?e.jsx("p",{className:`${g.message} ${g.errorMessage}`,children:p}):null]}),e.jsxs("div",{className:g.actions,children:[e.jsx("button",{className:g.cancelButton,onClick:s,disabled:d,children:l("header.projectRootModal.cancel","Cancel")}),a==="initial"?e.jsx("button",{className:g.confirmButton,onClick:h,disabled:d,children:d?"...":l("header.projectRootModal.pick","Choose folder")}):e.jsx("button",{className:g.confirmButton,onClick:j,disabled:d||!t,children:d?"...":l("header.projectRootModal.apply","Apply change")})]})]})})}function F(n,a){if(n&&typeof n=="object"&&"message"in n&&typeof n.message=="string"){const t=n.message.trim();if(t.length>0)return t}return a}function se(){const{level:n,status:a}=W(),{t}=T(),{show:c}=q(),{search:d}=_(),p=r.useRef(null),[s,h]=r.useState(null),[j,l]=r.useState(!1),[S,y]=r.useState(null),[m,R]=r.useState(null),[f,v]=r.useState(!1),[w,L]=r.useState(!1),[I,x]=r.useState(null),i=r.useMemo(()=>new URLSearchParams(d).get("section")==="project-root",[d]),C=r.useCallback(async()=>{if(n==="disconnected"){h(null),l(!1);return}l(!1);try{const u=await z();h(u)}catch{h(null),l(!0)}},[n]);r.useEffect(()=>{C()},[C,a==null?void 0:a.connectedClients,a==null?void 0:a.sessionId]),r.useEffect(()=>{var u,P,O;i&&((P=(u=p.current)==null?void 0:u.scrollIntoView)==null||P.call(u,{block:"start",behavior:"smooth"}),(O=p.current)==null||O.focus())},[i]);const b=(u=!1)=>{!u&&(f||w)||(y(null),R(null),x(null))},E=()=>{n==="disconnected"||!s||(x(null),R(null),y("initial"))},Y=async()=>{v(!0),x(null);try{const u=await X();if(u.cancelled||!u.projectRoot){b(!0);return}R(u.projectRoot),y("confirm")}catch(u){x(F(u,t("header.projectRootModal.error","Failed to change project root")))}finally{v(!1)}},G=async()=>{if(m){L(!0),x(null);try{const u=await Q(m);h(u),l(!1),b(!0)}catch(u){const P=F(u,t("header.projectRootModal.error","Failed to change project root"));x(P),c(P,"error")}finally{L(!1)}}},$=j?t("controls.projectRoot.unavailable","Project root unavailable"):t("common.loading","Loading..."),V=n==="disconnected"||!s;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{id:"controls-project-root",ref:p,tabIndex:-1,className:o.card,children:[e.jsxs("div",{className:o.cardHeader,children:[e.jsx(N,{label:t("controls.projectRoot.title","Project Root"),tooltip:t("controls.projectRoot.title.tooltip","Authoritative project root and sync target used by MCP.")}),e.jsx(B,{text:t("controls.projectRoot.live.tooltip","Changing this updates MCP runtime state immediately after confirmation."),children:e.jsx("span",{className:`${o.headerBadge} ${o.headerBadgeLive}`,children:t("settings.general.liveApply","Live Apply")})})]}),e.jsxs("dl",{className:o.controlGrid,children:[e.jsx("dt",{children:t("controls.projectRoot.projectRoot","Project Root")}),e.jsx("dd",{children:(s==null?void 0:s.projectRoot)??$}),e.jsx("dt",{children:t("controls.projectRoot.syncRoot","Sync Root")}),e.jsx("dd",{children:(s==null?void 0:s.projectSyncRoot)??$})]}),e.jsx("p",{className:o.controlHint,children:t("controls.projectRoot.hint","Use this only when MCP should write sync data under a different project folder. Existing sync folders are not moved automatically.")}),e.jsx("button",{type:"button",className:o.actionBtn,disabled:V,onClick:E,children:t("header.changeProjectRoot","Change Project Root")})]}),e.jsx(ne,{open:S!==null,step:S??"initial",selectedProjectRoot:m,studioConnected:n==="studioConnected",loading:f||w,errorMessage:I,onClose:b,onPick:Y,onApply:G})]})}function ie(n){if(!n)return null;const a=n.placeName?n.placeId!==void 0?`${n.placeName} · ${n.placeId}`:n.placeName:n.placeId!==void 0?String(n.placeId):null;return a?`${n.targetAlias} · ${a}`:n.targetAlias}function U(n,a){const t=Math.max(0,Math.floor((Date.now()-n)/1e3));return t<60?`${t}${a("connection.time.secondsAgo","s ago")}`:t<3600?`${Math.floor(t/60)}${a("connection.time.minutesAgo","m ago")}`:`${Math.floor(t/3600)}${a("connection.time.hoursAgo","h ago")}`}function ae(){const{status:n,level:a}=W(),{t}=T(),{show:c}=q(),{search:d}=_(),p=r.useRef(null),[s,h]=r.useState(null),[j,l]=r.useState(null),S=r.useMemo(()=>new URLSearchParams(d).get("section")==="studio-routing",[d]),y=r.useCallback(async()=>{if(a==="disconnected"){h(null);return}try{const i=await H.get("/api/dashboard/studio-routing");h(i)}catch{h(null)}},[a]);r.useEffect(()=>{y()},[y,n==null?void 0:n.connectedClients,n==null?void 0:n.sessionId]),r.useEffect(()=>{var i,C,b;S&&((C=(i=p.current)==null?void 0:i.scrollIntoView)==null||C.call(i,{block:"start",behavior:"smooth"}),(b=p.current)==null||b.focus())},[S]);const m=(s==null?void 0:s.studioRoutingMode)??(n==null?void 0:n.studioRoutingMode)??"recentPriority",R=(s==null?void 0:s.pinnedTargetClientId)??(n==null?void 0:n.pinnedTargetClientId)??null,f=K((s==null?void 0:s.targets)??(n==null?void 0:n.pluginClients)??[],m,R),v=(s==null?void 0:s.priorityTarget)??Z(f,m,R),w=ie(v),L=new Set(f.filter(i=>i.placeId!==void 0).map(i=>i.placeId).filter((i,C,b)=>b.filter(E=>E===i).length>1)),I=async i=>{l(i.studioRoutingMode==="pinned"?i.pinnedTargetClientId??"pinned":"recentPriority");try{const C=await H.patch("/api/dashboard/studio-routing",i);h(C)}catch{c(t("connection.routing.updateFailed","Failed to update routing target"),"error")}finally{l(null)}},x=async i=>{try{await navigator.clipboard.writeText(i),c(t("connection.targets.copied","Copied value"),"success")}catch{c(t("connection.targets.copyFailed","Failed to copy value"),"error")}};return e.jsxs("div",{id:"controls-studio-routing",ref:p,tabIndex:-1,className:o.card,children:[e.jsx("div",{className:o.cardHeader,children:e.jsx(N,{label:t("controls.studioRouting.title","Studio Routing"),tooltip:t("controls.studioRouting.title.tooltip","Routing priority for MCP requests that do not name a Studio target.")})}),e.jsxs("div",{className:o.routingOverview,children:[e.jsxs("div",{className:o.routingOverviewCopy,children:[e.jsx("span",{className:o.routingEyebrow,children:t("controls.studioRouting.priorityTitle","Priority for requests without a named Studio target")}),e.jsx("strong",{children:m==="pinned"?t("connection.routing.pinned","Manual: Pinned Studio"):t("connection.routing.recentPriority","Automatic: Recent priority")}),e.jsx("p",{children:t("controls.studioRouting.priorityDescription","Explicit Studio ID, Connection ID, or Place ID requests bypass this priority setting and route to the named Studio.")})]}),e.jsxs("div",{className:o.priorityTargetSummary,children:[e.jsx("span",{children:t("controls.studioRouting.currentPriorityTarget","Current priority target")}),e.jsx("strong",{children:w??t("controls.studioRouting.noPriorityTarget","No connected Studio target")})]})]}),e.jsxs("div",{className:o.studioRoutingChoiceControl,role:"group","aria-label":t("connection.routing.priorityControl","Priority mode for requests without a named Studio target"),children:[e.jsxs("button",{type:"button",className:m==="recentPriority"?o.segmentActive:o.segment,disabled:j!==null,"aria-pressed":m==="recentPriority",onClick:()=>I({studioRoutingMode:"recentPriority"}),children:[e.jsx("span",{children:t("connection.routing.recentPriority","Automatic: Recent priority")}),e.jsx("small",{children:t("controls.studioRouting.recentPriorityHelp","Requests the highest-priority active Studio, based on recent routed commands and connection order.")})]}),e.jsxs("button",{type:"button",className:m==="pinned"?o.segmentActive:o.segment,disabled:!f.length||j!==null,"aria-pressed":m==="pinned",onClick:()=>I({studioRoutingMode:"pinned"}),children:[e.jsx("span",{children:t("connection.routing.pinned","Manual: Pinned Studio")}),e.jsx("small",{children:t("controls.studioRouting.pinnedHelp","Requests the pinned Studio unless the agent names a Studio ID, Connection ID, or Place ID.")})]})]}),L.size>0?e.jsx("p",{className:o.routingWarning,children:t("controls.studioRouting.duplicatePlaceWarning","More than one connected Studio window has the same Place ID. Ask the AI agent to use Studio ID for that place.")}):null,e.jsx("div",{className:o.tableWrap,children:e.jsxs("table",{className:o.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:t("connection.targets.routing","Routing")}),e.jsx("th",{children:t("connection.targets.target","Studio ID")}),e.jsx("th",{children:t("connection.targets.place","Place")}),e.jsx("th",{children:t("connection.targets.placeId","Place ID")}),e.jsx("th",{children:t("connection.targets.lastUsed","Last Used")}),e.jsx("th",{children:t("connection.targets.lastSeen","Last Seen")}),e.jsx("th",{children:t("connection.targets.clientId","Connection ID")})]})}),e.jsx("tbody",{children:f.length>0?f.map(i=>e.jsxs("tr",{children:[e.jsx("td",{children:m==="pinned"&&R===i.clientId?e.jsx("span",{className:o.routingBadge,children:t("connection.routing.pinnedBadge","Pinned")}):m==="recentPriority"&&(v==null?void 0:v.clientId)===i.clientId?e.jsx("span",{className:o.routingBadge,children:t("connection.routing.priorityBadge","Priority")}):m==="pinned"?e.jsx("button",{type:"button",className:o.setPriorityTargetButton,disabled:j!==null,onClick:()=>I({studioRoutingMode:"pinned",pinnedTargetClientId:i.clientId}),children:t("connection.routing.setPriorityTarget","Set as priority target")}):null}),e.jsxs("td",{children:[e.jsx("span",{className:o.monoMuted,title:i.clientId,children:i.targetAlias}),e.jsx(A,{text:t("connection.targets.copyTargetAlias","Copy Studio ID"),children:e.jsx("button",{type:"button",className:o.copyIconButton,"aria-label":t("connection.targets.copyTargetAlias","Copy Studio ID"),onClick:()=>x(i.targetAlias),children:e.jsx(M,{size:13,"aria-hidden":"true"})})})]}),e.jsx("td",{children:i.placeName??"-"}),e.jsxs("td",{children:[i.placeId??"-",i.placeId!==void 0?e.jsx(A,{text:t("connection.targets.copyPlaceId","Copy Place ID"),children:e.jsx("button",{type:"button",className:o.copyIconButton,"aria-label":t("connection.targets.copyPlaceId","Copy Place ID"),onClick:()=>x(String(i.placeId)),children:e.jsx(M,{size:13,"aria-hidden":"true"})})}):null]}),e.jsx("td",{children:i.lastRoutedAt?U(i.lastRoutedAt,t):"-"}),e.jsx("td",{children:U(i.lastSeen,t)}),e.jsxs("td",{children:[e.jsx("span",{className:o.monoMuted,title:i.clientId,children:i.clientId.slice(0,10)}),e.jsx(A,{text:t("connection.targets.copyClientId","Copy Connection ID"),children:e.jsx("button",{type:"button",className:o.copyIconButton,"aria-label":t("connection.targets.copyClientId","Copy Connection ID"),onClick:()=>x(i.clientId),children:e.jsx(M,{size:13,"aria-hidden":"true"})})})]})]},i.clientId)):e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:o.emptyRow,children:t("connection.targets.none","No Studio targets connected. Open Roblox Studio and connect WEPPY Plugin.")})})})]})})]})}const le=["debug","info","warn","error"];function D({checked:n,onChange:a,testId:t,ariaLabel:c}){return e.jsxs("label",{className:o.toggleSwitch,"data-testid":t,children:[e.jsx("input",{type:"checkbox",className:o.toggleInput,checked:n,"aria-label":c,onChange:d=>a(d.target.checked)}),e.jsx("span",{className:o.toggleTrack,"aria-hidden":"true",children:e.jsx("span",{className:o.toggleThumb})})]})}function re({settings:n,updateHotSetting:a}){const{t}=T(),[c,d]=r.useState(null),p=r.useCallback(async(s,h)=>{await a(s,h),d(s),setTimeout(()=>d(j=>j===s?null:j),2e3)},[a]);return e.jsxs("div",{className:o.card,children:[e.jsxs("div",{className:o.cardHeader,children:[e.jsx(N,{label:t("settings.general.title","General Settings"),tooltip:t("settings.general.title.tooltip","Hot settings that apply immediately when changed.")}),e.jsx(B,{text:t("settings.general.liveApply.tooltip","Changes in this section are applied immediately without a separate save button."),children:e.jsx("span",{className:`${o.headerBadge} ${o.headerBadgeLive}`,children:t("settings.general.liveApply","Live Apply")})})]}),n?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:o.settingRow,children:[e.jsx("span",{className:o.settingLabel,children:e.jsx(N,{label:t("settings.general.logLevel","Log Level"),tooltip:t("settings.general.logLevel.tooltip","Sets how much detail WEPPY Dashboard writes to its logs.")})}),e.jsxs("div",{className:o.settingControl,children:[e.jsx("select",{className:o.select,value:n.hot.LOG_LEVEL,onChange:s=>p("LOG_LEVEL",s.target.value),children:le.map(s=>e.jsx("option",{value:s,children:s},s))}),c==="LOG_LEVEL"&&e.jsx("span",{className:o.savedIndicator,children:t("settings.general.applied")})]})]}),e.jsxs("div",{className:o.settingRow,children:[e.jsx("span",{className:o.settingLabel,children:e.jsx(N,{label:t("settings.general.localHistory","Tool History Recording"),tooltip:t("settings.general.localHistory.tooltip","Stores local tool execution history for the WEPPY Dashboard history views.")})}),e.jsxs("div",{className:o.settingControl,children:[e.jsx("span",{className:`${o.savedIndicator} ${c==="ENABLE_LOCAL_HISTORY"?"":o.savedIndicatorHidden}`,children:t("settings.general.applied","Applied")}),e.jsx(D,{checked:n.hot.ENABLE_LOCAL_HISTORY,ariaLabel:t("settings.general.localHistory","Tool History Recording"),testId:"settings-toggle-enable-local-history",onChange:s=>p("ENABLE_LOCAL_HISTORY",s)})]})]}),e.jsxs("div",{className:o.settingRow,children:[e.jsx("span",{className:o.settingLabel,children:e.jsx(N,{label:t("settings.general.localStatistics","Tool Statistics Collection"),tooltip:t("settings.general.localStatistics.tooltip","Aggregates local usage statistics for WEPPY Dashboard reporting.")})}),e.jsxs("div",{className:o.settingControl,children:[e.jsx("span",{className:`${o.savedIndicator} ${c==="ENABLE_LOCAL_STATISTICS"?"":o.savedIndicatorHidden}`,children:t("settings.general.applied","Applied")}),e.jsx(D,{checked:n.hot.ENABLE_LOCAL_STATISTICS,ariaLabel:t("settings.general.localStatistics","Tool Statistics Collection"),testId:"settings-toggle-enable-local-statistics",onChange:s=>p("ENABLE_LOCAL_STATISTICS",s)})]})]}),e.jsxs("div",{className:o.settingRow,children:[e.jsx("span",{className:o.settingLabel,children:e.jsx(N,{label:t("settings.general.contextCapture","Context Capture"),tooltip:t("settings.general.contextCapture.tooltip","When enabled, WEPPY Dashboard records structured execution context for changelog and playtest views.")})}),e.jsxs("div",{className:o.settingControl,children:[e.jsx("span",{className:`${o.savedIndicator} ${c==="ENABLE_CONTEXT_CAPTURE"?"":o.savedIndicatorHidden}`,children:t("settings.general.applied","Applied")}),e.jsx(D,{checked:n.hot.ENABLE_CONTEXT_CAPTURE,ariaLabel:t("settings.general.contextCapture","Context Capture"),testId:"settings-toggle-enable-context-capture",onChange:s=>p("ENABLE_CONTEXT_CAPTURE",s)})]})]}),e.jsxs("div",{className:o.settingRow,children:[e.jsx("span",{className:o.settingLabel,children:e.jsx(N,{label:t("settings.general.requestTimeout","Action Timeout"),tooltip:t("settings.general.requestTimeout.tooltip","Maximum time WEPPY Dashboard waits for an action before it fails.")})}),e.jsxs("div",{className:o.settingControl,children:[e.jsx("input",{type:"number",className:o.numberInput,value:n.hot.REQUEST_TIMEOUT,min:1e3,max:12e4,step:1e3,onChange:s=>{const h=parseInt(s.target.value,10);isNaN(h)||p("REQUEST_TIMEOUT",h)}}),e.jsx(B,{text:t("settings.general.requestTimeout.unit.tooltip","Action timeout is measured in milliseconds."),children:e.jsx("span",{className:o.unit,children:t("settings.general.requestTimeout.unit","ms")})}),c==="REQUEST_TIMEOUT"&&e.jsx("span",{className:o.savedIndicator,children:t("settings.general.applied","Applied")})]})]})]}):e.jsx("div",{className:o.loading,children:t("settings.unavailable")})]})}function je(){const{t:n}=T(),{search:a}=_(),{settings:t,updateHotSetting:c,loading:d}=te();return r.useMemo(()=>new URLSearchParams(a).get("section"),[a])==="license"?e.jsx(J,{to:"/settings?section=license",replace:!0}):d?e.jsx("div",{className:o.page,children:e.jsx("div",{className:o.loading,children:n("common.loading")})}):e.jsxs("div",{className:o.page,children:[e.jsx(ee,{title:n("page.controls.title","Controls"),description:n("page.controls.description","Manage project root, Studio routing, and MCP live settings."),helpTopicId:"controls"}),e.jsx(se,{}),e.jsx(ae,{}),e.jsx(re,{settings:t,updateHotSetting:c})]})}export{je as Component};
|
|
1
|
+
import{u as T,j as e,f as W,l as q,d as _,r,v as z,w as Q,x as X,a as H,s as K,y as Z,k as A,N as J}from"./index-CnXGGM07.js";import{P as ee}from"./PageHeader-Bfy2f-GH.js";import{I as N}from"./InfoLabel-BAhsgLcj.js";import{s as g}from"./ConfirmModal.module-D1aZY2bQ.js";import{T as B}from"./TooltipText-CGH7dKN6.js";import{s as o,u as te}from"./useSettings-DKMlodE_.js";import{C as M}from"./copy-D-nSZB9j.js";function k(n,a){return e.jsxs("div",{className:g.pathBlock,children:[e.jsx("span",{className:g.pathLabel,children:n}),e.jsx("code",{className:g.pathCode,children:a})]})}function oe(n){const t=/^[A-Z]:\\/i.test(n)||n.includes("\\")?"\\":"/";return`${n.replace(/[\\/]+$/,"")}${t}weppy-project-sync`}function ne({open:n,step:a,selectedProjectRoot:t,studioConnected:c,loading:d=!1,errorMessage:p=null,onClose:s,onPick:h,onApply:j}){const{t:l}=T();if(!n)return null;const S=t?oe(t):"";return e.jsx("div",{className:g.backdrop,onClick:d?void 0:s,role:"presentation",children:e.jsxs("div",{className:g.modal,onClick:y=>y.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"project-root-change-modal-title",children:[e.jsx("h2",{id:"project-root-change-modal-title",className:g.title,children:a==="initial"?l("header.projectRootModal.initial.title","Change project root"):l("header.projectRootModal.confirm.title","Confirm new project root")}),e.jsx("p",{className:g.message,children:a==="initial"?c?l("header.projectRootModal.initial.body.connected","MCP will switch to the new project root and resync current Studio contents into the new target."):l("header.projectRootModal.initial.body.disconnected","MCP will switch to the new project root and use the new folder as the next sync target."):l("header.projectRootModal.confirm.body","Review the selected project folder before applying.")}),e.jsxs("div",{className:g.bodyGrid,children:[a==="initial"?e.jsxs(e.Fragment,{children:[k(l("header.projectRootModal.initial.nextSyncRoot","New sync target after selection"),l("header.projectRootModal.initial.nextSyncRoot.placeholder","<selected project folder>/weppy-project-sync")),e.jsxs("ul",{className:g.warningList,children:[c?e.jsxs(e.Fragment,{children:[e.jsx("li",{children:l("header.projectRootModal.initial.warningStop","Current sync stops immediately.")}),e.jsx("li",{children:l("header.projectRootModal.initial.warningFreshSync","The current Studio contents will be used to build a fresh full sync in the new target.")})]}):e.jsx("li",{children:l("header.projectRootModal.initial.warningDeferredSync","If Studio is not connected, full resync starts the next time the plugin connects.")}),e.jsx("li",{children:l("header.projectRootModal.initial.warningNoMove","Old sync folders are not moved automatically.")})]})]}):e.jsxs(e.Fragment,{children:[k(l("header.projectRootModal.confirm.projectRoot","Selected project folder"),t??""),k(l("header.projectRootModal.confirm.syncRoot","New sync target"),S),e.jsx("p",{className:g.message,children:l("header.projectRootModal.confirm.warningNoMove","Existing sync folders are not moved automatically.")})]}),p?e.jsx("p",{className:`${g.message} ${g.errorMessage}`,children:p}):null]}),e.jsxs("div",{className:g.actions,children:[e.jsx("button",{className:g.cancelButton,onClick:s,disabled:d,children:l("header.projectRootModal.cancel","Cancel")}),a==="initial"?e.jsx("button",{className:g.confirmButton,onClick:h,disabled:d,children:d?"...":l("header.projectRootModal.pick","Choose folder")}):e.jsx("button",{className:g.confirmButton,onClick:j,disabled:d||!t,children:d?"...":l("header.projectRootModal.apply","Apply change")})]})]})})}function F(n,a){if(n&&typeof n=="object"&&"message"in n&&typeof n.message=="string"){const t=n.message.trim();if(t.length>0)return t}return a}function se(){const{level:n,status:a}=W(),{t}=T(),{show:c}=q(),{search:d}=_(),p=r.useRef(null),[s,h]=r.useState(null),[j,l]=r.useState(!1),[S,y]=r.useState(null),[m,R]=r.useState(null),[f,v]=r.useState(!1),[w,L]=r.useState(!1),[I,x]=r.useState(null),i=r.useMemo(()=>new URLSearchParams(d).get("section")==="project-root",[d]),C=r.useCallback(async()=>{if(n==="disconnected"){h(null),l(!1);return}l(!1);try{const u=await z();h(u)}catch{h(null),l(!0)}},[n]);r.useEffect(()=>{C()},[C,a==null?void 0:a.connectedClients,a==null?void 0:a.sessionId]),r.useEffect(()=>{var u,P,O;i&&((P=(u=p.current)==null?void 0:u.scrollIntoView)==null||P.call(u,{block:"start",behavior:"smooth"}),(O=p.current)==null||O.focus())},[i]);const b=(u=!1)=>{!u&&(f||w)||(y(null),R(null),x(null))},E=()=>{n==="disconnected"||!s||(x(null),R(null),y("initial"))},Y=async()=>{v(!0),x(null);try{const u=await X();if(u.cancelled||!u.projectRoot){b(!0);return}R(u.projectRoot),y("confirm")}catch(u){x(F(u,t("header.projectRootModal.error","Failed to change project root")))}finally{v(!1)}},G=async()=>{if(m){L(!0),x(null);try{const u=await Q(m);h(u),l(!1),b(!0)}catch(u){const P=F(u,t("header.projectRootModal.error","Failed to change project root"));x(P),c(P,"error")}finally{L(!1)}}},$=j?t("controls.projectRoot.unavailable","Project root unavailable"):t("common.loading","Loading..."),V=n==="disconnected"||!s;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{id:"controls-project-root",ref:p,tabIndex:-1,className:o.card,children:[e.jsxs("div",{className:o.cardHeader,children:[e.jsx(N,{label:t("controls.projectRoot.title","Project Root"),tooltip:t("controls.projectRoot.title.tooltip","Authoritative project root and sync target used by MCP.")}),e.jsx(B,{text:t("controls.projectRoot.live.tooltip","Changing this updates MCP runtime state immediately after confirmation."),children:e.jsx("span",{className:`${o.headerBadge} ${o.headerBadgeLive}`,children:t("settings.general.liveApply","Live Apply")})})]}),e.jsxs("dl",{className:o.controlGrid,children:[e.jsx("dt",{children:t("controls.projectRoot.projectRoot","Project Root")}),e.jsx("dd",{children:(s==null?void 0:s.projectRoot)??$}),e.jsx("dt",{children:t("controls.projectRoot.syncRoot","Sync Root")}),e.jsx("dd",{children:(s==null?void 0:s.projectSyncRoot)??$})]}),e.jsx("p",{className:o.controlHint,children:t("controls.projectRoot.hint","Use this only when MCP should write sync data under a different project folder. Existing sync folders are not moved automatically.")}),e.jsx("button",{type:"button",className:o.actionBtn,disabled:V,onClick:E,children:t("header.changeProjectRoot","Change Project Root")})]}),e.jsx(ne,{open:S!==null,step:S??"initial",selectedProjectRoot:m,studioConnected:n==="studioConnected",loading:f||w,errorMessage:I,onClose:b,onPick:Y,onApply:G})]})}function ie(n){if(!n)return null;const a=n.placeName?n.placeId!==void 0?`${n.placeName} · ${n.placeId}`:n.placeName:n.placeId!==void 0?String(n.placeId):null;return a?`${n.targetAlias} · ${a}`:n.targetAlias}function U(n,a){const t=Math.max(0,Math.floor((Date.now()-n)/1e3));return t<60?`${t}${a("connection.time.secondsAgo","s ago")}`:t<3600?`${Math.floor(t/60)}${a("connection.time.minutesAgo","m ago")}`:`${Math.floor(t/3600)}${a("connection.time.hoursAgo","h ago")}`}function ae(){const{status:n,level:a}=W(),{t}=T(),{show:c}=q(),{search:d}=_(),p=r.useRef(null),[s,h]=r.useState(null),[j,l]=r.useState(null),S=r.useMemo(()=>new URLSearchParams(d).get("section")==="studio-routing",[d]),y=r.useCallback(async()=>{if(a==="disconnected"){h(null);return}try{const i=await H.get("/api/dashboard/studio-routing");h(i)}catch{h(null)}},[a]);r.useEffect(()=>{y()},[y,n==null?void 0:n.connectedClients,n==null?void 0:n.sessionId]),r.useEffect(()=>{var i,C,b;S&&((C=(i=p.current)==null?void 0:i.scrollIntoView)==null||C.call(i,{block:"start",behavior:"smooth"}),(b=p.current)==null||b.focus())},[S]);const m=(s==null?void 0:s.studioRoutingMode)??(n==null?void 0:n.studioRoutingMode)??"recentPriority",R=(s==null?void 0:s.pinnedTargetClientId)??(n==null?void 0:n.pinnedTargetClientId)??null,f=K((s==null?void 0:s.targets)??(n==null?void 0:n.pluginClients)??[],m,R),v=(s==null?void 0:s.priorityTarget)??Z(f,m,R),w=ie(v),L=new Set(f.filter(i=>i.placeId!==void 0).map(i=>i.placeId).filter((i,C,b)=>b.filter(E=>E===i).length>1)),I=async i=>{l(i.studioRoutingMode==="pinned"?i.pinnedTargetClientId??"pinned":"recentPriority");try{const C=await H.patch("/api/dashboard/studio-routing",i);h(C)}catch{c(t("connection.routing.updateFailed","Failed to update routing target"),"error")}finally{l(null)}},x=async i=>{try{await navigator.clipboard.writeText(i),c(t("connection.targets.copied","Copied value"),"success")}catch{c(t("connection.targets.copyFailed","Failed to copy value"),"error")}};return e.jsxs("div",{id:"controls-studio-routing",ref:p,tabIndex:-1,className:o.card,children:[e.jsx("div",{className:o.cardHeader,children:e.jsx(N,{label:t("controls.studioRouting.title","Studio Routing"),tooltip:t("controls.studioRouting.title.tooltip","Routing priority for MCP requests that do not name a Studio target.")})}),e.jsxs("div",{className:o.routingOverview,children:[e.jsxs("div",{className:o.routingOverviewCopy,children:[e.jsx("span",{className:o.routingEyebrow,children:t("controls.studioRouting.priorityTitle","Priority for requests without a named Studio target")}),e.jsx("strong",{children:m==="pinned"?t("connection.routing.pinned","Manual: Pinned Studio"):t("connection.routing.recentPriority","Automatic: Recent priority")}),e.jsx("p",{children:t("controls.studioRouting.priorityDescription","Explicit Studio ID, Connection ID, or Place ID requests bypass this priority setting and route to the named Studio.")})]}),e.jsxs("div",{className:o.priorityTargetSummary,children:[e.jsx("span",{children:t("controls.studioRouting.currentPriorityTarget","Current priority target")}),e.jsx("strong",{children:w??t("controls.studioRouting.noPriorityTarget","No connected Studio target")})]})]}),e.jsxs("div",{className:o.studioRoutingChoiceControl,role:"group","aria-label":t("connection.routing.priorityControl","Priority mode for requests without a named Studio target"),children:[e.jsxs("button",{type:"button",className:m==="recentPriority"?o.segmentActive:o.segment,disabled:j!==null,"aria-pressed":m==="recentPriority",onClick:()=>I({studioRoutingMode:"recentPriority"}),children:[e.jsx("span",{children:t("connection.routing.recentPriority","Automatic: Recent priority")}),e.jsx("small",{children:t("controls.studioRouting.recentPriorityHelp","Requests the highest-priority active Studio, based on recent routed commands and connection order.")})]}),e.jsxs("button",{type:"button",className:m==="pinned"?o.segmentActive:o.segment,disabled:!f.length||j!==null,"aria-pressed":m==="pinned",onClick:()=>I({studioRoutingMode:"pinned"}),children:[e.jsx("span",{children:t("connection.routing.pinned","Manual: Pinned Studio")}),e.jsx("small",{children:t("controls.studioRouting.pinnedHelp","Requests the pinned Studio unless the agent names a Studio ID, Connection ID, or Place ID.")})]})]}),L.size>0?e.jsx("p",{className:o.routingWarning,children:t("controls.studioRouting.duplicatePlaceWarning","More than one connected Studio window has the same Place ID. Ask the AI agent to use Studio ID for that place.")}):null,e.jsx("div",{className:o.tableWrap,children:e.jsxs("table",{className:o.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:t("connection.targets.routing","Routing")}),e.jsx("th",{children:t("connection.targets.target","Studio ID")}),e.jsx("th",{children:t("connection.targets.place","Place")}),e.jsx("th",{children:t("connection.targets.placeId","Place ID")}),e.jsx("th",{children:t("connection.targets.lastUsed","Last Used")}),e.jsx("th",{children:t("connection.targets.lastSeen","Last Seen")}),e.jsx("th",{children:t("connection.targets.clientId","Connection ID")})]})}),e.jsx("tbody",{children:f.length>0?f.map(i=>e.jsxs("tr",{children:[e.jsx("td",{children:m==="pinned"&&R===i.clientId?e.jsx("span",{className:o.routingBadge,children:t("connection.routing.pinnedBadge","Pinned")}):m==="recentPriority"&&(v==null?void 0:v.clientId)===i.clientId?e.jsx("span",{className:o.routingBadge,children:t("connection.routing.priorityBadge","Priority")}):m==="pinned"?e.jsx("button",{type:"button",className:o.setPriorityTargetButton,disabled:j!==null,onClick:()=>I({studioRoutingMode:"pinned",pinnedTargetClientId:i.clientId}),children:t("connection.routing.setPriorityTarget","Set as priority target")}):null}),e.jsxs("td",{children:[e.jsx("span",{className:o.monoMuted,title:i.clientId,children:i.targetAlias}),e.jsx(A,{text:t("connection.targets.copyTargetAlias","Copy Studio ID"),children:e.jsx("button",{type:"button",className:o.copyIconButton,"aria-label":t("connection.targets.copyTargetAlias","Copy Studio ID"),onClick:()=>x(i.targetAlias),children:e.jsx(M,{size:13,"aria-hidden":"true"})})})]}),e.jsx("td",{children:i.placeName??"-"}),e.jsxs("td",{children:[i.placeId??"-",i.placeId!==void 0?e.jsx(A,{text:t("connection.targets.copyPlaceId","Copy Place ID"),children:e.jsx("button",{type:"button",className:o.copyIconButton,"aria-label":t("connection.targets.copyPlaceId","Copy Place ID"),onClick:()=>x(String(i.placeId)),children:e.jsx(M,{size:13,"aria-hidden":"true"})})}):null]}),e.jsx("td",{children:i.lastRoutedAt?U(i.lastRoutedAt,t):"-"}),e.jsx("td",{children:U(i.lastSeen,t)}),e.jsxs("td",{children:[e.jsx("span",{className:o.monoMuted,title:i.clientId,children:i.clientId.slice(0,10)}),e.jsx(A,{text:t("connection.targets.copyClientId","Copy Connection ID"),children:e.jsx("button",{type:"button",className:o.copyIconButton,"aria-label":t("connection.targets.copyClientId","Copy Connection ID"),onClick:()=>x(i.clientId),children:e.jsx(M,{size:13,"aria-hidden":"true"})})})]})]},i.clientId)):e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:o.emptyRow,children:t("connection.targets.none","No Studio targets connected. Open Roblox Studio and connect WEPPY Plugin.")})})})]})})]})}const le=["debug","info","warn","error"];function D({checked:n,onChange:a,testId:t,ariaLabel:c}){return e.jsxs("label",{className:o.toggleSwitch,"data-testid":t,children:[e.jsx("input",{type:"checkbox",className:o.toggleInput,checked:n,"aria-label":c,onChange:d=>a(d.target.checked)}),e.jsx("span",{className:o.toggleTrack,"aria-hidden":"true",children:e.jsx("span",{className:o.toggleThumb})})]})}function re({settings:n,updateHotSetting:a}){const{t}=T(),[c,d]=r.useState(null),p=r.useCallback(async(s,h)=>{await a(s,h),d(s),setTimeout(()=>d(j=>j===s?null:j),2e3)},[a]);return e.jsxs("div",{className:o.card,children:[e.jsxs("div",{className:o.cardHeader,children:[e.jsx(N,{label:t("settings.general.title","General Settings"),tooltip:t("settings.general.title.tooltip","Hot settings that apply immediately when changed.")}),e.jsx(B,{text:t("settings.general.liveApply.tooltip","Changes in this section are applied immediately without a separate save button."),children:e.jsx("span",{className:`${o.headerBadge} ${o.headerBadgeLive}`,children:t("settings.general.liveApply","Live Apply")})})]}),n?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:o.settingRow,children:[e.jsx("span",{className:o.settingLabel,children:e.jsx(N,{label:t("settings.general.logLevel","Log Level"),tooltip:t("settings.general.logLevel.tooltip","Sets how much detail WEPPY Dashboard writes to its logs.")})}),e.jsxs("div",{className:o.settingControl,children:[e.jsx("select",{className:o.select,value:n.hot.LOG_LEVEL,onChange:s=>p("LOG_LEVEL",s.target.value),children:le.map(s=>e.jsx("option",{value:s,children:s},s))}),c==="LOG_LEVEL"&&e.jsx("span",{className:o.savedIndicator,children:t("settings.general.applied")})]})]}),e.jsxs("div",{className:o.settingRow,children:[e.jsx("span",{className:o.settingLabel,children:e.jsx(N,{label:t("settings.general.localHistory","Tool History Recording"),tooltip:t("settings.general.localHistory.tooltip","Stores local tool execution history for the WEPPY Dashboard history views.")})}),e.jsxs("div",{className:o.settingControl,children:[e.jsx("span",{className:`${o.savedIndicator} ${c==="ENABLE_LOCAL_HISTORY"?"":o.savedIndicatorHidden}`,children:t("settings.general.applied","Applied")}),e.jsx(D,{checked:n.hot.ENABLE_LOCAL_HISTORY,ariaLabel:t("settings.general.localHistory","Tool History Recording"),testId:"settings-toggle-enable-local-history",onChange:s=>p("ENABLE_LOCAL_HISTORY",s)})]})]}),e.jsxs("div",{className:o.settingRow,children:[e.jsx("span",{className:o.settingLabel,children:e.jsx(N,{label:t("settings.general.localStatistics","Tool Statistics Collection"),tooltip:t("settings.general.localStatistics.tooltip","Aggregates local usage statistics for WEPPY Dashboard reporting.")})}),e.jsxs("div",{className:o.settingControl,children:[e.jsx("span",{className:`${o.savedIndicator} ${c==="ENABLE_LOCAL_STATISTICS"?"":o.savedIndicatorHidden}`,children:t("settings.general.applied","Applied")}),e.jsx(D,{checked:n.hot.ENABLE_LOCAL_STATISTICS,ariaLabel:t("settings.general.localStatistics","Tool Statistics Collection"),testId:"settings-toggle-enable-local-statistics",onChange:s=>p("ENABLE_LOCAL_STATISTICS",s)})]})]}),e.jsxs("div",{className:o.settingRow,children:[e.jsx("span",{className:o.settingLabel,children:e.jsx(N,{label:t("settings.general.contextCapture","Context Capture"),tooltip:t("settings.general.contextCapture.tooltip","When enabled, WEPPY Dashboard records structured execution context for changelog and playtest views.")})}),e.jsxs("div",{className:o.settingControl,children:[e.jsx("span",{className:`${o.savedIndicator} ${c==="ENABLE_CONTEXT_CAPTURE"?"":o.savedIndicatorHidden}`,children:t("settings.general.applied","Applied")}),e.jsx(D,{checked:n.hot.ENABLE_CONTEXT_CAPTURE,ariaLabel:t("settings.general.contextCapture","Context Capture"),testId:"settings-toggle-enable-context-capture",onChange:s=>p("ENABLE_CONTEXT_CAPTURE",s)})]})]}),e.jsxs("div",{className:o.settingRow,children:[e.jsx("span",{className:o.settingLabel,children:e.jsx(N,{label:t("settings.general.requestTimeout","Action Timeout"),tooltip:t("settings.general.requestTimeout.tooltip","Maximum time WEPPY Dashboard waits for an action before it fails.")})}),e.jsxs("div",{className:o.settingControl,children:[e.jsx("input",{type:"number",className:o.numberInput,value:n.hot.REQUEST_TIMEOUT,min:1e3,max:12e4,step:1e3,onChange:s=>{const h=parseInt(s.target.value,10);isNaN(h)||p("REQUEST_TIMEOUT",h)}}),e.jsx(B,{text:t("settings.general.requestTimeout.unit.tooltip","Action timeout is measured in milliseconds."),children:e.jsx("span",{className:o.unit,children:t("settings.general.requestTimeout.unit","ms")})}),c==="REQUEST_TIMEOUT"&&e.jsx("span",{className:o.savedIndicator,children:t("settings.general.applied","Applied")})]})]})]}):e.jsx("div",{className:o.loading,children:t("settings.unavailable")})]})}function je(){const{t:n}=T(),{search:a}=_(),{settings:t,updateHotSetting:c,loading:d}=te();return r.useMemo(()=>new URLSearchParams(a).get("section"),[a])==="license"?e.jsx(J,{to:"/settings?section=license",replace:!0}):d?e.jsx("div",{className:o.page,children:e.jsx("div",{className:o.loading,children:n("common.loading")})}):e.jsxs("div",{className:o.page,children:[e.jsx(ee,{title:n("page.controls.title","Controls"),description:n("page.controls.description","Manage project root, Studio routing, and MCP live settings."),helpTopicId:"controls"}),e.jsx(se,{}),e.jsx(ae,{}),e.jsx(re,{settings:t,updateHotSetting:c})]})}export{je as Component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as h,r as f,j as a,g as _}from"./index-CnXGGM07.js";import{B as x}from"./PageHeader-Bfy2f-GH.js";const j="_scope_1kz7c_1",m="_main_1kz7c_13",k="_label_1kz7c_20",I="_selectorLabel_1kz7c_28",w="_placeSelect_1kz7c_35",z="_name_1kz7c_48",A="_id_1kz7c_59",L="_scopeBadge_1kz7c_66",y="_copy_1kz7c_70",E="_note_1kz7c_82",n={scope:j,main:m,label:k,selectorLabel:I,placeSelect:w,name:z,id:A,scopeBadge:L,copy:y,note:E};function d(e,l){return l===null?null:e.places.find(c=>c.placeId===l)??null}function S(e){var l;return e.lastActivePlaceId!==null?e.lastActivePlaceId:((l=e.places[0])==null?void 0:l.placeId)??null}function B(e){return e.pluginConnected&&e.activePlaceId!==null?e.activePlaceId:S(e)}function U(e,l){if(e.pluginConnected&&e.activePlaceId!==null){const o=d(e,e.activePlaceId);return{label:l("placeScope.current.label","Current Place"),placeId:e.activePlaceId,placeName:e.activePlaceName??(o==null?void 0:o.placeName)??l("placeScope.unknownPlace","Unknown place"),badge:l("placeScope.live","Live"),live:!0,note:null}}const c=S(e),s=d(e,c);if(c!==null){const o=c===e.lastActivePlaceId?e.lastActivePlaceName:null;return{label:l("placeScope.lastActive.label","Last Active Place"),placeId:c,placeName:o??(s==null?void 0:s.placeName)??l("placeScope.unknownPlace","Unknown place"),badge:l("placeScope.pluginRequired","Plugin required"),live:!1,note:l("placeScope.pluginRequired.note","Connect WEPPY Plugin to confirm the live active place.")}}return{label:l("placeScope.noPlace.label","Place scope"),placeId:null,placeName:l("placeScope.noPlace.value","No place data available yet"),badge:l("placeScope.noPlace.badge","No place"),live:!1,note:l("placeScope.noPlace.note","Connect WEPPY Plugin and sync a place to create place-scoped data.")}}function q(e,l,c){const s=typeof l=="number"?d(e,l):null,o=B(e),t=(s==null?void 0:s.placeId)??o,r=d(e,t);if(t===null)return{label:c("placeScope.noPlace.label","Place scope"),placeId:null,placeName:c("placeScope.noPlace.value","No place data available yet"),badge:c("placeScope.noPlace.badge","No place"),live:!1,note:c("placeScope.noPlace.note","Connect WEPPY Plugin and sync a place to create place-scoped data.")};const u=e.pluginConnected&&e.activePlaceId===t,b=t===e.lastActivePlaceId?e.lastActivePlaceName:null;return{label:u?c("placeScope.current.label","Current Place"):c("placeScope.selected.label","Selected Place"),placeId:t,placeName:(r==null?void 0:r.placeName)??b??c("placeScope.unknownPlace","Unknown place"),badge:u?c("placeScope.live","Live"):c("placeScope.stored","Stored"),live:u,note:u?null:c("placeScope.selected.note","Showing stored data only. Studio routing is unchanged.")}}function F(e,l){switch(e){case"sync":return l("placeScope.surface.sync","Sync status and logs use this place.");case"changelog":return l("placeScope.surface.changelog","Changelog sessions use this place.");case"playtest":return l("placeScope.surface.playtest","Playtest reports use this place.");case"uiStudio":return l("placeScope.surface.uiStudio","UI captures and change history use this place.");case"tools":return l("placeScope.surface.tools","Tool history and statistics use this place.")}}function W({surface:e,selectable:l=!1,selectedPlaceId:c=null,onSelectedPlaceIdChange:s}){const{t:o}=h(),[t,r]=f.useState(null),[u,b]=f.useState(!0);if(f.useEffect(()=>{let i=!1;async function v(){try{const g=await _();i||r(g)}catch{i||r(null)}finally{i||b(!1)}}return v(),()=>{i=!0}},[]),f.useEffect(()=>{!l||!t||typeof c!="number"||d(t,c)||s==null||s(null)},[s,l,c,t]),u)return a.jsx("div",{className:n.scope,"aria-live":"polite",children:a.jsx("span",{className:n.label,children:o("placeScope.loading","Loading place scope...")})});if(!t)return a.jsx("div",{className:n.scope,"aria-live":"polite",children:a.jsx("span",{className:n.label,children:o("placeScope.unavailable","Place scope unavailable")})});const p=l?q(t,c,o):U(t,o),N=typeof p.placeId=="number"?String(p.placeId):"",P=l&&t.places.length>0;return a.jsxs("div",{className:n.scope,"aria-live":"polite",children:[a.jsxs("div",{className:n.main,children:[P?a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:n.selectorLabel,children:[a.jsx("span",{className:n.label,children:o("placeScope.selector.label","Place data")}),a.jsx("select",{className:n.placeSelect,value:N,onChange:i=>{const v=Number.parseInt(i.currentTarget.value,10);s==null||s(Number.isInteger(v)?v:null)},children:t.places.map(i=>a.jsxs("option",{value:i.placeId,children:[i.placeName," (",i.placeId,")"]},i.placeId))})]}),a.jsx("span",{className:n.label,children:p.label}),a.jsx("span",{className:n.name,children:p.placeName})]}):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:n.label,children:p.label}),a.jsx("span",{className:n.name,children:p.placeName})]}),p.placeId!==null?a.jsx("span",{className:n.id,children:p.placeId}):null,a.jsx(x,{variant:p.live?"success":"warning",shape:"pill",className:n.scopeBadge,children:p.badge})]}),a.jsxs("div",{className:n.copy,children:[a.jsx("span",{children:F(e,o)}),p.note?a.jsx("span",{className:n.note,children:p.note}):null]})]})}export{W as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._scope_1kz7c_1{display:flex;align-items:center;justify-content:space-between;gap:12px;min-width:0;padding:9px 12px;border:1px solid var(--border);border-radius:8px;background:var(--bg-secondary)}._main_1kz7c_13{display:flex;align-items:center;gap:8px;min-width:0}._label_1kz7c_20{flex:0 0 auto;color:var(--text-secondary);font-family:var(--font-label);font-size:11px;font-weight:600}._selectorLabel_1kz7c_28{display:flex;align-items:center;gap:8px;min-width:0}._placeSelect_1kz7c_35{min-width:180px;max-width:280px;height:30px;padding:0 28px 0 10px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-primary);color:var(--text-primary);font:inherit;font-size:12px}._name_1kz7c_48{min-width:0;color:var(--text-primary);font-family:var(--font-label);font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._id_1kz7c_59{flex:0 0 auto;color:var(--text-muted);font-family:var(--font-code);font-size:11px}._scopeBadge_1kz7c_66{flex:0 0 auto}._copy_1kz7c_70{display:flex;align-items:center;justify-content:flex-end;gap:8px;min-width:0;color:var(--text-secondary);font-size:12px;line-height:1.4;text-align:right}._note_1kz7c_82{color:var(--text-muted)}@media(max-width:720px){._scope_1kz7c_1{align-items:flex-start;flex-direction:column}._copy_1kz7c_70{align-items:flex-start;flex-direction:column;text-align:left}._selectorLabel_1kz7c_28{width:100%}._placeSelect_1kz7c_35{flex:1 1 auto;min-width:0;max-width:none}}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as _,r as x,j as e}from"./index-
|
|
1
|
+
import{u as _,r as x,j as e}from"./index-CnXGGM07.js";const N="_container_uv8oc_2",j="_header_uv8oc_10",v="_modeBtn_uv8oc_18",g="_modeBtnActive_uv8oc_33",w="_unifiedView_uv8oc_40",L="_diffLine_uv8oc_46",b="_lineNum_uv8oc_55",C="_lineContent_uv8oc_64",S="_lineAdded_uv8oc_68",V="_lineRemoved_uv8oc_73",B="_lineContext_uv8oc_78",$="_sideBySide_uv8oc_83",A="_sidePane_uv8oc_90",P="_sideLabel_uv8oc_100",R="_sideContent_uv8oc_112",D="_empty_uv8oc_117",s={container:N,header:j,modeBtn:v,modeBtnActive:g,unifiedView:w,diffLine:L,lineNum:b,lineContent:C,lineAdded:S,lineRemoved:V,lineContext:B,sideBySide:$,sidePane:A,sideLabel:P,sideContent:R,empty:D};function k(n,i){const l=n.split(`
|
|
2
2
|
`),d=i.split(`
|
|
3
3
|
`),a=[],f=Math.max(l.length,d.length);let t=0,r=0;for(;(t<l.length||r<d.length)&&(t<l.length&&r<d.length?l[t]===d[r]?(a.push({type:"context",content:l[t],lineNum:r+1}),t++,r++):(a.push({type:"removed",content:l[t],lineNum:t+1}),t++,t<l.length&&l[t]===d[r]?(a.push({type:"added",content:d[r],lineNum:r+1}),r++):r<d.length&&(a.push({type:"added",content:d[r],lineNum:r+1}),r++)):t<l.length?(a.push({type:"removed",content:l[t],lineNum:t+1}),t++):r<d.length&&(a.push({type:"added",content:d[r],lineNum:r+1}),r++),!(a.length>f*3)););return a}function O({before:n,after:i}){const{t:l}=_(),[d,a]=x.useState("unified"),f=typeof n=="string"?n:n!=null?JSON.stringify(n,null,2):"",t=typeof i=="string"?i:i!=null?JSON.stringify(i,null,2):"",r=x.useMemo(()=>k(f,t),[f,t]);if(!f&&!t)return e.jsx("div",{className:s.container,children:e.jsx("div",{className:s.empty,children:l("changelog.diff.empty","No diff available")})});if(!f&&t){const c=t.split(`
|
|
4
4
|
`);return e.jsx("div",{className:s.container,children:e.jsx("div",{className:s.unifiedView,children:c.map((u,m)=>e.jsxs("div",{className:`${s.diffLine} ${s.lineAdded}`,children:[e.jsx("span",{className:s.lineNum,children:m+1}),e.jsxs("span",{className:s.lineContent,children:["+ ",u]})]},m))})})}return e.jsxs("div",{className:s.container,children:[e.jsxs("div",{className:s.header,children:[e.jsx("button",{className:`${s.modeBtn} ${d==="unified"?s.modeBtnActive:""}`,onClick:()=>a("unified"),children:l("changelog.diff.unified","Unified")}),e.jsx("button",{className:`${s.modeBtn} ${d==="side-by-side"?s.modeBtnActive:""}`,onClick:()=>a("side-by-side"),children:l("changelog.diff.sideBySide","Side by Side")})]}),d==="unified"?e.jsx("div",{className:s.unifiedView,children:r.map((c,u)=>e.jsxs("div",{className:`${s.diffLine} ${c.type==="added"?s.lineAdded:c.type==="removed"?s.lineRemoved:s.lineContext}`,children:[e.jsx("span",{className:s.lineNum,children:c.lineNum??""}),e.jsxs("span",{className:s.lineContent,children:[c.type==="added"?"+ ":c.type==="removed"?"- ":" ",c.content]})]},u))}):e.jsxs("div",{className:s.sideBySide,children:[e.jsxs("div",{className:s.sidePane,children:[e.jsx("div",{className:s.sideLabel,children:l("changelog.diff.before","Before")}),e.jsx("div",{className:s.sideContent,children:f.split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r,k as e}from"./index-
|
|
1
|
+
import{j as r,k as e}from"./index-CnXGGM07.js";function s({label:t,tooltip:o}){return r.jsx(e,{text:o,children:t})}export{s as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,u as R,r as v,f as L,h as F,a as M,D as V}from"./index-CJJYSnlB.js";import{I as A}from"./InfoLabel-DwsCwdUw.js";import{P as U}from"./PageHeader-DwlcGnaB.js";import{S as z}from"./StatusBadge-CYejTjWf.js";import{T as O}from"./TooltipText-LAwR8aaI.js";import{G as X}from"./GameChangeDetail-sTt5o48Z.js";import{u as q,f as J}from"./useLiveUptime-DM28rhji.js";const K="_page_1xgxh_2",Q="_card_1xgxh_10",W="_cardHeader_1xgxh_17",Y="_disconnectCard_1xgxh_28",Z="_disconnectIcon_1xgxh_36",ee="_disconnectTitle_1xgxh_41",te="_disconnectMessage_1xgxh_48",se="_reconnectGuide_1xgxh_55",ne="_guideStep_1xgxh_64",ie="_stepNumber_1xgxh_72",ce="_reconnectIndicator_1xgxh_88",re="_reconnectDot_1xgxh_98",ae="_pulse_1xgxh_1",oe="_disconnectActions_1xgxh_112",le="_btn_1xgxh_118",de="_btnSecondary_1xgxh_134",me="_metricRow_1xgxh_152",ge="_metricGrid_1xgxh_158",he="_metricCard_1xgxh_164",xe="_metric_ok_1xgxh_174",ue="_metric_warn_1xgxh_179",ve="_metric_error_1xgxh_184",_e="_metricHeader_1xgxh_189",pe="_metricIcon_1xgxh_200",fe="_metricTitle_1xgxh_204",Ce="_metricValue_1xgxh_208",je="_metricSubtitle_1xgxh_215",we="_guideCard_1xgxh_225",Ne="_guideTitle_1xgxh_232",ye="_checklist_1xgxh_239",Te="_feedEmpty_1xgxh_263",Se="_feedList_1xgxh_270",Ie="_feedItem_1xgxh_278",be="_feedTime_1xgxh_291",ke="_feedIcon_1xgxh_298",Me="_feedSummary_1xgxh_304",De="_feedText_1xgxh_313",Be="_feedContext_1xgxh_321",He="_feedItemClickable_1xgxh_330",Ee="_feedChevron_1xgxh_338",Pe="_feedDetail_1xgxh_347",$e="_feedDetailPre_1xgxh_356",Re="_feedDetailText_1xgxh_365",Ge="_changelogSummary_1xgxh_372",Le="_changeTag_1xgxh_381",Fe="_tierBar_1xgxh_393",Ve="_tierBarTrack_1xgxh_399",Ae="_tierBarFillBasic_1xgxh_407",Ue="_tierBarFillPro_1xgxh_412",ze="_tierLabels_1xgxh_417",s={page:K,card:Q,cardHeader:W,disconnectCard:Y,disconnectIcon:Z,disconnectTitle:ee,disconnectMessage:te,reconnectGuide:se,guideStep:ne,stepNumber:ie,reconnectIndicator:ce,reconnectDot:re,pulse:ae,disconnectActions:oe,btn:le,btnSecondary:de,metricRow:me,metricGrid:ge,metricCard:he,metric_ok:xe,metric_warn:ue,metric_error:ve,metricHeader:_e,metricIcon:pe,metricTitle:fe,metricValue:Ce,metricSubtitle:je,guideCard:we,guideTitle:Ne,checklist:ye,feedEmpty:Te,feedList:Se,feedItem:Ie,feedTime:be,feedIcon:ke,feedSummary:Me,feedText:De,feedContext:Be,feedItemClickable:He,feedChevron:Ee,feedDetail:Pe,feedDetailPre:$e,feedDetailText:Re,changelogSummary:Ge,changeTag:Le,tierBar:Fe,tierBarTrack:Ve,tierBarFillBasic:Ae,tierBarFillPro:Ue,tierLabels:ze};function N({title:e,value:i,icon:c,subtitle:r,status:a,children:n}){const l=a?s[`metric_${a}`]:"";return t.jsxs("div",{className:`${s.metricCard} ${l}`,children:[t.jsxs("div",{className:s.metricHeader,children:[c&&t.jsx("span",{className:s.metricIcon,children:c}),t.jsx("span",{className:s.metricTitle,children:e})]}),t.jsx("div",{className:s.metricValue,children:i}),r&&t.jsx("div",{className:s.metricSubtitle,children:r}),n]})}function Oe(e){var c,r;const i=e==null?void 0:e.contextSummary;return(i==null?void 0:i.intent)??((r=(c=i==null?void 0:i.affectedAreas)==null?void 0:c[0])==null?void 0:r.label)??(i==null?void 0:i.testScenario)??null}function H({changes:e}){const{t:i}=R(),[c,r]=v.useState(null);return e.length===0?t.jsx("div",{className:s.feedEmpty,children:i("overview.feed.empty")}):t.jsx("div",{className:s.feedList,children:e.map((a,n)=>{const l=c===n,m=a.raw,g=m&&(m.before!=null||m.after!=null||m.details!=null),_=Oe(m);return t.jsxs("div",{children:[t.jsxs("div",{className:`${s.feedItem} ${g?s.feedItemClickable:""}`,onClick:()=>g&&r(l?null:n),children:[t.jsx("span",{className:s.feedTime,children:a.timestamp}),t.jsx("span",{className:s.feedIcon,children:a.icon}),t.jsxs("span",{className:s.feedText,children:[t.jsx("span",{className:s.feedSummary,children:a.summary}),_&&t.jsx("span",{className:s.feedContext,children:_})]}),g&&t.jsx("span",{className:s.feedChevron,children:l?"▴":"▾"})]}),l&&m&&t.jsx("div",{className:s.feedDetail,children:t.jsx(X,{change:m})})]},n)})})}const E=20;function G(e){return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}function P(){return G(new Date)}function $(e){switch(e){case"script":return"📝";case"instance":return"🧱";case"property":return"🎨";case"lighting":return"💡";case"terrain":return"⛰️";case"asset":return"📦";default:return"🔧"}}function Xe(){const{level:e,status:i}=L(),c=F(),[r,a]=v.useState(null),[n,l]=v.useState(null),[m,g]=v.useState(null),[_,h]=v.useState([]),y=v.useRef(null),T=v.useCallback(async()=>{try{const o=await M.get("/connection-info");a(o)}catch{a(null)}},[]),S=v.useCallback(async()=>{try{const o=await M.get("/api/dashboard/changelog/active");if(g(o),o.recentChanges&&o.recentChanges.length>0){const p=o.recentChanges.map(x=>({timestamp:x.timestamp?G(new Date(x.timestamp)):P(),icon:$(x.category),summary:x.summary,category:x.category,raw:x}));h(p)}}catch{g(null)}},[]),f=v.useCallback(async()=>{try{const o=await M.get("/sync/status");l(o)}catch{l(null)}},[]);return v.useEffect(()=>{e!=="disconnected"?(T(),S(),f()):(a(null),l(null),g(null));const o=new V;y.current=o,o.connect();const p=o.on("game_change",C=>{const u=C,j={timestamp:P(),icon:$(u.category),summary:u.summary,category:u.category};h(k=>{const w=[j,...k];return w.length>E?w.slice(0,E):w}),S()}),x=o.on("sync",C=>{const u=C;l(j=>({...j,state:u.status,...u.placeId?{placeId:u.placeId}:{}}))});return()=>{p(),x(),o.disconnect(),y.current=null}},[e,T,S,f]),{level:e,status:i,connectionInfo:r,syncStatus:n,changeSummary:m,recentChanges:_,tier:c}}function D(e){return e.scriptsModified+e.scriptsCreated+e.instancesCreated+e.instancesDeleted+e.instancesMoved+e.propertiesChanged+e.assetsInserted+(e.lightingChanged?1:0)+(e.terrainChanged?1:0)}function qe(e,i){switch(e){case"syncing":return i("status.syncing","Syncing");case"initializing":return i("status.initializing","Initializing");case"error":return i("status.error","Error");default:return i("status.idle","Idle")}}function Je(e){switch(e){case"syncing":return"ok";case"initializing":return"warn";case"error":return"error";default:return"ok"}}function b(e,i,c,r){return t.jsxs("div",{className:e.metricSubtitle,children:[t.jsx(A,{label:i,tooltip:c}),": ",r]},i)}function d(e,i){return t.jsx(O,{text:i,children:e})}function st(){var w,B;const{t:e}=R(),{level:i,status:c,connectionInfo:r,syncStatus:a,changeSummary:n,recentChanges:l}=Xe(),m=q(c==null?void 0:c.uptime),g=t.jsx(U,{title:e("page.overview.title","Overview"),description:e("page.overview.description","Check server, plugin, agent, sync, and recent game-change status in one place."),helpTopicId:"overview",helpState:{connectionLevel:i}});if(i==="disconnected")return t.jsxs("div",{className:s.page,children:[g,t.jsxs("div",{className:s.disconnectCard,children:[t.jsx("div",{className:s.disconnectIcon,children:"⚠️"}),t.jsx("h2",{className:s.disconnectTitle,children:e("overview.l0.title")}),t.jsx("p",{className:s.disconnectMessage,children:e("overview.l0.message")}),t.jsxs("div",{className:s.reconnectGuide,children:[t.jsxs("div",{className:s.guideStep,children:[t.jsx("span",{className:s.stepNumber,children:"1"}),t.jsx("span",{children:e("overview.l0.step1")})]}),t.jsxs("div",{className:s.guideStep,children:[t.jsx("span",{className:s.stepNumber,children:"2"}),t.jsx("span",{children:e("overview.l0.step2")})]})]}),t.jsxs("div",{className:s.reconnectIndicator,children:[t.jsx("span",{className:s.reconnectDot}),e("overview.l0.reconnecting")]}),t.jsxs("div",{className:s.disconnectActions,children:[t.jsx("button",{className:s.btn,onClick:()=>window.location.reload(),children:e("overview.l0.reconnectBtn")}),t.jsx("button",{className:s.btnSecondary,onClick:()=>{window.location.hash="#/settings"},children:e("overview.l0.settingsBtn")})]})]})]});const _=(r==null?void 0:r.mcpInstanceCount)??0,h=((w=r==null?void 0:r.mcpInstances)==null?void 0:w.find(I=>!I.isServer&&I.aiClientName))??((B=r==null?void 0:r.mcpInstances)==null?void 0:B.find(I=>!!I.aiClientName))??null,y=(c==null?void 0:c.pluginClients)??[],T=y.length>0,S=(c==null?void 0:c.sessionId)??(r==null?void 0:r.sessionId)??"-",f=e("overview.metric.server.tooltip","MCP server runtime and process status"),o=e("overview.metric.plugin.tooltip","Roblox Studio plugin connection and version status"),p=e("overview.metric.agent.tooltip","Connected AI coding agents and their runtime state"),x=e("overview.metric.sync.tooltip","Current Studio to local sync activity"),C=c?[b(s,e("overview.meta.version","Version"),e("overview.meta.version.tooltip","Installed MCP server version"),`v${c.version}`),b(s,e("overview.meta.session","Session"),e("overview.meta.session.tooltip","Current MCP session identifier"),S),b(s,e("overview.meta.pid","PID"),e("overview.meta.pid.tooltip","Operating system process identifier"),String(c.pid??"-")),b(s,e("overview.meta.uptime","Uptime"),e("overview.meta.uptime.tooltip","Time elapsed since the MCP server started"),J(m??c.uptime))]:[];if(i==="serverOnly")return t.jsxs("div",{className:s.page,children:[g,t.jsxs("div",{className:s.metricRow,children:[t.jsx(N,{title:d(e("overview.metric.server"),f),value:d(e("status.online"),f),icon:"🖥️",status:"ok",children:t.jsxs(t.Fragment,{children:[C,t.jsx(z,{status:"online"})]})}),t.jsx(N,{title:d(e("overview.metric.agent"),p),value:d((h==null?void 0:h.aiClientName)??e("overview.metric.noAgent"),p),icon:"🤖",subtitle:_>1?`${_} ${e("overview.metric.agent.instancesUnit","instances")}`:void 0,status:h?"ok":"warn"})]}),t.jsxs("div",{className:s.guideCard,children:[t.jsx("h3",{className:s.guideTitle,children:e("overview.l1.pluginGuide")}),t.jsxs("ul",{className:s.checklist,children:[t.jsx("li",{children:e("overview.l1.check1")}),t.jsx("li",{children:e("overview.l1.check2")})]})]}),t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.feed.title")}),l.length>0?t.jsx(H,{changes:l}):t.jsx("div",{className:s.feedEmpty,children:e("overview.l1.feedHint")})]}),n&&D(n)>0&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.changelog.title")}),t.jsxs("div",{className:s.changelogSummary,children:[t.jsxs("span",{children:[e("overview.changelog.entries","Entries"),": ",D(n)]}),n.scriptsModified>0&&t.jsxs("span",{className:s.changeTag,children:["📝"," ",n.scriptsModified," ",e("overview.changelog.scripts")]}),n.instancesCreated>0&&t.jsxs("span",{className:s.changeTag,children:["🧱"," ",n.instancesCreated," ",e("overview.changelog.instances")]}),n.propertiesChanged>0&&t.jsxs("span",{className:s.changeTag,children:["🎨"," ",n.propertiesChanged," ",e("overview.changelog.properties")]}),n.assetsInserted>0&&t.jsxs("span",{className:s.changeTag,children:["📦"," ",n.assetsInserted," ",e("overview.changelog.assets")]})]})]})]});const u=y[0],j=n?D(n):0,k=!!n&&j>0;return t.jsxs("div",{className:s.page,children:[g,t.jsxs("div",{className:s.metricGrid,children:[t.jsx(N,{title:d(e("overview.metric.server"),f),value:d(e("status.online"),f),icon:"🖥️",status:"ok",children:t.jsx(t.Fragment,{children:C})}),t.jsx(N,{title:d(e("overview.metric.plugin"),o),value:d(e(T?"status.online":"status.offline"),o),icon:"🔌",subtitle:u?`${u.placeName??"-"} / v${u.pluginVersion??"-"}`:void 0,status:T?"ok":"error"}),t.jsx(N,{title:d(e("overview.metric.agent"),p),value:d((h==null?void 0:h.aiClientName)??e("overview.metric.noAgent"),p),icon:"🤖",subtitle:_>1?`${_} ${e("overview.metric.agent.instancesUnit","instances")}`:void 0,status:h?"ok":"warn"}),t.jsx(N,{title:d(e("overview.metric.sync"),x),value:d(qe(a==null?void 0:a.state,e),x),icon:"🔄",status:Je(a==null?void 0:a.state)})]}),t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.feed.title")}),t.jsx(H,{changes:l})]}),k&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.changelog.title")}),t.jsxs("div",{className:s.changelogSummary,children:[t.jsxs("span",{children:[e("overview.changelog.entries","Entries"),": ",j]}),n.scriptsModified>0&&t.jsxs("span",{className:s.changeTag,children:["📝"," ",n.scriptsModified," ",e("overview.changelog.scripts")]}),n.instancesCreated>0&&t.jsxs("span",{className:s.changeTag,children:["🧱"," ",n.instancesCreated," ",e("overview.changelog.instances")]}),n.propertiesChanged>0&&t.jsxs("span",{className:s.changeTag,children:["🎨"," ",n.propertiesChanged," ",e("overview.changelog.properties")]}),n.assetsInserted>0&&t.jsxs("span",{className:s.changeTag,children:["📦"," ",n.assetsInserted," ",e("overview.changelog.assets")]})]})]})]})}export{st as Component};
|
|
1
|
+
import{j as t,u as R,r as v,f as L,h as F,a as M,D as V}from"./index-CnXGGM07.js";import{I as A}from"./InfoLabel-BAhsgLcj.js";import{P as U}from"./PageHeader-Bfy2f-GH.js";import{S as z}from"./StatusBadge-Df9BQsJU.js";import{T as O}from"./TooltipText-CGH7dKN6.js";import{G as X}from"./GameChangeDetail-CMSmIwO-.js";import{u as q,f as J}from"./useLiveUptime-1Et9Q6mq.js";const K="_page_1xgxh_2",Q="_card_1xgxh_10",W="_cardHeader_1xgxh_17",Y="_disconnectCard_1xgxh_28",Z="_disconnectIcon_1xgxh_36",ee="_disconnectTitle_1xgxh_41",te="_disconnectMessage_1xgxh_48",se="_reconnectGuide_1xgxh_55",ne="_guideStep_1xgxh_64",ie="_stepNumber_1xgxh_72",ce="_reconnectIndicator_1xgxh_88",re="_reconnectDot_1xgxh_98",ae="_pulse_1xgxh_1",oe="_disconnectActions_1xgxh_112",le="_btn_1xgxh_118",de="_btnSecondary_1xgxh_134",me="_metricRow_1xgxh_152",ge="_metricGrid_1xgxh_158",he="_metricCard_1xgxh_164",xe="_metric_ok_1xgxh_174",ue="_metric_warn_1xgxh_179",ve="_metric_error_1xgxh_184",_e="_metricHeader_1xgxh_189",pe="_metricIcon_1xgxh_200",fe="_metricTitle_1xgxh_204",Ce="_metricValue_1xgxh_208",je="_metricSubtitle_1xgxh_215",we="_guideCard_1xgxh_225",Ne="_guideTitle_1xgxh_232",ye="_checklist_1xgxh_239",Te="_feedEmpty_1xgxh_263",Se="_feedList_1xgxh_270",Ie="_feedItem_1xgxh_278",be="_feedTime_1xgxh_291",ke="_feedIcon_1xgxh_298",Me="_feedSummary_1xgxh_304",De="_feedText_1xgxh_313",Be="_feedContext_1xgxh_321",He="_feedItemClickable_1xgxh_330",Ee="_feedChevron_1xgxh_338",Pe="_feedDetail_1xgxh_347",$e="_feedDetailPre_1xgxh_356",Re="_feedDetailText_1xgxh_365",Ge="_changelogSummary_1xgxh_372",Le="_changeTag_1xgxh_381",Fe="_tierBar_1xgxh_393",Ve="_tierBarTrack_1xgxh_399",Ae="_tierBarFillBasic_1xgxh_407",Ue="_tierBarFillPro_1xgxh_412",ze="_tierLabels_1xgxh_417",s={page:K,card:Q,cardHeader:W,disconnectCard:Y,disconnectIcon:Z,disconnectTitle:ee,disconnectMessage:te,reconnectGuide:se,guideStep:ne,stepNumber:ie,reconnectIndicator:ce,reconnectDot:re,pulse:ae,disconnectActions:oe,btn:le,btnSecondary:de,metricRow:me,metricGrid:ge,metricCard:he,metric_ok:xe,metric_warn:ue,metric_error:ve,metricHeader:_e,metricIcon:pe,metricTitle:fe,metricValue:Ce,metricSubtitle:je,guideCard:we,guideTitle:Ne,checklist:ye,feedEmpty:Te,feedList:Se,feedItem:Ie,feedTime:be,feedIcon:ke,feedSummary:Me,feedText:De,feedContext:Be,feedItemClickable:He,feedChevron:Ee,feedDetail:Pe,feedDetailPre:$e,feedDetailText:Re,changelogSummary:Ge,changeTag:Le,tierBar:Fe,tierBarTrack:Ve,tierBarFillBasic:Ae,tierBarFillPro:Ue,tierLabels:ze};function N({title:e,value:i,icon:c,subtitle:r,status:a,children:n}){const l=a?s[`metric_${a}`]:"";return t.jsxs("div",{className:`${s.metricCard} ${l}`,children:[t.jsxs("div",{className:s.metricHeader,children:[c&&t.jsx("span",{className:s.metricIcon,children:c}),t.jsx("span",{className:s.metricTitle,children:e})]}),t.jsx("div",{className:s.metricValue,children:i}),r&&t.jsx("div",{className:s.metricSubtitle,children:r}),n]})}function Oe(e){var c,r;const i=e==null?void 0:e.contextSummary;return(i==null?void 0:i.intent)??((r=(c=i==null?void 0:i.affectedAreas)==null?void 0:c[0])==null?void 0:r.label)??(i==null?void 0:i.testScenario)??null}function H({changes:e}){const{t:i}=R(),[c,r]=v.useState(null);return e.length===0?t.jsx("div",{className:s.feedEmpty,children:i("overview.feed.empty")}):t.jsx("div",{className:s.feedList,children:e.map((a,n)=>{const l=c===n,m=a.raw,g=m&&(m.before!=null||m.after!=null||m.details!=null),_=Oe(m);return t.jsxs("div",{children:[t.jsxs("div",{className:`${s.feedItem} ${g?s.feedItemClickable:""}`,onClick:()=>g&&r(l?null:n),children:[t.jsx("span",{className:s.feedTime,children:a.timestamp}),t.jsx("span",{className:s.feedIcon,children:a.icon}),t.jsxs("span",{className:s.feedText,children:[t.jsx("span",{className:s.feedSummary,children:a.summary}),_&&t.jsx("span",{className:s.feedContext,children:_})]}),g&&t.jsx("span",{className:s.feedChevron,children:l?"▴":"▾"})]}),l&&m&&t.jsx("div",{className:s.feedDetail,children:t.jsx(X,{change:m})})]},n)})})}const E=20;function G(e){return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}function P(){return G(new Date)}function $(e){switch(e){case"script":return"📝";case"instance":return"🧱";case"property":return"🎨";case"lighting":return"💡";case"terrain":return"⛰️";case"asset":return"📦";default:return"🔧"}}function Xe(){const{level:e,status:i}=L(),c=F(),[r,a]=v.useState(null),[n,l]=v.useState(null),[m,g]=v.useState(null),[_,h]=v.useState([]),y=v.useRef(null),T=v.useCallback(async()=>{try{const o=await M.get("/connection-info");a(o)}catch{a(null)}},[]),S=v.useCallback(async()=>{try{const o=await M.get("/api/dashboard/changelog/active");if(g(o),o.recentChanges&&o.recentChanges.length>0){const p=o.recentChanges.map(x=>({timestamp:x.timestamp?G(new Date(x.timestamp)):P(),icon:$(x.category),summary:x.summary,category:x.category,raw:x}));h(p)}}catch{g(null)}},[]),f=v.useCallback(async()=>{try{const o=await M.get("/sync/status");l(o)}catch{l(null)}},[]);return v.useEffect(()=>{e!=="disconnected"?(T(),S(),f()):(a(null),l(null),g(null));const o=new V;y.current=o,o.connect();const p=o.on("game_change",C=>{const u=C,j={timestamp:P(),icon:$(u.category),summary:u.summary,category:u.category};h(k=>{const w=[j,...k];return w.length>E?w.slice(0,E):w}),S()}),x=o.on("sync",C=>{const u=C;l(j=>({...j,state:u.status,...u.placeId?{placeId:u.placeId}:{}}))});return()=>{p(),x(),o.disconnect(),y.current=null}},[e,T,S,f]),{level:e,status:i,connectionInfo:r,syncStatus:n,changeSummary:m,recentChanges:_,tier:c}}function D(e){return e.scriptsModified+e.scriptsCreated+e.instancesCreated+e.instancesDeleted+e.instancesMoved+e.propertiesChanged+e.assetsInserted+(e.lightingChanged?1:0)+(e.terrainChanged?1:0)}function qe(e,i){switch(e){case"syncing":return i("status.syncing","Syncing");case"initializing":return i("status.initializing","Initializing");case"error":return i("status.error","Error");default:return i("status.idle","Idle")}}function Je(e){switch(e){case"syncing":return"ok";case"initializing":return"warn";case"error":return"error";default:return"ok"}}function b(e,i,c,r){return t.jsxs("div",{className:e.metricSubtitle,children:[t.jsx(A,{label:i,tooltip:c}),": ",r]},i)}function d(e,i){return t.jsx(O,{text:i,children:e})}function st(){var w,B;const{t:e}=R(),{level:i,status:c,connectionInfo:r,syncStatus:a,changeSummary:n,recentChanges:l}=Xe(),m=q(c==null?void 0:c.uptime),g=t.jsx(U,{title:e("page.overview.title","Overview"),description:e("page.overview.description","Check server, plugin, agent, sync, and recent game-change status in one place."),helpTopicId:"overview",helpState:{connectionLevel:i}});if(i==="disconnected")return t.jsxs("div",{className:s.page,children:[g,t.jsxs("div",{className:s.disconnectCard,children:[t.jsx("div",{className:s.disconnectIcon,children:"⚠️"}),t.jsx("h2",{className:s.disconnectTitle,children:e("overview.l0.title")}),t.jsx("p",{className:s.disconnectMessage,children:e("overview.l0.message")}),t.jsxs("div",{className:s.reconnectGuide,children:[t.jsxs("div",{className:s.guideStep,children:[t.jsx("span",{className:s.stepNumber,children:"1"}),t.jsx("span",{children:e("overview.l0.step1")})]}),t.jsxs("div",{className:s.guideStep,children:[t.jsx("span",{className:s.stepNumber,children:"2"}),t.jsx("span",{children:e("overview.l0.step2")})]})]}),t.jsxs("div",{className:s.reconnectIndicator,children:[t.jsx("span",{className:s.reconnectDot}),e("overview.l0.reconnecting")]}),t.jsxs("div",{className:s.disconnectActions,children:[t.jsx("button",{className:s.btn,onClick:()=>window.location.reload(),children:e("overview.l0.reconnectBtn")}),t.jsx("button",{className:s.btnSecondary,onClick:()=>{window.location.hash="#/settings"},children:e("overview.l0.settingsBtn")})]})]})]});const _=(r==null?void 0:r.mcpInstanceCount)??0,h=((w=r==null?void 0:r.mcpInstances)==null?void 0:w.find(I=>!I.isServer&&I.aiClientName))??((B=r==null?void 0:r.mcpInstances)==null?void 0:B.find(I=>!!I.aiClientName))??null,y=(c==null?void 0:c.pluginClients)??[],T=y.length>0,S=(c==null?void 0:c.sessionId)??(r==null?void 0:r.sessionId)??"-",f=e("overview.metric.server.tooltip","MCP server runtime and process status"),o=e("overview.metric.plugin.tooltip","Roblox Studio plugin connection and version status"),p=e("overview.metric.agent.tooltip","Connected AI coding agents and their runtime state"),x=e("overview.metric.sync.tooltip","Current Studio to local sync activity"),C=c?[b(s,e("overview.meta.version","Version"),e("overview.meta.version.tooltip","Installed MCP server version"),`v${c.version}`),b(s,e("overview.meta.session","Session"),e("overview.meta.session.tooltip","Current MCP session identifier"),S),b(s,e("overview.meta.pid","PID"),e("overview.meta.pid.tooltip","Operating system process identifier"),String(c.pid??"-")),b(s,e("overview.meta.uptime","Uptime"),e("overview.meta.uptime.tooltip","Time elapsed since the MCP server started"),J(m??c.uptime))]:[];if(i==="serverOnly")return t.jsxs("div",{className:s.page,children:[g,t.jsxs("div",{className:s.metricRow,children:[t.jsx(N,{title:d(e("overview.metric.server"),f),value:d(e("status.online"),f),icon:"🖥️",status:"ok",children:t.jsxs(t.Fragment,{children:[C,t.jsx(z,{status:"online"})]})}),t.jsx(N,{title:d(e("overview.metric.agent"),p),value:d((h==null?void 0:h.aiClientName)??e("overview.metric.noAgent"),p),icon:"🤖",subtitle:_>1?`${_} ${e("overview.metric.agent.instancesUnit","instances")}`:void 0,status:h?"ok":"warn"})]}),t.jsxs("div",{className:s.guideCard,children:[t.jsx("h3",{className:s.guideTitle,children:e("overview.l1.pluginGuide")}),t.jsxs("ul",{className:s.checklist,children:[t.jsx("li",{children:e("overview.l1.check1")}),t.jsx("li",{children:e("overview.l1.check2")})]})]}),t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.feed.title")}),l.length>0?t.jsx(H,{changes:l}):t.jsx("div",{className:s.feedEmpty,children:e("overview.l1.feedHint")})]}),n&&D(n)>0&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.changelog.title")}),t.jsxs("div",{className:s.changelogSummary,children:[t.jsxs("span",{children:[e("overview.changelog.entries","Entries"),": ",D(n)]}),n.scriptsModified>0&&t.jsxs("span",{className:s.changeTag,children:["📝"," ",n.scriptsModified," ",e("overview.changelog.scripts")]}),n.instancesCreated>0&&t.jsxs("span",{className:s.changeTag,children:["🧱"," ",n.instancesCreated," ",e("overview.changelog.instances")]}),n.propertiesChanged>0&&t.jsxs("span",{className:s.changeTag,children:["🎨"," ",n.propertiesChanged," ",e("overview.changelog.properties")]}),n.assetsInserted>0&&t.jsxs("span",{className:s.changeTag,children:["📦"," ",n.assetsInserted," ",e("overview.changelog.assets")]})]})]})]});const u=y[0],j=n?D(n):0,k=!!n&&j>0;return t.jsxs("div",{className:s.page,children:[g,t.jsxs("div",{className:s.metricGrid,children:[t.jsx(N,{title:d(e("overview.metric.server"),f),value:d(e("status.online"),f),icon:"🖥️",status:"ok",children:t.jsx(t.Fragment,{children:C})}),t.jsx(N,{title:d(e("overview.metric.plugin"),o),value:d(e(T?"status.online":"status.offline"),o),icon:"🔌",subtitle:u?`${u.placeName??"-"} / v${u.pluginVersion??"-"}`:void 0,status:T?"ok":"error"}),t.jsx(N,{title:d(e("overview.metric.agent"),p),value:d((h==null?void 0:h.aiClientName)??e("overview.metric.noAgent"),p),icon:"🤖",subtitle:_>1?`${_} ${e("overview.metric.agent.instancesUnit","instances")}`:void 0,status:h?"ok":"warn"}),t.jsx(N,{title:d(e("overview.metric.sync"),x),value:d(qe(a==null?void 0:a.state,e),x),icon:"🔄",status:Je(a==null?void 0:a.state)})]}),t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.feed.title")}),t.jsx(H,{changes:l})]}),k&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.changelog.title")}),t.jsxs("div",{className:s.changelogSummary,children:[t.jsxs("span",{children:[e("overview.changelog.entries","Entries"),": ",j]}),n.scriptsModified>0&&t.jsxs("span",{className:s.changeTag,children:["📝"," ",n.scriptsModified," ",e("overview.changelog.scripts")]}),n.instancesCreated>0&&t.jsxs("span",{className:s.changeTag,children:["🧱"," ",n.instancesCreated," ",e("overview.changelog.instances")]}),n.propertiesChanged>0&&t.jsxs("span",{className:s.changeTag,children:["🎨"," ",n.propertiesChanged," ",e("overview.changelog.properties")]}),n.assetsInserted>0&&t.jsxs("span",{className:s.changeTag,children:["📦"," ",n.assetsInserted," ",e("overview.changelog.assets")]})]})]})]})}export{st as Component};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{i as Z,r as d,j as t,u as ee,e as te,X as ne,E as oe,J as se}from"./index-CnXGGM07.js";/**
|
|
2
|
+
* @license lucide-react v1.8.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const ae=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],q=Z("circle-question-mark",ae),re="_button_vab4n_1",ce="_iconButton_vab4n_2",ie="_checkboxInput_vab4n_26",le="_button_sm_vab4n_37",de="_button_md_vab4n_42",ue="_primary_vab4n_47",pe="_secondary_vab4n_58",he="_ghost_vab4n_69",be="_danger_vab4n_81",fe="_iconButton_sm_vab4n_104",_e="_iconButton_md_vab4n_109",ge="_badge_vab4n_114",ye="_pill_vab4n_133",ve="_interactive_vab4n_137",me="_neutral_vab4n_151",Pe="_accent_vab4n_157",ke="_success_vab4n_163",we="_warning_vab4n_169",Ce="_info_vab4n_175",xe="_error_vab4n_181",Ie="_pro_vab4n_193",_={button:re,iconButton:ce,checkboxInput:ie,button_sm:le,button_md:de,primary:ue,secondary:pe,ghost:he,danger:be,iconButton_sm:fe,iconButton_md:_e,badge:ge,pill:ye,interactive:ve,neutral:me,accent:Pe,success:ke,warning:we,info:Ce,error:xe,pro:Ie};function S(...e){return e.filter(Boolean).join(" ")}const Re=d.forwardRef(function({variant:n="secondary",size:o="md",className:i,type:a="button",...b},u){return t.jsx("button",{ref:u,type:a,className:S(_.button,_[n],_[`button_${o}`],i),...b})}),X=d.forwardRef(function({size:n="md",className:o,type:i="button",...a},b){return t.jsx("button",{ref:b,type:i,className:S(_.iconButton,_[`iconButton_${n}`],o),...a})}),at=d.forwardRef(function({variant:n="neutral",shape:o="square",interactive:i=!1,className:a,...b},u){return t.jsx("span",{ref:u,className:S(_.badge,_[n],o==="pill"&&_.pill,i&&_.interactive,a),...b})}),rt=d.forwardRef(function({className:n,type:o,...i},a){return t.jsx("input",{ref:a,type:"checkbox",className:S(_.checkboxInput,n),...i})}),r={canDo:{key:"dashboardHelp.section.canDo",fallback:"What you can do here"},needs:{key:"dashboardHelp.section.needs",fallback:"What you need to use it"},currentState:{key:"dashboardHelp.section.currentState",fallback:"Check based on current status"}},Ae="https://create.roblox.com/docs/cloud/auth/api-keys",Ee="https://create.roblox.com/docs/cloud/guides/usage-assets",Se="https://create.roblox.com/docs/cloud/reference/features/assets",Le="https://create.roblox.com/docs/reference/engine/classes/DataModel#CreatorId",Be="https://create.roblox.com/docs/reference/engine/classes/Player#UserId",He="https://create.roblox.com/docs/projects/groups",De="https://create.roblox.com/docs/cloud/reference/features/groups";function g(e,n,o,i){return{id:e,title:{key:`dashboardHelp.${e}.title`,fallback:n},sections:o,links:i}}function l(e,n,o,i){return{heading:e,items:i.map((a,b)=>({key:`dashboardHelp.${n}.${o}.${b+1}`,fallback:a}))}}function c(e,n,o){return{heading:r.currentState,items:[{key:`dashboardHelp.${e}.currentState.${n}`,fallback:o}]}}function P(e,n,o,i,a,b){return g(e,n,[l(r.canDo,e,"canDo",o),l(r.needs,e,"needs",i),l(r.currentState,e,"currentState",a)],b)}function je(e){return e.tier==="basic"?c("assets","basic","Activate Pro before uploading to Roblox."):e.uploadEnabled===!1?c("assets","uploadDisabled","Turn on API Key local upload in Assets settings."):e.hasOpenCloudCredential===!1?c("assets","noCredential","Save and test an Open Cloud API Key."):e.hasDefaultCreator===!1?c("assets","noCreator","Save a default Creator ID or enter Creator details during upload."):c("assets","default","Open an asset detail dialog to start upload or usage scan.")}function Ne(e){return e.connectionLevel!==void 0&&e.connectionLevel!=="studioConnected"?c("sync","pluginMissing","Connect WEPPY Plugin in Studio before using live sync details."):e.tier==="basic"?c("sync","basic","Activate Pro to use bidirectional or reverse sync."):c("sync","default","Use the sync log to diagnose stuck or failed sync activity.")}function Me(e,n={}){return e==="openCloudApiKey"?g(e,"Open Cloud API Key help",[l(r.canDo,e,"canDo",["WEPPY uses this key only for Roblox Open Cloud requests."]),l(r.needs,e,"needs",["Create a Roblox API key in Creator Hub. Add Assets under Access Permissions, then enable both Read and Write operations.","Set the key target to the same User or Group that you use as the upload Creator.","The raw key is encrypted on this device. It is not sent to WEPPY servers, and it is not stored in any other external storage, browser storage, telemetry, logs, tool history, or Asset Library metadata."]),n.hasOpenCloudCredential?c(e,"saved","Use Test Connection to confirm the saved key still works."):c(e,"empty","Create an API key in Roblox Creator Hub, paste it here, then save and test it.")],[{label:{key:"dashboardHelp.openCloudApiKey.link.apiKeys",fallback:"Roblox API keys"},href:Ae},{label:{key:"dashboardHelp.openCloudApiKey.link.assetsGuide",fallback:"Assets API usage guide"},href:Ee},{label:{key:"dashboardHelp.openCloudApiKey.link.assetsReference",fallback:"Assets API reference"},href:Se}]):e==="openCloudCreatorId"?g(e,"Creator ID help",[l(r.canDo,e,"canDo",["The default Creator decides which User or Group owns newly uploaded Roblox assets."]),l(r.needs,e,"needs",["For User, sign in to roblox.com, open your profile from your avatar or username, then copy only the number between /users/ and /profile in the browser URL.","For Group, open the Roblox group or community page, then copy only the number after /groups/ or /communities/ in the browser URL.","Paste only the numeric ID in Creator ID. Do not paste the full URL, rbxassetid://, User, or Group text."]),n.hasDefaultCreator?c(e,"saved","Keep this value if new assets should continue using the same owner."):c(e,"empty","Choose User or Group, paste the numeric ID, then save the default Creator.")],[{label:{key:"dashboardHelp.openCloudCreatorId.link.creatorId",fallback:"Creator ID reference"},href:Le},{label:{key:"dashboardHelp.openCloudCreatorId.link.userId",fallback:"User ID reference"},href:Be},{label:{key:"dashboardHelp.openCloudCreatorId.link.groups",fallback:"Roblox groups"},href:He},{label:{key:"dashboardHelp.openCloudCreatorId.link.groupsApi",fallback:"Groups Cloud API"},href:De}]):{overview:g("overview","Overview help",[l(r.canDo,"overview","canDo",["Check MCP server, WEPPY Plugin, AI Agent, Sync, and recent game changes in one place."]),l(r.needs,"overview","needs",["Useful status requires the MCP server. Live Studio status also needs WEPPY Plugin connected to the active place."]),n.connectionLevel==="serverOnly"?c("overview","serverOnly","Open Roblox Studio and start WEPPY Plugin so live place data can appear."):c("overview","default","If the server disconnects, restart MCP or wait for the automatic reconnect.")]),connection:P("connection","Connection help",["Inspect server process details, connected AI agents, Studio plugin clients, and connection log events."],["The MCP server must be reachable. Plugin rows appear after Studio sends heartbeats."],["If Plugin is missing, open Roblox Studio and run WEPPY Plugin. If AI Agent is missing, reconnect the MCP server from your AI tool."]),sync:g("sync","Sync help",[l(r.canDo,"sync","canDo",["Review Studio to local sync status, direction, apply mode, and sync logs."]),l(r.needs,"sync","needs",["Sync needs an active place and connected WEPPY Plugin. Two-way and reverse workflows depend on Pro."]),Ne(n)]),assets:g("assets","Assets help",[l(r.canDo,"assets","canDo",["Browse local Asset Library files, switch place/shared scope, filter categories, scan usage, insert RBXM into Studio, and upload local assets to Roblox."]),l(r.needs,"assets","needs",["Upload needs Pro, the Open Cloud upload toggle, a valid API Key, and a Creator. Browse and preview work on Basic."]),je(n)]),changelog:P("changelog","Changelog help",["Review real game-change sessions extracted from AI actions and sync events."],["Entries are scoped to the active place. Basic shows only the latest preview entries."],["If the list is empty, ask the AI Agent to make a game change. Clear only deletes saved history records, not Studio objects."]),playtest:g("playtest","Playtest help",[l(r.canDo,"playtest","canDo",["Review Playtest results and reports saved by the AI Agent."]),l(r.needs,"playtest","needs",["Pro shows real stored reports. Basic shows sample preview data. Live active-place confidence needs WEPPY Plugin connected."]),n.tier==="basic"?c("playtest","basic","Activate Pro to use real Playtest history."):c("playtest","default","Ask the AI Agent to run a Playtest when no report is available.")]),uiStudio:g("uiStudio","UI Studio help",[l(r.canDo,"uiStudio","canDo",["Review AI-created UI analysis, improvement suggestions, captures, and before/after history."]),l(r.needs,"uiStudio","needs",["Pro shows real UI Studio data. Basic shows a bundled sample. New capture/check actions need WEPPY Plugin connected."]),n.tier==="basic"?c("uiStudio","basic","Activate Pro to use live UI Studio previews."):c("uiStudio","default","Ask the AI Agent to capture the UI or recheck improvement suggestions, then copy follow-up requests back to the AI chat.")]),tools:P("tools","Tools help",["Inspect tool history, status classification, fallback/unsupported/warn/error details, and usage statistics."],["History and statistics depend on local recording settings and the active place bucket."],["If no records appear, check Controls > General Settings and confirm history/statistics are enabled. Expand failed rows to inspect input, permission, or connection causes."]),controls:P("controls","Controls help",["Manage Project Root, Studio routing, and MCP hot settings."],["Project Root and Studio Routing need MCP server connection. Hot settings need a server response. Asset upload controls live in Assets settings."],["Use Project Root only when MCP should write sync data under a different project folder. Use Studio Routing only for requests where the agent does not name Studio ID, Connection ID, or Place ID."]),settings:P("settings","Settings help",["Manage License, saved data cleanup, server environment display, and language."],["License actions need MCP server connection. Server environment values are read-only here. Asset upload controls live in Assets settings."],["Activate a license for Pro features. Change environment values outside WEPPY Dashboard, then restart MCP. Review delete confirmations before clearing saved data."]),whatsNew:P("whatsNew","What's New help",["Review WEPPY Dashboard, MCP, and Plugin announcements, releases, and change notes."],["Announcements are bundled locally. Unread state is stored in this browser."],["After you visit this page, unread announcements from this visit are marked read when you leave. The top header does not show a duplicate What's New button on this page."])}[e]}const Ue="_root_15e9p_1",Oe="_rootPage_15e9p_7",We="_rootField_15e9p_11",Te="_helpButton_15e9p_15",Ge="_panel_15e9p_19",Fe="_panelField_15e9p_34",$e="_panelPage_15e9p_38",Ye="_panelHeader_15e9p_42",Ke="_closeButton_15e9p_60",qe="_sectionStack_15e9p_64",Xe="_helpSection_15e9p_69",ze="_linkList_15e9p_70",h={root:Ue,rootPage:Oe,rootField:We,helpButton:Te,panel:Ge,panelField:Fe,panelPage:$e,panelHeader:Ye,closeButton:Ke,sectionStack:qe,helpSection:Xe,linkList:ze},y=12,A=8,Je=120,Qe=360,Ve=340,z=560;function Ze({topicId:e,state:n,variant:o="page",className:i}){const{t:a}=ee(),{trackEvent:b}=te(),[u,k]=d.useState(!1),[x,M]=d.useState(null),L=d.useId(),U=d.useRef(null),B=d.useRef(null),H=d.useRef(null),v=Me(e,n),I=a(v.title.key,v.title.fallback),R=d.useCallback(()=>{const s=B.current,p=H.current;if(!s||!p||typeof window>"u")return;const f=s.getBoundingClientRect(),m=p.getBoundingClientRect(),w=window.innerWidth,C=window.innerHeight,Q=o==="field"?Ve:Qe,T=m.width||Math.min(Q,w-y*2),G=m.height||z;let D=o==="field"?f.left:f.right-T;D=Math.max(y,Math.min(D,w-T-y));const j=C-f.bottom-A-y,F=f.top-A-y,$=j<Math.min(G,220)&&F>j,V=Math.max(Je,$?F:j),Y=Math.min(z,V),K=Math.min(G,Y);let N=$?f.top-A-K:f.bottom+A;N=Math.max(y,Math.min(N,C-K-y)),M({top:Math.round(N),left:Math.round(D),maxHeight:Math.round(Y)})},[o]);d.useLayoutEffect(()=>{u?R():M(null)},[u,R]),d.useEffect(()=>{if(!u)return;const s=f=>{var w,C;const m=f.target;m&&!((w=U.current)!=null&&w.contains(m))&&!((C=H.current)!=null&&C.contains(m))&&k(!1)},p=f=>{f.key==="Escape"&&k(!1)};return document.addEventListener("mousedown",s),document.addEventListener("keydown",p),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("keydown",p)}},[u]),d.useEffect(()=>{if(!u)return;const s=()=>R();return window.addEventListener("scroll",s,!0),window.addEventListener("resize",s),()=>{window.removeEventListener("scroll",s,!0),window.removeEventListener("resize",s)}},[u,R]);const O=o==="field"?a("dashboardHelp.fieldButton.ariaLabel","Open field help"):a("dashboardHelp.pageButton.ariaLabel","Open page help"),J=x?{top:x.top,left:x.left,maxHeight:x.maxHeight}:{top:-9999,left:-9999,visibility:"hidden"},W=u?t.jsxs("section",{ref:H,id:L,className:[h.panel,o==="field"?h.panelField:h.panelPage].filter(Boolean).join(" "),style:J,role:"dialog","aria-label":I,"data-panel-placement":"help-portal",children:[t.jsxs("div",{className:h.panelHeader,children:[t.jsx("h2",{children:I}),t.jsx(X,{type:"button",size:"sm",className:h.closeButton,"aria-label":a("common.close","Close"),onClick:()=>k(!1),children:t.jsx(ne,{size:15,"aria-hidden":"true"})})]}),t.jsx("div",{className:h.sectionStack,children:v.sections.map(s=>t.jsxs("section",{className:h.helpSection,children:[t.jsx("h3",{children:a(s.heading.key,s.heading.fallback)}),t.jsx("ul",{children:s.items.map(p=>t.jsx("li",{children:a(p.key,p.fallback)},p.key))})]},s.heading.key))}),v.links&&v.links.length>0&&t.jsxs("div",{className:h.linkList,children:[t.jsx("h3",{children:a("dashboardHelp.section.links","Related links")}),v.links.map(s=>t.jsxs("a",{href:s.href,target:"_blank",rel:"noreferrer",children:[a(s.label.key,s.label.fallback),t.jsx(oe,{size:12,"aria-hidden":"true"})]},s.href))]})]}):null;return t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:U,className:[h.root,o==="field"?h.rootField:h.rootPage,i??""].filter(Boolean).join(" "),children:o==="field"?t.jsx(X,{ref:B,type:"button",size:"sm",className:h.helpButton,"aria-label":`${O}: ${I}`,"aria-expanded":u,"aria-controls":L,onClick:()=>{k(s=>{const p=!s;return s||b("dashboard_click_event",{click_target:"dashboard_help_open",help_topic:e,placement:o}),p})},children:t.jsx(q,{size:14,"aria-hidden":"true"})}):t.jsxs(Re,{ref:B,type:"button",variant:"secondary",size:"sm",className:h.helpButton,"aria-label":`${O}: ${I}`,"aria-expanded":u,"aria-controls":L,onClick:()=>{k(s=>{const p=!s;return s||b("dashboard_click_event",{click_target:"dashboard_help_open",help_topic:e,placement:o}),p})},children:[t.jsx(q,{size:16,"aria-hidden":"true"}),t.jsx("span",{children:a("dashboardHelp.button","Help")})]})}),W&&typeof document<"u"?se.createPortal(W,document.body):null]})}const et="_pageHeader_qym7v_1",tt="_copy_qym7v_9",nt="_titleLine_qym7v_16",ot="_actions_qym7v_39",E={pageHeader:et,copy:tt,titleLine:nt,actions:ot};function ct({title:e,description:n,badge:o,helpTopicId:i,helpState:a}){return t.jsxs("div",{className:E.pageHeader,children:[t.jsxs("div",{className:E.copy,children:[t.jsxs("div",{className:E.titleLine,children:[t.jsx("h1",{children:e}),o]}),t.jsx("p",{children:n})]}),t.jsx("div",{className:E.actions,children:t.jsx(Ze,{topicId:i,state:a})})]})}export{at as B,rt as C,Ze as D,ct as P};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._button_vab4n_1,._iconButton_vab4n_2{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--border);border-radius:var(--radius-control);font-family:var(--font-label);font-size:12px;font-weight:600;line-height:1;text-decoration:none;white-space:nowrap;cursor:pointer;transition:background var(--transition),border-color var(--transition),box-shadow var(--transition),color var(--transition),opacity var(--transition)}._button_vab4n_1:focus-visible,._iconButton_vab4n_2:focus-visible,._checkboxInput_vab4n_26:focus-visible{outline:none;box-shadow:var(--focus-ring)}._button_vab4n_1:disabled,._iconButton_vab4n_2:disabled{cursor:not-allowed;opacity:.5}._button_sm_vab4n_37{min-height:28px;padding:0 10px}._button_md_vab4n_42{min-height:34px;padding:0 12px}._primary_vab4n_47{border-color:var(--accent);background:var(--accent);color:var(--button-primary-text)}._primary_vab4n_47:hover:not(:disabled){background:var(--accent-hover);border-color:var(--accent-hover)}._secondary_vab4n_58{background:var(--bg-secondary);color:var(--text-primary)}._secondary_vab4n_58:hover:not(:disabled){border-color:var(--border-highlight);background:var(--accent-dim);color:var(--accent)}._ghost_vab4n_69{border-color:transparent;background:transparent;color:var(--text-secondary)}._ghost_vab4n_69:hover:not(:disabled){border-color:var(--border);background:var(--bg-secondary);color:var(--text-primary)}._danger_vab4n_81{border-color:var(--danger-border);background:var(--danger-bg);color:var(--danger-text)}._danger_vab4n_81:hover:not(:disabled){background:var(--danger-hover-bg);border-color:var(--danger)}._iconButton_vab4n_2{padding:0;background:var(--bg-secondary);color:var(--text-secondary)}._iconButton_vab4n_2:hover:not(:disabled){border-color:var(--border-highlight);background:var(--accent-dim);color:var(--accent)}._iconButton_sm_vab4n_104{width:28px;height:28px}._iconButton_md_vab4n_109{width:34px;height:34px}._badge_vab4n_114{display:inline-flex;align-items:center;justify-content:center;min-height:22px;gap:5px;padding:2px 8px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-secondary);font-family:var(--font-label);font-size:11px;font-weight:600;line-height:1;white-space:nowrap;cursor:default}._pill_vab4n_133{border-radius:var(--radius-pill)}._interactive_vab4n_137{cursor:pointer;transition:background var(--transition),border-color var(--transition),color var(--transition)}._interactive_vab4n_137:hover{border-color:var(--border-highlight);background:var(--accent-dim);color:var(--accent)}._neutral_vab4n_151{background:var(--bg-secondary);border-color:var(--border);color:var(--text-secondary)}._accent_vab4n_157{background:var(--accent-dim);border-color:var(--border-highlight);color:var(--accent)}._success_vab4n_163{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}._warning_vab4n_169{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}._info_vab4n_175{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}._error_vab4n_181{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}._danger_vab4n_81._badge_vab4n_114{background:var(--danger-bg);border-color:var(--danger-border);color:var(--danger-text)}._pro_vab4n_193{background:var(--pro-bg-soft);border-color:var(--pro-border);color:var(--pro-text)}._checkboxInput_vab4n_26{width:18px;height:18px;margin:0;border:1px solid var(--border);border-radius:var(--radius-control);accent-color:var(--accent);cursor:pointer}._checkboxInput_vab4n_26:disabled{cursor:not-allowed;opacity:.5}._root_15e9p_1{position:relative;display:inline-flex;align-items:center}._rootPage_15e9p_7{margin-left:4px}._rootField_15e9p_11{margin-left:2px}._helpButton_15e9p_15{flex:0 0 auto}._panel_15e9p_19{position:fixed;z-index:1200;box-sizing:border-box;width:min(360px,calc(100vw - 24px));max-height:min(560px,calc(100vh - 24px));overflow:auto;border:1px solid var(--border);border-radius:8px;background:var(--bg-card);box-shadow:0 18px 46px #00000047;padding:14px;text-align:left}._panelField_15e9p_34{width:min(340px,calc(100vw - 24px))}._panelPage_15e9p_38{width:min(360px,calc(100vw - 24px))}._panelHeader_15e9p_42{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}._panelHeader_15e9p_42 h2{margin:0;color:var(--text-primary);font-family:var(--font-label);font-size:14px;line-height:1.3;letter-spacing:0;text-transform:none}._closeButton_15e9p_60{flex:0 0 auto}._sectionStack_15e9p_64{display:grid;gap:12px}._helpSection_15e9p_69 h3,._linkList_15e9p_70 h3{margin:0 0 6px;color:var(--text-primary);font-family:var(--font-label);font-size:12px;letter-spacing:0;text-transform:none}._helpSection_15e9p_69 ul{margin:0;padding-left:18px;color:var(--text-secondary);font-size:12px;line-height:1.45}._helpSection_15e9p_69 li+li{margin-top:4px}._linkList_15e9p_70{display:grid;gap:6px;margin-top:14px;padding-top:12px;border-top:1px solid var(--border)}._linkList_15e9p_70 a{display:inline-flex;align-items:center;gap:6px;color:var(--accent);font-size:12px;text-decoration:none}._linkList_15e9p_70 a:hover,._linkList_15e9p_70 a:focus-visible{text-decoration:underline;outline:none}._pageHeader_qym7v_1{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;min-width:0}._copy_qym7v_9{display:flex;flex-direction:column;gap:5px;min-width:0}._titleLine_qym7v_16{display:flex;align-items:center;gap:8px;min-width:0;flex-wrap:wrap}._titleLine_qym7v_16 h1{margin:0;color:var(--text-primary);font-size:22px;font-weight:700;letter-spacing:0}._copy_qym7v_9 p{margin:0;color:var(--text-secondary);font-size:13px;line-height:1.45}._actions_qym7v_39{display:flex;align-items:center;justify-content:flex-end;flex:0 0 auto}@media(max-width:640px){._pageHeader_qym7v_1{gap:12px}._copy_qym7v_9 p{font-size:12px}}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{r as l,a as v,u as N,j as t,e as D,h as E,l as $,T as U}from"./index-CnXGGM07.js";import{P as O}from"./PageHeader-Bfy2f-GH.js";import{I as B}from"./InfoLabel-BAhsgLcj.js";import{C as F}from"./CurrentPlaceScope-C8U9I15o.js";import{T as S}from"./TooltipText-CGH7dKN6.js";import{C as V}from"./ConfirmModal-BqCEvp7Y.js";import"./ConfirmModal.module-D1aZY2bQ.js";const W=5e3;function T(e){if(typeof e=="number")return{placeId:String(e)}}function z(e,o){return typeof o!="number"?e:`${e}?placeId=${encodeURIComponent(String(o))}`}function G(e){const o=(e==null?void 0:e.enabled)??!0,r=(e==null?void 0:e.placeId)??null,[n,a]=l.useState([]),[m,i]=l.useState(null),[p,c]=l.useState(o),d=l.useRef(null),u=l.useCallback(async()=>{try{const y=T(r),x=y?await v.get("/api/dashboard/playtest/history",y):await v.get("/api/dashboard/playtest/history");a(x.entries??[])}catch{}},[r]),h=l.useCallback(async()=>{if(!o){c(!1);return}await u(),c(!1)},[o,u]),g=l.useCallback(async()=>{o&&(await v.post(z("/api/dashboard/playtest/history/clear",r)),a([]),i(null))},[o,r]);l.useEffect(()=>{i(null)},[r]);const f=l.useCallback(async y=>{if(o)try{const x=T(r),w=x?await v.get(`/api/dashboard/playtest/report/${y}`,x):await v.get(`/api/dashboard/playtest/report/${y}`);i(w)}catch{i(null)}},[o,r]);return l.useEffect(()=>{if(!o){c(!1);return}return h(),d.current=setInterval(h,W),()=>{d.current&&clearInterval(d.current)}},[o,h]),{history:n,selectedReport:m,loading:p,loadReport:f,clearHistory:g}}function Q(e){const o="2026-03-27T15:26:00.000Z",r={testScenario:e("playtest.sample.context.why","Spawn into the arena, survive the opener, and verify the HUD responds immediately."),expectedBehavior:e("playtest.sample.context.expected","The player spawns safely, the countdown UI appears within one second, and the first wave starts without errors."),observedBehavior:e("playtest.sample.context.observed","Spawn protection held, the HUD updated on time, and wave one completed with no gameplay regressions.")};return{history:[{timestamp:o,testName:e("playtest.sample.history.name","Sample Arena Smoke Test"),mode:"play",status:"passed",durationMs:4820,contextId:"sample_playtest_preview",contextSummary:r}],report:{markdown:e("playtest.sample.report.markdown",`# Sample Arena Smoke Test
|
|
2
|
+
|
|
3
|
+
- Spawn flow: PASS
|
|
4
|
+
- HUD countdown: PASS
|
|
5
|
+
- Wave bootstrap: PASS
|
|
6
|
+
|
|
7
|
+
This is a sample preview. Live playtests and real reports are available with Pro.`),logs:e("playtest.sample.report.logs",`[sample] boot playtest preview
|
|
8
|
+
[sample] spawn protection active
|
|
9
|
+
[sample] hud countdown rendered
|
|
10
|
+
[sample] wave one completed
|
|
11
|
+
[sample] preview report finished`),contextId:"sample_playtest_preview",contextSummary:r}}}const Y="_page_18pmo_2",Z="_sampleBanner_18pmo_9",q="_sampleBannerRow_18pmo_21",J="_sampleBannerMain_18pmo_28",K="_sampleBadge_18pmo_35",X="_sampleTitle_18pmo_50",ee="_sampleMessage_18pmo_57",te="_sampleActions_18pmo_64",se="_primaryAction_18pmo_72",ae="_secondaryAction_18pmo_73",oe="_card_18pmo_109",re="_cardHeader_18pmo_116",ne="_clearButton_18pmo_128",le="_statusRow_18pmo_157",ie="_statusIndicator_18pmo_164",ce="_statusRunning_18pmo_172",pe="_statusPaused_18pmo_177",me="_statusNotRunning_18pmo_181",de="_statusLabel_18pmo_185",ue="_statusMeta_18pmo_192",he="_controlButtons_18pmo_198",ye="_btn_18pmo_205",_e="_btnPrimary_18pmo_227",xe="_btnDanger_18pmo_237",ge="_historyList_18pmo_249",ve="_historyItem_18pmo_257",Se="_historyItemSelected_18pmo_276",fe="_historyItemHeader_18pmo_281",be="_historyIcon_18pmo_287",je="_historyTimestamp_18pmo_292",we="_historyName_18pmo_299",Ne="_historyItemMeta_18pmo_309",Ce="_historyMode_18pmo_318",Ie="_historyDuration_18pmo_322",Le="_historyStatus_18pmo_326",Pe="_status_passed_18pmo_333",Re="_status_failed_18pmo_337",Be="_status_running_18pmo_341",Te="_historyError_18pmo_345",Me="_historyContext_18pmo_355",ke="_historyContextLine_18pmo_364",Ae="_historyContextLabel_18pmo_370",He="_reportContainer_18pmo_379",De="_reportContextPanel_18pmo_385",Ee="_reportContextRow_18pmo_395",$e="_reportContextLabel_18pmo_403",Ue="_reportSection_18pmo_411",Oe="_reportSectionHeader_18pmo_417",Fe="_reportMarkdown_18pmo_429",Ve="_reportLogs_18pmo_442",We="_emptyState_18pmo_457",ze="_emptyStateTitle_18pmo_464",Ge="_emptyStateMessage_18pmo_472",Qe="_upgradePanel_18pmo_481",Ye="_upgradePanelIcon_18pmo_489",Ze="_upgradePanelTitle_18pmo_494",qe="_upgradePanelDesc_18pmo_502",Je="_benefitList_18pmo_512",Ke="_benefitItem_18pmo_523",Xe="_upgradeActions_18pmo_538",s={page:Y,sampleBanner:Z,sampleBannerRow:q,sampleBannerMain:J,sampleBadge:K,sampleTitle:X,sampleMessage:ee,sampleActions:te,primaryAction:se,secondaryAction:ae,card:oe,cardHeader:re,clearButton:ne,statusRow:le,statusIndicator:ie,statusRunning:ce,statusPaused:pe,statusNotRunning:me,statusLabel:de,statusMeta:ue,controlButtons:he,btn:ye,btnPrimary:_e,btnDanger:xe,historyList:ge,historyItem:ve,historyItemSelected:Se,historyItemHeader:fe,historyIcon:be,historyTimestamp:je,historyName:we,historyItemMeta:Ne,historyMode:Ce,historyDuration:Ie,historyStatus:Le,status_passed:Pe,status_failed:Re,status_running:Be,historyError:Te,historyContext:Me,historyContextLine:ke,historyContextLabel:Ae,reportContainer:He,reportContextPanel:De,reportContextRow:Ee,reportContextLabel:$e,reportSection:Ue,reportSectionHeader:Oe,reportMarkdown:Fe,reportLogs:Ve,emptyState:We,emptyStateTitle:ze,emptyStateMessage:Ge,upgradePanel:Qe,upgradePanelIcon:Ye,upgradePanelTitle:Ze,upgradePanelDesc:qe,benefitList:Je,benefitItem:Ke,upgradeActions:Xe};function j(e){return e.trim().toLowerCase()}function et(e){switch(j(e)){case"passed":return"✅";case"failed":return"❌";case"running":return"⏱";default:return"❓"}}function tt(e,o){switch(j(o)){case"run":return e("playtest.status.mode.run","Run");case"server":return e("playtest.status.mode.server","Server");case"edit":return e("playtest.status.mode.edit","Edit");case"play":return e("playtest.status.mode.play","Play");default:return o}}function st(e,o){switch(j(o)){case"passed":return e("playtest.history.status.passed","Passed");case"failed":return e("playtest.history.status.failed","Failed");case"running":return e("playtest.history.status.running","Running");default:return e("playtest.history.status.unknown","Unknown")}}function at(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function ot({entries:e,onSelect:o,selectedTimestamp:r}){const{t:n}=N();return e.length===0?t.jsx("div",{className:s.emptyState,children:n("playtest.history.empty","No test results yet")}):t.jsx("div",{className:s.historyList,children:e.map(a=>{var i,p,c,d,u,h;const m=a.timestamp===r;return t.jsxs("button",{className:`${s.historyItem} ${m?s.historyItemSelected:""}`,onClick:()=>o(a.timestamp),children:[t.jsxs("div",{className:s.historyItemHeader,children:[t.jsx("span",{className:s.historyIcon,children:et(a.status)}),t.jsx("span",{className:s.historyTimestamp,children:a.timestamp}),t.jsx("span",{className:s.historyName,children:a.testName})]}),t.jsxs("div",{className:s.historyItemMeta,children:[t.jsx(S,{text:n("playtest.history.mode.tooltip","Playtest mode used for this recorded test run."),children:t.jsxs("span",{className:s.historyMode,children:[n("playtest.history.mode","Mode"),": ",tt(n,a.mode)]})}),t.jsx("span",{className:s.historyDuration,children:at(a.durationMs)}),t.jsx(S,{text:n("playtest.history.status.tooltip","Recorded result state for this automated playtest run."),children:t.jsx("span",{className:`${s.historyStatus} ${s[`status_${j(a.status)}`]??""}`,children:st(n,a.status)})})]}),a.errorMessage&&t.jsx("div",{className:s.historyError,children:a.errorMessage}),(a.contextId||((i=a.contextSummary)==null?void 0:i.testScenario)||((p=a.contextSummary)==null?void 0:p.expectedBehavior)||((c=a.contextSummary)==null?void 0:c.observedBehavior))&&t.jsxs("div",{className:s.historyContext,children:[a.contextId&&t.jsxs("div",{className:s.historyContextLine,children:[t.jsx("span",{className:s.historyContextLabel,children:n("playtest.context.contextId","Context ID")}),t.jsx("span",{children:a.contextId})]}),((d=a.contextSummary)==null?void 0:d.testScenario)&&t.jsxs("div",{className:s.historyContextLine,children:[t.jsx("span",{className:s.historyContextLabel,children:n("playtest.context.why","Why this test ran")}),t.jsx("span",{children:a.contextSummary.testScenario})]}),((u=a.contextSummary)==null?void 0:u.expectedBehavior)&&t.jsxs("div",{className:s.historyContextLine,children:[t.jsx("span",{className:s.historyContextLabel,children:n("playtest.context.expected","Expected")}),t.jsx("span",{children:a.contextSummary.expectedBehavior})]}),((h=a.contextSummary)==null?void 0:h.observedBehavior)&&t.jsxs("div",{className:s.historyContextLine,children:[t.jsx("span",{className:s.historyContextLabel,children:n("playtest.context.observed","Observed")}),t.jsx("span",{children:a.contextSummary.observedBehavior})]})]})]},a.timestamp)})})}function rt({report:e}){var n,a,m,i,p,c;const{t:o}=N(),r=!!((n=e.contextSummary)!=null&&n.testScenario||(a=e.contextSummary)!=null&&a.expectedBehavior||(m=e.contextSummary)!=null&&m.observedBehavior);return t.jsxs("div",{className:s.reportContainer,children:[r&&t.jsxs("div",{className:s.reportContextPanel,children:[((i=e.contextSummary)==null?void 0:i.testScenario)&&t.jsxs("div",{className:s.reportContextRow,children:[t.jsx("span",{className:s.reportContextLabel,children:o("playtest.context.why","Why this test ran")}),t.jsx("span",{children:e.contextSummary.testScenario})]}),((p=e.contextSummary)==null?void 0:p.expectedBehavior)&&t.jsxs("div",{className:s.reportContextRow,children:[t.jsx("span",{className:s.reportContextLabel,children:o("playtest.context.expected","Expected")}),t.jsx("span",{children:e.contextSummary.expectedBehavior})]}),((c=e.contextSummary)==null?void 0:c.observedBehavior)&&t.jsxs("div",{className:s.reportContextRow,children:[t.jsx("span",{className:s.reportContextLabel,children:o("playtest.context.observed","Observed")}),t.jsx("span",{children:e.contextSummary.observedBehavior})]})]}),e.markdown&&t.jsxs("div",{className:s.reportSection,children:[t.jsx("div",{className:s.reportSectionHeader,children:t.jsx(S,{text:o("playtest.report.content.tooltip","Markdown summary for the selected automated playtest run."),children:t.jsx("span",{children:o("playtest.report.content","Report")})})}),t.jsx("pre",{className:s.reportMarkdown,children:e.markdown})]}),e.logs&&t.jsxs("div",{className:s.reportSection,children:[t.jsx("div",{className:s.reportSectionHeader,children:t.jsx(S,{text:o("playtest.report.logs.tooltip","Execution logs captured for the selected automated playtest run."),children:t.jsx("span",{children:o("playtest.report.logs","Logs")})})}),t.jsx("pre",{className:s.reportLogs,children:e.logs})]}),!e.markdown&&!e.logs&&t.jsx("div",{className:s.emptyState,children:o("playtest.report.empty","No report content available")})]})}function ut(){var R;const{t:e}=N(),{trackEvent:o}=D(),{tier:r,loading:n}=E(),a=!n&&r==="basic",[m,i]=l.useState(null),p=G({enabled:!a,placeId:m}),{show:c}=$(),[d,u]=l.useState(null),[h,g]=l.useState(!1),[f,y]=l.useState(!1),{history:x,selectedReport:w,loading:M}=p,_=a?Q(e):null,C=((R=_==null?void 0:_.history[0])==null?void 0:R.timestamp)??null,I=a?d??C:d,L=(_==null?void 0:_.history)??x,P=_&&I===C?_.report:w,k=a?!1:M,A=b=>{u(b),!a&&p.loadReport(b)},H=async()=>{y(!0);try{await p.clearHistory(),c(e("toast.clearSuccess","Cleared successfully"),"success"),g(!1),u(null)}catch{c(e("toast.clearFailed","Failed to clear data"),"error")}finally{y(!1)}};return t.jsxs("div",{className:s.page,children:[t.jsx(O,{title:e("page.playtest.title","Playtest"),description:e("page.playtest.description","Review automated playtest runs, saved reports, and result history."),helpTopicId:"playtest",helpState:{tier:r}}),!a&&t.jsx(F,{surface:"playtest",selectable:!0,selectedPlaceId:m,onSelectedPlaceIdChange:b=>{i(b),u(null)}}),a&&t.jsx("div",{className:s.sampleBanner,children:t.jsxs("div",{className:s.sampleBannerRow,children:[t.jsxs("div",{className:s.sampleBannerMain,children:[t.jsx("div",{className:s.sampleBadge,children:e("playtest.sample.badge","Preview of the Pro playtest view")}),t.jsx("div",{className:s.sampleTitle,children:e("playtest.sample.title","You are previewing the report viewer that becomes available after upgrading to Pro.")}),t.jsx("div",{className:s.sampleMessage,children:e("playtest.sample.message","This preview uses sample data. Real playtest history management and stored reports unlock with Pro.")})]}),t.jsx("div",{className:s.sampleActions,children:t.jsx("a",{className:s.primaryAction,href:U.playtest,target:"_blank",rel:"noreferrer",onClick:()=>o("dashboard_click_event",{click_target:"upgrade_cta",placement:"playtest_sample_banner",page:"playtest"}),children:e("tier.upgrade","View Pro")})})]})}),t.jsxs("div",{className:s.card,children:[t.jsxs("div",{className:s.cardHeader,children:[t.jsx(B,{label:e("playtest.history.title","Test History"),tooltip:e("playtest.history.title.tooltip","Recorded automated playtest runs for this project.")}),a?t.jsx(S,{text:e("playtest.sample.clearDisabled","Available with Pro for live playtest history."),children:t.jsx("span",{children:t.jsx("button",{className:s.clearButton,disabled:!0,children:e("common.clear","Clear")})})}):t.jsx("button",{className:s.clearButton,onClick:()=>{o("dashboard_click_event",{click_target:"playtest_clear_history",page:"playtest"}),g(!0)},children:e("common.clear","Clear")})]}),k?t.jsx("div",{className:s.emptyState,children:e("common.loading","Loading...")}):L.length===0?t.jsxs("div",{className:s.emptyState,children:[t.jsx("div",{className:s.emptyStateTitle,children:e("playtest.empty.title","No playtest results yet")}),t.jsx("div",{className:s.emptyStateMessage,children:e("playtest.empty.message","Test results for this place will appear here after the AI Agent runs a Playtest.")})]}):t.jsx(ot,{entries:L,onSelect:A,selectedTimestamp:I??void 0})]}),P&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:t.jsx(B,{label:e("playtest.report.title","Selected Report"),tooltip:e("playtest.report.title.tooltip","Detailed output for the currently selected automated playtest run.")})}),t.jsx(rt,{report:P})]}),!a&&t.jsx(V,{open:h,title:e("playtest.clear.title","Clear test history?"),message:e("playtest.clear.message","This permanently removes the stored playtest reports for the current place."),cancelLabel:e("common.cancel","Cancel"),confirmLabel:e("common.clear","Clear"),loading:f,onCancel:()=>!f&&g(!1),onConfirm:H})]})}export{ut as Component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._page_18pmo_2{display:flex;flex-direction:column;gap:16px;max-width:900px}._sampleBanner_18pmo_9{display:flex;flex-direction:column;gap:12px;padding:18px 20px;border:1px solid var(--pro-border);border-radius:var(--radius);background:linear-gradient(135deg,#f0bd5829,#f0bd5808 55%),var(--bg-card)}._sampleBannerRow_18pmo_21{display:flex;align-items:center;justify-content:space-between;gap:20px}._sampleBannerMain_18pmo_28{display:flex;flex-direction:column;gap:8px;min-width:0}._sampleBadge_18pmo_35{width:fit-content;padding:0;border-radius:0;background:none;border:none;color:var(--pro-text);font-family:var(--font-label);font-size:11px;font-weight:600;letter-spacing:.02em;text-transform:none;opacity:.92}._sampleTitle_18pmo_50{font-family:var(--font-label);font-size:16px;font-weight:600;color:var(--text-primary)}._sampleMessage_18pmo_57{max-width:560px;color:var(--text-secondary);font-size:13px;line-height:1.5}._sampleActions_18pmo_64{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}._primaryAction_18pmo_72,._secondaryAction_18pmo_73{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:0 14px;border-radius:var(--radius-control);font-family:var(--font-label);font-size:12px;text-decoration:none;transition:background var(--transition),border-color var(--transition),opacity var(--transition)}._secondaryAction_18pmo_73{border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer}._secondaryAction_18pmo_73:hover{border-color:var(--accent);background:var(--accent-dim)}._primaryAction_18pmo_72{border:1px solid var(--pro-badge);background:var(--pro-badge);color:var(--pro-text-on-badge)}._primaryAction_18pmo_72:hover{opacity:.9}._card_18pmo_109{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:16px 20px}._cardHeader_18pmo_116{font-family:var(--font-label);font-size:13px;font-weight:600;color:var(--text-primary);margin-bottom:12px;display:flex;align-items:center;justify-content:space-between;gap:8px}._clearButton_18pmo_128{border:1px solid var(--danger-border);background:var(--danger-bg);color:var(--danger-text);border-radius:var(--radius-control);padding:6px 12px;font-family:var(--font-label);font-size:12px;font-weight:600;cursor:pointer;transition:background var(--transition),border-color var(--transition),color var(--transition)}._clearButton_18pmo_128:hover:not(:disabled){background:var(--danger-hover-bg);border-color:var(--danger)}._clearButton_18pmo_128:focus-visible{outline:none;box-shadow:var(--focus-ring)}._clearButton_18pmo_128:disabled{cursor:not-allowed;opacity:.55}._statusRow_18pmo_157{display:flex;align-items:center;gap:12px;margin-bottom:8px}._statusIndicator_18pmo_164{display:inline-block;width:8px;height:8px;border-radius:50%;flex-shrink:0}._statusRunning_18pmo_172{background:var(--success);box-shadow:0 0 6px var(--success)}._statusPaused_18pmo_177{background:var(--warning)}._statusNotRunning_18pmo_181{background:var(--text-muted)}._statusLabel_18pmo_185{font-family:var(--font-code);font-size:13px;font-weight:600;color:var(--text-primary)}._statusMeta_18pmo_192{font-family:var(--font-code);font-size:12px;color:var(--text-secondary)}._controlButtons_18pmo_198{display:flex;gap:8px;margin-top:12px}._btn_18pmo_205{font-family:var(--font-label);font-size:12px;padding:6px 14px;border-radius:var(--radius-control);border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;transition:background var(--transition),border-color var(--transition)}._btn_18pmo_205:hover{border-color:var(--accent);background:var(--accent-dim)}._btn_18pmo_205:disabled{opacity:.4;pointer-events:none}._btnPrimary_18pmo_227{background:var(--accent);color:var(--bg-card);border-color:var(--accent)}._btnPrimary_18pmo_227:hover{opacity:.9}._btnDanger_18pmo_237{border-color:var(--danger-border);background:var(--danger-bg);color:var(--danger-text)}._btnDanger_18pmo_237:hover{border-color:var(--danger);background:var(--danger-hover-bg)}._historyList_18pmo_249{display:flex;flex-direction:column;gap:4px;max-height:320px;overflow-y:auto}._historyItem_18pmo_257{display:flex;flex-direction:column;gap:4px;padding:8px 12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-card);cursor:pointer;text-align:left;width:100%;font-family:inherit;transition:border-color var(--transition)}._historyItem_18pmo_257:hover{border-color:var(--accent)}._historyItemSelected_18pmo_276{border-color:var(--accent);background:var(--accent-dim)}._historyItemHeader_18pmo_281{display:flex;align-items:center;gap:8px}._historyIcon_18pmo_287{font-size:14px;flex-shrink:0}._historyTimestamp_18pmo_292{font-family:var(--font-code);font-size:11px;color:var(--text-muted);flex-shrink:0}._historyName_18pmo_299{font-family:var(--font-label);font-size:12px;font-weight:500;color:var(--text-primary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._historyItemMeta_18pmo_309{display:flex;gap:12px;font-family:var(--font-code);font-size:11px;color:var(--text-secondary);padding-left:22px}._historyMode_18pmo_318{color:var(--text-muted)}._historyDuration_18pmo_322{color:var(--text-secondary)}._historyStatus_18pmo_326{font-weight:500;text-transform:uppercase;font-size:10px;letter-spacing:.04em}._status_passed_18pmo_333{color:var(--success)}._status_failed_18pmo_337{color:var(--error)}._status_running_18pmo_341{color:var(--accent)}._historyError_18pmo_345{font-family:var(--font-code);font-size:11px;color:var(--error);padding-left:22px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._historyContext_18pmo_355{display:flex;flex-direction:column;gap:4px;padding-left:22px;color:var(--text-secondary);font-size:11px}._historyContextLine_18pmo_364{display:flex;flex-direction:column;gap:2px}._historyContextLabel_18pmo_370{font-family:var(--font-label);font-size:10px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em}._reportContainer_18pmo_379{display:flex;flex-direction:column;gap:12px}._reportContextPanel_18pmo_385{display:flex;flex-direction:column;gap:10px;padding:12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-secondary)}._reportContextRow_18pmo_395{display:flex;flex-direction:column;gap:4px;color:var(--text-primary);font-size:12px}._reportContextLabel_18pmo_403{font-family:var(--font-label);font-size:10px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em}._reportSection_18pmo_411{border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}._reportSectionHeader_18pmo_417{font-family:var(--font-label);font-size:11px;font-weight:600;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.06em;padding:6px 12px;background:var(--bg-secondary);border-bottom:1px solid var(--border)}._reportMarkdown_18pmo_429{padding:12px;margin:0;font-family:var(--font-code);font-size:12px;line-height:1.6;color:var(--text-primary);white-space:pre-wrap;word-break:break-word;max-height:400px;overflow-y:auto}._reportLogs_18pmo_442{padding:12px;margin:0;font-family:var(--font-code);font-size:11px;line-height:1.5;color:var(--text-secondary);white-space:pre-wrap;word-break:break-word;max-height:240px;overflow-y:auto;background:var(--bg-secondary)}._emptyState_18pmo_457{text-align:center;padding:32px 16px;color:var(--text-muted);font-size:13px}._emptyStateTitle_18pmo_464{font-family:var(--font-label);font-size:14px;font-weight:600;color:var(--text-secondary);margin-bottom:8px}._emptyStateMessage_18pmo_472{font-size:12px;color:var(--text-muted);max-width:360px;margin:0 auto;line-height:1.5}._upgradePanel_18pmo_481{background:var(--bg-secondary);border:1px solid var(--border);border-radius:var(--radius);padding:32px 24px;text-align:center}._upgradePanelIcon_18pmo_489{font-size:32px;margin-bottom:12px}._upgradePanelTitle_18pmo_494{font-family:var(--font-label);font-size:15px;font-weight:600;color:var(--text-primary);margin-bottom:8px}._upgradePanelDesc_18pmo_502{font-size:13px;color:var(--text-secondary);margin-bottom:16px;max-width:400px;margin-left:auto;margin-right:auto;line-height:1.5}._benefitList_18pmo_512{list-style:none;padding:0;margin:0 auto 16px;display:flex;flex-direction:column;gap:4px;max-width:360px;text-align:left}._benefitItem_18pmo_523{font-size:12px;color:var(--text-secondary);padding-left:16px;position:relative}._benefitItem_18pmo_523:before{content:"+";position:absolute;left:0;color:var(--accent);font-weight:600}._upgradeActions_18pmo_538{display:flex;gap:8px;justify-content:center}@media(max-width:720px){._sampleBannerRow_18pmo_21{flex-direction:column;align-items:stretch}._sampleActions_18pmo_64{justify-content:stretch}._primaryAction_18pmo_72,._secondaryAction_18pmo_73{width:100%}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._card_g3as3_4{border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-card);padding:16px 20px;display:flex;flex-direction:column;gap:14px}._cardEmbedded_g3as3_14{border:none;border-radius:0;background:transparent;padding:14px 0 0}._cardTitle_g3as3_21{margin:0;font-size:13px;font-weight:600;color:var(--text-primary);letter-spacing:.02em}._usageRow_g3as3_30{display:flex;flex-direction:column;gap:4px}._usageTotal_g3as3_36{font-size:13px;font-weight:600;color:var(--text-primary)}._usageBreakdown_g3as3_42{font-size:12px;color:var(--text-muted)}._usageCounts_g3as3_47{font-size:12px;color:var(--text-secondary)}._divider_g3as3_53{border:none;border-top:1px solid var(--border);margin:0}._lastRunRow_g3as3_60{font-size:12px;color:var(--text-secondary);display:flex;align-items:center;gap:6px;flex-wrap:wrap}._lastRunLabel_g3as3_69{color:var(--text-muted);font-weight:500;white-space:nowrap}._errorIcon_g3as3_75{color:var(--error-text);cursor:help;font-size:13px;line-height:1;position:relative}._errorIcon_g3as3_75:hover ._tooltip_g3as3_83{display:block}._tooltip_g3as3_83{display:none;position:absolute;bottom:calc(100% + 6px);left:50%;transform:translate(-50%);background:var(--bg-secondary);border:1px solid var(--border);border-radius:4px;padding:4px 8px;font-size:11px;color:var(--error-text);white-space:nowrap;z-index:10;pointer-events:none;box-shadow:0 2px 8px #0003}._cleanupRow_g3as3_106{display:flex;flex-wrap:wrap;gap:8px;align-items:center}._cleanupLabel_g3as3_113{font-size:12px;color:var(--text-muted);font-weight:500;white-space:nowrap}._cleanupBtn_g3as3_120{padding:5px 10px;border-radius:var(--radius-control);border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-secondary);font-family:var(--font-label);font-size:11px;cursor:pointer;white-space:nowrap;transition:border-color var(--transition),color var(--transition)}._cleanupBtn_g3as3_120:hover:not(:disabled){border-color:var(--accent);color:var(--text-primary)}._cleanupBtn_g3as3_120:disabled{opacity:.45;cursor:not-allowed}._cleanupBtnDanger_g3as3_143{border-color:var(--danger-border);background:var(--danger-bg);color:var(--danger-text)}._cleanupBtnDanger_g3as3_143:hover:not(:disabled){border-color:var(--danger);background:var(--danger-hover-bg);color:var(--danger-text)}._retentionSection_g3as3_156{display:flex;flex-direction:column;gap:10px}._retentionTitle_g3as3_162{margin:0;font-size:12px;font-weight:600;color:var(--text-muted);letter-spacing:.04em;text-transform:uppercase}._retentionFieldset_g3as3_171{display:flex;flex-direction:column;gap:10px;border:none;margin:0;padding:0;position:relative}._retentionFieldset_g3as3_171[disabled]{opacity:.5;pointer-events:none}._proOverlay_g3as3_186{position:absolute;top:0;right:0;bottom:0;left:0;cursor:not-allowed;z-index:1}._proOverlay_g3as3_186:hover ._tooltip_g3as3_83{display:block}._radioRow_g3as3_198{display:flex;align-items:center;gap:8px;flex-wrap:wrap}._radioLabel_g3as3_205{display:flex;align-items:center;gap:5px;font-size:13px;color:var(--text-secondary);cursor:pointer;-webkit-user-select:none;user-select:none;white-space:nowrap}._radioLabel_g3as3_205 input[type=radio]{width:14px;height:14px;cursor:pointer;accent-color:var(--accent);flex-shrink:0}._presetGroup_g3as3_225{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-left:20px}._presetBtn_g3as3_233{padding:3px 8px;border-radius:4px;border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-secondary);font-family:var(--font-label);font-size:11px;cursor:pointer;transition:border-color var(--transition),background var(--transition)}._presetBtn_g3as3_233:hover{border-color:var(--accent);color:var(--text-primary)}._presetBtnActive_g3as3_250{border-color:var(--accent);background:var(--accent-dim);color:var(--accent);font-weight:600}._freeInput_g3as3_257{width:72px;font-size:12px;padding:3px 7px;border:1px solid var(--border);border-radius:4px;background:var(--bg-secondary);color:var(--text-primary);font-family:inherit}._freeInput_g3as3_257:focus{outline:none;border-color:var(--accent)}._freeInput_g3as3_257._inputError_g3as3_273{border-color:var(--error-text)}._inputUnit_g3as3_277{font-size:11px;color:var(--text-muted);white-space:nowrap}._cascadeRow_g3as3_284{display:flex;align-items:center;gap:7px;font-size:13px;color:var(--text-secondary);cursor:pointer;-webkit-user-select:none;user-select:none}._cascadeRow_g3as3_284 input[type=checkbox]{flex-shrink:0}._retentionActions_g3as3_299{display:flex;gap:8px;flex-wrap:wrap}._saveBtn_g3as3_305{padding:6px 14px;border-radius:5px;border:1px solid transparent;background:var(--accent);color:var(--bg-card);font-family:var(--font-label);font-size:12px;font-weight:600;cursor:pointer;transition:opacity var(--transition)}._saveBtn_g3as3_305:hover:not(:disabled){opacity:.88}._saveBtn_g3as3_305:disabled{opacity:.45;cursor:not-allowed}._runNowBtn_g3as3_327{padding:6px 14px;border-radius:5px;border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-secondary);font-family:var(--font-label);font-size:12px;cursor:pointer;transition:border-color var(--transition),color var(--transition)}._runNowBtn_g3as3_327:hover:not(:disabled){border-color:var(--accent);color:var(--text-primary)}._runNowBtn_g3as3_327:disabled{opacity:.45;cursor:not-allowed}._errorMsg_g3as3_350{font-size:12px;color:var(--error-text);padding:4px 0}
|