@shuind/dsh-codex-harness 0.1.39 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,42 @@
1
+ /** Default plugin-owned Codex operating prompt. */
2
+ export const DEFAULT_CODEX_SYSTEM_PROMPT = String.raw `## General
3
+
4
+ - When searching for text or files, prefer using rg or rg --files respectively because rg is much faster than alternatives like grep. If rg is not available, use the next best alternative.
5
+
6
+ ## Editing constraints
7
+
8
+ - Default to ASCII when editing or creating files. Only introduce non-ASCII or other Unicode characters when there is a clear justification and the file already uses them.
9
+ - Add succinct code comments that explain non-obvious code. Do not add comments that merely narrate assignments or control flow.
10
+ - You may be in a dirty git worktree. Never revert existing changes you did not make unless the user explicitly requests it. If unrelated files are changed, leave them alone.
11
+
12
+ ## Planning
13
+
14
+ - Use update_plan for work with multiple meaningful steps. Keep the plan current as the task progresses.
15
+ - Do not use a plan for a trivial one-step request.
16
+
17
+ ## dsh session
18
+
19
+ - The user and you share one workspace. Inspect the repository and every applicable AGENTS.md before editing.
20
+
21
+ ## Task execution
22
+
23
+ - Keep the user informed with concise progress updates and lead with the result.
24
+
25
+ ## Presenting your work
26
+
27
+ - Be concise, direct, friendly, and actionable.
28
+ - For substantial work, explain what changed and why, then briefly note how the work was verified and what comes next.
29
+ - Do not dump large files into the conversation; refer to their paths.
30
+ - Use plain text with short sections only when they improve scanability.
31
+
32
+ ## Working principles
33
+
34
+ - Ask, align, and clarify first. Gather enough context from the user, then align the approach to achieve the user's goal through the clearest, most effective path.
35
+ - Keep only the essential logic and core actions. There's no need to explain or test what was removed or why something wasn't done, especially when writing documentation or communicating. Convey enough valuable information with as few words as possible.
36
+ - Solve problems by thinking from first principles and at a higher level.
37
+ `;
38
+ /** Resolve the full plugin-owned prompt, preserving intentional empty overrides. */
39
+ export function resolveCodexSystemPrompt(systemPrompt) {
40
+ return systemPrompt ?? DEFAULT_CODEX_SYSTEM_PROMPT;
41
+ }
42
+ //# sourceMappingURL=prompt.js.map
@@ -0,0 +1,16 @@
1
+ /** Shared host-side Codex settings contract. */
2
+ import z from '@deepseek-ai/schemastery';
3
+ /** Live Codex controls shared by the Web UI and agent layer. */
4
+ export declare const CODEX_SETTINGS_NAMESPACE: Branded<"SettingsNamespace">;
5
+ export interface CodexSettings {
6
+ /** Use the Responses priority service tier for GPT requests. */
7
+ fast: boolean;
8
+ /** Optional context capacity override, in tokens. */
9
+ contextWindow?: number;
10
+ /** Complete plugin-owned Codex operating prompt. */
11
+ systemPrompt?: string;
12
+ }
13
+ /** Default settings exposed even before a Codex session is opened. */
14
+ export declare const CODEX_SETTINGS_ENTRY: CodexSettings;
15
+ export declare const CODEX_SETTINGS_SCHEMA: z<CodexSettings>;
16
+ //# sourceMappingURL=settings.d.ts.map
@@ -0,0 +1,18 @@
1
+ /** Shared host-side Codex settings contract. */
2
+ import z from '@deepseek-ai/schemastery';
3
+ import { settingsNamespace } from '@deepseek-ai/dsh-settings';
4
+ import { CODEX_CONTEXT_MAX } from "./context.js";
5
+ import { DEFAULT_CODEX_SYSTEM_PROMPT } from "./prompt.js";
6
+ /** Live Codex controls shared by the Web UI and agent layer. */
7
+ export const CODEX_SETTINGS_NAMESPACE = settingsNamespace('codex');
8
+ /** Default settings exposed even before a Codex session is opened. */
9
+ export const CODEX_SETTINGS_ENTRY = {
10
+ fast: false,
11
+ systemPrompt: DEFAULT_CODEX_SYSTEM_PROMPT,
12
+ };
13
+ export const CODEX_SETTINGS_SCHEMA = z.object({
14
+ fast: z.boolean().default(false),
15
+ contextWindow: z.number().step(1).min(1).max(CODEX_CONTEXT_MAX),
16
+ systemPrompt: z.string().default(DEFAULT_CODEX_SYSTEM_PROMPT),
17
+ });
18
+ //# sourceMappingURL=settings.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shuind/dsh-codex-harness",
3
- "version": "0.1.39",
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.",
3
+ "version": "0.2.0",
4
+ "description": "Codex coding preset with customizable prompts and tools for DSH.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "types": "lib/types/index.d.ts",
@@ -39,7 +39,6 @@
39
39
  "lib/types/**/*.d.ts",
40
40
  "lib/client.js",
41
41
  "cordis.patch.yml",
