@fantasticit/sumi 0.15.0 → 0.15.2

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 (86) hide show
  1. package/dist/host-messages.d.ts +6 -0
  2. package/dist/host-messages.js +8 -0
  3. package/dist/host-messages.js.map +1 -0
  4. package/dist/host-transcripts.d.ts +5 -0
  5. package/dist/host-transcripts.js +86 -0
  6. package/dist/host-transcripts.js.map +1 -0
  7. package/dist/hub/board.d.ts +43 -1
  8. package/dist/hub/board.js +87 -13
  9. package/dist/hub/board.js.map +1 -1
  10. package/dist/hub/page-icons.d.ts +1 -0
  11. package/dist/hub/page-icons.js +5 -0
  12. package/dist/hub/page-icons.js.map +1 -0
  13. package/dist/hub/page-model.d.ts +102 -0
  14. package/dist/hub/page-model.js +302 -0
  15. package/dist/hub/page-model.js.map +1 -0
  16. package/dist/hub/page-overlays.d.ts +1 -0
  17. package/dist/hub/page-overlays.js +115 -0
  18. package/dist/hub/page-overlays.js.map +1 -0
  19. package/dist/hub/page-sessions.d.ts +1 -0
  20. package/dist/hub/page-sessions.js +588 -0
  21. package/dist/hub/page-sessions.js.map +1 -0
  22. package/dist/hub/page-style.d.ts +1 -0
  23. package/dist/hub/page-style.js +346 -0
  24. package/dist/hub/page-style.js.map +1 -0
  25. package/dist/hub/page-tips.d.ts +2 -0
  26. package/dist/hub/page-tips.js +93 -0
  27. package/dist/hub/page-tips.js.map +1 -0
  28. package/dist/hub/page-usage.d.ts +2 -0
  29. package/dist/hub/page-usage.js +360 -0
  30. package/dist/hub/page-usage.js.map +1 -0
  31. package/dist/hub/page-workbench.d.ts +1 -0
  32. package/dist/hub/page-workbench.js +901 -0
  33. package/dist/hub/page-workbench.js.map +1 -0
  34. package/dist/hub/pages.d.ts +1 -0
  35. package/dist/hub/pages.js +68 -182
  36. package/dist/hub/pages.js.map +1 -1
  37. package/dist/hub/server.js +2 -4
  38. package/dist/hub/server.js.map +1 -1
  39. package/dist/hub/snapshot.d.ts +9 -0
  40. package/dist/hub/snapshot.js +97 -20
  41. package/dist/hub/snapshot.js.map +1 -1
  42. package/dist/hub/usage-summary.d.ts +36 -0
  43. package/dist/hub/usage-summary.js +76 -0
  44. package/dist/hub/usage-summary.js.map +1 -0
  45. package/dist/hub/usage.d.ts +50 -0
  46. package/dist/hub/usage.js +285 -0
  47. package/dist/hub/usage.js.map +1 -0
  48. package/dist/visualize-sessions.d.ts +6 -0
  49. package/dist/visualize-sessions.js +9 -2
  50. package/dist/visualize-sessions.js.map +1 -1
  51. package/dist/visualize.d.ts +6 -0
  52. package/dist/visualize.js +1 -1
  53. package/dist/visualize.js.map +1 -1
  54. package/node_modules/@sumi/create/package.json +2 -2
  55. package/node_modules/@sumi/kernel/package.json +2 -2
  56. package/node_modules/@sumi/plugin-sdk/dist/hub.d.ts +21 -2
  57. package/node_modules/@sumi/plugin-sdk/dist/hub.js +42 -0
  58. package/node_modules/@sumi/plugin-sdk/dist/hub.js.map +1 -1
  59. package/node_modules/@sumi/plugin-sdk/dist/snapshot.d.ts +5 -1
  60. package/node_modules/@sumi/plugin-sdk/dist/snapshot.js +28 -12
  61. package/node_modules/@sumi/plugin-sdk/dist/snapshot.js.map +1 -1
  62. package/node_modules/@sumi/plugin-sdk/package.json +1 -1
  63. package/node_modules/@sumi/plugins-core/package.json +3 -3
  64. package/node_modules/@sumi/plugins-governance/dist/hub-snapshot.d.ts +1 -1
  65. package/node_modules/@sumi/plugins-governance/dist/hub-snapshot.js +52 -10
  66. package/node_modules/@sumi/plugins-governance/dist/hub-snapshot.js.map +1 -1
  67. package/node_modules/@sumi/plugins-governance/dist/index.d.ts +1 -1
  68. package/node_modules/@sumi/plugins-governance/dist/index.js +1 -1
  69. package/node_modules/@sumi/plugins-governance/dist/index.js.map +1 -1
  70. package/node_modules/@sumi/plugins-governance/instructions/push.md +1 -1
  71. package/node_modules/@sumi/plugins-governance/package.json +4 -4
  72. package/node_modules/@sumi/plugins-openspec/package.json +6 -6
  73. package/node_modules/@sumi/plugins-precedent/package.json +3 -3
  74. package/node_modules/@sumi/plugins-review/dist/fix-list.js +2 -1
  75. package/node_modules/@sumi/plugins-review/dist/fix-list.js.map +1 -1
  76. package/node_modules/@sumi/plugins-review/dist/instructions.js +1 -1
  77. package/node_modules/@sumi/plugins-review/dist/instructions.js.map +1 -1
  78. package/node_modules/@sumi/plugins-review/dist/review.d.ts +13 -1
  79. package/node_modules/@sumi/plugins-review/dist/review.js +90 -3
  80. package/node_modules/@sumi/plugins-review/dist/review.js.map +1 -1
  81. package/node_modules/@sumi/plugins-review/dist/rubric-check.js +5 -20
  82. package/node_modules/@sumi/plugins-review/dist/rubric-check.js.map +1 -1
  83. package/node_modules/@sumi/plugins-review/dist/submission.js +11 -5
  84. package/node_modules/@sumi/plugins-review/dist/submission.js.map +1 -1
  85. package/node_modules/@sumi/plugins-review/package.json +6 -6
  86. package/package.json +10 -10
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page-workbench.js","sourceRoot":"","sources":["../../src/hub/page-workbench.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAk4BzC,CAAC"}
@@ -1,2 +1,3 @@
1
+ /** 所有工作台路径使用同一自包含页面,只有同源读取请求。 */
1
2
  export declare const BOARD_PAGE: string;
2
3
  export declare const SESSIONS_PAGE: string;
