@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
@@ -12,47 +12,47 @@ space /L2/avoid X12+3200..X13 Y5..Y11 + X12..X12+3200 Y5..Y6+5600 + X12..X12+320
12
12
  space /L3/avoid X12+3200..X13 Y5..Y11 + X12..X12+3200 Y5..Y7 + X12..X12+3200 Y8+3600..Y11 name:吹抜け void:1
13
13
  # L4 の吹抜けは基壇のセットバックに合わせて短い — 段々は吹抜けにも及ぶ
14
14
  space /L4/avoid X12+3200..X13 Y6..Y10 + X12..X12+3200 Y6..Y7 + X12..X12+3200 Y8+3600..Y10 name:吹抜け void:1
15
- space /L2..L4/es2 escalator X12..X12+3200 Y7..Y7+12000 name:エスカレーター use:common escalator:N
16
- space /L2/es1 corridor X12..X12+3200 Y6+5600..Y7 name:エスカレーター乗降 use:common
15
+ space /L2..L4/es2 escalator X12..X12+3200 Y7..Y7+12000 name:エスカレーター lease.category:common escalator:N
16
+ space /L2/es1 corridor X12..X12+3200 Y6+5600..Y7 name:エスカレーター乗降 lease.category:common
17
17
  boundary /L1/atrium /L2/avoid type:void
18
18
  boundary /L2/avoid /L3/avoid type:void
19
19
  boundary /L3/avoid /L4/avoid type:void
20
20
  boundary /L2/es1 /L2/es2 type:open
21
21
 
22
22
  # ---- L2 — L1と同じ外形 ----
23
- space /L2/gal corridor X11..X12 Y4..Y12 + X13..X14 Y4..Y12 + X12..X13 Y4..Y5 + X12..X13 Y11..Y12 name:回廊 use:common floor:石張り
23
+ space /L2/gal corridor X11..X12 Y4..Y12 + X13..X14 Y4..Y12 + X12..X13 Y4..Y5 + X12..X13 Y11..Y12 name:回廊 lease.category:common floor:石張り
24
24
  boundary /L2/gal /L2/avoid t:60 spec:手すり air:1 h:1100
25
25
  boundary /L2/gal /L2/es2 type:open
26
26
  band X X2..X11 Y4..Y5
27
- space /L2/s01 shop w:25200 name:南区画01 use:rentable
28
- space /L2/s02 shop w:rest name:南区画02 use:rentable
29
- space /L2/s04 shop X14..X19 Y4..Y5 name:南区画03 use:rentable
30
- space /L2/mallSw corridor X2..X11 Y5..Y6 name:南モール西 use:common floor:石張り
31
- space /L2/mallSe corridor X14..X19 Y5..Y6 name:南モール東 use:common floor:石張り
27
+ space /L2/s01 shop w:25200 name:南区画01 lease.category:rentable
28
+ space /L2/s02 shop w:rest name:南区画02 lease.category:rentable
29
+ space /L2/s04 shop X14..X19 Y4..Y5 name:南区画03 lease.category:rentable
30
+ space /L2/mallSw corridor X2..X11 Y5..Y6 name:南モール西 lease.category:common floor:石張り
31
+ space /L2/mallSe corridor X14..X19 Y5..Y6 name:南モール東 lease.category:common floor:石張り
32
32
  # 西の1スパン (X2..X3) はエントランス吹抜け — 1階の大開口の上をガラスが2層で立つ
33
33
  space /L2/alvoid X2..X3 Y7..Y9 name:エントランス吹抜け void:1
