dsh-codex-connect 0.1.0-alpha.4.13 → 0.1.0-alpha.4.15

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/INSTALL.md CHANGED
@@ -12,7 +12,7 @@ Install `dsh-codex-connect` into one requested DeepSeek Harness profile without
12
12
 
13
13
  ## Install and validate
14
14
 
15
- The only verified combination is DSH plugin API packages `0.1.0-rc.7`, `@earendil-works/pi-ai` `0.82.1`, and Node.js `^22.19.0 || >=24.0.0`. Alpha 4.10 uses the rc.7 keyed Plugin configuration slot; DSH rc.6 users should remain on Alpha 4.9. Upgrade the DSH API packages and pi-ai together, then rerun `dsh-codex-connect doctor --json` and `pnpm --silent run check:compatibility`; the contract does not make claims about future versions.
15
+ The only verified combination is DSH plugin API packages `0.1.1-rc.2`, `@earendil-works/pi-ai` `0.82.1`, and Node.js `^22.19.0 || >=24.0.0`. Alpha 4.15 uses the rc.2 keyed Plugin configuration slot; users of older DSH API packages should upgrade the DSH API packages and pi-ai together, then rerun `dsh-codex-connect doctor --json` and `pnpm --silent run check:compatibility`; the contract does not make claims about future versions.
16
16
 
17
17
  1. Check `dsh --version` or `dsh --help`. From a Harness checkout use `pnpm dsh`.
18
18
  2. Install the package:
@@ -21,7 +21,7 @@ The only verified combination is DSH plugin API packages `0.1.0-rc.7`, `@earendi
21
21
  dsh plugin --profile web add dsh-codex-connect@alpha
22
22
  ```
23
23
 
24
- After `0.1.0-alpha.4.13` is published, pin it exactly with `dsh plugin --profile web add dsh-codex-connect@0.1.0-alpha.4.13`. If npm is unavailable after its matching GitHub prerelease is created, use `dsh plugin --profile web add 'github:franksong2702/dsh-codex-connect#v0.1.0-alpha.4.13'`.
24
+ After `0.1.0-alpha.4.15` is published, pin it exactly with `dsh plugin --profile web add dsh-codex-connect@0.1.0-alpha.4.15`. If npm is unavailable after its matching GitHub prerelease is created, use `dsh plugin --profile web add 'github:franksong2702/dsh-codex-connect#v0.1.0-alpha.4.15'`.
25
25
 
26
26
  3. Run `dsh --profile web --dump-config` and require exactly one `llm-openai-codex` row loading `dsh-codex-connect`.
27
27
  4. Confirm the effective `agent-default-model` and `web.searchProvider` values are unchanged from before installation.
package/MIGRATION.md CHANGED
@@ -10,3 +10,21 @@
10
10
  6. Run `--dump-config`, then `dsh-codex-connect doctor`. Do not run OAuth again when `status` already reports signed in.
11
11
 
12
12
  Rollback is the inverse package swap. Do not delete or copy the separate OAuth file during either direction. If Harness reports a duplicate `openai-codex` adapter, the old bundle or a manual provider row is still active; resolve that one row instead of changing credentials.
13
+
14
+ ## Repairing search history written by Alpha 4.10
15
+
16
+ Alpha 4.10 briefly wrote `web/openai-codex-search-llm-request` as a required private Session event. Because an external plugin cannot extend the Host persistence vocabulary across independent module instances, a newer Harness can refuse to read those histories after the event writer is removed.
17
+
18
+ Upgrade Codex Connect, then inspect the default `$DSH_HOME/sessions` root without changing it:
19
+
20
+ ```sh
21
+ dsh plugin --profile web exec dsh-codex-connect migrate-history --json
22
+ ```
23
+
24
+ If the dry run reports affected events, stop every DSH process that can write this Session root and apply the migration. `--confirm-stopped` is required together with `--apply`:
25
+
26
+ ```sh
27
+ dsh plugin --profile web exec dsh-codex-connect migrate-history --apply --confirm-stopped --json
28
+ ```
29
+
30
+ The migration changes only that retired event's envelope by adding `"ignorable": true`. It preserves event data, sequence, time, and the concatenated Zstandard frame layout, and creates `session.jsonl.zstd.pre-codex-search-history-migration` beside every changed artifact before replacing it. Keep that backup until you have reopened and verified the repaired Session. Re-running the command is safe. For a non-default JSONL persistence root, pass `--root /absolute/path/to/sessions`. SQLite and uncompressed JSONL stores are not modified by this command. Applying fails closed when the filesystem cannot create the required same-directory hard-link backup. Applying is also fail-closed on Windows; Windows users can run the dry-run only.
package/README.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # git hash-object README.md docs/README.zh.md
5
- README.md: 2f74e9c6f07f649354b00d8055bc2470a2e85c1c
6
- docs/README.zh.md: a8efb3f3f0380f864bf54cbe5b47487ffd52b52c
5
+ README.md: 3100a9d730d2eb072e5afcb5897b548da0e00fab
6
+ docs/README.zh.md: a7c3497b9676910b0857e71937241acdcb20b76e
package/README.md CHANGED
@@ -10,11 +10,11 @@ Connect your ChatGPT subscription to DeepSeek Harness with OAuth, optional GPT I
10
10
  <img src="https://raw.githubusercontent.com/franksong2702/dsh-codex-connect/main/docs/assets/en/hero.jpg" alt="Codex Connect — ChatGPT OAuth for DeepSeek Harness" width="100%">