package/dist/hub/pages.js CHANGED
@@ -1,189 +1,75 @@
1
- // hub 的两个自包含只读页面:无外部字体与脚本,数据来自同源的 JSON 接口,动态内容一律用 textContent(图标是内联的常量 SVG,不含外部输入)。
2
- // 版式与配色来自设计稿;所有按钮只用于导航、筛选与展开,没有提交类控件。
3
- const STYLE = `:root{--bg:#F6F6F4;--surface:#fff;--soft:#EFEFEC;--line:#E4E4E0;--ink:#1F1F1C;--ink2:#3A3A36;--muted:#6B6B66;--faint:#8A8A84;--blue:#1D4ED8;--blue-soft:#EEF2FF;--blue-ink:#3730A3;--dev-bg:#F2F6FE;--dev-line:#C9D8F8;--orange:#C2410C;--auto-bg:#FFF8F1;--auto-line:#F1D9C2;--red:#B42318;--red-bg:#FDF1F0;--red-line:#F0C4BF;--green:#15803D;--green-soft:#E7F5EC;--green-ink:#166534;--shadow:0 1px 2px rgba(20,20,18,.05),0 1px 1px rgba(20,20,18,.03);--shadow-hover:0 4px 14px rgba(20,20,18,.10),0 1px 3px rgba(20,20,18,.06);--skel:#ECECE8;--skel-hi:#F6F6F3;color-scheme:light;font-family:Inter,"PingFang SC","Microsoft YaHei","Noto Sans SC",system-ui,sans-serif}
4
- @media (prefers-color-scheme:dark){:root{--bg:#161614;--surface:#20201D;--soft:#2A2A26;--line:#34342F;--ink:#ECECE8;--ink2:#D2D2CC;--muted:#A2A29A;--faint:#85857D;--blue:#7BA0FF;--blue-soft:#232A45;--blue-ink:#B6C6FF;--dev-bg:#1C2338;--dev-line:#2F3C63;--orange:#F0985F;--auto-bg:#2D241C;--auto-line:#4A3926;--red:#FF8E84;--red-bg:#3A2321;--red-line:#5F3531;--green:#6FCF8D;--green-soft:#1F3427;--green-ink:#8FE0A9;--shadow:0 1px 2px rgba(0,0,0,.35);--shadow-hover:0 6px 18px rgba(0,0,0,.45),0 1px 3px rgba(0,0,0,.4);--skel:#2A2A26;--skel-hi:#34342F;color-scheme:dark}}
5
- *{box-sizing:border-box}html,body{height:100%}body{margin:0;background:var(--bg);color:var(--ink);font-size:14px;display:flex;flex-direction:column;overflow:hidden}
6
- .mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
7
- a{color:var(--blue)}button,select{font:inherit;color:inherit}
8
- .ic{display:inline-flex;flex:none;vertical-align:-3px}.ic svg{width:1em;height:1em;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
9
- .ic.s14{font-size:14px}.ic.s16{font-size:16px}.ic.s18{font-size:18px}.ic.s22{font-size:22px}
10
- header.top{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:16px;padding:10px 24px;background:var(--surface);border-bottom:1px solid var(--line)}
11
- .brand{display:flex;align-items:center;gap:10px;flex:1 1 200px;min-width:0}.brand strong{font-size:18px;letter-spacing:.2px}.brand span.sum{font-size:13px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
12
- nav.tabs{display:flex;gap:2px;padding:3px;background:var(--soft);border-radius:10px}
13
- nav.tabs a{display:inline-flex;align-items:center;gap:7px;padding:6px 16px;border-radius:8px;font-size:14px;font-weight:500;color:var(--muted);text-decoration:none;transition:color .12s,background .12s}
14
- nav.tabs a:hover{color:var(--ink)}
15
- nav.tabs a[aria-current="page"]{background:var(--surface);color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.12)}
16
- nav.tabs a:focus-visible,.card:focus-visible,.pill:focus-visible,.sess:focus-visible,.row:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
17
- .right{flex:1 1 200px;display:flex;justify-content:flex-end;gap:8px}
18
- #need{display:inline-flex;gap:6px;align-items:center;padding:6px 12px;border-radius:8px;background:var(--red-bg);color:var(--red);font-weight:600;font-size:13px}#need[hidden]{display:none}
19
- .alerts{flex:none;display:flex;flex-direction:column;max-height:33vh;overflow:auto}.alerts:empty{display:none}
20
- .alert{display:flex;align-items:flex-start;gap:10px;padding:8px 24px;font-size:13px;background:var(--auto-bg);color:var(--ink2);border-bottom:1px solid var(--auto-line)}.alert .ic{color:var(--orange);margin-top:2px}.alert b{font-weight:600}.alert.bad{background:var(--red-bg);border-bottom-color:var(--red-line)}.alert.bad .ic{color:var(--red)}
21
- .filters{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:8px 24px;background:var(--surface);border-bottom:1px solid var(--line);font-size:13px}
22
- .filters label{color:var(--muted)}.filters select{padding:5px 8px;border-radius:8px;border:1px solid var(--line);background:var(--surface)}
23
- .projects{display:flex;gap:8px;overflow-x:auto;flex:1 1 400px;min-width:0;padding:2px 0}
24
- .proj{display:flex;gap:8px;align-items:center;padding:4px 10px;border-radius:8px;border:1px solid var(--line);background:var(--bg);white-space:nowrap;font-size:13px}.proj .mono{color:var(--blue);font-weight:500}.proj em{font-style:normal;color:var(--muted)}.proj.warn em{color:var(--orange)}
25
- .body{flex:1 1 auto;min-height:0;display:flex}
26
- .board{flex:1 1 0;min-width:0;display:flex;gap:16px;padding:16px 20px 0 24px;overflow-x:auto;overflow-y:hidden}
27
- .col{flex:1 0 224px;min-width:224px;display:flex;flex-direction:column;min-height:0}
28
- .col>header{flex:none;display:flex;flex-direction:column;gap:3px;padding-bottom:10px}
29
- .col h2{margin:0;font-size:14px;font-weight:600;display:flex;align-items:center;gap:8px}.col h2 .ic{color:var(--faint)}.col h2 .n{margin-left:auto;min-width:22px;text-align:center;padding:1px 7px;border-radius:999px;background:var(--soft);color:var(--muted);font-size:12px;font-weight:600}
30
- .col p.hint{margin:0;font-size:12px;color:var(--muted)}
31
- .stack{flex:1 1 auto;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:10px;padding:3px 6px 20px 3px;margin:0 -6px 0 -3px}
32
- .lane{display:flex;flex-direction:column;gap:2px;margin-top:4px}.lane strong{font-size:13px;display:flex;align-items:center;gap:6px}.lane span{font-size:12px;color:var(--muted)}.lane.urgent strong{color:var(--red)}
33
- .empty{font-size:12px;color:var(--faint);padding:10px 2px}
34
- .card{all:unset;box-sizing:border-box;display:flex;flex-direction:column;gap:7px;width:100%;padding:12px 14px;border-radius:12px;background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow);cursor:pointer;text-align:left;transition:box-shadow .15s,border-color .15s,transform .15s}
35
- .card:hover{border-color:var(--faint);box-shadow:var(--shadow-hover);transform:translateY(-1px)}.card[aria-pressed="true"]{box-shadow:0 0 0 2px var(--blue)}
36
- .card.dev{background:var(--dev-bg);border-color:var(--dev-line)}.card.auto{background:var(--auto-bg);border-color:var(--auto-line)}.card.need{background:var(--red-bg);border-color:var(--red-line)}
37
- .card .t{display:flex;justify-content:space-between;gap:8px;align-items:flex-start}.card .t strong{font-size:15px;line-height:21px;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
38
- .chip{display:inline-flex;align-items:center;gap:5px;padding:2px 7px;border-radius:6px;font-size:12px;font-weight:500;line-height:18px;background:var(--soft);color:var(--ink2);max-width:100%}
39
- .card .t .chip{flex:none;max-width:45%;background:var(--surface);border:1px solid var(--line)}.card .t .chip b{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
40
- .line{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted);min-width:0}.line>.tx{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.line .ic{color:var(--faint)}
41
- .card .m{font-size:12px;color:var(--ink2);overflow-wrap:anywhere}.card.need .m{color:var(--red);font-weight:600}
42
- .foot{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;color:var(--muted);padding-top:7px;border-top:1px solid var(--line);margin-top:1px}.foot .line{flex:1 1 auto}.foot .when{flex:none;display:inline-flex;align-items:center;gap:8px;white-space:nowrap}.tm{display:inline-flex;align-items:center;gap:4px}
43
- .card.dev .foot{border-top-color:var(--dev-line)}.card.auto .foot{border-top-color:var(--auto-line)}.card.need .foot{border-top-color:var(--red-line)}
44
- .badge{display:inline-flex;align-items:center;gap:4px;padding:1px 7px;border-radius:999px;font-size:12px;font-weight:600;line-height:18px;flex:none;white-space:nowrap}
45
- .badge.pass{background:var(--green-soft);color:var(--green-ink)}.badge.fail,.badge.blocked{background:var(--red-bg);color:var(--red)}.badge.pending,.badge.superseded{background:var(--soft);color:var(--muted)}
46
- .bar{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted)}.bar .track{flex:1 1 auto;height:4px;border-radius:2px;background:var(--line);overflow:hidden}.bar .track b{display:block;height:4px;background:var(--orange)}
47
- aside.detail{flex:0 0 380px;min-width:0;background:var(--surface);border-left:1px solid var(--line);padding:22px 24px;display:flex;flex-direction:column;gap:18px;overflow-y:auto}
48
- aside.detail[hidden]{display:none}.detail-content{display:flex;flex-direction:column;gap:18px}.detail-close{align-self:flex-end;flex:none;cursor:pointer;min-height:32px;padding:4px 10px;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--muted)}.detail-close:hover{background:var(--soft);color:var(--ink)}.detail-close:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
49
- aside.detail h1{margin:0;font-size:22px;line-height:30px;overflow-wrap:anywhere}aside.detail h2{margin:0;font-size:15px;display:flex;align-items:center;gap:7px}
50
- .chips{display:flex;flex-wrap:wrap;gap:6px}.status{font-size:13px;font-weight:600}
51
- .runs{display:flex;flex-direction:column;gap:8px;padding-top:14px;border-top:1px solid var(--line)}.run{display:flex;align-items:center;gap:10px;font-size:13px}.run .mono{flex:1 1 auto;overflow-wrap:anywhere}
52
- .facts{display:grid;grid-template-columns:72px minmax(0,1fr);row-gap:8px;font-size:13px;margin:0;padding-top:14px;border-top:1px solid var(--line)}.facts dt{color:var(--muted)}.facts dd{margin:0;overflow-wrap:anywhere}
53
- .note{margin:0;color:var(--muted);font-size:12px;line-height:1.7}
54
- .skel{display:block;border-radius:8px;background:linear-gradient(90deg,var(--skel),var(--skel-hi),var(--skel));background-size:200% 100%;animation:shimmer 1.4s infinite linear}
55
- @keyframes shimmer{to{background-position:-200% 0}}@media(prefers-reduced-motion:reduce){.skel{animation:none}}
56
- .skelcard{display:flex;flex-direction:column;gap:9px;padding:14px;border-radius:12px;background:var(--surface);border:1px solid var(--line)}
57
- .layout{flex:1 1 auto;min-height:0;display:flex}
58
- nav.list{flex:0 0 300px;min-width:0;padding:12px 10px;background:var(--surface);border-right:1px solid var(--line);display:flex;flex-direction:column;gap:2px;overflow-y:auto}
59
- .sess{all:unset;flex:none;box-sizing:border-box;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 10px;align-items:baseline;width:100%;padding:9px 12px;border-radius:10px;cursor:pointer;min-height:44px;transition:background .12s}.sess:hover{background:var(--soft)}.sess[aria-current="true"]{background:var(--blue-soft)}
60
- .sess strong{font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.sess time{font-size:12px;color:var(--muted);white-space:nowrap;text-align:right}
61
- .sess .m{grid-column:1/-1;font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.sess .m .ic{margin-right:2px;color:var(--faint)}.sess .m i{font-style:normal;margin:0 4px;color:var(--line)}
62
- main.sessions{flex:1 1 0;min-width:0;padding:22px 28px;display:flex;flex-direction:column;gap:18px;overflow-y:auto}
63
- main.sessions h1{margin:0;font-size:24px;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.meta{font-size:13px;color:var(--muted);overflow-wrap:anywhere}
64
- .stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}.stat{padding:14px;border-radius:12px;background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow);display:flex;flex-direction:column;gap:4px}.stat span{font-size:12px;color:var(--muted)}.stat strong{font-size:24px}
65
- .pills{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.pill{all:unset;box-sizing:border-box;display:inline-flex;gap:6px;align-items:center;padding:6px 12px;border-radius:999px;font-size:13px;cursor:pointer;border:1px solid var(--line);min-height:32px;background:var(--surface)}.pill:hover{border-color:var(--faint)}.pill[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:var(--surface)}
66
- ol.events{margin:0;padding:0;list-style:none;background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);overflow:hidden;flex:none}
67
- ol.events li{border-bottom:1px solid var(--line);padding:12px 14px}ol.events li:last-child{border-bottom:0}
68
- ol.events[data-view="deliveries"] li.hidden-by-view{display:none}
69
- .row{display:flex;gap:12px;align-items:flex-start;flex-wrap:wrap}.row time{font-size:12px;color:var(--muted);width:56px;flex:none;padding-top:2px}
70
- .kind{flex:none;background:var(--blue-soft);color:var(--blue-ink)}.kind.read{background:var(--green-soft);color:var(--green-ink)}.kind.prompt{background:#FFF1E3;color:#9A3412}.kind.plain{background:var(--soft);color:var(--ink2)}
71
- .what{display:flex;flex-direction:column;gap:3px;flex:1 1 200px;min-width:0}.what b{font-weight:500;overflow-wrap:anywhere}.what small{font-size:12px;color:var(--muted)}
72
- .tag{font-size:11px;font-weight:650;padding:2px 7px;border-radius:5px;background:var(--soft);color:var(--ink2)}.tag.ok{background:var(--green-soft);color:var(--green-ink)}.tag.bad{background:var(--red-bg);color:var(--red)}
73
- details{margin:8px 0 0 68px}summary{cursor:pointer;font-size:12px;color:var(--blue);font-weight:600}
74
- pre{white-space:pre-wrap;overflow-wrap:anywhere;font:12px/1.6 ui-monospace,SFMono-Regular,Menlo,monospace;background:var(--bg);border-radius:8px;padding:11px;max-height:480px;overflow:auto;margin:8px 0 0}
75
- @media(max-width:820px){html,body{height:auto}body{overflow:auto}.body,.layout{flex-direction:column}.board{overflow:visible;flex-direction:column;padding:14px 16px}.col{flex:none;min-width:0}.stack{overflow:visible}aside.detail{flex:none;border-left:0;border-top:1px solid var(--line);overflow:visible}nav.list{flex:none;border-right:0;border-bottom:1px solid var(--line);max-height:300px}main.sessions{overflow:visible}header.top,.filters,.alert{padding-left:16px;padding-right:16px}details{margin-left:0}}`;
76
- // 内联线性图标(24×24、1.5 描边,风格取自 lucide),页面离线可用;只接受下表中的常量,不拼接外部输入。
77
- const ICONS = `const PATHS={logo:'<path d="M4 6h16M4 12h10M4 18h6"/>',board:'<rect x="3" y="3" width="7" height="9" rx="1"/><rect x="14" y="3" width="7" height="5" rx="1"/><rect x="14" y="12" width="7" height="9" rx="1"/><rect x="3" y="16" width="7" height="5" rx="1"/>',session:'<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/>',folder:'<path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/>',branch:'<line x1="6" x2="6" y1="3" y2="15"/><circle cx="18" cy="6" r="3"/><circle cx="6" cy="18" r="3"/><path d="M18 9a9 9 0 0 1-9 9"/>',commit:'<circle cx="12" cy="12" r="3"/><line x1="3" x2="9" y1="12" y2="12"/><line x1="15" x2="21" y1="12" y2="12"/>',clock:'<circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/>',host:'<path d="M12 8V4H8"/><rect width="16" height="12" x="4" y="8" rx="2"/><path d="M2 14h2M20 14h2M15 13v2M9 13v2"/>',pass:'<circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/>',fail:'<circle cx="12" cy="12" r="10"/><path d="m15 9-6 6M9 9l6 6"/>',pending:'<path d="M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83"/>',alert:'<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4M12 17h.01"/>',awaiting:'<circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3M12 17h.01"/>',dev:'<path d="m16 18 6-6-6-6M8 6l-6 6 6 6"/>',review:'<path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"/><path d="m9 12 2 2 4-4"/>',done:'<circle cx="18" cy="18" r="3"/><circle cx="6" cy="6" r="3"/><path d="M6 21V9a9 9 0 0 0 9 9"/>',spec:'<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z"/><path d="M14 2v4a2 2 0 0 0 2 2h4M8 13h8M8 17h5"/>'};
78
- const icon=(name,size)=>{const node=make('span','ic');node.style.fontSize=(size||14)+'px';node.setAttribute('aria-hidden','true');node.innerHTML='<svg viewBox="0 0 24 24">'+(PATHS[name]||'')+'</svg>';return node};
79
- const iconText=(name,text,size)=>{const node=make('span');node.append(icon(name,size||14),document.createTextNode(' '+text));return node};`;
80
- const shell = (title, active, content, script) => `<!doctype html>
81
- <html lang="zh-CN">
82
- <head>
83
- <meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
84
- <title>${title}</title>
85
- <style>${STYLE}</style>
86
- </head><body>
87
- <header class="top">
88
- <div class="brand"><span class="ic s22" data-icon="logo"></span><strong>Sumi</strong><span class="sum" id="summary">读取中…</span></div>
89
- <nav class="tabs" aria-label="视图"><a href="/"${active === 'board' ? ' aria-current="page"' : ''}><span class="ic s16" data-icon="board"></span>看板</a><a href="/sessions"${active === 'sessions' ? ' aria-current="page"' : ''}><span class="ic s16" data-icon="session"></span>会话</a></nav>
90
- <div class="right"><span id="need" hidden></span></div>
91
- </header>
92
- <div id="alerts" class="alerts" role="status"></div>
93
- ${content}
94
- <script>
1
+ import { MODEL_SCRIPT } from './page-model.js';
2
+ import { OVERLAYS_SCRIPT } from './page-overlays.js';
3
+ import { USAGE_SCRIPT } from './page-usage.js';
4
+ import { TIPS_SCRIPT } from './page-tips.js';
5
+ import { ICONS } from './page-icons.js';
6
+ import { STYLE } from './page-style.js';
7
+ import { SESSIONS_SCRIPT } from './page-sessions.js';
8
+ import { WORKBENCH_SCRIPT } from './page-workbench.js';
9
+ const SESSION_CONTENT = `<div class="sess">
10
+ <aside class="slist" aria-label="会话列表区域"><div class="itool"><div class="seg" role="group" aria-label="会话范围"><button id="with-prompts" type="button" class="on" aria-pressed="true">手动发起</button><button id="all-sessions" type="button" aria-pressed="false">全部</button></div><div class="seg session-sort"><button id="sort-recent" type="button" class="on">最近</button><button id="sort-token" type="button">Token</button></div><span id="session-help" class="session-help"></span></div>
11
+ <div class="session-filters"><label for="project">项目</label><select id="project"><option value="">全部项目</option></select><label for="host">AI 工具</label><select id="host"><option value="">全部</option></select></div>
12
+ <div class="session-search"><input id="session-query" class="local-filter" type="search" aria-label="筛选会话标题" placeholder="筛选会话标题"></div><nav id="list" class="session-items" aria-label="会话列表" aria-busy="true"><div class="skeleton"><span class="skel"></span><span class="skel"></span></div></nav></aside>
13
+ <main id="session-main" class="session-main"><div class="session-content"><div id="meta" class="meta-line"></div><h2 id="title">选择会话查看详情</h2>
14
+ <section id="stats" class="grid g4 session-stats" aria-label="会话指标"></section>
15
+ <details id="usage-detail" class="tkd"><summary id="usage-summary">Token 明细</summary><div id="usage-facts"></div></details>
16
+ <section id="turn-axis" class="panel turn-axis" aria-label="每轮时间轴"></section><h3 class="sectit">按轮对话</h3><div class="event-filters"><div id="pills" class="seg" role="group" aria-label="筛选事件"></div><span id="count" class="event-count"></span></div>
17
+ <div id="timeline" data-view="deliveries" aria-label="事件时间线"></div>
18
+ <details class="ev-ev evidence"><summary>会话记录详情</summary><div><p id="capture">暂无会话记录信息</p><dl id="evidence-stats" class="kv"></dl>
19
+ <details class="note"><summary>口径</summary><p>“已进入会话记录”仅表示正文已记录,不代表 AI 已理解或遵循。“无法核对”表示暂无会话记录。</p><p>文件读取数仅统计当前已加载记录中的独立文件。终端命令、外部工具和默认加载的内容不在统计范围内。</p><p>上下文读取与文件读取分开统计。“Sumi 读取”表示 Sumi 打开过文档。</p><p>会话记录保存在项目本地,工作台只读。记录可能包含提示词与开发上下文。</p></details></div></details></div></main></div>`;
20
+ const COMMON = String.raw `
95
21
  const byId=(id)=>document.getElementById(id);
