@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.
- package/CHANGELOG.md +11 -0
- package/LICENSE +21 -0
- package/README.md +1 -1
- package/dist/bin/pascal-mcp.d.ts +1 -1
- package/dist/bin/pascal-mcp.js +7 -7
- package/dist/bridge/index.d.ts +2 -2
- package/dist/bridge/index.js +1 -1
- package/dist/bridge/scene-bridge.d.ts +2 -2
- package/dist/bridge/scene-bridge.d.ts.map +1 -1
- package/dist/bridge/scene-bridge.js +3 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/operations/index.d.ts +1 -1
- package/dist/operations/index.js +1 -1
- package/dist/operations/scene-operations.d.ts +2 -2
- package/dist/prompts/from-brief.d.ts +1 -1
- package/dist/prompts/from-brief.d.ts.map +1 -1
- package/dist/prompts/from-brief.js +2 -1
- package/dist/prompts/index.d.ts +1 -1
- package/dist/prompts/index.js +3 -3
- package/dist/prompts/iterate-on-feedback.d.ts +1 -1
- package/dist/prompts/iterate-on-feedback.js +1 -1
- package/dist/prompts/renovation-from-photos.d.ts +1 -1
- package/dist/resources/agent-guide.d.ts +1 -1
- package/dist/resources/agent-guide.d.ts.map +1 -1
- package/dist/resources/agent-guide.js +1 -0
- package/dist/resources/catalog-items.d.ts +1 -1
- package/dist/resources/catalog-items.js +1 -1
- package/dist/resources/constraints.d.ts +1 -1
- package/dist/resources/index.d.ts +1 -1
- package/dist/resources/index.js +5 -5
- package/dist/resources/scene-current.d.ts +1 -1
- package/dist/resources/scene-summary.d.ts +1 -1
- package/dist/server.d.ts +14 -3
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +60 -6
- package/dist/storage/index.d.ts +4 -4
- package/dist/storage/index.js +4 -4
- package/dist/storage/sqlite-scene-store.d.ts +1 -1
- package/dist/storage/sqlite-scene-store.js +3 -3
- package/dist/templates/index.js +3 -3
- package/dist/tools/annotations.d.ts +28 -0
- package/dist/tools/annotations.d.ts.map +1 -0
- package/dist/tools/annotations.js +27 -0
- package/dist/tools/apply-patch.d.ts +8 -1
- package/dist/tools/apply-patch.d.ts.map +1 -1
- package/dist/tools/apply-patch.js +9 -5
- package/dist/tools/check-collisions.d.ts +60 -1
- package/dist/tools/check-collisions.d.ts.map +1 -1
- package/dist/tools/check-collisions.js +242 -21
- package/dist/tools/construction-tools.d.ts +24 -2
- package/dist/tools/construction-tools.d.ts.map +1 -1
- package/dist/tools/construction-tools.js +36 -10
- package/dist/tools/create-level.d.ts +8 -1
- package/dist/tools/create-level.d.ts.map +1 -1
- package/dist/tools/create-level.js +9 -6
- package/dist/tools/create-unit.d.ts +27 -0
- package/dist/tools/create-unit.d.ts.map +1 -0
- package/dist/tools/create-unit.js +36 -0
- package/dist/tools/create-wall.d.ts +8 -1
- package/dist/tools/create-wall.d.ts.map +1 -1
- package/dist/tools/create-wall.js +9 -6
- package/dist/tools/cut-opening.d.ts +8 -1
- package/dist/tools/cut-opening.d.ts.map +1 -1
- package/dist/tools/cut-opening.js +10 -7
- package/dist/tools/delete-node.d.ts +8 -1
- package/dist/tools/delete-node.d.ts.map +1 -1
- package/dist/tools/delete-node.js +8 -5
- package/dist/tools/describe-node.d.ts +1 -1
- package/dist/tools/describe-node.d.ts.map +1 -1
- package/dist/tools/describe-node.js +5 -3
- package/dist/tools/door-clearance.d.ts +19 -3
- package/dist/tools/door-clearance.d.ts.map +1 -1
- package/dist/tools/door-clearance.js +102 -8
- package/dist/tools/duplicate-level.d.ts +8 -1
- package/dist/tools/duplicate-level.d.ts.map +1 -1
- package/dist/tools/duplicate-level.js +8 -4
- package/dist/tools/export-glb.d.ts +1 -1
- package/dist/tools/export-glb.d.ts.map +1 -1
- package/dist/tools/export-glb.js +4 -2
- package/dist/tools/export-json.d.ts +1 -1
- package/dist/tools/export-json.d.ts.map +1 -1
- package/dist/tools/export-json.js +2 -0
- package/dist/tools/find-nodes.d.ts +1 -1
- package/dist/tools/find-nodes.d.ts.map +1 -1
- package/dist/tools/find-nodes.js +3 -1
- package/dist/tools/get-node.d.ts +1 -1
- package/dist/tools/get-node.d.ts.map +1 -1
- package/dist/tools/get-node.js +4 -2
- package/dist/tools/get-scene.d.ts +1 -1
- package/dist/tools/get-scene.d.ts.map +1 -1
- package/dist/tools/get-scene.js +2 -0
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +32 -26
- package/dist/tools/layout-clearance.d.ts +4 -2
- package/dist/tools/layout-clearance.d.ts.map +1 -1
- package/dist/tools/layout-clearance.js +7 -3
- package/dist/tools/list-units.d.ts +38 -0
- package/dist/tools/list-units.d.ts.map +1 -0
- package/dist/tools/list-units.js +61 -0
- package/dist/tools/live-sync.d.ts +34 -4
- package/dist/tools/live-sync.d.ts.map +1 -1
- package/dist/tools/live-sync.js +38 -6
- package/dist/tools/measure.d.ts +2 -1
- package/dist/tools/measure.d.ts.map +1 -1
- package/dist/tools/measure.js +6 -2
- package/dist/tools/normalize-schema-dialect.d.ts +3 -0
- package/dist/tools/normalize-schema-dialect.d.ts.map +1 -0
- package/dist/tools/normalize-schema-dialect.js +28 -0
- package/dist/tools/photo-to-scene/index.d.ts +2 -2
- package/dist/tools/photo-to-scene/index.js +2 -2
- package/dist/tools/photo-to-scene/photo-to-scene.d.ts +1 -1
- package/dist/tools/photo-to-scene/photo-to-scene.d.ts.map +1 -1
- package/dist/tools/photo-to-scene/photo-to-scene.js +5 -3
- package/dist/tools/place-item.d.ts +8 -1
- package/dist/tools/place-item.d.ts.map +1 -1
- package/dist/tools/place-item.js +11 -7
- package/dist/tools/redo.d.ts +8 -1
- package/dist/tools/redo.d.ts.map +1 -1
- package/dist/tools/redo.js +6 -4
- package/dist/tools/room-tools.d.ts +29 -1
- package/dist/tools/room-tools.d.ts.map +1 -1
- package/dist/tools/room-tools.js +27 -12
- package/dist/tools/scene-lifecycle/create-project.d.ts +1 -1
- package/dist/tools/scene-lifecycle/create-project.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/create-project.js +4 -2
- package/dist/tools/scene-lifecycle/delete-scene.d.ts +1 -1
- package/dist/tools/scene-lifecycle/delete-scene.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/delete-scene.js +4 -2
- package/dist/tools/scene-lifecycle/get-project-status.d.ts +1 -1
- package/dist/tools/scene-lifecycle/get-project-status.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/get-project-status.js +4 -2
- package/dist/tools/scene-lifecycle/index.d.ts +8 -8
- package/dist/tools/scene-lifecycle/index.js +14 -14
- package/dist/tools/scene-lifecycle/list-scenes.d.ts +1 -1
- package/dist/tools/scene-lifecycle/list-scenes.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/list-scenes.js +3 -1
- package/dist/tools/scene-lifecycle/load-scene.d.ts +1 -1
- package/dist/tools/scene-lifecycle/load-scene.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/load-scene.js +4 -2
- package/dist/tools/scene-lifecycle/metadata.d.ts +3 -3
- package/dist/tools/scene-lifecycle/rename-scene.d.ts +1 -1
- package/dist/tools/scene-lifecycle/rename-scene.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/rename-scene.js +4 -2
- package/dist/tools/scene-lifecycle/save-scene.d.ts +1 -1
- package/dist/tools/scene-lifecycle/save-scene.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/save-scene.js +6 -4
- package/dist/tools/scene-lifecycle/test-utils.d.ts +7 -3
- package/dist/tools/scene-lifecycle/test-utils.d.ts.map +1 -1
- package/dist/tools/scene-lifecycle/test-utils.js +28 -4
- package/dist/tools/scene-query.d.ts +1 -1
- package/dist/tools/scene-query.d.ts.map +1 -1
- package/dist/tools/scene-query.js +9 -3
- package/dist/tools/set-unit-members.d.ts +20 -0
- package/dist/tools/set-unit-members.d.ts.map +1 -0
- package/dist/tools/set-unit-members.js +43 -0
- package/dist/tools/set-zone.d.ts +8 -1
- package/dist/tools/set-zone.d.ts.map +1 -1
- package/dist/tools/set-zone.js +8 -5
- package/dist/tools/templates/create-from-template.d.ts +1 -1
- package/dist/tools/templates/create-from-template.d.ts.map +1 -1
- package/dist/tools/templates/create-from-template.js +7 -5
- package/dist/tools/templates/create-house-from-brief.d.ts +1 -1
- package/dist/tools/templates/create-house-from-brief.d.ts.map +1 -1
- package/dist/tools/templates/create-house-from-brief.js +7 -5
- package/dist/tools/templates/index.d.ts +4 -4
- package/dist/tools/templates/index.js +6 -6
- package/dist/tools/templates/list-templates.d.ts.map +1 -1
- package/dist/tools/templates/list-templates.js +3 -1
- package/dist/tools/undo.d.ts +8 -1
- package/dist/tools/undo.d.ts.map +1 -1
- package/dist/tools/undo.js +6 -4
- package/dist/tools/unit-members.d.ts +4 -0
- package/dist/tools/unit-members.d.ts.map +1 -0
- package/dist/tools/unit-members.js +24 -0
- package/dist/tools/validate-scene.d.ts +1 -1
- package/dist/tools/validate-scene.d.ts.map +1 -1
- package/dist/tools/validate-scene.js +2 -0
- package/dist/tools/variants/generate-variants.d.ts +1 -1
- package/dist/tools/variants/generate-variants.d.ts.map +1 -1
- package/dist/tools/variants/generate-variants.js +4 -2
- package/dist/tools/variants/index.d.ts +3 -3
- package/dist/tools/variants/index.js +3 -3
- package/dist/tools/vision/analyze-floorplan-image.d.ts +1 -1
- package/dist/tools/vision/analyze-floorplan-image.d.ts.map +1 -1
- package/dist/tools/vision/analyze-floorplan-image.js +3 -1
- package/dist/tools/vision/analyze-room-photo.d.ts +1 -1
- package/dist/tools/vision/analyze-room-photo.d.ts.map +1 -1
- package/dist/tools/vision/analyze-room-photo.js +3 -1
- package/dist/tools/vision/index.d.ts +3 -3
- package/dist/tools/vision/index.js +4 -4
- 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/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pascal Group Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
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 }` |
|
package/dist/bin/pascal-mcp.d.ts
CHANGED
package/dist/bin/pascal-mcp.js
CHANGED
|
@@ -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:
|
package/dist/bridge/index.d.ts
CHANGED
|
@@ -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
|
package/dist/bridge/index.js
CHANGED
|
@@ -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;
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"scene-bridge.d.ts","sourceRoot":"","sources":["../../src/bridge/scene-bridge.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Side-effect import MUST come first: installs RAF polyfill before core loads.
|
|
2
|
-
import './node-shims';
|
|
3
|
-
import { AnyNode as AnyNodeSchema } from '@pascal-app/core/schema';
|
|
2
|
+
import './node-shims.js';
|
|
3
|
+
import { AnyNode as AnyNodeSchema, parseNode, } from '@pascal-app/core/schema';
|
|
4
4
|
// Per PLAN §0.6: `useScene` is the DEFAULT export from `@pascal-app/core/store`.
|
|
5
5
|
import useScene from '@pascal-app/core/store';
|
|
6
6
|
/**
|
|
@@ -294,7 +294,7 @@ export class SceneBridge {
|
|
|
294
294
|
if (!p)
|
|
295
295
|
throw new Error(`invalid patch: patches[${i}] is undefined`);
|
|
296
296
|
if (p.op === 'create') {
|
|
297
|
-
const res =
|
|
297
|
+
const res = parseNode(p.node);
|
|
298
298
|
if (!res.success) {
|
|
299
299
|
throw new Error(`invalid patch: patches[${i}] create node failed schema: ${res.error.message}`);
|
|
300
300
|
}
|
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
|
package/dist/operations/index.js
CHANGED
|
@@ -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;
|
|
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`.',
|
package/dist/prompts/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import type { SceneOperations } from '../operations';
|
|
2
|
+
import type { SceneOperations } from '../operations/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Registers all MCP prompts exposed by `@pascal-app/mcp`:
|
|
5
5
|
* - `from_brief` — generate a scene from a natural-language brief
|
package/dist/prompts/index.js
CHANGED
|
@@ -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
|
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,
|
|
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,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
|
package/dist/resources/index.js
CHANGED
|
@@ -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,12 @@
|
|
|
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
|
+
export type PascalMcpToolExecutor = <Result>(input: {
|
|
6
|
+
name: string;
|
|
7
|
+
signal: AbortSignal;
|
|
8
|
+
execute: () => Promise<Result>;
|
|
9
|
+
}) => Promise<Result>;
|
|
5
10
|
export type CreatePascalMcpServerOptions = {
|
|
6
11
|
bridge: SceneBridge;
|
|
7
12
|
operations?: SceneOperations;
|
|
@@ -9,6 +14,12 @@ export type CreatePascalMcpServerOptions = {
|
|
|
9
14
|
store?: SceneStore;
|
|
10
15
|
name?: string;
|
|
11
16
|
version?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Wrap every regular tool handler, including callback updates.
|
|
19
|
+
* Tool renames fail closed because the SDK registration lifecycle cannot safely rename twice.
|
|
20
|
+
* Experimental task-based tool registrations are outside this hook.
|
|
21
|
+
*/
|
|
22
|
+
executeTool?: PascalMcpToolExecutor;
|
|
12
23
|
};
|
|
13
24
|
export declare function createPascalMcpServer(opts: CreatePascalMcpServerOptions): McpServer;
|
|
14
25
|
//# sourceMappingURL=server.d.ts.map
|
package/dist/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,
|
|
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;AAMjD,MAAM,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE;IAClD,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,WAAW,CAAA;IACnB,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;CAC/B,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;AAErB,MAAM,MAAM,4BAA4B,GAAG;IACzC,MAAM,EAAE,WAAW,CAAA;IACnB,UAAU,CAAC,EAAE,eAAe,CAAA;IAC5B,mFAAmF;IACnF,KAAK,CAAC,EAAE,UAAU,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;OAIG;IACH,WAAW,CAAC,EAAE,qBAAqB,CAAA;CACpC,CAAA;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,4BAA4B,GAAG,SAAS,CAcnF"}
|
package/dist/server.js
CHANGED
|
@@ -1,19 +1,73 @@
|
|
|
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 {
|
|
7
|
-
import {
|
|
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',
|
|
11
12
|
version: opts.version ?? version,
|
|
12
13
|
});
|
|
14
|
+
if (opts.executeTool)
|
|
15
|
+
installToolExecutor(server, opts.executeTool);
|
|
13
16
|
const operations = opts.operations ?? createSceneOperations({ bridge: opts.bridge, store: opts.store });
|
|
14
17
|
registerTools(server, operations);
|
|
15
18
|
registerVisionTools(server, operations);
|
|
16
19
|
registerResources(server, operations);
|
|
17
20
|
registerPrompts(server, operations);
|
|
21
|
+
normalizeToolSchemaDialect(server);
|
|
18
22
|
return server;
|
|
19
23
|
}
|
|
24
|
+
function installToolExecutor(server, executeTool) {
|
|
25
|
+
const registerTool = server.registerTool.bind(server);
|
|
26
|
+
const wrappedRegisterTool = (name, config, callback) => {
|
|
27
|
+
const runtimeCallback = callback;
|
|
28
|
+
const registration = registerTool(name, config, wrapToolCallback(name, runtimeCallback, executeTool));
|
|
29
|
+
return wrapRegisteredTool(registration, name, runtimeCallback, executeTool);
|
|
30
|
+
};
|
|
31
|
+
server.registerTool = wrappedRegisterTool;
|
|
32
|
+
const tool = server.tool.bind(server);
|
|
33
|
+
server.tool = ((name, ...args) => {
|
|
34
|
+
const callback = args.at(-1);
|
|
35
|
+
if (typeof callback !== 'function') {
|
|
36
|
+
return Reflect.apply(tool, undefined, [name, ...args]);
|
|
37
|
+
}
|
|
38
|
+
const runtimeCallback = callback;
|
|
39
|
+
args[args.length - 1] = wrapToolCallback(name, runtimeCallback, executeTool);
|
|
40
|
+
const registration = Reflect.apply(tool, undefined, [name, ...args]);
|
|
41
|
+
return wrapRegisteredTool(registration, name, runtimeCallback, executeTool);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function wrapToolCallback(name, callback, executeTool) {
|
|
45
|
+
return (...args) => executeTool({
|
|
46
|
+
name,
|
|
47
|
+
signal: toolRequestSignal(args),
|
|
48
|
+
execute: () => Promise.resolve(Reflect.apply(callback, undefined, args)),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function wrapRegisteredTool(registration, initialName, initialCallback, executeTool) {
|
|
52
|
+
let currentCallback = initialCallback;
|
|
53
|
+
const update = registration.update.bind(registration);
|
|
54
|
+
registration.update = ((updates) => {
|
|
55
|
+
if (typeof updates.name === 'string') {
|
|
56
|
+
throw new Error('MCP tool renaming is unsupported when executeTool is configured');
|
|
57
|
+
}
|
|
58
|
+
const callbackUpdate = updates.callback;
|
|
59
|
+
if (typeof callbackUpdate === 'function') {
|
|
60
|
+
currentCallback = callbackUpdate;
|
|
61
|
+
}
|
|
62
|
+
update({
|
|
63
|
+
...updates,
|
|
64
|
+
...(typeof callbackUpdate === 'function'
|
|
65
|
+
? { callback: wrapToolCallback(initialName, currentCallback, executeTool) }
|
|
66
|
+
: {}),
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
return registration;
|
|
70
|
+
}
|
|
71
|
+
function toolRequestSignal(args) {
|
|
72
|
+
return args.at(-1).signal;
|
|
73
|
+
}
|
package/dist/storage/index.d.ts
CHANGED
|
@@ -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
|
*
|
package/dist/storage/index.js
CHANGED
|
@@ -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;
|
package/dist/templates/index.js
CHANGED
|
@@ -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,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const READ_ONLY_TOOL_ANNOTATIONS: {
|
|
2
|
+
readonly readOnlyHint: true;
|
|
3
|
+
readonly destructiveHint: false;
|
|
4
|
+
readonly idempotentHint: true;
|
|
5
|
+
readonly openWorldHint: false;
|
|
6
|
+
};
|
|
7
|
+
export declare const READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS: {
|
|
8
|
+
readonly readOnlyHint: true;
|
|
9
|
+
readonly destructiveHint: false;
|
|
10
|
+
readonly idempotentHint: true;
|
|
11
|
+
readonly openWorldHint: true;
|
|
12
|
+
};
|
|
13
|
+
export declare const ADDITIVE_TOOL_ANNOTATIONS: {
|
|
14
|
+
readonly readOnlyHint: false;
|
|
15
|
+
readonly destructiveHint: false;
|
|
16
|
+
readonly openWorldHint: false;
|
|
17
|
+
};
|
|
18
|
+
export declare const DESTRUCTIVE_TOOL_ANNOTATIONS: {
|
|
19
|
+
readonly readOnlyHint: false;
|
|
20
|
+
readonly destructiveHint: true;
|
|
21
|
+
readonly openWorldHint: false;
|
|
22
|
+
};
|
|
23
|
+
export declare const DESTRUCTIVE_OPEN_WORLD_TOOL_ANNOTATIONS: {
|
|
24
|
+
readonly readOnlyHint: false;
|
|
25
|
+
readonly destructiveHint: true;
|
|
26
|
+
readonly openWorldHint: true;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=annotations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../../src/tools/annotations.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B;;;;;CAK7B,CAAA;AAEV,eAAO,MAAM,qCAAqC;;;;;CAKxC,CAAA;AAEV,eAAO,MAAM,yBAAyB;;;;CAI5B,CAAA;AAEV,eAAO,MAAM,4BAA4B;;;;CAI/B,CAAA;AAEV,eAAO,MAAM,uCAAuC;;;;CAI1C,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const READ_ONLY_TOOL_ANNOTATIONS = {
|
|
2
|
+
readOnlyHint: true,
|
|
3
|
+
destructiveHint: false,
|
|
4
|
+
idempotentHint: true,
|
|
5
|
+
openWorldHint: false,
|
|
6
|
+
};
|
|
7
|
+
export const READ_ONLY_OPEN_WORLD_TOOL_ANNOTATIONS = {
|
|
8
|
+
readOnlyHint: true,
|
|
9
|
+
destructiveHint: false,
|
|
10
|
+
idempotentHint: true,
|
|
11
|
+
openWorldHint: true,
|
|
12
|
+
};
|
|
13
|
+
export const ADDITIVE_TOOL_ANNOTATIONS = {
|
|
14
|
+
readOnlyHint: false,
|
|
15
|
+
destructiveHint: false,
|
|
16
|
+
openWorldHint: false,
|
|
17
|
+
};
|
|
18
|
+
export const DESTRUCTIVE_TOOL_ANNOTATIONS = {
|
|
19
|
+
readOnlyHint: false,
|
|
20
|
+
destructiveHint: true,
|
|
21
|
+
openWorldHint: false,
|
|
22
|
+
};
|
|
23
|
+
export const DESTRUCTIVE_OPEN_WORLD_TOOL_ANNOTATIONS = {
|
|
24
|
+
readOnlyHint: false,
|
|
25
|
+
destructiveHint: true,
|
|
26
|
+
openWorldHint: true,
|
|
27
|
+
};
|
|
@@ -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">;
|
|
@@ -17,6 +17,13 @@ export declare const applyPatchInput: {
|
|
|
17
17
|
}, z.core.$strip>], "op">>;
|
|
18
18
|
};
|
|
19
19
|
export declare const applyPatchOutput: {
|
|
20
|
+
persistence: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
status: z.ZodEnum<{
|
|
22
|
+
unbound: "unbound";
|
|
23
|
+
events_unsupported: "events_unsupported";
|
|
24
|
+
}>;
|
|
25
|
+
warning: z.ZodString;
|
|
26
|
+
}, z.core.$strip>>;
|
|
20
27
|
appliedOps: z.ZodNumber;
|
|
21
28
|
deletedIds: z.ZodArray<z.ZodString>;
|
|
22
29
|
createdIds: z.ZodArray<z.ZodString>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-patch.d.ts","sourceRoot":"","sources":["../../src/tools/apply-patch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"apply-patch.d.ts","sourceRoot":"","sources":["../../src/tools/apply-patch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAMpD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;CAE3B,CAAA;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;;CAK5B,CAAA;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,GAAG,IAAI,CAqDnF"}
|