@pascal-app/mcp 1.0.0 → 1.0.3

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 (150) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +1 -1
  3. package/dist/bin/pascal-mcp.d.ts +1 -1
  4. package/dist/bin/pascal-mcp.js +7 -7
  5. package/dist/bridge/index.d.ts +2 -2
  6. package/dist/bridge/index.js +1 -1
  7. package/dist/bridge/scene-bridge.d.ts +4 -2
  8. package/dist/bridge/scene-bridge.d.ts.map +1 -1
  9. package/dist/bridge/scene-bridge.js +7 -2
  10. package/dist/index.d.ts +4 -4
  11. package/dist/index.js +4 -4
  12. package/dist/operations/index.d.ts +1 -1
  13. package/dist/operations/index.js +1 -1
  14. package/dist/operations/scene-operations.d.ts +2 -2
  15. package/dist/prompts/from-brief.d.ts +1 -1
  16. package/dist/prompts/from-brief.d.ts.map +1 -1
  17. package/dist/prompts/from-brief.js +2 -1
  18. package/dist/prompts/index.d.ts +1 -1
  19. package/dist/prompts/index.js +3 -3
  20. package/dist/prompts/iterate-on-feedback.d.ts +1 -1
  21. package/dist/prompts/iterate-on-feedback.js +1 -1
  22. package/dist/prompts/renovation-from-photos.d.ts +1 -1
  23. package/dist/resources/agent-guide.d.ts +1 -1
  24. package/dist/resources/agent-guide.d.ts.map +1 -1
  25. package/dist/resources/agent-guide.js +1 -0
  26. package/dist/resources/catalog-items.d.ts +1 -1
  27. package/dist/resources/catalog-items.js +1 -1
  28. package/dist/resources/constraints.d.ts +1 -1
  29. package/dist/resources/index.d.ts +1 -1
  30. package/dist/resources/index.js +5 -5
  31. package/dist/resources/scene-current.d.ts +1 -1
  32. package/dist/resources/scene-summary.d.ts +1 -1
  33. package/dist/server.d.ts +3 -3
  34. package/dist/server.d.ts.map +1 -1
  35. package/dist/server.js +8 -6
  36. package/dist/storage/index.d.ts +4 -4
  37. package/dist/storage/index.js +4 -4
  38. package/dist/storage/sqlite-scene-store.d.ts +1 -1
  39. package/dist/storage/sqlite-scene-store.js +3 -3
  40. package/dist/templates/index.js +3 -3
  41. package/dist/tools/apply-patch.d.ts +1 -1
  42. package/dist/tools/apply-patch.js +5 -5
  43. package/dist/tools/check-collisions.d.ts +1 -1
  44. package/dist/tools/check-collisions.js +7 -7
  45. package/dist/tools/construction-tools.d.ts +1 -1
  46. package/dist/tools/construction-tools.js +4 -4
  47. package/dist/tools/create-level.d.ts +1 -1
  48. package/dist/tools/create-level.js +5 -5
  49. package/dist/tools/create-unit.d.ts +27 -0
  50. package/dist/tools/create-unit.d.ts.map +1 -0
  51. package/dist/tools/create-unit.js +36 -0
  52. package/dist/tools/create-wall.d.ts +1 -1
  53. package/dist/tools/create-wall.js +5 -5
  54. package/dist/tools/cut-opening.d.ts +1 -1
  55. package/dist/tools/cut-opening.js +6 -6
  56. package/dist/tools/delete-node.d.ts +1 -1
  57. package/dist/tools/delete-node.js +4 -4
  58. package/dist/tools/describe-node.d.ts +1 -1
  59. package/dist/tools/describe-node.js +4 -4
  60. package/dist/tools/door-clearance.d.ts +1 -1
  61. package/dist/tools/door-clearance.js +1 -1
  62. package/dist/tools/duplicate-level.d.ts +1 -1
  63. package/dist/tools/duplicate-level.js +4 -4
  64. package/dist/tools/export-glb.d.ts +1 -1
  65. package/dist/tools/export-glb.js +1 -1
  66. package/dist/tools/export-json.d.ts +1 -1
  67. package/dist/tools/export-json.js +1 -1
  68. package/dist/tools/find-nodes.d.ts +1 -1
  69. package/dist/tools/find-nodes.js +2 -2
  70. package/dist/tools/get-node.d.ts +1 -1
  71. package/dist/tools/get-node.js +3 -3
  72. package/dist/tools/get-scene.d.ts +1 -1
  73. package/dist/tools/get-scene.js +1 -1
  74. package/dist/tools/index.d.ts +1 -1
  75. package/dist/tools/index.d.ts.map +1 -1
  76. package/dist/tools/index.js +32 -26
  77. package/dist/tools/layout-clearance.d.ts +2 -2
  78. package/dist/tools/layout-clearance.js +2 -2
  79. package/dist/tools/list-units.d.ts +38 -0
  80. package/dist/tools/list-units.d.ts.map +1 -0
  81. package/dist/tools/list-units.js +61 -0
  82. package/dist/tools/live-sync.d.ts +1 -1
  83. package/dist/tools/live-sync.js +2 -2
  84. package/dist/tools/measure.d.ts +1 -1
  85. package/dist/tools/measure.js +3 -3
  86. package/dist/tools/normalize-schema-dialect.d.ts +3 -0
  87. package/dist/tools/normalize-schema-dialect.d.ts.map +1 -0
  88. package/dist/tools/normalize-schema-dialect.js +28 -0
  89. package/dist/tools/photo-to-scene/index.d.ts +2 -2
  90. package/dist/tools/photo-to-scene/index.js +2 -2
  91. package/dist/tools/photo-to-scene/photo-to-scene.d.ts +1 -1
  92. package/dist/tools/photo-to-scene/photo-to-scene.js +4 -4
  93. package/dist/tools/place-item.d.ts +1 -1
  94. package/dist/tools/place-item.js +7 -7
  95. package/dist/tools/redo.d.ts +1 -1
  96. package/dist/tools/redo.js +2 -2
  97. package/dist/tools/room-tools.d.ts +1 -1
  98. package/dist/tools/room-tools.js +9 -9
  99. package/dist/tools/scene-lifecycle/create-project.d.ts +1 -1
  100. package/dist/tools/scene-lifecycle/create-project.js +3 -3
  101. package/dist/tools/scene-lifecycle/delete-scene.d.ts +1 -1
  102. package/dist/tools/scene-lifecycle/delete-scene.js +3 -3
  103. package/dist/tools/scene-lifecycle/get-project-status.d.ts +1 -1
  104. package/dist/tools/scene-lifecycle/get-project-status.js +3 -3
  105. package/dist/tools/scene-lifecycle/index.d.ts +8 -8
  106. package/dist/tools/scene-lifecycle/index.js +14 -14
  107. package/dist/tools/scene-lifecycle/list-scenes.d.ts +1 -1
  108. package/dist/tools/scene-lifecycle/list-scenes.js +2 -2
  109. package/dist/tools/scene-lifecycle/load-scene.d.ts +1 -1
  110. package/dist/tools/scene-lifecycle/load-scene.js +3 -3
  111. package/dist/tools/scene-lifecycle/metadata.d.ts +3 -3
  112. package/dist/tools/scene-lifecycle/rename-scene.d.ts +1 -1
  113. package/dist/tools/scene-lifecycle/rename-scene.js +3 -3
  114. package/dist/tools/scene-lifecycle/save-scene.d.ts +1 -1
  115. package/dist/tools/scene-lifecycle/save-scene.js +5 -5
  116. package/dist/tools/scene-lifecycle/test-utils.d.ts +3 -3
  117. package/dist/tools/scene-lifecycle/test-utils.js +4 -4
  118. package/dist/tools/scene-query.d.ts +1 -1
  119. package/dist/tools/scene-query.js +4 -4
  120. package/dist/tools/set-unit-members.d.ts +20 -0
  121. package/dist/tools/set-unit-members.d.ts.map +1 -0
  122. package/dist/tools/set-unit-members.js +43 -0
  123. package/dist/tools/set-zone.d.ts +1 -1
  124. package/dist/tools/set-zone.js +4 -4
  125. package/dist/tools/templates/create-from-template.d.ts +1 -1
  126. package/dist/tools/templates/create-from-template.js +6 -6
  127. package/dist/tools/templates/create-house-from-brief.d.ts +1 -1
  128. package/dist/tools/templates/create-house-from-brief.js +6 -6
  129. package/dist/tools/templates/index.d.ts +4 -4
  130. package/dist/tools/templates/index.js +6 -6
  131. package/dist/tools/templates/list-templates.js +2 -2
  132. package/dist/tools/undo.d.ts +1 -1
  133. package/dist/tools/undo.js +2 -2
  134. package/dist/tools/unit-members.d.ts +4 -0
  135. package/dist/tools/unit-members.d.ts.map +1 -0
  136. package/dist/tools/unit-members.js +24 -0
  137. package/dist/tools/validate-scene.d.ts +6 -1
  138. package/dist/tools/validate-scene.d.ts.map +1 -1
  139. package/dist/tools/validate-scene.js +9 -7
  140. package/dist/tools/variants/generate-variants.d.ts +1 -1
  141. package/dist/tools/variants/generate-variants.js +3 -3
  142. package/dist/tools/variants/index.d.ts +3 -3
  143. package/dist/tools/variants/index.js +3 -3
  144. package/dist/tools/vision/analyze-floorplan-image.d.ts +1 -1
  145. package/dist/tools/vision/analyze-floorplan-image.js +2 -2
  146. package/dist/tools/vision/analyze-room-photo.d.ts +1 -1
  147. package/dist/tools/vision/analyze-room-photo.js +2 -2
  148. package/dist/tools/vision/index.d.ts +3 -3
  149. package/dist/tools/vision/index.js +4 -4
  150. package/package.json +8 -7
