@unson/brainbase-mcp 0.50.31 → 0.51.0

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.
Files changed (51) hide show
  1. package/contracts/canonical-task/store-schema.sql +3 -0
  2. package/dist/automation-run.js +3 -2
  3. package/dist/canonical-task-postgres.js +3 -0
  4. package/dist/canonical-task-service.d.ts +6 -0
  5. package/dist/canonical-task-service.js +40 -1
  6. package/dist/company-os-learning-adoption.d.ts +9 -0
  7. package/dist/company-os-learning-adoption.js +50 -1
  8. package/dist/durable-waits.d.ts +30 -0
  9. package/dist/durable-waits.js +100 -94
  10. package/dist/foundation-public-provider.d.ts +3 -1
  11. package/dist/foundation-public-provider.js +2 -2
  12. package/dist/graph-corrections.d.ts +46 -1
  13. package/dist/graph-corrections.js +172 -1
  14. package/dist/judgment-event-outbox.d.ts +24 -2
  15. package/dist/judgment-event-outbox.js +92 -10
  16. package/dist/judgment-frame.js +2 -2
  17. package/dist/judgment-host.d.ts +4 -1
  18. package/dist/judgment-host.js +126 -14
  19. package/dist/judgment-task-progress.d.ts +41 -0
  20. package/dist/judgment-task-progress.js +18 -0
  21. package/dist/knowledge-continuation.js +7 -1
  22. package/dist/knowledge-lookup.js +43 -58
  23. package/dist/mcp-runtime.d.ts +9 -0
  24. package/dist/mcp-runtime.js +12 -4
  25. package/dist/meeting-automation-runtime.d.ts +52 -0
  26. package/dist/meeting-automation-runtime.js +46 -0
  27. package/dist/queue-task-tools.js +2 -2
  28. package/dist/routine-liveness.js +0 -1
  29. package/dist/routine-runtime.js +1 -1
  30. package/dist/server.d.ts +59 -85
  31. package/dist/server.js +44 -36
  32. package/dist/ssot.js +1 -1
  33. package/dist/testing/queue-task-tools-contract.js +1 -1
  34. package/dist/world-model-impact-index.d.ts +132 -0
  35. package/dist/world-model-impact-index.js +901 -0
  36. package/package.json +6 -18
  37. package/ui/judgment-history.css +13 -0
  38. package/ui/objective-editor.css +19 -2
  39. package/ui/objective-editor.js +6 -3
  40. package/ui/project-workspace.css +33 -26
  41. package/ui/workspace-kit.js +9 -7
  42. package/ui/world/world-view.css +65 -46
  43. package/ui/world/world-view.js +27 -18
  44. package/dist/execution-authority-http.d.ts +0 -30
  45. package/dist/execution-authority-http.js +0 -454
  46. package/dist/execution-authority.d.ts +0 -282
  47. package/dist/execution-authority.js +0 -867
  48. package/dist/resource-reservation-http.d.ts +0 -31
  49. package/dist/resource-reservation-http.js +0 -371
  50. package/dist/resource-reservations.d.ts +0 -221
  51. package/dist/resource-reservations.js +0 -577
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unson/brainbase-mcp",
3
- "version": "0.50.31",
3
+ "version": "0.51.0",
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",
@@ -387,10 +387,6 @@
387
387
  "types": "./dist/mcp-tool-schema-portability.d.ts",
388
388
  "import": "./dist/mcp-tool-schema-portability.js"
389
389
  },
390
- "./resource-reservations": {
391
- "types": "./dist/resource-reservations.d.ts",
392
- "import": "./dist/resource-reservations.js"
393
- },
394
390
  "./durable-waits": {
395
391
  "types": "./dist/durable-waits.d.ts",
396
392
  "import": "./dist/durable-waits.js"
@@ -407,10 +403,6 @@
407
403
  "types": "./dist/judgment-view-http.d.ts",
408
404
  "import": "./dist/judgment-view-http.js"
409
405
  },
410
- "./execution-authority-http": {
411
- "types": "./dist/execution-authority-http.d.ts",
412
- "import": "./dist/execution-authority-http.js"
413
- },
414
406
  "./server-support": {
415
407
  "types": "./dist/server-support.d.ts",
416
408
  "import": "./dist/server-support.js"
@@ -423,6 +415,10 @@
423
415
  "types": "./dist/company-os-impact-review.d.ts",
424
416
  "import": "./dist/company-os-impact-review.js"
425
417
  },
