@shuind/dsh-codex-harness 0.1.34 → 0.1.36
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 +5 -4
- package/lib/client.js +68 -14
- package/lib/types/client/index.d.ts +11 -1
- package/lib/types/client/index.js +68 -17
- package/package.json +1 -1
- package/presets/codex/agent.cordis.yml +106 -4
- package/presets/codex-collaboration/agent.cordis.yml +106 -4
package/README.md
CHANGED
|
@@ -6,10 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
- **精简 Codex coding-agent 提示词**:使用精简版系统提示词;身份、模型和工作目录由 `dsh-persona` 提供,避免重复的 Harness 身份说明,同时保留必要的工具契约和编码工作流。
|
|
8
8
|
- **Codex 工具**:`exec_command`、`write_stdin`、`apply_patch`、`update_plan`;`apply_patch` 匹配失败时会显示文件、hunk、行号、可见空白和附近文件内容,便于修正上下文。
|
|
9
|
-
- **后台任务**:`exec_command` 支持 `run_in_background: true`,立即返回 DSH `job_id
|
|
9
|
+
- **后台任务**:`exec_command` 支持 `run_in_background: true`,立即返回 DSH `job_id`;`job_output`、`job_list`、`job_kill` 以及完成通知和对应提示词均由 `@deepseek-ai/dsh-tool-jobs` 提供,Codex 层不重复注入后台任务管理提示。随包 preset 使用官方 `wakeup` 投递策略,空闲 agent 也会自动收到完成通知。
|
|
10
10
|
- **GPT 能力补全**:为 GPT 系列模型补充图片输入和思考强度选项;不会覆盖用户已有的显式配置。
|
|
11
11
|
- **Fast**:仅在 Codex preset 的模型选择菜单中显示,开启后向 Responses 请求发送 `service_tier: "priority"`。
|
|
12
12
|
- **Legacy Web compatibility**: The plugin uses only slots present in the legacy host. The context-size control is appended to the host context-usage popup, and the activity line is appended beside `Deep diving...`; no host upgrade is required.
|
|
13
|
+
- **Official DSH capabilities**: The shipped Codex presets add the official goal, reviewed plan-mode, continuable subagent/workflow, user-question, and durable todo surfaces. Background-job guidance and completion notifications remain owned by `@deepseek-ai/dsh-tool-jobs`; the Codex layer does not duplicate that prompt.
|
|
13
14
|
- **Responses 原生 apply_patch**:在 GPT Responses 请求的插件传输边界,把普通 JSON function tool 改写为 `type: "custom"` + OpenAI `lark` grammar;下一轮历史同步改写为 `custom_tool_call`。如果中转站拒绝 custom tool,则自动回退到普通 function tool,不改变 DSH 工具执行器。
|
|
14
15
|
- **远程搜索与压缩**:OpenAI Responses 请求默认优先使用 hosted `web_search` 和 `/responses/compact`;失败时回退到 DSH 的本地实现。
|
|
15
16
|
- **远程压缩用量**:`/responses/compact` 返回标准 `usage` 时,插件会把 `input_tokens`、缓存读写和 `output_tokens` 原样拆分为 DSH 的用量字段;不再把远程压缩伪造成 `0`。中转站缺失或返回不一致的 usage 时,插件不会编造数字。
|
|
@@ -20,7 +21,7 @@
|
|
|
20
21
|
## 安装
|
|
21
22
|
|
|
22
23
|
```sh
|
|
23
|
-
dsh plugin --profile web add @shuind/dsh-codex-harness@0.1.
|
|
24
|
+
dsh plugin --profile web add @shuind/dsh-codex-harness@0.1.36
|
|
24
25
|
```
|
|
25
26
|
|
|
26
27
|
重启 Web,创建新会话,在模式菜单中选择 **Codex 模式**。
|
|
@@ -72,7 +73,7 @@ Codex 发起模型请求时,Web 会在 `Deep diving...` 右侧显示 `请求
|
|
|
72
73
|
|
|
73
74
|
它们分别位于 `${DSH_HOME:-$HOME/.dsh}/.agent-presets/codex/` 和 `${DSH_HOME:-$HOME/.dsh}/.agent-presets/codex-collaboration/`。如果对应目录已经存在,插件会保留你的文件,不会覆盖自定义内容。
|
|
74
75
|
|
|
75
|
-
在 Web 的 **Agent 预设** 中选择 **Codex 模式** 或 **Codex 协作模式**,再新建会话即可使用随包提供的 Codex
|
|
76
|
+
在 Web 的 **Agent 预设** 中选择 **Codex 模式** 或 **Codex 协作模式**,再新建会话即可使用随包提供的 Codex 工具、官方后台任务控制、目标、Plan mode、子 Agent/工作流、用户询问、todo、网页搜索、远程压缩和 Skills 组合。两套 preset 共用 Fast、思考强度、GPT 图片输入和上下文容量设置;只有系统提示词是否包含协作指导不同。
|
|
76
77
|
|
|
77
78
|
## 自定义 preset
|
|
78
79
|
|
|
@@ -96,7 +97,7 @@ Codex 发起模型请求时,Web 会在 `Deep diving...` 右侧显示 `请求
|
|
|
96
97
|
- id: codex-jobs
|
|
97
98
|
name: '@deepseek-ai/dsh-tool-jobs'
|
|
98
99
|
config:
|
|
99
|
-
completionDelivery:
|
|
100
|
+
completionDelivery: wakeup
|
|
100
101
|
```
|
|
101
102
|
|
|
102
103
|
再写入 `preset.yml`,让 Web 中显示更清晰的名称:
|
package/lib/client.js
CHANGED
|
@@ -284,15 +284,19 @@ window.__ModuleLoader__.load({
|
|
|
284
284
|
function elapsedSeconds(startedAt, now) {
|
|
285
285
|
return Math.max(0, Math.floor((now - startedAt) / 1e3));
|
|
286
286
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
const normalizedProjectedActivity = projectedActivity?.activity === "awaiting-model" ? {
|
|
287
|
+
/** Prefer the session snapshot when an older projection host only exposes null. */
|
|
288
|
+
function resolveActivity(agentPreset, projectedActivity, fallbackActivity) {
|
|
289
|
+
if (!isCodexPresetId(agentPreset)) return null;
|
|
290
|
+
if (projectedActivity?.activity === "awaiting-model") return {
|
|
292
291
|
activity: fallbackActivity?.activity ?? "requesting-model",
|
|
293
292
|
startedAt: fallbackActivity?.startedAt ?? projectedActivity.startedAt
|
|
294
|
-
}
|
|
295
|
-
|
|
293
|
+
};
|
|
294
|
+
if (projectedActivity === null) return fallbackActivity ?? null;
|
|
295
|
+
return projectedActivity ?? fallbackActivity ?? null;
|
|
296
|
+
}
|
|
297
|
+
function ActivityLine({ sessionId, useSession, useSessions, useProjection, t, position }) {
|
|
298
|
+
const agentPreset = useSessions((state) => state.byId[sessionId]?.agentPreset);
|
|
299
|
+
const activity = resolveActivity(agentPreset, useProjection("codexActivity"), useSession(modelActivity, sameModelActivity));
|
|
296
300
|
const [now, setNow] = (0, react.useState)(() => Date.now());
|
|
297
301
|
(0, react.useEffect)(() => {
|
|
298
302
|
if (!isCodexPresetId(agentPreset) || activity === void 0 || activity === null) return void 0;
|
|
@@ -316,12 +320,19 @@ window.__ModuleLoader__.load({
|
|
|
316
320
|
alignItems: "center",
|
|
317
321
|
gap: 7,
|
|
318
322
|
minHeight: 26,
|
|
319
|
-
marginLeft: 10,
|
|
323
|
+
marginLeft: position === void 0 ? 10 : 0,
|
|
320
324
|
color: "var(--dsw-alias-label-secondary)",
|
|
321
325
|
fontSize: 12,
|
|
322
326
|
lineHeight: "20px",
|
|
323
327
|
whiteSpace: "nowrap",
|
|
324
|
-
WebkitTextFillColor: "currentColor"
|
|
328
|
+
WebkitTextFillColor: "currentColor",
|
|
329
|
+
...position === void 0 ? {} : {
|
|
330
|
+
position: "fixed",
|
|
331
|
+
left: position.left,
|
|
332
|
+
top: position.top,
|
|
333
|
+
zIndex: 100,
|
|
334
|
+
pointerEvents: "none"
|
|
335
|
+
}
|
|
325
336
|
},
|
|
326
337
|
children: [
|
|
327
338
|
(0, react_jsx_runtime.jsx)("span", {
|
|
@@ -361,8 +372,48 @@ window.__ModuleLoader__.load({
|
|
|
361
372
|
return null;
|
|
362
373
|
}
|
|
363
374
|
function findTurnStatus() {
|
|
364
|
-
|
|
365
|
-
|
|
375
|
+
let fallback = null;
|
|
376
|
+
for (const status of document.querySelectorAll("[role=\"status\"]")) {
|
|
377
|
+
if (status.closest("[data-chat-flow]") === null) continue;
|
|
378
|
+
fallback ??= status;
|
|
379
|
+
if (status.textContent?.includes("Deep diving...") === true || status.className.toString().includes("turnStatus")) return status;
|
|
380
|
+
}
|
|
381
|
+
return fallback;
|
|
382
|
+
}
|
|
383
|
+
function useTurnStatusPosition(target) {
|
|
384
|
+
const [position, setPosition] = (0, react.useState)(null);
|
|
385
|
+
(0, react.useLayoutEffect)(() => {
|
|
386
|
+
if (target === null) {
|
|
387
|
+
setPosition(null);
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
const update = () => {
|
|
391
|
+
if (!target.isConnected) {
|
|
392
|
+
setPosition(null);
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
const rect = target.getBoundingClientRect();
|
|
396
|
+
if (rect.width === 0 && rect.height === 0) {
|
|
397
|
+
setPosition(null);
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
setPosition({
|
|
401
|
+
left: Math.round(rect.right + 10),
|
|
402
|
+
top: Math.round(rect.top + (rect.height - 26) / 2)
|
|
403
|
+
});
|
|
404
|
+
};
|
|
405
|
+
update();
|
|
406
|
+
window.addEventListener("resize", update);
|
|
407
|
+
window.addEventListener("scroll", update, true);
|
|
408
|
+
const observer = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver(update);
|
|
409
|
+
observer?.observe(target);
|
|
410
|
+
return () => {
|
|
411
|
+
window.removeEventListener("resize", update);
|
|
412
|
+
window.removeEventListener("scroll", update, true);
|
|
413
|
+
observer?.disconnect();
|
|
414
|
+
};
|
|
415
|
+
}, [target]);
|
|
416
|
+
return position;
|
|
366
417
|
}
|
|
367
418
|
function useLegacyHostTargets() {
|
|
368
419
|
const [targets, setTargets] = (0, react.useState)({
|
|
@@ -394,6 +445,7 @@ window.__ModuleLoader__.load({
|
|
|
394
445
|
function LegacyOverlay(props) {
|
|
395
446
|
const { sessionId, useSession, useSessions, useProjection, useSettings, setSetting, unsetSetting, t } = props;
|
|
396
447
|
const { contextDialog, turnStatus } = useLegacyHostTargets();
|
|
448
|
+
const turnStatusPosition = useTurnStatusPosition(turnStatus);
|
|
397
449
|
const contextWindow = contextWindowFromProjection(useProjection);
|
|
398
450
|
if (!isCodexPresetId(useSessions((state) => state.byId[sessionId]?.agentPreset))) return null;
|
|
399
451
|
return (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [contextDialog !== null && (0, react_dom.createPortal)((0, react_jsx_runtime.jsx)(ContextSizeControl, {
|
|
@@ -404,13 +456,14 @@ window.__ModuleLoader__.load({
|
|
|
404
456
|
setSetting,
|
|
405
457
|
unsetSetting,
|
|
406
458
|
t
|
|
407
|
-
}), contextDialog, "codex-context-size"),
|
|
459
|
+
}), contextDialog, "codex-context-size"), turnStatusPosition !== null && typeof document !== "undefined" && document.body !== null && (0, react_dom.createPortal)((0, react_jsx_runtime.jsx)(ActivityLine, {
|
|
408
460
|
sessionId,
|
|
409
461
|
useSession,
|
|
410
462
|
useSessions,
|
|
411
463
|
useProjection,
|
|
412
|
-
t
|
|
413
|
-
|
|
464
|
+
t,
|
|
465
|
+
position: turnStatusPosition
|
|
466
|
+
}), document.body, "codex-activity")] });
|
|
414
467
|
}
|
|
415
468
|
const inject = [
|
|
416
469
|
"slots",
|
|
@@ -453,6 +506,7 @@ window.__ModuleLoader__.load({
|
|
|
453
506
|
exports.apply = apply;
|
|
454
507
|
exports.default = client_default;
|
|
455
508
|
exports.inject = inject;
|
|
509
|
+
exports.resolveActivity = resolveActivity;
|
|
456
510
|
return module.exports;
|
|
457
511
|
}
|
|
458
512
|
});
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
import type { HostObservable, InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
3
3
|
import type { Context } from '@deepseek-ai/cordis';
|
|
4
4
|
import type { SettingsScope } from '@deepseek-ai/dsh-client-runtime/client';
|
|
5
|
+
import type { CodexActivity } from '../activity-types.ts';
|
|
6
|
+
import { modelActivity } from './activity.ts';
|
|
5
7
|
declare const LEGACY_OVERLAY_SLOT: "conversation.input.overlay";
|
|
6
8
|
interface CodexSettings {
|
|
7
9
|
fast: boolean;
|
|
@@ -43,7 +45,15 @@ interface InputSettingsControlInjected {
|
|
|
43
45
|
}
|
|
44
46
|
type LegacyOverlayProps = PropsRuntime<typeof LEGACY_OVERLAY_SLOT> & InjectFace<InputSettingsControlInjected> & PropsLocale<'codex'>;
|
|
45
47
|
type ActivityProps = Pick<LegacyOverlayProps, 'sessionId' | 'useSession' | 'useSessions' | 'useProjection' | 't'>;
|
|
46
|
-
|
|
48
|
+
type ActivityFallback = ReturnType<typeof modelActivity>;
|
|
49
|
+
/** Prefer the session snapshot when an older projection host only exposes null. */
|
|
50
|
+
export declare function resolveActivity(agentPreset: string | undefined, projectedActivity: CodexActivity | null | undefined, fallbackActivity: ActivityFallback): CodexActivity | null;
|
|
51
|
+
export declare function ActivityLine({ sessionId, useSession, useSessions, useProjection, t, position, }: ActivityProps & {
|
|
52
|
+
position?: {
|
|
53
|
+
left: number;
|
|
54
|
+
top: number;
|
|
55
|
+
};
|
|
56
|
+
}): import("react").JSX.Element | null;
|
|
47
57
|
export declare const inject: string[];
|
|
48
58
|
/** Mount all controls through the official composer seats shared by every DSH release. */
|
|
49
59
|
export declare function apply(ctx: Context): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
/** Browser controls for the Codex request settings mounted by the Host plugin. */
|
|
3
|
-
import { useEffect, useState } from 'react';
|
|
3
|
+
import { useEffect, useLayoutEffect, useState } from 'react';
|
|
4
4
|
import { createPortal } from 'react-dom';
|
|
5
5
|
import { CODEX_CONTEXT_MAX, CODEX_CONTEXT_UNIT, isCodexPresetId } from "../context.js";
|
|
6
6
|
import { modelActivity, sameModelActivity } from "./activity.js";
|
|
@@ -121,7 +121,21 @@ function ContextSizeControl({ contextWindow, sessionId, useSessions, useSettings
|
|
|
121
121
|
function elapsedSeconds(startedAt, now) {
|
|
122
122
|
return Math.max(0, Math.floor((now - startedAt) / 1_000));
|
|
123
123
|
}
|
|
124
|
-
|
|
124
|
+
/** Prefer the session snapshot when an older projection host only exposes null. */
|
|
125
|
+
export function resolveActivity(agentPreset, projectedActivity, fallbackActivity) {
|
|
126
|
+
if (!isCodexPresetId(agentPreset))
|
|
127
|
+
return null;
|
|
128
|
+
if (projectedActivity?.activity === 'awaiting-model') {
|
|
129
|
+
return {
|
|
130
|
+
activity: fallbackActivity?.activity ?? 'requesting-model',
|
|
131
|
+
startedAt: fallbackActivity?.startedAt ?? projectedActivity.startedAt,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
if (projectedActivity === null)
|
|
135
|
+
return fallbackActivity ?? null;
|
|
136
|
+
return projectedActivity ?? fallbackActivity ?? null;
|
|
137
|
+
}
|
|
138
|
+
export function ActivityLine({ sessionId, useSession, useSessions, useProjection, t, position, }) {
|
|
125
139
|
const agentPreset = useSessions(state => state.byId[sessionId]?.agentPreset);
|
|
126
140
|
// Keep the projection seam optional: this package must still load when the
|
|
127
141
|
// host has no session-projection registry or has not carried this key.
|
|
@@ -130,17 +144,7 @@ export function ActivityLine({ sessionId, useSession, useSessions, useProjection
|
|
|
130
144
|
// fallback only covers the short wire gap before the next projection frame;
|
|
131
145
|
// tool calls intentionally remain silent because their cards own the status.
|
|
132
146
|
const fallbackActivity = useSession(modelActivity, sameModelActivity);
|
|
133
|
-
|
|
134
|
-
// clear and must not be resurrected by the local snapshot fallback.
|
|
135
|
-
const normalizedProjectedActivity = projectedActivity?.activity === 'awaiting-model'
|
|
136
|
-
? {
|
|
137
|
-
activity: fallbackActivity?.activity ?? 'requesting-model',
|
|
138
|
-
startedAt: fallbackActivity?.startedAt ?? projectedActivity.startedAt,
|
|
139
|
-
}
|
|
140
|
-
: projectedActivity;
|
|
141
|
-
const activity = projectedActivity !== undefined ? normalizedProjectedActivity : (isCodexPresetId(agentPreset) && fallbackActivity !== undefined
|
|
142
|
-
? fallbackActivity
|
|
143
|
-
: null);
|
|
147
|
+
const activity = resolveActivity(agentPreset, projectedActivity, fallbackActivity);
|
|
144
148
|
const [now, setNow] = useState(() => Date.now());
|
|
145
149
|
useEffect(() => {
|
|
146
150
|
if (!isCodexPresetId(agentPreset) || activity === undefined || activity === null)
|
|
@@ -161,12 +165,19 @@ export function ActivityLine({ sessionId, useSession, useSessions, useProjection
|
|
|
161
165
|
alignItems: 'center',
|
|
162
166
|
gap: 7,
|
|
163
167
|
minHeight: 26,
|
|
164
|
-
marginLeft: 10,
|
|
168
|
+
marginLeft: position === undefined ? 10 : 0,
|
|
165
169
|
color: 'var(--dsw-alias-label-secondary)',
|
|
166
170
|
fontSize: 12,
|
|
167
171
|
lineHeight: '20px',
|
|
168
172
|
whiteSpace: 'nowrap',
|
|
169
173
|
WebkitTextFillColor: 'currentColor',
|
|
174
|
+
...(position === undefined ? {} : {
|
|
175
|
+
position: 'fixed',
|
|
176
|
+
left: position.left,
|
|
177
|
+
top: position.top,
|
|
178
|
+
zIndex: 100,
|
|
179
|
+
pointerEvents: 'none',
|
|
180
|
+
}),
|
|
170
181
|
}, children: [_jsx("span", { "aria-hidden": "true", style: {
|
|
171
182
|
width: 5,
|
|
172
183
|
height: 5,
|
|
@@ -191,12 +202,51 @@ function findContextMeterDialog() {
|
|
|
191
202
|
return null;
|
|
192
203
|
}
|
|
193
204
|
function findTurnStatus() {
|
|
205
|
+
let fallback = null;
|
|
194
206
|
for (const status of document.querySelectorAll('[role="status"]')) {
|
|
207
|
+
if (status.closest('[data-chat-flow]') === null)
|
|
208
|
+
continue;
|
|
209
|
+
fallback ??= status;
|
|
195
210
|
if (status.textContent?.includes('Deep diving...') === true
|
|
196
|
-
|
|
211
|
+
|| status.className.toString().includes('turnStatus'))
|
|
197
212
|
return status;
|
|
198
213
|
}
|
|
199
|
-
return
|
|
214
|
+
return fallback;
|
|
215
|
+
}
|
|
216
|
+
function useTurnStatusPosition(target) {
|
|
217
|
+
const [position, setPosition] = useState(null);
|
|
218
|
+
useLayoutEffect(() => {
|
|
219
|
+
if (target === null) {
|
|
220
|
+
setPosition(null);
|
|
221
|
+
return undefined;
|
|
222
|
+
}
|
|
223
|
+
const update = () => {
|
|
224
|
+
if (!target.isConnected) {
|
|
225
|
+
setPosition(null);
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
const rect = target.getBoundingClientRect();
|
|
229
|
+
if (rect.width === 0 && rect.height === 0) {
|
|
230
|
+
setPosition(null);
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
setPosition({
|
|
234
|
+
left: Math.round(rect.right + 10),
|
|
235
|
+
top: Math.round(rect.top + (rect.height - 26) / 2),
|
|
236
|
+
});
|
|
237
|
+
};
|
|
238
|
+
update();
|
|
239
|
+
window.addEventListener('resize', update);
|
|
240
|
+
window.addEventListener('scroll', update, true);
|
|
241
|
+
const observer = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(update);
|
|
242
|
+
observer?.observe(target);
|
|
243
|
+
return () => {
|
|
244
|
+
window.removeEventListener('resize', update);
|
|
245
|
+
window.removeEventListener('scroll', update, true);
|
|
246
|
+
observer?.disconnect();
|
|
247
|
+
};
|
|
248
|
+
}, [target]);
|
|
249
|
+
return position;
|
|
200
250
|
}
|
|
201
251
|
function useLegacyHostTargets() {
|
|
202
252
|
const [targets, setTargets] = useState({ contextDialog: null, turnStatus: null });
|
|
@@ -227,11 +277,12 @@ function useLegacyHostTargets() {
|
|
|
227
277
|
function LegacyOverlay(props) {
|
|
228
278
|
const { sessionId, useSession, useSessions, useProjection, useSettings, setSetting, unsetSetting, t, } = props;
|
|
229
279
|
const { contextDialog, turnStatus } = useLegacyHostTargets();
|
|
280
|
+
const turnStatusPosition = useTurnStatusPosition(turnStatus);
|
|
230
281
|
const contextWindow = contextWindowFromProjection(useProjection);
|
|
231
282
|
const agentPreset = useSessions(state => state.byId[sessionId]?.agentPreset);
|
|
232
283
|
if (!isCodexPresetId(agentPreset))
|
|
233
284
|
return null;
|
|
234
|
-
return (_jsxs(_Fragment, { children: [contextDialog !== null && createPortal(_jsx(ContextSizeControl, { contextWindow: contextWindow, sessionId: sessionId, useSessions: useSessions, useSettings: useSettings, setSetting: setSetting, unsetSetting: unsetSetting, t: t }), contextDialog, 'codex-context-size'),
|
|
285
|
+
return (_jsxs(_Fragment, { children: [contextDialog !== null && createPortal(_jsx(ContextSizeControl, { contextWindow: contextWindow, sessionId: sessionId, useSessions: useSessions, useSettings: useSettings, setSetting: setSetting, unsetSetting: unsetSetting, t: t }), contextDialog, 'codex-context-size'), turnStatusPosition !== null && typeof document !== 'undefined' && document.body !== null && createPortal(_jsx(ActivityLine, { sessionId: sessionId, useSession: useSession, useSessions: useSessions, useProjection: useProjection, t: t, position: turnStatusPosition }), document.body, 'codex-activity')] }));
|
|
235
286
|
}
|
|
236
287
|
export const inject = ['slots', 'locale', 'settingsScope'];
|
|
237
288
|
/** Mount all controls through the official composer seats shared by every DSH release. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shuind/dsh-codex-harness",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.36",
|
|
4
4
|
"description": "A Codex harness with a streamlined system prompt for GPT models that do not fit DSH's native interface, while remaining compatible with the DSH plugin ecosystem.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
config:
|
|
22
22
|
collaborationPrompt: false
|
|
23
23
|
|
|
24
|
-
# Background
|
|
25
|
-
#
|
|
26
|
-
#
|
|
24
|
+
# Background-job guidance and completion delivery belong to the official
|
|
25
|
+
# dsh-tool-jobs plugin. Use wakeup delivery so an idle agent also learns about
|
|
26
|
+
# a completed job without needing a separate user/tool wake.
|
|
27
27
|
- id: codex-jobs
|
|
28
28
|
name: '@deepseek-ai/dsh-tool-jobs'
|
|
29
29
|
config:
|
|
30
|
-
completionDelivery:
|
|
30
|
+
completionDelivery: wakeup
|
|
31
31
|
|
|
32
32
|
# The generic DSH pi-ai adapter still owns the user's configured provider,
|
|
33
33
|
# endpoint, API key, and model. Codex's remote-first transport wrapper is
|
|
@@ -89,3 +89,105 @@
|
|
|
89
89
|
|
|
90
90
|
- id: tool-skill
|
|
91
91
|
name: '@deepseek-ai/dsh-tool-skill'
|
|
92
|
+
|
|
93
|
+
# Goal state remains host-owned and session-keyed. This row adds the official
|
|
94
|
+
# model-facing goal lifecycle without moving the goal service into the preset.
|
|
95
|
+
- id: tool-goal
|
|
96
|
+
name: '@deepseek-ai/dsh-tool-goal'
|
|
97
|
+
|
|
98
|
+
# Official plan mode supplies the reviewed exit_plan_mode flow. Keep the
|
|
99
|
+
# Codex update_plan and todo_write tools out of this planning phase.
|
|
100
|
+
- id: planning
|
|
101
|
+
name: cordis:group
|
|
102
|
+
group: true
|
|
103
|
+
isolate:
|
|
104
|
+
planMode: true
|
|
105
|
+
config:
|
|
106
|
+
- id: plan-mode
|
|
107
|
+
name: '@deepseek-ai/dsh-plan-mode'
|
|
108
|
+
config:
|
|
109
|
+
section: |
|
|
110
|
+
You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement, including an answer confirming something you asked, approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
|
|
111
|
+
|
|
112
|
+
Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
|
|
113
|
+
|
|
114
|
+
The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override later tool descriptions or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use update_plan or todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
|
|
115
|
+
|
|
116
|
+
Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
|
|
117
|
+
|
|
118
|
+
Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
|
|
119
|
+
|
|
120
|
+
When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
|
|
121
|
+
|
|
122
|
+
# Continuable delegation and workflow execution are official model-facing
|
|
123
|
+
# capabilities. Their registries and providers stay in the host composition.
|
|
124
|
+
- id: delegation
|
|
125
|
+
name: cordis:group
|
|
126
|
+
group: true
|
|
127
|
+
isolate:
|
|
128
|
+
workflowEngine: true
|
|
129
|
+
config:
|
|
130
|
+
- id: tool-subagent-control
|
|
131
|
+
name: '@deepseek-ai/dsh-tool-subagent-control'
|
|
132
|
+
|
|
133
|
+
- id: tool-subagent-list-agents
|
|
134
|
+
name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
|
|
135
|
+
|
|
136
|
+
- id: tool-subagent
|
|
137
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
138
|
+
config:
|
|
139
|
+
provider: spawn
|
|
140
|
+
toolName: subagent
|
|
141
|
+
modelSelectionSettings: true
|
|
142
|
+
backgroundMode: continuable
|
|
143
|
+
|
|
144
|
+
- id: tool-subagent-fork
|
|
145
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
146
|
+
config:
|
|
147
|
+
provider: fork
|
|
148
|
+
toolName: subagent_fork
|
|
149
|
+
backgroundMode: continuable
|
|
150
|
+
|
|
151
|
+
# Optional providers remain disabled until their matching Bundle is
|
|
152
|
+
# installed in the host profile.
|
|
153
|
+
- id: tool-subagent-codex
|
|
154
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
155
|
+
disabled: true
|
|
156
|
+
config:
|
|
157
|
+
provider: codex
|
|
158
|
+
toolName: subagent_codex
|
|
159
|
+
backgroundMode: one-shot
|
|
160
|
+
maxDepth: provider-managed
|
|
161
|
+
|
|
162
|
+
- id: tool-subagent-claude-code
|
|
163
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
164
|
+
disabled: true
|
|
165
|
+
config:
|
|
166
|
+
provider: claude-code
|
|
167
|
+
toolName: subagent_claude_code
|
|
168
|
+
backgroundMode: one-shot
|
|
169
|
+
maxDepth: provider-managed
|
|
170
|
+
|
|
171
|
+
- id: workflow-worker-thread
|
|
172
|
+
name: '@deepseek-ai/dsh-workflow-worker-thread'
|
|
173
|
+
config:
|
|
174
|
+
provider: spawn
|
|
175
|
+
|
|
176
|
+
- id: tool-workflow
|
|
177
|
+
name: '@deepseek-ai/dsh-tool-workflow'
|
|
178
|
+
|
|
179
|
+
- id: tool-ralph
|
|
180
|
+
name: '@deepseek-ai/dsh-tool-ralph'
|
|
181
|
+
config:
|
|
182
|
+
subagentProvider: spawn
|
|
183
|
+
maxRounds: 64
|
|
184
|
+
|
|
185
|
+
# These official tools provide the interactive question surface and the
|
|
186
|
+
# durable whole-list task view alongside Codex-compatible update_plan.
|
|
187
|
+
- id: tool-ask-user
|
|
188
|
+
name: '@deepseek-ai/dsh-tool-ask-user'
|
|
189
|
+
|
|
190
|
+
- id: tool-todo
|
|
191
|
+
name: '@deepseek-ai/dsh-tool-todo'
|
|
192
|
+
config:
|
|
193
|
+
allowParallelInProgress: true
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
config:
|
|
22
22
|
collaborationPrompt: true
|
|
23
23
|
|
|
24
|
-
# Background
|
|
25
|
-
#
|
|
26
|
-
#
|
|
24
|
+
# Background-job guidance and completion delivery belong to the official
|
|
25
|
+
# dsh-tool-jobs plugin. Use wakeup delivery so an idle agent also learns about
|
|
26
|
+
# a completed job without needing a separate user/tool wake.
|
|
27
27
|
- id: codex-jobs
|
|
28
28
|
name: '@deepseek-ai/dsh-tool-jobs'
|
|
29
29
|
config:
|
|
30
|
-
completionDelivery:
|
|
30
|
+
completionDelivery: wakeup
|
|
31
31
|
|
|
32
32
|
# The generic DSH pi-ai adapter still owns the user's configured provider,
|
|
33
33
|
# endpoint, API key, and model. Codex's remote-first transport wrapper is
|
|
@@ -89,3 +89,105 @@
|
|
|
89
89
|
|
|
90
90
|
- id: tool-skill
|
|
91
91
|
name: '@deepseek-ai/dsh-tool-skill'
|
|
92
|
+
|
|
93
|
+
# Goal state remains host-owned and session-keyed. This row adds the official
|
|
94
|
+
# model-facing goal lifecycle without moving the goal service into the preset.
|
|
95
|
+
- id: tool-goal
|
|
96
|
+
name: '@deepseek-ai/dsh-tool-goal'
|
|
97
|
+
|
|
98
|
+
# Official plan mode supplies the reviewed exit_plan_mode flow. Keep the
|
|
99
|
+
# Codex update_plan and todo_write tools out of this planning phase.
|
|
100
|
+
- id: planning
|
|
101
|
+
name: cordis:group
|
|
102
|
+
group: true
|
|
103
|
+
isolate:
|
|
104
|
+
planMode: true
|
|
105
|
+
config:
|
|
106
|
+
- id: plan-mode
|
|
107
|
+
name: '@deepseek-ai/dsh-plan-mode'
|
|
108
|
+
config:
|
|
109
|
+
section: |
|
|
110
|
+
You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement, including an answer confirming something you asked, approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
|
|
111
|
+
|
|
112
|
+
Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
|
|
113
|
+
|
|
114
|
+
The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override later tool descriptions or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use update_plan or todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
|
|
115
|
+
|
|
116
|
+
Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
|
|
117
|
+
|
|
118
|
+
Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
|
|
119
|
+
|
|
120
|
+
When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
|
|
121
|
+
|
|
122
|
+
# Continuable delegation and workflow execution are official model-facing
|
|
123
|
+
# capabilities. Their registries and providers stay in the host composition.
|
|
124
|
+
- id: delegation
|
|
125
|
+
name: cordis:group
|
|
126
|
+
group: true
|
|
127
|
+
isolate:
|
|
128
|
+
workflowEngine: true
|
|
129
|
+
config:
|
|
130
|
+
- id: tool-subagent-control
|
|
131
|
+
name: '@deepseek-ai/dsh-tool-subagent-control'
|
|
132
|
+
|
|
133
|
+
- id: tool-subagent-list-agents
|
|
134
|
+
name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
|
|
135
|
+
|
|
136
|
+
- id: tool-subagent
|
|
137
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
138
|
+
config:
|
|
139
|
+
provider: spawn
|
|
140
|
+
toolName: subagent
|
|
141
|
+
modelSelectionSettings: true
|
|
142
|
+
backgroundMode: continuable
|
|
143
|
+
|
|
144
|
+
- id: tool-subagent-fork
|
|
145
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
146
|
+
config:
|
|
147
|
+
provider: fork
|
|
148
|
+
toolName: subagent_fork
|
|
149
|
+
backgroundMode: continuable
|
|
150
|
+
|
|
151
|
+
# Optional providers remain disabled until their matching Bundle is
|
|
152
|
+
# installed in the host profile.
|
|
153
|
+
- id: tool-subagent-codex
|
|
154
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
155
|
+
disabled: true
|
|
156
|
+
config:
|
|
157
|
+
provider: codex
|
|
158
|
+
toolName: subagent_codex
|
|
159
|
+
backgroundMode: one-shot
|
|
160
|
+
maxDepth: provider-managed
|
|
161
|
+
|
|
162
|
+
- id: tool-subagent-claude-code
|
|
163
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
164
|
+
disabled: true
|
|
165
|
+
config:
|
|
166
|
+
provider: claude-code
|
|
167
|
+
toolName: subagent_claude_code
|
|
168
|
+
backgroundMode: one-shot
|
|
169
|
+
maxDepth: provider-managed
|
|
170
|
+
|
|
171
|
+
- id: workflow-worker-thread
|
|
172
|
+
name: '@deepseek-ai/dsh-workflow-worker-thread'
|
|
173
|
+
config:
|
|
174
|
+
provider: spawn
|
|
175
|
+
|
|
176
|
+
- id: tool-workflow
|
|
177
|
+
name: '@deepseek-ai/dsh-tool-workflow'
|
|
178
|
+
|
|
179
|
+
- id: tool-ralph
|
|
180
|
+
name: '@deepseek-ai/dsh-tool-ralph'
|
|
181
|
+
config:
|
|
182
|
+
subagentProvider: spawn
|
|
183
|
+
maxRounds: 64
|
|
184
|
+
|
|
185
|
+
# These official tools provide the interactive question surface and the
|
|
186
|
+
# durable whole-list task view alongside Codex-compatible update_plan.
|
|
187
|
+
- id: tool-ask-user
|
|
188
|
+
name: '@deepseek-ai/dsh-tool-ask-user'
|
|
189
|
+
|
|
190
|
+
- id: tool-todo
|
|
191
|
+
name: '@deepseek-ai/dsh-tool-todo'
|
|
192
|
+
config:
|
|
193
|
+
allowParallelInProgress: true
|