dsh-hiss-plugins 1.5.1 → 3.0.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/README.md +15 -117
- package/cordis.patch.yml +2 -15
- package/lib/client.js +21 -278
- package/lib/project-mcp/index.js +2 -2
- package/locale/en.json +3 -17
- package/locale/zh.json +3 -17
- package/package.json +13 -23
- package/lib/codegraph/index.js +0 -62
- package/lib/colgrep/index.js +0 -247
- package/lib/lan-access/gateway.js +0 -348
- package/lib/lan-access/index.js +0 -340
- package/lib/lan-access/qr.js +0 -442
package/lib/client.js
CHANGED
|
@@ -28,15 +28,12 @@ window.__ModuleLoader__.load({
|
|
|
28
28
|
* Each row is a top-level Loader row, which is what makes its switch addressable at all.
|
|
29
29
|
*/
|
|
30
30
|
const FEATURES = [
|
|
31
|
-
{ key: "colgrep", moduleName: `${PACKAGE_ID}/colgrep`, description: "featureColgrepDescription" },
|
|
32
|
-
{ key: "codegraph", moduleName: `${PACKAGE_ID}/codegraph`, description: "featureCodegraphDescription" },
|
|
33
31
|
{ key: "project-mcp", moduleName: `${PACKAGE_ID}/project-mcp`, description: "featureProjectMcpDescription" },
|
|
34
32
|
{ key: "gitbash", moduleName: `${PACKAGE_ID}/gitbash`, description: "featureGitbashDescription" },
|
|
35
33
|
{ key: "superpowers", moduleName: `${PACKAGE_ID}/superpowers`, description: "featureSuperpowersDescription" },
|
|
36
34
|
{ key: "ponytail", moduleName: `${PACKAGE_ID}/ponytail`, description: "featurePonytailDescription" },
|
|
37
35
|
{ key: "init", moduleName: `${PACKAGE_ID}/init`, description: "featureInitDescription" },
|
|
38
36
|
{ key: "fix", moduleName: `${PACKAGE_ID}/fix`, description: "featureFixDescription" },
|
|
39
|
-
{ key: "lan-access", moduleName: `${PACKAGE_ID}/lan-access`, description: "featureLanAccessDescription" },
|
|
40
37
|
];
|
|
41
38
|
/** The same features keyed by the name a card shows. */
|
|
42
39
|
const FEATURE_BY_KEY = new Map(FEATURES.map((feature) => [feature.key, feature]));
|
|
@@ -53,16 +50,10 @@ window.__ModuleLoader__.load({
|
|
|
53
50
|
const NOTICE_STYLE = { margin: 0, color: "var(--dsw-alias-label-secondary, var(--dsw-alias-label-tertiary))", fontSize: "13px", lineHeight: "20px" };
|
|
54
51
|
const REASON_STYLE = { color: "var(--dsw-alias-label-tertiary)", fontSize: "12px", lineHeight: "18px", maxWidth: "220px" };
|
|
55
52
|
const BUTTON_STYLE = { border: "0.5px solid var(--dsw-alias-border-l3)", borderRadius: "6px", color: "var(--dsw-alias-label-primary)", font: "inherit", cursor: "pointer", background: "none", padding: "4px 10px" };
|
|
56
|
-
/**
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
/**
|
|
60
|
-
const LAN_OVERLAY_STYLE = { position: "fixed", inset: "0", zIndex: 2147483000, display: "flex", alignItems: "center", justifyContent: "center", background: "rgba(0, 0, 0, 0.45)", pointerEvents: "auto" };
|
|
61
|
-
const LAN_DIALOG_STYLE = { width: "380px", maxWidth: "calc(100vw - 32px)", maxHeight: "calc(100vh - 48px)", overflow: "auto", display: "flex", flexDirection: "column", gap: "12px", padding: "16px", borderRadius: "12px", background: "var(--dsw-alias-bg-primary, #fff)", color: "var(--dsw-alias-label-primary)", boxShadow: "0 18px 48px rgba(0, 0, 0, 0.28)" };
|
|
62
|
-
const LAN_HEADER_STYLE = { display: "flex", alignItems: "center", justifyContent: "space-between", gap: "12px" };
|
|
63
|
-
const LAN_HINT_STYLE = { margin: 0, color: "var(--dsw-alias-label-tertiary)", fontSize: "13px", lineHeight: "20px" };
|
|
64
|
-
const LAN_FRAME_STYLE = { width: "100%", height: "360px", border: "none", borderRadius: "8px", background: "#fff", display: "block" };
|
|
65
|
-
/** The MCP dialog: same shell as the phone popup, one column of servers inside. */
|
|
53
|
+
/** Frame-wide click-catcher for the MCP dialog. */
|
|
54
|
+
const OVERLAY_STYLE = { position: "fixed", inset: "0", zIndex: 2147483000, display: "flex", alignItems: "center", justifyContent: "center", background: "rgba(0, 0, 0, 0.45)", pointerEvents: "auto" };
|
|
55
|
+
const DIALOG_HEADER_STYLE = { display: "flex", alignItems: "center", justifyContent: "space-between", gap: "12px" };
|
|
56
|
+
/** The MCP dialog: overlay, header and one column of servers inside. */
|
|
66
57
|
const MCP_DIALOG_STYLE = { width: "880px", maxWidth: "calc(100vw - 32px)", maxHeight: "calc(100vh - 48px)", overflow: "auto", display: "flex", flexDirection: "column", gap: "14px", padding: "16px", borderRadius: "12px", background: "var(--dsw-alias-bg-primary, #fff)", color: "var(--dsw-alias-label-primary)", boxShadow: "0 18px 48px rgba(0, 0, 0, 0.28)" };
|
|
67
58
|
/** Two columns: global on the left, the workspace on the right. */
|
|
68
59
|
const MCP_COLUMNS_STYLE = { display: "flex", gap: "16px", alignItems: "flex-start" };
|
|
@@ -95,26 +86,12 @@ window.__ModuleLoader__.load({
|
|
|
95
86
|
reasonManagementRequired: "该插件由 DSH 自身管理,无法在这个页面切换。",
|
|
96
87
|
reasonUnaddressable: "无法在 profile 中定位该插件的行,请手动修改 cordis.patch.yml。",
|
|
97
88
|
reasonUnknown: "该插件无法在这个页面切换({code})。",
|
|
98
|
-
featureColgrepDescription: "语义代码检索工具",
|
|
99
|
-
featureCodegraphDescription: "代码图 MCP 工具",
|
|
100
89
|
featureProjectMcpDescription: "按会话挂载项目 .mcp.json",
|
|
101
90
|
featureGitbashDescription: "Windows 上的 Git Bash shell",
|
|
102
91
|
featureSuperpowersDescription: "superpowers 技能常驻引导(任何回复前先检查并加载技能)",
|
|
103
92
|
featurePonytailDescription: "ponytail 采纳提示与 /ponytail 等级切换",
|
|
104
93
|
featureInitDescription: "生成或更新项目 AGENTS.md(/init)",
|
|
105
94
|
featureFixDescription: "先查根因并报告,确认后再修复(/fix)",
|
|
106
|
-
featureLanAccessDescription: "让手机在同一局域网打开本 GUI(/lan 给出带 token 的地址)",
|
|
107
|
-
lanButton: "手机连接",
|
|
108
|
-
lanButtonAria: "用手机通过局域网连接:打开二维码",
|
|
109
|
-
lanTitle: "手机扫码连接",
|
|
110
|
-
lanClose: "关闭",
|
|
111
|
-
lanLoading: "正在开启局域网访问…",
|
|
112
|
-
lanHint: "手机与电脑连同一个网络,用相机扫码打开;打开一次后 30 天内免 token。",
|
|
113
|
-
lanRestart: "已开启局域网访问,但需要重启 DSH 后二维码才可用。",
|
|
114
|
-
lanFailed: "无法开启局域网访问:{error}",
|
|
115
|
-
lanNotInstalled: "这个 profile 里没有 lan-access 行。",
|
|
116
|
-
lanReadOnly: "无法在这个页面启用 lan-access 行({reason})。",
|
|
117
|
-
lanFrameFailed: "二维码页没有响应;请先打开 /lan-access 检查原因。",
|
|
118
95
|
mcpTitle: "MCP 服务器",
|
|
119
96
|
mcpClose: "关闭",
|
|
120
97
|
mcpLoading: "正在读取 MCP 状态…",
|
|
@@ -162,26 +139,12 @@ window.__ModuleLoader__.load({
|
|
|
162
139
|
reasonManagementRequired: "DSH manages this plugin itself, so it cannot be switched from this page.",
|
|
163
140
|
reasonUnaddressable: "This plugin's row cannot be addressed in the profile; edit cordis.patch.yml by hand.",
|
|
164
141
|
reasonUnknown: "This plugin cannot be switched from this page ({code}).",
|
|
165
|
-
featureColgrepDescription: "semantic code search tool",
|
|
166
|
-
featureCodegraphDescription: "CodeGraph MCP tools",
|
|
167
142
|
featureProjectMcpDescription: "mounts the project's .mcp.json per session",
|
|
168
143
|
featureGitbashDescription: "Git Bash shell on Windows",
|
|
169
144
|
featureSuperpowersDescription: "always-on superpowers skill mandate",
|
|
170
145
|
featurePonytailDescription: "ponytail adoption hint and /ponytail level switching",
|
|
171
146
|
featureInitDescription: "generates or updates the project's AGENTS.md (/init)",
|
|
172
147
|
featureFixDescription: "diagnoses the root cause and waits for confirmation before fixing (/fix)",
|
|
173
|
-
featureLanAccessDescription: "opens this GUI from a phone on the same network (/lan prints the tokenized URL)",
|
|
174
|
-
lanButton: "Phone link",
|
|
175
|
-
lanButtonAria: "Connect a phone over the LAN: show the QR code",
|
|
176
|
-
lanTitle: "Scan to connect a phone",
|
|
177
|
-
lanClose: "Close",
|
|
178
|
-
lanLoading: "Enabling LAN access…",
|
|
179
|
-
lanHint: "Keep the phone on the same network and scan with the camera; after one open the token is not needed for 30 days.",
|
|
180
|
-
lanRestart: "LAN access is enabled, but DSH must restart before the QR code is available.",
|
|
181
|
-
lanFailed: "Could not enable LAN access: {error}",
|
|
182
|
-
lanNotInstalled: "This profile has no lan-access row.",
|
|
183
|
-
lanReadOnly: "The lan-access row cannot be enabled from here ({reason}).",
|
|
184
|
-
lanFrameFailed: "The QR page did not answer; open /lan-access to see why.",
|
|
185
148
|
mcpTitle: "MCP servers",
|
|
186
149
|
mcpClose: "Close",
|
|
187
150
|
mcpLoading: "Reading MCP state…",
|
|
@@ -436,179 +399,6 @@ window.__ModuleLoader__.load({
|
|
|
436
399
|
});
|
|
437
400
|
}
|
|
438
401
|
|
|
439
|
-
/**
|
|
440
|
-
* Values apply() hands the two slot components. They live at module scope because the
|
|
441
|
-
* sidebar action and the overlay host are separate slot occupants with no shared props.
|
|
442
|
-
*/
|
|
443
|
-
const lanUi = {
|
|
444
|
-
store: null,
|
|
445
|
-
t: (key) => key,
|
|
446
|
-
ensureEnabled: async () => "enabled",
|
|
447
|
-
probe: async () => ({ ok: false, message: "" }),
|
|
448
|
-
};
|
|
449
|
-
|
|
450
|
-
/**
|
|
451
|
-
* Popup state shared by the sidebar action and its overlay host: the two live in
|
|
452
|
-
* different slots, so neither can own React state for the other.
|
|
453
|
-
* @returns a tiny external store.
|
|
454
|
-
*/
|
|
455
|
-
function createPopupStore() {
|
|
456
|
-
let open = false;
|
|
457
|
-
const listeners = new Set();
|
|
458
|
-
return {
|
|
459
|
-
get: () => open,
|
|
460
|
-
set(value) {
|
|
461
|
-
const next = value === true;
|
|
462
|
-
if (next === open) return;
|
|
463
|
-
open = next;
|
|
464
|
-
for (const listener of [...listeners]) listener();
|
|
465
|
-
},
|
|
466
|
-
listen(listener) {
|
|
467
|
-
listeners.add(listener);
|
|
468
|
-
return () => {
|
|
469
|
-
listeners.delete(listener);
|
|
470
|
-
};
|
|
471
|
-
},
|
|
472
|
-
};
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
/**
|
|
476
|
-
* Subscribe a component to the popup store.
|
|
477
|
-
* @param store - the shared store.
|
|
478
|
-
* @returns whether the popup is open.
|
|
479
|
-
*/
|
|
480
|
-
function usePopupOpen(store) {
|
|
481
|
-
const [open, setOpen] = React.useState(store.get());
|
|
482
|
-
React.useEffect(() => store.listen(() => setOpen(store.get())), []);
|
|
483
|
-
return open;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
/** A phone outline for the sidebar action. */
|
|
487
|
-
function PhoneIcon() {
|
|
488
|
-
return jsx("svg", {
|
|
489
|
-
width: 16,
|
|
490
|
-
height: 16,
|
|
491
|
-
viewBox: "0 0 24 24",
|
|
492
|
-
fill: "none",
|
|
493
|
-
stroke: "currentColor",
|
|
494
|
-
strokeWidth: 1.8,
|
|
495
|
-
strokeLinecap: "round",
|
|
496
|
-
strokeLinejoin: "round",
|
|
497
|
-
"aria-hidden": "true",
|
|
498
|
-
children: [
|
|
499
|
-
jsx("rect", { x: 6, y: 2, width: 12, height: 20, rx: 3, key: "body" }),
|
|
500
|
-
jsx("path", { d: "M11 18h2", key: "home" }),
|
|
501
|
-
],
|
|
502
|
-
});
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
/**
|
|
506
|
-
* The sidebar-foot action that opens the phone-link popup.
|
|
507
|
-
* @param props - `store`, the bound `t`, and the owner's column width state.
|
|
508
|
-
*/
|
|
509
|
-
function LanAccessButton({ wide }) {
|
|
510
|
-
const { store, t } = lanUi;
|
|
511
|
-
const open = usePopupOpen(store);
|
|
512
|
-
return jsx("button", {
|
|
513
|
-
type: "button",
|
|
514
|
-
title: t("lanButton"),
|
|
515
|
-
"aria-label": t("lanButtonAria"),
|
|
516
|
-
"aria-expanded": open,
|
|
517
|
-
style: wide ? LAN_BUTTON_STYLE : { ...LAN_BUTTON_STYLE, ...LAN_RAIL_STYLE },
|
|
518
|
-
onClick: () => store.set(true),
|
|
519
|
-
children: [
|
|
520
|
-
jsx(PhoneIcon, { key: "icon" }),
|
|
521
|
-
wide ? jsx("span", {
|
|
522
|
-
key: "label",
|
|
523
|
-
children: t("lanButton")
|
|
524
|
-
}) : null
|
|
525
|
-
]
|
|
526
|
-
});
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
/**
|
|
530
|
-
* The frame-wide popup: enabling the row, waiting for the page, and showing the QR.
|
|
531
|
-
* @param props - `store`, the bound `t`, `ensureEnabled`, and `probe`.
|
|
532
|
-
*/
|
|
533
|
-
function LanAccessPopup() {
|
|
534
|
-
const { store, t, ensureEnabled, probe } = lanUi;
|
|
535
|
-
const open = usePopupOpen(store);
|
|
536
|
-
const [state, setState] = React.useState({ status: "idle" });
|
|
537
|
-
const [frameHeight, setFrameHeight] = React.useState(360);
|
|
538
|
-
React.useEffect(() => {
|
|
539
|
-
if (!open) return undefined;
|
|
540
|
-
let current = true;
|
|
541
|
-
setState({ status: "loading" });
|
|
542
|
-
Promise.resolve().then(ensureEnabled).then((outcome) => {
|
|
543
|
-
if (!current) return undefined;
|
|
544
|
-
if (outcome === "restart-required") {
|
|
545
|
-
setState({ status: "restart" });
|
|
546
|
-
return undefined;
|
|
547
|
-
}
|
|
548
|
-
return probe().then((answer) => {
|
|
549
|
-
if (!current) return;
|
|
550
|
-
setState(answer.ok ? { status: "ready", src: answer.url } : { status: "error", message: answer.message });
|
|
551
|
-
});
|
|
552
|
-
}).catch((error) => {
|
|
553
|
-
if (current) setState({ status: "error", message: messageOf(error) });
|
|
554
|
-
});
|
|
555
|
-
return () => {
|
|
556
|
-
current = false;
|
|
557
|
-
};
|
|
558
|
-
}, [open, ensureEnabled, probe]);
|
|
559
|
-
React.useEffect(() => {
|
|
560
|
-
if (!open) return undefined;
|
|
561
|
-
const onKey = (event) => {
|
|
562
|
-
if (event.key === "Escape") store.set(false);
|
|
563
|
-
};
|
|
564
|
-
globalThis.window?.addEventListener?.("keydown", onKey);
|
|
565
|
-
return () => globalThis.window?.removeEventListener?.("keydown", onKey);
|
|
566
|
-
}, [open, store]);
|
|
567
|
-
if (!open) return null;
|
|
568
|
-
return jsx("div", {
|
|
569
|
-
role: "presentation",
|
|
570
|
-
style: LAN_OVERLAY_STYLE,
|
|
571
|
-
onClick: () => store.set(false),
|
|
572
|
-
children: jsxs("div", {
|
|
573
|
-
role: "dialog",
|
|
574
|
-
"aria-modal": "true",
|
|
575
|
-
"aria-label": t("lanTitle"),
|
|
576
|
-
style: LAN_DIALOG_STYLE,
|
|
577
|
-
onClick: (event) => event.stopPropagation(),
|
|
578
|
-
children: [
|
|
579
|
-
jsxs("div", {
|
|
580
|
-
style: LAN_HEADER_STYLE,
|
|
581
|
-
children: [jsx("strong", { children: t("lanTitle") }), jsx("button", {
|
|
582
|
-
type: "button",
|
|
583
|
-
style: BUTTON_STYLE,
|
|
584
|
-
onClick: () => store.set(false),
|
|
585
|
-
children: t("lanClose")
|
|
586
|
-
})]
|
|
587
|
-
}),
|
|
588
|
-
state.status === "loading" ? jsx("p", { role: "status", style: LAN_HINT_STYLE, children: t("lanLoading") }) : null,
|
|
589
|
-
state.status === "restart" ? jsx("p", { role: "alert", style: LAN_HINT_STYLE, children: t("lanRestart") }) : null,
|
|
590
|
-
state.status === "error" ? jsx("p", { role: "alert", style: LAN_HINT_STYLE, children: t("lanFailed", { error: state.message }) }) : null,
|
|
591
|
-
state.status === "ready" ? jsx("iframe", {
|
|
592
|
-
title: t("lanTitle"),
|
|
593
|
-
src: state.src,
|
|
594
|
-
style: { ...LAN_FRAME_STYLE, height: `${String(frameHeight)}px` },
|
|
595
|
-
onLoad: (event) => {
|
|
596
|
-
// Same origin, so the document height is readable: the frame is cut
|
|
597
|
-
// to its content and the dialog never grows a second scrollbar.
|
|
598
|
-
try {
|
|
599
|
-
const measured = event?.currentTarget?.contentDocument?.documentElement?.scrollHeight;
|
|
600
|
-
if (typeof measured === "number" && measured > 0) setFrameHeight(Math.max(240, Math.min(measured + 2, 560)));
|
|
601
|
-
} catch {
|
|
602
|
-
// A cross-origin document keeps the default height.
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
}) : null,
|
|
606
|
-
jsx("p", { style: LAN_HINT_STYLE, children: t("lanHint") })
|
|
607
|
-
]
|
|
608
|
-
})
|
|
609
|
-
});
|
|
610
|
-
}
|
|
611
|
-
|
|
612
402
|
/** Values the `/mcp` dialog needs from apply(): its store, the bound lookup and the host call. */
|
|
613
403
|
const mcpUi = {
|
|
614
404
|
store: null,
|
|
@@ -800,7 +590,7 @@ window.__ModuleLoader__.load({
|
|
|
800
590
|
] });
|
|
801
591
|
return jsx("div", {
|
|
802
592
|
role: "presentation",
|
|
803
|
-
style:
|
|
593
|
+
style: OVERLAY_STYLE,
|
|
804
594
|
onClick: () => store.close(),
|
|
805
595
|
children: jsxs("div", {
|
|
806
596
|
role: "dialog",
|
|
@@ -809,7 +599,7 @@ window.__ModuleLoader__.load({
|
|
|
809
599
|
style: MCP_DIALOG_STYLE,
|
|
810
600
|
onClick: (event) => event.stopPropagation(),
|
|
811
601
|
children: [
|
|
812
|
-
jsxs("div", { style:
|
|
602
|
+
jsxs("div", { style: DIALOG_HEADER_STYLE, children: [
|
|
813
603
|
jsx("strong", { children: t("mcpTitle") }),
|
|
814
604
|
jsxs("span", { style: MCP_ACTIONS_STYLE, children: [
|
|
815
605
|
jsx("button", { type: "button", style: BUTTON_STYLE, "aria-label": t("mcpRefresh"), onClick: () => run({ action: "status" }), children: t("mcpRefresh") }),
|
|
@@ -854,10 +644,10 @@ window.__ModuleLoader__.load({
|
|
|
854
644
|
});
|
|
855
645
|
}
|
|
856
646
|
|
|
857
|
-
/**
|
|
858
|
-
const
|
|
647
|
+
/** The host command whose run this browser half projects into the chat view. */
|
|
648
|
+
const PROJECTED_COMMAND = "mcp";
|
|
859
649
|
/**
|
|
860
|
-
* Chat node kind of the `/mcp`
|
|
650
|
+
* Chat node kind of the `/mcp` projection.
|
|
861
651
|
*
|
|
862
652
|
* DSH hides the whole transcript while a session has no turn (the chat view counts only
|
|
863
653
|
* non-command nodes as activity, and only a turn clears the session's blank flag), so in a
|
|
@@ -869,17 +659,20 @@ window.__ModuleLoader__.load({
|
|
|
869
659
|
const MCP_NODE_KIND = "hiss-mcp-command";
|
|
870
660
|
|
|
871
661
|
/**
|
|
872
|
-
* Project one `/mcp`
|
|
662
|
+
* Project one `/mcp` run as an empty chat node.
|
|
873
663
|
* Only `command/run` is claimed: `command/done` still renders through the generic command card,
|
|
874
664
|
* and every other command is untouched.
|
|
875
665
|
*/
|
|
876
666
|
const mcpCommandDefinition = {
|
|
877
667
|
kind: MCP_NODE_KIND,
|
|
878
668
|
target: "chat",
|
|
879
|
-
match: (event) => event.type === "command/run" &&
|
|
669
|
+
match: (event) => event.type === "command/run" && event.data.name === PROJECTED_COMMAND
|
|
880
670
|
? { id: String(event.data.commandId), role: "start" }
|
|
881
671
|
: null,
|
|
882
672
|
start: (_context, match) => ({ seq: match.event.seq, commandId: match.event.data.commandId }),
|
|
673
|
+
// The contract requires update; each run's commandId is its own context, so later
|
|
674
|
+
// matches never arrive — keep the state unchanged if the harness ever sends one.
|
|
675
|
+
update: (context) => context.state,
|
|
883
676
|
buildViewNode: (context) => ({
|
|
884
677
|
key: context.key,
|
|
885
678
|
kind: MCP_NODE_KIND,
|
|
@@ -944,37 +737,6 @@ window.__ModuleLoader__.load({
|
|
|
944
737
|
if (result.application === "failed") throw refusalError(t, result.error?.code, result.error?.diagnostic);
|
|
945
738
|
return result.application;
|
|
946
739
|
};
|
|
947
|
-
lanUi.store = createPopupStore();
|
|
948
|
-
/**
|
|
949
|
-
* Turn the lan-access row on so the popup has something to show.
|
|
950
|
-
* @returns "enabled" when the listener is being mounted now, "restart-required" when only a restart lands it.
|
|
951
|
-
*/
|
|
952
|
-
const ensureLanEnabled = async () => {
|
|
953
|
-
const rows = await list();
|
|
954
|
-
const row = rows.find((candidate) => candidate.key === "lan-access");
|
|
955
|
-
if (row === undefined) throw new Error(t("lanNotInstalled"));
|
|
956
|
-
if (row.enabled) return "enabled";
|
|
957
|
-
if (!row.toggleable) throw new Error(t("lanReadOnly", { reason: row.reason ?? "unknown" }));
|
|
958
|
-
return (await setEnabled(row.entryId, true)) === "restart-required" ? "restart-required" : "enabled";
|
|
959
|
-
};
|
|
960
|
-
/**
|
|
961
|
-
* Wait for the host's QR page: a just-enabled row registers its route asynchronously.
|
|
962
|
-
* @returns whether the page answers, and the frame URL.
|
|
963
|
-
*/
|
|
964
|
-
const probeLanPage = async () => {
|
|
965
|
-
const url = "/lan-access?embed=1";
|
|
966
|
-
for (let attempt = 0; attempt < 12; attempt += 1) {
|
|
967
|
-
try {
|
|
968
|
-
const response = await fetch(url, { method: "HEAD", cache: "no-store" });
|
|
969
|
-
if (response.ok) return { ok: true, url };
|
|
970
|
-
if (response.status === 401 || response.status === 403) break;
|
|
971
|
-
} catch {
|
|
972
|
-
// The route does not exist yet (404) or the browser is briefly offline.
|
|
973
|
-
}
|
|
974
|
-
await new Promise((resolve) => setTimeout(resolve, 250));
|
|
975
|
-
}
|
|
976
|
-
return { ok: false, message: t("lanFrameFailed", { url: "/lan-access" }) };
|
|
977
|
-
};
|
|
978
740
|
ctx.slots.inject("plugins.tab", () => ctx.slots.register({
|
|
979
741
|
name: "plugins.tab",
|
|
980
742
|
id: "dsh-hiss-plugins",
|
|
@@ -988,9 +750,6 @@ window.__ModuleLoader__.load({
|
|
|
988
750
|
features: FEATURES.map((feature) => feature.key)
|
|
989
751
|
})
|
|
990
752
|
}, HissPluginsTab));
|
|
991
|
-
lanUi.t = t;
|
|
992
|
-
lanUi.ensureEnabled = ensureLanEnabled;
|
|
993
|
-
lanUi.probe = probeLanPage;
|
|
994
753
|
mcpUi.store = createDialogStore();
|
|
995
754
|
mcpUi.t = t;
|
|
996
755
|
/**
|
|
@@ -1016,7 +775,7 @@ window.__ModuleLoader__.load({
|
|
|
1016
775
|
};
|
|
1017
776
|
// The dialog replaces the chat text report a bare /mcp used to log; an argued
|
|
1018
777
|
// /mcp still reaches the host command, which answers with its usage line.
|
|
1019
|
-
// Optional: a host without the command surface keeps the tab
|
|
778
|
+
// Optional: a host without the command surface keeps the tab.
|
|
1020
779
|
if (typeof ctx.inject === "function") ctx.inject(["commandUi"], (uiCtx) => uiCtx.commandUi.decorate({
|
|
1021
780
|
name: "mcp",
|
|
1022
781
|
available: () => true,
|
|
@@ -1027,32 +786,16 @@ window.__ModuleLoader__.load({
|
|
|
1027
786
|
},
|
|
1028
787
|
},
|
|
1029
788
|
}));
|
|
1030
|
-
ctx.slots.inject("
|
|
1031
|
-
name: "
|
|
1032
|
-
id: "
|
|
1033
|
-
order:
|
|
789
|
+
ctx.slots.inject("shell.overlay", () => ctx.slots.register({
|
|
790
|
+
name: "shell.overlay",
|
|
791
|
+
id: "mcp.dialog",
|
|
792
|
+
order: 901,
|
|
1034
793
|
locale: NS,
|
|
1035
|
-
|
|
1036
|
-
}, LanAccessButton));
|
|
1037
|
-
ctx.slots.inject("shell.overlay", () => {
|
|
1038
|
-
const popup = ctx.slots.register({
|
|
1039
|
-
name: "shell.overlay",
|
|
1040
|
-
id: "lan-access.popup",
|
|
1041
|
-
order: 900,
|
|
1042
|
-
locale: NS,
|
|
1043
|
-
}, LanAccessPopup);
|
|
1044
|
-
ctx.slots.register({
|
|
1045
|
-
name: "shell.overlay",
|
|
1046
|
-
id: "mcp.dialog",
|
|
1047
|
-
order: 901,
|
|
1048
|
-
locale: NS,
|
|
1049
|
-
}, McpDialog);
|
|
1050
|
-
return popup;
|
|
1051
|
-
});
|
|
794
|
+
}, McpDialog));
|
|
1052
795
|
}
|
|
1053
796
|
|
|
1054
797
|
exports.apply = apply;
|
|
1055
798
|
exports.inject = inject;
|
|
1056
799
|
return module.exports;
|
|
1057
800
|
},
|
|
1058
|
-
});
|
|
801
|
+
});
|
package/lib/project-mcp/index.js
CHANGED
|
@@ -56,7 +56,7 @@ function switchesOf(state, cwd) {
|
|
|
56
56
|
|
|
57
57
|
/** The public tool names a scope sees, or the global view when no scope is given. */
|
|
58
58
|
function toolNamesOf(ctx, scope) {
|
|
59
|
-
return ctx.tools.
|
|
59
|
+
return ctx.tools.getAll(scope).map((tool) => tool.name);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/**
|
|
@@ -565,4 +565,4 @@ export function apply(ctx) {
|
|
|
565
565
|
// A reload mid-session must reach agents that are already live.
|
|
566
566
|
for (const agent of ctx.agents.list()) void wire(agent);
|
|
567
567
|
registerStatusCommand(ctx);
|
|
568
|
-
}
|
|
568
|
+
}
|
package/locale/en.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "dsh-hiss-plugins",
|
|
4
|
-
"description": "One DeepSeek Harness bundle carrying
|
|
4
|
+
"description": "One DeepSeek Harness bundle carrying six switchable plugins — project-mcp, git-bash, superpowers, ponytail, init and fix — managed from a tab in the Plugins page."
|
|
5
5
|
},
|
|
6
6
|
"loading": "Reading plugins…",
|
|
7
7
|
"error": "Plugins are unavailable: {error}",
|
|
@@ -15,26 +15,12 @@
|
|
|
15
15
|
"reasonManagementRequired": "DSH manages this plugin itself, so it cannot be switched from this page.",
|
|
16
16
|
"reasonUnaddressable": "This plugin's row cannot be addressed in the profile; edit cordis.patch.yml by hand.",
|
|
17
17
|
"reasonUnknown": "This plugin cannot be switched from this page ({code}).",
|
|
18
|
-
|
|
19
|
-
"featureCodegraphDescription": "CodeGraph MCP tools",
|
|
20
|
-
"featureProjectMcpDescription": "mounts the project's .mcp.json per session",
|
|
18
|
+
"featureProjectMcpDescription": "mounts the project's .mcp.json per session",
|
|
21
19
|
"featureGitbashDescription": "Git Bash shell on Windows",
|
|
22
20
|
"featureSuperpowersDescription": "always-on superpowers skill mandate",
|
|
23
21
|
"featurePonytailDescription": "ponytail adoption hint and /ponytail level switching",
|
|
24
22
|
"featureInitDescription": "generates or updates the project's AGENTS.md (/init)",
|
|
25
23
|
"featureFixDescription": "diagnoses the root cause and waits for confirmation before fixing (/fix)",
|
|
26
|
-
"featureLanAccessDescription": "opens this GUI from a phone on the same network (/lan prints the tokenized URL)",
|
|
27
|
-
"lanButton": "Phone link",
|
|
28
|
-
"lanButtonAria": "Connect a phone over the LAN: show the QR code",
|
|
29
|
-
"lanTitle": "Scan to connect a phone",
|
|
30
|
-
"lanClose": "Close",
|
|
31
|
-
"lanLoading": "Enabling LAN access…",
|
|
32
|
-
"lanHint": "Keep the phone on the same network and scan with the camera; after one open the token is not needed for 30 days.",
|
|
33
|
-
"lanRestart": "LAN access is enabled, but DSH must restart before the QR code is available.",
|
|
34
|
-
"lanFailed": "Could not enable LAN access: {error}",
|
|
35
|
-
"lanNotInstalled": "This profile has no lan-access row.",
|
|
36
|
-
"lanReadOnly": "The lan-access row cannot be enabled from here ({reason}).",
|
|
37
|
-
"lanFrameFailed": "The QR page did not answer; open /lan-access to see why.",
|
|
38
24
|
"mcpTitle": "MCP servers",
|
|
39
25
|
"mcpClose": "Close",
|
|
40
26
|
"mcpLoading": "Reading MCP state…",
|
|
@@ -67,4 +53,4 @@
|
|
|
67
53
|
"mcpCollapse": "Collapse",
|
|
68
54
|
"mcpExpandAria": "Expand the tools of {name}",
|
|
69
55
|
"mcpCollapseAria": "Collapse the tools of {name}"
|
|
70
|
-
}
|
|
56
|
+
}
|
package/locale/zh.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"meta": {
|
|
3
3
|
"title": "dsh-hiss-plugins",
|
|
4
|
-
"description": "一个 DeepSeek Harness 组合包,携带
|
|
4
|
+
"description": "一个 DeepSeek Harness 组合包,携带 project-mcp、git-bash、superpowers、ponytail、init、fix 六个可独立开关的插件,并在插件页提供管理标签。"
|
|
5
5
|
},
|
|
6
6
|
"loading": "正在读取插件…",
|
|
7
7
|
"error": "暂时无法读取插件:{error}",
|
|
@@ -15,26 +15,12 @@
|
|
|
15
15
|
"reasonManagementRequired": "该插件由 DSH 自身管理,无法在这个页面切换。",
|
|
16
16
|
"reasonUnaddressable": "无法在 profile 中定位该插件的行,请手动修改 cordis.patch.yml。",
|
|
17
17
|
"reasonUnknown": "该插件无法在这个页面切换({code})。",
|
|
18
|
-
|
|
19
|
-
"featureCodegraphDescription": "代码图 MCP 工具",
|
|
20
|
-
"featureProjectMcpDescription": "按会话挂载项目 .mcp.json",
|
|
18
|
+
"featureProjectMcpDescription": "按会话挂载项目 .mcp.json",
|
|
21
19
|
"featureGitbashDescription": "Windows 上的 Git Bash shell",
|
|
22
20
|
"featureSuperpowersDescription": "superpowers 技能常驻引导(任何回复前先检查并加载技能)",
|
|
23
21
|
"featurePonytailDescription": "ponytail 采纳提示与 /ponytail 等级切换",
|
|
24
22
|
"featureInitDescription": "生成或更新项目 AGENTS.md(/init)",
|
|
25
23
|
"featureFixDescription": "先查根因并报告,确认后再修复(/fix)",
|
|
26
|
-
"featureLanAccessDescription": "让手机在同一局域网打开本 GUI(/lan 给出带 token 的地址)",
|
|
27
|
-
"lanButton": "手机连接",
|
|
28
|
-
"lanButtonAria": "用手机通过局域网连接:打开二维码",
|
|
29
|
-
"lanTitle": "手机扫码连接",
|
|
30
|
-
"lanClose": "关闭",
|
|
31
|
-
"lanLoading": "正在开启局域网访问…",
|
|
32
|
-
"lanHint": "手机与电脑连同一个网络,用相机扫码打开;打开一次后 30 天内免 token。",
|
|
33
|
-
"lanRestart": "已开启局域网访问,但需要重启 DSH 后二维码才可用。",
|
|
34
|
-
"lanFailed": "无法开启局域网访问:{error}",
|
|
35
|
-
"lanNotInstalled": "这个 profile 里没有 lan-access 行。",
|
|
36
|
-
"lanReadOnly": "无法在这个页面启用 lan-access 行({reason})。",
|
|
37
|
-
"lanFrameFailed": "二维码页没有响应;请先打开 /lan-access 检查原因。",
|
|
38
24
|
"mcpTitle": "MCP 服务器",
|
|
39
25
|
"mcpClose": "关闭",
|
|
40
26
|
"mcpLoading": "正在读取 MCP 状态…",
|
|
@@ -67,4 +53,4 @@
|
|
|
67
53
|
"mcpCollapse": "收起",
|
|
68
54
|
"mcpExpandAria": "展开 {name} 的工具",
|
|
69
55
|
"mcpCollapseAria": "收起 {name} 的工具"
|
|
70
|
-
}
|
|
56
|
+
}
|
package/package.json
CHANGED
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-hiss-plugins",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "dsh-hiss-plugins — one DeepSeek Harness bundle carrying
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "dsh-hiss-plugins — one DeepSeek Harness bundle carrying six independently switchable plugins (project-mcp, git-bash, superpowers, ponytail, init, fix) plus a management tab in the Plugins page.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dsh",
|
|
7
7
|
"deepseek-harness",
|
|
8
8
|
"dsh-plugin",
|
|
9
|
-
"colgrep",
|
|
10
|
-
"codegraph",
|
|
11
9
|
"mcp",
|
|
12
10
|
"git-bash",
|
|
13
|
-
"semantic-search",
|
|
14
11
|
"superpowers",
|
|
15
12
|
"ponytail",
|
|
16
13
|
"agents-md",
|
|
17
14
|
"init",
|
|
18
|
-
"fix"
|
|
19
|
-
"lan",
|
|
20
|
-
"mobile"
|
|
15
|
+
"fix"
|
|
21
16
|
],
|
|
22
17
|
"license": "MIT",
|
|
23
18
|
"author": {
|
|
@@ -36,15 +31,12 @@
|
|
|
36
31
|
"main": "./lib/index.js",
|
|
37
32
|
"exports": {
|
|
38
33
|
".": "./lib/index.js",
|
|
39
|
-
"./colgrep": "./lib/colgrep/index.js",
|
|
40
|
-
"./codegraph": "./lib/codegraph/index.js",
|
|
41
34
|
"./project-mcp": "./lib/project-mcp/index.js",
|
|
42
35
|
"./gitbash": "./lib/gitbash/index.js",
|
|
43
36
|
"./superpowers": "./lib/superpowers/index.js",
|
|
44
37
|
"./ponytail": "./lib/ponytail/index.js",
|
|
45
38
|
"./init": "./lib/init/index.js",
|
|
46
39
|
"./fix": "./lib/fix/index.js",
|
|
47
|
-
"./lan-access": "./lib/lan-access/index.js",
|
|
48
40
|
"./client": "./lib/client.js",
|
|
49
41
|
"./locale/*.json": "./locale/*.json",
|
|
50
42
|
"./package.json": "./package.json"
|
|
@@ -57,20 +49,18 @@
|
|
|
57
49
|
"LICENSE"
|
|
58
50
|
],
|
|
59
51
|
"peerDependencies": {
|
|
60
|
-
"@deepseek-ai/dsh-bash-sandbox": "^0.2.
|
|
61
|
-
"@deepseek-ai/dsh-llm": "^0.2.
|
|
62
|
-
"@deepseek-ai/dsh-mcp-client": "^0.2.
|
|
63
|
-
"@deepseek-ai/dsh-skill": "^0.2.
|
|
64
|
-
"@deepseek-ai/dsh-tool-bash": "^0.2.
|
|
65
|
-
"@deepseek-ai/dsh-tools": "^0.2.1-alpha.4"
|
|
52
|
+
"@deepseek-ai/dsh-bash-sandbox": "^0.2.3-alpha.3",
|
|
53
|
+
"@deepseek-ai/dsh-llm": "^0.2.3-alpha.3",
|
|
54
|
+
"@deepseek-ai/dsh-mcp-client": "^0.2.3-alpha.3",
|
|
55
|
+
"@deepseek-ai/dsh-skill": "^0.2.3-alpha.3",
|
|
56
|
+
"@deepseek-ai/dsh-tool-bash": "^0.2.3-alpha.3"
|
|
66
57
|
},
|
|
67
58
|
"devDependencies": {
|
|
68
|
-
"@deepseek-ai/dsh-bash-sandbox": "0.2.
|
|
69
|
-
"@deepseek-ai/dsh-llm": "0.2.
|
|
70
|
-
"@deepseek-ai/dsh-mcp-client": "0.2.
|
|
71
|
-
"@deepseek-ai/dsh-skill": "0.2.
|
|
72
|
-
"@deepseek-ai/dsh-tool-bash": "0.2.
|
|
73
|
-
"@deepseek-ai/dsh-tools": "0.2.1-alpha.4"
|
|
59
|
+
"@deepseek-ai/dsh-bash-sandbox": "0.2.3-alpha.3",
|
|
60
|
+
"@deepseek-ai/dsh-llm": "0.2.3-alpha.3",
|
|
61
|
+
"@deepseek-ai/dsh-mcp-client": "0.2.3-alpha.3",
|
|
62
|
+
"@deepseek-ai/dsh-skill": "0.2.3-alpha.3",
|
|
63
|
+
"@deepseek-ai/dsh-tool-bash": "0.2.3-alpha.3"
|
|
74
64
|
},
|
|
75
65
|
"dsh": {
|
|
76
66
|
"bundle": {
|
package/lib/codegraph/index.js
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { existsSync } from "node:fs";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
import { apply as mcpClientApply, inject as mcpClientInject } from "@deepseek-ai/dsh-mcp-client";
|
|
4
|
-
|
|
5
|
-
export const name = "codegraph";
|
|
6
|
-
export const inject = ["systemPrompt"];
|
|
7
|
-
|
|
8
|
-
const GUIDANCE = [
|
|
9
|
-
"CodeGraph (semantic code intelligence) is available through the `mcp__codegraph__codegraph_explore` tool. ",
|
|
10
|
-
"For structural questions about the codebase — how a component works, how X reaches Y, the blast radius of a change — ",
|
|
11
|
-
"call `mcp__codegraph__codegraph_explore` directly instead of grepping or reading files one by one; ",
|
|
12
|
-
"it returns the relevant symbols' source, call paths, and impact in one call. ",
|
|
13
|
-
"Always pass `projectPath` as the workspace directory you are working in (or a subdirectory that has a `.codegraph/` index). ",
|
|
14
|
-
"If the tool reports no index, tell the user to run `codegraph init` in that project first. ",
|
|
15
|
-
"If the `mcp__codegraph__*` tool is not listed, the codegraph CLI is not installed or failed to start — check the DSH host logs.",
|
|
16
|
-
].join("");
|
|
17
|
-
|
|
18
|
-
// This workspace has no index. The MCP server exposes only `codegraph_explore`,
|
|
19
|
-
// so nothing can build the index but the agent itself.
|
|
20
|
-
const MISSING_INDEX = " This workspace has no index yet — run `codegraph init -y` here once before exploring, then retry.";
|
|
21
|
-
|
|
22
|
-
export function guidanceFor(cwd) {
|
|
23
|
-
const hint = cwd && !existsSync(join(cwd, ".codegraph")) ? MISSING_INDEX : "";
|
|
24
|
-
return `${GUIDANCE} Current workspace: ${cwd}; pass it as \`projectPath\`.${hint}`;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Stdio config for the CodeGraph MCP server. `command` resolves `codegraph`
|
|
29
|
-
* from the DSH host process's PATH (installed globally), and `cwd` is only the
|
|
30
|
-
* server's default project — the model always passes `projectPath` to target
|
|
31
|
-
* the actual workspace.
|
|
32
|
-
*
|
|
33
|
-
* @param {string} [cwd] default project directory for the spawned server.
|
|
34
|
-
* @returns {import("@deepseek-ai/dsh-mcp-client").StdioConfig}
|
|
35
|
-
*/
|
|
36
|
-
export function codegraphConfig(cwd = process.cwd()) {
|
|
37
|
-
return {
|
|
38
|
-
transport: "stdio",
|
|
39
|
-
serverName: "codegraph",
|
|
40
|
-
command: "codegraph",
|
|
41
|
-
args: ["serve", "--mcp"],
|
|
42
|
-
env: {},
|
|
43
|
-
cwd,
|
|
44
|
-
toolCallTimeoutMs: 120000,
|
|
45
|
-
failOnStartupError: false,
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* DSH plugin entry point. Loads the DSH MCP client bridge for the CodeGraph
|
|
51
|
-
* server (registering `mcp__codegraph__*` tools globally) and injects usage
|
|
52
|
-
* guidance whose text carries the current session's workspace path, so agents
|
|
53
|
-
* prefer it and pass the right `projectPath`.
|
|
54
|
-
*/
|
|
55
|
-
export function apply(ctx) {
|
|
56
|
-
ctx.plugin({ inject: mcpClientInject, apply: mcpClientApply }, codegraphConfig());
|
|
57
|
-
ctx.systemPrompt.section({
|
|
58
|
-
name: "codegraph:guidance",
|
|
59
|
-
order: 100,
|
|
60
|
-
text: (context) => guidanceFor(context.scope?.session?.header?.cwd ?? process.cwd()),
|
|
61
|
-
});
|
|
62
|
-
}
|