418
+ "./world-model-impact-index": {
419
+ "types": "./dist/world-model-impact-index.d.ts",
420
+ "import": "./dist/world-model-impact-index.js"
421
+ },
426
422
  "./streamable-http": {
427
423
  "types": "./dist/streamable-http.d.ts",
428
424
  "import": "./dist/streamable-http.js"
@@ -525,14 +521,6 @@
525
521
  "types": "./dist/problem-candidates.d.ts",
526
522
  "import": "./dist/problem-candidates.js"
527
523
  },
528
- "./resource-reservation-http": {
529
- "types": "./dist/resource-reservation-http.d.ts",
530
- "import": "./dist/resource-reservation-http.js"
531
- },
532
- "./execution-authority": {
533
- "types": "./dist/execution-authority.d.ts",
534
- "import": "./dist/execution-authority.js"
535
- },
536
524
  "./knowledge-continuation": {
537
525
  "types": "./dist/knowledge-continuation.d.ts",
538
526
  "import": "./dist/knowledge-continuation.js"
@@ -681,5 +669,5 @@
681
669
  "url": "https://github.com/Unson-LLC/brainbase/issues"
682
670
  },
683
671
  "homepage": "https://github.com/Unson-LLC/brainbase#readme",
684
- "gitHead": "6b864deb46fbb8ac8105f1f4e1f870afaf3e1264"
672
+ "gitHead": "8b9acad360928fd94db972da5861ea90044ea481"
685
673
  }
@@ -776,3 +776,16 @@
776
776
  color: var(--bb-color-accent-strong);
777
777
  font-weight: var(--bb-font-weight-medium);
778
778
  }
779
+
780
+ /* Explicit small warning/error treatments; details retain all coverage metadata. */
781
+ .bb-jh-banner.is-warning {
782
+ padding: 6px 10px;
783
+ border-left: 3px solid var(--bb-color-notice-warning);
784
+ background: linear-gradient(90deg, color-mix(in srgb, var(--bb-color-notice-warning) 18%, transparent), transparent), var(--bb-color-notice-background);
785
+ }
786
+ .bb-jh-notifications .bb-jh-banner.is-warning {
787
+ background: linear-gradient(90deg, color-mix(in srgb, var(--bb-color-notice-warning) 18%, transparent), transparent), var(--bb-color-notice-background);
788
+ }
789
+ .bb-jh-notifications .bb-jh-banner.is-danger {
790
+ background: linear-gradient(90deg, color-mix(in srgb, var(--bb-color-notice-danger) 18%, transparent), transparent), var(--bb-color-notice-background);
791
+ }
@@ -242,9 +242,9 @@ textarea.objective-editor-input { min-height: 5.4rem; resize: vertical; }
242
242
  .bb-objective-judgment.is-draft { color: var(--bb-color-warning); }
243
243
  .bb-objective-judgment.is-unresolved { color: var(--bb-color-quiet); font-weight: 500; }
244
244
  .bb-objective-story { margin-top: var(--bb-space-6); }
245
- .bb-objective-notice-body { display: grid; gap: var(--bb-space-2); min-width: 0; }
245
+ .bb-objective-notice-body { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
246
246
  .bb-objective-notice-body p { margin: 0; overflow-wrap: anywhere; }
247
- .bb-objective-notice-body .bb-ws-button { justify-self: start; }
247
+ .bb-objective-notice-body .bb-ws-button { min-height: 20px; padding: 0 5px; font-size: 11px; }
248
248
 
249
249
  .bb-objective-rail { display: block; }
250
250
  .bb-objective-rail > .bb-ws-notice { margin: var(--bb-space-4) 0 0; }
@@ -292,3 +292,20 @@ textarea.objective-editor-input { min-height: 5.4rem; resize: vertical; }
292
292
  .objective-editor-criterion-row { grid-template-columns: 1fr 1fr; }
293
293
  .objective-editor-criterion-row .objective-editor-button-danger { grid-column: 1 / -1; justify-self: start; }
294
294
  }
