u-space 0.0.21 → 0.0.23

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.
@@ -2,7 +2,13 @@ import { Loader } from 'three/webgpu';
2
2
  import type { Viewer } from 'u-space';
3
3
  import { BuildingGroup } from './objects/BuildingGroup';
4
4
  export declare class SemanticLoader extends Loader {
5
+ #private;
5
6
  viewer: Viewer;
7
+ key: string;
8
+ cachedIds: Set<string>;
6
9
  constructor(viewer: Viewer);
10
+ setKey(key: string): this;
7
11
  loadAsync(): Promise<BuildingGroup[]>;
12
+ clearCache(): void;
13
+ dispose(): void;
8
14
  }
@@ -1,5 +1,15 @@
1
+ import { type LoadingManager, type Object3D } from 'three/webgpu';
1
2
  import { BuildingGroup } from './objects/BuildingGroup';
2
3
  import type { SemanticObject } from './semantic.types';
4
+ import type { ITreeData } from '../types';
5
+ export interface SemanticParserOptions {
6
+ treeData?: ITreeData[];
7
+ path?: string;
8
+ manager?: LoadingManager;
9
+ registerObject?: (id: string, object: Object3D) => void;
10
+ }
3
11
  export declare class SemanticParser {
12
+ #private;
4
13
  parse(semanticData: SemanticObject): BuildingGroup[];
14
+ parseAsync(semanticData: SemanticObject, options?: SemanticParserOptions): Promise<BuildingGroup[]>;
5
15
  }
@@ -3,6 +3,7 @@ import type { ElevatorMesh } from './ElevatorMesh';
3
3
  import type { FloorMesh } from './FloorMesh';
4
4
  import type { SemanticKind } from '../types';
5
5
  import type { VentMesh } from './VentMesh';
