@pascal-app/mcp 1.1.1 → 1.1.2

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/dist/server.d.ts CHANGED
@@ -46,8 +46,8 @@ export type CreatePascalMcpServerOptions = {
46
46
  sceneViews?: SceneViewHost;
47
47
  /** Reads catalog items' pictures and surfaces before view_assets and paint. */
48
48
  assetViews?: PlanReadingHosts['assetViews'];
49
- /** A pause after each call of a run_batch, for a host with a scene of its own per request. */
50
- betweenBatchCalls?: PlanReadingHosts['betweenBatchCalls'];
49
+ /** A pause between the steps of a long call, for a host with a scene of its own per request. */
50
+ betweenSteps?: PlanReadingHosts['betweenSteps'];
51
51
  /** Lines the host adds to what a client reads at connect (the person's own settings). */
52
52
  instructions?: string;
53
53
  };
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAKV,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAG7B,MAAM,mCAAmC,CAAA;AAE1C,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;AAEjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAKzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAIvD,MAAM,MAAM,qBAAqB,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE;IAClD,IAAI,EAAE,MAA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QAAQ,CAAC,EAAE,qBAAqB,CAAA;IAChC,yFAAyF;IACzF,KAAK,CAAC,EAAE,uBAAuB,CAAA;IAC/B,8FAA8F;IAC9F,QAAQ,CAAC,EAAE,iBAAiB,CAAA;IAC5B,4FAA4F;IAC5F,UAAU,CAAC,EAAE,aAAa,CAAA;IAC1B,+EAA+E;IAC/E,UAAU,CAAC,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAA;IAC3C,gGAAgG;IAChG,YAAY,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAA;IAC/C,yFAAyF;IACzF,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,4BAA4B,GAAG,SAAS,CA+BnF"}
package/dist/server.js CHANGED
@@ -29,7 +29,7 @@ export function createPascalMcpServer(opts) {
29
29
  readFile: opts.readFile,
30
30
  sceneViews: opts.sceneViews,
31
31
  assetViews: opts.assetViews,
32
- betweenBatchCalls: opts.betweenBatchCalls,
32
+ betweenSteps: opts.betweenSteps,
33
33
  });
34
34
  registerVisionTools(server, operations);
35
35
  if (opts.services)
@@ -7,7 +7,8 @@ import { type GeometryScriptHost, type ObjectMakerHost } from './add-object.js';
7
7
  * stored module and adapter, changed by edits, when left out), or the stored conversion again;
8
8
  * items naming a piece written with its module, those still being made left for the host to write
9
9
  * when they land; every module compiled and stored through the host, the operation applied,
10
- * Pascal's checks run, and the gate report answered.
10
+ * Pascal's checks run, and the gate report answered. The checks take seconds on a large building:
11
+ * a host that gives `betweenSteps` is awaited between them, as in verify_scene.
11
12
  */
12
- export declare function registerAuthorScene(server: McpServer, bridge: SceneOperations, host: GeometryScriptHost | undefined, makers?: ObjectMakerHost, readFile?: ProjectFileReader): void;
13
+ export declare function registerAuthorScene(server: McpServer, bridge: SceneOperations, host: GeometryScriptHost | undefined, makers?: ObjectMakerHost, readFile?: ProjectFileReader, betweenSteps?: () => Promise<void>): void;
13
14
  //# sourceMappingURL=author-scene.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"author-scene.d.ts","sourceRoot":"","sources":["../../src/tools/author-scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAE7D,OAAO,EAML,KAAK,iBAAiB,EAGvB,MAAM,mCAAmC,CAAA;AAY1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAmB,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAA;AAoC7F;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,kBAAkB,GAAG,SAAS,EACpC,MAAM,CAAC,EAAE,eAAe,EACxB,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,IAAI,CAkMN"}