96
22
  const make=(tag,className,value)=>{const node=document.createElement(tag);if(className)node.className=className;if(value!==undefined)node.textContent=String(value);return node};
97
- ${ICONS}
98
23
  const clock=(value)=>{const date=new Date(value);return Number.isNaN(date.getTime())?'时间未知':date.toLocaleTimeString('zh-CN',{hour12:false})};
99
24
  const stamp=(value)=>{const date=new Date(value);return Number.isNaN(date.getTime())?'':date.toLocaleString('zh-CN',{hour12:false,month:'numeric',day:'numeric',hour:'2-digit',minute:'2-digit'})};
100
- const ago=(value)=>{const time=Date.parse(value);if(Number.isNaN(time))return '';const sec=Math.max(0,(Date.now()-time)/1000);if(sec<60)return '刚刚';if(sec<3600)return Math.floor(sec/60)+' 分钟前';if(sec<86400)return Math.floor(sec/3600)+' 小时前';if(sec<2592000)return Math.floor(sec/86400)+' 天前';return stamp(value)};
25
+ const ago=(value)=>{const time=Date.parse(value);if(Number.isNaN(time))return '';const sec=Math.max(0,(Date.now()-time)/1000);if(sec<60)return '刚刚';if(sec<3600)return Math.floor(sec/60)+' 分钟前';if(sec<86400)return Math.floor(sec/3600)+' 小时前';return Math.floor(sec/86400)+' 天前'};
101
26
  const getJson=async(url)=>{const response=await fetch(url,{cache:'no-store'});if(!response.ok)throw new Error(String(response.status));return response.json()};