34
- space /L2/es4 corridor X2..X3 Y6..Y7 name:下りエスカレーター乗り場 use:common
35
- space /L2/es3 corridor X2..X3 Y9..Y10 name:上りエスカレーター降り場 use:common
36
- space /L2/w01 corridor X3..X4 Y6..Y7 name:西通路南 use:common
37
- space /L2/w02 shop X4..X8 Y6..Y7 name:西区画02 use:rentable
38
- space /L2/w03 shop X8..X11 Y6..Y7 name:西区画03 use:rentable
39
- space /L2/e01 shop X14..X17 Y6..Y7+5600 name:東区画01 use:rentable
40
- space /L2/e02 shop X17..X19 Y6..Y7+5600 + X17+2800..X19 Y7+5600..Y8+4200 name:東区画02 use:rentable
41
- space /L2/acorr corridor X3..X4 Y7..Y8+4200 name:A棟西通路 use:common
42
- space /L2/eside shop X10..X11 Y7..Y8+4200 name:東脇区画 use:rentable
43
- space /L2/e03 shop X14..X15+5600 Y7+5600..Y8+4200 name:東区画03 use:rentable
44
- space /L2/bcorr corridor X16..X17 Y7+5600..Y8+4200 name:B棟階段付室 use:common
45
- space /L2/w04 corridor X3..X4 Y8+4200..Y10 name:西通路北 use:common
46
- space /L2/w05 shop X4..X8 Y8+4200..Y10 name:西区画05 use:rentable
47
- space /L2/w06 shop X8..X11 Y8+4200..Y10 name:西区画06 use:rentable
48
- space /L2/n04 shop X14..X16 Y9..Y10 name:北区画04 use:rentable
49
- space /L2/n05 shop X16..X19 Y9..Y10 name:北区画05 use:rentable
50
- space /L2/mallNw corridor X2..X11 Y10..Y11 name:北モール西 use:common floor:石張り
51
- space /L2/mallNe corridor X14..X19 Y10..Y11 name:北モール東 use:common floor:石張り
34
+ space /L2/es4 corridor X2..X3 Y6..Y7 name:下りエスカレーター乗り場 lease.category:common
35
+ space /L2/es3 corridor X2..X3 Y9..Y10 name:上りエスカレーター降り場 lease.category:common
36
+ space /L2/w01 corridor X3..X4 Y6..Y7 name:西通路南 lease.category:common
37
+ space /L2/w02 shop X4..X8 Y6..Y7 name:西区画02 lease.category:rentable
38
+ space /L2/w03 shop X8..X11 Y6..Y7 name:西区画03 lease.category:rentable
39
+ space /L2/e01 shop X14..X17 Y6..Y7+5600 name:東区画01 lease.category:rentable
40
+ space /L2/e02 shop X17..X19 Y6..Y7+5600 + X17+2800..X19 Y7+5600..Y8+4200 name:東区画02 lease.category:rentable
41
+ space /L2/acorr corridor X3..X4 Y7..Y8+4200 name:A棟西通路 lease.category:common
42
+ space /L2/eside shop X10..X11 Y7..Y8+4200 name:東脇区画 lease.category:rentable
43
+ space /L2/e03 shop X14..X15+5600 Y7+5600..Y8+4200 name:東区画03 lease.category:rentable
44
+ space /L2/bcorr corridor X16..X17 Y7+5600..Y8+4200 name:B棟階段付室 lease.category:common
45
+ space /L2/w04 corridor X3..X4 Y8+4200..Y10 name:西通路北 lease.category:common
46
+ space /L2/w05 shop X4..X8 Y8+4200..Y10 name:西区画05 lease.category:rentable
47
+ space /L2/w06 shop X8..X11 Y8+4200..Y10 name:西区画06 lease.category:rentable
48
+ space /L2/n04 shop X14..X16 Y9..Y10 name:北区画04 lease.category:rentable
49
+ space /L2/n05 shop X16..X19 Y9..Y10 name:北区画05 lease.category:rentable
50
+ space /L2/mallNw corridor X2..X11 Y10..Y11 name:北モール西 lease.category:common floor:石張り
51
+ space /L2/mallNe corridor X14..X19 Y10..Y11 name:北モール東 lease.category:common floor:石張り
52
52
  band X X2..X11 Y11..Y12
53
- space /L2/n01 shop w:25200 name:北区画01 use:rentable
54
- space /L2/n02 shop w:rest name:北区画02 use:rentable
55
- space /L2/nE shop X14..X19 Y11..Y12 name:北東区画 use:rentable
53
+ space /L2/n01 shop w:25200 name:北区画01 lease.category:rentable
54
+ space /L2/n02 shop w:rest name:北区画02 lease.category:rentable
55
+ space /L2/nE shop X14..X19 Y11..Y12 name:北東区画 lease.category:rentable
56
56
  boundary /L2/gal /L2/mallSw type:open
57
57
  boundary /L2/gal /L2/mallSe type:open
58
58
  boundary /L2/gal /L2/mallNw type:open
@@ -111,37 +111,37 @@ boundary /L2/nE /L2/mallNe t:120 spec:店舗サッシ
111
111
  door SD1 at:0.3
112
112
 
113
113
  # ---- L3 — 西・北を退く ----
114
- space /L3/gal corridor X13..X14 Y4..Y11 + X12..X13 Y4..Y5 name:回廊東 use:common floor:石張り
115
- space /L3/galW corridor X11..X12 Y4..Y11 name:回廊西 use:common floor:石張り
114
+ space /L3/gal corridor X13..X14 Y4..Y11 + X12..X13 Y4..Y5 name:回廊東 lease.category:common floor:石張り
115
+ space /L3/galW corridor X11..X12 Y4..Y11 name:回廊西 lease.category:common floor:石張り
116
116
  boundary /L3/gal /L3/avoid t:60 spec:手すり air:1 h:1100
117
117
  boundary /L3/galW /L3/avoid t:60 spec:手すり air:1 h:1100
118
118
  boundary /L3/galW /L3/mallSw type:open
119
119
  boundary /L3/galW /L3/mallNw type:open
120
120
  boundary /L3/galW /L3/es2 type:open
121
121
  band X X3..X11 Y4..Y5
