@unson/brainbase-mcp 0.50.8 → 0.50.10

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.
@@ -88,6 +88,12 @@
88
88
  "event"
89
89
  ]
90
90
  },
91
+ {
92
+ "name": "personal_knowledge_reject",
93
+ "requiredInput": [
94
+ "event_id"
95
+ ]
96
+ },
91
97
  {
92
98
  "name": "personal_knowledge_search",
93
99
  "requiredInput": [
@@ -122,6 +128,7 @@
122
128
  "toolNames": [
123
129
  "personal_knowledge_context",
124
130
  "personal_knowledge_register",
131
+ "personal_knowledge_reject",
125
132
  "personal_knowledge_search"
126
133
  ]
127
134
  },
@@ -1,4 +1,4 @@
1
- /** The context header used by the v1 register and search contracts. */
1
+ /** The context header used by the v1 register, search, and reject contracts. */
2
2
  export declare const PERSONAL_KNOWLEDGE_CONTEXT_HEADER = "X-Brainbase-Personal-Context";
3
3
  export declare const PERSONAL_KNOWLEDGE_CONTEXT_VERSION_HEADER = "X-Brainbase-Personal-Context-Version";
4
4
  /** Short alias retained for consumers that call this a personal context header. */
@@ -126,6 +126,11 @@ export declare class PersonalKnowledgeClient {
126
126
  getContext(): Promise<PersonalKnowledgeContextEnvelope>;
127
127
  register(input: PersonalKnowledgeEventInput): Promise<PersonalKnowledgeRegisterEnvelope>;
128
128
  search(query: string, limit?: number): Promise<PersonalKnowledgeSearchEnvelope>;
129
+ reject(eventId: string): Promise<{
130
+ event_id: string;
131
+ action: 'reject';
132
+ semantic_state: 'retracted';
133
+ }>;
129
134
  private request;
130
135
  }
131
136
  export declare function createPersonalKnowledgeClient(options: PersonalKnowledgeClientOptions): PersonalKnowledgeClient;
@@ -4,7 +4,7 @@ import { hostname, userInfo } from 'node:os';
4
4
  import { chmod, open, mkdir, readFile, rename, rm, stat } from 'node:fs/promises';
5
5
  import { dirname, join } from 'node:path';
6
6
  import { resolveDataDir } from './paths.js';
7
- /** The context header used by the v1 register and search contracts. */
7
+ /** The context header used by the v1 register, search, and reject contracts. */
8
8
  export const PERSONAL_KNOWLEDGE_CONTEXT_HEADER = 'X-Brainbase-Personal-Context';
9
9
  export const PERSONAL_KNOWLEDGE_CONTEXT_VERSION_HEADER = 'X-Brainbase-Personal-Context-Version';
10
10
  /** Short alias retained for consumers that call this a personal context header. */
@@ -685,6 +685,23 @@ export class PersonalKnowledgeClient {
685
685
  });
686
686
  return assertSearchEnvelope(payload, this.expectedContext);
687
687
  }