6
+ export type BuildingFloorReference = FloorMesh | number;
6
7
  export declare class BuildingGroup extends BaseGroup {
7
8
  isBuildingGroup: boolean;
8
9
  type: string;
@@ -19,8 +20,11 @@ export declare class BuildingGroup extends BaseGroup {
19
20
  addVent(mesh: VentMesh): this;
20
21
  getVentAt(index: number): VentMesh;
21
22
  removeVent(mesh: VentMesh): this;
22
- isolateFloor(mesh: FloorMesh | number): this;
23
+ isolateFloor(floor: BuildingFloorReference | BuildingFloorReference[]): this;
24
+ isolateFloors(floors: BuildingFloorReference[]): this;
23
25
  showAllFloors(): this;
26
+ showAllFacilities(): this;
27
+ hideAllFacilities(): this;
24
28
  planishFloors(kind?: SemanticKind): this;
25
29
  unplanishFloors(kind?: SemanticKind): this;
26
30
  }
@@ -1,6 +1,26 @@
1
- import { Box3, BufferGeometry, Matrix4, MeshStandardNodeMaterial, Sphere, Vector3, Vector4, type Intersection, type Raycaster } from 'three/webgpu';
1
+ import { Box3, BufferGeometry, Matrix4, MeshStandardNodeMaterial, Sphere, Vector3, Vector4, type Intersection, type Object3D, type Raycaster } from 'three/webgpu';
2
2
  import { BaseMesh, type InteractionEvent, type InteractionEventMap } from 'u-space';
3
3
  import type { SemanticColor, SemanticGeometryEntry, SemanticKind } from '../types';
4
+ type FacilityReference = Object3D | string;
5
+ type FacilitySemanticKind = 'Facilities';
6
+ export type FloorSemanticKind = SemanticKind | FacilitySemanticKind;
7
+ export interface FloorGeometrySemanticEntity {
8
+ type: 'geometry';
9
+ kind: SemanticKind;
10
+ id: string;
11
+ name?: string;
12
+ index: number;
13
+ }
14
+ export interface FloorFacilitySemanticEntity {
15
+ type: 'object';
16
+ kind: FacilitySemanticKind;
17
+ id: string;
18
+ name?: string;
19
+ index: number;
20
+ object: Object3D;
21
+ aliases: string[];
22
+ }
23
+ export type FloorSemanticEntity = FloorGeometrySemanticEntity | FloorFacilitySemanticEntity;
4
24
  type FloorMeshEventPayload<T> = T extends {
5
25
  event: InteractionEvent;
6
26
  } ? {
@@ -34,15 +54,28 @@ export declare class FloorMesh extends BaseMesh<BufferGeometry, MeshStandardNode
34
54
  windowsInstances: Map<string, number>;
35
55
  staircasesInstances: Map<string, number>;
36
56
  semanticInstances: Map<string, number>;
57
+ semanticEntities: Map<string, FloorSemanticEntity>;
58
+ facilityObjectsById: Map<string, Object3D>;
59
+ facilityObjects: Object3D[];
37
60
  constructor(entries: SemanticGeometryEntry[]);
38
61
  planish(kind?: SemanticKind): this;
39
62
  unplanish(kind?: SemanticKind): this;
40
63
  get semanticCount(): number;
41
64
  get instanceCount(): number;
42
65
  getSemanticIndexById(id: string): number | undefined;
66
+ getSemanticById(id: string): FloorSemanticEntity | undefined;
67
+ getSemantics(): FloorSemanticEntity[];
68
+ getSemanticsByKind(kind: FloorSemanticKind): FloorSemanticEntity[];
43
69
  getSemanticIdAt(index: number): string;
44
70
  getSemanticKindAt(index: number): SemanticKind;
45
71
  getSemanticNameAt(index: number): string | undefined;
72
+ showAllFacilities(): this;
73
+ hideAllFacilities(): this;
74
+ addFacility(object: Object3D, ids?: string | string[]): this;
75
+ getFacilityById(id: string): Object3D<import("three").Object3DEventMap> | undefined;
76
+ getFacilityAt(index: number): Object3D<import("three").Object3DEventMap>;
77
+ getFacilities(): Object3D<import("three").Object3DEventMap>[];
78
+ removeFacility(facility: FacilityReference): this;
46
79
  setColorAt(index: number, color: SemanticColor): this;
47
80
  getColorAt(index: number, target?: Vector4): Vector4;
48
81
  setOpacityAt(index: number, opacity: number): this;
@@ -35,11 +35,17 @@ export interface Staircase {
35
35
  Polyline: number[];
36
36
  Spaces: number[];
37
37
  }
38
+ export interface Facility {
39
+ ID: string;
40
+ Name: string;
41
+ Spaces: number[];
42
+ TwinsIdentifier: string;
43
+ }
38
44
  export interface Story {
39
45
  Columns?: any[];
40
46
  Doors?: number[];
41
47
  Elevation?: number;
42
- Facilities?: any[];
48
+ Facilities?: number[];
43
49
  FloorIndex?: any;
44
50
  Height?: number;
45
51
  ID?: string;
@@ -103,6 +109,7 @@ export interface Asset {
103
109
  export interface SemanticObject {
104
110
  Buildings?: Building[];
105
111
  Doors?: Door[];
112
+ Facilities?: Facility[];
106
113
  Spaces?: Space[];
107
114
  Staircases?: Staircase[];
108
115
  Stories?: Story[];
@@ -1,5 +1,6 @@
1
1
  import { type WebGPURenderer } from 'three/webgpu';
2
2
  export declare class Info {
3
+ #private;
3
4
  el: HTMLElement;
4
5
  renderer: WebGPURenderer;
5
6
  container: HTMLElement;
@@ -55,4 +55,4 @@ const { lon, lat, height } = arcgisTilesRenderer.positionToLonLatHeight(worldPos
55
55
 
56
56
  传给 `positionToLonLatHeight()` 的 `position` 必须是场景世界坐标。如果坐标来自某个对象的局部空间,先通过 `object.localToWorld(localPosition)` 或 `object.getWorldPosition()` 转成世界坐标。
57
57
 
58
- 如果在瓦片 root tileset 加载前调用 `invalidate()`,重定位会等到 root tileset 加载后才真正应用。需要在业务逻辑中立即使用转换结果时,应确保 `invalidate()` 已经完成,或在瓦片加载完成后再调用转换方法。
58
+ 如果在瓦片 root tileset 加载前调用 `invalidate()`,会先基于当前 WGS84 椭球立即应用一次重定位,保证后续坐标转换可用;root tileset 加载完成后会按最终 ellipsoid 再应用一次。
@@ -1,12 +1,12 @@
1
1
  # u-manager
2
2
 
3
- `u-manager` 是一套全面的加载器和解析器,用于从服务器路径流式传输、解密并显示结构化场景数据。支持场景、拓扑、动画、属性、相机视点、楼层和井道语义模型。
3
+ `u-manager` 是一套全面的加载器和解析器,用于从服务器路径流式传输、解密并显示结构化场景数据。支持场景、拓扑、动画、属性、相机视点、楼层、井道和设备语义模型。
4
4
 
5
5
  所有加载器均继承自 Three.js 的 `Loader`,并提供 `setPath(path)` 方法,在调用 `loadAsync()` 前配置基础数据目录。
6
6
 
7
7
  ## `SemanticLoader`
8
8
 
9
- 加载 `db/semantic_model.json` 楼层语义数据,并按建筑返回 `BuildingGroup[]`。每个建筑包含多个 `FloorMesh`,每个楼层把墙、柱、空间等语义对象合并为一个 TSL 材质驱动的网格;建筑级电梯井和通风井会使用 `ExtrudeMesh` 独立渲染。
9
+ 加载 `db/semantic_model.json` 楼层语义数据,并按建筑返回 `BuildingGroup[]`。每个建筑包含多个 `FloorMesh`,每个楼层把墙、柱、空间、楼梯等语义对象合并为一个 TSL 材质驱动的网格;建筑级电梯井和通风井会使用 `ExtrudeMesh` 独立渲染。语义模型包含 `Facilities` 时,`SemanticLoader` 会额外读取 `SceneMetadata.json` 指向的 `tree_models`,按场景授权配置解密,再把对应设备模型挂载到所属楼层。
10
10
 
11
11
  ```typescript
12
12
  import { Vector3, Vector4 } from 'three';
@@ -14,6 +14,7 @@ import { SemanticLoader } from 'u-space/plugins/u-manager';
14
14
 
15
15
  const loader = new SemanticLoader(viewer);
16
16
  loader.setPath('./scenes/my-scene');
17
+ loader.setKey('YOUR_LICENSE_KEY'); // 官方授权场景解析 tree_models 时必需
17
18
 
18
19
  const buildings = await loader.loadAsync(); // BuildingGroup[]
19
20
  viewer.scene.add(...buildings);
@@ -36,7 +37,7 @@ floor.addEventListener('click', ({ event }) => {
36
37
 
37
38
  ### `BuildingGroup`
38
39
 
39
- `BuildingGroup` 继承自 `BaseGroup`,用于组织一个建筑下的所有楼层、电梯井和通风井。
40
+ `BuildingGroup` 继承自 `BaseGroup`,用于组织一个建筑下的所有楼层、电梯井和通风井。设备语义对象不会直接挂到 `BuildingGroup`,而是作为实际模型挂到对应的 `FloorMesh`。
40
41
 
41
42
  | 属性 / 方法 | 说明 |
42
43
  | :---------- | :--- |
@@ -50,8 +51,11 @@ floor.addEventListener('click', ({ event }) => {
50
51
  | `getElevatorAt(index)` | 按下标获取电梯井 `ExtrudeMesh`。 |
51
52
  | `addVent(vent)` / `removeVent(vent)` | 添加或移除通风井,并同步更新 group。 |
52
53
  | `getVentAt(index)` | 按下标获取通风井 `ExtrudeMesh`。 |
53
- | `isolateFloor(floor \| index)` | 只显示指定楼层,隐藏其他楼层。 |
54
+ | `isolateFloor(floor \| index)` | 只显示指定楼层,隐藏其他楼层;也兼容传入楼层数组。 |
55
+ | `isolateFloors(floors \| indexes)` | 只显示指定多个楼层,隐藏其他楼层。 |
54
56
  | `showAllFloors()` | 显示全部楼层。 |
57
+ | `showAllFacilities()` | 显示整栋建筑内全部楼层设备。 |
58
+ | `hideAllFacilities()` | 隐藏整栋建筑内全部楼层设备。 |
55
59
  | `planishFloors(kind?)` | 压扁所有楼层;传入 `kind` 时只压扁该语义类型。 |
56
60
  | `unplanishFloors(kind?)` | 恢复所有楼层;传入 `kind` 时只恢复该语义类型。 |
57
61
 
@@ -74,9 +78,30 @@ if (vent) {
74
78
 
75
79
  电梯井和通风井会在渲染阶段沿法线轻微内收,减少与墙体共面时的闪面。`Spaces` 实例也会使用稳定的 per-instance 渲染偏移抖动,缓解完全重叠空间之间的 z-fighting;这些偏移只影响渲染顶点,不改变语义 ID、实例矩阵和包围体查询的使用方式。
76
80
 
81
+ ### 设施设备
82
+
83
+ `SemanticLoader` 会从 `Stories[].Facilities` 读取设备索引,再从顶层 `Facilities` 数组取得 `Facility` 数据,并使用 `Facility.ID` 在解密后的 `tree_models` 中查找同 ID 节点。只有带 `renderType: '3D'` 和模型 `path` 的节点会被加载。
84
+
85
+ `tree_models.matrix` 是相对父节点的本地矩阵;`SemanticLoader` 会沿树父级累乘得到设备世界矩阵,再转换为对应 `FloorMesh` 的局部矩阵。因此楼层移动、隔离或显示隐藏时设备会跟随楼层一起工作。即使某个 story 只有 `Facilities`、没有墙柱空间等合并几何,也会创建一个空的 `FloorMesh` 作为设备容器。
86
+
87
+ 加载成功后,设备会写入 `userData.facilityId`、`semanticId`、`semanticKind: 'Facilities'`、`semanticName`、`spaces`、`twinsIdentifier`、`storyId` 和 `floorIndex`,并按 `Facility.ID` 以及 `tree_models` 节点的 `sid` 注册到 `viewer.objectManager`。
88
+
89
+ ```typescript
90
+ const floor = building.getFloorAt(0);
91
+
92
+ const facility = floor.getFacilityById('FACILITY_001') ?? viewer.objectManager.getById('FACILITY_001');
93
+ const facilityEntity = floor.getSemanticById('FACILITY_001');
94
+
95
+ if (facility && facilityEntity?.type === 'object') {
96
+ await viewer.controls.flyToObject(facility);
97
+ }
98
+
99
+ const facilities = floor.getSemanticsByKind('Facilities');
100
+ ```
101
+
77
102
  ### `FloorMesh`
78
103
 
79
- `FloorMesh` 继承自 `BaseMesh`,表示一个楼层。它不是 `BatchedMesh`,而是把同一楼层内的语义对象合并为一份几何,并通过 TSL + `DataTexture` 在 GPU 侧按 `semanticIndex` 控制颜色、透明度、显示隐藏和实例矩阵。
104
+ `FloorMesh` 继承自 `BaseMesh`,表示一个楼层。它不是 `BatchedMesh`,而是把同一楼层内的语义对象合并为一份几何,并通过 TSL + `DataTexture` 在 GPU 侧按 `semanticIndex` 控制颜色、透明度、显示隐藏和实例矩阵。设备模型作为普通 `Object3D` 子对象挂载在楼层下,通过设施检索 API 管理。
80
105
 
81
106
  这种结构的目标是让每个楼层通常只占一个主渲染 draw call,同时仍保留实例级控制能力。`xxxAt` 方法全部作用于单个语义实例;没有 `At` 后缀的方法作用于整个楼层 mesh。
82
107
 
@@ -84,11 +109,24 @@ if (vent) {
84
109
  | :---------- | :--- |
85
110
  | `semanticCount` / `instanceCount` | 当前楼层语义实例数量。 |
86
111
  | `semanticInstances` | `Map<string, number>`,从语义对象 ID 映射到实例下标。 |
87
- | `wallsInstances` / `columnsInstances` / `spacesInstances` / `doorsInstances` / `windowsInstances` | 按语义类型维护的 ID 到实例下标映射。 |
112
+ | `wallsInstances` / `columnsInstances` / `spacesInstances` / `doorsInstances` / `windowsInstances` / `staircasesInstances` | 按语义类型维护的 ID 到实例下标映射。 |
113
+ | `semanticEntities` | `Map<string, FloorSemanticEntity>`,统一索引楼层内合并几何语义和 `Facilities` 对象语义。 |
114
+ | `facilityObjectsById` | `Map<string, Object3D>`,按 `Facility.ID`、`sid` 或显式别名查找设备模型。 |
115
+ | `facilityObjects` | 当前楼层挂载的设备模型数组。 |
88
116
  | `getSemanticIndexById(id)` | 根据语义 ID 获取实例下标。 |
117
+ | `getSemanticById(id)` | 根据语义 ID 或设备别名获取统一语义实体。 |
118
+ | `getSemantics()` | 获取楼层内全部语义实体,包含合并几何和设备对象。 |
119
+ | `getSemanticsByKind(kind)` | 按语义类型过滤实体;`kind` 可以是 `Walls`、`Columns`、`Spaces`、`Doors`、`Windows`、`Staircases` 或 `Facilities`。 |
89
120
  | `getSemanticIdAt(index)` | 获取实例语义 ID。 |
90
- | `getSemanticKindAt(index)` | 获取实例类型:`'Walls' \| 'Columns' \| 'Spaces' \| 'Doors' \| 'Windows'`。 |
121
+ | `getSemanticKindAt(index)` | 获取合并几何实例类型:`'Walls' \| 'Columns' \| 'Spaces' \| 'Doors' \| 'Windows' \| 'Staircases'`。 |
91
122
  | `getSemanticNameAt(index)` | 获取实例名称;当前 `Spaces` 会从语义数据的 `Name` 写入,其他类型可能为 `undefined`。 |
123
+ | `showAllFacilities()` | 显示当前楼层的全部设备对象。 |
124
+ | `hideAllFacilities()` | 隐藏当前楼层的全部设备对象。 |
125
+ | `addFacility(object, ids?)` | 把设备对象挂到楼层,并按显式 ID、`facilityId`、`semanticId`、`id`、`sid` 建立检索别名。 |
126
+ | `getFacilityById(id)` | 根据 `Facility.ID`、`sid` 或别名获取设备对象。 |
127
+ | `getFacilityAt(index)` | 按楼层设备数组下标获取设备对象。 |
128
+ | `getFacilities()` | 获取当前楼层全部设备对象。 |
129
+ | `removeFacility(facility)` | 按设备对象或 ID 从楼层移除设备,并同步清理检索索引。 |
92
130
  | `setColorAt(index, color)` / `getColorAt(index, target?)` | 修改或读取实例颜色,支持 `Color`、`Vector3`、`Vector4`。 |
93
131
  | `setOpacityAt(index, opacity)` / `getOpacityAt(index)` | 修改或读取实例透明度。 |
94
132
  | `setVisibleAt(index, visible)` / `getVisibleAt(index)` | 修改或读取实例显隐状态。 |
package/docs/changelog.md CHANGED
@@ -4,6 +4,15 @@
4
4
 
5
5
  ### 新增
6
6
 
7
+ - **u-manager semantics** — `BuildingGroup` 新增 `isolateFloors(floors)`,支持按多个 `FloorMesh` 或楼层下标同时隔离显示多个楼层;`isolateFloor()` 继续兼容单楼层调用,并可接收数组作为便捷写法。
8
+ - **u-manager semantics** — `SemanticLoader` 新增 `Facilities` 解析:从 `Stories[].Facilities` 索引读取顶层设备语义,用 `Facility.ID` 匹配解密后的 `tree_models` 设备节点,沿父级累乘本地矩阵得到设备世界矩阵,加载 3D 设备模型并转换为楼层局部矩阵后挂载到对应 `FloorMesh`。
9
+ - **u-manager semantics** — `FloorMesh` 新增楼层设备检索与统一语义实体 API:`getFacilityById()`、`getFacilityAt()`、`getFacilities()`、`removeFacility()`、`showAllFacilities()`、`hideAllFacilities()`、`getSemanticById()`、`getSemantics()` 和 `getSemanticsByKind('Facilities')`;`BuildingGroup.showAllFacilities()/hideAllFacilities()` 支持批量显示或隐藏整栋建筑内的楼层设备。
10
+ - **u-space MCP** — 文档索引同步楼层 `Facilities` 解析和检索 API,MCP 客户端可检索设备按楼层挂载、`tree_models` 解密匹配、本地矩阵父级累乘和世界坐标转换规则。
11
+
12
+ ## 0.0.21
13
+
14
+ ### 新增
15
+
7
16
  - **u-manager semantics** — `SemanticLoader` 支持解析建筑级 `Elevators` 和 `Vents`,以 `Polygon.shape` 作为底面轮廓、`Elevation` 作为底面高度、`TotalHeight` 作为拉伸高度生成 `ExtrudeMesh`,并通过 `BuildingGroup.elevatorMeshes`、`BuildingGroup.ventMeshes` 及 add/get/remove 方法管理。
8
17
 
9
18
  ### 修复
@@ -11,6 +20,10 @@
11
20
  - **透明语义体块渲染** — 电梯井/通风井在渲染阶段沿法线轻微内收,`Spaces` 实例使用稳定 per-instance 渲染偏移抖动,缓解与墙体或完全重叠空间共面时的 z-fighting。
12
21
  - **atmosphere 插件** — 后处理链移除 aerial perspective 节点,保留 lens flare、tone mapping、temporal antialias 和 dithering;`scene.backgroundNode` 使用 `skyBackground()`,`scene.environmentNode` 使用 `skyEnvironment()`,并继续在关闭插件时恢复启用前的背景和环境节点。
13
22
 
23
+ ### 示例与文档
24
+
25
+ - **在线示例** — `examples/importmap.js` 的 CDN fallback 版本更新为 `0.0.21`,部署流程仍会优先按 `package.json` 注入当前版本。
26
+
14
27
  ## 0.0.18
15
28
 
16
29
  ### 变更
@@ -27,7 +40,7 @@
27
40
  ### 变更
28
41
 
29
42
  - **大气状态更新** — 大气插件在 `beforeRender` 中刷新相机 ECEF 位置、太阳/月亮方向和阴影 target,相机控制器驱动的移动也能逐帧更新大气状态。
30
- - **MCP 发布** — 根目录 MCP 发布入口合并为 `pnpm publish:mcp`,命令会先构建 `u-space-mcp` 文档索引,再发布 npm 包。
43
+ - **MCP 发布** — 根目录 MCP 发布入口合并为 `pnpm publish:mcp`,命令会先递增 `u-space-mcp` patch 版本,再构建文档索引并发布 npm 包。
31
44
 
32
45
  ## 0.0.16
33
46
 
@@ -2,6 +2,12 @@
2
2
 
3
3
  `u-space` 的 `examples/` 目录中包含了大量演示引擎功能的示例。以下是几个关键示例及其所展示的系统特性。
4
4
 
5
+ ## 运行方式与版本
6
+
7
+ 示例统一通过 `examples/importmap.js` 注入 Import Map。本地通过 `localhost`、`127.0.0.1`、`0.0.0.0` 或 `192.168.x.x` 访问时会加载仓库里的 `../dist/` 构建产物;在线部署或非本地域名访问时会从 jsDelivr 加载当前发布版本 `u-space@0.0.22`。Vercel 文档部署会继续把 `__VERSION__` 占位符替换为 `package.json` 中的版本号,源码里的 `0.0.22` 作为直接托管 `examples/` 时的 fallback。
8
+
9
+ 插件示例可以在页面加载 `importmap.js` 前通过 `window.__IMPORTS__` 声明额外依赖。将 `u-space/plugins/<name>` 的值设为 `true` 时,`importmap.js` 会自动在本地和 CDN 路径之间切换。
10
+
5
11
  ## 1. `demo01.html`:基础配置与交互
6
12
 
7
13
  该示例演示了通过 WebGPU 渲染 3D 场景所需的最少配置,与 [快速上手](./getting-started.md) 指南中的内容一致。
@@ -125,7 +125,7 @@ box.addEventListener('pointerleave', (e) => {
125
125
 
126
126
  ```typescript
127
127
  import { version } from 'u-space';
128
- console.log(version); // e.g. '0.0.5'
128
+ console.log(version); // e.g. '0.0.22'
129
129
 
130
130
  // 也可以通过全局变量访问
131
131
  console.log(window.__USPACE__.version);
package/docs/index.md CHANGED
@@ -52,7 +52,7 @@ features:
52
52
  | [keyboard-controls](./api-plugin-keyboard-controls) | WASD / 方向键控制相机移动与旋转 |
53
53
  | [minimap](./api-plugin-minimap) | 2D 小地图叠加层 |
54
54
  | [tiles](./api-plugin-tiles) | ArcGIS 3D 瓦片 / GIS 地球渲染 |
55
- | [u-manager](./api-plugin-u-manager) | 场景加载、语义楼层、语义井道、拓扑、动画、属性、视点管理 |
55
+ | [u-manager](./api-plugin-u-manager) | 场景加载、语义楼层、语义井道、楼层设备、拓扑、动画、属性、视点管理 |
56
56
  | [curve-movement](./api-plugin-curve-movement) | 沿样条曲线移动相机或对象 |
57
57
  | [tracking-controls](./api-plugin-tracking-controls) | 相机跟随移动目标 |
58
58
  | [atmosphere](./api-plugin-atmosphere) | 天空背景、天空环境、太阳/月亮光照与阴影 |
package/docs/mcp.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # u-space MCP
2
2
 
3
- `u-space-mcp` 是面向 `u-space` 文档的 Model Context Protocol(MCP)服务器。它把当前文档打包成只读 MCP 工具,方便 Mastra、Claude Desktop、Cursor 等 MCP 客户端在回答 `u-space` API、插件和示例问题时直接检索官方文档,包括 `u-manager` 的 `SemanticLoader`、`BuildingGroup`、`FloorMesh` 语义楼层 API、电梯井/通风井语义体块,以及 atmosphere 插件的 `skyBackground()`、`skyEnvironment()` 和 RenderPipeline output effect 配置。
3
+ `u-space-mcp` 是面向 `u-space` 文档的 Model Context Protocol(MCP)服务器。它把当前文档打包成只读 MCP 工具,方便 Mastra、Claude Desktop、Cursor 等 MCP 客户端在回答 `u-space` API、插件和示例问题时直接检索官方文档,包括 `u-manager` 的 `SemanticLoader`、`BuildingGroup`、`FloorMesh` 语义楼层 API、楼层 `Facilities` 设备检索、电梯井/通风井语义体块,以及 atmosphere 插件的 `skyBackground()`、`skyEnvironment()` 和 RenderPipeline output effect 配置。
4
4
 
5
5
  ## 安装与启动
6
6
 
@@ -86,7 +86,7 @@ export const codingAgent = new Agent({
86
86
 
87
87
  ## 包结构
88
88
 
89
- 源码位于 `packages/u-space-mcp`。根目录只保留一个 MCP 发布入口;执行时会先从 `docs/*.md` 生成内置文档索引,编译 MCP 包,然后发布到 npm:
89
+ 源码位于 `packages/u-space-mcp`。根目录只保留一个 MCP 发布入口;执行时会先递增 `u-space-mcp` 的 patch 版本,再从 `docs/*.md` 生成内置文档索引,编译 MCP 包,然后发布到 npm:
90
90
 
91
91
  ```bash
92
92
  pnpm publish:mcp
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "u-space",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "type": "module",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "module": "dist/index.js",
@@ -29,7 +29,7 @@
29
29
  "docs:build": "vitepress build docs",
30
30
  "docs:preview": "vitepress preview docs",
31
31
  "docs:deploy": "pnpm docs:build && vercel --prod",
32
- "publish:mcp": "pnpm --filter u-space-mcp build && npm publish ./packages/u-space-mcp --access public --ignore-scripts",
32
+ "publish:mcp": "npm --prefix ./packages/u-space-mcp version patch --no-git-tag-version && pnpm --filter u-space-mcp build && npm publish ./packages/u-space-mcp --access public --ignore-scripts",
33
33
  "release": "npm version patch && pnpm build && npm publish --access=public"
34
34
  },
35
35
  "files": [