@shuind/dsh-codex-harness 0.2.21 → 0.3.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/CHANGELOG.md +185 -0
- package/README.md +38 -50
- package/RELEASE.md +61 -0
- package/assets/codex.svg +5 -0
- package/cordis.patch.yml +181 -6
- package/docs/preset-library.md +33 -23
- package/docs/tool-policy-benchmark.json +310 -0
- package/docs/tool-policy.md +148 -0
- package/lib/client.js +4774 -2416
- package/lib/compact-command.js +416 -0
- package/lib/compaction.js +141 -12
- package/lib/hybrid-executor.js +1196 -0
- package/lib/index.js +3658 -2334
- package/lib/preferences.js +117 -0
- package/lib/tool-policy.js +2422 -0
- package/lib/typert.js +86 -79
- package/lib/types/client/activity.d.ts +33 -9
- package/lib/types/client/activity.js +4 -3
- package/lib/types/client/desktop.d.ts +67 -0
- package/lib/types/client/desktop.js +229 -0
- package/lib/types/client/index.d.ts +207 -110
- package/lib/types/client/index.js +99 -492
- package/lib/types/client/policy-drafts.d.ts +25 -0
- package/lib/types/client/policy-drafts.js +47 -0
- package/lib/types/client/policy-locale.d.ts +260 -0
- package/lib/types/client/policy-locale.js +357 -0
- package/lib/types/client/preset-manager.d.ts +38 -10
- package/lib/types/client/preset-manager.js +235 -185
- package/lib/types/client/preset-requests.d.ts +12 -0
- package/lib/types/client/preset-requests.js +101 -0
- package/lib/types/client/tool-policy.d.ts +33 -0
- package/lib/types/client/tool-policy.js +336 -0
- package/lib/types/contracts/preset-editor-schema.d.ts +78 -0
- package/lib/types/contracts/preset-editor-schema.js +95 -0
- package/lib/types/{prompt.js → contracts/prompt.js} +13 -7
- package/lib/types/{settings.d.ts → contracts/settings.d.ts} +11 -4
- package/lib/types/{settings.js → contracts/settings.js} +22 -6
- package/lib/types/contracts/tool-policy-contract.d.ts +63 -0
- package/lib/types/contracts/tool-policy-contract.js +33 -0
- package/lib/types/contracts/ui-contracts.d.ts +92 -0
- package/lib/types/contracts/ui-contracts.js +83 -0
- package/lib/types/entries/client.d.ts +10 -0
- package/lib/types/entries/client.js +10 -0
- package/lib/types/{compact-command.d.ts → entries/compact-command.d.ts} +2 -0
- package/lib/types/entries/compact-command.js +176 -0
- package/lib/types/{compaction.d.ts → entries/compaction.d.ts} +15 -3
- package/lib/types/{compaction.js → entries/compaction.js} +47 -11
- package/lib/types/entries/hybrid-executor.d.ts +19 -0
- package/lib/types/entries/hybrid-executor.js +57 -0
- package/lib/types/entries/index.d.ts +66 -0
- package/lib/types/entries/index.js +192 -0
- package/lib/types/entries/preferences.d.ts +11 -0
- package/lib/types/entries/preferences.js +16 -0
- package/lib/types/entries/tool-policy.d.ts +97 -0
- package/lib/types/entries/tool-policy.js +158 -0
- package/lib/types/entries/typert.host.d.ts +23 -0
- package/lib/types/entries/typert.host.js +24 -0
- package/lib/types/hybrid/codex-hybrid-executor.d.ts +44 -0
- package/lib/types/hybrid/codex-hybrid-executor.js +257 -0
- package/lib/types/hybrid/hybrid-sdk.d.ts +13 -0
- package/lib/types/hybrid/hybrid-sdk.js +196 -0
- package/lib/types/hybrid/program-calls.d.ts +28 -0
- package/lib/types/hybrid/program-calls.js +193 -0
- package/lib/types/hybrid/subcall-scheduler.d.ts +90 -0
- package/lib/types/hybrid/subcall-scheduler.js +343 -0
- package/lib/types/policy/deferred-tools.d.ts +42 -0
- package/lib/types/policy/deferred-tools.js +264 -0
- package/lib/types/policy/overlay-installer.d.ts +12 -0
- package/lib/types/policy/overlay-installer.js +179 -0
- package/lib/types/policy/rule-resolver.d.ts +94 -0
- package/lib/types/policy/rule-resolver.js +114 -0
- package/lib/types/policy/tool-capabilities.d.ts +33 -0
- package/lib/types/policy/tool-capabilities.js +46 -0
- package/lib/types/{activity.d.ts → presets/activity.d.ts} +3 -5
- package/lib/types/{activity.js → presets/activity.js} +51 -27
- package/lib/types/presets/desktop-preset.d.ts +22 -0
- package/lib/types/presets/desktop-preset.js +43 -0
- package/lib/types/presets/preset-editor.d.ts +47 -0
- package/lib/types/presets/preset-editor.js +81 -0
- package/lib/types/presets/preset-prompt-catalog.d.ts +23 -0
- package/lib/types/presets/preset-prompt-catalog.js +215 -0
- package/lib/types/presets/preset-tool-catalog.d.ts +5 -0
- package/lib/types/presets/preset-tool-catalog.js +58 -0
- package/lib/types/presets/runtime-enhancements.d.ts +45 -0
- package/lib/types/presets/runtime-enhancements.js +349 -0
- package/lib/types/presets/small-window-compaction.d.ts +15 -0
- package/lib/types/presets/small-window-compaction.js +121 -0
- package/lib/types/responses/compact-checkpoint.d.ts +27 -0
- package/lib/types/responses/compact-checkpoint.js +257 -0
- package/lib/types/responses/fetch-transport.d.ts +16 -0
- package/lib/types/responses/fetch-transport.js +257 -0
- package/lib/types/responses/remote-compact.d.ts +13 -0
- package/lib/types/responses/remote-compact.js +319 -0
- package/lib/types/responses/sse-diagnostics.d.ts +9 -0
- package/lib/types/responses/sse-diagnostics.js +157 -0
- package/lib/types/responses/wire-rewrite.d.ts +35 -0
- package/lib/types/responses/wire-rewrite.js +237 -0
- package/lib/types/tools/exec-output.d.ts +58 -0
- package/lib/types/tools/exec-output.js +173 -0
- package/lib/types/tools/exec-plan-tools.d.ts +37 -0
- package/lib/types/tools/exec-plan-tools.js +265 -0
- package/lib/types/tools/exec-runner.d.ts +21 -0
- package/lib/types/tools/exec-runner.js +385 -0
- package/lib/types/tools/patch-tool.d.ts +16 -0
- package/lib/types/tools/patch-tool.js +258 -0
- package/lib/types/{patch.d.ts → tools/patch.d.ts} +1 -1
- package/lib/types/{patch.js → tools/patch.js} +96 -21
- package/locale/en.json +6 -0
- package/locale/hybrid-executor/en.json +6 -0
- package/locale/hybrid-executor/zh.json +6 -0
- package/locale/tool-policy/en.json +6 -0
- package/locale/tool-policy/zh.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +297 -299
- package/presets/{codex-collaboration → codex-hybrid}/agent.cordis.yml +45 -48
- package/presets/codex-hybrid/preset.yml +3 -0
- package/scripts/benchmark-tool-policy.mjs +186 -0
- package/scripts/build-preset.mjs +19 -0
- package/scripts/clean-build.mjs +11 -0
- package/src/client/activity.ts +83 -0
- package/src/client/desktop.tsx +276 -0
- package/src/client/index.tsx +391 -0
- package/src/client/policy-drafts.ts +56 -0
- package/src/client/policy-locale.ts +362 -0
- package/src/client/preset-manager.tsx +376 -0
- package/src/client/preset-requests.ts +113 -0
- package/src/client/tool-policy.tsx +402 -0
- package/src/contracts/preset-editor-schema.ts +110 -0
- package/src/contracts/prompt.ts +66 -0
- package/src/contracts/settings.ts +103 -0
- package/src/contracts/tool-policy-contract.ts +93 -0
- package/src/contracts/ui-contracts.ts +173 -0
- package/src/entries/client.tsx +14 -0
- package/src/entries/compact-command.ts +256 -0
- package/src/entries/compaction.ts +218 -0
- package/src/entries/hybrid-executor.ts +76 -0
- package/src/entries/index.ts +298 -0
- package/src/entries/preferences.ts +17 -0
- package/src/entries/tool-policy.ts +162 -0
- package/src/entries/typert.host.ts +29 -0
- package/src/hybrid/codex-hybrid-executor.ts +310 -0
- package/src/hybrid/hybrid-sdk.ts +217 -0
- package/src/hybrid/program-calls.ts +202 -0
- package/src/hybrid/subcall-scheduler.ts +446 -0
- package/src/policy/deferred-tools.ts +331 -0
- package/src/policy/overlay-installer.ts +191 -0
- package/src/policy/rule-resolver.ts +128 -0
- package/src/policy/tool-capabilities.ts +88 -0
- package/src/presets/activity.ts +146 -0
- package/src/presets/desktop-preset.ts +60 -0
- package/src/presets/preset-editor.ts +101 -0
- package/src/presets/preset-prompt-catalog.ts +221 -0
- package/src/presets/preset-tool-catalog.ts +58 -0
- package/src/presets/runtime-enhancements.ts +415 -0
- package/src/presets/small-window-compaction.ts +166 -0
- package/src/responses/compact-checkpoint.ts +264 -0
- package/src/responses/fetch-transport.ts +290 -0
- package/src/responses/remote-compact.ts +393 -0
- package/src/responses/sse-diagnostics.ts +156 -0
- package/src/responses/wire-rewrite.ts +261 -0
- package/src/tools/exec-output.ts +211 -0
- package/src/tools/exec-plan-tools.ts +307 -0
- package/src/tools/exec-runner.ts +445 -0
- package/src/tools/patch-tool.ts +331 -0
- package/src/tools/patch.ts +328 -0
- package/tsconfig.json +29 -0
- package/tsdown.config.ts +110 -0
- package/lib/installer.js +0 -237
- package/lib/invariant.js +0 -23
- package/lib/types/activity-types.d.ts +0 -6
- package/lib/types/activity-types.js +0 -3
- package/lib/types/client/preset-copy.d.ts +0 -42
- package/lib/types/client/preset-copy.js +0 -81
- package/lib/types/compact-command.js +0 -79
- package/lib/types/context.d.ts +0 -8
- package/lib/types/context.js +0 -14
- package/lib/types/exec.d.ts +0 -46
- package/lib/types/exec.js +0 -365
- package/lib/types/index.d.ts +0 -95
- package/lib/types/index.js +0 -738
- package/lib/types/installer.d.ts +0 -27
- package/lib/types/installer.js +0 -146
- package/lib/types/invariant.d.ts +0 -16
- package/lib/types/invariant.js +0 -22
- package/lib/types/preset-contract.d.ts +0 -69
- package/lib/types/preset-contract.js +0 -22
- package/lib/types/preset-editor-remote.d.ts +0 -30
- package/lib/types/preset-editor-remote.js +0 -37
- package/lib/types/preset-editor.d.ts +0 -69
- package/lib/types/preset-editor.js +0 -557
- package/lib/types/preset-templates.d.ts +0 -36
- package/lib/types/preset-templates.js +0 -12
- package/lib/types/prompt-sections.d.ts +0 -15
- package/lib/types/prompt-sections.js +0 -23
- package/lib/types/remote.d.ts +0 -40
- package/lib/types/remote.js +0 -683
- package/lib/types/typert.host.d.ts +0 -47
- package/lib/types/typert.host.js +0 -99
- package/presets/codex-collaboration/preset.yml +0 -3
- /package/lib/types/{prompt.d.ts → contracts/prompt.d.ts} +0 -0
|
@@ -1,47 +0,0 @@
|
|
|
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
|
package/lib/types/typert.host.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
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
|
|
File without changes
|