@shuind/dsh-codex-harness 0.2.3 → 0.2.5
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/lib/client.js +267 -114
- package/lib/index.js +116 -13
- package/lib/installer.js +22 -1
- package/lib/types/client/index.d.ts +19 -9
- package/lib/types/client/index.js +110 -55
- package/lib/types/index.d.ts +7 -1
- package/lib/types/index.js +63 -10
- package/lib/types/prompt.d.ts +6 -0
- package/lib/types/prompt.js +16 -1
- package/lib/types/remote.d.ts +5 -0
- package/lib/types/remote.js +42 -0
- package/lib/types/settings.d.ts +6 -0
- package/lib/types/settings.js +7 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -49,10 +49,25 @@ window.__ModuleLoader__.load({
|
|
|
49
49
|
|
|
50
50
|
## Working principles
|
|
51
51
|
|
|
52
|
-
-
|
|
52
|
+
- Actively establish the user's current context rather than relying on stale assumptions or prior context. Before committing to an approach that could materially shape the outcome or direction of the work, state the intended path and align it with the user; clarify any material uncertainty first. Then pursue the user's goal through the clearest, most effective path.
|
|
53
53
|
- Keep only the essential logic and core actions. Don't 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.
|
|
54
54
|
- Solve problems by thinking from first principles and at a higher level.
|
|
55
55
|
`;
|
|
56
|
+
/** Default deployment Persona template used by the Codex preset. */
|
|
57
|
+
const DEFAULT_CODEX_PERSONA = String.raw`You are Codex, a coding agent based on the {{model}} model. Your working directory is {{cwd}}.`;
|
|
58
|
+
/** Default DSH Core source-checkout guidance template. */
|
|
59
|
+
const DEFAULT_DSH_CORE_SOURCE_PROMPT = String.raw`The DeepSeek Harness implementation checkout is at {{sourceRoot}}. The checkout location and current working directory are separate values and may differ; never infer the working directory from this path. Use pwd to determine the current working directory. Use this checkout only to inspect or extend DSH itself.`;
|
|
60
|
+
/** Default DSH Web runtime guidance template. */
|
|
61
|
+
const DEFAULT_DSH_CORE_WEB_PROMPT = [
|
|
62
|
+
"You are interacting with the user through the DeepSeek Harness Web GUI at {{webUrl}}.",
|
|
63
|
+
"When the user refers to \"this page\", \"this GUI\", or \"this app\" without naming another target, they mean this GUI.",
|
|
64
|
+
"The browser provides no implicit DOM, route, or screenshot context.",
|
|
65
|
+
"The client-plugin HMR receiver is active, but client-plugin changes reload without a refresh only while `pnpm run dev:web` is also running from this same checkout to rebuild their bundles; verify that watcher before promising automatic updates.",
|
|
66
|
+
"Every other change - the apps/web shell and plain packages - requires rebuilding the affected Web artifacts and verifying this existing URL after a page refresh.",
|
|
67
|
+
"Starting another server does not update this GUI.",
|
|
68
|
+
"The apps/web Vite entry builds the shell but is not a standalone application because only dsh web injects window.__DSH_BOOT__.",
|
|
69
|
+
"Do not start a replacement server unless the user asks; if one is needed, use a managed background job and verify its exact URL."
|
|
70
|
+
].join(" ");
|
|
56
71
|
//#endregion
|
|
57
72
|
//#region lib/types/client/activity.js
|
|
58
73
|
/** Client-only inference used while the host activity projection frame is in flight. */
|
|
@@ -122,25 +137,32 @@ window.__ModuleLoader__.load({
|
|
|
122
137
|
contextRestore: "Restore model default",
|
|
123
138
|
promptCardTitle: "Codex Harness",
|
|
124
139
|
promptCardDescription: "Choose Codex capabilities and customize the operating prompt.",
|
|
125
|
-
|
|
140
|
+
codexOnlyCapabilitiesLabel: "Codex mode only",
|
|
141
|
+
otherCapabilitiesLabel: "Additional capabilities",
|
|
126
142
|
capabilityPrompt: "Codex operating prompt",
|
|
127
|
-
capabilityPromptHint: "Inject the editable instructions and persona-first prompt layout
|
|
143
|
+
capabilityPromptHint: "Inject the editable instructions and persona-first prompt layout.",
|
|
128
144
|
capabilityTerminal: "Terminal tools",
|
|
129
|
-
capabilityTerminalHint: "Expose exec_command and write_stdin
|
|
145
|
+
capabilityTerminalHint: "Expose exec_command and write_stdin.",
|
|
130
146
|
capabilityPatch: "Patch tool",
|
|
131
|
-
capabilityPatchHint: "Expose apply_patch
|
|
147
|
+
capabilityPatchHint: "Expose apply_patch, using the native Responses grammar when supported.",
|
|
132
148
|
capabilityPlan: "Plan tool",
|
|
133
|
-
capabilityPlanHint: "Expose update_plan for implementation task tracking
|
|
149
|
+
capabilityPlanHint: "Expose update_plan for implementation task tracking.",
|
|
134
150
|
capabilityWebSearch: "Hosted web search",
|
|
135
151
|
capabilityWebSearchHint: "Use the provider-native Responses web_search tool when available.",
|
|
136
152
|
capabilityCompaction: "Remote compaction",
|
|
137
153
|
capabilityCompactionHint: "Prefer the provider Responses compact endpoint before local compaction.",
|
|
138
154
|
capabilityActivity: "Activity indicator",
|
|
139
155
|
capabilityActivityHint: "Show request, reply, and compaction status beside the conversation.",
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
156
|
+
promptCustomizationLabel: "Prompt customization",
|
|
157
|
+
personaLabel: "Persona",
|
|
158
|
+
personaHint: "Deployment identity and role. Supports {{model}} and {{cwd}}.",
|
|
159
|
+
sourcePromptLabel: "DSH Core source instructions",
|
|
160
|
+
sourcePromptHint: "Guidance about the DSH checkout and working directory. Supports {{sourceRoot}}.",
|
|
161
|
+
webPromptLabel: "DSH Core Web instructions",
|
|
162
|
+
webPromptHint: "Guidance about this Web GUI, HMR, builds, and verification. Supports {{webUrl}}.",
|
|
163
|
+
promptRestoreAll: "Restore all prompt defaults",
|
|
164
|
+
promptLabel: "Codex operating prompt",
|
|
165
|
+
promptHint: "This is the Codex operating prompt. Persona and DSH Core instructions are edited separately above.",
|
|
144
166
|
promptUnsaved: "Unsaved",
|
|
145
167
|
promptDiscard: "Discard",
|
|
146
168
|
promptSave: "Save",
|
|
@@ -164,25 +186,32 @@ window.__ModuleLoader__.load({
|
|
|
164
186
|
contextRestore: "恢复模型默认值",
|
|
165
187
|
promptCardTitle: "Codex Harness",
|
|
166
188
|
promptCardDescription: "选择 Codex 能力并自定义完整的操作提示词。",
|
|
167
|
-
|
|
189
|
+
codexOnlyCapabilitiesLabel: "仅在 Codex 模式下",
|
|
190
|
+
otherCapabilitiesLabel: "其他能力",
|
|
168
191
|
capabilityPrompt: "Codex 操作提示词",
|
|
169
|
-
capabilityPromptHint: "
|
|
192
|
+
capabilityPromptHint: "注入可编辑指令,并将 Persona 放在提示词首位。",
|
|
170
193
|
capabilityTerminal: "终端工具",
|
|
171
|
-
capabilityTerminalHint: "
|
|
194
|
+
capabilityTerminalHint: "提供 exec_command 和 write_stdin。",
|
|
172
195
|
capabilityPatch: "补丁工具",
|
|
173
|
-
capabilityPatchHint: "
|
|
196
|
+
capabilityPatchHint: "提供 apply_patch,并在支持时使用 Responses 原生语法。",
|
|
174
197
|
capabilityPlan: "计划工具",
|
|
175
|
-
capabilityPlanHint: "
|
|
198
|
+
capabilityPlanHint: "提供 update_plan,用于跟踪实施任务。",
|
|
176
199
|
capabilityWebSearch: "托管网络搜索",
|
|
177
200
|
capabilityWebSearchHint: "可用时使用提供商原生的 Responses web_search 工具。",
|
|
178
201
|
capabilityCompaction: "远程上下文压缩",
|
|
179
202
|
capabilityCompactionHint: "优先调用提供商的 Responses compact 端点,失败时回退本地压缩。",
|
|
180
203
|
capabilityActivity: "活动状态",
|
|
181
204
|
capabilityActivityHint: "在对话旁显示请求、回复和压缩状态。",
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
205
|
+
promptCustomizationLabel: "提示词定制",
|
|
206
|
+
personaLabel: "Persona",
|
|
207
|
+
personaHint: "定义 Agent 的身份与角色,支持 {{model}} 和 {{cwd}}。",
|
|
208
|
+
sourcePromptLabel: "DSH Core 源码说明",
|
|
209
|
+
sourcePromptHint: "说明 DSH 源码检出目录与工作目录,支持 {{sourceRoot}}。",
|
|
210
|
+
webPromptLabel: "DSH Core Web 说明",
|
|
211
|
+
webPromptHint: "说明 Web GUI、HMR、构建与验证,支持 {{webUrl}}。",
|
|
212
|
+
promptRestoreAll: "恢复所有提示词默认值",
|
|
213
|
+
promptLabel: "Codex 操作提示词",
|
|
214
|
+
promptHint: "这是 Codex 操作提示词。Persona 和 DSH Core 说明在上方分别编辑。",
|
|
186
215
|
promptUnsaved: "未保存",
|
|
187
216
|
promptDiscard: "放弃",
|
|
188
217
|
promptSave: "保存",
|
|
@@ -200,9 +229,6 @@ window.__ModuleLoader__.load({
|
|
|
200
229
|
const value = layer["systemPrompt"];
|
|
201
230
|
return typeof value === "string" ? value : void 0;
|
|
202
231
|
}
|
|
203
|
-
function hasPromptOverride(layer) {
|
|
204
|
-
return typeof layer === "object" && layer !== null && !Array.isArray(layer) && Object.hasOwn(layer, "systemPrompt");
|
|
205
|
-
}
|
|
206
232
|
function CapabilityToggle({ field, label, hint, enabled, disabled, setSetting }) {
|
|
207
233
|
return (0, react_jsx_runtime.jsxs)("label", {
|
|
208
234
|
style: {
|
|
@@ -249,14 +275,107 @@ window.__ModuleLoader__.load({
|
|
|
249
275
|
})]
|
|
250
276
|
});
|
|
251
277
|
}
|
|
278
|
+
/** Visually separate capability scope while keeping the host's light settings style. */
|
|
279
|
+
function CapabilityGroup({ label, children, accent }) {
|
|
280
|
+
return (0, react_jsx_runtime.jsxs)("section", {
|
|
281
|
+
style: {
|
|
282
|
+
display: "grid",
|
|
283
|
+
gap: 4
|
|
284
|
+
},
|
|
285
|
+
children: [(0, react_jsx_runtime.jsxs)("div", {
|
|
286
|
+
style: {
|
|
287
|
+
display: "flex",
|
|
288
|
+
alignItems: "center",
|
|
289
|
+
gap: 7,
|
|
290
|
+
paddingLeft: 2
|
|
291
|
+
},
|
|
292
|
+
children: [(0, react_jsx_runtime.jsx)("span", {
|
|
293
|
+
"aria-hidden": "true",
|
|
294
|
+
style: {
|
|
295
|
+
width: 6,
|
|
296
|
+
height: 6,
|
|
297
|
+
flex: "0 0 auto",
|
|
298
|
+
borderRadius: 999,
|
|
299
|
+
background: accent
|
|
300
|
+
}
|
|
301
|
+
}), (0, react_jsx_runtime.jsx)("strong", {
|
|
302
|
+
style: {
|
|
303
|
+
color: "var(--dsw-alias-label-secondary)",
|
|
304
|
+
fontSize: 14,
|
|
305
|
+
fontWeight: 600,
|
|
306
|
+
letterSpacing: "0.01em"
|
|
307
|
+
},
|
|
308
|
+
children: label
|
|
309
|
+
})]
|
|
310
|
+
}), (0, react_jsx_runtime.jsx)("div", {
|
|
311
|
+
style: {
|
|
312
|
+
display: "grid",
|
|
313
|
+
marginLeft: 5,
|
|
314
|
+
paddingLeft: 12
|
|
315
|
+
},
|
|
316
|
+
children
|
|
317
|
+
})]
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
function PromptEditor({ id, label, hint, value, writable, saving, minHeight, onChange }) {
|
|
321
|
+
return (0, react_jsx_runtime.jsxs)("div", {
|
|
322
|
+
style: {
|
|
323
|
+
display: "grid",
|
|
324
|
+
gap: 5
|
|
325
|
+
},
|
|
326
|
+
children: [
|
|
327
|
+
(0, react_jsx_runtime.jsx)("label", {
|
|
328
|
+
htmlFor: id,
|
|
329
|
+
style: {
|
|
330
|
+
fontSize: 13,
|
|
331
|
+
fontWeight: 500
|
|
332
|
+
},
|
|
333
|
+
children: label
|
|
334
|
+
}),
|
|
335
|
+
(0, react_jsx_runtime.jsx)("textarea", {
|
|
336
|
+
id,
|
|
337
|
+
value,
|
|
338
|
+
disabled: !writable || saving,
|
|
339
|
+
onChange: (event) => {
|
|
340
|
+
onChange(event.target.value);
|
|
341
|
+
},
|
|
342
|
+
spellCheck: false,
|
|
343
|
+
style: {
|
|
344
|
+
boxSizing: "border-box",
|
|
345
|
+
width: "100%",
|
|
346
|
+
minHeight,
|
|
347
|
+
resize: "vertical",
|
|
348
|
+
padding: 10,
|
|
349
|
+
border: "1px solid var(--dsw-alias-border-l2)",
|
|
350
|
+
borderRadius: 8,
|
|
351
|
+
background: "var(--dsw-alias-bg-layer-3)",
|
|
352
|
+
color: "var(--dsw-alias-label-primary)",
|
|
353
|
+
font: "inherit",
|
|
354
|
+
fontSize: 12,
|
|
355
|
+
lineHeight: 1.5
|
|
356
|
+
}
|
|
357
|
+
}),
|
|
358
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
359
|
+
style: {
|
|
360
|
+
color: "var(--dsw-alias-label-tertiary)",
|
|
361
|
+
fontSize: 11,
|
|
362
|
+
lineHeight: 1.45
|
|
363
|
+
},
|
|
364
|
+
children: hint
|
|
365
|
+
})
|
|
366
|
+
]
|
|
367
|
+
});
|
|
368
|
+
}
|
|
252
369
|
/** Full-prompt editor contributed to Settings > Plugins. */
|
|
253
370
|
function PromptSettingsCard(props) {
|
|
254
371
|
const { useSettings, setSetting, unsetSetting, t } = props;
|
|
255
372
|
const snapshot = useSettings((state) => state);
|
|
373
|
+
const currentPersona = snapshot.value?.persona ?? DEFAULT_CODEX_PERSONA;
|
|
374
|
+
const currentSourcePrompt = snapshot.value?.harnessSourcePrompt ?? DEFAULT_DSH_CORE_SOURCE_PROMPT;
|
|
375
|
+
const currentWebPrompt = snapshot.value?.webSurfacePrompt ?? DEFAULT_DSH_CORE_WEB_PROMPT;
|
|
256
376
|
const current = snapshot.value?.systemPrompt ?? DEFAULT_CODEX_SYSTEM_PROMPT;
|
|
257
377
|
const inherited = promptFromLayer(snapshot.base) ?? DEFAULT_CODEX_SYSTEM_PROMPT;
|
|
258
|
-
const
|
|
259
|
-
const capabilities = [
|
|
378
|
+
const codexOnlyCapabilities = [
|
|
260
379
|
{
|
|
261
380
|
field: "promptEnabled",
|
|
262
381
|
label: "capabilityPrompt",
|
|
@@ -276,7 +395,9 @@ window.__ModuleLoader__.load({
|
|
|
276
395
|
field: "planToolEnabled",
|
|
277
396
|
label: "capabilityPlan",
|
|
278
397
|
hint: "capabilityPlanHint"
|
|
279
|
-
}
|
|
398
|
+
}
|
|
399
|
+
];
|
|
400
|
+
const otherCapabilities = [
|
|
280
401
|
{
|
|
281
402
|
field: "hostedWebSearchEnabled",
|
|
282
403
|
label: "capabilityWebSearch",
|
|
@@ -294,19 +415,43 @@ window.__ModuleLoader__.load({
|
|
|
294
415
|
}
|
|
295
416
|
];
|
|
296
417
|
const [open, setOpen] = (0, react.useState)(false);
|
|
418
|
+
const [personaDraft, setPersonaDraft] = (0, react.useState)(currentPersona);
|
|
419
|
+
const [sourcePromptDraft, setSourcePromptDraft] = (0, react.useState)(currentSourcePrompt);
|
|
420
|
+
const [webPromptDraft, setWebPromptDraft] = (0, react.useState)(currentWebPrompt);
|
|
297
421
|
const [draft, setDraft] = (0, react.useState)(current);
|
|
298
422
|
const [saving, setSaving] = (0, react.useState)(false);
|
|
299
423
|
const [failed, setFailed] = (0, react.useState)(false);
|
|
300
424
|
(0, react.useEffect)(() => {
|
|
425
|
+
setPersonaDraft(currentPersona);
|
|
426
|
+
setSourcePromptDraft(currentSourcePrompt);
|
|
427
|
+
setWebPromptDraft(currentWebPrompt);
|
|
301
428
|
setDraft(current);
|
|
302
|
-
}, [
|
|
429
|
+
}, [
|
|
430
|
+
current,
|
|
431
|
+
currentPersona,
|
|
432
|
+
currentSourcePrompt,
|
|
433
|
+
currentWebPrompt
|
|
434
|
+
]);
|
|
303
435
|
if (snapshot.status === "unavailable") return null;
|
|
304
|
-
const dirty = draft !== current;
|
|
436
|
+
const dirty = personaDraft !== currentPersona || sourcePromptDraft !== currentSourcePrompt || webPromptDraft !== currentWebPrompt || draft !== current;
|
|
437
|
+
const renderCapability = (capability) => (0, react_jsx_runtime.jsx)(CapabilityToggle, {
|
|
438
|
+
field: capability.field,
|
|
439
|
+
label: t(capability.label),
|
|
440
|
+
hint: t(capability.hint),
|
|
441
|
+
enabled: snapshot.value?.[capability.field] ?? true,
|
|
442
|
+
disabled: !snapshot.writable || saving,
|
|
443
|
+
setSetting
|
|
444
|
+
}, capability.field);
|
|
305
445
|
const save = async () => {
|
|
306
446
|
setSaving(true);
|
|
307
447
|
setFailed(false);
|
|
308
448
|
try {
|
|
309
|
-
await
|
|
449
|
+
await Promise.all([
|
|
450
|
+
setSetting("persona", personaDraft),
|
|
451
|
+
setSetting("harnessSourcePrompt", sourcePromptDraft),
|
|
452
|
+
setSetting("webSurfacePrompt", webPromptDraft),
|
|
453
|
+
setSetting("systemPrompt", draft)
|
|
454
|
+
]);
|
|
310
455
|
} catch {
|
|
311
456
|
setFailed(true);
|
|
312
457
|
} finally {
|
|
@@ -316,11 +461,20 @@ window.__ModuleLoader__.load({
|
|
|
316
461
|
const reset = async () => {
|
|
317
462
|
setSaving(true);
|
|
318
463
|
setFailed(false);
|
|
464
|
+
setPersonaDraft(DEFAULT_CODEX_PERSONA);
|
|
465
|
+
setSourcePromptDraft(DEFAULT_DSH_CORE_SOURCE_PROMPT);
|
|
466
|
+
setWebPromptDraft(DEFAULT_DSH_CORE_WEB_PROMPT);
|
|
319
467
|
setDraft(inherited);
|
|
320
468
|
try {
|
|
321
469
|
await unsetSetting("systemPrompt");
|
|
470
|
+
await unsetSetting("persona");
|
|
471
|
+
await unsetSetting("harnessSourcePrompt");
|
|
472
|
+
await unsetSetting("webSurfacePrompt");
|
|
322
473
|
} catch {
|
|
323
474
|
setFailed(true);
|
|
475
|
+
setPersonaDraft(currentPersona);
|
|
476
|
+
setSourcePromptDraft(currentSourcePrompt);
|
|
477
|
+
setWebPromptDraft(currentWebPrompt);
|
|
324
478
|
setDraft(current);
|
|
325
479
|
} finally {
|
|
326
480
|
setSaving(false);
|
|
@@ -412,102 +566,101 @@ window.__ModuleLoader__.load({
|
|
|
412
566
|
},
|
|
413
567
|
children: t("promptReadOnly")
|
|
414
568
|
}),
|
|
415
|
-
(0, react_jsx_runtime.
|
|
416
|
-
style: {
|
|
417
|
-
display: "block",
|
|
418
|
-
marginBottom: 4,
|
|
419
|
-
fontSize: 13
|
|
420
|
-
},
|
|
421
|
-
children: t("capabilitiesLabel")
|
|
422
|
-
}),
|
|
423
|
-
(0, react_jsx_runtime.jsx)("div", {
|
|
569
|
+
(0, react_jsx_runtime.jsxs)("div", {
|
|
424
570
|
style: {
|
|
425
571
|
display: "grid",
|
|
572
|
+
gap: 16,
|
|
426
573
|
marginBottom: 14
|
|
427
574
|
},
|
|
428
|
-
children:
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
575
|
+
children: [(0, react_jsx_runtime.jsx)(CapabilityGroup, {
|
|
576
|
+
label: t("codexOnlyCapabilitiesLabel"),
|
|
577
|
+
accent: "var(--dsw-static-blue-500)",
|
|
578
|
+
children: codexOnlyCapabilities.map(renderCapability)
|
|
579
|
+
}), (0, react_jsx_runtime.jsx)(CapabilityGroup, {
|
|
580
|
+
label: t("otherCapabilitiesLabel"),
|
|
581
|
+
accent: "var(--dsw-alias-label-tertiary)",
|
|
582
|
+
children: otherCapabilities.map(renderCapability)
|
|
583
|
+
})]
|
|
436
584
|
}),
|
|
437
585
|
(0, react_jsx_runtime.jsxs)("div", {
|
|
438
586
|
style: {
|
|
439
|
-
display: "
|
|
440
|
-
|
|
441
|
-
gap: 8,
|
|
442
|
-
marginBottom: 7,
|
|
587
|
+
display: "grid",
|
|
588
|
+
gap: 14,
|
|
443
589
|
paddingTop: 12,
|
|
444
590
|
borderTop: "1px solid var(--dsw-alias-border-l2)"
|
|
445
591
|
},
|
|
446
|
-
children: [
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
},
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
592
|
+
children: [
|
|
593
|
+
(0, react_jsx_runtime.jsxs)("div", {
|
|
594
|
+
style: {
|
|
595
|
+
display: "flex",
|
|
596
|
+
alignItems: "center",
|
|
597
|
+
gap: 8
|
|
598
|
+
},
|
|
599
|
+
children: [(0, react_jsx_runtime.jsx)("strong", {
|
|
600
|
+
style: {
|
|
601
|
+
flex: 1,
|
|
602
|
+
fontSize: 13
|
|
603
|
+
},
|
|
604
|
+
children: t("promptCustomizationLabel")
|
|
605
|
+
}), (0, react_jsx_runtime.jsx)("button", {
|
|
606
|
+
type: "button",
|
|
607
|
+
disabled: !snapshot.writable || saving || !dirty,
|
|
608
|
+
onClick: () => {
|
|
609
|
+
reset();
|
|
610
|
+
},
|
|
611
|
+
style: {
|
|
612
|
+
border: 0,
|
|
613
|
+
padding: 0,
|
|
614
|
+
background: "none",
|
|
615
|
+
color: "var(--dsw-alias-label-secondary)",
|
|
616
|
+
font: "inherit",
|
|
617
|
+
fontSize: 11,
|
|
618
|
+
cursor: "pointer"
|
|
619
|
+
},
|
|
620
|
+
children: t("promptRestoreAll")
|
|
621
|
+
})]
|
|
622
|
+
}),
|
|
623
|
+
(0, react_jsx_runtime.jsx)(PromptEditor, {
|
|
624
|
+
id: "codex-persona",
|
|
625
|
+
label: t("personaLabel"),
|
|
626
|
+
hint: t("personaHint"),
|
|
627
|
+
value: personaDraft,
|
|
628
|
+
writable: snapshot.writable,
|
|
629
|
+
saving,
|
|
630
|
+
minHeight: 84,
|
|
631
|
+
onChange: setPersonaDraft
|
|
632
|
+
}),
|
|
633
|
+
(0, react_jsx_runtime.jsx)(PromptEditor, {
|
|
634
|
+
id: "codex-harness-source-prompt",
|
|
635
|
+
label: t("sourcePromptLabel"),
|
|
636
|
+
hint: t("sourcePromptHint"),
|
|
637
|
+
value: sourcePromptDraft,
|
|
638
|
+
writable: snapshot.writable,
|
|
639
|
+
saving,
|
|
640
|
+
minHeight: 100,
|
|
641
|
+
onChange: setSourcePromptDraft
|
|
642
|
+
}),
|
|
643
|
+
(0, react_jsx_runtime.jsx)(PromptEditor, {
|
|
644
|
+
id: "codex-web-surface-prompt",
|
|
645
|
+
label: t("webPromptLabel"),
|
|
646
|
+
hint: t("webPromptHint"),
|
|
647
|
+
value: webPromptDraft,
|
|
648
|
+
writable: snapshot.writable,
|
|
649
|
+
saving,
|
|
650
|
+
minHeight: 120,
|
|
651
|
+
onChange: setWebPromptDraft
|
|
652
|
+
}),
|
|
653
|
+
(0, react_jsx_runtime.jsx)(PromptEditor, {
|
|
654
|
+
id: "codex-system-prompt",
|
|
655
|
+
label: t("promptLabel"),
|
|
656
|
+
hint: t("promptHint"),
|
|
657
|
+
value: draft,
|
|
658
|
+
writable: snapshot.writable,
|
|
659
|
+
saving,
|
|
660
|
+
minHeight: 320,
|
|
661
|
+
onChange: setDraft
|
|
662
|
+
})
|
|
663
|
+
]
|
|
511
664
|
}),
|
|
512
665
|
(0, react_jsx_runtime.jsxs)("div", {
|
|
513
666
|
style: {
|