1
+ {"version":3,"file":"author-scene.d.ts","sourceRoot":"","sources":["../../src/tools/author-scene.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAE7D,OAAO,EAOL,KAAK,iBAAiB,EAGvB,MAAM,mCAAmC,CAAA;AAY1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAmB,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAA;AAoC7F;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,kBAAkB,GAAG,SAAS,EACpC,MAAM,CAAC,EAAE,eAAe,EACxB,QAAQ,CAAC,EAAE,iBAAiB,EAC5B,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GACjC,IAAI,CAqMN"}
@@ -1,5 +1,5 @@
1
1
  import { filterDerivedNodeWrites } from '@pascal-app/core';
2
- import { achievedChanges, authorSceneChecks, verifyScene, } from '@pascal-app/core/agent-operations';
2
+ import { achievedChanges, authorSceneChecks, inOneGo, verifySceneSteps, } from '@pascal-app/core/agent-operations';
3
3
  import { authorScenePayload, authorSceneTool, isAgentRefusal, refuse, surfaceDescription, } from '@pascal-app/core/agent-tools';
4
4
  import { GEOMETRY_SCRIPT_MIME_TYPES } from '@pascal-app/core/schema';
5
5
  import { compileAuthorScene } from '@pascal-app/geometry-script/author-scene';
@@ -8,7 +8,7 @@ import { compileAndStore } from './add-object.js';
8
8
  import { DESTRUCTIVE_TOOL_ANNOTATIONS } from './annotations.js';
9
9
  import { refusalResult, toolError } from './errors.js';
10
10
  import { persistencePayload, publishLiveSceneSnapshot } from './live-sync.js';
11
- import { toPatches } from './shared-tools.js';
11
+ import { pausedBetweenSteps, toPatches } from './shared-tools.js';
12
12
  /** The largest payload file read: a house with its modules inline runs to a few MiB. */
13
13
  const PAYLOAD_FILE_MAX_BYTES = 32 * 1024 * 1024;
14
14
  /** Payload keys holding a module's text; stored as `<key>Script`, the script's hash. */
@@ -18,9 +18,10 @@ const CODE_KEYS = new Set(['code', 'floorCode', 'wallCode']);
18
18
  * stored module and adapter, changed by edits, when left out), or the stored conversion again;
19
19
  * items naming a piece written with its module, those still being made left for the host to write
20
20
  * when they land; every module compiled and stored through the host, the operation applied,
21
- * Pascal's checks run, and the gate report answered.
21
+ * Pascal's checks run, and the gate report answered. The checks take seconds on a large building:
22
+ * a host that gives `betweenSteps` is awaited between them, as in verify_scene.
22
23
  */
