@pascal-app/mcp 1.0.3 → 1.0.5
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 +76 -0
- package/README.md +181 -56
- package/dist/bin/pascal-mcp.js +9 -3
- package/dist/bridge/agent-session.d.ts +18 -0
- package/dist/bridge/agent-session.d.ts.map +1 -0
- package/dist/bridge/agent-session.js +15 -0
- package/dist/bridge/index.d.ts +1 -1
- package/dist/bridge/index.d.ts.map +1 -1
- package/dist/bridge/scene-bridge.d.ts +42 -6
- package/dist/bridge/scene-bridge.d.ts.map +1 -1
- package/dist/bridge/scene-bridge.js +232 -45
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/lib/safe-fetch.d.ts +22 -4
- package/dist/lib/safe-fetch.d.ts.map +1 -1
- package/dist/lib/safe-fetch.js +233 -134
- package/dist/operations/scene-operations.d.ts +41 -3
- package/dist/operations/scene-operations.d.ts.map +1 -1
- package/dist/operations/scene-operations.js +42 -1
- 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 +3 -3
- package/dist/prompts/index.d.ts +1 -1
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/iterate-on-feedback.d.ts +1 -1
- package/dist/prompts/iterate-on-feedback.d.ts.map +1 -1
- package/dist/prompts/iterate-on-feedback.js +3 -3
- package/dist/prompts/renovation-from-photos.d.ts +1 -1
- package/dist/prompts/renovation-from-photos.d.ts.map +1 -1
- package/dist/prompts/renovation-from-photos.js +2 -2
- package/dist/prompts/scene-guidance.d.ts.map +1 -1
- package/dist/prompts/scene-guidance.js +13 -6
- 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 +62 -33
- package/dist/resources/catalog-items.d.ts +5 -6
- package/dist/resources/catalog-items.d.ts.map +1 -1
- package/dist/resources/catalog-items.js +7 -9
- package/dist/resources/constraints.d.ts +1 -1
- package/dist/resources/constraints.d.ts.map +1 -1
- package/dist/resources/constraints.js +1 -1
- package/dist/resources/design-schema.d.ts +9 -0
- package/dist/resources/design-schema.d.ts.map +1 -0
- package/dist/resources/design-schema.js +21 -0
- package/dist/resources/index.d.ts +4 -2
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +5 -2
- package/dist/resources/scene-current.d.ts +1 -1
- package/dist/resources/scene-current.d.ts.map +1 -1
- package/dist/resources/scene-summary.d.ts +1 -1
- package/dist/resources/scene-summary.d.ts.map +1 -1
- package/dist/server.d.ts +25 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +71 -25
- package/dist/storage/disk-artifact-store.d.ts +9 -0
- package/dist/storage/disk-artifact-store.d.ts.map +1 -0
- package/dist/storage/disk-artifact-store.js +46 -0
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +1 -0
- package/dist/storage/sqlite-scene-store.d.ts +3 -3
- package/dist/storage/sqlite-scene-store.d.ts.map +1 -1
- package/dist/storage/sqlite-scene-store.js +4 -3
- package/dist/storage/types.d.ts +36 -7
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/storage/types.js +12 -0
- package/dist/templates/empty-studio.d.ts +3 -3
- package/dist/templates/empty-studio.d.ts.map +1 -1
- package/dist/templates/garden-house.d.ts +3 -3
- package/dist/templates/garden-house.d.ts.map +1 -1
- package/dist/templates/index.d.ts.map +1 -1
- package/dist/templates/two-bedroom.d.ts +3 -3
- package/dist/templates/two-bedroom.d.ts.map +1 -1
- package/dist/tools/add-column.d.ts +5 -0
- package/dist/tools/add-column.d.ts.map +1 -0
- package/dist/tools/add-column.js +59 -0
- package/dist/tools/add-object.d.ts +76 -0
- package/dist/tools/add-object.d.ts.map +1 -0
- package/dist/tools/add-object.js +187 -0
- package/dist/tools/annotations.d.ts.map +1 -1
- package/dist/tools/apply-patch.d.ts +9 -2
- package/dist/tools/apply-patch.d.ts.map +1 -1
- package/dist/tools/apply-patch.js +36 -5
- package/dist/tools/asset-catalog.d.ts +9 -5
- package/dist/tools/asset-catalog.d.ts.map +1 -1
- package/dist/tools/asset-catalog.js +33 -12
- package/dist/tools/author-scene.d.ts +10 -0
- package/dist/tools/author-scene.d.ts.map +1 -0
- package/dist/tools/author-scene.js +140 -0
- package/dist/tools/check-collisions.d.ts +7 -7
- package/dist/tools/check-collisions.d.ts.map +1 -1
- package/dist/tools/check-collisions.js +7 -8
- package/dist/tools/clear-scene.d.ts +9 -0
- package/dist/tools/clear-scene.d.ts.map +1 -0
- package/dist/tools/clear-scene.js +59 -0
- package/dist/tools/collections.d.ts +4 -0
- package/dist/tools/collections.d.ts.map +1 -0
- package/dist/tools/collections.js +53 -0
- package/dist/tools/construction-tools.d.ts +12 -88
- package/dist/tools/construction-tools.d.ts.map +1 -1
- package/dist/tools/construction-tools.js +122 -381
- package/dist/tools/create-unit.d.ts +5 -3
- package/dist/tools/create-unit.d.ts.map +1 -1
- package/dist/tools/create-unit.js +2 -2
- package/dist/tools/errors.d.ts +15 -4
- package/dist/tools/errors.d.ts.map +1 -1
- package/dist/tools/errors.js +14 -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 +2 -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 -2
- package/dist/tools/geometry-script-worker.d.ts +2 -0
- package/dist/tools/geometry-script-worker.d.ts.map +1 -0
- package/dist/tools/geometry-script-worker.js +21 -0
- package/dist/tools/get-scene.d.ts +2 -1
- package/dist/tools/get-scene.d.ts.map +1 -1
- package/dist/tools/get-scene.js +5 -3
- package/dist/tools/honest-patch-guard.d.ts +2 -0
- package/dist/tools/honest-patch-guard.d.ts.map +1 -0
- package/dist/tools/honest-patch-guard.js +32 -0
- package/dist/tools/hosted-services.d.ts +4 -0
- package/dist/tools/hosted-services.d.ts.map +1 -0
- package/dist/tools/hosted-services.js +40 -0
- package/dist/tools/index.d.ts +12 -2
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +18 -32
- package/dist/tools/level-height-guard.d.ts +2 -0
- package/dist/tools/level-height-guard.d.ts.map +1 -0
- package/dist/tools/level-height-guard.js +11 -0
- package/dist/tools/list-units.d.ts +2 -2
- package/dist/tools/list-units.d.ts.map +1 -1
- package/dist/tools/list-units.js +2 -2
- package/dist/tools/live-sync.d.ts +25 -6
- package/dist/tools/live-sync.d.ts.map +1 -1
- package/dist/tools/live-sync.js +48 -27
- package/dist/tools/local-geometry-scripts.d.ts +8 -0
- package/dist/tools/local-geometry-scripts.d.ts.map +1 -0
- package/dist/tools/local-geometry-scripts.js +67 -0
- package/dist/tools/measure.d.ts +7 -1
- package/dist/tools/measure.d.ts.map +1 -1
- package/dist/tools/measure.js +38 -70
- package/dist/tools/measurement.d.ts +1 -36
- package/dist/tools/measurement.d.ts.map +1 -1
- package/dist/tools/measurement.js +2 -94
- package/dist/tools/node-world-point.d.ts +37 -0
- package/dist/tools/node-world-point.d.ts.map +1 -0
- package/dist/tools/node-world-point.js +457 -0
- package/dist/tools/normalize-schema-dialect.d.ts +1 -1
- package/dist/tools/normalize-schema-dialect.d.ts.map +1 -1
- package/dist/tools/normalize-schema-dialect.js +22 -3
- package/dist/tools/patch-guards.d.ts +60 -0
- package/dist/tools/patch-guards.d.ts.map +1 -0
- package/dist/tools/patch-guards.js +256 -0
- package/dist/tools/photo-to-scene/index.d.ts +1 -1
- package/dist/tools/photo-to-scene/index.d.ts.map +1 -1
- package/dist/tools/photo-to-scene/photo-to-scene.d.ts +3 -3
- package/dist/tools/photo-to-scene/photo-to-scene.d.ts.map +1 -1
- package/dist/tools/photo-to-scene/photo-to-scene.js +10 -9
- package/dist/tools/project-files.d.ts +4 -0
- package/dist/tools/project-files.d.ts.map +1 -0
- package/dist/tools/project-files.js +30 -0
- package/dist/tools/redo.d.ts +4 -2
- package/dist/tools/redo.d.ts.map +1 -1
- package/dist/tools/redo.js +4 -4
- package/dist/tools/retired-tools.d.ts +10 -0
- package/dist/tools/retired-tools.d.ts.map +1 -0
- package/dist/tools/retired-tools.js +22 -0
- package/dist/tools/roof-level-guard.d.ts +2 -0
- package/dist/tools/roof-level-guard.d.ts.map +1 -0
- package/dist/tools/roof-level-guard.js +22 -0
- package/dist/tools/room-tools.d.ts +36 -98
- package/dist/tools/room-tools.d.ts.map +1 -1
- package/dist/tools/room-tools.js +130 -565
- 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 +31 -6
- package/dist/tools/scene-lifecycle/delete-scene.d.ts +3 -1
- package/dist/tools/scene-lifecycle/delete-scene.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/delete-scene.js +10 -9
- 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 +6 -6
- package/dist/tools/scene-lifecycle/index.d.ts +1 -1
- package/dist/tools/scene-lifecycle/index.d.ts.map +1 -1
- 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 +4 -4
- package/dist/tools/scene-lifecycle/load-scene.d.ts +2 -2
- package/dist/tools/scene-lifecycle/load-scene.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/load-scene.js +5 -5
- package/dist/tools/scene-lifecycle/metadata.d.ts +1 -1
- 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 +6 -6
- package/dist/tools/scene-lifecycle/save-scene.d.ts +6 -3
- package/dist/tools/scene-lifecycle/save-scene.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/save-scene.js +124 -16
- package/dist/tools/scene-lifecycle/test-utils.d.ts +3 -3
- package/dist/tools/scene-lifecycle/test-utils.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/test-utils.js +2 -1
- package/dist/tools/set-unit-members.d.ts +4 -2
- package/dist/tools/set-unit-members.d.ts.map +1 -1
- package/dist/tools/set-unit-members.js +6 -6
- package/dist/tools/set-zone.d.ts +4 -2
- package/dist/tools/set-zone.d.ts.map +1 -1
- package/dist/tools/set-zone.js +30 -18
- package/dist/tools/shared-tools.d.ts +40 -0
- package/dist/tools/shared-tools.d.ts.map +1 -0
- package/dist/tools/shared-tools.js +574 -0
- package/dist/tools/structure-tools.d.ts +57 -0
- package/dist/tools/structure-tools.d.ts.map +1 -0
- package/dist/tools/structure-tools.js +57 -0
- package/dist/tools/templates/create-from-template.d.ts +2 -2
- package/dist/tools/templates/create-from-template.d.ts.map +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.d.ts.map +1 -1
- package/dist/tools/templates/create-house-from-brief.js +6 -6
- package/dist/tools/templates/index.d.ts +1 -1
- package/dist/tools/templates/index.d.ts.map +1 -1
- package/dist/tools/templates/list-templates.d.ts +1 -1
- package/dist/tools/templates/list-templates.d.ts.map +1 -1
- package/dist/tools/templates/list-templates.js +2 -2
- package/dist/tools/undo.d.ts +4 -2
- package/dist/tools/undo.d.ts.map +1 -1
- package/dist/tools/undo.js +4 -4
- package/dist/tools/unit-members.d.ts.map +1 -1
- package/dist/tools/unit-members.js +6 -6
- package/dist/tools/variants/generate-variants.d.ts +6 -6
- package/dist/tools/variants/generate-variants.d.ts.map +1 -1
- package/dist/tools/variants/generate-variants.js +6 -6
- package/dist/tools/variants/index.d.ts +1 -1
- package/dist/tools/variants/index.d.ts.map +1 -1
- package/dist/tools/variants/mutations.js +1 -1
- package/dist/tools/view-scene.d.ts +44 -0
- package/dist/tools/view-scene.d.ts.map +1 -0
- package/dist/tools/view-scene.js +75 -0
- 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 +7 -7
- 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 +7 -7
- package/dist/tools/vision/index.d.ts +1 -1
- package/dist/tools/vision/index.d.ts.map +1 -1
- package/dist/transports/http.d.ts +8 -2
- package/dist/transports/http.d.ts.map +1 -1
- package/dist/transports/http.js +9 -3
- package/dist/transports/stdio.d.ts +15 -9
- package/dist/transports/stdio.d.ts.map +1 -1
- package/dist/transports/stdio.js +18 -11
- package/dist/version.d.ts +5 -0
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +17 -3
- package/examples/coordinate-conventions-demo.md +12 -13
- package/examples/embed-in-agent.ts +6 -7
- package/examples/generate-apartment.md +13 -15
- package/examples/photo-to-scene.md +3 -4
- package/examples/renovate-from-photos.md +6 -9
- package/package.json +19 -9
- package/dist/tools/create-level.d.ts +0 -21
- package/dist/tools/create-level.d.ts.map +0 -1
- package/dist/tools/create-level.js +0 -63
- package/dist/tools/create-wall.d.ts +0 -22
- package/dist/tools/create-wall.d.ts.map +0 -1
- package/dist/tools/create-wall.js +0 -57
- package/dist/tools/cut-opening.d.ts +0 -25
- package/dist/tools/cut-opening.d.ts.map +0 -1
- package/dist/tools/cut-opening.js +0 -61
- package/dist/tools/delete-node.d.ts +0 -19
- package/dist/tools/delete-node.d.ts.map +0 -1
- package/dist/tools/delete-node.js +0 -40
- package/dist/tools/describe-node.d.ts +0 -17
- package/dist/tools/describe-node.d.ts.map +0 -1
- package/dist/tools/describe-node.js +0 -97
- package/dist/tools/door-clearance.d.ts +0 -135
- package/dist/tools/door-clearance.d.ts.map +0 -1
- package/dist/tools/door-clearance.js +0 -334
- package/dist/tools/duplicate-level.d.ts +0 -19
- package/dist/tools/duplicate-level.d.ts.map +0 -1
- package/dist/tools/duplicate-level.js +0 -60
- package/dist/tools/find-nodes.d.ts +0 -32
- package/dist/tools/find-nodes.d.ts.map +0 -1
- package/dist/tools/find-nodes.js +0 -107
- package/dist/tools/geometry.d.ts +0 -24
- package/dist/tools/geometry.d.ts.map +0 -1
- package/dist/tools/geometry.js +0 -94
- package/dist/tools/get-node.d.ts +0 -11
- package/dist/tools/get-node.d.ts.map +0 -1
- package/dist/tools/get-node.js +0 -29
- package/dist/tools/layout-clearance.d.ts +0 -105
- package/dist/tools/layout-clearance.d.ts.map +0 -1
- package/dist/tools/layout-clearance.js +0 -190
- package/dist/tools/place-item.d.ts +0 -22
- package/dist/tools/place-item.d.ts.map +0 -1
- package/dist/tools/place-item.js +0 -89
- package/dist/tools/scene-query.d.ts +0 -62
- package/dist/tools/scene-query.d.ts.map +0 -1
- package/dist/tools/scene-query.js +0 -670
- package/dist/tools/validate-scene.d.ts +0 -19
- package/dist/tools/validate-scene.d.ts.map +0 -1
- package/dist/tools/validate-scene.js +0 -28
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { achievedChanges, verifyScene, } from '@pascal-app/core/agent-operations';
|
|
2
|
+
import { authorSceneTool, isAgentRefusal, } from '@pascal-app/core/agent-tools';
|
|
3
|
+
import { GEOMETRY_SCRIPT_MIME_TYPES } from '@pascal-app/core/schema';
|
|
4
|
+
import { compileAuthorScene } from '@pascal-app/geometry-script/author-scene';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { compileAndStore } from './add-object.js';
|
|
7
|
+
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from './annotations.js';
|
|
8
|
+
import { refusalResult, toolError } from './errors.js';
|
|
9
|
+
import { persistencePayload, publishLiveSceneSnapshot } from './live-sync.js';
|
|
10
|
+
import { toPatches } from './shared-tools.js';
|
|
11
|
+
/**
|
|
12
|
+
* `author_scene` on the MCP: every item's module compiled and stored through the host, the
|
|
13
|
+
* module and the adapter kept as the scene's provenance, the operation applied, Pascal's checks
|
|
14
|
+
* run, and the gate report answered. Replay is the same payload through the same operation.
|
|
15
|
+
*/
|
|
16
|
+
export function registerAuthorScene(server, bridge, host) {
|
|
17
|
+
server.registerTool(authorSceneTool.name, {
|
|
18
|
+
title: authorSceneTool.title,
|
|
19
|
+
description: authorSceneTool.description,
|
|
20
|
+
inputSchema: z.object(authorSceneTool.input),
|
|
21
|
+
annotations: DESTRUCTIVE_TOOL_ANNOTATIONS,
|
|
22
|
+
}, async (input) => {
|
|
23
|
+
if (!host) {
|
|
24
|
+
return toolError('This Pascal server cannot run geometry scripts.', {
|
|
25
|
+
code: 'scripts_unavailable',
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
const args = input;
|
|
29
|
+
const scene = bridge.getActiveScene();
|
|
30
|
+
if (!scene) {
|
|
31
|
+
return toolError('Open or save a scene first: a conversion is stored with a scene.', {
|
|
32
|
+
code: 'no_active_scene',
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
if (args.sceneId && args.sceneId !== scene.id) {
|
|
36
|
+
return toolError('Open the requested scene before converting it.', {
|
|
37
|
+
code: 'scene_mismatch',
|
|
38
|
+
mutationApplied: false,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
const before = bridge.getNodes();
|
|
42
|
+
const beforeJson = JSON.stringify(before);
|
|
43
|
+
const context = {
|
|
44
|
+
activeLevelId: bridge.activeLevelId?.() ?? null,
|
|
45
|
+
...(bridge.supportsMaterialUpserts && bridge.getMaterials
|
|
46
|
+
? { materials: bridge.getMaterials() }
|
|
47
|
+
: {}),
|
|
48
|
+
};
|
|
49
|
+
let outcome;
|
|
50
|
+
try {
|
|
51
|
+
outcome = await compileAuthorScene(before, args, context, ({ code, kind, inputs, nodeId }) => compileAndStore(host, scene.id, { code, language: 'three', params: undefined, inputs }, kind, { nodeId }), host.signal);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
if (isAgentRefusal(error))
|
|
55
|
+
return refusalResult(error);
|
|
56
|
+
return toolError(error instanceof Error ? error.message : String(error), {
|
|
57
|
+
code: 'conversion_failed',
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
// Provenance: the design's module and the program that read it, kept as scripts of the scene.
|
|
61
|
+
const provenance = {};
|
|
62
|
+
for (const [kind, text] of [
|
|
63
|
+
['module', args.module],
|
|
64
|
+
['adapter', args.adapter],
|
|
65
|
+
]) {
|
|
66
|
+
if (!text)
|
|
67
|
+
continue;
|
|
68
|
+
provenance[kind] = await host.storeArtifact({
|
|
69
|
+
sceneId: scene.id,
|
|
70
|
+
sha256: await sha256(text),
|
|
71
|
+
bytes: new TextEncoder().encode(text),
|
|
72
|
+
mimeType: GEOMETRY_SCRIPT_MIME_TYPES.three,
|
|
73
|
+
metadata: { kind: 'item' },
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
host.signal?.throwIfAborted();
|
|
77
|
+
await host.assertActive?.();
|
|
78
|
+
if (JSON.stringify(bridge.getNodes()) !== beforeJson) {
|
|
79
|
+
return toolError('The scene changed while its candidate was compiling. Read the current scene and retry the conversion.', { code: 'scene_changed', mutationApplied: false });
|
|
80
|
+
}
|
|
81
|
+
const buildingUpdate = outcome.changes.update.find((change) => change.id === outcome.buildingId);
|
|
82
|
+
buildingUpdate.data.metadata = {
|
|
83
|
+
...buildingUpdate.data.metadata,
|
|
84
|
+
authorScene: {
|
|
85
|
+
...provenance,
|
|
86
|
+
payload: withoutCode(args.payload),
|
|
87
|
+
report: outcome.result,
|
|
88
|
+
at: new Date().toISOString(),
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
const patches = toPatches(outcome.changes);
|
|
92
|
+
if (patches.length)
|
|
93
|
+
bridge.applyPatch(patches);
|
|
94
|
+
const checks = verifyScene(bridge.getNodes(), undefined, {
|
|
95
|
+
activeLevelId: null,
|
|
96
|
+
}).result;
|
|
97
|
+
const byType = new Map();
|
|
98
|
+
for (const issue of checks.issues)
|
|
99
|
+
byType.set(issue.type ?? 'unknown', (byType.get(issue.type ?? 'unknown') ?? 0) + 1);
|
|
100
|
+
const payload = {
|
|
101
|
+
...outcome.result,
|
|
102
|
+
itemTriangles: outcome.itemTriangles,
|
|
103
|
+
itemsCompiled: outcome.itemsCompiled,
|
|
104
|
+
green: outcome.result.defects.length === 0,
|
|
105
|
+
verify: {
|
|
106
|
+
valid: checks.valid,
|
|
107
|
+
issues: checks.issues.length,
|
|
108
|
+
byType: Object.fromEntries(byType),
|
|
109
|
+
first: checks.issues.slice(0, 40).map((i) => i.message),
|
|
110
|
+
},
|
|
111
|
+
achieved: achievedChanges(before, outcome.changes ?? {}),
|
|
112
|
+
...persistencePayload(await publishLiveSceneSnapshot(bridge, authorSceneTool.name)),
|
|
113
|
+
};
|
|
114
|
+
return {
|
|
115
|
+
content: [{ type: 'text', text: JSON.stringify(payload) }],
|
|
116
|
+
structuredContent: payload,
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
/** The payload as kept with the scene: every module is already its own artifact. */
|
|
121
|
+
function withoutCode(payload) {
|
|
122
|
+
return {
|
|
123
|
+
...payload,
|
|
124
|
+
levels: payload.levels.map((level) => ({
|
|
125
|
+
...level,
|
|
126
|
+
walls: (level.walls ?? []).map(({ faceLeft, faceRight, ...wall }) => ({
|
|
127
|
+
...wall,
|
|
128
|
+
openings: (wall.openings ?? []).map(({ code: _, ...opening }) => opening),
|
|
129
|
+
...(faceLeft ? { faceLeft: { toHeight: faceLeft.toHeight } } : {}),
|
|
130
|
+
...(faceRight ? { faceRight: { toHeight: faceRight.toHeight } } : {}),
|
|
131
|
+
})),
|
|
132
|
+
items: (level.items ?? []).map(({ code: _, ...item }) => item),
|
|
133
|
+
rooms: level.rooms.map(({ floorCode: _, wallCode: _w, ...room }) => room),
|
|
134
|
+
})),
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
async function sha256(text) {
|
|
138
|
+
const digest = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(text));
|
|
139
|
+
return [...new Uint8Array(digest)].map((b) => b.toString(16).padStart(2, '0')).join('');
|
|
140
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type { McpServer } from '@modelcontextprotocol/
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/server';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import type { SceneOperations } from '../operations/index.js';
|
|
4
4
|
export declare const checkCollisionsInput: {
|
|
5
5
|
levelId: z.ZodOptional<z.ZodString>;
|
|
6
|
-
minimumClearance: z.ZodDefault<z.ZodPipe<z.ZodUnion<
|
|
6
|
+
minimumClearance: z.ZodDefault<z.ZodPipe<z.ZodUnion<[z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
|
|
7
7
|
floorOnly: z.ZodDefault<z.ZodBoolean>;
|
|
8
8
|
candidate: z.ZodOptional<z.ZodObject<{
|
|
9
9
|
id: z.ZodDefault<z.ZodString>;
|
|
10
10
|
name: z.ZodDefault<z.ZodString>;
|
|
11
11
|
levelId: z.ZodString;
|
|
12
|
-
position: z.ZodPipe<z.ZodArray<z.ZodPipe<z.ZodUnion<
|
|
13
|
-
dimensions: z.ZodPipe<z.ZodArray<z.ZodPipe<z.ZodUnion<
|
|
14
|
-
rotationY: z.ZodDefault<z.ZodPipe<z.ZodUnion<
|
|
12
|
+
position: z.ZodPipe<z.ZodArray<z.ZodPipe<z.ZodUnion<[z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>> | z.ZodDefault<z.ZodPipe<z.ZodUnion<[z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>>, z.ZodTransform<[number, number, number], number[]>>;
|
|
13
|
+
dimensions: z.ZodPipe<z.ZodArray<z.ZodPipe<z.ZodUnion<[z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>> | z.ZodDefault<z.ZodPipe<z.ZodUnion<[z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>>, z.ZodTransform<[number, number, number], number[]>>;
|
|
14
|
+
rotationY: z.ZodDefault<z.ZodPipe<z.ZodUnion<[z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
|
|
15
15
|
source: z.ZodOptional<z.ZodObject<{
|
|
16
16
|
assetId: z.ZodOptional<z.ZodString>;
|
|
17
17
|
uri: z.ZodOptional<z.ZodString>;
|
|
@@ -21,8 +21,8 @@ export declare const checkCollisionsInput: {
|
|
|
21
21
|
export declare const checkCollisionsOutput: {
|
|
22
22
|
status: z.ZodEnum<{
|
|
23
23
|
checked: "checked";
|
|
24
|
-
partial: "partial";
|
|
25
24
|
insufficient_evidence: "insufficient_evidence";
|
|
25
|
+
partial: "partial";
|
|
26
26
|
}>;
|
|
27
27
|
units: z.ZodLiteral<"meters">;
|
|
28
28
|
method: z.ZodLiteral<"rotation-aware-plan-aabb">;
|
|
@@ -64,8 +64,8 @@ export declare const checkCollisionsOutput: {
|
|
|
64
64
|
bId: z.ZodString;
|
|
65
65
|
kind: z.ZodString;
|
|
66
66
|
violation: z.ZodEnum<{
|
|
67
|
-
overlap: "overlap";
|
|
68
67
|
clearance: "clearance";
|
|
68
|
+
overlap: "overlap";
|
|
69
69
|
}>;
|
|
70
70
|
minimumClearanceMeters: z.ZodNumber;
|
|
71
71
|
}, z.core.$strip>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-collisions.d.ts","sourceRoot":"","sources":["../../src/tools/check-collisions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"check-collisions.d.ts","sourceRoot":"","sources":["../../src/tools/check-collisions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAO7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AA4BpD,eAAO,MAAM,oBAAoB;IAC/B,OAAO;IACP,gBAAgB;IAIhB,SAAS;IAIT,SAAS;;;;;;;;;;;;CAqBV,CAAA;AAED,eAAO,MAAM,qBAAqB;IAChC,MAAM;;;;;IACN,KAAK;IACL,MAAM;IACN,mBAAmB;IACnB,sBAAsB;IACtB,SAAS;IACT,eAAe;IACf,YAAY;;;;;;;;;;;;;;;;;;;;IAsBZ,YAAY;;;;;IAOZ,iBAAiB;;;;IAMjB,UAAU;;;;;;;;;;CASX,CAAA;AA6BD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CA4KxF"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
+
import { findItemItemCollisions, inspectItemPlanFootprint, resolveNodeLevelId, } from '@pascal-app/core/agent-operations';
|
|
1
2
|
import { ItemNode } from '@pascal-app/core/schema';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { READ_ONLY_TOOL_ANNOTATIONS } from './annotations.js';
|
|
4
|
-
import {
|
|
5
|
-
import { ErrorCode, throwMcpError } from './errors.js';
|
|
6
|
-
import { findItemItemCollisions } from './layout-clearance.js';
|
|
5
|
+
import { ProtocolErrorCode, throwMcpError } from './errors.js';
|
|
7
6
|
import { measurement } from './measurement.js';
|
|
8
7
|
import { computeGraphHash } from './scene-lifecycle/metadata.js';
|
|
9
8
|
import { NodeIdSchema } from './schemas.js';
|
|
@@ -131,24 +130,24 @@ export function registerCheckCollisions(server, bridge) {
|
|
|
131
130
|
server.registerTool('check_collisions', {
|
|
132
131
|
title: 'Check collisions',
|
|
133
132
|
description: 'Assess declared item footprints with a rotation-aware plan AABB test. Supports an explicit minimum clearance and reports units, source dimensions, skipped evidence, and unsupported checks. Optionally scope to one level or floor-standing items.',
|
|
134
|
-
inputSchema: checkCollisionsInput,
|
|
135
|
-
outputSchema: checkCollisionsOutput,
|
|
133
|
+
inputSchema: z.object(checkCollisionsInput),
|
|
134
|
+
outputSchema: z.object(checkCollisionsOutput),
|
|
136
135
|
annotations: READ_ONLY_TOOL_ANNOTATIONS,
|
|
137
136
|
}, async ({ levelId, minimumClearance, floorOnly, candidate }) => {
|
|
138
137
|
const sceneNodes = Object.values(bridge.getNodes());
|
|
139
138
|
if (candidate && levelId && candidate.levelId !== levelId) {
|
|
140
|
-
throwMcpError(
|
|
139
|
+
throwMcpError(ProtocolErrorCode.InvalidParams, 'candidate.levelId must match levelId when both are provided');
|
|
141
140
|
}
|
|
142
141
|
const scopeLevelId = candidate?.levelId ?? levelId;
|
|
143
142
|
if (scopeLevelId) {
|
|
144
143
|
const target = sceneNodes.find((node) => node.id === scopeLevelId);
|
|
145
144
|
if (target?.type !== 'level') {
|
|
146
|
-
throwMcpError(
|
|
145
|
+
throwMcpError(ProtocolErrorCode.InvalidParams, `Level not found: ${scopeLevelId}`);
|
|
147
146
|
}
|
|
148
147
|
}
|
|
149
148
|
if (candidate) {
|
|
150
149
|
if (sceneNodes.some((node) => node.id === candidate.id)) {
|
|
151
|
-
throwMcpError(
|
|
150
|
+
throwMcpError(ProtocolErrorCode.InvalidParams, `Candidate id already exists: ${candidate.id}`);
|
|
152
151
|
}
|
|
153
152
|
}
|
|
154
153
|
const candidateNode = candidate
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/server';
|
|
2
|
+
import type { SceneOperations } from '../operations/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* `clear_scene`: the scene goes back to the host's default scaffold (a site, a building, a level),
|
|
5
|
+
* then is saved with `allowSceneWipe`, so a store that refuses an accidental wipe takes this one.
|
|
6
|
+
* The project's installed plugins stay, and its undo history goes, as the editor's own clear does.
|
|
7
|
+
*/
|
|
8
|
+
export declare function registerClearScene(server: McpServer, operations: SceneOperations): void;
|
|
9
|
+
//# sourceMappingURL=clear-scene.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clear-scene.d.ts","sourceRoot":"","sources":["../../src/tools/clear-scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAG7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAKpD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,GAAG,IAAI,CAmDvF"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { clearSceneTool } from '@pascal-app/core/agent-tools';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { DESTRUCTIVE_TOOL_ANNOTATIONS } from './annotations.js';
|
|
4
|
+
import { refusalResult } from './errors.js';
|
|
5
|
+
import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync.js';
|
|
6
|
+
/**
|
|
7
|
+
* `clear_scene`: the scene goes back to the host's default scaffold (a site, a building, a level),
|
|
8
|
+
* then is saved with `allowSceneWipe`, so a store that refuses an accidental wipe takes this one.
|
|
9
|
+
* The project's installed plugins stay, and its undo history goes, as the editor's own clear does.
|
|
10
|
+
*/
|
|
11
|
+
export function registerClearScene(server, operations) {
|
|
12
|
+
server.registerTool(clearSceneTool.name, {
|
|
13
|
+
title: clearSceneTool.title,
|
|
14
|
+
description: clearSceneTool.description,
|
|
15
|
+
inputSchema: z.object(clearSceneTool.input),
|
|
16
|
+
outputSchema: z.object({
|
|
17
|
+
cleared: z.object({ removed: z.number() }),
|
|
18
|
+
version: z.number().nullable(),
|
|
19
|
+
graphHash: z.string().nullable(),
|
|
20
|
+
...liveSyncOutput,
|
|
21
|
+
}),
|
|
22
|
+
annotations: DESTRUCTIVE_TOOL_ANNOTATIONS,
|
|
23
|
+
}, async () => {
|
|
24
|
+
try {
|
|
25
|
+
const before = Object.keys(operations.getNodes()).length;
|
|
26
|
+
const { installedPlugins } = operations.exportSceneGraph();
|
|
27
|
+
operations.setScene({}, []);
|
|
28
|
+
operations.loadDefault();
|
|
29
|
+
// Resetting drops the plugin state on every host; the scaffold is applied again with it.
|
|
30
|
+
if (installedPlugins)
|
|
31
|
+
operations.loadJSON({
|
|
32
|
+
...operations.exportSceneGraph(),
|
|
33
|
+
collections: {},
|
|
34
|
+
materials: {},
|
|
35
|
+
installedPlugins,
|
|
36
|
+
});
|
|
37
|
+
// Nothing to undo back into: the empty intermediate or the old scene, saved over the clear.
|
|
38
|
+
operations.clearHistory();
|
|
39
|
+
const removed = Math.max(0, before - Object.keys(operations.getNodes()).length);
|
|
40
|
+
const persistence = await publishLiveSceneSnapshot(operations, clearSceneTool.name, {
|
|
41
|
+
allowSceneWipe: true,
|
|
42
|
+
});
|
|
43
|
+
const active = operations.getActiveScene();
|
|
44
|
+
const payload = {
|
|
45
|
+
cleared: { removed },
|
|
46
|
+
version: active?.version ?? null,
|
|
47
|
+
graphHash: active?.graphHash ?? null,
|
|
48
|
+
...persistencePayload(persistence),
|
|
49
|
+
};
|
|
50
|
+
return {
|
|
51
|
+
content: [{ type: 'text', text: JSON.stringify(payload) }],
|
|
52
|
+
structuredContent: payload,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
return refusalResult(error);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../src/tools/collections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAY7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAgBpD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CA+CxF"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { editCollection, listCollections, writeCollections, } from '@pascal-app/core/agent-operations';
|
|
2
|
+
import { editCollectionTool, listCollectionsTool } from '@pascal-app/core/agent-tools';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { DESTRUCTIVE_TOOL_ANNOTATIONS, READ_ONLY_TOOL_ANNOTATIONS } from './annotations.js';
|
|
5
|
+
import { refusalResult } from './errors.js';
|
|
6
|
+
import { persistencePayload, publishLiveSceneSnapshot } from './live-sync.js';
|
|
7
|
+
// The collection tools share contracts and operations with the chat; they read the scene's
|
|
8
|
+
// collections beside its nodes, which the node-only shared operations never see.
|
|
9
|
+
function sceneOf(bridge) {
|
|
10
|
+
return { nodes: bridge.getNodes(), collections: bridge.getCollections() };
|
|
11
|
+
}
|
|
12
|
+
function reply(payload) {
|
|
13
|
+
return { content: [{ type: 'text', text: JSON.stringify(payload) }] };
|
|
14
|
+
}
|
|
15
|
+
export function registerCollectionTools(server, bridge) {
|
|
16
|
+
server.registerTool(listCollectionsTool.name, {
|
|
17
|
+
title: listCollectionsTool.title,
|
|
18
|
+
description: listCollectionsTool.description,
|
|
19
|
+
inputSchema: z.object(listCollectionsTool.input),
|
|
20
|
+
annotations: READ_ONLY_TOOL_ANNOTATIONS,
|
|
21
|
+
}, async (input) => {
|
|
22
|
+
try {
|
|
23
|
+
return reply(listCollections(sceneOf(bridge), input).result);
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
return refusalResult(error);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
server.registerTool(editCollectionTool.name, {
|
|
30
|
+
title: editCollectionTool.title,
|
|
31
|
+
description: editCollectionTool.description,
|
|
32
|
+
inputSchema: z.object(editCollectionTool.input),
|
|
33
|
+
annotations: DESTRUCTIVE_TOOL_ANNOTATIONS,
|
|
34
|
+
}, async (input) => {
|
|
35
|
+
let outcome;
|
|
36
|
+
try {
|
|
37
|
+
outcome = editCollection(sceneOf(bridge), input);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
return refusalResult(error);
|
|
41
|
+
}
|
|
42
|
+
const { update, collections = {} } = outcome.changes ?? {};
|
|
43
|
+
bridge.runAsSingleHistoryStep(() => {
|
|
44
|
+
if (update?.length)
|
|
45
|
+
bridge.applyPatch(update.map(({ id, data }) => ({ op: 'update', id: id, data })));
|
|
46
|
+
bridge.setCollections(writeCollections(bridge.getCollections(), collections));
|
|
47
|
+
});
|
|
48
|
+
return reply({
|
|
49
|
+
...outcome.result,
|
|
50
|
+
...persistencePayload(await publishLiveSceneSnapshot(bridge, editCollectionTool.name)),
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
}
|
|
@@ -1,115 +1,39 @@
|
|
|
1
|
-
import type { McpServer } from '@modelcontextprotocol/
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/server';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import type { SceneOperations } from '../operations/index.js';
|
|
4
4
|
export declare const createStoryShellInput: {
|
|
5
5
|
levelId: z.ZodString;
|
|
6
6
|
footprint: z.ZodArray<z.ZodArray<z.ZodNumber>>;
|
|
7
|
-
wallHeight: z.ZodOptional<z.ZodPipe<z.ZodUnion<
|
|
8
|
-
wallThickness: z.ZodDefault<z.ZodPipe<z.ZodUnion<
|
|
7
|
+
wallHeight: z.ZodOptional<z.ZodPipe<z.ZodUnion<[z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
|
|
8
|
+
wallThickness: z.ZodDefault<z.ZodPipe<z.ZodUnion<[z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
|
|
9
9
|
createSlab: z.ZodDefault<z.ZodBoolean>;
|
|
10
10
|
createCeiling: z.ZodDefault<z.ZodBoolean>;
|
|
11
|
-
slabElevation: z.ZodDefault<z.ZodPipe<z.ZodUnion<
|
|
12
|
-
ceilingHeight: z.ZodOptional<z.ZodPipe<z.ZodUnion<
|
|
11
|
+
slabElevation: z.ZodDefault<z.ZodPipe<z.ZodUnion<[z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
|
|
12
|
+
ceilingHeight: z.ZodOptional<z.ZodPipe<z.ZodUnion<[z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
|
|
13
13
|
namePrefix: z.ZodOptional<z.ZodString>;
|
|
14
14
|
wallMaterialPreset: z.ZodOptional<z.ZodString>;
|
|
15
15
|
slabMaterialPreset: z.ZodOptional<z.ZodString>;
|
|
16
16
|
ceilingMaterialPreset: z.ZodOptional<z.ZodString>;
|
|
17
17
|
};
|
|
18
18
|
export declare const createStoryShellOutput: {
|
|
19
|
+
project: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20
|
+
unsaved: z.ZodOptional<z.ZodString>;
|
|
19
21
|
persistence: z.ZodOptional<z.ZodObject<{
|
|
20
22
|
status: z.ZodEnum<{
|
|
21
|
-
unbound: "unbound";
|
|
22
23
|
events_unsupported: "events_unsupported";
|
|
24
|
+
unbound: "unbound";
|
|
23
25
|
}>;
|
|
24
26
|
warning: z.ZodString;
|
|
25
27
|
}, z.core.$strip>>;
|
|
26
28
|
levelId: z.ZodString;
|
|
27
29
|
wallIds: z.ZodArray<z.ZodString>;
|
|
30
|
+
/** Zones the reconciler derived for the enclosed faces. */
|
|
31
|
+
zoneIds: z.ZodArray<z.ZodString>;
|
|
32
|
+
/** Derived floor plate. `null` when floors were declined or nothing reconciled. */
|
|
28
33
|
slabId: z.ZodNullable<z.ZodString>;
|
|
34
|
+
/** Derived ceiling. `null` when ceilings were declined or nothing reconciled. */
|
|
29
35
|
ceilingId: z.ZodNullable<z.ZodString>;
|
|
30
36
|
createdIds: z.ZodArray<z.ZodString>;
|
|
31
37
|
};
|
|
32
|
-
export declare const createRoofInput: {
|
|
33
|
-
levelId: z.ZodString;
|
|
34
|
-
roofLevelId: z.ZodOptional<z.ZodString>;
|
|
35
|
-
useDedicatedRoofLevel: z.ZodDefault<z.ZodBoolean>;
|
|
36
|
-
roofLevelLabel: z.ZodDefault<z.ZodString>;
|
|
37
|
-
roofLevelElevation: z.ZodOptional<z.ZodNumber>;
|
|
38
|
-
roofLevelHeight: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
|
|
39
|
-
center: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
40
|
-
width: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>;
|
|
41
|
-
depth: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>;
|
|
42
|
-
roofType: z.ZodDefault<z.ZodEnum<{
|
|
43
|
-
gable: "gable";
|
|
44
|
-
flat: "flat";
|
|
45
|
-
hip: "hip";
|
|
46
|
-
shed: "shed";
|
|
47
|
-
gambrel: "gambrel";
|
|
48
|
-
dutch: "dutch";
|
|
49
|
-
mansard: "mansard";
|
|
50
|
-
conical: "conical";
|
|
51
|
-
}>>;
|
|
52
|
-
pitch: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
|
|
53
|
-
wallHeight: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
|
|
54
|
-
wallThickness: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
|
|
55
|
-
overhang: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
|
|
56
|
-
materialPreset: z.ZodOptional<z.ZodString>;
|
|
57
|
-
name: z.ZodOptional<z.ZodString>;
|
|
58
|
-
};
|
|
59
|
-
export declare const createRoofOutput: {
|
|
60
|
-
persistence: z.ZodOptional<z.ZodObject<{
|
|
61
|
-
status: z.ZodEnum<{
|
|
62
|
-
unbound: "unbound";
|
|
63
|
-
events_unsupported: "events_unsupported";
|
|
64
|
-
}>;
|
|
65
|
-
warning: z.ZodString;
|
|
66
|
-
}, z.core.$strip>>;
|
|
67
|
-
referenceLevelId: z.ZodString;
|
|
68
|
-
roofLevelId: z.ZodString;
|
|
69
|
-
createdRoofLevelId: z.ZodNullable<z.ZodString>;
|
|
70
|
-
roofId: z.ZodString;
|
|
71
|
-
roofSegmentId: z.ZodString;
|
|
72
|
-
};
|
|
73
|
-
export declare const createStairBetweenLevelsInput: {
|
|
74
|
-
fromLevelId: z.ZodString;
|
|
75
|
-
toLevelId: z.ZodString;
|
|
76
|
-
position: z.ZodArray<z.ZodNumber>;
|
|
77
|
-
rotation: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
|
|
78
|
-
width: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
|
|
79
|
-
runLength: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
|
|
80
|
-
totalRise: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
|
|
81
|
-
stepCount: z.ZodDefault<z.ZodNumber>;
|
|
82
|
-
railingMode: z.ZodDefault<z.ZodEnum<{
|
|
83
|
-
none: "none";
|
|
84
|
-
both: "both";
|
|
85
|
-
right: "right";
|
|
86
|
-
left: "left";
|
|
87
|
-
}>>;
|
|
88
|
-
destinationSlabId: z.ZodOptional<z.ZodString>;
|
|
89
|
-
sourceCeilingId: z.ZodOptional<z.ZodString>;
|
|
90
|
-
createDestinationSlabOpening: z.ZodDefault<z.ZodBoolean>;
|
|
91
|
-
createSourceCeilingOpening: z.ZodDefault<z.ZodBoolean>;
|
|
92
|
-
openingWidth: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
|
|
93
|
-
openingLength: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
|
|
94
|
-
openingOffset: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
|
|
95
|
-
openingCenter: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
96
|
-
openingRotation: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
|
|
97
|
-
materialPreset: z.ZodOptional<z.ZodString>;
|
|
98
|
-
name: z.ZodOptional<z.ZodString>;
|
|
99
|
-
};
|
|
100
|
-
export declare const createStairBetweenLevelsOutput: {
|
|
101
|
-
persistence: z.ZodOptional<z.ZodObject<{
|
|
102
|
-
status: z.ZodEnum<{
|
|
103
|
-
unbound: "unbound";
|
|
104
|
-
events_unsupported: "events_unsupported";
|
|
105
|
-
}>;
|
|
106
|
-
warning: z.ZodString;
|
|
107
|
-
}, z.core.$strip>>;
|
|
108
|
-
stairId: z.ZodString;
|
|
109
|
-
stairSegmentId: z.ZodString;
|
|
110
|
-
destinationSlabId: z.ZodNullable<z.ZodString>;
|
|
111
|
-
sourceCeilingId: z.ZodNullable<z.ZodString>;
|
|
112
|
-
openingPolygon: z.ZodArray<z.ZodArray<z.ZodNumber>>;
|
|
113
|
-
};
|
|
114
38
|
export declare function registerConstructionTools(server: McpServer, bridge: SceneOperations): void;
|
|
115
39
|
//# sourceMappingURL=construction-tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"construction-tools.d.ts","sourceRoot":"","sources":["../../src/tools/construction-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"construction-tools.d.ts","sourceRoot":"","sources":["../../src/tools/construction-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAI7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAOpD,eAAO,MAAM,qBAAqB;IAChC,OAAO;IACP,SAAS;IACT,UAAU;IAIV,aAAa;IAIb,UAAU;IAIV,aAAa;IAIb,aAAa;IAGb,aAAa;IAIb,UAAU;IACV,kBAAkB;IAClB,kBAAkB;IAClB,qBAAqB;CACtB,CAAA;AAED,eAAO,MAAM,sBAAsB;;;;;;;;;;;;IAGjC,2DAA2D;;IAE3D,mFAAmF;;IAEnF,iFAAiF;;;CAIlF,CAAA;AAgDD,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CA4H1F"}
|