@umituz/web-virtual 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -2
- package/package.json +1 -1
- package/src/components/DigitalHQView.tsx +136 -54
- package/src/components/EntityInspector.tsx +8 -8
- package/src/components/VirtualCommandBar.tsx +24 -14
- package/src/components/VirtualEntityDrawer.tsx +15 -15
- package/src/components/VirtualReportModal.tsx +7 -6
- package/src/components/VirtualRoster.tsx +8 -6
- package/src/components/VirtualWorld.tsx +208 -49
- package/src/components/WorldControls.tsx +12 -12
- package/src/core/environment.ts +2 -2
- package/src/engine/renderer.ts +61 -5
- package/src/entities/architecture/OfficeArchitectureBuilder.ts +16 -0
- package/src/entities/people/AvatarBuilder.test.ts +75 -0
- package/src/entities/people/AvatarBuilder.ts +23 -3
- package/src/presets/factoryPreset.ts +15 -15
- package/src/presets/farmPreset.ts +15 -15
- package/src/presets/hospitalPreset.ts +12 -12
- package/src/presets/officePreset.ts +84 -84
- package/src/presets/schoolPreset.ts +12 -12
- package/src/styles/virtual.css +494 -193
package/README.md
CHANGED
|
@@ -4,11 +4,16 @@ Universal 3D Virtual Environment Engine for Web and React.
|
|
|
4
4
|
|
|
5
5
|
Build realistic, high-performance, interactive 3D virtual offices, farms, industrial factories, schools, and hospitals with locked 60fps rendering, raycasting, and contextual inspectors.
|
|
6
6
|
|
|
7
|
+
All UI strings are **English** so the package drops into any product without locale friction. Consumer-supplied data (entity names, missions, roles) is rendered verbatim.
|
|
8
|
+
|
|
7
9
|
---
|
|
8
10
|
|
|
9
11
|
## Features
|
|
10
12
|
|
|
11
13
|
- **Universal Engine**: Agnostic to domain (Corporate Offices, Agriculture, Automation Factories, Campus, Healthcare).
|
|
14
|
+
- **Hot-Synced Entities (1.2.0)**: When the `world` prop changes (e.g. a status poll), entities are diffed and updated **in place** — the scene, camera position, lights and cached GLB models are never rebuilt. No flicker, no reloads, no lost camera angle.
|
|
15
|
+
- **WebGL Resilience (1.2.0)**: Graceful fallback UI when WebGL is unavailable, and a one-click restore overlay if the GPU context is lost mid-session.
|
|
16
|
+
- **Battery Friendly (1.2.0)**: The render loop pauses automatically while the tab is hidden.
|
|
12
17
|
- **Locked 60 FPS Performance**: Direct GPU CSS `translate3d` projection for floating labels and pins without React state re-rendering overhead during orbit/zoom.
|
|
13
18
|
- **Interactive Entities & Raycasting**: Click and hover directly on 3D desks, monitors, robots, or avatars.
|
|
14
19
|
- **Architectural Presets**:
|
|
@@ -17,9 +22,10 @@ Build realistic, high-performance, interactive 3D virtual offices, farms, indust
|
|
|
17
22
|
- `factoryPreset`: Conveyor belts, robotic arms, storage racks.
|
|
18
23
|
- `schoolPreset`: Lecture halls, interactive smartboards, science labs.
|
|
19
24
|
- `hospitalPreset`: Triage rooms, consultation suites, patient monitoring.
|
|
20
|
-
- **
|
|
25
|
+
- **DigitalHQView**: A complete, embeddable "digital headquarters" screen — 3D office floor, operations dashboard, and an AI command center wired through a single `onDispatchMission` callback.
|
|
26
|
+
- **Contextual Inspector & Profile Drawer**: Role, status, metrics, latest task, and custom application actions.
|
|
21
27
|
- **Day & Night Simulation**: One-click smooth lighting transitions.
|
|
22
|
-
- **Pin & Label Modes**: Minimal
|
|
28
|
+
- **Pin & Label Modes**: Minimal circular pins (`#1`..`#17`) with status indicators, expandable chips, or hidden mode.
|
|
23
29
|
|
|
24
30
|
---
|
|
25
31
|
|
|
@@ -57,6 +63,58 @@ export function MyOfficePage() {
|
|
|
57
63
|
}
|
|
58
64
|
```
|
|
59
65
|
|
|
66
|
+
### Live status updates (hot-sync)
|
|
67
|
+
|
|
68
|
+
Poll or stream your data and pass a fresh `world` object — the engine diffs entities and updates status rings, animations and transforms in place. Poll every few seconds without penalty:
|
|
69
|
+
|
|
70
|
+
```tsx
|
|
71
|
+
const world = useMemo(
|
|
72
|
+
() => createEnvironment({ preset: officePreset, name: 'HQ', entities: liveEntities }),
|
|
73
|
+
[liveEntities],
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
return <VirtualWorld world={world} preset={officePreset} />
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Full digital HQ screen
|
|
80
|
+
|
|
81
|
+
```tsx
|
|
82
|
+
import { DigitalHQView, createEnvironment, officePreset } from '@umituz/web-virtual'
|
|
83
|
+
|
|
84
|
+
<DigitalHQView
|
|
85
|
+
world={world}
|
|
86
|
+
preset={officePreset}
|
|
87
|
+
deskCapacity={17}
|
|
88
|
+
onDispatchMission={async ({ prompt, targetId, isDemo }) => {
|
|
89
|
+
await fetch('/api/office/dispatch', {
|
|
90
|
+
method: 'POST',
|
|
91
|
+
body: JSON.stringify({ prompt, targetId, demo: isDemo }),
|
|
92
|
+
})
|
|
93
|
+
}}
|
|
94
|
+
getEntityLatestTask={(id) => latestTaskById.get(id) ?? null}
|
|
95
|
+
/>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Key props
|
|
101
|
+
|
|
102
|
+
### `VirtualWorld`
|
|
103
|
+
|
|
104
|
+
| Prop | Type | Notes |
|
|
105
|
+
|---|---|---|
|
|
106
|
+
| `world` | `WorldDefinition` | Hot-synced: changes update the scene in place. |
|
|
107
|
+
| `preset` | `WorldPreset` | Scene is built once per preset instance. |
|
|
108
|
+
| `pinMode` | `'pins' \| 'labels' \| 'off'` | Controlled or uncontrolled label display. |
|
|
109
|
+
| `nightMode` | `boolean` | Smooth day/night lighting transition. |
|
|
110
|
+
| `onSelectEntity` / `onHoverEntity` | callback | Fired from 3D raycast hits and pins. |
|
|
111
|
+
|
|
112
|
+
Ref API (`VirtualWorldRef`): `focusOnEntity`, `setCameraPreset`, `resetCamera`, `setNightMode`, `resize`.
|
|
113
|
+
|
|
114
|
+
### `DigitalHQView`
|
|
115
|
+
|
|
116
|
+
Everything `VirtualWorld` renders plus an operations dashboard and AI command center. Notable props: `projects`, `activities`, `presetMissions`, `deskCapacity` (defaults to the world's entity count), `getEntityMetrics`, `getEntityLatestTask`, `onDispatchMission({ prompt, targetId, isDemo })`, `onSeedSquad`.
|
|
117
|
+
|
|
60
118
|
---
|
|
61
119
|
|
|
62
120
|
## License
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/web-virtual",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Universal 3D Virtual Environment Engine for Web & React — Offices, Farms, Factories, Schools, Hospitals with 60fps performance, raycasting and interactive entities.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -26,8 +26,12 @@ import {
|
|
|
26
26
|
Send,
|
|
27
27
|
Loader2,
|
|
28
28
|
Eye,
|
|
29
|
+
Tag,
|
|
30
|
+
Moon,
|
|
31
|
+
Sun,
|
|
32
|
+
RotateCcw,
|
|
29
33
|
} from 'lucide-react'
|
|
30
|
-
import type { WorldDefinition, WorldEntity, WorldPreset } from '../core/types'
|
|
34
|
+
import type { WorldDefinition, WorldEntity, WorldPreset, PinDisplayMode } from '../core/types'
|
|
31
35
|
import { VirtualWorld, type VirtualWorldRef } from './VirtualWorld'
|
|
32
36
|
import { VirtualCommandBar, type PresetMission } from './VirtualCommandBar'
|
|
33
37
|
import { VirtualRoster } from './VirtualRoster'
|
|
@@ -69,6 +73,8 @@ export interface DigitalHQViewProps {
|
|
|
69
73
|
onSelectEntity?: (entity: WorldEntity | null) => void
|
|
70
74
|
getEntityMetrics?: (entityId: string) => EntityRunMetrics | undefined
|
|
71
75
|
getEntityLatestTask?: (entityId: string) => EntityLatestTask | null
|
|
76
|
+
/** Total number of desks in the office layout (defaults to the world's entity count). */
|
|
77
|
+
deskCapacity?: number
|
|
72
78
|
returnUrl?: string
|
|
73
79
|
standaloneUrl?: string
|
|
74
80
|
className?: string
|
|
@@ -92,6 +98,7 @@ export function DigitalHQView({
|
|
|
92
98
|
onSelectEntity,
|
|
93
99
|
getEntityMetrics,
|
|
94
100
|
getEntityLatestTask,
|
|
101
|
+
deskCapacity,
|
|
95
102
|
returnUrl = '/app/office',
|
|
96
103
|
standaloneUrl = '/digital-hq',
|
|
97
104
|
className = '',
|
|
@@ -99,11 +106,23 @@ export function DigitalHQView({
|
|
|
99
106
|
// Navigation Mode
|
|
100
107
|
const [activeMode, setActiveMode] = useState<OperationalMode>('office')
|
|
101
108
|
|
|
102
|
-
// Layout / Sidebar
|
|
109
|
+
// Layout / Sidebar / Toggles (Pure Zen Office Mode by default)
|
|
103
110
|
const virtualWorldRef = useRef<VirtualWorldRef>(null)
|
|
104
|
-
const [showRoster, setShowRoster] = useState(
|
|
111
|
+
const [showRoster, setShowRoster] = useState(false)
|
|
112
|
+
const [showCommandBar, setShowCommandBar] = useState(false)
|
|
113
|
+
const [pinMode, setPinMode] = useState<PinDisplayMode>('off')
|
|
114
|
+
const [nightMode, setNightMode] = useState(false)
|
|
105
115
|
const [isFullscreen, setIsFullscreen] = useState(false)
|
|
106
116
|
|
|
117
|
+
// Pin cycle toggle: off -> pins (#1..#17) -> labels (full names) -> off
|
|
118
|
+
const handleCyclePinMode = useCallback(() => {
|
|
119
|
+
setPinMode((prev) => {
|
|
120
|
+
if (prev === 'off') return 'pins'
|
|
121
|
+
if (prev === 'pins') return 'labels'
|
|
122
|
+
return 'off'
|
|
123
|
+
})
|
|
124
|
+
}, [])
|
|
125
|
+
|
|
107
126
|
// Selection & Report
|
|
108
127
|
const [internalSelectedId, setInternalSelectedId] = useState<string | null>(null)
|
|
109
128
|
const [viewingReport, setViewingReport] = useState<VirtualReportData | null>(null)
|
|
@@ -178,8 +197,11 @@ export function DigitalHQView({
|
|
|
178
197
|
return world.entities.filter((e) => e.status === 'awaiting_approval').length
|
|
179
198
|
}, [world.entities])
|
|
180
199
|
|
|
200
|
+
// Total desks in the office layout (defaults to the world's entity count)
|
|
201
|
+
const capacity = deskCapacity ?? world.entities.length
|
|
202
|
+
|
|
181
203
|
return (
|
|
182
|
-
<div className={`wv-hq-container ${className}`}>
|
|
204
|
+
<div className={`wv-hq-container ${nightMode ? 'is-night' : ''} ${className}`}>
|
|
183
205
|
{/* 1. Header Toolbar */}
|
|
184
206
|
<header className="wv-hq-header">
|
|
185
207
|
<div className="wv-hq-header-left">
|
|
@@ -192,25 +214,25 @@ export function DigitalHQView({
|
|
|
192
214
|
<h1 className="wv-hq-brand-title">{world.name}</h1>
|
|
193
215
|
<span className="wv-hq-badge">Universal 3D</span>
|
|
194
216
|
</div>
|
|
195
|
-
<p className="wv-hq-brand-desc">
|
|
217
|
+
<p className="wv-hq-brand-desc">AI-powered virtual headquarters</p>
|
|
196
218
|
</div>
|
|
197
219
|
</div>
|
|
198
220
|
|
|
199
221
|
<div className="wv-hq-stats-row">
|
|
200
222
|
<span className="wv-hq-stat-pill is-green">
|
|
201
223
|
<span className="wv-hq-pip" />
|
|
202
|
-
{world.entities.length} /
|
|
224
|
+
{world.entities.length} / {capacity} desks staffed
|
|
203
225
|
</span>
|
|
204
226
|
{activeWorkersCount > 0 && (
|
|
205
227
|
<span className="wv-hq-stat-pill is-purple">
|
|
206
228
|
<Zap size={12} />
|
|
207
|
-
{activeWorkersCount}
|
|
229
|
+
{activeWorkersCount} on a mission
|
|
208
230
|
</span>
|
|
209
231
|
)}
|
|
210
232
|
{pendingApprovalsCount > 0 && (
|
|
211
233
|
<span className="wv-hq-stat-pill is-amber">
|
|
212
234
|
<Clock size={12} />
|
|
213
|
-
{pendingApprovalsCount}
|
|
235
|
+
{pendingApprovalsCount} awaiting approval
|
|
214
236
|
</span>
|
|
215
237
|
)}
|
|
216
238
|
</div>
|
|
@@ -224,7 +246,7 @@ export function DigitalHQView({
|
|
|
224
246
|
className={`wv-hq-mode-tab ${activeMode === 'office' ? 'is-active' : ''}`}
|
|
225
247
|
>
|
|
226
248
|
<Compass size={14} color="#3b82f6" />
|
|
227
|
-
<span>
|
|
249
|
+
<span>Office floor (3D)</span>
|
|
228
250
|
</button>
|
|
229
251
|
|
|
230
252
|
<button
|
|
@@ -233,7 +255,7 @@ export function DigitalHQView({
|
|
|
233
255
|
className={`wv-hq-mode-tab ${activeMode === 'operations' ? 'is-active' : ''}`}
|
|
234
256
|
>
|
|
235
257
|
<LayoutDashboard size={14} color="#06b6d4" />
|
|
236
|
-
<span>
|
|
258
|
+
<span>Operations</span>
|
|
237
259
|
{projects.length > 0 && (
|
|
238
260
|
<span className="wv-hq-tab-count">{projects.length}</span>
|
|
239
261
|
)}
|
|
@@ -245,7 +267,7 @@ export function DigitalHQView({
|
|
|
245
267
|
className={`wv-hq-mode-tab ${activeMode === 'command_center' ? 'is-active' : ''}`}
|
|
246
268
|
>
|
|
247
269
|
<Terminal size={14} color="#a855f7" />
|
|
248
|
-
<span>AI
|
|
270
|
+
<span>AI command center</span>
|
|
249
271
|
{pendingApprovalsCount > 0 && (
|
|
250
272
|
<span className="wv-hq-tab-badge">{pendingApprovalsCount}</span>
|
|
251
273
|
)}
|
|
@@ -254,7 +276,7 @@ export function DigitalHQView({
|
|
|
254
276
|
|
|
255
277
|
{/* Header Right Actions */}
|
|
256
278
|
<div className="wv-hq-header-right">
|
|
257
|
-
{onSeedSquad && world.entities.length <
|
|
279
|
+
{onSeedSquad && world.entities.length < capacity && (
|
|
258
280
|
<button
|
|
259
281
|
type="button"
|
|
260
282
|
onClick={onSeedSquad}
|
|
@@ -262,20 +284,71 @@ export function DigitalHQView({
|
|
|
262
284
|
className="wv-hq-action-btn is-seed"
|
|
263
285
|
>
|
|
264
286
|
{isSeeding ? <Loader2 size={13} className="wv-spin" /> : <Sparkles size={13} />}
|
|
265
|
-
<span>
|
|
287
|
+
<span>Build squad ({capacity})</span>
|
|
266
288
|
</button>
|
|
267
289
|
)}
|
|
268
290
|
|
|
269
291
|
{activeMode === 'office' && (
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
292
|
+
<>
|
|
293
|
+
{/* Pin Mode 3-Way Cycle Toggle */}
|
|
294
|
+
<button
|
|
295
|
+
type="button"
|
|
296
|
+
onClick={handleCyclePinMode}
|
|
297
|
+
className={`wv-hq-action-btn ${pinMode !== 'off' ? 'is-active' : ''}`}
|
|
298
|
+
title="Cycle labels: off ➔ numbers (#) ➔ names"
|
|
299
|
+
>
|
|
300
|
+
<Tag size={14} />
|
|
301
|
+
<span>
|
|
302
|
+
{pinMode === 'off' ? 'Labels: off' : pinMode === 'pins' ? 'Desk no. (#)' : 'Names'}
|
|
303
|
+
</span>
|
|
304
|
+
</button>
|
|
305
|
+
|
|
306
|
+
{/* Command Bar Toggle */}
|
|
307
|
+
<button
|
|
308
|
+
type="button"
|
|
309
|
+
onClick={() => setShowCommandBar((prev) => !prev)}
|
|
310
|
+
className={`wv-hq-action-btn ${showCommandBar ? 'is-active' : ''}`}
|
|
311
|
+
title={showCommandBar ? 'Hide mission panel' : 'Show mission panel'}
|
|
312
|
+
>
|
|
313
|
+
<Terminal size={14} />
|
|
314
|
+
<span className="wv-hide-mobile">Mission panel</span>
|
|
315
|
+
</button>
|
|
316
|
+
|
|
317
|
+
{/* Roster Sidebar Toggle */}
|
|
318
|
+
<button
|
|
319
|
+
type="button"
|
|
320
|
+
onClick={handleToggleRoster}
|
|
321
|
+
className={`wv-hq-action-btn ${showRoster ? 'is-active' : ''}`}
|
|
322
|
+
title={showRoster ? 'Hide roster panel' : 'Show roster panel'}
|
|
323
|
+
>
|
|
324
|
+
{showRoster ? <PanelRightClose size={15} /> : <PanelRightOpen size={15} />}
|
|
325
|
+
<span className="wv-hide-mobile">Roster ({world.entities.length})</span>
|
|
326
|
+
</button>
|
|
327
|
+
|
|
328
|
+
{/* Lighting Toggle */}
|
|
329
|
+
<button
|
|
330
|
+
type="button"
|
|
331
|
+
onClick={() => {
|
|
332
|
+
const next = !nightMode
|
|
333
|
+
setNightMode(next)
|
|
334
|
+
virtualWorldRef.current?.setNightMode(next)
|
|
335
|
+
}}
|
|
336
|
+
className="wv-hq-icon-btn"
|
|
337
|
+
title={nightMode ? 'Switch to day mode (bright studio)' : 'Switch to night mode (evening lights)'}
|
|
338
|
+
>
|
|
339
|
+
{nightMode ? <Sun size={15} color="#f59e0b" /> : <Moon size={15} />}
|
|
340
|
+
</button>
|
|
341
|
+
|
|
342
|
+
{/* Camera Reset */}
|
|
343
|
+
<button
|
|
344
|
+
type="button"
|
|
345
|
+
onClick={() => virtualWorldRef.current?.resetCamera()}
|
|
346
|
+
className="wv-hq-icon-btn"
|
|
347
|
+
title="Reset camera to the default isometric angle"
|
|
348
|
+
>
|
|
349
|
+
<RotateCcw size={15} />
|
|
350
|
+
</button>
|
|
351
|
+
</>
|
|
279
352
|
)}
|
|
280
353
|
|
|
281
354
|
{!standalone ? (
|
|
@@ -284,16 +357,16 @@ export function DigitalHQView({
|
|
|
284
357
|
target="_blank"
|
|
285
358
|
rel="noreferrer"
|
|
286
359
|
className="wv-hq-action-btn"
|
|
287
|
-
title="
|
|
360
|
+
title="Open as a standalone fullscreen page"
|
|
288
361
|
>
|
|
289
362
|
<ExternalLink size={14} />
|
|
290
|
-
<span className="wv-hide-mobile">
|
|
363
|
+
<span className="wv-hide-mobile">Open standalone</span>
|
|
291
364
|
</a>
|
|
292
365
|
) : (
|
|
293
366
|
<a
|
|
294
367
|
href={returnUrl}
|
|
295
368
|
className="wv-hq-action-btn"
|
|
296
|
-
title="
|
|
369
|
+
title="Back to dashboard"
|
|
297
370
|
>
|
|
298
371
|
<ArrowRight size={14} style={{ transform: 'rotate(180deg)' }} />
|
|
299
372
|
<span className="wv-hide-mobile">Dashboard</span>
|
|
@@ -304,7 +377,7 @@ export function DigitalHQView({
|
|
|
304
377
|
type="button"
|
|
305
378
|
onClick={handleToggleFullscreen}
|
|
306
379
|
className="wv-hq-icon-btn"
|
|
307
|
-
title={isFullscreen ? '
|
|
380
|
+
title={isFullscreen ? 'Exit fullscreen' : 'Fullscreen'}
|
|
308
381
|
>
|
|
309
382
|
{isFullscreen ? <Minimize2 size={15} /> : <Maximize2 size={15} />}
|
|
310
383
|
</button>
|
|
@@ -315,7 +388,7 @@ export function DigitalHQView({
|
|
|
315
388
|
onClick={onRefresh}
|
|
316
389
|
disabled={refreshing}
|
|
317
390
|
className="wv-hq-icon-btn"
|
|
318
|
-
title="
|
|
391
|
+
title="Refresh data"
|
|
319
392
|
>
|
|
320
393
|
<RefreshCw size={15} className={refreshing ? 'wv-spin' : ''} />
|
|
321
394
|
</button>
|
|
@@ -334,14 +407,14 @@ export function DigitalHQView({
|
|
|
334
407
|
{loading && (
|
|
335
408
|
<div className="wv-hq-loading-overlay">
|
|
336
409
|
<Loader2 size={32} className="wv-spin" color="#3b82f6" />
|
|
337
|
-
<p>
|
|
410
|
+
<p>Loading the 3D office floor...</p>
|
|
338
411
|
</div>
|
|
339
412
|
)}
|
|
340
413
|
|
|
341
414
|
{/* Navigation Hint */}
|
|
342
415
|
<div className="wv-hq-nav-hint">
|
|
343
416
|
<Compass size={14} color="#3b82f6" />
|
|
344
|
-
<span>3D
|
|
417
|
+
<span>Click a 3D desk to open its profile • Left drag: orbit • Right drag: pan • Wheel: zoom</span>
|
|
345
418
|
</div>
|
|
346
419
|
|
|
347
420
|
{/* 3D Viewport */}
|
|
@@ -351,8 +424,15 @@ export function DigitalHQView({
|
|
|
351
424
|
preset={preset}
|
|
352
425
|
selectedEntityId={activeEntity?.id}
|
|
353
426
|
onSelectEntity={handleSelect}
|
|
354
|
-
|
|
355
|
-
|
|
427
|
+
pinMode={pinMode}
|
|
428
|
+
onChangePinMode={setPinMode}
|
|
429
|
+
nightMode={nightMode}
|
|
430
|
+
onToggleNightMode={() => {
|
|
431
|
+
const next = !nightMode
|
|
432
|
+
setNightMode(next)
|
|
433
|
+
virtualWorldRef.current?.setNightMode(next)
|
|
434
|
+
}}
|
|
435
|
+
showControls={false}
|
|
356
436
|
showInspector={false}
|
|
357
437
|
>
|
|
358
438
|
{/* Floating Bottom Command Bar Overlay */}
|
|
@@ -367,6 +447,8 @@ export function DigitalHQView({
|
|
|
367
447
|
isDemoMode={isDemoMode}
|
|
368
448
|
onToggleDemoMode={() => setIsDemoMode(!isDemoMode)}
|
|
369
449
|
isLaunching={isLaunching}
|
|
450
|
+
isOpen={showCommandBar}
|
|
451
|
+
onToggleOpen={setShowCommandBar}
|
|
370
452
|
/>
|
|
371
453
|
</VirtualWorld>
|
|
372
454
|
</div>
|
|
@@ -427,38 +509,38 @@ export function DigitalHQView({
|
|
|
427
509
|
<div className="wv-hq-ops-metrics-grid">
|
|
428
510
|
<div className="wv-hq-ops-metric-card">
|
|
429
511
|
<div className="wv-ops-metric-header">
|
|
430
|
-
<span>
|
|
512
|
+
<span>Total projects</span>
|
|
431
513
|
<FolderKanban size={16} color="#3b82f6" />
|
|
432
514
|
</div>
|
|
433
515
|
<div className="wv-ops-metric-num">{projects.length}</div>
|
|
434
|
-
<p className="wv-ops-metric-sub">
|
|
516
|
+
<p className="wv-ops-metric-sub">Active work portfolio</p>
|
|
435
517
|
</div>
|
|
436
518
|
|
|
437
519
|
<div className="wv-hq-ops-metric-card">
|
|
438
520
|
<div className="wv-ops-metric-header">
|
|
439
|
-
<span>
|
|
521
|
+
<span>Departments</span>
|
|
440
522
|
<Building2 size={16} color="#06b6d4" />
|
|
441
523
|
</div>
|
|
442
524
|
<div className="wv-ops-metric-num">{departments.length}</div>
|
|
443
|
-
<p className="wv-ops-metric-sub">
|
|
525
|
+
<p className="wv-ops-metric-sub">Functional work cells</p>
|
|
444
526
|
</div>
|
|
445
527
|
|
|
446
528
|
<div className="wv-hq-ops-metric-card">
|
|
447
529
|
<div className="wv-ops-metric-header">
|
|
448
|
-
<span>
|
|
530
|
+
<span>Active staff</span>
|
|
449
531
|
<Zap size={16} color="#a855f7" />
|
|
450
532
|
</div>
|
|
451
|
-
<div className="wv-ops-metric-num">{activeWorkersCount} /
|
|
452
|
-
<p className="wv-ops-metric-sub">
|
|
533
|
+
<div className="wv-ops-metric-num">{activeWorkersCount} / {capacity}</div>
|
|
534
|
+
<p className="wv-ops-metric-sub">Specialists working at their desks</p>
|
|
453
535
|
</div>
|
|
454
536
|
|
|
455
537
|
<div className="wv-hq-ops-metric-card">
|
|
456
538
|
<div className="wv-ops-metric-header">
|
|
457
|
-
<span>
|
|
539
|
+
<span>Awaiting approval</span>
|
|
458
540
|
<Clock size={16} color="#f59e0b" />
|
|
459
541
|
</div>
|
|
460
542
|
<div className="wv-ops-metric-num">{pendingApprovalsCount}</div>
|
|
461
|
-
<p className="wv-ops-metric-sub">
|
|
543
|
+
<p className="wv-ops-metric-sub">Missions pending a manager approval</p>
|
|
462
544
|
</div>
|
|
463
545
|
</div>
|
|
464
546
|
|
|
@@ -467,7 +549,7 @@ export function DigitalHQView({
|
|
|
467
549
|
<div className="wv-hq-ops-dept-col">
|
|
468
550
|
<h2 className="wv-hq-section-heading">
|
|
469
551
|
<Building2 size={16} color="#3b82f6" />
|
|
470
|
-
<span>
|
|
552
|
+
<span>Department rooms & desks</span>
|
|
471
553
|
</h2>
|
|
472
554
|
|
|
473
555
|
<div className="wv-hq-dept-cards-grid">
|
|
@@ -480,14 +562,14 @@ export function DigitalHQView({
|
|
|
480
562
|
<div>
|
|
481
563
|
<div className="wv-dept-card-top">
|
|
482
564
|
<span className="wv-dept-color-pip" style={{ backgroundColor: dept.color }} />
|
|
483
|
-
{isDeptBusy && <span className="wv-dept-busy-badge">⚡
|
|
565
|
+
{isDeptBusy && <span className="wv-dept-busy-badge">⚡ Working</span>}
|
|
484
566
|
</div>
|
|
485
567
|
<h3 className="wv-dept-name">{dept.name}</h3>
|
|
486
568
|
<p className="wv-dept-desc">{dept.description}</p>
|
|
487
569
|
</div>
|
|
488
570
|
|
|
489
571
|
<div className="wv-dept-card-bottom">
|
|
490
|
-
<span>{deptEntities.length}
|
|
572
|
+
<span>{deptEntities.length} {deptEntities.length === 1 ? 'desk' : 'desks'}</span>
|
|
491
573
|
<button
|
|
492
574
|
type="button"
|
|
493
575
|
onClick={() => {
|
|
@@ -496,7 +578,7 @@ export function DigitalHQView({
|
|
|
496
578
|
}}
|
|
497
579
|
className="wv-dept-link-btn"
|
|
498
580
|
>
|
|
499
|
-
<span>
|
|
581
|
+
<span>Go to room</span>
|
|
500
582
|
<ArrowRight size={13} />
|
|
501
583
|
</button>
|
|
502
584
|
</div>
|
|
@@ -510,14 +592,14 @@ export function DigitalHQView({
|
|
|
510
592
|
<div className="wv-hq-ops-act-col">
|
|
511
593
|
<h2 className="wv-hq-section-heading">
|
|
512
594
|
<Activity size={16} color="#3b82f6" />
|
|
513
|
-
<span>
|
|
595
|
+
<span>System activity feed</span>
|
|
514
596
|
</h2>
|
|
515
597
|
|
|
516
598
|
<div className="wv-hq-act-box">
|
|
517
599
|
{activities.length === 0 ? (
|
|
518
600
|
<div className="wv-hq-empty-act">
|
|
519
601
|
<Clock size={24} style={{ opacity: 0.4, margin: '0 auto 8px' }} />
|
|
520
|
-
<p>
|
|
602
|
+
<p>No recorded system activity yet.</p>
|
|
521
603
|
</div>
|
|
522
604
|
) : (
|
|
523
605
|
activities.slice(0, 8).map((act) => (
|
|
@@ -552,9 +634,9 @@ export function DigitalHQView({
|
|
|
552
634
|
<Terminal size={20} />
|
|
553
635
|
</div>
|
|
554
636
|
<div>
|
|
555
|
-
<h2 className="wv-dispatch-title">
|
|
637
|
+
<h2 className="wv-dispatch-title">AI command & orchestration</h2>
|
|
556
638
|
<p className="wv-dispatch-sub">
|
|
557
|
-
|
|
639
|
+
Dispatch missions to every department automatically through the general manager.
|
|
558
640
|
</p>
|
|
559
641
|
</div>
|
|
560
642
|
</div>
|
|
@@ -564,7 +646,7 @@ export function DigitalHQView({
|
|
|
564
646
|
value={promptText}
|
|
565
647
|
onChange={(e) => setPromptText(e.target.value)}
|
|
566
648
|
rows={3}
|
|
567
|
-
placeholder="
|
|
649
|
+
placeholder="Describe a company goal or a complex project... (e.g. Build the strategy, visual briefs and budget plan for our new digital marketing campaign)"
|
|
568
650
|
className="wv-dispatch-textarea"
|
|
569
651
|
/>
|
|
570
652
|
<div className="wv-dispatch-actions-row">
|
|
@@ -574,7 +656,7 @@ export function DigitalHQView({
|
|
|
574
656
|
className={`wv-demo-toggle-btn ${isDemoMode ? 'is-demo' : 'is-ai'}`}
|
|
575
657
|
>
|
|
576
658
|
{isDemoMode ? <Sparkles size={14} /> : <Bot size={14} />}
|
|
577
|
-
<span>{isDemoMode ? '
|
|
659
|
+
<span>{isDemoMode ? 'Fast demo simulation' : 'Real LLM API'}</span>
|
|
578
660
|
</button>
|
|
579
661
|
|
|
580
662
|
<button
|
|
@@ -584,7 +666,7 @@ export function DigitalHQView({
|
|
|
584
666
|
className="wv-dispatch-submit-big-btn"
|
|
585
667
|
>
|
|
586
668
|
{isLaunching ? <Loader2 size={16} className="wv-spin" /> : <Send size={15} />}
|
|
587
|
-
<span>
|
|
669
|
+
<span>Start orchestration</span>
|
|
588
670
|
</button>
|
|
589
671
|
</div>
|
|
590
672
|
</div>
|
|
@@ -594,13 +676,13 @@ export function DigitalHQView({
|
|
|
594
676
|
<div className="wv-hq-review-section">
|
|
595
677
|
<h3 className="wv-hq-section-heading">
|
|
596
678
|
<Clock size={16} color="#f59e0b" />
|
|
597
|
-
<span>
|
|
679
|
+
<span>Missions awaiting review & approval</span>
|
|
598
680
|
</h3>
|
|
599
681
|
|
|
600
682
|
<div className="wv-hq-review-feed">
|
|
601
683
|
{world.entities.filter((e) => getEntityLatestTask && getEntityLatestTask(e.id)).length === 0 ? (
|
|
602
684
|
<div className="wv-hq-empty-feed">
|
|
603
|
-
|
|
685
|
+
No completed or approval-pending missions yet.
|
|
604
686
|
</div>
|
|
605
687
|
) : (
|
|
606
688
|
world.entities
|
|
@@ -633,7 +715,7 @@ export function DigitalHQView({
|
|
|
633
715
|
className="wv-review-view-btn"
|
|
634
716
|
>
|
|
635
717
|
<Eye size={14} />
|
|
636
|
-
<span>
|
|
718
|
+
<span>View report</span>
|
|
637
719
|
</button>
|
|
638
720
|
</div>
|
|
639
721
|
)
|
|
@@ -91,7 +91,7 @@ export function EntityInspector({
|
|
|
91
91
|
justifyContent: 'center',
|
|
92
92
|
borderRadius: 6,
|
|
93
93
|
}}
|
|
94
|
-
title="
|
|
94
|
+
title="Close (Esc)"
|
|
95
95
|
>
|
|
96
96
|
<X size={16} />
|
|
97
97
|
</button>
|
|
@@ -101,10 +101,10 @@ export function EntityInspector({
|
|
|
101
101
|
<div style={{ padding: 14, overflowY: 'auto', display: 'flex', flexDirection: 'column', gap: 12 }}>
|
|
102
102
|
{/* Role & Department */}
|
|
103
103
|
<div>
|
|
104
|
-
<div style={{ fontSize: 13, fontWeight: 500, color: '#e2e8f0' }}>{entity.role || '
|
|
104
|
+
<div style={{ fontSize: 13, fontWeight: 500, color: '#e2e8f0' }}>{entity.role || 'Entity'}</div>
|
|
105
105
|
{entity.department && (
|
|
106
106
|
<div style={{ fontSize: 11, color: '#94a3b8', marginTop: 2 }}>
|
|
107
|
-
|
|
107
|
+
Department: {entity.department}
|
|
108
108
|
</div>
|
|
109
109
|
)}
|
|
110
110
|
</div>
|
|
@@ -132,10 +132,10 @@ export function EntityInspector({
|
|
|
132
132
|
}}
|
|
133
133
|
>
|
|
134
134
|
{entity.status === 'running' || entity.status === 'working'
|
|
135
|
-
? '
|
|
135
|
+
? 'Working on a mission'
|
|
136
136
|
: entity.status === 'awaiting_approval'
|
|
137
|
-
? '
|
|
138
|
-
: '
|
|
137
|
+
? 'Awaiting approval'
|
|
138
|
+
: 'Ready / idle'}
|
|
139
139
|
</span>
|
|
140
140
|
</div>
|
|
141
141
|
|
|
@@ -160,7 +160,7 @@ export function EntityInspector({
|
|
|
160
160
|
fontSize: 11,
|
|
161
161
|
}}
|
|
162
162
|
>
|
|
163
|
-
<div style={{ fontWeight: 600, color: '#94a3b8', marginBottom: 6 }}
|
|
163
|
+
<div style={{ fontWeight: 600, color: '#94a3b8', marginBottom: 6 }}>ATTRIBUTES</div>
|
|
164
164
|
{Object.entries(entity.metadata).map(([k, v]) => (
|
|
165
165
|
<div
|
|
166
166
|
key={k}
|
|
@@ -212,7 +212,7 @@ export function EntityInspector({
|
|
|
212
212
|
}}
|
|
213
213
|
>
|
|
214
214
|
<Focus size={14} />
|
|
215
|
-
3D
|
|
215
|
+
Focus 3D camera
|
|
216
216
|
</button>
|
|
217
217
|
)}
|
|
218
218
|
|