@shuind/dsh-codex-harness 0.3.1 → 0.3.2
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 +12 -0
- package/README.md +3 -5
- package/lib/client.js +250 -120
- package/lib/index.js +38 -20
- package/lib/types/client/desktop.js +30 -22
- package/lib/types/client/index.d.ts +11 -0
- package/lib/types/client/policy-locale.d.ts +14 -3
- package/lib/types/client/policy-locale.js +28 -1
- package/lib/types/client/tool-policy.d.ts +15 -1
- package/lib/types/client/tool-policy.js +67 -10
- package/lib/types/contracts/ui-contracts.d.ts +4 -0
- package/lib/types/responses/compact-checkpoint.js +3 -10
- package/lib/types/responses/remote-compact.js +39 -11
- package/package.json +1 -1
- package/src/client/desktop.tsx +40 -22
- package/src/client/policy-locale.ts +27 -2
- package/src/client/tool-policy.tsx +99 -11
- package/src/contracts/ui-contracts.ts +4 -0
- package/src/responses/compact-checkpoint.ts +2 -8
- package/src/responses/remote-compact.ts +41 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.2 (2026-11-28)
|
|
4
|
+
|
|
5
|
+
- **工具页置顶「GPT 能力」分组**:
|
|
6
|
+
- 在预设工具策略页单独置顶「GPT 能力」分组,高亮展示 GPT 来源的联网搜索(托管搜索 / Codex 搜索 / 双搜索)、`codex_connect_image_generate`(默认徽章与提示注明实测路由至 `GPT-Image-2.6 Sunburst`)以及只读 `/compact` 远程压缩说明行。
|
|
7
|
+
- **修复 GPT 能力徽章未实时刷新问题**:
|
|
8
|
+
- 在 `src/client/desktop.tsx` 的设置页 `injected()` 中补齐 `getCodexConnectScope` 注入,修改 `dsh-codex-connect` 的生图模型或搜索配置后工具页徽章可实时同步。
|
|
9
|
+
- **远程压缩健壮性修复**:
|
|
10
|
+
- JSON 压缩响应解析严格校验 `item.type === 'compaction'`,避免将带 `encrypted_content` 的普通推理项(`reasoning`)误认为压缩结果。
|
|
11
|
+
- 远程压缩遇到未卸载的实时图片内容块时不再静默替换为 `[image omitted]`,而是交回 DSH 适配器回退处理;已显式卸载的图片继续使用标准卸载占位文本。
|
|
12
|
+
- **市场截图维护**:
|
|
13
|
+
- 更新设置页与上下文容量/远程压缩展示截图。
|
|
14
|
+
|
|
3
15
|
## 0.3.1 (2026-11-22)
|
|
4
16
|
|
|
5
17
|
- **适配 DeepSeek Harness `0.2.2-rc.5`**:
|
package/README.md
CHANGED
|
@@ -2,21 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
给 DeepSeek Harness(DSH)用的 Codex 风格插件:自带一套混合模式编码预设(`codex-hybrid`)和 Codex 常用工具,支持对任意预设按工具做启用 / 替换 / 延迟加载 / 隐藏,也可以单独调整预设提示词,并针对 OpenAI Responses API 与中转站补全了常用请求增强。
|
|
4
4
|
|
|
5
|
-
当前版本 `0.3.
|
|
5
|
+
当前版本 `0.3.2` 适配 **DeepSeek Harness `0.2.2-rc.1`–`0.2.2-rc.5`**(`engines.dsh: >=0.2.2-rc.1 <=0.2.2-rc.5`)。
|
|
6
6
|
|
|
7
7
|
## 安装
|
|
8
8
|
|
|
9
9
|
### 从插件市场 / npm 安装
|
|
10
10
|
|
|
11
|
-
在 Harness 的 **插件 → 添加插件** 中输入 `@shuind/dsh-codex-harness`(或指定 `@shuind/dsh-codex-harness@0.3.
|
|
11
|
+
在 Harness 的 **插件 → 添加插件** 中输入 `@shuind/dsh-codex-harness`(或指定 `@shuind/dsh-codex-harness@0.3.2`),安装后按提示重启 Harness 即可。
|
|
12
12
|
|
|
13
13
|
### 从离线包安装(GitHub Release)
|
|
14
14
|
|
|
15
|
-
1. 在 [Releases](https://github.com/shuind/dsh-codex-harness/releases) 页面下载对应版本的 `.tgz` 安装包(如 `shuind-dsh-codex-harness-0.3.
|
|
15
|
+
1. 在 [Releases](https://github.com/shuind/dsh-codex-harness/releases) 页面下载对应版本的 `.tgz` 安装包(如 `shuind-dsh-codex-harness-0.3.2.tgz`)。
|
|
16
16
|
2. 打开 Harness 桌面端的 **插件 → 添加插件**,填入该 `.tgz` 文件的本地路径确认安装,然后重启 Harness。
|
|
17
17
|
|
|
18
|
-
> 桌面端请直接在软件内的插件页面安装或升级,不要用命令行里可能存在的旧版 `dsh` 去改桌面端的 `desktop` profile。
|
|
19
|
-
|
|
20
18
|
## 功能概览
|
|
21
19
|
|
|
22
20
|
- **Codex 常用工具**:
|
package/lib/client.js
CHANGED
|
@@ -6112,6 +6112,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6112
6112
|
toolPolicyConditional: "Conditional",
|
|
6113
6113
|
toolPolicyTargetExists: "Replacement target already exists",
|
|
6114
6114
|
toolPolicyPresetDisabled: "Disabled by original preset",
|
|
6115
|
+
toolPolicyGptGroup: "GPT capabilities",
|
|
6116
|
+
toolPolicyGptHostedSearch: "GPT hosted search",
|
|
6117
|
+
toolPolicyGptHostedSearchTitle: "GPT sessions prefer OpenAI Responses hosted web_search (controlled in Runtime preferences).",
|
|
6118
|
+
toolPolicyGptCodexSearch: "Codex search",
|
|
6119
|
+
toolPolicyGptCodexSearchTitle: "Profile-wide web search owned by Codex Connect.",
|
|
6120
|
+
toolPolicyGptDualSearch: "GPT hosted / Codex search",
|
|
6121
|
+
toolPolicyGptDualSearchTitle: "GPT sessions prefer OpenAI hosted web_search; other models use Codex Connect search.",
|
|
6122
|
+
toolPolicyGptImageTitle: "Provided by Codex Connect (ChatGPT subscription image endpoint; tested to route to GPT-Image-2.6 Sunburst); callable from any tool-capable model.",
|
|
6123
|
+
toolPolicyGptCompactionDesc: "Server-side native context compaction (GPT sessions only; falls back to local summary on failure)",
|
|
6124
|
+
toolPolicyGptCompactionBadge: "GPT native compaction",
|
|
6125
|
+
toolPolicyGptCompactionReadOnly: "Non-tool · Runtime preference",
|
|
6115
6126
|
toolPolicyCommandGroup: "Commands & runtime",
|
|
6116
6127
|
toolPolicyFileGroup: "Files & search",
|
|
6117
6128
|
toolPolicyPlanGroup: "Planning & interaction",
|
|
@@ -6279,6 +6290,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6279
6290
|
toolPolicyConditional: "按条件可用",
|
|
6280
6291
|
toolPolicyTargetExists: "替换目标已存在",
|
|
6281
6292
|
toolPolicyPresetDisabled: "原预设未启用",
|
|
6293
|
+
toolPolicyGptGroup: "GPT 能力",
|
|
6294
|
+
toolPolicyGptHostedSearch: "GPT 托管搜索",
|
|
6295
|
+
toolPolicyGptHostedSearchTitle: "GPT 会话优先使用 OpenAI Responses 原生托管搜索(由「运行偏好」控制)。",
|
|
6296
|
+
toolPolicyGptCodexSearch: "Codex 订阅搜索",
|
|
6297
|
+
toolPolicyGptCodexSearchTitle: "由 Codex Connect 接管当前配置全局联网搜索。",
|
|
6298
|
+
toolPolicyGptDualSearch: "GPT 托管 / Codex 搜索",
|
|
6299
|
+
toolPolicyGptDualSearchTitle: "GPT 会话优先使用 OpenAI 原生托管搜索;其他模型走 Codex Connect 订阅搜索。",
|
|
6300
|
+
toolPolicyGptImageTitle: "来源于 Codex Connect(ChatGPT 订阅生图接口,实测路由至 GPT-Image-2.6 Sunburst),支持工具调用的模型均可调用。",
|
|
6301
|
+
toolPolicyGptCompactionDesc: "使用 OpenAI 服务端原生压缩替代默认文本摘要(仅 GPT 会话,失败自动回退)",
|
|
6302
|
+
toolPolicyGptCompactionBadge: "GPT 原生压缩",
|
|
6303
|
+
toolPolicyGptCompactionReadOnly: "非工具 · 运行偏好控制",
|
|
6282
6304
|
toolPolicyCommandGroup: "命令与执行",
|
|
6283
6305
|
toolPolicyFileGroup: "文件与检索",
|
|
6284
6306
|
toolPolicyPlanGroup: "规划与交互",
|
|
@@ -6456,7 +6478,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6456
6478
|
"team_task_list",
|
|
6457
6479
|
"team_task_update"
|
|
6458
6480
|
]);
|
|
6459
|
-
function groupOf(tool) {
|
|
6481
|
+
function groupOf(tool, gptSearchActive = false) {
|
|
6482
|
+
if (tool.name === "codex_connect_image_generate") return "gpt";
|
|
6483
|
+
if (tool.name === "web_search" && gptSearchActive) return "gpt";
|
|
6460
6484
|
if (commandNames.has(tool.name) || tool.replacements.some((item) => item.action === "codex-exec")) return "command";
|
|
6461
6485
|
if (fileNames.has(tool.name) || tool.replacements.some((item) => item.action === "codex-patch")) return "file";
|
|
6462
6486
|
if (planNames.has(tool.name) || tool.replacements.some((item) => item.action === "codex-plan")) return "plan";
|
|
@@ -6583,6 +6607,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6583
6607
|
.codex-tool-policy .codex-tool-policy-description { font-size:12px; color:var(--dsw-alias-label-secondary); }
|
|
6584
6608
|
.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); }
|
|
6585
6609
|
.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; }
|
|
6610
|
+
.codex-tool-policy .codex-badge[data-tone=gpt] { background:var(--dsw-alias-state-success-bg, rgba(16,163,127,0.12)); color:var(--dsw-alias-state-success-primary, #10a37f); border-color:transparent; font-weight:500; }
|
|
6586
6611
|
.codex-tool-policy .codex-badge[data-tone=warn] { color:var(--dsw-alias-state-warn-primary); }
|
|
6587
6612
|
.codex-tool-policy .codex-tool-policy-action { display:flex; align-items:center; gap:6px; flex-shrink:0; }
|
|
6588
6613
|
.codex-tool-policy .codex-tool-policy-prompts { display:flex; flex-direction:column; gap:10px; }
|
|
@@ -6661,8 +6686,31 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6661
6686
|
value
|
|
6662
6687
|
}], revision);
|
|
6663
6688
|
}
|
|
6689
|
+
function resolveGptCapabilities(codexSettings, codexConnect) {
|
|
6690
|
+
const connectReady = codexConnect?.status === "ready";
|
|
6691
|
+
if (codexSettings === void 0 && !connectReady) return void 0;
|
|
6692
|
+
return {
|
|
6693
|
+
hostedWebSearch: codexSettings !== void 0 ? codexSettings.hostedWebSearchEnabled ?? true : false,
|
|
6694
|
+
codexSearch: connectReady && codexConnect.searchEnabled === true,
|
|
6695
|
+
codexSearchModel: connectReady ? codexConnect.searchModel : void 0,
|
|
6696
|
+
remoteCompaction: codexSettings !== void 0 && (codexSettings.remoteCompactionEnabled ?? true) || connectReady && codexConnect.nativeCompaction === true,
|
|
6697
|
+
imageGeneration: connectReady && codexConnect.imageGenerationEnabled === true,
|
|
6698
|
+
imageModelHint: connectReady ? codexConnect.imageModelHint : void 0
|
|
6699
|
+
};
|
|
6700
|
+
}
|
|
6701
|
+
function formatGptImageBadge(hint) {
|
|
6702
|
+
const value = hint?.trim() ?? "";
|
|
6703
|
+
if (!value || value === "gpt-image-2.6-sunburst") return "GPT-Image-2.6 Sunburst";
|
|
6704
|
+
if (value === "gpt-image-2.6-flare") return "GPT-Image-2.6 Flare";
|
|
6705
|
+
if (value === "gpt-image-2") return "GPT-Image-2";
|
|
6706
|
+
return value;
|
|
6707
|
+
}
|
|
6664
6708
|
const isPromptName = (name) => PRESET_PROMPT_NAMES.includes(name);
|
|
6665
6709
|
const GROUP_META = [
|
|
6710
|
+
{
|
|
6711
|
+
id: "gpt",
|
|
6712
|
+
labelKey: "toolPolicyGptGroup"
|
|
6713
|
+
},
|
|
6666
6714
|
{
|
|
6667
6715
|
id: "command",
|
|
6668
6716
|
labelKey: "toolPolicyCommandGroup"
|
|
@@ -6691,7 +6739,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6691
6739
|
...props
|
|
6692
6740
|
});
|
|
6693
6741
|
}
|
|
6694
|
-
function ToolPolicySettingsCard({ form, presetManager, mode = "tools", t }) {
|
|
6742
|
+
function ToolPolicySettingsCard({ form, presetManager, mode = "tools", gptCapabilities, t }) {
|
|
6695
6743
|
const snapshot = (0, react.useSyncExternalStore)((listener) => form.subscribe(listener), () => form.getSnapshot(), () => form.getSnapshot());
|
|
6696
6744
|
const [subMode, setSubMode] = (0, react.useState)(mode === "prompts" || mode === "definition" ? mode : "tools");
|
|
6697
6745
|
const prevMode = (0, react.useRef)(mode);
|
|
@@ -6950,131 +6998,200 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
6950
6998
|
const changedPrompts = currentDraft ? [...new Set([...beforeRule?.promptOverrides ?? [], ...rule?.promptOverrides ?? []].map((entry) => entry.name))].filter((name) => JSON.stringify(beforeRule?.promptOverrides?.find((entry) => entry.name === name)) !== JSON.stringify(rule?.promptOverrides?.find((entry) => entry.name === name))) : [];
|
|
6951
6999
|
const changeSummary = [...changedNames.length ? [`${t("presetSummaryTools")}: ${changedNames.slice(0, 4).join(", ")}${changedNames.length > 4 ? ` (+${changedNames.length - 4})` : ""}`] : [], ...changedPrompts.length ? [`${t("presetSummaryPrompts")}: ${changedPrompts.map((name) => promptCatalog?.sections.find((section) => section.name === name)?.label || name).join(", ")}`] : []].join(" · ") || t(currentDraft && !sameRules(beforeTarget, currentDraft.rules) ? "toolPolicyRuleChanged" : "toolPolicyNoToolDelta");
|
|
6952
7000
|
const unavailable = (reason) => t(reason === "conditional" ? "toolPolicyConditional" : reason === "target-exists" ? "toolPolicyTargetExists" : "toolPolicyUnsupported");
|
|
6953
|
-
const
|
|
7001
|
+
const gptSearchActive = gptCapabilities?.hostedWebSearch === true || gptCapabilities?.codexSearch === true;
|
|
7002
|
+
const gptBadgeFor = (tool) => {
|
|
7003
|
+
if (tool.name === "codex_connect_image_generate") return {
|
|
7004
|
+
label: formatGptImageBadge(gptCapabilities?.imageModelHint),
|
|
7005
|
+
title: t("toolPolicyGptImageTitle")
|
|
7006
|
+
};
|
|
7007
|
+
if (tool.name === "web_search" && gptSearchActive) {
|
|
7008
|
+
const model = gptCapabilities?.codexSearchModel;
|
|
7009
|
+
if (gptCapabilities?.hostedWebSearch && gptCapabilities?.codexSearch) return {
|
|
7010
|
+
label: t("toolPolicyGptDualSearch"),
|
|
7011
|
+
title: model ? `${t("toolPolicyGptDualSearchTitle")} (${model})` : t("toolPolicyGptDualSearchTitle")
|
|
7012
|
+
};
|
|
7013
|
+
if (gptCapabilities?.hostedWebSearch) return {
|
|
7014
|
+
label: t("toolPolicyGptHostedSearch"),
|
|
7015
|
+
title: t("toolPolicyGptHostedSearchTitle")
|
|
7016
|
+
};
|
|
7017
|
+
return {
|
|
7018
|
+
label: model ? `${t("toolPolicyGptCodexSearch")} · ${model}` : t("toolPolicyGptCodexSearch"),
|
|
7019
|
+
title: model ? `${t("toolPolicyGptCodexSearchTitle")} (${model})` : t("toolPolicyGptCodexSearchTitle")
|
|
7020
|
+
};
|
|
7021
|
+
}
|
|
7022
|
+
};
|
|
7023
|
+
const renderRows = (tools, includeCompaction = false) => (0, react_jsx_runtime.jsxs)("div", {
|
|
6954
7024
|
className: "codex-tool-policy-table",
|
|
6955
7025
|
role: "table",
|
|
6956
7026
|
"aria-label": t("toolPolicyTitle"),
|
|
6957
|
-
children: [
|
|
6958
|
-
|
|
6959
|
-
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
|
|
7027
|
+
children: [
|
|
7028
|
+
tools.map((tool) => {
|
|
7029
|
+
const action = chosen(tool);
|
|
7030
|
+
const deferReason = deferUnavailableReason(tool);
|
|
7031
|
+
const supported = action === "keep" || action === "hide" || action === "defer" || tool.replacements.some((option) => option.action === action);
|
|
7032
|
+
const custom = customized(tool);
|
|
7033
|
+
const hasOverride = !!rule?.tools?.some((choice) => choice.name === tool.name);
|
|
7034
|
+
const gptBadge = gptBadgeFor(tool);
|
|
7035
|
+
return (0, react_jsx_runtime.jsxs)("div", {
|
|
7036
|
+
role: "row",
|
|
7037
|
+
className: "codex-tool-policy-tool",
|
|
7038
|
+
"data-tool-name": tool.name,
|
|
7039
|
+
"data-tool-action": action,
|
|
7040
|
+
children: [(0, react_jsx_runtime.jsxs)("div", {
|
|
7041
|
+
role: "cell",
|
|
7042
|
+
className: "codex-tool-policy-name",
|
|
7043
|
+
children: [
|
|
7044
|
+
(0, react_jsx_runtime.jsx)("code", {
|
|
7045
|
+
className: "codex-tool-policy-identifier",
|
|
7046
|
+
children: tool.name
|
|
7047
|
+
}),
|
|
7048
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
7049
|
+
className: "codex-tool-policy-description",
|
|
7050
|
+
title: tool.description,
|
|
7051
|
+
children: human(tool)
|
|
7052
|
+
}),
|
|
7053
|
+
gptBadge && (0, react_jsx_runtime.jsx)("span", {
|
|
7054
|
+
className: "codex-badge",
|
|
7055
|
+
"data-tone": "gpt",
|
|
7056
|
+
title: gptBadge.title,
|
|
7057
|
+
children: gptBadge.label
|
|
7058
|
+
}),
|
|
7059
|
+
tool.defaultDeferred && !custom && (0, react_jsx_runtime.jsx)("span", {
|
|
7060
|
+
className: "codex-badge",
|
|
7061
|
+
"data-tone": "blue",
|
|
7062
|
+
children: t("toolPolicyDefaultDeferred")
|
|
7063
|
+
}),
|
|
7064
|
+
custom && (0, react_jsx_runtime.jsx)("span", {
|
|
7065
|
+
className: "codex-badge",
|
|
7066
|
+
"data-tone": "blue",
|
|
7067
|
+
children: t("toolPolicyModified")
|
|
7068
|
+
}),
|
|
7069
|
+
tool.codexTool?.presetEnabled === false && (0, react_jsx_runtime.jsx)("span", {
|
|
7070
|
+
className: "codex-badge",
|
|
7071
|
+
"data-tone": "warn",
|
|
7072
|
+
children: t("toolPolicyPresetDisabled")
|
|
7073
|
+
}),
|
|
7074
|
+
tool.conditional && tool.codexTool === void 0 && (0, react_jsx_runtime.jsx)("span", {
|
|
7075
|
+
className: "codex-badge",
|
|
7076
|
+
children: t("toolPolicyConditional")
|
|
7077
|
+
})
|
|
7078
|
+
]
|
|
7079
|
+
}), (0, react_jsx_runtime.jsxs)("div", {
|
|
7080
|
+
role: "cell",
|
|
7081
|
+
className: "codex-tool-policy-action",
|
|
7082
|
+
children: [
|
|
7083
|
+
(0, react_jsx_runtime.jsxs)("div", {
|
|
7084
|
+
className: "codex-seg",
|
|
7085
|
+
role: "group",
|
|
7086
|
+
"aria-label": `${t("toolPolicyAction")} ${tool.name}`,
|
|
7087
|
+
children: [
|
|
7088
|
+
(0, react_jsx_runtime.jsx)("button", {
|
|
7089
|
+
type: "button",
|
|
7090
|
+
"data-action": "keep",
|
|
7091
|
+
"aria-pressed": action === "keep",
|
|
7092
|
+
disabled: duplicate,
|
|
7093
|
+
onClick: () => chooseAction(tool, "keep"),
|
|
7094
|
+
children: t("toolPolicyKeep")
|
|
7095
|
+
}),
|
|
7096
|
+
tool.replacements.map((option) => (0, react_jsx_runtime.jsx)("button", {
|
|
7097
|
+
type: "button",
|
|
7098
|
+
"data-action": option.action,
|
|
7099
|
+
"aria-pressed": action === option.action,
|
|
7100
|
+
disabled: duplicate || !option.available,
|
|
7101
|
+
title: option.available ? option.tools.join(" + ") : `${option.tools.join(" + ")} · ${unavailable(option.reason)}`,
|
|
7102
|
+
onClick: () => chooseAction(tool, option.action),
|
|
7103
|
+
children: t("toolPolicyReplaceShort")
|
|
7104
|
+
}, option.action)),
|
|
7105
|
+
(0, react_jsx_runtime.jsx)("button", {
|
|
7106
|
+
type: "button",
|
|
7107
|
+
"data-action": "defer",
|
|
7108
|
+
"aria-pressed": action === "defer",
|
|
7109
|
+
disabled: duplicate || deferReason !== void 0,
|
|
7110
|
+
title: deferReason !== void 0 ? unavailable(deferReason) : t("toolPolicyDeferHint"),
|
|
7111
|
+
onClick: () => chooseAction(tool, "defer"),
|
|
7112
|
+
children: t("toolPolicyDefer")
|
|
7113
|
+
}),
|
|
7114
|
+
(0, react_jsx_runtime.jsx)("button", {
|
|
7115
|
+
type: "button",
|
|
7116
|
+
"data-action": "hide",
|
|
7117
|
+
"aria-pressed": action === "hide",
|
|
7118
|
+
disabled: duplicate,
|
|
7119
|
+
onClick: () => chooseAction(tool, "hide"),
|
|
7120
|
+
children: t("toolPolicyHide")
|
|
7121
|
+
})
|
|
7122
|
+
]
|
|
7123
|
+
}),
|
|
7124
|
+
!supported && (0, react_jsx_runtime.jsxs)("span", {
|
|
7125
|
+
className: "codex-tool-policy-warning",
|
|
7126
|
+
children: [
|
|
7127
|
+
t("toolPolicyUnsupported"),
|
|
7128
|
+
" (",
|
|
7129
|
+
action,
|
|
7130
|
+
")"
|
|
7131
|
+
]
|
|
7132
|
+
}),
|
|
7133
|
+
hasOverride && (0, react_jsx_runtime.jsx)("button", {
|
|
7134
|
+
type: "button",
|
|
7135
|
+
className: "codex-btn",
|
|
7136
|
+
"aria-label": `${t("toolPolicyRestoreChoice")} ${tool.name}`,
|
|
7137
|
+
title: t("toolPolicyRestoreChoice"),
|
|
7138
|
+
onClick: () => removeChoice(tool.name),
|
|
7139
|
+
children: "↶"
|
|
7140
|
+
})
|
|
7141
|
+
]
|
|
7142
|
+
})]
|
|
7143
|
+
}, tool.name);
|
|
7144
|
+
}),
|
|
7145
|
+
includeCompaction && (0, react_jsx_runtime.jsxs)("div", {
|
|
6964
7146
|
role: "row",
|
|
6965
7147
|
className: "codex-tool-policy-tool",
|
|
6966
|
-
"data-
|
|
6967
|
-
"data-tool-action": action,
|
|
7148
|
+
"data-gpt-capability": "compaction",
|
|
6968
7149
|
children: [(0, react_jsx_runtime.jsxs)("div", {
|
|
6969
7150
|
role: "cell",
|
|
6970
7151
|
className: "codex-tool-policy-name",
|
|
6971
7152
|
children: [
|
|
6972
7153
|
(0, react_jsx_runtime.jsx)("code", {
|
|
6973
7154
|
className: "codex-tool-policy-identifier",
|
|
6974
|
-
children:
|
|
7155
|
+
children: "/compact"
|
|
6975
7156
|
}),
|
|
6976
7157
|
(0, react_jsx_runtime.jsx)("span", {
|
|
6977
7158
|
className: "codex-tool-policy-description",
|
|
6978
|
-
|
|
6979
|
-
children: human(tool)
|
|
6980
|
-
}),
|
|
6981
|
-
tool.defaultDeferred && !custom && (0, react_jsx_runtime.jsx)("span", {
|
|
6982
|
-
className: "codex-badge",
|
|
6983
|
-
"data-tone": "blue",
|
|
6984
|
-
children: t("toolPolicyDefaultDeferred")
|
|
6985
|
-
}),
|
|
6986
|
-
custom && (0, react_jsx_runtime.jsx)("span", {
|
|
6987
|
-
className: "codex-badge",
|
|
6988
|
-
"data-tone": "blue",
|
|
6989
|
-
children: t("toolPolicyModified")
|
|
7159
|
+
children: t("toolPolicyGptCompactionDesc")
|
|
6990
7160
|
}),
|
|
6991
|
-
|
|
6992
|
-
className: "codex-badge",
|
|
6993
|
-
"data-tone": "warn",
|
|
6994
|
-
children: t("toolPolicyPresetDisabled")
|
|
6995
|
-
}),
|
|
6996
|
-
tool.conditional && tool.codexTool === void 0 && (0, react_jsx_runtime.jsx)("span", {
|
|
7161
|
+
(0, react_jsx_runtime.jsx)("span", {
|
|
6997
7162
|
className: "codex-badge",
|
|
6998
|
-
|
|
7163
|
+
"data-tone": "gpt",
|
|
7164
|
+
children: t("toolPolicyGptCompactionBadge")
|
|
6999
7165
|
})
|
|
7000
7166
|
]
|
|
7001
|
-
}), (0, react_jsx_runtime.
|
|
7167
|
+
}), (0, react_jsx_runtime.jsx)("div", {
|
|
7002
7168
|
role: "cell",
|
|
7003
7169
|
className: "codex-tool-policy-action",
|
|
7004
|
-
children:
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
"aria-label": `${t("toolPolicyAction")} ${tool.name}`,
|
|
7009
|
-
children: [
|
|
7010
|
-
(0, react_jsx_runtime.jsx)("button", {
|
|
7011
|
-
type: "button",
|
|
7012
|
-
"data-action": "keep",
|
|
7013
|
-
"aria-pressed": action === "keep",
|
|
7014
|
-
disabled: duplicate,
|
|
7015
|
-
onClick: () => chooseAction(tool, "keep"),
|
|
7016
|
-
children: t("toolPolicyKeep")
|
|
7017
|
-
}),
|
|
7018
|
-
tool.replacements.map((option) => (0, react_jsx_runtime.jsx)("button", {
|
|
7019
|
-
type: "button",
|
|
7020
|
-
"data-action": option.action,
|
|
7021
|
-
"aria-pressed": action === option.action,
|
|
7022
|
-
disabled: duplicate || !option.available,
|
|
7023
|
-
title: option.available ? option.tools.join(" + ") : `${option.tools.join(" + ")} · ${unavailable(option.reason)}`,
|
|
7024
|
-
onClick: () => chooseAction(tool, option.action),
|
|
7025
|
-
children: t("toolPolicyReplaceShort")
|
|
7026
|
-
}, option.action)),
|
|
7027
|
-
(0, react_jsx_runtime.jsx)("button", {
|
|
7028
|
-
type: "button",
|
|
7029
|
-
"data-action": "defer",
|
|
7030
|
-
"aria-pressed": action === "defer",
|
|
7031
|
-
disabled: duplicate || deferReason !== void 0,
|
|
7032
|
-
title: deferReason !== void 0 ? unavailable(deferReason) : t("toolPolicyDeferHint"),
|
|
7033
|
-
onClick: () => chooseAction(tool, "defer"),
|
|
7034
|
-
children: t("toolPolicyDefer")
|
|
7035
|
-
}),
|
|
7036
|
-
(0, react_jsx_runtime.jsx)("button", {
|
|
7037
|
-
type: "button",
|
|
7038
|
-
"data-action": "hide",
|
|
7039
|
-
"aria-pressed": action === "hide",
|
|
7040
|
-
disabled: duplicate,
|
|
7041
|
-
onClick: () => chooseAction(tool, "hide"),
|
|
7042
|
-
children: t("toolPolicyHide")
|
|
7043
|
-
})
|
|
7044
|
-
]
|
|
7045
|
-
}),
|
|
7046
|
-
!supported && (0, react_jsx_runtime.jsxs)("span", {
|
|
7047
|
-
className: "codex-tool-policy-warning",
|
|
7048
|
-
children: [
|
|
7049
|
-
t("toolPolicyUnsupported"),
|
|
7050
|
-
" (",
|
|
7051
|
-
action,
|
|
7052
|
-
")"
|
|
7053
|
-
]
|
|
7054
|
-
}),
|
|
7055
|
-
hasOverride && (0, react_jsx_runtime.jsx)("button", {
|
|
7056
|
-
type: "button",
|
|
7057
|
-
className: "codex-btn",
|
|
7058
|
-
"aria-label": `${t("toolPolicyRestoreChoice")} ${tool.name}`,
|
|
7059
|
-
title: t("toolPolicyRestoreChoice"),
|
|
7060
|
-
onClick: () => removeChoice(tool.name),
|
|
7061
|
-
children: "↶"
|
|
7062
|
-
})
|
|
7063
|
-
]
|
|
7170
|
+
children: (0, react_jsx_runtime.jsx)("span", {
|
|
7171
|
+
className: "codex-badge",
|
|
7172
|
+
children: t("toolPolicyGptCompactionReadOnly")
|
|
7173
|
+
})
|
|
7064
7174
|
})]
|
|
7065
|
-
},
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7175
|
+
}, "__gpt_compaction__"),
|
|
7176
|
+
tools.length === 0 && !includeCompaction && (0, react_jsx_runtime.jsx)("p", {
|
|
7177
|
+
className: "codex-tool-policy-note",
|
|
7178
|
+
style: { padding: "12px 14px" },
|
|
7179
|
+
children: t("toolPolicyNoMatches")
|
|
7180
|
+
})
|
|
7181
|
+
]
|
|
7071
7182
|
});
|
|
7072
7183
|
if (snapshot.status !== "ready" || snapshot.value === void 0 || mode === "inactive") return null;
|
|
7073
7184
|
const text = query.trim().toLowerCase();
|
|
7074
7185
|
const isFiltering = text.length > 0 || filter !== "all";
|
|
7075
7186
|
const allTools = inventory?.tools ?? [];
|
|
7076
7187
|
const hasReplaceable = allTools.some((tool) => tool.replacements.some((option) => option.available));
|
|
7077
|
-
const shown = allTools.filter((tool) =>
|
|
7188
|
+
const shown = allTools.filter((tool) => {
|
|
7189
|
+
const gptBadge = gptBadgeFor(tool);
|
|
7190
|
+
const haystack = `${human(tool)} ${tool.name} ${tool.description} ${gptBadge?.label ?? ""}`.toLowerCase();
|
|
7191
|
+
return (!text || haystack.includes(text)) && (filter === "all" || (filter === "modified" ? customized(tool) : filter === "deferred" ? chosen(tool) === "defer" : tool.replacements.some((option) => option.available)));
|
|
7192
|
+
});
|
|
7193
|
+
const compactionSearchText = `/compact compaction ${t("toolPolicyGptCompactionDesc")} ${t("toolPolicyGptCompactionBadge")} gpt`.toLowerCase();
|
|
7194
|
+
const showCompactionRow = gptCapabilities?.remoteCompaction === true && filter === "all" && (!text || compactionSearchText.includes(text));
|
|
7078
7195
|
return (0, react_jsx_runtime.jsxs)("section", {
|
|
7079
7196
|
className: "codex-tool-policy",
|
|
7080
7197
|
"aria-label": t(activeSub === "prompts" ? "settingsPresetPrompts" : "toolPolicyTitle"),
|
|
@@ -7206,14 +7323,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7206
7323
|
})
|
|
7207
7324
|
]
|
|
7208
7325
|
}),
|
|
7209
|
-
inventory && !duplicate && (isFiltering && shown.length === 0 ? (0, react_jsx_runtime.jsx)("div", {
|
|
7326
|
+
inventory && !duplicate && (isFiltering && shown.length === 0 && !showCompactionRow ? (0, react_jsx_runtime.jsx)("div", {
|
|
7210
7327
|
className: "codex-card",
|
|
7211
7328
|
children: renderRows(shown)
|
|
7212
7329
|
}) : GROUP_META.map((group) => {
|
|
7213
|
-
const tools = shown.filter((tool) => groupOf(tool) === group.id);
|
|
7214
|
-
|
|
7330
|
+
const tools = shown.filter((tool) => groupOf(tool, gptSearchActive) === group.id);
|
|
7331
|
+
const includeCompaction = group.id === "gpt" && showCompactionRow;
|
|
7332
|
+
if (!tools.length && !includeCompaction) return null;
|
|
7215
7333
|
const changes = tools.filter(customized).length;
|
|
7216
7334
|
const key = `${selectedId}/${group.id}`;
|
|
7335
|
+
const count = tools.length + (includeCompaction ? 1 : 0);
|
|
7217
7336
|
return (0, react_jsx_runtime.jsxs)("details", {
|
|
7218
7337
|
className: "codex-group",
|
|
7219
7338
|
"data-tool-group": group.id,
|
|
@@ -7224,8 +7343,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7224
7343
|
},
|
|
7225
7344
|
children: [(0, react_jsx_runtime.jsxs)("summary", { children: [(0, react_jsx_runtime.jsx)("span", { children: t(group.labelKey) }), (0, react_jsx_runtime.jsxs)("span", {
|
|
7226
7345
|
className: "codex-tool-policy-note",
|
|
7227
|
-
children: [
|
|
7228
|
-
})] }), renderRows(tools)]
|
|
7346
|
+
children: [count, changes ? ` · ${changes} ${t("toolPolicyCustomized")}` : ""]
|
|
7347
|
+
})] }), renderRows(tools, includeCompaction)]
|
|
7229
7348
|
}, group.id);
|
|
7230
7349
|
}))
|
|
7231
7350
|
] }),
|
|
@@ -7619,6 +7738,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7619
7738
|
for (const [k, v] of Object.entries(record)) if (v === null || typeof v === "number" && Number.isSafeInteger(v) && v > 0) out[k] = v;
|
|
7620
7739
|
return out;
|
|
7621
7740
|
}
|
|
7741
|
+
function projectCodexConnectRecord(record, baseRecord, writable) {
|
|
7742
|
+
const searchModel = typeof record.searchModel === "string" && record.searchModel.trim() ? record.searchModel.trim() : void 0;
|
|
7743
|
+
const imageModelHint = typeof record.imageModelHint === "string" ? record.imageModelHint.trim() : void 0;
|
|
7744
|
+
return {
|
|
7745
|
+
status: "ready",
|
|
7746
|
+
writable,
|
|
7747
|
+
overrides: asOverrides(record.contextWindowOverrides),
|
|
7748
|
+
baseOverrides: asOverrides(baseRecord?.contextWindowOverrides),
|
|
7749
|
+
...typeof record.enableNativeCompaction === "boolean" ? { nativeCompaction: record.enableNativeCompaction } : {},
|
|
7750
|
+
...typeof record.enableSearch === "boolean" ? { searchEnabled: record.enableSearch } : {},
|
|
7751
|
+
...searchModel !== void 0 ? { searchModel } : {},
|
|
7752
|
+
...typeof record.enableImageGeneration === "boolean" ? { imageGenerationEnabled: record.enableImageGeneration } : {},
|
|
7753
|
+
...imageModelHint !== void 0 ? { imageModelHint } : {}
|
|
7754
|
+
};
|
|
7755
|
+
}
|
|
7622
7756
|
function bindCodexConnectScope(configForms) {
|
|
7623
7757
|
const form = configForms.get(OPENAI_CODEX_SETTINGS_NAMESPACE);
|
|
7624
7758
|
const mirror = configForms.describe?.();
|
|
@@ -7636,13 +7770,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7636
7770
|
lastFormSnap = formSnap;
|
|
7637
7771
|
lastMirrorSnap = mirrorSnap;
|
|
7638
7772
|
const formRecord = formSnap.status === "ready" ? asRecord(formSnap.value) : void 0;
|
|
7639
|
-
if (formRecord !== void 0) return projected =
|
|
7640
|
-
status: "ready",
|
|
7641
|
-
writable: formSnap.writable,
|
|
7642
|
-
overrides: asOverrides(formRecord.contextWindowOverrides),
|
|
7643
|
-
baseOverrides: asOverrides(asRecord(formSnap.base)?.contextWindowOverrides),
|
|
7644
|
-
...typeof formRecord.enableNativeCompaction === "boolean" ? { nativeCompaction: formRecord.enableNativeCompaction } : {}
|
|
7645
|
-
};
|
|
7773
|
+
if (formRecord !== void 0) return projected = projectCodexConnectRecord(formRecord, asRecord(formSnap.base), formSnap.writable);
|
|
7646
7774
|
const view = mirrorSnap?.view;
|
|
7647
7775
|
if (view !== void 0) {
|
|
7648
7776
|
const row = view.namespaces?.find((candidate) => candidate.ns === OPENAI_CODEX_SETTINGS_NAMESPACE);
|
|
@@ -7651,13 +7779,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7651
7779
|
status: "unavailable",
|
|
7652
7780
|
writable: false
|
|
7653
7781
|
};
|
|
7654
|
-
return projected =
|
|
7655
|
-
status: "ready",
|
|
7656
|
-
writable: view.writable ?? formSnap.writable,
|
|
7657
|
-
overrides: asOverrides(rowRecord.contextWindowOverrides),
|
|
7658
|
-
baseOverrides: asOverrides(asRecord(row.base)?.contextWindowOverrides),
|
|
7659
|
-
...typeof rowRecord.enableNativeCompaction === "boolean" ? { nativeCompaction: rowRecord.enableNativeCompaction } : {}
|
|
7660
|
-
};
|
|
7782
|
+
return projected = projectCodexConnectRecord(rowRecord, asRecord(row.base), view.writable ?? formSnap.writable);
|
|
7661
7783
|
}
|
|
7662
7784
|
return projected = {
|
|
7663
7785
|
status: formSnap.status,
|
|
@@ -7836,9 +7958,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7836
7958
|
]
|
|
7837
7959
|
});
|
|
7838
7960
|
}
|
|
7961
|
+
const EMPTY_CONNECT_SUBSCRIBE = () => () => {};
|
|
7962
|
+
const EMPTY_CONNECT_SNAPSHOT = () => void 0;
|
|
7839
7963
|
function CodexSettingsTab(props) {
|
|
7840
|
-
const { toolPolicy, presetManager, t } = props;
|
|
7964
|
+
const { toolPolicy, presetManager, getCodexConnectScope, t } = props;
|
|
7841
7965
|
const [page, setPage] = (0, react.useState)(props.initialPage ?? "tools");
|
|
7966
|
+
const settingsSnapshot = typeof props.useSettings === "function" ? props.useSettings((state) => state) : void 0;
|
|
7967
|
+
const connectScope = getCodexConnectScope?.();
|
|
7968
|
+
const connectSnapshot = (0, react.useSyncExternalStore)(connectScope ? connectScope.subscribe : EMPTY_CONNECT_SUBSCRIBE, connectScope ? connectScope.getSnapshot : EMPTY_CONNECT_SNAPSHOT, connectScope ? connectScope.getSnapshot : EMPTY_CONNECT_SNAPSHOT);
|
|
7969
|
+
const gptCapabilities = resolveGptCapabilities(settingsSnapshot?.value, connectSnapshot);
|
|
7842
7970
|
const mode = page === "tools" ? "tools" : "inactive";
|
|
7843
7971
|
return (0, react_jsx_runtime.jsxs)("section", {
|
|
7844
7972
|
className: "codex-harness-settings",
|
|
@@ -7863,6 +7991,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7863
7991
|
binding: toolPolicy,
|
|
7864
7992
|
presetManager,
|
|
7865
7993
|
mode,
|
|
7994
|
+
gptCapabilities,
|
|
7866
7995
|
t
|
|
7867
7996
|
}),
|
|
7868
7997
|
(0, react_jsx_runtime.jsx)(RuntimeSettingsEditor, {
|
|
@@ -7902,6 +8031,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
7902
8031
|
unsetSetting: (field) => settings.unset(field),
|
|
7903
8032
|
presetManager,
|
|
7904
8033
|
toolPolicy,
|
|
8034
|
+
getCodexConnectScope,
|
|
7905
8035
|
saveSettings: async (edits, revision) => {
|
|
7906
8036
|
await saveDesktopSettings(form, edits, revision);
|
|
7907
8037
|
if (typeof edits.remoteCompactionEnabled === "boolean") {
|