@pascal-app/mcp 1.0.0-beta.6 → 1.0.1
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/CHANGELOG.md +11 -0
- package/LICENSE +21 -0
- package/README.md +1 -1
- package/dist/bin/pascal-mcp.d.ts +1 -1
- package/dist/bin/pascal-mcp.js +7 -7
- package/dist/bridge/index.d.ts +2 -2
- package/dist/bridge/index.js +1 -1
- package/dist/bridge/scene-bridge.d.ts +2 -2
- package/dist/bridge/scene-bridge.d.ts.map +1 -1
- package/dist/bridge/scene-bridge.js +3 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/operations/index.d.ts +1 -1
- package/dist/operations/index.js +1 -1
- package/dist/operations/scene-operations.d.ts +2 -2
- package/dist/prompts/from-brief.d.ts +1 -1
- package/dist/prompts/from-brief.d.ts.map +1 -1
- package/dist/prompts/from-brief.js +2 -1
- package/dist/prompts/index.d.ts +1 -1
- package/dist/prompts/index.js +3 -3
- package/dist/prompts/iterate-on-feedback.d.ts +1 -1
- package/dist/prompts/iterate-on-feedback.js +1 -1
- package/dist/prompts/renovation-from-photos.d.ts +1 -1
- package/dist/resources/agent-guide.d.ts +1 -1
- package/dist/resources/agent-guide.d.ts.map +1 -1
- package/dist/resources/agent-guide.js +1 -0
- package/dist/resources/catalog-items.d.ts +1 -1
- package/dist/resources/catalog-items.js +1 -1
- package/dist/resources/constraints.d.ts +1 -1
- package/dist/resources/index.d.ts +1 -1
- package/dist/resources/index.js +5 -5
- package/dist/resources/scene-current.d.ts +1 -1
- package/dist/resources/scene-summary.d.ts +1 -1
- package/dist/server.d.ts +14 -3
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +60 -6
- package/dist/storage/index.d.ts +4 -4
- package/dist/storage/index.js +4 -4
- package/dist/storage/sqlite-scene-store.d.ts +1 -1
- package/dist/storage/sqlite-scene-store.js +3 -3
- package/dist/templates/index.js +3 -3
- 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 +8 -1
- package/dist/tools/apply-patch.d.ts.map +1 -1
- package/dist/tools/apply-patch.js +9 -5
- package/dist/tools/check-collisions.d.ts +60 -1
- package/dist/tools/check-collisions.d.ts.map +1 -1
- package/dist/tools/check-collisions.js +242 -21
- package/dist/tools/construction-tools.d.ts +24 -2
- package/dist/tools/construction-tools.d.ts.map +1 -1
- package/dist/tools/construction-tools.js +36 -10
- package/dist/tools/create-level.d.ts +8 -1
- package/dist/tools/create-level.d.ts.map +1 -1
- package/dist/tools/create-level.js +9 -6
- package/dist/tools/create-unit.d.ts +27 -0
- package/dist/tools/create-unit.d.ts.map +1 -0
- package/dist/tools/create-unit.js +36 -0
- package/dist/tools/create-wall.d.ts +8 -1
- package/dist/tools/create-wall.d.ts.map +1 -1
- package/dist/tools/create-wall.js +9 -6
- package/dist/tools/cut-opening.d.ts +8 -1
- package/dist/tools/cut-opening.d.ts.map +1 -1
- package/dist/tools/cut-opening.js +10 -7
- package/dist/tools/delete-node.d.ts +8 -1
- package/dist/tools/delete-node.d.ts.map +1 -1
- package/dist/tools/delete-node.js +8 -5
- package/dist/tools/describe-node.d.ts +1 -1
- package/dist/tools/describe-node.d.ts.map +1 -1
- package/dist/tools/describe-node.js +5 -3
- package/dist/tools/door-clearance.d.ts +19 -3
- package/dist/tools/door-clearance.d.ts.map +1 -1
- package/dist/tools/door-clearance.js +102 -8
- package/dist/tools/duplicate-level.d.ts +8 -1
- package/dist/tools/duplicate-level.d.ts.map +1 -1
- package/dist/tools/duplicate-level.js +8 -4
- package/dist/tools/export-glb.d.ts +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/tools/find-nodes.d.ts.map +1 -1
- package/dist/tools/find-nodes.js +3 -1
- package/dist/tools/get-node.d.ts +1 -1
- package/dist/tools/get-node.d.ts.map +1 -1
- package/dist/tools/get-node.js +4 -2
- package/dist/tools/get-scene.d.ts +1 -1
- package/dist/tools/get-scene.d.ts.map +1 -1
- package/dist/tools/get-scene.js +2 -0
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +32 -26
- package/dist/tools/layout-clearance.d.ts +4 -2
- package/dist/tools/layout-clearance.d.ts.map +1 -1
- package/dist/tools/layout-clearance.js +7 -3
- package/dist/tools/list-units.d.ts +38 -0
- package/dist/tools/list-units.d.ts.map +1 -0
- package/dist/tools/list-units.js +61 -0
- package/dist/tools/live-sync.d.ts +34 -4
- package/dist/tools/live-sync.d.ts.map +1 -1
- package/dist/tools/live-sync.js +38 -6
- package/dist/tools/measure.d.ts +2 -1
- package/dist/tools/measure.d.ts.map +1 -1
- package/dist/tools/measure.js +6 -2
- package/dist/tools/normalize-schema-dialect.d.ts +3 -0
- package/dist/tools/normalize-schema-dialect.d.ts.map +1 -0
- package/dist/tools/normalize-schema-dialect.js +28 -0
- package/dist/tools/photo-to-scene/index.d.ts +2 -2
- package/dist/tools/photo-to-scene/index.js +2 -2
- package/dist/tools/photo-to-scene/photo-to-scene.d.ts +1 -1
- package/dist/tools/photo-to-scene/photo-to-scene.d.ts.map +1 -1
- package/dist/tools/photo-to-scene/photo-to-scene.js +5 -3
- package/dist/tools/place-item.d.ts +8 -1
- package/dist/tools/place-item.d.ts.map +1 -1
- package/dist/tools/place-item.js +11 -7
- package/dist/tools/redo.d.ts +8 -1
- package/dist/tools/redo.d.ts.map +1 -1
- package/dist/tools/redo.js +6 -4
- package/dist/tools/room-tools.d.ts +29 -1
- package/dist/tools/room-tools.d.ts.map +1 -1
- package/dist/tools/room-tools.js +27 -12
- package/dist/tools/scene-lifecycle/create-project.d.ts +1 -1
- package/dist/tools/scene-lifecycle/create-project.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/create-project.js +4 -2
- package/dist/tools/scene-lifecycle/delete-scene.d.ts +1 -1
- package/dist/tools/scene-lifecycle/delete-scene.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/delete-scene.js +4 -2
- package/dist/tools/scene-lifecycle/get-project-status.d.ts +1 -1
- package/dist/tools/scene-lifecycle/get-project-status.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/get-project-status.js +4 -2
- package/dist/tools/scene-lifecycle/index.d.ts +8 -8
- package/dist/tools/scene-lifecycle/index.js +14 -14
- package/dist/tools/scene-lifecycle/list-scenes.d.ts +1 -1
- package/dist/tools/scene-lifecycle/list-scenes.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/list-scenes.js +3 -1
- package/dist/tools/scene-lifecycle/load-scene.d.ts +1 -1
- package/dist/tools/scene-lifecycle/load-scene.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/load-scene.js +4 -2
- package/dist/tools/scene-lifecycle/metadata.d.ts +3 -3
- package/dist/tools/scene-lifecycle/rename-scene.d.ts +1 -1
- package/dist/tools/scene-lifecycle/rename-scene.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/rename-scene.js +4 -2
- package/dist/tools/scene-lifecycle/save-scene.d.ts +1 -1
- package/dist/tools/scene-lifecycle/save-scene.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/save-scene.js +6 -4
- package/dist/tools/scene-lifecycle/test-utils.d.ts +7 -3
- package/dist/tools/scene-lifecycle/test-utils.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/test-utils.js +28 -4
- package/dist/tools/scene-query.d.ts +1 -1
- package/dist/tools/scene-query.d.ts.map +1 -1
- package/dist/tools/scene-query.js +9 -3
- package/dist/tools/set-unit-members.d.ts +20 -0
- package/dist/tools/set-unit-members.d.ts.map +1 -0
- package/dist/tools/set-unit-members.js +43 -0
- package/dist/tools/set-zone.d.ts +8 -1
- package/dist/tools/set-zone.d.ts.map +1 -1
- package/dist/tools/set-zone.js +8 -5
- package/dist/tools/templates/create-from-template.d.ts +1 -1
- package/dist/tools/templates/create-from-template.d.ts.map +1 -1
- package/dist/tools/templates/create-from-template.js +7 -5
- package/dist/tools/templates/create-house-from-brief.d.ts +1 -1
- package/dist/tools/templates/create-house-from-brief.d.ts.map +1 -1
- package/dist/tools/templates/create-house-from-brief.js +7 -5
- package/dist/tools/templates/index.d.ts +4 -4
- package/dist/tools/templates/index.js +6 -6
- package/dist/tools/templates/list-templates.d.ts.map +1 -1
- package/dist/tools/templates/list-templates.js +3 -1
- package/dist/tools/undo.d.ts +8 -1
- package/dist/tools/undo.d.ts.map +1 -1
- package/dist/tools/undo.js +6 -4
- package/dist/tools/unit-members.d.ts +4 -0
- package/dist/tools/unit-members.d.ts.map +1 -0
- package/dist/tools/unit-members.js +24 -0
- package/dist/tools/validate-scene.d.ts +1 -1
- 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 +1 -1
- package/dist/tools/variants/generate-variants.d.ts.map +1 -1
- package/dist/tools/variants/generate-variants.js +4 -2
- package/dist/tools/variants/index.d.ts +3 -3
- package/dist/tools/variants/index.js +3 -3
- package/dist/tools/vision/analyze-floorplan-image.d.ts +1 -1
- package/dist/tools/vision/analyze-floorplan-image.d.ts.map +1 -1
- package/dist/tools/vision/analyze-floorplan-image.js +3 -1
- package/dist/tools/vision/analyze-room-photo.d.ts +1 -1
- package/dist/tools/vision/analyze-room-photo.d.ts.map +1 -1
- package/dist/tools/vision/analyze-room-photo.js +3 -1
- package/dist/tools/vision/index.d.ts +3 -3
- package/dist/tools/vision/index.js +4 -4
- package/package.json +8 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import type { SceneOperations } from '../../operations';
|
|
2
|
+
import type { SceneOperations } from '../../operations/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Register the `photo_to_scene` orchestrator tool. Chains the vision
|
|
5
5
|
* (`analyze_floorplan_image`-equivalent sampling call) → SceneGraph
|
|
@@ -7,5 +7,5 @@ import type { SceneOperations } from '../../operations';
|
|
|
7
7
|
* Pascal scene from a single photo upload.
|
|
8
8
|
*/
|
|
9
9
|
export declare function registerPhotoToSceneTool(server: McpServer, bridge: SceneOperations): void;
|
|
10
|
-
export { photoToSceneInput, photoToSceneOutput, registerPhotoToScene, } from './photo-to-scene';
|
|
10
|
+
export { photoToSceneInput, photoToSceneOutput, registerPhotoToScene, } from './photo-to-scene.js';
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { registerPhotoToScene } from './photo-to-scene';
|
|
1
|
+
import { registerPhotoToScene } from './photo-to-scene.js';
|
|
2
2
|
/**
|
|
3
3
|
* Register the `photo_to_scene` orchestrator tool. Chains the vision
|
|
4
4
|
* (`analyze_floorplan_image`-equivalent sampling call) → SceneGraph
|
|
@@ -8,4 +8,4 @@ import { registerPhotoToScene } from './photo-to-scene';
|
|
|
8
8
|
export function registerPhotoToSceneTool(server, bridge) {
|
|
9
9
|
registerPhotoToScene(server, bridge);
|
|
10
10
|
}
|
|
11
|
-
export { photoToSceneInput, photoToSceneOutput, registerPhotoToScene, } from './photo-to-scene';
|
|
11
|
+
export { photoToSceneInput, photoToSceneOutput, registerPhotoToScene, } from './photo-to-scene.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import type { SceneOperations } from '../../operations';
|
|
3
|
+
import type { SceneOperations } from '../../operations/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Input shape for the `photo_to_scene` orchestrator. `image` matches the
|
|
6
6
|
* contract documented on `analyze_floorplan_image` — base64 or http(s) URL.
|
|
@@ -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,8 +1,9 @@
|
|
|
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 {
|
|
5
|
-
import {
|
|
4
|
+
import { DESTRUCTIVE_OPEN_WORLD_TOOL_ANNOTATIONS } from '../annotations.js';
|
|
5
|
+
import { appendLiveSceneEvent } from '../live-sync.js';
|
|
6
|
+
import { measurement } from '../measurement.js';
|
|
6
7
|
/**
|
|
7
8
|
* Input shape for the `photo_to_scene` orchestrator. `image` matches the
|
|
8
9
|
* contract documented on `analyze_floorplan_image` — base64 or http(s) URL.
|
|
@@ -82,7 +83,7 @@ const DATA_URI_RE = /^data:(image\/[a-z0-9.+-]+);base64,(.+)$/i;
|
|
|
82
83
|
async function resolveImageBlock(image) {
|
|
83
84
|
if (/^https?:\/\//i.test(image)) {
|
|
84
85
|
// SSRF-safe fetch (see packages/mcp/src/lib/safe-fetch.ts).
|
|
85
|
-
const { safeFetch } = await import('../../lib/safe-fetch');
|
|
86
|
+
const { safeFetch } = await import('../../lib/safe-fetch.js');
|
|
86
87
|
const res = await safeFetch(image, { accept: 'image/*' });
|
|
87
88
|
const data = res.buffer.toString('base64');
|
|
88
89
|
const mimeType = res.contentType ?? 'image/jpeg';
|
|
@@ -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);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import type { SceneOperations } from '../operations';
|
|
3
|
+
import type { SceneOperations } from '../operations/index.js';
|
|
4
4
|
export declare const placeItemInput: {
|
|
5
5
|
catalogItemId: z.ZodString;
|
|
6
6
|
targetNodeId: z.ZodString;
|
|
@@ -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,11 +1,12 @@
|
|
|
1
1
|
import { ItemNode } from '@pascal-app/core/schema';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
3
|
+
import { ADDITIVE_TOOL_ANNOTATIONS } from './annotations.js';
|
|
4
|
+
import { findCatalogItem } from './asset-catalog.js';
|
|
5
|
+
import { ErrorCode, throwMcpError } from './errors.js';
|
|
6
|
+
import { projectWorldPointToWallLocalX, wallLength } from './geometry.js';
|
|
7
|
+
import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync.js';
|
|
8
|
+
import { measurement } from './measurement.js';
|
|
9
|
+
import { NodeIdSchema, Vec3Schema } from './schemas.js';
|
|
9
10
|
export const placeItemInput = {
|
|
10
11
|
catalogItemId: z.string().min(1),
|
|
11
12
|
targetNodeId: NodeIdSchema,
|
|
@@ -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
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import type { SceneOperations } from '../operations';
|
|
3
|
+
import type { SceneOperations } from '../operations/index.js';
|
|
4
4
|
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.js';
|
|
3
|
+
import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync.js';
|
|
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,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import type { SceneOperations } from '../operations';
|
|
3
|
+
import type { SceneOperations } from '../operations/index.js';
|
|
4
4
|
export declare const searchAssetsInput: {
|
|
5
5
|
query: z.ZodString;
|
|
6
6
|
category: z.ZodOptional<z.ZodString>;
|
|
@@ -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,cAAc;;;;;;;CAU1B,CAAA;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;CAU3B,CAAA;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;CAM5B,CAAA;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;CAK7B,CAAA;AA4QD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAuB5D;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAuDnF;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CA6ChF;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CA4ClF;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CA0HpF;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAMlF"}
|
package/dist/tools/room-tools.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { CeilingNode, DoorNode, ItemNode, SlabNode, WallNode, WindowNode, ZoneNode, } from '@pascal-app/core/schema';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
3
|
+
import { ADDITIVE_TOOL_ANNOTATIONS, READ_ONLY_TOOL_ANNOTATIONS } from './annotations.js';
|
|
4
|
+
import { findCatalogItem, searchCatalogItems } from './asset-catalog.js';
|
|
5
|
+
import { keepoutCoversPlanned, keepoutForPolygonEdge } from './door-clearance.js';
|
|
6
|
+
import { ErrorCode, throwMcpError } from './errors.js';
|
|
7
|
+
import { polygonArea, polygonBounds, wallLength, wallLocalXFromT } from './geometry.js';
|
|
8
|
+
import { collectDoorKeepouts, collectOccupiedFootprints, findValidPlacement, itemPlanAabb, } from './layout-clearance.js';
|
|
9
|
+
import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot, } from './live-sync.js';
|
|
10
|
+
import { measurement } from './measurement.js';
|
|
11
|
+
import { NodeIdSchema, Vec2Schema } from './schemas.js';
|
|
11
12
|
const ROOM_TYPES = [
|
|
12
13
|
'bedroom',
|
|
13
14
|
'kitchen',
|
|
@@ -47,6 +48,7 @@ export const createRoomOutput = {
|
|
|
47
48
|
ceilingId: z.string(),
|
|
48
49
|
wallIds: z.array(z.string()),
|
|
49
50
|
areaSqMeters: z.number(),
|
|
51
|
+
...liveSyncOutput,
|
|
50
52
|
};
|
|
51
53
|
export const addDoorInput = {
|
|
52
54
|
wallId: NodeIdSchema,
|
|
@@ -65,6 +67,7 @@ export const addDoorOutput = {
|
|
|
65
67
|
wallLength: z.number(),
|
|
66
68
|
clamped: z.boolean(),
|
|
67
69
|
coordinateSystem: z.literal('wall-local-meters'),
|
|
70
|
+
...liveSyncOutput,
|
|
68
71
|
};
|
|
69
72
|
export const addWindowInput = {
|
|
70
73
|
wallId: NodeIdSchema,
|
|
@@ -86,6 +89,7 @@ export const addWindowOutput = {
|
|
|
86
89
|
clamped: z.boolean(),
|
|
87
90
|
coordinateSystem: z.literal('wall-local-meters'),
|
|
88
91
|
sillHeight: z.number(),
|
|
92
|
+
...liveSyncOutput,
|
|
89
93
|
};
|
|
90
94
|
export const furnishRoomInput = {
|
|
91
95
|
levelId: NodeIdSchema.optional(),
|
|
@@ -98,6 +102,7 @@ export const furnishRoomOutput = {
|
|
|
98
102
|
placed: z.number(),
|
|
99
103
|
itemIds: z.array(z.string()),
|
|
100
104
|
skipped: z.array(z.string()),
|
|
105
|
+
...liveSyncOutput,
|
|
101
106
|
};
|
|
102
107
|
function textResult(payload) {
|
|
103
108
|
return {
|
|
@@ -340,6 +345,7 @@ export function registerSearchAssets(server) {
|
|
|
340
345
|
description: 'Search the built-in MCP item catalog by keyword. Call before place_item when you need a valid catalogItemId.',
|
|
341
346
|
inputSchema: searchAssetsInput,
|
|
342
347
|
outputSchema: searchAssetsOutput,
|
|
348
|
+
annotations: READ_ONLY_TOOL_ANNOTATIONS,
|
|
343
349
|
}, async ({ query, category }) => {
|
|
344
350
|
const results = searchCatalogItems({ query, category }).map((item) => ({
|
|
345
351
|
id: item.id,
|
|
@@ -358,6 +364,7 @@ export function registerCreateRoom(server, bridge) {
|
|
|
358
364
|
description: 'Create a room on a level: zone, slab, ceiling, and one wall per polygon edge. Returns wallIds in polygon edge order.',
|
|
359
365
|
inputSchema: createRoomInput,
|
|
360
366
|
outputSchema: createRoomOutput,
|
|
367
|
+
annotations: ADDITIVE_TOOL_ANNOTATIONS,
|
|
361
368
|
}, async ({ levelId, name, polygon, color, wallHeight, wallThickness }) => {
|
|
362
369
|
assertLevel(bridge, levelId);
|
|
363
370
|
const points = polygon;
|
|
@@ -387,13 +394,14 @@ export function registerCreateRoom(server, bridge) {
|
|
|
387
394
|
parentId: levelId,
|
|
388
395
|
})),
|
|
389
396
|
]);
|
|
390
|
-
await publishLiveSceneSnapshot(bridge, 'create_room');
|
|
397
|
+
const persistence = await publishLiveSceneSnapshot(bridge, 'create_room');
|
|
391
398
|
return textResult({
|
|
392
399
|
zoneId: zone.id,
|
|
393
400
|
slabId: slab.id,
|
|
394
401
|
ceilingId: ceiling.id,
|
|
395
402
|
wallIds: walls.map((wall) => wall.id),
|
|
396
403
|
areaSqMeters: Math.round(polygonArea(points) * 100) / 100,
|
|
404
|
+
...persistencePayload(persistence),
|
|
397
405
|
});
|
|
398
406
|
});
|
|
399
407
|
}
|
|
@@ -403,6 +411,7 @@ export function registerAddDoor(server, bridge) {
|
|
|
403
411
|
description: 'Add a door to an existing wall. t/position is 0..1 along the wall: 0 = start, 0.5 = center, 1 = end.',
|
|
404
412
|
inputSchema: addDoorInput,
|
|
405
413
|
outputSchema: addDoorOutput,
|
|
414
|
+
annotations: ADDITIVE_TOOL_ANNOTATIONS,
|
|
406
415
|
}, async ({ wallId, t, position, width = 0.9, height = 2.1, hingesSide, swingDirection }) => {
|
|
407
416
|
const wall = assertWall(bridge, wallId);
|
|
408
417
|
const length = wallLength(wall);
|
|
@@ -421,7 +430,7 @@ export function registerAddDoor(server, bridge) {
|
|
|
421
430
|
...(swingDirection ? { swingDirection } : {}),
|
|
422
431
|
});
|
|
423
432
|
const id = bridge.createNode(door, wallId);
|
|
424
|
-
await publishLiveSceneSnapshot(bridge, 'add_door');
|
|
433
|
+
const persistence = await publishLiveSceneSnapshot(bridge, 'add_door');
|
|
425
434
|
return textResult({
|
|
426
435
|
doorId: id,
|
|
427
436
|
localX,
|
|
@@ -430,6 +439,7 @@ export function registerAddDoor(server, bridge) {
|
|
|
430
439
|
wallLength: length,
|
|
431
440
|
clamped: Math.abs(localX - wallT * length) > 1e-9,
|
|
432
441
|
coordinateSystem: 'wall-local-meters',
|
|
442
|
+
...persistencePayload(persistence),
|
|
433
443
|
});
|
|
434
444
|
});
|
|
435
445
|
}
|
|
@@ -439,6 +449,7 @@ export function registerAddWindow(server, bridge) {
|
|
|
439
449
|
description: 'Add a window to an existing wall. t/position is 0..1 along the wall; sillHeight is the height from floor to window bottom.',
|
|
440
450
|
inputSchema: addWindowInput,
|
|
441
451
|
outputSchema: addWindowOutput,
|
|
452
|
+
annotations: ADDITIVE_TOOL_ANNOTATIONS,
|
|
442
453
|
}, async ({ wallId, t, position, width = 1.5, height = 1.5, sillHeight = 0.9 }) => {
|
|
443
454
|
const wall = assertWall(bridge, wallId);
|
|
444
455
|
const length = wallLength(wall);
|
|
@@ -455,7 +466,7 @@ export function registerAddWindow(server, bridge) {
|
|
|
455
466
|
height,
|
|
456
467
|
});
|
|
457
468
|
const id = bridge.createNode(windowNode, wallId);
|
|
458
|
-
await publishLiveSceneSnapshot(bridge, 'add_window');
|
|
469
|
+
const persistence = await publishLiveSceneSnapshot(bridge, 'add_window');
|
|
459
470
|
return textResult({
|
|
460
471
|
windowId: id,
|
|
461
472
|
localX,
|
|
@@ -465,6 +476,7 @@ export function registerAddWindow(server, bridge) {
|
|
|
465
476
|
clamped: Math.abs(localX - wallT * length) > 1e-9,
|
|
466
477
|
coordinateSystem: 'wall-local-meters',
|
|
467
478
|
sillHeight,
|
|
479
|
+
...persistencePayload(persistence),
|
|
468
480
|
});
|
|
469
481
|
});
|
|
470
482
|
}
|
|
@@ -474,6 +486,7 @@ export function registerFurnishRoom(server, bridge) {
|
|
|
474
486
|
description: 'Place furniture for a room type (levelId+polygon or zoneId). Skips or nudges poses that block door clear zones or overlap existing items (rotation-aware). Parent floor items to the level.',
|
|
475
487
|
inputSchema: furnishRoomInput,
|
|
476
488
|
outputSchema: furnishRoomOutput,
|
|
489
|
+
annotations: ADDITIVE_TOOL_ANNOTATIONS,
|
|
477
490
|
}, async ({ levelId, zoneId, roomType, polygon, doorWallIndex }) => {
|
|
478
491
|
const room = inferRoomGeometry(bridge, levelId, polygon, zoneId);
|
|
479
492
|
assertLevel(bridge, room.levelId);
|
|
@@ -552,18 +565,20 @@ export function registerFurnishRoom(server, bridge) {
|
|
|
552
565
|
},
|
|
553
566
|
}));
|
|
554
567
|
}
|
|
568
|
+
let persistence = 'published';
|
|
555
569
|
if (items.length > 0) {
|
|
556
570
|
bridge.applyPatch(items.map((item) => ({
|
|
557
571
|
op: 'create',
|
|
558
572
|
node: item,
|
|
559
573
|
parentId: room.levelId,
|
|
560
574
|
})));
|
|
561
|
-
await publishLiveSceneSnapshot(bridge, 'furnish_room');
|
|
575
|
+
persistence = await publishLiveSceneSnapshot(bridge, 'furnish_room');
|
|
562
576
|
}
|
|
563
577
|
return textResult({
|
|
564
578
|
placed: items.length,
|
|
565
579
|
itemIds: items.map((item) => item.id),
|
|
566
580
|
skipped,
|
|
581
|
+
...persistencePayload(persistence),
|
|
567
582
|
});
|
|
568
583
|
});
|
|
569
584
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import type { SceneOperations } from '../../operations';
|
|
3
|
+
import type { SceneOperations } from '../../operations/index.js';
|
|
4
4
|
export declare const createProjectInput: {
|
|
5
5
|
name: z.ZodString;
|
|
6
6
|
id: z.ZodOptional<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-project.d.ts","sourceRoot":"","sources":["../../../src/tools/scene-lifecycle/create-project.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,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"create-project.d.ts","sourceRoot":"","sources":["../../../src/tools/scene-lifecycle/create-project.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,kBAAkB,CAAA;AAKvD,eAAO,MAAM,kBAAkB;;;;CAI9B,CAAA;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;CAsB/B,CAAA;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,GAAG,IAAI,CAiD1F"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { ADDITIVE_TOOL_ANNOTATIONS } from '../annotations.js';
|
|
3
|
+
import { ErrorCode, throwMcpError } from '../errors.js';
|
|
4
|
+
import { currentLevelContext, projectStatusPayload } from './metadata.js';
|
|
4
5
|
export const createProjectInput = {
|
|
5
6
|
name: z.string().min(1).max(200),
|
|
6
7
|
id: z.string().min(1).max(64).optional(),
|
|
@@ -35,6 +36,7 @@ export function registerCreateProject(server, operations) {
|
|
|
35
36
|
description: 'Create a browser-visible Pascal project for the authenticated user. Use this before save_scene when the user asks for a new project.',
|
|
36
37
|
inputSchema: createProjectInput,
|
|
37
38
|
outputSchema: createProjectOutput,
|
|
39
|
+
annotations: ADDITIVE_TOOL_ANNOTATIONS,
|
|
38
40
|
}, async ({ name, id, isPrivate }) => {
|
|
39
41
|
if (!operations.canCreateProject) {
|
|
40
42
|
throwMcpError(ErrorCode.InvalidRequest, 'create_project_unavailable: this MCP store cannot create hosted projects');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import type { SceneOperations } from '../../operations';
|
|
3
|
+
import type { SceneOperations } from '../../operations/index.js';
|
|
4
4
|
export declare const deleteSceneInput: {
|
|
5
5
|
id: z.ZodString;
|
|
6
6
|
expectedVersion: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete-scene.d.ts","sourceRoot":"","sources":["../../../src/tools/scene-lifecycle/delete-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,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"delete-scene.d.ts","sourceRoot":"","sources":["../../../src/tools/scene-lifecycle/delete-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,kBAAkB,CAAA;AAKvD,eAAO,MAAM,gBAAgB;;;CAG5B,CAAA;AAED,eAAO,MAAM,iBAAiB;;CAE7B,CAAA;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,GAAG,IAAI,CAoCxF"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { SceneNotFoundError, SceneVersionConflictError } from '../../storage/types';
|
|
3
|
-
import {
|
|
2
|
+
import { SceneNotFoundError, SceneVersionConflictError } from '../../storage/types.js';
|
|
3
|
+
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from '../annotations.js';
|
|
4
|
+
import { ErrorCode, throwMcpError } from '../errors.js';
|
|
4
5
|
export const deleteSceneInput = {
|
|
5
6
|
id: z.string().min(1).max(64),
|
|
6
7
|
expectedVersion: z.number().int().positive().optional(),
|
|
@@ -14,6 +15,7 @@ export function registerDeleteScene(server, operations) {
|
|
|
14
15
|
description: 'Delete a scene from the SceneStore by id. Optionally pass `expectedVersion` for optimistic concurrency.',
|
|
15
16
|
inputSchema: deleteSceneInput,
|
|
16
17
|
outputSchema: deleteSceneOutput,
|
|
18
|
+
annotations: DESTRUCTIVE_TOOL_ANNOTATIONS,
|
|
17
19
|
}, async ({ id, expectedVersion }) => {
|
|
18
20
|
try {
|
|
19
21
|
const deleted = await operations.deleteStoredScene(id, {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import type { SceneOperations } from '../../operations';
|
|
3
|
+
import type { SceneOperations } from '../../operations/index.js';
|
|
4
4
|
export declare const getProjectStatusInput: {
|
|
5
5
|
id: z.ZodString;
|
|
6
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-project-status.d.ts","sourceRoot":"","sources":["../../../src/tools/scene-lifecycle/get-project-status.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,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"get-project-status.d.ts","sourceRoot":"","sources":["../../../src/tools/scene-lifecycle/get-project-status.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,kBAAkB,CAAA;AAKvD,eAAO,MAAM,qBAAqB;;CAEjC,CAAA;AAED,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;CAsBlC,CAAA;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,GAAG,IAAI,CA4C7F"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from '../annotations.js';
|
|
3
|
+
import { ErrorCode, McpError, throwMcpError } from '../errors.js';
|
|
4
|
+
import { currentLevelContext, projectStatusPayload } from './metadata.js';
|
|
4
5
|
export const getProjectStatusInput = {
|
|
5
6
|
id: z.string().min(1).max(64),
|
|
6
7
|
};
|
|
@@ -33,6 +34,7 @@ export function registerGetProjectStatus(server, operations) {
|
|
|
33
34
|
description: 'Authoritative status/debug call for a Pascal project: editor URL, browser-visible version, latest saved version, published version, node count, and graph hash.',
|
|
34
35
|
inputSchema: getProjectStatusInput,
|
|
35
36
|
outputSchema: getProjectStatusOutput,
|
|
37
|
+
annotations: DESTRUCTIVE_TOOL_ANNOTATIONS,
|
|
36
38
|
}, async ({ id }) => {
|
|
37
39
|
try {
|
|
38
40
|
const status = await operations.getProjectStatus(id);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import type { SceneOperations } from '../../operations';
|
|
2
|
+
import type { SceneOperations } from '../../operations/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Register the scene-lifecycle MCP tools (`save_scene`, `load_scene`,
|
|
5
5
|
* `list_scenes`, `delete_scene`, `rename_scene`) against the given server.
|
|
@@ -7,11 +7,11 @@ import type { SceneOperations } from '../../operations';
|
|
|
7
7
|
* entry points share the same storage boundary.
|
|
8
8
|
*/
|
|
9
9
|
export declare function registerSceneLifecycleTools(server: McpServer, operations: SceneOperations): void;
|
|
10
|
-
export { createProjectInput, createProjectOutput, registerCreateProject } from './create-project';
|
|
11
|
-
export { deleteSceneInput, deleteSceneOutput, registerDeleteScene } from './delete-scene';
|
|
12
|
-
export { getProjectStatusInput, getProjectStatusOutput, registerGetProjectStatus, } from './get-project-status';
|
|
13
|
-
export { listScenesInput, listScenesOutput, registerListScenes } from './list-scenes';
|
|
14
|
-
export { loadSceneInput, loadSceneOutput, registerLoadScene } from './load-scene';
|
|
15
|
-
export { registerRenameScene, renameSceneInput, renameSceneOutput } from './rename-scene';
|
|
16
|
-
export { registerSaveScene, saveSceneInput, saveSceneOutput } from './save-scene';
|
|
10
|
+
export { createProjectInput, createProjectOutput, registerCreateProject } from './create-project.js';
|
|
11
|
+
export { deleteSceneInput, deleteSceneOutput, registerDeleteScene } from './delete-scene.js';
|
|
12
|
+
export { getProjectStatusInput, getProjectStatusOutput, registerGetProjectStatus, } from './get-project-status.js';
|
|
13
|
+
export { listScenesInput, listScenesOutput, registerListScenes } from './list-scenes.js';
|
|
14
|
+
export { loadSceneInput, loadSceneOutput, registerLoadScene } from './load-scene.js';
|
|
15
|
+
export { registerRenameScene, renameSceneInput, renameSceneOutput } from './rename-scene.js';
|
|
16
|
+
export { registerSaveScene, saveSceneInput, saveSceneOutput } from './save-scene.js';
|
|
17
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { registerCreateProject } from './create-project';
|
|
2
|
-
import { registerDeleteScene } from './delete-scene';
|
|
3
|
-
import { registerGetProjectStatus } from './get-project-status';
|
|
4
|
-
import { registerListScenes } from './list-scenes';
|
|
5
|
-
import { registerLoadScene } from './load-scene';
|
|
6
|
-
import { registerRenameScene } from './rename-scene';
|
|
7
|
-
import { registerSaveScene } from './save-scene';
|
|
1
|
+
import { registerCreateProject } from './create-project.js';
|
|
2
|
+
import { registerDeleteScene } from './delete-scene.js';
|
|
3
|
+
import { registerGetProjectStatus } from './get-project-status.js';
|
|
4
|
+
import { registerListScenes } from './list-scenes.js';
|
|
5
|
+
import { registerLoadScene } from './load-scene.js';
|
|
6
|
+
import { registerRenameScene } from './rename-scene.js';
|
|
7
|
+
import { registerSaveScene } from './save-scene.js';
|
|
8
8
|
/**
|
|
9
9
|
* Register the scene-lifecycle MCP tools (`save_scene`, `load_scene`,
|
|
10
10
|
* `list_scenes`, `delete_scene`, `rename_scene`) against the given server.
|
|
@@ -20,10 +20,10 @@ export function registerSceneLifecycleTools(server, operations) {
|
|
|
20
20
|
registerDeleteScene(server, operations);
|
|
21
21
|
registerRenameScene(server, operations);
|
|
22
22
|
}
|
|
23
|
-
export { createProjectInput, createProjectOutput, registerCreateProject } from './create-project';
|
|
24
|
-
export { deleteSceneInput, deleteSceneOutput, registerDeleteScene } from './delete-scene';
|
|
25
|
-
export { getProjectStatusInput, getProjectStatusOutput, registerGetProjectStatus, } from './get-project-status';
|
|
26
|
-
export { listScenesInput, listScenesOutput, registerListScenes } from './list-scenes';
|
|
27
|
-
export { loadSceneInput, loadSceneOutput, registerLoadScene } from './load-scene';
|
|
28
|
-
export { registerRenameScene, renameSceneInput, renameSceneOutput } from './rename-scene';
|
|
29
|
-
export { registerSaveScene, saveSceneInput, saveSceneOutput } from './save-scene';
|
|
23
|
+
export { createProjectInput, createProjectOutput, registerCreateProject } from './create-project.js';
|
|
24
|
+
export { deleteSceneInput, deleteSceneOutput, registerDeleteScene } from './delete-scene.js';
|
|
25
|
+
export { getProjectStatusInput, getProjectStatusOutput, registerGetProjectStatus, } from './get-project-status.js';
|
|
26
|
+
export { listScenesInput, listScenesOutput, registerListScenes } from './list-scenes.js';
|
|
27
|
+
export { loadSceneInput, loadSceneOutput, registerLoadScene } from './load-scene.js';
|
|
28
|
+
export { registerRenameScene, renameSceneInput, renameSceneOutput } from './rename-scene.js';
|
|
29
|
+
export { registerSaveScene, saveSceneInput, saveSceneOutput } from './save-scene.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import type { SceneOperations } from '../../operations';
|
|
3
|
+
import type { SceneOperations } from '../../operations/index.js';
|
|
4
4
|
export declare const listScenesInput: {
|
|
5
5
|
projectId: z.ZodOptional<z.ZodString>;
|
|
6
6
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-scenes.d.ts","sourceRoot":"","sources":["../../../src/tools/scene-lifecycle/list-scenes.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,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"list-scenes.d.ts","sourceRoot":"","sources":["../../../src/tools/scene-lifecycle/list-scenes.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,kBAAkB,CAAA;AAMvD,eAAO,MAAM,eAAe;;;CAG3B,CAAA;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;CAmB5B,CAAA;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,GAAG,IAAI,CA4BvF"}
|