@pascal-app/core 1.1.0 → 1.1.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/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 +12209 -12209
- 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 +7 -1
- package/dist/agent-operations/batch.d.ts.map +1 -1
- package/dist/agent-operations/batch.js +17 -2
- 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 +2963 -2963
- 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 +3 -0
- package/dist/agent-operations/index.d.ts.map +1 -1
- package/dist/agent-operations/index.js +4 -1
- 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 +585 -585
- 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 +3 -2
- package/dist/agent-operations/types.d.ts.map +1 -1
- package/dist/agent-operations/usage-checks.js +18 -3
- package/dist/agent-tools/assets.js +1 -1
- package/dist/building/__fixtures__/wall-opening-cases.d.ts +234 -234
- package/dist/building/level-duplication.d.ts +3516 -3516
- 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 +566 -566
- package/dist/hooks/spatial-grid/spatial-grid-sync.d.ts +585 -585
- 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 +9262 -9262
- package/dist/lib/absorb-wall-separators.d.ts +1344 -1344
- 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/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 +7 -1
- package/dist/spatial/usage-field/findings.d.ts.map +1 -1
- package/dist/spatial/usage-field/findings.js +42 -10
- 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 +1641 -1641
- package/dist/store/scene-annotations.d.ts +1778 -1778
- 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 +1622 -1622
- package/dist/systems/slab/__fixtures__/raised-room.d.ts +585 -585
- package/dist/systems/stair/stair-opening-preview.d.ts +1919 -1919
- package/dist/utils/ensure-scene-openings.d.ts +3409 -3409
- package/dist/utils/floor-plate-migration.d.ts +1344 -1344
- package/dist/utils/owned-floor-opening-migration.d.ts +1344 -1344
- package/dist/utils/reconcile-structure-on-load.d.ts +1641 -1641
- 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,EAAE,MAAM,CAAC,CAAC;IAAC,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAAA;AAC3F,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAA;AACvD,KAAK,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAA;AAEjD,uEAAuE;AACvE,MAAM,M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AW,GAAG,WAAW,GAAG,KAAK,GAAG,YAAY,CAC9D,GAAG;IAAE,IAAI,CAAC,EAAE,WAAW,GAAG,OAAO,GAAG,EAAE,CAAA;CAAE,CAAA;AAEzC;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,kBAAkB,GAAG,aAAa,CAgEzF;AAaD;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACzC,QAAQ,CAAC,EAAE,iBAAiB,EAC5B,IAAI,CAAC,EAAE,aAAa,UA8BrB;AA6RD;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACxC,KAAK,EAAE,cAAc,EACrB,EAAE,aAAa,EAAE,GAAE;IAAE,aAAa,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAA;CAAO,GACxE;IACD,IAAI,EAAE,aAAa,CAAA;IACnB,IAAI,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAC9B,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,QAAQ,CAAC,EAAE,iBAAiB,CAAA;IAC5B,YAAY,CAAC,EAAE,qBAAqB,CAAA;IACpC,QAAQ,CAAC,EAAE,iBAAiB,CAAA;CAC7B,CAkHA"}
|
|
@@ -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,9 @@
|
|
|
1
1
|
import type { ZodType } from 'zod';
|
|
2
2
|
import type { DesignBrief } from '../agent-tools/design-brief.js';
|
|
3
|
-
import type { AnyNode,
|
|
3
|
+
import type { AnyNode, Collection, CompiledGeometryScript, SceneMaterial, SceneMaterialId } from '../schema/index.js';
|
|
4
4
|
import type { AssetSearchResult } from './asset-catalog.js';
|
|
5
5
|
import type { AssetViewFacts } from './asset-views.js';
|
|
6
|
+
import type { CatalogAsset } from './catalog-asset.js';
|
|
6
7
|
import type { SessionKeep, SessionRecord } from './scene-checkpoint.js';
|
|
7
8
|
export type SceneNodes = Readonly<Record<string, AnyNode>>;
|
|
8
9
|
/**
|
|
@@ -32,7 +33,7 @@ export type AgentContext = {
|
|
|
32
33
|
};
|
|
33
34
|
/** The agent's session so far. The host keeps it where its sessions live; it is never scene data. */
|
|
34
35
|
session?: SessionRecord;
|
|
35
|
-
catalog?: readonly
|
|
36
|
+
catalog?: readonly CatalogAsset[];
|
|
36
37
|
/** The library's answers to the call's searches, by `assetSearchKey`; set, they are what search_assets lists. */
|
|
37
38
|
catalogSearches?: Readonly<Record<string, AssetSearchResult>>;
|
|
38
39
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/agent-operations/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA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AA;KAAE,EAAE,CAAA;IAC/C,MAAM,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;KAAE,EAAE,CAAA;IACjD,sFAAsF;IACtF,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC,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,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, usageIssues } 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() ? usageIssues(nodes, { types: askedTypes(input.type) }) : [],
|
|
12
27
|
});
|
|
@@ -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({
|