@unson/brainbase-mcp 0.15.3 → 0.15.4
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-placement.js +21 -0
- package/ui/world/world-view.js +2 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unson/brainbase-mcp",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.4",
|
|
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",
|
|
@@ -358,5 +358,5 @@
|
|
|
358
358
|
"engines": {
|
|
359
359
|
"node": ">=20"
|
|
360
360
|
},
|
|
361
|
-
"gitHead": "
|
|
361
|
+
"gitHead": "1a548f70b900633c8cdcfe3c468de0a082b156fe"
|
|
362
362
|
}
|
|
@@ -43,3 +43,24 @@ export function groupJudgmentPlaces(places, businesses) {
|
|
|
43
43
|
}
|
|
44
44
|
return { byBusiness, unplaced };
|
|
45
45
|
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The lots around a city's landmark for `count` districts: a square grid of `step` spacing whose cells
|
|
49
|
+
* outside the landmark's lot hold at least `count` districts (a 2x2 grid lies wholly inside it).
|
|
50
|
+
*/
|
|
51
|
+
export function districtLots(count, step = 2.5) {
|
|
52
|
+
let cols = Math.max(2, Math.ceil(Math.sqrt(count + 1)));
|
|
53
|
+
for (;;) {
|
|
54
|
+
const cells = [];
|
|
55
|
+
for (let row = 0; row < cols; row += 1) {
|
|
56
|
+
for (let col = 0; col < cols; col += 1) {
|
|
57
|
+
const cx = -((cols - 1) * step) / 2 + col * step;
|
|
58
|
+
const cz = -((cols - 1) * step) / 2 + row * step;
|
|
59
|
+
if (Math.abs(cx) < 2.2 && Math.abs(cz) < 2.2) continue; // the landmark's lot
|
|
60
|
+
cells.push([cx, cz]);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (cells.length >= count) return { cols, cells };
|
|
64
|
+
cols += 1;
|
|
65
|
+
}
|
|
66
|
+
}
|
package/ui/world/world-view.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
import { THREE, MapControls } from './world-vendor.js';
|
|
18
|
-
import { groupJudgmentPlaces, UNPLACED_REASON_TEXT } from './world-placement.js';
|
|
18
|
+
import { districtLots, groupJudgmentPlaces, UNPLACED_REASON_TEXT } from './world-placement.js';
|
|
19
19
|
import {
|
|
20
20
|
makeWorkspaceElement as el,
|
|
21
21
|
workspacePageHeader,
|
|
@@ -505,17 +505,8 @@ function createScene({ doc, stage, labelsLayer, reducedMotion, onPick, onClear }
|
|
|
505
505
|
cityLabel.node.style.borderColor = `${entry.color}80`;
|
|
506
506
|
cityLabel.business = business;
|
|
507
507
|
const n = business.engagements.length;
|
|
508
|
-
const cols = Math.max(2, Math.ceil(Math.sqrt(n + 1)));
|
|
509
508
|
const step = 2.5;
|
|
510
|
-
const cells =
|
|
511
|
-
for (let row = 0; row < cols; row += 1) {
|
|
512
|
-
for (let col = 0; col < cols; col += 1) {
|
|
513
|
-
const cx = -((cols - 1) * step) / 2 + col * step;
|
|
514
|
-
const cz = -((cols - 1) * step) / 2 + row * step;
|
|
515
|
-
if (Math.abs(cx) < 2.2 && Math.abs(cz) < 2.2) continue; // the landmark's lot
|
|
516
|
-
cells.push([cx, cz]);
|
|
517
|
-
}
|
|
518
|
-
}
|
|
509
|
+
const { cols, cells } = districtLots(n, step);
|
|
519
510
|
cells.sort((a, b) => Math.hypot(...a) - Math.hypot(...b));
|
|
520
511
|
business.engagements.forEach((engagement, index) => {
|
|
521
512
|
const [cx, cz] = cells[index % cells.length];
|