cortico-world-memory-core 0.18.0 → 0.18.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.18.1
4
+
5
+ 「独处」独立成团后有自己的颜色了。
6
+
7
+ - 攒够 3 张的标签会从「自己」里分出去单独成团(星图本来就有这个逻辑),但**颜色一直跟着 kind 走**,
8
+ 和「自己」同色,看上去像没分开。现在给这类团单独配色:`独处 = 淡紫 #c9a2ff`。
9
+ - 图例补一行「独处 N」,只在 ≥3 张(真正独立成团)时出现,否则会和「自己」重复计数。
10
+ - **星点本身仍是 kind 的颜色**:星点回答「这是谁说的」,光晕回答「哪一类」。两者分开是有意的。
11
+
12
+ ## 0.18.0
3
13
  ## 0.18.0
4
14
 
5
15
  把她独处时想的东西,接进记忆和主动开口。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cortico-world-memory-core",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "type": "module",
5
5
  "description": "四个工具写卡、查卡、改状态、排日程,改口不覆盖。每轮自动把 2 条相关旧记忆推到眼前,不用模型自己查;搜索分「对得上 / 可能沾边」两档。冷层收走三个月没想起的流水账,不删、可回暖。3D 星图一眼看完整个库。常驻约 1,000 token,本地不联网,MIT。\n\nQQ 交流群:745879632",
6
6
  "keywords": [
package/webui/app.js CHANGED
@@ -996,6 +996,8 @@ class Graph {
996
996
 
997
997
  const GALAXY_KIND = { fact: '事实', self: '自己', episode: '经历', promise: '承诺', note: '临时' };
998
998
  const GALAXY_COLOR = { fact: '#8ef0dc', self: '#9ab8ff', episode: '#ffc078', promise: '#ff9ec4', note: '#c3ccd8' };
999
+ /** 攒够 3 张就独立成团的标签,可以有自己的颜色。色相要和它的 kind 拉开,一眼能分。 */
1000
+ const GALAXY_TAG_COLOR = { 独处: '#c9a2ff' };
999
1001
  const GALAXY_CAM = 1900;
1000
1002
 
1001
1003
  /** 固定种子:同一批卡片每次布出来的星系一样。 */
@@ -1321,7 +1323,7 @@ class Galaxy {
1321
1323
  this.nodes.push(node);
1322
1324
  });
1323
1325
  g.hub = g.nodes.reduce((b, n) => (Number(n.card.weight) > Number(b.card.weight) ? n : b), g.nodes[0]);
1324
- g.color = GALAXY_COLOR[g.hub.card.kind] ?? '#c3ccd8';
1326
+ g.color = GALAXY_TAG_COLOR[g.name] ?? GALAXY_COLOR[g.hub.card.kind] ?? '#c3ccd8';
1325
1327
  g.rz = gauss() * RMAX * 0.04;
1326
1328
  }
1327
1329
 
@@ -1804,13 +1806,18 @@ function renderGalaxyLegend() {
1804
1806
  const host = $('#galaxy-legend');
1805
1807
  if (!host || !galaxy) return;
1806
1808
  const counts = galaxy.kindCounts ?? {};
1807
- host.innerHTML = Object.keys(GALAXY_KIND)
1809
+ const parts = Object.keys(GALAXY_KIND)
1808
1810
  .filter((k) => counts[k])
1809
1811
  .map(
1810
1812
  (k) =>
1811
1813
  `<span style="color:${GALAXY_COLOR[k]}"><i style="background:${GALAXY_COLOR[k]}"></i>${GALAXY_KIND[k]} ${counts[k]}</span>`,
1812
- )
1813
- .join('');
1814
+ );
1815
+ // 独立成团的标签单独列一行:它已经从「自己」里分出去了,混在一起会让人数不上
1816
+ for (const [tag, color] of Object.entries(GALAXY_TAG_COLOR)) {
1817
+ const n = cards().filter((c) => (c.tags ?? []).includes(tag)).length;
1818
+ if (n >= 3) parts.push(`<span style="color:${color}"><i style="background:${color}"></i>${tag} ${n}</span>`);
1819
+ }
1820
+ host.innerHTML = parts.join('');
1814
1821
  }
1815
1822
 
1816
1823
  let graph = null;