@pascal-app/mcp 1.0.0-beta.6 → 1.0.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/LICENSE +21 -0
- package/dist/bridge/scene-bridge.d.ts.map +1 -1
- package/dist/bridge/scene-bridge.js +2 -2
- package/dist/server.d.ts +11 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +52 -0
- package/dist/tools/annotations.d.ts +28 -0
- package/dist/tools/annotations.d.ts.map +1 -0
- package/dist/tools/annotations.js +27 -0
- package/dist/tools/apply-patch.d.ts +7 -0
- package/dist/tools/apply-patch.d.ts.map +1 -1
- package/dist/tools/apply-patch.js +6 -2
- package/dist/tools/check-collisions.d.ts +59 -0
- package/dist/tools/check-collisions.d.ts.map +1 -1
- package/dist/tools/check-collisions.js +240 -19
- package/dist/tools/construction-tools.d.ts +23 -1
- package/dist/tools/construction-tools.d.ts.map +1 -1
- package/dist/tools/construction-tools.js +34 -8
- package/dist/tools/create-level.d.ts +7 -0
- package/dist/tools/create-level.d.ts.map +1 -1
- package/dist/tools/create-level.js +6 -3
- package/dist/tools/create-wall.d.ts +7 -0
- package/dist/tools/create-wall.d.ts.map +1 -1
- package/dist/tools/create-wall.js +6 -3
- package/dist/tools/cut-opening.d.ts +7 -0
- package/dist/tools/cut-opening.d.ts.map +1 -1
- package/dist/tools/cut-opening.js +6 -3
- package/dist/tools/delete-node.d.ts +7 -0
- package/dist/tools/delete-node.d.ts.map +1 -1
- package/dist/tools/delete-node.js +6 -3
- package/dist/tools/describe-node.d.ts.map +1 -1
- package/dist/tools/describe-node.js +2 -0
- package/dist/tools/door-clearance.d.ts +18 -2
- package/dist/tools/door-clearance.d.ts.map +1 -1
- package/dist/tools/door-clearance.js +101 -7
- package/dist/tools/duplicate-level.d.ts +7 -0
- package/dist/tools/duplicate-level.d.ts.map +1 -1
- package/dist/tools/duplicate-level.js +6 -2
- package/dist/tools/export-glb.d.ts.map +1 -1
- package/dist/tools/export-glb.js +4 -2
- package/dist/tools/export-json.d.ts.map +1 -1
- package/dist/tools/export-json.js +2 -0
- package/dist/tools/find-nodes.d.ts.map +1 -1
- package/dist/tools/find-nodes.js +2 -0
- package/dist/tools/get-node.d.ts.map +1 -1
- package/dist/tools/get-node.js +2 -0
- package/dist/tools/get-scene.d.ts.map +1 -1
- package/dist/tools/get-scene.js +2 -0
- package/dist/tools/layout-clearance.d.ts +2 -0
- package/dist/tools/layout-clearance.d.ts.map +1 -1
- package/dist/tools/layout-clearance.js +5 -1
- package/dist/tools/live-sync.d.ts +33 -3
- package/dist/tools/live-sync.d.ts.map +1 -1
- package/dist/tools/live-sync.js +36 -4
- package/dist/tools/measure.d.ts +1 -0
- package/dist/tools/measure.d.ts.map +1 -1
- package/dist/tools/measure.js +4 -0
- package/dist/tools/photo-to-scene/photo-to-scene.d.ts.map +1 -1
- package/dist/tools/photo-to-scene/photo-to-scene.js +2 -0
- package/dist/tools/place-item.d.ts +7 -0
- package/dist/tools/place-item.d.ts.map +1 -1
- package/dist/tools/place-item.js +6 -2
- package/dist/tools/redo.d.ts +7 -0
- package/dist/tools/redo.d.ts.map +1 -1
- package/dist/tools/redo.js +6 -4
- package/dist/tools/room-tools.d.ts +28 -0
- package/dist/tools/room-tools.d.ts.map +1 -1
- package/dist/tools/room-tools.js +20 -5
- package/dist/tools/scene-lifecycle/create-project.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/create-project.js +2 -0
- package/dist/tools/scene-lifecycle/delete-scene.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/delete-scene.js +2 -0
- package/dist/tools/scene-lifecycle/get-project-status.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/get-project-status.js +2 -0
- package/dist/tools/scene-lifecycle/list-scenes.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/list-scenes.js +2 -0
- package/dist/tools/scene-lifecycle/load-scene.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/load-scene.js +2 -0
- package/dist/tools/scene-lifecycle/rename-scene.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/rename-scene.js +2 -0
- package/dist/tools/scene-lifecycle/save-scene.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/save-scene.js +2 -0
- package/dist/tools/scene-lifecycle/test-utils.d.ts +5 -1
- package/dist/tools/scene-lifecycle/test-utils.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/test-utils.js +24 -0
- package/dist/tools/scene-query.d.ts.map +1 -1
- package/dist/tools/scene-query.js +6 -0
- package/dist/tools/set-zone.d.ts +7 -0
- package/dist/tools/set-zone.d.ts.map +1 -1
- package/dist/tools/set-zone.js +6 -3
- package/dist/tools/templates/create-from-template.d.ts.map +1 -1
- package/dist/tools/templates/create-from-template.js +2 -0
- package/dist/tools/templates/create-house-from-brief.d.ts.map +1 -1
- package/dist/tools/templates/create-house-from-brief.js +2 -0
- package/dist/tools/templates/list-templates.d.ts.map +1 -1
- package/dist/tools/templates/list-templates.js +2 -0
- package/dist/tools/undo.d.ts +7 -0
- package/dist/tools/undo.d.ts.map +1 -1
- package/dist/tools/undo.js +6 -4
- package/dist/tools/validate-scene.d.ts.map +1 -1
- package/dist/tools/validate-scene.js +2 -0
- package/dist/tools/variants/generate-variants.d.ts.map +1 -1
- package/dist/tools/variants/generate-variants.js +2 -0
- package/dist/tools/vision/analyze-floorplan-image.d.ts.map +1 -1
- package/dist/tools/vision/analyze-floorplan-image.js +2 -0
- package/dist/tools/vision/analyze-room-photo.d.ts.map +1 -1
- package/dist/tools/vision/analyze-room-photo.js +2 -0
- package/package.json +5 -5
|
@@ -5,6 +5,13 @@ export declare const duplicateLevelInput: {
|
|
|
5
5
|
levelId: z.ZodString;
|
|
6
6
|
};
|
|
7
7
|
export declare const duplicateLevelOutput: {
|
|
8
|
+
persistence: z.ZodOptional<z.ZodObject<{
|
|
9
|
+
status: z.ZodEnum<{
|
|
10
|
+
unbound: "unbound";
|
|
11
|
+
events_unsupported: "events_unsupported";
|
|
12
|
+
}>;
|
|
13
|
+
warning: z.ZodString;
|
|
14
|
+
}, z.core.$strip>>;
|
|
8
15
|
newLevelId: z.ZodString;
|
|
9
16
|
newNodeIds: z.ZodArray<z.ZodString>;
|
|
10
17
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"duplicate-level.d.ts","sourceRoot":"","sources":["../../src/tools/duplicate-level.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAGxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"duplicate-level.d.ts","sourceRoot":"","sources":["../../src/tools/duplicate-level.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAGxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAMpD,eAAO,MAAM,mBAAmB;;CAE/B,CAAA;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;CAIhC,CAAA;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAwDvF"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { cloneLevelSubtree } from '@pascal-app/core/clone-scene-graph';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import { ADDITIVE_TOOL_ANNOTATIONS } from './annotations';
|
|
3
4
|
import { ErrorCode, throwMcpError } from './errors';
|
|
4
|
-
import { publishLiveSceneSnapshot } from './live-sync';
|
|
5
|
+
import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync';
|
|
5
6
|
import { NodeIdSchema } from './schemas';
|
|
6
7
|
export const duplicateLevelInput = {
|
|
7
8
|
levelId: NodeIdSchema,
|
|
@@ -9,6 +10,7 @@ export const duplicateLevelInput = {
|
|
|
9
10
|
export const duplicateLevelOutput = {
|
|
10
11
|
newLevelId: z.string(),
|
|
11
12
|
newNodeIds: z.array(z.string()),
|
|
13
|
+
...liveSyncOutput,
|
|
12
14
|
};
|
|
13
15
|
export function registerDuplicateLevel(server, bridge) {
|
|
14
16
|
server.registerTool('duplicate_level', {
|
|
@@ -16,6 +18,7 @@ export function registerDuplicateLevel(server, bridge) {
|
|
|
16
18
|
description: 'Clone a level and all its descendants into a new subtree attached to the same building.',
|
|
17
19
|
inputSchema: duplicateLevelInput,
|
|
18
20
|
outputSchema: duplicateLevelOutput,
|
|
21
|
+
annotations: ADDITIVE_TOOL_ANNOTATIONS,
|
|
19
22
|
}, async ({ levelId }) => {
|
|
20
23
|
const node = bridge.getNode(levelId);
|
|
21
24
|
if (!node) {
|
|
@@ -43,10 +46,11 @@ export function registerDuplicateLevel(server, bridge) {
|
|
|
43
46
|
return createOp;
|
|
44
47
|
});
|
|
45
48
|
const result = bridge.applyPatch(patches);
|
|
46
|
-
await publishLiveSceneSnapshot(bridge, 'duplicate_level');
|
|
49
|
+
const persistence = await publishLiveSceneSnapshot(bridge, 'duplicate_level');
|
|
47
50
|
const payload = {
|
|
48
51
|
newLevelId: newLevelId,
|
|
49
52
|
newNodeIds: result.createdIds,
|
|
53
|
+
...persistencePayload(persistence),
|
|
50
54
|
};
|
|
51
55
|
return {
|
|
52
56
|
content: [{ type: 'text', text: JSON.stringify(payload) }],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export-glb.d.ts","sourceRoot":"","sources":["../../src/tools/export-glb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"export-glb.d.ts","sourceRoot":"","sources":["../../src/tools/export-glb.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAGpD,eAAO,MAAM,cAAc,IAAK,CAAA;AAEhC,eAAO,MAAM,eAAe;;;CAG3B,CAAA;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI,CAuBnF"}
|
package/dist/tools/export-glb.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { READ_ONLY_TOOL_ANNOTATIONS } from './annotations';
|
|
2
3
|
export const exportGlbInput = {};
|
|
3
4
|
export const exportGlbOutput = {
|
|
4
5
|
status: z.literal('not_implemented'),
|
|
@@ -7,9 +8,10 @@ export const exportGlbOutput = {
|
|
|
7
8
|
export function registerExportGlb(server, _bridge) {
|
|
8
9
|
server.registerTool('export_glb', {
|
|
9
10
|
title: 'Export GLB',
|
|
10
|
-
description: 'GLB export is not available in headless mode — it requires the Three.js renderer, which is browser-only. Returns a structured `not_implemented`
|
|
11
|
+
description: 'GLB export is not available in headless mode — it requires the Three.js renderer, which is browser-only. Returns a structured `not_implemented` tool error.',
|
|
11
12
|
inputSchema: exportGlbInput,
|
|
12
13
|
outputSchema: exportGlbOutput,
|
|
14
|
+
annotations: READ_ONLY_TOOL_ANNOTATIONS,
|
|
13
15
|
}, async () => {
|
|
14
16
|
const payload = {
|
|
15
17
|
status: 'not_implemented',
|
|
@@ -18,7 +20,7 @@ export function registerExportGlb(server, _bridge) {
|
|
|
18
20
|
return {
|
|
19
21
|
content: [{ type: 'text', text: JSON.stringify(payload) }],
|
|
20
22
|
structuredContent: payload,
|
|
21
|
-
isError:
|
|
23
|
+
isError: true,
|
|
22
24
|
};
|
|
23
25
|
});
|
|
24
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export-json.d.ts","sourceRoot":"","sources":["../../src/tools/export-json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"export-json.d.ts","sourceRoot":"","sources":["../../src/tools/export-json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAGpD,eAAO,MAAM,eAAe;;CAE3B,CAAA;AAED,eAAO,MAAM,gBAAgB;;CAE5B,CAAA;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAqBnF"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { READ_ONLY_TOOL_ANNOTATIONS } from './annotations';
|
|
2
3
|
export const exportJsonInput = {
|
|
3
4
|
pretty: z.boolean().optional(),
|
|
4
5
|
};
|
|
@@ -11,6 +12,7 @@ export function registerExportJson(server, bridge) {
|
|
|
11
12
|
description: 'Return the scene as a serialized JSON string. Pass `pretty: true` to indent with 2 spaces.',
|
|
12
13
|
inputSchema: exportJsonInput,
|
|
13
14
|
outputSchema: exportJsonOutput,
|
|
15
|
+
annotations: READ_ONLY_TOOL_ANNOTATIONS,
|
|
14
16
|
}, async ({ pretty }) => {
|
|
15
17
|
const scene = bridge.exportJSON();
|
|
16
18
|
const json = JSON.stringify(scene, null, pretty ? 2 : 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-nodes.d.ts","sourceRoot":"","sources":["../../src/tools/find-nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAGxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"find-nodes.d.ts","sourceRoot":"","sources":["../../src/tools/find-nodes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAGxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAwBpD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;CAK1B,CAAA;AAED,eAAO,MAAM,eAAe;;CAE3B,CAAA;AAkCD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAwDlF"}
|
package/dist/tools/find-nodes.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { pointInPolygon } from '@pascal-app/core/spatial-grid';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import { READ_ONLY_TOOL_ANNOTATIONS } from './annotations';
|
|
3
4
|
import { NodeIdSchema } from './schemas';
|
|
4
5
|
const ALL_NODE_TYPES = [
|
|
5
6
|
'site',
|
|
@@ -65,6 +66,7 @@ export function registerFindNodes(server, bridge) {
|
|
|
65
66
|
description: 'Find nodes matching any combination of type, parentId, levelId, or zoneId filters.',
|
|
66
67
|
inputSchema: findNodesInput,
|
|
67
68
|
outputSchema: findNodesOutput,
|
|
69
|
+
annotations: READ_ONLY_TOOL_ANNOTATIONS,
|
|
68
70
|
}, async (args) => {
|
|
69
71
|
const { type, parentId, levelId, zoneId } = args;
|
|
70
72
|
// Delegate type/parent/level filtering to the bridge.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-node.d.ts","sourceRoot":"","sources":["../../src/tools/get-node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"get-node.d.ts","sourceRoot":"","sources":["../../src/tools/get-node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAKpD,eAAO,MAAM,YAAY;;CAExB,CAAA;AAED,eAAO,MAAM,aAAa;;CAEzB,CAAA;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAsBhF"}
|
package/dist/tools/get-node.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { READ_ONLY_TOOL_ANNOTATIONS } from './annotations';
|
|
2
3
|
import { ErrorCode, throwMcpError } from './errors';
|
|
3
4
|
import { NodeIdSchema } from './schemas';
|
|
4
5
|
export const getNodeInput = {
|
|
@@ -13,6 +14,7 @@ export function registerGetNode(server, bridge) {
|
|
|
13
14
|
description: 'Return the full node payload for the given ID.',
|
|
14
15
|
inputSchema: getNodeInput,
|
|
15
16
|
outputSchema: getNodeOutput,
|
|
17
|
+
annotations: READ_ONLY_TOOL_ANNOTATIONS,
|
|
16
18
|
}, async ({ id }) => {
|
|
17
19
|
const node = bridge.getNode(id);
|
|
18
20
|
if (!node) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-scene.d.ts","sourceRoot":"","sources":["../../src/tools/get-scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"get-scene.d.ts","sourceRoot":"","sources":["../../src/tools/get-scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAGpD,eAAO,MAAM,aAAa,IAAK,CAAA;AAE/B,eAAO,MAAM,cAAc;;;;CAI1B,CAAA;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAwBjF"}
|
package/dist/tools/get-scene.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { READ_ONLY_TOOL_ANNOTATIONS } from './annotations';
|
|
2
3
|
export const getSceneInput = {};
|
|
3
4
|
export const getSceneOutput = {
|
|
4
5
|
nodes: z.record(z.string(), z.unknown()),
|
|
@@ -11,6 +12,7 @@ export function registerGetScene(server, bridge) {
|
|
|
11
12
|
description: 'Returns the full scene graph: flat node dictionary, root node IDs, and collections.',
|
|
12
13
|
inputSchema: getSceneInput,
|
|
13
14
|
outputSchema: getSceneOutput,
|
|
15
|
+
annotations: READ_ONLY_TOOL_ANNOTATIONS,
|
|
14
16
|
}, async () => {
|
|
15
17
|
const scene = bridge.exportJSON();
|
|
16
18
|
const payload = {
|
|
@@ -25,6 +25,8 @@ export type ItemCollision = {
|
|
|
25
25
|
bName?: string;
|
|
26
26
|
levelId?: string | null;
|
|
27
27
|
kind: 'item-aabb';
|
|
28
|
+
violation: 'overlap' | 'clearance';
|
|
29
|
+
minimumClearanceMeters: number;
|
|
28
30
|
message: string;
|
|
29
31
|
};
|
|
30
32
|
export declare function nodeItemAabb(node: AnyNode): PlanAabb | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-clearance.d.ts","sourceRoot":"","sources":["../../src/tools/layout-clearance.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EAKL,KAAK,QAAQ,EAEd,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,KAAK,QAAQ,EACb,kBAAkB,GACnB,MAAM,kBAAkB,CAAA;AAEzB,+DAA+D;AAC/D,eAAO,MAAM,gBAAgB,OAAO,CAAA;AAEpC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,IAAI,EAAE,QAAQ,CAAA;CACf,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,IAAI,EAAE,WAAW,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,IAAI,CAE3D;AAED,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,EACxB,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM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A2BxE"}
|
|
@@ -71,7 +71,11 @@ export function findItemItemCollisions(args) {
|
|
|
71
71
|
bName: b.name,
|
|
72
72
|
levelId: a.levelId ?? b.levelId,
|
|
73
73
|
kind: 'item-aabb',
|
|
74
|
-
|
|
74
|
+
violation: aabbsOverlap(a.aabb, b.aabb, 0) ? 'overlap' : 'clearance',
|
|
75
|
+
minimumClearanceMeters: gap,
|
|
76
|
+
message: aabbsOverlap(a.aabb, b.aabb, 0)
|
|
77
|
+
? `Items overlap: ${a.name ?? a.id} (${a.id}) and ${b.name ?? b.id} (${b.id})`
|
|
78
|
+
: `Items are closer than ${gap} m: ${a.name ?? a.id} (${a.id}) and ${b.name ?? b.id} (${b.id})`,
|
|
75
79
|
});
|
|
76
80
|
}
|
|
77
81
|
}
|
|
@@ -1,11 +1,41 @@
|
|
|
1
1
|
import type { SceneGraph } from '@pascal-app/core/clone-scene-graph';
|
|
2
|
+
import { z } from 'zod';
|
|
2
3
|
import type { SceneOperations } from '../operations';
|
|
3
4
|
export declare function syncDerivedStairOpenings(operations: SceneOperations): number;
|
|
5
|
+
export type LiveSyncStatus = 'published' | 'unbound' | 'events_unsupported';
|
|
6
|
+
type LiveSyncSkip = Exclude<LiveSyncStatus, 'published'>;
|
|
7
|
+
/**
|
|
8
|
+
* Output-schema fragment for every tool that mutates the scene. Spread into
|
|
9
|
+
* the tool's `outputSchema` so `persistencePayload` fields survive the SDK's
|
|
10
|
+
* structured-content validation.
|
|
11
|
+
*/
|
|
12
|
+
export declare const liveSyncOutput: {
|
|
13
|
+
persistence: z.ZodOptional<z.ZodObject<{
|
|
14
|
+
status: z.ZodEnum<{
|
|
15
|
+
unbound: "unbound";
|
|
16
|
+
events_unsupported: "events_unsupported";
|
|
17
|
+
}>;
|
|
18
|
+
warning: z.ZodString;
|
|
19
|
+
}, z.core.$strip>>;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Payload fragment matching `liveSyncOutput`: empty after a successful
|
|
23
|
+
* publish, a `persistence` warning when the mutation stayed in-memory.
|
|
24
|
+
*/
|
|
25
|
+
export declare function persistencePayload(status: LiveSyncStatus): {
|
|
26
|
+
persistence?: {
|
|
27
|
+
status: LiveSyncSkip;
|
|
28
|
+
warning: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
4
31
|
/**
|
|
5
32
|
* Persist the bridge's current graph to the active scene and append a live
|
|
6
|
-
* event for browser subscribers.
|
|
7
|
-
* bound to a saved scene
|
|
33
|
+
* event for browser subscribers. Skips persistence — reporting why — when the
|
|
34
|
+
* MCP session is not currently bound to a saved scene or the store cannot
|
|
35
|
+
* append scene events; callers surface that through `persistencePayload` so
|
|
36
|
+
* the skip is never silent (#725).
|
|
8
37
|
*/
|
|
9
|
-
export declare function publishLiveSceneSnapshot(operations: SceneOperations, kind: string): Promise<
|
|
38
|
+
export declare function publishLiveSceneSnapshot(operations: SceneOperations, kind: string): Promise<LiveSyncStatus>;
|
|
10
39
|
export declare function appendLiveSceneEvent(operations: SceneOperations, sceneId: string, version: number, kind: string, graph: SceneGraph): Promise<void>;
|
|
40
|
+
export {};
|
|
11
41
|
//# sourceMappingURL=live-sync.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live-sync.d.ts","sourceRoot":"","sources":["../../src/tools/live-sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAA;AAEpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAIpD,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,eAAe,GAAG,MAAM,CAW5E;AAED;;;;GAIG;AACH,wBAAsB,wBAAwB,CAC5C,UAAU,EAAE,eAAe,EAC3B,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"live-sync.d.ts","sourceRoot":"","sources":["../../src/tools/live-sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAA;AAEpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAIpD,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,eAAe,GAAG,MAAM,CAW5E;AAED,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,SAAS,GAAG,oBAAoB,CAAA;AAE3E,KAAK,YAAY,GAAG,OAAO,CAAC,cAAc,EAAE,WAAW,CAAC,CAAA;AAExD;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;;;;;CAO1B,CAAA;AASD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,cAAc,GAAG;IAC1D,WAAW,CAAC,EAAE;QAAE,MAAM,EAAE,YAAY,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAA;CACxD,CAGA;AAED;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAC5C,UAAU,EAAE,eAAe,EAC3B,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,cAAc,CAAC,CAwCzB;AAED,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,eAAe,EAC3B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,UAAU,GAChB,OAAO,CAAC,IAAI,CAAC,CAGf"}
|
package/dist/tools/live-sync.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { syncAutoStairOpenings } from '@pascal-app/core/stair-openings';
|
|
2
|
+
import { z } from 'zod';
|
|
2
3
|
import { SceneVersionConflictError } from '../storage/types';
|
|
3
4
|
import { ErrorCode, throwMcpError } from './errors';
|
|
4
5
|
export function syncDerivedStairOpenings(operations) {
|
|
@@ -12,16 +13,46 @@ export function syncDerivedStairOpenings(operations) {
|
|
|
12
13
|
})));
|
|
13
14
|
return updates.length;
|
|
14
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Output-schema fragment for every tool that mutates the scene. Spread into
|
|
18
|
+
* the tool's `outputSchema` so `persistencePayload` fields survive the SDK's
|
|
19
|
+
* structured-content validation.
|
|
20
|
+
*/
|
|
21
|
+
export const liveSyncOutput = {
|
|
22
|
+
persistence: z
|
|
23
|
+
.object({
|
|
24
|
+
status: z.enum(['unbound', 'events_unsupported']),
|
|
25
|
+
warning: z.string(),
|
|
26
|
+
})
|
|
27
|
+
.optional(),
|
|
28
|
+
};
|
|
29
|
+
const LIVE_SYNC_WARNINGS = {
|
|
30
|
+
unbound: 'The change was applied to the in-memory session only: no active scene is bound, so nothing was persisted and no live event reached subscribers. Bind a scene with save_scene or load_scene to persist changes.',
|
|
31
|
+
events_unsupported: 'The change was applied to the in-memory session only: the attached scene store does not support live scene events, so nothing was persisted.',
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Payload fragment matching `liveSyncOutput`: empty after a successful
|
|
35
|
+
* publish, a `persistence` warning when the mutation stayed in-memory.
|
|
36
|
+
*/
|
|
37
|
+
export function persistencePayload(status) {
|
|
38
|
+
if (status === 'published')
|
|
39
|
+
return {};
|
|
40
|
+
return { persistence: { status, warning: LIVE_SYNC_WARNINGS[status] } };
|
|
41
|
+
}
|
|
15
42
|
/**
|
|
16
43
|
* Persist the bridge's current graph to the active scene and append a live
|
|
17
|
-
* event for browser subscribers.
|
|
18
|
-
* bound to a saved scene
|
|
44
|
+
* event for browser subscribers. Skips persistence — reporting why — when the
|
|
45
|
+
* MCP session is not currently bound to a saved scene or the store cannot
|
|
46
|
+
* append scene events; callers surface that through `persistencePayload` so
|
|
47
|
+
* the skip is never silent (#725).
|
|
19
48
|
*/
|
|
20
49
|
export async function publishLiveSceneSnapshot(operations, kind) {
|
|
21
50
|
syncDerivedStairOpenings(operations);
|
|
22
51
|
const active = operations.getActiveScene();
|
|
23
|
-
if (!
|
|
24
|
-
return;
|
|
52
|
+
if (!active)
|
|
53
|
+
return 'unbound';
|
|
54
|
+
if (!operations.canAppendSceneEvents)
|
|
55
|
+
return 'events_unsupported';
|
|
25
56
|
const graph = operations.exportSceneGraph();
|
|
26
57
|
try {
|
|
27
58
|
const meta = await operations.saveScene({
|
|
@@ -54,6 +85,7 @@ export async function publishLiveSceneSnapshot(operations, kind) {
|
|
|
54
85
|
const message = error instanceof Error ? error.message : String(error);
|
|
55
86
|
throwMcpError(ErrorCode.InternalError, `live_sync_failed: ${message}`);
|
|
56
87
|
}
|
|
88
|
+
return 'published';
|
|
57
89
|
}
|
|
58
90
|
export async function appendLiveSceneEvent(operations, sceneId, version, kind, graph) {
|
|
59
91
|
if (!operations.canAppendSceneEvents)
|
package/dist/tools/measure.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare const measureOutput: {
|
|
|
9
9
|
distanceMeters: z.ZodNumber;
|
|
10
10
|
areaSqMeters: z.ZodOptional<z.ZodNumber>;
|
|
11
11
|
units: z.ZodLiteral<"meters">;
|
|
12
|
+
areaUnits: z.ZodOptional<z.ZodLiteral<"square_meters">>;
|
|
12
13
|
};
|
|
13
14
|
export declare function registerMeasure(server: McpServer, bridge: SceneOperations): void;
|
|
14
15
|
//# sourceMappingURL=measure.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"measure.d.ts","sourceRoot":"","sources":["../../src/tools/measure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"measure.d.ts","sourceRoot":"","sources":["../../src/tools/measure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAKpD,eAAO,MAAM,YAAY;;;CAGxB,CAAA;AAED,eAAO,MAAM,aAAa;;;;;CAKzB,CAAA;AAsED,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAyEhF"}
|
package/dist/tools/measure.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { READ_ONLY_TOOL_ANNOTATIONS } from './annotations';
|
|
2
3
|
import { ErrorCode, throwMcpError } from './errors';
|
|
3
4
|
import { NodeIdSchema } from './schemas';
|
|
4
5
|
export const measureInput = {
|
|
@@ -9,6 +10,7 @@ export const measureOutput = {
|
|
|
9
10
|
distanceMeters: z.number(),
|
|
10
11
|
areaSqMeters: z.number().optional(),
|
|
11
12
|
units: z.literal('meters'),
|
|
13
|
+
areaUnits: z.literal('square_meters').optional(),
|
|
12
14
|
};
|
|
13
15
|
/**
|
|
14
16
|
* Compute a 3D centre point in level-coordinate space for distance measurement.
|
|
@@ -85,6 +87,7 @@ export function registerMeasure(server, bridge) {
|
|
|
85
87
|
description: 'Measure distance (in meters) between two nodes, or the net area of a polygon node when fromId === toId.',
|
|
86
88
|
inputSchema: measureInput,
|
|
87
89
|
outputSchema: measureOutput,
|
|
90
|
+
annotations: READ_ONLY_TOOL_ANNOTATIONS,
|
|
88
91
|
}, async ({ fromId, toId }) => {
|
|
89
92
|
const from = bridge.getNode(fromId);
|
|
90
93
|
if (!from) {
|
|
@@ -107,6 +110,7 @@ export function registerMeasure(server, bridge) {
|
|
|
107
110
|
distanceMeters: 0,
|
|
108
111
|
areaSqMeters: area,
|
|
109
112
|
units: 'meters',
|
|
113
|
+
areaUnits: 'square_meters',
|
|
110
114
|
};
|
|
111
115
|
return {
|
|
112
116
|
content: [{ type: 'text', text: JSON.stringify(payload) }],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"photo-to-scene.d.ts","sourceRoot":"","sources":["../../../src/tools/photo-to-scene/photo-to-scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAYxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"photo-to-scene.d.ts","sourceRoot":"","sources":["../../../src/tools/photo-to-scene/photo-to-scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAYxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAKvD;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;CAa7B,CAAA;AAED,eAAO,MAAM,kBAAkB;;;;;;;;CAQ9B,CAAA;AAmTD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CA8ErF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ErrorCode, McpError } from '@modelcontextprotocol/sdk/types.js';
|
|
2
2
|
import { AnyNode, BuildingNode, LevelNode, SiteNode, WallNode, ZoneNode, } from '@pascal-app/core/schema';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
+
import { DESTRUCTIVE_OPEN_WORLD_TOOL_ANNOTATIONS } from '../annotations';
|
|
4
5
|
import { appendLiveSceneEvent } from '../live-sync';
|
|
5
6
|
import { measurement } from '../measurement';
|
|
6
7
|
/**
|
|
@@ -280,6 +281,7 @@ export function registerPhotoToScene(server, bridge) {
|
|
|
280
281
|
description: 'Orchestrator: analyse a floor-plan photo via MCP sampling, translate the structured vision result into a Pascal SceneGraph (site → building → level with walls and zones), optionally save it, and swap the bridge to the new scene. Requires host support for sampling.',
|
|
281
282
|
inputSchema: photoToSceneInput,
|
|
282
283
|
outputSchema: photoToSceneOutput,
|
|
284
|
+
annotations: DESTRUCTIVE_OPEN_WORLD_TOOL_ANNOTATIONS,
|
|
283
285
|
}, async ({ image, scaleHint, name, save, defaultWallThickness, defaultWallHeight }) => {
|
|
284
286
|
// 1. Vision.
|
|
285
287
|
const vision = await callVisionSampling(server, image, scaleHint);
|
|
@@ -8,6 +8,13 @@ export declare const placeItemInput: {
|
|
|
8
8
|
rotation: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
|
|
9
9
|
};
|
|
10
10
|
export declare const placeItemOutput: {
|
|
11
|
+
persistence: z.ZodOptional<z.ZodObject<{
|
|
12
|
+
status: z.ZodEnum<{
|
|
13
|
+
unbound: "unbound";
|
|
14
|
+
events_unsupported: "events_unsupported";
|
|
15
|
+
}>;
|
|
16
|
+
warning: z.ZodString;
|
|
17
|
+
}, z.core.$strip>>;
|
|
11
18
|
itemId: z.ZodString;
|
|
12
19
|
status: z.ZodOptional<z.ZodString>;
|
|
13
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"place-item.d.ts","sourceRoot":"","sources":["../../src/tools/place-item.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAGxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"place-item.d.ts","sourceRoot":"","sources":["../../src/tools/place-item.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAGxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AASpD,eAAO,MAAM,cAAc;;;;;CAK1B,CAAA;AAED,eAAO,MAAM,eAAe;;;;;;;;;;CAI3B,CAAA;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAwFlF"}
|
package/dist/tools/place-item.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ItemNode } from '@pascal-app/core/schema';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import { ADDITIVE_TOOL_ANNOTATIONS } from './annotations';
|
|
3
4
|
import { findCatalogItem } from './asset-catalog';
|
|
4
5
|
import { ErrorCode, throwMcpError } from './errors';
|
|
5
6
|
import { projectWorldPointToWallLocalX, wallLength } from './geometry';
|
|
6
|
-
import { publishLiveSceneSnapshot } from './live-sync';
|
|
7
|
+
import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync';
|
|
7
8
|
import { measurement } from './measurement';
|
|
8
9
|
import { NodeIdSchema, Vec3Schema } from './schemas';
|
|
9
10
|
export const placeItemInput = {
|
|
@@ -15,6 +16,7 @@ export const placeItemInput = {
|
|
|
15
16
|
export const placeItemOutput = {
|
|
16
17
|
itemId: z.string(),
|
|
17
18
|
status: z.string().optional(),
|
|
19
|
+
...liveSyncOutput,
|
|
18
20
|
};
|
|
19
21
|
export function registerPlaceItem(server, bridge) {
|
|
20
22
|
server.registerTool('place_item', {
|
|
@@ -22,6 +24,7 @@ export function registerPlaceItem(server, bridge) {
|
|
|
22
24
|
description: 'Place a catalog item into the scene. Target a level/slab/zone for floor items, a wall for wall-attached items, or a ceiling for ceiling-attached items. Do not target the site node directly.',
|
|
23
25
|
inputSchema: placeItemInput,
|
|
24
26
|
outputSchema: placeItemOutput,
|
|
27
|
+
annotations: ADDITIVE_TOOL_ANNOTATIONS,
|
|
25
28
|
}, async ({ catalogItemId, targetNodeId, position, rotation }) => {
|
|
26
29
|
const target = bridge.getNode(targetNodeId);
|
|
27
30
|
if (!target) {
|
|
@@ -72,10 +75,11 @@ export function registerPlaceItem(server, bridge) {
|
|
|
72
75
|
...wallExtras,
|
|
73
76
|
});
|
|
74
77
|
const id = bridge.createNode(item, parentId);
|
|
75
|
-
await publishLiveSceneSnapshot(bridge, 'place_item');
|
|
78
|
+
const persistence = await publishLiveSceneSnapshot(bridge, 'place_item');
|
|
76
79
|
const payload = {
|
|
77
80
|
itemId: id,
|
|
78
81
|
status: catalogAsset ? 'ok' : 'catalog_unavailable',
|
|
82
|
+
...persistencePayload(persistence),
|
|
79
83
|
};
|
|
80
84
|
return {
|
|
81
85
|
content: [{ type: 'text', text: JSON.stringify(payload) }],
|
package/dist/tools/redo.d.ts
CHANGED
|
@@ -5,6 +5,13 @@ export declare const redoInput: {
|
|
|
5
5
|
steps: z.ZodOptional<z.ZodNumber>;
|
|
6
6
|
};
|
|
7
7
|
export declare const redoOutput: {
|
|
8
|
+
persistence: z.ZodOptional<z.ZodObject<{
|
|
9
|
+
status: z.ZodEnum<{
|
|
10
|
+
unbound: "unbound";
|
|
11
|
+
events_unsupported: "events_unsupported";
|
|
12
|
+
}>;
|
|
13
|
+
warning: z.ZodString;
|
|
14
|
+
}, z.core.$strip>>;
|
|
8
15
|
redone: z.ZodNumber;
|
|
9
16
|
};
|
|
10
17
|
export declare function registerRedo(server: McpServer, bridge: SceneOperations): void;
|
package/dist/tools/redo.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redo.d.ts","sourceRoot":"","sources":["../../src/tools/redo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"redo.d.ts","sourceRoot":"","sources":["../../src/tools/redo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAIpD,eAAO,MAAM,SAAS;;CAErB,CAAA;AAED,eAAO,MAAM,UAAU;;;;;;;;;CAGtB,CAAA;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAsB7E"}
|
package/dist/tools/redo.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from './annotations';
|
|
3
|
+
import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync';
|
|
3
4
|
export const redoInput = {
|
|
4
5
|
steps: z.number().int().positive().optional(),
|
|
5
6
|
};
|
|
6
7
|
export const redoOutput = {
|
|
7
8
|
redone: z.number(),
|
|
9
|
+
...liveSyncOutput,
|
|
8
10
|
};
|
|
9
11
|
export function registerRedo(server, bridge) {
|
|
10
12
|
server.registerTool('redo', {
|
|
@@ -12,11 +14,11 @@ export function registerRedo(server, bridge) {
|
|
|
12
14
|
description: 'Redo the next N previously-undone steps (default 1). Returns the number of steps actually redone.',
|
|
13
15
|
inputSchema: redoInput,
|
|
14
16
|
outputSchema: redoOutput,
|
|
17
|
+
annotations: DESTRUCTIVE_TOOL_ANNOTATIONS,
|
|
15
18
|
}, async ({ steps }) => {
|
|
16
19
|
const redone = bridge.redo(steps ?? 1);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const payload = { redone };
|
|
20
|
+
const persistence = redone > 0 ? await publishLiveSceneSnapshot(bridge, 'redo') : 'published';
|
|
21
|
+
const payload = { redone, ...persistencePayload(persistence) };
|
|
20
22
|
return {
|
|
21
23
|
content: [{ type: 'text', text: JSON.stringify(payload) }],
|
|
22
24
|
structuredContent: payload,
|
|
@@ -18,6 +18,13 @@ export declare const createRoomInput: {
|
|
|
18
18
|
wallThickness: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
|
|
19
19
|
};
|
|
20
20
|
export declare const createRoomOutput: {
|
|
21
|
+
persistence: z.ZodOptional<z.ZodObject<{
|
|
22
|
+
status: z.ZodEnum<{
|
|
23
|
+
unbound: "unbound";
|
|
24
|
+
events_unsupported: "events_unsupported";
|
|
25
|
+
}>;
|
|
26
|
+
warning: z.ZodString;
|
|
27
|
+
}, z.core.$strip>>;
|
|
21
28
|
zoneId: z.ZodString;
|
|
22
29
|
slabId: z.ZodString;
|
|
23
30
|
ceilingId: z.ZodString;
|
|
@@ -40,6 +47,13 @@ export declare const addDoorInput: {
|
|
|
40
47
|
}>>;
|
|
41
48
|
};
|
|
42
49
|
export declare const addDoorOutput: {
|
|
50
|
+
persistence: z.ZodOptional<z.ZodObject<{
|
|
51
|
+
status: z.ZodEnum<{
|
|
52
|
+
unbound: "unbound";
|
|
53
|
+
events_unsupported: "events_unsupported";
|
|
54
|
+
}>;
|
|
55
|
+
warning: z.ZodString;
|
|
56
|
+
}, z.core.$strip>>;
|
|
43
57
|
doorId: z.ZodString;
|
|
44
58
|
localX: z.ZodNumber;
|
|
45
59
|
t: z.ZodNumber;
|
|
@@ -57,6 +71,13 @@ export declare const addWindowInput: {
|
|
|
57
71
|
sillHeight: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
|
|
58
72
|
};
|
|
59
73
|
export declare const addWindowOutput: {
|
|
74
|
+
persistence: z.ZodOptional<z.ZodObject<{
|
|
75
|
+
status: z.ZodEnum<{
|
|
76
|
+
unbound: "unbound";
|
|
77
|
+
events_unsupported: "events_unsupported";
|
|
78
|
+
}>;
|
|
79
|
+
warning: z.ZodString;
|
|
80
|
+
}, z.core.$strip>>;
|
|
60
81
|
windowId: z.ZodString;
|
|
61
82
|
localX: z.ZodNumber;
|
|
62
83
|
t: z.ZodNumber;
|
|
@@ -84,6 +105,13 @@ export declare const furnishRoomInput: {
|
|
|
84
105
|
doorWallIndex: z.ZodOptional<z.ZodNumber>;
|
|
85
106
|
};
|
|
86
107
|
export declare const furnishRoomOutput: {
|
|
108
|
+
persistence: z.ZodOptional<z.ZodObject<{
|
|
109
|
+
status: z.ZodEnum<{
|
|
110
|
+
unbound: "unbound";
|
|
111
|
+
events_unsupported: "events_unsupported";
|
|
112
|
+
}>;
|
|
113
|
+
warning: z.ZodString;
|
|
114
|
+
}, z.core.$strip>>;
|
|
87
115
|
placed: z.ZodNumber;
|
|
88
116
|
itemIds: z.ZodArray<z.ZodString>;
|
|
89
117
|
skipped: z.ZodArray<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"room-tools.d.ts","sourceRoot":"","sources":["../../src/tools/room-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAWxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"room-tools.d.ts","sourceRoot":"","sources":["../../src/tools/room-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAWxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAkCpD,eAAO,MAAM,iBAAiB;;;CAG7B,CAAA;AAED,eAAO,MAAM,kBAAkB;;;CAG9B,CAAA;AAED,eAAO,MAAM,eAAe;;;;;;;CAa3B,CAAA;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;CAO5B,CAAA;AAED,eAAO,MAAM,YAAY;;;;;;;;;;;;;;CAQxB,CAAA;AAED,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;CASzB,CAAA;AAED,eAAO,MAAM,cAA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