dsh-science-plugin 0.14.0 → 0.14.3
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 +37 -9
- package/agents/_README.md +5 -5
- package/agents/figure-expert.md +35 -35
- package/agents/presentation.md +78 -78
- package/agents/simulator.md +30 -30
- package/agents/topic-designer.md +26 -26
- package/agents/trainer.md +36 -36
- package/client/client.js +154 -177
- package/client/client.js.map +2 -2
- package/cordis.patch.yml +11 -12
- package/lib/action-cards.js +7 -4
- package/lib/db.js +386 -386
- package/lib/httpdata-auth.js +12 -21
- package/lib/httpdata.js +41 -45
- package/lib/index.js +3 -2
- package/lib/project-experts.js +94 -0
- package/lib/router.js +1 -1
- package/lib/skillmenu.js +87 -52
- package/lib/ssh.js +66 -20
- package/lib/store.js +50 -50
- package/lib/team.js +19 -11
- package/package.json +74 -71
- package/skills/sci-autoresearch/SKILL.md +41 -41
- package/skills/sci-hypothesis/SKILL.md +31 -31
- package/skills/sci-polish/SKILL.md +28 -28
- package/skills/sci-slides/SKILL.md +73 -73
- package/skills/sci-writing/SKILL.md +33 -33
- package/docs/DEVLOG.md +0 -864
- package/docs/SPEC.md +0 -452
- package/docs/research/2026-11-12-academic-figure-skill-/350/257/204/344/274/260.md +0 -33
- package/docs/research/2026-11-12-/347/247/221/347/240/224/347/273/230/345/233/276/345/274/200/346/272/220/346/226/271/346/241/210/350/260/203/347/240/224.md +0 -52
- package/docs/research/2026-11-13-/345/257/271/350/257/235/351/251/261/345/212/250/347/247/221/347/240/224/345/267/245/344/275/234/345/217/260/344/272/247/345/223/201/347/255/226/347/225/245/350/260/203/347/240/224.md +0 -319
- package/docs/research/2026-11-13-/350/267/257/347/272/277B/346/212/200/346/234/257/345/217/257/350/241/214/346/200/247/344/270/216/344/275/216/347/274/272/351/231/267/350/256/276/350/256/241/350/260/203/347/240/224.md +0 -65
- package/docs/superpowers/specs/2026-11-12-/347/247/221/347/240/224/345/267/245/344/275/234/345/217/260/351/207/215/346/236/204/350/256/276/350/256/241.md +0 -364
- package/docs/superpowers/specs/2026-11-13-/345/257/271/350/257/235/344/274/230/345/205/210/347/247/221/347/240/224/345/215/241/347/211/207/345/267/245/344/275/234/345/217/260/351/207/215/346/236/204/350/256/276/350/256/241.md +0 -607
package/client/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
window.__ModuleLoader__.load({ id: "dsh-science", factory: (require) => {
|
|
1
|
+
window.__ModuleLoader__.load({ id: "dsh-science-plugin", factory: (require) => {
|
|
2
2
|
var module = { exports: {} };
|
|
3
3
|
var exports = module.exports;
|
|
4
4
|
var __create = Object.create;
|
|
@@ -204,6 +204,7 @@ function WorkspaceOverview({ view, raw, busy, onAction, onNavigate, onOpenConver
|
|
|
204
204
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { "aria-hidden": "true", children: "\u2197" })
|
|
205
205
|
] }),
|
|
206
206
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Button, { disabled: busy, onClick: () => onAction(hasProject ? "literature" : "import_results"), children: hasProject ? "\u63A2\u7D22\u6587\u732E" : "\u6574\u7406\u5DF2\u6709\u7ED3\u679C" }),
|
|
207
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Button, { onClick: () => onNavigate("experts"), children: "\u914D\u7F6E\u9879\u76EE\u4E13\u5BB6" }),
|
|
207
208
|
onOpenCatalog && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Button, { disabled: busy, onClick: onOpenCatalog, children: "\u67E5\u770B\u5168\u90E8\u9879\u76EE" })
|
|
208
209
|
] })
|
|
209
210
|
] }),
|
|
@@ -334,6 +335,8 @@ var RESEARCH_DESK_CSS = `
|
|
|
334
335
|
@media(hover:hover){.sci-desk-tile:hover{transform:translateY(-2px);box-shadow:0 8px 20px #0000000e}}
|
|
335
336
|
@media(max-width:760px){.sci-desk-hero[data-active=true]{grid-template-columns:1fr}}
|
|
336
337
|
@media(prefers-reduced-motion:reduce){.sci-desk .sci-desk-scene,.sci-desk .sci-button,.sci-desk .sci-desk-tile{animation:none;transition:none;transform:none}}
|
|
338
|
+
|
|
339
|
+
.sci-project-experts{max-width:960px;margin:auto}.sci-expert-form,.sci-expert-row,.sci-expert-presets{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:10px 0}.sci-expert-row{justify-content:space-between;overflow-wrap:anywhere}.sci-expert-form input,.sci-expert-form select{padding:7px 9px;max-width:100%;color:inherit;background:var(--sci-card);border:1px solid var(--sci-border);border-radius:6px}.sci-expert-form input{flex:1;min-width:12em}.sci-expert-presets button{display:grid;text-align:left}.sci-expert-presets small{font-size:.8em;font-weight:400}
|
|
337
340
|
`;
|
|
338
341
|
|
|
339
342
|
// client-src/workbench/PaperSpinePage.jsx
|
|
@@ -915,182 +918,144 @@ function ArtifactsPage({ view, onAction }) {
|
|
|
915
918
|
// client-src/workbench/ExpertSetupPage.jsx
|
|
916
919
|
var import_react7 = __toESM(require("react"), 1);
|
|
917
920
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
}
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
921
|
+
async function request(binding, payload, signal) {
|
|
922
|
+
const response = await fetch("/plugins/dsh-science/skill-manage", {
|
|
923
|
+
method: "POST",
|
|
924
|
+
credentials: "same-origin",
|
|
925
|
+
signal,
|
|
926
|
+
headers: { "content-type": "application/json" },
|
|
927
|
+
body: JSON.stringify({ sessionId: binding.sessionId, expectedProjectId: binding.projectId, ...payload })
|
|
928
|
+
});
|
|
929
|
+
const data = await response.json();
|
|
930
|
+
if (!response.ok) throw new Error(data.error || "\u65E0\u6CD5\u8BFB\u53D6\u9879\u76EE\u4E13\u5BB6");
|
|
931
|
+
return data;
|
|
932
|
+
}
|
|
933
|
+
function Expert({ role: role2, data, act, busy, openManager }) {
|
|
934
|
+
const [kind, setKind] = (0, import_react7.useState)("global");
|
|
935
|
+
const [value, setValue] = (0, import_react7.useState)("");
|
|
936
|
+
const links = data.config.links[role2] || [];
|
|
937
|
+
const local = data.installed[role2] || [];
|
|
938
|
+
const options = kind === "global" ? data.global.map((s) => s.name) : data.legacy[role2] || [];
|
|
939
|
+
const typeLabel = { global: "\u5168\u5C40 Skill", legacy: "\u65E7\u7248\u6280\u80FD", local: "\u9879\u76EE Skill", plugin: "DSH \u63D2\u4EF6" };
|
|
940
|
+
const choose = kind === "global" || kind === "legacy";
|
|
941
|
+
const submit = async (event) => {
|
|
942
|
+
event.preventDefault();
|
|
943
|
+
const ok = await act(kind === "local" ? { action: "install", role: role2, repoUrl: value.trim() } : { action: "link", role: role2, kind, value: value.trim() });
|
|
944
|
+
if (ok) setValue("");
|
|
945
|
+
};
|
|
946
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Panel, { title: data.roles[role2]?.label || role2, action: data.writable && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, { small: true, quiet: true, disabled: busy, onClick: () => act({ action: "hide", role: role2 }), children: "\u79FB\u51FA\u9879\u76EE\u4E13\u5BB6" }), children: [
|
|
947
|
+
links.map((l) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "sci-expert-row", children: [
|
|
948
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { children: [
|
|
949
|
+
typeLabel[l.kind],
|
|
950
|
+
" \xB7 ",
|
|
951
|
+
l.kind === "plugin" ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("a", { href: l.value, target: "_blank", rel: "noreferrer", children: l.value }) : l.value
|
|
952
|
+
] }),
|
|
953
|
+
data.writable && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, { small: true, quiet: true, disabled: busy, onClick: () => act({ action: "unlink", role: role2, kind: l.kind, value: l.value }), children: "\u53D6\u6D88\u5173\u8054" })
|
|
954
|
+
] }, l.kind + "/" + l.value)),
|
|
955
|
+
local.map((s) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "sci-expert-row", children: [
|
|
956
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { children: [
|
|
957
|
+
"\u9879\u76EE Skill \xB7 ",
|
|
958
|
+
s.name,
|
|
959
|
+
s.warn ? "\uFF08\u4ED3\u5E93\u4E2D\u672A\u53D1\u73B0 SKILL.md\uFF09" : ""
|
|
960
|
+
] }),
|
|
961
|
+
data.writable && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, { small: true, quiet: true, disabled: busy, onClick: () => act({ action: "remove", role: role2, name: s.name }), children: "\u4ECE\u672C\u9879\u76EE\u5378\u8F7D" })
|
|
962
|
+
] }, s.name)),
|
|
963
|
+
data.writable && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("form", { className: "sci-expert-form", onSubmit: submit, children: [
|
|
964
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("select", { "aria-label": "\u6269\u5C55\u7C7B\u578B", value: kind, onChange: (e) => {
|
|
965
|
+
setKind(e.target.value);
|
|
966
|
+
setValue("");
|
|
967
|
+
}, children: [
|
|
968
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "global", children: "\u5F15\u7528\u5168\u5C40 Skill" }),
|
|
969
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "local", children: "\u5B89\u88C5\u9879\u76EE Skill" }),
|
|
970
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "plugin", children: "\u5173\u8054 DSH \u63D2\u4EF6" }),
|
|
971
|
+
!!data.legacy[role2]?.length && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "legacy", children: "\u5F15\u7528\u65E7\u7248\u89D2\u8272\u6280\u80FD" })
|
|
972
|
+
] }),
|
|
973
|
+
choose ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("select", { "aria-label": "\u9009\u62E9\u6280\u80FD", value, onChange: (e) => setValue(e.target.value), children: [
|
|
974
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "", children: options.length ? "\u9009\u62E9\u5DF2\u5B89\u88C5\u7684\u6280\u80FD" : "\u6682\u65E0\u53EF\u5F15\u7528\u7684\u6280\u80FD" }),
|
|
975
|
+
options.map((n) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { children: n }, n))
|
|
976
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("input", { "aria-label": "\u6269\u5C55\u6765\u6E90\u94FE\u63A5", type: "url", required: true, value, placeholder: kind === "plugin" ? "npm \u5305\u6216 GitHub / GitLab \u4ED3\u5E93\u94FE\u63A5" : "GitHub / GitLab \u4ED3\u5E93\u9996\u9875\u94FE\u63A5", onChange: (e) => setValue(e.target.value) }),
|
|
977
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, { small: true, type: "submit", disabled: busy || !value.trim(), children: kind === "local" ? "\u5B89\u88C5\u5230\u9879\u76EE" : "\u5173\u8054" })
|
|
978
|
+
] }),
|
|
979
|
+
(kind === "plugin" || links.some((l) => l.kind === "plugin")) && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("p", { className: "sci-small", children: [
|
|
980
|
+
"\u9879\u76EE\u4FDD\u5B58\u63D2\u4EF6\u6765\u6E90\u3002\u5B89\u88C5\u548C\u542F\u7528\u4F1A\u4F5C\u7528\u4E8E\u5F53\u524D DSH \u914D\u7F6E\u3002 ",
|
|
981
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, { quiet: true, small: true, onClick: openManager, children: "\u6253\u5F00 DSH \u63D2\u4EF6\u7BA1\u7406\u5668" })
|
|
982
|
+
] })
|
|
983
|
+
] });
|
|
984
|
+
}
|
|
985
|
+
function ExpertSetupPage({ binding, services }) {
|
|
986
|
+
const [data, setData] = (0, import_react7.useState)(null);
|
|
987
|
+
const [busy, setBusy] = (0, import_react7.useState)(false);
|
|
988
|
+
const [error, setError] = (0, import_react7.useState)("");
|
|
989
|
+
const [role2, setRole] = (0, import_react7.useState)("");
|
|
990
|
+
const [retry, setRetry] = (0, import_react7.useState)(0);
|
|
991
|
+
(0, import_react7.useEffect)(() => {
|
|
992
|
+
if (!binding.projectId) return;
|
|
993
|
+
const abort = new AbortController();
|
|
994
|
+
request(binding, { action: "inspect" }, abort.signal).then(setData).catch((e) => {
|
|
995
|
+
if (!abort.signal.aborted) setError(e.message);
|
|
996
|
+
});
|
|
997
|
+
return () => abort.abort();
|
|
998
|
+
}, [binding.sessionId, binding.projectId, retry]);
|
|
999
|
+
const act = async (payload) => {
|
|
1000
|
+
setBusy(true);
|
|
1001
|
+
setError("");
|
|
952
1002
|
try {
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
} catch (error) {
|
|
960
|
-
setNotice({ tone: "error", text: `\u64CD\u4F5C\u5931\u8D25\uFF1A${error.message}` });
|
|
1003
|
+
await request(binding, payload);
|
|
1004
|
+
setData(await request(binding, { action: "inspect" }));
|
|
1005
|
+
return true;
|
|
1006
|
+
} catch (e) {
|
|
1007
|
+
setError(e.message);
|
|
1008
|
+
return false;
|
|
961
1009
|
} finally {
|
|
962
|
-
setBusy(
|
|
1010
|
+
setBusy(false);
|
|
963
1011
|
}
|
|
964
1012
|
};
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
const
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
candidateCards.length ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "sci-expert-grid", children: candidateCards.map((entry) => {
|
|
990
|
-
const installedEntry = installedFor(installed, entry.role, entry.id);
|
|
991
|
-
const canInstall = entry.installable === true && Boolean(entry.gitRef);
|
|
992
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("article", { className: "sci-expert-card", children: [
|
|
993
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "sci-result-top", children: [
|
|
994
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
|
|
995
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h3", { children: entry.name }),
|
|
996
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: entry.description })
|
|
997
|
-
] }),
|
|
998
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Badge, { tone: installedEntry ? "good" : canInstall ? "default" : "warn", children: installedEntry ? "\u5DF2\u5B89\u88C5" : canInstall ? "\u53EF\u5B89\u88C5\u6280\u80FD" : "\u73AF\u5883\u5DE5\u5177 / \u5F85\u6838\u9A8C" })
|
|
999
|
-
] }),
|
|
1000
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "sci-small", children: [
|
|
1001
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: "\u89D2\u8272\uFF1A" }),
|
|
1002
|
-
ROLE_INFO[entry.role]?.title || entry.role
|
|
1003
|
-
] }),
|
|
1004
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "sci-small", children: [
|
|
1005
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: "\u8FD0\u884C\u73AF\u5883\u4E0E\u4F9D\u8D56\uFF1A" }),
|
|
1006
|
-
entry.environment || "\u672A\u8BB0\u5F55\uFF0C\u9700\u6838\u5BF9\u4ED3\u5E93\u8BF4\u660E\u3002"
|
|
1007
|
-
] }),
|
|
1008
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "sci-small", children: [
|
|
1009
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: "\u6765\u6E90\u4ED3\u5E93\uFF1A" }),
|
|
1010
|
-
entry.repo ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("a", { href: entry.repo, target: "_blank", rel: "noreferrer", children: entry.repo }) : "\u672A\u8BB0\u5F55"
|
|
1011
|
-
] }),
|
|
1012
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "sci-small", children: [
|
|
1013
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: "\u8BB8\u53EF\u8BC1\uFF1A" }),
|
|
1014
|
-
entry.license || "\u672A\u6838\u9A8C"
|
|
1015
|
-
] }),
|
|
1016
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "sci-small", children: [
|
|
1017
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: "SKILL.md\uFF1A" }),
|
|
1018
|
-
entry.hasSkillMd ? `\u5DF2\u6838\u9A8C \xB7 ${entry.subdir ? `${entry.subdir}/SKILL.md` : "SKILL.md"}` : "\u672A\u6838\u9A8C\u6216\u672A\u53D1\u73B0"
|
|
1019
|
-
] }),
|
|
1020
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "sci-small", children: [
|
|
1021
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: "\u5B89\u88C5\u72B6\u6001\uFF1A" }),
|
|
1022
|
-
installedEntry ? `\u5DF2\u5B89\u88C5${installedEntry.dir ? ` \xB7 ${installedEntry.dir}` : ""}` : "\u5C1A\u672A\u5B89\u88C5"
|
|
1023
|
-
] }),
|
|
1024
|
-
entry.gitRef && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "sci-small", children: [
|
|
1025
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: "\u56FA\u5B9A\u7248\u672C\uFF1A" }),
|
|
1026
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("code", { children: entry.gitRef })
|
|
1027
|
-
] }),
|
|
1028
|
-
!entry.gitRef && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "sci-risk", children: "\u5F53\u524D\u6CA1\u6709\u5DF2\u6838\u5B9E\u7684\u56FA\u5B9A\u63D0\u4EA4\uFF0C\u5B89\u88C5\u5165\u53E3\u6682\u4E0D\u53EF\u7528\u3002" }),
|
|
1029
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "sci-risk", children: [
|
|
1030
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: "\u4F7F\u7528\u98CE\u9669\uFF1A" }),
|
|
1031
|
-
entry.risk || "\u98CE\u9669\u4FE1\u606F\u672A\u8BB0\u5F55\uFF1B\u5B89\u88C5\u524D\u9700\u81EA\u884C\u6838\u5BF9\u4F9D\u8D56\u3001\u6570\u636E\u5916\u4F20\u548C\u8BB8\u53EF\u8FB9\u754C\u3002"
|
|
1032
|
-
] }),
|
|
1033
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "sci-result-actions", children: installedEntry ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, { small: true, onClick: () => manageSkill(entry, "remove"), disabled: busy === `${entry.role}:${entry.id}`, children: "\u79FB\u9664\u6269\u5C55" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, { small: true, primary: true, onClick: () => manageSkill(entry, "install"), disabled: !canInstall || busy === `${entry.role}:${entry.id}`, children: busy === `${entry.role}:${entry.id}` ? "\u5904\u7406\u4E2D\u2026" : canInstall ? "\u5B89\u88C5\u5230\u8BE5\u4E13\u5BB6" : "\u6682\u4E0D\u53EF\u5B89\u88C5" }) })
|
|
1034
|
-
] }, `${entry.role}:${entry.id}`);
|
|
1035
|
-
}) }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "sci-small", children: "\u76EE\u524D\u6CA1\u6709\u56FA\u5B9A\u7248\u672C\u4E14\u53EF\u76F4\u63A5\u5B89\u88C5\u7684\u6280\u80FD\u6761\u76EE\u3002\u73AF\u5883\u5DE5\u5177\u5019\u9009\u4ECD\u53EF\u7531\u8BA1\u7B97\u4E13\u5BB6\u6309\u5B98\u65B9\u6587\u6863\u914D\u7F6E\u3002" })
|
|
1013
|
+
const bind = async () => {
|
|
1014
|
+
setBusy(true);
|
|
1015
|
+
try {
|
|
1016
|
+
const r = await binding.act({ actionId: "project.ensure-binding", commandId: crypto.randomUUID(), payload: {} });
|
|
1017
|
+
if (r.status !== 200) throw new Error(r.body?.reason || "\u521B\u5EFA\u9879\u76EE\u5931\u8D25");
|
|
1018
|
+
await binding.refresh();
|
|
1019
|
+
} catch (e) {
|
|
1020
|
+
setError(e.message);
|
|
1021
|
+
} finally {
|
|
1022
|
+
setBusy(false);
|
|
1023
|
+
}
|
|
1024
|
+
};
|
|
1025
|
+
const openManager = () => {
|
|
1026
|
+
if (!services.openPluginManager?.()) setError("\u8BF7\u4ECE DSH \u8BBE\u7F6E\u6253\u5F00\u300C\u63D2\u4EF6\u300D\u7BA1\u7406\u9875\u9762\u3002");
|
|
1027
|
+
};
|
|
1028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "sci-project-experts", children: [
|
|
1029
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h1", { children: "\u9879\u76EE\u4E13\u5BB6" }),
|
|
1030
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(StatusMessage, { tone: "error", children: [
|
|
1031
|
+
error,
|
|
1032
|
+
" ",
|
|
1033
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, { small: true, onClick: () => {
|
|
1034
|
+
setError("");
|
|
1035
|
+
setRetry(retry + 1);
|
|
1036
|
+
}, children: "\u91CD\u65B0\u8BFB\u53D6" })
|
|
1036
1037
|
] }),
|
|
1037
|
-
|
|
1038
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
] }),
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: "SKILL.md\uFF1A" }),
|
|
1059
|
-
entry.hasSkillMd ? `\u5DF2\u53D1\u73B0 \xB7 ${(entry.skillMdPaths || []).join("\uFF1B") || entry.dir}` : "\u672A\u53D1\u73B0\uFF1B\u76EE\u5F55\u53EA\u767B\u8BB0\u4E86\u8DEF\u5F84"
|
|
1060
|
-
] }),
|
|
1061
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "sci-small", children: [
|
|
1062
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: "\u5B89\u88C5\u4F4D\u7F6E\uFF1A" }),
|
|
1063
|
-
entry.dir || "\u672A\u8BB0\u5F55"
|
|
1064
|
-
] }),
|
|
1065
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "sci-risk", children: [
|
|
1066
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: "\u4F7F\u7528\u98CE\u9669\uFF1A" }),
|
|
1067
|
-
entry.risk || "\u5C1A\u672A\u6838\u9A8C\uFF1B\u4F7F\u7528\u524D\u9700\u68C0\u67E5\u4ED3\u5E93\u8BF4\u660E\u3001\u6267\u884C\u547D\u4EE4\u3001\u4F9D\u8D56\u8BB8\u53EF\u548C\u6570\u636E\u5916\u4F20\u8FB9\u754C\u3002"
|
|
1068
|
-
] }),
|
|
1069
|
-
entry.warn && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "sci-risk", children: "\u5B89\u88C5\u8BB0\u5F55\u6807\u8BB0\uFF1A\u672A\u53D1\u73B0\u6807\u51C6 SKILL.md\u3002" }),
|
|
1070
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "sci-result-actions", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, { small: true, onClick: () => manageSkill(entry, "remove"), disabled: busy === `${entry.role}:${entry.id}`, children: busy === `${entry.role}:${entry.id}` ? "\u5904\u7406\u4E2D\u2026" : "\u79FB\u9664\u6269\u5C55" }) })
|
|
1071
|
-
] }, `${entry.role}:${entry.id}`)) }) }),
|
|
1072
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Panel, { title: "\u72EC\u7ACB\u96C6\u6210\u4E0E\u6570\u636E\u8FB9\u754C", subtitle: "\u4EE5\u4E0B\u80FD\u529B\u9700\u8981\u5355\u72EC\u5B89\u88C5\u6216\u5916\u90E8\u670D\u52A1\uFF0C\u4E0D\u4F1A\u4F5C\u4E3A\u672C\u5730\u6280\u80FD\u4F2A\u88C5\u6210\u4E00\u952E\u529F\u80FD\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "sci-expert-grid", children: (skillMenu.integrations || []).map((integration) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("article", { className: "sci-expert-card", children: [
|
|
1073
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h3", { children: integration.name }),
|
|
1074
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: integration.description }),
|
|
1075
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Badge, { tone: integration.tone || "default", children: integration.status }),
|
|
1076
|
-
integration.environment && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "sci-small", children: [
|
|
1077
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: "\u73AF\u5883/\u4F9D\u8D56\uFF1A" }),
|
|
1078
|
-
integration.environment
|
|
1079
|
-
] }),
|
|
1080
|
-
integration.license && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "sci-small", children: [
|
|
1081
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: "\u8BB8\u53EF\uFF1A" }),
|
|
1082
|
-
integration.license
|
|
1083
|
-
] }),
|
|
1084
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "sci-small", children: [
|
|
1085
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: "\u6765\u6E90\uFF1A" }),
|
|
1086
|
-
integration.repo || integration.sourceUrl ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("a", { href: integration.repo || integration.sourceUrl, target: "_blank", rel: "noreferrer", children: integration.repo || integration.sourceUrl }) : integration.sourcePath ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("code", { children: integration.sourcePath }) : "\u672A\u8BB0\u5F55"
|
|
1087
|
-
] }),
|
|
1088
|
-
integration.installCommand && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "sci-small", children: [
|
|
1089
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("b", { children: "\u5B89\u88C5\u547D\u4EE4\uFF1A" }),
|
|
1090
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("code", { children: integration.installCommand })
|
|
1091
|
-
] }),
|
|
1092
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "sci-result-actions", children: integration.actionUrl ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("a", { className: "sci-button sci-button-small", href: integration.actionUrl, target: "_blank", rel: "noreferrer", children: integration.actionLabel || "\u6253\u5F00\u6765\u6E90" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "sci-small", children: integration.actionLabel || "\u5F53\u524D\u672A\u914D\u7F6E\u53EF\u6267\u884C\u8FDE\u63A5" }) })
|
|
1093
|
-
] }, integration.id)) }) })
|
|
1038
|
+
!binding.projectId ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Panel, { title: "\u4E3A\u5F53\u524D\u8BFE\u9898\u914D\u7F6E\u4E13\u5BB6", children: [
|
|
1039
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: "\u5148\u5C06\u6B64\u4F1A\u8BDD\u7ED1\u5B9A\u5230\u79D1\u7814\u9879\u76EE\uFF0C\u518D\u9009\u62E9\u9700\u8981\u7684\u4E13\u5BB6\u548C\u6269\u5C55\u3002" }),
|
|
1040
|
+
binding.ref?.relationship === "unbound" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, { primary: true, disabled: busy, onClick: bind, children: "\u521B\u5EFA\u5F53\u524D\u79D1\u7814\u9879\u76EE" })
|
|
1041
|
+
] }) : !data ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { role: "status", children: "\u6B63\u5728\u8BFB\u53D6\u4E13\u5BB6\u914D\u7F6E\u2026" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1042
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Panel, { title: "\u9009\u62E9\u4E13\u5BB6", subtitle: "\u9009\u62E9\u53EA\u4FDD\u5B58\u5728\u5F53\u524D\u9879\u76EE\u3002\u6D3E\u53D1\u4EFB\u52A1\u65F6\u624D\u4F1A\u542F\u52A8\u4E13\u5BB6\u3002", children: data.writable ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
1043
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "sci-expert-presets", children: Object.entries(data.presets).map(([id, p]) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Button, { disabled: busy || p.roles.every((r) => data.config.roles.includes(r)), onClick: () => act({ action: "preset", value: id }), children: [
|
|
1044
|
+
p.label,
|
|
1045
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("small", { children: p.roles.map((r) => data.roles[r].label).join(" \xB7 ") })
|
|
1046
|
+
] }, id)) }),
|
|
1047
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "sci-expert-form", children: [
|
|
1048
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("select", { "aria-label": "\u6DFB\u52A0\u5355\u4E2A\u4E13\u5BB6", value: role2, onChange: (e) => setRole(e.target.value), children: [
|
|
1049
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "", children: "\u9009\u62E9\u5176\u4ED6\u4E13\u5BB6" }),
|
|
1050
|
+
Object.entries(data.roles).filter(([id]) => !data.config.roles.includes(id)).map(([id, d]) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: id, children: d.label }, id))
|
|
1051
|
+
] }),
|
|
1052
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Button, { small: true, disabled: busy || !role2, onClick: async () => {
|
|
1053
|
+
if (await act({ action: "add", role: role2 })) setRole("");
|
|
1054
|
+
}, children: "\u6DFB\u52A0\u4E13\u5BB6" })
|
|
1055
|
+
] })
|
|
1056
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: "\u8BF7\u5728\u9879\u76EE\u7684\u4E3B\u4F1A\u8BDD\u4FEE\u6539\u4E13\u5BB6\u914D\u7F6E\u3002" }) }),
|
|
1057
|
+
data.config.roles.map((r) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Expert, { role: r, data, act, busy, openManager }, r))
|
|
1058
|
+
] })
|
|
1094
1059
|
] });
|
|
1095
1060
|
}
|
|
1096
1061
|
|
|
@@ -1989,11 +1954,11 @@ function ProjectCatalog({ services }) {
|
|
|
1989
1954
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1990
1955
|
var NAV = [
|
|
1991
1956
|
{ id: "overview", label: "\u6982\u89C8" },
|
|
1957
|
+
{ id: "experts", label: "\u9879\u76EE\u4E13\u5BB6" },
|
|
1992
1958
|
{ id: "catalog", label: "\u9879\u76EE\u603B\u89C8" },
|
|
1993
1959
|
{ id: "paper", label: "\u8BBA\u6587\u4E3B\u7EBF" },
|
|
1994
1960
|
{ id: "team", label: "\u56E2\u961F\u8FDB\u5C55" },
|
|
1995
|
-
{ id: "artifacts", label: "\u56FE\u8868\u4E0E\u6210\u679C" }
|
|
1996
|
-
{ id: "experts", label: "\u4E13\u5BB6\u914D\u7F6E" }
|
|
1961
|
+
{ id: "artifacts", label: "\u56FE\u8868\u4E0E\u6210\u679C" }
|
|
1997
1962
|
];
|
|
1998
1963
|
function WorkbenchMark() {
|
|
1999
1964
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "sci-wb-mark", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.7", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
@@ -2091,7 +2056,7 @@ function ResearchWorkbench({ services }) {
|
|
|
2091
2056
|
page === "paper" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PaperSpinePage, { view: currentView, raw: state.raw, onAction: openAction, onConfirm: confirmResult, busy, onOpenConversation: openConversation, onNavigate: setPage }),
|
|
2092
2057
|
page === "team" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TeamProgressPage, { view: currentView, openMemberSession: services?.openMemberSession, memberOpenAvailable: services?.memberOpenAvailable?.(currentView) }),
|
|
2093
2058
|
page === "artifacts" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ArtifactsPage, { view: currentView, onAction: openAction }),
|
|
2094
|
-
page === "experts" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ExpertSetupPage, {
|
|
2059
|
+
page === "experts" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ExpertSetupPage, { binding: state, services }, JSON.stringify([state.sessionId, state.projectId])),
|
|
2095
2060
|
state.error && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "sci-small", style: { marginTop: 14 }, role: "status", children: [
|
|
2096
2061
|
"\u72B6\u6001\u5237\u65B0\u5931\u8D25\uFF0C\u6B63\u5728\u663E\u793A\u4E0A\u4E00\u6B21\u6210\u529F\u8BFB\u53D6\u7684\u6570\u636E\uFF1A",
|
|
2097
2062
|
state.error
|
|
@@ -3082,7 +3047,7 @@ function useCurrentObjectRevision(sessionId, objectId) {
|
|
|
3082
3047
|
const res = await fetch(`/plugins/dsh-science/project/get?sessionId=${encodeURIComponent(sessionId)}`);
|
|
3083
3048
|
if (!alive || !res || !res.ok) return;
|
|
3084
3049
|
const body = await res.json();
|
|
3085
|
-
const paper = body
|
|
3050
|
+
const paper = body?.project?.snapshot?.paper ?? body?.project?.paper;
|
|
3086
3051
|
if (!paper) return;
|
|
3087
3052
|
const obj = objectId === "core" ? paper.core : (paper.results || []).find((r) => r && r.id === objectId);
|
|
3088
3053
|
const revision = obj && Number(obj.revision);
|
|
@@ -3336,7 +3301,19 @@ function makeServices(ctx) {
|
|
|
3336
3301
|
const prepareHandoff = async (kind, target = null) => {
|
|
3337
3302
|
return handoffToComposer({ ctx, sessionId: getSessionId(), kind, target, openConversation });
|
|
3338
3303
|
};
|
|
3339
|
-
|
|
3304
|
+
let manager;
|
|
3305
|
+
ctx.inject?.(["pluginNavigation"], (scope) => {
|
|
3306
|
+
manager = scope.pluginNavigation;
|
|
3307
|
+
scope.effect(() => () => {
|
|
3308
|
+
manager = void 0;
|
|
3309
|
+
});
|
|
3310
|
+
});
|
|
3311
|
+
const openPluginManager = () => {
|
|
3312
|
+
if (!manager?.openList) return false;
|
|
3313
|
+
manager.openList();
|
|
3314
|
+
return true;
|
|
3315
|
+
};
|
|
3316
|
+
return { openPluginManager, getSessionId, subscribeSession, getCurrentSession, openConversation, openWorkbench, openRootSession, openMemberSession, memberOpenAvailable, prepareHandoff };
|
|
3340
3317
|
}
|
|
3341
3318
|
function WorkbenchIcon({ size = 22, active = false }) {
|
|
3342
3319
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.7", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", "data-active": active || void 0, children: [
|