@shuind/dsh-codex-harness 0.1.40 → 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.
package/README.md CHANGED
@@ -1,34 +1,29 @@
1
1
  # @shuind/dsh-codex-harness
2
2
 
3
- 使用精简版 Codex 提示词和工具,以及改善体验的功能。
3
+ 为 DSH 提供可自定义提示词与 Codex 工具的编码模式。
4
4
 
5
5
  ## 功能
6
6
 
7
- - **精简 Codex coding-agent 提示词**:使用精简版系统提示词;身份、模型和工作目录由 `dsh-persona` 提供,避免重复的 Harness 身份说明,同时保留必要的工具契约和编码工作流。
8
- - **Codex 工具**:`exec_command`、`write_stdin`、`apply_patch`、`update_plan`;`apply_patch` 匹配失败时会显示文件、hunk、行号、可见空白和附近文件内容,便于修正上下文。
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
- - **GPT 能力补全**:为 GPT 系列模型补充图片输入和思考强度选项;不会覆盖用户已有的显式配置。
11
- - **Fast**:仅在 Codex preset 的模型选择菜单中显示,开启后向 Responses 请求发送 `service_tier: "priority"`。
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.
14
- - **Responses 原生 apply_patch**:在 GPT Responses 请求的插件传输边界,把普通 JSON function tool 改写为 `type: "custom"` + OpenAI `lark` grammar;下一轮历史同步改写为 `custom_tool_call`。如果中转站拒绝 custom tool,则自动回退到普通 function tool,不改变 DSH 工具执行器。
15
- - **远程搜索与压缩**:OpenAI Responses 请求默认优先使用 hosted `web_search` 和 `/responses/compact`;失败时回退到 DSH 的本地实现。
16
- - **远程压缩用量**:`/responses/compact` 返回标准 `usage` 时,插件会把 `input_tokens`、缓存读写和 `output_tokens` 原样拆分为 DSH 的用量字段;不再把远程压缩伪造成 `0`。中转站缺失或返回不一致的 usage 时,插件不会编造数字。
17
- - **上下文容量**:在 Web 中设置 `1K`–`1000K` tokens,设置值作用于下一次请求。
18
- - **自动压缩阈值**:Codex preset 的自动压缩会读取最新请求持久化的有效上下文容量,并在 `95%` pressure threshold 触发;例如设置 `400K` 时阈值是 `380K`,不会错误地按适配器默认 `262,144` 在约 `210K` 提前触发。
19
- - **活动状态**:Codex 请求模型、接收模型回复或进行上下文压缩时,在 `Deep diving...` 右侧显示对应阶段和耗时,让长时间 Deep Diving 不再像卡住。
7
+ - 单一 **Codex 模式**,默认包含完整的编码规则与 Working principles。
8
+ - 在 **设置 → 插件 → 插件配置 → Codex Harness** 中查看、编辑或恢复完整提示词。
9
+ - 提供 `exec_command`、`write_stdin`、`apply_patch` 和 `update_plan`。
10
+ - 支持 Fast 请求、GPT 图片与思考强度、上下文容量和活动状态。
11
+ - Responses 请求优先使用原生 `apply_patch`、hosted `web_search` 和远程压缩,失败时回退到 DSH 实现。
12
+ - 随附 DSH 的后台任务、目标、Plan mode、子 Agent/工作流、用户询问、todo 与 Skills 组合。
20
13
 
21
14
  ## 安装
22
15
 
23
16
  ```sh
24
- dsh plugin --profile web add @shuind/dsh-codex-harness@0.1.40
17
+ dsh plugin --profile web add @shuind/dsh-codex-harness@0.2.0
25
18
  ```
26
19
 
27
- 重启 Web,创建新会话,在模式菜单中选择 **Codex 模式**。
20
+ 重启 Web,在 **Agent 预设** 中选择 **Codex 模式**,再创建会话。
28
21
 
29
22
  ## 配置
30
23
 
31
- 在 DSH 的 Models / `llm-pi-ai` 中配置 Responses provider、endpoint、API key 和模型。例如:
24
+ ### 模型
25
+
26
+ 在 DSH 的 Models 中配置支持 OpenAI Responses 的 provider、endpoint、API key 和 GPT 模型。例如:
32
27
 