package/CHANGELOG.md CHANGED
@@ -5,6 +5,17 @@ All notable changes to `@pascal-app/mcp` will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [Unreleased]
9
+
10
+ ### Fixed
11
+
12
+ - The published ESM output now resolves relative JavaScript imports under Node,
13
+ so `pascal-mcp` and package subpath exports no longer require Bun's
14
+ extensionless import fallback.
15
+ - Tool schemas in `tools/list` now declare the JSON Schema 2020-12 dialect
16
+ instead of the SDK default `draft-07`, so clients that enforce 2020-12 no
17
+ longer reject every tool call.
18
+
8
19
  ## [0.1.0] - 2026-04-18
9
20
 
10
21
  ### Added
package/README.md CHANGED
@@ -334,7 +334,7 @@ captured by Zundo's temporal middleware as a single undoable step.
334
334
  | `add_door` | Add a door to a wall using parametric placement. | `{ wallId, t, width?, height?, hingesSide?, swingDirection? }` | `{ doorId, localX }` |
335
335
  | `add_window` | Add a window to a wall using parametric placement and sill height. | `{ wallId, t, width?, height?, sillHeight? }` | `{ windowId, localX, sillHeight }` |
336
336
  | `furnish_room` | Place realistic furniture for a room type inside a polygon. | `{ levelId, roomType, polygon, doorWallIndex? }` | `{ placed, itemIds, skipped }` |
