dsh-git-badge 0.11.0 → 0.12.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/CHANGELOG.md +12 -0
- package/lib/client.js +0 -122
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,18 @@ npm. 0.6.0 is the first release recorded here.
|
|
|
10
10
|
|
|
11
11
|
## [Unreleased]
|
|
12
12
|
|
|
13
|
+
## [0.12.0] - 2026-09-15
|
|
14
|
+
|
|
15
|
+
### Removed
|
|
16
|
+
|
|
17
|
+
- **The restart notice and one-click Restart button are gone from the input
|
|
18
|
+
chip.** The inline text — *restart dsh web to activate the sidebar badges* —
|
|
19
|
+
and its Restart button (`POST /dsh-market/api/v1/restart`) could outlive the
|
|
20
|
+
restart it asked for when the marker survived a boot, and the nag outweighed
|
|
21
|
+
the convenience. The restart-pending marker pipeline is intact server-side
|
|
22
|
+
(`seam/store.js`, `seamRestartPending` on the status response) for a future
|
|
23
|
+
marketplace-surface notification; the chip simply no longer renders it.
|
|
24
|
+
|
|
13
25
|
## [0.11.0] - 2026-09-14
|
|
14
26
|
|
|
15
27
|
### Added
|
package/lib/client.js
CHANGED
|
@@ -703,48 +703,6 @@ window.__ModuleLoader__.load({
|
|
|
703
703
|
*/
|
|
704
704
|
let seamHint = null;
|
|
705
705
|
|
|
706
|
-
/**
|
|
707
|
-
* The restart affordance for a seam change made while the host was
|
|
708
|
-
* running. dshmarket cannot see host-file mutations (its restart banner
|
|
709
|
-
* tracks only its own package bookkeeping), so the flag this reads is
|
|
710
|
-
* written by our own postinstall/apply — see seam/store.js. The Restart
|
|
711
|
-
* button calls dshmarket's PUBLIC, documented v1 restart endpoint
|
|
712
|
-
* (UPDATE-API-V1.md): feature-detected via capabilities, same-origin, and
|
|
713
|
-
* rendered as text-only on hosts that delegate restart (desktop /
|
|
714
|
-
* supervised), never a hand-rolled process-control path.
|
|
715
|
-
*/
|
|
716
|
-
async function marketRestartSupported() {
|
|
717
|
-
try {
|
|
718
|
-
const cap = await fetch("/dsh-market/api/v1/capabilities", { headers: { accept: "application/json" } }).then((r) => r.json());
|
|
719
|
-
return cap !== null && typeof cap === "object" && cap.restart !== void 0 && cap.restart.supported === true;
|
|
720
|
-
} catch {
|
|
721
|
-
return false;
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
async function marketRestart() {
|
|
726
|
-
await fetch("/dsh-market/api/v1/restart", {
|
|
727
|
-
method: "POST",
|
|
728
|
-
headers: { accept: "application/json", "content-type": "application/json" },
|
|
729
|
-
body: "{}",
|
|
730
|
-
}).catch(() => void 0); // the host drops the socket mid-restart — expected
|
|
731
|
-
// Poll until the origin is serving again, then reload into the
|
|
732
|
-
// recomposed boot. Bounded so a failed relaunch cannot spin forever.
|
|
733
|
-
for (let waited = 0; waited < 30000; waited += 500) {
|
|
734
|
-
await new Promise((r) => setTimeout(r, 500));
|
|
735
|
-
try {
|
|
736
|
-
const cap = await fetch("/dsh-market/api/v1/capabilities", { headers: { accept: "application/json" } });
|
|
737
|
-
if (cap.ok) {
|
|
738
|
-
location.reload();
|
|
739
|
-
return;
|
|
740
|
-
}
|
|
741
|
-
} catch {
|
|
742
|
-
// host down mid-restart — expected; keep polling
|
|
743
|
-
}
|
|
744
|
-
}
|
|
745
|
-
location.reload();
|
|
746
|
-
}
|
|
747
|
-
|
|
748
706
|
function ComposerGitChip({ sessionId }) {
|
|
749
707
|
const target = sessionId === void 0 ? void 0 : { kind: "session", id: sessionId };
|
|
750
708
|
// the PR/CI token is always on the chip, so its fetch is not gated
|
|
@@ -757,29 +715,7 @@ window.__ModuleLoader__.load({
|
|
|
757
715
|
// the PR token's own hover/focus state: it underlines on hover (and on
|
|
758
716
|
// focus) rather than at rest, and that underline is applied inline below
|
|
759
717
|
const [linkHover, setLinkHover] = react.useState(false);
|
|
760
|
-
// The restart affordance: idle → checking (capabilities) → restarting.
|
|
761
|
-
// One status refresh carries seamRestartPending at a time; when the
|
|
762
|
-
// restart lands, the marker is cleared at the new boot and this reverts.
|
|
763
|
-
const [restarting, setRestarting] = react.useState(false);
|
|
764
|
-
const [canRestart, setCanRestart] = react.useState(null); // null = not yet checked
|
|
765
718
|
const detail = useGitStatus(target, { pr: true, detail: true, enabled: hovered });
|
|
766
|
-
const restartPending = info !== void 0 && info.git === true && info.seamRestartPending !== void 0;
|
|
767
|
-
react.useEffect(() => {
|
|
768
|
-
if (!restartPending || canRestart !== null) return;
|
|
769
|
-
let cancelled = false;
|
|
770
|
-
marketRestartSupported().then((v) => {
|
|
771
|
-
if (!cancelled) setCanRestart(v);
|
|
772
|
-
});
|
|
773
|
-
return () => {
|
|
774
|
-
cancelled = true;
|
|
775
|
-
};
|
|
776
|
-
}, [restartPending, canRestart]);
|
|
777
|
-
async function restartNow() {
|
|
778
|
-
setRestarting(true);
|
|
779
|
-
if (await marketRestartSupported()) await marketRestart();
|
|
780
|
-
// Unsupported host: the text stays and says restart dsh web manually.
|
|
781
|
-
else setRestarting(false);
|
|
782
|
-
}
|
|
783
719
|
if (info === void 0 || info.git !== true) return null;
|
|
784
720
|
// the mark is an element now rather than a leading glyph in the string, so
|
|
785
721
|
// the SAME StatusMark the sidebar row draws carries the status here too;
|
|
@@ -787,63 +723,6 @@ window.__ModuleLoader__.load({
|
|
|
787
723
|
const text = info.branch + formatOperationToken(info) + formatGitSuffix(info);
|
|
788
724
|
const prToken = formatPrToken(info);
|
|
789
725
|
const prUrl = prLinkUrl(info);
|
|
790
|
-
// One-line explanation + one-click restart, ONLY while a restart is
|
|
791
|
-
// actually pending. The button exists because dshmarket's own banner
|
|
792
|
-
// cannot see the host-file change our installer made; the endpoint is
|
|
793
|
-
// its documented public API. On hosts that delegate restart (desktop,
|
|
794
|
-
// supervisors) canRestart is false and the text names the manual step.
|
|
795
|
-
const restartNotice =
|
|
796
|
-
!restartPending || restarting
|
|
797
|
-
? null
|
|
798
|
-
: react_jsx_runtime.jsxs(
|
|
799
|
-
"span",
|
|
800
|
-
{
|
|
801
|
-
style: {
|
|
802
|
-
display: "inline-flex",
|
|
803
|
-
alignItems: "center",
|
|
804
|
-
gap: "6px",
|
|
805
|
-
paddingLeft: "6px",
|
|
806
|
-
borderLeft: "1px solid var(--dsw-alias-border-secondary, #d0d7de)",
|
|
807
|
-
whiteSpace: "normal",
|
|
808
|
-
maxWidth: "320px"
|
|
809
|
-
},
|
|
810
|
-
children: [
|
|
811
|
-
react_jsx_runtime.jsx(
|
|
812
|
-
"span",
|
|
813
|
-
{
|
|
814
|
-
title: "The installer applied dsh-git-badge's sidebar patch to DSH's own files; client bundles are composed at boot, so a restart is needed for it to take effect. Revert anytime with `npx dsh-git-badge revert`.",
|
|
815
|
-
children:
|
|
816
|
-
canRestart === false
|
|
817
|
-
? "restart dsh web to activate the sidebar badges (one-click restart is unavailable on this host)"
|
|
818
|
-
: "installer patched DSH — restart to activate the sidebar badges"
|
|
819
|
-
},
|
|
820
|
-
"explain"
|
|
821
|
-
),
|
|
822
|
-
canRestart === true
|
|
823
|
-
? react_jsx_runtime.jsx(
|
|
824
|
-
"button",
|
|
825
|
-
{
|
|
826
|
-
onClick: () => void restartNow(),
|
|
827
|
-
style: {
|
|
828
|
-
cursor: "pointer",
|
|
829
|
-
color: "inherit",
|
|
830
|
-
background: "none",
|
|
831
|
-
border: "1px solid var(--dsw-alias-border-secondary, #d0d7de)",
|
|
832
|
-
borderRadius: "4px",
|
|
833
|
-
fontSize: "11px",
|
|
834
|
-
lineHeight: "18px",
|
|
835
|
-
padding: "0 6px",
|
|
836
|
-
flex: "none"
|
|
837
|
-
},
|
|
838
|
-
children: "Restart"
|
|
839
|
-
},
|
|
840
|
-
"btn"
|
|
841
|
-
)
|
|
842
|
-
: null
|
|
843
|
-
]
|
|
844
|
-
},
|
|
845
|
-
"restart"
|
|
846
|
-
);
|
|
847
726
|
const chip = react_jsx_runtime.jsxs("span", {
|
|
848
727
|
style: {
|
|
849
728
|
display: "inline-flex",
|
|
@@ -907,7 +786,6 @@ window.__ModuleLoader__.load({
|
|
|
907
786
|
onBlur: () => setLinkHover(false),
|
|
908
787
|
children: prToken
|
|
909
788
|
}),
|
|
910
|
-
restartNotice
|
|
911
789
|
]
|
|
912
790
|
});
|
|
913
791
|
// No Tooltip primitive (a shell that does not seed it): render the chip
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-git-badge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Git status badges for DeepSeek Harness: an input-row chip on every install, plus sidebar session-row badges (git status, PR/CI action tokens) after one manual step: `npx dsh-git-badge apply`, then restart dsh web. Event-driven freshness over SSE.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|