122
- space /L3/s01 shop w:25200 name:南区画01 use:rentable
123
- space /L3/s02 shop w:rest name:南区画02 use:rentable
124
- space /L3/s04 shop X14..X19 Y4..Y5 name:南区画03 use:rentable
125
- space /L3/mallSw corridor X3..X11 Y5..Y6 name:南モール西 use:common floor:石張り
126
- space /L3/mallSe corridor X14..X19 Y5..Y6 name:南モール東 use:common floor:石張り
127
- space /L3/w01 corridor X3..X4 Y6..Y7 name:西通路南 use:common
128
- space /L3/w02 shop X4..X8 Y6..Y7 name:西区画02 use:rentable
129
- space /L3/w03 shop X8..X11 Y6..Y7 name:西区画03 use:rentable
130
- space /L3/e01 shop X14..X17 Y6..Y7+5600 name:東区画01 use:rentable
131
- space /L3/e02 shop X17..X19 Y6..Y7+5600 + X17+2800..X19 Y7+5600..Y8+4200 name:東区画02 use:rentable
132
- space /L3/acorr corridor X3..X4 Y7..Y8+4200 name:A棟西通路 use:common
133
- space /L3/eside shop X10..X11 Y7..Y8+4200 name:東脇区画 use:rentable
134
- space /L3/e03 shop X14..X15+5600 Y7+5600..Y8+4200 name:東区画03 use:rentable
135
- space /L3/bcorr corridor X16..X17 Y7+5600..Y8+4200 name:B棟階段付室 use:common
136
- space /L3/w04 corridor X3..X4 Y8+4200..Y9 name:西通路北 use:common
137
- space /L3/w05 shop X4..X8 Y8+4200..Y9 name:西区画05 use:rentable
138
- space /L3/w06 shop X8..X11 Y8+4200..Y9 name:西区画06 use:rentable
139
- space /L3/mallNw corridor X3..X11 Y9..Y10 name:北モール西 use:common floor:石張り
122
+ space /L3/s01 shop w:25200 name:南区画01 lease.category:rentable
123
+ space /L3/s02 shop w:rest name:南区画02 lease.category:rentable
124
+ space /L3/s04 shop X14..X19 Y4..Y5 name:南区画03 lease.category:rentable
125
+ space /L3/mallSw corridor X3..X11 Y5..Y6 name:南モール西 lease.category:common floor:石張り
126
+ space /L3/mallSe corridor X14..X19 Y5..Y6 name:南モール東 lease.category:common floor:石張り
127
+ space /L3/w01 corridor X3..X4 Y6..Y7 name:西通路南 lease.category:common
128
+ space /L3/w02 shop X4..X8 Y6..Y7 name:西区画02 lease.category:rentable
129
+ space /L3/w03 shop X8..X11 Y6..Y7 name:西区画03 lease.category:rentable
130
+ space /L3/e01 shop X14..X17 Y6..Y7+5600 name:東区画01 lease.category:rentable
131
+ space /L3/e02 shop X17..X19 Y6..Y7+5600 + X17+2800..X19 Y7+5600..Y8+4200 name:東区画02 lease.category:rentable
132
+ space /L3/acorr corridor X3..X4 Y7..Y8+4200 name:A棟西通路 lease.category:common
133
+ space /L3/eside shop X10..X11 Y7..Y8+4200 name:東脇区画 lease.category:rentable
134
+ space /L3/e03 shop X14..X15+5600 Y7+5600..Y8+4200 name:東区画03 lease.category:rentable
135
+ space /L3/bcorr corridor X16..X17 Y7+5600..Y8+4200 name:B棟階段付室 lease.category:common
136
+ space /L3/w04 corridor X3..X4 Y8+4200..Y9 name:西通路北 lease.category:common
137
+ space /L3/w05 shop X4..X8 Y8+4200..Y9 name:西区画05 lease.category:rentable
138
+ space /L3/w06 shop X8..X11 Y8+4200..Y9 name:西区画06 lease.category:rentable
139
+ space /L3/mallNw corridor X3..X11 Y9..Y10 name:北モール西 lease.category:common floor:石張り
140
140
  band X X3..X11 Y10..Y11
141
- space /L3/n01 shop w:25200 name:北区画01 use:rentable
142
- space /L3/n02 shop w:rest name:北区画02 use:rentable
143
- space /L3/nE shop X14..X19 Y10..Y11 name:北東区画 use:rentable
144
- space /L3/mallNe corridor X14..X19 Y9..Y10 name:北モール東 use:common floor:石張り
141
+ space /L3/n01 shop w:25200 name:北区画01 lease.category:rentable
142
+ space /L3/n02 shop w:rest name:北区画02 lease.category:rentable
143
+ space /L3/nE shop X14..X19 Y10..Y11 name:北東区画 lease.category:rentable
144
+ space /L3/mallNe corridor X14..X19 Y9..Y10 name:北モール東 lease.category:common floor:石張り
145
145
  boundary /L3/gal /L3/mallSe type:open
146
146
  boundary /L3/gal /L3/mallNe type:open
147
147
  boundary /L3/n01 /L3/mallNw t:120 spec:店舗サッシ
@@ -185,24 +185,24 @@ boundary /L3/w06 /L3/mallNw t:120 spec:店舗サッシ
185
185
  door SD1
186
186
 
187
187
  # ---- L4 — さらに退く。飲食の階 ----
188
- space /L4/gal corridor X11..X12 Y5..Y10 + X13..X14 Y5..Y10 + X12..X13 Y5..Y6 name:回廊 use:common floor:石張り
188
+ space /L4/gal corridor X11..X12 Y5..Y10 + X13..X14 Y5..Y10 + X12..X13 Y5..Y6 name:回廊 lease.category:common floor:石張り
189
189
  boundary /L4/gal /L4/avoid t:60 spec:手すり air:1 h:1100
190
190
  boundary /L4/gal /L4/es2 type:open
