@fractalsynapse/dsh-chapters 0.2.60 → 0.2.62

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.
@@ -1426,6 +1426,14 @@ three models swapped live at runtime, autorun uncapped; durable-log watching nam
1426
1426
  mechanism. Open: #491/#462 await the still-undelivered scheduled cycle (cron ~10h late, past
1427
1427
  pattern — dispatch fallback decided for tomorrow if absent); #456 Tier B remains the campaign day.
1428
1428
 
1429
+ ## 0.2.62 cut (2026-11-28): bar retracted (trace-audited zero), /compact receiver bug repaired (ES privates vs the cordis proxy), source-first rule binding
1430
+
1431
+ **Shipped:** #599 (PR #600) removal + #597 AGENTS rule + #601 (PR #602) proxy-safe binding with hazard/late-dispatch/first-writer/boundary rows. /compact proven kind=success on rc.2 AND rc.5 matrix trees. #545 remains OPEN — the resumed-timeline invisibility of chapters command rows is a separate, still-under-investigation defect (now from host source, not bundle archaeology). Suite 1845/0/1+, both PRs all-contexts green first pass.
1432
+
1433
+ ## 0.2.61 cut (2026-11-27): reply-row self-suppression + dock geometry — maintainer-graded, rig-blind
1434
+
1435
+ **Shipped:** #594 (PR #595, all five contexts first pass): suppression subtracts the row's own mounted text (the flash-then-vanish was the row eating its own echo; the rig's card-rendering host hid it behind a correct-looking suppressed=true), and the row ships the bar's measured dock geometry as its own stylesheet. Live corroboration BEFORE the fix: the maintainer's registry held the perfect record ('/chapters-status · success · Version: 0.2.60 · loaded from …') — server side always right, client display ate itself. Suite 1847/0/1+, tsc + client typecheck clean. Acceptance pending on the ONLY grader that matters: the row appears with the last recorded reply at page load on the maintainer's host and STAYS.
1436
+
1429
1437
  ## 0.2.60 cut (2026-11-27): the command reply row — invisible-card era ends plugin-side, plus the #588 gate trilogy
1430
1438
 
1431
1439
  **Shipped:** #590 (PR #591): the dock row rendering every /chapters-* reply (server-recorded settings row, human-driven pulls, self-suppression when the host card exists, in-flight as running) — the maintainer's downtime complaint, ended. #588 (PR #589): the regression gates — host fold drift guard both ways (mutation-proved), durable round-trip stage, FAQ. Development record kept honest: the follow-wire channel was MEASURED dead (27 records, 0 command events) before merge, the exec-slash and dispatch-race bugs found by breadcrumb-driven reload legs (fourteen iterations), and the e2e now grades the reply-visible CONTRACT rather than my assumption about the channel. The row on the maintainer's exact host version is graded by the post-install live pass — recorded as pending, not claimed.
