@ckanner/flywheel 0.33.1 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/README.md +1 -0
- package/README.zh-CN.md +2 -0
- package/THIRD_PARTY_NOTICES.md +5 -1
- package/bin/flywheel-kimi-native-worker.js +5 -0
- package/bin/flywheel.js +8 -1
- package/bin/runtime.js +5 -1
- package/dist/bridge.mjs +89 -7
- package/dist/claude-code-pro-bridge.mjs +55 -6
- package/dist/client.js +40 -5
- package/dist/codex-pro-bridge.mjs +12 -5
- package/dist/control.mjs +1 -1
- package/dist/kimi-native-bridge.mjs +429 -0
- package/dist/kimi-native-runtime.mjs +233 -0
- package/dist/kimi-native-worker.mjs +77 -0
- package/dist/kimi-tower-candidate.mjs +227 -0
- package/dist/machine-worker.mjs +39 -5
- package/dist/managed-lcu.mjs +223 -0
- package/dist/native-doctor.mjs +36 -0
- package/dist/native-jobs.mjs +72 -0
- package/dist/native-policy.mjs +371 -0
- package/dist/native-resources.mjs +144 -0
- package/dist/native.mjs +251 -0
- package/dist/policy.mjs +13 -3
- package/dist/prewarm.mjs +4 -1
- package/dist/protocol.mjs +8 -1
- package/dist/worker.mjs +16 -9
- package/docs/README.md +9 -0
- package/docs/README.zh-CN.md +3 -0
- package/docs/design.md +33 -11
- package/docs/en/claude-code-pro.md +2 -2
- package/docs/en/configuration.md +17 -5
- package/docs/en/contributing.md +5 -3
- package/docs/en/getting-started.md +2 -2
- package/docs/en/model-policy.md +2 -2
- package/docs/en/native-capabilities.md +185 -0
- package/docs/en/releasing.md +2 -2
- package/docs/en/session-recovery.md +2 -2
- package/docs/plans/2026-11-13-native-harness-capabilities.en.md +258 -0
- package/docs/plans/2026-11-13-native-harness-capabilities.md +276 -0
- package/docs/plans/README.md +1 -0
- package/docs/validation/2026-11-14-desktop-native-configuration.md +128 -0
- package/docs/validation/2026-11-14-native-harness-implementation.md +215 -0
- package/docs/validation/2026-11-14-published-companions.md +15 -0
- package/docs/validation/2026-11-14-release-0.33.1.md +78 -0
- package/docs/validation/README.md +3 -0
- package/docs/validation/evidence/2026-11-14-native-harness-candidate.json +255 -0
- package/docs/validation/evidence/2026-11-14-native-harness-sessions.json +6009 -0
- package/docs/validation/evidence/2026-11-14-native-harness-tower-candidate.json +192 -0
- package/docs/zh-CN/claude-code-pro.md +2 -2
- package/docs/zh-CN/configuration.md +21 -8
- package/docs/zh-CN/contributing.md +5 -3
- package/docs/zh-CN/getting-started.md +2 -2
- package/docs/zh-CN/model-policy.md +2 -2
- package/docs/zh-CN/native-capabilities.md +184 -0
- package/docs/zh-CN/releasing.md +2 -2
- package/docs/zh-CN/session-recovery.md +1 -1
- package/native/darwin-amd64/flywheel +0 -0
- package/native/darwin-arm64/flywheel +0 -0
- package/native/linux-amd64/flywheel +0 -0
- package/native/linux-arm64/flywheel +0 -0
- package/native/manifest.json +9 -9
- package/node_modules/dsh-preset-generator/CHANGELOG.md +77 -0
- package/node_modules/dsh-preset-generator/LICENSE +21 -0
- package/node_modules/dsh-preset-generator/README.md +149 -0
- package/node_modules/dsh-preset-generator/docs/README.zh.md +95 -0
- package/node_modules/dsh-preset-generator/package.json +43 -0
- package/node_modules/dsh-preset-generator/src/composition.mjs +150 -0
- package/node_modules/dsh-preset-generator/src/gen-presets.mjs +367 -0
- package/node_modules/dsh-preset-generator/src/policy.mjs +17 -0
- package/node_modules/dsh-subagent-codex-pro/CHANGELOG.md +16 -1
- package/node_modules/dsh-subagent-codex-pro/README.md +57 -4
- package/node_modules/dsh-subagent-codex-pro/assets/native-client.js +118 -0
- package/node_modules/dsh-subagent-codex-pro/cordis.patch.yml +6 -0
- package/node_modules/dsh-subagent-codex-pro/docs/README.zh.md +49 -2
- package/node_modules/dsh-subagent-codex-pro/docs/machine-lifecycle-validation.md +1 -1
- package/node_modules/dsh-subagent-codex-pro/docs/machine-lifecycle.md +1 -1
- package/node_modules/dsh-subagent-codex-pro/docs/machine-lifecycle.zh.md +1 -1
- package/node_modules/dsh-subagent-codex-pro/docs/machine.md +2 -2
- package/node_modules/dsh-subagent-codex-pro/docs/native-capabilities.md +254 -0
- package/node_modules/dsh-subagent-codex-pro/docs/native-capabilities.zh.md +180 -0
- package/node_modules/dsh-subagent-codex-pro/lib/config.js +56 -0
- package/node_modules/dsh-subagent-codex-pro/lib/config.js.map +1 -0
- package/node_modules/dsh-subagent-codex-pro/lib/desktop-native.js +109 -0
- package/node_modules/dsh-subagent-codex-pro/lib/desktop-native.js.map +1 -0
- package/node_modules/dsh-subagent-codex-pro/lib/dsh-types.js +3 -4
- package/node_modules/dsh-subagent-codex-pro/lib/dsh-types.js.map +1 -1
- package/node_modules/dsh-subagent-codex-pro/lib/index.js +64 -15
- package/node_modules/dsh-subagent-codex-pro/lib/index.js.map +1 -1
- package/node_modules/dsh-subagent-codex-pro/lib/jobs.js +6 -2
- package/node_modules/dsh-subagent-codex-pro/lib/jobs.js.map +1 -1
- package/node_modules/dsh-subagent-codex-pro/lib/machine-cli.js +2 -2
- package/node_modules/dsh-subagent-codex-pro/lib/machine-cli.js.map +1 -1
- package/node_modules/dsh-subagent-codex-pro/lib/machine-local.js +5 -2
- package/node_modules/dsh-subagent-codex-pro/lib/machine-local.js.map +1 -1
- package/node_modules/dsh-subagent-codex-pro/lib/machine-supervision.js +11 -0
- package/node_modules/dsh-subagent-codex-pro/lib/machine-supervision.js.map +1 -1
- package/node_modules/dsh-subagent-codex-pro/lib/machine-supervisor.js +1 -0
- package/node_modules/dsh-subagent-codex-pro/lib/machine-supervisor.js.map +1 -1
- package/node_modules/dsh-subagent-codex-pro/lib/machine.js +20 -3
- package/node_modules/dsh-subagent-codex-pro/lib/machine.js.map +1 -1
- package/node_modules/dsh-subagent-codex-pro/lib/native.js +297 -0
- package/node_modules/dsh-subagent-codex-pro/lib/native.js.map +1 -0
- package/node_modules/dsh-subagent-codex-pro/lib/process-guardian.js +11 -1
- package/node_modules/dsh-subagent-codex-pro/lib/process-guardian.js.map +1 -1
- package/node_modules/dsh-subagent-codex-pro/lib/run.js +19 -1
- package/node_modules/dsh-subagent-codex-pro/lib/run.js.map +1 -1
- package/node_modules/dsh-subagent-codex-pro/lib/tool.js +123 -57
- package/node_modules/dsh-subagent-codex-pro/lib/tool.js.map +1 -1
- package/node_modules/dsh-subagent-codex-pro/lib/types/config.d.ts +31 -0
- package/node_modules/dsh-subagent-codex-pro/lib/types/config.d.ts.map +1 -0
- package/node_modules/dsh-subagent-codex-pro/lib/types/desktop-native.d.ts +30 -0
- package/node_modules/dsh-subagent-codex-pro/lib/types/desktop-native.d.ts.map +1 -0
- package/node_modules/dsh-subagent-codex-pro/lib/types/dsh-types.d.ts +7 -5
- package/node_modules/dsh-subagent-codex-pro/lib/types/dsh-types.d.ts.map +1 -1
- package/node_modules/dsh-subagent-codex-pro/lib/types/index.d.ts +31 -0
- package/node_modules/dsh-subagent-codex-pro/lib/types/index.d.ts.map +1 -1
- package/node_modules/dsh-subagent-codex-pro/lib/types/jobs.d.ts +2 -0
- package/node_modules/dsh-subagent-codex-pro/lib/types/jobs.d.ts.map +1 -1
- package/node_modules/dsh-subagent-codex-pro/lib/types/machine-local.d.ts.map +1 -1
- package/node_modules/dsh-subagent-codex-pro/lib/types/machine-supervision.d.ts.map +1 -1
- package/node_modules/dsh-subagent-codex-pro/lib/types/machine.d.ts +7 -0
- package/node_modules/dsh-subagent-codex-pro/lib/types/machine.d.ts.map +1 -1
- package/node_modules/dsh-subagent-codex-pro/lib/types/native.d.ts +120 -0
- package/node_modules/dsh-subagent-codex-pro/lib/types/native.d.ts.map +1 -0
- package/node_modules/dsh-subagent-codex-pro/lib/types/run.d.ts +11 -0
- package/node_modules/dsh-subagent-codex-pro/lib/types/run.d.ts.map +1 -1
- package/node_modules/dsh-subagent-codex-pro/lib/types/tool.d.ts +11 -0
- package/node_modules/dsh-subagent-codex-pro/lib/types/tool.d.ts.map +1 -1
- package/node_modules/dsh-subagent-codex-pro/lib/types/wire.d.ts +7 -1
- package/node_modules/dsh-subagent-codex-pro/lib/types/wire.d.ts.map +1 -1
- package/node_modules/dsh-subagent-codex-pro/lib/wire.js +34 -6
- package/node_modules/dsh-subagent-codex-pro/lib/wire.js.map +1 -1
- package/node_modules/dsh-subagent-codex-pro/package.json +28 -4
- package/npm/install.js +2 -2
- package/package.json +25 -10
- package/plugins/dsh/KIMI_NATIVE_PROTOCOL.en.md +76 -0
- package/plugins/dsh/KIMI_NATIVE_PROTOCOL.md +76 -0
- package/plugins/dsh/PROTOCOL.md +149 -17
- package/plugins/dsh/README.md +15 -12
- package/plugins/dsh/README.zh-CN.md +8 -8
- package/plugins/dsh/THIRD_PARTY_NOTICES.md +5 -1
- package/plugins/dsh/vendor/README.md +40 -11
- package/plugins/dsh/vendor/chatgpt.json +21 -0
- package/plugins/dsh/vendor/claude-code-pro.json +21 -0
- package/plugins/dsh/vendor/codex-pro.json +13 -8
- package/plugins/dsh/vendor/lcu.json +21 -0
- package/plugins/dsh/vendor/preset-generator.json +16 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# dsh-subagent-codex-pro
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
**0.9.0
|
|
4
|
+
**0.9.0:**公开 machine API 新增可等待的结构化检查点、私有调用
|
|
5
5
|
journal 与只读恢复。独立 supervisor 在调用者死亡后继续清理并保存原始终态回执。
|
|
6
|
-
详见[生命周期与恢复](machine-lifecycle.zh.md)
|
|
6
|
+
详见[生命周期与恢复](machine-lifecycle.zh.md);本次 0.10.0 仍是未发布的源码候选。
|
|
7
7
|
|
|
8
8
|
[English](../README.md) | 中文
|
|
9
9
|
|
|
@@ -18,6 +18,53 @@ tools.subagent_codex({
|
|
|
18
18
|
})
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
## 0.10.0:插件设置、PTC 工具与原生能力
|
|
22
|
+
|
|
23
|
+
原生能力已经接入**插件本身**。在 DSH「插件」中打开已安装的 bundle,配置
|
|
24
|
+
**codex-pro** 这一行,即可选择继承、显式全部关闭、并发子线程上限、子模型、
|
|
25
|
+
子 Agent 思考等级与 V2 后端。保存后下一次调用读取新设置;正在运行的任务
|
|
26
|
+
保持原来的快照。遇到配置版本冲突,页面保留草稿,只有显式重新载入才放弃编辑。
|
|
27
|
+
|
|
28
|
+
普通 `subagent_codex` 工具新增单次 `native` 参数,DSH 的 PTC 自动生成其工具
|
|
29
|
+
SDK,不需要另外实现 PTC executor。外层用 PTC 编排,内层仍由 Codex 原生
|
|
30
|
+
harness 执行原生工具与子 Agent。
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
await tools.subagent_codex({
|
|
34
|
+
description: "实现独立模块",
|
|
35
|
+
prompt: "完成任务;合适时将独立工作交给原生子 Agent。",
|
|
36
|
+
native: { version: 1, agents: { enabled: true, maxConcurrentThreads: 3, backend: "v2" } },
|
|
37
|
+
})
|
|
38
|
+
await tools.subagent_codex_review({
|
|
39
|
+
description: "审查当前分支",
|
|
40
|
+
target: { type: "baseBranch", branch: "main" },
|
|
41
|
+
})
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
| 单次 native 值 | 语义 |
|
|
45
|
+
| --- | --- |
|
|
46
|
+
| 省略 | 使用调用开始时的插件默认值;插件也未设置时保留 CLI 自己的默认行为。 |
|
|
47
|
+
| `null` | 显式关闭两个 Agent 后端,不是退回 CLI 默认。 |
|
|
48
|
+
| version 1 对象 | 整体替换插件默认值,不逐字段合并。 |
|
|
49
|
+
| `{version:1,agents:{enabled:false}}` | 显式关闭;并发、子模型、effort、backend 等残留字段会报错。 |
|
|
50
|
+
|
|
51
|
+
`modelSelection:false` 不会禁用用户配置中的子模型默认值,但单次 enabled 对象
|
|
52
|
+
必须保留相同的子模型与 effort,包括字段是否省略;改变或清空选择需用户修改设置。
|
|
53
|
+
`native` 不能扩大插件配置的文件与进程权限。
|
|
54
|
+
|
|
55
|
+
独立原生 Review 使用专用 `subagent_codex_review`:每次显式 target、新的临时
|
|
56
|
+
线程、read-only、agents off,不接收会被忽略的 prompt、thread_id、图片或
|
|
57
|
+
output_schema。不能将 review 设成普通委派的默认任务。
|
|
58
|
+
|
|
59
|
+
前台工具结果以独立 `native` 字段保留完整回执,`content` 中的结构化答案不混入
|
|
60
|
+
调试文字。带 native 回执的后台 job 返回 JSON 字符串信封
|
|
61
|
+
`{text,threadId,native}`;未启用显式 native 控制时保留原来的纯文本结果。
|
|
62
|
+
Host provider 使用同一动态默认值,并通过官方 diagnostic 记录有界摘要。
|
|
63
|
+
machine API 继续提供完整回执、逐子线程事件与用量,以及只读恢复。
|
|
64
|
+
详见[中文完整契约](native-capabilities.zh.md) / [English contract](native-capabilities.md)。
|
|
65
|
+
本次仍是 0.10.0 源码候选,未发布 npm;离线协议与组件测试不等于用户 Mac
|
|
66
|
+
或真实付费模型已验收。
|
|
67
|
+
|
|
21
68
|
## 0.8.0 正式机器入口与迁移
|
|
22
69
|
|
|
23
70
|
新增 [machine API/CLI](machine.md),让 Go 等编排器直接复用本包的 Codex 运行核心,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Lifecycle 1 validation record
|
|
2
2
|
|
|
3
|
-
Validated on 2026-11-08 against
|
|
3
|
+
Validated on 2026-11-08 against **0.9.0**,
|
|
4
4
|
based on repository commit `04ecdb677735d84f3a0f5dba01a9d9b28c324c0e`.
|
|
5
5
|
This records local Linux validation with Node 24.22.1 and npm 12.2.1. It does
|
|
6
6
|
not claim a registry release, a macOS run, or a live Codex account acceptance.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Typed lifecycle and read-only recovery (lifecycle 1)
|
|
2
2
|
|
|
3
|
-
This contract is in
|
|
3
|
+
This contract is in **0.9.0**. The public
|
|
4
4
|
`dsh-subagent-codex-pro/machine` result protocol stays 1. Lifecycle is a separate,
|
|
5
5
|
versioned JavaScript API capability; the single-document CLI and existing DSH
|
|
6
6
|
Host/tool results do not silently become a duplex protocol.
|
|
@@ -4,7 +4,7 @@ Version 0.8.0 introduced a public entry for orchestrators that need the complete
|
|
|
4
4
|
without a DSH parent Agent. It uses the same app-server runner, configuration
|
|
5
5
|
checks, usage tracker and process guardian as the DSH provider and tool.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
**0.9.0** adds [typed lifecycle and read-only
|
|
8
8
|
recovery](machine-lifecycle.md) ([中文](machine-lifecycle.zh.md)). The result protocol
|
|
9
9
|
remains 1. The single-document CLI remains terminal-only; durable ACKs use the
|
|
10
10
|
JavaScript API. Existing DSH callers do not opt into this additional supervisor.
|
|
@@ -52,7 +52,7 @@ npx --no-install codex-pro-machine --json < request.json > receipt.json
|
|
|
52
52
|
The required fields are protocol, requestId, prompt, cwd, model, effort and
|
|
53
53
|
permissionMode. Machine calls always name their model and permission explicitly.
|
|
54
54
|
Optional fields are command, timeoutMs, maxOutputBytes, threadMode, threadId,
|
|
55
|
-
images and
|
|
55
|
+
images, outputSchema and native. See [native capabilities](native-capabilities.md) for versioned controls and evidence. Unknown fields fail before a process starts. The CLI
|
|
56
56
|
limits the entire request to 1 MiB. The runner limits stdout and diagnostic bytes
|
|
57
57
|
to 32 MiB by default; exceeding the configured positive maxOutputBytes stops the
|
|
58
58
|
run and sets execution.truncated instead of accepting a partial answer.
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
# Native Codex capabilities (0.10.0 source candidate)
|
|
2
|
+
|
|
3
|
+
Protocol 1 keeps its existing behavior when `native` is absent. A caller can now
|
|
4
|
+
opt into a versioned native policy. The adapter still starts the user's installed,
|
|
5
|
+
logged-in Codex app-server; it does not create a new account, billing path, SDK
|
|
6
|
+
client, or DSH session. These controls apply to the public `/machine` API and CLI,
|
|
7
|
+
and are now also connected to the DSH plugin settings and tools described below.
|
|
8
|
+
|
|
9
|
+
English | [中文](native-capabilities.zh.md)
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import { runMachine, MACHINE_NATIVE_CAPABILITIES } from 'dsh-subagent-codex-pro/machine'
|
|
13
|
+
|
|
14
|
+
const receipt = await runMachine({
|
|
15
|
+
protocol: 1, requestId: 'implementation-1', cwd: '/repo/worktree',
|
|
16
|
+
prompt: 'Implement the change. Delegate independent work when useful.',
|
|
17
|
+
model: 'your-installed-codex-model', effort: 'high',
|
|
18
|
+
permissionMode: 'workspace-write', threadMode: 'persistent',
|
|
19
|
+
native: {
|
|
20
|
+
version: 1,
|
|
21
|
+
agents: {
|
|
22
|
+
enabled: true,
|
|
23
|
+
maxConcurrentThreads: 4,
|
|
24
|
+
defaultModel: 'your-worker-model',
|
|
25
|
+
defaultEffort: 'high',
|
|
26
|
+
// Optional: explicitly select the current V2 collaboration backend.
|
|
27
|
+
backend: 'v2',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
}, {
|
|
31
|
+
recoveryDirectory: '/repo/run-evidence/implementation-1',
|
|
32
|
+
onLifecycle: async event => { /* durably save before resolving */ },
|
|
33
|
+
onNativeEvent: event => { /* bounded metadata for the host's activity view */ },
|
|
34
|
+
})
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Desktop settings and PTC tools
|
|
38
|
+
|
|
39
|
+
Open the installed bundle's `codex-pro` row configuration in DSH's Plugins page.
|
|
40
|
+
The shipped browser entry registers `plugins.row.config` using the Host's shared
|
|
41
|
+
React module. It edits only the `native` path through the owner form's atomic
|
|
42
|
+
`mutate(ops, expectedRevision)`, never a deep merge of stale enabled controls.
|
|
43
|
+
“Inherit configuration” unsets that path; “All off” writes `null`. The effective
|
|
44
|
+
value preview distinguishes inherited configuration from the editable override.
|
|
45
|
+
Read-only/unavailable forms cannot save; conflicts retain the draft and its
|
|
46
|
+
original revision until the user reloads.
|
|
47
|
+
|
|
48
|
+
The plugin exports an actual Schemastery `Config`. Its `native` field is
|
|
49
|
+
volatile and read once at each delegation's start, including the Host provider
|
|
50
|
+
path. Omission has no empty-object default. Other plugin configuration keeps its
|
|
51
|
+
existing remount semantics. YAML configuration remains available:
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
native:
|
|
55
|
+
version: 1
|
|
56
|
+
agents:
|
|
57
|
+
enabled: true
|
|
58
|
+
maxConcurrentThreads: 3
|
|
59
|
+
defaultModel: your-worker-model
|
|
60
|
+
defaultEffort: high
|
|
61
|
+
backend: v2
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`subagent_codex({description, prompt, native, ...})` is the same registered tool
|
|
65
|
+
in ordinary DSH execution and in the automatically generated PTC tool SDK.
|
|
66
|
+
Omitting `native` inherits the current plugin default; no plugin default leaves
|
|
67
|
+
CLI-native defaults alone. A supplied object replaces that default completely.
|
|
68
|
+
Desktop `native:null` is shorthand for
|
|
69
|
+
`{version:1,agents:{enabled:false}}`; the public protocol-1 machine API still
|
|
70
|
+
uses the versioned object and does not accept this desktop shorthand.
|
|
71
|
+
|
|
72
|
+
A disabled policy may not carry enabled-only fields. Unknown native fields and
|
|
73
|
+
unknown tool arguments are rejected even if a caller bypasses JSON Schema.
|
|
74
|
+
When `modelSelection:false`, inherited child model/effort settings remain valid.
|
|
75
|
+
An enabled per-call object must keep those two values exactly, including
|
|
76
|
+
omission; replacing an object must not silently clear a configured model.
|
|
77
|
+
Explicit off is still permitted. Native fields do not expand the root sandbox.
|
|
78
|
+
|
|
79
|
+
An implicit `threadMode:session` resume is bound to native policy, model,
|
|
80
|
+
effort, permission and cwd. A binding change starts a new thread. Explicit
|
|
81
|
+
`thread_id` remains supported, including externally created threads: requested
|
|
82
|
+
configuration is reapplied and checked on every resume; a failed explicit
|
|
83
|
+
resume is reported, never silently replaced.
|
|
84
|
+
|
|
85
|
+
The latest DSH Host `SubagentStartRequest` has model/effort `agentOptions`,
|
|
86
|
+
but no generic provider-options or native field. Its provider path therefore
|
|
87
|
+
uses this plugin's live native default, while per-call native changes use
|
|
88
|
+
`subagent_codex` or `/machine`. Unknown Host start/options fields are rejected.
|
|
89
|
+
This is not a second Host Agent tree: Codex's children retain their native
|
|
90
|
+
lifecycle, permission, tool and usage semantics.
|
|
91
|
+
|
|
92
|
+
## Desktop native review
|
|
93
|
+
|
|
94
|
+
```js
|
|
95
|
+
await tools.subagent_codex_review({
|
|
96
|
+
description: "Review branch changes",
|
|
97
|
+
target: { type: "baseBranch", branch: "main" },
|
|
98
|
+
// Optional when model selection is enabled:
|
|
99
|
+
model: "your-review-model",
|
|
100
|
+
reasoning_effort: "high",
|
|
101
|
+
})
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
This dedicated tool accepts description, target, cwd, timeout, model/effort when
|
|
105
|
+
authorized, and background execution when the jobs service exists. It fixes
|
|
106
|
+
fresh ephemeral execution, read-only sandbox, approvals=never, and agents off.
|
|
107
|
+
It does not accept prompt, native, thread controls, images or output_schema.
|
|
108
|
+
Review is rejected in plugin defaults and ordinary tool native overrides, so a
|
|
109
|
+
normal task cannot accidentally become review/start or lose its prompt.
|
|
110
|
+
For an agent-assisted review or structured verdict, use an ordinary independent
|
|
111
|
+
delegation with the appropriate prompt and schema.
|
|
112
|
+
|
|
113
|
+
## Desktop evidence
|
|
114
|
+
|
|
115
|
+
| Entry | Evidence and answer |
|
|
116
|
+
| --- | --- |
|
|
117
|
+
| Foreground / PTC tool | `{content,native}`; complete native receipt is separate from unchanged answer blocks. Rendering preserves image attachments and appends a bounded native metadata block. |
|
|
118
|
+
| Background job | With native evidence, `result` is a JSON string `{text,threadId,native}`; without it, the previous plain text result remains. Failed jobs retain an available native receipt. |
|
|
119
|
+
| Host provider | Official `output`/`structured` are unchanged. `diagnostic` and the plugin log retain bounded metadata: config match, completion/cleanup, pending counts and abbreviated ids, child state counts, usage scope/status and event truncation. |
|
|
120
|
+
| Machine API | Complete native receipt and existing durable recovery journal. |
|
|
121
|
+
|
|
122
|
+
The Host's narrow result contract is not extended with invented fields. Its
|
|
123
|
+
bounded summary is not the complete event ledger; callers needing all child
|
|
124
|
+
identities and events use the dedicated tools or machine API. An unconfirmed
|
|
125
|
+
native configuration, unfinished observed child or unconfirmed process cleanup
|
|
126
|
+
prevents a successful result, even when the root already emitted a final answer.
|
|
127
|
+
|
|
128
|
+
## Configuration and full agent access
|
|
129
|
+
|
|
130
|
+
Native agents receive Codex's actual configured tools, permissions, MCP servers,
|
|
131
|
+
and model behavior. This package does not replace their tools with a read-only
|
|
132
|
+
helper subset. The caller selects the root sandbox explicitly; native agents
|
|
133
|
+
inherit the native harness's rules. Agent role definitions already installed in
|
|
134
|
+
Codex remain available. `defaultModel`/`defaultEffort` are defaults, not model
|
|
135
|
+
allowlists: a native spawn may select a different allowed model.
|
|
136
|
+
|
|
137
|
+
`maxConcurrentThreads` is a cap on open spawned threads, not a cumulative spawn,
|
|
138
|
+
token, or cost budget. V2's internal setting includes the root, so explicit V2
|
|
139
|
+
uses `N + 1`. With backend omitted, native/model backend selection remains intact;
|
|
140
|
+
an inherited V2 cap that exceeds the requested cap causes a configuration failure.
|
|
141
|
+
There is no claim that turning the V2 feature flag off forces a model to use V1.
|
|
142
|
+
|
|
143
|
+
Explicit off is `{version:1, agents:{enabled:false}}`. A present `native` with no
|
|
144
|
+
`agents` also disables agent dispatch. Off sets **both** `agents.enabled=false`
|
|
145
|
+
and `features.multi_agent_v2=false`; the V2 flag otherwise takes precedence.
|
|
146
|
+
Invalid/unknown controls fail before a process starts. The adapter passes config
|
|
147
|
+
overrides as separate argv values and checks `config/read` in the requested cwd
|
|
148
|
+
before it starts or resumes a thread. Missing, overridden or conflicting config
|
|
149
|
+
does not authorize a model turn. A config match proves configured values; observed
|
|
150
|
+
child/model events remain separate from requested defaults.
|
|
151
|
+
|
|
152
|
+
## Independent native review
|
|
153
|
+
|
|
154
|
+
```js
|
|
155
|
+
const review = await runMachine({
|
|
156
|
+
protocol: 1, requestId: 'review-1', cwd: '/repo/reviewer-worktree',
|
|
157
|
+
prompt: 'Native review operation', model: 'your-review-model', effort: 'high',
|
|
158
|
+
permissionMode: 'read-only',
|
|
159
|
+
native: { version: 1, review: { target: { type: 'baseBranch', branch: 'main' } } },
|
|
160
|
+
})
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Targets are `uncommittedChanges`, `baseBranch` with `branch`, `commit` with `sha`
|
|
164
|
+
and optional `title`, and `custom` with `instructions`. The operation creates a
|
|
165
|
+
fresh thread, verifies its cwd/model/sandbox, then calls `review/start` with inline
|
|
166
|
+
delivery on **that new thread**. Executor history is never resumed or forked.
|
|
167
|
+
The operation's native target supplies the review instructions; the compatibility
|
|
168
|
+
`prompt` field is not submitted as an ordinary turn. Requested model and effort
|
|
169
|
+
are scoped `review_model`/`model_reasoning_effort` config overrides, checked before
|
|
170
|
+
dispatch. The review response must identify the same new thread.
|
|
171
|
+
|
|
172
|
+
Codex's native review internally disables collaboration, image viewing and web
|
|
173
|
+
search. The API therefore rejects review combined with enabled native agents,
|
|
174
|
+
images, outputSchema, or an existing threadId. For a multi-agent review or a
|
|
175
|
+
schema-constrained verdict, start an independent normal query instead. A native
|
|
176
|
+
review result is supporting evidence; it is not automatically a host's approval
|
|
177
|
+
or a validated structured review decision.
|
|
178
|
+
|
|
179
|
+
## Media and structured output
|
|
180
|
+
|
|
181
|
+
The existing `images: ['/absolute/image.png']` and object-rooted `outputSchema`
|
|
182
|
+
remain supported for normal turns with or without native agents. They use native
|
|
183
|
+
`localImage` and `turn/start.outputSchema`; neither is a prompt-only convention.
|
|
184
|
+
The result keeps text, structured output and returned image metadata in their
|
|
185
|
+
existing fields. Native observations do not alter the model's answer.
|
|
186
|
+
|
|
187
|
+
## Evidence, accounting and cancellation
|
|
188
|
+
|
|
189
|
+
`receipt.native` adds requested controls; config source/match/values; bounded
|
|
190
|
+
ordered observations; child identities/parents/models/states; per-child usage;
|
|
191
|
+
and independent cleanup facts. `onNativeEvent` receives the same metadata. It is
|
|
192
|
+
an advisory callback and cannot authorize dispatch or replace lifecycle ACKs.
|
|
193
|
+
The terminal native receipt is persisted with the existing private machine
|
|
194
|
+
journal, including when the caller disconnects. Recovery reads the original
|
|
195
|
+
receipt and never resumes a model on its own.
|
|
196
|
+
|
|
197
|
+
Only native parent relations, collaboration items and sub-agent activity items
|
|
198
|
+
establish ownership. Foreign-thread text/usage cannot become a child result or
|
|
199
|
+
root completion. Child approval requests are handled by the same unattended
|
|
200
|
+
approval policy, and only for a known child turn. Unknown requests do not receive
|
|
201
|
+
an expanded permission grant. A child `thread/started` received before the root
|
|
202
|
+
response is buffered with its nested thread identity; its ancestry is replayed
|
|
203
|
+
after the root becomes known before routing later child requests.
|
|
204
|
+
|
|
205
|
+
`native.usage.strategy` is `per-thread`, and its `scope` is `observed-children`.
|
|
206
|
+
`totalTokens` covers those children only; root usage remains in `outcome.usage`.
|
|
207
|
+
Counters are cumulative snapshots, not increments. Duplicate snapshots do not
|
|
208
|
+
increase spend; a resumed child adopts a historical baseline. Unknown baselines,
|
|
209
|
+
counter anomalies, missing observations or a truncated ledger make aggregation
|
|
210
|
+
partial/unknown. An unfinished child's last attributable snapshot remains
|
|
211
|
+
partial, including after physical cleanup; the snapshot is retained while the
|
|
212
|
+
complete aggregate total stays absent. No observed children is unknown, not
|
|
213
|
+
fabricated zero. The host
|
|
214
|
+
must not add a child snapshot more than once or confuse complete observed-child
|
|
215
|
+
usage with proof that all possible external spend was measured.
|
|
216
|
+
|
|
217
|
+
Late completions and replayed starts for an older child turn cannot replace the
|
|
218
|
+
active turn's identity. Native `failed` turns are terminal, while failure and
|
|
219
|
+
business success remain separate facts; a parent may handle a child failure.
|
|
220
|
+
|
|
221
|
+
Cancellation sends `turn/interrupt` to known running children and the root, then
|
|
222
|
+
uses the existing guardian's bounded process-group cleanup. A root interrupt by
|
|
223
|
+
itself does not prove all children stopped. `native.cleanup.confirmed` is set from
|
|
224
|
+
physical cleanup evidence, not an interrupt response or child completion text.
|
|
225
|
+
Permissions, thread state and configuration must be revalidated on every explicit
|
|
226
|
+
resume. No automatic retry occurs after a possibly dispatched failure.
|
|
227
|
+
|
|
228
|
+
## Verification and primary references
|
|
229
|
+
|
|
230
|
+
The desktop follow-up is validated by GitHub Actions against the actual npm
|
|
231
|
+
Schemastery package, registered plugin tools and real offline app-server child
|
|
232
|
+
processes. React component tests exercise saving, whole-value off/reset,
|
|
233
|
+
validation, read-only forms and revision conflicts. Package tests install the
|
|
234
|
+
real tarball into a clean consumer without DSH peers and exercise its public
|
|
235
|
+
machine API and installed CLI. Local execution was unavailable for this follow-up;
|
|
236
|
+
these checks do not claim an installed desktop or authenticated model run.
|
|
237
|
+
|
|
238
|
+
Earlier machine-capability offline tests exercise actual child processes for config mismatch before dispatch,
|
|
239
|
+
early child events, child approvals, deduplicated/replayed usage, cancellation,
|
|
240
|
+
fresh native review, supervisor delivery and the built installed npm package.
|
|
241
|
+
The package remains a source candidate until separately published. This change
|
|
242
|
+
does not claim an authenticated live-model/desktop acceptance run. During the earlier machine-capability review, a zero-model probe of
|
|
243
|
+
`codex-cli 0.167.0-alpha.4` could read CLI help but timed out at the configuration
|
|
244
|
+
handshake. That historical probe is not a new desktop follow-up execution; no
|
|
245
|
+
model turn was sent.
|
|
246
|
+
|
|
247
|
+
Implementation contracts were checked against OpenAI's fixed source
|
|
248
|
+
[`7924f95421a326bb66426a3ce232b72550948470`](https://github.com/openai/codex/tree/7924f95421a326bb66426a3ce232b72550948470):
|
|
249
|
+
|
|
250
|
+
- [Native config schema](https://github.com/openai/codex/blob/7924f95421a326bb66426a3ce232b72550948470/codex-rs/core/config.schema.json)
|
|
251
|
+
- [Backend precedence and caps](https://github.com/openai/codex/blob/7924f95421a326bb66426a3ce232b72550948470/codex-rs/core/src/config/mod.rs)
|
|
252
|
+
- [Typed child items](https://github.com/openai/codex/blob/7924f95421a326bb66426a3ce232b72550948470/codex-rs/app-server-protocol/schema/typescript/v2/ThreadItem.ts)
|
|
253
|
+
- [Review endpoint](https://github.com/openai/codex/blob/7924f95421a326bb66426a3ce232b72550948470/codex-rs/app-server-protocol/schema/typescript/v2/ReviewStartParams.ts)
|
|
254
|
+
- [Native review restrictions](https://github.com/openai/codex/blob/7924f95421a326bb66426a3ce232b72550948470/codex-rs/core/src/tasks/review.rs)
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# Codex 原生能力与桌面插件(0.10.0 源码候选)
|
|
2
|
+
|
|
3
|
+
[English](native-capabilities.md) | 中文
|
|
4
|
+
|
|
5
|
+
本包继续启动用户已经安装、登录的 Codex app-server。它不创建另一套账号、
|
|
6
|
+
计费入口或 DSH 子 Agent 运行时。外层 DSH 可以通过 PTC 生成的工具 SDK
|
|
7
|
+
调用插件;内层的 Agent、工具、审批、上下文与 Review 仍由 Codex 原生
|
|
8
|
+
harness 执行。PTC 与原生能力属于不同层,可以同时使用;本次没有另建
|
|
9
|
+
PTC executor,也不声称未经测量的性能提升。
|
|
10
|
+
|
|
11
|
+
## 在插件里设置默认能力
|
|
12
|
+
|
|
13
|
+
在 DSH「插件」页面打开本 bundle,再配置 `codex-pro` 行。页面提供:
|
|
14
|
+
|
|
15
|
+
- 继承配置:删除用户层的 `native` 覆盖;如果基础配置也没有设置,则保留
|
|
16
|
+
Codex CLI 自己的默认行为。
|
|
17
|
+
- 全部关闭:保存 `native:null`,明确关闭两个 Agent 后端。
|
|
18
|
+
- 启用原生 Agent:设置并发子线程上限、子 Agent 默认模型、默认思考等级,
|
|
19
|
+
以及是否明确选择 V2 后端。
|
|
20
|
+
|
|
21
|
+
插件导出真正的 Schemastery `Config`,`native` 为 volatile 字段。每次调用
|
|
22
|
+
开始读取一次 `.get()` 快照;保存后无需重载插件,已经开始的任务不被中途
|
|
23
|
+
改写。其他已有插件参数仍沿用原来的重载语义。页面底部展示实际生效值,
|
|
24
|
+
区分“用户层未覆盖”和“显式关闭”。
|
|
25
|
+
|
|
26
|
+
浏览器入口注册官方 `plugins.row.config`,使用 DSH 共享的 React,不打包
|
|
27
|
+
另一套 React。保存通过 owner form 的
|
|
28
|
+
`mutate([{op:"set",path:["native"],value}], capturedRevision)` 原子写入整个
|
|
29
|
+
native 值;继承用 `unset`。它不深合并旧配置,所以关闭不会保存并发、子模型
|
|
30
|
+
或 backend 残留。不可写/未就绪时禁止保存;遇到版本冲突保留草稿及编辑起点
|
|
31
|
+
revision,只有明确点“重新载入”才丢弃编辑。
|
|
32
|
+
|
|
33
|
+
也可以在配置中设置:
|
|
34
|
+
|
|
35
|
+
```yaml
|
|
36
|
+
native:
|
|
37
|
+
version: 1
|
|
38
|
+
agents:
|
|
39
|
+
enabled: true
|
|
40
|
+
maxConcurrentThreads: 3
|
|
41
|
+
defaultModel: your-worker-model
|
|
42
|
+
defaultEffort: high
|
|
43
|
+
backend: v2
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 单次委派与默认值覆盖
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
const result = await tools.subagent_codex({
|
|
50
|
+
description: "实现独立模块",
|
|
51
|
+
prompt: "完成需求;将能够独立验证的工作交给原生子 Agent。",
|
|
52
|
+
native: {
|
|
53
|
+
version: 1,
|
|
54
|
+
agents: { enabled: true, maxConcurrentThreads: 3, backend: "v2" },
|
|
55
|
+
},
|
|
56
|
+
})
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
DSH 普通工具执行与 PTC 使用同一个注册工具及运行实现。
|
|
60
|
+
|
|
61
|
+
| 单次参数 | 行为 |
|
|
62
|
+
| --- | --- |
|
|
63
|
+
| 不传 `native` | 使用调用开始时的插件默认;插件未设则继承 CLI 默认。 |
|
|
64
|
+
| `native:null` | 显式关闭,不是回到默认。 |
|
|
65
|
+
| version 1 对象 | 整体替换默认,不逐字段合并。 |
|
|
66
|
+
| `agents:{enabled:false}` | 显式关闭,拒绝同时携带其他 Agent 字段。 |
|
|
67
|
+
| 对象存在但省略 `agents` | 也会显式关闭 Agent。 |
|
|
68
|
+
|
|
69
|
+
桌面的 `null` 是插件便利写法,进入共享协议前规范化为
|
|
70
|
+
`{version:1,agents:{enabled:false}}`。公开 machine API 的协议仍要求版本化
|
|
71
|
+
对象,不接受这个桌面简写。
|
|
72
|
+
|
|
73
|
+
未知 native 字段、未知工具参数、非法并发以及 disabled 的残留参数,在启动
|
|
74
|
+
进程前报错。即使调用者绕过 DSH 的 JSON Schema 校验,也不会被静默忽略。
|
|
75
|
+
`modelSelection:false` 允许用户在设置页配置的子模型/effort 默认值正常使用;
|
|
76
|
+
单次启用对象必须保持相同选择,包括字段是否省略。新增、改写或通过整体替换
|
|
77
|
+
清空这些选择都需要用户修改插件配置;显式关闭仍允许。
|
|
78
|
+
|
|
79
|
+
`maxConcurrentThreads` 限制同时打开的子线程数量,不是累计 spawn 次数、token
|
|
80
|
+
或费用预算。V2 内部计数包含根线程,所以明确选择 V2 时写入 `N+1`。
|
|
81
|
+
不写 backend 保留原生后端选择;继承的 V2 配置若与请求上限冲突,配置验证会失败。
|
|
82
|
+
不声称关闭某个 V2 特性就能强制任意模型走 V1。
|
|
83
|
+
|
|
84
|
+
普通原生子 Agent 继续使用 Codex 配置的工具、MCP、角色和模型行为;本插件不把
|
|
85
|
+
它们替换成受限帮助工具。子模型与 effort 字段是默认值,不是 Codex 原生模型
|
|
86
|
+
allowlist。根线程的 sandbox/审批边界仍由插件配置决定,调用方只能收窄权限;
|
|
87
|
+
`native` 不授予额外的文件、进程或网络权限。
|
|
88
|
+
|
|
89
|
+
## Host provider 与会话复用
|
|
90
|
+
|
|
91
|
+
最新 DSH `SubagentStartRequest` 的 `agentOptions` 是 Host 的 provider、
|
|
92
|
+
model、reasoningEffort、maxTokens 语义,没有通用的 providerOptions/native
|
|
93
|
+
字段。Codex provider 读取插件相同的动态 native 默认值,并支持它能够兑现的
|
|
94
|
+
model/effort;不支持的有值参数明确拒绝。合法但显式为 undefined 的可选字段不
|
|
95
|
+
阻止启动。需要单次 native 覆盖时,使用专用 `subagent_codex` 工具或 machine API。
|
|
96
|
+
|
|
97
|
+
`threadMode:session` 的隐式复用绑定 native 策略、根模型、effort、权限与 cwd。
|
|
98
|
+
其中任一值改变,下一次隐式调用新建线程,避免已有会话掩盖设置变化。显式
|
|
99
|
+
`thread_id` 继续支持,包括外部创建的线程;每次都重新应用并验证请求配置。
|
|
100
|
+
显式恢复失败会报告错误,不会悄悄换成新线程。可能已经派发的任务不会自动重跑。
|
|
101
|
+
|
|
102
|
+
## 独立原生 Review
|
|
103
|
+
|
|
104
|
+
```js
|
|
105
|
+
await tools.subagent_codex_review({
|
|
106
|
+
description: "检查分支变更",
|
|
107
|
+
target: { type: "baseBranch", branch: "main" },
|
|
108
|
+
model: "your-review-model",
|
|
109
|
+
reasoning_effort: "high",
|
|
110
|
+
})
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
这是单独的、每次明确请求的操作。工具只接受 description、target、cwd、
|
|
114
|
+
timeout,以及被允许的 model/effort、后台执行选项。它固定:
|
|
115
|
+
|
|
116
|
+
- 新的临时线程,不继续实现者的历史。
|
|
117
|
+
- read-only sandbox、approvals=never、agents off。
|
|
118
|
+
- 在验证新线程后调用 `review/start`,inline 结果必须对应同一线程。
|
|
119
|
+
|
|
120
|
+
target 支持 `uncommittedChanges`、携带 branch 的 `baseBranch`、携带 sha 和
|
|
121
|
+
可选 title 的 `commit`、携带 instructions 的 `custom`。工具不接收普通 prompt、
|
|
122
|
+
native、thread_id/thread_mode、图片或 output_schema,因此没有被静默丢弃的
|
|
123
|
+
任务语义。插件默认值与普通工具里的 `native.review` 都会被拒绝。
|
|
124
|
+
|
|
125
|
+
Codex 原生 Review 自身禁用 collaboration、图片查看与 web search。需要原生
|
|
126
|
+
多 Agent 参与审查、图片或结构化 verdict 时,使用独立的普通委派并明确 prompt
|
|
127
|
+
与 schema。Review 输出是审查证据,不自动等同于 Host 审批或通过验证的
|
|
128
|
+
结构化决策。底层 machine Review 的兼容 prompt 字段不会作为普通 turn 提交,
|
|
129
|
+
实际审查语义来自 target;桌面专用工具则完全不暴露这个兼容字段。
|
|
130
|
+
|
|
131
|
+
## 回执、用量与终态
|
|
132
|
+
|
|
133
|
+
| 入口 | 答案与证据 |
|
|
134
|
+
| --- | --- |
|
|
135
|
+
| 前台 / PTC 工具 | `{content,native}`:完整原生回执单独保存;答案正文保持不变,render 保留图片附件并另附有界元数据块。 |
|
|
136
|
+
| 后台 job | 有原生证据时,result 为 JSON 字符串 `{text,threadId,native}`;没有原生控制时保留原来的纯文本。失败 job 也保留已获得的 native 回执。 |
|
|
137
|
+
| Host provider | 保持官方 output/structured 形状;diagnostic 与插件日志记录有界摘要,不虚构 Host 扩展字段。 |
|
|
138
|
+
| machine API | 完整原生回执、事件回调及原有私有恢复 journal。 |
|
|
139
|
+
|
|
140
|
+
Host 摘要包含配置是否匹配、completion/cleanup、pending 数量与截短标记、
|
|
141
|
+
子线程状态计数、用量范围/状态和事件截断。它不冒充完整事件账本;需要全部
|
|
142
|
+
子线程身份与事件时使用专用工具或 machine API。结构化答案不会被 thread marker、
|
|
143
|
+
native JSON 或调试前后缀污染。
|
|
144
|
+
|
|
145
|
+
原生回执记录 requested、effective、observed、children、usage、completion、
|
|
146
|
+
cleanup。只有可信原生父子关系、协作 item 与子 Agent 活动才能建立 ownership;
|
|
147
|
+
无关线程的消息不能冒充根答案或子线程用量。父线程 id 尚未到达时,早到的子线程
|
|
148
|
+
来源会暂存,根身份确认后再关联。
|
|
149
|
+
|
|
150
|
+
`native.usage` 统计观察到的子线程,根线程用量仍在 `outcome.usage`。累计快照
|
|
151
|
+
不是增量;重复快照不重复计费,恢复线程保留历史基线。未知基线、异常计数、
|
|
152
|
+
缺失观察或截断账本会使统计成为 partial/unknown。没有观察到子线程不是零费用
|
|
153
|
+
证明。尚未完成的子线程即使已有 token 快照,也不能被宣称为完整终态用量。
|
|
154
|
+
|
|
155
|
+
根线程发出 final answer 仍不够:原生配置未确认、已观察子线程仍未终结、或
|
|
156
|
+
实际进程清理未确认,都会导致失败。原生 child failed 是“已终结”事实,不自动
|
|
157
|
+
等同于父任务业务失败;父任务可能已经处理了这个失败。
|
|
158
|
+
|
|
159
|
+
取消向已知运行中的子 turn 和根 turn 发送 interrupt,然后通过 guardian 有界清理
|
|
160
|
+
整个本地进程组。收到 interrupt 回复不等于已经清理;cleanup 以物理进程证据为准。
|
|
161
|
+
完整 machine 终态随现有 journal 保存,读取恢复记录不会自动启动新模型。
|
|
162
|
+
|
|
163
|
+
## 验证范围
|
|
164
|
+
|
|
165
|
+
本轮本地执行环境不可用,实际验证在 GitHub Actions 的 Node 22/24、
|
|
166
|
+
Ubuntu/macOS 矩阵完成。测试使用真正 npm 发布的 Schemastery,真实注册的
|
|
167
|
+
插件工具/Host provider 到独立 app-server fixture 子进程的整条路径,以及真实
|
|
168
|
+
React 组件的保存、关闭、继承、校验、只读与 revision 冲突交互。打包测试安装
|
|
169
|
+
真实 tarball,在没有 DSH peer 的干净消费者中验证公开 machine API、CLI 与
|
|
170
|
+
supervisor,并检查浏览器入口确实包含在包中。
|
|
171
|
+
|
|
172
|
+
这些是离线协议、组件和包验证,不是用户已安装 DSH 桌面端或真实付费模型验收。
|
|
173
|
+
版本保持未发布的 0.10.0 candidate。更早的 native machine 测试与 CLI 零模型探测
|
|
174
|
+
历史记录见[英文契约的验证部分](native-capabilities.md#verification-and-primary-references),
|
|
175
|
+
不将旧测试算作本轮新执行。
|
|
176
|
+
|
|
177
|
+
DSH 配置/页面契约以
|
|
178
|
+
[39163dd](https://github.com/deepseek-ai/deepseek-harness/tree/39163dd30f703a79079e2d2446545cff3c453738)
|
|
179
|
+
的 settings、subagent/types 与 ui-plugin-manager slot-contract 为依据;
|
|
180
|
+
Codex 原生协议依据与具体文件链接列于[英文契约](native-capabilities.md#verification-and-primary-references)。
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** The real Host settings schema. Only native defaults are edited without remounting. */
|
|
2
|
+
import z from '@deepseek-ai/schemastery';
|
|
3
|
+
/** Schemastery objects/arrays default to empty values; omission here means inheritance. */
|
|
4
|
+
function optional(schema) {
|
|
5
|
+
delete schema.meta.default;
|
|
6
|
+
return schema;
|
|
7
|
+
}
|
|
8
|
+
// Start from any(): validating an object schema first can strip unknown fields
|
|
9
|
+
// in a transform. This callback must be self-contained because the Host sends
|
|
10
|
+
// its serialized schema to the browser for the same validation there.
|
|
11
|
+
const native = z.transform(z.any(), (value) => {
|
|
12
|
+
if (value === undefined || value === null)
|
|
13
|
+
return value;
|
|
14
|
+
const object = (v) => v !== null && typeof v === 'object' && !Array.isArray(v);
|
|
15
|
+
const keys = (v, allowed) => Object.keys(v).every(key => allowed.includes(key));
|
|
16
|
+
const text = (v) => typeof v === 'string' && v.trim() !== ''
|
|
17
|
+
&& !v.includes('\0') && new TextEncoder().encode(v).byteLength <= 65536;
|
|
18
|
+
if (!object(value) || value.version !== 1 || !keys(value, ['version', 'agents'])) {
|
|
19
|
+
throw new Error('invalid native capability version or fields; review uses subagent_codex_review');
|
|
20
|
+
}
|
|
21
|
+
const agents = value.agents;
|
|
22
|
+
if (agents !== undefined) {
|
|
23
|
+
if (!object(agents) || !keys(agents, ['enabled', 'maxConcurrentThreads', 'defaultModel', 'defaultEffort', 'backend'])
|
|
24
|
+
|| typeof agents.enabled !== 'boolean')
|
|
25
|
+
throw new Error('native.agents requires an explicit enabled boolean and known fields');
|
|
26
|
+
if (agents.maxConcurrentThreads !== undefined && (!Number.isSafeInteger(agents.maxConcurrentThreads)
|
|
27
|
+
|| Number(agents.maxConcurrentThreads) < 1 || Number(agents.maxConcurrentThreads) >= Number.MAX_SAFE_INTEGER)) {
|
|
28
|
+
throw new Error('native concurrency must be a positive safe integer with room for the root');
|
|
29
|
+
}
|
|
30
|
+
for (const field of ['defaultModel', 'defaultEffort']) {
|
|
31
|
+
if (agents[field] !== undefined && !text(agents[field]))
|
|
32
|
+
throw new Error('invalid native agents ' + field);
|
|
33
|
+
}
|
|
34
|
+
if (agents.backend !== undefined && agents.backend !== 'v2')
|
|
35
|
+
throw new Error('invalid native agent backend');
|
|
36
|
+
if (agents.enabled === false && Object.keys(agents).length !== 1)
|
|
37
|
+
throw new Error('disabled agents cannot have active controls');
|
|
38
|
+
}
|
|
39
|
+
return value;
|
|
40
|
+
}).description('Native agent defaults. Unset inherits Codex CLI defaults; null explicitly turns agents off. Review is a separate explicit tool.').volatile();
|
|
41
|
+
/** Exported as Config by the plugin, so DSH derives an editable live settings form. */
|
|
42
|
+
export const ConfigSchema = z.object({
|
|
43
|
+
providerName: z.string(),
|
|
44
|
+
command: z.string(),
|
|
45
|
+
model: z.string(),
|
|
46
|
+
reasoningEffort: z.string(),
|
|
47
|
+
modelSelection: z.boolean(),
|
|
48
|
+
permissionMode: z.union(['read-only', 'workspace-write', 'never', 'approve-for-me', 'dangerously-bypass-approvals-and-sandbox']),
|
|
49
|
+
env: optional(z.dict(z.string())),
|
|
50
|
+
presets: optional(z.array(z.string())),
|
|
51
|
+
threadMode: z.union(['ephemeral', 'persistent', 'session']),
|
|
52
|
+
runTimeoutMs: z.natural(),
|
|
53
|
+
originator: z.string(),
|
|
54
|
+
native,
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"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"}
|