@zoraxylia/dsh-codex-adapter 0.1.17 → 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 +83 -21
- package/lib/server.mjs +1 -1
- package/package.json +1 -1
- package/src/client/index.tsx +60 -16
- 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.",
|
|
@@ -1543,13 +1543,27 @@ function WorkersPanel({ ctx }) {
|
|
|
1543
1543
|
const integrationRow = (name, installed, extra, installTarget, uninstallTarget, tips) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1544
1544
|
style: S.card,
|
|
1545
1545
|
children: [
|
|
1546
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
1546
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
1547
1547
|
style: {
|
|
1548
|
+
display: "flex",
|
|
1549
|
+
alignItems: "center",
|
|
1550
|
+
gap: 7,
|
|
1548
1551
|
fontWeight: 600,
|
|
1549
1552
|
fontSize: 13,
|
|
1550
1553
|
minWidth: 92
|
|
1551
1554
|
},
|
|
1552
|
-
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]
|
|
1553
1567
|
}),
|
|
1554
1568
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
1555
1569
|
style: S.chip(installed),
|
|
@@ -1791,6 +1805,7 @@ function WorkersPanel({ ctx }) {
|
|
|
1791
1805
|
]
|
|
1792
1806
|
}, job.id);
|
|
1793
1807
|
};
|
|
1808
|
+
const runningJobs = jobsLoaded ? jobs.filter((j) => j.status === "running" && j.originWriterAlive !== false).length : 0;
|
|
1794
1809
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1795
1810
|
style: {
|
|
1796
1811
|
display: "flex",
|
|
@@ -1813,32 +1828,79 @@ function WorkersPanel({ ctx }) {
|
|
|
1813
1828
|
children: copy.intro
|
|
1814
1829
|
}),
|
|
1815
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
|
+
},
|
|
1816
1840
|
style: {
|
|
1841
|
+
position: "sticky",
|
|
1842
|
+
top: 0,
|
|
1843
|
+
zIndex: 6,
|
|
1817
1844
|
display: "flex",
|
|
1818
1845
|
gap: 2,
|
|
1846
|
+
marginTop: 2,
|
|
1847
|
+
paddingTop: 4,
|
|
1848
|
+
marginBottom: -1,
|
|
1849
|
+
background: "Canvas",
|
|
1819
1850
|
borderBottom: "1px solid rgba(128,128,128,0.2)",
|
|
1820
|
-
|
|
1851
|
+
boxShadow: "0 1px 0 rgba(128,128,128,0.06)"
|
|
1821
1852
|
},
|
|
1822
1853
|
children: [
|
|
1823
1854
|
["integrations", copy.integrations],
|
|
1824
1855
|
["config", copy.globalConfig],
|
|
1825
1856
|
["history", copy.history]
|
|
1826
|
-
].map(([key, label]) =>
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
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
|
+
})
|
|
1842
1904
|
}),
|
|
1843
1905
|
tab === "integrations" && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1844
1906
|
style: {
|
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',
|
|
@@ -726,8 +726,17 @@ function WorkersPanel({ ctx }: { ctx: any }) {
|
|
|
726
726
|
);
|
|
727
727
|
|
|
728
728
|
const integrationRow = (name: string, installed: boolean, extra: any, installTarget: string, uninstallTarget: string, tips: any) => (
|
|
729
|
-
<div style={S.card}
|
|
730
|
-
|
|
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>
|
|
731
740
|
<span style={S.chip(installed)}>{installed ? `● ${copy.installed}` : `○ ${copy.notInstalled}`}</span>
|
|
732
741
|
{extra}
|
|
733
742
|
<span style={{ flex: 1 }} />
|
|
@@ -813,22 +822,55 @@ function WorkersPanel({ ctx }: { ctx: any }) {
|
|
|
813
822
|
);
|
|
814
823
|
};
|
|
815
824
|
|
|
825
|
+
const runningJobs = jobsLoaded ? jobs.filter((j: any) => j.status === 'running' && j.originWriterAlive !== false).length : 0;
|
|
826
|
+
|
|
816
827
|
return (
|
|
817
828
|
<div style={{ display: 'flex', flexDirection: 'column', gap: 8, fontSize: 13, lineHeight: 1.55 }}>
|
|
818
829
|
<div style={{ fontSize: 19, fontWeight: 600, marginBottom: -2 }}>{copy.title}</div>
|
|
819
830
|
<div style={{ opacity: 0.75 }}>{copy.intro}</div>
|
|
820
831
|
|
|
821
|
-
<div
|
|
822
|
-
{(
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
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
|
+
})}
|
|
832
874
|
</div>
|
|
833
875
|
|
|
834
876
|
{tab === 'integrations' && (
|
|
@@ -1085,7 +1127,9 @@ function WorkersPanel({ ctx }: { ctx: any }) {
|
|
|
1085
1127
|
const secs = Number.isFinite(start) && Number.isFinite(end) && end >= start ? ((end - start) / 1000).toFixed(1) + 's' : '—';
|
|
1086
1128
|
const color = r.status === 'failed' ? '#e5484d' : r.status === 'done' ? '#3fb950' : undefined;
|
|
1087
1129
|
return (
|
|
1088
|
-
<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'; }}>
|
|
1089
1133
|
<td style={{ padding: '4px 6px', whiteSpace: 'nowrap' }}>{r.endedAt ? new Date(r.endedAt).toLocaleString() : '—'}</td>
|
|
1090
1134
|
<td style={{ padding: '4px 6px' }}>{r.tier ?? '—'}</td>
|
|
1091
1135
|
<td style={{ padding: '4px 6px' }}>{r.model ?? '—'}{r.effort ? ` @${r.effort}` : ''}</td>
|
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).');
|