@kensnzk/koyu 0.19.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 (92) hide show
  1. package/README.ja.md +7 -5
  2. package/README.md +8 -6
  3. package/dist/analysis/contracts.d.ts +11 -1
  4. package/dist/analysis/contracts.d.ts.map +1 -1
  5. package/dist/analysis/contracts.js +11 -1
  6. package/dist/analysis/contracts.js.map +1 -1
  7. package/dist/cli.js +48 -9
  8. package/dist/cli.js.map +1 -1
  9. package/dist/core/diagnose.d.ts +2 -0
  10. package/dist/core/diagnose.d.ts.map +1 -1
  11. package/dist/core/diagnose.js +20 -1
  12. package/dist/core/diagnose.js.map +1 -1
  13. package/dist/core/diff.d.ts.map +1 -1
  14. package/dist/core/diff.js +4 -1
  15. package/dist/core/diff.js.map +1 -1
  16. package/dist/core/model.d.ts +171 -8
  17. package/dist/core/model.d.ts.map +1 -1
  18. package/dist/core/model.js +219 -15
  19. package/dist/core/model.js.map +1 -1
  20. package/dist/core/parse.d.ts.map +1 -1
  21. package/dist/core/parse.js +42 -11
  22. package/dist/core/parse.js.map +1 -1
  23. package/dist/core/vocabulary.d.ts +16 -0
  24. package/dist/core/vocabulary.d.ts.map +1 -1
  25. package/dist/core/vocabulary.js +11 -2
  26. package/dist/core/vocabulary.js.map +1 -1
  27. package/dist/form.d.ts +1 -0
  28. package/dist/form.d.ts.map +1 -1
  29. package/dist/form.js +5 -0
  30. package/dist/form.js.map +1 -1
  31. package/dist/index.d.ts +1 -1
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +4 -1
  34. package/dist/index.js.map +1 -1
  35. package/dist/mcp.js +49 -12
  36. package/dist/mcp.js.map +1 -1
  37. package/dist/model.d.ts +1 -1
  38. package/dist/model.d.ts.map +1 -1
  39. package/dist/model.js +1 -1
  40. package/dist/model.js.map +1 -1
  41. package/dist/validate/builtin/access.js +30 -6
  42. package/dist/validate/builtin/access.js.map +1 -1
  43. package/dist/validate/contracts.d.ts +6 -1
  44. package/dist/validate/contracts.d.ts.map +1 -1
  45. package/dist/validate/contracts.js +6 -1
  46. package/dist/validate/contracts.js.map +1 -1
  47. package/editors/vscode/package.json +1 -1
  48. package/editors/vscode/syntaxes/koyu.tmLanguage.json +55 -55
  49. package/examples/basement/main.muro +9 -9
  50. package/examples/complex/L1.muro +22 -22
  51. package/examples/complex/basement.muro +4 -4
  52. package/examples/complex/core.muro +9 -9
  53. package/examples/complex/hotel.muro +14 -14
  54. package/examples/complex/main.muro +1 -1
  55. package/examples/complex/office.muro +3 -3
  56. package/examples/complex/plant.muro +4 -4
  57. package/examples/complex/podium.muro +23 -23
  58. package/examples/house/main.muro +2 -2
  59. package/examples/house.muro +2 -2
  60. package/examples/mansion.muro +27 -27
  61. package/examples/office.muro +16 -16
  62. package/examples/steps/06-finished.muro +1 -1
  63. package/examples/tower/L1.muro +12 -12
  64. package/examples/tower/L11.muro +4 -4
  65. package/examples/tower/L2.muro +10 -10
  66. package/examples/tower/main.muro +1 -1
  67. package/examples/tower/typical.muro +10 -10
  68. package/examples/twin/L1.muro +29 -29
  69. package/examples/twin/L5.muro +14 -14
  70. package/examples/twin/basement.muro +9 -9
  71. package/examples/twin/core.muro +49 -49
  72. package/examples/twin/hotel.muro +15 -15
  73. package/examples/twin/main.muro +1 -1
  74. package/examples/twin/office.muro +10 -10
  75. package/examples/twin/podium.muro +73 -73
  76. package/examples/twin/residence.muro +10 -10
  77. package/examples/two-rooms.canonical.json +2 -2
  78. package/examples/two-rooms.muro +1 -1
  79. package/package.json +17 -2
  80. package/src/analysis/contracts.ts +11 -1
  81. package/src/cli.ts +50 -10
  82. package/src/core/diagnose.ts +24 -1
  83. package/src/core/diff.ts +4 -1
  84. package/src/core/model.ts +231 -15
  85. package/src/core/parse.ts +57 -9
  86. package/src/core/vocabulary.ts +30 -2
  87. package/src/form.ts +13 -0
  88. package/src/index.ts +5 -0
  89. package/src/mcp.ts +56 -12
  90. package/src/model.ts +7 -1
  91. package/src/validate/builtin/access.ts +32 -6
  92. package/src/validate/contracts.ts +6 -1
