@weppy/roblox-mcp 2.17.9 → 2.17.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +14 -5
- package/dashboard/dist/assets/{AiPromptExamples-BpV5YtwH.js → AiPromptExamples-BSFrFYar.js} +1 -1
- package/dashboard/dist/assets/{AssetsPage-CBkKW012.js → AssetsPage-Bt9gZnJ_.js} +1 -1
- package/dashboard/dist/assets/ChangelogPage-C4tBBoXT.js +1 -0
- package/dashboard/dist/assets/{ConfirmModal-DD79xiWf.js → ConfirmModal-BbqpSaVw.js} +1 -1
- package/dashboard/dist/assets/ConnectionPage-BStKoHK8.css +1 -0
- package/dashboard/dist/assets/ConnectionPage-Sy7xUWtJ.js +6 -0
- package/dashboard/dist/assets/{ControlsPage-BxQAO5lE.js → ControlsPage-ECpr55X_.js} +1 -1
- package/dashboard/dist/assets/{GameChangeDetail-pof3XQ18.js → GameChangeDetail-DJ0xywJq.js} +1 -1
- package/dashboard/dist/assets/InfoLabel-DAd1I756.js +1 -0
- package/dashboard/dist/assets/OverviewPage-C2xJb1Wf.js +1 -0
- package/dashboard/dist/assets/{PageHeader-DUbueTLC.js → PageHeader-_z4Dtkbg.js} +1 -1
- package/dashboard/dist/assets/{PlaceSelectOptions-KRG4cS5y.js → PlaceSelectOptions-Dd_m61bQ.js} +1 -1
- package/dashboard/dist/assets/{PlaytestAiPromptExamples-BQ80VdK6.js → PlaytestAiPromptExamples-CNe0qWb1.js} +1 -1
- package/dashboard/dist/assets/{PlaytestPage-DNxnroWr.js → PlaytestPage-DZa14JH0.js} +18 -23
- package/dashboard/dist/assets/{SettingsPage-3tKUev9_.js → SettingsPage-BiDPnuz8.js} +1 -1
- package/dashboard/dist/assets/SyncPage-BIm9tW0s.css +1 -0
- package/dashboard/dist/assets/SyncPage-EcDvwdB8.js +1 -0
- package/dashboard/dist/assets/Tabs-BoD1I6c5.js +1 -0
- package/dashboard/dist/assets/{CurrentPlaceScope-B6NllTmu.css → Tabs-Ci4-OJm-.css} +1 -1
- package/dashboard/dist/assets/{TierPromoPanel-D_H_UgF4.js → TierPromoPanel-CQQdO5mK.js} +1 -1
- package/dashboard/dist/assets/ToolsPage-D7ovZ3QM.js +1 -0
- package/dashboard/dist/assets/TooltipText-NA7u0bu6.js +1 -0
- package/dashboard/dist/assets/{UiStudioPage-CkHLBCN0.js → UiStudioPage-wYZQClUu.js} +2 -2
- package/dashboard/dist/assets/{WhatsNewPage-D0l3SoZ9.js → WhatsNewPage-D3cvOOAD.js} +1 -1
- package/dashboard/dist/assets/{bot-DCwGDR4k.js → bot-D89pfHg8.js} +1 -1
- package/dashboard/dist/assets/{check-DBxi70_h.js → check-GVlTbKVy.js} +1 -1
- package/dashboard/dist/assets/{copy-bDdN4zua.js → copy-DVGVC27v.js} +1 -1
- package/dashboard/dist/assets/index-uP4eoQi-.js +746 -0
- package/dashboard/dist/assets/rotate-ccw-Dxk8CuFi.js +6 -0
- package/dashboard/dist/assets/sample-requests-CQy_WSFJ.js +1 -0
- package/dashboard/dist/assets/{trash-2-BH7PRW92.js → trash-2-CEfHj47n.js} +1 -1
- package/dashboard/dist/assets/useLiveUptime-BGDr-4gk.js +1 -0
- package/dashboard/dist/assets/{useSettings-B8q8Cuch.js → useSettings-kOu_k9zT.js} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/dist/index.js +170 -170
- package/package.json +1 -1
- package/roblox-plugin/WeppyRobloxMCP.rbxm +0 -0
- package/dashboard/dist/assets/ChangelogPage-ChbHQhGx.js +0 -1
- package/dashboard/dist/assets/ConnectionPage-B3fGIK2X.css +0 -1
- package/dashboard/dist/assets/ConnectionPage-CywH0H2T.js +0 -6
- package/dashboard/dist/assets/CurrentPlaceScope-B0YLMs_a.js +0 -1
- package/dashboard/dist/assets/InfoLabel-CJVH3VF5.js +0 -1
- package/dashboard/dist/assets/OverviewPage-DStdjjf8.js +0 -1
- package/dashboard/dist/assets/StatusBadge-hrdvNb3-.js +0 -1
- package/dashboard/dist/assets/SyncPage-BgbrC3SP.css +0 -1
- package/dashboard/dist/assets/SyncPage-BtC4iYZE.js +0 -1
- package/dashboard/dist/assets/Tabs-CPTkUoYi.css +0 -1
- package/dashboard/dist/assets/Tabs-CXCAvK-b.js +0 -1
- package/dashboard/dist/assets/ToolsPage-SonaofpX.js +0 -1
- package/dashboard/dist/assets/TooltipText-CHM9zlD0.js +0 -1
- package/dashboard/dist/assets/index-MEBRUJOq.js +0 -714
- package/dashboard/dist/assets/sample-requests-DIskT9fc.js +0 -1
- package/dashboard/dist/assets/useLiveUptime-DtX2DhLL.js +0 -1
- /package/dashboard/dist/assets/{StatusBadge-C2zYt5iE.css → useLiveUptime-C2zYt5iE.css} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -55,6 +55,26 @@ All notable changes to this project will be documented in this file.
|
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
## [2.17.10] - 2026-09-26
|
|
61
|
+
|
|
62
|
+
### Features
|
|
63
|
+
|
|
64
|
+
- **See Sync status for each connected Studio** — The Dashboard shows each Studio's Place and Sync state separately. Selecting a Studio to inspect its policy or logs does not change where AI commands are sent.
|
|
65
|
+
- **Review local changes and conflicts in Studio** — The Plugin gives pending changes a clearer review screen and lists bidirectional conflicts with Local and Studio previews before you choose which version to keep.
|
|
66
|
+
- **Restart an unresponsive Bridge from the Dashboard** — When an AI agent is connected, the Connection page can request a Bridge restart and show when Dashboard and Studio reconnect. Active Playtest controls are cleaned up during the restart.
|
|
67
|
+
- **Optional game feel guidance for AI agents** — The WEPPY agent plugin includes guidance for choosing feedback on hits, rewards, movement, and interactions to fit the game being built.
|
|
68
|
+
|
|
69
|
+
### Bug Fixes
|
|
70
|
+
|
|
71
|
+
- **Avoid duplicate Studio objects during reverse Sync** — Local script and properties files arriving together now create one Studio instance. Conflict resolution confirms a local change only after Studio applies it, so a failed apply remains available for review.
|
|
72
|
+
- **Show agent connection times accurately** — The Connection page separates the last confirmed contact from the most recent command instead of presenting one time as both.
|
|
73
|
+
- **Identify occupied Bridge ports correctly** — When a listener stops responding while holding the Bridge port, WEPPY reports a port ownership conflict instead of a generic startup timeout.
|
|
74
|
+
|
|
75
|
+
### Documentation
|
|
76
|
+
|
|
77
|
+
- **Clarify setup and current features** — Public setup guidance now covers Dola's manual MCP configuration, the Node.js 22 requirement, and current Playtest and Place shortcuts.
|
|
58
78
|
|
|
59
79
|
## [2.17.9] - 2026-09-21
|
|
60
80
|
|
package/README.md
CHANGED
|
@@ -61,10 +61,12 @@ Use this server command:
|
|
|
61
61
|
npx -y @weppy/roblox-mcp@latest
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
Automatic registration supports Claude Code, Claude Desktop, Cursor, Codex CLI, Codex App, Gemini CLI, and Antigravity / Antigravity IDE / Antigravity CLI.
|
|
65
65
|
|
|
66
66
|
> Any MCP-compatible AI client works. The server command is `npx -y @weppy/roblox-mcp@latest`.
|
|
67
67
|
|
|
68
|
+
**Dola Desktop** connects through a local STDIO Custom Connector. It requires Dola's Pro mode and Local computer. Follow the [Dola manual setup guide](https://weppyai.com/en/docs/agents/dola/); the one-line installer and GitHub marketplace plugin do not configure Dola.
|
|
69
|
+
|
|
68
70
|
### Optional WEPPY AI Agent Plugin
|
|
69
71
|
|
|
70
72
|
The **WEPPY Roblox AI Toolkit** connects to every supported AI app through the **WEPPY MCP Server**. Claude Code, Codex, and Antigravity can additionally install the **WEPPY AI Agent Plugin** for client-native setup and workflow guidance for Studio control, sync, and assets.
|
|
@@ -94,9 +96,9 @@ On Windows Antigravity, CLI installation has been verified to expose skills and
|
|
|
94
96
|
|
|
95
97
|
## Compatibility
|
|
96
98
|
|
|
97
|
-
| Claude Code | Claude Desktop | Cursor | Codex CLI | Gemini CLI | Antigravity / Antigravity IDE / Antigravity CLI |
|
|
98
|
-
|
|
99
|
-
| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
99
|
+
| Claude Code | Claude Desktop | Cursor | Codex CLI | Gemini CLI | Antigravity / Antigravity IDE / Antigravity CLI | Dola Desktop |
|
|
100
|
+
|:-----------:|:--------------:|:------:|:---------:|:----------:|:-----------------------------:|:------------:|
|
|
101
|
+
| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | [Manual setup](https://weppyai.com/en/docs/agents/dola/) |
|
|
100
102
|
|
|
101
103
|
**Requirements:** Node.js 22+, Roblox Studio, Windows 10+ or macOS 12+
|
|
102
104
|
|
|
@@ -125,6 +127,8 @@ Many Roblox experiences are not a single Place. WEPPY lets you keep up to five S
|
|
|
125
127
|
|
|
126
128
|
### 3) Assets: Generate, upload, and apply images in Studio
|
|
127
129
|
|
|
130
|
+
If your AI app can create PNG or JPG files, it can make a new image for this workflow. Otherwise, start with an image you already have and register it in Asset Library before uploading it.
|
|
131
|
+
|
|
128
132
|
WEPPY Assets turns a natural-language asset request into a Studio-ready result.
|
|
129
133
|
|
|
130
134
|
- "Create a gem icon for the shop button, upload it to Roblox, then apply it to the ShopButton image in the Lobby Place."
|
|
@@ -136,11 +140,12 @@ WEPPY Assets turns a natural-language asset request into a Studio-ready result.
|
|
|
136
140
|
|
|
137
141
|
### 4) Sync: Keep full project context stable for AI
|
|
138
142
|
|
|
139
|
-
AI
|
|
143
|
+
AI reads a local mirror of your Studio project. Review pending local changes before applying them to Studio.
|
|
140
144
|
|
|
141
145
|
- Sync starts Off on first use. Start on connection is also Off. Saved settings always take precedence, including a saved Off value. The first-use workflow is Studio First, so the first synchronization treats Studio as the source.
|
|
142
146
|
- Choose Studio First, Bidirectional Review, Local Code, Studio World, or Custom. Custom groups changes into four semantic scopes: Script Source, Properties, Structure, and Service Properties.
|
|
143
147
|
- Content Changes and Structure Changes application modes are shown separately from scope direction. Local file deletion does not delete a Studio instance by default; applying a deletion to Studio requires an additional opt-in and is separate from UI Studio history cleanup.
|
|
148
|
+
- **Review Changes** lists local edits waiting for manual application. **Review Conflicts** lists files changed differently in Studio and locally; compare both versions before choosing one.
|
|
144
149
|
- Basic uses Studio-to-local Sync. Pro adds the richer workflow directions, history, and support for up to five Places.
|
|
145
150
|
- The WEPPY MCP Server and WEPPY Roblox Studio Plugin must come from the same release. Update both together, then restart Roblox Studio before reconnecting if their versions do not match.
|
|
146
151
|
|
|
@@ -164,6 +169,8 @@ Ordinary runtime checks use a structured Play session. AI can wait for game UI,
|
|
|
164
169
|
|
|
165
170
|
The same Playtest page also includes a **Test Values** workspace for development-only values. Create multiple Place-scoped profiles for different test setups; the Dashboard remembers the last profile selected for each Place. While Play or Run remains active, you can switch, create, edit, or delete profiles without restarting the game. Switching keeps the current game values and changes the controls, Watch Values, and Actions shown for the same session. Controls and read-only observations appear in one searchable, paginated list, so large profiles remain easy to scan. Use **Manage values** to add entries discovered from Project Test Adapters, or use a runtime path and the current Studio selection for direct values. A stale or disconnected observation is shown as the last observed value instead of being presented as current.
|
|
166
171
|
|
|
172
|
+
On Pro, profile **Actions** can run a prepared game operation during Play, such as changing a value or calling a reviewed Test Adapter. Actions report their result separately from value changes. **Reset all** restores reversible value changes; it cannot undo saved game data, deaths, rewards, or external requests caused by an Action.
|
|
173
|
+
|
|
167
174
|
Basic includes profile creation and live runtime observation. Pro adds typed value changes during Play, rollback, **Reset all**, and actual saved **Automated Test Results**. The Playtest page explains the Pro additions and links directly to available plans and purchase options.
|
|
168
175
|
|
|
169
176
|
Studio Stop discards Play/Run Instance changes. While the runtime remains active, **Reset all** restores every reversible value changed through any profile in that session, and a partially failed transaction rolls back. Games that cache values at startup or need domain operations can expose reviewed Project Test Adapter methods through optional Dashboard metadata. The Dashboard validates the metadata, shows the registration source, and links a read-only observer to each adapter control. Removing a profile reference leaves the adapter source intact.
|
|
@@ -196,6 +203,8 @@ The MCP server provides a web dashboard where you can check connection status, t
|
|
|
196
203
|
|
|
197
204
|
- Connection topology for AI agents, the MCP server, and connected Roblox Studio windows
|
|
198
205
|
- Studio Targets with copyable Studio IDs, Priority/Pinned badges, and a link to routing controls
|
|
206
|
+
- Published Place names and quick links to Place settings, Experience management, and the Roblox page
|
|
207
|
+
- Place folders available in Tools, Playtest, Changelog, and Assets before the first Sync; duplicate folders are identified for review
|
|
199
208
|
- Multi-agent and multi-Studio workflows: keep several agents and up to five Studio windows visible, then tell the agent which Studio ID to use
|
|
200
209
|
- Assets page for local library items, shared assets, and Roblox upload status
|
|
201
210
|
- Controls page for enforcing post-write Luau syntax validation, including clear On and Off behavior
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,j as t}from"./index-
|
|
1
|
+
import{r as i,j as t}from"./index-uP4eoQi-.js";import{C as d}from"./copy-DVGVC27v.js";const _="_examples_1sykl_1",m="_example_1sykl_1",h="_request_1sykl_15",j="_nextStep_1sykl_16",b="_actionRow_1sykl_40",f="_copyButton_1sykl_47",k="_success_1sykl_79",w="_error_1sykl_80",c={examples:_,example:m,request:h,nextStep:j,actionRow:b,copyButton:f,success:k,error:w};function N(s){const[p,a]=i.useState({}),n=i.useRef(0),x=s.examples.map(e=>e.id).join("|");i.useEffect(()=>(n.current+=1,a({}),()=>{n.current+=1}),[x,s.resetKey]);const y=async(e,r)=>{var u;const l=++n.current;a(o=>({...o,[e]:"copying"}));try{if(!((u=navigator.clipboard)!=null&&u.writeText))throw new Error("clipboard_unavailable");if(await navigator.clipboard.writeText(r),l!==n.current)return;a(o=>({...o,[e]:"copied"}))}catch{if(l!==n.current)return;a(o=>({...o,[e]:"error"}))}};return t.jsxs("div",{className:c.examples,children:[s.examples.map(e=>{const r=p[e.id]??"idle";return t.jsxs("section",{className:c.example,children:[t.jsx("h4",{children:e.title}),t.jsx("p",{className:c.request,children:e.request}),t.jsxs("div",{className:c.actionRow,children:[t.jsxs("button",{type:"button",className:c.copyButton,disabled:r==="copying",onClick:()=>void y(e.id,e.request),children:[t.jsx(d,{size:14,"aria-hidden":"true"}),r==="copying"?s.labels.copying:s.labels.copy]}),r==="copied"&&t.jsx("span",{className:c.success,role:"status",children:s.labels.copied})]}),r==="error"&&t.jsx("p",{className:c.error,role:"alert",children:s.labels.copyFailed})]},e.id)}),s.nextStep&&t.jsx("p",{className:c.nextStep,children:s.nextStep})]})}export{N as A};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as le,b as F,l as we,u as ce,j as s,P as ws,I as Rs,r as c,F as $s,m as Ls,R as fs,X as Xe,E as Us,n as bs,g as Ts,o as Ve,p as be,q as Ae,t as Bs,v as Es,a as Gs,e as Ms}from"./index-
|
|
1
|
+
import{f as le,b as F,l as we,u as ce,j as s,P as ws,I as Rs,r as c,F as $s,m as Ls,R as fs,X as Xe,E as Us,n as bs,g as Ts,o as Ve,p as be,q as Ae,t as Bs,v as Es,a as Gs,e as Ms}from"./index-uP4eoQi-.js";import{C as ys}from"./ConfirmModal-BbqpSaVw.js";import{B as me,C as Ds,D as Qe,b as Fs,P as Os}from"./PageHeader-_z4Dtkbg.js";import{P as Hs,a as zs}from"./PlaceSelectOptions-Dd_m61bQ.js";import{T as se}from"./TooltipText-NA7u0bu6.js";import{A as Ks}from"./AiPromptExamples-BSFrFYar.js";import{B as Ws}from"./bot-D89pfHg8.js";import{T as Vs}from"./trash-2-CEfHj47n.js";import{C as js}from"./copy-DVGVC27v.js";import"./ConfirmModal.module-DJksQHBd.js";/**
|
|
2
2
|
* @license lucide-react v1.8.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as o,b as P,D as Q,u as q,j as e,X as W,a as X,w as Y,c as J,e as ee,k as te,T as ae}from"./index-uP4eoQi-.js";import{B as ne,P as se}from"./PageHeader-_z4Dtkbg.js";import{C as ie}from"./ConfirmModal-BbqpSaVw.js";import{C as ce,a as oe,T as re}from"./Tabs-BoD1I6c5.js";import{T as O}from"./TooltipText-NA7u0bu6.js";import{I as le}from"./InfoLabel-DAd1I756.js";import{G as de}from"./GameChangeDetail-DJ0xywJq.js";import"./ConfirmModal.module-DJksQHBd.js";import"./PlaceSelectOptions-Dd_m61bQ.js";const ge=10;function me(t,i){return typeof i!="number"?t:`${t}?placeId=${encodeURIComponent(String(i))}`}function he(t){const i=(t==null?void 0:t.placeId)??null,[m,c]=o.useState([]),[n,s]=o.useState(0),[u,p]=o.useState(!1),[r,T]=o.useState(!0),[C,E]=o.useState(0),[f,z]=o.useState("all"),B=o.useRef(null),S=o.useCallback(async(y,v)=>{T(!0);try{const k={limit:String(ge),offset:String(y)};v!=="all"&&(k.status=v),typeof i=="number"&&(k.placeId=String(i));const w=await P.get("/api/dashboard/changelog",k);c(w.entries),s(w.total),p(w.hasMore)}catch{c([]),s(0),p(!1)}finally{T(!1)}},[i]),I=o.useCallback(()=>{S(C,f)},[S,C,f]),$=o.useCallback(async()=>{await P.post(me("/api/dashboard/changelog/clear",i)),c([]),s(0),p(!1)},[i]);return o.useEffect(()=>{S(C,f)},[S,C,f]),o.useEffect(()=>{const y=new Q;B.current=y,y.connect();const v=y.on("command",()=>{S(C,f)});return()=>{v(),y.disconnect(),B.current=null}},[S,C,f]),{entries:m,total:n,hasMore:u,loading:r,offset:C,statusFilter:f,setOffset:E,setStatusFilter:z,refresh:I,clear:$}}const ue="_card_qniob_2",pe="_header_qniob_27",fe="_statusBadge_qniob_34",ye="_statusDot_qniob_45",xe="_active_qniob_51",_e="_completed_qniob_60",be="_timeRange_qniob_68",Ce="_summaryList_qniob_75",Se="_summaryItem_qniob_81",ve="_summaryIcon_qniob_90",je="_summaryText_qniob_96",Ne="_progressBar_qniob_101",Te="_progressFill_qniob_110",Ie="_emptySummary_qniob_124",ke="_contextBlock_qniob_132",we="_contextLabel_qniob_141",$e="_contextValue_qniob_149",h={card:ue,header:pe,statusBadge:fe,statusDot:ye,active:xe,completed:_e,timeRange:be,summaryList:Ce,summaryItem:Se,summaryIcon:ve,summaryText:je,progressBar:Ne,progressFill:Te,emptySummary:Ie,contextBlock:ke,contextLabel:we,contextValue:$e};function H(t){if(!t)return"--:--";const i=new Date(t);return`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}`}function Be({entry:t,onClick:i,buttonRef:m}){var v,k,w,L,A,R,d,_,D,M;const{t:c}=q(),n=t.changeSummary,s=t.status==="active",u=t.isBootstrapOnly===!0,p=[],r=n.scriptsModified+n.scriptsCreated;if(r>0){const g=[];n.scriptsModified>0&&g.push(`${n.scriptsModified} ${c("changelog.card.modified","modified")}`),n.scriptsCreated>0&&g.push(`${n.scriptsCreated} ${c("changelog.card.created","created")}`);const x=`${r} ${c("changelog.card.scripts","scripts")} ${g.join(", ")}`;p.push({icon:"📝",text:x,tooltip:c("changelog.card.scripts.tooltip","Script changes made in this session.")})}const T=n.instancesCreated+n.instancesDeleted+n.instancesMoved;if(T>0){const g=[];n.instancesCreated>0&&g.push(`${n.instancesCreated} ${c("changelog.card.created","created")}`),n.instancesDeleted>0&&g.push(`${n.instancesDeleted} ${c("changelog.card.deleted","deleted")}`),n.instancesMoved>0&&g.push(`${n.instancesMoved} ${c("changelog.card.moved","moved")}`);const x=`${T} ${c("changelog.card.instances","instances")} ${g.join(", ")}`;p.push({icon:"🧱",text:x,tooltip:c("changelog.card.instances.tooltip","Instance create, delete, move, or clone changes in this session.")})}n.propertiesChanged>0&&p.push({icon:"🎨",text:`${n.propertiesChanged} ${c("changelog.card.propertiesChanged","properties changed")}`,tooltip:c("changelog.card.propertiesChanged.tooltip","Property value changes recorded for this session.")}),n.lightingChanged&&p.push({icon:"🌅",text:c("changelog.card.lightingConfigured","Lighting configured"),tooltip:c("changelog.card.lightingConfigured.tooltip","Lighting or atmosphere settings changed in this session.")}),n.terrainChanged&&p.push({icon:"⛰️",text:c("changelog.card.terrainConfigured","Terrain configured"),tooltip:c("changelog.card.terrainConfigured.tooltip","Terrain data or terrain settings changed in this session.")}),n.assetsInserted>0&&p.push({icon:"📦",text:`${n.assetsInserted} ${c("changelog.card.assetsInserted","assets inserted")}`,tooltip:c("changelog.card.assetsInserted.tooltip","Assets inserted into the place during this session.")});const C=H(t.startTime),E=s?c("changelog.card.inProgress","in progress"):t.endTime?H(t.endTime):"--:--",f=u?c("changelog.card.bootstrapStatus","Bootstrap"):s?c("changelog.card.active","Active"):c("changelog.card.completed","Completed"),z=u?c("changelog.card.bootstrapStatus.tooltip","This session only contains the initial sync bootstrap snapshot."):s?c("changelog.card.active.tooltip","This session is still receiving new game changes."):c("changelog.card.completed.tooltip","This session has ended and no more changes are expected."),B=u?c("changelog.card.bootstrapSummary","Initial sync snapshot"):c("changelog.card.noChanges","No changes yet"),S=u?c("changelog.card.bootstrapSummary.tooltip","Initial file sync writes are collapsed into a single bootstrap snapshot row."):c("changelog.card.noChanges.tooltip","No game changes have been extracted for this session yet."),I=(k=(v=t.contextSummary)==null?void 0:v.intent)==null?void 0:k.trim(),$=((R=(A=(L=(w=t.contextSummary)==null?void 0:w.affectedAreas)==null?void 0:L[0])==null?void 0:A.label)==null?void 0:R.trim())||((_=(d=t.contextSummary)==null?void 0:d.testScenario)==null?void 0:_.trim()),y=(M=(D=t.verificationSummary)==null?void 0:D.label)==null?void 0:M.trim();return e.jsxs("button",{ref:m,className:h.card,type:"button",onClick:g=>i(g.currentTarget),children:[e.jsxs("span",{className:h.header,children:[e.jsx(O,{text:z,children:e.jsxs("span",{className:`${h.statusBadge} ${s?h.active:h.completed}`,children:[e.jsx("span",{className:h.statusDot}),f]})}),e.jsxs("span",{className:h.timeRange,children:[C,"~",E]})]}),e.jsx("span",{className:h.summaryList,children:p.length>0?p.map((g,x)=>e.jsxs("span",{className:h.summaryItem,children:[e.jsx("span",{className:h.summaryIcon,children:g.icon}),e.jsx(O,{text:g.tooltip,children:e.jsx("span",{className:h.summaryText,children:g.text})})]},x)):e.jsx(O,{text:S,children:e.jsx("span",{className:h.emptySummary,style:{display:"block"},children:B})})}),I&&e.jsxs("span",{className:h.contextBlock,children:[e.jsx("span",{className:h.contextLabel,children:c("changelog.card.sessionIntent","Session intent")}),e.jsx("span",{className:h.contextValue,children:I})]}),!I&&$&&e.jsxs("span",{className:h.contextBlock,children:[e.jsx("span",{className:h.contextLabel,children:c("changelog.card.representativeArea","Representative area")}),e.jsx("span",{className:h.contextValue,children:$})]}),y&&e.jsxs("span",{className:h.contextBlock,children:[e.jsx("span",{className:h.contextLabel,children:c("changelog.card.verification","Verification")}),e.jsx("span",{className:h.contextValue,children:y})]}),s&&e.jsx("span",{className:h.progressBar,children:e.jsx("span",{className:h.progressFill})})]})}function ze(t){const i={scriptsModified:0,scriptsCreated:0,instancesCreated:0,instancesDeleted:0,instancesMoved:0,propertiesChanged:0,lightingChanged:!1,terrainChanged:!1,assetsInserted:0};for(const m of t)switch(m.category){case"script":m.changeType==="create"?i.scriptsCreated++:i.scriptsModified++;break;case"instance":m.changeType==="create"?i.instancesCreated++:m.changeType==="delete"?i.instancesDeleted++:m.changeType==="move"&&i.instancesMoved++;break;case"property":i.propertiesChanged++;break;case"lighting":i.lightingChanged=!0;break;case"terrain":i.terrainChanged=!0;break;case"asset":i.assetsInserted++;break}return i}function Ee(t){if(typeof t=="number")return{placeId:String(t)}}function Le(t,i){const[m,c]=o.useState(""),[n,s]=o.useState(""),[u,p]=o.useState(),[r,T]=o.useState("completed"),[C,E]=o.useState([]),[f,z]=o.useState([]),[B,S]=o.useState([]),[I,$]=o.useState(),[y,v]=o.useState(),[k,w]=o.useState(),[L,A]=o.useState({scriptsModified:0,scriptsCreated:0,instancesCreated:0,instancesDeleted:0,instancesMoved:0,propertiesChanged:0,lightingChanged:!1,terrainChanged:!1,assetsInserted:0}),[R,d]=o.useState(!0),[_,D]=o.useState(null),M=o.useCallback(async()=>{if(t){d(!0),D(null);try{const g=Ee(i),[x,G]=await Promise.all([g?P.get(`/api/dashboard/changelog/${t}`,g):P.get(`/api/dashboard/changelog/${t}`),g?P.get(`/api/dashboard/changelog/${t}/changes`,g):P.get(`/api/dashboard/changelog/${t}/changes`)]);c(x.entryId),s(x.startTime),p(x.endTime),T(x.status),E(x.entries),z(x.failures),$(x.contextSummary),v(x.replayMetadata),w(x.verificationSummary),S(G.changes),A(ze(G.changes))}catch(g){D(g instanceof Error?g.message:"Failed to load changelog detail")}finally{d(!1)}}},[t,i]);return o.useEffect(()=>{M()},[M]),{entryId:m,startTime:n,endTime:u,status:r,entries:C,failures:f,changes:B,changeSummary:L,contextSummary:I,replayMetadata:y,verificationSummary:k,loading:R,error:_,refresh:M}}const Ae={script:"📝",instance:"🧱",property:"🎨",lighting:"🌅",terrain:"⛰️",asset:"📦"};function Re(t){return Ae[t]??"❓"}const Me="_dialogContent_197zf_2",Oe="_dialogHeader_197zf_10",De="_dialogTitleGroup_197zf_20",Fe="_dialogTitle_197zf_20",Pe="_dialogMeta_197zf_36",Ge="_dialogClose_197zf_43",Ke="_dialogBody_197zf_68",Ve="_page_197zf_77",qe="_headerTime_197zf_84",Ue="_dialogActions_197zf_90",He="_retryButton_197zf_96",Ze="_statusActive_197zf_129",Qe="_statusCompleted_197zf_134",We="_section_197zf_139",Xe="_sectionTitle_197zf_146",Ye="_summaryGrid_197zf_159",Je="_summaryCard_197zf_165",et="_summaryCardActive_197zf_188",tt="_summaryIcon_197zf_193",at="_summaryCount_197zf_199",nt="_summaryLabel_197zf_207",st="_contextGrid_197zf_217",it="_contextRow_197zf_223",ct="_contextKey_197zf_229",ot="_contextValue_197zf_237",rt="_timelineFilter_197zf_245",lt="_filterLabel_197zf_253",dt="_filterSelect_197zf_259",gt="_ownershipToggle_197zf_269",mt="_timeline_197zf_245",ht="_timelineEntry_197zf_297",ut="_timelineTime_197zf_326",pt="_timelineIcon_197zf_334",ft="_timelineBody_197zf_339",yt="_timelineSummary_197zf_345",xt="_timelineTarget_197zf_353",_t="_timelineConfidence_197zf_361",bt="_ownershipBadge_197zf_370",Ct="_confidenceExact_197zf_378",St="_confidencePartial_197zf_383",vt="_confidenceAfterOnly_197zf_388",jt="_confidenceIntentOnly_197zf_393",Nt="_confidenceUnknown_197zf_398",Tt="_timelineExpanded_197zf_404",It="_empty_197zf_413",kt="_loading_197zf_422",wt="_error_197zf_431",a={dialogContent:Me,dialogHeader:Oe,dialogTitleGroup:De,dialogTitle:Fe,dialogMeta:Pe,dialogClose:Ge,dialogBody:Ke,page:Ve,headerTime:qe,dialogActions:Ue,retryButton:He,statusActive:Ze,statusCompleted:Qe,section:We,sectionTitle:Xe,summaryGrid:Ye,summaryCard:Je,summaryCardActive:et,summaryIcon:tt,summaryCount:at,summaryLabel:nt,contextGrid:st,contextRow:it,contextKey:ct,contextValue:ot,timelineFilter:rt,filterLabel:lt,filterSelect:dt,ownershipToggle:gt,timeline:mt,timelineEntry:ht,timelineTime:ut,timelineIcon:pt,timelineBody:ft,timelineSummary:yt,timelineTarget:xt,timelineConfidence:_t,ownershipBadge:bt,confidenceExact:Ct,confidencePartial:St,confidenceAfterOnly:vt,confidenceIntentOnly:jt,confidenceUnknown:Nt,timelineExpanded:Tt,empty:It,loading:kt,error:wt},Z=[{key:"script",icon:"📝",labelKey:"changelog.category.script"},{key:"instance",icon:"🧱",labelKey:"changelog.category.instance"},{key:"property",icon:"🎨",labelKey:"changelog.category.property"},{key:"lighting",icon:"🌅",labelKey:"changelog.category.lighting"},{key:"terrain",icon:"⛰️",labelKey:"changelog.category.terrain"},{key:"asset",icon:"📦",labelKey:"changelog.category.asset"}];function V(t){if(!t)return"--:--";const i=new Date(t);return`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}`}function $t(t){if(!t)return"--:--:--";const i=new Date(t);return`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}:${String(i.getSeconds()).padStart(2,"0")}`}function Bt(t,i){if(!t||!i)return"";const m=new Date(i).getTime()-new Date(t).getTime();return m<0?"":`${Math.round(m/6e4)}min`}function zt(t){switch(t){case"exact":return a.confidenceExact;case"partial":return a.confidencePartial;case"after-only":return a.confidenceAfterOnly;case"intent-only":return a.confidenceIntentOnly;default:return a.confidenceUnknown}}function Et(t,i){switch(i){case"exact":return t("changelog.detail.confidence.exact","Exact");case"partial":return t("changelog.detail.confidence.partial","Partial");case"after-only":return t("changelog.detail.confidence.afterOnly","After only");case"intent-only":return t("changelog.detail.confidence.intentOnly","Intent only");default:return t("changelog.detail.confidence.unknown","Unknown")}}function Lt(t,i){switch(i){case"exact":return t("changelog.detail.confidence.exact.tooltip","Both the before and after state were confirmed for this change.");case"partial":return t("changelog.detail.confidence.partial.tooltip","Only part of the before and after state could be confirmed for this change.");case"after-only":return t("changelog.detail.confidence.afterOnly.tooltip","Only the resulting state after the change could be confirmed.");case"intent-only":return t("changelog.detail.confidence.intentOnly.tooltip","Only the requested action was recorded, not the resulting state.");default:return t("changelog.detail.confidence.unknown.tooltip","This change could not be confidently classified from the available data.")}}function At(t,i){switch(i){case"user_source":return t("changelog.ownership.userSource","User source");case"canonical_mirror":return t("changelog.ownership.canonicalMirror","Mirror metadata");case"generated":return t("changelog.ownership.generated","Generated");default:return null}}function Rt({entryId:t,placeId:i,onClose:m,returnFocusTo:c=null}){var v,k,w,L,A,R,d,_,D,M,g,x,G,U;const{t:n}=q(),s=Le(t,i),[u,p]=o.useState("all"),[r,T]=o.useState(!0),[C,E]=o.useState(null),f=o.useMemo(()=>{const l=r?s.changes:s.changes.filter(b=>b.artifactOwnership!=="generated");return[...u==="all"?l:l.filter(b=>b.category===u)].reverse()},[s.changes,u,r]),z=s.changes.some(l=>l.artifactOwnership==="generated"),B=Bt(s.startTime,s.endTime),S=s.endTime?`${V(s.startTime)} → ${V(s.endTime)} (${B})`:`${V(s.startTime)} → ${n("changelog.card.inProgress","in progress")}`,I=!!((v=s.contextSummary)!=null&&v.intent||(k=s.contextSummary)!=null&&k.testScenario||(w=s.contextSummary)!=null&&w.expectedBehavior||(L=s.contextSummary)!=null&&L.observedBehavior),$=!!((A=s.verificationSummary)!=null&&A.label||(R=s.verificationSummary)!=null&&R.status||(d=s.verificationSummary)!=null&&d.testTimestamp),y=n("changelog.detail.dialogLabel","Changelog detail");return e.jsx(ce,{open:!0,ariaLabel:y,onClose:m,returnFocusTo:c,testId:"changelog-detail-backdrop",children:e.jsxs("div",{className:a.dialogContent,children:[e.jsxs("div",{className:a.dialogHeader,children:[e.jsxs("div",{className:a.dialogTitleGroup,children:[e.jsx("h2",{className:a.dialogTitle,children:y}),!s.loading&&!s.error&&e.jsxs("div",{className:a.dialogMeta,children:[e.jsx("span",{className:a.headerTime,children:S}),e.jsx(O,{text:s.status==="active"?n("changelog.card.active.tooltip","This session is still receiving new game changes."):n("changelog.card.completed.tooltip","This session has ended and no more changes are expected."),children:e.jsx("span",{className:s.status==="active"?a.statusActive:a.statusCompleted,children:s.status==="active"?n("changelog.card.active","Active"):n("changelog.card.completed","Completed")})})]})]}),e.jsx("button",{className:a.dialogClose,type:"button","aria-label":n("common.close","Close"),onClick:m,children:e.jsx(W,{size:18,"aria-hidden":"true"})})]}),e.jsxs("div",{className:a.dialogBody,children:[s.loading&&e.jsx("div",{className:a.loading,children:n("common.loading","Loading...")}),s.error&&e.jsxs("div",{className:a.error,children:[e.jsx("span",{children:s.error}),e.jsxs("div",{className:a.dialogActions,children:[e.jsx("button",{className:a.retryButton,type:"button",onClick:s.refresh,children:n("common.retry","Retry")}),e.jsx("button",{className:a.retryButton,type:"button",onClick:m,children:n("common.close","Close")})]})]}),!s.loading&&!s.error&&e.jsxs("div",{className:a.page,children:[e.jsxs("div",{className:a.section,children:[e.jsx("div",{className:a.sectionTitle,children:e.jsx(O,{text:n("changelog.detail.changeSummary.tooltip","Counts of extracted game changes grouped by category for this session."),children:e.jsx("span",{children:n("changelog.detail.changeSummary","Change Summary")})})}),e.jsx("div",{className:a.summaryGrid,children:Z.map(l=>{const j=s.changeSummary;let b;switch(l.key){case"script":b=j.scriptsModified+j.scriptsCreated;break;case"instance":b=j.instancesCreated+j.instancesDeleted+j.instancesMoved;break;case"property":b=j.propertiesChanged;break;case"lighting":b=j.lightingChanged?1:0;break;case"terrain":b=j.terrainChanged?1:0;break;case"asset":b=j.assetsInserted;break;default:b=0}const F=u===l.key;return e.jsxs("button",{type:"button",className:`${a.summaryCard} ${F?a.summaryCardActive:""}`,"aria-label":`${n(l.labelKey,l.key)}: ${b}`,"aria-pressed":F,onClick:()=>p(F?"all":l.key),children:[e.jsx("span",{className:a.summaryIcon,children:l.icon}),e.jsx("span",{className:a.summaryCount,children:b}),e.jsx("span",{className:a.summaryLabel,children:n(l.labelKey,l.key)})]},l.key)})})]}),I&&e.jsxs("div",{className:a.section,children:[e.jsx("div",{className:a.sectionTitle,children:e.jsx(O,{text:n("changelog.detail.context.tooltip","Structured execution context captured for this changelog session."),children:e.jsx("span",{children:n("changelog.detail.context.title","Context Summary")})})}),e.jsxs("div",{className:a.contextGrid,children:[((_=s.contextSummary)==null?void 0:_.intent)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("changelog.card.sessionIntent","Session intent")}),e.jsx("span",{className:a.contextValue,children:s.contextSummary.intent})]}),((D=s.contextSummary)==null?void 0:D.testScenario)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("playtest.context.why","Why this test ran")}),e.jsx("span",{className:a.contextValue,children:s.contextSummary.testScenario})]}),((M=s.contextSummary)==null?void 0:M.expectedBehavior)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("playtest.context.expected","Expected")}),e.jsx("span",{className:a.contextValue,children:s.contextSummary.expectedBehavior})]}),((g=s.contextSummary)==null?void 0:g.observedBehavior)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("playtest.context.observed","Observed")}),e.jsx("span",{className:a.contextValue,children:s.contextSummary.observedBehavior})]})]})]}),$&&e.jsxs("div",{className:a.section,children:[e.jsx("div",{className:a.sectionTitle,children:e.jsx(O,{text:n("changelog.detail.verification.tooltip","Verification signals linked to this changelog session."),children:e.jsx("span",{children:n("changelog.detail.verification.title","Verification")})})}),e.jsxs("div",{className:a.contextGrid,children:[((x=s.verificationSummary)==null?void 0:x.label)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("changelog.detail.verification.label","Result")}),e.jsx("span",{className:a.contextValue,children:s.verificationSummary.label})]}),((G=s.verificationSummary)==null?void 0:G.status)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("changelog.detail.verification.status","Status")}),e.jsx("span",{className:a.contextValue,children:s.verificationSummary.status})]}),((U=s.verificationSummary)==null?void 0:U.testTimestamp)&&e.jsxs("div",{className:a.contextRow,children:[e.jsx("span",{className:a.contextKey,children:n("changelog.detail.verification.timestamp","Recorded at")}),e.jsx("span",{className:a.contextValue,children:s.verificationSummary.testTimestamp})]})]})]}),e.jsxs("div",{className:a.section,children:[e.jsx("div",{className:a.sectionTitle,children:e.jsx(O,{text:n("changelog.detail.changeTimeline.tooltip","Chronological list of extracted game changes for this session."),children:e.jsx("span",{children:n("changelog.detail.changeTimeline","Change Timeline")})})}),e.jsxs("div",{className:a.timelineFilter,children:[e.jsx("span",{className:a.filterLabel,children:e.jsx(le,{label:`${n("changelog.detail.filterCategory","Category")}:`,tooltip:n("changelog.detail.filterCategory.tooltip","Filter the timeline to a single change category.")})}),e.jsxs("select",{className:a.filterSelect,value:u,onChange:l=>p(l.target.value),children:[e.jsx("option",{value:"all",children:n("tools.filter.all","All")}),Z.map(l=>e.jsxs("option",{value:l.key,children:[l.icon," ",n(l.labelKey,l.key)]},l.key))]}),z&&e.jsxs("label",{className:a.ownershipToggle,children:[e.jsx("input",{type:"checkbox",checked:r,onChange:l=>T(l.target.checked)}),n("changelog.ownership.showGenerated","Show generated metadata")]})]}),f.length===0?e.jsx("div",{className:a.empty,children:n("changelog.detail.noChanges","No changes in this category")}):e.jsx("div",{className:a.timeline,children:f.map((l,j)=>{const b=C===j,F=At(n,l.artifactOwnership);return e.jsxs("div",{children:[e.jsxs("button",{type:"button",className:a.timelineEntry,"aria-expanded":b,onClick:()=>E(b?null:j),children:[e.jsx("span",{className:a.timelineTime,children:$t(l.timestamp)}),e.jsx("span",{className:a.timelineIcon,children:Re(l.category)}),e.jsxs("span",{className:a.timelineBody,children:[e.jsxs("span",{className:a.timelineSummary,children:[l.summary,F&&e.jsx(ne,{variant:l.artifactOwnership==="generated"?"neutral":"accent",className:a.ownershipBadge,children:F}),e.jsx(O,{text:Lt(n,l.confidence),children:e.jsx("span",{className:`${a.timelineConfidence} ${zt(l.confidence)}`,children:Et(n,l.confidence)})})]}),e.jsx("span",{className:a.timelineTarget,children:l.target})]})]}),b&&e.jsx("div",{className:a.timelineExpanded,children:e.jsx(de,{change:l})})]},j)})})]})]})]})]})})}const Mt="_page_1tggr_2",Ot="_limitNotice_1tggr_9",Dt="_limitNoticeContent_1tggr_23",Ft="_limitNoticeTitle_1tggr_28",Pt="_limitNoticeText_1tggr_35",Gt="_primaryAction_1tggr_41",Kt="_clearButton_1tggr_67",Vt="_list_1tggr_88",qt="_empty_1tggr_95",Ut="_loading_1tggr_104",Ht="_pagination_1tggr_113",Zt="_pageInfo_1tggr_121",Qt="_btn_1tggr_127",N={page:Mt,limitNotice:Ot,limitNoticeContent:Dt,limitNoticeTitle:Ft,limitNoticeText:Pt,primaryAction:Gt,clearButton:Kt,list:Vt,empty:qt,loading:Ut,pagination:Ht,pageInfo:Zt,btn:Qt},K=10;function Wt(t,i){return typeof i!="number"?`/changelog/${t}`:`/changelog/${t}?placeId=${encodeURIComponent(String(i))}`}function Xt(t){const i=/^\/changelog\/([^/]+)$/.exec(t);if(!i)return null;try{return decodeURIComponent(i[1])}catch{return i[1]}}function Yt(t){const i=new URLSearchParams(t).get("placeId");if(!i)return null;const m=Number.parseInt(i,10);return Number.isInteger(m)&&m>=0?m:null}const Jt=[{key:"all",labelKey:"changelog.filter.all"},{key:"active",labelKey:"changelog.filter.active"},{key:"completed",labelKey:"changelog.filter.completed"}];function la(){const{t}=q(),{trackEvent:i,trackPageView:m}=X(),c=Y(),n=J(),s=Xt(n.pathname),[u,p]=o.useState(()=>Yt(n.search)),r=he({placeId:u}),T=ee(),{show:C}=te(),[E,f]=o.useState(!1),[z,B]=o.useState(!1),[S,I]=o.useState(null),$=o.useRef(null),y=s??S,v=!T.loading&&T.tier==="basic",k=v?r.entries.slice(0,3):r.entries,w=!v&&r.total>K;o.useEffect(()=>{s&&s===S&&I(null)},[S,s]);const L=async()=>{B(!0);try{await r.clear(),C(t("toast.clearSuccess","Cleared successfully"),"success"),f(!1)}catch{C(t("toast.clearFailed","Failed to clear data"),"error")}finally{B(!1)}},A=(d,_)=>{$.current=_,I(d),c(Wt(d,u))},R=()=>{I(null),c("/changelog",{replace:!0})};return e.jsxs("div",{className:N.page,children:[e.jsx(se,{title:t("page.changelog.title","Changelog"),description:t("page.changelog.description","Review game-change sessions captured from AI actions and sync events."),helpTopicId:"changelog",helpState:{tier:T.tier}}),e.jsx(oe,{surface:"changelog",selectable:!0,selectedPlaceId:u,onSelectedPlaceIdChange:d=>{p(d),r.setOffset(0)}}),e.jsx(re,{items:Jt.map(d=>({key:d.key,label:t(d.labelKey,d.key.charAt(0).toUpperCase()+d.key.slice(1))})),value:r.statusFilter,onChange:d=>{const _=`changelog_${d}`;i("dashboard_click_event",{click_target:`changelog_tab_${d}`,page:"changelog",tab:_}),m({page:"changelog",tab:_}),r.setStatusFilter(d),r.setOffset(0)},rightActions:e.jsx("button",{className:N.clearButton,onClick:()=>{i("dashboard_click_event",{click_target:"changelog_clear",page:"changelog",tab:`changelog_${r.statusFilter}`}),f(!0)},children:t("common.clear","Clear")})}),r.loading&&r.entries.length===0&&e.jsx("div",{className:N.loading,children:t("common.loading","Loading...")}),!r.loading&&r.entries.length===0?e.jsx("div",{className:N.empty,children:t("changelog.empty","No changelog entries for the current place yet")}):e.jsx("div",{className:N.list,children:k.map(d=>e.jsx(Be,{entry:d,onClick:_=>A(d.entryId,_),buttonRef:_=>{d.entryId===y&&_&&($.current=_)}},d.entryId))}),w&&e.jsxs("div",{className:N.pagination,children:[e.jsx("button",{className:N.btn,disabled:r.offset===0,onClick:()=>r.setOffset(Math.max(0,r.offset-K)),children:t("tools.page.prev","Prev")}),e.jsxs("span",{className:N.pageInfo,children:[r.offset+1,"–",Math.min(r.offset+K,r.total)," / ",r.total]}),e.jsx("button",{className:N.btn,disabled:!r.hasMore,onClick:()=>r.setOffset(r.offset+K),children:t("tools.page.next","Next")})]}),v&&e.jsx(e.Fragment,{children:e.jsxs("div",{className:N.limitNotice,children:[e.jsxs("div",{className:N.limitNoticeContent,children:[e.jsx("div",{className:N.limitNoticeTitle,children:t("changelog.basic.limit.title","Basic preview shows the latest 3 sessions")}),e.jsx("div",{className:N.limitNoticeText,children:t("changelog.basic.limit.body","Full changelog timeline browsing is available with Pro.")})]}),e.jsx("a",{className:N.primaryAction,href:ae.changelog,target:"_blank",rel:"noreferrer",onClick:()=>i("dashboard_click_event",{click_target:"upgrade_cta",placement:"changelog_limit_notice",page:"changelog",tab:`changelog_${r.statusFilter}`}),children:t("tier.upgrade","View Pro")})]})}),e.jsx(ie,{open:E,title:t("changelog.clear.title","Clear changelog?"),message:t("changelog.clear.message","This permanently removes the stored changelog for the current place."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:z,onCancel:()=>!z&&f(!1),onConfirm:L}),y&&e.jsx(Rt,{entryId:y,placeId:u,onClose:R,returnFocusTo:$.current})]})}export{la as Component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,j as s}from"./index-
|
|
1
|
+
import{r as t,j as s}from"./index-uP4eoQi-.js";import{s as r}from"./ConfirmModal.module-DJksQHBd.js";function D({open:a,title:y,message:E,cancelLabel:R,confirmLabel:j,loading:n=!1,onCancel:c,onConfirm:k}){const i=t.useId(),o=t.useRef(null),f=t.useRef(null),d=t.useRef(null),m=t.useRef(c),h=t.useRef(n);return m.current=c,h.current=n,t.useEffect(()=>{var b;if(!a)return;d.current=document.activeElement instanceof HTMLElement?document.activeElement:null,(b=f.current)==null||b.focus();const l=e=>{if(e.key==="Escape"){e.preventDefault(),h.current||m.current();return}if(e.key!=="Tab"||!o.current)return;const u=Array.from(o.current.querySelectorAll("button:not([disabled])"));if(u.length===0){e.preventDefault(),o.current.focus();return}const p=u[0],x=u[u.length-1];e.shiftKey&&document.activeElement===p?(e.preventDefault(),x.focus()):!e.shiftKey&&document.activeElement===x&&(e.preventDefault(),p.focus())};return document.addEventListener("keydown",l),()=>{document.removeEventListener("keydown",l);const e=d.current;e&&document.contains(e)&&e.focus()}},[a]),a?s.jsx("div",{className:r.backdrop,onClick:n?void 0:c,children:s.jsxs("div",{ref:o,className:r.modal,role:"dialog","aria-modal":"true","aria-labelledby":i,tabIndex:-1,onClick:l=>l.stopPropagation(),children:[s.jsx("h2",{id:i,className:r.title,children:y}),s.jsx("p",{className:r.message,children:E}),s.jsxs("div",{className:r.actions,children:[s.jsx("button",{ref:f,className:r.cancelButton,onClick:c,disabled:n,children:R}),s.jsx("button",{className:r.confirmButton,onClick:k,disabled:n,children:n?"...":j})]})]})}):null}export{D as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._container_1h084_2{max-height:200px;overflow-y:auto;font-family:var(--font-code);font-size:12px;line-height:1.6;padding:8px 12px;background:var(--bg-secondary);border-radius:4px}._entry_1h084_14{display:flex;gap:8px;white-space:nowrap}._timestamp_1h084_21{color:var(--text-muted);flex-shrink:0}._message_1h084_27{color:var(--text-primary);overflow:hidden;text-overflow:ellipsis}._warn_1h084_34 ._message_1h084_27{color:var(--warning)}._error_1h084_39 ._message_1h084_27{color:var(--error)}._empty_1h084_44{color:var(--text-muted);font-style:italic;padding:8px 0}._page_6dxry_2{display:flex;flex-direction:column;gap:var(--space-page);width:100%;max-width:1180px}._card_6dxry_11{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:var(--card-padding-block) var(--card-padding-inline)}._topologyCard_6dxry_19{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:18px 20px 20px}._topologyDisconnected_6dxry_26{border-color:var(--error-border)}._topologyHeader_6dxry_30{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:18px}._topologyIntro_6dxry_38{margin:-6px 0 0;color:var(--text-secondary);font-size:13px;line-height:1.5}._topologyNetwork_6dxry_45{position:relative}._topologyLinks_6dxry_49{position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;width:100%;height:100%;pointer-events:none;overflow:visible}._topologyLink_6dxry_49{stroke:color-mix(in srgb,var(--accent) 62%,var(--border));stroke-linecap:round;stroke-width:1.5;opacity:.82}._topologyLink_agent_6dxry_66{stroke:color-mix(in srgb,var(--accent) 58%,var(--border))}._topologyLink_studio_6dxry_70{stroke:color-mix(in srgb,var(--accent) 66%,var(--border))}._topologyGrid_6dxry_74{position:relative;z-index:1;display:grid;grid-template-columns:minmax(220px,1fr) minmax(220px,.82fr) minmax(240px,1.18fr);align-items:start;gap:52px}._topologyColumn_6dxry_83{min-width:0;display:flex;flex-direction:column;gap:10px}._topologyColumnHeader_6dxry_90{display:flex;align-items:center;gap:8px;min-height:28px;color:var(--text-primary);font-family:var(--font-label);font-size:12px;font-weight:700}._topologyColumnHeaderSpacer_6dxry_101{min-height:28px}._topologyCount_6dxry_105{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:20px;padding:0 6px;border-radius:var(--radius-pill);background:var(--bg-secondary);border:1px solid var(--border);color:var(--text-secondary);font-family:var(--font-code);font-size:11px}._topologyList_6dxry_120{display:flex;flex-direction:column;gap:8px;justify-content:flex-start;min-height:178px}._topologyListCentered_6dxry_128{justify-content:center}._topologyNode_6dxry_132{min-width:0;border:1px solid var(--border);border-radius:8px;background:var(--bg-secondary);padding:10px 12px}._topologyNodeTitle_6dxry_140{display:flex;align-items:center;min-width:0;gap:8px;color:var(--text-primary);font-family:var(--font-label);font-size:13px;font-weight:600}._topologyNodeTitle_6dxry_140 strong,._topologyNodeTitle_6dxry_140 span{min-width:0}._topologyNodeMeta_6dxry_156,._topologyNodeSubtle_6dxry_157{margin-top:6px;color:var(--text-secondary);font-family:var(--font-code);font-size:11px;line-height:1.4;overflow-wrap:anywhere}._topologyNodeSubtle_6dxry_157{color:var(--text-muted)}._topologyState_6dxry_170{margin-left:auto;flex:0 0 auto;border:1px solid var(--border);border-radius:var(--radius-pill);padding:2px 7px;background:color-mix(in srgb,var(--bg-card) 76%,transparent);color:var(--text-secondary);font-family:var(--font-label);font-size:10px;font-weight:600}._topologyEmpty_6dxry_183{min-height:82px;display:flex;align-items:center;justify-content:center;border:1px dashed var(--border);border-radius:8px;color:var(--text-muted);background:color-mix(in srgb,var(--bg-secondary) 58%,transparent);padding:12px;text-align:center;font-size:12px;line-height:1.45}._topologyOverflow_6dxry_198{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:34px;padding:6px 8px 6px 12px;border:1px solid var(--border);border-radius:7px;background:color-mix(in srgb,var(--bg-card) 72%,transparent);color:var(--text-secondary);font-family:var(--font-label);font-size:12px}._topologyOverflowButton_6dxry_213{flex:0 0 auto;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;font-family:var(--font-label);font-size:11px;font-weight:600;padding:4px 8px;transition:background var(--transition),border-color var(--transition),color var(--transition)}._topologyOverflowButton_6dxry_213:hover{border-color:var(--border-highlight);background:var(--accent-dim);color:var(--accent)}._topologyServerColumn_6dxry_236{min-width:0;display:flex;flex-direction:column;gap:10px}._topologyServer_6dxry_236{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;min-height:178px;border-color:color-mix(in srgb,var(--accent) 42%,var(--border));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 16%,transparent)}._topologyServerIcon_6dxry_254{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border:1px solid var(--border-highlight);border-radius:50%;background:var(--accent-dim);color:var(--accent);margin-bottom:10px}._topologyServerBody_6dxry_267{display:flex;flex-direction:column;align-items:center;gap:8px;min-width:0;width:100%}._topologyServerTitle_6dxry_276{color:var(--text-primary);font-family:var(--font-label);font-size:15px;font-weight:700}._topologyServerMeta_6dxry_283{color:var(--text-secondary);font-family:var(--font-code);font-size:11px;overflow-wrap:anywhere}._routingSummaryCompact_6dxry_290{display:flex;justify-content:center;width:100%;min-width:0}._disabled_6dxry_298{opacity:.4;pointer-events:none}._cardHeader_6dxry_304{font-family:var(--font-label);font-weight:600;font-size:var(--type-card-title-size);text-transform:uppercase;letter-spacing:.05em;color:var(--text-primary);margin-bottom:var(--space-section);display:flex;align-items:center;justify-content:space-between}._restartButton_6dxry_317{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:32px;padding:0 10px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;font-family:var(--font-label);font-size:11px;font-weight:600;letter-spacing:0;text-transform:none;transition:background var(--transition),border-color var(--transition),color var(--transition)}._restartButton_6dxry_317:hover:not(:disabled){border-color:var(--border-highlight);background:var(--accent-dim);color:var(--accent)}._restartButton_6dxry_317:focus-visible{outline:none;box-shadow:var(--focus-ring)}._restartButton_6dxry_317:disabled{cursor:not-allowed;opacity:.55}._bridgeActionHint_6dxry_356{margin:calc(var(--space-section) * -.55) 0 12px;color:var(--text-muted);font-size:12px;line-height:1.5}._restartProgress_6dxry_363,._restartFailure_6dxry_364{display:flex;align-items:center;gap:12px;min-height:68px;border:1px solid var(--border-highlight);border-radius:var(--radius-control);padding:12px 14px;background:var(--accent-dim);color:var(--text-primary)}._restartProgress_6dxry_363 strong{font-family:var(--font-label);font-size:13px;font-weight:600}._restartProgress_6dxry_363 p,._restartFailure_6dxry_364 p{margin:4px 0 0;color:var(--text-secondary);font-size:12px;line-height:1.5}._restartFailure_6dxry_364{justify-content:space-between;border-color:var(--error-border);background:var(--error-bg)}._restartFailure_6dxry_364 p{margin:0;color:var(--error-text)}._restartIconSpinning_6dxry_401{animation:_restart-spin_6dxry_1 .9s linear infinite}@keyframes _restart-spin_6dxry_1{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){._restartIconSpinning_6dxry_401{animation:none}}._cardHint_6dxry_417{margin:-4px 0 12px;color:var(--text-muted);font-size:12px;line-height:1.5}._clearButton_6dxry_424{border:1px solid var(--danger-border);background:var(--danger-bg);color:var(--danger-text);border-radius:var(--radius-control);padding:6px 12px;font-family:var(--font-label);font-size:12px;font-weight:600;cursor:pointer;transition:background var(--transition),border-color var(--transition),color var(--transition)}._clearButton_6dxry_424:hover{background:var(--danger-hover-bg);border-color:var(--danger)}._clearButton_6dxry_424:focus-visible{outline:none;box-shadow:var(--focus-ring)}._serverGrid_6dxry_448{display:grid;grid-template-columns:auto 1fr;gap:4px 16px;font-family:var(--font-code);font-size:13px}._serverGrid_6dxry_448 dt{color:var(--text-muted)}._serverGrid_6dxry_448 dd{color:var(--text-primary);margin:0}._statusRow_6dxry_466{display:flex;align-items:center;gap:16px;margin-bottom:12px}._metaItem_6dxry_473{font-family:var(--font-code);font-size:12px;color:var(--text-secondary)}._table_6dxry_480{width:100%;border-collapse:collapse;font-family:var(--font-code);font-size:12px}._table_6dxry_480 th{text-align:left;color:var(--text-muted);font-weight:400;padding:4px 8px 4px 0;border-bottom:1px solid var(--border)}._table_6dxry_480 td{padding:6px 8px 6px 0;color:var(--text-primary)}._tableWrap_6dxry_500{overflow-x:auto}._table_6dxry_480 tr:hover td{background:var(--accent-dim)}._routingSummary_6dxry_290{display:inline-flex;align-items:center;gap:10px;margin-bottom:12px;flex-wrap:wrap}._manageLink_6dxry_516{display:inline-flex;align-items:center;height:24px;padding:0 8px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-primary);font-family:var(--font-label);font-size:11px;font-weight:600;text-decoration:none;transition:border-color var(--transition),background var(--transition),color var(--transition)}._manageLink_6dxry_516:hover{border-color:var(--border-highlight);background:var(--accent-dim);color:var(--accent);text-decoration:none}._segment_6dxry_542,._segmentActive_6dxry_543{height:28px;padding:0 10px;border:none;border-right:1px solid var(--border);background:transparent;color:var(--text-secondary);font-family:var(--font-label);font-size:12px;cursor:pointer}._segment_6dxry_542:last-child,._segmentActive_6dxry_543:last-child{border-right:none}._segment_6dxry_542:hover:not(:disabled){background:var(--accent-dim);color:var(--accent)}._segmentActive_6dxry_543{background:var(--accent-dim);color:var(--text-primary);font-weight:600}._segment_6dxry_542:disabled,._segmentActive_6dxry_543:disabled{cursor:default;opacity:.55}._targetPrimary_6dxry_577{white-space:nowrap}._monoMuted_6dxry_581{color:var(--text-secondary)}._copyIconButton_6dxry_585{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;margin-left:6px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-secondary);cursor:pointer;vertical-align:middle;transition:border-color var(--transition),background var(--transition),color var(--transition)}._copyIconButton_6dxry_585:hover{color:var(--accent);border-color:var(--border-highlight);background:var(--accent-dim)}._routingBadge_6dxry_610{display:inline-flex;align-items:center;min-height:22px;padding:0 8px;border:1px solid var(--border-highlight);border-radius:var(--radius-control);background:var(--accent-dim);color:var(--text-primary);font-family:var(--font-label);font-size:11px;font-weight:600}._studioStateBadge_6dxry_624{display:inline-flex;align-items:center;min-height:22px;padding:0 8px;border:1px solid var(--border);border-radius:var(--radius-control);background:var(--bg-secondary);color:var(--text-secondary);font-family:var(--font-label);font-size:11px;font-weight:600;white-space:nowrap}._studioState_running_6dxry_639{border-color:color-mix(in srgb,var(--success) 42%,var(--border));background:color-mix(in srgb,var(--success) 12%,var(--bg-secondary));color:var(--success)}._studioState_paused_6dxry_645{border-color:color-mix(in srgb,var(--warning) 42%,var(--border));background:color-mix(in srgb,var(--warning) 12%,var(--bg-secondary));color:var(--warning)}._studioState_edit_6dxry_651{border-color:var(--border-highlight);background:color-mix(in srgb,var(--accent) 9%,var(--bg-secondary));color:var(--text-primary)}._studioState_unknown_6dxry_657{border-color:var(--border);background:var(--bg-secondary);color:var(--text-muted)}._toggleBtn_6dxry_664{background:none;border:none;color:var(--text-secondary);cursor:pointer;font-size:12px;padding:0 4px;transition:color var(--transition)}._toggleBtn_6dxry_664:hover{color:var(--accent)}._disconnected_6dxry_679{text-align:center;padding:32px 16px}._disconnected_6dxry_679 h3{color:var(--error);font-size:16px;margin:0 0 8px}._disconnected_6dxry_679 p{color:var(--text-secondary);font-size:13px;margin:0 0 4px}._disconnectedActions_6dxry_696{display:flex;gap:8px;justify-content:center;margin-top:16px}._btn_6dxry_703{font-family:var(--font-label);font-size:12px;padding:6px 14px;border-radius:var(--radius-control);border:1px solid var(--border);background:var(--bg-secondary);color:var(--text-primary);cursor:pointer;transition:background var(--transition),border-color var(--transition)}._btn_6dxry_703:hover{border-color:var(--accent);background:var(--accent-dim)}._activity_active_6dxry_721,._activity_stale_6dxry_722,._activity_unknown_6dxry_723{display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:6px;vertical-align:middle}._activity_active_6dxry_721{background:var(--success);box-shadow:0 0 4px var(--success)}._activity_stale_6dxry_722{background:var(--text-muted)}._activity_unknown_6dxry_723{background:var(--text-muted);opacity:.4}._killBtn_6dxry_747{font-family:var(--font-label);font-size:11px;padding:3px 10px;border-radius:var(--radius-control);border:1px solid var(--danger-border);background:var(--danger-bg);color:var(--danger-text);cursor:pointer;transition:background var(--transition),border-color var(--transition)}._killBtn_6dxry_747:hover{background:var(--danger-hover-bg);border-color:var(--danger);color:var(--danger-text)}._killBtn_6dxry_747:focus-visible{outline:none;box-shadow:var(--focus-ring)}._emptyRow_6dxry_771{color:var(--text-muted);font-style:italic}@media(max-width:980px){._topologyHeader_6dxry_30{flex-direction:column;align-items:stretch}._topologyGrid_6dxry_74{grid-template-columns:1fr;gap:10px}._topologyColumnHeaderSpacer_6dxry_101{display:none}._topologyServer_6dxry_236{min-height:150px}}@media(max-width:640px){._card_6dxry_11,._topologyCard_6dxry_19{padding:14px}._topologyNodeTitle_6dxry_140{flex-wrap:wrap}._topologyState_6dxry_170{margin-left:0}}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{f as ge,u as re,r as d,j as e,d as ue,b as F,h as pe,D as ye,L as he,M as me,i as V,a as xe,k as _e,s as Se}from"./index-uP4eoQi-.js";import{I as _}from"./InfoLabel-DAd1I756.js";import{P as je}from"./PageHeader-_z4Dtkbg.js";import{S as ce,f as ae,u as ve}from"./useLiveUptime-BGDr-4gk.js";import{T as te}from"./TooltipText-NA7u0bu6.js";import{C as ee}from"./ConfirmModal-BbqpSaVw.js";import{B as be}from"./bot-D89pfHg8.js";import{C as J}from"./copy-DVGVC27v.js";import{R as ne}from"./rotate-ccw-Dxk8CuFi.js";import"./ConfirmModal.module-DJksQHBd.js";/**
|
|
2
|
+
* @license lucide-react v1.8.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const fe=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Ce=ge("server",fe),we="_container_1h084_2",Ne="_entry_1h084_14",Ie="_timestamp_1h084_21",ke="_message_1h084_27",Be="_warn_1h084_34",Pe="_error_1h084_39",Ae="_empty_1h084_44",G={container:we,entry:Ne,timestamp:Ie,message:ke,warn:Be,error:Pe,empty:Ae};function Le(t){const o=new Date(t);return Number.isNaN(o.getTime())?t:`${String(o.getHours()).padStart(2,"0")}:${String(o.getMinutes()).padStart(2,"0")}`}function Ee({entries:t}){const{t:o}=re(),s=d.useRef(null);return d.useEffect(()=>{const r=s.current;r&&(r.scrollTop=r.scrollHeight)},[t.length]),e.jsx("div",{ref:s,className:G.container,children:t.length===0?e.jsx("div",{className:G.empty,children:o("connection.log.empty","No events yet")}):t.map((r,i)=>e.jsxs("div",{className:`${G.entry} ${r.type?G[r.type]:""}`,children:[e.jsx("span",{className:G.timestamp,children:Le(r.timestamp)}),e.jsx("span",{className:G.message,children:r.message})]},i))})}const oe=50,Me=1e3,$e=45e3;function Te(){const t=new Date;return`${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function Re(){const{level:t,status:o,error:s,beginExpectedBridgeRestart:r,endExpectedBridgeRestart:i}=ue(),[u,p]=d.useState(null),[c,E]=d.useState(null),[C,M]=d.useState([]),[U,b]=d.useState("idle"),[$,R]=d.useState(null),z=d.useRef(null),f=d.useRef(0),D=d.useCallback((g,y)=>{M(S=>{const j=[...S,{timestamp:Te(),message:g,type:y}];return j.length>oe?j.slice(-oe):j})},[]),m=d.useCallback(async()=>{try{const g=await F.get("/connection-info");p(g)}catch{p(null)}},[]),w=d.useCallback(async()=>{try{const g=await F.get("/api/dashboard/studio-routing");E(g)}catch{E(null)}},[]),H=d.useCallback(async g=>{const y=await F.patch("/api/dashboard/studio-routing",g);return E(y),await m(),y},[m]),B=d.useCallback(async()=>{try{const g=await F.get("/api/dashboard/connection-log");M(g.entries??[])}catch{M([])}},[]),W=d.useCallback(async()=>{await F.post("/api/dashboard/connection-log/clear"),M([])},[]),I=d.useCallback(async g=>{await F.post("/api/dashboard/kill-agent",{instanceId:g}),await m()},[m]),O=d.useCallback((g,y,S)=>{(async()=>{const j=Date.now()+$e;for(;f.current===g&&Date.now()<j;){if(await new Promise(x=>setTimeout(x,Me)),f.current!==g)return;try{const x=await F.get("/status");if(!!!(x.instanceId&&x.sessionId&&x.instanceId!==y&&x.sessionId!==S))continue;if(await Promise.all([m(),w()]),f.current!==g)return;b("succeeded"),R(null),i();return}catch{}}f.current===g&&(b("failed"),R("bridge_restart_timeout"),i())})()},[i,m,w]),P=d.useCallback(async()=>{const g=(o==null?void 0:o.instanceId)??(u==null?void 0:u.serverInstanceId),y=(o==null?void 0:o.sessionId)??(u==null?void 0:u.sessionId);if(!g||!y)return b("failed"),R("bridge_restart_unavailable"),!1;const S=f.current+1;f.current=S,R(null),b("requesting"),r();try{return await F.post("/api/dashboard/bridge/restart",{instanceId:g,sessionId:y}),f.current!==S?!1:(b("reconnecting"),setTimeout(()=>{f.current===S&&O(S,g,y)},0),!0)}catch(j){return f.current!==S||(b("failed"),R(j instanceof pe&&j.error?j.error:"bridge_restart_failed"),i()),!1}},[r,u==null?void 0:u.serverInstanceId,u==null?void 0:u.sessionId,i,O,o==null?void 0:o.instanceId,o==null?void 0:o.sessionId]);return d.useEffect(()=>{t!=="disconnected"&&o?(m(),w()):E(null),B()},[t,o,m,B,w]),d.useEffect(()=>{const g=new ye;z.current=g,g.connect();const y=g.on("connection",j=>{const x=j;x.status!=="updated"&&x.clientId&&D(`Plugin ${x.status} — ${x.clientId}`,x.status==="disconnected"?"warn":"info"),m(),w()}),S=g.on("mcp_status",j=>{const x=j,A=x.status==="registered"?"registered":"unregistered";D(`MCP ${A} — ${x.aiClientName}`,x.status==="registered"?"info":"warn"),m(),w()});return()=>{y(),S(),g.disconnect(),z.current=null}},[D,m,w]),d.useEffect(()=>()=>{f.current+=1,i()},[i]),{status:o,connectionInfo:u,studioRouting:c,connectionLog:C,level:t,error:s,clearConnectionLog:W,killAgent:I,bridgeRestartState:U,bridgeRestartError:$,restartBridge:P,updateStudioRouting:H}}const De="_page_6dxry_2",He="_card_6dxry_11",Ue="_topologyCard_6dxry_19",Oe="_topologyDisconnected_6dxry_26",Fe="_topologyHeader_6dxry_30",We="_topologyIntro_6dxry_38",qe="_topologyNetwork_6dxry_45",Ye="_topologyLinks_6dxry_49",ze="_topologyLink_6dxry_49",Ge="_topologyLink_agent_6dxry_66",Ve="_topologyLink_studio_6dxry_70",Ke="_topologyGrid_6dxry_74",Xe="_topologyColumn_6dxry_83",Je="_topologyColumnHeader_6dxry_90",Qe="_topologyColumnHeaderSpacer_6dxry_101",Ze="_topologyCount_6dxry_105",et="_topologyList_6dxry_120",tt="_topologyListCentered_6dxry_128",nt="_topologyNode_6dxry_132",ot="_topologyNodeTitle_6dxry_140",st="_topologyNodeMeta_6dxry_156",it="_topologyNodeSubtle_6dxry_157",rt="_topologyState_6dxry_170",ct="_topologyEmpty_6dxry_183",at="_topologyOverflow_6dxry_198",lt="_topologyOverflowButton_6dxry_213",dt="_topologyServerColumn_6dxry_236",gt="_topologyServer_6dxry_236",ut="_topologyServerIcon_6dxry_254",pt="_topologyServerBody_6dxry_267",yt="_topologyServerTitle_6dxry_276",ht="_topologyServerMeta_6dxry_283",mt="_routingSummaryCompact_6dxry_290",xt="_disabled_6dxry_298",_t="_cardHeader_6dxry_304",St="_restartButton_6dxry_317",jt="_bridgeActionHint_6dxry_356",vt="_restartProgress_6dxry_363",bt="_restartFailure_6dxry_364",ft="_restartIconSpinning_6dxry_401",Ct="_cardHint_6dxry_417",wt="_clearButton_6dxry_424",Nt="_serverGrid_6dxry_448",It="_statusRow_6dxry_466",kt="_metaItem_6dxry_473",Bt="_table_6dxry_480",Pt="_tableWrap_6dxry_500",At="_routingSummary_6dxry_290",Lt="_manageLink_6dxry_516",Et="_segment_6dxry_542",Mt="_segmentActive_6dxry_543",$t="_targetPrimary_6dxry_577",Tt="_monoMuted_6dxry_581",Rt="_copyIconButton_6dxry_585",Dt="_routingBadge_6dxry_610",Ht="_studioStateBadge_6dxry_624",Ut="_studioState_running_6dxry_639",Ot="_studioState_paused_6dxry_645",Ft="_studioState_edit_6dxry_651",Wt="_studioState_unknown_6dxry_657",qt="_toggleBtn_6dxry_664",Yt="_disconnected_6dxry_679",zt="_disconnectedActions_6dxry_696",Gt="_btn_6dxry_703",Vt="_activity_active_6dxry_721",Kt="_activity_stale_6dxry_722",Xt="_activity_unknown_6dxry_723",Jt="_killBtn_6dxry_747",Qt="_emptyRow_6dxry_771",n={page:De,card:He,topologyCard:Ue,topologyDisconnected:Oe,topologyHeader:Fe,topologyIntro:We,topologyNetwork:qe,topologyLinks:Ye,topologyLink:ze,topologyLink_agent:Ge,topologyLink_studio:Ve,topologyGrid:Ke,topologyColumn:Xe,topologyColumnHeader:Je,topologyColumnHeaderSpacer:Qe,topologyCount:Ze,topologyList:et,topologyListCentered:tt,topologyNode:nt,topologyNodeTitle:ot,topologyNodeMeta:st,topologyNodeSubtle:it,topologyState:rt,topologyEmpty:ct,topologyOverflow:at,topologyOverflowButton:lt,topologyServerColumn:dt,topologyServer:gt,topologyServerIcon:ut,topologyServerBody:pt,topologyServerTitle:yt,topologyServerMeta:ht,routingSummaryCompact:mt,disabled:xt,cardHeader:_t,restartButton:St,bridgeActionHint:jt,restartProgress:vt,restartFailure:bt,restartIconSpinning:ft,"restart-spin":"_restart-spin_6dxry_1",cardHint:Ct,clearButton:wt,serverGrid:Nt,statusRow:It,metaItem:kt,table:Bt,tableWrap:Pt,routingSummary:At,manageLink:Lt,segment:Et,segmentActive:Mt,targetPrimary:$t,monoMuted:Tt,copyIconButton:Rt,routingBadge:Dt,studioStateBadge:Ht,studioState_running:Ut,studioState_paused:Ot,studioState_edit:Ft,studioState_unknown:Wt,toggleBtn:qt,disconnected:Yt,disconnectedActions:zt,btn:Gt,activity_active:Vt,activity_stale:Kt,activity_unknown:Xt,killBtn:Jt,emptyRow:Qt},X=5;function Zt(t){return t?Date.now()-t<3e4?"active":"stale":"unknown"}function en(t,o){return t==="active"?o("connection.topology.active","Active"):t==="stale"?o("connection.topology.stale","Stale"):o("connection.topology.unknown","Unknown")}function se(t){return t.length>10?t.slice(0,10):t}function ie(t,o){return t.replace("{count}",String(o))}function tn(t,o,s){const r=t.studioState??"unknown",i={edit:o("connection.targets.studioState.edit","Edit"),running:o("connection.targets.studioState.running","Running"),paused:o("connection.targets.studioState.paused","Paused"),unknown:o("connection.targets.studioState.unknown","Unknown")},u=t.studioStateSource==="thread"?o("connection.targets.studioState.source.thread","WEPPY play command"):t.studioStateSource==="pluginConnection"?o("connection.targets.studioState.source.pluginConnection","Studio Play/Test connection"):t.studioStateSource==="runService"?o("connection.targets.studioState.source.runService","Studio RunService"):o("connection.targets.studioState.source.unknown","Unknown source"),p=t.studioStateUpdatedAt?s(t.studioStateUpdatedAt):o("connection.targets.studioState.updatedUnknown","not reported");return{state:r,label:i[r],tooltip:`${u} · ${p}`}}function nn(t,o){return t.length!==o.length?!1:t.every((s,r)=>{const i=o[r];return i!==void 0&&s.id===i.id&&s.side===i.side&&Math.abs(s.x1-i.x1)<.5&&Math.abs(s.y1-i.y1)<.5&&Math.abs(s.x2-i.x2)<.5&&Math.abs(s.y2-i.y2)<.5})}function k(t,o,s){return{x:o-t.left,y:s-t.top}}function on(t,o,s,r){if(o.right<=s.left){const p=k(r,o.right,o.top+o.height/2),c=k(r,s.left,s.top+s.height/2);return{id:t,side:"agent",x1:p.x,y1:p.y,x2:c.x,y2:c.y}}if(o.bottom<=s.top){const p=k(r,o.left+o.width/2,o.bottom),c=k(r,s.left+s.width/2,s.top);return{id:t,side:"agent",x1:p.x,y1:p.y,x2:c.x,y2:c.y}}const i=k(r,o.left+o.width/2,o.top),u=k(r,s.left+s.width/2,s.bottom);return{id:t,side:"agent",x1:i.x,y1:i.y,x2:u.x,y2:u.y}}function sn(t,o,s,r){if(s.right<=o.left){const p=k(r,o.left,o.top+o.height/2),c=k(r,s.right,s.top+s.height/2);return{id:t,side:"studio",x1:p.x,y1:p.y,x2:c.x,y2:c.y}}if(s.bottom<=o.top){const p=k(r,o.left+o.width/2,o.top),c=k(r,s.left+s.width/2,s.bottom);return{id:t,side:"studio",x1:p.x,y1:p.y,x2:c.x,y2:c.y}}const i=k(r,o.left+o.width/2,o.bottom),u=k(r,s.left+s.width/2,s.top);return{id:t,side:"studio",x1:i.x,y1:i.y,x2:u.x,y2:u.y}}function rn({agents:t,isDisconnected:o,pinnedTargetClientId:s,priorityTarget:r,status:i,studioRoutingMode:u,studioTargets:p,t:c,timeAgo:E,onCopySelector:C,onManageRouting:M}){const[U,b]=d.useState(!1),[$,R]=d.useState(!1),[z,f]=d.useState([]),D=d.useRef(null),m=d.useRef(null),w=d.useRef(new Map),H=d.useRef(new Map),B=u==="pinned"?c("connection.routing.pinned","Manual: Pinned Studio"):c("connection.routing.recentPriority","Automatic: Recent priority"),W=o?"offline":"online",I=d.useMemo(()=>U?t:t.slice(0,X),[t,U]),O=Math.max(0,t.length-I.length),P=d.useMemo(()=>$?p:p.slice(0,X),[p,$]),g=Math.max(0,p.length-P.length),y=[n.topologyList,I.length<=1?n.topologyListCentered:""].filter(Boolean).join(" "),S=[n.topologyList,P.length<=1?n.topologyListCentered:""].filter(Boolean).join(" "),j=d.useCallback(a=>h=>{if(h){w.current.set(a,h);return}w.current.delete(a)},[]),x=d.useCallback(a=>h=>{if(h){H.current.set(a,h);return}H.current.delete(a)},[]),A=d.useCallback(()=>{const a=D.current,h=m.current;if(!a||!h){f([]);return}const v=a.getBoundingClientRect(),N=h.getBoundingClientRect(),L=[];I.forEach(T=>{const q=w.current.get(T.instanceId);q&&L.push(on(`agent-${T.instanceId}`,q.getBoundingClientRect(),N,v))}),P.forEach(T=>{const q=H.current.get(T.clientId);q&&L.push(sn(`studio-${T.clientId}`,q.getBoundingClientRect(),N,v))}),f(T=>nn(T,L)?T:L)},[I,P]);return d.useLayoutEffect(()=>{A();const a=[D.current,m.current,...I.map(v=>w.current.get(v.instanceId)),...P.map(v=>H.current.get(v.clientId))].filter(v=>v!=null);if(window.addEventListener("resize",A),typeof ResizeObserver>"u")return()=>{window.removeEventListener("resize",A)};const h=new ResizeObserver(A);return a.forEach(v=>h.observe(v)),()=>{window.removeEventListener("resize",A),h.disconnect()}},[A,I,P]),e.jsxs("section",{className:`${n.topologyCard} ${o?n.topologyDisconnected:""}`,"aria-label":c("connection.topology.ariaLabel","Connection topology"),children:[e.jsxs("div",{className:n.topologyHeader,children:[e.jsxs("div",{children:[e.jsx("div",{className:n.cardHeader,children:c("connection.topology.title","Connection topology")}),e.jsx("p",{className:n.topologyIntro,children:c("connection.topology.description","Each AI agent connects through its own MCP Adapter to one shared WEPPY Bridge, which keeps Roblox Studio connected.")})]}),e.jsx(he,{to:"/controls?section=studio-routing",className:n.manageLink,onClick:M,children:c("connection.routing.manage","Manage routing")})]}),e.jsxs("div",{className:n.topologyNetwork,ref:D,children:[e.jsx("svg",{"aria-hidden":"true",className:n.topologyLinks,"data-testid":"topology-connection-lines",focusable:"false",children:z.map(a=>e.jsx("line",{className:`${n.topologyLink} ${n[`topologyLink_${a.side}`]}`,"data-side":a.side,vectorEffect:"non-scaling-stroke",x1:a.x1,x2:a.x2,y1:a.y1,y2:a.y2},a.id))}),e.jsxs("div",{className:n.topologyGrid,children:[e.jsxs("div",{className:n.topologyColumn,children:[e.jsxs("div",{className:n.topologyColumnHeader,children:[e.jsx(be,{size:15,"aria-hidden":"true"}),e.jsx("span",{children:c("connection.agents.title","AI Agents")}),e.jsx("span",{className:n.topologyCount,children:t.length})]}),e.jsxs("div",{className:y,children:[t.length>0?I.map(a=>{const h=Zt(a.lastSeen),v=a.aiClientName??se(a.instanceId),N=a.lastSeen,L=a.mcpVersion?`${c("connection.topology.adapterRole","MCP Adapter")} v${a.mcpVersion}`:c("connection.topology.adapterRole","MCP Adapter");return e.jsxs("div",{className:n.topologyNode,ref:j(a.instanceId),children:[e.jsxs("div",{className:n.topologyNodeTitle,children:[e.jsx("span",{className:n[`activity_${h}`]}),e.jsx("strong",{children:v}),e.jsx("span",{className:n.topologyState,children:en(h,c)})]}),e.jsxs("div",{className:n.topologyNodeMeta,children:[e.jsx("span",{children:L})," ·"," ",c("connection.server.session","Session")," ",se(a.instanceId)," ·"," ",N?`${c("connection.topology.lastContact","Last contact")} ${E(N)}`:c("connection.topology.noContact","No recent contact")]})]},a.instanceId)}):e.jsx("div",{className:n.topologyEmpty,children:c("connection.agents.none","No agents connected")}),t.length>X?e.jsxs("div",{className:n.topologyOverflow,children:[O>0?e.jsx("span",{children:ie(c("connection.topology.moreAgents","+{count} more agents"),O)}):e.jsx("span",{children:c("connection.topology.allAgentsVisible","All agents visible")}),e.jsx("button",{type:"button",className:n.topologyOverflowButton,"aria-label":U?c("connection.topology.showLessAgents","Show less AI agents"):c("connection.topology.showAllAgents","Show all AI agents"),onClick:()=>b(a=>!a),children:U?c("connection.topology.showLess","Show less"):c("connection.topology.showAll","Show all")})]}):null]})]}),e.jsxs("div",{className:n.topologyServerColumn,children:[e.jsx("div",{className:n.topologyColumnHeaderSpacer,"aria-hidden":"true"}),e.jsxs("div",{className:`${n.topologyNode} ${n.topologyServer}`,ref:m,children:[e.jsx("div",{className:n.topologyServerIcon,children:e.jsx(Ce,{size:18,"aria-hidden":"true"})}),e.jsxs("div",{className:n.topologyServerBody,children:[e.jsx("div",{className:n.topologyServerTitle,children:c("connection.topology.serverTitle","WEPPY Bridge")}),e.jsx(ce,{status:W}),e.jsxs("div",{className:n.topologyServerMeta,children:[i!=null&&i.version?`v${i.version}`:c("connection.topology.versionUnknown","Version unknown"),i!=null&&i.sessionId?` · ${c("connection.server.session","Session")} ${i.sessionId.slice(0,8)}`:""]}),(i==null?void 0:i.pid)!=null||(i==null?void 0:i.uptime)!=null?e.jsxs("div",{className:n.topologyNodeSubtle,children:[(i==null?void 0:i.pid)!=null?e.jsx("span",{children:`${c("connection.server.pid","PID")} ${i.pid}`}):null,(i==null?void 0:i.pid)!=null&&(i==null?void 0:i.uptime)!=null?" · ":"",(i==null?void 0:i.uptime)!=null?e.jsx("span",{children:`${c("connection.server.uptime","Uptime")} ${ae(i.uptime)}`}):null]}):null,e.jsx("div",{className:n.routingSummaryCompact,children:e.jsx("span",{className:n.routingBadge,children:B})})]})]})]}),e.jsxs("div",{className:n.topologyColumn,children:[e.jsxs("div",{className:n.topologyColumnHeader,children:[e.jsx(me,{size:15,"aria-hidden":"true"}),e.jsx("span",{children:c("connection.targets.title","Studio Targets")}),e.jsx("span",{className:n.topologyCount,children:p.length})]}),e.jsxs("div",{className:S,children:[p.length>0?P.map(a=>{const h=u==="pinned"&&s===a.clientId,v=u==="recentPriority"&&(r==null?void 0:r.clientId)===a.clientId,N=tn(a,c,E);return e.jsxs("div",{className:n.topologyNode,ref:x(a.clientId),children:[e.jsxs("div",{className:n.topologyNodeTitle,children:[e.jsx("span",{className:n.targetPrimary,children:a.targetAlias}),e.jsx(V,{text:c("connection.targets.copyTargetAlias","Copy Studio ID"),children:e.jsx("button",{type:"button",className:n.copyIconButton,"aria-label":c("connection.targets.copyTargetAlias","Copy Studio ID"),onClick:()=>C(a.targetAlias,"target_alias"),children:e.jsx(J,{size:13,"aria-hidden":"true"})})}),h?e.jsx("span",{className:n.routingBadge,children:c("connection.routing.pinnedBadge","Pinned")}):v?e.jsx("span",{className:n.routingBadge,children:c("connection.routing.priorityBadge","Priority")}):null,e.jsx(V,{text:N.tooltip,children:e.jsx("span",{className:`${n.studioStateBadge} ${n[`studioState_${N.state}`]}`,children:N.label})})]}),e.jsxs("div",{className:n.topologyNodeMeta,children:[e.jsx("span",{children:a.placeName??c("connection.topology.placeUnknown","Place unknown")}),a.placeId!==void 0?` · ${a.placeId}`:""]}),e.jsxs("div",{className:n.topologyNodeSubtle,children:[a.connectionState," · ",c("connection.targets.lastSeen","Last Seen")," ",E(a.lastSeen)]})]},a.clientId)}):e.jsx("div",{className:n.topologyEmpty,children:c("connection.targets.none","No Studio targets connected. Open Roblox Studio and connect WEPPY Plugin.")}),p.length>X?e.jsxs("div",{className:n.topologyOverflow,children:[g>0?e.jsx("span",{children:ie(c("connection.topology.moreStudios","+{count} more studios"),g)}):e.jsx("span",{children:c("connection.topology.allStudiosVisible","All studios visible")}),e.jsx("button",{type:"button",className:n.topologyOverflowButton,"aria-label":$?c("connection.topology.showLessStudios","Show less Studio targets"):c("connection.topology.showAllStudios","Show all Studio targets"),onClick:()=>R(a=>!a),children:$?c("connection.topology.showLess","Show less"):c("connection.topology.showAll","Show all")})]}):null]})]})]})]})]})}function Y(t,o){const s=Math.max(0,Math.floor((Date.now()-t)/1e3));return s<60?`${s}${o("connection.time.secondsAgo","s ago")}`:s<3600?`${Math.floor(s/60)}${o("connection.time.minutesAgo","m ago")}`:`${Math.floor(s/3600)}${o("connection.time.hoursAgo","h ago")}`}function cn(t){return t?Date.now()-t<3e4?"active":"stale":"unknown"}function an(t,o){const s=t.studioState??"unknown",r={edit:o("connection.targets.studioState.edit","Edit"),running:o("connection.targets.studioState.running","Running"),paused:o("connection.targets.studioState.paused","Paused"),unknown:o("connection.targets.studioState.unknown","Unknown")},i=t.studioStateSource==="thread"?o("connection.targets.studioState.source.thread","WEPPY play command"):t.studioStateSource==="pluginConnection"?o("connection.targets.studioState.source.pluginConnection","Studio Play/Test connection"):t.studioStateSource==="runService"?o("connection.targets.studioState.source.runService","Studio RunService"):o("connection.targets.studioState.source.unknown","Unknown source"),u=t.studioStateUpdatedAt?Y(t.studioStateUpdatedAt,o):o("connection.targets.studioState.updatedUnknown","not reported"),p=t.playtestMode&&t.playtestMode!=="unknown"?` · ${t.playtestMode}`:"";return{state:s,label:`${r[s]}${p}`,tooltip:`${i} · ${u}`}}function Sn(){const{t}=re(),{trackEvent:o}=xe(),{status:s,connectionInfo:r,studioRouting:i,connectionLog:u,level:p,clearConnectionLog:c,killAgent:E,bridgeRestartState:C,bridgeRestartError:M,restartBridge:U}=Re(),{show:b}=_e(),[$,R]=d.useState(!0),[z,f]=d.useState(!1),[D,m]=d.useState(!1),[w,H]=d.useState(!1),[B,W]=d.useState(null),[I,O]=d.useState(!1),P=ve(s==null?void 0:s.uptime),g=d.useRef(C),y=p==="disconnected",S=C==="requesting"||C==="reconnecting",j=((r==null?void 0:r.mcpInstanceCount)??0)>0,x=!!(((s==null?void 0:s.instanceId)??(r==null?void 0:r.serverInstanceId))&&((s==null?void 0:s.sessionId)??(r==null?void 0:r.sessionId))),A=!y&&!S&&j&&x,a=y?"offline":"online",h=(i==null?void 0:i.studioRoutingMode)??(s==null?void 0:s.studioRoutingMode)??"recentPriority",v=(i==null?void 0:i.pinnedTargetClientId)??(s==null?void 0:s.pinnedTargetClientId)??null,N=Se((i==null?void 0:i.targets)??(s==null?void 0:s.pluginClients)??[],h,v),L=(i==null?void 0:i.priorityTarget)??N[0];d.useEffect(()=>{const l=g.current;g.current=C,l!==C&&(C==="succeeded"?b(t("connection.server.restartSucceeded","WEPPY Bridge restarted"),"success"):C==="failed"&&b(t("connection.server.restartFailed","WEPPY Bridge could not be restarted"),"error"))},[C,b,t]);const T=M==="bridge_restart_timeout"?t("connection.server.restartTimeout","The new Bridge did not become ready in time. Check the MCP connection in your AI tool, then try again."):M==="bridge_restart_stale"?t("connection.server.restartStale","The Bridge changed before the restart request was accepted. Refresh the current status and try again."):M==="bridge_restart_unavailable"?t("connection.server.restartUnavailable","Connect at least one AI Agent before restarting so its MCP Adapter can start the new Bridge."):t("connection.server.restartFailed","WEPPY Bridge could not be restarted"),q=async()=>{await U()&&m(!1)},le=async()=>{if(B){O(!0);try{await E(B.instanceId),b(t("connection.agents.killed","Agent killed"),"success"),W(null)}catch{b(t("connection.agents.killFailed","Failed to kill agent"),"error")}finally{O(!1)}}},de=async()=>{H(!0);try{await c(),b(t("toast.clearSuccess","Cleared successfully"),"success"),f(!1)}catch{b(t("toast.clearFailed","Failed to clear data"),"error")}finally{H(!1)}},K=async(l,Q)=>{try{await navigator.clipboard.writeText(l),b(t("connection.targets.copied","Copied value"),"success"),o("dashboard_click_event",{click_target:`connection_copy_${Q}`,page:"connection"})}catch{b(t("connection.targets.copyFailed","Failed to copy value"),"error")}};return e.jsxs("div",{className:n.page,children:[e.jsx(je,{title:t("page.connection.title","Connection"),description:t("page.connection.description","Inspect WEPPY Bridge, MCP Adapter, Studio Plugin, and connection log status."),helpTopicId:"connection",helpState:{connectionLevel:p}}),e.jsx(rn,{agents:(r==null?void 0:r.mcpInstances)??[],isDisconnected:y&&!S,pinnedTargetClientId:v,priorityTarget:L,status:s??null,studioRoutingMode:h,studioTargets:N,t,timeAgo:l=>Y(l,t),onCopySelector:K,onManageRouting:()=>o("dashboard_click_event",{click_target:"connection_manage_routing",page:"connection"})}),e.jsxs("div",{className:n.card,children:[e.jsxs("div",{className:n.cardHeader,children:[e.jsx("span",{children:t("connection.server.title","Bridge Status")}),e.jsxs("button",{type:"button",className:n.restartButton,disabled:!A,title:j?void 0:t("connection.server.restartUnavailable","Connect at least one AI Agent before restarting so its MCP Adapter can start the new Bridge."),onClick:()=>{o("dashboard_click_event",{click_target:"connection_restart_bridge",page:"connection"}),m(!0)},children:[e.jsx(ne,{size:14,"aria-hidden":"true",className:S?n.restartIconSpinning:void 0}),S?t("connection.server.restarting","Restarting…"):t("connection.server.restart","Restart Bridge")]})]}),!j&&!y?e.jsx("p",{className:n.bridgeActionHint,children:t("connection.server.restartUnavailable","Connect at least one AI Agent before restarting so its MCP Adapter can start the new Bridge.")}):null,S?e.jsxs("div",{className:n.restartProgress,role:"status","aria-live":"polite",children:[e.jsx(ne,{size:18,"aria-hidden":"true",className:n.restartIconSpinning}),e.jsxs("div",{children:[e.jsx("strong",{children:C==="requesting"?t("connection.server.restartRequesting","Requesting Bridge restart…"):t("connection.server.restartReconnecting","Reconnecting to WEPPY Bridge…")}),e.jsx("p",{children:t("connection.server.restartWaiting","Dashboard and Studio connections will return automatically when the new Bridge is ready.")})]})]}):C==="failed"?e.jsxs("div",{className:n.restartFailure,role:"alert",children:[e.jsx("p",{children:T}),e.jsx("button",{type:"button",className:n.btn,onClick:()=>{y?window.location.reload():m(!0)},children:t("common.retry","Retry")})]}):y?e.jsxs("div",{className:n.disconnected,children:[e.jsx("h3",{children:t("level.l0.title")}),e.jsx("p",{children:t("level.l0.message")}),e.jsx("p",{children:t("common.reconnecting")}),e.jsxs("div",{className:n.disconnectedActions,children:[e.jsx("button",{className:n.btn,onClick:()=>window.location.reload(),children:t("connection.reconnect","Reconnect")}),e.jsx("button",{className:n.btn,onClick:()=>{window.location.hash="#/settings"},children:t("connection.checkSettings","Check Settings")})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:n.statusRow,children:e.jsx(ce,{status:a})}),e.jsxs("dl",{className:n.serverGrid,children:[(s==null?void 0:s.version)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(_,{label:t("connection.server.version","Version"),tooltip:t("connection.server.version.tooltip","WEPPY Bridge runtime version")})}),e.jsx("dd",{children:e.jsx(te,{text:t("connection.server.version.tooltip","WEPPY Bridge runtime version"),children:`v${s.version}`})})]}),(s==null?void 0:s.pid)!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(_,{label:t("connection.server.pid","PID"),tooltip:t("connection.server.pid.tooltip","Operating system process identifier")})}),e.jsx("dd",{children:s.pid})]}),(s==null?void 0:s.uptime)!=null&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(_,{label:t("connection.server.uptime","Uptime"),tooltip:t("connection.server.uptime.tooltip","Time elapsed since the WEPPY Bridge started")})}),e.jsx("dd",{children:ae(P??s.uptime)})]}),(s==null?void 0:s.sessionId)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(_,{label:t("connection.server.session","Session"),tooltip:t("connection.server.session.tooltip","Current WEPPY Bridge session identifier")})}),e.jsx("dd",{children:s.sessionId.slice(0,8)})]}),(r==null?void 0:r.serverExecutable)&&e.jsxs(e.Fragment,{children:[e.jsx("dt",{children:e.jsx(_,{label:t("connection.server.exec","Exec"),tooltip:t("connection.server.exec.tooltip","Executable path used to launch the WEPPY Bridge")})}),e.jsx("dd",{children:r.serverExecutable})]})]})]})]}),e.jsxs("div",{className:`${n.card} ${y?n.disabled:""}`,children:[e.jsxs("div",{className:n.cardHeader,children:[e.jsxs("span",{children:[t("connection.agents.title","AI Agents")," ","(",(r==null?void 0:r.mcpInstanceCount)??0,")"]}),e.jsx("button",{className:n.toggleBtn,onClick:()=>R(l=>!l),"aria-label":$?t("common.collapse","Collapse"):t("common.expand","Expand"),children:$?"▾":"▸"})]}),$&&e.jsxs("table",{className:n.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:t("connection.agents.name","Agent")}),e.jsx("th",{children:e.jsx(_,{label:t("connection.agents.version","Version"),tooltip:t("connection.agents.version.tooltip","MCP Adapter package version for this agent session")})}),e.jsx("th",{children:e.jsx(_,{label:t("connection.server.pid","PID"),tooltip:t("connection.server.pid.tooltip","Operating system process identifier")})}),e.jsx("th",{children:e.jsx(_,{label:t("connection.agents.projectRoot","Project Root"),tooltip:t("connection.agents.projectRoot.tooltip","Authoritative project root for sync ownership")})}),e.jsx("th",{children:t("connection.agents.connected","Connected")}),e.jsx("th",{children:e.jsx(_,{label:t("connection.agents.lastSeen","Last contact"),tooltip:t("connection.agents.lastSeen.tooltip","Last heartbeat or tool request received from this agent. Check Last Command for tool use.")})}),e.jsx("th",{children:e.jsx(_,{label:t("connection.agents.lastCommand","Last Command"),tooltip:t("connection.agents.lastCommand.tooltip","Most recent tool request from this agent.")})}),e.jsx("th",{})]})}),e.jsx("tbody",{children:r!=null&&r.mcpInstances&&r.mcpInstances.length>0?r.mcpInstances.map(l=>e.jsxs("tr",{children:[e.jsxs("td",{children:[e.jsx("span",{className:n[`activity_${cn(l.lastSeen)}`]}),l.aiClientName??t("connection.agents.unknown","Unknown")]}),e.jsx("td",{children:l.mcpVersion??"-"}),e.jsx("td",{children:l.pid}),e.jsx("td",{children:l.projectRoot??l.cwd??t("connection.agents.projectRoot.unresolved","Unresolved")}),e.jsx("td",{children:Y(l.connectedAt,t)}),e.jsx("td",{children:l.lastSeen?Y(l.lastSeen,t):"-"}),e.jsx("td",{children:l.lastCommandAt?Y(l.lastCommandAt,t):"-"}),e.jsx("td",{children:!l.isServer&&e.jsx("button",{className:n.killBtn,onClick:()=>{o("dashboard_click_event",{click_target:"connection_kill_agent",page:"connection"}),W({instanceId:l.instanceId,name:l.aiClientName??l.instanceId.slice(0,8)})},children:t("connection.agents.kill","Kill")})})]},l.instanceId)):e.jsx("tr",{children:e.jsx("td",{colSpan:8,className:n.emptyRow,children:t("connection.agents.none","No agents connected")})})})]})]}),e.jsxs("div",{className:`${n.card} ${y?n.disabled:""}`,children:[e.jsxs("div",{className:n.cardHeader,children:[t("connection.targets.title","Studio Targets")," ","(",N.length,")"]}),e.jsx("p",{className:n.cardHint,children:t("connection.targets.help","When multiple Studio windows are connected, tell the agent to use Studio ID studio-1 to choose one.")}),e.jsx("div",{className:n.tableWrap,children:e.jsxs("table",{className:n.table,children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:e.jsx(_,{label:t("connection.targets.target","Studio ID"),tooltip:t("connection.targets.target.tooltip","Short name for this Roblox Studio window")})}),e.jsx("th",{children:t("connection.targets.place","Place")}),e.jsx("th",{children:e.jsx(_,{label:t("connection.targets.placeId","Place ID"),tooltip:t("connection.targets.placeId.tooltip","Roblox Place ID for this Studio window")})}),e.jsx("th",{children:e.jsx(_,{label:t("connection.targets.clientId","Connection ID"),tooltip:t("connection.targets.clientId.tooltip","Full connection ID for diagnostics. Usually use Studio ID instead.")})}),e.jsx("th",{children:e.jsx(_,{label:t("connection.targets.studioState","Studio State"),tooltip:t("connection.targets.studioState.tooltip","Current edit/play runtime state reported by this Studio window")})}),e.jsx("th",{children:e.jsx(_,{label:t("connection.targets.session","Session"),tooltip:t("connection.targets.session.tooltip","Command channel state for this Studio target")})}),e.jsx("th",{children:e.jsx(_,{label:t("connection.targets.lastUsed","Last Used"),tooltip:t("connection.targets.lastUsed.tooltip","Most recent plugin-route request routed to this Studio target")})}),e.jsx("th",{children:e.jsx(_,{label:t("connection.targets.lastSeen","Last Seen"),tooltip:t("connection.targets.lastSeen.tooltip","Most recent heartbeat received from this Studio target")})}),e.jsx("th",{children:e.jsx(_,{label:t("connection.targets.version","Version"),tooltip:t("connection.targets.version.tooltip","Installed plugin version reported by Studio")})}),e.jsx("th",{children:e.jsx(_,{label:t("connection.targets.routing","Routing"),tooltip:t("connection.targets.routing.tooltip","Routing priority for requests without a named Studio target")})}),e.jsx("th",{children:e.jsx(_,{label:t("connection.targets.inFlight","In Flight"),tooltip:t("connection.targets.inFlight.tooltip","Active command request currently routed to this Studio target")})})]})}),e.jsx("tbody",{children:N.length>0?N.map(l=>{const Q=l.clientId.slice(0,10),Z=an(l,t);return e.jsxs("tr",{children:[e.jsxs("td",{children:[e.jsx("span",{className:n.monoMuted,title:l.clientId,children:l.targetAlias}),e.jsx(V,{text:t("connection.targets.copyTargetAlias","Copy Studio ID"),children:e.jsx("button",{type:"button",className:n.copyIconButton,"aria-label":t("connection.targets.copyTargetAlias","Copy Studio ID"),onClick:()=>K(l.targetAlias,"target_alias"),children:e.jsx(J,{size:13,"aria-hidden":"true"})})})]}),e.jsx("td",{children:e.jsx("span",{className:n.targetPrimary,children:l.placeName??"-"})}),e.jsxs("td",{children:[l.placeId??"-",l.placeId!==void 0?e.jsx(V,{text:t("connection.targets.copyPlaceId","Copy Place ID"),children:e.jsx("button",{type:"button",className:n.copyIconButton,"aria-label":t("connection.targets.copyPlaceId","Copy Place ID"),onClick:()=>K(String(l.placeId),"place_id"),children:e.jsx(J,{size:13,"aria-hidden":"true"})})}):null]}),e.jsxs("td",{children:[e.jsx("span",{className:n.monoMuted,title:l.clientId,children:Q}),e.jsx(V,{text:t("connection.targets.copyClientId","Copy Connection ID"),children:e.jsx("button",{type:"button",className:n.copyIconButton,"aria-label":t("connection.targets.copyClientId","Copy Connection ID"),onClick:()=>K(l.clientId,"client_id"),children:e.jsx(J,{size:13,"aria-hidden":"true"})})})]}),e.jsx("td",{children:e.jsx(te,{text:Z.tooltip,children:e.jsx("span",{className:`${n.studioStateBadge} ${n[`studioState_${Z.state}`]}`,children:Z.label})})}),e.jsx("td",{children:l.connectionState}),e.jsx("td",{children:l.lastRoutedAt?Y(l.lastRoutedAt,t):"-"}),e.jsx("td",{children:Y(l.lastSeen,t)}),e.jsx("td",{children:l.pluginVersion??"-"}),e.jsx("td",{children:h==="pinned"&&v===l.clientId?e.jsx("span",{className:n.routingBadge,children:t("connection.routing.pinnedBadge","Pinned")}):h==="recentPriority"&&(L==null?void 0:L.clientId)===l.clientId?e.jsx("span",{className:n.routingBadge,children:t("connection.routing.priorityBadge","Priority")}):e.jsx("span",{className:n.monoMuted,children:"-"})}),e.jsx("td",{children:l.inFlightRequestId?l.inFlightRequestId.slice(0,8):"-"})]},l.clientId)}):e.jsx("tr",{children:e.jsx("td",{colSpan:11,className:n.emptyRow,children:t("connection.targets.none","No Studio targets connected. Open Roblox Studio and connect WEPPY Plugin.")})})})]})})]}),e.jsxs("div",{className:`${n.card} ${y?n.disabled:""}`,children:[e.jsxs("div",{className:n.cardHeader,children:[e.jsx("span",{children:t("connection.log.title","Connection Log")}),e.jsx("button",{className:n.clearButton,onClick:()=>{o("dashboard_click_event",{click_target:"connection_clear_log",page:"connection"}),f(!0)},children:t("common.clear","Clear")})]}),e.jsx(Ee,{entries:u})]}),e.jsx(ee,{open:z,title:t("connection.clear.title","Clear connection log?"),message:t("connection.clear.message","This permanently removes the stored connection log for the current project."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("common.clear","Clear"),loading:w,onCancel:()=>!w&&f(!1),onConfirm:de}),e.jsx(ee,{open:D,title:t("connection.server.restartTitle","Restart WEPPY Bridge?"),message:t("connection.server.restartMessage","Dashboard and Studio targets will disconnect briefly. In-progress commands may have an unknown result, and active Playtest sessions or pending controls will be cleaned up. A connected MCP Adapter will start a new Bridge automatically."),cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("connection.server.restartConfirm","Restart Bridge"),loading:C==="requesting",onCancel:()=>C!=="requesting"&&m(!1),onConfirm:q}),e.jsx(ee,{open:!!B,title:t("connection.agents.kill.title","Kill agent?"),message:`"${B==null?void 0:B.name}" 프로세스를 강제 종료합니다. 해당 에이전트의 진행 중인 작업이 중단됩니다.`,cancelLabel:t("common.cancel","Cancel"),confirmLabel:t("connection.agents.kill","Kill"),loading:I,onCancel:()=>!I&&W(null),onConfirm:le})]})}export{Sn as Component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as P,j as e,d as q,i as z,c as k,r as l,J as X,K as J,N as Z,b as U,s as ee,O as te,h as D,Q as ne}from"./index-MEBRUJOq.js";import{D as Q,P as oe}from"./PageHeader-DUbueTLC.js";import{I as T}from"./InfoLabel-CJVH3VF5.js";import{s as j}from"./ConfirmModal.module-DJksQHBd.js";import{T as F}from"./TooltipText-CHM9zlD0.js";import{s as t,u as ae}from"./useSettings-B8q8Cuch.js";import{C as B}from"./check-DBxi70_h.js";import{C as _}from"./copy-bDdN4zua.js";function H(o,s){return e.jsxs("div",{className:j.pathBlock,children:[e.jsx("span",{className:j.pathLabel,children:o}),e.jsx("code",{className:j.pathCode,children:s})]})}function ie(o){const n=/^[A-Z]:\\/i.test(o)||o.includes("\\")?"\\":"/";return`${o.replace(/[\\/]+$/,"")}${n}weppy-project-sync`}function se({open:o,step:s,selectedProjectRoot:n,studioConnected:d,loading:p=!1,errorMessage:h=null,onClose:a,onPick:c,onApply:g}){const{t:r}=P();if(!o)return null;const y=n?ie(n):"";return e.jsx("div",{className:j.backdrop,onClick:p?void 0:a,role:"presentation",children:e.jsxs("div",{className:j.modal,onClick:x=>x.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"project-root-change-modal-title",children:[e.jsx("h2",{id:"project-root-change-modal-title",className:j.title,children:s==="initial"?r("header.projectRootModal.initial.title","Change project root"):r("header.projectRootModal.confirm.title","Confirm new project root")}),e.jsx("p",{className:j.message,children:s==="initial"?d?r("header.projectRootModal.initial.body.connected","MCP will switch to the new project root and resync current Studio contents into the new target."):r("header.projectRootModal.initial.body.disconnected","MCP will switch to the new project root and use the new folder as the next sync target."):r("header.projectRootModal.confirm.body","Review the selected project folder before applying.")}),e.jsxs("div",{className:j.bodyGrid,children:[s==="initial"?e.jsxs(e.Fragment,{children:[H(r("header.projectRootModal.initial.nextSyncRoot","New sync target after selection"),r("header.projectRootModal.initial.nextSyncRoot.placeholder","<selected project folder>/weppy-project-sync")),e.jsxs("ul",{className:j.warningList,children:[d?e.jsxs(e.Fragment,{children:[e.jsx("li",{children:r("header.projectRootModal.initial.warningStop","Current sync stops immediately.")}),e.jsx("li",{children:r("header.projectRootModal.initial.warningFreshSync","The current Studio contents will be used to build a fresh full sync in the new target.")})]}):e.jsx("li",{children:r("header.projectRootModal.initial.warningDeferredSync","If Studio is not connected, full resync starts the next time the plugin connects.")}),e.jsx("li",{children:r("header.projectRootModal.initial.warningNoMove","Old sync folders are not moved automatically.")})]})]}):e.jsxs(e.Fragment,{children:[H(r("header.projectRootModal.confirm.projectRoot","Selected project folder"),n??""),H(r("header.projectRootModal.confirm.syncRoot","New sync target"),y),e.jsx("p",{className:j.message,children:r("header.projectRootModal.confirm.warningNoMove","Existing sync folders are not moved automatically.")})]}),h?e.jsx("p",{className:`${j.message} ${j.errorMessage}`,children:h}):null]}),e.jsxs("div",{className:j.actions,children:[e.jsx("button",{className:j.cancelButton,onClick:a,disabled:p,children:r("header.projectRootModal.cancel","Cancel")}),s==="initial"?e.jsx("button",{className:j.confirmButton,onClick:c,disabled:p,children:p?"...":r("header.projectRootModal.pick","Choose folder")}):e.jsx("button",{className:j.confirmButton,onClick:g,disabled:p||!n,children:p?"...":r("header.projectRootModal.apply","Apply change")})]})]})})}function W(o,s){if(o&&typeof o=="object"&&"message"in o&&typeof o.message=="string"){const n=o.message.trim();if(n.length>0)return n}return s}function le(){const{level:o,status:s}=q(),{t:n}=P(),{show:d}=z(),{search:p}=k(),h=l.useRef(null),[a,c]=l.useState(null),[g,r]=l.useState(!1),[y,x]=l.useState(null),[b,N]=l.useState(null),[S,u]=l.useState(!1),[f,v]=l.useState(!1),[L,C]=l.useState(null),M=l.useMemo(()=>new URLSearchParams(p).get("section")==="project-root",[p]),w=l.useCallback(async()=>{if(o==="disconnected"){c(null),r(!1);return}r(!1);try{const m=await X();c(m)}catch{c(null),r(!0)}},[o]);l.useEffect(()=>{w()},[w,s==null?void 0:s.connectedClients,s==null?void 0:s.sessionId]),l.useEffect(()=>{var m,E,V;M&&((E=(m=h.current)==null?void 0:m.scrollIntoView)==null||E.call(m,{block:"start",behavior:"smooth"}),(V=h.current)==null||V.focus())},[M]);const R=(m=!1)=>{!m&&(S||f)||(x(null),N(null),C(null))},i=()=>{o==="disconnected"||!a||(C(null),N(null),x("initial"))},I=async()=>{u(!0),C(null);try{const m=await Z();if(m.cancelled||!m.projectRoot){R(!0);return}N(m.projectRoot),x("confirm")}catch(m){C(W(m,n("header.projectRootModal.error","Failed to change project root")))}finally{u(!1)}},A=async()=>{if(b){v(!0),C(null);try{const m=await J(b);c(m),r(!1),R(!0)}catch(m){const E=W(m,n("header.projectRootModal.error","Failed to change project root"));C(E),d(E,"error")}finally{v(!1)}}},$=g?n("controls.projectRoot.unavailable","Project root unavailable"):n("common.loading","Loading..."),K=o==="disconnected"||!a;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{id:"controls-project-root",ref:h,tabIndex:-1,className:t.card,children:[e.jsxs("div",{className:t.cardHeader,children:[e.jsx(T,{label:n("controls.projectRoot.title","Project Root"),tooltip:n("controls.projectRoot.title.tooltip","Authoritative project root and sync target used by MCP.")}),e.jsx(F,{text:n("controls.projectRoot.live.tooltip","Changing this updates MCP runtime state immediately after confirmation."),children:e.jsx("span",{className:`${t.headerBadge} ${t.headerBadgeLive}`,children:n("settings.general.liveApply","Live Apply")})})]}),e.jsxs("dl",{className:t.controlGrid,children:[e.jsx("dt",{children:n("controls.projectRoot.projectRoot","Project Root")}),e.jsx("dd",{children:(a==null?void 0:a.projectRoot)??$}),e.jsx("dt",{children:n("controls.projectRoot.syncRoot","Sync Root")}),e.jsx("dd",{children:(a==null?void 0:a.projectSyncRoot)??$})]}),e.jsx("p",{className:t.controlHint,children:n("controls.projectRoot.hint","Use this only when MCP should write sync data under a different project folder. Existing sync folders are not moved automatically.")}),e.jsx("button",{type:"button",className:t.actionBtn,disabled:K,onClick:i,children:n("header.changeProjectRoot","Change Project Root")})]}),e.jsx(se,{open:y!==null,step:y??"initial",selectedProjectRoot:b,studioConnected:o==="studioConnected",loading:S||f,errorMessage:L,onClose:R,onPick:I,onApply:A})]})}function ce(o){if(!o)return null;const s=o.placeName?o.placeId!==void 0?`${o.placeName} · ${o.placeId}`:o.placeName:o.placeId!==void 0?String(o.placeId):null;return s?`${o.targetAlias} · ${s}`:o.targetAlias}function G(o,s){const n=Math.max(0,Math.floor((Date.now()-o)/1e3));return n<60?`${n}${s("connection.time.secondsAgo","s ago")}`:n<3600?`${Math.floor(n/60)}${s("connection.time.minutesAgo","m ago")}`:`${Math.floor(n/3600)}${s("connection.time.hoursAgo","h ago")}`}function re(){const{status:o,level:s}=q(),{t:n}=P(),{show:d}=z(),{search:p}=k(),h=l.useRef(null),a=l.useRef(null),[c,g]=l.useState(null),[r,y]=l.useState(null),[x,b]=l.useState("idle"),N=l.useMemo(()=>new URLSearchParams(p).get("section")==="studio-routing",[p]),S=l.useCallback(async()=>{if(s==="disconnected"){g(null);return}try{const i=await U.get("/api/dashboard/studio-routing");g(i)}catch{g(null)}},[s]);l.useEffect(()=>{S()},[S,o==null?void 0:o.connectedClients,o==null?void 0:o.sessionId]),l.useEffect(()=>{var i,I,A;N&&((I=(i=h.current)==null?void 0:i.scrollIntoView)==null||I.call(i,{block:"start",behavior:"smooth"}),(A=h.current)==null||A.focus())},[N]),l.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]);const u=(c==null?void 0:c.studioRoutingMode)??(o==null?void 0:o.studioRoutingMode)??"recentPriority",f=(c==null?void 0:c.pinnedTargetClientId)??(o==null?void 0:o.pinnedTargetClientId)??null,v=ee((c==null?void 0:c.targets)??(o==null?void 0:o.pluginClients)??[],u,f),L=(c==null?void 0:c.priorityTarget)??te(v,u,f),C=ce(L),M=new Set(v.filter(i=>i.placeId!==void 0).map(i=>i.placeId).filter((i,I,A)=>A.filter($=>$===i).length>1)),w=async i=>{y(i.studioRoutingMode==="pinned"?i.pinnedTargetClientId??"pinned":"recentPriority"),b("idle"),a.current&&(clearTimeout(a.current),a.current=null);try{const I=await U.patch("/api/dashboard/studio-routing",i);g(I),b("applied"),a.current=setTimeout(()=>{b("idle"),a.current=null},2e3)}catch{b("failed"),d(n("connection.routing.updateFailed","Failed to update routing target"),"error")}finally{y(null)}},R=async i=>{try{await navigator.clipboard.writeText(i),d(n("connection.targets.copied","Copied value"),"success")}catch{d(n("connection.targets.copyFailed","Failed to copy value"),"error")}};return e.jsxs("div",{id:"controls-studio-routing",ref:h,tabIndex:-1,className:t.card,children:[e.jsxs("div",{className:t.cardHeader,children:[e.jsxs("div",{className:t.cardHeaderTitleGroup,children:[e.jsx("span",{children:n("controls.studioRouting.title","Studio Routing")}),e.jsx(Q,{topicId:"studioRouting",variant:"field",tooltip:n("controls.studioRouting.helpButton","How does it work?"),triggerClassName:`${t.cardHelpButton} ${t.touchTarget44}`})]}),e.jsx("span",{className:`${t.headerBadge} ${t.headerBadgeLive}`,children:n("settings.general.liveApply","Live Apply")})]}),e.jsxs("div",{className:t.routingOverview,children:[e.jsxs("div",{className:t.routingOverviewCopy,children:[e.jsx("span",{className:t.routingEyebrow,children:n("controls.studioRouting.priorityTitle","Priority for requests without a named Studio target")}),e.jsx("strong",{children:u==="pinned"?n("connection.routing.pinned","Manual: Pinned Studio"):n("connection.routing.recentPriority","Automatic: Recent priority")}),e.jsx("p",{children:n("controls.studioRouting.priorityDescription","Explicit Studio ID, Connection ID, or Place ID requests bypass this priority setting and route to the named Studio.")})]}),e.jsxs("div",{className:t.priorityTargetSummary,children:[e.jsx("span",{children:n("controls.studioRouting.state.currentTarget","Current priority target")}),e.jsx("strong",{children:C??n("controls.studioRouting.noPriorityTarget","No connected Studio target")}),e.jsx("span",{className:`${t.savedIndicator} ${t.routingFeedback} ${x==="failed"?t.savedIndicatorFailed:""} ${r===null&&x==="idle"?t.savedIndicatorHidden:""}`,"aria-live":"polite","data-testid":"studio-routing-save-feedback",children:r!==null?n("controls.studioRouting.saving","Applying…"):x==="applied"?n("controls.studioRouting.applied","Applied"):x==="failed"?n("controls.studioRouting.failed","Failed to apply"):null})]})]}),e.jsxs("div",{className:t.studioRoutingChoiceControl,role:"group","aria-label":n("connection.routing.priorityControl","Priority mode for requests without a named Studio target"),children:[e.jsxs("button",{type:"button",className:u==="recentPriority"?t.segmentActive:t.segment,disabled:r!==null,"aria-pressed":u==="recentPriority","aria-label":n("controls.studioRouting.mode.auto","Automatic"),onClick:()=>w({studioRoutingMode:"recentPriority"}),children:[e.jsx("span",{className:t.segmentIndicator,"aria-hidden":"true",children:u==="recentPriority"?e.jsx(B,{size:16}):null}),e.jsxs("span",{className:t.segmentCopy,children:[e.jsx("span",{className:t.segmentLabel,children:n("connection.routing.recentPriority","Automatic: Recent priority")}),e.jsx("small",{className:t.segmentDescription,children:n("controls.studioRouting.help.auto","Automatic uses the highest-priority active Studio, based on recent routed commands and connection order.")})]})]}),e.jsxs("button",{type:"button",className:u==="pinned"?t.segmentActive:t.segment,disabled:!v.length||r!==null,"aria-pressed":u==="pinned","aria-label":n("controls.studioRouting.mode.pinned","Studio fixed"),onClick:()=>w({studioRoutingMode:"pinned"}),children:[e.jsx("span",{className:t.segmentIndicator,"aria-hidden":"true",children:u==="pinned"?e.jsx(B,{size:16}):null}),e.jsxs("span",{className:t.segmentCopy,children:[e.jsx("span",{className:t.segmentLabel,children:n("connection.routing.pinned","Manual: Pinned Studio")}),e.jsx("small",{className:t.segmentDescription,children:n("controls.studioRouting.help.pinned","Studio fixed uses the selected Studio unless the request names a Studio ID, Connection ID, or Place ID.")})]})]})]}),v.length?null:e.jsx("p",{className:t.routingDisabledReason,children:n("controls.studioRouting.pinnedUnavailable","Connect a Studio target to use Studio fixed mode.")}),M.size>0?e.jsx("p",{className:t.routingWarning,children:n("controls.studioRouting.duplicatePlaceWarning","More than one connected Studio window has the same Place ID. Ask the AI agent to use Studio ID for that place.")}):null,e.jsx("div",{className:t.tableWrap,role:u==="pinned"?"radiogroup":void 0,"aria-label":u==="pinned"?n("controls.studioRouting.targetGroupLabel","Studio fixed target"):void 0,children:e.jsxs("table",{className:`${t.table} ${t.routingTargetsTable}`,children:[e.jsxs("colgroup",{children:[e.jsx("col",{className:t.routingActionColumn}),e.jsx("col",{span:6})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:n("connection.targets.routing","Routing")}),e.jsx("th",{children:n("connection.targets.target","Studio ID")}),e.jsx("th",{children:n("connection.targets.place","Place")}),e.jsx("th",{children:n("connection.targets.placeId","Place ID")}),e.jsx("th",{children:n("connection.targets.lastUsed","Last Used")}),e.jsx("th",{children:n("connection.targets.lastSeen","Last Seen")}),e.jsx("th",{children:n("connection.targets.clientId","Connection ID")})]})}),e.jsx("tbody",{children:v.length>0?v.map(i=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("div",{className:t.routingActionSlot,children:u==="pinned"?e.jsxs("button",{type:"button",role:"radio","aria-checked":f===i.clientId,"aria-label":`${n("controls.studioRouting.selectTarget","Select fixed Studio")}: ${i.targetAlias}`,className:`${t.routingTargetRadio} ${f===i.clientId?t.routingTargetRadioActive:""}`,disabled:r!==null,onClick:()=>{f!==i.clientId&&w({studioRoutingMode:"pinned",pinnedTargetClientId:i.clientId})},children:[e.jsx("span",{className:t.routingRadioIndicator,"aria-hidden":"true",children:f===i.clientId?e.jsx(B,{size:12}):null}),e.jsx("span",{children:f===i.clientId?n("connection.routing.pinnedBadge","Pinned"):n("controls.studioRouting.select","Select")})]}):(L==null?void 0:L.clientId)===i.clientId?e.jsx("span",{className:t.routingBadge,children:n("connection.routing.priorityBadge","Priority")}):null})}),e.jsxs("td",{children:[e.jsx("span",{className:t.monoMuted,title:i.clientId,children:i.targetAlias}),e.jsx(D,{text:n("connection.targets.copyTargetAlias","Copy Studio ID"),children:e.jsx("button",{type:"button",className:t.copyIconButton,"aria-label":n("connection.targets.copyTargetAlias","Copy Studio ID"),onClick:()=>R(i.targetAlias),children:e.jsx(_,{size:13,"aria-hidden":"true"})})})]}),e.jsx("td",{children:i.placeName??"-"}),e.jsxs("td",{children:[i.placeId??"-",i.placeId!==void 0?e.jsx(D,{text:n("connection.targets.copyPlaceId","Copy Place ID"),children:e.jsx("button",{type:"button",className:t.copyIconButton,"aria-label":n("connection.targets.copyPlaceId","Copy Place ID"),onClick:()=>R(String(i.placeId)),children:e.jsx(_,{size:13,"aria-hidden":"true"})})}):null]}),e.jsx("td",{children:i.lastRoutedAt?G(i.lastRoutedAt,n):"-"}),e.jsx("td",{children:G(i.lastSeen,n)}),e.jsxs("td",{children:[e.jsx("span",{className:t.monoMuted,title:i.clientId,children:i.clientId.slice(0,10)}),e.jsx(D,{text:n("connection.targets.copyClientId","Copy Connection ID"),children:e.jsx("button",{type:"button",className:t.copyIconButton,"aria-label":n("connection.targets.copyClientId","Copy Connection ID"),onClick:()=>R(i.clientId),children:e.jsx(_,{size:13,"aria-hidden":"true"})})})]})]},i.clientId)):e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:t.emptyRow,children:n("connection.targets.none","No Studio targets connected. Open Roblox Studio and connect WEPPY Plugin.")})})})]})})]})}const Y=["debug","info","warn","error"];function O({checked:o,onChange:s,testId:n,ariaLabel:d}){return e.jsxs("label",{className:t.toggleSwitch,"data-testid":n,children:[e.jsx("input",{type:"checkbox",className:t.toggleInput,checked:o,"aria-label":d,onChange:p=>s(p.target.checked)}),e.jsx("span",{className:t.toggleTrack,"aria-hidden":"true",children:e.jsx("span",{className:t.toggleThumb})})]})}function de({settings:o,updateHotSetting:s}){const{t:n}=P(),[d,p]=l.useState(null),h=l.useCallback(async(a,c)=>{try{await s(a,c),p(a),setTimeout(()=>p(g=>g===a?null:g),2e3)}catch{p(g=>g===a?null:g)}},[s]);return e.jsxs("div",{className:t.card,children:[e.jsxs("div",{className:t.cardHeader,children:[e.jsx(T,{label:n("settings.general.title","General Settings"),tooltip:n("settings.general.title.tooltip","Hot settings that apply immediately when changed.")}),e.jsx(F,{text:n("settings.general.liveApply.tooltip","Changes in this section are applied immediately without a separate save button."),children:e.jsx("span",{className:`${t.headerBadge} ${t.headerBadgeLive}`,children:n("settings.general.liveApply","Live Apply")})})]}),o?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:t.settingRow,children:[e.jsx("span",{className:t.settingLabel,children:e.jsx(T,{label:n("settings.general.logLevel","Log Level"),tooltip:n("settings.general.logLevel.tooltip","Sets how much detail WEPPY Dashboard writes to its logs.")})}),e.jsxs("div",{className:t.settingControl,children:[e.jsx("select",{className:t.select,value:o.hot.LOG_LEVEL,onChange:a=>{const c=Y.find(g=>g===a.target.value);c&&h("LOG_LEVEL",c)},children:Y.map(a=>e.jsx("option",{value:a,children:a},a))}),d==="LOG_LEVEL"&&e.jsx("span",{className:t.savedIndicator,children:n("settings.general.applied")})]})]}),e.jsxs("div",{className:t.settingRow,children:[e.jsx("span",{className:t.settingLabel,children:e.jsx(T,{label:n("settings.general.localHistory","Tool History Recording"),tooltip:n("settings.general.localHistory.tooltip","Stores local tool execution history for the WEPPY Dashboard history views.")})}),e.jsxs("div",{className:t.settingControl,children:[e.jsx("span",{className:`${t.savedIndicator} ${d==="ENABLE_LOCAL_HISTORY"?"":t.savedIndicatorHidden}`,children:n("settings.general.applied","Applied")}),e.jsx(O,{checked:o.hot.ENABLE_LOCAL_HISTORY,ariaLabel:n("settings.general.localHistory","Tool History Recording"),testId:"settings-toggle-enable-local-history",onChange:a=>h("ENABLE_LOCAL_HISTORY",a)})]})]}),e.jsxs("div",{className:t.settingRow,children:[e.jsx("span",{className:t.settingLabel,children:e.jsx(T,{label:n("settings.general.localStatistics","Tool Statistics Collection"),tooltip:n("settings.general.localStatistics.tooltip","Aggregates local usage statistics for WEPPY Dashboard reporting.")})}),e.jsxs("div",{className:t.settingControl,children:[e.jsx("span",{className:`${t.savedIndicator} ${d==="ENABLE_LOCAL_STATISTICS"?"":t.savedIndicatorHidden}`,children:n("settings.general.applied","Applied")}),e.jsx(O,{checked:o.hot.ENABLE_LOCAL_STATISTICS,ariaLabel:n("settings.general.localStatistics","Tool Statistics Collection"),testId:"settings-toggle-enable-local-statistics",onChange:a=>h("ENABLE_LOCAL_STATISTICS",a)})]})]}),e.jsxs("div",{className:t.settingRow,children:[e.jsx("span",{className:t.settingLabel,children:e.jsx(T,{label:n("settings.general.contextCapture","Context Capture"),tooltip:n("settings.general.contextCapture.tooltip","When enabled, WEPPY Dashboard records structured execution context for changelog and playtest views.")})}),e.jsxs("div",{className:t.settingControl,children:[e.jsx("span",{className:`${t.savedIndicator} ${d==="ENABLE_CONTEXT_CAPTURE"?"":t.savedIndicatorHidden}`,children:n("settings.general.applied","Applied")}),e.jsx(O,{checked:o.hot.ENABLE_CONTEXT_CAPTURE,ariaLabel:n("settings.general.contextCapture","Context Capture"),testId:"settings-toggle-enable-context-capture",onChange:a=>h("ENABLE_CONTEXT_CAPTURE",a)})]})]}),e.jsxs("div",{className:t.settingRow,children:[e.jsx("span",{className:t.settingLabel,children:e.jsx(T,{label:n("settings.general.requestTimeout","Action Timeout"),tooltip:n("settings.general.requestTimeout.tooltip","Maximum time WEPPY Dashboard waits for an action before it fails.")})}),e.jsxs("div",{className:t.settingControl,children:[e.jsx("input",{type:"number",className:t.numberInput,value:o.hot.REQUEST_TIMEOUT,min:1e3,max:12e4,step:1e3,onChange:a=>{const c=parseInt(a.target.value,10);isNaN(c)||h("REQUEST_TIMEOUT",c)}}),e.jsx(F,{text:n("settings.general.requestTimeout.unit.tooltip","Action timeout is measured in milliseconds."),children:e.jsx("span",{className:t.unit,children:n("settings.general.requestTimeout.unit","ms")})}),d==="REQUEST_TIMEOUT"&&e.jsx("span",{className:t.savedIndicator,children:n("settings.general.applied","Applied")})]})]})]}):e.jsx("div",{className:t.loading,children:n("settings.unavailable")})]})}function ue({enabled:o,saving:s,onChange:n}){const{t:d}=P(),{search:p}=k(),h=l.useRef(null),a=l.useRef(null),c=l.useId(),[g,r]=l.useState(!1),[y,x]=l.useState("idle"),b=l.useMemo(()=>new URLSearchParams(p).get("section")==="luau-validation",[p]),N=s||g;l.useEffect(()=>{var u,f,v;b&&((f=(u=h.current)==null?void 0:u.scrollIntoView)==null||f.call(u,{block:"start",behavior:"smooth"}),(v=h.current)==null||v.focus())},[b]),l.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]);const S=l.useCallback(async u=>{r(!0),x("idle"),a.current&&(clearTimeout(a.current),a.current=null);try{await n(u),x("applied"),a.current=setTimeout(()=>{x("idle"),a.current=null},2e3)}catch{x("failed")}finally{r(!1)}},[n]);return e.jsxs("div",{id:"controls-luau-validation",ref:h,tabIndex:-1,className:`${t.card} ${t.validationCard}`,"data-testid":"luau-syntax-validation-card",children:[e.jsxs("div",{className:t.cardHeader,children:[e.jsxs("div",{className:t.cardHeaderTitleGroup,children:[e.jsx("span",{children:d("controls.luauValidation.title","Luau Syntax Validation")}),e.jsx(Q,{topicId:"luauValidation",variant:"field",tooltip:d("controls.luauValidation.helpButton","How does it work?"),triggerClassName:`${t.cardHelpButton} ${t.touchTarget44}`})]}),e.jsx("span",{className:`${t.headerBadge} ${t.headerBadgeLive}`,children:d("settings.general.liveApply","Live Apply")})]}),e.jsxs("div",{className:t.validationSettingRow,children:[e.jsxs("div",{className:t.validationSettingCopy,children:[e.jsx("span",{id:c,className:t.validationSettingLabel,children:d("controls.luauValidation.settingLabel","Check automatically after Script edits")}),e.jsx("span",{className:t.validationSettingStatus,children:o?d("controls.luauValidation.state.on","Current: On"):d("controls.luauValidation.state.off","Current: Off")})]}),e.jsxs("div",{className:t.validationPolicyControl,children:[e.jsx("span",{className:`${t.savedIndicator} ${y==="failed"?t.savedIndicatorFailed:""} ${!N&&y==="idle"?t.savedIndicatorHidden:""}`,"data-testid":"luau-validation-save-feedback","aria-live":"polite",children:N?d("controls.luauValidation.saving","Saving…"):y==="applied"?d("controls.luauValidation.applied","Applied"):y==="failed"?d("controls.luauValidation.failed","Failed to apply"):null}),e.jsxs("label",{className:`${t.toggleSwitch} ${t.validationToggleTarget}`,"data-testid":"luau-validation-toggle",children:[e.jsx("input",{type:"checkbox",role:"switch",className:t.toggleInput,checked:o,disabled:N,"aria-labelledby":c,onChange:u=>{S(u.target.checked)}}),e.jsx("span",{className:t.toggleTrack,"aria-hidden":"true",children:e.jsx("span",{className:t.toggleThumb})})]})]})]})]})}function ve(){const{t:o}=P(),{search:s}=k(),{settings:n,updateHotSetting:d,saving:p,loading:h}=ae();return l.useMemo(()=>new URLSearchParams(s).get("section"),[s])==="license"?e.jsx(ne,{to:"/settings?section=license",replace:!0}):h?e.jsx("div",{className:t.page,children:e.jsx("div",{className:t.loading,children:o("common.loading")})}):e.jsxs("div",{className:t.page,children:[e.jsx(oe,{title:o("page.controls.title","Controls"),description:o("page.controls.description","Manage project root, Studio routing, and MCP live settings."),helpTopicId:"controls"}),e.jsx(le,{}),e.jsx(re,{}),e.jsx(ue,{enabled:(n==null?void 0:n.hot.SCRIPT_WRITE_VALIDATION_ENABLED)??!1,saving:p,onChange:c=>d("SCRIPT_WRITE_VALIDATION_ENABLED",c)}),e.jsx(de,{settings:n,updateHotSetting:d})]})}export{ve as Component};
|
|
1
|
+
import{u as P,j as e,d as q,k as z,c as k,r as l,J as X,K as J,N as Z,b as U,s as ee,O as te,i as D,Q as ne}from"./index-uP4eoQi-.js";import{D as Q,P as oe}from"./PageHeader-_z4Dtkbg.js";import{I as T}from"./InfoLabel-DAd1I756.js";import{s as j}from"./ConfirmModal.module-DJksQHBd.js";import{T as F}from"./TooltipText-NA7u0bu6.js";import{s as t,u as ae}from"./useSettings-kOu_k9zT.js";import{C as B}from"./check-GVlTbKVy.js";import{C as _}from"./copy-DVGVC27v.js";function H(o,s){return e.jsxs("div",{className:j.pathBlock,children:[e.jsx("span",{className:j.pathLabel,children:o}),e.jsx("code",{className:j.pathCode,children:s})]})}function ie(o){const n=/^[A-Z]:\\/i.test(o)||o.includes("\\")?"\\":"/";return`${o.replace(/[\\/]+$/,"")}${n}weppy-project-sync`}function se({open:o,step:s,selectedProjectRoot:n,studioConnected:d,loading:p=!1,errorMessage:h=null,onClose:a,onPick:c,onApply:g}){const{t:r}=P();if(!o)return null;const y=n?ie(n):"";return e.jsx("div",{className:j.backdrop,onClick:p?void 0:a,role:"presentation",children:e.jsxs("div",{className:j.modal,onClick:x=>x.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"project-root-change-modal-title",children:[e.jsx("h2",{id:"project-root-change-modal-title",className:j.title,children:s==="initial"?r("header.projectRootModal.initial.title","Change project root"):r("header.projectRootModal.confirm.title","Confirm new project root")}),e.jsx("p",{className:j.message,children:s==="initial"?d?r("header.projectRootModal.initial.body.connected","MCP will switch to the new project root and resync current Studio contents into the new target."):r("header.projectRootModal.initial.body.disconnected","MCP will switch to the new project root and use the new folder as the next sync target."):r("header.projectRootModal.confirm.body","Review the selected project folder before applying.")}),e.jsxs("div",{className:j.bodyGrid,children:[s==="initial"?e.jsxs(e.Fragment,{children:[H(r("header.projectRootModal.initial.nextSyncRoot","New sync target after selection"),r("header.projectRootModal.initial.nextSyncRoot.placeholder","<selected project folder>/weppy-project-sync")),e.jsxs("ul",{className:j.warningList,children:[d?e.jsxs(e.Fragment,{children:[e.jsx("li",{children:r("header.projectRootModal.initial.warningStop","Current sync stops immediately.")}),e.jsx("li",{children:r("header.projectRootModal.initial.warningFreshSync","The current Studio contents will be used to build a fresh full sync in the new target.")})]}):e.jsx("li",{children:r("header.projectRootModal.initial.warningDeferredSync","If Studio is not connected, full resync starts the next time the plugin connects.")}),e.jsx("li",{children:r("header.projectRootModal.initial.warningNoMove","Old sync folders are not moved automatically.")})]})]}):e.jsxs(e.Fragment,{children:[H(r("header.projectRootModal.confirm.projectRoot","Selected project folder"),n??""),H(r("header.projectRootModal.confirm.syncRoot","New sync target"),y),e.jsx("p",{className:j.message,children:r("header.projectRootModal.confirm.warningNoMove","Existing sync folders are not moved automatically.")})]}),h?e.jsx("p",{className:`${j.message} ${j.errorMessage}`,children:h}):null]}),e.jsxs("div",{className:j.actions,children:[e.jsx("button",{className:j.cancelButton,onClick:a,disabled:p,children:r("header.projectRootModal.cancel","Cancel")}),s==="initial"?e.jsx("button",{className:j.confirmButton,onClick:c,disabled:p,children:p?"...":r("header.projectRootModal.pick","Choose folder")}):e.jsx("button",{className:j.confirmButton,onClick:g,disabled:p||!n,children:p?"...":r("header.projectRootModal.apply","Apply change")})]})]})})}function W(o,s){if(o&&typeof o=="object"&&"message"in o&&typeof o.message=="string"){const n=o.message.trim();if(n.length>0)return n}return s}function le(){const{level:o,status:s}=q(),{t:n}=P(),{show:d}=z(),{search:p}=k(),h=l.useRef(null),[a,c]=l.useState(null),[g,r]=l.useState(!1),[y,x]=l.useState(null),[b,N]=l.useState(null),[S,u]=l.useState(!1),[f,v]=l.useState(!1),[L,C]=l.useState(null),M=l.useMemo(()=>new URLSearchParams(p).get("section")==="project-root",[p]),w=l.useCallback(async()=>{if(o==="disconnected"){c(null),r(!1);return}r(!1);try{const m=await X();c(m)}catch{c(null),r(!0)}},[o]);l.useEffect(()=>{w()},[w,s==null?void 0:s.connectedClients,s==null?void 0:s.sessionId]),l.useEffect(()=>{var m,E,V;M&&((E=(m=h.current)==null?void 0:m.scrollIntoView)==null||E.call(m,{block:"start",behavior:"smooth"}),(V=h.current)==null||V.focus())},[M]);const R=(m=!1)=>{!m&&(S||f)||(x(null),N(null),C(null))},i=()=>{o==="disconnected"||!a||(C(null),N(null),x("initial"))},I=async()=>{u(!0),C(null);try{const m=await Z();if(m.cancelled||!m.projectRoot){R(!0);return}N(m.projectRoot),x("confirm")}catch(m){C(W(m,n("header.projectRootModal.error","Failed to change project root")))}finally{u(!1)}},A=async()=>{if(b){v(!0),C(null);try{const m=await J(b);c(m),r(!1),R(!0)}catch(m){const E=W(m,n("header.projectRootModal.error","Failed to change project root"));C(E),d(E,"error")}finally{v(!1)}}},$=g?n("controls.projectRoot.unavailable","Project root unavailable"):n("common.loading","Loading..."),K=o==="disconnected"||!a;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{id:"controls-project-root",ref:h,tabIndex:-1,className:t.card,children:[e.jsxs("div",{className:t.cardHeader,children:[e.jsx(T,{label:n("controls.projectRoot.title","Project Root"),tooltip:n("controls.projectRoot.title.tooltip","Authoritative project root and sync target used by MCP.")}),e.jsx(F,{text:n("controls.projectRoot.live.tooltip","Changing this updates MCP runtime state immediately after confirmation."),children:e.jsx("span",{className:`${t.headerBadge} ${t.headerBadgeLive}`,children:n("settings.general.liveApply","Live Apply")})})]}),e.jsxs("dl",{className:t.controlGrid,children:[e.jsx("dt",{children:n("controls.projectRoot.projectRoot","Project Root")}),e.jsx("dd",{children:(a==null?void 0:a.projectRoot)??$}),e.jsx("dt",{children:n("controls.projectRoot.syncRoot","Sync Root")}),e.jsx("dd",{children:(a==null?void 0:a.projectSyncRoot)??$})]}),e.jsx("p",{className:t.controlHint,children:n("controls.projectRoot.hint","Use this only when MCP should write sync data under a different project folder. Existing sync folders are not moved automatically.")}),e.jsx("button",{type:"button",className:t.actionBtn,disabled:K,onClick:i,children:n("header.changeProjectRoot","Change Project Root")})]}),e.jsx(se,{open:y!==null,step:y??"initial",selectedProjectRoot:b,studioConnected:o==="studioConnected",loading:S||f,errorMessage:L,onClose:R,onPick:I,onApply:A})]})}function ce(o){if(!o)return null;const s=o.placeName?o.placeId!==void 0?`${o.placeName} · ${o.placeId}`:o.placeName:o.placeId!==void 0?String(o.placeId):null;return s?`${o.targetAlias} · ${s}`:o.targetAlias}function G(o,s){const n=Math.max(0,Math.floor((Date.now()-o)/1e3));return n<60?`${n}${s("connection.time.secondsAgo","s ago")}`:n<3600?`${Math.floor(n/60)}${s("connection.time.minutesAgo","m ago")}`:`${Math.floor(n/3600)}${s("connection.time.hoursAgo","h ago")}`}function re(){const{status:o,level:s}=q(),{t:n}=P(),{show:d}=z(),{search:p}=k(),h=l.useRef(null),a=l.useRef(null),[c,g]=l.useState(null),[r,y]=l.useState(null),[x,b]=l.useState("idle"),N=l.useMemo(()=>new URLSearchParams(p).get("section")==="studio-routing",[p]),S=l.useCallback(async()=>{if(s==="disconnected"){g(null);return}try{const i=await U.get("/api/dashboard/studio-routing");g(i)}catch{g(null)}},[s]);l.useEffect(()=>{S()},[S,o==null?void 0:o.connectedClients,o==null?void 0:o.sessionId]),l.useEffect(()=>{var i,I,A;N&&((I=(i=h.current)==null?void 0:i.scrollIntoView)==null||I.call(i,{block:"start",behavior:"smooth"}),(A=h.current)==null||A.focus())},[N]),l.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]);const u=(c==null?void 0:c.studioRoutingMode)??(o==null?void 0:o.studioRoutingMode)??"recentPriority",f=(c==null?void 0:c.pinnedTargetClientId)??(o==null?void 0:o.pinnedTargetClientId)??null,v=ee((c==null?void 0:c.targets)??(o==null?void 0:o.pluginClients)??[],u,f),L=(c==null?void 0:c.priorityTarget)??te(v,u,f),C=ce(L),M=new Set(v.filter(i=>i.placeId!==void 0).map(i=>i.placeId).filter((i,I,A)=>A.filter($=>$===i).length>1)),w=async i=>{y(i.studioRoutingMode==="pinned"?i.pinnedTargetClientId??"pinned":"recentPriority"),b("idle"),a.current&&(clearTimeout(a.current),a.current=null);try{const I=await U.patch("/api/dashboard/studio-routing",i);g(I),b("applied"),a.current=setTimeout(()=>{b("idle"),a.current=null},2e3)}catch{b("failed"),d(n("connection.routing.updateFailed","Failed to update routing target"),"error")}finally{y(null)}},R=async i=>{try{await navigator.clipboard.writeText(i),d(n("connection.targets.copied","Copied value"),"success")}catch{d(n("connection.targets.copyFailed","Failed to copy value"),"error")}};return e.jsxs("div",{id:"controls-studio-routing",ref:h,tabIndex:-1,className:t.card,children:[e.jsxs("div",{className:t.cardHeader,children:[e.jsxs("div",{className:t.cardHeaderTitleGroup,children:[e.jsx("span",{children:n("controls.studioRouting.title","Studio Routing")}),e.jsx(Q,{topicId:"studioRouting",variant:"field",tooltip:n("controls.studioRouting.helpButton","How does it work?"),triggerClassName:`${t.cardHelpButton} ${t.touchTarget44}`})]}),e.jsx("span",{className:`${t.headerBadge} ${t.headerBadgeLive}`,children:n("settings.general.liveApply","Live Apply")})]}),e.jsxs("div",{className:t.routingOverview,children:[e.jsxs("div",{className:t.routingOverviewCopy,children:[e.jsx("span",{className:t.routingEyebrow,children:n("controls.studioRouting.priorityTitle","Priority for requests without a named Studio target")}),e.jsx("strong",{children:u==="pinned"?n("connection.routing.pinned","Manual: Pinned Studio"):n("connection.routing.recentPriority","Automatic: Recent priority")}),e.jsx("p",{children:n("controls.studioRouting.priorityDescription","Explicit Studio ID, Connection ID, or Place ID requests bypass this priority setting and route to the named Studio.")})]}),e.jsxs("div",{className:t.priorityTargetSummary,children:[e.jsx("span",{children:n("controls.studioRouting.state.currentTarget","Current priority target")}),e.jsx("strong",{children:C??n("controls.studioRouting.noPriorityTarget","No connected Studio target")}),e.jsx("span",{className:`${t.savedIndicator} ${t.routingFeedback} ${x==="failed"?t.savedIndicatorFailed:""} ${r===null&&x==="idle"?t.savedIndicatorHidden:""}`,"aria-live":"polite","data-testid":"studio-routing-save-feedback",children:r!==null?n("controls.studioRouting.saving","Applying…"):x==="applied"?n("controls.studioRouting.applied","Applied"):x==="failed"?n("controls.studioRouting.failed","Failed to apply"):null})]})]}),e.jsxs("div",{className:t.studioRoutingChoiceControl,role:"group","aria-label":n("connection.routing.priorityControl","Priority mode for requests without a named Studio target"),children:[e.jsxs("button",{type:"button",className:u==="recentPriority"?t.segmentActive:t.segment,disabled:r!==null,"aria-pressed":u==="recentPriority","aria-label":n("controls.studioRouting.mode.auto","Automatic"),onClick:()=>w({studioRoutingMode:"recentPriority"}),children:[e.jsx("span",{className:t.segmentIndicator,"aria-hidden":"true",children:u==="recentPriority"?e.jsx(B,{size:16}):null}),e.jsxs("span",{className:t.segmentCopy,children:[e.jsx("span",{className:t.segmentLabel,children:n("connection.routing.recentPriority","Automatic: Recent priority")}),e.jsx("small",{className:t.segmentDescription,children:n("controls.studioRouting.help.auto","Automatic uses the highest-priority active Studio, based on recent routed commands and connection order.")})]})]}),e.jsxs("button",{type:"button",className:u==="pinned"?t.segmentActive:t.segment,disabled:!v.length||r!==null,"aria-pressed":u==="pinned","aria-label":n("controls.studioRouting.mode.pinned","Studio fixed"),onClick:()=>w({studioRoutingMode:"pinned"}),children:[e.jsx("span",{className:t.segmentIndicator,"aria-hidden":"true",children:u==="pinned"?e.jsx(B,{size:16}):null}),e.jsxs("span",{className:t.segmentCopy,children:[e.jsx("span",{className:t.segmentLabel,children:n("connection.routing.pinned","Manual: Pinned Studio")}),e.jsx("small",{className:t.segmentDescription,children:n("controls.studioRouting.help.pinned","Studio fixed uses the selected Studio unless the request names a Studio ID, Connection ID, or Place ID.")})]})]})]}),v.length?null:e.jsx("p",{className:t.routingDisabledReason,children:n("controls.studioRouting.pinnedUnavailable","Connect a Studio target to use Studio fixed mode.")}),M.size>0?e.jsx("p",{className:t.routingWarning,children:n("controls.studioRouting.duplicatePlaceWarning","More than one connected Studio window has the same Place ID. Ask the AI agent to use Studio ID for that place.")}):null,e.jsx("div",{className:t.tableWrap,role:u==="pinned"?"radiogroup":void 0,"aria-label":u==="pinned"?n("controls.studioRouting.targetGroupLabel","Studio fixed target"):void 0,children:e.jsxs("table",{className:`${t.table} ${t.routingTargetsTable}`,children:[e.jsxs("colgroup",{children:[e.jsx("col",{className:t.routingActionColumn}),e.jsx("col",{span:6})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:n("connection.targets.routing","Routing")}),e.jsx("th",{children:n("connection.targets.target","Studio ID")}),e.jsx("th",{children:n("connection.targets.place","Place")}),e.jsx("th",{children:n("connection.targets.placeId","Place ID")}),e.jsx("th",{children:n("connection.targets.lastUsed","Last Used")}),e.jsx("th",{children:n("connection.targets.lastSeen","Last Seen")}),e.jsx("th",{children:n("connection.targets.clientId","Connection ID")})]})}),e.jsx("tbody",{children:v.length>0?v.map(i=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsx("div",{className:t.routingActionSlot,children:u==="pinned"?e.jsxs("button",{type:"button",role:"radio","aria-checked":f===i.clientId,"aria-label":`${n("controls.studioRouting.selectTarget","Select fixed Studio")}: ${i.targetAlias}`,className:`${t.routingTargetRadio} ${f===i.clientId?t.routingTargetRadioActive:""}`,disabled:r!==null,onClick:()=>{f!==i.clientId&&w({studioRoutingMode:"pinned",pinnedTargetClientId:i.clientId})},children:[e.jsx("span",{className:t.routingRadioIndicator,"aria-hidden":"true",children:f===i.clientId?e.jsx(B,{size:12}):null}),e.jsx("span",{children:f===i.clientId?n("connection.routing.pinnedBadge","Pinned"):n("controls.studioRouting.select","Select")})]}):(L==null?void 0:L.clientId)===i.clientId?e.jsx("span",{className:t.routingBadge,children:n("connection.routing.priorityBadge","Priority")}):null})}),e.jsxs("td",{children:[e.jsx("span",{className:t.monoMuted,title:i.clientId,children:i.targetAlias}),e.jsx(D,{text:n("connection.targets.copyTargetAlias","Copy Studio ID"),children:e.jsx("button",{type:"button",className:t.copyIconButton,"aria-label":n("connection.targets.copyTargetAlias","Copy Studio ID"),onClick:()=>R(i.targetAlias),children:e.jsx(_,{size:13,"aria-hidden":"true"})})})]}),e.jsx("td",{children:i.placeName??"-"}),e.jsxs("td",{children:[i.placeId??"-",i.placeId!==void 0?e.jsx(D,{text:n("connection.targets.copyPlaceId","Copy Place ID"),children:e.jsx("button",{type:"button",className:t.copyIconButton,"aria-label":n("connection.targets.copyPlaceId","Copy Place ID"),onClick:()=>R(String(i.placeId)),children:e.jsx(_,{size:13,"aria-hidden":"true"})})}):null]}),e.jsx("td",{children:i.lastRoutedAt?G(i.lastRoutedAt,n):"-"}),e.jsx("td",{children:G(i.lastSeen,n)}),e.jsxs("td",{children:[e.jsx("span",{className:t.monoMuted,title:i.clientId,children:i.clientId.slice(0,10)}),e.jsx(D,{text:n("connection.targets.copyClientId","Copy Connection ID"),children:e.jsx("button",{type:"button",className:t.copyIconButton,"aria-label":n("connection.targets.copyClientId","Copy Connection ID"),onClick:()=>R(i.clientId),children:e.jsx(_,{size:13,"aria-hidden":"true"})})})]})]},i.clientId)):e.jsx("tr",{children:e.jsx("td",{colSpan:7,className:t.emptyRow,children:n("connection.targets.none","No Studio targets connected. Open Roblox Studio and connect WEPPY Plugin.")})})})]})})]})}const Y=["debug","info","warn","error"];function O({checked:o,onChange:s,testId:n,ariaLabel:d}){return e.jsxs("label",{className:t.toggleSwitch,"data-testid":n,children:[e.jsx("input",{type:"checkbox",className:t.toggleInput,checked:o,"aria-label":d,onChange:p=>s(p.target.checked)}),e.jsx("span",{className:t.toggleTrack,"aria-hidden":"true",children:e.jsx("span",{className:t.toggleThumb})})]})}function de({settings:o,updateHotSetting:s}){const{t:n}=P(),[d,p]=l.useState(null),h=l.useCallback(async(a,c)=>{try{await s(a,c),p(a),setTimeout(()=>p(g=>g===a?null:g),2e3)}catch{p(g=>g===a?null:g)}},[s]);return e.jsxs("div",{className:t.card,children:[e.jsxs("div",{className:t.cardHeader,children:[e.jsx(T,{label:n("settings.general.title","General Settings"),tooltip:n("settings.general.title.tooltip","Hot settings that apply immediately when changed.")}),e.jsx(F,{text:n("settings.general.liveApply.tooltip","Changes in this section are applied immediately without a separate save button."),children:e.jsx("span",{className:`${t.headerBadge} ${t.headerBadgeLive}`,children:n("settings.general.liveApply","Live Apply")})})]}),o?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:t.settingRow,children:[e.jsx("span",{className:t.settingLabel,children:e.jsx(T,{label:n("settings.general.logLevel","Log Level"),tooltip:n("settings.general.logLevel.tooltip","Sets how much detail WEPPY Dashboard writes to its logs.")})}),e.jsxs("div",{className:t.settingControl,children:[e.jsx("select",{className:t.select,value:o.hot.LOG_LEVEL,onChange:a=>{const c=Y.find(g=>g===a.target.value);c&&h("LOG_LEVEL",c)},children:Y.map(a=>e.jsx("option",{value:a,children:a},a))}),d==="LOG_LEVEL"&&e.jsx("span",{className:t.savedIndicator,children:n("settings.general.applied")})]})]}),e.jsxs("div",{className:t.settingRow,children:[e.jsx("span",{className:t.settingLabel,children:e.jsx(T,{label:n("settings.general.localHistory","Tool History Recording"),tooltip:n("settings.general.localHistory.tooltip","Stores local tool execution history for the WEPPY Dashboard history views.")})}),e.jsxs("div",{className:t.settingControl,children:[e.jsx("span",{className:`${t.savedIndicator} ${d==="ENABLE_LOCAL_HISTORY"?"":t.savedIndicatorHidden}`,children:n("settings.general.applied","Applied")}),e.jsx(O,{checked:o.hot.ENABLE_LOCAL_HISTORY,ariaLabel:n("settings.general.localHistory","Tool History Recording"),testId:"settings-toggle-enable-local-history",onChange:a=>h("ENABLE_LOCAL_HISTORY",a)})]})]}),e.jsxs("div",{className:t.settingRow,children:[e.jsx("span",{className:t.settingLabel,children:e.jsx(T,{label:n("settings.general.localStatistics","Tool Statistics Collection"),tooltip:n("settings.general.localStatistics.tooltip","Aggregates local usage statistics for WEPPY Dashboard reporting.")})}),e.jsxs("div",{className:t.settingControl,children:[e.jsx("span",{className:`${t.savedIndicator} ${d==="ENABLE_LOCAL_STATISTICS"?"":t.savedIndicatorHidden}`,children:n("settings.general.applied","Applied")}),e.jsx(O,{checked:o.hot.ENABLE_LOCAL_STATISTICS,ariaLabel:n("settings.general.localStatistics","Tool Statistics Collection"),testId:"settings-toggle-enable-local-statistics",onChange:a=>h("ENABLE_LOCAL_STATISTICS",a)})]})]}),e.jsxs("div",{className:t.settingRow,children:[e.jsx("span",{className:t.settingLabel,children:e.jsx(T,{label:n("settings.general.contextCapture","Context Capture"),tooltip:n("settings.general.contextCapture.tooltip","When enabled, WEPPY Dashboard records structured execution context for changelog and playtest views.")})}),e.jsxs("div",{className:t.settingControl,children:[e.jsx("span",{className:`${t.savedIndicator} ${d==="ENABLE_CONTEXT_CAPTURE"?"":t.savedIndicatorHidden}`,children:n("settings.general.applied","Applied")}),e.jsx(O,{checked:o.hot.ENABLE_CONTEXT_CAPTURE,ariaLabel:n("settings.general.contextCapture","Context Capture"),testId:"settings-toggle-enable-context-capture",onChange:a=>h("ENABLE_CONTEXT_CAPTURE",a)})]})]}),e.jsxs("div",{className:t.settingRow,children:[e.jsx("span",{className:t.settingLabel,children:e.jsx(T,{label:n("settings.general.requestTimeout","Action Timeout"),tooltip:n("settings.general.requestTimeout.tooltip","Maximum time WEPPY Dashboard waits for an action before it fails.")})}),e.jsxs("div",{className:t.settingControl,children:[e.jsx("input",{type:"number",className:t.numberInput,value:o.hot.REQUEST_TIMEOUT,min:1e3,max:12e4,step:1e3,onChange:a=>{const c=parseInt(a.target.value,10);isNaN(c)||h("REQUEST_TIMEOUT",c)}}),e.jsx(F,{text:n("settings.general.requestTimeout.unit.tooltip","Action timeout is measured in milliseconds."),children:e.jsx("span",{className:t.unit,children:n("settings.general.requestTimeout.unit","ms")})}),d==="REQUEST_TIMEOUT"&&e.jsx("span",{className:t.savedIndicator,children:n("settings.general.applied","Applied")})]})]})]}):e.jsx("div",{className:t.loading,children:n("settings.unavailable")})]})}function ue({enabled:o,saving:s,onChange:n}){const{t:d}=P(),{search:p}=k(),h=l.useRef(null),a=l.useRef(null),c=l.useId(),[g,r]=l.useState(!1),[y,x]=l.useState("idle"),b=l.useMemo(()=>new URLSearchParams(p).get("section")==="luau-validation",[p]),N=s||g;l.useEffect(()=>{var u,f,v;b&&((f=(u=h.current)==null?void 0:u.scrollIntoView)==null||f.call(u,{block:"start",behavior:"smooth"}),(v=h.current)==null||v.focus())},[b]),l.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]);const S=l.useCallback(async u=>{r(!0),x("idle"),a.current&&(clearTimeout(a.current),a.current=null);try{await n(u),x("applied"),a.current=setTimeout(()=>{x("idle"),a.current=null},2e3)}catch{x("failed")}finally{r(!1)}},[n]);return e.jsxs("div",{id:"controls-luau-validation",ref:h,tabIndex:-1,className:`${t.card} ${t.validationCard}`,"data-testid":"luau-syntax-validation-card",children:[e.jsxs("div",{className:t.cardHeader,children:[e.jsxs("div",{className:t.cardHeaderTitleGroup,children:[e.jsx("span",{children:d("controls.luauValidation.title","Luau Syntax Validation")}),e.jsx(Q,{topicId:"luauValidation",variant:"field",tooltip:d("controls.luauValidation.helpButton","How does it work?"),triggerClassName:`${t.cardHelpButton} ${t.touchTarget44}`})]}),e.jsx("span",{className:`${t.headerBadge} ${t.headerBadgeLive}`,children:d("settings.general.liveApply","Live Apply")})]}),e.jsxs("div",{className:t.validationSettingRow,children:[e.jsxs("div",{className:t.validationSettingCopy,children:[e.jsx("span",{id:c,className:t.validationSettingLabel,children:d("controls.luauValidation.settingLabel","Check automatically after Script edits")}),e.jsx("span",{className:t.validationSettingStatus,children:o?d("controls.luauValidation.state.on","Current: On"):d("controls.luauValidation.state.off","Current: Off")})]}),e.jsxs("div",{className:t.validationPolicyControl,children:[e.jsx("span",{className:`${t.savedIndicator} ${y==="failed"?t.savedIndicatorFailed:""} ${!N&&y==="idle"?t.savedIndicatorHidden:""}`,"data-testid":"luau-validation-save-feedback","aria-live":"polite",children:N?d("controls.luauValidation.saving","Saving…"):y==="applied"?d("controls.luauValidation.applied","Applied"):y==="failed"?d("controls.luauValidation.failed","Failed to apply"):null}),e.jsxs("label",{className:`${t.toggleSwitch} ${t.validationToggleTarget}`,"data-testid":"luau-validation-toggle",children:[e.jsx("input",{type:"checkbox",role:"switch",className:t.toggleInput,checked:o,disabled:N,"aria-labelledby":c,onChange:u=>{S(u.target.checked)}}),e.jsx("span",{className:t.toggleTrack,"aria-hidden":"true",children:e.jsx("span",{className:t.toggleThumb})})]})]})]})]})}function ve(){const{t:o}=P(),{search:s}=k(),{settings:n,updateHotSetting:d,saving:p,loading:h}=ae();return l.useMemo(()=>new URLSearchParams(s).get("section"),[s])==="license"?e.jsx(ne,{to:"/settings?section=license",replace:!0}):h?e.jsx("div",{className:t.page,children:e.jsx("div",{className:t.loading,children:o("common.loading")})}):e.jsxs("div",{className:t.page,children:[e.jsx(oe,{title:o("page.controls.title","Controls"),description:o("page.controls.description","Manage project root, Studio routing, and MCP live settings."),helpTopicId:"controls"}),e.jsx(le,{}),e.jsx(re,{}),e.jsx(ue,{enabled:(n==null?void 0:n.hot.SCRIPT_WRITE_VALIDATION_ENABLED)??!1,saving:p,onChange:c=>d("SCRIPT_WRITE_VALIDATION_ENABLED",c)}),e.jsx(de,{settings:n,updateHotSetting:d})]})}export{ve as Component};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as _,r as x,j as e}from"./index-
|
|
1
|
+
import{u as _,r as x,j as e}from"./index-uP4eoQi-.js";const N="_container_uv8oc_2",j="_header_uv8oc_10",v="_modeBtn_uv8oc_18",g="_modeBtnActive_uv8oc_33",w="_unifiedView_uv8oc_40",L="_diffLine_uv8oc_46",b="_lineNum_uv8oc_55",C="_lineContent_uv8oc_64",S="_lineAdded_uv8oc_68",V="_lineRemoved_uv8oc_73",B="_lineContext_uv8oc_78",$="_sideBySide_uv8oc_83",A="_sidePane_uv8oc_90",P="_sideLabel_uv8oc_100",R="_sideContent_uv8oc_112",D="_empty_uv8oc_117",s={container:N,header:j,modeBtn:v,modeBtnActive:g,unifiedView:w,diffLine:L,lineNum:b,lineContent:C,lineAdded:S,lineRemoved:V,lineContext:B,sideBySide:$,sidePane:A,sideLabel:P,sideContent:R,empty:D};function k(n,i){const l=n.split(`
|
|
2
2
|
`),d=i.split(`
|
|
3
3
|
`),a=[],f=Math.max(l.length,d.length);let t=0,r=0;for(;(t<l.length||r<d.length)&&(t<l.length&&r<d.length?l[t]===d[r]?(a.push({type:"context",content:l[t],lineNum:r+1}),t++,r++):(a.push({type:"removed",content:l[t],lineNum:t+1}),t++,t<l.length&&l[t]===d[r]?(a.push({type:"added",content:d[r],lineNum:r+1}),r++):r<d.length&&(a.push({type:"added",content:d[r],lineNum:r+1}),r++)):t<l.length?(a.push({type:"removed",content:l[t],lineNum:t+1}),t++):r<d.length&&(a.push({type:"added",content:d[r],lineNum:r+1}),r++),!(a.length>f*3)););return a}function O({before:n,after:i}){const{t:l}=_(),[d,a]=x.useState("unified"),f=typeof n=="string"?n:n!=null?JSON.stringify(n,null,2):"",t=typeof i=="string"?i:i!=null?JSON.stringify(i,null,2):"",r=x.useMemo(()=>k(f,t),[f,t]);if(!f&&!t)return e.jsx("div",{className:s.container,children:e.jsx("div",{className:s.empty,children:l("changelog.diff.empty","No diff available")})});if(!f&&t){const c=t.split(`
|
|
4
4
|
`);return e.jsx("div",{className:s.container,children:e.jsx("div",{className:s.unifiedView,children:c.map((u,m)=>e.jsxs("div",{className:`${s.diffLine} ${s.lineAdded}`,children:[e.jsx("span",{className:s.lineNum,children:m+1}),e.jsxs("span",{className:s.lineContent,children:["+ ",u]})]},m))})})}return e.jsxs("div",{className:s.container,children:[e.jsxs("div",{className:s.header,children:[e.jsx("button",{className:`${s.modeBtn} ${d==="unified"?s.modeBtnActive:""}`,onClick:()=>a("unified"),children:l("changelog.diff.unified","Unified")}),e.jsx("button",{className:`${s.modeBtn} ${d==="side-by-side"?s.modeBtnActive:""}`,onClick:()=>a("side-by-side"),children:l("changelog.diff.sideBySide","Side by Side")})]}),d==="unified"?e.jsx("div",{className:s.unifiedView,children:r.map((c,u)=>e.jsxs("div",{className:`${s.diffLine} ${c.type==="added"?s.lineAdded:c.type==="removed"?s.lineRemoved:s.lineContext}`,children:[e.jsx("span",{className:s.lineNum,children:c.lineNum??""}),e.jsxs("span",{className:s.lineContent,children:[c.type==="added"?"+ ":c.type==="removed"?"- ":" ",c.content]})]},u))}):e.jsxs("div",{className:s.sideBySide,children:[e.jsxs("div",{className:s.sidePane,children:[e.jsx("div",{className:s.sideLabel,children:l("changelog.diff.before","Before")}),e.jsx("div",{className:s.sideContent,children:f.split(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r,i as e}from"./index-uP4eoQi-.js";function n({label:t,tooltip:o}){return r.jsx(e,{text:o,children:t})}export{n as I};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s,u as R,r as h,d as L,e as F,b as M,D as V}from"./index-uP4eoQi-.js";import{I as A}from"./InfoLabel-DAd1I756.js";import{P as U}from"./PageHeader-_z4Dtkbg.js";import{u as z,f as O,S as X}from"./useLiveUptime-BGDr-4gk.js";import{T as q}from"./TooltipText-NA7u0bu6.js";import{G as J}from"./GameChangeDetail-DJ0xywJq.js";const K="_page_amwos_2",Q="_card_amwos_10",W="_cardHeader_amwos_17",Y="_disconnectCard_amwos_28",Z="_disconnectIcon_amwos_36",ee="_disconnectTitle_amwos_41",se="_disconnectMessage_amwos_48",te="_reconnectGuide_amwos_55",ne="_guideStep_amwos_64",ie="_stepNumber_amwos_72",ae="_reconnectIndicator_amwos_88",ce="_reconnectDot_amwos_98",re="_pulse_amwos_1",oe="_disconnectActions_amwos_112",le="_btn_amwos_118",de="_btnSecondary_amwos_134",me="_metricRow_amwos_152",ue="_metricGrid_amwos_158",ve="_metricCard_amwos_164",ge="_metric_ok_amwos_174",_e="_metric_warn_amwos_179",he="_metric_error_amwos_184",pe="_metricHeader_amwos_189",we="_metricIcon_amwos_200",fe="_metricTitle_amwos_204",xe="_metricValue_amwos_208",Ce="_metricSubtitle_amwos_215",je="_guideCard_amwos_225",Ne="_guideTitle_amwos_232",ye="_checklist_amwos_239",Te="_feedEmpty_amwos_263",Se="_feedList_amwos_270",Ie="_feedItem_amwos_278",be="_feedTime_amwos_291",ke="_feedIcon_amwos_298",Me="_feedSummary_amwos_304",De="_feedText_amwos_313",Be="_feedContext_amwos_321",He="_feedItemClickable_amwos_330",Ee="_feedChevron_amwos_338",Pe="_feedDetail_amwos_347",$e="_feedDetailPre_amwos_356",Re="_feedDetailText_amwos_365",Ge="_changelogSummary_amwos_372",Le="_changeTag_amwos_381",Fe="_tierBar_amwos_393",Ve="_tierBarTrack_amwos_399",Ae="_tierBarFillBasic_amwos_407",Ue="_tierBarFillPro_amwos_412",ze="_tierLabels_amwos_417",t={page:K,card:Q,cardHeader:W,disconnectCard:Y,disconnectIcon:Z,disconnectTitle:ee,disconnectMessage:se,reconnectGuide:te,guideStep:ne,stepNumber:ie,reconnectIndicator:ae,reconnectDot:ce,pulse:re,disconnectActions:oe,btn:le,btnSecondary:de,metricRow:me,metricGrid:ue,metricCard:ve,metric_ok:ge,metric_warn:_e,metric_error:he,metricHeader:pe,metricIcon:we,metricTitle:fe,metricValue:xe,metricSubtitle:Ce,guideCard:je,guideTitle:Ne,checklist:ye,feedEmpty:Te,feedList:Se,feedItem:Ie,feedTime:be,feedIcon:ke,feedSummary:Me,feedText:De,feedContext:Be,feedItemClickable:He,feedChevron:Ee,feedDetail:Pe,feedDetailPre:$e,feedDetailText:Re,changelogSummary:Ge,changeTag:Le,tierBar:Fe,tierBarTrack:Ve,tierBarFillBasic:Ae,tierBarFillPro:Ue,tierLabels:ze};function N({title:e,value:i,icon:a,subtitle:c,status:r,children:n}){const l=r?t[`metric_${r}`]:"";return s.jsxs("div",{className:`${t.metricCard} ${l}`,children:[s.jsxs("div",{className:t.metricHeader,children:[a&&s.jsx("span",{className:t.metricIcon,children:a}),s.jsx("span",{className:t.metricTitle,children:e})]}),s.jsx("div",{className:t.metricValue,children:i}),c&&s.jsx("div",{className:t.metricSubtitle,children:c}),n]})}function Oe(e){var a,c;const i=e==null?void 0:e.contextSummary;return(i==null?void 0:i.intent)??((c=(a=i==null?void 0:i.affectedAreas)==null?void 0:a[0])==null?void 0:c.label)??(i==null?void 0:i.testScenario)??null}function H({changes:e}){const{t:i}=R(),[a,c]=h.useState(null);return e.length===0?s.jsx("div",{className:t.feedEmpty,children:i("overview.feed.empty")}):s.jsx("div",{className:t.feedList,children:e.map((r,n)=>{const l=a===n,m=r.raw,u=m&&(m.before!=null||m.after!=null||m.details!=null),p=Oe(m);return s.jsxs("div",{children:[s.jsxs("div",{className:`${t.feedItem} ${u?t.feedItemClickable:""}`,onClick:()=>u&&c(l?null:n),children:[s.jsx("span",{className:t.feedTime,children:r.timestamp}),s.jsx("span",{className:t.feedIcon,children:r.icon}),s.jsxs("span",{className:t.feedText,children:[s.jsx("span",{className:t.feedSummary,children:r.summary}),p&&s.jsx("span",{className:t.feedContext,children:p})]}),u&&s.jsx("span",{className:t.feedChevron,children:l?"▴":"▾"})]}),l&&m&&s.jsx("div",{className:t.feedDetail,children:s.jsx(J,{change:m})})]},n)})})}const E=20;function G(e){return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}function P(){return G(new Date)}function $(e){switch(e){case"script":return"📝";case"instance":return"🧱";case"property":return"🎨";case"lighting":return"💡";case"terrain":return"⛰️";case"asset":return"📦";default:return"🔧"}}function Xe(){const{level:e,status:i}=L(),a=F(),[c,r]=h.useState(null),[n,l]=h.useState(null),[m,u]=h.useState(null),[p,v]=h.useState([]),y=h.useRef(null),T=h.useCallback(async()=>{try{const o=await M.get("/connection-info");r(o)}catch{r(null)}},[]),S=h.useCallback(async()=>{try{const o=await M.get("/api/dashboard/changelog/active");if(u(o),o.recentChanges&&o.recentChanges.length>0){const w=o.recentChanges.map(g=>({timestamp:g.timestamp?G(new Date(g.timestamp)):P(),icon:$(g.category),summary:g.summary,category:g.category,raw:g}));v(w)}}catch{u(null)}},[]),f=h.useCallback(async()=>{try{const o=await M.get("/sync/status");l(o)}catch{l(null)}},[]);return h.useEffect(()=>{e!=="disconnected"?(T(),S(),f()):(r(null),l(null),u(null));const o=new V;y.current=o,o.connect();const w=o.on("game_change",x=>{const _=x,C={timestamp:P(),icon:$(_.category),summary:_.summary,category:_.category};v(k=>{const j=[C,...k];return j.length>E?j.slice(0,E):j}),S()}),g=o.on("sync",x=>{const _=x;l(C=>({...C,state:_.status,..._.placeId?{placeId:_.placeId}:{}}))});return()=>{w(),g(),o.disconnect(),y.current=null}},[e,T,S,f]),{level:e,status:i,connectionInfo:c,syncStatus:n,changeSummary:m,recentChanges:p,tier:a}}function D(e){return e.scriptsModified+e.scriptsCreated+e.instancesCreated+e.instancesDeleted+e.instancesMoved+e.propertiesChanged+e.assetsInserted+(e.lightingChanged?1:0)+(e.terrainChanged?1:0)}function qe(e,i){switch(e){case"syncing":return i("status.syncing","Syncing");case"initializing":return i("status.initializing","Initializing");case"error":return i("status.error","Error");default:return i("status.idle","Idle")}}function Je(e){switch(e){case"syncing":return"ok";case"initializing":return"warn";case"error":return"error";default:return"ok"}}function b(e,i,a,c){return s.jsxs("div",{className:e.metricSubtitle,children:[s.jsx(A,{label:i,tooltip:a}),": ",c]},i)}function d(e,i){return s.jsx(q,{text:i,children:e})}function ss(){var j,B;const{t:e}=R(),{level:i,status:a,connectionInfo:c,syncStatus:r,changeSummary:n,recentChanges:l}=Xe(),m=z(a==null?void 0:a.uptime),u=s.jsx(U,{title:e("page.overview.title","Overview"),description:e("page.overview.description","Check server, plugin, agent, sync, and recent game-change status in one place."),helpTopicId:"overview",helpState:{connectionLevel:i}});if(i==="disconnected")return s.jsxs("div",{className:t.page,children:[u,s.jsxs("div",{className:t.disconnectCard,children:[s.jsx("div",{className:t.disconnectIcon,children:"⚠️"}),s.jsx("h2",{className:t.disconnectTitle,children:e("overview.l0.title")}),s.jsx("p",{className:t.disconnectMessage,children:e("overview.l0.message")}),s.jsxs("div",{className:t.reconnectGuide,children:[s.jsxs("div",{className:t.guideStep,children:[s.jsx("span",{className:t.stepNumber,children:"1"}),s.jsx("span",{children:e("overview.l0.step1")})]}),s.jsxs("div",{className:t.guideStep,children:[s.jsx("span",{className:t.stepNumber,children:"2"}),s.jsx("span",{children:e("overview.l0.step2")})]})]}),s.jsxs("div",{className:t.reconnectIndicator,children:[s.jsx("span",{className:t.reconnectDot}),e("overview.l0.reconnecting")]}),s.jsxs("div",{className:t.disconnectActions,children:[s.jsx("button",{className:t.btn,onClick:()=>window.location.reload(),children:e("overview.l0.reconnectBtn")}),s.jsx("button",{className:t.btnSecondary,onClick:()=>{window.location.hash="#/settings"},children:e("overview.l0.settingsBtn")})]})]})]});const p=(c==null?void 0:c.mcpInstanceCount)??0,v=((j=c==null?void 0:c.mcpInstances)==null?void 0:j.find(I=>!I.isServer&&I.aiClientName))??((B=c==null?void 0:c.mcpInstances)==null?void 0:B.find(I=>!!I.aiClientName))??null,y=(a==null?void 0:a.pluginClients)??[],T=y.length>0,S=(a==null?void 0:a.sessionId)??(c==null?void 0:c.sessionId)??"-",f=e("overview.metric.server.tooltip","MCP server runtime and process status"),o=e("overview.metric.plugin.tooltip","Roblox Studio plugin connection and version status"),w=e("overview.metric.agent.tooltip","Connected AI coding agents and their runtime state"),g=e("overview.metric.sync.tooltip","Current Studio to local sync activity"),x=a?[b(t,e("overview.meta.version","Version"),e("overview.meta.version.tooltip","Installed MCP server version"),`v${a.version}`),b(t,e("overview.meta.session","Session"),e("overview.meta.session.tooltip","Current MCP session identifier"),S),b(t,e("overview.meta.pid","PID"),e("overview.meta.pid.tooltip","Operating system process identifier"),String(a.pid??"-")),b(t,e("overview.meta.uptime","Uptime"),e("overview.meta.uptime.tooltip","Time elapsed since the MCP server started"),O(m??a.uptime))]:[];if(i==="serverOnly")return s.jsxs("div",{className:t.page,children:[u,s.jsxs("div",{className:t.metricRow,children:[s.jsx(N,{title:d(e("overview.metric.server"),f),value:d(e("status.online"),f),icon:"🖥️",status:"ok",children:s.jsxs(s.Fragment,{children:[x,s.jsx(X,{status:"online"})]})}),s.jsx(N,{title:d(e("overview.metric.agent"),w),value:d((v==null?void 0:v.aiClientName)??e("overview.metric.noAgent"),w),icon:"🤖",subtitle:p>1?`${p} ${e("overview.metric.agent.instancesUnit","instances")}`:void 0,status:v?"ok":"warn"})]}),s.jsxs("div",{className:t.guideCard,children:[s.jsx("h3",{className:t.guideTitle,children:e("overview.l1.pluginGuide")}),s.jsxs("ul",{className:t.checklist,children:[s.jsx("li",{children:e("overview.l1.check1")}),s.jsx("li",{children:e("overview.l1.check2")})]})]}),s.jsxs("div",{className:t.card,children:[s.jsx("div",{className:t.cardHeader,children:e("overview.feed.title")}),l.length>0?s.jsx(H,{changes:l}):s.jsx("div",{className:t.feedEmpty,children:e("overview.l1.feedHint")})]}),n&&D(n)>0&&s.jsxs("div",{className:t.card,children:[s.jsx("div",{className:t.cardHeader,children:e("overview.changelog.title")}),s.jsxs("div",{className:t.changelogSummary,children:[s.jsxs("span",{children:[e("overview.changelog.entries","Entries"),": ",D(n)]}),n.scriptsModified>0&&s.jsxs("span",{className:t.changeTag,children:["📝"," ",n.scriptsModified," ",e("overview.changelog.scripts")]}),n.instancesCreated>0&&s.jsxs("span",{className:t.changeTag,children:["🧱"," ",n.instancesCreated," ",e("overview.changelog.instances")]}),n.propertiesChanged>0&&s.jsxs("span",{className:t.changeTag,children:["🎨"," ",n.propertiesChanged," ",e("overview.changelog.properties")]}),n.assetsInserted>0&&s.jsxs("span",{className:t.changeTag,children:["📦"," ",n.assetsInserted," ",e("overview.changelog.assets")]})]})]})]});const _=y[0],C=n?D(n):0,k=!!n&&C>0;return s.jsxs("div",{className:t.page,children:[u,s.jsxs("div",{className:t.metricGrid,children:[s.jsx(N,{title:d(e("overview.metric.server"),f),value:d(e("status.online"),f),icon:"🖥️",status:"ok",children:s.jsx(s.Fragment,{children:x})}),s.jsx(N,{title:d(e("overview.metric.plugin"),o),value:d(e(T?"status.online":"status.offline"),o),icon:"🔌",subtitle:_?`${_.placeName??"-"} / v${_.pluginVersion??"-"}`:void 0,status:T?"ok":"error"}),s.jsx(N,{title:d(e("overview.metric.agent"),w),value:d((v==null?void 0:v.aiClientName)??e("overview.metric.noAgent"),w),icon:"🤖",subtitle:p>1?`${p} ${e("overview.metric.agent.instancesUnit","instances")}`:void 0,status:v?"ok":"warn"}),s.jsx(N,{title:d(e("overview.metric.sync"),g),value:d(qe(r==null?void 0:r.state,e),g),icon:"🔄",status:Je(r==null?void 0:r.state)})]}),s.jsxs("div",{className:t.card,children:[s.jsx("div",{className:t.cardHeader,children:e("overview.feed.title")}),s.jsx(H,{changes:l})]}),k&&s.jsxs("div",{className:t.card,children:[s.jsx("div",{className:t.cardHeader,children:e("overview.changelog.title")}),s.jsxs("div",{className:t.changelogSummary,children:[s.jsxs("span",{children:[e("overview.changelog.entries","Entries"),": ",C]}),n.scriptsModified>0&&s.jsxs("span",{className:t.changeTag,children:["📝"," ",n.scriptsModified," ",e("overview.changelog.scripts")]}),n.instancesCreated>0&&s.jsxs("span",{className:t.changeTag,children:["🧱"," ",n.instancesCreated," ",e("overview.changelog.instances")]}),n.propertiesChanged>0&&s.jsxs("span",{className:t.changeTag,children:["🎨"," ",n.propertiesChanged," ",e("overview.changelog.properties")]}),n.assetsInserted>0&&s.jsxs("span",{className:t.changeTag,children:["📦"," ",n.assetsInserted," ",e("overview.changelog.assets")]})]})]})]})}export{ss as Component};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{f as oe,r as u,j as t,u as se,a as ae,X as re,E as ie,
|
|
1
|
+
import{f as oe,r as u,j as t,u as se,a as ae,X as re,E as ie,i as ce,x as le}from"./index-uP4eoQi-.js";/**
|
|
2
2
|
* @license lucide-react v1.8.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
package/dashboard/dist/assets/{PlaceSelectOptions-KRG4cS5y.js → PlaceSelectOptions-Dd_m61bQ.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t,C as i,G as m,q as v,H as x}from"./index-
|
|
1
|
+
import{j as t,C as i,G as m,q as v,H as x}from"./index-uP4eoQi-.js";const P="_details_1nw6u_1",I={details:P};function D(c,n,e,l,a,s,r,d){const f=c.isConnected?e:l,p=i(c),S=[f,p==="duplicate"?a:p==="unresolved"?s:null,d===!1?r:null].filter(u=>!!u);return`${n} (${c.placeId}) — ${S.join(" · ")}`}function $(c){const n=new Set;return c.filter(e=>e.placeId<=0||i(e)!=="unresolved"?!0:n.has(e.placeId)?!1:(n.add(e.placeId),!0))}function y(c,n){return Object.entries(n).reduce((e,[l,a])=>e.replace(`{${l}}`,a),c)}function L({places:c,confirmedNames:n,t:e}){const l=$(c),a=l.filter(o=>o.isConnected),s=l.filter(o=>!o.isConnected),r=e("placeScope.connected","Studio connected"),d=e("placeScope.stored","Stored data"),f=e("placeScope.folder.duplicate","Duplicate folder"),p=e("placeScope.folder.unresolved","Representative folder unconfirmed"),S=e("placeScope.folder.noSyncHistory","No sync history"),u=o=>{const h=m(o),b=v(c,o),j=x(c,o,n==null?void 0:n.get(o.placeId))??y(e("placeScope.folder.unresolvedPlace","Place {placeId}"),{placeId:String(o.placeId)});return t.jsx("option",{value:h?`folder:${o.placeDirName}`:o.placeId,disabled:h,children:D(o,j,r,d,f,p,S,b)},`${o.placeId}:${o.placeDirName}`)};return t.jsxs(t.Fragment,{children:[a.length>0?t.jsx("optgroup",{label:e("placeScope.connectedGroup","Connected Studios"),children:a.map(u)}):null,s.length>0?t.jsx("optgroup",{label:e("placeScope.storedGroup","Stored data"),children:s.map(u)}):null]})}function C({places:c,t:n}){const e=c.filter(l=>i(l)==="duplicate"||i(l)==="unresolved");return e.length===0?null:t.jsxs("details",{className:I.details,children:[t.jsx("summary",{children:n("placeScope.folder.details","Place folder details")}),t.jsx("ul",{children:e.map(l=>{const a=i(l)==="duplicate",s=a?n("placeScope.folder.duplicate","Duplicate folder"):n("placeScope.folder.unresolved","Representative folder unconfirmed"),r=a?y(n("placeScope.folder.duplicateReason","The current saved location is {canonicalFolder}. This folder is backed up after a successful full sync."),{canonicalFolder:l.canonicalPlaceDirName??n("placeScope.folder.unknown","unknown")}):n("placeScope.folder.unresolvedReason","This Place remains selectable by ID, but no specific folder is confirmed as the representative yet."),d=l.hasSyncMetadata===!1?`${n("placeScope.folder.noSyncHistory","No sync history")}. ${r}`:r;return t.jsxs("li",{children:[t.jsx("strong",{children:s}),t.jsx("span",{children:l.placeDirName}),t.jsx("span",{children:d})]},`${l.placeId}:${l.placeDirName}`)})})]})}export{L as P,C as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as i,r as c,j as r}from"./index-
|
|
1
|
+
import{u as i,r as c,j as r}from"./index-uP4eoQi-.js";import{A as n}from"./AiPromptExamples-BSFrFYar.js";const m=["character","automated-check","selection","game-state","action"];function y(t){return m.map(a=>({id:a,title:t(`playtest.ai.examples.${a}.title`),request:t(`playtest.ai.examples.${a}.request`)}))}function d(t){const{locale:a,t:e}=i(),s=t.exampleIds.join("|"),o=c.useMemo(()=>{const p=new Set(t.exampleIds);return y(e).filter(l=>p.has(l.id))},[s,e]);return r.jsx(n,{examples:o,resetKey:`${a}|${s}`,labels:{copy:e("playtest.ai.copy","Copy request"),copying:e("playtest.ai.copying","Copying…"),copied:e("playtest.ai.copied","Copied"),copyFailed:e("playtest.ai.copyFailed","Could not copy. Select the request text and copy it manually.")}})}export{d as P};
|