191
- space /L4/mallSw corridor X3..X11 Y5..Y6 name:南モール西 use:common floor:石張り
192
- space /L4/mallSe corridor X14..X19 Y5..Y6 name:南モール東 use:common floor:石張り
193
- space /L4/w01 corridor X3..X4 Y6..Y7 name:西通路南 use:common
194
- space /L4/w02 shop X4..X8 Y6..Y7 name:西区画02 use:rentable
195
- space /L4/w03 shop X8..X11 Y6..Y7 name:西区画03 use:rentable
196
- space /L4/e01 shop X14..X17 Y6..Y7+5600 name:東区画01 use:rentable
197
- space /L4/e02 shop X17..X19 Y6..Y7+5600 + X17+2800..X19 Y7+5600..Y8+4200 name:東区画02 use:rentable
198
- space /L4/acorr corridor X3..X4 Y7..Y8+4200 name:A棟西通路 use:common
199
- space /L4/eside shop X10..X11 Y7..Y8+4200 name:東脇区画 use:rentable
200
- space /L4/e03 shop X14..X15+5600 Y7+5600..Y8+4200 name:東区画03 use:rentable
201
- space /L4/bcorr corridor X16..X17 Y7+5600..Y8+4200 name:B棟階段付室 use:common
202
- space /L4/w04 corridor X3..X8 Y8+4200..Y9 name:西通路北 use:common
203
- space /L4/w06 shop X8..X11 Y8+4200..Y9 name:西区画05 use:rentable
204
- space /L4/mallNw corridor X3..X11 Y9..Y10 name:北モール西 use:common floor:石張り
205
- space /L4/mallNe corridor X14..X19 Y9..Y10 name:北モール東 use:common floor:石張り
191
+ space /L4/mallSw corridor X3..X11 Y5..Y6 name:南モール西 lease.category:common floor:石張り
192
+ space /L4/mallSe corridor X14..X19 Y5..Y6 name:南モール東 lease.category:common floor:石張り
193
+ space /L4/w01 corridor X3..X4 Y6..Y7 name:西通路南 lease.category:common
194
+ space /L4/w02 shop X4..X8 Y6..Y7 name:西区画02 lease.category:rentable
195
+ space /L4/w03 shop X8..X11 Y6..Y7 name:西区画03 lease.category:rentable
196
+ space /L4/e01 shop X14..X17 Y6..Y7+5600 name:東区画01 lease.category:rentable
197
+ space /L4/e02 shop X17..X19 Y6..Y7+5600 + X17+2800..X19 Y7+5600..Y8+4200 name:東区画02 lease.category:rentable
198
+ space /L4/acorr corridor X3..X4 Y7..Y8+4200 name:A棟西通路 lease.category:common
199
+ space /L4/eside shop X10..X11 Y7..Y8+4200 name:東脇区画 lease.category:rentable
200
+ space /L4/e03 shop X14..X15+5600 Y7+5600..Y8+4200 name:東区画03 lease.category:rentable
201
+ space /L4/bcorr corridor X16..X17 Y7+5600..Y8+4200 name:B棟階段付室 lease.category:common
202
+ space /L4/w04 corridor X3..X8 Y8+4200..Y9 name:西通路北 lease.category:common
203
+ space /L4/w06 shop X8..X11 Y8+4200..Y9 name:西区画05 lease.category:rentable
204
+ space /L4/mallNw corridor X3..X11 Y9..Y10 name:北モール西 lease.category:common floor:石張り
205
+ space /L4/mallNe corridor X14..X19 Y9..Y10 name:北モール東 lease.category:common floor:石張り
206
206
  boundary /L4/gal /L4/mallSw type:open
207
207
  boundary /L4/gal /L4/mallSe type:open
208
208
  boundary /L4/gal /L4/mallNw type:open
@@ -236,10 +236,10 @@ boundary /L4/eside /L4/gal t:120 spec:店舗サッシ
236
236
 
237
237
  # ---- セットバックの屋根 = テラス緑化 ----
238
238
  # 退いた分の屋根がそのまま庭になる。縁はパラペット+手すり (air:1 — 半屋外に導出される)
239
- space /L3/tW terrace X2..X3 Y4..Y12 name:西テラス use:common floor:緑化
240
- space /L3/tN terrace X3..X19 Y11..Y12 name:北テラス use:common floor:緑化
241
- space /L4/tS terrace X3..X19 Y4..Y5 name:南テラス use:common floor:緑化
242
- space /L4/tN terrace X3..X19 Y10..Y11 name:北テラス use:common floor:緑化
239
+ space /L3/tW terrace X2..X3 Y4..Y12 name:西テラス lease.category:common floor:緑化
240
+ space /L3/tN terrace X3..X19 Y11..Y12 name:北テラス lease.category:common floor:緑化
241
+ space /L4/tS terrace X3..X19 Y4..Y5 name:南テラス lease.category:common floor:緑化
242
+ space /L4/tN terrace X3..X19 Y10..Y11 name:北テラス lease.category:common floor:緑化
243
243
  boundary /L3/w01 /L3/tW t:300 spec:カーテンウォール
244
244
  door AD2 name:西テラスへ
245
245
  boundary /L3/gal /L3/tN t:300 spec:カーテンウォール
@@ -6,16 +6,16 @@
6
6
  #
7
7
  # 屋上 (L19の高さ) は住民の庭園 — B棟の頭が緑になる。
8
8
 
9
- space /L13..L18/rcorr corridor X14..X19 Y7..Y7+2400 name:住戸廊下 use:common
9
+ space /L13..L18/rcorr corridor X14..X19 Y7..Y7+2400 name:住戸廊下 lease.category:common
10
10
  band X X14..X19 Y6..Y7
11
- space /L13..L18/rs01 unit w:8400 name:住戸S01 use:exclusive daylight:1
12
- space /L13..L18/rs02 unit w:8400 name:住戸S02 use:exclusive daylight:1
13
- space /L13..L18/rs03 unit w:8400 name:住戸S03 use:exclusive daylight:1
14
- space /L13..L18/rs04 unit w:8400 name:住戸S04 use:exclusive daylight:1
15
- space /L13..L18/rs05 unit w:rest name:住戸S05 use:exclusive daylight:1
11
+ space /L13..L18/rs01 unit w:8400 name:住戸S01 lease.category:exclusive daylight:1
12
+ space /L13..L18/rs02 unit w:8400 name:住戸S02 lease.category:exclusive daylight:1
13
+ space /L13..L18/rs03 unit w:8400 name:住戸S03 lease.category:exclusive daylight:1
14
+ space /L13..L18/rs04 unit w:8400 name:住戸S04 lease.category:exclusive daylight:1
15
+ space /L13..L18/rs05 unit w:rest name:住戸S05 lease.category:exclusive daylight:1
16
16
  # 西向きの奥行10.2mは1住戸の窓では 1/7 に届かない — 住戸にせず共用のビューラウンジにする