11
11
  </p>
12
12
 
13
- `dsh-codex-connect` adds the `openai-codex` model catalog and a separate ChatGPT OAuth login. Models run through Harness's normal LLM service, so streaming, tool calls, reasoning replay, compaction, filesystem controls, permission gates, and approval prompts remain Harness-owned. It does not turn a ChatGPT subscription into an OpenAI Platform API credential.
13
+ `dsh-codex-connect` adds the `openai-codex` model catalog and a separate ChatGPT OAuth login. Models run through Harness's normal LLM service, so streaming, tool calls, reasoning replay, compaction, filesystem controls, permission gates, and approval prompts remain Harness-owned. It does not turn a ChatGPT subscription into an OpenAI Platform API credential. When an eligible GPT Codex model is selected, the Composer also shows a conversation-scoped Fast Mode toggle and a compact weekly-quota indicator.
14
14
 
15
15
  Installation is additive. The bundle does not replace the current default model or search route. Standalone search, `view_image`, and image generation remain disabled until explicitly enabled.
16
16
 
17
- Every UI screenshot in this English guide is captured from the English-localized Harness UI. The [Chinese guide](docs/README.zh.md) uses a Chinese capture of the same state. Model and provider identifiers keep their canonical spelling in both languages.
17
+ The setup and image-result screenshots in this English guide are captured from the English-localized Harness UI. The shared Composer crop is a language-neutral feature strip; the [Chinese guide](docs/README.zh.md) uses the same strip and Chinese captures for the other screens. Model and provider identifiers keep their canonical spelling in both languages.
18
18
 
19
19
  ## Quick start (about five minutes)
20
20
 
@@ -28,7 +28,7 @@ dsh plugin --profile web add dsh-codex-connect@alpha
28
28
 
29
29
  Expected result: the package is added to that profile. This does not change the profile's default model or global search route.
30
30
 
31
- To reproduce this release exactly, use `dsh plugin --profile web add dsh-codex-connect@0.1.0-alpha.4.13`. If npm is unavailable after the matching GitHub prerelease exists, use `dsh plugin --profile web add 'github:franksong2702/dsh-codex-connect#v0.1.0-alpha.4.13'`. A local checkout can be installed as `link:/absolute/path/to/dsh-codex-connect`.
31
+ To reproduce this release exactly, use `dsh plugin --profile web add dsh-codex-connect@0.1.0-alpha.4.15`. If npm is unavailable after the matching GitHub prerelease exists, use `dsh plugin --profile web add 'github:franksong2702/dsh-codex-connect#v0.1.0-alpha.4.15'`. A local checkout can be installed as `link:/absolute/path/to/dsh-codex-connect`.
32
32
 
33
33
  ### 2. Start Harness
34
34
 
@@ -50,7 +50,7 @@ Expected result: a fresh installation shows **Not signed in** and a **Sign in wi
50
50
 
51
51
  ### 4. Sign in with ChatGPT
52
52
 
53
- Click **Sign in with ChatGPT** and complete the browser approval yourself. Do not copy an authorization URL, code, token, or account identifier into an issue, log, or configuration file.
53
+ Click **Sign in with ChatGPT** and complete the browser approval yourself. If an embedded WebView blocks the sign-in window, use the displayed **Open ChatGPT sign-in page** link to continue in your system browser. Do not copy an authorization URL, code, token, or account identifier into an issue, log, or configuration file.
54
54
 
55
55
  Expected result: the account area changes to **Signed in**. The screenshot below is the successful end state after this step; it is not the initial sign-in screen.
56
56
 
@@ -85,6 +85,18 @@ dsh plugin --profile web exec dsh-codex-connect doctor --json
85
85
 
86
86
  Expected result: `status --json` reports `signed-in` and exits `0`, while `doctor --json` prints one secret-free JSON document. A signed-out `status --json` exits `1`; return to step 4 instead of treating that as a plugin failure.
87
87
 
88
+ ### Composer controls for GPT Codex conversations
89
+
90
+ The two small controls are shown only when the current conversation is using a GPT model from the `openai-codex` provider. They are session controls, not profile-wide settings:
91
+
92
+ - **Fast Mode (lightning icon)** is off by default for each conversation. Click it to request the faster `1.5×` mode; click it again to return to Standard speed. The control is bound to that conversation and does not change the selected model or other conversations. Hover or focus the icon to see the current state and its quota-consumption warning.
93
+ - **Weekly quota bar** is the short horizontal bar beside the model selector. Its color moves from green through yellow/orange to red as the remaining amount falls. Hover or focus it to see the exact remaining percentage and the server-provided reset time. It is hidden for non-GPT models or when usage data is unavailable.
94
+ - For the exact `gpt-5.3-codex-spark` model, the Composer reads the Spark weekly bucket. Other GPT Codex models read the standard Codex weekly bucket; these are separate limits.
95
+
96
+ <p align="center">
97
+ <img src="https://raw.githubusercontent.com/franksong2702/dsh-codex-connect/main/docs/assets/composer-capabilities.jpg" alt="DeepSeek Harness Composer with the per-conversation Fast Mode lightning control and weekly quota bar" width="820">
98
+ </p>
99
+
88
100
  ## Optional capabilities (off by default)
