@pascal-app/mcp 1.0.0-beta.6 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +21 -0
  3. package/README.md +1 -1
  4. package/dist/bin/pascal-mcp.d.ts +1 -1
  5. package/dist/bin/pascal-mcp.js +7 -7
  6. package/dist/bridge/index.d.ts +2 -2
  7. package/dist/bridge/index.js +1 -1
  8. package/dist/bridge/scene-bridge.d.ts +2 -2
  9. package/dist/bridge/scene-bridge.d.ts.map +1 -1
  10. package/dist/bridge/scene-bridge.js +3 -3
  11. package/dist/index.d.ts +4 -4
  12. package/dist/index.js +4 -4
  13. package/dist/operations/index.d.ts +1 -1
  14. package/dist/operations/index.js +1 -1
  15. package/dist/operations/scene-operations.d.ts +2 -2
  16. package/dist/prompts/from-brief.d.ts +1 -1
  17. package/dist/prompts/from-brief.d.ts.map +1 -1
  18. package/dist/prompts/from-brief.js +2 -1
  19. package/dist/prompts/index.d.ts +1 -1
  20. package/dist/prompts/index.js +3 -3
  21. package/dist/prompts/iterate-on-feedback.d.ts +1 -1
  22. package/dist/prompts/iterate-on-feedback.js +1 -1
  23. package/dist/prompts/renovation-from-photos.d.ts +1 -1
  24. package/dist/resources/agent-guide.d.ts +1 -1
  25. package/dist/resources/agent-guide.d.ts.map +1 -1
  26. package/dist/resources/agent-guide.js +1 -0
  27. package/dist/resources/catalog-items.d.ts +1 -1
  28. package/dist/resources/catalog-items.js +1 -1
  29. package/dist/resources/constraints.d.ts +1 -1
  30. package/dist/resources/index.d.ts +1 -1
  31. package/dist/resources/index.js +5 -5
  32. package/dist/resources/scene-current.d.ts +1 -1
  33. package/dist/resources/scene-summary.d.ts +1 -1
  34. package/dist/server.d.ts +14 -3
  35. package/dist/server.d.ts.map +1 -1
  36. package/dist/server.js +60 -6
  37. package/dist/storage/index.d.ts +4 -4
  38. package/dist/storage/index.js +4 -4
  39. package/dist/storage/sqlite-scene-store.d.ts +1 -1
  40. package/dist/storage/sqlite-scene-store.js +3 -3
  41. package/dist/templates/index.js +3 -3
  42. package/dist/tools/annotations.d.ts +28 -0
  43. package/dist/tools/annotations.d.ts.map +1 -0
  44. package/dist/tools/annotations.js +27 -0
  45. package/dist/tools/apply-patch.d.ts +8 -1
  46. package/dist/tools/apply-patch.d.ts.map +1 -1
  47. package/dist/tools/apply-patch.js +9 -5
  48. package/dist/tools/check-collisions.d.ts +60 -1
  49. package/dist/tools/check-collisions.d.ts.map +1 -1
  50. package/dist/tools/check-collisions.js +242 -21
  51. package/dist/tools/construction-tools.d.ts +24 -2
  52. package/dist/tools/construction-tools.d.ts.map +1 -1
  53. package/dist/tools/construction-tools.js +36 -10
  54. package/dist/tools/create-level.d.ts +8 -1
  55. package/dist/tools/create-level.d.ts.map +1 -1
  56. package/dist/tools/create-level.js +9 -6
  57. package/dist/tools/create-unit.d.ts +27 -0
  58. package/dist/tools/create-unit.d.ts.map +1 -0
  59. package/dist/tools/create-unit.js +36 -0
  60. package/dist/tools/create-wall.d.ts +8 -1
  61. package/dist/tools/create-wall.d.ts.map +1 -1
  62. package/dist/tools/create-wall.js +9 -6
  63. package/dist/tools/cut-opening.d.ts +8 -1
  64. package/dist/tools/cut-opening.d.ts.map +1 -1
  65. package/dist/tools/cut-opening.js +10 -7
  66. package/dist/tools/delete-node.d.ts +8 -1
  67. package/dist/tools/delete-node.d.ts.map +1 -1
  68. package/dist/tools/delete-node.js +8 -5
  69. package/dist/tools/describe-node.d.ts +1 -1
  70. package/dist/tools/describe-node.d.ts.map +1 -1
  71. package/dist/tools/describe-node.js +5 -3
  72. package/dist/tools/door-clearance.d.ts +19 -3
  73. package/dist/tools/door-clearance.d.ts.map +1 -1
  74. package/dist/tools/door-clearance.js +102 -8
  75. package/dist/tools/duplicate-level.d.ts +8 -1
  76. package/dist/tools/duplicate-level.d.ts.map +1 -1
  77. package/dist/tools/duplicate-level.js +8 -4
  78. package/dist/tools/export-glb.d.ts +1 -1
  79. package/dist/tools/export-glb.d.ts.map +1 -1
  80. package/dist/tools/export-glb.js +4 -2
  81. package/dist/tools/export-json.d.ts +1 -1
  82. package/dist/tools/export-json.d.ts.map +1 -1
  83. package/dist/tools/export-json.js +2 -0
  84. package/dist/tools/find-nodes.d.ts +1 -1
  85. package/dist/tools/find-nodes.d.ts.map +1 -1
  86. package/dist/tools/find-nodes.js +3 -1
  87. package/dist/tools/get-node.d.ts +1 -1
  88. package/dist/tools/get-node.d.ts.map +1 -1
  89. package/dist/tools/get-node.js +4 -2
  90. package/dist/tools/get-scene.d.ts +1 -1
  91. package/dist/tools/get-scene.d.ts.map +1 -1
  92. package/dist/tools/get-scene.js +2 -0
  93. package/dist/tools/index.d.ts +1 -1
  94. package/dist/tools/index.d.ts.map +1 -1
  95. package/dist/tools/index.js +32 -26
  96. package/dist/tools/layout-clearance.d.ts +4 -2
  97. package/dist/tools/layout-clearance.d.ts.map +1 -1
  98. package/dist/tools/layout-clearance.js +7 -3
  99. package/dist/tools/list-units.d.ts +38 -0
  100. package/dist/tools/list-units.d.ts.map +1 -0
  101. package/dist/tools/list-units.js +61 -0
  102. package/dist/tools/live-sync.d.ts +34 -4
  103. package/dist/tools/live-sync.d.ts.map +1 -1
  104. package/dist/tools/live-sync.js +38 -6
  105. package/dist/tools/measure.d.ts +2 -1
  106. package/dist/tools/measure.d.ts.map +1 -1
  107. package/dist/tools/measure.js +6 -2
  108. package/dist/tools/normalize-schema-dialect.d.ts +3 -0
  109. package/dist/tools/normalize-schema-dialect.d.ts.map +1 -0
  110. package/dist/tools/normalize-schema-dialect.js +28 -0
  111. package/dist/tools/photo-to-scene/index.d.ts +2 -2
  112. package/dist/tools/photo-to-scene/index.js +2 -2
  113. package/dist/tools/photo-to-scene/photo-to-scene.d.ts +1 -1
  114. package/dist/tools/photo-to-scene/photo-to-scene.d.ts.map +1 -1
  115. package/dist/tools/photo-to-scene/photo-to-scene.js +5 -3
  116. package/dist/tools/place-item.d.ts +8 -1
  117. package/dist/tools/place-item.d.ts.map +1 -1
  118. package/dist/tools/place-item.js +11 -7
  119. package/dist/tools/redo.d.ts +8 -1
  120. package/dist/tools/redo.d.ts.map +1 -1
  121. package/dist/tools/redo.js +6 -4
  122. package/dist/tools/room-tools.d.ts +29 -1
  123. package/dist/tools/room-tools.d.ts.map +1 -1
  124. package/dist/tools/room-tools.js +27 -12
  125. package/dist/tools/scene-lifecycle/create-project.d.ts +1 -1
  126. package/dist/tools/scene-lifecycle/create-project.d.ts.map +1 -1
  127. package/dist/tools/scene-lifecycle/create-project.js +4 -2
  128. package/dist/tools/scene-lifecycle/delete-scene.d.ts +1 -1
  129. package/dist/tools/scene-lifecycle/delete-scene.d.ts.map +1 -1
  130. package/dist/tools/scene-lifecycle/delete-scene.js +4 -2
  131. package/dist/tools/scene-lifecycle/get-project-status.d.ts +1 -1
  132. package/dist/tools/scene-lifecycle/get-project-status.d.ts.map +1 -1
  133. package/dist/tools/scene-lifecycle/get-project-status.js +4 -2
  134. package/dist/tools/scene-lifecycle/index.d.ts +8 -8
  135. package/dist/tools/scene-lifecycle/index.js +14 -14
  136. package/dist/tools/scene-lifecycle/list-scenes.d.ts +1 -1
  137. package/dist/tools/scene-lifecycle/list-scenes.d.ts.map +1 -1
  138. package/dist/tools/scene-lifecycle/list-scenes.js +3 -1
  139. package/dist/tools/scene-lifecycle/load-scene.d.ts +1 -1
  140. package/dist/tools/scene-lifecycle/load-scene.d.ts.map +1 -1
  141. package/dist/tools/scene-lifecycle/load-scene.js +4 -2
  142. package/dist/tools/scene-lifecycle/metadata.d.ts +3 -3
  143. package/dist/tools/scene-lifecycle/rename-scene.d.ts +1 -1
  144. package/dist/tools/scene-lifecycle/rename-scene.d.ts.map +1 -1
  145. package/dist/tools/scene-lifecycle/rename-scene.js +4 -2
  146. package/dist/tools/scene-lifecycle/save-scene.d.ts +1 -1
  147. package/dist/tools/scene-lifecycle/save-scene.d.ts.map +1 -1
  148. package/dist/tools/scene-lifecycle/save-scene.js +6 -4
  149. package/dist/tools/scene-lifecycle/test-utils.d.ts +7 -3
  150. package/dist/tools/scene-lifecycle/test-utils.d.ts.map +1 -1
  151. package/dist/tools/scene-lifecycle/test-utils.js +28 -4
  152. package/dist/tools/scene-query.d.ts +1 -1
  153. package/dist/tools/scene-query.d.ts.map +1 -1
  154. package/dist/tools/scene-query.js +9 -3
  155. package/dist/tools/set-unit-members.d.ts +20 -0
  156. package/dist/tools/set-unit-members.d.ts.map +1 -0
  157. package/dist/tools/set-unit-members.js +43 -0
  158. package/dist/tools/set-zone.d.ts +8 -1
  159. package/dist/tools/set-zone.d.ts.map +1 -1
  160. package/dist/tools/set-zone.js +8 -5
  161. package/dist/tools/templates/create-from-template.d.ts +1 -1
  162. package/dist/tools/templates/create-from-template.d.ts.map +1 -1
  163. package/dist/tools/templates/create-from-template.js +7 -5
  164. package/dist/tools/templates/create-house-from-brief.d.ts +1 -1
  165. package/dist/tools/templates/create-house-from-brief.d.ts.map +1 -1
  166. package/dist/tools/templates/create-house-from-brief.js +7 -5
  167. package/dist/tools/templates/index.d.ts +4 -4
  168. package/dist/tools/templates/index.js +6 -6
  169. package/dist/tools/templates/list-templates.d.ts.map +1 -1
  170. package/dist/tools/templates/list-templates.js +3 -1
  171. package/dist/tools/undo.d.ts +8 -1
  172. package/dist/tools/undo.d.ts.map +1 -1
  173. package/dist/tools/undo.js +6 -4
  174. package/dist/tools/unit-members.d.ts +4 -0
  175. package/dist/tools/unit-members.d.ts.map +1 -0
  176. package/dist/tools/unit-members.js +24 -0
  177. package/dist/tools/validate-scene.d.ts +1 -1
  178. package/dist/tools/validate-scene.d.ts.map +1 -1
  179. package/dist/tools/validate-scene.js +2 -0
  180. package/dist/tools/variants/generate-variants.d.ts +1 -1
  181. package/dist/tools/variants/generate-variants.d.ts.map +1 -1
  182. package/dist/tools/variants/generate-variants.js +4 -2
  183. package/dist/tools/variants/index.d.ts +3 -3
  184. package/dist/tools/variants/index.js +3 -3
  185. package/dist/tools/vision/analyze-floorplan-image.d.ts +1 -1
  186. package/dist/tools/vision/analyze-floorplan-image.d.ts.map +1 -1
  187. package/dist/tools/vision/analyze-floorplan-image.js +3 -1
  188. package/dist/tools/vision/analyze-room-photo.d.ts +1 -1
  189. package/dist/tools/vision/analyze-room-photo.d.ts.map +1 -1
  190. package/dist/tools/vision/analyze-room-photo.js +3 -1
  191. package/dist/tools/vision/index.d.ts +3 -3
  192. package/dist/tools/vision/index.js +4 -4
  193. package/package.json +8 -7
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { ErrorCode, throwMcpError } from '../errors';
2
+ import { READ_ONLY_TOOL_ANNOTATIONS } from '../annotations.js';
3
+ import { ErrorCode, throwMcpError } from '../errors.js';
3
4
  const DEFAULT_LIMIT = 100;