23
- export function registerAuthorScene(server, bridge, host, makers, readFile) {
24
+ export function registerAuthorScene(server, bridge, host, makers, readFile, betweenSteps) {
24
25
  server.registerTool(authorSceneTool.name, {
25
26
  title: authorSceneTool.title,
26
27
  description: surfaceDescription(authorSceneTool, 'mcp'),
@@ -141,9 +142,10 @@ export function registerAuthorScene(server, bridge, host, makers, readFile) {
141
142
  const patches = toPatches(filterDerivedNodeWrites(bridge.getNodes(), outcome.changes));
142
143
  if (patches.length)
143
144
  bridge.applyPatch(patches);
144
- const verified = verifyScene(bridge.getNodes(), undefined, {
145
+ const checking = verifySceneSteps(bridge.getNodes(), undefined, {
145
146
  activeLevelId: null,
146
- }).result;
147
+ });
148
+ const verified = (betweenSteps ? await pausedBetweenSteps(checking, betweenSteps) : inOneGo(checking)).result;
147
149
  const byType = new Map();
148
150
  for (const issue of verified.issues)
149
151
  byType.set(issue.type ?? 'unknown', (byType.get(issue.type ?? 'unknown') ?? 0) + 1);
@@ -23,5 +23,5 @@ export type ToolHosts = PlanReadingHosts & {
23
23
  readFile?: ProjectFileReader;
24
24
  sceneViews?: SceneViewHost;
25
25
  };
26
- export declare function registerTools(server: McpServer, operations: SceneOperations, { catalog, geometryScripts, objectMakers, readFile, sceneViews, assetViews, betweenBatchCalls, }?: ToolHosts): void;
26
+ export declare function registerTools(server: McpServer, operations: SceneOperations, { catalog, geometryScripts, objectMakers, readFile, sceneViews, assetViews, betweenSteps, }?: ToolHosts): void;
27
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAEpD,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,eAAe,EAGrB,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAcnD,OAAO,EAAE,KAAK,gBAAgB,EAAuB,MAAM,gBAAgB,CAAA;AAI3E,OAAO,EAAqB,KAAK,aAAa,EAAE,MAAM,cAAc,CAAA;AAEpE;;;;;;;GAOG;AACH,gFAAgF;AAChF,MAAM,MAAM,SAAS,GAAG,gBAAgB,GAAG;IACzC,OAAO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B,aAAa,CAC3B,MAAM,EAAE,SAAS,EACjB,UAAU,EAAE,eAAe,EAC3B,EACE,OAAO,EACP,eAAe,EACf,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,UAAU,EACV,YAAY,GACb,GAAE,SAAc,GAChB,IAAI,CA6BN"}
@@ -19,16 +19,16 @@ import { registerTemplateTools } from './templates/index.js';
19
19
  import { registerUndo } from './undo.js';
20
20
  import { registerVariantTools } from './variants/index.js';
21
21
  import { registerViewScene } from './view-scene.js';
22
- export function registerTools(server, operations, { catalog, geometryScripts, objectMakers, readFile, sceneViews, assetViews, betweenBatchCalls, } = {}) {
22
+ export function registerTools(server, operations, { catalog, geometryScripts, objectMakers, readFile, sceneViews, assetViews, betweenSteps, } = {}) {
23
23
  registerGetScene(server, operations);
24
24
  registerSharedTools(server, operations, catalog, {
25
25
  assetViews,
26
- betweenBatchCalls,
26
+ betweenSteps,
27
27
  buildObject: (input) => compileObjectOnHost(geometryScripts, operations, input),
28
28
  });
29
29
  registerAddColumn(server, operations, geometryScripts);
30
30
  registerAddObject(server, operations, geometryScripts, objectMakers);
31
- registerAuthorScene(server, operations, geometryScripts, objectMakers, readFile);
31
+ registerAuthorScene(server, operations, geometryScripts, objectMakers, readFile, betweenSteps);
32
32
  registerGetSource(server, operations, geometryScripts);
33
33
  registerMeasure(server, operations);
34
34
  registerViewScene(server, operations, sceneViews);
@@ -1,5 +1,5 @@
1
1
  import type { McpServer } from '@modelcontextprotocol/server';
2
- import { type AddObjectInput, type AgentHostRuntime, type AgentOperation, type AssetViewLoader, type SceneChanges } from '@pascal-app/core/agent-operations';
2
+ import { type AddObjectInput, type AgentHostRuntime, type AgentOperation, type AssetViewLoader, type SceneChanges, type Steps } from '@pascal-app/core/agent-operations';
3
3
  import { type AgentToolAnnotations, type AgentToolContract, type DesignBrief } from '@pascal-app/core/agent-tools';
4
4
  import { type CompiledGeometryScript } from '@pascal-app/core/schema';
5
5
  import { z } from 'zod';
@@ -25,17 +25,20 @@ export type PlanReadingHosts = {
25
25
  /** Compiles one add_object module for a batch before the synchronous operations run. */
26
26
  buildObject?: (input: Omit<AddObjectInput, 'compiled'>) => Promise<CompiledGeometryScript>;
27
27
  /**
28
- * Awaited after each call of a run_batch, so the host's timers and I/O run during a long one.
29
- * Only for a host whose scene no other call can reach meanwhile (a bridge of its own for each
30
- * request): the batch is planned on the scene as its first call found it and applied after its
31
- * last. Without it a batch runs uninterrupted.
28
+ * Awaited between the steps of a call that takes seconds on a large building (after each call of
29
+ * a run_batch, after each check of a verify_scene, author_scene's closing one included), so the
30
+ * host's timers and I/O run meanwhile. Only for a host whose scene no other call can reach then
31
+ * (a bridge of its own for each request): a batch is planned on the scene as its first call
32
+ * found it and applied after its last. Without it these calls run uninterrupted.
32
33
  */
33
- betweenBatchCalls?: () => Promise<void>;
34
+ betweenSteps?: () => Promise<void>;
34
35
  };
35
36
  export declare function toPatches(changes: SceneChanges): Patch[];
36
37
  /** How an outcome reaches this bridge: its patches, its derived construction, its session record. */
37
38
  export declare function agentRuntime(bridge: SceneOperations): AgentHostRuntime;
38
39
  export declare function briefInForce(bridge: SceneOperations): DesignBrief | null | undefined;
40
+ /** Work one step at a time, the host's pause after each; `scope` is where each step runs. */
41
+ export declare function pausedBetweenSteps<Result>(steps: Steps<Result>, pause: () => Promise<void>, scope?: (step: () => IteratorResult<void, Result>) => IteratorResult<void, Result>): Promise<Result>;
39
42
  export declare function registerSharedTools(server: McpServer, bridge: SceneOperations, catalog?: AssetCatalog, hosts?: PlanReadingHosts): void;
40
43
  /**
41
44
  * Registers one operation tool, as the shared tools are: a host adds a plugin's `'operation'`
@@ -1 +1 @@
1
- {"version":3,"file":"shared-tools.d.ts","sourceRoot":"","sources":["../../src/tools/shared-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EACL,KAAK,cAAc,EAGnB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,eA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eAAe,EACvB,IAAI,EAAE,aAAa,EACnB,OAAO,GAAE,YAA6B,EACtC,KAAK,GAAE,gBAAqB,GAC3B,IAAI,CAmJN"}
@@ -1,4 +1,4 @@
1
- import { AGENT_OPERATIONS, achievedChanges, applyAgentOutcome, assetViewNeeds, buildBatchObjects, createAssetViewLoader, createFetchAssetViewIO, furnishingRefusal, RUN_BATCH_STEPS, readCatalog, startOfSession, writeCollections, } from '@pascal-app/core/agent-operations';
1
+ import { AGENT_OPERATION_STEPS, AGENT_OPERATIONS, achievedChanges, applyAgentOutcome, assetViewNeeds, buildBatchObjects, createAssetViewLoader, createFetchAssetViewIO, furnishingRefusal, readCatalog, startOfSession, writeCollections, } from '@pascal-app/core/agent-operations';
2
2
  import { addCornerWindowTool, addFenceTool, addLevelTool, addObjectTool, addWallTool, createRoofTool, createRoomTool, createStairTool, createUnitTool, deleteNodeTool, designBriefTool, duplicateLevelTool, duplicateNodeOutput, duplicateNodeTool, findByTypeTool, fitStairTool, furnishRoomTool, getLevelSummaryTool, getNodeTool, getSiteTool, getWallsTool, getZonesTool, isAgentRefusal, listLevelsTool, listUnitsTool, measureStairTool, mergeWindowsTool, moveNodeOutput, moveNodeTool, moveRoofsToRoofLevelTool, paintTool, placeBuildingTool, placeDesignTool, placeInRoomTool, placeItemsTool, ROOM_TOOL_CONTRACTS, refuse, runBatchTool, searchAssetsTool, searchMaterialsTool, setCheckpointTool, setGroundLevelTool, setUnitMembersTool, setWallTypeTool, surfaceDescription, validateDesignTool, verifySceneModelResult, verifySceneTool, viewAssetsTool, } from '@pascal-app/core/agent-tools';
3
3
  import { DesignValidationSchema } from '@pascal-app/core/procedural-items';
4
4
  import { untracked } from '@pascal-app/core/runtime';
@@ -555,10 +555,10 @@ function modelResult(name, output, input) {
555
555
  return searchAssetsModelResult(output);
556
556
  return output;
557
557
  }
558
- /** A batch one call at a time, each in the scene's scope, the host's pause after each. */
559
- async function runBatchInSteps(bridge, batch, pause) {
558
+ /** Work one step at a time, the host's pause after each; `scope` is where each step runs. */
559
+ export async function pausedBetweenSteps(steps, pause, scope = (step) => step()) {
560
560
  for (;;) {
561
- const step = inScene(bridge, () => batch.next());
561
+ const step = scope(() => steps.next());
562
562
  if (step.done)
563
563
  return step.value;
564
564
  await pause();
@@ -638,9 +638,12 @@ export function registerOperationTool(server, bridge, tool, catalog = builtInCat
638
638
  pictures: needs.pictures,
639
639
  });
640
640
  try {
641
+ const steps = hosts.betweenSteps && Object.hasOwn(AGENT_OPERATION_STEPS, tool.contract.name)
642
+ ? AGENT_OPERATION_STEPS[tool.contract.name]
643
+ : undefined;
641
644
  outcome =
642
- tool.contract.name === runBatchTool.name && hosts.betweenBatchCalls
643
- ? await runBatchInSteps(bridge, RUN_BATCH_STEPS(nodes, input, context), hosts.betweenBatchCalls)
645
+ steps && hosts.betweenSteps
646
+ ? await pausedBetweenSteps(steps(nodes, input, context), hosts.betweenSteps, (step) => inScene(bridge, step))
644
647
  : inScene(bridge, () => tool.operation(nodes, input, context));
645
648
  }
646
649
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pascal-app/mcp",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Model Context Protocol server for Pascal 3D editor",
5
5
  "mcpName": "app.pascal/editor",
6
6
  "type": "module",
@@ -62,19 +62,19 @@
62
62
  "prepublishOnly": "bun run build && bun test && bun run smoke:node"
63
63
  },
64
64
  "peerDependencies": {
65
- "@pascal-app/core": "^1.1.1"
65
+ "@pascal-app/core": "^1.1.2"
66
66
  },
67
67
  "dependencies": {
68
68
  "@hono/node-server": "^2.1.6",
69
69
  "@modelcontextprotocol/node": "^2.1.2",
70
70
  "@modelcontextprotocol/server": "^2.4.0",
71
- "@pascal-app/geometry-script": "^1.1.1",
71
+ "@pascal-app/geometry-script": "^1.1.2",
72
72
  "@pascal-app/lingo": "^0.5.0",
73
73
  "zod": ">=4.6.7 <4.7"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@modelcontextprotocol/client": "^2.4.0",
77
- "@pascal-app/core": "^1.1.1",
77
+ "@pascal-app/core": "^1.1.2",
78
78
  "@pascal/typescript-config": "*",
79
79
  "@types/node": "^26.6.6",
80
80
  "typescript": "7.0.2"