@@ -29,7 +29,7 @@
29
29
  # koyu plan examples/twin/main.muro -l L8 A棟基準階とB棟ホテル階
30
30
  # koyu axo examples/twin/main.muro -l L1,L2,L3,L4,L5
31
31
 
32
- koyu 1.1
32
+ muro 1.3
33
33
  name 双塔複合建築 — 商業・事務所・ホテル・レジデンス
34
34
  unit mm
35
35
 
@@ -5,14 +5,14 @@
5
5
  #
6
6
  # **南西の隅は斜めに落とす。**基壇の隅切りと同じ向きの線が、塔にも一本だけ通る。
7
7
 
8
- space /L6..L20/aoff1 room X3..X11 Y6..Y7 name:貸室南 use:rentable
9
- space /L6..L20/aoff2 room X3..X11 Y8+4200..Y10 name:貸室北 use:rentable
10
- space /L6..L20/aoffW room X3..X4 Y7..Y8+4200 name:貸室西 use:rentable
11
- space /L6..L20/aoffE room X10..X11 Y7..Y8+4200 name:貸室東 use:rentable
12
- space /L21..L34/aoff1 room X3..X11 Y6..Y7 name:貸室南 use:rentable
13
- space /L21..L34/aoff2 room X3..X11 Y8+4200..Y10 name:貸室北 use:rentable
14
- space /L21..L34/aoffW room X3..X4 Y7..Y8+4200 name:貸室西 use:rentable
15
- space /L21..L34/aoffE room X10..X11 Y7..Y8+4200 name:貸室東 use:rentable
8
+ space /L6..L20/aoff1 room X3..X11 Y6..Y7 name:貸室南 lease.category:rentable
9
+ space /L6..L20/aoff2 room X3..X11 Y8+4200..Y10 name:貸室北 lease.category:rentable
10
+ space /L6..L20/aoffW room X3..X4 Y7..Y8+4200 name:貸室西 lease.category:rentable
11
+ space /L6..L20/aoffE room X10..X11 Y7..Y8+4200 name:貸室東 lease.category:rentable
12
+ space /L21..L34/aoff1 room X3..X11 Y6..Y7 name:貸室南 lease.category:rentable
13
+ space /L21..L34/aoff2 room X3..X11 Y8+4200..Y10 name:貸室北 lease.category:rentable
14
+ space /L21..L34/aoffW room X3..X4 Y7..Y8+4200 name:貸室西 lease.category:rentable
15
+ space /L21..L34/aoffE room X10..X11 Y7..Y8+4200 name:貸室東 lease.category:rentable
16
16
 
17
17
  boundary /L6..L20/aoffW /L6..L20/ahall t:120 spec:スチールパーティション
18
18
  door FD2 name:貸室入口西
@@ -82,7 +82,7 @@ boundary /L6..L20/aoff1 /out edge:W t:250 spec:カーテンウォール
82
82
  boundary /L21..L34/aoff1 /out edge:W t:250 spec:カーテンウォール
83
83
 
84
84
  # ---- M2 中間機械階 — 客の階数に現れない ----
85
- space /M2/amach service X3..X11 Y6..Y7 + X3..X4 Y7..Y8+4200 + X10..X11 Y7..Y8+4200 + X3..X11 Y8+4200..Y10 name:中間機械室 use:common
85
+ space /M2/amach service X3..X11 Y6..Y7 + X3..X4 Y7..Y8+4200 + X10..X11 Y7..Y8+4200 + X3..X11 Y8+4200..Y10 name:中間機械室 lease.category:common
86
86
  boundary /M2/amach /M2/ahall type:open
87
87
  # 隅切りは塔屋まで通す — 斜めの面が途中で消えると別の塔に見える
88
88
  boundary /M2/amach /out t:250 spec:ルーバー
@@ -93,7 +93,7 @@ boundary /M2/amach /out edge:W t:250 spec:ルーバー
93
93
  boundary /M2/amach /out edge:E t:250 spec:ルーバー
94
94
 
95
95
  # ---- R1 塔屋 ----
96
- space /R1/ptop service X3..X11 Y6..Y7 + X3..X4 Y7..Y8+4200 + X10..X11 Y7..Y8+4200 + X3..X11 Y8+4200..Y10 name:塔屋・冷却塔 use:common
96
+ space /R1/ptop service X3..X11 Y6..Y7 + X3..X4 Y7..Y8+4200 + X10..X11 Y7..Y8+4200 + X3..X11 Y8+4200..Y10 name:塔屋・冷却塔 lease.category:common
97
97
  boundary /R1/ptop /R1/ahall type:open