337
- | `apply_patch` | Batched create/update/delete/move, validated and dry-run before commit. | `{ patches: Patch[] }` | `{ applied: number }` |
337
+ | `apply_patch` | Batched create/update/delete/move, validated and dry-run before commit. Batch-first is the default: send all create/update/delete ops for a build step in one atomic call (stable order, later ops may reference earlier created ids); do not loop one-op calls. | `{ patches: Patch[] }` | `{ applied: number }` |
338
338
  | `create_level` | Add a new level to a building. | `{ buildingId, elevation, height, label? }` | `{ levelId }` |
339
339
  | `create_wall` | Add a wall to a level. | `{ levelId, start, end, thickness?, height? }` | `{ wallId }` |
340
340
  | `place_item` | Place a catalog item on a level/slab/zone, ceiling, wall, or site. Slab/zone targets resolve to the parent level so floor items render and validate. | `{ catalogItemId, targetNodeId, position, rotation? }` | `{ itemId, status }` |
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import '../bridge/node-shims';
2
+ import '../bridge/node-shims.js';
3
3
  //# sourceMappingURL=pascal-mcp.d.ts.map
@@ -1,14 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  // Load shims FIRST so any subsequent core import sees the RAF polyfill.
3
- import '../bridge/node-shims';
3
+ import '../bridge/node-shims.js';
4
4
  import { readFileSync } from 'node:fs';
5
5
  import { parseArgs } from 'node:util';
