@wrongstack/webui 0.299.0 → 0.300.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/dist/assets/AgentRosterView-wkALMOGD.js +9 -0
- package/dist/assets/{AnalyticsDashboard-D58kSekC.js → AnalyticsDashboard-CIN35A_u.js} +1 -1
- package/dist/assets/AudienceMemoryPanel-BAY2Bh8z.js +3 -0
- package/dist/assets/ChangesView-CVWSTGmX.js +1 -0
- package/dist/assets/ChronicleDashboard-Bg3W7C9U.js +1 -0
- package/dist/assets/CodeEditor-CWY_6cQD.js +1 -0
- package/dist/assets/CodeMap-CjmKO0lB.js +1 -0
- package/dist/assets/CronJobsPanel-BinzTWNs.js +1 -0
- package/dist/assets/DeadCodeScanPanel-C3CgaNVv.js +2 -0
- package/dist/assets/DebugDashboard-BqUghn06.js +1 -0
- package/dist/assets/DesignGalleryView-CuWWQAlD.js +1 -0
- package/dist/assets/GoalView-2weuLiPM.js +1 -0
- package/dist/assets/KanbanView-DXYRrshJ.js +3 -0
- package/dist/assets/{MailboxDetailView-ZcKcOEAe.js → MailboxDetailView-aaHx9Nma.js} +1 -1
- package/dist/assets/MemoryManager-BgcicCyg.js +1 -0
- package/dist/assets/{ModelPicker-DvNLZzkm.js → ModelPicker-B3BqjJnT.js} +1 -1
- package/dist/assets/OfficeMapPanel-Ck8NUOEs.js +4 -0
- package/dist/assets/OfficeMapPanel-CpexsBed.css +1 -0
- package/dist/assets/{ProcessMonitor-2nSk6sXA.js → ProcessMonitor-CoMYZcdS.js} +1 -1
- package/dist/assets/{QueuePanel-4KBBWFxj.js → QueuePanel-CA3CVCO_.js} +1 -1
- package/dist/assets/{RefreshDebugView-D3XnE53y.js → RefreshDebugView-cqBtyNna.js} +1 -1
- package/dist/assets/RequirementIntakeView-BBtUk8mC.js +1 -0
- package/dist/assets/SageTabs-Di49i4Yu.js +2 -0
- package/dist/assets/SddHub-D8iV6l9A.js +2 -0
- package/dist/assets/SessionInspectView-DHC_xTzG.js +1 -0
- package/dist/assets/{SessionList-BeinIC-h.js → SessionList-DH-ZsHmv.js} +1 -1
- package/dist/assets/{SessionsDashboard-DEG_BylE.js → SessionsDashboard-Coi6htwg.js} +1 -1
- package/dist/assets/SetupScreen-CD2Sx4n9.js +1 -0
- package/dist/assets/{SkillDetailView-D7EQ2XtV.js → SkillDetailView-D7wSJWUX.js} +1 -1
- package/dist/assets/SpecsView-BRWSI1iV.js +1 -0
- package/dist/assets/TechStackView-BOjkuJLe.js +1 -0
- package/dist/assets/{TerminalPanel-BL9ZPGJt.js → TerminalPanel-Dg8WR5Un.js} +1 -1
- package/dist/assets/{Toaster-CJI70aa-.js → Toaster-DSKFSuK3.js} +1 -1
- package/dist/assets/activity-BWbV0byu.js +9 -0
- package/dist/assets/activity-Bjb_mil3.js +9 -0
- package/dist/assets/activity-Bze6njDy.js +9 -0
- package/dist/assets/activity-Ciqcr7Ps.js +9 -0
- package/dist/assets/activity-DA9hmVZV.js +9 -0
- package/dist/assets/activity-GdnS66AB.js +9 -0
- package/dist/assets/activity-eawh_OWs.js +9 -0
- package/dist/assets/{chat-DzPxYALH.js → chat-4NEOESoU.js} +1 -1
- package/dist/assets/{chat-DLn1hY01.js → chat-BSg62iwX.js} +1 -1
- package/dist/assets/{chat-OunddzYy.js → chat-Bb1TpPfJ.js} +1 -1
- package/dist/assets/{chat-DxLD17ER.js → chat-COLKjtcx.js} +1 -1
- package/dist/assets/{chat-DSEq1Bdz.js → chat-CfRKV9iX.js} +1 -1
- package/dist/assets/{chat-CwnuX7tG.js → chat-EbeT4kiS.js} +1 -1
- package/dist/assets/{chat-CRmMDzCb.js → chat-ux_gymOJ.js} +1 -1
- package/dist/assets/{common-DMM-xyW3.js → common-BXJbu5Y-.js} +1 -1
- package/dist/assets/{common-C9ikgX7d.js → common-BiNu_WzQ.js} +1 -1
- package/dist/assets/common-COVxQ0FV.js +1 -0
- package/dist/assets/{common-D29Zdkxb.js → common-Ch7JihXD.js} +1 -1
- package/dist/assets/{common-DoUBSHRY.js → common-DPaTeTls.js} +1 -1
- package/dist/assets/{common-vdwxzODB.js → common-DdGpRh8j.js} +1 -1
- package/dist/assets/{common-C5hY-d_0.js → common-pI6fYZW3.js} +1 -1
- package/dist/assets/i18n-C31PI0Up.js +2 -0
- package/dist/assets/index-5IWUhPO4.css +1 -0
- package/dist/assets/index-D1izXztg.js +132 -0
- package/dist/assets/{mailbox-store-D8TvJsuk.js → mailbox-store-Bc9ER3Ph.js} +1 -1
- package/dist/assets/{progress-ring-61A-xUEl.js → progress-ring-D_d6hn_4.js} +1 -1
- package/dist/assets/{roster-ws-Dfg_187V.js → roster-ws-D6dGRfC5.js} +1 -1
- package/dist/assets/settings-BKuhxUSF.js +1 -0
- package/dist/assets/settings-CeK0doV7.js +1 -0
- package/dist/assets/settings-DZ-H89lu.js +1 -0
- package/dist/assets/settings-DvrdpSdA.js +1 -0
- package/dist/assets/settings-SBUqq0ll.js +1 -0
- package/dist/assets/settings-W8t1ZrxM.js +1 -0
- package/dist/assets/settings-tOqZkk9R.js +1 -0
- package/dist/assets/stores-OBoFiAKe.js +7 -0
- package/dist/assets/ui-store-CE4-TlwB.js +1 -0
- package/dist/assets/useWebSocket-DuLtH2jI.js +29 -0
- package/dist/assets/{view-navigation-DxfiZrXS.js → view-navigation-DIDEcp4V.js} +1 -1
- package/dist/assets/ws-client-Bw1ixxwI.js +1 -0
- package/dist/components/AutonomyPicker.d.ts +1 -1
- package/dist/components/ChatView/auto-collapse.d.ts +42 -0
- package/dist/components/FallbackModal.d.ts +2 -0
- package/dist/components/KanbanVerificationDashboard.d.ts +0 -6
- package/dist/components/SettingsPanel/PluginToggleList.d.ts +11 -3
- package/dist/components/SettingsPanel/brain-section-options.d.ts +25 -55
- package/dist/components/TaskCard.d.ts +0 -1
- package/dist/components/TaskRiskPanel.d.ts +10 -3
- package/dist/components/TechStackView/shared.d.ts +11 -6
- package/dist/components/ThemeProvider.d.ts +6 -1
- package/dist/components/agent-roster-data.d.ts +2 -1
- package/dist/hooks/ws-handlers/files-mailbox-handlers.d.ts +1 -0
- package/dist/hooks/ws-handlers/misc-handlers.d.ts +13 -0
- package/dist/hooks/ws-handlers/session-handlers.d.ts +1 -0
- package/dist/index.css +30 -0
- package/dist/index.html +15 -15
- package/dist/index.js +25202 -11602
- package/dist/lib/file-icons.d.ts +3 -3
- package/dist/lib/palettes.d.ts +37 -0
- package/dist/lib/ws-client.d.ts +3 -3
- package/dist/providers.json +7 -7
- package/dist/stores/config-store.d.ts +9 -1
- package/dist/stores/context-editor-store.d.ts +9 -1
- package/dist/stores/fallback-store.d.ts +30 -0
- package/dist/stores/fleet-store.d.ts +13 -0
- package/dist/stores/index.d.ts +2 -0
- package/dist/stores/local-prefs.d.ts +4 -0
- package/dist/stores/mailbox-store.d.ts +2 -0
- package/dist/types/client-message.d.ts +12 -1
- package/dist/types/protocol-core.d.ts +19 -0
- package/dist/types/runtime.d.ts +8 -0
- package/dist/types/server-message.d.ts +13 -2
- package/package.json +9 -9
- package/dist/assets/AgentRosterView-BqojERFR.js +0 -11
- package/dist/assets/AudienceMemoryPanel-Cc1UkbDl.js +0 -3
- package/dist/assets/ChangesView-BKU80ANq.js +0 -1
- package/dist/assets/ChronicleDashboard-CvCS1Dj1.js +0 -1
- package/dist/assets/CodeEditor-BHZQhx_8.js +0 -1
- package/dist/assets/CodeMap-qllGEFLB.js +0 -1
- package/dist/assets/CronJobsPanel-DD5mhZ4Q.js +0 -1
- package/dist/assets/DeadCodeScanPanel-PB-c8et_.js +0 -2
- package/dist/assets/DebugDashboard-Q8QiVflQ.js +0 -1
- package/dist/assets/DesignGalleryView-CGOtWO7s.js +0 -1
- package/dist/assets/GoalView-Dlk42vW7.js +0 -1
- package/dist/assets/KanbanView-DIP6kKmU.js +0 -3
- package/dist/assets/MemoryManager-B7620q_K.js +0 -1
- package/dist/assets/OfficeMapPanel-BFIF-EMt.css +0 -1
- package/dist/assets/OfficeMapPanel-DKJNTtOZ.js +0 -4
- package/dist/assets/RequirementIntakeView-BMxlf8bt.js +0 -1
- package/dist/assets/SageTabs-g1hO2hJ0.js +0 -2
- package/dist/assets/SddHub-Kv_TbTgT.js +0 -2
- package/dist/assets/SessionInspectView-PnKTvyvP.js +0 -1
- package/dist/assets/SetupScreen-DxJwZ1OZ.js +0 -1
- package/dist/assets/SpecsView-Fm7pYYcj.js +0 -1
- package/dist/assets/TechStackView-Bo_UenRF.js +0 -1
- package/dist/assets/activity-BCgOEWgR.js +0 -5
- package/dist/assets/activity-BQ0zqkw2.js +0 -5
- package/dist/assets/activity-CAovbq3e.js +0 -5
- package/dist/assets/activity-CFQyCvgu.js +0 -5
- package/dist/assets/activity-CdQf7zRK.js +0 -5
- package/dist/assets/activity-DACvyn2-.js +0 -5
- package/dist/assets/activity-DOwYydU-.js +0 -5
- package/dist/assets/common-BfVFjVhf.js +0 -1
- package/dist/assets/i18n-B0hsnanh.js +0 -2
- package/dist/assets/index-DHdO0CRE.js +0 -132
- package/dist/assets/index-DKrFQ76m.css +0 -1
- package/dist/assets/settings-B5xal2R3.js +0 -1
- package/dist/assets/settings-BHtFy8EG.js +0 -1
- package/dist/assets/settings-Bss5hBla.js +0 -1
- package/dist/assets/settings-BzrLCVRP.js +0 -1
- package/dist/assets/settings-C7RdvmLZ.js +0 -1
- package/dist/assets/settings-Dd94HoV6.js +0 -1
- package/dist/assets/settings-Dm9THFe8.js +0 -1
- package/dist/assets/stores-BptlyD_v.js +0 -7
- package/dist/assets/ui-store-BsBnjO3w.js +0 -1
- package/dist/assets/useWebSocket-Bc4S0N4r.js +0 -29
- package/dist/assets/ws-client-DqFoX4jJ.js +0 -1
- package/dist/lib/accent-colors.d.ts +0 -136
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.agent-office{--office-line:hsl(var(--border) / .72);--office-soft:hsl(var(--surface-2) / .78);--office-panel:hsl(var(--card) / .94);height:100%;min-height:0;color:hsl(var(--foreground));background:radial-gradient(circle at 9% 0%, hsl(var(--primary) / .08), transparent 24rem), linear-gradient(135deg, hsl(var(--background)), hsl(var(--surface-2) / .62));grid-template-rows:auto auto minmax(0,1fr) auto;display:grid;position:relative;overflow:hidden}.agent-office:before{pointer-events:none;content:"";opacity:.18;background-image:linear-gradient(hsl(var(--border) / .34) 1px, transparent 1px), linear-gradient(90deg, hsl(var(--border) / .34) 1px, transparent 1px);background-size:28px 28px;position:absolute;inset:0;-webkit-mask-image:linear-gradient(#0000,#000 16% 92%,#0000);mask-image:linear-gradient(#0000,#000 16% 92%,#0000)}.agent-office__header{z-index:4;border-bottom:1px solid var(--office-line);background:hsl(var(--card) / .9);min-height:68px;box-shadow:0 8px 30px hsl(var(--shadow-color) / .08);-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);align-items:center;gap:18px;padding:10px 16px;display:flex;position:relative}.agent-office__title{align-items:center;gap:10px;min-width:210px;display:flex}.agent-office__brand-mark{border:1px solid hsl(var(--primary) / .34);width:38px;height:38px;color:hsl(var(--primary));background:hsl(var(--primary) / .1);border-radius:10px;flex:none;place-items:center;display:grid}.agent-office__brand-mark svg{width:19px;height:19px}.agent-office__title>div>span,.agent-office__detail-header>div>span{color:hsl(var(--muted-foreground));font:500 11px / 1.2 var(--font-mono);letter-spacing:.13em;display:block}.agent-office__title h1{max-width:280px;font:500 15px / 1.2 var(--font-display);text-overflow:ellipsis;white-space:nowrap;margin:3px 0 0;overflow:hidden}.agent-office__live-pill{border:1px solid hsl(var(--success) / .3);color:hsl(var(--success));background:hsl(var(--success) / .08);font:500 11px / 1 var(--font-mono);letter-spacing:.1em;border-radius:999px;align-items:center;gap:6px;padding:5px 8px;display:flex}.agent-office__live-pill>span,.agent-office__pulse-dot{width:6px;height:6px;box-shadow:0 0 0 4px hsl(var(--success) / .12);background:currentColor;border-radius:999px;animation:1.6s ease-in-out infinite agent-office-pulse}.agent-office__summary{flex:auto;justify-content:center;gap:6px;min-width:0;display:flex}.agent-office__summary>div{border-left:1px solid var(--office-line);grid-template-columns:auto auto;align-items:center;gap:0 6px;min-width:92px;padding:6px 9px;display:grid}.agent-office__summary svg{width:13px;height:13px;color:hsl(var(--muted-foreground))}.agent-office__summary strong{font:500 13px / 1 var(--font-mono)}.agent-office__summary span{color:hsl(var(--muted-foreground));grid-column:1/-1;font-size:11px}.agent-office__column-headings,.agent-office__lane{grid-template-columns:180px minmax(430px,1fr) 270px;display:grid}.agent-office__column-headings{z-index:3;border-bottom:1px solid var(--office-line);min-height:28px;color:hsl(var(--muted-foreground));background:hsl(var(--background) / .84);font:500 10px / 1 var(--font-mono);letter-spacing:.14em;align-items:center;padding:0 12px;position:relative}.agent-office__column-headings span{padding:0 12px}.agent-office__column-headings span:last-child{padding-left:16px}.agent-office__client-office{border:1px solid hsl(var(--border));background:hsl(var(--card) / .42);box-shadow:0 14px 38px hsl(var(--shadow-color) / .08);border-radius:16px;margin-bottom:14px;overflow:hidden}.agent-office__client-header{border-bottom:1px solid hsl(var(--border));background:linear-gradient(90deg, hsl(var(--primary) / .07), transparent 42%), hsl(var(--card) / .82);justify-content:space-between;align-items:center;gap:14px;min-height:62px;padding:9px 12px;display:flex}.agent-office__client-title{flex-wrap:wrap;flex:420px;align-items:center;gap:9px;min-width:210px;display:flex}.agent-office__client-copy{flex-direction:column;flex:150px;gap:2px;min-width:0;display:flex}.agent-office__client-copy strong{font:500 12px / 1.2 var(--font-display);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.agent-office__client-copy>span{max-width:310px;color:hsl(var(--muted-foreground));font:400 10px / 1.2 var(--font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.agent-office__client-icon{width:32px;height:32px;color:hsl(var(--primary));background:hsl(var(--primary) / .1);border-radius:9px;flex:none;place-items:center;display:grid}.agent-office__client-icon svg{width:16px;height:16px}.agent-office__client-agent-count{color:hsl(var(--primary));background:hsl(var(--primary) / .09);font:500 10px / 1 var(--font-mono);border-radius:999px;flex:none;padding:3px 6px}.agent-office__client-presence{flex-wrap:wrap;align-items:center;gap:4px;min-width:0;display:flex}.agent-office__presence-chip{border:1px solid hsl(var(--border));min-height:20px;color:hsl(var(--muted-foreground));background:hsl(var(--background) / .5);font:500 9px / 1 var(--font-mono);letter-spacing:.04em;border-radius:999px;flex:none;align-items:center;gap:3px;padding:3px 5px;display:inline-flex}.agent-office__presence-chip svg{width:9px;height:9px}.agent-office__presence-chip.is-live,.agent-office__presence-chip.is-telemetry{border-color:hsl(var(--success) / .25);color:hsl(var(--success));background:hsl(var(--success) / .07)}.agent-office__presence-chip.is-legacy{border-color:hsl(var(--warning) / .28);color:hsl(var(--warning));background:hsl(var(--warning) / .08)}.agent-office__agent-verified{min-height:16px;color:hsl(var(--success));background:hsl(var(--success) / .08);font:500 8px / 1 var(--font-mono);letter-spacing:.04em;border-radius:999px;flex:none;align-items:center;gap:2px;padding:2px 4px;display:inline-flex}.agent-office__agent-verified svg{width:8px;height:8px}.agent-office__client-stats{border:0;flex-wrap:wrap;justify-content:flex-end;gap:5px;min-width:0;margin:0;padding:0;display:flex}.agent-office__client-stats>span{border:1px solid hsl(var(--border));min-height:25px;color:hsl(var(--muted-foreground));background:hsl(var(--background) / .58);font:400 9px / 1 var(--font-mono);letter-spacing:.05em;border-radius:6px;align-items:center;gap:4px;padding:4px 6px;display:inline-flex}.agent-office__client-stats svg{width:11px;height:11px}.agent-office__client-stats strong{color:hsl(var(--foreground));font-size:11px}.agent-office__client-delta strong{color:hsl(var(--success))}.agent-office__client-delta b{color:hsl(var(--destructive));font-weight:500}.agent-office__client-desks{padding:9px 9px 1px}.agent-office__briefing{border-bottom:1px solid hsl(var(--border));background:hsl(var(--background) / .34);grid-template-columns:minmax(0,1.15fr) minmax(300px,.85fr);gap:8px;padding:8px 9px;display:grid}.agent-office__prompt-card,.agent-office__todo-board{border:1px solid hsl(var(--border));min-width:0;min-height:68px;color:hsl(var(--foreground));background:hsl(var(--card) / .7);text-align:left;box-shadow:0 6px 18px hsl(var(--shadow-color) / .045);border-radius:10px;align-items:center;gap:9px;padding:9px 10px;transition:border-color .16s,background .16s,transform .16s;display:flex;position:relative}.agent-office__prompt-card{overflow:hidden}.agent-office__prompt-card.is-active{border-color:hsl(var(--success) / .38);background:linear-gradient(90deg, hsl(var(--success) / .07), transparent 62%), hsl(var(--card) / .78);box-shadow:0 8px 24px hsl(var(--success) / .08)}.agent-office__prompt-card.is-fresh:after{pointer-events:none;content:"";background:linear-gradient(90deg, transparent, hsl(var(--primary) / .14), transparent);width:24%;animation:1.1s ease-out agent-office-brief-arrive;position:absolute;inset:0 auto 0 -30%;transform:skew(-18deg)}.agent-office__prompt-card.is-waiting,.agent-office__todo-board.is-waiting{background:hsl(var(--muted) / .28);border-style:dashed}.agent-office__prompt-card:hover,.agent-office__todo-board:hover{border-color:hsl(var(--primary) / .34);background:hsl(var(--card));transform:translateY(-1px)}.agent-office__briefing-icon{width:34px;height:34px;color:hsl(var(--primary));background:hsl(var(--primary) / .1);border-radius:9px;flex:none;place-items:center;display:grid}.agent-office__briefing-icon svg{width:16px;height:16px}.agent-office__briefing-copy{flex-direction:column;flex:auto;gap:4px;min-width:0;display:flex}.agent-office__briefing-copy>span,.agent-office__todo-heading>span{color:hsl(var(--muted-foreground));font:500 9px / 1 var(--font-mono);letter-spacing:.11em;text-transform:uppercase}.agent-office__briefing-copy strong{font:500 12px / 1.35 var(--font-display);-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.agent-office__prompt-card time{color:hsl(var(--muted-foreground));font:400 9px / 1 var(--font-mono);flex:none;align-self:flex-start}.agent-office__instruction-live{color:hsl(var(--success));background:hsl(var(--success) / .09);font:500 9px / 1 var(--font-mono);letter-spacing:.08em;border-radius:999px;flex:none;align-items:center;gap:4px;padding:3px 5px;display:inline-flex}.agent-office__instruction-live i{width:5px;height:5px;box-shadow:0 0 0 3px hsl(var(--success) / .1);background:currentColor;border-radius:50%;animation:1.6s ease-in-out infinite agent-office-pulse}.agent-office__todo-board{flex-direction:column;align-items:stretch;gap:7px}.agent-office__todo-board.has-active{border-color:hsl(var(--primary) / .26)}.agent-office__todo-board.has-active:after{content:"";background:linear-gradient(90deg, hsl(var(--primary) / .16), hsl(var(--primary)), hsl(var(--primary) / .16));background-size:200% 100%;border-radius:999px;width:38px;height:2px;animation:2.4s linear infinite agent-office-sync-line;position:absolute;bottom:7px;right:8px;overflow:hidden}.agent-office__todo-heading{justify-content:space-between;align-items:center;gap:8px;min-width:0;display:flex}.agent-office__todo-heading>span{align-items:center;gap:5px;display:inline-flex}.agent-office__todo-heading svg{width:12px;height:12px;color:hsl(var(--primary))}.agent-office__todo-heading strong,.agent-office__todo-more{color:hsl(var(--muted-foreground));font:500 9px / 1 var(--font-mono)}.agent-office__todo-preview{flex-direction:column;gap:4px;min-width:0;display:flex}.agent-office__todo-line{min-width:0;font:400 10px / 1.2 var(--font-mono);align-items:center;gap:6px;display:flex}.agent-office__todo-line i{border:1px solid hsl(var(--muted-foreground) / .62);border-radius:50%;flex:none;width:6px;height:6px}.agent-office__todo-line.is-in_progress i{border-color:hsl(var(--success));background:hsl(var(--success));box-shadow:0 0 0 3px hsl(var(--success) / .1);animation:1.6s ease-in-out infinite agent-office-pulse}.agent-office__todo-line>span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.agent-office__todo-empty{color:hsl(var(--muted-foreground));font:400 10px / 1.2 var(--font-mono);align-items:center;gap:6px;display:flex}.agent-office__todo-empty svg{width:13px;height:13px;color:hsl(var(--success))}.agent-office__todo-empty.is-waiting svg{color:hsl(var(--warning));animation:1.8s ease-in-out infinite agent-office-telemetry-wait}.agent-office__floor{z-index:2;overscroll-behavior:contain;scrollbar-color:hsl(var(--border)) transparent;min-height:0;padding:10px 12px 20px;position:relative;overflow-y:auto}.agent-office__lane{--desk-top:hsl(var(--warning) / .72);--desk-edge:hsl(var(--warning) / .3);--desk-leg:hsl(var(--muted-foreground) / .62);--desk-chair:hsl(var(--muted-foreground) / .28);--desk-screen:hsl(var(--primary));--desk-decor:hsl(var(--warning) / .68);--desk-wall:hsl(var(--info) / .055);--desk-floor:hsl(var(--warning) / .055);--desk-aura:hsl(var(--warning) / .045);border:1px solid var(--office-line);background:var(--office-panel);min-height:172px;box-shadow:0 10px 30px hsl(var(--shadow-color) / .06);border-radius:14px;margin-bottom:9px;transition:border-color .18s,box-shadow .18s,transform .18s;animation:.42s cubic-bezier(.16,.82,.28,1) agent-office-lane-arrive;position:relative;overflow:hidden}.agent-office__lane.is-desk-mint{--desk-top:hsl(var(--success) / .58);--desk-edge:hsl(var(--success) / .22);--desk-leg:hsl(var(--foreground) / .5);--desk-chair:hsl(var(--success) / .2);--desk-screen:hsl(var(--success));--desk-decor:hsl(var(--info) / .7);--desk-wall:hsl(var(--success) / .07);--desk-floor:hsl(var(--info) / .045);--desk-aura:hsl(var(--success) / .055)}.agent-office__lane.is-desk-ocean{--desk-top:hsl(var(--info) / .62);--desk-edge:hsl(var(--info) / .24);--desk-leg:hsl(var(--foreground) / .58);--desk-chair:hsl(var(--info) / .2);--desk-screen:hsl(var(--info));--desk-decor:hsl(var(--primary) / .72);--desk-wall:hsl(var(--info) / .09);--desk-floor:hsl(var(--primary) / .04);--desk-aura:hsl(var(--info) / .052)}.agent-office__lane.is-desk-plum{--desk-top:hsl(var(--primary) / .58);--desk-edge:hsl(var(--primary) / .24);--desk-leg:hsl(var(--foreground) / .54);--desk-chair:hsl(var(--primary) / .2);--desk-screen:hsl(var(--primary));--desk-decor:hsl(var(--warning) / .75);--desk-wall:hsl(var(--primary) / .075);--desk-floor:hsl(var(--warning) / .04);--desk-aura:hsl(var(--primary) / .052)}.agent-office__lane.is-desk-rose{--desk-top:hsl(var(--destructive) / .5);--desk-edge:hsl(var(--destructive) / .2);--desk-leg:hsl(var(--foreground) / .52);--desk-chair:hsl(var(--destructive) / .18);--desk-screen:hsl(var(--destructive));--desk-decor:hsl(var(--warning) / .72);--desk-wall:hsl(var(--destructive) / .06);--desk-floor:hsl(var(--warning) / .04);--desk-aura:hsl(var(--destructive) / .048)}.agent-office__lane.is-desk-graphite{--desk-top:hsl(var(--muted-foreground) / .58);--desk-edge:hsl(var(--foreground) / .18);--desk-leg:hsl(var(--foreground) / .66);--desk-chair:hsl(var(--foreground) / .16);--desk-screen:hsl(var(--success));--desk-decor:hsl(var(--info) / .7);--desk-wall:hsl(var(--muted-foreground) / .055);--desk-floor:hsl(var(--foreground) / .035);--desk-aura:hsl(var(--muted-foreground) / .044)}.agent-office__lane:hover{box-shadow:0 13px 34px hsl(var(--shadow-color) / .1);transform:translateY(-1px)}.agent-office__lane.is-active{border-color:hsl(var(--primary) / .38);box-shadow:0 12px 34px hsl(var(--primary) / .09)}.agent-office__lane.is-failed{border-color:hsl(var(--destructive) / .42)}.agent-office__identity{border-right:1px solid var(--office-line);background:linear-gradient(145deg, var(--desk-aura), transparent 68%);flex-direction:column;justify-content:center;min-width:0;padding:16px;display:flex}.agent-office__identity-line{align-items:center;gap:8px;min-width:0;display:flex}.agent-office__identity-line strong{font:500 13px / 1.25 var(--font-display);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.agent-office__status-dot{background:hsl(var(--muted-foreground) / .52);border-radius:999px;flex:none;width:7px;height:7px}.agent-office__status-dot.is-active{background:hsl(var(--success));box-shadow:0 0 0 4px hsl(var(--success) / .1)}.agent-office__status-dot.is-failed{background:hsl(var(--destructive));box-shadow:0 0 0 4px hsl(var(--destructive) / .1)}.agent-office__role{color:hsl(var(--primary));font:500 10px / 1 var(--font-mono);letter-spacing:.12em;margin:6px 0 16px 15px}.agent-office__agent-meta{flex-wrap:wrap;gap:5px;display:flex}.agent-office__agent-meta span{max-width:100%;color:hsl(var(--muted-foreground));background:hsl(var(--muted) / .75);font:400 10px / 1.2 var(--font-mono);text-overflow:ellipsis;white-space:nowrap;border-radius:5px;padding:3px 6px;overflow:hidden}.agent-office__agent-task{border:1px solid hsl(var(--primary) / .2);width:100%;min-width:0;color:hsl(var(--foreground));background:hsl(var(--primary) / .055);text-align:left;border-radius:7px;align-items:center;gap:6px;margin-top:8px;padding:5px 6px;display:flex}.agent-office__agent-task:hover{border-color:hsl(var(--primary) / .4);background:hsl(var(--primary) / .09)}.agent-office__agent-task:not(.is-missing){animation:.46s cubic-bezier(.16,.82,.28,1) agent-office-task-assigned}.agent-office__agent-task.is-missing{color:hsl(var(--muted-foreground));background:hsl(var(--muted) / .3);border-style:dashed}.agent-office__agent-task.is-missing>svg{color:hsl(var(--warning));animation:1.8s ease-in-out infinite agent-office-telemetry-wait}.agent-office__agent-task>svg{width:13px;height:13px;color:hsl(var(--primary));flex:none}.agent-office__agent-task>span{flex-direction:column;gap:2px;min-width:0;display:flex}.agent-office__agent-task strong{color:hsl(var(--primary));font:500 8px / 1 var(--font-mono);letter-spacing:.09em}.agent-office__agent-task small{font:400 10px / 1.2 var(--font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.agent-office__identity-mail{border:1px solid hsl(var(--info) / .18);width:100%;min-width:0;color:hsl(var(--muted-foreground));background:hsl(var(--info) / .055);text-align:left;border-radius:7px;align-items:center;gap:6px;margin-top:8px;padding:5px 6px;display:flex}.agent-office__identity-mail:hover{border-color:hsl(var(--info) / .34);background:hsl(var(--info) / .09)}.agent-office__identity-mail.is-unread{border-color:hsl(var(--info) / .38);color:hsl(var(--foreground))}.agent-office__identity-mail>svg{width:13px;height:13px;color:hsl(var(--info));flex:none}.agent-office__identity-mail>span{flex-direction:column;gap:2px;min-width:0;display:flex}.agent-office__identity-mail strong{font:500 9px / 1 var(--font-mono);letter-spacing:.08em}.agent-office__identity-mail small{max-width:100%;font:400 10px / 1.15 var(--font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.agent-office__scene{background:linear-gradient(to bottom, var(--desk-wall) 0 68%, transparent 68%), linear-gradient(165deg, transparent 0 72%, var(--desk-floor) 72% 100%);min-width:0;position:relative;overflow:hidden}.agent-office__scene:after{pointer-events:none;content:"";border-top:1px solid hsl(var(--border) / .55);background-image:repeating-linear-gradient(90deg, transparent 0 54px, hsl(var(--border) / .26) 54px 55px);transform-origin:bottom;height:29%;position:absolute;bottom:0;left:0;right:0;transform:perspective(170px)rotateX(4deg)}.agent-office__window{border:1px solid hsl(var(--border));background:hsl(var(--card));width:70px;height:37px;box-shadow:inset 0 -10px 18px hsl(var(--info) / .08);border-radius:5px;gap:3px;padding:4px;display:flex;position:absolute;top:14px;left:15px}.agent-office__window span{background:linear-gradient(160deg, color-mix(in srgb, var(--desk-screen) 23%, transparent), hsl(var(--primary) / .04));border-radius:2px;flex:1;animation:8s ease-in-out infinite alternate agent-office-window-glow}.agent-office__window span:nth-child(2){animation-delay:-2.4s}.agent-office__window span:nth-child(3){animation-delay:-4.8s}.agent-office__plant{z-index:3;width:25px;height:41px;position:absolute;bottom:29px;left:9px}.agent-office__plant:after{content:"";background:var(--desk-decor);border-radius:3px 3px 8px 8px;width:18px;height:16px;position:absolute;bottom:0;left:4px}.agent-office__plant span,.agent-office__plant i,.agent-office__plant b{--plant-angle:0deg;--plant-scale:1;background:hsl(var(--success) / .72);width:8px;height:23px;transform:rotate(var(--plant-angle)) scale(var(--plant-scale));transform-origin:bottom;border-radius:100% 0;position:absolute;bottom:14px;left:10px}.agent-office__plant i{--plant-angle:-40deg}.agent-office__plant b{--plant-angle:43deg;--plant-scale:.86}.agent-office__plant span,.agent-office__plant i,.agent-office__plant b{animation:4.8s ease-in-out infinite alternate agent-office-plant-sway}.agent-office__plant i{animation-delay:-1.3s}.agent-office__plant b{animation-delay:-2.6s}.agent-office__desk-zone{z-index:4;width:128px;position:absolute;top:18px;bottom:19px;left:30px}.agent-office__desk{z-index:5;background:var(--desk-top);width:84px;height:9px;box-shadow:0 25px 0 -3px var(--desk-edge);border-radius:3px;position:absolute;bottom:29px;right:0}.agent-office__desk:before,.agent-office__desk:after{content:"";background:var(--desk-leg);width:5px;height:38px;position:absolute;top:7px}.agent-office__desk:before{left:7px}.agent-office__desk:after{right:7px}.agent-office__monitor{z-index:7;border:3px solid hsl(var(--foreground) / .8);width:48px;height:34px;color:var(--desk-screen);background:hsl(var(--background));box-shadow:inset 0 0 12px color-mix(in srgb, var(--desk-screen) 18%, transparent);border-radius:5px;place-items:center;display:grid;position:absolute;bottom:38px;right:22px}.agent-office__lane.is-active .agent-office__monitor:before{pointer-events:none;content:"";opacity:.46;background:linear-gradient(to bottom, transparent 0 42%, color-mix(in srgb, var(--desk-screen) 28%, transparent) 48% 54%, transparent 60% 100%);background-size:100% 220%;border-radius:2px;animation:2.2s linear infinite agent-office-monitor-scan;position:absolute;inset:3px}.agent-office__monitor:after{content:"";background:hsl(var(--foreground) / .72);width:4px;height:8px;position:absolute;bottom:-10px;left:20px}.agent-office__monitor>svg{width:15px;height:15px}.agent-office__monitor .agent-office__tool-glyph{width:23px;height:23px;box-shadow:none;background:0 0;border:0}.agent-office__monitor .agent-office__tool-glyph>svg{width:14px;height:14px}.agent-office__monitor .agent-office__file-underlay{display:none}.agent-office__activity-fx{z-index:9;pointer-events:none;opacity:0;width:58px;height:42px;position:absolute;bottom:35px;right:16px}.agent-office__activity-fx>span,.agent-office__activity-fx>i,.agent-office__activity-fx>b{display:block;position:absolute}.agent-office__scene.is-tool-terminal .agent-office__activity-fx{opacity:.8}.agent-office__scene.is-tool-terminal .agent-office__activity-fx>span,.agent-office__scene.is-tool-terminal .agent-office__activity-fx>i,.agent-office__scene.is-tool-terminal .agent-office__activity-fx>b{background:var(--desk-screen);border-radius:2px;width:2px;height:5px;animation:.85s ease-in-out infinite alternate agent-office-terminal-bars;bottom:10px;left:17px}.agent-office__scene.is-tool-terminal .agent-office__activity-fx>i{height:10px;animation-delay:-.42s;left:25px}.agent-office__scene.is-tool-terminal .agent-office__activity-fx>b{height:7px;animation-delay:-.7s;left:33px}.agent-office__scene.is-tool-web .agent-office__activity-fx{opacity:.7}.agent-office__scene.is-tool-web .agent-office__activity-fx>span,.agent-office__scene.is-tool-web .agent-office__activity-fx>i,.agent-office__scene.is-tool-web .agent-office__activity-fx>b{border:1px solid var(--desk-screen);border-bottom-color:#0000;border-left-color:#0000;border-radius:50%;width:12px;height:12px;animation:1.8s ease-out infinite agent-office-web-signal;top:1px;right:-2px;transform:rotate(-38deg)}.agent-office__scene.is-tool-web .agent-office__activity-fx>i{width:20px;height:20px;animation-delay:-.6s;top:-3px;right:-6px}.agent-office__scene.is-tool-web .agent-office__activity-fx>b{width:28px;height:28px;animation-delay:-1.2s;top:-7px;right:-10px}.agent-office__scene:is(.is-tool-read,.is-tool-search) .agent-office__activity-fx{opacity:.78}.agent-office__scene:is(.is-tool-read,.is-tool-search) .agent-office__activity-fx>span{border:2px solid var(--desk-screen);border-radius:50%;width:14px;height:14px;animation:1.65s ease-in-out infinite alternate agent-office-inspect;top:-3px;left:4px}.agent-office__scene:is(.is-tool-read,.is-tool-search) .agent-office__activity-fx>i{background:var(--desk-screen);border-radius:2px;width:9px;height:2px;animation:1.65s ease-in-out infinite alternate agent-office-inspect-handle;top:10px;left:16px;transform:rotate(42deg)}.agent-office__scene:is(.is-tool-read,.is-tool-search) .agent-office__activity-fx>b{border:1px solid color-mix(in srgb, var(--desk-screen) 58%, transparent);background:repeating-linear-gradient(to bottom, transparent 0 3px, color-mix(in srgb, var(--desk-screen) 32%, transparent) 3px 4px);border-radius:2px;width:12px;height:16px;top:1px;left:31px}.agent-office__scene:is(.is-tool-write,.is-tool-edit) .agent-office__activity-fx{opacity:.78}.agent-office__scene:is(.is-tool-write,.is-tool-edit) .agent-office__activity-fx>span{border-bottom:1px solid color-mix(in srgb, var(--desk-screen) 62%, transparent);background:repeating-linear-gradient(to bottom, transparent 0 3px, color-mix(in srgb, var(--desk-screen) 24%, transparent) 3px 4px);width:22px;height:8px;bottom:-2px;right:5px}.agent-office__scene:is(.is-tool-write,.is-tool-edit) .agent-office__activity-fx>i{background:var(--desk-screen);transform-origin:100%;border-radius:4px 1px 1px 4px;width:17px;height:3px;animation:.72s ease-in-out infinite alternate agent-office-write-stroke;bottom:3px;right:12px;transform:rotate(-27deg)}.agent-office__scene:is(.is-tool-write,.is-tool-edit) .agent-office__activity-fx>b{background:var(--desk-screen);border-radius:50%;width:3px;height:3px;bottom:1px;right:27px}.agent-office__scene:is(.is-tool-memory,.is-tool-other) .agent-office__activity-fx{opacity:.72}.agent-office__scene:is(.is-tool-memory,.is-tool-other) .agent-office__activity-fx>span,.agent-office__scene:is(.is-tool-memory,.is-tool-other) .agent-office__activity-fx>i,.agent-office__scene:is(.is-tool-memory,.is-tool-other) .agent-office__activity-fx>b{border:1px solid var(--desk-screen);background:color-mix(in srgb, var(--desk-screen) 15%, transparent);border-radius:2px;width:6px;height:6px;animation:1.8s ease-in-out infinite agent-office-memory-pulse;top:-1px;right:0}.agent-office__scene:is(.is-tool-memory,.is-tool-other) .agent-office__activity-fx>i{animation-delay:-.6s;top:8px;right:-5px}.agent-office__scene:is(.is-tool-memory,.is-tool-other) .agent-office__activity-fx>b{animation-delay:-1.2s;top:14px;right:4px}.agent-office__desk-lamp{z-index:8;background:var(--desk-leg);transform-origin:bottom;border-radius:3px;width:3px;height:25px;position:absolute;bottom:39px;right:76px;transform:rotate(8deg)}.agent-office__desk-lamp:before{content:"";background:var(--desk-decor);width:16px;height:10px;box-shadow:0 7px 11px color-mix(in srgb, var(--desk-decor) 20%, transparent);border-radius:8px 8px 3px 3px;position:absolute;top:-4px;left:-7px;transform:rotate(-12deg)}.agent-office__desk-lamp:after{content:"";background:var(--desk-leg);border-radius:4px;width:13px;height:3px;position:absolute;bottom:-2px;right:-5px}.agent-office__desk-clutter{z-index:8;background:hsl(var(--card));width:18px;height:7px;box-shadow:0 -3px 0 -1px var(--desk-decor), 0 1px 2px hsl(var(--shadow-color) / .12);border-radius:2px;position:absolute;bottom:39px;right:61px;transform:rotate(-3deg)}.agent-office__desk-clutter>i,.agent-office__desk-clutter>b{background:var(--desk-decor);border-radius:2px;width:2px;height:10px;position:absolute;bottom:8px;right:2px;transform:rotate(12deg)}.agent-office__desk-clutter>b{background:var(--desk-screen);height:8px;right:6px;transform:rotate(-5deg)}.agent-office__desk-charm{z-index:8;width:15px;height:14px;color:var(--desk-decor);display:block;position:absolute;bottom:11px;right:-6px}.agent-office__desk-charm.is-bot{background:color-mix(in srgb, var(--desk-decor) 18%, hsl(var(--card)));border:1px solid;border-radius:4px}.agent-office__desk-charm.is-bot:before,.agent-office__desk-charm.is-bot:after{content:"";background:currentColor;border-radius:50%;width:2px;height:2px;animation:4.1s ease-in-out infinite agent-office-charm-blink;position:absolute;top:4px}.agent-office__desk-charm.is-bot:before{left:3px}.agent-office__desk-charm.is-bot:after{right:3px}.agent-office__desk-charm.is-bot>i{background:currentColor;width:1px;height:5px;position:absolute;top:-5px;left:6px}.agent-office__desk-charm.is-cactus:before{content:"";background:hsl(var(--success) / .74);width:7px;height:12px;box-shadow:-4px 4px 0 -2px hsl(var(--success) / .74);border-radius:6px 6px 2px 2px;position:absolute;bottom:4px;right:4px}.agent-office__desk-charm.is-cactus:after{content:"";background:var(--desk-decor);border-radius:2px 2px 5px 5px;width:13px;height:5px;position:absolute;bottom:0;right:1px}.agent-office__desk-charm.is-duck:before{content:"";background:hsl(var(--warning) / .82);border-radius:65% 48% 48% 55%;width:14px;height:9px;animation:3.6s ease-in-out infinite agent-office-charm-bob;position:absolute;bottom:0;right:0}.agent-office__desk-charm.is-duck:after{content:"";background:hsl(var(--warning) / .82);width:8px;height:8px;box-shadow:-3px 4px 0 -2px hsl(var(--destructive) / .72);border-radius:50%;animation:3.6s ease-in-out infinite agent-office-charm-bob;position:absolute;top:0;left:1px}.agent-office__desk-charm.is-radio{background:hsl(var(--card));box-shadow:inset 5px 0 0 color-mix(in srgb, var(--desk-decor) 18%, transparent);border:1px solid;border-radius:3px}.agent-office__desk-charm.is-radio:before{content:"";border:1px dotted;border-radius:50%;width:5px;height:5px;position:absolute;top:3px;right:2px}.agent-office__desk-charm.is-radio:after{content:"";transform-origin:bottom;background:currentColor;width:1px;height:7px;position:absolute;top:-6px;left:3px;transform:rotate(-20deg)}.agent-office__lane.is-clutter-0 .agent-office__desk-lamp,.agent-office__lane.is-clutter-1 .agent-office__desk-clutter{display:none}.agent-office__lane.is-layout-1 .agent-office__desk-zone{left:39px}.agent-office__lane.is-layout-1 .agent-office__window{border-radius:14px 14px 5px 5px;width:49px}.agent-office__lane.is-layout-1 .agent-office__desk{border-radius:8px 3px 3px 8px;width:91px;transform:rotate(.7deg)}.agent-office__lane.is-layout-2 .agent-office__desk-zone{left:22px}.agent-office__lane.is-layout-2 .agent-office__desk{border-radius:2px 9px 2px 2px;height:11px;bottom:31px}.agent-office__lane.is-layout-2 .agent-office__desk:before{width:3px;left:17px}.agent-office__lane.is-layout-2 .agent-office__desk:after{width:3px;right:16px}.agent-office__lane.is-layout-2 .agent-office__plant{transform-origin:bottom;transform:scale(.78)}.agent-office__lane.is-layout-3 .agent-office__window{border-radius:3px;width:78px;height:29px;transform:rotate(-1deg)}.agent-office__lane.is-layout-3 .agent-office__window span:nth-child(2){flex:1.8}.agent-office__lane.is-layout-3 .agent-office__desk{border-radius:10px 2px 6px;width:78px;height:12px}.agent-office__lane.is-layout-3 .agent-office__plant{left:139px}.agent-office__mug{z-index:8;background:hsl(var(--primary) / .55);border-radius:2px 2px 4px 4px;width:11px;height:13px;position:absolute;bottom:39px;right:4px}.agent-office__mug:after{content:"";border:2px solid hsl(var(--primary) / .55);border-left:0;border-radius:0 5px 5px 0;width:6px;height:7px;position:absolute;top:3px;right:-5px}.agent-office__mug>i,.agent-office__mug>b{content:"";border-left:1px solid hsl(var(--muted-foreground) / .42);opacity:0;border-radius:50%;width:5px;height:8px;animation:3.4s ease-in-out infinite agent-office-mug-steam;position:absolute;top:-9px;left:2px}.agent-office__mug>b{animation-delay:-1.55s;left:6px}.agent-office__mug.is-leader{background:hsl(var(--warning) / .82);width:14px;box-shadow:inset 0 3px 0 hsl(var(--background) / .22)}.agent-office__mug.is-leader:before{content:"";background:hsl(var(--warning));clip-path:polygon(0 100%,0 0,30% 65%,50% 0,70% 65%,100% 0,100% 100%);width:10px;height:5px;position:absolute;top:-5px;left:2px}.agent-office__mug.is-leader:after{border-color:hsl(var(--warning) / .82)}.agent-office__mug.is-builder{background:hsl(var(--success) / .72);border-radius:3px;width:10px;height:18px}.agent-office__mug.is-builder:after{display:none}.agent-office__mug.is-researcher{background:hsl(var(--info) / .66);border-radius:3px 3px 7px 7px;width:15px;height:14px}.agent-office__mug.is-researcher:after{border-color:hsl(var(--info) / .66)}.agent-office__mug.is-reviewer{background:hsl(var(--warning) / .68);border-radius:2px 2px 5px 5px;width:10px;height:8px;bottom:39px;right:7px}.agent-office__mug.is-reviewer:after{border-color:hsl(var(--warning) / .68);width:5px;height:5px;top:1px;right:-4px}.agent-office__mug.is-planner{background:hsl(var(--primary) / .64);box-shadow:-8px -3px 0 -3px hsl(var(--foreground) / .72)}.agent-office__mug.is-operator{background:hsl(var(--muted-foreground) / .62)}.agent-office__mug.is-operator:after{border-color:hsl(var(--muted-foreground) / .62)}.agent-office__avatar{--avatar-shirt:hsl(var(--primary) / .72);--avatar-accent:hsl(var(--primary));--avatar-skin:hsl(var(--warning) / .42);--avatar-skin-shadow:hsl(var(--warning) / .14);--avatar-hair:hsl(var(--foreground) / .78);--avatar-cycle:7.2s;--avatar-delay:-.4s;--avatar-type-speed:.72s;z-index:6;width:58px;height:78px;position:absolute;bottom:25px;left:0}.agent-office__avatar-chair{background:var(--desk-chair);border-radius:15px 15px 8px 8px;width:41px;height:49px;position:absolute;bottom:2px;left:5px;transform:rotate(-3deg)}.agent-office__avatar-body{background:var(--avatar-shirt);border-radius:12px 12px 8px 8px;width:34px;height:35px;position:absolute;bottom:15px;left:14px}.agent-office__avatar-head{background:var(--avatar-skin);width:31px;height:32px;box-shadow:inset 0 -3px 0 var(--avatar-skin-shadow);border-radius:48% 48% 44% 44%;position:absolute;top:4px;left:15px}.agent-office__avatar-hair{background:var(--avatar-hair);border-radius:15px 14px 4px 7px;height:13px;position:absolute;inset:-2px 2px auto 0}.agent-office__avatar.is-avatar-1{--avatar-skin:color-mix(in srgb, hsl(var(--warning)) 72%, hsl(var(--foreground)));--avatar-skin-shadow:color-mix(in srgb, var(--avatar-skin) 72%, transparent);--avatar-hair:hsl(var(--primary) / .76)}.agent-office__avatar.is-avatar-1 .agent-office__avatar-hair{clip-path:polygon(0 0,100% 0,100% 68%,70% 42%,48% 100%,31% 43%,0 72%);border-radius:17px 15px 8px 3px;height:17px;inset:-3px -1px auto}.agent-office__avatar.is-avatar-2{--avatar-skin:color-mix(in srgb, hsl(var(--warning)) 63%, hsl(var(--background)));--avatar-skin-shadow:hsl(var(--warning) / .12);--avatar-hair:hsl(var(--foreground) / .7)}.agent-office__avatar.is-avatar-2 .agent-office__avatar-hair{background:radial-gradient(circle at 15% 58%, var(--avatar-hair) 0 4px, transparent 4.5px), radial-gradient(circle at 38% 34%, var(--avatar-hair) 0 5px, transparent 5.5px), radial-gradient(circle at 64% 38%, var(--avatar-hair) 0 5px, transparent 5.5px), radial-gradient(circle at 87% 62%, var(--avatar-hair) 0 4px, transparent 4.5px);border-radius:11px 13px 4px 7px;width:32px;height:15px;inset:-4px -1px auto}.agent-office__avatar.is-avatar-3{--avatar-skin:color-mix(in srgb, hsl(var(--warning)) 58%, hsl(var(--primary)));--avatar-skin-shadow:hsl(var(--primary) / .13);--avatar-hair:hsl(var(--muted-foreground) / .84)}.agent-office__avatar.is-avatar-3 .agent-office__avatar-hair{border-radius:14px 14px 3px 7px;height:9px;inset:-1px 3px auto 0}.agent-office__avatar.is-avatar-3 .agent-office__avatar-hair:after{content:"";background:var(--avatar-hair);border-radius:50%;width:11px;height:11px;position:absolute;top:-7px;right:-3px}.agent-office__avatar.is-avatar-4{--avatar-skin:color-mix(in srgb, hsl(var(--warning)) 78%, hsl(var(--background)));--avatar-skin-shadow:hsl(var(--warning) / .1);--avatar-hair:hsl(var(--foreground) / .66)}.agent-office__avatar.is-avatar-4 .agent-office__avatar-hair{background:repeating-linear-gradient(90deg, var(--avatar-hair) 0 2px, transparent 2px 4px);border-radius:50% 50% 2px 2px;height:5px;inset:0 2px auto 1px}.agent-office__avatar.is-avatar-5{--avatar-skin:hsl(var(--info) / .46);--avatar-skin-shadow:hsl(var(--info) / .31);--avatar-hair:hsl(var(--info) / .78)}.agent-office__avatar.is-avatar-5 .agent-office__avatar-hair{clip-path:polygon(0 0,100% 0,100% 100%,83% 55%,66% 100%,50% 55%,33% 100%,16% 55%,0 100%);border-radius:3px 3px 1px 1px;height:8px;inset:-2px 1px auto}.agent-office__avatar.is-motion-1{--avatar-cycle:8.6s;--avatar-delay:-3.1s;--avatar-type-speed:.58s}.agent-office__avatar.is-motion-2{--avatar-cycle:6.8s;--avatar-delay:-5.2s;--avatar-type-speed:.84s}.agent-office__avatar.is-motion-3{--avatar-cycle:9.4s;--avatar-delay:-1.7s;--avatar-type-speed:.66s}.agent-office__avatar-face:before,.agent-office__avatar-face:after{content:"";background:hsl(var(--foreground) / .7);width:2px;height:2px;animation:5.2s ease-in-out infinite agent-office-blink;animation-delay:var(--avatar-delay);border-radius:50%;position:absolute;top:17px}.agent-office__avatar-face:before{left:9px}.agent-office__avatar-face:after{right:9px}.agent-office__avatar-mouth{background:hsl(var(--foreground) / .58);transform-origin:50%;border-radius:50%;width:6px;height:2px;position:absolute;bottom:6px;left:13px}.agent-office__avatar-headset{border:2px solid hsl(var(--foreground) / .72);border-bottom:0;border-radius:15px 15px 0 0;height:20px;position:absolute;inset:5px -4px auto}.agent-office__avatar-headset:after{content:"";background:hsl(var(--foreground) / .72);border-radius:3px;width:5px;height:9px;position:absolute;bottom:-3px;right:-3px}.agent-office__avatar-arm{z-index:8;background:var(--avatar-shirt);transform-origin:0;border-radius:8px;width:29px;height:8px;position:absolute;bottom:29px;right:0;transform:rotate(-11deg)}.agent-office__avatar-role-badge{z-index:10;border:2px solid hsl(var(--card));width:18px;height:18px;color:hsl(var(--primary-foreground));background:var(--avatar-accent);box-shadow:0 2px 6px hsl(var(--shadow-color) / .18);border-radius:50%;place-items:center;display:grid;position:absolute;bottom:4px;left:18px}.agent-office__avatar-role-badge svg{width:9px;height:9px}.agent-office__avatar-prop{z-index:11;pointer-events:none;position:absolute}.agent-office__avatar.is-leader{--avatar-shirt:hsl(var(--primary) / .86);--avatar-accent:hsl(var(--warning))}.agent-office__avatar.is-leader .agent-office__avatar-prop{background:hsl(var(--warning));clip-path:polygon(0 100%,0 25%,25% 65%,50% 0,75% 65%,100% 25%,100% 100%);width:23px;height:11px;filter:drop-shadow(0 2px 2px hsl(var(--shadow-color) / .16));top:-3px;left:19px}.agent-office__avatar.is-builder{--avatar-shirt:hsl(var(--success) / .7);--avatar-accent:hsl(var(--success))}.agent-office__avatar.is-builder .agent-office__avatar-body{box-shadow:inset 0 4px 0 hsl(var(--background) / .18);border-radius:16px 16px 7px 7px}.agent-office__avatar.is-builder .agent-office__avatar-prop{background:hsl(var(--warning));border-radius:4px;width:23px;height:4px;bottom:20px;right:0;transform:rotate(-38deg)}.agent-office__avatar.is-researcher{--avatar-shirt:hsl(var(--info) / .68);--avatar-accent:hsl(var(--info))}.agent-office__avatar.is-researcher .agent-office__avatar-prop{border:3px solid hsl(var(--info));border-radius:50%;width:14px;height:14px;top:14px;right:2px}.agent-office__avatar.is-researcher .agent-office__avatar-prop:after{content:"";background:hsl(var(--info));border-radius:3px;width:9px;height:3px;position:absolute;bottom:-5px;right:-7px;transform:rotate(48deg)}.agent-office__avatar.is-reviewer{--avatar-shirt:hsl(var(--warning) / .64);--avatar-accent:hsl(var(--warning))}.agent-office__avatar.is-reviewer .agent-office__avatar-prop{border:2px solid hsl(var(--foreground) / .76);width:11px;height:7px;box-shadow:12px 0 0 -2px hsl(var(--warning) / .35), 12px 0 0 0 hsl(var(--foreground) / .76);border-radius:5px;top:18px;left:17px}.agent-office__avatar.is-planner{--avatar-shirt:hsl(var(--primary) / .56);--avatar-accent:hsl(var(--primary))}.agent-office__avatar.is-planner .agent-office__avatar-hair{border-radius:4px 15px 10px 4px;transform:rotate(-5deg)}.agent-office__avatar.is-planner .agent-office__avatar-prop{border:2px solid hsl(var(--primary));background:hsl(var(--card));width:18px;height:24px;box-shadow:inset 0 5px 0 hsl(var(--primary) / .15);border-radius:3px;bottom:16px;right:-1px;transform:rotate(8deg)}.agent-office__avatar.is-operator{--avatar-shirt:hsl(var(--muted-foreground) / .62);--avatar-accent:hsl(var(--muted-foreground))}.agent-office__avatar.is-active .agent-office__avatar-arm{animation:agent-office-type var(--avatar-type-speed) ease-in-out infinite alternate;animation-delay:var(--avatar-delay)}.agent-office__avatar.is-active .agent-office__avatar-head{animation:2.6s ease-in-out infinite agent-office-nod;animation-delay:var(--avatar-delay)}.agent-office__avatar.is-idle .agent-office__avatar-head{animation:agent-office-yawn-head var(--avatar-cycle) ease-in-out infinite;animation-delay:var(--avatar-delay)}.agent-office__avatar.is-idle .agent-office__avatar-mouth{animation:agent-office-yawn-mouth var(--avatar-cycle) ease-in-out infinite;animation-delay:var(--avatar-delay)}.agent-office__avatar.is-idle .agent-office__avatar-arm{animation:agent-office-idle-stretch var(--avatar-cycle) ease-in-out infinite;animation-delay:var(--avatar-delay)}.agent-office__avatar.is-failed .agent-office__avatar-body{background:hsl(var(--destructive) / .72)}.agent-office__conveyor{z-index:5;place-items:center;min-width:0;display:grid;position:absolute;inset:24px 16px 22px 168px}.agent-office__belt{border:1px solid hsl(var(--border));background:repeating-linear-gradient(115deg, hsl(var(--muted)) 0 18px, hsl(var(--surface-3) / .62) 18px 35px);height:30px;box-shadow:inset 0 4px 8px hsl(var(--shadow-color) / .06);border-radius:8px;justify-content:space-around;align-items:center;display:flex;position:absolute;bottom:15px;left:0;right:0;overflow:hidden}.agent-office__belt span{border:3px solid hsl(var(--muted-foreground) / .3);background:hsl(var(--card));border-radius:50%;flex:none;width:18px;height:18px}.agent-office__conveyor.is-moving .agent-office__belt{animation:1.8s linear infinite agent-office-belt}.agent-office__current-action{z-index:3;width:min(340px,90%);margin-bottom:25px;position:relative}.agent-office__current-action>.agent-office__parcel{animation:.52s cubic-bezier(.2,.8,.2,1) agent-office-arrive}.agent-office__parcel{border:1px solid hsl(var(--border));width:100%;min-width:0;color:hsl(var(--foreground));text-align:left;background:hsl(var(--card));box-shadow:0 9px 22px hsl(var(--shadow-color) / .12);cursor:pointer;border-radius:10px;align-items:center;gap:10px;padding:10px;transition:transform .15s,border-color .15s,box-shadow .15s;display:flex;position:relative}button.agent-office__parcel:hover{border-color:hsl(var(--primary) / .45);box-shadow:0 12px 26px hsl(var(--shadow-color) / .16);transform:translateY(-2px)}.agent-office__parcel.is-running{border-color:hsl(var(--primary) / .52);box-shadow:0 10px 26px hsl(var(--primary) / .14)}.agent-office__parcel.is-failed{border-color:hsl(var(--destructive) / .48)}.agent-office__parcel.is-compact{min-height:38px;box-shadow:none;border-radius:7px;gap:7px;padding:6px 7px}.agent-office__parcel--empty{cursor:default;color:hsl(var(--muted-foreground));background:hsl(var(--card) / .65);box-shadow:none;border-style:dashed}.agent-office__mail-parcel{border:1px solid hsl(var(--info) / .34);width:100%;min-width:0;color:hsl(var(--foreground));text-align:left;background:hsl(var(--card));box-shadow:0 8px 22px hsl(var(--info) / .12);cursor:pointer;border-radius:8px;align-items:center;gap:8px;padding:7px 8px;display:flex;position:relative}.agent-office__mail-parcel:hover{border-color:hsl(var(--info) / .58)}.agent-office__mail-parcel.is-outgoing{border-color:hsl(var(--success) / .36)}.agent-office__mail-parcel.is-unread:after{content:"";background:hsl(var(--info));width:5px;height:5px;box-shadow:0 0 0 3px hsl(var(--info) / .12);border-radius:50%;position:absolute;top:5px;right:5px}.agent-office__mail-parcel>svg{width:12px;height:12px;color:hsl(var(--info));flex:none}.agent-office__mail-icon{width:27px;height:27px;color:hsl(var(--info));background:hsl(var(--info) / .1);border-radius:6px;flex:none;place-items:center;display:grid}.agent-office__mail-icon svg{width:13px;height:13px}.agent-office__mail-parcel.is-outgoing .agent-office__mail-icon{color:hsl(var(--success));background:hsl(var(--success) / .1)}.agent-office__mail-flyby{z-index:12;width:min(190px,42%);position:absolute;top:8px;right:9px}.agent-office__mail-flyby.is-incoming{animation:.65s cubic-bezier(.16,.82,.28,1) agent-office-mail-in}.agent-office__mail-flyby.is-outgoing{animation:.65s cubic-bezier(.16,.82,.28,1) agent-office-mail-out}.agent-office__tool-glyph{border:1px solid hsl(var(--border));width:36px;height:36px;color:hsl(var(--muted-foreground));background:hsl(var(--muted));border-radius:9px;flex:none;place-items:center;display:grid;position:relative}.agent-office__tool-glyph>svg{z-index:2;width:17px;height:17px;position:relative}.agent-office__tool-glyph.is-read{color:hsl(var(--info));background:hsl(var(--info) / .1);border-color:hsl(var(--info) / .25)}.agent-office__tool-glyph.is-read>svg:not(.agent-office__file-underlay){width:13px;height:13px;transform:translate(5px,5px)}.agent-office__tool-glyph>.agent-office__file-underlay{z-index:1;opacity:.72;width:18px;height:18px;position:absolute;transform:translate(-3px,-3px)}.agent-office__tool-glyph.is-write,.agent-office__tool-glyph.is-edit{color:hsl(var(--warning));background:hsl(var(--warning) / .1);border-color:hsl(var(--warning) / .25)}.agent-office__tool-glyph.is-terminal{color:hsl(var(--success));background:hsl(var(--success) / .1);border-color:hsl(var(--success) / .25)}.agent-office__tool-glyph.is-web{color:hsl(var(--info));background:hsl(var(--info) / .1);border-color:hsl(var(--info) / .25)}.agent-office__tool-glyph.is-search,.agent-office__tool-glyph.is-memory{color:hsl(var(--primary));background:hsl(var(--primary) / .09);border-color:hsl(var(--primary) / .24)}.agent-office__tool-glyph.is-active:after{z-index:0;content:"";opacity:.25;border:1px solid;border-radius:11px;animation:1.3s ease-out infinite agent-office-ring;position:absolute;inset:-4px}.agent-office__parcel.is-compact .agent-office__tool-glyph{border-radius:6px;width:27px;height:27px}.agent-office__parcel.is-compact .agent-office__tool-glyph>svg{width:13px;height:13px}.agent-office__parcel-copy{flex-direction:column;flex:auto;gap:2px;min-width:0;display:flex}.agent-office__parcel-topline{align-items:center;gap:6px;min-width:0;display:flex}.agent-office__parcel-copy strong{font:500 10px / 1.2 var(--font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.agent-office__parcel-target{color:hsl(var(--muted-foreground));font:400 9px / 1.25 var(--font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.agent-office__parcel-summary{color:hsl(var(--foreground) / .82);text-overflow:ellipsis;white-space:nowrap;font-size:10px;overflow:hidden}.agent-office__parcel.is-compact .agent-office__parcel-target,.agent-office__parcel.is-compact .agent-office__line-chip{display:none}.agent-office__parcel.is-compact .agent-office__parcel-summary{color:hsl(var(--muted-foreground));font-size:11px}.agent-office__line-chip{color:hsl(var(--info));background:hsl(var(--info) / .09);font:500 10px / 1 var(--font-mono);border-radius:4px;flex:none;padding:2px 4px}.agent-office__parcel-state{width:18px;height:18px;color:hsl(var(--success));flex:none;place-items:center;display:grid}.agent-office__parcel-state>svg{width:12px;height:12px}.agent-office__parcel-state .agent-office__pulse-dot{color:hsl(var(--primary));background:hsl(var(--primary));box-shadow:0 0 0 4px hsl(var(--primary) / .12)}.agent-office__parcel.is-failed .agent-office__parcel-state{color:hsl(var(--destructive))}.agent-office__history{border-left:1px solid var(--office-line);background:hsl(var(--background) / .24);min-width:0;padding:11px 12px}.agent-office__history-heading{color:hsl(var(--muted-foreground));font:500 10px / 1 var(--font-mono);letter-spacing:.1em;justify-content:space-between;align-items:center;margin-bottom:7px;display:flex}.agent-office__history-heading span:last-child{letter-spacing:0}.agent-office__history-list{scrollbar-color:hsl(var(--border)) transparent;scrollbar-width:thin;flex-direction:column;gap:5px;max-height:146px;padding-right:3px;display:flex;overflow-y:auto}.agent-office__history-empty{min-height:88px;color:hsl(var(--muted-foreground));place-items:center;font-size:10px;font-style:italic;display:grid}.agent-office__footer{z-index:4;border-top:1px solid var(--office-line);min-height:31px;color:hsl(var(--muted-foreground));background:hsl(var(--card) / .9);font:400 9px / 1 var(--font-mono);align-items:center;gap:18px;padding:5px 15px;display:flex;position:relative}.agent-office__footer>span{align-items:center;gap:6px;display:flex}.agent-office__footer svg{width:12px;height:12px}.agent-office__empty-state{text-align:center;place-content:center;justify-items:center;min-height:360px;display:grid}.agent-office__empty-state>span{border:1px dashed hsl(var(--border));width:64px;height:64px;color:hsl(var(--primary));background:hsl(var(--primary) / .06);border-radius:18px;place-items:center;margin-bottom:15px;display:grid}.agent-office__empty-state h2{font:500 16px / 1.3 var(--font-display);margin:0 0 5px}.agent-office__empty-state p{color:hsl(var(--muted-foreground));margin:0;font-size:11px}.agent-office__detail-backdrop{z-index:39;background:hsl(var(--background) / .44);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);cursor:default;border:0;position:absolute;inset:0}.agent-office__detail{z-index:40;border-left:1px solid hsl(var(--border));width:min(410px,94%);color:hsl(var(--foreground));background:hsl(var(--background));box-shadow:-20px 0 55px hsl(var(--shadow-color) / .24);animation:.22s ease-out agent-office-drawer;position:absolute;top:0;bottom:0;right:0;overflow-y:auto}.agent-office__detail-header{z-index:2;border-bottom:1px solid hsl(var(--border));background:hsl(var(--card) / .95);-webkit-backdrop-filter:blur(18px);backdrop-filter:blur(18px);align-items:center;gap:10px;padding:14px;display:flex;position:sticky;top:0}.agent-office__detail-header h2{font:500 15px / 1.2 var(--font-display);margin:3px 0 0}.agent-office__detail-header>button{border:1px solid hsl(var(--border));width:30px;height:30px;color:hsl(var(--muted-foreground));background:hsl(var(--background));cursor:pointer;border-radius:7px;place-items:center;margin-left:auto;display:grid}.agent-office__detail-header>button:hover{color:hsl(var(--foreground));background:hsl(var(--accent))}.agent-office__detail-header>button svg{width:14px;height:14px}.agent-office__detail-icon{width:38px;height:38px;color:hsl(var(--primary));background:hsl(var(--primary) / .1);border-radius:10px;place-items:center;display:grid}.agent-office__detail-icon.is-terminal{color:hsl(var(--success));background:hsl(var(--success) / .1)}.agent-office__detail-icon.is-read,.agent-office__detail-icon.is-web{color:hsl(var(--info));background:hsl(var(--info) / .1)}.agent-office__detail-icon.is-edit,.agent-office__detail-icon.is-write{color:hsl(var(--warning));background:hsl(var(--warning) / .1)}.agent-office__detail-icon.is-mail{color:hsl(var(--info));background:hsl(var(--info) / .1)}.agent-office__detail-icon.is-task,.agent-office__detail-icon.is-briefing{color:hsl(var(--primary));background:hsl(var(--primary) / .1)}.agent-office__detail-icon svg{width:18px;height:18px}.agent-office__detail-status{border:1px solid hsl(var(--border));background:hsl(var(--card));border-radius:9px;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:9px;margin:14px;padding:11px;display:grid}.agent-office__detail-status strong{text-overflow:ellipsis;white-space:nowrap;font-size:11px;overflow:hidden}.agent-office__detail-status>span:last-child{color:hsl(var(--muted-foreground));background:hsl(var(--muted));font:500 10px / 1 var(--font-mono);text-transform:uppercase;border-radius:4px;padding:3px 5px}.agent-office__detail-section{border-top:1px solid hsl(var(--border) / .72);padding:12px 14px}.agent-office__detail-section h3{color:hsl(var(--muted-foreground));font:500 11px / 1 var(--font-mono);letter-spacing:.11em;text-transform:uppercase;margin:0 0 9px}.agent-office__detail-row{justify-content:space-between;align-items:baseline;gap:14px;padding:4px 0;font-size:10px;display:flex}.agent-office__detail-row>span{color:hsl(var(--muted-foreground))}.agent-office__detail-row>strong{min-width:0;font:500 10px / 1.3 var(--font-mono);text-align:right;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.agent-office__target-code{overflow-wrap:anywhere;color:hsl(var(--foreground));background:hsl(var(--muted) / .7);font:400 10px / 1.45 var(--font-mono);border-radius:7px;padding:9px;display:block}.agent-office__file-target{border:1px solid hsl(var(--border) / .68);border-radius:6px;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:7px;margin-top:6px;padding:7px;display:grid}.agent-office__file-target svg{width:13px;height:13px;color:hsl(var(--info))}.agent-office__file-target span{font:400 9px / 1.2 var(--font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.agent-office__file-target strong{color:hsl(var(--info));font:500 10px / 1 var(--font-mono)}.agent-office__metric-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;display:grid}.agent-office__metric-grid>div{background:hsl(var(--muted) / .62);border-radius:7px;flex-direction:column;min-width:0;padding:9px;display:flex}.agent-office__metric-grid strong{font:500 12px / 1.2 var(--font-mono);text-overflow:ellipsis;overflow:hidden}.agent-office__metric-grid span{color:hsl(var(--muted-foreground));margin-top:3px;font-size:10px}.agent-office__detail-section pre{border:1px solid hsl(var(--border));max-height:260px;color:hsl(var(--foreground) / .9);background:hsl(var(--popover));font:400 9px / 1.55 var(--font-mono);white-space:pre-wrap;overflow-wrap:anywhere;border-radius:7px;margin:0;padding:10px;overflow:auto}.agent-office__mail-body{border:1px solid hsl(var(--border));color:hsl(var(--foreground) / .88);background:hsl(var(--muted) / .45);font:400 11px / 1.55 var(--font-sans);white-space:pre-wrap;border-radius:8px;padding:10px}.agent-office__task-body{border:1px solid hsl(var(--border));color:hsl(var(--foreground) / .9);background:hsl(var(--muted) / .42);font:400 11px / 1.55 var(--font-sans);white-space:pre-wrap;border-radius:8px;padding:10px}.agent-office__todo-detail-list{flex-direction:column;gap:6px;display:flex}.agent-office__todo-detail{border:1px solid hsl(var(--border));background:hsl(var(--muted) / .3);border-radius:8px;align-items:flex-start;gap:8px;padding:7px 8px;display:flex}.agent-office__todo-detail>span{border:1px solid hsl(var(--muted-foreground));border-radius:50%;flex:none;width:7px;height:7px;margin-top:3px}.agent-office__todo-detail.is-in_progress>span{border-color:hsl(var(--success));background:hsl(var(--success));box-shadow:0 0 0 3px hsl(var(--success) / .1)}.agent-office__todo-detail.is-completed{opacity:.68}.agent-office__todo-detail.is-completed>span{border-color:hsl(var(--success));background:hsl(var(--success))}.agent-office__todo-detail>div{flex-direction:column;gap:3px;min-width:0;display:flex}.agent-office__todo-detail strong{font:500 10px / 1.35 var(--font-sans)}.agent-office__todo-detail small{color:hsl(var(--muted-foreground));font:400 9px / 1 var(--font-mono);text-transform:uppercase}@keyframes agent-office-arrive{0%{opacity:.4;transform:translate(42px)rotate(1deg)}to{opacity:1;transform:translate(0)rotate(0)}}@keyframes agent-office-mail-in{0%{opacity:0;transform:translate(72px)rotate(4deg)}to{opacity:1;transform:translate(0)rotate(0)}}@keyframes agent-office-mail-out{0%{opacity:0;transform:translate(-42px)rotate(-3deg)}to{opacity:1;transform:translate(0)rotate(0)}}@keyframes agent-office-belt{to{background-position:70px 0}}@keyframes agent-office-brief-arrive{0%{left:-30%}to{left:118%}}@keyframes agent-office-sync-line{to{background-position:-200% 0}}@keyframes agent-office-telemetry-wait{0%,to{opacity:.42}50%{opacity:1}}@keyframes agent-office-task-assigned{0%{opacity:0;transform:translate(-12px)rotate(-1deg)}to{opacity:1;transform:translate(0)rotate(0)}}@keyframes agent-office-window-glow{0%{opacity:.58}to{opacity:1;box-shadow:inset 0 0 8px hsl(var(--info) / .14)}}@keyframes agent-office-plant-sway{0%{transform:rotate(calc(var(--plant-angle) - 3deg)) scale(var(--plant-scale))}to{transform:rotate(calc(var(--plant-angle) + 3deg)) scale(var(--plant-scale))}}@keyframes agent-office-monitor-scan{0%{background-position:0 -110%}to{background-position:0 110%}}@keyframes agent-office-mug-steam{0%,18%{opacity:0;transform:translateY(3px)translate(0)}42%{opacity:.55}78%,to{opacity:0;transform:translateY(-6px)translate(2px)}}@keyframes agent-office-blink{0%,44%,48%,to{transform:scaleY(1)}46%{transform:scaleY(.12)}}@keyframes agent-office-terminal-bars{0%{opacity:.42;transform:scaleY(.45)}to{opacity:1;transform:scaleY(1.15)}}@keyframes agent-office-lane-arrive{0%{opacity:0;transform:translateY(8px)scale(.992)}to{opacity:1;transform:translateY(0)scale(1)}}@keyframes agent-office-memory-pulse{0%,to{opacity:.35;transform:scale(.72)rotate(0)}50%{opacity:1;transform:scale(1.08)rotate(8deg)}}@keyframes agent-office-web-signal{0%{opacity:0;transform:rotate(-38deg)scale(.72)}45%{opacity:.82}to{opacity:0;transform:rotate(-38deg)scale(1.08)}}@keyframes agent-office-inspect{0%{transform:translate(0)rotate(-4deg)}to{transform:translate(13px,3px)rotate(5deg)}}@keyframes agent-office-inspect-handle{0%{transform:translate(0)rotate(42deg)}to{transform:translate(13px,3px)rotate(51deg)}}@keyframes agent-office-write-stroke{0%{transform:translate(-4px)rotate(-27deg)}to{transform:translate(5px)rotate(-18deg)}}@keyframes agent-office-charm-blink{0%,45%,49%,to{transform:scaleY(1)}47%{transform:scaleY(.12)}}@keyframes agent-office-charm-bob{0%,76%,to{transform:translateY(0)rotate(0)}84%,91%{transform:translateY(-2px)rotate(-5deg)}}@keyframes agent-office-yawn-head{0%,72%,to{transform:translateY(0)rotate(0)}78%,90%{transform:translateY(-2px)rotate(-7deg)}}@keyframes agent-office-yawn-mouth{0%,72%,to{height:2px;transform:scale(1)}80%,88%{height:7px;transform:scale(1.15)}}@keyframes agent-office-idle-stretch{0%,72%,to{transform:rotate(-11deg)}80%,90%{transform:translate(2px,-7px)rotate(-34deg)}}@keyframes agent-office-type{to{transform:rotate(-4deg)translateY(2px)}}@keyframes agent-office-nod{0%,70%,to{transform:rotate(0)}82%{transform:rotate(3deg)}}@keyframes agent-office-ring{0%{opacity:.42;transform:scale(.82)}to{opacity:0;transform:scale(1.18)}}@keyframes agent-office-pulse{0%,to{opacity:.55;transform:scale(.8)}50%{opacity:1;transform:scale(1)}}@keyframes agent-office-drawer{0%{opacity:.5;transform:translate(35px)}to{opacity:1;transform:translate(0)}}.agent-office__model-chip{border:1px solid hsl(var(--primary) / .3);background:hsl(var(--primary) / .08);max-width:100%;color:hsl(var(--primary));font:600 9px / 1.5 var(--font-mono);letter-spacing:.02em;text-overflow:ellipsis;white-space:nowrap;border-radius:999px;align-items:center;padding:1px 7px;display:inline-flex;overflow:hidden}.agent-office__client-desks{position:relative}.agent-office__mail-routes{z-index:6;pointer-events:none;width:44px;position:absolute;top:9px;bottom:1px;left:206px}.agent-office__mail-route{position:absolute;inset:0}.agent-office__mail-route-parcel{top:var(--from);border:1px solid hsl(var(--info) / .55);background:hsl(var(--card) / .94);width:30px;height:30px;box-shadow:0 4px 14px hsl(var(--info) / .3), 0 0 0 3px hsl(var(--info) / .08);color:hsl(var(--info));border-radius:9px;place-items:center;animation:3.8s ease-in-out infinite agent-office-mail-travel;display:grid;position:absolute;left:0}.agent-office__mail-route-parcel svg{width:15px;height:15px}@keyframes agent-office-mail-travel{0%{top:var(--from);opacity:0;transform:translateY(-50%)scale(.7)}12%{opacity:1;transform:translateY(-50%)scale(1)}86%{opacity:1}to{top:var(--to);opacity:0;transform:translateY(-50%)scale(.7)}}.agent-office__desks-empty{border:1px dashed var(--office-line);color:hsl(var(--muted-foreground));font:500 10.5px / 1.4 var(--font-mono);border-radius:12px;align-items:center;gap:8px;margin:0 9px 9px;padding:13px 14px;display:flex}.agent-office__desks-empty svg{width:14px;height:14px;color:hsl(var(--warning))}.agent-office__lounge{border:1px dashed hsl(var(--border));background:linear-gradient(160deg, hsl(var(--warning) / .05), transparent 62%), var(--office-panel);border-radius:14px;margin:2px 9px 10px;padding:10px 12px 12px}.agent-office__lounge-heading{color:hsl(var(--muted-foreground));font:600 10px / 1 var(--font-mono);letter-spacing:.09em;text-transform:uppercase;align-items:center;gap:8px;margin-bottom:9px;display:flex}.agent-office__lounge-heading svg{width:14px;height:14px;color:hsl(var(--warning))}.agent-office__lounge-heading>span{letter-spacing:0;text-transform:none;margin-left:auto;font-weight:500}.agent-office__lounge-seats{flex-wrap:wrap;gap:8px;display:flex}.agent-office__lounge-seat{border:1px solid var(--office-line);background:hsl(var(--card) / .7);cursor:pointer;text-align:left;border-radius:11px;flex:0 auto;align-items:center;gap:9px;min-width:190px;padding:7px 10px;transition:border-color .16s,box-shadow .16s,transform .16s;display:flex}.agent-office__lounge-seat:disabled{cursor:default;opacity:.72}.agent-office__lounge-seat:not(:disabled):hover{border-color:hsl(var(--primary) / .4);box-shadow:0 6px 16px hsl(var(--shadow-color) / .1);transform:translateY(-1px)}.agent-office__lounge-avatar{border:1px solid hsl(var(--border));background:hsl(var(--accent) / .5);width:28px;height:28px;color:hsl(var(--muted-foreground));border-radius:9px;flex:none;place-items:center;display:grid}.agent-office__lounge-avatar svg{width:14px;height:14px}.agent-office__lounge-seat.is-leader .agent-office__lounge-avatar{border-color:hsl(var(--primary) / .35);background:hsl(var(--primary) / .12);color:hsl(var(--primary))}.agent-office__lounge-seat.is-builder .agent-office__lounge-avatar{border-color:hsl(var(--info) / .35);background:hsl(var(--info) / .12);color:hsl(var(--info))}.agent-office__lounge-seat.is-researcher .agent-office__lounge-avatar{border-color:hsl(var(--success) / .35);background:hsl(var(--success) / .12);color:hsl(var(--success))}.agent-office__lounge-seat.is-reviewer .agent-office__lounge-avatar{border-color:hsl(var(--destructive) / .32);background:hsl(var(--destructive) / .1);color:hsl(var(--destructive))}.agent-office__lounge-seat.is-planner .agent-office__lounge-avatar{border-color:hsl(var(--warning) / .38);background:hsl(var(--warning) / .12);color:hsl(var(--warning))}.agent-office__lounge-seat.is-operator .agent-office__lounge-avatar{border-color:hsl(var(--muted-foreground) / .34);background:hsl(var(--muted-foreground) / .1);color:hsl(var(--muted-foreground))}.agent-office__lounge-copy{flex-direction:column;gap:1px;min-width:0;display:flex}.agent-office__lounge-copy strong{color:hsl(var(--foreground));text-overflow:ellipsis;white-space:nowrap;font-size:11.5px;font-weight:600;line-height:1.25;overflow:hidden}.agent-office__lounge-copy small{color:hsl(var(--muted-foreground));font:500 9px / 1.3 var(--font-mono);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.agent-office__lounge-meta{color:hsl(var(--muted-foreground));font:500 9px / 1 var(--font-mono);align-items:center;gap:7px;margin-left:auto;display:flex}.agent-office__lounge-mail{color:hsl(var(--info));align-items:center;gap:3px;display:inline-flex}.agent-office__lounge-mail svg{width:11px;height:11px}@media (width<=1040px){.agent-office__briefing{grid-template-columns:1fr}.agent-office__client-header{flex-wrap:wrap}.agent-office__client-stats{justify-content:flex-start;width:100%}.agent-office__column-headings,.agent-office__lane{grid-template-columns:150px minmax(390px,1fr) 230px}.agent-office__mail-routes{left:176px}.agent-office__summary>div{min-width:72px}.agent-office__summary span{display:none}.agent-office__title{min-width:185px}.agent-office__title h1{max-width:200px}}@media (width<=820px){.agent-office__header{flex-wrap:wrap;gap:8px}.agent-office__summary{order:3;justify-content:flex-start;width:100%}.agent-office__summary>div{padding-block:3px}.agent-office__live-pill{margin-left:auto}.agent-office__column-headings{display:none}.agent-office__lane{grid-template-columns:132px minmax(380px,1fr)}.agent-office__mail-routes{left:158px}.agent-office__history{display:none}.agent-office__floor{overflow-x:auto}}@media (prefers-reduced-motion:reduce){.agent-office *,.agent-office :before,.agent-office :after{scroll-behavior:auto;transition-duration:.001ms;animation-duration:.001ms;animation-iteration-count:1}}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{$i as t,$r as n,Ai as r,An as i,Di as a,Dr as o,Jr as s,Ki as c,La as l,Nt as u,Oa as d,Oi as f,Or as p,Pa as m,Qn as h,Ta as g,Un as _,Ur as v,Vt as y,Wi as b,Wr as x,Xn as S,Yn as C,Zn as w,_ as T,_i as E,a as D,an as O,bi as k,c as A,d as ee,dt as j,f as M,h as te,hi as N,hr as ne,i as P,ia as re,in as F,ja as ie,ji as ae,l as oe,la as I,lt as se,m as ce,mt as le,nr as ue,o as de,or as fe,p as pe,pt as L,r as me,s as R,sn as z,u as B,ut as he,v as ge,xr as _e,xt as ve,yt as ye,za as be,zn as V}from"./vendor-BuarzSSb.js";import"./i18n-B0hsnanh.js";import{s as xe}from"./ws-client-DqFoX4jJ.js";import{t as H}from"./utils-B-9lSDIn.js";import{t as Se}from"./session-store-b2KGFwkX.js";import{C as Ce,d as we,u as U,y as Te}from"./stores-BptlyD_v.js";import{r as Ee}from"./mailbox-store-D8TvJsuk.js";import{d as De}from"./markdown-sSmz-Ua_.js";import{_ as Oe,d as ke,f as Ae,g as je,l as Me,u as Ne,w as Pe}from"./index-DHdO0CRE.js";var W=e(be(),1);function Fe(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:{}}function Ie(e){return typeof e==`number`&&Number.isFinite(e)?e:void 0}function G(e){return typeof e==`string`&&e.trim()?e.trim():void 0}function K(e,t){for(let n of t){let t=G(e[n]);if(t)return t}}function q(e,t){for(let n of t){let t=Ie(e[n]);if(t!==void 0)return t}}function Le(e){return e.split(/[\\/]/).filter(Boolean).pop()??e}function Re(e){return e?e.split(/\r?\n/).length:0}function ze(e){let t=0,n=0;for(let r of e.split(/\r?\n/))r.startsWith(`+++`)||r.startsWith(`---`)||(r.startsWith(`+`)&&(t+=1),r.startsWith(`-`)&&(n+=1));return t||n?{added:t,removed:n}:null}function Be(e){let t=e.split(/\r?\n/,1)[0]?.trim()??e;return t.length>72?`${t.slice(0,69)}…`:t}function Ve(e){let t=e.toLowerCase().replace(/[.:/-]+/g,`_`);return/^(read|view|open_file|read_file)|file_read/.test(t)?`read`:/^(write|create|save)|file_write/.test(t)?`write`:/edit|update|patch|replace|apply_patch/.test(t)?`edit`:/bash|shell|terminal|exec|command|powershell|cmd/.test(t)?`terminal`:/fetch|browser|browse|http|url|web/.test(t)?`web`:/search|grep|find|glob|query/.test(t)?`search`:/memory|recall|remember/.test(t)?`memory`:`other`}function He(e,t){let n=(Array.isArray(e.fileTargets)?e.fileTargets:[]).flatMap(e=>{let t=Fe(e),n=K(t,[`filePath`,`file_path`,`path`]);return n?[{filePath:n,operation:G(t.operation),line:q(t,[`line`,`startLine`,`start_line`]),endLine:q(t,[`endLine`,`end_line`])}]:[]});if(n.length>0)return n;let r=K(t,[`file_path`,`filePath`,`path`,`filename`,`target_file`,`targetFile`]);return r?[{filePath:r,line:q(t,[`line`,`start_line`,`startLine`,`offset`]),endLine:q(t,[`end_line`,`endLine`])}]:[]}function Ue(e,t){let n=e?.line??q(t,[`line`,`start_line`,`startLine`,`offset`]),r=e?.endLine??q(t,[`end_line`,`endLine`]),i=q(t,[`limit`,`line_count`,`lineCount`]);return r===void 0&&n!==void 0&&i!==void 0&&i>0&&(r=n+i-1),n!==void 0&&r!==void 0?{start:n,end:r,label:`L${n}–${r}`}:n===void 0?{}:{start:n,label:`L${n}`}}function We(e,t,n,r,i,a){let o=Ue(a,n),s=a?.filePath??K(n,[`file_path`,`filePath`,`path`,`filename`]),c=s?Le(s):void 0;if(e===`read`)return{target:s,summary:i===void 0?o.label?`${o.label} queued to read`:`Reading file`:`${i.toLocaleString()} lines read`,lineLabel:o.label};if(e===`write`){let e=K(n,[`content`,`text`,`data`]),t=q(r,[`inputLines`])??(e?Re(e):void 0);return{target:s,summary:t===void 0?`Writing file`:`${t.toLocaleString()} lines written`,lineLabel:o.label}}if(e===`edit`){let e=K(n,[`patch`,`diff`]),t=e?ze(e):null,i=K(n,[`old_string`,`oldString`,`search`]),a=K(n,[`new_string`,`newString`,`replacement`]),c=q(r,[`addedLines`]),l=q(r,[`removedLines`]),u=q(r,[`oldLines`]),d=q(r,[`newLines`]);return{target:s,summary:t||c!==void 0||l!==void 0?`+${t?.added??c??0} / −${t?.removed??l??0} lines`:i!==void 0||a!==void 0||u!==void 0||d!==void 0?`${i?Re(i):u??0} → ${a?Re(a):d??0} lines`:o.label?`${o.label} updated`:`Updating file`,lineLabel:o.label}}if(e===`terminal`){let e=K(n,[`command`,`cmd`,`script`,`shell`])??t;return{summary:Be(e),target:e}}if(e===`web`){let e=K(n,[`url`,`href`,`uri`]),t=K(n,[`query`,`q`,`search`]);return{target:e??t,summary:e?`Fetched ${e}`:t?`Looked up “${t}”`:`Went online`}}if(e===`search`){let e=K(n,[`query`,`pattern`,`q`,`search`])??c;return{target:s??e,summary:e?`Searched “${e}”`:`Searching project`}}if(e===`memory`){let e=K(n,[`query`,`text`,`key`]);return{target:e,summary:e?`Recalled “${e}”`:`Checking memory`}}return{target:s,summary:c?`${t} · ${c}`:t}}function Ge(e,t){let n=G(t.name)??G(t.toolName);if(n)return n;if(e.kind===`agent:tool`)return e.target??void 0;if(e.kind.startsWith(`tool:`))return e.source}function Ke(e,t,n){return G(t.agentId)??G(t.subagentId)??(e.kind===`agent:tool`?e.source:void 0)??(e.source!==n&&e.source!==`filesystem`?e.source:void 0)??`leader`}function qe(e){return G(e.parentSessionId)??G(e.sessionId)}function Je(e,t){return e.kind===`tool:started`||e.kind===`tool:progress`?`running`:t.ok===!1?`failed`:`succeeded`}function Ye(e){if(![`tool:started`,`tool:progress`,`tool:executed`,`agent:tool`].includes(e.kind))return null;let t=Fe(e.data),n=Ge(e,t);if(!n)return null;let r=Ke(e,t,n),i=t.input,a=Fe(i),o=He(t,a),s=Ie(t.outputLines),c=Ve(n),l=We(c,n,a,t,s,o[0]),u=G(t.id),d=Math.floor(e.timestamp/2e3),f=Je(e,t),p=Ie(t.durationMs);return{id:u?`${r}:${u}`:`${r}:${n}:${d}`,agentId:r,agentName:G(t.agentName),sessionId:qe(t),toolName:n,kind:c,status:f,startedAt:f===`running`?e.timestamp:Math.max(0,e.timestamp-(p??0)),...f===`running`?{}:{completedAt:e.timestamp},durationMs:p,target:l.target,summary:l.summary,lineLabel:l.lineLabel,outputLines:s,outputBytes:Ie(t.outputBytes),outputTokens:Ie(t.outputTokens),input:i,output:G(t.output),fileTargets:o,raw:e.raw??t}}function Xe(e,t,n){return e?.length?tt(e.map(e=>({id:`snapshot:${n??`session`}:${t}:${e.id}`,kind:`tool:executed`,timestamp:e.completedAt,source:t,target:e.name,label:e.name,data:{...e,agentId:t,sessionId:n},flowGroup:`agent:${t}`})),t,n):[]}function Ze(e){return e?.length?e.map(e=>({id:e.id,direction:e.direction,from:e.from,to:e.to,type:e.type,subject:e.subject,body:``,priority:`normal`,timestamp:new Date(e.at).toISOString(),timestampMs:e.at,unread:e.direction===`incoming`})).sort((e,t)=>t.timestampMs-e.timestampMs).slice(0,12):[]}function Qe(e,t,n=3e4){let r=new Map;e.forEach((e,t)=>{for(let n of[e.agent.serverId,e.agent.mailboxId,e.agent.name]){let e=J(n);e&&!r.has(e)&&r.set(e,t)}});let i=new Set,a=[];for(let o of e){let e=o.mail[0];if(!e||i.has(e.id)||t-e.timestampMs>n)continue;let s=r.get(J(e.from)),c=r.get(J(e.to));s===void 0||c===void 0||s===c||(i.add(e.id),a.push({id:e.id,mail:e,fromIndex:s,toIndex:c}))}return a}function $e(e,t){return e.toLowerCase()===t.toLowerCase()}function J(e){return e?.trim().toLowerCase()??``}function et(e,t,n){let r=new Set([t.serverId,t.mailboxId,t.name].map(J).filter(e=>e.length>0)),i=n?`@session:${J(n)}`:``,a=J(t.role),o=J(t.serverId)===`leader`||J(t.serverId).startsWith(`leader@`)||a===`lead`||a===`leader`;return e.flatMap(e=>{let t=J(e.from),n=J(e.to),a=r.has(t),s=n===`*`||n===`all`||i.length>0&&n===i,c=(e.audience!==`leaders`||o)&&(r.has(n)||o&&s);if(!c&&!a)return[];let l=Date.parse(e.timestamp);return[{...e,direction:c?`incoming`:`outgoing`,timestampMs:Number.isFinite(l)?l:0,unread:c&&!Object.keys(e.readBy??{}).some(e=>r.has(J(e)))}]}).sort((e,t)=>t.timestampMs-e.timestampMs).slice(0,8)}function tt(e,t,n){let r=new Map;for(let i=e.length-1;i>=0;--i){let a=e[i];if(!a)continue;let o=Ye(a);if(!o||!$e(o.agentId,t)||n&&o.sessionId&&o.sessionId!==n)continue;let s=r.get(o.id);r.set(o.id,s?{...s,...o,startedAt:Math.min(s.startedAt,o.startedAt),fileTargets:o.fileTargets.length>0?o.fileTargets:s.fileTargets,input:o.input??s.input,output:o.output??s.output,raw:o.raw??s.raw}:o)}let i=[...r.values()].sort((e,t)=>(t.completedAt??t.startedAt)-(e.completedAt??e.startedAt));return i.filter((e,t)=>e.input!==void 0||e.fileTargets.length>0||e.output!==void 0||!i.some((n,r)=>r!==t&&n.toolName===e.toolName&&(n.input!==void 0||n.fileTargets.length>0||n.output!==void 0)&&Math.abs((n.completedAt??n.startedAt)-(e.completedAt??e.startedAt))<2500))}function nt(e,t,n){let r=Ve(t),i={read:`Reading a file`,write:`Writing a file`,edit:`Updating code`,terminal:`Running a command`,web:`Working online`,search:`Searching project`,memory:`Checking memory`,other:t};return{id:`${e}:live:${t}`,agentId:e,sessionId:n,toolName:t,kind:r,status:`running`,startedAt:Date.now(),summary:i[r],fileTargets:[]}}var Y=se(),rt={read:O,write:n,edit:n,terminal:y,web:N,search:v,memory:S,other:a};function it(e,t=46){if(!e||e.length<=t)return e;let n=e.split(/[\\/]/).slice(-2).join(`/`);return n.length<=t?`…/${n}`:`…${e.slice(-(t-1))}`}function at(e){return e===void 0?`—`:e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(+(e<1e4))} s`}function ot(e){if(e===void 0)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function X({label:e,value:t}){return(0,Y.jsxs)(`div`,{className:`agent-office__detail-row`,children:[(0,Y.jsx)(`span`,{children:e}),(0,Y.jsx)(`strong`,{children:t})]})}function st({selected:e,onClose:t}){let{t:n}=m(),{call:r,agentName:i}=e,a=rt[r.kind],o=ot(r.input),c=ot(r.output);return(0,Y.jsxs)(`aside`,{className:`agent-office__detail`,"aria-label":`${r.toolName} details`,children:[(0,Y.jsxs)(`div`,{className:`agent-office__detail-header`,children:[(0,Y.jsx)(`div`,{className:H(`agent-office__detail-icon`,`is-${r.kind}`),children:(0,Y.jsx)(a,{"aria-hidden":`true`})}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{children:n(`activity:agentOffice.toolCall`)}),(0,Y.jsx)(`h2`,{children:r.toolName})]}),(0,Y.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Close details`,children:(0,Y.jsx)(j,{})})]}),(0,Y.jsxs)(`div`,{className:`agent-office__detail-status`,children:[(0,Y.jsx)(`span`,{className:H(`agent-office__status-dot`,r.status===`running`&&`is-active`,r.status===`failed`&&`is-failed`)}),(0,Y.jsx)(`strong`,{children:r.summary}),(0,Y.jsx)(`span`,{children:r.status})]}),(0,Y.jsxs)(`section`,{className:`agent-office__detail-section`,children:[(0,Y.jsx)(`h3`,{children:n(`activity:agentOffice.execution`)}),(0,Y.jsx)(X,{label:n(`activity:agentOffice.agent`),value:i}),(0,Y.jsx)(X,{label:n(`activity:agentOffice.started`),value:new Date(r.startedAt).toLocaleTimeString()}),(0,Y.jsx)(X,{label:n(`activity:agentOffice.duration`),value:at(r.durationMs)}),r.sessionId&&(0,Y.jsx)(X,{label:n(`activity:agentOffice.session`),value:it(r.sessionId,28)})]}),(r.target||r.fileTargets.length>0)&&(0,Y.jsxs)(`section`,{className:`agent-office__detail-section`,children:[(0,Y.jsx)(`h3`,{children:n(`activity:agentOffice.target`)}),r.target&&(0,Y.jsx)(`code`,{className:`agent-office__target-code`,children:r.target}),r.fileTargets.map((e,t)=>(0,Y.jsxs)(`div`,{className:`agent-office__file-target`,children:[(0,Y.jsx)(s,{"aria-hidden":`true`}),(0,Y.jsx)(`span`,{children:e.filePath}),(e.line||e.endLine)&&(0,Y.jsxs)(`strong`,{children:[`L`,e.line??1,e.endLine?`–${e.endLine}`:``]})]},`${e.filePath}:${t}`))]}),(r.outputLines!==void 0||r.outputBytes!==void 0||r.outputTokens!==void 0)&&(0,Y.jsxs)(`section`,{className:`agent-office__detail-section`,children:[(0,Y.jsx)(`h3`,{children:n(`activity:agentOffice.resultSize`)}),(0,Y.jsxs)(`div`,{className:`agent-office__metric-grid`,children:[r.outputLines!==void 0&&(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{children:r.outputLines.toLocaleString()}),(0,Y.jsx)(`span`,{children:n(`activity:agentOffice.lines`)})]}),r.outputBytes!==void 0&&(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{children:r.outputBytes.toLocaleString()}),(0,Y.jsx)(`span`,{children:n(`activity:agentOffice.bytes`)})]}),r.outputTokens!==void 0&&(0,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(`strong`,{children:[`≈`,r.outputTokens.toLocaleString()]}),(0,Y.jsx)(`span`,{children:n(`activity:agentOffice.tokens`)})]})]})]}),o&&(0,Y.jsxs)(`section`,{className:`agent-office__detail-section`,children:[(0,Y.jsx)(`h3`,{children:n(`activity:agentOffice.input`)}),(0,Y.jsx)(`pre`,{children:(0,Y.jsx)(`code`,{children:o})})]}),c&&(0,Y.jsxs)(`section`,{className:`agent-office__detail-section`,children:[(0,Y.jsx)(`h3`,{children:n(`activity:agentOffice.outputPreview`)}),(0,Y.jsx)(`pre`,{children:(0,Y.jsx)(`code`,{children:c})})]})]})}function ct({selected:e,onClose:t}){let{t:n}=m(),{mail:r,agentName:i}=e;return(0,Y.jsxs)(`aside`,{className:`agent-office__detail`,"aria-label":`${r.subject} details`,children:[(0,Y.jsxs)(`div`,{className:`agent-office__detail-header`,children:[(0,Y.jsx)(`div`,{className:`agent-office__detail-icon is-mail`,children:(0,Y.jsx)(h,{"aria-hidden":`true`})}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{children:r.direction===`incoming`?`INCOMING MAIL`:`OUTGOING MAIL`}),(0,Y.jsx)(`h2`,{children:r.subject})]}),(0,Y.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Close mail details`,children:(0,Y.jsx)(j,{})})]}),(0,Y.jsxs)(`div`,{className:`agent-office__detail-status`,children:[(0,Y.jsx)(`span`,{className:H(`agent-office__status-dot`,r.unread&&`is-active`)}),(0,Y.jsxs)(`strong`,{children:[r.from,` → `,r.to]}),(0,Y.jsx)(`span`,{children:r.type}),r.audience===`leaders`&&(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(ue,{className:`h-3 w-3`}),` `,n(`activity:mailbox.audienceLeaders`)]})]}),(0,Y.jsxs)(`section`,{className:`agent-office__detail-section`,children:[(0,Y.jsx)(`h3`,{children:n(`activity:mailbox.messages`)}),(0,Y.jsx)(X,{label:n(`activity:agentOffice.agent`),value:i}),(0,Y.jsx)(X,{label:n(`activity:agentOffice.started`),value:new Date(r.timestampMs).toLocaleTimeString()}),(0,Y.jsx)(X,{label:`Priority`,value:r.priority}),(0,Y.jsx)(X,{label:`Route`,value:`${r.from} → ${r.to}`})]}),(0,Y.jsxs)(`section`,{className:`agent-office__detail-section`,children:[(0,Y.jsx)(`h3`,{children:r.subject}),(0,Y.jsx)(`div`,{className:`agent-office__mail-body`,children:r.body})]})]})}function lt({selected:e,onClose:t}){let{t:n}=m();return(0,Y.jsxs)(`aside`,{className:`agent-office__detail`,"aria-label":`${e.agentName} task details`,children:[(0,Y.jsxs)(`div`,{className:`agent-office__detail-header`,children:[(0,Y.jsx)(`div`,{className:`agent-office__detail-icon is-task`,children:(0,Y.jsx)(fe,{"aria-hidden":`true`})}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{children:n(`activity:agentOffice.currentTask`)}),(0,Y.jsx)(`h2`,{children:e.agentName})]}),(0,Y.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Close task details`,children:(0,Y.jsx)(j,{})})]}),(0,Y.jsxs)(`section`,{className:`agent-office__detail-section`,children:[(0,Y.jsx)(`h3`,{children:n(`activity:agentOffice.task`)}),e.taskId&&(0,Y.jsx)(X,{label:`ID`,value:e.taskId}),(0,Y.jsx)(`div`,{className:`agent-office__task-body`,children:e.task})]})]})}function ut({selected:e,onClose:t}){let{t:n}=m(),r=e.todos.filter(e=>e.status!==`completed`).length;return(0,Y.jsxs)(`aside`,{className:`agent-office__detail`,"aria-label":`${e.officeLabel} briefing`,children:[(0,Y.jsxs)(`div`,{className:`agent-office__detail-header`,children:[(0,Y.jsx)(`div`,{className:`agent-office__detail-icon is-briefing`,children:(0,Y.jsx)(C,{"aria-hidden":`true`})}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{children:e.instructionActive?n(`activity:agentOffice.activeInstruction`):n(`activity:agentOffice.officeBriefing`)}),(0,Y.jsx)(`h2`,{children:e.officeLabel})]}),(0,Y.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Close office briefing`,children:(0,Y.jsx)(j,{})})]}),(0,Y.jsxs)(`div`,{className:`agent-office__detail-status`,children:[(0,Y.jsx)(`span`,{className:H(`agent-office__status-dot`,(e.instructionActive||r>0)&&`is-active`)}),(0,Y.jsx)(`strong`,{children:e.telemetryConnected?n(`activity:agentOffice.activeTodos`):n(`activity:agentOffice.telemetryWaiting`)}),(0,Y.jsx)(`span`,{children:e.telemetryConnected?r:`—`})]}),(0,Y.jsxs)(`section`,{className:`agent-office__detail-section`,children:[(0,Y.jsx)(`h3`,{children:e.instructionActive?n(`activity:agentOffice.activeInstruction`):n(`activity:agentOffice.leaderPrompt`)}),e.promptAt!==void 0&&(0,Y.jsx)(X,{label:n(`activity:agentOffice.promptReceived`),value:new Date(e.promptAt).toLocaleString()}),(0,Y.jsx)(`div`,{className:`agent-office__task-body`,children:e.prompt??(e.telemetryConnected?n(`activity:agentOffice.noPrompt`):n(`activity:agentOffice.telemetryWaiting`))})]}),(0,Y.jsxs)(`section`,{className:`agent-office__detail-section`,children:[(0,Y.jsx)(`h3`,{children:n(`activity:agentOffice.todos`)}),(0,Y.jsx)(`div`,{className:`agent-office__todo-detail-list`,children:e.telemetryConnected?e.todos.length>0?e.todos.map(e=>(0,Y.jsxs)(`div`,{className:H(`agent-office__todo-detail`,`is-${e.status}`),children:[(0,Y.jsx)(`span`,{"aria-hidden":`true`}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`strong`,{children:e.content}),(0,Y.jsx)(`small`,{children:n(`activity:agentOffice.todoStatus.${e.status}`)})]})]},e.id)):(0,Y.jsx)(`span`,{className:`agent-office__history-empty`,children:n(`activity:agentOffice.noActiveTodos`)}):(0,Y.jsx)(`span`,{className:`agent-office__history-empty`,children:n(`activity:agentOffice.todoTelemetryWaiting`)})})]})]})}function dt({selected:e,onClose:t}){return e.kind===`tool`?(0,Y.jsx)(st,{selected:e,onClose:t}):e.kind===`mail`?(0,Y.jsx)(ct,{selected:e,onClose:t}):e.kind===`task`?(0,Y.jsx)(lt,{selected:e,onClose:t}):(0,Y.jsx)(ut,{selected:e,onClose:t})}function ft(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 pt(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 mt(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 ht(e){if(!e)return;let t=e.split(`/`);return t[t.length-1]?.slice(0,18)}function gt(e,t=56){if(!e)return;let n=e.replace(/\s+/g,` `).trim();if(n)return n.length<=t?n:t<=1?`…`:`${n.slice(0,t-1).trimEnd()}…`}function _t(e,t){if(e.length===0)return{positions:new Map,columns:0,rows:0,columnWidth:380};let n=Math.max(1,...e.map(e=>e.agentCount)),r=Math.max(380,Math.min(3,n)*190+80),i=e=>270+Math.max(1,...e.map(e=>Math.ceil(Math.max(1,e.agentCount)/3)))*150,a=Math.max(320,t.width),o=Math.max(240,t.height),s=1,c=-1/0,l=1/0;for(let t=1;t<=e.length;t+=1){let n=[];for(let r=0;r<e.length;r+=t)n.push(i(e.slice(r,r+t)));let u=n.length,d=Math.max(660,Math.min(t,e.length)*r),f=320+n.reduce((e,t)=>e+t,0)+Math.max(0,u-1)*100,p=Math.min(a/d,o/f),m=Math.abs(Math.log(d/f/(a/o)));(p>c+1e-9||Math.abs(p-c)<=1e-9&&m<l)&&(s=t,c=p,l=m)}let u=new Map,d=370;for(let t=0;t<e.length;t+=s){let n=e.slice(t,t+s);n.forEach((e,t)=>{u.set(e.id,{x:600+(t-(n.length-1)/2)*r,y:d})}),d+=i(n)+100}return{positions:u,columns:s,rows:Math.ceil(e.length/s),columnWidth:r}}function vt(e,t,n,r=640){let i=Math.min(3,n),a=Math.floor(t/i),o=t%i;return{x:e-(Math.min(i,n-a*i)-1)*190/2+o*190,y:r+a*150}}function yt(e){return e===`tui`?`tui`:e===`repl`||e===`cli`?`repl`:`webui`}function bt(e){return e===`tui`?`TUI`:e===`repl`?`REPL`:`WebUI`}function xt(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 St(e){if(e)return e.split(`/`).filter(Boolean).pop()??e}function Ct(e){let t=St(e)??e??``;return t.length>10?`…${t.slice(-8)}`:t}function wt(e,t){let n=St(t);if(n)return e.find(e=>St(e.sessionId)===n)}function Tt(e,t){let n=xt(t.status);return{officeId:`${e}__agent-${t.id}`,serverId:t.id,name:t.name??t.id,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,currentTool:t.currentTool,currentTask:t.description,taskId:t.taskId,presenceSource:`fleet`}}function Et(e,t){return e===`cli`?`CLI`:e===`repl`?`REPL`:bt(t)}function Dt(e,t,n=[],r=new Map,i=Date.now()){let a=new Set,o=[];for(let n of e){let e=yt(n.clientType),r=Et(n.clientType,e),i=`client-${n.pid??n.sessionId}`,s=[],c=!1;for(let e of n.agents){a.add(e.id);let n=t.get(e.id),r=xt(n?.status??e.status);(r===`active`||r===`streaming`)&&(c=!0),s.push({officeId:`${i}__agent-${e.id}`,serverId:e.id,name:n?.name??e.name??e.id,status:r,iteration:n?.iteration??e.iterations??0,toolCalls:n?.toolCalls??e.toolCalls??0,costUsd:n?.costUsd??e.costUsd??0,tokensIn:n?.tokensIn??e.tokensIn??0,tokensOut:n?.tokensOut??e.tokensOut??0,ctxPct:n?.ctxPct??e.ctxPct,model:n?.model??e.model,lastActivityAt:e.lastActivityAt,currentTool:n?.currentTool??e.currentTool,currentTask:e.currentTask??n?.description,taskId:e.taskId??n?.taskId,recentTools:e.recentTools,recentMail:e.recentMail,activity:e.activity,presenceSource:`registry`})}let l=n.status===`closing`||n.status===`stale`||n.status===`lost`?`offline`:c?`active`:`idle`,u=n.agents.find(e=>e.id===`leader`);o.push({id:i,type:e,label:`${r} · ${n.pid?`PID ${n.pid}`:Ct(n.sessionId)}`,sublabel:[`session ${Ct(n.sessionId)}`,n.gitBranch?`⎇ ${n.gitBranch}`:``,n.workingDir?n.workingDir.split(/[\\/]/).filter(Boolean).pop():``].filter(Boolean).join(` · `),status:l,sessionId:n.sessionId,pid:n.pid,branch:n.gitBranch,workingDir:n.workingDir,startedAt:n.startedAt,lastHeartbeatAt:n.lastHeartbeatAt,latestPrompt:u?.latestPrompt,latestPromptAt:u?.latestPromptAt,activeInstruction:u?.status===`running`||u?.status===`streaming`?u.latestPrompt??u.currentTask:void 0,todos:u?.todos,agents:s})}for(let e of n.filter(e=>e.online)){let t=wt(o,e.sessionId);if(!t)continue;let n=e.name.trim().toLowerCase(),r=t.agents.find(t=>t.serverId===e.agentId||t.name.trim().toLowerCase()===n);r&&(a.add(e.agentId),r.mailboxId=e.agentId,r.role=e.role,r.currentTask=r.currentTask??e.currentTask,r.currentTool=r.currentTool??e.currentTool)}let s=[...t.values()].filter(e=>!a.has(e.id)),c,l=()=>{if(c)return c;let e=o.find(e=>e.type===`webui`);return e?(c=e,e):(c={id:`client-self`,type:`webui`,label:`This WebUI`,sublabel:`Web UI`,status:`idle`,agents:[]},o.push(c),c)};for(let e of s){let t=wt(o,e.sessionId)??l(),n=Tt(t.id,e);(n.status===`active`||n.status===`streaming`)&&t.status!==`offline`&&(t.status=`active`),t.agents.push(n),a.add(e.id)}for(let[e,t]of r){if(a.has(e)||i-t.finishedAt>9e5)continue;let n=wt(o,t.agent.sessionId);n&&n.agents.push(Tt(n.id,t.agent))}return o.length===0&&o.push({id:`client-self`,type:`webui`,label:`This WebUI`,sublabel:`Web UI · connecting…`,status:`idle`,agents:[]}),o}function Ot(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 kt=new Set([`completed`,`failed`,`timeout`,`stopped`]);function At(e){let t=(0,W.useRef)(new Map).current;return(0,W.useMemo)(()=>{let n=Date.now(),r=new Set;for(let i of e.values())if(r.add(i.id),kt.has(i.status)){let e=t.get(i.id);e?e.agent=i:t.set(i.id,{agent:i,finishedAt:i.completedAt??n})}else t.delete(i.id);for(let[e,n]of[...t.entries()])!r.has(e)&&!kt.has(n.agent.status)&&t.set(e,{agent:{...n.agent,status:`stopped`},finishedAt:n.finishedAt});for(let[e,r]of t)n-r.finishedAt>9e5&&t.delete(e);return{map:t,now:n}},[e,t])}var jt=[`bot`,`cactus`,`duck`,`radio`],Mt={leader:`plum`,builder:`ocean`,researcher:`mint`,reviewer:`rose`,planner:`amber`,operator:`graphite`},Nt={leader:0,builder:1,researcher:2,reviewer:3,planner:4,operator:5},Pt={read:O,write:n,edit:n,terminal:y,web:N,search:v,memory:S,other:a},Ft={leader:re,builder:a,researcher:O,reviewer:t,planner:fe,operator:y};function It(e){if(e.serverId===`leader`||e.serverId.startsWith(`leader@`))return`leader`;let t=[e.role,e.name,e.currentTask].filter(Boolean).join(` `).toLowerCase();return/review|critic|audit|security|test|qa|verify|checker/.test(t)?`reviewer`:/research|analyst|explor|investig|search|hunter|recon/.test(t)?`researcher`:/plan|architect|design|coordinat|strateg|spec/.test(t)?`planner`:/build|implement|code|develop|engineer|refactor|fix|frontend|backend/.test(t)?`builder`:`operator`}function Lt(e,t){let n=2166136261;for(let t=0;t<e.length;t+=1)n^=e.charCodeAt(t),n=Math.imul(n,16777619);let r=n>>>0;return{palette:Mt[t],layout:r%4,clutter:Math.floor(r/4)%3,avatar:Nt[t],motion:Math.floor(r/31)%4,charm:jt[Math.floor(r/47)%jt.length]}}function Rt(e,t=22){let n=e.split(`/`).filter(Boolean).pop()??e;return n.length>t?`${n.slice(0,t-1)}…`:n}function zt(e,t=46){if(!e||e.length<=t)return e;let n=e.split(/[\\/]/).slice(-2).join(`/`);return n.length<=t?`…/${n}`:`…${e.slice(-(t-1))}`}function Bt(e,t){let n=Math.max(0,Math.floor((t-e)/1e3));if(n<5)return`now`;if(n<60)return`${n}s`;let r=Math.floor(n/60);return r<60?`${r}m`:`${Math.floor(r/60)}h`}function Vt(e,t){if(!e)return`—`;let n=Date.parse(e);if(!Number.isFinite(n))return`—`;let r=Math.max(0,Math.floor((t-n)/1e3));return r<60?`${r}s`:r<3600?`${Math.floor(r/60)}m`:r<86400?`${Math.floor(r/3600)}h`:`${Math.floor(r/86400)}d`}function Ht(e){let t=new Set,n=new Set,r=new Set,i=0,a=0,o={files:0,reads:0,writes:0,edits:0,linesAdded:0,linesRemoved:0,terminalCalls:0,incomingMail:0,outgoingMail:0};for(let s of e){let e=s.agent.activity;for(let n of e?.filesTouched??[])t.add(n);o.reads+=e?.reads??0,o.writes+=e?.writes??0,o.edits+=e?.edits??0,o.linesAdded+=e?.linesAdded??0,o.linesRemoved+=e?.linesRemoved??0,o.terminalCalls+=e?.terminalCalls??0,i+=e?.mailReceived??0,a+=e?.mailSent??0;for(let e of s.mail)(e.direction===`incoming`?n:r).add(e.id)}return o.files=t.size,o.incomingMail=Math.max(i,n.size),o.outgoingMail=Math.max(a,r.size),o}function Ut(e,t,n){return n.map((n,r)=>({...nt(e.serverId,n.name,t.sessionId),id:`${e.serverId}:log:${n.at}:${r}`,kind:Ve(n.name),status:n.ok?`succeeded`:`failed`,startedAt:Math.max(0,n.at-n.durationMs),completedAt:n.at,durationMs:n.durationMs,summary:n.ok?`${n.name} completed`:`${n.name} failed`}))}function Wt(...e){let t=[];for(let n of e.flat()){let e=n.completedAt??n.startedAt;t.some(t=>(t.id===n.id||t.toolName===n.toolName)&&Math.abs((t.completedAt??t.startedAt)-e)<2500)||t.push(n)}return t.sort((e,t)=>(t.completedAt??t.startedAt)-(e.completedAt??e.startedAt))}function Gt(...e){let t=new Map;for(let n of e.flat())t.set(n.id,n);return[...t.values()].sort((e,t)=>t.timestampMs-e.timestampMs).slice(0,12)}function Kt({kind:e,active:t}){let n=Pt[e];return(0,Y.jsxs)(`span`,{className:H(`agent-office__tool-glyph`,`is-${e}`,t&&`is-active`),children:[e===`read`&&(0,Y.jsx)(s,{className:`agent-office__file-underlay`,"aria-hidden":`true`}),(0,Y.jsx)(n,{"aria-hidden":`true`})]})}function qt({active:e,failed:t,role:n,variant:r,motion:i}){let a=Ft[n];return(0,Y.jsxs)(`div`,{className:H(`agent-office__avatar`,`is-${n}`,`is-avatar-${r}`,`is-motion-${i}`,e&&`is-active`,!e&&!t&&`is-idle`,t&&`is-failed`),"aria-hidden":`true`,children:[(0,Y.jsx)(`span`,{className:`agent-office__avatar-chair`}),(0,Y.jsx)(`span`,{className:`agent-office__avatar-body`}),(0,Y.jsxs)(`span`,{className:`agent-office__avatar-head`,children:[(0,Y.jsx)(`span`,{className:`agent-office__avatar-hair`}),(0,Y.jsx)(`span`,{className:`agent-office__avatar-face`}),(0,Y.jsx)(`span`,{className:`agent-office__avatar-mouth`}),(0,Y.jsx)(`span`,{className:`agent-office__avatar-headset`})]}),(0,Y.jsx)(`span`,{className:`agent-office__avatar-arm`}),(0,Y.jsx)(`span`,{className:`agent-office__avatar-prop`}),(0,Y.jsx)(`span`,{className:`agent-office__avatar-role-badge`,children:(0,Y.jsx)(a,{})})]})}function Jt({call:e,compact:n=!1,onSelect:r}){let i=e.status===`running`;return(0,Y.jsxs)(`button`,{type:`button`,className:H(`agent-office__parcel`,`is-${e.kind}`,n&&`is-compact`,i&&`is-running`,e.status===`failed`&&`is-failed`),onClick:r,"aria-label":`${e.toolName}: ${e.summary}`,children:[(0,Y.jsx)(Kt,{kind:e.kind,active:i}),(0,Y.jsxs)(`span`,{className:`agent-office__parcel-copy`,children:[(0,Y.jsxs)(`span`,{className:`agent-office__parcel-topline`,children:[(0,Y.jsx)(`strong`,{children:e.toolName}),e.lineLabel&&(0,Y.jsx)(`span`,{className:`agent-office__line-chip`,children:e.lineLabel})]}),!n&&e.target&&(0,Y.jsx)(`span`,{className:`agent-office__parcel-target`,children:zt(e.target)}),(0,Y.jsx)(`span`,{className:`agent-office__parcel-summary`,children:e.summary})]}),(0,Y.jsx)(`span`,{className:`agent-office__parcel-state`,"aria-hidden":`true`,children:i?(0,Y.jsx)(`span`,{className:`agent-office__pulse-dot`}):e.status===`failed`?(0,Y.jsx)(j,{}):(0,Y.jsx)(t,{})})]})}function Yt({mail:e,compact:t=!1,onSelect:n}){let r=e.direction===`incoming`;return(0,Y.jsxs)(`button`,{type:`button`,className:H(`agent-office__mail-parcel`,t&&`is-compact`,r?`is-incoming`:`is-outgoing`,e.unread&&`is-unread`),onClick:n,"aria-label":`${r?`Incoming`:`Outgoing`} mail: ${e.subject}`,children:[(0,Y.jsx)(`span`,{className:`agent-office__mail-icon`,children:r?(0,Y.jsx)(_e,{"aria-hidden":`true`}):(0,Y.jsx)(F,{"aria-hidden":`true`})}),(0,Y.jsxs)(`span`,{className:`agent-office__parcel-copy`,children:[(0,Y.jsx)(`strong`,{children:r?`${e.from} →`:`→ ${e.to}`}),(0,Y.jsx)(`span`,{className:`agent-office__parcel-summary`,children:e.subject})]}),(0,Y.jsx)(h,{"aria-hidden":`true`})]})}function Xt({office:e,now:t}){let{t:r}=m(),{client:i,agents:a,stats:o}=e,s=i.lastHeartbeatAt?Date.parse(i.lastHeartbeatAt):NaN,c=Number.isFinite(s)&&t-s<2e4,l=Number.isFinite(s)&&!c,u=a.some(({agent:e})=>e.presenceSource===`registry`),f=c?`VERIFIED`:l?`DELAYED`:u?`REGISTRY`:`LOCAL`,p=a.some(({agent:e})=>e.recentTools!==void 0||e.activity!==void 0),g=a.some(({agent:e})=>e.toolCalls>0&&e.recentTools===void 0&&e.activity===void 0);return(0,Y.jsxs)(`header`,{className:`agent-office__client-header`,children:[(0,Y.jsxs)(`div`,{className:`agent-office__client-title`,children:[(0,Y.jsx)(`span`,{className:`agent-office__client-icon`,children:(0,Y.jsx)(re,{"aria-hidden":`true`})}),(0,Y.jsxs)(`div`,{className:`agent-office__client-copy`,children:[(0,Y.jsx)(`strong`,{children:i.label}),(0,Y.jsx)(`span`,{children:i.sublabel||i.sessionId})]}),(0,Y.jsxs)(`div`,{className:`agent-office__client-presence`,children:[(0,Y.jsxs)(`span`,{className:`agent-office__client-agent-count`,children:[a.length,` `,r(`activity:agentOffice.agents`)]}),(0,Y.jsxs)(`span`,{className:H(`agent-office__presence-chip`,!l&&`is-live`,l&&`is-legacy`),children:[(0,Y.jsx)(L,{"aria-hidden":`true`}),` `,f]}),(0,Y.jsxs)(`span`,{className:`agent-office__presence-chip`,children:[(0,Y.jsx)(ae,{"aria-hidden":`true`}),` `,Vt(i.startedAt,t),` UP`]}),(0,Y.jsxs)(`span`,{className:H(`agent-office__presence-chip`,g?`is-legacy`:p&&`is-telemetry`),children:[(0,Y.jsx)(d,{"aria-hidden":`true`}),g?`RECONNECT`:p?`TOOLS LIVE`:`READY`]})]})]}),(0,Y.jsxs)(`fieldset`,{className:`agent-office__client-stats`,"aria-label":`Session activity totals`,children:[(0,Y.jsxs)(`span`,{title:`Unique files touched`,children:[(0,Y.jsx)(x,{}),` `,(0,Y.jsx)(`strong`,{children:o.files}),` FILES`]}),(0,Y.jsxs)(`span`,{title:`File reads`,children:[(0,Y.jsx)(O,{}),` `,(0,Y.jsx)(`strong`,{children:o.reads}),` READ`]}),(0,Y.jsxs)(`span`,{title:`Files written`,children:[(0,Y.jsx)(n,{}),` `,(0,Y.jsx)(`strong`,{children:o.writes}),` WRITE`]}),(0,Y.jsxs)(`span`,{title:`Files edited`,children:[(0,Y.jsx)(n,{}),` `,(0,Y.jsx)(`strong`,{children:o.edits}),` EDIT`]}),(0,Y.jsxs)(`span`,{className:`agent-office__client-delta`,title:`Lines added and removed`,children:[(0,Y.jsxs)(`strong`,{children:[`+`,o.linesAdded]}),` / `,(0,Y.jsxs)(`b`,{children:[`−`,o.linesRemoved]})]}),(0,Y.jsxs)(`span`,{title:`Terminal commands`,children:[(0,Y.jsx)(y,{}),` `,(0,Y.jsx)(`strong`,{children:o.terminalCalls}),` TERM`]}),(0,Y.jsxs)(`span`,{title:`Incoming and outgoing mail`,children:[(0,Y.jsx)(h,{}),` `,(0,Y.jsx)(`strong`,{children:o.incomingMail}),`↓ `,(0,Y.jsx)(`strong`,{children:o.outgoingMail}),`↑`]})]})]})}function Zt({office:e,now:t,onSelect:n}){let{t:r}=m(),{client:i}=e,a=i.todos!==void 0,o=i.todos??[],s=o.filter(e=>e.status!==`completed`),c=o.length-s.length,l=!!i.activeInstruction,u=i.activeInstruction??i.latestPrompt,f=i.latestPromptAt!==void 0&&t-i.latestPromptAt<3e4,p=()=>n({kind:`briefing`,officeLabel:i.label,prompt:u,promptAt:i.latestPromptAt,instructionActive:l,telemetryConnected:a,todos:o});return(0,Y.jsxs)(`section`,{className:`agent-office__briefing`,"aria-label":r(`activity:agentOffice.officeBriefing`),children:[(0,Y.jsxs)(`button`,{type:`button`,className:H(`agent-office__prompt-card`,l&&`is-active`,f&&`is-fresh`,!a&&`is-waiting`),onClick:p,children:[(0,Y.jsx)(`span`,{className:`agent-office__briefing-icon is-prompt`,children:(0,Y.jsx)(C,{"aria-hidden":`true`})}),(0,Y.jsxs)(`span`,{className:`agent-office__briefing-copy`,children:[(0,Y.jsx)(`span`,{children:r(l?`activity:agentOffice.activeInstruction`:`activity:agentOffice.leaderPrompt`)}),(0,Y.jsx)(`strong`,{children:u??r(a?`activity:agentOffice.noPrompt`:`activity:agentOffice.telemetryWaiting`)})]}),l&&(0,Y.jsxs)(`span`,{className:`agent-office__instruction-live`,children:[(0,Y.jsx)(`i`,{"aria-hidden":`true`}),` LIVE`]}),i.latestPromptAt!==void 0&&(0,Y.jsx)(`time`,{dateTime:new Date(i.latestPromptAt).toISOString(),children:Bt(i.latestPromptAt,t)})]}),(0,Y.jsxs)(`button`,{type:`button`,className:H(`agent-office__todo-board`,s.length>0&&`has-active`,!a&&`is-waiting`),onClick:p,children:[(0,Y.jsxs)(`span`,{className:`agent-office__todo-heading`,children:[(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(fe,{"aria-hidden":`true`}),` `,r(`activity:agentOffice.activeTodos`)]}),(0,Y.jsx)(`strong`,{children:a?r(`activity:agentOffice.todoProgress`,{done:c,total:o.length}):r(`activity:agentOffice.syncWaiting`)})]}),(0,Y.jsxs)(`span`,{className:`agent-office__todo-preview`,children:[a?s.length>0?s.slice(0,3).map(e=>(0,Y.jsxs)(`span`,{className:H(`agent-office__todo-line`,`is-${e.status}`),children:[(0,Y.jsx)(`i`,{"aria-hidden":`true`}),(0,Y.jsx)(`span`,{children:e.activeForm||e.content})]},e.id)):(0,Y.jsxs)(`span`,{className:`agent-office__todo-empty`,children:[(0,Y.jsx)(b,{"aria-hidden":`true`}),o.length>0?r(`activity:agentOffice.allTodosDone`):r(`activity:agentOffice.noActiveTodos`)]}):(0,Y.jsxs)(`span`,{className:`agent-office__todo-empty is-waiting`,children:[(0,Y.jsx)(d,{"aria-hidden":`true`}),r(`activity:agentOffice.todoTelemetryWaiting`)]}),s.length>3&&(0,Y.jsx)(`span`,{className:`agent-office__todo-more`,children:r(`activity:agentOffice.moreTodos`,{count:s.length-3})})]})]})]})}function Qt({active:e}){let{t}=m();return(0,Y.jsxs)(`div`,{className:`agent-office__parcel agent-office__parcel--empty`,children:[(0,Y.jsx)(`span`,{className:`agent-office__tool-glyph`,children:(0,Y.jsx)(I,{"aria-hidden":`true`})}),(0,Y.jsxs)(`span`,{className:`agent-office__parcel-copy`,children:[(0,Y.jsx)(`strong`,{children:t(e?`activity:agentOffice.thinking`:`activity:agentOffice.waiting`)}),(0,Y.jsx)(`span`,{children:t(e?`activity:agentOffice.preparing`:`activity:agentOffice.deskReady`)})]})]})}function $t({model:e,now:n,onSelect:r,routedMailIds:i}){let{t:o}=m(),{agent:s,client:c,current:l,display:u,history:f,mail:p}=e,g=s.status===`active`||s.status===`streaming`,_=s.status===`error`,v=p[0],y=It(s),b=Lt(`${c.sessionId}:${s.serverId}:${s.name}`,y),x=v&&n-v.timestampMs<3e4&&!i?.has(v.id),S=f.slice(0,6),C=S[0]?.completedAt??S[0]?.startedAt??u?.completedAt??u?.startedAt,w=l?`is-tool-${l.kind}`:void 0;return(0,Y.jsxs)(`article`,{className:H(`agent-office__lane`,`is-desk-${b.palette}`,`is-layout-${b.layout}`,`is-clutter-${b.clutter}`,g&&`is-active`,_&&`is-failed`),children:[(0,Y.jsxs)(`div`,{className:`agent-office__identity`,children:[(0,Y.jsxs)(`div`,{className:`agent-office__identity-line`,children:[(0,Y.jsx)(`span`,{className:H(`agent-office__status-dot`,g&&`is-active`,_&&`is-failed`)}),(0,Y.jsx)(`strong`,{title:s.name,children:s.name}),(0,Y.jsxs)(`span`,{className:`agent-office__agent-verified`,title:s.presenceSource===`registry`?`Verified by live session registry`:`Verified by local fleet state`,children:[(0,Y.jsx)(t,{"aria-hidden":`true`}),s.presenceSource===`registry`?`LIVE`:`LOCAL`]})]}),(0,Y.jsx)(`span`,{className:`agent-office__role`,children:s.role??(s.serverId===`leader`||s.serverId.startsWith(`leader@`)?o(`activity:agentOffice.leadAgent`):o(`activity:agentOffice.agent`))}),(0,Y.jsxs)(`div`,{className:`agent-office__agent-meta`,children:[(0,Y.jsx)(`span`,{children:c.branch?`⎇ ${c.branch}`:c.type.toUpperCase()}),(0,Y.jsx)(`span`,{children:o(`activity:agentOffice.callsCount`,{count:s.toolCalls})}),s.model&&(0,Y.jsx)(`span`,{className:`agent-office__model-chip`,title:s.model,children:Rt(s.model)})]}),s.currentTask&&(0,Y.jsxs)(`button`,{type:`button`,className:`agent-office__agent-task`,onClick:()=>r({kind:`task`,task:s.currentTask??``,taskId:s.taskId,agentName:s.name}),children:[(0,Y.jsx)(fe,{"aria-hidden":`true`}),(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(`strong`,{children:o(`activity:agentOffice.currentTask`)}),(0,Y.jsx)(`small`,{children:s.currentTask})]})]}),!s.currentTask&&g&&(0,Y.jsxs)(`div`,{className:`agent-office__agent-task is-missing`,children:[(0,Y.jsx)(d,{"aria-hidden":`true`}),(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(`strong`,{children:o(`activity:agentOffice.currentTask`)}),(0,Y.jsx)(`small`,{children:c.todos===void 0?o(`activity:agentOffice.telemetryWaiting`):o(`activity:agentOffice.taskNotReported`)})]})]}),v&&(0,Y.jsxs)(`button`,{type:`button`,className:H(`agent-office__identity-mail`,v.unread&&`is-unread`),onClick:()=>r({kind:`mail`,mail:v,agentName:s.name}),"aria-label":`${p.length} mail messages. Latest: ${v.subject}`,children:[(0,Y.jsx)(h,{"aria-hidden":`true`}),(0,Y.jsxs)(`span`,{children:[(0,Y.jsxs)(`strong`,{children:[p.length,` MAIL`]}),(0,Y.jsx)(`small`,{children:v.subject})]})]})]}),(0,Y.jsxs)(`div`,{className:H(`agent-office__scene`,w),children:[(0,Y.jsxs)(`div`,{className:`agent-office__window`,"aria-hidden":`true`,children:[(0,Y.jsx)(`span`,{}),(0,Y.jsx)(`span`,{}),(0,Y.jsx)(`span`,{})]}),(0,Y.jsxs)(`div`,{className:`agent-office__plant`,"aria-hidden":`true`,children:[(0,Y.jsx)(`span`,{}),(0,Y.jsx)(`i`,{}),(0,Y.jsx)(`b`,{})]}),(0,Y.jsxs)(`div`,{className:`agent-office__desk-zone`,"aria-hidden":`true`,children:[(0,Y.jsx)(qt,{active:g,failed:_,role:y,variant:b.avatar,motion:b.motion}),(0,Y.jsx)(`span`,{className:`agent-office__monitor`,children:u?(0,Y.jsx)(Kt,{kind:u.kind,active:l!==void 0}):(0,Y.jsx)(a,{})}),(0,Y.jsxs)(`span`,{className:`agent-office__activity-fx`,children:[(0,Y.jsx)(`span`,{}),(0,Y.jsx)(`i`,{}),(0,Y.jsx)(`b`,{})]}),(0,Y.jsx)(`span`,{className:`agent-office__desk`}),(0,Y.jsx)(`span`,{className:`agent-office__desk-lamp`}),(0,Y.jsxs)(`span`,{className:`agent-office__desk-clutter`,children:[(0,Y.jsx)(`i`,{}),(0,Y.jsx)(`b`,{})]}),(0,Y.jsxs)(`span`,{className:H(`agent-office__desk-charm`,`is-${b.charm}`),children:[(0,Y.jsx)(`i`,{}),(0,Y.jsx)(`b`,{})]}),(0,Y.jsxs)(`span`,{className:H(`agent-office__mug`,`is-${y}`),children:[(0,Y.jsx)(`i`,{"aria-hidden":`true`}),(0,Y.jsx)(`b`,{"aria-hidden":`true`})]})]}),x&&(0,Y.jsx)(`div`,{className:H(`agent-office__mail-flyby`,`is-${v.direction}`),children:(0,Y.jsx)(Yt,{mail:v,compact:!0,onSelect:()=>r({kind:`mail`,mail:v,agentName:s.name})},v.id)}),(0,Y.jsxs)(`div`,{className:H(`agent-office__conveyor`,l&&`is-moving`),children:[(0,Y.jsxs)(`div`,{className:`agent-office__belt`,"aria-hidden":`true`,children:[(0,Y.jsx)(`span`,{}),(0,Y.jsx)(`span`,{}),(0,Y.jsx)(`span`,{}),(0,Y.jsx)(`span`,{}),(0,Y.jsx)(`span`,{}),(0,Y.jsx)(`span`,{})]}),(0,Y.jsx)(`div`,{className:`agent-office__current-action`,children:u?(0,Y.jsx)(Jt,{call:u,onSelect:()=>r({kind:`tool`,call:u,agentName:s.name})},u.id):(0,Y.jsx)(Qt,{active:g})})]})]}),(0,Y.jsxs)(`div`,{className:`agent-office__history`,children:[(0,Y.jsxs)(`div`,{className:`agent-office__history-heading`,children:[(0,Y.jsx)(`span`,{children:o(`activity:agentOffice.recent`)}),C!==void 0&&(0,Y.jsx)(`span`,{children:Bt(C,n)})]}),(0,Y.jsx)(`div`,{className:`agent-office__history-list`,children:S.length>0?S.map(e=>(0,Y.jsx)(Jt,{call:e,compact:!0,onSelect:()=>r({kind:`tool`,call:e,agentName:s.name})},`tool:${e.id}`)):(0,Y.jsx)(`span`,{className:`agent-office__history-empty`,children:s.toolCalls>0&&s.recentTools===void 0&&s.activity===void 0?o(`activity:agentOffice.telemetryReconnect`):o(`activity:agentOffice.noCalls`)})})]})]})}function en(e){return e.agent.status===`active`||e.agent.status===`streaming`||e.agent.status===`error`}function tn({agents:e,now:t,onSelect:n}){let{t:r}=m();return(0,Y.jsxs)(`section`,{className:`agent-office__lounge`,"aria-label":r(`activity:agentOffice.breakRoom`),children:[(0,Y.jsxs)(`header`,{className:`agent-office__lounge-heading`,children:[(0,Y.jsx)(f,{"aria-hidden":`true`}),(0,Y.jsx)(`strong`,{children:r(`activity:agentOffice.breakRoom`)}),(0,Y.jsx)(`span`,{children:r(`activity:agentOffice.onBreak`,{count:e.length})})]}),(0,Y.jsx)(`div`,{className:`agent-office__lounge-seats`,children:e.map(e=>{let{agent:i,history:a,mail:o}=e,s=It(i),c=Ft[s],l=o.filter(e=>e.unread).length,u=a[0]?.completedAt??a[0]?.startedAt,d=o[0],f=()=>{i.currentTask?n({kind:`task`,task:i.currentTask,taskId:i.taskId,agentName:i.name}):d&&n({kind:`mail`,mail:d,agentName:i.name})},p=!!i.currentTask||!!d;return(0,Y.jsxs)(`button`,{type:`button`,className:H(`agent-office__lounge-seat`,`is-${s}`),onClick:f,disabled:!p,children:[(0,Y.jsx)(`span`,{className:`agent-office__lounge-avatar`,children:(0,Y.jsx)(c,{"aria-hidden":`true`})}),(0,Y.jsxs)(`span`,{className:`agent-office__lounge-copy`,children:[(0,Y.jsx)(`strong`,{children:i.name}),(0,Y.jsx)(`small`,{children:i.role??r(`activity:agentOffice.agent`)})]}),(0,Y.jsxs)(`span`,{className:`agent-office__lounge-meta`,children:[u!==void 0&&(0,Y.jsx)(`span`,{children:Bt(u,t)}),l>0&&(0,Y.jsxs)(`span`,{className:`agent-office__lounge-mail`,children:[(0,Y.jsx)(h,{"aria-hidden":`true`}),` `,l]})]})]},e.key)})})]})}function nn(){let{t:e}=m(),t=we(e=>e.liveSessions),n=we(e=>e.aggregate),r=Ce(e=>e.agents),i=Ee(e=>e.agents),a=Ee(e=>e.messages),o=xe(e=>e.toolEvents),s=Se(e=>e.projectName),c=At(r),[l,u]=(0,W.useState)(null),g=(0,W.useMemo)(()=>Dt(t,r,i,c.map,c.now),[t,r,i,c]),_=(0,W.useMemo)(()=>g.flatMap(e=>e.agents.map(t=>{let n=Wt(tt(o,t.serverId,e.sessionId),Xe(t.recentTools,t.serverId,e.sessionId),Ut(t,e,r.get(t.serverId)?.toolLog??[])),i=t.status===`active`||t.status===`streaming`,s=n.find(e=>e.status===`running`);!s&&i&&t.currentTool&&(s=nt(t.serverId,t.currentTool,e.sessionId));let c=s??n[0],l=n.filter(e=>e.status!==`running`).slice(0,6),u=Gt(Ze(t.recentMail),et(a,t,e.sessionId));return{key:t.officeId,client:e,agent:t,calls:n,current:s,display:c,history:l,mail:u}})),[g,r,a,o]),v=(0,W.useMemo)(()=>g.map(e=>{let t=_.filter(t=>t.client.id===e.id);return{client:e,agents:t,stats:Ht(t)}}).filter(e=>e.agents.length>0),[g,_]),y=_.filter(({agent:e})=>e.status===`active`||e.status===`streaming`).length,b=s||t.find(e=>e.projectName)?.projectName||e(`activity:office.fleetHq`),x=Date.now();return(0,Y.jsxs)(`div`,{className:`agent-office`,children:[(0,Y.jsxs)(`header`,{className:`agent-office__header`,children:[(0,Y.jsxs)(`div`,{className:`agent-office__title`,children:[(0,Y.jsx)(`span`,{className:`agent-office__brand-mark`,children:(0,Y.jsx)(re,{"aria-hidden":`true`})}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`span`,{children:e(`activity:agentOffice.liveProjectOffice`)}),(0,Y.jsx)(`h1`,{children:b})]})]}),(0,Y.jsxs)(`div`,{className:`agent-office__live-pill`,children:[(0,Y.jsx)(`span`,{}),` LIVE`]}),(0,Y.jsxs)(`div`,{className:`agent-office__summary`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(I,{}),(0,Y.jsx)(`strong`,{children:_.length}),(0,Y.jsx)(`span`,{children:e(`activity:agentOffice.agents`)})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(he,{}),(0,Y.jsx)(`strong`,{children:y}),(0,Y.jsx)(`span`,{children:e(`activity:agentOffice.working`)})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(d,{}),(0,Y.jsx)(`strong`,{children:n.toolCalls.toLocaleString()}),(0,Y.jsx)(`span`,{children:e(`activity:agentOffice.toolCalls`)})]})]})]}),(0,Y.jsx)(`main`,{className:`agent-office__floor`,children:_.length>0?v.map(t=>{let n=t.agents.filter(en),r=t.agents.filter(e=>!en(e)),i=Qe(n,x),a=new Set(i.map(e=>e.id));return(0,Y.jsxs)(`section`,{className:`agent-office__client-office`,children:[(0,Y.jsx)(Xt,{office:t,now:x}),(0,Y.jsx)(Zt,{office:t,now:x,onSelect:u}),n.length>0&&(0,Y.jsxs)(`div`,{className:`agent-office__column-headings`,"aria-hidden":`true`,children:[(0,Y.jsx)(`span`,{children:e(`activity:agentOffice.team`)}),(0,Y.jsx)(`span`,{children:e(`activity:agentOffice.liveDesk`)}),(0,Y.jsx)(`span`,{children:e(`activity:agentOffice.lastActions`)})]}),(0,Y.jsxs)(`div`,{className:`agent-office__client-desks`,children:[n.map(e=>(0,Y.jsx)($t,{model:e,now:x,onSelect:u,routedMailIds:a},e.key)),i.length>0&&(0,Y.jsx)(`div`,{className:`agent-office__mail-routes`,"aria-hidden":`true`,children:i.map(e=>(0,Y.jsx)(`div`,{className:`agent-office__mail-route`,style:{"--from":`${(e.fromIndex+.5)/n.length*100}%`,"--to":`${(e.toIndex+.5)/n.length*100}%`},children:(0,Y.jsx)(`span`,{className:`agent-office__mail-route-parcel`,children:(0,Y.jsx)(h,{"aria-hidden":`true`})})},e.id))}),n.length===0&&(0,Y.jsxs)(`div`,{className:`agent-office__desks-empty`,children:[(0,Y.jsx)(f,{"aria-hidden":`true`}),e(`activity:agentOffice.desksEmpty`)]})]}),r.length>0&&(0,Y.jsx)(tn,{agents:r,now:x,onSelect:u})]},t.client.id)}):(0,Y.jsxs)(`div`,{className:`agent-office__empty-state`,children:[(0,Y.jsx)(`span`,{children:(0,Y.jsx)(L,{"aria-hidden":`true`})}),(0,Y.jsx)(`h2`,{children:e(`activity:agentOffice.readyTitle`)}),(0,Y.jsx)(`p`,{children:e(`activity:agentOffice.readyBody`)})]})}),(0,Y.jsxs)(`footer`,{className:`agent-office__footer`,children:[(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(`span`,{className:`agent-office__status-dot is-active`}),` `,e(`activity:agentOffice.liveEvent`)]}),(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(p,{}),` `,e(`activity:agentOffice.connectedSessions`,{count:t.length})]}),(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(ae,{}),` `,e(`activity:agentOffice.detailHint`)]})]}),l&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`button`,{type:`button`,className:`agent-office__detail-backdrop`,onClick:()=>u(null),"aria-label":`Close tool details`}),(0,Y.jsx)(dt,{selected:l,onClose:()=>u(null)})]})]})}function rn(){let{t:e}=m(),{clientCounts:t,currentSession:n,totalAgents:r,activeAgents:i,aggregate:a}=we(ie(e=>({clientCounts:e.clientCounts,currentSession:e.currentSession,totalAgents:e.totalAgents,activeAgents:e.activeAgents,aggregate:e.aggregate}))),s=t.tui+t.webui+t.repl,c=e=>e?.toLocaleString()??`0`;return(0,Y.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,Y.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,Y.jsx)(d,{className:`h-3.5 w-3.5 text-success`}),(0,Y.jsx)(`span`,{className:`text-[10px] font-bold uppercase text-muted-foreground`,children:e(`activity:office.sessionStats`)})]}),(0,Y.jsxs)(`div`,{className:`space-y-1.5 text-[10px]`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(ye,{className:`h-3 w-3 text-muted-foreground`}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.clients`)})]}),(0,Y.jsxs)(`span`,{className:`font-mono text-foreground`,children:[i,` `,(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`/`}),` `,(0,Y.jsx)(`span`,{className:`text-success`,children:s})]})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-3 pl-4 text-[9px]`,children:[t.tui>0&&(0,Y.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(u,{className:`h-2.5 w-2.5 text-success`}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`TUI`}),(0,Y.jsx)(`span`,{className:`font-mono text-success`,children:t.tui})]}),t.webui>0&&(0,Y.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(_,{className:`h-2.5 w-2.5 text-primary`}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`WebUI`}),(0,Y.jsx)(`span`,{className:`font-mono text-primary`,children:t.webui})]}),t.repl>0&&(0,Y.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Y.jsx)(u,{className:`h-2.5 w-2.5 text-warning`}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`REPL`}),(0,Y.jsx)(`span`,{className:`font-mono text-warning`,children:t.repl})]})]}),(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(I,{className:`h-3 w-3 text-muted-foreground`}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:officeMap.agents`)})]}),(0,Y.jsxs)(`span`,{className:`font-mono text-foreground`,children:[i,` `,(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`/`}),` `,(0,Y.jsx)(`span`,{className:`text-primary`,children:r})]})]}),n.model&&(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(k,{className:`h-3 w-3 text-muted-foreground`}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:officeMap.model`)})]}),(0,Y.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,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(he,{className:`h-3 w-3 text-muted-foreground`}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:officeMap.mode`)})]}),(0,Y.jsx)(`span`,{className:H(`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,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(o,{className:`h-3 w-3 text-muted-foreground`}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.toolCallsLabel`)})]}),(0,Y.jsx)(`span`,{className:`font-mono text-warning`,children:c(a.toolCalls)})]}),(0,Y.jsxs)(`div`,{className:`mt-1.5 space-y-1 border-t border-border/70 pt-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`text-[8px] text-muted-foreground`,children:`IN`}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.input`)})]}),(0,Y.jsx)(`span`,{className:`font-mono text-[9px] text-foreground`,children:c(a.tokensIn)})]}),(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`text-[8px] text-muted-foreground`,children:`OUT`}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.output`)})]}),(0,Y.jsx)(`span`,{className:`font-mono text-[9px] text-foreground`,children:c(a.tokensOut)})]})]}),(0,Y.jsxs)(`div`,{className:`mt-1.5 flex items-center justify-between gap-4 border-t border-border/70 pt-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,Y.jsx)(E,{className:`h-3 w-3 text-muted-foreground`}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.cost`)})]}),(0,Y.jsx)(`span`,{className:`font-mono font-medium text-success`,children:(e=>e==null?`$0.0000`:`$${e.toFixed(4)}`)(a.costUsd)})]})]})]})}function an({events:e,now:t}){let{t:n}=m(),r=e.slice(0,14);return(0,Y.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 z-10 pointer-events-none px-3 pb-3`,children:(0,Y.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,Y.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-1.5 text-[10px] uppercase text-primary`,children:[(0,Y.jsx)(d,{className:`h-3 w-3`}),n(`activity:office.liveActivity`)]}),r.length===0?(0,Y.jsx)(`div`,{className:`text-[11px] italic text-muted-foreground`,children:n(`activity:office.waitingActivity`)}):(0,Y.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,Y.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] leading-tight`,children:[(0,Y.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full shrink-0`,style:{backgroundColor:Ot(e.kind)}}),(0,Y.jsx)(`span`,{className:`flex-1 truncate text-foreground`,children:e.label}),(0,Y.jsx)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:r<1?n(`activity:office.now`):`${r}s`})]},e.id)})})]})})}function on(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 sn={user:{Icon:ve,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-transparent`,bubbleBorder:`border-primary/40`,textColor:`text-foreground`},assistant:{Icon:I,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:u,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:I,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:c,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 cn({entry:e}){let{t}=m();return e.role===`error`?(0,Y.jsx)(ke,{text:e.text}):e.role===`tool`?(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5 tool-details`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5 text-sm font-medium text-foreground`,children:[(0,Y.jsx)(u,{className:`h-3 w-3`}),(0,Y.jsx)(`span`,{className:`font-mono`,children:e.tool??t(`activity:watch.toolFallback`)}),e.durationMs!==void 0&&(0,Y.jsxs)(`span`,{className:`ml-auto text-[10px] text-muted-foreground font-normal tabular-nums`,children:[(0,Y.jsx)(r,{className:`h-3 w-3 inline mr-0.5 align-text-bottom`}),on(e.durationMs)]})]}),e.input!==void 0&&e.input!==null&&(0,Y.jsx)(`div`,{className:`p-3 bg-muted/50 rounded-lg overflow-x-auto`,children:(0,Y.jsx)(Me,{input:e.input})}),e.output!==void 0&&e.output!==null?(0,Y.jsx)(`div`,{className:`text-sm leading-relaxed markdown-content`,children:typeof e.output==`string`?(0,Y.jsx)(Ne,{remarkPlugins:[De],rehypePlugins:Oe,components:je,children:e.output}):(0,Y.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,Y.jsx)(`div`,{className:`text-sm leading-relaxed markdown-content`,children:(0,Y.jsx)(Ne,{remarkPlugins:[De],rehypePlugins:Oe,components:je,children:e.text})}):null,e.isError&&(0,Y.jsxs)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2`,children:[(0,Y.jsx)(`span`,{className:`text-xs font-medium text-destructive`,children:t(`activity:watch.toolFailed`)}),e.text&&(0,Y.jsx)(`pre`,{className:`mt-1 text-xs whitespace-pre-wrap text-destructive/80`,children:e.text})]})]}):(0,Y.jsx)(`div`,{className:`text-sm leading-relaxed markdown-content`,children:(0,Y.jsx)(Ne,{remarkPlugins:[De],rehypePlugins:Oe,components:je,children:e.text})})}function ln({entry:e,isContinuation:t=!1}){let{t:n}=m(),r=sn[e.role],i=r.Icon;return(0,Y.jsxs)(`div`,{className:`group flex gap-3 animate-message msg-bubble rounded-lg transition-shadow`,children:[t?(0,Y.jsx)(`div`,{className:`flex-shrink-0 w-8`}):(0,Y.jsx)(`div`,{className:H(`flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center`,r.avatarBg,r.avatarColor,r.avatarRing),children:(0,Y.jsx)(i,{className:`h-4 w-4`})}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5 min-w-0 flex-1`,children:[!t&&(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:H(`text-xs font-medium`,r.textColor),children:e.role===`tool`&&e.tool?e.tool:n(r.labelKey)}),(0,Y.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,Y.jsxs)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:[`· `,on(e.durationMs)]})]}),(0,Y.jsx)(`div`,{className:H(`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,Y.jsx)(`div`,{className:H(`text-sm leading-relaxed markdown-content`,r.textColor),children:(0,Y.jsx)(cn,{entry:e})})}),e.text&&e.role!==`error`&&(0,Y.jsx)(`div`,{className:`opacity-0 group-hover:opacity-100 transition-opacity`,children:(0,Y.jsx)(Ae,{text:e.text,label:n(`common:action.copy`)})})]})]})}var un=[`steer`,`ask`,`assign`,`note`],dn=2500;function fn({sessionId:e,limit:t=200}){let[n,r]=(0,W.useState)(null),{t:i}=m(),[a,o]=(0,W.useState)(null),[s,c]=(0,W.useState)(``),[u,d]=(0,W.useState)(!1),[f,p]=(0,W.useState)(null),[h,g]=(0,W.useState)(`steer`),[_,v]=(0,W.useState)(`high`),[y,b]=(0,W.useState)([]),[x,S]=(0,W.useState)(!1),C=(0,W.useRef)(null),w=(0,W.useRef)(!0),T=(0,W.useRef)(!0),E=we(e=>e.liveSessions),D=(0,W.useMemo)(()=>E.find(t=>t.sessionId===e),[E,e]),O=(0,W.useMemo)(()=>{let e=D;return e?`${e.status}|${e.agents.map(e=>`${e.id}:${e.status}:${e.toolCalls??0}:${e.iterations??0}`).join(`,`)}`:``},[D]),k=D?.status===`active`||(D?.agents.some(e=>e.status===`running`||e.status===`streaming`)??!1),A=(0,W.useMemo)(()=>{if(!D)return null;let e=D.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},[D,i]),ee=(0,W.useMemo)(()=>{if(!D)return null;let e=D.agents.find(e=>e.partialText&&(e.status===`streaming`||e.status===`running`))??D.agents.find(e=>e.partialText);return e?.partialText?{label:e.id===`leader`?i(`activity:sessionWatch.claude`):e.name||e.id,text:e.partialText}:null},[D,i]),j=(0,W.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();T.current&&(r(i),o(null))}catch(e){T.current&&o(e instanceof Error?e.message:String(e))}},[e,t]),M=(0,W.useCallback)(async()=>{try{let t=await fetch(`/api/sessions/${encodeURIComponent(e)}/mailbox`);if(!t.ok)return;let n=await t.json();T.current&&Array.isArray(n.thread)&&b(n.thread)}catch{}},[e]);(0,W.useEffect)(()=>{T.current=!0,r(null),o(null),b([]),j(),M();let e=setInterval(()=>{document.hidden||(j(),M())},dn);return()=>{T.current=!1,clearInterval(e)}},[j,M]),(0,W.useEffect)(()=>{O&&j()},[O,j]),(0,W.useEffect)(()=>{w.current&&C.current&&(C.current.scrollTop=C.current.scrollHeight)},[n,ee]);let te=()=>{let e=C.current;e&&(w.current=e.scrollHeight-e.scrollTop-e.clientHeight<40)},N=async()=>{let t=s.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:h,priority:_})});if(!n.ok)throw Error(`HTTP ${n.status}`);c(``),p(k?l.t(`activity:sessionWatch.sentRunning`):l.t(`activity:sessionWatch.sentIdle`)),M()}catch(e){p(l.t(`activity:sessionWatch.sentFailed`,{error:e instanceof Error?e.message:String(e)}))}finally{d(!1)}}},ne=async()=>{if(!x){S(!0),p(null);try{let t=await fetch(`/api/sessions/${encodeURIComponent(e)}/interrupt`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({reason:l.t(`activity:sessionWatch.interruptReason`)})});if(!t.ok)throw Error(`HTTP ${t.status}`);p(l.t(`activity:sessionWatch.interruptSent`)),M()}catch(e){p(l.t(`activity:sessionWatch.interruptFailed`,{error:e instanceof Error?e.message:String(e)}))}finally{S(!1)}}},P=n?.entries??[];return(0,Y.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between mb-1.5 shrink-0`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] uppercase tracking-wide text-muted-foreground`,children:[(0,Y.jsx)(`span`,{className:H(`h-1.5 w-1.5 rounded-full`,k?`bg-success animate-pulse`:`bg-muted-foreground`)}),i(`activity:sessionWatch.liveStream`)]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n&&(0,Y.jsxs)(`div`,{className:`text-[10px] text-muted-foreground`,children:[i(`activity:sessionWatch.events`,{count:n.total}),` · `,n.status]}),k&&(0,Y.jsx)(`button`,{type:`button`,onClick:()=>void ne(),disabled:x,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(x?`activity:sessionWatch.interrupting`:`activity:sessionWatch.interrupt`)})]})]}),A&&(0,Y.jsxs)(`div`,{className:`mb-1.5 shrink-0 text-[10px] text-foreground truncate`,children:[`▶ `,A]}),a&&(0,Y.jsxs)(`div`,{className:`text-[11px] text-destructive mb-1 shrink-0`,children:[`· `,a]}),(0,Y.jsxs)(`div`,{ref:C,onScroll:te,className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain space-y-1.5 pr-1`,children:[P.length===0&&!a&&(0,Y.jsx)(`div`,{className:`text-[11px] text-muted-foreground italic`,children:i(`activity:sessionWatch.loading`)}),P.map((e,t)=>(0,Y.jsx)(ln,{entry:e,isContinuation:t>0&&P[t-1].role===e.role},`${e.ts}-${t}`)),ee&&(0,Y.jsxs)(`div`,{className:`flex gap-3 animate-message`,children:[(0,Y.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,Y.jsx)(I,{className:`h-4 w-4 animate-pulse`})}),(0,Y.jsxs)(`div`,{className:`flex flex-col gap-1.5 max-w-[85%] min-w-0`,children:[(0,Y.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground px-1`,children:ee.label}),(0,Y.jsx)(`div`,{className:`rounded-2xl rounded-bl-md px-4 py-3 bg-card border border-border`,children:(0,Y.jsxs)(`span`,{className:`text-sm leading-relaxed text-foreground whitespace-pre-wrap break-words`,children:[ee.text,(0,Y.jsx)(`span`,{className:`animate-pulse text-primary`,children:`▋`})]})})]})]})]}),y.length>0&&(0,Y.jsxs)(`div`,{className:`mt-2 pt-2 border-t border-border shrink-0 max-h-28 overflow-y-auto space-y-1`,children:[(0,Y.jsx)(`div`,{className:`text-[9px] uppercase tracking-wide text-muted-foreground`,children:i(`activity:mailbox.messages`)}),y.slice(-6).map(e=>{let t=e.completed?i(`activity:sessionWatch.done`):e.readByLeader?i(`activity:sessionWatch.read`):i(`activity:sessionWatch.delivered`);return(0,Y.jsxs)(`div`,{className:`text-[10px] leading-snug`,children:[(0,Y.jsx)(`span`,{className:H(`font-semibold mr-1.5`,e.fromLeader?`text-accent`:`text-primary`),children:e.fromLeader?i(`activity:sessionWatch.agent`):i(`activity:sessionWatch.you`)}),(0,Y.jsx)(`span`,{className:`text-foreground whitespace-pre-wrap break-words`,children:e.body}),!e.fromLeader&&(0,Y.jsx)(`span`,{className:H(`ml-1.5 text-[9px]`,e.completed?`text-success`:e.readByLeader?`text-primary`:`text-muted-foreground`),children:t})]},e.id)})]}),(0,Y.jsxs)(`div`,{className:`mt-2 pt-2 border-t border-border shrink-0`,children:[(0,Y.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5`,children:[(0,Y.jsx)(`select`,{value:h,onChange:e=>g(e.target.value),title:i(`activity:sessionWatch.msgType.${h}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:un.map(e=>(0,Y.jsx)(`option`,{value:e,children:i(`activity:sessionWatch.msgType.${e}Label`)},e))}),(0,Y.jsxs)(`select`,{value:_,onChange:e=>v(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,Y.jsx)(`option`,{value:`high`,children:`high`}),(0,Y.jsx)(`option`,{value:`normal`,children:`normal`}),(0,Y.jsx)(`option`,{value:`low`,children:`low`})]})]}),(0,Y.jsxs)(`div`,{className:`flex items-end gap-1.5`,children:[(0,Y.jsx)(`textarea`,{value:s,onChange:e=>c(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),N())},rows:2,placeholder:i(`activity:sessionWatch.placeholder`,{label:i(`activity:sessionWatch.msgType.${h}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,Y.jsx)(`button`,{type:`button`,onClick:()=>void N(),disabled:u||!s.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,Y.jsx)(`div`,{className:`mt-1 text-[10px] text-muted-foreground`,children:f}),(0,Y.jsx)(`div`,{className:`mt-0.5 text-[9px] text-muted-foreground`,children:i(`activity:sessionWatch.sendHint`)})]})]})}var Z={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))`},pn=.12;function mn(e){return Math.min(100,Math.max(0,e??0))}function hn({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:Z.muted,active:Z.success,streaming:Z.primary,completed:Z.primary,error:Z.destructive,offline:Z.muted};return(0,Y.jsx)(`span`,{className:H(`rounded-full`,r,n>0&&`animate-pulse`,a[e]),style:{boxShadow:n>0?`0 0 ${i}px ${o[e]}`:void 0}})}function Q(){let e={opacity:0,width:1,height:1,minWidth:0,border:`none`,background:`transparent`};return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(R,{type:`target`,position:T.Top,style:e,isConnectable:!1}),(0,Y.jsx)(R,{type:`source`,position:T.Bottom,style:e,isConnectable:!1})]})}function gn({data:e}){let{t}=m();return(0,Y.jsxs)(`div`,{className:`mt-2 flex items-center justify-between border-t border-border/60 pt-1.5 text-[10px] text-muted-foreground`,children:[(0,Y.jsxs)(`span`,{children:[(0,Y.jsx)(`span`,{className:`font-mono text-foreground`,children:e.agentCount??0}),` `,t(`activity:office.agentsSuffix`)]}),e.startedAt&&(0,Y.jsx)(`span`,{children:t(`activity:office.upPrefix`,{time:mt(e.startedAt,Date.now())})})]})}function _n({data:e}){let{t}=m(),n=e.status===`active`||e.status===`streaming`,r=e.status===`error`,i=e.status===`offline`,a=e.color||Z.info;return(0,Y.jsxs)(`div`,{className:H(`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`,i&&`border-border/70 bg-muted/35 opacity-60`,!n&&!r&&!i&&`border-primary/30 bg-primary/10`),children:[(0,Y.jsx)(Q,{}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-3 mb-3`,children:[(0,Y.jsx)(`div`,{className:H(`flex items-center justify-center w-10 h-10 rounded-lg`,n?`bg-primary/15`:`bg-primary/10`),children:(0,Y.jsx)(_,{className:`h-5 w-5`,style:{color:a}})}),(0,Y.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,Y.jsx)(`div`,{className:`text-xs font-bold truncate`,style:{color:a},children:e.label}),(0,Y.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:t(`activity:office.webuiClient`)})]}),(0,Y.jsx)(hn,{status:e.status,activity:e.vizActivity??0})]}),e.sublabel&&(0,Y.jsx)(`div`,{className:`mb-2 truncate text-[10px] text-muted-foreground`,children:e.sublabel}),(0,Y.jsx)(`div`,{className:`flex items-center gap-2 text-[10px] text-muted-foreground`,children:i?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(le,{className:`h-3 w-3 text-muted-foreground`}),(0,Y.jsx)(`span`,{children:t(`activity:office.disconnected`)})]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(L,{className:`h-3 w-3 text-success`}),(0,Y.jsx)(`span`,{children:t(`activity:office.connected`)})]})}),n&&(0,Y.jsx)(`div`,{className:`mt-2 h-1 overflow-hidden rounded-full bg-primary/20`,children:(0,Y.jsx)(`div`,{className:`h-full animate-pulse bg-primary`,style:{width:`60%`}})}),(0,Y.jsx)(gn,{data:e})]})}function vn({data:e}){let{t}=m(),n=e.status===`active`||e.status===`streaming`,r=e.status===`error`,i=e.color||Z.success;return(0,Y.jsxs)(`div`,{className:H(`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,Y.jsx)(Q,{}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-3 mb-3`,children:[(0,Y.jsx)(`div`,{className:H(`flex items-center justify-center w-10 h-10 rounded-lg`,n?`bg-success/15`:`bg-success/10`),children:(0,Y.jsx)(u,{className:`h-5 w-5`,style:{color:i}})}),(0,Y.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,Y.jsx)(`div`,{className:`text-xs font-bold truncate`,style:{color:i},children:e.label}),(0,Y.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:t(`activity:office.tuiClient`)})]}),(0,Y.jsx)(hn,{status:e.status,activity:e.vizActivity??0})]}),e.sublabel&&(0,Y.jsx)(`div`,{className:`mb-2 truncate text-[10px] text-muted-foreground`,children:e.sublabel}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-muted-foreground`,children:[(0,Y.jsx)(u,{className:`h-3 w-3 text-success`}),(0,Y.jsx)(`span`,{children:t(`activity:office.terminal`)})]}),(0,Y.jsx)(gn,{data:e})]})}function yn({data:e}){let{t}=m(),n=e.status===`active`||e.status===`streaming`,r=e.color||Z.warning;return(0,Y.jsxs)(`div`,{className:H(`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,Y.jsx)(Q,{}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-3 mb-3`,children:[(0,Y.jsx)(`div`,{className:H(`flex items-center justify-center w-10 h-10 rounded-lg`,n?`bg-warning/15`:`bg-warning/10`),children:(0,Y.jsx)(u,{className:`h-5 w-5`,style:{color:r}})}),(0,Y.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,Y.jsx)(`div`,{className:`text-xs font-bold truncate`,style:{color:r},children:e.label}),(0,Y.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:t(`activity:office.repl`)})]}),(0,Y.jsx)(hn,{status:e.status,activity:e.vizActivity??0})]}),e.sublabel&&(0,Y.jsx)(`div`,{className:`mb-1 truncate text-[10px] text-muted-foreground`,children:e.sublabel}),(0,Y.jsx)(gn,{data:e})]})}function bn({data:e}){let{t}=m(),n=e.status===`active`||e.status===`streaming`,r=e.color||Z.primary;return(0,Y.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,Y.jsx)(Q,{}),(0,Y.jsx)(`div`,{className:`absolute -top-3 left-1/2 -translate-x-1/2 rounded-full bg-primary px-2 py-0.5 text-[11px] font-bold text-primary-foreground`,children:t(`activity:office.coordinator`)}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-3 mb-3 mt-2`,children:[(0,Y.jsx)(`div`,{className:H(`flex items-center justify-center w-12 h-12 rounded-xl`,n?`bg-primary/15`:`bg-primary/10`),children:(0,Y.jsx)(k,{className:`h-6 w-6`,style:{color:r}})}),(0,Y.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,Y.jsx)(`div`,{className:`text-sm font-bold truncate`,style:{color:r},children:e.label}),(0,Y.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:e.sublabel||t(`activity:office.fleetSummary`)})]}),(0,Y.jsx)(hn,{status:e.status,activity:e.vizActivity??0})]}),(0,Y.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-[10px] mb-2`,children:[(0,Y.jsxs)(`div`,{className:`rounded bg-muted/40 p-1.5 text-center`,children:[(0,Y.jsxs)(`div`,{className:`font-mono`,children:[(0,Y.jsx)(`span`,{className:`text-success`,children:e.agentsActive||0}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:` / `}),(0,Y.jsx)(`span`,{className:`text-primary`,children:e.agentsTotal||0})]}),(0,Y.jsx)(`div`,{className:`text-muted-foreground`,children:t(`activity:officeMap.agents`)})]}),(0,Y.jsxs)(`div`,{className:`rounded bg-muted/40 p-1.5 text-center`,children:[(0,Y.jsx)(`div`,{className:`font-mono text-warning`,children:(e.toolCalls||0).toLocaleString()}),(0,Y.jsx)(`div`,{className:`text-muted-foreground`,children:t(`activity:office.toolCallsLabel`)})]}),(0,Y.jsxs)(`div`,{className:`rounded bg-muted/40 p-1.5 text-center`,children:[(0,Y.jsx)(`div`,{className:`font-mono text-foreground`,children:ft(e.tokensIn)}),(0,Y.jsx)(`div`,{className:`text-muted-foreground`,children:t(`activity:office.tokensLabel`)})]}),(0,Y.jsxs)(`div`,{className:`rounded bg-muted/40 p-1.5 text-center`,children:[(0,Y.jsxs)(`div`,{className:`font-mono text-success`,children:[`$`,(e.costUsd||0).toFixed(3)]}),(0,Y.jsx)(`div`,{className:`text-muted-foreground`,children:t(`activity:office.cost`)})]})]}),n&&(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-primary`,children:[(0,Y.jsx)(`span`,{className:`h-2 w-2 animate-pulse rounded-full bg-primary`}),t(`activity:office.coordinatingFleet`)]})]})}function xn({data:e}){let{t}=m(),n=e.status===`active`||e.status===`streaming`,r=e.status===`error`,i=e.status===`completed`,a=e.color||Z.primary,o=mn(e.ctxPct);return(0,Y.jsxs)(`div`,{className:H(`w-[170px] min-w-0 max-w-[170px] overflow-hidden rounded-lg border p-3 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,Y.jsx)(Q,{}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[(0,Y.jsx)(I,{className:`h-4 w-4 shrink-0`,style:{color:a}}),(0,Y.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,Y.jsx)(`div`,{className:`text-[11px] font-bold truncate`,style:{color:a},children:e.label}),e.model&&(0,Y.jsx)(`div`,{className:`truncate text-[10px] text-muted-foreground`,children:ht(e.model)})]}),(0,Y.jsx)(hn,{status:e.status,small:!0,activity:e.vizActivity??0})]}),e.currentTask&&(0,Y.jsxs)(`div`,{className:`mb-1.5 flex min-w-0 items-center gap-1 overflow-hidden text-[11px] text-primary`,children:[(0,Y.jsx)(`span`,{className:H(`h-1.5 w-1.5 shrink-0 rounded-full bg-primary`,n&&`animate-pulse`)}),(0,Y.jsx)(`span`,{className:`min-w-0 truncate font-mono`,title:e.currentTask,children:gt(e.currentTask,72)})]}),(0,Y.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-2 gap-y-0.5 text-[11px] mb-1.5`,children:[(0,Y.jsxs)(`div`,{className:`flex justify-between`,children:[(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`iter`}),(0,Y.jsx)(`span`,{className:`font-mono text-foreground`,children:e.iteration||0})]}),(0,Y.jsxs)(`div`,{className:`flex justify-between`,children:[(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`tools`}),(0,Y.jsx)(`span`,{className:`font-mono text-warning`,children:e.toolCalls||0})]}),(0,Y.jsxs)(`div`,{className:`flex justify-between`,children:[(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`tok`}),(0,Y.jsx)(`span`,{className:`font-mono text-foreground`,children:ft((e.tokensIn||0)+(e.tokensOut||0))})]}),(0,Y.jsxs)(`div`,{className:`flex justify-between`,children:[(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`cost`}),(0,Y.jsxs)(`span`,{className:`font-mono text-success`,children:[`$`,(e.costUsd||0).toFixed(3)]})]})]}),o>0&&(0,Y.jsxs)(`div`,{className:`mb-1`,children:[(0,Y.jsxs)(`div`,{className:`mb-0.5 flex justify-between text-[10px] text-muted-foreground`,children:[(0,Y.jsx)(`span`,{children:`ctx`}),(0,Y.jsxs)(`span`,{className:H(`font-mono`,o>=90?`text-destructive`:o>=70?`text-warning`:`text-muted-foreground`),children:[o,`%`]})]}),(0,Y.jsx)(`div`,{className:`h-1 overflow-hidden rounded-full bg-muted`,children:(0,Y.jsx)(`div`,{className:H(`h-full`,o>=90?`bg-destructive`:o>=70?`bg-warning`:`bg-primary`),style:{width:`${o}%`}})})]}),e.lastActivityAt&&(0,Y.jsxs)(`div`,{className:H(`flex items-center gap-1 text-[10px]`,n?`text-muted-foreground/70`:`text-muted-foreground`),children:[i&&(0,Y.jsx)(`span`,{className:`text-success`,children:t(`activity:office.donePrefix`)}),r&&(0,Y.jsx)(`span`,{className:`text-destructive`,children:t(`activity:office.failedPrefix`)}),(0,Y.jsx)(`span`,{children:t(`activity:office.seenPrefix`,{time:pt(e.lastActivityAt,Date.now())})})]})]})}function Sn({data:e}){let{t}=m();return(0,Y.jsxs)(`div`,{className:H(`rounded-lg border border-dashed p-3 min-w-[120px] transition-all opacity-40`,`border-border/70 bg-muted/30`),children:[(0,Y.jsx)(Q,{}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,Y.jsx)(g,{className:`h-4 w-4 text-muted-foreground`}),(0,Y.jsx)(`div`,{className:`flex-1 min-w-0`,children:(0,Y.jsx)(`div`,{className:`truncate text-[10px] text-muted-foreground`,children:e.label})}),(0,Y.jsx)(hn,{status:e.status,small:!0,activity:e.vizActivity??0})]}),(0,Y.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:t(`activity:office.availableDesk`)})]})}function Cn({data:e}){let{t}=m(),n=e.color||Z.warning,r=(e.unreadCount||0)>0;return(0,Y.jsxs)(`div`,{className:H(`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,Y.jsx)(Q,{}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-3 mb-3`,children:[(0,Y.jsx)(`div`,{className:H(`flex items-center justify-center w-10 h-10 rounded-lg`,r?`bg-warning/18`:`bg-warning/10`),children:(0,Y.jsx)(h,{className:`h-5 w-5`,style:{color:n}})}),(0,Y.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,Y.jsx)(`div`,{className:`text-xs font-bold`,style:{color:n},children:t(`activity:office.mailboxHub`)}),(0,Y.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:r?t(`activity:office.unreadSuffix`,{count:e.unreadCount||0}):t(`activity:office.allClear`)})]}),r&&(0,Y.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,Y.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-[10px]`,children:[(0,Y.jsxs)(`div`,{className:`rounded bg-muted/40 p-1.5 text-center`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-center gap-1 text-warning`,children:[(0,Y.jsx)(F,{className:`h-3 w-3`}),(0,Y.jsx)(`span`,{children:e.messageCount||0})]}),(0,Y.jsx)(`div`,{className:`text-muted-foreground`,children:t(`activity:office.total`)})]}),(0,Y.jsxs)(`div`,{className:`rounded bg-muted/40 p-1.5 text-center`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-center gap-1 text-success`,children:[(0,Y.jsx)(_e,{className:`h-3 w-3`}),(0,Y.jsx)(`span`,{children:e.unreadCount||0})]}),(0,Y.jsx)(`div`,{className:`text-muted-foreground`,children:t(`activity:office.unreadLabel`)})]})]}),e.sublabel&&(0,Y.jsxs)(`div`,{className:`mt-2 truncate border-t border-border/60 pt-1.5 text-[11px] text-muted-foreground`,children:[`✉ `,e.sublabel]})]})}var wn={webui:_n,tui:vn,repl:yn,coordinator:bn,agent:xn,mailbox:Cn,desk:Sn};function $({k:e,v:t,accent:n}){return(0,Y.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,Y.jsx)(`span`,{className:`text-muted-foreground shrink-0`,children:e}),(0,Y.jsx)(`span`,{className:H(`font-mono truncate text-right`,n??`text-foreground/80`),children:t})]})}function Tn({selectedNode:e,selectedAgentTranscript:t,mailboxMessages:n,onClose:r,onOpenWatch:i}){let{t:a}=m(),o=e.data,s=Date.now(),c=o.kind===`agent`,l=o.kind===`webui`||o.kind===`tui`||o.kind===`repl`,d=(o.tokensIn||0)+(o.tokensOut||0),f=mn(o.ctxPct);return(0,Y.jsxs)(`div`,{className:H(`absolute top-20 right-4 bg-background border border-border rounded-lg p-4 shadow-xl z-20`,o.kind===`agent`?`w-[28rem] max-w-[calc(100%-2rem)]`:o.sessionId?`w-80`:`w-64`),children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[o.kind===`webui`&&(0,Y.jsx)(_,{className:`h-4 w-4 text-info`}),o.kind===`tui`&&(0,Y.jsx)(u,{className:`h-4 w-4 text-success`}),o.kind===`coordinator`&&(0,Y.jsx)(k,{className:`h-4 w-4 text-primary`}),o.kind===`agent`&&(0,Y.jsx)(I,{className:`h-4 w-4 text-primary`}),o.kind===`mailbox`&&(0,Y.jsx)(h,{className:`h-4 w-4 text-warning`}),(0,Y.jsx)(`span`,{className:`text-sm font-bold text-foreground`,children:o.label})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[o.sessionId&&(0,Y.jsx)(`button`,{type:`button`,title:a(`activity:office.openFullView`),onClick:()=>i({sessionId:o.sessionId,label:o.label}),className:`text-muted-foreground hover:text-primary`,children:(0,Y.jsx)(w,{className:`h-3.5 w-3.5`})}),(0,Y.jsx)(`button`,{type:`button`,onClick:r,className:`text-muted-foreground hover:text-foreground text-lg leading-none`,children:`×`})]})]}),(0,Y.jsxs)(`div`,{className:`space-y-1.5 text-xs`,children:[(0,Y.jsx)($,{k:`Status`,v:String(o.status).toUpperCase(),accent:H(o.status===`active`&&`text-success`,o.status===`streaming`&&`text-primary`,o.status===`error`&&`text-destructive`,o.status===`idle`&&`text-muted-foreground`,o.status===`offline`&&`text-muted-foreground/70`)}),c&&(0,Y.jsxs)(Y.Fragment,{children:[o.model&&(0,Y.jsx)($,{k:`Model`,v:ht(o.model),accent:`text-primary`}),o.currentTask&&(0,Y.jsxs)(`div`,{className:`pt-1`,children:[(0,Y.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground`,children:a(`activity:agentOffice.currentTask`)}),(0,Y.jsx)(`div`,{className:`mt-1 max-h-32 overflow-y-auto whitespace-pre-wrap break-words font-mono text-[10px] text-primary`,children:o.currentTask})]}),(0,Y.jsx)($,{k:`Iterations`,v:o.iteration||0,accent:`text-primary`}),(0,Y.jsx)($,{k:`Tool calls`,v:o.toolCalls||0,accent:`text-warning`}),(0,Y.jsx)($,{k:`Tokens in`,v:ft(o.tokensIn)}),(0,Y.jsx)($,{k:`Tokens out`,v:ft(o.tokensOut)}),(0,Y.jsx)($,{k:`Tokens total`,v:ft(d)}),f>0&&(0,Y.jsx)($,{k:`Context`,v:`${f}%`,accent:f>=90?`text-destructive`:f>=70?`text-warning`:`text-foreground/70`}),(0,Y.jsx)($,{k:`Cost`,v:`$${(o.costUsd||0).toFixed(4)}`,accent:`text-success`}),o.lastActivityAt&&(0,Y.jsx)($,{k:`Last seen`,v:pt(o.lastActivityAt,s),accent:`text-muted-foreground`}),(0,Y.jsx)(`div`,{className:`pt-2`,children:(0,Y.jsx)(Pe,{entries:t,agentName:o.label,compact:!0,maxHeightClassName:`max-h-64`})})]}),l&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)($,{k:`Surface`,v:bt(o.kind),accent:`text-foreground/80`}),o.branch&&(0,Y.jsx)($,{k:`Branch`,v:`⎇ ${o.branch}`,accent:`text-foreground/70`}),o.pid!=null&&(0,Y.jsx)($,{k:`PID`,v:o.pid}),o.workingDir&&(0,Y.jsx)($,{k:`Dir`,v:o.workingDir,accent:`text-muted-foreground`}),(0,Y.jsx)($,{k:`Agents`,v:o.agentCount??0,accent:`text-primary`}),o.startedAt&&(0,Y.jsx)($,{k:`Uptime`,v:mt(o.startedAt,s),accent:`text-foreground/70`})]}),o.kind===`mailbox`&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)($,{k:`Total messages`,v:o.messageCount||0,accent:`text-warning`}),(0,Y.jsx)($,{k:`Unread`,v:o.unreadCount||0,accent:`text-warning`}),n.length>0&&(0,Y.jsxs)(`div`,{className:`mt-1 space-y-1 border-t border-border pt-2`,children:[(0,Y.jsx)(`div`,{className:`text-[10px] uppercase tracking-wide text-muted-foreground`,children:a(`activity:office.recent`)}),[...n].sort((e,t)=>Date.parse(t.timestamp)-Date.parse(e.timestamp)).slice(0,6).map(e=>(0,Y.jsxs)(`div`,{className:`flex items-start gap-1.5 text-[10px]`,children:[(0,Y.jsx)(`span`,{className:H(`mt-1 h-1.5 w-1.5 shrink-0 rounded-full`,!e.completed&&(e.readByCount??0)===0?`bg-warning`:e.completed?`bg-success`:`bg-muted`)}),(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsx)(`div`,{className:`truncate text-foreground/80`,children:e.subject||a(`activity:office.noSubject`)}),(0,Y.jsxs)(`div`,{className:`truncate font-mono text-[9px] text-muted-foreground`,children:[e.from,` → `,e.to,` · `,pt(e.timestamp,s),e.audience===`leaders`?` · ${a(`activity:mailbox.audienceLeaders`)}`:``]})]})]},e.id))]})]}),o.kind===`coordinator`&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)($,{k:`Connections`,v:o.connections||0,accent:`text-primary`}),(0,Y.jsx)($,{k:`Iterations`,v:o.iteration||0,accent:`text-primary`})]}),(c||l)&&o.sessionId&&(0,Y.jsx)(`div`,{className:`mt-2 border-t border-border pt-2 h-72`,children:(0,Y.jsx)(fn,{sessionId:o.sessionId})})]})]})}var En={wire:({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i,targetPosition:a,data:o,selected:s})=>{let c=o?.color||Z.primary,l=U(e=>e.animateEdges),u=o?.animated&&l?Math.max(.15,o?.intensity??.6):0,[d,f,p]=ge({sourceX:e,sourceY:t,sourcePosition:i??T.Bottom,targetX:n,targetY:r,targetPosition:a??T.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,Y.jsxs)(Y.Fragment,{children:[(0,Y.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,Y.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,Y.jsx)(`animate`,{attributeName:`stroke-dashoffset`,from:g,to:`0`,dur:_,repeatCount:`indefinite`})}),o?.label&&u>.1&&(0,Y.jsx)(de,{children:(0,Y.jsx)(`div`,{style:{position:`absolute`,transform:`translate(-50%, -50%) translate(${f}px, ${p}px)`},className:`pointer-events-none max-w-[220px] truncate whitespace-nowrap 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 Dn(){let{t:e}=m();return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.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,Y.jsx)(`div`,{className:`mb-2 font-bold text-foreground`,children:e(`activity:office.legendStatus`)}),(0,Y.jsxs)(`div`,{className:`space-y-1`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`h-2 w-2 animate-pulse rounded-full bg-success`}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.legendActive`)})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`h-2 w-2 rounded-full bg-muted-foreground`}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.legendIdle`)})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`h-2 w-2 animate-pulse rounded-full bg-destructive`}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.legendError`)})]})]})]}),(0,Y.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,Y.jsx)(`div`,{className:`mb-2 font-bold text-foreground`,children:e(`activity:office.legendConnections`)}),(0,Y.jsxs)(`div`,{className:`space-y-1`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-warning`,children:`✉`}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.legendMail`)})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-primary`,children:`→`}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.legendTask`)})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-success`,children:`●`}),(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:e(`activity:office.legendStatusConn`)})]})]})]})]})}function On({draft:e,isSending:t,result:n,onClose:r,onDraftChange:i,onSend:a}){let{t:o}=m();return(0,Y.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,Y.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] font-semibold text-warning`,children:[(0,Y.jsx)(F,{className:`h-3.5 w-3.5`}),` `,o(`activity:office.broadcastToAll`)]}),(0,Y.jsx)(`button`,{type:`button`,onClick:r,className:`text-base leading-none text-muted-foreground hover:text-foreground`,children:`×`})]}),(0,Y.jsx)(`textarea`,{value:e,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),a())},rows:3,placeholder:o(`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,Y.jsxs)(`div`,{className:`mt-1.5 flex items-center justify-between`,children:[(0,Y.jsx)(`span`,{className:`text-[9px] text-muted-foreground`,children:o(`activity:office.broadcastSendHint`)}),(0,Y.jsx)(`button`,{type:`button`,onClick:a,disabled:t||!e.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:t?`…`:o(`activity:office.broadcast`)})]}),n&&(0,Y.jsx)(`div`,{className:`mt-1 text-[10px] text-muted-foreground`,children:n})]})}function kn({broadcastOpen:e,labels:t,onArrange:n,onBroadcastToggle:r,onFeedToggle:i,showFeed:a}){return(0,Y.jsxs)(oe,{position:`top-right`,className:`flex items-center gap-2`,children:[(0,Y.jsxs)(`button`,{type:`button`,onClick:n,title:t.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,Y.jsx)(ne,{className:`h-3.5 w-3.5`}),t.arrange]}),(0,Y.jsxs)(`button`,{type:`button`,onClick:i,title:t.feedTitle,className:H(`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md border text-xs transition-colors`,a?`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,Y.jsx)(z,{className:`h-3.5 w-3.5`}),t.feed]}),(0,Y.jsxs)(`button`,{type:`button`,onClick:r,title:t.broadcastTitle,className:H(`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md border text-xs transition-colors`,e?`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,Y.jsx)(F,{className:`h-3.5 w-3.5`}),t.broadcast]})]})}function An(){return(0,Y.jsx)(A,{className:`rounded-lg border border-border/70 bg-card/90`,nodeColor:e=>{switch(e.data.kind){case`coordinator`:return Z.primary;case`webui`:return Z.info;case`tui`:return Z.success;case`repl`:case`mailbox`:return Z.warning;default:return Z.primary}},maskColor:`hsl(var(--background) / 0.72)`})}function jn({closeTitle:e,label:t,onClose:n,sessionId:r,streamTitle:i}){return(0,Y.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,Y.jsxs)(`div`,{className:`flex items-center justify-between border-b border-border px-4 py-2.5 shrink-0 bg-card`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,Y.jsx)(I,{className:`h-4 w-4 text-primary shrink-0`}),(0,Y.jsxs)(`div`,{className:`min-w-0`,children:[(0,Y.jsx)(`div`,{className:`truncate text-sm font-bold text-foreground`,children:t}),(0,Y.jsx)(`div`,{className:`text-[10px] uppercase tracking-wide text-muted-foreground`,children:i})]})]}),(0,Y.jsx)(`button`,{type:`button`,onClick:n,title:e,className:`text-muted-foreground hover:text-foreground text-xl leading-none shrink-0`,children:`×`})]}),(0,Y.jsx)(`div`,{className:`flex-1 min-h-0 p-4`,children:(0,Y.jsx)(fn,{sessionId:r,limit:500})})]})}function Mn(){let{t:e}=m(),{fitView:t}=te(),n=(0,W.useRef)(null),[r,i]=(0,W.useState)({width:1280,height:720});(0,W.useEffect)(()=>{let e=n.current;if(!e)return;let t=()=>{let{width:t,height:n}=e.getBoundingClientRect();t<1||n<1||i(e=>Math.abs(e.width-t)<2&&Math.abs(e.height-n)<2?e:{width:t,height:n})};t();let r=new ResizeObserver(t);return r.observe(e),()=>r.disconnect()},[]);let a=xe(e=>e.events),o=Ce(e=>e.agents),s=Ce(e=>e.agentTranscripts),c=Ce(e=>e.leaderId),l=we(e=>e.liveSessions),u=Ee(e=>e.messages),d=Ee(e=>e.agents),f=Se(e=>e.session),p=At(o),h=(0,W.useMemo)(()=>Dt(l,o,d,p.map,p.now),[l,o,d,p]),g=U(e=>e.showHud),_=U(e=>e.showLegend),v=U(e=>e.showMinimap),y=U(e=>e.showControls),b=U(e=>e.showFeed),x=U(e=>e.setShowFeed),S=U(e=>e.background),[C,w,T]=ce([]),[E,O,k]=pe([]),[A,j]=(0,W.useState)(null),[N,ne]=(0,W.useState)(null),[F,ie]=(0,W.useState)(!1),[ae,oe]=(0,W.useState)(``),[I,se]=(0,W.useState)(!1),[le,ue]=(0,W.useState)(null),de=(0,W.useMemo)(()=>{if(A?.data.kind!==`agent`)return Te;let e=A.data.serverId??(A.id.includes(`__agent-`)?A.id.split(`__agent-`).pop():A.id.replace(/^agent-/,``));return e?s.get(e)??Te:Te},[s,A]),fe=(0,W.useCallback)(async()=>{let e=ae.trim();if(!(!e||I)){se(!0),ue(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();oe(``),ue(`Delivered to ${n.delivered??0}/${n.targets??0} session(s)`)}catch(e){ue(`Failed: ${e instanceof Error?e.message:String(e)}`)}finally{se(!1)}}},[ae,I]),L=(0,W.useRef)(new Map),R=4e3,z=(0,W.useRef)(new Map),B=(0,W.useRef)(new Map),he=(0,W.useRef)(new Map),ge=(0,W.useRef)(new Map),_e=(0,W.useRef)(``);(0,W.useEffect)(()=>{let n=[],i=[],a=Date.now(),s=_t(h.map(e=>({id:e.id,agentCount:e.agents.length})),r),l=u.filter(e=>!e.completed&&(e.readByCount??0)===0).length,d=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:l>0?`active`:`idle`,unreadCount:l,messageCount:u.length,sublabel:d?`${d.from} → ${d.to}: ${d.subject}`:void 0,color:Z.warning}});let f=0,p=0,m=0,g=0,_=0;for(let e of h)for(let t of e.agents)p+=1,(t.status===`active`||t.status===`streaming`)&&(f+=1),m+=t.toolCalls,g+=t.costUsd,_+=t.tokensIn+t.tokensOut;let v=c?o.get(c):null,y=f>0;n.push({id:`coordinator`,type:`coordinator`,position:{x:370,y:50},data:{label:e(`activity:office.fleetHqLabel`),sublabel:e(`activity:office.clientsSuffix`,{count:h.length}),kind:`coordinator`,status:v?.status===`failed`?`error`:y?`active`:`idle`,connections:h.length,agentsActive:f,agentsTotal:p,toolCalls:m,costUsd:g,tokensIn:_,color:Z.primary}});let b={tui:Z.success,webui:Z.info,repl:Z.warning};for(let t of h){let r=s.positions.get(t.id)??{x:600,y:370},o=r.x,c=r.y,u=b[t.type],d=t.status===`active`;if(n.push({id:t.id,type:t.type,position:{x:o,y:c},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:u}}),i.push({id:`${t.id}->coordinator`,source:t.id,target:`coordinator`,type:`wire`,animated:d,data:{color:u,animated:d,label:e(`activity:office.controlLabel`),flowType:`task`}}),i.push({id:`mailbox->${t.id}`,source:`mailbox`,target:t.id,type:`wire`,animated:l>0,data:{color:Z.warning,animated:l>0,label:l>0?`${l}`:void 0,flowType:`mail`}}),t.agents.length===0){n.push({id:`desk-${t.id}`,type:`desk`,position:{x:o,y:c+270},data:{label:e(`activity:office.idleDesk`),kind:`agent`,status:`idle`,color:Z.muted}});continue}t.agents.forEach((r,s)=>{let l=r.status===`active`||r.status===`streaming`,u=ge.current.get(r.serverId);if(u&&(r.toolCalls>u.toolCalls||r.iteration>u.iteration)||l){L.current.set(r.officeId,a+R);let e=B.current.get(r.officeId)??0;B.current.set(r.officeId,Math.min(1,e+(1-e)*.5));for(let e of[`${t.id}->${r.officeId}`,`${t.id}->coordinator`]){let t=z.current.get(e)??0;z.current.set(e,Math.min(1,t+.5))}}ge.current.set(r.serverId,{toolCalls:r.toolCalls,iteration:r.iteration}),n.push({id:r.officeId,type:`agent`,position:vt(o,s,t.agents.length,c+270),data:{label:r.name,kind:`agent`,status:r.status,serverId:r.serverId,sessionId:t.sessionId,currentTask:r.currentTask,iteration:r.iteration,toolCalls:r.toolCalls,costUsd:r.costUsd,tokensIn:r.tokensIn,tokensOut:r.tokensOut,ctxPct:r.ctxPct,model:r.model,lastActivityAt:r.lastActivityAt,color:Z.primary}}),i.push({id:`${t.id}->${r.officeId}`,source:t.id,target:r.officeId,type:`wire`,animated:l,data:{color:Z.primary,animated:l,label:l?gt(r.currentTask,48)??e(`activity:office.taskFallback`):void 0,flowType:`task`}})})}let x=new Set(h.flatMap(e=>e.agents.map(e=>e.serverId)));for(let e of[...ge.current.keys()])x.has(e)||ge.current.delete(e);let S=n.map(e=>{let t=L.current.get(e.id),n=B.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}}}),C=i.map(e=>{let t=z.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 S)T.set(e.id,{...e.position});he.current=T,w(S),O(C);let E=[`${Math.round(r.width)}x${Math.round(r.height)}`,`${s.columns}x${s.rows}`,h.map(e=>`${e.id}:${e.agents.length}`).join(`|`),S.map(e=>e.id).sort().join(`|`)].join(`:`);if(E!==_e.current){_e.current=E;let e=setTimeout(()=>t({padding:pn,duration:300}),50);return()=>clearTimeout(e)}},[h,c,o,u,f,r,R,w,O,t]);let ve=h.flatMap(e=>e.agents.map(t=>({clientId:e.id,clientType:e.type,officeId:t.officeId,serverId:t.serverId}))),ye=h.map(e=>e.id),be=new Map;for(let e of ve)(!be.has(e.serverId)||e.clientType===`webui`)&&be.set(e.serverId,e.officeId);function V(e){return be.get(e)??`agent-${e}`}function H(e){let t=e.split(`__agent-`)[0];return t&&t!==e?`${t}->${e}`:`coordinator->${e}`}function De(e){switch(e.kind){case`mailbox:send`:case`mailbox:deliver`:return{nodes:[`mailbox`],edges:e.kind===`mailbox:send`?ye.map(e=>`mailbox->${e}`):[],status:`active`};case`agent:spawned`:{let t=V(e.source);return{nodes:[`coordinator`,t],edges:[H(t)],status:`active`}}case`agent:tool`:case`tool:started`:case`tool:progress`:{let t=V(e.source);return{nodes:[`coordinator`,t],edges:[H(t)],status:e.kind===`tool:progress`||e.kind===`tool:started`?`streaming`:`active`}}case`tool:executed`:{let t=V(e.target??e.source);return{nodes:[t],edges:[H(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:ve.map(e=>H(e.officeId)),status:e.kind===`iteration:start`?`streaming`:`active`};case`agent:text`:{let t=V(e.source);return{nodes:[t],edges:[H(t)],status:`streaming`}}case`agent:status`:{let t=V(e.source);return{nodes:[`coordinator`,t],edges:[H(t)],status:e.data&&typeof e.data==`object`&&`status`in e.data&&String(e.data.status)===`failed`?`error`:`completed`}}case`agent:ctx`:return{nodes:[V(e.source)],edges:[],status:`active`};case`budget:extended`:return{nodes:[`coordinator`,V(e.source)],edges:[],status:`active`};case`context:compacted`:case`context:repaired`:return{nodes:[`coordinator`],edges:[],status:`active`};case`error`:return{nodes:e.source?[V(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=V(t.id);n.includes(e)||n.push(e)}return{nodes:n,edges:[],status:`active`}}default:return{nodes:[],edges:[],status:`idle`}}}(0,W.useEffect)(()=>{if(a.length===0)return;let e=a[0];if(!e)return;let{nodes:t,edges:n,status:r}=De(e),i=Date.now();t.length>0&&(t.forEach(e=>{L.current.set(e,i+R);let t=B.current.get(e)??0;B.current.set(e,Math.min(1,t+(1-t)*.5))}),w(e=>e.map(e=>t.includes(e.id)?{...e,data:{...e.data,status:r,vizActivity:B.current.get(e.id)??0}}:e))),n.length>0&&(n.forEach(e=>{let t=z.current.get(e)??0;z.current.set(e,Math.min(1,t+.5))}),O(e=>e.map(e=>n.includes(e.id)?{...e,animated:!0,data:{...e.data,animated:!0,intensity:z.current.get(e.id)??1}}:e)))},[a,w,O,R,o]),(0,W.useEffect)(()=>{let e=setInterval(()=>{let e=new Map,t=!1;for(let[n,r]of z.current){let i=r*.85;i<.05?(z.current.delete(n),e.set(n,{intensity:0,animated:!1}),t=!0):(z.current.set(n,i),e.set(n,{intensity:i,animated:!0}),t=!0)}t&&O(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 B.current){let i=t*.9;i<.03?(B.current.delete(e),n.set(e,0),r=!0):(B.current.set(e,i),n.set(e,i),r=!0)}r&&w(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)},[O,w]);let Oe=(0,W.useCallback)(e=>O(t=>ee({...e,type:`wire`},t)),[O]),ke=(0,W.useCallback)((e,t)=>{j(t)},[]),Ae=(0,W.useCallback)(()=>{j(null)},[]);(0,W.useEffect)(()=>{if(!N)return;let e=e=>{e.key===`Escape`&&ne(null)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[N]);let je=(0,W.useCallback)(()=>{w(e=>e.map(e=>{let t=he.current.get(e.id);return t?{...e,position:{...t}}:e})),setTimeout(()=>t({padding:pn,duration:300}),50)},[w,t]),[,Me]=(0,W.useState)(0);return(0,W.useEffect)(()=>{let e=setInterval(()=>{document.hidden||Me(e=>e+1)},2e3);return()=>clearInterval(e)},[]),(0,Y.jsxs)(`div`,{ref:n,className:`relative h-full w-full overflow-hidden bg-[hsl(var(--surface-2)/0.55)]`,children:[(0,Y.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,Y.jsx)(rn,{}),(0,Y.jsx)(`div`,{className:`absolute top-3 left-1/2 -translate-x-1/2 z-10`,children:(0,Y.jsx)(`div`,{className:`rounded-lg border border-border/70 bg-card/90 px-4 py-2 shadow-xl backdrop-blur`,children:(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-bold text-foreground`,children:[(0,Y.jsx)(re,{className:`h-4 w-4 text-primary`}),e(`activity:office.fleetHq`),(0,Y.jsx)(`span`,{className:`ml-2 h-2 w-2 animate-pulse rounded-full bg-success`}),(0,Y.jsx)(`span`,{className:`text-[10px] font-normal text-muted-foreground`,children:e(`activity:office.live`)})]})})}),_&&(0,Y.jsx)(Dn,{}),(0,Y.jsxs)(M,{nodes:C,edges:E,onNodesChange:T,onEdgesChange:k,onConnect:Oe,onNodeClick:ke,onPaneClick:Ae,nodeTypes:wn,edgeTypes:En,fitView:!0,fitViewOptions:{padding:pn},minZoom:.15,maxZoom:1.5,defaultEdgeOptions:{type:`wire`},proOptions:{hideAttribution:!0},children:[(0,Y.jsx)(kn,{broadcastOpen:F,labels:{arrange:e(`activity:office.arrange`),arrangeTitle:e(`activity:office.arrangeTitle`),broadcast:e(`activity:office.broadcast`),broadcastTitle:e(`activity:office.broadcastTitle`),feed:e(`activity:office.feed`),feedTitle:e(`activity:office.feedTitle`)},onArrange:je,onBroadcastToggle:()=>ie(e=>!e),onFeedToggle:()=>x(!b),showFeed:b}),S!==`none`&&(0,Y.jsx)(me,{variant:S===`lines`?P.Lines:S===`cross`?P.Cross:P.Dots,gap:20,size:1,color:`hsl(var(--border) / 0.35)`}),y&&(0,Y.jsx)(D,{className:`rounded-lg border border-border/70 bg-card/90 [&>button]:bg-card [&>button]:text-foreground`}),v&&(0,Y.jsx)(An,{})]}),b&&(0,Y.jsx)(an,{events:a,now:Date.now()}),F&&(0,Y.jsx)(On,{draft:ae,isSending:I,result:le,onClose:()=>ie(!1),onDraftChange:oe,onSend:()=>void fe()}),A&&(0,Y.jsx)(Tn,{selectedNode:A,selectedAgentTranscript:de,mailboxMessages:u,onClose:Ae,onOpenWatch:ne}),N&&(0,Y.jsx)(jn,{closeTitle:e(`activity:office.closeEsc`),label:N.label,onClose:()=>ne(null),sessionId:N.sessionId,streamTitle:e(`activity:office.fullOperationStream`)})]})}function Nn(){let{t:e}=m(),t=U(e=>e.viewMode),n=U(e=>e.setViewMode),r=[{id:`office`,label:e(`activity:agentOffice.office`),description:e(`activity:agentOffice.officeDescription`),icon:i},{id:`topology`,label:e(`activity:agentOffice.topology`),description:e(`activity:agentOffice.topologyDescription`),icon:V}],a=(e,t)=>{let i;if(e.key===`ArrowLeft`&&(i=(t-1+r.length)%r.length),e.key===`ArrowRight`&&(i=(t+1)%r.length),e.key===`Home`&&(i=0),e.key===`End`&&(i=r.length-1),i===void 0)return;e.preventDefault();let a=r[i];a&&(n(a.id),e.currentTarget.parentElement?.querySelectorAll(`[role="tab"]`)[i]?.focus())};return(0,Y.jsxs)(`div`,{className:`flex h-full min-h-0 w-full flex-col bg-background`,children:[(0,Y.jsx)(`nav`,{"aria-label":`${e(`activity:agentOffice.office`)} / ${e(`activity:agentOffice.topology`)}`,className:`relative z-[60] shrink-0 border-b border-border bg-card/95 px-3 pt-2 shadow-[0_8px_28px_hsl(var(--shadow-color)/0.1)] backdrop-blur-xl sm:px-5`,children:(0,Y.jsx)(`div`,{role:`tablist`,"aria-orientation":`horizontal`,className:`mx-auto grid w-full max-w-3xl grid-cols-2 gap-1`,children:r.map((e,r)=>{let i=e.icon,o=t===e.id;return(0,Y.jsxs)(`button`,{id:`office-map-tab-${e.id}`,type:`button`,role:`tab`,"aria-selected":o,"aria-controls":`office-map-view-panel`,tabIndex:o?0:-1,onClick:()=>n(e.id),onKeyDown:e=>a(e,r),className:H(`group relative flex min-w-0 items-center gap-2.5 border-b-2 px-3 py-2.5 text-left transition-all duration-200 sm:gap-3 sm:px-5`,o?`border-primary bg-primary/[0.07] text-foreground`:`border-transparent text-muted-foreground hover:border-border hover:bg-accent/60 hover:text-foreground`),children:[(0,Y.jsx)(`span`,{className:H(`grid h-8 w-8 shrink-0 place-items-center rounded-lg border transition-colors`,o?`border-primary/35 bg-primary/15 text-primary`:`border-border bg-background/70 text-muted-foreground group-hover:text-foreground`),children:(0,Y.jsx)(i,{className:`h-4 w-4`,"aria-hidden":`true`})}),(0,Y.jsxs)(`span`,{className:`min-w-0`,children:[(0,Y.jsx)(`strong`,{className:`block truncate font-display text-xs font-semibold sm:text-sm`,children:e.label}),(0,Y.jsx)(`small`,{className:`hidden truncate font-mono text-[9px] font-normal text-muted-foreground sm:block`,children:e.description})]}),(0,Y.jsx)(`span`,{"aria-hidden":`true`,className:H(`ml-auto h-1.5 w-1.5 shrink-0 rounded-full transition-all`,o?`bg-primary shadow-[0_0_0_4px_hsl(var(--primary)/0.12)]`:`bg-border`)})]},e.id)})})}),(0,Y.jsx)(`div`,{id:`office-map-view-panel`,role:`tabpanel`,"aria-labelledby":`office-map-tab-${t}`,className:`relative min-h-0 flex-1`,children:t===`office`?(0,Y.jsx)(nn,{}):(0,Y.jsx)(B,{children:(0,Y.jsx)(Mn,{})})})]})}export{Nn as OfficeMapPanel};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{lt as t,za as n}from"./vendor-BuarzSSb.js";import{t as r}from"./utils-B-9lSDIn.js";import{t as i}from"./button-Dcy288Mc.js";import{t as a}from"./input-fo9-BPBC.js";import{o}from"./index-DHdO0CRE.js";var s=e(n(),1),c=t(),l=[`feature`,`bug_fix`,`refactor`,`performance`,`security`,`ui_change`,`api_change`,`infrastructure`,`migration`,`testing`,`documentation`,`maintenance`,`other`,`unspecified`],u=[`unspecified`,`low`,`medium`,`high`,`critical`],d={draft:`bg-muted text-muted-foreground`,collecting_information:`bg-amber-500/15 text-amber-700 dark:text-amber-300`,submitted:`bg-emerald-500/15 text-emerald-700 dark:text-emerald-300`,cancelled:`bg-destructive/15 text-destructive`,archived:`bg-muted text-muted-foreground`};function f(e){let t=Date.now()-e;if(t<6e4)return`just now`;let n=Math.floor(t/6e4);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function p(){let[e,t]=(0,s.useState)(null),[n,p]=(0,s.useState)([]),[m,h]=(0,s.useState)(!0),[g,_]=(0,s.useState)(null),[v,y]=(0,s.useState)(``),[b,x]=(0,s.useState)(``),[S,C]=(0,s.useState)(`unspecified`),[w,T]=(0,s.useState)(`unspecified`),[E,D]=(0,s.useState)(!1),[O,k]=(0,s.useState)(null),[A,j]=(0,s.useState)(null),M=(0,s.useCallback)(async()=>{h(!0),_(null);try{let e=await fetch(`/api/requirement-intakes`);if(!e.ok){let t=await e.json().catch(()=>null);throw Error(t?.error?.message??`List failed (HTTP ${e.status})`)}let n=await e.json();t(n.projectId),p(n.intakes)}catch(e){_(e instanceof Error?e.message:String(e))}finally{h(!1)}},[]);(0,s.useEffect)(()=>{M()},[M]);let N=(0,s.useCallback)(async()=>{let t=v.trim();if(!t){k(`Describe the request first — it is preserved verbatim.`);return}if(!e){k(`No project identity available yet.`);return}D(!0),k(null),j(null);try{let n=await fetch(`/api/projects/${encodeURIComponent(e)}/requirement-intakes`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({originalRequest:t,...b.trim()?{title:b.trim()}:{},...S===`unspecified`?{}:{requestType:S},...w===`unspecified`?{}:{priority:w}})}),r=await n.json().catch(()=>null);if(!n.ok||!r?.record)throw Error(r?.error?.message??`Create failed (HTTP ${n.status})`);let i=await fetch(`/api/requirement-intakes/${r.record.id}/submit`,{method:`POST`,headers:{"Content-Type":`application/json`},body:`{}`});if(!i.ok){let e=await i.json().catch(()=>null);throw Error(e?.error?.message??`Submit failed (HTTP ${i.status})`)}j(`Intake recorded and submitted (${r.record.id}).`),y(``),x(``),C(`unspecified`),T(`unspecified`),await M()}catch(e){k(e instanceof Error?e.message:String(e))}finally{D(!1)}},[v,b,S,w,e,M]);return(0,c.jsxs)(`div`,{className:`flex h-full flex-col overflow-hidden`,children:[(0,c.jsxs)(`header`,{className:`border-b border-border/70 px-5 py-3`,children:[(0,c.jsx)(`div`,{className:`text-sm font-semibold text-foreground`,children:`Requirements Intake`}),(0,c.jsx)(`div`,{className:`mt-0.5 text-[11px] text-muted-foreground`,children:`Collect and preserve software development requests as structured intake records`})]}),(0,c.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain p-5`,children:[g?(0,c.jsxs)(`div`,{role:`alert`,className:`mb-4 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:[g,(0,c.jsx)(`button`,{type:`button`,className:`ml-2 underline underline-offset-2`,onClick:()=>void M(),children:`Retry`})]}):null,(0,c.jsxs)(`section`,{"aria-label":`File a new intake`,className:`mb-6 rounded-lg border border-border/70 bg-card/60 p-4`,children:[(0,c.jsx)(`div`,{className:`mb-3 text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`File a new request`}),(0,c.jsxs)(`div`,{className:`space-y-3`,children:[(0,c.jsxs)(`div`,{children:[(0,c.jsxs)(`label`,{htmlFor:`intake-request`,className:`mb-1 block text-xs text-foreground`,children:[`Request text `,(0,c.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,c.jsx)(`textarea`,{id:`intake-request`,value:v,onChange:e=>y(e.target.value),placeholder:`Describe the feature, bug fix, refactor, or change…`,rows:4,className:r(`w-full resize-y rounded-md border border-border/70 bg-background px-3 py-2`,`text-sm text-foreground placeholder:text-muted-foreground/70`,`focus:outline-none focus:ring-2 focus:ring-ring`)}),(0,c.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:`Stored verbatim as the record's original request — never rewritten.`})]}),(0,c.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 sm:grid-cols-3`,children:[(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`label`,{htmlFor:`intake-title`,className:`mb-1 block text-xs text-foreground`,children:`Title (optional)`}),(0,c.jsx)(a,{id:`intake-title`,value:b,onChange:e=>x(e.target.value),placeholder:`Short display title`})]}),(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`label`,{htmlFor:`intake-type`,className:`mb-1 block text-xs text-foreground`,children:`Type`}),(0,c.jsx)(`select`,{id:`intake-type`,value:S,onChange:e=>C(e.target.value),className:r(`w-full rounded-md border border-border/70 bg-background px-2 py-2`,`text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring`),children:l.map(e=>(0,c.jsx)(`option`,{value:e,children:e},e))})]}),(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`label`,{htmlFor:`intake-priority`,className:`mb-1 block text-xs text-foreground`,children:`Priority`}),(0,c.jsx)(`select`,{id:`intake-priority`,value:w,onChange:e=>T(e.target.value),className:r(`w-full rounded-md border border-border/70 bg-background px-2 py-2`,`text-sm text-foreground focus:outline-none focus:ring-2 focus:ring-ring`),children:u.map(e=>(0,c.jsx)(`option`,{value:e,children:e},e))})]})]}),O?(0,c.jsx)(`div`,{role:`alert`,className:`rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive`,children:O}):null,A?(0,c.jsx)(`div`,{role:`status`,className:`rounded-md border border-emerald-500/30 bg-emerald-500/10 px-3 py-2 text-xs text-emerald-700 dark:text-emerald-300`,children:A}):null,(0,c.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,c.jsx)(i,{variant:`secondary`,size:`sm`,disabled:E,onClick:()=>{y(``),k(null),j(null)},children:`Clear`}),(0,c.jsx)(i,{size:`sm`,disabled:E||!v.trim(),onClick:()=>void N(),children:E?`Filing…`:`File + submit`})]})]})]}),(0,c.jsxs)(`section`,{"aria-label":`Intake records`,className:`space-y-2`,children:[(0,c.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,c.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground`,children:`Records`}),(0,c.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[n.length,` total`]})]}),m?(0,c.jsx)(`div`,{className:`py-8 text-center text-xs text-muted-foreground`,children:`Loading…`}):n.length===0?(0,c.jsx)(`div`,{className:`rounded-md border border-dashed border-border/70 py-10 text-center text-xs text-muted-foreground`,children:`No intake records yet — file the first one above.`}):(0,c.jsx)(`ul`,{className:`space-y-2`,children:n.map(e=>(0,c.jsxs)(`li`,{className:`rounded-md border border-border/70 bg-card/60 p-3`,children:[(0,c.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,c.jsxs)(`div`,{className:`min-w-0`,children:[(0,c.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,title:e.title,children:e.title}),(0,c.jsx)(`div`,{className:`mt-0.5 font-mono text-[10px] text-muted-foreground`,children:e.id})]}),(0,c.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-1.5`,children:[(0,c.jsx)(o,{variant:`secondary`,className:`text-[10px]`,children:e.requestType}),(0,c.jsx)(o,{className:r(`text-[10px]`,d[e.status]??`bg-muted text-muted-foreground`),children:e.status})]})]}),(0,c.jsxs)(`div`,{className:`mt-1.5 text-[11px] text-muted-foreground`,children:[e.priority,` · updated `,f(e.updatedAt)]})]},e.id))})]})]})]})}export{p as RequirementIntakeView};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MemoryManager-B7620q_K.js","assets/rolldown-runtime-QTnfLwEv.js","assets/vendor-BuarzSSb.js","assets/monaco-BLUV5g0U.js","assets/monaco-Bowa0-zp.css","assets/markdown-sSmz-Ua_.js","assets/vendor-BMdWcCR4.css","assets/ui-store-BsBnjO3w.js","assets/useWebSocket-Bc4S0N4r.js","assets/chat-store-CtOyUCdF.js","assets/utils-B-9lSDIn.js","assets/i18n-B0hsnanh.js","assets/activity-BQ0zqkw2.js","assets/chat-DLn1hY01.js","assets/commandPalette-DpaemFux.js","assets/common-BfVFjVhf.js","assets/settings-BHtFy8EG.js","assets/setup-BFcmn89w.js","assets/toasts-BL_8kH4B.js","assets/ws-client-DqFoX4jJ.js","assets/session-store-b2KGFwkX.js","assets/codemap-activity-store-DQfjo7-j.js","assets/stores-BptlyD_v.js","assets/mailbox-store-D8TvJsuk.js","assets/view-navigation-DxfiZrXS.js","assets/codemap-index-store-COStDU-8.js","assets/Toaster-CJI70aa-.js","assets/dialog-ftgTihmF.js","assets/button-Dcy288Mc.js","assets/input-fo9-BPBC.js","assets/index-DHdO0CRE.js","assets/ModelPicker-DvNLZzkm.js","assets/index-DKrFQ76m.css","assets/roster-ws-Dfg_187V.js","assets/shared-KAzksK0C.js","assets/AudienceMemoryPanel-Cc1UkbDl.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{bt as t,lr as n,lt as r,za as i}from"./vendor-BuarzSSb.js";import{s as a}from"./monaco-BLUV5g0U.js";import{t as o}from"./utils-B-9lSDIn.js";import{D as s,E as c,O as l,T as u}from"./index-DHdO0CRE.js";var d=e(i(),1),f=r(),p=(0,d.lazy)(()=>a(()=>import(`./MemoryManager-B7620q_K.js`).then(e=>({default:e.MemoryManager})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]))),m=(0,d.lazy)(()=>a(()=>import(`./AudienceMemoryPanel-Cc1UkbDl.js`).then(e=>({default:e.AudienceMemoryPanel})),__vite__mapDeps([35,1,2,3,4,5,6,8,9,10,11,7,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,34])));function h({label:e}){return(0,f.jsx)(`div`,{className:`flex h-full min-h-0 items-center justify-center bg-background text-xs text-muted-foreground`,"aria-busy":`true`,children:(0,f.jsxs)(`span`,{className:`font-mono uppercase tracking-wide`,children:[e,`…`]})})}var g=[{value:`all`,label:`All memories`,hint:`Inspect, curate, retire`,Icon:n},{value:`audience`,label:`Audience-scoped`,hint:`Guidance routed to agents`,Icon:t}];function _({defaultValue:e=`all`}={}){return(0,f.jsxs)(u,{defaultValue:e,className:`flex h-full min-h-0 min-w-0 flex-1 flex-col`,children:[(0,f.jsx)(`div`,{className:`flex shrink-0 items-center justify-between gap-3 border-b border-border/70 bg-card/55 px-4 py-2 sm:px-5`,role:`presentation`,children:(0,f.jsx)(s,{"aria-label":`SAGE memory lenses`,className:`h-9 bg-muted/40 p-1 shadow-none`,children:g.map(({value:e,label:t,hint:n,Icon:r})=>(0,f.jsxs)(l,{value:e,className:o(`h-7 gap-2 px-3 text-[11px] font-semibold uppercase tracking-wide`,`data-[state=active]:bg-background data-[state=active]:text-foreground`,`data-[state=active]:shadow-[0_0_0_1px_hsl(var(--border)/0.7)]`),children:[(0,f.jsx)(r,{className:`size-3.5`}),(0,f.jsx)(`span`,{children:t}),(0,f.jsx)(`span`,{className:`hidden font-mono text-[9px] font-normal normal-case text-muted-foreground sm:inline`,children:n})]},e))})}),(0,f.jsx)(c,{value:`all`,className:`mt-0 flex-1 overflow-hidden ring-offset-0 focus-visible:ring-0`,children:(0,f.jsx)(d.Suspense,{fallback:(0,f.jsx)(h,{label:`Loading SAGE`}),children:(0,f.jsx)(p,{})})}),(0,f.jsx)(c,{value:`audience`,className:`mt-0 flex-1 overflow-hidden ring-offset-0 focus-visible:ring-0`,children:(0,f.jsx)(d.Suspense,{fallback:(0,f.jsx)(h,{label:`Loading audience memories`}),children:(0,f.jsx)(m,{})})})]})}export{_ as SageTabs};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{$i as t,Ai as n,Bt as r,Ct as i,Et as a,Gn as o,Gt as s,Ii as c,La as l,Nr as u,Nt as d,Oa as f,Ot as p,Pa as m,Pt as h,Qi as g,Ut as _,Wi as v,Wt as y,Xi as b,Xr as ee,Zn as x,bi as te,dt as S,hn as C,in as w,ir as T,jt as E,kn as D,la as O,lt as k,mn as A,pi as ne,ut as re,wn as j,xa as M,xt as N,za as P,zn as F}from"./vendor-BuarzSSb.js";import"./i18n-B0hsnanh.js";import{n as I}from"./ui-store-BsBnjO3w.js";import{t as ie}from"./useWebSocket-Bc4S0N4r.js";import{t as L}from"./utils-B-9lSDIn.js";import{c as R,f as ae,s as z}from"./stores-BptlyD_v.js";import{o as B}from"./view-navigation-DxfiZrXS.js";import{a as V,i as H,n as U,o as W,r as G,t as K}from"./dialog-ftgTihmF.js";import{t as q}from"./button-Dcy288Mc.js";import{n as oe,t as se}from"./ModelPicker-DvNLZzkm.js";import{c as ce,s as le}from"./index-DHdO0CRE.js";import{a as J,c as ue,i as Y,l as X,n as de,o as fe,r as pe,s as me,t as he,u as ge}from"./progress-ring-61A-xUEl.js";import{SpecsView as _e}from"./SpecsView-Fm7pYYcj.js";var Z=e(P(),1),Q=k();function ve({feed:e,now:t}){let{t:n}=m();return(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-border px-3 py-2 text-xs font-semibold text-foreground`,children:[(0,Q.jsx)(f,{className:`h-3.5 w-3.5 text-warning`}),n(`activity:sdd.activityHeading`)]}),(0,Q.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 space-y-1 overflow-auto overscroll-contain p-2`,children:e.length===0?(0,Q.jsx)(`p`,{className:`px-1 pt-4 text-center text-[11px] text-muted-foreground`,children:n(`activity:sdd.feedEmpty`)}):e.map((e,n)=>{let r=Y[e.kind]??Y.started,i=r.icon;return(0,Q.jsxs)(`div`,{className:L(`sdd-rise flex items-start gap-2 rounded-md px-2 py-1.5 text-[11px]`,n===0?`bg-muted`:`hover:bg-muted`),children:[(0,Q.jsx)(i,{className:L(`mt-0.5 h-3.5 w-3.5 shrink-0`,r.color)}),(0,Q.jsx)(`span`,{className:`flex-1 leading-snug text-foreground`,children:e.text}),(0,Q.jsx)(`span`,{className:`shrink-0 tabular-nums text-[10px] text-muted-foreground`,children:me(e.ts,t)})]},`${e.ts}-${n}`)})})]})}function ye({open:e,onOpenChange:t,snapshot:n,busy:r,onConfirm:i}){let{t:a}=m(),o=n?.mergedCommits?.length??0,s=n?.baseBranch,[c,l]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{e&&l(!1)},[e]);let u=n?.status===`running`||n?.status===`paused`,d=(0,Z.useMemo)(()=>{let e=new Set;for(let t of n?.tasks??[])t.worktreeBranch&&e.add(t.worktreeBranch);return e.size},[n?.tasks]),f=(0,Z.useMemo)(()=>{let e=new Set;for(let t of n?.tasks??[])t.displayStatus===`in_progress`&&t.agentName&&e.add(t.agentName);return e.size},[n?.tasks]);return(0,Q.jsx)(K,{open:e,onOpenChange:e=>!r&&t(e),children:(0,Q.jsxs)(U,{className:`sm:max-w-lg border-destructive/50`,children:[(0,Q.jsxs)(V,{children:[(0,Q.jsxs)(W,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(E,{className:`h-5 w-5 text-destructive`}),a(`activity:sdd.destroyTitle`)]}),(0,Q.jsx)(G,{children:a(`activity:sdd.destroyDesc`)})]}),(0,Q.jsxs)(`ul`,{className:`space-y-1.5 py-1 text-sm`,children:[u&&(0,Q.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,Q.jsx)(`span`,{className:`mt-0.5 text-destructive`,children:`■`}),(0,Q.jsx)(`span`,{children:f>0?a(`activity:sdd.stopRunAgents`,{count:f}):a(`activity:sdd.stopRun`)})]}),(0,Q.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,Q.jsx)(`span`,{className:`mt-0.5 text-destructive`,children:`■`}),(0,Q.jsx)(`span`,{children:d>0?a(`activity:sdd.removeWorktreesCount`,{count:d}):a(`activity:sdd.removeWorktreesAll`)})]}),(0,Q.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,Q.jsx)(`span`,{className:`mt-0.5 text-destructive`,children:`■`}),(0,Q.jsx)(`span`,{children:a(`activity:sdd.deleteArtifacts`)})]})]}),o>0&&(0,Q.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 rounded-md border border-warning/30 bg-warning/5 p-2.5 text-sm`,children:[(0,Q.jsx)(`input`,{type:`checkbox`,checked:c,onChange:e=>l(e.target.checked),className:`mt-0.5 h-4 w-4 accent-warning`}),(0,Q.jsxs)(`span`,{children:[(0,Q.jsx)(`span`,{className:`font-medium`,children:a(`activity:sdd.revertMerged`,{count:o})}),` `,`on `,(0,Q.jsx)(`code`,{className:`text-xs`,children:s??a(`activity:sdd.baseBranchFallback`)}),(0,Q.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:a(`activity:sdd.revertHint`)})]})]}),(0,Q.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md bg-muted/50 p-2 text-xs text-muted-foreground`,children:[(0,Q.jsx)(p,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-warning`}),a(o>0&&!c?`activity:sdd.noteLeaveMerged`:`activity:sdd.noteAbandon`)]}),(0,Q.jsxs)(H,{className:`gap-2 sm:gap-2`,children:[(0,Q.jsx)(q,{variant:`outline`,size:`sm`,disabled:r,onClick:()=>t(!1),children:a(`common:action.cancel`)}),(0,Q.jsx)(q,{size:`sm`,disabled:r,onClick:()=>i(c),className:`bg-destructive text-destructive-foreground hover:bg-destructive/90`,children:r?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(T,{className:`mr-1 h-3.5 w-3.5 animate-spin`}),` `,a(`activity:sdd.destroying`)]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(E,{className:`mr-1 h-3.5 w-3.5`}),` `,a(`activity:sdd.destroyAll`)]})})]})]})})}var be=[{key:`pending`,labelKey:`kanbanBacklog`,accent:`border-border/70`,head:`text-muted-foreground`},{key:`queued`,labelKey:`kanbanReady`,accent:`border-primary/35`,head:`text-primary`},{key:`in_progress`,labelKey:`kanbanRunning`,accent:`border-warning/45`,head:`text-warning`},{key:`review`,labelKey:`kanbanReview`,accent:`border-primary/35`,head:`text-primary`},{key:`failed`,labelKey:`kanbanFailed`,accent:`border-destructive/35`,head:`text-destructive`},{key:`completed`,labelKey:`kanbanDone`,accent:`border-success/35`,head:`text-success`}];function xe({tasks:e,selectedId:t,onTaskClick:n}){let{t:r}=m(),i=(0,Z.useMemo)(()=>{let t=new Map;for(let e of be)t.set(e.key,[]);for(let n of e){let e=n.displayStatus===`blocked`?`pending`:n.displayStatus===`cancelled`?`failed`:n.displayStatus;(t.get(e)??t.get(`pending`))?.push(n)}return t},[e]);return(0,Q.jsx)(`div`,{className:`flex h-full min-h-0 min-w-0 gap-3 overflow-x-auto p-4`,children:be.map(e=>{let a=i.get(e.key)??[];return(0,Q.jsxs)(`div`,{className:`flex min-h-0 w-64 shrink-0 flex-col`,children:[(0,Q.jsxs)(`div`,{className:L(`mb-2 flex items-center gap-2 border-b-2 pb-1.5`,e.accent),children:[(0,Q.jsx)(`span`,{className:L(`text-xs font-bold uppercase tracking-wide`,e.head),children:r(`activity:sdd.${e.labelKey}`)}),(0,Q.jsx)(`span`,{className:`rounded-full bg-muted px-1.5 text-[10px] text-muted-foreground`,children:a.length})]}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain pr-1`,children:[a.map(e=>(0,Q.jsx)(Se,{task:e,selected:e.id===t,onClick:()=>n(e.id)},e.id)),a.length===0&&(0,Q.jsx)(`div`,{className:`rounded-md border border-dashed border-border py-6 text-center text-[10px] text-muted-foreground`,children:r(`activity:sdd.kanbanEmpty`)})]})]},e.key)})})}function Se({task:e,selected:n,onClick:r}){let i=e.displayStatus===`in_progress`;return(0,Q.jsxs)(`button`,{type:`button`,onClick:r,className:L(`sdd-node-enter w-full rounded-lg border bg-card/85 p-2 text-left shadow-sm transition hover:border-primary/35 hover:bg-accent/35`,n?`border-primary/55 ring-1 ring-primary/35`:`border-border/70`,i&&`sdd-node-running`,e.displayStatus===`completed`&&`sdd-node-complete`,e.displayStatus===`failed`&&`sdd-node-failed`),children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[i&&(0,Q.jsx)(T,{className:`h-3 w-3 animate-spin text-warning`}),e.displayStatus===`completed`&&(0,Q.jsx)(t,{className:`h-3 w-3 text-success`}),e.displayStatus===`failed`&&(0,Q.jsx)(S,{className:`h-3 w-3 text-destructive`}),(0,Q.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:e.shortId}),(0,Q.jsx)(`span`,{className:L(`ml-auto rounded px-1.5 text-[9px] font-bold uppercase`,X(e.priority).chip),children:e.priority})]}),(0,Q.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[11px] leading-snug text-foreground`,children:e.title}),(e.agentName||e.worktreeBranch||e.retries)&&(0,Q.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[e.agentName&&(0,Q.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Q.jsx)(`span`,{className:L(`flex h-4 w-4 items-center justify-center rounded-full text-[8px] font-bold text-white`,i?`bg-warning sdd-agent-live`:`bg-muted-foreground`),children:fe(e.agentName)}),(0,Q.jsx)(`span`,{className:`max-w-[80px] truncate text-[10px] text-muted-foreground`,children:e.agentName})]}),e.retries?(0,Q.jsxs)(`span`,{className:`flex items-center gap-0.5 text-[9px] text-destructive`,children:[(0,Q.jsx)(A,{className:`h-2.5 w-2.5`}),e.retries]}):null,e.worktreeBranch&&(0,Q.jsx)(u,{className:`ml-auto h-2.5 w-2.5 text-muted-foreground`})]})]})}function Ce({task:e,allTasks:a,feed:s,now:c,expanded:l,modelCandidates:d,defaultModel:f,onClose:p,onToggleExpanded:h,onRetry:g,onReassign:v,onSetModel:y,onSetVerification:b,onCancel:ee,onDelete:te,onSplit:C,onSelectTask:w}){let{t:T}=m(),D=ge(e.displayStatus),O=D.icon,k=e.displayStatus===`in_progress`,ne=e.displayStatus===`pending`||e.displayStatus===`blocked`||e.displayStatus===`queued`,[re,j]=(0,Z.useState)(!1),[N,P]=(0,Z.useState)(``),[F,I]=(0,Z.useState)(null),[ie,R]=(0,Z.useState)(!1),[ae,z]=(0,Z.useState)(``),[B,V]=(0,Z.useState)(!1),[H,U]=(0,Z.useState)(e.verificationCommand??``),W=()=>{N.trim()&&(v(e.id,N.trim()),j(!1),P(``))},G=()=>{let t=ae.split(`
|
|
2
|
-
`).map(e=>e.trim()).filter(Boolean).map(e=>{let[t,...n]=e.split(`::`),r=(t??``).trim();return{title:r,description:n.join(`::`).trim()||r}}).filter(e=>e.title);t.length&&(C(e.id,t),R(!1),z(``))},K=(0,Z.useMemo)(()=>new Map(a.map(e=>[e.shortId,e])),[a]),q=(0,Z.useMemo)(()=>a.filter(t=>t.deps.includes(e.shortId)),[a,e.shortId]),oe=(0,Z.useMemo)(()=>s.filter(t=>t.taskId===e.id||t.taskShortId===e.shortId),[s,e.id,e.shortId]),ce=e.startedAt&&!e.completedAt?ue(c-e.startedAt):e.startedAt&&e.completedAt?ue(e.completedAt-e.startedAt):null;return(0,Q.jsxs)(`div`,{className:`sdd-rise flex h-full min-h-0 min-w-0 flex-col`,children:[(0,Q.jsxs)(`div`,{className:L(`flex items-center gap-2 border-b border-border/70 bg-card/70 px-3 py-2`,l&&`px-5 py-3`),children:[(0,Q.jsx)(`button`,{type:`button`,onClick:p,className:`text-muted-foreground hover:text-foreground`,title:T(`activity:sddTask.backTitle`),children:(0,Q.jsx)(M,{className:`h-4 w-4`})}),(0,Q.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.shortId}),h&&(0,Q.jsx)(`button`,{type:`button`,onClick:h,className:`ml-1 inline-flex h-7 w-7 items-center justify-center rounded-md text-muted-foreground transition hover:bg-muted hover:text-foreground`,title:T(l?`activity:sddTask.collapseTitle`:`activity:sddTask.expandTitle`),"aria-label":T(l?`activity:sddTask.collapseTitle`:`activity:sddTask.expandTitle`),"aria-pressed":l,children:l?(0,Q.jsx)(o,{className:`h-4 w-4`}):(0,Q.jsx)(x,{className:`h-4 w-4`})}),(0,Q.jsxs)(`span`,{className:L(`ml-auto flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px]`,D.ring,D.text),children:[(0,Q.jsx)(O,{className:L(`h-3 w-3`,k&&`animate-spin`)}),D.label]})]}),(0,Q.jsxs)(`div`,{className:L(`min-h-0 min-w-0 flex-1 overflow-auto overscroll-contain`,l?`grid grid-cols-2 content-start gap-4 p-5`:`space-y-3 p-3`),children:[(0,Q.jsx)(`h3`,{className:L(`text-sm font-semibold leading-snug text-foreground`,l&&`col-span-2 text-lg`),children:e.title}),e.agentName&&(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-border/70 bg-muted/45 p-2`,children:[(0,Q.jsx)(`span`,{className:L(`flex h-7 w-7 items-center justify-center rounded-full text-[10px] font-bold text-white`,k?`bg-warning sdd-agent-live`:`bg-muted-foreground`),children:fe(e.agentName)}),(0,Q.jsxs)(`div`,{className:`leading-tight`,children:[(0,Q.jsx)(`div`,{className:`text-xs font-medium text-foreground`,children:e.agentName}),(0,Q.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:T(k?`activity:sddTask.workingOn`:`activity:sddTask.assigned`)})]})]}),(0,Q.jsxs)(`div`,{className:`grid grid-cols-2 gap-1.5 text-[11px]`,children:[(0,Q.jsx)(Te,{label:T(`activity:sddTask.metaPriority`),children:(0,Q.jsx)(`span`,{className:L(`font-medium uppercase`,X(e.priority).text),children:e.priority})}),(0,Q.jsx)(Te,{label:T(`activity:sddTask.metaType`),children:e.type}),ce&&(0,Q.jsx)(Te,{label:e.completedAt?T(`activity:sddTask.metaDuration`):T(`activity:sddTask.metaElapsed`),children:(0,Q.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Q.jsx)(n,{className:`h-3 w-3 text-muted-foreground`}),ce]})}),e.retries?(0,Q.jsx)(Te,{label:T(`activity:sddTask.metaRetries`),children:(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 text-destructive`,children:[(0,Q.jsx)(A,{className:`h-3 w-3`}),e.retries]})}):null,e.worktreeBranch&&(0,Q.jsx)(Te,{label:T(`activity:sddTask.metaWorktree`),full:!0,children:(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 font-mono text-foreground`,title:e.worktreeBranch,children:[(0,Q.jsx)(u,{className:`h-3 w-3 text-muted-foreground`}),(0,Q.jsx)(`span`,{className:`truncate`,children:e.worktreeBranch})]})})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[T(`activity:sddTask.workerModel`),!e.model&&f&&(0,Q.jsxs)(`span`,{className:`font-normal normal-case text-muted-foreground`,children:[`· `,T(`activity:sddTask.runDefault`,{model:f})]})]}),(0,Q.jsx)(se,{value:e.model,provider:e.provider,candidates:d,placeholder:f?T(`activity:sddTask.runDefaultPlaceholderModel`,{model:f}):T(`activity:sddTask.runDefaultPlaceholder`),onPick:(t,n)=>y(e.id,t,n),onReset:e.model?()=>y(e.id,void 0,void 0):void 0}),e.fallbackModels&&e.fallbackModels.length>0&&(0,Q.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:e.fallbackModels.map(e=>(0,Q.jsxs)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[9px] text-muted-foreground`,children:[`↳ `,e]},e))})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[T(`activity:sddTask.verificationCmd`),(0,Q.jsxs)(`span`,{className:`font-normal normal-case text-muted-foreground`,children:[`· `,T(`activity:sddTask.gatesCompletion`)]})]}),B?(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsx)(`input`,{value:H,onChange:e=>U(e.target.value),onKeyDown:t=>{t.key===`Enter`?(b(e.id,H.trim()||void 0),V(!1)):t.key===`Escape`&&(U(e.verificationCommand??``),V(!1))},placeholder:T(`activity:sddTask.verifyPlaceholder`),className:`w-full rounded border border-border bg-background px-2 py-1 font-mono text-[11px] text-foreground`}),(0,Q.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:()=>{b(e.id,H.trim()||void 0),V(!1)},className:`rounded bg-primary px-2 py-0.5 text-[10px] text-primary-foreground hover:opacity-90`,children:T(`common:action.save`)}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>{U(e.verificationCommand??``),V(!1)},className:`rounded bg-muted px-2 py-0.5 text-[10px] text-muted-foreground hover:bg-muted/80`,children:T(`common:action.cancel`)})]})]}):e.verificationCommand?(0,Q.jsxs)(`div`,{className:`flex items-center gap-1`,children:[e.verificationState&&(0,Q.jsx)(`span`,{title:e.verificationDetail,className:e.verificationState===`passed`?`rounded bg-success/10 px-1.5 py-0.5 text-[10px] text-success`:`rounded bg-destructive/10 px-1.5 py-0.5 text-[10px] text-destructive`,children:e.verificationState===`passed`?`✓ verified`:`✗ failed`}),(0,Q.jsx)(`code`,{className:`flex-1 truncate rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-foreground`,children:e.verificationCommand}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>V(!0),className:`rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted/80`,children:T(`common:action.edit`)}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>b(e.id,void 0),className:`rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted/80`,children:T(`common:action.clear`)})]}):(0,Q.jsx)(`button`,{type:`button`,onClick:()=>V(!0),className:`rounded border border-dashed border-border px-2 py-1 text-[10px] text-muted-foreground hover:bg-muted`,children:T(`activity:sddTask.addVerify`)})]}),e.description&&(0,Q.jsxs)(`div`,{className:L(l&&`col-span-2`),children:[(0,Q.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:T(`activity:sddTask.description`)}),(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap rounded-md bg-muted p-2 text-[11px] leading-relaxed text-foreground`,children:e.description})]}),(0,Q.jsx)(we,{events:oe,expanded:l}),e.deps.length>0&&(0,Q.jsx)(Ee,{title:T(`activity:sddTask.dependsOn`),shortIds:e.deps,byShort:K,onSelectTask:w}),q.length>0&&(0,Q.jsx)(Ee,{title:T(`activity:sddTask.blocks`),shortIds:q.map(e=>e.shortId),byShort:K,onSelectTask:w})]}),(0,Q.jsxs)(`div`,{className:L(`border-t border-border p-2`,l&&`px-5 py-3`),children:[re?(0,Q.jsxs)(`div`,{className:`sdd-rise flex items-center gap-1.5`,children:[(0,Q.jsx)(`input`,{value:N,onChange:e=>P(e.target.value),onKeyDown:e=>{e.key===`Enter`&&W(),e.key===`Escape`&&j(!1)},placeholder:T(`activity:sddTask.newWorkerPlaceholder`),className:`min-w-0 flex-1 rounded-md border border-border/70 bg-background px-2 py-1.5 text-xs outline-none focus:border-primary/60`}),(0,Q.jsx)(`button`,{type:`button`,onClick:W,disabled:!N.trim(),className:`rounded-md bg-primary/10 px-2 py-1.5 text-xs font-medium text-primary hover:bg-primary/15 disabled:opacity-40`,children:(0,Q.jsx)(t,{className:`h-3.5 w-3.5`})}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>j(!1),className:`rounded-md bg-muted px-2 py-1.5 text-xs text-muted-foreground hover:bg-muted`,children:(0,Q.jsx)(S,{className:`h-3.5 w-3.5`})})]}):F?(0,Q.jsxs)(`div`,{className:`sdd-rise flex items-center gap-2`,children:[(0,Q.jsx)(`span`,{className:`flex-1 text-xs text-foreground`,children:T(F===`stop`?`activity:sddTask.confirmStop`:`activity:sddTask.confirmDelete`)}),(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>{F===`stop`?ee(e.id):te(e.id),I(null)},className:`inline-flex items-center gap-1 rounded-md bg-destructive/10 px-2.5 py-1.5 text-xs font-medium text-destructive hover:bg-destructive/15`,children:[(0,Q.jsx)(t,{className:`h-3.5 w-3.5`}),` `,T(F===`stop`?`common:action.stop`:`common:action.delete`)]}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>I(null),className:`rounded-md bg-muted px-2 py-1.5 text-xs text-muted-foreground hover:bg-muted`,children:(0,Q.jsx)(S,{className:`h-3.5 w-3.5`})})]}):(0,Q.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>g(e.id),title:T(`activity:sddTask.retryTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-warning/12 py-1.5 text-xs font-medium text-warning hover:bg-warning/18`,children:[(0,Q.jsx)(A,{className:`h-3.5 w-3.5`}),` `,T(`common:action.retry`)]}),(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>j(!0),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-primary/10 py-1.5 text-xs font-medium text-primary hover:bg-primary/15`,children:[(0,Q.jsx)(i,{className:`h-3.5 w-3.5`}),` `,T(`activity:sddTask.reassign`)]}),k&&(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>I(`stop`),title:T(`activity:sddTask.stopTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-destructive/10 py-1.5 text-xs font-medium text-destructive hover:bg-destructive/15`,children:[(0,Q.jsx)(r,{className:`h-3.5 w-3.5`}),` `,T(`common:action.stop`)]}),!k&&(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>R(!0),title:T(`activity:sddTask.splitTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-primary/10 py-1.5 text-xs font-medium text-primary hover:bg-primary/15`,children:[(0,Q.jsx)(_,{className:`h-3.5 w-3.5`}),` `,T(`activity:sddTask.split`)]}),ne&&(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>I(`delete`),title:T(`activity:sddTask.deleteTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-destructive/10 py-1.5 text-xs font-medium text-destructive hover:bg-destructive/15`,children:[(0,Q.jsx)(E,{className:`h-3.5 w-3.5`}),` `,T(`common:action.delete`)]})]}),ie&&(0,Q.jsxs)(`div`,{className:`mt-2 flex flex-col gap-2`,children:[(0,Q.jsx)(`label`,{className:`text-[11px] text-muted-foreground`,htmlFor:`sdd-split-input`,children:T(`activity:sddTask.splitHint`)}),(0,Q.jsx)(`textarea`,{id:`sdd-split-input`,rows:3,value:ae,onChange:e=>z(e.target.value),placeholder:T(`activity:sddTask.splitPlaceholder`),className:`w-full resize-y rounded-md border border-border/70 bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-ring`}),(0,Q.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:G,className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-primary/10 py-1.5 text-xs font-medium text-primary hover:bg-primary/15`,children:[(0,Q.jsx)(_,{className:`h-3.5 w-3.5`}),` `,T(`activity:sddTask.splitInto`)]}),(0,Q.jsx)(`button`,{type:`button`,onClick:()=>{R(!1),z(``)},className:`rounded-md bg-muted px-2 py-1.5 text-xs text-muted-foreground hover:bg-muted`,children:(0,Q.jsx)(S,{className:`h-3.5 w-3.5`})})]})]})]})]})}function we({events:e,expanded:t}){let{t:n}=m();return(0,Q.jsxs)(`section`,{className:L(`rounded-lg border border-border/70 bg-background/45`,t&&`col-span-2`),children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border/60 px-3 py-2.5`,children:[(0,Q.jsx)(f,{className:`h-4 w-4 text-primary`}),(0,Q.jsx)(`h4`,{className:`text-xs font-semibold text-foreground`,children:n(`activity:sddTask.eventLog`)}),(0,Q.jsx)(`span`,{className:`rounded-full bg-muted px-2 py-0.5 text-[10px] text-muted-foreground`,children:e.length}),(0,Q.jsx)(`span`,{className:`ml-auto text-[10px] text-muted-foreground`,children:n(`activity:sddTask.newestFirst`)})]}),e.length===0?(0,Q.jsx)(`p`,{className:`px-3 py-5 text-center text-[11px] text-muted-foreground`,children:n(`activity:sddTask.noEvents`)}):(0,Q.jsx)(`div`,{className:L(`divide-y divide-border/45 overflow-auto`,t?`max-h-[32rem]`:`max-h-72`),children:e.map((e,t)=>{let n=e.kind===`file`,r=e.kind===`tool`,i=e.ok===!1||e.kind===`failed`||e.kind===`verification_failed`,a=n?ee:r?d:f;return(0,Q.jsxs)(`div`,{className:L(`grid grid-cols-[4.75rem_1rem_minmax(0,1fr)] gap-2 px-3 py-2.5 text-[11px]`,i&&`bg-destructive/[0.035]`),children:[(0,Q.jsx)(`time`,{dateTime:new Date(e.ts).toISOString(),className:`font-mono text-[10px] text-muted-foreground`,title:new Date(e.ts).toLocaleString(),children:new Date(e.ts).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}),(0,Q.jsx)(a,{className:L(`mt-0.5 h-3.5 w-3.5`,i?`text-destructive`:n?`text-info`:r?`text-warning`:`text-primary`)}),(0,Q.jsxs)(`div`,{className:`min-w-0`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[e.action&&(0,Q.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] font-medium text-foreground`,children:e.action}),e.agentName&&(0,Q.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e.agentName}),e.durationMs!==void 0&&(0,Q.jsx)(`span`,{className:`text-[10px] text-muted-foreground`,children:e.durationMs<1e3?`${Math.round(e.durationMs)}ms`:`${(e.durationMs/1e3).toFixed(1)}s`})]}),e.filePath?(0,Q.jsx)(`code`,{className:`mt-1 block break-all font-mono text-[10px] leading-relaxed text-foreground`,children:e.filePath}):e.detail?(0,Q.jsx)(`code`,{className:`mt-1 block break-words font-mono text-[10px] leading-relaxed text-muted-foreground`,children:e.detail}):(0,Q.jsx)(`p`,{className:`mt-1 break-words leading-relaxed text-foreground`,children:e.text})]})]},`${e.ts}-${e.kind}-${t}`)})})]})}function Te({label:e,children:t,full:n}){return(0,Q.jsxs)(`div`,{className:L(`rounded-md border border-border bg-muted/50 px-2 py-1`,n&&`col-span-2`),children:[(0,Q.jsx)(`div`,{className:`text-[9px] uppercase tracking-wide text-muted-foreground`,children:e}),(0,Q.jsx)(`div`,{className:`text-foreground`,children:t})]})}function Ee({title:e,shortIds:t,byShort:n,onSelectTask:r}){return(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:e}),(0,Q.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:t.map(e=>{let t=n.get(e);return(0,Q.jsxs)(`button`,{type:`button`,disabled:!t,onClick:()=>t&&r(t.id),className:`flex items-center gap-1 rounded-full border border-border bg-muted px-2 py-0.5 text-[10px] text-foreground hover:bg-muted disabled:opacity-50`,title:t?.title,children:[(0,Q.jsx)(`span`,{className:L(`h-1.5 w-1.5 rounded-full`,ge(t?.displayStatus??`pending`).dot)}),(0,Q.jsx)(`span`,{className:`font-mono`,children:e})]},e)})})]})}function De({onClose:e}){let{t}=m(),{client:n}=ie(),i=R(e=>e.snapshot),o=R(e=>e.lifecycleResult),s=R(e=>e.destroying),c=R(e=>e.setDestroying),l=R(e=>e.setLifecycleResult),[u,d]=(0,Z.useState)(()=>Date.now()),[h,g]=(0,Z.useState)(null),[_,v]=(0,Z.useState)(!1),[y,b]=(0,Z.useState)(`graph`),[ee,x]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{n?.send?.({type:`sdd.board.get`})},[n]);let C=i&&(i.status===`running`||i.status===`paused`);(0,Z.useEffect)(()=>{if(!C)return;let e=setInterval(()=>d(Date.now()),1e3);return d(Date.now()),()=>clearInterval(e)},[C]);let w=(0,Z.useCallback)(e=>n?.send?.(e),[n]),T=(0,Z.useRef)(null),O=(0,Z.useCallback)(e=>{T.current=null,w({type:`sdd.board.destroy`,payload:{revertMerged:e}})},[w]),k=(0,Z.useCallback)(e=>{x(!1),l(null),c(!0),C?(w({type:`sdd.board.stop`,payload:{}}),T.current={revertMerged:e,deadline:Date.now()+2e4}):O(e)},[C,w,O,c,l]);(0,Z.useEffect)(()=>{let e=T.current;e&&(!C||Date.now()>=e.deadline)&&O(e.revertMerged)},[C,i,O]);let M=(0,Z.useCallback)(()=>{l(null),w({type:`sdd.board.cleanup_worktrees`,payload:{}})},[w,l]),N=(0,Z.useCallback)(()=>{l(null),w({type:`sdd.board.rollback`,payload:{}})},[w,l]),P=(0,Z.useMemo)(()=>(i?.tasks??[]).map(e=>({id:e.id,shortId:e.shortId,title:e.title,displayStatus:e.displayStatus,priority:e.priority,deps:e.deps,agentName:e.agentName,worktreeBranch:e.worktreeBranch})),[i?.tasks]),F=(0,Z.useMemo)(()=>{let e=new Map;for(let t of i?.tasks??[])t.displayStatus===`in_progress`&&t.agentName&&e.set(t.agentName,{name:t.agentName,task:t.title});return[...e.values()]},[i?.tasks]),z=(0,Z.useCallback)(e=>g(e),[]),B=(0,Z.useCallback)(()=>{g(null),v(!1)},[]),V=(0,Z.useCallback)(e=>w({type:`sdd.board.retry`,payload:{taskId:e}}),[w]),H=(0,Z.useCallback)(()=>w({type:`sdd.board.retry_all_failed`,payload:{}}),[w]),U=(0,Z.useCallback)((e,t)=>{let n=t.trim();n&&w({type:`sdd.board.reassign`,payload:{taskId:e,agentName:n}})},[w]),W=(0,Z.useCallback)((e,t,n)=>w({type:`sdd.board.set_task_model`,payload:{taskId:e,model:t,provider:n}}),[w]),G=(0,Z.useCallback)((e,t)=>w({type:`sdd.board.set_task_verification`,payload:{taskId:e,verificationCommand:t}}),[w]),K=(0,Z.useCallback)(e=>w({type:`sdd.board.cancel_task`,payload:{taskId:e}}),[w]),se=(0,Z.useCallback)(e=>{w({type:`sdd.board.delete_task`,payload:{taskId:e}}),g(null),v(!1)},[w]),ce=(0,Z.useCallback)((e,t)=>{w({type:`sdd.board.split_task`,payload:{taskId:e,subtasks:t}}),g(null),v(!1)},[w]),le=oe(h!==null),Y=(0,Z.useMemo)(()=>i?.tasks.find(e=>e.id===h)??null,[i?.tasks,h]),X=i?.progress,me=i?.diagnostics?.deadlockChains??[];return(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,Q.jsxs)(`header`,{className:`sdd-sheen shrink-0 border-b border-border px-4 pb-3 pt-2.5`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(f,{className:`h-5 w-5 text-warning`}),(0,Q.jsx)(`h1`,{className:`text-lg font-semibold text-foreground`,children:i?.title??t(`activity:sddBoard.titleFallback`)}),i&&(0,Q.jsx)(`span`,{className:L(`rounded-full border px-2 py-0.5 text-[11px] font-medium capitalize`,J[i.status]??J.idle),children:i.status}),i?.defaultModel&&(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 rounded-full border border-border bg-muted px-2 py-0.5 text-[10px] text-muted-foreground`,title:t(`activity:sddBoard.defaultModelTitle`),children:[(0,Q.jsx)(te,{className:`h-3 w-3 text-primary`}),i.defaultModel]})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i&&(0,Q.jsxs)(`button`,{type:`button`,title:`Open the mirrored kanban board(s) for this run (one per dependency wave)`,onClick:()=>{let e=`run:${i.runId}`,t=ae.getState().boards.filter(t=>t.tags?.includes(e)),n=t.find(e=>e.tags?.includes(`phase:wave-0`))??t[0];n&&ae.getState().setActiveBoardId(n.id),I.getState().setCurrentView(`kanban`)},className:`inline-flex items-center gap-1 rounded-md border border-border px-2.5 py-1 text-xs font-medium text-muted-foreground hover:bg-muted`,children:[(0,Q.jsx)(f,{className:`h-3.5 w-3.5`}),` Kanban`]}),i&&(0,Q.jsx)(`div`,{className:`flex items-center rounded-md border border-border bg-muted p-0.5 text-[11px]`,children:[`graph`,`kanban`].map(e=>(0,Q.jsx)(`button`,{type:`button`,onClick:()=>b(e),className:L(`rounded px-2 py-0.5 capitalize transition`,y===e?`bg-primary/12 text-primary`:`text-muted-foreground hover:text-foreground`),children:t(e===`graph`?`activity:sddBoard.graphLabel`:`activity:sddBoard.kanbanLabel`)},e))}),C&&(X?.failed??0)>0&&(0,Q.jsxs)(`button`,{type:`button`,onClick:H,title:t(`activity:sddBoard.retryAllTitle`),className:`inline-flex items-center gap-1 rounded-md bg-warning/15 px-2.5 py-1 text-xs font-medium text-warning hover:bg-warning/25`,children:[(0,Q.jsx)(A,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.retryFailed`,{count:X?.failed??0})]}),C&&(0,Q.jsxs)(Q.Fragment,{children:[i?.status===`paused`?(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>w({type:`sdd.board.resume`,payload:{}}),className:`inline-flex items-center gap-1 rounded-md bg-success/15 px-2.5 py-1 text-xs font-medium text-success hover:bg-success/25`,children:[(0,Q.jsx)(j,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.resume`)]}):(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>w({type:`sdd.board.pause`,payload:{}}),className:`inline-flex items-center gap-1 rounded-md bg-warning/15 px-2.5 py-1 text-xs font-medium text-warning hover:bg-warning/25`,children:[(0,Q.jsx)(D,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.pause`)]}),(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>w({type:`sdd.board.stop`,payload:{}}),className:`inline-flex items-center gap-1 rounded-md bg-destructive/15 px-2.5 py-1 text-xs font-medium text-destructive hover:bg-destructive/25`,children:[(0,Q.jsx)(r,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.stop`)]})]}),i&&!C&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:M,title:t(`activity:sddBoard.cleanTitle`),className:`inline-flex items-center gap-1 rounded-md bg-muted px-2.5 py-1 text-xs font-medium text-muted-foreground hover:bg-muted/80`,children:[(0,Q.jsx)(ne,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.cleanWorktrees`)]}),(i.mergedCommits?.length??0)>0&&(0,Q.jsxs)(`button`,{type:`button`,onClick:N,title:t(`activity:sddBoard.rollbackTitle`,{count:i.mergedCommits?.length??0,base:i.baseBranch??t(`activity:sdd.baseBranchFallback`)}),className:`inline-flex items-center gap-1 rounded-md bg-warning/15 px-2.5 py-1 text-xs font-medium text-warning hover:bg-warning/25`,children:[(0,Q.jsx)(a,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.rollback`,{count:i.mergedCommits?.length??0})]})]}),i&&(s?(0,Q.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md bg-destructive/15 px-2.5 py-1 text-xs font-medium text-destructive`,children:[(0,Q.jsx)(A,{className:`h-3.5 w-3.5 animate-spin`}),` `,t(C?`activity:sddBoard.stopping`:`activity:sddBoard.destroying`)]}):(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>x(!0),title:t(`activity:sddBoard.destroyTitle`),className:`inline-flex items-center gap-1 rounded-md bg-destructive px-2.5 py-1 text-xs font-medium text-destructive-foreground hover:bg-destructive/90`,children:[(0,Q.jsx)(E,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.destroy`)]})),(0,Q.jsx)(q,{variant:`ghost`,size:`icon`,onClick:e,children:(0,Q.jsx)(S,{className:`h-4 w-4`})})]})]}),i&&X&&(0,Q.jsxs)(`div`,{className:`mt-2.5 flex items-center gap-5`,children:[(0,Q.jsx)(he,{pct:X.percentComplete}),(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,Q.jsx)(Ae,{label:t(`activity:sddBoard.statDone`),value:`${X.completed}/${X.total}`,color:`text-success`}),X.inProgress>0&&(0,Q.jsx)(Ae,{label:t(`activity:sddBoard.statRunning`),value:X.inProgress,color:`text-warning`}),X.failed>0&&(0,Q.jsx)(Ae,{label:t(`activity:sddBoard.statFailed`),value:X.failed,color:`text-destructive`}),(0,Q.jsx)(Ae,{label:t(`activity:sddBoard.statWave`),value:i.wave+1,color:`text-primary`}),C&&i.startedAt>0&&(0,Q.jsx)(Ae,{label:t(`activity:sddBoard.statElapsed`),value:ue(u-i.startedAt),color:`text-foreground`})]}),(0,Q.jsx)(`div`,{className:`flex min-h-[24px] items-center gap-1.5`,children:F.length===0?(0,Q.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:t(`activity:sddBoard.noActiveWorkers`)}):F.map((e,t)=>(0,Q.jsxs)(`span`,{title:`${e.name} → ${e.task}`,className:`flex items-center gap-1 rounded-full bg-muted py-0.5 pl-0.5 pr-2`,children:[(0,Q.jsx)(`span`,{className:L(`sdd-agent-live flex h-5 w-5 items-center justify-center rounded-full text-[9px] font-bold text-white`,pe[t%pe.length]),children:fe(e.name)}),(0,Q.jsx)(`span`,{className:`max-w-[90px] truncate text-[11px] text-foreground`,children:e.name})]},e.name))})]})]})]}),o&&(0,Q.jsx)(ke,{result:o,onDismiss:()=>l(null)}),me.length>0&&(0,Q.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-destructive/30 bg-destructive/5 px-4 py-2 text-xs text-destructive`,children:[(0,Q.jsx)(p,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`div`,{className:`font-semibold`,children:t(`activity:sddBoard.deadlock`)}),me.map(e=>(0,Q.jsxs)(`div`,{className:`font-mono`,children:[e.blocked,` ← `,e.blockedBy.join(`, `)]},e.blocked))]})]}),(0,Q.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1`,children:[(0,Q.jsx)(`div`,{className:`relative min-h-0 min-w-0 flex-1 overflow-hidden`,children:i?y===`graph`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(de,{tasks:P,columns:i.columns,onTaskClick:z}),(0,Q.jsx)(`div`,{className:`pointer-events-none absolute bottom-2 left-1/2 -translate-x-1/2 rounded-full bg-black/40 px-2 py-0.5 text-[10px] text-muted-foreground backdrop-blur`,children:t(`activity:sddBoard.clickTaskHint`)})]}):(0,Q.jsx)(xe,{tasks:i.tasks,selectedId:h,onTaskClick:z}):(0,Q.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 text-sm text-muted-foreground`,children:[(0,Q.jsx)(re,{className:`h-10 w-10 text-primary/40`}),(0,Q.jsx)(`p`,{className:`text-foreground`,children:t(`activity:sddBoard.noRunTitle`)}),(0,Q.jsx)(`p`,{className:`max-w-sm text-center text-xs text-muted-foreground`,children:t(`activity:sddBoard.noRunBody`)})]})}),i&&(0,Q.jsx)(`aside`,{"data-testid":`sdd-task-panel`,"data-expanded":_&&Y?`true`:`false`,className:L(`shrink-0 border-l border-border bg-card transition-[width] duration-200 ease-out`,_&&Y?`w-[min(72rem,72vw)]`:`w-80`),children:Y?(0,Q.jsx)(Ce,{task:Y,allTasks:i.tasks,feed:i.taskEvents?.[Y.id]??i.feed??[],now:u,expanded:_,modelCandidates:le,defaultModel:i.defaultModel,onClose:B,onToggleExpanded:()=>v(e=>!e),onRetry:V,onReassign:U,onSetModel:W,onSetVerification:G,onCancel:K,onDelete:se,onSplit:ce,onSelectTask:g},Y.id):(0,Q.jsx)(ve,{feed:i.feed??[],now:u})})]}),(0,Q.jsx)(ye,{open:ee,onOpenChange:x,snapshot:i,busy:s,onConfirm:k})]})}function Oe(e){let t=e.op===`cleanup_worktrees`?`lcClean`:e.op===`rollback`?`lcRollback`:`lcDestroy`,n=l.t(`activity:sddBoard.${t}`);if(!e.ok)return l.t(`activity:sddBoard.lcFailed`,{op:n,reason:e.reason??l.t(`activity:sddBoard.lcUnknownError`)});let r=[];typeof e.removed==`number`&&r.push(l.t(`activity:sddBoard.lcWorktrees`,{count:e.removed})),typeof e.reverted==`number`&&e.reverted>0&&r.push(l.t(`activity:sddBoard.lcCommits`,{count:e.reverted})),e.deleted?.length&&r.push(l.t(`activity:sddBoard.lcDeleted`,{items:e.deleted.join(`, `)}));let i=r.length?r.join(` · `):l.t(`activity:sddBoard.lcNothing`);return e.reason?l.t(`activity:sddBoard.lcNote`,{op:n,body:i,reason:e.reason}):l.t(`activity:sddBoard.lcOk`,{op:n,body:i})}function ke({result:e,onDismiss:t}){let n=!e.ok||!!e.reason;return(0,Q.jsxs)(`div`,{className:L(`flex items-start gap-2 border-b px-4 py-2 text-xs`,n?`border-warning/30 bg-warning/5 text-warning`:`border-success/30 bg-success/5 text-success`),children:[n?(0,Q.jsx)(c,{className:`mt-0.5 h-4 w-4 shrink-0`}):(0,Q.jsx)(v,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,Q.jsx)(`span`,{className:`flex-1`,children:Oe(e)}),(0,Q.jsx)(`button`,{type:`button`,onClick:t,className:`shrink-0 opacity-60 hover:opacity-100`,children:(0,Q.jsx)(S,{className:`h-3.5 w-3.5`})})]})}function Ae({label:e,value:t,color:n}){return(0,Q.jsxs)(`span`,{className:`flex items-baseline gap-1`,children:[(0,Q.jsx)(`span`,{className:L(`font-semibold tabular-nums`,n),children:t}),(0,Q.jsx)(`span`,{className:`text-[10px] uppercase tracking-wide text-muted-foreground`,children:e})]})}var je={idle:`phaseStart`,questioning:`phaseInterview`,spec_review:`phaseSpecReview`,implementation:`phasePlanning`,task_review:`phaseTaskReview`,executing:`phaseRunning`,done:`phaseDone`},Me=[`questioning`,`spec_review`,`implementation`,`task_review`,`executing`];function Ne({onClose:e,onRunStarted:n}){let{t:r}=m(),{client:i}=ie(),a=z(e=>e.snapshot),o=z(e=>e.agentText),c=z(e=>e.error),l=z(e=>e.startedRunId),u=z(e=>e.setStartedRunId),[d,f]=(0,Z.useState)(``),[p,_]=(0,Z.useState)(``),[v,ee]=(0,Z.useState)(!1),[x,te]=(0,Z.useState)(!0),[E,D]=(0,Z.useState)(!0),[O,k]=(0,Z.useState)(!1),[A,ne]=(0,Z.useState)(void 0),[re,j]=(0,Z.useState)(void 0),[M,N]=(0,Z.useState)([]),[P,I]=(0,Z.useState)(4),[R,ae]=(0,Z.useState)(!0),[B,V]=(0,Z.useState)(!1),H=oe(O),U=(0,Z.useCallback)(e=>i?.send?.(e),[i]),W=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{U({type:`sdd.spec.get`})},[U]),(0,Z.useEffect)(()=>{W.current?.scrollIntoView({behavior:`smooth`,block:`end`})},[a?.answers.length??0,o]),(0,Z.useEffect)(()=>{l&&(u(null),n?.())},[n,u,l]);let G=a?.busy??!1,K=a?.phase??`idle`,J=!!a?.sessionId,ue=!!a?.resumed,Y=a?.lastRunId;(0,Z.useEffect)(()=>{J&&ee(!1)},[J]);let fe=a?.answers[a.answers.length-1]?.question??``,pe=!!a&&(a.taskCount>0||!!a.graphId||K===`task_review`||K===`executing`),me=()=>{let e=d.trim();!e||G||v||(ee(!0),U({type:`sdd.spec.start`,payload:{goal:e}}))},he=()=>{let e=p.trim();!e||G||(U({type:`sdd.spec.message`,payload:{text:e}}),_(``))},ge=()=>!G&&U({type:`sdd.spec.approve`,payload:{}}),_e=()=>{U({type:`sdd.run.start`,payload:{parallelSlots:P,worktrees:R,planDecompose:B,...A?{model:A,provider:re}:{},...M.length?{fallbackModels:M}:{}}}),k(!1)},ve=()=>{G||U({type:`sdd.spec.discard`,payload:{}})},ye=(0,Z.useMemo)(()=>(a?.board?.tasks??[]).map(e=>({id:e.id,shortId:e.shortId,title:e.title,displayStatus:e.displayStatus,priority:e.priority,deps:e.deps,agentName:e.agentName,worktreeBranch:e.worktreeBranch,retries:e.retries})),[a?.board]),be=ye.length>0;return(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,Q.jsxs)(`header`,{className:`sdd-sheen flex shrink-0 items-center justify-between border-b border-border px-4 py-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(y,{className:`h-5 w-5 text-primary`}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h1`,{className:`text-lg font-semibold`,children:a?.title||r(`activity:sddWizard.titleFallback`)}),J&&(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[r(`activity:sddWizard.${je[K]??`phaseStart`}`),K===`questioning`&&` · ${r(`activity:sddWizard.questionsSuffix`,{cur:a?.questionCount??0,max:a?.maxQuestions??0})}`,a&&a.taskCount>0?` · ${r(`activity:sddWizard.tasksSuffix`,{count:a.taskCount})}`:``]})]}),G&&(0,Q.jsx)(T,{className:`h-4 w-4 animate-spin text-muted-foreground`})]}),(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[Y&&(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>n?.(),className:`inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-xs font-medium text-muted-foreground hover:bg-muted`,children:[(0,Q.jsx)(C,{className:`h-3.5 w-3.5`}),` `,r(`activity:sddWizard.openLiveBoard`)]}),J&&(0,Q.jsx)(`button`,{type:`button`,onClick:ve,disabled:G,title:r(`activity:sddWizard.discardTitle`),className:`inline-flex items-center gap-1 rounded-md border border-border px-2 py-1 text-xs font-medium text-muted-foreground hover:bg-destructive/10 hover:text-destructive disabled:opacity-50`,children:r(`activity:sddWizard.discardInterview`)}),pe&&(0,Q.jsxs)(`div`,{className:`relative flex items-center gap-1.5`,children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>k(e=>!e),title:r(`activity:sddWizard.runCfgTitle`),className:L(`inline-flex items-center gap-1 rounded-md border px-2 py-1 text-xs font-medium`,A||M.length||B?`border-primary/40 bg-primary/10 text-primary`:`border-border bg-muted text-muted-foreground hover:text-foreground`),children:[(0,Q.jsx)(s,{className:`h-3.5 w-3.5`}),A||r(`activity:sddWizard.modelsLabel`)]}),(0,Q.jsxs)(`button`,{type:`button`,onClick:_e,className:`inline-flex items-center gap-1 rounded-md bg-success/15 px-2.5 py-1 text-xs font-medium text-success hover:bg-success/25`,children:[(0,Q.jsx)(C,{className:`h-3.5 w-3.5`}),` `,r(`activity:sddWizard.startRun`)]}),O&&(0,Q.jsxs)(`div`,{className:`sdd-rise absolute right-0 top-9 z-50 w-72 rounded-lg border border-border bg-popover p-3 shadow-xl`,children:[(0,Q.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:r(`activity:sddWizard.defaultWorkerModel`)}),(0,Q.jsx)(se,{value:A,provider:re,candidates:H,placeholder:r(`activity:sddWizard.leaderDefaultPlaceholder`),resetLabel:r(`activity:sddWizard.useSessionDefault`),onPick:(e,t)=>{ne(e),j(t)},onReset:A?()=>{ne(void 0),j(void 0)}:void 0}),(0,Q.jsx)(`div`,{className:`mb-1 mt-3 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:r(`activity:sddWizard.fallbackChain`)}),(0,Q.jsx)(le,{value:M,candidates:H,onChange:N}),(0,Q.jsx)(`p`,{className:`mt-2 text-[10px] text-muted-foreground`,children:r(`activity:sddWizard.appliesToAll`)}),(0,Q.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-2`,children:[(0,Q.jsx)(`label`,{htmlFor:`sdd-slots`,className:`text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:r(`activity:sddWizard.parallelAgents`)}),(0,Q.jsx)(`input`,{id:`sdd-slots`,type:`number`,min:1,max:16,value:P,onChange:e=>{let t=Number.parseInt(e.target.value,10);I(Number.isFinite(t)?Math.min(16,Math.max(1,t)):1)},className:`w-16 rounded-md border border-border bg-background px-2 py-1 text-right text-xs outline-none focus:border-primary`})]}),(0,Q.jsxs)(`label`,{className:`mt-2 flex cursor-pointer items-center justify-between gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:r(`activity:sddWizard.isolateWorktrees`)}),(0,Q.jsx)(`input`,{type:`checkbox`,checked:R,onChange:e=>ae(e.target.checked),className:`h-3.5 w-3.5 accent-primary`})]}),(0,Q.jsx)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:r(R?`activity:sddWizard.worktreeOn`:`activity:sddWizard.worktreeOff`)}),(0,Q.jsxs)(`label`,{className:`mt-2 flex cursor-pointer items-center justify-between gap-2`,children:[(0,Q.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:r(`activity:sddWizard.planDecompose`)}),(0,Q.jsx)(`input`,{type:`checkbox`,checked:B,onChange:e=>V(e.target.checked),className:`h-3.5 w-3.5 accent-primary`})]}),(0,Q.jsx)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:r(B?`activity:sddWizard.planDecomposeOn`:`activity:sddWizard.planDecomposeOff`)})]})]}),(0,Q.jsx)(q,{variant:`ghost`,size:`icon`,onClick:e,children:(0,Q.jsx)(S,{className:`h-4 w-4`})})]})]}),J&&(0,Q.jsx)(`div`,{className:`flex shrink-0 items-center gap-1 border-b bg-card/50 px-4 py-1.5 text-[11px]`,children:Me.map((e,n)=>{let i=e===K,a=Me.indexOf(K)>n;return(0,Q.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Q.jsxs)(`span`,{className:L(`rounded-full px-2 py-0.5`,i?`bg-primary/15 text-primary`:a?`text-success`:`text-muted-foreground`),children:[a&&(0,Q.jsx)(t,{className:`mr-0.5 inline h-3 w-3`}),r(`activity:sddWizard.${je[e]}`)]}),n<Me.length-1&&(0,Q.jsx)(`span`,{className:`text-muted-foreground/65`,children:`→`})]},e)})}),(0,Q.jsxs)(`div`,{ref:ce(`sdd-wizard`),className:`min-h-0 flex-1 overflow-auto overscroll-contain p-4`,children:[c&&(0,Q.jsx)(`div`,{className:`mb-3 rounded-md border border-destructive/40 bg-destructive/5 p-2 text-xs text-destructive`,children:c}),ue&&J&&(0,Q.jsx)(`div`,{className:`mb-3 rounded-md border border-primary/30 bg-primary/5 px-3 py-2 text-xs text-primary`,children:r(`activity:sddWizard.resumeBanner`)}),J?(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[be&&(0,Q.jsxs)(`div`,{className:`sdd-rise overflow-hidden rounded-lg border border-primary/20 bg-[hsl(var(--surface-2)/0.85)]`,children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>te(e=>!e),className:`flex w-full items-center gap-1.5 border-b border-border/60 px-3 py-1.5 text-[11px] font-medium text-primary hover:bg-muted/40`,children:[x?(0,Q.jsx)(g,{className:`h-3.5 w-3.5`}):(0,Q.jsx)(b,{className:`h-3.5 w-3.5`}),(0,Q.jsx)(F,{className:`h-3.5 w-3.5`}),r(`activity:sddWizard.taskGraphSummary`,{count:a?.taskCount??0}),(0,Q.jsx)(`span`,{className:`ml-auto text-muted-foreground`,children:r(x?`activity:sddWizard.dragToExplore`:`activity:sddWizard.show`)})]}),x&&(0,Q.jsx)(`div`,{className:`h-[32dvh] min-h-[200px]`,children:(0,Q.jsx)(de,{tasks:ye,columns:a?.board?.columns??[]})})]}),(0,Q.jsxs)(`div`,{className:`mx-auto max-w-2xl space-y-3`,children:[a?.goal&&(0,Q.jsxs)(`div`,{className:`rounded-md border border-border bg-muted/30 px-3 py-2`,children:[(0,Q.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,Q.jsx)(h,{className:`h-3 w-3`}),` `,r(`activity:sddWizard.goalLabel`)]}),(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:a.goal})]}),a?.answers.length||o&&K===`questioning`||G?(0,Q.jsxs)(`div`,{className:`space-y-2.5`,children:[a?.answers.map(e=>(0,Q.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,Q.jsx)(Fe,{speaker:`assistant`,text:e.question}),(0,Q.jsx)(Fe,{speaker:`user`,text:e.answer})]},e.question.slice(0,64))),o&&K===`questioning`&&o!==fe&&(0,Q.jsx)(Fe,{speaker:`assistant`,text:o}),G&&(0,Q.jsx)(Fe,{speaker:`assistant`,text:``,thinking:!0})]}):null,a?.spec&&(0,Q.jsxs)(`div`,{className:`sdd-rise rounded-md border border-border bg-card p-3`,children:[(0,Q.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-sm font-semibold`,children:[(0,Q.jsx)(y,{className:`h-3.5 w-3.5 text-primary`}),a.spec.title]}),(0,Q.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:a.spec.overview}),(0,Q.jsx)(`ul`,{className:`space-y-0.5 text-xs`,children:a.spec.requirements.map(e=>(0,Q.jsxs)(`li`,{className:`flex gap-1.5`,children:[(0,Q.jsx)(`span`,{className:L(`shrink-0 font-mono uppercase`,X(e.priority).text),children:e.priority[0]}),(0,Q.jsx)(`span`,{children:e.description})]},`${e.priority}-${e.description.slice(0,32)}`))})]}),o&&(K===`implementation`||K===`task_review`)&&(0,Q.jsxs)(`div`,{className:`sdd-rise rounded-md border border-border bg-card`,children:[(0,Q.jsxs)(`button`,{type:`button`,onClick:()=>D(e=>!e),className:`flex w-full items-center gap-1.5 border-b border-border/60 px-3 py-2 text-sm font-semibold hover:bg-muted/40`,children:[E?(0,Q.jsx)(g,{className:`h-3.5 w-3.5`}):(0,Q.jsx)(b,{className:`h-3.5 w-3.5`}),(0,Q.jsx)(y,{className:`h-3.5 w-3.5 text-primary`}),` `,r(`activity:sddWizard.implementationPlan`)]}),E&&(0,Q.jsx)(`div`,{className:`max-h-[40dvh] overflow-auto px-3 py-2`,children:(0,Q.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:Pe(o)})})]}),o&&K!==`questioning`&&K!==`implementation`&&K!==`task_review`&&!a?.spec&&(0,Q.jsx)(Fe,{speaker:`assistant`,text:o}),(K===`spec_review`||K===`implementation`||K===`task_review`)&&(0,Q.jsxs)(q,{variant:`secondary`,onClick:ge,disabled:G,children:[(0,Q.jsx)(t,{className:`mr-1.5 h-4 w-4`}),r(K===`spec_review`?`activity:sddWizard.approveSpec`:K===`task_review`?`activity:sddWizard.approveTasks`:`activity:sddWizard.approvePlan`)]}),(0,Q.jsx)(`div`,{ref:W})]})]}):(0,Q.jsxs)(`div`,{className:`mx-auto mt-8 max-w-xl`,children:[(0,Q.jsx)(`label`,{className:`mb-2 block text-sm font-medium`,htmlFor:`sdd-goal`,children:r(`activity:sddWizard.goalPrompt`)}),(0,Q.jsx)(`textarea`,{id:`sdd-goal`,value:d,onChange:e=>f(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&me()},rows:4,placeholder:r(`activity:sddWizard.goalPlaceholder`),className:`w-full resize-none rounded-md border border-border bg-card px-3 py-2 text-sm outline-none focus:border-primary`}),(0,Q.jsx)(q,{className:`mt-3`,onClick:me,disabled:!d.trim()||v,children:v?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(T,{className:`mr-1.5 h-4 w-4 animate-spin`}),` `,r(`activity:sddWizard.startingInterview`)]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(y,{className:`mr-1.5 h-4 w-4`}),` `,r(`activity:sddWizard.startInterview`)]})}),(0,Q.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:r(`activity:sddWizard.introBody`)})]})]}),J&&K!==`executing`&&K!==`done`&&(0,Q.jsxs)(`div`,{className:`flex shrink-0 items-end gap-2 border-t bg-card px-4 py-2`,children:[(0,Q.jsx)(`textarea`,{value:p,onChange:e=>_(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),he())},rows:1,placeholder:r(K===`questioning`?`activity:sddWizard.answerPlaceholder`:`activity:sddWizard.changePlaceholder`),disabled:G,className:`max-h-32 flex-1 resize-none rounded-md border border-border bg-background px-3 py-2 text-sm outline-none focus:border-primary disabled:opacity-50`}),(0,Q.jsx)(q,{size:`icon`,onClick:he,disabled:G||!p.trim(),children:(0,Q.jsx)(w,{className:`h-4 w-4`})})]})]})}function Pe(e){let t=e.replace(/```json[\s\S]*?```/gi,``).trim();return t.length>0?t:e.trim()}function Fe({speaker:e,text:t,live:n,thinking:r}){let i=e===`user`;return(0,Q.jsxs)(`div`,{className:L(`sdd-rise flex items-start gap-2`,i&&`flex-row-reverse`),children:[(0,Q.jsx)(`span`,{className:L(`mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full`,i?`bg-info/15 text-info`:`bg-primary/15 text-primary`,(n||r)&&`sdd-agent-live`),children:i?(0,Q.jsx)(N,{className:`h-3.5 w-3.5`}):(0,Q.jsx)(O,{className:`h-3.5 w-3.5`})}),(0,Q.jsx)(`div`,{className:L(`max-w-[80%] whitespace-pre-wrap rounded-2xl px-3 py-2 text-sm leading-relaxed text-foreground`,i?`rounded-tr-sm bg-info/10`:`rounded-tl-sm bg-muted`),children:r?(0,Q.jsxs)(`span`,{className:`flex items-center gap-1 py-0.5`,children:[(0,Q.jsx)(`span`,{className:`h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-200ms]`}),(0,Q.jsx)(`span`,{className:`h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-100ms]`}),(0,Q.jsx)(`span`,{className:`h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground`})]}):t})]})}var $=[{id:`project`,labelKey:`activity:sddhub.tabProject`},{id:`board`,labelKey:`activity:sddhub.tabBoard`},{id:`specs`,labelKey:`activity:sddhub.tabSpecs`}];function Ie(){let{t:e}=m(),[t,n]=(0,Z.useState)(`project`),r=z(e=>e.startedRunId),i=z(e=>e.setStartedRunId),a=()=>B(`chat`),o=(0,Z.useCallback)(()=>n(`board`),[]);(0,Z.useEffect)(()=>{r&&(n(`board`),i(null))},[r,i]);let s=(e,t)=>{let r;if(e.key===`ArrowLeft`&&(r=(t-1+$.length)%$.length),e.key===`ArrowRight`&&(r=(t+1)%$.length),e.key===`Home`&&(r=0),e.key===`End`&&(r=$.length-1),r===void 0)return;e.preventDefault();let i=$[r];i&&(n(i.id),e.currentTarget.parentElement?.querySelectorAll(`[role="tab"]`)[r]?.focus())};return(0,Q.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,Q.jsx)(`div`,{role:`tablist`,"aria-orientation":`horizontal`,className:`flex shrink-0 items-end border-b border-border/70 bg-card px-4`,children:$.map((r,i)=>{let a=t===r.id;return(0,Q.jsxs)(`button`,{id:`sdd-hub-tab-${r.id}`,type:`button`,role:`tab`,"aria-selected":a,"aria-controls":`sdd-hub-panel-${r.id}`,tabIndex:a?0:-1,onClick:()=>n(r.id),onKeyDown:e=>s(e,i),className:L(`relative px-4 py-2.5 text-sm font-medium transition-colors`,a?`text-foreground`:`text-muted-foreground hover:text-foreground`),children:[e(r.labelKey),a&&(0,Q.jsx)(`span`,{"aria-hidden":`true`,className:`absolute bottom-0 left-0 right-0 h-0.5 bg-primary`})]},r.id)})}),(0,Q.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:[(0,Q.jsx)(`div`,{id:`sdd-hub-panel-project`,role:`tabpanel`,"aria-labelledby":`sdd-hub-tab-project`,hidden:t!==`project`,className:`h-full overflow-y-auto overscroll-contain`,children:(0,Q.jsx)(Ne,{onClose:a,onRunStarted:o})}),(0,Q.jsx)(`div`,{id:`sdd-hub-panel-board`,role:`tabpanel`,"aria-labelledby":`sdd-hub-tab-board`,hidden:t!==`board`,className:`h-full overflow-y-auto overscroll-contain`,children:(0,Q.jsx)(De,{onClose:a})}),(0,Q.jsx)(`div`,{id:`sdd-hub-panel-specs`,role:`tabpanel`,"aria-labelledby":`sdd-hub-tab-specs`,hidden:t!==`specs`,className:`h-full overflow-y-auto overscroll-contain`,children:(0,Q.jsx)(_e,{onClose:a,onRunStarted:o})})]})]})}export{Ie as SddHub};
|