@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
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ToolPolicyRule } from '../contracts/tool-policy-contract.ts'
|
|
2
|
+
|
|
3
|
+
/** Ephemeral UI drafts only; accepted ConfigForms values remain authoritative. */
|
|
4
|
+
export interface PresetDraft {
|
|
5
|
+
readonly preset: string
|
|
6
|
+
readonly revision: number | undefined
|
|
7
|
+
readonly baseline: readonly ToolPolicyRule[]
|
|
8
|
+
readonly rules: readonly ToolPolicyRule[]
|
|
9
|
+
}
|
|
10
|
+
export type PresetDrafts = ReadonlyMap<string, PresetDraft>
|
|
11
|
+
export interface PolicySnapshot { readonly revision: number | undefined; readonly rules: readonly ToolPolicyRule[] }
|
|
12
|
+
export interface PreparedPresetSave extends PolicySnapshot { readonly draft: PresetDraft; readonly before: PolicySnapshot }
|
|
13
|
+
|
|
14
|
+
function canonical(value: unknown): unknown {
|
|
15
|
+
if (Array.isArray(value)) return value.map(canonical)
|
|
16
|
+
if (value !== null && typeof value === 'object') return Object.fromEntries(Object.entries(value)
|
|
17
|
+
.filter(([, item]) => item !== undefined).sort(([a], [b]) => a.localeCompare(b)).map(([key, item]) => [key, canonical(item)]))
|
|
18
|
+
return value
|
|
19
|
+
}
|
|
20
|
+
export const sameRules = (a: readonly ToolPolicyRule[], b: readonly ToolPolicyRule[]): boolean => JSON.stringify(canonical(a)) === JSON.stringify(canonical(b))
|
|
21
|
+
export const presetRules = (rules: readonly ToolPolicyRule[], preset: string): readonly ToolPolicyRule[] => rules.filter(rule => rule.preset === preset)
|
|
22
|
+
|
|
23
|
+
export function editPresetDraft(drafts: PresetDrafts, preset: string, accepted: PolicySnapshot,
|
|
24
|
+
change: (rules: readonly ToolPolicyRule[]) => readonly ToolPolicyRule[]): PresetDrafts {
|
|
25
|
+
const previous = drafts.get(preset)
|
|
26
|
+
const next = new Map(drafts)
|
|
27
|
+
next.set(preset, { preset, revision: previous === undefined ? accepted.revision : previous.revision,
|
|
28
|
+
baseline: previous?.baseline ?? accepted.rules, rules: change(previous?.rules ?? presetRules(accepted.rules, preset)) })
|
|
29
|
+
return next
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Replace just this source target, preserving all accepted other targets/order. */
|
|
33
|
+
export function mergePresetRules(accepted: readonly ToolPolicyRule[], preset: string, replacement: readonly ToolPolicyRule[]): readonly ToolPolicyRule[] {
|
|
34
|
+
const first = accepted.findIndex(rule => rule.preset === preset)
|
|
35
|
+
if (first < 0) return [...accepted, ...replacement]
|
|
36
|
+
return [...accepted.slice(0, first), ...replacement, ...accepted.slice(first).filter(rule => rule.preset !== preset)]
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function preparePresetSave(draft: PresetDraft, accepted: PolicySnapshot): PreparedPresetSave {
|
|
40
|
+
// Never silently rebase an external edit, even if only a different target changed.
|
|
41
|
+
if (draft.revision !== accepted.revision || !sameRules(draft.baseline, accepted.rules)) throw new Error('policy-draft-conflict')
|
|
42
|
+
return { draft, before: accepted, revision: draft.revision, rules: mergePresetRules(accepted.rules, draft.preset, draft.rules) }
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function acceptPresetSave(drafts: PresetDrafts, saved: PreparedPresetSave, accepted: PolicySnapshot): PresetDrafts {
|
|
46
|
+
const next = new Map(drafts)
|
|
47
|
+
if (next.get(saved.draft.preset) === saved.draft) next.delete(saved.draft.preset)
|
|
48
|
+
// A true result is not enough: a later external view may already have arrived.
|
|
49
|
+
if (!sameRules(accepted.rules, saved.rules)) return next
|
|
50
|
+
for (const [preset, draft] of next) {
|
|
51
|
+
if (draft.revision !== saved.before.revision || !sameRules(draft.baseline, saved.before.rules)) continue
|
|
52
|
+
if (!sameRules(presetRules(saved.before.rules, preset), presetRules(accepted.rules, preset))) continue
|
|
53
|
+
next.set(preset, { ...draft, revision: accepted.revision, baseline: accepted.rules })
|
|
54
|
+
}
|
|
55
|
+
return next
|
|
56
|
+
}
|
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
/** Locale dictionaries, tool grouping, human labels, and DSH-native styles for `ToolPolicySettingsCard`. */
|
|
2
|
+
import type { PresetToolEntry } from '../contracts/tool-policy-contract.ts'
|
|
3
|
+
|
|
4
|
+
export const toolPolicyEn = {
|
|
5
|
+
settingsTabLabel: 'Codex Harness',
|
|
6
|
+
settingsToolsPage: 'Preset plans',
|
|
7
|
+
settingsRuntimePage: 'Runtime preferences',
|
|
8
|
+
settingsSubTools: 'Tools',
|
|
9
|
+
settingsPresetPrompts: 'Prompts',
|
|
10
|
+
settingsDefinition: 'YAML',
|
|
11
|
+
settingsPreferHostedSearch: 'Prefer model-hosted search',
|
|
12
|
+
settingsPreferRemoteCompaction: 'Prefer remote compaction',
|
|
13
|
+
settingsSharedFailed: 'Not saved; this page’s draft is kept. Shared settings may have changed—discard this page’s draft to reload.',
|
|
14
|
+
settingsRuntimeScope: 'Shared in this environment',
|
|
15
|
+
settingsSaveRuntime: 'Save runtime preferences',
|
|
16
|
+
settingsBundleSummary: 'Configure Codex Harness in its dedicated Settings tab.',
|
|
17
|
+
settingsBundlePath: 'Settings → Plugins → Codex Harness',
|
|
18
|
+
settingsDefinitionAbsent: 'Choose a preset on Preset plans first.',
|
|
19
|
+
globalGroupRequest: 'Model requests',
|
|
20
|
+
globalGroupDisplay: 'Display',
|
|
21
|
+
globalPending: 'Unsaved',
|
|
22
|
+
toolPolicyTitle: 'Tool plan',
|
|
23
|
+
toolPolicyPresetChoice: 'Preset',
|
|
24
|
+
toolPolicyInvalidEntry: 'Empty preset ID',
|
|
25
|
+
toolPolicyTiming: 'Applies to new or reloaded sessions',
|
|
26
|
+
presetPromptsLoading: 'Loading prompts…',
|
|
27
|
+
presetPromptsFailed: 'Prompts unavailable.',
|
|
28
|
+
presetPromptsEmpty: 'No prompt sections.',
|
|
29
|
+
presetPromptsReload: 'Reload prompts',
|
|
30
|
+
presetPromptRestore: 'Restore original',
|
|
31
|
+
presetPromptReadOnly: 'Read-only',
|
|
32
|
+
presetPromptOverride: 'Override',
|
|
33
|
+
presetSummaryTools: 'Tools',
|
|
34
|
+
presetSummaryPrompts: 'Prompts',
|
|
35
|
+
toolPolicyDraftSummary: 'Pending changes',
|
|
36
|
+
toolPolicyRuleChanged: 'Preset changes',
|
|
37
|
+
toolPolicyNoToolDelta: 'No pending changes',
|
|
38
|
+
toolPolicySearch: 'Search tools',
|
|
39
|
+
toolPolicyFilter: 'Tool filter',
|
|
40
|
+
toolPolicyAll: 'All',
|
|
41
|
+
toolPolicyModified: 'Customized',
|
|
42
|
+
toolPolicyDeferredFilter: 'Deferred',
|
|
43
|
+
toolPolicyReplaceable: 'Replaceable',
|
|
44
|
+
toolPolicyDefaultDeferred: 'Default deferred',
|
|
45
|
+
toolPolicyAction: 'Tool action',
|
|
46
|
+
toolPolicyKeep: 'Enable',
|
|
47
|
+
toolPolicyDefer: 'Defer',
|
|
48
|
+
toolPolicyDeferHint: 'Defer loading until activated via activate_tools',
|
|
49
|
+
toolPolicyHide: 'Hide',
|
|
50
|
+
toolPolicyReplaceShort: 'Replace',
|
|
51
|
+
toolPolicyRestoreChoice: 'Restore default choice',
|
|
52
|
+
toolPolicyUnsupported: 'Saved replacement unavailable',
|
|
53
|
+
toolPolicyConditional: 'Conditional',
|
|
54
|
+
toolPolicyTargetExists: 'Replacement target already exists',
|
|
55
|
+
toolPolicyPresetDisabled: 'Disabled by original preset',
|
|
56
|
+
toolPolicyCommandGroup: 'Commands & runtime',
|
|
57
|
+
toolPolicyFileGroup: 'Files & search',
|
|
58
|
+
toolPolicyPlanGroup: 'Planning & interaction',
|
|
59
|
+
toolPolicyCollabGroup: 'Agents & workflows',
|
|
60
|
+
toolPolicyOtherGroup: 'Web & extensions',
|
|
61
|
+
toolPolicyCustomized: 'customized',
|
|
62
|
+
toolLabelExec: 'Run terminal command in Shell / PTY', toolLabelStdin: 'Poll output or send stdin to interactive PTY',
|
|
63
|
+
toolLabelPwsh: 'Run PowerShell command', toolLabelBash: 'Run Bash command',
|
|
64
|
+
toolLabelRunCode: 'Run SDK code in sandbox to batch tool calls', toolLabelJobList: 'List running and finished background jobs',
|
|
65
|
+
toolLabelJobOutput: 'Read incremental output or result of a background job', toolLabelJobKill: 'Stop a running background job',
|
|
66
|
+
toolLabelTermOpen: 'Open a persistent terminal session', toolLabelTermList: 'List persistent terminal sessions',
|
|
67
|
+
toolLabelTermRead: 'Read output from a persistent terminal', toolLabelTermSend: 'Send input to a persistent terminal',
|
|
68
|
+
toolLabelTermSignal: 'Send signal to a persistent terminal', toolLabelTermClose: 'Close a persistent terminal session',
|
|
69
|
+
toolLabelWorkdir: 'Read or change working directory (cd)', toolLabelWorktree: 'Create Git branch and worktree',
|
|
70
|
+
toolLabelPatch: 'Create, edit, delete, or move files via Codex patch', toolLabelRead: 'Read UTF-8 text file with line numbers',
|
|
71
|
+
toolLabelWrite: 'Create or overwrite UTF-8 text file', toolLabelEdit: 'Edit file by replacing literal text',
|
|
72
|
+
toolLabelStrReplace: 'View or edit files via str_replace commands', toolLabelGlob: 'Find file paths by glob pattern',
|
|
73
|
+
toolLabelGrep: 'Search file contents with ripgrep regex', toolLabelImage: 'Read PNG/JPEG/WebP/GIF image',
|
|
74
|
+
toolLabelLsp: 'Query LSP for definitions, references, and symbols', toolLabelPlan: 'Update execution plan and step statuses',
|
|
75
|
+
toolLabelTodo: 'Write complete todo list', toolLabelExitPlan: 'Submit Markdown plan to exit plan mode',
|
|
76
|
+
toolLabelAskUser: 'Ask structured questions to the user', toolLabelPresent: 'Present deliverable files to the user',
|
|
77
|
+
toolLabelProposeAction: 'Propose action card for user approval', toolLabelApprove: 'Approve action denied by Codex Auto-review',
|
|
78
|
+
toolLabelSubagent: 'Spawn isolated subagent for a subtask', toolLabelSubagentFork: 'Fork subagent from current context',
|
|
79
|
+
toolLabelSubagentCodex: 'Delegate task to Codex subagent', toolLabelSubagentClaude: 'Delegate task to Claude Code subagent',
|
|
80
|
+
toolLabelSubagentOar: 'Run experimental OAR subagent', toolLabelSubagentModels: 'List available models for subagents',
|
|
81
|
+
toolLabelSendMessage: 'Send message to subagent or teammate', toolLabelListAgents: 'List started subagents and statuses',
|
|
82
|
+
toolLabelInterruptAgent: 'Interrupt a running subagent', toolLabelWaitAgent: 'Wait for subagent or teammate updates',
|
|
83
|
+
toolLabelWorkflow: 'Run multi-stage or parallel PTC workflow', toolLabelRalph: 'Run iterative Ralph loop agent',
|
|
84
|
+
toolLabelCreateGoal: 'Create persistent session goal', toolLabelGetGoal: 'Read current session goal',
|
|
85
|
+
toolLabelUpdateGoal: 'Update current session goal', toolLabelGoal: 'Manage current session goal',
|
|
86
|
+
toolLabelSpawnTeammate: 'Spawn durable Team teammate', toolLabelTeamCreate: 'Create task on shared Team board',
|
|
87
|
+
toolLabelTeamGet: 'Read latest shared Team task state', toolLabelTeamList: 'List shared Team tasks and blockers',
|
|
88
|
+
toolLabelTeamUpdate: 'Update shared Team task with revision check', toolLabelWebSearch: 'Search the web for current information',
|
|
89
|
+
toolLabelWebFetch: 'Fetch decoded text from HTTP(S) URL', toolLabelSkill: 'Load full instructions for a skill',
|
|
90
|
+
toolLabelActivateTools: 'Activate deferred (deferLoading) tools', toolLabelSchedule: 'Manage scheduled tasks',
|
|
91
|
+
toolLabelScheduleCreate: 'Create one-shot or cron schedule', toolLabelScheduleEdit: 'Edit or toggle an existing schedule',
|
|
92
|
+
toolLabelScheduleList: 'List configured schedules', toolLabelScheduleView: 'View schedule details and history',
|
|
93
|
+
toolLabelPluginManager: 'Manage plugins in current profile', toolLabelPluginMarket: 'Browse plugin market indexes',
|
|
94
|
+
toolLabelCordisList: 'List Cordis Inspect Providers', toolLabelCordisQuery: 'Run read-only Cordis Inspect query',
|
|
95
|
+
toolLabelSessionSearch: 'Search events across prior sessions', toolLabelSessionTrace: 'Trace session lineage',
|
|
96
|
+
toolLabelSessionEventRead: 'Read full raw event from session', toolLabelSessionEventSearch: 'Search events within a session',
|
|
97
|
+
toolLabelSessionEventTrace: 'Trace event replacements and citations', toolLabelMcpList: 'List resources from MCP server',
|
|
98
|
+
toolLabelMcpTemplates: 'List URI templates from MCP server', toolLabelMcpRead: 'Read MCP server resource by URI',
|
|
99
|
+
toolLabelWorkspaceDeps: 'Get bundled Python and library paths', toolLabelStagehandNav: 'Navigate browser to URL (Stagehand)',
|
|
100
|
+
toolLabelStagehandAct: 'Perform page interaction (Stagehand)', toolLabelStagehandExtract: 'Extract structured page data (Stagehand)',
|
|
101
|
+
toolLabelStagehandObserve: 'Observe interactive page elements (Stagehand)', toolLabelStagehandShot: 'Capture browser screenshot (Stagehand)',
|
|
102
|
+
toolLabelStagehandTabs: 'Manage browser tabs (Stagehand)',
|
|
103
|
+
toolLabelViewImage: 'View local or HTTP(S) image (Codex Connect)',
|
|
104
|
+
toolLabelCodexImageGen: 'Generate or edit images via GPT Image (Codex Connect)',
|
|
105
|
+
toolLabelCodexQuota: 'Query shared Codex account quota (Codex Connect)',
|
|
106
|
+
toolLabelMcpDynamic: 'MCP server tool', toolLabelOther: 'Other tool',
|
|
107
|
+
toolPolicyToolsLoading: 'Loading tools…',
|
|
108
|
+
toolPolicyToolsEmpty: 'No registered tools.',
|
|
109
|
+
toolPolicyNoMatches: 'No matching tools.',
|
|
110
|
+
toolPolicyToolsFailed: 'Tool list unavailable. Saved rules are kept.',
|
|
111
|
+
toolPolicyToolsRefresh: 'Refresh tools',
|
|
112
|
+
toolPolicyCatalogLoading: 'Loading presets…',
|
|
113
|
+
toolPolicyCatalogEmpty: 'No presets found.',
|
|
114
|
+
toolPolicyCatalogFailed: 'Preset list unavailable. Saved IDs remain selectable.',
|
|
115
|
+
toolPolicyCatalogRetry: 'Reload presets',
|
|
116
|
+
toolPolicyEmpty: 'Choose a preset',
|
|
117
|
+
toolPolicySave: 'Save preset',
|
|
118
|
+
toolPolicySaving: 'Saving…',
|
|
119
|
+
toolPolicyDiscard: 'Discard draft',
|
|
120
|
+
toolPolicySaved: 'Preset saved.',
|
|
121
|
+
toolPolicyInvalidPreset: 'An empty preset ID cannot be saved.',
|
|
122
|
+
toolPolicyDuplicatePreset: 'Duplicate preset IDs cannot be saved.',
|
|
123
|
+
toolPolicyRefused: 'Not saved. Draft started from older settings; discard draft to reload.',
|
|
124
|
+
toolPolicyFailed: 'Save failed. Draft is kept.',
|
|
125
|
+
toolPolicyReadOnly: 'These settings are read-only.',
|
|
126
|
+
pmRefresh: 'Refresh',
|
|
127
|
+
peLoading: 'Loading preset…',
|
|
128
|
+
peReadError: 'Preset definition unavailable.',
|
|
129
|
+
} as const
|
|
130
|
+
|
|
131
|
+
export const toolPolicyZh: Record<keyof typeof toolPolicyEn, string> = {
|
|
132
|
+
settingsTabLabel: 'Codex Harness',
|
|
133
|
+
settingsToolsPage: '预设方案',
|
|
134
|
+
settingsRuntimePage: '运行偏好',
|
|
135
|
+
settingsSubTools: '工具',
|
|
136
|
+
settingsPresetPrompts: '提示词',
|
|
137
|
+
settingsDefinition: '原始定义',
|
|
138
|
+
settingsPreferHostedSearch: '优先使用模型托管搜索',
|
|
139
|
+
settingsPreferRemoteCompaction: '优先使用远程压缩',
|
|
140
|
+
settingsSharedFailed: '未保存,本页草稿已保留。共享设置可能已更新,请放弃本页草稿后重新读取。',
|
|
141
|
+
settingsRuntimeScope: '本环境共享',
|
|
142
|
+
settingsSaveRuntime: '保存运行偏好',
|
|
143
|
+
settingsBundleSummary: '请在独立的 Codex Harness 设置页配置。',
|
|
144
|
+
settingsBundlePath: '设置 → 内置插件 → Codex Harness',
|
|
145
|
+
settingsDefinitionAbsent: '请先在预设方案页选择预设。',
|
|
146
|
+
globalGroupRequest: '模型请求',
|
|
147
|
+
globalGroupDisplay: '界面',
|
|
148
|
+
globalPending: '未保存',
|
|
149
|
+
toolPolicyTitle: '工具方案',
|
|
150
|
+
toolPolicyPresetChoice: '预设',
|
|
151
|
+
toolPolicyInvalidEntry: '空预设 ID',
|
|
152
|
+
toolPolicyTiming: '新建或重载会话后生效',
|
|
153
|
+
presetPromptsLoading: '正在读取提示词…',
|
|
154
|
+
presetPromptsFailed: '提示词暂不可用。',
|
|
155
|
+
presetPromptsEmpty: '没有提示词段落。',
|
|
156
|
+
presetPromptsReload: '重新读取提示词',
|
|
157
|
+
presetPromptRestore: '恢复原始',
|
|
158
|
+
presetPromptReadOnly: '只读',
|
|
159
|
+
presetPromptOverride: '覆盖',
|
|
160
|
+
presetSummaryTools: '工具',
|
|
161
|
+
presetSummaryPrompts: '提示词',
|
|
162
|
+
toolPolicyDraftSummary: '本次修改',
|
|
163
|
+
toolPolicyRuleChanged: '预设方案调整',
|
|
164
|
+
toolPolicyNoToolDelta: '没有待保存变化',
|
|
165
|
+
toolPolicySearch: '搜索工具',
|
|
166
|
+
toolPolicyFilter: '工具筛选',
|
|
167
|
+
toolPolicyAll: '全部',
|
|
168
|
+
toolPolicyModified: '已修改',
|
|
169
|
+
toolPolicyDeferredFilter: '按需延迟',
|
|
170
|
+
toolPolicyReplaceable: '可替换',
|
|
171
|
+
toolPolicyDefaultDeferred: '默认延迟',
|
|
172
|
+
toolPolicyAction: '工具操作',
|
|
173
|
+
toolPolicyKeep: '启用',
|
|
174
|
+
toolPolicyDefer: '延迟',
|
|
175
|
+
toolPolicyDeferHint: '按需延迟加载(通过 activate_tools 激活)',
|
|
176
|
+
toolPolicyHide: '隐藏',
|
|
177
|
+
toolPolicyReplaceShort: '替换',
|
|
178
|
+
toolPolicyRestoreChoice: '恢复默认选择',
|
|
179
|
+
toolPolicyUnsupported: '已保存的替换当前不可用',
|
|
180
|
+
toolPolicyConditional: '按条件可用',
|
|
181
|
+
toolPolicyTargetExists: '替换目标已存在',
|
|
182
|
+
toolPolicyPresetDisabled: '原预设未启用',
|
|
183
|
+
toolPolicyCommandGroup: '命令与执行',
|
|
184
|
+
toolPolicyFileGroup: '文件与检索',
|
|
185
|
+
toolPolicyPlanGroup: '规划与交互',
|
|
186
|
+
toolPolicyCollabGroup: '子代理与工作流',
|
|
187
|
+
toolPolicyOtherGroup: '网络与扩展',
|
|
188
|
+
toolPolicyCustomized: '项修改',
|
|
189
|
+
toolLabelExec: '在 Shell / PTY 中运行终端命令', toolLabelStdin: '轮询命令输出或向交互式 PTY 发送输入',
|
|
190
|
+
toolLabelPwsh: '执行 PowerShell 命令', toolLabelBash: '执行 Bash 命令',
|
|
191
|
+
toolLabelRunCode: '在沙箱中运行 SDK 代码批量调用工具', toolLabelJobList: '列出后台 job(运行中与已结束)及状态',
|
|
192
|
+
toolLabelJobOutput: '读取后台 job 的增量输出或结果', toolLabelJobKill: '终止正在运行的后台 job',
|
|
193
|
+
toolLabelTermOpen: '创建持久化终端 session', toolLabelTermList: '列出当前 Agent 的持久化终端 session',
|
|
194
|
+
toolLabelTermRead: '分页读取持久化终端输出', toolLabelTermSend: '向持久化终端发送输入',
|
|
195
|
+
toolLabelTermSignal: '向持久化终端进程组发送信号', toolLabelTermClose: '关闭持久化终端并清理进程树',
|
|
196
|
+
toolLabelWorkdir: '查看或切换当前工作目录(cd)', toolLabelWorktree: '新建 Git 分支与 Worktree 并切换目录',
|
|
197
|
+
toolLabelPatch: '使用 Codex Patch 语法增删改移文件', toolLabelRead: '读取 UTF-8 文本文件(带行号)',
|
|
198
|
+
toolLabelWrite: '新建或覆盖写入 UTF-8 文本文件', toolLabelEdit: '按字面文本精确替换修改文件',
|
|
199
|
+
toolLabelStrReplace: '使用 str_replace 命令查看或编辑文件', toolLabelGlob: '按 Glob 模式匹配查找文件路径',
|
|
200
|
+
toolLabelGrep: '使用 ripgrep 正则搜索文件内容', toolLabelImage: '读取 PNG / JPEG / WebP / GIF 图片',
|
|
201
|
+
toolLabelLsp: '通过 LSP 查询定义跳转、引用与符号', toolLabelPlan: '更新任务执行计划与步骤状态',
|
|
202
|
+
toolLabelTodo: '覆盖写入待办任务列表(todo)', toolLabelExitPlan: '提交 Markdown 方案并请求退出 Plan 模式',
|
|
203
|
+
toolLabelAskUser: '向用户发起结构化提问', toolLabelPresent: '将文件声明为交付物展示给用户',
|
|
204
|
+
toolLabelProposeAction: '发起需用户确认的操作卡片', toolLabelApprove: '批准被 Codex Auto-review 拦截的操作',
|
|
205
|
+
toolLabelSubagent: '启动独立上下文的 subagent 执行子任务', toolLabelSubagentFork: '基于当前上下文 fork 子代理',
|
|
206
|
+
toolLabelSubagentCodex: '委托外部 Codex subagent 执行任务', toolLabelSubagentClaude: '委托外部 Claude Code subagent 执行任务',
|
|
207
|
+
toolLabelSubagentOar: '启动实验性 OAR subagent', toolLabelSubagentModels: '查询可用于 subagent 的模型列表',
|
|
208
|
+
toolLabelSendMessage: '向 subagent 或协作代理发送消息', toolLabelListAgents: '列出已启动的 subagent 及状态',
|
|
209
|
+
toolLabelInterruptAgent: '中断指定 subagent 当前任务', toolLabelWaitAgent: '等待 subagent 或团队成员状态更新',
|
|
210
|
+
toolLabelWorkflow: '运行多阶段 / 并行 PTC 工作流', toolLabelRalph: '运行多轮自动迭代的 Ralph 循环代理',
|
|
211
|
+
toolLabelCreateGoal: '创建持久化会话 Goal', toolLabelGetGoal: '读取当前会话 Goal 状态',
|
|
212
|
+
toolLabelUpdateGoal: '更新当前会话 Goal 进度', toolLabelGoal: '管理当前会话 Goal',
|
|
213
|
+
toolLabelSpawnTeammate: '创建持久化 Team 协作代理', toolLabelTeamCreate: '在 Team 看板新建待认领任务',
|
|
214
|
+
toolLabelTeamGet: '读取 Team 共享任务最新状态', toolLabelTeamList: '列出 Team 共享任务与阻塞关系',
|
|
215
|
+
toolLabelTeamUpdate: '按修订号更新 Team 共享任务', toolLabelWebSearch: '搜索实时网页信息与来源摘要',
|
|
216
|
+
toolLabelWebFetch: '抓取指定 HTTP(S) URL 网页文本', toolLabelSkill: '按需加载指定 Skill 完整指令',
|
|
217
|
+
toolLabelActivateTools: '激活按需延迟加载(deferLoading)的工具', toolLabelSchedule: '管理定时与周期任务',
|
|
218
|
+
toolLabelScheduleCreate: '新建一次性或 Cron 周期任务', toolLabelScheduleEdit: '修改或启停已有定时任务',
|
|
219
|
+
toolLabelScheduleList: '列出定时任务与下次触发时间', toolLabelScheduleView: '查看单个定时任务详情与记录',
|
|
220
|
+
toolLabelPluginManager: '查看、启停、安装或移除 Profile 插件', toolLabelPluginMarket: '浏览插件市场索引与可安装包',
|
|
221
|
+
toolLabelCordisList: '列出宿主已知的 Cordis Inspect Provider', toolLabelCordisQuery: '执行 Cordis Inspect 只读诊断查询',
|
|
222
|
+
toolLabelSessionSearch: '跨历史 Session 搜索匹配事件', toolLabelSessionTrace: '追踪 Session 派生与上下文链路',
|
|
223
|
+
toolLabelSessionEventRead: '读取 Session 单条完整原始事件', toolLabelSessionEventSearch: '在单个 Session 内搜索历史事件',
|
|
224
|
+
toolLabelSessionEventTrace: '追踪单条 Session 事件的引用与替换链', toolLabelMcpList: '列出 MCP Server 可用资源',
|
|
225
|
+
toolLabelMcpTemplates: '列出 MCP Server 参数化 URI 模板', toolLabelMcpRead: '按 URI 读取 MCP Server 资源内容',
|
|
226
|
+
toolLabelWorkspaceDeps: '获取内置 Python 与依赖库路径', toolLabelStagehandNav: '浏览器导航至目标 URL(Stagehand)',
|
|
227
|
+
toolLabelStagehandAct: '在页面执行交互操作(Stagehand)', toolLabelStagehandExtract: '从页面提取结构化数据(Stagehand)',
|
|
228
|
+
toolLabelStagehandObserve: '观察页面可交互元素(Stagehand)', toolLabelStagehandShot: '截取当前浏览器页面(Stagehand)',
|
|
229
|
+
toolLabelStagehandTabs: '管理浏览器标签页(Stagehand)',
|
|
230
|
+
toolLabelViewImage: '查看本地或 HTTP(S) 图片(Codex Connect)',
|
|
231
|
+
toolLabelCodexImageGen: '通过 GPT Image 生成或编辑图片(Codex Connect)',
|
|
232
|
+
toolLabelCodexQuota: '查询当前 Codex 账号共享额度(Codex Connect)',
|
|
233
|
+
toolLabelMcpDynamic: 'MCP 扩展工具', toolLabelOther: '其它工具',
|
|
234
|
+
toolPolicyToolsLoading: '正在读取工具…',
|
|
235
|
+
toolPolicyToolsEmpty: '没有已注册工具。',
|
|
236
|
+
toolPolicyNoMatches: '没有匹配工具。',
|
|
237
|
+
toolPolicyToolsFailed: '工具目录不可用,已保存规则仍保留。',
|
|
238
|
+
toolPolicyToolsRefresh: '刷新工具',
|
|
239
|
+
toolPolicyCatalogLoading: '正在读取预设…',
|
|
240
|
+
toolPolicyCatalogEmpty: '没有可选预设。',
|
|
241
|
+
toolPolicyCatalogFailed: '预设列表不可用,仍可选择已保存 ID。',
|
|
242
|
+
toolPolicyCatalogRetry: '重新读取预设',
|
|
243
|
+
toolPolicyEmpty: '请选择预设',
|
|
244
|
+
toolPolicySave: '保存此预设',
|
|
245
|
+
toolPolicySaving: '正在保存…',
|
|
246
|
+
toolPolicyDiscard: '放弃草稿',
|
|
247
|
+
toolPolicySaved: '此预设已保存。',
|
|
248
|
+
toolPolicyInvalidPreset: '预设 ID 为空,无法保存。',
|
|
249
|
+
toolPolicyDuplicatePreset: '预设 ID 重复,无法保存。',
|
|
250
|
+
toolPolicyRefused: '未保存,草稿基于旧设置。请放弃草稿后重新读取。',
|
|
251
|
+
toolPolicyFailed: '保存失败,此预设草稿已保留。',
|
|
252
|
+
toolPolicyReadOnly: '当前设置为只读。',
|
|
253
|
+
pmRefresh: '刷新',
|
|
254
|
+
peLoading: '正在读取预设…',
|
|
255
|
+
peReadError: '预设定义暂不可用。',
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
const commandNames = new Set([
|
|
259
|
+
'bash', 'pwsh', 'exec_command', 'write_stdin', 'run_code', 'job_list', 'job_output', 'job_kill',
|
|
260
|
+
'terminal_open', 'terminal_list', 'terminal_read', 'terminal_send', 'terminal_signal', 'terminal_close',
|
|
261
|
+
'working_directory', 'create_worktree',
|
|
262
|
+
])
|
|
263
|
+
const fileNames = new Set(['read', 'write', 'edit', 'str_replace_editor', 'apply_patch', 'glob', 'grep', 'read_image', 'view_image', 'lsp'])
|
|
264
|
+
const planNames = new Set(['todo_write', 'update_plan', 'exit_plan_mode', 'ask_user_question', 'present', 'propose_action', 'approve'])
|
|
265
|
+
const collabNames = new Set([
|
|
266
|
+
'subagent', 'subagent_fork', 'subagent_codex', 'subagent_claude_code', 'subagent_oar', 'list_subagent_models',
|
|
267
|
+
'send_message', 'list_agents', 'interrupt_agent', 'wait_agent', 'workflow', 'ralph',
|
|
268
|
+
'create_goal', 'get_goal', 'update_goal', 'goal', 'spawn_teammate', 'team_task_create', 'team_task_get',
|
|
269
|
+
'team_task_list', 'team_task_update',
|
|
270
|
+
])
|
|
271
|
+
|
|
272
|
+
export type ToolGroupId = 'command' | 'file' | 'plan' | 'collab' | 'other'
|
|
273
|
+
|
|
274
|
+
export function groupOf(tool: PresetToolEntry): ToolGroupId {
|
|
275
|
+
if (commandNames.has(tool.name) || tool.replacements.some(item => item.action === 'codex-exec')) return 'command'
|
|
276
|
+
if (fileNames.has(tool.name) || tool.replacements.some(item => item.action === 'codex-patch')) return 'file'
|
|
277
|
+
if (planNames.has(tool.name) || tool.replacements.some(item => item.action === 'codex-plan')) return 'plan'
|
|
278
|
+
if (collabNames.has(tool.name)) return 'collab'
|
|
279
|
+
return 'other'
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export const humanLabels = {
|
|
283
|
+
exec_command: 'toolLabelExec', write_stdin: 'toolLabelStdin', pwsh: 'toolLabelPwsh', bash: 'toolLabelBash',
|
|
284
|
+
run_code: 'toolLabelRunCode', job_list: 'toolLabelJobList', job_output: 'toolLabelJobOutput', job_kill: 'toolLabelJobKill',
|
|
285
|
+
terminal_open: 'toolLabelTermOpen', terminal_list: 'toolLabelTermList', terminal_read: 'toolLabelTermRead',
|
|
286
|
+
terminal_send: 'toolLabelTermSend', terminal_signal: 'toolLabelTermSignal', terminal_close: 'toolLabelTermClose',
|
|
287
|
+
working_directory: 'toolLabelWorkdir', create_worktree: 'toolLabelWorktree', apply_patch: 'toolLabelPatch',
|
|
288
|
+
read: 'toolLabelRead', write: 'toolLabelWrite', edit: 'toolLabelEdit', str_replace_editor: 'toolLabelStrReplace',
|
|
289
|
+
glob: 'toolLabelGlob', grep: 'toolLabelGrep', read_image: 'toolLabelImage', lsp: 'toolLabelLsp',
|
|
290
|
+
update_plan: 'toolLabelPlan', todo_write: 'toolLabelTodo', exit_plan_mode: 'toolLabelExitPlan',
|
|
291
|
+
ask_user_question: 'toolLabelAskUser', present: 'toolLabelPresent', propose_action: 'toolLabelProposeAction', approve: 'toolLabelApprove',
|
|
292
|
+
subagent: 'toolLabelSubagent', subagent_fork: 'toolLabelSubagentFork', subagent_codex: 'toolLabelSubagentCodex',
|
|
293
|
+
subagent_claude_code: 'toolLabelSubagentClaude', subagent_oar: 'toolLabelSubagentOar', list_subagent_models: 'toolLabelSubagentModels',
|
|
294
|
+
send_message: 'toolLabelSendMessage', list_agents: 'toolLabelListAgents', interrupt_agent: 'toolLabelInterruptAgent',
|
|
295
|
+
wait_agent: 'toolLabelWaitAgent', workflow: 'toolLabelWorkflow', ralph: 'toolLabelRalph',
|
|
296
|
+
create_goal: 'toolLabelCreateGoal', get_goal: 'toolLabelGetGoal', update_goal: 'toolLabelUpdateGoal', goal: 'toolLabelGoal',
|
|
297
|
+
spawn_teammate: 'toolLabelSpawnTeammate', team_task_create: 'toolLabelTeamCreate', team_task_get: 'toolLabelTeamGet',
|
|
298
|
+
team_task_list: 'toolLabelTeamList', team_task_update: 'toolLabelTeamUpdate', web_search: 'toolLabelWebSearch',
|
|
299
|
+
web_fetch: 'toolLabelWebFetch', skill: 'toolLabelSkill', activate_tools: 'toolLabelActivateTools',
|
|
300
|
+
schedule: 'toolLabelSchedule', schedule_create: 'toolLabelScheduleCreate', schedule_edit: 'toolLabelScheduleEdit',
|
|
301
|
+
schedule_list: 'toolLabelScheduleList', schedule_view: 'toolLabelScheduleView',
|
|
302
|
+
plugin_manager: 'toolLabelPluginManager', plugin_market: 'toolLabelPluginMarket',
|
|
303
|
+
cordis_inspect_list: 'toolLabelCordisList', cordis_inspect_query: 'toolLabelCordisQuery',
|
|
304
|
+
session_search: 'toolLabelSessionSearch', session_trace: 'toolLabelSessionTrace',
|
|
305
|
+
session_event_read: 'toolLabelSessionEventRead', session_event_search: 'toolLabelSessionEventSearch',
|
|
306
|
+
session_event_trace: 'toolLabelSessionEventTrace', list_mcp_resources: 'toolLabelMcpList',
|
|
307
|
+
list_mcp_resource_templates: 'toolLabelMcpTemplates', read_mcp_resource: 'toolLabelMcpRead',
|
|
308
|
+
load_workspace_dependencies: 'toolLabelWorkspaceDeps', stagehand_navigate: 'toolLabelStagehandNav',
|
|
309
|
+
stagehand_act: 'toolLabelStagehandAct', stagehand_extract: 'toolLabelStagehandExtract',
|
|
310
|
+
stagehand_observe: 'toolLabelStagehandObserve', stagehand_screenshot: 'toolLabelStagehandShot',
|
|
311
|
+
stagehand_tabs: 'toolLabelStagehandTabs',
|
|
312
|
+
view_image: 'toolLabelViewImage',
|
|
313
|
+
codex_connect_image_generate: 'toolLabelCodexImageGen',
|
|
314
|
+
codex_connect_quota: 'toolLabelCodexQuota',
|
|
315
|
+
} as const
|
|
316
|
+
|
|
317
|
+
export const policyStyles = `
|
|
318
|
+
.codex-tool-policy { display:flex; flex-direction:column; gap:12px; min-width:0; font-size:13px; color:var(--dsw-alias-label-primary); }
|
|
319
|
+
.codex-tool-policy p, .codex-tool-policy h3, .codex-tool-policy h4 { margin:0; }
|
|
320
|
+
.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; }
|
|
321
|
+
.codex-tool-policy form, .codex-tool-policy fieldset { min-width:0; margin:0; padding:0; border:0; display:flex; flex-direction:column; gap:10px; }
|
|
322
|
+
.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; }
|
|
323
|
+
.codex-tool-policy .codex-preset-bar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; }
|
|
324
|
+
.codex-tool-policy .codex-preset-select-wrap { display:flex; align-items:center; gap:8px; min-width:0; flex:1 1 260px; }
|
|
325
|
+
.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; }
|
|
326
|
+
.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; }
|
|
327
|
+
.codex-tool-policy .codex-btn:disabled { opacity:.48; cursor:default; }
|
|
328
|
+
.codex-tool-policy .codex-btn-primary { background:var(--dsw-alias-label-primary); color:var(--dsw-alias-bg-base); border-color:transparent; font-weight:500; }
|
|
329
|
+
.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; }
|
|
330
|
+
.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; }
|
|
331
|
+
.codex-tool-policy .codex-seg button:hover:not(:disabled) { color:var(--dsw-alias-label-primary); }
|
|
332
|
+
.codex-tool-policy .codex-seg button:disabled { opacity:.38; cursor:default; }
|
|
333
|
+
.codex-tool-policy .codex-seg button[aria-pressed=true] { background:var(--dsw-alias-label-primary); color:var(--dsw-alias-bg-base); font-weight:500; }
|
|
334
|
+
.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; }
|
|
335
|
+
.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); }
|
|
336
|
+
.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; }
|
|
337
|
+
.codex-tool-policy .codex-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
|
|
338
|
+
.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; }
|
|
339
|
+
.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; }
|
|
340
|
+
.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; }
|
|
341
|
+
.codex-tool-policy details.codex-group[open] > summary { border-bottom:0.5px solid var(--dsw-alias-border-l1); }
|
|
342
|
+
.codex-tool-policy .codex-tool-policy-table { display:flex; flex-direction:column; }
|
|
343
|
+
.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); }
|
|
344
|
+
.codex-tool-policy .codex-tool-policy-tool:last-child { border-bottom:0; }
|
|
345
|
+
.codex-tool-policy .codex-tool-policy-tool[data-tool-action=hide] .codex-tool-policy-name { opacity:.52; }
|
|
346
|
+
.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; }
|
|
347
|
+
.codex-tool-policy .codex-tool-policy-identifier { font-size:13px; font-weight:600; color:var(--dsw-alias-label-primary); }
|
|
348
|
+
.codex-tool-policy .codex-tool-policy-description { font-size:12px; color:var(--dsw-alias-label-secondary); }
|
|
349
|
+
.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); }
|
|
350
|
+
.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; }
|
|
351
|
+
.codex-tool-policy .codex-badge[data-tone=warn] { color:var(--dsw-alias-state-warn-primary); }
|
|
352
|
+
.codex-tool-policy .codex-tool-policy-action { display:flex; align-items:center; gap:6px; flex-shrink:0; }
|
|
353
|
+
.codex-tool-policy .codex-tool-policy-prompts { display:flex; flex-direction:column; gap:10px; }
|
|
354
|
+
.codex-tool-policy .codex-tool-policy-prompt { display:grid; gap:8px; }
|
|
355
|
+
.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; }
|
|
356
|
+
.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; }
|
|
357
|
+
.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)); }
|
|
358
|
+
.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); }
|
|
359
|
+
.codex-tool-policy .codex-save-buttons { display:flex; align-items:center; gap:8px; }
|
|
360
|
+
.codex-tool-policy .codex-tool-policy-warning { color:var(--dsw-alias-state-warn-primary); font-size:12px; }
|
|
361
|
+
.codex-tool-policy .codex-tool-policy-error { color:var(--dsw-alias-state-error-primary); font-size:12px; }
|
|
362
|
+
`
|