@easysociable/cli 0.1.0 → 0.1.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.
- package/README.md +38 -69
- package/dist/easysociable.js +301 -2829
- package/dist/easysociable.js.map +1 -1
- package/package.json +17 -12
- package/skills/ONBOARDING.md +3 -1
- package/skills/easysociable-content/INSTALL.md +60 -0
- package/skills/easysociable-content/SKILL.md +107 -96
- package/skills/easysociable-content/fixtures/golden-run-en/draft.md +13 -0
- package/skills/easysociable-content/fixtures/golden-run-en/idea.md +26 -0
- package/skills/easysociable-content/fixtures/golden-run-en/pack-tiktok.json +11 -0
- package/skills/easysociable-content/platforms/claude.md +1 -2
- package/skills/easysociable-content/platforms/codex.md +1 -2
- package/skills/easysociable-content/platforms/hermes.md +1 -2
- package/skills/easysociable-content/platforms/openclaw.md +1 -2
- package/skills/easysociable-content/references/CLI.md +25 -12
- package/skills/easysociable-content/references/CONTRACT_SYNC.md +42 -0
- package/skills/easysociable-content/references/MCP.md +7 -12
- package/skills/easysociable-content/references/PAGE_PACK.md +128 -5
- package/skills/easysociable-content/references/PLATFORM_GUIDE.md +36 -0
- package/skills/easysociable-content/references/RUN_LAYOUT.md +73 -0
- package/skills/easysociable-content/references/TROUBLESHOOTING.md +11 -9
- package/skills/easysociable-content/references/VAULT.md +32 -12
- package/skills/easysociable-content/references/VOICE.md +16 -0
- package/skills/easysociable-content/scripts/contracts.mjs +183 -0
- package/skills/easysociable-content/scripts/export-contracts.mjs +76 -0
- package/skills/easysociable-content/scripts/fixture.test.mjs +24 -0
- package/skills/easysociable-content/scripts/package-skill.mjs +49 -0
- package/skills/easysociable-content/scripts/setup.mjs +127 -83
- package/skills/easysociable-content/scripts/setup.test.mjs +49 -38
- package/skills/easysociable-content/scripts/starter.mjs +50 -48
- package/skills/easysociable-content/scripts/validate-export.mjs +42 -0
- package/skills/easysociable-content/scripts/validate-pack.mjs +48 -0
- package/skills/easysociable-content/scripts/validate-run.mjs +100 -0
- package/skills/easysociable-content/scripts/validate.test.mjs +101 -0
- package/skills/easysociable-content/scripts/workbench.mjs +135 -0
- package/skills/easysociable-content/starter/CLAUDE.md +756 -0
- package/skills/easysociable-content/starter/accounts/README.md +9 -0
- package/skills/easysociable-content/starter/accounts/_index.md +31 -0
- package/skills/easysociable-content/starter/accounts/overrides/README.md +3 -0
- package/skills/easysociable-content/starter/discovery/README.md +18 -0
- package/skills/easysociable-content/starter/discovery/_index.md +27 -0
- package/skills/easysociable-content/starter/discovery/_template.md +41 -0
- package/skills/easysociable-content/starter/engine.json +19 -0
- package/skills/easysociable-content/starter/exports/README.md +28 -0
- package/skills/easysociable-content/starter/inbox/README.md +9 -0
- package/skills/easysociable-content/starter/inbox/_index.md +24 -0
- package/skills/easysociable-content/starter/inbox/entries/README.md +3 -0
- package/skills/easysociable-content/starter/platforms/README.md +19 -0
- package/skills/easysociable-content/starter/platforms/ig.md +69 -0
- package/skills/easysociable-content/starter/platforms/instagram.md +5 -0
- package/skills/easysociable-content/starter/platforms/linkedin.md +72 -0
- package/skills/easysociable-content/starter/platforms/threads.md +69 -0
- package/skills/easysociable-content/starter/platforms/tiktok.md +71 -0
- package/skills/easysociable-content/starter/platforms/x.md +78 -0
- package/skills/easysociable-content/starter/platforms/xiaohongshu.md +19 -0
- package/skills/easysociable-content/starter/profiles/_index.md +13 -0
- package/skills/easysociable-content/starter/profiles/default/README.md +11 -0
- package/skills/easysociable-content/starter/profiles/default/audience.md +38 -0
- package/skills/easysociable-content/starter/profiles/default/pillars.md +33 -0
- package/skills/easysociable-content/starter/profiles/default/voice.md +24 -0
- package/skills/easysociable-content/starter/published/_index.md +20 -0
- package/skills/easysociable-content/starter/raw/README.md +4 -0
- package/skills/easysociable-content/starter/raw/_index.md +12 -0
- package/skills/easysociable-content/starter/runs/README.md +22 -0
- package/skills/easysociable-content/starter/runs/_index.md +41 -0
- package/skills/easysociable-content/starter/runs/_template/brief.md +66 -0
- package/skills/easysociable-content/starter/runs/_template/draft.md +11 -0
- package/skills/easysociable-content/starter/runs/_template/editor.md +18 -0
- package/skills/easysociable-content/starter/runs/_template/feedback.md +15 -0
- package/skills/easysociable-content/starter/runs/_template/idea.md +27 -0
- package/skills/easysociable-content/starter/runs/_template/pack.md +47 -0
- package/skills/easysociable-content/starter/runs/_template/packet.md +25 -0
- package/skills/easysociable-content/starter/runs/_template/rubric.md +19 -0
- package/skills/easysociable-content/starter/swipe/_index.md +27 -0
- package/skills/easysociable-content/starter/swipe/_template.md +34 -0
- package/skills/easysociable-content/starter/topics/README.md +25 -0
- package/skills/easysociable-content/starter/topics/WATCHLIST.md +65 -0
- package/skills/easysociable-content/starter/topics/_index.md +44 -0
- package/skills/easysociable-content/starter/topics/_template-item.md +90 -0
- package/skills/easysociable-content/starter/topics/items/README.md +4 -0
- package/skills/easysociable-content/starter/topics/scoring.md +201 -0
- package/skills/easysociable-content/starter/topics/watchlists/README.md +10 -0
- package/skills/easysociable-content/starter/topics/watchlists/_shared.md +14 -0
- package/skills/easysociable-content/starter/topics/watchlists/default.md +6 -0
- package/skills/easysociable-content/starter/wiki/README.md +13 -0
- package/skills/easysociable-content/starter/wiki/atoms/_index.md +23 -0
- package/skills/easysociable-content/starter/wiki/atoms/_template.md +31 -0
- package/skills/easysociable-content/starter/wiki/claims/_index.md +26 -0
- package/skills/easysociable-content/starter/wiki/claims/_template.md +38 -0
- package/skills/easysociable-content/starter/workbench/README.md +17 -0
- package/skills/easysociable-content/workbench/build.py +1074 -0
- package/skills/easysociable-content/workbench/serve.py +53 -0
- package/skills/easysociable-content/workbench/template.html +2119 -0
- package/skills/easysociable-content/workflows/ANALYSIS_AND_COVERAGE.md +14 -5
- package/skills/easysociable-content/workflows/CONTENT_EXPORT.md +16 -11
- package/skills/easysociable-content/workflows/GETTING_STARTED.md +40 -0
- package/skills/easysociable-content/workflows/MCP_FIRST.md +3 -8
- package/skills/easysociable-content/workflows/OUT_OF_SCOPE.md +18 -0
- package/skills/easysociable-content/workflows/PACK_AUTHORING.md +42 -0
- package/skills/easysociable-content/workflows/SWIPE_CAPTURE.md +18 -0
- package/skills/easysociable-content/workflows/TOPIC_DRAFT.md +28 -4
- package/skills/easysociable-content/workflows/WORKING_DRAFT.md +17 -8
- package/skills/easysociable-slideshow/SKILL.md +20 -13
- package/skills/easysociable-slideshow/references/VAULT.md +13 -11
- package/skills/easysociable-template/scripts/generate-theme-from-hex.mjs +0 -0
- package/skills/easysociable-content/workflows/DEVICE_TASKS.md +0 -5
- package/skills/easysociable-content/workflows/EXPERIMENTS.md +0 -6
- package/skills/easysociable-content/workflows/PUBLICATION.md +0 -5
|
@@ -0,0 +1,2119 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<title>Content Engine · 观察台</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
--ink: #2c2822;
|
|
10
|
+
--bg: #f4ecdc;
|
|
11
|
+
--bg-2: #efe6d2;
|
|
12
|
+
--bg-3: #e5d9c0;
|
|
13
|
+
--paper: #faf6ec;
|
|
14
|
+
--text: #2c2822;
|
|
15
|
+
--muted: #6e675c;
|
|
16
|
+
--faint: #8a8276;
|
|
17
|
+
--line: #d4c6a8;
|
|
18
|
+
--accent: #9c3d32;
|
|
19
|
+
--accent-dim: #7a3028;
|
|
20
|
+
--gap: #a14a38;
|
|
21
|
+
--ok: #4a6750;
|
|
22
|
+
--chip: #e8dcc4;
|
|
23
|
+
--shadow: 0 12px 28px rgba(70, 50, 24, .08);
|
|
24
|
+
--glow: #ead9b8;
|
|
25
|
+
--gap-bg: #f6e6d6;
|
|
26
|
+
--sumi: #2c2822;
|
|
27
|
+
}
|
|
28
|
+
* { box-sizing: border-box; }
|
|
29
|
+
html, body {
|
|
30
|
+
margin: 0; height: 100%;
|
|
31
|
+
background:
|
|
32
|
+
radial-gradient(900px 420px at 12% -8%, var(--glow) 0%, transparent 55%),
|
|
33
|
+
var(--bg);
|
|
34
|
+
color: var(--text);
|
|
35
|
+
font: 14px/1.5 "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
|
|
36
|
+
}
|
|
37
|
+
body::before {
|
|
38
|
+
content: "";
|
|
39
|
+
position: fixed; inset: 0; pointer-events: none; z-index: 0;
|
|
40
|
+
opacity: .14; mix-blend-mode: multiply;
|
|
41
|
+
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
|
|
42
|
+
}
|
|
43
|
+
body::after {
|
|
44
|
+
content: "";
|
|
45
|
+
position: fixed; inset: 0; pointer-events: none; z-index: 0;
|
|
46
|
+
opacity: .045;
|
|
47
|
+
background: repeating-linear-gradient(
|
|
48
|
+
0deg,
|
|
49
|
+
transparent 0 5px,
|
|
50
|
+
rgba(80, 60, 30, .35) 5px 6px
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
button { font: inherit; }
|
|
54
|
+
a { color: var(--accent); text-decoration: none; }
|
|
55
|
+
a:hover { text-decoration: underline; text-underline-offset: 3px; }
|
|
56
|
+
.tools { display: flex; align-items: center; gap: 8px; }
|
|
57
|
+
.tools button, .tools select {
|
|
58
|
+
background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
|
|
59
|
+
border-radius: 999px; padding: 6px 10px; cursor: pointer; font: inherit;
|
|
60
|
+
}
|
|
61
|
+
#profileSel { max-width: 220px; }
|
|
62
|
+
header.app {
|
|
63
|
+
display: grid;
|
|
64
|
+
grid-template-columns: auto 1fr auto auto;
|
|
65
|
+
align-items: center;
|
|
66
|
+
gap: 20px;
|
|
67
|
+
padding: 14px 28px;
|
|
68
|
+
border-bottom: 1px solid var(--line);
|
|
69
|
+
background: color-mix(in srgb, var(--paper) 82%, transparent);
|
|
70
|
+
backdrop-filter: blur(16px);
|
|
71
|
+
position: sticky; top: 0; z-index: 5;
|
|
72
|
+
}
|
|
73
|
+
.brand { display: flex; align-items: center; gap: 12px; min-width: 168px; }
|
|
74
|
+
.mark {
|
|
75
|
+
width: 28px; height: 28px; border-radius: 8px;
|
|
76
|
+
background: linear-gradient(145deg, #3a342c, #1e1b17);
|
|
77
|
+
box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
|
|
78
|
+
position: relative;
|
|
79
|
+
}
|
|
80
|
+
.mark::after {
|
|
81
|
+
content: ""; position: absolute; inset: 8px 7px 8px 13px;
|
|
82
|
+
border-right: 1.5px solid var(--paper); border-bottom: 1.5px solid var(--paper);
|
|
83
|
+
opacity: .55;
|
|
84
|
+
}
|
|
85
|
+
header.app h1 { font-size: 15px; font-weight: 600; margin: 0; letter-spacing: .04em; }
|
|
86
|
+
header.app h1 small { display: block; color: var(--faint); font-weight: 400; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; margin-top: 2px; }
|
|
87
|
+
nav.tabs { display: flex; gap: 2px; flex-wrap: wrap; }
|
|
88
|
+
nav.tabs button, .subtabs button {
|
|
89
|
+
background: transparent; border: 0; color: var(--muted);
|
|
90
|
+
padding: 8px 12px; border-radius: 999px; cursor: pointer;
|
|
91
|
+
}
|
|
92
|
+
nav.tabs button.on, .subtabs button.on {
|
|
93
|
+
background: var(--sumi); color: var(--paper); font-weight: 600;
|
|
94
|
+
}
|
|
95
|
+
nav.tabs button:not(.on):hover { color: var(--text); background: var(--bg-3); }
|
|
96
|
+
.search {
|
|
97
|
+
position: relative;
|
|
98
|
+
}
|
|
99
|
+
.search::before {
|
|
100
|
+
content: ""; position: absolute; left: 12px; top: 11px; width: 12px; height: 12px;
|
|
101
|
+
border: 1.5px solid var(--faint); border-radius: 50%;
|
|
102
|
+
}
|
|
103
|
+
.search::after {
|
|
104
|
+
content: ""; position: absolute; left: 22px; top: 21px; width: 6px; height: 1.5px;
|
|
105
|
+
background: var(--faint); transform: rotate(45deg);
|
|
106
|
+
}
|
|
107
|
+
#q {
|
|
108
|
+
width: 260px; background: var(--paper); border: 1px solid var(--line); color: var(--text);
|
|
109
|
+
padding: 8px 12px 8px 32px; border-radius: 999px; outline: none;
|
|
110
|
+
}
|
|
111
|
+
#q:focus { border-color: var(--accent-dim); }
|
|
112
|
+
.stamp { color: var(--faint); font-size: 11px; letter-spacing: .04em; }
|
|
113
|
+
.shell { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr); height: calc(100% - 61px); }
|
|
114
|
+
.list { overflow: auto; padding: 28px 32px 56px; }
|
|
115
|
+
.insp {
|
|
116
|
+
overflow: auto; padding: 28px 26px 56px;
|
|
117
|
+
background:
|
|
118
|
+
linear-gradient(180deg, rgba(255,250,240,.5), transparent 140px),
|
|
119
|
+
var(--bg-2);
|
|
120
|
+
border-left: 1px solid var(--line);
|
|
121
|
+
}
|
|
122
|
+
.lead {
|
|
123
|
+
font-family: "Iowan Old Style", "Palatino Linotype", "Songti SC", Georgia, serif;
|
|
124
|
+
font-size: 28px; line-height: 1.25; font-weight: 500; margin: 0 0 8px; max-width: 18em;
|
|
125
|
+
}
|
|
126
|
+
.lede { color: var(--muted); margin: 0 0 22px; max-width: 42em; }
|
|
127
|
+
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
|
|
128
|
+
.filters select {
|
|
129
|
+
background: var(--paper); border: 1.5px solid var(--line); color: var(--text);
|
|
130
|
+
padding: 7px 28px 7px 12px; border-radius: 8px; min-width: 140px;
|
|
131
|
+
}
|
|
132
|
+
.filt {
|
|
133
|
+
display: flex; flex-direction: column; gap: 14px;
|
|
134
|
+
margin: 0 0 16px; padding: 14px 16px;
|
|
135
|
+
background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
|
|
136
|
+
}
|
|
137
|
+
.filt-row {
|
|
138
|
+
display: flex; flex-direction: column; align-items: stretch; gap: 6px;
|
|
139
|
+
}
|
|
140
|
+
.filt-lab { font-size: 11px; color: var(--faint); letter-spacing: .08em; }
|
|
141
|
+
.filt .subtabs {
|
|
142
|
+
display: flex; flex-wrap: wrap; margin: 0; width: 100%;
|
|
143
|
+
border-radius: 12px; gap: 2px;
|
|
144
|
+
}
|
|
145
|
+
.filt .subtabs button { white-space: nowrap; }
|
|
146
|
+
.ghost-link {
|
|
147
|
+
background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer;
|
|
148
|
+
font: inherit; text-decoration: underline; text-underline-offset: 3px;
|
|
149
|
+
}
|
|
150
|
+
.cards { display: grid; gap: 10px; }
|
|
151
|
+
.row {
|
|
152
|
+
display: grid; grid-template-columns: 8px 1fr auto; gap: 14px;
|
|
153
|
+
padding: 14px 16px 14px 0; background: var(--paper);
|
|
154
|
+
border: 1px solid var(--line); border-radius: 14px;
|
|
155
|
+
cursor: pointer; text-align: left; box-shadow: 0 1px 0 rgba(255,255,255,.55) inset;
|
|
156
|
+
}
|
|
157
|
+
.row:hover { border-color: #b8a888; transform: translateY(-1px); }
|
|
158
|
+
.row.sel { border-color: var(--accent); box-shadow: var(--shadow); }
|
|
159
|
+
.stripe { border-radius: 14px 0 0 14px; background: var(--accent-dim); }
|
|
160
|
+
.row[data-kind="capture"] .stripe { background: #7d9aa8; }
|
|
161
|
+
.row[data-kind="raw"] .stripe { background: #6e7f6a; }
|
|
162
|
+
.row[data-kind="discovery"] .stripe { background: #6b7c8a; }
|
|
163
|
+
.row[data-kind="topic"] .stripe { background: var(--accent); }
|
|
164
|
+
.row[data-kind="swipe"] .stripe { background: #c4a06a; }
|
|
165
|
+
.row[data-kind="atom"] .stripe { background: #a78bb0; }
|
|
166
|
+
.row[data-kind="claim"] .stripe { background: #d08a78; }
|
|
167
|
+
.row[data-kind="run"] .stripe { background: #8aa87a; }
|
|
168
|
+
.row[data-kind="profile"] .stripe { background: #8b6b4a; }
|
|
169
|
+
.row[data-kind="account"] .stripe { background: #5c6b7a; }
|
|
170
|
+
.heat {
|
|
171
|
+
display: flex; flex-wrap: wrap; gap: 6px;
|
|
172
|
+
margin-top: 10px; align-items: center;
|
|
173
|
+
}
|
|
174
|
+
.heat-chip {
|
|
175
|
+
display: inline-flex; align-items: center; gap: 5px;
|
|
176
|
+
font-size: 11px; font-variant-numeric: tabular-nums;
|
|
177
|
+
padding: 3px 8px; border-radius: 999px; white-space: nowrap;
|
|
178
|
+
border: 1px solid transparent;
|
|
179
|
+
}
|
|
180
|
+
.heat-chip .sym { font-size: 10px; line-height: 1; opacity: .9; }
|
|
181
|
+
.heat-chip .val { font-weight: 600; letter-spacing: .01em; }
|
|
182
|
+
.heat-chip.likes { color: #a14a38; background: #f3ddd4; }
|
|
183
|
+
.heat-chip.replies { color: #3d4a57; background: #dce3ea; }
|
|
184
|
+
.heat-chip.bookmarks {
|
|
185
|
+
color: #8a6a3a; background: #ead9b8;
|
|
186
|
+
border-color: rgba(138, 106, 58, .28);
|
|
187
|
+
}
|
|
188
|
+
.heat-chip.views { color: #8a8276; background: #ebe4d6; }
|
|
189
|
+
.heat-chip.empty { opacity: .55; font-weight: 400; }
|
|
190
|
+
.heat-note { font-size: 11px; color: var(--faint); margin: 6px 0 0; }
|
|
191
|
+
.insp .heat { margin: 0 0 14px; }
|
|
192
|
+
.row .id {
|
|
193
|
+
font-family: ui-monospace, "SF Mono", Menlo, monospace;
|
|
194
|
+
font-size: 11px; color: var(--accent); letter-spacing: .02em;
|
|
195
|
+
}
|
|
196
|
+
.row .label { font-size: 15px; margin-top: 4px; }
|
|
197
|
+
.row .meta { color: var(--muted); font-size: 12px; margin-top: 6px; }
|
|
198
|
+
.row .side {
|
|
199
|
+
display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between;
|
|
200
|
+
gap: 10px; min-height: 52px;
|
|
201
|
+
}
|
|
202
|
+
.plat-mark {
|
|
203
|
+
width: 28px; height: 28px; border-radius: 8px;
|
|
204
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
205
|
+
font-size: 11px; font-weight: 700; letter-spacing: -.02em; line-height: 1;
|
|
206
|
+
flex-shrink: 0;
|
|
207
|
+
}
|
|
208
|
+
.pills { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: flex-start; max-width: 280px; }
|
|
209
|
+
.pill-stack { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
|
|
210
|
+
.pill-row { display: inline-flex; flex-wrap: nowrap; gap: 6px; align-items: center; }
|
|
211
|
+
.score {
|
|
212
|
+
font-family: "Iowan Old Style", Georgia, serif;
|
|
213
|
+
font-size: 22px; color: var(--sumi); line-height: 1;
|
|
214
|
+
}
|
|
215
|
+
.pill {
|
|
216
|
+
display: inline-block; font-size: 11px; padding: 3px 8px; border-radius: 999px;
|
|
217
|
+
background: var(--chip); color: var(--muted); white-space: nowrap;
|
|
218
|
+
}
|
|
219
|
+
.pill.gap { color: var(--gap); background: #f3ddd4; }
|
|
220
|
+
.pill.ok { color: var(--ok); background: #dce6d8; }
|
|
221
|
+
.pill.hit-n { color: #3d4a57; background: #dce3ea; }
|
|
222
|
+
.pill.hit-win { color: var(--ok); background: #dce6d8; }
|
|
223
|
+
.pill.hit-loss { color: var(--gap); background: #f3ddd4; }
|
|
224
|
+
.ipgrid { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 0; max-width: 42em; }
|
|
225
|
+
.ipcard {
|
|
226
|
+
background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
|
|
227
|
+
padding: 16px 18px; cursor: pointer; text-align: left;
|
|
228
|
+
}
|
|
229
|
+
.ipcard:hover, .ipcard.on { border-color: var(--accent); box-shadow: var(--shadow); }
|
|
230
|
+
.ipcard .hid { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--accent); }
|
|
231
|
+
.ipcard .ttl {
|
|
232
|
+
font-family: "Iowan Old Style", "Songti SC", Georgia, serif;
|
|
233
|
+
font-size: 17px; line-height: 1.35; margin: 6px 0 0;
|
|
234
|
+
}
|
|
235
|
+
.prof-stats {
|
|
236
|
+
display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 18px;
|
|
237
|
+
}
|
|
238
|
+
.prof-stats > div {
|
|
239
|
+
background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
|
|
240
|
+
padding: 10px 12px;
|
|
241
|
+
}
|
|
242
|
+
.prof-stats b {
|
|
243
|
+
display: block; font-family: "Iowan Old Style", Georgia, serif;
|
|
244
|
+
font-size: 22px; font-weight: 500; line-height: 1.1; margin-bottom: 4px;
|
|
245
|
+
}
|
|
246
|
+
.prof-stats span { font-size: 11px; color: var(--faint); }
|
|
247
|
+
.prof-pillars { display: grid; gap: 8px; margin: 0 0 18px; }
|
|
248
|
+
.prof-pill {
|
|
249
|
+
display: grid; grid-template-columns: 36px 1fr; gap: 10px; align-items: baseline;
|
|
250
|
+
padding: 10px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
|
|
251
|
+
font-size: 13px;
|
|
252
|
+
}
|
|
253
|
+
.prof-pill .hid { color: var(--accent); font-family: ui-monospace, Menlo, monospace; font-size: 11px; }
|
|
254
|
+
.prof-accts button { margin-top: 0; margin-bottom: 8px; }
|
|
255
|
+
.prof-docs { display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; }
|
|
256
|
+
.gap-list { display: grid; gap: 8px; margin: 0 0 4px; }
|
|
257
|
+
.gap-list p {
|
|
258
|
+
margin: 0; padding: 10px 12px; border-radius: 12px; font-size: 13px;
|
|
259
|
+
background: #f3ddd4; color: var(--gap); border: 1px solid rgba(161, 74, 56, .18);
|
|
260
|
+
}
|
|
261
|
+
.stage-file-lite {
|
|
262
|
+
display: grid; grid-template-columns: 76px 1fr auto; gap: 10px; align-items: center;
|
|
263
|
+
width: 100%; text-align: left; cursor: pointer;
|
|
264
|
+
font-family: inherit; font-size: 13px; color: var(--text);
|
|
265
|
+
background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
|
|
266
|
+
padding: 10px 12px;
|
|
267
|
+
}
|
|
268
|
+
.stage-file-lite:hover { border-color: var(--accent-dim); background: var(--bg-3); }
|
|
269
|
+
.stage-file-lite .sk { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--ok); }
|
|
270
|
+
.stage-file-lite .sp {
|
|
271
|
+
font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--faint);
|
|
272
|
+
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
273
|
+
}
|
|
274
|
+
.stage-file-lite .sa { font-size: 12px; color: var(--accent); }
|
|
275
|
+
.empty {
|
|
276
|
+
color: var(--faint); padding: 48px 8px;
|
|
277
|
+
text-align: center;
|
|
278
|
+
}
|
|
279
|
+
.empty strong { display: block; color: var(--muted); font-weight: 500; margin-bottom: 6px; }
|
|
280
|
+
.insp h2 {
|
|
281
|
+
font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
|
|
282
|
+
color: var(--faint); font-weight: 600; margin: 22px 0 10px;
|
|
283
|
+
}
|
|
284
|
+
.insp h2:first-child { margin-top: 0; }
|
|
285
|
+
.insp .kicker { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--accent); margin: 0 0 6px; }
|
|
286
|
+
.insp .title {
|
|
287
|
+
font-family: "Iowan Old Style", "Songti SC", Georgia, serif;
|
|
288
|
+
font-size: 22px; line-height: 1.3; margin: 0 0 16px;
|
|
289
|
+
}
|
|
290
|
+
.insp .title-btn {
|
|
291
|
+
font: inherit; color: inherit; text-align: left; text-decoration: none;
|
|
292
|
+
border-bottom: 1px solid var(--accent-dim);
|
|
293
|
+
}
|
|
294
|
+
.insp .title-btn:hover { color: var(--accent); }
|
|
295
|
+
.kv { display: grid; grid-template-columns: 76px 1fr; gap: 8px 12px; font-size: 13px; margin: 0 0 16px; }
|
|
296
|
+
.kv dt { color: var(--faint); }
|
|
297
|
+
.kv dd { margin: 0; }
|
|
298
|
+
.trace { margin: 4px 0 20px; }
|
|
299
|
+
.tstep {
|
|
300
|
+
display: grid; grid-template-columns: 18px 1fr; gap: 10px;
|
|
301
|
+
position: relative; align-items: stretch;
|
|
302
|
+
}
|
|
303
|
+
.tspine {
|
|
304
|
+
position: relative;
|
|
305
|
+
width: 18px;
|
|
306
|
+
justify-self: stretch;
|
|
307
|
+
}
|
|
308
|
+
.tstep .dot {
|
|
309
|
+
position: relative; z-index: 1;
|
|
310
|
+
display: block; box-sizing: border-box;
|
|
311
|
+
width: 10px; height: 10px; margin: 5px auto 0;
|
|
312
|
+
border-radius: 50%; background: var(--line);
|
|
313
|
+
}
|
|
314
|
+
.tstep .dot.on { background: var(--accent); }
|
|
315
|
+
.tstep .dot.here { background: var(--ok); box-shadow: 0 0 0 4px rgba(156,186,134,.18); }
|
|
316
|
+
.tstep .rail {
|
|
317
|
+
position: absolute;
|
|
318
|
+
left: 50%;
|
|
319
|
+
top: 15px;
|
|
320
|
+
bottom: -5px;
|
|
321
|
+
width: 2px;
|
|
322
|
+
margin-left: -1px;
|
|
323
|
+
background: var(--line);
|
|
324
|
+
border-radius: 1px;
|
|
325
|
+
pointer-events: none;
|
|
326
|
+
}
|
|
327
|
+
.tstep:last-child .rail { display: none; }
|
|
328
|
+
.tcard { padding: 0 0 16px; min-height: 28px; }
|
|
329
|
+
.tcard .note { margin-bottom: 6px; letter-spacing: .12em; text-transform: uppercase; font-size: 10px; }
|
|
330
|
+
.tcard button {
|
|
331
|
+
background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
|
|
332
|
+
border-radius: 10px; padding: 8px 10px; cursor: pointer; text-align: left; width: 100%; margin-top: 6px;
|
|
333
|
+
}
|
|
334
|
+
.tcard button:hover { border-color: var(--accent-dim); }
|
|
335
|
+
.vacant { color: var(--faint); font-size: 12px; font-style: italic; padding: 2px 0 4px; }
|
|
336
|
+
.note { font-size: 12px; color: var(--muted); }
|
|
337
|
+
.warn {
|
|
338
|
+
color: var(--gap); font-size: 12px; background: #f3ddd4; border-radius: 10px; padding: 10px 12px;
|
|
339
|
+
}
|
|
340
|
+
.subtabs { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin-bottom: 16px; }
|
|
341
|
+
.subtabs button { border-radius: 999px; padding: 6px 14px; }
|
|
342
|
+
footer.hint { margin-top: 28px; color: var(--faint); font-size: 12px; }
|
|
343
|
+
.stages { margin: 8px 0 14px; }
|
|
344
|
+
.stages .stage-lab {
|
|
345
|
+
font-size: 11px; color: var(--faint); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 8px;
|
|
346
|
+
}
|
|
347
|
+
.md-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
|
|
348
|
+
.md-actions button {
|
|
349
|
+
font-size: 12px; padding: 8px 12px; border-radius: 999px;
|
|
350
|
+
border: 1px solid var(--accent-dim); background: var(--bg-2); color: var(--sumi); cursor: pointer;
|
|
351
|
+
}
|
|
352
|
+
.md-actions button:hover { background: var(--chip); }
|
|
353
|
+
.serve-banner {
|
|
354
|
+
display: none; position: sticky; top: 0; z-index: 40;
|
|
355
|
+
background: #f3ddd4; color: var(--gap); font-size: 13px;
|
|
356
|
+
padding: 10px 18px; border-bottom: 1px solid var(--line);
|
|
357
|
+
}
|
|
358
|
+
.serve-banner.on { display: block; }
|
|
359
|
+
.serve-banner code {
|
|
360
|
+
font-size: 12px; background: rgba(0,0,0,.06); padding: 2px 6px; border-radius: 4px;
|
|
361
|
+
}
|
|
362
|
+
.md-modal {
|
|
363
|
+
display: none; position: fixed; inset: 0; z-index: 50;
|
|
364
|
+
background: rgba(36, 30, 22, .52);
|
|
365
|
+
backdrop-filter: blur(6px);
|
|
366
|
+
padding: 4vh 3vw;
|
|
367
|
+
align-items: center; justify-content: center;
|
|
368
|
+
}
|
|
369
|
+
.md-modal.on { display: flex; }
|
|
370
|
+
.md-sheet {
|
|
371
|
+
width: min(960px, 100%);
|
|
372
|
+
height: min(820px, 88vh);
|
|
373
|
+
margin: 0;
|
|
374
|
+
background:
|
|
375
|
+
linear-gradient(180deg, rgba(255,252,245,.55), transparent 48px),
|
|
376
|
+
var(--paper);
|
|
377
|
+
border: 1px solid #cbb896;
|
|
378
|
+
border-radius: 18px;
|
|
379
|
+
box-shadow:
|
|
380
|
+
0 1px 0 rgba(255,255,255,.55) inset,
|
|
381
|
+
0 28px 80px rgba(42, 32, 18, .28),
|
|
382
|
+
0 2px 0 rgba(90, 60, 20, .06);
|
|
383
|
+
display: flex; flex-direction: column; overflow: hidden;
|
|
384
|
+
position: relative;
|
|
385
|
+
}
|
|
386
|
+
.md-sheet::before {
|
|
387
|
+
content: "";
|
|
388
|
+
position: absolute; inset: 0; pointer-events: none; z-index: 0;
|
|
389
|
+
opacity: .08; mix-blend-mode: multiply; border-radius: inherit;
|
|
390
|
+
background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
|
|
391
|
+
}
|
|
392
|
+
.md-sheet > * { position: relative; z-index: 1; }
|
|
393
|
+
.md-sheet.run-mode { width: min(1120px, 100%); }
|
|
394
|
+
.md-head {
|
|
395
|
+
display: flex; align-items: center; gap: 14px; padding: 16px 20px 14px;
|
|
396
|
+
border-bottom: 1px solid rgba(180, 150, 100, .35);
|
|
397
|
+
background: linear-gradient(180deg, #f3ead6, #ebe1cb);
|
|
398
|
+
flex-shrink: 0;
|
|
399
|
+
}
|
|
400
|
+
.md-head .md-title {
|
|
401
|
+
flex: 1; min-width: 0; font-family: "Iowan Old Style", "Songti SC", Georgia, serif;
|
|
402
|
+
font-size: 19px; margin: 0; letter-spacing: .01em;
|
|
403
|
+
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
|
|
404
|
+
}
|
|
405
|
+
.md-head .md-sub {
|
|
406
|
+
font-size: 12px; color: var(--muted);
|
|
407
|
+
max-width: 42%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
|
|
408
|
+
}
|
|
409
|
+
.md-head button {
|
|
410
|
+
border: 1px solid var(--line); background: var(--paper); border-radius: 999px;
|
|
411
|
+
padding: 7px 13px; cursor: pointer; font-size: 12px; color: var(--text);
|
|
412
|
+
box-shadow: 0 1px 0 rgba(255,255,255,.5) inset;
|
|
413
|
+
}
|
|
414
|
+
.md-head button:hover { border-color: var(--accent-dim); }
|
|
415
|
+
.md-layout {
|
|
416
|
+
display: grid; grid-template-columns: 1fr; flex: 1; min-height: 0;
|
|
417
|
+
}
|
|
418
|
+
.md-sheet.run-mode .md-layout {
|
|
419
|
+
grid-template-columns: 228px 1fr;
|
|
420
|
+
}
|
|
421
|
+
.md-rail {
|
|
422
|
+
display: none; overflow: auto; padding: 18px 14px 24px;
|
|
423
|
+
border-right: 1px solid rgba(180, 150, 100, .35);
|
|
424
|
+
background:
|
|
425
|
+
linear-gradient(90deg, #e8dcc3 0%, #efe4cf 72%, #f3ead8 100%);
|
|
426
|
+
}
|
|
427
|
+
.md-sheet.run-mode .md-rail { display: block; }
|
|
428
|
+
.md-rail .rail-lab {
|
|
429
|
+
font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
|
|
430
|
+
color: var(--faint); padding: 0 6px 14px;
|
|
431
|
+
}
|
|
432
|
+
.md-rail .rail-flow {
|
|
433
|
+
list-style: none; margin: 0; padding: 0;
|
|
434
|
+
}
|
|
435
|
+
.md-rail .rail-flow > li { position: relative; }
|
|
436
|
+
.md-rail button.rail-step {
|
|
437
|
+
display: grid; grid-template-columns: 28px 1fr; gap: 4px 10px;
|
|
438
|
+
width: 100%; text-align: left; cursor: pointer;
|
|
439
|
+
border: 0; background: transparent; font: inherit; color: var(--muted);
|
|
440
|
+
padding: 0 6px 0 2px; border-radius: 12px; min-height: 52px;
|
|
441
|
+
}
|
|
442
|
+
.md-rail button.rail-step:hover .rail-card {
|
|
443
|
+
background: rgba(250, 246, 236, .72);
|
|
444
|
+
border-color: rgba(180, 150, 100, .45);
|
|
445
|
+
}
|
|
446
|
+
.md-rail button.rail-step.on .rail-card {
|
|
447
|
+
background: var(--paper);
|
|
448
|
+
border-color: rgba(156, 61, 50, .35);
|
|
449
|
+
box-shadow: 0 6px 16px rgba(70, 45, 20, .08);
|
|
450
|
+
color: var(--sumi);
|
|
451
|
+
}
|
|
452
|
+
.md-rail button.rail-step.miss { opacity: .42; cursor: default; }
|
|
453
|
+
.md-rail button.rail-step.miss:hover .rail-card { background: transparent; border-color: transparent; }
|
|
454
|
+
.md-rail .rail-spine {
|
|
455
|
+
display: flex; flex-direction: column; align-items: center;
|
|
456
|
+
padding-top: 14px;
|
|
457
|
+
}
|
|
458
|
+
.md-rail .rail-spine .dot {
|
|
459
|
+
width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0;
|
|
460
|
+
background: #cfc0a2;
|
|
461
|
+
border: 2px solid #efe4cf;
|
|
462
|
+
box-shadow: 0 0 0 1px rgba(120, 95, 55, .25);
|
|
463
|
+
z-index: 1;
|
|
464
|
+
}
|
|
465
|
+
.md-rail button.rail-step.has .dot {
|
|
466
|
+
background: var(--ok);
|
|
467
|
+
box-shadow: 0 0 0 1px rgba(74, 103, 80, .35);
|
|
468
|
+
}
|
|
469
|
+
.md-rail button.rail-step.on .dot {
|
|
470
|
+
background: var(--accent);
|
|
471
|
+
box-shadow: 0 0 0 4px rgba(156, 61, 50, .16);
|
|
472
|
+
}
|
|
473
|
+
.md-rail .rail-spine .wire {
|
|
474
|
+
width: 2px; flex: 1; min-height: 28px; margin-top: 4px;
|
|
475
|
+
background: linear-gradient(180deg, #c8b68f, #d9c9a8);
|
|
476
|
+
border-radius: 2px;
|
|
477
|
+
}
|
|
478
|
+
.md-rail .rail-flow > li:last-child .wire { display: none; }
|
|
479
|
+
.md-rail .rail-card {
|
|
480
|
+
margin: 4px 0 8px; padding: 10px 11px 9px;
|
|
481
|
+
border-radius: 11px; border: 1px solid transparent;
|
|
482
|
+
transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
|
|
483
|
+
}
|
|
484
|
+
.md-rail .rail-card .idx {
|
|
485
|
+
display: inline-block; min-width: 1.6em;
|
|
486
|
+
font-family: ui-monospace, Menlo, monospace;
|
|
487
|
+
font-size: 10px; color: var(--faint); letter-spacing: .04em;
|
|
488
|
+
margin-right: 6px;
|
|
489
|
+
}
|
|
490
|
+
.md-rail button.rail-step.on .idx { color: var(--accent); }
|
|
491
|
+
.md-rail .rail-card .sn {
|
|
492
|
+
font-family: "Iowan Old Style", "Songti SC", Georgia, serif;
|
|
493
|
+
font-size: 14px; line-height: 1.25; color: inherit;
|
|
494
|
+
}
|
|
495
|
+
.md-rail .rail-card .sf {
|
|
496
|
+
display: block; margin-top: 3px;
|
|
497
|
+
font-family: ui-monospace, Menlo, monospace;
|
|
498
|
+
font-size: 10px; color: var(--faint);
|
|
499
|
+
}
|
|
500
|
+
.md-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--paper); }
|
|
501
|
+
.md-toolbar {
|
|
502
|
+
display: flex; align-items: center; gap: 10px; padding: 11px 22px;
|
|
503
|
+
border-bottom: 1px solid rgba(180, 150, 100, .28); flex-shrink: 0;
|
|
504
|
+
background: rgba(244, 236, 220, .55);
|
|
505
|
+
}
|
|
506
|
+
.md-toolbar .md-path {
|
|
507
|
+
flex: 1; min-width: 0;
|
|
508
|
+
font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--faint);
|
|
509
|
+
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
|
|
510
|
+
}
|
|
511
|
+
.md-body {
|
|
512
|
+
overflow: auto; padding: 26px 30px 40px; flex: 1;
|
|
513
|
+
font-size: 15px; line-height: 1.7; color: var(--text);
|
|
514
|
+
}
|
|
515
|
+
.md-body .acct-kv {
|
|
516
|
+
display: grid; grid-template-columns: 110px 1fr; gap: 10px 14px;
|
|
517
|
+
margin: 0 0 18px; font-size: 14px;
|
|
518
|
+
}
|
|
519
|
+
.md-body .acct-kv dt { color: var(--faint); }
|
|
520
|
+
.md-body .acct-kv dd { margin: 0; }
|
|
521
|
+
.md-body .acct-note {
|
|
522
|
+
margin: 0 0 16px; padding: 12px 14px; border-radius: 12px;
|
|
523
|
+
background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); font-size: 13px;
|
|
524
|
+
}
|
|
525
|
+
.md-body .acct-voice {
|
|
526
|
+
border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2);
|
|
527
|
+
}
|
|
528
|
+
.md-body .acct-voice > summary {
|
|
529
|
+
cursor: pointer; list-style: none; padding: 12px 14px;
|
|
530
|
+
font-size: 13px; color: var(--sumi); display: flex; align-items: center; gap: 8px;
|
|
531
|
+
}
|
|
532
|
+
.md-body .acct-voice > summary::-webkit-details-marker { display: none; }
|
|
533
|
+
.md-body .acct-voice > summary::before {
|
|
534
|
+
content: "▸"; color: var(--accent); font-size: 12px;
|
|
535
|
+
}
|
|
536
|
+
.md-body .acct-voice[open] > summary::before { content: "▾"; }
|
|
537
|
+
.md-body .acct-voice > summary .sp {
|
|
538
|
+
margin-left: auto; font-family: ui-monospace, Menlo, monospace;
|
|
539
|
+
font-size: 11px; color: var(--faint);
|
|
540
|
+
}
|
|
541
|
+
.md-body .acct-voice-body {
|
|
542
|
+
padding: 4px 18px 18px; border-top: 1px solid var(--line);
|
|
543
|
+
background: var(--paper); border-radius: 0 0 12px 12px;
|
|
544
|
+
}
|
|
545
|
+
.md-body h1, .md-body h2, .md-body h3 {
|
|
546
|
+
font-family: "Iowan Old Style", "Songti SC", Georgia, serif;
|
|
547
|
+
line-height: 1.3; margin: 1.2em 0 .5em;
|
|
548
|
+
}
|
|
549
|
+
.md-body h1 { font-size: 1.55em; } .md-body h2 { font-size: 1.28em; } .md-body h3 { font-size: 1.1em; }
|
|
550
|
+
.md-body p, .md-body ul, .md-body ol { margin: 0 0 .85em; }
|
|
551
|
+
.md-body ul, .md-body ol { padding-left: 1.4em; }
|
|
552
|
+
.md-body code {
|
|
553
|
+
font-family: ui-monospace, Menlo, monospace; font-size: .88em;
|
|
554
|
+
background: var(--chip); padding: .1em .35em; border-radius: 4px;
|
|
555
|
+
}
|
|
556
|
+
.md-body pre {
|
|
557
|
+
background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px;
|
|
558
|
+
padding: 12px 14px; overflow: auto; font-size: 13px; line-height: 1.45;
|
|
559
|
+
}
|
|
560
|
+
.md-body pre code { background: none; padding: 0; }
|
|
561
|
+
.md-body blockquote {
|
|
562
|
+
margin: 0 0 .85em; padding: 0 0 0 14px; border-left: 3px solid var(--accent-dim); color: var(--muted);
|
|
563
|
+
}
|
|
564
|
+
.md-body a { color: var(--accent); }
|
|
565
|
+
.md-body table { border-collapse: collapse; width: 100%; font-size: 13px; margin: 0 0 1em; }
|
|
566
|
+
.md-body th, .md-body td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; }
|
|
567
|
+
.md-body th { background: var(--bg-2); }
|
|
568
|
+
@media (max-width: 980px) {
|
|
569
|
+
header.app { grid-template-columns: 1fr 1fr; }
|
|
570
|
+
nav.tabs { grid-column: 1 / -1; }
|
|
571
|
+
.shell { grid-template-columns: 1fr; height: auto; }
|
|
572
|
+
.insp { border-left: 0; border-top: 1px solid var(--line); min-height: 40vh; }
|
|
573
|
+
#q { width: 100%; }
|
|
574
|
+
.md-sheet, .md-sheet.run-mode {
|
|
575
|
+
width: 100%;
|
|
576
|
+
height: min(860px, 92vh);
|
|
577
|
+
}
|
|
578
|
+
.md-sheet.run-mode .md-layout { grid-template-columns: 1fr; }
|
|
579
|
+
.md-sheet.run-mode .md-rail {
|
|
580
|
+
display: block; border-right: 0; border-bottom: 1px solid rgba(180, 150, 100, .35);
|
|
581
|
+
max-height: 34%; overflow: auto;
|
|
582
|
+
}
|
|
583
|
+
.md-rail .rail-spine .wire { min-height: 12px; }
|
|
584
|
+
}
|
|
585
|
+
</style>
|
|
586
|
+
</head>
|
|
587
|
+
<body>
|
|
588
|
+
<div class="serve-banner" id="serveBanner"></div>
|
|
589
|
+
<header class="app">
|
|
590
|
+
<div class="brand">
|
|
591
|
+
<div class="mark" aria-hidden="true"></div>
|
|
592
|
+
<h1>观察台<small>Content Engine</small></h1>
|
|
593
|
+
</div>
|
|
594
|
+
<nav class="tabs" id="tabs"></nav>
|
|
595
|
+
<div class="search"><input id="q" type="search" placeholder="" /></div>
|
|
596
|
+
<div class="tools">
|
|
597
|
+
<select id="profileSel" aria-label="profile"></select>
|
|
598
|
+
<button type="button" id="langBtn">EN</button>
|
|
599
|
+
<span class="stamp" id="stamp"></span>
|
|
600
|
+
</div>
|
|
601
|
+
</header>
|
|
602
|
+
<div class="shell">
|
|
603
|
+
<section class="list" id="list"></section>
|
|
604
|
+
<aside class="insp" id="insp"><div class="empty"><strong>从左边拾起一件东西</strong>它从哪来、有没有被写过、发过没有、值不值得再拿出来——会在这里连成一条。</div></aside>
|
|
605
|
+
</div>
|
|
606
|
+
<div class="md-modal" id="mdModal" role="dialog" aria-modal="true" aria-labelledby="mdTitle">
|
|
607
|
+
<div class="md-sheet" id="mdSheet">
|
|
608
|
+
<div class="md-head">
|
|
609
|
+
<h2 class="md-title" id="mdTitle"></h2>
|
|
610
|
+
<span class="md-sub" id="mdSub"></span>
|
|
611
|
+
<button type="button" id="mdClose">✕</button>
|
|
612
|
+
</div>
|
|
613
|
+
<div class="md-layout">
|
|
614
|
+
<nav class="md-rail" id="mdRail" aria-label="stages"></nav>
|
|
615
|
+
<div class="md-main">
|
|
616
|
+
<div class="md-toolbar">
|
|
617
|
+
<span class="md-path" id="mdPath"></span>
|
|
618
|
+
</div>
|
|
619
|
+
<div class="md-body" id="mdBody"></div>
|
|
620
|
+
</div>
|
|
621
|
+
</div>
|
|
622
|
+
</div>
|
|
623
|
+
</div>
|
|
624
|
+
<script>
|
|
625
|
+
const GRAPH = /*__GRAPH__*/null;
|
|
626
|
+
const TRACE_ORDER = ["raw", "capture", "discovery", "topic", "swipe", "atom", "claim", "run", "published"];
|
|
627
|
+
const STR = {
|
|
628
|
+
zh: {
|
|
629
|
+
title: "Content Engine · 观察台",
|
|
630
|
+
brand: "观察台",
|
|
631
|
+
search: "搜索 ID、一句话、来源…",
|
|
632
|
+
overview: "总览", discovery: "发现", topics: "选题库", notes: "记录与知识", runs: "Run 档案", pub: "发布与复盘",
|
|
633
|
+
notes_in: "记下的", notes_lib: "进库的",
|
|
634
|
+
lead: "先认 IP,再看库存。",
|
|
635
|
+
kpi_cap: "记下的", kpi_lib: "进库的", kpi_topics: "选题", kpi_out: "下场",
|
|
636
|
+
kpi_cap_sub: "Capture", kpi_lib_sub: "Swipe / Atom / Claim",
|
|
637
|
+
kpi_topics_sub: "{n} 条 ready 未开单", kpi_out_sub: "Run / 已发帖",
|
|
638
|
+
ip_section: "IP · Profiles",
|
|
639
|
+
ip_all: "全部 Profile",
|
|
640
|
+
ip_accounts: "账号 {n}",
|
|
641
|
+
vault_title: "整库",
|
|
642
|
+
vault_kicker: "未选 Profile",
|
|
643
|
+
vault_lede: "点左边一张卡片,看该 IP 的支柱、账号与档案。数字只出现在这一侧。",
|
|
644
|
+
gap_section: "断链",
|
|
645
|
+
gap_none: "没有明显断链。",
|
|
646
|
+
gap_ready_n: "ready 选题未开单 {n}",
|
|
647
|
+
gap_lib_n: "Capture 未入库 {n}",
|
|
648
|
+
gap_review_n: "已发但无法复盘 {n}",
|
|
649
|
+
kv_profile: "Profile",
|
|
650
|
+
kind_profile: "Profile", kind_account: "账号",
|
|
651
|
+
profile_pillars: "支柱",
|
|
652
|
+
profile_accounts: "账号",
|
|
653
|
+
profile_docs: "档案文件",
|
|
654
|
+
profile_stats: "资产概览",
|
|
655
|
+
profile_voice_path: "Voice 路径",
|
|
656
|
+
doc_readme: "README",
|
|
657
|
+
doc_voice: "Voice",
|
|
658
|
+
doc_audience: "Audience",
|
|
659
|
+
doc_pillars: "Pillars",
|
|
660
|
+
empty_profile_t: "点选一个 Profile",
|
|
661
|
+
empty_profile_b: "右侧会显示该 IP 的支柱、账号、档案与断链。",
|
|
662
|
+
acct_handle: "Handle",
|
|
663
|
+
acct_voice: "Voice",
|
|
664
|
+
acct_platforms: "平台",
|
|
665
|
+
acct_default_plat: "默认平台",
|
|
666
|
+
acct_overrides: "Overrides",
|
|
667
|
+
acct_status: "状态",
|
|
668
|
+
acct_note: "Account 是挂在 Profile 上的发布身份;支柱 / audience / voice 在 Profile 档案里。",
|
|
669
|
+
acct_voice_md: "Voice Markdown",
|
|
670
|
+
gap_ready: "缺口:ready 选题未开单",
|
|
671
|
+
gap_lib: "缺口:Capture 未入库",
|
|
672
|
+
gap_review: "缺口:已发但无法复盘(result ≠ win/flat/loss)",
|
|
673
|
+
gap_unshipped: "无发布行",
|
|
674
|
+
gap_unshipped_box: "有 Run、没有发布行",
|
|
675
|
+
gap_superseded: "未发过 · 已取代",
|
|
676
|
+
gap_killed: "未发过 · 已放弃",
|
|
677
|
+
hint: "外链 src_likes 等是来源帖热度,不计入你的成绩。无趋势图:指标样本不够。",
|
|
678
|
+
none: "无", unused: "未开单", no_lib: "未入库", thin: "数据不足", no_ev: "无本库证据",
|
|
679
|
+
lib_use_hist: "使用史在 published/_index(swipe / atoms 列)。零件文件不建 Evidence 表。",
|
|
680
|
+
lib_claim_ev: "命题证据在本 claim 的 Evidence 表;命中率看 n/win/loss。",
|
|
681
|
+
f_status: "状态(登记)", f_pillar: "Pillar", f_src: "来源", f_use: "使用", f_unused: "未开单", f_promoted: "已开单",
|
|
682
|
+
f_sort: "排序",
|
|
683
|
+
f_sort_bookmarks: "Bookmarks ↓",
|
|
684
|
+
f_sort_replies: "Replies ↓",
|
|
685
|
+
f_sort_likes: "Likes ↓",
|
|
686
|
+
f_sort_views: "Views ↓",
|
|
687
|
+
f_sort_date: "日期 ↓",
|
|
688
|
+
f_sort_relevance: "Relevance ↓",
|
|
689
|
+
f_lib_kind: "种类", f_lib_subtype: "子类", f_lib_status: "状态",
|
|
690
|
+
kv_hits: "命中",
|
|
691
|
+
kv_refs: "开单引用",
|
|
692
|
+
kv_heat_at: "热度快照",
|
|
693
|
+
lib_refs: "{n} 次引用",
|
|
694
|
+
lib_n: "n {v}",
|
|
695
|
+
lib_win: "win {v}",
|
|
696
|
+
lib_loss: "loss {v}",
|
|
697
|
+
f_all: "全部",
|
|
698
|
+
f_run_ship: "发布", f_run_shipped: "已发布", f_run_unshipped: "未发布", f_run_plat: "平台",
|
|
699
|
+
f_run_topic: "选题", f_run_no_topic: "未绑选题",
|
|
700
|
+
f_run_topic_n: "{id} · {n}",
|
|
701
|
+
no_run: "无匹配 Run",
|
|
702
|
+
f_cap_ingest: "入库",
|
|
703
|
+
f_cap_ingested: "已入库",
|
|
704
|
+
f_cap_not_ingested: "未入库",
|
|
705
|
+
no_topic: "无匹配选题", no_discovery: "无匹配发现", no_note: "无匹配记录", no_pub: "尚无已发帖",
|
|
706
|
+
no_stage: "无阶段文件",
|
|
707
|
+
empty_t: "从左边拾起一件东西",
|
|
708
|
+
empty_b: "它从哪来、有没有被写过、发过没有、值不值得再拿出来——会在这里连成一条。",
|
|
709
|
+
obj: "对象", trace: "追溯", vacant: "未绑定",
|
|
710
|
+
read_md: "阅读 Markdown",
|
|
711
|
+
open_run: "打开阶段阅读",
|
|
712
|
+
open_stage: "打开",
|
|
713
|
+
stages_h: "阶段流程",
|
|
714
|
+
stages_hint: "点标题或下方按钮,打开阶段阅读。",
|
|
715
|
+
md_loading: "加载中…",
|
|
716
|
+
md_missing: "文件不存在或无法读取。",
|
|
717
|
+
md_need_serve: "需要本地 HTTP。在 Content Engine 根目录运行:",
|
|
718
|
+
serve_cmd: "python3 workbench/serve.py",
|
|
719
|
+
serve_banner: "请用本地服务打开观察台(file:// 无法读取 Markdown)。运行:",
|
|
720
|
+
readonly: "只读 · 由 indexes 生成 · 正文经 HTTP 即时读取,不改写库",
|
|
721
|
+
no_stage: "无文件",
|
|
722
|
+
src_url: "来源 URL:", src_heat: "来源帖热度,不是你的帖",
|
|
723
|
+
heat_hint: "来源帖热度 · 非我方成绩",
|
|
724
|
+
raw_section: "关联 Raw",
|
|
725
|
+
raw_link: "原始帖子",
|
|
726
|
+
raw_file: "Raw 文件",
|
|
727
|
+
raw_none: "未绑定 Raw / 无原始链接",
|
|
728
|
+
thin_warn: "数据不足:result 不是 win / flat / loss,不画趋势。",
|
|
729
|
+
topic_bind: "选题绑定:{t} · swipe {s} · claim {c}",
|
|
730
|
+
supersedes: "取代 {id}", superseded_by: "被取代 {id}",
|
|
731
|
+
kind_raw: "Raw", kind_capture: "Capture", kind_discovery: "发现", kind_topic: "选题", kind_swipe: "Swipe",
|
|
732
|
+
kind_atom: "Atom", kind_claim: "Claim", kind_run: "Run", kind_published: "发布",
|
|
733
|
+
kv_kind: "类型", kv_date: "日期", kv_status: "状态", kv_plat: "平台", kv_score: "分数", kv_relevance: "关联度", kv_ownership: "归属度", kv_product_relevance: "产品关联",
|
|
734
|
+
kv_use: "使用", kv_src: "来源", kv_result: "结果", kv_pillar: "支柱",
|
|
735
|
+
pub_lead: "这一页只列已经写进 published/_index 的 URL。Run 状态 ≠ 已发帖。",
|
|
736
|
+
pub_lede: "按 Profile 作用域过滤;没有 URL 的 Run 不会出现在这里。",
|
|
737
|
+
raw_yes: "有", raw_no: "无",
|
|
738
|
+
},
|
|
739
|
+
en: {
|
|
740
|
+
title: "Content Engine · Observatory",
|
|
741
|
+
brand: "Observatory",
|
|
742
|
+
search: "Search ID, one-liner, source…",
|
|
743
|
+
overview: "Overview", discovery: "Discovery", topics: "Topics", notes: "Notes & library", runs: "Run files", pub: "Shipped & review",
|
|
744
|
+
notes_in: "Captured", notes_lib: "Catalog",
|
|
745
|
+
lead: "Pick an IP, then inspect the stock.",
|
|
746
|
+
kpi_cap: "Captured", kpi_lib: "Catalog", kpi_topics: "Topics", kpi_out: "Outcomes",
|
|
747
|
+
kpi_cap_sub: "Capture", kpi_lib_sub: "Swipe / Atom / Claim",
|
|
748
|
+
kpi_topics_sub: "{n} ready, never opened as a run", kpi_out_sub: "Runs / shipped URLs",
|
|
749
|
+
ip_section: "IP · Profiles",
|
|
750
|
+
ip_all: "All profiles",
|
|
751
|
+
ip_accounts: "{n} account(s)",
|
|
752
|
+
vault_title: "Whole vault",
|
|
753
|
+
vault_kicker: "No Profile selected",
|
|
754
|
+
vault_lede: "Click a card on the left for that IP’s pillars, accounts, and files. Numbers live only on this side.",
|
|
755
|
+
gap_section: "Breaks",
|
|
756
|
+
gap_none: "No obvious breaks.",
|
|
757
|
+
gap_ready_n: "{n} ready topics with no run",
|
|
758
|
+
gap_lib_n: "{n} captures not ingested",
|
|
759
|
+
gap_review_n: "{n} shipped posts not reviewable",
|
|
760
|
+
kv_profile: "Profile",
|
|
761
|
+
kind_profile: "Profile", kind_account: "Account",
|
|
762
|
+
profile_pillars: "Pillars",
|
|
763
|
+
profile_accounts: "Accounts",
|
|
764
|
+
profile_docs: "Profile files",
|
|
765
|
+
profile_stats: "Asset snapshot",
|
|
766
|
+
profile_voice_path: "Voice path",
|
|
767
|
+
doc_readme: "README",
|
|
768
|
+
doc_voice: "Voice",
|
|
769
|
+
doc_audience: "Audience",
|
|
770
|
+
doc_pillars: "Pillars",
|
|
771
|
+
empty_profile_t: "Pick a Profile",
|
|
772
|
+
empty_profile_b: "The inspector shows that IP’s pillars, accounts, files, and breaks.",
|
|
773
|
+
acct_handle: "Handle",
|
|
774
|
+
acct_voice: "Voice",
|
|
775
|
+
acct_platforms: "Platforms",
|
|
776
|
+
acct_default_plat: "Default platform",
|
|
777
|
+
acct_overrides: "Overrides",
|
|
778
|
+
acct_status: "Status",
|
|
779
|
+
acct_note: "An Account is a publish identity on a Profile; pillars / audience / voice live in the Profile files.",
|
|
780
|
+
acct_voice_md: "Voice Markdown",
|
|
781
|
+
gap_ready: "Gap: ready topics with no run",
|
|
782
|
+
gap_lib: "Gap: Capture not ingested",
|
|
783
|
+
gap_review: "Gap: shipped but not reviewable (result ≠ win/flat/loss)",
|
|
784
|
+
gap_unshipped: "no ship row",
|
|
785
|
+
gap_unshipped_box: "Runs with no published row",
|
|
786
|
+
gap_superseded: "never shipped · superseded",
|
|
787
|
+
gap_killed: "never shipped · killed",
|
|
788
|
+
hint: "src_likes etc. are source-post heat, not your results. No trend charts: the sample is too thin.",
|
|
789
|
+
none: "None", unused: "unused", no_lib: "not ingested", thin: "too thin", no_ev: "no in-vault evidence",
|
|
790
|
+
lib_use_hist: "Use history is published/_index (swipe / atoms columns). No Evidence table in part files.",
|
|
791
|
+
lib_claim_ev: "Proposition evidence is this claim’s Evidence table; hit rate is n/win/loss.",
|
|
792
|
+
f_status: "Registry status", f_pillar: "Pillar", f_src: "Source", f_use: "Use", f_unused: "unused", f_promoted: "promoted",
|
|
793
|
+
f_sort: "Sort",
|
|
794
|
+
f_sort_bookmarks: "Bookmarks ↓",
|
|
795
|
+
f_sort_replies: "Replies ↓",
|
|
796
|
+
f_sort_likes: "Likes ↓",
|
|
797
|
+
f_sort_views: "Views ↓",
|
|
798
|
+
f_sort_date: "Date ↓",
|
|
799
|
+
f_sort_relevance: "Relevance ↓",
|
|
800
|
+
f_lib_kind: "Kind", f_lib_subtype: "Subtype", f_lib_status: "Status",
|
|
801
|
+
kv_hits: "Hits",
|
|
802
|
+
kv_refs: "Run uses",
|
|
803
|
+
kv_heat_at: "Heat snapshot",
|
|
804
|
+
lib_refs: "{n} cited",
|
|
805
|
+
lib_n: "n {v}",
|
|
806
|
+
lib_win: "win {v}",
|
|
807
|
+
lib_loss: "loss {v}",
|
|
808
|
+
f_all: "All",
|
|
809
|
+
f_run_ship: "Shipped", f_run_shipped: "Shipped", f_run_unshipped: "Unshipped", f_run_plat: "Platform",
|
|
810
|
+
f_run_topic: "Topic", f_run_no_topic: "No topic",
|
|
811
|
+
f_run_topic_n: "{id} · {n}",
|
|
812
|
+
no_run: "No matching runs",
|
|
813
|
+
f_cap_ingest: "Ingest",
|
|
814
|
+
f_cap_ingested: "Ingested",
|
|
815
|
+
f_cap_not_ingested: "Not ingested",
|
|
816
|
+
no_topic: "No matching topics", no_discovery: "No matching discoveries", no_note: "No matching notes", no_pub: "No shipped posts",
|
|
817
|
+
no_stage: "no stage files",
|
|
818
|
+
empty_t: "Pick something on the left",
|
|
819
|
+
empty_b: "Where it came from, whether it was written, whether it shipped, whether it is worth reusing — that chain shows up here.",
|
|
820
|
+
obj: "Object", trace: "Trace", vacant: "unbound",
|
|
821
|
+
read_md: "Read Markdown",
|
|
822
|
+
open_run: "Open stages",
|
|
823
|
+
open_stage: "Open",
|
|
824
|
+
stages_h: "Stages",
|
|
825
|
+
stages_hint: "Click the title or the button below to open the stage reader.",
|
|
826
|
+
md_loading: "Loading…",
|
|
827
|
+
md_missing: "File missing or unreadable.",
|
|
828
|
+
md_need_serve: "Needs local HTTP. From the Content Engine root run:",
|
|
829
|
+
serve_cmd: "python3 workbench/serve.py",
|
|
830
|
+
serve_banner: "Open the observatory via local serve (file:// cannot fetch Markdown). Run:",
|
|
831
|
+
readonly: "Read-only · indexes for structure · live Markdown over HTTP",
|
|
832
|
+
no_stage: "missing",
|
|
833
|
+
src_url: "Source URL: ", src_heat: "Source-post heat, not your post",
|
|
834
|
+
heat_hint: "Source-post heat · not our score",
|
|
835
|
+
raw_section: "Linked Raw",
|
|
836
|
+
raw_link: "Original post",
|
|
837
|
+
raw_file: "Raw file",
|
|
838
|
+
raw_none: "No Raw / no source URL",
|
|
839
|
+
thin_warn: "Too thin to review: result is not win / flat / loss. No chart.",
|
|
840
|
+
topic_bind: "Topic: {t} · swipe {s} · claim {c}",
|
|
841
|
+
supersedes: "supersedes {id}", superseded_by: "superseded by {id}",
|
|
842
|
+
kind_raw: "Raw", kind_capture: "Capture", kind_discovery: "Discovery", kind_topic: "Topic", kind_swipe: "Swipe",
|
|
843
|
+
kind_atom: "Atom", kind_claim: "Claim", kind_run: "Run", kind_published: "Shipped",
|
|
844
|
+
kv_kind: "Kind", kv_date: "Date", kv_status: "Status", kv_plat: "Platform", kv_score: "Score", kv_relevance: "Relevance", kv_ownership: "Ownership", kv_product_relevance: "Product relevance",
|
|
845
|
+
kv_use: "Use", kv_src: "Source", kv_result: "Result", kv_pillar: "Pillar",
|
|
846
|
+
pub_lead: "This view lists URLs written in published/_index. Run status is not the same as shipped.",
|
|
847
|
+
pub_lede: "Filtered by Profile scope; runs without a URL do not appear here.",
|
|
848
|
+
raw_yes: "yes", raw_no: "no",
|
|
849
|
+
},
|
|
850
|
+
};
|
|
851
|
+
|
|
852
|
+
let lang = localStorage.getItem("wb-lang") || "zh";
|
|
853
|
+
let profileScope = localStorage.getItem("wb-profile") || "";
|
|
854
|
+
function t(k, vars) {
|
|
855
|
+
let s = (STR[lang] && STR[lang][k]) || STR.zh[k] || k;
|
|
856
|
+
if (vars) Object.entries(vars).forEach(([a, b]) => { s = s.replaceAll("{" + a + "}", b); });
|
|
857
|
+
return s;
|
|
858
|
+
}
|
|
859
|
+
function kindName(k) { return t("kind_" + k); }
|
|
860
|
+
function profileList() { return GRAPH.profiles || []; }
|
|
861
|
+
function activePillars() {
|
|
862
|
+
const by = GRAPH.pillars_by_profile || {};
|
|
863
|
+
if (profileScope && by[profileScope]) return by[profileScope];
|
|
864
|
+
const merged = {};
|
|
865
|
+
Object.values(by).forEach(p => Object.assign(merged, p));
|
|
866
|
+
return Object.keys(merged).length ? merged : (GRAPH.pillars || {});
|
|
867
|
+
}
|
|
868
|
+
function pillarName(id) {
|
|
869
|
+
const p = activePillars()[id] || (GRAPH.pillars || {})[id];
|
|
870
|
+
if (!p) return id;
|
|
871
|
+
return lang === "zh" ? p.zh : p.en;
|
|
872
|
+
}
|
|
873
|
+
function formatPillar(cell) {
|
|
874
|
+
if (!cell) return "";
|
|
875
|
+
const ids = [...new Set(String(cell).match(/P\d+/g) || [])];
|
|
876
|
+
if (!ids.length) return cell;
|
|
877
|
+
const sep = lang === "zh" ? ":" : ": ";
|
|
878
|
+
return ids.map(id => `${id}${sep}${pillarName(id)}`).join(" · ");
|
|
879
|
+
}
|
|
880
|
+
function pillarIds() {
|
|
881
|
+
return Object.keys(activePillars());
|
|
882
|
+
}
|
|
883
|
+
function nodeProfiles(n) {
|
|
884
|
+
if (!n) return [];
|
|
885
|
+
if (n.kind === "profile") return [n.ident];
|
|
886
|
+
if (n.kind === "account") return n.profile_id ? [n.profile_id] : [];
|
|
887
|
+
if (n.profile) return [n.profile];
|
|
888
|
+
if (n.profiles) {
|
|
889
|
+
return String(n.profiles).split(",").map(s => s.trim()).filter(s => s && s !== "*");
|
|
890
|
+
}
|
|
891
|
+
if (n.kind === "published" && n.run_id) {
|
|
892
|
+
const run = GRAPH.nodes.find(x => x.kind === "run" && x.ident === n.run_id);
|
|
893
|
+
return run && run.profile ? [run.profile] : [];
|
|
894
|
+
}
|
|
895
|
+
if (n.kind === "raw" && n.capture_id) {
|
|
896
|
+
const c = GRAPH.nodes.find(x => x.kind === "capture" && x.ident === n.capture_id);
|
|
897
|
+
return c && c.profile ? [c.profile] : [];
|
|
898
|
+
}
|
|
899
|
+
return [];
|
|
900
|
+
}
|
|
901
|
+
function inScope(n) {
|
|
902
|
+
if (!profileScope) return true;
|
|
903
|
+
if (n.kind === "profile") return n.ident === profileScope;
|
|
904
|
+
if (n.kind === "account") return n.profile_id === profileScope;
|
|
905
|
+
if (n.lib && n.profiles) {
|
|
906
|
+
const parts = String(n.profiles).split(",").map(s => s.trim());
|
|
907
|
+
if (parts.includes("*") || parts.includes(profileScope)) return true;
|
|
908
|
+
return false;
|
|
909
|
+
}
|
|
910
|
+
const ps = nodeProfiles(n);
|
|
911
|
+
if (!ps.length) return true;
|
|
912
|
+
return ps.includes(profileScope);
|
|
913
|
+
}
|
|
914
|
+
function scoped(kind) { return GRAPH.nodes.filter(n => n.kind === kind && inScope(n)); }
|
|
915
|
+
|
|
916
|
+
const byId = Object.fromEntries(GRAPH.nodes.map(n => [n.id, n]));
|
|
917
|
+
const adj = new Map();
|
|
918
|
+
for (const e of GRAPH.edges) {
|
|
919
|
+
if (!adj.has(e.from)) adj.set(e.from, []);
|
|
920
|
+
if (!adj.has(e.to)) adj.set(e.to, []);
|
|
921
|
+
adj.get(e.from).push(e.to);
|
|
922
|
+
adj.get(e.to).push(e.from);
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
let view = "overview";
|
|
926
|
+
let notesTab = "notes";
|
|
927
|
+
let libKind = "";
|
|
928
|
+
let libSubtype = "";
|
|
929
|
+
let libStatus = "";
|
|
930
|
+
let runShip = "";
|
|
931
|
+
let runPlat = "";
|
|
932
|
+
let runTopic = "";
|
|
933
|
+
let pubTopic = "";
|
|
934
|
+
let pubPlat = "";
|
|
935
|
+
let topicStatus = "";
|
|
936
|
+
let topicPillar = "";
|
|
937
|
+
let topicSrc = "";
|
|
938
|
+
let topicUsage = "";
|
|
939
|
+
let discStatus = "";
|
|
940
|
+
let discSort = "bookmarks";
|
|
941
|
+
let capIngest = "";
|
|
942
|
+
let selected = null;
|
|
943
|
+
const $list = document.getElementById("list");
|
|
944
|
+
const $insp = document.getElementById("insp");
|
|
945
|
+
const $q = document.getElementById("q");
|
|
946
|
+
const tabs = document.getElementById("tabs");
|
|
947
|
+
const $modal = document.getElementById("mdModal");
|
|
948
|
+
const $sheet = document.getElementById("mdSheet");
|
|
949
|
+
const $mdTitle = document.getElementById("mdTitle");
|
|
950
|
+
const $mdSub = document.getElementById("mdSub");
|
|
951
|
+
const $mdPath = document.getElementById("mdPath");
|
|
952
|
+
const $mdBody = document.getElementById("mdBody");
|
|
953
|
+
const $mdRail = document.getElementById("mdRail");
|
|
954
|
+
const STAGE_ORDER = ["idea", "brief", "packet", "draft", "editor", "rubric", "pack", "feedback"];
|
|
955
|
+
let runModal = null; // { id, stage }
|
|
956
|
+
let mdFetchToken = 0;
|
|
957
|
+
document.getElementById("stamp").textContent = GRAPH.generated_at;
|
|
958
|
+
|
|
959
|
+
function vaultFetchUrl(rel) {
|
|
960
|
+
return "../" + String(rel || "").replace(/^\/+/, "");
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
function isHttpServe() {
|
|
964
|
+
return location.protocol === "http:" || location.protocol === "https:";
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
function refreshServeBanner() {
|
|
968
|
+
const el = document.getElementById("serveBanner");
|
|
969
|
+
if (!isHttpServe()) {
|
|
970
|
+
el.classList.add("on");
|
|
971
|
+
el.innerHTML = `${t("serve_banner")} <code>${esc(t("serve_cmd"))}</code>`;
|
|
972
|
+
} else {
|
|
973
|
+
el.classList.remove("on");
|
|
974
|
+
el.textContent = "";
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
function closeMd() {
|
|
979
|
+
$modal.classList.remove("on");
|
|
980
|
+
$sheet.classList.remove("run-mode");
|
|
981
|
+
$mdBody.innerHTML = "";
|
|
982
|
+
$mdRail.innerHTML = "";
|
|
983
|
+
$mdPath.textContent = "";
|
|
984
|
+
$mdSub.textContent = "";
|
|
985
|
+
runModal = null;
|
|
986
|
+
mdFetchToken += 1;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
async function loadMdIntoBody(rel) {
|
|
990
|
+
const token = ++mdFetchToken;
|
|
991
|
+
$mdPath.textContent = rel || "";
|
|
992
|
+
$mdBody.innerHTML = `<p class="note">${esc(t("md_loading"))}</p>`;
|
|
993
|
+
if (!rel) {
|
|
994
|
+
$mdBody.innerHTML = `<p class="md-err">${esc(t("md_missing"))}</p>`;
|
|
995
|
+
return;
|
|
996
|
+
}
|
|
997
|
+
if (!isHttpServe()) {
|
|
998
|
+
$mdBody.innerHTML = `<p class="md-err">${esc(t("md_need_serve"))}</p><p><code>${esc(t("serve_cmd"))}</code></p>`;
|
|
999
|
+
return;
|
|
1000
|
+
}
|
|
1001
|
+
try {
|
|
1002
|
+
const res = await fetch(vaultFetchUrl(rel));
|
|
1003
|
+
if (!res.ok) throw new Error(String(res.status));
|
|
1004
|
+
const text = await res.text();
|
|
1005
|
+
if (token !== mdFetchToken) return;
|
|
1006
|
+
$mdBody.innerHTML = renderMarkdown(text);
|
|
1007
|
+
} catch {
|
|
1008
|
+
if (token !== mdFetchToken) return;
|
|
1009
|
+
$mdBody.innerHTML = `<p class="md-err">${esc(t("md_missing"))}</p><p class="note">${esc(rel)}</p>`;
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
function paintRunRail(n, active) {
|
|
1014
|
+
const files = n.stage_files || {};
|
|
1015
|
+
const steps = STAGE_ORDER.map((k, i) => {
|
|
1016
|
+
const p = files[k];
|
|
1017
|
+
const cls = ["rail-step", p ? "has" : "miss", k === active ? "on" : ""].filter(Boolean).join(" ");
|
|
1018
|
+
const idx = String(i + 1).padStart(2, "0");
|
|
1019
|
+
const fileHint = p ? p.split("/").pop() : t("no_stage");
|
|
1020
|
+
return `<li><button type="button" class="${cls}" data-stage="${esc(k)}" ${p ? "" : "disabled"}>
|
|
1021
|
+
<span class="rail-spine" aria-hidden="true"><span class="dot"></span><span class="wire"></span></span>
|
|
1022
|
+
<span class="rail-card">
|
|
1023
|
+
<span class="sn"><span class="idx">${idx}</span>${esc(k)}</span>
|
|
1024
|
+
<span class="sf">${esc(fileHint)}</span>
|
|
1025
|
+
</span>
|
|
1026
|
+
</button></li>`;
|
|
1027
|
+
}).join("");
|
|
1028
|
+
$mdRail.innerHTML = `<div class="rail-lab">${t("stages_h")}</div><ol class="rail-flow">${steps}</ol>`;
|
|
1029
|
+
$mdRail.querySelectorAll("button[data-stage]:not([disabled])").forEach(btn => {
|
|
1030
|
+
btn.onclick = () => openRun(n, btn.getAttribute("data-stage"));
|
|
1031
|
+
});
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
function defaultStage(n) {
|
|
1035
|
+
const files = n.stage_files || {};
|
|
1036
|
+
return STAGE_ORDER.find(k => files[k]) || STAGE_ORDER[0];
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
function openRun(n, stage) {
|
|
1040
|
+
if (!n || n.kind !== "run") return;
|
|
1041
|
+
const files = n.stage_files || {};
|
|
1042
|
+
const st = stage && files[stage] ? stage : defaultStage(n);
|
|
1043
|
+
runModal = { id: n.id, stage: st };
|
|
1044
|
+
$sheet.classList.add("run-mode");
|
|
1045
|
+
$mdTitle.textContent = n.ident;
|
|
1046
|
+
$mdSub.textContent = n.label || "";
|
|
1047
|
+
paintRunRail(n, st);
|
|
1048
|
+
$modal.classList.add("on");
|
|
1049
|
+
loadMdIntoBody(files[st] || "");
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
async function openMd(rel, title) {
|
|
1053
|
+
if (!rel) return;
|
|
1054
|
+
runModal = null;
|
|
1055
|
+
$sheet.classList.remove("run-mode");
|
|
1056
|
+
$mdRail.innerHTML = "";
|
|
1057
|
+
$mdTitle.textContent = title || rel.split("/").pop();
|
|
1058
|
+
$mdSub.textContent = "";
|
|
1059
|
+
$modal.classList.add("on");
|
|
1060
|
+
await loadMdIntoBody(rel);
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
function accountVoicePath(n) {
|
|
1064
|
+
const v = String(n.voice || "").trim();
|
|
1065
|
+
if (!v || v === "profile") {
|
|
1066
|
+
return n.profile_id ? `profiles/${n.profile_id}/voice.md` : "";
|
|
1067
|
+
}
|
|
1068
|
+
return v;
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
function openAccount(n) {
|
|
1072
|
+
if (!n || n.kind !== "account") return;
|
|
1073
|
+
runModal = null;
|
|
1074
|
+
$sheet.classList.remove("run-mode");
|
|
1075
|
+
$mdRail.innerHTML = "";
|
|
1076
|
+
$mdTitle.textContent = n.ident;
|
|
1077
|
+
$mdSub.textContent = t("kind_account");
|
|
1078
|
+
$mdPath.textContent = "";
|
|
1079
|
+
const voicePath = accountVoicePath(n);
|
|
1080
|
+
const rows = [
|
|
1081
|
+
[t("acct_handle"), n.ident],
|
|
1082
|
+
[t("kv_profile"), n.profile_id],
|
|
1083
|
+
[t("acct_status"), n.status],
|
|
1084
|
+
[t("acct_platforms"), n.platforms],
|
|
1085
|
+
[t("acct_default_plat"), n.default_platform],
|
|
1086
|
+
[t("acct_voice"), voicePath || n.voice || t("none")],
|
|
1087
|
+
[t("acct_overrides"), n.overrides || t("none")],
|
|
1088
|
+
].filter(([, v]) => v);
|
|
1089
|
+
const voiceFold = voicePath
|
|
1090
|
+
? `<details class="acct-voice" id="acctVoice">
|
|
1091
|
+
<summary>${esc(t("acct_voice_md"))}<span class="sp">${esc(voicePath.split("/").pop())}</span></summary>
|
|
1092
|
+
<div class="acct-voice-body" id="acctVoiceBody"><p class="note">${esc(t("md_loading"))}</p></div>
|
|
1093
|
+
</details>`
|
|
1094
|
+
: "";
|
|
1095
|
+
$mdBody.innerHTML = `<dl class="acct-kv">${rows.map(([k, v]) =>
|
|
1096
|
+
`<dt>${esc(k)}</dt><dd>${esc(v)}</dd>`
|
|
1097
|
+
).join("")}</dl>
|
|
1098
|
+
<p class="acct-note">${esc(t("acct_note"))}</p>
|
|
1099
|
+
${voiceFold}`;
|
|
1100
|
+
$modal.classList.add("on");
|
|
1101
|
+
const fold = $mdBody.querySelector("#acctVoice");
|
|
1102
|
+
const body = $mdBody.querySelector("#acctVoiceBody");
|
|
1103
|
+
if (fold && body) {
|
|
1104
|
+
fold.addEventListener("toggle", async () => {
|
|
1105
|
+
if (!fold.open || body.dataset.loaded === "1") return;
|
|
1106
|
+
if (!isHttpServe()) {
|
|
1107
|
+
body.innerHTML = `<p class="md-err">${esc(t("md_need_serve"))}</p>`;
|
|
1108
|
+
return;
|
|
1109
|
+
}
|
|
1110
|
+
try {
|
|
1111
|
+
const res = await fetch(vaultFetchUrl(voicePath));
|
|
1112
|
+
if (!res.ok) throw new Error(String(res.status));
|
|
1113
|
+
body.innerHTML = renderMarkdown(await res.text());
|
|
1114
|
+
body.dataset.loaded = "1";
|
|
1115
|
+
} catch {
|
|
1116
|
+
body.innerHTML = `<p class="md-err">${esc(t("md_missing"))}</p><p class="note">${esc(voicePath)}</p>`;
|
|
1117
|
+
}
|
|
1118
|
+
});
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
function inlineMd(text) {
|
|
1123
|
+
return esc(text)
|
|
1124
|
+
.replace(/`([^`]+)`/g, "<code>$1</code>")
|
|
1125
|
+
.replace(/\*\*([^*]+)\*\*/g, "<strong>$1</strong>")
|
|
1126
|
+
.replace(/\[([^\]]+)\]\((https?:[^)\s]+)\)/g, '<a href="$2" target="_blank" rel="noreferrer">$1</a>');
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
function renderMarkdown(src) {
|
|
1130
|
+
const lines = String(src || "").replace(/\r\n/g, "\n").split("\n");
|
|
1131
|
+
const out = [];
|
|
1132
|
+
let i = 0;
|
|
1133
|
+
let para = [];
|
|
1134
|
+
let listType = null;
|
|
1135
|
+
const flushPara = () => {
|
|
1136
|
+
if (!para.length) return;
|
|
1137
|
+
out.push("<p>" + inlineMd(para.join(" ")) + "</p>");
|
|
1138
|
+
para = [];
|
|
1139
|
+
};
|
|
1140
|
+
const flushList = () => {
|
|
1141
|
+
if (!listType) return;
|
|
1142
|
+
out.push(listType === "ul" ? "</ul>" : "</ol>");
|
|
1143
|
+
listType = null;
|
|
1144
|
+
};
|
|
1145
|
+
while (i < lines.length) {
|
|
1146
|
+
const line = lines[i];
|
|
1147
|
+
if (line.startsWith("```")) {
|
|
1148
|
+
flushPara(); flushList();
|
|
1149
|
+
const buf = [];
|
|
1150
|
+
i += 1;
|
|
1151
|
+
while (i < lines.length && !lines[i].startsWith("```")) {
|
|
1152
|
+
buf.push(lines[i]);
|
|
1153
|
+
i += 1;
|
|
1154
|
+
}
|
|
1155
|
+
out.push("<pre><code>" + esc(buf.join("\n")) + "</code></pre>");
|
|
1156
|
+
i += 1;
|
|
1157
|
+
continue;
|
|
1158
|
+
}
|
|
1159
|
+
if (/^\|.+\|$/.test(line) && i + 1 < lines.length && /^\|[\s:\-|]+\|$/.test(lines[i + 1])) {
|
|
1160
|
+
flushPara(); flushList();
|
|
1161
|
+
const rows = [];
|
|
1162
|
+
while (i < lines.length && /^\|.+\|$/.test(lines[i])) {
|
|
1163
|
+
if (!/^\|[\s:\-|]+\|$/.test(lines[i])) rows.push(lines[i]);
|
|
1164
|
+
i += 1;
|
|
1165
|
+
}
|
|
1166
|
+
const cells = (row) => row.replace(/^\||\|$/g, "").split("|").map(c => c.trim());
|
|
1167
|
+
const head = cells(rows[0] || "");
|
|
1168
|
+
const body = rows.slice(1);
|
|
1169
|
+
out.push("<table><thead><tr>" + head.map(c => "<th>" + inlineMd(c) + "</th>").join("") + "</tr></thead>");
|
|
1170
|
+
out.push("<tbody>" + body.map(r => "<tr>" + cells(r).map(c => "<td>" + inlineMd(c) + "</td>").join("") + "</tr>").join("") + "</tbody></table>");
|
|
1171
|
+
continue;
|
|
1172
|
+
}
|
|
1173
|
+
if (!line.trim()) {
|
|
1174
|
+
flushPara(); flushList();
|
|
1175
|
+
i += 1;
|
|
1176
|
+
continue;
|
|
1177
|
+
}
|
|
1178
|
+
const hm = /^(#{1,3})\s+(.+)$/.exec(line);
|
|
1179
|
+
if (hm) {
|
|
1180
|
+
flushPara(); flushList();
|
|
1181
|
+
const lvl = hm[1].length;
|
|
1182
|
+
out.push(`<h${lvl}>` + inlineMd(hm[2]) + `</h${lvl}>`);
|
|
1183
|
+
i += 1;
|
|
1184
|
+
continue;
|
|
1185
|
+
}
|
|
1186
|
+
if (/^>\s?/.test(line)) {
|
|
1187
|
+
flushPara(); flushList();
|
|
1188
|
+
out.push("<blockquote><p>" + inlineMd(line.replace(/^>\s?/, "")) + "</p></blockquote>");
|
|
1189
|
+
i += 1;
|
|
1190
|
+
continue;
|
|
1191
|
+
}
|
|
1192
|
+
const ul = /^[-*]\s+(.+)$/.exec(line);
|
|
1193
|
+
const ol = /^\d+\.\s+(.+)$/.exec(line);
|
|
1194
|
+
if (ul || ol) {
|
|
1195
|
+
flushPara();
|
|
1196
|
+
const kind = ul ? "ul" : "ol";
|
|
1197
|
+
if (listType !== kind) {
|
|
1198
|
+
flushList();
|
|
1199
|
+
listType = kind;
|
|
1200
|
+
out.push(kind === "ul" ? "<ul>" : "<ol>");
|
|
1201
|
+
}
|
|
1202
|
+
out.push("<li>" + inlineMd((ul || ol)[1]) + "</li>");
|
|
1203
|
+
i += 1;
|
|
1204
|
+
continue;
|
|
1205
|
+
}
|
|
1206
|
+
flushList();
|
|
1207
|
+
para.push(line);
|
|
1208
|
+
i += 1;
|
|
1209
|
+
}
|
|
1210
|
+
flushPara();
|
|
1211
|
+
flushList();
|
|
1212
|
+
return out.join("\n") || "<p></p>";
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
function mdFileForNode(n) {
|
|
1216
|
+
if (!n) return "";
|
|
1217
|
+
if (n.kind === "run") return "";
|
|
1218
|
+
if (n.open_file) return n.open_file;
|
|
1219
|
+
if (n.path && String(n.path).endsWith(".md")) return n.path;
|
|
1220
|
+
return "";
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
function runMetaHtml(n) {
|
|
1224
|
+
const files = n.stage_files || {};
|
|
1225
|
+
const have = STAGE_ORDER.filter(k => files[k]).join(" · ") || t("no_stage");
|
|
1226
|
+
const sel = n.selection || {};
|
|
1227
|
+
return `<p class="note">${t("stages_h")}:${esc(have)}</p>
|
|
1228
|
+
<p class="note">${t("topic_bind", { t: n.topic_id || t("none"), s: sel.swipe, c: sel.claim })}</p>
|
|
1229
|
+
${n.supersedes ? `<p class="note">${t("supersedes", { id: n.supersedes })}</p>` : ""}
|
|
1230
|
+
${n.superseded_by ? `<p class="note">${t("superseded_by", { id: n.superseded_by })}</p>` : ""}`;
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
function mdActionsHtml(n) {
|
|
1234
|
+
if (n.kind === "run") {
|
|
1235
|
+
return `<div class="md-actions"><button type="button" data-run-open="${esc(n.id)}">${t("open_run")}</button></div>
|
|
1236
|
+
<p class="note">${t("stages_hint")}</p>`;
|
|
1237
|
+
}
|
|
1238
|
+
const path = mdFileForNode(n);
|
|
1239
|
+
if (!path) return "";
|
|
1240
|
+
return `<div class="md-actions"><button type="button" data-md="${esc(path)}" data-md-title="${esc(n.ident)}">${t("read_md")}</button></div>`;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
document.addEventListener("click", (e) => {
|
|
1244
|
+
const runBtn = e.target.closest("[data-run-open]");
|
|
1245
|
+
if (runBtn && !runBtn.closest("#mdModal")) {
|
|
1246
|
+
e.preventDefault();
|
|
1247
|
+
e.stopPropagation();
|
|
1248
|
+
const node = byId[runBtn.getAttribute("data-run-open")];
|
|
1249
|
+
if (node) openRun(node);
|
|
1250
|
+
return;
|
|
1251
|
+
}
|
|
1252
|
+
const acctBtn = e.target.closest("[data-account-open]");
|
|
1253
|
+
if (acctBtn && !acctBtn.closest("#mdModal")) {
|
|
1254
|
+
e.preventDefault();
|
|
1255
|
+
e.stopPropagation();
|
|
1256
|
+
const node = byId[acctBtn.getAttribute("data-account-open")];
|
|
1257
|
+
if (node) openAccount(node);
|
|
1258
|
+
return;
|
|
1259
|
+
}
|
|
1260
|
+
const el = e.target.closest("[data-md]");
|
|
1261
|
+
if (!el || el.closest("#mdModal")) return;
|
|
1262
|
+
const rel = el.getAttribute("data-md");
|
|
1263
|
+
if (!rel) return;
|
|
1264
|
+
e.preventDefault();
|
|
1265
|
+
e.stopPropagation();
|
|
1266
|
+
openMd(rel, el.getAttribute("data-md-title") || "");
|
|
1267
|
+
});
|
|
1268
|
+
|
|
1269
|
+
document.getElementById("mdClose").onclick = closeMd;
|
|
1270
|
+
$modal.addEventListener("click", (e) => { if (e.target === $modal) closeMd(); });
|
|
1271
|
+
document.addEventListener("keydown", (e) => { if (e.key === "Escape") closeMd(); });
|
|
1272
|
+
|
|
1273
|
+
function applyChrome() {
|
|
1274
|
+
document.documentElement.lang = lang === "zh" ? "zh-CN" : "en";
|
|
1275
|
+
document.title = t("title");
|
|
1276
|
+
document.querySelector("header h1").innerHTML = `${t("brand")}<small>Content Engine</small>`;
|
|
1277
|
+
$q.placeholder = t("search");
|
|
1278
|
+
document.getElementById("langBtn").textContent = lang === "zh" ? "EN" : "中文";
|
|
1279
|
+
refreshServeBanner();
|
|
1280
|
+
const sel = document.getElementById("profileSel");
|
|
1281
|
+
const ids = profileList().map(p => p.id);
|
|
1282
|
+
if (profileScope && !ids.includes(profileScope)) profileScope = "";
|
|
1283
|
+
sel.innerHTML = `<option value="">${t("ip_all")}</option>` +
|
|
1284
|
+
ids.map(id => `<option value="${id}" ${id === profileScope ? "selected" : ""}>${id}</option>`).join("");
|
|
1285
|
+
tabs.innerHTML = "";
|
|
1286
|
+
for (const id of ["overview", "discovery", "topics", "notes", "runs", "pub"]) {
|
|
1287
|
+
const b = document.createElement("button");
|
|
1288
|
+
b.textContent = t(id);
|
|
1289
|
+
b.dataset.view = id;
|
|
1290
|
+
b.onclick = () => { view = id; render(); };
|
|
1291
|
+
tabs.appendChild(b);
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
document.getElementById("langBtn").onclick = () => {
|
|
1295
|
+
lang = lang === "zh" ? "en" : "zh";
|
|
1296
|
+
localStorage.setItem("wb-lang", lang);
|
|
1297
|
+
applyChrome();
|
|
1298
|
+
render();
|
|
1299
|
+
};
|
|
1300
|
+
document.getElementById("profileSel").onchange = (e) => {
|
|
1301
|
+
profileScope = e.target.value;
|
|
1302
|
+
localStorage.setItem("wb-profile", profileScope);
|
|
1303
|
+
if (profileScope) selected = `profile:${profileScope}`;
|
|
1304
|
+
else if (selected && byId[selected]?.kind === "profile") selected = null;
|
|
1305
|
+
applyChrome();
|
|
1306
|
+
render();
|
|
1307
|
+
};
|
|
1308
|
+
|
|
1309
|
+
$q.addEventListener("input", () => render());
|
|
1310
|
+
|
|
1311
|
+
function nodesOf(kind) { return GRAPH.nodes.filter(n => n.kind === kind && inScope(n)); }
|
|
1312
|
+
function nodesOfAll(kind) { return GRAPH.nodes.filter(n => n.kind === kind); }
|
|
1313
|
+
function runIsShipped(r) {
|
|
1314
|
+
if ((r.ship_urls || []).length) return true;
|
|
1315
|
+
return nodesOf("published").some(p =>
|
|
1316
|
+
(p.run_id && p.run_id === r.ident) ||
|
|
1317
|
+
(r.folder && p.run_folder && p.run_folder === r.folder)
|
|
1318
|
+
);
|
|
1319
|
+
}
|
|
1320
|
+
function runClosedWithoutShip(r) {
|
|
1321
|
+
return r.status === "superseded" || r.status === "killed";
|
|
1322
|
+
}
|
|
1323
|
+
function unshippedRuns() {
|
|
1324
|
+
return nodesOf("run").filter(r => !runIsShipped(r) && !runClosedWithoutShip(r));
|
|
1325
|
+
}
|
|
1326
|
+
function citesPart(p, n) {
|
|
1327
|
+
const id = n.ident;
|
|
1328
|
+
const cell = n.kind === "swipe" ? p.swipe : n.kind === "atom" ? p.atoms : n.kind === "claim" ? p.claim : "";
|
|
1329
|
+
const v = String(cell || "").trim();
|
|
1330
|
+
if (!v || v.toLowerCase() === "none") return false;
|
|
1331
|
+
return v.split(/[,;]/).some(tok => (tok.split(":").pop() || "").trim() === id);
|
|
1332
|
+
}
|
|
1333
|
+
function publishedFor(n, ctx) {
|
|
1334
|
+
if (n.kind === "published") return [n];
|
|
1335
|
+
if (n.kind === "swipe" || n.kind === "atom" || n.kind === "claim") {
|
|
1336
|
+
return nodesOf("published").filter(p => citesPart(p, n));
|
|
1337
|
+
}
|
|
1338
|
+
const runs = n.kind === "run" ? [n] : ctx.filter(x => x.kind === "run");
|
|
1339
|
+
return nodesOf("published").filter(p => runs.some(r =>
|
|
1340
|
+
(p.run_id && p.run_id === r.ident) || (r.folder && p.run_folder === r.folder)
|
|
1341
|
+
));
|
|
1342
|
+
}
|
|
1343
|
+
function qmatch(n) {
|
|
1344
|
+
const q = $q.value.trim().toLowerCase();
|
|
1345
|
+
if (!q) return true;
|
|
1346
|
+
const blob = [n.ident, n.label, n.kind, n.status, n.pillar, n.profile, n.profiles, n.src_handle, n.url, n.notes, n.type, n.atom_type, n.topic_id].filter(Boolean).join(" ").toLowerCase();
|
|
1347
|
+
return blob.includes(q);
|
|
1348
|
+
}
|
|
1349
|
+
function connected(id) {
|
|
1350
|
+
const seen = new Set([id]);
|
|
1351
|
+
const q = [id];
|
|
1352
|
+
while (q.length) {
|
|
1353
|
+
const cur = q.shift();
|
|
1354
|
+
for (const n of adj.get(cur) || []) {
|
|
1355
|
+
if (!seen.has(n)) { seen.add(n); q.push(n); }
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
return [...seen].map(i => byId[i]).filter(Boolean);
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
function select(id) {
|
|
1362
|
+
const n = byId[id];
|
|
1363
|
+
if (view === "overview" && n && n.kind === "account") {
|
|
1364
|
+
openAccount(n);
|
|
1365
|
+
return;
|
|
1366
|
+
}
|
|
1367
|
+
selected = id;
|
|
1368
|
+
render();
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
function rowEl(n, extra) {
|
|
1372
|
+
const d = document.createElement("div");
|
|
1373
|
+
d.className = "row" + (selected === n.id ? " sel" : "");
|
|
1374
|
+
d.dataset.kind = n.kind;
|
|
1375
|
+
d.onclick = () => select(n.id);
|
|
1376
|
+
const score = n.kind === "topic" && (n.craft || n.total)
|
|
1377
|
+
? `<div class="score">${esc(n.fit ? `${n.craft}/${n.fit}` : n.total)}</div>`
|
|
1378
|
+
: "";
|
|
1379
|
+
const clean = n.kind === "run" || n.kind === "published";
|
|
1380
|
+
const meta = clean ? "" : (extra || metaLine(n));
|
|
1381
|
+
d.innerHTML = `<div class="stripe"></div>
|
|
1382
|
+
<div>
|
|
1383
|
+
<div class="id">${esc(n.ident)}</div>
|
|
1384
|
+
<div class="label">${esc(n.label)}</div>
|
|
1385
|
+
${meta ? `<div class="meta">${esc(meta)}</div>` : ""}
|
|
1386
|
+
</div>
|
|
1387
|
+
<div class="side">
|
|
1388
|
+
<div class="pills">${score}${pills(n)}</div>
|
|
1389
|
+
${clean ? platMarkHtml(n) : ""}
|
|
1390
|
+
</div>`;
|
|
1391
|
+
return d;
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
function runPlatform(n) {
|
|
1395
|
+
return String(n.primary_platform || n.platform || n.platforms || "").split(",")[0].trim().toLowerCase();
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
function platMarkHtml(n) {
|
|
1399
|
+
const id = runPlatform(n);
|
|
1400
|
+
const marks = {
|
|
1401
|
+
x: { t: "𝕏", bg: "#171411", fg: "#f4ecdc" },
|
|
1402
|
+
twitter: { t: "𝕏", bg: "#171411", fg: "#f4ecdc" },
|
|
1403
|
+
tiktok: { t: "Tk", bg: "#111111", fg: "#69c9d0" },
|
|
1404
|
+
instagram: { t: "Ig", bg: "#c13584", fg: "#fff" },
|
|
1405
|
+
linkedin: { t: "in", bg: "#0a66c2", fg: "#fff" },
|
|
1406
|
+
threads: { t: "Th", bg: "#1c1915", fg: "#f4ecdc" },
|
|
1407
|
+
xiaohongshu: { t: "红", bg: "#ff2442", fg: "#fff" },
|
|
1408
|
+
};
|
|
1409
|
+
const m = marks[id] || { t: (id || "?").slice(0, 2), bg: "#6e675c", fg: "#faf6ec" };
|
|
1410
|
+
return `<span class="plat-mark" title="${esc(id || "")}" style="background:${m.bg};color:${m.fg}">${m.t}</span>`;
|
|
1411
|
+
}
|
|
1412
|
+
function metaLine(n) {
|
|
1413
|
+
return [n.date, n.profile, n.status, formatPillar(n.pillar), n.platform || n.platforms, n.type || n.atom_type || n.form].filter(Boolean).join(" · ");
|
|
1414
|
+
}
|
|
1415
|
+
function numCompact(v) {
|
|
1416
|
+
if (v === null || v === undefined || v === "") return null;
|
|
1417
|
+
const n = Number(String(v).replace(/,/g, ""));
|
|
1418
|
+
if (!Number.isFinite(n)) return null;
|
|
1419
|
+
if (n >= 10000) return `${(n / 1000).toFixed(n % 1000 === 0 ? 0 : 1)}k`;
|
|
1420
|
+
if (n >= 1000) return `${(n / 1000).toFixed(1)}k`.replace(/\.0k$/, "k");
|
|
1421
|
+
return String(Math.round(n));
|
|
1422
|
+
}
|
|
1423
|
+
function heatMetric(n, key) {
|
|
1424
|
+
return numCompact(n[`src_${key}`]);
|
|
1425
|
+
}
|
|
1426
|
+
function heatStripHtml(n, opts = {}) {
|
|
1427
|
+
const hint = opts.hint ? `<span class="heat-note">${esc(t("heat_hint"))}</span>` : "";
|
|
1428
|
+
const items = [
|
|
1429
|
+
{ key: "likes", sym: "♥", title: "likes" },
|
|
1430
|
+
{ key: "replies", sym: "↩", title: "replies" },
|
|
1431
|
+
{ key: "bookmarks", sym: "🔖", title: "bookmarks" },
|
|
1432
|
+
{ key: "views", sym: "👁", title: "views" },
|
|
1433
|
+
];
|
|
1434
|
+
const chips = items.map(({ key, sym, title }) => {
|
|
1435
|
+
const val = heatMetric(n, key);
|
|
1436
|
+
const shown = val === null ? "—" : val;
|
|
1437
|
+
const empty = val === null ? " empty" : "";
|
|
1438
|
+
return `<span class="heat-chip ${key}${empty}" title="${esc(title)}"><span class="sym">${sym}</span><span class="val">${esc(shown)}</span></span>`;
|
|
1439
|
+
}).join("");
|
|
1440
|
+
return `<div class="heat" title="${esc(t("heat_hint"))}">${chips}</div>${hint}`;
|
|
1441
|
+
}
|
|
1442
|
+
function discoveryRowEl(n, extra) {
|
|
1443
|
+
const d = document.createElement("div");
|
|
1444
|
+
d.className = "row" + (selected === n.id ? " sel" : "");
|
|
1445
|
+
d.dataset.kind = n.kind;
|
|
1446
|
+
d.onclick = () => select(n.id);
|
|
1447
|
+
const meta = extra || metaLine(n);
|
|
1448
|
+
d.innerHTML = `<div class="stripe"></div>
|
|
1449
|
+
<div>
|
|
1450
|
+
<div class="id">${esc(n.ident)}</div>
|
|
1451
|
+
<div class="label">${esc(n.label)}</div>
|
|
1452
|
+
${meta ? `<div class="meta">${esc(meta)}</div>` : ""}
|
|
1453
|
+
${heatStripHtml(n)}
|
|
1454
|
+
</div>
|
|
1455
|
+
<div class="side">
|
|
1456
|
+
<div class="pills">${pills(n)}</div>
|
|
1457
|
+
${platMarkHtml(n)}
|
|
1458
|
+
</div>`;
|
|
1459
|
+
return d;
|
|
1460
|
+
}
|
|
1461
|
+
function sortDiscoveries(rows, mode) {
|
|
1462
|
+
const missing = -1;
|
|
1463
|
+
const num = (n, key) => {
|
|
1464
|
+
const v = Number(String(n[`src_${key}`] ?? "").replace(/,/g, ""));
|
|
1465
|
+
return Number.isFinite(v) ? v : missing;
|
|
1466
|
+
};
|
|
1467
|
+
return rows.slice().sort((a, b) => {
|
|
1468
|
+
let cmp = 0;
|
|
1469
|
+
if (mode === "likes") cmp = num(b, "likes") - num(a, "likes");
|
|
1470
|
+
else if (mode === "replies") cmp = num(b, "replies") - num(a, "replies");
|
|
1471
|
+
else if (mode === "views") cmp = num(b, "views") - num(a, "views");
|
|
1472
|
+
else if (mode === "date") cmp = String(b.date || "").localeCompare(String(a.date || ""));
|
|
1473
|
+
else cmp = num(b, "bookmarks") - num(a, "bookmarks");
|
|
1474
|
+
if (cmp !== 0) return cmp;
|
|
1475
|
+
return String(b.date || "").localeCompare(String(a.date || ""));
|
|
1476
|
+
});
|
|
1477
|
+
}
|
|
1478
|
+
function pills(n) {
|
|
1479
|
+
const bits = [];
|
|
1480
|
+
if (n.kind === "discovery") {
|
|
1481
|
+
const st = n.status || "";
|
|
1482
|
+
const cls = st === "read" || st === "promoted" ? "ok"
|
|
1483
|
+
: (st === "saved" || st === "rejected" || st === "unread" ? "gap" : "");
|
|
1484
|
+
if (st) bits.push(`<span class="pill ${cls}">${esc(st)}</span>`);
|
|
1485
|
+
if (n.source_role) bits.push(`<span class="pill">${esc(n.source_role)}</span>`);
|
|
1486
|
+
if (n.next_action && n.next_action !== "none") bits.push(`<span class="pill">${esc(n.next_action)}</span>`);
|
|
1487
|
+
}
|
|
1488
|
+
if (n.kind === "topic") {
|
|
1489
|
+
bits.push(`<span class="pill">${esc(n.status)}</span>`);
|
|
1490
|
+
bits.push(n.usage === "unused" ? `<span class="pill gap">${t("unused")}</span>` : `<span class="pill ok">${esc(n.usage)}</span>`);
|
|
1491
|
+
}
|
|
1492
|
+
if (n.kind === "run") {
|
|
1493
|
+
const cls = n.status === "published" ? "ok" : n.status === "superseded" || n.status === "killed" ? "gap" : "";
|
|
1494
|
+
bits.push(`<span class="pill ${cls}">${esc(n.status)}</span>`);
|
|
1495
|
+
if (!runIsShipped(n)) {
|
|
1496
|
+
if (n.status === "superseded") bits.push(`<span class="pill">${t("gap_superseded")}</span>`);
|
|
1497
|
+
else if (n.status === "killed") bits.push(`<span class="pill">${t("gap_killed")}</span>`);
|
|
1498
|
+
else bits.push(`<span class="pill gap">${t("gap_unshipped")}</span>`);
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
if (n.kind === "capture" && n.library_cell === "none") bits.push(`<span class="pill gap">${t("no_lib")}</span>`);
|
|
1502
|
+
if (n.kind === "published") {
|
|
1503
|
+
if (n.result) bits.push(`<span class="pill">${esc(n.result)}</span>`);
|
|
1504
|
+
if (!n.reviewable) bits.push(`<span class="pill gap">${t("thin")}</span>`);
|
|
1505
|
+
}
|
|
1506
|
+
if (n.kind === "swipe" || n.kind === "atom" || n.kind === "claim") {
|
|
1507
|
+
const st = n.status || "";
|
|
1508
|
+
const cls = n.kind === "claim"
|
|
1509
|
+
? (st === "supported" ? "ok" : (st === "weakened" || st === "retired" ? "gap" : ""))
|
|
1510
|
+
: (st === "working" ? "ok" : (st === "dead" ? "gap" : ""));
|
|
1511
|
+
const row1 = [];
|
|
1512
|
+
if (st) row1.push(`<span class="pill ${cls}">${esc(st)}</span>`);
|
|
1513
|
+
row1.push(`<span class="pill hit-win">${esc(t("lib_win", { v: n.win ?? 0 }))}</span>`);
|
|
1514
|
+
row1.push(`<span class="pill hit-loss">${esc(t("lib_loss", { v: n.loss ?? 0 }))}</span>`);
|
|
1515
|
+
row1.push(`<span class="pill hit-n">${esc(t("lib_n", { v: n.n ?? 0 }))}</span>`);
|
|
1516
|
+
const row2 = [`<span class="pill">${esc(t("lib_refs", { n: n.refs ?? 0 }))}</span>`];
|
|
1517
|
+
if (n.kind === "claim" && !n.has_evidence) row2.push(`<span class="pill gap">${t("no_ev")}</span>`);
|
|
1518
|
+
bits.push(`<span class="pill-stack"><span class="pill-row">${row1.join("")}</span><span class="pill-row">${row2.join("")}</span></span>`);
|
|
1519
|
+
}
|
|
1520
|
+
return bits.join("");
|
|
1521
|
+
}
|
|
1522
|
+
function esc(s) {
|
|
1523
|
+
return String(s ?? "").replace(/[&<>"]/g, c => ({ "&": "&", "<": "<", ">": ">", '"': """ }[c]));
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
function render() {
|
|
1527
|
+
for (const b of tabs.querySelectorAll("button")) b.classList.toggle("on", b.dataset.view === view);
|
|
1528
|
+
if (view === "overview") renderOverview();
|
|
1529
|
+
if (view === "discovery") renderDiscovery();
|
|
1530
|
+
if (view === "topics") renderTopics();
|
|
1531
|
+
if (view === "notes") renderNotes();
|
|
1532
|
+
if (view === "runs") renderRuns();
|
|
1533
|
+
if (view === "pub") renderPub();
|
|
1534
|
+
renderInsp();
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
function renderOverview() {
|
|
1538
|
+
$list.innerHTML = "";
|
|
1539
|
+
$list.insertAdjacentHTML("beforeend", `<p class="lead">${t("lead")}</p>`);
|
|
1540
|
+
const ipSec = document.createElement("h2");
|
|
1541
|
+
ipSec.className = "note";
|
|
1542
|
+
ipSec.style.cssText = "letter-spacing:.12em;text-transform:uppercase;margin:8px 0 10px;font-size:11px;";
|
|
1543
|
+
ipSec.textContent = `${t("ip_section")} · ${profileList().length}`;
|
|
1544
|
+
$list.appendChild(ipSec);
|
|
1545
|
+
const ipgrid = document.createElement("div");
|
|
1546
|
+
ipgrid.className = "ipgrid";
|
|
1547
|
+
profileList().forEach(p => {
|
|
1548
|
+
const card = document.createElement("button");
|
|
1549
|
+
card.type = "button";
|
|
1550
|
+
card.className = "ipcard" + (profileScope === p.id ? " on" : "");
|
|
1551
|
+
card.innerHTML = `<div class="hid">${esc(p.id)}</div>
|
|
1552
|
+
<div class="ttl">${esc(p.one_liner || p.id)}</div>`;
|
|
1553
|
+
card.onclick = () => {
|
|
1554
|
+
const pid = `profile:${p.id}`;
|
|
1555
|
+
if (profileScope === p.id) {
|
|
1556
|
+
profileScope = "";
|
|
1557
|
+
if (selected === pid) selected = null;
|
|
1558
|
+
} else {
|
|
1559
|
+
profileScope = p.id;
|
|
1560
|
+
selected = pid;
|
|
1561
|
+
}
|
|
1562
|
+
localStorage.setItem("wb-profile", profileScope);
|
|
1563
|
+
applyChrome();
|
|
1564
|
+
render();
|
|
1565
|
+
};
|
|
1566
|
+
ipgrid.appendChild(card);
|
|
1567
|
+
});
|
|
1568
|
+
$list.appendChild(ipgrid);
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
function chipRow(label, opts, current, onPick) {
|
|
1572
|
+
const row = document.createElement("div");
|
|
1573
|
+
row.className = "filt-row";
|
|
1574
|
+
const lab = document.createElement("span");
|
|
1575
|
+
lab.className = "filt-lab";
|
|
1576
|
+
lab.textContent = label;
|
|
1577
|
+
row.appendChild(lab);
|
|
1578
|
+
const tabs = document.createElement("div");
|
|
1579
|
+
tabs.className = "subtabs";
|
|
1580
|
+
[{ id: "", label: t("f_all") }, ...opts].forEach(o => {
|
|
1581
|
+
const b = document.createElement("button");
|
|
1582
|
+
b.type = "button";
|
|
1583
|
+
b.textContent = o.label;
|
|
1584
|
+
if ((o.id || "") === (current || "")) b.classList.add("on");
|
|
1585
|
+
b.onclick = () => onPick(o.id);
|
|
1586
|
+
tabs.appendChild(b);
|
|
1587
|
+
});
|
|
1588
|
+
row.appendChild(tabs);
|
|
1589
|
+
return row;
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
function filterBar(html, onReady) {
|
|
1593
|
+
const wrap = document.createElement("div");
|
|
1594
|
+
wrap.innerHTML = html;
|
|
1595
|
+
wrap.className = "filters";
|
|
1596
|
+
$list.appendChild(wrap);
|
|
1597
|
+
onReady(wrap);
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
function renderDiscovery() {
|
|
1601
|
+
$list.innerHTML = "";
|
|
1602
|
+
const statuses = [...new Set(nodesOf("discovery").map(x => x.status).filter(Boolean))];
|
|
1603
|
+
const sortOpts = [
|
|
1604
|
+
["bookmarks", "f_sort_bookmarks"],
|
|
1605
|
+
["replies", "f_sort_replies"],
|
|
1606
|
+
["likes", "f_sort_likes"],
|
|
1607
|
+
["views", "f_sort_views"],
|
|
1608
|
+
["date", "f_sort_date"],
|
|
1609
|
+
];
|
|
1610
|
+
filterBar(
|
|
1611
|
+
`<select id="d-st"><option value="">${t("f_status")}</option>${statuses.map(s => `<option value="${s}" ${s === discStatus ? "selected" : ""}>${esc(s)}</option>`).join("")}</select>
|
|
1612
|
+
<select id="d-sort" title="${esc(t("f_sort"))}"><option value="" disabled>${esc(t("f_sort"))}</option>${sortOpts.map(([v, k]) => `<option value="${v}" ${v === discSort ? "selected" : ""}>${esc(t(k))}</option>`).join("")}</select>`,
|
|
1613
|
+
(w) => {
|
|
1614
|
+
const status = w.querySelector("#d-st");
|
|
1615
|
+
const sortEl = w.querySelector("#d-sort");
|
|
1616
|
+
const paint = () => {
|
|
1617
|
+
discStatus = status.value;
|
|
1618
|
+
discSort = sortEl.value || "bookmarks";
|
|
1619
|
+
const cards = document.createElement("div");
|
|
1620
|
+
cards.className = "cards";
|
|
1621
|
+
let rows = nodesOf("discovery").filter(qmatch);
|
|
1622
|
+
if (discStatus) rows = rows.filter(x => x.status === discStatus);
|
|
1623
|
+
rows = sortDiscoveries(rows, discSort);
|
|
1624
|
+
rows.forEach(x => {
|
|
1625
|
+
const meta = [
|
|
1626
|
+
x.source_role,
|
|
1627
|
+
x.next_action && x.next_action !== "none" ? x.next_action : "",
|
|
1628
|
+
`@${x.source_handle || "—"}`,
|
|
1629
|
+
].filter(Boolean).join(" · ");
|
|
1630
|
+
cards.appendChild(discoveryRowEl(x, meta));
|
|
1631
|
+
});
|
|
1632
|
+
if (!rows.length) cards.innerHTML = `<p class='empty'>${t("no_discovery")}</p>`;
|
|
1633
|
+
[...$list.querySelectorAll(".cards")].forEach(n => n.remove());
|
|
1634
|
+
$list.appendChild(cards);
|
|
1635
|
+
};
|
|
1636
|
+
status.onchange = paint;
|
|
1637
|
+
sortEl.onchange = paint;
|
|
1638
|
+
paint();
|
|
1639
|
+
}
|
|
1640
|
+
);
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
function renderTopics() {
|
|
1644
|
+
$list.innerHTML = "";
|
|
1645
|
+
const statuses = [...new Set(nodesOf("topic").map(x => x.status).filter(Boolean))];
|
|
1646
|
+
filterBar(
|
|
1647
|
+
`<select id="f-st"><option value="">${t("f_status")}</option>${statuses.map(s => `<option value="${s}" ${s === topicStatus ? "selected" : ""}>${esc(s)}</option>`).join("")}</select>
|
|
1648
|
+
<select id="f-p"><option value="">${t("f_pillar")}</option>${pillarIds().map(id => `<option value="${id}" ${id === topicPillar ? "selected" : ""}>${esc(formatPillar(id))}</option>`).join("")}</select>
|
|
1649
|
+
<select id="f-src"><option value="">${t("f_src")}</option>${["watchlist", "inbox", "user"].map(s => `<option value="${s}" ${s === topicSrc ? "selected" : ""}>${s}</option>`).join("")}</select>
|
|
1650
|
+
<select id="f-u"><option value="">${t("f_use")}</option>
|
|
1651
|
+
<option value="unused" ${topicUsage === "unused" ? "selected" : ""}>${t("f_unused")}</option>
|
|
1652
|
+
<option value="promoted" ${topicUsage === "promoted" ? "selected" : ""}>${t("f_promoted")}</option></select>`,
|
|
1653
|
+
(w) => {
|
|
1654
|
+
const st = w.querySelector("#f-st");
|
|
1655
|
+
const pill = w.querySelector("#f-p");
|
|
1656
|
+
const src = w.querySelector("#f-src");
|
|
1657
|
+
const use = w.querySelector("#f-u");
|
|
1658
|
+
const paint = () => {
|
|
1659
|
+
topicStatus = st.value;
|
|
1660
|
+
topicPillar = pill.value;
|
|
1661
|
+
topicSrc = src.value;
|
|
1662
|
+
topicUsage = use.value;
|
|
1663
|
+
[...$list.querySelectorAll(".cards")].forEach(n => n.remove());
|
|
1664
|
+
const cards = document.createElement("div");
|
|
1665
|
+
cards.className = "cards";
|
|
1666
|
+
let rows = nodesOf("topic").filter(qmatch).sort((a, b) => Number(b.craft || b.total) - Number(a.craft || a.total));
|
|
1667
|
+
if (topicStatus) rows = rows.filter(x => x.status === topicStatus);
|
|
1668
|
+
if (topicPillar) rows = rows.filter(x => (x.pillar || "").includes(topicPillar));
|
|
1669
|
+
if (topicSrc) rows = rows.filter(x => x.source_type === topicSrc);
|
|
1670
|
+
if (topicUsage) rows = rows.filter(x => x.usage === topicUsage);
|
|
1671
|
+
rows.forEach(x => {
|
|
1672
|
+
const score = x.fit ? `${x.craft}/${x.fit}` : (x.craft || x.total || "—");
|
|
1673
|
+
cards.appendChild(rowEl(x, `${score} · ${formatPillar(x.pillar)} · ${x.source_type} @${x.src_handle || "—"}`));
|
|
1674
|
+
});
|
|
1675
|
+
if (!rows.length) cards.innerHTML = `<p class='empty'>${t("no_topic")}</p>`;
|
|
1676
|
+
$list.appendChild(cards);
|
|
1677
|
+
};
|
|
1678
|
+
w.querySelectorAll("select").forEach(s => s.onchange = paint);
|
|
1679
|
+
paint();
|
|
1680
|
+
}
|
|
1681
|
+
);
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
function renderNotes() {
|
|
1685
|
+
$list.innerHTML = "";
|
|
1686
|
+
const sub = document.createElement("div");
|
|
1687
|
+
sub.className = "subtabs";
|
|
1688
|
+
sub.innerHTML = `<button data-t="notes">${t("notes_in")}</button><button data-t="lib">${t("notes_lib")}</button>`;
|
|
1689
|
+
$list.appendChild(sub);
|
|
1690
|
+
sub.querySelectorAll("button").forEach(b => b.classList.toggle("on", b.dataset.t === notesTab));
|
|
1691
|
+
sub.onclick = (e) => {
|
|
1692
|
+
const tab = e.target.dataset.t;
|
|
1693
|
+
if (!tab) return;
|
|
1694
|
+
notesTab = tab;
|
|
1695
|
+
renderNotes();
|
|
1696
|
+
renderInsp();
|
|
1697
|
+
};
|
|
1698
|
+
if (notesTab === "notes") {
|
|
1699
|
+
const box = document.createElement("div");
|
|
1700
|
+
box.className = "filt";
|
|
1701
|
+
box.appendChild(chipRow(t("f_cap_ingest"), [
|
|
1702
|
+
{ id: "ingested", label: t("f_cap_ingested") },
|
|
1703
|
+
{ id: "not_ingested", label: t("f_cap_not_ingested") },
|
|
1704
|
+
], capIngest, (id) => {
|
|
1705
|
+
capIngest = id;
|
|
1706
|
+
renderNotes();
|
|
1707
|
+
renderInsp();
|
|
1708
|
+
}));
|
|
1709
|
+
$list.appendChild(box);
|
|
1710
|
+
const cards = document.createElement("div");
|
|
1711
|
+
cards.className = "cards";
|
|
1712
|
+
let caps = nodesOf("capture").filter(qmatch).sort((a, b) => (b.date || "").localeCompare(a.date || ""));
|
|
1713
|
+
if (capIngest === "ingested") caps = caps.filter(c => c.status === "ingested");
|
|
1714
|
+
if (capIngest === "not_ingested") caps = caps.filter(c => c.status !== "ingested");
|
|
1715
|
+
caps.forEach(c => cards.appendChild(rowEl(c, `${c.type} · ${c.status} · raw ${c.has_raw ? t("raw_yes") : t("raw_no")}`)));
|
|
1716
|
+
if (!caps.length) cards.innerHTML = `<p class='empty'>${t("no_note")}</p>`;
|
|
1717
|
+
$list.appendChild(cards);
|
|
1718
|
+
return;
|
|
1719
|
+
}
|
|
1720
|
+
const items = GRAPH.nodes.filter(n => n.lib && inScope(n));
|
|
1721
|
+
const subtypeOf = (n) => n.atom_type || n.form || n.claim_type || "";
|
|
1722
|
+
const kinds = [...new Set(items.map(n => n.kind))];
|
|
1723
|
+
const pool = items.filter(n => !libKind || n.kind === libKind);
|
|
1724
|
+
const subs = [...new Set(pool.map(subtypeOf).filter(Boolean))].sort();
|
|
1725
|
+
const statusVocab = {
|
|
1726
|
+
swipe: ["trial", "working", "dead"],
|
|
1727
|
+
atom: ["trial", "working", "dead"],
|
|
1728
|
+
claim: ["hypothesis", "supported", "weakened", "retired"],
|
|
1729
|
+
};
|
|
1730
|
+
const statuses = statusVocab[libKind] || [];
|
|
1731
|
+
const box = document.createElement("div");
|
|
1732
|
+
box.className = "filt";
|
|
1733
|
+
box.appendChild(chipRow(t("f_lib_kind"), kinds.map(k => ({ id: k, label: kindName(k) })), libKind, (id) => {
|
|
1734
|
+
libKind = id;
|
|
1735
|
+
libSubtype = "";
|
|
1736
|
+
libStatus = "";
|
|
1737
|
+
renderNotes();
|
|
1738
|
+
renderInsp();
|
|
1739
|
+
}));
|
|
1740
|
+
box.appendChild(chipRow(t("f_lib_subtype"), subs.map(s => ({ id: s, label: s })), libSubtype, (id) => {
|
|
1741
|
+
libSubtype = id;
|
|
1742
|
+
renderNotes();
|
|
1743
|
+
renderInsp();
|
|
1744
|
+
}));
|
|
1745
|
+
if (libKind) {
|
|
1746
|
+
box.appendChild(chipRow(t("f_lib_status"), statuses.map(s => ({ id: s, label: s })), libStatus, (id) => {
|
|
1747
|
+
libStatus = id;
|
|
1748
|
+
renderNotes();
|
|
1749
|
+
renderInsp();
|
|
1750
|
+
}));
|
|
1751
|
+
}
|
|
1752
|
+
$list.appendChild(box);
|
|
1753
|
+
const cards = document.createElement("div");
|
|
1754
|
+
cards.className = "cards";
|
|
1755
|
+
let rows = items.filter(qmatch);
|
|
1756
|
+
if (libKind) rows = rows.filter(n => n.kind === libKind);
|
|
1757
|
+
if (libSubtype) rows = rows.filter(n => subtypeOf(n) === libSubtype);
|
|
1758
|
+
if (libStatus) rows = rows.filter(n => n.status === libStatus);
|
|
1759
|
+
rows.forEach(n => cards.appendChild(rowEl(n, `${kindName(n.kind)}${subtypeOf(n) ? " · " + subtypeOf(n) : ""}`)));
|
|
1760
|
+
if (!rows.length) cards.innerHTML = `<p class='empty'>${t("no_note")}</p>`;
|
|
1761
|
+
$list.appendChild(cards);
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
function topicIdOf(n) {
|
|
1765
|
+
if (n.topic_id) return n.topic_id;
|
|
1766
|
+
if (n.kind === "published" && n.run_id) {
|
|
1767
|
+
return byId[`run:${n.run_id}`]?.topic_id || "";
|
|
1768
|
+
}
|
|
1769
|
+
return "";
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
function topicSelectHtml(nodes, current) {
|
|
1773
|
+
const ids = [...new Set(nodes.map(topicIdOf).filter(Boolean))].sort();
|
|
1774
|
+
const hasNone = nodes.some(n => !topicIdOf(n));
|
|
1775
|
+
const opts = [
|
|
1776
|
+
`<option value="">${t("f_run_topic")} · ${t("f_all")}</option>`,
|
|
1777
|
+
...ids.map(id => {
|
|
1778
|
+
const n = nodes.filter(x => topicIdOf(x) === id).length;
|
|
1779
|
+
return `<option value="${esc(id)}" ${id === current ? "selected" : ""}>${esc(t("f_run_topic_n", { id, n }))}</option>`;
|
|
1780
|
+
}),
|
|
1781
|
+
];
|
|
1782
|
+
if (hasNone) {
|
|
1783
|
+
opts.push(`<option value="__none__" ${current === "__none__" ? "selected" : ""}>${esc(t("f_run_no_topic"))}</option>`);
|
|
1784
|
+
}
|
|
1785
|
+
return `<select id="f-topic" aria-label="${esc(t("f_run_topic"))}">${opts.join("")}</select>`;
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
function renderRuns() {
|
|
1789
|
+
$list.innerHTML = "";
|
|
1790
|
+
const runs = nodesOf("run");
|
|
1791
|
+
const plats = ["x", "tiktok", "instagram", "linkedin", "threads", "xiaohongshu"];
|
|
1792
|
+
const box = document.createElement("div");
|
|
1793
|
+
box.className = "filt";
|
|
1794
|
+
const top = document.createElement("div");
|
|
1795
|
+
top.className = "filters";
|
|
1796
|
+
top.style.marginBottom = "0";
|
|
1797
|
+
top.innerHTML = topicSelectHtml(runs, runTopic);
|
|
1798
|
+
box.appendChild(top);
|
|
1799
|
+
box.appendChild(chipRow(t("f_run_ship"), [
|
|
1800
|
+
{ id: "shipped", label: t("f_run_shipped") },
|
|
1801
|
+
{ id: "unshipped", label: t("f_run_unshipped") },
|
|
1802
|
+
], runShip, (id) => { runShip = id; renderRuns(); renderInsp(); }));
|
|
1803
|
+
box.appendChild(chipRow(t("f_run_plat"), plats.map(p => ({ id: p, label: p })), runPlat, (id) => {
|
|
1804
|
+
runPlat = id; renderRuns(); renderInsp();
|
|
1805
|
+
}));
|
|
1806
|
+
$list.appendChild(box);
|
|
1807
|
+
top.querySelector("#f-topic").onchange = (e) => {
|
|
1808
|
+
runTopic = e.target.value;
|
|
1809
|
+
renderRuns();
|
|
1810
|
+
renderInsp();
|
|
1811
|
+
};
|
|
1812
|
+
const cards = document.createElement("div");
|
|
1813
|
+
cards.className = "cards";
|
|
1814
|
+
let rows = runs.filter(qmatch).sort((a, b) => (b.date || "").localeCompare(a.date || ""));
|
|
1815
|
+
if (runTopic === "__none__") rows = rows.filter(r => !topicIdOf(r));
|
|
1816
|
+
else if (runTopic) rows = rows.filter(r => topicIdOf(r) === runTopic);
|
|
1817
|
+
if (runShip === "shipped") rows = rows.filter(runIsShipped);
|
|
1818
|
+
if (runShip === "unshipped") rows = rows.filter(r => !runIsShipped(r));
|
|
1819
|
+
if (runPlat) {
|
|
1820
|
+
rows = rows.filter(r =>
|
|
1821
|
+
String(r.platforms || r.primary_platform || "").split(",").map(s => s.trim().toLowerCase()).includes(runPlat)
|
|
1822
|
+
);
|
|
1823
|
+
}
|
|
1824
|
+
rows.forEach(r => cards.appendChild(rowEl(r)));
|
|
1825
|
+
if (!rows.length) cards.innerHTML = `<p class='empty'>${t("no_run")}</p>`;
|
|
1826
|
+
$list.appendChild(cards);
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1829
|
+
function renderPub() {
|
|
1830
|
+
$list.innerHTML = "";
|
|
1831
|
+
$list.insertAdjacentHTML("beforeend", `<p class="lead">${t("pub_lead")}</p><p class="lede">${t("pub_lede")}</p>`);
|
|
1832
|
+
const pubs = nodesOf("published");
|
|
1833
|
+
const plats = ["x", "tiktok", "instagram", "linkedin", "threads", "xiaohongshu"];
|
|
1834
|
+
const box = document.createElement("div");
|
|
1835
|
+
box.className = "filt";
|
|
1836
|
+
const top = document.createElement("div");
|
|
1837
|
+
top.className = "filters";
|
|
1838
|
+
top.style.marginBottom = "0";
|
|
1839
|
+
top.innerHTML = topicSelectHtml(pubs, pubTopic);
|
|
1840
|
+
box.appendChild(top);
|
|
1841
|
+
box.appendChild(chipRow(t("f_run_plat"), plats.map(p => ({ id: p, label: p })), pubPlat, (id) => {
|
|
1842
|
+
pubPlat = id; renderPub(); renderInsp();
|
|
1843
|
+
}));
|
|
1844
|
+
$list.appendChild(box);
|
|
1845
|
+
top.querySelector("#f-topic").onchange = (e) => {
|
|
1846
|
+
pubTopic = e.target.value;
|
|
1847
|
+
renderPub();
|
|
1848
|
+
renderInsp();
|
|
1849
|
+
};
|
|
1850
|
+
const cards = document.createElement("div");
|
|
1851
|
+
cards.className = "cards";
|
|
1852
|
+
let rows = pubs.filter(qmatch).sort((a, b) => (b.date || "").localeCompare(a.date || ""));
|
|
1853
|
+
if (pubTopic === "__none__") rows = rows.filter(p => !topicIdOf(p));
|
|
1854
|
+
else if (pubTopic) rows = rows.filter(p => topicIdOf(p) === pubTopic);
|
|
1855
|
+
if (pubPlat) {
|
|
1856
|
+
rows = rows.filter(p => String(p.platform || "").trim().toLowerCase() === pubPlat);
|
|
1857
|
+
}
|
|
1858
|
+
if (!rows.length) cards.innerHTML = `<p class='empty'>${t("no_pub")}</p>`;
|
|
1859
|
+
rows.forEach(p => cards.appendChild(rowEl(p)));
|
|
1860
|
+
$list.appendChild(cards);
|
|
1861
|
+
}
|
|
1862
|
+
|
|
1863
|
+
function rawLinksFor(n, ctx) {
|
|
1864
|
+
const out = [];
|
|
1865
|
+
if (n.kind === "raw" && n.source_url) {
|
|
1866
|
+
out.push({ id: n.id, ident: n.ident, label: n.label, url: n.source_url, path: n.path });
|
|
1867
|
+
return out;
|
|
1868
|
+
}
|
|
1869
|
+
if (n.kind === "capture") {
|
|
1870
|
+
ctx.filter(x => x.kind === "raw").forEach(r => {
|
|
1871
|
+
out.push({ id: r.id, ident: r.ident, label: r.label, url: r.source_url || "", path: r.path });
|
|
1872
|
+
});
|
|
1873
|
+
}
|
|
1874
|
+
return out;
|
|
1875
|
+
}
|
|
1876
|
+
|
|
1877
|
+
function sourceBlockHtml(n, ctx) {
|
|
1878
|
+
const topicUrl = n.src_url || "";
|
|
1879
|
+
const ownUrl = n.source_url || "";
|
|
1880
|
+
const raws = rawLinksFor(n, ctx);
|
|
1881
|
+
let html = "";
|
|
1882
|
+
if (topicUrl) {
|
|
1883
|
+
html += `<p class="note">${t("src_url")}<a href="${esc(topicUrl)}" target="_blank" rel="noreferrer">${esc(topicUrl)}</a><br>${t("src_heat")}
|
|
1884
|
+
${n.src_likes ? ` likes ${esc(n.src_likes)} · replies ${esc(n.src_replies)} · bookmarks ${esc(n.src_bookmarks)}` : ""}</p>`;
|
|
1885
|
+
}
|
|
1886
|
+
if (n.kind === "capture" || n.kind === "raw") {
|
|
1887
|
+
html += `<h2>${t("raw_section")}</h2>`;
|
|
1888
|
+
if (!raws.length && !ownUrl) {
|
|
1889
|
+
html += `<p class="vacant">${t("raw_none")}</p>`;
|
|
1890
|
+
} else if (n.kind === "raw") {
|
|
1891
|
+
if (ownUrl) html += `<p class="note">${t("raw_link")}:<a href="${esc(ownUrl)}" target="_blank" rel="noreferrer">${esc(ownUrl)}</a></p>`;
|
|
1892
|
+
} else {
|
|
1893
|
+
raws.forEach(r => {
|
|
1894
|
+
html += `<div class="note" style="margin:0 0 10px">
|
|
1895
|
+
<div><button type="button" class="ghost-link" data-goto="${esc(r.id)}">${esc(r.ident)}</button> · ${esc(r.label.slice(0, 80))}</div>
|
|
1896
|
+
${r.url ? `<div>${t("raw_link")}:<a href="${esc(r.url)}" target="_blank" rel="noreferrer">${esc(r.url)}</a></div>` : `<div class="vacant">${t("raw_none")}</div>`}
|
|
1897
|
+
${r.path ? `<div>${t("raw_file")}:<button type="button" class="ghost-link" data-md="${esc(r.path)}" data-md-title="${esc(r.ident)}">${esc(r.path)}</button></div>` : ""}
|
|
1898
|
+
</div>`;
|
|
1899
|
+
});
|
|
1900
|
+
}
|
|
1901
|
+
} else if (ownUrl && !topicUrl) {
|
|
1902
|
+
html += `<p class="note">${t("src_url")}<a href="${esc(ownUrl)}" target="_blank" rel="noreferrer">${esc(ownUrl)}</a></p>`;
|
|
1903
|
+
}
|
|
1904
|
+
return html;
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
function profileCounts(profileId) {
|
|
1908
|
+
return {
|
|
1909
|
+
capture: nodesOfAll("capture").filter(n => n.profile === profileId).length,
|
|
1910
|
+
topic: nodesOfAll("topic").filter(n => n.profile === profileId).length,
|
|
1911
|
+
lib: GRAPH.nodes.filter(n => n.lib && (String(n.profiles || "").includes(profileId) || String(n.profiles || "").includes("*"))).length,
|
|
1912
|
+
run: nodesOfAll("run").filter(n => n.profile === profileId).length,
|
|
1913
|
+
published: nodesOfAll("published").filter(n => n.profile === profileId).length,
|
|
1914
|
+
};
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
function countsFor(profileId) {
|
|
1918
|
+
if (profileId) return profileCounts(profileId);
|
|
1919
|
+
return {
|
|
1920
|
+
capture: nodesOfAll("capture").length,
|
|
1921
|
+
topic: nodesOfAll("topic").length,
|
|
1922
|
+
lib: GRAPH.nodes.filter(n => n.lib).length,
|
|
1923
|
+
run: nodesOfAll("run").length,
|
|
1924
|
+
published: nodesOfAll("published").length,
|
|
1925
|
+
};
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
function gapsFor(profileId) {
|
|
1929
|
+
const topics = profileId ? nodesOfAll("topic").filter(n => n.profile === profileId) : nodesOfAll("topic");
|
|
1930
|
+
const caps = profileId ? nodesOfAll("capture").filter(n => n.profile === profileId) : nodesOfAll("capture");
|
|
1931
|
+
const pubs = profileId ? nodesOfAll("published").filter(n => n.profile === profileId) : nodesOfAll("published");
|
|
1932
|
+
return [
|
|
1933
|
+
[topics.filter(x => x.status === "ready" && x.usage === "unused").length, "gap_ready_n"],
|
|
1934
|
+
[caps.filter(c => c.status !== "ingested").length, "gap_lib_n"],
|
|
1935
|
+
[pubs.filter(p => !p.reviewable).length, "gap_review_n"],
|
|
1936
|
+
].filter(([n]) => n > 0);
|
|
1937
|
+
}
|
|
1938
|
+
|
|
1939
|
+
function statsHtml(counts) {
|
|
1940
|
+
return `<div class="prof-stats">
|
|
1941
|
+
<div><b>${counts.capture}</b><span>${t("kpi_cap")}</span></div>
|
|
1942
|
+
<div><b>${counts.topic}</b><span>${t("kpi_topics")}</span></div>
|
|
1943
|
+
<div><b>${counts.lib}</b><span>${t("kpi_lib")}</span></div>
|
|
1944
|
+
<div><b>${counts.run}</b><span>Run</span></div>
|
|
1945
|
+
<div><b>${counts.published}</b><span>${t("kind_published")}</span></div>
|
|
1946
|
+
</div>`;
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1949
|
+
function gapsHtml(profileId) {
|
|
1950
|
+
const gaps = gapsFor(profileId);
|
|
1951
|
+
if (!gaps.length) return `<p class="vacant">${t("gap_none")}</p>`;
|
|
1952
|
+
return `<div class="gap-list">${gaps.map(([n, k]) => `<p>${esc(t(k, { n }))}</p>`).join("")}</div>`;
|
|
1953
|
+
}
|
|
1954
|
+
|
|
1955
|
+
function renderVaultInsp() {
|
|
1956
|
+
$insp.innerHTML = `<h2>${t("vault_title")}</h2>
|
|
1957
|
+
<p class="kicker">${t("vault_kicker")}</p>
|
|
1958
|
+
<p class="note" style="margin:0 0 16px">${esc(t("vault_lede"))}</p>
|
|
1959
|
+
<h2>${t("profile_stats")}</h2>
|
|
1960
|
+
${statsHtml(countsFor(""))}
|
|
1961
|
+
<h2>${t("gap_section")}</h2>
|
|
1962
|
+
${gapsHtml("")}
|
|
1963
|
+
<p class="note">${t("readonly")}</p>`;
|
|
1964
|
+
}
|
|
1965
|
+
|
|
1966
|
+
function renderProfileInsp(n) {
|
|
1967
|
+
const pillars = (GRAPH.pillars_by_profile || {})[n.ident] || {};
|
|
1968
|
+
const accounts = nodesOfAll("account").filter(a => a.profile_id === n.ident);
|
|
1969
|
+
const files = n.files || {};
|
|
1970
|
+
const docOrder = [
|
|
1971
|
+
["readme", t("doc_readme")],
|
|
1972
|
+
["voice", t("doc_voice")],
|
|
1973
|
+
["audience", t("doc_audience")],
|
|
1974
|
+
["pillars", t("doc_pillars")],
|
|
1975
|
+
];
|
|
1976
|
+
const pillarRows = Object.entries(pillars).map(([id, p]) => {
|
|
1977
|
+
const title = lang === "zh" ? p.zh : p.en;
|
|
1978
|
+
return `<div class="prof-pill"><span class="hid">${esc(id)}</span><span>${esc(title)}</span></div>`;
|
|
1979
|
+
}).join("") || `<p class="vacant">${t("vacant")}</p>`;
|
|
1980
|
+
const acctRows = accounts.map(a =>
|
|
1981
|
+
`<button type="button" data-account-open="${esc(a.id)}">${esc(a.ident)} · ${esc(a.platforms || a.default_platform || "")} · ${esc(a.status || "")}</button>`
|
|
1982
|
+
).join("") || `<p class="vacant">${t("vacant")}</p>`;
|
|
1983
|
+
const docRows = docOrder.filter(([k]) => files[k]).map(([k, label]) =>
|
|
1984
|
+
`<button type="button" class="stage-file-lite" data-md="${esc(files[k])}" data-md-title="${esc(label)}">
|
|
1985
|
+
<span class="sk">${esc(label)}</span><span class="sp">${esc(files[k].split("/").pop())}</span><span class="sa">${t("read_md")}</span>
|
|
1986
|
+
</button>`
|
|
1987
|
+
).join("") || `<p class="vacant">${t("vacant")}</p>`;
|
|
1988
|
+
$insp.innerHTML = `<h2>${t("kind_profile")}</h2>
|
|
1989
|
+
<p class="kicker">${esc(n.ident)}</p>
|
|
1990
|
+
<p class="title">${esc(n.label)}</p>
|
|
1991
|
+
<h2>${t("profile_stats")}</h2>
|
|
1992
|
+
${statsHtml(countsFor(n.ident))}
|
|
1993
|
+
<h2>${t("gap_section")}</h2>
|
|
1994
|
+
${gapsHtml(n.ident)}
|
|
1995
|
+
<h2>${t("profile_pillars")}</h2>
|
|
1996
|
+
<div class="prof-pillars">${pillarRows}</div>
|
|
1997
|
+
<h2>${t("profile_accounts")}</h2>
|
|
1998
|
+
<div class="tcard prof-accts">${acctRows}</div>
|
|
1999
|
+
<h2>${t("profile_docs")}</h2>
|
|
2000
|
+
<div class="prof-docs">${docRows}</div>
|
|
2001
|
+
<p class="note">${t("readonly")}</p>`;
|
|
2002
|
+
$insp.querySelectorAll("[data-account-open]").forEach(btn => {
|
|
2003
|
+
btn.onclick = (e) => {
|
|
2004
|
+
e.preventDefault();
|
|
2005
|
+
e.stopPropagation();
|
|
2006
|
+
const node = byId[btn.getAttribute("data-account-open")];
|
|
2007
|
+
if (node) openAccount(node);
|
|
2008
|
+
};
|
|
2009
|
+
});
|
|
2010
|
+
}
|
|
2011
|
+
|
|
2012
|
+
function renderInsp() {
|
|
2013
|
+
if (!selected || !byId[selected]) {
|
|
2014
|
+
if (view === "overview") {
|
|
2015
|
+
renderVaultInsp();
|
|
2016
|
+
} else {
|
|
2017
|
+
$insp.innerHTML = `<div class='empty'><strong>${t("empty_t")}</strong>${t("empty_b")}</div>`;
|
|
2018
|
+
}
|
|
2019
|
+
return;
|
|
2020
|
+
}
|
|
2021
|
+
const n = byId[selected];
|
|
2022
|
+
if (n.kind === "profile") {
|
|
2023
|
+
renderProfileInsp(n);
|
|
2024
|
+
return;
|
|
2025
|
+
}
|
|
2026
|
+
const ctx = connected(n.id);
|
|
2027
|
+
const byKind = {};
|
|
2028
|
+
for (const k of TRACE_ORDER) byKind[k] = ctx.filter(x => x.kind === k);
|
|
2029
|
+
const kv = Object.entries({
|
|
2030
|
+
[t("kv_kind")]: kindName(n.kind),
|
|
2031
|
+
[t("kv_date")]: n.date,
|
|
2032
|
+
[t("kv_status")]: n.status,
|
|
2033
|
+
[t("kv_refs")]: (n.kind === "swipe" || n.kind === "atom" || n.kind === "claim") ? String(n.refs ?? 0) : "",
|
|
2034
|
+
[t("kv_hits")]: (n.kind === "swipe" || n.kind === "atom" || n.kind === "claim") && n.n != null
|
|
2035
|
+
? `${n.win || 0}w / ${n.loss || 0}l / n=${n.n}`
|
|
2036
|
+
: "",
|
|
2037
|
+
[t("kv_pillar")]: formatPillar(n.pillar),
|
|
2038
|
+
[t("kv_plat")]: n.platform || n.platforms,
|
|
2039
|
+
[t("kv_profile")]: n.profile || n.profile_id || (n.profiles || ""),
|
|
2040
|
+
[t("kv_score")]: n.fit ? `${n.craft} opp / ${n.fit} aud` : n.total,
|
|
2041
|
+
[t("kv_use")]: n.kind === "discovery" ? (n.next_action || "") : n.usage,
|
|
2042
|
+
[t("kv_src")]: n.kind === "discovery" ? (n.source_role || "") : n.source_type,
|
|
2043
|
+
Handle: n.source_handle || n.src_handle || "",
|
|
2044
|
+
[t("kv_heat_at")]: n.kind === "discovery" ? (n.engagement_at || "") : "",
|
|
2045
|
+
[t("kv_result")]: n.result,
|
|
2046
|
+
}).filter(([, v]) => v);
|
|
2047
|
+
const heatBlock = n.kind === "discovery"
|
|
2048
|
+
? `${heatStripHtml(n, { hint: true })}${n.source_url ? `<p class="note">${t("src_url")}<a href="${esc(n.source_url)}" target="_blank" rel="noreferrer">${esc(n.source_url)}</a></p>` : ""}`
|
|
2049
|
+
: "";
|
|
2050
|
+
$insp.innerHTML = `<h2>${t("obj")}</h2>
|
|
2051
|
+
<p class="kicker">${esc(kindName(n.kind))} · ${esc(n.ident)}</p>
|
|
2052
|
+
<p class="title">${n.kind === "run" ? `<button type="button" class="ghost-link title-btn" data-run-open="${esc(n.id)}">${esc(n.label)}</button>` : esc(n.label)}</p>
|
|
2053
|
+
<dl class="kv">${kv.map(([k, v]) => `<dt>${esc(k)}</dt><dd>${esc(v)}</dd>`).join("")}</dl>
|
|
2054
|
+
${heatBlock}
|
|
2055
|
+
${n.kind === "swipe" || n.kind === "atom" ? `<p class="note">${esc(t("lib_use_hist"))}</p>` : ""}
|
|
2056
|
+
${n.kind === "claim" ? `<p class="note">${esc(t("lib_claim_ev"))}</p>` : ""}
|
|
2057
|
+
${sourceBlockHtml(n, ctx)}
|
|
2058
|
+
${n.url && n.kind === "published" ? `<p><a href="${esc(n.url)}" target="_blank" rel="noreferrer">${esc(n.url)}</a></p>
|
|
2059
|
+
${n.reviewable ? "" : `<p class='warn'>${t("thin_warn")}</p>`}` : ""}
|
|
2060
|
+
${n.kind === "run" ? runMetaHtml(n) : ""}
|
|
2061
|
+
${mdActionsHtml(n)}
|
|
2062
|
+
<h2>${t("trace")}</h2>
|
|
2063
|
+
<div class="trace" id="trace"></div>
|
|
2064
|
+
<p class="note">${t("readonly")}</p>`;
|
|
2065
|
+
$insp.querySelectorAll("[data-goto]").forEach(btn => {
|
|
2066
|
+
btn.onclick = () => select(btn.getAttribute("data-goto"));
|
|
2067
|
+
});
|
|
2068
|
+
const trace = $insp.querySelector("#trace");
|
|
2069
|
+
for (const k of TRACE_ORDER) {
|
|
2070
|
+
const items = k === "published" ? publishedFor(n, ctx) : (byKind[k] || []);
|
|
2071
|
+
const step = document.createElement("div");
|
|
2072
|
+
step.className = "tstep";
|
|
2073
|
+
const here = items.some(x => x.id === n.id);
|
|
2074
|
+
const on = items.length > 0;
|
|
2075
|
+
step.innerHTML = `<div class="tspine"><div class="dot${on ? " on" : ""}${here ? " here" : ""}"></div><div class="rail"></div></div>`;
|
|
2076
|
+
const body = document.createElement("div");
|
|
2077
|
+
body.className = "tcard";
|
|
2078
|
+
const lab = document.createElement("div");
|
|
2079
|
+
lab.className = "note";
|
|
2080
|
+
lab.textContent = kindName(k);
|
|
2081
|
+
body.appendChild(lab);
|
|
2082
|
+
if (!items.length) {
|
|
2083
|
+
const v = document.createElement("div");
|
|
2084
|
+
v.className = "vacant";
|
|
2085
|
+
v.textContent = t("vacant");
|
|
2086
|
+
body.appendChild(v);
|
|
2087
|
+
} else {
|
|
2088
|
+
items.forEach(item => {
|
|
2089
|
+
const b = document.createElement("button");
|
|
2090
|
+
if (item.source_url && item.kind === "raw") {
|
|
2091
|
+
b.innerHTML = `${esc(item.ident)} ${esc(item.label.slice(0, 48))}<br><span class="note">${esc(item.source_url)}</span>`;
|
|
2092
|
+
} else {
|
|
2093
|
+
b.textContent = `${item.ident} ${item.label.slice(0, 72)}`;
|
|
2094
|
+
}
|
|
2095
|
+
b.onclick = () => {
|
|
2096
|
+
if (item.kind === "run") {
|
|
2097
|
+
selected = item.id;
|
|
2098
|
+
render();
|
|
2099
|
+
openRun(item);
|
|
2100
|
+
return;
|
|
2101
|
+
}
|
|
2102
|
+
select(item.id);
|
|
2103
|
+
const md = mdFileForNode(item);
|
|
2104
|
+
if (md) openMd(md, item.ident);
|
|
2105
|
+
};
|
|
2106
|
+
body.appendChild(b);
|
|
2107
|
+
});
|
|
2108
|
+
}
|
|
2109
|
+
step.appendChild(body);
|
|
2110
|
+
trace.appendChild(step);
|
|
2111
|
+
}
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
applyChrome();
|
|
2115
|
+
render();
|
|
2116
|
+
|
|
2117
|
+
</script>
|
|
2118
|
+
</body>
|
|
2119
|
+
</html>
|