@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.
Files changed (200) hide show
  1. package/CHANGELOG.md +185 -0
  2. package/README.md +38 -50
  3. package/RELEASE.md +61 -0
  4. package/assets/codex.svg +5 -0
  5. package/cordis.patch.yml +181 -6
  6. package/docs/preset-library.md +33 -23
  7. package/docs/tool-policy-benchmark.json +310 -0
  8. package/docs/tool-policy.md +148 -0
  9. package/lib/client.js +4774 -2416
  10. package/lib/compact-command.js +416 -0
  11. package/lib/compaction.js +141 -12
  12. package/lib/hybrid-executor.js +1196 -0
  13. package/lib/index.js +3658 -2334
  14. package/lib/preferences.js +117 -0
  15. package/lib/tool-policy.js +2422 -0
  16. package/lib/typert.js +86 -79
  17. package/lib/types/client/activity.d.ts +33 -9
  18. package/lib/types/client/activity.js +4 -3
  19. package/lib/types/client/desktop.d.ts +67 -0
  20. package/lib/types/client/desktop.js +229 -0
  21. package/lib/types/client/index.d.ts +207 -110
  22. package/lib/types/client/index.js +99 -492
  23. package/lib/types/client/policy-drafts.d.ts +25 -0
  24. package/lib/types/client/policy-drafts.js +47 -0
  25. package/lib/types/client/policy-locale.d.ts +260 -0
  26. package/lib/types/client/policy-locale.js +357 -0
  27. package/lib/types/client/preset-manager.d.ts +38 -10
  28. package/lib/types/client/preset-manager.js +235 -185
  29. package/lib/types/client/preset-requests.d.ts +12 -0
  30. package/lib/types/client/preset-requests.js +101 -0
  31. package/lib/types/client/tool-policy.d.ts +33 -0
  32. package/lib/types/client/tool-policy.js +336 -0
  33. package/lib/types/contracts/preset-editor-schema.d.ts +78 -0
  34. package/lib/types/contracts/preset-editor-schema.js +95 -0
  35. package/lib/types/{prompt.js → contracts/prompt.js} +13 -7
  36. package/lib/types/{settings.d.ts → contracts/settings.d.ts} +11 -4
  37. package/lib/types/{settings.js → contracts/settings.js} +22 -6
  38. package/lib/types/contracts/tool-policy-contract.d.ts +63 -0
  39. package/lib/types/contracts/tool-policy-contract.js +33 -0
  40. package/lib/types/contracts/ui-contracts.d.ts +92 -0
  41. package/lib/types/contracts/ui-contracts.js +83 -0
  42. package/lib/types/entries/client.d.ts +10 -0
  43. package/lib/types/entries/client.js +10 -0
  44. package/lib/types/{compact-command.d.ts → entries/compact-command.d.ts} +2 -0
  45. package/lib/types/entries/compact-command.js +176 -0
  46. package/lib/types/{compaction.d.ts → entries/compaction.d.ts} +15 -3
  47. package/lib/types/{compaction.js → entries/compaction.js} +47 -11
  48. package/lib/types/entries/hybrid-executor.d.ts +19 -0
  49. package/lib/types/entries/hybrid-executor.js +57 -0
  50. package/lib/types/entries/index.d.ts +66 -0
  51. package/lib/types/entries/index.js +192 -0
  52. package/lib/types/entries/preferences.d.ts +11 -0
  53. package/lib/types/entries/preferences.js +16 -0
  54. package/lib/types/entries/tool-policy.d.ts +97 -0
  55. package/lib/types/entries/tool-policy.js +158 -0
  56. package/lib/types/entries/typert.host.d.ts +23 -0
  57. package/lib/types/entries/typert.host.js +24 -0
  58. package/lib/types/hybrid/codex-hybrid-executor.d.ts +44 -0
  59. package/lib/types/hybrid/codex-hybrid-executor.js +257 -0
  60. package/lib/types/hybrid/hybrid-sdk.d.ts +13 -0
  61. package/lib/types/hybrid/hybrid-sdk.js +196 -0
  62. package/lib/types/hybrid/program-calls.d.ts +28 -0
  63. package/lib/types/hybrid/program-calls.js +193 -0
  64. package/lib/types/hybrid/subcall-scheduler.d.ts +90 -0
  65. package/lib/types/hybrid/subcall-scheduler.js +343 -0
  66. package/lib/types/policy/deferred-tools.d.ts +42 -0
  67. package/lib/types/policy/deferred-tools.js +264 -0
  68. package/lib/types/policy/overlay-installer.d.ts +12 -0
  69. package/lib/types/policy/overlay-installer.js +179 -0
  70. package/lib/types/policy/rule-resolver.d.ts +94 -0
  71. package/lib/types/policy/rule-resolver.js +114 -0
  72. package/lib/types/policy/tool-capabilities.d.ts +33 -0
  73. package/lib/types/policy/tool-capabilities.js +46 -0
  74. package/lib/types/{activity.d.ts → presets/activity.d.ts} +3 -5
  75. package/lib/types/{activity.js → presets/activity.js} +51 -27
  76. package/lib/types/presets/desktop-preset.d.ts +22 -0
  77. package/lib/types/presets/desktop-preset.js +43 -0
  78. package/lib/types/presets/preset-editor.d.ts +47 -0
  79. package/lib/types/presets/preset-editor.js +81 -0
  80. package/lib/types/presets/preset-prompt-catalog.d.ts +23 -0
  81. package/lib/types/presets/preset-prompt-catalog.js +215 -0
  82. package/lib/types/presets/preset-tool-catalog.d.ts +5 -0
  83. package/lib/types/presets/preset-tool-catalog.js +58 -0
  84. package/lib/types/presets/runtime-enhancements.d.ts +45 -0
  85. package/lib/types/presets/runtime-enhancements.js +349 -0
  86. package/lib/types/presets/small-window-compaction.d.ts +15 -0
  87. package/lib/types/presets/small-window-compaction.js +121 -0
  88. package/lib/types/responses/compact-checkpoint.d.ts +27 -0
  89. package/lib/types/responses/compact-checkpoint.js +257 -0
  90. package/lib/types/responses/fetch-transport.d.ts +16 -0
  91. package/lib/types/responses/fetch-transport.js +257 -0
  92. package/lib/types/responses/remote-compact.d.ts +13 -0
  93. package/lib/types/responses/remote-compact.js +319 -0
  94. package/lib/types/responses/sse-diagnostics.d.ts +9 -0
  95. package/lib/types/responses/sse-diagnostics.js +157 -0
  96. package/lib/types/responses/wire-rewrite.d.ts +35 -0
  97. package/lib/types/responses/wire-rewrite.js +237 -0
  98. package/lib/types/tools/exec-output.d.ts +58 -0
  99. package/lib/types/tools/exec-output.js +173 -0
  100. package/lib/types/tools/exec-plan-tools.d.ts +37 -0
  101. package/lib/types/tools/exec-plan-tools.js +265 -0
  102. package/lib/types/tools/exec-runner.d.ts +21 -0
  103. package/lib/types/tools/exec-runner.js +385 -0
  104. package/lib/types/tools/patch-tool.d.ts +16 -0
  105. package/lib/types/tools/patch-tool.js +258 -0
  106. package/lib/types/{patch.d.ts → tools/patch.d.ts} +1 -1
  107. package/lib/types/{patch.js → tools/patch.js} +96 -21
  108. package/locale/en.json +6 -0
  109. package/locale/hybrid-executor/en.json +6 -0
  110. package/locale/hybrid-executor/zh.json +6 -0
  111. package/locale/tool-policy/en.json +6 -0
  112. package/locale/tool-policy/zh.json +6 -0
  113. package/locale/zh.json +6 -0
  114. package/package.json +297 -299
  115. package/presets/{codex-collaboration → codex-hybrid}/agent.cordis.yml +45 -48
  116. package/presets/codex-hybrid/preset.yml +3 -0
  117. package/scripts/benchmark-tool-policy.mjs +186 -0
  118. package/scripts/build-preset.mjs +19 -0
  119. package/scripts/clean-build.mjs +11 -0
  120. package/src/client/activity.ts +83 -0
  121. package/src/client/desktop.tsx +276 -0
  122. package/src/client/index.tsx +391 -0
  123. package/src/client/policy-drafts.ts +56 -0
  124. package/src/client/policy-locale.ts +362 -0
  125. package/src/client/preset-manager.tsx +376 -0
  126. package/src/client/preset-requests.ts +113 -0
  127. package/src/client/tool-policy.tsx +402 -0
  128. package/src/contracts/preset-editor-schema.ts +110 -0
  129. package/src/contracts/prompt.ts +66 -0
  130. package/src/contracts/settings.ts +103 -0
  131. package/src/contracts/tool-policy-contract.ts +93 -0
  132. package/src/contracts/ui-contracts.ts +173 -0
  133. package/src/entries/client.tsx +14 -0
  134. package/src/entries/compact-command.ts +256 -0
  135. package/src/entries/compaction.ts +218 -0
  136. package/src/entries/hybrid-executor.ts +76 -0
  137. package/src/entries/index.ts +298 -0
  138. package/src/entries/preferences.ts +17 -0
  139. package/src/entries/tool-policy.ts +162 -0
  140. package/src/entries/typert.host.ts +29 -0
  141. package/src/hybrid/codex-hybrid-executor.ts +310 -0
  142. package/src/hybrid/hybrid-sdk.ts +217 -0
  143. package/src/hybrid/program-calls.ts +202 -0
  144. package/src/hybrid/subcall-scheduler.ts +446 -0
  145. package/src/policy/deferred-tools.ts +331 -0
  146. package/src/policy/overlay-installer.ts +191 -0
  147. package/src/policy/rule-resolver.ts +128 -0
  148. package/src/policy/tool-capabilities.ts +88 -0
  149. package/src/presets/activity.ts +146 -0
  150. package/src/presets/desktop-preset.ts +60 -0
  151. package/src/presets/preset-editor.ts +101 -0
  152. package/src/presets/preset-prompt-catalog.ts +221 -0
  153. package/src/presets/preset-tool-catalog.ts +58 -0
  154. package/src/presets/runtime-enhancements.ts +415 -0
  155. package/src/presets/small-window-compaction.ts +166 -0
  156. package/src/responses/compact-checkpoint.ts +264 -0
  157. package/src/responses/fetch-transport.ts +290 -0
  158. package/src/responses/remote-compact.ts +393 -0
  159. package/src/responses/sse-diagnostics.ts +156 -0
  160. package/src/responses/wire-rewrite.ts +261 -0
  161. package/src/tools/exec-output.ts +211 -0
  162. package/src/tools/exec-plan-tools.ts +307 -0
  163. package/src/tools/exec-runner.ts +445 -0
  164. package/src/tools/patch-tool.ts +331 -0
  165. package/src/tools/patch.ts +328 -0
  166. package/tsconfig.json +29 -0
  167. package/tsdown.config.ts +110 -0
  168. package/lib/installer.js +0 -237
  169. package/lib/invariant.js +0 -23
  170. package/lib/types/activity-types.d.ts +0 -6
  171. package/lib/types/activity-types.js +0 -3
  172. package/lib/types/client/preset-copy.d.ts +0 -42
  173. package/lib/types/client/preset-copy.js +0 -81
  174. package/lib/types/compact-command.js +0 -79
  175. package/lib/types/context.d.ts +0 -8
  176. package/lib/types/context.js +0 -14
  177. package/lib/types/exec.d.ts +0 -46
  178. package/lib/types/exec.js +0 -365
  179. package/lib/types/index.d.ts +0 -95
  180. package/lib/types/index.js +0 -738
  181. package/lib/types/installer.d.ts +0 -27
  182. package/lib/types/installer.js +0 -146
  183. package/lib/types/invariant.d.ts +0 -16
  184. package/lib/types/invariant.js +0 -22
  185. package/lib/types/preset-contract.d.ts +0 -69
  186. package/lib/types/preset-contract.js +0 -22
  187. package/lib/types/preset-editor-remote.d.ts +0 -30
  188. package/lib/types/preset-editor-remote.js +0 -37
  189. package/lib/types/preset-editor.d.ts +0 -69
  190. package/lib/types/preset-editor.js +0 -557
  191. package/lib/types/preset-templates.d.ts +0 -36
  192. package/lib/types/preset-templates.js +0 -12
  193. package/lib/types/prompt-sections.d.ts +0 -15
  194. package/lib/types/prompt-sections.js +0 -23
  195. package/lib/types/remote.d.ts +0 -40
  196. package/lib/types/remote.js +0 -683
  197. package/lib/types/typert.host.d.ts +0 -47
  198. package/lib/types/typert.host.js +0 -99
  199. package/presets/codex-collaboration/preset.yml +0 -3
  200. /package/lib/types/{prompt.d.ts → contracts/prompt.d.ts} +0 -0
