@pascal-app/core 1.1.0 → 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/agent-operations/__fixtures__/cases.d.ts +3 -2
- package/dist/agent-operations/__fixtures__/cases.d.ts.map +1 -1
- package/dist/agent-operations/__fixtures__/place-items-cases.d.ts.map +1 -1
- package/dist/agent-operations/__fixtures__/place-items-cases.js +28 -0
- package/dist/agent-operations/__fixtures__/roof-bearing-cases.d.ts +2618 -2618
- package/dist/agent-operations/asset-catalog.d.ts +21 -11
- package/dist/agent-operations/asset-catalog.d.ts.map +1 -1
- package/dist/agent-operations/asset-catalog.js +28 -10
- package/dist/agent-operations/asset-views.d.ts +8 -3
- package/dist/agent-operations/asset-views.d.ts.map +1 -1
- package/dist/agent-operations/asset-views.js +19 -3
- package/dist/agent-operations/batch.d.ts +4 -2
- package/dist/agent-operations/batch.d.ts.map +1 -1
- package/dist/agent-operations/batch.js +9 -6
- package/dist/agent-operations/catalog-asset.d.ts +15 -0
- package/dist/agent-operations/catalog-asset.d.ts.map +1 -0
- package/dist/agent-operations/catalog-asset.js +4 -0
- package/dist/agent-operations/circulation-spaces.d.ts +585 -585
- package/dist/agent-operations/design-brief.d.ts.map +1 -1
- package/dist/agent-operations/design-brief.js +2 -0
- package/dist/agent-operations/furnish-room.d.ts.map +1 -1
- package/dist/agent-operations/furnish-room.js +2 -1
- package/dist/agent-operations/index.d.ts +5716 -7
- package/dist/agent-operations/index.d.ts.map +1 -1
- package/dist/agent-operations/index.js +17 -3
- package/dist/agent-operations/level-reads.d.ts.map +1 -1
- package/dist/agent-operations/level-reads.js +4 -1
- package/dist/agent-operations/place-in-room.d.ts.map +1 -1
- package/dist/agent-operations/place-in-room.js +2 -1
- package/dist/agent-operations/place-items.d.ts.map +1 -1
- package/dist/agent-operations/place-items.js +2 -1
- package/dist/agent-operations/scene-queries.d.ts +3818 -3818
- package/dist/agent-operations/scene-view.d.ts.map +1 -1
- package/dist/agent-operations/scene-view.js +38 -13
- package/dist/agent-operations/search-assets.d.ts.map +1 -1
- package/dist/agent-operations/search-assets.js +6 -0
- package/dist/agent-operations/types.d.ts +10 -2
- package/dist/agent-operations/types.d.ts.map +1 -1
- package/dist/agent-operations/usage-checks.js +18 -3
- package/dist/agent-operations/verify-scene.d.ts +7 -3
- package/dist/agent-operations/verify-scene.d.ts.map +1 -1
- package/dist/agent-operations/verify-scene.js +15 -7
- package/dist/agent-tools/assets.js +1 -1
- package/dist/building/__fixtures__/wall-opening-cases.d.ts +30 -30
- package/dist/building/level-duplication.d.ts +3409 -3409
- package/dist/building/level-duplication.d.ts.map +1 -1
- package/dist/building/level-duplication.js +3 -1
- package/dist/building/wall-openings.d.ts +75 -75
- package/dist/commands/structure/shared.d.ts +3407 -3407
- package/dist/commands/structure/zone-wall-merge.d.ts +652 -652
- package/dist/hooks/spatial-grid/spatial-grid-sync.d.ts +3818 -3818
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/lib/__fixtures__/mezzanine.d.ts +2003 -2003
- package/dist/lib/absorb-wall-separators.d.ts +1032 -1032
- package/dist/lib/asset-storage.d.ts.map +1 -1
- package/dist/lib/asset-storage.js +3 -0
- package/dist/lib/floor-foundation-datum.d.ts.map +1 -1
- package/dist/lib/floor-foundation-datum.js +5 -1
- package/dist/lib/floorplan/context.d.ts +95 -0
- package/dist/lib/floorplan/context.d.ts.map +1 -0
- package/dist/lib/floorplan/context.js +155 -0
- package/dist/lib/floorplan/index.d.ts +6 -0
- package/dist/lib/floorplan/index.d.ts.map +1 -0
- package/dist/lib/floorplan/index.js +5 -0
- package/dist/lib/floorplan/marks.d.ts +71 -0
- package/dist/lib/floorplan/marks.d.ts.map +1 -0
- package/dist/lib/floorplan/marks.js +157 -0
- package/dist/lib/floorplan/plan-math.d.ts +18 -0
- package/dist/lib/floorplan/plan-math.d.ts.map +1 -0
- package/dist/lib/floorplan/plan-math.js +82 -0
- package/dist/lib/floorplan/svg-paths.d.ts +17 -0
- package/dist/lib/floorplan/svg-paths.d.ts.map +1 -0
- package/dist/lib/floorplan/svg-paths.js +92 -0
- package/dist/lib/floorplan/wall-affordances.d.ts +31 -0
- package/dist/lib/floorplan/wall-affordances.d.ts.map +1 -0
- package/dist/lib/floorplan/wall-affordances.js +24 -0
- package/dist/lib/steps.d.ts +8 -0
- package/dist/lib/steps.d.ts.map +1 -0
- package/dist/lib/steps.js +7 -0
- package/dist/registry/__fixtures__/roof-planes.d.ts +69 -0
- package/dist/registry/__fixtures__/roof-planes.d.ts.map +1 -0
- package/dist/registry/__fixtures__/roof-planes.js +59 -0
- package/dist/registry/index.d.ts +2 -1
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +1 -0
- package/dist/registry/roofs.d.ts +34 -0
- package/dist/registry/roofs.d.ts.map +1 -0
- package/dist/registry/roofs.js +61 -0
- package/dist/registry/types.d.ts +30 -0
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/registry/validate-relations.d.ts +5 -1
- package/dist/registry/validate-relations.d.ts.map +1 -1
- package/dist/registry/validate-relations.js +6 -2
- package/dist/schema/asset-url.d.ts +8 -0
- package/dist/schema/asset-url.d.ts.map +1 -1
- package/dist/schema/asset-url.js +17 -0
- package/dist/schema/nodes/roof.d.ts +1 -1
- package/dist/schema/nodes/roof.d.ts.map +1 -1
- package/dist/schema/nodes/roof.js +13 -8
- package/dist/schema/types.d.ts +1 -1
- package/dist/services/roof-level.d.ts.map +1 -1
- package/dist/services/roof-level.js +12 -2
- package/dist/services/roof-move.d.ts +4 -2
- package/dist/services/roof-move.d.ts.map +1 -1
- package/dist/services/roof-move.js +21 -9
- package/dist/spatial/usage-field/findings.d.ts +10 -1
- package/dist/spatial/usage-field/findings.d.ts.map +1 -1
- package/dist/spatial/usage-field/findings.js +56 -12
- package/dist/spatial/usage-field/measure.d.ts +3 -1
- package/dist/spatial/usage-field/measure.d.ts.map +1 -1
- package/dist/spatial/usage-field/measure.js +7 -2
- package/dist/spatial/usage-field/path.d.ts.map +1 -1
- package/dist/spatial/usage-field/path.js +28 -18
- package/dist/store/actions/node-actions.d.ts +2380 -2380
- package/dist/store/scene-annotations.d.ts +1279 -1279
- package/dist/systems/document-reconcile.d.ts.map +1 -1
- package/dist/systems/document-reconcile.js +1 -2
- package/dist/systems/roof/roof-elevation.d.ts +11 -6
- package/dist/systems/roof/roof-elevation.d.ts.map +1 -1
- package/dist/systems/roof/roof-elevation.js +24 -11
- package/dist/systems/slab/__fixtures__/floor-step.d.ts +2381 -2381
- package/dist/systems/slab/__fixtures__/raised-room.d.ts +3818 -3818
- package/dist/systems/stair/stair-opening-preview.d.ts +900 -900
- package/dist/utils/ensure-scene-openings.d.ts +4815 -4815
- package/dist/utils/floor-plate-migration.d.ts +1032 -1032
- package/dist/utils/owned-floor-opening-migration.d.ts +1032 -1032
- package/dist/utils/reconcile-structure-on-load.d.ts +2380 -2380
- package/dist/utils/scene-bounds.d.ts +32 -0
- package/dist/utils/scene-bounds.d.ts.map +1 -0
- package/dist/utils/scene-bounds.js +201 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scene-view.d.ts","sourceRoot":"","sources":["../../src/agent-operations/scene-view.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,aAAa,EAElB,KAAK,UAAU,EAChB,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"scene-view.d.ts","sourceRoot":"","sources":["../../src/agent-operations/scene-view.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,aAAa,EAElB,KAAK,UAAU,EAChB,MAAM,2BAA2B,CAAA;AAMlC,OAAO,KAAK,EACV,OAAO,EAKP,SAAS,EAKV,MAAM,WAAW,CAAA;AAUlB;;;GAGG;AAEH,MAAM,MAAM,YAAY,GAAG;IAAE,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,E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-4,8 +4,9 @@ import { levelGradeStanding } from '../lib/grade-standing.js';
|
|
|
4
4
|
import { buildingGroundBox, levelGroundBox, terrainBetweenEyeAndBox } from '../lib/ground-window.js';
|
|
5
5
|
import { distanceToSegment } from '../lib/room-topology-index.js';
|
|
6
6
|
import { buildingStreet } from '../lib/site-placement.js';
|
|
7
|
+
import { roofFaceOf, roofFaceShapes } from '../registry/roofs.js';
|
|
7
8
|
import { getActiveRoofHeight } from '../schema/index.js';
|
|
8
|
-
import { isCeilingGeometry, isRoofGeometry } from '../services/roof-level.js';
|
|
9
|
+
import { coveredStoreyId, isCeilingGeometry, isRoofGeometry } from '../services/roof-level.js';
|
|
9
10
|
import { EXPLODED_GAP, getLevelElevations } from '../services/storey.js';
|
|
10
11
|
import { stairFootprintAABB } from '../systems/stair/stair-footprint.js';
|
|
11
12
|
import { resolveWallExteriorSide } from '../systems/wall/wall-assembly.js';
|
|
@@ -311,8 +312,9 @@ function siteBox(node, baseY) {
|
|
|
311
312
|
return null;
|
|
312
313
|
}
|
|
313
314
|
/**
|
|
314
|
-
* A roof's box: its segments' footprints
|
|
315
|
-
*
|
|
315
|
+
* A roof's box: its segments' footprints and its faces' outlines (`capabilities.roofs`) in the
|
|
316
|
+
* plan, from the roof's seat (its faces' lowest eave, theirs being their own heights) to the
|
|
317
|
+
* highest peak. A roof holds no wall, so a roof, or the roof level it stands on, framed nothing.
|
|
316
318
|
*/
|
|
317
319
|
function roofBox(nodes, roof, baseY) {
|
|
318
320
|
const seat = baseY + roof.position[1];
|
|
@@ -321,11 +323,18 @@ function roofBox(nodes, roof, baseY) {
|
|
|
321
323
|
x * Math.sin(angle) + z * Math.cos(angle),
|
|
322
324
|
];
|
|
323
325
|
const points = [];
|
|
324
|
-
let
|
|
326
|
+
let floor = Number.POSITIVE_INFINITY;
|
|
327
|
+
let peak = Number.NEGATIVE_INFINITY;
|
|
328
|
+
for (const face of roofFaceShapes(roof, nodes)) {
|
|
329
|
+
points.push(...face.outline);
|
|
330
|
+
floor = Math.min(floor, baseY + face.low);
|
|
331
|
+
peak = Math.max(peak, baseY + face.high);
|
|
332
|
+
}
|
|
325
333
|
for (const id of roof.children ?? []) {
|
|
326
334
|
const segment = nodes[id];
|
|
327
335
|
if (segment?.type !== 'roof-segment')
|
|
328
336
|
continue;
|
|
337
|
+
floor = Math.min(floor, seat);
|
|
329
338
|
for (const [sx, sz] of [
|
|
330
339
|
[-1, -1],
|
|
331
340
|
[1, -1],
|
|
@@ -338,12 +347,12 @@ function roofBox(nodes, roof, baseY) {
|
|
|
338
347
|
const [px, pz] = turn([cx + segment.position[0], cz + segment.position[2]], -roof.rotation);
|
|
339
348
|
points.push([px + roof.position[0], pz + roof.position[2]]);
|
|
340
349
|
}
|
|
341
|
-
peak = Math.max(peak, seat + segment.position[1] + segment.wallHeight + getActiveRoofHeight(segment));
|
|
350
|
+
peak = Math.max(peak, seat, seat + segment.position[1] + segment.wallHeight + getActiveRoofHeight(segment));
|
|
342
351
|
}
|
|
343
352
|
if (!points.length)
|
|
344
353
|
return null;
|
|
345
354
|
return tall({
|
|
346
|
-
min: [Math.min(...points.map((p) => p[0])),
|
|
355
|
+
min: [Math.min(...points.map((p) => p[0])), floor, Math.min(...points.map((p) => p[1]))],
|
|
347
356
|
max: [Math.max(...points.map((p) => p[0])), peak, Math.max(...points.map((p) => p[1]))],
|
|
348
357
|
}, 0.3);
|
|
349
358
|
}
|
|
@@ -454,19 +463,35 @@ export function sceneViewBounds(nodes, targetId, presentation) {
|
|
|
454
463
|
if (pose)
|
|
455
464
|
return placed(hostedItemBox(target, pose, baseOf(pose.levelId)), pose.levelId);
|
|
456
465
|
}
|
|
466
|
+
const unreadFace = (id) => {
|
|
467
|
+
const child = nodes[id];
|
|
468
|
+
return !!child?.type.includes(':') && !roofFaceOf(child);
|
|
469
|
+
};
|
|
470
|
+
// A roof holding faces this runtime cannot read (their plugin not registered here) frames the
|
|
471
|
+
// storey it covers as well, up to its own level's top.
|
|
472
|
+
const coveredByTarget = target?.type === 'roof' && (target.children ?? []).some(unreadFace)
|
|
473
|
+
? coveredStoreyId(nodes, target)
|
|
474
|
+
: null;
|
|
457
475
|
const site = target && nodes[target.parentId ?? '']?.type === 'level'
|
|
458
476
|
? levelChildBox(nodes, target, baseOf(target.parentId))
|
|
459
477
|
: null;
|
|
460
|
-
if (site)
|
|
478
|
+
if (site && !coveredByTarget)
|
|
461
479
|
return placed(site, target.parentId);
|
|
462
480
|
const levelOf = (node) => (node.parentId ? nodes[node.parentId] : undefined);
|
|
463
481
|
const outlines = [];
|
|
464
482
|
// With no walls yet, what the level holds frames it: furniture placed from a plan before the
|
|
465
483
|
// walls are built, a site with its paving and fences. The roofs frame with the walls, and so does
|
|
466
|
-
// a plugin's node (a roof plane), whose shape core cannot read: up to its storey's top.
|
|
484
|
+
// a plugin's node (a roof plane), whose shape core cannot read: up to its storey's top. A roof's
|
|
485
|
+
// faces are read through their kind (`capabilities.roofs`); a plugin's this runtime has not
|
|
486
|
+
// registered frames as one on the level would.
|
|
467
487
|
const held = [];
|
|
468
488
|
const roofs = [];
|
|
469
489
|
let pluginTop = Number.NEGATIVE_INFINITY;
|
|
490
|
+
const upToStoreyTop = (levelId, at) => {
|
|
491
|
+
const storey = elevations.get(levelId);
|
|
492
|
+
if (storey)
|
|
493
|
+
pluginTop = Math.max(pluginTop, baseOf(levelId) + storey.height + at.y);
|
|
494
|
+
};
|
|
470
495
|
// biome-ignore lint/plugin: a view frames whatever the level holds
|
|
471
496
|
for (const node of Object.values(nodes)) {
|
|
472
497
|
const level = levelOf(node);
|
|
@@ -475,6 +500,7 @@ export function sceneViewBounds(nodes, targetId, presentation) {
|
|
|
475
500
|
const inTarget = !target ||
|
|
476
501
|
target.id === node.id ||
|
|
477
502
|
target.id === level.id ||
|
|
503
|
+
level.id === coveredByTarget ||
|
|
478
504
|
(target.type === 'building' && level.parentId === target.id);
|
|
479
505
|
if (!inTarget)
|
|
480
506
|
continue;
|
|
@@ -491,15 +517,14 @@ export function sceneViewBounds(nodes, targetId, presentation) {
|
|
|
491
517
|
});
|
|
492
518
|
else if (node.type === 'item')
|
|
493
519
|
(isRoofGeometry(node) ? roofs : held).push(placedBox(itemBox(node, baseOf(level.id)), at));
|
|
494
|
-
else if (node.type.includes(':'))
|
|
495
|
-
|
|
496
|
-
if (storey)
|
|
497
|
-
pluginTop = Math.max(pluginTop, baseOf(level.id) + storey.height + at.y);
|
|
498
|
-
}
|
|
520
|
+
else if (node.type.includes(':'))
|
|
521
|
+
upToStoreyTop(level.id, at);
|
|
499
522
|
else {
|
|
500
523
|
const box = levelChildBox(nodes, node, baseOf(level.id));
|
|
501
524
|
if (box)
|
|
502
525
|
(node.type === 'roof' ? roofs : held).push(placedBox(box, at));
|
|
526
|
+
if (node.type === 'roof' && (node.children ?? []).some(unreadFace))
|
|
527
|
+
upToStoreyTop(level.id, at);
|
|
503
528
|
}
|
|
504
529
|
}
|
|
505
530
|
const upTo = (box) => pluginTop > box.max[1] ? { min: box.min, max: [box.max[0], pluginTop, box.max[2]] } : box;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-assets.d.ts","sourceRoot":"","sources":["../../src/agent-operations/search-assets.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,KAAK,WAAW,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AACvD,KAAK,iBAAiB,GAAG;IAAE,OAAO,EAAE,WAAW,EAAE,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAcnE;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,cAAc,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"search-assets.d.ts","sourceRoot":"","sources":["../../src/agent-operations/search-assets.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C,KAAK,WAAW,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AACvD,KAAK,iBAAiB,GAAG;IAAE,OAAO,EAAE,WAAW,EAAE,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAcnE;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,cAAc,CAAC,iBAAiB,CA2C1D,CAAA"}
|
|
@@ -38,6 +38,12 @@ export const searchAssets = (_nodes, input, context) => {
|
|
|
38
38
|
category: item.category,
|
|
39
39
|
dimensions: item.dimensions ?? [1, 1, 1],
|
|
40
40
|
attachTo: item.attachTo ?? null,
|
|
41
|
+
...(item.script && {
|
|
42
|
+
params: item.script.manifest.params.map((spec) => ({
|
|
43
|
+
...spec,
|
|
44
|
+
value: item.script.params[spec.id] ?? spec.default,
|
|
45
|
+
})),
|
|
46
|
+
}),
|
|
41
47
|
}));
|
|
42
48
|
return { query: query.text, total: found.total, truncated, results };
|
|
43
49
|
});
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { ZodType } from 'zod';
|
|
2
2
|
import type { DesignBrief } from '../agent-tools/design-brief.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Steps } from '../lib/steps.js';
|
|
4
|
+
import type { AnyNode, Collection, CompiledGeometryScript, SceneMaterial, SceneMaterialId } from '../schema/index.js';
|
|
4
5
|
import type { AssetSearchResult } from './asset-catalog.js';
|
|
5
6
|
import type { AssetViewFacts } from './asset-views.js';
|
|
7
|
+
import type { CatalogAsset } from './catalog-asset.js';
|
|
6
8
|
import type { SessionKeep, SessionRecord } from './scene-checkpoint.js';
|
|
7
9
|
export type SceneNodes = Readonly<Record<string, AnyNode>>;
|
|
8
10
|
/**
|
|
@@ -32,7 +34,7 @@ export type AgentContext = {
|
|
|
32
34
|
};
|
|
33
35
|
/** The agent's session so far. The host keeps it where its sessions live; it is never scene data. */
|
|
34
36
|
session?: SessionRecord;
|
|
35
|
-
catalog?: readonly
|
|
37
|
+
catalog?: readonly CatalogAsset[];
|
|
36
38
|
/** The library's answers to the call's searches, by `assetSearchKey`; set, they are what search_assets lists. */
|
|
37
39
|
catalogSearches?: Readonly<Record<string, AssetSearchResult>>;
|
|
38
40
|
/**
|
|
@@ -118,6 +120,12 @@ export type AgentOperationOutcome = {
|
|
|
118
120
|
* what the tool's contract parses; `never` by default so any operation fits a registry.
|
|
119
121
|
*/
|
|
120
122
|
export type AgentOperation<Input = never> = (nodes: SceneNodes, input: Input, context: AgentContext) => AgentOperationOutcome;
|
|
123
|
+
/**
|
|
124
|
+
* An operation that takes seconds on a large building, in steps: a batch's calls, verify_scene's
|
|
125
|
+
* checks. A host that can let other work run between them resumes it one step at a time; the
|
|
126
|
+
* operation of the same name runs it through (`inOneGo`), with the same outcome.
|
|
127
|
+
*/
|
|
128
|
+
export type AgentOperationSteps<Input = never> = (...args: Parameters<AgentOperation<Input>>) => Steps<AgentOperationOutcome>;
|
|
121
129
|
/** Operations by tool name: core's `AGENT_OPERATIONS`, or a plugin's `./agent-operations` export. */
|
|
122
130
|
export type AgentOperations = Readonly<Record<string, AgentOperation>>;
|
|
123
131
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/agent-operations/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAClC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,KAAK,EACV,OAAO,EACP,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/agent-operations/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAClC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,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,CAAA;CAChD,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,uFAAuF;IACvF,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK;QACtC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QAC/B,OAAO,CAAC,EAAE,YAAY,CAAA;KACvB,CAAA;CACF,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,cAAc,CAAC,KAAK,GAAG,KAAK,IAAI,CAC1C,KAAK,EAAE,UAAU,EACjB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,YAAY,KAClB,qBAAqB,CAAA;AAE1B;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,CAAC,KAAK,GAAG,KAAK,IAAI,CAC/C,GAAG,IAAI,EAAE,UAAU,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,KACvC,KAAK,CAAC,qBAAqB,CAAC,CAAA;AAEjC,qGAAqG;AACrG,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAAA"}
|
|
@@ -1,12 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isUsageType, ROOM_ENTRY_TYPE, ROOM_FOLDED_TYPES } from '../agent-tools/verify-scene-usage.js';
|
|
2
|
+
import { USAGE_TYPES, usageIssueSteps } from '../spatial/usage-field/findings.js';
|
|
2
3
|
import { sdfChecksOn } from '../spatial/usage-field/flag.js';
|
|
3
4
|
import { registerSceneCheck } from './verify-scene.js';
|
|
5
|
+
/**
|
|
6
|
+
* The finding types a `type` question is about: itself, or what a room's one entry holds. A usage
|
|
7
|
+
* type no measurement gives is a misspelt one, and its answer names the types there are: every
|
|
8
|
+
* measurement is taken, as for a question with no type.
|
|
9
|
+
*/
|
|
10
|
+
function askedTypes(type) {
|
|
11
|
+
if (typeof type !== 'string' || type.length === 0)
|
|
12
|
+
return undefined;
|
|
13
|
+
if (type === ROOM_ENTRY_TYPE)
|
|
14
|
+
return new Set(ROOM_FOLDED_TYPES);
|
|
15
|
+
return isUsageType(type) && !USAGE_TYPES.has(type) ? undefined : new Set([type]);
|
|
16
|
+
}
|
|
4
17
|
/**
|
|
5
18
|
* Passages, turning circles, pockets and wall objects, measured on the real shapes of the scene
|
|
6
|
-
* (`spatial/usage-field`). Off unless a host turns usage checks on; off, it adds nothing.
|
|
19
|
+
* (`spatial/usage-field`). Off unless a host turns usage checks on; off, it adds nothing. A
|
|
20
|
+
* question about one finding type takes the measurements that give it, and none for a type that
|
|
21
|
+
* is not a usage finding.
|
|
7
22
|
*/
|
|
8
23
|
registerSceneCheck({
|
|
9
24
|
name: 'usage',
|
|
10
25
|
order: 60,
|
|
11
|
-
run: (nodes) =>
|
|
26
|
+
run: (nodes, input) => sdfChecksOn() ? usageIssueSteps(nodes, { types: askedTypes(input.type) }) : [],
|
|
12
27
|
});
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type OpenWallEnd } from '../lib/room-graph.js';
|
|
2
|
+
import { type Steps } from '../lib/steps.js';
|
|
2
3
|
import type { UsageIssue } from '../spatial/usage-field/findings.js';
|
|
3
4
|
import { type CeilingObjectObservation } from './ceiling-object-observations.js';
|
|
4
5
|
import type { RoomCheckIssue } from './room-checks.js';
|
|
5
6
|
import { type RoomFinding } from './room-findings.js';
|
|
6
|
-
import type { AgentContext, AgentOperation, SceneNodes } from './types.js';
|
|
7
|
+
import type { AgentContext, AgentOperation, AgentOperationSteps, SceneNodes } from './types.js';
|
|
7
8
|
import type { RoomUnreachableIssue } from './unreachable-rooms-check.js';
|
|
8
9
|
import { type WallEndShortIssue, type WallNearlyAlignedIssue } from './wall-joins.js';
|
|
9
10
|
import { type WallObjectObservation } from './wall-object-observations.js';
|
|
@@ -57,12 +58,13 @@ export type VerifySceneInput = Readonly<Record<string, unknown>>;
|
|
|
57
58
|
/**
|
|
58
59
|
* A check verify_scene runs beyond its own, registered by the module that knows it (the facade
|
|
59
60
|
* checks, the photo's), so verify_scene imports none of them. Checks before CHECKPOINT_ORDER run
|
|
60
|
-
* ahead of the checkpoint's comparison, the rest after it.
|
|
61
|
+
* ahead of the checkpoint's comparison, the rest after it. A check that takes seconds on a large
|
|
62
|
+
* building answers in steps, and verify_scene stops where it does.
|
|
61
63
|
*/
|
|
62
64
|
export type SceneCheck = {
|
|
63
65
|
name: string;
|
|
64
66
|
order: number;
|
|
65
|
-
run: (nodes: SceneNodes, input: VerifySceneInput, context: AgentContext) => SceneIssue[]
|
|
67
|
+
run: (nodes: SceneNodes, input: VerifySceneInput, context: AgentContext) => SceneIssue[] | Steps<SceneIssue[]>;
|
|
66
68
|
};
|
|
67
69
|
export declare const CHECKPOINT_ORDER = 100;
|
|
68
70
|
/**
|
|
@@ -78,4 +80,6 @@ export declare function registerSceneReport(report: SceneReport): void;
|
|
|
78
80
|
/** Runs a check in every verify_scene from now on; registering a check again replaces it. */
|
|
79
81
|
export declare function registerSceneCheck(check: SceneCheck): void;
|
|
80
82
|
export declare const verifyScene: AgentOperation<VerifySceneInput | undefined>;
|
|
83
|
+
/** `verify_scene`, a step for each registered check and for each step of one that has them. */
|
|
84
|
+
export declare const verifySceneSteps: AgentOperationSteps<VerifySceneInput | undefined>;
|
|
81
85
|
//# sourceMappingURL=verify-scene.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-scene.d.ts","sourceRoot":"","sources":["../../src/agent-operations/verify-scene.ts"],"names":[],"mappings":"AAOA,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"verify-scene.d.ts","sourceRoot":"","sources":["../../src/agent-operations/verify-scene.ts"],"names":[],"mappings":"AAOA,OAAO,EAAsB,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AInC;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAA;AAI/F,+FAA+F;AAC/F,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,WAAW,QAItD;AAED,6FAA6F;AAC7F,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,QAKnD;AAuLD,eAAO,MAAM,WAAW,EAAE,cAAc,CAAC,gBAAgB,GAAG,SAAS,CACnB,CAAA;AAElD,+FAA+F;AAC/F,eAAO,MAAM,gBAAgB,EAAE,mBAAmB,CAAC,gBAAgB,GAAG,SAAS,CAigB9E,CAAA"}
|
|
@@ -7,6 +7,7 @@ import { HIDDEN_SITE_NOTE } from '../lib/node-visibility.js';
|
|
|
7
7
|
import { wallSupportForNodes } from '../lib/opening-floor-datum.js';
|
|
8
8
|
import { detectOpenWallEnds } from '../lib/room-graph.js';
|
|
9
9
|
import { siteBrief } from '../lib/site-placement.js';
|
|
10
|
+
import { inOneGo } from '../lib/steps.js';
|
|
10
11
|
import { nodeRegistry } from '../registry/index.js';
|
|
11
12
|
import { AnyNode as AnyNodeSchema, } from '../schema/index.js';
|
|
12
13
|
import { nodeSchemaForKind } from '../schema/compiled-node-parsers.js';
|
|
@@ -206,7 +207,9 @@ function checkSchemas(scene, hostSchema) {
|
|
|
206
207
|
*/
|
|
207
208
|
/** A flight of this many risers or fewer is a step up to a door, not a staircase: no going or comfort target applies. */
|
|
208
209
|
const SHORT_FLIGHT_STEPS = 3;
|
|
209
|
-
export const verifyScene = (scene, input, context) =>
|
|
210
|
+
export const verifyScene = (scene, input, context) => inOneGo(verifySceneSteps(scene, input, context));
|
|
211
|
+
/** `verify_scene`, a step for each registered check and for each step of one that has them. */
|
|
212
|
+
export const verifySceneSteps = function* (scene, input, context) {
|
|
210
213
|
const { errors, unknownKinds, unread, measured: nodes } = checkSchemas(scene, context.nodeSchema);
|
|
211
214
|
const onLevel = (levelId) => nodesOnLevel(nodes, levelId);
|
|
212
215
|
const ofType = (content, type) => content.filter((node) => node.type === type);
|
|
@@ -526,9 +529,16 @@ export const verifyScene = (scene, input, context) => {
|
|
|
526
529
|
issues.push(...layoutIssuesFromScene(Object.values(settled)));
|
|
527
530
|
issues.push(...ceilingObjectObservations(settled));
|
|
528
531
|
issues.push(...wallObjectObservations(settled));
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
+
const registered = function* (beforeCheckpoint) {
|
|
533
|
+
for (const check of checks) {
|
|
534
|
+
if (check.order < CHECKPOINT_ORDER !== beforeCheckpoint)
|
|
535
|
+
continue;
|
|
536
|
+
const found = check.run(settled, input ?? {}, context);
|
|
537
|
+
issues.push(...(Array.isArray(found) ? found : yield* found));
|
|
538
|
+
yield;
|
|
539
|
+
}
|
|
540
|
+
};
|
|
541
|
+
yield* registered(true);
|
|
532
542
|
// What the edits since the host's checkpoint lost, by place.
|
|
533
543
|
const hosted = context.checkpoint
|
|
534
544
|
? changesSince(context.checkpoint, scene)
|
|
@@ -541,9 +551,7 @@ export const verifyScene = (scene, input, context) => {
|
|
|
541
551
|
const since = typeof input?.since === 'string' ? reviewSince(session, input.since, scene) : null;
|
|
542
552
|
if (since?.places)
|
|
543
553
|
issues.push(...since.places.issues);
|
|
544
|
-
|
|
545
|
-
if (check.order >= CHECKPOINT_ORDER)
|
|
546
|
-
issues.push(...check.run(settled, input ?? {}, context));
|
|
554
|
+
yield* registered(false);
|
|
547
555
|
const occupiedStoryCount = levels.filter((level) => level.isOccupiedStory).length;
|
|
548
556
|
issues.splice(0, issues.length, ...withoutDuplicatePockets(issues));
|
|
549
557
|
const issueGroups = sceneIssueGroups(issues, nodes);
|
|
@@ -5,7 +5,7 @@ export const SEARCH_ASSETS_MAX_LIMIT = 60;
|
|
|
5
5
|
export const searchAssetsTool = {
|
|
6
6
|
name: 'search_assets',
|
|
7
7
|
title: 'Search assets',
|
|
8
|
-
description: `Search the item library (furniture, fixtures, lights, plants, outdoor) by keyword, with one or several queries in a call. The catalog is a limited set that varies by server: what a search returns is what exists. Results provide valid asset ids and placement facts when these are not already known. A query matches the items whose name, id, category or tags hold every one of its words. Returns one group per query, best matches first (the name exactly, then words of the name, words starting it, the category, a tag), at most limit items (${SEARCH_ASSETS_LIMIT} unless set, up to ${SEARCH_ASSETS_MAX_LIMIT}); total counts every match and truncated says the limit cut some, with a hint on how to narrow. Each item has its id, name, category, dimensions [width, height, depth] in metres and attachTo (null on the floor, else 'wall', 'wall-side' or 'ceiling'). Related lookups (sofa, coffee table, tv stand) can share a call.`,
|
|
8
|
+
description: `Search the item library (furniture, fixtures, lights, plants, outdoor) by keyword, with one or several queries in a call. The catalog is a limited set that varies by server: what a search returns is what exists. Results provide valid asset ids and placement facts when these are not already known. A query matches the items whose name, id, category or tags hold every one of its words. Returns one group per query, best matches first (the name exactly, then words of the name, words starting it, the category, a tag), at most limit items (${SEARCH_ASSETS_LIMIT} unless set, up to ${SEARCH_ASSETS_MAX_LIMIT}); total counts every match and truncated says the limit cut some, with a hint on how to narrow. Each item has its id, name, category, dimensions [width, height, depth] in metres and attachTo (null on the floor, else 'wall', 'wall-side' or 'ceiling'). An item with params is built from code and listed before plain models the query names as well: once placed, add_object with its nodeId and new params resizes or reshapes it to the room. Related lookups (sofa, coffee table, tv stand) can share a call.`,
|
|
9
9
|
input: {
|
|
10
10
|
queries: z
|
|
11
11
|
.array(z.object({
|
|
@@ -802,36 +802,6 @@ export declare function openingScene(): {
|
|
|
802
802
|
level: number;
|
|
803
803
|
baseElevation: number;
|
|
804
804
|
height?: number | undefined;
|
|
805
|
-
} | {
|
|
806
|
-
object: "node";
|
|
807
|
-
name?: string | undefined;
|
|
808
|
-
parentId: string | null;
|
|
809
|
-
visible: boolean;
|
|
810
|
-
camera?: {
|
|
811
|
-
position: [number, number, number];
|
|
812
|
-
target: [number, number, number];
|
|
813
|
-
mode: "orthographic" | "perspective";
|
|
814
|
-
fov?: number | undefined;
|
|
815
|
-
zoom?: number | undefined;
|
|
816
|
-
} | undefined;
|
|
817
|
-
metadata: Record<string, unknown>;
|
|
818
|
-
provenance?: {
|
|
819
|
-
refs: {
|
|
820
|
-
ns?: string | undefined;
|
|
821
|
-
id: string;
|
|
822
|
-
role?: "absorbed" | "alias" | "derived" | "piece" | "primary" | undefined;
|
|
823
|
-
}[];
|
|
824
|
-
lineage?: {
|
|
825
|
-
op: "attach" | "convert" | "duplicate" | "import" | "make-independent" | "merge" | "promote" | "split";
|
|
826
|
-
fromIds: string[];
|
|
827
|
-
} | undefined;
|
|
828
|
-
} | undefined;
|
|
829
|
-
id: `building_${string}`;
|
|
830
|
-
type: "building";
|
|
831
|
-
children: (`elevator_${string}` | `level_${string}` | `unit_${string}`)[];
|
|
832
|
-
position: [number, number, number];
|
|
833
|
-
rotation: [number, number, number];
|
|
834
|
-
groundLevelId?: `level_${string}` | undefined;
|
|
835
805
|
} | {
|
|
836
806
|
object: "node";
|
|
837
807
|
name?: string | undefined;
|
|
@@ -1060,6 +1030,36 @@ export declare function openingScene(): {
|
|
|
1060
1030
|
panicBarStyle: "crossbar" | "touchbar";
|
|
1061
1031
|
panicBarRods: boolean;
|
|
1062
1032
|
panicBarHeight: number;
|
|
1033
|
+
} | {
|
|
1034
|
+
object: "node";
|
|
1035
|
+
name?: string | undefined;
|
|
1036
|
+
parentId: string | null;
|
|
1037
|
+
visible: boolean;
|
|
1038
|
+
camera?: {
|
|
1039
|
+
position: [number, number, number];
|
|
1040
|
+
target: [number, number, number];
|
|
1041
|
+
mode: "orthographic" | "perspective";
|
|
1042
|
+
fov?: number | undefined;
|
|
1043
|
+
zoom?: number | undefined;
|
|
1044
|
+
} | undefined;
|
|
1045
|
+
metadata: Record<string, unknown>;
|
|
1046
|
+
provenance?: {
|
|
1047
|
+
refs: {
|
|
1048
|
+
ns?: string | undefined;
|
|
1049
|
+
id: string;
|
|
1050
|
+
role?: "absorbed" | "alias" | "derived" | "piece" | "primary" | undefined;
|
|
1051
|
+
}[];
|
|
1052
|
+
lineage?: {
|
|
1053
|
+
op: "attach" | "convert" | "duplicate" | "import" | "make-independent" | "merge" | "promote" | "split";
|
|
1054
|
+
fromIds: string[];
|
|
1055
|
+
} | undefined;
|
|
1056
|
+
} | undefined;
|
|
1057
|
+
id: `building_${string}`;
|
|
1058
|
+
type: "building";
|
|
1059
|
+
children: (`elevator_${string}` | `level_${string}` | `unit_${string}`)[];
|
|
1060
|
+
position: [number, number, number];
|
|
1061
|
+
rotation: [number, number, number];
|
|
1062
|
+
groundLevelId?: `level_${string}` | undefined;
|
|
1063
1063
|
};
|
|
1064
1064
|
};
|
|
1065
1065
|
rootNodeIds: `building_${string}`[];
|