@kensnzk/koyu 0.14.0 → 0.16.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 -2
- package/README.md +5 -3
- package/dist/cli.js +156 -81
- package/dist/cli.js.map +1 -1
- package/dist/core/derive.d.ts +259 -0
- package/dist/core/derive.d.ts.map +1 -0
- package/dist/core/derive.js +570 -0
- package/dist/core/derive.js.map +1 -0
- package/dist/{check.d.ts → core/diagnose.d.ts} +11 -12
- package/dist/core/diagnose.d.ts.map +1 -0
- package/dist/{check.js → core/diagnose.js} +232 -221
- package/dist/core/diagnose.js.map +1 -0
- package/dist/core/diff.d.ts.map +1 -0
- package/dist/{diff.js → core/diff.js} +84 -41
- package/dist/core/diff.js.map +1 -0
- package/dist/{fabric.d.ts → core/fabric.d.ts} +4 -0
- package/dist/core/fabric.d.ts.map +1 -0
- package/dist/{fabric.js → core/fabric.js} +4 -3
- package/dist/core/fabric.js.map +1 -0
- package/dist/{graph.d.ts → core/graph.d.ts} +1 -3
- package/dist/core/graph.d.ts.map +1 -0
- package/dist/{graph.js → core/graph.js} +43 -51
- package/dist/core/graph.js.map +1 -0
- package/dist/core/light.d.ts +24 -0
- package/dist/core/light.d.ts.map +1 -0
- package/dist/{light.js → core/light.js} +15 -10
- package/dist/core/light.js.map +1 -0
- package/dist/{model.d.ts → core/model.d.ts} +124 -13
- package/dist/core/model.d.ts.map +1 -0
- package/dist/{model.js → core/model.js} +193 -50
- package/dist/core/model.js.map +1 -0
- package/dist/core/parse.d.ts.map +1 -0
- package/dist/{parse.js → core/parse.js} +528 -116
- package/dist/core/parse.js.map +1 -0
- package/dist/{poly.d.ts → core/poly.d.ts} +3 -2
- package/dist/core/poly.d.ts.map +1 -0
- package/dist/{poly.js → core/poly.js} +8 -9
- package/dist/core/poly.js.map +1 -0
- package/dist/core/site.d.ts.map +1 -0
- package/dist/core/site.js.map +1 -0
- package/dist/core/tolerance.d.ts +26 -0
- package/dist/core/tolerance.d.ts.map +1 -0
- package/dist/core/tolerance.js +48 -0
- package/dist/core/tolerance.js.map +1 -0
- package/dist/{vertical.d.ts → core/vertical.d.ts} +41 -12
- package/dist/core/vertical.d.ts.map +1 -0
- package/dist/{vertical.js → core/vertical.js} +45 -104
- package/dist/core/vertical.js.map +1 -0
- package/dist/core/vocabulary.d.ts +40 -0
- package/dist/core/vocabulary.d.ts.map +1 -0
- package/dist/core/vocabulary.js +164 -0
- package/dist/core/vocabulary.js.map +1 -0
- package/dist/{axo.d.ts → draw/axo.d.ts} +1 -1
- package/dist/draw/axo.d.ts.map +1 -0
- package/dist/{axo.js → draw/axo.js} +53 -81
- package/dist/draw/axo.js.map +1 -0
- package/dist/draw/index.d.ts +3 -0
- package/dist/draw/index.d.ts.map +1 -0
- package/dist/draw/index.js +11 -0
- package/dist/draw/index.js.map +1 -0
- package/dist/draw/plan.d.ts +10 -0
- package/dist/draw/plan.d.ts.map +1 -0
- package/dist/draw/plan.js +284 -0
- package/dist/draw/plan.js.map +1 -0
- package/dist/index.d.ts +15 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +49 -12
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +71 -40
- package/dist/mcp.js.map +1 -1
- package/dist/parse-file.d.ts +1 -1
- package/dist/parse-file.d.ts.map +1 -1
- package/dist/parse-file.js +1 -1
- package/dist/parse-file.js.map +1 -1
- package/dist/validate/access.d.ts +6 -0
- package/dist/validate/access.d.ts.map +1 -0
- package/dist/validate/access.js +238 -0
- package/dist/validate/access.js.map +1 -0
- package/dist/validate/envelope.d.ts +4 -0
- package/dist/validate/envelope.d.ts.map +1 -0
- package/dist/validate/envelope.js +55 -0
- package/dist/validate/envelope.js.map +1 -0
- package/dist/validate/index.d.ts +60 -0
- package/dist/validate/index.d.ts.map +1 -0
- package/dist/validate/index.js +77 -0
- package/dist/validate/index.js.map +1 -0
- package/dist/validate/light.d.ts +6 -0
- package/dist/validate/light.d.ts.map +1 -0
- package/dist/validate/light.js +28 -0
- package/dist/validate/light.js.map +1 -0
- package/dist/validate/runs.d.ts +16 -0
- package/dist/validate/runs.d.ts.map +1 -0
- package/dist/validate/runs.js +60 -0
- package/dist/validate/runs.js.map +1 -0
- package/dist/validate/site.d.ts +6 -0
- package/dist/validate/site.d.ts.map +1 -0
- package/dist/validate/site.js +63 -0
- package/dist/validate/site.js.map +1 -0
- package/editors/vscode/.vscodeignore +2 -0
- package/editors/vscode/README.md +28 -0
- package/editors/vscode/extension.js +150 -0
- package/editors/vscode/language-configuration.json +19 -0
- package/editors/vscode/package.json +57 -0
- package/editors/vscode/syntaxes/koyu.tmLanguage.json +226 -0
- package/examples/basement/main.muro +1 -1
- package/examples/complex/main.muro +1 -1
- package/examples/house/main.muro +2 -2
- package/examples/house.muro +2 -2
- package/examples/mansion.muro +2 -2
- package/examples/office.muro +2 -2
- package/examples/steps/01-one-room.muro +1 -1
- package/examples/steps/02-two-rooms.muro +1 -1
- package/examples/steps/03-door.muro +1 -1
- package/examples/steps/04-exterior.muro +1 -1
- package/examples/steps/05-two-storeys.muro +1 -1
- package/examples/steps/06-finished.muro +2 -2
- package/examples/tower/main.muro +1 -1
- package/examples/twin/L1.muro +136 -119
- package/examples/twin/L5.muro +85 -123
- package/examples/twin/assets.muro +10 -8
- package/examples/twin/basement.muro +43 -34
- package/examples/twin/core.muro +148 -65
- package/examples/twin/hotel.muro +66 -107
- package/examples/twin/main.muro +73 -67
- package/examples/twin/office.muro +87 -88
- package/examples/twin/podium.muro +309 -97
- package/examples/twin/residence.muro +61 -116
- package/examples/twin/site.muro +16 -13
- package/examples/two-rooms.canonical.json +4 -2
- package/examples/two-rooms.muro +2 -2
- package/package.json +16 -1
- package/spec/README.md +28 -0
- package/spec/canonical-json.md +98 -0
- package/spec/composition.md +121 -0
- package/spec/derivation.md +393 -0
- package/spec/en/README.md +30 -0
- package/spec/en/canonical-json.md +101 -0
- package/spec/en/composition.md +121 -0
- package/spec/en/derivation.md +393 -0
- package/spec/en/language.md +164 -0
- package/spec/en/notation-v0.md +145 -0
- package/spec/en/scope.md +229 -0
- package/spec/en/semantics.md +132 -0
- package/spec/en/tools.md +108 -0
- package/spec/en/validation.md +79 -0
- package/spec/en/vocabulary.md +103 -0
- package/spec/language.md +163 -0
- package/spec/notation-v0.md +184 -0
- package/spec/scope.md +229 -0
- package/spec/semantics.md +130 -0
- package/spec/tools.md +106 -0
- package/spec/validation.md +79 -0
- package/spec/vocabulary.md +114 -0
- package/src/cli.ts +165 -80
- package/src/core/derive.ts +852 -0
- package/src/{check.ts → core/diagnose.ts} +260 -229
- package/src/{diff.ts → core/diff.ts} +84 -40
- package/src/{fabric.ts → core/fabric.ts} +4 -3
- package/src/{graph.ts → core/graph.ts} +47 -60
- package/src/core/light.ts +69 -0
- package/src/{model.ts → core/model.ts} +236 -52
- package/src/{parse.ts → core/parse.ts} +584 -116
- package/src/{poly.ts → core/poly.ts} +8 -9
- package/src/core/tolerance.ts +55 -0
- package/src/{vertical.ts → core/vertical.ts} +65 -115
- package/src/core/vocabulary.ts +197 -0
- package/src/{axo.ts → draw/axo.ts} +51 -94
- package/src/draw/index.ts +11 -0
- package/src/draw/plan.ts +344 -0
- package/src/index.ts +181 -35
- package/src/mcp.ts +76 -40
- package/src/parse-file.ts +2 -2
- package/src/validate/access.ts +279 -0
- package/src/validate/envelope.ts +59 -0
- package/src/validate/index.ts +107 -0
- package/src/validate/light.ts +43 -0
- package/src/validate/runs.ts +87 -0
- package/src/validate/site.ts +84 -0
- package/dist/axo.d.ts.map +0 -1
- package/dist/axo.js.map +0 -1
- package/dist/check.d.ts.map +0 -1
- package/dist/check.js.map +0 -1
- package/dist/diff.d.ts.map +0 -1
- package/dist/diff.js.map +0 -1
- package/dist/fabric.d.ts.map +0 -1
- package/dist/fabric.js.map +0 -1
- package/dist/graph.d.ts.map +0 -1
- package/dist/graph.js.map +0 -1
- package/dist/light.d.ts +0 -15
- package/dist/light.d.ts.map +0 -1
- package/dist/light.js.map +0 -1
- package/dist/model.d.ts.map +0 -1
- package/dist/model.js.map +0 -1
- package/dist/parse.d.ts.map +0 -1
- package/dist/parse.js.map +0 -1
- package/dist/plan.d.ts +0 -10
- package/dist/plan.d.ts.map +0 -1
- package/dist/plan.js +0 -354
- package/dist/plan.js.map +0 -1
- package/dist/poly.d.ts.map +0 -1
- package/dist/poly.js.map +0 -1
- package/dist/site.d.ts.map +0 -1
- package/dist/site.js.map +0 -1
- package/dist/vertical.d.ts.map +0 -1
- package/dist/vertical.js.map +0 -1
- package/src/light.ts +0 -63
- package/src/plan.ts +0 -472
- /package/dist/{diff.d.ts → core/diff.d.ts} +0 -0
- /package/dist/{parse.d.ts → core/parse.d.ts} +0 -0
- /package/dist/{site.d.ts → core/site.d.ts} +0 -0
- /package/dist/{site.js → core/site.js} +0 -0
- /package/src/{site.ts → core/site.ts} +0 -0
package/README.ja.md
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
```muro
|
|
21
21
|
grid X 0 3600
|
|
22
22
|
grid Y 0 4000
|
|
23
|
-
level L1 0
|
|
23
|
+
level L1 0 h:2400 slab:150
|
|
24
24
|
space /L1/a room X1..X2 Y1..Y2
|
|
25
25
|
```
|
|
26
26
|
|
|
@@ -33,7 +33,7 @@ space /L1/a room X1..X2 Y1..Y2
|
|
|
33
33
|
```muro
|
|
34
34
|
grid X 0 3600 5400
|
|
35
35
|
grid Y 0 4000
|
|
36
|
-
level L1 0
|
|
36
|
+
level L1 0 h:2400 slab:150
|
|
37
37
|
space /L1/a room X1..X2 Y1..Y2
|
|
38
38
|
space /L1/b room X2..X3 Y1..Y2
|
|
39
39
|
```
|
|
@@ -82,6 +82,8 @@ npm run koyu -- site examples/tower/main.muro # ショーケース: polyg
|
|
|
82
82
|
|
|
83
83
|
`koyu-mcp` は依存ゼロのMCPサーバー (stdio、ADR-0012)。LLMエージェントが建物を読み (`layers`)、編集し (`write_layer`)、`check` がビルドの門番になる — エラーは出所レイヤー:行つき。`doors` / `light` / `site` は同じ記述への異なる問い。延床4,786㎡のショーケース一棟が原本8,099トークン (実測 — IFC4は14倍、IFCXは25倍: [examples/comparison/](examples/comparison/README.md)) なので、一棟がコンテキストに余裕で載る。エージェントが正しく*編集*できるかは次の分水嶺 — 編集evalは計画段階でまだ実施していない ([docs/horizon.md](docs/horizon.md))。三軸の構想 (デジタルツイン・W3C BOTへのオントロジー整列・都市接続) も同文書。
|
|
84
84
|
|
|
85
|
+
登録は一行 (`claude mcp add koyu -- npx -p @kensnzk/koyu koyu-mcp`)。Claude Code・Claude Desktop・その他クライアントでの設定と標準ループは [guide/howto/agent-mcp.md](guide/howto/agent-mcp.md)。
|
|
86
|
+
|
|
85
87
|
## 構成
|
|
86
88
|
|
|
87
89
|
現在の仕様は [spec/](spec/README.md) に体系化した — 言語リファレンス ([language.md](spec/language.md))・意味論 ([semantics.md](spec/semantics.md))・語彙の台帳 ([vocabulary.md](spec/vocabulary.md))・正準JSON・ツールリファレンス (CLI/MCP/API)。ADRは「なぜ」を、specは「いま何が真か」を持つ。記法の成立記録 (DSL/YAML/JSON書き比べ) は [spec/notation-v0.md](spec/notation-v0.md)、IFC4とのカバレッジ照合は [docs/ifc-coverage.md](docs/ifc-coverage.md)、設計判断の記録は [docs/decisions/](docs/decisions/)、行程は [docs/roadmap.md](docs/roadmap.md) (Linear: [koyu](https://linear.app/munipersonal/project/koyu-2789f588a03a/overview) と対応)、日々の記録は [docs/log/](docs/log/)。実装は src/ に約7,500行 (パーサ・グラフ・チェック・平面図生成・CLI・MCPサーバー)、テストは test/。IFCXの読解メモは [docs/ifcx-notes.md](docs/ifcx-notes.md)、同じ二室をIFC4・IFCXで書いた三方比較は [examples/comparison/](examples/comparison/README.md)。
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ One room is written like this. Four lines, and it is a complete file.
|
|
|
21
21
|
```muro
|
|
22
22
|
grid X 0 3600
|
|
23
23
|
grid Y 0 4000
|
|
24
|
-
level L1 0
|
|
24
|
+
level L1 0 h:2400 slab:150
|
|
25
25
|
space /L1/a room X1..X2 Y1..Y2
|
|
26
26
|
```
|
|
27
27
|
|
|
@@ -34,7 +34,7 @@ Add one more `space` line. Change nothing else.
|
|
|
34
34
|
```muro
|
|
35
35
|
grid X 0 3600 5400
|
|
36
36
|
grid Y 0 4000
|
|
37
|
-
level L1 0
|
|
37
|
+
level L1 0 h:2400 slab:150
|
|
38
38
|
space /L1/a room X1..X2 Y1..Y2
|
|
39
39
|
space /L1/b room X2..X3 Y1..Y2
|
|
40
40
|
```
|
|
@@ -59,7 +59,7 @@ A building can also be written as a set of files and composed — additive layer
|
|
|
59
59
|
|
|
60
60
|
1. **Install.** Clone this repository and run `npm install`.
|
|
61
61
|
2. **Write the four lines above** into `first.muro`, then run `npx tsx src/cli.ts check first.muro` and `npx tsx src/cli.ts plan first.muro -o out/first.svg`.
|
|
62
|
-
3. **Read a bundled example.** `npx tsx src/cli.ts check examples/two-rooms.muro` prints `✔
|
|
62
|
+
3. **Read a bundled example.** `npx tsx src/cli.ts check examples/two-rooms.muro` prints `✔ Consistent — 3 spaces / 3 boundaries`; `stats`, `graph`, and `doors` answer about the same file.
|
|
63
63
|
|
|
64
64
|
`grid` and `level` must be declared before anything that refers to them, and the type (`room`, the second positional word) is required; everything else — the `koyu` version line, `unit`, `name`, heights — is optional. From here, [guide/start.md](guide/start.md) (Japanese) is a managed path from this one room to a two-storey house with per-floor plans, a circulation check, and a daylight check.
|
|
65
65
|
|
|
@@ -91,6 +91,8 @@ npm run koyu -- site examples/tower/main.muro # showcase: polygon site, t
|
|
|
91
91
|
|
|
92
92
|
`koyu-mcp` is a zero-dependency MCP server over stdio (ADR-0012): an LLM agent reads the building (`layers`), edits it (`write_layer`), and `check` acts as the build gate — errors come back with layer:line provenance. `doors` / `light` / `site` / `stats` are the same description read different ways. The whole 4,786m² showcase is 8,099 tokens as source (measured; IFC4 is 14x, IFCX 25x — see [examples/comparison/](examples/comparison/README.md)), so a whole building fits in one context with room to work. Whether an agent can *edit* it correctly is the next watershed — an edit eval is planned, not yet run ([docs/horizon.md](docs/horizon.md)). The horizon design (digital twin, ontology alignment via W3C BOT, city connection) is in the same document.
|
|
93
93
|
|
|
94
|
+
Registering it is one line (`claude mcp add koyu -- npx -p @kensnzk/koyu koyu-mcp`). Setup for Claude Code, Claude Desktop, and other clients, plus the standard loop, is in [guide/en/howto/agent-mcp.md](guide/en/howto/agent-mcp.md).
|
|
95
|
+
|
|
94
96
|
## Layout
|
|
95
97
|
|
|
96
98
|
The learning material lives in [guide/](guide/README.md) — tutorial, concepts, how-to, diagnostics, CLI/API. The current specification lives in [spec/](spec/README.md) — language reference, semantics (derivations, checks, queries), the attribute ledger, the canonical JSON format, and the tool reference (CLI / MCP / API). ADRs record why decisions were made; spec/ states what is true now. The historical record of how the notation was chosen (with the DSL/YAML/JSON comparison) is [spec/notation-v0.md](spec/notation-v0.md); coverage against the IFC4 architectural core is [docs/ifc-coverage.md](docs/ifc-coverage.md); design decisions are recorded in [docs/decisions/](docs/decisions/); the roadmap is [docs/roadmap.md](docs/roadmap.md); daily logs are in [docs/log/](docs/log/). The implementation is ~7,500 lines in src/ (parser, graph, checks, plan generation, CLI, MCP server), tests in test/. Reading notes on IFCX are in [docs/ifcx-notes.md](docs/ifcx-notes.md); the same two rooms written three ways (this notation, IFC4, IFCX) is in [examples/comparison/](examples/comparison/README.md).
|
package/dist/cli.js
CHANGED
|
@@ -8,21 +8,29 @@
|
|
|
8
8
|
// npm run koyu -- stats examples/office.muro
|
|
9
9
|
// npm run koyu -- levels examples/office.muro # テキストの矩計 (高さの積み上がり)
|
|
10
10
|
// npm run koyu -- json examples/office.muro
|
|
11
|
+
//
|
|
12
|
+
// **人向けの出力は英語である。**機械が読む面 (診断・Finding・MCP) と同じ言葉に揃えてあり、
|
|
13
|
+
// locale 引数は持たない — 同じ文言の台帳を二つ持たないためである。
|
|
11
14
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
12
15
|
import { dirname } from "node:path";
|
|
13
|
-
import { check, checkDiagnostics } from "./
|
|
14
|
-
import { renderDiff, semanticDiff } from "./diff.js";
|
|
15
|
-
import { doorsBetween, neighbors } from "./graph.js";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
16
|
+
import { check, checkDiagnostics } from "./core/diagnose.js";
|
|
17
|
+
import { renderDiff, semanticDiff } from "./core/diff.js";
|
|
18
|
+
import { doorsBetween, neighbors } from "./core/graph.js";
|
|
19
|
+
import { daylightInputs } from "./core/light.js";
|
|
20
|
+
import { validate } from "./validate/index.js";
|
|
21
|
+
import { siteReport } from "./core/site.js";
|
|
22
|
+
import { areaM2, displayName, effectiveUse, heff, isSemiOutdoor, levelsSorted, SourceError, toCanonical, zoneAreaM2, srcRef, } from "./core/model.js";
|
|
19
23
|
import { parseFile } from "./parse-file.js";
|
|
20
|
-
import { svgPlan } from "./plan.js";
|
|
21
|
-
import { svgAxo } from "./axo.js";
|
|
22
|
-
import { slopeText, verticalRuns } from "./vertical.js";
|
|
24
|
+
import { svgPlan } from "./draw/plan.js";
|
|
25
|
+
import { svgAxo } from "./draw/axo.js";
|
|
26
|
+
import { slopeText, verticalRuns } from "./core/vertical.js";
|
|
23
27
|
function load(file) {
|
|
24
28
|
return parseFile(file); // import による合成もここで働く
|
|
25
29
|
}
|
|
30
|
+
/** 数と名詞 — 英語は数が先に立ち、1のときだけ単数形になる */
|
|
31
|
+
function qty(count, one, many) {
|
|
32
|
+
return `${count} ${count === 1 ? one : many}`;
|
|
33
|
+
}
|
|
26
34
|
/** `-l L1..L5` / `-l L1,L3` をレベル名の列へ */
|
|
27
35
|
/**
|
|
28
36
|
* `-l` の解決。**解決できない指定は空配列に落とさない** — 空配列は「一枚も描かない」を
|
|
@@ -37,20 +45,20 @@ function expandLevelArg(model, arg) {
|
|
|
37
45
|
const names = arg.split(",");
|
|
38
46
|
const unknown = names.filter((n) => !all.includes(n));
|
|
39
47
|
if (unknown.length > 0)
|
|
40
|
-
die(
|
|
48
|
+
die(`Undeclared level: ${unknown.join(",")} (declared: ${all.join(" ")})`);
|
|
41
49
|
return names;
|
|
42
50
|
}
|
|
43
51
|
const za = model.levels[m[1]]?.z;
|
|
44
52
|
const zb = model.levels[m[2]]?.z;
|
|
45
53
|
if (za === undefined || zb === undefined) {
|
|
46
54
|
const bad = [m[1], m[2]].filter((n) => model.levels[n] === undefined);
|
|
47
|
-
die(
|
|
55
|
+
die(`Undeclared level: ${bad.join(",")} (declared: ${all.join(" ")})`);
|
|
48
56
|
}
|
|
49
57
|
const out = levelsSorted(model)
|
|
50
58
|
.filter((l) => l.z >= Math.min(za, zb) && l.z <= Math.max(za, zb))
|
|
51
59
|
.map((l) => l.name);
|
|
52
60
|
if (out.length === 0)
|
|
53
|
-
die(
|
|
61
|
+
die(`No level falls in the range ${arg}`);
|
|
54
62
|
return out;
|
|
55
63
|
}
|
|
56
64
|
/** 呼び方の問題は終了コード2 (使い方と同じ扱い — 構成の問題ではない) */
|
|
@@ -66,12 +74,38 @@ function opt(rest, ...names) {
|
|
|
66
74
|
}
|
|
67
75
|
return undefined;
|
|
68
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* 数を取る引数。**読めない値を黙って NaN のまま通さない。**
|
|
79
|
+
* `-s abc` は `width="NaN"` のSVGを終了コード0で書き出していた — 生成に成功したと言いながら
|
|
80
|
+
* 開けない図を残すのは、呼び方の問題を作品の問題に化けさせる。呼び方の問題として返す (ADR-0028)
|
|
81
|
+
*/
|
|
82
|
+
function numOpt(rest, ...names) {
|
|
83
|
+
const raw = opt(rest, ...names);
|
|
84
|
+
if (raw === undefined)
|
|
85
|
+
return undefined;
|
|
86
|
+
const v = Number(raw);
|
|
87
|
+
if (!Number.isFinite(v) || v <= 0)
|
|
88
|
+
die(`${names[0]} takes a positive number: ${raw}`);
|
|
89
|
+
return v;
|
|
90
|
+
}
|
|
91
|
+
/** 語彙の決まった引数。台帳に無い値は呼び方の問題である */
|
|
92
|
+
function enumOpt(rest, allowed, ...names) {
|
|
93
|
+
const raw = opt(rest, ...names);
|
|
94
|
+
if (raw === undefined)
|
|
95
|
+
return undefined;
|
|
96
|
+
if (!allowed.includes(raw)) {
|
|
97
|
+
die(`${names[0]} is one of ${allowed.join(" / ")}: ${raw}`);
|
|
98
|
+
}
|
|
99
|
+
return raw;
|
|
100
|
+
}
|
|
69
101
|
function main(argv) {
|
|
70
102
|
const [cmd, file, ...rest] = argv;
|
|
71
103
|
if (!cmd || !file) {
|
|
72
|
-
console.log("
|
|
73
|
-
" check:
|
|
74
|
-
"
|
|
104
|
+
console.log("Usage: koyu <check|validate|layers|diff|plan|axo|doors|graph|stats|levels|runs|light|site|json> <file.muro> [args...]\n" +
|
|
105
|
+
" check: --json (emit Diagnostic[] as JSON) / --strict (exit 1 if there are warnings) — structural consistency only\n" +
|
|
106
|
+
" validate: --json (emit Finding[] as JSON) — architectural judgement (not what check guarantees)\n" +
|
|
107
|
+
" layers: the layers that took part in composition, weakest first. --attrs for the provenance of each attribute\n" +
|
|
108
|
+
" diff: koyu diff <a.muro> <b.muro> [--json] — the difference in the language of composition (0=no difference / 1=differences / 2=the input is broken)");
|
|
75
109
|
return 2;
|
|
76
110
|
}
|
|
77
111
|
if (cmd === "diff") {
|
|
@@ -79,7 +113,7 @@ function main(argv) {
|
|
|
79
113
|
// 終了コードは 0=差分なし / 1=差分あり / 2=入力が壊れている — checkの0/1と紛れない
|
|
80
114
|
const fileB = rest[0];
|
|
81
115
|
if (!fileB) {
|
|
82
|
-
console.log("
|
|
116
|
+
console.log("Usage: koyu diff <a.muro> <b.muro> [--json]");
|
|
83
117
|
return 2;
|
|
84
118
|
}
|
|
85
119
|
let ma;
|
|
@@ -101,7 +135,7 @@ function main(argv) {
|
|
|
101
135
|
console.log(JSON.stringify(d, null, 1));
|
|
102
136
|
}
|
|
103
137
|
else if (lines.length === 0) {
|
|
104
|
-
console.log("
|
|
138
|
+
console.log("No differences");
|
|
105
139
|
}
|
|
106
140
|
else {
|
|
107
141
|
for (const l of lines)
|
|
@@ -144,12 +178,53 @@ function main(argv) {
|
|
|
144
178
|
for (const e of errors)
|
|
145
179
|
console.log(`✖ ${e}`);
|
|
146
180
|
if (errors.length === 0) {
|
|
147
|
-
console.log(`✔
|
|
148
|
-
(warnings.length ? ` (
|
|
181
|
+
console.log(`✔ Consistent — ${qty(model.spaces.size, "space", "spaces")} / ${qty(model.boundaries.length, "boundary", "boundaries")}` +
|
|
182
|
+
(warnings.length ? ` (${qty(warnings.length, "warning", "warnings")})` : ""));
|
|
183
|
+
// **緑の意味を、緑を出す場所で言う。**構造整合が成り立っただけであって、
|
|
184
|
+
// 建築として妥当かはここでは何も言っていない (spec/scope.md §3)
|
|
185
|
+
console.log(" Structural consistency only — architectural validity is what koyu validate says, separately");
|
|
149
186
|
return strict && warnings.length > 0 ? 1 : 0;
|
|
150
187
|
}
|
|
151
188
|
return 1;
|
|
152
189
|
}
|
|
190
|
+
case "validate": {
|
|
191
|
+
// 建築的な判定 (spec/scope.md §3)。**check の保証ではない** — 型もコードの綴りも別で、
|
|
192
|
+
// 終了コードだけが同じ流儀 (0=違反なし / 1=違反あり)
|
|
193
|
+
const findings = validate(model);
|
|
194
|
+
if (rest.includes("--json")) {
|
|
195
|
+
console.log(JSON.stringify(findings, null, 1));
|
|
196
|
+
return findings.some((f) => f.level === "violation") ? 1 : 0;
|
|
197
|
+
}
|
|
198
|
+
const label = (f) => (f.level === "violation" ? "✖" : "⚠");
|
|
199
|
+
for (const f of findings) {
|
|
200
|
+
const where = f.line !== undefined ? `${srcRef(f.line, f.file)}: ` : "";
|
|
201
|
+
console.log(`${label(f)} [${f.rule}] ${where}${f.message}`);
|
|
202
|
+
}
|
|
203
|
+
const violations = findings.filter((f) => f.level === "violation").length;
|
|
204
|
+
const cautions = findings.length - violations;
|
|
205
|
+
console.log(findings.length === 0
|
|
206
|
+
? "✔ Nothing caught by validation (this is a judgement, not a guarantee about the composition)"
|
|
207
|
+
: `Validation — ${qty(violations, "violation", "violations")} / ${qty(cautions, "caution", "cautions")}`);
|
|
208
|
+
return violations > 0 ? 1 : 0;
|
|
209
|
+
}
|
|
210
|
+
case "layers": {
|
|
211
|
+
// 合成の規則1と6 (spec/composition.md) — 強度順序を見せ、最終値の出所を言う。
|
|
212
|
+
// **暗黙の解決はどこにも無い**ことを、目で確かめられるようにするための面である
|
|
213
|
+
if (model.layers.length === 0) {
|
|
214
|
+
console.log("No layers (parsing a single file involves no composition)");
|
|
215
|
+
return 0;
|
|
216
|
+
}
|
|
217
|
+
console.log("Layers (weakest first — later layers are stronger):");
|
|
218
|
+
model.layers.forEach((l, i) => console.log(` ${i}\t${l}`));
|
|
219
|
+
if (rest.includes("--attrs")) {
|
|
220
|
+
console.log("\nAttribute provenance:");
|
|
221
|
+
const rows = [...model.attrSrc].sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0));
|
|
222
|
+
for (const [key, layerIdx] of rows) {
|
|
223
|
+
console.log(` ${key}\t← ${layerIdx} ${model.layers[layerIdx] ?? "?"}`);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return 0;
|
|
227
|
+
}
|
|
153
228
|
case "json": {
|
|
154
229
|
process.stdout.write(toCanonical(model));
|
|
155
230
|
return 0;
|
|
@@ -158,28 +233,28 @@ function main(argv) {
|
|
|
158
233
|
const level = opt(rest, "-l", "--level") ?? Object.keys(model.levels)[0];
|
|
159
234
|
// 未宣言のレベルは呼び方の問題 — 生のスタックトレースで落ちない (ADR-0028)
|
|
160
235
|
if (level !== undefined && model.levels[level] === undefined) {
|
|
161
|
-
die(
|
|
236
|
+
die(`Undeclared level: ${level} (declared: ${levelsSorted(model).map((l) => l.name).join(" ")})`);
|
|
162
237
|
}
|
|
163
238
|
const explicit = opt(rest, "-o");
|
|
164
239
|
const outFile = explicit ?? `${file.replace(/\.muro$/, "")}-${level}.svg`;
|
|
165
240
|
const svg = svgPlan(model, { level });
|
|
166
241
|
mkdirSync(dirname(outFile), { recursive: true });
|
|
167
242
|
writeFileSync(outFile, svg);
|
|
168
|
-
console.log(
|
|
243
|
+
console.log(`Generated the plan: ${outFile}`);
|
|
169
244
|
return 0;
|
|
170
245
|
}
|
|
171
246
|
case "doors": {
|
|
172
247
|
const [from, to] = rest;
|
|
173
248
|
if (!from || !to) {
|
|
174
|
-
console.log("
|
|
249
|
+
console.log("Usage: koyu doors <file> /pathA /pathB");
|
|
175
250
|
return 2;
|
|
176
251
|
}
|
|
177
252
|
const route = doorsBetween(model, from, to);
|
|
178
253
|
if (!route) {
|
|
179
|
-
console.log(
|
|
254
|
+
console.log(`Cannot reach ${to} from ${from}`);
|
|
180
255
|
return 1;
|
|
181
256
|
}
|
|
182
|
-
console.log(`${route.doors}
|
|
257
|
+
console.log(`${qty(route.doors, "door", "doors")} — ${route.path.join(" → ")}`);
|
|
183
258
|
return 0;
|
|
184
259
|
}
|
|
185
260
|
case "graph": {
|
|
@@ -188,18 +263,18 @@ function main(argv) {
|
|
|
188
263
|
console.log(`${s.path} (${displayName(s)})`);
|
|
189
264
|
for (const n of ns) {
|
|
190
265
|
const mark = n.boundary.kind === "open"
|
|
191
|
-
? "〰
|
|
266
|
+
? "〰 open"
|
|
192
267
|
: n.boundary.kind === "wall" && n.boundary.air && !n.passable
|
|
193
|
-
? "|
|
|
268
|
+
? "| railing etc. (open to the air, not passable)"
|
|
194
269
|
: n.boundary.kind === "stair"
|
|
195
|
-
? "↕
|
|
270
|
+
? "↕ stair"
|
|
196
271
|
: n.boundary.kind === "shaft"
|
|
197
|
-
? "↕
|
|
272
|
+
? "↕ shaft (not passable)"
|
|
198
273
|
: n.boundary.kind === "void"
|
|
199
|
-
? "↕
|
|
274
|
+
? "↕ void"
|
|
200
275
|
: n.passable
|
|
201
|
-
? `—
|
|
202
|
-
: "|
|
|
276
|
+
? `— ${qty(n.doors, "door", "doors")}`
|
|
277
|
+
: "| wall";
|
|
203
278
|
const attrs = Object.entries(n.boundary.attrs)
|
|
204
279
|
.map(([k, v]) => `${k}:${v}`)
|
|
205
280
|
.join(" ");
|
|
@@ -224,18 +299,18 @@ function main(argv) {
|
|
|
224
299
|
let sub = 0;
|
|
225
300
|
for (const s of onLevel) {
|
|
226
301
|
if (s.type === "void") {
|
|
227
|
-
console.log(` ${s.path}\t${displayName(s)}\
|
|
302
|
+
console.log(` ${s.path}\t${displayName(s)}\tvoid (not counted as floor area)`);
|
|
228
303
|
continue;
|
|
229
304
|
}
|
|
230
305
|
const a = areaM2(s);
|
|
231
306
|
if (s.type === "exterior") {
|
|
232
307
|
outdoorTotal += a;
|
|
233
|
-
console.log(` ${s.path}\t${displayName(s)}\t${s.type}\t${a.toFixed(2)}
|
|
308
|
+
console.log(` ${s.path}\t${displayName(s)}\t${s.type}\t${a.toFixed(2)} m2 (outdoor, not counted)`);
|
|
234
309
|
continue;
|
|
235
310
|
}
|
|
236
311
|
if (isSemiOutdoor(model, s)) {
|
|
237
312
|
semiTotal += a;
|
|
238
|
-
console.log(` ${s.path}\t${displayName(s)}\t${s.type}\t${a.toFixed(2)}
|
|
313
|
+
console.log(` ${s.path}\t${displayName(s)}\t${s.type}\t${a.toFixed(2)} m2 (semi-outdoor, reported separately)`);
|
|
239
314
|
continue;
|
|
240
315
|
}
|
|
241
316
|
sub += a;
|
|
@@ -244,106 +319,106 @@ function main(argv) {
|
|
|
244
319
|
const use = effectiveUse(model, s);
|
|
245
320
|
if (use)
|
|
246
321
|
byUse.set(use, (byUse.get(use) ?? 0) + a);
|
|
247
|
-
console.log(` ${s.path}\t${displayName(s)}\t${s.type}\t${a.toFixed(2)}
|
|
322
|
+
console.log(` ${s.path}\t${displayName(s)}\t${s.type}\t${a.toFixed(2)} m2`);
|
|
248
323
|
}
|
|
249
|
-
console.log(`
|
|
324
|
+
console.log(` Subtotal ${sub.toFixed(2)} m2`);
|
|
250
325
|
}
|
|
251
|
-
console.log(
|
|
326
|
+
console.log(`Total ${total.toFixed(2)} m2 (indoor floor area)`);
|
|
252
327
|
if (outdoorTotal > 0) {
|
|
253
|
-
console.log(
|
|
328
|
+
console.log(`Outdoor ${outdoorTotal.toFixed(2)} m2 (plazas, open ground and the like — not counted as floor area)`);
|
|
254
329
|
}
|
|
255
330
|
if (semiTotal > 0) {
|
|
256
|
-
console.log(
|
|
331
|
+
console.log(`Semi-outdoor ${semiTotal.toFixed(2)} m2 (balconies, external stairs and the like — whether they count is a matter of regulatory detail, so it is reported separately)`);
|
|
257
332
|
}
|
|
258
333
|
const zonesToShow = [...model.zones.values()].filter((z) => z.attrs["site"] !== 1);
|
|
259
334
|
if (zonesToShow.length > 0) {
|
|
260
|
-
console.log("
|
|
335
|
+
console.log("By zone (counted aggregation):");
|
|
261
336
|
for (const z of zonesToShow.sort((a, b) => (a.path < b.path ? -1 : 1))) {
|
|
262
337
|
const nm = z.attrs["name"];
|
|
263
|
-
console.log(` ${z.path}\t${typeof nm === "string" ? nm : ""}\t${zoneAreaM2(model, z.path).toFixed(2)}
|
|
338
|
+
console.log(` ${z.path}\t${typeof nm === "string" ? nm : ""}\t${zoneAreaM2(model, z.path).toFixed(2)} m2`);
|
|
264
339
|
}
|
|
265
340
|
}
|
|
266
341
|
for (const [t, a] of byType)
|
|
267
|
-
console.log(` ${t}: ${a.toFixed(2)}
|
|
342
|
+
console.log(` ${t}: ${a.toFixed(2)} m2`);
|
|
268
343
|
if (byUse.size > 0) {
|
|
269
|
-
const parts = [...byUse.entries()].map(([u, a]) => `${u} ${a.toFixed(2)}
|
|
270
|
-
console.log(`use
|
|
344
|
+
const parts = [...byUse.entries()].map(([u, a]) => `${u} ${a.toFixed(2)} m2 (${((a / total) * 100).toFixed(1)}%)`);
|
|
345
|
+
console.log(`By use: ${parts.join(" / ")}`);
|
|
271
346
|
}
|
|
272
347
|
return 0;
|
|
273
348
|
}
|
|
274
349
|
case "light": {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
350
|
+
// 採光は**判定**である — core が返すのは床面積と有効窓面積という数だけで、
|
|
351
|
+
// 1/7 の合否は検証の面 (validate) が言う (spec/scope.md §4)
|
|
352
|
+
const inputs = daylightInputs(model);
|
|
353
|
+
if (inputs.length === 0) {
|
|
354
|
+
console.log("Nothing is in daylight scope (write daylight:1 on the rooms to be judged)");
|
|
278
355
|
return 0;
|
|
279
356
|
}
|
|
280
|
-
|
|
281
|
-
for (const
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
(r.missingH ? " ⚠ h未指定の窓は数えていません" : ""));
|
|
357
|
+
const failing = new Set(validate(model).filter((f) => f.rule === "daylight.ratio").flatMap((f) => f.path ?? []));
|
|
358
|
+
for (const d of inputs) {
|
|
359
|
+
const ok = !failing.has(d.space.path);
|
|
360
|
+
const ratio = d.window > 0 ? `1/${(d.floor / d.window).toFixed(1)}` : "no window";
|
|
361
|
+
console.log(`${ok ? "✔" : "✖"} ${d.space.path}\t${displayName(d.space)}\twindow ${d.window.toFixed(2)} m2 / floor ${d.floor.toFixed(2)} m2 = ${ratio} (needs 1/7 ≈ ${(d.floor / 7).toFixed(2)} m2)` +
|
|
362
|
+
(d.missingH ? " ⚠ windows without h: are not counted" : ""));
|
|
287
363
|
}
|
|
288
|
-
console.log(
|
|
289
|
-
? `✔
|
|
290
|
-
: `✖ ${
|
|
291
|
-
return
|
|
364
|
+
console.log(failing.size === 0
|
|
365
|
+
? `✔ Every room meets 1/7 — ${qty(inputs.length, "room", "rooms")} in scope (a rough judgement with no correction factor — this is validation, not what check guarantees)`
|
|
366
|
+
: `✖ Short of 1/7: ${failing.size} of ${qty(inputs.length, "room", "rooms")} (this is a validation judgement)`);
|
|
367
|
+
return failing.size === 0 ? 0 : 1;
|
|
292
368
|
}
|
|
293
369
|
case "site": {
|
|
294
370
|
// 敷地の問い: 敷地面積・接道・建蔽率・容積率 (基本計画のボリューム検討の数字)
|
|
295
371
|
const r = siteReport(model);
|
|
296
372
|
if (!r.siteZone && r.roads.length === 0) {
|
|
297
|
-
console.log("
|
|
373
|
+
console.log("There is no site (write site:1 on a zone and road:<width> on the road)");
|
|
298
374
|
return 1;
|
|
299
375
|
}
|
|
300
376
|
const site = r.declaredArea ?? r.derivedArea;
|
|
301
377
|
if (r.siteZone) {
|
|
302
378
|
const nm = r.siteZone.attrs["name"];
|
|
303
|
-
console.log(
|
|
379
|
+
console.log(`Site ${r.siteZone.path}${typeof nm === "string" ? ` (${nm})` : ""}`);
|
|
304
380
|
}
|
|
305
381
|
if (r.polygon) {
|
|
306
|
-
console.log(`
|
|
382
|
+
console.log(` Site shape: polygon with ${r.polygon.points.length} vertices (a polygon declaration — given geometry)`);
|
|
307
383
|
}
|
|
308
384
|
if (r.declaredArea !== undefined) {
|
|
309
|
-
|
|
310
|
-
console.log(` 敷地面積: 宣言 ${r.declaredArea.toFixed(2)}㎡ / 導出 ${r.derivedArea.toFixed(2)}㎡ ${ok ? "✔ 一致" : `⚠ 不一致 (${r.polygon ? "測量値と多角形の食い違い" : "タイルの隙間か重なり"})`}`);
|
|
385
|
+
console.log(` Site area: declared ${r.declaredArea.toFixed(2)} m2 / derived ${r.derivedArea.toFixed(2)} m2`);
|
|
311
386
|
}
|
|
312
387
|
else {
|
|
313
|
-
console.log(`
|
|
388
|
+
console.log(` Site area (derived): ${r.derivedArea.toFixed(2)} m2`);
|
|
314
389
|
}
|
|
315
390
|
for (const road of r.roads) {
|
|
316
391
|
const nm = road.road.attrs["name"];
|
|
317
|
-
console.log(`
|
|
392
|
+
console.log(` Road: ${road.road.path}${typeof nm === "string" ? ` (${nm})` : ""} width ${road.width}mm / frontage ${road.frontage}mm`);
|
|
318
393
|
}
|
|
319
|
-
console.log(`
|
|
320
|
-
console.log(`
|
|
394
|
+
console.log(` Building footprint (horizontal projection, rough): ${r.footprint.toFixed(2)} m2 → building coverage ratio ${((r.footprint / site) * 100).toFixed(1)}%`);
|
|
395
|
+
console.log(` Total floor area: ${r.totalFloor.toFixed(2)} m2 → floor area ratio ${((r.totalFloor / site) * 100).toFixed(1)}%`);
|
|
321
396
|
return 0;
|
|
322
397
|
}
|
|
323
398
|
case "axo": {
|
|
324
399
|
// 軸測図 — 立体をそのまま投影する。平面と同じく生成物のSVGなので、
|
|
325
400
|
// 実行環境もWebGLも要らず、生成して見るという同じ手で立体を確かめられる
|
|
326
401
|
const outPath = opt(rest, "-o", "--out") ?? "out/axo.svg";
|
|
327
|
-
const dirOpt =
|
|
402
|
+
const dirOpt = enumOpt(rest, ["NE", "NW", "SE", "SW"], "-d", "--dir");
|
|
328
403
|
const lv = opt(rest, "-l", "--levels");
|
|
329
|
-
const sc =
|
|
404
|
+
const sc = numOpt(rest, "-s", "--scale");
|
|
330
405
|
const svg = svgAxo(model, {
|
|
331
406
|
...(dirOpt ? { dir: dirOpt } : {}),
|
|
332
407
|
...(lv ? { levels: expandLevelArg(model, lv) } : {}),
|
|
333
|
-
...(sc ? { scale:
|
|
408
|
+
...(sc !== undefined ? { scale: sc } : {}),
|
|
334
409
|
...(rest.includes("--ceilings") ? { ceilings: true } : {}),
|
|
335
410
|
...(rest.includes("--no-walls") ? { walls: false } : {}),
|
|
336
411
|
});
|
|
337
412
|
mkdirSync(dirname(outPath), { recursive: true });
|
|
338
413
|
writeFileSync(outPath, svg);
|
|
339
|
-
console.log(
|
|
414
|
+
console.log(`Generated the axonometric: ${outPath}`);
|
|
340
415
|
return 0;
|
|
341
416
|
}
|
|
342
417
|
case "runs": {
|
|
343
418
|
// 縦動線 (ADR-0021): 段数も踏面も勾配も原本には書かれていない。全て導出値である
|
|
344
419
|
const runs = verticalRuns(model);
|
|
345
420
|
if (runs.length === 0) {
|
|
346
|
-
console.log("
|
|
421
|
+
console.log("There is no vertical circulation (write stair:N / ramp:N / escalator:N / lift:1 on a space)");
|
|
347
422
|
return 0;
|
|
348
423
|
}
|
|
349
424
|
for (const r of runs) {
|
|
@@ -355,9 +430,9 @@ function main(argv) {
|
|
|
355
430
|
continue;
|
|
356
431
|
}
|
|
357
432
|
const shape = r.device === "stair"
|
|
358
|
-
? `${r.risers}
|
|
359
|
-
:
|
|
360
|
-
console.log(`${head}\
|
|
433
|
+
? `${qty(r.risers, "riser", "risers")} of ${Math.round(r.riser)}mm, tread ${Math.round(r.tread)}mm`
|
|
434
|
+
: `slope ${slopeText(r.slope)}`;
|
|
435
|
+
console.log(`${head}\trise ${r.rise}mm\t${r.form === "return" ? "return" : "straight"}\t${shape}\tgoing ${Math.round(r.going)}mm\t${r.path}`);
|
|
361
436
|
}
|
|
362
437
|
return 0;
|
|
363
438
|
}
|
|
@@ -365,7 +440,7 @@ function main(argv) {
|
|
|
365
440
|
// テキストの矩計: レベルの積み上がりと高さの検算
|
|
366
441
|
const levels = levelsSorted(model);
|
|
367
442
|
if (levels.length === 0) {
|
|
368
|
-
console.log("
|
|
443
|
+
console.log("No level is defined");
|
|
369
444
|
return 1;
|
|
370
445
|
}
|
|
371
446
|
for (let i = levels.length - 1; i >= 0; i--) {
|
|
@@ -377,21 +452,21 @@ function main(argv) {
|
|
|
377
452
|
if (upper) {
|
|
378
453
|
const pitch = upper.z - l.z;
|
|
379
454
|
const detail = l.h !== undefined && upper.slab !== undefined
|
|
380
|
-
? ` =
|
|
381
|
-
(pitch - l.h - upper.slab > 0 ? ` +
|
|
455
|
+
? ` = ceiling ${l.h} + slab ${upper.slab}` +
|
|
456
|
+
(pitch - l.h - upper.slab > 0 ? ` + ${pitch - l.h - upper.slab} left over` : "")
|
|
382
457
|
: "";
|
|
383
|
-
console.log(` ↑
|
|
458
|
+
console.log(` ↑ storey height ${pitch}${detail}`);
|
|
384
459
|
}
|
|
385
460
|
}
|
|
386
461
|
const spaces = [...model.spaces.values()].filter((s) => s.rects.length > 0 && s.level);
|
|
387
462
|
const overrides = spaces.filter((s) => typeof s.attrs["h"] === "number");
|
|
388
463
|
for (const s of overrides) {
|
|
389
|
-
console.log(
|
|
464
|
+
console.log(`Per-space ceiling height: ${s.path} h:${heff(model, s)}`);
|
|
390
465
|
}
|
|
391
466
|
return 0;
|
|
392
467
|
}
|
|
393
468
|
default:
|
|
394
|
-
console.log(
|
|
469
|
+
console.log(`Unknown command: ${cmd}`);
|
|
395
470
|
return 2;
|
|
396
471
|
}
|
|
397
472
|
}
|