@@ -0,0 +1,25 @@
1
+ import type { ToolPolicyRule } from '../contracts/tool-policy-contract.ts';
2
+ /** Ephemeral UI drafts only; accepted ConfigForms values remain authoritative. */
3
+ export interface PresetDraft {
4
+ readonly preset: string;
5
+ readonly revision: number | undefined;
6
+ readonly baseline: readonly ToolPolicyRule[];
7
+ readonly rules: readonly ToolPolicyRule[];
8
+ }
9
+ export type PresetDrafts = ReadonlyMap<string, PresetDraft>;
10
+ export interface PolicySnapshot {
11
+ readonly revision: number | undefined;
12
+ readonly rules: readonly ToolPolicyRule[];
13
+ }
14
+ export interface PreparedPresetSave extends PolicySnapshot {
15
+ readonly draft: PresetDraft;
16
+ readonly before: PolicySnapshot;
17
+ }
18
+ export declare const sameRules: (a: readonly ToolPolicyRule[], b: readonly ToolPolicyRule[]) => boolean;
19
+ export declare const presetRules: (rules: readonly ToolPolicyRule[], preset: string) => readonly ToolPolicyRule[];
20
+ export declare function editPresetDraft(drafts: PresetDrafts, preset: string, accepted: PolicySnapshot, change: (rules: readonly ToolPolicyRule[]) => readonly ToolPolicyRule[]): PresetDrafts;
21
+ /** Replace just this source target, preserving all accepted other targets/order. */
22
+ export declare function mergePresetRules(accepted: readonly ToolPolicyRule[], preset: string, replacement: readonly ToolPolicyRule[]): readonly ToolPolicyRule[];
23
+ export declare function preparePresetSave(draft: PresetDraft, accepted: PolicySnapshot): PreparedPresetSave;
24
+ export declare function acceptPresetSave(drafts: PresetDrafts, saved: PreparedPresetSave, accepted: PolicySnapshot): PresetDrafts;
25
+ //# sourceMappingURL=policy-drafts.d.ts.map
@@ -0,0 +1,47 @@
1
+ function canonical(value) {
2
+ if (Array.isArray(value))
3
+ return value.map(canonical);
4
+ if (value !== null && typeof value === 'object')
5
+ return Object.fromEntries(Object.entries(value)
6
+ .filter(([, item]) => item !== undefined).sort(([a], [b]) => a.localeCompare(b)).map(([key, item]) => [key, canonical(item)]));
7
+ return value;
8
+ }
9
+ export const sameRules = (a, b) => JSON.stringify(canonical(a)) === JSON.stringify(canonical(b));
10
+ export const presetRules = (rules, preset) => rules.filter(rule => rule.preset === preset);
11
+ export function editPresetDraft(drafts, preset, accepted, change) {
12
+ const previous = drafts.get(preset);
13
+ const next = new Map(drafts);
14
+ next.set(preset, { preset, revision: previous === undefined ? accepted.revision : previous.revision,
15
+ baseline: previous?.baseline ?? accepted.rules, rules: change(previous?.rules ?? presetRules(accepted.rules, preset)) });
16
+ return next;
17
+ }
18
+ /** Replace just this source target, preserving all accepted other targets/order. */
19
+ export function mergePresetRules(accepted, preset, replacement) {
20
+ const first = accepted.findIndex(rule => rule.preset === preset);
21
+ if (first < 0)
22
+ return [...accepted, ...replacement];
23
+ return [...accepted.slice(0, first), ...replacement, ...accepted.slice(first).filter(rule => rule.preset !== preset)];
24
+ }
25
+ export function preparePresetSave(draft, accepted) {
26
+ // Never silently rebase an external edit, even if only a different target changed.
27
+ if (draft.revision !== accepted.revision || !sameRules(draft.baseline, accepted.rules))
28
+ throw new Error('policy-draft-conflict');
29
+ return { draft, before: accepted, revision: draft.revision, rules: mergePresetRules(accepted.rules, draft.preset, draft.rules) };
30
+ }
31
+ export function acceptPresetSave(drafts, saved, accepted) {
32
+ const next = new Map(drafts);
33
+ if (next.get(saved.draft.preset) === saved.draft)
34
+ next.delete(saved.draft.preset);
35
+ // A true result is not enough: a later external view may already have arrived.
36
+ if (!sameRules(accepted.rules, saved.rules))
37
+ return next;
38
+ for (const [preset, draft] of next) {
39
+ if (draft.revision !== saved.before.revision || !sameRules(draft.baseline, saved.before.rules))
40
+ continue;
41
+ if (!sameRules(presetRules(saved.before.rules, preset), presetRules(accepted.rules, preset)))
42
+ continue;
43
+ next.set(preset, { ...draft, revision: accepted.revision, baseline: accepted.rules });
44
+ }
45
+ return next;
46
+ }
47
+ //# sourceMappingURL=policy-drafts.js.map
@@ -0,0 +1,260 @@
1
+ /** Locale dictionaries, tool grouping, human labels, and DSH-native styles for `ToolPolicySettingsCard`. */
2
+ import type { PresetToolEntry } from '../contracts/tool-policy-contract.ts';
3
+ export declare const toolPolicyEn: {
4
+ readonly settingsTabLabel: "Codex Harness";
5
+ readonly settingsToolsPage: "Preset plans";
6
+ readonly settingsRuntimePage: "Runtime preferences";
7
+ readonly settingsSubTools: "Tools";
8
+ readonly settingsPresetPrompts: "Prompts";
9
+ readonly settingsDefinition: "YAML";
10
+ readonly settingsPreferHostedSearch: "Prefer model-hosted search";
11
+ readonly settingsPreferRemoteCompaction: "Prefer remote compaction";
12
+ readonly settingsSharedFailed: "Not saved; this page’s draft is kept. Shared settings may have changed—discard this page’s draft to reload.";
13
+ readonly settingsRuntimeScope: "Shared in this environment";
14
+ readonly settingsSaveRuntime: "Save runtime preferences";
15
+ readonly settingsBundleSummary: "Configure Codex Harness in its dedicated Settings tab.";
16
+ readonly settingsBundlePath: "Settings → Plugins → Codex Harness";
17
+ readonly settingsDefinitionAbsent: "Choose a preset on Preset plans first.";
18
+ readonly globalGroupRequest: "Model requests";
19
+ readonly globalGroupDisplay: "Display";
20
+ readonly globalPending: "Unsaved";
21
+ readonly toolPolicyTitle: "Tool plan";
22
+ readonly toolPolicyPresetChoice: "Preset";
23
+ readonly toolPolicyInvalidEntry: "Empty preset ID";
24
+ readonly toolPolicyTiming: "Applies to new or reloaded sessions";
25
+ readonly presetPromptsLoading: "Loading prompts…";
26
+ readonly presetPromptsFailed: "Prompts unavailable.";
27
+ readonly presetPromptsEmpty: "No prompt sections.";
28
+ readonly presetPromptsReload: "Reload prompts";
29
+ readonly presetPromptRestore: "Restore original";
30
+ readonly presetPromptReadOnly: "Read-only";
31
+ readonly presetPromptOverride: "Override";
32
+ readonly presetSummaryTools: "Tools";
33
+ readonly presetSummaryPrompts: "Prompts";
34
+ readonly toolPolicyDraftSummary: "Pending changes";
35
+ readonly toolPolicyRuleChanged: "Preset changes";
36
+ readonly toolPolicyNoToolDelta: "No pending changes";
37
+ readonly toolPolicySearch: "Search tools";
38
+ readonly toolPolicyFilter: "Tool filter";
39
+ readonly toolPolicyAll: "All";
40
+ readonly toolPolicyModified: "Customized";
41
+ readonly toolPolicyDeferredFilter: "Deferred";
42
+ readonly toolPolicyReplaceable: "Replaceable";
43
+ readonly toolPolicyDefaultDeferred: "Default deferred";
44
+ readonly toolPolicyAction: "Tool action";
45
+ readonly toolPolicyKeep: "Enable";
46
+ readonly toolPolicyDefer: "Defer";
47
+ readonly toolPolicyDeferHint: "Defer loading until activated via activate_tools";
48
+ readonly toolPolicyHide: "Hide";
49
+ readonly toolPolicyReplaceShort: "Replace";
50
+ readonly toolPolicyRestoreChoice: "Restore default choice";
51
+ readonly toolPolicyUnsupported: "Saved replacement unavailable";
52
+ readonly toolPolicyConditional: "Conditional";
53
+ readonly toolPolicyTargetExists: "Replacement target already exists";
54
+ readonly toolPolicyPresetDisabled: "Disabled by original preset";
55
+ readonly toolPolicyCommandGroup: "Commands & runtime";
56
+ readonly toolPolicyFileGroup: "Files & search";
57
+ readonly toolPolicyPlanGroup: "Planning & interaction";
58
+ readonly toolPolicyCollabGroup: "Agents & workflows";
59
+ readonly toolPolicyOtherGroup: "Web & extensions";
60
+ readonly toolPolicyCustomized: "customized";
61
+ readonly toolLabelExec: "Run terminal command in Shell / PTY";
62
+ readonly toolLabelStdin: "Poll output or send stdin to interactive PTY";
63
+ readonly toolLabelPwsh: "Run PowerShell command";
64
+ readonly toolLabelBash: "Run Bash command";
65
+ readonly toolLabelRunCode: "Run SDK code in sandbox to batch tool calls";
66
+ readonly toolLabelJobList: "List running and finished background jobs";
67
+ readonly toolLabelJobOutput: "Read incremental output or result of a background job";
68
+ readonly toolLabelJobKill: "Stop a running background job";
69
+ readonly toolLabelTermOpen: "Open a persistent terminal session";
70
+ readonly toolLabelTermList: "List persistent terminal sessions";
71
+ readonly toolLabelTermRead: "Read output from a persistent terminal";
72
+ readonly toolLabelTermSend: "Send input to a persistent terminal";
73
+ readonly toolLabelTermSignal: "Send signal to a persistent terminal";
74
+ readonly toolLabelTermClose: "Close a persistent terminal session";
75
+ readonly toolLabelWorkdir: "Read or change working directory (cd)";
76
+ readonly toolLabelWorktree: "Create Git branch and worktree";
77
+ readonly toolLabelPatch: "Create, edit, delete, or move files via Codex patch";
78
+ readonly toolLabelRead: "Read UTF-8 text file with line numbers";
79
+ readonly toolLabelWrite: "Create or overwrite UTF-8 text file";
80
+ readonly toolLabelEdit: "Edit file by replacing literal text";
81
+ readonly toolLabelStrReplace: "View or edit files via str_replace commands";
82
+ readonly toolLabelGlob: "Find file paths by glob pattern";
83
+ readonly toolLabelGrep: "Search file contents with ripgrep regex";
84
+ readonly toolLabelImage: "Read PNG/JPEG/WebP/GIF image";
85
+ readonly toolLabelLsp: "Query LSP for definitions, references, and symbols";
86
+ readonly toolLabelPlan: "Update execution plan and step statuses";
87
+ readonly toolLabelTodo: "Write complete todo list";
88
+ readonly toolLabelExitPlan: "Submit Markdown plan to exit plan mode";
89
+ readonly toolLabelAskUser: "Ask structured questions to the user";
90
+ readonly toolLabelPresent: "Present deliverable files to the user";
91
+ readonly toolLabelProposeAction: "Propose action card for user approval";
92
+ readonly toolLabelApprove: "Approve action denied by Codex Auto-review";
93
+ readonly toolLabelSubagent: "Spawn isolated subagent for a subtask";
94
+ readonly toolLabelSubagentFork: "Fork subagent from current context";
95
+ readonly toolLabelSubagentCodex: "Delegate task to Codex subagent";
96
+ readonly toolLabelSubagentClaude: "Delegate task to Claude Code subagent";
97
+ readonly toolLabelSubagentOar: "Run experimental OAR subagent";
98
+ readonly toolLabelSubagentModels: "List available models for subagents";
99
+ readonly toolLabelSendMessage: "Send message to subagent or teammate";
100
+ readonly toolLabelListAgents: "List started subagents and statuses";
101
+ readonly toolLabelInterruptAgent: "Interrupt a running subagent";
102
+ readonly toolLabelWaitAgent: "Wait for subagent or teammate updates";
103
+ readonly toolLabelWorkflow: "Run multi-stage or parallel PTC workflow";
104
+ readonly toolLabelRalph: "Run iterative Ralph loop agent";
105
+ readonly toolLabelCreateGoal: "Create persistent session goal";
106
+ readonly toolLabelGetGoal: "Read current session goal";
107
+ readonly toolLabelUpdateGoal: "Update current session goal";
108
+ readonly toolLabelGoal: "Manage current session goal";
109
+ readonly toolLabelSpawnTeammate: "Spawn durable Team teammate";
110
+ readonly toolLabelTeamCreate: "Create task on shared Team board";
111
+ readonly toolLabelTeamGet: "Read latest shared Team task state";
112
+ readonly toolLabelTeamList: "List shared Team tasks and blockers";
113
+ readonly toolLabelTeamUpdate: "Update shared Team task with revision check";
114
+ readonly toolLabelWebSearch: "Search the web for current information";
115
+ readonly toolLabelWebFetch: "Fetch decoded text from HTTP(S) URL";
116
+ readonly toolLabelSkill: "Load full instructions for a skill";
117
+ readonly toolLabelActivateTools: "Activate deferred (deferLoading) tools";
118
+ readonly toolLabelSchedule: "Manage scheduled tasks";
119
+ readonly toolLabelScheduleCreate: "Create one-shot or cron schedule";
120
+ readonly toolLabelScheduleEdit: "Edit or toggle an existing schedule";
121
+ readonly toolLabelScheduleList: "List configured schedules";
122
+ readonly toolLabelScheduleView: "View schedule details and history";
123
+ readonly toolLabelPluginManager: "Manage plugins in current profile";
124
+ readonly toolLabelPluginMarket: "Browse plugin market indexes";
125
+ readonly toolLabelCordisList: "List Cordis Inspect Providers";
126
+ readonly toolLabelCordisQuery: "Run read-only Cordis Inspect query";
127
+ readonly toolLabelSessionSearch: "Search events across prior sessions";
128
+ readonly toolLabelSessionTrace: "Trace session lineage";
129
+ readonly toolLabelSessionEventRead: "Read full raw event from session";
130
+ readonly toolLabelSessionEventSearch: "Search events within a session";
131
+ readonly toolLabelSessionEventTrace: "Trace event replacements and citations";
132
+ readonly toolLabelMcpList: "List resources from MCP server";
133
+ readonly toolLabelMcpTemplates: "List URI templates from MCP server";
134
+ readonly toolLabelMcpRead: "Read MCP server resource by URI";
135
+ readonly toolLabelWorkspaceDeps: "Get bundled Python and library paths";
136
+ readonly toolLabelStagehandNav: "Navigate browser to URL (Stagehand)";
137
+ readonly toolLabelStagehandAct: "Perform page interaction (Stagehand)";
138
+ readonly toolLabelStagehandExtract: "Extract structured page data (Stagehand)";
139
+ readonly toolLabelStagehandObserve: "Observe interactive page elements (Stagehand)";
140
+ readonly toolLabelStagehandShot: "Capture browser screenshot (Stagehand)";
141
+ readonly toolLabelStagehandTabs: "Manage browser tabs (Stagehand)";
142
+ readonly toolLabelViewImage: "View local or HTTP(S) image (Codex Connect)";
143
+ readonly toolLabelCodexImageGen: "Generate or edit images via GPT Image (Codex Connect)";
144
+ readonly toolLabelCodexQuota: "Query shared Codex account quota (Codex Connect)";
145
+ readonly toolLabelMcpDynamic: "MCP server tool";
146
+ readonly toolLabelOther: "Other tool";
147
+ readonly toolPolicyToolsLoading: "Loading tools…";
148
+ readonly toolPolicyToolsEmpty: "No registered tools.";
149
+ readonly toolPolicyNoMatches: "No matching tools.";
150
+ readonly toolPolicyToolsFailed: "Tool list unavailable. Saved rules are kept.";
151
+ readonly toolPolicyToolsRefresh: "Refresh tools";
152
+ readonly toolPolicyCatalogLoading: "Loading presets…";
153
+ readonly toolPolicyCatalogEmpty: "No presets found.";
154
+ readonly toolPolicyCatalogFailed: "Preset list unavailable. Saved IDs remain selectable.";
155
+ readonly toolPolicyCatalogRetry: "Reload presets";
156
+ readonly toolPolicyEmpty: "Choose a preset";
157
+ readonly toolPolicySave: "Save preset";
158
+ readonly toolPolicySaving: "Saving…";
159
+ readonly toolPolicyDiscard: "Discard draft";
160
+ readonly toolPolicySaved: "Preset saved.";
161
+ readonly toolPolicyInvalidPreset: "An empty preset ID cannot be saved.";
162
+ readonly toolPolicyDuplicatePreset: "Duplicate preset IDs cannot be saved.";
163
+ readonly toolPolicyRefused: "Not saved. Draft started from older settings; discard draft to reload.";
164
+ readonly toolPolicyFailed: "Save failed. Draft is kept.";
165
+ readonly toolPolicyReadOnly: "These settings are read-only.";
166
+ readonly pmRefresh: "Refresh";
167
+ readonly peLoading: "Loading preset…";
168
+ readonly peReadError: "Preset definition unavailable.";
169
+ };
170
+ export declare const toolPolicyZh: Record<keyof typeof toolPolicyEn, string>;
171
+ export type ToolGroupId = 'command' | 'file' | 'plan' | 'collab' | 'other';
172
+ export declare function groupOf(tool: PresetToolEntry): ToolGroupId;
173
+ export declare const humanLabels: {
174
+ readonly exec_command: "toolLabelExec";
175
+ readonly write_stdin: "toolLabelStdin";
176
+ readonly pwsh: "toolLabelPwsh";
177
+ readonly bash: "toolLabelBash";
178
+ readonly run_code: "toolLabelRunCode";
179
+ readonly job_list: "toolLabelJobList";
180
+ readonly job_output: "toolLabelJobOutput";
181
+ readonly job_kill: "toolLabelJobKill";
182
+ readonly terminal_open: "toolLabelTermOpen";
183
+ readonly terminal_list: "toolLabelTermList";
184
+ readonly terminal_read: "toolLabelTermRead";
185
+ readonly terminal_send: "toolLabelTermSend";
186
+ readonly terminal_signal: "toolLabelTermSignal";
187
+ readonly terminal_close: "toolLabelTermClose";
188
+ readonly working_directory: "toolLabelWorkdir";
189
+ readonly create_worktree: "toolLabelWorktree";
190
+ readonly apply_patch: "toolLabelPatch";
191
+ readonly read: "toolLabelRead";
192
+ readonly write: "toolLabelWrite";
193
+ readonly edit: "toolLabelEdit";
194
+ readonly str_replace_editor: "toolLabelStrReplace";
195
+ readonly glob: "toolLabelGlob";
196
+ readonly grep: "toolLabelGrep";
197
+ readonly read_image: "toolLabelImage";
198
+ readonly lsp: "toolLabelLsp";
199
+ readonly update_plan: "toolLabelPlan";
200
+ readonly todo_write: "toolLabelTodo";
201
+ readonly exit_plan_mode: "toolLabelExitPlan";
202
+ readonly ask_user_question: "toolLabelAskUser";
203
+ readonly present: "toolLabelPresent";
204
+ readonly propose_action: "toolLabelProposeAction";
205
+ readonly approve: "toolLabelApprove";
206
+ readonly subagent: "toolLabelSubagent";
207
+ readonly subagent_fork: "toolLabelSubagentFork";
208
+ readonly subagent_codex: "toolLabelSubagentCodex";
209
+ readonly subagent_claude_code: "toolLabelSubagentClaude";
210
+ readonly subagent_oar: "toolLabelSubagentOar";
211
+ readonly list_subagent_models: "toolLabelSubagentModels";
212
+ readonly send_message: "toolLabelSendMessage";
213
+ readonly list_agents: "toolLabelListAgents";
214
+ readonly interrupt_agent: "toolLabelInterruptAgent";
215
+ readonly wait_agent: "toolLabelWaitAgent";
216
+ readonly workflow: "toolLabelWorkflow";
217
+ readonly ralph: "toolLabelRalph";
218
+ readonly create_goal: "toolLabelCreateGoal";
219
+ readonly get_goal: "toolLabelGetGoal";
220
+ readonly update_goal: "toolLabelUpdateGoal";
221
+ readonly goal: "toolLabelGoal";
222
+ readonly spawn_teammate: "toolLabelSpawnTeammate";
223
+ readonly team_task_create: "toolLabelTeamCreate";
224
+ readonly team_task_get: "toolLabelTeamGet";
225
+ readonly team_task_list: "toolLabelTeamList";
226
+ readonly team_task_update: "toolLabelTeamUpdate";
227
+ readonly web_search: "toolLabelWebSearch";
228
+ readonly web_fetch: "toolLabelWebFetch";
229
+ readonly skill: "toolLabelSkill";
230
+ readonly activate_tools: "toolLabelActivateTools";
231
+ readonly schedule: "toolLabelSchedule";
232
+ readonly schedule_create: "toolLabelScheduleCreate";
233
+ readonly schedule_edit: "toolLabelScheduleEdit";
234
+ readonly schedule_list: "toolLabelScheduleList";
235
+ readonly schedule_view: "toolLabelScheduleView";
236
+ readonly plugin_manager: "toolLabelPluginManager";
237
+ readonly plugin_market: "toolLabelPluginMarket";
238
+ readonly cordis_inspect_list: "toolLabelCordisList";
239
+ readonly cordis_inspect_query: "toolLabelCordisQuery";
240
+ readonly session_search: "toolLabelSessionSearch";
241
+ readonly session_trace: "toolLabelSessionTrace";
242
+ readonly session_event_read: "toolLabelSessionEventRead";
243
+ readonly session_event_search: "toolLabelSessionEventSearch";
244
+ readonly session_event_trace: "toolLabelSessionEventTrace";
245
+ readonly list_mcp_resources: "toolLabelMcpList";
246
+ readonly list_mcp_resource_templates: "toolLabelMcpTemplates";
247
+ readonly read_mcp_resource: "toolLabelMcpRead";
248
+ readonly load_workspace_dependencies: "toolLabelWorkspaceDeps";
249
+ readonly stagehand_navigate: "toolLabelStagehandNav";
250
+ readonly stagehand_act: "toolLabelStagehandAct";
251
+ readonly stagehand_extract: "toolLabelStagehandExtract";
252
+ readonly stagehand_observe: "toolLabelStagehandObserve";
253
+ readonly stagehand_screenshot: "toolLabelStagehandShot";
254
+ readonly stagehand_tabs: "toolLabelStagehandTabs";
255
+ readonly view_image: "toolLabelViewImage";
256
+ readonly codex_connect_image_generate: "toolLabelCodexImageGen";
257
+ readonly codex_connect_quota: "toolLabelCodexQuota";
258
+ };
259
+ export declare const policyStyles = "\n.codex-tool-policy { display:flex; flex-direction:column; gap:12px; min-width:0; font-size:13px; color:var(--dsw-alias-label-primary); }\n.codex-tool-policy p, .codex-tool-policy h3, .codex-tool-policy h4 { margin:0; }\n.codex-tool-policy .codex-tool-policy-note { color:var(--dsw-alias-label-tertiary, var(--dsw-alias-label-secondary)); font-size:12px; line-height:1.45; }\n.codex-tool-policy form, .codex-tool-policy fieldset { min-width:0; margin:0; padding:0; border:0; display:flex; flex-direction:column; gap:10px; }\n.codex-tool-policy .codex-card { border:0.5px solid var(--dsw-alias-settings-card-stroke, var(--dsw-alias-border-l2)); border-radius:var(--dsw-radius-xl, 12px); background:var(--dsw-alias-settings-card-fill, var(--dsw-alias-bg-layer-1)); padding:12px 14px; }\n.codex-tool-policy .codex-preset-bar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; }\n.codex-tool-policy .codex-preset-select-wrap { display:flex; align-items:center; gap:8px; min-width:0; flex:1 1 260px; }\n.codex-tool-policy .codex-preset-select-wrap select { min-width:0; flex:1; height:32px; padding:0 10px; border:0.5px solid var(--dsw-alias-border-l3, var(--dsw-alias-border-l2)); border-radius:var(--dsw-radius-md, 8px); background:var(--dsw-alias-bg-layer-2); color:inherit; font:inherit; }\n.codex-tool-policy .codex-btn { box-sizing:border-box; height:32px; padding:0 11px; border:0.5px solid var(--dsw-alias-border-l3, var(--dsw-alias-border-l2)); border-radius:var(--dsw-radius-md, 8px); background:var(--dsw-alias-bg-layer-2); color:inherit; font:inherit; font-size:12px; cursor:pointer; white-space:nowrap; }\n.codex-tool-policy .codex-btn:disabled { opacity:.48; cursor:default; }\n.codex-tool-policy .codex-btn-primary { background:var(--dsw-alias-label-primary); color:var(--dsw-alias-bg-base); border-color:transparent; font-weight:500; }\n.codex-tool-policy .codex-seg { display:inline-flex; align-items:center; gap:2px; padding:2px; border-radius:var(--dsw-radius-md, 8px); background:var(--dsw-alias-bg-layer-2); border:0.5px solid var(--dsw-alias-border-l2); flex-shrink:0; }\n.codex-tool-policy .codex-seg button { border:0; border-radius:6px; padding:4px 9px; background:transparent; color:var(--dsw-alias-label-secondary); font:inherit; font-size:12px; line-height:18px; cursor:pointer; white-space:nowrap; transition:background .12s, color .12s; }\n.codex-tool-policy .codex-seg button:hover:not(:disabled) { color:var(--dsw-alias-label-primary); }\n.codex-tool-policy .codex-seg button:disabled { opacity:.38; cursor:default; }\n.codex-tool-policy .codex-seg button[aria-pressed=true] { background:var(--dsw-alias-label-primary); color:var(--dsw-alias-bg-base); font-weight:500; }\n.codex-tool-policy .codex-seg button[data-action=defer][aria-pressed=true] { background:var(--dsw-alias-interactive-bg-selected, rgba(59,130,246,0.14)); color:var(--dsw-static-blue-500, var(--dsw-alias-brand-primary)); font-weight:600; }\n.codex-tool-policy .codex-seg button[data-action=hide][aria-pressed=true] { background:var(--dsw-alias-border-l3, var(--dsw-alias-border-l2)); color:var(--dsw-alias-label-primary); }\n.codex-tool-policy :is(input,select,button,summary,textarea):focus-visible { outline:2px solid var(--dsw-focus-ring-color, var(--dsw-alias-brand-primary)); outline-offset:2px; }\n.codex-tool-policy .codex-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }\n.codex-tool-policy .codex-toolbar input[type=text] { flex:1 1 180px; min-width:0; height:32px; padding:0 10px; border:0.5px solid var(--dsw-alias-border-l3, var(--dsw-alias-border-l2)); border-radius:var(--dsw-radius-md, 8px); background:var(--dsw-alias-bg-layer-1, var(--dsw-alias-bg-layer-2)); color:inherit; font:inherit; font-size:13px; }\n.codex-tool-policy details.codex-group { border:0.5px solid var(--dsw-alias-settings-card-stroke, var(--dsw-alias-border-l2)); border-radius:var(--dsw-radius-xl, 12px); background:var(--dsw-alias-settings-card-fill, transparent); overflow:hidden; }\n.codex-tool-policy details.codex-group > summary { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 14px; font-weight:600; font-size:13px; cursor:pointer; list-style:none; user-select:none; }\n.codex-tool-policy details.codex-group[open] > summary { border-bottom:0.5px solid var(--dsw-alias-border-l1); }\n.codex-tool-policy .codex-tool-policy-table { display:flex; flex-direction:column; }\n.codex-tool-policy .codex-tool-policy-tool { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 12px; padding:8px 14px; border-bottom:0.5px solid var(--dsw-alias-border-l1); }\n.codex-tool-policy .codex-tool-policy-tool:last-child { border-bottom:0; }\n.codex-tool-policy .codex-tool-policy-tool[data-tool-action=hide] .codex-tool-policy-name { opacity:.52; }\n.codex-tool-policy .codex-tool-policy-name { min-width:0; flex:1 1 220px; display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; overflow-wrap:anywhere; }\n.codex-tool-policy .codex-tool-policy-identifier { font-size:13px; font-weight:600; color:var(--dsw-alias-label-primary); }\n.codex-tool-policy .codex-tool-policy-description { font-size:12px; color:var(--dsw-alias-label-secondary); }\n.codex-tool-policy .codex-badge { font-size:11px; line-height:16px; padding:1px 6px; border-radius:999px; background:var(--dsw-alias-bg-layer-2); color:var(--dsw-alias-label-secondary); border:0.5px solid var(--dsw-alias-border-l2); }\n.codex-tool-policy .codex-badge[data-tone=blue] { background:var(--dsw-alias-interactive-bg-selected, rgba(59,130,246,0.12)); color:var(--dsw-static-blue-500, var(--dsw-alias-brand-primary)); border-color:transparent; }\n.codex-tool-policy .codex-badge[data-tone=warn] { color:var(--dsw-alias-state-warn-primary); }\n.codex-tool-policy .codex-tool-policy-action { display:flex; align-items:center; gap:6px; flex-shrink:0; }\n.codex-tool-policy .codex-tool-policy-prompts { display:flex; flex-direction:column; gap:10px; }\n.codex-tool-policy .codex-tool-policy-prompt { display:grid; gap:8px; }\n.codex-tool-policy textarea { box-sizing:border-box; width:100%; min-width:0; resize:vertical; padding:8px 10px; border:0.5px solid var(--dsw-alias-border-l3, var(--dsw-alias-border-l2)); border-radius:var(--dsw-radius-md, 8px); background:var(--dsw-alias-bg-layer-2); color:inherit; font:inherit; }\n.codex-tool-policy .codex-tool-policy-prompt pre { margin:0; max-height:240px; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; font:inherit; font-size:12px; }\n.codex-tool-policy .codex-save-bar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; padding:10px 14px; border:0.5px solid var(--dsw-alias-settings-card-stroke, var(--dsw-alias-border-l2)); border-radius:var(--dsw-radius-xl, 12px); background:var(--dsw-alias-settings-card-fill, var(--dsw-alias-bg-layer-1)); }\n.codex-tool-policy .codex-save-bar[data-dirty=true] { position:sticky; bottom:8px; z-index:2; border-color:var(--dsw-alias-border-l3, var(--dsw-alias-border-l2)); background:var(--dsw-alias-bg-layer-1, var(--dsw-alias-settings-card-fill)); box-shadow:0 4px 16px rgba(0,0,0,0.12); }\n.codex-tool-policy .codex-save-buttons { display:flex; align-items:center; gap:8px; }\n.codex-tool-policy .codex-tool-policy-warning { color:var(--dsw-alias-state-warn-primary); font-size:12px; }\n.codex-tool-policy .codex-tool-policy-error { color:var(--dsw-alias-state-error-primary); font-size:12px; }\n";
260
+ //# sourceMappingURL=policy-locale.d.ts.map