@weppy/roblox-mcp 2.16.1 → 2.16.2
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 +7 -0
- package/dashboard/dist/assets/{AssetsPage-y9ob34oQ.js → AssetsPage-_CPMetwm.js} +2 -2
- package/dashboard/dist/assets/ChangelogPage-B9Ct115r.css +1 -0
- package/dashboard/dist/assets/ChangelogPage-BpTjHwvr.js +1 -0
- package/dashboard/dist/assets/{ConfirmModal-BCthkdVV.js → ConfirmModal-BSbhJt6x.js} +1 -1
- package/dashboard/dist/assets/{ConnectionPage-C5kFQ8k3.js → ConnectionPage-BMIbBueG.js} +2 -2
- package/dashboard/dist/assets/{ContentScopedDialog-Be71g2ql.js → ContentScopedDialog-D92wgDaU.js} +1 -1
- package/dashboard/dist/assets/{ControlsPage-CAQx3UR_.js → ControlsPage-C828Cgwo.js} +2 -2
- package/dashboard/dist/assets/CurrentPlaceScope-BFYSAg2T.js +1 -0
- package/dashboard/dist/assets/{GameChangeDetail-AUqSoK_K.js → GameChangeDetail-CCQ8h1ft.js} +1 -1
- package/dashboard/dist/assets/{InfoLabel-CI6bHOeU.js → InfoLabel-D6WxKFnG.js} +1 -1
- package/dashboard/dist/assets/OverviewPage-B8RMrIaQ.js +1 -0
- package/dashboard/dist/assets/{UiPrimitive-BMSNRGwI.css → PageHeader-CrhjZjgp.css} +1 -1
- package/dashboard/dist/assets/PageHeader-Xrn6BpcL.js +6 -0
- package/dashboard/dist/assets/{PlaytestPage-Djj9Z4yq.js → PlaytestPage-CrCurhRT.js} +2 -2
- package/dashboard/dist/assets/SettingsPage-B_9NwPEF.js +1 -0
- package/dashboard/dist/assets/{StatusBadge-PkthVJ8-.js → StatusBadge-Ddzg1cSk.js} +1 -1
- package/dashboard/dist/assets/SyncPage-BNadN0NU.js +1 -0
- package/dashboard/dist/assets/{Tabs-PO1vvwQv.js → Tabs-DZDOsT6_.js} +1 -1
- package/dashboard/dist/assets/ToolsPage-bHm2QbDR.js +1 -0
- package/dashboard/dist/assets/{TooltipText-d7cAgyJE.js → TooltipText-B1An7dUI.js} +1 -1
- package/dashboard/dist/assets/{UiStudioPage-DopaYXcf.js → UiStudioPage-CWQgLMHO.js} +2 -2
- package/dashboard/dist/assets/WhatsNewPage-D-iibgAc.js +1 -0
- package/dashboard/dist/assets/{copy-DfHRl3VR.js → copy-B03ftJiE.js} +1 -1
- package/dashboard/dist/assets/{index-Dj2NvZgn.js → index-Ygt1Wh6v.js} +19 -19
- package/dashboard/dist/assets/sample-requests-r6iFLFba.js +1 -0
- package/dashboard/dist/assets/{useLiveUptime-BH4xRx9-.js → useLiveUptime-CnfGQ_vS.js} +1 -1
- package/dashboard/dist/assets/useSettings-BrnGUYZY.js +1 -0
- package/dashboard/dist/index.html +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
- package/dashboard/dist/assets/ChangelogDetailPage-B7dy6kfX.js +0 -1
- package/dashboard/dist/assets/ChangelogDetailPage-vGgnpq1q.css +0 -1
- package/dashboard/dist/assets/ChangelogPage-CTzv0TSI.js +0 -1
- package/dashboard/dist/assets/ChangelogPage-DsP0fTsc.css +0 -1
- package/dashboard/dist/assets/CurrentPlaceScope-CMhgXKOx.js +0 -1
- package/dashboard/dist/assets/OverviewPage-QU6C8Jn2.js +0 -1
- package/dashboard/dist/assets/PageHeader-CDCcXu8v.js +0 -6
- package/dashboard/dist/assets/PageHeader-CV_rjuG8.css +0 -1
- package/dashboard/dist/assets/SettingsPage-u168hqTU.js +0 -1
- package/dashboard/dist/assets/SyncPage-DCSjeijW.js +0 -1
- package/dashboard/dist/assets/ToolsPage-Agg2KLl4.js +0 -1
- package/dashboard/dist/assets/UiPrimitive-BTuxHpyB.js +0 -1
- package/dashboard/dist/assets/WhatsNewPage-DZNySLP6.js +0 -1
- package/dashboard/dist/assets/sample-requests-CG4hsqBb.js +0 -1
- package/dashboard/dist/assets/useSettings-Q2tOR4bH.js +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weppy/roblox-mcp",
|
|
3
|
-
"version": "2.16.
|
|
3
|
+
"version": "2.16.2",
|
|
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 c,a as O,u as P,b as U,c as H,d as q,j as e}from"./index-Dj2NvZgn.js";import{I as W}from"./InfoLabel-CI6bHOeU.js";import{G as Y}from"./GameChangeDetail-AUqSoK_K.js";import{T as u}from"./TooltipText-d7cAgyJE.js";import{B as z}from"./UiPrimitive-BTuxHpyB.js";function J(t){const s={scriptsModified:0,scriptsCreated:0,instancesCreated:0,instancesDeleted:0,instancesMoved:0,propertiesChanged:0,lightingChanged:!1,terrainChanged:!1,assetsInserted:0};for(const r of t)switch(r.category){case"script":r.changeType==="create"?s.scriptsCreated++:s.scriptsModified++;break;case"instance":r.changeType==="create"?s.instancesCreated++:r.changeType==="delete"?s.instancesDeleted++:r.changeType==="move"&&s.instancesMoved++;break;case"property":s.propertiesChanged++;break;case"lighting":s.lightingChanged=!0;break;case"terrain":s.terrainChanged=!0;break;case"asset":s.assetsInserted++;break}return s}function Q(t){if(typeof t=="number")return{placeId:String(t)}}function X(t,s){const[r,p]=c.useState(""),[L,a]=c.useState(""),[h,w]=c.useState(),[y,B]=c.useState("completed"),[$,M]=c.useState([]),[v,R]=c.useState([]),[A,G]=c.useState([]),[K,V]=c.useState(),[S,C]=c.useState(),[b,N]=c.useState(),[T,k]=c.useState({scriptsModified:0,scriptsCreated:0,instancesCreated:0,instancesDeleted:0,instancesMoved:0,propertiesChanged:0,lightingChanged:!1,terrainChanged:!1,assetsInserted:0}),[I,x]=c.useState(!0),[E,f]=c.useState(null),g=c.useCallback(async()=>{if(t){x(!0),f(null);try{const m=Q(s),[d,_]=await Promise.all([m?O.get(`/api/dashboard/changelog/${t}`,m):O.get(`/api/dashboard/changelog/${t}`),m?O.get(`/api/dashboard/changelog/${t}/changes`,m):O.get(`/api/dashboard/changelog/${t}/changes`)]);p(d.entryId),a(d.startTime),w(d.endTime),B(d.status),M(d.entries),R(d.failures),V(d.contextSummary),C(d.replayMetadata),N(d.verificationSummary),G(_.changes),k(J(_.changes))}catch(m){f(m instanceof Error?m.message:"Failed to load changelog detail")}finally{x(!1)}}},[t,s]);return c.useEffect(()=>{g()},[g]),{entryId:r,startTime:L,endTime:h,status:y,entries:$,failures:v,changes:A,changeSummary:T,contextSummary:K,replayMetadata:S,verificationSummary:b,loading:I,error:E,refresh:g}}const Z={script:"📝",instance:"🧱",property:"🎨",lighting:"🌅",terrain:"⛰️",asset:"📦"};function ee(t){return Z[t]??"❓"}const te="_page_11hjw_2",ne="_header_11hjw_10",ae="_backLink_11hjw_16",se="_headerTitle_11hjw_29",ie="_headerTime_11hjw_37",ce="_statusActive_11hjw_44",re="_statusCompleted_11hjw_49",oe="_section_11hjw_54",le="_sectionTitle_11hjw_61",de="_summaryGrid_11hjw_74",me="_summaryCard_11hjw_80",he="_summaryCardActive_11hjw_94",ge="_summaryIcon_11hjw_99",ue="_summaryCount_11hjw_105",pe="_summaryLabel_11hjw_112",ye="_contextGrid_11hjw_121",xe="_contextRow_11hjw_127",fe="_contextKey_11hjw_133",_e="_contextValue_11hjw_141",je="_timelineFilter_11hjw_149",we="_filterLabel_11hjw_157",ve="_filterSelect_11hjw_163",Se="_ownershipToggle_11hjw_173",Ce="_timeline_11hjw_149",be="_timelineEntry_11hjw_201",Ne="_timelineTime_11hjw_218",Te="_timelineIcon_11hjw_226",ke="_timelineBody_11hjw_231",Ie="_timelineSummary_11hjw_236",Ee="_timelineTarget_11hjw_243",Oe="_timelineConfidence_11hjw_250",Le="_ownershipBadge_11hjw_259",Be="_confidenceExact_11hjw_267",$e="_confidencePartial_11hjw_272",Me="_confidenceAfterOnly_11hjw_277",Re="_confidenceIntentOnly_11hjw_282",Ae="_confidenceUnknown_11hjw_287",Ge="_timelineExpanded_11hjw_293",Ke="_empty_11hjw_365",Ve="_loading_11hjw_374",Fe="_error_11hjw_383",n={page:te,header:ne,backLink:ae,headerTitle:se,headerTime:ie,statusActive:ce,statusCompleted:re,section:oe,sectionTitle:le,summaryGrid:de,summaryCard:me,summaryCardActive:he,summaryIcon:ge,summaryCount:ue,summaryLabel:pe,contextGrid:ye,contextRow:xe,contextKey:fe,contextValue:_e,timelineFilter:je,filterLabel:we,filterSelect:ve,ownershipToggle:Se,timeline:Ce,timelineEntry:be,timelineTime:Ne,timelineIcon:Te,timelineBody:ke,timelineSummary:Ie,timelineTarget:Ee,timelineConfidence:Oe,ownershipBadge:Le,confidenceExact:Be,confidencePartial:$e,confidenceAfterOnly:Me,confidenceIntentOnly:Re,confidenceUnknown:Ae,timelineExpanded:Ge,empty:Ke,loading:Ve,error:Fe},D=[{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 F(t){if(!t)return"--:--";const s=new Date(t);return`${String(s.getHours()).padStart(2,"0")}:${String(s.getMinutes()).padStart(2,"0")}`}function De(t){if(!t)return"--:--:--";const s=new Date(t);return`${String(s.getHours()).padStart(2,"0")}:${String(s.getMinutes()).padStart(2,"0")}:${String(s.getSeconds()).padStart(2,"0")}`}function Pe(t,s){if(!t||!s)return"";const r=new Date(s).getTime()-new Date(t).getTime();return r<0?"":`${Math.round(r/6e4)}min`}function Ue(t){switch(t){case"exact":return n.confidenceExact;case"partial":return n.confidencePartial;case"after-only":return n.confidenceAfterOnly;case"intent-only":return n.confidenceIntentOnly;default:return n.confidenceUnknown}}function He(t,s){switch(s){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 qe(t,s){switch(s){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 We(t,s){switch(s){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 Ye(t){const s=new URLSearchParams(t).get("placeId");if(!s)return null;const r=Number.parseInt(s,10);return Number.isInteger(r)&&r>=0?r:null}function et(){var S,C,b,N,T,k,I,x,E,f,g,m,d,_;const{t}=P(),{id:s}=U(),r=H(),p=q(),L=c.useMemo(()=>Ye(p.search),[p.search]),a=X(s,L),[h,w]=c.useState("all"),[y,B]=c.useState(!0),[$,M]=c.useState(null),v=c.useMemo(()=>{const i=y?a.changes:a.changes.filter(o=>o.artifactOwnership!=="generated");return[...h==="all"?i:i.filter(o=>o.category===h)].reverse()},[a.changes,h,y]),R=a.changes.some(i=>i.artifactOwnership==="generated");if(a.loading)return e.jsx("div",{className:n.loading,children:t("common.loading","Loading...")});if(a.error)return e.jsxs("div",{className:n.error,children:[a.error,e.jsx("br",{}),e.jsxs("span",{className:n.backLink,onClick:()=>r("/changelog"),children:["←"," ",t("changelog.detail.backToList","Back to list")]})]});const A=Pe(a.startTime,a.endTime),G=a.endTime?`${F(a.startTime)} → ${F(a.endTime)} (${A})`:`${F(a.startTime)} → ${t("changelog.card.inProgress","in progress")}`,K=!!((S=a.contextSummary)!=null&&S.intent||(C=a.contextSummary)!=null&&C.testScenario||(b=a.contextSummary)!=null&&b.expectedBehavior||(N=a.contextSummary)!=null&&N.observedBehavior),V=!!((T=a.verificationSummary)!=null&&T.label||(k=a.verificationSummary)!=null&&k.status||(I=a.verificationSummary)!=null&&I.testTimestamp);return e.jsxs("div",{className:n.page,children:[e.jsxs("div",{className:n.header,children:[e.jsxs("span",{className:n.backLink,onClick:()=>r("/changelog"),children:["←"," ",t("sidebar.changelog","Changelog")]}),e.jsx("span",{className:n.headerTitle,children:"|"}),e.jsx("span",{className:n.headerTime,children:G}),e.jsx(u,{text:a.status==="active"?t("changelog.card.active.tooltip","This session is still receiving new game changes."):t("changelog.card.completed.tooltip","This session has ended and no more changes are expected."),children:e.jsx("span",{className:a.status==="active"?n.statusActive:n.statusCompleted,children:a.status==="active"?t("changelog.card.active","Active"):t("changelog.card.completed","Completed")})})]}),e.jsxs("div",{className:n.section,children:[e.jsx("div",{className:n.sectionTitle,children:e.jsx(u,{text:t("changelog.detail.changeSummary.tooltip","Counts of extracted game changes grouped by category for this session."),children:e.jsx("span",{children:t("changelog.detail.changeSummary","Change Summary")})})}),e.jsx("div",{className:n.summaryGrid,children:D.map(i=>{const l=a.changeSummary;let o;switch(i.key){case"script":o=l.scriptsModified+l.scriptsCreated;break;case"instance":o=l.instancesCreated+l.instancesDeleted+l.instancesMoved;break;case"property":o=l.propertiesChanged;break;case"lighting":o=l.lightingChanged?1:0;break;case"terrain":o=l.terrainChanged?1:0;break;case"asset":o=l.assetsInserted;break;default:o=0}const j=h===i.key;return e.jsxs("div",{className:`${n.summaryCard} ${j?n.summaryCardActive:""}`,onClick:()=>w(j?"all":i.key),children:[e.jsx("span",{className:n.summaryIcon,children:i.icon}),e.jsx("div",{className:n.summaryCount,children:o}),e.jsx("div",{className:n.summaryLabel,children:t(i.labelKey,i.key)})]},i.key)})})]}),K&&e.jsxs("div",{className:n.section,children:[e.jsx("div",{className:n.sectionTitle,children:e.jsx(u,{text:t("changelog.detail.context.tooltip","Structured execution context captured for this changelog session."),children:e.jsx("span",{children:t("changelog.detail.context.title","Context Summary")})})}),e.jsxs("div",{className:n.contextGrid,children:[((x=a.contextSummary)==null?void 0:x.intent)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("changelog.card.sessionIntent","Session intent")}),e.jsx("span",{className:n.contextValue,children:a.contextSummary.intent})]}),((E=a.contextSummary)==null?void 0:E.testScenario)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("playtest.context.why","Why this test ran")}),e.jsx("span",{className:n.contextValue,children:a.contextSummary.testScenario})]}),((f=a.contextSummary)==null?void 0:f.expectedBehavior)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("playtest.context.expected","Expected")}),e.jsx("span",{className:n.contextValue,children:a.contextSummary.expectedBehavior})]}),((g=a.contextSummary)==null?void 0:g.observedBehavior)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("playtest.context.observed","Observed")}),e.jsx("span",{className:n.contextValue,children:a.contextSummary.observedBehavior})]})]})]}),V&&e.jsxs("div",{className:n.section,children:[e.jsx("div",{className:n.sectionTitle,children:e.jsx(u,{text:t("changelog.detail.verification.tooltip","Verification signals linked to this changelog session."),children:e.jsx("span",{children:t("changelog.detail.verification.title","Verification")})})}),e.jsxs("div",{className:n.contextGrid,children:[((m=a.verificationSummary)==null?void 0:m.label)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("changelog.detail.verification.label","Result")}),e.jsx("span",{className:n.contextValue,children:a.verificationSummary.label})]}),((d=a.verificationSummary)==null?void 0:d.status)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("changelog.detail.verification.status","Status")}),e.jsx("span",{className:n.contextValue,children:a.verificationSummary.status})]}),((_=a.verificationSummary)==null?void 0:_.testTimestamp)&&e.jsxs("div",{className:n.contextRow,children:[e.jsx("span",{className:n.contextKey,children:t("changelog.detail.verification.timestamp","Recorded at")}),e.jsx("span",{className:n.contextValue,children:a.verificationSummary.testTimestamp})]})]})]}),e.jsxs("div",{className:n.section,children:[e.jsx("div",{className:n.sectionTitle,children:e.jsx(u,{text:t("changelog.detail.changeTimeline.tooltip","Chronological list of extracted game changes for this session."),children:e.jsx("span",{children:t("changelog.detail.changeTimeline","Change Timeline")})})}),e.jsxs("div",{className:n.timelineFilter,children:[e.jsx("span",{className:n.filterLabel,children:e.jsx(W,{label:`${t("changelog.detail.filterCategory","Category")}:`,tooltip:t("changelog.detail.filterCategory.tooltip","Filter the timeline to a single change category.")})}),e.jsxs("select",{className:n.filterSelect,value:h,onChange:i=>w(i.target.value),children:[e.jsx("option",{value:"all",children:t("tools.filter.all","All")}),D.map(i=>e.jsxs("option",{value:i.key,children:[i.icon," ",t(i.labelKey,i.key)]},i.key))]}),R&&e.jsxs("label",{className:n.ownershipToggle,children:[e.jsx("input",{type:"checkbox",checked:y,onChange:i=>B(i.target.checked)}),t("changelog.ownership.showGenerated","Show generated metadata")]})]}),v.length===0?e.jsx("div",{className:n.empty,children:t("changelog.detail.noChanges","No changes in this category")}):e.jsx("div",{className:n.timeline,children:v.map((i,l)=>{const o=$===l,j=We(t,i.artifactOwnership);return e.jsxs("div",{children:[e.jsxs("div",{className:n.timelineEntry,onClick:()=>M(o?null:l),children:[e.jsx("span",{className:n.timelineTime,children:De(i.timestamp)}),e.jsx("span",{className:n.timelineIcon,children:ee(i.category)}),e.jsxs("div",{className:n.timelineBody,children:[e.jsxs("div",{className:n.timelineSummary,children:[i.summary,j&&e.jsx(z,{variant:i.artifactOwnership==="generated"?"neutral":"accent",className:n.ownershipBadge,children:j}),e.jsx(u,{text:qe(t,i.confidence),children:e.jsx("span",{className:`${n.timelineConfidence} ${Ue(i.confidence)}`,children:He(t,i.confidence)})})]}),e.jsx("div",{className:n.timelineTarget,children:i.target})]})]}),o&&e.jsx("div",{className:n.timelineExpanded,children:e.jsx(Y,{change:i})})]},l)})})]})]})}export{et as Component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._page_11hjw_2{display:flex;flex-direction:column;gap:20px;max-width:900px}._header_11hjw_10{display:flex;align-items:center;gap:12px}._backLink_11hjw_16{font-family:var(--font-label);font-size:12px;color:var(--accent);cursor:pointer;text-decoration:none;transition:opacity var(--transition)}._backLink_11hjw_16:hover{opacity:.8}._headerTitle_11hjw_29{font-family:var(--font-label);font-size:14px;font-weight:600;color:var(--text-primary);letter-spacing:.03em}._headerTime_11hjw_37{font-family:var(--font-code);font-size:12px;color:var(--text-secondary);margin-left:auto}._statusActive_11hjw_44{color:var(--success);font-weight:600}._statusCompleted_11hjw_49{color:var(--text-muted)}._section_11hjw_54{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:16px 20px}._sectionTitle_11hjw_61{font-family:var(--font-label);font-size:12px;font-weight:600;color:var(--text-primary);text-transform:uppercase;letter-spacing:.05em;margin-bottom:12px;padding-bottom:8px;border-bottom:1px solid var(--border)}._summaryGrid_11hjw_74{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:10px}._summaryCard_11hjw_80{background:var(--bg-secondary);border:1px solid var(--border);border-radius:6px;padding:10px 12px;text-align:center;cursor:pointer;transition:border-color var(--transition)}._summaryCard_11hjw_80:hover{border-color:var(--accent)}._summaryCardActive_11hjw_94{border-color:var(--accent);background:var(--accent-dim)}._summaryIcon_11hjw_99{font-size:20px;display:block;margin-bottom:4px}._summaryCount_11hjw_105{font-family:var(--font-code);font-size:18px;font-weight:700;color:var(--text-primary)}._summaryLabel_11hjw_112{font-family:var(--font-label);font-size:10px;color:var(--text-secondary);text-transform:uppercase;letter-spacing:.04em;margin-top:2px}._contextGrid_11hjw_121{display:flex;flex-direction:column;gap:10px}._contextRow_11hjw_127{display:flex;flex-direction:column;gap:4px}._contextKey_11hjw_133{font-family:var(--font-label);font-size:10px;color:var(--text-muted);text-transform:uppercase;letter-spacing:.05em}._contextValue_11hjw_141{font-family:var(--font-label);font-size:13px;color:var(--text-primary);line-height:1.5}._timelineFilter_11hjw_149{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:12px}._filterLabel_11hjw_157{font-family:var(--font-label);font-size:11px;color:var(--text-secondary)}._filterSelect_11hjw_163{font-family:var(--font-code);font-size:11px;padding:3px 8px;border:1px solid var(--border);border-radius:4px;background:var(--bg-secondary);color:var(--text-primary)}._ownershipToggle_11hjw_173{display:inline-flex;min-height:44px;align-items:center;gap:8px;margin-left:auto;color:var(--text-secondary);font-family:var(--font-label);font-size:12px;cursor:pointer}._ownershipToggle_11hjw_173 input{width:16px;height:16px;accent-color:var(--accent)}._timeline_11hjw_149{display:flex;flex-direction:column;gap:0;position:relative;max-height:480px;overflow-y:auto}._timelineEntry_11hjw_201{display:flex;gap:12px;padding:8px 0;border-bottom:1px solid var(--border);transition:background var(--transition);cursor:pointer}._timelineEntry_11hjw_201:last-child{border-bottom:none}._timelineEntry_11hjw_201:hover{background:var(--bg-secondary)}._timelineTime_11hjw_218{font-family:var(--font-code);font-size:11px;color:var(--text-muted);min-width:50px;flex-shrink:0}._timelineIcon_11hjw_226{font-size:14px;flex-shrink:0}._timelineBody_11hjw_231{flex:1;min-width:0}._timelineSummary_11hjw_236{font-family:var(--font-code);font-size:12px;color:var(--text-primary);word-break:break-all}._timelineTarget_11hjw_243{font-family:var(--font-code);font-size:11px;color:var(--text-secondary);margin-top:2px}._timelineConfidence_11hjw_250{font-family:var(--font-label);font-size:9px;padding:1px 5px;border-radius:3px;margin-left:8px;vertical-align:middle}._ownershipBadge_11hjw_259{min-height:20px;margin-left:8px;padding:1px 6px;font-size:9px;vertical-align:middle}._confidenceExact_11hjw_267{background:#22c55e26;color:var(--success)}._confidencePartial_11hjw_272{background:#f59e0b26;color:var(--warning)}._confidenceAfterOnly_11hjw_277{background:#22c55e14;color:var(--text-secondary)}._confidenceIntentOnly_11hjw_282{background:#ef444426;color:var(--error)}._confidenceUnknown_11hjw_287{background:var(--bg-secondary);color:var(--text-muted)}._timelineExpanded_11hjw_293{margin-top:8px;padding:8px;background:var(--bg-card);border:1px solid var(--border);border-radius:6px}._beforeAfterList_11hjw_302{display:flex;flex-direction:column;gap:12px}._beforeAfterItem_11hjw_308{background:var(--bg-secondary);border:1px solid var(--border);border-radius:6px;overflow:hidden}._beforeAfterHeader_11hjw_315{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background:var(--bg-card);border-bottom:1px solid var(--border);cursor:pointer}._beforeAfterPath_11hjw_325{font-family:var(--font-code);font-size:11px;color:var(--text-primary)}._beforeAfterBadge_11hjw_331{font-family:var(--font-label);font-size:9px;padding:1px 6px;border-radius:3px;text-transform:uppercase;letter-spacing:.04em}._badgeCreate_11hjw_340{background:#22c55e26;color:var(--success)}._badgeModify_11hjw_345{background:#f59e0b26;color:var(--warning)}._badgeDelete_11hjw_350{background:#ef444426;color:var(--error)}._badgeMove_11hjw_355{background:#3b82f626;color:var(--accent)}._beforeAfterBody_11hjw_360{padding:8px}._empty_11hjw_365{text-align:center;padding:20px;color:var(--text-muted);font-family:var(--font-label);font-size:12px}._loading_11hjw_374{text-align:center;padding:40px 20px;color:var(--text-secondary);font-family:var(--font-label);font-size:12px}._error_11hjw_383{text-align:center;padding:40px 20px;color:var(--error);font-family:var(--font-label);font-size:13px}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as l,a as F,D,u as M,j as e,e as O,c as V,h as U,l as K,T as G}from"./index-Dj2NvZgn.js";import{P as H}from"./PageHeader-CDCcXu8v.js";import{C as Z}from"./ConfirmModal-BCthkdVV.js";import{C as Q}from"./CurrentPlaceScope-CMhgXKOx.js";import{T as k}from"./TooltipText-d7cAgyJE.js";import{T as q}from"./Tabs-PO1vvwQv.js";import"./UiPrimitive-BTuxHpyB.js";import"./ConfirmModal.module-DJksQHBd.js";const z=10;function J(t,o){return typeof o!="number"?t:`${t}?placeId=${encodeURIComponent(String(o))}`}function W(t){const o=(t==null?void 0:t.placeId)??null,[s,n]=l.useState([]),[u,_]=l.useState(0),[a,f]=l.useState(!1),[x,v]=l.useState(!0),[g,C]=l.useState(0),[d,y]=l.useState("all"),N=l.useRef(null),m=l.useCallback(async(h,b)=>{v(!0);try{const j={limit:String(z),offset:String(h)};b!=="all"&&(j.status=b),typeof o=="number"&&(j.placeId=String(o));const I=await F.get("/api/dashboard/changelog",j);n(I.entries),_(I.total),f(I.hasMore)}catch{n([]),_(0),f(!1)}finally{v(!1)}},[o]),S=l.useCallback(()=>{m(g,d)},[m,g,d]),i=l.useCallback(async()=>{await F.post(J("/api/dashboard/changelog/clear",o)),n([]),_(0),f(!1)},[o]);return l.useEffect(()=>{m(g,d)},[m,g,d]),l.useEffect(()=>{const h=new D;N.current=h,h.connect();const b=h.on("command",()=>{m(g,d)});return()=>{b(),h.disconnect(),N.current=null}},[m,g,d]),{entries:s,total:u,hasMore:a,loading:x,offset:g,statusFilter:d,setOffset:C,setStatusFilter:y,refresh:S,clear:i}}const X="_card_1n89u_2",Y="_header_1n89u_17",ee="_statusBadge_1n89u_24",te="_statusDot_1n89u_35",se="_active_1n89u_41",ae="_completed_1n89u_50",ne="_timeRange_1n89u_58",ce="_summaryList_1n89u_65",oe="_summaryItem_1n89u_71",ie="_summaryIcon_1n89u_80",le="_summaryText_1n89u_86",re="_progressBar_1n89u_91",ge="_progressFill_1n89u_99",de="_emptySummary_1n89u_112",me="_contextBlock_1n89u_120",he="_contextLabel_1n89u_129",pe="_contextValue_1n89u_137",c={card:X,header:Y,statusBadge:ee,statusDot:te,active:se,completed:ae,timeRange:ne,summaryList:ce,summaryItem:oe,summaryIcon:ie,summaryText:le,progressBar:re,progressFill:ge,emptySummary:de,contextBlock:me,contextLabel:he,contextValue:pe};function R(t){if(!t)return"--:--";const o=new Date(t);return`${String(o.getHours()).padStart(2,"0")}:${String(o.getMinutes()).padStart(2,"0")}`}function ue({entry:t,onClick:o}){var h,b,j,I,B,L,A,P,w,E;const{t:s}=M(),n=t.changeSummary,u=t.status==="active",_=t.isBootstrapOnly===!0,a=[],f=n.scriptsModified+n.scriptsCreated;if(f>0){const p=[];n.scriptsModified>0&&p.push(`${n.scriptsModified} ${s("changelog.card.modified","modified")}`),n.scriptsCreated>0&&p.push(`${n.scriptsCreated} ${s("changelog.card.created","created")}`);const T=`${f} ${s("changelog.card.scripts","scripts")} ${p.join(", ")}`;a.push({icon:"📝",text:T,tooltip:s("changelog.card.scripts.tooltip","Script changes made in this session.")})}const x=n.instancesCreated+n.instancesDeleted+n.instancesMoved;if(x>0){const p=[];n.instancesCreated>0&&p.push(`${n.instancesCreated} ${s("changelog.card.created","created")}`),n.instancesDeleted>0&&p.push(`${n.instancesDeleted} ${s("changelog.card.deleted","deleted")}`),n.instancesMoved>0&&p.push(`${n.instancesMoved} ${s("changelog.card.moved","moved")}`);const T=`${x} ${s("changelog.card.instances","instances")} ${p.join(", ")}`;a.push({icon:"🧱",text:T,tooltip:s("changelog.card.instances.tooltip","Instance create, delete, move, or clone changes in this session.")})}n.propertiesChanged>0&&a.push({icon:"🎨",text:`${n.propertiesChanged} ${s("changelog.card.propertiesChanged","properties changed")}`,tooltip:s("changelog.card.propertiesChanged.tooltip","Property value changes recorded for this session.")}),n.lightingChanged&&a.push({icon:"🌅",text:s("changelog.card.lightingConfigured","Lighting configured"),tooltip:s("changelog.card.lightingConfigured.tooltip","Lighting or atmosphere settings changed in this session.")}),n.terrainChanged&&a.push({icon:"⛰️",text:s("changelog.card.terrainConfigured","Terrain configured"),tooltip:s("changelog.card.terrainConfigured.tooltip","Terrain data or terrain settings changed in this session.")}),n.assetsInserted>0&&a.push({icon:"📦",text:`${n.assetsInserted} ${s("changelog.card.assetsInserted","assets inserted")}`,tooltip:s("changelog.card.assetsInserted.tooltip","Assets inserted into the place during this session.")});const v=R(t.startTime),g=u?s("changelog.card.inProgress","in progress"):t.endTime?R(t.endTime):"--:--",C=_?s("changelog.card.bootstrapStatus","Bootstrap"):u?s("changelog.card.active","Active"):s("changelog.card.completed","Completed"),d=_?s("changelog.card.bootstrapStatus.tooltip","This session only contains the initial sync bootstrap snapshot."):u?s("changelog.card.active.tooltip","This session is still receiving new game changes."):s("changelog.card.completed.tooltip","This session has ended and no more changes are expected."),y=_?s("changelog.card.bootstrapSummary","Initial sync snapshot"):s("changelog.card.noChanges","No changes yet"),N=_?s("changelog.card.bootstrapSummary.tooltip","Initial file sync writes are collapsed into a single bootstrap snapshot row."):s("changelog.card.noChanges.tooltip","No game changes have been extracted for this session yet."),m=(b=(h=t.contextSummary)==null?void 0:h.intent)==null?void 0:b.trim(),S=((L=(B=(I=(j=t.contextSummary)==null?void 0:j.affectedAreas)==null?void 0:I[0])==null?void 0:B.label)==null?void 0:L.trim())||((P=(A=t.contextSummary)==null?void 0:A.testScenario)==null?void 0:P.trim()),i=(E=(w=t.verificationSummary)==null?void 0:w.label)==null?void 0:E.trim();return e.jsxs("div",{className:c.card,onClick:o,children:[e.jsxs("div",{className:c.header,children:[e.jsx(k,{text:d,children:e.jsxs("span",{className:`${c.statusBadge} ${u?c.active:c.completed}`,children:[e.jsx("span",{className:c.statusDot}),C]})}),e.jsxs("span",{className:c.timeRange,children:[v,"~",g]})]}),e.jsx("div",{className:c.summaryList,children:a.length>0?a.map((p,T)=>e.jsxs("div",{className:c.summaryItem,children:[e.jsx("span",{className:c.summaryIcon,children:p.icon}),e.jsx(k,{text:p.tooltip,children:e.jsx("span",{className:c.summaryText,children:p.text})})]},T)):e.jsx(k,{text:N,children:e.jsx("span",{className:c.emptySummary,style:{display:"block"},children:y})})}),m&&e.jsxs("div",{className:c.contextBlock,children:[e.jsx("span",{className:c.contextLabel,children:s("changelog.card.sessionIntent","Session intent")}),e.jsx("span",{className:c.contextValue,children:m})]}),!m&&S&&e.jsxs("div",{className:c.contextBlock,children:[e.jsx("span",{className:c.contextLabel,children:s("changelog.card.representativeArea","Representative area")}),e.jsx("span",{className:c.contextValue,children:S})]}),i&&e.jsxs("div",{className:c.contextBlock,children:[e.jsx("span",{className:c.contextLabel,children:s("changelog.card.verification","Verification")}),e.jsx("span",{className:c.contextValue,children:i})]}),u&&e.jsx("div",{className:c.progressBar,children:e.jsx("div",{className:c.progressFill})})]})}const _e="_page_1tggr_2",fe="_limitNotice_1tggr_9",xe="_limitNoticeContent_1tggr_23",ye="_limitNoticeTitle_1tggr_28",be="_limitNoticeText_1tggr_35",ve="_primaryAction_1tggr_41",Ce="_clearButton_1tggr_67",Ne="_list_1tggr_88",Se="_empty_1tggr_95",je="_loading_1tggr_104",Ie="_pagination_1tggr_113",Te="_pageInfo_1tggr_121",$e="_btn_1tggr_127",r={page:_e,limitNotice:fe,limitNoticeContent:xe,limitNoticeTitle:ye,limitNoticeText:be,primaryAction:ve,clearButton:Ce,list:Ne,empty:Se,loading:je,pagination:Ie,pageInfo:Te,btn:$e},$=10;function ke(t,o){return typeof o!="number"?`/changelog/${t}`:`/changelog/${t}?placeId=${encodeURIComponent(String(o))}`}const Be=[{key:"all",labelKey:"changelog.filter.all"},{key:"active",labelKey:"changelog.filter.active"},{key:"completed",labelKey:"changelog.filter.completed"}];function De(){const{t}=M(),{trackEvent:o,trackPageView:s}=O(),n=V(),[u,_]=l.useState(null),a=W({placeId:u}),f=U(),{show:x}=K(),[v,g]=l.useState(!1),[C,d]=l.useState(!1),y=!f.loading&&f.tier==="basic",N=y?a.entries.slice(0,3):a.entries,m=!y&&a.total>$,S=async()=>{d(!0);try{await a.clear(),x(t("toast.clearSuccess","Cleared successfully"),"success"),g(!1)}catch{x(t("toast.clearFailed","Failed to clear data"),"error")}finally{d(!1)}};return e.jsxs("div",{className:r.page,children:[e.jsx(H,{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:f.tier}}),e.jsx(Q,{surface:"changelog",selectable:!0,selectedPlaceId:u,onSelectedPlaceIdChange:i=>{_(i),a.setOffset(0)}}),e.jsx(q,{items:Be.map(i=>({key:i.key,label:t(i.labelKey,i.key.charAt(0).toUpperCase()+i.key.slice(1))})),value:a.statusFilter,onChange:i=>{const h=`changelog_${i}`;o("dashboard_click_event",{click_target:`changelog_tab_${i}`,page:"changelog",tab:h}),s({page:"changelog",tab:h}),a.setStatusFilter(i),a.setOffset(0)},rightActions:e.jsx("button",{className:r.clearButton,onClick:()=>{o("dashboard_click_event",{click_target:"changelog_clear",page:"changelog",tab:`changelog_${a.statusFilter}`}),g(!0)},children:t("common.clear","Clear")})}),a.loading&&a.entries.length===0&&e.jsx("div",{className:r.loading,children:t("common.loading","Loading...")}),!a.loading&&a.entries.length===0?e.jsx("div",{className:r.empty,children:t("changelog.empty","No changelog entries for the current place yet")}):e.jsx("div",{className:r.list,children:N.map(i=>e.jsx(ue,{entry:i,onClick:()=>n(ke(i.entryId,u))},i.entryId))}),m&&e.jsxs("div",{className:r.pagination,children:[e.jsx("button",{className:r.btn,disabled:a.offset===0,onClick:()=>a.setOffset(Math.max(0,a.offset-$)),children:t("tools.page.prev","Prev")}),e.jsxs("span",{className:r.pageInfo,children:[a.offset+1,"–",Math.min(a.offset+$,a.total)," / ",a.total]}),e.jsx("button",{className:r.btn,disabled:!a.hasMore,onClick:()=>a.setOffset(a.offset+$),children:t("tools.page.next","Next")})]}),y&&e.jsx(e.Fragment,{children:e.jsxs("div",{className:r.limitNotice,children:[e.jsxs("div",{className:r.limitNoticeContent,children:[e.jsx("div",{className:r.limitNoticeTitle,children:t("changelog.basic.limit.title","Basic preview shows the latest 3 sessions")}),e.jsx("div",{className:r.limitNoticeText,children:t("changelog.basic.limit.body","Full changelog timeline browsing is available with Pro.")})]}),e.jsx("a",{className:r.primaryAction,href:G.changelog,target:"_blank",rel:"noreferrer",onClick:()=>o("dashboard_click_event",{click_target:"upgrade_cta",placement:"changelog_limit_notice",page:"changelog",tab:`changelog_${a.statusFilter}`}),children:t("tier.upgrade","View Pro")})]})}),e.jsx(Z,{open:v,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:C,onCancel:()=>!C&&g(!1),onConfirm:S})]})}export{De as Component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._card_1n89u_2{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:14px 18px;cursor:pointer;transition:border-color var(--transition),box-shadow var(--transition)}._card_1n89u_2:hover{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent-dim)}._header_1n89u_17{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}._statusBadge_1n89u_24{display:flex;align-items:center;gap:6px;font-family:var(--font-label);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em}._statusDot_1n89u_35{width:7px;height:7px;border-radius:50%}._active_1n89u_41 ._statusDot_1n89u_35{background:var(--success);box-shadow:0 0 6px var(--success)}._active_1n89u_41{color:var(--success)}._completed_1n89u_50 ._statusDot_1n89u_35{background:var(--text-muted)}._completed_1n89u_50{color:var(--text-secondary)}._timeRange_1n89u_58{font-family:var(--font-code);font-size:11px;color:var(--text-secondary)}._summaryList_1n89u_65{display:flex;flex-direction:column;gap:4px}._summaryItem_1n89u_71{display:flex;align-items:center;gap:8px;font-family:var(--font-code);font-size:12px;color:var(--text-primary)}._summaryIcon_1n89u_80{width:20px;text-align:center;flex-shrink:0}._summaryText_1n89u_86{color:var(--text-secondary)}._progressBar_1n89u_91{margin-top:10px;height:3px;background:var(--bg-secondary);border-radius:2px;overflow:hidden}._progressFill_1n89u_99{height:100%;background:var(--accent);border-radius:2px;animation:_pulse_1n89u_1 2s ease-in-out infinite}@keyframes _pulse_1n89u_1{0%,to{opacity:.6;width:30%}50%{opacity:1;width:70%}}._emptySummary_1n89u_112{font-family:var(--font-label);font-size:12px;color:var(--text-muted);text-align:center;padding:8px 0}._contextBlock_1n89u_120{margin-top:12px;padding-top:12px;border-top:1px solid var(--border);display:flex;flex-direction:column;gap:4px}._contextLabel_1n89u_129{font-family:var(--font-label);font-size:10px;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted)}._contextValue_1n89u_137{font-family:var(--font-label);font-size:12px;color:var(--text-primary);line-height:1.5}._page_1tggr_2{display:flex;flex-direction:column;gap:var(--content-gap);max-width:var(--content-max)}._limitNotice_1tggr_9{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:14px 16px;border:1px solid var(--pro-border);border-radius:var(--radius);background:linear-gradient(180deg,rgba(240,189,88,.12),transparent 58%),var(--bg-card)}._limitNoticeContent_1tggr_23{flex:1 1 260px;min-width:0}._limitNoticeTitle_1tggr_28{font-family:var(--font-label);font-size:12px;color:var(--pro-text);margin-bottom:6px}._limitNoticeText_1tggr_35{font-size:12px;color:var(--text-secondary);line-height:1.5}._primaryAction_1tggr_41{display:inline-flex;align-items:center;justify-content:center;min-height:30px;padding:6px 12px;border:1px solid var(--pro-border);border-radius:var(--radius-sm);background:var(--pro-badge);color:var(--pro-text-on-badge);font-family:var(--font-label);font-size:12px;font-weight:600;text-decoration:none;white-space:nowrap;transition:background var(--transition),border-color var(--transition)}._primaryAction_1tggr_41:hover{border-color:var(--pro-badge);background:var(--pro-bg-soft);color:var(--pro-text)}._clearButton_1tggr_67{border:1px solid var(--danger-border);background:var(--danger-bg);color:var(--danger-text);border-radius:var(--radius-sm);padding:6px 12px;font-family:var(--font-label);font-size:12px;font-weight:500;cursor:pointer;transition:background var(--transition),border-color var(--transition)}._clearButton_1tggr_67:hover{background:var(--danger-hover-bg);border-color:var(--danger)}._list_1tggr_88{display:flex;flex-direction:column;gap:10px}._empty_1tggr_95{text-align:center;padding:40px 20px;color:var(--text-muted);font-family:var(--font-label);font-size:13px}._loading_1tggr_104{text-align:center;padding:40px 20px;color:var(--text-secondary);font-family:var(--font-label);font-size:12px}._pagination_1tggr_113{display:flex;align-items:center;justify-content:center;gap:12px;margin-top:4px}._pageInfo_1tggr_121{font-family:var(--font-code);font-size:12px;color:var(--text-secondary)}._btn_1tggr_127{font-family:var(--font-label);font-size:12px;padding:4px 12px;border-radius:4px;border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;transition:background var(--transition),border-color var(--transition)}._btn_1tggr_127:hover:not(:disabled){border-color:var(--accent);background:var(--accent-dim)}._btn_1tggr_127:disabled{opacity:.4;cursor:default}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as h,r as f,j as a,g as _}from"./index-Dj2NvZgn.js";import{B as x}from"./UiPrimitive-BTuxHpyB.js";const j="_scope_1kz7c_1",m="_main_1kz7c_13",k="_label_1kz7c_20",I="_selectorLabel_1kz7c_28",w="_placeSelect_1kz7c_35",z="_name_1kz7c_48",A="_id_1kz7c_59",L="_scopeBadge_1kz7c_66",y="_copy_1kz7c_70",E="_note_1kz7c_82",n={scope:j,main:m,label:k,selectorLabel:I,placeSelect:w,name:z,id:A,scopeBadge:L,copy:y,note:E};function d(e,l){return l===null?null:e.places.find(c=>c.placeId===l)??null}function S(e){var l;return e.lastActivePlaceId!==null?e.lastActivePlaceId:((l=e.places[0])==null?void 0:l.placeId)??null}function B(e){return e.pluginConnected&&e.activePlaceId!==null?e.activePlaceId:S(e)}function U(e,l){if(e.pluginConnected&&e.activePlaceId!==null){const o=d(e,e.activePlaceId);return{label:l("placeScope.current.label","Current Place"),placeId:e.activePlaceId,placeName:e.activePlaceName??(o==null?void 0:o.placeName)??l("placeScope.unknownPlace","Unknown place"),badge:l("placeScope.live","Live"),live:!0,note:null}}const c=S(e),s=d(e,c);if(c!==null){const o=c===e.lastActivePlaceId?e.lastActivePlaceName:null;return{label:l("placeScope.lastActive.label","Last Active Place"),placeId:c,placeName:o??(s==null?void 0:s.placeName)??l("placeScope.unknownPlace","Unknown place"),badge:l("placeScope.pluginRequired","Plugin required"),live:!1,note:l("placeScope.pluginRequired.note","Connect WEPPY Plugin to confirm the live active place.")}}return{label:l("placeScope.noPlace.label","Place scope"),placeId:null,placeName:l("placeScope.noPlace.value","No place data available yet"),badge:l("placeScope.noPlace.badge","No place"),live:!1,note:l("placeScope.noPlace.note","Connect WEPPY Plugin and sync a place to create place-scoped data.")}}function q(e,l,c){const s=typeof l=="number"?d(e,l):null,o=B(e),t=(s==null?void 0:s.placeId)??o,r=d(e,t);if(t===null)return{label:c("placeScope.noPlace.label","Place scope"),placeId:null,placeName:c("placeScope.noPlace.value","No place data available yet"),badge:c("placeScope.noPlace.badge","No place"),live:!1,note:c("placeScope.noPlace.note","Connect WEPPY Plugin and sync a place to create place-scoped data.")};const u=e.pluginConnected&&e.activePlaceId===t,b=t===e.lastActivePlaceId?e.lastActivePlaceName:null;return{label:u?c("placeScope.current.label","Current Place"):c("placeScope.selected.label","Selected Place"),placeId:t,placeName:(r==null?void 0:r.placeName)??b??c("placeScope.unknownPlace","Unknown place"),badge:u?c("placeScope.live","Live"):c("placeScope.stored","Stored"),live:u,note:u?null:c("placeScope.selected.note","Showing stored data only. Studio routing is unchanged.")}}function F(e,l){switch(e){case"sync":return l("placeScope.surface.sync","Sync status and logs use this place.");case"changelog":return l("placeScope.surface.changelog","Changelog sessions use this place.");case"playtest":return l("placeScope.surface.playtest","Playtest reports use this place.");case"uiStudio":return l("placeScope.surface.uiStudio","UI captures and change history use this place.");case"tools":return l("placeScope.surface.tools","Tool history and statistics use this place.")}}function W({surface:e,selectable:l=!1,selectedPlaceId:c=null,onSelectedPlaceIdChange:s}){const{t:o}=h(),[t,r]=f.useState(null),[u,b]=f.useState(!0);if(f.useEffect(()=>{let i=!1;async function v(){try{const g=await _();i||r(g)}catch{i||r(null)}finally{i||b(!1)}}return v(),()=>{i=!0}},[]),f.useEffect(()=>{!l||!t||typeof c!="number"||d(t,c)||s==null||s(null)},[s,l,c,t]),u)return a.jsx("div",{className:n.scope,"aria-live":"polite",children:a.jsx("span",{className:n.label,children:o("placeScope.loading","Loading place scope...")})});if(!t)return a.jsx("div",{className:n.scope,"aria-live":"polite",children:a.jsx("span",{className:n.label,children:o("placeScope.unavailable","Place scope unavailable")})});const p=l?q(t,c,o):U(t,o),N=typeof p.placeId=="number"?String(p.placeId):"",P=l&&t.places.length>0;return a.jsxs("div",{className:n.scope,"aria-live":"polite",children:[a.jsxs("div",{className:n.main,children:[P?a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:n.selectorLabel,children:[a.jsx("span",{className:n.label,children:o("placeScope.selector.label","Place data")}),a.jsx("select",{className:n.placeSelect,value:N,onChange:i=>{const v=Number.parseInt(i.currentTarget.value,10);s==null||s(Number.isInteger(v)?v:null)},children:t.places.map(i=>a.jsxs("option",{value:i.placeId,children:[i.placeName," (",i.placeId,")"]},i.placeId))})]}),a.jsx("span",{className:n.label,children:p.label}),a.jsx("span",{className:n.name,children:p.placeName})]}):a.jsxs(a.Fragment,{children:[a.jsx("span",{className:n.label,children:p.label}),a.jsx("span",{className:n.name,children:p.placeName})]}),p.placeId!==null?a.jsx("span",{className:n.id,children:p.placeId}):null,a.jsx(x,{variant:p.live?"success":"warning",shape:"pill",className:n.scopeBadge,children:p.badge})]}),a.jsxs("div",{className:n.copy,children:[a.jsx("span",{children:F(e,o)}),p.note?a.jsx("span",{className:n.note,children:p.note}):null]})]})}export{W as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t,u as R,r as v,f as L,h as F,a as M,D as V}from"./index-Dj2NvZgn.js";import{I as A}from"./InfoLabel-CI6bHOeU.js";import{P as U}from"./PageHeader-CDCcXu8v.js";import{S as z}from"./StatusBadge-PkthVJ8-.js";import{T as O}from"./TooltipText-d7cAgyJE.js";import{G as X}from"./GameChangeDetail-AUqSoK_K.js";import{u as q,f as J}from"./useLiveUptime-BH4xRx9-.js";import"./UiPrimitive-BTuxHpyB.js";const K="_page_1xgxh_2",Q="_card_1xgxh_10",W="_cardHeader_1xgxh_17",Y="_disconnectCard_1xgxh_28",Z="_disconnectIcon_1xgxh_36",ee="_disconnectTitle_1xgxh_41",te="_disconnectMessage_1xgxh_48",se="_reconnectGuide_1xgxh_55",ne="_guideStep_1xgxh_64",ie="_stepNumber_1xgxh_72",ce="_reconnectIndicator_1xgxh_88",re="_reconnectDot_1xgxh_98",ae="_pulse_1xgxh_1",oe="_disconnectActions_1xgxh_112",le="_btn_1xgxh_118",de="_btnSecondary_1xgxh_134",me="_metricRow_1xgxh_152",ge="_metricGrid_1xgxh_158",he="_metricCard_1xgxh_164",xe="_metric_ok_1xgxh_174",ue="_metric_warn_1xgxh_179",ve="_metric_error_1xgxh_184",_e="_metricHeader_1xgxh_189",pe="_metricIcon_1xgxh_200",fe="_metricTitle_1xgxh_204",Ce="_metricValue_1xgxh_208",je="_metricSubtitle_1xgxh_215",we="_guideCard_1xgxh_225",Ne="_guideTitle_1xgxh_232",ye="_checklist_1xgxh_239",Te="_feedEmpty_1xgxh_263",Se="_feedList_1xgxh_270",Ie="_feedItem_1xgxh_278",be="_feedTime_1xgxh_291",ke="_feedIcon_1xgxh_298",Me="_feedSummary_1xgxh_304",De="_feedText_1xgxh_313",Be="_feedContext_1xgxh_321",He="_feedItemClickable_1xgxh_330",Ee="_feedChevron_1xgxh_338",Pe="_feedDetail_1xgxh_347",$e="_feedDetailPre_1xgxh_356",Re="_feedDetailText_1xgxh_365",Ge="_changelogSummary_1xgxh_372",Le="_changeTag_1xgxh_381",Fe="_tierBar_1xgxh_393",Ve="_tierBarTrack_1xgxh_399",Ae="_tierBarFillBasic_1xgxh_407",Ue="_tierBarFillPro_1xgxh_412",ze="_tierLabels_1xgxh_417",s={page:K,card:Q,cardHeader:W,disconnectCard:Y,disconnectIcon:Z,disconnectTitle:ee,disconnectMessage:te,reconnectGuide:se,guideStep:ne,stepNumber:ie,reconnectIndicator:ce,reconnectDot:re,pulse:ae,disconnectActions:oe,btn:le,btnSecondary:de,metricRow:me,metricGrid:ge,metricCard:he,metric_ok:xe,metric_warn:ue,metric_error:ve,metricHeader:_e,metricIcon:pe,metricTitle:fe,metricValue:Ce,metricSubtitle:je,guideCard:we,guideTitle:Ne,checklist:ye,feedEmpty:Te,feedList:Se,feedItem:Ie,feedTime:be,feedIcon:ke,feedSummary:Me,feedText:De,feedContext:Be,feedItemClickable:He,feedChevron:Ee,feedDetail:Pe,feedDetailPre:$e,feedDetailText:Re,changelogSummary:Ge,changeTag:Le,tierBar:Fe,tierBarTrack:Ve,tierBarFillBasic:Ae,tierBarFillPro:Ue,tierLabels:ze};function N({title:e,value:i,icon:c,subtitle:r,status:a,children:n}){const l=a?s[`metric_${a}`]:"";return t.jsxs("div",{className:`${s.metricCard} ${l}`,children:[t.jsxs("div",{className:s.metricHeader,children:[c&&t.jsx("span",{className:s.metricIcon,children:c}),t.jsx("span",{className:s.metricTitle,children:e})]}),t.jsx("div",{className:s.metricValue,children:i}),r&&t.jsx("div",{className:s.metricSubtitle,children:r}),n]})}function Oe(e){var c,r;const i=e==null?void 0:e.contextSummary;return(i==null?void 0:i.intent)??((r=(c=i==null?void 0:i.affectedAreas)==null?void 0:c[0])==null?void 0:r.label)??(i==null?void 0:i.testScenario)??null}function H({changes:e}){const{t:i}=R(),[c,r]=v.useState(null);return e.length===0?t.jsx("div",{className:s.feedEmpty,children:i("overview.feed.empty")}):t.jsx("div",{className:s.feedList,children:e.map((a,n)=>{const l=c===n,m=a.raw,g=m&&(m.before!=null||m.after!=null||m.details!=null),_=Oe(m);return t.jsxs("div",{children:[t.jsxs("div",{className:`${s.feedItem} ${g?s.feedItemClickable:""}`,onClick:()=>g&&r(l?null:n),children:[t.jsx("span",{className:s.feedTime,children:a.timestamp}),t.jsx("span",{className:s.feedIcon,children:a.icon}),t.jsxs("span",{className:s.feedText,children:[t.jsx("span",{className:s.feedSummary,children:a.summary}),_&&t.jsx("span",{className:s.feedContext,children:_})]}),g&&t.jsx("span",{className:s.feedChevron,children:l?"▴":"▾"})]}),l&&m&&t.jsx("div",{className:s.feedDetail,children:t.jsx(X,{change:m})})]},n)})})}const E=20;function G(e){return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}function P(){return G(new Date)}function $(e){switch(e){case"script":return"📝";case"instance":return"🧱";case"property":return"🎨";case"lighting":return"💡";case"terrain":return"⛰️";case"asset":return"📦";default:return"🔧"}}function Xe(){const{level:e,status:i}=L(),c=F(),[r,a]=v.useState(null),[n,l]=v.useState(null),[m,g]=v.useState(null),[_,h]=v.useState([]),y=v.useRef(null),T=v.useCallback(async()=>{try{const o=await M.get("/connection-info");a(o)}catch{a(null)}},[]),S=v.useCallback(async()=>{try{const o=await M.get("/api/dashboard/changelog/active");if(g(o),o.recentChanges&&o.recentChanges.length>0){const p=o.recentChanges.map(x=>({timestamp:x.timestamp?G(new Date(x.timestamp)):P(),icon:$(x.category),summary:x.summary,category:x.category,raw:x}));h(p)}}catch{g(null)}},[]),f=v.useCallback(async()=>{try{const o=await M.get("/sync/status");l(o)}catch{l(null)}},[]);return v.useEffect(()=>{e!=="disconnected"?(T(),S(),f()):(a(null),l(null),g(null));const o=new V;y.current=o,o.connect();const p=o.on("game_change",C=>{const u=C,j={timestamp:P(),icon:$(u.category),summary:u.summary,category:u.category};h(k=>{const w=[j,...k];return w.length>E?w.slice(0,E):w}),S()}),x=o.on("sync",C=>{const u=C;l(j=>({...j,state:u.status,...u.placeId?{placeId:u.placeId}:{}}))});return()=>{p(),x(),o.disconnect(),y.current=null}},[e,T,S,f]),{level:e,status:i,connectionInfo:r,syncStatus:n,changeSummary:m,recentChanges:_,tier:c}}function D(e){return e.scriptsModified+e.scriptsCreated+e.instancesCreated+e.instancesDeleted+e.instancesMoved+e.propertiesChanged+e.assetsInserted+(e.lightingChanged?1:0)+(e.terrainChanged?1:0)}function qe(e,i){switch(e){case"syncing":return i("status.syncing","Syncing");case"initializing":return i("status.initializing","Initializing");case"error":return i("status.error","Error");default:return i("status.idle","Idle")}}function Je(e){switch(e){case"syncing":return"ok";case"initializing":return"warn";case"error":return"error";default:return"ok"}}function b(e,i,c,r){return t.jsxs("div",{className:e.metricSubtitle,children:[t.jsx(A,{label:i,tooltip:c}),": ",r]},i)}function d(e,i){return t.jsx(O,{text:i,children:e})}function nt(){var w,B;const{t:e}=R(),{level:i,status:c,connectionInfo:r,syncStatus:a,changeSummary:n,recentChanges:l}=Xe(),m=q(c==null?void 0:c.uptime),g=t.jsx(U,{title:e("page.overview.title","Overview"),description:e("page.overview.description","Check server, plugin, agent, sync, and recent game-change status in one place."),helpTopicId:"overview",helpState:{connectionLevel:i}});if(i==="disconnected")return t.jsxs("div",{className:s.page,children:[g,t.jsxs("div",{className:s.disconnectCard,children:[t.jsx("div",{className:s.disconnectIcon,children:"⚠️"}),t.jsx("h2",{className:s.disconnectTitle,children:e("overview.l0.title")}),t.jsx("p",{className:s.disconnectMessage,children:e("overview.l0.message")}),t.jsxs("div",{className:s.reconnectGuide,children:[t.jsxs("div",{className:s.guideStep,children:[t.jsx("span",{className:s.stepNumber,children:"1"}),t.jsx("span",{children:e("overview.l0.step1")})]}),t.jsxs("div",{className:s.guideStep,children:[t.jsx("span",{className:s.stepNumber,children:"2"}),t.jsx("span",{children:e("overview.l0.step2")})]})]}),t.jsxs("div",{className:s.reconnectIndicator,children:[t.jsx("span",{className:s.reconnectDot}),e("overview.l0.reconnecting")]}),t.jsxs("div",{className:s.disconnectActions,children:[t.jsx("button",{className:s.btn,onClick:()=>window.location.reload(),children:e("overview.l0.reconnectBtn")}),t.jsx("button",{className:s.btnSecondary,onClick:()=>{window.location.hash="#/settings"},children:e("overview.l0.settingsBtn")})]})]})]});const _=(r==null?void 0:r.mcpInstanceCount)??0,h=((w=r==null?void 0:r.mcpInstances)==null?void 0:w.find(I=>!I.isServer&&I.aiClientName))??((B=r==null?void 0:r.mcpInstances)==null?void 0:B.find(I=>!!I.aiClientName))??null,y=(c==null?void 0:c.pluginClients)??[],T=y.length>0,S=(c==null?void 0:c.sessionId)??(r==null?void 0:r.sessionId)??"-",f=e("overview.metric.server.tooltip","MCP server runtime and process status"),o=e("overview.metric.plugin.tooltip","Roblox Studio plugin connection and version status"),p=e("overview.metric.agent.tooltip","Connected AI coding agents and their runtime state"),x=e("overview.metric.sync.tooltip","Current Studio to local sync activity"),C=c?[b(s,e("overview.meta.version","Version"),e("overview.meta.version.tooltip","Installed MCP server version"),`v${c.version}`),b(s,e("overview.meta.session","Session"),e("overview.meta.session.tooltip","Current MCP session identifier"),S),b(s,e("overview.meta.pid","PID"),e("overview.meta.pid.tooltip","Operating system process identifier"),String(c.pid??"-")),b(s,e("overview.meta.uptime","Uptime"),e("overview.meta.uptime.tooltip","Time elapsed since the MCP server started"),J(m??c.uptime))]:[];if(i==="serverOnly")return t.jsxs("div",{className:s.page,children:[g,t.jsxs("div",{className:s.metricRow,children:[t.jsx(N,{title:d(e("overview.metric.server"),f),value:d(e("status.online"),f),icon:"🖥️",status:"ok",children:t.jsxs(t.Fragment,{children:[C,t.jsx(z,{status:"online"})]})}),t.jsx(N,{title:d(e("overview.metric.agent"),p),value:d((h==null?void 0:h.aiClientName)??e("overview.metric.noAgent"),p),icon:"🤖",subtitle:_>1?`${_} ${e("overview.metric.agent.instancesUnit","instances")}`:void 0,status:h?"ok":"warn"})]}),t.jsxs("div",{className:s.guideCard,children:[t.jsx("h3",{className:s.guideTitle,children:e("overview.l1.pluginGuide")}),t.jsxs("ul",{className:s.checklist,children:[t.jsx("li",{children:e("overview.l1.check1")}),t.jsx("li",{children:e("overview.l1.check2")})]})]}),t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.feed.title")}),l.length>0?t.jsx(H,{changes:l}):t.jsx("div",{className:s.feedEmpty,children:e("overview.l1.feedHint")})]}),n&&D(n)>0&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.changelog.title")}),t.jsxs("div",{className:s.changelogSummary,children:[t.jsxs("span",{children:[e("overview.changelog.entries","Entries"),": ",D(n)]}),n.scriptsModified>0&&t.jsxs("span",{className:s.changeTag,children:["📝"," ",n.scriptsModified," ",e("overview.changelog.scripts")]}),n.instancesCreated>0&&t.jsxs("span",{className:s.changeTag,children:["🧱"," ",n.instancesCreated," ",e("overview.changelog.instances")]}),n.propertiesChanged>0&&t.jsxs("span",{className:s.changeTag,children:["🎨"," ",n.propertiesChanged," ",e("overview.changelog.properties")]}),n.assetsInserted>0&&t.jsxs("span",{className:s.changeTag,children:["📦"," ",n.assetsInserted," ",e("overview.changelog.assets")]})]})]})]});const u=y[0],j=n?D(n):0,k=!!n&&j>0;return t.jsxs("div",{className:s.page,children:[g,t.jsxs("div",{className:s.metricGrid,children:[t.jsx(N,{title:d(e("overview.metric.server"),f),value:d(e("status.online"),f),icon:"🖥️",status:"ok",children:t.jsx(t.Fragment,{children:C})}),t.jsx(N,{title:d(e("overview.metric.plugin"),o),value:d(e(T?"status.online":"status.offline"),o),icon:"🔌",subtitle:u?`${u.placeName??"-"} / v${u.pluginVersion??"-"}`:void 0,status:T?"ok":"error"}),t.jsx(N,{title:d(e("overview.metric.agent"),p),value:d((h==null?void 0:h.aiClientName)??e("overview.metric.noAgent"),p),icon:"🤖",subtitle:_>1?`${_} ${e("overview.metric.agent.instancesUnit","instances")}`:void 0,status:h?"ok":"warn"}),t.jsx(N,{title:d(e("overview.metric.sync"),x),value:d(qe(a==null?void 0:a.state,e),x),icon:"🔄",status:Je(a==null?void 0:a.state)})]}),t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.feed.title")}),t.jsx(H,{changes:l})]}),k&&t.jsxs("div",{className:s.card,children:[t.jsx("div",{className:s.cardHeader,children:e("overview.changelog.title")}),t.jsxs("div",{className:s.changelogSummary,children:[t.jsxs("span",{children:[e("overview.changelog.entries","Entries"),": ",j]}),n.scriptsModified>0&&t.jsxs("span",{className:s.changeTag,children:["📝"," ",n.scriptsModified," ",e("overview.changelog.scripts")]}),n.instancesCreated>0&&t.jsxs("span",{className:s.changeTag,children:["🧱"," ",n.instancesCreated," ",e("overview.changelog.instances")]}),n.propertiesChanged>0&&t.jsxs("span",{className:s.changeTag,children:["🎨"," ",n.propertiesChanged," ",e("overview.changelog.properties")]}),n.assetsInserted>0&&t.jsxs("span",{className:s.changeTag,children:["📦"," ",n.assetsInserted," ",e("overview.changelog.assets")]})]})]})]})}export{nt as Component};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{i as te,u as oe,e as ne,r as p,j as t,X as se,E as ae,k as re,v as ie}from"./index-Dj2NvZgn.js";import{I as X,a as le}from"./UiPrimitive-BTuxHpyB.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 ce=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],z=te("circle-question-mark",ce),O={"studio.mesh_image_apis":{action:'In Studio, open File → Experience Settings → Security and enable "Allow Mesh / Image APIs".'},"open_cloud.api_key":{action:"In Roblox Creator Hub, create an API key, add Assets under Access Permissions, enable both Read and Write, then save and test the key in WEPPY Assets settings.",docsUrl:"https://create.roblox.com/docs/cloud/auth/api-keys"},"open_cloud.assets":{docsUrl:"https://create.roblox.com/docs/cloud/guides/usage-assets"}},n={canDo:{key:"dashboardHelp.section.canDo",fallback:"What you can do here"},howItWorks:{key:"dashboardHelp.section.howItWorks",fallback:"How it works"},needs:{key:"dashboardHelp.section.needs",fallback:"What you need to use it"},currentState:{key:"dashboardHelp.section.currentState",fallback:"Check based on current status"}},de=O["studio.mesh_image_apis"],Q=O["open_cloud.api_key"],ue=O["open_cloud.assets"],pe=Q.docsUrl,he=ue.docsUrl,fe="https://create.roblox.com/docs/cloud/reference/features/assets",ge="https://create.roblox.com/docs/reference/engine/classes/DataModel#CreatorId",ye="https://create.roblox.com/docs/reference/engine/classes/Player#UserId",be="https://create.roblox.com/docs/projects/groups",me="https://create.roblox.com/docs/cloud/reference/features/groups";function g(e,a,s,h){return{id:e,title:{key:`dashboardHelp.${e}.title`,fallback:a},sections:s,links:h}}function i(e,a,s,h){return{heading:e,items:h.map((y,P)=>({key:`dashboardHelp.${a}.${s}.${P+1}`,fallback:y}))}}function r(e,a,s){return{heading:n.currentState,items:[{key:`dashboardHelp.${e}.currentState.${a}`,fallback:s}]}}function v(e,a,s,h,y,P){return g(e,a,[i(n.canDo,e,"canDo",s),i(n.needs,e,"needs",h),i(n.currentState,e,"currentState",y)],P)}function ke(e){return e.tier==="basic"?r("assets","basic","Activate Pro before uploading to Roblox."):e.uploadEnabled===!1?r("assets","uploadDisabled","Turn on API Key local upload in Assets settings."):e.hasOpenCloudCredential===!1?r("assets","noCredential","Save and test an Open Cloud API Key."):e.hasDefaultCreator===!1?r("assets","noCreator","Save a default Creator ID or enter Creator details during upload."):r("assets","default","Open an asset detail dialog to start upload or usage scan.")}function ve(e){return e.connectionLevel!==void 0&&e.connectionLevel!=="studioConnected"?r("sync","pluginMissing","Connect WEPPY Plugin in Studio before using live sync details."):e.tier==="basic"?r("sync","basic","Activate Pro to use bidirectional or reverse sync."):r("sync","default","Use the sync log to diagnose stuck or failed sync activity.")}function Pe(e,a={}){return e==="studioRouting"?{id:e,title:{key:"controls.studioRouting.helpLabel",fallback:"How Studio routing works"},sections:[{heading:n.canDo,items:[{key:"controls.studioRouting.priorityDescription",fallback:"Explicit Studio ID, Connection ID, or Place ID requests bypass this priority setting and route to the named Studio."}]},{heading:n.howItWorks,items:[{key:"controls.studioRouting.help.auto",fallback:"Automatic uses the highest-priority active Studio, based on recent routed commands and connection order."},{key:"controls.studioRouting.help.pinned",fallback:"Studio fixed uses the selected Studio unless the request names a Studio ID, Connection ID, or Place ID."}]}]}:e==="luauValidation"?{id:e,title:{key:"controls.luauValidation.helpLabel",fallback:"How Luau syntax validation works"},sections:[{heading:n.canDo,items:[{key:"controls.luauValidation.benefit",fallback:"After AI edits a Script, check for Luau syntax errors."}]},{heading:n.howItWorks,items:[{key:"controls.luauValidation.help.behavior",fallback:"When On, after AI finishes replacing, editing, inserting, or deleting Script lines, WEPPY checks the full code that was actually saved. When Off, the Script is edited without an automatic syntax check."},{key:"controls.luauValidation.help.response",fallback:"A clean Script keeps the usual short completion response. WEPPY gives details only when it finds an error or cannot complete the check. Large Scripts may take a little longer."},{key:"controls.luauValidation.help.nonBlocking",fallback:"If WEPPY finds a syntax error or cannot complete the check, the saved Script change is not undone. The result helps the AI fix the same Script right away."},{key:"controls.luauValidation.priority",fallback:"If an AI request differs from this setting, the Dashboard setting is used. Turn it on or off here to change how Script edits are checked."}]}]}:e==="openCloudApiKey"?g(e,"Open Cloud API Key help",[i(n.canDo,e,"canDo",["WEPPY uses this key only for Roblox Open Cloud requests."]),i(n.needs,e,"needs",[Q.action,"Set the key target to the same User or Group that you use as the upload Creator.","The raw key is encrypted on this device. It is not sent to WEPPY servers, and it is not stored in any other external storage, browser storage, telemetry, logs, tool history, or Asset Library metadata."]),a.hasOpenCloudCredential?r(e,"saved","Use Test Connection to confirm the saved key still works."):r(e,"empty","Create an API key in Roblox Creator Hub, paste it here, then save and test it.")],[{label:{key:"dashboardHelp.openCloudApiKey.link.apiKeys",fallback:"Roblox API keys"},href:pe},{label:{key:"dashboardHelp.openCloudApiKey.link.assetsGuide",fallback:"Assets API usage guide"},href:he},{label:{key:"dashboardHelp.openCloudApiKey.link.assetsReference",fallback:"Assets API reference"},href:fe}]):e==="openCloudCreatorId"?g(e,"Creator ID help",[i(n.canDo,e,"canDo",["The default Creator decides which User or Group owns newly uploaded Roblox assets."]),i(n.needs,e,"needs",["For User, sign in to roblox.com, open your profile from your avatar or username, then copy only the number between /users/ and /profile in the browser URL.","For Group, open the Roblox group or community page, then copy only the number after /groups/ or /communities/ in the browser URL.","Paste only the numeric ID in Creator ID. Do not paste the full URL, rbxassetid://, User, or Group text."]),a.hasDefaultCreator?r(e,"saved","Keep this value if new assets should continue using the same owner."):r(e,"empty","Choose User or Group, paste the numeric ID, then save the default Creator.")],[{label:{key:"dashboardHelp.openCloudCreatorId.link.creatorId",fallback:"Creator ID reference"},href:ge},{label:{key:"dashboardHelp.openCloudCreatorId.link.userId",fallback:"User ID reference"},href:ye},{label:{key:"dashboardHelp.openCloudCreatorId.link.groups",fallback:"Roblox groups"},href:be},{label:{key:"dashboardHelp.openCloudCreatorId.link.groupsApi",fallback:"Groups Cloud API"},href:me}]):{overview:g("overview","Overview help",[i(n.canDo,"overview","canDo",["Check MCP server, WEPPY Plugin, AI Agent, Sync, and recent game changes in one place."]),i(n.needs,"overview","needs",["Useful status requires the MCP server. Live Studio status also needs WEPPY Plugin connected to the active place."]),a.connectionLevel==="serverOnly"?r("overview","serverOnly","Open Roblox Studio and start WEPPY Plugin so live place data can appear."):r("overview","default","If the server disconnects, restart MCP or wait for the automatic reconnect.")]),connection:v("connection","Connection help",["Inspect server process details, connected AI agents, Studio plugin clients, and connection log events."],["The MCP server must be reachable. Plugin rows appear after Studio sends heartbeats."],["If Plugin is missing, open Roblox Studio and run WEPPY Plugin. If AI Agent is missing, reconnect the MCP server from your AI tool."]),sync:g("sync","Sync help",[i(n.canDo,"sync","canDo",["Review Studio to local sync status, direction, apply mode, and sync logs."]),i(n.needs,"sync","needs",["Sync needs an active place and connected WEPPY Plugin. Two-way and reverse workflows depend on Pro."]),ve(a)]),assets:g("assets","Assets help",[i(n.canDo,"assets","canDo",["Browse local Asset Library files, switch place/shared scope, filter categories, scan usage, insert RBXM into Studio, and upload local assets to Roblox."]),i(n.needs,"assets","needs",["Upload needs Pro, the Open Cloud upload toggle, a valid API Key, and a Creator. Browse and preview work on Basic."]),ke(a)]),changelog:v("changelog","Changelog help",["Review real game-change sessions extracted from AI actions and sync events."],["Entries are scoped to the active place. Basic shows only the latest preview entries."],["If the list is empty, ask the AI Agent to make a game change. Clear only deletes saved history records, not Studio objects."]),playtest:g("playtest","Playtest help",[i(n.canDo,"playtest","canDo",["Review structured Playtest evidence for UI, input, and server results saved by the AI Agent."]),i(n.needs,"playtest","needs",["Pro shows real stored reports. Basic shows one sample. Play screenshot evidence is unavailable; semantic UI and interaction evidence remain available. Live active-place confidence needs WEPPY Plugin connected."]),a.tier==="basic"?r("playtest","basic","Activate Pro to use real Playtest history."):r("playtest","default","Ask the AI Agent to run a Playtest when no report is available.")]),uiStudio:g("uiStudio","UI Studio help",[i(n.canDo,"uiStudio","canDo",["Review AI-created UI analysis, improvement suggestions, captures, and before/after history."]),i(n.needs,"uiStudio","needs",["Pro shows real UI Studio data. Basic shows a bundled sample. New capture/check actions need WEPPY Plugin connected."]),a.tier==="basic"?r("uiStudio","basic","Activate Pro to use live UI Studio previews."):r("uiStudio","default","Ask the AI Agent to capture the UI or recheck improvement suggestions, then copy follow-up requests back to the AI chat.")]),tools:v("tools","Tools help",["Inspect tool history, status classification, fallback/unsupported/warn/error details, and usage statistics."],["History and statistics depend on local recording settings and the active place bucket."],["If no records appear, check Controls > General Settings and confirm history/statistics are enabled. Expand failed rows to inspect input, permission, or connection causes."]),controls:v("controls","Controls help",["Manage Project Root, Studio routing, and MCP hot settings."],["Project Root and Studio Routing need MCP server connection. Hot settings need a server response. Asset upload controls live in Assets settings."],["Use Project Root only when MCP should write sync data under a different project folder. Use Studio Routing only for requests where the agent does not name Studio ID, Connection ID, or Place ID."]),settings:v("settings","Settings help",["Manage License, saved data cleanup, server environment display, and language."],["License actions need MCP server connection. Server environment values are read-only here. Asset upload controls live in Assets settings.",de.action],["Activate a license for Pro features. Change environment values outside WEPPY Dashboard, then restart MCP. Review delete confirmations before clearing saved data."]),whatsNew:v("whatsNew","What's New help",["Review WEPPY Dashboard, MCP, and Plugin announcements, releases, and change notes."],["Announcements are bundled locally. Unread state is stored in this browser."],["After you visit this page, unread announcements from this visit are marked read when you leave. The top header does not show a duplicate What's New button on this page."])}[e]}const _e="_root_15e9p_1",we="_rootPage_15e9p_7",Ie="_rootField_15e9p_11",Ce="_helpButton_15e9p_15",Se="_panel_15e9p_19",Ae="_panelField_15e9p_34",Ee="_panelPage_15e9p_38",xe="_panelHeader_15e9p_42",Re="_closeButton_15e9p_60",De="_sectionStack_15e9p_64",Le="_helpSection_15e9p_69",He="_linkList_15e9p_70",c={root:_e,rootPage:we,rootField:Ie,helpButton:Ce,panel:Se,panelField:Ae,panelPage:Ee,panelHeader:xe,closeButton:Re,sectionStack:De,helpSection:Le,linkList:He},b=12,E=8,Ue=120,je=360,Oe=340,V=560;function Ne({topicId:e,state:a,variant:s="page",className:h,tooltip:y,triggerClassName:P}){const{t:f}=oe(),{trackEvent:N}=ne(),[d,_]=p.useState(!1),[C,M]=p.useState(null),R=p.useId(),B=p.useRef(null),D=p.useRef(null),L=p.useRef(null),m=Pe(e,a),S=f(m.title.key,m.title.fallback),A=p.useCallback(()=>{const o=D.current,l=L.current;if(!o||!l||typeof window>"u")return;const u=o.getBoundingClientRect(),k=l.getBoundingClientRect(),w=window.innerWidth,I=window.innerHeight,Z=s==="field"?Oe:je,G=k.width||Math.min(Z,w-b*2),F=k.height||V;let H=s==="field"?u.left:u.right-G;H=Math.max(b,Math.min(H,w-G-b));const U=I-u.bottom-E-b,Y=u.top-E-b,K=U<Math.min(F,220)&&Y>U,ee=Math.max(Ue,K?Y:U),q=Math.min(V,ee),$=Math.min(F,q);let j=K?u.top-E-$:u.bottom+E;j=Math.max(b,Math.min(j,I-$-b)),M({top:Math.round(j),left:Math.round(H),maxHeight:Math.round(q)})},[s]);p.useLayoutEffect(()=>{d?A():M(null)},[d,A]),p.useEffect(()=>{if(!d)return;const o=u=>{var w,I;const k=u.target;k&&!((w=B.current)!=null&&w.contains(k))&&!((I=L.current)!=null&&I.contains(k))&&_(!1)},l=u=>{u.key==="Escape"&&_(!1)};return document.addEventListener("mousedown",o),document.addEventListener("keydown",l),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",l)}},[d]),p.useEffect(()=>{if(!d)return;const o=()=>A();return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[d,A]);const W=s==="field"?f("dashboardHelp.fieldButton.ariaLabel","Open field help"):f("dashboardHelp.pageButton.ariaLabel","Open page help"),J=C?{top:C.top,left:C.left,maxHeight:C.maxHeight}:{top:-9999,left:-9999,visibility:"hidden"},T=d?t.jsxs("section",{ref:L,id:R,className:[c.panel,s==="field"?c.panelField:c.panelPage].filter(Boolean).join(" "),style:J,role:"dialog","aria-label":S,"data-panel-placement":"help-portal",children:[t.jsxs("div",{className:c.panelHeader,children:[t.jsx("h2",{children:S}),t.jsx(X,{type:"button",size:"sm",className:c.closeButton,"aria-label":f("common.close","Close"),onClick:()=>_(!1),children:t.jsx(se,{size:15,"aria-hidden":"true"})})]}),t.jsx("div",{className:c.sectionStack,children:m.sections.map(o=>t.jsxs("section",{className:c.helpSection,children:[t.jsx("h3",{children:f(o.heading.key,o.heading.fallback)}),t.jsx("ul",{children:o.items.map(l=>t.jsx("li",{children:f(l.key,l.fallback)},l.key))})]},o.heading.key))}),m.links&&m.links.length>0&&t.jsxs("div",{className:c.linkList,children:[t.jsx("h3",{children:f("dashboardHelp.section.links","Related links")}),m.links.map(o=>t.jsxs("a",{href:o.href,target:"_blank",rel:"noreferrer",children:[f(o.label.key,o.label.fallback),t.jsx(ae,{size:12,"aria-hidden":"true"})]},o.href))]})]}):null;return t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:B,className:[c.root,s==="field"?c.rootField:c.rootPage,h??""].filter(Boolean).join(" "),children:s==="field"?t.jsx(re,{text:y??"",disabled:d,children:t.jsx(X,{ref:D,type:"button",size:"sm",className:[c.helpButton,P??""].filter(Boolean).join(" "),"aria-label":`${W}: ${S}`,"aria-expanded":d,"aria-controls":R,onClick:()=>{_(o=>{const l=!o;return o||N("dashboard_click_event",{click_target:"dashboard_help_open",help_topic:e,placement:s}),l})},children:t.jsx(z,{size:14,"aria-hidden":"true"})})}):t.jsxs(le,{ref:D,type:"button",variant:"secondary",size:"sm",className:c.helpButton,"aria-label":`${W}: ${S}`,"aria-expanded":d,"aria-controls":R,onClick:()=>{_(o=>{const l=!o;return o||N("dashboard_click_event",{click_target:"dashboard_help_open",help_topic:e,placement:s}),l})},children:[t.jsx(z,{size:16,"aria-hidden":"true"}),t.jsx("span",{children:f("dashboardHelp.button","Help")})]})}),T&&typeof document<"u"?ie.createPortal(T,document.body):null]})}const Me="_pageHeader_qym7v_1",Be="_copy_qym7v_9",We="_titleLine_qym7v_16",Te="_actions_qym7v_39",x={pageHeader:Me,copy:Be,titleLine:We,actions:Te};function Ye({title:e,description:a,badge:s,helpTopicId:h,helpState:y}){return t.jsxs("div",{className:x.pageHeader,children:[t.jsxs("div",{className:x.copy,children:[t.jsxs("div",{className:x.titleLine,children:[t.jsx("h1",{children:e}),s]}),t.jsx("p",{children:a})]}),t.jsx("div",{className:x.actions,children:t.jsx(Ne,{topicId:h,state:y})})]})}export{Ne as D,Ye as P,O as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
._root_15e9p_1{position:relative;display:inline-flex;align-items:center}._rootPage_15e9p_7{margin-left:4px}._rootField_15e9p_11{margin-left:2px}._helpButton_15e9p_15{flex:0 0 auto}._panel_15e9p_19{position:fixed;z-index:1200;box-sizing:border-box;width:min(360px,calc(100vw - 24px));max-height:min(560px,calc(100vh - 24px));overflow:auto;border:1px solid var(--border);border-radius:8px;background:var(--bg-card);box-shadow:0 18px 46px #00000047;padding:14px;text-align:left}._panelField_15e9p_34{width:min(340px,calc(100vw - 24px))}._panelPage_15e9p_38{width:min(360px,calc(100vw - 24px))}._panelHeader_15e9p_42{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}._panelHeader_15e9p_42 h2{margin:0;color:var(--text-primary);font-family:var(--font-label);font-size:14px;line-height:1.3;letter-spacing:0;text-transform:none}._closeButton_15e9p_60{flex:0 0 auto}._sectionStack_15e9p_64{display:grid;gap:12px}._helpSection_15e9p_69 h3,._linkList_15e9p_70 h3{margin:0 0 6px;color:var(--text-primary);font-family:var(--font-label);font-size:12px;letter-spacing:0;text-transform:none}._helpSection_15e9p_69 ul{margin:0;padding-left:18px;color:var(--text-secondary);font-size:12px;line-height:1.45}._helpSection_15e9p_69 li+li{margin-top:4px}._linkList_15e9p_70{display:grid;gap:6px;margin-top:14px;padding-top:12px;border-top:1px solid var(--border)}._linkList_15e9p_70 a{display:inline-flex;align-items:center;gap:6px;color:var(--accent);font-size:12px;text-decoration:none}._linkList_15e9p_70 a:hover,._linkList_15e9p_70 a:focus-visible{text-decoration:underline;outline:none}._pageHeader_qym7v_1{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;min-width:0}._copy_qym7v_9{display:flex;flex-direction:column;gap:5px;min-width:0}._titleLine_qym7v_16{display:flex;align-items:center;gap:8px;min-width:0;flex-wrap:wrap}._titleLine_qym7v_16 h1{margin:0;color:var(--text-primary);font-size:22px;font-weight:700;letter-spacing:0}._copy_qym7v_9 p{margin:0;color:var(--text-secondary);font-size:13px;line-height:1.45}._actions_qym7v_39{display:flex;align-items:center;justify-content:flex-end;flex:0 0 auto}@media(max-width:640px){._pageHeader_qym7v_1{gap:12px}._copy_qym7v_9 p{font-size:12px}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as X,e as le,r,j as e,a as U,g as me,d as ye,T as je,A as xe,S as fe}from"./index-Dj2NvZgn.js";import{P as be}from"./PageHeader-CDCcXu8v.js";import{I as R}from"./InfoLabel-CI6bHOeU.js";import{T as m}from"./TooltipText-d7cAgyJE.js";import{s as a,u as ve}from"./useSettings-Q2tOR4bH.js";import{C as ce}from"./ConfirmModal-BCthkdVV.js";import{D as de,f as ue,r as Se,s as Ce,a as pe,d as se,S as ae,b as Ne}from"./sample-requests-CG4hsqBb.js";import{C as _e}from"./UiPrimitive-BTuxHpyB.js";import"./ConfirmModal.module-DJksQHBd.js";const ke="_card_1ende_4",Pe="_cardEmbedded_1ende_14",Le="_cardTitle_1ende_21",Re="_storageConsoleGrid_1ende_30",we="_storageUsageColumn_1ende_37",He="_storagePolicyColumn_1ende_38",Be="_usageRow_1ende_43",Me="_usageTotal_1ende_49",Ae="_usageBreakdown_1ende_56",$e="_usageCounts_1ende_62",De="_storageFooter_1ende_69",Ee="_lastRunRow_1ende_78",Te="_lastRunLabel_1ende_88",Ie="_errorIcon_1ende_94",Ue="_tooltip_1ende_102",ze="_cleanupRow_1ende_125",Fe="_cleanupLabel_1ende_132",Oe="_cleanupBtn_1ende_139",Ge="_cleanupBtnDanger_1ende_168",qe="_retentionSection_1ende_181",We="_retentionTitle_1ende_187",Ye="_retentionFieldset_1ende_194",Ke="_proOverlay_1ende_209",Ve="_modeSegments_1ende_221",Je="_radioLabel_1ende_242",Qe="_radioLabelActive_1ende_263",Ze="_presetGroup_1ende_277",Xe="_presetBtn_1ende_285",et="_presetBtnActive_1ende_308",tt="_freeInput_1ende_315",st="_inputError_1ende_332",at="_inputUnit_1ende_336",nt="_cascadeRow_1ende_343",it="_retentionActions_1ende_359",ot="_saveBtn_1ende_365",rt="_runNowBtn_1ende_393",lt="_errorMsg_1ende_437",ct="_freeInputHitArea_1ende_499",o={card:ke,cardEmbedded:Pe,cardTitle:Le,storageConsoleGrid:Re,storageUsageColumn:we,storagePolicyColumn:He,usageRow:Be,usageTotal:Me,usageBreakdown:Ae,usageCounts:$e,storageFooter:De,lastRunRow:Ee,lastRunLabel:Te,errorIcon:Ie,tooltip:Ue,cleanupRow:ze,cleanupLabel:Fe,cleanupBtn:Oe,cleanupBtnDanger:Ge,retentionSection:qe,retentionTitle:We,retentionFieldset:Ye,proOverlay:Ke,modeSegments:Ve,radioLabel:Je,radioLabelActive:Qe,presetGroup:Ze,presetBtn:Xe,presetBtnActive:et,freeInput:tt,inputError:st,inputUnit:at,cascadeRow:nt,retentionActions:it,saveBtn:ot,runNowBtn:rt,errorMsg:lt,freeInputHitArea:ct};function dt(t,s){return!!(t.mode==="off"&&s.mode!=="off"||t.mode==="age"&&s.mode==="age"&&(s.ageDays??0)<(t.ageDays??0)||t.mode==="size"&&s.mode==="size"&&(s.sizeMb??0)<(t.sizeMb??0)||!t.cascadeSnapshots&&s.cascadeSnapshots)}function ne(t){return t.mode==="age"?Number.isInteger(t.ageDays)&&t.ageDays>=1&&t.ageDays<=365:t.mode==="size"?Number.isInteger(t.sizeMb)&&t.sizeMb>=50&&t.sizeMb<=1e4:!0}function ut(t,s){return t.mode===s.mode&&t.ageDays===s.ageDays&&t.sizeMb===s.sizeMb&&t.cascadeSnapshots===s.cascadeSnapshots}function Y(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:t<1024*1024*1024?`${(t/(1024*1024)).toFixed(1)} MB`:`${(t/(1024*1024*1024)).toFixed(2)} GB`}function pt({placeId:t,tier:s,currentPolicy:l,onSaved:d}){const{t:i}=X(),{trackEvent:b}=le(),[n,g]=r.useState(l),[p,_]=r.useState(()=>[7,14,30,90].includes(l.ageDays??-1)?"":String(l.ageDays??30)),[v,k]=r.useState(()=>[100,500,1e3].includes(l.sizeMb??-1)?"":String(l.sizeMb??500)),[P,D]=r.useState(null),[x,f]=r.useState(!1),[E,w]=r.useState(!1),[y,H]=r.useState(!1),[L,A]=r.useState(null);r.useEffect(()=>{g(l);const h=[7,14,30,90],M=[100,500,1e3];_(h.includes(l.ageDays??-1)?"":String(l.ageDays??30)),k(M.includes(l.sizeMb??-1)?"":String(l.sizeMb??500))},[l]);const $=s==="basic",N=ne(n),j=ut(l,n),T=N&&!j&&!E,S=h=>{g(M=>{const O={...M,mode:h};return h==="age"&&(O.ageDays=parseInt(p,10)||30),h==="size"&&(O.sizeMb=parseInt(v,10)||500),O})},B=h=>{_(""),g(M=>({...M,ageDays:h}))},z=h=>{k(""),g(M=>({...M,sizeMb:h}))},F=h=>{_(h);const M=parseInt(h,10);Number.isNaN(M)||g(O=>({...O,ageDays:M}))},c=h=>{k(h);const M=parseInt(h,10);Number.isNaN(M)||g(O=>({...O,sizeMb:M}))},I=async()=>{if(A(null),b("dashboard_click_event",{click_target:"ui_studio_cleanup_save",page:"settings"}),dt(l,n)){try{const h=await ue(t,{mode:n.mode,ageDays:n.ageDays,sizeMb:n.sizeMb,cascadeSnapshots:n.cascadeSnapshots});D(h.dryRun),f(!0)}catch(h){A(h.message)}return}await W()},W=async()=>{w(!0);try{await Ce(t,n),f(!1),d()}catch(h){throw A(h.message),h}finally{w(!1)}},u=async()=>{A(null),b("dashboard_click_event",{click_target:"ui_studio_cleanup_run_now",page:"settings"}),H(!0);try{await Se(t),d()}catch(h){A(h.message)}finally{H(!1)}},C=P?`${i("uiStudio.cleanup.policy.confirm.messageStrict","이 정책으로 즉시")} ${P.wouldRemoveRequests}${i("uiStudio.cleanup.policy.confirm.requests","건")} / ${P.wouldRemoveSnapshots}${i("uiStudio.cleanup.policy.confirm.snapshots","개 화면 캡처")} / ${Y(P.wouldFreeBytes)} ${i("uiStudio.cleanup.policy.confirm.freed","가 삭제됩니다 — 적용?")}`:"",K=n.mode==="age"&&!ne(n),q=n.mode==="size"&&!ne(n);return e.jsxs("div",{className:o.retentionSection,children:[e.jsx("h3",{className:o.retentionTitle,children:e.jsx(R,{label:i("uiStudio.cleanup.policy.title","자동 삭제 정책"),tooltip:i("uiStudio.cleanup.policy.title.tooltip","Rules that automatically remove old or large captures.")})}),e.jsxs("div",{style:{position:"relative"},children:[$&&e.jsx("div",{className:o.proOverlay,title:i("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능"),children:e.jsx("div",{className:o.tooltip,children:i("uiStudio.cleanup.policy.proRequired","Pro에서 사용 가능")})}),e.jsxs("fieldset",{className:o.retentionFieldset,disabled:$,"aria-label":i("uiStudio.cleanup.policy.title","자동 삭제 정책"),style:$?{opacity:.45,pointerEvents:"none"}:void 0,children:[e.jsxs("div",{className:o.modeSegments,"data-testid":"cleanup-mode-segments",children:[e.jsx(m,{text:i("uiStudio.cleanup.policy.modeOff.tooltip","Turn off auto-cleanup. Data stays until you remove it manually."),children:e.jsxs("label",{className:`${o.radioLabel} ${n.mode==="off"?o.radioLabelActive:""}`,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"off",checked:n.mode==="off",onChange:()=>S("off")}),i("uiStudio.cleanup.policy.modeOff","사용 안 함 (off)")]})}),e.jsx(m,{text:i("uiStudio.cleanup.policy.modeAge.tooltip","Automatically delete data older than the configured number of days."),children:e.jsxs("label",{className:`${o.radioLabel} ${n.mode==="age"?o.radioLabelActive:""}`,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"age",checked:n.mode==="age",onChange:()=>S("age")}),i("uiStudio.cleanup.policy.modeAge","기간 기반 (age)")]})}),e.jsx(m,{text:i("uiStudio.cleanup.policy.modeSize.tooltip","When total usage exceeds the limit, the oldest data is removed first."),children:e.jsxs("label",{className:`${o.radioLabel} ${n.mode==="size"?o.radioLabelActive:""}`,children:[e.jsx("input",{type:"radio",name:"cleanupMode",value:"size",checked:n.mode==="size",onChange:()=>S("size")}),i("uiStudio.cleanup.policy.modeSize","용량 기반 (size)")]})})]}),n.mode==="age"&&e.jsxs("div",{className:o.presetGroup,children:[[7,14,30,90].map(h=>e.jsx(m,{text:i("uiStudio.cleanup.policy.agePreset.tooltip","Delete data older than this many days."),children:e.jsxs("button",{type:"button",className:`${o.presetBtn} ${n.ageDays===h&&p===""?o.presetBtnActive:""}`,onClick:()=>B(h),children:[h,i("uiStudio.cleanup.policy.daysUnit","일")]})},h)),e.jsx(m,{text:i("uiStudio.cleanup.policy.ageInput.tooltip","Enter any value between 1 and 365 days."),children:e.jsx("label",{className:o.freeInputHitArea,children:e.jsx("input",{type:"number",className:`${o.freeInput} ${K?o.inputError:""}`,value:p,min:1,max:365,onChange:h=>F(h.target.value)})})}),e.jsxs("span",{className:o.inputUnit,children:["1–365",i("uiStudio.cleanup.policy.daysUnit","일")]})]}),n.mode==="size"&&e.jsxs("div",{className:o.presetGroup,children:[[100,500,1e3].map(h=>e.jsx(m,{text:i("uiStudio.cleanup.policy.sizePreset.tooltip","Keep total usage under this size."),children:e.jsxs("button",{type:"button",className:`${o.presetBtn} ${n.sizeMb===h&&v===""?o.presetBtnActive:""}`,onClick:()=>z(h),children:[h,i("uiStudio.cleanup.policy.mbUnit","MB")]})},h)),e.jsx(m,{text:i("uiStudio.cleanup.policy.sizeInput.tooltip","Enter any value between 50 MB and 10000 MB (10 GB)."),children:e.jsx("label",{className:o.freeInputHitArea,children:e.jsx("input",{type:"number",className:`${o.freeInput} ${q?o.inputError:""}`,value:v,min:50,max:1e4,onChange:h=>c(h.target.value)})})}),e.jsxs("span",{className:o.inputUnit,children:["50–10000",i("uiStudio.cleanup.policy.mbUnit","MB")]})]}),e.jsx(m,{text:i("uiStudio.cleanup.policy.cascade.tooltip","Also delete the capture images linked to those records. If off, the images stay."),children:e.jsxs("label",{className:o.cascadeRow,children:[e.jsx(_e,{checked:n.cascadeSnapshots,onChange:h=>g(M=>({...M,cascadeSnapshots:h.target.checked}))}),i("uiStudio.cleanup.policy.cascade","연결된 화면 캡처도 함께 삭제")]})}),e.jsxs("div",{className:o.retentionActions,children:[e.jsx(m,{text:i("uiStudio.cleanup.policy.save.tooltip","Save the current cleanup rule. It runs in the background from then on."),children:e.jsx("button",{type:"button",className:o.saveBtn,onClick:()=>void I(),disabled:!T,children:i("uiStudio.cleanup.policy.save","정책 저장")})}),e.jsx(m,{text:i("uiStudio.cleanup.policy.runNow.tooltip","저장된 정리 정책을 다음 자동 실행까지 기다리지 않고 지금 한 번 실행합니다."),children:e.jsx("button",{type:"button",className:o.runNowBtn,onClick:()=>void u(),disabled:y,children:i("uiStudio.cleanup.policy.runNow","저장된 정책으로 정리")})})]}),L&&e.jsx("div",{className:o.errorMsg,children:L})]})]}),x&&P&&e.jsx(de,{title:i("uiStudio.cleanup.policy.confirm.title","정책 적용 확인"),message:C,danger:!0,confirmLabel:i("uiStudio.cleanup.policy.save","정책 저장"),busy:E,onConfirm:W,onClose:()=>f(!1)})]})}function gt({placeId:t,tier:s,onChanged:l,sampleUsage:d,sampleRetention:i,embedded:b=!1}){const{t:n}=X(),g=s==="basic"&&d!=null&&i!=null,[p,_]=r.useState(g?d:null),[v,k]=r.useState(g?i:null),[P,D]=r.useState(null),[x,f]=r.useState(null),[E,w]=r.useState(null),y=r.useCallback(async()=>{if(!g&&t!=null){D(null);try{const[S,B]=await Promise.all([pe(t),ue(t)]);_(S),k(B.policy)}catch(S){D(S.message)}}},[t,g]);r.useEffect(()=>{y()},[y]);const H=r.useCallback(()=>{y(),l==null||l()},[y,l]),L=r.useCallback(async()=>{if(x&&t!=null){w(null);try{x.kind==="keep7"?await se(t,{olderThanDays:7,alsoSnapshots:!0}):x.kind==="keep30"?await se(t,{olderThanDays:30,alsoSnapshots:!0}):await se(t,{all:!0,alsoSnapshots:!0}),f(null),y(),l==null||l()}catch(S){throw w(S.message),S}}},[x,t,y,l]);function A(S){const B=n("uiStudio.cleanup.studioPreservedNote","This deletes saved change records and screenshots on disk only; Roblox Studio instances are not affected.");return S.kind==="keep7"?`${n("uiStudio.cleanup.cleanupConfirmMessage.keep7","7일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${B}`:S.kind==="keep30"?`${n("uiStudio.cleanup.cleanupConfirmMessage.keep30","30일 이전 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${B}`:`${((p==null?void 0:p.requestCount)??0)+((p==null?void 0:p.snapshotCount)??0)}${n("uiStudio.cleanup.cleanupConfirmMessage.all","개의 저장된 변경 기록과 화면 캡처가 삭제됩니다. 이 작업은 되돌릴 수 없습니다.")} ${B}`}if(t==null&&!g)return null;if(P)return e.jsx("div",{className:`${o.card} ${b?o.cardEmbedded:""}`,children:e.jsx("p",{className:o.errorMsg,children:P})});if(!p||!v)return e.jsx("div",{className:`${o.card} ${b?o.cardEmbedded:""}`,children:e.jsx("p",{style:{fontSize:12,color:"var(--text-muted)",margin:0},children:n("uiStudio.storage.loading","로딩 중...")})});const $=v.lastRunAt,N=v.lastRunStats,j=$?new Date($).toLocaleString():null,T=t??0;return e.jsxs("div",{className:`${o.card} ${b?o.cardEmbedded:""}`,children:[!b&&e.jsx("h3",{className:o.cardTitle,children:e.jsx(R,{label:n("uiStudio.storage.title","UI Studio 저장 데이터"),tooltip:n("uiStudio.storage.title.tooltip","Disk usage of UI Studio change records and screenshots.")})}),e.jsxs("div",{className:o.storageConsoleGrid,"data-testid":"ui-studio-storage-console-grid",children:[e.jsx("section",{className:o.storageUsageColumn,children:e.jsxs("div",{className:o.usageRow,children:[e.jsx(m,{text:n("uiStudio.storage.usageLabel.tooltip","Disk space currently used by UI Studio for this project."),children:e.jsxs("div",{className:o.usageTotal,children:[n("uiStudio.storage.usageLabel","사용 중")," ",Y(p.totalBytes)]})}),e.jsxs("div",{className:o.usageBreakdown,children:[e.jsx(m,{text:n("uiStudio.storage.historyBytes.tooltip","Space taken by change record data (JSON)."),children:e.jsxs("span",{children:[n("uiStudio.storage.historyBytes","변경 이력")," ",Y(p.historyBytes)]})})," · ",e.jsx(m,{text:n("uiStudio.storage.snapshotBytes.tooltip","Space taken by captured PNG image files."),children:e.jsxs("span",{children:[n("uiStudio.storage.snapshotBytes","화면 캡처")," ",Y(p.snapshotBytes)]})})]}),e.jsxs("div",{className:o.usageCounts,children:[e.jsx(m,{text:n("uiStudio.storage.requestCount.tooltip","Number of actions where AI changed the UI."),children:e.jsxs("span",{children:[n("uiStudio.storage.requestCount","변경 기록")," ",p.requestCount.toLocaleString(),n("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(m,{text:n("uiStudio.storage.mutationCount.tooltip","Number of detail changes inside actions (one property edit = 1)."),children:e.jsxs("span",{children:[n("uiStudio.storage.mutationCount","변경 상세")," ",p.mutationCount.toLocaleString(),n("uiStudio.storage.countSuffix","개")]})})," · ",e.jsx(m,{text:n("uiStudio.storage.snapshotCount.tooltip","Number of saved capture image files."),children:e.jsxs("span",{children:[n("uiStudio.storage.snapshotCount","화면 캡처")," ",p.snapshotCount.toLocaleString(),n("uiStudio.storage.countSuffix","개")]})})]})]})}),e.jsx("section",{className:o.storagePolicyColumn,children:e.jsx(pt,{placeId:T,tier:s,currentPolicy:v,onSaved:H})})]}),e.jsxs("div",{className:o.storageFooter,"data-testid":"ui-studio-storage-footer",children:[e.jsxs("div",{className:o.lastRunRow,children:[e.jsx("span",{className:o.lastRunLabel,children:e.jsx(R,{label:n("uiStudio.storage.lastRun","마지막 자동 정리"),tooltip:n("uiStudio.storage.lastRun.tooltip","When the auto-cleanup policy last ran, and what it removed.")})}),j?e.jsxs(e.Fragment,{children:[e.jsx("span",{children:j}),N&&e.jsxs("span",{children:["· ",n("uiStudio.storage.requestCount","변경 기록")," ",N.removedRequests,n("uiStudio.storage.countSuffix","개")," / ",n("uiStudio.storage.snapshotCount","화면 캡처")," ",N.removedSnapshots,n("uiStudio.storage.countSuffix","개")," / ",Y(N.freedBytes)," ",n("uiStudio.storage.lastRunFreed","회수")]}),N&&N.errors>0&&e.jsxs("span",{className:o.errorIcon,title:`${n("uiStudio.storage.lastRunErrors","오류")} ${N.errors}건`,children:["⚠",e.jsxs("span",{className:o.tooltip,children:[n("uiStudio.storage.lastRunErrors","오류")," ",N.errors,n("uiStudio.storage.countSuffix","건")]})]})]}):e.jsx("span",{children:n("uiStudio.storage.lastRunNever","—")})]}),e.jsxs("div",{className:o.cleanupRow,children:[e.jsx("span",{className:o.cleanupLabel,children:e.jsx(R,{label:n("uiStudio.cleanup.label","수동 정리"),tooltip:n("uiStudio.cleanup.label.tooltip","Manually clean up change records and captures whenever you want.")})}),e.jsx(m,{text:n("uiStudio.cleanup.keep7.tooltip","Delete change records and captures older than 7 days."),children:e.jsx("button",{type:"button",className:o.cleanupBtn,onClick:()=>f({kind:"keep7"}),disabled:s==="basic",children:n("uiStudio.cleanup.keepLastNDays","최근 7일만 남기기").replace("{n}","7")})}),e.jsx(m,{text:n("uiStudio.cleanup.keep30.tooltip","Delete change records and captures older than 30 days."),children:e.jsx("button",{type:"button",className:o.cleanupBtn,onClick:()=>f({kind:"keep30"}),disabled:s==="basic",children:n("uiStudio.cleanup.keepLastNDays","최근 30일만 남기기").replace("{n}","30")})}),!b&&e.jsx(m,{text:n("uiStudio.cleanup.deleteAll.tooltip","Delete every change record and capture for this project. The actual UI in Roblox Studio is not affected."),children:e.jsx("button",{type:"button",className:`${o.cleanupBtn} ${o.cleanupBtnDanger}`,onClick:()=>f({kind:"all"}),disabled:s==="basic",children:n("uiStudio.cleanup.deleteAll","전체 삭제…")})})]})]}),E&&e.jsx("div",{className:o.errorMsg,children:E}),x&&e.jsx(de,{title:n("uiStudio.cleanup.cleanupConfirmTitle","정리 확인"),message:A(x),danger:!0,confirmLabel:n("common.delete","삭제"),onConfirm:L,onClose:()=>{f(null),w(null)}})]})}function ie(t,s){const l={placeId:String(t)};return s&&(l["preview.mode"]=s.mode,s.mode==="size"&&(l["preview.sizeMb"]=String(s.sizeMb))),U.get("/api/dashboard/changelog/cleanup",l)}function oe(t){return U.put("/api/dashboard/changelog/cleanup",t)}function ht(t){return U.post(`/api/dashboard/changelog/cleanup/run?placeId=${encodeURIComponent(t)}`)}const mt=[100,500,1e3];function re(t,s){return t.mode!==s.mode?!1:t.mode==="off"||s.mode==="size"&&t.sizeMb===s.sizeMb}function yt(t,s){return t.mode==="off"?!1:s.mode==="off"||t.sizeMb<s.sizeMb}function J(t){return t<1e3?`${t} B`:t<1e6?`${(t/1e3).toFixed(1)} KB`:t<1e9?`${(t/1e6).toFixed(1)} MB`:`${(t/1e9).toFixed(2)} GB`}function jt({placeId:t,onChanged:s}){const{locale:l,t:d}=X(),[i,b]=r.useState(null),[n,g]=r.useState({mode:"size",sizeMb:500}),[p,_]=r.useState(t!==null),[v,k]=r.useState(!1),[P,D]=r.useState(!1),[x,f]=r.useState(!1),[E,w]=r.useState(!1),[y,H]=r.useState(null),L=r.useCallback(async()=>{if(t===null){b(null),_(!1);return}D(!1);try{const u=await ie(t);b(u),g(u.policy)}catch{D(!0)}finally{_(!1)}},[t]);r.useEffect(()=>{_(t!==null),L()},[L,t]);const A=r.useCallback(async u=>{k(!0),f(!1),w(!1);try{await oe(u),H(null),await L(),w(!0),s==null||s()}catch{f(!0)}finally{k(!1)}},[L,s]),$=r.useCallback(async()=>{if(!(!i||t===null||re(n,i.policy))){k(!0),f(!1),w(!1);try{if(yt(n,i.policy)){const u=await ie(t,n);if(u.preview.affectedPlaceCount>0){H({policy:n,preview:u});return}}await oe(n),await L(),w(!0),s==null||s()}catch{f(!0)}finally{k(!1)}}},[i,n,L,s,t]),N=r.useCallback(async()=>{if(t!==null){k(!0),f(!1),w(!1);try{await ht(t),await L(),s==null||s()}catch{f(!0)}finally{k(!1)}}},[L,s,t]),j=i==null?void 0:i.selectedPlace.currentUsage,T=(i==null?void 0:i.policy.mode)==="size"?i.policy.sizeMb*1e6:null,S=T??Math.max((j==null?void 0:j.bytes)??0,1),B=Math.min(100,((j==null?void 0:j.sessionBytes)??0)/S*100),z=Math.min(Math.max(0,100-B),((j==null?void 0:j.contextBytes)??0)/S*100),F=i?!re(n,i.policy):!1,c=u=>u.mode==="off"?d("settings.projectChanges.cleanup.unlimited","Unlimited"):`${u.sizeMb} MB`,I=r.useMemo(()=>{if(!y)return"";const u=y.preview.preview,C=d("settings.projectChanges.cleanup.confirm.message","{places} Places · {sessions} sessions · {bytes} expected to be freed.").replace("{places}",u.affectedPlaceCount.toLocaleString()).replace("{sessions}",u.deleteSessionCount.toLocaleString()).replace("{bytes}",J(u.estimatedFreedBytes));return u.wouldRemainOverLimitPlaceCount===0?C:`${C} ${d("settings.projectChanges.cleanup.confirm.protected","{places} Place may remain over the limit because active data is protected.").replace("{places}",u.wouldRemainOverLimitPlaceCount.toLocaleString())}`},[y,d]);if(t===null)return e.jsx("div",{className:a.projectChangesPanel,children:e.jsx("p",{className:a.projectChangesEmpty,children:d("settings.projectChanges.cleanup.noPlace","Select a Place to manage saved project changes.")})});if(p)return e.jsx("div",{className:a.projectChangesPanel,children:e.jsx("p",{className:a.projectChangesEmpty,children:d("settings.projectChanges.cleanup.loading","Loading storage settings…")})});if(P||!i||!j)return e.jsxs("div",{className:a.projectChangesPanel,children:[e.jsx("p",{className:a.projectChangesError,role:"alert",children:d("settings.projectChanges.cleanup.loadFailed","Could not load storage settings.")}),e.jsx("button",{className:a.projectChangesSecondaryButton,type:"button",onClick:()=>{_(!0),L()},children:d("common.retry","Retry")})]});const W=T===null?d("settings.projectChanges.cleanup.usageUnlimited","{used} used · Unlimited").replace("{used}",J(j.bytes)):d("settings.projectChanges.cleanup.usageLimited","{used} used of {limit}").replace("{used}",J(j.bytes)).replace("{limit}",c(i.policy));return e.jsxs("div",{className:a.projectChangesPanel,children:[e.jsxs("div",{className:a.projectChangesConsoleGrid,"data-testid":"project-storage-console-grid",children:[e.jsxs("section",{className:a.projectChangesUsageColumn,children:[e.jsx("h3",{className:a.projectChangesPanelTitle,children:e.jsx(R,{label:d("settings.projectChanges.cleanup.title","Storage management"),tooltip:d("settings.projectChanges.cleanup.title.tooltip","Set how much Project Change Summary history each Place can keep.")})}),e.jsxs("div",{className:a.projectChangesUsageBlock,children:[e.jsx("div",{className:a.projectChangesUsageSummary,children:W}),e.jsxs("div",{className:a.projectChangesQuotaRail,role:"meter","aria-label":d("settings.projectChanges.cleanup.usageAria","Place storage usage"),"aria-valuemin":0,"aria-valuenow":j.bytes,"aria-valuemax":T??j.bytes,children:[e.jsx("span",{className:a.projectChangesSessionRail,style:{width:`${B}%`}}),e.jsx("span",{className:a.projectChangesContextRail,style:{width:`${z}%`}})]}),e.jsxs("div",{className:a.projectChangesUsageLegend,children:[e.jsxs("span",{children:[d("settings.projectChanges.cleanup.sessions","Sessions")," ",e.jsx("strong",{children:J(j.sessionBytes)})]}),e.jsxs("span",{children:[d("settings.projectChanges.cleanup.contexts","Contexts")," ",e.jsx("strong",{children:J(j.contextBytes)})]})]})]})]}),e.jsxs("section",{className:a.projectChangesPolicyColumn,children:[e.jsx("p",{className:a.projectChangesScope,children:d("settings.projectChanges.cleanup.scope","One setting applies the selected limit separately to every Place.")}),e.jsxs("fieldset",{className:a.projectChangesPolicyFieldset,disabled:v,children:[e.jsx("legend",{className:a.projectChangesPolicyLegend,children:d("settings.projectChanges.cleanup.limit","Limit per Place")}),e.jsxs("div",{className:a.projectChangesPresetGroup,children:[mt.map(u=>{const C=n.mode==="size"&&n.sizeMb===u;return e.jsx("button",{className:`${a.projectChangesPresetButton} ${C?a.projectChangesPresetButtonActive:""}`,type:"button","aria-pressed":C,onClick:()=>g({mode:"size",sizeMb:u}),children:d("settings.projectChanges.cleanup.preset","{sizeMb}MB").replace("{sizeMb}",String(u))},u)}),e.jsx("button",{className:`${a.projectChangesPresetButton} ${n.mode==="off"?a.projectChangesPresetButtonActive:""}`,type:"button","aria-pressed":n.mode==="off",onClick:()=>g({mode:"off"}),children:d("settings.projectChanges.cleanup.unlimited","Unlimited")})]})]}),e.jsxs("div",{className:a.projectChangesActions,children:[e.jsx("button",{className:a.projectChangesSaveButton,type:"button",disabled:!F||v,onClick:()=>void $(),children:d("common.save","Save")}),e.jsx("button",{className:a.projectChangesSecondaryButton,type:"button",disabled:v,onClick:()=>void N(),children:d("settings.projectChanges.cleanup.runNow","Run saved policy")}),E&&e.jsx("span",{className:a.projectChangesSaved,role:"status",children:d("settings.projectChanges.cleanup.saved","Saved")})]})]})]}),i.selectedPlace.dryRun.wouldRemainOverLimit&&e.jsx("p",{className:a.projectChangesWarning,children:d("settings.projectChanges.cleanup.protectedWarning","Active changes are protected, so this Place may stay over the limit.")}),e.jsxs("div",{className:a.projectChangesLastRun,"data-testid":"project-storage-footer",children:[e.jsx("span",{className:a.projectChangesLastRunLabel,children:d("settings.projectChanges.cleanup.lastRun","Last cleanup")}),i.selectedPlace.lastRun?e.jsxs("span",{children:[new Date(i.selectedPlace.lastRun.ranAt).toLocaleString(l)," · ",d("settings.projectChanges.cleanup.lastRunSummary","{sessions} sessions · {bytes} freed").replace("{sessions}",i.selectedPlace.lastRun.deletedSessionCount.toLocaleString()).replace("{bytes}",J(i.selectedPlace.lastRun.freedBytes))]}):e.jsx("span",{children:d("settings.projectChanges.cleanup.neverRun","Not run yet")})]}),x&&e.jsx("p",{className:a.projectChangesError,role:"alert",children:d("settings.projectChanges.cleanup.actionFailed","Could not update storage settings.")}),e.jsx(ce,{open:y!==null,title:d("settings.projectChanges.cleanup.confirm.title","Apply this limit and clean saved changes?"),message:I,cancelLabel:d("common.cancel","Cancel"),confirmLabel:d("settings.projectChanges.cleanup.confirm.apply","Apply and clean"),loading:v,onCancel:()=>!v&&H(null),onConfirm:()=>{y&&A(y.policy)}})]})}const xt={toolsActivity:null,toolStats:null,toolSessions:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null},ft={toolsActivity:null,toolStats:null,syncLog:null,playtestReports:null,projectChanges:null,connectionLog:null};function bt(t){var s;return t?t.pluginConnected?t.activePlaceId:t.lastActivePlaceId??((s=t.places[0])==null?void 0:s.placeId)??null:null}async function G(t){try{return await t}catch{return null}}function ee(t){return t?typeof t.total=="number"?t.total:Array.isArray(t.entries)?t.entries.length:null:null}function te(t,s,l,d){return s===null?t("settings.dataHistory.metric.unavailable","Unavailable"):`${s.toLocaleString()} ${t(l,d)}`}function Q(t,s,l){const d=l===null?t("settings.dataHistory.metric.sizeUnavailable","size unavailable"):Y(l);return`${s} · ${d}`}function Z(t,s){var d;const l=(d=t==null?void 0:t[s])==null?void 0:d.bytes;return typeof l=="number"&&Number.isFinite(l)?l:null}function vt(t,s){return s?[`${s.requestCount.toLocaleString()} ${t("uiStudio.storage.requestCount","change records")}`,`${s.snapshotCount.toLocaleString()} ${t("uiStudio.storage.snapshotCount","screenshots")}`,Y(s.totalBytes)].join(" · "):t("settings.dataHistory.metric.unavailable","Unavailable")}function St({tier:t}){const{t:s}=X(),[l,d]=r.useState(xt),[i,b]=r.useState(ft),[n,g]=r.useState(t==="basic"?ae:null),[p,_]=r.useState(null),[v,k]=r.useState(!0),[P,D]=r.useState(!0),[x,f]=r.useState(null),[E,w]=r.useState(()=>new Set),[y,H]=r.useState(null),[L,A]=r.useState(!1),[$,N]=r.useState(null),j=r.useCallback(async()=>{k(!0);const u=await G(me()),C=bt(u);_(C);const[K,q,h,M,O,ge,V]=await Promise.all([G(U.get("/api/dashboard/history",{limit:"1",offset:"0"})),G(U.get("/api/dashboard/tool-stats")),G(U.get("/sync/history",{limit:"1",offset:"0"})),G(U.get("/api/dashboard/playtest/history")),G(U.get("/api/dashboard/changelog",{limit:"1",offset:"0"})),G(U.get("/api/dashboard/connection-log")),G(U.get("/api/dashboard/storage-summary"))]),he=t==="basic"?ae:C===null?null:await G(pe(C));d({toolsActivity:ee(K),toolStats:(q==null?void 0:q.totalCalls)??null,toolSessions:(q==null?void 0:q.totalSessions)??null,syncLog:ee(h),playtestReports:ee(M),projectChanges:ee(O),connectionLog:ee(ge)}),b({toolsActivity:Z(V,"toolsActivity"),toolStats:Z(V,"toolStats"),syncLog:Z(V,"syncLog"),playtestReports:Z(V,"playtestReports"),projectChanges:Z(V,"projectChanges"),connectionLog:Z(V,"connectionLog")}),g(he),k(!1)},[t]);r.useEffect(()=>{j()},[j]);const T=r.useCallback(u=>{w(C=>{if(C.has(u))return C;const K=new Set(C);return K.add(u),K}),f(C=>C===u?null:u)},[]),S=r.useMemo(()=>[{key:"toolsActivity",title:s("settings.dataHistory.toolsActivity.title","Tool activity"),description:s("settings.dataHistory.toolsActivity.description","Saved tool runs shown on the Tools page."),metric:Q(s,te(s,l.toolsActivity,"settings.dataHistory.metric.records","records"),i.toolsActivity),metricTooltip:s("settings.dataHistory.toolsActivity.metric.tooltip","Number of saved tool runs and the disk space they use."),route:"/tools",clearEndpoint:"/api/dashboard/tools/history/clear"},{key:"toolStats",title:s("settings.dataHistory.toolStats.title","Tool usage statistics"),description:s("settings.dataHistory.toolStats.description","Aggregated tool counts and status totals."),metric:Q(s,l.toolStats===null?s("settings.dataHistory.metric.unavailable","Unavailable"):`${l.toolStats.toLocaleString()} ${s("settings.dataHistory.metric.runs","runs")} · ${(l.toolSessions??0).toLocaleString()} ${s("settings.dataHistory.metric.sessions","sessions")}`,i.toolStats),metricTooltip:s("settings.dataHistory.toolStats.metric.tooltip","Aggregated total runs and session counts."),route:"/tools",clearEndpoint:"/api/dashboard/tools/statistics/clear"},{key:"syncLog",title:s("settings.dataHistory.syncLog.title","Sync log"),description:s("settings.dataHistory.syncLog.description","Saved file sync events for the active place."),metric:Q(s,te(s,l.syncLog,"settings.dataHistory.metric.records","records"),i.syncLog),metricTooltip:s("settings.dataHistory.syncLog.metric.tooltip","Number of saved sync events and the disk space they use."),route:"/sync",clearEndpoint:"/api/dashboard/sync/history/clear"},{key:"playtestReports",title:s("settings.dataHistory.playtest.title","Playtest reports"),description:s("settings.dataHistory.playtest.description","Saved automated playtest reports and logs."),metric:Q(s,te(s,l.playtestReports,"settings.dataHistory.metric.reports","reports"),i.playtestReports),metricTooltip:s("settings.dataHistory.playtestReports.metric.tooltip","Number of saved playtest reports and the disk space they use."),route:"/playtest",clearEndpoint:"/api/dashboard/playtest/history/clear"},{key:"projectChanges",title:s("settings.dataHistory.projectChanges.title","Project change summary"),description:s("settings.dataHistory.projectChanges.description","Saved summaries of project changes."),metric:Q(s,te(s,l.projectChanges,"settings.dataHistory.metric.records","records"),i.projectChanges),metricTooltip:s("settings.dataHistory.projectChanges.metric.tooltip","Number of saved project change summaries and the disk space they use."),route:"/changelog",clearEndpoint:"/api/dashboard/changelog/clear"},{key:"connectionLog",title:s("settings.dataHistory.connectionLog.title","Connection log"),description:s("settings.dataHistory.connectionLog.description","Saved MCP and Studio connection events."),metric:Q(s,te(s,l.connectionLog,"settings.dataHistory.metric.records","records"),i.connectionLog),metricTooltip:s("settings.dataHistory.connectionLog.metric.tooltip","Number of saved connection events and the disk space they use."),route:"/connection",clearEndpoint:"/api/dashboard/connection-log/clear"}],[l,i,s]),B=async()=>{if(y){A(!0),N(null);try{if(y.kind==="uiStudio"){if(t!=="pro"||p===null)throw new Error("UI Studio place is unavailable");await se(p,{all:!0,alsoSnapshots:!0}),N(s("settings.dataHistory.uiStudio.clear.success","UI Studio saved data cleared."))}else{const u=y.row.key==="projectChanges";if(u&&p===null)throw new Error("Project changes place is unavailable");let C=y.row.clearEndpoint;u&&p!==null&&(C=`${C}?placeId=${encodeURIComponent(p)}`),await U.post(C),N(u?s("settings.dataHistory.projectChanges.clear.success","Project change summaries cleared."):s("settings.dataHistory.clear.success","Saved data cleared."))}H(null),await j()}catch{N(y.kind==="uiStudio"?s("settings.dataHistory.uiStudio.clear.failed","Failed to clear UI Studio saved data."):s("settings.dataHistory.clear.failed","Failed to clear saved data."))}finally{A(!1)}}},z=t==="pro"?p:0,F=t==="pro"&&p!==null,c=(y==null?void 0:y.kind)==="uiStudio",I=(y==null?void 0:y.kind)==="row"&&y.row.key==="projectChanges",W=s("settings.dataHistory.title","Data & History");return e.jsxs(e.Fragment,{children:[e.jsxs("section",{id:"data-history",className:a.card,children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(R,{label:s("settings.dataHistory.title","Data & History"),tooltip:s("settings.dataHistory.title.tooltip","Manage saved dashboard data in one place.")}),e.jsxs("div",{className:a.cardHeaderActions,children:[e.jsx(m,{text:s("settings.dataHistory.scope.tooltip","Clear actions apply to the current project and active place where applicable."),children:e.jsx("span",{className:a.headerBadge,children:v?s("common.loading","Loading"):s("settings.dataHistory.scope","Current project")})}),e.jsx(m,{text:s("settings.dataHistory.toggle.tooltip","Collapse or expand this section."),children:e.jsx("button",{className:a.collapseButton,type:"button","aria-expanded":P,"aria-controls":"settings-data-history-body","aria-label":P?s("settings.dataHistory.collapse","Collapse {title}").replace("{title}",W):s("settings.dataHistory.expand","Expand {title}").replace("{title}",W),onClick:()=>D(u=>!u),children:P?"▾":"▸"})})]})]}),P&&e.jsxs("div",{id:"settings-data-history-body",children:[e.jsx("p",{className:a.dataHistoryIntro,children:s("settings.dataHistory.intro","Review saved dashboard data, open the related page, or clear stored records from one place.")}),e.jsxs("div",{className:a.dataHistoryList,children:[S.map(u=>e.jsxs(r.Fragment,{children:[e.jsxs("div",{className:`${a.dataHistoryRow} ${u.key==="projectChanges"&&x==="projectChanges"?a.dataHistoryRowExpanded:""}`,children:[e.jsxs("div",{className:a.dataHistoryMain,children:[e.jsx("div",{className:a.dataHistoryTitle,children:u.title}),e.jsx("div",{className:a.dataHistoryDescription,children:u.description})]}),e.jsx(m,{text:u.metricTooltip,children:e.jsx("div",{className:a.dataHistoryMetric,children:u.metric})}),e.jsxs("div",{className:a.dataHistoryActions,children:[e.jsx(m,{text:s("settings.dataHistory.open.tooltip","Open the page that shows this item in detail."),children:e.jsx("a",{className:a.linkButton,href:`#${u.route}`,children:s("settings.dataHistory.open","Open")})}),u.key==="projectChanges"&&e.jsx(m,{text:s("settings.dataHistory.manageStorage.tooltip","Show or hide storage policy and cleanup controls."),children:e.jsxs("button",{className:a.manageStorageButton,type:"button","aria-expanded":x==="projectChanges","aria-controls":"settings-project-changes-storage","aria-label":s("settings.dataHistory.manageStorage.projectChanges.aria","Manage Project change summary storage"),onClick:()=>T("projectChanges"),children:[s("settings.dataHistory.manageStorage","Manage storage"),e.jsx("span",{"aria-hidden":"true",children:x==="projectChanges"?"▴":"▾"})]})}),e.jsx(m,{text:s("settings.dataHistory.clear.tooltip","Delete only the records saved for this item. Roblox Studio data is not changed."),children:e.jsx("button",{className:a.dangerButton,type:"button",disabled:u.key==="projectChanges"&&p===null,onClick:()=>H({kind:"row",row:u}),children:u.key==="projectChanges"?s("settings.dataHistory.clearAll","Clear all"):s("common.clear","Clear")})})]})]}),u.key==="projectChanges"&&E.has("projectChanges")&&e.jsx("div",{id:"settings-project-changes-storage",className:`${a.dataHistoryDetail} ${a.projectChangesDataHistoryDetail}`,hidden:x!=="projectChanges",children:e.jsx(jt,{placeId:p,onChanged:j})})]},u.key)),e.jsxs("div",{className:`${a.dataHistoryRow} ${x==="uiStudio"?a.dataHistoryRowExpanded:""}`,children:[e.jsxs("div",{className:a.dataHistoryMain,children:[e.jsx("div",{className:a.dataHistoryTitle,children:s("settings.dataHistory.uiStudio.title","UI Studio history and screenshots")}),e.jsx("div",{className:a.dataHistoryDescription,children:s("settings.dataHistory.uiStudio.description","Saved UI Studio change records, screenshots, and cleanup policy.")})]}),e.jsx(m,{text:s("settings.dataHistory.uiStudio.metric.tooltip","UI Studio change record and capture counts, plus total disk usage."),children:e.jsx("div",{className:a.dataHistoryMetric,children:vt(s,n)})}),e.jsxs("div",{className:a.dataHistoryActions,children:[e.jsx(m,{text:s("settings.dataHistory.open.tooltip","Open the page that shows this item in detail."),children:e.jsx("a",{className:a.linkButton,href:"#/ui-studio?tab=history",children:s("settings.dataHistory.open","Open")})}),e.jsx(m,{text:s("settings.dataHistory.manageStorage.tooltip","Show or hide storage policy and cleanup controls."),children:e.jsxs("button",{className:a.manageStorageButton,type:"button","aria-expanded":x==="uiStudio","aria-controls":"settings-ui-studio-storage","aria-label":s("settings.dataHistory.manageStorage.uiStudio.aria","Manage UI Studio history and screenshots storage"),onClick:()=>T("uiStudio"),children:[s("settings.dataHistory.manageStorage","Manage storage"),e.jsx("span",{"aria-hidden":"true",children:x==="uiStudio"?"▴":"▾"})]})}),e.jsx(m,{text:s("settings.dataHistory.clear.tooltip","Delete only the records saved for this item. Roblox Studio data is not changed."),children:e.jsx("button",{className:a.dangerButton,type:"button",disabled:!F,onClick:()=>H({kind:"uiStudio"}),children:s("settings.dataHistory.clearAll","Clear all")})})]})]}),E.has("uiStudio")&&e.jsx("div",{id:"settings-ui-studio-storage",className:`${a.dataHistoryDetail} ${a.uiStudioDataHistoryDetail}`,hidden:x!=="uiStudio",children:e.jsx(gt,{placeId:z,tier:t,onChanged:j,embedded:!0,...t==="basic"?{sampleUsage:ae,sampleRetention:Ne}:{}})})]}),$&&e.jsx("p",{className:a.inlineStatus,children:$})]})]}),e.jsx(ce,{open:y!==null,title:c?s("settings.dataHistory.uiStudio.clear.title","Clear UI Studio saved data?"):I?s("settings.dataHistory.projectChanges.clear.title","Clear project change summaries?"):s("settings.dataHistory.clear.title","Clear saved data?"),message:c?s("settings.dataHistory.uiStudio.clear.message","This deletes saved UI Studio change records and screenshots only. Roblox Studio instances and project objects are not changed."):I?s("settings.dataHistory.projectChanges.clear.message","This deletes completed sessions and ended context history for the selected Place. Active work and Roblox Studio project data stay intact."):s("settings.dataHistory.clear.message","This deletes saved dashboard records only. Roblox Studio instances and project objects are not changed."),cancelLabel:s("common.cancel","Cancel"),confirmLabel:I||c?s("settings.dataHistory.clearAll","Clear all"):s("common.clear","Clear"),loading:L,onCancel:()=>!L&&H(null),onConfirm:()=>void B()})]})}const Ct=r.forwardRef(function({autoOpen:s,settingsFilePath:l,saving:d,targeted:i,updateDashboardPreferences:b},n){const{t:g}=X(),[p,_]=r.useState("idle"),v="settings-dashboard-auto-open-label",k=d||p==="saving",P=async x=>{_("saving");try{await b({autoOpen:x}),_("saved")}catch{_("error")}},D=p==="saving"?g("settings.dashboard.autoOpen.saving","Saving…"):p==="saved"?g("settings.dashboard.autoOpen.saved","Saved for the next server start."):p==="error"?g("settings.dashboard.autoOpen.error","Could not save. The previous setting was restored."):" ";return e.jsxs("div",{id:"settings-dashboard",ref:n,tabIndex:-1,"data-testid":"settings-dashboard-card",className:[a.card,a.dashboardCard,i?a.dashboardCardTarget:""].filter(Boolean).join(" "),children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(R,{label:g("settings.dashboard.title","Dashboard"),tooltip:g("settings.dashboard.title.tooltip","Choose how WEPPY Dashboard behaves when the MCP Server starts.")}),e.jsx(m,{text:g("settings.dashboard.autoOpen.nextStart","Applies the next time the MCP Server starts."),children:e.jsx("span",{className:a.headerBadge,children:g("settings.dashboard.nextStartBadge","Next Start")})})]}),e.jsxs("div",{className:a.dashboardSettingRow,children:[e.jsxs("div",{className:a.dashboardSettingCopy,children:[e.jsx("span",{id:v,className:a.dashboardSettingLabel,children:g("settings.dashboard.autoOpen.label","Open Dashboard when WEPPY starts")}),e.jsx("span",{className:a.dashboardSettingDescription,children:g("settings.dashboard.autoOpen.description","Automatically opens this Dashboard after the MCP Server starts.")}),e.jsx("span",{className:a.dashboardSettingMeta,children:g("settings.dashboard.autoOpen.nextStart","Applies the next time the MCP Server starts.")})]}),e.jsxs("label",{className:`${a.toggleSwitch} ${a.dashboardToggleTarget}`,children:[e.jsx("input",{className:a.toggleInput,type:"checkbox",role:"switch","aria-labelledby":v,checked:s,disabled:k,onChange:x=>{P(x.target.checked)}}),e.jsx("span",{className:a.toggleTrack,"aria-hidden":"true",children:e.jsx("span",{className:a.toggleThumb})})]})]}),e.jsxs("dl",{className:a.dashboardDetails,children:[e.jsxs("div",{className:a.dashboardDetailRow,children:[e.jsx("dt",{children:g("settings.dashboard.settingsFile.label","Settings file")}),e.jsx("dd",{children:e.jsx("code",{className:a.dashboardSettingsFilePath,children:l})})]}),e.jsxs("div",{className:a.dashboardDetailRow,children:[e.jsx("dt",{children:g("settings.dashboard.agentExample.label","Ask your Agent")}),e.jsx("dd",{className:a.dashboardAgentPrompt,children:g("settings.dashboard.agentExample.prompt","“Turn off Dashboard auto-open.”")})]})]}),e.jsx("p",{className:`${a.dashboardSaveFeedback} ${p==="error"?a.dashboardSaveFeedbackError:""}`,"aria-live":"polite",children:D})]})}),Nt={en:"English",ko:"한국어",es:"Español","pt-br":"Português (BR)",ja:"日本語",id:"Bahasa Indonesia",de:"Deutsch","fr-fr":"Français"};function _t(t){return t==="active"?a.statusActive:t==="grace"?a.statusGrace:t==="invalid"||t==="revoked"?a.statusError:a.statusInactive}function kt(t){return t?t.refreshBlockedReason==="missing_session_token"?!0:t.status==="active"||t.status==="grace"||t.status==="invalid"||t.status==="revoked"||t.status==="unknown":!1}function Pt(t,s){return t.refreshBlockedReason==="missing_session_token"?{label:s("settings.license.status.activationRequired","Activation Required"),tooltip:s("settings.license.status.activationRequired.tooltip","Manual license activation is required before WEPPY Dashboard can refresh this status."),detail:s("settings.license.detail.missingSessionToken","Refresh is blocked because the current session token is missing."),detailTone:a.licenseNoticeWarning}:t.statusDetail==="active_cancel_pending"?{label:s("settings.license.active","Active"),tooltip:s("settings.license.status.activeCancelPending.tooltip","Cancellation is pending, but Pro access remains active until the current billing period ends."),detail:s("settings.license.detail.cancelPending","Cancellation is scheduled. Pro access remains active until the current billing period ends."),detailTone:a.licenseNoticeInfo}:t.statusDetail==="grace_provider_unavailable"?{label:s("settings.license.status.grace","Grace"),tooltip:s("settings.license.status.grace.tooltip","Provider verification is temporarily unavailable, but Pro access remains active during the grace period."),detail:s("settings.license.detail.graceProviderUnavailable","Provider unavailable. Pro access remains active during grace mode."),detailTone:a.licenseNoticeInfo}:t.statusDetail==="grace_expired"||t.statusDetail==="grace_payment_failed"?{label:s("settings.license.status.grace","Grace"),tooltip:s("settings.license.status.graceBilling.tooltip","Pro access is still available during a billing-related grace period."),detail:s("settings.license.detail.graceBilling","Pro access remains available during a billing grace period."),detailTone:a.licenseNoticeInfo}:{label:s(`settings.license.${t.status}`,t.status),tooltip:s(`settings.license.${t.status}.tooltip`,"Current license activation state."),detail:t.refreshRequired?s("settings.license.detail.refreshRecommended","License verification should be refreshed soon."):null,detailTone:a.licenseNoticeMuted}}function Et(){const{t,selectedLocale:s,setLocale:l}=X(),{trackEvent:d}=le(),{search:i}=ye(),{settings:b,license:n,licenseControlsDisabled:g,licenseSubmitting:p,licenseMessage:_,activateLicense:v,refreshLicense:k,resetLicense:P,saving:D,updateDashboardPreferences:x,loading:f}=ve(),[E,w]=r.useState(""),y=n?Pt(n,t):null,H=kt(n),L=H&&(n==null?void 0:n.refreshBlockedReason)!=="missing_session_token",A=H,$=H?n==null?void 0:n.maskedKey:void 0,N=n!=null&&n.provider&&n.provider!=="auto"?n.provider:void 0,j=(n==null?void 0:n.tier)==="pro"?"pro":"basic",T=r.useRef(null),S=r.useRef(null),B=r.useRef(null),z=r.useMemo(()=>new URLSearchParams(i).get("section")==="license",[i]),F=r.useMemo(()=>new URLSearchParams(i).get("section")==="dashboard",[i]);return r.useEffect(()=>{var I;if(!z||f)return;const c=T.current;if((I=c==null?void 0:c.scrollIntoView)==null||I.call(c,{block:"start",behavior:"smooth"}),B.current&&!B.current.disabled){B.current.focus();return}c==null||c.focus()},[f,g,p,z]),r.useEffect(()=>{var I;if(!F||f)return;const c=S.current;(I=c==null?void 0:c.scrollIntoView)==null||I.call(c,{block:"start",behavior:"smooth"}),c==null||c.focus()},[f,F]),f?e.jsx("div",{className:a.page,children:e.jsx("div",{className:a.loading,children:t("common.loading")})}):e.jsxs("div",{className:a.page,children:[e.jsx(be,{title:t("page.settings.title","Settings"),description:t("page.settings.description","Manage license, saved data, server environment, and language."),helpTopicId:"settings",helpState:{tier:j}}),e.jsxs("div",{id:"settings-license",ref:T,tabIndex:-1,"data-testid":"settings-license-card",className:[a.card,z?a.licenseCardTarget:"",(n==null?void 0:n.tier)==="pro"?a.licenseCardPro:""].filter(Boolean).join(" "),children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(R,{label:t("settings.license.title","License"),tooltip:t("settings.license.title.tooltip","Current license status and subscription tier.")}),e.jsx(m,{text:g?t("settings.license.disconnected.tooltip","Reconnect to the MCP server to manage license actions from WEPPY Dashboard."):t("settings.license.live.tooltip","License actions are sent to the MCP server immediately."),children:e.jsx("span",{className:`${a.headerBadge} ${g?"":a.headerBadgeLive}`,children:g?t("settings.license.disconnected","Disconnected"):t("settings.general.liveApply","Live Apply")})})]}),e.jsxs(e.Fragment,{children:[n?e.jsxs(e.Fragment,{children:[(()=>{const c=y;return e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:a.licenseGrid,children:[e.jsx("dt",{children:e.jsx(R,{label:t("settings.license.status","Status"),tooltip:t("settings.license.status.tooltip","Current license activation state.")})}),e.jsxs("dd",{children:[e.jsx("span",{className:`${a.statusDot} ${_t(n.status)}`}),e.jsx(m,{text:(c==null?void 0:c.tooltip)??t(`settings.license.${n.status}.tooltip`,"Current license activation state."),children:(c==null?void 0:c.label)??t(`settings.license.${n.status}`,n.status)})]}),e.jsx("dt",{children:e.jsx(R,{label:t("settings.license.tier","Tier"),tooltip:t("settings.license.tier.tooltip","Current subscription tier for available WEPPY Dashboard features.")})}),e.jsx("dd",{className:n.tier==="pro"?a.proBadge:"",children:e.jsx(m,{text:t(`tier.${n.tier}.tooltip`,"Available feature set for the connected license."),children:n.tier==="pro"?t("tier.pro","Pro"):t("tier.basic","Basic")})}),$&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(R,{label:t("settings.license.key","Key"),tooltip:t("settings.license.key.tooltip","Masked license key currently loaded by the server.")})}),e.jsx("dd",{children:e.jsx(m,{text:t("settings.license.keyValue.tooltip","Masked license key currently loaded by the server."),children:$})})]}),N&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(R,{label:t("settings.license.provider","Provider"),tooltip:t("settings.license.provider.tooltip","License provider used to validate this key.")})}),e.jsx("dd",{children:e.jsx(m,{text:t("settings.license.providerValue.tooltip","License provider used to validate this key."),children:N})})]})]}),(c==null?void 0:c.detail)&&e.jsx("p",{className:`${a.licenseNotice} ${c.detailTone}`,children:n.refreshBlockedReason==="missing_session_token"?t("settings.license.detail.manualActivation","Manual activation required to restore Pro access."):c.detail}),n.refreshBlockedReason==="missing_session_token"&&e.jsx("p",{className:`${a.licenseNotice} ${a.licenseNoticeMuted}`,children:c==null?void 0:c.detail})]})})(),n.tier==="basic"&&e.jsx(m,{text:t("tier.upgrade.tooltip","View Pro features and purchase options."),children:e.jsx("a",{className:a.upgradeLink,href:je.settingsLicense,target:"_blank",rel:"noopener noreferrer",onClick:()=>d("dashboard_click_event",{click_target:"upgrade_cta",placement:"settings_license",page:"settings"}),children:t("tier.upgrade","View Pro")})})]}):e.jsx("div",{className:a.loading,children:t("settings.license.unavailable")}),e.jsxs("div",{className:a.licenseControls,children:[e.jsxs("div",{className:a.licenseControlRow,children:[e.jsx(m,{text:t("settings.license.refresh.tooltip","Re-fetch the current state from the license server. Useful when a billing change hasn't appeared yet."),children:e.jsx("button",{type:"button",className:a.actionBtn,disabled:g||p||!L,onClick:()=>{k()},children:p?t("common.loading"):t("settings.license.refresh","Refresh License")})}),e.jsx(m,{text:t("settings.license.reset.tooltip","Remove the currently registered license key. Use this before activating with a different key."),children:e.jsx("button",{type:"button",className:a.actionBtn,disabled:g||p||!A,onClick:()=>{P()},children:p?t("common.loading"):t("settings.license.reset","Reset License")})})]}),e.jsxs("div",{className:a.licenseControlRow,children:[e.jsxs("label",{className:`${a.licenseField} ${a.licenseFieldGrow}`,children:[e.jsx("span",{className:a.controlLabel,children:e.jsx(R,{label:t("settings.license.keyInput","License Key"),tooltip:t("settings.license.key.tooltip","Masked license key currently loaded by the server.")})}),e.jsx("input",{ref:B,"aria-label":t("settings.license.keyInput","License Key"),className:a.textInput,type:"text",value:E,disabled:g||p,onChange:c=>w(c.target.value)})]}),e.jsx(m,{text:t("settings.license.activate.tooltip","Activate Pro features with the entered license key."),children:e.jsx("button",{type:"button",className:a.actionBtn,disabled:g||p,onClick:()=>{(async()=>await v(E)&&w(""))()},children:p?t("common.loading"):t("settings.license.activate","Activate License")})})]}),_&&e.jsx("p",{className:a.licenseMessage,children:_})]})]})]}),e.jsx(St,{tier:j}),b&&e.jsx(Ct,{ref:S,autoOpen:b.dashboard.autoOpen,settingsFilePath:b.dashboard.settingsFilePath,saving:D,targeted:F,updateDashboardPreferences:x}),e.jsxs("div",{className:a.card,children:[e.jsxs("div",{className:a.cardHeader,children:[e.jsx(R,{label:t("settings.cold.title","Server Environment"),tooltip:t("settings.cold.title.tooltip","Read-only server environment values loaded at startup.")}),e.jsx(m,{text:t("settings.readOnly.tooltip","This section shows values that cannot be edited from WEPPY Dashboard."),children:e.jsx("span",{className:a.headerBadge,children:t("settings.readOnly","Read-only")})})]}),b?e.jsxs(e.Fragment,{children:[e.jsxs("dl",{className:a.coldGrid,children:[e.jsx("dt",{children:e.jsx(R,{label:"HTTP_PORT",tooltip:t("settings.cold.httpPort.tooltip","Port number used by the MCP WEPPY Dashboard HTTP server.")})}),e.jsx("dd",{children:b.cold.HTTP_PORT}),e.jsx("dt",{children:e.jsx(R,{label:"HTTP_HOST",tooltip:t("settings.cold.httpHost.tooltip","Host interface that the MCP WEPPY Dashboard HTTP server binds to.")})}),e.jsx("dd",{children:b.cold.HTTP_HOST})]}),e.jsx("p",{className:a.coldHint,children:t("settings.cold.hint","Set via environment variables to change these values.")})]}):e.jsx("div",{className:a.loading,children:t("settings.unavailable")})]}),e.jsxs("div",{className:a.card,children:[e.jsx("div",{className:a.cardHeader,children:e.jsx(R,{label:t("settings.language.title","Language"),tooltip:t("settings.language.title.tooltip","Choose how the WEPPY Dashboard interface text is localized.")})}),e.jsxs("div",{className:a.langRow,children:[e.jsx("label",{children:e.jsx(R,{label:t("settings.language.dashboard","WEPPY Dashboard Language"),tooltip:t("settings.language.dashboard.tooltip","Overrides the WEPPY Dashboard language or follows the system language when set to Auto.")})}),e.jsx(m,{text:t("settings.language.auto.tooltip","Follow the operating system's language. Falls back to English when not supported."),children:e.jsxs("select",{className:a.select,value:s,onChange:c=>l(c.target.value),children:[e.jsx("option",{value:xe,children:t("settings.language.auto","Auto")}),fe.map(c=>e.jsx("option",{value:c,children:Nt[c]??c},c))]})})]})]})]})}export{Et as Component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r,a as I,m as A,D as V,e as H,d as W,n as q,j as e,u as M,f as G,h as z,l as Y,T as K}from"./index-Dj2NvZgn.js";import{P as J}from"./PageHeader-CDCcXu8v.js";import{I as L}from"./InfoLabel-CI6bHOeU.js";import{T as S}from"./TooltipText-d7cAgyJE.js";import{C as F}from"./ConfirmModal-BCthkdVV.js";import{C as E}from"./CurrentPlaceScope-CMhgXKOx.js";import{S as Q}from"./StatusBadge-PkthVJ8-.js";import{B as R,a as B}from"./UiPrimitive-BTuxHpyB.js";import"./ConfirmModal.module-DJksQHBd.js";const X=5e3;function Z(){const[t,s]=r.useState(null),[c,a]=r.useState([]),[x,y]=r.useState(!0),[d,f]=r.useState(null),[h,j]=r.useState(null),[n,u]=r.useState({report:null,loading:!1,applying:!1,error:null}),k=r.useRef(null),N=r.useRef(null),v=r.useCallback(async()=>{var p;try{const[l,g]=await Promise.all([I.get("/sync/status"),I.get("/api/dashboard/place-summary")]);s(l);const D=(p=g.places)==null?void 0:p.find(U=>U.isActive);return f((D==null?void 0:D.placeDirName)??null),j(g.activePlaceId),g.activePlaceId}catch{return null}},[]),T=r.useCallback(async()=>{try{const p=await I.get("/sync/history",{limit:"30"});a(p.entries??[])}catch{a([])}},[]),o=r.useCallback(async p=>{if(p===null){u({report:null,loading:!1,applying:!1,error:null});return}u(l=>({...l,loading:!0,error:null}));try{const l=await I.get("/api/sync/migration",{placeId:String(p)});u(g=>({...g,report:l,loading:!1,error:l.status==="blocked"?"migration_blocked":null}))}catch(l){if(l instanceof A&&(l.status===404||l.status===503)){u(g=>({...g,report:null,loading:!1,error:null}));return}u(g=>({...g,loading:!1,error:"unknown"}))}},[]),_=r.useCallback(async()=>{const[p]=await Promise.all([v(),T()]);await o(p),y(!1)},[v,T,o]),P=r.useCallback(()=>{_()},[_]),C=r.useCallback(async()=>{await o(h)},[h,o]),m=r.useCallback(async()=>{const p=n.report;if(!(!p||p.status!=="ready"||n.applying)){u(l=>({...l,applying:!0,error:null}));try{const l=await I.post("/api/sync/migration",{placeId:p.placeId,fromVersion:2,previewFingerprint:p.previewFingerprint,apply:!0});u({report:l,loading:!1,applying:!1,error:null}),await v()}catch(l){if(l instanceof A&&l.status===409&&(l.error==="preview_stale"||l.error==="migration_blocked")){const g=l.error;await o(p.placeId),u(D=>({...D,applying:!1,error:g}));return}u(g=>({...g,applying:!1,error:"unknown"}))}}},[o,v,n.applying,n.report]),b=r.useCallback(async()=>{await I.post("/api/dashboard/sync/history/clear"),a([]),v()},[v]);return r.useEffect(()=>(_(),N.current=setInterval(_,X),()=>{N.current&&clearInterval(N.current)}),[_]),r.useEffect(()=>{const p=new V;k.current=p,p.connect();const l=p.on("sync",()=>{_()});return()=>{l(),p.disconnect(),k.current=null}},[_]),{status:t,history:c,loading:x,activePlaceDirName:d,migration:n,refresh:P,refreshMigration:C,applyMigration:m,clearHistory:b}}const ee="_actions_1j3p3_60",te="_btn_1j3p3_68",ie="_btnPrimary_1j3p3_99",oe="_panel_1j3p3_109",ae="_panelIcon_1j3p3_116",se="_panelTitle_1j3p3_122",ne="_panelDesc_1j3p3_131",ce="_benefitList_1j3p3_139",le="_benefitItem_1j3p3_148",w={actions:ee,btn:te,btnPrimary:ie,panel:oe,panelIcon:ae,panelTitle:se,panelDesc:ne,benefitList:ce,benefitItem:le};function re({icon:t,title:s,description:c,benefits:a,upgradeLabel:x,upgradeHref:y}){const{trackEvent:d}=H(),{pathname:f,search:h}=W(),j=q(f,h);return e.jsxs("div",{className:w.panel,children:[t&&e.jsx("div",{className:w.panelIcon,children:t}),e.jsx("div",{className:w.panelTitle,children:s}),e.jsx("div",{className:w.panelDesc,children:c}),e.jsx("ul",{className:w.benefitList,children:a.map(n=>e.jsx("li",{className:w.benefitItem,children:n},n))}),e.jsx("div",{className:w.actions,children:e.jsx("a",{className:`${w.btn} ${w.btnPrimary}`,href:y,target:"_blank",rel:"noreferrer",onClick:()=>d("dashboard_click_event",{click_target:"upgrade_cta",placement:"tier_panel",...j}),children:x})})]})}const pe="_page_1o0wf_2",de="_card_1o0wf_10",ye="_cardHeader_1o0wf_17",me="_clearButton_1o0wf_29",ue="_statusRow_1o0wf_53",ge="_metaItem_1o0wf_60",fe="_statusGrid_1o0wf_66",he="_migrationPanel_1o0wf_85",_e="_migrationHeader_1o0wf_92",xe="_migrationTitle_1o0wf_99",we="_migrationDescription_1o0wf_108",je="_migrationLedger_1o0wf_116",ve="_migrationLedgerItem_1o0wf_123",Se="_migrationLedgerBlocked_1o0wf_148",be="_migrationSection_1o0wf_152",Ne="_migrationList_1o0wf_166",Ie="_migrationRow_1o0wf_176",Le="_migrationOperation_1o0wf_189",Te="_migrationRowBody_1o0wf_194",De="_migrationNotice_1o0wf_215",Re="_migrationActions_1o0wf_222",ke="_migrationButton_1o0wf_228",Pe="_policySummary_1o0wf_265",Ce="_policySummaryItem_1o0wf_276",Ae="_policyPrimaryValue_1o0wf_301",Ee="_policyReviewNotice_1o0wf_307",Be="_policyApplySection_1o0wf_318",$e="_policyApplyHeader_1o0wf_322",Oe="_policyApplyTitle_1o0wf_326",He="_policyApplyDescription_1o0wf_334",Me="_policyInfoLabel_1o0wf_342",Fe="_policySafetyRow_1o0wf_353",Ue="_policySafetyLabel_1o0wf_365",Ve="_policySafetyBadge_1o0wf_371",We="_policyDisclosure_1o0wf_375",qe="_policyDisclosureIcon_1o0wf_407",Ge="_policyDisclosureIconOpen_1o0wf_414",ze="_policyScopeList_1o0wf_418",Ye="_policyScopeRow_1o0wf_425",Ke="_policyScopeName_1o0wf_439",Je="_policyDirectionRail_1o0wf_451",Qe="_policyDirectionEndpoint_1o0wf_467",Xe="_policyDirectionEndpointStudio_1o0wf_474",Ze="_policyDirectionArrow_1o0wf_478",et="_forwardBadge_1o0wf_521",tt="_logContainer_1o0wf_536",it="_logEntry_1o0wf_543",ot="_logTime_1o0wf_555",at="_logType_1o0wf_561",st="_logTypeWrite_1o0wf_570",nt="_logTypeUpdate_1o0wf_574",ct="_logTypeDelete_1o0wf_578",lt="_logTypeIdle_1o0wf_582",rt="_logPath_1o0wf_586",pt="_logEmpty_1o0wf_593",dt="_overlay_1o0wf_600",yt="_overlayTitle_1o0wf_610",mt="_overlayMessage_1o0wf_617",ut="_checklist_1o0wf_623",gt="_checkItem_1o0wf_633",i={page:pe,card:de,cardHeader:ye,clearButton:me,statusRow:ue,metaItem:ge,statusGrid:fe,migrationPanel:he,migrationHeader:_e,migrationTitle:xe,migrationDescription:we,migrationLedger:je,migrationLedgerItem:ve,migrationLedgerBlocked:Se,migrationSection:be,migrationList:Ne,migrationRow:Ie,migrationOperation:Le,migrationRowBody:Te,migrationNotice:De,migrationActions:Re,migrationButton:ke,policySummary:Pe,policySummaryItem:Ce,policyPrimaryValue:Ae,policyReviewNotice:Ee,policyApplySection:Be,policyApplyHeader:$e,policyApplyTitle:Oe,policyApplyDescription:He,policyInfoLabel:Me,policySafetyRow:Fe,policySafetyLabel:Ue,policySafetyBadge:Ve,policyDisclosure:We,policyDisclosureIcon:qe,policyDisclosureIconOpen:Ge,policyScopeList:ze,policyScopeRow:Ye,policyScopeName:Ke,policyDirectionRail:Je,policyDirectionEndpoint:Qe,policyDirectionEndpointStudio:Xe,policyDirectionArrow:Ze,forwardBadge:et,logContainer:tt,logEntry:it,logTime:ot,logType:at,logTypeWrite:st,logTypeUpdate:nt,logTypeDelete:ct,logTypeIdle:lt,logPath:rt,logEmpty:pt,overlay:dt,overlayTitle:yt,overlayMessage:mt,checklist:ut,checkItem:gt};function ft(t){return t==="add"?"success":t==="delete"?"danger":"accent"}function ht(t){return`sync.migration.reason.${t}`}function _t(t){return`sync.migration.reason.${t}`}function xt({migration:t,onRefresh:s,onApply:c}){const{t:a}=M(),[x,y]=r.useState(!1),d=t==null?void 0:t.report;if(!t||!d||d.status==="not_required")return null;const f=d.status==="blocked",h=d.status==="ready"&&!t.loading&&!t.applying,j=async()=>{await c(),y(!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:d.summary.add})]}),e.jsxs("div",{className:i.migrationLedgerItem,children:[e.jsx("span",{children:a("sync.migration.summary.modify","Modify")}),e.jsx("strong",{children:d.summary.modify})]}),e.jsxs("div",{className:i.migrationLedgerItem,children:[e.jsx("span",{children:a("sync.migration.summary.delete","Delete")}),e.jsx("strong",{children:d.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:d.summary.blocked})]})]}),d.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:d.changes.map(n=>e.jsxs("li",{className:i.migrationRow,children:[e.jsx(R,{variant:ft(n.operation),className:i.migrationOperation,children:a(`sync.migration.operation.${n.operation}`,n.operation)}),e.jsxs("div",{className:i.migrationRowBody,children:[e.jsx("code",{children:n.path}),e.jsx("span",{children:a(ht(n.reason),n.reason.replace(/_/g," "))})]})]},`${n.operation}:${n.path}`))})]}),d.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:d.blockers.map((n,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:[n.path&&e.jsx("code",{children:n.path}),e.jsx("span",{children:a(_t(n.reason),n.reason.replace(/_/g," "))})]})]},`${n.reason}:${n.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(B,{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(B,{variant:"primary",className:i.migrationButton,disabled:!h,onClick:()=>y(!0),children:t.applying?a("sync.migration.applying","Applying…"):a("sync.migration.apply","Apply update")})]}),e.jsx(F,{open:x,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&&y(!1),onConfirm:()=>void j()})]})}const wt=["scriptSource","properties","structure","serviceProperties"];function jt(t){const s=new Date(t);return`${String(s.getHours()).padStart(2,"0")}:${String(s.getMinutes()).padStart(2,"0")}`}function vt(t){switch(t){case"write":return i.logTypeWrite;case"update":return i.logTypeUpdate;case"delete":return i.logTypeDelete;default:return i.logTypeIdle}}function St(t){switch(t){case"syncing":return"syncing";case"initializing":return"initializing";case"idle":return"idle";default:return"offline"}}function bt(t,s){const c={studio_first:"Studio First",bidirectional_review:"Bidirectional",local_code_studio_world:"Local Code, Studio World",custom:"Custom"};return t(`sync.policy.preset.${s}`,c[s])}function $(t,s){return s==="auto"?t("sync.policy.apply.auto","Auto apply"):t("sync.policy.apply.manual","Review first")}function Nt(t,s){const c={forward:"Studio → Local",reverse:"Local → Studio",bidirectional:"Both ways"};return t(`sync.policy.direction.${s}`,c[s])}function It(t){return{forward:"←",reverse:"→",bidirectional:"⇄"}[t]}function Lt(t,s){const c={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`,c[s])}function O(...t){const s=t[0]??"",c=s.includes("\\")&&!s.includes("/")?"\\":"/";return t.filter(a=>a.length>0).map((a,x)=>x===0?a.replace(/[\\/]+$/g,""):a.replace(/^[\\/]+|[\\/]+$/g,"")).join(c)}function Tt(t){const s=t.replace(/[\\/]+$/g,""),c=s.split(/[\\/]+/);return c[c.length-1]??s}function Dt(t,s){const c=Tt(t);return c==="explorer"?t:c===s?O(t,"explorer"):O(t,s,"explorer")}function Rt(t,s){return s?t("sync.policy.safety.auto","Auto delete to Studio"):t("sync.policy.safety.review","Review before delete")}function kt(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 Pt(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 Ct(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 Vt(){const{t}=M(),{trackEvent:s}=H(),{level:c}=G(),{tier:a,loading:x}=z(),y=Z(),{show:d}=Y(),[f,h]=r.useState(!1),[j,n]=r.useState(!1),[u,k]=r.useState(!1),N=!x&&a==="basic",v=c==="disconnected"||c==="serverOnly",T=e.jsx(J,{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:c,tier:a}});if(v)return e.jsxs("div",{className:i.page,children:[T,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=y.status,_=y.history,P=St(o==null?void 0:o.state),C=async()=>{n(!0);try{await y.clearHistory(),d(t("toast.clearSuccess","Cleared successfully"),"success"),h(!1)}catch{d(t("toast.clearFailed","Failed to clear data"),"error")}finally{n(!1)}};return e.jsxs("div",{className:i.page,children:[T,e.jsx(E,{surface:"sync"}),e.jsxs("div",{className:i.card,children:[e.jsxs("div",{className:i.cardHeader,children:[e.jsx(S,{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(S,{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(Q,{status:P}),(o==null?void 0:o.placeName)&&e.jsxs("span",{className:i.metaItem,children:[e.jsx(L,{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(L,{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})]}),y.activePlaceDirName&&(o==null?void 0:o.syncRoot)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(L,{label:t("sync.status.placePath","Explorer Path"),tooltip:t("sync.status.placePath.tooltip","Explorer files path for the active place.")})}),e.jsx("dd",{children:Dt(o.syncRoot,y.activePlaceDirName)})]}),(o==null?void 0:o.instanceCount)!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(L,{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(L,{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(L,{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(xt,{migration:y.migration,onRefresh:y.refreshMigration,onApply:y.applyMigration}),(o==null?void 0:o.policy)&&e.jsxs("div",{className:i.card,children:[e.jsx("div",{className:i.cardHeader,children:e.jsx(S,{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:bt(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(S,{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:$(t,o.policy.apply.contentChanges)})]}),e.jsxs("div",{className:i.policySummaryItem,children:[e.jsx("dt",{children:e.jsx(S,{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:$(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(S,{text:kt(t,o.policy.autoApplyLocalDeletesToStudio),children:e.jsx(R,{variant:o.policy.autoApplyLocalDeletesToStudio?"warning":"neutral",className:i.policySafetyBadge,tabIndex:0,children:Rt(t,o.policy.autoApplyLocalDeletesToStudio)})})]})]}),e.jsxs("button",{type:"button",className:i.policyDisclosure,"aria-expanded":u,"aria-controls":"sync-policy-scope-panel",onClick:()=>k(m=>!m),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:wt.map(m=>{const b=o.policy.directions[m];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.${m}`,m)}),e.jsx(S,{text:Lt(t,b),children:e.jsxs("span",{className:i.policyDirectionRail,"data-testid":"sync-policy-direction-rail",role:"img","aria-label":Nt(t,b),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:It(b)}),e.jsx("span",{className:`${i.policyDirectionEndpoint} ${i.policyDirectionEndpointStudio}`,children:t("sync.policy.endpoint.studio","Studio")})]})})]},m)})})]}),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"}),h(!0)},children:t("common.clear","Clear")})]}),e.jsx("div",{className:i.logContainer,children:_.length===0?e.jsx("div",{className:i.logEmpty,children:t("sync.log.empty","No sync events yet")}):_.map((m,b)=>e.jsxs("div",{className:i.logEntry,children:[e.jsx("span",{className:i.logTime,children:jt(m.timestamp)}),e.jsx(S,{text:Ct(t,m.type),children:e.jsx("span",{className:`${i.logType} ${vt(m.type)}`,children:Pt(t,m.type)})}),e.jsxs("span",{className:i.logPath,children:[m.path,m.details?` — ${m.details}`:""]})]},b))})]}),N&&e.jsx(re,{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:K.sync}),e.jsx(F,{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:j,onCancel:()=>!j&&h(!1),onConfirm:C})]})}export{Vt as Component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e,r as i,a as I,D as ht,u as at,X as mt,e as bt,l as gt}from"./index-Dj2NvZgn.js";import{P as xt}from"./PageHeader-CDCcXu8v.js";import{T as M}from"./TooltipText-d7cAgyJE.js";import{C as ft}from"./ConfirmModal-BCthkdVV.js";import{C as _t}from"./ContentScopedDialog-Be71g2ql.js";import{C as yt}from"./CurrentPlaceScope-CMhgXKOx.js";import{T as Ct}from"./Tabs-PO1vvwQv.js";import"./UiPrimitive-BTuxHpyB.js";import"./ConfirmModal.module-DJksQHBd.js";const jt="_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:jt,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 j=N?N(h):String(w);return e.jsx("tr",{className:l?A.clickable:void 0,tabIndex:l?-1:void 0,onClick:l?f=>l(h,f.currentTarget):void 0,children:t.map(f=>e.jsx("td",{children:f.render?f.render(h):String(h[f.key]??"")},f.key))},j)})})]})})}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),[j,f]=i.useState(!1),[U,O]=i.useState(!0),[m,E]=i.useState(0),[_,F]=i.useState(""),B=i.useRef(null),k=i.useCallback(async()=>{l(!0);try{const y=Pt(o),u=y?await I.get("/api/dashboard/tool-stats",y):await I.get("/api/dashboard/tool-stats");T(u)}catch{}finally{l(!1)}},[o]),g=i.useCallback(async(y,u)=>{O(!0);try{const P={limit:String(Bt),offset:String(y)};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),f(H.hasMore)}catch{S([]),w(0),f(!1)}finally{O(!1)}},[o]),D=i.useCallback(()=>{k(),g(m,_)},[g,k,m,_]),V=i.useCallback(async()=>{await I.post(Y("/api/dashboard/tools/history/clear",o)),g(m,_)},[g,m,_,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(()=>{g(m,_)},[g,m,_]),i.useEffect(()=>{const y=new ht;B.current=y,y.connect();const u=y.on("command",()=>{k(),g(m,_)});return()=>{u(),y.disconnect(),B.current=null}},[g,k,m,_]),{statistics:c,statsLoading:b,history:N,historyTotal:h,historyHasMore:j,historyLoading:U,historyOffset:m,historyToolFilter:_,setHistoryOffset:E,setHistoryToolFilter:F,refresh:D,clearHistory:V,clearStatistics:K}}const Et="_page_d8s7g_2",Ht="_card_d8s7g_14",At="_cardToolbar_d8s7g_21",Rt="_sectionTitle_d8s7g_29",It="_dangerButton_d8s7g_35",Ot="_proBadge_d8s7g_54",Ft="_statusOk_d8s7g_69",Dt="_statusFallback_d8s7g_82",$t="_statusUnsupported_d8s7g_95",qt="_statusWarning_d8s7g_108",Wt="_statusError_d8s7g_121",Ut="_tierBasic_d8s7g_135",Vt="_tierPro_d8s7g_139",Kt="_tierMixed_d8s7g_144",Gt="_filterRow_d8s7g_155",zt="_filterLabel_d8s7g_162",Jt="_filterSelect_d8s7g_171",Qt="_detailsButton_d8s7g_186",Zt="_detailShell_d8s7g_209",Xt="_detailHeader_d8s7g_217",Yt="_detailHeading_d8s7g_228",te="_detailTitle_d8s7g_235",ee="_detailRecordName_d8s7g_242",se="_detailHeaderActions_d8s7g_251",ae="_detailCloseButton_d8s7g_258",oe="_detailBody_d8s7g_281",le="_detailSection_d8s7g_293",re="_detailList_d8s7g_312",ie="_detailItem_d8s7g_318",ne="_detailLabel_d8s7g_325",ce="_detailValue_d8s7g_330",de="_pre_d8s7g_336",ue="_pagination_d8s7g_354",pe="_pageInfo_d8s7g_362",he="_btn_d8s7g_368",me="_tierDistribution_d8s7g_396",be="_tierBarWrap_d8s7g_400",ge="_tierBarBasic_d8s7g_408",xe="_tierBarPro_d8s7g_413",fe="_tierLabels_d8s7g_418",_e="_statsTableWrap_d8s7g_427",ye="_statsTable_d8s7g_427",Ce="_sortableHeader_d8s7g_459",je="_sortArrow_d8s7g_464",Te="_statsToolRow_d8s7g_468",ke="_statsActionRow_d8s7g_476",Ne="_expandButton_d8s7g_480",Se="_expandIcon_d8s7g_492",we="_actionLabel_d8s7g_497",ve="_emptyStats_d8s7g_504",Me="_summaryLine_d8s7g_510",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:ge,tierBarPro:xe,tierLabels:fe,statsTableWrap:_e,statsTable:ye,sortableHeader:Ce,sortArrow:je,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 C(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:[C(c("tools.history.routing.mode","Mode"),l.selectionMode),C(c("tools.history.routing.requested","Requested"),Ae(l,c)),C(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?C(c("tools.detail.requestedCommand","Requested Command"),b.requestedCommand):null,t.status==="fallback"&&b.executedCommand?C(c("tools.detail.executedCommand","Executed Command"),b.executedCommand):null,t.status==="fallback"&&b.alternatives?C(c("tools.detail.alternatives","Alternatives"),b.alternatives.join(", ")):null,t.status==="unsupported"&&t.blockedMessage?C(c("tools.detail.blockedMessage","Blocked Reason"),t.blockedMessage):null,t.status==="unsupported"?C(c("tools.detail.noFallback","No Fallback"),c("tools.detail.noFallback.value","No fallback ran.")):null,t.status==="warning"&&t.warningMessage?C(c("tools.detail.warningMessage","Warning Message"),t.warningMessage):null,t.status==="error"&&t.errorMessage?C(c("tools.detail.errorMessage","Error Message"),t.errorMessage):null,t.status==="error"&&t.blockedMessage?C(c("tools.detail.blockedMessage","Blocked Reason"),t.blockedMessage):null,t.status==="error"&&t.fallbackCommand?C(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 Je(){const{t}=at(),{trackEvent:o,trackPageView:c}=bt(),[T,b]=i.useState(null),l=Lt({placeId:T}),{show:N}=gt(),[S,h]=i.useState("history"),[w,j]=i.useState(null),f=i.useRef(null),[U,O]=i.useState(null),[m,E]=i.useState(null),[_,F]=i.useState(!1),[B,k]=i.useState("totalCalls"),[g,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]),y=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})),x=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:x,successCount:v,fallbackCount:$,unsupportedCount:q,warningCount:dt,failureCount:ut,totalExecutionTimeMs:Z,avgExecutionTimeMs:x>0?Math.round(Z/x):0}}):[]},[l.statistics]),u=i.useCallback((s,n,r,x)=>e.jsx(M,{text:t(r,x),children:t(s,n)}),[t]),P=i.useCallback((s,n)=>{f.current=n,j(s)},[]),H=i.useCallback(()=>{j(null)},[]),z=i.useMemo(()=>[...y].sort((n,r)=>{const x=n[B],v=r[B];if(typeof x=="number"&&typeof v=="number")return g==="asc"?x-v:v-x;const $=String(x??""),q=String(v??"");return g==="asc"?$.localeCompare(q):q.localeCompare($)}),[y,B,g]),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 x=Math.round(s/r*100),v=100-x;return{basic:s,pro:n,basicPct:x,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}),j(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(xt,{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=>{j(null),b(s),l.setHistoryOffset(0)}}),e.jsx(Ct,{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=>{j(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:()=>{j(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:()=>{j(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:g==="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(_t,{open:w!==null,ariaLabel:t("tools.detail.dialogLabel","Tool execution detail"),onClose:H,returnFocusTo:f.current,testId:"tools-history-detail-popup-layer",children:w&&e.jsx(Ie,{entry:w,onClose:H})}),e.jsx(ft,{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:_,onCancel:()=>!_&&E(null),onConfirm:it})]})}export{Je as Component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,j as r}from"./index-Dj2NvZgn.js";const i="_button_vab4n_1",d="_iconButton_vab4n_2",v="_checkboxInput_vab4n_26",m="_button_sm_vab4n_37",p="_button_md_vab4n_42",l="_primary_vab4n_47",f="_secondary_vab4n_58",B="_ghost_vab4n_69",x="_danger_vab4n_81",g="_iconButton_sm_vab4n_104",y="_iconButton_md_vab4n_109",h="_badge_vab4n_114",j="_pill_vab4n_133",k="_interactive_vab4n_137",w="_neutral_vab4n_151",I="_accent_vab4n_157",R="_success_vab4n_163",N="_warning_vab4n_169",C="_info_vab4n_175",E="_error_vab4n_181",$="_pro_vab4n_193",n={button:i,iconButton:d,checkboxInput:v,button_sm:m,button_md:p,primary:l,secondary:f,ghost:B,danger:x,iconButton_sm:g,iconButton_md:y,badge:h,pill:j,interactive:k,neutral:w,accent:I,success:R,warning:N,info:C,error:E,pro:$};function u(...a){return a.filter(Boolean).join(" ")}const z=e.forwardRef(function({variant:t="secondary",size:_="md",className:o,type:c="button",...s},b){return r.jsx("button",{ref:b,type:c,className:u(n.button,n[t],n[`button_${_}`],o),...s})}),A=e.forwardRef(function({size:t="md",className:_,type:o="button",...c},s){return r.jsx("button",{ref:s,type:o,className:u(n.iconButton,n[`iconButton_${t}`],_),...c})}),D=e.forwardRef(function({variant:t="neutral",shape:_="square",interactive:o=!1,className:c,...s},b){return r.jsx("span",{ref:b,className:u(n.badge,n[t],_==="pill"&&n.pill,o&&n.interactive,c),...s})}),F=e.forwardRef(function({className:t,type:_,...o},c){return r.jsx("input",{ref:c,type:"checkbox",className:u(n.checkboxInput,t),...o})});export{D as B,F as C,A as I,z as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as y,j as e,L as j,J as b,r as g,K as N}from"./index-Dj2NvZgn.js";import{P as f}from"./PageHeader-CDCcXu8v.js";import"./UiPrimitive-BTuxHpyB.js";const k="_card_1b5wm_2",C="_cardUnread_1b5wm_15",R="_cardRead_1b5wm_20",v="_cardUnreadWarning_1b5wm_25",L="_topRow_1b5wm_32",T="_categoryChip_1b5wm_39",B="_versionChip_1b5wm_52",U="_importantBadge_1b5wm_64",S="_date_1b5wm_77",A="_title_1b5wm_85",E="_body_1b5wm_94",W="_linkList_1b5wm_102",$="_link_1b5wm_102",M="_internalLink_1b5wm_124",I="_newBadge_1b5wm_146",a={card:k,cardUnread:C,cardRead:R,cardUnreadWarning:v,topRow:L,categoryChip:T,versionChip:B,importantBadge:U,date:S,title:A,body:E,linkList:W,link:$,internalLink:M,newBadge:I},P={release:"whatsNew.category.release",notice:"whatsNew.category.notice",deprecation:"whatsNew.category.deprecation",tip:"whatsNew.category.tip"};function x({announcement:t,isNew:c}){const{locale:o,t:r}=y(),d=c?a.cardUnread:a.cardRead,l=t.severity==="warning",h=l&&c?a.cardUnreadWarning:"",m=t.title[o]??t.title.en,w=t.body[o]??t.body.en,_=t.links??(t.link?[t.link]:[]),p=s=>typeof s=="string"?s:s[o]??s.en;return e.jsxs("div",{className:`${a.card} ${d} ${h}`,children:[e.jsxs("div",{className:a.topRow,children:[e.jsx("span",{className:a.categoryChip,children:r(P[t.category])}),l&&e.jsx("span",{className:a.importantBadge,children:r("whatsNew.importantBadge","IMPORTANT")}),t.version&&e.jsx("span",{className:a.versionChip,children:t.version}),c&&e.jsx("span",{className:a.newBadge,children:r("whatsNew.newBadge","NEW")}),e.jsx("span",{className:a.date,children:t.date})]}),e.jsx("h3",{className:a.title,children:m}),e.jsx("p",{className:a.body,children:w}),_.length>0&&e.jsx("div",{className:a.linkList,children:_.map(s=>{const i=p(s.url),u=p(s.label);return i.startsWith("/")?e.jsx(j,{className:`${a.link} ${a.internalLink}`,to:i,children:u},i):e.jsxs("a",{className:a.link,href:i,target:"_blank",rel:"noopener noreferrer",children:["↗"," ",u]},i)})})]})}const z="_page_1talg_2",O="_section_1talg_10",H="_sectionTitle_1talg_16",K="_unreadCount_1talg_28",Y="_empty_1talg_43",G="_divider_1talg_51",n={page:z,section:O,sectionTitle:H,unreadCount:K,empty:Y,divider:G};function F(){const{t}=y(),{readSet:c,markRead:o}=b(),r=g.useMemo(()=>{const s=[];for(const i of N)c.has(i.id)||s.push(i.id);return s},[]),d=g.useRef(r);d.current=r,g.useEffect(()=>()=>{d.current.length>0&&o(d.current)},[]);const l=g.useMemo(()=>new Set(r),[r]),h=N.filter(s=>l.has(s.id)),m=N.filter(s=>!l.has(s.id)),w=h.length>0,_=m.length>0,p=e.jsx(f,{title:t("whatsNew.pageTitle","What's New"),description:t("whatsNew.pageSubtitle","Stay up to date with MCP changes"),helpTopicId:"whatsNew"});return N.length===0?e.jsxs("div",{className:n.page,children:[p,e.jsx("p",{className:n.empty,children:t("whatsNew.empty","No announcements yet")})]}):e.jsxs("div",{className:n.page,children:[p,w&&e.jsxs("section",{className:n.section,children:[e.jsxs("h2",{className:n.sectionTitle,children:[t("whatsNew.unreadSection","Unread"),e.jsx("span",{className:n.unreadCount,children:h.length})]}),h.map(s=>e.jsx(x,{announcement:s,isNew:!0},`unread-${s.id}`))]}),w&&_&&e.jsx("hr",{className:n.divider}),_&&e.jsxs("section",{className:n.section,children:[e.jsx("h2",{className:n.sectionTitle,children:t("whatsNew.allSection","All Announcements")}),m.map(s=>e.jsx(x,{announcement:s,isNew:!1},`all-${s.id}`))]})]})}export{F as Component};
|