102
- function showAlerts(items,group=false){const target=byId('alerts');const opened=target.querySelector('details')?.open;const rows=items.map(([tone,name,text])=>{const row=make('div','alert '+tone);row.setAttribute('role','alert');const body=make('span');if(name)body.append(make('b','',name+':'));body.append(document.createTextNode(text));row.append(icon('alert',14),body);return row});if(group&&items.length){const details=make('details');details.open=!!opened;details.append(make('summary','alert',items.length+' 个项目需要关注'),...rows);target.replaceChildren(details)}else target.replaceChildren(...rows)}
103
- function projectAlerts(board){return board.projects.filter((entry)=>entry.status!=='ok').map((entry)=>[entry.status==='error'?'bad':'',entry.name,(entry.message||'读取失败')+(entry.readAt?'(上次读取 '+ago(new Date(entry.readAt).toISOString())+')':'')])}
104
- for(const node of document.querySelectorAll('[data-icon]'))node.replaceWith(icon(node.dataset.icon,Number(node.className.replace(/\\D/g,''))||16));
105
- ${script}
27
+ const matchesSearch=(title,query)=>(title||'').toLocaleLowerCase().includes((query||'').trim().toLocaleLowerCase());
28
+ function relativeTime(value){const node=make('time','',ago(value)||'时间未提供');if(value){node.dateTime=value;node.title=new Date(value).toLocaleString('zh-CN',{hour12:false})}return node;}
29
+ function pathText(value){const node=make('span','mono path');const text=homePath(value,lastBoard?.home);const parts=text.split(/(?<=[/\\])/);parts.forEach((part,index)=>{node.append(document.createTextNode(part));if(index<parts.length-1)node.append(make('wbr'));});node.title=value;node.dataset.tip=value;return node;}
30
+
31
+ const PROJECT_COLORS=['#5B5BD6','#1E7F4F','#C27C0E','#C8372D'];
32
+ function projectTag(name){const node=make('span','proj');const hash=Array.from(name||'').reduce((value,char)=>(value*31+char.codePointAt(0))>>>0,0);node.style.setProperty('--pc',PROJECT_COLORS[hash%PROJECT_COLORS.length]);const marker=make('i');marker.setAttribute('aria-hidden','true');node.append(marker,document.createTextNode(name||'项目未提供'));node.title=name||'';return node}
33
+ function agentTag(host){if(!host)return make('span','faint','—');const name=host==='claude'?'Claude':host==='codex'?'Codex':host;const node=make('span','agent');const mark=make('i',host==='claude'?'cl':'cx',host==='claude'?'C':host==='codex'?'X':name.slice(0,1).toUpperCase());mark.setAttribute('aria-hidden','true');node.title=name;node.append(mark,make('span','agent-name',name));return node}
34
+
35
+ let lastBoard=null;
36
+ function showAlerts(items,group=false){const target=byId('alerts');const opened=target.querySelector('details')?.open;const rows=items.map(([tone,name,text])=>{const row=make('div','alert '+tone);row.setAttribute('role','alert');row.textContent=(name?name+':':'')+text;return row});if(group&&items.length){const details=make('details');details.open=!!opened;details.append(make('summary','',items.length+' 个项目需要关注'),...rows);target.replaceChildren(details)}else target.replaceChildren(...rows)}
37
+ function projectAlerts(board){return board.projects.filter((entry)=>entry.status!=='ok').map((entry)=>[entry.status==='error'?'bad':'',entry.name,(entry.message||'读取失败,将自动重试')+(entry.readAt?'(上次读取 '+clock(entry.readAt)+')':'')])}
38
+ function updateShell(board){lastBoard=board;commandController.refresh();byId('readat').textContent='读取于 '+clock(board.generatedAt);byId('project-count').textContent='本机 · '+board.projects.length+' 个项目';byId('inbox-count').textContent=String(board.cards.filter((card)=>['待决策','受阻'].includes(workState(card,board.generatedAt).label)).length);byId('work-count').textContent=String(board.cards.filter((card)=>card.kind==='branch'&&!card.merged).length);byId('session-count').textContent=String(board.sessions.length);showAlerts(projectAlerts(board),true);const name=location.pathname==='/inbox'?'收件箱':location.pathname.startsWith('/work')?'工作项':location.pathname==='/sessions'?'会话':location.pathname==='/usage'?'用量':'概览';byId('crumbs').replaceChildren(make('span','','个人空间'),make('span','sep','/'),make('b','',name));for(const node of document.querySelectorAll('.ni')){const active=node.pathname===location.pathname||(node.pathname==='/work'&&location.pathname.startsWith('/work/'));node.classList.toggle('on',active);if(active)node.setAttribute('aria-current','page');else node.removeAttribute('aria-current')}prepareTooltips(byId('crumbs'))}
39
+ const systemTheme=matchMedia('(prefers-color-scheme:dark)');let theme=null;try{const saved=localStorage.getItem('sumi-workbench-theme');if(saved==='light'||saved==='dark')theme=saved}catch{}
40
+ function applyTheme(){document.documentElement.dataset.theme=theme||(systemTheme.matches?'dark':'light');byId('theme').title=document.documentElement.dataset.theme==='dark'?'切换到浅色':'切换到深色';byId('theme').setAttribute('aria-pressed',String(document.documentElement.dataset.theme==='dark'))}
41
+ byId('theme').addEventListener('click',()=>{theme=document.documentElement.dataset.theme==='dark'?'light':'dark';try{localStorage.setItem('sumi-workbench-theme',theme)}catch{}applyTheme()});systemTheme.addEventListener('change',applyTheme);applyTheme();
42
+ for(const node of document.querySelectorAll('[data-icon]'))node.replaceWith(icon(node.dataset.icon,16));
43
+ `;
44
+ /** 所有工作台路径使用同一自包含页面,只有同源读取请求。 */
45
+ export const BOARD_PAGE = `<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Sumi 工作台</title><style>${STYLE}</style></head><body>
46
+ <aside class="side"><a class="org" href="/"><span class="seal">墨</span><div><b>Sumi 工作台</b><small>个人空间 · 本机</small></div></a>
47
+ <nav class="navs" aria-label="工作导航"><div class="nl">工作</div>
48
+ <a class="ni" href="/" aria-label="概览"><span data-icon="home"></span><span class="label">概览</span></a>
49
+ <a class="ni" href="/inbox" aria-label="收件箱"><span data-icon="inbox"></span><span class="label">收件箱</span><span class="n alert" id="inbox-count"></span></a>
50
+ <a class="ni" href="/work" aria-label="工作项"><span data-icon="items"></span><span class="label">工作项</span><span class="n" id="work-count"></span></a>
51
+ <a class="ni" href="/sessions" aria-label="会话"><span data-icon="session"></span><span class="label">会话</span><span class="n" id="session-count"></span></a>
52
+ <a class="ni" href="/usage" aria-label="用量"><span data-icon="usage"></span><span class="label">用量</span></a></nav>
53
+ <div class="side-help"><button id="usage" class="btn sm" type="button">使用说明</button></div><div class="me"><small id="project-count">本机 · 读取中</small><button class="ib" id="theme" type="button" aria-label="切换深浅色"><span data-icon="sun"></span></button></div></aside>
54
+ <div class="main"><header class="top"><div class="crumbs" id="crumbs">个人空间 / 概览</div><button class="cmdk" id="search" type="button" aria-haspopup="dialog" aria-controls="command-dialog"><span data-icon="search"></span><span class="search-placeholder">搜索工作项、会话、页面</span><span class="kbd">⌘K</span></button><span class="readat" id="readat">读取中</span></header>
55
+ <div id="alerts" class="alerts" role="status"></div>
56
+ <div class="page" id="page"><div class="skeleton" aria-busy="true"><span class="skel"></span><span class="skel"></span><span class="skel"></span></div></div></div>
57
+ <div id="workbench-tip" class="tipbox" role="tooltip" hidden></div>
58
+ <dialog id="command-dialog" class="overlay command-dialog" aria-labelledby="command-title"><div class="overlay-head"><h2 id="command-title">快捷搜索</h2><button type="button" class="btn sm" data-close-overlay>关闭</button></div><label class="command-input-row"><span data-icon="search"></span><input id="command-input" type="search" role="combobox" aria-label="搜索标题、分支或项目" aria-controls="command-results" aria-autocomplete="list" aria-expanded="true" placeholder="搜索标题、分支或项目" autocomplete="off"></label><div id="command-results" role="listbox" aria-label="搜索结果"></div><div class="command-footer"><span>↑ ↓ 选择 · 回车打开 · Esc 关闭</span><span id="command-count" aria-live="polite"></span></div></dialog>
59
+ <dialog id="help-dialog" class="overlay" aria-labelledby="help-title"><div class="overlay-head"><h2 id="help-title">本页术语说明</h2><button type="button" class="btn sm" data-close-overlay>关闭</button></div><dl id="help-body" class="glossary"></dl></dialog>
60
+ <dialog id="usage-dialog" class="overlay" aria-labelledby="usage-title"><div class="overlay-head"><h2 id="usage-title">如何使用工作台</h2><button type="button" class="btn sm" data-close-overlay>关闭</button></div><div id="usage-content" class="overlay-body"></div></dialog>
61
+
62
+ <script>${ICONS}
63
+ ${MODEL_SCRIPT}
64
+ ${COMMON}
65
+ ${OVERLAYS_SCRIPT}
66
+ ${USAGE_SCRIPT}
67
+ ${TIPS_SCRIPT}
68
+ if(location.pathname==='/sessions'){byId('page').classList.add('session-page');byId('page').replaceChildren();const template=document.createElement('template');template.innerHTML=${JSON.stringify(SESSION_CONTENT)};byId('page').append(template.content);
69
+ ${SESSIONS_SCRIPT}
70
+ }else{
71
+ ${WORKBENCH_SCRIPT}
72
+ }
106
73
  </script></body></html>`;
107
- const BOARD_SCRIPT = `
108
- const COLUMNS=[['awaiting','待确认','awaiting','代理在等你确认后才继续'],['dev','开发中','dev','还没有完整的检查,或任务没做完'],['review','检查与评审','review',''],['done','可合并与已合并','done','检查通过且任务完成,或已合并进默认分支']];
109
- const RUN={pass:'通过',fail:'失败',blocked:'受阻',pending:'待评审'};
110
- const RUN_ICON={pass:'pass',fail:'fail',blocked:'alert',pending:'pending'};
111
- let board=null;let project='';let selected='';let detailOpen=true;
112
- try{detailOpen=localStorage.getItem('sumi.hub.detailOpen')!=='false'}catch{}
113
- function setDetailOpen(open){detailOpen=open;byId('detail').hidden=!open;try{localStorage.setItem('sumi.hub.detailOpen',String(open))}catch{}}
114
- byId('detail').hidden=!detailOpen;
115
- byId('close-detail').addEventListener('click',()=>{setDetailOpen(false);const card=byId('board').querySelector('.card[aria-pressed="true"]');if(card)card.focus({preventScroll:true})});
116
- const visible=()=>board.cards.filter((card)=>!project||card.projectId===project);
117
- const latestRun=(card)=>(card.runs||[]).find((run)=>!run.partial);
118
- function runBadge(run){const badge=make('span','badge '+(run.superseded?'superseded':run.conclusion));badge.append(icon(run.superseded?'clock':RUN_ICON[run.conclusion]||'pending',13),document.createTextNode(run.superseded?'未完成(已被取代)':RUN[run.conclusion]||run.conclusion));return badge}
119
- function sessionLabel(card){const link=card.linkedSession;if(!link)return null;return [link.host,link.title].filter(Boolean).join(' · ')}
120
- function branchLabel(card){return card.detached?'分离提交 '+card.detached:card.branch||''}
121
- function renderCard(card){const button=make('button','card '+(card.lane==='needs-you'?'need':card.lane==='auto'?'auto':card.column==='dev'?'dev':''));button.type='button';button.setAttribute('aria-pressed',String(card.id===selected));
122
- const top=make('span','t');const chip=make('span','chip mono');chip.append(icon('folder',13),make('b','',card.project));top.append(make('strong','',card.title),chip);button.append(top);
123
- if(card.kind==='branch'){const label=branchLabel(card);if(label&&label!==card.title){const line=make('span','line');line.append(icon(card.detached?'commit':'branch',13),make('span','tx mono',label));button.append(line)}
124
- if(card.commit&&card.commit.subject&&card.commit.subject!==card.title){const line=make('span','line');line.append(icon('commit',13),make('span','tx',card.commit.subject));button.append(line)}}
125
- if(card.kind==='branch'&&card.progress&&card.progress.length){const bar=make('span','bar');const track=make('span','track');const fill=make('b');fill.style.width=pct(card)+'%';track.append(fill);const done=card.progress.reduce((sum,item)=>sum+item.done,0);const total=card.progress.reduce((sum,item)=>sum+item.total,0);bar.append(track,document.createTextNode('任务 '+done+'/'+total+(card.progress.length>1?'('+card.progress.length+' 个 change)':'')));button.append(bar)}
126
- button.append(make('span','m',card.reason));
127
- const foot=make('span','foot');const who=make('span','line');if(card.kind==='session'){who.append(icon('host',13),make('span','tx',card.host||'宿主未知'))}else{const label=sessionLabel(card);who.append(icon('session',13),make('span','tx',label||'没有关联会话'))}foot.append(who);
128
- const right=make('span','when');const run=card.kind==='branch'?latestRun(card):null;if(card.merged)right.append(make('span','badge pass','已合并'));else if(run)right.append(runBadge(run));const at=card.activityAt||card.updatedAt;if(at){const time=make('span','tm');time.append(icon('clock',13),document.createTextNode(ago(at)));right.append(time)}foot.append(right);button.append(foot);
129
- button.addEventListener('click',()=>{selected=card.id;setDetailOpen(true);render()});return button}
130
- function pct(card){const items=card.progress||[];const total=items.reduce((sum,item)=>sum+item.total,0);return total?Math.round(items.reduce((sum,item)=>sum+item.done,0)/total*100):0}
131
- function column(def,count){const section=make('section','col');const head=make('header');const heading=make('h2');heading.append(icon(def[2],16),document.createTextNode(def[1]),make('span','n',count));head.append(heading);if(def[3])head.append(make('p','hint',def[3]));const stack=make('div','stack');section.append(head,stack);return [section,stack]}
132
- function render(){if(!board)return;const cards=visible();const root=byId('board');const tops=[...root.querySelectorAll('.stack')].map((stack)=>stack.scrollTop);const left=root.scrollLeft;const pageY=window.scrollY;const refocus=document.activeElement&&document.activeElement.classList.contains('card');root.replaceChildren();for(const def of COLUMNS){const mine=cards.filter((card)=>card.column===def[0]);const [section,stack]=column(def,mine.length);if(def[0]==='review'){const need=mine.filter((card)=>card.lane==='needs-you');const auto=mine.filter((card)=>card.lane!=='needs-you');const a=make('div','lane urgent');const title=make('strong');title.append(icon('alert',14),document.createTextNode('需要你 '+need.length));a.append(title,make('span','','代理处理不了:检查受阻、连续失败或已停滞'));stack.append(a,...need.map(renderCard));const b=make('div','lane');b.append(make('strong','','自动处理中 '+auto.length),make('span','','等待评审或正在修复,近期仍有活动'));stack.append(b,...auto.map(renderCard))}else{stack.append(...mine.map(renderCard));if(!mine.length)stack.append(make('div','empty','暂无'))}root.append(section)}
133
- /* 整列重建会丢失滚动位置与焦点:点击卡片和定时刷新后恢复原位 */
134
- root.querySelectorAll('.stack').forEach((stack,index)=>{stack.scrollTop=tops[index]||0});root.scrollLeft=left;window.scrollTo(window.scrollX,pageY);if(refocus){const card=root.querySelector('.card[aria-pressed="true"]');if(card)card.focus({preventScroll:true})}
135
- const branches=board.cards.filter((card)=>card.kind==='branch').length;byId('summary').textContent='本机 '+board.projects.length+' 个项目 · '+branches+' 个分支';const need=byId('need');need.hidden=!board.needsYou;need.replaceChildren(icon('alert',14),document.createTextNode('需要你 '+board.needsYou));showAlerts(projectAlerts(board),true);
136
- const picker=byId('project');if(picker.options.length!==board.projects.length+1){picker.replaceChildren(new Option('全部项目',''),...board.projects.map((entry)=>new Option(entry.name,entry.id)));picker.value=project}
137
- byId('projects').replaceChildren(...board.projects.map((entry)=>{const box=make('div','proj'+(entry.status==='ok'?'':' warn'));box.append(icon('folder',14),make('span','mono',entry.name),make('em','',entry.status==='ok'?'读取于 '+clock(entry.readAt):(entry.message||'')+(entry.readAt?' · 上次读取 '+clock(entry.readAt):'')));return box}));
138
- renderDetail(cards.find((card)=>card.id===selected))}
139
- function fact(list,key,value){if(!value)return;list.append(make('dt','',key),make('dd','',value))}
140
- function renderDetail(card){const box=byId('detail-content');box.replaceChildren();if(!card){box.append(make('p','note','选择一张卡片查看详情。看板只读:要回答问题或做决定,请回到对应的 AI 会话。'));return}
141
- const chips=make('div','chips');const branch=make('span','chip mono');branch.append(icon('branch',13),document.createTextNode(branchLabel(card)||card.title));const proj=make('span','chip');proj.append(icon('folder',13),document.createTextNode(card.project));chips.append(branch,proj);if(card.host){const host=make('span','chip');host.append(icon('host',13),document.createTextNode(card.host));chips.append(host)}box.append(chips);
142
- const head=make('div');head.style.cssText='display:flex;flex-direction:column;gap:6px';const status=make('span','status',COLUMNS.find((def)=>def[0]===card.column)[1]+(card.lane==='needs-you'?' · 需要你':card.lane==='auto'?' · 自动处理中':''));status.style.color=card.lane==='needs-you'?'var(--red)':'var(--ink)';head.append(status,make('h1','',card.title),make('p','note',card.reason));box.append(head);
143
- const facts=make('dl','facts');fact(facts,'提交',card.commit?card.commit.sha+(card.commit.subject?' '+card.commit.subject:''):'');fact(facts,'change',card.changes&&card.changes.length?card.changes.join('、'):'');fact(facts,'会话',sessionLabel(card)||'');fact(facts,'最近活动',card.activityAt||card.updatedAt?ago(card.activityAt||card.updatedAt):'');if(facts.children.length)box.append(facts);
144
- if(card.progress&&card.progress.length){const section=make('section','runs');const h=make('h2');h.append(icon('spec',16),document.createTextNode('任务进度'));section.append(h);for(const item of card.progress){const bar=make('div','bar');const track=make('span','track');const fill=make('b');fill.style.width=(item.total?Math.round(item.done/item.total*100):0)+'%';track.append(fill);bar.append(track,document.createTextNode(item.label+' '+item.done+'/'+item.total));section.append(bar)}box.append(section)}
145
- if(card.runs&&card.runs.length){const section=make('section','runs');const h=make('h2');h.append(icon('review',16),document.createTextNode('最近检查'));section.append(h);for(const run of card.runs){const row=make('div','run');row.append(runBadge(run),make('span','mono',run.runId+(run.partial?'(部分运行)':'')),make('span','note',stamp(run.finishedAt||run.startedAt)));section.append(row)}box.append(section)}
146
- if(card.kind==='session'){const link=make('a','','在会话页查看');link.href='/sessions#'+card.id;box.append(link)}}
147
- byId('project').addEventListener('change',(event)=>{project=event.target.value;render()});
148
- async function refresh(){try{board=await getJson('/api/board');render()}catch{byId('summary').textContent='无法读取 hub 数据';showAlerts([['bad','','无法读取 hub 数据,稍后会自动重试']])}}
149
- refresh();setInterval(refresh,5000);`;
150
- const SKELETON_CARD = '<div class="skelcard"><span class="skel" style="height:16px;width:70%"></span><span class="skel" style="height:12px;width:45%"></span><span class="skel" style="height:12px;width:90%"></span></div>';
151
- const skeletonColumns = ['待确认', '开发中', '检查与评审', '可合并与已合并']
152
- .map((name) => `<section class="col" aria-busy="true"><header><h2>${name}</h2></header><div class="stack">${SKELETON_CARD}${SKELETON_CARD}</div></section>`)
153
- .join('');
154
- export const BOARD_PAGE = shell('Sumi 看板', 'board', `<div class="filters"><label for="project">项目</label><select id="project"><option value="">全部项目</option></select><div id="projects" class="projects" aria-label="项目读取状态"></div></div>
155
- <div class="body"><main id="board" class="board" aria-label="看板" aria-live="polite">${skeletonColumns}</main><aside id="detail" class="detail" aria-label="详情"><button id="close-detail" class="detail-close" type="button" aria-label="关闭详情">关闭详情</button><div id="detail-content" class="detail-content"><span class="skel" style="height:22px;width:60%"></span><span class="skel" style="height:14px;width:90%"></span><span class="skel" style="height:14px;width:75%"></span></div></aside></div>`, BOARD_SCRIPT);
156
- const SESSIONS_SCRIPT = `
157
- const CHANNELS={prompt:'提示词',startup:'会话开始','session-start':'会话开始',clear:'清空后',compact:'压缩后','subagent-start':'子代理启动','before-edit':'编辑前','after-edit':'编辑后','rules-fallback':'规则兜底','read-gate':'读取门槛','task-select':'任务选择','context-read':'路径查询'};
158
- const METHODS={'additional-context':['上下文注入',''],denial:['拒绝工具调用','bad'],'tool-output':['AI 主动读取','']};
159
- const CONFIRM={confirmed:['已进入会话记录','ok'],missing:['未找到','bad'],unknown:['无法核对','']};
160
- const KINDS={prompt:['你的提示','prompt'],injection:['Sumi 送达',''],'agent-read':['AI 读取','read'],document:['Sumi 读取','plain'],command:['Sumi 命令','plain']};
161
- const FILTERS=[['deliveries','送达与读取'],['all','全部事件']];
162
- let sessions=[];let selected=decodeURIComponent(location.hash.slice(1));let events=[];let next=0;let confirmations={};let host='';let project='';let view='deliveries';
163
- const keyOf=(item)=>item.projectId+':'+item.id;const chars=(value)=>value>=10000?(value/10000).toFixed(1)+' 万':String(value);
164
- const current=()=>sessions.find((item)=>keyOf(item)===selected);
165
- function filtered(){return sessions.filter((item)=>(!host||item.host===host)&&(!project||item.projectId===project))}
166
- function renderList(){const list=byId('list');const items=filtered();list.replaceChildren(...items.map((item)=>{const button=make('button','sess');button.type='button';button.setAttribute('aria-current',String(keyOf(item)===selected));button.title=item.title||'';button.append(make('strong','',item.title||item.session||item.id),make('time','',item.updatedAt?ago(item.updatedAt):''));const meta=make('span','m');const bits=[['folder',item.project],['host',item.host||'宿主未知'],['session','送达 '+item.deliveries+' 次']];if(item.awaiting)bits.push(['awaiting',item.awaiting]);bits.forEach(([name,text],index)=>{if(index)meta.append(make('i','','·'));meta.append(icon(name,13),document.createTextNode(' '+text))});button.append(meta);button.addEventListener('click',()=>select(keyOf(item)));return button}));if(!items.length)list.append(make('div','empty','没有会话。接线 hook 后,新的会话会出现在这里。'))}
167
- function renderFilters(board){const hosts=[...new Set(sessions.map((item)=>item.host).filter(Boolean))];const projectBox=byId('project');if(projectBox.options.length!==board.projects.length+1){projectBox.replaceChildren(new Option('全部项目',''),...board.projects.map((entry)=>new Option(entry.name,entry.id)));projectBox.value=project}const hostBox=byId('host');if(hostBox.options.length!==hosts.length+1){hostBox.replaceChildren(new Option('全部',''),...hosts.map((name)=>new Option(name,name)));hostBox.value=host}}
168
- function renderHeader(){const item=current();byId('title').textContent=item?item.title||'未记录提示词的会话':'选择一个会话';byId('title').title=item&&item.title?item.title:'';byId('meta').textContent=item?[item.project,item.host,item.session,(item.checkouts.length>2?item.checkouts.slice(0,2).join('、')+' 等 '+item.checkouts.length+' 个检出':item.checkouts.join('、')),item.agents.length?'子代理 '+item.agents.length+' 个':''].filter(Boolean).join(' · '):'';const stats=byId('stats');if(!item){stats.replaceChildren();return}const count=(state)=>Object.values(confirmations).filter((value)=>value===state).length;stats.replaceChildren(...[[chars(item.chars),'送达字符'],[item.deliveries,'送达次数'],[item.prompts,'你的提示'],[count('confirmed'),'已进入会话记录'],[count('missing'),'未找到'],[item.reads,'AI 主动读取'],[item.denials,'拒绝式送达']].map(([value,label])=>{const box=make('div','stat');box.append(make('span','',label),make('strong','',value));return box}))}
169
- function groups(items){const map=new Map();for(const entry of items){if(entry.key==='catalog:complete')continue;const prefix=entry.key.split(':')[0];map.set(prefix,[...(map.get(prefix)||[]),entry])}return map}
170
- function title(event){if(event.kind==='injection')return (CHANNELS[event.channel]||event.channel||'上下文')+(event.agent?' · 子代理':'');if(event.kind==='command')return 'sumi '+(event.command||'')+(Array.isArray(event.args)&&event.args.length?' '+event.args.join(' ').slice(0,80):'');if(event.kind==='prompt')return (event.content||'').split('\\n')[0].slice(0,160);return event.source||''}
171
- function renderEvent(event){const row=make('li',event.kind==='injection'||event.kind==='prompt'||event.kind==='agent-read'?'':'hidden-by-view');row.dataset.at=event.at||'';const head=make('div','row');const time=make('time','',clock(event.at));if(event.at)time.dateTime=event.at;const kind=KINDS[event.kind]||[event.kind,'plain'];const what=make('span','what');what.append(make('b','',title(event)));const notes=[];if(event.kind==='injection'){const method=METHODS[event.method]||[event.method||'方式未知',''];notes.push(method[0]);if(event.checkout)notes.push('检出 '+event.checkout)}if(event.paths&&event.paths.length)notes.push('触发路径 '+event.paths.slice(0,4).join('、')+(event.paths.length>4?' 等 '+event.paths.length+' 个':''));if(event.selected&&event.selected.length)notes.push('选中 '+event.selected.join('、'));if(notes.length)what.append(make('small','',notes.join(' · ')));head.append(time,make('span','chip kind '+kind[1],kind[0]),what);if(event.kind==='injection'){const state=make('span','tag','核对中');state.dataset.confirm=event.id;head.append(state)}const text=event.kind==='command'?event.output||'':event.content||'';if(text)head.append(make('span','mono note',text.length+' 字'));row.append(head);const lines=[];for(const [prefix,group] of groups(event.items||[]))lines.push('送达 '+group.length+' 条:'+group.slice(0,6).map((entry)=>entry.key).join('、')+(group.length>6?' 等':''));const skipped=event.skipped||[];if(skipped.length)lines.push('跳过 '+skipped.length+' 条:'+skipped.slice(0,4).map((entry)=>entry.key+'('+entry.reason+')').join('、'));if(lines.length){const box=make('div','note');box.style.margin='6px 0 0 68px';box.textContent=lines.join(';');row.append(box)}if(text){const details=make('details');details.append(make('summary','','查看全文'),make('pre','',text));row.append(details)}return row}
172
- function insert(event){const target=byId('timeline');const row=renderEvent(event);let before=null;for(let node=target.lastElementChild;node;node=node.previousElementSibling){if((node.dataset.at||'')<=(event.at||''))break;before=node}target.insertBefore(row,before)}
173
- function applyConfirmations(){for(const [id,state] of Object.entries(confirmations)){const node=document.querySelector('[data-confirm="'+id+'"]');if(!node)continue;const def=CONFIRM[state];node.textContent=def[0];node.className='tag '+def[1]}}
174
- async function loadEvents(key){const item=current();if(!item)return;for(let more=true;more&&key===selected;){const page=await getJson('/api/projects/'+item.projectId+'/sessions/'+item.id+'/events?after='+next);if(key!==selected)return;for(const event of page.events){events.push(event);insert(event)}more=page.more&&page.next>next;next=page.next}byId('count').textContent='共 '+events.length+' 条事件'}
175
- async function loadConfirmations(key){const item=current();if(!item)return;try{const value=await getJson('/api/projects/'+item.projectId+'/sessions/'+item.id+'/confirmations');if(key!==selected)return;confirmations=value;applyConfirmations();renderHeader()}catch{}}
176
- async function select(key){if(selected===key)return;selected=key;history.replaceState(null,'','#'+encodeURIComponent(key));events=[];next=0;confirmations={};byId('timeline').replaceChildren();renderList();renderHeader();try{await loadEvents(key);await loadConfirmations(key)}catch{byId('count').textContent='无法读取该会话'}}
177
- async function refresh(){try{const board=await getJson('/api/board');sessions=board.sessions;byId('summary').textContent='本机 '+board.projects.length+' 个项目 · '+sessions.length+' 个会话';const need=byId('need');need.hidden=!board.needsYou;need.replaceChildren(icon('alert',14),document.createTextNode('需要你 '+board.needsYou));showAlerts(projectAlerts(board),true);renderFilters(board);if(!current()&&sessions[0]){selected='';await select(keyOf(sessions[0]));return}renderList();renderHeader();if(current()){history.replaceState(null,'','#'+encodeURIComponent(selected));await loadEvents(selected)}}catch{byId('summary').textContent='无法读取 hub 数据';showAlerts([['bad','','无法读取 hub 数据,稍后会自动重试']])}}
178
- byId('project').addEventListener('change',(event)=>{project=event.target.value;renderList()});byId('host').addEventListener('change',(event)=>{host=event.target.value;renderList()});
179
- byId('pills').replaceChildren(...FILTERS.map(([id,label])=>{const button=make('button','pill',label);button.type='button';button.setAttribute('aria-pressed',String(id===view));button.addEventListener('click',()=>{view=id;byId('timeline').dataset.view=id;for(const option of byId('pills').children)option.setAttribute('aria-pressed',String(option===button))});return button}));
180
- addEventListener('hashchange',()=>{const key=decodeURIComponent(location.hash.slice(1));selected='';select(key)});
181
- refresh();setInterval(refresh,3000);setInterval(()=>{if(selected)loadConfirmations(selected)},8000);`;
182
- export const SESSIONS_PAGE = shell('Sumi 会话', 'sessions', `<div class="filters"><label for="project">项目</label><select id="project"><option value="">全部项目</option></select><label for="host">代理</label><select id="host"><option value="">全部</option></select></div>
183
- <div class="layout"><nav id="list" class="list" aria-label="会话列表" aria-busy="true"><span class="skel" style="height:44px"></span><span class="skel" style="height:44px"></span><span class="skel" style="height:44px"></span></nav>
184
- <main class="sessions"><div><div id="meta" class="meta"></div><h1 id="title">选择一个会话</h1></div>
185
- <section id="stats" class="stats" aria-label="送达总量"></section>
186
- <div id="pills" class="pills" role="group" aria-label="筛选事件"></div><span id="count" class="meta"></span>
187
- <ol id="timeline" class="events" data-view="deliveries" aria-label="事件时间线"></ol>
188
- <p class="note"><strong>证据范围</strong>:“已进入会话记录”表示这段正文出现在宿主的会话记录文件里,不表示 AI 理解或遵循了它。“无法核对”表示宿主没有提供会话记录。“AI 读取”来自宿主 Read 工具;Shell、MCP 和宿主自动加载的读取不在观测范围内。“Sumi 读取”只表示 Sumi 打开了文档。事件保存在各项目 git 公共目录的 sumi/sessions 下,hub 只读取,可能包含提示词和开发上下文。</p></main></div>`, SESSIONS_SCRIPT);
74
+ export const SESSIONS_PAGE = BOARD_PAGE;
189
75
  //# sourceMappingURL=pages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pages.js","sourceRoot":"","sources":["../../src/hub/pages.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,sCAAsC;AAEtC,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6fAwE+e,CAAC;AAE9f,6DAA6D;AAC7D,MAAM,KAAK,GAAG;;2IAE6H,CAAC;AAE5I,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,MAA4B,EAAE,OAAe,EAAE,MAAc,EAAE,EAAE,CAAC;;;;SAIvF,KAAK;SACL,KAAK;;;;+CAIiC,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,2EAA2E,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE;;;;EAI3N,OAAO;;;;EAIP,KAAK;;;;;;;;EAQL,MAAM;wBACgB,CAAC;AAEzB,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCA0CgB,CAAC;AAEtC,MAAM,aAAa,GACjB,sMAAsM,CAAC;AACzM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,CAAC;KACvD,GAAG,CACF,CAAC,IAAI,EAAE,EAAE,CACP,qDAAqD,IAAI,oCAAoC,aAAa,GAAG,aAAa,kBAAk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,GAAG,UAAU,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { createServer } from 'node:http';
2
2
  import { getCliVersion, KernelError } from '@sumi/kernel';
3
3
  import { buildBoard, createCollector, projectId } from './board.js';
4
- import { BOARD_PAGE, SESSIONS_PAGE } from './pages.js';
4
+ import { BOARD_PAGE } from './pages.js';
5
5
  import { recordHubDiagnostic } from './start.js';
6
6
  import { acquireHubLock, HEALTH, HUB_PORT, probeHub, readProjects, releaseHubFiles, supersedesHub, writeHubState } from './state.js';
7
7
  /** 同一用户已有 hub 在运行。 */
@@ -105,10 +105,8 @@ export async function startHub(options = {}) {
105
105
  else
106
106
  collector.detail(entry.path, args).then((result) => json(result?.[detail[3]] ?? null), () => json(null));
107
107
  }
108
- else if (url.pathname === '/')
108
+ else if (['/', '/inbox', '/work', '/sessions', '/usage'].includes(url.pathname) || /^\/work\/[^/]+$/.test(url.pathname))
109
109
  html(BOARD_PAGE);
110
- else if (url.pathname === '/sessions')
111
- html(SESSIONS_PAGE);
112
110
  else {
113
111
  res.statusCode = 404;
114
112
  res.end('Not found');
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/hub/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,EAAkB,MAAM,YAAY,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAiBrI,sBAAsB;AACtB,MAAM,OAAO,eAAgB,SAAQ,WAAW;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AG,MAAM;YAAE,KAAK,KAAK,EAAE,CAAC;;YAC7C,aAAa,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC,CAAC;IAC5E,CAAC,EAAE,OAAO,CAAC,YAAY,IAAI,MAAM,CAAC,CAAC;IACnC,KAAK,CAAC,KAAK,EAAE,CAAC;IACd,OAAO,EAAE,GAAG,EAAE,oBAAoB,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAClE,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { type HubContribution } from '@sumi/plugin-sdk';
2
+ import { captureStatus } from '../visualize.js';
2
3
  import { type SessionSummary } from '../visualize-sessions.js';
3
4
  export declare const SNAPSHOT_SCHEMA = 1;
4
5
  export interface RunSummary {
@@ -8,6 +9,11 @@ export interface RunSummary {
8
9
  partial: boolean;
9
10
  startedAt: string;
10
11
  finishedAt: string | null;
12
+ steps?: {
13
+ id: string;
14
+ conclusion: string;
15
+ durationMs?: number;
16
+ }[];
11
17
  }
12
18
  export interface CheckoutSnapshot {
13
19
  path: string;
@@ -28,6 +34,8 @@ export interface CheckoutSnapshot {
28
34
  }
29
35
  export type SessionSnapshot = SessionSummary & {
30
36
  awaiting?: string;
37
+ attention?: HubContribution['attention'];
38
+ notes?: HubContribution['notes'];
31
39
  };
32
40
  export interface ProjectSnapshot {
33
41
  schemaVersion: typeof SNAPSHOT_SCHEMA;
@@ -36,6 +44,7 @@ export interface ProjectSnapshot {
36
44
  checkouts: CheckoutSnapshot[];
37
45
  sessions: SessionSnapshot[];
38
46
  diagnostics: string[];
47
+ capture?: ReturnType<typeof captureStatus>;
39
48
  }
40
49
  /** 项目自己的只读快照:检出与分支、最近运行、会话列表及插件贡献。不修改任何项目数据。 */
41
50
  export declare function buildSnapshot(root: string, now?: number): Promise<ProjectSnapshot>;