@wrongstack/webui 0.285.0 → 0.287.0
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/README.md +35 -0
- package/dist/App.d.ts.map +1 -1
- package/dist/assets/AnalyticsDashboard-Lwr7vcaY.js +1 -0
- package/dist/assets/AutoPhaseView-Dm2ALbiB.js +1 -0
- package/dist/assets/ChangesView-CVcdAOd0.js +1 -0
- package/dist/assets/CodeEditor-DJCl9lsb.js +1 -0
- package/dist/assets/CronJobsPanel-B21inkB5.js +1 -0
- package/dist/assets/DebugDashboard-BppNFFs9.js +1 -0
- package/dist/assets/{DesignGalleryView-Bk3HH3al.js → DesignGalleryView-BKfKAS1f.js} +1 -1
- package/dist/assets/KanbanView-Bc2UIVD2.js +1 -0
- package/dist/assets/MailboxDetailView-b8e-UFpl.js +1 -0
- package/dist/assets/OfficeMapPanel-DmW-omSm.js +4 -0
- package/dist/assets/ProcessMonitor-4Il_i86w.js +1 -0
- package/dist/assets/{QueuePanel-BdwvWRuB.js → QueuePanel-Ikqk4oth.js} +1 -1
- package/dist/assets/{RefreshDebugView-eZwtZXgZ.js → RefreshDebugView-BQ7J1C4N.js} +1 -1
- package/dist/assets/SddBoardView-B2ECODCt.js +2 -0
- package/dist/assets/SddFlowGraph-DmZbA2K1.js +1 -0
- package/dist/assets/SddWizard-CPYgixwo.js +1 -0
- package/dist/assets/SessionsDashboard-DZ2kQo_0.js +1 -0
- package/dist/assets/SetupScreen-CnfDy-Zu.js +1 -0
- package/dist/assets/SkillDetailView-Df1mNWLj.js +3 -0
- package/dist/assets/{SpecsView-yunV-Xfj.js → SpecsView-C0zbOk7n.js} +1 -1
- package/dist/assets/TerminalPanel-B-fOpicS.js +1 -0
- package/dist/assets/activity-BlfRLrUt.js +5 -0
- package/dist/assets/activity-C6fV-S38.js +5 -0
- package/dist/assets/activity-Csy0Hk3h.js +5 -0
- package/dist/assets/activity-DEmOOQMt.js +5 -0
- package/dist/assets/activity-DFMWzed9.js +5 -0
- package/dist/assets/activity-Dn9wzdq-.js +5 -0
- package/dist/assets/activity-GAfT06yP.js +5 -0
- package/dist/assets/chat-BJzPxfyr.js +1 -0
- package/dist/assets/chat-BRBVFl4h.js +1 -0
- package/dist/assets/chat-Bkom8vQo.js +1 -0
- package/dist/assets/chat-C7ybebfi.js +1 -0
- package/dist/assets/chat-Du7n7HZ7.js +1 -0
- package/dist/assets/chat-IRKmQ6we.js +1 -0
- package/dist/assets/chat-VkTBQmmx.js +1 -0
- package/dist/assets/chat-store-CQq9AeA9.js +5 -0
- package/dist/assets/commandPalette-BcMV6x3_.js +1 -0
- package/dist/assets/commandPalette-C4o2rUOp.js +1 -0
- package/dist/assets/commandPalette-C5U6qfth.js +1 -0
- package/dist/assets/commandPalette-CBJfByB7.js +1 -0
- package/dist/assets/commandPalette-CrYfIhnW.js +1 -0
- package/dist/assets/commandPalette-Dgd8HfNm.js +1 -0
- package/dist/assets/i18n-CLLrYq46.js +2 -0
- package/dist/assets/index-BwLKTDt1.js +159 -0
- package/dist/assets/index-Dk3-IFDU.css +1 -0
- package/dist/assets/manrope-cyrillic-wght-normal-Dvxsihut.woff2 +0 -0
- package/dist/assets/manrope-greek-wght-normal-DL7QRZyv.woff2 +0 -0
- package/dist/assets/manrope-latin-ext-wght-normal-Ch3YOpNY.woff2 +0 -0
- package/dist/assets/manrope-latin-wght-normal-DHIcAJRg.woff2 +0 -0
- package/dist/assets/manrope-vietnamese-wght-normal-usUDDRr7.woff2 +0 -0
- package/dist/assets/markdown-BRAejDWd.js +44 -0
- package/dist/assets/{monaco-XnLmrAXJ.js → monaco-MjnRih9i.js} +1 -1
- package/dist/assets/{monaco-theme-Lsd14tM-.js → monaco-theme-DhdHiZEb.js} +1 -1
- package/dist/assets/{session-store-P-JnaPPK.js → session-store-zbDVE9MI.js} +1 -1
- package/dist/assets/settings-Bc58aJZk.js +1 -0
- package/dist/assets/settings-Bp9YKTVi.js +1 -0
- package/dist/assets/settings-C5VZmgTv.js +1 -0
- package/dist/assets/settings-CPPzs9tv.js +1 -0
- package/dist/assets/settings-D97B_3tS.js +1 -0
- package/dist/assets/settings-DLpAN_Sw.js +1 -0
- package/dist/assets/settings-KWv7WsjE.js +1 -0
- package/dist/assets/space-grotesk-latin-ext-wght-normal-D9tNdqV9.woff2 +0 -0
- package/dist/assets/space-grotesk-latin-wght-normal-BhU9QXUp.woff2 +0 -0
- package/dist/assets/space-grotesk-vietnamese-wght-normal-D0rl6rjA.woff2 +0 -0
- package/dist/assets/ui-store-Dm48nEb1.js +1 -0
- package/dist/assets/utils-C9L1kxOy.js +1 -0
- package/dist/assets/{vendor-CyLvG8N0.js → vendor-B51hXwIj.js} +30 -30
- package/dist/assets/vendor-BShi5_Dg.css +1 -0
- package/dist/assets/ws-client-Bbu1u6TM.js +1 -0
- package/dist/assets/{xyflow-oYDGUYW6.js → xyflow-BDdNcuaV.js} +3 -3
- package/dist/components/ChatInput/image-attachments.d.ts +58 -0
- package/dist/components/ChatInput/image-attachments.d.ts.map +1 -0
- package/dist/components/ChatInput/slash-routing.d.ts +8 -0
- package/dist/components/ChatInput/slash-routing.d.ts.map +1 -1
- package/dist/components/ChatInput/use-paste-drop.d.ts +14 -4
- package/dist/components/ChatInput/use-paste-drop.d.ts.map +1 -1
- package/dist/components/ChatInput.d.ts.map +1 -1
- package/dist/components/ChatView/index.d.ts.map +1 -1
- package/dist/components/ChipMultiSelect.d.ts +20 -0
- package/dist/components/ChipMultiSelect.d.ts.map +1 -0
- package/dist/components/CodeEditor.d.ts.map +1 -1
- package/dist/components/CommandPalette/index.d.ts.map +1 -1
- package/dist/components/ContextDashboard.d.ts +13 -0
- package/dist/components/ContextDashboard.d.ts.map +1 -0
- package/dist/components/CronJobsPanel.d.ts +6 -0
- package/dist/components/CronJobsPanel.d.ts.map +1 -0
- package/dist/components/CronTrigger.d.ts +2 -0
- package/dist/components/CronTrigger.d.ts.map +1 -0
- package/dist/components/FallbackEditor.d.ts.map +1 -1
- package/dist/components/FileReferenceChip.d.ts +2 -2
- package/dist/components/FileReferenceChip.d.ts.map +1 -1
- package/dist/components/InspectorPanel.d.ts +9 -9
- package/dist/components/InspectorPanel.d.ts.map +1 -1
- package/dist/components/KanbanView.d.ts.map +1 -1
- package/dist/components/MailboxPanel.d.ts.map +1 -1
- package/dist/components/MemoryManager/MemoryGraph.d.ts +40 -0
- package/dist/components/MemoryManager/MemoryGraph.d.ts.map +1 -0
- package/dist/components/MemoryManager/index.d.ts +15 -0
- package/dist/components/MemoryManager/index.d.ts.map +1 -0
- package/dist/components/MessageBubble/AttachmentGallery.d.ts +12 -0
- package/dist/components/MessageBubble/AttachmentGallery.d.ts.map +1 -0
- package/dist/components/MessageBubble/LazyMarkdown.d.ts +27 -0
- package/dist/components/MessageBubble/LazyMarkdown.d.ts.map +1 -0
- package/dist/components/MessageBubble/ToolInputView.d.ts.map +1 -1
- package/dist/components/MessageBubble/index.d.ts.map +1 -1
- package/dist/components/ModelPickDialog.d.ts +22 -0
- package/dist/components/ModelPickDialog.d.ts.map +1 -0
- package/dist/components/ModelPicker.d.ts.map +1 -1
- package/dist/components/ModelSelectDialog.d.ts +47 -0
- package/dist/components/ModelSelectDialog.d.ts.map +1 -0
- package/dist/components/RefinePanel.d.ts +17 -1
- package/dist/components/RefinePanel.d.ts.map +1 -1
- package/dist/components/SddFlowGraph.d.ts.map +1 -1
- package/dist/components/SddTaskDrawer.d.ts.map +1 -1
- package/dist/components/SearchOverlay.d.ts.map +1 -1
- package/dist/components/SessionsDashboard.d.ts.map +1 -1
- package/dist/components/SettingsPanel/BrainSection.d.ts.map +1 -1
- package/dist/components/SettingsPanel/MCPSection.d.ts +21 -0
- package/dist/components/SettingsPanel/MCPSection.d.ts.map +1 -1
- package/dist/components/SettingsPanel/ModelSection.d.ts.map +1 -1
- package/dist/components/SettingsPanel/PluginToggleList.d.ts +3 -0
- package/dist/components/SettingsPanel/PluginToggleList.d.ts.map +1 -0
- package/dist/components/SettingsPanel/PreferenceControls.d.ts.map +1 -1
- package/dist/components/SettingsPanel/PreferenceToggle.d.ts.map +1 -1
- package/dist/components/SettingsPanel/RoutingSection.d.ts +13 -0
- package/dist/components/SettingsPanel/RoutingSection.d.ts.map +1 -0
- package/dist/components/SettingsPanel/ShadowSection.d.ts.map +1 -1
- package/dist/components/SettingsPanel/ToolsSection.d.ts.map +1 -1
- package/dist/components/SettingsPanel/index.d.ts.map +1 -1
- package/dist/components/SidePanel/HistoryPanel.d.ts.map +1 -1
- package/dist/components/SidePanel/SessionList.d.ts +33 -5
- package/dist/components/SidePanel/SessionList.d.ts.map +1 -1
- package/dist/components/SidePanel/SkillsList.d.ts.map +1 -1
- package/dist/components/SidePanel/index.d.ts.map +1 -1
- package/dist/components/SkillDetailView.d.ts.map +1 -1
- package/dist/components/TaskCard.d.ts.map +1 -1
- package/dist/components/TerminalPanel.d.ts.map +1 -1
- package/dist/components/Toaster.d.ts +0 -7
- package/dist/components/Toaster.d.ts.map +1 -1
- package/dist/components/TodosPanel.d.ts.map +1 -1
- package/dist/components/WelcomeScreen.d.ts.map +1 -1
- package/dist/components/WorkspaceDock.d.ts +8 -9
- package/dist/components/WorkspaceDock.d.ts.map +1 -1
- package/dist/components/activity-bar/index.d.ts.map +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/ui/PickerCardList.d.ts +52 -0
- package/dist/components/ui/PickerCardList.d.ts.map +1 -0
- package/dist/components/ui/sheet.d.ts +7 -1
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/sparkline.d.ts.map +1 -1
- package/dist/hooks/useDesktopBridge.d.ts +29 -0
- package/dist/hooks/useDesktopBridge.d.ts.map +1 -0
- package/dist/hooks/useF5Resilience.d.ts +16 -0
- package/dist/hooks/useF5Resilience.d.ts.map +1 -0
- package/dist/hooks/useGlobalKeyboardShortcuts.d.ts +25 -0
- package/dist/hooks/useGlobalKeyboardShortcuts.d.ts.map +1 -0
- package/dist/hooks/useKanbanMeta.d.ts +32 -0
- package/dist/hooks/useKanbanMeta.d.ts.map +1 -0
- package/dist/hooks/useWebSocket.d.ts +17 -2
- package/dist/hooks/useWebSocket.d.ts.map +1 -1
- package/dist/hooks/ws-handlers/chat-handlers.d.ts.map +1 -1
- package/dist/hooks/ws-handlers/files-mailbox-handlers.d.ts +3 -1
- package/dist/hooks/ws-handlers/files-mailbox-handlers.d.ts.map +1 -1
- package/dist/hooks/ws-handlers/misc-handlers.d.ts +2 -0
- package/dist/hooks/ws-handlers/misc-handlers.d.ts.map +1 -1
- package/dist/hooks/ws-handlers.d.ts +4 -0
- package/dist/hooks/ws-handlers.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.html +17 -16
- package/dist/index.js +26302 -20824
- package/dist/index.js.map +4 -4
- package/dist/lib/analytics.d.ts +2 -0
- package/dist/lib/analytics.d.ts.map +1 -1
- package/dist/lib/default-prompt-pools.d.ts +27 -0
- package/dist/lib/default-prompt-pools.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +7 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/view-navigation.d.ts +1 -1
- package/dist/lib/view-navigation.d.ts.map +1 -1
- package/dist/lib/ws-client.d.ts +22 -5
- package/dist/lib/ws-client.d.ts.map +1 -1
- package/dist/main.d.ts +2 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/stores/chat-store.d.ts +10 -1
- package/dist/stores/chat-store.d.ts.map +1 -1
- package/dist/stores/cron-store.d.ts +29 -0
- package/dist/stores/cron-store.d.ts.map +1 -0
- package/dist/stores/file-reference-store.d.ts +7 -1
- package/dist/stores/file-reference-store.d.ts.map +1 -1
- package/dist/stores/index.d.ts +2 -0
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/stores/kanban-store.d.ts +2 -1
- package/dist/stores/kanban-store.d.ts.map +1 -1
- package/dist/stores/local-prefs.d.ts +24 -0
- package/dist/stores/local-prefs.d.ts.map +1 -1
- package/dist/stores/mailbox-store.d.ts +10 -0
- package/dist/stores/mailbox-store.d.ts.map +1 -1
- package/dist/stores/types.d.ts +24 -3
- package/dist/stores/types.d.ts.map +1 -1
- package/dist/stores/ui-store.d.ts +28 -9
- package/dist/stores/ui-store.d.ts.map +1 -1
- package/dist/types.d.ts +391 -7
- package/dist/types.d.ts.map +1 -1
- package/package.json +16 -19
- package/dist/assets/AnalyticsDashboard-Bn2wIgV0.js +0 -1
- package/dist/assets/AutoPhaseView-DWp3yHpI.js +0 -1
- package/dist/assets/ChangesView-C_r4kccO.js +0 -1
- package/dist/assets/CodeEditor-DSpqZ-mS.js +0 -1
- package/dist/assets/DebugDashboard-DWKLI7lR.js +0 -1
- package/dist/assets/KanbanView-CJqlvsbc.js +0 -1
- package/dist/assets/MailboxDetailView-BwWagFay.js +0 -1
- package/dist/assets/OfficeMapPanel-QFPaXTZ9.js +0 -4
- package/dist/assets/ProcessMonitor-dUyYv3Z4.js +0 -1
- package/dist/assets/SddBoardView-OtKwEtAp.js +0 -2
- package/dist/assets/SddFlowGraph-MVMUCMEy.js +0 -1
- package/dist/assets/SddWizard-c7g68RFx.js +0 -1
- package/dist/assets/SessionsDashboard-pMXfRTwN.js +0 -1
- package/dist/assets/SkillDetailView-CcdIF-85.js +0 -2
- package/dist/assets/TerminalPanel-BIYT1IB3.js +0 -1
- package/dist/assets/activity-3lpGdUIy.js +0 -5
- package/dist/assets/activity-Bi6wI_Cg.js +0 -5
- package/dist/assets/activity-CSPSX--m.js +0 -5
- package/dist/assets/activity-CcEdxJjx.js +0 -5
- package/dist/assets/activity-Cv0CmTyM.js +0 -5
- package/dist/assets/activity-Doy5Yots.js +0 -5
- package/dist/assets/activity-T9kySYDT.js +0 -5
- package/dist/assets/chat--Zry3Atx.js +0 -1
- package/dist/assets/chat-0DeGMNFQ.js +0 -1
- package/dist/assets/chat-BErfSQjE.js +0 -1
- package/dist/assets/chat-CX5cjaC-.js +0 -1
- package/dist/assets/chat-CibJIps5.js +0 -1
- package/dist/assets/chat-Dr5SJikx.js +0 -1
- package/dist/assets/chat-Siz8aWTB.js +0 -1
- package/dist/assets/chat-store-De7J1E26.js +0 -5
- package/dist/assets/commandPalette-2M1hYRuH.js +0 -1
- package/dist/assets/commandPalette-BE_ljQwl.js +0 -1
- package/dist/assets/commandPalette-BYf22WAi.js +0 -1
- package/dist/assets/commandPalette-BZhacjvy.js +0 -1
- package/dist/assets/commandPalette-CTE9ITWg.js +0 -1
- package/dist/assets/commandPalette-RxWSjQIg.js +0 -1
- package/dist/assets/i18n-BMePmaPJ.js +0 -2
- package/dist/assets/index-CbrHWxbT.css +0 -1
- package/dist/assets/index-CyTNJHe8.js +0 -154
- package/dist/assets/local-prefs-BBMxai9I.js +0 -1
- package/dist/assets/markdown-D0X23O-i.js +0 -44
- package/dist/assets/settings-BVvx94WK.js +0 -1
- package/dist/assets/settings-CKNx8p9I.js +0 -1
- package/dist/assets/settings-CQ4x-iFD.js +0 -1
- package/dist/assets/settings-CmHCQRVI.js +0 -1
- package/dist/assets/settings-D-SHf0yS.js +0 -1
- package/dist/assets/settings-DgGu17XI.js +0 -1
- package/dist/assets/settings-TqprB9wO.js +0 -1
- package/dist/assets/ui-store-ComQYc5F.js +0 -1
- package/dist/assets/utils-CU_o9ioU.js +0 -1
- package/dist/assets/vendor-CcOzUMQS.css +0 -1
- package/dist/assets/ws-client-CwL51TNh.js +0 -1
- package/dist/server/index.d.ts.map +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# @wrongstack/webui
|
|
2
|
+
|
|
3
|
+
React 19 + Vite browser client for WrongStack. The WebSocket and HTTP backend is
|
|
4
|
+
published separately as [`@wrongstack/webui-server`](../webui-server); the CLI
|
|
5
|
+
starts both surfaces with `wstack --webui` (equivalent to `wstack webui`).
|
|
6
|
+
|
|
7
|
+
## Development
|
|
8
|
+
|
|
9
|
+
From the workspace root:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pnpm --filter @wrongstack/webui dev
|
|
13
|
+
pnpm --filter @wrongstack/webui build
|
|
14
|
+
pnpm --filter @wrongstack/webui typecheck
|
|
15
|
+
pnpm --filter @wrongstack/webui test
|
|
16
|
+
pnpm --filter @wrongstack/webui test:coverage
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The Vite development server serves the frontend. A functional agent session also
|
|
20
|
+
requires the WrongStack WebUI backend; use `wstack --webui` for the integrated
|
|
21
|
+
surface.
|
|
22
|
+
|
|
23
|
+
## Package boundaries
|
|
24
|
+
|
|
25
|
+
- `src/components/`, `src/hooks/`, and `src/stores/` implement the browser UI.
|
|
26
|
+
- `src/lib/` contains browser-side protocol and formatting utilities.
|
|
27
|
+
- `@wrongstack/webui-server` owns the Node.js server implementation used by the CLI.
|
|
28
|
+
- `src/server/index.ts` is a temporary compatibility re-export of
|
|
29
|
+
`@wrongstack/webui-server`; it is not a second backend implementation.
|
|
30
|
+
|
|
31
|
+
See [TESTING.md](./TESTING.md) for the package test and coverage policy.
|
|
32
|
+
|
|
33
|
+
## License
|
|
34
|
+
|
|
35
|
+
MIT
|
package/dist/App.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AAouBA,wBAAgB,GAAG,gCAQlB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-BRAejDWd.js";import{Jr as r,Vr as i,cn as a,lr as o,lt as s,or as c,pi as l,pt as u,rt as d,vi as f,zr as p}from"./vendor-B51hXwIj.js";import"./i18n-CLLrYq46.js";import{t as m}from"./ws-client-Bbu1u6TM.js";import{nt as h}from"./index-BwLKTDt1.js";var g=e(t(),1),_=n();function v(e){let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m ${t%60}s`;let r=Math.floor(n/60);return r<24?`${r}h ${n%60}m`:`${Math.floor(r/24)}d`}function y(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function b(e){return e<.01?`$${e.toFixed(4)}`:`$${e.toFixed(2)}`}function x(e){return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function S(e){return e.includes(`error`)||e.includes(`fail`)?`text-destructive`:e.includes(`warn`)?`text-warning`:e.includes(`success`)||e.includes(`complete`)?`text-success`:`text-muted-foreground`}function C({icon:e,label:t,value:n,sub:r,color:i=`text-muted-foreground`}){return(0,_.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,_.jsx)(`div`,{className:`mt-0.5 ${i}`,children:e}),(0,_.jsxs)(`div`,{className:`min-w-0`,children:[(0,_.jsx)(`div`,{className:`text-2xl font-semibold tabular-nums text-foreground`,children:n}),(0,_.jsx)(`div`,{className:`mt-0.5 text-xs text-muted-foreground`,children:t}),r?(0,_.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground/70`,children:r}):null]})]})}function w(){let{t:e}=f(),[t,n]=(0,g.useState)(null),[w,T]=(0,g.useState)([]),[E,D]=(0,g.useState)([]),[O,k]=(0,g.useState)(null),[A,j]=(0,g.useState)(!0),[M,N]=(0,g.useState)(!1),P=(0,g.useRef)(null),F=(0,g.useCallback)(async()=>{try{let e=await fetch(`/api/analytics/summary`);e.ok&&n(await e.json())}catch{}},[]),I=(0,g.useCallback)(async()=>{try{let e=await fetch(`/api/analytics?limit=50`);e.ok&&T((await e.json()).events)}catch{}},[]),L=(0,g.useCallback)(async()=>{try{let e=await fetch(`/api/sessions`);e.ok&&D(await e.json())}catch{}},[]),R=(0,g.useCallback)(async()=>{if(!M){N(!0);try{let e=m(h.getState().wsUrl);P.current=e;let t=e.on(`stats.get`,e=>{let n=e.payload;k(n),N(!1),t()});e.getStats(),setTimeout(()=>{N(!1),t()},8e3)}catch{N(!1)}}},[M]);(0,g.useEffect)(()=>{let e=()=>{Promise.all([F(),I(),L(),R()]).finally(()=>j(!1))};e();let t=setInterval(e,1e4);return()=>clearInterval(t)},[F,I,L,R]);let{totalAgents:z,activeAgents:B,totalToolCalls:V,totalIterations:H}=(0,g.useMemo)(()=>{let e=0,t=0,n=0,r=0;for(let i of E)for(let a of i.agents)e++,a.status===`running`&&t++,n+=a.toolCalls,r+=a.iterations;return{totalAgents:e,activeAgents:t,totalToolCalls:n,totalIterations:r}},[E]),U=(0,g.useMemo)(()=>t?Object.entries(t.categoryBreakdown).sort((e,t)=>t[1]-e[1]).slice(0,8):[],[t]),W=(0,g.useMemo)(()=>t?Object.entries(t.eventBreakdown).sort((e,t)=>t[1]-e[1]).slice(0,10):[],[t]),G=(0,g.useMemo)(()=>{if(!t)return 0;let e=0;for(let[n,r]of Object.entries(t.eventBreakdown))n.toLowerCase().includes(`error`)&&(e+=r);return e},[t]),K=(0,g.useMemo)(()=>{if(!t)return 0;let e=0;for(let[n,r]of Object.entries(t.eventBreakdown))n.toLowerCase().includes(`warn`)&&(e+=r);return e},[t]),q=(0,g.useMemo)(()=>[...w].reverse(),[w]);return A?(0,_.jsx)(`div`,{className:`flex h-full min-h-0 items-center justify-center bg-[hsl(var(--surface-2)/0.45)] p-4`,children:(0,_.jsxs)(`div`,{className:`ws-surface flex items-center gap-2 rounded-xl px-4 py-3 text-sm text-muted-foreground`,children:[(0,_.jsx)(r,{className:`h-4 w-4 animate-spin text-primary`}),e(`activity:analytics.loading`)]})}):(0,_.jsx)(`div`,{className:`h-full min-h-0 min-w-0 overflow-y-auto bg-[hsl(var(--surface-2)/0.45)] p-4 sm:p-6`,children:(0,_.jsxs)(`div`,{className:`mx-auto flex w-full max-w-7xl flex-col gap-5`,children:[(0,_.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:(0,_.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,_.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,_.jsx)(l,{className:`h-4 w-4 text-primary`}),(0,_.jsx)(`h1`,{className:`truncate text-base font-semibold`,children:e(`activity:analytics.heading`)})]}),(0,_.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`activity:analytics.autoRefresh`)})]})}),(0,_.jsxs)(`div`,{className:`min-w-0 space-y-5`,children:[(0,_.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3`,children:[(0,_.jsx)(C,{icon:(0,_.jsx)(p,{className:`h-4 w-4`}),label:e(`activity:analytics.liveSessions`),value:E.length,color:`text-primary`}),(0,_.jsx)(C,{icon:(0,_.jsx)(d,{className:`h-4 w-4`}),label:e(`activity:analytics.agents`),value:`${B}/${z}`,sub:B>0?e(`activity:analytics.agentsActive`,{count:B}):void 0,color:`text-success`}),(0,_.jsx)(C,{icon:(0,_.jsx)(a,{className:`h-4 w-4`}),label:e(`activity:analytics.totalEvents`),value:t?.totalEvents??0,sub:e(`activity:analytics.categoriesSub`,{count:t?.uniqueCategories??0}),color:`text-warning`}),(0,_.jsx)(C,{icon:(0,_.jsx)(u,{className:`h-4 w-4`}),label:e(`activity:analytics.toolCalls`),value:V,sub:e(`activity:analytics.iterationsSub`,{count:H}),color:`text-success`}),(0,_.jsx)(C,{icon:(0,_.jsx)(c,{className:`h-4 w-4`}),label:e(`activity:analytics.sessionCost`),value:O?b(O.cost):`—`,sub:O?e(`activity:analytics.tokensSub`,{input:y(O.usage.input),output:y(O.usage.output)}):void 0,color:`text-primary`}),(0,_.jsx)(C,{icon:(0,_.jsx)(o,{className:`h-4 w-4`}),label:e(`activity:analytics.sessionDuration`),value:O?v(O.elapsedMs):`—`,sub:O?e(`activity:analytics.messagesSub`,{count:O.messages}):void 0,color:`text-muted-foreground`})]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-4`,children:[(0,_.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,_.jsxs)(`h3`,{className:`mb-3 flex items-center gap-2 text-xs font-semibold uppercase text-muted-foreground`,children:[(0,_.jsx)(s,{className:`h-3.5 w-3.5 text-primary`}),e(`activity:analytics.eventsByCategory`)]}),U.length===0?(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`activity:analytics.noEvents`)}):(0,_.jsx)(`div`,{className:`space-y-1.5`,children:U.map(([e,t])=>{let n=U[0]?.[1]??1,r=Math.round(t/n*100);return(0,_.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,7rem)_minmax(0,1fr)_2.5rem] items-center gap-2 text-xs`,children:[(0,_.jsx)(`span`,{className:`min-w-0 truncate text-foreground`,children:e}),(0,_.jsx)(`div`,{className:`h-4 overflow-hidden rounded-full bg-muted`,children:(0,_.jsx)(`div`,{className:`h-full rounded-full bg-primary/70 transition-all`,style:{width:`${Math.max(r,4)}%`}})}),(0,_.jsx)(`span`,{className:`text-right tabular-nums text-muted-foreground`,children:t})]},e)})})]}),(0,_.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,_.jsxs)(`h3`,{className:`mb-3 flex items-center gap-2 text-xs font-semibold uppercase text-muted-foreground`,children:[(0,_.jsx)(l,{className:`h-3.5 w-3.5 text-warning`}),e(`activity:analytics.topEvents`)]}),W.length===0?(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`activity:analytics.noEvents`)}):(0,_.jsx)(`div`,{className:`space-y-1.5`,children:W.map(([e,t])=>{let n=W[0]?.[1]??1,r=Math.round(t/n*100);return(0,_.jsxs)(`div`,{className:`grid grid-cols-[minmax(0,9rem)_minmax(0,1fr)_2.5rem] items-center gap-2 text-xs`,children:[(0,_.jsx)(`span`,{className:`min-w-0 truncate ${S(e)}`,children:e}),(0,_.jsx)(`div`,{className:`h-4 overflow-hidden rounded-full bg-muted`,children:(0,_.jsx)(`div`,{className:`h-full rounded-full bg-warning/70 transition-all`,style:{width:`${Math.max(r,4)}%`}})}),(0,_.jsx)(`span`,{className:`text-right tabular-nums text-muted-foreground`,children:t})]},e)})})]})]}),(0,_.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-4`,children:[(0,_.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,_.jsxs)(`h3`,{className:`mb-3 flex items-center gap-2 text-xs font-semibold uppercase text-muted-foreground`,children:[(0,_.jsx)(c,{className:`h-3.5 w-3.5 text-primary`}),e(`activity:analytics.activeSessionUsage`)]}),O?(0,_.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 text-xs`,children:[(0,_.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.provider`)}),(0,_.jsx)(`p`,{className:`mt-0.5 truncate font-mono text-foreground`,children:O.provider})]}),(0,_.jsxs)(`div`,{className:`min-w-0 rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.model`)}),(0,_.jsx)(`p`,{className:`mt-0.5 truncate font-mono text-foreground`,children:O.model})]}),(0,_.jsxs)(`div`,{className:`rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.inputTokens`)}),(0,_.jsx)(`p`,{className:`mt-0.5 tabular-nums text-foreground`,children:y(O.usage.input)})]}),(0,_.jsxs)(`div`,{className:`rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.outputTokens`)}),(0,_.jsx)(`p`,{className:`mt-0.5 tabular-nums text-foreground`,children:y(O.usage.output)})]}),(0,_.jsxs)(`div`,{className:`rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.cacheRatio`)}),(0,_.jsxs)(`p`,{className:`mt-0.5 tabular-nums text-foreground`,children:[(O.cache.ratio*100).toFixed(1),`%`]})]}),(0,_.jsxs)(`div`,{className:`rounded-lg border border-border/70 bg-background/50 px-3 py-2`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.filesRead`)}),(0,_.jsx)(`p`,{className:`mt-0.5 tabular-nums text-foreground`,children:O.readFiles})]})]}):(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`activity:analytics.noSession`)})]}),(0,_.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,_.jsxs)(`h3`,{className:`mb-3 flex items-center gap-2 text-xs font-semibold uppercase text-muted-foreground`,children:[(0,_.jsx)(i,{className:`h-3.5 w-3.5 text-warning`}),e(`activity:analytics.healthErrors`)]}),(0,_.jsx)(`div`,{className:`space-y-2 text-xs`,children:t?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(`div`,{className:`flex justify-between`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.errorEvents`)}),(0,_.jsx)(`span`,{className:`tabular-nums text-destructive`,children:G})]}),(0,_.jsxs)(`div`,{className:`flex justify-between`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.warningEvents`)}),(0,_.jsx)(`span`,{className:`tabular-nums text-warning`,children:K})]}),(0,_.jsxs)(`div`,{className:`flex justify-between`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.cacheHitRate`)}),(0,_.jsx)(`span`,{className:`tabular-nums text-success`,children:O?`${(O.cache.ratio*100).toFixed(1)}%`:`—`})]}),(0,_.jsxs)(`div`,{className:`flex justify-between`,children:[(0,_.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:analytics.totalCategories`)}),(0,_.jsx)(`span`,{className:`tabular-nums text-foreground`,children:t.uniqueCategories})]})]}):(0,_.jsx)(`p`,{className:`text-muted-foreground`,children:e(`activity:analytics.waitingData`)})})]})]}),(0,_.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,_.jsxs)(`h3`,{className:`mb-3 flex items-center gap-2 text-xs font-semibold uppercase text-muted-foreground`,children:[(0,_.jsx)(p,{className:`h-3.5 w-3.5 text-primary`}),e(`activity:analytics.recentEvents`)]}),w.length===0?(0,_.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`activity:analytics.noRecentEvents`)}):(0,_.jsx)(`div`,{className:`max-h-64 space-y-1 overflow-y-auto`,children:q.map((e,t)=>(0,_.jsxs)(`div`,{className:`grid grid-cols-[4rem_minmax(0,7rem)_minmax(0,6rem)_minmax(0,1fr)] items-start gap-2 rounded px-2 py-1 text-xs hover:bg-muted/60`,children:[(0,_.jsx)(`span`,{className:`tabular-nums text-muted-foreground/70`,children:x(e.timestamp)}),(0,_.jsx)(`span`,{className:`min-w-0 truncate ${S(e.event)}`,children:e.event}),(0,_.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:e.category}),(0,_.jsx)(`span`,{className:`min-w-0 truncate text-foreground/80`,children:e.label??e.sessionId??``})]},`${e.timestamp}-${t}`))})]})]})]})})}export{w as AnalyticsDashboard};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./chat-store-CQq9AeA9.js";import{m as n,p as r}from"./markdown-BRAejDWd.js";import{Gt as i,It as a,Jr as o,Kt as s,Lt as c,Wr as l,X as u,Xt as d,Yr as f,Z as p,bt as m,ct as h,di as g,gr as _,oi as v,ot as y,pr as b,ri as x,vi as S,xi as C}from"./vendor-B51hXwIj.js";import"./i18n-CLLrYq46.js";import{t as w}from"./utils-C9L1kxOy.js";import{L as T,O as E,V as D,a as ee,i as O,o as k,rt as A,y as j,z as M}from"./index-BwLKTDt1.js";var N=e(n(),1),P=r(),F={pending:{icon:(0,P.jsx)(_,{className:`w-4 h-4`}),color:`text-muted-foreground`,label:`Pending`},in_progress:{icon:(0,P.jsx)(b,{className:`w-4 h-4 animate-spin`}),color:`text-primary`,label:`In Progress`},blocked:{icon:(0,P.jsx)(d,{className:`w-4 h-4`}),color:`text-warning`,label:`Blocked`},failed:{icon:(0,P.jsx)(v,{className:`w-4 h-4`}),color:`text-destructive`,label:`Failed`},review:{icon:(0,P.jsx)(a,{className:`w-4 h-4`}),color:`text-info`,label:`Review`},completed:{icon:(0,P.jsx)(g,{className:`w-4 h-4`}),color:`text-success`,label:`Done`}},I={critical:`bg-destructive/15 text-destructive`,high:`bg-warning/15 text-warning`,medium:`bg-info/15 text-info`,low:`bg-muted text-muted-foreground`},L={feature:`bg-success/15 text-success`,bugfix:`bg-destructive/15 text-destructive`,refactor:`bg-primary/15 text-primary`,docs:`bg-info/15 text-info`,test:`bg-primary/15 text-primary`,chore:`bg-muted text-muted-foreground`};function R(e){if(!e)return``;let t=Math.floor(e/6e4);if(t<60)return`${t}m`;let n=Math.floor(t/60),r=t%60;return r>0?`${n}h ${r}m`:`${n}h`}function z({task:e,onStatusChange:t,onRetry:n,agents:r,onAssign:i,compact:o,className:s}){let{t:c}=S(),l=F[e.status],[u,d]=(0,N.useState)(!1),f=e.status===`in_progress`;return(0,P.jsxs)(`div`,{className:w(`w-full text-left rounded-lg border p-3 transition-all hover:shadow-sm`,f?`border-primary/40 bg-primary/5`:e.status===`completed`?`border-success/35 bg-success/6`:e.status===`failed`?`border-destructive/40 bg-destructive/5`:`border-border bg-card`,s),children:[(0,P.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,P.jsx)(`span`,{className:w(`mt-0.5`,l.color),role:`img`,"aria-label":f?c(`common:status.inProgress`):void 0,children:l.icon}),(0,P.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,P.jsx)(`span`,{className:`text-sm font-medium`,children:e.title}),(0,P.jsx)(`span`,{className:w(`px-1.5 py-0.5 rounded text-[10px] font-medium`,I[e.priority]),children:e.priority}),(0,P.jsx)(`span`,{className:w(`px-1.5 py-0.5 rounded text-[10px] font-medium`,L[e.type]),children:e.type})]}),e.description&&(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 line-clamp-2`,children:e.description})]})]}),e.assignee&&(0,P.jsxs)(`div`,{className:w(`mt-2 inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-medium`,f?`bg-primary/15 text-primary`:`bg-muted text-muted-foreground`),children:[f&&(0,P.jsx)(b,{className:`w-3 h-3 animate-spin`,"aria-label":c(`common:status.working`)}),(0,P.jsx)(`span`,{children:e.assignee})]}),(0,P.jsxs)(`div`,{className:`flex items-center gap-3 mt-2 text-xs text-muted-foreground`,children:[e.estimateHours?(0,P.jsxs)(`span`,{children:[`~`,e.estimateHours,`h`]}):null,e.actualHours?(0,P.jsxs)(`span`,{children:[`• `,e.actualHours,`h`]}):null,e.startedAt?(0,P.jsxs)(`span`,{children:[`• `,R(Date.now()-e.startedAt)]}):null]}),e.tags.length>0&&(0,P.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-2`,children:e.tags.map(e=>(0,P.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-[10px] bg-muted text-muted-foreground`,children:e},e))}),!o&&(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 mt-2`,children:[t&&e.status!==`in_progress`&&e.status!==`completed`&&(0,P.jsx)(`button`,{type:`button`,onClick:()=>t(e.id,`in_progress`),className:`px-2 py-0.5 text-[10px] rounded bg-primary/15 text-primary hover:bg-primary/25 transition-colors`,children:c(`activity:task.start`)}),t&&e.status===`in_progress`&&(0,P.jsx)(`button`,{type:`button`,onClick:()=>t(e.id,`completed`),className:`px-2 py-0.5 text-[10px] rounded bg-success/15 text-success hover:bg-success/25 transition-colors`,children:c(`activity:task.complete`)}),n&&(e.status===`failed`||e.status===`completed`)&&(0,P.jsxs)(`button`,{type:`button`,onClick:()=>n(e.id),className:`px-2 py-0.5 text-[10px] rounded bg-muted text-muted-foreground hover:bg-muted/70 transition-colors inline-flex items-center gap-1`,children:[(0,P.jsx)(a,{className:`w-3 h-3`}),` `,c(`activity:task.retry`)]}),i&&r&&r.length>0&&(u?(0,P.jsxs)(`select`,{defaultValue:e.assignee??``,onChange:t=>{i(e.id,t.target.value),d(!1)},onBlur:()=>d(!1),className:`px-1 py-0.5 text-[10px] rounded border border-border bg-card`,children:[(0,P.jsx)(`option`,{value:``,children:c(`activity:task.unassigned`)}),r.map(e=>(0,P.jsx)(`option`,{value:e,children:e},e))]}):(0,P.jsxs)(`button`,{type:`button`,onClick:()=>d(!0),className:`px-2 py-0.5 text-[10px] rounded bg-muted text-muted-foreground hover:bg-muted/70 transition-colors inline-flex items-center gap-1`,title:c(`activity:task.assignTitle`),children:[(0,P.jsx)(y,{className:`w-3 h-3`}),` `,c(`activity:task.assign`)]}))]})]})}var B=[{key:`pending`,label:`Pending`,match:[`pending`,`blocked`]},{key:`in_progress`,label:`In Progress`,match:[`in_progress`]},{key:`review`,label:`Review`,match:[`review`]},{key:`failed`,label:`Failed`,match:[`failed`]},{key:`completed`,label:`Done`,match:[`completed`]}],V={pending:`bg-muted text-muted-foreground`,ready:`bg-info/15 text-info`,running:`bg-primary/15 text-primary`,paused:`bg-warning/15 text-warning`,completed:`bg-success/15 text-success`,failed:`bg-destructive/15 text-destructive`,skipped:`bg-muted text-muted-foreground`};function H(){let{client:e}=T(),{t}=S(),n=A(e=>e.phases),[r,a]=(0,N.useState)(`phase`),[o,s]=(0,N.useState)(null),[c,u]=(0,N.useState)(null),d=(0,N.useMemo)(()=>n.flatMap(e=>(e.tasks??[]).map(t=>({...t,phaseId:e.id}))),[n]),f=(0,N.useMemo)(()=>[...new Set(d.map(e=>e.assignee).filter(e=>!!e))],[d]),p=(0,N.useCallback)(t=>e?.send?.(t),[e]),m=(0,N.useCallback)((e,t)=>p({type:`autophase.taskStatus`,payload:{taskId:e,status:t}}),[p]),h=(0,N.useCallback)(e=>p({type:`autophase.retryTask`,payload:{taskId:e}}),[p]),g=(0,N.useCallback)((e,t)=>p({type:`autophase.assignTask`,payload:{taskId:e,agentName:t||void 0}}),[p]),_=(0,N.useCallback)(e=>{j({title:t(`activity:board.newTaskTitle`),placeholder:t(`activity:board.newTaskPlaceholder`),confirmLabel:t(`activity:board.addTask`)}).then(t=>{t&&p({type:`autophase.addTask`,payload:{phaseId:e,title:t}})})},[p]),v=(0,N.useCallback)(e=>{o&&p({type:`autophase.moveTask`,payload:{taskId:o,toPhaseId:e}}),s(null),u(null)},[o,p]),y=(0,N.useCallback)(e=>{o&&p({type:`autophase.taskStatus`,payload:{taskId:o,status:e}}),s(null),u(null)},[o,p]),b={onStatusChange:m,onRetry:h,agents:f,onAssign:g};function C(e){return{draggable:!0,onDragStart:t=>{s(e),t.dataTransfer.effectAllowed=`move`},onDragEnd:()=>{s(null),u(null)}}}function E(e,t){return{onDragOver:t=>{t.preventDefault(),t.dataTransfer.dropEffect=`move`,c!==e&&u(e)},onDragLeave:()=>u(t=>t===e?null:t),onDrop:e=>{e.preventDefault(),t()},"data-hover":c===e||void 0}}return n.length===0?(0,P.jsx)(`div`,{className:`flex h-full min-h-0 min-w-0 items-center justify-center text-muted-foreground`,children:(0,P.jsx)(`p`,{className:`text-sm`,children:t(`activity:board.empty`)})}):(0,P.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-4 py-2`,children:[(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t(`activity:board.summary`,{phases:n.length,tasks:d.length})}),(0,P.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-border p-0.5`,children:[(0,P.jsxs)(`button`,{type:`button`,onClick:()=>a(`phase`),className:w(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors`,r===`phase`?`bg-primary/15 text-primary`:`text-muted-foreground hover:text-foreground`),children:[(0,P.jsx)(x,{className:`h-3.5 w-3.5`}),` `,t(`activity:board.phases`)]}),(0,P.jsxs)(`button`,{type:`button`,onClick:()=>a(`status`),className:w(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs transition-colors`,r===`status`?`bg-primary/15 text-primary`:`text-muted-foreground hover:text-foreground`),children:[(0,P.jsx)(l,{className:`h-3.5 w-3.5`}),` `,t(`activity:board.statusTab`)]})]})]}),r===`phase`?(0,P.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 gap-3 overflow-x-auto p-3`,children:n.map(e=>{let n=d.filter(t=>t.phaseId===e.id);return(0,P.jsxs)(`div`,{...E(`phase:${e.id}`,()=>v(e.id)),className:w(`flex min-h-0 w-80 shrink-0 flex-col rounded-lg border bg-muted/30 transition-colors`,c===`phase:${e.id}`?`border-primary/60 bg-primary/5`:`border-border`),children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-2`,children:[(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,P.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:e.name}),(0,P.jsx)(`span`,{className:w(`rounded px-1.5 py-0.5 text-[10px] font-medium capitalize`,V[e.status]),children:e.status})]}),(0,P.jsxs)(`span`,{className:`text-[11px] text-muted-foreground`,children:[e.completedTasks,`/`,e.taskCount,` · `,e.progressPercent,`%`]})]}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>_(e.id),title:t(`activity:board.addTask`),className:`rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,P.jsx)(i,{className:`h-4 w-4`})})]}),(0,P.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto p-2`,children:n.length===0?(0,P.jsx)(`p`,{className:`px-1 py-4 text-center text-[11px] text-muted-foreground`,children:t(`activity:board.dropHere`)}):n.map(e=>(0,P.jsx)(`div`,{...C(e.id),className:w(o===e.id&&`opacity-50`),children:(0,P.jsx)(z,{task:e,...b})},e.id))})]},e.id)})}):(0,P.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-auto p-3`,children:(0,P.jsxs)(`div`,{className:`grid min-w-[900px] gap-2`,style:{gridTemplateColumns:`9rem repeat(${B.length}, minmax(0, 1fr))`},children:[(0,P.jsx)(`div`,{}),B.map(e=>(0,P.jsx)(`div`,{className:`px-2 pb-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:t(`activity:board.status.${e.key}`)},e.key)),n.map(e=>(0,P.jsxs)(U,{children:[(0,P.jsx)(`div`,{className:`flex items-center pr-2`,children:(0,P.jsxs)(`div`,{className:`min-w-0`,children:[(0,P.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e.name}),(0,P.jsx)(`span`,{className:w(`mt-0.5 inline-block rounded px-1.5 py-0.5 text-[10px] capitalize`,V[e.status]),children:e.status})]})}),B.map(t=>{let n=d.filter(n=>n.phaseId===e.id&&t.match.includes(n.status)),r=`cell:${e.id}:${t.key}`;return(0,P.jsx)(`div`,{...E(r,()=>y(t.key)),className:w(`min-h-[4rem] space-y-2 rounded-md border p-1.5 transition-colors`,c===r?`border-primary/60 bg-primary/5`:`border-border bg-muted/20`),children:n.map(e=>(0,P.jsx)(`div`,{...C(e.id),className:w(o===e.id&&`opacity-50`),children:(0,P.jsx)(z,{task:e,compact:!0,...b})},e.id))},t.key)})]},e.id))]})})]})}function U({children:e}){return(0,P.jsx)(P.Fragment,{children:e})}function W({onClose:e}){let{client:n}=T(),{t:r}=S(),a=A(e=>e.phases),l=A(e=>e.overallPercent),g=A(e=>e.autonomous),_=A(e=>e.title),v=A(e=>e.goal),y=A(e=>e.status),b=A(e=>e.lastError),x=A(e=>e.graphs);(0,N.useEffect)(()=>{n?.send?.({type:`autophase.list`}),n?.send?.({type:`autophase.state`})},[n]);let j=D(e=>e.worktrees),F=D(e=>e.baseBranch),[I,L]=(0,N.useState)(``),[R,z]=(0,N.useState)(null),[B,V]=(0,N.useState)(!1),[U,W]=(0,N.useState)(!0),G=a.length>0,K=R!=null&&!G;(0,N.useEffect)(()=>{G&&z(null)},[G]);let q=(0,N.useCallback)(()=>{let e=I.trim();if(!e||R!=null)return;let r=t.getState();r.addMessage({role:`user`,content:e}),r.addMessage({role:`assistant`,content:C.t(`activity:autoPhase.planningAck`)}),z(e),L(``),n?.send?.({type:`autophase.start`,payload:{title:e,autonomous:!0,worktrees:U}}),M(`chat`)},[I,R,n,U]),J=(0,N.useCallback)(()=>{n?.send?.({type:`autophase.stop`,payload:{}}),z(null)},[n]),Y=(0,N.useCallback)(()=>{n?.send?.({type:`autophase.toggleAutonomous`,payload:{}})},[n]),X=(0,N.useCallback)(()=>{n?.send?.(y===`paused`?{type:`autophase.resume`,payload:{}}:{type:`autophase.pause`,payload:{}})},[n,y]),Z=(0,N.useCallback)(()=>{n?.send?.({type:`autophase.stop`,payload:{}})},[n]),Q=(0,N.useCallback)(()=>{n?.send?.({type:`autophase.clear`,payload:{}}),A.getState().clear(),z(null),L(``)},[n]),[te,$]=(0,N.useState)(!1),ne=(0,N.useCallback)(()=>{n?.send?.({type:`autophase.revert`,payload:{}}),$(!1)},[n]),re=y===`running`||y===`paused`,ie=y===`stopped`||y===`completed`||y===`failed`,ae=(0,N.useCallback)(e=>{e&&n?.send?.({type:`autophase.load`,payload:{graphId:e}})},[n]);return(0,P.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,P.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-2 border-b bg-card px-4 py-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,P.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,P.jsx)(f,{className:`h-5 w-5 text-muted-foreground`}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`h1`,{className:`text-lg font-semibold`,children:G&&_||`AutoPhase`}),G&&(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r(`activity:autoPhase.summary`,{count:a.length,pct:l})})]}),G&&(0,P.jsx)(`span`,{className:w(`rounded border px-2 py-0.5 text-[11px] font-medium capitalize`,y===`failed`?`border-destructive/40 bg-destructive/10 text-destructive`:y===`paused`||y===`stopped`?`border-warning/40 bg-warning/10 text-warning`:y===`completed`?`border-success/40 bg-success/10 text-success`:`border-primary/30 bg-primary/10 text-primary`),title:b??void 0,children:y})]}),(0,P.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 sm:justify-end`,children:[x.length>0&&(0,P.jsxs)(`select`,{value:G?x.find(e=>e.title===_)?.id??``:``,onChange:e=>ae(e.target.value),title:r(`activity:autoPhase.switchBoard`),className:`min-w-0 flex-1 rounded border border-border bg-card px-2 py-1 text-xs text-foreground sm:w-72 sm:flex-none`,children:[(0,P.jsx)(`option`,{value:``,disabled:!0,children:r(`activity:autoPhase.boardsCount`,{count:x.length})}),x.map(e=>(0,P.jsxs)(`option`,{value:e.id,children:[e.title,` · `,e.status]},e.id))]}),G&&(0,P.jsxs)(`button`,{type:`button`,onClick:Y,title:r(`activity:autoPhase.toggleAutonomousTitle`),className:w(`inline-flex items-center gap-1 rounded border px-2 py-1 text-xs transition-colors`,g?`border-primary/30 bg-primary/10 text-primary`:`border-border text-muted-foreground hover:text-foreground`),children:[(0,P.jsx)(p,{className:`h-3.5 w-3.5`}),` `,r(g?`activity:autoPhase.autonomous`:`activity:autoPhase.manual`)]}),re&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{type:`button`,onClick:X,title:r(y===`paused`?`activity:autoPhase.resumeTitle`:`activity:autoPhase.pauseTitle`),className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[y===`paused`?(0,P.jsx)(s,{className:`h-3.5 w-3.5`}):(0,P.jsx)(d,{className:`h-3.5 w-3.5`}),r(y===`paused`?`activity:autoPhase.resume`:`activity:autoPhase.pause`)]}),(0,P.jsxs)(`button`,{type:`button`,onClick:Z,title:r(`activity:autoPhase.stopTitle`),className:`inline-flex items-center gap-1 rounded border border-destructive/40 bg-destructive/10 px-2 py-1 text-xs font-medium text-destructive transition-colors hover:bg-destructive/20`,children:[(0,P.jsx)(m,{className:`h-3.5 w-3.5 fill-current`}),` `,r(`activity:autoPhase.stop`)]})]}),G&&ie&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`button`,{type:`button`,onClick:Q,title:r(`activity:autoPhase.newTitle`),className:`inline-flex items-center gap-1 rounded border border-primary/30 bg-primary/10 px-2 py-1 text-xs font-medium text-primary transition-colors hover:bg-primary/20`,children:[(0,P.jsx)(i,{className:`h-3.5 w-3.5`}),` `,r(`activity:autoPhase.newLabel`)]}),te?(0,P.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded border border-warning/40 bg-warning/10 px-1.5 py-0.5 text-xs`,children:[(0,P.jsx)(`span`,{className:`text-warning`,children:r(`activity:autoPhase.revertConfirm`)}),(0,P.jsx)(`button`,{type:`button`,onClick:ne,className:`rounded bg-destructive/15 px-1.5 py-0.5 font-medium text-destructive hover:bg-destructive/25`,children:r(`common:action.yes`)}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>$(!1),className:`rounded px-1.5 py-0.5 text-muted-foreground hover:text-foreground`,children:r(`common:action.no`)})]}):(0,P.jsxs)(`button`,{type:`button`,onClick:()=>$(!0),title:r(`activity:autoPhase.revertTitle`),className:`inline-flex items-center gap-1 rounded border border-border px-2 py-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,children:[(0,P.jsx)(h,{className:`h-3.5 w-3.5`}),` `,r(`activity:autoPhase.revert`)]})]}),(0,P.jsx)(E,{variant:`ghost`,size:`icon`,onClick:e,children:(0,P.jsx)(u,{className:`h-4 w-4`})})]})]}),G&&v&&(0,P.jsxs)(`div`,{className:`shrink-0 border-b border-border/60 bg-muted/20 px-4 py-2.5`,children:[(0,P.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,P.jsx)(c,{className:`h-3 w-3`}),` `,r(`activity:autoPhase.goal`)]}),(0,P.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:v})]}),G?(0,P.jsx)(`div`,{className:`flex min-h-0 flex-1`,children:(0,P.jsx)(H,{})}):K?(0,P.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-8`,children:(0,P.jsxs)(`div`,{className:`max-w-lg w-full space-y-5 text-center`,children:[(0,P.jsx)(o,{className:`h-10 w-10 mx-auto animate-spin text-primary/70`}),(0,P.jsxs)(`div`,{className:`space-y-1`,children:[(0,P.jsx)(`h2`,{className:`text-xl font-semibold`,children:r(`activity:autoPhase.planning`)}),(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r(`activity:autoPhase.planningBody`)})]}),(0,P.jsxs)(`div`,{className:`rounded-lg border border-border bg-card px-4 py-3 text-left`,children:[(0,P.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,P.jsx)(c,{className:`h-3 w-3`}),` `,r(`activity:autoPhase.goal`)]}),(0,P.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:R})]}),(0,P.jsxs)(E,{variant:`outline`,onClick:J,className:`gap-2`,children:[(0,P.jsx)(m,{className:`h-4 w-4 fill-current`}),` `,r(`common:action.cancel`)]})]})}):(0,P.jsx)(`div`,{className:`flex-1 flex items-center justify-center p-8`,children:(0,P.jsxs)(`div`,{className:`max-w-lg w-full space-y-6`,children:[(0,P.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,P.jsx)(c,{className:`h-10 w-10 mx-auto text-primary/60`}),(0,P.jsx)(`h2`,{className:`text-xl font-semibold`,children:r(`activity:autoPhase.startHeading`)}),(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r(`activity:autoPhase.startBody`)})]}),(0,P.jsx)(`textarea`,{value:I,onChange:e=>L(e.target.value),placeholder:r(`activity:autoPhase.startPlaceholder`),rows:5,className:`w-full rounded-lg border border-border bg-card px-4 py-3 text-sm resize-none focus:outline-none focus:ring-2 focus:ring-primary/30 placeholder:text-muted-foreground/70`,onKeyDown:e=>{e.key===`Enter`&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),q())}}),(0,P.jsxs)(`label`,{className:`flex cursor-pointer items-center justify-center gap-2 text-xs text-muted-foreground`,children:[(0,P.jsx)(`input`,{type:`checkbox`,checked:U,onChange:e=>W(e.target.checked),className:`h-3.5 w-3.5 accent-primary`}),r(`activity:autoPhase.isolateLabel`)]}),(0,P.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,P.jsxs)(E,{onClick:q,disabled:!I.trim(),className:`flex-1 gap-2`,children:[(0,P.jsx)(s,{className:`h-4 w-4`}),r(`activity:autoPhase.startButton`)]})}),(0,P.jsxs)(`p`,{className:`text-xs text-muted-foreground text-center`,children:[r(`activity:autoPhase.ctrlHint`),` ·`,` `,r(U?`activity:autoPhase.isolateOn`:`activity:autoPhase.isolateOff`)]})]})}),j.length>0&&(0,P.jsxs)(`div`,{className:`border-t bg-card/50 shrink-0`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-4 pt-2 text-xs`,children:[(0,P.jsx)(`button`,{type:`button`,onClick:()=>V(!1),className:w(`rounded px-2 py-0.5 border transition-colors`,B?`border-border text-muted-foreground hover:text-foreground`:`bg-primary/10 border-primary/30 text-primary`),children:r(`activity:autoPhase.lanes`)}),(0,P.jsx)(`button`,{type:`button`,onClick:()=>V(!0),className:w(`rounded px-2 py-0.5 border transition-colors`,B?`bg-primary/10 border-primary/30 text-primary`:`border-border text-muted-foreground hover:text-foreground`),children:r(`activity:autoPhase.graph`)})]}),(0,P.jsxs)(`div`,{className:`space-y-2 px-4 pb-3`,children:[(0,P.jsx)(O,{}),B?(0,P.jsx)(k,{worktrees:j,baseBranch:F}):(0,P.jsx)(ee,{worktrees:j,baseBranch:F})]})]})]})}export{W as AutoPhaseView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-BRAejDWd.js";import{$n as r,Bt as i,Jr as a,Pt as o,Wr as s,ii as c,vi as l,wr as u}from"./vendor-B51hXwIj.js";import"./i18n-CLLrYq46.js";import{i as d,r as f,s as p,t as m}from"./monaco-MjnRih9i.js";import{t as h}from"./ws-client-Bbu1u6TM.js";import{t as g}from"./utils-C9L1kxOy.js";import{E as _,Z as v,nt as y}from"./index-BwLKTDt1.js";import{t as b}from"./monaco-theme-DhdHiZEb.js";var x=e(t(),1),S=n();d.config({monaco:m});var C={ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,json:`json`,css:`css`,scss:`scss`,html:`html`,md:`markdown`,py:`python`,go:`go`,rs:`rust`,java:`java`,c:`c`,cpp:`cpp`,cs:`csharp`,rb:`ruby`,php:`php`,sh:`shell`,bash:`shell`,yml:`yaml`,yaml:`yaml`,toml:`toml`,sql:`sql`};function w(e){return C[e.split(`.`).pop()?.toLowerCase()??``]??`plaintext`}function T({path:e,oldText:t,newText:n}){let{t:r}=l(),i=(0,x.useRef)(null),[s,c]=(0,x.useState)(!1),[d,m]=(0,x.useState)(!1),[g,_]=(0,x.useState)(null);(0,x.useEffect)(()=>{c(!1),m(!1),_(null)},[]);let v=(0,x.useCallback)(e=>{i.current=e,p.setTheme(b()),e.getModifiedEditor().onDidChangeModelContent(()=>c(!0))},[]),C=(0,x.useCallback)(()=>{let t=i.current?.getModifiedEditor().getValue();if(t==null)return;m(!0);let n=h(y.getState().wsUrl),r=n.on(`files.written`,t=>{t.type===`files.written`&&t.payload.filePath===e&&(r(),clearTimeout(a),m(!1),t.payload.success&&(c(!1),_(Date.now())))}),a=setTimeout(()=>{r(),m(!1)},5e3);n.send({type:`files.write`,payload:{filePath:e,content:t}})},[e]),T=w(e);return(0,S.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden`,children:[(0,S.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-2 px-2 py-1.5 border-b border-border/40`,children:[(0,S.jsx)(`span`,{className:`text-xs font-mono text-muted-foreground truncate`,children:e}),(0,S.jsxs)(`button`,{type:`button`,onClick:C,disabled:!s||d,className:`inline-flex items-center gap-1.5 h-7 px-2.5 rounded-md border border-border text-xs font-medium disabled:opacity-40 enabled:hover:bg-muted transition-colors`,title:r(`activity:monacoDiff.applyTitle`),children:[d?(0,S.jsx)(a,{className:`h-3.5 w-3.5 animate-spin`}):g&&!s?(0,S.jsx)(u,{className:`h-3.5 w-3.5 text-success`}):(0,S.jsx)(o,{className:`h-3.5 w-3.5`}),r(d?`activity:monacoDiff.applying`:g&&!s?`activity:monacoDiff.applied`:`activity:monacoDiff.apply`)]})]}),(0,S.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-hidden`,children:(0,S.jsx)(f,{original:t,modified:n,language:T,theme:b(),onMount:v,options:{renderSideBySide:!0,readOnly:!1,originalEditable:!1,minimap:{enabled:!1},fontSize:13,scrollBeyondLastLine:!1,automaticLayout:!0}})})]})}var E=1e4;function D({className:e}){let{t}=l(),n=v(e=>e.selectedPath),o=v(e=>e.diff),u=v(e=>e.loadingDiff),[d,f]=(0,x.useState)(`unified`),[p,m]=(0,x.useState)(!1),b=!!n&&(u||!o);(0,x.useEffect)(()=>{if(m(!1),!b)return;let e=setTimeout(()=>m(!0),E);return()=>clearTimeout(e)},[b,n]);let C=()=>{n&&(m(!1),v.getState().setDiffLoading(!0),h(y.getState().wsUrl).getGitDiff?.(n))};if(!n)return(0,S.jsx)(`div`,{className:g(`flex min-h-0 min-w-0 flex-1 items-center justify-center bg-[hsl(var(--surface-2)/0.45)] p-4`,e),children:(0,S.jsxs)(`div`,{className:`ws-surface flex max-w-md flex-col items-center gap-3 rounded-xl p-6 text-center text-muted-foreground`,children:[(0,S.jsx)(`span`,{className:`flex h-12 w-12 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,S.jsx)(r,{className:`h-6 w-6`})}),(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`h2`,{className:`text-base font-semibold text-foreground`,children:`Source changes`}),(0,S.jsx)(`p`,{className:`mt-1 text-sm`,children:t(`activity:changes.selectPrompt`)})]})]})});let w=o&&!o.error&&!o.binary&&!o.tooLarge;return(0,S.jsx)(`div`,{className:g(`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-[hsl(var(--surface-2)/0.45)] p-3`,e),children:(0,S.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-border/70 bg-card/75 shadow-sm`,children:[(0,S.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-2 border-b border-border/70 px-3 py-2`,children:[(0,S.jsxs)(`div`,{className:`min-w-0`,children:[(0,S.jsx)(`div`,{className:`text-[10px] font-semibold uppercase text-muted-foreground`,children:`Source control`}),(0,S.jsx)(`div`,{className:`truncate font-mono text-xs text-foreground`,title:n,children:n})]}),w&&(0,S.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>f(`unified`),title:t(`activity:changes.unifiedTitle`),className:g(`inline-flex h-8 items-center gap-1 rounded-md border px-2 text-xs transition-colors`,d===`unified`?`border-primary/40 bg-primary/10 text-primary`:`border-border text-muted-foreground hover:bg-muted`),children:[(0,S.jsx)(s,{className:`h-3.5 w-3.5`}),` `,t(`activity:changes.unified`)]}),(0,S.jsxs)(`button`,{type:`button`,onClick:()=>f(`edit`),title:t(`activity:changes.editTitle`),className:g(`inline-flex h-8 items-center gap-1 rounded-md border px-2 text-xs transition-colors`,d===`edit`?`border-primary/40 bg-primary/10 text-primary`:`border-border text-muted-foreground hover:bg-muted`),children:[(0,S.jsx)(c,{className:`h-3.5 w-3.5`}),` `,t(`activity:changes.edit`)]})]})]}),(0,S.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:u||!o?p?(0,S.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col items-center justify-center gap-3 p-4 text-center`,children:[(0,S.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`activity:changes.diffTimeout`)}),(0,S.jsxs)(`button`,{type:`button`,onClick:C,className:`inline-flex h-8 items-center gap-1.5 rounded-md border border-border px-3 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground`,children:[(0,S.jsx)(i,{className:`h-3.5 w-3.5`}),` `,t(`common:action.retry`)]})]}):(0,S.jsxs)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,S.jsx)(a,{className:`h-4 w-4 animate-spin`}),` `,t(`activity:changes.loadingDiff`)]}):o.error?(0,S.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-sm text-destructive`,children:o.error}):o.binary?(0,S.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-sm text-muted-foreground`,children:t(`activity:changes.binary`)}):o.tooLarge?(0,S.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center text-sm text-muted-foreground`,children:t(`activity:changes.tooLarge`)}):d===`edit`?(0,S.jsx)(T,{path:o.path,oldText:o.oldText??``,newText:o.newText??``},o.path):(0,S.jsx)(_,{oldText:o.oldText,newText:o.newText,caption:o.path,fill:!0})})]})})}export{D as ChangesView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-BRAejDWd.js";import{X as r,Xn as i,gr as a,jt as o,vi as s}from"./vendor-B51hXwIj.js";import"./i18n-CLLrYq46.js";import{a as c,c as l,i as u,n as d,o as f,s as p,t as m}from"./monaco-MjnRih9i.js";import{t as h}from"./ws-client-Bbu1u6TM.js";import{t as g}from"./utils-C9L1kxOy.js";import{I as _,et as v,nt as y,tt as b,z as x}from"./index-BwLKTDt1.js";import{t as S}from"./monaco-theme-DhdHiZEb.js";var C={ts:`typescript`,tsx:`typescript`,js:`javascript`,jsx:`javascript`,json:`json`,css:`css`,html:`html`,svg:`xml`,md:`markdown`,yml:`yaml`,yaml:`yaml`,toml:`toml`,sh:`shell`,bash:`shell`,ps1:`powershell`,py:`python`,rs:`rust`,go:`go`,rb:`ruby`,java:`java`,c:`c`,cpp:`cpp`,h:`c`,hpp:`cpp`,sql:`sql`,xml:`xml`},w=Array.from(new Set(Object.values(C))).filter(e=>e!==`plaintext`),T=12e3,E=4e3,D=5e3,O=1e4;function k(e){return C[e.split(`.`).pop()?.toLowerCase()??``]??`plaintext`}function A(e){return e.match(/([A-Za-z_$][\w$]*)$/)?.[1]??``}function j(e,t){return e.triggerCharacter?!0:t.length>=3}function M(e,t){return e.triggerCharacter===`.`?!0:e.triggerCharacter?!1:/^(findBy|findAllBy|create|update|delete|remove|get[A-Z_]|set[A-Z_]|use[A-Z_])/.test(t)}function N(e){return[e.filePath,e.language,e.lineNumber,e.column,e.versionId??``,e.triggerCharacter??``,e.linePrefix.slice(-160),e.suffix.slice(0,160)].join(`\0`)}var P=e(t(),1),F=n();u.config({monaco:m});function I(e){switch(e){case`method`:return l.CompletionItemKind.Method;case`function`:return l.CompletionItemKind.Function;case`constructor`:return l.CompletionItemKind.Constructor;case`field`:return l.CompletionItemKind.Field;case`variable`:return l.CompletionItemKind.Variable;case`class`:return l.CompletionItemKind.Class;case`interface`:return l.CompletionItemKind.Interface;case`module`:return l.CompletionItemKind.Module;case`property`:return l.CompletionItemKind.Property;case`unit`:return l.CompletionItemKind.Unit;case`value`:return l.CompletionItemKind.Value;case`enum`:return l.CompletionItemKind.Enum;case`keyword`:return l.CompletionItemKind.Keyword;case`snippet`:return l.CompletionItemKind.Snippet;case`file`:return l.CompletionItemKind.File;case`reference`:return l.CompletionItemKind.Reference;default:return l.CompletionItemKind.Text}}function L(){let e=v(e=>e.openFiles),t=v(e=>e.activeFilePath),n=v(e=>e.setActiveFile),i=v(e=>e.closeFile);return e.length===0?null:(0,F.jsx)(`div`,{className:`flex items-center border-b bg-muted/40 overflow-x-auto shrink-0`,children:e.map(e=>{let o=e.path===t,s=e.path.split(`/`).pop()??e.path;return(0,F.jsxs)(`button`,{type:`button`,onClick:()=>n(e.path),onMouseDown:t=>{t.button===1&&(t.preventDefault(),i(e.path))},className:g(`group flex items-center gap-1.5 px-3 py-1.5 text-[11px] border-r whitespace-nowrap min-w-0 max-w-[180px] transition-colors`,o?`bg-background border-t-2 border-t-primary text-foreground -mb-px`:`text-muted-foreground hover:bg-muted/60 hover:text-foreground`),title:e.path,children:[e.dirty&&(0,F.jsx)(a,{className:`h-2 w-2 fill-current text-primary shrink-0`}),(0,F.jsx)(`span`,{className:`truncate`,children:s}),(0,F.jsx)(r,{className:g(`h-3 w-3 shrink-0 rounded-sm hover:bg-muted-foreground/20 opacity-0 group-hover:opacity-100 transition-opacity`,o&&`opacity-100`),onClick:t=>{t.stopPropagation(),i(e.path)}})]},e.path)})})}function R(){let{t:e}=s(),t=v(e=>e.openFiles),n=v(e=>e.activeFilePath),r=v(e=>e.updateContent),{theme:a}=_(),u=(0,P.useRef)(null),m=(0,P.useRef)(n),g=(0,P.useRef)(new Map),C=(0,P.useMemo)(()=>t.find(e=>e.path===n)??null,[t,n]),R=n?k(n):`plaintext`,z=S(),[B,V]=(0,P.useState)(!1);(0,P.useEffect)(()=>{m.current=n},[n]),(0,P.useEffect)(()=>{let e=S();p.setTheme(e)},[a]),(0,P.useEffect)(()=>{let e=w.map(e=>l.registerCompletionItemProvider(e,{triggerCharacters:[`.`,`_`],provideCompletionItems:async(e,t,n,r)=>{let i=m.current;if(!i)return{suggestions:[]};let a=e.getOffsetAt(t),o=e.getValue(),s=o.slice(Math.max(0,a-T),a),c=o.slice(a,a+E),u=e.getLineContent(t.lineNumber).slice(0,Math.max(0,t.column-1)),d=A(u),f={triggerCharacter:n.triggerCharacter,triggerKind:n.triggerKind};if(!j(f,d))return{suggestions:[]};let p=`cmp_${Date.now()}_${Math.random().toString(36).slice(2)}`,_=e.getWordUntilPosition(t),v={startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:_.startColumn,endColumn:t.column},b=h(y.getState().wsUrl),x=e=>e.map((e,t)=>({label:e.label,kind:I(e.kind),insertText:e.insertText,detail:e.detail??(e.source?`WrongStack ${e.source}`:void 0),documentation:e.documentation,sortText:e.sortText??`${String(t).padStart(3,`0`)}-${e.label}`,range:v,insertTextRules:e.kind===`snippet`?l.CompletionItemInsertTextRule.InsertAsSnippet:void 0})),S=N({filePath:i,language:e.getLanguageId(),lineNumber:t.lineNumber,column:t.column,versionId:e.getVersionId(),triggerCharacter:n.triggerCharacter,linePrefix:u,suffix:c}),C=g.current.get(S);return C&&C.expiresAt>Date.now()?{suggestions:x(C.items)}:await new Promise(a=>{let l=!1,u=()=>{},m=null,h,_=e=>{l||(l=!0,u(),h!==void 0&&window.clearTimeout(h),m?.dispose(),a({suggestions:e}))};u=b.on(`completion.result`,e=>{let t=e;t.payload.requestId===p&&(g.current.set(S,{expiresAt:Date.now()+O,items:t.payload.items}),_(x(t.payload.items)))}),h=window.setTimeout(()=>_([]),D),m=r.onCancellationRequested(()=>_([])),b.requestCompletion({requestId:p,filePath:i,language:e.getLanguageId(),lineNumber:t.lineNumber,column:t.column,content:o.length<=5e5?o:void 0,prefix:s,suffix:c,triggerCharacter:n.triggerCharacter,triggerKind:n.triggerKind,allowLlm:M(f,d)})})}}));return()=>{e.forEach(e=>{e.dispose()})}},[]);let H=(0,P.useCallback)(()=>{let e=u.current;if(!e)return null;let t=e.getSelection();if(!t||t.isEmpty())return null;let n=e.getModel();if(!n)return null;let r=n.getValueInRange(t);return r.trim()?{content:r,startLine:t.startLineNumber,endLine:t.endLineNumber}:null},[]),U=(0,P.useCallback)(()=>{x(`chat`),requestAnimationFrame(()=>{document.querySelector(`[data-chat-textarea]`)?.focus()})},[]),W=(0,P.useCallback)(()=>{let e=m.current;if(!e)return;let t=H();t&&(b.getState().addRef({kind:`snippet`,path:e,startLine:t.startLine,endLine:t.endLine,content:t.content}),U())},[H,U]),G=(0,P.useCallback)(()=>{let e=m.current;e&&(b.getState().addRef({kind:`file`,path:e}),U())},[U]),K=(0,P.useCallback)(t=>{u.current=t,p.setTheme(S()),t.onDidChangeCursorSelection(()=>{let e=t.getSelection();V(!!e&&!e.isEmpty())}),t.addAction({id:`wrongstack-send-to-chat`,label:e(`activity:codeEditor.sendSelectionAction`),contextMenuGroupId:`wrongstack`,contextMenuOrder:0,precondition:void 0,keybindings:[f.CtrlCmd|f.Shift|c.KeyL],run:e=>{let t=e.getSelection();t&&!t.isEmpty()?W():G()}})},[W,G]),q=(0,P.useCallback)(e=>{n&&e!==void 0&&r(n,e)},[n,r]);return(0,P.useEffect)(()=>{let e=e=>{let t=e.ctrlKey||e.metaKey,r=e.target?.tagName?.toLowerCase()===`textarea`||e.target?.closest(`.monaco-editor`)!==null;!t||!r||(e.key.toLowerCase()===`s`&&(e.preventDefault(),window.dispatchEvent(new CustomEvent(`wrongstack:save-file`,{detail:{filePath:n}}))),e.key.toLowerCase()===`w`&&(e.preventDefault(),n&&v.getState().closeFile(n)))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[n]),t.length===0?(0,F.jsx)(`div`,{className:`flex h-full min-w-0 items-center justify-center`,children:(0,F.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`activity:codeEditor.noFilesOpen`)}),(0,F.jsx)(`p`,{className:`text-[11px] text-muted-foreground/75`,children:e(`activity:codeEditor.selectToEdit`)})]})}):(0,F.jsxs)(`div`,{className:`flex h-full min-w-0 flex-col overflow-hidden`,children:[(0,F.jsx)(L,{}),(0,F.jsxs)(`div`,{className:`relative min-h-0 min-w-0 flex-1 overflow-hidden`,children:[(B||C)&&(0,F.jsx)(`div`,{className:`absolute top-2 right-2 z-10 flex items-center gap-1 rounded-lg border border-border bg-popover/95 backdrop-blur shadow-md p-1`,children:(0,F.jsxs)(`button`,{type:`button`,onClick:B?W:G,className:`inline-flex items-center gap-1.5 rounded-md px-2 py-1 text-[11px] text-foreground hover:bg-accent transition-colors`,title:e(B?`activity:codeEditor.sendSelectedTitle`:`activity:codeEditor.mentionFileTitle`),children:[B?(0,F.jsx)(o,{className:`h-3 w-3`}):(0,F.jsx)(i,{className:`h-3 w-3`}),(0,F.jsx)(`span`,{children:e(B?`activity:codeEditor.sendToChat`:`activity:codeEditor.mentionFile`)})]})}),C?(0,F.jsx)(d,{language:R,value:C.content,onChange:q,theme:z,onMount:K,loading:(0,F.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,F.jsx)(`span`,{className:`text-[11px] text-muted-foreground animate-pulse`,children:e(`activity:codeEditor.loadingEditor`)})}),options:{minimap:{enabled:!1},fontSize:13,fontFamily:`'IBM Plex Mono', 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace`,lineNumbers:`on`,renderWhitespace:`selection`,scrollBeyondLastLine:!1,wordWrap:`off`,tabSize:2,smoothScrolling:!0,cursorBlinking:`smooth`,cursorSmoothCaretAnimation:`on`,bracketPairColorization:{enabled:!0},"semanticHighlighting.enabled":!0,automaticLayout:!0,padding:{top:8}}},C.path):(0,F.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,F.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e(`activity:codeEditor.selectTab`)})})]})]})}export{R as CodeEditor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-BRAejDWd.js";import{Ft as r,li as i,pr as a,ui as o,vi as s}from"./vendor-B51hXwIj.js";import"./i18n-CLLrYq46.js";import{A as c,F as l,M as u,P as d,X as f,_ as p,j as m,u as h}from"./index-BwLKTDt1.js";var g=e(t(),1),_=n();function v(e){return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:e<36e5?`${(e/6e4).toFixed(1)}m`:`${(e/36e5).toFixed(1)}h`}function y(e){if(!e)return`—`;let t=new Date(e),n=Date.now(),r=t.getTime()-n,i=Math.abs(r);if(i<6e4)return r>=0?`<1m`:`<1m ago`;if(i<36e5){let e=Math.round(i/6e4);return r>=0?`${e}m`:`${e}m ago`}if(i<864e5){let e=Math.round(i/36e5);return r>=0?`${e}h`:`${e}h ago`}return t.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function b({enabled:e,overdue:t}){return e?t?(0,_.jsxs)(h,{variant:`destructive`,className:`gap-1`,children:[(0,_.jsx)(a,{className:`h-3 w-3`}),`Overdue`]}):(0,_.jsxs)(h,{variant:`default`,className:`gap-1 bg-emerald-600 hover:bg-emerald-600`,children:[(0,_.jsx)(i,{className:`h-3 w-3`}),`Active`]}):(0,_.jsxs)(h,{variant:`secondary`,className:`gap-1`,children:[(0,_.jsx)(o,{className:`h-3 w-3`}),`Disabled`]})}function x({open:e,onClose:t}){let{t:n}=s(),i=f(e=>e.snapshot),o=f(e=>e.lastFiredAt);f(e=>e.revision);let h=i?.jobs??[],x=i?.count??0,S=i?.maxConcurrent??0,C=h.filter(e=>e.overdue).length,w=h.filter(e=>e.enabled).length,T=h.reduce((e,t)=>e+t.runCount,0);return(0,_.jsx)(c,{open:e,onOpenChange:(0,g.useCallback)(e=>{e||t()},[t]),children:(0,_.jsxs)(m,{className:`max-w-3xl max-h-[80vh] flex flex-col`,children:[(0,_.jsxs)(d,{children:[(0,_.jsxs)(l,{className:`flex items-center gap-2`,children:[(0,_.jsx)(r,{className:`h-5 w-5`}),`Cron Jobs`]}),(0,_.jsx)(u,{children:`Scheduled recurring tasks managed by the cron plugin.`})]}),x>0&&(0,_.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-sm text-muted-foreground border-b border-border/70 pb-3`,children:[(0,_.jsxs)(`span`,{className:`font-medium text-foreground`,children:[x,` job`,x===1?``:`s`]}),(0,_.jsxs)(`span`,{className:`text-emerald-500`,children:[w,` enabled`]}),C>0&&(0,_.jsxs)(`span`,{className:`text-destructive`,children:[C,` overdue`]}),(0,_.jsxs)(`span`,{children:[T,` total runs`]}),(0,_.jsxs)(`span`,{className:`text-muted-foreground/60`,children:[`max `,S,` concurrent`]})]}),x===0&&(0,_.jsxs)(`div`,{className:`flex flex-col items-center gap-2 py-12 text-muted-foreground`,children:[(0,_.jsx)(a,{className:`h-8 w-8 opacity-40`}),(0,_.jsx)(`p`,{className:`text-sm`,children:`No cron jobs scheduled.`}),(0,_.jsxs)(`p`,{className:`text-xs`,children:[`Use `,(0,_.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5`,children:`cron_schedule`}),` to add one.`]})]}),x>0&&(0,_.jsx)(p,{className:`flex-1 -mx-6 px-6`,children:(0,_.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,_.jsx)(`thead`,{children:(0,_.jsxs)(`tr`,{className:`border-b border-border/50 text-left text-xs text-muted-foreground`,children:[(0,_.jsx)(`th`,{className:`pb-2 pr-3 font-medium`,children:`Status`}),(0,_.jsx)(`th`,{className:`pb-2 pr-3 font-medium`,children:`Name`}),(0,_.jsx)(`th`,{className:`pb-2 pr-3 font-medium`,children:`Interval`}),(0,_.jsx)(`th`,{className:`pb-2 pr-3 font-medium text-right`,children:`Runs`}),(0,_.jsx)(`th`,{className:`pb-2 pr-3 font-medium`,children:`Next Run`}),(0,_.jsx)(`th`,{className:`pb-2 pr-3 font-medium`,children:`Last Run`}),(0,_.jsx)(`th`,{className:`pb-2 font-medium`,children:`Action`})]})}),(0,_.jsx)(`tbody`,{children:h.map(e=>(0,_.jsxs)(`tr`,{className:`border-b border-border/30 last:border-0`,children:[(0,_.jsx)(`td`,{className:`py-2.5 pr-3`,children:(0,_.jsx)(b,{enabled:e.enabled,overdue:e.overdue})}),(0,_.jsx)(`td`,{className:`py-2.5 pr-3 font-mono text-xs font-medium max-w-[160px] truncate`,title:e.name,children:e.name}),(0,_.jsx)(`td`,{className:`py-2.5 pr-3 font-mono text-xs tabular-nums`,children:v(e.intervalMs)}),(0,_.jsxs)(`td`,{className:`py-2.5 pr-3 text-right font-mono text-xs tabular-nums`,children:[e.runCount,o[e.name]&&(0,_.jsx)(`span`,{className:`ml-1 text-emerald-500`,title:`Last fired at ${o[e.name]}`,children:`●`})]}),(0,_.jsx)(`td`,{className:`py-2.5 pr-3 font-mono text-xs tabular-nums`,children:y(e.nextRun)}),(0,_.jsx)(`td`,{className:`py-2.5 pr-3 font-mono text-xs tabular-nums`,children:y(e.lastRun)}),(0,_.jsx)(`td`,{className:`py-2.5 font-mono text-xs max-w-[200px] truncate text-muted-foreground`,title:e.action,children:e.action})]},e.name))})]})}),x>0&&(0,_.jsxs)(`p`,{className:`text-xs text-muted-foreground pt-3 border-t border-border/70`,children:[`Use `,(0,_.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 text-[11px]`,children:`cron_schedule`}),` to add,`,(0,_.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 text-[11px] ml-1`,children:`cron_cancel`}),` to remove.`]})]})})}export{x as CronJobsPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-BRAejDWd.js";import{At as r,Bn as i,Bt as a,Qr as o,fi as s,lt as c,nr as l,pi as u,pr as d,vi as f,xi as p,zr as m}from"./vendor-B51hXwIj.js";import"./i18n-CLLrYq46.js";var h=e(t(),1),g=n();function _({title:e,value:t,subtitle:n,icon:r,color:i=`text-primary`,trend:a}){let{t:o}=f();return(0,g.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,g.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,g.jsxs)(`div`,{className:`min-w-0`,children:[(0,g.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium`,children:e}),(0,g.jsx)(`p`,{className:`mt-1 truncate text-xl font-semibold tabular-nums sm:text-2xl ${i}`,children:t}),n&&(0,g.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1`,children:n})]}),(0,g.jsx)(`div`,{className:`shrink-0 rounded-lg bg-muted/70 p-2 ${i}`,children:(0,g.jsx)(r,{className:`w-5 h-5`})})]}),a&&(0,g.jsxs)(`div`,{className:`mt-2 flex items-center gap-1`,children:[a===`up`&&(0,g.jsx)(c,{className:`w-3 h-3 text-success`}),a===`down`&&(0,g.jsx)(c,{className:`w-3 h-3 rotate-180 text-destructive`}),(0,g.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:o(a===`up`?`activity:debug.trendUp`:a===`down`?`activity:debug.trendDown`:`activity:debug.trendStable`)})]})]})}function v(){let{t:e}=f(),[t,n]=(0,h.useState)({fileWatcher:null,system:null,lastUpdated:null,error:null}),[v,x]=(0,h.useState)(!0),[S,C]=(0,h.useState)(2e3),w=(0,h.useCallback)(async()=>{try{let e=await fetch(`/debug/watcher-metrics`),t=null,r=e.headers.get(`content-type`)??``;e.ok&&r.includes(`application/json`)&&(t=await e.json());let i={memoryUsage:{heapUsed:performance.memory?.usedJSHeapSize??0,heapTotal:performance.memory?.totalJSHeapSize??0,external:0,rss:0,arrayBuffers:0},uptime:performance.timeOrigin?performance.now()/1e3:0,cpuUsage:{user:0,system:0}};n({fileWatcher:t,system:i,lastUpdated:new Date,error:null})}catch(e){n(t=>({...t,error:e instanceof Error?e.message:p.t(`activity:debug.fetchFailed`)}))}finally{x(!1)}},[]);return(0,h.useEffect)(()=>{w();let e=setInterval(w,S);return()=>clearInterval(e)},[w,S]),(0,g.jsx)(`div`,{className:`h-full min-h-0 min-w-0 flex-1 overflow-y-auto bg-[hsl(var(--surface-2)/0.45)] p-4 sm:p-6`,children:(0,g.jsxs)(`div`,{className:`mx-auto flex max-w-7xl flex-col gap-5`,children:[(0,g.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:(0,g.jsxs)(`div`,{className:`flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between`,children:[(0,g.jsxs)(`div`,{className:`min-w-0`,children:[(0,g.jsxs)(`h1`,{className:`flex items-center gap-2 text-lg font-semibold sm:text-xl`,children:[(0,g.jsx)(u,{className:`h-5 w-5 text-primary`}),e(`activity:debug.heading`)]}),(0,g.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:e(`activity:debug.subtitle`)})]}),(0,g.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center`,children:[(0,g.jsxs)(`label`,{className:`flex min-w-0 items-center gap-2 text-sm`,children:[(0,g.jsx)(a,{className:`w-4 h-4 text-muted-foreground`}),(0,g.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e(`activity:debug.refreshLabel`)}),(0,g.jsxs)(`select`,{value:S,onChange:e=>C(Number(e.target.value)),className:`h-9 rounded-md border border-border/70 bg-background/70 px-2 text-sm`,children:[(0,g.jsx)(`option`,{value:1e3,children:`1s`}),(0,g.jsx)(`option`,{value:2e3,children:`2s`}),(0,g.jsx)(`option`,{value:5e3,children:`5s`}),(0,g.jsx)(`option`,{value:1e4,children:`10s`})]})]}),(0,g.jsxs)(`button`,{type:`button`,onClick:()=>{x(!0),w()},disabled:v,className:`inline-flex h-9 items-center justify-center gap-2 rounded-md bg-primary px-3 text-sm font-medium text-primary-foreground shadow-sm shadow-primary/15 hover:bg-primary/90 disabled:opacity-50`,children:[(0,g.jsx)(a,{className:`w-4 h-4 ${v?`animate-spin`:``}`}),e(`common:action.refresh`)]})]})]})}),t.lastUpdated&&(0,g.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border/60 bg-card/55 px-3 py-2 text-sm text-muted-foreground`,children:[(0,g.jsx)(d,{className:`w-4 h-4`}),e(`activity:debug.lastUpdated`,{time:t.lastUpdated.toLocaleTimeString()})]}),t.error&&(0,g.jsxs)(`div`,{className:`flex items-center gap-3 rounded-xl border border-destructive/25 bg-destructive/10 p-4 text-destructive`,children:[(0,g.jsx)(s,{className:`w-5 h-5 flex-shrink-0`}),(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`p`,{className:`font-medium`,children:e(`activity:debug.fetchFailed`)}),(0,g.jsx)(`p`,{className:`text-sm opacity-80`,children:t.error})]})]}),(0,g.jsxs)(`section`,{children:[(0,g.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,g.jsx)(l,{className:`h-4 w-4 text-primary`}),e(`activity:debug.fileWatcher`)]}),(0,g.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4`,children:[(0,g.jsx)(_,{title:e(`activity:debug.watcherStatus`),value:t.fileWatcher?.watcherActive?e(`activity:debug.running`):e(`activity:debug.stopped`),icon:r,color:t.fileWatcher?.watcherActive?`text-success`:`text-destructive`}),(0,g.jsx)(_,{title:e(`activity:debug.activeProjects`),value:t.fileWatcher?.activeProjects??0,subtitle:e(`activity:debug.projectsWatched`),icon:o,color:`text-primary`}),(0,g.jsx)(_,{title:e(`activity:debug.fileChanges`),value:t.fileWatcher?.fileChangesDetected??0,subtitle:e(`activity:debug.totalDetected`),icon:m,color:`text-primary`,trend:`neutral`}),(0,g.jsx)(_,{title:e(`activity:debug.filesProcessed`),value:t.fileWatcher?.filesProcessed??0,subtitle:e(`activity:debug.afterHash`),icon:i,color:`text-success`})]}),(0,g.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mt-4`,children:[(0,g.jsx)(_,{title:e(`activity:debug.broadcastsSent`),value:t.fileWatcher?.broadcastsSent??0,subtitle:e(`activity:debug.toClients`),icon:c,color:`text-success`}),(0,g.jsx)(_,{title:e(`activity:debug.debounceResets`),value:t.fileWatcher?.debounceResets??0,subtitle:e(`activity:debug.rapidWrites`),icon:a,color:`text-warning`}),(0,g.jsx)(_,{title:e(`activity:debug.avgDebounce`),value:`${(t.fileWatcher?.averageDebounceDelayMs??0).toFixed(1)}ms`,subtitle:e(`activity:debug.actualDelay`),icon:d,color:`text-warning`}),(0,g.jsx)(_,{title:e(`activity:debug.totalDelay`),value:`${(t.fileWatcher?.totalDebounceDelayMs??0).toFixed(0)}ms`,subtitle:e(`activity:debug.sumDelays`),icon:u,color:`text-primary`})]})]}),(0,g.jsxs)(`section`,{children:[(0,g.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,g.jsx)(i,{className:`h-4 w-4 text-primary`}),e(`activity:debug.browserPerf`)]}),(0,g.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-3 gap-4`,children:[(0,g.jsx)(_,{title:e(`activity:debug.heapUsed`),value:y(t.system?.memoryUsage?.heapUsed??0),subtitle:e(`activity:debug.jsHeap`),icon:u,color:`text-primary`}),(0,g.jsx)(_,{title:e(`activity:debug.heapTotal`),value:y(t.system?.memoryUsage?.heapTotal??0),subtitle:e(`activity:debug.totalHeap`),icon:u,color:`text-success`}),(0,g.jsx)(_,{title:e(`activity:debug.pageUptime`),value:b(t.system?.uptime??0),subtitle:e(`activity:debug.sinceLoad`),icon:d,color:`text-primary`})]})]}),(0,g.jsxs)(`section`,{children:[(0,g.jsxs)(`h2`,{className:`mb-3 flex items-center gap-2 text-sm font-semibold text-muted-foreground`,children:[(0,g.jsx)(m,{className:`h-4 w-4 text-primary`}),e(`activity:debug.rawData`)]}),(0,g.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:(0,g.jsx)(`pre`,{className:`overflow-x-auto text-xs font-mono text-muted-foreground`,children:JSON.stringify({fileWatcher:t.fileWatcher,browserMemory:t.system?.memoryUsage,pageUptime:t.system?.uptime},null,2)})})]})]})})}function y(e){if(e===0)return`0 B`;let t=1024,n=[`B`,`KB`,`MB`,`GB`],r=Math.floor(Math.log(e)/Math.log(t));return`${(e/t**r).toFixed(1)} ${n[r]}`}function b(e){return e<60?`${e.toFixed(0)}s`:e<3600?`${(e/60).toFixed(1)}m`:`${(e/3600).toFixed(1)}h`}export{v as DebugDashboard};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{Mt as r,Qt as i,Tt as a,Z as o,br as s,fi as c,hi as l,tr as u}from"./vendor-CyLvG8N0.js";import"./i18n-BMePmaPJ.js";import{t as d}from"./utils-CU_o9ioU.js";import{C as f,T as p}from"./index-CyTNJHe8.js";var m=e(t(),1);function h(e,t,n){return e<t?t:e>n?n:e}function g(e){let t=/^oklch\(\s*([^)]+)\)$/i.exec(e.trim());if(!t?.[1])return null;let n=(t[1].split(`/`)[0]??``).trim().split(/\s+/);if(n.length<3||!n[0]||!n[1]||!n[2])return null;let r=n[0].endsWith(`%`)?Number.parseFloat(n[0])/100:Number.parseFloat(n[0]),i=n[1].endsWith(`%`)?Number.parseFloat(n[1])/100*.4:Number.parseFloat(n[1]),a=Number.parseFloat(n[2].replace(/deg$/i,``));return[r,i,a].every(Number.isFinite)?[h(r,0,1),Math.max(0,i),a]:null}function _(e){return h(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055,0,1)}function v(e){return Math.round(e*255).toString(16).padStart(2,`0`)}function y(e){let t=g(e);if(!t)return null;let[n,r,i]=t,a=i*Math.PI/180,o=r*Math.cos(a),s=r*Math.sin(a),c=n+.3963377774*o+.2158037573*s,l=n-.1055613458*o-.0638541728*s,u=n-.0894841775*o-1.291485548*s,d=c**3,f=l**3,p=u**3,m=4.0767416621*d-3.3077115913*f+.2309699292*p,h=-1.2684380046*d+2.6097574011*f-.3413193965*p,y=-.0041960863*d-.7034186147*f+1.707614701*p;return`#${v(_(m))}${v(_(h))}${v(_(y))}`}function b(e){let t=e.trim(),n=y(t);if(n)return n.toLowerCase();let r=/^#([0-9a-f]{6})([0-9a-f]{2})?$/i.exec(t);if(r?.[1])return`#${r[1].toLowerCase()}`;let i=/^#([0-9a-f]{3})$/i.exec(t);return i?.[1]?`#${i[1].split(``).map(e=>e+e).join(``).toLowerCase()}`:null}var x=n(),S=[`web`,`react-native`,`flutter`,`swiftui`,`compose`],C=[`primary`,`accent`,`bg`,`surface`,`fg`,`border`];function w(e,t,n){let r={...e};for(let[e,i]of Object.entries(t))e.startsWith(`light.`)?n===`light`&&(r[e.slice(6)]=i):e.startsWith(`dark.`)?n===`dark`&&(r[e.slice(5)]=i):r[e]=i;return r}function T({t:e,label:t}){let n=e.bg??`#fff`,r=e.surface??n,i=e.fg??`#111`,a=e.muted??i,o=e.primary??`#3b82f6`,s=e.accent??o,c=e.border??a,l=e.radius??`0.5rem`,u=e.fontSans??`system-ui, sans-serif`,d=e.fontDisplay??u,f=e.shadow&&e.shadow!==`none`?e.shadow:void 0;return(0,x.jsxs)(`div`,{style:{background:n,color:i,fontFamily:u},className:`flex min-w-0 flex-col gap-2 overflow-hidden p-3`,children:[(0,x.jsx)(`div`,{className:`text-[9px] uppercase tracking-wide`,style:{color:a},children:t}),(0,x.jsxs)(`div`,{style:{background:r,border:`1px solid ${c}`,borderRadius:l,boxShadow:f},className:`flex min-w-0 flex-col gap-2 p-3`,children:[(0,x.jsx)(`div`,{style:{fontFamily:d},className:`text-base font-bold leading-tight`,children:`Aa Heading`}),(0,x.jsx)(`div`,{className:`text-[11px] leading-snug`,style:{color:a},children:`The quick brown fox jumps over the lazy dog.`}),(0,x.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-center gap-1.5`,children:[(0,x.jsx)(`span`,{style:{background:o,color:n,borderRadius:l},className:`shrink-0 px-2.5 py-1 text-[10px] font-semibold`,children:`Primary`}),(0,x.jsx)(`span`,{style:{border:`1px solid ${c}`,color:i,borderRadius:l},className:`shrink-0 px-2 py-1 text-[10px]`,children:`Ghost`}),(0,x.jsx)(`span`,{style:{background:s,color:n,borderRadius:`999px`},className:`ml-auto shrink-0 px-2 py-0.5 text-[9px] font-semibold`,children:`Badge`})]}),(0,x.jsx)(`div`,{style:{border:`1px solid ${c}`,borderRadius:l,color:a},className:`text-[10px] px-2 py-1.5 mt-1`,children:`Input field…`})]})]})}function E({kit:e,overrides:t,onSet:n}){let[r,i]=(0,m.useState)(`light`),{t:a}=c(),o=w(r===`light`?e.light:e.dark,t,r);return(0,x.jsxs)(`div`,{className:`mt-1 rounded-lg border border-border/60 p-2 bg-muted/30`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,x.jsx)(`span`,{className:`text-[10px] font-semibold uppercase text-muted-foreground`,children:a(`activity:design.colors`)}),(0,x.jsx)(`div`,{className:`ml-auto inline-flex rounded border border-border/60 overflow-hidden`,children:[`light`,`dark`].map(e=>(0,x.jsx)(`button`,{type:`button`,onClick:()=>i(e),className:d(`text-[10px] px-1.5 py-0.5`,r===e?`bg-primary text-primary-foreground`:`text-muted-foreground`),children:e},e))})]}),(0,x.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:C.filter(e=>o[e]).map(e=>{let t=b(o[e]??``)??`#000000`;return(0,x.jsxs)(`label`,{className:`flex min-w-[2rem] flex-col items-center gap-0.5`,title:`${e}: ${o[e]}`,children:[(0,x.jsx)(`input`,{type:`color`,value:t,onChange:t=>n(`${r}.${e}`,t.target.value),className:`w-6 h-6 rounded cursor-pointer bg-transparent border border-border/60 p-0`}),(0,x.jsx)(`span`,{className:`text-[8px] text-muted-foreground`,children:e})]},e)})})]})}function D({className:e}){let{client:t}=f(),{t:n}=c(),[h,g]=(0,m.useState)([]),[_,v]=(0,m.useState)(null),[y,b]=(0,m.useState)({}),[C,D]=(0,m.useState)(`web`),[O,k]=(0,m.useState)(``),[A,j]=(0,m.useState)(null);(0,m.useEffect)(()=>{if(!t)return;let e=e=>{let t=e.payload;g(t?.kits??[]),v(t?.activeKit??null),b(t?.overrides??{})},n=e=>{let t=e.payload;t?.ok&&t.kit&&(v(t.kit),b(t.overrides??{}))},r=e=>{let t=e.payload;t?.ok&&t.overrides&&b(t.overrides)},i=e=>{let t=e.payload;j(t?.ok?l.t(`activity:design.wrote`,{path:t.path}):l.t(`activity:design.materializeFailed`,{error:t?.error??`error`}))},a=e=>{let t=e.payload;if(!t?.ok){j(l.t(`activity:design.verifyError`,{error:t?.error??`error`}));return}let n=Math.round((t.score??1)*100);j(t.violationCount?l.t(`activity:design.verifyOffPalette`,{pct:n,count:t.violationCount,files:t.filesScanned}):l.t(`activity:design.verifyClean`,{files:t.filesScanned}))};return t.on(`design.list`,e),t.on(`design.use`,n),t.on(`design.set`,r),t.on(`design.materialize`,i),t.on(`design.verify`,a),t.send({type:`design.list`}),()=>{t.off(`design.list`,e),t.off(`design.use`,n),t.off(`design.set`,r),t.off(`design.materialize`,i),t.off(`design.verify`,a)}},[t]);let M=(0,m.useCallback)(e=>t?.send({type:`design.use`,payload:{kit:e,stack:C}}),[t,C]),N=(0,m.useCallback)((e,n)=>{b(t=>({...t,[e]:n})),t?.send({type:`design.set`,payload:{overrides:{[e]:n}}})},[t]),P=(0,m.useCallback)(()=>{j(l.t(`activity:design.writing`)),t?.send({type:`design.materialize`,payload:{stack:C}})},[t,C]),F=(0,m.useCallback)(()=>{j(l.t(`activity:design.scanning`)),t?.send({type:`design.verify`})},[t]),I=(0,m.useMemo)(()=>{let e=O.trim().toLowerCase();return[...e?h.filter(t=>t.id.includes(e)||t.name.toLowerCase().includes(e)||t.aesthetic.toLowerCase().includes(e)||t.tags.some(t=>t.includes(e))):h].sort((e,t)=>e.name.localeCompare(t.name))},[h,O]);return(0,x.jsxs)(`div`,{className:d(`flex h-full min-h-0 min-w-0 flex-col overflow-hidden bg-[hsl(var(--surface-2)/0.45)]`,e),children:[(0,x.jsx)(`div`,{className:`border-b border-border/60 p-3`,children:(0,x.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-3 shadow-sm`,children:(0,x.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center`,children:[(0,x.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,x.jsx)(i,{className:`h-4 w-4`})}),(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`h2`,{className:`truncate text-sm font-semibold`,children:n(`activity:design.heading`)}),(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`activity:design.kitsCount`,{count:I.length})})]})]}),(0,x.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2 sm:flex-row sm:items-center lg:justify-end`,children:[(0,x.jsxs)(`label`,{className:`relative min-w-0 flex-1 sm:max-w-xs`,children:[(0,x.jsx)(r,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/70`}),(0,x.jsx)(`input`,{value:O,onChange:e=>k(e.target.value),placeholder:n(`activity:design.searchPlaceholder`),className:`h-9 w-full rounded-md border border-border/70 bg-background/70 pl-8 pr-3 text-sm shadow-sm outline-none transition focus:border-primary/40 focus:ring-2 focus:ring-ring/30`})]}),(0,x.jsx)(`select`,{value:C,onChange:e=>D(e.target.value),className:`h-9 rounded-md border border-border/70 bg-background/70 px-2 text-sm shadow-sm`,title:n(`activity:design.stackTitle`),children:S.map(e=>(0,x.jsx)(`option`,{value:e,children:e},e))}),A&&(0,x.jsx)(`span`,{className:`min-w-0 truncate rounded-md border border-border/60 bg-muted/40 px-2 py-1 text-[11px] text-muted-foreground sm:max-w-56`,children:A}),(0,x.jsx)(`button`,{type:`button`,onClick:()=>p(`chat`),className:`inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,title:n(`common:action.close`),children:(0,x.jsx)(o,{className:`h-4 w-4`})})]})]})})}),(0,x.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto p-3 sm:p-4`,children:I.length===0?(0,x.jsxs)(`div`,{className:`ws-surface mx-auto mt-8 flex max-w-md flex-col items-center gap-3 rounded-xl p-6 text-center text-muted-foreground`,children:[(0,x.jsx)(i,{className:`h-8 w-8 text-primary/60`}),(0,x.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:n(`activity:design.kitsCount`,{count:0})}),(0,x.jsx)(`p`,{className:`text-xs`,children:n(`activity:design.searchPlaceholder`)})]}):(0,x.jsx)(`div`,{className:`grid gap-4 [grid-template-columns:repeat(auto-fill,minmax(min(100%,20rem),1fr))]`,children:I.map(e=>{let t=_===e.id,r=t?y:{};return(0,x.jsxs)(`div`,{className:d(`flex min-w-0 flex-col overflow-hidden rounded-xl border bg-card/75 shadow-sm`,t?`border-primary/60 ring-1 ring-primary/30`:`border-border/70`),children:[(0,x.jsxs)(`div`,{className:`grid min-h-[12rem] grid-cols-1 sm:grid-cols-2`,children:[(0,x.jsx)(T,{t:w(e.light,r,`light`),label:n(`activity:designStudio.light`)}),(0,x.jsx)(T,{t:w(e.dark,r,`dark`),label:n(`activity:designStudio.dark`)})]}),(0,x.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 border-t border-border/60 bg-card p-3`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,x.jsx)(`h3`,{className:`text-sm font-semibold truncate`,children:e.name}),(0,x.jsx)(`code`,{className:`text-[10px] text-muted-foreground`,children:e.id}),t&&(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 text-[9px] font-semibold uppercase text-primary ml-auto`,children:[(0,x.jsx)(s,{className:`w-3 h-3`}),` `,n(`activity:design.active`)]})]}),(0,x.jsx)(`p`,{className:`text-[11px] text-muted-foreground leading-snug`,children:e.aesthetic}),(0,x.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2`,children:[(0,x.jsx)(`button`,{type:`button`,onClick:()=>M(e.id),className:d(`rounded-md px-2.5 py-1 text-[11px] font-medium transition`,t?`bg-primary/10 text-primary`:`bg-primary text-primary-foreground hover:opacity-90`),children:n(t?`activity:design.reapply`:`activity:design.use`)}),t&&(0,x.jsxs)(`button`,{type:`button`,onClick:P,className:`inline-flex items-center gap-1 rounded-md border border-border/60 px-2 py-1 text-[11px] font-medium hover:bg-muted`,title:n(`activity:design.materializeTitle`,{stack:C}),children:[(0,x.jsx)(u,{className:`w-3 h-3`}),` `,n(`activity:design.materialize`)]}),t&&(0,x.jsxs)(`button`,{type:`button`,onClick:F,className:`inline-flex items-center gap-1 rounded-md border border-border/60 px-2 py-1 text-[11px] font-medium hover:bg-muted`,title:n(`activity:design.verifyTitle`),children:[(0,x.jsx)(a,{className:`w-3 h-3`}),` `,n(`activity:design.verify`)]}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[10px] text-muted-foreground`,children:e.bestFor})]}),t&&(0,x.jsx)(E,{kit:e,overrides:r,onSet:N})]})]},e.id)})})})]})}export{D as DesignGalleryView};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-BRAejDWd.js";import{$t as r,Mt as i,Tt as a,X as o,ar as s,vi as c,wr as l,xi as u}from"./vendor-B51hXwIj.js";import"./i18n-CLLrYq46.js";import{t as d}from"./utils-C9L1kxOy.js";import{L as f,z as p}from"./index-BwLKTDt1.js";var m=e(t(),1);function h(e,t,n){return e<t?t:e>n?n:e}function g(e){let t=/^oklch\(\s*([^)]+)\)$/i.exec(e.trim());if(!t?.[1])return null;let n=(t[1].split(`/`)[0]??``).trim().split(/\s+/);if(n.length<3||!n[0]||!n[1]||!n[2])return null;let r=n[0].endsWith(`%`)?Number.parseFloat(n[0])/100:Number.parseFloat(n[0]),i=n[1].endsWith(`%`)?Number.parseFloat(n[1])/100*.4:Number.parseFloat(n[1]),a=Number.parseFloat(n[2].replace(/deg$/i,``));return[r,i,a].every(Number.isFinite)?[h(r,0,1),Math.max(0,i),a]:null}function _(e){return h(e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055,0,1)}function v(e){return Math.round(e*255).toString(16).padStart(2,`0`)}function y(e){let t=g(e);if(!t)return null;let[n,r,i]=t,a=i*Math.PI/180,o=r*Math.cos(a),s=r*Math.sin(a),c=n+.3963377774*o+.2158037573*s,l=n-.1055613458*o-.0638541728*s,u=n-.0894841775*o-1.291485548*s,d=c**3,f=l**3,p=u**3,m=4.0767416621*d-3.3077115913*f+.2309699292*p,h=-1.2684380046*d+2.6097574011*f-.3413193965*p,y=-.0041960863*d-.7034186147*f+1.707614701*p;return`#${v(_(m))}${v(_(h))}${v(_(y))}`}function b(e){let t=e.trim(),n=y(t);if(n)return n.toLowerCase();let r=/^#([0-9a-f]{6})([0-9a-f]{2})?$/i.exec(t);if(r?.[1])return`#${r[1].toLowerCase()}`;let i=/^#([0-9a-f]{3})$/i.exec(t);return i?.[1]?`#${i[1].split(``).map(e=>e+e).join(``).toLowerCase()}`:null}var x=n(),S=[`web`,`react-native`,`flutter`,`swiftui`,`compose`],C=[`primary`,`accent`,`bg`,`surface`,`fg`,`border`];function w(e,t,n){let r={...e};for(let[e,i]of Object.entries(t))e.startsWith(`light.`)?n===`light`&&(r[e.slice(6)]=i):e.startsWith(`dark.`)?n===`dark`&&(r[e.slice(5)]=i):r[e]=i;return r}function T({t:e,label:t}){let n=e.bg??`#fff`,r=e.surface??n,i=e.fg??`#111`,a=e.muted??i,o=e.primary??`#3b82f6`,s=e.accent??o,c=e.border??a,l=e.radius??`0.5rem`,u=e.fontSans??`system-ui, sans-serif`,d=e.fontDisplay??u,f=e.shadow&&e.shadow!==`none`?e.shadow:void 0;return(0,x.jsxs)(`div`,{style:{background:n,color:i,fontFamily:u},className:`flex min-w-0 flex-col gap-2 overflow-hidden p-3`,children:[(0,x.jsx)(`div`,{className:`text-[9px] uppercase tracking-wide`,style:{color:a},children:t}),(0,x.jsxs)(`div`,{style:{background:r,border:`1px solid ${c}`,borderRadius:l,boxShadow:f},className:`flex min-w-0 flex-col gap-2 p-3`,children:[(0,x.jsx)(`div`,{style:{fontFamily:d},className:`text-base font-bold leading-tight`,children:`Aa Heading`}),(0,x.jsx)(`div`,{className:`text-[11px] leading-snug`,style:{color:a},children:`The quick brown fox jumps over the lazy dog.`}),(0,x.jsxs)(`div`,{className:`mt-1 flex min-w-0 items-center gap-1.5`,children:[(0,x.jsx)(`span`,{style:{background:o,color:n,borderRadius:l},className:`shrink-0 px-2.5 py-1 text-[10px] font-semibold`,children:`Primary`}),(0,x.jsx)(`span`,{style:{border:`1px solid ${c}`,color:i,borderRadius:l},className:`shrink-0 px-2 py-1 text-[10px]`,children:`Ghost`}),(0,x.jsx)(`span`,{style:{background:s,color:n,borderRadius:`999px`},className:`ml-auto shrink-0 px-2 py-0.5 text-[9px] font-semibold`,children:`Badge`})]}),(0,x.jsx)(`div`,{style:{border:`1px solid ${c}`,borderRadius:l,color:a},className:`text-[10px] px-2 py-1.5 mt-1`,children:`Input field…`})]})]})}function E({kit:e,overrides:t,onSet:n}){let[r,i]=(0,m.useState)(`light`),{t:a}=c(),o=w(r===`light`?e.light:e.dark,t,r);return(0,x.jsxs)(`div`,{className:`mt-1 rounded-lg border border-border/60 p-2 bg-muted/30`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,x.jsx)(`span`,{className:`text-[10px] font-semibold uppercase text-muted-foreground`,children:a(`activity:design.colors`)}),(0,x.jsx)(`div`,{className:`ml-auto inline-flex rounded border border-border/60 overflow-hidden`,children:[`light`,`dark`].map(e=>(0,x.jsx)(`button`,{type:`button`,onClick:()=>i(e),className:d(`text-[10px] px-1.5 py-0.5`,r===e?`bg-primary text-primary-foreground`:`text-muted-foreground`),children:e},e))})]}),(0,x.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:C.filter(e=>o[e]).map(e=>{let t=b(o[e]??``)??`#000000`;return(0,x.jsxs)(`label`,{className:`flex min-w-[2rem] flex-col items-center gap-0.5`,title:`${e}: ${o[e]}`,children:[(0,x.jsx)(`input`,{type:`color`,value:t,onChange:t=>n(`${r}.${e}`,t.target.value),className:`w-6 h-6 rounded cursor-pointer bg-transparent border border-border/60 p-0`}),(0,x.jsx)(`span`,{className:`text-[8px] text-muted-foreground`,children:e})]},e)})})]})}function D({className:e}){let{client:t}=f(),{t:n}=c(),[h,g]=(0,m.useState)([]),[_,v]=(0,m.useState)(null),[y,b]=(0,m.useState)({}),[C,D]=(0,m.useState)(`web`),[O,k]=(0,m.useState)(``),[A,j]=(0,m.useState)(null);(0,m.useEffect)(()=>{if(!t)return;let e=e=>{let t=e.payload;g(t?.kits??[]),v(t?.activeKit??null),b(t?.overrides??{})},n=e=>{let t=e.payload;t?.ok&&t.kit&&(v(t.kit),b(t.overrides??{}))},r=e=>{let t=e.payload;t?.ok&&t.overrides&&b(t.overrides)},i=e=>{let t=e.payload;j(t?.ok?u.t(`activity:design.wrote`,{path:t.path}):u.t(`activity:design.materializeFailed`,{error:t?.error??`error`}))},a=e=>{let t=e.payload;if(!t?.ok){j(u.t(`activity:design.verifyError`,{error:t?.error??`error`}));return}let n=Math.round((t.score??1)*100);j(t.violationCount?u.t(`activity:design.verifyOffPalette`,{pct:n,count:t.violationCount,files:t.filesScanned}):u.t(`activity:design.verifyClean`,{files:t.filesScanned}))};return t.on(`design.list`,e),t.on(`design.use`,n),t.on(`design.set`,r),t.on(`design.materialize`,i),t.on(`design.verify`,a),t.send({type:`design.list`}),()=>{t.off(`design.list`,e),t.off(`design.use`,n),t.off(`design.set`,r),t.off(`design.materialize`,i),t.off(`design.verify`,a)}},[t]);let M=(0,m.useCallback)(e=>t?.send({type:`design.use`,payload:{kit:e,stack:C}}),[t,C]),N=(0,m.useCallback)((e,n)=>{b(t=>({...t,[e]:n})),t?.send({type:`design.set`,payload:{overrides:{[e]:n}}})},[t]),P=(0,m.useCallback)(()=>{j(u.t(`activity:design.writing`)),t?.send({type:`design.materialize`,payload:{stack:C}})},[t,C]),F=(0,m.useCallback)(()=>{j(u.t(`activity:design.scanning`)),t?.send({type:`design.verify`})},[t]),I=(0,m.useMemo)(()=>{let e=O.trim().toLowerCase();return[...e?h.filter(t=>t.id.includes(e)||t.name.toLowerCase().includes(e)||t.aesthetic.toLowerCase().includes(e)||t.tags.some(t=>t.includes(e))):h].sort((e,t)=>e.name.localeCompare(t.name))},[h,O]);return(0,x.jsxs)(`div`,{className:d(`flex h-full min-h-0 min-w-0 flex-col overflow-hidden bg-[hsl(var(--surface-2)/0.45)]`,e),children:[(0,x.jsx)(`div`,{className:`border-b border-border/60 p-3`,children:(0,x.jsx)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-3 shadow-sm`,children:(0,x.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center`,children:[(0,x.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,x.jsx)(r,{className:`h-4 w-4`})}),(0,x.jsxs)(`div`,{className:`min-w-0`,children:[(0,x.jsx)(`h2`,{className:`truncate text-sm font-semibold`,children:n(`activity:design.heading`)}),(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`activity:design.kitsCount`,{count:I.length})})]})]}),(0,x.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-2 sm:flex-row sm:items-center lg:justify-end`,children:[(0,x.jsxs)(`label`,{className:`relative min-w-0 flex-1 sm:max-w-xs`,children:[(0,x.jsx)(i,{className:`pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/70`}),(0,x.jsx)(`input`,{value:O,onChange:e=>k(e.target.value),placeholder:n(`activity:design.searchPlaceholder`),className:`h-9 w-full rounded-md border border-border/70 bg-background/70 pl-8 pr-3 text-sm shadow-sm outline-none transition focus:border-primary/40 focus:ring-2 focus:ring-ring/30`})]}),(0,x.jsx)(`select`,{value:C,onChange:e=>D(e.target.value),className:`h-9 rounded-md border border-border/70 bg-background/70 px-2 text-sm shadow-sm`,title:n(`activity:design.stackTitle`),children:S.map(e=>(0,x.jsx)(`option`,{value:e,children:e},e))}),A&&(0,x.jsx)(`span`,{className:`min-w-0 truncate rounded-md border border-border/60 bg-muted/40 px-2 py-1 text-[11px] text-muted-foreground sm:max-w-56`,children:A}),(0,x.jsx)(`button`,{type:`button`,onClick:()=>p(`chat`),className:`inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,title:n(`common:action.close`),children:(0,x.jsx)(o,{className:`h-4 w-4`})})]})]})})}),(0,x.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto p-3 sm:p-4`,children:I.length===0?(0,x.jsxs)(`div`,{className:`ws-surface mx-auto mt-8 flex max-w-md flex-col items-center gap-3 rounded-xl p-6 text-center text-muted-foreground`,children:[(0,x.jsx)(r,{className:`h-8 w-8 text-primary/60`}),(0,x.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:n(`activity:design.kitsCount`,{count:0})}),(0,x.jsx)(`p`,{className:`text-xs`,children:n(`activity:design.searchPlaceholder`)})]}):(0,x.jsx)(`div`,{className:`grid gap-4 [grid-template-columns:repeat(auto-fill,minmax(min(100%,20rem),1fr))]`,children:I.map(e=>{let t=_===e.id,r=t?y:{};return(0,x.jsxs)(`div`,{className:d(`flex min-w-0 flex-col overflow-hidden rounded-xl border bg-card/75 shadow-sm`,t?`border-primary/60 ring-1 ring-primary/30`:`border-border/70`),children:[(0,x.jsxs)(`div`,{className:`grid min-h-[12rem] grid-cols-1 sm:grid-cols-2`,children:[(0,x.jsx)(T,{t:w(e.light,r,`light`),label:n(`activity:designStudio.light`)}),(0,x.jsx)(T,{t:w(e.dark,r,`dark`),label:n(`activity:designStudio.dark`)})]}),(0,x.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 border-t border-border/60 bg-card p-3`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,x.jsx)(`h3`,{className:`text-sm font-semibold truncate`,children:e.name}),(0,x.jsx)(`code`,{className:`text-[10px] text-muted-foreground`,children:e.id}),t&&(0,x.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 text-[9px] font-semibold uppercase text-primary ml-auto`,children:[(0,x.jsx)(l,{className:`w-3 h-3`}),` `,n(`activity:design.active`)]})]}),(0,x.jsx)(`p`,{className:`text-[11px] text-muted-foreground leading-snug`,children:e.aesthetic}),(0,x.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2`,children:[(0,x.jsx)(`button`,{type:`button`,onClick:()=>M(e.id),className:d(`rounded-md px-2.5 py-1 text-[11px] font-medium transition`,t?`bg-primary/10 text-primary`:`bg-primary text-primary-foreground hover:opacity-90`),children:n(t?`activity:design.reapply`:`activity:design.use`)}),t&&(0,x.jsxs)(`button`,{type:`button`,onClick:P,className:`inline-flex items-center gap-1 rounded-md border border-border/60 px-2 py-1 text-[11px] font-medium hover:bg-muted`,title:n(`activity:design.materializeTitle`,{stack:C}),children:[(0,x.jsx)(s,{className:`w-3 h-3`}),` `,n(`activity:design.materialize`)]}),t&&(0,x.jsxs)(`button`,{type:`button`,onClick:F,className:`inline-flex items-center gap-1 rounded-md border border-border/60 px-2 py-1 text-[11px] font-medium hover:bg-muted`,title:n(`activity:design.verifyTitle`),children:[(0,x.jsx)(a,{className:`w-3 h-3`}),` `,n(`activity:design.verify`)]}),(0,x.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[10px] text-muted-foreground`,children:e.bestFor})]}),t&&(0,x.jsx)(E,{kit:e,overrides:r,onSet:N})]})]},e.id)})})})]})}export{D as DesignGalleryView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-BRAejDWd.js";import{Bt as r,Cr as i,Fr as a,Gt as o,It as s,Kt as c,Lt as l,Pt as u,Tt as d,X as f,Xt as p,at as m,bt as h,dr as g,dt as _,jt as v,nn as y,ri as b,wr as x,zr as S}from"./vendor-B51hXwIj.js";import{t as C}from"./ws-client-Bbu1u6TM.js";import{t as w}from"./session-store-zbDVE9MI.js";import{t as T}from"./utils-C9L1kxOy.js";import{J as E,f as D,k as O,nt as k}from"./index-BwLKTDt1.js";var A=e(t(),1);function j(e){let t=k(e=>e.wsUrl),n=k(e=>e.provider),r=k(e=>e.model),[i,a]=(0,A.useState)([]),[o,s]=(0,A.useState)([]),[c,l]=(0,A.useState)({}),[u,d]=(0,A.useState)(``),[f,p]=(0,A.useState)(``);return(0,A.useEffect)(()=>{let e=C(t).on(`kanban.meta`,e=>{let t=e.payload?.data;t&&(a(t.tools??[]),s(t.skills??[]),l(t.fallbackProfiles??{}),t.sessionProvider&&d(t.sessionProvider),t.sessionModel&&p(t.sessionModel))});return()=>e()},[t]),(0,A.useEffect)(()=>{e&&C(t).send({type:`kanban.meta`})},[e,t]),{tools:i,skills:o,fallbackProfiles:c,sessionProvider:u||n,sessionModel:f||r}}var M=n();function N({options:e,selected:t,onChange:n,placeholder:r,emptyLabel:a}){let[s,c]=(0,A.useState)(!1),[l,u]=(0,A.useState)(``),d=(0,A.useRef)(null);(0,A.useEffect)(()=>{if(!s)return;let e=e=>{d.current&&!d.current.contains(e.target)&&c(!1)};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[s]);let p=(0,A.useMemo)(()=>{let t=new Map(e.map(e=>[e.value,e.label]));return e=>t.get(e)??e},[e]),m=(0,A.useMemo)(()=>{let t=l.trim().toLowerCase();return(t?e.filter(e=>`${e.value} ${e.label} ${e.tag??``}`.toLowerCase().includes(t)):e).slice(0,80)},[e,l]),h=e=>{n(t.includes(e)?t.filter(t=>t!==e):[...t,e])};return(0,M.jsxs)(`div`,{ref:d,className:`relative`,children:[t.length>0&&(0,M.jsx)(`div`,{className:`mb-1 flex flex-wrap gap-1`,children:t.map(e=>(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-[11px]`,children:[(0,M.jsx)(`span`,{className:`max-w-[150px] truncate`,children:p(e)}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>h(e),className:`text-muted-foreground hover:text-destructive`,"aria-label":`Remove ${p(e)}`,children:(0,M.jsx)(f,{size:11})})]},e))}),(0,M.jsxs)(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`flex w-full items-center gap-1.5 rounded-md border border-border bg-muted px-2 py-1.5 text-left text-xs transition-colors hover:border-primary/45 hover:bg-muted/80`,children:[(0,M.jsx)(o,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,M.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,children:r??`Add…`}),(0,M.jsx)(i,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`})]}),s&&(0,M.jsxs)(`div`,{className:`absolute z-50 mt-1 max-h-72 w-full min-w-[240px] overflow-hidden rounded-md border border-border/80 bg-popover shadow-xl`,children:[(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-border/70 bg-muted/20 px-2 py-1.5`,children:[(0,M.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),placeholder:`Filter…`,className:`min-w-0 flex-1 bg-transparent text-xs outline-none placeholder:text-muted-foreground`}),l&&(0,M.jsx)(`button`,{type:`button`,onClick:()=>u(``),className:`text-muted-foreground hover:text-foreground`,children:(0,M.jsx)(f,{className:`h-3 w-3`})})]}),(0,M.jsxs)(`div`,{className:`max-h-60 overflow-y-auto py-1`,children:[m.map(e=>{let n=t.includes(e.value);return(0,M.jsxs)(`button`,{type:`button`,onClick:()=>h(e.value),className:T(`flex w-full items-start gap-1.5 px-2 py-1.5 text-left text-xs transition-colors hover:bg-muted`,n?`bg-primary/8 text-primary`:`text-foreground`),children:[n?(0,M.jsx)(x,{className:`mt-0.5 h-3 w-3 shrink-0 text-primary`}):(0,M.jsx)(`span`,{className:`w-3 shrink-0`}),(0,M.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,M.jsx)(`span`,{className:`block truncate`,children:e.label}),e.description&&(0,M.jsx)(`span`,{className:`mt-0.5 block truncate text-[10px] text-muted-foreground`,children:e.description})]}),e.tag&&(0,M.jsx)(`span`,{className:`mt-0.5 shrink-0 font-mono text-[9px] text-muted-foreground`,children:e.tag})]},e.value)}),m.length===0&&(0,M.jsx)(`div`,{className:`px-2 py-3 text-center text-[11px] text-muted-foreground`,children:e.length===0?a??`Nothing available`:`No match`})]})]})]})}function P({board:e,snapshot:t,sendKanban:n}){let[r,a]=(0,A.useState)(!1),[o,s]=(0,A.useState)(!0),[c,l]=(0,A.useState)(`deterministic`),[f,p]=(0,A.useState)(`session`),[m,h]=(0,A.useState)(``),[g,_]=(0,A.useState)(``),[v,y]=(0,A.useState)(``),[b,x]=(0,A.useState)([]),[C,w]=(0,A.useState)([]),[E,k]=(0,A.useState)(10),P=O(r&&c===`agentic`),F=j(r&&c===`agentic`);(0,A.useEffect)(()=>{let t=e.supervisor;s(t?.enabled??!0),l(t?.mode??`deterministic`),p(t?.routing?.mode??`session`),h(t?.routing?.provider??``),_(t?.routing?.model??``),y(t?.routing?.fallbackProfile??``),x(t?.routing?.fallbackModels??[]),w(t?.skills??[]),k(Math.max(2,Math.round((t?.intervalMs??1e4)/1e3)))},[e.id,e.supervisor]);let I=()=>{let t={mode:f,...f===`fixed`&&m?{provider:m}:{},...f===`fixed`&&g?{model:g}:{},...f===`fallback_profile`&&v?{fallbackProfile:v}:{},...b.length?{fallbackModels:b}:{}};n(`kanban.update`,{boardId:e.id,supervisor:{enabled:o,mode:c,intervalMs:Math.max(2,E)*1e3,recoveryMode:`auto`,...c===`agentic`?{routing:t,skills:C}:{}}}),window.setTimeout(()=>n(`kanban.supervisor.audit`,{boardId:e.id}),150)},L=o?t?.status??`starting`:`disabled`;return(0,M.jsxs)(`div`,{className:`shrink-0 border-b bg-background/80`,children:[(0,M.jsxs)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`flex w-full items-center gap-2 px-4 py-1.5 text-left text-[11px] hover:bg-muted/40`,children:[(0,M.jsx)(d,{size:13,className:L===`healthy`?`text-success`:`text-warning`}),(0,M.jsx)(`span`,{className:`font-semibold`,children:`Kanban Agent`}),(0,M.jsxs)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 capitalize text-muted-foreground`,children:[c,` · `,L]}),t?.summary&&(0,M.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,children:t.summary}),(0,M.jsx)(`span`,{className:`ml-auto text-muted-foreground`,children:t?.lastAuditAt?`checked ${H(t.lastAuditAt)} ago`:`not checked`}),(0,M.jsx)(i,{size:13,className:T(`transition-transform`,r&&`rotate-180`)})]}),r&&(0,M.jsxs)(`div`,{className:`grid gap-3 border-t p-3 text-xs lg:grid-cols-[220px_220px_1fr_auto]`,children:[(0,M.jsxs)(`label`,{className:`flex items-center gap-2 rounded-md border bg-card px-2 py-2`,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:o,onChange:e=>s(e.target.checked)}),(0,M.jsx)(`span`,{children:`Watch this board`})]}),(0,M.jsx)(G,{label:`Supervisor engine`,value:c,options:[`deterministic`,`agentic`],onChange:e=>l(e)}),(0,M.jsxs)(`label`,{className:`block`,children:[(0,M.jsx)(`span`,{className:`mb-1 block text-[11px] font-medium text-muted-foreground`,children:`Audit interval (seconds)`}),(0,M.jsx)(`input`,{type:`number`,min:2,value:E,onChange:e=>k(Number(e.target.value)||2),className:`h-8 w-full rounded-md border bg-background px-2 outline-none focus:border-primary`})]}),(0,M.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,M.jsxs)(`button`,{type:`button`,onClick:I,className:`inline-flex h-8 items-center gap-1 rounded-md bg-primary px-3 text-primary-foreground`,children:[(0,M.jsx)(u,{size:13}),` Save`]}),(0,M.jsxs)(`button`,{type:`button`,onClick:()=>n(`kanban.supervisor.audit`,{boardId:e.id}),className:`inline-flex h-8 items-center gap-1 rounded-md border px-3 hover:bg-muted`,children:[(0,M.jsx)(S,{size:13}),` Audit now`]})]}),c===`deterministic`?(0,M.jsx)(`div`,{className:`lg:col-span-4 rounded-md border border-success/20 bg-success/5 px-3 py-2 text-muted-foreground`,children:`Deterministic mode uses no provider, model, token, or billing. It repairs assignment/status/column drift and recovers expired leases.`}):(0,M.jsxs)(`div`,{className:`grid gap-3 lg:col-span-4 lg:grid-cols-2`,children:[(0,M.jsx)(G,{label:`Kanban Agent model source`,value:f,options:[`session`,`fixed`,`fallback_profile`],onChange:e=>p(e)}),f===`fixed`&&(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{className:`mb-1 block text-[11px] font-medium text-muted-foreground`,children:`Fixed provider / model`}),(0,M.jsx)(D,{value:g||void 0,provider:m||void 0,candidates:P,placeholder:`Select exact provider / model…`,onPick:(e,t)=>{_(e),h(t)}})]}),f===`fallback_profile`&&(0,M.jsx)(G,{label:`Fallback profile (first model is primary)`,value:v,options:Object.keys(F.fallbackProfiles),placeholder:`Select configured profile…`,onChange:y}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{className:`mb-1 block text-[11px] font-medium text-muted-foreground`,children:`Supervisor skills`}),(0,M.jsx)(N,{options:F.skills.map(e=>({value:e.name,label:e.name,description:e.description,tag:e.source})),selected:C,onChange:w,placeholder:`Force-load agentic skills…`})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{className:`mb-1 block text-[11px] font-medium text-muted-foreground`,children:`Extra fallback models`}),(0,M.jsx)(N,{options:P.map(e=>({value:`${e.provider}/${e.model}`,label:e.label,tag:e.provider})),selected:b,onChange:x,placeholder:`Optional ordered fallbacks…`})]})]})]})]})}function F(e){let t=e?.tags??[],n=t.includes(`sdd`)?`sdd`:t.includes(`autophase`)?`autophase`:null;if(!n)return null;let r=t.find(e=>e.startsWith(`run:`))?.slice(4);return{engine:n,...r?{runId:r}:{}}}function I({onClose:e}){let t=k(e=>e.wsUrl),n=w(e=>e.session?.id??null),{boards:i,activeBoardId:s,activeBoard:c,loading:l,error:u,queueHealth:d,supervisorSnapshot:p,setLoading:m,setActiveBoardId:h}=E(),[v,y]=(0,A.useState)(``),[x,S]=(0,A.useState)(``),[D,O]=(0,A.useState)(``),[j,N]=(0,A.useState)(null),[I,ee]=(0,A.useState)(null),te=(0,A.useRef)(null),B=(0,A.useMemo)(()=>C(t),[t]),re=c?.tasks.find(e=>e.id===j)??null,V=(0,A.useMemo)(()=>c?c.tasks.filter(e=>e.status===`in_progress`||e.assignment?.status===`running`||e.assignment?.status===`queued`).reduce((e,t)=>e+(t.costCeilingUsd??0),0):0,[c]),H=(e,t={})=>{m(!0),B.send({type:e,payload:t})},ie=(e,t={})=>{B.send({type:e,payload:t})},U=(0,A.useMemo)(()=>F(c),[c]),W=()=>H(`kanban.list`),G=(e=s)=>{e&&H(`kanban.get`,{boardId:e})};(0,A.useEffect)(()=>{W()},[]),(0,A.useEffect)(()=>{let e=n?i.find(e=>e.tags?.includes(`session:${n}`)):void 0,t=!!(n&&e)&&te.current!==n,r=t?e:s?void 0:i[0];r?.id&&(t&&(te.current=n),h(r.id),H(`kanban.get`,{boardId:r.id}))},[i,s,n,h]),(0,A.useEffect)(()=>{c&&j&&!c.tasks.some(e=>e.id===j)&&N(null)},[c,j]),(0,A.useEffect)(()=>{s&&(H(`kanban.health`,{boardId:s}),H(`kanban.supervisor.status`,{boardId:s}))},[s]),(0,A.useEffect)(()=>{if(!s)return;let e=setInterval(()=>{B.send({type:`kanban.get`,payload:{boardId:s}}),B.send({type:`kanban.health`,payload:{boardId:s}}),B.send({type:`kanban.supervisor.status`,payload:{boardId:s}})},3e3);return()=>clearInterval(e)},[s,B]),(0,A.useEffect)(()=>{let e=setInterval(()=>{B.send({type:`kanban.list`})},4e3);return()=>clearInterval(e)},[B]);let K=()=>{let e=v.trim();e&&(y(``),H(`kanban.create`,{title:e}))},q=()=>{if(!c)return;let e=x.trim();e&&(S(``),H(`kanban.task.add`,{boardId:c.id,title:e,columnId:c.columns[0]?.id??`backlog`}),window.setTimeout(()=>G(c.id),150))},J=()=>{if(!c)return;let e=D.trim();e&&(O(``),H(`kanban.column.add`,{boardId:c.id,title:e}),window.setTimeout(()=>G(c.id),150))},Y=()=>{c&&(H(`kanban.delete`,{boardId:c.id}),window.setTimeout(W,150))},ae=()=>{c&&(H(`kanban.duplicate`,{boardId:c.id,title:`${c.title} Copy`}),window.setTimeout(W,150))},X=e=>{c&&(H(`kanban.task.remove`,{boardId:c.id,taskId:e.id}),window.setTimeout(()=>G(c.id),150))},Z=(e,t)=>{c&&(H(`kanban.task.move`,{boardId:c.id,taskId:e,columnId:t}),window.setTimeout(()=>G(c.id),150))};return(0,M.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background text-foreground md:flex-row`,children:[(0,M.jsxs)(`aside`,{className:`flex max-h-[45dvh] w-full shrink-0 flex-col border-b bg-card/40 md:max-h-none md:w-[280px] md:border-b-0 md:border-r`,children:[(0,M.jsxs)(`div`,{className:`flex h-12 items-center gap-2 border-b px-3`,children:[(0,M.jsx)(`button`,{type:`button`,title:`Back`,onClick:e,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,M.jsx)(a,{size:16})}),(0,M.jsx)(b,{size:17,className:`text-primary`}),(0,M.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,M.jsx)(`div`,{className:`truncate text-sm font-semibold`,children:`Kanban`}),(0,M.jsxs)(`div`,{className:`truncate text-[11px] text-muted-foreground`,children:[i.length,` boards`]})]}),(0,M.jsx)(`button`,{type:`button`,title:`Refresh`,onClick:W,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,M.jsx)(r,{size:15,className:l?`animate-spin`:void 0})})]}),(0,M.jsxs)(`div`,{className:`flex gap-1 border-b p-2`,children:[(0,M.jsx)(`input`,{value:v,onChange:e=>y(e.target.value),onKeyDown:e=>{e.key===`Enter`&&K()},placeholder:`New board`,className:`min-w-0 flex-1 rounded-md border bg-background px-2 py-1.5 text-sm outline-none focus:border-primary`}),(0,M.jsx)(`button`,{type:`button`,title:`Create board`,onClick:K,className:`flex h-8 w-8 items-center justify-center rounded-md bg-primary text-primary-foreground hover:bg-primary/90`,children:(0,M.jsx)(o,{size:16})})]}),(0,M.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-2`,children:i.map(e=>(0,M.jsxs)(`button`,{type:`button`,onClick:()=>{h(e.id),H(`kanban.get`,{boardId:e.id})},className:T(`mb-1 w-full rounded-md px-2 py-2 text-left transition-colors`,s===e.id?`bg-primary/10 text-foreground`:`text-muted-foreground hover:bg-muted hover:text-foreground`),children:[(0,M.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e.title}),(0,M.jsxs)(`div`,{className:`mt-0.5 flex items-center justify-between text-[11px]`,children:[(0,M.jsxs)(`span`,{children:[e.taskCount,` tasks`]}),(0,M.jsxs)(`span`,{children:[e.completedTaskCount,` done`]})]})]},e.id))})]}),(0,M.jsxs)(`main`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,M.jsxs)(`header`,{className:`flex min-h-12 shrink-0 flex-wrap items-center gap-2 border-b px-3 py-2 sm:px-4`,children:[(0,M.jsxs)(`div`,{className:`w-full min-w-0 sm:w-auto sm:flex-1`,children:[(0,M.jsx)(`div`,{className:`truncate text-sm font-semibold`,children:c?.title??`No board selected`}),(0,M.jsx)(`div`,{className:`truncate text-[11px] text-muted-foreground`,children:c?`${c.columns.length} columns / ${c.tasks.length} tasks`:`Create or select a board`})]}),c&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`input`,{value:x,onChange:e=>S(e.target.value),onKeyDown:e=>{e.key===`Enter`&&q()},placeholder:`New task`,className:`h-8 w-[calc(100%-2.5rem)] min-w-0 flex-none rounded-md border bg-background px-2 text-sm outline-none focus:border-primary sm:w-56`}),(0,M.jsx)(`button`,{type:`button`,title:`Add task`,onClick:q,className:`flex h-8 w-8 items-center justify-center rounded-md bg-primary text-primary-foreground hover:bg-primary/90`,children:(0,M.jsx)(o,{size:16})}),(0,M.jsx)(`input`,{value:D,onChange:e=>O(e.target.value),onKeyDown:e=>{e.key===`Enter`&&J()},placeholder:`New column`,className:`h-8 w-[calc(100%-2.5rem)] min-w-0 flex-none rounded-md border bg-background px-2 text-sm outline-none focus:border-primary sm:w-44`}),(0,M.jsx)(`button`,{type:`button`,title:`Add column`,onClick:J,className:`hidden h-8 w-8 items-center justify-center rounded-md border text-muted-foreground hover:bg-muted hover:text-foreground sm:flex`,children:(0,M.jsx)(b,{size:16})}),(0,M.jsx)(`button`,{type:`button`,title:`Duplicate board`,onClick:ae,className:`flex h-8 w-8 items-center justify-center rounded-md border text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,M.jsx)(g,{size:16})}),(0,M.jsx)(`button`,{type:`button`,title:`Delete board`,onClick:Y,className:`hidden h-8 w-8 items-center justify-center rounded-md border text-muted-foreground hover:bg-destructive/10 hover:text-destructive sm:flex`,children:(0,M.jsx)(_,{size:16})})]})]}),c&&U&&(0,M.jsx)(L,{runLink:U,sendRaw:ie}),c&&!U&&c.tasks.length>0&&(0,M.jsx)(R,{boardId:c.id,sendKanban:H}),c&&(0,M.jsx)(P,{board:c,snapshot:p,sendKanban:H}),u&&(0,M.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-2 border-b border-destructive/30 bg-destructive/10 px-4 text-sm text-destructive`,children:[(0,M.jsx)(f,{size:15}),(0,M.jsx)(`span`,{className:`truncate`,children:u})]}),(0,M.jsx)(`div`,{className:`kanban-scroll-area min-h-0 flex-1 overflow-x-auto overflow-y-hidden`,children:c?(0,M.jsxs)(M.Fragment,{children:[d&&(0,M.jsxs)(`div`,{className:`flex shrink-0 items-center gap-4 border-b px-4 py-2 text-xs text-muted-foreground`,children:[(0,M.jsx)(`span`,{className:`font-medium text-foreground`,children:`Queue health`}),d.counts.ready>0&&(0,M.jsxs)(`span`,{title:`Claimable tasks`,className:`inline-flex items-center gap-1 text-success`,children:[d.counts.ready,` ready`]}),d.counts.running>0&&(0,M.jsxs)(`span`,{title:`Running assignments`,className:`inline-flex items-center gap-1 text-warning`,children:[d.counts.running,` running`]}),d.counts.review>0&&(0,M.jsxs)(`span`,{title:`In review`,className:`inline-flex items-center gap-1 text-primary`,children:[d.counts.review,` review`]}),d.counts.blocked>0&&(0,M.jsxs)(`span`,{title:`Manually blocked`,className:`inline-flex items-center gap-1 text-destructive`,children:[d.counts.blocked,` blocked`]}),d.counts.failed>0&&(0,M.jsxs)(`span`,{title:`Failed tasks`,className:`inline-flex items-center gap-1 text-destructive`,children:[d.counts.failed,` failed`]}),d.dependencyBlocked.count>0&&(0,M.jsxs)(`span`,{title:`Ready/pending tasks blocked by dependencies`,className:`inline-flex items-center gap-1 rounded bg-warning/10 px-1.5 py-0.5 text-warning`,children:[d.dependencyBlocked.count,` blocked by deps`]}),d.staleAssignments.count>0&&(0,M.jsxs)(`span`,{title:`Expired lease assignments`,className:`inline-flex items-center gap-1 rounded bg-destructive/10 px-1.5 py-0.5 text-destructive`,children:[d.staleAssignments.count,` stale`]}),d.heartbeatDue.count===0&&d.staleAssignments.count===0&&d.dependencyBlocked.count===0&&(0,M.jsx)(`span`,{className:`text-success`,children:`healthy`}),V>0&&(0,M.jsxs)(`span`,{title:`Sum of costCeilingUsd for running/queued tasks`,className:`inline-flex items-center gap-1 text-info`,children:[`~$`,V.toFixed(2),` running cost`]})]}),(0,M.jsx)(`div`,{className:`flex h-full min-w-max gap-3 p-4`,children:[...c.columns].sort((e,t)=>e.order-t.order).map(e=>(0,M.jsx)(z,{board:c,column:e,selectedTaskId:j,dragTaskId:I,setDragTaskId:ee,onSelectTask:N,onDeleteTask:X,onMoveTask:Z},e.id))})]}):(0,M.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`No kanban board selected.`})})]}),(0,M.jsx)(ne,{boards:i,board:c,task:re,runLink:U,onClose:()=>N(null),sendKanban:H,sendRaw:ie,refreshBoard:G})]})}function L({runLink:e,sendRaw:t}){let n=e.engine===`sdd`,r=n?`sdd.board`:`autophase`,i=`inline-flex items-center gap-1 rounded-md border px-2 py-1 text-[11px] font-medium hover:bg-muted`;return(0,M.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-b bg-primary/5 px-4 py-1.5`,children:[(0,M.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-primary/15 px-1.5 py-0.5 text-[10px] font-semibold uppercase text-primary`,children:[(0,M.jsx)(l,{size:11}),` `,e.engine]}),(0,M.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:`Live run — steer it from here`}),(0,M.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,M.jsxs)(`button`,{type:`button`,className:i,onClick:()=>t(`${r}.pause`),children:[(0,M.jsx)(p,{size:12}),` Pause`]}),(0,M.jsxs)(`button`,{type:`button`,className:i,onClick:()=>t(`${r}.resume`),children:[(0,M.jsx)(c,{size:12}),` Resume`]}),n&&(0,M.jsxs)(`button`,{type:`button`,className:i,onClick:()=>t(`sdd.board.retry_all_failed`),children:[(0,M.jsx)(s,{size:12}),` Retry failed`]}),(0,M.jsxs)(`button`,{type:`button`,className:T(i,`text-destructive hover:bg-destructive/10`),onClick:()=>t(`${r}.stop`),children:[(0,M.jsx)(h,{size:12}),` Stop`]})]})]})}function R({boardId:e,sendKanban:t}){let n=`inline-flex items-center gap-1 rounded-md border px-2 py-1 text-[11px] font-medium text-primary hover:bg-primary/10`;return(0,M.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-2 border-b bg-muted/30 px-4 py-1.5`,children:[(0,M.jsx)(l,{size:13,className:`text-primary`}),(0,M.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:`Run this board as a live agent job:`}),(0,M.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,M.jsx)(`button`,{type:`button`,className:n,onClick:()=>t(`kanban.run.start`,{boardId:e,engine:`autophase`}),children:`Start as AutoPhase`}),(0,M.jsx)(`button`,{type:`button`,className:n,onClick:()=>t(`kanban.run.start`,{boardId:e,engine:`sdd`}),children:`Start as SDD`})]})]})}function ee({runLink:e,runTaskId:t,modelCandidates:n,sendRaw:r}){let i=e.engine===`sdd`,[a,o]=(0,A.useState)(!1),[l,u]=(0,A.useState)(``),d=`inline-flex flex-1 items-center justify-center gap-1 rounded-md border py-1.5 text-xs font-medium hover:bg-muted`,p=()=>{let e=l.trim();e&&(r(i?`sdd.board.reassign`:`autophase.assignTask`,{taskId:t,agentName:e}),o(!1),u(``))};return(0,M.jsxs)(`div`,{className:`mt-4 rounded-md border bg-primary/5 p-2.5`,children:[(0,M.jsx)(`div`,{className:`mb-2 text-[10px] font-semibold uppercase tracking-wide text-primary`,children:`Run controls`}),i&&(0,M.jsxs)(`div`,{className:`mb-2`,children:[(0,M.jsx)(`div`,{className:`mb-1 text-[10px] uppercase text-muted-foreground`,children:`Worker model`}),(0,M.jsx)(D,{candidates:n,placeholder:`Set model for this task…`,onPick:(e,n)=>r(`sdd.board.set_task_model`,{taskId:t,model:e,provider:n})})]}),a?(0,M.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,M.jsx)(`input`,{value:l,onChange:e=>u(e.target.value),onKeyDown:e=>{e.key===`Enter`&&p(),e.key===`Escape`&&o(!1)},placeholder:`New worker name`,className:`min-w-0 flex-1 rounded-md border bg-background px-2 py-1.5 text-xs outline-none focus:border-primary`}),(0,M.jsx)(`button`,{type:`button`,onClick:p,className:`rounded-md bg-primary/10 px-2 py-1.5 text-primary`,children:(0,M.jsx)(x,{size:14})}),(0,M.jsx)(`button`,{type:`button`,onClick:()=>o(!1),className:`rounded-md bg-muted px-2 py-1.5`,children:(0,M.jsx)(f,{size:14})})]}):(0,M.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,M.jsxs)(`button`,{type:`button`,className:d,onClick:()=>r(i?`sdd.board.retry`:`autophase.retryTask`,{taskId:t}),children:[(0,M.jsx)(s,{size:13}),` Retry`]}),(0,M.jsxs)(`button`,{type:`button`,className:d,onClick:()=>o(!0),children:[(0,M.jsx)(m,{size:13}),` Reassign`]}),i?(0,M.jsxs)(`button`,{type:`button`,className:T(d,`text-destructive hover:bg-destructive/10`),onClick:()=>r(`sdd.board.cancel_task`,{taskId:t}),children:[(0,M.jsx)(h,{size:13}),` Cancel`]}):(0,M.jsxs)(`button`,{type:`button`,className:d,onClick:()=>r(`autophase.runTask`,{taskId:t}),children:[(0,M.jsx)(c,{size:13}),` Run now`]})]})]})}function z({board:e,column:t,selectedTaskId:n,dragTaskId:r,setDragTaskId:i,onSelectTask:a,onDeleteTask:o,onMoveTask:s}){let c=e.tasks.filter(e=>e.columnId===t.id).sort((e,t)=>e.order-t.order);return(0,M.jsxs)(`section`,{className:T(`flex h-full shrink-0 flex-col rounded-md border bg-muted/25 transition-[width] duration-200`,c.length===0?`w-[180px]`:`w-[310px]`),children:[(0,M.jsxs)(`div`,{className:`flex h-10 shrink-0 items-center gap-2 border-b px-3`,children:[(0,M.jsx)(`span`,{className:`h-2.5 w-2.5 rounded-full`,style:{background:t.color??`hsl(var(--primary))`}}),(0,M.jsx)(`div`,{className:`min-w-0 flex-1 truncate text-sm font-semibold`,children:t.title}),(0,M.jsx)(`span`,{className:`rounded bg-background px-1.5 py-0.5 text-[11px] text-muted-foreground`,children:c.length})]}),(0,M.jsx)(`ul`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto p-2`,onDragOver:e=>e.preventDefault(),onDrop:e=>{e.preventDefault(),r&&s(r,t.id),i(null)},children:c.map(e=>(0,M.jsxs)(`li`,{draggable:!0,onDragStart:()=>i(e.id),onDragEnd:()=>i(null),className:T(`relative rounded-md border bg-background p-3 shadow-sm transition-colors`,n===e.id?`border-primary`:`hover:border-primary/50`),children:[(0,M.jsx)(`button`,{type:`button`,"aria-label":`Select task: ${e.title}`,onClick:()=>a(e.id),className:`absolute inset-0 cursor-pointer rounded-md`}),(0,M.jsxs)(`div`,{className:`pointer-events-none relative flex items-start gap-2`,children:[(0,M.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,M.jsx)(`div`,{className:`line-clamp-2 text-sm font-medium leading-5`,children:e.title}),e.description&&(0,M.jsx)(`div`,{className:`mt-1 line-clamp-2 text-xs leading-4 text-muted-foreground`,children:e.description})]}),(0,M.jsx)(`button`,{type:`button`,title:`Delete task`,"aria-label":`Delete task: ${e.title}`,onClick:()=>o(e),className:`pointer-events-auto relative flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-destructive/10 hover:text-destructive`,children:(0,M.jsx)(_,{size:14})})]}),(0,M.jsxs)(`div`,{className:`pointer-events-none relative mt-2 flex flex-wrap items-center gap-1.5 text-[11px]`,children:[(0,M.jsx)(`span`,{className:K(e.priority),children:e.priority}),(0,M.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 text-muted-foreground`,children:e.status}),e.assignedAgent&&(0,M.jsx)(`span`,{className:`rounded bg-primary/10 px-1.5 py-0.5 text-primary`,children:e.assignedAgent}),e.assignment?.model&&(0,M.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 text-muted-foreground`,children:e.assignment.model}),e.assignment?.modelRouting===`session`&&(0,M.jsx)(`span`,{className:`rounded bg-info/10 px-1.5 py-0.5 text-info`,children:`session model`}),e.dependsOn?.length?(0,M.jsxs)(`span`,{className:`rounded bg-warning/10 px-1.5 py-0.5 text-warning`,children:[e.dependsOn.length,` deps`]}):null,e.chain&&(0,M.jsxs)(`span`,{className:`rounded bg-primary/10 px-1.5 py-0.5 text-primary`,children:[`chain `,e.chain.order+1]}),e.assignment?.skills?.length?(0,M.jsxs)(`span`,{className:`rounded bg-success/10 px-1.5 py-0.5 text-success`,children:[e.assignment.skills.length,` skills`]}):null]})]},e.id))})]})}var te=[`architect`,`developer`,`reviewer`,`tester`,`verifier`,`security`,`documenter`,`external`,`leader`,`shadow`,`subagent`],B=[{value:`fs.read`,label:`Read files`,description:`fs.read`},{value:`fs.write`,label:`Write files (in project)`,description:`fs.write`},{value:`fs.write.outside-project`,label:`Write outside project`,description:`fs.write.outside-project`},{value:`net.outbound`,label:`Outbound network`,description:`net.outbound`},{value:`shell.exec`,label:`Run project commands`,description:`shell.exec`},{value:`shell.restricted`,label:`Restricted shell`,description:`shell.restricted`},{value:`shell.arbitrary`,label:`Arbitrary shell`,description:`shell.arbitrary`},{value:`session.todo`,label:`Session todos`,description:`session.todo`},{value:`tool.meta`,label:`Tool metadata`,description:`tool.meta`},{value:`tool.mutate.any`,label:`Invoke any tool`,description:`tool.mutate.any`},{value:`memory.read`,label:`Read memory`,description:`memory.read`},{value:`memory.write`,label:`Write memory`,description:`memory.write`},{value:`package.install`,label:`Install packages`,description:`package.install`},{value:`subagent.spawn`,label:`Spawn subagents`,description:`subagent.spawn`},{value:`config.mutate`,label:`Mutate config / trust`,description:`config.mutate`}];function ne({boards:e,board:t,task:n,runLink:r,onClose:a,sendKanban:s,sendRaw:c,refreshBoard:l}){let[d,p]=(0,A.useState)(``),[h,_]=(0,A.useState)(``),[b,S]=(0,A.useState)(``),[C,w]=(0,A.useState)(``),[E,k]=(0,A.useState)(``),[P,F]=(0,A.useState)(`session`),[I,L]=(0,A.useState)(``),[R,z]=(0,A.useState)([]),[ne,V]=(0,A.useState)([]),[H,K]=(0,A.useState)([]),[q,J]=(0,A.useState)([]),[Y,ae]=(0,A.useState)(``),X=O(!!n),Z=j(!!n),[oe,se]=(0,A.useState)(!1),[ce,le]=(0,A.useState)(``),[ue,de]=(0,A.useState)(``),[fe,pe]=(0,A.useState)(`pending`),[me,he]=(0,A.useState)(`medium`),[ge,_e]=(0,A.useState)(`chore`),[ve,ye]=(0,A.useState)(``),[be,xe]=(0,A.useState)([]),[Q,Se]=(0,A.useState)([]),[Ce,we]=(0,A.useState)(!1),[Te,Ee]=(0,A.useState)(``),[De,Oe]=(0,A.useState)(``),[ke,Ae]=(0,A.useState)(`off`),[$,je]=(0,A.useState)(``),[Me,Ne]=(0,A.useState)(``),[Pe,Fe]=(0,A.useState)(``),[Ie,Le]=(0,A.useState)(``);(0,A.useEffect)(()=>{p(n?.assignment?.agentId??n?.assignedAgent??``),_(n?.assignment?.name??``),S(n?.assignment?.role??``),w(n?.assignment?.provider??``),k(n?.assignment?.model??``),F(n?.assignment?.modelRouting??(n?.assignment?.provider||n?.assignment?.model?`fixed`:`session`)),L(n?.assignment?.fallbackProfile??``),z(n?.assignment?.fallbackModels??[]),V(n?.assignment?.skills??[]),K(n?.assignment?.tools??[]),J(n?.assignment?.allowedCapabilities??[]),ae(e.find(e=>e.id!==t?.id)?.id??``),le(n?.title??``),de(n?.description??``),pe(n?.status??`pending`),he(n?.priority??`medium`),_e(n?.type??`chore`),ye(n?.labels?.join(`, `)??``),xe(n?.dependsOn??[]),Se(n?.chain&&t?t.tasks.filter(e=>e.chain?.chainId===n.chain?.chainId).sort((e,t)=>(e.chain?.order??0)-(t.chain?.order??0)).map(e=>e.id):n?[n.id]:[]),we(!1),Ee(n?.estimatedHours?.toString()??``),Oe(n?.actualHours?.toString()??``),Ae(n?.retryPolicy??n?.assignment?.retryPolicy??`off`),je((n?.costCeilingUsd??n?.assignment?.costCeilingUsd)?.toString()??``),Ne(n?.assignment?.maxAttempts?.toString()??``),Fe(``),Le(``)},[t?.id,e,n]);let Re=()=>({boardId:t?.id,taskId:n?.id,...d.trim()?{agentId:d.trim()}:{},...h.trim()?{name:h.trim()}:{},...b.trim()?{role:b.trim()}:{},modelRouting:P,...P===`fixed`&&C.trim()?{provider:C.trim()}:{},...P===`fixed`&&E.trim()?{model:E.trim()}:{},...P===`fallback_profile`&&I.trim()?{fallbackProfile:I.trim()}:{},fallbackModels:R,skills:ne,tools:H,allowedCapabilities:q,...Me?{maxAttempts:Number(Me)}:{},...$?{costCeilingUsd:Number($)}:{},retryPolicy:ke}),ze=()=>{!t||!n||!ce.trim()||(s(`kanban.task.update`,{boardId:t.id,taskId:n.id,title:ce.trim(),description:ue,status:fe,priority:me,type:ge,labels:ve.split(`,`).map(e=>e.trim()).filter(Boolean),dependsOn:be,...n.chain&&Q.length<=1?{chain:null}:{},estimatedHours:Te?Number(Te):0,actualHours:De?Number(De):0,retryPolicy:ke,costCeilingUsd:$?Number($):null}),Q.length>1&&s(`kanban.task.chain`,{boardId:t.id,taskIds:Q,enforceDependencies:Ce}),window.setTimeout(()=>l(t.id),180))},Be=()=>{!t||!n||!Pe.trim()||(s(`kanban.task.check.add`,{boardId:t.id,taskId:n.id,description:Pe.trim(),checkType:`manual`}),Fe(``))},Ve=()=>{!t||!n||!Ie.trim()||(s(`kanban.task.note.add`,{boardId:t.id,taskId:n.id,content:Ie.trim(),author:`webui`}),Le(``))};return(0,M.jsxs)(`aside`,{className:T(`w-full shrink-0 flex-col border-t bg-card/40 md:w-[420px] md:border-l md:border-t-0 xl:w-[480px]`,n?`flex max-h-[42dvh] md:max-h-none`:`hidden md:flex`),children:[(0,M.jsxs)(`div`,{className:`flex h-12 items-center gap-2 border-b px-3`,children:[(0,M.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,M.jsx)(`div`,{className:`truncate text-sm font-semibold`,children:n?`Task`:`Selection`}),(0,M.jsx)(`div`,{className:`truncate text-[11px] text-muted-foreground`,children:n?.id.slice(0,8)??`No task selected`})]}),(0,M.jsx)(`button`,{type:`button`,title:`Close`,onClick:a,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,M.jsx)(f,{size:16})})]}),n?(0,M.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-3`,children:[(0,M.jsxs)(`div`,{className:`space-y-3 rounded-md border bg-background p-2.5`,children:[(0,M.jsx)(W,{label:`Title`,value:ce,onChange:le}),(0,M.jsxs)(`label`,{className:`block`,children:[(0,M.jsx)(`span`,{className:`mb-1 block text-[11px] font-medium text-muted-foreground`,children:`Description / working context`}),(0,M.jsx)(`textarea`,{value:ue,onChange:e=>de(e.target.value),rows:5,className:`w-full resize-y rounded-md border bg-background px-2 py-1.5 text-xs leading-5 outline-none focus:border-primary`})]}),(0,M.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,M.jsx)(G,{label:`Status`,value:fe,options:[`pending`,`ready`,`in_progress`,`blocked`,`review`,`completed`,`failed`,`archived`],onChange:e=>pe(e)}),(0,M.jsx)(G,{label:`Priority`,value:me,options:[`critical`,`high`,`medium`,`low`],onChange:e=>he(e)}),(0,M.jsx)(G,{label:`Type`,value:ge,options:[`feature`,`bugfix`,`refactor`,`docs`,`test`,`chore`],onChange:e=>_e(e)}),(0,M.jsx)(W,{label:`Labels (comma separated)`,value:ve,onChange:ye})]}),(0,M.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,M.jsx)(W,{label:`Estimated hours`,value:Te,onChange:Ee}),(0,M.jsx)(W,{label:`Actual hours`,value:De,onChange:Oe})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{className:`mb-1 block text-[11px] font-medium text-muted-foreground`,children:`Dependencies`}),(0,M.jsx)(N,{options:(t?.tasks??[]).filter(e=>e.id!==n.id).map(e=>({value:e.id,label:e.title,description:e.status})),selected:be,onChange:xe,placeholder:`Select blocking tasks…`})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{className:`mb-1 block text-[11px] font-medium text-muted-foreground`,children:`Task chain (selection order)`}),(0,M.jsx)(N,{options:(t?.tasks??[]).map(e=>({value:e.id,label:e.title,description:e.status})),selected:Q,onChange:e=>Se(e.includes(n.id)?e:[n.id,...e]),placeholder:`Add tasks to a sequential chain…`}),(0,M.jsxs)(`label`,{className:`mt-1.5 flex items-center gap-2 text-[11px] text-muted-foreground`,children:[(0,M.jsx)(`input`,{type:`checkbox`,checked:Ce,onChange:e=>we(e.target.checked)}),`Enforce chain order as dependencies`]})]}),(0,M.jsxs)(`button`,{type:`button`,onClick:ze,className:`inline-flex h-9 w-full items-center justify-center gap-2 rounded-md bg-primary text-sm text-primary-foreground hover:bg-primary/90`,children:[(0,M.jsx)(u,{size:15}),` Save task contract`]})]}),(0,M.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-2 text-xs`,children:[(0,M.jsx)(U,{label:`Source`,value:n.origin?.system??`manual`}),(0,M.jsx)(U,{label:`Task ID`,value:n.id.slice(0,8)}),(0,M.jsx)(U,{label:`Run`,value:n.assignment?.status??`unassigned`}),(0,M.jsx)(U,{label:`Column`,value:re(t,n.columnId)})]}),n.assignment&&(0,M.jsx)(ie,{assignment:n.assignment}),r&&n.origin?.taskId&&(0,M.jsx)(ee,{runLink:r,runTaskId:n.origin.taskId,modelCandidates:X,sendRaw:c}),!r&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(`div`,{className:`mt-4 space-y-3`,children:[(0,M.jsx)(G,{label:`Primary model source`,value:P,options:[`session`,`fixed`,`fallback_profile`],onChange:e=>F(e)}),P===`session`&&(0,M.jsxs)(`div`,{className:`rounded-md border bg-info/5 px-2 py-1.5 text-[11px] text-muted-foreground`,children:[`Uses the live session model:`,` `,Z.sessionProvider?`${Z.sessionProvider}/`:``,Z.sessionModel||`not available`,`.`]}),P===`fixed`&&(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{className:`mb-1 block text-[11px] font-medium text-muted-foreground`,children:`Fixed provider / model`}),(0,M.jsx)(D,{value:E||void 0,provider:C||void 0,candidates:X,placeholder:`Select exact provider / model…`,onPick:(e,t)=>{k(e),w(t)}})]}),P===`fallback_profile`&&(0,M.jsx)(G,{label:`Fallback profile (first model is primary)`,value:I,options:Object.keys(Z.fallbackProfiles),placeholder:`Select configured profile…`,onChange:L}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{className:`mb-1 block text-[11px] font-medium text-muted-foreground`,children:`Fallback models`}),(0,M.jsx)(N,{options:X.map(e=>({value:`${e.provider}/${e.model}`,label:e.label,description:e.description,tag:e.provider})),selected:R,onChange:z,placeholder:`Add fallback model…`,emptyLabel:`No models — add a provider in Settings`})]}),(0,M.jsx)(G,{label:`Role`,value:b,options:te,placeholder:`Select a role…`,onChange:S}),(0,M.jsxs)(`div`,{children:[(0,M.jsxs)(`span`,{className:`mb-1 block text-[11px] font-medium text-muted-foreground`,children:[`Agentic skills`,` `,(0,M.jsx)(`span`,{className:`text-muted-foreground/70`,children:`· force-loaded into the worker`})]}),(0,M.jsx)(N,{options:Z.skills.map(e=>({value:e.name,label:e.name,description:e.description,tag:e.source})),selected:ne,onChange:V,placeholder:`Assign required skills…`,emptyLabel:`No skills registered`})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsxs)(`span`,{className:`mb-1 block text-[11px] font-medium text-muted-foreground`,children:[`Tools`,` `,(0,M.jsx)(`span`,{className:`text-muted-foreground/70`,children:`· blank = full default toolset`})]}),(0,M.jsx)(N,{options:Z.tools.map(e=>({value:e.name,label:e.name,description:e.description})),selected:H,onChange:K,placeholder:`Restrict to specific tools…`,emptyLabel:`Tool list unavailable on this server`})]}),(0,M.jsxs)(`div`,{className:`rounded-md border bg-background/60`,children:[(0,M.jsxs)(`button`,{type:`button`,onClick:()=>se(e=>!e),className:`flex w-full items-center justify-between px-2 py-1.5 text-[11px] font-medium text-muted-foreground hover:text-foreground`,children:[`Advanced`,(0,M.jsx)(i,{size:13,className:T(`transition-transform`,oe&&`rotate-180`)})]}),oe&&(0,M.jsxs)(`div`,{className:`space-y-3 border-t p-2`,children:[(0,M.jsx)(W,{label:`Agent name (optional)`,value:h,onChange:_}),(0,M.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,M.jsx)(G,{label:`Retry policy`,value:ke,options:[`off`,`incremental`,`exponential`],onChange:e=>Ae(e)}),(0,M.jsx)(W,{label:`Max attempts`,value:Me,onChange:Ne}),(0,M.jsx)(W,{label:`Cost ceiling USD`,value:$,onChange:je})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsxs)(`span`,{className:`mb-1 block text-[11px] font-medium text-muted-foreground`,children:[`Capabilities`,` `,(0,M.jsx)(`span`,{className:`text-muted-foreground/70`,children:`· blank = safe defaults`})]}),(0,M.jsx)(N,{options:B,selected:q,onChange:J,placeholder:`Grant a capability…`})]})]})]})]}),(0,M.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-2`,children:[(0,M.jsxs)(`button`,{type:`button`,onClick:()=>{!t||!n||(s(`kanban.task.assign`,Re()),window.setTimeout(()=>l(t.id),150))},className:`inline-flex h-9 items-center justify-center gap-2 rounded-md border text-sm hover:bg-muted`,children:[(0,M.jsx)(m,{size:15}),`Assign`]}),(0,M.jsxs)(`button`,{type:`button`,onClick:()=>{!t||!n||(s(`kanban.task.dispatch`,Re()),window.setTimeout(()=>l(t.id),200))},className:`inline-flex h-9 items-center justify-center gap-2 rounded-md bg-primary text-sm text-primary-foreground hover:bg-primary/90`,children:[(0,M.jsx)(v,{size:15}),`Dispatch`]})]})]}),e.length>1&&!r?(0,M.jsxs)(`div`,{className:`mt-4 space-y-2 rounded-md border bg-background p-2`,children:[(0,M.jsxs)(`label`,{className:`block`,children:[(0,M.jsx)(`span`,{className:`mb-1 block text-[11px] font-medium text-muted-foreground`,children:`Target board`}),(0,M.jsx)(`select`,{value:Y,onChange:e=>ae(e.target.value),className:`h-8 w-full rounded-md border bg-background px-2 text-sm outline-none focus:border-primary`,children:e.filter(e=>e.id!==t?.id).map(e=>(0,M.jsx)(`option`,{value:e.id,children:e.title},e.id))})]}),(0,M.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,M.jsxs)(`button`,{type:`button`,onClick:()=>{!t||!n||!Y||s(`kanban.task.copy`,{boardId:t.id,taskId:n.id,targetBoardId:Y})},disabled:!Y,className:`inline-flex h-9 items-center justify-center gap-2 rounded-md border text-sm hover:bg-muted disabled:opacity-50`,children:[(0,M.jsx)(g,{size:15}),`Copy`]}),(0,M.jsxs)(`button`,{type:`button`,onClick:()=>{!t||!n||!Y||s(`kanban.task.transfer`,{boardId:t.id,taskId:n.id,targetBoardId:Y})},disabled:!Y,className:`inline-flex h-9 items-center justify-center gap-2 rounded-md border text-sm hover:bg-muted disabled:opacity-50`,children:[(0,M.jsx)(y,{size:15}),`Transfer`]})]})]}):null,(0,M.jsxs)(`div`,{className:`mt-5`,children:[(0,M.jsx)(`div`,{className:`mb-2 text-xs font-semibold uppercase text-muted-foreground`,children:`Completion checks`}),(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(n.successCriteria??[]).map(e=>(0,M.jsxs)(`div`,{className:`grid grid-cols-[auto_1fr_92px] items-center gap-2 rounded-md border bg-background px-2 py-1.5 text-xs`,children:[(0,M.jsx)(x,{size:13,className:e.status===`passed`?`text-success`:`text-muted-foreground`}),(0,M.jsx)(`span`,{className:`min-w-0 truncate`,children:e.description}),(0,M.jsx)(`select`,{value:e.status,onChange:r=>s(`kanban.task.check.update`,{boardId:t?.id,taskId:n.id,checkId:e.id,status:r.target.value}),className:`h-7 rounded border bg-background px-1 text-[11px]`,children:[`pending`,`passed`,`failed`,`skipped`].map(e=>(0,M.jsx)(`option`,{value:e,children:e},e))})]},e.id)),(0,M.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,M.jsx)(`input`,{value:Pe,onChange:e=>Fe(e.target.value),onKeyDown:e=>e.key===`Enter`&&Be(),placeholder:`Add a verifiable completion check…`,className:`h-8 min-w-0 flex-1 rounded-md border bg-background px-2 text-xs outline-none focus:border-primary`}),(0,M.jsx)(`button`,{type:`button`,onClick:Be,className:`h-8 rounded-md border px-2 hover:bg-muted`,children:(0,M.jsx)(o,{size:14})})]})]})]}),(0,M.jsxs)(`div`,{className:`mt-5`,children:[(0,M.jsx)(`div`,{className:`mb-2 text-xs font-semibold uppercase text-muted-foreground`,children:`Notes / audit trail`}),(0,M.jsxs)(`div`,{className:`space-y-1.5`,children:[(n.notes??[]).map(e=>(0,M.jsxs)(`div`,{className:`rounded-md border bg-background px-2 py-1.5 text-xs`,children:[(0,M.jsxs)(`div`,{className:`mb-1 flex justify-between text-[10px] text-muted-foreground`,children:[(0,M.jsx)(`span`,{children:e.author}),(0,M.jsx)(`span`,{children:new Date(e.createdAt).toLocaleString()})]}),(0,M.jsx)(`div`,{className:`whitespace-pre-wrap leading-5`,children:e.content})]},e.id)),(0,M.jsxs)(`div`,{className:`flex gap-1.5`,children:[(0,M.jsx)(`input`,{value:Ie,onChange:e=>Le(e.target.value),onKeyDown:e=>e.key===`Enter`&&Ve(),placeholder:`Add operator note…`,className:`h-8 min-w-0 flex-1 rounded-md border bg-background px-2 text-xs outline-none focus:border-primary`}),(0,M.jsx)(`button`,{type:`button`,onClick:Ve,className:`h-8 rounded-md border px-2 hover:bg-muted`,children:(0,M.jsx)(o,{size:14})})]})]})]})]}):(0,M.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-6 text-center text-sm text-muted-foreground`,children:`Select a task to edit assignment and dispatch settings.`})]})}function re(e,t){return e?.columns.find(e=>e.id===t)?.title??t}var V={assigned:`bg-info/10 text-info`,queued:`bg-info/10 text-info`,running:`bg-warning/10 text-warning`,completed:`bg-success/10 text-success`,failed:`bg-destructive/10 text-destructive`,cancelled:`bg-muted text-muted-foreground`};function H(e,t){if(!e)return null;let n=Date.parse(e);if(Number.isNaN(n))return null;let r=t?Date.parse(t):Date.now();if(Number.isNaN(r))return null;let i=Math.max(0,Math.round((r-n)/1e3));if(i<60)return`${i}s`;let a=Math.floor(i/60);return a<60?`${a}m ${i%60}s`:`${Math.floor(a/60)}h ${a%60}m`}function ie({assignment:e}){let t=e.status===`running`,n=H(e.dispatchedAt,e.completedAt),r=[];return(e.name||e.agentId)&&r.push({label:`Agent`,value:e.name??e.agentId}),e.role&&r.push({label:`Role`,value:e.role}),e.modelRouting&&r.push({label:`Model source`,value:e.modelRouting}),(e.provider||e.model)&&r.push({label:`Model`,value:(0,M.jsxs)(`span`,{className:`font-mono text-[11px]`,children:[e.provider?`${e.provider}/`:``,e.model??`—`]})}),e.subagentId&&r.push({label:`Subagent`,value:(0,M.jsx)(`span`,{className:`font-mono text-[11px]`,children:e.subagentId})}),n&&r.push({label:e.completedAt?`Duration`:`Elapsed`,value:n}),typeof e.attempt==`number`&&r.push({label:`Attempt`,value:`${e.attempt}${e.maxAttempts?` / ${e.maxAttempts}`:``}`}),e.costCeilingUsd&&r.push({label:`Cost ceiling`,value:`$${e.costCeilingUsd.toFixed(2)}`}),e.fallbackProfile&&r.push({label:`Fallback profile`,value:e.fallbackProfile}),e.fallbackModels?.length&&r.push({label:`Fallbacks`,value:e.fallbackModels.join(` → `)}),e.skills?.length&&r.push({label:`Skills`,value:e.skills.join(`, `)}),e.tools?.length&&r.push({label:`Tools`,value:e.tools.join(`, `)}),e.leaseExpiresAt&&r.push({label:`Lease expires`,value:new Date(e.leaseExpiresAt).toLocaleString()}),(0,M.jsxs)(`div`,{className:`mt-4 rounded-md border bg-background p-2.5`,children:[(0,M.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,M.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Live run`}),(0,M.jsxs)(`span`,{className:T(`ml-auto inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-medium capitalize`,V[e.status]??`bg-muted text-muted-foreground`),children:[t&&(0,M.jsx)(`span`,{className:`h-1.5 w-1.5 animate-pulse rounded-full bg-current`,"aria-hidden":!0}),e.status]})]}),r.length>0&&(0,M.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:r.map(e=>(0,M.jsxs)(`div`,{className:`contents`,children:[(0,M.jsx)(`dt`,{className:`text-muted-foreground`,children:e.label}),(0,M.jsx)(`dd`,{className:`min-w-0 truncate text-right text-foreground`,children:e.value})]},e.label))}),e.lastResult&&(0,M.jsxs)(`div`,{className:`mt-2`,children:[(0,M.jsx)(`div`,{className:`mb-1 text-[10px] uppercase text-muted-foreground`,children:`Last result`}),(0,M.jsx)(`div`,{className:`max-h-24 overflow-y-auto whitespace-pre-wrap rounded bg-muted px-2 py-1 text-[11px] leading-relaxed text-foreground`,children:e.lastResult})]}),e.error&&(0,M.jsx)(`div`,{className:`mt-2 rounded border border-destructive/30 bg-destructive/10 px-2 py-1 text-[11px] text-destructive`,children:e.error})]})}function U({label:e,value:t}){return(0,M.jsxs)(`div`,{className:`rounded-md border bg-background px-2 py-1.5`,children:[(0,M.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground`,children:e}),(0,M.jsx)(`div`,{className:`mt-0.5 truncate text-xs font-medium`,children:t})]})}function W({label:e,value:t,onChange:n}){return(0,M.jsxs)(`label`,{className:`block`,children:[(0,M.jsx)(`span`,{className:`mb-1 block text-[11px] font-medium text-muted-foreground`,children:e}),(0,M.jsx)(`input`,{value:t,onChange:e=>n(e.target.value),className:`h-8 w-full rounded-md border bg-background px-2 text-sm outline-none focus:border-primary`})]})}function G({label:e,value:t,options:n,placeholder:r,onChange:i}){return(0,M.jsxs)(`label`,{className:`block`,children:[(0,M.jsx)(`span`,{className:`mb-1 block text-[11px] font-medium text-muted-foreground`,children:e}),(0,M.jsxs)(`select`,{value:t,onChange:e=>i(e.target.value),className:`h-8 w-full rounded-md border bg-background px-2 text-sm outline-none focus:border-primary`,children:[r&&(0,M.jsx)(`option`,{value:``,children:r}),n.map(e=>(0,M.jsx)(`option`,{value:e,children:e},e))]})]})}function K(e){let t=`rounded px-1.5 py-0.5`;return e===`critical`?`${t} bg-destructive/10 text-destructive`:e===`high`?`${t} bg-warning/10 text-warning`:e===`low`?`${t} bg-muted text-muted-foreground`:`${t} bg-info/10 text-info`}export{I as KanbanView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-BRAejDWd.js";import{Fr as r,Ft as i,X as a,Xn as o,ci as s,cn as c,di as l,fn as u,gr as d,ht as f,it as p,jt as m,kr as h,pr as g,vi as _,xi as v,zt as y}from"./vendor-B51hXwIj.js";import"./i18n-CLLrYq46.js";import{t as b}from"./utils-C9L1kxOy.js";import{n as x}from"./ui-store-Dm48nEb1.js";import{D as S,w as C,z as w}from"./index-BwLKTDt1.js";var T=e(t(),1),E=n(),D={note:o,ask:s,assign:m,steer:i,btw:h,broadcast:m,status:d,result:l},O={high:`border-destructive/25 bg-destructive/10 text-destructive`,normal:`border-border bg-muted text-muted-foreground`,low:`border-primary/20 bg-primary/10 text-primary`};function k(e){return new Date(e).toLocaleString()}function A(e){let t=new Date(e),n=Date.now()-t.getTime();return n<6e4?v.t(`common:time.justNow`):n<36e5?v.t(`common:time.minutesAgo`,{count:Math.round(n/6e4)}):n<864e5?v.t(`common:time.hoursAgo`,{count:Math.round(n/36e5)}):n<6048e5?v.t(`common:time.daysAgo`,{count:Math.round(n/864e5)}):t.toLocaleDateString()}function j(){let{t:e}=_();return(0,E.jsx)(`div`,{className:`flex h-full min-h-0 flex-1 items-center justify-center bg-[hsl(var(--surface-2)/0.45)] p-4`,children:(0,E.jsxs)(`div`,{className:`ws-surface flex max-w-md flex-col items-center gap-3 rounded-xl p-6 text-center text-muted-foreground`,children:[(0,E.jsx)(`span`,{className:`flex h-12 w-12 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,E.jsx)(u,{className:`h-6 w-6`})}),(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:e(`activity:mailbox.emptyDetail`)}),(0,E.jsx)(`div`,{className:`mt-1 text-xs`,children:e(`activity:mailbox.emptyDetailHint`)})]})]})})}function M({readBy:e}){let{t}=_(),n=Object.entries(e);return n.length===0?null:(0,E.jsxs)(`div`,{className:`space-y-1`,children:[(0,E.jsx)(`div`,{className:`text-[10px] font-semibold text-muted-foreground uppercase tracking-wide`,children:t(`activity:mailbox.readBy`)}),(0,E.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:n.map(([e,t])=>(0,E.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] bg-success/10 text-success`,title:k(t),children:[(0,E.jsx)(l,{className:`h-2.5 w-2.5`}),e]},e))})]})}function N({className:e}){let{t}=_(),n=x(e=>e.selectedMailMessage),i=x(e=>e.setSelectedMailMessage);(0,T.useEffect)(()=>()=>{i(null)},[i]);function o(){i(null),w(`chat`)}if(!n)return(0,E.jsx)(j,{});let s=D[n.type]??c,u=t(`activity:mailbox.type.${n.type}`,{defaultValue:n.type}),d=O[n.priority]??O.normal;return(0,E.jsx)(`div`,{className:b(`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-[hsl(var(--surface-2)/0.45)] p-3`,e),children:(0,E.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-xl border border-border/70 bg-card/75 shadow-sm`,children:[(0,E.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-border/70 px-3 py-3 sm:px-4 shrink-0`,children:[(0,E.jsx)(`button`,{type:`button`,onClick:o,className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-border/70 bg-background/60 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,title:t(`activity:mailbox.backToChat`),children:(0,E.jsx)(r,{className:`h-4 w-4`})}),(0,E.jsx)(`div`,{className:b(`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg`,n.completed?`bg-success/10`:`bg-primary/10`),children:(0,E.jsx)(s,{className:b(`h-4 w-4`,n.completed?`text-success`:`text-primary`)})}),(0,E.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,E.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,E.jsx)(`h2`,{className:`text-sm font-semibold text-foreground truncate`,children:n.subject}),n.completed&&(0,E.jsxs)(`span`,{className:`inline-flex shrink-0 items-center gap-1 rounded-md border border-success/25 bg-success/8 px-1.5 py-0.5 text-[10px] font-semibold text-success`,children:[(0,E.jsx)(l,{className:`h-3 w-3`}),t(`activity:mailbox.completed`)]}),(0,E.jsx)(`span`,{className:b(`rounded-md border px-1.5 py-0.5 text-[10px] font-semibold uppercase`,d),children:n.priority||`normal`})]}),(0,E.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-2 text-[11px] text-muted-foreground`,children:[(0,E.jsx)(`span`,{className:`min-w-0 truncate font-medium text-foreground/80`,children:n.from}),(0,E.jsx)(`span`,{children:`→`}),(0,E.jsx)(`span`,{className:`min-w-0 truncate`,children:n.to===`*`||n.to===`all`?t(`activity:mailbox.everyone`):n.to}),(0,E.jsx)(`span`,{className:`opacity-40`,children:`•`}),(0,E.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,E.jsx)(g,{className:`h-3 w-3`}),A(n.timestamp)]})]})]}),(0,E.jsx)(`button`,{type:`button`,onClick:o,className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,title:t(`activity:mailbox.closeTitle`),children:(0,E.jsx)(a,{className:`h-4 w-4`})})]}),(0,E.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto`,children:(0,E.jsx)(`div`,{className:`mx-auto w-full max-w-4xl px-4 py-5`,children:(0,E.jsx)(`div`,{className:`markdown-content prose prose-sm dark:prose-invert max-w-none text-sm leading-relaxed`,children:(0,E.jsx)(S,{components:C,children:n.body})})})}),(0,E.jsxs)(`div`,{className:`border-t border-border/70 bg-muted/20 px-4 py-3 shrink-0`,children:[(0,E.jsxs)(`div`,{className:`grid grid-cols-2 sm:grid-cols-4 gap-x-6 gap-y-2 text-xs`,children:[(0,E.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,E.jsx)(f,{className:`h-3 w-3 shrink-0`}),(0,E.jsx)(`span`,{children:u})]}),(0,E.jsx)(`div`,{className:`flex items-center gap-1.5`,children:(0,E.jsx)(`span`,{className:b(`rounded border px-1.5 py-0.5 text-[10px] font-semibold uppercase`,d),children:n.priority||`normal`})}),(0,E.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,E.jsx)(p,{className:`h-3 w-3 shrink-0`}),(0,E.jsx)(`span`,{className:`truncate`,title:n.from,children:n.from})]}),(0,E.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,E.jsx)(g,{className:`h-3 w-3 shrink-0`}),(0,E.jsx)(`span`,{children:k(n.timestamp)})]}),n.replyTo&&(0,E.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground col-span-2`,children:[(0,E.jsx)(y,{className:`h-3 w-3 shrink-0`}),(0,E.jsx)(`span`,{className:`truncate`,children:t(`activity:mailbox.replyTo`,{id:n.replyTo})})]}),n.completed&&n.completedBy&&(0,E.jsxs)(`div`,{className:`flex items-center gap-1.5 text-muted-foreground col-span-2`,children:[(0,E.jsx)(l,{className:`h-3 w-3 shrink-0 text-success`}),(0,E.jsx)(`span`,{children:n.completedAt?t(`activity:mailbox.completedByAt`,{name:n.completedBy,time:k(n.completedAt)}):t(`activity:mailbox.completedBy`,{name:n.completedBy})})]}),n.outcome&&(0,E.jsxs)(`div`,{className:`flex items-start gap-1.5 text-muted-foreground col-span-2 sm:col-span-4`,children:[(0,E.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wide shrink-0 mt-0.5`,children:t(`activity:mailbox.outcome`)}),(0,E.jsx)(`span`,{children:n.outcome})]}),n.taskContext&&(0,E.jsxs)(`div`,{className:`flex items-start gap-1.5 text-muted-foreground col-span-2 sm:col-span-4`,children:[(0,E.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wide shrink-0 mt-0.5`,children:t(`activity:mailbox.task`)}),(0,E.jsx)(`span`,{children:n.taskContext})]})]}),Object.keys(n.readBy??{}).length>0&&(0,E.jsx)(`div`,{className:`mt-3 pt-3 border-t border-border/50`,children:(0,E.jsx)(M,{readBy:n.readBy})})]})]})})}export{N as MailboxDetailView};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{l as t,m as n,p as r}from"./markdown-BRAejDWd.js";import{$ as i,Cn as a,Dr as o,Lr as s,Mn as c,Nt as l,On as u,Tr as d,Y as f,Z as p,an as m,dn as h,et as g,fi as _,fn as v,it as y,jt as b,lr as x,or as S,pr as C,pt as w,rt as T,vi as E,xi as D,zr as O}from"./vendor-B51hXwIj.js";import"./i18n-CLLrYq46.js";import{s as ee}from"./ws-client-Bbu1u6TM.js";import{t as te}from"./session-store-zbDVE9MI.js";import{t as k}from"./utils-C9L1kxOy.js";import{a as A,c as j,d as M,f as N,h as ne,i as P,l as re,m as F,n as ie,o as ae,p as oe,r as se,s as ce,t as le,u as ue}from"./xyflow-BDdNcuaV.js";import{$ as de,C as I,D as L,G as R,K as fe,Q as pe,S as z,T as B,q as me,v as he,w as V,x as ge}from"./index-BwLKTDt1.js";var H=e(n(),1),U=r();function W(e){if(e<1e3)return`${e}ms`;let t=Math.round(e/100);return t<600?`${(t/10).toFixed(1)}s`:`${Math.floor(t/600)}m ${Math.round(t%600/10)}s`}var _e={user:{Icon:y,labelKey:`activity:message.roleYou`,avatarBg:`bg-primary`,avatarColor:`text-primary-foreground`,avatarRing:`ring-2 ring-offset-2 ring-offset-background ring-primary/20`,bubbleBg:`bg-primary`,bubbleBorder:`border-transparent`,textColor:`text-primary-foreground`},assistant:{Icon:o,labelKey:`activity:message.roleAssistant`,avatarBg:`bg-accent`,avatarColor:`text-accent-foreground`,avatarRing:`ring-2 ring-offset-2 ring-offset-background ring-accent/20`,bubbleBg:`bg-card`,bubbleBorder:`border-border`,textColor:`text-foreground`},tool:{Icon:w,labelKey:`activity:message.roleTool`,avatarBg:`bg-secondary`,avatarColor:`text-secondary-foreground`,avatarRing:`ring-2 ring-offset-2 ring-offset-background ring-secondary/20`,bubbleBg:`bg-muted/80`,bubbleBorder:`border-border`,textColor:`text-foreground`},system:{Icon:o,labelKey:`activity:transcript.kindSystem`,avatarBg:`bg-muted`,avatarColor:`text-muted-foreground`,avatarRing:`ring-2 ring-offset-2 ring-offset-background ring-muted/20`,bubbleBg:`bg-muted/50`,bubbleBorder:`border-border`,textColor:`text-muted-foreground`},error:{Icon:_,labelKey:`activity:transcript.kindError`,avatarBg:`bg-destructive`,avatarColor:`text-destructive-foreground`,avatarRing:`ring-2 ring-offset-2 ring-offset-background ring-destructive/20`,bubbleBg:`bg-destructive/5`,bubbleBorder:`border-destructive/20`,textColor:`text-destructive`}};function G({entry:e}){let{t:n}=E();return e.role===`error`?(0,U.jsx)(z,{text:e.text}):e.role===`tool`?(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5 tool-details`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm font-medium text-foreground`,children:[(0,U.jsx)(w,{className:`h-3 w-3`}),(0,U.jsx)(`span`,{className:`font-mono`,children:e.tool??n(`activity:watch.toolFallback`)}),e.durationMs!==void 0&&(0,U.jsxs)(`span`,{className:`ml-auto text-[10px] text-muted-foreground font-normal tabular-nums`,children:[(0,U.jsx)(C,{className:`h-3 w-3 inline mr-0.5 align-text-bottom`}),W(e.durationMs)]})]}),e.input!==void 0&&e.input!==null&&(0,U.jsx)(`div`,{className:`p-3 bg-muted/50 rounded-lg overflow-x-auto`,children:(0,U.jsx)(ge,{input:e.input})}),e.output!==void 0&&e.output!==null?(0,U.jsx)(`div`,{className:`text-sm leading-relaxed markdown-content`,children:typeof e.output==`string`?(0,U.jsx)(L,{remarkPlugins:[t],rehypePlugins:B,components:V,children:e.output}):(0,U.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs bg-card rounded-lg p-2 border border-border overflow-x-auto`,children:JSON.stringify(e.output,null,2)})}):e.text?(0,U.jsx)(`div`,{className:`text-sm leading-relaxed markdown-content`,children:(0,U.jsx)(L,{remarkPlugins:[t],rehypePlugins:B,components:V,children:e.text})}):null,e.isError&&(0,U.jsxs)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2`,children:[(0,U.jsx)(`span`,{className:`text-xs font-medium text-destructive`,children:n(`activity:watch.toolFailed`)}),e.text&&(0,U.jsx)(`pre`,{className:`mt-1 text-xs whitespace-pre-wrap text-destructive/80`,children:e.text})]})]}):(0,U.jsx)(`div`,{className:`text-sm leading-relaxed markdown-content`,children:(0,U.jsx)(L,{remarkPlugins:[t],rehypePlugins:B,components:V,children:e.text})})}function ve({entry:e,isContinuation:t=!1}){let{t:n}=E(),r=_e[e.role],i=r.Icon;return(0,U.jsxs)(`div`,{className:`group flex gap-3 animate-message msg-bubble rounded-lg transition-shadow`,children:[t?(0,U.jsx)(`div`,{className:`flex-shrink-0 w-8`}):(0,U.jsx)(`div`,{className:k(`flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center`,r.avatarBg,r.avatarColor,r.avatarRing),children:(0,U.jsx)(i,{className:`h-4 w-4`})}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5 min-w-0 flex-1`,children:[!t&&(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:k(`text-xs font-medium`,r.textColor),children:e.role===`tool`&&e.tool?e.tool:n(r.labelKey)}),(0,U.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:new Date(e.ts).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}),e.role===`tool`&&e.durationMs!==void 0&&(0,U.jsxs)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:[`· `,W(e.durationMs)]})]}),(0,U.jsx)(`div`,{className:k(`rounded-2xl px-4 py-3 border`,e.role===`user`&&`rounded-br-md`,e.role===`assistant`&&`rounded-bl-md`,e.role===`tool`&&`rounded-bl-sm`,e.role===`system`&&`rounded-bl-sm opacity-70`,e.role===`error`&&`rounded-bl-sm`,r.bubbleBg,r.bubbleBorder),children:(0,U.jsx)(`div`,{className:k(`text-sm leading-relaxed markdown-content`,r.textColor),children:(0,U.jsx)(G,{entry:e})})}),e.text&&e.role!==`error`&&(0,U.jsx)(`div`,{className:`opacity-0 group-hover:opacity-100 transition-opacity`,children:(0,U.jsx)(I,{text:e.text,label:n(`common:action.copy`)})})]})]})}var ye=[`steer`,`ask`,`assign`,`note`],be=2500;function xe({sessionId:e,limit:t=200}){let[n,r]=(0,H.useState)(null),{t:i}=E(),[a,s]=(0,H.useState)(null),[c,l]=(0,H.useState)(``),[u,d]=(0,H.useState)(!1),[f,p]=(0,H.useState)(null),[m,h]=(0,H.useState)(`steer`),[g,_]=(0,H.useState)(`high`),[v,y]=(0,H.useState)([]),[b,x]=(0,H.useState)(!1),S=(0,H.useRef)(null),C=(0,H.useRef)(!0),w=(0,H.useRef)(!0),T=fe(e=>e.liveSessions),O=(0,H.useMemo)(()=>T.find(t=>t.sessionId===e),[T,e]),ee=(0,H.useMemo)(()=>{let e=O;return e?`${e.status}|${e.agents.map(e=>`${e.id}:${e.status}:${e.toolCalls??0}:${e.iterations??0}`).join(`,`)}`:``},[O]),te=O?.status===`active`||(O?.agents.some(e=>e.status===`running`||e.status===`streaming`)??!1),A=(0,H.useMemo)(()=>{if(!O)return null;let e=O.agents.find(e=>e.status===`running`||e.status===`streaming`);return e?.currentTool?`🔧 ${e.currentTool}`:e?i(`activity:sessionWatch.working`,{name:e.name??e.id}):null},[O,i]),j=(0,H.useMemo)(()=>{if(!O)return null;let e=O.agents.find(e=>e.partialText&&(e.status===`streaming`||e.status===`running`))??O.agents.find(e=>e.partialText);return e?.partialText?{label:e.id===`leader`?i(`activity:sessionWatch.claude`):e.name||e.id,text:e.partialText}:null},[O,i]),M=(0,H.useCallback)(async()=>{try{let n=await fetch(`/api/sessions/${encodeURIComponent(e)}/events?limit=${t}`);if(!n.ok)throw Error(`HTTP ${n.status}`);let i=await n.json();w.current&&(r(i),s(null))}catch(e){w.current&&s(e instanceof Error?e.message:String(e))}},[e,t]),N=(0,H.useCallback)(async()=>{try{let t=await fetch(`/api/sessions/${encodeURIComponent(e)}/mailbox`);if(!t.ok)return;let n=await t.json();w.current&&Array.isArray(n.thread)&&y(n.thread)}catch{}},[e]);(0,H.useEffect)(()=>{w.current=!0,r(null),s(null),y([]),M(),N();let e=setInterval(()=>{document.hidden||(M(),N())},be);return()=>{w.current=!1,clearInterval(e)}},[M,N]),(0,H.useEffect)(()=>{ee&&M()},[ee,M]),(0,H.useEffect)(()=>{C.current&&S.current&&(S.current.scrollTop=S.current.scrollHeight)},[n,j]);let ne=()=>{let e=S.current;e&&(C.current=e.scrollHeight-e.scrollTop-e.clientHeight<40)},P=async()=>{let t=c.trim();if(!(!t||u)){d(!0),p(null);try{let n=await fetch(`/api/sessions/${encodeURIComponent(e)}/message`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({text:t,type:m,priority:g})});if(!n.ok)throw Error(`HTTP ${n.status}`);l(``),p(te?D.t(`activity:sessionWatch.sentRunning`):D.t(`activity:sessionWatch.sentIdle`)),N()}catch(e){p(D.t(`activity:sessionWatch.sentFailed`,{error:e instanceof Error?e.message:String(e)}))}finally{d(!1)}}},re=async()=>{if(!b){x(!0),p(null);try{let t=await fetch(`/api/sessions/${encodeURIComponent(e)}/interrupt`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({reason:D.t(`activity:sessionWatch.interruptReason`)})});if(!t.ok)throw Error(`HTTP ${t.status}`);p(D.t(`activity:sessionWatch.interruptSent`)),N()}catch(e){p(D.t(`activity:sessionWatch.interruptFailed`,{error:e instanceof Error?e.message:String(e)}))}finally{x(!1)}}},F=n?.entries??[];return(0,U.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-1.5 shrink-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] uppercase tracking-wide text-muted-foreground`,children:[(0,U.jsx)(`span`,{className:k(`h-1.5 w-1.5 rounded-full`,te?`bg-success animate-pulse`:`bg-muted-foreground`)}),i(`activity:sessionWatch.liveStream`)]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n&&(0,U.jsxs)(`div`,{className:`text-[10px] text-muted-foreground`,children:[i(`activity:sessionWatch.events`,{count:n.total}),` · `,n.status]}),te&&(0,U.jsx)(`button`,{type:`button`,onClick:()=>void re(),disabled:b,title:i(`activity:sessionWatch.interruptTitle`),className:`rounded border border-destructive/40 bg-destructive/15 px-1.5 py-0.5 text-[10px] text-destructive hover:bg-destructive/25 disabled:opacity-40 transition-colors`,children:i(b?`activity:sessionWatch.interrupting`:`activity:sessionWatch.interrupt`)})]})]}),A&&(0,U.jsxs)(`div`,{className:`mb-1.5 shrink-0 text-[10px] text-foreground truncate`,children:[`▶ `,A]}),a&&(0,U.jsxs)(`div`,{className:`text-[11px] text-destructive mb-1 shrink-0`,children:[`· `,a]}),(0,U.jsxs)(`div`,{ref:S,onScroll:ne,className:`min-h-0 min-w-0 flex-1 overflow-y-auto space-y-1.5 pr-1`,children:[F.length===0&&!a&&(0,U.jsx)(`div`,{className:`text-[11px] text-muted-foreground italic`,children:i(`activity:sessionWatch.loading`)}),F.map((e,t)=>(0,U.jsx)(ve,{entry:e,isContinuation:t>0&&F[t-1].role===e.role},`${e.ts}-${t}`)),j&&(0,U.jsxs)(`div`,{className:`flex gap-3 animate-message`,children:[(0,U.jsx)(`div`,{className:`flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center bg-accent text-accent-foreground ring-2 ring-offset-2 ring-offset-background ring-accent/20`,children:(0,U.jsx)(o,{className:`h-4 w-4 animate-pulse`})}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-1.5 max-w-[85%] min-w-0`,children:[(0,U.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground px-1`,children:j.label}),(0,U.jsx)(`div`,{className:`rounded-2xl rounded-bl-md px-4 py-3 bg-card border border-border`,children:(0,U.jsxs)(`span`,{className:`text-sm leading-relaxed text-foreground whitespace-pre-wrap break-words`,children:[j.text,(0,U.jsx)(`span`,{className:`animate-pulse text-primary`,children:`▋`})]})})]})]})]}),v.length>0&&(0,U.jsxs)(`div`,{className:`mt-2 pt-2 border-t border-border shrink-0 max-h-28 overflow-y-auto space-y-1`,children:[(0,U.jsx)(`div`,{className:`text-[9px] uppercase tracking-wide text-muted-foreground`,children:i(`activity:mailbox.messages`)}),v.slice(-6).map(e=>{let t=e.completed?i(`activity:sessionWatch.done`):e.readByLeader?i(`activity:sessionWatch.read`):i(`activity:sessionWatch.delivered`);return(0,U.jsxs)(`div`,{className:`text-[10px] leading-snug`,children:[(0,U.jsx)(`span`,{className:k(`font-semibold mr-1.5`,e.fromLeader?`text-accent`:`text-primary`),children:e.fromLeader?i(`activity:sessionWatch.agent`):i(`activity:sessionWatch.you`)}),(0,U.jsx)(`span`,{className:`text-foreground whitespace-pre-wrap break-words`,children:e.body}),!e.fromLeader&&(0,U.jsx)(`span`,{className:k(`ml-1.5 text-[9px]`,e.completed?`text-success`:e.readByLeader?`text-primary`:`text-muted-foreground`),children:t})]},e.id)})]}),(0,U.jsxs)(`div`,{className:`mt-2 pt-2 border-t border-border shrink-0`,children:[(0,U.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5`,children:[(0,U.jsx)(`select`,{value:m,onChange:e=>h(e.target.value),title:i(`activity:sessionWatch.msgType.${m}Hint`),className:`rounded bg-muted border border-border px-1.5 py-0.5 text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring`,children:ye.map(e=>(0,U.jsx)(`option`,{value:e,children:i(`activity:sessionWatch.msgType.${e}Label`)},e))}),(0,U.jsxs)(`select`,{value:g,onChange:e=>_(e.target.value),title:i(`activity:sessionWatch.priority`),className:`rounded bg-muted border border-border px-1.5 py-0.5 text-[10px] text-foreground focus:outline-none focus:ring-1 focus:ring-ring`,children:[(0,U.jsx)(`option`,{value:`high`,children:`high`}),(0,U.jsx)(`option`,{value:`normal`,children:`normal`}),(0,U.jsx)(`option`,{value:`low`,children:`low`})]})]}),(0,U.jsxs)(`div`,{className:`flex items-end gap-1.5`,children:[(0,U.jsx)(`textarea`,{value:c,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),P())},rows:2,placeholder:i(`activity:sessionWatch.placeholder`,{label:i(`activity:sessionWatch.msgType.${m}Label`)}),className:`flex-1 resize-none rounded-md bg-muted border border-border px-2 py-1 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>void P(),disabled:u||!c.trim(),className:`shrink-0 rounded-md bg-primary text-primary-foreground px-2.5 py-1.5 text-xs hover:bg-primary/90 disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:u?`…`:i(`activity:sessionWatch.send`)})]}),f&&(0,U.jsx)(`div`,{className:`mt-1 text-[10px] text-muted-foreground`,children:f}),(0,U.jsx)(`div`,{className:`mt-0.5 text-[9px] text-muted-foreground`,children:i(`activity:sessionWatch.sendHint`)})]})]})}function K(e){return e==null||!Number.isFinite(e)?`0`:e<1e3?String(Math.round(e)):e<1e6?`${(e/1e3).toFixed(1)}k`:`${(e/1e6).toFixed(1)}M`}function Se(e,t){if(!e)return`never`;let n=Date.parse(e);if(!Number.isFinite(n))return`never`;let r=Math.max(0,Math.round((t-n)/1e3));return r<60?`${r}s ago`:r<3600?`${Math.round(r/60)}m ago`:r<86400?`${Math.round(r/3600)}h ago`:`${Math.round(r/86400)}d ago`}function Ce(e,t){if(!e)return``;let n=Date.parse(e);if(!Number.isFinite(n))return``;let r=Math.max(0,Math.round((t-n)/1e3));return r<60?`${r}s`:r<3600?`${Math.round(r/60)}m`:`${Math.round(r/3600)}h`}function we(e){if(!e)return;let t=e.split(`/`);return t[t.length-1]?.slice(0,18)}function Te(e,t=380){let n=new Map,r=Math.max(1,e.length);return e.forEach((e,i)=>{let a=(i-(r-1)/2)*t;n.set(e,600+a)}),n}function Ee(e,t,n){let r=Math.min(3,n),i=Math.floor(t/r),a=t%r;return{x:e-(Math.min(r,n-i*r)-1)*190/2+a*190,y:640+i*150}}function De(e){return e===`tui`?`tui`:e===`repl`||e===`cli`?`repl`:`webui`}function Oe(e){return e===`tui`?`TUI`:e===`repl`?`REPL`:`WebUI`}function ke(e){switch(e){case`running`:case`active`:return`active`;case`idle`:return`idle`;case`completed`:return`completed`;case`failed`:case`error`:return`error`;case`stopped`:return`offline`;default:return`idle`}}function Ae(e,t){let n=new Set,r=[];for(let i of e){let e=De(i.clientType),a=`client-${i.pid??i.sessionId}`,o=[],s=!1;for(let e of i.agents){n.add(e.id);let r=t.get(e.id),i=ke(r?.status??e.status);(i===`active`||i===`streaming`)&&(s=!0),o.push({officeId:`${a}__agent-${e.id}`,serverId:e.id,name:r?.name??e.name??e.id,status:i,iteration:r?.iteration??e.iterations??0,toolCalls:r?.toolCalls??e.toolCalls??0,costUsd:r?.costUsd??e.costUsd??0,tokensIn:r?.tokensIn??e.tokensIn??0,tokensOut:r?.tokensOut??e.tokensOut??0,ctxPct:r?.ctxPct??e.ctxPct,model:r?.model??e.model,lastActivityAt:e.lastActivityAt,currentTask:r?.currentTool??r?.lastTool??e.currentTool})}let c=i.status===`closing`||i.status===`stale`||i.status===`lost`?`offline`:s?`active`:`idle`;r.push({id:a,type:e,label:i.projectName||Oe(e),sublabel:[Oe(e),i.gitBranch?`⎇ ${i.gitBranch}`:``,i.pid?`pid ${i.pid}`:``].filter(Boolean).join(` · `),status:c,sessionId:i.sessionId,pid:i.pid,branch:i.gitBranch,workingDir:i.workingDir,startedAt:i.startedAt,agents:o})}let i=[...t.values()].filter(e=>!n.has(e.id));if(i.length>0){let e=r.find(e=>e.type===`webui`);e||(e={id:`client-self`,type:`webui`,label:`This WebUI`,sublabel:`Web UI`,status:`idle`,agents:[]},r.push(e));for(let t of i){let n=ke(t.status);(n===`active`||n===`streaming`)&&(e.status=`active`),e.agents.push({officeId:`${e.id}__agent-${t.id}`,serverId:t.id,name:t.name,status:n,iteration:t.iteration??0,toolCalls:t.toolCalls??0,costUsd:t.costUsd??0,tokensIn:t.tokensIn??0,tokensOut:t.tokensOut??0,ctxPct:t.ctxPct,model:t.model,currentTask:t.currentTool??t.lastTool})}}return r.length===0&&r.push({id:`client-self`,type:`webui`,label:`This WebUI`,sublabel:`Web UI · connecting…`,status:`idle`,agents:[]}),r}function je(e){return e.startsWith(`tool`)?`hsl(var(--warning))`:e.startsWith(`mailbox`)?`hsl(var(--info))`:e.startsWith(`provider`)?`hsl(var(--primary))`:e.startsWith(`agent`)||e.startsWith(`subagent`)?`hsl(var(--success))`:e.includes(`error`)?`hsl(var(--destructive))`:`hsl(var(--primary))`}var q={primary:`hsl(var(--primary))`,info:`hsl(var(--info))`,success:`hsl(var(--success))`,warning:`hsl(var(--warning))`,destructive:`hsl(var(--destructive))`,muted:`hsl(var(--muted-foreground))`};function Me(e){return Math.min(100,Math.max(0,e??0))}function J({status:e,small:t,activity:n=0}){let r=t?`w-2 h-2`:`w-3 h-3`,i=t?4+n*4:6+n*6,a={idle:`bg-muted-foreground`,active:`bg-success`,streaming:`bg-primary`,completed:`bg-primary`,error:`bg-destructive`,offline:`bg-muted-foreground/60`},o={idle:q.muted,active:q.success,streaming:q.primary,completed:q.primary,error:q.destructive,offline:q.muted};return(0,U.jsx)(`span`,{className:k(`rounded-full`,r,n>0&&`animate-pulse`,a[e]),style:{boxShadow:n>0?`0 0 ${i}px ${o[e]}`:void 0}})}function Ne(){let{t:e}=E(),{clientCounts:t,currentSession:n,totalAgents:r,activeAgents:i,aggregate:a}=fe(f(e=>({clientCounts:e.clientCounts,currentSession:e.currentSession,totalAgents:e.totalAgents,activeAgents:e.activeAgents,aggregate:e.aggregate}))),s=t.tui+t.webui+t.repl,l=e=>e?.toLocaleString()??`0`;return(0,U.jsxs)(`div`,{className:`absolute left-4 top-20 z-10 rounded-xl border border-border/70 bg-card/90 p-3 text-foreground shadow-xl backdrop-blur`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,U.jsx)(O,{className:`h-3.5 w-3.5 text-success`}),(0,U.jsx)(`span`,{className:`text-[10px] font-bold uppercase text-muted-foreground`,children:e(`activity:office.sessionStats`)})]}),(0,U.jsxs)(`div`,{className:`space-y-1.5 text-[10px]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(T,{className:`h-3 w-3 text-muted-foreground`}),(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.clients`)})]}),(0,U.jsxs)(`span`,{className:`font-mono text-foreground`,children:[i,` `,(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:`/`}),` `,(0,U.jsx)(`span`,{className:`text-success`,children:s})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3 pl-4 text-[9px]`,children:[t.tui>0&&(0,U.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(w,{className:`h-2.5 w-2.5 text-success`}),(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:`TUI`}),(0,U.jsx)(`span`,{className:`font-mono text-success`,children:t.tui})]}),t.webui>0&&(0,U.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(m,{className:`h-2.5 w-2.5 text-primary`}),(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:`WebUI`}),(0,U.jsx)(`span`,{className:`font-mono text-primary`,children:t.webui})]}),t.repl>0&&(0,U.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(w,{className:`h-2.5 w-2.5 text-warning`}),(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:`REPL`}),(0,U.jsx)(`span`,{className:`font-mono text-warning`,children:t.repl})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(o,{className:`h-3 w-3 text-muted-foreground`}),(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:officeMap.agents`)})]}),(0,U.jsxs)(`span`,{className:`font-mono text-foreground`,children:[i,` `,(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:`/`}),` `,(0,U.jsx)(`span`,{className:`text-primary`,children:r})]})]}),n.model&&(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(x,{className:`h-3 w-3 text-muted-foreground`}),(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:officeMap.model`)})]}),(0,U.jsx)(`span`,{className:`max-w-[120px] truncate font-mono text-primary`,title:n.model,children:n.model.split(`/`).pop()?.slice(0,16)})]}),n.mode&&(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(p,{className:`h-3 w-3 text-muted-foreground`}),(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:officeMap.mode`)})]}),(0,U.jsx)(`span`,{className:k(`font-mono uppercase text-[9px] px-1.5 py-0.5 rounded`,n.mode===`auto`&&`bg-primary/10 text-primary`,n.mode===`suggest`&&`bg-success/10 text-success`,n.mode===`off`&&`bg-muted text-muted-foreground`,![`auto`,`suggest`,`off`].includes(n.mode||``)&&`bg-muted text-muted-foreground`),children:n.mode})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(c,{className:`h-3 w-3 text-muted-foreground`}),(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.toolCallsLabel`)})]}),(0,U.jsx)(`span`,{className:`font-mono text-warning`,children:l(a.toolCalls)})]}),(0,U.jsxs)(`div`,{className:`mt-1.5 space-y-1 border-t border-border/70 pt-1.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(`span`,{className:`text-[8px] text-muted-foreground`,children:`IN`}),(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.input`)})]}),(0,U.jsx)(`span`,{className:`font-mono text-[9px] text-foreground`,children:l(a.tokensIn)})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(`span`,{className:`text-[8px] text-muted-foreground`,children:`OUT`}),(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.output`)})]}),(0,U.jsx)(`span`,{className:`font-mono text-[9px] text-foreground`,children:l(a.tokensOut)})]})]}),(0,U.jsxs)(`div`,{className:`mt-1.5 flex items-center justify-between gap-4 border-t border-border/70 pt-1.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(S,{className:`h-3 w-3 text-muted-foreground`}),(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.cost`)})]}),(0,U.jsx)(`span`,{className:`font-mono font-medium text-success`,children:(e=>e==null?`$0.0000`:`$${e.toFixed(4)}`)(a.costUsd)})]})]})]})}function Y(){let e={opacity:0,width:1,height:1,minWidth:0,border:`none`,background:`transparent`};return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(A,{type:`target`,position:F.Top,style:e,isConnectable:!1}),(0,U.jsx)(A,{type:`source`,position:F.Bottom,style:e,isConnectable:!1})]})}function X({data:e}){let{t}=E();return(0,U.jsxs)(`div`,{className:`mt-2 flex items-center justify-between border-t border-border/60 pt-1.5 text-[8px] text-muted-foreground`,children:[(0,U.jsxs)(`span`,{children:[(0,U.jsx)(`span`,{className:`font-mono text-foreground`,children:e.agentCount??0}),` `,t(`activity:office.agentsSuffix`)]}),e.startedAt&&(0,U.jsx)(`span`,{children:t(`activity:office.upPrefix`,{time:Ce(e.startedAt,Date.now())})})]})}function Pe({data:e}){let{t}=E(),n=e.status===`active`||e.status===`streaming`,r=e.status===`error`,a=e.status===`offline`,o=e.color||q.info;return(0,U.jsxs)(`div`,{className:k(`rounded-xl border-2 p-4 min-w-[180px] transition-all backdrop-blur-sm`,n&&`shadow-lg shadow-primary/15`,r&&`border-destructive/50 bg-destructive/10`,a&&`border-border/70 bg-muted/35 opacity-60`,!n&&!r&&!a&&`border-primary/30 bg-primary/10`),children:[(0,U.jsx)(Y,{}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3 mb-3`,children:[(0,U.jsx)(`div`,{className:k(`flex items-center justify-center w-10 h-10 rounded-lg`,n?`bg-primary/15`:`bg-primary/10`),children:(0,U.jsx)(m,{className:`h-5 w-5`,style:{color:o}})}),(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsx)(`div`,{className:`text-xs font-bold truncate`,style:{color:o},children:e.label}),(0,U.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:t(`activity:office.webuiClient`)})]}),(0,U.jsx)(J,{status:e.status,activity:e.vizActivity??0})]}),e.sublabel&&(0,U.jsx)(`div`,{className:`mb-2 truncate text-[10px] text-muted-foreground`,children:e.sublabel}),(0,U.jsx)(`div`,{className:`flex items-center gap-2 text-[10px] text-muted-foreground`,children:a?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(g,{className:`h-3 w-3 text-muted-foreground`}),(0,U.jsx)(`span`,{children:t(`activity:office.disconnected`)})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(i,{className:`h-3 w-3 text-success`}),(0,U.jsx)(`span`,{children:t(`activity:office.connected`)})]})}),n&&(0,U.jsx)(`div`,{className:`mt-2 h-1 overflow-hidden rounded-full bg-primary/20`,children:(0,U.jsx)(`div`,{className:`h-full animate-pulse bg-primary`,style:{width:`60%`}})}),(0,U.jsx)(X,{data:e})]})}function Z({data:e}){let{t}=E(),n=e.status===`active`||e.status===`streaming`,r=e.status===`error`,i=e.color||q.success;return(0,U.jsxs)(`div`,{className:k(`rounded-xl border-2 p-4 min-w-[180px] transition-all backdrop-blur-sm`,n&&`shadow-lg shadow-success/15`,r&&`border-destructive/50 bg-destructive/10`,!n&&!r&&`border-success/30 bg-success/10`),children:[(0,U.jsx)(Y,{}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3 mb-3`,children:[(0,U.jsx)(`div`,{className:k(`flex items-center justify-center w-10 h-10 rounded-lg`,n?`bg-success/15`:`bg-success/10`),children:(0,U.jsx)(w,{className:`h-5 w-5`,style:{color:i}})}),(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsx)(`div`,{className:`text-xs font-bold truncate`,style:{color:i},children:e.label}),(0,U.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:t(`activity:office.tuiClient`)})]}),(0,U.jsx)(J,{status:e.status,activity:e.vizActivity??0})]}),e.sublabel&&(0,U.jsx)(`div`,{className:`mb-2 truncate text-[10px] text-muted-foreground`,children:e.sublabel}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-muted-foreground`,children:[(0,U.jsx)(w,{className:`h-3 w-3 text-success`}),(0,U.jsx)(`span`,{children:t(`activity:office.terminal`)})]}),(0,U.jsx)(X,{data:e})]})}function Fe({data:e}){let{t}=E(),n=e.status===`active`||e.status===`streaming`,r=e.color||q.warning;return(0,U.jsxs)(`div`,{className:k(`rounded-xl border-2 p-4 min-w-[160px] transition-all backdrop-blur-sm`,n&&`shadow-lg shadow-warning/15`,!n&&`border-warning/30 bg-warning/10`),children:[(0,U.jsx)(Y,{}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3 mb-3`,children:[(0,U.jsx)(`div`,{className:k(`flex items-center justify-center w-10 h-10 rounded-lg`,n?`bg-warning/15`:`bg-warning/10`),children:(0,U.jsx)(w,{className:`h-5 w-5`,style:{color:r}})}),(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsx)(`div`,{className:`text-xs font-bold truncate`,style:{color:r},children:e.label}),(0,U.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:t(`activity:office.repl`)})]}),(0,U.jsx)(J,{status:e.status,activity:e.vizActivity??0})]}),e.sublabel&&(0,U.jsx)(`div`,{className:`mb-1 truncate text-[10px] text-muted-foreground`,children:e.sublabel}),(0,U.jsx)(X,{data:e})]})}function Ie({data:e}){let{t}=E(),n=e.status===`active`||e.status===`streaming`,r=e.color||q.primary;return(0,U.jsxs)(`div`,{className:`relative min-w-[200px] rounded-xl border-2 border-border/70 bg-card/90 p-4 shadow-lg backdrop-blur-sm transition-all`,children:[(0,U.jsx)(Y,{}),(0,U.jsx)(`div`,{className:`absolute -top-3 left-1/2 -translate-x-1/2 rounded-full bg-primary px-2 py-0.5 text-[9px] font-bold text-primary-foreground`,children:t(`activity:office.coordinator`)}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3 mb-3 mt-2`,children:[(0,U.jsx)(`div`,{className:k(`flex items-center justify-center w-12 h-12 rounded-xl`,n?`bg-primary/15`:`bg-primary/10`),children:(0,U.jsx)(x,{className:`h-6 w-6`,style:{color:r}})}),(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsx)(`div`,{className:`text-sm font-bold truncate`,style:{color:r},children:e.label}),(0,U.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:e.sublabel||t(`activity:office.fleetSummary`)})]}),(0,U.jsx)(J,{status:e.status,activity:e.vizActivity??0})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-[10px] mb-2`,children:[(0,U.jsxs)(`div`,{className:`rounded bg-muted/40 p-1.5 text-center`,children:[(0,U.jsxs)(`div`,{className:`font-mono`,children:[(0,U.jsx)(`span`,{className:`text-success`,children:e.agentsActive||0}),(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:` / `}),(0,U.jsx)(`span`,{className:`text-primary`,children:e.agentsTotal||0})]}),(0,U.jsx)(`div`,{className:`text-muted-foreground`,children:t(`activity:officeMap.agents`)})]}),(0,U.jsxs)(`div`,{className:`rounded bg-muted/40 p-1.5 text-center`,children:[(0,U.jsx)(`div`,{className:`font-mono text-warning`,children:(e.toolCalls||0).toLocaleString()}),(0,U.jsx)(`div`,{className:`text-muted-foreground`,children:t(`activity:office.toolCallsLabel`)})]}),(0,U.jsxs)(`div`,{className:`rounded bg-muted/40 p-1.5 text-center`,children:[(0,U.jsx)(`div`,{className:`font-mono text-foreground`,children:K(e.tokensIn)}),(0,U.jsx)(`div`,{className:`text-muted-foreground`,children:t(`activity:office.tokensLabel`)})]}),(0,U.jsxs)(`div`,{className:`rounded bg-muted/40 p-1.5 text-center`,children:[(0,U.jsxs)(`div`,{className:`font-mono text-success`,children:[`$`,(e.costUsd||0).toFixed(3)]}),(0,U.jsx)(`div`,{className:`text-muted-foreground`,children:t(`activity:office.cost`)})]})]}),n&&(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-primary`,children:[(0,U.jsx)(`span`,{className:`h-2 w-2 animate-pulse rounded-full bg-primary`}),t(`activity:office.coordinatingFleet`)]})]})}function Le({data:e}){let{t}=E(),n=e.status===`active`||e.status===`streaming`,r=e.status===`error`,i=e.status===`completed`,a=e.color||q.primary,s=Me(e.ctxPct);return(0,U.jsxs)(`div`,{className:k(`rounded-lg border p-3 min-w-[150px] transition-all backdrop-blur-sm`,n&&`border-primary/50 bg-primary/10 shadow-lg shadow-primary/10`,r&&`border-destructive/50 bg-destructive/10`,i&&`border-border/70 bg-muted/35`,!n&&!r&&!i&&`border-primary/30 bg-primary/10`),children:[(0,U.jsx)(Y,{}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,U.jsx)(o,{className:`h-4 w-4 shrink-0`,style:{color:a}}),(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsx)(`div`,{className:`text-[11px] font-bold truncate`,style:{color:a},children:e.label}),e.model&&(0,U.jsx)(`div`,{className:`truncate text-[8px] text-muted-foreground`,children:we(e.model)})]}),(0,U.jsx)(J,{status:e.status,small:!0,activity:e.vizActivity??0})]}),e.currentTask&&(0,U.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1 truncate text-[9px] text-primary`,children:[(0,U.jsx)(`span`,{className:k(`h-1.5 w-1.5 shrink-0 rounded-full bg-primary`,n&&`animate-pulse`)}),(0,U.jsx)(`span`,{className:`truncate font-mono`,children:e.currentTask})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-2 gap-y-0.5 text-[9px] mb-1.5`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between`,children:[(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:`iter`}),(0,U.jsx)(`span`,{className:`font-mono text-foreground`,children:e.iteration||0})]}),(0,U.jsxs)(`div`,{className:`flex justify-between`,children:[(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:`tools`}),(0,U.jsx)(`span`,{className:`font-mono text-warning`,children:e.toolCalls||0})]}),(0,U.jsxs)(`div`,{className:`flex justify-between`,children:[(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:`tok`}),(0,U.jsx)(`span`,{className:`font-mono text-foreground`,children:K((e.tokensIn||0)+(e.tokensOut||0))})]}),(0,U.jsxs)(`div`,{className:`flex justify-between`,children:[(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:`cost`}),(0,U.jsxs)(`span`,{className:`font-mono text-success`,children:[`$`,(e.costUsd||0).toFixed(3)]})]})]}),s>0&&(0,U.jsxs)(`div`,{className:`mb-1`,children:[(0,U.jsxs)(`div`,{className:`mb-0.5 flex justify-between text-[8px] text-muted-foreground`,children:[(0,U.jsx)(`span`,{children:`ctx`}),(0,U.jsxs)(`span`,{className:k(`font-mono`,s>=90?`text-destructive`:s>=70?`text-warning`:`text-muted-foreground`),children:[s,`%`]})]}),(0,U.jsx)(`div`,{className:`h-1 overflow-hidden rounded-full bg-muted`,children:(0,U.jsx)(`div`,{className:k(`h-full`,s>=90?`bg-destructive`:s>=70?`bg-warning`:`bg-primary`),style:{width:`${s}%`}})})]}),e.lastActivityAt&&(0,U.jsxs)(`div`,{className:k(`flex items-center gap-1 text-[8px]`,n?`text-muted-foreground/70`:`text-muted-foreground`),children:[i&&(0,U.jsx)(`span`,{className:`text-success`,children:t(`activity:office.donePrefix`)}),r&&(0,U.jsx)(`span`,{className:`text-destructive`,children:t(`activity:office.failedPrefix`)}),(0,U.jsx)(`span`,{children:t(`activity:office.seenPrefix`,{time:Se(e.lastActivityAt,Date.now())})})]})]})}function Re({data:e}){let{t}=E();return(0,U.jsxs)(`div`,{className:k(`rounded-lg border border-dashed p-3 min-w-[120px] transition-all opacity-40`,`border-border/70 bg-muted/30`),children:[(0,U.jsx)(Y,{}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,U.jsx)(s,{className:`h-4 w-4 text-muted-foreground`}),(0,U.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,U.jsx)(`div`,{className:`truncate text-[10px] text-muted-foreground`,children:e.label})}),(0,U.jsx)(J,{status:e.status,small:!0,activity:e.vizActivity??0})]}),(0,U.jsx)(`div`,{className:`text-[9px] text-muted-foreground`,children:t(`activity:office.availableDesk`)})]})}function Q({data:e}){let{t}=E(),n=e.color||q.warning,r=(e.unreadCount||0)>0;return(0,U.jsxs)(`div`,{className:k(`rounded-xl border-2 p-4 min-w-[160px] transition-all backdrop-blur-sm`,r&&`border-warning/50 bg-warning/10 shadow-lg shadow-warning/10`,!r&&`border-warning/30 bg-warning/6`),children:[(0,U.jsx)(Y,{}),(0,U.jsxs)(`div`,{className:`flex items-center gap-3 mb-3`,children:[(0,U.jsx)(`div`,{className:k(`flex items-center justify-center w-10 h-10 rounded-lg`,r?`bg-warning/18`:`bg-warning/10`),children:(0,U.jsx)(v,{className:`h-5 w-5`,style:{color:n}})}),(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsx)(`div`,{className:`text-xs font-bold`,style:{color:n},children:t(`activity:office.mailboxHub`)}),(0,U.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:r?t(`activity:office.unreadSuffix`,{count:e.unreadCount||0}):t(`activity:office.allClear`)})]}),r&&(0,U.jsx)(`div`,{className:`flex h-5 w-5 items-center justify-center rounded-full bg-warning text-[10px] font-bold text-background`,children:e.unreadCount})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-[10px]`,children:[(0,U.jsxs)(`div`,{className:`rounded bg-muted/40 p-1.5 text-center`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-center gap-1 text-warning`,children:[(0,U.jsx)(b,{className:`h-3 w-3`}),(0,U.jsx)(`span`,{children:e.messageCount||0})]}),(0,U.jsx)(`div`,{className:`text-muted-foreground`,children:t(`activity:office.total`)})]}),(0,U.jsxs)(`div`,{className:`rounded bg-muted/40 p-1.5 text-center`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-center gap-1 text-success`,children:[(0,U.jsx)(u,{className:`h-3 w-3`}),(0,U.jsx)(`span`,{children:e.unreadCount||0})]}),(0,U.jsx)(`div`,{className:`text-muted-foreground`,children:t(`activity:office.unreadLabel`)})]})]}),e.sublabel&&(0,U.jsxs)(`div`,{className:`mt-2 truncate border-t border-border/60 pt-1.5 text-[9px] text-muted-foreground`,children:[`✉ `,e.sublabel]})]})}var ze={webui:Pe,tui:Z,repl:Fe,coordinator:Ie,agent:Le,mailbox:Q,desk:Re},Be={wire:({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i,targetPosition:a,data:o,selected:s})=>{let c=o?.color||q.primary,l=R(e=>e.animateEdges),u=o?.animated&&l?Math.max(.15,o?.intensity??.6):0,[d,f,p]=ne({sourceX:e,sourceY:t,sourcePosition:i??F.Bottom,targetX:n,targetY:r,targetPosition:a??F.Top,curvature:.28}),m=5+u*7,h=5+u*4,g=m+h,_=`${Math.max(.5,1.6-u).toFixed(2)}s`;return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`path`,{d,fill:`none`,stroke:c,strokeWidth:s?2.5:1.4,strokeOpacity:s?.9:.28,className:`react-flow__edge-path`}),u>.05&&(0,U.jsx)(`path`,{d,fill:`none`,stroke:c,strokeWidth:2.2,strokeOpacity:.45+u*.5,strokeDasharray:`${m} ${h}`,strokeLinecap:`round`,style:{filter:`drop-shadow(0 0 ${2+u*4}px ${c})`},children:(0,U.jsx)(`animate`,{attributeName:`stroke-dashoffset`,from:g,to:`0`,dur:_,repeatCount:`indefinite`})}),o?.label&&u>.1&&(0,U.jsx)(P,{children:(0,U.jsx)(`div`,{style:{position:`absolute`,transform:`translate(-50%, -50%) translate(${f}px, ${p}px)`},className:`pointer-events-none rounded-full border border-border/70 bg-card/90 px-1.5 py-0.5 text-[8px] font-medium text-foreground backdrop-blur-sm`,children:o.label})})]})}};function Ve({events:e,now:t}){let{t:n}=E(),r=e.slice(0,14);return(0,U.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 z-10 pointer-events-none px-3 pb-3`,children:(0,U.jsxs)(`div`,{className:`pointer-events-auto mx-auto max-w-3xl rounded-lg border border-border/70 bg-card/90 px-3 py-2 shadow-xl backdrop-blur`,children:[(0,U.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 text-[10px] uppercase text-primary`,children:[(0,U.jsx)(O,{className:`h-3 w-3`}),n(`activity:office.liveActivity`)]}),r.length===0?(0,U.jsx)(`div`,{className:`text-[11px] italic text-muted-foreground`,children:n(`activity:office.waitingActivity`)}):(0,U.jsx)(`div`,{className:`flex flex-col gap-0.5 max-h-32 overflow-hidden`,children:r.map(e=>{let r=Math.max(0,Math.round((t-e.timestamp)/1e3));return(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] leading-tight`,children:[(0,U.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full shrink-0`,style:{backgroundColor:je(e.kind)}}),(0,U.jsx)(`span`,{className:`flex-1 truncate text-foreground`,children:e.label}),(0,U.jsx)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:r<1?n(`activity:office.now`):`${r}s`})]},e.id)})})]})})}function $(){let{t:e}=E(),{fitView:t}=oe(),n=ee(e=>e.events),r=de(e=>e.agents),i=de(e=>e.agentTranscripts),s=de(e=>e.leaderId),c=fe(e=>e.liveSessions),u=me(e=>e.messages),f=te(e=>e.session),p=(0,H.useMemo)(()=>Ae(c,r),[c,r]),g=R(e=>e.showHud),_=R(e=>e.showLegend),y=R(e=>e.showMinimap),S=R(e=>e.showControls),C=R(e=>e.showFeed),T=R(e=>e.setShowFeed),D=R(e=>e.background),[O,A,j]=N([]),[ne,P,F]=M([]),[I,L]=(0,H.useState)(null),[z,B]=(0,H.useState)(null),[V,ge]=(0,H.useState)(!1),[W,_e]=(0,H.useState)(``),[G,ve]=(0,H.useState)(!1),[ye,be]=(0,H.useState)(null),De=(0,H.useMemo)(()=>{if(I?.data.kind!==`agent`)return pe;let e=I.data.serverId??(I.id.includes(`__agent-`)?I.id.split(`__agent-`).pop():I.id.replace(/^agent-/,``));return e?i.get(e)??pe:pe},[i,I]),ke=(0,H.useCallback)(async()=>{let e=W.trim();if(!(!e||G)){ve(!0),be(null);try{let t=await fetch(`/api/fleet/broadcast`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({text:e})});if(!t.ok)throw Error(`HTTP ${t.status}`);let n=await t.json();_e(``),be(`Delivered to ${n.delivered??0}/${n.targets??0} session(s)`)}catch(e){be(`Failed: ${e instanceof Error?e.message:String(e)}`)}finally{ve(!1)}}},[W,G]),je=(0,H.useRef)(new Map),J=4e3,Y=(0,H.useRef)(new Map),X=(0,H.useRef)(new Map),Pe=(0,H.useRef)(new Map),Z=(0,H.useRef)(new Map),Fe=(0,H.useRef)(``);(0,H.useEffect)(()=>{let n=[],i=[],a=Date.now(),o=Math.max(1,...p.map(e=>e.agents.length||1)),c=Math.max(380,Math.min(3,o)*190+80),l=Te(p.map(e=>e.id),c),d=u.filter(e=>!e.completed&&(e.readByCount??0)===0).length,f=u.length?[...u].sort((e,t)=>Date.parse(t.timestamp)-Date.parse(e.timestamp))[0]:void 0;n.push({id:`mailbox`,type:`mailbox`,position:{x:830,y:50},data:{label:e(`activity:office.mailboxHub`),kind:`mailbox`,status:d>0?`active`:`idle`,unreadCount:d,messageCount:u.length,sublabel:f?`${f.from} → ${f.to}: ${f.subject}`:void 0,color:q.warning}});let m=0,h=0,g=0,_=0,v=0;for(let e of p)for(let t of e.agents)h+=1,(t.status===`active`||t.status===`streaming`)&&(m+=1),g+=t.toolCalls,_+=t.costUsd,v+=t.tokensIn+t.tokensOut;let y=s?r.get(s):null,b=m>0;n.push({id:`coordinator`,type:`coordinator`,position:{x:370,y:50},data:{label:e(`activity:office.fleetHqLabel`),sublabel:e(`activity:office.clientsSuffix`,{count:p.length}),kind:`coordinator`,status:y?.status===`failed`?`error`:b?`active`:`idle`,connections:p.length,agentsActive:m,agentsTotal:h,toolCalls:g,costUsd:_,tokensIn:v,color:q.primary}});let x={tui:q.success,webui:q.info,repl:q.warning};for(let t of p){let r=l.get(t.id)??600,o=x[t.type],s=t.status===`active`;if(n.push({id:t.id,type:t.type,position:{x:r,y:370},data:{label:t.label,sublabel:t.sublabel,kind:t.type,status:t.status,sessionId:t.sessionId,pid:t.pid,branch:t.branch,workingDir:t.workingDir,startedAt:t.startedAt,agentCount:t.agents.length,color:o}}),i.push({id:`${t.id}->coordinator`,source:t.id,target:`coordinator`,type:`wire`,animated:s,data:{color:o,animated:s,label:e(`activity:office.controlLabel`),flowType:`task`}}),i.push({id:`mailbox->${t.id}`,source:`mailbox`,target:t.id,type:`wire`,animated:d>0,data:{color:q.warning,animated:d>0,label:d>0?`${d}`:void 0,flowType:`mail`}}),t.agents.length===0){n.push({id:`desk-${t.id}`,type:`desk`,position:{x:r,y:640},data:{label:e(`activity:office.idleDesk`),kind:`agent`,status:`idle`,color:q.muted}});continue}t.agents.forEach((o,s)=>{let c=o.status===`active`||o.status===`streaming`,l=Z.current.get(o.serverId);if(l&&(o.toolCalls>l.toolCalls||o.iteration>l.iteration)||c){je.current.set(o.officeId,a+J);let e=X.current.get(o.officeId)??0;X.current.set(o.officeId,Math.min(1,e+(1-e)*.5));for(let e of[`${t.id}->${o.officeId}`,`${t.id}->coordinator`]){let t=Y.current.get(e)??0;Y.current.set(e,Math.min(1,t+.5))}}Z.current.set(o.serverId,{toolCalls:o.toolCalls,iteration:o.iteration}),n.push({id:o.officeId,type:`agent`,position:Ee(r,s,t.agents.length),data:{label:o.name,kind:`agent`,status:o.status,serverId:o.serverId,sessionId:t.sessionId,currentTask:o.currentTask,iteration:o.iteration,toolCalls:o.toolCalls,costUsd:o.costUsd,tokensIn:o.tokensIn,tokensOut:o.tokensOut,ctxPct:o.ctxPct,model:o.model,lastActivityAt:o.lastActivityAt,color:q.primary}}),i.push({id:`${t.id}->${o.officeId}`,source:t.id,target:o.officeId,type:`wire`,animated:c,data:{color:q.primary,animated:c,label:c?o.currentTask??e(`activity:office.taskFallback`):void 0,flowType:`task`}})})}let S=new Set(p.flatMap(e=>e.agents.map(e=>e.serverId)));for(let e of[...Z.current.keys()])S.has(e)||Z.current.delete(e);let C=n.map(e=>{let t=je.current.get(e.id),n=X.current.get(e.id)??0;return t&&t>a&&e.data.status!==`error`&&e.data.status!==`offline`?{...e,data:{...e.data,status:`active`,vizActivity:n}}:{...e,data:{...e.data,vizActivity:n}}}),w=i.map(e=>{let t=Y.current.get(e.id)??0;return t>.05?{...e,animated:!0,data:{...e.data,animated:!0,intensity:t}}:e}),T=new Map;for(let e of C)T.set(e.id,{...e.position});Pe.current=T,A(C),P(w);let E=C.map(e=>e.id).sort().join(`|`);if(E!==Fe.current){Fe.current=E;let e=setTimeout(()=>t({padding:.2,duration:300}),50);return()=>clearTimeout(e)}},[p,s,r,u,f,J,A,P,t]);let Ie=p.flatMap(e=>e.agents.map(t=>({clientId:e.id,clientType:e.type,officeId:t.officeId,serverId:t.serverId}))),Le=p.map(e=>e.id),Re=new Map;for(let e of Ie)(!Re.has(e.serverId)||e.clientType===`webui`)&&Re.set(e.serverId,e.officeId);function Q(e){return Re.get(e)??`agent-${e}`}function $(e){let t=e.split(`__agent-`)[0];return t&&t!==e?`${t}->${e}`:`coordinator->${e}`}function He(e){switch(e.kind){case`mailbox:send`:case`mailbox:deliver`:return{nodes:[`mailbox`],edges:e.kind===`mailbox:send`?Le.map(e=>`mailbox->${e}`):[],status:`active`};case`agent:spawned`:{let t=Q(e.source);return{nodes:[`coordinator`,t],edges:[$(t)],status:`active`}}case`agent:tool`:case`tool:started`:case`tool:progress`:{let t=Q(e.source);return{nodes:[`coordinator`,t],edges:[$(t)],status:e.kind===`tool:progress`||e.kind===`tool:started`?`streaming`:`active`}}case`tool:executed`:{let t=Q(e.target??e.source);return{nodes:[t],edges:[$(t)],status:`active`}}case`provider:call`:case`provider:delta`:case`provider:response`:return{nodes:[`coordinator`],edges:[],status:e.kind===`provider:delta`?`streaming`:`active`};case`iteration:start`:case`iteration:end`:return{nodes:[`coordinator`],edges:Ie.map(e=>$(e.officeId)),status:e.kind===`iteration:start`?`streaming`:`active`};case`agent:text`:{let t=Q(e.source);return{nodes:[t],edges:[$(t)],status:`streaming`}}case`agent:status`:{let t=Q(e.source);return{nodes:[`coordinator`,t],edges:[$(t)],status:e.data&&typeof e.data==`object`&&`status`in e.data&&String(e.data.status)===`failed`?`error`:`completed`}}case`agent:ctx`:return{nodes:[Q(e.source)],edges:[],status:`active`};case`budget:extended`:return{nodes:[`coordinator`,Q(e.source)],edges:[],status:`active`};case`context:compacted`:case`context:repaired`:return{nodes:[`coordinator`],edges:[],status:`active`};case`error`:return{nodes:e.source?[Q(e.source)]:[],edges:[],status:`error`};case`cost:update`:return{nodes:[`coordinator`],edges:[],status:`active`};case`fleet:snapshot`:{let t=e.data?.sessions??[],n=[`coordinator`];for(let e of t)if(e.agents)for(let t of e.agents){let e=Q(t.id);n.includes(e)||n.push(e)}return{nodes:n,edges:[],status:`active`}}default:return{nodes:[],edges:[],status:`idle`}}}(0,H.useEffect)(()=>{if(n.length===0)return;let e=n[0];if(!e)return;let{nodes:t,edges:r,status:i}=He(e),a=Date.now();t.length>0&&(t.forEach(e=>{je.current.set(e,a+J);let t=X.current.get(e)??0;X.current.set(e,Math.min(1,t+(1-t)*.5))}),A(e=>e.map(e=>t.includes(e.id)?{...e,data:{...e.data,status:i,vizActivity:X.current.get(e.id)??0}}:e))),r.length>0&&(r.forEach(e=>{let t=Y.current.get(e)??0;Y.current.set(e,Math.min(1,t+.5))}),P(e=>e.map(e=>r.includes(e.id)?{...e,animated:!0,data:{...e.data,animated:!0,intensity:Y.current.get(e.id)??1}}:e)))},[n,A,P,J,r]),(0,H.useEffect)(()=>{let e=setInterval(()=>{let e=new Map,t=!1;for(let[n,r]of Y.current){let i=r*.85;i<.05?(Y.current.delete(n),e.set(n,{intensity:0,animated:!1}),t=!0):(Y.current.set(n,i),e.set(n,{intensity:i,animated:!0}),t=!0)}t&&P(t=>t.map(t=>{let n=e.get(t.id);return n?{...t,animated:n.animated,data:{...t.data,animated:n.animated,intensity:n.intensity}}:t}));let n=new Map,r=!1;for(let[e,t]of X.current){let i=t*.9;i<.03?(X.current.delete(e),n.set(e,0),r=!0):(X.current.set(e,i),n.set(e,i),r=!0)}r&&A(e=>e.map(e=>{let t=n.get(e.id);return t===void 0?e:{...e,data:{...e.data,vizActivity:t}}}))},1e3);return()=>clearInterval(e)},[P,A]);let Ue=(0,H.useCallback)(e=>P(t=>re({...e,type:`wire`},t)),[P]),We=(0,H.useCallback)((e,t)=>{L(t)},[]),Ge=(0,H.useCallback)(()=>{L(null)},[]);(0,H.useEffect)(()=>{if(!z)return;let e=e=>{e.key===`Escape`&&B(null)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[z]);let Ke=(0,H.useCallback)(()=>{A(e=>e.map(e=>{let t=Pe.current.get(e.id);return t?{...e,position:{...t}}:e})),setTimeout(()=>t({padding:.2,duration:300}),50)},[A,t]),[,qe]=(0,H.useState)(0);return(0,H.useEffect)(()=>{let e=setInterval(()=>{document.hidden||qe(e=>e+1)},2e3);return()=>clearInterval(e)},[]),(0,U.jsxs)(`div`,{className:`relative h-full w-full overflow-hidden bg-[hsl(var(--surface-2)/0.55)]`,children:[(0,U.jsx)(`div`,{className:`absolute inset-0 opacity-[0.03]`,style:{backgroundImage:`
|
|
2
|
+
linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px),
|
|
3
|
+
linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px)
|
|
4
|
+
`,backgroundSize:`40px 40px`}}),g&&(0,U.jsx)(Ne,{}),(0,U.jsx)(`div`,{className:`absolute top-3 left-1/2 -translate-x-1/2 z-10`,children:(0,U.jsx)(`div`,{className:`rounded-lg border border-border/70 bg-card/90 px-4 py-2 shadow-xl backdrop-blur`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-bold text-foreground`,children:[(0,U.jsx)(d,{className:`h-4 w-4 text-primary`}),e(`activity:office.fleetHq`),(0,U.jsx)(`span`,{className:`ml-2 h-2 w-2 animate-pulse rounded-full bg-success`}),(0,U.jsx)(`span`,{className:`text-[10px] font-normal text-muted-foreground`,children:e(`activity:office.live`)})]})})}),_&&(0,U.jsxs)(`div`,{className:`absolute bottom-4 left-4 z-10 rounded-lg border border-border/70 bg-card/90 p-3 text-[10px] shadow-xl backdrop-blur`,children:[(0,U.jsx)(`div`,{className:`mb-2 font-bold text-foreground`,children:e(`activity:office.legendStatus`)}),(0,U.jsxs)(`div`,{className:`space-y-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`h-2 w-2 animate-pulse rounded-full bg-success`}),(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.legendActive`)})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`h-2 w-2 rounded-full bg-muted-foreground`}),(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.legendIdle`)})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`h-2 w-2 animate-pulse rounded-full bg-destructive`}),(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.legendError`)})]})]})]}),_&&(0,U.jsxs)(`div`,{className:`absolute bottom-4 right-4 z-10 rounded-lg border border-border/70 bg-card/90 p-3 text-[10px] shadow-xl backdrop-blur`,children:[(0,U.jsx)(`div`,{className:`mb-2 font-bold text-foreground`,children:e(`activity:office.legendConnections`)}),(0,U.jsxs)(`div`,{className:`space-y-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-warning`,children:`✉`}),(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.legendMail`)})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-primary`,children:`→`}),(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.legendTask`)})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-success`,children:`●`}),(0,U.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.legendStatusConn`)})]})]})]}),(0,U.jsxs)(ue,{nodes:O,edges:ne,onNodesChange:j,onEdgesChange:F,onConnect:Ue,onNodeClick:We,onPaneClick:Ge,nodeTypes:ze,edgeTypes:Be,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:1.5,defaultEdgeOptions:{type:`wire`},proOptions:{hideAttribution:!0},children:[(0,U.jsxs)(ce,{position:`top-right`,className:`flex items-center gap-2`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:Ke,title:e(`activity:office.arrangeTitle`),className:`flex items-center gap-1.5 rounded-md border border-border/70 bg-card/90 px-2.5 py-1.5 text-xs text-foreground shadow-sm transition-colors hover:bg-accent`,children:[(0,U.jsx)(a,{className:`h-3.5 w-3.5`}),e(`activity:office.arrange`)]}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>T(!C),title:e(`activity:office.feedTitle`),className:k(`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md border text-xs transition-colors`,C?`border-primary/35 bg-primary/10 text-primary`:`border-border/70 bg-card/90 text-muted-foreground hover:bg-accent hover:text-foreground`),children:[(0,U.jsx)(l,{className:`h-3.5 w-3.5`}),e(`activity:office.feed`)]}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>ge(e=>!e),title:e(`activity:office.broadcastTitle`),className:k(`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md border text-xs transition-colors`,V?`border-warning/35 bg-warning/10 text-warning`:`border-border/70 bg-card/90 text-muted-foreground hover:bg-accent hover:text-foreground`),children:[(0,U.jsx)(b,{className:`h-3.5 w-3.5`}),e(`activity:office.broadcast`)]})]}),D!==`none`&&(0,U.jsx)(le,{variant:D===`lines`?ie.Lines:D===`cross`?ie.Cross:ie.Dots,gap:20,size:1,color:`hsl(var(--border) / 0.35)`}),S&&(0,U.jsx)(se,{className:`rounded-lg border border-border/70 bg-card/90 [&>button]:bg-card [&>button]:text-foreground`}),y&&(0,U.jsx)(ae,{className:`rounded-lg border border-border/70 bg-card/90`,nodeColor:e=>{switch(e.data.kind){case`coordinator`:return q.primary;case`webui`:return q.info;case`tui`:return q.success;case`repl`:return q.warning;case`mailbox`:return q.warning;case`agent`:return q.primary;default:return q.primary}},maskColor:`hsl(var(--background) / 0.72)`})]}),C&&(0,U.jsx)(Ve,{events:n,now:Date.now()}),V&&(0,U.jsxs)(`div`,{className:`absolute right-4 top-16 z-30 w-80 rounded-xl border border-warning/35 bg-card/95 p-3 shadow-2xl backdrop-blur`,children:[(0,U.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] font-semibold text-warning`,children:[(0,U.jsx)(b,{className:`h-3.5 w-3.5`}),` `,e(`activity:office.broadcastToAll`)]}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>ge(!1),className:`text-base leading-none text-muted-foreground hover:text-foreground`,children:`×`})]}),(0,U.jsx)(`textarea`,{value:W,onChange:e=>_e(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),ke())},rows:3,placeholder:e(`activity:office.broadcastPlaceholder`),className:`w-full resize-none rounded-md border border-border/70 bg-background/70 px-2 py-1 text-[11px] text-foreground placeholder:text-muted-foreground focus:border-warning/45 focus:outline-none`}),(0,U.jsxs)(`div`,{className:`mt-1.5 flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-[9px] text-muted-foreground`,children:e(`activity:office.broadcastSendHint`)}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>void ke(),disabled:G||!W.trim(),className:`rounded-md border border-warning/35 bg-warning/12 px-2.5 py-1 text-[11px] text-warning transition-colors hover:bg-warning/18 disabled:cursor-not-allowed disabled:opacity-40`,children:G?`…`:e(`activity:office.broadcast`)})]}),ye&&(0,U.jsx)(`div`,{className:`mt-1 text-[10px] text-muted-foreground`,children:ye})]}),I&&(0,U.jsxs)(`div`,{className:k(`absolute top-20 right-4 bg-background border border-border rounded-lg p-4 shadow-xl z-20`,I.data.kind===`agent`?`w-[28rem] max-w-[calc(100%-2rem)]`:I.data.sessionId?`w-80`:`w-64`),children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[I.data.kind===`webui`&&(0,U.jsx)(m,{className:`h-4 w-4 text-info`}),I.data.kind===`tui`&&(0,U.jsx)(w,{className:`h-4 w-4 text-success`}),I.data.kind===`coordinator`&&(0,U.jsx)(x,{className:`h-4 w-4 text-primary`}),I.data.kind===`agent`&&(0,U.jsx)(o,{className:`h-4 w-4 text-primary`}),I.data.kind===`mailbox`&&(0,U.jsx)(v,{className:`h-4 w-4 text-warning`}),(0,U.jsx)(`span`,{className:`text-sm font-bold text-foreground`,children:I.data.label})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[I.data.sessionId&&(0,U.jsx)(`button`,{type:`button`,title:e(`activity:office.openFullView`),onClick:()=>B({sessionId:I.data.sessionId,label:I.data.label}),className:`text-muted-foreground hover:text-primary`,children:(0,U.jsx)(h,{className:`h-3.5 w-3.5`})}),(0,U.jsx)(`button`,{type:`button`,onClick:Ge,className:`text-muted-foreground hover:text-foreground text-lg leading-none`,children:`×`})]})]}),(()=>{let t=I.data,n=Date.now(),r=({k:e,v:t,accent:n})=>(0,U.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,U.jsx)(`span`,{className:`text-muted-foreground shrink-0`,children:e}),(0,U.jsx)(`span`,{className:k(`font-mono truncate text-right`,n??`text-foreground/80`),children:t})]}),i=t.kind===`agent`,a=t.kind===`webui`||t.kind===`tui`||t.kind===`repl`,o=(t.tokensIn||0)+(t.tokensOut||0),s=Me(t.ctxPct);return(0,U.jsxs)(`div`,{className:`space-y-1.5 text-xs`,children:[(0,U.jsx)(r,{k:`Status`,v:String(t.status).toUpperCase(),accent:k(t.status===`active`&&`text-success`,t.status===`streaming`&&`text-primary`,t.status===`error`&&`text-destructive`,t.status===`idle`&&`text-muted-foreground`,t.status===`offline`&&`text-muted-foreground/70`)}),i&&(0,U.jsxs)(U.Fragment,{children:[t.model&&(0,U.jsx)(r,{k:`Model`,v:we(t.model),accent:`text-primary`}),t.currentTask&&(0,U.jsx)(r,{k:`Tool`,v:t.currentTask,accent:`text-primary`}),(0,U.jsx)(r,{k:`Iterations`,v:t.iteration||0,accent:`text-primary`}),(0,U.jsx)(r,{k:`Tool calls`,v:t.toolCalls||0,accent:`text-warning`}),(0,U.jsx)(r,{k:`Tokens in`,v:K(t.tokensIn)}),(0,U.jsx)(r,{k:`Tokens out`,v:K(t.tokensOut)}),(0,U.jsx)(r,{k:`Tokens total`,v:K(o)}),s>0&&(0,U.jsx)(r,{k:`Context`,v:`${s}%`,accent:s>=90?`text-destructive`:s>=70?`text-warning`:`text-foreground/70`}),(0,U.jsx)(r,{k:`Cost`,v:`$${(t.costUsd||0).toFixed(4)}`,accent:`text-success`}),t.lastActivityAt&&(0,U.jsx)(r,{k:`Last seen`,v:Se(t.lastActivityAt,n),accent:`text-muted-foreground`}),(0,U.jsx)(`div`,{className:`pt-2`,children:(0,U.jsx)(he,{entries:De,agentName:t.label,compact:!0,maxHeightClassName:`max-h-64`})})]}),a&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(r,{k:`Surface`,v:Oe(t.kind),accent:`text-foreground/80`}),t.branch&&(0,U.jsx)(r,{k:`Branch`,v:`⎇ ${t.branch}`,accent:`text-foreground/70`}),t.pid!=null&&(0,U.jsx)(r,{k:`PID`,v:t.pid}),t.workingDir&&(0,U.jsx)(r,{k:`Dir`,v:t.workingDir,accent:`text-muted-foreground`}),(0,U.jsx)(r,{k:`Agents`,v:t.agentCount??0,accent:`text-primary`}),t.startedAt&&(0,U.jsx)(r,{k:`Uptime`,v:Ce(t.startedAt,n),accent:`text-foreground/70`})]}),t.kind===`mailbox`&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(r,{k:`Total messages`,v:t.messageCount||0,accent:`text-warning`}),(0,U.jsx)(r,{k:`Unread`,v:t.unreadCount||0,accent:`text-warning`}),u.length>0&&(0,U.jsxs)(`div`,{className:`mt-1 space-y-1 border-t border-border pt-2`,children:[(0,U.jsx)(`div`,{className:`text-[10px] uppercase tracking-wide text-muted-foreground`,children:e(`activity:office.recent`)}),[...u].sort((e,t)=>Date.parse(t.timestamp)-Date.parse(e.timestamp)).slice(0,6).map(t=>(0,U.jsxs)(`div`,{className:`flex items-start gap-1.5 text-[10px]`,children:[(0,U.jsx)(`span`,{className:k(`mt-1 h-1.5 w-1.5 shrink-0 rounded-full`,!t.completed&&(t.readByCount??0)===0?`bg-warning`:t.completed?`bg-success`:`bg-muted`)}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`div`,{className:`truncate text-foreground/80`,children:t.subject||e(`activity:office.noSubject`)}),(0,U.jsxs)(`div`,{className:`truncate font-mono text-[9px] text-muted-foreground`,children:[t.from,` → `,t.to,` · `,Se(t.timestamp,n)]})]})]},t.id))]})]}),t.kind===`coordinator`&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(r,{k:`Connections`,v:t.connections||0,accent:`text-primary`}),(0,U.jsx)(r,{k:`Iterations`,v:t.iteration||0,accent:`text-primary`})]}),(i||a)&&t.sessionId&&(0,U.jsx)(`div`,{className:`mt-2 border-t border-border pt-2 h-72`,children:(0,U.jsx)(xe,{sessionId:t.sessionId})})]})})()]}),z&&(0,U.jsxs)(`div`,{className:`absolute inset-y-0 right-0 z-30 flex w-[min(680px,92%)] flex-col border-l border-border bg-background shadow-2xl`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-4 py-2.5 shrink-0 bg-card`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,U.jsx)(o,{className:`h-4 w-4 text-primary shrink-0`}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`div`,{className:`truncate text-sm font-bold text-foreground`,children:z.label}),(0,U.jsx)(`div`,{className:`text-[10px] uppercase tracking-wide text-muted-foreground`,children:e(`activity:office.fullOperationStream`)})]})]}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>B(null),title:e(`activity:office.closeEsc`),className:`text-muted-foreground hover:text-foreground text-xl leading-none shrink-0`,children:`×`})]}),(0,U.jsx)(`div`,{className:`flex-1 min-h-0 p-4`,children:(0,U.jsx)(xe,{sessionId:z.sessionId,limit:500})})]})]})}function He(){return(0,U.jsx)(j,{children:(0,U.jsx)($,{})})}export{He as OfficeMapPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-BRAejDWd.js";import{bt as r,pt as i,vi as a,wt as o}from"./vendor-B51hXwIj.js";import"./i18n-CLLrYq46.js";import{t as s}from"./utils-C9L1kxOy.js";import{A as c,F as l,L as u,M as d,j as f,nt as p}from"./index-BwLKTDt1.js";var m=e(t(),1),h=n();function g({open:e,onClose:t,className:n}){let{t:g}=a(),[_,v]=(0,m.useState)([]),y=u(),b=p(e=>e.wsConnected),x=(0,m.useRef)(null),S=(0,m.useRef)(null);(0,m.useEffect)(()=>{if(!(!e||!b||!y.client?.isConnected))return y.client.send?.({type:`process.list`}),x.current=y.client.on?.(`process.list`,e=>{let t=e?.payload;t?.processes&&v(t.processes)})??null,S.current=setInterval(()=>{y.client.send?.({type:`process.list`})},3e3),()=>{x.current?.(),S.current&&clearInterval(S.current)}},[e,b,y.client]);let C=(0,m.useCallback)(e=>{y.client.send?.({type:`process.kill`,payload:{pid:e}})},[y.client]),w=(0,m.useCallback)(()=>{y.client.send?.({type:`process.killAll`})},[y.client]),T=_.filter(e=>e.status===`running`);return(0,h.jsx)(c,{open:e,onOpenChange:e=>{e||t()},children:(0,h.jsxs)(f,{className:s(`max-w-lg gap-0 p-0 overflow-hidden flex flex-col max-h-[75dvh] pt-[10dvh]`,n),showCloseButton:!1,children:[(0,h.jsx)(l,{className:`sr-only`,children:g(`activity:process.heading`)}),(0,h.jsx)(d,{className:`sr-only`,children:g(`activity:process.subtitle`,{active:T.length,total:_.length})}),(0,h.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b shrink-0`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,h.jsx)(`span`,{className:`flex items-center justify-center w-8 h-8 rounded-lg bg-warning/10 text-warning`,children:(0,h.jsx)(i,{className:`h-4 w-4`})}),(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`h2`,{className:`text-sm font-semibold`,children:g(`activity:process.heading`)}),(0,h.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:g(`activity:process.subtitle`,{active:T.length,total:_.length})})]})]}),(0,h.jsx)(`div`,{className:`flex items-center gap-1`,children:T.length>0&&(0,h.jsxs)(`button`,{type:`button`,onClick:w,className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs text-destructive hover:bg-destructive/10 transition-colors font-medium`,children:[(0,h.jsx)(r,{className:`h-3 w-3 fill-current`}),g(`activity:process.killAll`)]})})]}),(0,h.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto`,children:_.length===0?(0,h.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 gap-3 text-muted-foreground`,children:[(0,h.jsx)(i,{className:`h-10 w-10 opacity-15`}),(0,h.jsx)(`p`,{className:`text-sm font-medium`,children:g(`activity:process.emptyTitle`)}),(0,h.jsx)(`p`,{className:`text-xs text-center max-w-xs`,children:g(`activity:process.emptyBody`)})]}):(0,h.jsx)(`div`,{className:`divide-y`,children:_.map(e=>{let t=e.status===`running`?Math.floor((Date.now()-e.startedAt)/1e3):null,n=t?t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`:null,i=e.protected===!0;return(0,h.jsxs)(`div`,{className:s(`flex items-center justify-between px-4 py-3 text-xs transition-colors`,e.status===`running`?`bg-background hover:bg-muted/30`:`bg-muted/20 text-muted-foreground`),children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 flex-1`,children:[(0,h.jsx)(`span`,{className:s(`led shrink-0`,e.status===`running`?i?`text-info`:`text-success led-pulse`:`text-muted-foreground`)}),(0,h.jsxs)(`div`,{className:`min-w-0`,children:[(0,h.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,h.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground shrink-0`,children:g(`activity:process.pidLabel`,{pid:e.pid})}),(0,h.jsx)(`span`,{className:`font-medium truncate`,children:e.tool}),i&&(0,h.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 px-1 py-0.5 rounded text-[9px] bg-info/10 text-info font-medium shrink-0`,title:g(`activity:process.protectedTitle`),children:[(0,h.jsx)(o,{className:`h-2.5 w-2.5`}),g(`activity:process.protected`)]})]}),(0,h.jsx)(`code`,{className:`text-[10px] text-muted-foreground/70 truncate block mt-0.5 font-mono`,children:e.command})]})]}),(0,h.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0 ml-3`,children:[n&&(0,h.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:n}),e.status===`running`&&!i&&(0,h.jsx)(`button`,{type:`button`,onClick:()=>C(e.pid),className:`p-1.5 rounded-md hover:bg-destructive/10 hover:text-destructive transition-colors`,title:g(`activity:process.killTitle`,{pid:e.pid}),children:(0,h.jsx)(r,{className:`h-3.5 w-3.5 fill-current`})})]})]},e.pid)})})})]})})}export{g as ProcessMonitor};
|