17
- space /L13..L18/rlounge room X14..X15+5600 Y7+2400..Y8+4200 name:ビューラウンジ use:common
18
- space /L13..L18/rn02 unit X18..X19 Y7+2400..Y8+4200 name:住戸N02 use:exclusive daylight:1
17
+ space /L13..L18/rlounge room X14..X15+5600 Y7+2400..Y8+4200 name:ビューラウンジ lease.category:common
18
+ space /L13..L18/rn02 unit X18..X19 Y7+2400..Y8+4200 name:住戸N02 lease.category:exclusive daylight:1
19
19
 
20
20
  boundary /L13..L18/rcorr /L13..L18/bhall2 type:open
21
21
  boundary /L13..L18/rcorr /L13..L18/bslob t:180 spec:LGS
@@ -61,8 +61,8 @@ boundary /L13..L18/rcorr /out edge:E t:250 spec:PC板
61
61
  # ---- B棟屋上 (L19の高さ) — 塔屋と庭園 ----
62
62
  # A棟と同じく、階段2本とEVオーバーラン・機械を塔屋 (btop) が覆い、残りが庭園になる。
63
63
  # 塔屋は屋内なので柱が立ち、露天の庭園には立たない (ADR-0030)
64
- space /L19/btop service X15+5600..X18 Y7+5600..Y9 name:B棟塔屋・EV機械室 use:common
65
- space /L19/broof terrace X14..X19 Y6..Y7+5600 + X14..X15+5600 Y7+5600..Y9 + X18..X19 Y7+5600..Y9 name:B棟屋上庭園 use:common floor:緑化
64
+ space /L19/btop service X15+5600..X18 Y7+5600..Y9 name:B棟塔屋・EV機械室 lease.category:common
65
+ space /L19/broof terrace X14..X19 Y6..Y7+5600 + X14..X15+5600 Y7+5600..Y9 + X18..X19 Y7+5600..Y9 name:B棟屋上庭園 lease.category:common floor:緑化
66
66
  boundary /L18/bst1 /L19/btop type:stair
67
67
  boundary /L18/bst2 /L19/btop type:stair
68
68
  boundary /L19/btop /L19/broof edge:W t:250 spec:PC板
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "format": "koyu-canonical/2.0",
3
- "muro": "1.2",
3
+ "muro": "1.3",
4
4
  "name": "二室",
5
5
  "unit": "mm",
6
6
  "grid": {
@@ -4,7 +4,7 @@
4
4
  # 書いてあるのは、扉を吊るために宣言した境界と、外皮の境界だけ。
5
5
  # 両室に daylight:1 を書いたので、窓が要る — `koyu light` が 1/7 を確かめる (ADR-0020)。
6
6
 
7
- muro 1.2
7
+ muro 1.3
8
8
  name 二室
9
9
  unit mm
10
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kensnzk/koyu",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "muro": {
5
5
  "reads": [
6
6
  "0.1",
@@ -10,9 +10,10 @@
10
10
  "0.5",
11
11
  "1.0",
12
12
  "1.1",
13
- "1.2"
13
+ "1.2",
14
+ "1.3"
14
15
  ],
15
- "newest": "1.2",
16
+ "newest": "1.3",
16
17
  "undeclared": "1.1"
17
18
  },
18
19
  "description": "空間を一次要素とするテキストネイティブ建築記述の探求 — writing architecture, not buildings",