package/lib/client.js CHANGED
@@ -1440,183 +1440,6 @@ window.__ModuleLoader__.load({
1440
1440
  if (res.ok !== true) return "";
1441
1441
  return res.value?.result?.text ?? "";
1442
1442
  }
1443
- function excerptOf(text) {
1444
- const flat = text.replace(/\s+/g, " ").trim();
1445
- return flat.length > 200 ? `${flat.slice(0, 200)}…` : flat;
1446
- }
1447
- /**
1448
- * Does the host already render this reply? The probe runs BEFORE the row mounts (once per new
1449
- * exchange), so an excerpt found in the document is the host's card, not our own echo. Absent
1450
- * document (tests, odd hosts) reads as "not shown" — fail-visible, never fail-silent.
1451
- */
1452
- function hostCardShowsReply(excerpt, doc) {
1453
- if (excerpt === "") return false;
1454
- const text = doc?.body?.innerText;
1455
- if (typeof text !== "string") return false;
1456
- return text.includes(excerpt.slice(0, 80));
1457
- }
1458
- function parseReplyRow(raw) {
1459
- if (raw.trim() === "") return null;
1460
- try {
1461
- const p = JSON.parse(raw);
1462
- if (typeof p.line !== "string" || p.line === "") return null;
1463
- return {
1464
- line: p.line,
1465
- kind: p.kind ?? "success",
1466
- text: p.text ?? "",
1467
- seq: Number.isFinite(Date.parse(p.at ?? "")) ? Date.parse(p.at ?? "") : 1
1468
- };
1469
- } catch {
1470
- return null;
1471
- }
1472
- }
1473
- const composerTextOf = () => {
1474
- try {
1475
- const el = document.querySelector("[data-composer-input]");
1476
- if (el === null) return "";
1477
- return "value" in el ? String(el.value ?? "") : el.innerText ?? "";
1478
- } catch {
1479
- return "";
1480
- }
1481
- };
1482
- function subscribeReply(exec, onReply) {
1483
- let closed = false;
1484
- const pullOnce = async () => {
1485
- try {
1486
- const raw = await exec("/chapters-reply last");
1487
- const parsed = parseReplyRow(raw);
1488
- if (closed) return true;
1489
- console.info(`[client:chapters] command reply pull: ${String(raw.length)} chars, parsed=${String(parsed !== null)}`);
1490
- if (parsed === null) return false;
1491
- onReply(parsed);
1492
- return true;
1493
- } catch {
1494
- return false;
1495
- }
1496
- };
1497
- const pull = async (retry = false) => {
1498
- if (await pullOnce()) return;
1499
- if (!retry) return;
1500
- for (let i = 0; i < 4; i += 1) {
1501
- await new Promise((res) => setTimeout(res, 500));
1502
- if (closed || await pullOnce()) return;
1503
- }
1504
- };
1505
- pull();
1506
- const onVis = () => {
1507
- try {
1508
- if (document.visibilityState === "visible") pull();
1509
- } catch {}
1510
- };
1511
- try {
1512
- document.addEventListener("visibilitychange", onVis);
1513
- } catch {}
1514
- let prior = composerTextOf();
1515
- let observer;
1516
- let attachTimer;
1517
- const onComposerMutate = () => {
1518
- const now = composerTextOf();
1519
- if (/^\s*\/chapters[-a-z]*/i.test(prior) && now.trim() === "") {
1520
- console.info("[client:chapters] command reply submit detected");
1521
- pull(true);
1522
- }
1523
- prior = now;
1524
- };
1525
- const attachComposer = () => {
1526
- try {
1527
- const el = document.querySelector("[data-composer-input]");
1528
- if (el === null) return false;
1529
- observer = new MutationObserver(onComposerMutate);
1530
- observer.observe(el, {
1531
- childList: true,
1532
- subtree: true,
1533
- characterData: true,
1534
- attributes: true
1535
- });
1536
- console.info("[client:chapters] command reply composer observer attached");
1537
- return true;
1538
- } catch {
1539
- return true;
1540
- }
1541
- };
1542
- if (!attachComposer()) {
1543
- let attempts = 0;
1544
- const retry = () => {
1545
- if (closed || attempts >= 8 || attachComposer()) return;
1546
- attempts += 1;
1547
- attachTimer = setTimeout(retry, 2e3);
1548
- };
1549
- attachTimer = setTimeout(retry, 2e3);
1550
- }
1551
- return () => {
1552
- closed = true;
1553
- if (attachTimer !== void 0) clearTimeout(attachTimer);
1554
- try {
1555
- document.removeEventListener("visibilitychange", onVis);
1556
- } catch {}
1557
- observer?.disconnect();
1558
- };
1559
- }
1560
- function CommandReplyRow(props) {
1561
- const [reply, setReply] = (0, react.useState)(null);
1562
- const [expanded, setExpanded] = (0, react.useState)(false);
1563
- const [dismissedSeq, setDismissedSeq] = (0, react.useState)(null);
1564
- (0, react.useEffect)(() => {
1565
- console.info("[client:chapters] command reply row mounted");
1566
- return subscribeReply(props.exec, setReply);
1567
- }, [props.exec]);
1568
- const excerpt = reply === null || reply.kind === "running" ? "" : excerptOf(reply.text);
1569
- const [suppressed, setSuppressed] = (0, react.useState)(false);
1570
- (0, react.useEffect)(() => {
1571
- setExpanded(false);
1572
- const sup = reply !== null && excerpt !== "" && hostCardShowsReply(excerpt, document);
1573
- if (reply !== null) console.info(`[client:chapters] command reply render decision: seq=${String(reply.seq)} suppressed=${String(sup)}`);
1574
- setSuppressed(sup);
1575
- }, [reply?.seq, excerpt]);
1576
- if (reply === null || reply.seq === dismissedSeq) return null;
1577
- if (suppressed) return null;
1578
- const color = reply.kind === "error" ? "var(--color-danger, #d33)" : reply.kind === "running" ? "var(--color-warning, #b80)" : "var(--color-fg-dimmed, #888)";
1579
- return (0, react.createElement)("div", {
1580
- "data-chapters-reply": "true",
1581
- style: {
1582
- display: "flex",
1583
- gap: 8,
1584
- alignItems: "center",
1585
- fontSize: 12,
1586
- padding: "4px 10px",
1587
- borderLeft: `3px solid ${color}`,
1588
- opacity: .92
1589
- },
1590
- title: reply.kind === "running" ? `${reply.line} — running` : `${reply.line} — ${reply.kind}`,
1591
- onClick: () => {
1592
- if (excerpt !== "") setExpanded((e) => !e);
1593
- }
1594
- }, (0, react.createElement)("span", { style: {
1595
- fontFamily: "monospace",
1596
- color
1597
- } }, reply.kind === "running" ? `> ${reply.line} …` : `> ${reply.line}`), excerpt === "" ? null : (0, react.createElement)("span", { style: {
1598
- color: "var(--color-fg, #ccc)",
1599
- overflow: "hidden",
1600
- textOverflow: "ellipsis",
1601
- whiteSpace: expanded ? "pre-wrap" : "nowrap",
1602
- maxWidth: "60ch",
1603
- flex: 1
1604
- } }, expanded ? reply.text : excerpt), (0, react.createElement)("button", {
1605
- type: "button",
1606
- "aria-label": "Dismiss command reply",
1607
- style: {
1608
- marginLeft: "auto",
1609
- border: "none",
1610
- background: "none",
1611
- color,
1612
- cursor: "pointer"
1613
- },
1614
- onClick: (ev) => {
1615
- ev.stopPropagation();
1616
- setDismissedSeq(reply.seq);
1617
- }
1618
- }, "×"));
1619
- }
1620
1443
  // src/client/index.ts
1621
1444
  /**
1622
1445
  * dsh-chapters client entry: the per-message door buttons.
@@ -1792,13 +1615,6 @@ window.__ModuleLoader__.load({
1792
1615
  order: 30,
1793
1616
  inject: (sessionId) => ({ exec: (line) => runCommandText(remote, sessionId, line) })
1794
1617
  }, PromptDock));
1795
- const disposeReplyRow = slots.inject("conversation.input.dock", () => slots.register({
1796
- name: "conversation.input.dock",
1797
- id: "chapters-command-reply",
1798
- order: 31,
1799
- inject: (sessionId) => ({ exec: (line) => runCommandText(remote, sessionId, line) })
1800
- }, CommandReplyRow));
1801
- console.info(`[client:chapters] command reply row registered: ${typeof disposeReplyRow}`);
1802
1618
  }
1803
1619
  exports.apply = apply;
1804
1620
  exports.inject = inject;