@realsee/vr-cli 0.1.3
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/NOTICE.md +7 -0
- package/README.md +216 -0
- package/TERMS.txt +54 -0
- package/agent-assets/AGENTS.md +113 -0
- package/agent-assets/adapters/.cursor/rules/realsee-vr.mdc +7 -0
- package/agent-assets/adapters/.github/copilot-instructions.md +1 -0
- package/agent-assets/adapters/.kiro/steering/realsee-vr.md +6 -0
- package/agent-assets/adapters/CLAUDE.md +3 -0
- package/bin/vr-cli.mjs +3 -0
- package/dist/cli.mjs +24 -0
- package/package.json +38 -0
- package/skills/realsee-image-resources/SKILL.md +82 -0
- package/skills/realsee-image-resources/references/cors-and-three-textures.md +50 -0
- package/skills/realsee-image-resources/references/data-wanxiang.md +57 -0
- package/skills/realsee-image-resources/references/five-image-url-transform.md +81 -0
- package/skills/realsee-image-resources/references/source-and-domain-policy.md +63 -0
- package/skills/realsee-vr-app/SKILL.md +157 -0
- package/skills/realsee-vr-app/references/continuous-improvement.md +24 -0
- package/skills/realsee-vr-app/references/dnalogel-api-capabilities.md +241 -0
- package/skills/realsee-vr-app/references/dnalogel-openapi-recipes.md +818 -0
- package/skills/realsee-vr-app/references/five-api-capabilities.md +119 -0
- package/skills/realsee-vr-app/references/five-runtime.md +83 -0
- package/skills/realsee-vr-app/references/official-docs.md +61 -0
- package/skills/realsee-vr-app/references/plugin-lifecycle.md +65 -0
- package/skills/realsee-vr-app/references/ui-and-validation.md +57 -0
- package/skills/realsee-vr-app/references/vapor-dom-layer.md +186 -0
- package/skills/realsee-vr-app/scripts/verify-project.mjs +1566 -0
- package/skills/threejs-r117-five/SKILL.md +71 -0
- package/skills/threejs-r117-five/references/five-ownership.md +70 -0
- package/skills/threejs-r117-five/references/r117-capabilities.md +82 -0
- package/skills/threejs-r117-five/references/r117-version-guards.md +60 -0
- package/templates/base/.editorconfig +12 -0
- package/templates/base/.env.example +12 -0
- package/templates/base/.gitignore.template +6 -0
- package/templates/base/.node-version +1 -0
- package/templates/base/.npmrc.template +3 -0
- package/templates/base/.nvmrc +1 -0
- package/templates/base/.prettierignore +12 -0
- package/templates/base/README.md +160 -0
- package/templates/base/eslint.config.mjs +75 -0
- package/templates/base/index.html +13 -0
- package/templates/base/package-lock.json +6444 -0
- package/templates/base/package.json +55 -0
- package/templates/base/prettier.config.mjs +5 -0
- package/templates/base/server/app.ts +54 -0
- package/templates/base/server/check-config.ts +4 -0
- package/templates/base/server/config.ts +54 -0
- package/templates/base/server/index.ts +31 -0
- package/templates/base/server/realsee-open-api.ts +316 -0
- package/templates/base/server/types.ts +64 -0
- package/templates/base/server/work-route.ts +80 -0
- package/templates/base/server/work-service.ts +54 -0
- package/templates/base/shared/model-floorplan.ts +242 -0
- package/templates/base/src/main.tsx +11 -0
- package/templates/base/src/shared/useElementSize.ts +28 -0
- package/templates/base/src/styles.css +91 -0
- package/templates/base/src/vr/five/SpatialRuntimeProvider.tsx +234 -0
- package/templates/base/src/vr/five/api.ts +10 -0
- package/templates/base/src/vr/five/fiveConfig.ts +42 -0
- package/templates/base/src/vr/five/initialState.ts +48 -0
- package/templates/base/src/vr/plugins/SpatialPluginRegistry.ts +104 -0
- package/templates/base/src/vr/plugins/dnalogel.ts +2 -0
- package/templates/base/src/vr/plugins/examples/FeatureOwnedMeshPlugin.ts +73 -0
- package/templates/base/src/vr/work/WorkSource.ts +247 -0
- package/templates/base/tsconfig.json +27 -0
- package/templates/base/tsconfig.server.json +25 -0
- package/templates/base/vite.config.ts +21 -0
- package/templates/viewer/src/app/App.tsx +182 -0
- package/templates/viewer/src/features/floorplan/ModelFloorplanFeature.ts +141 -0
- package/templates/viewer/src/features/navigation/ModeSwitcher.tsx +111 -0
- package/templates/viewer/src/features/tags/PanoTagFeature.ts +110 -0
- package/templates/viewer/src/ui/ViewerOverlay.tsx +141 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: threejs-r117-five
|
|
3
|
+
description: Use Three.js 0.117.1 core capabilities safely in Realsee Five 6.8.9 applications. Use for Three math, Object3D, geometry, materials, lighting, textures, animation, loaders, GLSL shaders, Five post-processing passes, raycasting, resource cleanup, performance, and version migration. This is a portable Agent Skill, independent of any specific coding agent.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Three.js r117 foundation for Five
|
|
7
|
+
|
|
8
|
+
Five is built on Three.js, so its public scene, camera, renderer, coordinate, raycasting and pass APIs interoperate with the single pinned `three@0.117.1` instance. This does not transfer ownership of Five's renderer pipeline to application code.
|
|
9
|
+
|
|
10
|
+
## 1. Confirm the compatibility contract
|
|
11
|
+
|
|
12
|
+
Before writing code, verify the compatibility declarations and installed resolutions:
|
|
13
|
+
|
|
14
|
+
- `@realsee/five`: declared as `>=6.8.9`; inspect the lockfile and installed package for the actual version.
|
|
15
|
+
- `three`: declared and resolved exactly as `0.117.1`.
|
|
16
|
+
|
|
17
|
+
Do not install another Three version or a separate modern `@types/three`. The installed `three/src/Three.d.ts`, `three/examples/jsm/**/*.d.ts` and Five declarations are authoritative. If Five has moved above the generated baseline, re-check its versioned contract fixtures and browser behavior while keeping the single Three r117 instance.
|
|
18
|
+
|
|
19
|
+
## 2. Classify the task and rendering mode
|
|
20
|
+
|
|
21
|
+
Choose the capability route before selecting APIs:
|
|
22
|
+
|
|
23
|
+
1. **Five feature**: add custom objects, geometry, materials, textures, animation, loaders, shaders, lights, picking or a Five pass to the existing Five runtime. Read [references/five-ownership.md](references/five-ownership.md).
|
|
24
|
+
2. **Version lookup**: map a modern Three example to r117. Read [references/r117-version-guards.md](references/r117-version-guards.md) before adapting it.
|
|
25
|
+
3. **Capability design**: choose among the ten supported knowledge domains. Read [references/r117-capabilities.md](references/r117-capabilities.md).
|
|
26
|
+
|
|
27
|
+
For image provenance, approved Realsee CDN selection, Five `defaultImageURLTransform`, 数据万象 or CORS, first read the sibling [realsee-image-resources Skill](../realsee-image-resources/SKILL.md). This Skill still owns the pinned Three r117 texture API and application texture ownership rules.
|
|
28
|
+
|
|
29
|
+
Then select one explicit rendering ownership mode:
|
|
30
|
+
|
|
31
|
+
1. **Default internal renderer**: Five owns the renderer, canvas, viewport, render scheduling and composer. Application features add owned objects or passes through Five's public APIs.
|
|
32
|
+
2. **Application-owned external renderer/shared viewport**: pass the renderer into `FiveInitArgs` at construction and coordinate canvas, sizing, pixel ratio, viewport/scissor, scheduling and final renderer disposal in one application owner. The owner may render its own Scene/Camera in a controlled viewport, but must not redraw `five.scene` outside Five or wrap Five in a second composer.
|
|
33
|
+
3. **Independent/offscreen Three scene**: a separate Scene/Camera/Renderer is allowed when it does not render Five-owned objects or compete for Five's visible canvas lifecycle.
|
|
34
|
+
|
|
35
|
+
For generated-project vibe coding in the default mode, inspect `src/vr/plugins/examples/FeatureOwnedMeshPlugin.ts` before adding a custom Three object or plugin. Prefer its opt-in factory/registry pattern and idempotent feature-owned cleanup. Adapt it in a focused feature; never auto-enable the reference from the default App.
|
|
36
|
+
|
|
37
|
+
## 3. Preserve Five ownership
|
|
38
|
+
|
|
39
|
+
- Add custom `Object3D` trees to `five.scene`; do not replace `five.scene` or mutate `five.modelScene` internals.
|
|
40
|
+
- Use `five.camera` for projection and raycasting, but use Five State/camera methods for motion. Do not attach OrbitControls to it.
|
|
41
|
+
- In the default mode, let Five own its renderer, canvas, size, viewport, RAF and composer. In external-renderer mode, keep those responsibilities in the single declared application owner.
|
|
42
|
+
- Use `five.needsRender = true` for changed custom visuals under on-demand rendering.
|
|
43
|
+
- Integrate Five post-processing through public `five.addPass`, `insertPass` and `removePass`; do not create a second EffectComposer around `five.renderer`.
|
|
44
|
+
- Prefer Five gesture events and model intersection APIs for Work/model picking; use native Raycaster directly for application-owned custom objects.
|
|
45
|
+
|
|
46
|
+
## 4. Use r117 APIs, not current Three examples
|
|
47
|
+
|
|
48
|
+
Core imports come from `three`. Extension modules use `three/examples/jsm/.../*.js`. The package has no `three/addons` export.
|
|
49
|
+
|
|
50
|
+
Use r117 terminology such as `texture.encoding`, `renderer.outputEncoding`, `THREE.sRGBEncoding`, `TextGeometry`'s `height`, `Matrix4.getInverse`, and explicit `*BufferGeometry` where BufferGeometry behavior matters. Reject modern-only color-space, WebGPU, TSL and PBR optical APIs unless the pinned matrix is upgraded and re-audited.
|
|
51
|
+
|
|
52
|
+
## 5. Own resources and time
|
|
53
|
+
|
|
54
|
+
Every feature owns what it creates:
|
|
55
|
+
|
|
56
|
+
- remove its Object3D root from `five.scene`;
|
|
57
|
+
- stop and uncache AnimationMixer actions;
|
|
58
|
+
- remove Five/DOM event subscriptions;
|
|
59
|
+
- stop media and request/animation work;
|
|
60
|
+
- dispose geometries, materials, textures, render targets, controls, loaders with explicit worker disposal, and custom passes where supported;
|
|
61
|
+
- do not dispose Work/model resources or the Five renderer that the feature does not own.
|
|
62
|
+
|
|
63
|
+
Run long-lived work through the generated spatial lifetime so StrictMode, HMR and Five teardown wait for it safely.
|
|
64
|
+
|
|
65
|
+
## 6. Validate
|
|
66
|
+
|
|
67
|
+
Run type checking and production build, then validate in a real browser. Inspect coordinates, camera mode transitions, draw order, pointer routing, shader compilation, GPU resources and remount cleanup. A screenshot alone cannot prove raycasting, ownership or disposal.
|
|
68
|
+
|
|
69
|
+
## Provenance
|
|
70
|
+
|
|
71
|
+
The ten-domain routing model was inspired by [CloudAI-X/threejs-skills](https://github.com/CloudAI-X/threejs-skills). This skill is independently rewritten against the locally installed r117/Five declarations; it does not copy the upstream r160+ examples or assume their APIs are compatible.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Five and Three ownership boundary
|
|
2
|
+
|
|
3
|
+
Five exposes Three-compatible objects, but application access does not imply application ownership.
|
|
4
|
+
|
|
5
|
+
## Scene and objects
|
|
6
|
+
|
|
7
|
+
`five.scene` is the public destination for application-owned custom `Object3D` trees. Add meshes, groups, lines, points, sprites, instanced meshes, helpers and intentional feature lights there. Keep one root per feature so teardown can remove it deterministically.
|
|
8
|
+
|
|
9
|
+
Do not replace `five.scene`. Do not mutate or dispose `five.modelScene`, Work tiles, internal panorama meshes or model materials as though they were feature-owned. Use Five model/layer/parameter APIs for Work content.
|
|
10
|
+
|
|
11
|
+
When a custom object changes under on-demand rendering, set its supported render flag or `five.needsRender = true`.
|
|
12
|
+
|
|
13
|
+
## Camera and coordinates
|
|
14
|
+
|
|
15
|
+
`five.camera` is a Five camera that participates in Mode and State synchronization. It can be passed to Three projection, frustum and Raycaster math. Motion belongs to `five.setState`, `changeMode`, `moveToPano`, `updateCamera` or `updateCameraWithKeyframes`.
|
|
16
|
+
|
|
17
|
+
Do not replace the camera, attach Orbit/Map/FirstPerson controls, or continuously write position/quaternion/projection outside Five's controller.
|
|
18
|
+
|
|
19
|
+
Keep coordinate spaces explicit:
|
|
20
|
+
|
|
21
|
+
- DOM client coordinates;
|
|
22
|
+
- canvas-relative NDC;
|
|
23
|
+
- Five local/world coordinates;
|
|
24
|
+
- Work ENU/ECEF coordinates;
|
|
25
|
+
- loader model coordinates and up-axis.
|
|
26
|
+
|
|
27
|
+
Use Five/ViewLayer coordinate conversion APIs where Work identity matters. Validate imported model orientation in a real Work; do not assume every source uses the same up-axis.
|
|
28
|
+
|
|
29
|
+
## Renderer, canvas and viewport
|
|
30
|
+
|
|
31
|
+
Three integration has three supported ownership modes:
|
|
32
|
+
|
|
33
|
+
1. **Default internal renderer**: `new Five(initArgs)` creates and owns its WebGL renderer. `appendTo`, `refresh`, `getElement` and `dispose` define the generated canvas lifecycle.
|
|
34
|
+
2. **Application-owned external renderer/shared viewport**: pass `FiveInitArgs.renderer` at construction and use the public `viewport`/`setViewport` contract. One application owner manages DOM mounting, dimensions, pixel ratio, viewport/scissor state, shared render timing and final renderer release.
|
|
35
|
+
3. **Independent/offscreen scene**: a separate Three Scene/Camera/Renderer may run in isolation without rendering Five-owned objects or competing for Five's visible surface.
|
|
36
|
+
|
|
37
|
+
In the default mode, application features must not replace `five.renderer`, call `renderer.setSize`, dispose its context, move the Five canvas into React reconciliation, or call `renderer.render(five.scene, five.camera)` from another RAF.
|
|
38
|
+
|
|
39
|
+
An external-renderer owner may render its own Scene/Camera in a controlled time slot and viewport. It must restore required viewport/scissor state, must not bypass Five to redraw `five.scene`, and must not wrap Five's renderer/scene in a second composer. The public declarations do not guarantee whether `five.dispose()` detaches or clears an externally supplied canvas, so never depend on that side effect; stop Five first, then let the application owner perform final renderer/canvas cleanup.
|
|
40
|
+
|
|
41
|
+
## Time and animation
|
|
42
|
+
|
|
43
|
+
Five owns visible render scheduling in the default mode. With an external renderer, the single application owner coordinates shared timing without a second RAF racing Five. Use Five render events, a feature task, or the reviewed external-owner schedule to advance Three animation state. Continuous animation must request rendering and be stoppable.
|
|
44
|
+
|
|
45
|
+
For an `AnimationMixer`, teardown normally includes stopping actions, uncaching clips/roots, removing the object root, and disposing owned geometry/material/texture resources. Never dispose shared Work resources.
|
|
46
|
+
|
|
47
|
+
## Post-processing
|
|
48
|
+
|
|
49
|
+
Five owns its composer and G-buffer pipeline in both internal- and external-renderer modes. Use public Five `Pass`/`FivePass` contracts and `five.addPass`, `insertPass`, `removePass`. Always remove an installed pass at feature teardown. Call `dispose()` only when the concrete declared pass supports it and the feature owns that pass; separately release feature-owned materials, textures and render targets.
|
|
50
|
+
|
|
51
|
+
Do not wrap `five.renderer` or `five.scene` in `three/examples/jsm/postprocessing/EffectComposer`. An isolated application scene may have its own reviewed pipeline only when it remains outside Five's scene/composer lifecycle.
|
|
52
|
+
|
|
53
|
+
## Picking and interaction
|
|
54
|
+
|
|
55
|
+
For gesture-driven picking, prefer Five pointer data such as `event.center.raycaster` and `event.center.coords`; this preserves Five's input and viewport transforms. Use `five.modelScene.intersectRaycaster` when hits must aggregate across loaded Work/models. Use `five.model.intersectRaycaster` only when intentionally targeting the active single model. For application-owned custom objects, use the r117 Raycaster against the feature root only.
|
|
56
|
+
|
|
57
|
+
When raw DOM input must be converted manually, begin with the actual Five canvas rectangle and then account for the `five.viewport` subregion before mapping to NDC. Using the whole canvas dimensions alone is incorrect for an external renderer or shared viewport. Pair every DOM or Five event subscription with its returned disposer and avoid transparent DOM overlays intercepting canvas input.
|
|
58
|
+
|
|
59
|
+
## Teardown order
|
|
60
|
+
|
|
61
|
+
1. mark the feature inactive and stop new work;
|
|
62
|
+
2. abort owned requests and unregister input/events;
|
|
63
|
+
3. await or serialize native async operations that cannot be cancelled;
|
|
64
|
+
4. stop animation/media/workers;
|
|
65
|
+
5. remove custom scene roots and Five passes;
|
|
66
|
+
6. dispose owned render targets, geometry, materials and textures;
|
|
67
|
+
7. release registry entries;
|
|
68
|
+
8. allow the runtime owner—not the feature—to dispose Five and its renderer.
|
|
69
|
+
|
|
70
|
+
This order must remain safe under React StrictMode, HMR, Work replacement and partial initialization failure.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Three.js 0.117.1 capability map
|
|
2
|
+
|
|
3
|
+
Use this map to choose a capability family, then confirm the exact signature in the installed declaration. It is a routing guide, not a replacement for `node_modules/three/src/Three.d.ts`.
|
|
4
|
+
|
|
5
|
+
## Import contract
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import * as THREE from 'three'
|
|
9
|
+
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js'
|
|
10
|
+
import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js'
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The r117 package exposes `build/three.module.js`, `src/Three.d.ts`, and `examples/jsm`. It has no package export map for `three/addons`.
|
|
14
|
+
|
|
15
|
+
## Capability domains
|
|
16
|
+
|
|
17
|
+
### Fundamentals
|
|
18
|
+
|
|
19
|
+
Available foundations include `Scene`, `Object3D`, `Group`, `Mesh`, `Line`, `LineLoop`, `LineSegments`, `Points`, `Sprite`, `LOD`, `InstancedMesh`, perspective/orthographic/cube/array cameras, `WebGLRenderer`, render targets, `Clock`, helpers and the complete math set (`Vector*`, `Euler`, `Quaternion`, `Matrix*`, `Color`, `Box*`, `Sphere`, `Plane`, `Ray`, `Frustum`).
|
|
20
|
+
|
|
21
|
+
Inside Five, reuse `five.scene`, `five.camera` and the Five-owned renderer instead of constructing replacements.
|
|
22
|
+
|
|
23
|
+
### Geometry
|
|
24
|
+
|
|
25
|
+
r117 supports legacy `Geometry`, `BufferGeometry`, instanced/interleaved buffers, attributes, curves, shapes and the usual primitives. It still has parallel legacy and buffer classes such as `BoxGeometry` and `BoxBufferGeometry`; prefer the explicit buffer class for GPU-oriented custom features. It includes box, plane, sphere, circle, cylinder, cone, ring, torus, torus-knot, tube, shape, extrude, text, lathe, polyhedron, edges and wireframe families.
|
|
26
|
+
|
|
27
|
+
Useful examples modules include `ConvexGeometry`, `DecalGeometry`, `BoxLineGeometry` and `ParametricGeometries` under `three/examples/jsm/geometries`.
|
|
28
|
+
|
|
29
|
+
### Materials
|
|
30
|
+
|
|
31
|
+
Core materials include basic, Lambert, Phong, standard, physical, toon, matcap, normal, depth, distance, line, points, sprite, shadow, `ShaderMaterial` and `RawShaderMaterial`. r117 physical material supports the locally declared clearcoat/sheen-era fields, not modern transmission/IOR/thickness/iridescence APIs.
|
|
32
|
+
|
|
33
|
+
When cloning or replacing material arrays, dispose each owned unique material once. Do not dispose Five model materials.
|
|
34
|
+
|
|
35
|
+
### Lighting
|
|
36
|
+
|
|
37
|
+
Core lights include ambient, hemisphere, directional, point, spot, rectangular area and light probes, plus their helpers and shadow types. `RectAreaLightUniformsLib` and `LightProbeGenerator` are examples modules. Keep shadow maps bounded and update helper/projection state after changes.
|
|
38
|
+
|
|
39
|
+
Five already owns scene lighting policy. Add feature lights only when their lifecycle, cost and interaction with Work materials are intentional.
|
|
40
|
+
|
|
41
|
+
### Textures
|
|
42
|
+
|
|
43
|
+
Core types include regular, canvas, data, 3D data, compressed, cube, video and depth textures; loaders include texture, cube, compressed, data, image and bitmap loaders; PMREM is available. Configure wrapping, filtering, anisotropy, mipmaps and r117 `encoding` explicitly. Color/albedo textures commonly use `THREE.sRGBEncoding`; data maps remain linear according to their installed contract.
|
|
44
|
+
|
|
45
|
+
Image provenance, approved Realsee CDN hosts, Five `defaultImageURLTransform`, 数据万象 processing and browser CORS belong to the sibling [realsee-image-resources Skill](../../realsee-image-resources/SKILL.md). After that policy produces an authorized browser-readable URL, this reference governs r117 texture configuration and ownership.
|
|
46
|
+
|
|
47
|
+
Dispose only owned textures, render targets and media sources. A material does not automatically establish application-level ownership of a shared texture.
|
|
48
|
+
|
|
49
|
+
### Animation
|
|
50
|
+
|
|
51
|
+
Use `AnimationMixer`, `AnimationClip`, `AnimationAction`, keyframe tracks, bones, skeletons, skinned meshes and morph influences. Advance mixers from a Five-owned timing integration or feature task rather than starting a second renderer loop. Stop actions, uncache roots/clips and release subscriptions on teardown.
|
|
52
|
+
|
|
53
|
+
### Loaders
|
|
54
|
+
|
|
55
|
+
Core loaders cover files, objects, buffer geometry, materials, textures, fonts, audio and animations. r117 examples provide GLTF, DRACO, FBX, OBJ/MTL, PLY, STL, SVG, RGBE, EXR, DDS, KTX, Basis, Collada, 3MF and other format loaders under `three/examples/jsm/loaders`.
|
|
56
|
+
|
|
57
|
+
Loader results require explicit coordinate/up-axis handling before joining a Five scene. Configure decoder/worker paths through injected deployment policy and dispose workers where that loader exposes a disposal method.
|
|
58
|
+
|
|
59
|
+
### Shaders
|
|
60
|
+
|
|
61
|
+
Use GLSL with `ShaderMaterial` or `RawShaderMaterial`, typed uniforms, `UniformsUtils`, `ShaderLib`, `ShaderChunk`, or carefully reviewed `onBeforeCompile`. r117 also ships an older examples NodeMaterial system; it is not modern TSL.
|
|
62
|
+
|
|
63
|
+
Document coordinate spaces for positions, normals and vectors. Mark material/uniform changes for rendering and clean up all owned textures, render targets and materials.
|
|
64
|
+
|
|
65
|
+
### Post-processing
|
|
66
|
+
|
|
67
|
+
Standalone Three scenes can use r117 examples modules such as `EffectComposer`, `RenderPass`, `ShaderPass`, bloom, SSAO/SAO, SMAA, Bokeh, film, glitch and afterimage passes. A Five feature instead uses Five's public `Pass`/`FivePass` and `five.addPass`/`insertPass`/`removePass` lifecycle. Never wrap the Five renderer in a second examples composer.
|
|
68
|
+
|
|
69
|
+
### Interaction
|
|
70
|
+
|
|
71
|
+
Core `Raycaster`, `Ray`, `Layers` and object event primitives are available. Examples controls include Orbit/Map, Drag, Transform, PointerLock, FirstPerson, Fly and Trackball controls; selection helpers are also available.
|
|
72
|
+
|
|
73
|
+
Do not attach those controls to `five.camera`. For gesture-driven Work/model picking, prefer `event.center.raycaster` and `event.center.coords`. Use `five.modelScene.intersectRaycaster` to aggregate across loaded Work/models, and reserve `five.model.intersectRaycaster` for an intentionally selected single active model. For custom objects under `five.scene`, raycast only the owned feature root. If raw DOM input must be converted manually, map through both the Five canvas rectangle and the `five.viewport` subregion before producing NDC; whole-canvas normalization is wrong for shared viewports.
|
|
74
|
+
|
|
75
|
+
## Performance baseline
|
|
76
|
+
|
|
77
|
+
- reuse geometry, material and texture instances where ownership permits;
|
|
78
|
+
- prefer instancing for repeated identical meshes;
|
|
79
|
+
- avoid per-frame allocations in raycasting, animation and shader updates;
|
|
80
|
+
- bound texture resolution, anisotropy, shadow maps and render-target count;
|
|
81
|
+
- use Five on-demand rendering rather than an independent perpetual render loop;
|
|
82
|
+
- measure real GPU/frame behavior before applying generic optimization advice.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# r117 version guards
|
|
2
|
+
|
|
3
|
+
Modern Three.js examples are not source-compatible with `three@0.117.1`. Translate them through installed declarations before use.
|
|
4
|
+
|
|
5
|
+
## Required r117 mappings
|
|
6
|
+
|
|
7
|
+
| Modern pattern | r117-compatible direction |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `three/addons/...` | `three/examples/jsm/.../*.js` |
|
|
10
|
+
| `texture.colorSpace = THREE.SRGBColorSpace` | `texture.encoding = THREE.sRGBEncoding` |
|
|
11
|
+
| `renderer.outputColorSpace` | `renderer.outputEncoding` |
|
|
12
|
+
| `TextGeometry` option `depth` | option `height` in the r117 declaration |
|
|
13
|
+
| `new THREE.CapsuleGeometry(...)` | compose reviewed r117 primitives or custom BufferGeometry |
|
|
14
|
+
| `matrix.invert()` | use the declared `target.getInverse(source)` pattern |
|
|
15
|
+
| modern `BoxGeometry` assumed to extend BufferGeometry | choose r117 `BoxBufferGeometry` explicitly when required |
|
|
16
|
+
| `three/tsl`, `Fn`, modern NodeMaterial/TSL | GLSL `ShaderMaterial`/`RawShaderMaterial`, or separately audit r117's old examples nodes |
|
|
17
|
+
| `WebGPURenderer` | unavailable; use the Five-owned WebGL renderer |
|
|
18
|
+
|
|
19
|
+
## Modern APIs absent from the pinned matrix
|
|
20
|
+
|
|
21
|
+
Do not generate these without upgrading and re-auditing the complete Five/Three matrix:
|
|
22
|
+
|
|
23
|
+
- `SRGBColorSpace`, `LinearSRGBColorSpace`, `NoColorSpace`, `outputColorSpace`;
|
|
24
|
+
- `three/addons`, `three/tsl`, WebGPU renderer and modern TSL helpers;
|
|
25
|
+
- `CapsuleGeometry`;
|
|
26
|
+
- current `MeshPhysicalMaterial` transmission, IOR, thickness, attenuation and iridescence fields;
|
|
27
|
+
- current GLTF loader helpers such as KTX2/Meshopt methods unless they exist in the exact installed r117 runtime and declaration;
|
|
28
|
+
- renderer members introduced later, including `useLegacyLights`, `compileAsync()` and `renderAsync()`.
|
|
29
|
+
|
|
30
|
+
Do not overgeneralize that boundary: r117 already has `physicallyCorrectLights`, tone mapping, `outputEncoding`, synchronous `compile()` and `setAnimationLoop()`.
|
|
31
|
+
|
|
32
|
+
## r117-specific cautions
|
|
33
|
+
|
|
34
|
+
- Geometry is in a legacy transition period: many shapes have both `*Geometry` and `*BufferGeometry` with different inheritance.
|
|
35
|
+
- `Texture.encoding` and `WebGLRenderer.outputEncoding` use `TextureEncoding` constants; the sRGB constant begins with lowercase `s`.
|
|
36
|
+
- `MeshPhysicalMaterial` fields must be read from the local declaration; current documentation includes properties r117 never had.
|
|
37
|
+
- Examples modules are not part of the root type barrel. Import their exact `.js` file under `three/examples/jsm`.
|
|
38
|
+
- Avoid adding an independent `@types/three`; r117 already declares `types: src/Three.d.ts`.
|
|
39
|
+
|
|
40
|
+
## Runtime and type availability
|
|
41
|
+
|
|
42
|
+
Classify an examples module before using it:
|
|
43
|
+
|
|
44
|
+
1. **Runtime and declaration both exist**: import the exact `.js` path and use the bundled type declaration directly.
|
|
45
|
+
2. **Runtime `.js` exists but its declaration is missing**: inspect the pinned r117 source, then add the smallest project-local module declaration or augmentation needed for the reviewed API. Keep it version-specific and verify runtime behavior; do not install modern `@types/three` to fill the gap.
|
|
46
|
+
3. **Runtime module or member is absent**: it is unavailable in this matrix. Choose an r117 alternative or upgrade and re-audit the full Five/Three contract.
|
|
47
|
+
|
|
48
|
+
For example, some r117 examples such as `NodeMaterialLoader.js` may have runtime code without a same-name `.d.ts`; that is a typing gap, not proof that the runtime module is absent.
|
|
49
|
+
|
|
50
|
+
## Verification workflow
|
|
51
|
+
|
|
52
|
+
1. Search the installed `three/src/Three.d.ts` root export.
|
|
53
|
+
2. Open the referenced local declaration for the exact field or constructor.
|
|
54
|
+
3. For extension modules, inspect the exact `.js` runtime and check whether a matching declaration exists; apply the three availability classes above.
|
|
55
|
+
4. Confirm the feature does not assume ownership of a Five-controlled subsystem.
|
|
56
|
+
5. Type-check, build, and exercise the behavior in the target browser/GPU.
|
|
57
|
+
|
|
58
|
+
The doctor/verifier string checks are representative, high-signal regression guards rather than a complete Three API validator. Installed runtime/declarations, any reviewed local augmentation, type checking, production build and browser/GPU validation form the complete gate.
|
|
59
|
+
|
|
60
|
+
Online current Three docs are useful for concepts, not signatures. Treat a runtime symbol absent from the pinned package as unavailable; treat a declaration-only gap according to the reviewed local-augmentation path instead of guessing a modern alias.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Fastify BFF server-only configuration. Copy this file to .env.development and replace the credential placeholders.
|
|
2
|
+
# The browser calls only same-origin /api/work/{resourceCode}; never rename these values to VITE_*.
|
|
3
|
+
# 标识当前的应用 ID(可选部署元数据)
|
|
4
|
+
APP_ID=next-vr-develpment
|
|
5
|
+
# Realsee 开放平台网关(中文版;海外版为 https://app-gateway.realsee.jp)
|
|
6
|
+
REALSEE_GATEWAY_ENDPOINT=https://app-gateway.realsee.cn
|
|
7
|
+
# Realsee 的网关 app key
|
|
8
|
+
REALSEE_GATEWAY_APP_KEY=*
|
|
9
|
+
# Realsee 的网关 app secret
|
|
10
|
+
REALSEE_GATEWAY_APP_SECRET=*
|
|
11
|
+
# Realsee 的企业账号 ID(可选部署元数据)
|
|
12
|
+
REALSEE_SOURCE=REALSEE_TECH
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
22.23.2
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
22.23.2
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Realsee Spatial Viewer
|
|
2
|
+
|
|
3
|
+
Generated by `@realsee/vr-cli` {{TOOL_VERSION}}.
|
|
4
|
+
|
|
5
|
+
This project ships a minimal read-only Viewer composition while preserving the complete native Five runtime, the dnalogel preset plugin collection, and an extension point for application-defined Five plugins. Vapor is only the React DOM component layer above the native Five canvas. The generated runtime does not use `@realsee/five/react`.
|
|
6
|
+
|
|
7
|
+
## Toolchain
|
|
8
|
+
|
|
9
|
+
Use Node.js `22.23.2` LTS from `.nvmrc` and `.node-version`: it is the current security patch on the oldest LTS line in the [Node.js production support matrix](https://nodejs.org/en/about/previous-releases). The runtime minimum is `>=22.18.0`, where the [native TypeScript type stripping](https://nodejs.org/api/typescript.html) used by the generated BFF is enabled by default. npm `11.19.0` stays pinned by `packageManager`. The committed `package-lock.json` is authoritative; use `npm ci` for deterministic installs. `.npmrc` enforces the declared engines, lockfile creation and the `>=` prefix for newly saved direct dependencies. ESLint covers browser TypeScript/React Hooks and Node BFF/config code; Prettier and EditorConfig keep formatting deterministic.
|
|
10
|
+
|
|
11
|
+
## Start
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
cp .env.example .env.development
|
|
15
|
+
# Fill REALSEE_GATEWAY_APP_KEY and REALSEE_GATEWAY_APP_SECRET in .env.development.
|
|
16
|
+
npm ci
|
|
17
|
+
npm run dev
|
|
18
|
+
# Open http://127.0.0.1:8087/xZjYOkRkWIz75RwI3x (replace with an authorized resourceCode).
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
`REALSEE_GATEWAY_ENDPOINT` must be an HTTPS URL; the BFF refuses HTTP so AK/SK cannot be sent in cleartext. `npm run dev` validates `.env.development` before starting Fastify and Vite. After changing `.env.development`, stop the existing dev command and start it again so Node reloads the environment.
|
|
22
|
+
|
|
23
|
+
Development runs the Fastify BFF on `127.0.0.1:8088` and Vite on `127.0.0.1:8087`; Vite proxies `/api` to Fastify, so the browser uses only the same-origin `GET /api/work/{resourceCode}` contract. Port 8087 is non-privileged; do not change it to privileged port 517.
|
|
24
|
+
|
|
25
|
+
The BFF posts `REALSEE_GATEWAY_APP_KEY` and `REALSEE_GATEWAY_APP_SECRET` as form fields to `/auth/access_token`, caches the 5-minute token until shortly before `expire_at`, retries once after an upstream 401, then calls `GET /open/v3/vr/info?resource_code={resourceCode}` with the raw token in the `Authorization` header. It returns only the browser-safe `{ work, workCode, baseURL? }` envelope. Generic `tags` are not inferred as PanoTag data. The default gateway is `https://app-gateway.realsee.cn`; overseas deployments use `https://app-gateway.realsee.jp`. See the official [Realsee OpenAPI reference](https://open-platform.realsee.com/developer/openapi/?id=1001).
|
|
26
|
+
|
|
27
|
+
For a production-style local run, build first and let Fastify serve both `dist` and the API on port 8087:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm run build
|
|
31
|
+
npm start
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Replace the example BFF
|
|
35
|
+
|
|
36
|
+
The browser depends only on `GET /api/work/{resourceCode}`. Fastify is an example implementation, not an application architecture requirement:
|
|
37
|
+
|
|
38
|
+
- `server/types.ts` declares the server-side contracts (`ServerConfig`, `WorkEnvelope`, `WorkDetailClient`, `WorkService`);
|
|
39
|
+
- `server/realsee-open-api.ts` owns Realsee token exchange, expiry caching and upstream Work calls;
|
|
40
|
+
- `server/work-service.ts` maps upstream data to the browser envelope without depending on Fastify;
|
|
41
|
+
- `server/work-route.ts` adapts that service to HTTP;
|
|
42
|
+
- `server/app.ts` composes routes and optional production static hosting;
|
|
43
|
+
- `server/index.ts` is the Node.js process entry.
|
|
44
|
+
|
|
45
|
+
The BFF is TypeScript and runs without a build step: Node executes `.ts` directly through native type stripping, so `npm run dev` and `npm start` need no bundler for the server. Because type stripping only removes erasable syntax, `tsconfig.server.json` enables `erasableSyntaxOnly`; `enum`, `namespace` and constructor parameter properties are rejected at type-check time instead of failing at runtime.
|
|
46
|
+
|
|
47
|
+
A Go, Java or other backend may replace the entire `server/` directory as long as it preserves the same-origin endpoint and response envelope. Keep AK/SK and access tokens server-side; never put them in `src/`, `VITE_*`, Vite `define/envPrefix`, URLs, browser headers, logs or bundles. AK/SK authorize the BFF to call the upstream API; if an internet-facing deployment also needs caller or tenant authorization, add that policy before the Work route instead of exposing AK/SK to the browser. The generated project does not include `work.json` or customer Work data.
|
|
48
|
+
|
|
49
|
+
The generated project has one `.env.example`. Only the Fastify BFF reads `REALSEE_GATEWAY_ENDPOINT`, `REALSEE_GATEWAY_APP_KEY` and `REALSEE_GATEWAY_APP_SECRET`; `APP_ID` and `REALSEE_SOURCE` remain optional deployment metadata. Real values belong in `.env.development`, the deployment environment or a secret manager.
|
|
50
|
+
|
|
51
|
+
## Update dependencies
|
|
52
|
+
|
|
53
|
+
The manifest intentionally declares every direct dependency except `three` as an open minimum range (`>=baseline`). The committed `package-lock.json` records the generator's reviewed initial resolution, so `npm ci` remains reproducible while an explicit update can move across major versions.
|
|
54
|
+
|
|
55
|
+
To update every unlocked dependency to the newest release allowed by its open range:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npm update
|
|
59
|
+
npm run check
|
|
60
|
+
npm run build
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
To raise one dependency's declared minimum to its latest release and refresh the lockfile in one step:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npm install <pkg>@latest
|
|
67
|
+
npm run check
|
|
68
|
+
npm run build
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
`.npmrc` uses `save-prefix=>=`, so newly saved direct dependencies and explicit upgrades retain the open-minimum policy. After manually editing a minimum, use `npm run deps:relock`, then `npm run deps:install` to verify a clean lockfile install.
|
|
72
|
+
|
|
73
|
+
Only one dependency is hard-locked:
|
|
74
|
+
|
|
75
|
+
- `three` must stay exactly `0.117.1`. Five 6.8.9 targets that release, and the generated code plus the bundled Three capability references assume the r117 API surface. `vr-cli doctor` and the portable verifier reject any other value, including ranges.
|
|
76
|
+
- Every other dependency, including `@realsee/five`, `@realsee/dnalogel`, `@realsee/vapor`, Fastify, React, Vite, TypeScript and the lint stack, must use `>=x.y.z` with a minimum no lower than the generator baseline. Exact, caret, tilde and bounded ranges are rejected because they cannot move freely to the latest release.
|
|
77
|
+
- The lockfile's resolved direct version must satisfy both the declared minimum and the generator baseline. Raising a minimum requires relocking.
|
|
78
|
+
|
|
79
|
+
When you update Five, dnalogel or Vapor, re-check the versioned contract fixtures and validate them together in a real browser: their spatial behavior is not fully covered by type checking. Do not run `npm audit fix --force`, which would rewrite the locked Three version.
|
|
80
|
+
|
|
81
|
+
## Generator manifest
|
|
82
|
+
|
|
83
|
+
`.vr-cli.json` is generator metadata, not application runtime configuration. It records only the schema/tool version, preset, package name, Agent asset mode and generation time. `vr-cli doctor` uses the declared Agent asset mode together with the files currently on disk to validate expected and unexpected Agent assets. Keep it in the generated repository for diagnostics and provenance, but never put credentials in it.
|
|
84
|
+
|
|
85
|
+
The BFF returns raw Work inside this browser-safe envelope. Only an explicit nested PanoTag preset list is loaded; generic `tags`, `tagList` or `tag_list` fields are never inferred as PanoTag:
|
|
86
|
+
|
|
87
|
+
```json
|
|
88
|
+
{
|
|
89
|
+
"work": {},
|
|
90
|
+
"workCode": "xZjYOkRkWIz75RwI3x",
|
|
91
|
+
"baseURL": "https://authorized-resource-host.example/",
|
|
92
|
+
"initialState": {},
|
|
93
|
+
"presetData": {
|
|
94
|
+
"panoTagList": []
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Spatial annotations
|
|
100
|
+
|
|
101
|
+
“VR spatial tag” (spatial annotation) is the domain concept; PanoTag is only one preset implementation. Before adding a tag, classify its content, renderer, anchor and lifecycle/data ownership. Text, images, video, audio, models, virtual screens, room/item labels and custom spatial content may require different dnalogel presets or an application-defined Five/Three plugin.
|
|
102
|
+
|
|
103
|
+
The Viewer is read-only. Do not directly edit `work.json`, downloaded Work or customer Work, and do not invent third-party media URLs. Persistent changes require an authoritative editor/API/BFF/source contract and user confirmation; otherwise use a typed patch proposal or runtime-only feature.
|
|
104
|
+
|
|
105
|
+
## Architecture
|
|
106
|
+
|
|
107
|
+
```text
|
|
108
|
+
server/
|
|
109
|
+
├── config.mjs server-only environment validation
|
|
110
|
+
├── realsee-open-api.mjs token cache and Realsee OpenAPI adapter
|
|
111
|
+
├── work-service.mjs framework-neutral browser envelope
|
|
112
|
+
├── work-route.mjs Fastify HTTP adapter
|
|
113
|
+
├── app.mjs API and optional dist hosting
|
|
114
|
+
└── index.mjs Node.js process entry
|
|
115
|
+
src/
|
|
116
|
+
├── app/ composition root
|
|
117
|
+
├── vr/
|
|
118
|
+
│ ├── five/ native Five runtime and complete supported entry map
|
|
119
|
+
│ ├── plugins/ dnalogel presets, custom Five plugins and lifecycle registry
|
|
120
|
+
│ └── work/ browser-side WorkSource boundary
|
|
121
|
+
├── features/ focused spatial feature adapters
|
|
122
|
+
├── ui/ Vapor/React DOM only
|
|
123
|
+
└── shared/ non-domain React utilities
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
- `.agents/skills/threejs-r117-five` maps all ten Three.js r117 capability domains, Five ownership boundaries and modern API incompatibilities for any Agent.
|
|
127
|
+
- `fiveConfig.ts` returns reviewed `FiveInitArgs`; `SpatialRuntimeProvider` calls `new Five(...)` directly.
|
|
128
|
+
- The provider waits for a positive host size, uses `appendTo` and `refresh`, exposes the native instance through `useSpatialRuntime()`, then owns plugin/Five/canvas cleanup.
|
|
129
|
+
- React is limited to local composition, Context, lifecycle and DOM UI; do not add `createFiveProvider`, `FiveCanvas` or Five React hooks.
|
|
130
|
+
- `src/vr/five/api.ts` maps every supported native Five 6.8.9 public entry point.
|
|
131
|
+
- `src/vr/plugins/dnalogel.ts` exposes the dnalogel 3.81.2 preset plugin root surface; `src/vr/plugins` also hosts application-defined Five plugin infrastructure.
|
|
132
|
+
- `SpatialPluginRegistry` is vendor-neutral: it rejects external name collisions, performs identity-safe registration and continues draining after individual disposal errors; each plugin feature still owns its declared load/hooks/media lifecycle.
|
|
133
|
+
- `src/vr/plugins/examples/FeatureOwnedMeshPlugin.ts` is an opt-in Agent reference for custom Five/Three features. The default App does not import or register it. Vibe coding should copy its feature-owned scene root, registration rollback, render invalidation and idempotent disposal pattern before adding a focused feature.
|
|
134
|
+
- `features/navigation` and `features/tags` are examples, not capability limits. The bundled PanoTag feature is created only for explicit `presetData.panoTagList` data.
|
|
135
|
+
- `ui/ViewerOverlay.tsx` contains the Vapor DOM overlay and imports no spatial SDK.
|
|
136
|
+
|
|
137
|
+
Prefer narrow direct imports in production features so unused capability families are not bundled.
|
|
138
|
+
|
|
139
|
+
## Checks
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
npm run typecheck
|
|
143
|
+
npm run typecheck:web
|
|
144
|
+
npm run typecheck:bff
|
|
145
|
+
npm run lint
|
|
146
|
+
npm run format:check
|
|
147
|
+
npm run check
|
|
148
|
+
npm run build
|
|
149
|
+
node .agents/skills/realsee-vr-app/scripts/verify-project.mjs .
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Development-time validation is strict by design:
|
|
153
|
+
|
|
154
|
+
- `typecheck:web` runs `tsconfig.json` over browser sources; `typecheck:bff` runs `tsconfig.server.json` over `server/`. Both enable `strict`, `noUncheckedIndexedAccess`, `noImplicitReturns` and unused-symbol checks; the server project adds `exactOptionalPropertyTypes`, `verbatimModuleSyntax` and `erasableSyntaxOnly`.
|
|
155
|
+
- `lint` is type-aware (`typescript-eslint` `recommendedTypeChecked` over both projects) and fails on any warning. `no-floating-promises` and `no-misused-promises` are enforced everywhere; `no-unnecessary-condition` is enabled for `server/**` where types are fully owned, and left off for browser code that relies on async cancellation flags TypeScript cannot narrow.
|
|
156
|
+
- `check` runs type checking, lint and Prettier; `build` repeats it before the Vite production build.
|
|
157
|
+
|
|
158
|
+
The portable Skills contain the version-bound native Five lifecycle map, spatial-annotation decision workflow, complete dnalogel plugin family catalog, Three.js r117 capability/ownership/version guards, and Vapor DOM boundary. Installed declarations remain the source of truth for signatures.
|
|
159
|
+
|
|
160
|
+
This is an internal integration template. Do not commit credentials, customer Work payloads, SDK source or copied SDK documentation.
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import js from '@eslint/js'
|
|
2
|
+
import globals from 'globals'
|
|
3
|
+
import reactHooks from 'eslint-plugin-react-hooks'
|
|
4
|
+
import tseslint from 'typescript-eslint'
|
|
5
|
+
|
|
6
|
+
// Development-time strong validation: TypeScript sources are linted with
|
|
7
|
+
// type-aware rules from both the browser and the server project.
|
|
8
|
+
export default tseslint.config(
|
|
9
|
+
{
|
|
10
|
+
ignores: [
|
|
11
|
+
'node_modules/**',
|
|
12
|
+
'dist/**',
|
|
13
|
+
'.agents/**',
|
|
14
|
+
'.claude/**',
|
|
15
|
+
'.cursor/**',
|
|
16
|
+
'.github/**',
|
|
17
|
+
'.kiro/**',
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
...js.configs.recommended,
|
|
22
|
+
files: ['**/*.{js,mjs,cjs}'],
|
|
23
|
+
},
|
|
24
|
+
...tseslint.configs.recommendedTypeChecked,
|
|
25
|
+
{
|
|
26
|
+
files: ['**/*.{ts,tsx}'],
|
|
27
|
+
languageOptions: {
|
|
28
|
+
parserOptions: {
|
|
29
|
+
project: ['./tsconfig.json', './tsconfig.server.json'],
|
|
30
|
+
tsconfigRootDir: import.meta.dirname,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
rules: {
|
|
34
|
+
'@typescript-eslint/consistent-type-imports': 'error',
|
|
35
|
+
'@typescript-eslint/no-floating-promises': 'error',
|
|
36
|
+
'@typescript-eslint/no-misused-promises': 'error',
|
|
37
|
+
'@typescript-eslint/switch-exhaustiveness-check': 'error',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
// Server types are fully owned here, so redundant runtime guards are real findings.
|
|
42
|
+
// Browser code keeps async cancellation flags that TypeScript cannot narrow, so
|
|
43
|
+
// this rule stays scoped to the server project.
|
|
44
|
+
files: ['server/**/*.ts'],
|
|
45
|
+
rules: {
|
|
46
|
+
'@typescript-eslint/no-unnecessary-condition': 'error',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
files: ['src/**/*.{ts,tsx}'],
|
|
51
|
+
languageOptions: {
|
|
52
|
+
globals: globals.browser,
|
|
53
|
+
},
|
|
54
|
+
plugins: {
|
|
55
|
+
'react-hooks': reactHooks,
|
|
56
|
+
},
|
|
57
|
+
rules: {
|
|
58
|
+
'react-hooks/exhaustive-deps': 'error',
|
|
59
|
+
'react-hooks/rules-of-hooks': 'error',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
files: ['server/**/*.ts'],
|
|
64
|
+
languageOptions: {
|
|
65
|
+
globals: globals.node,
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
files: ['**/*.{js,mjs,cjs}'],
|
|
70
|
+
extends: [tseslint.configs.disableTypeChecked],
|
|
71
|
+
languageOptions: {
|
|
72
|
+
globals: globals.node,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<meta name="theme-color" content="#0b1020" />
|
|
7
|
+
<title>Realsee VR Viewer</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|