@pascal-app/mcp 1.0.0 → 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/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.js +1 -1
- 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 +3 -3
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +8 -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/apply-patch.d.ts +1 -1
- package/dist/tools/apply-patch.js +5 -5
- package/dist/tools/check-collisions.d.ts +1 -1
- package/dist/tools/check-collisions.js +7 -7
- package/dist/tools/construction-tools.d.ts +1 -1
- package/dist/tools/construction-tools.js +4 -4
- package/dist/tools/create-level.d.ts +1 -1
- package/dist/tools/create-level.js +5 -5
- 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 +1 -1
- package/dist/tools/create-wall.js +5 -5
- package/dist/tools/cut-opening.d.ts +1 -1
- package/dist/tools/cut-opening.js +6 -6
- package/dist/tools/delete-node.d.ts +1 -1
- package/dist/tools/delete-node.js +4 -4
- package/dist/tools/describe-node.d.ts +1 -1
- package/dist/tools/describe-node.js +4 -4
- package/dist/tools/door-clearance.d.ts +1 -1
- package/dist/tools/door-clearance.js +1 -1
- package/dist/tools/duplicate-level.d.ts +1 -1
- package/dist/tools/duplicate-level.js +4 -4
- package/dist/tools/export-glb.d.ts +1 -1
- package/dist/tools/export-glb.js +1 -1
- package/dist/tools/export-json.d.ts +1 -1
- package/dist/tools/export-json.js +1 -1
- package/dist/tools/find-nodes.d.ts +1 -1
- package/dist/tools/find-nodes.js +2 -2
- package/dist/tools/get-node.d.ts +1 -1
- package/dist/tools/get-node.js +3 -3
- package/dist/tools/get-scene.d.ts +1 -1
- package/dist/tools/get-scene.js +1 -1
- 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 +2 -2
- package/dist/tools/layout-clearance.js +2 -2
- 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 +1 -1
- package/dist/tools/live-sync.js +2 -2
- package/dist/tools/measure.d.ts +1 -1
- package/dist/tools/measure.js +3 -3
- 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.js +4 -4
- package/dist/tools/place-item.d.ts +1 -1
- package/dist/tools/place-item.js +7 -7
- package/dist/tools/redo.d.ts +1 -1
- package/dist/tools/redo.js +2 -2
- package/dist/tools/room-tools.d.ts +1 -1
- package/dist/tools/room-tools.js +9 -9
- package/dist/tools/scene-lifecycle/create-project.d.ts +1 -1
- package/dist/tools/scene-lifecycle/create-project.js +3 -3
- package/dist/tools/scene-lifecycle/delete-scene.d.ts +1 -1
- package/dist/tools/scene-lifecycle/delete-scene.js +3 -3
- package/dist/tools/scene-lifecycle/get-project-status.d.ts +1 -1
- package/dist/tools/scene-lifecycle/get-project-status.js +3 -3
- 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.js +2 -2
- package/dist/tools/scene-lifecycle/load-scene.d.ts +1 -1
- package/dist/tools/scene-lifecycle/load-scene.js +3 -3
- 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.js +3 -3
- package/dist/tools/scene-lifecycle/save-scene.d.ts +1 -1
- package/dist/tools/scene-lifecycle/save-scene.js +5 -5
- package/dist/tools/scene-lifecycle/test-utils.d.ts +3 -3
- package/dist/tools/scene-lifecycle/test-utils.js +4 -4
- package/dist/tools/scene-query.d.ts +1 -1
- package/dist/tools/scene-query.js +4 -4
- 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 +1 -1
- package/dist/tools/set-zone.js +4 -4
- package/dist/tools/templates/create-from-template.d.ts +1 -1
- package/dist/tools/templates/create-from-template.js +6 -6
- package/dist/tools/templates/create-house-from-brief.d.ts +1 -1
- package/dist/tools/templates/create-house-from-brief.js +6 -6
- package/dist/tools/templates/index.d.ts +4 -4
- package/dist/tools/templates/index.js +6 -6
- package/dist/tools/templates/list-templates.js +2 -2
- package/dist/tools/undo.d.ts +1 -1
- package/dist/tools/undo.js +2 -2
- 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.js +1 -1
- package/dist/tools/variants/generate-variants.d.ts +1 -1
- package/dist/tools/variants/generate-variants.js +3 -3
- 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.js +2 -2
- package/dist/tools/vision/analyze-room-photo.d.ts +1 -1
- package/dist/tools/vision/analyze-room-photo.js +2 -2
- package/dist/tools/vision/index.d.ts +3 -3
- package/dist/tools/vision/index.js +4 -4
- package/package.json +6 -5
package/dist/tools/redo.d.ts
CHANGED
|
@@ -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 redoInput: {
|
|
5
5
|
steps: z.ZodOptional<z.ZodNumber>;
|
|
6
6
|
};
|
package/dist/tools/redo.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from './annotations';
|
|
3
|
-
import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync';
|
|
2
|
+
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from './annotations.js';
|
|
3
|
+
import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync.js';
|
|
4
4
|
export const redoInput = {
|
|
5
5
|
steps: z.number().int().positive().optional(),
|
|
6
6
|
};
|
|
@@ -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>;
|
package/dist/tools/room-tools.js
CHANGED
|
@@ -1,14 +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 { ADDITIVE_TOOL_ANNOTATIONS, READ_ONLY_TOOL_ANNOTATIONS } from './annotations';
|
|
4
|
-
import { findCatalogItem, searchCatalogItems } from './asset-catalog';
|
|
5
|
-
import { keepoutCoversPlanned, keepoutForPolygonEdge } from './door-clearance';
|
|
6
|
-
import { ErrorCode, throwMcpError } from './errors';
|
|
7
|
-
import { polygonArea, polygonBounds, wallLength, wallLocalXFromT } from './geometry';
|
|
8
|
-
import { collectDoorKeepouts, collectOccupiedFootprints, findValidPlacement, itemPlanAabb, } from './layout-clearance';
|
|
9
|
-
import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot, } from './live-sync';
|
|
10
|
-
import { measurement } from './measurement';
|
|
11
|
-
import { NodeIdSchema, Vec2Schema } from './schemas';
|
|
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';
|
|
12
12
|
const ROOM_TYPES = [
|
|
13
13
|
'bedroom',
|
|
14
14
|
'kitchen',
|
|
@@ -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,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { ADDITIVE_TOOL_ANNOTATIONS } from '../annotations';
|
|
3
|
-
import { ErrorCode, throwMcpError } from '../errors';
|
|
4
|
-
import { currentLevelContext, projectStatusPayload } from './metadata';
|
|
2
|
+
import { ADDITIVE_TOOL_ANNOTATIONS } from '../annotations.js';
|
|
3
|
+
import { ErrorCode, throwMcpError } from '../errors.js';
|
|
4
|
+
import { currentLevelContext, projectStatusPayload } from './metadata.js';
|
|
5
5
|
export const createProjectInput = {
|
|
6
6
|
name: z.string().min(1).max(200),
|
|
7
7
|
id: z.string().min(1).max(64).optional(),
|
|
@@ -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,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { SceneNotFoundError, SceneVersionConflictError } from '../../storage/types';
|
|
3
|
-
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from '../annotations';
|
|
4
|
-
import { ErrorCode, throwMcpError } from '../errors';
|
|
2
|
+
import { SceneNotFoundError, SceneVersionConflictError } from '../../storage/types.js';
|
|
3
|
+
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from '../annotations.js';
|
|
4
|
+
import { ErrorCode, throwMcpError } from '../errors.js';
|
|
5
5
|
export const deleteSceneInput = {
|
|
6
6
|
id: z.string().min(1).max(64),
|
|
7
7
|
expectedVersion: z.number().int().positive().optional(),
|
|
@@ -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,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from '../annotations';
|
|
3
|
-
import { ErrorCode, McpError, throwMcpError } from '../errors';
|
|
4
|
-
import { currentLevelContext, projectStatusPayload } from './metadata';
|
|
2
|
+
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from '../annotations.js';
|
|
3
|
+
import { ErrorCode, McpError, throwMcpError } from '../errors.js';
|
|
4
|
+
import { currentLevelContext, projectStatusPayload } from './metadata.js';
|
|
5
5
|
export const getProjectStatusInput = {
|
|
6
6
|
id: z.string().min(1).max(64),
|
|
7
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 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,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { READ_ONLY_TOOL_ANNOTATIONS } from '../annotations';
|
|
3
|
-
import { ErrorCode, throwMcpError } from '../errors';
|
|
2
|
+
import { READ_ONLY_TOOL_ANNOTATIONS } from '../annotations.js';
|
|
3
|
+
import { ErrorCode, throwMcpError } from '../errors.js';
|
|
4
4
|
const DEFAULT_LIMIT = 100;
|
|
5
5
|
export const listScenesInput = {
|
|
6
6
|
projectId: z.string().optional(),
|
|
@@ -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 loadSceneInput: {
|
|
5
5
|
id: z.ZodString;
|
|
6
6
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from '../annotations';
|
|
3
|
-
import { ErrorCode, throwMcpError } from '../errors';
|
|
4
|
-
import { currentLevelContext, sceneMetaPayload } from './metadata';
|
|
2
|
+
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from '../annotations.js';
|
|
3
|
+
import { ErrorCode, throwMcpError } from '../errors.js';
|
|
4
|
+
import { currentLevelContext, sceneMetaPayload } from './metadata.js';
|
|
5
5
|
export const loadSceneInput = {
|
|
6
6
|
id: z.string().min(1).max(64),
|
|
7
7
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SceneGraph } from '@pascal-app/core/clone-scene-graph';
|
|
2
|
-
import type { SceneOperations } from '../../operations';
|
|
3
|
-
import type { ProjectStatus, SceneMeta } from '../../storage/types';
|
|
2
|
+
import type { SceneOperations } from '../../operations/index.js';
|
|
3
|
+
import type { ProjectStatus, SceneMeta } from '../../storage/types.js';
|
|
4
4
|
export declare function computeGraphHash(graph: SceneGraph): string;
|
|
5
5
|
export declare function editorUrlFor(meta: Pick<SceneMeta, 'id' | 'editorUrl' | 'url'>): string;
|
|
6
6
|
export declare function sceneMetaPayload(meta: SceneMeta, graph?: SceneGraph): {
|
|
@@ -18,7 +18,7 @@ export declare function sceneMetaPayload(meta: SceneMeta, graph?: SceneGraph): {
|
|
|
18
18
|
url: string;
|
|
19
19
|
published: boolean;
|
|
20
20
|
isDraft: boolean;
|
|
21
|
-
saveMode: import("../../storage").SceneSaveMode;
|
|
21
|
+
saveMode: import("../../storage/index.js").SceneSaveMode;
|
|
22
22
|
graphHash: string | undefined;
|
|
23
23
|
};
|
|
24
24
|
export declare function projectStatusPayload(status: ProjectStatus, nextStep?: string): {
|
|
@@ -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 renameSceneInput: {
|
|
5
5
|
id: z.ZodString;
|
|
6
6
|
newName: z.ZodString;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { SceneNotFoundError, SceneVersionConflictError } from '../../storage/types';
|
|
3
|
-
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from '../annotations';
|
|
4
|
-
import { ErrorCode, throwMcpError } from '../errors';
|
|
2
|
+
import { SceneNotFoundError, SceneVersionConflictError } from '../../storage/types.js';
|
|
3
|
+
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from '../annotations.js';
|
|
4
|
+
import { ErrorCode, throwMcpError } from '../errors.js';
|
|
5
5
|
export const renameSceneInput = {
|
|
6
6
|
id: z.string().min(1).max(64),
|
|
7
7
|
newName: z.string().min(1).max(200),
|
|
@@ -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 saveSceneInput: {
|
|
5
5
|
id: z.ZodOptional<z.ZodString>;
|
|
6
6
|
name: z.ZodString;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AnyNode } from '@pascal-app/core/schema';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { SceneVersionConflictError } from '../../storage/types';
|
|
4
|
-
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from '../annotations';
|
|
5
|
-
import { ErrorCode, throwMcpError } from '../errors';
|
|
6
|
-
import { appendLiveSceneEvent } from '../live-sync';
|
|
7
|
-
import { currentLevelContext, sceneMetaPayload } from './metadata';
|
|
3
|
+
import { SceneVersionConflictError } from '../../storage/types.js';
|
|
4
|
+
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from '../annotations.js';
|
|
5
|
+
import { ErrorCode, throwMcpError } from '../errors.js';
|
|
6
|
+
import { appendLiveSceneEvent } from '../live-sync.js';
|
|
7
|
+
import { currentLevelContext, sceneMetaPayload } from './metadata.js';
|
|
8
8
|
export const saveSceneInput = {
|
|
9
9
|
id: z.string().min(1).max(64).optional(),
|
|
10
10
|
name: z.string().min(1).max(200),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SceneBridge } from '../../bridge/scene-bridge';
|
|
2
|
-
import { type SceneOperations } from '../../operations';
|
|
3
|
-
import { type ProjectCreateOptions, type ProjectStatus, type SceneEvent, type SceneEventAppendOptions, type SceneEventListOptions, type SceneListOptions, type SceneMeta, type SceneMutateOptions, type SceneSaveOptions, type SceneStore, type SceneWithGraph } from '../../storage/types';
|
|
1
|
+
import { SceneBridge } from '../../bridge/scene-bridge.js';
|
|
2
|
+
import { type SceneOperations } from '../../operations/index.js';
|
|
3
|
+
import { type ProjectCreateOptions, type ProjectStatus, type SceneEvent, type SceneEventAppendOptions, type SceneEventListOptions, type SceneListOptions, type SceneMeta, type SceneMutateOptions, type SceneSaveOptions, type SceneStore, type SceneWithGraph } from '../../storage/types.js';
|
|
4
4
|
export type StoredTextContent = {
|
|
5
5
|
type: string;
|
|
6
6
|
text: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { SceneBridge } from '../../bridge/scene-bridge';
|
|
2
|
-
import { createSceneOperations } from '../../operations';
|
|
3
|
-
import { SceneNotFoundError, SceneVersionConflictError, } from '../../storage/types';
|
|
4
|
-
import { computeGraphHash, editorUrlFor } from './metadata';
|
|
1
|
+
import { SceneBridge } from '../../bridge/scene-bridge.js';
|
|
2
|
+
import { createSceneOperations } from '../../operations/index.js';
|
|
3
|
+
import { SceneNotFoundError, SceneVersionConflictError, } from '../../storage/types.js';
|
|
4
|
+
import { computeGraphHash, editorUrlFor } from './metadata.js';
|
|
5
5
|
export function parseToolText(content) {
|
|
6
6
|
return JSON.parse(content[0].text);
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import type { AnyNode } from '@pascal-app/core/schema';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import type { SceneOperations } from '../operations';
|
|
4
|
+
import type { SceneOperations } from '../operations/index.js';
|
|
5
5
|
export declare const levelScopedInput: {
|
|
6
6
|
levelId: z.ZodOptional<z.ZodString>;
|
|
7
7
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DEFAULT_LEVEL_HEIGHT, getStoredLevelHeight, getWallPlaneTop, resolveStairTotalRise, resolveWallEffectiveHeight, } from '@pascal-app/core';
|
|
2
2
|
import { computeWallSlabSupport } from '@pascal-app/core/spatial-grid';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { READ_ONLY_TOOL_ANNOTATIONS } from './annotations';
|
|
5
|
-
import { distance2D, pointInPolygon, polygonArea, polygonContainsPolygon, wallLength, } from './geometry';
|
|
6
|
-
import { layoutIssuesFromScene } from './layout-clearance';
|
|
7
|
-
import { NodeIdSchema } from './schemas';
|
|
4
|
+
import { READ_ONLY_TOOL_ANNOTATIONS } from './annotations.js';
|
|
5
|
+
import { distance2D, pointInPolygon, polygonArea, polygonContainsPolygon, wallLength, } from './geometry.js';
|
|
6
|
+
import { layoutIssuesFromScene } from './layout-clearance.js';
|
|
7
|
+
import { NodeIdSchema } from './schemas.js';
|
|
8
8
|
export const levelScopedInput = {
|
|
9
9
|
levelId: NodeIdSchema.optional(),
|
|
10
10
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import type { SceneOperations } from '../operations/index.js';
|
|
4
|
+
export declare const setUnitMembersInput: {
|
|
5
|
+
unitId: z.ZodString;
|
|
6
|
+
memberZoneIds: z.ZodArray<z.ZodString>;
|
|
7
|
+
};
|
|
8
|
+
export declare const setUnitMembersOutput: {
|
|
9
|
+
persistence: z.ZodOptional<z.ZodObject<{
|
|
10
|
+
status: z.ZodEnum<{
|
|
11
|
+
unbound: "unbound";
|
|
12
|
+
events_unsupported: "events_unsupported";
|
|
13
|
+
}>;
|
|
14
|
+
warning: z.ZodString;
|
|
15
|
+
}, z.core.$strip>>;
|
|
16
|
+
unitId: z.ZodString;
|
|
17
|
+
memberCount: z.ZodNumber;
|
|
18
|
+
};
|
|
19
|
+
export declare function registerSetUnitMembers(server: McpServer, bridge: SceneOperations): void;
|
|
20
|
+
//# sourceMappingURL=set-unit-members.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-unit-members.d.ts","sourceRoot":"","sources":["../../src/tools/set-unit-members.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;AAOpD,eAAO,MAAM,mBAAmB;;;CAG/B,CAAA;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;CAIhC,CAAA;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAgCvF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from './annotations.js';
|
|
3
|
+
import { ErrorCode, throwMcpError } from './errors.js';
|
|
4
|
+
import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync.js';
|
|
5
|
+
import { NodeIdSchema } from './schemas.js';
|
|
6
|
+
import { validateUnitMembers } from './unit-members.js';
|
|
7
|
+
export const setUnitMembersInput = {
|
|
8
|
+
unitId: NodeIdSchema,
|
|
9
|
+
memberZoneIds: z.array(NodeIdSchema),
|
|
10
|
+
};
|
|
11
|
+
export const setUnitMembersOutput = {
|
|
12
|
+
unitId: z.string(),
|
|
13
|
+
memberCount: z.number(),
|
|
14
|
+
...liveSyncOutput,
|
|
15
|
+
};
|
|
16
|
+
export function registerSetUnitMembers(server, bridge) {
|
|
17
|
+
server.registerTool('set_unit_members', {
|
|
18
|
+
title: 'Set unit members',
|
|
19
|
+
description: 'Replace the zones referenced by a unit. Every zone must belong to a level in the same building.',
|
|
20
|
+
inputSchema: setUnitMembersInput,
|
|
21
|
+
outputSchema: setUnitMembersOutput,
|
|
22
|
+
annotations: { ...DESTRUCTIVE_TOOL_ANNOTATIONS, idempotentHint: true },
|
|
23
|
+
}, async ({ unitId, memberZoneIds }) => {
|
|
24
|
+
const unit = bridge.getNode(unitId);
|
|
25
|
+
if (!unit) {
|
|
26
|
+
throwMcpError(ErrorCode.InvalidParams, `Unit not found: ${unitId}`);
|
|
27
|
+
}
|
|
28
|
+
if (unit.type !== 'unit') {
|
|
29
|
+
throwMcpError(ErrorCode.InvalidParams, `Node ${unitId} is a ${unit.type}, expected unit`);
|
|
30
|
+
}
|
|
31
|
+
if (!unit.parentId) {
|
|
32
|
+
throwMcpError(ErrorCode.InvalidParams, `Unit ${unitId} must belong to a building`);
|
|
33
|
+
}
|
|
34
|
+
const members = validateUnitMembers(bridge, unit.parentId, memberZoneIds);
|
|
35
|
+
bridge.updateNode(unit.id, { members });
|
|
36
|
+
const persistence = await publishLiveSceneSnapshot(bridge, 'set_unit_members');
|
|
37
|
+
const payload = { unitId, memberCount: members.length, ...persistencePayload(persistence) };
|
|
38
|
+
return {
|
|
39
|
+
content: [{ type: 'text', text: JSON.stringify(payload) }],
|
|
40
|
+
structuredContent: payload,
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
}
|
package/dist/tools/set-zone.d.ts
CHANGED
|
@@ -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 setZoneInput: {
|
|
5
5
|
levelId: z.ZodString;
|
|
6
6
|
polygon: z.ZodArray<z.ZodArray<z.ZodNumber>>;
|
package/dist/tools/set-zone.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ZoneNode } from '@pascal-app/core/schema';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { ADDITIVE_TOOL_ANNOTATIONS } from './annotations';
|
|
4
|
-
import { ErrorCode, throwMcpError } from './errors';
|
|
5
|
-
import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync';
|
|
6
|
-
import { NodeIdSchema, Vec2Schema } from './schemas';
|
|
3
|
+
import { ADDITIVE_TOOL_ANNOTATIONS } from './annotations.js';
|
|
4
|
+
import { ErrorCode, throwMcpError } from './errors.js';
|
|
5
|
+
import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync.js';
|
|
6
|
+
import { NodeIdSchema, Vec2Schema } from './schemas.js';
|
|
7
7
|
export const setZoneInput = {
|
|
8
8
|
levelId: NodeIdSchema,
|
|
9
9
|
polygon: z.array(Vec2Schema).min(3),
|
|
@@ -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 createFromTemplateInput: {
|
|
5
5
|
id: z.ZodString;
|
|
6
6
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { cloneSceneGraph } from '@pascal-app/core/clone-scene-graph';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { rehydrateSiteChildren } from '../../lib/rehydrate-site-children';
|
|
4
|
-
import { isTemplateId, TEMPLATES } from '../../templates';
|
|
5
|
-
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from '../annotations';
|
|
6
|
-
import { ErrorCode, throwMcpError } from '../errors';
|
|
7
|
-
import { appendLiveSceneEvent } from '../live-sync';
|
|
8
|
-
import { currentLevelContext, sceneMetaPayload } from '../scene-lifecycle/metadata';
|
|
3
|
+
import { rehydrateSiteChildren } from '../../lib/rehydrate-site-children.js';
|
|
4
|
+
import { isTemplateId, TEMPLATES } from '../../templates/index.js';
|
|
5
|
+
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from '../annotations.js';
|
|
6
|
+
import { ErrorCode, throwMcpError } from '../errors.js';
|
|
7
|
+
import { appendLiveSceneEvent } from '../live-sync.js';
|
|
8
|
+
import { currentLevelContext, sceneMetaPayload } from '../scene-lifecycle/metadata.js';
|
|
9
9
|
export const createFromTemplateInput = {
|
|
10
10
|
id: z
|
|
11
11
|
.string()
|
|
@@ -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 createHouseFromBriefInput: {
|
|
5
5
|
brief: z.ZodString;
|
|
6
6
|
projectId: z.ZodOptional<z.ZodString>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { cloneSceneGraph } from '@pascal-app/core/clone-scene-graph';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { rehydrateSiteChildren } from '../../lib/rehydrate-site-children';
|
|
4
|
-
import { isTemplateId, TEMPLATES } from '../../templates';
|
|
5
|
-
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from '../annotations';
|
|
6
|
-
import { ErrorCode, throwMcpError } from '../errors';
|
|
7
|
-
import { appendLiveSceneEvent } from '../live-sync';
|
|
8
|
-
import { currentLevelContext, sceneMetaPayload } from '../scene-lifecycle/metadata';
|
|
3
|
+
import { rehydrateSiteChildren } from '../../lib/rehydrate-site-children.js';
|
|
4
|
+
import { isTemplateId, TEMPLATES } from '../../templates/index.js';
|
|
5
|
+
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from '../annotations.js';
|
|
6
|
+
import { ErrorCode, throwMcpError } from '../errors.js';
|
|
7
|
+
import { appendLiveSceneEvent } from '../live-sync.js';
|
|
8
|
+
import { currentLevelContext, sceneMetaPayload } from '../scene-lifecycle/metadata.js';
|
|
9
9
|
export const createHouseFromBriefInput = {
|
|
10
10
|
brief: z.string().min(1),
|
|
11
11
|
projectId: z.string().optional(),
|
|
@@ -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 template MCP tools (`list_templates`, `create_from_template`)
|
|
5
5
|
* against the given server.
|
|
@@ -8,7 +8,7 @@ import type { SceneOperations } from '../../operations';
|
|
|
8
8
|
* applies the template to the bridge but skips the save step.
|
|
9
9
|
*/
|
|
10
10
|
export declare function registerTemplateTools(server: McpServer, bridge: SceneOperations): void;
|
|
11
|
-
export { createFromTemplateInput, createFromTemplateOutput, registerCreateFromTemplate, } from './create-from-template';
|
|
12
|
-
export { createHouseFromBriefInput, createHouseFromBriefOutput, registerCreateHouseFromBrief, } from './create-house-from-brief';
|
|
13
|
-
export { listTemplatesInput, listTemplatesOutput, registerListTemplates, } from './list-templates';
|
|
11
|
+
export { createFromTemplateInput, createFromTemplateOutput, registerCreateFromTemplate, } from './create-from-template.js';
|
|
12
|
+
export { createHouseFromBriefInput, createHouseFromBriefOutput, registerCreateHouseFromBrief, } from './create-house-from-brief.js';
|
|
13
|
+
export { listTemplatesInput, listTemplatesOutput, registerListTemplates, } from './list-templates.js';
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { registerCreateFromTemplate } from './create-from-template';
|
|
2
|
-
import { registerCreateHouseFromBrief } from './create-house-from-brief';
|
|
3
|
-
import { registerListTemplates } from './list-templates';
|
|
1
|
+
import { registerCreateFromTemplate } from './create-from-template.js';
|
|
2
|
+
import { registerCreateHouseFromBrief } from './create-house-from-brief.js';
|
|
3
|
+
import { registerListTemplates } from './list-templates.js';
|
|
4
4
|
/**
|
|
5
5
|
* Register the template MCP tools (`list_templates`, `create_from_template`)
|
|
6
6
|
* against the given server.
|
|
@@ -13,6 +13,6 @@ export function registerTemplateTools(server, bridge) {
|
|
|
13
13
|
registerCreateFromTemplate(server, bridge);
|
|
14
14
|
registerCreateHouseFromBrief(server, bridge);
|
|
15
15
|
}
|
|
16
|
-
export { createFromTemplateInput, createFromTemplateOutput, registerCreateFromTemplate, } from './create-from-template';
|
|
17
|
-
export { createHouseFromBriefInput, createHouseFromBriefOutput, registerCreateHouseFromBrief, } from './create-house-from-brief';
|
|
18
|
-
export { listTemplatesInput, listTemplatesOutput, registerListTemplates, } from './list-templates';
|
|
16
|
+
export { createFromTemplateInput, createFromTemplateOutput, registerCreateFromTemplate, } from './create-from-template.js';
|
|
17
|
+
export { createHouseFromBriefInput, createHouseFromBriefOutput, registerCreateHouseFromBrief, } from './create-house-from-brief.js';
|
|
18
|
+
export { listTemplatesInput, listTemplatesOutput, registerListTemplates, } from './list-templates.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { TEMPLATES } from '../../templates';
|
|
3
|
-
import { READ_ONLY_TOOL_ANNOTATIONS } from '../annotations';
|
|
2
|
+
import { TEMPLATES } from '../../templates/index.js';
|
|
3
|
+
import { READ_ONLY_TOOL_ANNOTATIONS } from '../annotations.js';
|
|
4
4
|
export const listTemplatesInput = {};
|
|
5
5
|
export const listTemplatesOutput = {
|
|
6
6
|
templates: z.array(z.object({
|
package/dist/tools/undo.d.ts
CHANGED
|
@@ -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 undoInput: {
|
|
5
5
|
steps: z.ZodOptional<z.ZodNumber>;
|
|
6
6
|
};
|
package/dist/tools/undo.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from './annotations';
|
|
3
|
-
import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync';
|
|
2
|
+
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from './annotations.js';
|
|
3
|
+
import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync.js';
|
|
4
4
|
export const undoInput = {
|
|
5
5
|
steps: z.number().int().positive().optional(),
|
|
6
6
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ZoneNode } from '@pascal-app/core/schema';
|
|
2
|
+
import type { SceneOperations } from '../operations/index.js';
|
|
3
|
+
export declare function validateUnitMembers(bridge: SceneOperations, buildingId: string, memberZoneIds: string[]): ZoneNode['id'][];
|
|
4
|
+
//# sourceMappingURL=unit-members.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unit-members.d.ts","sourceRoot":"","sources":["../../src/tools/unit-members.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAa,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAGpD,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,eAAe,EACvB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EAAE,GACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,CA6BlB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ErrorCode, throwMcpError } from './errors.js';
|
|
2
|
+
export function validateUnitMembers(bridge, buildingId, memberZoneIds) {
|
|
3
|
+
const building = bridge.getNode(buildingId);
|
|
4
|
+
if (!building) {
|
|
5
|
+
throwMcpError(ErrorCode.InvalidParams, `Building not found: ${buildingId}`);
|
|
6
|
+
}
|
|
7
|
+
if (building.type !== 'building') {
|
|
8
|
+
throwMcpError(ErrorCode.InvalidParams, `Node ${buildingId} is a ${building.type}, expected building`);
|
|
9
|
+
}
|
|
10
|
+
return memberZoneIds.map((zoneId) => {
|
|
11
|
+
const zone = bridge.getNode(zoneId);
|
|
12
|
+
if (!zone) {
|
|
13
|
+
throwMcpError(ErrorCode.InvalidParams, `Zone not found: ${zoneId}`);
|
|
14
|
+
}
|
|
15
|
+
if (zone.type !== 'zone') {
|
|
16
|
+
throwMcpError(ErrorCode.InvalidParams, `Node ${zoneId} is a ${zone.type}, expected zone`);
|
|
17
|
+
}
|
|
18
|
+
const [, level, parent] = bridge.getAncestry(zone.id);
|
|
19
|
+
if (level?.type !== 'level' || parent?.id !== building.id) {
|
|
20
|
+
throwMcpError(ErrorCode.InvalidParams, `Zone ${zoneId} must belong to a level in building ${buildingId}`);
|
|
21
|
+
}
|
|
22
|
+
return zone.id;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -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 validateSceneInput: {};
|
|
5
5
|
export declare const validateSceneOutput: {
|
|
6
6
|
valid: z.ZodBoolean;
|