42
- "presets/codex",
43
42
  "presets/codex-collaboration",
44
43
  "README.md",
45
44
  "README.zh.md",
@@ -75,7 +74,8 @@
75
74
  "@deepseek-ai/dsh-client-locale",
76
75
  "@deepseek-ai/dsh-client-runtime",
77
76
  "@deepseek-ai/dsh-client-ui-conversation",
78
- "@deepseek-ai/dsh-client-ui-settings"
77
+ "@deepseek-ai/dsh-client-ui-settings",
78
+ "@deepseek-ai/dsh-client-ui-settings-plugins"
79
79
  ],
80
80
  "platform": "web"
81
81
  }
@@ -91,6 +91,7 @@
91
91
  "@deepseek-ai/dsh-client-runtime": ">=0.1.0-rc.8",
92
92
  "@deepseek-ai/dsh-client-ui-conversation": ">=0.1.0-rc.8",
93
93
  "@deepseek-ai/dsh-client-ui-settings": ">=0.1.0-rc.8",
94
+ "@deepseek-ai/dsh-client-ui-settings-plugins": ">=0.1.0-rc.8",
94
95
  "@deepseek-ai/dsh-client-ui-slots": ">=0.1.0-rc.8",
95
96
  "@deepseek-ai/dsh-compaction": ">=0.1.0-rc.8",
96
97
  "@deepseek-ai/dsh-compaction-basic": ">=0.1.0-rc.8",
@@ -133,6 +134,9 @@
133
134
  "@deepseek-ai/dsh-client-ui-settings": {
134
135
  "optional": true
135
136
  },
137
+ "@deepseek-ai/dsh-client-ui-settings-plugins": {
138
+ "optional": true
139
+ },
136
140
  "@deepseek-ai/dsh-client-ui-slots": {
137
141
  "optional": true
138
142
  },
@@ -1,5 +1,5 @@
1
- # The Codex agent preset. The bundle installs this file into the DSH user
2
- # preset root on first boot; the tool row is deliberately not global.
1
+ # The single bundled Codex preset. Its complete operating prompt, including
2
+ # the working principles, is editable from Settings > Plugins.
3
3
 
4
4
  - id: persona
5
5
  name: '@deepseek-ai/dsh-persona'
@@ -14,12 +14,10 @@
14
14
  config:
15
15
  maxBytes: 65536
16
16
 
17
- # This is the complete model-facing Codex layer. It owns the prompt overlay
18
- # and the four Codex core tool names; execution remains delegated to dsh.
17
+ # The Codex layer owns its prompt overlay and core tool names; execution
18
+ # remains delegated to dsh.
19
19
  - id: codex-tools
20
20
  name: '@shuind/dsh-codex-harness'
21
- config:
22
- collaborationPrompt: true
23
21
 
24
22
  # Background-job guidance and completion delivery belong to the official
25
23
  # dsh-tool-jobs plugin. Use wakeup delivery so an idle agent also learns about
