@kensnzk/koyu 0.20.0 → 0.21.0
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/README.ja.md +4 -4
- package/README.md +4 -4
- package/dist/cli.js +34 -8
- package/dist/cli.js.map +1 -1
- package/dist/core/diagnose.d.ts +1 -0
- package/dist/core/diagnose.d.ts.map +1 -1
- package/dist/core/diagnose.js +19 -1
- package/dist/core/diagnose.js.map +1 -1
- package/dist/core/model.d.ts +15 -3
- package/dist/core/model.d.ts.map +1 -1
- package/dist/core/model.js +24 -8
- package/dist/core/model.js.map +1 -1
- package/dist/core/vocabulary.d.ts +16 -0
- package/dist/core/vocabulary.d.ts.map +1 -1
- package/dist/core/vocabulary.js +11 -2
- package/dist/core/vocabulary.js.map +1 -1
- package/dist/mcp.js +37 -10
- package/dist/mcp.js.map +1 -1
- package/dist/model.d.ts +1 -1
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +1 -1
- package/dist/model.js.map +1 -1
- package/dist/validate/builtin/access.js +30 -6
- package/dist/validate/builtin/access.js.map +1 -1
- package/examples/basement/main.muro +9 -9
- package/examples/complex/L1.muro +22 -22
- package/examples/complex/basement.muro +4 -4
- package/examples/complex/core.muro +9 -9
- package/examples/complex/hotel.muro +14 -14
- package/examples/complex/main.muro +1 -1
- package/examples/complex/office.muro +3 -3
- package/examples/complex/plant.muro +4 -4
- package/examples/complex/podium.muro +23 -23
- package/examples/house/main.muro +2 -2
- package/examples/house.muro +2 -2
- package/examples/mansion.muro +27 -27
- package/examples/office.muro +16 -16
- package/examples/steps/06-finished.muro +1 -1
- package/examples/tower/L1.muro +12 -12
- package/examples/tower/L11.muro +4 -4
- package/examples/tower/L2.muro +10 -10
- package/examples/tower/main.muro +1 -1
- package/examples/tower/typical.muro +10 -10
- package/examples/twin/L1.muro +29 -29
- package/examples/twin/L5.muro +14 -14
- package/examples/twin/basement.muro +9 -9
- package/examples/twin/core.muro +49 -49
- package/examples/twin/hotel.muro +15 -15
- package/examples/twin/main.muro +1 -1
- package/examples/twin/office.muro +10 -10
- package/examples/twin/podium.muro +73 -73
- package/examples/twin/residence.muro +10 -10
- package/examples/two-rooms.canonical.json +1 -1
- package/examples/two-rooms.muro +1 -1
- package/package.json +4 -3
- package/src/cli.ts +34 -8
- package/src/core/diagnose.ts +23 -1
- package/src/core/model.ts +25 -9
- package/src/core/vocabulary.ts +30 -2
- package/src/mcp.ts +38 -10
- package/src/model.ts +1 -1
- package/src/validate/builtin/access.ts +32 -6
|
@@ -9,7 +9,7 @@ import type {
|
|
|
9
9
|
import { passable } from "../../core/graph.js";
|
|
10
10
|
import {
|
|
11
11
|
canonicalSpaceOrder,
|
|
12
|
-
|
|
12
|
+
effectiveAttr,
|
|
13
13
|
isOutside,
|
|
14
14
|
isVoid,
|
|
15
15
|
type Boundary,
|
|
@@ -101,7 +101,7 @@ export const ACCESS_ANALYSIS: AnalysisDefinition<AccessAnalysisValue> = freezeBu
|
|
|
101
101
|
.filter((space) =>
|
|
102
102
|
space.type === "corridor"
|
|
103
103
|
&& space.rects.length > 0
|
|
104
|
-
&&
|
|
104
|
+
&& leaseCategory(coreModel, space) === "common"
|
|
105
105
|
)
|
|
106
106
|
.map((space) => space.path);
|
|
107
107
|
|
|
@@ -124,13 +124,13 @@ export const ACCESS_ANALYSIS: AnalysisDefinition<AccessAnalysisValue> = freezeBu
|
|
|
124
124
|
.map((space) => routeObservation(
|
|
125
125
|
space.path,
|
|
126
126
|
findRoute(coreModel, [space.path], exterior, {
|
|
127
|
-
avoid: (candidate) =>
|
|
127
|
+
avoid: (candidate) => leaseCategory(coreModel, candidate) === "rentable",
|
|
128
128
|
}),
|
|
129
129
|
));
|
|
130
130
|
|
|
131
131
|
const vehicleCanPass = carPassable(coreModel);
|
|
132
132
|
const vehicleExteriorRoutes = spaces
|
|
133
|
-
.filter((space) => baseAccessPopulation(space) &&
|
|
133
|
+
.filter((space) => baseAccessPopulation(space) && isVehicleSpace(space))
|
|
134
134
|
.map((space) => routeObservation(
|
|
135
135
|
space.path,
|
|
136
136
|
findRoute(coreModel, [space.path], exterior, { canPass: vehicleCanPass }),
|
|
@@ -141,7 +141,7 @@ export const ACCESS_ANALYSIS: AnalysisDefinition<AccessAnalysisValue> = freezeBu
|
|
|
141
141
|
space.rects.length > 0
|
|
142
142
|
&& space.type !== "shaft"
|
|
143
143
|
&& (space.attrs["stair"] != null || space.attrs["escalator"] != null)
|
|
144
|
-
&&
|
|
144
|
+
&& leaseCategory(coreModel, space) === "common"
|
|
145
145
|
)
|
|
146
146
|
.map((space) => {
|
|
147
147
|
const horizontalEntry = (boundary: Boundary): boolean =>
|
|
@@ -280,7 +280,7 @@ export const ACCESS_PARKING_RULE: Rule = freezeBuiltin<Rule>({
|
|
|
280
280
|
if (artifact.state !== "complete") return analysisIndeterminate(artifact);
|
|
281
281
|
if (artifact.value.exteriorRefs.length === 0) return notApplicable("No exterior space is declared");
|
|
282
282
|
if (artifact.value.vehicleExteriorRoutes.length === 0) {
|
|
283
|
-
return notApplicable("No regioned eligible space
|
|
283
|
+
return notApplicable("No regioned eligible space is typed parking or ramp");
|
|
284
284
|
}
|
|
285
285
|
const evidenceById = evidenceMap(artifact);
|
|
286
286
|
return applicable(artifact.value.vehicleExteriorRoutes.map((route): RuleOutcome => ({
|
|
@@ -478,6 +478,32 @@ function carPassable(model: Model): CanPass {
|
|
|
478
478
|
};
|
|
479
479
|
}
|
|
480
480
|
|
|
481
|
+
/**
|
|
482
|
+
* The lease division a space falls in, as this rule pack reads it.
|
|
483
|
+
*
|
|
484
|
+
* `lease.category` is a carried namespaced key, so core gives it no meaning and nothing guards
|
|
485
|
+
* its spelling: write `lease.categry:common` and the rules below quietly stop applying to that
|
|
486
|
+
* space. That is the same exposure the free type words already carry here, and it is a
|
|
487
|
+
* consequence of judgement living on the face that does not freeze rather than in the language.
|
|
488
|
+
*
|
|
489
|
+
* It resolves through the zones above a space, so writing it once on a tenancy zone reaches
|
|
490
|
+
* every room beneath.
|
|
491
|
+
*/
|
|
492
|
+
function leaseCategory(model: Model, space: Space): string | undefined {
|
|
493
|
+
const v = effectiveAttr(model, space, "lease.category");
|
|
494
|
+
return typeof v === "string" ? v : undefined;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Whether cars belong in this space.
|
|
499
|
+
*
|
|
500
|
+
* This is the room's purpose, so it is read from the type position rather than from a key.
|
|
501
|
+
* On the bundled examples it selects exactly the spaces the retired `use:parking` selected.
|
|
502
|
+
*/
|
|
503
|
+
function isVehicleSpace(space: Space): boolean {
|
|
504
|
+
return space.type === "parking" || space.type === "ramp";
|
|
505
|
+
}
|
|
506
|
+
|
|
481
507
|
function baseAccessPopulation(space: Space): boolean {
|
|
482
508
|
return space.rects.length > 0 && !isOutside(space) && !impassable(space);
|
|
483
509
|
}
|