33
28
  ```yaml
34
29
  api: openai-responses
@@ -36,107 +31,24 @@ baseURL: https://your-responses-endpoint.example.com
36
31
  apiKeyEnv: OPENAI_API_KEY
37
32
  ```
38
33
 
39
- 模型列表中填写中转站实际支持的 GPT 模型。
40
-
41
- ## 请求设置
42
-
43
- ### Fast
44
-
45
- Fast 与 `reasoning_effort` 独立。开启 Fast 后,GPT Responses 请求会携带:
46
-
47
- ```json
48
- {
49
- "service_tier": "priority"
50
- }
51
- ```
52
-
53
- Fast 设置保存在 `codex` 命名空间,只对 Codex preset 生效。
54
-
55
- ### 上下文容量
56
-
57
- 点击 Web 顶部的上下文使用量指示器,可以设置下一次请求的上下文容量。上方 meter 显示当前请求的实际容量;修改设置后,需要发送下一次请求才会更新。Codex preset 的自动压缩也使用这个已经持久化的有效容量。
58
-
59
- 上下文容量使用整数 K tokens,范围为 `1K` 到 `1000K`。实际可用上限仍取决于模型和中转站支持情况。
60
-
61
- ### 活动状态
62
-
63
- Codex 发起模型请求时,Web 会在 `Deep diving...` 右侧显示 `请求中... · Ns`;收到首个非空模型 token(非流式适配器则收到 `assistant/message`)后切换为 `回复中... · Ns`。模型回复结束、进入工具调用、压缩结束或下一轮开始后自动隐藏。该状态由 Host 的 `sessionProjections` 投影驱动,因此本地压缩和远程 `/responses/compact` 都会显示同一种状态。
64
-
65
- 如果当前 DSH 组合没有加载 projection 服务,插件会跳过注册,客户端也会自动隐藏这行,不影响普通会话。
66
-
67
- ## 随包提供的 Codex preset
68
-
69
- 安装插件后,首次启动对应的 DSH profile 时,插件会安装两套随包提供的 preset:
70
-
71
- - **Codex 模式**:使用精简版 Codex 提示词和工具,以及改善体验的功能。
72
- - **Codex 协作模式**:额外加入协作提示词,预期获得更好的体验。
73
-
74
- 它们分别位于 `${DSH_HOME:-$HOME/.dsh}/.agent-presets/codex/` 和 `${DSH_HOME:-$HOME/.dsh}/.agent-presets/codex-collaboration/`。如果对应目录已经存在,插件会保留你的文件,不会覆盖自定义内容。
34
+ 也可以配合 [dsh-codex-connect](https://github.com/shuind/dsh-codex-connect) 使用 ChatGPT 订阅模型。
75
35
 
76
- 在 Web 的 **Agent 预设** 中选择 **Codex 模式** 或 **Codex 协作模式**,再新建会话即可使用随包提供的 Codex 工具、官方后台任务控制、目标、Plan mode、子 Agent/工作流、用户询问、todo、网页搜索、远程压缩和 Skills 组合。两套 preset 共用 Fast、思考强度、GPT 图片输入和上下文容量设置;只有系统提示词是否包含协作指导不同。
36
+ ### 提示词
77
37
 
78
- ## 自定义 preset
38
+ 打开 **设置 → 插件 → 插件配置 → Codex Harness**。编辑器展示本插件实际注入的完整提示词;保存后从下一次请求开始生效,点击“恢复默认”可回到随包模板。
79
39
 
80
- 只有在想自己组合工具、提示词,或修改插件配置时才需要自定义 preset。自定义 preset 放在 `${DSH_HOME:-$HOME/.dsh}/.agent-presets/<id>/` 目录中。
40
+ 身份、模型、工作目录、工具说明和 DSH 运行时上下文由对应插件动态提供,不会写死在可编辑模板中。
81
41
 
82
- ### 示例:创建一个带协作提示词的 Codex preset
42
+ ### Fast 与上下文
83
43
 
84
- 例如创建目录 `${DSH_HOME:-$HOME/.dsh}/.agent-presets/my-codex/`,并写入 `agent.cordis.yml`:
44
+ - **Fast**:在 Codex 模式的模型菜单中开启,向 Responses 请求发送 `service_tier: "priority"`。
45
+ - **上下文容量**:点击输入栏旁的上下文用量指示器,可设置 `1K`–`1000K` tokens;下一次请求和自动压缩使用该值。
85
46
 
86
- ```yaml
87
- - id: persona
88
- name: '@deepseek-ai/dsh-persona'
89
- config:
90
- text: 你是一个使用 DSH 工具工作的 Codex 编程助手。
91
-
92
- - id: codex-tools
93
- name: '@shuind/dsh-codex-harness'
94
- config:
95
- collaborationPrompt: true
96
-
97
- - id: codex-jobs
98
- name: '@deepseek-ai/dsh-tool-jobs'
99
- config:
100
- completionDelivery: wakeup
101
- ```
102
-
103
- 再写入 `preset.yml`,让 Web 中显示更清晰的名称:
104
-
105
- ```yaml
106
- name: My Codex
107
- description: 使用 Codex 工具并开启可选协作提示词。
108
- order: 10
109
- ```
110
-
111
- 然后在 Web 的 **Agent 预设** 中选择 `My Codex`,再新建会话。这个 preset 会加载 Codex 工具,并开启协作提示词;网页搜索、远程压缩、后台任务控制和 Skills 等其他功能需要在同一个 `agent.cordis.yml` 中按需添加。若希望自定义 preset 也修正自动压缩阈值,请在 compaction 隔离组中使用 `@shuind/dsh-codex-harness/compaction` 替代 `@deepseek-ai/dsh-compaction-basic`。
112
-
113
- ### 可选协作提示词(私货)
114
-
115
- 这段提示词默认关闭,不会注入系统提示词。需要时,在自定义 `agent.cordis.yml` 中开启:
116
-
117
- ```yaml
118
- - id: codex-tools
119
- name: '@shuind/dsh-codex-harness'
120
- config:
121
- collaborationPrompt: true
122
- ```
123
-
124
- 开启后,Codex preset 会在系统提示词中注入以下协作要求:
125
-
126
- ```text
127
- ## Working principles
128
-
129
- 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.
130
- 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.
131
- Solve problems by thinking from first principles and at a higher level.
132
- ```
47
+ ## v0.2.0 迁移
133
48
 
134
- ## 注意事项
49
+ v0.2.0 将原来的两个内置模式合并为一个。安装器会升级未修改的旧 Codex 协作模式,并移除未修改的旧基础模式;检测到用户改动的 preset 会保留。
135
50
 
136
- - preset 在创建会话时确定;已有会话不会自动切换到 Codex 模式。
137
- - GPT 模型的图片输入和思考强度属于能力补全;用户已明确配置的字段会被保留。
138
- - hosted search、远程压缩以及 reasoning 参数的可用性取决于实际 Responses 中转站和模型。
139
- - `apply_patch` 的 custom grammar 改写只作用于 GPT Responses 请求;中转站必须接受 OpenAI custom tools 和 Lark grammar。拒绝时插件会自动发送原始 JSON function-call 请求。
51
+ preset 在创建会话时确定,已有会话不会自动切换。模型、中转站是否支持 hosted search、远程压缩、custom tools 和 priority tier,以实际服务为准。
140
52
 
141
53
  ## License
142
54
 
package/cordis.patch.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  - insert:
2
2
  # The bundle is host-plane installation only. The Codex tool/prompt row
3
- # lives in presets/codex/agent.cordis.yml, so other presets stay unchanged.
3
+ # lives in the bundled agent preset, so other presets stay unchanged.
4
4
  - id: codex-preset-installer
5
5
  name: '@shuind/dsh-codex-harness/installer'
6
6
  # Register the browser face as part of the bundle. Without this explicit
package/lib/client.js CHANGED
@@ -15,10 +15,49 @@ window.__ModuleLoader__.load({
15
15
  const CODEX_CONTEXT_UNIT = 1e3;
16
16
  const CODEX_CONTEXT_MAX = 1e6;
17
17
  const CODEX_PRESET_IDS = /* @__PURE__ */ new Set(["codex", "codex-collaboration"]);
18
- /** Both shipped presets use the same Codex request controls in Web. */
18
+ /** The bundled preset and legacy Codex sessions share the same Web controls. */
19
19
  function isCodexPresetId(value) {
20
20
  return value !== void 0 && CODEX_PRESET_IDS.has(value);
21
21
  }
22
+ //#endregion
23
+ //#region lib/types/prompt.js
24
+ /** Default plugin-owned Codex operating prompt. */
25
+ const DEFAULT_CODEX_SYSTEM_PROMPT = String.raw`## General
26
+
27
+ - 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.
28
+
29
+ ## Editing constraints
30
+
31
+ - 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.
32
+ - Add succinct code comments that explain non-obvious code. Do not add comments that merely narrate assignments or control flow.
33
+ - 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.
34
+
35
+ ## Planning
36
+
37
+ - Use update_plan for work with multiple meaningful steps. Keep the plan current as the task progresses.
38
+ - Do not use a plan for a trivial one-step request.
39
+
40
+ ## dsh session
41
+
42
+ - The user and you share one workspace. Inspect the repository and every applicable AGENTS.md before editing.
43
+
44
+ ## Task execution
45
+
46
+ - Keep the user informed with concise progress updates and lead with the result.
47
+
48
+ ## Presenting your work
49
+
50
+ - Be concise, direct, friendly, and actionable.
51
+ - For substantial work, explain what changed and why, then briefly note how the work was verified and what comes next.
52
+ - Do not dump large files into the conversation; refer to their paths.
53
+ - Use plain text with short sections only when they improve scanability.
54
+
55
+ ## Working principles
56
+
57
+ - 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.
58
+ - 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.
59
+ - Solve problems by thinking from first principles and at a higher level.
60
+ `;
22
61
  //#endregion
23
62
  //#region lib/types/client/activity.js
24
63
  /** Client-only inference used while the host activity projection frame is in flight. */
@@ -70,11 +109,12 @@ window.__ModuleLoader__.load({
70
109
  }
71
110
  //#endregion
72
111
  //#region lib/types/client/index.js
73
- /** Browser controls for the Codex request settings mounted by the Host plugin. */
112
+ /** Browser controls for Codex requests and the editable operating prompt. */
74
113
  const NS = "codex";
75
114
  const SETTINGS_NAMESPACE = "codex";
76
115
  const FAST_FALLBACK_SLOT = "conversation.input.right";
77
116
  const LEGACY_OVERLAY_SLOT = "conversation.input.overlay";
117
+ const PLUGIN_SETTINGS_SLOT = "settings.plugin.item";
78
118
  const DEFAULT_CONTEXT_WINDOW = 262144;
79
119
  const en = {
80
120
  fast: "Fast mode",
@@ -85,6 +125,20 @@ window.__ModuleLoader__.load({
85
125
  contextSize: "Context size",
86
126
  contextSizeDescription: "Next request capacity in K tokens.",
87
127
  contextRestore: "Restore model default",
128
+ promptCardTitle: "Codex Harness",
129
+ promptCardDescription: "View and customize the complete Codex operating prompt.",
130
+ promptLabel: "System prompt",
131
+ promptHint: "This is the full prompt owned by this plugin. Persona and DSH tool guidance stay dynamic.",
132
+ promptOverridden: "Overridden",
133
+ promptReset: "Restore default",
134
+ promptUnsaved: "Unsaved",
135
+ promptDiscard: "Discard",
136
+ promptSave: "Save",
137
+ promptSaving: "Saving...",
138
+ promptSaveFailed: "Could not save the prompt.",
139
+ promptExpand: "Expand settings",
140
+ promptCollapse: "Collapse settings",
141
+ promptReadOnly: "This settings document is read-only.",
88
142
  activityCompacting: "Compacting context...",
89
143
  activityRequestingModel: "Requesting model...",
90
144
  activityModelReply: "Model replying..."
@@ -98,10 +152,291 @@ window.__ModuleLoader__.load({
98
152
  contextSize: "上下文大小",
99
153
  contextSizeDescription: "设置下次请求的上下文容量,单位为 K tokens。",
100
154
  contextRestore: "恢复模型默认值",
155
+ promptCardTitle: "Codex Harness",
156
+ promptCardDescription: "查看和自定义完整的 Codex 系统提示词。",
157
+ promptLabel: "系统提示词",
158
+ promptHint: "这是本插件负责的全部提示词;Persona 和 DSH 工具指导仍会动态注入。",
159
+ promptOverridden: "已覆盖",
160
+ promptReset: "恢复默认",
161
+ promptUnsaved: "未保存",
162
+ promptDiscard: "放弃",
163
+ promptSave: "保存",
164
+ promptSaving: "保存中...",
165
+ promptSaveFailed: "提示词保存失败。",
166
+ promptExpand: "展开设置",
167
+ promptCollapse: "收起设置",
168
+ promptReadOnly: "当前设置文件为只读。",
101
169
  activityCompacting: "正在压缩上下文...",
102
170
  activityRequestingModel: "请求中...",
103
171
  activityModelReply: "回复中..."
104
172
  };
173
+ function promptFromLayer(layer) {
174
+ if (typeof layer !== "object" || layer === null || Array.isArray(layer)) return void 0;
175
+ const value = layer["systemPrompt"];
176
+ return typeof value === "string" ? value : void 0;
177
+ }
178
+ function hasPromptOverride(layer) {
179
+ return typeof layer === "object" && layer !== null && !Array.isArray(layer) && Object.hasOwn(layer, "systemPrompt");
180
+ }
181
+ /** Full-prompt editor contributed to Settings > Plugins. */
182
+ function PromptSettingsCard(props) {
183
+ const { useSettings, setSetting, unsetSetting, t } = props;
184
+ const snapshot = useSettings((state) => state);
185
+ const current = snapshot.value?.systemPrompt ?? DEFAULT_CODEX_SYSTEM_PROMPT;
186
+ const inherited = promptFromLayer(snapshot.base) ?? DEFAULT_CODEX_SYSTEM_PROMPT;
187
+ const overridden = hasPromptOverride(snapshot.user);
188
+ const [open, setOpen] = (0, react.useState)(false);
189
+ const [draft, setDraft] = (0, react.useState)(current);
190
+ const [saving, setSaving] = (0, react.useState)(false);
191
+ const [failed, setFailed] = (0, react.useState)(false);
192
+ (0, react.useEffect)(() => {
193
+ setDraft(current);
194
+ }, [current]);
195
+ if (snapshot.status === "unavailable") return null;
196
+ const dirty = draft !== current;
197
+ const save = async () => {
198
+ setSaving(true);
199
+ setFailed(false);
200
+ try {
201
+ await setSetting("systemPrompt", draft);
202
+ } catch {
203
+ setFailed(true);
204
+ } finally {
205
+ setSaving(false);
206
+ }
207
+ };
208
+ const reset = async () => {
209
+ setSaving(true);
210
+ setFailed(false);
211
+ setDraft(inherited);
212
+ try {
213
+ await unsetSetting("systemPrompt");
214
+ } catch {
215
+ setFailed(true);
216
+ setDraft(current);
217
+ } finally {
218
+ setSaving(false);
219
+ }
220
+ };
221
+ return (0, react_jsx_runtime.jsxs)("li", {
222
+ style: {
223
+ listStyle: "none",
224
+ border: "1px solid var(--dsw-alias-border-l2)",
225
+ borderRadius: 12,
226
+ background: open ? "var(--dsw-alias-bg-layer-2)" : "var(--dsw-alias-bg-layer-3)",
227
+ overflow: "hidden"
228
+ },
229
+ children: [(0, react_jsx_runtime.jsxs)("button", {
230
+ type: "button",
231
+ "aria-expanded": open,
232
+ "aria-label": `${t(open ? "promptCollapse" : "promptExpand")}: ${t("promptCardTitle")}`,
233
+ onClick: () => {
234
+ setOpen(!open);
235
+ },
236
+ style: {
237
+ width: "100%",
238
+ border: 0,
239
+ background: "none",
240
+ color: "inherit",
241
+ padding: "14px 16px",
242
+ display: "flex",
243
+ alignItems: "center",
244
+ gap: 12,
245
+ textAlign: "left",
246
+ cursor: "pointer",
247
+ font: "inherit"
248
+ },
249
+ children: [
250
+ (0, react_jsx_runtime.jsxs)("span", {
251
+ style: {
252
+ flex: 1,
253
+ minWidth: 0,
254
+ display: "flex",
255
+ flexDirection: "column",
256
+ gap: 4
257
+ },
258
+ children: [(0, react_jsx_runtime.jsx)("strong", {
259
+ style: {
260
+ fontSize: 15,
261
+ lineHeight: 1.4
262
+ },
263
+ children: t("promptCardTitle")
264
+ }), (0, react_jsx_runtime.jsx)("span", {
265
+ style: {
266
+ color: "var(--dsw-alias-label-tertiary)",
267
+ fontSize: 13,
268
+ lineHeight: 1.5
269
+ },
270
+ children: t("promptCardDescription")
271
+ })]
272
+ }),
273
+ dirty && (0, react_jsx_runtime.jsx)("span", {
274
+ style: {
275
+ borderRadius: 999,
276
+ padding: "1px 8px",
277
+ background: "var(--dsw-alias-bg-module-platform)",
278
+ color: "var(--dsw-alias-label-secondary)",
279
+ fontSize: 11
280
+ },
281
+ children: t("promptUnsaved")
282
+ }),
283
+ (0, react_jsx_runtime.jsx)("span", {
284
+ "aria-hidden": "true",
285
+ style: {
286
+ color: "var(--dsw-alias-label-tertiary)",
287
+ fontSize: 16
288
+ },
289
+ children: open ? "-" : "+"
290
+ })
291
+ ]
292
+ }), open && (0, react_jsx_runtime.jsxs)("div", {
293
+ style: {
294
+ borderTop: "1px solid var(--dsw-alias-border-l2)",
295
+ margin: "0 16px",
296
+ padding: "12px 0"
297
+ },
298
+ children: [
299
+ !snapshot.writable && (0, react_jsx_runtime.jsx)("p", {
300
+ style: {
301
+ margin: "0 0 10px",
302
+ color: "var(--dsw-alias-label-tertiary)",
303
+ fontSize: 12
304
+ },
305
+ children: t("promptReadOnly")
306
+ }),
307
+ (0, react_jsx_runtime.jsxs)("div", {
308
+ style: {
309
+ display: "flex",
310
+ alignItems: "center",
311
+ gap: 8,
312
+ marginBottom: 7
313
+ },
314
+ children: [(0, react_jsx_runtime.jsx)("label", {
315
+ htmlFor: "codex-system-prompt",
316
+ style: {
317
+ flex: 1,
318
+ fontSize: 13,
319
+ fontWeight: 500
320
+ },
321
+ children: t("promptLabel")
322
+ }), overridden && (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [(0, react_jsx_runtime.jsx)("span", {
323
+ style: {
324
+ borderRadius: 999,
325
+ padding: "1px 8px",
326
+ background: "var(--dsw-alias-bg-module-platform)",
327
+ color: "var(--dsw-alias-label-secondary)",
328
+ fontSize: 11
329
+ },
330
+ children: t("promptOverridden")
331
+ }), (0, react_jsx_runtime.jsx)("button", {
332
+ type: "button",
333
+ disabled: !snapshot.writable || saving,
334
+ onClick: () => {
335
+ reset();
336
+ },
337
+ style: {
338
+ border: 0,
339
+ background: "none",
340
+ color: "var(--dsw-alias-label-secondary)",
341
+ font: "inherit",
342
+ fontSize: 12,
343
+ cursor: "pointer"
344
+ },
345
+ children: t("promptReset")
346
+ })] })]
347
+ }),
348
+ (0, react_jsx_runtime.jsx)("textarea", {
349
+ id: "codex-system-prompt",
350
+ value: draft,
351
+ disabled: !snapshot.writable || saving,
352
+ onChange: (event) => {
353
+ setDraft(event.target.value);
354
+ },
355
+ spellCheck: false,
356
+ style: {
357
+ boxSizing: "border-box",
358
+ width: "100%",
359
+ minHeight: 320,
360
+ resize: "vertical",
361
+ padding: 12,
362
+ border: "1px solid var(--dsw-alias-border-l2)",
363
+ borderRadius: 8,
364
+ background: "var(--dsw-alias-bg-layer-3)",
365
+ color: "var(--dsw-alias-label-primary)",
366
+ fontFamily: "ui-monospace, SFMono-Regular, Consolas, monospace",
367
+ fontSize: 12,
368
+ lineHeight: 1.55
369
+ }
370
+ }),
371
+ (0, react_jsx_runtime.jsx)("p", {
372
+ style: {
373
+ margin: "6px 0 12px",
374
+ color: "var(--dsw-alias-label-tertiary)",
375
+ fontSize: 12,
376
+ lineHeight: 1.5
377
+ },
378
+ children: t("promptHint")
379
+ }),
380
+ (0, react_jsx_runtime.jsxs)("div", {
381
+ style: {
382
+ display: "flex",
383
+ justifyContent: "flex-end",
384
+ alignItems: "center",
385
+ gap: 8,
386
+ paddingTop: 12,
387
+ borderTop: "1px solid var(--dsw-alias-border-l2)"
388
+ },
389
+ children: [
390
+ failed && (0, react_jsx_runtime.jsx)("span", {
391
+ role: "status",
392
+ style: {
393
+ flex: 1,
394
+ color: "var(--dsw-alias-label-error)",
395
+ fontSize: 12
396
+ },
397
+ children: t("promptSaveFailed")
398
+ }),
399
+ (0, react_jsx_runtime.jsx)("button", {
400
+ type: "button",
401
+ disabled: !dirty || saving,
402
+ onClick: () => {
403
+ setDraft(current);
404
+ setFailed(false);
405
+ },
406
+ style: {
407
+ border: "1px solid var(--dsw-alias-border-l2)",
408
+ borderRadius: 8,
409
+ background: "none",
410
+ color: "inherit",
411
+ padding: "5px 14px",
412
+ font: "inherit",
413
+ cursor: "pointer"
414
+ },
415
+ children: t("promptDiscard")
416
+ }),
417
+ (0, react_jsx_runtime.jsx)("button", {
418
+ type: "button",
419
+ disabled: !snapshot.writable || !dirty || saving,
420
+ onClick: () => {
421
+ save();
422
+ },
423
+ style: {
424
+ border: 0,
425
+ borderRadius: 8,
426
+ background: "var(--dsw-alias-label-primary)",
427
+ color: "var(--dsw-alias-bg-layer-3)",
428
+ padding: "6px 14px",
429
+ font: "inherit",
430
+ cursor: "pointer"
431
+ },
432
+ children: saving ? t("promptSaving") : t("promptSave")
433
+ })
434
+ ]
435
+ })
436
+ ]
437
+ })]
438
+ });
439
+ }
105
440
  /** The legacy composer seat is a compact inline row, not a menu panel. */
106
441
  function FastModeFallback(props) {
107
442
  const { sessionId, useSessions, useSettings, setSetting, t } = props;
@@ -470,7 +805,7 @@ window.__ModuleLoader__.load({
470
805
  "locale",
471
806
  "settingsScope"
472
807
  ];
473
- /** Mount all controls through the official composer seats shared by every DSH release. */
808
+ /** Mount request controls and the plugin settings card through shared slots. */
474
809
  function apply(ctx) {
475
810
  ctx.effect(() => ctx.locale.register(NS, {
476
811
  en,
@@ -496,6 +831,12 @@ window.__ModuleLoader__.load({
496
831
  locale: NS,
497
832
  inject: injected
498
833
  }, LegacyOverlay));
834
+ ctx.slots.inject(PLUGIN_SETTINGS_SLOT, () => ctx.slots.register({
835
+ name: PLUGIN_SETTINGS_SLOT,
836
+ key: SETTINGS_NAMESPACE,
837
+ locale: NS,
838
+ inject: injected
839
+ }, PromptSettingsCard));
499
840
  }
500
841
  var client_default = {
501
842
  inject,
@@ -503,6 +844,7 @@ window.__ModuleLoader__.load({
503
844
  };
504
845
  //#endregion
505
846
  exports.ActivityLine = ActivityLine;
847
+ exports.PromptSettingsCard = PromptSettingsCard;
506
848
  exports.apply = apply;
507
849
  exports.default = client_default;
508
850
  exports.inject = inject;