@unson/brainbase-mcp 0.22.2 → 0.22.3
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/package.json +2 -2
- package/ui/world/world-district.js +12 -11
- package/ui/world/world-placement.js +17 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unson/brainbase-mcp",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.3",
|
|
4
4
|
"description": "Local-first Brainbase judgment OS that lets supported AI agents reuse a user's approved goals, priorities, decisions, and judgment criteria.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -407,5 +407,5 @@
|
|
|
407
407
|
"engines": {
|
|
408
408
|
"node": ">=20"
|
|
409
409
|
},
|
|
410
|
-
"gitHead": "
|
|
410
|
+
"gitHead": "8e7c9b80910f862f297788c35096461e3359d465"
|
|
411
411
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import { THREE, MapControls } from './world-vendor.js';
|
|
17
|
-
import { DISTRICT_STREETS, districtStage, districtStreetLots, skyAt } from './world-placement.js';
|
|
17
|
+
import { DISTRICT_STREETS, districtGroundPlan, districtStage, districtStreetLots, skyAt } from './world-placement.js';
|
|
18
18
|
import { canvasTexture, drawFacade, FACADE_SIZES, FACADE_UNITS, gableRoof, hashUnit, paintVertices, roundedPlate, valueNoise } from './world-scenery.js';
|
|
19
19
|
import { makeWorkspaceElement as el } from '../../workspace-kit.js';
|
|
20
20
|
|
|
@@ -535,8 +535,8 @@ export function createDistrictView({ doc, stage, reducedMotion = false, onPick,
|
|
|
535
535
|
// The stage of the district (AC-24): counted from permanent buildings, it sets how built-up it looks.
|
|
536
536
|
const stage = districtStage(shown);
|
|
537
537
|
const grown = stage.level;
|
|
538
|
-
const
|
|
539
|
-
const hallZ
|
|
538
|
+
const plan = districtGroundPlan(L);
|
|
539
|
+
const { gateZ, hallZ, plazaZ, plazaRadius } = plan;
|
|
540
540
|
// Land as in the world: gentle, non-repeating shades of grass (scenery).
|
|
541
541
|
const grass = { low: new THREE.Color(0x9fbf8c), high: new THREE.Color(0xd3e4bd), warm: new THREE.Color(0xd9d6a6) };
|
|
542
542
|
const land = mesh(paintVertices(new THREE.CircleGeometry(150, 96, 0, Math.PI * 2), (color, x, y) => {
|
|
@@ -554,7 +554,8 @@ export function createDistrictView({ doc, stage, reducedMotion = false, onPick,
|
|
|
554
554
|
const lift = new THREE.Group();
|
|
555
555
|
lift.position.y = 0.17;
|
|
556
556
|
root.add(lift);
|
|
557
|
-
|
|
557
|
+
// The main street ends at the plaza's edge; it never runs under the plaza (that overlap flickered).
|
|
558
|
+
streetStrip(lift, { x: 0, z: (plan.street.from + plan.street.to) / 2, width: DISTRICT_STREETS.main * 2, length: plan.street.to - plan.street.from, centreLine: grown >= 2, dirt: grown === 0 });
|
|
558
559
|
streetStrip(lift, { x: -DISTRICT_STREETS.backStreet, z: 0, width: 1.6, length: L + 2, dirt: grown < 2 });
|
|
559
560
|
streetStrip(lift, { x: DISTRICT_STREETS.backStreet, z: 0, width: 1.6, length: L + 2, dirt: grown < 2 });
|
|
560
561
|
// A cross street between the blocks, and at the hall end of each block a sign saying what its work is for.
|
|
@@ -616,20 +617,20 @@ export function createDistrictView({ doc, stage, reducedMotion = false, onPick,
|
|
|
616
617
|
const hallChimney = new THREE.Vector3(2.8, 5.2, hallZ - 1.2);
|
|
617
618
|
const purposeText = work?.status === 'ok' ? (work.purpose.text ?? '目的は未登録') : '目的を読めません';
|
|
618
619
|
addLabel(`庁舎:${business.name}(${purposeText})`, new THREE.Vector3(0, 5.6, hallZ), 'is-plaza', { priority: 1 });
|
|
619
|
-
const plaza = mesh(new THREE.CircleGeometry(
|
|
620
|
+
const plaza = mesh(new THREE.CircleGeometry(plazaRadius - 0.25, 48), material(0xf1ece1, { roughness: 1 }), { y: 0.24, z: plazaZ, shadow: false });
|
|
620
621
|
plaza.rotation.x = -Math.PI / 2;
|
|
621
622
|
root.add(plaza);
|
|
622
|
-
const ring = mesh(new THREE.RingGeometry(
|
|
623
|
+
const ring = mesh(new THREE.RingGeometry(plazaRadius - 0.25, plazaRadius, 48), material(0xcfc8b8, { roughness: 1 }), { y: 0.25, z: plazaZ, shadow: false });
|
|
623
624
|
ring.rotation.x = -Math.PI / 2;
|
|
624
625
|
root.add(ring);
|
|
625
626
|
if (grown >= 3) {
|
|
626
627
|
// A fountain in the plaza once the district is a 街.
|
|
627
628
|
const basin = material(0xd9d3c6, { roughness: 0.8 });
|
|
628
|
-
root.add(mesh(new THREE.CylinderGeometry(1.0, 1.1, 0.35, 32), basin, { y: 0.37, z:
|
|
629
|
-
const water = mesh(new THREE.CylinderGeometry(0.88, 0.88, 0.04, 32), material(0x7fc4d6, { roughness: 0.15, metalness: 0.1, transparent: true, opacity: 0.85 }), { y: 0.52, z:
|
|
629
|
+
root.add(mesh(new THREE.CylinderGeometry(1.0, 1.1, 0.35, 32), basin, { y: 0.37, z: plazaZ }));
|
|
630
|
+
const water = mesh(new THREE.CylinderGeometry(0.88, 0.88, 0.04, 32), material(0x7fc4d6, { roughness: 0.15, metalness: 0.1, transparent: true, opacity: 0.85 }), { y: 0.52, z: plazaZ, shadow: false });
|
|
630
631
|
root.add(water);
|
|
631
|
-
root.add(mesh(new THREE.CylinderGeometry(0.12, 0.16, 0.7, 12), basin, { y: 0.7, z:
|
|
632
|
-
const jet = mesh(new THREE.ConeGeometry(0.22, 0.6, 12, 1, true), material(0xcfeef5, { transparent: true, opacity: 0.6, emissive: new THREE.Color(0x6fb6c9), emissiveIntensity: 0.2 }), { y: 1.25, z:
|
|
632
|
+
root.add(mesh(new THREE.CylinderGeometry(0.12, 0.16, 0.7, 12), basin, { y: 0.7, z: plazaZ }));
|
|
633
|
+
const jet = mesh(new THREE.ConeGeometry(0.22, 0.6, 12, 1, true), material(0xcfeef5, { transparent: true, opacity: 0.6, emissive: new THREE.Color(0x6fb6c9), emissiveIntensity: 0.2 }), { y: 1.25, z: plazaZ, shadow: false });
|
|
633
634
|
jet.rotation.x = Math.PI;
|
|
634
635
|
root.add(jet);
|
|
635
636
|
fountainJet = jet;
|
|
@@ -648,7 +649,7 @@ export function createDistrictView({ doc, stage, reducedMotion = false, onPick,
|
|
|
648
649
|
policies.forEach((policy, index) => {
|
|
649
650
|
const angle = Math.PI * (0.15 + (0.7 * index) / Math.max(policies.length - 1, 1));
|
|
650
651
|
const x = Math.cos(angle) * 2.8;
|
|
651
|
-
const z =
|
|
652
|
+
const z = plazaZ + Math.sin(angle) * 1.6;
|
|
652
653
|
if (policy.link === 'recorded') {
|
|
653
654
|
root.add(box(0.5, 1.2, 0.22, 0xa8a49a, { x, y: 0.8, z }, { roughness: 0.9 }));
|
|
654
655
|
} else {
|
|
@@ -194,6 +194,23 @@ export function districtStreetLots(sites, { minRows = 4 } = {}) {
|
|
|
194
194
|
return { lots, streets, rows, length };
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
+
/**
|
|
198
|
+
* Where the gate, the plaza and the hall stand around the blocks of a district (`length` from
|
|
199
|
+
* `districtStreetLots`). The main street runs from beyond the gate to the plaza's edge and never into
|
|
200
|
+
* it, and the plaza stays clear of the first row of lots.
|
|
201
|
+
*/
|
|
202
|
+
export function districtGroundPlan(length) {
|
|
203
|
+
const plazaRadius = 3.85;
|
|
204
|
+
const plazaZ = -length / 2 - 1.5 - plazaRadius;
|
|
205
|
+
return {
|
|
206
|
+
gateZ: length / 2 + 4,
|
|
207
|
+
plazaZ,
|
|
208
|
+
plazaRadius,
|
|
209
|
+
hallZ: plazaZ - 5.4,
|
|
210
|
+
street: { from: plazaZ + plazaRadius, to: length / 2 + 12 },
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
|
|
197
214
|
/*
|
|
198
215
|
* The town grows (story-world-work-sites-and-gaps-v1, AC-22〜24). It grows only from evidenced outcomes
|
|
199
216
|
* and closed gaps, never from activity: counting completions or edits would let splitting work inflate it.
|