@@ -1,3 +1,3 @@
1
- name: Codex 协作模式
2
- description: 额外加入协作提示词,预期获得更好的体验。
3
- order: 6
1
+ name: Codex 模式
2
+ description: 使用可自定义提示词与 Codex 工具的编码 Agent。
3
+ order: 5
@@ -1,195 +0,0 @@
1
- # The Codex agent preset. The bundle installs this file into the DSH user
2
- # preset root on first boot; the tool row is deliberately not global.
3
-
4
- - id: persona
5
- name: '@deepseek-ai/dsh-persona'
6
- config:
7
- # Keep identity, model, cwd, and runtime context in one persona section.
8
- text: >-
9
- You are Codex, a coding agent based on the {{model}} model. Your working directory is {{cwd}}.
10
- includeRuntimeContext: true
11
-
12
- - id: agent-instructions
13
- name: '@deepseek-ai/dsh-agent-instructions'
14
- config:
15
- maxBytes: 65536
16
-
17
- # This is the complete model-facing Codex layer. It owns the prompt overlay
18
- # and the four Codex core tool names; execution remains delegated to dsh.
19
- - id: codex-tools
20
- name: '@shuind/dsh-codex-harness'
21
- config:
22
- collaborationPrompt: false
23
-
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
- - id: codex-jobs
28
- name: '@deepseek-ai/dsh-tool-jobs'
29
- config:
30
- completionDelivery: wakeup
31
-
32
- # The generic DSH pi-ai adapter still owns the user's configured provider,
33
- # endpoint, API key, and model. Codex's remote-first transport wrapper is
34
- # installed only in this Codex scope and falls back to the generic DSH path.
35
-
36
- # Keep the local tool mounted as the fallback. Codex rewrites the final GPT
37
- # Responses request to a hosted web_search tool first; a failed remote request
38
- # is retried through this unchanged local function-tool path.
39
- - id: codex-web-search
40
- name: '@deepseek-ai/dsh-tool-web'
41
- config:
42
- search: true
43
- fetch: false
44
-
45
- # PTY execution is optional. Pipe-backed exec_command remains available on all
46
- # platforms through the shell capability consumed by the Codex tool layer.
47
- - id: codex-terminal
48
- name: cordis:group
49
- group: true
50
- isolate:
51
- terminals: true
52
- config:
53
- - id: terminals
54
- name: '@deepseek-ai/dsh-terminal'
55
-
56
- - id: terminal-bash
57
- name: '@deepseek-ai/dsh-terminal-bash'
58
- disabled: !!js process.platform === 'win32'
59
- config:
60
- timeoutMs: 300000
61
-
62
- # Context compaction is agent-scoped in Web. The token meter stays on the host
63
- # plane, while this group owns the backend, `/compact`, and optional tool-result
64
- # pruning for Codex sessions.
65
- - id: compaction
66
- name: cordis:group
67
- group: true
68
- isolate:
69
- compaction: true
70
- toolResultPruner: true
71
- config:
72
- - id: compaction-basic
73
- name: '@shuind/dsh-codex-harness/compaction'
74
- config:
75
- thresholdRatio: 0.95
76
-
77
- - id: command-compact
78
- name: '@deepseek-ai/dsh-command-compact'
79
-
80
- - id: tool-result-pruner
81
- name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
82
- config:
83
- thresholdChars: 8192
84
- headChars: 4096
85
- tailChars: 1024
86
-
87
- # Skills are the dsh extensibility seam and do not change the four Codex core
88
- # tool names.
89
- - id: skill-filesystem
90
- name: '@deepseek-ai/dsh-skill-filesystem'
91
-
92
- - id: tool-skill
93
- name: '@deepseek-ai/dsh-tool-skill'
94
-
95
- # Goal state remains host-owned and session-keyed. This row adds the official
96
- # model-facing goal lifecycle without moving the goal service into the preset.
97
- - id: tool-goal
98
- name: '@deepseek-ai/dsh-tool-goal'
99
-
100
- # Official plan mode supplies the reviewed exit_plan_mode flow. Keep the
101
- # Codex update_plan and todo_write tools out of this planning phase.
102
- - id: planning
103
- name: cordis:group
104
- group: true
105
- isolate:
106
- planMode: true
107
- config:
108
- - id: plan-mode
109
- name: '@deepseek-ai/dsh-plan-mode'
110
- config:
111
- section: |
112
- 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.
113
-
114
- 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.
115
-
116
- 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.
117
-
118
- 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.
119
-
120
- 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.
121
-
122
- 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.
123
-
124
- # Continuable delegation and workflow execution are official model-facing
125
- # capabilities. Their registries and providers stay in the host composition.
126
- - id: delegation
127
- name: cordis:group
128
- group: true
129
- isolate:
130
- workflowEngine: true
131
- config:
132
- - id: tool-subagent-control
133
- name: '@deepseek-ai/dsh-tool-subagent-control'
134
-
135
- - id: tool-subagent-list-agents
136
- name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
137
-
138
- - id: tool-subagent
139
- name: '@deepseek-ai/dsh-tool-subagent'
140
- config:
141
- provider: spawn
142
- toolName: subagent
143
- modelSelectionSettings: true
144
- backgroundMode: continuable
145
-
146
- - id: tool-subagent-fork
147
- name: '@deepseek-ai/dsh-tool-subagent'
148
- config:
149
- provider: fork
150
- toolName: subagent_fork
151
- backgroundMode: continuable
152
-
153
- # Optional providers remain disabled until their matching Bundle is
154
- # installed in the host profile.
155
- - id: tool-subagent-codex
156
- name: '@deepseek-ai/dsh-tool-subagent'
157
- disabled: true
158
- config:
159
- provider: codex
160
- toolName: subagent_codex
161
- backgroundMode: one-shot
162
- maxDepth: provider-managed
163
-
164
- - id: tool-subagent-claude-code
165
- name: '@deepseek-ai/dsh-tool-subagent'
166
- disabled: true
167
- config:
168
- provider: claude-code
169
- toolName: subagent_claude_code
170
- backgroundMode: one-shot
171
- maxDepth: provider-managed
172
-
173
- - id: workflow-worker-thread
174
- name: '@deepseek-ai/dsh-workflow-worker-thread'
175
- config:
176
- provider: spawn
177
-
178
- - id: tool-workflow
179
- name: '@deepseek-ai/dsh-tool-workflow'
180
-
181
- - id: tool-ralph
182
- name: '@deepseek-ai/dsh-tool-ralph'
183
- config:
184
- subagentProvider: spawn
185
- maxRounds: 64
186
-
187
- # These official tools provide the interactive question surface and the
188
- # durable whole-list task view alongside Codex-compatible update_plan.
189
- - id: tool-ask-user
190
- name: '@deepseek-ai/dsh-tool-ask-user'
191
-
192
- - id: tool-todo
193
- name: '@deepseek-ai/dsh-tool-todo'
194
- config:
195
- allowParallelInProgress: true
@@ -1,3 +0,0 @@
1
- name: Codex 模式
2
- description: 使用精简版 Codex 提示词和工具,以及改善体验的功能。
3
- order: 5