6
- import { SceneBridge } from '../bridge/scene-bridge';
7
- import { version } from '../index';
8
- import { createPascalMcpServer } from '../server';
9
- import { createSceneStore } from '../storage';
10
- import { connectHttp } from '../transports/http';
11
- import { connectStdio } from '../transports/stdio';
6
+ import { SceneBridge } from '../bridge/scene-bridge.js';
7
+ import { version } from '../index.js';
8
+ import { createPascalMcpServer } from '../server.js';
9
+ import { createSceneStore } from '../storage/index.js';
10
+ import { connectHttp } from '../transports/http.js';
11
+ import { connectStdio } from '../transports/stdio.js';
12
12
  const HELP = `pascal-mcp — MCP server for the Pascal editor
13
13
 
14
14
  USAGE:
@@ -1,3 +1,3 @@
1
- export type { ActiveSceneMeta, CreatePatch, DeletePatch, Patch, UpdatePatch, ValidationError, ValidationResult, } from './scene-bridge';
2
- export { SceneBridge } from './scene-bridge';
1
+ export type { ActiveSceneMeta, CreatePatch, DeletePatch, Patch, UpdatePatch, ValidationError, ValidationResult, } from './scene-bridge.js';
2
+ export { SceneBridge } from './scene-bridge.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- export { SceneBridge } from './scene-bridge';
1
+ export { SceneBridge } from './scene-bridge.js';
@@ -1,9 +1,9 @@
1
- import './node-shims';
1
+ import './node-shims.js';
2
2
  import type { SceneGraph } from '@pascal-app/core/clone-scene-graph';
3
3
  import type { AnyNode } from '@pascal-app/core/schema';
4
4
  import { type AnyNodeId, type AnyNodeType } from '@pascal-app/core/schema';
5
5
  import useScene from '@pascal-app/core/store';
6
- import type { SceneMeta } from '../storage/types';
6
+ import type { SceneMeta } from '../storage/types.js';
7
7
  export type ValidationError = {
8
8
  nodeId: string;
9
9
  path: string;
@@ -12,6 +12,8 @@ export type ValidationError = {
12
12
  export type ValidationResult = {
13
13
  valid: boolean;
14
14
  errors: ValidationError[];
15
+ /** Advisories that do not fail validation, such as a hidden Site. */
16
+ warnings: ValidationError[];
15
17
  };
16
18
  export type CreatePatch = {
17
19
  op: 'create';
@@ -1 +1 @@
1
- {"version":3,"file":"scene-bridge.d.ts","sourceRoot":"","sources":["../../src/bridge/scene-bridge.ts"],"names":[],"mappings":"AACA,OAAO,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAA;AACpE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,WAAW,EAEjB,MAAM,yBAAyB,CAAA;AAEhC,OAAO,QAAQ,MAAM,wBAAwB,CAAA;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAEjD,MAAM,MAAM,eAAe,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAC/E,MAAM,MAAM,gBAAgB,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAAE,CAAA;AAE5E,MAAM,MAAM,WAAW,GAAG;IAAE,EAAE,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,CAAA;AAC/E,MAAM,MAAM,WAAW,GAAG;IAAE,EAAE,EAAE,QAAQ,CAAC;IAAC,EAAE,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;CAAE,CAAA;AACjF,MAAM,MAAM,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ect import MUST come first: installs RAF polyfill before core loads.
2
- import './node-shims';
2
+ import './node-shims.js';
3
+ import { HIDDEN_SITE_NOTE } from '@pascal-app/core';
3
4
  import { AnyNode as AnyNodeSchema, parseNode, } from '@pascal-app/core/schema';
4
5
  // Per PLAN §0.6: `useScene` is the DEFAULT export from `@pascal-app/core/store`.
5
6
  import useScene from '@pascal-app/core/store';
@@ -407,8 +408,12 @@ export class SceneBridge {
407
408
  */
408
409
  validateScene() {
409
410
  const errors = [];
411
+ const warnings = [];
410
412
  const nodes = useScene.getState().nodes;
411
413
  for (const [id, node] of Object.entries(nodes)) {
414
+ if (node.type === 'site' && node.visible === false) {
415
+ warnings.push({ nodeId: id, path: 'visible', message: HIDDEN_SITE_NOTE });
416
+ }
412
417
  const res = AnyNodeSchema.safeParse(node);
413
418
  if (res.success)
414
419
  continue;
@@ -420,7 +425,7 @@ export class SceneBridge {
420
425
  });
421
426
  }
422
427
  }
423
- return { valid: errors.length === 0, errors };
428
+ return { valid: errors.length === 0, errors, warnings };
424
429
  }
425
430
  /**
426
431
  * Drain the dirtyNodes set. Returns the ids that were present. No-op for
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { SceneBridge } from './bridge/scene-bridge';
2
- export { createSceneOperations, type SceneOperations } from './operations';
3
- export { type CreatePascalMcpServerOptions, createPascalMcpServer } from './server';
4
- export { version } from './version';
1
+ export { SceneBridge } from './bridge/scene-bridge.js';
2
+ export { createSceneOperations, type SceneOperations } from './operations/index.js';
3
+ export { type CreatePascalMcpServerOptions, createPascalMcpServer } from './server.js';
4
+ export { version } from './version.js';
5
5
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { SceneBridge } from './bridge/scene-bridge';
2
- export { createSceneOperations } from './operations';
3
- export { createPascalMcpServer } from './server';
4
- export { version } from './version';
1
+ export { SceneBridge } from './bridge/scene-bridge.js';
2
+ export { createSceneOperations } from './operations/index.js';
3
+ export { createPascalMcpServer } from './server.js';
4
+ export { version } from './version.js';
@@ -1,2 +1,2 @@
1
- export { type CreateSceneOperationsOptions, createSceneOperations, type SceneOperations, } from './scene-operations';
1
+ export { type CreateSceneOperationsOptions, createSceneOperations, type SceneOperations, } from './scene-operations.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- export { createSceneOperations, } from './scene-operations';
1
+ export { createSceneOperations, } from './scene-operations.js';
@@ -1,7 +1,7 @@
1
1
  import type { SceneGraph } from '@pascal-app/core/clone-scene-graph';
2
2
  import type { AnyNode, AnyNodeId, AnyNodeType } from '@pascal-app/core/schema';
3
- import type { ActiveSceneMeta, Patch, SceneBridge, ValidationResult } from '../bridge/scene-bridge';
4
- import type { ProjectCreateOptions, ProjectStatus, SceneEvent, SceneEventAppendOptions, SceneEventListOptions, SceneListOptions, SceneMeta, SceneMutateOptions, SceneSaveOptions, SceneStore, SceneWithGraph } from '../storage/types';
3
+ import type { ActiveSceneMeta, Patch, SceneBridge, ValidationResult } from '../bridge/scene-bridge.js';
4
+ import type { ProjectCreateOptions, ProjectStatus, SceneEvent, SceneEventAppendOptions, SceneEventListOptions, SceneListOptions, SceneMeta, SceneMutateOptions, SceneSaveOptions, SceneStore, SceneWithGraph } from '../storage/types.js';
5
5
  export type CreateSceneOperationsOptions = {
6
6
  bridge?: SceneBridge;
7
7
  store?: SceneStore;
@@ -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
  * Build the user-facing prompt text for `from_brief`. Pure function for testability.
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"from-brief.d.ts","sourceRoot":"","sources":["../../src/prompts/from-brief.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAoBpD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACjC,GAAG,MAAM,CAeT;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI,CAwBnF"}
1
+ {"version":3,"file":"from-brief.d.ts","sourceRoot":"","sources":["../../src/prompts/from-brief.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAqBpD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACjC,GAAG,MAAM,CAeT;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI,CAwBnF"}
@@ -1,8 +1,9 @@
1
1
  import { z } from 'zod';
2
- import { SCENE_DESIGN_GUIDANCE } from './scene-guidance';
2
+ import { SCENE_DESIGN_GUIDANCE } from './scene-guidance.js';
3
3
  const PREAMBLE = [
4
4
  'You are a Pascal 3D scene designer.',
5
5
  'You have access to semantic scene tools and the lower-level `apply_patch` tool. Prefer semantic construction/room/opening/furnishing tools for architectural work, and use `apply_patch` for bulk graph edits that need exact control.',
6
+ 'One patch per phase: when a phase needs many graph edits, send all of them in a single `apply_patch` call in stable order (later ops may reference ids created by earlier ops) instead of looping one-op calls; a single call is atomic and pays the snapshot cost once.',
6
7
  'Bind an active scene before mutating anything. Call `create_project` for a new project, `list_scenes` then `load_scene` for an existing one, or `create_house_from_brief` to create and load a starter in one step. Without a bound scene, mutations apply in memory only — they are not persisted and never appear in the browser.',
7
8
  'Build incrementally with visible progress. Starting from an empty scene, first create/load a Site and Building, then create occupied Levels and `create_story_shell` once per story before detailed rooms, openings, furniture, a dedicated roof level via `create_roof`, and landscaping.',
8
9
  'Semantic tools update the browser-visible draft. Call `save_scene` with `saveMode: "checkpoint"` only for meaningful milestones, then call `verify_scene` and `get_project_status`, and return the final `editorUrl`.',
@@ -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
  * Registers all MCP prompts exposed by `@pascal-app/mcp`:
5
5
  * - `from_brief` — generate a scene from a natural-language brief
@@ -1,6 +1,6 @@
1
- import { registerFromBrief } from './from-brief';
2
- import { registerIterateOnFeedback } from './iterate-on-feedback';
3
- import { registerRenovationFromPhotos } from './renovation-from-photos';
1
+ import { registerFromBrief } from './from-brief.js';
2
+ import { registerIterateOnFeedback } from './iterate-on-feedback.js';
3
+ import { registerRenovationFromPhotos } from './renovation-from-photos.js';
4
4
  /**
5
5
  * Registers all MCP prompts exposed by `@pascal-app/mcp`:
6
6
  * - `from_brief` — generate a scene from a natural-language brief
@@ -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
  * Build the user-facing prompt text for `iterate_on_feedback`.
5
5
  * Pure function for testability.
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { SCENE_DESIGN_GUIDANCE } from './scene-guidance';
2
+ import { SCENE_DESIGN_GUIDANCE } from './scene-guidance.js';
3
3
  const PREAMBLE = [
4
4
  'You are iterating on an existing Pascal scene based on user feedback.',
5
5
  'Given the current state (read via the `pascal://scene/current` resource) and the user feedback below, propose the MINIMUM set of `apply_patch` operations that satisfies the feedback.',
