@unson/brainbase-mcp 0.23.5 → 0.23.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unson/brainbase-mcp",
3
- "version": "0.23.5",
3
+ "version": "0.23.6",
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",
@@ -423,5 +423,5 @@
423
423
  "engines": {
424
424
  "node": ">=20"
425
425
  },
426
- "gitHead": "98835ea4b24370a96ea81e80716653b416bcd7c3"
426
+ "gitHead": "d475d6282eda01482255c0a234999e194560d3c8"
427
427
  }
@@ -606,7 +606,9 @@ function aggregateNormalJudgmentHistory(home, { now = new Date(), period = PERIO
606
606
  confirmedOutcomes: null,
607
607
  },
608
608
  visibleCount: 0,
609
- totalCount: home.coverage?.total ?? (home.coverage?.complete === true && home.records.length === 0 ? 0 : null),
609
+ retrievedCount: 0,
610
+ countComplete: false,
611
+ totalCount: home.status === 'available' && home.coverage?.complete === true ? nonNegativeInteger(home.coverage?.total) : null,
610
612
  period: normalizedPeriod(period),
611
613
  query: text(query),
612
614
  status: home.status,
@@ -660,7 +662,10 @@ function aggregateNormalJudgmentHistory(home, { now = new Date(), period = PERIO
660
662
  }
661
663
  }
662
664
  const metricsUnconfirmed = home.status === 'partial' && rows.length === 0;
663
- const judgments = metricsUnconfirmed ? null : rows.length;
665
+ // A page length is a retrieved count, never proof of the whole range.
666
+ const countComplete = home.status === 'available' && home.coverage?.complete === true
667
+ && nonNegativeInteger(home.coverage?.total) !== null && !needle;
668
+ const judgments = countComplete ? home.coverage.total : null;
664
669
  const referenceCount = metricsUnconfirmed || referencesUnconfirmed ? null : references.size;
665
670
  const confirmedOutcomes = metricsUnconfirmed
666
671
  ? null
@@ -680,7 +685,9 @@ function aggregateNormalJudgmentHistory(home, { now = new Date(), period = PERIO
680
685
  confirmedOutcomes,
681
686
  },
682
687
  visibleCount: rows.length,
683
- totalCount: home.coverage?.total ?? (home.coverage?.complete === true && home.records.length === 0 ? 0 : null),
688
+ retrievedCount: rows.length,
689
+ countComplete,
690
+ totalCount: home.status === 'available' && home.coverage?.complete === true ? nonNegativeInteger(home.coverage?.total) : null,
684
691
  };
685
692
  }
686
693
 
@@ -1328,7 +1335,7 @@ function paginationControls(doc, aggregate, onNext) {
1328
1335
  const total = aggregate?.totalCount;
1329
1336
  if (!pagination?.hasNext && total === null) return null;
1330
1337
  const wrap = makeWorkspaceElement(doc, 'div', { className: 'bb-jh-pagination' });
1331
- const count = total === null ? '同じ範囲の件数は未確認' : `同じ範囲の件数: ${total}件`;
1338
+ const count = total === null ? '同じ範囲の件数は未確認' : `${aggregate.query ? '検索前の全件数' : '同じ範囲の件数'}: ${total}件`;
1332
1339
  wrap.append(makeWorkspaceElement(doc, 'span', { className: 'bb-jh-pagination-count', text: count }));
1333
1340
  if (pagination?.hasNext) {
1334
1341
  wrap.append(workspaceButton(doc, { text: '次のページ', variant: 'quiet', onClick: onNext, attrs: { 'data-action': 'next-page' } }));
@@ -1709,7 +1716,12 @@ export function createJudgmentHistoryUI({
1709
1716
  const stats = aggregate.stats ?? {};
1710
1717
  const metricCount = (value, suffix) => value === null || value === undefined ? '未確認' : `${value}${suffix}`;
1711
1718
  wrapper.append(workspaceMetrics(doc, normalMode() ? [
1712
- { label: '判断件数', value: metricCount(stats.judgments, '件'), note: 'この期間・絞り込みの履歴' },
1719
+ {
1720
+ label: aggregate.query ? '表示対象' : aggregate.countComplete ? '判断件数' : '取得済み',
1721
+ value: metricCount(aggregate.countComplete ? stats.judgments : aggregate.retrievedCount, '件'),
1722
+ note: aggregate.countComplete ? 'この期間・絞り込みの全件数'
1723
+ : aggregate.query ? '取得済み履歴の検索結果・全件数未確認' : '全件数未確認',
1724
+ },
1713
1725
  { label: '使った参照', value: metricCount(stats.references, '件'), note: '当時の記録にある一意の参照' },
1714
1726
  { label: '確認済みの結果', value: metricCount(stats.confirmedOutcomes, '件'), note: '成果が確認済みと記録された判断' },
1715
1727
  ] : [
@@ -1717,8 +1729,8 @@ export function createJudgmentHistoryUI({
1717
1729
  { label: 'そこで使った参照', value: metricCount(stats.references, '件'), note: '代理判断に含まれる一意の参照' },
1718
1730
  { label: '判断回数にすると', value: metricCount(stats.equivalent, '回分相当'), note: '代理判断1件を1回分として表示' },
1719
1731
  ], { ariaLabel: '判断履歴の集計' }));
1720
- const emptyText = state.home?.status === 'partial'
1721
- ? 'この期間に取得できた判断履歴はありません。未接続・一部取得のため0件とは確認できません。'
1732
+ const emptyText = state.home?.status === 'partial' || (normalMode() && !aggregate.countComplete)
1733
+ ? 'この期間に取得できた判断履歴はありません。全件数が未確認のため0件とは確認できません。'
1722
1734
  : 'この期間の判断履歴はありません。';
1723
1735
  wrapper.append(workspaceLedger(doc, {
1724
1736
  className: 'bb-jh-ledger',