package/src/cli.ts CHANGED
@@ -25,7 +25,7 @@ import { siteReport } from "./core/site.js";
25
25
  import {
26
26
  areaM2,
27
27
  displayName,
28
- effectiveUse,
28
+ effectiveAttr,
29
29
  heff,
30
30
  isSemiOutdoor,
31
31
  levelsSorted,
@@ -95,6 +95,24 @@ function opt(rest: string[], ...names: string[]): string | undefined {
95
95
  return undefined;
96
96
  }
97
97
 
98
+ /**
99
+ * A repeatable option, in written order.
100
+ *
101
+ * **A missing value is the caller's mistake, not an empty result.** `--by` with nothing after it
102
+ * used to be indistinguishable from no `--by` at all, which would report "grouped by nothing"
103
+ * while looking like it had grouped.
104
+ */
105
+ function optAll(rest: string[], name: string): string[] {
106
+ const found: string[] = [];
107
+ for (let i = 0; i < rest.length; i++) {
108
+ if (rest[i] !== name) continue;
109
+ const v = rest[i + 1];
110
+ if (v === undefined || v.startsWith("-")) die(`${name} takes an attribute key: ${name} lease.category`);
111
+ found.push(v);
112
+ }
113
+ return found;
114
+ }
115
+
98
116
  /**
99
117
  * 数を取る引数。**読めない値を黙って NaN のまま通さない。**
100
118
  * `-s abc` は `width="NaN"` のSVGを終了コード0で書き出していた — 生成に成功したと言いながら
@@ -410,7 +428,10 @@ function main(argv: string[]): number {
410
428
  const spaces = [...model.spaces.values()];
411
429
  let total = 0;
412
430
  const byType = new Map<string, number>();
413
- const byUse = new Map<string, number>();
431
+ // One grouping per --by, in the order they were written, and none at all without one.
432
+ // A default key would put back the single privileged grouping that `use` was (ADR-0061).
433
+ const byKey = optAll(rest, "--by");
434
+ const grouped = new Map<string, Map<string, number>>(byKey.map((k) => [k, new Map()]));
414
435
  let semiTotal = 0;
415
436
  let outdoorTotal = 0;
416
437
  for (const l of levels) {
@@ -442,8 +463,13 @@ function main(argv: string[]): number {
442
463
  // "(untyped)" は集計の見出しであって、その空間の型ではない (mcp の "(unspecified)" と同じ構え)
443
464
  const label = s.type ?? "(untyped)";
444
465
  byType.set(label, (byType.get(label) ?? 0) + a);
445
- const use = effectiveUse(model, s);
446
- if (use) byUse.set(use, (byUse.get(use) ?? 0) + a);
466
+ for (const [key, bucket] of grouped) {
467
+ const v = effectiveAttr(model, s, key);
468
+ // A space that carries no value gets a heading rather than being dropped, so the
469
+ // buckets add up to Total and a gap in the description is visible instead of silent.
470
+ const b = v === undefined ? "(unspecified)" : String(v);
471
+ bucket.set(b, (bucket.get(b) ?? 0) + a);
472
+ }
447
473
  console.log(` ${s.path}\t${displayName(s)}\t${label}\t${a.toFixed(2)} m2`);
448
474
  }
449
475
  console.log(` Subtotal ${sub.toFixed(2)} m2`);
@@ -466,11 +492,11 @@ function main(argv: string[]): number {
466
492
  }
467
493
  }
468
494
  for (const [t, a] of byType) console.log(` ${t}: ${a.toFixed(2)} m2`);
469
- if (byUse.size > 0) {
470
- const parts = [...byUse.entries()].map(
471
- ([u, a]) => `${u} ${a.toFixed(2)} m2 (${((a / total) * 100).toFixed(1)}%)`,
495
+ for (const [key, bucket] of grouped) {
496
+ const parts = [...bucket.entries()].map(
497
+ ([v, a]) => `${v} ${a.toFixed(2)} m2 (${((a / total) * 100).toFixed(1)}%)`,
472
498
  );
473
- console.log(`By use: ${parts.join(" / ")}`);
499
+ console.log(`By ${key}: ${parts.join(" / ")}`);
474
500
  }
475
501
  return 0;
476
502
  }
@@ -127,6 +127,7 @@ export const DIAGNOSTIC_CODES = {
127
127
  VER04: "error", // koyu 0.5以前のファイルに1.0の語 (over・drop・集合編集 — ADR-0035/0038)
128
128
  VER05: "error", // koyu 1.0以前のファイルの型の位置に exterior / void (ADR-0051)
129
129
  VER06: "error", // the file declares a language version newer than this build reads
130
+ VER07: "error", // the file declares a version in which a key it writes is retired (ADR-0061)
130
131
  SYN01: "error", // 構文・合成エラー (SourceError の写し — check --json のみ)
131
132
  } as const satisfies Record<string, "error" | "warning">;
132
133
 
@@ -602,7 +603,7 @@ function checkColumns(ctx: Ctx): void {
602
603
  }
603
604
  }
604
605
 
605
- /** 言語版の受理条件 — VER01〜VER05 */
606
+ /** 言語版の受理条件 — VER01〜VER05 と VER07 (VER06 は parse が投げる) */
606
607
  function checkLanguageVersion(ctx: Ctx): void {
607
608
  const { model, emit, loc, withRect, levels, levelIndex } = ctx;
608
609
  // 言語版の受理条件 (ADR-0017): 旧版は意味保存の場合のみ受理する。
@@ -722,6 +723,27 @@ function checkLanguageVersion(ctx: Ctx): void {
722
723
  });
723
724
  }
724
725
  }
726
+
727
+ // A retired key is VER03/VER04 read from the other end. Those fire when a file declares an old
728
+ // version and writes a word that version does not yet have; this one fires when a file declares
729
+ // a new version and writes a word that version no longer has. Both say the same thing — the
730
+ // declared version and the vocabulary have to agree (ADR-0061).
731
+ //
732
+ // **The comparison runs the other way round from the three guards above.** They ask "is this
733
+ // file older than X", so the file's version sits on the left. Here the question is "has the
734
+ // file moved past the version this key was retired after", so the ledger's version sits on the
735
+ // left and the file's on the right.
736
+ for (const [where, subj, at] of attrSubjects(model)) {
737
+ for (const key of Object.keys(subj.of)) {
738
+ const gone = attrSpec(subj.elem, key)?.retired;
739
+ if (!gone || !olderThan(gone.after, model.version)) continue;
740
+ emit(
741
+ "VER07",
742
+ `A muro ${model.version} file carries ${key}: on ${where} — ${key} is retired after muro ${gone.after}. Write ${gone.instead} instead, or keep the file at muro ${gone.after}`,
743
+ at,
744
+ );
745
+ }
746
+ }
725
747
  }
726
748
 
727
749
  /** 同一性 — UID01〜UID04 */
package/src/core/model.ts CHANGED
@@ -43,6 +43,10 @@ export const MURO_SUPPORT: readonly { muro: string; since: string; until: string
43
43
  { muro: "1.1", since: "0.17.0", until: null },
44
44
  // The version line stops answering to the implementation's name: `muro 1.2`, not `koyu 1.2`.
45
45
  { muro: "1.2", since: "0.20.0", until: null },
46
+ // 1.3 adds no notation. It retires `use`, whose job was never a use — it held one grouping per
47
+ // space, so tenancy, fire compartment and department all competed for it. VER07 stops it here;
48
+ // the ledger row stays so that every version up to 1.2 goes on reading it (ADR-0061).
49
+ { muro: "1.3", since: "0.21.0", until: null },
46
50
  ];