295
+
296
+ /* Keep scope/status notices compact, including host-supplied source notices. */
297
+ .bb-objective-workspace .bb-ws-notice,
298
+ .bb-objective-rail .bb-ws-notice {
299
+ grid-template-columns: auto minmax(0, 1fr);
300
+ gap: 6px 10px;
301
+ width: fit-content;
302
+ max-width: 100%;
303
+ box-sizing: border-box;
304
+ margin: 8px 0;
305
+ padding: 6px 10px;
306
+ line-height: 1.5;
307
+ }
308
+ @media (max-width: 760px) {
309
+ .bb-objective-workspace .bb-ws-notice,
310
+ .bb-objective-rail .bb-ws-notice { grid-template-columns: minmax(0, 1fr); }
311
+ }
@@ -1045,15 +1045,18 @@ function periodText(period, { compact = false } = {}) {
1045
1045
  return `${ledgerDate(period?.from) ?? '未設定'}〜${ledgerDate(period?.until, startYear) ?? '未設定'}`;
1046
1046
  }
1047
1047
 
1048
- /** A state as a kit notice: failures are alerts, and never read as zero items. */
1048
+ /** Recoverable states are warnings; blocked operations are errors, never zero items. */
1049
1049
  function workspaceStatusNotice(doc, value, { label, onRetry, retryLabel = '再試行' } = {}) {
1050
1050
  const normalized = typeof value === 'string' ? { state: value } : value ?? {};
1051
1051
  const status = normalizeState(normalized.state);
1052
1052
  const tone = status === 'verified' ? 'info'
1053
- : ['unknown', 'saved_unverified'].includes(status) ? 'warning'
1053
+ : ['unknown', 'saved_unverified', 'error_retryable'].includes(status) ? 'warning'
1054
1054
  : 'danger';
1055
1055
  const body = makeElement('div', { className: 'bb-objective-notice-body' });
1056
1056
  body.append(makeElement('p', { text: `${STATUS_LABELS[status] ?? STATUS_LABELS.unknown}:${normalized.message ?? STATUS_LABELS[status] ?? '状態を確認できません。'}` }));
1057
+ if (['unknown', 'error_retryable'].includes(status)) {
1058
+ body.append(makeElement('p', { text: 'データが0件とは確認できていません。再読込して確かめてください。' }));
1059
+ }
1057
1060
  if (status === 'conflict' && normalized.currentRevision) {
1058
1061
  body.append(makeElement('p', { text: `現在の版: ${normalized.currentRevision}。入力は残しています。現在の版を確かめてから編集してください。` }));
1059
1062
  }
@@ -1366,7 +1369,7 @@ function portMethod(port, name) {
1366
1369
  * Host options used only in the workspace layout (when `rail` is given); the
1367
1370
  * tabs layout without `rail` ignores them:
1368
1371
  * - `title` / `lead`: replace the page head's 目的と現状 and its lead.
1369
- * - `sourceNotice: { label, text }`: a notice right after the page head
1372
+ * - `sourceNotice: { label, text, tone? }`: a notice right after the page head
1370
1373
  * (`text` is a string or an element). Default: none.
1371
1374
  * - `pageActions: [{ text, variant, onClick, disabled }]`: host-owned buttons in
1372
1375
  * the page head after 再読込 / 新しい目的.
@@ -628,6 +628,9 @@ button.bb-pkw-context-task-title:focus-visible { outline: 3px solid var(--bb-col
628
628
  .bb-pkw-dense-overview {
629
629
  display: grid;
630
630
  gap: 0;
631
+ /* The overview sits beside a rail and, in hosts, a detail panel, so its
632
+ width does not follow the viewport. Its metrics follow this width. */
633
+ container: bb-pkw-overview / inline-size;
631
634
  }
632
635
 
633
636
  .bb-pkw-dense-intro {
@@ -694,6 +697,36 @@ button.bb-pkw-context-task-title:focus-visible { outline: 3px solid var(--bb-col
694
697
  letter-spacing: -.03em;
695
698
  }
696
699
 
700
+ /* Four 30px values need about 150px each. Below that the overview shows two
701
+ per row, whatever the viewport, so a value is never broken inside a word. */
702
+ @container bb-pkw-overview (max-width: 600px) {
703
+ .bb-pkw-dense-metrics {
704
+ grid-template-columns: repeat(2, minmax(0, 1fr));
705
+ }
706
+
707
+ .bb-pkw-dense-metric,
708
+ .bb-pkw-dense-metric:first-child {
709
+ padding: 14px 12px;
710
+ }
711
+
712
+ .bb-pkw-dense-metric:nth-child(odd) {
713
+ padding-left: 0;
714
+ }
715
+
716
+ .bb-pkw-dense-metric:nth-child(even) {
717
+ border-right: 0;
718
+ padding-right: 0;
719
+ }
720
+
721
+ .bb-pkw-dense-metric:nth-child(-n + 2) {
722
+ border-bottom: 1px solid var(--bb-color-border);
723
+ }
724
+
725
+ .bb-pkw-dense-metric:last-child {
726
+ border-bottom: 0;
727
+ }
728
+ }
729
+
697
730
  .bb-pkw-dense-grid {
698
731
  display: grid;
699
732
  grid-template-columns: minmax(0, 1fr);
@@ -1066,32 +1099,6 @@ button.bb-pkw-context-task-title:focus-visible { outline: 3px solid var(--bb-col
1066
1099
  font-size: 34px;
1067
1100
  }
1068
1101
 
1069
- .bb-pkw-dense-metrics {
1070
- grid-template-columns: repeat(2, minmax(0, 1fr));
1071
- }
1072
-
1073
- .bb-pkw-dense-metric,
1074
- .bb-pkw-dense-metric:first-child {
1075
- padding: 14px 12px;
1076
- }
1077
-
1078
- .bb-pkw-dense-metric:nth-child(odd) {
1079
- padding-left: 0;
1080
- }
1081
-
1082
- .bb-pkw-dense-metric:nth-child(even) {
1083
- border-right: 0;
1084
- padding-right: 0;
1085
- }
1086
-
1087
- .bb-pkw-dense-metric:nth-child(-n + 2) {
1088
- border-bottom: 1px solid var(--bb-color-border);
1089
- }
1090
-
1091
- .bb-pkw-dense-metric:last-child {
1092
- border-bottom: 0;
1093
- }
1094
-
1095
1102
  .bb-pkw-dense-grid,
1096
1103
  .bb-pkw-detail-columns {
1097
1104
  grid-template-columns: minmax(0, 1fr);
@@ -196,8 +196,9 @@ export function workspaceDetailDrawer(doc, { title = '詳細', opener, onClose,
196
196
 
197
197
  /** A notice with a short label, like 接続範囲 on the organization screens. */
198
198
  export function workspaceNotice(doc, { label, text, tone = 'info', role } = {}) {
199
- const notice = el(doc, 'div', { className: `bb-ws-notice is-${tone}`, attrs: { role: role ?? (tone === 'info' ? undefined : 'alert') } });
200
- if (label) notice.append(el(doc, 'strong', { text: label }));
199
+ const notice = el(doc, 'div', { className: `bb-ws-notice is-${tone}`, attrs: { role: role ?? (tone === 'danger' ? 'alert' : tone === 'warning' ? 'status' : undefined) } });
200
+ const severity = tone === 'warning' ? '注意' : tone === 'danger' ? 'エラー' : '';
201
+ if (label || severity) notice.append(el(doc, 'strong', { text: [severity, label].filter(Boolean).join(':') }));
201
202
  appendContent(notice, doc, text);
202
203
  return notice;
203
204
  }
@@ -231,13 +232,13 @@ export function workspaceInlineNotice(doc, { text, tone = 'success', icon, actio
231
232
 
232
233
  /**
233
234
  * The notice a host passes to a part in place of (or in addition to) the
234
- * part's own: `{ label, text }`, where `text` is a string or an element. Null
235
+ * part's own: `{ label, text, tone? }`, where `text` is a string or an element. Null
235
236
  * when the host passed none.
236
237
  */
237
238
  export function workspaceHostNotice(doc, notice) {
238
239
  if (!notice || typeof notice !== 'object' || Array.isArray(notice)) return null;
239
240
  const label = typeof notice.label === 'string' && notice.label.trim() ? notice.label.trim() : undefined;
240
- return workspaceNotice(doc, { label, text: notice.text });
241
+ return workspaceNotice(doc, { label, text: notice.text, tone: ['warning', 'danger'].includes(notice.tone) ? notice.tone : 'info' });
241
242
  }
242
243
 
243
244
  /** A host's extra page-head buttons, `[{ text, variant, onClick, disabled }]`, as `workspaceActions` items. */
@@ -961,10 +962,11 @@ export function workspaceDismissNotification(card, onDismiss) {
961
962
 
962
963
  /** Persistent notification, closed unless `open`. The caller owns its lifecycle. */
963
964
  export function workspaceErrorCard(doc, { title, message, tone = 'danger', onRetry, open = false } = {}) {
964
- const card = workspaceNotificationCard(doc, { tone, className: 'bb-ws-error-card', role: 'listitem' });
965
+ const card = workspaceNotificationCard(doc, { tone, className: 'bb-ws-error-card', role: tone === 'warning' ? 'status' : 'alert' });
965
966
  const details = el(doc, 'details'); details.open = open;
966
- const summary = el(doc, 'summary', { attrs: { 'aria-label': `${title}の通知` } });
967
- summary.append(el(doc, 'span', { className: 'bb-ws-error-symbol', text: '!', attrs: { 'aria-hidden': 'true' } }), el(doc, 'span', { text: title }));
967
+ const severity = tone === 'warning' ? '注意' : 'エラー';
968
+ const summary = el(doc, 'summary', { attrs: { 'aria-label': `${severity}:${title}の通知` } });
969
+ summary.append(el(doc, 'span', { className: 'bb-ws-error-symbol', text: tone === 'warning' ? '△' : '×', attrs: { 'aria-hidden': 'true' } }), el(doc, 'span', { text: title }));
968
970
  details.append(summary, el(doc, 'p', { text: message })); card.append(details);
969
971
  if (onRetry) card.append(workspaceButton(doc, { text: '再試行', attrs: { 'aria-label': `${title}を再試行` }, onClick: onRetry }));
970
972
  return card;
@@ -357,52 +357,6 @@
357
357
  display: none;
358
358
  }
359
359
 
360
- /* RQ-003: the "?" disclosure and its panel sit above the canvas. The stage's
361
- first child canvas fills its height and the stage clips overflow, so these
362
- must be absolutely positioned to stay visible and clickable (not in flow). */
363
- .bb-world-legend-toggle {
364
- position: absolute;
365
- top: var(--bb-space-3);
366
- right: var(--bb-space-3);
367
- z-index: 3;
368
- }
369
-
370
- .bb-world-legend-panel {
371
- position: absolute;
372
- top: calc(var(--bb-space-3) + 42px);
373
- right: var(--bb-space-3);
374
- z-index: 3;
375
- max-width: min(360px, calc(100% - 24px));
376
- max-height: calc(100% - 80px);
377
- overflow: auto;
378
- display: flex;
379
- flex-direction: column;
380
- gap: var(--bb-space-2);
381
- padding: var(--bb-space-3);
382
- background: rgb(255 255 255 / 95%);
383
- border: 1px solid var(--bb-color-border);
384
- border-radius: var(--bb-radius-md);
385
- box-shadow: var(--bb-shadow);
386
- backdrop-filter: blur(4px);
387
- }
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
-
396
- .bb-world-legend-panel[hidden] {
397
- display: none;
398
- }
399
-
400
- /* Inside the panel the legend is static, not an overlay pinned to the stage. */
401
- .bb-world-legend-panel .bb-world-legend {
402
- position: static;
403
- inset: auto;
404
- }
405
-
406
360
  /* RQ-006: the header sky switch is an icon button. The icon reuses the canvas
407
361
  artwork, so its SVG needs the same explicit size or it would balloon and
408
362
  break the header (the canvas rule only targets .bb-world-canvas-sky-icon). */
@@ -734,6 +688,71 @@
734
688
  .bb-world-label.is-exit.is-unknown,
735
689
  .bb-world-label.is-exit.is-unavailable { color: var(--bb-color-muted); }
736
690
 
691
+ /* Standard presentation help stays above both world and district canvases. */
692
+ .bb-world-legend-toggle {
693
+ position: absolute;
694
+ right: var(--bb-space-3);
695
+ z-index: 6;
696
+ color: var(--bb-color-ink);
697
+ background: var(--bb-color-panel);
698
+ border: 1px solid var(--bb-color-border);
699
+ border-radius: var(--bb-radius-sm);
700
+ top: var(--bb-space-3);
701
+ width: 40px;
702
+ height: 40px;
703
+ font: inherit;
704
+ cursor: pointer;
705
+ }
706
+
707
+ .bb-world-legend-panel {
708
+ position: absolute;
709
+ right: var(--bb-space-3);
710
+ z-index: 6;
711
+ color: var(--bb-color-ink);
712
+ background: var(--bb-color-panel);
713
+ border: 1px solid var(--bb-color-border);
714
+ border-radius: var(--bb-radius-sm);
715
+ top: calc(var(--bb-space-3) + 48px);
716
+ width: min(440px, calc(100% - 2 * var(--bb-space-3)));
717
+ box-sizing: border-box;
718
+ max-height: calc(100% - 72px);
719
+ overflow: auto;
720
+ padding: var(--bb-space-3);
721
+ }
722
+
723
+ .bb-world-legend-panel p {
724
+ margin: 0;
725
+ font-size: 12px;
726
+ line-height: 1.6;
727
+ color: var(--bb-color-ink);
728
+ }
729
+
730
+ .bb-world-legend-panel[hidden] { display: none; }
731
+
732
+ .bb-world-legend-panel .bb-world-legend {
733
+ position: static;
734
+ inset: auto;
735
+ margin-top: var(--bb-space-3);
736
+ }
737
+
738
+ .bb-world-legend-toggle:focus-visible,
739
+ .bb-world-legend-panel:focus-visible {
740
+ outline: 2px solid var(--bb-color-accent);
741
+ outline-offset: 2px;
742
+ }
743
+ /* No help animation: opening and closing also respects reduced motion. */
744
+
745
+ .bb-world-stage.is-fallback {
746
+ height: auto;
747
+ min-height: 360px;
748
+ padding: 60px var(--bb-space-3) var(--bb-space-3);
749
+ }
750
+
751
+ /* Notices must reserve their full height before the list, including wrapped text. */
752
+ .bb-world-stage.is-fallback .bb-world-hud {
753
+ position: static;
754
+ max-width: none;
755
+ }
737
756
 
738
757
  /*
739
758
  * The pulse of the work (story-world-three-scales-v1): the panel whose contents follow the scale the
@@ -44,12 +44,12 @@ import {
44
44
  workspaceButton,
45
45
  } from '../../workspace-kit.js';
46
46
 
47
- let worldLegendSequence = 0;
48
-
49
47
  export const WORLD_VIEW_CONTRACT_VERSION = 'brainbase.world-view.v0';
50
48
  /** Optional full-canvas presentation; the standard host contract remains unchanged. */
51
49
  export const WORLD_CANVAS_PRESENTATION_VERSION = 'brainbase.world-canvas.v1';
52
50
 
51
+ let legendPanelSequence = 0;
52
+
53
53
  const STATE_LABELS = Object.freeze({ delegated: '任せている', verifying: '確かめ中', returned: '戻している' });
54
54
  const STATE_COLORS = Object.freeze({ delegated: 0x087d62, verifying: 0xc99a3a, returned: 0xd92335 });
55
55
  const REASON_LABELS = Object.freeze({
@@ -1779,23 +1779,32 @@ export function createWorldView({ root, rail, page, presentation = 'standard', d
1779
1779
  if (page?.source) help.append(el(doc, 'p', { text: page.source }));
1780
1780
  canvasUI.setHelp([help]);
1781
1781
  } else {
1782
- // The legend is no longer a permanent overlay (RQ-003); it folds into a small
1783
- // "?" disclosure, closed by default, with the same keyboard and aria-expanded
1784
- // behaviour as the canvas help button. The information is kept, just tucked away.
1785
- const legendPanel = el(doc, 'div', { className: 'bb-world-legend-panel', attrs: { id: `bb-world-legend-${++worldLegendSequence}` } });
1782
+ const panelId = `bb-world-legend-${++legendPanelSequence}`;
1783
+ const legendPanel = el(doc, 'section', {
1784
+ className: 'bb-world-legend-panel',
1785
+ attrs: { id: panelId, 'aria-label': '世界の見方と凡例', tabindex: '-1' },
1786
+ });
1786
1787
  legendPanel.hidden = true;
1788
+ legendPanel.inert = true;
1789
+ workLegend.hidden = false;
1787
1790
  legendPanel.append(el(doc, 'p', { text: '事業を都市、案件を区画、判断の種類を広場の建物として描いています。都市を選ぶとその事業の区画に入り、仕事(タスク)が通りに面した現場として建ち、記録から把握できていないことが街の様子で見えます。' }), legend, workLegend, el(doc, 'p', { className: 'bb-world-legend-pulse', text: '左下の「いまの動き」は、世界・事業・通り(仕事の集まり)の順に、見ている階層の動きを出します。「進行中」「待ち」はタスクの記録の言葉で、AIを「動いている」と出すのは、進行中のタスクと5分以内の稼働の知らせが一致したときだけです。' }));
1788
- const legendToggle = workspaceButton(doc, {
1789
- text: '?',
1790
- variant: 'quiet',
1791
- attrs: { 'aria-label': '世界の見方と凡例', title: '世界の見方と凡例', 'aria-controls': legendPanel.id, 'aria-expanded': 'false' },
1792
- onClick: () => {
1793
- const open = legendPanel.hidden;
1794
- legendPanel.hidden = !open;
1795
- legendToggle.setAttribute('aria-expanded', String(open));
1796
- },
1791
+ const legendToggle = el(doc, 'button', {
1792
+ className: 'bb-world-legend-toggle', text: '?',
1793
+ attrs: { type: 'button', title: '世界の見方と凡例', 'aria-label': '世界の見方と凡例', 'aria-controls': panelId, 'aria-expanded': 'false' },
1794
+ });
1795
+ const setLegendOpen = (open) => {
1796
+ legendPanel.hidden = !open;
1797
+ legendPanel.inert = !open;
1798
+ legendToggle.setAttribute('aria-expanded', String(open));
1799
+ (open ? legendPanel : legendToggle).focus?.({ preventScroll: true });
1800
+ };
1801
+ legendToggle.addEventListener('click', () => setLegendOpen(legendPanel.hidden));
1802
+ legendPanel.addEventListener('keydown', (event) => {
1803
+ if (event.key !== 'Escape' || event.defaultPrevented) return;
1804
+ event.preventDefault();
1805
+ event.stopPropagation();
1806
+ setLegendOpen(false);
1797
1807
  });
1798
- legendToggle.classList.add('bb-world-legend-toggle');
1799
1808
  stage.append(notices, legendToggle, legendPanel);
1800
1809
  wrap.append(header, stage);
1801
1810
  }
@@ -2872,8 +2881,8 @@ export function createWorldView({ root, rail, page, presentation = 'standard', d
2872
2881
  restoreSelection();
2873
2882
  void loadWorkSummary(note);
2874
2883
  } else {
2875
- stage.hidden = true;
2876
- renderFallbackList(doc, wrap, businesses, rows, exitSlot);
2884
+ stage.classList.add('is-fallback');
2885
+ renderFallbackList(doc, stage, businesses, rows, exitSlot);
2877
2886
  }
2878
2887
  for (const business of exitsEnabled ? businesses : []) loadExits(business);
2879
2888
  return;
@@ -1,30 +0,0 @@
1
- import type { IncomingMessage, ServerResponse } from 'node:http';
2
- import { ExecutionAuthorityService, type ExecutionAttribution, type ExecutionProblemReference } from './execution-authority.js';
3
- type MaybePromise<T> = T | Promise<T>;
4
- /** Context resolved by the host after authentication and tenant selection. */
5
- export interface TrustedExecutionAuthorityRequestContext {
6
- tenantId: string;
7
- principal: string;
8
- scopeId: string;
9
- /** A non-empty value means that the host already verified the mutation origin. */
10
- verifiedMutationOrigin?: string;
11
- /** Resolved by the host from authentication. Request bodies cannot supply it. */
12
- attribution?: ExecutionAttribution;
13
- }
14
- /** The factory is the boundary where a host binds a service to its trusted context. */
15
- export type ExecutionAuthorityServiceFactory = (context: TrustedExecutionAuthorityRequestContext) => MaybePromise<Pick<ExecutionAuthorityService, 'start' | 'readIntent'> & Partial<Pick<ExecutionAuthorityService, 'register' | 'reportEffect'>>>;
16
- export interface ExecutionAuthorityMutationVerificationInput {
17
- request: IncomingMessage;
18
- context: TrustedExecutionAuthorityRequestContext;
19
- }
20
- export interface ExecutionAuthorityHttpOptions {
21
- serviceFactory: ExecutionAuthorityServiceFactory;
22
- basePath?: string;
23
- bodyLimitBytes?: number;
24
- /** Required for hosts that do not attach verifiedMutationOrigin to context. */
25
- verifyMutationRequest?: (input: ExecutionAuthorityMutationVerificationInput) => MaybePromise<boolean>;
26
- }
27
- /** A composable route handler. `false` means that the request is outside this route. */
28
- export type ExecutionAuthorityHttpHandler = (request: IncomingMessage, response: ServerResponse, context: TrustedExecutionAuthorityRequestContext | null) => Promise<boolean>;
29
- export declare function createExecutionAuthorityHttpHandler(options: ExecutionAuthorityHttpOptions): ExecutionAuthorityHttpHandler;
30
- export type { ExecutionProblemReference };