opencroc 1.8.0 → 1.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +1107 -49
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +128 -1
- package/dist/index.js +548 -0
- package/dist/index.js.map +1 -1
- package/dist/web/dist/assets/main-Ccg3eDNK.js +1 -0
- package/dist/web/dist/assets/office-runtime-B3iNctxE.css +1 -0
- package/dist/web/dist/assets/office-runtime-BsCh82Pj.js +183 -0
- package/dist/web/dist/assets/pixel-page-3BYGm7dH.js +470 -0
- package/dist/web/dist/assets/react-vendor-C8RhVn0h.js +49 -0
- package/dist/web/dist/assets/studio-page-BInoyoV2.css +1 -0
- package/dist/web/dist/assets/studio-page-o3SCvE_v.js +351 -0
- package/dist/web/dist/assets/three-addons-BdrPp04O.js +470 -0
- package/dist/web/dist/assets/three-core-CsxM1PCY.js +4057 -0
- package/dist/web/dist/index.html +15 -0
- package/dist/web/index.html +11 -572
- package/dist/web/public/botreview/char_0.png +0 -0
- package/dist/web/public/botreview/char_1.png +0 -0
- package/dist/web/public/botreview/char_2.png +0 -0
- package/dist/web/public/botreview/coffee-machine.gif +0 -0
- package/dist/web/public/botreview/server.gif +0 -0
- package/dist/web/public/botreview/walls.png +0 -0
- package/dist/web/public/star/desk-v3.webp +0 -0
- package/dist/web/public/star/office_bg_small.webp +0 -0
- package/dist/web/public/star/star-idle-v5.png +0 -0
- package/dist/web/public/star/star-working-spritesheet-grid.webp +0 -0
- package/dist/web/src/app/AppLayout.tsx +34 -0
- package/dist/web/src/app/AppRouter.tsx +46 -0
- package/dist/web/src/app/bootstrap.tsx +22 -0
- package/dist/web/src/app/routes.tsx +52 -0
- package/dist/web/src/features/office/runtime/index.ts +1 -0
- package/dist/web/src/features/office/runtime/mount.ts +809 -0
- package/dist/web/src/features/pixel/runtime/index.ts +1 -0
- package/dist/web/src/features/pixel/runtime/mount.ts +728 -0
- package/dist/web/src/features/studio/runtime/index.ts +1 -0
- package/dist/web/src/features/studio/runtime/mount.ts +664 -0
- package/dist/web/src/features/three/engine/index.ts +1 -0
- package/dist/web/src/main.tsx +7 -0
- package/dist/web/src/pages/office/index.ts +1 -0
- package/dist/web/src/pages/office/page.tsx +283 -0
- package/dist/web/src/pages/pixel/index.ts +1 -0
- package/dist/web/src/pages/pixel/page.tsx +564 -0
- package/dist/web/src/pages/studio/index.ts +1 -0
- package/dist/web/src/pages/studio/page.tsx +446 -0
- package/dist/web/{js/agents.js → src/runtime/agents.ts} +304 -31
- package/dist/web/{js/camera.js → src/runtime/camera.ts} +12 -5
- package/dist/web/{js/dataviz.js → src/runtime/dataviz.ts} +38 -14
- package/dist/web/{js/effects.js → src/runtime/effects.ts} +139 -2
- package/dist/web/{js/engine.js → src/runtime/engine.ts} +45 -6
- package/dist/web/{js/office.js → src/runtime/office.ts} +136 -20
- package/dist/web/{js/ui.js → src/runtime/ui.ts} +11 -7
- package/dist/web/src/shared/assets.ts +4 -0
- package/dist/web/src/shared/navigation.ts +47 -0
- package/dist/web/src/styles/app-layout.css +19 -0
- package/dist/web/src/styles/office.css +268 -0
- package/dist/web/tsconfig.json +28 -0
- package/dist/web/vite.config.ts +93 -0
- package/package.json +11 -2
- package/dist/web/index-studio.html +0 -804
- package/dist/web/index-v2-pixel.html +0 -1571
- /package/dist/web/{assets → dist}/botreview/char_0.png +0 -0
- /package/dist/web/{assets → dist}/botreview/char_1.png +0 -0
- /package/dist/web/{assets → dist}/botreview/char_2.png +0 -0
- /package/dist/web/{assets → dist}/botreview/coffee-machine.gif +0 -0
- /package/dist/web/{assets → dist}/botreview/server.gif +0 -0
- /package/dist/web/{assets → dist}/botreview/walls.png +0 -0
- /package/dist/web/{assets → dist}/star/desk-v3.webp +0 -0
- /package/dist/web/{assets → dist}/star/office_bg_small.webp +0 -0
- /package/dist/web/{assets → dist}/star/star-idle-v5.png +0 -0
- /package/dist/web/{assets → dist}/star/star-working-spritesheet-grid.webp +0 -0
- /package/dist/web/{js/state.js → src/runtime/state.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c,j as u}from"./react-vendor-C8RhVn0h.js";import{A as f}from"./studio-page-o3SCvE_v.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))o(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const i of r.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&o(i)}).observe(document,{childList:!0,subtree:!0});function s(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerPolicy&&(r.referrerPolicy=e.referrerPolicy),e.crossOrigin==="use-credentials"?r.credentials="include":e.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function o(e){if(e.ep)return;e.ep=!0;const r=s(e);fetch(e.href,r)}})();function l({app:n,missingMessage:t,containerId:s="root"}){const o=document.getElementById(s);if(!o)throw new Error(t);c.createRoot(o).render(n)}l({app:u.jsx(f,{}),missingMessage:"Missing #root container for OpenCroc Studio."});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html,body{width:100%;height:100%;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Noto Sans SC,Helvetica Neue,Arial,sans-serif}body{background:#000;color:var(--text)}#root{width:100%;height:100%}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--text-subtle);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--text-dim)}::selection{background:var(--accent);color:#000}:root{--bg-void:#050510;--bg-deep:#0a0f1e;--bg-panel:rgba(12,18,36,.75);--bg-panel-solid:#0c1224;--bg-card:rgba(18,26,50,.6);--bg-hover:rgba(30,42,72,.5);--bg-glass:rgba(15,22,42,.55);--bg-glass-strong:rgba(15,22,42,.8);--bg-frosted:rgba(20,28,52,.45);--bg-input:rgba(15,22,44,.6);--accent:#34d399;--accent-rgb:52,211,153;--accent-dim:#059669;--accent-glow:rgba(52,211,153,.4);--accent-bg:rgba(52,211,153,.1);--red:#f87171;--red-rgb:248,113,113;--red-glow:rgba(248,113,113,.35);--red-bg:rgba(248,113,113,.1);--orange:#fbbf24;--orange-rgb:251,191,36;--orange-glow:rgba(251,191,36,.35);--orange-bg:rgba(251,191,36,.1);--blue:#60a5fa;--blue-rgb:96,165,250;--blue-glow:rgba(96,165,250,.35);--blue-bg:rgba(96,165,250,.1);--purple:#a78bfa;--purple-rgb:167,139,250;--purple-glow:rgba(167,139,250,.35);--purple-bg:rgba(167,139,250,.1);--cyan:#22d3ee;--cyan-rgb:34,211,238;--cyan-glow:rgba(34,211,238,.35);--cyan-bg:rgba(34,211,238,.1);--pink:#f472b6;--pink-rgb:244,114,182;--text:#f1f5f9;--text-dim:#94a3b8;--text-subtle:#4a5568;--text-muted:#2d3748;--border:rgba(148,163,184,.12);--border-accent:rgba(52,211,153,.25);--border-glass:rgba(255,255,255,.06);--shadow-xl:0 25px 50px -12px rgba(0,0,0,.6);--shadow-lg:0 20px 40px rgba(0,0,0,.4);--shadow-md:0 8px 24px rgba(0,0,0,.3);--shadow-sm:0 2px 8px rgba(0,0,0,.2);--shadow-glow:0 0 30px rgba(52,211,153,.15);--shadow-inset:inset 0 1px 0 rgba(255,255,255,.05);--blur-lg:blur(24px);--blur-md:blur(16px);--blur-sm:blur(8px);--blur-xs:blur(4px);--radius-xl:20px;--radius-lg:14px;--radius-md:10px;--radius-sm:6px;--radius-xs:4px;--radius-full:9999px;--ease-out-expo:cubic-bezier(.16,1,.3,1);--ease-spring:cubic-bezier(.175,.885,.32,1.275);--transition-fast:.15s var(--ease-out-expo);--transition:.25s var(--ease-out-expo);--transition-slow:.4s var(--ease-out-expo);--transition-spring:.5s var(--ease-spring);--z-canvas:0;--z-overlay:10;--z-panel:20;--z-header:30;--z-modal:40;--z-tooltip:50;--z-notify:60}[data-theme=light]{--bg-void:#e8ecf4;--bg-deep:#f0f4fa;--bg-panel:rgba(255,255,255,.78);--bg-panel-solid:#ffffff;--bg-card:rgba(248,250,255,.7);--bg-hover:rgba(226,232,240,.6);--bg-glass:rgba(255,255,255,.6);--bg-glass-strong:rgba(255,255,255,.85);--bg-frosted:rgba(255,255,255,.5);--bg-input:rgba(241,245,249,.8);--accent:#059669;--accent-rgb:5,150,105;--accent-dim:#047857;--accent-glow:rgba(5,150,105,.25);--accent-bg:rgba(5,150,105,.08);--red:#dc2626;--red-rgb:220,38,38;--red-glow:rgba(220,38,38,.2);--red-bg:rgba(220,38,38,.06);--orange:#d97706;--orange-rgb:217,119,6;--orange-glow:rgba(217,119,6,.2);--orange-bg:rgba(217,119,6,.06);--blue:#2563eb;--blue-rgb:37,99,235;--blue-glow:rgba(37,99,235,.2);--blue-bg:rgba(37,99,235,.06);--purple:#7c3aed;--purple-rgb:124,58,237;--purple-glow:rgba(124,58,237,.2);--purple-bg:rgba(124,58,237,.06);--cyan:#0891b2;--cyan-rgb:8,145,178;--cyan-glow:rgba(8,145,178,.2);--cyan-bg:rgba(8,145,178,.06);--pink:#db2777;--pink-rgb:219,39,119;--text:#0f172a;--text-dim:#475569;--text-subtle:#94a3b8;--text-muted:#cbd5e1;--border:rgba(100,116,139,.15);--border-accent:rgba(5,150,105,.3);--border-glass:rgba(0,0,0,.04);--shadow-xl:0 25px 50px -12px rgba(0,0,0,.12);--shadow-lg:0 20px 40px rgba(0,0,0,.06);--shadow-md:0 8px 24px rgba(0,0,0,.05);--shadow-sm:0 2px 8px rgba(0,0,0,.03);--shadow-glow:0 0 30px rgba(5,150,105,.08);--shadow-inset:inset 0 1px 0 rgba(255,255,255,.8)}#three-canvas{position:fixed;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:var(--z-canvas);display:block}.glass{background:var(--bg-glass);backdrop-filter:var(--blur-md);-webkit-backdrop-filter:var(--blur-md);border:1px solid var(--border-glass);box-shadow:var(--shadow-md),var(--shadow-inset);border-radius:var(--radius-lg);transition:background var(--transition),border-color var(--transition),box-shadow var(--transition)}.glass:hover{background:var(--bg-glass-strong);border-color:var(--border);box-shadow:var(--shadow-lg),var(--shadow-inset)}.glass-strong{background:var(--bg-glass-strong);backdrop-filter:var(--blur-lg);-webkit-backdrop-filter:var(--blur-lg);border:1px solid var(--border);box-shadow:var(--shadow-lg),var(--shadow-inset);border-radius:var(--radius-lg)}.header{position:fixed;top:12px;left:12px;right:12px;height:52px;z-index:var(--z-header);display:flex;align-items:center;gap:8px;padding:0 16px;background:var(--bg-glass-strong);backdrop-filter:var(--blur-lg);-webkit-backdrop-filter:var(--blur-lg);border:1px solid var(--border-glass);border-radius:var(--radius-xl);box-shadow:var(--shadow-lg),var(--shadow-inset);transition:all var(--transition)}.header:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:var(--radius-xl);background:linear-gradient(135deg,rgba(var(--accent-rgb),.05),transparent 60%);pointer-events:none}.logo{width:32px;height:32px;flex-shrink:0;display:flex;align-items:center;justify-content:center;background:var(--accent-bg);border:1px solid var(--border-accent);border-radius:var(--radius-md);transition:all var(--transition)}.logo:hover{transform:scale(1.08) rotate(-3deg);box-shadow:var(--shadow-glow)}.logo svg{width:20px;height:20px}.title-wrap{display:flex;flex-direction:column;gap:0;margin-right:16px;min-width:0}.title-wrap h1{font-size:14px;font-weight:700;letter-spacing:-.02em;color:var(--text);line-height:1.2;white-space:nowrap}.title-wrap .subtitle{font-size:10px;color:var(--text-subtle);letter-spacing:.05em;text-transform:uppercase;line-height:1}.h-divider{width:1px;height:28px;flex-shrink:0;background:var(--border);margin:0 4px}.view-switch{display:flex;gap:2px;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-md);padding:2px}.view-switch button{display:flex;align-items:center;gap:5px;padding:5px 12px;border:none;border-radius:var(--radius-sm);font-size:12px;font-weight:500;color:var(--text-dim);cursor:pointer;background:transparent;transition:all var(--transition);white-space:nowrap}.view-switch button:hover{color:var(--text);background:var(--bg-hover)}.view-switch button.active{color:var(--text);background:var(--bg-panel);box-shadow:var(--shadow-sm)}.view-switch button svg{width:14px;height:14px;flex-shrink:0}.actions{display:flex;gap:4px;align-items:center;flex-shrink:0}.btn{display:inline-flex;align-items:center;gap:5px;padding:6px 14px;border:1px solid var(--border);border-radius:var(--radius-sm);cursor:pointer;font-size:12px;font-weight:600;transition:all var(--transition);white-space:nowrap;position:relative;overflow:hidden}.btn:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background:linear-gradient(180deg,rgba(255,255,255,.06),transparent);pointer-events:none}.btn-primary{background:var(--accent);color:#000;border-color:var(--accent-dim)}.btn-primary:hover{background:var(--accent-dim);transform:translateY(-1px);box-shadow:0 4px 16px var(--accent-glow)}.btn-danger{background:var(--red-bg);color:var(--red);border-color:rgba(var(--red-rgb),.25)}.btn-danger:hover{background:rgba(var(--red-rgb),.18);transform:translateY(-1px);box-shadow:0 4px 16px var(--red-glow)}.btn-secondary{background:var(--bg-card);color:var(--text-dim)}.btn-secondary:hover{background:var(--bg-hover);color:var(--text);transform:translateY(-1px)}.btn:disabled{opacity:.4;cursor:not-allowed;transform:none!important;box-shadow:none!important}.btn svg{width:14px;height:14px;flex-shrink:0}.btn:active{transform:translateY(0)}.run-mode-wrap{position:relative}.run-mode-wrap select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--bg-card);color:var(--text-dim);border:1px solid var(--border);border-radius:var(--radius-sm);padding:5px 28px 5px 10px;font-size:12px;font-weight:500;cursor:pointer;transition:all var(--transition);outline:none}.run-mode-wrap select:hover{border-color:var(--border-accent);color:var(--text)}.run-mode-wrap:after{content:">";position:absolute;right:8px;top:50%;transform:translateY(-50%) rotate(90deg);color:var(--text-subtle);font-size:10px;pointer-events:none}.stats{display:flex;gap:2px;margin-left:auto;flex-shrink:0}.stat-box{display:flex;flex-direction:column;align-items:center;padding:4px 12px;min-width:56px;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-sm);transition:all var(--transition)}.stat-box:first-child{border-radius:var(--radius-sm) var(--radius-xs) var(--radius-xs) var(--radius-sm)}.stat-box:last-child{border-radius:var(--radius-xs) var(--radius-sm) var(--radius-sm) var(--radius-xs)}.stat-box:hover{background:var(--bg-hover);border-color:var(--border-accent)}.stat-label{font-size:9px;text-transform:uppercase;letter-spacing:.06em;color:var(--text-subtle);line-height:1}.stat-value{font-size:16px;font-weight:700;color:var(--accent);line-height:1.3;font-variant-numeric:tabular-nums}.header-end{display:flex;align-items:center;gap:6px;margin-left:8px}#theme-toggle{width:32px;height:32px;border:none;background:var(--bg-card);border-radius:var(--radius-sm);cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--text-dim);transition:all var(--transition);border:1px solid var(--border)}#theme-toggle:hover{background:var(--bg-hover);color:var(--text);transform:scale(1.05)}#theme-toggle svg{width:16px;height:16px}#conn-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0;background:var(--text-subtle);transition:background .3s}#conn-dot.connected{background:var(--accent);box-shadow:0 0 8px var(--accent-glow);animation:conn-pulse 2s infinite}.sidebar{position:fixed;top:76px;left:12px;bottom:240px;width:220px;z-index:var(--z-panel);display:flex;flex-direction:column;overflow:hidden;background:var(--bg-glass);backdrop-filter:var(--blur-md);-webkit-backdrop-filter:var(--blur-md);border:1px solid var(--border-glass);border-radius:var(--radius-lg);box-shadow:var(--shadow-md),var(--shadow-inset);transition:all var(--transition-slow)}.sidebar.collapsed{width:48px}.sidebar.collapsed .sidebar-content{opacity:0;pointer-events:none}.sidebar.collapsed .sidebar-toggle svg{transform:rotate(180deg)}.sidebar-header{display:flex;align-items:center;justify-content:space-between;padding:12px 14px 8px;flex-shrink:0}.sidebar-header h3{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:var(--text-subtle);font-weight:600}.sidebar-toggle{width:24px;height:24px;border:none;background:transparent;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--text-subtle);border-radius:var(--radius-xs);transition:all var(--transition)}.sidebar-toggle:hover{background:var(--bg-hover);color:var(--text)}.sidebar-toggle svg{width:14px;height:14px;transition:transform var(--transition)}.sidebar-content{flex:1;overflow-y:auto;padding:0 8px 8px;transition:opacity var(--transition)}.mod-item{display:flex;align-items:center;gap:8px;padding:7px 10px;margin-bottom:2px;border-radius:var(--radius-sm);cursor:pointer;transition:all var(--transition)}.mod-item:hover{background:var(--bg-hover)}.mod-item.active{background:var(--accent-bg);color:var(--accent)}.mod-item .dot{width:6px;height:6px;border-radius:50%;flex-shrink:0;background:var(--accent);opacity:.6;transition:all var(--transition)}.mod-item:hover .dot{opacity:1;transform:scale(1.3)}.mod-item .name{flex:1;font-size:12px;font-weight:500;color:var(--text-dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:color var(--transition)}.mod-item:hover .name{color:var(--text)}.mod-item .count{font-size:11px;color:var(--text-subtle);font-variant-numeric:tabular-nums;padding:1px 6px;background:var(--bg-card);border-radius:var(--radius-xs);font-weight:500;transition:all var(--transition)}.mod-item:hover .count{background:var(--bg-hover);color:var(--text-dim)}.agent-item{display:flex;align-items:center;gap:8px;padding:8px 10px;margin-bottom:2px;border-radius:var(--radius-sm);transition:all var(--transition)}.agent-item .status-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0;transition:all .3s}.agent-item .status-dot.working{background:var(--accent);box-shadow:0 0 6px var(--accent-glow);animation:dot-pulse 1s infinite}.agent-item .status-dot.testing{background:var(--blue);box-shadow:0 0 6px var(--blue-glow);animation:dot-pulse 1s infinite}.agent-item .status-dot.thinking{background:var(--purple);box-shadow:0 0 6px var(--purple-glow);animation:dot-pulse 1.2s infinite}.agent-item .status-dot.error,.agent-item .status-dot.failed{background:var(--red);box-shadow:0 0 6px var(--red-glow);animation:dot-shake .3s infinite}.agent-item .status-dot.done,.agent-item .status-dot.passed{background:var(--accent);box-shadow:0 0 6px var(--accent-glow)}.agent-item .status-dot.idle{background:var(--text-subtle)}.agent-item .agent-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.agent-item .agent-name{font-size:12px;font-weight:600;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.agent-item .agent-role{font-size:10px;color:var(--text-subtle);text-transform:uppercase;letter-spacing:.04em}.right-panel{position:fixed;top:76px;right:12px;bottom:240px;width:320px;z-index:var(--z-panel);display:flex;flex-direction:column;background:var(--bg-glass);backdrop-filter:var(--blur-md);-webkit-backdrop-filter:var(--blur-md);border:1px solid var(--border-glass);border-radius:var(--radius-lg);box-shadow:var(--shadow-md),var(--shadow-inset);overflow:hidden;transition:all var(--transition-slow)}.panel-tabs{display:flex;gap:0;padding:6px 6px 0;flex-shrink:0;border-bottom:1px solid var(--border)}.tab{flex:1;display:flex;align-items:center;justify-content:center;gap:5px;padding:8px 4px;border:none;background:transparent;font-size:12px;font-weight:500;color:var(--text-subtle);cursor:pointer;position:relative;border-radius:var(--radius-sm) var(--radius-sm) 0 0;transition:all var(--transition);white-space:nowrap}.tab:hover{color:var(--text-dim);background:var(--bg-hover)}.tab.active{color:var(--accent);background:var(--bg-card)}.tab.active:after{content:"";position:absolute;bottom:0;left:20%;right:20%;height:2px;background:var(--accent);border-radius:1px}.tab svg{width:13px;height:13px;flex-shrink:0}.tab-badge{font-size:9px;font-weight:700;min-width:16px;height:16px;display:inline-flex;align-items:center;justify-content:center;background:var(--accent-bg);color:var(--accent);border-radius:var(--radius-full);padding:0 4px;font-variant-numeric:tabular-nums}.tab-badge.alert{background:var(--red-bg);color:var(--red)}.panel-content{flex:1;overflow-y:auto;padding:8px}.panel-content.hidden{display:none}.log-entry{padding:5px 10px;margin-bottom:2px;border-radius:var(--radius-xs);font-size:12px;line-height:1.5;font-family:SF Mono,Fira Code,Cascadia Code,Consolas,monospace;transition:background var(--transition);display:flex;gap:8px;align-items:flex-start}.log-entry:hover{background:var(--bg-hover)}.log-entry .timestamp{color:var(--text-subtle);font-size:10px;flex-shrink:0;font-variant-numeric:tabular-nums;padding-top:1px}.log-entry .message{color:var(--text-dim);word-break:break-word;flex:1}.log-entry.warn .message{color:var(--orange)}.log-entry.error .message{color:var(--red)}.log-entry.success .message{color:var(--accent)}.tw-cursor{display:inline-block;width:2px;height:1em;background:var(--accent);margin-left:2px;vertical-align:text-bottom;animation:tw-blink .6s step-end infinite}@keyframes tw-blink{0%,to{opacity:1}50%{opacity:0}}.file-item{display:flex;align-items:center;gap:8px;padding:8px 10px;margin-bottom:2px;border-radius:var(--radius-sm);cursor:pointer;transition:all var(--transition)}.file-item:hover{background:var(--bg-hover)}.file-item svg{width:14px;height:14px;flex-shrink:0;color:var(--text-subtle)}.file-item .file-name{flex:1;font-size:12px;color:var(--text-dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-item:hover .file-name{color:var(--text)}.results-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:4px}.result-card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-md);padding:12px;display:flex;flex-direction:column;gap:4px;transition:all var(--transition)}.result-card:hover{border-color:var(--border-accent);background:var(--bg-hover)}.result-card .label{font-size:10px;text-transform:uppercase;letter-spacing:.06em;color:var(--text-subtle)}.result-card .value{font-size:24px;font-weight:700;font-variant-numeric:tabular-nums;line-height:1}.result-card.passed .value{color:var(--accent)}.result-card.failed .value{color:var(--red)}.result-card.skipped .value{color:var(--orange)}.result-card.timeout .value{color:var(--purple)}.pass-rate-bar{height:6px;background:var(--bg-card);border-radius:3px;overflow:hidden;margin:8px 4px;border:1px solid var(--border)}.pass-rate-bar .fill{height:100%;border-radius:3px;background:linear-gradient(90deg,var(--accent),var(--cyan));transition:width .8s var(--ease-out-expo)}.quality-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px;padding:4px}.quality-item{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-sm);padding:8px;text-align:center;transition:all var(--transition)}.quality-item:hover{border-color:var(--border-accent)}.quality-item .q-label{font-size:9px;text-transform:uppercase;letter-spacing:.04em;color:var(--text-subtle)}.quality-item .q-value{font-size:14px;font-weight:700;color:var(--blue);margin-top:2px}.file-preview{position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--z-modal);display:flex;align-items:center;justify-content:center;opacity:0;pointer-events:none;transition:opacity var(--transition)}.file-preview.visible{opacity:1;pointer-events:auto}.file-preview .backdrop{position:absolute;top:0;right:0;bottom:0;left:0;background:#00000080;-webkit-backdrop-filter:var(--blur-sm);backdrop-filter:var(--blur-sm)}.file-preview .fp-dialog{position:relative;width:min(800px,90vw);height:min(600px,80vh);background:var(--bg-glass-strong);-webkit-backdrop-filter:var(--blur-lg);backdrop-filter:var(--blur-lg);border:1px solid var(--border);border-radius:var(--radius-xl);box-shadow:var(--shadow-xl);display:flex;flex-direction:column;overflow:hidden;transform:scale(.95) translateY(10px);transition:transform var(--transition-spring)}.file-preview.visible .fp-dialog{transform:scale(1) translateY(0)}.fp-header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--border);flex-shrink:0}.fp-header .fp-title{font-size:13px;font-weight:600;color:var(--text)}.fp-header .fp-close{width:28px;height:28px;border:none;background:var(--bg-card);border-radius:var(--radius-sm);cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--text-dim);transition:all var(--transition);border:1px solid var(--border)}.fp-header .fp-close:hover{background:var(--red-bg);color:var(--red);border-color:rgba(var(--red-rgb),.25)}.fp-code{flex:1;overflow:auto;padding:16px;font-family:SF Mono,Fira Code,Cascadia Code,Consolas,monospace;font-size:12px;line-height:1.6;color:var(--text-dim);white-space:pre-wrap;word-break:break-all;-moz-tab-size:2;tab-size:2}.tooltip{position:fixed;z-index:var(--z-tooltip);padding:6px 10px;background:var(--bg-glass-strong);-webkit-backdrop-filter:var(--blur-md);backdrop-filter:var(--blur-md);border:1px solid var(--border);border-radius:var(--radius-sm);box-shadow:var(--shadow-md);font-size:11px;color:var(--text);pointer-events:none;opacity:0;transition:opacity .15s;max-width:280px}.tooltip.visible{opacity:1}.shortcut-legend{position:fixed;bottom:240px;right:12px;z-index:var(--z-notify);display:grid;grid-template-columns:auto 1fr;gap:4px 10px;padding:12px 16px;background:var(--bg-glass-strong);-webkit-backdrop-filter:var(--blur-lg);backdrop-filter:var(--blur-lg);border:1px solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow-lg);opacity:0;transform:translateY(8px) scale(.96);pointer-events:none;transition:all var(--transition-spring)}.shortcut-legend.visible{opacity:1;transform:translateY(0) scale(1);pointer-events:auto}.shortcut-legend kbd{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 6px;background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-xs);font-size:11px;font-weight:600;color:var(--text);font-family:inherit;box-shadow:0 1px 2px #00000026}.shortcut-legend span{font-size:12px;color:var(--text-dim);display:flex;align-items:center}.loading-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:100;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;background:var(--bg-void);transition:opacity .8s var(--ease-out-expo)}.loading-overlay.hidden{opacity:0;pointer-events:none}.loading-bar{width:200px;height:3px;background:var(--bg-card);border-radius:2px;overflow:hidden}.loading-bar .fill{width:0%;height:100%;background:linear-gradient(90deg,var(--accent),var(--cyan));border-radius:2px;transition:width .3s var(--ease-out-expo)}.loading-text{font-size:12px;color:var(--text-subtle);letter-spacing:.04em}.toast-container{position:fixed;top:76px;right:12px;z-index:var(--z-notify);display:flex;flex-direction:column;gap:8px;pointer-events:none}.toast{display:flex;align-items:center;gap:8px;padding:10px 16px;background:var(--bg-glass-strong);-webkit-backdrop-filter:var(--blur-md);backdrop-filter:var(--blur-md);border:1px solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow-lg);font-size:12px;color:var(--text);pointer-events:auto;animation:toast-in .4s var(--ease-spring),toast-out .3s ease-in 3.7s forwards;max-width:320px}.toast.success{border-left:3px solid var(--accent)}.toast.error{border-left:3px solid var(--red)}.toast.warning{border-left:3px solid var(--orange)}.toast.info{border-left:3px solid var(--blue)}.bubble-3d{padding:6px 12px;background:var(--bg-glass-strong);-webkit-backdrop-filter:var(--blur-sm);backdrop-filter:var(--blur-sm);border:1px solid var(--border-accent);border-radius:12px 12px 12px 2px;font-size:12px;color:var(--text);box-shadow:var(--shadow-sm);animation:bubble-3d-in .3s var(--ease-spring);pointer-events:none;white-space:nowrap}.agent-label-3d{padding:3px 8px;background:var(--bg-glass);-webkit-backdrop-filter:var(--blur-xs);backdrop-filter:var(--blur-xs);border:1px solid var(--border-glass);border-radius:var(--radius-sm);font-size:10px;font-weight:600;color:var(--text);text-align:center;pointer-events:none;box-shadow:var(--shadow-sm);white-space:nowrap}.agent-label-3d .role{display:block;font-size:8px;font-weight:400;color:var(--text-subtle);text-transform:uppercase;letter-spacing:.04em}@keyframes conn-pulse{0%{box-shadow:0 0 0 0 var(--accent-glow)}70%{box-shadow:0 0 0 6px transparent}to{box-shadow:0 0 0 0 transparent}}@keyframes dot-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.5;transform:scale(.85)}}@keyframes dot-shake{0%,to{transform:translate(0)}25%{transform:translate(-1px)}75%{transform:translate(1px)}}@keyframes toast-in{0%{opacity:0;transform:translate(40px) scale(.9)}to{opacity:1;transform:translate(0) scale(1)}}@keyframes toast-out{0%{opacity:1;transform:translate(0)}to{opacity:0;transform:translate(40px)}}@keyframes bubble-3d-in{0%{opacity:0;transform:translateY(6px) scale(.9)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes skeleton-pulse{0%{background-position:200% 0}to{background-position:-200% 0}}@keyframes float-gentle{0%,to{transform:translateY(0)}50%{transform:translateY(-4px)}}@keyframes rotate-slow{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes glow-pulse{0%,to{opacity:.6}50%{opacity:1}}.skeleton{background:linear-gradient(90deg,var(--bg-card) 25%,var(--bg-hover) 50%,var(--bg-card) 75%);background-size:200% 100%;animation:skeleton-pulse 1.5s ease infinite;border-radius:var(--radius-sm)}@media (max-width:1200px){.sidebar{width:180px}.right-panel{width:280px}.stats{display:none}}@media (max-width:960px){.sidebar{display:none}.right-panel{width:260px}}@media (max-width:768px){.header{padding:0 10px;gap:4px}.right-panel{display:none}}@media print{.header,.sidebar,.right-panel,.shortcut-legend,.tooltip,.file-preview,.loading-overlay,.toast-container{display:none!important}#three-canvas{position:static;width:100%;height:auto}}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
var Nt=Object.defineProperty;var Rt=(a,e,t)=>e in a?Nt(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var B=(a,e,t)=>Rt(a,typeof e!="symbol"?e+"":e,t);import{_ as Bt,n as Ot}from"./studio-page-o3SCvE_v.js";import{r as $t,j as c}from"./react-vendor-C8RhVn0h.js";import{C as Ft,S as Dt,F as ke,P as Wt,W as Ht,a as Vt,A as Zt,b as Xt,c as Xe,H as qe,D as Ge,d as le,V as Ue,e as Re,M as C,f as d,G as qt,R as Ie,g as G,h as ye,i as te,j as fe,B as Ut,k as _,l as oe,m as O,n as de,o as he,p as E,q as lt,r as w,s as A,T as ie,t as Kt,u as z,v as be,w as Ne,L as Jt,x as Yt,I as Ke}from"./three-core-CsxM1PCY.js";import{E as Qt,R as es,U as ts,S as ss,F as ns,O as os,C as is,a as Je,b as as}from"./three-addons-BdrPp04O.js";function Ye(){return c.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[c.jsx("rect",{x:"2",y:"4",width:"12",height:"10",rx:"1",stroke:"currentColor",strokeWidth:"1.5"}),c.jsx("circle",{cx:"8",cy:"9",r:"2.5",fill:"currentColor"}),c.jsx("rect",{x:"5",y:"2",width:"6",height:"2",rx:"0.5",fill:"currentColor",opacity:"0.6"})]})}function rs(){return c.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[c.jsx("path",{d:"M8 1L14.5 5v6L8 15 1.5 11V5z",stroke:"currentColor",strokeWidth:"1.2"}),c.jsx("path",{d:"M8 1v14M1.5 5L8 9l6.5-4",stroke:"currentColor",strokeWidth:"1",opacity:"0.5"})]})}function cs(){return c.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[c.jsx("circle",{cx:"4",cy:"4",r:"2",fill:"currentColor",opacity:"0.6"}),c.jsx("circle",{cx:"12",cy:"4",r:"2",fill:"currentColor",opacity:"0.6"}),c.jsx("circle",{cx:"8",cy:"12",r:"2",fill:"currentColor",opacity:"0.6"}),c.jsx("line",{x1:"4",y1:"6",x2:"8",y2:"10",stroke:"currentColor",strokeWidth:"1"}),c.jsx("line",{x1:"12",y1:"6",x2:"8",y2:"10",stroke:"currentColor",strokeWidth:"1"})]})}function ls(){return c.jsx("svg",{id:"theme-icon-dark",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:c.jsx("path",{d:"M8 1a7 7 0 100 14 5 5 0 010-14z",fill:"currentColor"})})}function ds(){return c.jsxs("svg",{id:"theme-icon-light",viewBox:"0 0 16 16",fill:"none",style:{display:"none"},"aria-hidden":"true",children:[c.jsx("circle",{cx:"8",cy:"8",r:"3",fill:"currentColor"}),c.jsxs("g",{stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:[c.jsx("line",{x1:"8",y1:"1",x2:"8",y2:"3"}),c.jsx("line",{x1:"8",y1:"13",x2:"8",y2:"15"}),c.jsx("line",{x1:"1",y1:"8",x2:"3",y2:"8"}),c.jsx("line",{x1:"13",y1:"8",x2:"15",y2:"8"}),c.jsx("line",{x1:"3.05",y1:"3.05",x2:"4.46",y2:"4.46"}),c.jsx("line",{x1:"11.54",y1:"11.54",x2:"12.95",y2:"12.95"}),c.jsx("line",{x1:"3.05",y1:"12.95",x2:"4.46",y2:"11.54"}),c.jsx("line",{x1:"11.54",y1:"4.46",x2:"12.95",y2:"3.05"})]})]})}function Us(){return $t.useEffect(()=>{let a,e=!1;return Bt(async()=>{const{mountOfficeRuntime:t}=await Promise.resolve().then(()=>Ws);return{mountOfficeRuntime:t}},void 0).then(({mountOfficeRuntime:t})=>t()).then(t=>{if(e){t();return}a=t}),()=>{e=!0,a==null||a()}},[]),c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"loading-overlay",id:"loading-overlay",children:[c.jsx("div",{style:{width:48,height:48,opacity:.8,color:"var(--accent)"},children:c.jsx(Ye,{})}),c.jsx("div",{className:"loading-bar",children:c.jsx("div",{className:"fill",id:"loading-fill"})}),c.jsx("div",{className:"loading-text",id:"loading-text",children:"Initializing 3D engine..."})]}),c.jsx("canvas",{id:"three-canvas"}),c.jsxs("div",{className:"header",id:"header",children:[c.jsx("div",{className:"logo",children:c.jsx(Ye,{})}),c.jsxs("div",{className:"title-wrap",children:[c.jsx("h1",{children:"OpenCroc Studio"}),c.jsx("span",{className:"subtitle",children:"3D Ops Dashboard | Real-time Multi-Agent Runtime"})]}),c.jsx("div",{className:"h-divider"}),c.jsxs("div",{className:"view-switch",children:[c.jsxs("button",{id:"view-3d",className:"active",type:"button",children:[c.jsx(rs,{}),"3D Office"]}),c.jsxs("button",{id:"view-graph",type:"button",children:[c.jsx(cs,{}),"Graph"]})]}),c.jsx("div",{className:"h-divider"}),c.jsxs("div",{className:"actions",children:[c.jsxs("button",{className:"btn btn-secondary",id:"btn-scan",type:"button",children:[c.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:c.jsx("path",{d:"M2 8h12M4 4h8M6 12h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),"Scan"]}),c.jsxs("button",{className:"btn btn-primary",id:"btn-pipeline",type:"button",children:[c.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:c.jsx("path",{d:"M2 8h3l2-4 2 8 2-4h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),"Pipeline"]}),c.jsx("div",{className:"run-mode-wrap",children:c.jsxs("select",{id:"run-mode",defaultValue:"auto",children:[c.jsx("option",{value:"auto",children:"Auto"}),c.jsx("option",{value:"reuse",children:"Reuse"}),c.jsx("option",{value:"managed",children:"Managed"})]})}),c.jsxs("button",{className:"btn btn-secondary",id:"btn-run-tests",type:"button",children:[c.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:c.jsx("path",{d:"M4 2v12l8-6z",fill:"currentColor",opacity:"0.7"})}),"Tests"]}),c.jsxs("button",{className:"btn btn-secondary",id:"btn-reports",type:"button",children:[c.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[c.jsx("rect",{x:"3",y:"1",width:"10",height:"14",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),c.jsx("line",{x1:"5",y1:"5",x2:"11",y2:"5",stroke:"currentColor",strokeWidth:"1",opacity:"0.5"}),c.jsx("line",{x1:"5",y1:"8",x2:"11",y2:"8",stroke:"currentColor",strokeWidth:"1",opacity:"0.5"}),c.jsx("line",{x1:"5",y1:"11",x2:"9",y2:"11",stroke:"currentColor",strokeWidth:"1",opacity:"0.5"})]}),"Reports"]}),c.jsxs("button",{className:"btn btn-danger",id:"btn-reset",type:"button",children:[c.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[c.jsx("path",{d:"M2 8a6 6 0 0111.3-2.8M14 8a6 6 0 01-11.3 2.8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),c.jsx("path",{d:"M14 2v4h-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),"Reset"]})]}),c.jsxs("div",{className:"stats",children:[c.jsxs("div",{className:"stat-box",children:[c.jsx("span",{className:"stat-label",children:"MODULES"}),c.jsx("span",{className:"stat-value",id:"s-mod",children:"0"})]}),c.jsxs("div",{className:"stat-box",children:[c.jsx("span",{className:"stat-label",children:"CLASSES"}),c.jsx("span",{className:"stat-value",id:"s-mdl",children:"0"})]}),c.jsxs("div",{className:"stat-box",children:[c.jsx("span",{className:"stat-label",children:"FUNCS"}),c.jsx("span",{className:"stat-value",id:"s-api",children:"0"})]}),c.jsxs("div",{className:"stat-box",children:[c.jsx("span",{className:"stat-label",children:"FILES"}),c.jsx("span",{className:"stat-value",id:"s-files",children:"-"})]}),c.jsxs("div",{className:"stat-box",children:[c.jsx("span",{className:"stat-label",children:"NODES"}),c.jsx("span",{className:"stat-value",id:"s-nodes",children:"-"})]}),c.jsxs("div",{className:"stat-box",children:[c.jsx("span",{className:"stat-label",children:"RISKS"}),c.jsx("span",{className:"stat-value",id:"s-risks",children:"-"})]})]}),c.jsxs("div",{className:"header-end",children:[c.jsxs("button",{id:"theme-toggle",title:"Toggle theme",type:"button",children:[c.jsx(ls,{}),c.jsx(ds,{})]}),c.jsx("div",{id:"conn-dot",title:"WebSocket"})]})]}),c.jsxs("div",{className:"sidebar",id:"sidebar",children:[c.jsxs("div",{className:"sidebar-header",children:[c.jsx("h3",{children:"Modules"}),c.jsx("button",{className:"sidebar-toggle",id:"sidebar-toggle",type:"button",children:c.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:c.jsx("path",{d:"M10 3L5 8l5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),c.jsxs("div",{className:"sidebar-content",id:"sidebar-content",children:[c.jsx("div",{id:"mod-list"}),c.jsx("div",{id:"agent-sidebar",style:{marginTop:12}})]})]}),c.jsxs("div",{className:"right-panel",id:"right-panel",children:[c.jsxs("div",{className:"panel-tabs",children:[c.jsxs("button",{className:"tab active","data-tab":"log",type:"button",children:[c.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:c.jsx("path",{d:"M2 3h12M2 7h8M2 11h10",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})}),"Log"]}),c.jsxs("button",{className:"tab","data-tab":"files",type:"button",children:[c.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[c.jsx("path",{d:"M3 1h6l4 4v10H3z",stroke:"currentColor",strokeWidth:"1.2"}),c.jsx("path",{d:"M9 1v4h4",stroke:"currentColor",strokeWidth:"1",opacity:"0.5"})]}),"Files"]}),c.jsxs("button",{className:"tab","data-tab":"results",type:"button",children:[c.jsx("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:c.jsx("polyline",{points:"2,12 5,6 9,10 14,3",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})}),"Results"]}),c.jsxs("button",{className:"tab","data-tab":"reports",type:"button",children:[c.jsxs("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[c.jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),c.jsx("path",{d:"M5 10V7M8 10V5M11 10V8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),"Reports"]})]}),c.jsx("div",{className:"panel-content",id:"log-list"}),c.jsx("div",{className:"panel-content hidden",id:"file-list"}),c.jsx("div",{className:"panel-content hidden",id:"results-panel"}),c.jsx("div",{className:"panel-content hidden",id:"reports-panel"})]}),c.jsxs("div",{className:"file-preview",id:"file-preview",children:[c.jsx("div",{className:"backdrop",id:"fp-backdrop"}),c.jsxs("div",{className:"fp-dialog",children:[c.jsxs("div",{className:"fp-header",children:[c.jsx("span",{className:"fp-title",id:"fp-title",children:"File Preview"}),c.jsx("button",{className:"fp-close",id:"fp-close",type:"button",children:c.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none","aria-hidden":"true",children:c.jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),c.jsx("pre",{className:"fp-code",id:"fp-code"})]})]}),c.jsxs("div",{className:"tooltip",id:"tooltip",children:[c.jsx("div",{className:"tt-name"}),c.jsx("div",{className:"tt-module"}),c.jsx("div",{className:"tt-type"})]}),c.jsxs("div",{className:"shortcut-legend",id:"shortcut-legend",children:[c.jsx("kbd",{children:"1"}),c.jsx("span",{children:"3D Office"}),c.jsx("kbd",{children:"2"}),c.jsx("span",{children:"Graph View"}),c.jsx("kbd",{children:"S"}),c.jsx("span",{children:"Scan"}),c.jsx("kbd",{children:"P"}),c.jsx("span",{children:"Pipeline"}),c.jsx("kbd",{children:"T"}),c.jsx("span",{children:"Run Tests"}),c.jsx("kbd",{children:"R"}),c.jsx("span",{children:"Reports"}),c.jsx("kbd",{children:"X"}),c.jsx("span",{children:"Reset"}),c.jsx("kbd",{children:"D"}),c.jsx("span",{children:"Dark/Light"}),c.jsx("kbd",{children:"?"}),c.jsx("span",{children:"Shortcuts"}),c.jsx("kbd",{children:"Esc"}),c.jsx("span",{children:"Close"})]}),c.jsx("div",{className:"toast-container",id:"toast-container"})]})}let j=null,M=null,U=null,N=null,Me=null,pe=null,ue=null;function Qe(a){var e;if(a){for(const t of Object.values(a))t&&typeof t=="object"&&t.isTexture&&t.dispose();(e=a.dispose)==null||e.call(a)}}async function hs(a,e="dark"){Me=new Ft,M=new Dt,M.fog=e==="dark"?new ke(328976,.012):new ke(15265012,.008);const t=window.innerWidth/window.innerHeight;return U=new Wt(55,t,.1,500),U.position.set(18,14,18),U.lookAt(0,0,0),j=new Ht({canvas:a,antialias:!0,alpha:!1,powerPreference:"high-performance"}),j.setSize(window.innerWidth,window.innerHeight),j.setPixelRatio(Math.min(window.devicePixelRatio,2)),j.outputColorSpace=Vt,j.toneMapping=Zt,j.toneMappingExposure=e==="dark"?1:1.4,j.shadowMap.enabled=!0,j.shadowMap.type=Xt,e==="dark"?j.setClearColor(328976):j.setClearColor(15265012),dt(M,e),ps(e),us(e),gs(e),{renderer:j,scene:M,camera:U,composer:N,clock:Me}}function dt(a,e){if(a.children.filter(t=>t.isLight).forEach(t=>a.remove(t)),e==="dark"){const t=new Xe(1714762,.4);t.name="ambient",a.add(t);const s=new qe(858922,659230,.3);s.name="hemi",a.add(s);const n=new Ge(4491468,.6);n.name="dir-main",n.position.set(-10,20,10),n.castShadow=!0,n.shadow.mapSize.set(2048,2048),n.shadow.camera.near=.5,n.shadow.camera.far=60,n.shadow.camera.left=-25,n.shadow.camera.right=25,n.shadow.camera.top=25,n.shadow.camera.bottom=-25,n.shadow.bias=-.002,n.shadow.normalBias=.02,a.add(n);const o=new le(3462041,2,30,1.5);o.name="accent-glow",o.position.set(0,6,0),o.castShadow=!1,a.add(o);const i=new le(10980346,1,25,1.5);i.name="rim-light",i.position.set(-12,8,-12),a.add(i);const r=new le(16498468,.8,15,2);r.name="warm-desk",r.position.set(6,4,6),a.add(r)}else{const t=new Xe(15791354,.6);t.name="ambient",a.add(t);const s=new qe(14544639,15789280,.5);s.name="hemi",a.add(s);const n=new Ge(16774630,1.2);n.name="dir-main",n.position.set(12,25,8),n.castShadow=!0,n.shadow.mapSize.set(2048,2048),n.shadow.camera.near=.5,n.shadow.camera.far=60,n.shadow.camera.left=-25,n.shadow.camera.right=25,n.shadow.camera.top=25,n.shadow.camera.bottom=-25,n.shadow.bias=-.002,n.shadow.normalBias=.02,a.add(n);const o=new Ge(11785471,.4);o.name="fill-light",o.position.set(-8,12,-5),a.add(o);const i=new le(366185,.6,20,2);i.name="accent-glow",i.position.set(0,5,0),a.add(i)}}function ps(a){const e=j.getSize(new Ue);N=new Qt(j);const t=new es(M,U);N.addPass(t),pe=new ts(new Ue(e.x,e.y),a==="dark"?.6:.15,.4,a==="dark"?.85:.95),N.addPass(pe),ue=new ss(ns),ue.uniforms.resolution.value.set(1/e.x,1/e.y),N.addPass(ue);const s=new os;N.addPass(s)}function us(a){const e=new Re(200,200),t=new C({color:a==="dark"?659230:14607597,roughness:.95,metalness:0}),s=new d(e,t);s.rotation.x=-Math.PI/2,s.position.y=-.01,s.receiveShadow=!0,s.name="ground",M.add(s);const n=80,o=40,i=new qt(n,o,a==="dark"?1714746:12371408,a==="dark"?989738:13687008);i.position.y=.01,i.material.opacity=a==="dark"?.3:.2,i.material.transparent=!0,i.name="grid",M.add(i);const r=new Ie(8,8.08,64),l=new G({color:a==="dark"?3462041:366185,transparent:!0,opacity:a==="dark"?.4:.2,side:ye}),h=new d(r,l);h.rotation.x=-Math.PI/2,h.position.y=.02,h.name="center-ring",M.add(h);const g=new Ie(14,14.06,64),u=new G({color:a==="dark"?6333946:2450411,transparent:!0,opacity:a==="dark"?.2:.1,side:ye}),m=new d(g,u);m.rotation.x=-Math.PI/2,m.position.y=.02,m.name="outer-ring",M.add(m)}function gs(a){const e=new te(150,32,32),t=new fe({uniforms:{topColor:{value:a==="dark"?new _(659246):new _(8900331)},bottomColor:{value:a==="dark"?new _(328976):new _(15265012)},offset:{value:20},exponent:{value:.6}},vertexShader:`
|
|
2
|
+
varying vec3 vWorldPosition;
|
|
3
|
+
void main() {
|
|
4
|
+
vec4 worldPos = modelMatrix * vec4(position, 1.0);
|
|
5
|
+
vWorldPosition = worldPos.xyz;
|
|
6
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
7
|
+
}
|
|
8
|
+
`,fragmentShader:`
|
|
9
|
+
uniform vec3 topColor;
|
|
10
|
+
uniform vec3 bottomColor;
|
|
11
|
+
uniform float offset;
|
|
12
|
+
uniform float exponent;
|
|
13
|
+
varying vec3 vWorldPosition;
|
|
14
|
+
void main() {
|
|
15
|
+
float h = normalize(vWorldPosition + offset).y;
|
|
16
|
+
gl_FragColor = vec4(mix(bottomColor, topColor, max(pow(max(h, 0.0), exponent), 0.0)), 1.0);
|
|
17
|
+
}
|
|
18
|
+
`,side:Ut,depthWrite:!1}),s=new d(e,t);s.name="sky",M.add(s),a==="dark"&&ht()}function ht(){const e=new Float32Array(6e3),t=new Float32Array(2e3),s=new Float32Array(2e3*3),n=[new _(16777215),new _(13426175),new _(16772829),new _(14544639),new _(3462041)];for(let l=0;l<2e3;l++){const h=Math.random()*Math.PI*2,g=Math.random()*Math.PI*.45,u=100+Math.random()*40;e[l*3]=u*Math.sin(g)*Math.cos(h),e[l*3+1]=u*Math.cos(g),e[l*3+2]=u*Math.sin(g)*Math.sin(h),t[l]=.3+Math.random()*1.2;const m=n[Math.floor(Math.random()*n.length)];s[l*3]=m.r,s[l*3+1]=m.g,s[l*3+2]=m.b}const o=new oe;o.setAttribute("position",new O(e,3)),o.setAttribute("size",new O(t,1)),o.setAttribute("color",new O(s,3));const i=new fe({uniforms:{time:{value:0}},vertexShader:`
|
|
19
|
+
attribute float size;
|
|
20
|
+
attribute vec3 color;
|
|
21
|
+
varying vec3 vColor;
|
|
22
|
+
varying float vSize;
|
|
23
|
+
uniform float time;
|
|
24
|
+
void main() {
|
|
25
|
+
vColor = color;
|
|
26
|
+
vSize = size;
|
|
27
|
+
vec4 mvPosition = modelViewMatrix * vec4(position, 1.0);
|
|
28
|
+
float twinkle = 0.7 + 0.3 * sin(time * 2.0 + position.x * 10.0 + position.z * 7.0);
|
|
29
|
+
gl_PointSize = size * twinkle * (200.0 / -mvPosition.z);
|
|
30
|
+
gl_Position = projectionMatrix * mvPosition;
|
|
31
|
+
}
|
|
32
|
+
`,fragmentShader:`
|
|
33
|
+
varying vec3 vColor;
|
|
34
|
+
varying float vSize;
|
|
35
|
+
void main() {
|
|
36
|
+
vec2 center = gl_PointCoord - vec2(0.5);
|
|
37
|
+
float dist = length(center);
|
|
38
|
+
if (dist > 0.5) discard;
|
|
39
|
+
float alpha = 1.0 - smoothstep(0.0, 0.5, dist);
|
|
40
|
+
float glow = exp(-dist * dist * 8.0);
|
|
41
|
+
gl_FragColor = vec4(vColor * (0.8 + glow * 0.5), alpha * 0.9);
|
|
42
|
+
}
|
|
43
|
+
`,transparent:!0,depthWrite:!1,blending:de}),r=new he(o,i);r.name="stars",M.add(r)}function ms(){if(!j||!U)return;const a=window.innerWidth,e=window.innerHeight;U.aspect=a/e,U.updateProjectionMatrix(),j.setSize(a,e),N&&N.setSize(a,e),ue&&ue.uniforms.resolution.value.set(1/a,1/e)}function ws(a){const e=M.getObjectByName("stars");e&&e.material.uniforms&&(e.material.uniforms.time.value+=a);const t=M.getObjectByName("center-ring");t&&(t.rotation.z+=a*.1);const s=M.getObjectByName("outer-ring");s&&(s.rotation.z-=a*.05)}function fs(a){if(!j||!M)return;j.setClearColor(a==="dark"?328976:15265012),j.toneMappingExposure=a==="dark"?1:1.4,M.fog=a==="dark"?new ke(328976,.012):new ke(15265012,.008),dt(M,a),pe&&(pe.strength=a==="dark"?.6:.15,pe.threshold=a==="dark"?.85:.95);const e=M.getObjectByName("ground");e&&e.material.color.setHex(a==="dark"?659230:14607597);const t=M.getObjectByName("grid");t&&(t.material.opacity=a==="dark"?.3:.2);const s=M.getObjectByName("sky");s&&s.material.uniforms&&(s.material.uniforms.topColor.value.setHex(a==="dark"?659246:8900331),s.material.uniforms.bottomColor.value.setHex(a==="dark"?328976:15265012));const n=M.getObjectByName("stars");n&&(n.visible=a==="dark"),!n&&a==="dark"&&ht();const o=M.getObjectByName("center-ring");o&&(o.material.color.setHex(a==="dark"?3462041:366185),o.material.opacity=a==="dark"?.4:.2)}function ys(){var a,e,t,s;if(M)for(M.traverse(n=>{var o,i;(i=(o=n.geometry)==null?void 0:o.dispose)==null||i.call(o),Array.isArray(n.material)?n.material.forEach(Qe):Qe(n.material)});M.children.length>0;)M.remove(M.children[0]);(e=(a=N==null?void 0:N.passes)==null?void 0:a.forEach)==null||e.call(a,n=>{var o;return(o=n.dispose)==null?void 0:o.call(n)}),(t=N==null?void 0:N.dispose)==null||t.call(N),(s=j==null?void 0:j.dispose)==null||s.call(j),j=null,M=null,U=null,N=null,Me=null,pe=null,ue=null}function vs(){return j}function q(){return M}function et(){return U}function xs(){return N}function bs(){return Me}let v=null,$="dark";const p={};function ks(){Object.keys(p).forEach(a=>{var e,t;(t=(e=p[a])==null?void 0:e.dispose)==null||t.call(e),delete p[a]})}function Be(a){v&&(a==null||a.remove(v),v.traverse(e=>{var t,s;(s=(t=e.geometry)==null?void 0:t.dispose)==null||s.call(t)}),v=null,Q.length=0,ee.length=0,Se.clear(),ks())}function pt(a){const e=a==="dark";p.floor=new C({color:e?1712946:14870768,roughness:.8,metalness:.05}),p.wall=new C({color:e?1976635:16317180,roughness:.7,metalness:0,transparent:!0,opacity:.85}),p.wallGlass=new lt({color:e?1981023:12573694,roughness:.1,metalness:.1,transparent:!0,opacity:.25,transmission:.6,thickness:.5,ior:1.5}),p.desk=new C({color:e?2963272:13358561,roughness:.5,metalness:.2}),p.deskTop=new C({color:e?3621201:14542061,roughness:.4,metalness:.15}),p.chair=new C({color:e?4871528:9741240,roughness:.6,metalness:.1}),p.screen=new C({color:e?0:1118481,roughness:.1,metalness:.8}),p.screenGlow=new G({color:e?3462041:366185,transparent:!0,opacity:.6}),p.metal=new C({color:e?6583435:9741240,roughness:.3,metalness:.7}),p.accent=new C({color:e?3462041:366185,roughness:.4,metalness:.3,emissive:e?3462041:366185,emissiveIntensity:e?.3:.1}),p.neon=new G({color:e?3462041:366185,transparent:!0,opacity:e?.8:.4}),p.neonBlue=new G({color:e?6333946:2450411,transparent:!0,opacity:e?.6:.3}),p.neonPurple=new G({color:e?10980346:8141549,transparent:!0,opacity:e?.5:.25}),p.server=new C({color:e?1712946:13358561,roughness:.3,metalness:.6}),p.coffee=new C({color:e?7877903:10576391,roughness:.5,metalness:.1}),p.plant=new C({color:e?1467700:2278750,roughness:.8,metalness:0}),p.pot=new C({color:e?9584654:16498468,roughness:.6,metalness:0}),p.whiteboard=new C({color:e?16317180:16777215,roughness:.2,metalness:.05}),p.frame=new C({color:e?3621201:6583435,roughness:.4,metalness:.5}),p.carpet=new C({color:e?1973067:13095678,roughness:.95,metalness:0}),p.pillar=new C({color:e?3359061:14870768,roughness:.5,metalness:.3})}async function Ms(a){$=a,Be(q()),pt(a);const e=q();v=new E,v.name="office",ut(),gt(),mt(),wt(),ft(6),yt(),vt(),xt(),bt(),kt(),Mt(),St(),_t(),Ct(),jt(),Pt(),Lt(),e.add(v)}function ut(){const a=new w(28,.2,20),e=new d(a,p.floor);e.position.set(0,.1,0),e.receiveShadow=!0,e.name="office-floor",v.add(e);const t=new w(28.2,.05,.05),s=new d(t,p.neon);s.position.set(0,.22,10),v.add(s);const n=s.clone();n.position.z=-10,v.add(n);const o=new w(.05,.05,20.2),i=new d(o,p.neon);i.position.set(-14,.22,0),v.add(i);const r=i.clone();r.position.x=14,v.add(r)}function gt(){const a=new w(28,6,.15),e=new d(a,p.wall);e.position.set(0,3.2,-10),e.castShadow=!0,e.receiveShadow=!0,v.add(e);const t=new w(.15,6,20),s=new d(t,p.wall);s.position.set(-14,3.2,0),s.castShadow=!0,s.receiveShadow=!0,v.add(s);const n=new d(new w(.15,2,20),p.wall);n.position.set(14,1.2,0),n.castShadow=!0,v.add(n);const o=new w(28,.04,.04),i=new d(o,p.neon);i.position.set(0,5,-9.9),v.add(i);const r=new d(new w(.04,6,.04),p.neonBlue);r.position.set(-13.9,3.2,9.5),v.add(r)}function mt(){const a=new w(.08,4,8),e=new d(a,p.wallGlass);e.position.set(-5,2.2,-3),v.add(e);const t=new w(8,3.5,.08),s=new d(t,p.wallGlass);s.position.set(3,1.95,3),v.add(s);const n=new w(.06,4,.06),o=new d(n,p.frame);o.position.set(-5,2.2,1),v.add(o);const i=o.clone();i.position.z=-7,v.add(i)}const Q=[],ee=[],Se=new Map;function wt(){const a=new E;a.name="agent-pond";const e=-9,t=6.2,s=new d(new A(3.4,3.5,.16,24),p.frame);s.position.set(e,.25,t),s.receiveShadow=!0,a.add(s);const n=new d(new A(3.1,3.2,.1,24),new C({color:$==="dark"?997981:8246268,roughness:.18,metalness:.2,transparent:!0,opacity:$==="dark"?.72:.52,emissive:$==="dark"?959977:223649,emissiveIntensity:$==="dark"?.16:.06}));n.position.set(e,.3,t),a.add(n);for(let i=0;i<10;i++){const r=i/10*Math.PI*2,l=3.7+i%2*.25,h=new d(new w(.32,.06,.32),p.deskTop);h.position.set(e+Math.cos(r)*l,.23,t+Math.sin(r)*l),h.rotation.y=r*.7,h.receiveShadow=!0,a.add(h)}ee.length=0;const o=24;for(let i=0;i<o;i++){const r=i/o*Math.PI*2,l=1.55+i%3*.34;ee.push({x:e+Math.cos(r)*l,z:t+Math.sin(r)*l})}v.add(a)}function ft(a){Q.length=0,Se.clear();const t=Math.ceil(a/2),s=-2,n=-6,o=4.5,i=5;for(let r=0;r<a;r++){const l=Math.floor(r/t),h=r%t,g=s+h*o,u=n+l*i;Q.push({x:g,z:u}),Ss(g,u,r)}}function Ss(a,e,t){const s=new E;s.name=`desk-${t}`;const n=new w(2.4,.08,1.2),o=new d(n,p.deskTop);o.position.set(0,1,0),o.castShadow=!0,o.receiveShadow=!0,s.add(o);const i=new w(.08,.8,.08);[[-1.1,.6,-.5],[1.1,.6,-.5],[-1.1,.6,.5],[1.1,.6,.5]].forEach(D=>{const V=new d(i,p.desk);V.position.set(...D),V.castShadow=!0,s.add(V)});const l=new E,h=new w(1,.7,.04),g=new d(h,p.screen);g.position.set(0,1.65,-.3),g.castShadow=!0,l.add(g);const u=new Re(.92,.62),m=new d(u,p.screenGlow);m.position.set(0,1.65,-.278),l.add(m);const x=new w(.06,.28,.06),y=new d(x,p.metal);y.position.set(0,1.18,-.3),l.add(y);const T=new A(.18,.2,.04,16),k=new d(T,p.metal);k.position.set(0,1.04,-.3),l.add(k),s.add(l);const S=new w(.6,.02,.2),P=new d(S,p.desk);P.position.set(0,1.06,.15),s.add(P);const b=new w(.1,.02,.14),F=new d(b,p.desk);F.position.set(.5,1.06,.15),s.add(F);const W=new E,K=new w(.7,.08,.7),I=new d(K,p.chair);I.position.set(0,.7,.9),I.castShadow=!0,W.add(I);const Z=new w(.7,.6,.06),H=new d(Z,p.chair);H.position.set(0,1.04,1.23),H.castShadow=!0,W.add(H);const X=new A(.04,.04,.5,8),J=new d(X,p.metal);J.position.set(0,.45,.9),W.add(J);const _e=new A(.25,.28,.03,5),ae=new d(_e,p.metal);if(ae.position.set(0,.2,.9),W.add(ae),s.add(W),t%2===0){const D=new E,V=new d(new A(.1,.12,.04,16),p.metal);V.position.set(-.8,1.06,-.2),D.add(V);const ge=new d(new A(.015,.015,.5,8),p.metal);ge.position.set(-.8,1.31,-.2),D.add(ge);const se=new d(new Kt(.1,.12,8),p.accent);se.position.set(-.8,1.58,-.2),se.rotation.x=Math.PI,D.add(se),s.add(D)}if(t%3===1){const D=new A(.05,.04,.1,12),V=new d(D,p.coffee);V.position.set(.8,1.09,0),s.add(V)}const re=new d(new A(.06,.06,.04,12),new C({color:$==="dark"?4674921:9741240,roughness:.25,metalness:.4,emissive:$==="dark"?988970:6583435,emissiveIntensity:.12}));re.position.set(1,1.08,-.32),s.add(re),Se.set(t,re),s.position.set(a,.2,e),v.add(s)}function tt(a,e){const t=Se.get(a);if(!t)return;const s=t.material;s&&(e?(s.color.setHex($==="dark"?3462041:366185),s.emissive.setHex($==="dark"?3462041:292951),s.emissiveIntensity=$==="dark"?.62:.35):(s.color.setHex($==="dark"?4674921:9741240),s.emissive.setHex($==="dark"?988970:6583435),s.emissiveIntensity=.12))}function yt(){const a=new E;a.name="server-rack";const e=new w(1,3.5,.8),t=new d(e,p.server);t.position.set(0,1.95,0),t.castShadow=!0,a.add(t);for(let o=0;o<6;o++){const i=new w(.9,.35,.7),r=new d(i,p.desk);r.position.set(0,.5+o*.5,0),a.add(r);const l=[p.neon,p.neonBlue,p.neon,p.neonBlue,p.neon,p.neonPurple];for(let h=0;h<3;h++){const g=new w(.03,.03,.01),u=new d(g,l[o]);u.position.set(-.3+h*.15,.5+o*.5,.36),a.add(u)}}const s=new d(new te(.06,8,8),p.accent);s.position.set(0,3.8,0),a.add(s),a.position.set(-10,.2,-6),v.add(a);const n=a.clone();n.position.set(-10,.2,-3),n.name="server-rack-2",v.add(n)}function vt(){const a=new E;a.name="coffee-area";const e=new w(2.5,1,.8),t=new d(e,p.deskTop);t.position.set(0,.7,0),t.castShadow=!0,t.receiveShadow=!0,a.add(t);const s=new w(.5,.6,.4),n=new d(s,p.server);n.position.set(-.4,1.5,0),n.castShadow=!0,a.add(n);const o=new A(.02,.02,.15,8),i=new d(o,p.metal);i.position.set(-.4,1.13,.15),a.add(i);for(let l=0;l<3;l++){const h=new A(.04,.035,.08,8),g=new d(h,p.coffee);g.position.set(.3+l*.15,1.24,0),a.add(g)}const r=new d(new te(.025,8,8),p.accent);r.position.set(-.15,1.7,.21),a.add(r),a.position.set(11,.2,-7),v.add(a)}function xt(){[[-12,.2,8],[12,.2,8],[-12,.2,-8],[8,.2,-8],[0,.2,9],[-7,.2,9]].forEach((e,t)=>{const s=new E;s.name=`plant-${t}`;const n=new A(.25,.2,.35,8),o=new d(n,p.pot);o.position.set(0,.175,0),o.castShadow=!0,s.add(o);const i=p.plant;for(let h=0;h<5;h++){const g=new te(.15+Math.random()*.1,6,6),u=new d(g,i),m=h/5*Math.PI*2;u.position.set(Math.cos(m)*.15,.5+Math.random()*.3,Math.sin(m)*.15),u.scale.y=1.2+Math.random()*.3,s.add(u)}const r=new A(.03,.04,.4,6),l=new d(r,p.coffee);l.position.set(0,.5,0),s.add(l),s.position.set(...e),v.add(s)})}function bt(){const a=new E;a.name="whiteboard";const e=new w(3,2,.06),t=new d(e,p.whiteboard);t.position.set(0,3.2,-9.9),t.castShadow=!0,a.add(t);const s=new w(3.1,2.1,.04),n=new d(s,p.frame);n.position.set(0,3.2,-9.95),a.add(n);const o=[3462041,6333946,16281969,16498468];for(let i=0;i<4;i++){const r=new w(.6,.04,.01),l=new d(r,new G({color:o[i],transparent:!0,opacity:.6}));l.position.set(-.9+i*.6,3.5-i*.2,-9.86),a.add(l)}v.add(a)}function kt(){[[-8,0],[8,0],[-8,-6],[8,-6]].forEach(([e,t],s)=>{const n=new w(.4,6.2,.4),o=new d(n,p.pillar);o.position.set(e,3.3,t),o.castShadow=!0,o.name=`pillar-${s}`,v.add(o);const i=new w(.5,.04,.5),r=new d(i,s<2?p.neon:p.neonBlue);r.position.set(e,.22,t),v.add(r)})}function Mt(){const a=new w(10,.03,7),e=new d(a,p.carpet);e.position.set(2,.22,-3),e.receiveShadow=!0,e.name="carpet",v.add(e)}function St(){[[-4,-4],[4,-4],[-4,3],[4,3],[0,0]].forEach(([e,t],s)=>{const n=new E;n.name=`ceiling-light-${s}`;const o=new w(1.5,.06,.4),i=new d(o,p.metal);i.position.set(0,6,0),n.add(i);const r=new w(1.4,.02,.35),l=new G({color:$==="dark"?14544639:16776944,transparent:!0,opacity:$==="dark"?.3:.6}),h=new d(r,l);h.position.set(0,5.97,0),h.name="light-panel",n.add(h);const g=new A(.008,.008,.5,4),u=new d(g,p.metal);u.position.set(-.5,6.25,0),n.add(u);const m=u.clone();m.position.x=.5,n.add(m),n.position.set(e,0,t),v.add(n)})}function _t(){const a=new w(.04,.02,14),e=new d(a,p.neon);e.position.set(-5.04,.23,-2),v.add(e);const t=new w(12,.02,.04),s=new d(t,p.neonBlue);s.position.set(2,.23,3.04),v.add(s);const n=new w(26,.03,.03),o=new d(n,p.neonPurple);o.position.set(0,6.15,0),v.add(o);const i=new w(.03,.03,18),r=new d(i,p.neon);r.position.set(0,6.15,0),v.add(r)}function Ct(){const a=new E;a.name="center-platform";const e=new A(1.5,1.6,.15,8),t=new d(e,p.metal);t.position.set(0,.28,0),t.receiveShadow=!0,a.add(t);const s=new A(1,1,.2,16),n=new d(s,p.accent);n.position.set(0,.32,0),a.add(n);const o=new ie(1.3,.02,8,32),i=new d(o,p.neon);i.rotation.x=Math.PI/2,i.position.set(0,.4,0),i.name="holo-ring",a.add(i);const r=new d(new ie(1.1,.015,8,32),p.neonBlue);r.rotation.x=Math.PI/2,r.rotation.z=Math.PI/6,r.position.set(0,.5,0),r.name="holo-ring-2",a.add(r),v.add(a)}function jt(){const a=new E;a.name="bookshelf";const e=new w(2,3,.4),t=new d(e,p.desk);t.position.set(0,1.7,0),t.castShadow=!0,a.add(t);for(let n=0;n<4;n++){const o=new w(1.9,.04,.38),i=new d(o,p.deskTop);i.position.set(0,.5+n*.7,0),a.add(i)}const s=[6333946,16281969,3462041,16498468,10980346,16020150];for(let n=0;n<3;n++){let o=-.8;for(let i=0;i<5;i++){const r=.08+Math.random()*.15,l=.25+Math.random()*.15,h=new w(r,l,.25),g=new C({color:s[(n*5+i)%s.length],roughness:.8}),u=new d(h,g);u.position.set(o+r/2,.55+n*.7+l/2,0),a.add(u),o+=r+.02}}a.position.set(-12.5,.2,-4),a.rotation.y=Math.PI/2,v.add(a)}function Pt(){const a=new E;a.name="water-cooler";const e=new w(.4,1.2,.35),t=new d(e,p.server);t.position.set(0,.8,0),t.castShadow=!0,a.add(t);const s=new A(.14,.16,.5,12),n=new lt({color:9684477,transmission:.8,roughness:.1,thickness:.3,transparent:!0,opacity:.5}),o=new d(s,n);o.position.set(0,1.65,0),a.add(o),a.position.set(11,.2,-4),v.add(a)}function Lt(){const a=new E;a.name="wall-clock";const e=new d(new A(.4,.4,.04,24),p.whiteboard);e.rotation.x=Math.PI/2,e.position.set(-6,4.5,-9.9),a.add(e);const t=new d(new ie(.4,.02,8,24),p.frame);t.position.set(-6,4.5,-9.88),a.add(t);const s=new w(.02,.2,.01),n=new d(s,p.frame);n.position.set(-6,4.6,-9.86),n.rotation.z=Math.PI/4,a.add(n);const o=new w(.015,.3,.01),i=new d(o,p.accent);i.position.set(-6,4.6,-9.84),i.rotation.z=-Math.PI/6,a.add(i),v.add(a);const r=new E;r.name="ceiling-fan";const l=new d(new A(.1,.1,.08,12),p.metal);l.position.set(0,6.1,0),r.add(l);const h=new d(new A(.02,.02,.4,6),p.metal);h.position.set(0,6.3,0),r.add(h);for(let y=0;y<4;y++){const T=new w(1.5,.02,.25),k=new d(T,p.desk);k.position.set(0,6.08,0),k.rotation.y=y/4*Math.PI*2,k.translateX(.75),r.add(k)}r.position.set(2,0,-2),v.add(r);const g=new E;g.name="door-frame";const u=new d(new w(.1,3,.1),p.frame);u.position.set(-13.95,1.7,5),g.add(u);const m=u.clone();m.position.z=7,g.add(m);const x=new d(new w(.1,.1,2.1),p.frame);x.position.set(-13.95,3.2,6),g.add(x),v.add(g)}function _s(){Be(q())}function Cs(a){$=a;const e=q();Be(e),pt(a),v=new E,v.name="office",ut(),gt(),mt(),wt(),ft(6),yt(),vt(),xt(),bt(),kt(),Mt(),St(),_t(),Ct(),jt(),Pt(),Lt(),e.add(v)}const R=new Map;let Y=null,L=null,we=null;function js(a){var e;(e=a==null?void 0:a.traverse)==null||e.call(a,t=>{var s,n,o,i;(n=(s=t.geometry)==null?void 0:s.dispose)==null||n.call(s),Array.isArray(t.material)?t.material.forEach(r=>{var l;return(l=r==null?void 0:r.dispose)==null?void 0:l.call(r)}):(i=(o=t.material)==null?void 0:o.dispose)==null||i.call(o)})}const st={parser:{body:6333946,accent:3900150,eye:14412542,glow:6333946},analyzer:{body:10980346,accent:9133302,eye:15591934,glow:10980346},tester:{body:3462041,accent:1096065,eye:13761253,glow:3462041},healer:{body:16498468,accent:16096779,eye:16708551,glow:16498468},planner:{body:16020150,accent:15485081,eye:16574451,glow:16020150},reporter:{body:2282478,accent:440020,eye:13630206,glow:2282478}},Ps={body:9741240,accent:6583435,eye:15857145,glow:9741240},nt={idle:{speed:.5,bobAmp:.03,rotSpeed:0},working:{speed:2,bobAmp:.06,rotSpeed:.5},testing:{speed:2.5,bobAmp:.08,rotSpeed:.8},thinking:{speed:1,bobAmp:.02,rotSpeed:.3},error:{speed:4,bobAmp:.04,rotSpeed:0,shake:!0},failed:{speed:4,bobAmp:.04,rotSpeed:0,shake:!0},done:{speed:1,bobAmp:.05,rotSpeed:.2},passed:{speed:1,bobAmp:.05,rotSpeed:.2}},Ls=new Set(["working","testing","thinking","scanning","navigating","interacting","asserting","reporting"]);class As{constructor(e){Y=e,this._time=0,this._bubbleTimers=new Map,this._deskAssignments=new Map,this._eventAssignments=new Map,this._initCSS2D()}_initCSS2D(){var e;(e=L==null?void 0:L.domElement)!=null&&e.parentNode&&L.domElement.parentNode.removeChild(L.domElement),L=new is,L.setSize(window.innerWidth,window.innerHeight),L.domElement.style.position="fixed",L.domElement.style.top="0",L.domElement.style.left="0",L.domElement.style.pointerEvents="none",L.domElement.style.zIndex="5",document.body.appendChild(L.domElement),we=()=>{L.setSize(window.innerWidth,window.innerHeight)},window.addEventListener("resize",we)}sync(e){const t=new Set,s=new Set;e.forEach((n,o)=>{t.add(n.name),R.has(n.name)||this._createRobot(n,o,e.length),this._updateStatus(n.name,n.status);const i=this._eventAssignments.get(n.name);(typeof i=="boolean"?i:this._isActiveStatus(n.status))&&s.add(n.name)});for(const n of this._eventAssignments.keys())t.has(n)||this._eventAssignments.delete(n);for(const[n,o]of this._deskAssignments)(!t.has(n)||!s.has(n))&&this._deskAssignments.delete(n);s.forEach(n=>{if(!this._deskAssignments.has(n)){const o=this._nextFreeDesk();o>=0&&this._deskAssignments.set(n,o)}}),this._syncDeskOccupancy(),t.forEach(n=>{const o=R.get(n);if(!o)return;const i=this._deskAssignments.get(n);if(typeof i=="number"&&Q[i]){const r=Q[i];this._setTarget(o,r.x,r.z+1.2,"desk",r)}else{const r=ee[o.pondSlot%Math.max(1,ee.length)]||{x:-9,z:6.2};this._setTarget(o,r.x,r.z,"pond")}});for(const[n]of R)t.has(n)||(this._deskAssignments.delete(n),this._removeRobot(n));this._scheduleBubbles(e)}applyAssignmentEvent(e){const t=e==null?void 0:e.name;if(!t||!R.has(t))return null;if(this._eventAssignments.set(t,!0),!this._deskAssignments.has(t)){const r=this._nextFreeDesk();r>=0&&this._deskAssignments.set(t,r)}const s=R.get(t),n=this._deskAssignments.get(t);if(!s||typeof n!="number"||!Q[n])return null;const o=Q[n],i={x:s.baseX,z:s.baseZ};return this._setTarget(s,o.x,o.z+1.2,"desk",o),this._syncDeskOccupancy(),this._flashSummon(t),{from:i,to:{x:o.x,z:o.z+1.2},kind:"assigned"}}applyReleaseEvent(e){const t=e==null?void 0:e.name;if(!t||!R.has(t))return null;this._eventAssignments.set(t,!1),this._deskAssignments.delete(t);const s=R.get(t);if(!s)return null;const n=ee[s.pondSlot%Math.max(1,ee.length)]||{x:-9,z:6.2},o={x:s.baseX,z:s.baseZ};return this._setTarget(s,n.x,n.z,"pond"),this._syncDeskOccupancy(),{from:o,to:{x:n.x,z:n.z},kind:"released"}}_flashSummon(e){const t=R.get(e);if(!t)return;if(t.parts.glow){const h=t.parts.glow.intensity;t.parts.glow.intensity=1.9,setTimeout(()=>{const g=R.get(e);g&&g.parts.glow&&(g.parts.glow.intensity=h)},700)}const s=new ie(.3,.04,8,20),n=new G({color:6333946,transparent:!0,opacity:.88,depthWrite:!1}),o=new d(s,n);o.rotation.x=-Math.PI/2,o.position.set(t.baseX,.24,t.baseZ),Y.add(o);let i=0;const r=.78,l=()=>{i+=.016,o.position.set(t.baseX,.24,t.baseZ),o.scale.setScalar(1+i/r*4.5),o.material.opacity=Math.max(0,.88*(1-i/r)),i<r?requestAnimationFrame(l):(Y.remove(o),s.dispose(),n.dispose())};requestAnimationFrame(l)}update(e){this._time+=e;for(const[t,s]of R){const n=nt[s.status]||nt.idle;let o=s.targetX,i=s.targetZ;s.path.length&&(o=s.path[0].x,i=s.path[0].z);const r=o-s.baseX,l=i-s.baseZ,h=Math.hypot(r,l);if(h>.01){const u=s.zone==="desk"?4.2:2.6,m=Math.min(1,e*u/h);s.baseX+=r*m,s.baseZ+=l*m,s.group.lookAt(new z(o,.2,i))}else s.path.length?s.path.shift():s.zone==="desk"&&s.deskPos?s.group.lookAt(new z(s.deskPos.x,.2,s.deskPos.z)):s.zone==="pond"&&s.group.lookAt(new z(-9,.2,6.2));const g=Math.sin(this._time*n.speed*2)*n.bobAmp;if(s.group.position.y=s.baseY+g,s.parts.leftArm&&(s.parts.leftArm.rotation.x=Math.sin(this._time*n.speed)*.3),s.parts.rightArm&&(s.parts.rightArm.rotation.x=-Math.sin(this._time*n.speed)*.3),s.parts.head&&n.rotSpeed>0&&(s.parts.head.rotation.y=Math.sin(this._time*n.rotSpeed)*.2),n.shake?(s.group.position.x=s.baseX+Math.sin(this._time*30)*.04,s.group.position.z=s.baseZ+Math.cos(this._time*25)*.02):(s.group.position.x=s.baseX,s.group.position.z=s.baseZ),s.parts.leftEye&&s.parts.rightEye){const u=.5+.5*Math.sin(this._time*n.speed*1.5);s.parts.leftEye.material.opacity=.6+u*.4,s.parts.rightEye.material.opacity=.6+u*.4}if(s.parts.antenna){const u=.3+.7*Math.abs(Math.sin(this._time*3));s.parts.antenna.material.emissiveIntensity=u}}if(L&&Y){const t=Y.userData.camera;t&&L.render(Y,t)}}_createRobot(e,t,s){const n=e.role||"parser";let o=st[n]||Ps;if(e.color&&!st[n]){const me=parseInt(e.color.replace("#",""),16);if(!isNaN(me)){const It=new _(me).lerp(new _(16777215),.35).getHex();o={body:me,accent:me,eye:It,glow:me}}}const i=new E;i.name=`agent-${e.name}`;const r={},l=new C({color:o.body,roughness:.4,metalness:.5}),h=new C({color:o.accent,roughness:.3,metalness:.6}),g=new G({color:o.eye,transparent:!0,opacity:.9}),u=new C({color:9741240,roughness:.2,metalness:.8}),m=new C({color:o.glow,roughness:.3,metalness:.4,emissive:o.glow,emissiveIntensity:.5}),x=new w(.5,.6,.35),y=new d(x,l);y.position.y=.9,y.castShadow=!0,i.add(y),r.body=y;const T=new w(.35,.35,.02),k=new d(T,h);k.position.set(0,.95,.19),i.add(k);const S=new be(.04,8),P=new d(S,m);P.position.set(0,1,.205),r.chestLed=P,i.add(P);const b=new w(.4,.35,.3),F=new d(b,l);F.position.y=1.45,F.castShadow=!0,i.add(F),r.head=F;const W=new w(.35,.15,.02),K=new d(W,new C({color:1120295,roughness:.1,metalness:.9}));K.position.set(0,1.48,.17),i.add(K);const I=new be(.035,8),Z=new d(I,g);Z.position.set(-.08,1.48,.185),i.add(Z),r.leftEye=Z;const H=new d(I,g.clone());H.position.set(.08,1.48,.185),i.add(H),r.rightEye=H;const X=new A(.015,.015,.2,6),J=new d(X,u);J.position.set(0,1.72,0),i.add(J);const _e=new te(.035,8,8),ae=new d(_e,m);ae.position.set(0,1.84,0),i.add(ae),r.antenna=ae;const re=new w(.12,.45,.12),D=new d(re,h);D.position.set(-.36,.85,0),D.castShadow=!0,i.add(D),r.leftArm=D;const V=new te(.06,8,8),ge=new d(V,u);ge.position.set(-.36,.58,0),i.add(ge);const se=new d(re,h);se.position.set(.36,.85,0),se.castShadow=!0,i.add(se),r.rightArm=se;const Oe=new d(V,u);Oe.position.set(.36,.58,0),i.add(Oe);const $e=new w(.14,.35,.14),ve=new d($e,l);ve.position.set(-.12,.38,0),ve.castShadow=!0,i.add(ve),r.leftLeg=ve;const xe=new d($e,l);xe.position.set(.12,.38,0),xe.castShadow=!0,i.add(xe),r.rightLeg=xe;const Fe=new w(.16,.06,.2),De=new d(Fe,h);De.position.set(-.12,.23,.03),i.add(De);const We=new d(Fe,h);We.position.set(.12,.23,.03),i.add(We);const Et=new w(.25,.3,.15),Ce=new d(Et,h);Ce.position.set(0,.95,-.25),Ce.castShadow=!0,i.add(Ce);const Tt=new A(.03,.04,.06,6),je=new d(Tt,u);je.position.set(-.06,.77,-.3),i.add(je);const He=je.clone();He.position.x=.06,i.add(He);const zt=new be(.3,16),Gt=new G({color:0,transparent:!0,opacity:.15}),Pe=new d(zt,Gt);Pe.rotation.x=-Math.PI/2,Pe.position.y=.21,i.add(Pe);const Ve=t%Math.max(1,ee.length),Ze=ee[Ve]||{x:-9,z:6.2},Le=Ze.x,Ae=Ze.z;i.position.set(Le,.2,Ae),i.lookAt(new z(-9,.2,6.2)),Y.add(i);const Ee=document.createElement("div");Ee.className="agent-label-3d",Ee.innerHTML=`${e.name}<span class="role">${n}</span>`;const Te=new Je(Ee);Te.position.set(0,2.1,0),i.add(Te);const ze=new le(o.glow,.3,4,2);ze.position.set(0,1.2,0),i.add(ze),r.glow=ze,R.set(e.name,{group:i,parts:r,label:Te,status:e.status||"idle",role:n,baseX:Le,baseY:.2,baseZ:Ae,deskPos:null,pondSlot:Ve,zone:"pond",targetX:Le,targetZ:Ae,path:[]})}_updateStatus(e,t){const s=R.get(e);if(!s)return;s.status=t;const n={idle:.2,working:.6,testing:.7,thinking:.4,error:1,failed:1,done:.5,passed:.5};s.parts.glow&&(s.parts.glow.intensity=n[t]||.2)}_isActiveStatus(e){return Ls.has(e||"idle")}_nextFreeDesk(){const e=new Set(this._deskAssignments.values());for(let t=0;t<Q.length;t++)if(!e.has(t))return t;return-1}_setTarget(e,t,s,n,o=null){if(!(n!==e.zone||Math.hypot(e.targetX-t,e.targetZ-s)>.06)){e.deskPos=o;return}e.targetX=t,e.targetZ=s,e.zone=n,e.deskPos=o,e.path=this._buildPath(e,t,s,n)}_buildPath(e,t,s,n){const o=[];return Math.abs(e.baseZ-2.6)<.6||o.push({x:e.baseX,z:2.6}),n==="desk"?(o.push({x:t,z:2.6}),o.push({x:t,z:s}),o):(o.push({x:-6.4,z:2.6+1.1}),o.push({x:t,z:s}),o)}_syncDeskOccupancy(){for(let e=0;e<Q.length;e++)tt(e,!1);for(const e of this._deskAssignments.values())tt(e,!0)}_removeRobot(e){const t=R.get(e);if(!t)return;Y.remove(t.group),js(t.group),R.delete(e),this._syncDeskOccupancy();const s=this._bubbleTimers.get(e);s&&(clearTimeout(s),this._bubbleTimers.delete(e))}_scheduleBubbles(e){const t={working:["正在执行...","快了快了","处理中...","加油 💪"],testing:["跑测试中...","验证 API...","等结果..."],thinking:["让我想想...","分析中...","推理...","🤔"],error:["出错了!","修复中...","糟糕..."],idle:["摸鱼中~","等任务...","☕ 喝咖啡","zzZ"],done:["搞定!","完成 ✓","下一个!"],passed:["全绿 ✓","测试通过!"],failed:["有失败...","需要修复"]},s=new Set;e.forEach(n=>{if(s.add(n.name),this._bubbleTimers.has(n.name))return;const o=()=>{const r=R.get(n.name);if(!r)return;const l=r.status||"idle",h=t[l]||t.idle,g=h[Math.floor(Math.random()*h.length)];this._showBubble(n.name,g);const u=6e3+Math.random()*8e3;this._bubbleTimers.set(n.name,setTimeout(o,u))},i=1e3+Math.random()*3e3;this._bubbleTimers.set(n.name,setTimeout(o,i))});for(const[n,o]of this._bubbleTimers)s.has(n)||(clearTimeout(o),this._bubbleTimers.delete(n))}_showBubble(e,t){const s=R.get(e);if(!s)return;s.bubbleObj&&s.group.remove(s.bubbleObj);const n=document.createElement("div");n.className="bubble-3d",n.textContent=t;const o=new Je(n);o.position.set(.4,2.3,0),s.group.add(o),s.bubbleObj=o,setTimeout(()=>{s.bubbleObj===o&&(s.group.remove(o),s.bubbleObj=null)},3e3)}dispose(){var e;for(const t of this._bubbleTimers.values())clearTimeout(t);this._bubbleTimers.clear(),this._deskAssignments.clear(),this._eventAssignments.clear();for(const t of[...R.keys()])this._removeRobot(t);we&&(window.removeEventListener("resize",we),we=null),(e=L==null?void 0:L.domElement)!=null&&e.parentNode&&L.domElement.parentNode.removeChild(L.domElement),L=null,Y=null}}function Es(a){var e;(e=a==null?void 0:a.traverse)==null||e.call(a,t=>{var s,n,o,i;(n=(s=t.geometry)==null?void 0:s.dispose)==null||n.call(s),Array.isArray(t.material)?t.material.forEach(r=>{var l;return(l=r==null?void 0:r.dispose)==null?void 0:l.call(r)}):(i=(o=t.material)==null?void 0:o.dispose)==null||i.call(o)})}class Ts{constructor(e){this.scene=e,this.systems=[],this._time=0,this._createAmbientParticles(),this._createDataStreamParticles(),this._createGroundGlow()}update(e){this._time+=e;for(const t of this.systems)t.update&&t.update(e,this._time)}_createAmbientParticles(){const t=new Float32Array(1500),s=new Float32Array(500*3),n=new Float32Array(500),o=new Float32Array(500),i=new Float32Array(500*3),r=[new _(3462041),new _(6333946),new _(10980346),new _(2282478),new _(16777215)];for(let u=0;u<500;u++){t[u*3]=(Math.random()-.5)*40,t[u*3+1]=Math.random()*15,t[u*3+2]=(Math.random()-.5)*30,s[u*3]=(Math.random()-.5)*.2,s[u*3+1]=.05+Math.random()*.15,s[u*3+2]=(Math.random()-.5)*.2,n[u]=.02+Math.random()*.08,o[u]=.1+Math.random()*.4;const m=r[Math.floor(Math.random()*r.length)];i[u*3]=m.r,i[u*3+1]=m.g,i[u*3+2]=m.b}const l=new oe;l.setAttribute("position",new O(t,3)),l.setAttribute("aVelocity",new O(s,3)),l.setAttribute("aSize",new O(n,1)),l.setAttribute("aOpacity",new O(o,1)),l.setAttribute("color",new O(i,3));const h=new fe({uniforms:{uTime:{value:0},uPixelRatio:{value:Math.min(window.devicePixelRatio,2)}},vertexShader:`
|
|
44
|
+
attribute float aSize;
|
|
45
|
+
attribute float aOpacity;
|
|
46
|
+
attribute vec3 aVelocity;
|
|
47
|
+
attribute vec3 color;
|
|
48
|
+
uniform float uTime;
|
|
49
|
+
uniform float uPixelRatio;
|
|
50
|
+
varying float vOpacity;
|
|
51
|
+
varying vec3 vColor;
|
|
52
|
+
void main() {
|
|
53
|
+
vOpacity = aOpacity;
|
|
54
|
+
vColor = color;
|
|
55
|
+
vec3 pos = position;
|
|
56
|
+
// Gentle floating motion
|
|
57
|
+
pos.x += sin(uTime * aVelocity.x + position.z * 2.0) * 0.5;
|
|
58
|
+
pos.y += mod(pos.y + uTime * aVelocity.y, 15.0);
|
|
59
|
+
pos.z += cos(uTime * aVelocity.z + position.x * 2.0) * 0.5;
|
|
60
|
+
vec4 mvPos = modelViewMatrix * vec4(pos, 1.0);
|
|
61
|
+
gl_PointSize = aSize * uPixelRatio * (150.0 / -mvPos.z);
|
|
62
|
+
gl_Position = projectionMatrix * mvPos;
|
|
63
|
+
}
|
|
64
|
+
`,fragmentShader:`
|
|
65
|
+
varying float vOpacity;
|
|
66
|
+
varying vec3 vColor;
|
|
67
|
+
void main() {
|
|
68
|
+
float d = length(gl_PointCoord - vec2(0.5));
|
|
69
|
+
if (d > 0.5) discard;
|
|
70
|
+
float alpha = (1.0 - smoothstep(0.2, 0.5, d)) * vOpacity;
|
|
71
|
+
gl_FragColor = vec4(vColor, alpha);
|
|
72
|
+
}
|
|
73
|
+
`,transparent:!0,depthWrite:!1,blending:de,vertexColors:!0}),g=new he(l,h);g.name="ambient-particles",this.scene.add(g),this.systems.push({mesh:g,update:(u,m)=>{h.uniforms.uTime.value=m}})}_createDataStreamParticles(){[{x:-10,z:-4.5},{x:0,z:0},{x:-10,z:-1.5}].forEach((t,s)=>{const o=new Float32Array(240),i=new Float32Array(80);for(let u=0;u<80;u++)o[u*3]=t.x+(Math.random()-.5)*.6,o[u*3+1]=Math.random()*6,o[u*3+2]=t.z+(Math.random()-.5)*.6,i[u]=1+Math.random()*2;const r=new oe;r.setAttribute("position",new O(o,3)),r.setAttribute("aSpeed",new O(i,1));const l=s===1?3462041:s===0?6333946:10980346,h=new fe({uniforms:{uTime:{value:0},uColor:{value:new _(l)},uPixelRatio:{value:Math.min(window.devicePixelRatio,2)}},vertexShader:`
|
|
74
|
+
attribute float aSpeed;
|
|
75
|
+
uniform float uTime;
|
|
76
|
+
uniform float uPixelRatio;
|
|
77
|
+
varying float vAlpha;
|
|
78
|
+
void main() {
|
|
79
|
+
vec3 pos = position;
|
|
80
|
+
float y = mod(pos.y + uTime * aSpeed, 6.0);
|
|
81
|
+
pos.y = y + 0.3;
|
|
82
|
+
vAlpha = 1.0 - y / 6.0; // Fade as they rise
|
|
83
|
+
vec4 mvPos = modelViewMatrix * vec4(pos, 1.0);
|
|
84
|
+
gl_PointSize = 3.0 * uPixelRatio * (100.0 / -mvPos.z);
|
|
85
|
+
gl_Position = projectionMatrix * mvPos;
|
|
86
|
+
}
|
|
87
|
+
`,fragmentShader:`
|
|
88
|
+
uniform vec3 uColor;
|
|
89
|
+
varying float vAlpha;
|
|
90
|
+
void main() {
|
|
91
|
+
float d = length(gl_PointCoord - vec2(0.5));
|
|
92
|
+
if (d > 0.5) discard;
|
|
93
|
+
float alpha = (1.0 - d * 2.0) * vAlpha * 0.6;
|
|
94
|
+
gl_FragColor = vec4(uColor, alpha);
|
|
95
|
+
}
|
|
96
|
+
`,transparent:!0,depthWrite:!1,blending:de}),g=new he(r,h);g.name=`data-stream-${s}`,this.scene.add(g),this.systems.push({mesh:g,update:(u,m)=>{h.uniforms.uTime.value=m}})})}_createGroundGlow(){const e=new be(3,32),t=new fe({uniforms:{uTime:{value:0},uColor:{value:new _(3462041)},uIntensity:{value:.15}},vertexShader:`
|
|
97
|
+
varying vec2 vUv;
|
|
98
|
+
void main() {
|
|
99
|
+
vUv = uv;
|
|
100
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
101
|
+
}
|
|
102
|
+
`,fragmentShader:`
|
|
103
|
+
uniform float uTime;
|
|
104
|
+
uniform vec3 uColor;
|
|
105
|
+
uniform float uIntensity;
|
|
106
|
+
varying vec2 vUv;
|
|
107
|
+
void main() {
|
|
108
|
+
vec2 center = vUv - vec2(0.5);
|
|
109
|
+
float dist = length(center) * 2.0;
|
|
110
|
+
float ring1 = smoothstep(0.8, 0.85, dist) - smoothstep(0.85, 0.9, dist);
|
|
111
|
+
float ring2 = smoothstep(0.5, 0.55, dist) - smoothstep(0.55, 0.6, dist);
|
|
112
|
+
float pulse = 0.5 + 0.5 * sin(uTime * 2.0);
|
|
113
|
+
float glow = (1.0 - dist) * uIntensity;
|
|
114
|
+
float rings = (ring1 + ring2 * 0.5) * 0.3 * pulse;
|
|
115
|
+
float alpha = max(glow, rings);
|
|
116
|
+
if (alpha < 0.01) discard;
|
|
117
|
+
gl_FragColor = vec4(uColor, alpha);
|
|
118
|
+
}
|
|
119
|
+
`,transparent:!0,depthWrite:!1,side:ye}),s=new d(e,t);s.rotation.x=-Math.PI/2,s.position.set(0,.22,0),s.name="ground-glow",this.scene.add(s),this.systems.push({mesh:s,update:(n,o)=>{t.uniforms.uTime.value=o}})}triggerCelebration(){const t=new Float32Array(600),s=[],n=new Float32Array(200*3),o=new Float32Array(200),i=[new _(3462041),new _(6333946),new _(16498468),new _(16020150),new _(10980346),new _(2282478)];for(let m=0;m<200;m++){t[m*3]=0,t[m*3+1]=2,t[m*3+2]=0;const x=Math.random()*Math.PI*2,y=Math.random()*Math.PI,T=3+Math.random()*5;s.push(Math.sin(y)*Math.cos(x)*T,Math.cos(y)*T*.5+4,Math.sin(y)*Math.sin(x)*T);const k=i[Math.floor(Math.random()*i.length)];n[m*3]=k.r,n[m*3+1]=k.g,n[m*3+2]=k.b,o[m]=.05+Math.random()*.1}const r=new oe;r.setAttribute("position",new O(t,3)),r.setAttribute("color",new O(n,3));const l=new Ne({size:.08,transparent:!0,opacity:1,vertexColors:!0,blending:de,depthWrite:!1}),h=new he(r,l);h.name="celebration",this.scene.add(h);let g=0;const u={mesh:h,update:m=>{if(g+=m,g>3){this.scene.remove(h),r.dispose(),l.dispose();const y=this.systems.indexOf(u);y>=0&&this.systems.splice(y,1);return}const x=r.attributes.position.array;for(let y=0;y<200;y++)x[y*3]+=s[y*3]*m,x[y*3+1]+=s[y*3+1]*m,x[y*3+2]+=s[y*3+2]*m,s[y*3+1]-=9.8*m;r.attributes.position.needsUpdate=!0,l.opacity=Math.max(0,1-g/3)}};this.systems.push(u)}triggerAgentTransfer(e,t,s="assigned"){if(!e||!t)return;const n=s==="released"?16498468:6333946,o=s==="released"?3462041:2282478;this._triggerPulse(e.x,.34,e.z,n,s==="released"?.8:1.1),this._triggerPulse(t.x,.34,t.z,o,s==="released"?1.2:.9,180);const i=s==="assigned"?e:t;i.x!=null&&this.triggerPondRipple(i.x,i.z??6.2)}triggerPondRipple(e,t){const s=new Ie(.18,.32,24),n=new G({color:959977,transparent:!0,opacity:.65,side:ye,depthWrite:!1}),o=new d(s,n);o.rotation.x=-Math.PI/2,o.position.set(e,.31,t),this.scene.add(o);let i=0;const r={mesh:o,update:l=>{if(i+=l,i>=1.1){this.scene.remove(o),s.dispose(),n.dispose();const h=this.systems.indexOf(r);h>=0&&this.systems.splice(h,1);return}o.scale.setScalar(1+i*3.2),o.material.opacity=Math.max(0,.65*(1-i/1.1))}};this.systems.push(r)}_triggerPulse(e,t,s,n,o=1,i=0){const r=()=>{const h=new Float32Array(114),g=new Float32Array(38*3);for(let S=0;S<38;S++){h[S*3]=e,h[S*3+1]=t,h[S*3+2]=s;const P=S/38*Math.PI*2,b=.8+Math.random()*1.4;g[S*3]=Math.cos(P)*b,g[S*3+1]=.8+Math.random()*o,g[S*3+2]=Math.sin(P)*b}const u=new oe;u.setAttribute("position",new O(h,3));const m=new Ne({size:.09,color:n,transparent:!0,opacity:.92,blending:de,depthWrite:!1}),x=new he(u,m);this.scene.add(x);let y=0;const T=.68,k={mesh:x,update:S=>{if(y+=S,y>=T){this.scene.remove(x),u.dispose(),m.dispose();const b=this.systems.indexOf(k);b>=0&&this.systems.splice(b,1);return}const P=u.attributes.position.array;for(let b=0;b<38;b++)P[b*3]+=g[b*3]*S,P[b*3+1]+=g[b*3+1]*S,P[b*3+2]+=g[b*3+2]*S,g[b*3+1]-=2.8*S;u.attributes.position.needsUpdate=!0,m.opacity=Math.max(0,.92-y/T*.92)}};this.systems.push(k)};i>0?setTimeout(r,i):r()}dispose(){for(const e of this.systems)e.mesh&&(this.scene.remove(e.mesh),Es(e.mesh));this.systems=[]}}const zs={office:{position:new z(18,14,18),target:new z(0,2,0)},graph:{position:new z(0,25,.1),target:new z(0,0,0)},closeup:{position:new z(5,4,8),target:new z(0,2,0)},overview:{position:new z(30,20,30),target:new z(0,0,0)}};class Gs{constructor(e,t,s){this.camera=t,this.scene=s,s.userData.camera=t,this.controls=new as(t,e),this.controls.enableDamping=!0,this.controls.dampingFactor=.08,this.controls.enablePan=!0,this.controls.panSpeed=.8,this.controls.rotateSpeed=.6,this.controls.zoomSpeed=1.2,this.controls.minDistance=3,this.controls.maxDistance=60,this.controls.maxPolarAngle=Math.PI*.48,this.controls.minPolarAngle=Math.PI*.05,this.controls.target.set(0,2,0),this.controls.autoRotate=!0,this.controls.autoRotateSpeed=.3,this._flying=!1,this._flyStart={pos:new z,tgt:new z},this._flyEnd={pos:new z,tgt:new z},this._flyProgress=0,this._flyDuration=1.5}update(e){if(this._flying){this._flyProgress+=e/this._flyDuration,this._flyProgress>=1&&(this._flyProgress=1,this._flying=!1);const t=1-Math.pow(1-this._flyProgress,3);this.camera.position.lerpVectors(this._flyStart.pos,this._flyEnd.pos,t),this.controls.target.lerpVectors(this._flyStart.tgt,this._flyEnd.tgt,t)}this.controls.update()}flyTo(e,t=1.5){let s;if(typeof e=="string"){if(s=zs[e],!s)return}else s=e;this._flyStart.pos.copy(this.camera.position),this._flyStart.tgt.copy(this.controls.target),this._flyEnd.pos.copy(s.position),this._flyEnd.tgt.copy(s.target),this._flyProgress=0,this._flyDuration=t,this._flying=!0}flyToModule(e,t){this.flyTo({position:new z(e+8,10,t+8),target:new z(e,1,t)})}enableAutoRotate(){this.controls.autoRotate=!0,this.controls.autoRotateSpeed=.3}disableAutoRotate(){this.controls.autoRotate=!1}getControls(){return this.controls}dispose(){var e,t,s,n;(t=(e=this.controls)==null?void 0:e.dispose)==null||t.call(e),((n=(s=this.scene)==null?void 0:s.userData)==null?void 0:n.camera)===this.camera&&delete this.scene.userData.camera}}function At(a){var e;(e=a==null?void 0:a.traverse)==null||e.call(a,t=>{var s,n,o,i;(n=(s=t.geometry)==null?void 0:s.dispose)==null||n.call(s),Array.isArray(t.material)?t.material.forEach(r=>{var l;return(l=r==null?void 0:r.dispose)==null?void 0:l.call(r)}):(i=(o=t.material)==null?void 0:o.dispose)==null||i.call(o)})}const ot=[3462041,6333946,10980346,16020150,16498468,2282478,16281969,4906624,8490232,16486972,3718648,12616956,10741301,15235577,3003583];function Is(a){return ot[a%ot.length]}class Ns{constructor(e){this.scene=e,this.group=new E,this.group.name="graph-viz",this.group.position.set(0,8,0),this.group.visible=!1,e.add(this.group),this._nodes=new Map,this._edges=[],this._modules=new Map}update(e){if(!e||!e.nodes)return;for(;this.group.children.length>0;){const r=this.group.children[0];this.group.remove(r),r.geometry&&r.geometry.dispose(),r.material&&r.material.dispose()}this._nodes.clear(),this._edges=[],this._modules.clear();const{nodes:t,edges:s}=e;if(!t.length)return;const n=new Map;t.forEach(r=>{const l=r.module||"default";n.has(l)||n.set(l,[]),n.get(l).push(r)});const o=[...n.keys()],i=Math.max(4,o.length*1.2);o.forEach((r,l)=>{const h=l/o.length*Math.PI*2,g=Math.cos(h)*i,u=Math.sin(h)*i,m=Is(l);this._modules.set(r,{x:g,z:u,color:m,idx:l});const x=new te(1.2,16,16),y=new G({color:m,transparent:!0,opacity:.08,wireframe:!0}),T=new d(x,y);T.position.set(g,0,u),this.group.add(T);const k=n.get(r);k.forEach((S,P)=>{const b=P/k.length*Math.PI*2,F=Math.min(k.length*.15,.9),W=g+Math.cos(b)*F,K=u+Math.sin(b)*F,I=Math.sin(P*.5)*.3,Z=new te(.08,8,8),H=new C({color:m,emissive:m,emissiveIntensity:.3,roughness:.3,metalness:.5}),X=new d(Z,H);X.position.set(W,I,K),this.group.add(X),this._nodes.set(S.id,{mesh:X,data:S,x:W,y:I,z:K})})}),s&&s.forEach(r=>{const l=this._nodes.get(r.from||r.source),h=this._nodes.get(r.to||r.target);if(!l||!h)return;const g=[new z(l.x,l.y,l.z),new z(h.x,h.y,h.z)],u=new oe().setFromPoints(g),m=new Jt({color:4674921,transparent:!0,opacity:.3}),x=new Yt(u,m);this.group.add(x),this._edges.push(x)})}show(){this.group.visible=!0}hide(){this.group.visible=!1}dispose(){this.scene.remove(this.group),At(this.group),this._nodes.clear(),this._edges=[],this._modules.clear()}}class Rs{constructor(e){this.scene=e,this.group=new E,this.group.name="hologram",this.group.position.set(0,2,0),e.add(this.group),this._time=0,this._build()}_build(){const e=new Ke(1,2),t=new G({color:3462041,wireframe:!0,transparent:!0,opacity:.2});this.sphere=new d(e,t),this.group.add(this.sphere);const s=new Ke(.6,1),n=new G({color:6333946,wireframe:!0,transparent:!0,opacity:.15});this.innerSphere=new d(s,n),this.group.add(this.innerSphere);const o=new te(.15,16,16),i=new G({color:3462041,transparent:!0,opacity:.6});this.core=new d(o,i),this.group.add(this.core);const r=new ie(1.3,.01,8,48),l=new G({color:3462041,transparent:!0,opacity:.3});this.ring1=new d(r,l),this.ring1.rotation.x=Math.PI/3,this.group.add(this.ring1);const h=new ie(1.5,.008,8,48),g=new G({color:6333946,transparent:!0,opacity:.2});this.ring2=new d(h,g),this.ring2.rotation.x=Math.PI/2,this.ring2.rotation.z=Math.PI/4,this.group.add(this.ring2);const u=new ie(1.1,.008,8,48),m=new G({color:10980346,transparent:!0,opacity:.2});this.ring3=new d(u,m),this.ring3.rotation.x=-Math.PI/4,this.ring3.rotation.y=Math.PI/3,this.group.add(this.ring3);const x=60,y=new Float32Array(x*3),T=new Float32Array(x),k=new Float32Array(x*3),S=[new _(3462041),new _(6333946),new _(10980346),new _(2282478)];for(let I=0;I<x;I++){const Z=.8+Math.random()*.5,H=Math.random()*Math.PI*2,X=Math.random()*Math.PI;y[I*3]=Z*Math.sin(X)*Math.cos(H),y[I*3+1]=Z*Math.cos(X),y[I*3+2]=Z*Math.sin(X)*Math.sin(H),T[I]=.03+Math.random()*.04;const J=S[Math.floor(Math.random()*S.length)];k[I*3]=J.r,k[I*3+1]=J.g,k[I*3+2]=J.b}const P=new oe;P.setAttribute("position",new O(y,3)),P.setAttribute("color",new O(k,3));const b=new Ne({size:.04,transparent:!0,opacity:.6,vertexColors:!0,blending:de,depthWrite:!1});this.dataPoints=new he(P,b),this.group.add(this.dataPoints);const F=new le(3462041,1,8,2);F.position.set(0,.5,0),this.group.add(F),this.holoLight=F;const W=new Re(2.5,.02),K=new G({color:3462041,transparent:!0,opacity:.3,side:ye});this.scanLine=new d(W,K),this.group.add(this.scanLine)}update(e,t){this._time+=e,this.sphere.rotation.y+=e*.15,this.sphere.rotation.x+=e*.05,this.innerSphere.rotation.y-=e*.2,this.innerSphere.rotation.z+=e*.1,this.ring1.rotation.y+=e*.3,this.ring2.rotation.y-=e*.2,this.ring3.rotation.z+=e*.25;const s=.8+.2*Math.sin(this._time*3);if(this.core.scale.setScalar(s),this.core.material.opacity=.4+.3*Math.sin(this._time*2),this.dataPoints.rotation.y+=e*.1,this.scanLine.position.y=Math.sin(this._time*1)*1.2,this.scanLine.material.opacity=.15+.15*Math.abs(Math.sin(this._time)),this.holoLight.intensity=.6+.4*Math.sin(this._time*2),t&&t.nodes){const n=t.nodes.length,o=Math.min(n/100,1);this.sphere.material.opacity=.1+o*.2,this.innerSphere.material.opacity=.08+o*.15}}dispose(){this.scene.remove(this.group),At(this.group)}}class Bs{constructor(){this._state={},this._listeners=new Map}set(e){Object.assign(this._state,e);for(const t of Object.keys(e)){const s=this._listeners.get(t);s&&s.forEach(n=>n(e[t],this._state))}}get(e){return this._state[e]}getAll(){return this._state}on(e,t){return this._listeners.has(e)||this._listeners.set(e,new Set),this._listeners.get(e).add(t),()=>{var s;return(s=this._listeners.get(e))==null?void 0:s.delete(t)}}}const it={idle:"空闲",working:"工作中",scanning:"扫描中",navigating:"导航中",interacting:"交互中",asserting:"断言中",reporting:"报告中",thinking:"思考中",complete:"完成",done:"完成",error:"错误"},at={idle:"dot-idle",working:"dot-active",scanning:"dot-active",navigating:"dot-active",interacting:"dot-active",asserting:"dot-active",reporting:"dot-active",thinking:"dot-active",complete:"dot-ok",done:"dot-ok",error:"dot-err"};class Os{constructor(e,t){this._state=e,this._options=t||{},this._callbacks={},this._logCount=0,this._esc=(t==null?void 0:t.esc)||(s=>String(s)),this._ROLE_ICONS=(t==null?void 0:t.ROLE_ICONS)||{},this._resolveIcon=(t==null?void 0:t.resolveRoleIcon)||(s=>this._ROLE_ICONS[s]||"🐊")}init(e){this._callbacks=e||{}}setLoading(e,t){const s=document.getElementById("loading-fill"),n=document.getElementById("loading-text");s&&(s.style.width=e+"%"),n&&(n.textContent=t||"Loading…")}addLog(e,t="info",s=!1){const n=document.getElementById("log-list");if(!n)return;this._logCount++;const i=new Date().toLocaleTimeString("zh-CN",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),r=document.createElement("div");r.className=`log-row log-${t}`;const l=`<span class="log-time">${i}</span>`,h=`<span class="log-level ${t}">[${t.toUpperCase()}]</span>`,g=document.createElement("span");for(g.className="log-msg",r.innerHTML=l+h,r.appendChild(g),n.appendChild(r),n.scrollTop=n.scrollHeight,s&&e.length>0?this._typewrite(g,e,0):g.textContent=e;n.children.length>300;)n.removeChild(n.firstChild)}_typewrite(e,t,s){s<t.length&&(e.textContent+=t[s],setTimeout(()=>this._typewrite(e,t,s+1),12))}showToast(e,t="info"){const s=document.getElementById("toast-container");if(!s)return;const n=document.createElement("div");n.className=`toast toast-${t}`,n.textContent=e,s.appendChild(n),setTimeout(()=>n.classList.add("show"),10),setTimeout(()=>{n.classList.remove("show"),setTimeout(()=>n.remove(),400)},3500)}updateSidebar(e,t){const s=document.getElementById("mod-list");if(s&&e&&e.nodes){const o={};e.nodes.forEach(i=>{const r=i.module||"default";o[r]||(o[r]=0),o[r]++}),s.innerHTML="",Object.entries(o).forEach(([i,r])=>{const l=document.createElement("div");l.className="mod-item",l.innerHTML=`
|
|
120
|
+
<span class="mod-dot"></span>
|
|
121
|
+
<span class="mod-name">${this._esc(i)}</span>
|
|
122
|
+
<span class="mod-count">${r}</span>
|
|
123
|
+
`,s.appendChild(l)})}const n=document.getElementById("agent-sidebar");n&&t&&(n.innerHTML="",(Array.isArray(t)?t:Object.entries(t).map(([i,r])=>({name:i,...r}))).forEach(i=>{const r=i.name||i.role||"",l=i.status||"idle",h=i.role||r,g=document.createElement("div");g.className="agent-sidebar-item";const u=i.category?` <span style="font-size:9px;color:var(--text-subtle);opacity:0.7">${this._esc(i.category)}</span>`:"";g.innerHTML=`
|
|
124
|
+
<span class="agent-icon">${this._resolveIcon(h)}</span>
|
|
125
|
+
<span class="agent-name">${this._esc(r)}${u}</span>
|
|
126
|
+
<span class="agent-status-dot ${at[l]||"dot-idle"}"></span>
|
|
127
|
+
<span class="agent-status-text">${it[l]||l}</span>
|
|
128
|
+
`,n.appendChild(g)}))}updateDeskCards(e){const t=document.getElementById("desk-row");if(!t||!e)return;const s=Array.isArray(e)?e:Object.entries(e).map(([o,i])=>({name:o,...i}));t.querySelectorAll(".desk-card").length!==s.length?(t.innerHTML="",s.forEach(o=>{const i=o.name||o.role||"",r=document.createElement("div");r.className="desk-card",r.id=`desk-${i}`,r.innerHTML=this._renderDeskCard(i,o),t.appendChild(r)})):s.forEach(o=>{const i=o.name||o.role||"",r=document.getElementById(`desk-${i}`);r&&(r.innerHTML=this._renderDeskCard(i,o))})}_renderDeskCard(e,t){const s=t.status||"idle",n=t.progress||0,o=t.role||e;return`
|
|
129
|
+
<div class="dc-icon">${this._resolveIcon(o)}</div>
|
|
130
|
+
<div class="dc-name">${this._esc(e)}</div>
|
|
131
|
+
<div class="dc-status ${at[s]||""}">${it[s]||s}</div>
|
|
132
|
+
<div class="dc-bar"><div class="dc-fill" style="width:${n}%"></div></div>
|
|
133
|
+
${t.currentTask?`<div class="dc-task">${this._esc(t.currentTask)}</div>`:""}
|
|
134
|
+
`}updateStats(e){if(!e)return;const t=(r,l)=>{const h=document.getElementById(r);h&&(h.textContent=l)},s=e.nodes||[],n=new Set(s.map(r=>r.module||"default")),o=s.filter(r=>r.type==="model"),i=s.filter(r=>r.type==="api"||r.type==="endpoint");t("s-mod",n.size),t("s-mdl",o.length),t("s-api",i.length),t("s-files",s.length)}updateResults(e){const t=document.getElementById("results-panel");if(!t)return;if(!e){t.innerHTML='<div class="empty-hint">暂无测试结果</div>';return}const s=e.total||0,n=e.passed||0,o=e.failed||0,i=e.skipped||0,r=s?Math.round(n/s*100):0;t.innerHTML=`
|
|
135
|
+
<div class="result-summary">
|
|
136
|
+
<div class="result-metric">
|
|
137
|
+
<span class="metric-val">${s}</span>
|
|
138
|
+
<span class="metric-label">总计</span>
|
|
139
|
+
</div>
|
|
140
|
+
<div class="result-metric ok">
|
|
141
|
+
<span class="metric-val">${n}</span>
|
|
142
|
+
<span class="metric-label">通过</span>
|
|
143
|
+
</div>
|
|
144
|
+
<div class="result-metric err">
|
|
145
|
+
<span class="metric-val">${o}</span>
|
|
146
|
+
<span class="metric-label">失败</span>
|
|
147
|
+
</div>
|
|
148
|
+
<div class="result-metric warn">
|
|
149
|
+
<span class="metric-val">${i}</span>
|
|
150
|
+
<span class="metric-label">跳过</span>
|
|
151
|
+
</div>
|
|
152
|
+
<div class="result-metric accent">
|
|
153
|
+
<span class="metric-val">${r}%</span>
|
|
154
|
+
<span class="metric-label">通过率</span>
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
${e.suites?this._renderSuites(e.suites):""}
|
|
158
|
+
`}_renderSuites(e){return!e||!e.length?"":'<div class="result-suites">'+e.map(t=>`
|
|
159
|
+
<div class="suite-row">
|
|
160
|
+
<span class="suite-icon">${t.passed?"✅":"❌"}</span>
|
|
161
|
+
<span class="suite-name">${this._esc(t.name)}</span>
|
|
162
|
+
<span class="suite-dur">${t.duration||"-"}ms</span>
|
|
163
|
+
</div>
|
|
164
|
+
`).join("")+"</div>"}updateFileList(e){const t=document.getElementById("file-list");if(t){if(!e||!e.length){t.innerHTML='<div class="empty-hint">暂无扫描文件</div>';return}t.innerHTML='<div class="file-list">'+e.map(s=>{const n=typeof s=="string"?s:s.path||s.name||"",o=n.split(".").pop().toLowerCase(),i=this._fileIcon(o);return`
|
|
165
|
+
<div class="file-item" data-path="${this._escAttr(n)}">
|
|
166
|
+
<span class="file-icon">${i}</span>
|
|
167
|
+
<span class="file-name">${this._esc(n)}</span>
|
|
168
|
+
</div>
|
|
169
|
+
`}).join("")+"</div>",t.querySelectorAll(".file-item").forEach(s=>{s.addEventListener("click",()=>{const n=s.dataset.path;n&&this._fire("openFile",n)})})}}_fileIcon(e){return{ts:"📘",tsx:"📘",js:"📒",jsx:"📒",vue:"💚",css:"🎨",html:"🌐",json:"📋",md:"📝",py:"🐍",go:"🐹",rs:"🦀",java:"☕",sql:"🗃️",yaml:"⚙️",yml:"⚙️"}[e]||"📄"}updateReports(e){const t=document.getElementById("reports-panel");if(t){if(!e||!e.length){t.innerHTML='<div class="empty-hint">暂无报告</div>';return}t.innerHTML='<div class="report-list">'+e.map(s=>{const n=s.name||s.title||"Report";return`
|
|
170
|
+
<div class="report-item" data-id="${this._escAttr(s.id||"")}">
|
|
171
|
+
<span class="report-icon">📊</span>
|
|
172
|
+
<span class="report-name">${this._esc(n)}</span>
|
|
173
|
+
<span class="report-date">${s.date||""}</span>
|
|
174
|
+
</div>
|
|
175
|
+
`}).join("")+"</div>",t.querySelectorAll(".report-item").forEach(s=>{s.addEventListener("click",()=>{const n=s.dataset.id;n&&this._fire("openReport",n)})})}}openFilePreview(e,t){const s=document.getElementById("fp-title"),n=document.getElementById("fp-code"),o=document.getElementById("file-preview");s&&(s.textContent=e),n&&(n.textContent=t||"(empty)"),o&&o.classList.add("visible")}openReportPreview(e){const t=document.getElementById("fp-title"),s=document.getElementById("fp-code"),n=document.getElementById("file-preview");t&&(t.textContent=e.name||"Report"),s&&(s.textContent=typeof e.content=="string"?e.content:JSON.stringify(e,null,2)),n&&n.classList.add("visible")}setConnected(e){const t=document.getElementById("conn-dot");t&&t.classList.toggle("connected",e)}_bind(e,t,s){const n=document.getElementById(e);n&&n.addEventListener(t,s)}_fire(e,...t){this._callbacks[e]&&this._callbacks[e](...t)}_esc(e){if(!e)return"";const t=document.createElement("div");return t.textContent=e,t.innerHTML}_escAttr(e){return e?e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">"):""}}const ne={croc:'<svg viewBox="0 0 16 16" fill="none"><rect x="2" y="4" width="12" height="10" rx="1" stroke="currentColor" stroke-width="1.5"/><circle cx="8" cy="9" r="2.5" fill="currentColor"/><rect x="5" y="2" width="6" height="2" rx="0.5" fill="currentColor" opacity="0.6"/></svg>',parser:'<svg viewBox="0 0 16 16" fill="none"><rect x="2" y="9" width="3" height="5" rx="0.5" fill="currentColor" opacity="0.7"/><rect x="6.5" y="5" width="3" height="9" rx="0.5" fill="currentColor" opacity="0.8"/><rect x="11" y="2" width="3" height="12" rx="0.5" fill="currentColor"/></svg>',analyzer:'<svg viewBox="0 0 16 16" fill="none"><rect x="2" y="8" width="2.5" height="6" rx="0.5" fill="currentColor" opacity="0.5"/><rect x="5.5" y="5" width="2.5" height="9" rx="0.5" fill="currentColor" opacity="0.7"/><rect x="9" y="3" width="2.5" height="11" rx="0.5" fill="currentColor" opacity="0.85"/><rect x="12.5" y="6" width="2.5" height="8" rx="0.5" fill="currentColor"/></svg>',tester:'<svg viewBox="0 0 16 16" fill="none"><path d="M6 2h4v4l3 7a1 1 0 01-1 1H4a1 1 0 01-1-1l3-7V2z" stroke="currentColor" stroke-width="1.2"/><line x1="5" y1="2" x2="11" y2="2" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>',healer:'<svg viewBox="0 0 16 16" fill="none"><path d="M8 2L3 9h4l-1 5 6-7H8l1-5z" fill="currentColor" opacity="0.8"/></svg>',planner:'<svg viewBox="0 0 16 16" fill="none"><rect x="3" y="1" width="10" height="14" rx="1" stroke="currentColor" stroke-width="1.2"/><path d="M6 1V3M10 1V3" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/><line x1="5" y1="6" x2="11" y2="6" stroke="currentColor" stroke-width="1" opacity="0.4"/><line x1="5" y1="9" x2="11" y2="9" stroke="currentColor" stroke-width="1" opacity="0.4"/><line x1="5" y1="12" x2="9" y2="12" stroke="currentColor" stroke-width="1" opacity="0.4"/></svg>',reporter:'<svg viewBox="0 0 16 16" fill="none"><polyline points="2,12 5,6 8,9 11,4 14,7" stroke="currentColor" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>'},rt={parser:ne.parser,analyzer:ne.analyzer,tester:ne.tester,healer:ne.healer,planner:ne.planner,reporter:ne.reporter},ct={security:"shield",performance:"perf",architecture:"arch","data-modeling":"data",devops:"ops","api-design":"api",refactor:"ref",microservice:"svc",python:"py",go:"go",java:"java",rust:"rs",react:"react",vue:"vue",express:"express",django:"django",springboot:"spring"},$s={working:["Working...","Almost there...","Processing...","On it."],testing:["Running tests...","Checking API...","Verifying..."],thinking:["Thinking...","Analyzing...","Reasoning..."],error:["Something broke.","Fixing it...","Investigating..."],idle:["Standing by.","Waiting for work.","Coffee break."],done:["Done.","Completed.","Ready for the next task."],passed:["All green.","Checks passed."],failed:["Needs attention.","Requires a fix."]};function ce(a){return String(a??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function f(a){const e=document.getElementById(a);if(!e)throw new Error(`Missing required element: #${a}`);return e}class Fs{constructor(){B(this,"state",new Bs);B(this,"ui",new Os(this.state,{ICONS:ne,ROLE_ICONS:rt,DYNAMIC_ROLE_ICONS:ct,resolveRoleIcon:e=>rt[e]||ct[e]||"bot",BUBBLE_TEXTS:$s,esc:ce}));B(this,"agentMgr");B(this,"particleMgr");B(this,"camCtrl");B(this,"graphViz");B(this,"hologram");B(this,"ws",null);B(this,"rafId",0);B(this,"reconnectTimer",0);B(this,"shortcutTimer",0);B(this,"disposed",!1);B(this,"listeners",[]);B(this,"renderLoop",()=>{var r,l,h,g,u,m,x,y;if(this.disposed)return;this.rafId=window.requestAnimationFrame(this.renderLoop);const e=bs();if(!e)return;const t=e.getDelta();if(t>.1)return;ws(t),(l=(r=this.camCtrl)==null?void 0:r.update)==null||l.call(r,t),(g=(h=this.particleMgr)==null?void 0:h.update)==null||g.call(h,t),(m=(u=this.agentMgr)==null?void 0:u.update)==null||m.call(u,t),(y=(x=this.hologram)==null?void 0:x.update)==null||y.call(x,t,this.state.get("graph"));const s=xs();if(s){s.render(t);return}const n=vs(),o=q(),i=et();n&&o&&i&&n.render(o,i)})}async mount(){this.ui.setLoading(5,"Creating runtime state..."),this.state.set({project:null,graph:{nodes:[],edges:[]},agents:[],ws:null,running:!1,generatedFiles:[],testMetrics:null,testQuality:null,reports:[],runMode:"auto",currentView:"3d",theme:localStorage.getItem("opencroc-theme")||"light",modMeta:new Map,nodePos:new Map});const e=this.state.get("theme");document.documentElement.setAttribute("data-theme",e),f("theme-icon-dark").style.display=e==="dark"?"":"none",f("theme-icon-light").style.display=e==="light"?"":"none",this.ui.setLoading(10,"Initializing 3D engine...");const t=f("three-canvas");await hs(t,e),this.ui.setLoading(25,"Building office..."),await Ms(e),this.ui.setLoading(40,"Preparing camera..."),this.camCtrl=new Gs(t,et(),q()),this.ui.setLoading(50,"Creating agents..."),this.agentMgr=new As(q()),this.ui.setLoading(60,"Creating effects..."),this.particleMgr=new Ts(q()),this.ui.setLoading(70,"Preparing data visualization..."),this.graphViz=new Ns(q()),this.hologram=new Rs(q()),this.ui.setLoading(80,"Binding controls..."),this.ui.init({doScan:()=>void this.doScan(),doPipeline:()=>void this.doPipeline(),doReset:()=>void this.doReset(),doRunTests:()=>void this.doRunTests(),doReports:()=>void this.doReports(),toggleTheme:()=>this.toggleTheme(),setView:s=>this.setView(s),openFile:s=>void this.openFilePreview(s),openReport:s=>void this.openReportPreview(s),openFilePreview:s=>void this.openFilePreview(s),openReportPreview:s=>void this.openReportPreview(s)}),this.bindEvents(),await this.fetchProject();try{const s=await fetch("/api/studio/summary");if(s.ok){const n=await s.json();this.state.set({studioScan:n}),this.updateStudioStats(n)}}catch{}this.ui.setLoading(90,"Connecting..."),this.connectWS(),this.ui.setLoading(100,"Ready."),window.setTimeout(()=>{f("loading-overlay").classList.add("hidden")},400),this.rafId=window.requestAnimationFrame(this.renderLoop),this.ui.addLog("OpenCroc Studio 3D is ready. Press ? for shortcuts.","info",!0)}dispose(){var e,t,s,n,o,i,r,l,h,g;this.disposed=!0,window.cancelAnimationFrame(this.rafId),window.clearTimeout(this.reconnectTimer),window.clearTimeout(this.shortcutTimer),this.listeners.forEach(u=>u()),this.listeners=[],this.ws&&(this.ws.onclose=null,this.ws.onopen=null,this.ws.onmessage=null,this.ws.close(),this.ws=null),(t=(e=this.camCtrl)==null?void 0:e.dispose)==null||t.call(e),(n=(s=this.agentMgr)==null?void 0:s.dispose)==null||n.call(s),(i=(o=this.particleMgr)==null?void 0:o.dispose)==null||i.call(o),(l=(r=this.graphViz)==null?void 0:r.dispose)==null||l.call(r),(g=(h=this.hologram)==null?void 0:h.dispose)==null||g.call(h),_s(),ys()}bindEvents(){this.listen(f("btn-scan"),"click",()=>void this.doScan()),this.listen(f("btn-pipeline"),"click",()=>void this.doPipeline()),this.listen(f("btn-reset"),"click",()=>void this.doReset()),this.listen(f("btn-run-tests"),"click",()=>void this.doRunTests()),this.listen(f("btn-reports"),"click",()=>void this.doReports()),this.listen(f("view-3d"),"click",()=>this.setView("3d")),this.listen(f("view-graph"),"click",()=>this.setView("graph")),this.listen(f("theme-toggle"),"click",()=>this.toggleTheme()),this.listen(f("sidebar-toggle"),"click",()=>{f("sidebar").classList.toggle("collapsed")}),this.listen(f("fp-close"),"click",()=>{f("file-preview").classList.remove("visible")}),this.listen(f("fp-backdrop"),"click",()=>{f("file-preview").classList.remove("visible")});const e=f("run-mode");this.listen(e,"change",t=>{const s=t.target;this.state.set({runMode:s.value})}),document.querySelectorAll(".panel-tabs .tab").forEach(t=>{this.listen(t,"click",()=>{document.querySelectorAll(".panel-tabs .tab").forEach(n=>n.classList.remove("active")),t.classList.add("active");const s=t.dataset.tab;f("log-list").classList.toggle("hidden",s!=="log"),f("file-list").classList.toggle("hidden",s!=="files"),f("results-panel").classList.toggle("hidden",s!=="results"),f("reports-panel").classList.toggle("hidden",s!=="reports")})}),this.listen(window,"resize",()=>ms()),this.listen(document,"keydown",t=>this.handleShortcuts(t))}handleShortcuts(e){var o;const t=e.target,s=(o=t==null?void 0:t.tagName)==null?void 0:o.toLowerCase();if(s==="input"||s==="textarea"||s==="select")return;const n=e.key.toLowerCase();if(e.key==="Escape"){f("file-preview").classList.remove("visible"),f("shortcut-legend").classList.remove("visible");return}if(n==="?"||e.key==="/"&&e.shiftKey){e.preventDefault();const i=f("shortcut-legend");i.classList.add("visible"),window.clearTimeout(this.shortcutTimer),this.shortcutTimer=window.setTimeout(()=>i.classList.remove("visible"),4e3);return}if(n==="1"){e.preventDefault(),this.setView("3d");return}if(n==="2"){e.preventDefault(),this.setView("graph");return}if(n==="s"&&!e.ctrlKey&&!e.metaKey){e.preventDefault(),this.doScan();return}if(n==="p"&&!e.ctrlKey&&!e.metaKey){e.preventDefault(),this.doPipeline();return}if(n==="t"&&!e.ctrlKey&&!e.metaKey){e.preventDefault(),this.doRunTests();return}if(n==="r"&&!e.ctrlKey&&!e.metaKey){e.preventDefault(),this.doReports();return}if(n==="x"&&!e.ctrlKey&&!e.metaKey){e.preventDefault(),this.doReset();return}n==="d"&&!e.ctrlKey&&!e.metaKey&&(e.preventDefault(),this.toggleTheme())}listen(e,t,s){e.addEventListener(t,s),this.listeners.push(()=>e.removeEventListener(t,s))}async fetchProject(){try{const t=await(await fetch("/api/project")).json();this.state.set({project:t,graph:t.graph||this.state.get("graph"),agents:t.agents||this.state.get("agents")}),this.updateAll()}catch(e){const t=e instanceof Error?e.message:String(e);this.ui.addLog(`Failed to fetch project: ${t}`,"error")}}async doScan(){var e,t,s;if(!this.state.get("running")){this.state.set({running:!0}),this.updateButtons(),this.ui.addLog("Starting codebase scan...","info",!0);try{await fetch("/api/scan",{method:"POST"});try{const n=((e=this.state.get("project"))==null?void 0:e.backendRoot)||".",o=await fetch("/api/studio/scan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({target:n})});if(o.ok){const i=await o.json();this.state.set({studioScan:i}),this.updateStudioStats(i),this.ui.addLog(`Knowledge graph ready: ${((t=i.stats)==null?void 0:t.totalNodes)||0} nodes, ${((s=i.stats)==null?void 0:s.totalEdges)||0} edges, ${i.risks||0} risks.`,"success",!0),this.ui.showToast("Knowledge graph updated.","success")}}catch(n){const o=n instanceof Error?n.message:String(n);this.ui.addLog(`Studio scan skipped: ${o}`,"warning")}}catch(n){const o=n instanceof Error?n.message:String(n);this.ui.addLog(`Scan error: ${o}`,"error"),this.state.set({running:!1}),this.updateButtons()}}}async doPipeline(){if(!this.state.get("running")){this.state.set({running:!0}),this.updateButtons(),this.ui.addLog("Pipeline started...","info",!0);try{await fetch("/api/pipeline",{method:"POST"})}catch(e){const t=e instanceof Error?e.message:String(e);this.ui.addLog(`Pipeline error: ${t}`,"error"),this.state.set({running:!1}),this.updateButtons()}}}async doReset(){try{await fetch("/api/reset",{method:"POST"})}catch(e){const t=e instanceof Error?e.message:String(e);this.ui.addLog(`Reset error: ${t}`,"error")}this.state.set({running:!1}),this.updateButtons(),this.ui.addLog("Agents reset.","info",!0)}async doRunTests(){if(!this.state.get("running")){this.state.set({running:!0}),this.updateButtons(),this.ui.addLog(`Running tests (mode: ${this.state.get("runMode")})...`,"info",!0);try{const t=await(await fetch("/api/run-tests",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:this.state.get("runMode")})})).json();t.error&&(this.ui.addLog(`Test error: ${t.error}`,"error"),this.state.set({running:!1}),this.updateButtons())}catch(e){const t=e instanceof Error?e.message:String(e);this.ui.addLog(`Test error: ${t}`,"error"),this.state.set({running:!1}),this.updateButtons()}}}async doReports(){if(!this.state.get("running")){this.state.set({running:!0}),this.updateButtons(),this.ui.addLog("Generating reports...","info",!0);try{const e=["developer","architect","tester","product","student","executive"],t=[];for(const s of e)try{const n=await fetch(`/api/studio/report/${s}`);if(!n.ok)continue;const o=await n.json();o.content&&t.push({perspective:s,title:o.title||s,content:o.content})}catch{}if(t.length>0){this.state.set({running:!1,studioReports:t}),this.updateButtons(),this.renderStudioReports(t),this.ui.addLog(`${t.length} perspective reports generated.`,"success",!0),this.ui.showToast(`${t.length} reports ready.`,"success");return}await fetch("/api/reports/generate",{method:"POST"})}catch(e){const t=e instanceof Error?e.message:String(e);this.ui.addLog(`Report error: ${t}`,"error"),this.state.set({running:!1}),this.updateButtons()}}}connectWS(){const e=location.protocol==="https:"?"wss:":"ws:",t=new WebSocket(`${e}//${location.host}/ws`);this.ws=t,t.onopen=()=>{this.disposed||(this.ui.setConnected(!0),this.state.set({ws:t}))},t.onclose=()=>{this.disposed||(this.ui.setConnected(!1),this.reconnectTimer=window.setTimeout(()=>this.connectWS(),3e3))},t.onmessage=s=>{try{this.handleWS(JSON.parse(s.data))}catch{}}}handleWS(e){var t,s,n,o,i,r,l,h,g,u,m,x,y,T,k,S,P;switch(e.type){case"agent:update":this.state.set({agents:e.payload}),(s=(t=this.agentMgr)==null?void 0:t.sync)==null||s.call(t,e.payload),this.ui.updateSidebar(null,e.payload);break;case"agent:assigned":{const b=(o=(n=this.agentMgr)==null?void 0:n.applyAssignmentEvent)==null?void 0:o.call(n,e.payload);b&&this.particleMgr&&this.particleMgr.triggerAgentTransfer(b.from,b.to,b.kind),(i=e.payload)!=null&&i.name&&this.ui.addLog(`${ce(e.payload.name)} was assigned${e.payload.currentTask?`: ${ce(e.payload.currentTask)}`:"."}`,"info");break}case"agent:released":{const b=(l=(r=this.agentMgr)==null?void 0:r.applyReleaseEvent)==null?void 0:l.call(r,e.payload);b&&this.particleMgr&&this.particleMgr.triggerAgentTransfer(b.from,b.to,b.kind),(h=e.payload)!=null&&h.name&&this.ui.addLog(`${ce(e.payload.name)} returned to the pond.`,"info");break}case"graph:update":this.state.set({graph:e.payload}),(u=(g=this.graphViz)==null?void 0:g.update)==null||u.call(g,e.payload),this.ui.updateSidebar(e.payload,null),this.ui.updateStats(e.payload);break;case"log":this.ui.addLog(e.payload.message,e.payload.level);break;case"files:generated":this.state.set({generatedFiles:e.payload}),this.ui.updateFileList(e.payload);break;case"pipeline:complete":this.state.set({running:!1}),this.updateButtons(),e.payload.error?this.ui.addLog(`Pipeline failed: ${e.payload.error}`,"error"):(this.ui.addLog("Pipeline complete.","success",!0),this.ui.showToast("Pipeline completed.","success"),(x=(m=this.particleMgr)==null?void 0:m.triggerCelebration)==null||x.call(m)),this.fetchProject();break;case"test:complete":this.state.set({running:!1,testMetrics:e.payload.metrics,testQuality:e.payload.quality}),this.updateButtons(),this.ui.updateResults(e.payload),this.ui.addLog(`Tests: ${((y=e.payload.metrics)==null?void 0:y.passed)||0} passed, ${((T=e.payload.metrics)==null?void 0:T.failed)||0} failed.`,"info",!0),this.ui.showToast(`Tests: ${((k=e.payload.metrics)==null?void 0:k.passed)||0} passed, ${((S=e.payload.metrics)==null?void 0:S.failed)||0} failed.`,(P=e.payload.metrics)!=null&&P.failed?"warning":"success");break;case"reports:generated":this.state.set({running:!1,reports:e.payload}),this.updateButtons(),this.ui.updateReports(e.payload),this.ui.addLog(`${e.payload.length} reports generated.`,"success",!0);break;case"scan:complete":this.state.set({running:!1}),this.updateButtons(),this.ui.addLog("Scan complete.","success",!0),this.ui.showToast("Scan completed.","success"),this.fetchProject();break}}updateAll(){var s,n,o,i;const e=this.state.get("graph"),t=this.state.get("agents");this.ui.updateSidebar(e,t),this.ui.updateStats(e),t&&((n=(s=this.agentMgr)==null?void 0:s.sync)==null||n.call(s,t)),e&&((i=(o=this.graphViz)==null?void 0:o.update)==null||i.call(o,e))}updateButtons(){const e=!!this.state.get("running");["btn-scan","btn-pipeline","btn-reset","btn-run-tests","btn-reports"].forEach(t=>{f(t).disabled=e})}async openFilePreview(e){try{const s=await(await fetch(`/api/files/${e}`)).json();f("fp-title").textContent=s.filePath||"File",f("fp-code").textContent=s.content||"",f("file-preview").classList.add("visible")}catch{this.ui.showToast("Failed to load file.","error")}}async openReportPreview(e){try{const s=await(await fetch(`/api/reports/${e}`)).text();if(e==="html"){const n=window.open("","_blank");n&&(n.document.write(s),n.document.close());return}f("fp-title").textContent=`Report: ${e}`,f("fp-code").textContent=s,f("file-preview").classList.add("visible")}catch{this.ui.showToast("Failed to load report.","error")}}toggleTheme(){const t=this.state.get("theme")==="dark"?"light":"dark";this.state.set({theme:t}),document.documentElement.setAttribute("data-theme",t),localStorage.setItem("opencroc-theme",t),f("theme-icon-dark").style.display=t==="dark"?"":"none",f("theme-icon-light").style.display=t==="light"?"":"none",fs(t),Cs(t)}setView(e){var t,s;if(this.state.set({currentView:e}),f("view-3d").classList.toggle("active",e==="3d"),f("view-graph").classList.toggle("active",e==="graph"),e==="3d"){(s=(t=this.camCtrl)==null?void 0:t.flyTo)==null||s.call(t,"office");return}Ot("/studio")}updateStudioStats(e){if(!(e!=null&&e.stats))return;const t=e.stats;f("s-mod").textContent=String(t.moduleCount||0),f("s-mdl").textContent=String(t.classCount||0),f("s-api").textContent=String(t.functionCount||0),f("s-files").textContent=String(t.fileCount||0),f("s-nodes").textContent=String(t.totalNodes||0);const s=f("s-risks");s.textContent=String(e.risks||0),s.style.color=e.risks?"var(--orange)":""}renderStudioReports(e){var n;const t=f("reports-panel"),s={developer:"DEV",architect:"ARC",tester:"TST",product:"PM",student:"EDU",executive:"BIZ"};t.innerHTML=e.map(o=>`
|
|
176
|
+
<div class="report-card" style="padding:12px;margin:8px 0;background:var(--bg-card);border-radius:var(--radius-md);border:1px solid var(--border);cursor:pointer">
|
|
177
|
+
<div style="display:flex;align-items:center;gap:8px;font-weight:600;color:var(--text);font-size:13px">
|
|
178
|
+
<span>${s[o.perspective]||"RPT"}</span>
|
|
179
|
+
<span>${ce(o.title||o.perspective)}</span>
|
|
180
|
+
<span style="margin-left:auto;font-size:10px;color:var(--text-subtle)">click to expand</span>
|
|
181
|
+
</div>
|
|
182
|
+
<div class="report-body hidden" style="margin-top:10px;font-size:12px;color:var(--text-dim);white-space:pre-wrap;max-height:400px;overflow:auto;line-height:1.6">${ce(o.content)}</div>
|
|
183
|
+
</div>`).join(""),t.querySelectorAll(".report-card").forEach(o=>{this.listen(o,"click",()=>{var i;(i=o.querySelector(".report-body"))==null||i.classList.toggle("hidden")})}),document.querySelectorAll(".panel-tabs .tab").forEach(o=>o.classList.remove("active")),(n=document.querySelector('.tab[data-tab="reports"]'))==null||n.classList.add("active"),f("log-list").classList.add("hidden"),f("file-list").classList.add("hidden"),f("results-panel").classList.add("hidden"),t.classList.remove("hidden")}}async function Ds(){const a=new Fs;return await a.mount(),()=>a.dispose()}const Ws=Object.freeze(Object.defineProperty({__proto__:null,mountOfficeRuntime:Ds},Symbol.toStringTag,{value:"Module"}));export{Us as default};
|