misakanet 3.13.0 → 3.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.codex-plugin/plugin.json +1 -1
- package/lib/client.js +265 -71
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "misakanet",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.15.0",
|
|
4
4
|
"description": "Failure-memory network for AI coding agents: search evidence-rated failure lessons, submit new failures, and turn crashes into reusable knowledge.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Ikalus1988",
|
package/lib/client.js
CHANGED
|
@@ -132,6 +132,9 @@ window.__ModuleLoader__.load({
|
|
|
132
132
|
var en = {
|
|
133
133
|
"guide.description": "What this session asked, what came back, and what you filed",
|
|
134
134
|
"panel.asked": "What this session asked",
|
|
135
|
+
"panel.recent": "Recent in this browser",
|
|
136
|
+
"panel.recent.hit": "hit",
|
|
137
|
+
"panel.recent.miss": "no match",
|
|
135
138
|
"panel.asked.none": "Nothing searched yet. In the composer: `/misakanet <what broke>`.",
|
|
136
139
|
"panel.reports": "Reports you filed",
|
|
137
140
|
"panel.reports.none": "Nothing filed from this session.",
|
|
@@ -141,15 +144,25 @@ window.__ModuleLoader__.load({
|
|
|
141
144
|
"panel.hint.openLabel": "Open the search box",
|
|
142
145
|
"panel.hint.openTitle": "Opens the composer's own MisakaNet overlay, which carries the same instruction. It does not type into the composer: a view occupant receives props, and the draft is reachable only from a live session scope, so nothing here can put `/misakanet ` in the box for you.",
|
|
143
146
|
"panel.activity": "Your activity",
|
|
147
|
+
"panel.flash.hit": "hit +1",
|
|
148
|
+
"panel.flash.search": "search +1",
|
|
149
|
+
"panel.flash.contrib": "contribution +0.5",
|
|
144
150
|
"panel.ladder": "Contribution ladder",
|
|
145
151
|
"panel.ladder.window": "this week · top 5",
|
|
152
|
+
"panel.ladder.you": "you",
|
|
153
|
+
"panel.ladder.claim": "Claim your node",
|
|
154
|
+
"panel.ladder.claimHint": "Misaka12345",
|
|
155
|
+
"panel.ladder.save": "Save",
|
|
156
|
+
"panel.ladder.clear": "clear",
|
|
157
|
+
"panel.ladder.yours": "your node: ",
|
|
158
|
+
"panel.network": "Network & corpus",
|
|
146
159
|
"panel.sources": "Where these numbers come from",
|
|
147
160
|
"panel.ladder.loading": "reading this week\u2019s ladder\u2026",
|
|
148
161
|
"panel.ladder.none": "No contribution recorded this week yet.",
|
|
149
162
|
"panel.ladder.coverage": "Submissions only; retrieval attribution pending.",
|
|
150
163
|
"panel.voice": "Voice",
|
|
151
|
-
"panel.voice.on": "
|
|
152
|
-
"panel.voice.off": "
|
|
164
|
+
"panel.voice.on": "on",
|
|
165
|
+
"panel.voice.off": "off",
|
|
153
166
|
"overlay.searching": "Searching…",
|
|
154
167
|
"overlay.empty": "After /misakanet, type what broke, e.g. /misakanet pip install timeout",
|
|
155
168
|
"overlay.none": "No lesson covers this yet. Ask the agent to file it (misakanet_submit_intake), or file it at misakanet.org — that is how the next person finds it here.",
|
|
@@ -311,6 +324,9 @@ window.__ModuleLoader__.load({
|
|
|
311
324
|
var zh = {
|
|
312
325
|
"guide.description": "本会话问过什么、拿回了什么、你报了什么",
|
|
313
326
|
"panel.asked": "本会话问过什么",
|
|
327
|
+
"panel.recent": "本浏览器最近",
|
|
328
|
+
"panel.recent.hit": "命中",
|
|
329
|
+
"panel.recent.miss": "未命中",
|
|
314
330
|
"panel.asked.none": "还没有检索过。在输入框里写 `/misakanet <出了什么问题>`。",
|
|
315
331
|
"panel.reports": "你报过的问题",
|
|
316
332
|
"panel.reports.none": "本会话没有报过任何问题。",
|
|
@@ -320,15 +336,25 @@ window.__ModuleLoader__.load({
|
|
|
320
336
|
"panel.hint.openLabel": "打开检索框",
|
|
321
337
|
"panel.hint.openTitle": "打开输入框自己的 MisakaNet 浮层,里面写着同样的用法。它不会替你在输入框里打字:视图组件只拿得到 props,草稿只有活的 session 作用域才能改,所以从这里没办法替你填入「/misakanet 」。",
|
|
322
338
|
"panel.activity": "你的活动",
|
|
339
|
+
"panel.flash.hit": "命中 +1",
|
|
340
|
+
"panel.flash.search": "检索 +1",
|
|
341
|
+
"panel.flash.contrib": "贡献 +0.5",
|
|
323
342
|
"panel.ladder": "贡献天梯",
|
|
324
343
|
"panel.ladder.window": "本周 · 前五",
|
|
344
|
+
"panel.ladder.you": "你",
|
|
345
|
+
"panel.ladder.claim": "认领你的节点",
|
|
346
|
+
"panel.ladder.claimHint": "Misaka12345",
|
|
347
|
+
"panel.ladder.save": "保存",
|
|
348
|
+
"panel.ladder.clear": "清除",
|
|
349
|
+
"panel.ladder.yours": "你的节点:",
|
|
350
|
+
"panel.network": "网络与语料",
|
|
325
351
|
"panel.sources": "这些数字从哪来",
|
|
326
352
|
"panel.ladder.loading": "正在读本周天梯…",
|
|
327
353
|
"panel.ladder.none": "本周还没有可上榜的贡献。",
|
|
328
354
|
"panel.ladder.coverage": "仅计提交;取用归属未接入。",
|
|
329
355
|
"panel.voice": "语音",
|
|
330
|
-
"panel.voice.on": "
|
|
331
|
-
"panel.voice.off": "
|
|
356
|
+
"panel.voice.on": "开",
|
|
357
|
+
"panel.voice.off": "关",
|
|
332
358
|
"overlay.searching": "检索中……",
|
|
333
359
|
"overlay.empty": "在 /misakanet 后面写清楚出了什么问题,例如 /misakanet pip install 超时。",
|
|
334
360
|
"overlay.none": "还没有课程覆盖这个问题。可以让 agent 报料(misakanet_submit_intake),或直接去 misakanet.org 提交 —— 下一个人就能在这里搜到它。",
|
|
@@ -624,6 +650,50 @@ window.__ModuleLoader__.load({
|
|
|
624
650
|
return { searches: 0, lessonsReused: 0, votes: 0, reportsFiled: 0, reportsConverted: 0 };
|
|
625
651
|
}
|
|
626
652
|
|
|
653
|
+
/**
|
|
654
|
+
* The last few searches this browser made, kept across sessions.
|
|
655
|
+
*
|
|
656
|
+
* The counters above already survive a reload; the *rows* did not, because the panel rebuilds
|
|
657
|
+
* them from the session transcript and a closed session has none. That is why a reopened window
|
|
658
|
+
* showed zeros for a browser that had searched an hour earlier. This store holds only what the
|
|
659
|
+
* person typed and whether it found a lesson — no lesson body, no tool arguments — capped at 20,
|
|
660
|
+
* local only, same rule as every counter here.
|
|
661
|
+
*/
|
|
662
|
+
/** The node a reader says is theirs. Public pseudonym, local only — never a token. */
|
|
663
|
+
var NODE_KEY = "misakanet.panel.node.v1";
|
|
664
|
+
function readClaim() {
|
|
665
|
+
try { return String(window.localStorage.getItem(NODE_KEY) || "").trim(); } catch (error) { return ""; }
|
|
666
|
+
}
|
|
667
|
+
function saveClaim(value) {
|
|
668
|
+
try {
|
|
669
|
+
if (value) window.localStorage.setItem(NODE_KEY, value);
|
|
670
|
+
else window.localStorage.removeItem(NODE_KEY);
|
|
671
|
+
} catch (error) { /* private mode: the claim just does not persist */ }
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
var HISTORY_KEY = "misakanet.panel.history.v1";
|
|
675
|
+
var HISTORY_MAX = 20;
|
|
676
|
+
|
|
677
|
+
function readHistory() {
|
|
678
|
+
try {
|
|
679
|
+
var raw = window.localStorage.getItem(HISTORY_KEY);
|
|
680
|
+
var list = raw ? JSON.parse(raw) : [];
|
|
681
|
+
return Array.isArray(list) ? list : [];
|
|
682
|
+
} catch (error) {
|
|
683
|
+
return [];
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
function pushHistory(entry) {
|
|
688
|
+
try {
|
|
689
|
+
var list = readHistory().filter(function (row) { return row && row.key !== entry.key; });
|
|
690
|
+
list.unshift(entry);
|
|
691
|
+
window.localStorage.setItem(HISTORY_KEY, JSON.stringify(list.slice(0, HISTORY_MAX)));
|
|
692
|
+
} catch (error) {
|
|
693
|
+
/* private mode, or a hostile localStorage: history is a nicety, never a requirement */
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
|
|
627
697
|
function bumpStat(name, by) {
|
|
628
698
|
try {
|
|
629
699
|
var stats = browserStats();
|
|
@@ -679,6 +749,26 @@ window.__ModuleLoader__.load({
|
|
|
679
749
|
}
|
|
680
750
|
}
|
|
681
751
|
|
|
752
|
+
/**
|
|
753
|
+
* One keyframe pair for the reward flash. Injected rather than inlined because `@keyframes` has
|
|
754
|
+
* no inline form, and gated on `prefers-reduced-motion: reduce` because a scoreboard animation
|
|
755
|
+
* is exactly the kind of motion that setting exists for.
|
|
756
|
+
*/
|
|
757
|
+
var MOTION_ID = "misakanet-panel-motion";
|
|
758
|
+
|
|
759
|
+
function ensureMotionCss() {
|
|
760
|
+
if (typeof document === "undefined" || document.getElementById(MOTION_ID)) return;
|
|
761
|
+
var style = document.createElement("style");
|
|
762
|
+
style.id = MOTION_ID;
|
|
763
|
+
style.textContent =
|
|
764
|
+
"@keyframes misakanet-pop{0%{transform:scale(.7);opacity:0}45%{transform:scale(1.08);opacity:1}100%{transform:scale(1);opacity:1}}" +
|
|
765
|
+
"@keyframes misakanet-rise{0%{transform:translateY(2px);opacity:1}100%{transform:translateY(-12px);opacity:0}}" +
|
|
766
|
+
".misakanet-flash{display:inline-block;font-size:11px;font-weight:600;padding:1px 6px;border-radius:9px;" +
|
|
767
|
+
"background:rgba(34,197,94,.14);color:inherit;animation:misakanet-pop 280ms ease-out,misakanet-rise 900ms ease-out 420ms forwards}" +
|
|
768
|
+
"@media (prefers-reduced-motion: reduce){.misakanet-flash{animation:none}}";
|
|
769
|
+
(document.head || document.body).appendChild(style);
|
|
770
|
+
}
|
|
771
|
+
|
|
682
772
|
var MUTED = "rgba(127,127,127,0.45)";
|
|
683
773
|
var DIM = { opacity: 0.72 };
|
|
684
774
|
// A dense panel still needs hierarchy: a hairline + a small uppercase label is what separates
|
|
@@ -949,6 +1039,8 @@ var DEFAULT_MCP_URL = "https://misakanet.org/mcp";
|
|
|
949
1039
|
voice: String(payload.voice || ""),
|
|
950
1040
|
voted: false,
|
|
951
1041
|
});
|
|
1042
|
+
pushHistory({ key: "s:" + entry.callId, at: entry.at, kind: "search",
|
|
1043
|
+
text: String(entry.query || "").slice(0, 90), lesson: entry.lessonId ? 1 : 0 });
|
|
952
1044
|
bumpStat("searches");
|
|
953
1045
|
// Browser playback of the cue the SERVER chose — only when someone turned it on. The local
|
|
954
1046
|
// hook does the same thing through the machine's own player; this is the browser's copy.
|
|
@@ -1409,17 +1501,54 @@ var DEFAULT_MCP_URL = "https://misakanet.org/mcp";
|
|
|
1409
1501
|
* is "the endpoint did not answer" — the two say different things and neither is an empty board.
|
|
1410
1502
|
*/
|
|
1411
1503
|
function LadderSection() {
|
|
1504
|
+
var claimState = react.useState(readClaim());
|
|
1505
|
+
var claim = claimState[0];
|
|
1506
|
+
var setClaim = claimState[1];
|
|
1507
|
+
var draftState = react.useState("");
|
|
1508
|
+
var draft = draftState[0];
|
|
1509
|
+
var setDraft = draftState[1];
|
|
1510
|
+
var editingState = react.useState(false);
|
|
1511
|
+
var editing = editingState[0];
|
|
1512
|
+
var setEditing = editingState[1];
|
|
1412
1513
|
var state = react.useState(undefined);
|
|
1413
1514
|
var ladder = state[0];
|
|
1414
1515
|
var setLadder = state[1];
|
|
1415
1516
|
react.useEffect(function () {
|
|
1416
1517
|
var alive = true;
|
|
1417
|
-
|
|
1518
|
+
var url = LADDER_URL + "?window=week" + (claim ? "&node=" + encodeURIComponent(claim) : "");
|
|
1519
|
+
fetch(url, { headers: { Accept: "application/json" } })
|
|
1418
1520
|
.then(function (response) { return response.ok ? response.json() : null; })
|
|
1419
1521
|
.then(function (data) { if (alive) setLadder(data && data.top ? data : null); })
|
|
1420
1522
|
.catch(function () { if (alive) setLadder(null); });
|
|
1421
1523
|
return function () { alive = false; };
|
|
1422
|
-
}, []);
|
|
1524
|
+
}, [claim]);
|
|
1525
|
+
|
|
1526
|
+
/**
|
|
1527
|
+
* One ranked row: badge, optional GH chip, name, score, and the share bar.
|
|
1528
|
+
* `highlight` marks the reader's own row when it sits outside the top five.
|
|
1529
|
+
*/
|
|
1530
|
+
function ladderRow(entry, key, max, highlight) {
|
|
1531
|
+
var share = Math.max(4, Math.round((entry.score / max) * 100));
|
|
1532
|
+
return h("div", { key: key, style: { padding: "5px 0", opacity: highlight ? 1 : undefined } },
|
|
1533
|
+
h("div", { style: { display: "flex", alignItems: "center", gap: "8px" } },
|
|
1534
|
+
h("span", { style: { flex: "none", width: "18px", height: "18px", borderRadius: "50%",
|
|
1535
|
+
display: "inline-flex", alignItems: "center", justifyContent: "center",
|
|
1536
|
+
fontSize: "10px", fontVariantNumeric: "tabular-nums",
|
|
1537
|
+
background: "rgba(127,127,127,.16)", opacity: 0.85 } }, String(entry.rank)),
|
|
1538
|
+
entry.login ? h("span", { style: { flex: "none", fontSize: "9px", lineHeight: "1",
|
|
1539
|
+
padding: "2px 4px", borderRadius: "3px", border: "1px solid " + MUTED,
|
|
1540
|
+
opacity: 0.65, letterSpacing: "0.04em" } }, "GH") : null,
|
|
1541
|
+
h("span", { style: { flex: "1 1 auto", minWidth: 0, overflow: "hidden",
|
|
1542
|
+
textOverflow: "ellipsis", whiteSpace: "nowrap" } }, String(entry.name || entry.node || "")),
|
|
1543
|
+
highlight ? h("span", { style: Object.assign({}, DIM, { flex: "none", fontSize: "10px" }) }, T("panel.ladder.you")) : null,
|
|
1544
|
+
h("span", { style: { flex: "none", fontWeight: 600, fontSize: "13px",
|
|
1545
|
+
fontVariantNumeric: "tabular-nums" } }, String(entry.score))),
|
|
1546
|
+
h("div", { style: { height: "3px", margin: "4px 0 0 26px", borderRadius: "2px",
|
|
1547
|
+
background: "rgba(127,127,127,.16)" } },
|
|
1548
|
+
h("i", { style: { display: "block", height: "100%", width: share + "%",
|
|
1549
|
+
borderRadius: "2px", background: "currentColor", opacity: 0.5 } })));
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1423
1552
|
var rows = [h("div", { key: "t", style: Object.assign({}, SECTION_TITLE, { display: "flex",
|
|
1424
1553
|
alignItems: "baseline", gap: "6px" }) },
|
|
1425
1554
|
T("panel.ladder"),
|
|
@@ -1432,27 +1561,41 @@ var DEFAULT_MCP_URL = "https://misakanet.org/mcp";
|
|
|
1432
1561
|
} else {
|
|
1433
1562
|
var top = ladder.top.slice(0, 5);
|
|
1434
1563
|
var max = top[0].score || 1;
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
fontSize: "10px", fontVariantNumeric: "tabular-nums",
|
|
1442
|
-
background: "rgba(127,127,127,.16)", opacity: 0.85 } }, String(entry.rank)),
|
|
1443
|
-
h("span", { style: { flex: "1 1 auto", minWidth: 0, overflow: "hidden",
|
|
1444
|
-
textOverflow: "ellipsis", whiteSpace: "nowrap" } }, String(entry.name || entry.node || "")),
|
|
1445
|
-
h("span", { style: { flex: "none", fontWeight: 600, fontSize: "13px",
|
|
1446
|
-
fontVariantNumeric: "tabular-nums" } }, String(entry.score))),
|
|
1447
|
-
h("div", { style: { height: "3px", margin: "4px 0 0 26px", borderRadius: "2px",
|
|
1448
|
-
background: "rgba(127,127,127,.16)" } },
|
|
1449
|
-
h("i", { style: { display: "block", height: "100%", width: share + "%",
|
|
1450
|
-
borderRadius: "2px", background: "currentColor", opacity: 0.5 } })));
|
|
1451
|
-
})));
|
|
1564
|
+
var own = ladder.me;
|
|
1565
|
+
var ownInsideTop = own && top.some(function (entry) { return entry.rank === own.rank; });
|
|
1566
|
+
rows.push(h("div", { key: "r", style: Object.assign({}, BOX, { marginTop: "6px" }) },
|
|
1567
|
+
top.map(function (entry) { return ladderRow(entry, "l" + entry.rank, max, own && entry.rank === own.rank); }),
|
|
1568
|
+
own && !ownInsideTop ? h("div", { key: "me", style: { borderTop: "1px solid " + MUTED, marginTop: "4px", paddingTop: "2px" } },
|
|
1569
|
+
ladderRow(own, "me-row", max, true)) : null));
|
|
1452
1570
|
if (ladder.coverage && ladder.coverage.note) {
|
|
1453
1571
|
rows.push(h("div", { key: "c", style: Object.assign({}, DIM, { marginTop: "4px" }) }, T("panel.ladder.coverage")));
|
|
1454
1572
|
}
|
|
1455
1573
|
}
|
|
1574
|
+
// Claim a pseudonym: the only identity the browser can hold without a token. Public by
|
|
1575
|
+
// construction, so a local copy of it is not a secret.
|
|
1576
|
+
if (editing) {
|
|
1577
|
+
rows.push(h("div", { key: "claim-edit", style: { display: "flex", gap: "6px", marginTop: "6px", alignItems: "center" } },
|
|
1578
|
+
h("input", {
|
|
1579
|
+
key: "input", type: "text", value: draft, placeholder: T("panel.ladder.claimHint"),
|
|
1580
|
+
style: Object.assign({}, BUTTON, { flex: "1 1 auto", fontWeight: 400, cursor: "text" }),
|
|
1581
|
+
onChange: function (event) { setDraft(event.target.value); },
|
|
1582
|
+
}),
|
|
1583
|
+
h("button", { key: "save", type: "button", style: BUTTON, onClick: function () {
|
|
1584
|
+
var value = String(draft || "").trim();
|
|
1585
|
+
if (!/^[A-Za-z0-9_-]{3,32}$/.test(value)) return;
|
|
1586
|
+
saveClaim(value);
|
|
1587
|
+
setClaim(value);
|
|
1588
|
+
setEditing(false);
|
|
1589
|
+
} }, T("panel.ladder.save"))));
|
|
1590
|
+
} else {
|
|
1591
|
+
rows.push(h("div", { key: "claim", style: Object.assign({}, DIM, { marginTop: "4px" }) },
|
|
1592
|
+
claim ? h("span", null, T("panel.ladder.yours") + claim + " ",
|
|
1593
|
+
h("button", { type: "button", style: BUTTON, onClick: function () {
|
|
1594
|
+
saveClaim(""); setClaim("");
|
|
1595
|
+
} }, T("panel.ladder.clear")))
|
|
1596
|
+
: h("button", { type: "button", style: BUTTON, onClick: function () { setDraft(""); setEditing(true); } },
|
|
1597
|
+
T("panel.ladder.claim"))));
|
|
1598
|
+
}
|
|
1456
1599
|
return h("div", null, rows);
|
|
1457
1600
|
}
|
|
1458
1601
|
|
|
@@ -1475,6 +1618,13 @@ var DEFAULT_MCP_URL = "https://misakanet.org/mcp";
|
|
|
1475
1618
|
// yet", `null` is "asked and there is no ranking". Collapsing them would make the first paint
|
|
1476
1619
|
// say the endpoint ranked nothing, which is a claim the page has not earned yet — and it would
|
|
1477
1620
|
// leave no way to tell an empty ranking from one still in flight.
|
|
1621
|
+
// The reward flash: one pop when a search surfaces a lesson. `null` count is "first paint",
|
|
1622
|
+
// which must not flash for rows that were already there when the panel opened.
|
|
1623
|
+
var flashState = react.useState("");
|
|
1624
|
+
var flash = flashState[0];
|
|
1625
|
+
var setFlash = flashState[1];
|
|
1626
|
+
var seenSearches = react.useRef(null);
|
|
1627
|
+
|
|
1478
1628
|
var hotState = react.useState(undefined);
|
|
1479
1629
|
var hot = hotState[0];
|
|
1480
1630
|
var setHot = hotState[1];
|
|
@@ -1647,6 +1797,49 @@ var DEFAULT_MCP_URL = "https://misakanet.org/mcp";
|
|
|
1647
1797
|
count(votes.length, T("unit.vote"), T("unit.votes")) + " " + T("panel.strip.helpfulTpl", { count: count(helpful, T("unit.vote"), T("unit.votes")), n: helpful, unit: T("unit.votes") }) +
|
|
1648
1798
|
count(intakes.length, T("unit.report"), T("unit.reports")) + " " + T("panel.strip.convertedTpl", { count: count(converted, T("unit.report"), T("unit.reports")), n: converted, unit: T("unit.reports") })));
|
|
1649
1799
|
|
|
1800
|
+
react.useEffect(function () {
|
|
1801
|
+
var total = searches.length;
|
|
1802
|
+
var reports = intakes.length;
|
|
1803
|
+
if (seenSearches.current === null) {
|
|
1804
|
+
seenSearches.current = { searches: total, intakes: reports };
|
|
1805
|
+
return;
|
|
1806
|
+
}
|
|
1807
|
+
var previous = seenSearches.current;
|
|
1808
|
+
seenSearches.current = { searches: total, intakes: reports };
|
|
1809
|
+
var kind = reports > previous.intakes ? "contrib"
|
|
1810
|
+
: total > previous.searches ? (searches[total - 1] && searches[total - 1].lessonId ? "hit" : "search")
|
|
1811
|
+
: "";
|
|
1812
|
+
if (!kind) return;
|
|
1813
|
+
setFlash(kind);
|
|
1814
|
+
var timer = setTimeout(function () { setFlash(""); }, 1300);
|
|
1815
|
+
return function () { clearTimeout(timer); };
|
|
1816
|
+
}, [searches.length, intakes.length]);
|
|
1817
|
+
|
|
1818
|
+
// What this browser did before this session existed. Shown only when the session has nothing
|
|
1819
|
+
// to show: otherwise the same rows would appear twice, and the session's own list is the
|
|
1820
|
+
// more precise one.
|
|
1821
|
+
if (!searches.length) {
|
|
1822
|
+
var recent = readHistory().slice(0, 4);
|
|
1823
|
+
if (recent.length) {
|
|
1824
|
+
rows.push(h("div", { key: "recent", style: SECTION_TITLE }, T("panel.recent")));
|
|
1825
|
+
rows.push(h("div", { key: "recent-r" }, recent.map(function (row) {
|
|
1826
|
+
return h("div", { key: row.key, style: { display: "flex", gap: "8px", padding: "3px 0" } },
|
|
1827
|
+
h("span", { style: Object.assign({}, DIM, { flex: "none", fontVariantNumeric: "tabular-nums" }) }, clockOf(row.at)),
|
|
1828
|
+
h("span", { style: { flex: "1 1 auto", minWidth: 0, overflow: "hidden",
|
|
1829
|
+
textOverflow: "ellipsis", whiteSpace: "nowrap" } }, String(row.text || "")),
|
|
1830
|
+
h("span", { style: Object.assign({}, DIM, { flex: "none" }) },
|
|
1831
|
+
row.lesson ? T("panel.recent.hit") : T("panel.recent.miss")));
|
|
1832
|
+
})));
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1836
|
+
ensureMotionCss();
|
|
1837
|
+
if (flash) {
|
|
1838
|
+
rows.push(h("div", { key: "flash", style: { marginTop: "6px" } },
|
|
1839
|
+
h("span", { className: "misakanet-flash" },
|
|
1840
|
+
T(flash === "hit" ? "panel.flash.hit" : flash === "search" ? "panel.flash.search" : "panel.flash.contrib"))));
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1650
1843
|
// The ladder sits directly under the counters, not at the bottom: it is the one number on this
|
|
1651
1844
|
// page about the whole network rather than this browser, and it used to be the last thing a
|
|
1652
1845
|
// reader reached — the review said the placement made a headline look like a footnote.
|
|
@@ -1736,10 +1929,14 @@ var DEFAULT_MCP_URL = "https://misakanet.org/mcp";
|
|
|
1736
1929
|
}, T("panel.hint.openLabel")) : null);
|
|
1737
1930
|
}
|
|
1738
1931
|
|
|
1739
|
-
|
|
1740
|
-
|
|
1932
|
+
// One line when the session has nothing at all, instead of three labelled sections each
|
|
1933
|
+
// saying so. Each section below renders only when it has rows.
|
|
1934
|
+
if (!searches.length && !intakes.length && !lessons.length) {
|
|
1741
1935
|
rows.push(entryPointHint("s1e", "panel.asked.none"));
|
|
1742
|
-
}
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
if (searches.length) {
|
|
1939
|
+
rows.push(h("div", { key: "s1", style: SECTION_TITLE }, T("panel.asked")));
|
|
1743
1940
|
var searchRows = searches.slice().reverse().slice(0, 20).map(function (entry) {
|
|
1744
1941
|
var key = "q" + entry.callId + entry.at;
|
|
1745
1942
|
var vote = entry.voted
|
|
@@ -1810,7 +2007,6 @@ var DEFAULT_MCP_URL = "https://misakanet.org/mcp";
|
|
|
1810
2007
|
}
|
|
1811
2008
|
|
|
1812
2009
|
// ② reports filed
|
|
1813
|
-
rows.push(h("div", { key: "s2", style: SECTION_TITLE }, T("panel.reports")));
|
|
1814
2010
|
var openReports = intakes.filter(function (entry) {
|
|
1815
2011
|
return entry.state !== "converted" && entry.state !== "answered" && entry.state !== "already_have";
|
|
1816
2012
|
});
|
|
@@ -1823,9 +2019,8 @@ var DEFAULT_MCP_URL = "https://misakanet.org/mcp";
|
|
|
1823
2019
|
rows.push(h("div", { key: "s2h", style: DIM },
|
|
1824
2020
|
count(openReports.length, T("panel.report.pending")) + T("panel.report.recheck")));
|
|
1825
2021
|
}
|
|
1826
|
-
if (
|
|
1827
|
-
rows.push(h("div", { key: "
|
|
1828
|
-
} else {
|
|
2022
|
+
if (intakes.length) {
|
|
2023
|
+
rows.push(h("div", { key: "s2", style: SECTION_TITLE }, T("panel.reports")));
|
|
1829
2024
|
rows.push(h("div", { key: "s2r" }, intakes.slice().reverse().map(function (entry) {
|
|
1830
2025
|
var labels = {
|
|
1831
2026
|
filing: "filing", pending: T("intake.waiting"), answered: T("intake.answered"),
|
|
@@ -1864,10 +2059,8 @@ var DEFAULT_MCP_URL = "https://misakanet.org/mcp";
|
|
|
1864
2059
|
// every count — no row here can claim the rung, which is also why the rule below is stated once.
|
|
1865
2060
|
// (`E4` itself is observed elsewhere: `misakanet_me_events` counts distinct clients from
|
|
1866
2061
|
// `search_signals`, which this browser half likewise cannot read.)
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
rows.push(entryPointHint("s3e", "panel.trust.none"));
|
|
1870
|
-
} else {
|
|
2062
|
+
if (lessons.length) {
|
|
2063
|
+
rows.push(h("div", { key: "s3", style: SECTION_TITLE }, T("panel.trust")));
|
|
1871
2064
|
// The rule once, not per row: it is the same sentence for every lesson, and repeating it
|
|
1872
2065
|
// four times buries the numbers it is there to explain.
|
|
1873
2066
|
rows.push(h("div", { key: "s3rule", style: DIM },
|
|
@@ -1889,24 +2082,19 @@ var DEFAULT_MCP_URL = "https://misakanet.org/mcp";
|
|
|
1889
2082
|
})));
|
|
1890
2083
|
}
|
|
1891
2084
|
|
|
1892
|
-
// ④
|
|
1893
|
-
rows.push(h("div", { key: "s4", style:
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
));
|
|
1906
|
-
|
|
1907
|
-
// ⑤ voice
|
|
1908
|
-
rows.push(h("div", { key: "s5", style: SECTION_TITLE }, T("panel.voice")));
|
|
1909
|
-
rows.push(h("div", { key: "s5r", style: BOX },
|
|
2085
|
+
// ④ this browser's counters, one line: the strip above already carries this session's.
|
|
2086
|
+
rows.push(h("div", { key: "s4", style: Object.assign({}, DIM, { marginTop: "6px" }) },
|
|
2087
|
+
T("panel.activity") + " · " + T("panel.activity.browser") +
|
|
2088
|
+
count(stats.searches || 0, T("unit.search"), T("unit.searches")) + " · " +
|
|
2089
|
+
T("panel.activity.reusedTpl", { count: count(stats.lessonsReused || 0, T("unit.lesson"), T("unit.lessons")), n: stats.lessonsReused || 0, unit: T("unit.lessons") }) +
|
|
2090
|
+
count(stats.votes || 0, T("unit.vote"), T("unit.votes")) + " · " +
|
|
2091
|
+
T("panel.activity.reportsTpl", { count: count(stats.reportsFiled || 0, T("unit.reportFiled"), T("unit.reportsFiled")), n: stats.reportsFiled || 0, unit: T("unit.reportsFiled") }) +
|
|
2092
|
+
T("panel.activity.filedTpl", { count: count(stats.reportsConverted || 0, T("unit.conversion"), T("unit.conversions")), n: stats.reportsConverted || 0, unit: T("unit.conversions") })));
|
|
2093
|
+
|
|
2094
|
+
// ⑤ voice: a switch, not a section. The full explanation of the local hook lives in the
|
|
2095
|
+
// footnote details; what a reader needs here is the control.
|
|
2096
|
+
rows.push(h("div", { key: "s5", style: { marginTop: "6px", display: "flex", gap: "8px",
|
|
2097
|
+
alignItems: "center", flexWrap: "wrap" } },
|
|
1910
2098
|
h("button", {
|
|
1911
2099
|
type: "button",
|
|
1912
2100
|
style: BUTTON,
|
|
@@ -1915,34 +2103,32 @@ var DEFAULT_MCP_URL = "https://misakanet.org/mcp";
|
|
|
1915
2103
|
setVoiceEnabled(next);
|
|
1916
2104
|
setVoice(next);
|
|
1917
2105
|
},
|
|
1918
|
-
}, T(voice ? "panel.voice.on" : "panel.voice.off")),
|
|
1919
|
-
lastCue
|
|
2106
|
+
}, T("panel.voice") + ": " + T(voice ? "panel.voice.on" : "panel.voice.off")),
|
|
2107
|
+
lastCue ? h("button", {
|
|
1920
2108
|
type: "button",
|
|
1921
2109
|
style: BUTTON,
|
|
1922
2110
|
onClick: function () { playCue(lastCue); },
|
|
1923
|
-
}, T("panel.voice.play") + lastCue + "”"),
|
|
1924
|
-
h("
|
|
1925
|
-
? T("panel.voice.cue") + lastCue + T("panel.voice.cueTail")
|
|
1926
|
-
: T("panel.voice.none")),
|
|
1927
|
-
h("div", { style: DIM }, T("panel.voice.hook"))));
|
|
2111
|
+
}, T("panel.voice.play") + lastCue + "”") : null,
|
|
2112
|
+
h("span", { style: DIM }, T("panel.voice.hook"))));
|
|
1928
2113
|
|
|
2114
|
+
var network = [];
|
|
1929
2115
|
// ⑥ the network's most-retrieved lessons
|
|
1930
2116
|
//
|
|
1931
2117
|
// Read-only, and about the whole network rather than this session: no lesson here had to be
|
|
1932
2118
|
// surfaced by the agent first. There is no vote affordance in this section and none of its copy
|
|
1933
2119
|
// says the count is approval — the number is an observed retrieval, and the rule states what it
|
|
1934
2120
|
// does and does not mean before the first row.
|
|
1935
|
-
|
|
2121
|
+
network.push(h("div", { key: "s6", style: SECTION_TITLE }, T("panel.hot")));
|
|
1936
2122
|
if (hot === undefined) {
|
|
1937
|
-
|
|
2123
|
+
network.push(h("div", { key: "s6w", style: DIM }, T("panel.hot.loading")));
|
|
1938
2124
|
} else if (hot === null) {
|
|
1939
2125
|
// The endpoint ranked nothing (or did not answer). Saying so beats printing five rows of
|
|
1940
2126
|
// `0 retrievals`, which would name lessons the payload never ranked.
|
|
1941
|
-
|
|
2127
|
+
network.push(h("div", { key: "s6e", style: DIM }, T("panel.hot.none")));
|
|
1942
2128
|
} else {
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
2129
|
+
network.push(h("div", { key: "s6rule", style: DIM }, T("panel.hot.rule")));
|
|
2130
|
+
network.push(h("div", { key: "s6l", style: DIM }, T("panel.hot.limit", { n: HOT_LESSON_LIMIT })));
|
|
2131
|
+
network.push(h("div", { key: "s6r" }, hot.slice(0, HOT_LESSON_LIMIT).map(function (entry) {
|
|
1946
2132
|
var path = String(entry && entry.lesson_id ? entry.lesson_id : "");
|
|
1947
2133
|
var times = entry && typeof entry.count === "number" ? entry.count : null;
|
|
1948
2134
|
return h("div", { key: "h" + path, style: { borderTop: "1px solid " + MUTED, padding: "4px 0" } },
|
|
@@ -1965,24 +2151,24 @@ var DEFAULT_MCP_URL = "https://misakanet.org/mcp";
|
|
|
1965
2151
|
// searched first. There is no vote affordance in this section and none of its copy says the order
|
|
1966
2152
|
// is approval — `unsolved30d` counts unanswered searches, and the rule says what it counts before
|
|
1967
2153
|
// the first row and how it differs from the retrieval ranking above.
|
|
1968
|
-
|
|
2154
|
+
network.push(h("div", { key: "s7", style: SECTION_TITLE }, T("panel.coverage")));
|
|
1969
2155
|
if (coverage === undefined) {
|
|
1970
|
-
|
|
2156
|
+
network.push(h("div", { key: "s7w", style: DIM }, T("panel.coverage.loading")));
|
|
1971
2157
|
} else if (coverage === null) {
|
|
1972
2158
|
// The board ranked nothing (or did not answer). Saying so beats printing rows of `0`, which
|
|
1973
2159
|
// would name topics the payload never ranked.
|
|
1974
|
-
|
|
2160
|
+
network.push(h("div", { key: "s7e", style: DIM }, T("panel.coverage.none")));
|
|
1975
2161
|
} else {
|
|
1976
|
-
|
|
2162
|
+
network.push(h("div", { key: "s7rule", style: DIM }, T("panel.coverage.rule")));
|
|
1977
2163
|
var coverageMetrics = coverage.metrics || {};
|
|
1978
2164
|
if (typeof coverageMetrics.publishedLessons === "number") {
|
|
1979
|
-
|
|
2165
|
+
network.push(h("div", { key: "s7t", style: DIM },
|
|
1980
2166
|
T("panel.coverage.totals", {
|
|
1981
2167
|
count: count(coverageMetrics.publishedLessons, T("unit.lesson"), T("unit.lessons")),
|
|
1982
2168
|
n: coverageMetrics.publishedLessons, unit: T("unit.lessons"),
|
|
1983
2169
|
})));
|
|
1984
2170
|
}
|
|
1985
|
-
|
|
2171
|
+
network.push(h("div", { key: "s7r" }, coverage.gaps.slice(0, COVERAGE_LIMIT).map(function (gap) {
|
|
1986
2172
|
return h("div", { key: "f" + gap.taskFamily, style: { borderTop: "1px solid " + MUTED, padding: "4px 0" } },
|
|
1987
2173
|
h("span", {}, gap.taskFamily),
|
|
1988
2174
|
h("span", { style: DIM }, " " + T("panel.coverage.lessonsTpl", {
|
|
@@ -1996,6 +2182,14 @@ var DEFAULT_MCP_URL = "https://misakanet.org/mcp";
|
|
|
1996
2182
|
})));
|
|
1997
2183
|
}
|
|
1998
2184
|
|
|
2185
|
+
// ⑥ and ⑦ answer a maintainer's question — what the corpus returns most, and where it has
|
|
2186
|
+
// nothing to return. A person opening the sidebar acts on none of it, so it is folded away:
|
|
2187
|
+
// present in one click, out of the default reading path.
|
|
2188
|
+
rows.push(h("details", { key: "network", style: { marginTop: "16px", paddingTop: "12px", borderTop: "1px solid " + MUTED } },
|
|
2189
|
+
h("summary", { style: { cursor: "pointer", fontSize: "11px", fontWeight: 600,
|
|
2190
|
+
letterSpacing: "0.04em", textTransform: "uppercase", opacity: 0.6 } }, T("panel.network")),
|
|
2191
|
+
h("div", null, network)));
|
|
2192
|
+
|
|
1999
2193
|
rows.push(h("details", { key: "foot", style: Object.assign({}, DIM, { marginTop: "12px" }) },
|
|
2000
2194
|
h("summary", { style: { cursor: "pointer" } }, T("panel.sources")),
|
|
2001
2195
|
h("div", { style: { marginTop: "4px" } }, T("panel.footnote"))));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "misakanet",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.15.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "MisakaNet failure-memory skill — evidence-rated failure lessons for AI agents. DSH bundle: registers the MCP tools as mcp__misakanet__* (misakanet_search/get_lesson/…), served by the public Streamable HTTP endpoint https://misakanet.org/mcp — live tools from an npm install, in any profile, with no local python. A profile that prefers the repo's own stdio server can override the bundle row.",
|
|
6
6
|
"icon": "icon.svg",
|