@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
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { WallNode } 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 { measurement } from './measurement';
|
|
7
|
-
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 { measurement } from './measurement.js';
|
|
7
|
+
import { NodeIdSchema, Vec2Schema } from './schemas.js';
|
|
8
8
|
export const createWallInput = {
|
|
9
9
|
levelId: NodeIdSchema,
|
|
10
10
|
start: Vec2Schema,
|
|
@@ -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 cutOpeningInput: {
|
|
5
5
|
wallId: z.ZodString;
|
|
6
6
|
type: z.ZodEnum<{
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DoorNode, WindowNode } 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 { wallLength, wallLocalXFromT } from './geometry';
|
|
6
|
-
import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync';
|
|
7
|
-
import { measurement } from './measurement';
|
|
8
|
-
import { NodeIdSchema } from './schemas';
|
|
3
|
+
import { ADDITIVE_TOOL_ANNOTATIONS } from './annotations.js';
|
|
4
|
+
import { ErrorCode, throwMcpError } from './errors.js';
|
|
5
|
+
import { wallLength, wallLocalXFromT } from './geometry.js';
|
|
6
|
+
import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync.js';
|
|
7
|
+
import { measurement } from './measurement.js';
|
|
8
|
+
import { NodeIdSchema } from './schemas.js';
|
|
9
9
|
export const cutOpeningInput = {
|
|
10
10
|
wallId: NodeIdSchema,
|
|
11
11
|
type: z.enum(['door', 'window']),
|
|
@@ -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 deleteNodeInput: {
|
|
5
5
|
id: z.ZodString;
|
|
6
6
|
cascade: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from './annotations';
|
|
3
|
-
import { ErrorCode, throwMcpError } from './errors';
|
|
4
|
-
import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync';
|
|
5
|
-
import { NodeIdSchema } from './schemas';
|
|
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
6
|
export const deleteNodeInput = {
|
|
7
7
|
id: NodeIdSchema,
|
|
8
8
|
cascade: z.boolean().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 describeNodeInput: {
|
|
5
5
|
id: z.ZodString;
|
|
6
6
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { resolveCeilingHeight } from '@pascal-app/core';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { READ_ONLY_TOOL_ANNOTATIONS } from './annotations';
|
|
4
|
-
import { ErrorCode, throwMcpError } from './errors';
|
|
5
|
-
import { resolveReportedWallHeight } from './scene-query';
|
|
6
|
-
import { NodeIdSchema } from './schemas';
|
|
3
|
+
import { READ_ONLY_TOOL_ANNOTATIONS } from './annotations.js';
|
|
4
|
+
import { ErrorCode, throwMcpError } from './errors.js';
|
|
5
|
+
import { resolveReportedWallHeight } from './scene-query.js';
|
|
6
|
+
import { NodeIdSchema } from './schemas.js';
|
|
7
7
|
export const describeNodeInput = {
|
|
8
8
|
id: NodeIdSchema,
|
|
9
9
|
};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* See docs/layout-clearance-error-log.md for pitfalls (levels, gap sign, scale).
|
|
8
8
|
*/
|
|
9
9
|
import { type AnyNode } from '@pascal-app/core/schema';
|
|
10
|
-
import { type Vec2 } from './geometry';
|
|
10
|
+
import { type Vec2 } from './geometry.js';
|
|
11
11
|
export type PlanAabb = {
|
|
12
12
|
minX: number;
|
|
13
13
|
maxX: number;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* See docs/layout-clearance-error-log.md for pitfalls (levels, gap sign, scale).
|
|
8
8
|
*/
|
|
9
9
|
import { getScaledDimensions } from '@pascal-app/core/schema';
|
|
10
|
-
import { wallLength } from './geometry';
|
|
10
|
+
import { wallLength } from './geometry.js';
|
|
11
11
|
/** Plan depth (m) cleared on each side of the wall face through the opening. */
|
|
12
12
|
export const DEFAULT_DOOR_CLEAR_DEPTH = 0.65;
|
|
13
13
|
/** Extra half-width (m) beyond the door leaf along the wall. */
|
|
@@ -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 duplicateLevelInput: {
|
|
5
5
|
levelId: z.ZodString;
|
|
6
6
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { cloneLevelSubtree } from '@pascal-app/core/clone-scene-graph';
|
|
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 } 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 } from './schemas.js';
|
|
7
7
|
export const duplicateLevelInput = {
|
|
8
8
|
levelId: NodeIdSchema,
|
|
9
9
|
};
|
|
@@ -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 exportGlbInput: {};
|
|
5
5
|
export declare const exportGlbOutput: {
|
|
6
6
|
status: z.ZodLiteral<"not_implemented">;
|
package/dist/tools/export-glb.js
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 exportJsonInput: {
|
|
5
5
|
pretty: z.ZodOptional<z.ZodBoolean>;
|
|
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 findNodesInput: {
|
|
5
5
|
type: z.ZodOptional<z.ZodEnum<{
|
|
6
6
|
site: "site";
|
package/dist/tools/find-nodes.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { pointInPolygon } from '@pascal-app/core/spatial-grid';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { READ_ONLY_TOOL_ANNOTATIONS } from './annotations';
|
|
4
|
-
import { NodeIdSchema } from './schemas';
|
|
3
|
+
import { READ_ONLY_TOOL_ANNOTATIONS } from './annotations.js';
|
|
4
|
+
import { NodeIdSchema } from './schemas.js';
|
|
5
5
|
const ALL_NODE_TYPES = [
|
|
6
6
|
'site',
|
|
7
7
|
'building',
|
package/dist/tools/get-node.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 getNodeInput: {
|
|
5
5
|
id: z.ZodString;
|
|
6
6
|
};
|
package/dist/tools/get-node.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { READ_ONLY_TOOL_ANNOTATIONS } from './annotations';
|
|
3
|
-
import { ErrorCode, throwMcpError } from './errors';
|
|
4
|
-
import { NodeIdSchema } from './schemas';
|
|
2
|
+
import { READ_ONLY_TOOL_ANNOTATIONS } from './annotations.js';
|
|
3
|
+
import { ErrorCode, throwMcpError } from './errors.js';
|
|
4
|
+
import { NodeIdSchema } from './schemas.js';
|
|
5
5
|
export const getNodeInput = {
|
|
6
6
|
id: NodeIdSchema,
|
|
7
7
|
};
|
|
@@ -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 getSceneInput: {};
|
|
5
5
|
export declare const getSceneOutput: {
|
|
6
6
|
nodes: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
package/dist/tools/get-scene.js
CHANGED
package/dist/tools/index.d.ts
CHANGED
|
@@ -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 every non-vision MCP tool against the given server.
|
|
5
5
|
* Vision tools (analyze_floorplan_image, analyze_room_photo) are registered
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AA+BpD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,GAAG,IAAI,CAgClF"}
|
package/dist/tools/index.js
CHANGED
|
@@ -1,29 +1,32 @@
|
|
|
1
|
-
import { registerApplyPatch } from './apply-patch';
|
|
2
|
-
import { registerCheckCollisions } from './check-collisions';
|
|
3
|
-
import { registerConstructionTools } from './construction-tools';
|
|
4
|
-
import { registerCreateLevel } from './create-level';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
1
|
+
import { registerApplyPatch } from './apply-patch.js';
|
|
2
|
+
import { registerCheckCollisions } from './check-collisions.js';
|
|
3
|
+
import { registerConstructionTools } from './construction-tools.js';
|
|
4
|
+
import { registerCreateLevel } from './create-level.js';
|
|
5
|
+
import { registerCreateUnit } from './create-unit.js';
|
|
6
|
+
import { registerCreateWall } from './create-wall.js';
|
|
7
|
+
import { registerCutOpening } from './cut-opening.js';
|
|
8
|
+
import { registerDeleteNode } from './delete-node.js';
|
|
9
|
+
import { registerDescribeNode } from './describe-node.js';
|
|
10
|
+
import { registerDuplicateLevel } from './duplicate-level.js';
|
|
11
|
+
import { registerExportGlb } from './export-glb.js';
|
|
12
|
+
import { registerExportJson } from './export-json.js';
|
|
13
|
+
import { registerFindNodes } from './find-nodes.js';
|
|
14
|
+
import { registerGetNode } from './get-node.js';
|
|
15
|
+
import { registerGetScene } from './get-scene.js';
|
|
16
|
+
import { registerListUnits } from './list-units.js';
|
|
17
|
+
import { registerMeasure } from './measure.js';
|
|
18
|
+
import { registerPhotoToSceneTool } from './photo-to-scene/index.js';
|
|
19
|
+
import { registerPlaceItem } from './place-item.js';
|
|
20
|
+
import { registerRedo } from './redo.js';
|
|
21
|
+
import { registerRoomTools } from './room-tools.js';
|
|
22
|
+
import { registerSceneLifecycleTools } from './scene-lifecycle/index.js';
|
|
23
|
+
import { registerSceneQueryTools } from './scene-query.js';
|
|
24
|
+
import { registerSetUnitMembers } from './set-unit-members.js';
|
|
25
|
+
import { registerSetZone } from './set-zone.js';
|
|
26
|
+
import { registerTemplateTools } from './templates/index.js';
|
|
27
|
+
import { registerUndo } from './undo.js';
|
|
28
|
+
import { registerValidateScene } from './validate-scene.js';
|
|
29
|
+
import { registerVariantTools } from './variants/index.js';
|
|
27
30
|
/**
|
|
28
31
|
* Register every non-vision MCP tool against the given server.
|
|
29
32
|
* Vision tools (analyze_floorplan_image, analyze_room_photo) are registered
|
|
@@ -43,6 +46,9 @@ export function registerTools(server, operations) {
|
|
|
43
46
|
registerRoomTools(server, operations);
|
|
44
47
|
registerApplyPatch(server, operations);
|
|
45
48
|
registerCreateLevel(server, operations);
|
|
49
|
+
registerCreateUnit(server, operations);
|
|
50
|
+
registerSetUnitMembers(server, operations);
|
|
51
|
+
registerListUnits(server, operations);
|
|
46
52
|
registerCreateWall(server, operations);
|
|
47
53
|
registerPlaceItem(server, operations);
|
|
48
54
|
registerCutOpening(server, operations);
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* See docs/layout-clearance-error-log.md for regression checklist.
|
|
9
9
|
*/
|
|
10
10
|
import type { AnyNode } from '@pascal-app/core/schema';
|
|
11
|
-
import { type PlanAabb } from './door-clearance';
|
|
12
|
-
export { aabbsOverlap, collectDoorKeepouts, findBlockedDoors, itemNodePlanAabb, itemPlanAabb, type PlanAabb, resolveNodeLevelId, } from './door-clearance';
|
|
11
|
+
import { type PlanAabb } from './door-clearance.js';
|
|
12
|
+
export { aabbsOverlap, collectDoorKeepouts, findBlockedDoors, itemNodePlanAabb, itemPlanAabb, type PlanAabb, resolveNodeLevelId, } from './door-clearance.js';
|
|
13
13
|
/** Minimum free space (m) required between item footprints. */
|
|
14
14
|
export declare const DEFAULT_ITEM_GAP = 0.08;
|
|
15
15
|
export type OccupiedFootprint = {
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*
|
|
8
8
|
* See docs/layout-clearance-error-log.md for regression checklist.
|
|
9
9
|
*/
|
|
10
|
-
import { aabbsOverlap, findBlockedDoors, itemNodePlanAabb, itemPlanAabb, resolveNodeLevelId, } from './door-clearance';
|
|
11
|
-
export { aabbsOverlap, collectDoorKeepouts, findBlockedDoors, itemNodePlanAabb, itemPlanAabb, resolveNodeLevelId, } from './door-clearance';
|
|
10
|
+
import { aabbsOverlap, findBlockedDoors, itemNodePlanAabb, itemPlanAabb, resolveNodeLevelId, } from './door-clearance.js';
|
|
11
|
+
export { aabbsOverlap, collectDoorKeepouts, findBlockedDoors, itemNodePlanAabb, itemPlanAabb, resolveNodeLevelId, } from './door-clearance.js';
|
|
12
12
|
/** Minimum free space (m) required between item footprints. */
|
|
13
13
|
export const DEFAULT_ITEM_GAP = 0.08;
|
|
14
14
|
export function nodeItemAabb(node) {
|
|
@@ -0,0 +1,38 @@
|
|
|
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 listUnitsInput: {
|
|
5
|
+
buildingId: z.ZodOptional<z.ZodString>;
|
|
6
|
+
};
|
|
7
|
+
export declare const listUnitsOutput: {
|
|
8
|
+
units: z.ZodArray<z.ZodObject<{
|
|
9
|
+
unitId: z.ZodString;
|
|
10
|
+
name: z.ZodString;
|
|
11
|
+
kind: z.ZodDefault<z.ZodEnum<{
|
|
12
|
+
apartment: "apartment";
|
|
13
|
+
"hotel-room": "hotel-room";
|
|
14
|
+
commercial: "commercial";
|
|
15
|
+
common: "common";
|
|
16
|
+
}>>;
|
|
17
|
+
color: z.ZodString;
|
|
18
|
+
members: z.ZodArray<z.ZodString>;
|
|
19
|
+
report: z.ZodObject<{
|
|
20
|
+
memberCount: z.ZodNumber;
|
|
21
|
+
levelSpan: z.ZodNullable<z.ZodObject<{
|
|
22
|
+
minOrdinal: z.ZodNumber;
|
|
23
|
+
maxOrdinal: z.ZodNumber;
|
|
24
|
+
count: z.ZodNumber;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
grossAreaM2: z.ZodNumber;
|
|
27
|
+
members: z.ZodArray<z.ZodObject<{
|
|
28
|
+
zoneId: z.ZodString;
|
|
29
|
+
name: z.ZodString;
|
|
30
|
+
levelId: z.ZodNullable<z.ZodString>;
|
|
31
|
+
levelOrdinal: z.ZodNullable<z.ZodNumber>;
|
|
32
|
+
areaM2: z.ZodNumber;
|
|
33
|
+
}, z.core.$strip>>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
};
|
|
37
|
+
export declare function registerListUnits(server: McpServer, bridge: SceneOperations): void;
|
|
38
|
+
//# sourceMappingURL=list-units.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-units.d.ts","sourceRoot":"","sources":["../../src/tools/list-units.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;AAKpD,eAAO,MAAM,cAAc;;CAE1B,CAAA;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0B3B,CAAA;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAgClF"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { buildUnitReport } from '@pascal-app/core';
|
|
2
|
+
import { UnitNode } from '@pascal-app/core/schema';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { READ_ONLY_TOOL_ANNOTATIONS } from './annotations.js';
|
|
5
|
+
import { NodeIdSchema } from './schemas.js';
|
|
6
|
+
import { validateUnitMembers } from './unit-members.js';
|
|
7
|
+
export const listUnitsInput = {
|
|
8
|
+
buildingId: NodeIdSchema.optional(),
|
|
9
|
+
};
|
|
10
|
+
export const listUnitsOutput = {
|
|
11
|
+
units: z.array(z.object({
|
|
12
|
+
unitId: z.string(),
|
|
13
|
+
name: z.string(),
|
|
14
|
+
kind: UnitNode.shape.kind,
|
|
15
|
+
color: z.string(),
|
|
16
|
+
members: z.array(z.string()),
|
|
17
|
+
report: z.object({
|
|
18
|
+
memberCount: z.number(),
|
|
19
|
+
levelSpan: z
|
|
20
|
+
.object({ minOrdinal: z.number(), maxOrdinal: z.number(), count: z.number() })
|
|
21
|
+
.nullable(),
|
|
22
|
+
grossAreaM2: z.number(),
|
|
23
|
+
members: z.array(z.object({
|
|
24
|
+
zoneId: z.string(),
|
|
25
|
+
name: z.string(),
|
|
26
|
+
levelId: z.string().nullable(),
|
|
27
|
+
levelOrdinal: z.number().nullable(),
|
|
28
|
+
areaM2: z.number(),
|
|
29
|
+
})),
|
|
30
|
+
}),
|
|
31
|
+
})),
|
|
32
|
+
};
|
|
33
|
+
export function registerListUnits(server, bridge) {
|
|
34
|
+
server.registerTool('list_units', {
|
|
35
|
+
title: 'List units',
|
|
36
|
+
description: 'List units with their member zones and current area reports, optionally filtered by building.',
|
|
37
|
+
inputSchema: listUnitsInput,
|
|
38
|
+
outputSchema: listUnitsOutput,
|
|
39
|
+
annotations: READ_ONLY_TOOL_ANNOTATIONS,
|
|
40
|
+
}, async ({ buildingId }) => {
|
|
41
|
+
if (buildingId !== undefined)
|
|
42
|
+
validateUnitMembers(bridge, buildingId, []);
|
|
43
|
+
const nodes = bridge.getNodes();
|
|
44
|
+
const units = Object.values(nodes)
|
|
45
|
+
.filter((node) => node.type === 'unit')
|
|
46
|
+
.filter((unit) => buildingId === undefined || unit.parentId === buildingId)
|
|
47
|
+
.map((unit) => ({
|
|
48
|
+
unitId: unit.id,
|
|
49
|
+
name: unit.name,
|
|
50
|
+
kind: unit.kind,
|
|
51
|
+
color: unit.color,
|
|
52
|
+
members: unit.members,
|
|
53
|
+
report: buildUnitReport(unit, nodes),
|
|
54
|
+
}));
|
|
55
|
+
const payload = { units };
|
|
56
|
+
return {
|
|
57
|
+
content: [{ type: 'text', text: JSON.stringify(payload) }],
|
|
58
|
+
structuredContent: payload,
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SceneGraph } from '@pascal-app/core/clone-scene-graph';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import type { SceneOperations } from '../operations';
|
|
3
|
+
import type { SceneOperations } from '../operations/index.js';
|
|
4
4
|
export declare function syncDerivedStairOpenings(operations: SceneOperations): number;
|
|
5
5
|
export type LiveSyncStatus = 'published' | 'unbound' | 'events_unsupported';
|
|
6
6
|
type LiveSyncSkip = Exclude<LiveSyncStatus, 'published'>;
|
package/dist/tools/live-sync.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { syncAutoStairOpenings } from '@pascal-app/core/stair-openings';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { SceneVersionConflictError } from '../storage/types';
|
|
4
|
-
import { ErrorCode, throwMcpError } from './errors';
|
|
3
|
+
import { SceneVersionConflictError } from '../storage/types.js';
|
|
4
|
+
import { ErrorCode, throwMcpError } from './errors.js';
|
|
5
5
|
export function syncDerivedStairOpenings(operations) {
|
|
6
6
|
const updates = syncAutoStairOpenings(operations.getNodes());
|
|
7
7
|
if (updates.length === 0)
|
package/dist/tools/measure.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 measureInput: {
|
|
5
5
|
fromId: z.ZodString;
|
|
6
6
|
toId: z.ZodString;
|
package/dist/tools/measure.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { READ_ONLY_TOOL_ANNOTATIONS } from './annotations';
|
|
3
|
-
import { ErrorCode, throwMcpError } from './errors';
|
|
4
|
-
import { NodeIdSchema } from './schemas';
|
|
2
|
+
import { READ_ONLY_TOOL_ANNOTATIONS } from './annotations.js';
|
|
3
|
+
import { ErrorCode, throwMcpError } from './errors.js';
|
|
4
|
+
import { NodeIdSchema } from './schemas.js';
|
|
5
5
|
export const measureInput = {
|
|
6
6
|
fromId: NodeIdSchema,
|
|
7
7
|
toId: NodeIdSchema,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-schema-dialect.d.ts","sourceRoot":"","sources":["../../src/tools/normalize-schema-dialect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAuBxE,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAWlE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ListToolsRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
const DIALECT_2020_12 = 'https://json-schema.org/draft/2020-12/schema';
|
|
3
|
+
function retargetDialect(value) {
|
|
4
|
+
if (Array.isArray(value)) {
|
|
5
|
+
for (const item of value)
|
|
6
|
+
retargetDialect(item);
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
if (value && typeof value === 'object') {
|
|
10
|
+
const record = value;
|
|
11
|
+
if (typeof record.$schema === 'string')
|
|
12
|
+
record.$schema = DIALECT_2020_12;
|
|
13
|
+
for (const key of Object.keys(record))
|
|
14
|
+
retargetDialect(record[key]);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export function normalizeToolSchemaDialect(server) {
|
|
18
|
+
const registry = server.server;
|
|
19
|
+
const original = registry._requestHandlers.get('tools/list');
|
|
20
|
+
if (!original)
|
|
21
|
+
return;
|
|
22
|
+
server.server.removeRequestHandler('tools/list');
|
|
23
|
+
server.server.setRequestHandler(ListToolsRequestSchema, async (request, extra) => {
|
|
24
|
+
const result = (await original(request, extra));
|
|
25
|
+
retargetDialect(result.tools);
|
|
26
|
+
return result;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -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,9 +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 { DESTRUCTIVE_OPEN_WORLD_TOOL_ANNOTATIONS } from '../annotations';
|
|
5
|
-
import { appendLiveSceneEvent } from '../live-sync';
|
|
6
|
-
import { measurement } from '../measurement';
|
|
4
|
+
import { DESTRUCTIVE_OPEN_WORLD_TOOL_ANNOTATIONS } from '../annotations.js';
|
|
5
|
+
import { appendLiveSceneEvent } from '../live-sync.js';
|
|
6
|
+
import { measurement } from '../measurement.js';
|
|
7
7
|
/**
|
|
8
8
|
* Input shape for the `photo_to_scene` orchestrator. `image` matches the
|
|
9
9
|
* contract documented on `analyze_floorplan_image` — base64 or http(s) URL.
|
|
@@ -83,7 +83,7 @@ const DATA_URI_RE = /^data:(image\/[a-z0-9.+-]+);base64,(.+)$/i;
|
|
|
83
83
|
async function resolveImageBlock(image) {
|
|
84
84
|
if (/^https?:\/\//i.test(image)) {
|
|
85
85
|
// SSRF-safe fetch (see packages/mcp/src/lib/safe-fetch.ts).
|
|
86
|
-
const { safeFetch } = await import('../../lib/safe-fetch');
|
|
86
|
+
const { safeFetch } = await import('../../lib/safe-fetch.js');
|
|
87
87
|
const res = await safeFetch(image, { accept: 'image/*' });
|
|
88
88
|
const data = res.buffer.toString('base64');
|
|
89
89
|
const mimeType = res.contentType ?? 'image/jpeg';
|
|
@@ -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;
|
package/dist/tools/place-item.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ItemNode } from '@pascal-app/core/schema';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { ADDITIVE_TOOL_ANNOTATIONS } from './annotations';
|
|
4
|
-
import { findCatalogItem } from './asset-catalog';
|
|
5
|
-
import { ErrorCode, throwMcpError } from './errors';
|
|
6
|
-
import { projectWorldPointToWallLocalX, wallLength } from './geometry';
|
|
7
|
-
import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync';
|
|
8
|
-
import { measurement } from './measurement';
|
|
9
|
-
import { NodeIdSchema, Vec3Schema } from './schemas';
|
|
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';
|
|
10
10
|
export const placeItemInput = {
|
|
11
11
|
catalogItemId: z.string().min(1),
|
|
12
12
|
targetNodeId: NodeIdSchema,
|