47
51
 
48
52
  /** The word a version line is written with from 1.2 on. */
@@ -69,7 +73,7 @@ export const LAST_KOYU_SPELLED_VERSION = "1.1";
69
73
  * `since` column is written in this vocabulary, and every surface that answers "which muro
70
74
  * does this build speak" needs both halves at once.
71
75
  */
72
- export const KOYU_VERSION = "0.20.0";
76
+ export const KOYU_VERSION = "0.21.0";
73
77
 
74
78
  /**
75
79
  * Whether `a` names a later language version than `b`.
@@ -846,17 +850,29 @@ export function isIndoor(model: Model, s: Space): boolean {
846
850
  return !isSemiOutdoor(model, s);
847
851
  }
848
852
 
849
- /** 実効use属性 — 自分に無ければ、最も深いゾーン祖先から継承する */
850
- export function effectiveUse(model: Model, s: Space): string | undefined {
851
- const own = s.attrs["use"];
852
- if (typeof own === "string") return own;
853
- let best: string | undefined;
853
+ /**
854
+ * The value a space carries for `key`: its own declaration, else the one on the deepest zone
855
+ * whose path is a prefix of the space's.
856
+ *
857
+ * **The caller names the key, and core forms no opinion about what it means.** That is what
858
+ * makes this legitimate for a carried namespaced key such as `lease.category`: asking is not
859
+ * reading. Core still gives the key no meaning, decides nothing by it, and would answer the
860
+ * same way for a key it has never seen.
861
+ *
862
+ * The resolution is the one `use` had before it was retired, with the literal `"use"` moved out
863
+ * to the caller. Non-string values resolve too — a space that writes `dept.name:2024` now
864
+ * answers with the number rather than falling through to its zone, which is what was written.
865
+ */
866
+ export function effectiveAttr(model: Model, s: Space, key: string): AttrValue | undefined {
867
+ const own = s.attrs[key];
868
+ if (own !== undefined) return own;
869
+ let best: AttrValue | undefined;
854
870
  let bestLen = -1;
855
871
  for (const z of model.zones.values()) {
856
872
  if (s.path.startsWith(z.path + "/") && z.path.length > bestLen) {
857
- const u = z.attrs["use"];
858
- if (typeof u === "string") {
859
- best = u;
873
+ const v = z.attrs[key];
874
+ if (v !== undefined) {
875
+ best = v;
860
876
  bestLen = z.path.length;
861
877
  }
862
878
  }
@@ -33,6 +33,19 @@ export interface AttrSpec {
33
33
  of?: Array<string | number>;
34
34
  /** 正の数値でなければ ATT01 */
35
35
  num?: true;
36
+ /**
37
+ * The key may be written up to and including muro `after`, and not after it.
38
+ *
39
+ * **A retired key stays in the ledger.** Taking the row out would make the key unknown at
40
+ * every version at once, because `checkAttrValues` reads `attrSpec` alone and never sees
41
+ * `model.version` — a file declaring an older version would start failing with ATT03 for a
42
+ * word that version legitimately has. The row is what keeps the old reading alive; VER07 is
43
+ * what stops the new one.
44
+ *
45
+ * `instead` names what to write from the next version, and is carried here so that no state
46
+ * exists where a key is retired with nothing offered in its place.
47
+ */
48
+ retired?: { after: string; instead: string };
36
49
  }
37
50
 
38
51
  /** 台帳を読みやすく書くための小道具 */
@@ -41,6 +54,10 @@ const one = (...of: Array<string | number>): AttrSpec => ({ tier: "interpreted",
41
54
  const free = (): AttrSpec => ({ tier: "interpreted" });
42
55
  const carry = (): AttrSpec => ({ tier: "carry" });
43
56
  const structure = (): AttrSpec => ({ tier: "structure" });
57
+ const retired = (after: string, instead: string, base: AttrSpec = free()): AttrSpec => ({
58
+ ...base,
59
+ retired: { after, instead },
60
+ });
44
61
 
45
62
  /**
46
63
  * 運搬層の名前空間の綴り — **ドット区切り** (`acme.sensor` `bems.temp` `survey.measured`)。
@@ -86,7 +103,14 @@ export const ATTR_LEDGER: Record<string, Record<string, AttrSpec>> = {
86
103
 
87
104
  // 解釈 — core が読む
88
105
  h: num(), // 天井高 mm。高さ不変量と矩計が読む
89
- use: free(), // 集計軸。zone から継承
106
+ // Retired after muro 1.2. It was never a use: ADR-0005 introduced it to answer the ratio of
107
+ // common to exclusive area, and it held one grouping per space, so tenancy, fire compartment
108
+ // and department all competed for it. A room's purpose is the type position; any other
109
+ // division of the building is a namespaced key, of which a space may carry as many as it likes.
110
+ use: retired(
111
+ "1.2",
112
+ "a namespaced key of your own (lease.category:, fire.compartment:, dept.name:)",
113
+ ),
90
114
  road: num(), // outside:1 の幅員 mm。接道の導出
91
115
  daylight: free(), // 採光の問いの対象 (ADR-0020)。値域は DAY01 が守るので台帳では重ねない
92
116
  ceiling: one(0, 1), // 0 = 天井を張らない (ADR-0024)
@@ -114,7 +138,11 @@ export const ATTR_LEDGER: Record<string, Record<string, AttrSpec>> = {
114
138
 
115
139
  zone: {
116
140
  name: free(),
117
- use: free(), // 配下へ継承される集計軸
141
+ // Retired after muro 1.2, for the reason given on the space row above.
142
+ use: retired(
143
+ "1.2",
144
+ "a namespaced key of your own (lease.category:, fire.compartment:, dept.name:)",
145
+ ),
118
146
  site: one(0, 1), // 敷地の集約 (ADR-0009)
119
147
  area: num(), // 敷地の宣言面積 ㎡ (測量値)
120
148
  uid: free(),
package/src/mcp.ts CHANGED
@@ -27,7 +27,7 @@ import {
27
27
  areaM2,
28
28
  isIndoor,
29
29
  displayName,
30
- effectiveUse,
30
+ effectiveAttr,
31
31
  isOutside,
32
32
  isSemiOutdoor,
33
33
  isVoid,
@@ -80,7 +80,7 @@ function assertInside(entryDir: string, targetDir: string): void {
80
80
  }
81
81
  }
82
82
 
83
- function summarize(model: Model, file: string): unknown {
83
+ function summarize(model: Model, file: string, by: readonly string[] = []): unknown {
84
84
  const rooms = [...model.spaces.values()].filter((s) => s.rects.length > 0 && s.level);
85
85
  const indoor = rooms.filter((s) => isIndoor(model, s));
86
86
  const semi = rooms.filter((s) => !isVoid(s) && isSemiOutdoor(model, s));
@@ -93,10 +93,17 @@ function summarize(model: Model, file: string): unknown {
93
93
  subtotalM2: Math.round(rs.reduce((a, s) => a + (areaM2(s) ?? 0), 0) * 100) / 100,
94
94
  };
95
95
  }
96
- const byUse: Record<string, number> = {};
97
- for (const s of indoor) {
98
- const u = effectiveUse(model, s) ?? "(unspecified)";
99
- byUse[u] = Math.round(((byUse[u] ?? 0) + (areaM2(s) ?? 0)) * 100) / 100;
96
+ // One grouping per key the caller asked for, and none at all when it asked for none.
97
+ // A default key would put back the single privileged grouping that `use` was.
98
+ const byM2: Record<string, Record<string, number>> = {};
99
+ for (const key of by) {
100
+ const bucket: Record<string, number> = {};
101
+ for (const s of indoor) {
102
+ const v = effectiveAttr(model, s, key);
103
+ const label = v === undefined ? "(unspecified)" : String(v);
104
+ bucket[label] = Math.round(((bucket[label] ?? 0) + (areaM2(s) ?? 0)) * 100) / 100;
105
+ }
106
+ byM2[key] = bucket;
100
107
  }
101
108
  const r = check(model);
102
109
  return {
@@ -145,7 +152,7 @@ function summarize(model: Model, file: string): unknown {
145
152
  totalFloorM2: Math.round(indoor.reduce((a, s) => a + (areaM2(s) ?? 0), 0) * 100) / 100,
146
153
  semiOutdoorM2: Math.round(semi.reduce((a, s) => a + (areaM2(s) ?? 0), 0) * 100) / 100,
147
154
  floorsM2: byLevel,
148
- byUseM2: byUse,
155
+ ...(by.length > 0 ? { byM2 } : {}),
149
156
  check: { errors: r.errors.length, warnings: r.warnings.length },
150
157
  hint: "Read layer contents with layers, check with check, and edit with write_layer (check is the gatekeeper). Architectural verdicts come from validate.",
151
158
  };
@@ -184,14 +191,35 @@ const str = (v: unknown, name: string): string => {
184
191
  return v;
185
192
  };
186
193
 
194
+ /** An optional array of attribute keys. Absent is not the same as empty, but both group nothing. */
195
+ const keys = (v: unknown, name: string): string[] => {
196
+ if (v === undefined) return [];
197
+ if (!Array.isArray(v) || v.some((k) => typeof k !== "string" || !k)) {
198
+ throw new Error(`${name} (an array of attribute keys) must hold non-empty strings`);
199
+ }
200
+ return v as string[];
201
+ };
202
+
187
203
  const TOOLS: Record<string, Tool> = {
188
204
  model_summary: {
189
205
  description:
190
- "Summary of the building: name, levels, layer composition, zones, door/window assets, areas, and check counts. Call this first",
191
- schema: { type: "object", properties: FILE_PROP, required: ["file"] },
206
+ "Summary of the building: name, levels, layer composition, zones, door/window assets, areas, and check counts. Call this first. Pass by:[\"lease.category\"] to also get floor area grouped by those attribute keys",
207
+ schema: {
208
+ type: "object",
209
+ properties: {
210
+ ...FILE_PROP,
211
+ by: {
212
+ type: "array",
213
+ items: { type: "string" },
214
+ description:
215
+ "Attribute keys to group indoor floor area by, e.g. [\"lease.category\"]. A space's own declaration wins, otherwise the deepest zone above it supplies the value; a space with no value falls into \"(unspecified)\". Omit for no grouping — there is no default key",
216
+ },
217
+ },
218
+ required: ["file"],
219
+ },
192
220
  run: (a) => {
193
221
  const file = str(a.file, "file");
194
- return summarize(load(file), file);
222
+ return summarize(load(file), file, keys(a.by, "by"));
195
223
  },
196
224
  },
197
225
  check: {
package/src/model.ts CHANGED
@@ -30,7 +30,7 @@ export {
30
30
  areaM2,
31
31
  DEFAULT_LANGUAGE_VERSION,
32
32
  displayName,
33
- effectiveUse,
33
+ effectiveAttr,
34
34
  heff,
35
35
  isCoveredAbove,
36
36
  isIndoor,