98
98
  boundary /R1/ptop /out t:250 spec:ルーバー
99
99
  line X3+4200,Y6 X3,Y6+4200
@@ -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
- "format": "koyu-canonical/1.2",
3
- "koyu": "1.1",
2
+ "format": "koyu-canonical/2.0",
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
- koyu 1.1
7
+ muro 1.3
8
8
  name 二室
9
9
  unit mm
10
10
 
package/package.json CHANGED
@@ -1,6 +1,21 @@
1
1
  {
2
2
  "name": "@kensnzk/koyu",
3
- "version": "0.19.0",
3
+ "version": "0.21.0",
4
+ "muro": {
5
+ "reads": [
6
+ "0.1",
7
+ "0.2",
8
+ "0.3",
9
+ "0.4",
10
+ "0.5",
11
+ "1.0",
12
+ "1.1",
13
+ "1.2",
14
+ "1.3"
15
+ ],
16
+ "newest": "1.3",
17
+ "undeclared": "1.1"
18
+ },
4
19
  "description": "空間を一次要素とするテキストネイティブ建築記述の探求 — writing architecture, not buildings",
5
20
  "type": "module",
6
21
  "main": "./dist/index.js",
@@ -82,7 +97,7 @@
82
97
  "gate:examples": "node --import tsx scripts/gate.mjs",
83
98
  "plan:examples": "tsx src/cli.ts plan examples/two-rooms.muro -o out/two-rooms.svg",
84
99
  "conformance": "node --import tsx --test test/conformance.test.ts",
85
- "gate:docs": "npm --prefix website run gate:canonical && npm --prefix website run check:navigation"
100
+ "gate:docs": "npm --prefix website run prepare:content && npm --prefix website run gate:canonical && npm --prefix website run check:navigation"
86
101
  },
