@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.
Files changed (62) hide show
  1. package/README.ja.md +4 -4
  2. package/README.md +4 -4
  3. package/dist/cli.js +34 -8
  4. package/dist/cli.js.map +1 -1
  5. package/dist/core/diagnose.d.ts +1 -0
  6. package/dist/core/diagnose.d.ts.map +1 -1
  7. package/dist/core/diagnose.js +19 -1
  8. package/dist/core/diagnose.js.map +1 -1
  9. package/dist/core/model.d.ts +15 -3
  10. package/dist/core/model.d.ts.map +1 -1
  11. package/dist/core/model.js +24 -8
  12. package/dist/core/model.js.map +1 -1
  13. package/dist/core/vocabulary.d.ts +16 -0
  14. package/dist/core/vocabulary.d.ts.map +1 -1
  15. package/dist/core/vocabulary.js +11 -2
  16. package/dist/core/vocabulary.js.map +1 -1
  17. package/dist/mcp.js +37 -10
  18. package/dist/mcp.js.map +1 -1
  19. package/dist/model.d.ts +1 -1
  20. package/dist/model.d.ts.map +1 -1
  21. package/dist/model.js +1 -1
  22. package/dist/model.js.map +1 -1
  23. package/dist/validate/builtin/access.js +30 -6
  24. package/dist/validate/builtin/access.js.map +1 -1
  25. package/examples/basement/main.muro +9 -9
  26. package/examples/complex/L1.muro +22 -22
  27. package/examples/complex/basement.muro +4 -4
  28. package/examples/complex/core.muro +9 -9
  29. package/examples/complex/hotel.muro +14 -14
  30. package/examples/complex/main.muro +1 -1
  31. package/examples/complex/office.muro +3 -3
  32. package/examples/complex/plant.muro +4 -4
  33. package/examples/complex/podium.muro +23 -23
  34. package/examples/house/main.muro +2 -2
  35. package/examples/house.muro +2 -2
  36. package/examples/mansion.muro +27 -27
  37. package/examples/office.muro +16 -16
  38. package/examples/steps/06-finished.muro +1 -1
  39. package/examples/tower/L1.muro +12 -12
  40. package/examples/tower/L11.muro +4 -4
  41. package/examples/tower/L2.muro +10 -10
  42. package/examples/tower/main.muro +1 -1
  43. package/examples/tower/typical.muro +10 -10
  44. package/examples/twin/L1.muro +29 -29
  45. package/examples/twin/L5.muro +14 -14
  46. package/examples/twin/basement.muro +9 -9
  47. package/examples/twin/core.muro +49 -49
  48. package/examples/twin/hotel.muro +15 -15
  49. package/examples/twin/main.muro +1 -1
  50. package/examples/twin/office.muro +10 -10
  51. package/examples/twin/podium.muro +73 -73
  52. package/examples/twin/residence.muro +10 -10
  53. package/examples/two-rooms.canonical.json +1 -1
  54. package/examples/two-rooms.muro +1 -1
  55. package/package.json +4 -3
  56. package/src/cli.ts +34 -8
  57. package/src/core/diagnose.ts +23 -1
  58. package/src/core/model.ts +25 -9
  59. package/src/core/vocabulary.ts +30 -2
  60. package/src/mcp.ts +38 -10
  61. package/src/model.ts +1 -1
  62. 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
- effectiveUse,
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
- && effectiveUse(coreModel, space) === "common"
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) => effectiveUse(coreModel, candidate) === "rentable",
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) && effectiveUse(coreModel, space) === "parking")
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
- && effectiveUse(coreModel, space) === "common"
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 has effective use parking");
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
  }