@shuind/dsh-codex-connect 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/INSTALL.md +349 -0
  2. package/LICENSE +202 -0
  3. package/MIGRATION.md +101 -0
  4. package/NOTICE +26 -0
  5. package/README.md +71 -2
  6. package/VERSIONING.md +69 -0
  7. package/cordis.patch.yml +9 -0
  8. package/docs/README.zh.md +3 -0
  9. package/docs/assets/composer-capabilities.jpg +0 -0
  10. package/docs/assets/en/hero.jpg +0 -0
  11. package/docs/assets/en/image-generation.png +0 -0
  12. package/docs/assets/en/model-selector.jpg +0 -0
  13. package/docs/assets/en/oauth-status.jpg +0 -0
  14. package/docs/assets/en/plugin-configuration.jpg +0 -0
  15. package/docs/assets/en/plugin-entry.jpg +0 -0
  16. package/docs/assets/hero.jpg +0 -0
  17. package/docs/assets/model-selector.jpg +0 -0
  18. package/docs/assets/oauth-status.jpg +0 -0
  19. package/docs/assets/plugin-configuration.jpg +0 -0
  20. package/docs/assets/zh/hero.jpg +0 -0
  21. package/docs/assets/zh/image-generation.png +0 -0
  22. package/docs/assets/zh/model-selector.jpg +0 -0
  23. package/docs/assets/zh/oauth-status.jpg +0 -0
  24. package/docs/assets/zh/plugin-configuration.jpg +0 -0
  25. package/docs/assets/zh/plugin-entry.jpg +0 -0
  26. package/docs/design.md +61 -0
  27. package/docs/design.zh.md +39 -0
  28. package/docs/licenses/pi-ai-oauth.txt +21 -0
  29. package/docs/licenses/standalone-cli.txt +115 -0
  30. package/docs/preflight-activity.md +42 -0
  31. package/docs/preflight-activity.zh.md +42 -0
  32. package/docs/quota-tool.md +46 -0
  33. package/docs/reference.md +240 -0
  34. package/docs/reference.zh.md +240 -0
  35. package/docs/skills/codex-quota-awareness/SKILL.md +12 -0
  36. package/lib/bin.js +2442 -0
  37. package/lib/client.js +6804 -0
  38. package/lib/index.d.ts +631 -0
  39. package/lib/index.js +7091 -0
  40. package/lib/models-Brnw-PH4.js +1763 -0
  41. package/lib/openai-codex-responses-DfZMR6a9.js +3452 -0
  42. package/package.json +234 -4