89
101
 
90
102
  The installed bundle is intentionally inert beyond model-provider registration:
@@ -103,7 +115,7 @@ Open **Settings → Plugins → Plugin configuration → Codex Connect** to mana
103
115
 
104
116
  - `enableSearch: true` registers Codex as an available search provider. It does not select the profile's global search route.
105
117
  - `enableImageTool: true` enables `view_image` for approved local reads and public-network image fetches on vision-capable models.
106
- - `enableImageGeneration: true` enables the prompt-only image generation tool. Use the image generation capability included with your current GPT subscription. Generated images are saved as DSH attachments and shown in the conversation with the native image gallery.
118
+ - `enableImageGeneration: true` enables the prompt-only image generation tool. Use the image generation capability included with your current GPT subscription. Generated images are saved as DSH attachments and shown in the Codex Connect result gallery.
107
119
 
108
120
  The screenshot below is an example after someone has explicitly enabled capabilities. It does not show the fresh-install default. This English guide uses the English-localized capture; the Chinese guide shows the matching Chinese-localized state.
109
121
 
@@ -124,6 +136,17 @@ This capability uses the image generation access included with your current GPT
124
136
  <img src="https://raw.githubusercontent.com/franksong2702/dsh-codex-connect/main/docs/assets/en/image-generation.png" alt="English-localized Codex Connect GPT Image result with preview, copyable prompt, download action, and image details" width="780">
125
137
  </p>
126
138
 
139
+ The detailed image prompt is authored by the selected GPT model. Codex Connect does not silently add image parameters: it validates the prompt-only request, forwards it through the ChatGPT subscription capability, and stores the returned image as a DSH attachment. On the result card you can scroll through and copy the complete prompt. **Try again** and **Generate another** send that card's own prompt again, so an older card is not accidentally regenerated from a newer conversation message. **Modify this image** first asks what you want to change, then continues from that card's prompt.
140
+
141
+ ### Usage limits in Plugin configuration
142
+
143
+ After sign-in, the Codex Connect settings card can show several server-reported windows. They are separate buckets, not three views of one number:
144
+
145
+ - **Codex · Weekly** is the standard Codex weekly bucket used by ordinary GPT Codex models.
146
+ - **GPT-5.3-Codex-Spark · 5-hour** and **GPT-5.3-Codex-Spark · Weekly** are the two Spark windows returned for the Spark model.
147
+
148
+ Each bar shows the remaining percentage and its local reset time. OpenAI controls the returned windows, eligibility, and reset values; missing usage data is treated as unavailable rather than guessed.
149
+
127
150
  ### Change a default model or global search route separately
128
151
 
129
152
  To make a Codex model the default for new agents, add or update the separate Harness row yourself:
@@ -164,6 +187,7 @@ Selecting Codex as the profile's global search route is another explicit change:
164
187
  - If the card says **Sign in again** or the server asks for reauthentication, click that action and complete the same safe browser flow. It preserves this plugin's capability settings and does not silently change your default model or global search route. Do not run `logout` just to renew a session.
165
188
  - `doctor` reads process and filesystem metadata only. `doctor --json` emits exactly one secret-free JSON document with schema version 1, package/version/Node metadata, credential-file state and safe mode, capabilities, conflict status, and hints. It omits the absolute credential path and OAuth, account, and expiry data.
166
189
  - `status --json` emits only signed-in or signed-out state with package metadata. `status --json` reads the credential only to determine sign-in state, but never prints credential contents or starts OAuth.
190
+ - Alpha 4.10 users whose search histories fail with an unknown `web/openai-codex-search-llm-request` event can run `dsh-codex-connect migrate-history --json`, stop DSH, then apply the reported repair with `migrate-history --apply --confirm-stopped --json`. The command is dry-run by default, backs up every changed compressed JSONL artifact, and is dry-run only on Windows; see [MIGRATION.md](MIGRATION.md).
167
191
  - OAuth is stored separately at `$DSH_HOME/.openai-codex-auth.json` (`~/.dsh` by default). `~/.codex/auth.json` is never copied or modified. The parent directory and file use owner-only permissions where supported, writes are atomic, and refresh writes use a cross-process file lock.
168
192
  - By default, the OAuth routes accept loopback browser requests only. When DSH runs on one device and you open it from another device on a trusted network, approve the browser address-bar origin explicitly on the device that runs DSH:
169
193
 
@@ -179,7 +203,7 @@ Selecting Codex as the profile's global search route is another explicit change:
179
203
 
180
204
  ## Compatibility and security boundary
181
205
 
