@shuind/dsh-codex-harness 0.2.4 → 0.2.6
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 +49 -49
- package/cordis.patch.yml +11 -11
- package/lib/client.js +378 -114
- package/lib/compaction.js +10 -1
- package/lib/index.js +184 -19
- package/lib/installer.js +24 -1
- package/lib/types/client/index.d.ts +26 -9
- package/lib/types/client/index.js +183 -56
- package/lib/types/compact-command.d.ts +13 -0
- package/lib/types/compact-command.js +79 -0
- package/lib/types/compaction.d.ts +6 -0
- package/lib/types/compaction.js +9 -0
- package/lib/types/index.d.ts +7 -1
- package/lib/types/index.js +81 -16
- package/lib/types/patch.js +15 -15
- package/lib/types/prompt.d.ts +6 -0
- package/lib/types/prompt.js +50 -35
- package/lib/types/settings.d.ts +8 -0
- package/lib/types/settings.js +9 -1
- package/package.json +260 -247
- package/presets/codex-collaboration/agent.cordis.yml +197 -197
- package/presets/codex-collaboration/preset.yml +3 -3
package/lib/types/index.js
CHANGED
|
@@ -6,9 +6,10 @@ import { APPLY_PATCH_DESCRIPTION, applyPatchHunks, parsePatch } from "./patch.js
|
|
|
6
6
|
import { renderExecResult, runExecCommand, runWriteStdin } from "./exec.js";
|
|
7
7
|
import { hostedWebSearchStream, installHostedWebSearch, remoteCompactStream, repairLegacyPiAiContextOverflow, } from "./remote.js";
|
|
8
8
|
import { registerCodexActivityProjection } from "./activity.js";
|
|
9
|
-
import { DEFAULT_CODEX_SYSTEM_PROMPT, resolveCodexSystemPrompt } from "./prompt.js";
|
|
9
|
+
import { DEFAULT_CODEX_PERSONA, DEFAULT_CODEX_SYSTEM_PROMPT, DEFAULT_DSH_CORE_SOURCE_PROMPT, DEFAULT_DSH_CORE_WEB_PROMPT, resolveCodexSystemPrompt, } from "./prompt.js";
|
|
10
10
|
import { CODEX_SETTINGS_ENTRY, CODEX_SETTINGS_NAMESPACE, CODEX_SETTINGS_SCHEMA, } from "./settings.js";
|
|
11
|
-
|
|
11
|
+
import { codexCompactionMode } from "./compaction.js";
|
|
12
|
+
export { DEFAULT_CODEX_PERSONA, DEFAULT_CODEX_SYSTEM_PROMPT, DEFAULT_DSH_CORE_SOURCE_PROMPT, DEFAULT_DSH_CORE_WEB_PROMPT, } from "./prompt.js";
|
|
12
13
|
export { CODEX_SETTINGS_NAMESPACE, CODEX_SETTINGS_SCHEMA } from "./settings.js";
|
|
13
14
|
export const name = 'codex';
|
|
14
15
|
export const inject = ['tools', 'systemPrompt', 'shell', 'fs', 'llm', 'credentials', 'settings'];
|
|
@@ -24,6 +25,9 @@ export const Config = z.object({
|
|
|
24
25
|
hostedWebSearch: z.boolean().default(true),
|
|
25
26
|
remoteCompact: z.boolean().default(true),
|
|
26
27
|
systemPrompt: z.string().default(DEFAULT_CODEX_SYSTEM_PROMPT),
|
|
28
|
+
persona: z.string().default(DEFAULT_CODEX_PERSONA),
|
|
29
|
+
harnessSourcePrompt: z.string().default(DEFAULT_DSH_CORE_SOURCE_PROMPT),
|
|
30
|
+
webSurfacePrompt: z.string().default(DEFAULT_DSH_CORE_WEB_PROMPT),
|
|
27
31
|
});
|
|
28
32
|
const LLM_PI_AI_SETTINGS = settingsNamespace('llm-pi-ai');
|
|
29
33
|
const GPT_REASONING_EFFORTS = {
|
|
@@ -118,8 +122,14 @@ function watchConfiguredGptModels(ctx) {
|
|
|
118
122
|
schedule();
|
|
119
123
|
}
|
|
120
124
|
/** Install the optional settings source used by requests and prompt assembly. */
|
|
121
|
-
function installCodexSettings(ctx, systemPrompt) {
|
|
122
|
-
const entry = {
|
|
125
|
+
function installCodexSettings(ctx, systemPrompt, persona, harnessSourcePrompt, webSurfacePrompt) {
|
|
126
|
+
const entry = {
|
|
127
|
+
...CODEX_SETTINGS_ENTRY,
|
|
128
|
+
systemPrompt,
|
|
129
|
+
persona,
|
|
130
|
+
harnessSourcePrompt,
|
|
131
|
+
webSurfacePrompt,
|
|
132
|
+
};
|
|
123
133
|
const withDefaults = (value) => ({
|
|
124
134
|
...entry,
|
|
125
135
|
...value,
|
|
@@ -241,6 +251,53 @@ export function normalizeCodexPromptAssembly(assembly) {
|
|
|
241
251
|
sections: [persona, ...sections.filter(section => section.name !== 'deployment:persona')],
|
|
242
252
|
};
|
|
243
253
|
}
|
|
254
|
+
function sectionText(assembly, name) {
|
|
255
|
+
const section = assembly.sections.find(candidate => candidate.name === name);
|
|
256
|
+
return section?.text;
|
|
257
|
+
}
|
|
258
|
+
function promptVariables(assembly) {
|
|
259
|
+
const variables = { ...assembly.variables };
|
|
260
|
+
if (variables.sourceRoot === undefined) {
|
|
261
|
+
const source = sectionText(assembly, 'harness:source');
|
|
262
|
+
const match = source?.match(/^The DeepSeek Harness implementation checkout is at (.+?)\. The checkout location/u);
|
|
263
|
+
if (match?.[1] !== undefined)
|
|
264
|
+
variables.sourceRoot = match[1];
|
|
265
|
+
}
|
|
266
|
+
if (variables.webUrl === undefined) {
|
|
267
|
+
const web = sectionText(assembly, 'app:web-surface');
|
|
268
|
+
const match = web?.match(/^You are interacting with the user through the DeepSeek Harness Web GUI at (.+?)\. When/u);
|
|
269
|
+
if (match?.[1] !== undefined)
|
|
270
|
+
variables.webUrl = match[1];
|
|
271
|
+
}
|
|
272
|
+
return variables;
|
|
273
|
+
}
|
|
274
|
+
function interpolateCodexPrompt(text, variables) {
|
|
275
|
+
return text.replace(/\{\{([\w.-]+)\}\}/g, (whole, key) => variables[key] ?? whole);
|
|
276
|
+
}
|
|
277
|
+
/** Apply user-editable Persona and DSH Core runtime prompt templates. */
|
|
278
|
+
function applyCodexPromptOverrides(assembly, settings) {
|
|
279
|
+
const overrides = {
|
|
280
|
+
'deployment:persona': settings.persona,
|
|
281
|
+
'harness:source': settings.harnessSourcePrompt,
|
|
282
|
+
'app:web-surface': settings.webSurfacePrompt,
|
|
283
|
+
};
|
|
284
|
+
const defaults = {
|
|
285
|
+
'deployment:persona': DEFAULT_CODEX_PERSONA,
|
|
286
|
+
'harness:source': DEFAULT_DSH_CORE_SOURCE_PROMPT,
|
|
287
|
+
'app:web-surface': DEFAULT_DSH_CORE_WEB_PROMPT,
|
|
288
|
+
};
|
|
289
|
+
const hasCustomOverride = Object.entries(overrides).some(([name, text]) => (text !== undefined && text !== defaults[name]));
|
|
290
|
+
if (!hasCustomOverride)
|
|
291
|
+
return assembly;
|
|
292
|
+
const variables = promptVariables(assembly);
|
|
293
|
+
const sections = assembly.sections.map(section => {
|
|
294
|
+
const template = overrides[section.name];
|
|
295
|
+
return template === undefined || template === defaults[section.name]
|
|
296
|
+
? section
|
|
297
|
+
: { ...section, text: interpolateCodexPrompt(template, variables) };
|
|
298
|
+
});
|
|
299
|
+
return { ...assembly, sections, variables };
|
|
300
|
+
}
|
|
244
301
|
const CODEX_TOOL_NAMES = {
|
|
245
302
|
terminalToolsEnabled: new Set(['exec_command', 'write_stdin']),
|
|
246
303
|
patchToolEnabled: new Set(['apply_patch']),
|
|
@@ -258,7 +315,8 @@ export function applyCodexCapabilitySettings(assembly, settings) {
|
|
|
258
315
|
const filtered = disabled.size === 0
|
|
259
316
|
? assembly
|
|
260
317
|
: { ...assembly, tools: assembly.tools.filter(tool => !disabled.has(tool.name)) };
|
|
261
|
-
|
|
318
|
+
const withOverrides = applyCodexPromptOverrides(filtered, settings);
|
|
319
|
+
return settings.promptEnabled ? normalizeCodexPromptAssembly(withOverrides) : withOverrides;
|
|
262
320
|
}
|
|
263
321
|
/** Build the complete plugin-owned prompt, preserving an intentional empty value. */
|
|
264
322
|
export function buildCodexSystemPrompt(config = {}) {
|
|
@@ -535,13 +593,16 @@ export function apply(ctx, config = {}) {
|
|
|
535
593
|
hostedWebSearch: config.hostedWebSearch ?? true,
|
|
536
594
|
remoteCompact: config.remoteCompact ?? true,
|
|
537
595
|
systemPrompt: config.systemPrompt ?? DEFAULT_CODEX_SYSTEM_PROMPT,
|
|
596
|
+
persona: config.persona ?? DEFAULT_CODEX_PERSONA,
|
|
597
|
+
harnessSourcePrompt: config.harnessSourcePrompt ?? DEFAULT_DSH_CORE_SOURCE_PROMPT,
|
|
598
|
+
webSurfacePrompt: config.webSurfacePrompt ?? DEFAULT_DSH_CORE_WEB_PROMPT,
|
|
538
599
|
};
|
|
539
600
|
if (resolved.codexCore
|
|
540
601
|
&& ctx.fs.sandboxMode !== undefined
|
|
541
602
|
&& ctx.get('sandboxPolicy') === undefined) {
|
|
542
603
|
throw new Error('codex: a sandboxing filesystem requires ctx.sandboxPolicy');
|
|
543
604
|
}
|
|
544
|
-
const codexSettings = installCodexSettings(ctx, resolved.systemPrompt);
|
|
605
|
+
const codexSettings = installCodexSettings(ctx, resolved.systemPrompt, resolved.persona, resolved.harnessSourcePrompt, resolved.webSurfacePrompt);
|
|
545
606
|
const execConfig = { ...resolved, currentSettings: codexSettings.current };
|
|
546
607
|
if (resolved.globalEnhancements) {
|
|
547
608
|
// The generic pi-ai plugin remains the owner of provider routes. This
|
|
@@ -559,22 +620,26 @@ export function apply(ctx, config = {}) {
|
|
|
559
620
|
}
|
|
560
621
|
ctx.on('llm/stream', ((options, next) => {
|
|
561
622
|
const settings = codexSettings.current();
|
|
562
|
-
const
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
623
|
+
const contextWindow = options.contextWindow ?? settings.contextWindow;
|
|
624
|
+
const compactionMode = codexCompactionMode();
|
|
625
|
+
const legacySafeNext = () => repairLegacyPiAiContextOverflow(next(), options.model, contextWindow);
|
|
626
|
+
if (options.purpose === 'compaction' && isGptModel(options.model)) {
|
|
627
|
+
const useRemoteCompaction = compactionMode === 'remote'
|
|
628
|
+
|| (compactionMode !== 'local' && resolved.remoteCompact && settings.remoteCompactionEnabled);
|
|
629
|
+
if (useRemoteCompaction) {
|
|
630
|
+
return remoteCompactStream(ctx, options, legacySafeNext, {
|
|
631
|
+
hostedWebSearch: resolved.hostedWebSearch && settings.hostedWebSearchEnabled,
|
|
632
|
+
customApplyPatch: settings.patchToolEnabled,
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
return legacySafeNext();
|
|
571
636
|
}
|
|
572
637
|
if (options.purpose === undefined && isGptModel(options.model)) {
|
|
573
638
|
return repairLegacyPiAiContextOverflow(hostedWebSearchStream(next, {
|
|
574
639
|
serviceTier: options.serviceTier,
|
|
575
640
|
hostedWebSearch: resolved.hostedWebSearch && settings.hostedWebSearchEnabled,
|
|
576
641
|
customApplyPatch: settings.patchToolEnabled,
|
|
577
|
-
}), options.model,
|
|
642
|
+
}), options.model, contextWindow);
|
|
578
643
|
}
|
|
579
644
|
return next();
|
|
580
645
|
}));
|
package/lib/types/patch.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/** Parser and line-oriented applicator for Codex's `apply_patch` language. */
|
|
2
2
|
export const APPLY_PATCH_DESCRIPTION = 'Edits files using Codex patch syntax with Begin/End Patch markers and file update directives. In hunk lines, the first character is the operation marker; repeat a source-leading marker when the source line itself starts with one.';
|
|
3
3
|
/** The grammar sent to providers that support OpenAI custom grammar tools. */
|
|
4
|
-
export const APPLY_PATCH_GRAMMAR = String.raw `start: begin_patch hunk+ end_patch
|
|
5
|
-
begin_patch: "*** Begin Patch" LF
|
|
6
|
-
end_patch: "*** End Patch" LF?
|
|
7
|
-
hunk: add_hunk | delete_hunk | update_hunk
|
|
8
|
-
add_hunk: "*** Add File: " filename LF add_line+
|
|
9
|
-
delete_hunk: "*** Delete File: " filename LF
|
|
10
|
-
update_hunk: "*** Update File: " filename LF change_move? change?
|
|
11
|
-
filename: /(.+)/
|
|
12
|
-
add_line: "+" /(.*)/ LF -> line
|
|
13
|
-
change_move: "*** Move to: " filename LF
|
|
14
|
-
change: (change_context | change_line)+ eof_line?
|
|
15
|
-
change_context: ("@@" | "@@ " /(.+)/) LF
|
|
16
|
-
change_line: ("+" | "-" | " ") /(.*)/ LF
|
|
17
|
-
eof_line: "*** End of File" LF
|
|
18
|
-
%import common.LF
|
|
4
|
+
export const APPLY_PATCH_GRAMMAR = String.raw `start: begin_patch hunk+ end_patch
|
|
5
|
+
begin_patch: "*** Begin Patch" LF
|
|
6
|
+
end_patch: "*** End Patch" LF?
|
|
7
|
+
hunk: add_hunk | delete_hunk | update_hunk
|
|
8
|
+
add_hunk: "*** Add File: " filename LF add_line+
|
|
9
|
+
delete_hunk: "*** Delete File: " filename LF
|
|
10
|
+
update_hunk: "*** Update File: " filename LF change_move? change?
|
|
11
|
+
filename: /(.+)/
|
|
12
|
+
add_line: "+" /(.*)/ LF -> line
|
|
13
|
+
change_move: "*** Move to: " filename LF
|
|
14
|
+
change: (change_context | change_line)+ eof_line?
|
|
15
|
+
change_context: ("@@" | "@@ " /(.+)/) LF
|
|
16
|
+
change_line: ("+" | "-" | " ") /(.*)/ LF
|
|
17
|
+
eof_line: "*** End of File" LF
|
|
18
|
+
%import common.LF
|
|
19
19
|
`;
|
|
20
20
|
function invalid(message) {
|
|
21
21
|
throw new Error(`apply_patch: ${message}`);
|
package/lib/types/prompt.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
/** Default plugin-owned Codex operating prompt. */
|
|
2
2
|
export declare const DEFAULT_CODEX_SYSTEM_PROMPT: string;
|
|
3
|
+
/** Default deployment Persona template used by the Codex preset. */
|
|
4
|
+
export declare const DEFAULT_CODEX_PERSONA: string;
|
|
5
|
+
/** Default DSH Core source-checkout guidance template. */
|
|
6
|
+
export declare const DEFAULT_DSH_CORE_SOURCE_PROMPT: string;
|
|
7
|
+
/** Default DSH Web runtime guidance template. */
|
|
8
|
+
export declare const DEFAULT_DSH_CORE_WEB_PROMPT: string;
|
|
3
9
|
/** Resolve the full plugin-owned prompt, preserving intentional empty overrides. */
|
|
4
10
|
export declare function resolveCodexSystemPrompt(systemPrompt?: string): string;
|
|
5
11
|
//# sourceMappingURL=prompt.d.ts.map
|
package/lib/types/prompt.js
CHANGED
|
@@ -1,40 +1,55 @@
|
|
|
1
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
|
-
-
|
|
35
|
-
- 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.
|
|
36
|
-
- Solve problems by thinking from first principles and at a higher level.
|
|
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
|
+
- 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.
|
|
35
|
+
- 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.
|
|
36
|
+
- Solve problems by thinking from first principles and at a higher level.
|
|
37
37
|
`;
|
|
38
|
+
/** Default deployment Persona template used by the Codex preset. */
|
|
39
|
+
export const DEFAULT_CODEX_PERSONA = String.raw `You are Codex, a coding agent based on the {{model}} model. Your working directory is {{cwd}}.`;
|
|
40
|
+
/** Default DSH Core source-checkout guidance template. */
|
|
41
|
+
export 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.`;
|
|
42
|
+
/** Default DSH Web runtime guidance template. */
|
|
43
|
+
export const DEFAULT_DSH_CORE_WEB_PROMPT = [
|
|
44
|
+
'You are interacting with the user through the DeepSeek Harness Web GUI at {{webUrl}}.',
|
|
45
|
+
'When the user refers to "this page", "this GUI", or "this app" without naming another target, they mean this GUI.',
|
|
46
|
+
'The browser provides no implicit DOM, route, or screenshot context.',
|
|
47
|
+
'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.',
|
|
48
|
+
'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.',
|
|
49
|
+
'Starting another server does not update this GUI.',
|
|
50
|
+
'The apps/web Vite entry builds the shell but is not a standalone application because only dsh web injects window.__DSH_BOOT__.',
|
|
51
|
+
'Do not start a replacement server unless the user asks; if one is needed, use a managed background job and verify its exact URL.',
|
|
52
|
+
].join(' ');
|
|
38
53
|
/** Resolve the full plugin-owned prompt, preserving intentional empty overrides. */
|
|
39
54
|
export function resolveCodexSystemPrompt(systemPrompt) {
|
|
40
55
|
return systemPrompt ?? DEFAULT_CODEX_SYSTEM_PROMPT;
|
package/lib/types/settings.d.ts
CHANGED
|
@@ -5,8 +5,16 @@ export declare const CODEX_SETTINGS_NAMESPACE: Branded<"SettingsNamespace">;
|
|
|
5
5
|
export interface CodexSettings {
|
|
6
6
|
/** Use the Responses priority service tier for GPT requests. */
|
|
7
7
|
fast: boolean;
|
|
8
|
+
/** Show the Fast mode switch in the conversation composer. */
|
|
9
|
+
fastModeControlEnabled: boolean;
|
|
8
10
|
/** Optional context capacity override, in tokens. */
|
|
9
11
|
contextWindow?: number;
|
|
12
|
+
/** Deployment Persona template; supports the host's prompt variables. */
|
|
13
|
+
persona?: string;
|
|
14
|
+
/** DSH Core source-checkout guidance template. */
|
|
15
|
+
harnessSourcePrompt?: string;
|
|
16
|
+
/** DSH Core Web GUI guidance template. */
|
|
17
|
+
webSurfacePrompt?: string;
|
|
10
18
|
/** Complete plugin-owned Codex operating prompt. */
|
|
11
19
|
systemPrompt?: string;
|
|
12
20
|
/** Inject the plugin-owned Codex operating prompt. */
|
package/lib/types/settings.js
CHANGED
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
import z from '@deepseek-ai/schemastery';
|
|
3
3
|
import { settingsNamespace } from '@deepseek-ai/dsh-settings';
|
|
4
4
|
import { CODEX_CONTEXT_MAX } from "./context.js";
|
|
5
|
-
import { DEFAULT_CODEX_SYSTEM_PROMPT } from "./prompt.js";
|
|
5
|
+
import { DEFAULT_CODEX_PERSONA, DEFAULT_CODEX_SYSTEM_PROMPT, DEFAULT_DSH_CORE_SOURCE_PROMPT, DEFAULT_DSH_CORE_WEB_PROMPT, } from "./prompt.js";
|
|
6
6
|
/** Live Codex controls shared by the Web UI and agent layer. */
|
|
7
7
|
export const CODEX_SETTINGS_NAMESPACE = settingsNamespace('codex');
|
|
8
8
|
/** Default settings exposed even before a Codex session is opened. */
|
|
9
9
|
export const CODEX_SETTINGS_ENTRY = {
|
|
10
10
|
fast: false,
|
|
11
|
+
fastModeControlEnabled: true,
|
|
12
|
+
persona: DEFAULT_CODEX_PERSONA,
|
|
13
|
+
harnessSourcePrompt: DEFAULT_DSH_CORE_SOURCE_PROMPT,
|
|
14
|
+
webSurfacePrompt: DEFAULT_DSH_CORE_WEB_PROMPT,
|
|
11
15
|
systemPrompt: DEFAULT_CODEX_SYSTEM_PROMPT,
|
|
12
16
|
promptEnabled: true,
|
|
13
17
|
terminalToolsEnabled: true,
|
|
@@ -19,7 +23,11 @@ export const CODEX_SETTINGS_ENTRY = {
|
|
|
19
23
|
};
|
|
20
24
|
export const CODEX_SETTINGS_SCHEMA = z.object({
|
|
21
25
|
fast: z.boolean().default(false),
|
|
26
|
+
fastModeControlEnabled: z.boolean().default(true),
|
|
22
27
|
contextWindow: z.number().step(1).min(1).max(CODEX_CONTEXT_MAX),
|
|
28
|
+
persona: z.string().default(DEFAULT_CODEX_PERSONA),
|
|
29
|
+
harnessSourcePrompt: z.string().default(DEFAULT_DSH_CORE_SOURCE_PROMPT),
|
|
30
|
+
webSurfacePrompt: z.string().default(DEFAULT_DSH_CORE_WEB_PROMPT),
|
|
23
31
|
systemPrompt: z.string().default(DEFAULT_CODEX_SYSTEM_PROMPT),
|
|
24
32
|
promptEnabled: z.boolean().default(true),
|
|
25
33
|
terminalToolsEnabled: z.boolean().default(true),
|