package/MIGRATION.md ADDED
@@ -0,0 +1,101 @@
1
+ # Migrating from `dsh-codex`
2
+
3
+ ## Alpha 12: Reserve retirement and alpha.3 recovery
4
+
5
+ Alpha 12 is published on the existing alpha channel. Its [bilingual release notes](docs/release-notes/0.2.0-alpha.12.md) describe the migration and verification limits. Legacy `enableReserveFallback` settings become inert on every Host. A saved `gpt-reserve` selection returns `MODEL_RETIRED` before account access or network activity: explicitly select an ordinary model, or preserve the old conversation and start another if the Host cannot replace its selection. No replacement model/account is guessed; old return files, sessions and OAuth credentials are not read for migration or deleted. Shared ordinary quota/account safety remains.
6
+
7
+ Only on exact DSH `0.2.2-alpha.3`, old Task state is recovery-only: authenticated inspection, Stop/manual takeover and existing strictly checked safe-disable/archive exits. Automatic routing/resume/delegation recovery are refused, including stale/direct callers. Ownership, counters, receipts, ledger fencing, cancellation and truthful child cleanup remain required. The previous fourteen supported Hosts retain their behavior, and public Task activation remains closed everywhere. No daily Host upgrade or reauthorization is part of this migration.
8
+
9
+ Alpha 12 已发布到原有 alpha 渠道。[双语发行说明](docs/release-notes/0.2.0-alpha.12.md#中文)列出迁移和验证边界。所有 Host 上旧 `enableReserveFallback` 配置不再生效;遗留 `gpt-reserve` 在读取账户或联网前返回 `MODEL_RETIRED`,需要明确选择普通模型,无法修改旧选择时保留会话另开一个。不猜测替代模型或账户,不因迁移读取或删除旧 return 文件、会话或 OAuth 凭据。仅在精确的 DSH `0.2.2-alpha.3` 上,旧 Task 保留经过身份校验的查看、停止/转手动和原有严格的安全退出,拒绝自动路由、续跑及委派恢复;计数、回执、ledger fencing、取消和真实清理义务不变。原十四个 Host 行为保留,所有版本公共激活入口仍关闭。本迁移不包含升级日常 Host 或重新授权。
10
+
11
+ ## DSH support window
12
+
13
+ New source builds declare sixteen exact DSH releases starting at `0.2.1-alpha.1`, plus the existing current-minor admission range. The Alpha 16 candidate adds `0.2.2-rc.4` and `0.2.2-rc.5` with Cordis `^4.1.0` compatibility. DSH `0.1.7-rc.1`, `0.1.7-rc.2`, `0.2.0-rc.1`, and `0.2.0-rc.2` are retired for new builds. The [published Alpha 15 package](INSTALL.md#020-alpha15-verified-publication) still supports all four. Pin `dsh-codex-connect@0.2.0-alpha.15` when keeping one of those hosts.
14
+
15
+ To move to a retained pairing, finish active tasks or use authenticated Stop or manual takeover on the original host. Wait for cleanup before changing the host. Keep the profile configuration, OAuth store, session files, and Task ledger intact. With explicit approval to upgrade the host, install exact DSH `0.2.2-rc.1` and the published `dsh-codex-connect@0.2.0-alpha.15` in the selected profile, then follow the [configuration and doctor checks](INSTALL.md). Cross-host recovery of active Task state remains unverified.
16
+
17
+ 新源码构建保留从 `0.2.1-alpha.1` 开始的 14 个已验证 DSH 精确版本,以及已有的当前次版本准入范围。新构建退役 DSH `0.1.7-rc.1`、`0.1.7-rc.2`、`0.2.0-rc.1` 和 `0.2.0-rc.2`。仍需使用这些宿主时,固定安装已发布的 `dsh-codex-connect@0.2.0-alpha.15`。
18
+
19
+ 迁移前在原宿主完成活动任务,或经身份校验停止任务、转为手动并等待清理完成。保留 profile 配置、OAuth 存储、会话文件和 Task ledger。经用户批准升级宿主后,在指定 profile 配对使用 DSH `0.2.2-rc.1` 与已发布的 `dsh-codex-connect@0.2.0-alpha.15`,按[安装手册](INSTALL.md)检查配置与 doctor。活动 Task 的跨宿主恢复仍未验证。
20
+
21
+ ## Alpha 4.43 candidate: upgrade the Harness together
22
+
23
+ This candidate targets DeepSeek Harness `0.1.7-rc.1` only. Upgrade the Harness
24
+ and its profile runtime first, then install the matching Codex Connect release;
25
+ this candidate is not compatible with the previously declared `0.1.2-rc.1` or
26
+ `0.1.5` hosts. Keep the existing `llm-openai-codex` row and OAuth store. The DSH
27
+ settings lifecycle, message-source types, and native-compaction integration have
28
+ changed, but the migration does not require signing in again or editing
29
+ credentials. This candidate is not published; do not use a public install
30
+ command until its exact package/host pair is verified and released.
31
+ DSH `0.1.7-rc.1` also changes the Session log format. Migration of an active
32
+ task from the previously supported Harness versions to this target has not
33
+ passed acceptance; do not treat same-host task recovery below as proof of a
34
+ cross-Harness upgrade. Finish or safely stop active delegated tasks before
35
+ changing the Harness until that migration is verified.
36
+
37
+ ## Next release candidate: public task orchestration paused
38
+
39
+ Task-level automatic model selection and read-only delegation are being withheld
40
+ until maintainer acceptance. This change does not retroactively disable npm 4.41
41
+ or already-running installations. It takes effect only after the new package is
42
+ published, installed, and loaded.
43
+
44
+ A new ordinary conversation has no collaboration activation options. Cached
45
+ clients cannot start, resume, upgrade or authorize delegation through the closed
46
+ server route. On a supported same-version host, existing tasks keep authenticated
47
+ readback, Stop and manual takeover;
48
+ grants, original history and spent request counts are not deleted or reset.
49
+ Manual model selection (including GPT-6/Astra), accounts, existing optional tools
50
+ and native compaction settings are unchanged. Internal orchestration source and
51
+ tests remain, but there is no public setting or environment-variable escape hatch.
52
+ Reopening requires a separately reviewed source change and new build after
53
+ acceptance; per-task user authorization will still be required.
54
+
55
+ Before downgrading an existing delegated task, use the authenticated safety exits
56
+ and let the runtime verify cleanup and delivery. Do not delete the task ledger or
57
+ edit its counters to force recovery. Cross-device/new-cookie task ownership limits
58
+ remain unchanged.
59
+
60
+
61
+ `dsh-codex-connect` uses the same provider id (`openai-codex`), OAuth filename (`.openai-codex-auth.json`), Cordis row id (`llm-openai-codex`), and browser auth routes for compatibility. The packages cannot be active together because Harness forbids duplicate provider adapters.
62
+
63
+ 1. Record the effective default model, search route, and `llm-openai-codex` config without reading any OAuth file.
64
+ 2. Remove `dsh-codex` from the selected profile and add `dsh-codex-connect`.
65
+ 3. Keep exactly one `llm-openai-codex` row loading `dsh-codex-connect`.
66
+ 4. Decide explicitly whether to set `enableSearch` and `enableImageTool`; both default to `false` after migration.
67
+ 5. Preserve the prior `agent-default-model` and `web.searchProvider` only when the user wants those routes to remain selected.
68
+ 6. Run `--dump-config`, then `dsh-codex-connect doctor`. Do not run OAuth again when `status` already reports signed in.
69
+
70
+ 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.
71
+
72
+ ## Astra reasoning selections
73
+
74
+ The plugin's Astra fallback definition offers `low`, `medium`, `high`, `xhigh`, and `max`. An omitted `reasoningEffort` preserves the provider default; it does not select Low or disable reasoning. The native dependency definition still takes precedence when present.
75
+
76
+ Before using Astra with a saved `minimal` or `off` selection, update the selected conversation and, if applicable, the default model setting:
77
+
78
+ | Saved value | Selection preserving its effective request behavior |
79
+ | --- | --- |
80
+ | `minimal` | Select `Low` (`reasoningEffort: low`); both send `low`. |
81
+ | `off` | Select `Default` (provider default), omitting `reasoningEffort`; both omit wire `reasoning`. This never guaranteed disabled reasoning. |
82
+
83
+ Other valid explicit efforts remain unchanged. A saved `minimal`, `off`, or unsupported `none` request is rejected with `UNSUPPORTED_REASONING_EFFORT` before authentication or model traffic; the plugin does not silently change it. `none` has no supported prior behavior to preserve: choose a valid effort or `Default` explicitly. The plugin does not rewrite settings or historical Session events. Use the conversation model selector for an existing Session; changing only the default model does not replace that Session's explicit selection. OAuth credentials do not need migration.
84
+
85
+ ## Repairing search history written by Alpha 4.10
86
+
87
+ 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.
88
+
89
+ Upgrade Codex Connect, then inspect the default `$DSH_HOME/sessions` root without changing it:
90
+
91
+ ```sh
92
+ dsh plugin --profile web exec dsh-codex-connect migrate-history --json
93
+ ```
94
+
95
+ 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`:
96
+
97
+ ```sh
98
+ dsh plugin --profile web exec dsh-codex-connect migrate-history --apply --confirm-stopped --json
99
+ ```
100
+
101
+ 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/NOTICE ADDED
@@ -0,0 +1,26 @@
1
+ dsh-codex-connect
2
+ Copyright 2026 Frank Song
3
+
4
+ This product includes software derived from Yan-Zero/dsh-codex:
5
+ https://github.com/Yan-Zero/dsh-codex
6
+ Copyright 2026 Yan-Zero
7
+
8
+ Modifications and additional work for Codex Connect are Copyright 2026
9
+ Frank Song. They include a distinct package identity, opt-in routing and
10
+ capabilities, secret-free diagnostics, provider-conflict guidance, migration
11
+ documentation, security hardening, live plugin configuration, and Alpha
12
+ release validation.
13
+
14
+ The upstream material and the Codex Connect modifications are distributed
15
+ under the Apache License, Version 2.0 included in LICENSE.
16
+
17
+ This product also includes OAuth login and refresh code from earendil-works/pi
18
+ (@earendil-works/pi-ai 0.84.4), under the MIT license reproduced in
19
+ docs/licenses/pi-ai-oauth.txt. JWT payload decoding, callback connection cleanup
20
+ and structured refresh rejection handling are modified.
21
+
22
+ The standalone CLI bundles selected code from host and provider dependencies so
23
+ it can run from an isolated DSH plugin-exec process without copying host peers.
24
+ The bundled third-party package attributions and license texts are in
25
+ docs/licenses/standalone-cli.txt. Runtime plugin imports continue to use the
26
+ host's packages rather than these standalone CLI copies.
package/README.md CHANGED
@@ -1,3 +1,72 @@
1
- # Temporary Holding Version
1
+ # @shuind/dsh-codex-connect
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ 给 DeepSeek Harness(DSH)用的 ChatGPT OAuth / Codex 模型提供方插件:免 API Key 使用 ChatGPT 订阅接入 `openai-codex` 模型,支持多账号切换(含多个 Team 账号)、实时配额查看、会话速度切换,以及按需开启的联网搜索、GPT Image 2.6 生图/改图与 Codex 原生上下文压缩。
4
+
5
+ 本仓库是 `dsh-codex-connect` 的精简重构分支,独立于上游,与 [@shuind/dsh-codex-harness](https://github.com/shuind/dsh-codex-harness) 一起维护。移除了独立代理与已废弃实验模块,重构了设置页,并按 `shared / platform / features / client` 分层维护。
6
+
7
+ > **互斥说明**:本包与原版 `dsh-codex-connect` 注册同一个 `openai-codex` 模型提供方(`id: llm-openai-codex`),**不能同时安装**。
8
+
9
+ 当前版本 `0.2.0` 适配 **DeepSeek Harness `0.2.2-rc.1`–`0.2.2-rc.5`**(`engines.dsh: >=0.2.2-rc.1 <=0.2.2-rc.5`,已在 `0.2.2-rc.5` 上完整验证)。
10
+
11
+ ## 安装
12
+
13
+ ### 从插件市场 / npm 安装
14
+
15
+ 在 DSH 的 **插件 → 添加插件** 中输入 `@shuind/dsh-codex-connect`(或在插件市场直接安装),安装后按提示重启 DSH 即可。
16
+
17
+ 也可以在 Web profile 下通过 CLI 安装:
18
+
19
+ ```sh
20
+ dsh plugin --profile web add @shuind/dsh-codex-connect
21
+ ```
22
+
23
+ > **从原版 `dsh-codex-connect` 迁移**:若此前安装过无 scope 的 `dsh-codex-connect` 并保存过设置,卸载时 DSH 不会自动清理 profile 的 `cordis.patch.yml`。换装本包后如出现「此 dsh profile 无法使用插件设置」,请打开对应 profile 的 `cordis.patch.yml`,将 `id: llm-openai-codex` 下的 `name: dsh-codex-connect` 改为 `name: "@shuind/dsh-codex-connect"`(或删除该旧条目)后重启 DSH。
24
+
25
+ ### 授权登录
26
+
27
+ 1. 打开 **设置 → 模型 → Openai-Codex → 授权**(或 **设置 → 插件 → Codex Connect**),在浏览器中完成 ChatGPT 登录。
28
+ 2. 远程浏览器无法直连 `localhost` 回调端口时,可展开页面中的回调 URL 表单粘贴完整跳转地址完成授权;也可以在主机终端运行 `dsh-codex-connect login`。
29
+ 3. OAuth 凭据独立保存在 `$DSH_HOME/.openai-codex-auth.json`,不会读写 `~/.codex/auth.json`;安装插件不会改动原有默认模型或搜索路由。
30
+
31
+ ## 界面预览
32
+
33
+ | 模型列表 | 功能设置 |
34
+ | --- | --- |
35
+ | ![模型列表](assets/screenshot-models.png) | ![功能设置](assets/screenshot-settings.png) |
36
+
37
+ ## 功能概览
38
+
39
+ - **多账号与实时配额**:
40
+ - 支持保存最多 16 个 ChatGPT 账号并手动切换当前账号;账号变更只作用于后续新请求,不影响进行中的回合。
41
+ - 在设置页与输入框右侧实时展示 `5h` / `7d` 额度窗口及重置时间。
42
+ - **模型列表与本地上下文预算**:
43
+ - 内置最新 Codex 模型目录(含 `gpt-6.2-astra`、`gpt-6.2-sol`、`gpt-6.1-sol` 等),按能力由强到弱排列,分为「已启用 / 未启用」两组,可随时控制模型选择器可见性。
44
+ - 支持按单个模型调整客户端上下文预算(隐藏模型仍保留其配置)。
45
+ - **会话速度切换(Standard / Fast)**:
46
+ - 输入框右侧可直接切换当前 Codex 对话的速度档位。
47
+ - **按需开启的可选能力(默认全部关闭)**:
48
+ - **Codex 联网搜索(`enableSearch`)**:开启后临时接管当前配置的全局联网搜索,其他模型也可直接调用;停用后自动恢复原路由。内置可折叠的 BrowseComp / FACTS Search V2 准确率参考与一键选用。
49
+ - **GPT Image 图片生成与编辑(`enableImageGeneration`)**:注册生图与修图工具,任何支持工具调用的模型(包括 DeepSeek)都可直接调用,无需切换聊天模型;支持 `GPT-Image-2.6 Flare`(默认,快速)与 `GPT-Image-2.6 Sunburst`(精细),并保留自定义模型名入口。
50
+ - **Codex 原生上下文压缩(`enableNativeCompaction`)**:使用 OpenAI 服务端原生压缩替代默认文本摘要(仅对 Codex 订阅会话生效,失败自动回退)。装有 `dsh-codex-harness` 时随其「运行偏好 → 优先使用远程压缩」自动同步,无需单独管理。
51
+ - **静默更新提醒与 CLI 工具**:
52
+ - 优先查询 npm(`@shuind/dsh-codex-connect`),查不到时回退 GitHub Releases;同时校验目标版本 `engines.dsh` 是否适配当前 DSH,不适配时明确提示且同一版本仅提醒一次。
53
+ - 提供独立 CLI:`dsh-codex-connect <doctor|login|logout|status|trust-origin|trusted-origins|untrust-origin>`。
54
+
55
+ ## 与 dsh-codex-harness 配合
56
+
57
+ 本插件保持独立插件形态,与 [@shuind/dsh-codex-harness](https://github.com/shuind/dsh-codex-harness) 一起维护并直接联动:
58
+
59
+ - `dsh-codex-harness` 会自动识别 `openai-codex` 提供方,将模型目录、逐模型上下文上限、`Fast` 档位、联网搜索和原生压缩交由本插件处理。
60
+ - 在 `dsh-codex-harness` 的「运行偏好 → 优先使用远程压缩」中切换开关时,会自动同步更新本插件的原生压缩设置;手动压缩支持 `/compact remote` 与 `/compact local`。
61
+ - 输入框右下角的上下文容量按钮与 `dsh-codex-connect` 的逐模型预算设置直接联动。
62
+
63
+ ## 更多说明
64
+
65
+ - 安装、升级与离线部署:[INSTALL.md](INSTALL.md)
66
+ - 配置项、远程授权与故障排查:[docs/reference.zh.md](docs/reference.zh.md) / [docs/reference.md](docs/reference.md)
67
+ - 架构与边界设计:[docs/design.zh.md](docs/design.zh.md) / [docs/design.md](docs/design.md)
68
+ - 版本兼容与迁移:[MIGRATION.md](MIGRATION.md) · [VERSIONING.md](VERSIONING.md)
69
+
70
+ ## License
71
+
72
+ Apache-2.0。保留上游原作者版权声明,详见 [LICENSE](LICENSE) 与 [NOTICE](NOTICE)。
package/VERSIONING.md ADDED
@@ -0,0 +1,69 @@
1
+ # Versioning policy
2
+
3
+ English | [中文](docs/VERSIONING.zh.md)
4
+
5
+ Codex Connect versions identify plugin releases independently of DeepSeek Harness. Show the plugin version and its verified DSH pairing together; do not infer one from the other.
6
+
7
+ ## Release identity and phase
8
+
9
+ The current release series starts at `0.2.0-alpha.1` and continues as `0.2.0-alpha.N`. This maintainer-approved numbering cleanup replaces the longer `0.1.0-alpha.4.x` sequence for new releases. It simplifies the independent plugin version; it does not narrow DSH compatibility, require a host upgrade, or promote the plugin to Beta or stable. Published versions and tags keep their original names and contents. A DSH update does not reset the plugin counter.
10
+
11
+ The publishing workflow accepts `MAJOR.MINOR.PATCH-alpha.NUMBER[.NUMBER…]`, with nonnegative integer components and no leading zeroes. Build metadata is not a release counter: SemVer ignores `+build.n` when comparing versions, and the pinned npm publishing implementation removes it. Use a distinct, higher-precedence version for every new package. Never overwrite a published package or move its release tag to different content.
12
+
13
+ The plugin's public behavior includes configuration, tools, commands, and stored data. In the `0.y.z` development period, incompatible changes require explicit release notes and migration guidance; intentionally starting a new incompatible release line increments the plugin minor version. Routine iterations within the current Alpha line increment its prerelease counter. Copying a host's version is not a substitute for deciding the plugin's change scope.
14
+
15
+ Alpha, Beta, RC, and a non-prerelease version describe the plugin's readiness, not DSH's. Phase promotion is a separate maintainer decision backed by recorded verification, including real-account and upgrade acceptance where relevant. A stable DSH release does not make the plugin stable. The current workflow remains Alpha-only; Beta, RC, and stable publishing need a separately reviewed workflow/channel change.
16
+
17
+ ## Compatibility evidence
18
+
19
+ | Information | Maintained in | Meaning |
20
+ |---|---|---|
21
+ | Plugin build version | `package.json.version` | Identity embedded in the build and CLI |
22
+ | Host dependency requirements | `compatibility.json` and dependency declarations | Intended supported runtime constraints, checked for consistency |
23
+ | Verified exact combinations | `verified-compatibility.json` | Evidence from checks of each explicit DSH/plugin pair |
24
+ | User-visible changes | GitHub Release notes and `update-highlights.json` | What changed between plugin releases |
25
+
26
+ Keep the compatibility catalog's `schemaVersion: 1`, `checkedAt`, `latestDshVersion`, and `pluginVersions[].{version,verifiedDshVersions}` fields at the existing URL. Preserve historical entries. An unlisted pair is unverified, not necessarily incompatible. Neither a target dependency nor a green test on a different pairing proves compatibility.
27
+
28
+ Record a new exact pair only after verification. A candidate's verification record does not prove npm publication. Before recommending it publicly, confirm both that the version exists on npm with its matching release tag and that the pair is recorded. The offline lint check verifies the recorded pair and bilingual agreement; it does not contact npm or certify publication.
29
+
30
+ Do not replace V1 in place with a version-keyed object or infer a range from a single successful version. Any future incompatible format needs a versioned endpoint and continued output for installed V1 clients.
31
+
32
+ ## Channels and recommendations
33
+
34
+ - `alpha` is the moving channel written by the current release workflow.
35
+ - `latest` follows the newest published plugin release, by SemVer precedence, verified against the exact DSH version currently resolved by npm `latest`. That plugin release may be an Alpha or a stable version; the channel does not change its readiness designation. Promotion is a separate, explicitly authorized maintainer action. Publishing an Alpha does not authorize or perform it.
36
+ - Exact installation commands identify a plugin release; dist-tags do not guarantee compatibility.
37
+ - Keep the public README recommendation on a confirmed published pair while preparing a newer candidate. The recommendation may therefore differ from `package.json.version`.
38
+
39
+ This rule supersedes the former stable-only restriction after the first stable release, as decided in [#445](https://github.com/franksong2702/dsh-codex-connect/issues/445#issuecomment-6935776620). It changes channel policy, not the current npm tag, supported hosts or release workflow. If DSH `latest` advances without a verified published pairing, leave the plugin tag unchanged and report the default-install gap; do not infer compatibility or promote an unverified candidate. Existing users on other DSH versions still need a verified exact pairing. Follow [the promotion procedure](RELEASING.md#promoting-latest-short-lived-interactive-authentication) for fresh registry checks, isolated installation, authorization, readback and rollback.
40
+
41
+ The project newest version and the newest verified plugin for a user's existing DSH are different questions. More precise host-specific recommendations and generated installation sections are follow-up work; this policy does not claim the current update UI computes that choice from every historical record.
42
+
43
+ ## Update highlights
44
+
45
+ Keep V1 highlight entries in increasing SemVer order, with unique versions and known capability kinds. Preserve the existing history. New documentation-only or maintenance releases may be omitted; existing empty `highlights` arrays remain valid. Release notes still describe fixes. Do not invent capabilities or require a contiguous counter sequence just to validate the catalog.
46
+
47
+ ## Numbering migration to 0.2.0 Alpha
48
+
49
+ `0.2.0-alpha.1` sorts above every `0.1.0-alpha.4.x` release, including the last published `0.1.0-alpha.4.54`. Do not reset to `0.1.0-alpha.1`: it sorts below the historical series. The unshipped `0.1.0-alpha.4.55` candidate is replaced by this version and is not a published release.
50
+
51
+ The existing update checker compares both `alpha` and `latest` using SemVer, so it recognizes the new Alpha even while `latest` stays at `0.1.0-alpha.4.50`. It reports an update without installing it or upgrading DSH. Users can install the exact plugin version into their existing profile. Compatibility and highlight history keep their V1 formats; the four declared DSH targets remain `0.1.7-rc.1`, `0.1.7-rc.2`, `0.2.0-rc.1`, and `0.2.0-rc.2`. Exact verification still precedes a new catalog entry.
52
+
53
+ Publication uses the existing Alpha-only workflow, protected environment, `v0.2.0-alpha.1` tag, GitHub prerelease, and npm `alpha` channel. It does not promote `latest`. Any later phase change still requires separate review of the gates and publication/readback path. Keep host upgrades, schema changes, and numbering migration separately reviewable.
54
+
55
+ ## Release checks
56
+
57
+ Follow [RELEASING.md](RELEASING.md) for the complete procedure. Run the frozen install and existing checks separately:
58
+
59
+ ```sh
60
+ pnpm install --frozen-lockfile
61
+ pnpm run check
62
+ pnpm run test:browser
63
+ pnpm run check:dsh-matrix
64
+ npm pack --dry-run
65
+ ```
66
+
67
+ `check` does not include the browser suite or isolated DSH installation. Regenerate the lockfile only when dependency changes require it; do not refresh the dependency tree for a documentation or localization release. Automated checks do not replace real OAuth acceptance. Merge, publish, and `latest` promotion remain distinct operations.
68
+
69
+ Normative references: [SemVer 2.0.0](https://semver.org/spec/v2.0.0.html) and the pinned [npm 11.6.4 publishing implementation](https://github.com/npm/cli/blob/v11.6.4/workspaces/libnpmpublish/lib/publish.js).
@@ -0,0 +1,9 @@
1
+ # Install the provider without changing the profile's current default model or
2
+ # web-search route. Optional capabilities require explicit profile config.
3
+ - insert:
4
+ - id: llm-openai-codex
5
+ name: "@shuind/dsh-codex-connect"
6
+ config:
7
+ enableSearch: false
8
+ enableNativeCompaction: false
9
+ enableImageGeneration: false
@@ -0,0 +1,3 @@
1
+ # @shuind/dsh-codex-connect
2
+
3
+ 中文文档已默认放在 [README.md](../README.md)。
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/docs/design.md ADDED
@@ -0,0 +1,61 @@
1
+ # Codex Connect: Alpha design
2
+
3
+ ## Ownership and composition
4
+
5
+ The package registers `openai-codex` through Harness's public `LlmRuntime` and `PiAiAdapter` surfaces. The main model path is not a one-shot subagent: it remains the normal Harness agent loop, preserving native tool approvals, permission policy, streaming, attachment resolution, reasoning replay, session persistence, compaction, and recovery.
6
+
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
+
9
+ The startup-only `enableQuotaTool` gate also defaults to `false`. When explicitly enabled, `codex_connect_quota` uses the Host tool runtime and the existing `OpenAICodexQuotaState`; it has no separate transport, account selector, refresh bypass or budget controller. The projection includes only common Codex window numbers and freshness, without upstream names/ids, balances or routing authority. Successful snapshots now retain their local fetch time across cache hits. See [quota observation](quota-tool.md).
10
+
11
+ 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. Default-model settings are never written.
12
+
13
+ Fast Mode remains per-session process-local state. Separate default-off profile settings seed newly started top-level and subagent sessions through `agent/created`; resume, setting edits, and repeated startup notifications do not change an existing session's Composer choice. The adapter adds `service_tier: 'priority'` only on Codex requests for an enabled session.
14
+
15
+ ## Saved Task recovery
16
+
17
+ The plugin handles saved v1 and v2 Task state for verified Hosts. Authenticated owners can read grants, use Stop or manual takeover, disable delegation, and archive a v2 Task after its child cleanup and delivery are verified. Legacy files retain their existing format. Recovery fences stale process state and preserves request counters and saved receipts. Start, resume, upgrade, and delegation enablement are rejected, including when a stale client supplies a matching receipt.
18
+
19
+ Ordinary requests pass through with the Host's route. A related saved task requires verified ownership. Missing state recorded by a session marker, ambiguous ownership, or unresolved child cleanup can block dispatch. A manual takeover preserves the existing portable-history projection for the next ordinary Codex request.
20
+
21
+ The product and synthetic host checks use saved-state recovery. The Task model-selection tool, delegation tools, child launcher, provider request scopes, and live evidence capture have been removed. Historical Phase 1 and Phase 2 behavior is recorded in [the Phase 1 contract](experiments/adaptive-task-phase1.md) and [the Phase 2 design](experiments/adaptive-task-phase2-design.md).
22
+
23
+ ## OAuth persistence
24
+
25
+ The plugin uses `$DSH_HOME/.openai-codex-auth.json`, separate from Codex CLI/Desktop state. Format version 2 stores at most 16 OAuth accounts and names exactly one active account. Existing version-1 documents remain readable and migrate on the first credential mutation; that migration first creates the owner-only `.openai-codex-auth.json.v1-backup` rollback copy. A pre-existing rollback copy must be owner-only and match the current version-1 document or migration stops before replacing the main document. Removing any account or signing out deletes the rollback copy so removed credentials do not persist there. Documents are limited to 512 KiB. POSIX reads reject group/world-accessible files, non-regular files are rejected, writes are atomic, and mutations use the Harness cross-process file lock. Callers receive cloned credentials.
26
+
27
+ Browser account routes expose deterministic plugin-derived keys, local display labels, masked email addresses when present in the OAuth token, and active state. They never expose the provider's account id or token fields. Activation and deletion are serialized with browser OAuth. Each model request captures its current account before auth resolution; a refresh updates only that captured account without changing the current selection. After OAuth resolution, quota, image-generation, and Auto-review requests resolve the account id stored with that exact access token, so a concurrent account switch cannot combine credentials from different accounts. Deleting the active account while another remains requires the caller to name the replacement; provider-global logout deletes every account. Browser-origin trust is a separate `$DSH_HOME/.openai-codex-trusted-origins.json` sidecar with `version: 1`, `mode: "allowlist"`, and exact normalized HTTP(S) origins; it never contains OAuth material and is changed only by the standalone CLI.
28
+
29
+ The settings routes and CLI reuse the existing OAuth path and route names for migration compatibility. Only an explicit login operation emits an authorization URL or code. Browser requests are accepted by default only from loopback; a remote request must use an exact effective HTTP(S) origin in the current sidecar, must not carry cross-site Fetch Metadata, and must match any supplied Origin exactly. The sidecar is re-read for every request, and unknown fields or modes fail closed. A login challenge accepts only credential-free HTTPS URLs and fails closed after 30 seconds or when the provider finishes without a URL; logout and disposal cancel pending waiters. Status responses are redacted. Doctor uses `lstat` metadata and never opens the document.
30
+
31
+ Browser account and update requests have a 45-second deadline covering response headers and JSON bodies. A timed-out account mutation is not retried automatically: while the account view is observed, the browser reads server state again because the mutation may already have committed. Failed state reads retry after five seconds, including when no account is stored. Plugin disposal aborts browser waits without logging out the server account.
32
+
33
+ ## Backend request governance
34
+
35
+ The composition root supplies the Task recovery guards for adapter streaming and auxiliary requests. Ordinary requests use the existing backend governor and provider retry policy. Recovery preserves the counters stored by earlier releases and does not create Task dispatch scopes.
36
+
37
+ Authenticated runtime traffic to `https://chatgpt.com/backend-api/` passes through one plugin-owned request governor before network dispatch. The governor fail-closes on any other origin/path, composes caller and route deadlines, keeps the existing Codex-only proxy scope alive for the complete logical direct request or provider stream, assigns a fresh `x-client-request-id` to every HTTP attempt, and bounds one plugin instance to eight concurrent backend requests. Concurrency is counted per HTTP attempt, not during authentication; even parallel fetches within one logical operation share that limit. Requests queued behind that limit remain cancellable and within route deadlines. Cancelling unread/paused bodies, response-hook failures and scope disposal releases resources; scope disposal runs before other plugin teardown waits. URL/header inputs are snapshotted before queue waits and authenticated requests never automatically follow redirects. HTTP `429` or `503` responses with a valid `Retry-After` create a lane-local cooldown that is rechecked on admission, never occupies a network slot while waiting, and honors longer service delays using timer slices of at most 15 minutes; the governor does not invent an account-block verdict or replay a failed model turn. Route-specific protocol retries remain with their existing owners, such as pi-ai model retry semantics and native-compaction's bounded retry loop.
38
+
39
+ Direct plugin routes use the honest shared identity `originator: deepseek-harness` and `User-Agent: dsh-codex-connect`; Search, quota, image generation, Auto-review, and native compaction all use that policy. The pi-ai model route deliberately preserves pi-ai's provider identity rather than impersonating Codex CLI/Desktop, while still receiving the same attempt id, concurrency, proxy, cancellation, server-directed cooldown, and bounded HTTP diagnostic metadata. Native compaction travels through the provider fetch seam at runtime and therefore shares the model governor lane while retaining the direct-plugin identity on its own request. This split is explicit policy, not a claim about undocumented upstream risk controls.
40
+
41
+ Standalone capability/Auto-review probes reuse the same pure URL/header policy but keep their isolated one-shot dispatcher and deadline instead of depending on a running plugin governor. The proxy reachability probe is also a bootstrap exception because it tests the proxy primitive used by the governor itself. OAuth authorization/refresh and credential-free public image fetching are outside `backend-api` and keep their separate security boundaries. Browser calls to this plugin's own local HTTP routes are likewise not upstream backend traffic.
42
+
43
+ ## Search and images
44
+
45
+ When `enableSearch: true`, the plugin registers its standalone search provider. It does not append a plugin-owned required-on-read Session event because an external package cannot guarantee that its `@deepseek-ai/dsh-session` module instance owns the Host persistence vocabulary; the standard web Tool call and result remain in the Session log. DSH `0.1.2-rc.1` does not expose the WebRuntime provider selection through its settings service, so the compatibility adapter verifies that release's runtime field, records the previous provider, and selects Codex only while the capability is active. Disable and disposal restore the recorded provider unless another owner has selected a newer route. An unsupported runtime fails activation instead of reporting a route change that did not occur. Search responses are mapped to Harness text and citation records.
46
+
47
+ When `enableImageTool: true`, `view_image` is registered only after tools, filesystem, and attachment services are available. Local files remain bounded by the Harness filesystem surface. Remote images allow only credential-free public HTTP(S): all DNS answers must be public unicast, each redirect is revalidated, and each socket is pinned to the validated address to close DNS-rebinding gaps. The tool also checks bounded bytes, accepted media signatures, and current-model image support before saving a Harness attachment.
48
+
49
+ Each remote-image redirect hop has one 30-second deadline covering DNS, connection, and body consumption. Cancellation settles the caller's wait immediately; an operating-system DNS lookup may still finish later, but its result cannot start a new HTTP request after cancellation or timeout.
50
+
51
+ Successful Codex image-generation Tool results also render in the independent completed-Turn tail. DSH groups Tool calls into a collapsed processing disclosure, so the keyed Tool card alone cannot make generated images visible with the answer. The tail reads only this Turn's settled Tool rows, including nested PTC calls and restored history, and uses the same validated result metadata, session-bound preview loader, Lightbox, and download controls as the Tool card. Failed, malformed, unrelated, or post-answer results do not enter the visible image row. The Tool card remains available in processing details.
52
+
53
+ Image preview recovery uses additive metadata/envelope version 3 only when original persistence completed but preview creation failed. It records exact originals with `previewStatus: unavailable` and no fabricated attachment. Host validation precedes original persistence, so preview failures cannot bypass the original image validation gate. Native and PTC history can admit these originals for the creating session or an authorized inherited prefix; arbitrary text cannot. The existing result card exposes original download and explicit editing without a new image request. Normal version 1/2 results are unchanged; cancellation still cleans unpublished originals. See [implementation and validation](agent-notes/image-preview-recovery.md).
54
+
55
+ ## Conflicts and diagnostics
56
+
57
+ Before registration the plugin checks current provider ids. An existing `openai-codex` adapter produces a focused message naming the likely legacy-bundle or manual-provider cause. The boot-free CLI `doctor` reports package/runtime version, OAuth path metadata, capability defaults, and safe conflict guidance without returning auth content.
58
+
59
+ ## Compatibility boundary
60
+
61
+ Alpha 4.27 pins Harness `0.1.2-rc.1` development dependencies and follows its pi-ai range `^0.84.2`. Supported Node.js remains `^22.19.0 || >=24.0.0`. The keyed `settings.plugin.item` integration remains, while client types come from their Session Controller, Settings, Store, and Renderer owners. The published compatibility record lists the exact Alpha 4.27 and DSH `0.1.2-rc.1` pair. Backend eligibility, quotas, models, service-side context capacity, and protocol details remain controlled upstream. Tests use temporary OAuth documents and mocked network responses; CI does not perform real authentication.
@@ -0,0 +1,39 @@
1
+ # Codex Connect:Alpha 设计
2
+
3
+ ## 所有权与组合
4
+
5
+ 本包通过 Harness 公共 `LlmRuntime` 与 `PiAiAdapter` 注册 `openai-codex`。主模型路径不是一次性 subagent,而是标准 Harness agent loop,因此原生工具审批、权限策略、流式输出、附件解析、reasoning replay、会话持久化、压缩与恢复均保持有效。
6
+
7
+ bundle patch 只插入 `llm-openai-codex`,不会写入 `agent-default-model` 或 `web.searchProvider`。`enableSearch` 与 `enableImageTool` 默认均为 `false`;关闭时不会注册对应可选服务。
8
+
9
+ Host 将 `llm-openai-codex` 注册为插件自有的能力 settings namespace。DSH 的 `llm-pi-ai` catalog 持有 `openai-codex` 可配置 provider 目录条目,Codex Connect 只注册实际 adapter,不重复声明该条目。浏览器通过 Harness settings-scope transport 绑定插件 namespace,把账户、额度以及带保存/放弃的能力配置放在现有“插件配置”卡片中。带 revision 防护的逐字段写入不会覆盖无关设置;提交后会即时协调搜索与图片能力的注册状态。插件绝不写入默认模型设置。
10
+
11
+ ## Task 开发冻结
12
+
13
+ 普通模型适配器与后端请求管理器不直接导入 Task 策略;产品组装处显式接入旧任务的 provider 包装和请求前计数。此拆分保留旧任务权限、取消与恢复,不等于已删除全部实验运行时。见[拆分记录](agent-notes/core-transport-decoupling.md)。
14
+
15
+ 维护范围现以[核心维护决定](maintenance-scope.md)为准:Task Phase 1/2 实现已经合并,但公开启动入口保持暂停,后续自动编排开发冻结。保留旧状态读取、经授权的停止与人工接管;历史候选验收计划不再是当前待办。
16
+
17
+ ## OAuth 持久化
18
+
19
+ 插件使用 `$DSH_HOME/.openai-codex-auth.json`,与 Codex CLI/Desktop 状态分离。格式 version 2 最多保存 16 个 OAuth 账户,并明确指定唯一当前账户。原 version 1 文件仍可读取,第一次修改凭据时才迁移;迁移前会先生成仅所有者可读的 `.openai-codex-auth.json.v1-backup` 回退副本。若该副本已存在,它必须仅所有者可读且与当前 version 1 文件一致,否则迁移会在替换主文件前停止。移除任一账户或执行退出登录时会删除该副本,避免已移除凭据继续留存。文档大小上限为 512 KiB。POSIX 上拒绝组/其他用户可读文件,也拒绝非普通文件;写入采用原子替换,所有修改使用 Harness 跨进程文件锁,返回给调用方的是凭据副本。
20
+
21
+ 浏览器账户路由只返回插件派生的稳定键、本地显示名称、OAuth token 中存在邮箱时的脱敏地址以及当前账户状态,不返回 provider 原始 account id 或 token 字段。账户切换和删除与浏览器 OAuth 串行执行;每个模型请求会在解析授权前固定当前账户,令牌刷新只更新该账户,不会改变当前选择。OAuth 解析完成后,额度、图片生成和 Auto-review 请求会查找与该 access token 精确配套的 account id,因此并发切换账户不会混用两个账户的凭据。仍有其他账户时,删除当前账户必须由调用方明确指定接替账户;provider 级退出登录会删除全部账户。浏览器 origin 授权单独存放于 `$DSH_HOME/.openai-codex-trusted-origins.json`,格式为 `version: 1`、`mode: "allowlist"` 和规范化的精确 HTTP(S) origin;其中不含 OAuth 内容,且只能通过独立 CLI 修改。
22
+
23
+ 为兼容迁移,设置页路由、OAuth 路径和 provider id 不改名。浏览器请求默认只允许 loopback;远程请求必须使用当前 sidecar 中的精确有效 HTTP(S) origin,不能带 cross-site Fetch Metadata,若带 Origin 还必须精确匹配。每次请求都会重新读取 sidecar;未知字段或错误 mode 会快速失败。登录挑战只接受不含凭据的 HTTPS 地址;30 秒内未得到地址、provider 已结束但没有地址、退出登录或插件卸载时,所有 waiter 都会被清理。只有显式登录会输出授权 URL 或代码;状态输出会脱敏。doctor 只用 `lstat` 检查元数据,不打开文件。
24
+
25
+ 浏览器账户与更新请求具有 45 秒期限,覆盖响应头和 JSON 响应体。账户修改超时后不会自动重试写操作:只要账户视图仍在观察状态,浏览器就会重新读取服务端状态,因为修改可能已经提交。状态读取失败后每五秒重试,即使尚未保存账户也一样。插件卸载会取消浏览器等待,但不会退出服务端账户。
26
+
27
+ ## 搜索与图片
28
+
29
+ 仅当 `enableSearch: true` 时注册 Codex 独立搜索提供方和不含凭据的请求事件。DSH `0.1.2-rc.1` 没有通过 settings 服务开放 WebRuntime 的 provider 选择,因此兼容适配器会先核对该版本的运行时字段,记录此前的提供方,并仅在能力开启期间选择 Codex。关闭能力或卸载插件时会恢复此前的提供方;如果另一个 owner 已经选择了更新的路由,则不会覆盖它。不支持的运行时会让能力启用失败,不会谎报路由已经变化。仅当 `enableImageTool: true` 且 tools、filesystem、attachments 服务存在时注册 `view_image`。本地文件继续受 Harness 文件系统边界与大小限制;远程图片只允许不含凭据的公共 HTTP(S),所有 DNS 结果必须是公共单播地址,每次重定向都会重新验证,并把实际连接固定到已验证地址以关闭 DNS rebinding 缺口。
30
+
31
+ 远程图片的每次重定向跳转共用一个 30 秒期限,覆盖 DNS、连接与响应体读取。取消会立即结束调用方等待;操作系统 DNS 查询可能稍后才完成,但其结果不能在取消或超时后启动新的 HTTP 请求。
32
+
33
+ 图片预览恢复仅在原图保存成功、预览创建失败时使用新增的元数据及内容 envelope 版本 3。结果记录精确原图和 `previewStatus: unavailable`,不会伪造附件。原图落盘前先通过 Host 验证,避免预览失败绕过原图验证。原生及 PTC 历史可将这些原图用于创建会话或实际继承了该结果的 fork;任意文本不会授予权限。现有结果卡提供原图下载及显式编辑,无需重新发送生图请求。正常版本 1/2 结果不变,取消仍清理未发布的原图。详见[实施与验证记录](agent-notes/image-preview-recovery.md)。
34
+
35
+ ## 冲突、诊断与兼容边界
36
+
37
+ 注册前检查现有 provider id;发现 `openai-codex` 已被占用时,给出旧 bundle 或手动 provider 配置的定向迁移提示。boot-free CLI doctor 只报告包/运行时版本、OAuth 路径元数据、能力默认值和安全提示。
38
+
39
+ Alpha 4.27 固定使用 Harness `0.1.2-rc.1` 开发依赖,并跟随其 pi-ai 版本范围 `^0.84.2`。Node.js 支持范围仍为 `^22.19.0 || >=24.0.0`。keyed `settings.plugin.item` 集成保持不变,客户端类型继续从 Session Controller、Settings、Store 和 Renderer 的所属包导入。已发布兼容性记录列出 Alpha 4.27 与 DSH `0.1.2-rc.1` 的精确组合。资格、额度、模型、服务端上下文容量和后端协议仍由上游控制。测试仅使用临时 OAuth 文档和模拟网络响应,CI 不执行真实认证。
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Mario Zechner
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,115 @@
1
+ Standalone CLI third-party notices
2
+
3
+ The generated lib/bin.js and its helper chunks include portions of the
4
+ packages listed below, except where marked as retained notices. The retained
5
+ notices cover dependencies bundled by earlier Alpha 4.43 candidates but
6
+ removed from the final standalone CLI. They do not change package licenses.
7
+
8
+ MIT-licensed packages:
9
+ - @deepseek-ai/dsh-atomic-write, dsh-home-paths, dsh-typert-protocol,
10
+ dsh-util-values, dsh-timeout, dsh-llm, and dsh-web: Copyright (c) 2026 DeepSeek.
11
+ - @deepseek-ai/cosmokit, @deepseek-ai/cordis, and
12
+ @deepseek-ai/schemastery: Copyright (c) 2021-present Shigma.
13
+ - @earendil-works/pi-ai: Copyright (c) 2025 Mario Zechner. Its OAuth
14
+ source notice is also retained in docs/licenses/pi-ai-oauth.txt.
15
+ - partial-json: Copyright (c) 2023 Promplate Dev Team.
16
+
17
+ Retained notices for packages no longer included in this CLI build:
18
+ - @deepseek-ai/dsh-attachment, dsh-llm-pi-ai, and dsh-compaction:
19
+ Copyright (c) 2026 DeepSeek (MIT).
20
+ - @anthropic-ai/sdk: Copyright 2023 Anthropic, PBC (MIT).
21
+ - @stablelib/base64: Copyright (C) 2016 Dmitry Chestnykh (MIT).
22
+ - standardwebhooks: Copyright Standard Webhooks (MIT).
23
+ - openai: Copyright OpenAI (Apache-2.0).
24
+ - neoqs: Copyright (c) 2014 Nathan LaFreniere and other contributors (BSD-3-Clause).
25
+ - zod-to-json-schema: Copyright (c) 2020 Stefan Terdell (ISC).
26
+ - fast-sha256: Unlicense.
27
+
28
+ MIT License
29
+
30
+ Permission is hereby granted, free of charge, to any person obtaining a copy
31
+ of this software and associated documentation files (the "Software"), to deal
32
+ in the Software without restriction, including without limitation the rights
33
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
34
+ copies of the Software, and to permit persons to whom the Software is
35
+ furnished to do so, subject to the following conditions:
36
+
37
+ The above copyright notice and this permission notice shall be included in all
38
+ copies or substantial portions of the Software.
39
+
40
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
41
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
42
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
43
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
44
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
45
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
46
+ SOFTWARE.
47
+
48
+ openai is Copyright OpenAI and is licensed under Apache-2.0; the full license
49
+ is included in this package's root LICENSE file.
50
+
51
+ The OpenAI and Anthropic SDKs include portions of neoqs, Copyright (c) 2014
52
+ Nathan LaFreniere and other contributors, under the BSD 3-Clause License:
53
+
54
+ Redistribution and use in source and binary forms, with or without
55
+ modification, are permitted provided that the following conditions are met:
56
+
57
+ 1. Redistributions of source code must retain the above copyright notice,
58
+ this list of conditions and the following disclaimer.
59
+ 2. Redistributions in binary form must reproduce the above copyright notice,
60
+ this list of conditions and the following disclaimer in the documentation
61
+ and/or other materials provided with the distribution.
62
+ 3. Neither the name of the copyright holder nor the names of its contributors
63
+ may be used to endorse or promote products derived from this software
64
+ without specific prior written permission.
65
+
66
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
67
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
68
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
69
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
70
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
71
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
72
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
73
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
74
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
75
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
76
+ POSSIBILITY OF SUCH DAMAGE.
77
+
78
+ The OpenAI SDK includes portions of zod-to-json-schema, Copyright (c) 2020
79
+ Stefan Terdell, under the ISC License:
80
+
81
+ Permission to use, copy, modify, and/or distribute this software for any
82
+ purpose with or without fee is hereby granted, provided that the above
83
+ copyright notice and this permission notice appear in all copies.
84
+
85
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
86
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
87
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
88
+ SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
89
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
90
+ OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
91
+ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
92
+
93
+ fast-sha256 1.3.0 is released under the Unlicense:
94
+
95
+ This is free and unencumbered software released into the public domain.
96
+
97
+ Anyone is free to copy, modify, publish, use, compile, sell, or distribute
98
+ this software, either in source code form or as a compiled binary, for any
99
+ purpose, commercial or non-commercial, and by any means.
100
+
101
+ In jurisdictions that recognize copyright laws, the author or authors of
102
+ this software dedicate any and all copyright interest in the software to the
103
+ public domain. We make this dedication for the benefit of the public at large
104
+ and to the detriment of our heirs and successors. We intend this dedication
105
+ to be an overt act of relinquishment in perpetuity of all present and future
106
+ rights to this software under copyright law.
107
+
108
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
109
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
110
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
111
+ AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
112
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
113
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
114
+
115
+ For more information, please refer to <https://unlicense.org>.