@weppy/roblox-mcp 2.17.9 → 2.17.10
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 +20 -0
- package/README.md +14 -5
- package/dashboard/dist/assets/{AiPromptExamples-BpV5YtwH.js → AiPromptExamples-BSFrFYar.js} +1 -1
- package/dashboard/dist/assets/{AssetsPage-CBkKW012.js → AssetsPage-Bt9gZnJ_.js} +1 -1
- package/dashboard/dist/assets/ChangelogPage-C4tBBoXT.js +1 -0
- package/dashboard/dist/assets/{ConfirmModal-DD79xiWf.js → ConfirmModal-BbqpSaVw.js} +1 -1
- package/dashboard/dist/assets/ConnectionPage-BStKoHK8.css +1 -0
- package/dashboard/dist/assets/ConnectionPage-Sy7xUWtJ.js +6 -0
- package/dashboard/dist/assets/{ControlsPage-BxQAO5lE.js → ControlsPage-ECpr55X_.js} +1 -1
- package/dashboard/dist/assets/{GameChangeDetail-pof3XQ18.js → GameChangeDetail-DJ0xywJq.js} +1 -1
- package/dashboard/dist/assets/InfoLabel-DAd1I756.js +1 -0
- package/dashboard/dist/assets/OverviewPage-C2xJb1Wf.js +1 -0
- package/dashboard/dist/assets/{PageHeader-DUbueTLC.js → PageHeader-_z4Dtkbg.js} +1 -1
- package/dashboard/dist/assets/{PlaceSelectOptions-KRG4cS5y.js → PlaceSelectOptions-Dd_m61bQ.js} +1 -1
- package/dashboard/dist/assets/{PlaytestAiPromptExamples-BQ80VdK6.js → PlaytestAiPromptExamples-CNe0qWb1.js} +1 -1
- package/dashboard/dist/assets/{PlaytestPage-DNxnroWr.js → PlaytestPage-DZa14JH0.js} +18 -23
- package/dashboard/dist/assets/{SettingsPage-3tKUev9_.js → SettingsPage-BiDPnuz8.js} +1 -1
- package/dashboard/dist/assets/SyncPage-BIm9tW0s.css +1 -0
- package/dashboard/dist/assets/SyncPage-EcDvwdB8.js +1 -0
- package/dashboard/dist/assets/Tabs-BoD1I6c5.js +1 -0
- package/dashboard/dist/assets/{CurrentPlaceScope-B6NllTmu.css → Tabs-Ci4-OJm-.css} +1 -1
- package/dashboard/dist/assets/{TierPromoPanel-D_H_UgF4.js → TierPromoPanel-CQQdO5mK.js} +1 -1
- package/dashboard/dist/assets/ToolsPage-D7ovZ3QM.js +1 -0
- package/dashboard/dist/assets/TooltipText-NA7u0bu6.js +1 -0
- package/dashboard/dist/assets/{UiStudioPage-CkHLBCN0.js → UiStudioPage-wYZQClUu.js} +2 -2
- package/dashboard/dist/assets/{WhatsNewPage-D0l3SoZ9.js → WhatsNewPage-D3cvOOAD.js} +1 -1
- package/dashboard/dist/assets/{bot-DCwGDR4k.js → bot-D89pfHg8.js} +1 -1
- package/dashboard/dist/assets/{check-DBxi70_h.js → check-GVlTbKVy.js} +1 -1
- package/dashboard/dist/assets/{copy-bDdN4zua.js → copy-DVGVC27v.js} +1 -1
- package/dashboard/dist/assets/index-uP4eoQi-.js +746 -0
- package/dashboard/dist/assets/rotate-ccw-Dxk8CuFi.js +6 -0
- package/dashboard/dist/assets/sample-requests-CQy_WSFJ.js +1 -0
- package/dashboard/dist/assets/{trash-2-BH7PRW92.js → trash-2-CEfHj47n.js} +1 -1
- package/dashboard/dist/assets/useLiveUptime-BGDr-4gk.js +1 -0
- package/dashboard/dist/assets/{useSettings-B8q8Cuch.js → useSettings-kOu_k9zT.js} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/dist/index.js +170 -170
- package/package.json +1 -1
- package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
- package/dashboard/dist/assets/ChangelogPage-ChbHQhGx.js +0 -1
- package/dashboard/dist/assets/ConnectionPage-B3fGIK2X.css +0 -1
- package/dashboard/dist/assets/ConnectionPage-CywH0H2T.js +0 -6
- package/dashboard/dist/assets/CurrentPlaceScope-B0YLMs_a.js +0 -1
- package/dashboard/dist/assets/InfoLabel-CJVH3VF5.js +0 -1
- package/dashboard/dist/assets/OverviewPage-DStdjjf8.js +0 -1
- package/dashboard/dist/assets/StatusBadge-hrdvNb3-.js +0 -1
- package/dashboard/dist/assets/SyncPage-BgbrC3SP.css +0 -1
- package/dashboard/dist/assets/SyncPage-BtC4iYZE.js +0 -1
- package/dashboard/dist/assets/Tabs-CPTkUoYi.css +0 -1
- package/dashboard/dist/assets/Tabs-CXCAvK-b.js +0 -1
- package/dashboard/dist/assets/ToolsPage-SonaofpX.js +0 -1
- package/dashboard/dist/assets/TooltipText-CHM9zlD0.js +0 -1
- package/dashboard/dist/assets/index-MEBRUJOq.js +0 -714
- package/dashboard/dist/assets/sample-requests-DIskT9fc.js +0 -1
- package/dashboard/dist/assets/useLiveUptime-DtX2DhLL.js +0 -1
- /package/dashboard/dist/assets/{StatusBadge-C2zYt5iE.css → useLiveUptime-C2zYt5iE.css} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weppy/roblox-mcp",
|
|
3
|
-
"version": "2.17.
|
|
3
|
+
"version": "2.17.10",
|
|
4
4
|
"description": "MCP (Model Context Protocol) server for Roblox Studio integration - enables AI coding agents to interact with Roblox Studio in real-time",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o,b as P,D as Q,u as q,j as e,X as W,a as X,w as Y,c as J,e as ee,i as te,T as ae}from"./index-MEBRUJOq.js";import{B as ne,P as se}from"./PageHeader-DUbueTLC.js";import{C as ie}from"./ConfirmModal-DD79xiWf.js";import{C as ce}from"./CurrentPlaceScope-B0YLMs_a.js";import{T as O}from"./TooltipText-CHM9zlD0.js";import{C as oe,T as re}from"./Tabs-CXCAvK-b.js";import{I as le}from"./InfoLabel-CJVH3VF5.js";import{G as de}from"./GameChangeDetail-pof3XQ18.js";import"./ConfirmModal.module-DJksQHBd.js";import"./PlaceSelectOptions-KRG4cS5y.js";const ge=10;function me(t,i){return typeof i!="number"?t:`${t}?placeId=${encodeURIComponent(String(i))}`}function he(t){const i=(t==null?void 0:t.placeId)??null,[m,c]=o.useState([]),[n,s]=o.useState(0),[u,p]=o.useState(!1),[r,T]=o.useState(!0),[C,E]=o.useState(0),[f,z]=o.useState("all"),B=o.useRef(null),S=o.useCallback(async(y,v)=>{T(!0);try{const k={limit:String(ge),offset:String(y)};v!=="all"&&(k.status=v),typeof i=="number"&&(k.placeId=String(i));const w=await P.get("/api/dashboard/changelog",k);c(w.entries),s(w.total),p(w.hasMore)}catch{c([]),s(0),p(!1)}finally{T(!1)}},[i]),I=o.useCallback(()=>{S(C,f)},[S,C,f]),$=o.useCallback(async()=>{await P.post(me("/api/dashboard/changelog/clear",i)),c([]),s(0),p(!1)},[i]);return o.useEffect(()=>{S(C,f)},[S,C,f]),o.useEffect(()=>{const y=new Q;B.current=y,y.connect();const v=y.on("command",()=>{S(C,f)});return()=>{v(),y.disconnect(),B.current=null}},[S,C,f]),{entries:m,total:n,hasMore:u,loading:r,offset:C,statusFilter:f,setOffset:E,setStatusFilter:z,refresh:I,clear:$}}const ue="_card_qniob_2",pe="_header_qniob_27",fe="_statusBadge_qniob_34",ye="_statusDot_qniob_45",xe="_active_qniob_51",_e="_completed_qniob_60",be="_timeRange_qniob_68",Ce="_summaryList_qniob_75",Se="_summaryItem_qniob_81",ve="_summaryIcon_qniob_90",je="_summaryText_qniob_96",Ne="_progressBar_qniob_101",Te="_progressFill_qniob_110",Ie="_emptySummary_qniob_124",ke="_contextBlock_qniob_132",we="_contextLabel_qniob_141",$e="_contextValue_qniob_149",h={card:ue,header:pe,statusBadge:fe,statusDot:ye,active:xe,completed:_e,timeRange:be,summaryList:Ce,summaryItem:Se,summaryIcon:ve,summaryText:je,progressBar:Ne,progressFill:Te,emptySummary:Ie,contextBlock:ke,contextLabel:we,contextValue:$e};function H(t){if(!t)return"--:--";const i=new Date(t);return`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}`}function Be({entry:t,onClick:i,buttonRef:m}){var v,k,w,L,A,R,d,_,D,M;const{t:c}=q(),n=t.changeSummary,s=t.status==="active",u=t.isBootstrapOnly===!0,p=[],r=n.scriptsModified+n.scriptsCreated;if(r>0){const g=[];n.scriptsModified>0&&g.push(`${n.scriptsModified} ${c("changelog.card.modified","modified")}`),n.scriptsCreated>0&&g.push(`${n.scriptsCreated} ${c("changelog.card.created","created")}`);const x=`${r} ${c("changelog.card.scripts","scripts")} ${g.join(", ")}`;p.push({icon:"📝",text:x,tooltip:c("changelog.card.scripts.tooltip","Script changes made in this session.")})}const T=n.instancesCreated+n.instancesDeleted+n.instancesMoved;if(T>0){const g=[];n.instancesCreated>0&&g.push(`${n.instancesCreated} ${c("changelog.card.created","created")}`),n.instancesDeleted>0&&g.push(`${n.instancesDeleted} ${c("changelog.card.deleted","deleted")}`),n.instancesMoved>0&&g.push(`${n.instancesMoved} ${c("changelog.card.moved","moved")}`);const x=`${T} ${c("changelog.card.instances","instances")} ${g.join(", ")}`;p.push({icon:"🧱",text:x,tooltip:c("changelog.card.instances.tooltip","Instance create, delete, move, or clone changes in this session.")})}n.propertiesChanged>0&&p.push({icon:"🎨",text:`${n.propertiesChanged} ${c("changelog.card.propertiesChanged","properties changed")}`,tooltip:c("changelog.card.propertiesChanged.tooltip","Property value changes recorded for this session.")}),n.lightingChanged&&p.push({icon:"🌅",text:c("changelog.card.lightingConfigured","Lighting configured"),tooltip:c("changelog.card.lightingConfigured.tooltip","Lighting or atmosphere settings changed in this session.")}),n.terrainChanged&&p.push({icon:"⛰️",text:c("changelog.card.terrainConfigured","Terrain configured"),tooltip:c("changelog.card.terrainConfigured.tooltip","Terrain data or terrain settings changed in this session.")}),n.assetsInserted>0&&p.push({icon:"📦",text:`${n.assetsInserted} ${c("changelog.card.assetsInserted","assets inserted")}`,tooltip:c("changelog.card.assetsInserted.tooltip","Assets inserted into the place during this session.")});const C=H(t.startTime),E=s?c("changelog.card.inProgress","in progress"):t.endTime?H(t.endTime):"--:--",f=u?c("changelog.card.bootstrapStatus","Bootstrap"):s?c("changelog.card.active","Active"):c("changelog.card.completed","Completed"),z=u?c("changelog.card.bootstrapStatus.tooltip","This session only contains the initial sync bootstrap snapshot."):s?c("changelog.card.active.tooltip","This session is still receiving new game changes."):c("changelog.card.completed.tooltip","This session has ended and no more changes are expected."),B=u?c("changelog.card.bootstrapSummary","Initial sync snapshot"):c("changelog.card.noChanges","No changes yet"),S=u?c("changelog.card.bootstrapSummary.tooltip","Initial file sync writes are collapsed into a single bootstrap snapshot row."):c("changelog.card.noChanges.tooltip","No game changes have been extracted for this session yet."),I=(k=(v=t.contextSummary)==null?void 0:v.intent)==null?void 0:k.trim(),$=((R=(A=(L=(w=t.contextSummary)==null?void 0:w.affectedAreas)==null?void 0:L[0])==null?void 0:A.label)==null?void 0:R.trim())||((_=(d=t.contextSummary)==null?void 0:d.testScenario)==null?void 0:_.trim()),y=(M=(D=t.verificationSummary)==null?void 0:D.label)==null?void 0:M.trim();return e.jsxs("button",{ref:m,className:h.card,type:"button",onClick:g=>i(g.currentTarget),children:[e.jsxs("span",{className:h.header,children:[e.jsx(O,{text:z,children:e.jsxs("span",{className:`${h.statusBadge} ${s?h.active:h.completed}`,children:[e.jsx("span",{className:h.statusDot}),f]})}),e.jsxs("span",{className:h.timeRange,children:[C,"~",E]})]}),e.jsx("span",{className:h.summaryList,children:p.length>0?p.map((g,x)=>e.jsxs("span",{className:h.summaryItem,children:[e.jsx("span",{className:h.summaryIcon,children:g.icon}),e.jsx(O,{text:g.tooltip,children:e.jsx("span",{className:h.summaryText,children:g.text})})]},x)):e.jsx(O,{text:S,children:e.jsx("span",{className:h.emptySummary,style:{display:"block"},children:B})})}),I&&e.jsxs("span",{className:h.contextBlock,children:[e.jsx("span",{className:h.contextLabel,children:c("changelog.card.sessionIntent","Session intent")}),e.jsx("span",{className:h.contextValue,children:I})]}),!I&&$&&e.jsxs("span",{className:h.contextBlock,children:[e.jsx("span",{className:h.contextLabel,children:c("changelog.card.representativeArea","Representative area")}),e.jsx("span",{className:h.contextValue,children:$})]}),y&&e.jsxs("span",{className:h.contextBlock,children:[e.jsx("span",{className:h.contextLabel,children:c("changelog.card.verification","Verification")}),e.jsx("span",{className:h.contextValue,children:y})]}),s&&e.jsx("span",{className:h.progressBar,children:e.jsx("span",{className:h.progressFill})})]})}function ze(t){const i={scriptsModified:0,scriptsCreated:0,instancesCreated:0,instancesDeleted:0,instancesMoved:0,propertiesChanged:0,lightingChanged:!1,terrainChanged:!1,assetsInserted:0};for(const m of t)switch(m.category){case"script":m.changeType==="create"?i.scriptsCreated++:i.scriptsModified++;break;case"instance":m.changeType==="create"?i.instancesCreated++:m.changeType==="delete"?i.instancesDeleted++:m.changeType==="move"&&i.instancesMoved++;break;case"property":i.propertiesChanged++;break;case"lighting":i.lightingChanged=!0;break;case"terrain":i.terrainChanged=!0;break;case"asset":i.assetsInserted++;break}return i}function Ee(t){if(typeof t=="number")return{placeId:String(t)}}function Le(t,i){const[m,c]=o.useState(""),[n,s]=o.useState(""),[u,p]=o.useState(),[r,T]=o.useState("completed"),[C,E]=o.useState([]),[f,z]=o.useState([]),[B,S]=o.useState([]),[I,$]=o.useState(),[y,v]=o.useState(),[k,w]=o.useState(),[L,A]=o.useState({scriptsModified:0,scriptsCreated:0,instancesCreated:0,instancesDeleted:0,instancesMoved:0,propertiesChanged:0,lightingChanged:!1,terrainChanged:!1,assetsInserted:0}),[R,d]=o.useState(!0),[_,D]=o.useState(null),M=o.useCallback(async()=>{if(t){d(!0),D(null);try{const g=Ee(i),[x,G]=await Promise.all([g?P.get(`/api/dashboard/changelog/${t}`,g):P.get(`/api/dashboard/changelog/${t}`),g?P.get(`/api/dashboard/changelog/${t}/changes`,g):P.get(`/api/dashboard/changelog/${t}/changes`)]);c(x.entryId),s(x.startTime),p(x.endTime),T(x.status),E(x.entries),z(x.failures),$(x.contextSummary),v(x.replayMetadata),w(x.verificationSummary),S(G.changes),A(ze(G.changes))}catch(g){D(g instanceof Error?g.message:"Failed to load changelog detail")}finally{d(!1)}}},[t,i]);return o.useEffect(()=>{M()},[M]),{entryId:m,startTime:n,endTime:u,status:r,entries:C,failures:f,changes:B,changeSummary:L,contextSummary:I,replayMetadata:y,verificationSummary:k,loading:R,error:_,refresh:M}}const Ae={script:"📝",instance:"🧱",property:"🎨",lighting:"🌅",terrain:"⛰️",asset:"📦"};function Re(t){return Ae[t]??"❓"}const Me="_dialogContent_197zf_2",Oe="_dialogHeader_197zf_10",De="_dialogTitleGroup_197zf_20",Fe="_dialogTitle_197zf_20",Pe="_dialogMeta_197zf_36",Ge="_dialogClose_197zf_43",Ke="_dialogBody_197zf_68",Ve="_page_197zf_77",qe="_headerTime_197zf_84",Ue="_dialogActions_197zf_90",He="_retryButton_197zf_96",Ze="_statusActive_197zf_129",Qe="_statusCompleted_197zf_134",We="_section_197zf_139",Xe="_sectionTitle_197zf_146",Ye="_summaryGrid_197zf_159",Je="_summaryCard_197zf_165",et="_summaryCardActive_197zf_188",tt="_summaryIcon_197zf_193",at="_summaryCount_197zf_199",nt="_summaryLabel_197zf_207",st="_contextGrid_197zf_217",it="_contextRow_197zf_223",ct="_contextKey_197zf_229",ot="_contextValue_197zf_237",rt="_timelineFilter_197zf_245",lt="_filterLabel_197zf_253",dt="_filterSelect_197zf_259",gt="_ownershipToggle_197zf_269",mt="_timeline_197zf_245",ht="_timelineEntry_197zf_297",ut="_timelineTime_197zf_326",pt="_timelineIcon_197zf_334",ft="_timelineBody_197zf_339",yt="_timelineSummary_197zf_345",xt="_timelineTarget_197zf_353",_t="_timelineConfidence_197zf_361",bt="_ownershipBadge_197zf_370",Ct="_confidenceExact_197zf_378",St="_confidencePartial_197zf_383",vt="_confidenceAfterOnly_197zf_388",jt="_confidenceIntentOnly_197zf_393",Nt="_confidenceUnknown_197zf_398",Tt="_timelineExpanded_197zf_404",It="_empty_197zf_413",kt="_loading_197zf_422",wt="_error_197zf_431",a={dialogContent:Me,dialogHeader:Oe,dialogTitleGroup:De,dialogTitle:Fe,dialogMeta:Pe,dialogClose:Ge,dialogBody:Ke,page:Ve,headerTime:qe,dialogActions:Ue,retryButton:He,statusActive:Ze,statusCompleted:Qe,section:We,sectionTitle:Xe,summaryGrid:Ye,summaryCard:Je,summaryCardActive:et,summaryIcon:tt,summaryCount:at,summaryLabel:nt,contextGrid:st,contextRow:it,contextKey:ct,contextValue:ot,timelineFilter:rt,filterLabel:lt,filterSelect:dt,ownershipToggle:gt,timeline:mt,timelineEntry:ht,timelineTime:ut,timelineIcon:pt,timelineBody:ft,timelineSummary:yt,timelineTarget:xt,timelineConfidence:_t,ownershipBadge:bt,confidenceExact:Ct,confidencePartial:St,confidenceAfterOnly:vt,confidenceIntentOnly:jt,confidenceUnknown:Nt,timelineExpanded:Tt,empty:It,loading:kt,error:wt},Z=[{key:"script",icon:"📝",labelKey:"changelog.category.script"},{key:"instance",icon:"🧱",labelKey:"changelog.category.instance"},{key:"property",icon:"🎨",labelKey:"changelog.category.property"},{key:"lighting",icon:"🌅",labelKey:"changelog.category.lighting"},{key:"terrain",icon:"⛰️",labelKey:"changelog.category.terrain"},{key:"asset",icon:"📦",labelKey:"changelog.category.asset"}];function V(t){if(!t)return"--:--";const i=new Date(t);return`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}`}function $t(t){if(!t)return"--:--:--";const i=new Date(t);return`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}:${String(i.getSeconds()).padStart(2,"0")}`}function Bt(t,i){if(!t||!i)return"";const m=new Date(i).getTime()-new Date(t).getTime();return m<0?"":`${Math.round(m/6e4)}min`}function zt(t){switch(t){case"exact":return a.confidenceExact;case"partial":return a.confidencePartial;case"after-only":return a.confidenceAfterOnly;case"intent-only":return a.confidenceIntentOnly;default:return a.confidenceUnknown}}function Et(t,i){switch(i){case"exact":return t("changelog.detail.confidence.exact","Exact");case"partial":return t("changelog.detail.confidence.partial","Partial");case"after-only":return t("changelog.detail.confidence.afterOnly","After only");case"intent-only":return t("changelog.detail.confidence.intentOnly","Intent only");default:return t("changelog.detail.confidence.unknown","Unknown")}}function Lt(t,i){switch(i){case"exact":return t("changelog.detail.confidence.exact.tooltip","Both the before and after state were confirmed for this change.");case"partial":return t("changelog.detail.confidence.partial.tooltip","Only part of the before and after state could be confirmed for this change.");case"after-only":return t("changelog.detail.confidence.afterOnly.tooltip","Only the resulting state after the change could be confirmed.");case"intent-only":return t("changelog.detail.confidence.intentOnly.tooltip","Only the requested action was recorded, not the resulting state.");default:return t("changelog.detail.confidence.unknown.tooltip","This change could not be confidently classified from the available data.")}}function At(t,i){switch(i){case"user_source":return t("changelog.ownership.userSource","User source");case"canonical_mirror":return t("changelog.ownership.canonicalMirror","Mirror metadata");case"generated":return t("changelog.ownership.generated","Generated");default:return null}}function Rt({entryId:t,placeId:i,onClose:m,returnFocusTo:c=null}){var v,k,w,L,A,R,d,_,D,M,g,x,G,U;const{t:n}=q(),s=Le(t,i),[u,p]=o.useState("all"),[r,T]=o.useState(!0),[C,E]=o.useState(null),f=o.useMemo(()=>{const l=r?s.changes:s.changes.filter(b=>b.artifactOwnership!=="generated");return[...u==="all"?l:l.filter(b=>b.category===u)].reverse()},[s.changes,u,r]),z=s.changes.some(l=>l.artifactOwnership==="generated"),B=Bt(s.startTime,s.endTime),S=s.endTime?`${V(s.startTime)} → ${V(s.endTime)} (${B})`:`${V(s.startTime)} → ${n("changelog.card.inProgress","in progress")}`,I=!!((v=s.contextSummary)!=null&&v.intent||(k=s.contextSummary)!=null&&k.testScenario||(w=s.contextSummary)!=null&&w.expectedBehavior||(L=s.contextSummary)!=null&&L.observedBehavior),$=!!((A=s.verificationSummary)!=null&&A.label||(R=s.verificationSummary)!=null&&R.status||(d=s.verificationSummary)!=null&&d.testTimestamp),y=n("changelog.detail.dialogLabel","Changelog detail");return e.jsx(oe,{open:!0,ariaLabel:y,onClose:m,returnFocusTo:c,testId:"changelog-detail-backdrop",children:e.jsxs("div",{className:a.dialogContent,children:[e.jsxs("div",{className:a.dialogHeader,children:[e.jsxs("div",{className:a.dialogTitleGroup,children:[e.jsx("h2",{className:a.dialogTitle,children:y}),!s.loading&&!s.error&&e.jsxs("div",{className:a.dialogMeta,children:[e.jsx("span",{className:a.headerTime,children:S}),e.jsx(O,{text:s.status==="active"?n("changelog.card.active.tooltip","This session is still receiving new game changes."):n("changelog.card.completed.tooltip","This session has ended and no more changes are expected."),children:e.jsx("span",{className:s.status==="active"?a.statusActive:a.statusCompleted,children:s.status==="active"?n("changelog.card.active","Active"):n("changelog.card.completed","Completed")})})]})]}),e.jsx("button",{className:a.dialogClose,type:"button","aria-label":n("common.close","Close"),onClick:m,children:e.jsx(W,{size:18,"aria-hidden":"true"})})]}),e.jsxs("div",{className:a.dialogBody,children:[s.loading&&e.jsx("div",{className:a.loading,children:n("common.loading","Loading...")}),s.error&&e.jsxs("div",{className:a.error,children:[e.jsx("span",{children:s.error}),e.jsxs("div",{className:a.dialogActions,children:[e.jsx("button",{className:a.retryButton,type:"button",onClick:s.refresh,children:n("common.retry","Retry")}),e.jsx("button",{className:a.retryButton,type:"button",onClick:m,children:n("common.close","Close")})]})]}),!s.loading&&!s.error&&e.jsxs("div",{className:a.page,children:[e.jsxs("div",{className:a.section,children:[e.jsx("div",{className:a.sectionTitle,children:e.jsx(O,{text:n("changelog.detail.changeSummary.tooltip","Counts of extracted game changes grouped by category for this session."),children:e.jsx("span",{children:n("changelog.detail.changeSummary","Change Summary")})})}),e.jsx("div",{className:a.summaryGrid,children:Z.map(l=>{const j=s.changeSummary;let b;switch(l.key){case"script":b=j.scriptsModified+j.scriptsCreated;break;case"instance":b=j.instancesCreated+j.instancesDeleted+j.instancesMoved;break;case"property":b=j.propertiesChanged;break;case"lighting":b=j.lightingChanged?1:0;break;case"terrain":b=j.terrainChanged?1:0;break;case"asset":b=j.assetsInserted;break;default:b=0}const F=u===l.key;return e.jsxs("button",{type:"button",className:`${a.summaryCard} ${F?a.summaryCardActive:""}`,"aria-label":`${n(l.labelKey,l.key)}: ${b}`,"aria-pressed":F,onClick:()=>p(F?"all":l.key),children:[e.jsx("span",{className:a.summaryIcon,children:l.icon}),e.jsx("span",{className:a.summaryCount,children:b}),e.jsx("span",{className:a.summaryLabel,children:n(l.labelKey,l.key)})]},l.key)})})]}),I&&e.jsxs("div",{className:a.section,children:[e.jsx("div",{className:a.sectionTitle,children:e.jsx(O,{text:n("changelog.detail.context.tooltip","Structured execution context captured for this changelog session."),children:e.jsx("span",{children:n("changelog.detail.context.title","Context Summary")})})}),e.jsxs("div",{className:a.contextGrid,children:[((_=s.contextSummary)==null?void 0:_.intent)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("changelog.card.sessionIntent","Session intent")}),e.jsx("span",{className:a.contextValue,children:s.contextSummary.intent})]}),((D=s.contextSummary)==null?void 0:D.testScenario)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("playtest.context.why","Why this test ran")}),e.jsx("span",{className:a.contextValue,children:s.contextSummary.testScenario})]}),((M=s.contextSummary)==null?void 0:M.expectedBehavior)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("playtest.context.expected","Expected")}),e.jsx("span",{className:a.contextValue,children:s.contextSummary.expectedBehavior})]}),((g=s.contextSummary)==null?void 0:g.observedBehavior)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("playtest.context.observed","Observed")}),e.jsx("span",{className:a.contextValue,children:s.contextSummary.observedBehavior})]})]})]}),$&&e.jsxs("div",{className:a.section,children:[e.jsx("div",{className:a.sectionTitle,children:e.jsx(O,{text:n("changelog.detail.verification.tooltip","Verification signals linked to this changelog session."),children:e.jsx("span",{children:n("changelog.detail.verification.title","Verification")})})}),e.jsxs("div",{className:a.contextGrid,children:[((x=s.verificationSummary)==null?void 0:x.label)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("changelog.detail.verification.label","Result")}),e.jsx("span",{className:a.contextValue,children:s.verificationSummary.label})]}),((G=s.verificationSummary)==null?void 0:G.status)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("changelog.detail.verification.status","Status")}),e.jsx("span",{className:a.contextValue,children:s.verificationSummary.status})]}),((U=s.verificationSummary)==null?void 0:U.testTimestamp)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("changelog.detail.verification.timestamp","Recorded at")}),e.jsx("span",{className:a.contextValue,children:s.verificationSummary.testTimestamp})]})]})]}),e.jsxs("div",{className:a.section,children:[e.jsx("div",{className:a.sectionTitle,children:e.jsx(O,{text:n("changelog.detail.changeTimeline.tooltip","Chronological list of extracted game changes for this session."),children:e.jsx("span",{children:n("changelog.detail.changeTimeline","Change Timeline")})})}),e.jsxs("div",{className:a.timelineFilter,children:[e.jsx("span",{className:a.filterLabel,children:e.jsx(le,{label:`${n("changelog.detail.filterCategory","Category")}:`,tooltip:n("changelog.detail.filterCategory.tooltip","Filter the timeline to a single change category.")})}),e.jsxs("select",{className:a.filterSelect,value:u,onChange:l=>p(l.target.value),children:[e.jsx("option",{value:"all",children:n("tools.filter.all","All")}),Z.map(l=>e.jsxs("option",{value:l.key,children:[l.icon," ",n(l.labelKey,l.key)]},l.key))]}),z&&e.jsxs("label",{className:a.ownershipToggle,children:[e.jsx("input",{type:"checkbox",checked:r,onChange:l=>T(l.target.checked)}),n("changelog.ownership.showGenerated","Show generated metadata")]})]}),f.length===0?e.jsx("div",{className:a.empty,children:n("changelog.detail.noChanges","No changes in this category")}):e.jsx("div",{className:a.timeline,children:f.map((l,j)=>{const b=C===j,F=At(n,l.artifactOwnership);return e.jsxs("div",{children:[e.jsxs("button",{type:"button",className:a.timelineEntry,"aria-expanded":b,onClick:()=>E(b?null:j),children:[e.jsx("span",{className:a.timelineTime,children:$t(l.timestamp)}),e.jsx("span",{className:a.timelineIcon,children:Re(l.category)}),e.jsxs("span",{className:a.timelineBody,children:[e.jsxs("span",{className:a.timelineSummary,children:[l.summary,F&&e.jsx(ne,{variant:l.artifactOwnership==="generated"?"neutral":"accent",className:a.ownershipBadge,children:F}),e.jsx(O,{text:Lt(n,l.confidence),children:e.jsx("span",{className:`${a.timelineConfidence} ${zt(l.confidence)}`,children:Et(n,l.confidence)})})]}),e.jsx("span",{className:a.timelineTarget,children:l.target})]})]}),b&&e.jsx("div",{className:a.timelineExpanded,children:e.jsx(de,{change:l})})]},j)})})]})]})]})]})})}const Mt="_page_1tggr_2",Ot="_limitNotice_1tggr_9",Dt="_limitNoticeContent_1tggr_23",Ft="_limitNoticeTitle_1tggr_28",Pt="_limitNoticeText_1tggr_35",Gt="_primaryAction_1tggr_41",Kt="_clearButton_1tggr_67",Vt="_list_1tggr_88",qt="_empty_1tggr_95",Ut="_loading_1tggr_104",Ht="_pagination_1tggr_113",Zt="_pageInfo_1tggr_121",Qt="_btn_1tggr_127",N={page:Mt,limitNotice:Ot,limitNoticeContent:Dt,limitNoticeTitle:Ft,limitNoticeText:Pt,primaryAction:Gt,clearButton:Kt,list:Vt,empty:qt,loading:Ut,pagination:Ht,pageInfo:Zt,btn:Qt},K=10;function Wt(t,i){return typeof i!="number"?`/changelog/${t}`:`/changelog/${t}?placeId=${encodeURIComponent(String(i))}`}function Xt(t){const i=/^\/changelog\/([^/]+)$/.exec(t);if(!i)return null;try{return decodeURIComponent(i[1])}catch{return i[1]}}function Yt(t){const i=new URLSearchParams(t).get("placeId");if(!i)return null;const m=Number.parseInt(i,10);return Number.isInteger(m)&&m>=0?m:null}const Jt=[{key:"all",labelKey:"changelog.filter.all"},{key:"active",labelKey:"changelog.filter.active"},{key:"completed",labelKey:"changelog.filter.completed"}];function da(){const{t}=q(),{trackEvent:i,trackPageView:m}=X(),c=Y(),n=J(),s=Xt(n.pathname),[u,p]=o.useState(()=>Yt(n.search)),r=he({placeId:u}),T=ee(),{show:C}=te(),[E,f]=o.useState(!1),[z,B]=o.useState(!1),[S,I]=o.useState(null),$=o.useRef(null),y=s??S,v=!T.loading&&T.tier==="basic",k=v?r.entries.slice(0,3):r.entries,w=!v&&r.total>K;o.useEffect(()=>{s&&s===S&&I(null)},[S,s]);const L=async()=>{B(!0);try{await r.clear(),C(t("toast.clearSuccess","Cleared successfully"),"success"),f(!1)}catch{C(t("toast.clearFailed","Failed to clear data"),"error")}finally{B(!1)}},A=(d,_)=>{$.current=_,I(d),c(Wt(d,u))},R=()=>{I(null),c("/changelog",{replace:!0})};return e.jsxs("div",{className:N.page,children:[e.jsx(se,{title:t("page.changelog.title","Changelog"),description:t("page.changelog.description","Review game-change sessions captured from AI actions and sync events."),helpTopicId:"changelog",helpState:{tier:T.tier}}),e.jsx(ce,{surface:"changelog",selectable:!0,selectedPlaceId:u,onSelectedPlaceIdChange:d=>{p(d),r.setOffset(0)}}),e.jsx(re,{items:Jt.map(d=>({key:d.key,label:t(d.labelKey,d.key.charAt(0).toUpperCase()+d.key.slice(1))})),value:r.statusFilter,onChange:d=>{const _=`changelog_${d}`;i("dashboard_click_event",{click_target:`changelog_tab_${d}`,page:"changelog",tab:_}),m({page:"changelog",tab:_}),r.setStatusFilter(d),r.setOffset(0)},rightActions:e.jsx("button",{className:N.clearButton,onClick:()=>{i("dashboard_click_event",{click_target:"changelog_clear",page:"changelog",tab:`changelog_${r.statusFilter}`}),f(!0)},children:t("common.clear","Clear")})}),r.loading&&r.entries.length===0&&e.jsx("div",{className:N.loading,children:t("common.loading","Loading...")}),!r.loading&&r.entries.length===0?e.jsx("div",{className:N.empty,children:t("changelog.empty","No changelog entries for the current place yet")}):e.jsx("div",{className:N.list,children:k.map(d=>e.jsx(Be,{entry:d,onClick:_=>A(d.entryId,_),buttonRef:_=>{d.entryId===y&&_&&($.current=_)}},d.entryId))}),w&&e.jsxs("div",{className:N.pagination,children:[e.jsx("button",{className:N.btn,disabled:r.offset===0,onClick:()=>r.setOffset(Math.max(0,r.offset-K)),children:t("tools.page.prev","Prev")}),e.jsxs("span",{className:N.pageInfo,children:[r.offset+1,"–",Math.min(r.offset+K,r.total)," / ",r.total]}),e.jsx("button",{className:N.btn,disabled:!r.hasMore,onClick:()=>r.setOffset(r.offset+K),children:t("tools.page.next","Next")})]}),v&&e.jsx(e.Fragment,{children:e.jsxs("div",{className:N.limitNotice,children:[e.jsxs("div",{className:N.limitNoticeContent,children:[e.jsx("div",{className:N.limitNoticeTitle,children:t("changelog.basic.limit.title","Basic preview shows the latest 3 sessions")}),e.jsx("div",{className:N.limitNoticeText,children:t("changelog.basic.limit.body","Full changelog timeline browsing is available with Pro.")})]}),e.jsx("a",{className:N.primaryAction,href:ae.changelog,target:"_blank",rel:"noreferrer",onClick:()=>i("dashboard_click_event",{click_target:"upgrade_cta",placement:"changelog_limit_notice",page:"changelog",tab:`changelog_${r.statusFilter}`}),children:t("tier.upgrade","View Pro")})]})}),e.jsx(ie,{open:E,title:t("changelog.clear.title","Clear changelog?"),message:t("changelog.clear.message","This permanently removes the stored changelog for the current place."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:z,onCancel:()=>!z&&f(!1),onConfirm:L}),y&&e.jsx(Rt,{entryId:y,placeId:u,onClose:R,returnFocusTo:$.current})]})}export{da as Component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._container_1h084_2{max-height:200px;overflow-y:auto;font-family:var(--font-code);font-size:12px;line-height:1.6;padding:8px 12px;background:var(--bg-secondary);border-radius:4px}._entry_1h084_14{display:flex;gap:8px;white-space:nowrap}._timestamp_1h084_21{color:var(--text-muted);flex-shrink:0}._message_1h084_27{color:var(--text-primary);overflow:hidden;text-overflow:ellipsis}._warn_1h084_34 ._message_1h084_27{color:var(--warning)}._error_1h084_39 ._message_1h084_27{color:var(--error)}._empty_1h084_44{color:var(--text-muted);font-style:italic;padding:8px 0}._page_cozq1_2{display:flex;flex-direction:column;gap:var(--space-page);width:100%;max-width:1180px}._card_cozq1_11{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:var(--card-padding-block) var(--card-padding-inline)}._topologyCard_cozq1_19{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:18px 20px 20px}._topologyDisconnected_cozq1_26{border-color:var(--error-border)}._topologyHeader_cozq1_30{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:18px}._topologyIntro_cozq1_38{margin:-6px 0 0;color:var(--text-secondary);font-size:13px;line-height:1.5}._topologyNetwork_cozq1_45{position:relative}._topologyLinks_cozq1_49{position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;width:100%;height:100%;pointer-events:none;overflow:visible}._topologyLink_cozq1_49{stroke:color-mix(in srgb,var(--accent) 62%,var(--border));stroke-linecap:round;stroke-width:1.5;opacity:.82}._topologyLink_agent_cozq1_66{stroke:color-mix(in srgb,var(--accent) 58%,var(--border))}._topologyLink_studio_cozq1_70{stroke:color-mix(in srgb,var(--accent) 66%,var(--border))}._topologyGrid_cozq1_74{position:relative;z-index:1;display:grid;grid-template-columns:minmax(220px,1fr) minmax(220px,.82fr) minmax(240px,1.18fr);align-items:start;gap:52px}._topologyColumn_cozq1_83{min-width:0;display:flex;flex-direction:column;gap:10px}._topologyColumnHeader_cozq1_90{display:flex;align-items:center;gap:8px;min-height:28px;color:var(--text-primary);font-family:var(--font-label);font-size:12px;font-weight:700}._topologyColumnHeaderSpacer_cozq1_101{min-height:28px}._topologyCount_cozq1_105{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:20px;padding:0 6px;border-radius:var(--radius-pill);background:var(--bg-secondary);border:1px solid var(--border);color:var(--text-secondary);font-family:var(--font-code);font-size:11px}._topologyList_cozq1_120{display:flex;flex-direction:column;gap:8px;justify-content:flex-start;min-height:178px}._topologyListCentered_cozq1_128{justify-content:center}._topologyNode_cozq1_132{min-width:0;border:1px solid var(--border);border-radius:8px;background:var(--bg-secondary);padding:10px 12px}._topologyNodeTitle_cozq1_140{display:flex;align-items:center;min-width:0;gap:8px;color:var(--text-primary);font-family:var(--font-label);font-size:13px;font-weight:600}._topologyNodeTitle_cozq1_140 strong,._topologyNodeTitle_cozq1_140 span{min-width:0}._topologyNodeMeta_cozq1_156,._topologyNodeSubtle_cozq1_157{margin-top:6px;color:var(--text-secondary);font-family:var(--font-code);font-size:11px;line-height:1.4;overflow-wrap:anywhere}._topologyNodeSubtle_cozq1_157{color:var(--text-muted)}._topologyState_cozq1_170{margin-left:auto;flex:0 0 auto;border:1px solid var(--border);border-radius:var(--radius-pill);padding:2px 7px;background:color-mix(in srgb,var(--bg-card) 76%,transparent);color:var(--text-secondary);font-family:var(--font-label);font-size:10px;font-weight:600}._topologyEmpty_cozq1_183{min-height:82px;display:flex;align-items:center;justify-content:center;border:1px dashed var(--border);border-radius:8px;color:var(--text-muted);background:color-mix(in srgb,var(--bg-secondary) 58%,transparent);padding:12px;text-align:center;font-size:12px;line-height:1.45}._topologyOverflow_cozq1_198{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:34px;padding:6px 8px 6px 12px;border:1px solid var(--border);border-radius:7px;background:color-mix(in srgb,var(--bg-card) 72%,transparent);color:var(--text-secondary);font-family:var(--font-label);font-size:12px}._topologyOverflowButton_cozq1_213{flex:0 0 auto;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;font-family:var(--font-label);font-size:11px;font-weight:600;padding:4px 8px;transition:background var(--transition),border-color var(--transition),color var(--transition)}._topologyOverflowButton_cozq1_213:hover{border-color:var(--border-highlight);background:var(--accent-dim);color:var(--accent)}._topologyServerColumn_cozq1_236{min-width:0;display:flex;flex-direction:column;gap:10px}._topologyServer_cozq1_236{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:178px;border-color:color-mix(in srgb,var(--accent) 42%,var(--border));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 16%,transparent)}._topologyServerIcon_cozq1_254{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border:1px solid var(--border-highlight);border-radius:50%;background:var(--accent-dim);color:var(--accent);margin-bottom:10px}._topologyServerBody_cozq1_267{display:flex;flex-direction:column;align-items:center;gap:8px;min-width:0;width:100%}._topologyServerTitle_cozq1_276{color:var(--text-primary);font-family:var(--font-label);font-size:15px;font-weight:700}._topologyServerMeta_cozq1_283{color:var(--text-secondary);font-family:var(--font-code);font-size:11px;overflow-wrap:anywhere}._routingSummaryCompact_cozq1_290{display:flex;justify-content:center;width:100%;min-width:0}._disabled_cozq1_298{opacity:.4;pointer-events:none}._cardHeader_cozq1_304{font-family:var(--font-label);font-weight:600;font-size:var(--type-card-title-size);text-transform:uppercase;letter-spacing:.05em;color:var(--text-primary);margin-bottom:var(--space-section);display:flex;align-items:center;justify-content:space-between}._cardHint_cozq1_317{margin:-4px 0 12px;color:var(--text-muted);font-size:12px;line-height:1.5}._clearButton_cozq1_324{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_cozq1_324:hover{background:var(--danger-hover-bg);border-color:var(--danger)}._clearButton_cozq1_324:focus-visible{outline:none;box-shadow:var(--focus-ring)}._serverGrid_cozq1_348{display:grid;grid-template-columns:auto 1fr;gap:4px 16px;font-family:var(--font-code);font-size:13px}._serverGrid_cozq1_348 dt{color:var(--text-muted)}._serverGrid_cozq1_348 dd{color:var(--text-primary);margin:0}._statusRow_cozq1_366{display:flex;align-items:center;gap:16px;margin-bottom:12px}._metaItem_cozq1_373{font-family:var(--font-code);font-size:12px;color:var(--text-secondary)}._table_cozq1_380{width:100%;border-collapse:collapse;font-family:var(--font-code);font-size:12px}._table_cozq1_380 th{text-align:left;color:var(--text-muted);font-weight:400;padding:4px 8px 4px 0;border-bottom:1px solid var(--border)}._table_cozq1_380 td{padding:6px 8px 6px 0;color:var(--text-primary)}._tableWrap_cozq1_400{overflow-x:auto}._table_cozq1_380 tr:hover td{background:var(--accent-dim)}._routingSummary_cozq1_290{display:inline-flex;align-items:center;gap:10px;margin-bottom:12px;flex-wrap:wrap}._manageLink_cozq1_416{display:inline-flex;align-items:center;height:24px;padding:0 8px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-primary);font-family:var(--font-label);font-size:11px;font-weight:600;text-decoration:none;transition:border-color var(--transition),background var(--transition),color var(--transition)}._manageLink_cozq1_416:hover{border-color:var(--border-highlight);background:var(--accent-dim);color:var(--accent);text-decoration:none}._segment_cozq1_442,._segmentActive_cozq1_443{height:28px;padding:0 10px;border:none;border-right:1px solid var(--border);background:transparent;color:var(--text-secondary);font-family:var(--font-label);font-size:12px;cursor:pointer}._segment_cozq1_442:last-child,._segmentActive_cozq1_443:last-child{border-right:none}._segment_cozq1_442:hover:not(:disabled){background:var(--accent-dim);color:var(--accent)}._segmentActive_cozq1_443{background:var(--accent-dim);color:var(--text-primary);font-weight:600}._segment_cozq1_442:disabled,._segmentActive_cozq1_443:disabled{cursor:default;opacity:.55}._targetPrimary_cozq1_477{white-space:nowrap}._monoMuted_cozq1_481{color:var(--text-secondary)}._copyIconButton_cozq1_485{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;margin-left:6px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-secondary);cursor:pointer;vertical-align:middle;transition:border-color var(--transition),background var(--transition),color var(--transition)}._copyIconButton_cozq1_485:hover{color:var(--accent);border-color:var(--border-highlight);background:var(--accent-dim)}._routingBadge_cozq1_510{display:inline-flex;align-items:center;min-height:22px;padding:0 8px;border:1px solid var(--border-highlight);border-radius:var(--radius-control);background:var(--accent-dim);color:var(--text-primary);font-family:var(--font-label);font-size:11px;font-weight:600}._studioStateBadge_cozq1_524{display:inline-flex;align-items:center;min-height:22px;padding:0 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;white-space:nowrap}._studioState_running_cozq1_539{border-color:color-mix(in srgb,var(--success) 42%,var(--border));background:color-mix(in srgb,var(--success) 12%,var(--bg-secondary));color:var(--success)}._studioState_paused_cozq1_545{border-color:color-mix(in srgb,var(--warning) 42%,var(--border));background:color-mix(in srgb,var(--warning) 12%,var(--bg-secondary));color:var(--warning)}._studioState_edit_cozq1_551{border-color:var(--border-highlight);background:color-mix(in srgb,var(--accent) 9%,var(--bg-secondary));color:var(--text-primary)}._studioState_unknown_cozq1_557{border-color:var(--border);background:var(--bg-secondary);color:var(--text-muted)}._toggleBtn_cozq1_564{background:none;border:none;color:var(--text-secondary);cursor:pointer;font-size:12px;padding:0 4px;transition:color var(--transition)}._toggleBtn_cozq1_564:hover{color:var(--accent)}._disconnected_cozq1_579{text-align:center;padding:32px 16px}._disconnected_cozq1_579 h3{color:var(--error);font-size:16px;margin:0 0 8px}._disconnected_cozq1_579 p{color:var(--text-secondary);font-size:13px;margin:0 0 4px}._disconnectedActions_cozq1_596{display:flex;gap:8px;justify-content:center;margin-top:16px}._btn_cozq1_603{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_cozq1_603:hover{border-color:var(--accent);background:var(--accent-dim)}._activity_active_cozq1_621,._activity_stale_cozq1_622,._activity_unknown_cozq1_623{display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:6px;vertical-align:middle}._activity_active_cozq1_621{background:var(--success);box-shadow:0 0 4px var(--success)}._activity_stale_cozq1_622{background:var(--text-muted)}._activity_unknown_cozq1_623{background:var(--text-muted);opacity:.4}._killBtn_cozq1_647{font-family:var(--font-label);font-size:11px;padding:3px 10px;border-radius:var(--radius-control);border:1px solid var(--danger-border);background:var(--danger-bg);color:var(--danger-text);cursor:pointer;transition:background var(--transition),border-color var(--transition)}._killBtn_cozq1_647:hover{background:var(--danger-hover-bg);border-color:var(--danger);color:var(--danger-text)}._killBtn_cozq1_647:focus-visible{outline:none;box-shadow:var(--focus-ring)}._emptyRow_cozq1_671{color:var(--text-muted);font-style:italic}@media(max-width:980px){._topologyHeader_cozq1_30{flex-direction:column;align-items:stretch}._topologyGrid_cozq1_74{grid-template-columns:1fr;gap:10px}._topologyColumnHeaderSpacer_cozq1_101{display:none}._topologyServer_cozq1_236{min-height:150px}}@media(max-width:640px){._card_cozq1_11,._topologyCard_cozq1_19{padding:14px}._topologyNodeTitle_cozq1_140{flex-wrap:wrap}._topologyState_cozq1_170{margin-left:0}}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{f as so,u as eo,r as d,j as o,d as co,b as U,D as io,L as lo,M as ao,h as Y,a as ro,i as po,s as go}from"./index-MEBRUJOq.js";import{I as u}from"./InfoLabel-CJVH3VF5.js";import{P as uo}from"./PageHeader-DUbueTLC.js";import{S as to}from"./StatusBadge-hrdvNb3-.js";import{T as X}from"./TooltipText-CHM9zlD0.js";import{C as J}from"./ConfirmModal-DD79xiWf.js";import{f as no,u as ho}from"./useLiveUptime-DtX2DhLL.js";import{B as yo}from"./bot-DCwGDR4k.js";import{C as V}from"./copy-bDdN4zua.js";import"./ConfirmModal.module-DJksQHBd.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 mo=[["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"}]],xo=so("server",mo),_o="_container_1h084_2",So="_entry_1h084_14",jo="_timestamp_1h084_21",vo="_message_1h084_27",fo="_warn_1h084_34",bo="_error_1h084_39",Co="_empty_1h084_44",O={container:_o,entry:So,timestamp:jo,message:vo,warn:fo,error:bo,empty:Co};function No(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 wo({entries:e}){const{t:s}=eo(),n=d.useRef(null);return d.useEffect(()=>{const l=n.current;l&&(l.scrollTop=l.scrollHeight)},[e.length]),o.jsx("div",{ref:n,className:O.container,children:e.length===0?o.jsx("div",{className:O.empty,children:s("connection.log.empty","No events yet")}):e.map((l,c)=>o.jsxs("div",{className:`${O.entry} ${l.type?O[l.type]:""}`,children:[o.jsx("span",{className:O.timestamp,children:No(l.timestamp)}),o.jsx("span",{className:O.message,children:l.message})]},c))})}const Q=50;function ko(){const e=new Date;return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}function Io(){const{level:e,status:s,error:n}=co(),[l,c]=d.useState(null),[y,p]=d.useState(null),[i,k]=d.useState([]),C=d.useRef(null),z=d.useCallback((g,j)=>{k(w=>{const S=[...w,{timestamp:ko(),message:g,type:j}];return S.length>Q?S.slice(-Q):S})},[]),m=d.useCallback(async()=>{try{const g=await U.get("/connection-info");c(g)}catch{c(null)}},[]),A=d.useCallback(async()=>{try{const g=await U.get("/api/dashboard/studio-routing");p(g)}catch{p(null)}},[]),I=d.useCallback(async g=>{const j=await U.patch("/api/dashboard/studio-routing",g);return p(j),await m(),j},[m]),B=d.useCallback(async()=>{try{const g=await U.get("/api/dashboard/connection-log");k(g.entries??[])}catch{k([])}},[]),E=d.useCallback(async()=>{await U.post("/api/dashboard/connection-log/clear"),k([])},[]),N=d.useCallback(async g=>{await U.post("/api/dashboard/kill-agent",{instanceId:g}),await m()},[m]);return d.useEffect(()=>{e!=="disconnected"&&s?(m(),A()):p(null),B()},[e,s,m,B,A]),d.useEffect(()=>{const g=new io;C.current=g,g.connect();const j=g.on("connection",S=>{const h=S;h.status!=="updated"&&h.clientId&&z(`Plugin ${h.status} — ${h.clientId}`,h.status==="disconnected"?"warn":"info"),m(),A()}),w=g.on("mcp_status",S=>{const h=S,F=h.status==="registered"?"registered":"unregistered";z(`MCP ${F} — ${h.aiClientName}`,h.status==="registered"?"info":"warn"),m(),A()});return()=>{j(),w(),g.disconnect(),C.current=null}},[z,m,A]),{status:s,connectionInfo:l,studioRouting:y,connectionLog:i,level:e,error:n,clearConnectionLog:E,killAgent:N,updateStudioRouting:I}}const Lo="_page_cozq1_2",zo="_card_cozq1_11",Ao="_topologyCard_cozq1_19",Po="_topologyDisconnected_cozq1_26",qo="_topologyHeader_cozq1_30",Bo="_topologyIntro_cozq1_38",$o="_topologyNetwork_cozq1_45",Mo="_topologyLinks_cozq1_49",Eo="_topologyLink_cozq1_49",To="_topologyLink_agent_cozq1_66",Do="_topologyLink_studio_cozq1_70",Ho="_topologyGrid_cozq1_74",Uo="_topologyColumn_cozq1_83",Oo="_topologyColumnHeader_cozq1_90",Fo="_topologyColumnHeaderSpacer_cozq1_101",Wo="_topologyCount_cozq1_105",Yo="_topologyList_cozq1_120",Go="_topologyListCentered_cozq1_128",Vo="_topologyNode_cozq1_132",Ro="_topologyNodeTitle_cozq1_140",Ko="_topologyNodeMeta_cozq1_156",Xo="_topologyNodeSubtle_cozq1_157",Jo="_topologyState_cozq1_170",Qo="_topologyEmpty_cozq1_183",Zo="_topologyOverflow_cozq1_198",oe="_topologyOverflowButton_cozq1_213",ee="_topologyServerColumn_cozq1_236",te="_topologyServer_cozq1_236",ne="_topologyServerIcon_cozq1_254",se="_topologyServerBody_cozq1_267",ce="_topologyServerTitle_cozq1_276",ie="_topologyServerMeta_cozq1_283",le="_routingSummaryCompact_cozq1_290",ae="_disabled_cozq1_298",re="_cardHeader_cozq1_304",de="_cardHint_cozq1_317",pe="_clearButton_cozq1_324",ge="_serverGrid_cozq1_348",ue="_statusRow_cozq1_366",he="_metaItem_cozq1_373",ye="_table_cozq1_380",me="_tableWrap_cozq1_400",xe="_routingSummary_cozq1_290",_e="_manageLink_cozq1_416",Se="_segment_cozq1_442",je="_segmentActive_cozq1_443",ve="_targetPrimary_cozq1_477",fe="_monoMuted_cozq1_481",be="_copyIconButton_cozq1_485",Ce="_routingBadge_cozq1_510",Ne="_studioStateBadge_cozq1_524",we="_studioState_running_cozq1_539",ke="_studioState_paused_cozq1_545",Ie="_studioState_edit_cozq1_551",Le="_studioState_unknown_cozq1_557",ze="_toggleBtn_cozq1_564",Ae="_disconnected_cozq1_579",Pe="_disconnectedActions_cozq1_596",qe="_btn_cozq1_603",Be="_activity_active_cozq1_621",$e="_activity_stale_cozq1_622",Me="_activity_unknown_cozq1_623",Ee="_killBtn_cozq1_647",Te="_emptyRow_cozq1_671",t={page:Lo,card:zo,topologyCard:Ao,topologyDisconnected:Po,topologyHeader:qo,topologyIntro:Bo,topologyNetwork:$o,topologyLinks:Mo,topologyLink:Eo,topologyLink_agent:To,topologyLink_studio:Do,topologyGrid:Ho,topologyColumn:Uo,topologyColumnHeader:Oo,topologyColumnHeaderSpacer:Fo,topologyCount:Wo,topologyList:Yo,topologyListCentered:Go,topologyNode:Vo,topologyNodeTitle:Ro,topologyNodeMeta:Ko,topologyNodeSubtle:Xo,topologyState:Jo,topologyEmpty:Qo,topologyOverflow:Zo,topologyOverflowButton:oe,topologyServerColumn:ee,topologyServer:te,topologyServerIcon:ne,topologyServerBody:se,topologyServerTitle:ce,topologyServerMeta:ie,routingSummaryCompact:le,disabled:ae,cardHeader:re,cardHint:de,clearButton:pe,serverGrid:ge,statusRow:ue,metaItem:he,table:ye,tableWrap:me,routingSummary:xe,manageLink:_e,segment:Se,segmentActive:je,targetPrimary:ve,monoMuted:fe,copyIconButton:be,routingBadge:Ce,studioStateBadge:Ne,studioState_running:we,studioState_paused:ke,studioState_edit:Ie,studioState_unknown:Le,toggleBtn:ze,disconnected:Ae,disconnectedActions:Pe,btn:qe,activity_active:Be,activity_stale:$e,activity_unknown:Me,killBtn:Ee,emptyRow:Te},G=5;function De(e){return e?Date.now()-e<3e4?"active":"stale":"unknown"}function He(e,s){return e==="active"?s("connection.topology.active","Active"):e==="stale"?s("connection.topology.stale","Stale"):s("connection.topology.unknown","Unknown")}function Z(e){return e.length>10?e.slice(0,10):e}function oo(e,s){return e.replace("{count}",String(s))}function Ue(e,s,n){const l=e.studioState??"unknown",c={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"),p=e.studioStateUpdatedAt?n(e.studioStateUpdatedAt):s("connection.targets.studioState.updatedUnknown","not reported");return{state:l,label:c[l],tooltip:`${y} · ${p}`}}function Oe(e,s){return e.length!==s.length?!1:e.every((n,l)=>{const c=s[l];return c!==void 0&&n.id===c.id&&n.side===c.side&&Math.abs(n.x1-c.x1)<.5&&Math.abs(n.y1-c.y1)<.5&&Math.abs(n.x2-c.x2)<.5&&Math.abs(n.y2-c.y2)<.5})}function b(e,s,n){return{x:s-e.left,y:n-e.top}}function Fe(e,s,n,l){if(s.right<=n.left){const p=b(l,s.right,s.top+s.height/2),i=b(l,n.left,n.top+n.height/2);return{id:e,side:"agent",x1:p.x,y1:p.y,x2:i.x,y2:i.y}}if(s.bottom<=n.top){const p=b(l,s.left+s.width/2,s.bottom),i=b(l,n.left+n.width/2,n.top);return{id:e,side:"agent",x1:p.x,y1:p.y,x2:i.x,y2:i.y}}const c=b(l,s.left+s.width/2,s.top),y=b(l,n.left+n.width/2,n.bottom);return{id:e,side:"agent",x1:c.x,y1:c.y,x2:y.x,y2:y.y}}function We(e,s,n,l){if(n.right<=s.left){const p=b(l,s.left,s.top+s.height/2),i=b(l,n.right,n.top+n.height/2);return{id:e,side:"studio",x1:p.x,y1:p.y,x2:i.x,y2:i.y}}if(n.bottom<=s.top){const p=b(l,s.left+s.width/2,s.top),i=b(l,n.left+n.width/2,n.bottom);return{id:e,side:"studio",x1:p.x,y1:p.y,x2:i.x,y2:i.y}}const c=b(l,s.left+s.width/2,s.bottom),y=b(l,n.left+n.width/2,n.top);return{id:e,side:"studio",x1:c.x,y1:c.y,x2:y.x,y2:y.y}}function Ye({agents:e,isDisconnected:s,pinnedTargetClientId:n,priorityTarget:l,status:c,studioRoutingMode:y,studioTargets:p,t:i,timeAgo:k,onCopySelector:C,onManageRouting:z}){const[m,A]=d.useState(!1),[I,B]=d.useState(!1),[E,N]=d.useState([]),g=d.useRef(null),j=d.useRef(null),w=d.useRef(new Map),S=d.useRef(new Map),h=y==="pinned"?i("connection.routing.pinned","Manual: Pinned Studio"):i("connection.routing.recentPriority","Automatic: Recent priority"),F=s?"offline":"online",f=d.useMemo(()=>m?e:e.slice(0,G),[e,m]),T=Math.max(0,e.length-f.length),v=d.useMemo(()=>I?p:p.slice(0,G),[p,I]),$=Math.max(0,p.length-v.length),R=[t.topologyList,f.length<=1?t.topologyListCentered:""].filter(Boolean).join(" "),K=[t.topologyList,v.length<=1?t.topologyListCentered:""].filter(Boolean).join(" "),D=d.useCallback(a=>x=>{if(x){w.current.set(a,x);return}w.current.delete(a)},[]),r=d.useCallback(a=>x=>{if(x){S.current.set(a,x);return}S.current.delete(a)},[]),L=d.useCallback(()=>{const a=g.current,x=j.current;if(!a||!x){N([]);return}const _=a.getBoundingClientRect(),P=x.getBoundingClientRect(),H=[];f.forEach(q=>{const W=w.current.get(q.instanceId);W&&H.push(Fe(`agent-${q.instanceId}`,W.getBoundingClientRect(),P,_))}),v.forEach(q=>{const W=S.current.get(q.clientId);W&&H.push(We(`studio-${q.clientId}`,W.getBoundingClientRect(),P,_))}),N(q=>Oe(q,H)?q:H)},[f,v]);return d.useLayoutEffect(()=>{L();const a=[g.current,j.current,...f.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,f,v]),o.jsxs("section",{className:`${t.topologyCard} ${s?t.topologyDisconnected:""}`,"aria-label":i("connection.topology.ariaLabel","Connection topology"),children:[o.jsxs("div",{className:t.topologyHeader,children:[o.jsxs("div",{children:[o.jsx("div",{className:t.cardHeader,children:i("connection.topology.title","Connection topology")}),o.jsx("p",{className:t.topologyIntro,children:i("connection.topology.description","Each AI agent connects through its own MCP Adapter to one shared WEPPY Bridge, which keeps Roblox Studio connected.")})]}),o.jsx(lo,{to:"/controls?section=studio-routing",className:t.manageLink,onClick:z,children:i("connection.routing.manage","Manage routing")})]}),o.jsxs("div",{className:t.topologyNetwork,ref:g,children:[o.jsx("svg",{"aria-hidden":"true",className:t.topologyLinks,"data-testid":"topology-connection-lines",focusable:"false",children:E.map(a=>o.jsx("line",{className:`${t.topologyLink} ${t[`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))}),o.jsxs("div",{className:t.topologyGrid,children:[o.jsxs("div",{className:t.topologyColumn,children:[o.jsxs("div",{className:t.topologyColumnHeader,children:[o.jsx(yo,{size:15,"aria-hidden":"true"}),o.jsx("span",{children:i("connection.agents.title","AI Agents")}),o.jsx("span",{className:t.topologyCount,children:e.length})]}),o.jsxs("div",{className:R,children:[e.length>0?f.map(a=>{const x=De(a.lastSeen),_=a.aiClientName??Z(a.instanceId),P=a.lastSeen??a.lastCommandAt??a.connectedAt,H=a.mcpVersion?`${i("connection.topology.adapterRole","MCP Adapter")} v${a.mcpVersion}`:i("connection.topology.adapterRole","MCP Adapter");return o.jsxs("div",{className:t.topologyNode,ref:D(a.instanceId),children:[o.jsxs("div",{className:t.topologyNodeTitle,children:[o.jsx("span",{className:t[`activity_${x}`]}),o.jsx("strong",{children:_}),o.jsx("span",{className:t.topologyState,children:He(x,i)})]}),o.jsxs("div",{className:t.topologyNodeMeta,children:[o.jsx("span",{children:H})," ·"," ",i("connection.server.session","Session")," ",Z(a.instanceId)," ·"," ",P?`${i("connection.topology.lastActivity","Last activity")} ${k(P)}`:i("connection.topology.noActivity","No recent activity")]})]},a.instanceId)}):o.jsx("div",{className:t.topologyEmpty,children:i("connection.agents.none","No agents connected")}),e.length>G?o.jsxs("div",{className:t.topologyOverflow,children:[T>0?o.jsx("span",{children:oo(i("connection.topology.moreAgents","+{count} more agents"),T)}):o.jsx("span",{children:i("connection.topology.allAgentsVisible","All agents visible")}),o.jsx("button",{type:"button",className:t.topologyOverflowButton,"aria-label":m?i("connection.topology.showLessAgents","Show less AI agents"):i("connection.topology.showAllAgents","Show all AI agents"),onClick:()=>A(a=>!a),children:m?i("connection.topology.showLess","Show less"):i("connection.topology.showAll","Show all")})]}):null]})]}),o.jsxs("div",{className:t.topologyServerColumn,children:[o.jsx("div",{className:t.topologyColumnHeaderSpacer,"aria-hidden":"true"}),o.jsxs("div",{className:`${t.topologyNode} ${t.topologyServer}`,ref:j,children:[o.jsx("div",{className:t.topologyServerIcon,children:o.jsx(xo,{size:18,"aria-hidden":"true"})}),o.jsxs("div",{className:t.topologyServerBody,children:[o.jsx("div",{className:t.topologyServerTitle,children:i("connection.topology.serverTitle","WEPPY Bridge")}),o.jsx(to,{status:F}),o.jsxs("div",{className:t.topologyServerMeta,children:[c!=null&&c.version?`v${c.version}`:i("connection.topology.versionUnknown","Version unknown"),c!=null&&c.sessionId?` · ${i("connection.server.session","Session")} ${c.sessionId.slice(0,8)}`:""]}),(c==null?void 0:c.pid)!=null||(c==null?void 0:c.uptime)!=null?o.jsxs("div",{className:t.topologyNodeSubtle,children:[(c==null?void 0:c.pid)!=null?o.jsx("span",{children:`${i("connection.server.pid","PID")} ${c.pid}`}):null,(c==null?void 0:c.pid)!=null&&(c==null?void 0:c.uptime)!=null?" · ":"",(c==null?void 0:c.uptime)!=null?o.jsx("span",{children:`${i("connection.server.uptime","Uptime")} ${no(c.uptime)}`}):null]}):null,o.jsx("div",{className:t.routingSummaryCompact,children:o.jsx("span",{className:t.routingBadge,children:h})})]})]})]}),o.jsxs("div",{className:t.topologyColumn,children:[o.jsxs("div",{className:t.topologyColumnHeader,children:[o.jsx(ao,{size:15,"aria-hidden":"true"}),o.jsx("span",{children:i("connection.targets.title","Studio Targets")}),o.jsx("span",{className:t.topologyCount,children:p.length})]}),o.jsxs("div",{className:K,children:[p.length>0?v.map(a=>{const x=y==="pinned"&&n===a.clientId,_=y==="recentPriority"&&(l==null?void 0:l.clientId)===a.clientId,P=Ue(a,i,k);return o.jsxs("div",{className:t.topologyNode,ref:r(a.clientId),children:[o.jsxs("div",{className:t.topologyNodeTitle,children:[o.jsx("span",{className:t.targetPrimary,children:a.targetAlias}),o.jsx(Y,{text:i("connection.targets.copyTargetAlias","Copy Studio ID"),children:o.jsx("button",{type:"button",className:t.copyIconButton,"aria-label":i("connection.targets.copyTargetAlias","Copy Studio ID"),onClick:()=>C(a.targetAlias,"target_alias"),children:o.jsx(V,{size:13,"aria-hidden":"true"})})}),x?o.jsx("span",{className:t.routingBadge,children:i("connection.routing.pinnedBadge","Pinned")}):_?o.jsx("span",{className:t.routingBadge,children:i("connection.routing.priorityBadge","Priority")}):null,o.jsx(Y,{text:P.tooltip,children:o.jsx("span",{className:`${t.studioStateBadge} ${t[`studioState_${P.state}`]}`,children:P.label})})]}),o.jsxs("div",{className:t.topologyNodeMeta,children:[o.jsx("span",{children:a.placeName??i("connection.topology.placeUnknown","Place unknown")}),a.placeId!==void 0?` · ${a.placeId}`:""]}),o.jsxs("div",{className:t.topologyNodeSubtle,children:[a.connectionState," · ",i("connection.targets.lastSeen","Last Seen")," ",k(a.lastSeen)]})]},a.clientId)}):o.jsx("div",{className:t.topologyEmpty,children:i("connection.targets.none","No Studio targets connected. Open Roblox Studio and connect WEPPY Plugin.")}),p.length>G?o.jsxs("div",{className:t.topologyOverflow,children:[$>0?o.jsx("span",{children:oo(i("connection.topology.moreStudios","+{count} more studios"),$)}):o.jsx("span",{children:i("connection.topology.allStudiosVisible","All studios visible")}),o.jsx("button",{type:"button",className:t.topologyOverflowButton,"aria-label":I?i("connection.topology.showLessStudios","Show less Studio targets"):i("connection.topology.showAllStudios","Show all Studio targets"),onClick:()=>B(a=>!a),children:I?i("connection.topology.showLess","Show less"):i("connection.topology.showAll","Show all")})]}):null]})]})]})]})]})}function M(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 Ge(e){return e?Date.now()-e<3e4?"active":"stale":"unknown"}function Ve(e,s){const n=e.studioState??"unknown",l={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")},c=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?M(e.studioStateUpdatedAt,s):s("connection.targets.studioState.updatedUnknown","not reported"),p=e.playtestMode&&e.playtestMode!=="unknown"?` · ${e.playtestMode}`:"";return{state:n,label:`${l[n]}${p}`,tooltip:`${c} · ${y}`}}function st(){const{t:e}=eo(),{trackEvent:s}=ro(),{status:n,connectionInfo:l,studioRouting:c,connectionLog:y,level:p,clearConnectionLog:i,killAgent:k}=Io(),{show:C}=po(),[z,m]=d.useState(!0),[A,I]=d.useState(!1),[B,E]=d.useState(!1),[N,g]=d.useState(null),[j,w]=d.useState(!1),S=ho(n==null?void 0:n.uptime),h=p==="disconnected",F=h?"offline":"online",f=(c==null?void 0:c.studioRoutingMode)??(n==null?void 0:n.studioRoutingMode)??"recentPriority",T=(c==null?void 0:c.pinnedTargetClientId)??(n==null?void 0:n.pinnedTargetClientId)??null,v=go((c==null?void 0:c.targets)??(n==null?void 0:n.pluginClients)??[],f,T),$=(c==null?void 0:c.priorityTarget)??v[0],R=async()=>{if(N){w(!0);try{await k(N.instanceId),C(e("connection.agents.killed","Agent killed"),"success"),g(null)}catch{C(e("connection.agents.killFailed","Failed to kill agent"),"error")}finally{w(!1)}}},K=async()=>{E(!0);try{await i(),C(e("toast.clearSuccess","Cleared successfully"),"success"),I(!1)}catch{C(e("toast.clearFailed","Failed to clear data"),"error")}finally{E(!1)}},D=async(r,L)=>{try{await navigator.clipboard.writeText(r),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 o.jsxs("div",{className:t.page,children:[o.jsx(uo,{title:e("page.connection.title","Connection"),description:e("page.connection.description","Inspect WEPPY Bridge, MCP Adapter, Studio Plugin, and connection log status."),helpTopicId:"connection",helpState:{connectionLevel:p}}),o.jsx(Ye,{agents:(l==null?void 0:l.mcpInstances)??[],isDisconnected:h,pinnedTargetClientId:T,priorityTarget:$,status:n??null,studioRoutingMode:f,studioTargets:v,t:e,timeAgo:r=>M(r,e),onCopySelector:D,onManageRouting:()=>s("dashboard_click_event",{click_target:"connection_manage_routing",page:"connection"})}),o.jsxs("div",{className:t.card,children:[o.jsx("div",{className:t.cardHeader,children:e("connection.server.title","Bridge Status")}),h?o.jsxs("div",{className:t.disconnected,children:[o.jsx("h3",{children:e("level.l0.title")}),o.jsx("p",{children:e("level.l0.message")}),o.jsx("p",{children:e("common.reconnecting")}),o.jsxs("div",{className:t.disconnectedActions,children:[o.jsx("button",{className:t.btn,onClick:()=>window.location.reload(),children:e("connection.reconnect","Reconnect")}),o.jsx("button",{className:t.btn,onClick:()=>{window.location.hash="#/settings"},children:e("connection.checkSettings","Check Settings")})]})]}):o.jsxs(o.Fragment,{children:[o.jsx("div",{className:t.statusRow,children:o.jsx(to,{status:F})}),o.jsxs("dl",{className:t.serverGrid,children:[(n==null?void 0:n.version)&&o.jsxs(o.Fragment,{children:[o.jsx("dt",{children:o.jsx(u,{label:e("connection.server.version","Version"),tooltip:e("connection.server.version.tooltip","WEPPY Bridge runtime version")})}),o.jsx("dd",{children:o.jsx(X,{text:e("connection.server.version.tooltip","WEPPY Bridge runtime version"),children:`v${n.version}`})})]}),(n==null?void 0:n.pid)!=null&&o.jsxs(o.Fragment,{children:[o.jsx("dt",{children:o.jsx(u,{label:e("connection.server.pid","PID"),tooltip:e("connection.server.pid.tooltip","Operating system process identifier")})}),o.jsx("dd",{children:n.pid})]}),(n==null?void 0:n.uptime)!=null&&o.jsxs(o.Fragment,{children:[o.jsx("dt",{children:o.jsx(u,{label:e("connection.server.uptime","Uptime"),tooltip:e("connection.server.uptime.tooltip","Time elapsed since the WEPPY Bridge started")})}),o.jsx("dd",{children:no(S??n.uptime)})]}),(n==null?void 0:n.sessionId)&&o.jsxs(o.Fragment,{children:[o.jsx("dt",{children:o.jsx(u,{label:e("connection.server.session","Session"),tooltip:e("connection.server.session.tooltip","Current WEPPY Bridge session identifier")})}),o.jsx("dd",{children:n.sessionId.slice(0,8)})]}),(l==null?void 0:l.serverExecutable)&&o.jsxs(o.Fragment,{children:[o.jsx("dt",{children:o.jsx(u,{label:e("connection.server.exec","Exec"),tooltip:e("connection.server.exec.tooltip","Executable path used to launch the WEPPY Bridge")})}),o.jsx("dd",{children:l.serverExecutable})]})]})]})]}),o.jsxs("div",{className:`${t.card} ${h?t.disabled:""}`,children:[o.jsxs("div",{className:t.cardHeader,children:[o.jsxs("span",{children:[e("connection.agents.title","AI Agents")," ","(",(l==null?void 0:l.mcpInstanceCount)??0,")"]}),o.jsx("button",{className:t.toggleBtn,onClick:()=>m(r=>!r),"aria-label":z?e("common.collapse","Collapse"):e("common.expand","Expand"),children:z?"▾":"▸"})]}),z&&o.jsxs("table",{className:t.table,children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:e("connection.agents.name","Agent")}),o.jsx("th",{children:o.jsx(u,{label:e("connection.agents.version","Version"),tooltip:e("connection.agents.version.tooltip","MCP Adapter package version for this agent session")})}),o.jsx("th",{children:o.jsx(u,{label:e("connection.server.pid","PID"),tooltip:e("connection.server.pid.tooltip","Operating system process identifier")})}),o.jsx("th",{children:o.jsx(u,{label:e("connection.agents.projectRoot","Project Root"),tooltip:e("connection.agents.projectRoot.tooltip","Authoritative project root for sync ownership")})}),o.jsx("th",{children:e("connection.agents.connected","Connected")}),o.jsx("th",{children:o.jsx(u,{label:e("connection.agents.lastSeen","Last Seen"),tooltip:e("connection.agents.lastSeen.tooltip","Most recent heartbeat or activity from this agent")})}),o.jsx("th",{children:o.jsx(u,{label:e("connection.agents.lastCommand","Last Command"),tooltip:e("connection.agents.lastCommand.tooltip","Most recent tool call executed by this agent")})}),o.jsx("th",{})]})}),o.jsx("tbody",{children:l!=null&&l.mcpInstances&&l.mcpInstances.length>0?l.mcpInstances.map(r=>o.jsxs("tr",{children:[o.jsxs("td",{children:[o.jsx("span",{className:t[`activity_${Ge(r.lastSeen)}`]}),r.aiClientName??e("connection.agents.unknown","Unknown")]}),o.jsx("td",{children:r.mcpVersion??"-"}),o.jsx("td",{children:r.pid}),o.jsx("td",{children:r.projectRoot??r.cwd??e("connection.agents.projectRoot.unresolved","Unresolved")}),o.jsx("td",{children:M(r.connectedAt,e)}),o.jsx("td",{children:r.lastSeen?M(r.lastSeen,e):"-"}),o.jsx("td",{children:r.lastCommandAt?M(r.lastCommandAt,e):"-"}),o.jsx("td",{children:!r.isServer&&o.jsx("button",{className:t.killBtn,onClick:()=>{s("dashboard_click_event",{click_target:"connection_kill_agent",page:"connection"}),g({instanceId:r.instanceId,name:r.aiClientName??r.instanceId.slice(0,8)})},children:e("connection.agents.kill","Kill")})})]},r.instanceId)):o.jsx("tr",{children:o.jsx("td",{colSpan:8,className:t.emptyRow,children:e("connection.agents.none","No agents connected")})})})]})]}),o.jsxs("div",{className:`${t.card} ${h?t.disabled:""}`,children:[o.jsxs("div",{className:t.cardHeader,children:[e("connection.targets.title","Studio Targets")," ","(",v.length,")"]}),o.jsx("p",{className:t.cardHint,children:e("connection.targets.help","When multiple Studio windows are connected, tell the agent to use Studio ID studio-1 to choose one.")}),o.jsx("div",{className:t.tableWrap,children:o.jsxs("table",{className:t.table,children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:o.jsx(u,{label:e("connection.targets.target","Studio ID"),tooltip:e("connection.targets.target.tooltip","Short name for this Roblox Studio window")})}),o.jsx("th",{children:e("connection.targets.place","Place")}),o.jsx("th",{children:o.jsx(u,{label:e("connection.targets.placeId","Place ID"),tooltip:e("connection.targets.placeId.tooltip","Roblox Place ID for this Studio window")})}),o.jsx("th",{children:o.jsx(u,{label:e("connection.targets.clientId","Connection ID"),tooltip:e("connection.targets.clientId.tooltip","Full connection ID for diagnostics. Usually use Studio ID instead.")})}),o.jsx("th",{children:o.jsx(u,{label:e("connection.targets.studioState","Studio State"),tooltip:e("connection.targets.studioState.tooltip","Current edit/play runtime state reported by this Studio window")})}),o.jsx("th",{children:o.jsx(u,{label:e("connection.targets.session","Session"),tooltip:e("connection.targets.session.tooltip","Command channel state for this Studio target")})}),o.jsx("th",{children:o.jsx(u,{label:e("connection.targets.lastUsed","Last Used"),tooltip:e("connection.targets.lastUsed.tooltip","Most recent plugin-route request routed to this Studio target")})}),o.jsx("th",{children:o.jsx(u,{label:e("connection.targets.lastSeen","Last Seen"),tooltip:e("connection.targets.lastSeen.tooltip","Most recent heartbeat received from this Studio target")})}),o.jsx("th",{children:o.jsx(u,{label:e("connection.targets.version","Version"),tooltip:e("connection.targets.version.tooltip","Installed plugin version reported by Studio")})}),o.jsx("th",{children:o.jsx(u,{label:e("connection.targets.routing","Routing"),tooltip:e("connection.targets.routing.tooltip","Routing priority for requests without a named Studio target")})}),o.jsx("th",{children:o.jsx(u,{label:e("connection.targets.inFlight","In Flight"),tooltip:e("connection.targets.inFlight.tooltip","Active command request currently routed to this Studio target")})})]})}),o.jsx("tbody",{children:v.length>0?v.map(r=>{const L=r.clientId.slice(0,10),a=Ve(r,e);return o.jsxs("tr",{children:[o.jsxs("td",{children:[o.jsx("span",{className:t.monoMuted,title:r.clientId,children:r.targetAlias}),o.jsx(Y,{text:e("connection.targets.copyTargetAlias","Copy Studio ID"),children:o.jsx("button",{type:"button",className:t.copyIconButton,"aria-label":e("connection.targets.copyTargetAlias","Copy Studio ID"),onClick:()=>D(r.targetAlias,"target_alias"),children:o.jsx(V,{size:13,"aria-hidden":"true"})})})]}),o.jsx("td",{children:o.jsx("span",{className:t.targetPrimary,children:r.placeName??"-"})}),o.jsxs("td",{children:[r.placeId??"-",r.placeId!==void 0?o.jsx(Y,{text:e("connection.targets.copyPlaceId","Copy Place ID"),children:o.jsx("button",{type:"button",className:t.copyIconButton,"aria-label":e("connection.targets.copyPlaceId","Copy Place ID"),onClick:()=>D(String(r.placeId),"place_id"),children:o.jsx(V,{size:13,"aria-hidden":"true"})})}):null]}),o.jsxs("td",{children:[o.jsx("span",{className:t.monoMuted,title:r.clientId,children:L}),o.jsx(Y,{text:e("connection.targets.copyClientId","Copy Connection ID"),children:o.jsx("button",{type:"button",className:t.copyIconButton,"aria-label":e("connection.targets.copyClientId","Copy Connection ID"),onClick:()=>D(r.clientId,"client_id"),children:o.jsx(V,{size:13,"aria-hidden":"true"})})})]}),o.jsx("td",{children:o.jsx(X,{text:a.tooltip,children:o.jsx("span",{className:`${t.studioStateBadge} ${t[`studioState_${a.state}`]}`,children:a.label})})}),o.jsx("td",{children:r.connectionState}),o.jsx("td",{children:r.lastRoutedAt?M(r.lastRoutedAt,e):"-"}),o.jsx("td",{children:M(r.lastSeen,e)}),o.jsx("td",{children:r.pluginVersion??"-"}),o.jsx("td",{children:f==="pinned"&&T===r.clientId?o.jsx("span",{className:t.routingBadge,children:e("connection.routing.pinnedBadge","Pinned")}):f==="recentPriority"&&($==null?void 0:$.clientId)===r.clientId?o.jsx("span",{className:t.routingBadge,children:e("connection.routing.priorityBadge","Priority")}):o.jsx("span",{className:t.monoMuted,children:"-"})}),o.jsx("td",{children:r.inFlightRequestId?r.inFlightRequestId.slice(0,8):"-"})]},r.clientId)}):o.jsx("tr",{children:o.jsx("td",{colSpan:11,className:t.emptyRow,children:e("connection.targets.none","No Studio targets connected. Open Roblox Studio and connect WEPPY Plugin.")})})})]})})]}),o.jsxs("div",{className:`${t.card} ${h?t.disabled:""}`,children:[o.jsxs("div",{className:t.cardHeader,children:[o.jsx("span",{children:e("connection.log.title","Connection Log")}),o.jsx("button",{className:t.clearButton,onClick:()=>{s("dashboard_click_event",{click_target:"connection_clear_log",page:"connection"}),I(!0)},children:e("common.clear","Clear")})]}),o.jsx(wo,{entries:y})]}),o.jsx(J,{open:A,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:B,onCancel:()=>!B&&I(!1),onConfirm:K}),o.jsx(J,{open:!!N,title:e("connection.agents.kill.title","Kill agent?"),message:`"${N==null?void 0:N.name}" 프로세스를 강제 종료합니다. 해당 에이전트의 진행 중인 작업이 중단됩니다.`,cancelLabel:e("common.cancel","Cancel"),confirmLabel:e("connection.agents.kill","Kill"),loading:j,onCancel:()=>!j&&g(null),onConfirm:R})]})}export{st as Component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as m,r as d,j as a,B as O,C as D,g as V,v as W,o as Y,p as w,q as k}from"./index-MEBRUJOq.js";import{B as y}from"./PageHeader-DUbueTLC.js";import{P as G,a as H}from"./PlaceSelectOptions-KRG4cS5y.js";const Q="_scope_1i8qy_1",z="_main_1i8qy_13",J="_label_1i8qy_22",X="_selectorLabel_1i8qy_30",Z="_placeSelect_1i8qy_38",ee="_name_1i8qy_54",ce="_id_1i8qy_65",le="_scopeBadge_1i8qy_72",ae="_copy_1i8qy_76",ne="_note_1i8qy_88",te="_folderDetails_1i8qy_92",se="_shortcuts_1i8qy_96",oe="_shortcutsTrigger_1i8qy_103",re="_shortcutLink_1i8qy_126",ie="_shortcutsPopover_1i8qy_131",o={scope:Q,main:z,label:J,selectorLabel:X,placeSelect:Z,name:ee,id:ce,scopeBadge:le,copy:ae,note:ne,folderDetails:te,shortcuts:se,shortcutsTrigger:oe,shortcutLink:re,shortcutsPopover:ie};function B(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>0}function u(e,c){return Y(e.places,c)}function T(e){var c;return e.lastActivePlaceId!==null?e.lastActivePlaceId:((c=e.places[0])==null?void 0:c.placeId)??null}function A(e){var c;if(e.pluginConnected&&e.activePlaceId!==null){const l=e.places.filter(n=>n.placeId===e.activePlaceId);if(u(e,e.activePlaceId)||l.length===0)return e.activePlaceId}if(e.lastActivePlaceId!==null){const l=e.places.filter(n=>n.placeId===e.lastActivePlaceId);if(u(e,e.lastActivePlaceId)||l.length===0)return e.lastActivePlaceId}return((c=W(e.places))==null?void 0:c.placeId)??null}function pe(e,c,l){var n;return c?((n=u(e,typeof l=="number"?l:null))==null?void 0:n.placeId)??A(e):e.pluginConnected&&e.activePlaceId!==null?e.activePlaceId:T(e)}function R(e,c){const l=u(e,c);return(l==null?void 0:l.universeId)!==void 0?l.universeId:c===e.activePlaceId?e.activeUniverseId??null:c===e.lastActivePlaceId?e.lastActiveUniverseId??null:null}function de(e,c,l){if(!B(e))return[];const n=[];return B(c)&&n.push({label:l("placeScope.shortcuts.settings","Place settings"),href:`https://create.roblox.com/dashboard/creations/experiences/${c}/places/${e}/configure`},{label:l("placeScope.shortcuts.experience","Experience management"),href:`https://create.roblox.com/dashboard/creations/experiences/${c}/overview`}),n.push({label:l("placeScope.shortcuts.roblox","View on Roblox"),href:`https://www.roblox.com/games/${e}`}),n}function ue(e,c){if(e.pluginConnected&&e.activePlaceId!==null){const s=u(e,e.activePlaceId),t=s?w(e.places,s.placeId):!1,i=c("placeScope.folder.unresolvedPlace","Place {placeId}").replace("{placeId}",String(e.activePlaceId));return{label:c("placeScope.current.label","Current Place"),placeId:e.activePlaceId,placeName:e.activePlaceName??(t?i:s==null?void 0:s.placeName)??c("placeScope.unknownPlace","Unknown place"),badge:c("placeScope.connected","Studio connected"),connected:(s==null?void 0:s.isConnected)??!0,folderUnresolved:t,hasSyncMetadata:s?k(e.places,s):void 0,note:null}}const l=T(e),n=u(e,l);if(l!==null){const s=l===e.lastActivePlaceId?e.lastActivePlaceName:null,t=n?w(e.places,n.placeId):!1,i=c("placeScope.folder.unresolvedPlace","Place {placeId}").replace("{placeId}",String(l));return{label:c("placeScope.lastActive.label","Last Active Place"),placeId:l,placeName:s??(t?i:n==null?void 0:n.placeName)??c("placeScope.unknownPlace","Unknown place"),badge:c("placeScope.stored","Stored data"),connected:!1,folderUnresolved:t,hasSyncMetadata:n?k(e.places,n):void 0,note:c("placeScope.stored.note","No connected Studio currently has this place open.")}}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"),connected:!1,folderUnresolved:!1,hasSyncMetadata:void 0,note:c("placeScope.noPlace.note","Connect WEPPY Plugin and sync a place to create place-scoped data.")}}function fe(e,c,l){const n=typeof c=="number"?u(e,c):null,s=A(e),t=(n==null?void 0:n.placeId)??s,i=u(e,t);if(t===null)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"),connected:!1,folderUnresolved:!1,hasSyncMetadata:void 0,note:l("placeScope.noPlace.note","Connect WEPPY Plugin and sync a place to create place-scoped data.")};const S=(i==null?void 0:i.isConnected)??!1,g=e.activePlaceId===t,v=t===e.lastActivePlaceId?e.lastActivePlaceName:null,h=g?e.activePlaceName:null,P=i?w(e.places,i.placeId):!1,N=l("placeScope.folder.unresolvedPlace","Place {placeId}").replace("{placeId}",String(t));return{label:g?l("placeScope.current.label","Current Place"):l("placeScope.selected.label","Selected Place"),placeId:t,placeName:h??v??(P?N:i==null?void 0:i.placeName)??l("placeScope.unknownPlace","Unknown place"),badge:S?l("placeScope.connected","Studio connected"):l("placeScope.stored","Stored data"),connected:S,folderUnresolved:P,hasSyncMetadata:i?k(e.places,i):void 0,note:S?null:l("placeScope.stored.note","No connected Studio currently has this place open.")}}function ve(e,c){switch(e){case"sync":return c("placeScope.surface.sync","Sync status and logs use this place.");case"changelog":return c("placeScope.surface.changelog","Changelog sessions use this place.");case"playtest":return c("placeScope.surface.playtest","Playtest reports use this place.");case"uiStudio":return c("placeScope.surface.uiStudio","UI captures and change history use this place.");case"tools":return c("placeScope.surface.tools","Tool history and statistics use this place.")}}function be({surface:e,selectable:c=!1,selectedPlaceId:l=null,onSelectedPlaceIdChange:n}){const{t:s}=m(),[t,i]=d.useState(null),[S,g]=d.useState(!0),[v,h]=d.useState(null),P=d.useRef(null),N=d.useRef(null),q=d.useId();d.useEffect(()=>{let r=!1;async function f(){try{const x=await V();r||i(x)}catch{r||i(null)}finally{r||g(!1)}}return f(),()=>{r=!0}},[]),d.useEffect(()=>{if(!c||!t)return;const r=A(t);(typeof l!="number"||!u(t,l))&&l!==r&&(n==null||n(r))},[n,c,l,t]);const L=t?pe(t,c,l):null,M=t?R(t,L):null,_=`${L??"none"}:${M??"none"}`;if(d.useEffect(()=>{h(r=>r===_?r:null)},[_]),d.useEffect(()=>{function r(){h(null)}function f(I){var b;v!==null&&!((b=P.current)!=null&&b.contains(I.target))&&r()}function x(I){var b;v!==null&&I.key==="Escape"&&(I.preventDefault(),r(),(b=N.current)==null||b.focus())}return document.addEventListener("pointerdown",f),document.addEventListener("keydown",x),()=>{document.removeEventListener("pointerdown",f),document.removeEventListener("keydown",x)}},[v]),S)return a.jsx("div",{className:o.scope,"aria-live":"polite",children:a.jsx("span",{className:o.label,children:s("placeScope.loading","Loading place scope...")})});if(!t)return a.jsx("div",{className:o.scope,"aria-live":"polite",children:a.jsx("span",{className:o.label,children:s("placeScope.unavailable","Place scope unavailable")})});const p=c?fe(t,l,s):ue(t,s),$=O(t),C=typeof p.placeId=="number"?String(p.placeId):"",F=c&&t.places.length>0,K=R(t,p.placeId),U=de(p.placeId,K,s),E=_,j=v===E;return a.jsxs("div",{className:o.scope,"aria-live":"polite",children:[a.jsxs("div",{className:o.main,children:[F?a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:o.selectorLabel,children:[a.jsx("span",{className:o.label,children:s("placeScope.selector.label","Place data")}),a.jsxs("select",{className:o.placeSelect,value:C,onChange:r=>{const f=Number.parseInt(r.currentTarget.value,10);h(null),n==null||n(Number.isInteger(f)?f:null)},children:[p.placeId===null?a.jsx("option",{value:"",disabled:!0,children:s("placeScope.selector.noneSelectable","No selectable Place folder")}):null,a.jsx(G,{places:t.places,confirmedNames:$,t:s})]})]}),a.jsx("span",{className:o.label,children:p.label}),a.jsx("span",{className:o.name,children:p.placeName})]}):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:o.label,children:p.label}),a.jsx("span",{className:o.name,children:p.placeName})]}),p.placeId!==null?a.jsx("span",{className:o.id,children:p.placeId}):null,a.jsx(y,{variant:p.connected?"success":"neutral",shape:"pill",className:o.scopeBadge,children:p.badge}),p.folderUnresolved?a.jsx(y,{variant:"neutral",shape:"pill",className:o.scopeBadge,children:s("placeScope.folder.unresolved","Representative folder unconfirmed")}):null,p.hasSyncMetadata===!1?a.jsx(y,{variant:"neutral",shape:"pill",className:o.scopeBadge,children:s("placeScope.folder.noSyncHistory","No sync history")}):null]}),a.jsxs("div",{className:o.copy,children:[a.jsx("span",{children:ve(e,s)}),p.note?a.jsx("span",{className:o.note,children:p.note}):null]}),t.places.some(r=>D(r)==="duplicate"||D(r)==="unresolved")?a.jsx("div",{className:o.folderDetails,children:a.jsx(H,{places:t.places,t:s})}):null,U.length>0?a.jsxs("div",{className:o.shortcuts,ref:P,children:[a.jsxs("button",{ref:N,type:"button",className:o.shortcutsTrigger,"aria-controls":q,"aria-expanded":j,onClick:()=>{h(j?null:E)},children:[s("placeScope.shortcuts.trigger","Quick links"),a.jsx("span",{"aria-hidden":"true",children:"↗"})]}),j?a.jsx("div",{id:q,className:o.shortcutsPopover,role:"group","aria-label":s("placeScope.shortcuts.label","Place shortcuts"),children:U.map(r=>a.jsxs("a",{className:o.shortcutLink,href:r.href,target:"_blank",rel:"noopener noreferrer",children:[a.jsx("span",{children:r.label}),a.jsx("span",{"aria-hidden":"true",children:"↗"})]},r.href))}):null]}):null]})}export{be as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r,h as e}from"./index-MEBRUJOq.js";function s({label:t,tooltip:o}){return r.jsx(e,{text:o,children:t})}export{s as I};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s,u as R,r as h,d as L,e as F,b as M,D as V}from"./index-MEBRUJOq.js";import{I as A}from"./InfoLabel-CJVH3VF5.js";import{P as U}from"./PageHeader-DUbueTLC.js";import{S as z}from"./StatusBadge-hrdvNb3-.js";import{T as O}from"./TooltipText-CHM9zlD0.js";import{G as X}from"./GameChangeDetail-pof3XQ18.js";import{u as q,f as J}from"./useLiveUptime-DtX2DhLL.js";const K="_page_amwos_2",Q="_card_amwos_10",W="_cardHeader_amwos_17",Y="_disconnectCard_amwos_28",Z="_disconnectIcon_amwos_36",ee="_disconnectTitle_amwos_41",se="_disconnectMessage_amwos_48",te="_reconnectGuide_amwos_55",ne="_guideStep_amwos_64",ie="_stepNumber_amwos_72",ae="_reconnectIndicator_amwos_88",ce="_reconnectDot_amwos_98",re="_pulse_amwos_1",oe="_disconnectActions_amwos_112",le="_btn_amwos_118",de="_btnSecondary_amwos_134",me="_metricRow_amwos_152",ue="_metricGrid_amwos_158",ve="_metricCard_amwos_164",ge="_metric_ok_amwos_174",_e="_metric_warn_amwos_179",he="_metric_error_amwos_184",pe="_metricHeader_amwos_189",we="_metricIcon_amwos_200",fe="_metricTitle_amwos_204",xe="_metricValue_amwos_208",Ce="_metricSubtitle_amwos_215",je="_guideCard_amwos_225",Ne="_guideTitle_amwos_232",ye="_checklist_amwos_239",Te="_feedEmpty_amwos_263",Se="_feedList_amwos_270",Ie="_feedItem_amwos_278",be="_feedTime_amwos_291",ke="_feedIcon_amwos_298",Me="_feedSummary_amwos_304",De="_feedText_amwos_313",Be="_feedContext_amwos_321",He="_feedItemClickable_amwos_330",Ee="_feedChevron_amwos_338",Pe="_feedDetail_amwos_347",$e="_feedDetailPre_amwos_356",Re="_feedDetailText_amwos_365",Ge="_changelogSummary_amwos_372",Le="_changeTag_amwos_381",Fe="_tierBar_amwos_393",Ve="_tierBarTrack_amwos_399",Ae="_tierBarFillBasic_amwos_407",Ue="_tierBarFillPro_amwos_412",ze="_tierLabels_amwos_417",t={page:K,card:Q,cardHeader:W,disconnectCard:Y,disconnectIcon:Z,disconnectTitle:ee,disconnectMessage:se,reconnectGuide:te,guideStep:ne,stepNumber:ie,reconnectIndicator:ae,reconnectDot:ce,pulse:re,disconnectActions:oe,btn:le,btnSecondary:de,metricRow:me,metricGrid:ue,metricCard:ve,metric_ok:ge,metric_warn:_e,metric_error:he,metricHeader:pe,metricIcon:we,metricTitle:fe,metricValue:xe,metricSubtitle:Ce,guideCard:je,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:a,subtitle:c,status:r,children:n}){const l=r?t[`metric_${r}`]:"";return s.jsxs("div",{className:`${t.metricCard} ${l}`,children:[s.jsxs("div",{className:t.metricHeader,children:[a&&s.jsx("span",{className:t.metricIcon,children:a}),s.jsx("span",{className:t.metricTitle,children:e})]}),s.jsx("div",{className:t.metricValue,children:i}),c&&s.jsx("div",{className:t.metricSubtitle,children:c}),n]})}function Oe(e){var a,c;const i=e==null?void 0:e.contextSummary;return(i==null?void 0:i.intent)??((c=(a=i==null?void 0:i.affectedAreas)==null?void 0:a[0])==null?void 0:c.label)??(i==null?void 0:i.testScenario)??null}function H({changes:e}){const{t:i}=R(),[a,c]=h.useState(null);return e.length===0?s.jsx("div",{className:t.feedEmpty,children:i("overview.feed.empty")}):s.jsx("div",{className:t.feedList,children:e.map((r,n)=>{const l=a===n,m=r.raw,u=m&&(m.before!=null||m.after!=null||m.details!=null),p=Oe(m);return s.jsxs("div",{children:[s.jsxs("div",{className:`${t.feedItem} ${u?t.feedItemClickable:""}`,onClick:()=>u&&c(l?null:n),children:[s.jsx("span",{className:t.feedTime,children:r.timestamp}),s.jsx("span",{className:t.feedIcon,children:r.icon}),s.jsxs("span",{className:t.feedText,children:[s.jsx("span",{className:t.feedSummary,children:r.summary}),p&&s.jsx("span",{className:t.feedContext,children:p})]}),u&&s.jsx("span",{className:t.feedChevron,children:l?"▴":"▾"})]}),l&&m&&s.jsx("div",{className:t.feedDetail,children:s.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(),a=F(),[c,r]=h.useState(null),[n,l]=h.useState(null),[m,u]=h.useState(null),[p,v]=h.useState([]),y=h.useRef(null),T=h.useCallback(async()=>{try{const o=await M.get("/connection-info");r(o)}catch{r(null)}},[]),S=h.useCallback(async()=>{try{const o=await M.get("/api/dashboard/changelog/active");if(u(o),o.recentChanges&&o.recentChanges.length>0){const w=o.recentChanges.map(g=>({timestamp:g.timestamp?G(new Date(g.timestamp)):P(),icon:$(g.category),summary:g.summary,category:g.category,raw:g}));v(w)}}catch{u(null)}},[]),f=h.useCallback(async()=>{try{const o=await M.get("/sync/status");l(o)}catch{l(null)}},[]);return h.useEffect(()=>{e!=="disconnected"?(T(),S(),f()):(r(null),l(null),u(null));const o=new V;y.current=o,o.connect();const w=o.on("game_change",x=>{const _=x,C={timestamp:P(),icon:$(_.category),summary:_.summary,category:_.category};v(k=>{const j=[C,...k];return j.length>E?j.slice(0,E):j}),S()}),g=o.on("sync",x=>{const _=x;l(C=>({...C,state:_.status,..._.placeId?{placeId:_.placeId}:{}}))});return()=>{w(),g(),o.disconnect(),y.current=null}},[e,T,S,f]),{level:e,status:i,connectionInfo:c,syncStatus:n,changeSummary:m,recentChanges:p,tier:a}}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,a,c){return s.jsxs("div",{className:e.metricSubtitle,children:[s.jsx(A,{label:i,tooltip:a}),": ",c]},i)}function d(e,i){return s.jsx(O,{text:i,children:e})}function ts(){var j,B;const{t:e}=R(),{level:i,status:a,connectionInfo:c,syncStatus:r,changeSummary:n,recentChanges:l}=Xe(),m=q(a==null?void 0:a.uptime),u=s.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 s.jsxs("div",{className:t.page,children:[u,s.jsxs("div",{className:t.disconnectCard,children:[s.jsx("div",{className:t.disconnectIcon,children:"⚠️"}),s.jsx("h2",{className:t.disconnectTitle,children:e("overview.l0.title")}),s.jsx("p",{className:t.disconnectMessage,children:e("overview.l0.message")}),s.jsxs("div",{className:t.reconnectGuide,children:[s.jsxs("div",{className:t.guideStep,children:[s.jsx("span",{className:t.stepNumber,children:"1"}),s.jsx("span",{children:e("overview.l0.step1")})]}),s.jsxs("div",{className:t.guideStep,children:[s.jsx("span",{className:t.stepNumber,children:"2"}),s.jsx("span",{children:e("overview.l0.step2")})]})]}),s.jsxs("div",{className:t.reconnectIndicator,children:[s.jsx("span",{className:t.reconnectDot}),e("overview.l0.reconnecting")]}),s.jsxs("div",{className:t.disconnectActions,children:[s.jsx("button",{className:t.btn,onClick:()=>window.location.reload(),children:e("overview.l0.reconnectBtn")}),s.jsx("button",{className:t.btnSecondary,onClick:()=>{window.location.hash="#/settings"},children:e("overview.l0.settingsBtn")})]})]})]});const p=(c==null?void 0:c.mcpInstanceCount)??0,v=((j=c==null?void 0:c.mcpInstances)==null?void 0:j.find(I=>!I.isServer&&I.aiClientName))??((B=c==null?void 0:c.mcpInstances)==null?void 0:B.find(I=>!!I.aiClientName))??null,y=(a==null?void 0:a.pluginClients)??[],T=y.length>0,S=(a==null?void 0:a.sessionId)??(c==null?void 0:c.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"),w=e("overview.metric.agent.tooltip","Connected AI coding agents and their runtime state"),g=e("overview.metric.sync.tooltip","Current Studio to local sync activity"),x=a?[b(t,e("overview.meta.version","Version"),e("overview.meta.version.tooltip","Installed MCP server version"),`v${a.version}`),b(t,e("overview.meta.session","Session"),e("overview.meta.session.tooltip","Current MCP session identifier"),S),b(t,e("overview.meta.pid","PID"),e("overview.meta.pid.tooltip","Operating system process identifier"),String(a.pid??"-")),b(t,e("overview.meta.uptime","Uptime"),e("overview.meta.uptime.tooltip","Time elapsed since the MCP server started"),J(m??a.uptime))]:[];if(i==="serverOnly")return s.jsxs("div",{className:t.page,children:[u,s.jsxs("div",{className:t.metricRow,children:[s.jsx(N,{title:d(e("overview.metric.server"),f),value:d(e("status.online"),f),icon:"🖥️",status:"ok",children:s.jsxs(s.Fragment,{children:[x,s.jsx(z,{status:"online"})]})}),s.jsx(N,{title:d(e("overview.metric.agent"),w),value:d((v==null?void 0:v.aiClientName)??e("overview.metric.noAgent"),w),icon:"🤖",subtitle:p>1?`${p} ${e("overview.metric.agent.instancesUnit","instances")}`:void 0,status:v?"ok":"warn"})]}),s.jsxs("div",{className:t.guideCard,children:[s.jsx("h3",{className:t.guideTitle,children:e("overview.l1.pluginGuide")}),s.jsxs("ul",{className:t.checklist,children:[s.jsx("li",{children:e("overview.l1.check1")}),s.jsx("li",{children:e("overview.l1.check2")})]})]}),s.jsxs("div",{className:t.card,children:[s.jsx("div",{className:t.cardHeader,children:e("overview.feed.title")}),l.length>0?s.jsx(H,{changes:l}):s.jsx("div",{className:t.feedEmpty,children:e("overview.l1.feedHint")})]}),n&&D(n)>0&&s.jsxs("div",{className:t.card,children:[s.jsx("div",{className:t.cardHeader,children:e("overview.changelog.title")}),s.jsxs("div",{className:t.changelogSummary,children:[s.jsxs("span",{children:[e("overview.changelog.entries","Entries"),": ",D(n)]}),n.scriptsModified>0&&s.jsxs("span",{className:t.changeTag,children:["📝"," ",n.scriptsModified," ",e("overview.changelog.scripts")]}),n.instancesCreated>0&&s.jsxs("span",{className:t.changeTag,children:["🧱"," ",n.instancesCreated," ",e("overview.changelog.instances")]}),n.propertiesChanged>0&&s.jsxs("span",{className:t.changeTag,children:["🎨"," ",n.propertiesChanged," ",e("overview.changelog.properties")]}),n.assetsInserted>0&&s.jsxs("span",{className:t.changeTag,children:["📦"," ",n.assetsInserted," ",e("overview.changelog.assets")]})]})]})]});const _=y[0],C=n?D(n):0,k=!!n&&C>0;return s.jsxs("div",{className:t.page,children:[u,s.jsxs("div",{className:t.metricGrid,children:[s.jsx(N,{title:d(e("overview.metric.server"),f),value:d(e("status.online"),f),icon:"🖥️",status:"ok",children:s.jsx(s.Fragment,{children:x})}),s.jsx(N,{title:d(e("overview.metric.plugin"),o),value:d(e(T?"status.online":"status.offline"),o),icon:"🔌",subtitle:_?`${_.placeName??"-"} / v${_.pluginVersion??"-"}`:void 0,status:T?"ok":"error"}),s.jsx(N,{title:d(e("overview.metric.agent"),w),value:d((v==null?void 0:v.aiClientName)??e("overview.metric.noAgent"),w),icon:"🤖",subtitle:p>1?`${p} ${e("overview.metric.agent.instancesUnit","instances")}`:void 0,status:v?"ok":"warn"}),s.jsx(N,{title:d(e("overview.metric.sync"),g),value:d(qe(r==null?void 0:r.state,e),g),icon:"🔄",status:Je(r==null?void 0:r.state)})]}),s.jsxs("div",{className:t.card,children:[s.jsx("div",{className:t.cardHeader,children:e("overview.feed.title")}),s.jsx(H,{changes:l})]}),k&&s.jsxs("div",{className:t.card,children:[s.jsx("div",{className:t.cardHeader,children:e("overview.changelog.title")}),s.jsxs("div",{className:t.changelogSummary,children:[s.jsxs("span",{children:[e("overview.changelog.entries","Entries"),": ",C]}),n.scriptsModified>0&&s.jsxs("span",{className:t.changeTag,children:["📝"," ",n.scriptsModified," ",e("overview.changelog.scripts")]}),n.instancesCreated>0&&s.jsxs("span",{className:t.changeTag,children:["🧱"," ",n.instancesCreated," ",e("overview.changelog.instances")]}),n.propertiesChanged>0&&s.jsxs("span",{className:t.changeTag,children:["🎨"," ",n.propertiesChanged," ",e("overview.changelog.properties")]}),n.assetsInserted>0&&s.jsxs("span",{className:t.changeTag,children:["📦"," ",n.assetsInserted," ",e("overview.changelog.assets")]})]})]})]})}export{ts as Component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as o,j as s}from"./index-MEBRUJOq.js";const e="_badge_1ucqq_2",c="_dot_1ucqq_12",a="_online_1ucqq_20",l="_offline_1ucqq_25",_="_idle_1ucqq_30",u="_syncing_1ucqq_34",d="_initializing_1ucqq_35",n={badge:e,dot:c,online:a,offline:l,idle:_,syncing:u,initializing:d},g={online:"status.online",offline:"status.offline",idle:"status.idle",syncing:"status.syncing",initializing:"status.initializing"};function f({status:i}){const{t}=o();return s.jsxs("span",{className:n.badge,children:[s.jsx("span",{className:`${n.dot} ${n[i]}`}),t(g[i])]})}export{f as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._page_1rrgy_2{display:flex;flex-direction:column;gap:var(--space-page);max-width:900px}._card_1rrgy_10{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:var(--card-padding-block) var(--card-padding-inline)}._cardHeader_1rrgy_17{font-family:var(--font-label);font-size:var(--type-card-title-size);font-weight:600;color:var(--text-primary);margin-bottom:var(--space-section);display:flex;align-items:center;justify-content:space-between;gap:var(--space-related)}._clearButton_1rrgy_29{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_1rrgy_29:hover{background:var(--danger-hover-bg);border-color:var(--danger)}._clearButton_1rrgy_29:focus-visible{outline:none;box-shadow:var(--focus-ring)}._statusRow_1rrgy_53{display:flex;align-items:center;gap:12px;margin-bottom:8px}._metaItem_1rrgy_60{font-family:var(--font-code);font-size:12px;color:var(--text-secondary)}._statusGrid_1rrgy_66{display:grid;grid-template-columns:auto 1fr;gap:4px 16px;font-size:12px}._statusGrid_1rrgy_66 dt{color:var(--text-secondary);font-family:var(--font-label)}._statusGrid_1rrgy_66 dd{margin:0;font-family:var(--font-code);color:var(--text-primary)}._migrationPanel_1rrgy_85{display:flex;flex-direction:column;gap:16px;font-size:16px}._migrationHeader_1rrgy_92{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}._migrationTitle_1rrgy_99{margin:0;color:var(--text-primary);font-family:var(--font-label);font-size:20px;line-height:1.25;font-weight:600}._migrationDescription_1rrgy_108{max-width:640px;margin:8px 0 0;color:var(--text-secondary);font-size:16px;line-height:1.5}._migrationLedger_1rrgy_116{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border:1px solid var(--border);background:var(--bg-secondary)}._migrationLedgerItem_1rrgy_123{display:flex;min-width:0;min-height:64px;flex-direction:column;justify-content:center;gap:4px;padding:8px 12px;border-right:1px solid var(--border);color:var(--text-secondary);font-family:var(--font-label);font-size:14px}._migrationLedgerItem_1rrgy_123:last-child{border-right:0}._migrationLedgerItem_1rrgy_123 strong{color:var(--text-primary);font-family:var(--font-code);font-size:20px;font-variant-numeric:tabular-nums}._migrationLedgerBlocked_1rrgy_148 strong{color:var(--warning-text)}._migrationSection_1rrgy_152{display:flex;flex-direction:column;gap:8px}._migrationSection_1rrgy_152 h3{margin:0;color:var(--text-secondary);font-family:var(--font-label);font-size:14px;font-weight:600}._migrationList_1rrgy_166{display:flex;flex-direction:column;gap:0;margin:0;padding:0;border:1px solid var(--border);list-style:none}._migrationRow_1rrgy_176{display:grid;grid-template-columns:84px minmax(0,1fr);align-items:start;gap:12px;padding:12px;border-bottom:1px solid var(--border)}._migrationRow_1rrgy_176:last-child{border-bottom:0}._migrationOperation_1rrgy_189{min-width:76px;text-transform:uppercase}._migrationRowBody_1rrgy_194{display:flex;min-width:0;flex-direction:column;gap:4px}._migrationRowBody_1rrgy_194 code{overflow-wrap:anywhere;color:var(--text-primary);font-family:var(--font-code);font-size:14px;line-height:1.4}._migrationRowBody_1rrgy_194 span{color:var(--text-secondary);font-size:14px;line-height:1.4}._migrationNotice_1rrgy_215{min-height:24px;color:var(--warning-text);font-size:16px;line-height:1.5}._migrationActions_1rrgy_222{display:flex;justify-content:flex-end;gap:8px}._migrationButton_1rrgy_228{min-height:44px;padding:0 16px;font-size:16px}@media(max-width:640px){._migrationHeader_1rrgy_92{flex-direction:column}._migrationLedger_1rrgy_116{grid-template-columns:repeat(2,minmax(0,1fr))}._migrationLedgerItem_1rrgy_123:nth-child(2){border-right:0}._migrationLedgerItem_1rrgy_123:nth-child(-n+2){border-bottom:1px solid var(--border)}._migrationRow_1rrgy_176{grid-template-columns:1fr}._migrationActions_1rrgy_222{flex-direction:column-reverse}._migrationButton_1rrgy_228{width:100%}}._policySummary_1rrgy_265{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;margin:0;overflow:hidden;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--border)}._policySummaryItem_1rrgy_276{display:grid;grid-template-columns:minmax(120px,.8fr) minmax(0,1.2fr);align-items:center;min-height:48px;gap:12px;padding:10px 12px;background:var(--bg-secondary)}._policySummaryItem_1rrgy_276 dt{color:var(--text-secondary);font-family:var(--font-label);font-size:12px}._policySummaryItem_1rrgy_276 dd{min-width:0;margin:0;color:var(--text-primary);font-family:var(--font-code);font-size:13px;overflow-wrap:anywhere}._policyPrimaryValue_1rrgy_301{font-family:var(--font-label)!important;font-size:16px!important;font-weight:600}._policyReviewNotice_1rrgy_307{margin-top:12px;padding:10px 12px;border:1px solid var(--warning-border);border-radius:var(--radius-control);background:var(--warning-bg);color:var(--warning-text);font-size:14px;line-height:1.45}._policyApplySection_1rrgy_318{margin-top:12px}._policyApplyHeader_1rrgy_322{margin-bottom:10px}._policyApplyTitle_1rrgy_326{margin:0;color:var(--text-primary);font-family:var(--font-label);font-size:14px;font-weight:600}._policyApplyDescription_1rrgy_334{margin:4px 0 0;color:var(--text-secondary);font-family:var(--font-label);font-size:13px;line-height:1.45}._policyInfoLabel_1rrgy_342{border-bottom:1px dotted var(--text-muted);cursor:help}._policyInfoLabel_1rrgy_342:focus-visible{outline:none;border-radius:2px;box-shadow:var(--focus-ring)}._policySafetyRow_1rrgy_353{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;min-height:48px;margin-top:8px;padding:0 12px;border:1px solid var(--border);border-radius:var(--radius-control)}._policySafetyLabel_1rrgy_365{color:var(--text-secondary);font-family:var(--font-label);font-size:12px}._policySafetyBadge_1rrgy_371{min-height:22px}._policyDisclosure_1rrgy_375{display:flex;width:100%;min-height:42px;align-items:center;justify-content:space-between;gap:12px;margin-top:12px;padding:0 12px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-card);color:var(--text-primary);font-family:var(--font-label);font-size:13px;font-weight:600;text-align:left;cursor:pointer;transition:background var(--transition),border-color var(--transition),color var(--transition)}._policyDisclosure_1rrgy_375:hover{border-color:var(--border-highlight);background:var(--bg-secondary);color:var(--accent)}._policyDisclosure_1rrgy_375:focus-visible{outline:none;box-shadow:var(--focus-ring)}._policyDisclosureIcon_1rrgy_407{flex:0 0 auto;color:var(--text-muted);font-family:var(--font-code);transition:transform var(--transition)}._policyDisclosureIconOpen_1rrgy_414{transform:rotate(180deg)}._policyScopeList_1rrgy_418{margin-top:8px;overflow:hidden;border:1px solid var(--border);border-radius:var(--radius-control)}._policyScopeRow_1rrgy_425{display:grid;grid-template-columns:minmax(180px,.9fr) minmax(0,1.1fr);align-items:center;min-height:44px;gap:16px;padding:8px 12px;border-bottom:1px solid var(--border)}._policyScopeRow_1rrgy_425:last-child{border-bottom:0}._policyScopeName_1rrgy_439{min-width:0;color:var(--text-secondary);font-family:var(--font-label);font-size:13px;overflow-wrap:anywhere}._policyScopeRow_1rrgy_425>[data-tooltip-text]{width:100%}._policyDirectionRail_1rrgy_451{display:grid;width:100%;min-width:0;grid-template-columns:minmax(0,1fr) 32px minmax(0,1fr);align-items:center;color:var(--text-secondary);font-family:var(--font-code)}._policyDirectionRail_1rrgy_451:focus-visible{outline:none;border-radius:2px;box-shadow:var(--focus-ring)}._policyDirectionEndpoint_1rrgy_467{min-width:0;font-size:11px;font-weight:500;overflow-wrap:anywhere}._policyDirectionEndpointStudio_1rrgy_474{text-align:right}._policyDirectionArrow_1rrgy_478{color:var(--accent);font-size:15px;font-weight:600;text-align:center}@media(max-width:640px){._policySummary_1rrgy_265{grid-template-columns:1fr}._policySummaryItem_1rrgy_276{grid-template-columns:minmax(112px,.8fr) minmax(0,1.2fr)}._policyScopeRow_1rrgy_425{grid-template-columns:1fr;gap:6px}._policySafetyRow_1rrgy_353{grid-template-columns:1fr;align-items:start;gap:8px;padding:10px 12px}._policySafetyRow_1rrgy_353>[data-tooltip-text]{max-width:100%;justify-self:start}._policySafetyBadge_1rrgy_371{height:auto;min-height:22px;white-space:normal;line-height:1.25;text-align:left}}._forwardBadge_1rrgy_521{display:inline-flex;align-items:center;min-height:20px;padding:2px 8px;font-size:10px;font-weight:600;letter-spacing:.04em;color:var(--text-secondary);background:var(--bg-secondary);border:1px solid var(--border);border-radius:var(--radius-control)}._logContainer_1rrgy_536{max-height:240px;overflow-y:auto;font-family:var(--font-code);font-size:11px}._logEntry_1rrgy_543{display:flex;gap:10px;padding:3px 0;border-bottom:1px solid var(--border);color:var(--text-primary)}._logEntry_1rrgy_543:last-child{border-bottom:none}._logTime_1rrgy_555{color:var(--text-muted);flex-shrink:0;width:44px}._logType_1rrgy_561{font-weight:500;flex-shrink:0;width:90px;text-transform:uppercase;font-size:10px;letter-spacing:.04em}._logTypeWrite_1rrgy_570{color:var(--success)}._logTypeUpdate_1rrgy_574{color:var(--accent)}._logTypeDelete_1rrgy_578{color:var(--error)}._logTypeIdle_1rrgy_582{color:var(--text-muted)}._logPath_1rrgy_586{color:var(--text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._logEmpty_1rrgy_593{color:var(--text-muted);font-style:italic;padding:8px 0}._overlay_1rrgy_600{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:48px 24px;gap:16px}._overlayTitle_1rrgy_610{font-family:var(--font-label);font-size:15px;font-weight:600;color:var(--text-primary)}._overlayMessage_1rrgy_617{font-size:13px;color:var(--text-secondary);max-width:400px}._checklist_1rrgy_623{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px;text-align:left}._checkItem_1rrgy_633{font-family:var(--font-code);font-size:12px;color:var(--text-secondary);padding-left:20px;position:relative}._checkItem_1rrgy_633:before{content:"○";position:absolute;left:0;color:var(--text-muted)}._upgradePanel_1rrgy_649{background:var(--bg-secondary);border:1px solid var(--border);border-radius:var(--radius);padding:16px 20px}._upgradePanelHeader_1rrgy_656{font-family:var(--font-label);font-size:13px;font-weight:600;color:var(--accent);margin-bottom:8px}._benefitList_1rrgy_664{list-style:none;padding:0;margin:0 0 12px;display:flex;flex-direction:column;gap:4px}._benefitItem_1rrgy_673{font-size:12px;color:var(--text-secondary);padding-left:16px;position:relative}._benefitItem_1rrgy_673:before{content:"+";position:absolute;left:0;color:var(--accent);font-weight:600}._upgradeActions_1rrgy_688{display:flex;gap:8px}._btn_1rrgy_693{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_1rrgy_693:hover{border-color:var(--accent);background:var(--accent-dim)}._btnPrimary_1rrgy_710{background:var(--accent);color:var(--bg-card);border-color:var(--accent)}._btnPrimary_1rrgy_710:hover{opacity:.9}._disabled_1rrgy_721{opacity:.4;pointer-events:none}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as c,b,k as C,D as F,u as O,j as e,a as U,d as V,e as W,i as q,T as G}from"./index-MEBRUJOq.js";import{B as R,a as P,P as z}from"./PageHeader-DUbueTLC.js";import{I}from"./InfoLabel-CJVH3VF5.js";import{T as j}from"./TooltipText-CHM9zlD0.js";import{C as H}from"./ConfirmModal-DD79xiWf.js";import{C as E}from"./CurrentPlaceScope-B0YLMs_a.js";import{S as Y}from"./StatusBadge-hrdvNb3-.js";import{T as K}from"./TierPromoPanel-D_H_UgF4.js";import"./ConfirmModal.module-DJksQHBd.js";import"./PlaceSelectOptions-KRG4cS5y.js";const J=5e3;function Q(){const[t,s]=c.useState(null),[l,a]=c.useState([]),[v,g]=c.useState(!0),[y,f]=c.useState(null),[_,w]=c.useState(null),[r,u]=c.useState({report:null,loading:!1,applying:!1,error:null}),D=c.useRef(null),N=c.useRef(null),x=c.useCallback(async()=>{var p;try{const[n,m]=await Promise.all([b.get("/sync/status"),b.get("/api/dashboard/place-summary")]);s(n);const T=(p=m.places)==null?void 0:p.find(M=>M.isActive);return f((T==null?void 0:T.placeDirName)??null),w(m.activePlaceId),m.activePlaceId}catch{return null}},[]),L=c.useCallback(async()=>{try{const p=await b.get("/sync/history",{limit:"30"});a(p.entries??[])}catch{a([])}},[]),o=c.useCallback(async p=>{if(p===null){u({report:null,loading:!1,applying:!1,error:null});return}u(n=>({...n,loading:!0,error:null}));try{const n=await b.get("/api/sync/migration",{placeId:String(p)});u(m=>({...m,report:n,loading:!1,error:n.status==="blocked"?"migration_blocked":null}))}catch(n){if(n instanceof C&&(n.status===404||n.status===503)){u(m=>({...m,report:null,loading:!1,error:null}));return}u(m=>({...m,loading:!1,error:"unknown"}))}},[]),h=c.useCallback(async()=>{const[p]=await Promise.all([x(),L()]);await o(p),g(!1)},[x,L,o]),k=c.useCallback(()=>{h()},[h]),A=c.useCallback(async()=>{await o(_)},[_,o]),d=c.useCallback(async()=>{const p=r.report;if(!(!p||p.status!=="ready"||r.applying)){u(n=>({...n,applying:!0,error:null}));try{const n=await b.post("/api/sync/migration",{placeId:p.placeId,fromVersion:2,previewFingerprint:p.previewFingerprint,apply:!0});u({report:n,loading:!1,applying:!1,error:null}),await x()}catch(n){if(n instanceof C&&n.status===409&&(n.error==="preview_stale"||n.error==="migration_blocked")){const m=n.error;await o(p.placeId),u(T=>({...T,applying:!1,error:m}));return}u(m=>({...m,applying:!1,error:"unknown"}))}}},[o,x,r.applying,r.report]),S=c.useCallback(async()=>{await b.post("/api/dashboard/sync/history/clear"),a([]),x()},[x]);return c.useEffect(()=>(h(),N.current=setInterval(h,J),()=>{N.current&&clearInterval(N.current)}),[h]),c.useEffect(()=>{const p=new F;D.current=p,p.connect();const n=p.on("sync",()=>{h()});return()=>{n(),p.disconnect(),D.current=null}},[h]),{status:t,history:l,loading:v,activePlaceDirName:y,migration:r,refresh:k,refreshMigration:A,applyMigration:d,clearHistory:S}}const X="_page_1rrgy_2",Z="_card_1rrgy_10",ee="_cardHeader_1rrgy_17",te="_clearButton_1rrgy_29",ie="_statusRow_1rrgy_53",oe="_metaItem_1rrgy_60",ae="_statusGrid_1rrgy_66",se="_migrationPanel_1rrgy_85",re="_migrationHeader_1rrgy_92",ne="_migrationTitle_1rrgy_99",ce="_migrationDescription_1rrgy_108",le="_migrationLedger_1rrgy_116",pe="_migrationLedgerItem_1rrgy_123",ye="_migrationLedgerBlocked_1rrgy_148",de="_migrationSection_1rrgy_152",ue="_migrationList_1rrgy_166",ge="_migrationRow_1rrgy_176",me="_migrationOperation_1rrgy_189",he="_migrationRowBody_1rrgy_194",fe="_migrationNotice_1rrgy_215",_e="_migrationActions_1rrgy_222",xe="_migrationButton_1rrgy_228",je="_policySummary_1rrgy_265",ve="_policySummaryItem_1rrgy_276",Se="_policyPrimaryValue_1rrgy_301",we="_policyReviewNotice_1rrgy_307",Ne="_policyApplySection_1rrgy_318",be="_policyApplyHeader_1rrgy_322",Ie="_policyApplyTitle_1rrgy_326",Le="_policyApplyDescription_1rrgy_334",Te="_policyInfoLabel_1rrgy_342",Re="_policySafetyRow_1rrgy_353",De="_policySafetyLabel_1rrgy_365",ke="_policySafetyBadge_1rrgy_371",Ae="_policyDisclosure_1rrgy_375",Ce="_policyDisclosureIcon_1rrgy_407",Pe="_policyDisclosureIconOpen_1rrgy_414",Ee="_policyScopeList_1rrgy_418",Be="_policyScopeRow_1rrgy_425",$e="_policyScopeName_1rrgy_439",Oe="_policyDirectionRail_1rrgy_451",He="_policyDirectionEndpoint_1rrgy_467",Me="_policyDirectionEndpointStudio_1rrgy_474",Fe="_policyDirectionArrow_1rrgy_478",Ue="_forwardBadge_1rrgy_521",Ve="_logContainer_1rrgy_536",We="_logEntry_1rrgy_543",qe="_logTime_1rrgy_555",Ge="_logType_1rrgy_561",ze="_logTypeWrite_1rrgy_570",Ye="_logTypeUpdate_1rrgy_574",Ke="_logTypeDelete_1rrgy_578",Je="_logTypeIdle_1rrgy_582",Qe="_logPath_1rrgy_586",Xe="_logEmpty_1rrgy_593",Ze="_overlay_1rrgy_600",et="_overlayTitle_1rrgy_610",tt="_overlayMessage_1rrgy_617",it="_checklist_1rrgy_623",ot="_checkItem_1rrgy_633",i={page:X,card:Z,cardHeader:ee,clearButton:te,statusRow:ie,metaItem:oe,statusGrid:ae,migrationPanel:se,migrationHeader:re,migrationTitle:ne,migrationDescription:ce,migrationLedger:le,migrationLedgerItem:pe,migrationLedgerBlocked:ye,migrationSection:de,migrationList:ue,migrationRow:ge,migrationOperation:me,migrationRowBody:he,migrationNotice:fe,migrationActions:_e,migrationButton:xe,policySummary:je,policySummaryItem:ve,policyPrimaryValue:Se,policyReviewNotice:we,policyApplySection:Ne,policyApplyHeader:be,policyApplyTitle:Ie,policyApplyDescription:Le,policyInfoLabel:Te,policySafetyRow:Re,policySafetyLabel:De,policySafetyBadge:ke,policyDisclosure:Ae,policyDisclosureIcon:Ce,policyDisclosureIconOpen:Pe,policyScopeList:Ee,policyScopeRow:Be,policyScopeName:$e,policyDirectionRail:Oe,policyDirectionEndpoint:He,policyDirectionEndpointStudio:Me,policyDirectionArrow:Fe,forwardBadge:Ue,logContainer:Ve,logEntry:We,logTime:qe,logType:Ge,logTypeWrite:ze,logTypeUpdate:Ye,logTypeDelete:Ke,logTypeIdle:Je,logPath:Qe,logEmpty:Xe,overlay:Ze,overlayTitle:et,overlayMessage:tt,checklist:it,checkItem:ot};function at(t){return t==="add"?"success":t==="delete"?"danger":"accent"}function st(t){return`sync.migration.reason.${t}`}function rt(t){return`sync.migration.reason.${t}`}function nt({migration:t,onRefresh:s,onApply:l}){const{t:a}=O(),[v,g]=c.useState(!1),y=t==null?void 0:t.report;if(!t||!y||y.status==="not_required")return null;const f=y.status==="blocked",_=y.status==="ready"&&!t.loading&&!t.applying,w=async()=>{await l(),g(!1)};return e.jsxs("section",{className:`${i.card} ${i.migrationPanel}`,"aria-labelledby":"sync-migration-title",children:[e.jsxs("div",{className:i.migrationHeader,children:[e.jsxs("div",{children:[e.jsx("h2",{id:"sync-migration-title",className:i.migrationTitle,children:a("sync.migration.title","Sync format update available")}),e.jsx("p",{className:i.migrationDescription,children:a("sync.migration.description","Review the metadata changes before updating this place from sync format v2 to v3.")})]}),e.jsx(R,{variant:f?"warning":"accent",children:f?a("sync.migration.status.blocked","Blocked"):a("sync.migration.status.ready","Ready to review")})]}),e.jsxs("div",{className:i.migrationLedger,"aria-label":a("sync.migration.preview","Review changes"),children:[e.jsxs("div",{className:i.migrationLedgerItem,children:[e.jsx("span",{children:a("sync.migration.summary.add","Add")}),e.jsx("strong",{children:y.summary.add})]}),e.jsxs("div",{className:i.migrationLedgerItem,children:[e.jsx("span",{children:a("sync.migration.summary.modify","Modify")}),e.jsx("strong",{children:y.summary.modify})]}),e.jsxs("div",{className:i.migrationLedgerItem,children:[e.jsx("span",{children:a("sync.migration.summary.delete","Delete")}),e.jsx("strong",{children:y.summary.delete})]}),e.jsxs("div",{className:`${i.migrationLedgerItem} ${f?i.migrationLedgerBlocked:""}`,children:[e.jsx("span",{children:a("sync.migration.summary.blocked","Blocked")}),e.jsx("strong",{children:y.summary.blocked})]})]}),y.changes.length>0&&e.jsxs("div",{className:i.migrationSection,children:[e.jsx("h3",{children:a("sync.migration.changes","Metadata changes")}),e.jsx("ul",{className:i.migrationList,children:y.changes.map(r=>e.jsxs("li",{className:i.migrationRow,children:[e.jsx(R,{variant:at(r.operation),className:i.migrationOperation,children:a(`sync.migration.operation.${r.operation}`,r.operation)}),e.jsxs("div",{className:i.migrationRowBody,children:[e.jsx("code",{children:r.path}),e.jsx("span",{children:a(st(r.reason),r.reason.replace(/_/g," "))})]})]},`${r.operation}:${r.path}`))})]}),y.blockers.length>0&&e.jsxs("div",{className:i.migrationSection,children:[e.jsx("h3",{children:a("sync.migration.blockers","Items to resolve")}),e.jsx("ul",{className:i.migrationList,children:y.blockers.map((r,u)=>e.jsxs("li",{className:i.migrationRow,children:[e.jsx(R,{variant:"warning",className:i.migrationOperation,children:a("sync.migration.summary.blocked","Blocked")}),e.jsxs("div",{className:i.migrationRowBody,children:[r.path&&e.jsx("code",{children:r.path}),e.jsx("span",{children:a(rt(r.reason),r.reason.replace(/_/g," "))})]})]},`${r.reason}:${r.path??u}`))})]}),e.jsxs("div",{className:i.migrationNotice,"aria-live":"polite",children:[(f||t.error==="migration_blocked")&&e.jsx("span",{children:a("sync.migration.blocked","Resolve sync conflicts before updating")}),t.error==="preview_stale"&&e.jsx("span",{children:a("sync.migration.stale","Preview changed. Review the latest diff.")}),t.error==="unknown"&&e.jsx("span",{children:a("sync.migration.error","Could not update the sync format. Try again.")})]}),e.jsxs("div",{className:i.migrationActions,children:[e.jsx(P,{variant:"secondary",className:i.migrationButton,disabled:t.loading||t.applying,onClick:()=>void s(),children:t.loading?a("sync.migration.refreshing","Refreshing…"):a("sync.migration.refresh","Refresh preview")}),e.jsx(P,{variant:"primary",className:i.migrationButton,disabled:!_,onClick:()=>g(!0),children:t.applying?a("sync.migration.applying","Applying…"):a("sync.migration.apply","Apply update")})]}),e.jsx(H,{open:v,title:a("sync.migration.confirm.title","Apply sync format update?"),message:a("sync.migration.confirm.message","Back up and update the listed sync metadata. Your Luau source files will not change."),cancelLabel:a("common.cancel","Cancel"),confirmLabel:a("sync.migration.apply","Apply update"),loading:t.applying,onCancel:()=>!t.applying&&g(!1),onConfirm:()=>void w()})]})}const ct=["scriptSource","properties","structure","serviceProperties"];function lt(t){const s=new Date(t);return`${String(s.getHours()).padStart(2,"0")}:${String(s.getMinutes()).padStart(2,"0")}`}function pt(t){switch(t){case"write":return i.logTypeWrite;case"update":return i.logTypeUpdate;case"delete":return i.logTypeDelete;default:return i.logTypeIdle}}function yt(t){switch(t){case"syncing":return"syncing";case"initializing":return"initializing";case"idle":return"idle";default:return"offline"}}function dt(t,s){const l={studio_first:"Studio First",bidirectional_review:"Bidirectional",local_code_studio_world:"Local Code, Studio World",custom:"Custom"};return t(`sync.policy.preset.${s}`,l[s])}function B(t,s){return s==="auto"?t("sync.policy.apply.auto","Auto apply"):t("sync.policy.apply.manual","Review first")}function ut(t,s){const l={forward:"Studio → Local",reverse:"Local → Studio",bidirectional:"Both ways"};return t(`sync.policy.direction.${s}`,l[s])}function gt(t){return{forward:"←",reverse:"→",bidirectional:"⇄"}[t]}function mt(t,s){const l={forward:"Studio changes are written to local files.",reverse:"Local file changes are applied to Studio.",bidirectional:"Changes can move from Studio to local files and from local files to Studio."};return t(`sync.policy.direction.${s}.tooltip`,l[s])}function $(...t){const s=t[0]??"",l=s.includes("\\")&&!s.includes("/")?"\\":"/";return t.filter(a=>a.length>0).map((a,v)=>v===0?a.replace(/[\\/]+$/g,""):a.replace(/^[\\/]+|[\\/]+$/g,"")).join(l)}function ht(t){const s=t.replace(/[\\/]+$/g,""),l=s.split(/[\\/]+/);return l[l.length-1]??s}function ft(t,s){const l=ht(t);return l==="explorer"?t:l===s?$(t,"explorer"):$(t,s,"explorer")}function _t(t,s){return s?t("sync.policy.safety.auto","Auto delete to Studio"):t("sync.policy.safety.review","Review before delete")}function xt(t,s){return s?t("sync.policy.safety.auto.tooltip","Deleting local files may automatically remove matching Studio instances. This is separate from UI Studio automatic cleanup."):t("sync.policy.safety.review.tooltip","Local file deletions wait for review before matching Studio instances are removed. This is separate from UI Studio automatic cleanup.")}function jt(t,s){switch(s){case"write":return t("sync.log.type.write","WRITE");case"update":return t("sync.log.type.update","UPDATE");case"delete":return t("sync.log.type.delete","DELETE");default:return t("sync.log.type.idle","IDLE")}}function vt(t,s){switch(s){case"write":return t("sync.log.type.write.tooltip","A new sync output was written to disk.");case"update":return t("sync.log.type.update.tooltip","An existing synced file or instance was updated.");case"delete":return t("sync.log.type.delete.tooltip","A synced file or instance was removed.");default:return t("sync.log.type.idle.tooltip","A sync event was recorded without a file mutation.")}}function At(){const{t}=O(),{trackEvent:s}=U(),{level:l}=V(),{tier:a,loading:v}=W(),g=Q(),{show:y}=q(),[f,_]=c.useState(!1),[w,r]=c.useState(!1),[u,D]=c.useState(!1),N=!v&&a==="basic",x=l==="disconnected"||l==="serverOnly",L=e.jsx(z,{title:t("page.sync.title","Sync"),description:t("page.sync.description","Monitor Studio to local sync status, direction, apply mode, and recent sync logs."),helpTopicId:"sync",helpState:{connectionLevel:l,tier:a}});if(x)return e.jsxs("div",{className:i.page,children:[L,e.jsx(E,{surface:"sync"}),e.jsx("div",{className:i.card,children:e.jsxs("div",{className:i.overlay,children:[e.jsx("div",{className:i.overlayTitle,children:t("sync.overlay.title","Roblox Studio plugin required")}),e.jsx("div",{className:i.overlayMessage,children:t("sync.overlay.message","Sync status will be available once the Roblox Studio plugin connects.")}),e.jsxs("ul",{className:i.checklist,children:[e.jsx("li",{className:i.checkItem,children:t("sync.overlay.check1","Is Roblox Studio running?")}),e.jsx("li",{className:i.checkItem,children:t("sync.overlay.check2","Is the WEPPY Plugin installed?")})]})]})})]});const o=g.status,h=g.history,k=yt(o==null?void 0:o.state),A=async()=>{r(!0);try{await g.clearHistory(),y(t("toast.clearSuccess","Cleared successfully"),"success"),_(!1)}catch{y(t("toast.clearFailed","Failed to clear data"),"error")}finally{r(!1)}};return e.jsxs("div",{className:i.page,children:[L,e.jsx(E,{surface:"sync"}),e.jsxs("div",{className:i.card,children:[e.jsxs("div",{className:i.cardHeader,children:[e.jsx(j,{text:t("sync.status.title.tooltip","Current Studio and local file sync status for this place."),children:t("sync.status.title","Sync Status")}),N&&e.jsx(j,{text:t("sync.status.forwardOnly.tooltip","Basic tier allows Studio to local forward sync only."),children:e.jsx("span",{className:i.forwardBadge,children:t("sync.status.forwardOnly","Forward Only")})})]}),e.jsxs("div",{className:i.statusRow,children:[e.jsx(Y,{status:k}),(o==null?void 0:o.placeName)&&e.jsxs("span",{className:i.metaItem,children:[e.jsx(I,{label:t("sync.status.place","Place"),tooltip:t("sync.status.place.tooltip","Connected Roblox place name and place ID.")}),": ",o.placeName,o.placeId?` (${o.placeId})`:""]})]}),e.jsxs("dl",{className:i.statusGrid,children:[(o==null?void 0:o.syncRoot)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(I,{label:t("sync.status.path","Place Root"),tooltip:t("sync.status.path.tooltip","Local filesystem root currently used for this place sync output.")})}),e.jsx("dd",{children:o.syncRoot})]}),g.activePlaceDirName&&(o==null?void 0:o.syncRoot)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(I,{label:t("sync.status.placePath","Explorer Path"),tooltip:t("sync.status.placePath.tooltip","Explorer files path for the active place.")})}),e.jsx("dd",{children:ft(o.syncRoot,g.activePlaceDirName)})]}),(o==null?void 0:o.instanceCount)!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(I,{label:t("sync.status.instances","Instances"),tooltip:t("sync.status.instances.tooltip","Total synced Roblox instances tracked in the local mirror.")})}),e.jsx("dd",{children:o.instanceCount})]}),(o==null?void 0:o.scriptCount)!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(I,{label:t("sync.status.scripts","Scripts"),tooltip:t("sync.status.scripts.tooltip","Total synced script files currently indexed for this place.")})}),e.jsx("dd",{children:o.scriptCount})]}),(o==null?void 0:o.state)==="syncing"&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(I,{label:t("sync.status.state","State"),tooltip:t("sync.status.state.tooltip","Current runtime sync state reported by the server.")})}),e.jsx("dd",{children:t("status.syncing","Syncing")})]})]})]}),e.jsx(nt,{migration:g.migration,onRefresh:g.refreshMigration,onApply:g.applyMigration}),(o==null?void 0:o.policy)&&e.jsxs("div",{className:i.card,children:[e.jsx("div",{className:i.cardHeader,children:e.jsx(j,{text:t("sync.policy.title.tooltip","Effective Sync policy reported by the connected Studio plugin."),children:t("sync.policy.title","Sync Policy")})}),e.jsxs("dl",{className:i.policySummary,children:[e.jsxs("div",{className:i.policySummaryItem,children:[e.jsx("dt",{children:t("sync.policy.activation","Activation")}),e.jsx("dd",{children:e.jsx(R,{variant:o.syncEnabled?"success":"neutral",children:o.syncEnabled?t("sync.policy.activation.on","Sync ON"):t("sync.policy.activation.off","Sync OFF")})})]}),e.jsxs("div",{className:i.policySummaryItem,children:[e.jsx("dt",{children:t("sync.policy.preset","Workflow")}),e.jsx("dd",{className:i.policyPrimaryValue,children:dt(t,o.policy.preset)})]})]}),o.policyReviewRequired&&e.jsx("div",{className:i.policyReviewNotice,role:"status",children:t("sync.policy.reviewRequired","Review this policy in the Studio plugin before starting Sync.")}),e.jsxs("section",{className:i.policyApplySection,"aria-labelledby":"sync-policy-apply-title",children:[e.jsxs("div",{className:i.policyApplyHeader,children:[e.jsx("h3",{id:"sync-policy-apply-title",className:i.policyApplyTitle,children:t("sync.policy.apply.title","How local changes apply to Studio")}),e.jsx("p",{className:i.policyApplyDescription,children:t("sync.policy.apply.description","Shows whether changes made locally are reviewed first or applied to Studio automatically.")})]}),e.jsxs("dl",{className:i.policySummary,children:[e.jsxs("div",{className:i.policySummaryItem,children:[e.jsx("dt",{children:e.jsx(j,{text:t("sync.policy.apply.content.tooltip","Script Source, property, and Service property changes made locally. Instance creation, deletion, renaming, and moves are Structure changes."),children:e.jsx("span",{className:i.policyInfoLabel,tabIndex:0,children:t("sync.policy.apply.content","Content changes")})})}),e.jsx("dd",{children:B(t,o.policy.apply.contentChanges)})]}),e.jsxs("div",{className:i.policySummaryItem,children:[e.jsx("dt",{children:e.jsx(j,{text:t("sync.policy.apply.structure.tooltip","Instance creation, deletion, renaming, and moves made locally. Automatic local deletion additionally requires the separate delete option below."),children:e.jsx("span",{className:i.policyInfoLabel,tabIndex:0,children:t("sync.policy.apply.structure","Structure changes")})})}),e.jsx("dd",{children:B(t,o.policy.apply.structureChanges)})]})]}),e.jsxs("div",{className:i.policySafetyRow,children:[e.jsx("span",{className:i.policySafetyLabel,children:t("sync.policy.safety.localDeletes","Local delete → Studio instance removal")}),e.jsx(j,{text:xt(t,o.policy.autoApplyLocalDeletesToStudio),children:e.jsx(R,{variant:o.policy.autoApplyLocalDeletesToStudio?"warning":"neutral",className:i.policySafetyBadge,tabIndex:0,children:_t(t,o.policy.autoApplyLocalDeletesToStudio)})})]})]}),e.jsxs("button",{type:"button",className:i.policyDisclosure,"aria-expanded":u,"aria-controls":"sync-policy-scope-panel",onClick:()=>D(d=>!d),children:[e.jsx("span",{children:t("sync.policy.scope.disclosure","Scope directions")}),e.jsx("span",{"aria-hidden":"true",className:`${i.policyDisclosureIcon} ${u?i.policyDisclosureIconOpen:""}`,children:"⌄"})]}),u&&e.jsx("div",{id:"sync-policy-scope-panel",className:i.policyScopeList,children:ct.map(d=>{const S=o.policy.directions[d];return e.jsxs("div",{className:i.policyScopeRow,"data-testid":"sync-policy-scope-row",children:[e.jsx("span",{className:i.policyScopeName,children:t(`sync.policy.scope.${d}`,d)}),e.jsx(j,{text:mt(t,S),children:e.jsxs("span",{className:i.policyDirectionRail,"data-testid":"sync-policy-direction-rail",role:"img","aria-label":ut(t,S),tabIndex:0,children:[e.jsx("span",{className:i.policyDirectionEndpoint,children:t("sync.policy.endpoint.local","Local")}),e.jsx("span",{className:i.policyDirectionArrow,"aria-hidden":"true",children:gt(S)}),e.jsx("span",{className:`${i.policyDirectionEndpoint} ${i.policyDirectionEndpointStudio}`,children:t("sync.policy.endpoint.studio","Studio")})]})})]},d)})})]}),e.jsxs("div",{className:i.card,children:[e.jsxs("div",{className:i.cardHeader,children:[e.jsx("span",{children:t("sync.log.title","Sync Log")}),e.jsx("button",{className:i.clearButton,onClick:()=>{s("dashboard_click_event",{click_target:"sync_clear_log",page:"sync"}),_(!0)},children:t("common.clear","Clear")})]}),e.jsx("div",{className:i.logContainer,children:h.length===0?e.jsx("div",{className:i.logEmpty,children:t("sync.log.empty","No sync events yet")}):h.map((d,S)=>e.jsxs("div",{className:i.logEntry,children:[e.jsx("span",{className:i.logTime,children:lt(d.timestamp)}),e.jsx(j,{text:vt(t,d.type),children:e.jsx("span",{className:`${i.logType} ${pt(d.type)}`,children:jt(t,d.type)})}),e.jsxs("span",{className:i.logPath,children:[d.path,d.details?` — ${d.details}`:""]})]},S))})]}),N&&e.jsx(K,{title:t("sync.upgrade.title","Explore Full Sync with Pro"),description:t("tier.banner.save","Save AI tokens with Pro!"),benefits:[t("sync.upgrade.benefit1","Bidirectional sync — edit files, auto-apply to Studio"),t("sync.upgrade.benefit2","Reverse sync — push file changes back to Studio"),t("sync.upgrade.benefit3","Full sync history and detailed change log")],upgradeLabel:t("sync.upgrade.buy","View Pro"),upgradeHref:G.sync}),e.jsx(H,{open:f,title:t("sync.clear.title","Clear sync log?"),message:t("sync.clear.message","This permanently removes the stored sync log for the current place."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:w,onCancel:()=>!w&&_(!1),onConfirm:A})]})}export{At as Component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._backdrop_1sgib_1{position:fixed;top:calc(var(--header-height) + 16px);right:24px;bottom:24px;left:calc(var(--sidebar-width) + 24px);z-index:900;display:flex;align-items:stretch;justify-content:center;min-width:0;padding:clamp(12px,2vw,24px);overflow:hidden;box-sizing:border-box;background:#03071294;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}._dialog_1sgib_19{display:flex;flex:1;flex-direction:column;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-card);box-shadow:0 24px 60px #0000006b}._dialog_1sgib_19>*{min-width:0;min-height:0;max-height:100%}@media(max-width:1120px){._backdrop_1sgib_1{right:16px;bottom:16px;left:calc(var(--sidebar-width) + 16px);padding:12px}}@media(max-width:768px){._backdrop_1sgib_1{top:calc(var(--header-height) + 10px);right:10px;bottom:10px;left:calc(var(--sidebar-collapsed) + 10px);padding:8px}}._tabBar_jefog_2{display:flex;align-items:stretch;gap:2px;border-bottom:1px solid var(--border)}._tabs_jefog_9{display:flex;gap:2px}._actions_jefog_14{margin-left:auto;display:flex;align-items:center;gap:8px;padding-bottom:4px}._tab_jefog_2{font-family:var(--font-label);font-size:12px;font-weight:500;min-height:34px;padding:0 14px;background:transparent;border:1px solid transparent;border-bottom:2px solid transparent;border-radius:var(--radius-control) var(--radius-control) 0 0;color:var(--text-secondary);cursor:pointer;transition:background var(--transition),border-color var(--transition),color var(--transition)}._tab_jefog_2:hover{background:var(--bg-secondary);border-color:var(--border);border-bottom-color:transparent;color:var(--text-primary)}._tab_jefog_2:focus-visible{outline:none;box-shadow:var(--focus-ring)}._tabActive_jefog_52{background:var(--accent-dim);color:var(--accent);border-bottom-color:var(--accent)}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,x as k,j as d}from"./index-MEBRUJOq.js";const w="_backdrop_1sgib_1",T="_dialog_1sgib_19",h={backdrop:w,dialog:T},B=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[contenteditable="true"]','[tabindex]:not([tabindex="-1"])'].join(", ");function L(a){return Array.from(a.querySelectorAll(B))}function R(a){const s=document.activeElement;if(!(s instanceof HTMLElement))return!1;const c=s.closest('[role="dialog"][aria-modal="true"]');return c!==null&&c!==a}function M({open:a,ariaLabel:s,onClose:c,returnFocusTo:f=null,initialFocusRef:l,dismissDisabled:i=!1,children:m,testId:v}){const e=r.useRef(null),t=r.useRef(c),u=r.useRef(i),E=r.useRef(null);return t.current=c,u.current=i,r.useEffect(()=>{if(!a)return;const o=e.current;if(!o)return;const j=document.body.style.overflow;E.current=f??(document.activeElement instanceof HTMLElement?document.activeElement:null),document.body.style.overflow="hidden",((l==null?void 0:l.current)??o).focus();const _=n=>{if(R(o))return;if(n.key==="Escape"){n.preventDefault(),u.current||t.current();return}if(n.key!=="Tab")return;const g=L(o);if(g.length===0){n.preventDefault(),o.focus();return}const p=g[0],x=g[g.length-1],y=document.activeElement;n.shiftKey&&(y===p||!o.contains(y))?(n.preventDefault(),x.focus()):!n.shiftKey&&(y===x||!o.contains(y))&&(n.preventDefault(),p.focus())};return document.addEventListener("keydown",_),()=>{document.removeEventListener("keydown",_),document.body.style.overflow=j;const n=f??E.current;n&&document.contains(n)&&n.focus()}},[l,a,f]),a?k.createPortal(d.jsx("div",{className:h.backdrop,"data-testid":v,role:"presentation",onClick:o=>{o.target===o.currentTarget&&!i&&t.current()},children:d.jsx("section",{ref:e,className:h.dialog,role:"dialog","aria-modal":"true","aria-label":s,tabIndex:-1,children:m})}),document.body):null}const A="_tabBar_jefog_2",D="_tabs_jefog_9",N="_actions_jefog_14",C="_tab_jefog_2",S="_tabActive_jefog_52",b={tabBar:A,tabs:D,actions:N,tab:C,tabActive:S};function O({items:a,value:s,onChange:c,ariaLabel:f,className:l,rightActions:i}){const m=r.useRef(null),v=r.useRef(null);return r.useEffect(()=>{const e=()=>{const t=m.current,u=v.current;!t||!u||typeof t.scrollTo!="function"||t.scrollTo({left:Math.max(0,u.offsetLeft+u.offsetWidth/2-t.clientWidth/2),behavior:"auto"})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[s]),d.jsxs("div",{ref:m,className:[b.tabBar,l].filter(Boolean).join(" "),role:"tablist","aria-label":f,children:[d.jsx("div",{className:b.tabs,children:a.map(e=>{const t=e.key===s;return d.jsx("button",{ref:t?v:void 0,type:"button",role:"tab","aria-selected":t,"data-testid":e.testId,className:[b.tab,t?b.tabActive:""].filter(Boolean).join(" "),onClick:()=>c(e.key),children:e.label},e.key)})}),i?d.jsx("div",{className:b.actions,children:i}):null]})}export{M as C,O as T};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,r as i,b as I,D as ht,u as at,X as mt,a as bt,i as xt}from"./index-MEBRUJOq.js";import{P as ft}from"./PageHeader-DUbueTLC.js";import{T as M}from"./TooltipText-CHM9zlD0.js";import{C as _t}from"./ConfirmModal-DD79xiWf.js";import{T as gt,C as jt}from"./Tabs-CXCAvK-b.js";import{C as yt}from"./CurrentPlaceScope-B0YLMs_a.js";import"./ConfirmModal.module-DJksQHBd.js";import"./PlaceSelectOptions-KRG4cS5y.js";const Ct="_wrapper_1s3lp_2",Tt="_table_1s3lp_7",kt="_sortable_1s3lp_32",Nt="_sortArrow_1s3lp_41",St="_clickable_1s3lp_52",wt="_empty_1s3lp_57",A={wrapper:Ct,table:Tt,sortable:kt,sortArrow:Nt,clickable:St,empty:wt};function vt({columns:t,data:o,sortBy:c,sortDir:T="asc",onSort:b,onRowClick:l,rowKey:N,emptyMessage:S}){return e.jsx("div",{className:A.wrapper,children:e.jsxs("table",{className:A.table,children:[e.jsx("thead",{children:e.jsx("tr",{children:t.map(h=>e.jsxs("th",{style:h.width?{width:h.width}:void 0,className:h.sortable?A.sortable:void 0,onClick:h.sortable&&b?()=>b(h.key):void 0,children:[e.jsx("span",{children:h.label}),h.sortable&&c===h.key&&e.jsx("span",{className:A.sortArrow,children:T==="asc"?"▴":"▾"})]},h.key))})}),e.jsx("tbody",{children:o.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:t.length,className:A.empty,children:S||"No data"})}):o.map((h,w)=>{const C=N?N(h):String(w);return e.jsx("tr",{className:l?A.clickable:void 0,tabIndex:l?-1:void 0,onClick:l?_=>l(h,_.currentTarget):void 0,children:t.map(_=>e.jsx("td",{children:_.render?_.render(h):String(h[_.key]??"")},_.key))},C)})})]})})}function Mt(t){return{...t,sequenceNumber:typeof t.sequenceNumber=="number"?t.sequenceNumber:void 0,executionTimeMs:typeof t.executionTimeMs=="number"?t.executionTimeMs:void 0}}const Bt=50;function Pt(t){if(typeof t=="number")return{placeId:String(t)}}function Y(t,o){return typeof o!="number"?t:`${t}?placeId=${encodeURIComponent(String(o))}`}function Lt(t){const o=(t==null?void 0:t.placeId)??null,[c,T]=i.useState(null),[b,l]=i.useState(!0),[N,S]=i.useState([]),[h,w]=i.useState(0),[C,_]=i.useState(!1),[U,O]=i.useState(!0),[m,E]=i.useState(0),[g,F]=i.useState(""),B=i.useRef(null),k=i.useCallback(async()=>{l(!0);try{const j=Pt(o),u=j?await I.get("/api/dashboard/tool-stats",j):await I.get("/api/dashboard/tool-stats");T(u)}catch{}finally{l(!1)}},[o]),x=i.useCallback(async(j,u)=>{O(!0);try{const P={limit:String(Bt),offset:String(j)};u&&(P.tool=u),typeof o=="number"&&(P.placeId=String(o));const H=await I.get("/api/dashboard/history",P);S(H.entries.map(Mt)),w(H.total),_(H.hasMore)}catch{S([]),w(0),_(!1)}finally{O(!1)}},[o]),D=i.useCallback(()=>{k(),x(m,g)},[x,k,m,g]),V=i.useCallback(async()=>{await I.post(Y("/api/dashboard/tools/history/clear",o)),x(m,g)},[x,m,g,o]),K=i.useCallback(async()=>{await I.post(Y("/api/dashboard/tools/statistics/clear",o)),k()},[k,o]);return i.useEffect(()=>{k()},[k]),i.useEffect(()=>{x(m,g)},[x,m,g]),i.useEffect(()=>{const j=new ht;B.current=j,j.connect();const u=j.on("command",()=>{k(),x(m,g)});return()=>{u(),j.disconnect(),B.current=null}},[x,k,m,g]),{statistics:c,statsLoading:b,history:N,historyTotal:h,historyHasMore:C,historyLoading:U,historyOffset:m,historyToolFilter:g,setHistoryOffset:E,setHistoryToolFilter:F,refresh:D,clearHistory:V,clearStatistics:K}}const Et="_page_1rtjt_2",Ht="_card_1rtjt_14",At="_cardToolbar_1rtjt_21",Rt="_sectionTitle_1rtjt_29",It="_dangerButton_1rtjt_36",Ot="_proBadge_1rtjt_55",Ft="_statusOk_1rtjt_70",Dt="_statusFallback_1rtjt_83",$t="_statusUnsupported_1rtjt_96",qt="_statusWarning_1rtjt_109",Wt="_statusError_1rtjt_122",Ut="_tierBasic_1rtjt_136",Vt="_tierPro_1rtjt_140",Kt="_tierMixed_1rtjt_145",Gt="_filterRow_1rtjt_156",zt="_filterLabel_1rtjt_163",Jt="_filterSelect_1rtjt_172",Qt="_detailsButton_1rtjt_187",Zt="_detailShell_1rtjt_210",Xt="_detailHeader_1rtjt_218",Yt="_detailHeading_1rtjt_229",te="_detailTitle_1rtjt_236",ee="_detailRecordName_1rtjt_243",se="_detailHeaderActions_1rtjt_252",ae="_detailCloseButton_1rtjt_259",oe="_detailBody_1rtjt_282",le="_detailSection_1rtjt_294",re="_detailList_1rtjt_313",ie="_detailItem_1rtjt_319",ne="_detailLabel_1rtjt_326",ce="_detailValue_1rtjt_331",de="_pre_1rtjt_337",ue="_pagination_1rtjt_355",pe="_pageInfo_1rtjt_363",he="_btn_1rtjt_369",me="_tierDistribution_1rtjt_397",be="_tierBarWrap_1rtjt_401",xe="_tierBarBasic_1rtjt_409",fe="_tierBarPro_1rtjt_414",_e="_tierLabels_1rtjt_419",ge="_statsTableWrap_1rtjt_428",je="_statsTable_1rtjt_428",ye="_sortableHeader_1rtjt_460",Ce="_sortArrow_1rtjt_465",Te="_statsToolRow_1rtjt_469",ke="_statsActionRow_1rtjt_477",Ne="_expandButton_1rtjt_481",Se="_expandIcon_1rtjt_493",we="_actionLabel_1rtjt_498",ve="_emptyStats_1rtjt_505",Me="_summaryLine_1rtjt_511",a={page:Et,card:Ht,cardToolbar:At,sectionTitle:Rt,dangerButton:It,proBadge:Ot,statusOk:Ft,statusFallback:Dt,statusUnsupported:$t,statusWarning:qt,statusError:Wt,tierBasic:Ut,tierPro:Vt,tierMixed:Kt,filterRow:Gt,filterLabel:zt,filterSelect:Jt,detailsButton:Qt,detailShell:Zt,detailHeader:Xt,detailHeading:Yt,detailTitle:te,detailRecordName:ee,detailHeaderActions:se,detailCloseButton:ae,detailBody:oe,detailSection:le,detailList:re,detailItem:ie,detailLabel:ne,detailValue:ce,pre:de,pagination:ue,pageInfo:pe,btn:he,tierDistribution:me,tierBarWrap:be,tierBarBasic:xe,tierBarPro:fe,tierLabels:_e,statsTableWrap:ge,statsTable:je,sortableHeader:ye,sortArrow:Ce,statsToolRow:Te,statsActionRow:ke,expandButton:Ne,expandIcon:Se,actionLabel:we,emptyStats:ve,summaryLine:Me},Be=new Set(["clientId","placeId","pinnedTarget","recentPriority","globalQueue"]);function tt(t){return typeof t=="string"&&t.length>0?t:void 0}function Pe(t){if(!Array.isArray(t))return;const o=t.filter(c=>typeof c=="string"&&c.length>0);return o.length>0?o:void 0}function Le(t){const o=t.result??{};return{requestedCommand:t.requestedCommand??tt(o.requestedCommand),executedCommand:t.executedCommand??tt(o.executedCommand),alternatives:t.alternatives??Pe(o.alternatives)}}function ot(t,o){switch(t.status){case"fallback":return{label:o("tools.badge.fallback","FALLBACK"),tooltip:o("tools.badge.fallback.tooltip","The requested Pro action succeeded via a Basic fallback."),className:a.statusFallback};case"unsupported":return{label:o("tools.badge.unsupported","UNSUPPORTED"),tooltip:o("tools.badge.unsupported.tooltip","The requested Pro action was blocked and no fallback ran."),className:a.statusUnsupported};case"warning":return{label:o("tools.badge.warn","WARN"),tooltip:o("tools.badge.warn.tooltip","The tool call failed as an expected caller, project, policy, or user-code issue."),className:a.statusWarning};case"error":return{label:o("tools.badge.err","FAILED"),tooltip:o("tools.badge.err.tooltip","The tool run failed."),className:a.statusError};default:return{label:o("tools.status.ok","OK"),tooltip:o("tools.status.ok.tooltip","The tool run completed successfully."),className:a.statusOk}}}function y(t,o){return e.jsxs("div",{className:a.detailItem,children:[e.jsx("span",{className:a.detailLabel,children:t}),e.jsx("span",{className:a.detailValue,children:o})]})}function Ee(t){if(!t||typeof t!="object")return;const o=t;if(typeof o.selectionMode=="string"&&Be.has(o.selectionMode))return o}function et(t){if(!(!t||typeof t!="object"||!("routing"in t)))return Ee(t.routing)}function He(t){return t.routing??et(t.result)??et(t.data)}function Ae(t,o){return t.requestedClientId?t.requestedClientId:t.requestedPlaceId!==void 0?t.requestedPlaceId:o("tools.history.routing.none","No Studio target named")}function Re(t){return t.actualPlaceName?`${t.actualPlaceName} · ${t.actualPlaceId??"-"}`:t.actualClientId??"-"}function Ie({entry:t,onClose:o}){const{t:c}=at(),T=ot(t,c),b=Le(t),l=He(t);return e.jsxs("div",{className:a.detailShell,children:[e.jsxs("header",{className:a.detailHeader,children:[e.jsxs("div",{className:a.detailHeading,children:[e.jsx("span",{className:a.detailTitle,children:c("tools.detail.title","Tool execution")}),e.jsx("span",{className:a.detailRecordName,children:t.command})]}),e.jsxs("div",{className:a.detailHeaderActions,children:[e.jsx(M,{text:T.tooltip,children:e.jsx("span",{className:T.className,children:T.label})}),e.jsx("button",{type:"button",className:a.detailCloseButton,onClick:o,"aria-label":c("common.close","Close"),children:e.jsx(mt,{size:18,"aria-hidden":"true"})})]})]}),e.jsxs("div",{className:a.detailBody,children:[e.jsxs("section",{className:a.detailSection,children:[e.jsx("strong",{children:e.jsx(M,{text:c("tools.detail.params.tooltip","Input parameters passed to this tool run."),children:c("tools.detail.params","Parameters")})}),e.jsx("pre",{className:a.pre,children:JSON.stringify(t.parameters,null,2)})]}),t.result&&e.jsxs("section",{className:a.detailSection,children:[e.jsx("strong",{children:e.jsx(M,{text:c("tools.detail.result.tooltip","Returned result payload for this tool run."),children:c("tools.detail.result","Result")})}),e.jsx("pre",{className:a.pre,children:JSON.stringify(t.result,null,2)})]}),l&&e.jsxs("section",{className:a.detailSection,children:[e.jsx("strong",{children:c("tools.history.routing","Routing")}),e.jsxs("div",{className:a.detailList,children:[y(c("tools.history.routing.mode","Mode"),l.selectionMode),y(c("tools.history.routing.requested","Requested"),Ae(l,c)),y(c("tools.history.routing.actual","Actual"),Re(l))]})]}),(t.status==="fallback"||t.status==="unsupported"||t.status==="warning"||t.status==="error")&&e.jsx("section",{className:a.detailSection,children:e.jsxs("div",{className:a.detailList,children:[t.status==="fallback"&&b.requestedCommand?y(c("tools.detail.requestedCommand","Requested Command"),b.requestedCommand):null,t.status==="fallback"&&b.executedCommand?y(c("tools.detail.executedCommand","Executed Command"),b.executedCommand):null,t.status==="fallback"&&b.alternatives?y(c("tools.detail.alternatives","Alternatives"),b.alternatives.join(", ")):null,t.status==="unsupported"&&t.blockedMessage?y(c("tools.detail.blockedMessage","Blocked Reason"),t.blockedMessage):null,t.status==="unsupported"?y(c("tools.detail.noFallback","No Fallback"),c("tools.detail.noFallback.value","No fallback ran.")):null,t.status==="warning"&&t.warningMessage?y(c("tools.detail.warningMessage","Warning Message"),t.warningMessage):null,t.status==="error"&&t.errorMessage?y(c("tools.detail.errorMessage","Error Message"),t.errorMessage):null,t.status==="error"&&t.blockedMessage?y(c("tools.detail.blockedMessage","Blocked Reason"),t.blockedMessage):null,t.status==="error"&&t.fallbackCommand?y(c("tools.detail.executedCommand","Executed Command"),t.fallbackCommand):null]})})]})]})}const G=50;function Oe(t){const o=new Date(t);return`${String(o.getHours()).padStart(2,"0")}:${String(o.getMinutes()).padStart(2,"0")}:${String(o.getSeconds()).padStart(2,"0")}`}function W(t){return typeof t!="number"||!Number.isFinite(t)?"-":t<1e3?`${t}ms`:`${(t/1e3).toFixed(1)}s`}function R(t,o){return o==="pro"?t("tier.pro","Pro"):o==="mixed"?t("tier.mixed","Mixed"):t("tier.basic","Basic")}function lt(t,o){return o!==t&&o.startsWith(`${t}_`)?o.slice(t.length+1):""}function st(t,o){const c=lt(t,o);return c?`${t}.${c}`:t}function ze(){const{t}=at(),{trackEvent:o,trackPageView:c}=bt(),[T,b]=i.useState(null),l=Lt({placeId:T}),{show:N}=xt(),[S,h]=i.useState("history"),[w,C]=i.useState(null),_=i.useRef(null),[U,O]=i.useState(null),[m,E]=i.useState(null),[g,F]=i.useState(!1),[B,k]=i.useState("totalCalls"),[x,D]=i.useState("desc"),V=i.useCallback(s=>{k(n=>n===s?(D(r=>r==="asc"?"desc":"asc"),s):(D("desc"),s))},[]),K=i.useMemo(()=>{var n;const s=new Set;return Object.keys(((n=l.statistics)==null?void 0:n.tools)??{}).forEach(r=>s.add(r)),l.history.forEach(r=>{r.tool&&s.add(r.tool)}),l.historyToolFilter&&s.add(l.historyToolFilter),Array.from(s).sort()},[l.history,l.historyToolFilter,l.statistics]),j=i.useMemo(()=>{var s;return(s=l.statistics)!=null&&s.tools?Object.values(l.statistics.tools).map(n=>{var X;const r=Object.entries(n.commands??{}).map(([p,d])=>({toolName:n.tool,commandName:d.command??p,label:lt(n.tool,d.command??p)||(d.command??p),tier:d.tier,totalCalls:d.totalCalls,successCount:d.successCount,fallbackCount:d.fallbackCount,unsupportedCount:d.unsupportedCount,warningCount:d.warningCount??0,failureCount:d.failureCount,totalExecutionTimeMs:d.totalExecutionTimeMs,avgExecutionTimeMs:d.avgExecutionTimeMs})),f=r.reduce((p,d)=>p+d.totalCalls,0),v=r.reduce((p,d)=>p+d.successCount,0),$=r.reduce((p,d)=>p+d.fallbackCount,0),q=r.reduce((p,d)=>p+d.unsupportedCount,0),dt=r.reduce((p,d)=>p+d.warningCount,0),ut=r.reduce((p,d)=>p+d.failureCount,0),Z=r.reduce((p,d)=>p+d.totalExecutionTimeMs,0),pt=new Set(r.map(p=>p.tier)).size>1?"mixed":((X=r[0])==null?void 0:X.tier)??n.tier;return{toolName:n.tool,tier:pt,commands:r,totalCalls:f,successCount:v,fallbackCount:$,unsupportedCount:q,warningCount:dt,failureCount:ut,totalExecutionTimeMs:Z,avgExecutionTimeMs:f>0?Math.round(Z/f):0}}):[]},[l.statistics]),u=i.useCallback((s,n,r,f)=>e.jsx(M,{text:t(r,f),children:t(s,n)}),[t]),P=i.useCallback((s,n)=>{_.current=n,C(s)},[]),H=i.useCallback(()=>{C(null)},[]),z=i.useMemo(()=>[...j].sort((n,r)=>{const f=n[B],v=r[B];if(typeof f=="number"&&typeof v=="number")return x==="asc"?f-v:v-f;const $=String(f??""),q=String(v??"");return x==="asc"?$.localeCompare(q):q.localeCompare($)}),[j,B,x]),rt=i.useMemo(()=>[{key:"timestamp",label:u("tools.col.time","Time","tools.col.time.tooltip","When the tool run was recorded."),width:"80px",render:s=>Oe(s.timestamp)},{key:"toolName",label:u("tools.col.toolAction","Tool.Action","tools.col.toolAction.tooltip","Tool name and action that were executed."),render:s=>e.jsxs("span",{children:[st(s.tool,s.command),s.tier==="pro"&&e.jsx(M,{text:t("tools.badge.pro.tooltip","This entry used a Pro-only tool or action."),children:e.jsx("span",{className:a.proBadge,children:t("tools.badge.pro","PRO")})})]})},{key:"executionTimeMs",label:u("tools.col.duration","Duration","tools.col.duration.tooltip","How long the tool took to finish."),width:"80px",render:s=>W(s.executionTimeMs)},{key:"status",label:u("tools.col.status","Status","tools.col.status.tooltip","Outcome of the recorded tool run."),width:"120px",render:s=>{const n=ot(s,t);return e.jsx(M,{text:n.tooltip,children:e.jsx("span",{className:n.className,children:n.label})})}},{key:"tier",label:u("tools.col.tier","Tier","tools.col.tier.tooltip","License tier required for the tool or action."),width:"60px",render:s=>e.jsx("span",{className:s.tier==="pro"?a.tierPro:a.tierBasic,children:R(t,s.tier)})},{key:"details",label:t("tools.detail.open","Details"),width:"84px",render:s=>{const n=st(s.tool,s.command);return e.jsx("button",{type:"button",className:a.detailsButton,"aria-haspopup":"dialog","aria-label":t("tools.detail.openLabel","View details for {command}").replace("{command}",n),onClick:r=>{r.stopPropagation(),P(s,r.currentTarget)},children:t("tools.detail.open","Details")})}}],[P,t,u]),J=i.useMemo(()=>[{key:"toolName",label:u("tools.col.tool","Tool","tools.col.tool.tooltip","Consolidated tool name in the statistics table."),sortable:!0},{key:"totalCalls",label:u("tools.col.calls","Calls","tools.col.calls.tooltip","Total number of recorded calls for this tool."),sortable:!0,width:"70px"},{key:"successCount",label:u("tools.col.ok","OK","tools.col.ok.tooltip","Number of direct successful runs."),sortable:!0,width:"70px"},{key:"fallbackCount",label:u("tools.col.fallback","FALLBACK","tools.col.fallback.tooltip","Number of runs that succeeded through fallback execution."),sortable:!0,width:"110px"},{key:"unsupportedCount",label:u("tools.col.unsupported","UNSUPPORTED","tools.col.unsupported.tooltip","Number of blocked runs without fallback execution."),sortable:!0,width:"130px"},{key:"warningCount",label:u("tools.col.warn","WARN","tools.col.warn.tooltip","Number of expected failures caused by caller input, project state, Roblox policy, or user code."),sortable:!0,width:"80px"},{key:"failureCount",label:u("tools.col.err","FAILED","tools.col.err.tooltip","Number of runs that failed."),sortable:!0,width:"70px"},{key:"avgExecutionTimeMs",label:u("tools.col.avgTime","Avg Time","tools.col.avgTime.tooltip","Average execution time across recorded calls."),sortable:!0,width:"90px",render:s=>W(s.avgExecutionTimeMs)},{key:"tier",label:u("tools.col.tier","Tier","tools.col.tierStats.tooltip","Basic, Pro, or Mixed summary for the tool statistics row."),sortable:!0,width:"70px",render:s=>e.jsx(M,{text:s.tier==="mixed"?t("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:e.jsx("span",{className:s.tier==="pro"?a.tierPro:s.tier==="mixed"?a.tierMixed:a.tierBasic,children:R(t,s.tier)})})}],[t,u]),L=i.useMemo(()=>{if(!l.statistics)return null;const s=l.statistics.tierSummary.basic.totalCalls,n=l.statistics.tierSummary.pro.totalCalls,r=s+n;if(r===0)return null;const f=Math.round(s/r*100),v=100-f;return{basic:s,pro:n,basicPct:f,proPct:v}},[l.statistics]),Q=i.useCallback(s=>{O(n=>n===s?null:s)},[]),it=i.useCallback(async()=>{if(m){F(!0);try{m==="history"?await l.clearHistory():await l.clearStatistics(),N(t("toast.clearSuccess","Cleared successfully"),"success"),E(null)}catch{N(t("toast.clearFailed","Failed to clear data"),"error")}finally{F(!1)}}},[m,N,t,l]),nt=i.useCallback(s=>{const n=s==="history"?"tools_history":"tools_statistics";o("dashboard_click_event",{click_target:s==="history"?"tools_tab_history":"tools_tab_statistics",page:"tools",tab:n}),c({page:"tools",tab:n}),C(null),h(s)},[o,c]),ct=["history","statistics"].map(s=>({key:s,label:t(`tools.tab.${s}`,s.charAt(0).toUpperCase()+s.slice(1))}));return e.jsxs("div",{className:a.page,children:[e.jsx(ft,{title:t("page.tools.title","Tools"),description:t("page.tools.description","Inspect tool history, outcomes, fallback details, and usage statistics."),helpTopicId:"tools"}),e.jsx(yt,{surface:"tools",selectable:!0,selectedPlaceId:T,onSelectedPlaceIdChange:s=>{C(null),b(s),l.setHistoryOffset(0)}}),e.jsx(gt,{items:ct,value:S,onChange:nt}),S==="history"&&e.jsxs("div",{className:a.card,children:[e.jsxs("div",{className:a.cardToolbar,children:[e.jsx("div",{className:a.sectionTitle,children:t("tools.tab.history","History")}),e.jsx("button",{className:a.dangerButton,onClick:()=>{o("dashboard_click_event",{click_target:"tools_clear_history",page:"tools",tab:"tools_history"}),E("history")},children:t("common.clear","Clear")})]}),e.jsx("div",{className:a.filterRow,children:e.jsxs("label",{className:a.filterLabel,children:[t("tools.filter.tool","Tool"),":",e.jsxs("select",{className:a.filterSelect,value:l.historyToolFilter,onChange:s=>{C(null),l.setHistoryToolFilter(s.target.value),l.setHistoryOffset(0)},children:[e.jsx("option",{value:"",children:t("tools.filter.all","All")}),K.map(s=>e.jsx("option",{value:s,children:s},s))]})]})}),e.jsx(vt,{columns:rt,data:l.history,rowKey:s=>s.id,onRowClick:(s,n)=>P(s,n),emptyMessage:t("tools.empty.history","No tool history entries for this place")}),e.jsxs("div",{className:a.pagination,children:[e.jsx("button",{className:a.btn,disabled:l.historyOffset===0,title:t("tools.page.prev.tooltip","Go to the previous page of tool history results."),onClick:()=>{C(null),l.setHistoryOffset(Math.max(0,l.historyOffset-G))},children:t("tools.page.prev","Prev")}),e.jsxs("span",{className:a.pageInfo,children:[l.historyOffset+1,"–",Math.min(l.historyOffset+G,l.historyTotal)," / ",l.historyTotal]}),e.jsx("button",{className:a.btn,disabled:!l.historyHasMore,title:t("tools.page.next.tooltip","Go to the next page of tool history results."),onClick:()=>{C(null),l.setHistoryOffset(l.historyOffset+G)},children:t("tools.page.next","Next")})]})]}),S==="statistics"&&e.jsxs("div",{className:a.card,children:[e.jsxs("div",{className:a.cardToolbar,children:[e.jsx("div",{className:a.sectionTitle,children:t("tools.tab.statistics","Statistics")}),e.jsx("button",{className:a.dangerButton,onClick:()=>{o("dashboard_click_event",{click_target:"tools_clear_statistics",page:"tools",tab:"tools_statistics"}),E("statistics")},children:t("common.clear","Clear")})]}),L&&e.jsxs("div",{className:a.tierDistribution,children:[e.jsxs("div",{className:a.tierBarWrap,children:[e.jsx("div",{className:a.tierBarBasic,style:{width:`${L.basicPct}%`}}),e.jsx("div",{className:a.tierBarPro,style:{width:`${L.proPct}%`}})]}),e.jsxs("div",{className:a.tierLabels,children:[e.jsxs("span",{children:[R(t,"basic")," ",L.basicPct,"% (",L.basic,")"]}),e.jsxs("span",{children:[R(t,"pro")," ",L.proPct,"% (",L.pro,")"]})]})]}),e.jsx("div",{className:a.statsTableWrap,children:e.jsxs("table",{className:a.statsTable,children:[e.jsx("thead",{children:e.jsx("tr",{children:J.map(s=>e.jsxs("th",{style:s.width?{width:s.width}:void 0,className:s.sortable?a.sortableHeader:void 0,onClick:s.sortable?()=>V(s.key):void 0,children:[e.jsx("span",{children:s.label}),s.sortable&&B===s.key&&e.jsx("span",{className:a.sortArrow,children:x==="asc"?"▴":"▾"})]},s.key))})}),e.jsx("tbody",{children:z.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:J.length,className:a.emptyStats,children:t("tools.empty.stats","No tool statistics for this place")})}):z.map(s=>{const n=U===s.toolName;return e.jsxs(i.Fragment,{children:[e.jsxs("tr",{className:a.statsToolRow,onClick:()=>Q(s.toolName),children:[e.jsx("td",{children:e.jsxs("button",{type:"button",className:a.expandButton,"aria-expanded":n,"aria-label":`${s.toolName} ${n?t("common.collapse","Collapse"):t("common.expand","Expand")}`,onClick:r=>{r.stopPropagation(),Q(s.toolName)},children:[e.jsx("span",{className:a.expandIcon,"aria-hidden":"true",children:n?"▾":"▸"}),e.jsx("span",{children:s.toolName})]})}),e.jsx("td",{children:s.totalCalls}),e.jsx("td",{children:s.successCount}),e.jsx("td",{children:s.fallbackCount}),e.jsx("td",{children:s.unsupportedCount}),e.jsx("td",{children:s.warningCount}),e.jsx("td",{children:s.failureCount}),e.jsx("td",{children:W(s.avgExecutionTimeMs)}),e.jsx("td",{children:e.jsx(M,{text:s.tier==="mixed"?t("tools.tier.mixed.tooltip","This tool includes both Basic and Pro actions."):"",children:e.jsx("span",{className:s.tier==="pro"?a.tierPro:s.tier==="mixed"?a.tierMixed:a.tierBasic,children:R(t,s.tier)})})})]}),n&&s.commands.map(r=>e.jsxs("tr",{className:a.statsActionRow,children:[e.jsx("td",{children:e.jsx("span",{className:a.actionLabel,children:r.label})}),e.jsx("td",{children:r.totalCalls}),e.jsx("td",{children:r.successCount}),e.jsx("td",{children:r.fallbackCount}),e.jsx("td",{children:r.unsupportedCount}),e.jsx("td",{children:r.warningCount}),e.jsx("td",{children:r.failureCount}),e.jsx("td",{children:W(r.avgExecutionTimeMs)}),e.jsx("td",{children:e.jsx("span",{className:r.tier==="pro"?a.tierPro:a.tierBasic,children:R(t,r.tier)})})]},`${s.toolName}:${r.commandName}`))]},s.toolName)})})]})}),l.statistics&&e.jsxs("div",{className:a.summaryLine,children:[t("tools.summary.total","Total"),": ",l.statistics.totalCalls," ",t("tools.summary.calls","calls")," | ",t("tools.summary.sessions","Sessions"),": ",l.statistics.totalSessions]})]}),e.jsx(jt,{open:w!==null,ariaLabel:t("tools.detail.dialogLabel","Tool execution detail"),onClose:H,returnFocusTo:_.current,testId:"tools-history-detail-popup-layer",children:w&&e.jsx(Ie,{entry:w,onClose:H})}),e.jsx(_t,{open:m!==null,title:m==="history"?t("tools.clear.history.title","Clear history?"):t("tools.clear.statistics.title","Clear statistics?"),message:m==="history"?t("tools.clear.history.message","This permanently removes the current place tools history."):t("tools.clear.statistics.message","This permanently resets the current place tool statistics."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:g,onCancel:()=>!g&&E(null),onConfirm:it})]})}export{ze as Component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r,h as s}from"./index-MEBRUJOq.js";function p({text:o,children:t}){return r.jsx(s,{text:o,children:t})}export{p as T};
|