87
102
  "devDependencies": {
88
103
  "@types/node": "^22.0.0",
@@ -218,7 +218,17 @@ export interface AnalysisResult<T extends JsonValue = JsonValue> {
218
218
  readonly artifact: AnalysisArtifact<T>;
219
219
  }
220
220
 
221
- export const ANALYSIS_FORMAT = "koyu-analysis/1" as const;
221
+ /**
222
+ * The name of the shape an analysis returns. **It carries no version, deliberately.**
223
+ *
224
+ * A version promises that something is worth checking against — and nothing checks this. It
225
+ * is written by `assess` and read by no one; the face it sits on is the one the project
226
+ * declares unfrozen, so a `/1` on it would announce a stability nobody intends to keep.
227
+ *
228
+ * The counter-example is `koyu-context/1`, the input this protocol takes: that one is checked
229
+ * on arrival and refused on mismatch, which is what makes its version worth carrying.
230
+ */
231
+ export const ANALYSIS_FORMAT = "koyu-analysis" as const;
222
232
 
223
233
  export interface AnalysisReport<T extends JsonValue = JsonValue> {
224
234
  readonly schema: typeof ANALYSIS_FORMAT;
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,
@@ -35,7 +35,8 @@ import {
35
35
  type Model,
36
36
  srcRef,
37
37
  isOutside,
38
- isVoid
38
+ isVoid,
39
+ versionLine
39
40
  } from "./core/model.js";
40
41
  import { parseFile } from "./parse-file.js";
41
42
  import { svgPlan } from "./draw/plan.js";
@@ -94,6 +95,24 @@ function opt(rest: string[], ...names: string[]): string | undefined {
94
95
  return undefined;
95
96
  }
96
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
+
97
116
  /**
98
117
  * 数を取る引数。**読めない値を黙って NaN のまま通さない。**
99
118
  * `-s abc` は `width="NaN"` のSVGを終了コード0で書き出していた — 生成に成功したと言いながら
@@ -190,6 +209,18 @@ function firstModelLine(evidence: AssessmentReport["findings"][number]["outcome"
190
209
 
191
210
  function main(argv: string[]): number {
192
211
  const [cmd, file, ...rest] = argv;
212
+ // Asked before the usage text, because it takes no file and a tool that cannot state its
213
+ // own version sends the reader to package.json to find out what they are running.
214
+ if (cmd === "--version" || cmd === "-v") {
215
+ // It takes no file, so being handed one is a calling mistake like any other. Printing the
216
+ // version and exiting 0 would let a wrapper that passes the wrong flag look like it worked.
217
+ if (file !== undefined) {
218
+ console.error(`--version takes no arguments: ${[file, ...rest].join(" ")}`);
219
+ return 2;
220
+ }
221
+ console.log(versionLine());
222
+ return 0;
223
+ }
193
224
  if (!cmd || !file) {
194
225
  console.log(
195
226
  "Usage: koyu <check|validate|layers|diff|plan|axo|doors|graph|stats|levels|runs|light|site|json> <file.muro> [args...]\n" +
@@ -240,7 +271,8 @@ function main(argv: string[]): number {
240
271
  // check --json は構文・合成エラー (SourceError) でも有効JSONを返す — SYN01 の1件に写す (ADR-0016)
241
272
  if (cmd === "check" && rest.includes("--json") && e instanceof SourceError) {
242
273
  const d: Diagnostic = {
243
- code: "SYN01",
274
+ // A parse failure that named its own condition keeps that code; the rest are syntax.
275
+ code: e.code ?? "SYN01",
244
276
  severity: "error",
245
277
  message: e.raw,
246
278
  ...(e.line ? { line: e.line } : {}),
@@ -396,7 +428,10 @@ function main(argv: string[]): number {
396
428
  const spaces = [...model.spaces.values()];
397
429
  let total = 0;
398
430
  const byType = new Map<string, number>();
399
- 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()]));
400
435
  let semiTotal = 0;
401
436
  let outdoorTotal = 0;
402
437
  for (const l of levels) {
@@ -428,8 +463,13 @@ function main(argv: string[]): number {
428
463
  // "(untyped)" は集計の見出しであって、その空間の型ではない (mcp の "(unspecified)" と同じ構え)
429
464
  const label = s.type ?? "(untyped)";
430
465
  byType.set(label, (byType.get(label) ?? 0) + a);
431
- const use = effectiveUse(model, s);
432
- 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
+ }
433
473
  console.log(` ${s.path}\t${displayName(s)}\t${label}\t${a.toFixed(2)} m2`);
434
474
  }
435
475
  console.log(` Subtotal ${sub.toFixed(2)} m2`);
@@ -452,11 +492,11 @@ function main(argv: string[]): number {
452
492
  }
453
493
  }
454
494
  for (const [t, a] of byType) console.log(` ${t}: ${a.toFixed(2)} m2`);
455
- if (byUse.size > 0) {
456
- const parts = [...byUse.entries()].map(
457
- ([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)}%)`,
458
498
  );
459
- console.log(`By use: ${parts.join(" / ")}`);
499
+ console.log(`By ${key}: ${parts.join(" / ")}`);
460
500
  }
461
501
  return 0;
462
502
  }
@@ -126,6 +126,8 @@ export const DIAGNOSTIC_CODES = {
126
126
  VER03: "error", // koyu 0.4以前のファイルに0.5の語 (縦動線・線・柱・地下)
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
+ 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)
129
131
  SYN01: "error", // 構文・合成エラー (SourceError の写し — check --json のみ)
130
132
  } as const satisfies Record<string, "error" | "warning">;
131
133
 
@@ -601,7 +603,7 @@ function checkColumns(ctx: Ctx): void {
601
603
  }
602
604
  }
603
605
 
604
- /** 言語版の受理条件 — VER01〜VER05 */
606
+ /** 言語版の受理条件 — VER01〜VER05 と VER07 (VER06 は parse が投げる) */
605
607
  function checkLanguageVersion(ctx: Ctx): void {
606
608
  const { model, emit, loc, withRect, levels, levelIndex } = ctx;
607
609
  // 言語版の受理条件 (ADR-0017): 旧版は意味保存の場合のみ受理する。
@@ -721,6 +723,27 @@ function checkLanguageVersion(ctx: Ctx): void {
721
723
  });
722
724
  }
723
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
+ }
724
747
  }
725
748
 
726
749
  /** 同一性 — UID01〜UID04 */
package/src/core/diff.ts CHANGED
@@ -686,7 +686,10 @@ export function renderDiff(d: ModelDiff): string[] {
686
686
  else if (g.kind === "added") out.push(`+ grid ${g.axis} ${g.name} ${g.to}`);
687
687
  else out.push(`− grid ${g.axis} ${g.name} ${g.from}`);
688
688
  }
689
- if (d.version) out.push(`± koyu ${d.version.from} → ${d.version.to}`);
689
+ // **The label names the language, not the implementation.** It also may not be the written
690
+ // declaration: from 1.2 the word is `muro`, so printing `koyu 1.2` would show a line the
691
+ // parser refuses. This is a label for a change, not a copy of either file's first line.
692
+ if (d.version) out.push(`± muro ${d.version.from} → ${d.version.to}`);
690
693
  if (d.name) out.push(`± name ${d.name.from ?? "—"} → ${d.name.to ?? "—"}`);
691
694
  for (const n of d.levels.added) out.push(`+ level ${n}`);
692
695
  for (const n of d.levels.removed) out.push(`− level ${n}`);