182
- - The only verified compatibility combination is DSH plugin API packages `0.1.0-rc.7`, `@earendil-works/pi-ai` `0.82.1`, and Node.js `^22.19.0 || >=24.0.0`; see [compatibility.json](compatibility.json). Alpha 4.10 uses the rc.7 keyed Plugin configuration slot; DSH rc.6 users should remain on Alpha 4.9.
206
+ - The only verified compatibility combination is DSH plugin API packages `0.1.1-rc.2`, `@earendil-works/pi-ai` `0.82.1`, and Node.js `^22.19.0 || >=24.0.0`; see [compatibility.json](compatibility.json). Alpha 4.15 uses the rc.2 keyed Plugin configuration slot; users of older DSH API packages should upgrade to the rc.2 API packages.
183
207
  - Upgrade the DSH plugin API packages and `@earendil-works/pi-ai` as one group, then run `dsh-codex-connect doctor --json` and the compatibility check again. This contract does not make claims about future versions.
184
208
  - ChatGPT plan eligibility, model access, quotas, and backend behavior are controlled by OpenAI and may change.
185
209
  - The Codex endpoint does not enforce the ordinary Responses `max_output_tokens` field. Harness compaction still works, but that summary cap cannot be imposed server-side on this route.
@@ -4,7 +4,7 @@
4
4
  "node": "^22.19.0 || >=24.0.0"
5
5
  },
