@pascal-app/mcp 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/README.md +330 -0
- package/dist/bin/pascal-mcp.d.ts +3 -0
- package/dist/bin/pascal-mcp.d.ts.map +1 -0
- package/dist/bin/pascal-mcp.js +91 -0
- package/dist/bridge/index.d.ts +3 -0
- package/dist/bridge/index.d.ts.map +1 -0
- package/dist/bridge/index.js +1 -0
- package/dist/bridge/node-shims.d.ts +16 -0
- package/dist/bridge/node-shims.d.ts.map +1 -0
- package/dist/bridge/node-shims.js +25 -0
- package/dist/bridge/scene-bridge.d.ts +158 -0
- package/dist/bridge/scene-bridge.d.ts.map +1 -0
- package/dist/bridge/scene-bridge.js +482 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/lib/rehydrate-site-children.d.ts +12 -0
- package/dist/lib/rehydrate-site-children.d.ts.map +1 -0
- package/dist/lib/rehydrate-site-children.js +40 -0
- package/dist/lib/safe-fetch.d.ts +19 -0
- package/dist/lib/safe-fetch.d.ts.map +1 -0
- package/dist/lib/safe-fetch.js +221 -0
- package/dist/operations/index.d.ts +2 -0
- package/dist/operations/index.d.ts.map +1 -0
- package/dist/operations/index.js +1 -0
- package/dist/operations/scene-operations.d.ts +67 -0
- package/dist/operations/scene-operations.d.ts.map +1 -0
- package/dist/operations/scene-operations.js +192 -0
- package/dist/prompts/from-brief.d.ts +11 -0
- package/dist/prompts/from-brief.d.ts.map +1 -0
- package/dist/prompts/from-brief.js +48 -0
- package/dist/prompts/index.d.ts +10 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +14 -0
- package/dist/prompts/iterate-on-feedback.d.ts +11 -0
- package/dist/prompts/iterate-on-feedback.d.ts.map +1 -0
- package/dist/prompts/iterate-on-feedback.js +41 -0
- package/dist/prompts/renovation-from-photos.d.ts +24 -0
- package/dist/prompts/renovation-from-photos.d.ts.map +1 -0
- package/dist/prompts/renovation-from-photos.js +135 -0
- package/dist/prompts/scene-guidance.d.ts +2 -0
- package/dist/prompts/scene-guidance.d.ts.map +1 -0
- package/dist/prompts/scene-guidance.js +24 -0
- package/dist/resources/agent-guide.d.ts +5 -0
- package/dist/resources/agent-guide.d.ts.map +1 -0
- package/dist/resources/agent-guide.js +85 -0
- package/dist/resources/catalog-items.d.ts +10 -0
- package/dist/resources/catalog-items.d.ts.map +1 -0
- package/dist/resources/catalog-items.js +29 -0
- package/dist/resources/constraints.d.ts +9 -0
- package/dist/resources/constraints.d.ts.map +1 -0
- package/dist/resources/constraints.js +69 -0
- package/dist/resources/index.d.ts +15 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +23 -0
- package/dist/resources/scene-current.d.ts +9 -0
- package/dist/resources/scene-current.d.ts.map +1 -0
- package/dist/resources/scene-current.js +20 -0
- package/dist/resources/scene-summary.d.ts +10 -0
- package/dist/resources/scene-summary.d.ts.map +1 -0
- package/dist/resources/scene-summary.js +196 -0
- package/dist/server.d.ts +14 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +18 -0
- package/dist/storage/index.d.ts +13 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +14 -0
- package/dist/storage/slug.d.ts +21 -0
- package/dist/storage/slug.d.ts.map +1 -0
- package/dist/storage/slug.js +62 -0
- package/dist/storage/sqlite-driver.d.ts +18 -0
- package/dist/storage/sqlite-driver.d.ts.map +1 -0
- package/dist/storage/sqlite-driver.js +32 -0
- package/dist/storage/sqlite-scene-store.d.ts +51 -0
- package/dist/storage/sqlite-scene-store.d.ts.map +1 -0
- package/dist/storage/sqlite-scene-store.js +526 -0
- package/dist/storage/types.d.ts +136 -0
- package/dist/storage/types.d.ts.map +1 -0
- package/dist/storage/types.js +28 -0
- package/dist/templates/empty-studio.d.ts +8 -0
- package/dist/templates/empty-studio.d.ts.map +1 -0
- package/dist/templates/empty-studio.js +230 -0
- package/dist/templates/garden-house.d.ts +8 -0
- package/dist/templates/garden-house.d.ts.map +1 -0
- package/dist/templates/garden-house.js +242 -0
- package/dist/templates/index.d.ts +23 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +20 -0
- package/dist/templates/two-bedroom.d.ts +8 -0
- package/dist/templates/two-bedroom.d.ts.map +1 -0
- package/dist/templates/two-bedroom.js +270 -0
- package/dist/tools/apply-patch.d.ts +25 -0
- package/dist/tools/apply-patch.d.ts.map +1 -0
- package/dist/tools/apply-patch.js +59 -0
- package/dist/tools/asset-catalog.d.ts +16 -0
- package/dist/tools/asset-catalog.d.ts.map +1 -0
- package/dist/tools/asset-catalog.js +308 -0
- package/dist/tools/check-collisions.d.ts +15 -0
- package/dist/tools/check-collisions.d.ts.map +1 -0
- package/dist/tools/check-collisions.js +61 -0
- package/dist/tools/construction-tools.d.ts +93 -0
- package/dist/tools/construction-tools.d.ts.map +1 -0
- package/dist/tools/construction-tools.js +369 -0
- package/dist/tools/create-level.d.ts +14 -0
- package/dist/tools/create-level.d.ts.map +1 -0
- package/dist/tools/create-level.js +48 -0
- package/dist/tools/create-wall.d.ts +15 -0
- package/dist/tools/create-wall.d.ts.map +1 -0
- package/dist/tools/create-wall.js +50 -0
- package/dist/tools/cut-opening.d.ts +18 -0
- package/dist/tools/cut-opening.d.ts.map +1 -0
- package/dist/tools/cut-opening.js +57 -0
- package/dist/tools/delete-node.d.ts +12 -0
- package/dist/tools/delete-node.d.ts.map +1 -0
- package/dist/tools/delete-node.js +37 -0
- package/dist/tools/describe-node.d.ts +17 -0
- package/dist/tools/describe-node.d.ts.map +1 -0
- package/dist/tools/describe-node.js +86 -0
- package/dist/tools/duplicate-level.d.ts +12 -0
- package/dist/tools/duplicate-level.d.ts.map +1 -0
- package/dist/tools/duplicate-level.js +56 -0
- package/dist/tools/errors.d.ts +20 -0
- package/dist/tools/errors.d.ts.map +1 -0
- package/dist/tools/errors.js +25 -0
- package/dist/tools/export-glb.d.ts +10 -0
- package/dist/tools/export-glb.d.ts.map +1 -0
- package/dist/tools/export-glb.js +24 -0
- package/dist/tools/export-json.d.ts +11 -0
- package/dist/tools/export-json.d.ts.map +1 -0
- package/dist/tools/export-json.js +23 -0
- package/dist/tools/find-nodes.d.ts +32 -0
- package/dist/tools/find-nodes.d.ts.map +1 -0
- package/dist/tools/find-nodes.js +105 -0
- package/dist/tools/geometry.d.ts +24 -0
- package/dist/tools/geometry.d.ts.map +1 -0
- package/dist/tools/geometry.js +94 -0
- package/dist/tools/get-node.d.ts +11 -0
- package/dist/tools/get-node.d.ts.map +1 -0
- package/dist/tools/get-node.js +27 -0
- package/dist/tools/get-scene.d.ts +11 -0
- package/dist/tools/get-scene.d.ts.map +1 -0
- package/dist/tools/get-scene.js +26 -0
- package/dist/tools/index.d.ts +12 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +64 -0
- package/dist/tools/live-sync.d.ts +11 -0
- package/dist/tools/live-sync.d.ts.map +1 -0
- package/dist/tools/live-sync.js +62 -0
- package/dist/tools/measure.d.ts +14 -0
- package/dist/tools/measure.d.ts.map +1 -0
- package/dist/tools/measure.js +137 -0
- package/dist/tools/photo-to-scene/index.d.ts +11 -0
- package/dist/tools/photo-to-scene/index.d.ts.map +1 -0
- package/dist/tools/photo-to-scene/index.js +11 -0
- package/dist/tools/photo-to-scene/photo-to-scene.d.ts +26 -0
- package/dist/tools/photo-to-scene/photo-to-scene.d.ts.map +1 -0
- package/dist/tools/photo-to-scene/photo-to-scene.js +323 -0
- package/dist/tools/place-item.d.ts +15 -0
- package/dist/tools/place-item.d.ts.map +1 -0
- package/dist/tools/place-item.js +84 -0
- package/dist/tools/redo.d.ts +11 -0
- package/dist/tools/redo.d.ts.map +1 -0
- package/dist/tools/redo.js +25 -0
- package/dist/tools/room-tools.d.ts +97 -0
- package/dist/tools/room-tools.d.ts.map +1 -0
- package/dist/tools/room-tools.js +510 -0
- package/dist/tools/scene-lifecycle/create-project.d.ts +33 -0
- package/dist/tools/scene-lifecycle/create-project.d.ts.map +1 -0
- package/dist/tools/scene-lifecycle/create-project.js +70 -0
- package/dist/tools/scene-lifecycle/delete-scene.d.ts +12 -0
- package/dist/tools/scene-lifecycle/delete-scene.d.ts.map +1 -0
- package/dist/tools/scene-lifecycle/delete-scene.js +42 -0
- package/dist/tools/scene-lifecycle/get-project-status.d.ts +31 -0
- package/dist/tools/scene-lifecycle/get-project-status.d.ts.map +1 -0
- package/dist/tools/scene-lifecycle/get-project-status.js +69 -0
- package/dist/tools/scene-lifecycle/index.d.ts +17 -0
- package/dist/tools/scene-lifecycle/index.d.ts.map +1 -0
- package/dist/tools/scene-lifecycle/index.js +29 -0
- package/dist/tools/scene-lifecycle/list-scenes.d.ts +27 -0
- package/dist/tools/scene-lifecycle/list-scenes.d.ts.map +1 -0
- package/dist/tools/scene-lifecycle/list-scenes.js +49 -0
- package/dist/tools/scene-lifecycle/load-scene.d.ts +31 -0
- package/dist/tools/scene-lifecycle/load-scene.d.ts.map +1 -0
- package/dist/tools/scene-lifecycle/load-scene.js +55 -0
- package/dist/tools/scene-lifecycle/metadata.d.ts +49 -0
- package/dist/tools/scene-lifecycle/metadata.d.ts.map +1 -0
- package/dist/tools/scene-lifecycle/metadata.js +68 -0
- package/dist/tools/scene-lifecycle/rename-scene.d.ts +22 -0
- package/dist/tools/scene-lifecycle/rename-scene.d.ts.map +1 -0
- package/dist/tools/scene-lifecycle/rename-scene.js +63 -0
- package/dist/tools/scene-lifecycle/save-scene.d.ts +42 -0
- package/dist/tools/scene-lifecycle/save-scene.d.ts.map +1 -0
- package/dist/tools/scene-lifecycle/save-scene.js +130 -0
- package/dist/tools/scene-lifecycle/test-utils.d.ts +39 -0
- package/dist/tools/scene-lifecycle/test-utils.d.ts.map +1 -0
- package/dist/tools/scene-lifecycle/test-utils.js +211 -0
- package/dist/tools/scene-query.d.ts +57 -0
- package/dist/tools/scene-query.d.ts.map +1 -0
- package/dist/tools/scene-query.js +645 -0
- package/dist/tools/schemas.d.ts +52 -0
- package/dist/tools/schemas.d.ts.map +1 -0
- package/dist/tools/schemas.js +42 -0
- package/dist/tools/set-zone.d.ts +14 -0
- package/dist/tools/set-zone.d.ts.map +1 -0
- package/dist/tools/set-zone.js +48 -0
- package/dist/tools/templates/create-from-template.d.ts +54 -0
- package/dist/tools/templates/create-from-template.d.ts.map +1 -0
- package/dist/tools/templates/create-from-template.js +145 -0
- package/dist/tools/templates/create-house-from-brief.d.ts +35 -0
- package/dist/tools/templates/create-house-from-brief.d.ts.map +1 -0
- package/dist/tools/templates/create-house-from-brief.js +170 -0
- package/dist/tools/templates/index.d.ts +14 -0
- package/dist/tools/templates/index.d.ts.map +1 -0
- package/dist/tools/templates/index.js +18 -0
- package/dist/tools/templates/list-templates.d.ts +18 -0
- package/dist/tools/templates/list-templates.d.ts.map +1 -0
- package/dist/tools/templates/list-templates.js +36 -0
- package/dist/tools/undo.d.ts +11 -0
- package/dist/tools/undo.d.ts.map +1 -0
- package/dist/tools/undo.js +25 -0
- package/dist/tools/validate-scene.d.ts +14 -0
- package/dist/tools/validate-scene.d.ts.map +1 -0
- package/dist/tools/validate-scene.js +24 -0
- package/dist/tools/variants/generate-variants.d.ts +30 -0
- package/dist/tools/variants/generate-variants.d.ts.map +1 -0
- package/dist/tools/variants/generate-variants.js +160 -0
- package/dist/tools/variants/index.d.ts +9 -0
- package/dist/tools/variants/index.d.ts.map +1 -0
- package/dist/tools/variants/index.js +9 -0
- package/dist/tools/variants/mutations.d.ts +18 -0
- package/dist/tools/variants/mutations.d.ts.map +1 -0
- package/dist/tools/variants/mutations.js +324 -0
- package/dist/tools/vision/analyze-floorplan-image.d.ts +33 -0
- package/dist/tools/vision/analyze-floorplan-image.d.ts.map +1 -0
- package/dist/tools/vision/analyze-floorplan-image.js +146 -0
- package/dist/tools/vision/analyze-room-photo.d.ts +29 -0
- package/dist/tools/vision/analyze-room-photo.d.ts.map +1 -0
- package/dist/tools/vision/analyze-room-photo.js +130 -0
- package/dist/tools/vision/index.d.ts +12 -0
- package/dist/tools/vision/index.d.ts.map +1 -0
- package/dist/tools/vision/index.js +14 -0
- package/dist/transports/http.d.ts +36 -0
- package/dist/transports/http.d.ts.map +1 -0
- package/dist/transports/http.js +203 -0
- package/dist/transports/stdio.d.ts +14 -0
- package/dist/transports/stdio.d.ts.map +1 -0
- package/dist/transports/stdio.js +16 -0
- package/package.json +86 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SceneGraph } from '@pascal-app/core/clone-scene-graph';
|
|
2
|
+
export declare const template: SceneGraph;
|
|
3
|
+
export declare const metadata: {
|
|
4
|
+
readonly id: "empty-studio";
|
|
5
|
+
readonly name: "Empty studio";
|
|
6
|
+
readonly description: "40 m² single-room studio apartment: 4 walls, 1 living/kitchen zone, 1 window, 1 front door.";
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=empty-studio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty-studio.d.ts","sourceRoot":"","sources":["../../src/templates/empty-studio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAA;AAgQpE,eAAO,MAAM,QAAQ,EAAE,UAA4B,CAAA;AAEnD,eAAO,MAAM,QAAQ;;;;CAKX,CAAA"}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 40 m² studio apartment — a single open room with one window, one front door
|
|
3
|
+
* and a single "Living/Kitchen" zone. Used as a starting point for small unit
|
|
4
|
+
* briefs. Deterministic ids (`site_empty`, `building_empty`, `level_0`, etc.)
|
|
5
|
+
* are regenerated by the MCP tool via `cloneSceneGraph` before applying.
|
|
6
|
+
*/
|
|
7
|
+
// Footprint: 8 m × 5 m = 40 m² (centered at origin).
|
|
8
|
+
// Walls traverse the boundary counter-clockwise (right-handed XZ plane).
|
|
9
|
+
const W = 4; // half-width
|
|
10
|
+
const D = 2.5; // half-depth
|
|
11
|
+
function buildNodes() {
|
|
12
|
+
const site = {
|
|
13
|
+
object: 'node',
|
|
14
|
+
id: 'site_empty',
|
|
15
|
+
type: 'site',
|
|
16
|
+
parentId: null,
|
|
17
|
+
visible: true,
|
|
18
|
+
metadata: {},
|
|
19
|
+
polygon: {
|
|
20
|
+
type: 'polygon',
|
|
21
|
+
points: [
|
|
22
|
+
[-15, -15],
|
|
23
|
+
[15, -15],
|
|
24
|
+
[15, 15],
|
|
25
|
+
[-15, 15],
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
children: ['building_empty'],
|
|
29
|
+
};
|
|
30
|
+
const building = {
|
|
31
|
+
object: 'node',
|
|
32
|
+
id: 'building_empty',
|
|
33
|
+
type: 'building',
|
|
34
|
+
parentId: 'site_empty',
|
|
35
|
+
visible: true,
|
|
36
|
+
metadata: {},
|
|
37
|
+
position: [0, 0, 0],
|
|
38
|
+
rotation: [0, 0, 0],
|
|
39
|
+
children: ['level_0'],
|
|
40
|
+
};
|
|
41
|
+
// Walls with deterministic ids; child ids are listed below after doors/windows
|
|
42
|
+
// are created, so we fill this array after computing them.
|
|
43
|
+
const wallIds = ['wall_n', 'wall_e', 'wall_s', 'wall_w'];
|
|
44
|
+
// South wall carries the front door; west wall carries the window.
|
|
45
|
+
const door = {
|
|
46
|
+
object: 'node',
|
|
47
|
+
id: 'door_front',
|
|
48
|
+
type: 'door',
|
|
49
|
+
parentId: 'wall_s',
|
|
50
|
+
visible: true,
|
|
51
|
+
metadata: {},
|
|
52
|
+
wallId: 'wall_s',
|
|
53
|
+
position: [0, 1.05, 0],
|
|
54
|
+
rotation: [0, 0, 0],
|
|
55
|
+
width: 0.9,
|
|
56
|
+
height: 2.1,
|
|
57
|
+
frameThickness: 0.05,
|
|
58
|
+
frameDepth: 0.07,
|
|
59
|
+
threshold: true,
|
|
60
|
+
thresholdHeight: 0.02,
|
|
61
|
+
hingesSide: 'left',
|
|
62
|
+
swingDirection: 'inward',
|
|
63
|
+
segments: [
|
|
64
|
+
{
|
|
65
|
+
type: 'panel',
|
|
66
|
+
heightRatio: 0.4,
|
|
67
|
+
columnRatios: [1],
|
|
68
|
+
dividerThickness: 0.03,
|
|
69
|
+
panelDepth: 0.01,
|
|
70
|
+
panelInset: 0.04,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
type: 'panel',
|
|
74
|
+
heightRatio: 0.6,
|
|
75
|
+
columnRatios: [1],
|
|
76
|
+
dividerThickness: 0.03,
|
|
77
|
+
panelDepth: 0.01,
|
|
78
|
+
panelInset: 0.04,
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
handle: true,
|
|
82
|
+
handleHeight: 1.05,
|
|
83
|
+
handleSide: 'right',
|
|
84
|
+
contentPadding: [0.04, 0.04],
|
|
85
|
+
doorCloser: false,
|
|
86
|
+
panicBar: false,
|
|
87
|
+
panicBarHeight: 1.0,
|
|
88
|
+
};
|
|
89
|
+
const windowNode = {
|
|
90
|
+
object: 'node',
|
|
91
|
+
id: 'window_w',
|
|
92
|
+
type: 'window',
|
|
93
|
+
parentId: 'wall_w',
|
|
94
|
+
visible: true,
|
|
95
|
+
metadata: {},
|
|
96
|
+
wallId: 'wall_w',
|
|
97
|
+
position: [0, 1.2, 0],
|
|
98
|
+
rotation: [0, 0, 0],
|
|
99
|
+
width: 1.5,
|
|
100
|
+
height: 1.2,
|
|
101
|
+
frameThickness: 0.05,
|
|
102
|
+
frameDepth: 0.07,
|
|
103
|
+
columnRatios: [1],
|
|
104
|
+
rowRatios: [1],
|
|
105
|
+
columnDividerThickness: 0.03,
|
|
106
|
+
rowDividerThickness: 0.03,
|
|
107
|
+
sill: true,
|
|
108
|
+
sillDepth: 0.08,
|
|
109
|
+
sillThickness: 0.03,
|
|
110
|
+
};
|
|
111
|
+
const wallNorth = {
|
|
112
|
+
object: 'node',
|
|
113
|
+
id: 'wall_n',
|
|
114
|
+
type: 'wall',
|
|
115
|
+
parentId: 'level_0',
|
|
116
|
+
visible: true,
|
|
117
|
+
metadata: {},
|
|
118
|
+
children: [],
|
|
119
|
+
thickness: 0.1,
|
|
120
|
+
height: 2.5,
|
|
121
|
+
start: [-W, -D],
|
|
122
|
+
end: [W, -D],
|
|
123
|
+
frontSide: 'unknown',
|
|
124
|
+
backSide: 'unknown',
|
|
125
|
+
};
|
|
126
|
+
const wallEast = {
|
|
127
|
+
object: 'node',
|
|
128
|
+
id: 'wall_e',
|
|
129
|
+
type: 'wall',
|
|
130
|
+
parentId: 'level_0',
|
|
131
|
+
visible: true,
|
|
132
|
+
metadata: {},
|
|
133
|
+
children: [],
|
|
134
|
+
thickness: 0.1,
|
|
135
|
+
height: 2.5,
|
|
136
|
+
start: [W, -D],
|
|
137
|
+
end: [W, D],
|
|
138
|
+
frontSide: 'unknown',
|
|
139
|
+
backSide: 'unknown',
|
|
140
|
+
};
|
|
141
|
+
const wallSouth = {
|
|
142
|
+
object: 'node',
|
|
143
|
+
id: 'wall_s',
|
|
144
|
+
type: 'wall',
|
|
145
|
+
parentId: 'level_0',
|
|
146
|
+
visible: true,
|
|
147
|
+
metadata: {},
|
|
148
|
+
children: ['door_front'],
|
|
149
|
+
thickness: 0.1,
|
|
150
|
+
height: 2.5,
|
|
151
|
+
start: [W, D],
|
|
152
|
+
end: [-W, D],
|
|
153
|
+
frontSide: 'unknown',
|
|
154
|
+
backSide: 'unknown',
|
|
155
|
+
};
|
|
156
|
+
const wallWest = {
|
|
157
|
+
object: 'node',
|
|
158
|
+
id: 'wall_w',
|
|
159
|
+
type: 'wall',
|
|
160
|
+
parentId: 'level_0',
|
|
161
|
+
visible: true,
|
|
162
|
+
metadata: {},
|
|
163
|
+
children: ['window_w'],
|
|
164
|
+
thickness: 0.1,
|
|
165
|
+
height: 2.5,
|
|
166
|
+
start: [-W, D],
|
|
167
|
+
end: [-W, -D],
|
|
168
|
+
frontSide: 'unknown',
|
|
169
|
+
backSide: 'unknown',
|
|
170
|
+
};
|
|
171
|
+
const zone = {
|
|
172
|
+
object: 'node',
|
|
173
|
+
id: 'zone_living',
|
|
174
|
+
type: 'zone',
|
|
175
|
+
parentId: 'level_0',
|
|
176
|
+
visible: true,
|
|
177
|
+
metadata: {},
|
|
178
|
+
name: 'Living / Kitchen',
|
|
179
|
+
color: '#60a5fa',
|
|
180
|
+
polygon: [
|
|
181
|
+
[-W, -D],
|
|
182
|
+
[W, -D],
|
|
183
|
+
[W, D],
|
|
184
|
+
[-W, D],
|
|
185
|
+
],
|
|
186
|
+
};
|
|
187
|
+
const level = {
|
|
188
|
+
object: 'node',
|
|
189
|
+
id: 'level_0',
|
|
190
|
+
type: 'level',
|
|
191
|
+
parentId: 'building_empty',
|
|
192
|
+
visible: true,
|
|
193
|
+
metadata: {},
|
|
194
|
+
level: 0,
|
|
195
|
+
children: [...wallIds, 'zone_living'],
|
|
196
|
+
};
|
|
197
|
+
return {
|
|
198
|
+
site,
|
|
199
|
+
building,
|
|
200
|
+
level,
|
|
201
|
+
walls: [wallNorth, wallEast, wallSouth, wallWest],
|
|
202
|
+
zone,
|
|
203
|
+
door,
|
|
204
|
+
window: windowNode,
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
function buildTemplate() {
|
|
208
|
+
const n = buildNodes();
|
|
209
|
+
const nodes = {};
|
|
210
|
+
for (const node of [n.site, n.building, n.level, ...n.walls, n.zone, n.door, n.window]) {
|
|
211
|
+
nodes[node.id] = node;
|
|
212
|
+
}
|
|
213
|
+
// SiteNode.children is a discriminatedUnion of BuildingNode/ItemNode objects
|
|
214
|
+
// (not string ids) — so the site must embed the full building node. The
|
|
215
|
+
// rest of the tree uses string ids per the BaseNode/LevelNode/WallNode
|
|
216
|
+
// schemas. We mutate the flat-dict copy of the site here so the nested
|
|
217
|
+
// representation round-trips through AnyNode.safeParse.
|
|
218
|
+
const siteInDict = nodes['site_empty'];
|
|
219
|
+
siteInDict.children = [nodes['building_empty']];
|
|
220
|
+
return {
|
|
221
|
+
nodes,
|
|
222
|
+
rootNodeIds: ['site_empty'],
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
export const template = buildTemplate();
|
|
226
|
+
export const metadata = {
|
|
227
|
+
id: 'empty-studio',
|
|
228
|
+
name: 'Empty studio',
|
|
229
|
+
description: '40 m² single-room studio apartment: 4 walls, 1 living/kitchen zone, 1 window, 1 front door.',
|
|
230
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SceneGraph } from '@pascal-app/core/clone-scene-graph';
|
|
2
|
+
export declare const template: SceneGraph;
|
|
3
|
+
export declare const metadata: {
|
|
4
|
+
readonly id: "garden-house";
|
|
5
|
+
readonly name: "Garden house";
|
|
6
|
+
readonly description: "12 × 8 m single-level house with a fenced back-garden zone; 4 walls, 2 doors, 4 windows, 3 privacy fences.";
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=garden-house.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"garden-house.d.ts","sourceRoot":"","sources":["../../src/templates/garden-house.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAA;AAmRpE,eAAO,MAAM,QAAQ,EAAE,UAA4B,CAAA;AAEnD,eAAO,MAAM,QAAQ;;;;CAKX,CAAA"}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Garden house" — a simplified take on the Casa del Sol layout used in the
|
|
3
|
+
* MCP research fixtures.
|
|
4
|
+
*
|
|
5
|
+
* Footprint: 12 m × 8 m house centered at the origin, with a 12 m × 6 m
|
|
6
|
+
* back garden zone immediately to the north of the house, surrounded by a
|
|
7
|
+
* privacy fence on three sides.
|
|
8
|
+
*
|
|
9
|
+
* Contents:
|
|
10
|
+
* - 4 perimeter walls around the house
|
|
11
|
+
* - 1 front door (south wall), 1 large garden door (north wall)
|
|
12
|
+
* - 2 windows on the south wall, 1 window on each of east and west
|
|
13
|
+
* - 1 indoor "living" zone, 1 outdoor "garden" zone
|
|
14
|
+
* - 3 fence segments bounding the north/east/west of the garden
|
|
15
|
+
*/
|
|
16
|
+
const HOUSE_W = 6; // half-width of the house (12 m total)
|
|
17
|
+
const HOUSE_D = 4; // half-depth of the house (8 m total)
|
|
18
|
+
const GARDEN_DEPTH = 6; // depth of the back-garden zone along +z direction
|
|
19
|
+
const WALL_THICKNESS = 0.15;
|
|
20
|
+
const WALL_HEIGHT = 2.7;
|
|
21
|
+
function wall(id, start, end, children = []) {
|
|
22
|
+
return {
|
|
23
|
+
object: 'node',
|
|
24
|
+
id,
|
|
25
|
+
type: 'wall',
|
|
26
|
+
parentId: 'level_0',
|
|
27
|
+
visible: true,
|
|
28
|
+
metadata: {},
|
|
29
|
+
children,
|
|
30
|
+
thickness: WALL_THICKNESS,
|
|
31
|
+
height: WALL_HEIGHT,
|
|
32
|
+
start,
|
|
33
|
+
end,
|
|
34
|
+
frontSide: 'unknown',
|
|
35
|
+
backSide: 'unknown',
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function door(id, parentWallId, width = 0.9) {
|
|
39
|
+
return {
|
|
40
|
+
object: 'node',
|
|
41
|
+
id,
|
|
42
|
+
type: 'door',
|
|
43
|
+
parentId: parentWallId,
|
|
44
|
+
visible: true,
|
|
45
|
+
metadata: {},
|
|
46
|
+
wallId: parentWallId,
|
|
47
|
+
position: [0, 1.05, 0],
|
|
48
|
+
rotation: [0, 0, 0],
|
|
49
|
+
width,
|
|
50
|
+
height: 2.1,
|
|
51
|
+
frameThickness: 0.05,
|
|
52
|
+
frameDepth: 0.07,
|
|
53
|
+
threshold: true,
|
|
54
|
+
thresholdHeight: 0.02,
|
|
55
|
+
hingesSide: 'left',
|
|
56
|
+
swingDirection: 'inward',
|
|
57
|
+
segments: [
|
|
58
|
+
{
|
|
59
|
+
type: 'panel',
|
|
60
|
+
heightRatio: 0.5,
|
|
61
|
+
columnRatios: [1],
|
|
62
|
+
dividerThickness: 0.03,
|
|
63
|
+
panelDepth: 0.01,
|
|
64
|
+
panelInset: 0.04,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
type: 'panel',
|
|
68
|
+
heightRatio: 0.5,
|
|
69
|
+
columnRatios: [1],
|
|
70
|
+
dividerThickness: 0.03,
|
|
71
|
+
panelDepth: 0.01,
|
|
72
|
+
panelInset: 0.04,
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
handle: true,
|
|
76
|
+
handleHeight: 1.05,
|
|
77
|
+
handleSide: 'right',
|
|
78
|
+
contentPadding: [0.04, 0.04],
|
|
79
|
+
doorCloser: false,
|
|
80
|
+
panicBar: false,
|
|
81
|
+
panicBarHeight: 1.0,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function makeWindow(id, parentWallId, width = 1.2) {
|
|
85
|
+
return {
|
|
86
|
+
object: 'node',
|
|
87
|
+
id,
|
|
88
|
+
type: 'window',
|
|
89
|
+
parentId: parentWallId,
|
|
90
|
+
visible: true,
|
|
91
|
+
metadata: {},
|
|
92
|
+
wallId: parentWallId,
|
|
93
|
+
position: [0, 1.2, 0],
|
|
94
|
+
rotation: [0, 0, 0],
|
|
95
|
+
width,
|
|
96
|
+
height: 1.2,
|
|
97
|
+
frameThickness: 0.05,
|
|
98
|
+
frameDepth: 0.07,
|
|
99
|
+
columnRatios: [1],
|
|
100
|
+
rowRatios: [1],
|
|
101
|
+
columnDividerThickness: 0.03,
|
|
102
|
+
rowDividerThickness: 0.03,
|
|
103
|
+
sill: true,
|
|
104
|
+
sillDepth: 0.08,
|
|
105
|
+
sillThickness: 0.03,
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function fence(id, start, end) {
|
|
109
|
+
return {
|
|
110
|
+
object: 'node',
|
|
111
|
+
id,
|
|
112
|
+
type: 'fence',
|
|
113
|
+
parentId: 'level_0',
|
|
114
|
+
visible: true,
|
|
115
|
+
metadata: {},
|
|
116
|
+
start,
|
|
117
|
+
end,
|
|
118
|
+
height: 1.8,
|
|
119
|
+
thickness: 0.08,
|
|
120
|
+
baseHeight: 0.22,
|
|
121
|
+
postSpacing: 2,
|
|
122
|
+
postSize: 0.1,
|
|
123
|
+
topRailHeight: 0.04,
|
|
124
|
+
groundClearance: 0,
|
|
125
|
+
edgeInset: 0.015,
|
|
126
|
+
baseStyle: 'grounded',
|
|
127
|
+
color: '#f3f4f6',
|
|
128
|
+
style: 'privacy',
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
function buildTemplate() {
|
|
132
|
+
const nodes = {};
|
|
133
|
+
nodes.site_garden = {
|
|
134
|
+
object: 'node',
|
|
135
|
+
id: 'site_garden',
|
|
136
|
+
type: 'site',
|
|
137
|
+
parentId: null,
|
|
138
|
+
visible: true,
|
|
139
|
+
metadata: {},
|
|
140
|
+
polygon: {
|
|
141
|
+
type: 'polygon',
|
|
142
|
+
points: [
|
|
143
|
+
[-15, -15],
|
|
144
|
+
[15, -15],
|
|
145
|
+
[15, 15],
|
|
146
|
+
[-15, 15],
|
|
147
|
+
],
|
|
148
|
+
},
|
|
149
|
+
children: ['building_garden'],
|
|
150
|
+
};
|
|
151
|
+
nodes.building_garden = {
|
|
152
|
+
object: 'node',
|
|
153
|
+
id: 'building_garden',
|
|
154
|
+
type: 'building',
|
|
155
|
+
parentId: 'site_garden',
|
|
156
|
+
visible: true,
|
|
157
|
+
metadata: {},
|
|
158
|
+
position: [0, 0, 0],
|
|
159
|
+
rotation: [0, 0, 0],
|
|
160
|
+
children: ['level_0'],
|
|
161
|
+
};
|
|
162
|
+
// Openings
|
|
163
|
+
nodes.door_front = door('door_front', 'wall_s', 1.0);
|
|
164
|
+
nodes.door_garden = door('door_garden', 'wall_n', 1.6);
|
|
165
|
+
nodes.window_s1 = makeWindow('window_s1', 'wall_s', 1.2);
|
|
166
|
+
nodes.window_s2 = makeWindow('window_s2', 'wall_s', 1.2);
|
|
167
|
+
nodes.window_e = makeWindow('window_e', 'wall_e', 1.0);
|
|
168
|
+
nodes.window_w = makeWindow('window_w', 'wall_w', 1.0);
|
|
169
|
+
// House perimeter (south is front, north opens to the garden)
|
|
170
|
+
nodes.wall_n = wall('wall_n', [-HOUSE_W, -HOUSE_D], [HOUSE_W, -HOUSE_D], ['door_garden']);
|
|
171
|
+
nodes.wall_e = wall('wall_e', [HOUSE_W, -HOUSE_D], [HOUSE_W, HOUSE_D], ['window_e']);
|
|
172
|
+
nodes.wall_s = wall('wall_s', [HOUSE_W, HOUSE_D], [-HOUSE_W, HOUSE_D], ['door_front', 'window_s1', 'window_s2']);
|
|
173
|
+
nodes.wall_w = wall('wall_w', [-HOUSE_W, HOUSE_D], [-HOUSE_W, -HOUSE_D], ['window_w']);
|
|
174
|
+
// Zones
|
|
175
|
+
nodes.zone_living = {
|
|
176
|
+
object: 'node',
|
|
177
|
+
id: 'zone_living',
|
|
178
|
+
type: 'zone',
|
|
179
|
+
parentId: 'level_0',
|
|
180
|
+
visible: true,
|
|
181
|
+
metadata: {},
|
|
182
|
+
name: 'Living',
|
|
183
|
+
color: '#60a5fa',
|
|
184
|
+
polygon: [
|
|
185
|
+
[-HOUSE_W, -HOUSE_D],
|
|
186
|
+
[HOUSE_W, -HOUSE_D],
|
|
187
|
+
[HOUSE_W, HOUSE_D],
|
|
188
|
+
[-HOUSE_W, HOUSE_D],
|
|
189
|
+
],
|
|
190
|
+
};
|
|
191
|
+
nodes.zone_garden = {
|
|
192
|
+
object: 'node',
|
|
193
|
+
id: 'zone_garden',
|
|
194
|
+
type: 'zone',
|
|
195
|
+
parentId: 'level_0',
|
|
196
|
+
visible: true,
|
|
197
|
+
metadata: {},
|
|
198
|
+
name: 'Back garden',
|
|
199
|
+
color: '#86efac',
|
|
200
|
+
polygon: [
|
|
201
|
+
[-HOUSE_W, -HOUSE_D - GARDEN_DEPTH],
|
|
202
|
+
[HOUSE_W, -HOUSE_D - GARDEN_DEPTH],
|
|
203
|
+
[HOUSE_W, -HOUSE_D],
|
|
204
|
+
[-HOUSE_W, -HOUSE_D],
|
|
205
|
+
],
|
|
206
|
+
};
|
|
207
|
+
// Privacy fence along 3 sides of the garden.
|
|
208
|
+
nodes.fence_n = fence('fence_n', [-HOUSE_W, -HOUSE_D - GARDEN_DEPTH], [HOUSE_W, -HOUSE_D - GARDEN_DEPTH]);
|
|
209
|
+
nodes.fence_e = fence('fence_e', [HOUSE_W, -HOUSE_D - GARDEN_DEPTH], [HOUSE_W, -HOUSE_D]);
|
|
210
|
+
nodes.fence_w = fence('fence_w', [-HOUSE_W, -HOUSE_D], [-HOUSE_W, -HOUSE_D - GARDEN_DEPTH]);
|
|
211
|
+
nodes.level_0 = {
|
|
212
|
+
object: 'node',
|
|
213
|
+
id: 'level_0',
|
|
214
|
+
type: 'level',
|
|
215
|
+
parentId: 'building_garden',
|
|
216
|
+
visible: true,
|
|
217
|
+
metadata: {},
|
|
218
|
+
level: 0,
|
|
219
|
+
children: [
|
|
220
|
+
'wall_n',
|
|
221
|
+
'wall_e',
|
|
222
|
+
'wall_s',
|
|
223
|
+
'wall_w',
|
|
224
|
+
'zone_living',
|
|
225
|
+
'zone_garden',
|
|
226
|
+
'fence_n',
|
|
227
|
+
'fence_e',
|
|
228
|
+
'fence_w',
|
|
229
|
+
],
|
|
230
|
+
};
|
|
231
|
+
nodes.site_garden.children = [nodes.building_garden];
|
|
232
|
+
return {
|
|
233
|
+
nodes: nodes,
|
|
234
|
+
rootNodeIds: ['site_garden'],
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
export const template = buildTemplate();
|
|
238
|
+
export const metadata = {
|
|
239
|
+
id: 'garden-house',
|
|
240
|
+
name: 'Garden house',
|
|
241
|
+
description: '12 × 8 m single-level house with a fenced back-garden zone; 4 walls, 2 doors, 4 windows, 3 privacy fences.',
|
|
242
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SceneGraph } from '@pascal-app/core/clone-scene-graph';
|
|
2
|
+
export type TemplateMetadata = {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
};
|
|
7
|
+
export type TemplateEntry = {
|
|
8
|
+
/** Stable template id used by `create_from_template`. */
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
/** Static SceneGraph — ids are placeholders; regenerate via `cloneSceneGraph`. */
|
|
13
|
+
template: SceneGraph;
|
|
14
|
+
};
|
|
15
|
+
export declare const TEMPLATES: {
|
|
16
|
+
readonly 'empty-studio': TemplateEntry;
|
|
17
|
+
readonly 'two-bedroom': TemplateEntry;
|
|
18
|
+
readonly 'garden-house': TemplateEntry;
|
|
19
|
+
};
|
|
20
|
+
export type TemplateId = keyof typeof TEMPLATES;
|
|
21
|
+
/** Type guard for external callers that receive arbitrary string ids. */
|
|
22
|
+
export declare function isTemplateId(id: string): id is TemplateId;
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAA;AAKpE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,yDAAyD;IACzD,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,kFAAkF;IAClF,QAAQ,EAAE,UAAU,CAAA;CACrB,CAAA;AAWD,eAAO,MAAM,SAAS;;;;CAIZ,CAAA;AAEV,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,SAAS,CAAA;AAE/C,yEAAyE;AACzE,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,EAAE,IAAI,UAAU,CAEzD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as emptyStudio from './empty-studio';
|
|
2
|
+
import * as gardenHouse from './garden-house';
|
|
3
|
+
import * as twoBedroom from './two-bedroom';
|
|
4
|
+
function makeEntry(template, metadata) {
|
|
5
|
+
return {
|
|
6
|
+
id: metadata.id,
|
|
7
|
+
name: metadata.name,
|
|
8
|
+
description: metadata.description,
|
|
9
|
+
template,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export const TEMPLATES = {
|
|
13
|
+
'empty-studio': makeEntry(emptyStudio.template, emptyStudio.metadata),
|
|
14
|
+
'two-bedroom': makeEntry(twoBedroom.template, twoBedroom.metadata),
|
|
15
|
+
'garden-house': makeEntry(gardenHouse.template, gardenHouse.metadata),
|
|
16
|
+
};
|
|
17
|
+
/** Type guard for external callers that receive arbitrary string ids. */
|
|
18
|
+
export function isTemplateId(id) {
|
|
19
|
+
return Object.hasOwn(TEMPLATES, id);
|
|
20
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SceneGraph } from '@pascal-app/core/clone-scene-graph';
|
|
2
|
+
export declare const template: SceneGraph;
|
|
3
|
+
export declare const metadata: {
|
|
4
|
+
readonly id: "two-bedroom";
|
|
5
|
+
readonly name: "Two-bedroom apartment";
|
|
6
|
+
readonly description: "80 m² two-bedroom flat: 9 walls, 4 zones (living/kitchen, 2 bedrooms, bath), 4 doors and 5 windows.";
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=two-bedroom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"two-bedroom.d.ts","sourceRoot":"","sources":["../../src/templates/two-bedroom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAA;AA+SpE,eAAO,MAAM,QAAQ,EAAE,UAA4B,CAAA;AAEnD,eAAO,MAAM,QAAQ;;;;CAKX,CAAA"}
|