@zoraxylia/dsh-codex-adapter 0.1.16 → 0.1.18
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/.claude-plugin/plugin.json +1 -1
- package/lib/client.js +118 -49
- package/lib/server.mjs +1 -1
- package/package.json +1 -1
- package/src/client/index.tsx +76 -26
- package/src/server.mjs +1 -1
package/lib/client.js
CHANGED
|
@@ -513,7 +513,7 @@ const COPY = {
|
|
|
513
513
|
},
|
|
514
514
|
save: "保存",
|
|
515
515
|
saved: "已保存",
|
|
516
|
-
jobs: "Worker 任务",
|
|
516
|
+
jobs: "实时 Worker 任务",
|
|
517
517
|
empty: "当前没有 worker 任务。",
|
|
518
518
|
history: "历史看板",
|
|
519
519
|
historyEmpty: "还没有历史记录。",
|
|
@@ -698,7 +698,7 @@ const COPY = {
|
|
|
698
698
|
},
|
|
699
699
|
save: "Save",
|
|
700
700
|
saved: "Saved",
|
|
701
|
-
jobs: "
|
|
701
|
+
jobs: "Live worker jobs",
|
|
702
702
|
empty: "No worker jobs yet.",
|
|
703
703
|
history: "History",
|
|
704
704
|
historyEmpty: "No history yet.",
|
|
@@ -1038,12 +1038,27 @@ function WorkersPanel({ ctx }) {
|
|
|
1038
1038
|
const [busy, setBusy] = (0, react.useState)(false);
|
|
1039
1039
|
const [historyRows, setHistoryRows] = (0, react.useState)([]);
|
|
1040
1040
|
const [historyAgg, setHistoryAgg] = (0, react.useState)(null);
|
|
1041
|
-
const [historyCollapsed, setHistoryCollapsed] = (0, react.useState)(true);
|
|
1042
1041
|
const [provForm, setProvForm] = (0, react.useState)(null);
|
|
1043
1042
|
const [modelAdd, setModelAdd] = (0, react.useState)(null);
|
|
1044
1043
|
const [testResult, setTestResult] = (0, react.useState)(null);
|
|
1045
|
-
const
|
|
1046
|
-
|
|
1044
|
+
const TABS = [
|
|
1045
|
+
"integrations",
|
|
1046
|
+
"config",
|
|
1047
|
+
"history"
|
|
1048
|
+
];
|
|
1049
|
+
const [tab, setTab] = (0, react.useState)(() => {
|
|
1050
|
+
try {
|
|
1051
|
+
const saved = localStorage.getItem("dsh-adapter-tab");
|
|
1052
|
+
return TABS.includes(saved ?? "") ? saved : "config";
|
|
1053
|
+
} catch {
|
|
1054
|
+
return "config";
|
|
1055
|
+
}
|
|
1056
|
+
});
|
|
1057
|
+
(0, react.useEffect)(() => {
|
|
1058
|
+
try {
|
|
1059
|
+
localStorage.setItem("dsh-adapter-tab", tab);
|
|
1060
|
+
} catch {}
|
|
1061
|
+
}, [tab]);
|
|
1047
1062
|
/**
|
|
1048
1063
|
* The panel is served from disk on every load, but the hub's routes are
|
|
1049
1064
|
* registered at instance boot — after an upgrade the new UI can call a route
|
|
@@ -1528,13 +1543,27 @@ function WorkersPanel({ ctx }) {
|
|
|
1528
1543
|
const integrationRow = (name, installed, extra, installTarget, uninstallTarget, tips) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1529
1544
|
style: S.card,
|
|
1530
1545
|
children: [
|
|
1531
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
1546
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1532
1547
|
style: {
|
|
1548
|
+
display: "flex",
|
|
1549
|
+
alignItems: "center",
|
|
1550
|
+
gap: 7,
|
|
1533
1551
|
fontWeight: 600,
|
|
1534
1552
|
fontSize: 13,
|
|
1535
1553
|
minWidth: 92
|
|
1536
1554
|
},
|
|
1537
|
-
children:
|
|
1555
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1556
|
+
"aria-hidden": "true",
|
|
1557
|
+
title: installed ? copy.installed : copy.notInstalled,
|
|
1558
|
+
style: {
|
|
1559
|
+
width: 7,
|
|
1560
|
+
height: 7,
|
|
1561
|
+
borderRadius: "50%",
|
|
1562
|
+
flexShrink: 0,
|
|
1563
|
+
background: installed ? "#3fb950" : "rgba(128,128,128,0.45)",
|
|
1564
|
+
boxShadow: installed ? "0 0 0 2px rgba(63,185,80,0.18)" : "none"
|
|
1565
|
+
}
|
|
1566
|
+
}), name]
|
|
1538
1567
|
}),
|
|
1539
1568
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1540
1569
|
style: S.chip(installed),
|
|
@@ -1588,38 +1617,6 @@ function WorkersPanel({ ctx }) {
|
|
|
1588
1617
|
]
|
|
1589
1618
|
});
|
|
1590
1619
|
/** Clickable section header that toggles its section's collapsed state. */
|
|
1591
|
-
const sectionHeader = (text, collapsed, toggle) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1592
|
-
role: "button",
|
|
1593
|
-
tabIndex: 0,
|
|
1594
|
-
"aria-expanded": !collapsed,
|
|
1595
|
-
title: collapsed ? copy.expand : copy.collapse,
|
|
1596
|
-
onClick: toggle,
|
|
1597
|
-
onKeyDown: (e) => {
|
|
1598
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
1599
|
-
e.preventDefault();
|
|
1600
|
-
toggle();
|
|
1601
|
-
}
|
|
1602
|
-
},
|
|
1603
|
-
style: {
|
|
1604
|
-
...S.section,
|
|
1605
|
-
display: "flex",
|
|
1606
|
-
alignItems: "center",
|
|
1607
|
-
gap: 6,
|
|
1608
|
-
cursor: "pointer",
|
|
1609
|
-
userSelect: "none"
|
|
1610
|
-
},
|
|
1611
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1612
|
-
"aria-hidden": "true",
|
|
1613
|
-
style: {
|
|
1614
|
-
fontSize: 11,
|
|
1615
|
-
width: 12,
|
|
1616
|
-
flexShrink: 0,
|
|
1617
|
-
textAlign: "center",
|
|
1618
|
-
opacity: .85
|
|
1619
|
-
},
|
|
1620
|
-
children: collapsed ? "▸" : "▾"
|
|
1621
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: text })]
|
|
1622
|
-
});
|
|
1623
1620
|
const rows = jobsLoaded ? displayJobs(jobs, ghosts) : [];
|
|
1624
1621
|
const groups = groupJobs(rows);
|
|
1625
1622
|
const locks = workspaceLocks(rows);
|
|
@@ -1808,6 +1805,7 @@ function WorkersPanel({ ctx }) {
|
|
|
1808
1805
|
]
|
|
1809
1806
|
}, job.id);
|
|
1810
1807
|
};
|
|
1808
|
+
const runningJobs = jobsLoaded ? jobs.filter((j) => j.status === "running" && j.originWriterAlive !== false).length : 0;
|
|
1811
1809
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1812
1810
|
style: {
|
|
1813
1811
|
display: "flex",
|
|
@@ -1829,8 +1827,82 @@ function WorkersPanel({ ctx }) {
|
|
|
1829
1827
|
style: { opacity: .75 },
|
|
1830
1828
|
children: copy.intro
|
|
1831
1829
|
}),
|
|
1832
|
-
|
|
1833
|
-
|
|
1830
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1831
|
+
role: "tablist",
|
|
1832
|
+
"aria-label": copy.title,
|
|
1833
|
+
onKeyDown: (e) => {
|
|
1834
|
+
if (e.key !== "ArrowRight" && e.key !== "ArrowLeft") return;
|
|
1835
|
+
e.preventDefault();
|
|
1836
|
+
const index = TABS.indexOf(tab);
|
|
1837
|
+
const step = e.key === "ArrowRight" ? 1 : TABS.length - 1;
|
|
1838
|
+
setTab(TABS[(index + step) % TABS.length]);
|
|
1839
|
+
},
|
|
1840
|
+
style: {
|
|
1841
|
+
position: "sticky",
|
|
1842
|
+
top: 0,
|
|
1843
|
+
zIndex: 6,
|
|
1844
|
+
display: "flex",
|
|
1845
|
+
gap: 2,
|
|
1846
|
+
marginTop: 2,
|
|
1847
|
+
paddingTop: 4,
|
|
1848
|
+
marginBottom: -1,
|
|
1849
|
+
background: "Canvas",
|
|
1850
|
+
borderBottom: "1px solid rgba(128,128,128,0.2)",
|
|
1851
|
+
boxShadow: "0 1px 0 rgba(128,128,128,0.06)"
|
|
1852
|
+
},
|
|
1853
|
+
children: [
|
|
1854
|
+
["integrations", copy.integrations],
|
|
1855
|
+
["config", copy.globalConfig],
|
|
1856
|
+
["history", copy.history]
|
|
1857
|
+
].map(([key, label]) => {
|
|
1858
|
+
const active = tab === key;
|
|
1859
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
1860
|
+
type: "button",
|
|
1861
|
+
role: "tab",
|
|
1862
|
+
"aria-selected": active,
|
|
1863
|
+
tabIndex: active ? 0 : -1,
|
|
1864
|
+
onClick: () => setTab(key),
|
|
1865
|
+
onMouseEnter: (e) => {
|
|
1866
|
+
if (!active) e.currentTarget.style.background = "rgba(128,128,128,0.10)";
|
|
1867
|
+
},
|
|
1868
|
+
onMouseLeave: (e) => {
|
|
1869
|
+
e.currentTarget.style.background = "transparent";
|
|
1870
|
+
},
|
|
1871
|
+
style: {
|
|
1872
|
+
display: "inline-flex",
|
|
1873
|
+
alignItems: "center",
|
|
1874
|
+
padding: "6px 12px",
|
|
1875
|
+
fontSize: 12.5,
|
|
1876
|
+
border: "none",
|
|
1877
|
+
background: "transparent",
|
|
1878
|
+
cursor: "pointer",
|
|
1879
|
+
borderRadius: "6px 6px 0 0",
|
|
1880
|
+
color: active ? "inherit" : "rgba(128,128,128,0.9)",
|
|
1881
|
+
fontWeight: active ? 600 : 400,
|
|
1882
|
+
borderBottom: `2px solid ${active ? "#4c8dff" : "transparent"}`,
|
|
1883
|
+
transition: "color 120ms ease, border-color 120ms ease, background 120ms ease"
|
|
1884
|
+
},
|
|
1885
|
+
children: [label, key === "history" && runningJobs > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1886
|
+
"aria-label": String(runningJobs),
|
|
1887
|
+
style: {
|
|
1888
|
+
marginLeft: 6,
|
|
1889
|
+
minWidth: 16,
|
|
1890
|
+
height: 16,
|
|
1891
|
+
padding: "0 4px",
|
|
1892
|
+
borderRadius: 99,
|
|
1893
|
+
background: "#4c8dff",
|
|
1894
|
+
color: "#fff",
|
|
1895
|
+
fontSize: 10.5,
|
|
1896
|
+
lineHeight: "16px",
|
|
1897
|
+
textAlign: "center",
|
|
1898
|
+
fontWeight: 600
|
|
1899
|
+
},
|
|
1900
|
+
children: runningJobs
|
|
1901
|
+
})]
|
|
1902
|
+
}, key);
|
|
1903
|
+
})
|
|
1904
|
+
}),
|
|
1905
|
+
tab === "integrations" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1834
1906
|
style: {
|
|
1835
1907
|
display: "flex",
|
|
1836
1908
|
flexDirection: "column",
|
|
@@ -1873,8 +1945,7 @@ function WorkersPanel({ ctx }) {
|
|
|
1873
1945
|
})
|
|
1874
1946
|
]
|
|
1875
1947
|
}),
|
|
1876
|
-
|
|
1877
|
-
!globalConfigCollapsed && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [config && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
1948
|
+
tab === "config" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [config && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
1878
1949
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1879
1950
|
style: S.group,
|
|
1880
1951
|
children: copy.groupDispatch
|
|
@@ -2527,8 +2598,7 @@ function WorkersPanel({ ctx }) {
|
|
|
2527
2598
|
},
|
|
2528
2599
|
children: notice
|
|
2529
2600
|
}),
|
|
2530
|
-
|
|
2531
|
-
!historyCollapsed && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2601
|
+
tab === "history" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2532
2602
|
style: {
|
|
2533
2603
|
display: "flex",
|
|
2534
2604
|
flexDirection: "column",
|
|
@@ -2691,11 +2761,10 @@ function WorkersPanel({ ctx }) {
|
|
|
2691
2761
|
})
|
|
2692
2762
|
})]
|
|
2693
2763
|
}),
|
|
2694
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2764
|
+
tab === "history" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2695
2765
|
style: S.section,
|
|
2696
2766
|
children: copy.jobs
|
|
2697
|
-
}),
|
|
2698
|
-
!jobsLoaded || groups.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2767
|
+
}), !jobsLoaded || groups.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2699
2768
|
style: { opacity: .55 },
|
|
2700
2769
|
children: copy.empty
|
|
2701
2770
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -2742,7 +2811,7 @@ function WorkersPanel({ ctx }) {
|
|
|
2742
2811
|
}, workspaceKey(group.cwd))) })
|
|
2743
2812
|
]
|
|
2744
2813
|
})
|
|
2745
|
-
}),
|
|
2814
|
+
})] }),
|
|
2746
2815
|
hoverTask && (0, react_dom.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2747
2816
|
style: {
|
|
2748
2817
|
position: "fixed",
|
package/lib/server.mjs
CHANGED
|
@@ -15072,7 +15072,7 @@ function describeBindings(config = {}) {
|
|
|
15072
15072
|
}
|
|
15073
15073
|
|
|
15074
15074
|
// src/server.mjs
|
|
15075
|
-
var server = new McpServer({ name: "dsh-adapter", version: "0.1.
|
|
15075
|
+
var server = new McpServer({ name: "dsh-adapter", version: "0.1.18" });
|
|
15076
15076
|
var tierSchema = external_exports.enum(["flash", "pro"]).optional().describe("Worker model tier. flash = mechanical, well-scoped work (single-file edits, lookups, formatting); pro = multi-file changes, debugging, design judgment. Omit to use the session default. Ignored when worker= is set.");
|
|
15077
15077
|
var effortSchema = external_exports.enum(["off", "high", "max"]).optional().describe("Reasoning effort for the worker. Omit to use the session default. With worker= it only applies when passed explicitly and the profile supports it (agy maps to low/medium/high).");
|
|
15078
15078
|
var workerSchema = external_exports.string().optional().describe('Named CLI worker profile (e.g. "agy" or "grok"). Explicit opt-in only: set it when the user explicitly asks for that external coding CLI, never as a default. When set, dispatch bypasses tier/mode and runs the task through that CLI; the profile pins backend\xD7model\xD7effort. See dsh_worker_config output, worker_profiles field, for the available profiles.');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zoraxylia/dsh-codex-adapter",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/hub/index.mjs",
|
|
6
6
|
"description": "Dispatch tasks from Claude Code / Codex to DSH agents as native subagents with live progress; configure dispatch defaults, execution mode, and vision / image-generation access, installed into the host in one click.",
|
package/src/client/index.tsx
CHANGED
|
@@ -136,7 +136,7 @@ const COPY = {
|
|
|
136
136
|
cardMM: { t: '视觉与生图', d: '给纯文本的 DSH 模型借来眼睛和画笔:describe_image、会话贴图转写与 generate_image 都用这里的设置。' },
|
|
137
137
|
cardCustomProv: { t: '自定义 Provider', d: '接入自己的 API 或本地命令;保存后会出现在上面的视觉 / 生图 provider 选择里。' },
|
|
138
138
|
modeDesc: { auto: 'auto · 优先 hub', hub: 'hub · 必须 hub', standalone: 'standalone · 独立进程' },
|
|
139
|
-
save: '保存', saved: '已保存', jobs: 'Worker 任务', empty: '当前没有 worker 任务。',
|
|
139
|
+
save: '保存', saved: '已保存', jobs: '实时 Worker 任务', empty: '当前没有 worker 任务。',
|
|
140
140
|
history: '历史看板', historyEmpty: '还没有历史记录。', historyTotal: '总数', historyDone: '成功', historyFailed: '失败',
|
|
141
141
|
historyAvg: '平均耗时', historyRefresh: '刷新', historyTime: '时间', historyTier: '档位', historyModel: '模型',
|
|
142
142
|
historyStatus: '状态', historyCost: '耗时', historyTask: '任务',
|
|
@@ -235,7 +235,7 @@ const COPY = {
|
|
|
235
235
|
cardMM: { t: 'Vision & image generation', d: "Lends the harness's text-only models eyes and a brush: describe_image, pasted-image transcription and generate_image all use these settings." },
|
|
236
236
|
cardCustomProv: { t: 'Custom providers', d: 'Bring your own API or local command; saved providers appear in the vision / image-gen selects above.' },
|
|
237
237
|
modeDesc: { auto: 'auto · prefer hub', hub: 'hub · require hub', standalone: 'standalone' },
|
|
238
|
-
save: 'Save', saved: 'Saved', jobs: '
|
|
238
|
+
save: 'Save', saved: 'Saved', jobs: 'Live worker jobs', empty: 'No worker jobs yet.',
|
|
239
239
|
history: 'History', historyEmpty: 'No history yet.', historyTotal: 'Total', historyDone: 'Done', historyFailed: 'Failed',
|
|
240
240
|
historyAvg: 'Avg duration', historyRefresh: 'Refresh', historyTime: 'Time', historyTier: 'Tier', historyModel: 'Model',
|
|
241
241
|
historyStatus: 'Status', historyCost: 'Duration', historyTask: 'Task',
|
|
@@ -424,7 +424,6 @@ function WorkersPanel({ ctx }: { ctx: any }) {
|
|
|
424
424
|
const [busy, setBusy] = useState(false);
|
|
425
425
|
const [historyRows, setHistoryRows] = useState<any[]>([]);
|
|
426
426
|
const [historyAgg, setHistoryAgg] = useState<any>(null);
|
|
427
|
-
const [historyCollapsed, setHistoryCollapsed] = useState(true);
|
|
428
427
|
const [provForm, setProvForm] = useState<{
|
|
429
428
|
originalId?: string; name: string; type: 'api' | 'cli'; models: string;
|
|
430
429
|
base_url: string; api_key: string; imagegen_model: string;
|
|
@@ -432,8 +431,15 @@ function WorkersPanel({ ctx }: { ctx: any }) {
|
|
|
432
431
|
} | null>(null);
|
|
433
432
|
const [modelAdd, setModelAdd] = useState<string | null>(null);
|
|
434
433
|
const [testResult, setTestResult] = useState<{ key: string; ok?: boolean; steps?: any[]; error?: string; busy: boolean } | null>(null);
|
|
435
|
-
const [
|
|
436
|
-
|
|
434
|
+
const TABS = ['integrations', 'config', 'history'] as const;
|
|
435
|
+
type TabKey = (typeof TABS)[number];
|
|
436
|
+
const [tab, setTab] = useState<TabKey>(() => {
|
|
437
|
+
try {
|
|
438
|
+
const saved = localStorage.getItem('dsh-adapter-tab');
|
|
439
|
+
return (TABS as readonly string[]).includes(saved ?? '') ? (saved as TabKey) : 'config';
|
|
440
|
+
} catch { return 'config'; }
|
|
441
|
+
});
|
|
442
|
+
useEffect(() => { try { localStorage.setItem('dsh-adapter-tab', tab); } catch { /* private mode */ } }, [tab]);
|
|
437
443
|
// Deliberately no default dispatch-target select here: CLI backends stay
|
|
438
444
|
// opt-in per call via the worker argument (see the read-only workerOptIn
|
|
439
445
|
// card below). Re-adding a default would silently re-route every
|
|
@@ -720,8 +726,17 @@ function WorkersPanel({ ctx }: { ctx: any }) {
|
|
|
720
726
|
);
|
|
721
727
|
|
|
722
728
|
const integrationRow = (name: string, installed: boolean, extra: any, installTarget: string, uninstallTarget: string, tips: any) => (
|
|
723
|
-
<div style={S.card}
|
|
724
|
-
|
|
729
|
+
<div style={{ ...S.card, transition: 'background 120ms ease', borderRadius: 8 }}
|
|
730
|
+
onMouseEnter={(e: any) => { e.currentTarget.style.background = 'rgba(128,128,128,0.06)'; }}
|
|
731
|
+
onMouseLeave={(e: any) => { e.currentTarget.style.background = 'transparent'; }}>
|
|
732
|
+
<span style={{ display: 'flex', alignItems: 'center', gap: 7, fontWeight: 600, fontSize: 13, minWidth: 92 }}>
|
|
733
|
+
<span aria-hidden="true" title={installed ? copy.installed : copy.notInstalled} style={{
|
|
734
|
+
width: 7, height: 7, borderRadius: '50%', flexShrink: 0,
|
|
735
|
+
background: installed ? '#3fb950' : 'rgba(128,128,128,0.45)',
|
|
736
|
+
boxShadow: installed ? '0 0 0 2px rgba(63,185,80,0.18)' : 'none',
|
|
737
|
+
}} />
|
|
738
|
+
{name}
|
|
739
|
+
</span>
|
|
725
740
|
<span style={S.chip(installed)}>{installed ? `● ${copy.installed}` : `○ ${copy.notInstalled}`}</span>
|
|
726
741
|
{extra}
|
|
727
742
|
<span style={{ flex: 1 }} />
|
|
@@ -739,18 +754,6 @@ function WorkersPanel({ ctx }: { ctx: any }) {
|
|
|
739
754
|
);
|
|
740
755
|
|
|
741
756
|
/** Clickable section header that toggles its section's collapsed state. */
|
|
742
|
-
const sectionHeader = (text: string, collapsed: boolean, toggle: () => void) => (
|
|
743
|
-
<div
|
|
744
|
-
role="button" tabIndex={0} aria-expanded={!collapsed}
|
|
745
|
-
title={collapsed ? copy.expand : copy.collapse}
|
|
746
|
-
onClick={toggle}
|
|
747
|
-
onKeyDown={(e: any) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); toggle(); } }}
|
|
748
|
-
style={{ ...S.section, display: 'flex', alignItems: 'center', gap: 6, cursor: 'pointer', userSelect: 'none' as const }}
|
|
749
|
-
>
|
|
750
|
-
<span aria-hidden="true" style={{ fontSize: 11, width: 12, flexShrink: 0, textAlign: 'center' as const, opacity: 0.85 }}>{collapsed ? '▸' : '▾'}</span>
|
|
751
|
-
<span>{text}</span>
|
|
752
|
-
</div>
|
|
753
|
-
);
|
|
754
757
|
|
|
755
758
|
// --- jobs board (WPC10; workspace groups + lock badges: WPC13) ------------
|
|
756
759
|
const rows = jobsLoaded ? displayJobs(jobs, ghosts) : [];
|
|
@@ -819,13 +822,58 @@ function WorkersPanel({ ctx }: { ctx: any }) {
|
|
|
819
822
|
);
|
|
820
823
|
};
|
|
821
824
|
|
|
825
|
+
const runningJobs = jobsLoaded ? jobs.filter((j: any) => j.status === 'running' && j.originWriterAlive !== false).length : 0;
|
|
826
|
+
|
|
822
827
|
return (
|
|
823
828
|
<div style={{ display: 'flex', flexDirection: 'column', gap: 8, fontSize: 13, lineHeight: 1.55 }}>
|
|
824
829
|
<div style={{ fontSize: 19, fontWeight: 600, marginBottom: -2 }}>{copy.title}</div>
|
|
825
830
|
<div style={{ opacity: 0.75 }}>{copy.intro}</div>
|
|
826
831
|
|
|
827
|
-
{
|
|
828
|
-
|
|
832
|
+
<div role="tablist" aria-label={copy.title}
|
|
833
|
+
onKeyDown={(e: any) => {
|
|
834
|
+
if (e.key !== 'ArrowRight' && e.key !== 'ArrowLeft') return;
|
|
835
|
+
e.preventDefault();
|
|
836
|
+
const index = TABS.indexOf(tab);
|
|
837
|
+
const step = e.key === 'ArrowRight' ? 1 : TABS.length - 1;
|
|
838
|
+
setTab(TABS[(index + step) % TABS.length]);
|
|
839
|
+
}}
|
|
840
|
+
style={{
|
|
841
|
+
position: 'sticky', top: 0, zIndex: 6, display: 'flex', gap: 2, marginTop: 2,
|
|
842
|
+
paddingTop: 4, marginBottom: -1,
|
|
843
|
+
background: 'Canvas',
|
|
844
|
+
borderBottom: '1px solid rgba(128,128,128,0.2)',
|
|
845
|
+
boxShadow: '0 1px 0 rgba(128,128,128,0.06)',
|
|
846
|
+
}}>
|
|
847
|
+
{([['integrations', copy.integrations], ['config', copy.globalConfig], ['history', copy.history]] as const).map(([key, label]) => {
|
|
848
|
+
const active = tab === key;
|
|
849
|
+
return (
|
|
850
|
+
<button key={key} type="button" role="tab" aria-selected={active} tabIndex={active ? 0 : -1}
|
|
851
|
+
onClick={() => setTab(key)}
|
|
852
|
+
onMouseEnter={(e: any) => { if (!active) e.currentTarget.style.background = 'rgba(128,128,128,0.10)'; }}
|
|
853
|
+
onMouseLeave={(e: any) => { e.currentTarget.style.background = 'transparent'; }}
|
|
854
|
+
style={{
|
|
855
|
+
display: 'inline-flex', alignItems: 'center',
|
|
856
|
+
padding: '6px 12px', fontSize: 12.5, border: 'none', background: 'transparent',
|
|
857
|
+
cursor: 'pointer', borderRadius: '6px 6px 0 0',
|
|
858
|
+
color: active ? 'inherit' : 'rgba(128,128,128,0.9)',
|
|
859
|
+
fontWeight: active ? 600 : 400,
|
|
860
|
+
borderBottom: `2px solid ${active ? '#4c8dff' : 'transparent'}`,
|
|
861
|
+
transition: 'color 120ms ease, border-color 120ms ease, background 120ms ease',
|
|
862
|
+
}}>
|
|
863
|
+
{label}
|
|
864
|
+
{key === 'history' && runningJobs > 0 && (
|
|
865
|
+
<span aria-label={String(runningJobs)} style={{
|
|
866
|
+
marginLeft: 6, minWidth: 16, height: 16, padding: '0 4px', borderRadius: 99,
|
|
867
|
+
background: '#4c8dff', color: '#fff', fontSize: 10.5, lineHeight: '16px',
|
|
868
|
+
textAlign: 'center', fontWeight: 600,
|
|
869
|
+
}}>{runningJobs}</span>
|
|
870
|
+
)}
|
|
871
|
+
</button>
|
|
872
|
+
);
|
|
873
|
+
})}
|
|
874
|
+
</div>
|
|
875
|
+
|
|
876
|
+
{tab === 'integrations' && (
|
|
829
877
|
<div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
|
|
830
878
|
{integrationRow('Claude Code', !!status?.claude?.installed,
|
|
831
879
|
status?.claude?.installed ? <span style={S.chip(!!status?.claude?.hud)}>{copy.hud}</span> : null,
|
|
@@ -849,8 +897,7 @@ function WorkersPanel({ ctx }: { ctx: any }) {
|
|
|
849
897
|
</div>
|
|
850
898
|
)}
|
|
851
899
|
|
|
852
|
-
{
|
|
853
|
-
{!globalConfigCollapsed && (<>
|
|
900
|
+
{tab === 'config' && (<>
|
|
854
901
|
{config && (<>
|
|
855
902
|
<div style={S.group}>{copy.groupDispatch}</div>
|
|
856
903
|
{block(copy.cardDispatch, (<>
|
|
@@ -1048,8 +1095,7 @@ function WorkersPanel({ ctx }: { ctx: any }) {
|
|
|
1048
1095
|
|
|
1049
1096
|
{notice !== '' && <div style={{ fontSize: 12, opacity: 0.8, whiteSpace: 'pre-wrap' }}>{notice}</div>}
|
|
1050
1097
|
|
|
1051
|
-
{
|
|
1052
|
-
{!historyCollapsed && (
|
|
1098
|
+
{tab === 'history' && (
|
|
1053
1099
|
<div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
|
|
1054
1100
|
<div style={{ display: 'flex', gap: 14, alignItems: 'center', flexWrap: 'wrap', fontSize: 12 }}>
|
|
1055
1101
|
<span>{copy.historyTotal}: <b>{historyAgg?.total ?? 0}</b></span>
|
|
@@ -1081,7 +1127,9 @@ function WorkersPanel({ ctx }: { ctx: any }) {
|
|
|
1081
1127
|
const secs = Number.isFinite(start) && Number.isFinite(end) && end >= start ? ((end - start) / 1000).toFixed(1) + 's' : '—';
|
|
1082
1128
|
const color = r.status === 'failed' ? '#e5484d' : r.status === 'done' ? '#3fb950' : undefined;
|
|
1083
1129
|
return (
|
|
1084
|
-
<tr key={r.id} style={{ borderTop: '1px solid rgba(128,128,128,0.14)' }}
|
|
1130
|
+
<tr key={r.id} style={{ borderTop: '1px solid rgba(128,128,128,0.14)', transition: 'background 120ms ease' }}
|
|
1131
|
+
onMouseEnter={(e: any) => { e.currentTarget.style.background = 'rgba(128,128,128,0.05)'; }}
|
|
1132
|
+
onMouseLeave={(e: any) => { e.currentTarget.style.background = 'transparent'; }}>
|
|
1085
1133
|
<td style={{ padding: '4px 6px', whiteSpace: 'nowrap' }}>{r.endedAt ? new Date(r.endedAt).toLocaleString() : '—'}</td>
|
|
1086
1134
|
<td style={{ padding: '4px 6px' }}>{r.tier ?? '—'}</td>
|
|
1087
1135
|
<td style={{ padding: '4px 6px' }}>{r.model ?? '—'}{r.effort ? ` @${r.effort}` : ''}</td>
|
|
@@ -1099,6 +1147,7 @@ function WorkersPanel({ ctx }: { ctx: any }) {
|
|
|
1099
1147
|
</div>
|
|
1100
1148
|
)}
|
|
1101
1149
|
|
|
1150
|
+
{tab === 'history' && (<>
|
|
1102
1151
|
<div style={S.section}>{copy.jobs}</div>
|
|
1103
1152
|
{!jobsLoaded || groups.length === 0 ? (
|
|
1104
1153
|
<div style={{ opacity: 0.55 }}>{copy.empty}</div>
|
|
@@ -1123,6 +1172,7 @@ function WorkersPanel({ ctx }: { ctx: any }) {
|
|
|
1123
1172
|
</table>
|
|
1124
1173
|
</div>
|
|
1125
1174
|
)}
|
|
1175
|
+
</>)}
|
|
1126
1176
|
{hoverTask && createPortal(
|
|
1127
1177
|
<div style={{
|
|
1128
1178
|
position: 'fixed', right: hoverTask.right, zIndex: 9999,
|
package/src/server.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import { acquireCwdLock, releaseCwdLockByJobId, updateCwdLockHolder, getCwdLocks
|
|
|
12
12
|
import { resolveWorkerCwd } from './paths.mjs';
|
|
13
13
|
import { detectOrchestrator } from './process-info.mjs';
|
|
14
14
|
|
|
15
|
-
const server = new McpServer({ name: 'dsh-adapter', version: '0.1.
|
|
15
|
+
const server = new McpServer({ name: 'dsh-adapter', version: '0.1.18' });
|
|
16
16
|
|
|
17
17
|
const tierSchema = z.enum(['flash', 'pro']).optional().describe('Worker model tier. flash = mechanical, well-scoped work (single-file edits, lookups, formatting); pro = multi-file changes, debugging, design judgment. Omit to use the session default. Ignored when worker= is set.');
|
|
18
18
|
const effortSchema = z.enum(['off', 'high', 'max']).optional().describe('Reasoning effort for the worker. Omit to use the session default. With worker= it only applies when passed explicitly and the profile supports it (agy maps to low/medium/high).');
|