6
6
  "dshPluginApi": {
7
- "version": "0.1.0-rc.7",
7
+ "version": "0.1.1-rc.2",
8
8
  "packages": [
9
9
  "@deepseek-ai/dsh-agent",
10
10
  "@deepseek-ai/dsh-atomic-write",
package/docs/README.zh.md CHANGED
@@ -10,7 +10,7 @@
10
10
  <img src="https://raw.githubusercontent.com/franksong2702/dsh-codex-connect/main/docs/assets/zh/hero.jpg" alt="Codex Connect — 通过 ChatGPT OAuth 连接 DeepSeek Harness" width="100%">
11
11
  </p>
12
12
 
13
- `dsh-codex-connect` 提供 `openai-codex` 模型目录和独立的 ChatGPT OAuth 登录。模型仍走 Harness 标准 LLM 服务,因此流式输出、工具调用、reasoning replay、压缩、文件系统控制、权限门禁和审批提示仍由 Harness 负责。ChatGPT 订阅不会因此变成 OpenAI Platform API 凭据。
13
+ `dsh-codex-connect` 提供 `openai-codex` 模型目录和独立的 ChatGPT OAuth 登录。模型仍走 Harness 标准 LLM 服务,因此流式输出、工具调用、reasoning replay、压缩、文件系统控制、权限门禁和审批提示仍由 Harness 负责。ChatGPT 订阅不会因此变成 OpenAI Platform API 凭据。选择符合条件的 GPT Codex 模型后,Composer 还会显示按对话绑定的 Fast Mode 开关和紧凑的周额度指示条。
14
14
 
15
15
  安装是增量的:bundle 不会替换当前主模型或搜索路由;独立搜索、`view_image` 和图片生成也默认关闭,必须显式开启。
16
16
 
@@ -28,7 +28,7 @@ dsh plugin --profile web add dsh-codex-connect@alpha
28
28
 
29
29
  预期结果:包被加入该 profile。这个动作不会更改 profile 的默认模型或全局搜索路由。
30
30
 
31
- 如需精确复现这个版本,使用 `dsh plugin --profile web add dsh-codex-connect@0.1.0-alpha.4.13`。对应 GitHub prerelease 已创建但 npm 不可用时,可使用 `dsh plugin --profile web add 'github:franksong2702/dsh-codex-connect#v0.1.0-alpha.4.13'`。本地 checkout 可安装为 `link:/absolute/path/to/dsh-codex-connect`。
31
+ 如需精确复现这个版本,使用 `dsh plugin --profile web add dsh-codex-connect@0.1.0-alpha.4.15`。对应 GitHub prerelease 已创建但 npm 不可用时,可使用 `dsh plugin --profile web add 'github:franksong2702/dsh-codex-connect#v0.1.0-alpha.4.15'`。本地 checkout 可安装为 `link:/absolute/path/to/dsh-codex-connect`。
32
32
 
33
33
  ### 2. 启动 Harness
34
34
 
@@ -50,7 +50,7 @@ dsh web
50
50
 
51
51
  ### 4. 使用 ChatGPT 登录
52
52
 
53
- 点击 **使用 ChatGPT 登录**,并自行完成浏览器审批。不要把授权 URL、授权码、token 或账户标识复制到 Issue、日志或配置文件中。
53
+ 点击 **使用 ChatGPT 登录**,并自行完成浏览器审批。如果内嵌 WebView 阻止登录窗口,请点击页面显示的 **打开 ChatGPT 登录页面**,在系统浏览器中继续。不要把授权 URL、授权码、token 或账户标识复制到 Issue、日志或配置文件中。
54
54
 
55
55
  预期结果:账户区变为 **已登录**。下图展示的是完成本步骤后的成功状态,不是开始登录前的页面。
56
56
 
@@ -85,6 +85,18 @@ dsh plugin --profile web exec dsh-codex-connect doctor --json
85
85
 
86
86
  预期结果:`status --json` 报告 `signed-in` 并以 `0` 退出,`doctor --json` 只输出一条非敏感 JSON。尚未登录时 `status --json` 会以 `1` 退出;回到第 4 步登录即可,不要把它当作插件故障。
87
87
 
88
+ ### GPT Codex 对话中的 Composer 控件
89
+
90
+ 只有当前对话选择了 `openai-codex` 提供方的 GPT 模型时,Composer 才会显示下面两个小控件。它们都是当前对话级别的控制,不是 profile 全局设置:
91
+
92
+ - **Fast Mode(闪电图标)**:每个对话默认关闭。点击后请求更快的 `1.5 倍` 模式,再点一次恢复标准速度。它只绑定当前对话,不会改变模型选择,也不会影响其他对话。鼠标悬停或键盘聚焦闪电图标,可以看到当前状态和额度消耗提示。
93
+ - **周额度进度条**:位于模型选择器旁边的短横条。剩余额度越低,颜色会从绿色经过黄色/橙色变为红色。鼠标悬停或键盘聚焦时,会显示精确剩余百分比和服务端提供的重置时间。非 GPT 模型或额度暂时不可用时不会显示。
94
+ - 对于精确模型 `gpt-5.3-codex-spark`,Composer 读取 Spark 的每周额度;其他 GPT Codex 模型读取标准 Codex 周额度,两者是分开的额度桶。
95
+
96
+ <p align="center">
97
+ <img src="https://raw.githubusercontent.com/franksong2702/dsh-codex-connect/main/docs/assets/composer-capabilities.jpg" alt="DeepSeek Harness Composer 中按对话绑定的 Fast Mode 闪电控件和周额度进度条" width="820">
98
+ </p>
99
+
88
100
  ## 可选能力(默认关闭)
89
101
 
90
102
  安装后的 bundle 只注册模型提供方,默认不额外启用任何能力:
@@ -103,7 +115,7 @@ dsh plugin --profile web exec dsh-codex-connect doctor --json
103
115
 
104
116
  - `enableSearch: true` 会把 Codex 注册为可选择的搜索提供方,不会把它选为 profile 的全局搜索路由。
105
117
  - `enableImageTool: true` 会为具备视觉能力的模型启用 `view_image`,用于审批后的本地读取和公网图片获取。
106
- - `enableImageGeneration: true` 会启用只接受文字描述的图片生成工具。使用你当前 GPT 订阅计划提供的图片生成能力。生成结果会保存为 DSH 附件,并通过对话中的原生图片画廊展示。
118
+ - `enableImageGeneration: true` 会启用只接受文字描述的图片生成工具。使用你当前 GPT 订阅计划提供的图片生成能力。生成结果会保存为 DSH 附件,并通过 Codex Connect 结果画廊展示。
107
119
 
108
120
  下图是有人显式开启能力之后的配置示例,不是新安装的默认状态。本中文指南使用中文本地化截图;English 版展示同一状态的英文截图。
109
121
 
@@ -124,6 +136,17 @@ dsh plugin --profile web exec dsh-codex-connect doctor --json
124
136
  <img src="https://raw.githubusercontent.com/franksong2702/dsh-codex-connect/main/docs/assets/zh/image-generation.png" alt="Codex Connect 中文 GPT Image 结果卡片,包含图片预览、可复制提示词、下载操作和图片详情" width="780">
125
137
  </p>
126
138
 
139
+ 图片的详细提示词由当前选择的 GPT 模型生成。Codex Connect 不会偷偷添加图片参数:它只校验“提示词”请求,通过 ChatGPT 订阅提供的图片能力发送,并把返回图片保存为 DSH 附件。结果卡片里的提示词可以滚动查看和复制。点击 **再次尝试** 或 **再生成一张** 时,会重新发送这张卡片自己的提示词,不会因为后来出现了新的对话消息而误用最新上下文。点击 **基于此图修改** 时,模型会先询问你想改什么,再基于这张卡片的提示词继续处理。
140
+
141
+ ### 插件配置中的额度说明
142
+
143
+ 登录后,Codex Connect 设置卡片可能显示多个服务端额度窗口。它们是不同的额度桶,不是同一个数字重复显示:
144
+
145
+ - **Codex · 每周额度**:普通 GPT Codex 模型使用的标准 Codex 周额度。
146
+ - **GPT-5.3-Codex-Spark · 5 小时额度** 和 **GPT-5.3-Codex-Spark · 每周额度**:Spark 模型返回的两个独立窗口。
147
+
148
+ 每条进度条都会显示剩余百分比和按本地时区格式化的重置时间。额度窗口、模型资格和重置时间由 OpenAI 返回;数据缺失时界面会显示不可用,不会自行猜测。
149
+
127
150
  ### 单独更改默认模型或全局搜索路由
128
151
 
129
152
  如需把 Codex 模型设为新 agent 的默认模型,需要自行添加或修改独立的 Harness 配置项:
@@ -163,6 +186,7 @@ dsh plugin --profile web exec dsh-codex-connect doctor --json
163
186
 
164
187
  - 卡片显示 **重新登录**,或服务端要求重新认证时,点击该操作并完成同一套安全的浏览器流程。它会保留本插件的能力配置,不会偷偷改动默认模型或全局搜索路由。不要为了刷新会话而运行 `logout`。
165
188
  - `doctor` 只读取进程与文件系统元数据。`doctor --json` 只输出一条可解析的非敏感 JSON,包含 schema version 1、包/版本/Node 信息、认证文件状态与安全 mode、能力、冲突状态和提示;它省略认证文件绝对路径以及 OAuth、账户和过期时间信息。
189
+ - Alpha 4.10 用户若因未知的 `web/openai-codex-search-llm-request` 事件而无法读取搜索历史,可先运行 `dsh-codex-connect migrate-history --json`,停止 DSH 后再以 `migrate-history --apply --confirm-stopped --json` 应用修复。该命令默认只预检,会备份每个被修改的压缩 JSONL 文件,Windows 仅支持预检;详见 [MIGRATION.md](../MIGRATION.md)。
166
190
  - `status --json` 只输出 signed-in 或 signed-out 状态及包元数据。它只为判断登录态读取认证文件,但不会输出认证文件内容或启动 OAuth。
167
191
  - OAuth 单独存储于 `$DSH_HOME/.openai-codex-auth.json`(默认 `~/.dsh`)。`~/.codex/auth.json` 不会被复制或修改。支持的平台上,父目录与文件使用仅所有者可访问权限;写入采用原子替换,刷新写入使用跨进程文件锁。
168
192
  - 默认情况下,OAuth 路由只接受 loopback 浏览器请求。当 DSH 在一台设备运行,而你从可信网络中的另一台设备打开 DSH 时,请在运行 DSH 的设备上显式批准浏览器地址栏中的 origin:
@@ -179,7 +203,7 @@ dsh plugin --profile web exec dsh-codex-connect doctor --json
179
203
 
180
204
  ## 兼容性与安全边界
181
205
 
182
- - 当前唯一已验证的兼容组合是 DSH 插件 API packages `0.1.0-rc.7`、`@earendil-works/pi-ai` `0.82.1` 和 Node.js `^22.19.0 || >=24.0.0`;详见 [compatibility.json](../compatibility.json)。Alpha 4.10 使用 rc.7 的 keyed 插件配置 slotDSH rc.6 用户应继续使用 Alpha 4.9
206
+ - 当前唯一已验证的兼容组合是 DSH 插件 API packages `0.1.1-rc.2`、`@earendil-works/pi-ai` `0.82.1` 和 Node.js `^22.19.0 || >=24.0.0`;详见 [compatibility.json](../compatibility.json)。Alpha 4.15 使用 rc.2 的 keyed 插件配置 slot;旧版 DSH API packages 用户应升级到 rc.2 API packages
183
207
  - 升级时请将 DSH 插件 API packages 与 `@earendil-works/pi-ai` 作为一组升级,再运行 `dsh-codex-connect doctor --json` 和兼容性检查。本契约不对未来版本作判断。
184
208
  - ChatGPT 套餐资格、模型权限、额度和后端行为由 OpenAI 控制,可能变化。
185
209
  - Codex 端点不会强制普通 Responses 的 `max_output_tokens` 字段。Harness 压缩仍可工作,但这个摘要上限不能由服务端在该路由上强制。
package/docs/design.md CHANGED
@@ -6,7 +6,7 @@ The package registers `openai-codex` through Harness's public `LlmRuntime` and `
6
6
 
7
7
  The bundle patch inserts only `llm-openai-codex`. It never writes `agent-default-model` or `web.searchProvider`. `enableSearch` and `enableImageTool` are capability gates defaulting to `false`; the optional service injections are not registered while disabled.
8
8
 
9
- The Host registers `llm-openai-codex` as the plugin-owned settings namespace and declares `OpenAI Codex` in the LLM configurable-provider directory. The browser binds that namespace through Harness's settings-scope transport and renders account, quota, Save/Discard capability controls in the existing Plugin configuration card. Revision-fenced field writes preserve unrelated settings. Committed changes reconcile search and image registrations live; the default-model and global-search namespaces are never written.
9
+ The Host registers `llm-openai-codex` as the plugin-owned capability settings namespace. DSH's `llm-pi-ai` catalog owns the `openai-codex` configurable-provider directory entry, while Codex Connect registers the active adapter without redeclaring that entry. The browser binds the plugin namespace through Harness's settings-scope transport and renders account, quota, Save/Discard capability controls in the existing Plugin configuration card. Revision-fenced field writes preserve unrelated settings. Committed changes reconcile search and image registrations live; the default-model and global-search namespaces are never written.
10
10
 
11
11
  ## OAuth persistence
12
12
 
@@ -26,4 +26,4 @@ Before registration the plugin checks current provider ids. An existing `openai-
26
26
 
27
27
  ## Compatibility boundary
28
28
 
29
- The Alpha pins Harness `0.1.0-rc.7` development dependencies and uses its keyed `settings.plugin.item` contract; supported Node.js is `^22.19.0 || >=24.0.0`. It pins `@earendil-works/pi-ai` `0.82.1`. Backend eligibility, quotas, models, and protocol details remain controlled upstream. Tests use temporary OAuth documents and mocked network responses; CI does not perform real authentication.
29
+ The Alpha pins Harness `0.1.1-rc.2` development dependencies and uses its keyed `settings.plugin.item` contract; supported Node.js is `^22.19.0 || >=24.0.0`. It pins `@earendil-works/pi-ai` `0.82.1`. Backend eligibility, quotas, models, and protocol details remain controlled upstream. Tests use temporary OAuth documents and mocked network responses; CI does not perform real authentication.
package/docs/design.zh.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  bundle patch 只插入 `llm-openai-codex`,不会写入 `agent-default-model` 或 `web.searchProvider`。`enableSearch` 与 `enableImageTool` 默认均为 `false`;关闭时不会注册对应可选服务。
8
8
 
9
- Host 将 `llm-openai-codex` 注册为插件自有 settings namespace,并在 LLM 可配置 provider 目录中声明显示名为 `OpenAI Codex`。浏览器通过 Harness settings-scope transport 绑定该 namespace,把账户、额度以及带保存/放弃的能力配置放在现有“插件配置”卡片中。带 revision 防护的逐字段写入不会覆盖无关设置;提交后会即时协调搜索与图片能力的注册状态,且绝不写入默认模型或全局搜索 namespace。
9
+ Host 将 `llm-openai-codex` 注册为插件自有的能力 settings namespace。DSH `llm-pi-ai` catalog 持有 `openai-codex` 可配置 provider 目录条目,Codex Connect 只注册实际 adapter,不重复声明该条目。浏览器通过 Harness settings-scope transport 绑定插件 namespace,把账户、额度以及带保存/放弃的能力配置放在现有“插件配置”卡片中。带 revision 防护的逐字段写入不会覆盖无关设置;提交后会即时协调搜索与图片能力的注册状态,且绝不写入默认模型或全局搜索 namespace。
10
10
 
11
11
  ## OAuth 持久化
12
12
 
@@ -22,4 +22,4 @@ Host 将 `llm-openai-codex` 注册为插件自有 settings namespace,并在 LL
22
22
 
23
23
  注册前检查现有 provider id;发现 `openai-codex` 已被占用时,给出旧 bundle 或手动 provider 配置的定向迁移提示。boot-free CLI doctor 只报告包/运行时版本、OAuth 路径元数据、能力默认值和安全提示。
24
24
 
25
- Alpha 固定使用 Harness `0.1.0-rc.7` 开发依赖,并采用其 keyed `settings.plugin.item` 契约;Node.js 支持 `^22.19.0 || >=24.0.0`。`@earendil-works/pi-ai` 固定为 `0.82.1`。资格、额度、模型和后端协议仍由上游控制。测试仅使用临时 OAuth 文档和模拟网络响应,CI 不执行真实认证。
25
+ Alpha 固定使用 Harness `0.1.1-rc.2` 开发依赖,并采用其 keyed `settings.plugin.item` 契约;Node.js 支持 `^22.19.0 || >=24.0.0`。`@earendil-works/pi-ai` 固定为 `0.82.1`。资格、额度、模型和后端协议仍由上游控制。测试仅使用临时 OAuth 文档和模拟网络响应,CI 不执行真实认证。
package/lib/bin.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { $ as OpenAICodexTrustedOriginsStore, I as CODEX_CONNECT_VERSION, P as diagnoseOpenAICodex, at as logoutOpenAICodex, et as normalizeTrustedOrigin, it as loginOpenAICodex, ot as openAICodexAuthStatus, ut as openAICodexAuthPath } from "./src-zOltFEBG.js";
2
+ import { L as diagnoseOpenAICodex, c as migrateOpenAICodexSearchHistory, ct as logoutOpenAICodex, lt as openAICodexAuthStatus, nt as OpenAICodexTrustedOriginsStore, pt as openAICodexAuthPath, rt as normalizeTrustedOrigin, st as loginOpenAICodex, z as CODEX_CONNECT_VERSION } from "./src-D5OQGYt6.js";
3
3
  import { fileURLToPath } from "node:url";
4
- import { spawn } from "node:child_process";
5
4
  import { realpathSync } from "node:fs";
5
+ import { spawn } from "node:child_process";
6
6
  import { createInterface } from "node:readline/promises";
7
7
  //#region src/bin.ts
8
8
  /** Standalone credential CLI for the optional OpenAI Codex bundle. */
@@ -65,6 +65,7 @@ async function answerPrompt(prompt, deviceCode, question) {
65
65
  function printHelp() {
66
66
  process.stdout.write([
67
67
  "Usage: dsh-codex-connect <doctor|login|logout|status> [--device-code|--json]",
68
+ " dsh-codex-connect migrate-history [--apply --confirm-stopped] [--root <path>] [--json]",
68
69
  " dsh-codex-connect trust-origin <origin>",
69
70
  " dsh-codex-connect trusted-origins [--json]",
70
71
  " dsh-codex-connect untrust-origin <origin>",
@@ -72,12 +73,13 @@ function printHelp() {
72
73
  " doctor inspect secret-free runtime and OAuth file metadata",
73
74
  " login sign in with a separate ChatGPT OAuth session",
74
75
  " logout remove the dsh credential without changing ~/.codex",
76
+ " migrate-history find or repair Alpha 4.10 private search events (dry-run by default)",
75
77
  " status report non-secret dsh credential state",
76
78
  " trust-origin allow one exact browser origin to reach Web OAuth routes",
77
79
  " trusted-origins list the currently allowed browser origins",
78
80
  " untrust-origin remove one exact browser origin from the allowlist",
79
81
  " --device-code use headless device-code login (login only)",
80
- " --json emit one secret-free JSON document (doctor/status/trusted-origins only)",
82
+ " --json emit one JSON document (doctor/status/trusted-origins/migrate-history)",
81
83
  ""
82
84
  ].join("\n"));
83
85
  }
@@ -118,12 +120,13 @@ async function run(argv) {
118
120
  "doctor",
119
121
  "login",
120
122
  "logout",
123
+ "migrate-history",
121
124
  "status",
122
125
  "trust-origin",
123
126
  "trusted-origins",
124
127
  "untrust-origin"
125
128
  ].includes(rawAction)) {
126
- process.stderr.write(`dsh-codex-connect: expected doctor, login, logout, status, trust-origin, trusted-origins, or untrust-origin; got ${JSON.stringify(rawAction)}\n`);
129
+ process.stderr.write(`dsh-codex-connect: expected doctor, login, logout, migrate-history, status, trust-origin, trusted-origins, or untrust-origin; got ${JSON.stringify(rawAction)}\n`);
127
130
  return 1;
128
131
  }
129
132
  const action = rawAction;
@@ -131,7 +134,25 @@ async function run(argv) {
131
134
  const optionFlags = action === "trust-origin" || action === "untrust-origin" ? flags.slice(1) : flags;
132
135
  const deviceCode = optionFlags.includes("--device-code");
133
136
  const jsonOutput = optionFlags.includes("--json");
134
- if (optionFlags.filter((flag) => flag !== "--device-code" && flag !== "--json").length > 0 || deviceCode && action !== "login" || jsonOutput && (action === "login" || action === "logout" || deviceCode) || (action === "trust-origin" || action === "untrust-origin") && (originArgument === void 0 || optionFlags.length !== 0)) {
137
+ let migrationRoot;
138
+ let migrationApply = false;
139
+ let migrationConfirmStopped = false;
140
+ const unknown = [];
141
+ if (action === "migrate-history") for (let index = 0; index < optionFlags.length; index += 1) {
142
+ const flag = optionFlags[index];
143
+ if (flag === "--apply") {
144
+ if (migrationApply) unknown.push(flag ?? "");
145
+ migrationApply = true;
146
+ } else if (flag === "--confirm-stopped") {
147
+ if (migrationConfirmStopped) unknown.push(flag ?? "");
148
+ migrationConfirmStopped = true;
149
+ } else if (flag === "--json") {} else if (flag === "--root" && migrationRoot === void 0 && optionFlags[index + 1] !== void 0 && !optionFlags[index + 1]?.startsWith("--")) {
150
+ migrationRoot = optionFlags[index + 1];
151
+ index += 1;
152
+ } else unknown.push(flag ?? "");
153
+ }
154
+ else unknown.push(...optionFlags.filter((flag) => flag !== "--device-code" && flag !== "--json"));
155
+ if (unknown.length > 0 || deviceCode && action !== "login" || jsonOutput && (action === "login" || action === "logout" || deviceCode) || action === "migrate-history" && (migrationConfirmStopped && !migrationApply || migrationApply && !migrationConfirmStopped) || (action === "trust-origin" || action === "untrust-origin") && (originArgument === void 0 || optionFlags.length !== 0)) {
135
156
  process.stderr.write(`dsh-codex-connect: invalid options for ${action}: ${flags.join(" ")}\n`);
136
157
  return 1;
137
158
  }
@@ -154,6 +175,23 @@ async function run(argv) {
154
175
  ].join("\n"));
155
176
  return doctorExitCode(report);
156
177
  }
178
+ case "migrate-history": {
179
+ const result = await migrateOpenAICodexSearchHistory({
180
+ apply: migrationApply,
181
+ ...migrationConfirmStopped ? { confirmStopped: true } : {},
182
+ ...migrationRoot === void 0 ? {} : { root: migrationRoot }
183
+ });
184
+ if (jsonOutput) printJson({
185
+ schemaVersion: JSON_SCHEMA_VERSION,
186
+ ...result
187
+ });
188
+ else {
189
+ const verb = result.mode === "apply" ? "Repaired" : "Found";
190
+ process.stdout.write(`${verb} ${result.changedEvents} legacy Codex search event(s) in ${result.changedFiles} session file(s) under ${result.root}.\n`);
191
+ if (result.mode === "dry-run" && result.changedEvents > 0) process.stdout.write("Stop DSH, then run again with --apply --confirm-stopped to create backups and repair these histories.\n");
192
+ }
193
+ return 0;
194
+ }
157
195
  case "status": {
158
196
  const status = await openAICodexAuthStatus();
159
197
  if (jsonOutput) {