@@ -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
  type PromptContent = {
4
4
  type: 'text';
5
5
  text: string;
@@ -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
  export declare const AGENT_GUIDE: string;
4
4
  export declare function registerAgentGuide(server: McpServer, _bridge: SceneOperations): void;
5
5
  //# sourceMappingURL=agent-guide.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-guide.d.ts","sourceRoot":"","sources":["../../src/resources/agent-guide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAEpD,eAAO,MAAM,WAAW,QA0DZ,CAAA;AAEZ,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI,CAuCpF"}
1
+ {"version":3,"file":"agent-guide.d.ts","sourceRoot":"","sources":["../../src/resources/agent-guide.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAEpD,eAAO,MAAM,WAAW,QA2DZ,CAAA;AAEZ,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI,CAuCpF"}
@@ -31,6 +31,7 @@ export const AGENT_GUIDE = [
31
31
  '',
32
32
  '- Prefer semantic tools over raw graph patches.',
33
33
  '- Do not hand-write node graphs unless no semantic tool exists.',
34
+ '- When you do use `apply_patch` for bulk graph edits, batch-first is the default: one call containing all create/update/delete ops for the phase, in stable order so later ops can reference ids created earlier. A single call is atomic (all or nothing); do not loop one-op `apply_patch` calls.',
34
35
  '- For rooms, use `create_room` -> `add_door` -> `add_window` -> `furnish_room`.',
35
36
  '- `furnish_room` skips or nudges poses that block door clear zones or overlap other items; `verify_scene` and `check_collisions` report remaining issues.',
36
37
  '- Between adjacent rooms, prefer one shared wall (or only cut openings that line up). Leave ~0.65 m clear on both sides of each door; do not stack furniture footprints.',
@@ -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
  * `pascal://catalog/items` — small built-in item catalog for standalone MCP.
5
5
  *
@@ -1,4 +1,4 @@
1
- import { MCP_CATALOG_ITEMS } from '../tools/asset-catalog';
1
+ import { MCP_CATALOG_ITEMS } from '../tools/asset-catalog.js';
2
2
  /**
3
3
  * `pascal://catalog/items` — small built-in item catalog for standalone MCP.
4
4
  *
@@ -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
  * `pascal://constraints/{levelId}` — per-level geometric constraints used as
5
5
  * input hints for agents: slab nodes (with polygons/holes/elevation) + each
@@ -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
  * Registers all MCP resources exposed by `@pascal-app/mcp`.
5
5
  *
@@ -1,8 +1,8 @@
1
- import { registerAgentGuide } from './agent-guide';
2
- import { registerCatalogItems } from './catalog-items';
3
- import { registerConstraints } from './constraints';
4
- import { registerSceneCurrent } from './scene-current';
5
- import { registerSceneSummary } from './scene-summary';
1
+ import { registerAgentGuide } from './agent-guide.js';
2
+ import { registerCatalogItems } from './catalog-items.js';
3
+ import { registerConstraints } from './constraints.js';
4
+ import { registerSceneCurrent } from './scene-current.js';
5
+ import { registerSceneSummary } from './scene-summary.js';
6
6
  /**
7
7
  * Registers all MCP resources exposed by `@pascal-app/mcp`.
8
8
  *
@@ -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
  * `pascal://scene/current` — full `{ nodes, rootNodeIds, collections }` snapshot.
5
5
  *
@@ -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
  /** Build the markdown summary. Pure over the SceneGraph snapshot. */
4
4
  export declare function buildSceneSummaryMarkdown(snapshot: ReturnType<SceneOperations['exportJSON']>): string;
5
5
  /**
package/dist/server.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- import type { SceneBridge } from './bridge/scene-bridge';
3
- import { type SceneOperations } from './operations';
4
- import type { SceneStore } from './storage/types';
2
+ import type { SceneBridge } from './bridge/scene-bridge.js';
3
+ import { type SceneOperations } from './operations/index.js';
4
+ import type { SceneStore } from './storage/types.js';
5
5
  export type PascalMcpToolExecutor = <Result>(input: {
6
6
  name: string;
7
7
  signal: AbortSignal;
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAuB,MAAM,yCAAyC,CAAA;AACxF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,cAAc,CAAA;AAG1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAKjD,MAAM,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE;IAClD,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,WAAW,CAAA;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A;CACpC,CAAA;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,4BAA4B,GAAG,SAAS,CAcnF"}
package/dist/server.js CHANGED
@@ -1,10 +1,11 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
- import { createSceneOperations } from './operations';
3
- import { registerPrompts } from './prompts';
4
- import { registerResources } from './resources';
5
- import { registerTools } from './tools';
6
- import { registerVisionTools } from './tools/vision';
7
- import { version } from './version';
2
+ import { createSceneOperations } from './operations/index.js';
3
+ import { registerPrompts } from './prompts/index.js';
4
+ import { registerResources } from './resources/index.js';
5
+ import { registerTools } from './tools/index.js';
6
+ import { normalizeToolSchemaDialect } from './tools/normalize-schema-dialect.js';
7
+ import { registerVisionTools } from './tools/vision/index.js';
8
+ import { version } from './version.js';
8
9
  export function createPascalMcpServer(opts) {
9
10
  const server = new McpServer({
10
11
  name: opts.name ?? 'pascal-mcp-server',
@@ -17,6 +18,7 @@ export function createPascalMcpServer(opts) {
17
18
  registerVisionTools(server, operations);
18
19
  registerResources(server, operations);
19
20
  registerPrompts(server, operations);
21
+ normalizeToolSchemaDialect(server);
20
22
  return server;
21
23
  }
22
24
  function installToolExecutor(server, executeTool) {
@@ -1,7 +1,7 @@
1
- import type { SceneStore } from './types';
2
- export * from './slug';
3
- export * from './sqlite-scene-store';
4
- export * from './types';
1
+ import type { SceneStore } from './types.js';
2
+ export * from './slug.js';
3
+ export * from './sqlite-scene-store.js';
4
+ export * from './types.js';
5
5
  /**
6
6
  * Factory for Pascal's local-first scene store.
7
7
  *
@@ -1,6 +1,6 @@
1
- export * from './slug';
2
- export * from './sqlite-scene-store';
3
- export * from './types';
1
+ export * from './slug.js';
2
+ export * from './sqlite-scene-store.js';
3
+ export * from './types.js';
4
4
  /**
5
5
  * Factory for Pascal's local-first scene store.
6
6
  *
@@ -9,6 +9,6 @@ export * from './types';
9
9
  * path or `PASCAL_DATA_DIR` for a directory containing `pascal.db`.
10
10
  */
11
11
  export async function createSceneStore(env) {
12
- const mod = await import('./sqlite-scene-store');
12
+ const mod = await import('./sqlite-scene-store.js');
13
13
  return new mod.SqliteSceneStore({ env });
14
14
  }
@@ -1,4 +1,4 @@
1
- import { type ProjectCreateOptions, type ProjectStatus, type SceneEvent, type SceneEventAppendOptions, type SceneEventListOptions, type SceneListOptions, type SceneMeta, type SceneMutateOptions, type SceneSaveOptions, type SceneStore, type SceneWithGraph } from './types';
1
+ import { type ProjectCreateOptions, type ProjectStatus, type SceneEvent, type SceneEventAppendOptions, type SceneEventListOptions, type SceneListOptions, type SceneMeta, type SceneMutateOptions, type SceneSaveOptions, type SceneStore, type SceneWithGraph } from './types.js';
2
2
  export interface SqliteSceneStoreOptions {
3
3
  /** Exact SQLite database file path. If omitted, resolved from env. */
4
4
  databasePath?: string;
@@ -3,9 +3,9 @@ import { mkdirSync } from 'node:fs';
3
3
  import * as os from 'node:os';
4
4
  import * as path from 'node:path';
5
5
  import { z } from 'zod';
6
- import { generateSlug, isValidSlug, sanitizeSlug } from './slug';
7
- import { openSqliteDatabase } from './sqlite-driver';
8
- import { SceneInvalidError, SceneNotFoundError, SceneTooLargeError, SceneVersionConflictError, } from './types';
6
+ import { generateSlug, isValidSlug, sanitizeSlug } from './slug.js';
7
+ import { openSqliteDatabase } from './sqlite-driver.js';
8
+ import { SceneInvalidError, SceneNotFoundError, SceneTooLargeError, SceneVersionConflictError, } from './types.js';
9
9
  const DEFAULT_MAX_SCENE_BYTES = 10 * 1024 * 1024;
10
10
  const DEFAULT_LIST_LIMIT = 100;
11
11
  const MAX_NAME_LENGTH = 200;
@@ -1,6 +1,6 @@
1
- import * as emptyStudio from './empty-studio';
2
- import * as gardenHouse from './garden-house';
3
- import * as twoBedroom from './two-bedroom';
1
+ import * as emptyStudio from './empty-studio.js';
2
+ import * as gardenHouse from './garden-house.js';
3
+ import * as twoBedroom from './two-bedroom.js';
4
4
  function makeEntry(template, metadata) {
5
5
  return {
6
6
  id: metadata.id,
@@ -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 applyPatchInput: {
5
5
  patches: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
6
6
  op: z.ZodLiteral<"create">;
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { DESTRUCTIVE_TOOL_ANNOTATIONS } from './annotations';
3
- import { ErrorCode, throwMcpError } from './errors';
4
- import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync';
5
- import { PatchSchema } from './schemas';
2
+ import { DESTRUCTIVE_TOOL_ANNOTATIONS } from './annotations.js';
3
+ import { ErrorCode, throwMcpError } from './errors.js';
4
+ import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync.js';
5
+ import { PatchSchema } from './schemas.js';
6
6
  export const applyPatchInput = {
7
7
  patches: z.array(PatchSchema),
8
8
  };
@@ -15,7 +15,7 @@ export const applyPatchOutput = {
15
15
  export function registerApplyPatch(server, bridge) {
16
16
  server.registerTool('apply_patch', {
17
17
  title: 'Apply patch',
18
- description: 'Apply a batch of create/update/delete operations atomically. All patches are validated before any are applied; the entire batch forms a single undo step.',
18
+ description: 'Apply a batch of create/update/delete operations atomically. All patches are validated before any are applied; the entire batch forms a single undo step. Batch-first is the default: prefer one apply_patch call containing all create/update/delete ops for a build step, in stable order so later ops can reference ids created by earlier ops. A single call is atomic (all or nothing) and pays the snapshot and save cost once; do not loop one-op calls.',
19
19
  inputSchema: applyPatchInput,
20
20
  outputSchema: applyPatchOutput,
21
21
  annotations: DESTRUCTIVE_TOOL_ANNOTATIONS,
@@ -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 checkCollisionsInput: {
5
5
  levelId: z.ZodOptional<z.ZodString>;
6
6
  minimumClearance: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>, z.ZodTransform<number, string | number>>>;
@@ -1,12 +1,12 @@
1
1
  import { ItemNode } from '@pascal-app/core/schema';
2
2
  import { z } from 'zod';
3
- import { READ_ONLY_TOOL_ANNOTATIONS } from './annotations';
4
- import { inspectItemPlanFootprint, resolveNodeLevelId } from './door-clearance';
5
- import { ErrorCode, throwMcpError } from './errors';
6
- import { findItemItemCollisions } from './layout-clearance';
7
- import { measurement } from './measurement';
8
- import { computeGraphHash } from './scene-lifecycle/metadata';
9
- import { NodeIdSchema } from './schemas';
3
+ import { READ_ONLY_TOOL_ANNOTATIONS } from './annotations.js';
4
+ import { inspectItemPlanFootprint, resolveNodeLevelId } from './door-clearance.js';
5
+ import { ErrorCode, throwMcpError } from './errors.js';
6
+ import { findItemItemCollisions } from './layout-clearance.js';
7
+ import { measurement } from './measurement.js';
8
+ import { computeGraphHash } from './scene-lifecycle/metadata.js';
9
+ import { NodeIdSchema } from './schemas.js';
10
10
  const candidatePosition = measurement('length', 'm', {
11
11
  description: 'Candidate position coordinate.',
12
12
  });
@@ -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 createStoryShellInput: {
5
5
  levelId: z.ZodString;
6
6
  footprint: z.ZodArray<z.ZodArray<z.ZodNumber>>;
@@ -1,10 +1,10 @@
1
1
  import { resolveStairTotalRise } from '@pascal-app/core';
2
2
  import { CeilingNode, getActiveRoofHeight, LevelNode, RoofNode, RoofSegmentNode, SlabNode, StairNode, StairSegmentNode, WallNode, } from '@pascal-app/core/schema';
3
3
  import { z } from 'zod';
4
- import { ADDITIVE_TOOL_ANNOTATIONS, DESTRUCTIVE_TOOL_ANNOTATIONS } from './annotations';
5
- import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync';
6
- import { measurement } from './measurement';
7
- import { NodeIdSchema, Vec2Schema, Vec3Schema } from './schemas';
4
+ import { ADDITIVE_TOOL_ANNOTATIONS, DESTRUCTIVE_TOOL_ANNOTATIONS } from './annotations.js';
5
+ import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync.js';
6
+ import { measurement } from './measurement.js';
7
+ import { NodeIdSchema, Vec2Schema, Vec3Schema } from './schemas.js';
8
8
  const ROOF_TYPES = [
9
9
  'hip',
10
10
  'gable',
@@ -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 createLevelInput: {
5
5
  buildingId: z.ZodString;
6
6
  elevation: z.ZodOptional<z.ZodNumber>;
@@ -1,11 +1,11 @@
1
1
  import { DEFAULT_LEVEL_HEIGHT } from '@pascal-app/core';
2
2
  import { LevelNode } from '@pascal-app/core/schema';
3
3
  import { z } from 'zod';
4
- import { ADDITIVE_TOOL_ANNOTATIONS } from './annotations';
5
- import { ErrorCode, throwMcpError } from './errors';
6
- import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync';
7
- import { measurement } from './measurement';
8
- import { NodeIdSchema } from './schemas';
4
+ import { ADDITIVE_TOOL_ANNOTATIONS } from './annotations.js';
5
+ import { ErrorCode, throwMcpError } from './errors.js';
6
+ import { liveSyncOutput, persistencePayload, publishLiveSceneSnapshot } from './live-sync.js';
7
+ import { measurement } from './measurement.js';
8
+ import { NodeIdSchema } from './schemas.js';
9
9
  export const createLevelInput = {
10
10
  buildingId: NodeIdSchema,
11
11
  elevation: z
@@ -0,0 +1,27 @@
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 createUnitInput: {
5
+ buildingId: z.ZodString;
6
+ name: z.ZodString;
7
+ kind: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
8
+ apartment: "apartment";
9
+ "hotel-room": "hotel-room";
10
+ commercial: "commercial";
11
+ common: "common";
12
+ }>>>;
13
+ color: z.ZodOptional<z.ZodString>;
14
+ memberZoneIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
15
+ };
16
+ export declare const createUnitOutput: {
17
+ persistence: z.ZodOptional<z.ZodObject<{
18
+ status: z.ZodEnum<{
19
+ unbound: "unbound";
20
+ events_unsupported: "events_unsupported";
21
+ }>;
22
+ warning: z.ZodString;
23
+ }, z.core.$strip>>;
24
+ unitId: z.ZodString;
25
+ };
26
+ export declare function registerCreateUnit(server: McpServer, bridge: SceneOperations): void;
27
+ //# sourceMappingURL=create-unit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-unit.d.ts","sourceRoot":"","sources":["../../src/tools/create-unit.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,eAAe;;;;;;;;;;;CAM3B,CAAA;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;CAG5B,CAAA;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAuBnF"}