@shuind/dsh-codex-harness 0.2.15 → 0.2.17

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,15 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import type { PromptAssembly } from '@deepseek-ai/dsh-system-prompt';
3
+ import z from '@deepseek-ai/schemastery';
4
+ export interface Config {
5
+ persona?: string;
6
+ harnessSourcePrompt?: string;
7
+ webSurfacePrompt?: string;
8
+ }
9
+ export declare const Config: z<Config>;
10
+ export declare const name = "preset-prompt-sections";
11
+ export declare const inject: string[];
12
+ /** Override only existing sections; dynamic runtime context and tool guidance remain host-owned. */
13
+ export declare function applyPromptSections(assembly: PromptAssembly, config: Config): PromptAssembly;
14
+ export declare function apply(ctx: Context, config: Config): void;
15
+ //# sourceMappingURL=prompt-sections.d.ts.map
@@ -0,0 +1,23 @@
1
+ import z from '@deepseek-ai/schemastery';
2
+ export const Config = z.object({ persona: z.string(), harnessSourcePrompt: z.string(), webSurfacePrompt: z.string() });
3
+ export const name = 'preset-prompt-sections';
4
+ export const inject = ['systemPrompt'];
5
+ /** Override only existing sections; dynamic runtime context and tool guidance remain host-owned. */
6
+ export function applyPromptSections(assembly, config) {
7
+ const variables = { ...assembly.variables };
8
+ variables.sourceRoot ??= assembly.sections.find(s => s.name === 'harness:source')?.text.match(/^The DeepSeek Harness implementation checkout is at (.+?)\. The checkout location/u)?.[1];
9
+ variables.webUrl ??= assembly.sections.find(s => s.name === 'app:web-surface')?.text.match(/^You are interacting with the user through the DeepSeek Harness Web GUI at (.+?)\. When/u)?.[1];
10
+ const values = {
11
+ 'deployment:persona': config.persona,
12
+ 'harness:source': config.harnessSourcePrompt,
13
+ 'app:web-surface': config.webSurfacePrompt,
14
+ };
15
+ return { ...assembly, sections: assembly.sections.map(section => {
16
+ const text = values[section.name];
17
+ return text === undefined ? section : { ...section, text: text.replace(/\{\{([\w.-]+)\}\}/g, (whole, key) => variables[key] ?? whole) };
18
+ }) };
19
+ }
20
+ export function apply(ctx, config) {
21
+ ctx.on('system-prompt/assemble', async (_assembly, _context, next) => applyPromptSections(await next(), config));
22
+ }
23
+ //# sourceMappingURL=prompt-sections.js.map
@@ -0,0 +1,47 @@
1
+ import { z } from 'zod';
2
+ /** Host-side Remote contract consumed by the browser's preset editor. */
3
+ export declare const TYPERT: {
4
+ package: string;
5
+ face: "host";
6
+ schemas: never[];
7
+ invocations: {
8
+ id: string;
9
+ service: string;
10
+ namespace: string;
11
+ method: string;
12
+ invocation: {
13
+ kind: "direct";
14
+ };
15
+ parameters: {
16
+ name: string;
17
+ wire: string;
18
+ source: "json";
19
+ codec: {
20
+ mode: "strict";
21
+ typeSymbol: string;
22
+ schema: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
23
+ };
24
+ }[];
25
+ result: {
26
+ mode: "strict";
27
+ typeSymbol: string;
28
+ schema: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
29
+ };
30
+ }[];
31
+ model: {
32
+ services: {
33
+ description: string;
34
+ summary: string;
35
+ tags: never[];
36
+ jsDoc: string;
37
+ key: string;
38
+ exportName: string;
39
+ members: never[];
40
+ types: never[];
41
+ }[];
42
+ events: never[];
43
+ objects: never[];
44
+ };
45
+ };
46
+ export default TYPERT;
47
+ //# sourceMappingURL=typert.host.d.ts.map
@@ -0,0 +1,99 @@
1
+ import { z } from 'zod';
2
+ const PACKAGE = '@shuind/dsh-codex-harness';
3
+ const SERVICE = 'codexPresetEditor';
4
+ const promptSections = z.array(z.object({ id: z.string(), label: z.string(), text: z.string().max(1_000_000), editable: z.boolean(), suppressed: z.boolean().optional() })).max(200);
5
+ const fields = {
6
+ name: z.string().max(200),
7
+ description: z.string().max(4000),
8
+ systemPrompt: z.string().max(1_000_000),
9
+ inheritPrompt: z.boolean(),
10
+ };
11
+ const codexOptions = z.object({
12
+ promptEnabled: z.boolean(),
13
+ terminalToolsEnabled: z.boolean(),
14
+ patchToolEnabled: z.boolean(),
15
+ planToolEnabled: z.boolean(),
16
+ hostedWebSearchEnabled: z.boolean(),
17
+ remoteCompactionEnabled: z.boolean(),
18
+ });
19
+ const document = z.object({
20
+ ...fields,
21
+ id: z.string(),
22
+ revision: z.string(),
23
+ editable: z.boolean(),
24
+ codex: z.boolean(),
25
+ codexOptions,
26
+ promptSections, composition: z.string(),
27
+ });
28
+ const catalog = z.object({
29
+ presets: z.array(z.object({
30
+ id: z.string(),
31
+ name: z.string(),
32
+ description: z.string(),
33
+ editable: z.boolean(),
34
+ isDefault: z.boolean(),
35
+ })),
36
+ authorable: z.boolean(),
37
+ excludedCount: z.number(),
38
+ });
39
+ const codexOptionsPatch = codexOptions.partial();
40
+ function descriptor(method, parameter, input, output) {
41
+ const id = `${PACKAGE}#${SERVICE}/${method}`;
42
+ return {
43
+ id,
44
+ service: SERVICE,
45
+ namespace: SERVICE,
46
+ method,
47
+ invocation: { kind: 'direct' },
48
+ parameters: parameter === undefined ? [] : [{
49
+ name: parameter,
50
+ wire: parameter,
51
+ source: 'json',
52
+ codec: { mode: 'strict', typeSymbol: `${id}:${parameter}`, schema: input },
53
+ }],
54
+ result: { mode: 'strict', typeSymbol: `${id}:result`, schema: output },
55
+ };
56
+ }
57
+ const updateInput = z.object({
58
+ ...fields,
59
+ id: z.string(),
60
+ revision: z.string().optional(),
61
+ composition: z.string().max(1_000_000).optional(),
62
+ enableCodex: z.boolean().optional(),
63
+ promptSections: promptSections.optional(), codexOptions: codexOptionsPatch.optional(),
64
+ });
65
+ const createInput = z.object({
66
+ ...fields,
67
+ sourceId: z.string(),
68
+ enableCodex: z.boolean().optional(),
69
+ composition: z.string().max(1_000_000).optional(),
70
+ promptSections: promptSections.optional(), codexOptions: codexOptionsPatch.optional(),
71
+ });
72
+ /** Host-side Remote contract consumed by the browser's preset editor. */
73
+ export const TYPERT = {
74
+ package: PACKAGE,
75
+ face: 'host',
76
+ schemas: [],
77
+ invocations: [
78
+ descriptor('catalog', undefined, z.unknown(), catalog),
79
+ descriptor('read', 'id', z.string(), document),
80
+ descriptor('update', 'rawInput', updateInput, document),
81
+ descriptor('create', 'rawInput', createInput, document),
82
+ ],
83
+ model: {
84
+ services: [{
85
+ description: 'Author and inspect DSH agent presets with Codex capabilities.',
86
+ summary: 'Codex preset editor.',
87
+ tags: [],
88
+ jsDoc: '',
89
+ key: SERVICE,
90
+ exportName: 'CodexPresetEditor',
91
+ members: [],
92
+ types: [],
93
+ }],
94
+ events: [],
95
+ objects: [],
96
+ },
97
+ };
98
+ export default TYPERT;
99
+ //# sourceMappingURL=typert.host.js.map