4
5
  export const listScenesInput = {
5
6
  projectId: z.string().optional(),
@@ -29,6 +30,7 @@ export function registerListScenes(server, operations) {
29
30
  description: 'List scenes in the SceneStore. Optionally filter by `projectId` and cap results with `limit` (default 100).',
30
31
  inputSchema: listScenesInput,
31
32
  outputSchema: listScenesOutput,
33
+ annotations: READ_ONLY_TOOL_ANNOTATIONS,
32
34
  }, async ({ projectId, limit }) => {
33
35
  try {
34
36
  const scenes = await operations.listScenes({
@@ -1,6 +1,6 @@
1
1
  import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import { z } from 'zod';
3
- import type { SceneOperations } from '../../operations';
3
+ import type { SceneOperations } from '../../operations/index.js';
4
4
  export declare const loadSceneInput: {
5
5
  id: z.ZodString;
6
6
  };
@@ -1 +1 @@
1
- {"version":3,"file":"load-scene.d.ts","sourceRoot":"","sources":["../../../src/tools/scene-lifecycle/load-scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAIvD,eAAO,MAAM,cAAc;;CAE1B,CAAA;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;CAmB3B,CAAA;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAgClF"}
1
+ {"version":3,"file":"load-scene.d.ts","sourceRoot":"","sources":["../../../src/tools/scene-lifecycle/load-scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAKvD,eAAO,MAAM,cAAc;;CAE1B,CAAA;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;CAmB3B,CAAA;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAiClF"}
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
- import { ErrorCode, throwMcpError } from '../errors';
3
- import { currentLevelContext, sceneMetaPayload } from './metadata';
2
+ import { DESTRUCTIVE_TOOL_ANNOTATIONS } from '../annotations.js';
3
+ import { ErrorCode, throwMcpError } from '../errors.js';
4
+ import { currentLevelContext, sceneMetaPayload } from './metadata.js';
4
5
  export const loadSceneInput = {
5
6
  id: z.string().min(1).max(64),
6
7
  };
@@ -30,6 +31,7 @@ export function registerLoadScene(server, bridge) {
30
31
  description: 'Load a scene from the SceneStore into the bridge. Returns the scene metadata. Throws `scene_not_found` if the id does not exist.',
31
32
  inputSchema: loadSceneInput,
32
33
  outputSchema: loadSceneOutput,
34
+ annotations: DESTRUCTIVE_TOOL_ANNOTATIONS,
33
35
  }, async ({ id }) => {
34
36
  const result = await bridge.loadStoredScene(id);
35
37
  if (!result) {
@@ -1,6 +1,6 @@
1
1
  import type { SceneGraph } from '@pascal-app/core/clone-scene-graph';
2
- import type { SceneOperations } from '../../operations';
3
- import type { ProjectStatus, SceneMeta } from '../../storage/types';
2
+ import type { SceneOperations } from '../../operations/index.js';
3
+ import type { ProjectStatus, SceneMeta } from '../../storage/types.js';
4
4
  export declare function computeGraphHash(graph: SceneGraph): string;
5
5
  export declare function editorUrlFor(meta: Pick<SceneMeta, 'id' | 'editorUrl' | 'url'>): string;
6
6
  export declare function sceneMetaPayload(meta: SceneMeta, graph?: SceneGraph): {
@@ -18,7 +18,7 @@ export declare function sceneMetaPayload(meta: SceneMeta, graph?: SceneGraph): {
18
18
  url: string;
19
19
  published: boolean;
20
20
  isDraft: boolean;
21
- saveMode: import("../../storage").SceneSaveMode;
21
+ saveMode: import("../../storage/index.js").SceneSaveMode;
22
22
  graphHash: string | undefined;
23
23
  };
24
24
  export declare function projectStatusPayload(status: ProjectStatus, nextStep?: string): {
@@ -1,6 +1,6 @@
1
1
  import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import { z } from 'zod';
3
- import type { SceneOperations } from '../../operations';
3
+ import type { SceneOperations } from '../../operations/index.js';
4
4
  export declare const renameSceneInput: {
5
5
  id: z.ZodString;
6
6
  newName: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"rename-scene.d.ts","sourceRoot":"","sources":["../../../src/tools/scene-lifecycle/rename-scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAIvD,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAA;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;CAW7B,CAAA;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,GAAG,IAAI,CA8CxF"}
1
+ {"version":3,"file":"rename-scene.d.ts","sourceRoot":"","sources":["../../../src/tools/scene-lifecycle/rename-scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAKvD,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAA;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;CAW7B,CAAA;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,GAAG,IAAI,CA+CxF"}
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
- import { SceneNotFoundError, SceneVersionConflictError } from '../../storage/types';
3
- import { ErrorCode, throwMcpError } from '../errors';
2
+ import { SceneNotFoundError, SceneVersionConflictError } from '../../storage/types.js';
3
+ import { DESTRUCTIVE_TOOL_ANNOTATIONS } from '../annotations.js';
4
+ import { ErrorCode, throwMcpError } from '../errors.js';
4
5
  export const renameSceneInput = {
5
6
  id: z.string().min(1).max(64),
6
7
  newName: z.string().min(1).max(200),
@@ -24,6 +25,7 @@ export function registerRenameScene(server, operations) {
24
25
  description: 'Rename a scene in the SceneStore. Returns the updated SceneMeta. Optionally pass `expectedVersion` for optimistic concurrency.',
25
26
  inputSchema: renameSceneInput,
26
27
  outputSchema: renameSceneOutput,
28
+ annotations: DESTRUCTIVE_TOOL_ANNOTATIONS,
27
29
  }, async ({ id, newName, expectedVersion }) => {
28
30
  try {
29
31
  const meta = await operations.renameStoredScene(id, newName, {
@@ -1,6 +1,6 @@
1
1
  import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import { z } from 'zod';
3
- import type { SceneOperations } from '../../operations';
3
+ import type { SceneOperations } from '../../operations/index.js';
4
4
  export declare const saveSceneInput: {
5
5
  id: z.ZodOptional<z.ZodString>;
6
6
  name: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"save-scene.d.ts","sourceRoot":"","sources":["../../../src/tools/scene-lifecycle/save-scene.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,kBAAkB,CAAA;AAMvD,eAAO,MAAM,cAAc;;;;;;;;;;;;;CA0B1B,CAAA;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;CAmB3B,CAAA;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAiGlF"}
1
+ {"version":3,"file":"save-scene.d.ts","sourceRoot":"","sources":["../../../src/tools/scene-lifecycle/save-scene.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,kBAAkB,CAAA;AAOvD,eAAO,MAAM,cAAc;;;;;;;;;;;;;CA0B1B,CAAA;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;CAmB3B,CAAA;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAkGlF"}
@@ -1,9 +1,10 @@
1
1
  import { AnyNode } from '@pascal-app/core/schema';
2
2
  import { z } from 'zod';
3
- import { SceneVersionConflictError } from '../../storage/types';
4
- import { ErrorCode, throwMcpError } from '../errors';
5
- import { appendLiveSceneEvent } from '../live-sync';
6
- import { currentLevelContext, sceneMetaPayload } from './metadata';
3
+ import { SceneVersionConflictError } from '../../storage/types.js';
4
+ import { DESTRUCTIVE_TOOL_ANNOTATIONS } from '../annotations.js';
5
+ import { ErrorCode, throwMcpError } from '../errors.js';
6
+ import { appendLiveSceneEvent } from '../live-sync.js';
7
+ import { currentLevelContext, sceneMetaPayload } from './metadata.js';
7
8
  export const saveSceneInput = {
8
9
  id: z.string().min(1).max(64).optional(),
9
10
  name: z.string().min(1).max(200),
@@ -53,6 +54,7 @@ export function registerSaveScene(server, bridge) {
53
54
  description: 'Save the current scene (or a provided graph) to the SceneStore. Defaults to a browser-visible draft save so agents can iterate without creating many project versions. Use saveMode: "checkpoint" for meaningful version history.',
54
55
  inputSchema: saveSceneInput,
55
56
  outputSchema: saveSceneOutput,
57
+ annotations: DESTRUCTIVE_TOOL_ANNOTATIONS,
56
58
  }, async ({ id, name, projectId, expectedVersion, saveMode, publish, thumbnail, includeCurrentScene, graph, }) => {
57
59
  let sceneGraph;
58
60
  if (includeCurrentScene) {
@@ -1,6 +1,6 @@
1
- import { SceneBridge } from '../../bridge/scene-bridge';
2
- import { type SceneOperations } from '../../operations';
3
- import { type ProjectCreateOptions, type ProjectStatus, type SceneListOptions, type SceneMeta, type SceneMutateOptions, type SceneSaveOptions, type SceneStore, type SceneWithGraph } from '../../storage/types';
1
+ import { SceneBridge } from '../../bridge/scene-bridge.js';
2
+ import { type SceneOperations } from '../../operations/index.js';
3
+ import { type ProjectCreateOptions, type ProjectStatus, type SceneEvent, type SceneEventAppendOptions, type SceneEventListOptions, type SceneListOptions, type SceneMeta, type SceneMutateOptions, type SceneSaveOptions, type SceneStore, type SceneWithGraph } from '../../storage/types.js';
4
4
  export type StoredTextContent = {
5
5
  type: string;
6
6
  text: string;
@@ -23,8 +23,10 @@ export declare class InMemorySceneStore implements SceneStore {
23
23
  readonly backend: "sqlite";
24
24
  private readonly data;
25
25
  private readonly projects;
26
+ private readonly events;
26
27
  private idCounter;
27
28
  private projectCounter;
29
+ private eventCounter;
28
30
  createProject(opts: ProjectCreateOptions): Promise<ProjectStatus>;
29
31
  getProjectStatus(id: string): Promise<ProjectStatus | null>;
30
32
  save(opts: SceneSaveOptions): Promise<SceneMeta>;
@@ -32,6 +34,8 @@ export declare class InMemorySceneStore implements SceneStore {
32
34
  list(opts?: SceneListOptions): Promise<SceneMeta[]>;
33
35
  delete(id: string, opts?: SceneMutateOptions): Promise<boolean>;
34
36
  rename(id: string, newName: string, opts?: SceneMutateOptions): Promise<SceneMeta>;
37
+ appendSceneEvent(opts: SceneEventAppendOptions): Promise<SceneEvent>;
38
+ listSceneEvents(sceneId: string, opts?: SceneEventListOptions): Promise<SceneEvent[]>;
35
39
  private touchProject;
36
40
  private toMeta;
37
41
  private toProjectStatus;
@@ -1 +1 @@
1
- {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../../src/tools/scene-lifecycle/test-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAC9E,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,kBAAkB,EAEvB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EAEf,KAAK,cAAc,EACpB,MAAM,qBAAqB,CAAA;AAG5B,MAAM,MAAM,iBAAiB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAE9D,wBAAgB,aAAa,CAAC,OAAO,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEnF;AAED,wBAAgB,yBAAyB,CAAC,OAAO,CAAC,EAAE;IAClD,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,KAAK,CAAC,EAAE,kBAAkB,CAAA;CAC3B,GAAG;IACF,MAAM,EAAE,WAAW,CAAA;IACnB,KAAK,EAAE,kBAAkB,CAAA;IACzB,UAAU,EAAE,eAAe,CAAA;CAC5B,CAKA;AAED;;;;GAIG;AACH,qBAAa,kBAAmB,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OAAO,CAAC,SAAS,EAAE,CAAC;IAanD,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,OAAO,CAAC;IAW/D,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,SAAS,CAAC;IAmBlF,gBAAgB,CAAC,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC;IAapE,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAU3F,OAAO,CAAC,YAAY;IAiBpB,OAAO,CAAC,MAAM;IAoBd,OAAO,CAAC,eAAe;CA0BxB"}
@@ -1,7 +1,7 @@
1
- import { SceneBridge } from '../../bridge/scene-bridge';
2
- import { createSceneOperations } from '../../operations';
3
- import { SceneNotFoundError, SceneVersionConflictError, } from '../../storage/types';
4
- import { computeGraphHash, editorUrlFor } from './metadata';
1
+ import { SceneBridge } from '../../bridge/scene-bridge.js';
2
+ import { createSceneOperations } from '../../operations/index.js';
3
+ import { SceneNotFoundError, SceneVersionConflictError, } from '../../storage/types.js';
4
+ import { computeGraphHash, editorUrlFor } from './metadata.js';
5
5
  export function parseToolText(content) {
6
6
  return JSON.parse(content[0].text);
7
7
  }
@@ -20,8 +20,10 @@ export class InMemorySceneStore {
20
20
  backend = 'sqlite';
21
21
  data = new Map();
22
22
  projects = new Map();
23
+ events = [];
23
24
  idCounter = 0;
24
25
  projectCounter = 0;
26
+ eventCounter = 0;
25
27
  async createProject(opts) {
26
28
  const id = opts.id ?? `project_${++this.projectCounter}`;
27
29
  const now = new Date().toISOString();
@@ -147,6 +149,28 @@ export class InMemorySceneStore {
147
149
  this.touchProject(id, newName, updated.updatedAt);
148
150
  return this.toMeta(updated);
149
151
  }
152
+ async appendSceneEvent(opts) {
153
+ const event = {
154
+ eventId: ++this.eventCounter,
155
+ sceneId: opts.sceneId,
156
+ version: opts.version,
157
+ kind: opts.kind,
158
+ createdAt: new Date().toISOString(),
159
+ graph: opts.graph,
160
+ };
161
+ this.events.push(event);
162
+ return event;
163
+ }
164
+ async listSceneEvents(sceneId, opts) {
165
+ let events = this.events.filter((event) => event.sceneId === sceneId);
166
+ const afterEventId = opts?.afterEventId;
167
+ if (afterEventId !== undefined) {
168
+ events = events.filter((event) => event.eventId > afterEventId);
169
+ }
170
+ if (opts?.limit !== undefined)
171
+ events = events.slice(0, opts.limit);
172
+ return events;
173
+ }
150
174
  touchProject(id, name, updatedAt) {
151
175
  const existing = this.projects.get(id);
152
176
  if (existing) {
@@ -1,7 +1,7 @@
1
1
  import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import type { AnyNode } from '@pascal-app/core/schema';
3
3
  import { z } from 'zod';
4
- import type { SceneOperations } from '../operations';
4
+ import type { SceneOperations } from '../operations/index.js';
5
5
  export declare const levelScopedInput: {
6
6
  levelId: z.ZodOptional<z.ZodString>;
7
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"scene-query.d.ts","sourceRoot":"","sources":["../../src/tools/scene-query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAQxE,OAAO,KAAK,EAAE,OAAO,EAAa,MAAM,yBAAyB,CAAA;AAEjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAYpD,eAAO,MAAM,gBAAgB;;CAE5B,CAAA;AAID,eAAO,MAAM,gBAAgB;;;;;;;CAO5B,CAAA;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;CAejC,CAAA;AAED,eAAO,MAAM,cAAc;;;CAG1B,CAAA;AAED,eAAO,MAAM,cAAc;;;CAG1B,CAAA;AAED,eAAO,MAAM,iBAAiB;;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A;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;CAY7B,CAAA;AA8CD,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,GACvC,MAAM,CAgBR;AAkWD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CA0CnF;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAiBxF;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAoBjF;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAoBjF;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAkQpF;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAMxF"}
@@ -1,9 +1,10 @@
1
1
  import { DEFAULT_LEVEL_HEIGHT, getStoredLevelHeight, getWallPlaneTop, resolveStairTotalRise, resolveWallEffectiveHeight, } from '@pascal-app/core';
2
2
  import { computeWallSlabSupport } from '@pascal-app/core/spatial-grid';
3
3
  import { z } from 'zod';
4
- import { distance2D, pointInPolygon, polygonArea, polygonContainsPolygon, wallLength, } from './geometry';
5
- import { layoutIssuesFromScene } from './layout-clearance';
6
- import { NodeIdSchema } from './schemas';
4
+ import { READ_ONLY_TOOL_ANNOTATIONS } from './annotations.js';
5
+ import { distance2D, pointInPolygon, polygonArea, polygonContainsPolygon, wallLength, } from './geometry.js';
6
+ import { layoutIssuesFromScene } from './layout-clearance.js';
7
+ import { NodeIdSchema } from './schemas.js';
7
8
  export const levelScopedInput = {
8
9
  levelId: NodeIdSchema.optional(),
9
10
  };
@@ -393,6 +394,7 @@ export function registerListLevels(server, bridge) {
393
394
  description: 'List all levels in the current scene with ids, names, floor indices, and child counts.',
394
395
  inputSchema: {},
395
396
  outputSchema: listLevelsOutput,
397
+ annotations: READ_ONLY_TOOL_ANNOTATIONS,
396
398
  }, async () => {
397
399
  const activeScene = bridge.getActiveScene();
398
400
  const levels = getLevels(bridge).map((level) => {
@@ -430,6 +432,7 @@ export function registerGetLevelSummary(server, bridge) {
430
432
  description: 'Get a compact model-friendly summary of one level: counts plus walls, zones, slabs, ceilings, and items. Omit levelId to use the first level.',
431
433
  inputSchema: levelScopedInput,
432
434
  outputSchema: getLevelSummaryOutput,
435
+ annotations: READ_ONLY_TOOL_ANNOTATIONS,
433
436
  }, async ({ levelId }) => {
434
437
  const resolved = getDefaultLevelId(bridge, levelId);
435
438
  if (!resolved)
@@ -443,6 +446,7 @@ export function registerGetWalls(server, bridge) {
443
446
  description: 'Get walls on a level with start/end coordinates, length, height, thickness, and child doors/windows. Omit levelId to use the first level.',
444
447
  inputSchema: levelScopedInput,
445
448
  outputSchema: getWallsOutput,
449
+ annotations: READ_ONLY_TOOL_ANNOTATIONS,
446
450
  }, async ({ levelId }) => {
447
451
  const resolved = getDefaultLevelId(bridge, levelId);
448
452
  if (!resolved)
@@ -459,6 +463,7 @@ export function registerGetZones(server, bridge) {
459
463
  description: 'Get room/zone polygons on a level with names, colors, bounds, and approximate areas. Omit levelId to use the first level.',
460
464
  inputSchema: levelScopedInput,
461
465
  outputSchema: getZonesOutput,
466
+ annotations: READ_ONLY_TOOL_ANNOTATIONS,
462
467
  }, async ({ levelId }) => {
463
468
  const resolved = getDefaultLevelId(bridge, levelId);
464
469
  if (!resolved)
@@ -475,6 +480,7 @@ export function registerVerifyScene(server, bridge) {
475
480
  description: 'High-level self-check after complex edits. Returns validation status, per-level room/content counts, empty levels, and practical layout issues.',
476
481
  inputSchema: {},
477
482
  outputSchema: verifySceneOutput,
483
+ annotations: READ_ONLY_TOOL_ANNOTATIONS,
478
484
  }, async () => {
479
485
  const validation = bridge.validateScene();
480
486
  const levels = getLevels(bridge).map((level) => {
@@ -0,0 +1,20 @@
1
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { z } from 'zod';
3
+ import type { SceneOperations } from '../operations/index.js';
4
+ export declare const setUnitMembersInput: {
5
+ unitId: z.ZodString;
6
+ memberZoneIds: z.ZodArray<z.ZodString>;
7
+ };
8
+ export declare const setUnitMembersOutput: {
9
+ persistence: z.ZodOptional<z.ZodObject<{
10
+ status: z.ZodEnum<{
11
+ unbound: "unbound";
12
+ events_unsupported: "events_unsupported";
13
+ }>;
14
+ warning: z.ZodString;
15
+ }, z.core.$strip>>;
16
+ unitId: z.ZodString;
17
+ memberCount: z.ZodNumber;
18
+ };
19
+ export declare function registerSetUnitMembers(server: McpServer, bridge: SceneOperations): void;
20
+ //# sourceMappingURL=set-unit-members.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set-unit-members.d.ts","sourceRoot":"","sources":["../../src/tools/set-unit-members.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAOpD,eAAO,MAAM,mBAAmB;;;CAG/B,CAAA;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;CAIhC,CAAA;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAgCvF"}
@@ -0,0 +1,43 @@
1
+ import { z } from 'zod';
2
+ import { DESTRUCTIVE_TOOL_ANNOTATIONS } from './annotations.js';
3
+ import { ErrorCode, throwMcpError } from './errors.js';
4
+ import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync.js';
5
+ import { NodeIdSchema } from './schemas.js';
6
+ import { validateUnitMembers } from './unit-members.js';
7
+ export const setUnitMembersInput = {
8
+ unitId: NodeIdSchema,
9
+ memberZoneIds: z.array(NodeIdSchema),
10
+ };
11
+ export const setUnitMembersOutput = {
12
+ unitId: z.string(),
13
+ memberCount: z.number(),
14
+ ...liveSyncOutput,
15
+ };
16
+ export function registerSetUnitMembers(server, bridge) {
17
+ server.registerTool('set_unit_members', {
18
+ title: 'Set unit members',
19
+ description: 'Replace the zones referenced by a unit. Every zone must belong to a level in the same building.',
20
+ inputSchema: setUnitMembersInput,
21
+ outputSchema: setUnitMembersOutput,
22
+ annotations: { ...DESTRUCTIVE_TOOL_ANNOTATIONS, idempotentHint: true },
23
+ }, async ({ unitId, memberZoneIds }) => {
24
+ const unit = bridge.getNode(unitId);
25
+ if (!unit) {
26
+ throwMcpError(ErrorCode.InvalidParams, `Unit not found: ${unitId}`);
27
+ }
28
+ if (unit.type !== 'unit') {
29
+ throwMcpError(ErrorCode.InvalidParams, `Node ${unitId} is a ${unit.type}, expected unit`);
30
+ }
31
+ if (!unit.parentId) {
32
+ throwMcpError(ErrorCode.InvalidParams, `Unit ${unitId} must belong to a building`);
33
+ }
34
+ const members = validateUnitMembers(bridge, unit.parentId, memberZoneIds);
35
+ bridge.updateNode(unit.id, { members });
36
+ const persistence = await publishLiveSceneSnapshot(bridge, 'set_unit_members');
37
+ const payload = { unitId, memberCount: members.length, ...persistencePayload(persistence) };
38
+ return {
39
+ content: [{ type: 'text', text: JSON.stringify(payload) }],
40
+ structuredContent: payload,
41
+ };
42
+ });
43
+ }
@@ -1,6 +1,6 @@
1
1
  import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import { z } from 'zod';
3
- import type { SceneOperations } from '../operations';
3
+ import type { SceneOperations } from '../operations/index.js';
4
4
  export declare const setZoneInput: {
5
5
  levelId: z.ZodString;
6
6
  polygon: z.ZodArray<z.ZodArray<z.ZodNumber>>;
@@ -8,6 +8,13 @@ export declare const setZoneInput: {
8
8
  properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
9
9
  };
10
10
  export declare const setZoneOutput: {
11
+ persistence: z.ZodOptional<z.ZodObject<{
12
+ status: z.ZodEnum<{
13
+ unbound: "unbound";
14
+ events_unsupported: "events_unsupported";
15
+ }>;
16
+ warning: z.ZodString;
17
+ }, z.core.$strip>>;
11
18
  zoneId: z.ZodString;
12
19
  };
13
20
  export declare function registerSetZone(server: McpServer, bridge: SceneOperations): void;
@@ -1 +1 @@
1
- {"version":3,"file":"set-zone.d.ts","sourceRoot":"","sources":["../../src/tools/set-zone.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,YAAY;;;;;CAKxB,CAAA;AAED,eAAO,MAAM,aAAa;;CAEzB,CAAA;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAgDhF"}
1
+ {"version":3,"file":"set-zone.d.ts","sourceRoot":"","sources":["../../src/tools/set-zone.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;AAMpD,eAAO,MAAM,YAAY;;;;;CAKxB,CAAA;AAED,eAAO,MAAM,aAAa;;;;;;;;;CAGzB,CAAA;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAiDhF"}
@@ -1,8 +1,9 @@
1
1
  import { ZoneNode } from '@pascal-app/core/schema';
2
2
  import { z } from 'zod';
3
- import { ErrorCode, throwMcpError } from './errors';
4
- import { publishLiveSceneSnapshot } from './live-sync';
5
- import { NodeIdSchema, Vec2Schema } from './schemas';
3
+ import { ADDITIVE_TOOL_ANNOTATIONS } from './annotations.js';
4
+ import { ErrorCode, throwMcpError } from './errors.js';
5
+ import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync.js';
6
+ import { NodeIdSchema, Vec2Schema } from './schemas.js';
6
7
  export const setZoneInput = {
7
8
  levelId: NodeIdSchema,
8
9
  polygon: z.array(Vec2Schema).min(3),
@@ -11,6 +12,7 @@ export const setZoneInput = {
11
12
  };
12
13
  export const setZoneOutput = {
13
14
  zoneId: z.string(),
15
+ ...liveSyncOutput,
14
16
  };
15
17
  export function registerSetZone(server, bridge) {
16
18
  server.registerTool('set_zone', {
@@ -18,6 +20,7 @@ export function registerSetZone(server, bridge) {
18
20
  description: 'Create a polygonal zone on the given level. label is stored as the zone name and properties are merged into metadata.',
19
21
  inputSchema: setZoneInput,
20
22
  outputSchema: setZoneOutput,
23
+ annotations: ADDITIVE_TOOL_ANNOTATIONS,
21
24
  }, async ({ levelId, polygon, label, properties }) => {
22
25
  const parent = bridge.getNode(levelId);
23
26
  if (!parent) {
@@ -38,8 +41,8 @@ export function registerSetZone(server, bridge) {
38
41
  metadata: properties ?? {},
39
42
  });
40
43
  const id = bridge.createNode(zone, levelId);
41
- await publishLiveSceneSnapshot(bridge, 'set_zone');
42
- const payload = { zoneId: id };
44
+ const persistence = await publishLiveSceneSnapshot(bridge, 'set_zone');
45
+ const payload = { zoneId: id, ...persistencePayload(persistence) };
43
46
  return {
44
47
  content: [{ type: 'text', text: JSON.stringify(payload) }],
45
48
  structuredContent: payload,
@@ -1,6 +1,6 @@
1
1
  import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import { z } from 'zod';
3
- import type { SceneOperations } from '../../operations';
3
+ import type { SceneOperations } from '../../operations/index.js';
4
4
  export declare const createFromTemplateInput: {
5
5
  id: z.ZodString;
6
6
  name: z.ZodOptional<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"create-from-template.d.ts","sourceRoot":"","sources":["../../../src/tools/templates/create-from-template.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAGxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAMvD,eAAO,MAAM,uBAAuB;;;IAYlC;;;;;OAKG;;;CAGJ,CAAA;AAED,eAAO,MAAM,wBAAwB;;;;IAInC,yEAAyE;;IAEzE,6DAA6D;;;;;;;;;;;;;;;;;;;;;;;;CAuB9D,CAAA;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CA8F3F"}
1
+ {"version":3,"file":"create-from-template.d.ts","sourceRoot":"","sources":["../../../src/tools/templates/create-from-template.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAGxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAOvD,eAAO,MAAM,uBAAuB;;;IAYlC;;;;;OAKG;;;CAGJ,CAAA;AAED,eAAO,MAAM,wBAAwB;;;;IAInC,yEAAyE;;IAEzE,6DAA6D;;;;;;;;;;;;;;;;;;;;;;;;CAuB9D,CAAA;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CA+F3F"}
@@ -1,10 +1,11 @@
1
1
  import { cloneSceneGraph } from '@pascal-app/core/clone-scene-graph';
2
2
  import { z } from 'zod';
3
- import { rehydrateSiteChildren } from '../../lib/rehydrate-site-children';
4
- import { isTemplateId, TEMPLATES } from '../../templates';
5
- import { ErrorCode, throwMcpError } from '../errors';
6
- import { appendLiveSceneEvent } from '../live-sync';
7
- import { currentLevelContext, sceneMetaPayload } from '../scene-lifecycle/metadata';
3
+ import { rehydrateSiteChildren } from '../../lib/rehydrate-site-children.js';
4
+ import { isTemplateId, TEMPLATES } from '../../templates/index.js';
5
+ import { DESTRUCTIVE_TOOL_ANNOTATIONS } from '../annotations.js';
6
+ import { ErrorCode, throwMcpError } from '../errors.js';
7
+ import { appendLiveSceneEvent } from '../live-sync.js';
8
+ import { currentLevelContext, sceneMetaPayload } from '../scene-lifecycle/metadata.js';
8
9
  export const createFromTemplateInput = {
9
10
  id: z
10
11
  .string()
@@ -68,6 +69,7 @@ export function registerCreateFromTemplate(server, bridge) {
68
69
  description: 'Instantiate a seed Pascal scene template into the bridge. Regenerates all ids before applying. When `save: true` and a SceneStore is wired, also persists the new scene and returns the SceneMeta.',
69
70
  inputSchema: createFromTemplateInput,
70
71
  outputSchema: createFromTemplateOutput,
72
+ annotations: DESTRUCTIVE_TOOL_ANNOTATIONS,
71
73
  }, async ({ id, name, save, projectId }) => {
72
74
  if (!isTemplateId(id)) {
73
75
  throwMcpError(ErrorCode.InvalidParams, `unknown_template: ${id}. Call list_templates for the set of valid ids.`);
@@ -1,6 +1,6 @@
1
1
  import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import { z } from 'zod';
3
- import type { SceneOperations } from '../../operations';
3
+ import type { SceneOperations } from '../../operations/index.js';
4
4
  export declare const createHouseFromBriefInput: {
5
5
  brief: z.ZodString;
6
6
  projectId: z.ZodOptional<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"create-house-from-brief.d.ts","sourceRoot":"","sources":["../../../src/tools/templates/create-house-from-brief.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAGxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAMvD,eAAO,MAAM,yBAAyB;;;;;;;;;CASrC,CAAA;AAED,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;CAmBtC,CAAA;AAmCD,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAqI7F"}
1
+ {"version":3,"file":"create-house-from-brief.d.ts","sourceRoot":"","sources":["../../../src/tools/templates/create-house-from-brief.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAGxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAOvD,eAAO,MAAM,yBAAyB;;;;;;;;;CASrC,CAAA;AAED,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;CAmBtC,CAAA;AAmCD,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAsI7F"}
@@ -1,10 +1,11 @@
1
1
  import { cloneSceneGraph } from '@pascal-app/core/clone-scene-graph';
2
2
  import { z } from 'zod';
3
- import { rehydrateSiteChildren } from '../../lib/rehydrate-site-children';
4
- import { isTemplateId, TEMPLATES } from '../../templates';
5
- import { ErrorCode, throwMcpError } from '../errors';
6
- import { appendLiveSceneEvent } from '../live-sync';
7
- import { currentLevelContext, sceneMetaPayload } from '../scene-lifecycle/metadata';
3
+ import { rehydrateSiteChildren } from '../../lib/rehydrate-site-children.js';
4
+ import { isTemplateId, TEMPLATES } from '../../templates/index.js';
5
+ import { DESTRUCTIVE_TOOL_ANNOTATIONS } from '../annotations.js';
6
+ import { ErrorCode, throwMcpError } from '../errors.js';
7
+ import { appendLiveSceneEvent } from '../live-sync.js';
8
+ import { currentLevelContext, sceneMetaPayload } from '../scene-lifecycle/metadata.js';
8
9
  export const createHouseFromBriefInput = {
9
10
  brief: z.string().min(1),
10
11
  projectId: z.string().optional(),
@@ -66,6 +67,7 @@ export function registerCreateHouseFromBrief(server, bridge) {
66
67
  description: 'High-level hosted workflow for external agents: choose a starter house from a brief, create/save/publish it, and return the editor URL. Use semantic tools afterward for exact customization.',
67
68
  inputSchema: createHouseFromBriefInput,
68
69
  outputSchema: createHouseFromBriefOutput,
70
+ annotations: DESTRUCTIVE_TOOL_ANNOTATIONS,
69
71
  }, async ({ brief, projectId, projectName, bedroomCount, rooms, style, landscaping, constraints, }) => {
70
72
  const templateId = chooseTemplate({
71
73
  ...(bedroomCount !== undefined ? { bedroomCount } : {}),
@@ -1,5 +1,5 @@
1
1
  import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- import type { SceneOperations } from '../../operations';
2
+ import type { SceneOperations } from '../../operations/index.js';
3
3
  /**
4
4
  * Register the template MCP tools (`list_templates`, `create_from_template`)
5
5
  * against the given server.
@@ -8,7 +8,7 @@ import type { SceneOperations } from '../../operations';
8
8
  * applies the template to the bridge but skips the save step.
9
9
  */
10
10
  export declare function registerTemplateTools(server: McpServer, bridge: SceneOperations): void;
11
- export { createFromTemplateInput, createFromTemplateOutput, registerCreateFromTemplate, } from './create-from-template';
12
- export { createHouseFromBriefInput, createHouseFromBriefOutput, registerCreateHouseFromBrief, } from './create-house-from-brief';
13
- export { listTemplatesInput, listTemplatesOutput, registerListTemplates, } from './list-templates';
11
+ export { createFromTemplateInput, createFromTemplateOutput, registerCreateFromTemplate, } from './create-from-template.js';
12
+ export { createHouseFromBriefInput, createHouseFromBriefOutput, registerCreateHouseFromBrief, } from './create-house-from-brief.js';
13
+ export { listTemplatesInput, listTemplatesOutput, registerListTemplates, } from './list-templates.js';
14
14
  //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,6 @@
1
- import { registerCreateFromTemplate } from './create-from-template';
2
- import { registerCreateHouseFromBrief } from './create-house-from-brief';
3
- import { registerListTemplates } from './list-templates';
1
+ import { registerCreateFromTemplate } from './create-from-template.js';
2
+ import { registerCreateHouseFromBrief } from './create-house-from-brief.js';
3
+ import { registerListTemplates } from './list-templates.js';
4
4
  /**
5
5
  * Register the template MCP tools (`list_templates`, `create_from_template`)
6
6
  * against the given server.
@@ -13,6 +13,6 @@ export function registerTemplateTools(server, bridge) {
13
13
  registerCreateFromTemplate(server, bridge);
14
14
  registerCreateHouseFromBrief(server, bridge);
15
15
  }
16
- export { createFromTemplateInput, createFromTemplateOutput, registerCreateFromTemplate, } from './create-from-template';
17
- export { createHouseFromBriefInput, createHouseFromBriefOutput, registerCreateHouseFromBrief, } from './create-house-from-brief';
18
- export { listTemplatesInput, listTemplatesOutput, registerListTemplates, } from './list-templates';
16
+ export { createFromTemplateInput, createFromTemplateOutput, registerCreateFromTemplate, } from './create-from-template.js';
17
+ export { createHouseFromBriefInput, createHouseFromBriefOutput, registerCreateHouseFromBrief, } from './create-house-from-brief.js';
18
+ export { listTemplatesInput, listTemplatesOutput, registerListTemplates, } from './list-templates.js';
@@ -1 +1 @@
1
- {"version":3,"file":"list-templates.d.ts","sourceRoot":"","sources":["../../../src/tools/templates/list-templates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,eAAO,MAAM,kBAAkB,IAAc,CAAA;AAE7C,eAAO,MAAM,mBAAmB;;;;;;;CAS/B,CAAA;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAwB7D"}
1
+ {"version":3,"file":"list-templates.d.ts","sourceRoot":"","sources":["../../../src/tools/templates/list-templates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,kBAAkB,IAAc,CAAA;AAE7C,eAAO,MAAM,mBAAmB;;;;;;;CAS/B,CAAA;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAyB7D"}
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
- import { TEMPLATES } from '../../templates';
2
+ import { TEMPLATES } from '../../templates/index.js';
3
+ import { READ_ONLY_TOOL_ANNOTATIONS } from '../annotations.js';
3
4
  export const listTemplatesInput = {};
4
5
  export const listTemplatesOutput = {
5
6
  templates: z.array(z.object({
@@ -20,6 +21,7 @@ export function registerListTemplates(server) {
20
21
  description: 'List the seed Pascal scene templates available to `create_from_template`. Returns the id, display name, one-line description and node count for each.',
21
22
  inputSchema: listTemplatesInput,
22
23
  outputSchema: listTemplatesOutput,
24
+ annotations: READ_ONLY_TOOL_ANNOTATIONS,
23
25
  }, async () => {
24
26
  const templates = Object.values(TEMPLATES).map((entry) => ({
25
27
  id: entry.id,
@@ -1,10 +1,17 @@
1
1
  import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import { z } from 'zod';
3
- import type { SceneOperations } from '../operations';
3
+ import type { SceneOperations } from '../operations/index.js';
4
4
  export declare const undoInput: {
5
5
  steps: z.ZodOptional<z.ZodNumber>;
6
6
  };
7
7
  export declare const undoOutput: {
8
+ persistence: z.ZodOptional<z.ZodObject<{
9
+ status: z.ZodEnum<{
10
+ unbound: "unbound";
11
+ events_unsupported: "events_unsupported";
12
+ }>;
13
+ warning: z.ZodString;
14
+ }, z.core.$strip>>;
8
15
  undone: z.ZodNumber;
9
16
  };
10
17
  export declare function registerUndo(server: McpServer, bridge: SceneOperations): void;
@@ -1 +1 @@
1
- {"version":3,"file":"undo.d.ts","sourceRoot":"","sources":["../../src/tools/undo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAGpD,eAAO,MAAM,SAAS;;CAErB,CAAA;AAED,eAAO,MAAM,UAAU;;CAEtB,CAAA;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAoB7E"}
1
+ {"version":3,"file":"undo.d.ts","sourceRoot":"","sources":["../../src/tools/undo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAIpD,eAAO,MAAM,SAAS;;CAErB,CAAA;AAED,eAAO,MAAM,UAAU;;;;;;;;;CAGtB,CAAA;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAsB7E"}