688
+ async reject(eventId) {
689
+ if (typeof eventId !== 'string' || !eventId.trim()) {
690
+ throw new Error('Personal Knowledge rejection requires a non-empty event_id.');
691
+ }
692
+ const event_id = eventId.trim();
693
+ await this.getContext();
694
+ const receipt = await this.request('/api/personal-knowledge/feedback', {
695
+ method: 'POST',
696
+ body: { event_id, action: 'reject' },
697
+ expectedHeader: true
698
+ });
699
+ if (!isRecord(receipt) || receipt.event_id !== event_id || receipt.action !== 'reject'
700
+ || receipt.semantic_state !== 'retracted' || 'error' in receipt) {
701
+ throw new PersonalKnowledgeClientError('Personal Knowledge reject response schema is invalid.');
702
+ }
703
+ return { event_id, action: 'reject', semantic_state: 'retracted' };
704
+ }
688
705
  async request(path, options) {
689
706
  let token;
690
707
  try {
package/dist/server.d.ts CHANGED
@@ -195,6 +195,24 @@ export declare const toolDefinitions: readonly [{
195
195
  };
196
196
  };
197
197
  };
198
+ }, {
199
+ readonly name: "personal_knowledge_reject";
200
+ readonly description: "Retract an event through the authenticated Personal Knowledge API. Requires API storage; identity comes from trusted configuration. This is not physical deletion.";
201
+ readonly annotations: {
202
+ readonly readOnlyHint: false;
203
+ readonly destructiveHint: true;
204
+ };
205
+ readonly inputSchema: {
206
+ readonly type: "object";
207
+ readonly required: readonly ["event_id"];
208
+ readonly additionalProperties: false;
209
+ readonly properties: {
210
+ readonly event_id: {
211
+ readonly type: "string";
212
+ readonly minLength: 1;
213
+ };
214
+ };
215
+ };
198
216
  }, {
199
217
  readonly name: "personal_knowledge_search";
200
218
  readonly description: "Search the explicitly configured v1 personal knowledge context. The result includes the verified context and never falls back to another store.";
package/dist/server.js CHANGED
@@ -17,7 +17,7 @@ import { auditPersonalOsDirectory } from './ontology-ssot.js';
17
17
  import { getOntologyImpact, inferPersonalOs, portableOntology, resolveOntologyVersion } from './ontology.js';
18
18
  import { loadPersonalOs } from './ssot.js';
19
19
  import { getContext, listEntities, onboardingStatus, searchAll, searchPersonalKg } from './tools.js';
20
- import { createLocalPersonalKnowledgeStore, createPersonalKnowledgeClient, decodePersonalKnowledgeContextHeader, PERSONAL_KNOWLEDGE_CONTRACT_VERSION, validatePersonalKnowledgeContext } from './personal-knowledge.js';
20
+ import { createLocalPersonalKnowledgeStore, createPersonalKnowledgeClient, decodePersonalKnowledgeContextHeader, PERSONAL_KNOWLEDGE_CONTRACT_VERSION, validatePersonalKnowledgeContext, PersonalKnowledgeClient } from './personal-knowledge.js';
21
21
  const argsSchema = z.object({
22
22
  dataDir: z.string().optional(),
23
23
  query: z.string().optional(),
@@ -54,6 +54,7 @@ const personalKnowledgeEventSchema = z.object({
54
54
  tags: z.array(z.string().min(1)).optional(),
55
55
  metadata: z.record(z.string(), z.unknown()).optional()
56
56
  }).strict();
57
+ const personalKnowledgeRejectSchema = z.object({ event_id: z.string().trim().min(1) }).strict();
57
58
  const personalKnowledgeContextSchema = z.object({}).strict();
58
59
  const personalKnowledgeRegisterSchema = z.object({ event: personalKnowledgeEventSchema }).strict();
59
60
  const personalKnowledgeSearchSchema = z.object({
@@ -254,6 +255,17 @@ export const toolDefinitions = [
254
255
  }
255
256
  }
256
257
  },
258
+ {
259
+ name: 'personal_knowledge_reject',
260
+ description: 'Retract an event through the authenticated Personal Knowledge API. Requires API storage; identity comes from trusted configuration. This is not physical deletion.',
261
+ annotations: { readOnlyHint: false, destructiveHint: true },
262
+ inputSchema: {
263
+ type: 'object',
264
+ required: ['event_id'],
265
+ additionalProperties: false,
266
+ properties: { event_id: { type: 'string', minLength: 1 } }
267
+ }
268
+ },
257
269
  {
258
270
  name: 'personal_knowledge_search',
259
271
  description: 'Search the explicitly configured v1 personal knowledge context. The result includes the verified context and never falls back to another store.',
@@ -434,6 +446,7 @@ export const toolDefinitions = [
434
446
  const managedPersonalKnowledgeToolNames = new Set([
435
447
  'personal_knowledge_context',
436
448
  'personal_knowledge_register',
449
+ 'personal_knowledge_reject',
437
450
  'personal_knowledge_search'
438
451
  ]);
439
452
  function isPersonalKnowledgeTool(name) {
@@ -518,6 +531,14 @@ function configuredPersonalKnowledgeRuntime() {
518
531
  });
519
532
  }
520
533
  async function callPersonalKnowledgeTool(name, rawArgs) {
534
+ if (name === 'personal_knowledge_reject') {
535
+ const args = personalKnowledgeRejectSchema.parse(rawArgs ?? {});
536
+ const runtime = configuredPersonalKnowledgeRuntime();
537
+ if (!(runtime instanceof PersonalKnowledgeClient)) {
538
+ throw new Error('Personal Knowledge rejection requires authenticated API storage; local retraction is not supported.');
539
+ }
540
+ return runtime.reject(args.event_id);
541
+ }
521
542
  const runtime = configuredPersonalKnowledgeRuntime();
522
543
  if (name === 'personal_knowledge_context') {
523
544
  personalKnowledgeContextSchema.parse(rawArgs ?? {});
@@ -536,7 +557,7 @@ async function callPersonalKnowledgeTool(name, rawArgs) {
536
557
  export async function callBrainbaseTool(name, rawArgs = {}, options = {}) {
537
558
  const mode = configuredPersonalKnowledgeMode();
538
559
  if (mode === 'managed_cloud' && !isPersonalKnowledgeTool(name)) {
539
- throw new Error('managed_cloud Personal Knowledge MCP only permits personal_knowledge_context, personal_knowledge_register, and personal_knowledge_search.');
560
+ throw new Error('managed_cloud Personal Knowledge MCP only permits personal_knowledge_context, personal_knowledge_register, personal_knowledge_reject, and personal_knowledge_search.');
540
561
  }
541
562
  if (name.startsWith('foundation_'))
542
563
  return callFoundationPublicTool(name, rawArgs, options.foundation);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unson/brainbase-mcp",
3
- "version": "0.50.8",
3
+ "version": "0.50.10",
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",
@@ -644,5 +644,5 @@
644
644
  "url": "https://github.com/Unson-LLC/brainbase/issues"
645
645
  },
646
646
  "homepage": "https://github.com/Unson-LLC/brainbase#readme",
647
- "gitHead": "ad082e33ab7e5bb67e9bca4852d2aa7281f0ceee"
647
+ "gitHead": "8b31a34e40631ff8b30969043803ae7daf2884e6"
648
648
  }
@@ -26,7 +26,9 @@
26
26
  }
27
27
 
28
28
  .bb-gp > .bb-ws-page .bb-ws-page-head h1 {
29
- font-size: clamp(28px, 3vw, 36px);
29
+ font-size: var(--bb-page-title-font-size);
30
+ font-weight: var(--bb-page-title-font-weight);
31
+ line-height: var(--bb-page-title-line-height);
30
32
  }
31
33
 
32
34
  .bb-gp > .bb-ws-page .bb-ws-lead {
@@ -15,10 +15,10 @@
15
15
  }
16
16
 
17
17
  .bb-jh .bb-ws-page-head h1 {
18
- font-size: 20px;
19
- font-weight: var(--bb-font-weight-medium);
20
- line-height: 1.25;
21
18
  letter-spacing: 0;
19
+ font-size: var(--bb-page-title-font-size);
20
+ font-weight: var(--bb-page-title-font-weight);
21
+ line-height: var(--bb-page-title-line-height);
22
22
  }
23
23
 
24
24
  .bb-jh .bb-ws-lead {
@@ -587,7 +587,6 @@
587
587
  /* Compact workspace header, search controls and shared floating notifications. */
588
588
  .bb-jh { position: relative; }
589
589
  .bb-jh > .bb-ws-page { margin-bottom: var(--bb-space-6, 32px); }
590
- .bb-jh .bb-ws-page-head h1 { font-size: 24px; line-height: 1.4; font-weight: var(--bb-font-weight-medium); letter-spacing: .02em; }
591
590
  .bb-jh-controls { margin-bottom: var(--bb-space-4, 16px); }
592
591
  .bb-jh-checked { font-size: 11px; font-variant-numeric: tabular-nums; }
593
592
  .bb-jh-filter-fields { display: grid; gap: 16px; }
@@ -69,9 +69,10 @@
69
69
 
70
70
  .judgment-view h1 {
71
71
  margin: 4px 0 8px;
72
- font-size: clamp(1.45rem, 3vw, 2rem);
73
- line-height: 1.25;
74
72
  letter-spacing: -.02em;
73
+ font-size: var(--bb-page-title-font-size);
74
+ font-weight: var(--bb-page-title-font-weight);
75
+ line-height: var(--bb-page-title-line-height);
75
76
  }
76
77
 
77
78
  .judgment-view h2 {
@@ -440,10 +440,10 @@ export function renderJudgmentView(root, input, options = {}) {
440
440
  const model = normalizeJudgmentView(input);
441
441
  clear(root);
442
442
  const surface = makeElement(doc, 'section', { className: 'judgment-view', attrs: { 'data-contract-version': JUDGMENT_VIEW_UI_CONTRACT_VERSION } });
443
- const header = makeElement(doc, 'header', { className: 'judgment-view-header' });
443
+ const header = makeElement(doc, 'header', { className: 'judgment-view-header bb-ws-page-head' });
444
444
  header.append(makeElement(doc, 'div', { className: 'judgment-view-kicker', text: 'BRAINBASE / JUDGMENT TRACE' }));
445
445
  header.append(makeElement(doc, 'h1', { text: '判断の追跡' }));
446
- header.append(makeElement(doc, 'p', { className: 'judgment-view-mode', text: '当時版(historical)を表示しています。現在版で補完しません。' }));
446
+ header.append(makeElement(doc, 'p', { className: 'judgment-view-mode', text: '現在版で補完せず、当時版(historical)を表示しています。' }));
447
447
  header.append(makeElement(doc, 'span', { className: `judgment-view-status is-${model.status}`, text: statusText(model.status), attrs: { role: 'status' } }));
448
448
  surface.append(header);
449
449
  if (nonEmpty(model.reason)) surface.append(makeElement(doc, 'p', { className: 'judgment-view-notice is-unknown', text: model.reason, attrs: { role: 'status' } }));
@@ -378,7 +378,7 @@ export function renderMeetingMinutesLineage(root, payload, { actions = {}, candi
378
378
  root.className = `${root.className || ''} bb-mml`.trim();
379
379
  if (normalized.status !== 'available') return renderUnavailable(root, normalized, documentRef);
380
380
 
381
- const heading = makeElement(documentRef, 'div', 'bb-mml-heading');
381
+ const heading = makeElement(documentRef, 'header', 'bb-mml-heading');
382
382
  append(heading,
383
383
  makeElement(documentRef, 'h2', 'bb-mml-title', '議事録からの判断・Task'),
384
384
  makeElement(documentRef, 'p', 'bb-mml-evidence', `根拠: ${evidenceLabel(normalized.evidence)}`));
@@ -73,7 +73,6 @@
73
73
  margin: 0;
74
74
  }
75
75
 
76
- .bb-minutes-heading h1,
77
76
  .bb-minutes-detail-head h2 {
78
77
  font-size: 20px;
79
78
  font-weight: var(--bb-font-weight-medium);
@@ -867,3 +866,9 @@
867
866
  }
868
867
 
869
868
  .bb-ws-search-band .bb-minutes-filter-reset[hidden] { display: none; }
869
+
870
+ .bb-minutes-heading h1 {
871
+ font-size: var(--bb-page-title-font-size);
872
+ font-weight: var(--bb-page-title-font-weight);
873
+ line-height: var(--bb-page-title-line-height);
874
+ }
@@ -746,7 +746,7 @@ export function createMeetingMinutesUI({
746
746
  const compact = searchBand || toolbarPresentation === 'compact';
747
747
  const screen = makeElement(doc, 'div', { className: `bb-minutes-screen${compact ? ' bb-minutes-compact bb-ws-neutral-controls' : ''}`, attrs: { 'data-contract-version': MEETING_MINUTES_UI_CONTRACT_VERSION } });
748
748
  if (searchBand) screen.classList.add('bb-minutes-search-band');
749
- const heading = makeElement(doc, 'header', { className: 'bb-minutes-heading' });
749
+ const heading = makeElement(doc, 'header', { className: 'bb-minutes-heading bb-ws-page-head' });
750
750
  heading.append(
751
751
  makeElement(doc, 'div', { className: 'bb-minutes-eyebrow', textContent: page?.source ?? '正本の議事録' }),
752
752
  makeElement(doc, 'h1', { textContent: '議事録' }),
@@ -51,7 +51,13 @@
51
51
  .objective-editor-root textarea { font: inherit; }
52
52
  .objective-editor-root h1,
53
53
  .objective-editor-root p { margin: 0; }
54
- .objective-editor-root h1 { margin: 4px 0 8px; font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -.02em; line-height: 1.25; }
54
+ .objective-editor-root h1 {
55
+ margin: 4px 0 8px;
56
+ letter-spacing: -.02em;
57
+ font-size: var(--bb-page-title-font-size);
58
+ font-weight: var(--bb-page-title-font-weight);
59
+ line-height: var(--bb-page-title-line-height);
60
+ }
55
61
  .objective-editor-root [hidden],
56
62
  .bb-objective-rail [hidden] { display: none !important; }
57
63
 
@@ -25,6 +25,7 @@ import {
25
25
  workspaceMetrics,
26
26
  workspaceNotice,
27
27
  workspacePageHeader,
28
+ workspaceHelp,
28
29
  workspaceRailBlock,
29
30
  workspaceRailHead,
30
31
  } from './workspace-kit.js';
@@ -982,15 +983,19 @@ function renderStoryLinks(root, state, callbacks) {
982
983
  export function renderObjectiveEditor(root, state, callbacks = {}) {
983
984
  clear(root);
984
985
  const wrapper = makeElement('div', { className: 'objective-editor-root', attrs: { 'data-contract-version': OBJECTIVE_EDITOR_CONTRACT_VERSION, 'data-view': state.view ?? 'list' } });
985
- const header = makeElement('header', { className: 'objective-editor-header' });
986
- const copy = makeElement('div', { className: 'objective-editor-header-copy' });
986
+ const header = makeElement('header', { className: 'objective-editor-header bb-ws-page-head' });
987
+ const copy = makeElement('div', { className: 'objective-editor-header-copy bb-ws-page-copy' });
988
+ const guide = workspaceHelp(getDocument(), { label: '目的と評価基準', text: '現状の理解(観測や仮説)とは分けて扱います。' });
989
+ guide.className += ' is-page-guide';
990
+ guide.children[0].textContent = '?';
987
991
  append(copy,
988
- makeElement('div', { className: 'objective-editor-eyebrow', text: 'BRAINBASE / OBJECTIVES' }),
989
992
  makeElement('h1', { text: '目的と評価基準' }),
990
- makeElement('p', { text: '目指す状態と評価基準を、版つきで編集・確認します。現状の理解(観測や仮説)とは分けて扱います。' }),
993
+ makeElement('p', { text: '目指す状態と評価基準を、版つきで編集・確認します。' }),
991
994
  );
995
+ const side = makeElement('div', { className: 'bb-ws-page-side' });
992
996
  const headerStatus = state.save.state !== 'idle' ? state.save.state : state.objectives.state;
993
- header.append(copy, statusBadge(headerStatus));
997
+ side.append(statusBadge(headerStatus), guide);
998
+ header.append(copy, side);
994
999
  wrapper.append(header);
995
1000
  const toolbar = makeElement('div', { className: 'objective-editor-toolbar' });
996
1001
  const tabs = [
@@ -5,7 +5,12 @@
5
5
  */
6
6
  .knowledge-outcome { display: grid; gap: 20px; color: var(--bb-color-ink, #17221c); }
7
7
  .knowledge-outcome-head { padding: 24px; border: 1px solid var(--bb-color-border, #dce5df); border-radius: 16px; background: linear-gradient(135deg, var(--bb-color-header-start, #f7faf8), var(--bb-color-header-end, #eef5f0)); }
8
- .knowledge-outcome-head h2 { margin: 4px 0 8px; font-size: clamp(1.45rem, 3vw, 2rem); }
8
+ .knowledge-outcome-head h1 {
9
+ margin: 4px 0 8px;
10
+ font-size: var(--bb-page-title-font-size);
11
+ font-weight: var(--bb-page-title-font-weight);
12
+ line-height: var(--bb-page-title-line-height);
13
+ }
9
14
  .knowledge-eyebrow { color: var(--bb-color-eyebrow, #47715a); font-size: .72rem; font-weight: var(--bb-font-weight-medium); letter-spacing: .12em; text-transform: uppercase; }
10
15
  .knowledge-outcome-nav,
11
16
  .knowledge-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
@@ -1,4 +1,4 @@
1
- import { workspaceDetailDrawer, workspaceButton } from './workspace-kit.js';
1
+ import { workspaceDetailDrawer, workspaceButton, workspaceHelp } from './workspace-kit.js';
2
2
  import { knowledgeDirectoryToolbar, knowledgeRegistrationChooser } from './knowledge-directory.js';
3
3
 
4
4
  /*
@@ -1582,15 +1582,18 @@ export function createKnowledgeOverviewController(options = {}) {
1582
1582
  clear(root);
1583
1583
  const shell = makeElement('div', { className: 'knowledge-outcome knowledge-overview' });
1584
1584
  if (options.presentation === 'directory') shell.classList.add('knowledge-directory');
1585
- const header = makeElement('header', { className: 'knowledge-outcome-head' });
1586
- const headerMain = makeElement('div', { className: 'knowledge-header-main' });
1585
+ const header = makeElement('header', { className: 'knowledge-outcome-head bb-ws-page-head' });
1586
+ const headerMain = makeElement('div', { className: 'knowledge-header-main bb-ws-page-copy' });
1587
1587
  append(headerMain,
1588
- makeElement('span', { className: 'knowledge-eyebrow', text: 'Brainbase Outcome' }),
1589
- makeElement('h2', { text: '知識・判断' }),
1590
- makeElement('p', { text: '見られるすべてのプロジェクトと組織共通の知識・判断を一覧にします。登録や改訂は、プロジェクトを選ぶとできます。' }),
1588
+ makeElement('h1', { text: '知識・判断' }),
1589
+ makeElement('p', { text: '見られる範囲の知識・判断を一覧にします。' }),
1591
1590
  );
1592
1591
  const headerMeta = makeElement('div', { className: 'knowledge-header-meta' });
1592
+ const guide = workspaceHelp(getDocument(), { label: '知識・判断', text: '見られるすべてのプロジェクトと組織共通の知識・判断を一覧にします。登録や改訂は、プロジェクトを選ぶとできます。' });
1593
+ guide.className += ' is-page-guide';
1594
+ guide.children[0].textContent = '?';
1593
1595
  renderKnowledgeProjectFilter(headerMeta, { projects: options.projects, selected: null }, { onChange: (code) => openProject(code, { reason: 'filter' }) });
1596
+ headerMeta.append(guide);
1594
1597
  append(header, headerMain, headerMeta);
1595
1598
  if (options.presentation !== 'directory') shell.append(header);
1596
1599
  const body = makeElement('div', { className: 'knowledge-outcome-body knowledge-workspace', attrs: { 'data-view': 'discovery' } });
@@ -1793,11 +1796,10 @@ export function createKnowledgeOutcomeController(options = {}) {
1793
1796
  clear(root);
1794
1797
  const shell = makeElement('div', { className: 'knowledge-outcome' });
1795
1798
  if (options.presentation === 'directory') shell.classList.add('knowledge-directory');
1796
- const header = makeElement('header', { className: 'knowledge-outcome-head' });
1797
- const headerMain = makeElement('div', { className: 'knowledge-header-main' });
1799
+ const header = makeElement('header', { className: 'knowledge-outcome-head bb-ws-page-head' });
1800
+ const headerMain = makeElement('div', { className: 'knowledge-header-main bb-ws-page-copy' });
1798
1801
  append(headerMain,
1799
- makeElement('span', { className: 'knowledge-eyebrow', text: 'Brainbase Outcome' }),
1800
- makeElement('h2', { text: '知識・判断を成果へつなぐ' }),
1802
+ makeElement('h1', { text: '知識・判断を成果へつなぐ' }),
1801
1803
  makeElement('p', { text: '正本を探し、由来と状態を確認して、必要なときだけ更新します。' }),
1802
1804
  );
1803
1805
  const headerMeta = makeElement('div', { className: 'knowledge-header-meta' });
@@ -43,12 +43,12 @@
43
43
  .bb-ws-page-head h1 {
44
44
  margin: 0;
45
45
  color: var(--bb-color-ink);
46
- font-size: clamp(32px, 3.5vw, 44px);
47
- font-weight: var(--bb-font-weight-medium);
48
- line-height: 1.1;
49
46
  letter-spacing: -.055em;
50
47
  word-break: keep-all;
51
48
  overflow-wrap: break-word;
49
+ font-size: var(--bb-page-title-font-size);
50
+ font-weight: var(--bb-page-title-font-weight);
51
+ line-height: var(--bb-page-title-line-height);
52
52
  }
53
53
 
54
54
  .bb-ws-lead {
@@ -464,10 +464,6 @@
464
464
  gap: 16px;
465
465
  }
466
466
 
467
- .bb-ws-page-head h1 {
468
- font-size: 34px;
469
- }
470
-
471
467
  .bb-ws-notice {
472
468
  grid-template-columns: minmax(0, 1fr);
473
469
  gap: 4px;
@@ -690,7 +686,7 @@
690
686
  .bb-ws-detail-closebar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: flex-end; min-height: 44px; padding: 4px 16px; box-sizing: border-box; background: var(--bb-color-panel); border-bottom: 1px solid var(--bb-color-border); }
691
687
  .bb-ws-detail-content { padding: 20px 24px 32px; }
692
688
  .bb-ws-has-topbar .bb-ws-page-head h1,
693
- .bb-ws-has-topbar .knowledge-outcome-head h2,
689
+ .bb-ws-has-topbar .knowledge-outcome-head h1,
694
690
  .bb-ws-has-topbar .bb-minutes-heading h1 { display: none; }
695
691
  @media (max-width: 760px) { .bb-ws-detail-content { padding: 16px 16px 32px; } }
696
692
 
@@ -994,6 +990,14 @@
994
990
 
995
991
  .bb-ws-neutral-controls .bb-ws-filter-icon-trigger.bb-ws-filter-icon-trigger:is(:hover,:focus,:focus-visible,[aria-expanded="true"]) { border-color: var(--bb-color-border); box-shadow: none; }
996
992
 
993
+ /* Page explanations open into the content, clear of the sticky title bar. */
994
+ .bb-ws-help.is-page-guide .bb-ws-help-bubble { top: calc(100% + 8px); bottom: auto; left: auto; right: 0; transform: translateY(-4px); }
995
+ .bb-ws-help.is-page-guide:not(.is-dismissed):is(:hover, :focus-within, .is-open) .bb-ws-help-bubble { transform: translateY(0); }
996
+ .bb-ws-help.is-page-guide .bb-ws-help-bubble::after { top: auto; bottom: 100%; }
997
+ /* Keep the guide at the right edge even when a host header becomes one column.
998
+ Specificity also preserves this placement when host CSS is loaded last. */
999
+ .bb-ws-page-head > :has(> .bb-ws-help.is-page-guide) { justify-content: flex-end; align-self: stretch; }
1000
+
997
1001
  /* Explicit filter choices: selection is a check, hover alone paints the row. */
998
1002
  .bb-ws-filter-popover button.bb-ws-filter-option[role] { display: grid; grid-template-columns: var(--bb-space-4) minmax(0, 1fr) auto; gap: var(--bb-space-2); color: var(--bb-color-ink); background: transparent; }
999
1003
  .bb-ws-filter-popover button.bb-ws-filter-option[aria-checked="true"] { background: transparent; color: var(--bb-color-ink); }
@@ -50,7 +50,7 @@ function appendContent(parent, doc, content) {
50
50
  }
51
51
 
52
52
  /** Breadcrumb, h1, lead, source label and actions, as on the organization screens. */
53
- export function workspacePageHeader(doc, { crumbs = [], title, lead, source, actions = [] } = {}) {
53
+ export function workspacePageHeader(doc, { crumbs = [], title, lead, help, preserveLead = false, source, actions = [] } = {}) {
54
54
  const wrap = el(doc, 'div', { className: 'bb-ws-page' });
55
55
  if (crumbs.length > 0) {
56
56
  const breadcrumb = el(doc, 'nav', { className: 'bb-ws-breadcrumb', attrs: { 'aria-label': 'パンくず' } });
@@ -63,12 +63,22 @@ export function workspacePageHeader(doc, { crumbs = [], title, lead, source, act
63
63
  const head = el(doc, 'header', { className: 'bb-ws-page-head' });
64
64
  const copy = el(doc, 'div', { className: 'bb-ws-page-copy' });
65
65
  copy.append(el(doc, 'h1', { text: title }));
66
- if (lead) copy.append(el(doc, 'p', { className: 'bb-ws-lead', text: lead }));
66
+ const description = typeof lead === 'string' ? lead.trim() : '';
67
+ const sentences = description.match(/[^。!?!?]+[。!?!?]?/gu) ?? [];
68
+ const longLead = !preserveLead && (description.length > 60 || sentences.length > 1);
69
+ const summary = longLead ? (sentences[0]?.length <= 60 ? sentences[0] : '') : description;
70
+ if (summary) copy.append(el(doc, 'p', { className: 'bb-ws-lead', text: summary }));
67
71
  head.append(copy);
68
72
  const side = el(doc, 'div', { className: 'bb-ws-page-side' });
73
+ if (help || longLead) {
74
+ const guide = workspaceHelp(doc, { label: title, text: [longLead ? description : '', help].filter(Boolean).join('\n\n') });
75
+ guide.className += ' is-page-guide';
76
+ guide.children[0].textContent = '?';
77
+ side.append(guide);
78
+ }
69
79
  if (source) side.append(el(doc, 'span', { className: 'bb-ws-source', text: source }));
70
80
  if (actions.length > 0) side.append(workspaceActions(doc, actions));
71
- if (source || actions.length > 0) head.append(side);
81
+ if (help || longLead || source || actions.length > 0) head.append(side);
72
82
  wrap.append(head);
73
83
  return wrap;
74
84
  }
@@ -386,6 +386,13 @@
386
386
  backdrop-filter: blur(4px);
387
387
  }
388
388
 
389
+ .bb-world-legend-panel p {
390
+ margin: 0;
391
+ font-size: 12px;
392
+ line-height: 1.6;
393
+ color: var(--bb-color-ink);
394
+ }
395
+
389
396
  .bb-world-legend-panel[hidden] {
390
397
  display: none;
391
398
  }
@@ -1677,7 +1677,8 @@ export function createWorldView({ root, rail, page, presentation = 'standard', d
1677
1677
  const header = workspacePageHeader(doc, {
1678
1678
  crumbs: page?.crumbs ?? ['あなたのBrainbase', '世界'],
1679
1679
  title: '世界',
1680
- lead: '事業を都市、案件を区画、判断の種類を広場の建物として描いています。都市を選ぶとその事業の区画に入り、仕事(タスク)が通りに面した現場として建ち、記録から把握できていないことが街の様子で見えます。見るための画面で、ここからは何も書き換えません。',
1680
+ lead: '見るための画面で、ここからは何も書き換えません。',
1681
+ preserveLead: true,
1681
1682
  source: page?.source ?? null,
1682
1683
  actions: [
1683
1684
  skyButton,
@@ -1747,7 +1748,7 @@ export function createWorldView({ root, rail, page, presentation = 'standard', d
1747
1748
  // behaviour as the canvas help button. The information is kept, just tucked away.
1748
1749
  const legendPanel = el(doc, 'div', { className: 'bb-world-legend-panel', attrs: { id: `bb-world-legend-${++worldLegendSequence}` } });
1749
1750
  legendPanel.hidden = true;
1750
- legendPanel.append(legend, workLegend);
1751
+ legendPanel.append(el(doc, 'p', { text: '事業を都市、案件を区画、判断の種類を広場の建物として描いています。都市を選ぶとその事業の区画に入り、仕事(タスク)が通りに面した現場として建ち、記録から把握できていないことが街の様子で見えます。' }), legend, workLegend);
1751
1752
  const legendToggle = workspaceButton(doc, {
1752
1753
  text: '?',
1753
1754
  variant: 'quiet',