@deepseek-ai/dsh-experimental-subagent-oar 0.0.0-stage → 0.2.2-alpha.3

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DeepSeek
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.
package/LICENSE-OAR ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,67 @@
1
+ # Bilingual-pair consistency record for README.md (docs/i18n/README.md): per heading
2
+ # section, a hash of its English and Chinese blocks outside code blocks and generated regions.
3
+ # After editing either side, bring the other along and re-record with:
4
+ # pnpm run verify-translation-pairing --write packages/experimental/subagent-oar/README.md
5
+ /:
6
+ en: e2a966cf2f6d7f5f
7
+ zh: e19b979aeef0d29a
8
+ /deepseek-ai-dsh-experimental-subagent-oar:
9
+ en: fef097906f8c0a35
10
+ zh: 3fb2737b8974edc0
11
+ /deepseek-ai-dsh-experimental-subagent-oar/summary:
12
+ en: 75bc60daa998f16a
13
+ zh: 31f09b5ed600232d
14
+ /deepseek-ai-dsh-experimental-subagent-oar/table-of-contents:
15
+ en: d152484eb41ac6b4
16
+ zh: 8d1e20b826450ffe
17
+ /deepseek-ai-dsh-experimental-subagent-oar/use-this-package:
18
+ en: bbff250eba0f1b89
19
+ zh: 0a618f05cc88ee2b
20
+ /deepseek-ai-dsh-experimental-subagent-oar/use-this-package/compose-a-profile:
21
+ en: 60804c44d0c2bb40
22
+ zh: 74471620c96b8c78
23
+ /deepseek-ai-dsh-experimental-subagent-oar/use-this-package/what-you-get:
24
+ en: e4b715738e3f238d
25
+ zh: 0c6d561b99d4b07e
26
+ /deepseek-ai-dsh-experimental-subagent-oar/use-this-package/configure-a-runtime-instance:
27
+ en: cfc28b43567604a6
28
+ zh: 04ef0d698c3b47f7
29
+ /deepseek-ai-dsh-experimental-subagent-oar/understand-the-implementation:
30
+ en: 19b537fd24aa1dfd
31
+ zh: fee12542bb2fc1a6
32
+ /deepseek-ai-dsh-experimental-subagent-oar/further-exploration:
33
+ en: 089fe63b9b457247
34
+ zh: 482382e68e5c4e2e
35
+ /deepseek-ai-dsh-experimental-subagent-oar/model-experience:
36
+ en: 215e7ba838619b7b
37
+ zh: a311da3843709f90
38
+ /deepseek-ai-dsh-experimental-subagent-oar/model-experience/child-request:
39
+ en: 1796fa78833bfc2b
40
+ zh: b78af12284632249
41
+ /deepseek-ai-dsh-experimental-subagent-oar/model-experience/child-request/what-the-model-sees:
42
+ en: 16dd6345fbe5b557
43
+ zh: adbd8e9b2f4d247f
44
+ /deepseek-ai-dsh-experimental-subagent-oar/model-experience/child-request/token-effect:
45
+ en: 51b1a72453170ef9
46
+ zh: 521ff4e9e9a84186
47
+ /deepseek-ai-dsh-experimental-subagent-oar/model-experience/child-request/kv-cache-effect:
48
+ en: 26a77ed7165e7414
49
+ zh: 61d802041b7663c6
50
+ /deepseek-ai-dsh-experimental-subagent-oar/model-experience/parent-results-indirectly:
51
+ en: cc55ad2a7e04a064
52
+ zh: e7d3d72a5b1e80e3
53
+ /deepseek-ai-dsh-experimental-subagent-oar/model-experience/parent-results-indirectly/what-the-model-sees:
54
+ en: 2d1cdcc92211fdec
55
+ zh: 016169e5fb65eb86
56
+ /deepseek-ai-dsh-experimental-subagent-oar/model-experience/parent-results-indirectly/token-effect:
57
+ en: 99d04595c61a32fc
58
+ zh: 47f6253729070269
59
+ /deepseek-ai-dsh-experimental-subagent-oar/model-experience/parent-results-indirectly/kv-cache-effect:
60
+ en: ba649995f08b9e09
61
+ zh: a153047f0c25645a
62
+ /deepseek-ai-dsh-experimental-subagent-oar/known-limitations-and-deferred-work:
63
+ en: 8eec39a3eb58a185
64
+ zh: 68feb7901d4b50b9
65
+ /deepseek-ai-dsh-experimental-subagent-oar/known-limitations-and-deferred-work/dev-note:
66
+ en: e67f633dc6fe7773
67
+ zh: 8ec3e73528ddb1a6
package/README.md CHANGED
@@ -1,3 +1,174 @@
1
- # Temporary Holding Version
1
+ ---
2
+ description: "Add experimental one-shot coding-agent delegation through OAR with per-call runtime selection."
3
+ kind: "package-reference"
4
+ ---
2
5
 
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.
6
+ # @deepseek-ai/dsh-experimental-subagent-oar
7
+
8
+ English | [中文](README.zh.md)
9
+
10
+ ## Summary
11
+
12
+ Compose this experimental provider with the `subagent_oar` tool to delegate standalone text tasks to Codex and Claude Code in the selected workspace. The provider embeds the OAR library, so no separate OAR CLI installation is required. Codex and Claude Code use their installed native CLIs, authentication, and settings.
13
+
14
+ ## Table of Contents
15
+
16
+ - [Use this package](#use-this-package)
17
+ - [Understand the implementation](#understand-the-implementation)
18
+ - [Further Exploration](#further-exploration)
19
+ - [Model Experience](#model-experience)
20
+ - [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
21
+ - [Dev Note](#dev-note)
22
+
23
+ -----
24
+
25
+ <a id="use-this-package"></a>
26
+ ## Use this package
27
+
28
+ ### Compose a profile
29
+
30
+ Install and authenticate the native Codex and Claude Code CLIs before delegating to them. Their executables must be available to the DSH Host. The provider starts no native session until a delegation is accepted.
31
+
32
+ Declare this provider and `@deepseek-ai/dsh-experimental-tool-subagent-oar` as dependencies of your composition, then add these rows through a profile patch:
33
+
34
+ ```yaml
35
+ - insert:
36
+ - id: experimental-subagent-oar-codex
37
+ name: '@deepseek-ai/dsh-experimental-subagent-oar'
38
+ config:
39
+ runtime: codex
40
+ providerName: oar-codex
41
+ launchArgs:
42
+ - -c
43
+ - sandbox_mode="workspace-write"
44
+ - id: experimental-subagent-oar-claude
45
+ name: '@deepseek-ai/dsh-experimental-subagent-oar'
46
+ config:
47
+ runtime: claude
48
+ providerName: oar-claude
49
+ launchArgs:
50
+ - --permission-mode
51
+ - dontAsk
52
+ - --permission-prompts
53
+ - none
54
+ - id: tool-subagent-oar
55
+ name: '@deepseek-ai/dsh-experimental-tool-subagent-oar'
56
+ config:
57
+ providers:
58
+ codex: oar-codex
59
+ claude: oar-claude
60
+ ```
61
+
62
+ Launch the completed composition through a `dsh` profile. The example assigns each provider a distinct name and fixes its native permission arguments before the model can delegate work.
63
+
64
+ ### What you get
65
+
66
+ The separate [`subagent_oar` tool](../tool-subagent-oar/README.md) selects a configured runtime for each call. Its package documents the arguments and parent-facing notices.
67
+
68
+ | `runtime` | Provider | Native permissions in the example |
69
+ |---|---|---|
70
+ | `codex` | `oar-codex` | Codex `workspace-write` sandbox; no approval prompts |
71
+ | `claude` | `oar-claude` | Claude Code `dontAsk`; permission prompts disabled |
72
+
73
+ Each delegation starts one native session for one text task. The parent Session retains the external task identity and terminal result; this provider creates no DSH child Session and exposes no follow-up or resume operation.
74
+
75
+ ### Configure a runtime instance
76
+
77
+ Each provider instance selects one OAR runtime and registers a unique `providerName`. To expose another runtime, add its provider row and extend the [external tool's provider mapping](../tool-subagent-oar/README.md#use-this-package). Later profile layers can override these configurations. An unknown OAR runtime id fails when its provider loads.
78
+
79
+ | Field | Default | Meaning |
80
+ |---|---|---|
81
+ | `runtime` | required | Runtime id in OAR's default registry |
82
+ | `providerName` | `oar` | Name registered with the DSH subagent service |
83
+ | `model` | native settings | Optional native model selection |
84
+ | `effort` | native settings | Optional native reasoning effort, where supported by the runtime |
85
+ | `launchArgs` | `[]` | Native runtime arguments, including permission settings |
86
+ | `env` | `{}` | Explicit environment overrides after ambient credential and DSH-variable scrubbing; `null` removes a variable |
87
+ | `timeoutMs` | none | Optional turn deadline after startup; omission uses parent cancellation only |
88
+
89
+ For Claude, select the native permission mode explicitly in `launchArgs` and retain `--permission-prompts none` for unattended work. A Claude instance with no permission-mode argument inherits OAR's permission bypass default. Replacing the example's argument array also replaces its explicit permission settings.
90
+
91
+ The [configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-experimental-subagent-oar) owns accepted fields and validation. A child that needs an API credential from an environment variable must receive it through `env`; native account files remain available through the native runtime's settings.
92
+
93
+ OAR's pinned default registry includes `antigravity`, `claude`, `codex`, `grok`, `kimi`, `opencode`, and `pi`. Provider configuration accepts every registered runtime id. Codex and Claude have native e2e coverage. Other runtimes need an explicit provider and tool mapping and remain unverified.
94
+
95
+ -----
96
+
97
+ <a id="understand-the-implementation"></a>
98
+ ## Understand the implementation
99
+
100
+ <details>
101
+ <summary>Implementation internals — click to expand</summary>
102
+
103
+ The example mounts two instances of the same provider and the [external delegation tool](../tool-subagent-oar/README.md). [`src/index.ts`](src/index.ts) registers providers; the tool package owns runtime selection and task presentation. The provider uses OAR's runtime registry and session API for startup, one prompt, answer collection, cancellation, and disposal. OAR owns native processes; these sessions do not use the DSH subprocess provider.
104
+
105
+ The dependency patch applies environment overrides to native installation probes. It permits Claude's explicit `--permission-mode` and suppresses OAR's forced permission bypass when that argument is present. The example passes `--permission-mode dontAsk --permission-prompts none`. Codex receives `-c sandbox_mode="workspace-write"`. OAR sets Codex approval policy to `never`. Neither path forwards native approval requests to a DSH interaction UI. Codex startup failure stops app-server and waits for its exit, including a response without a thread id.
106
+
107
+ Only root assistant text contributes to the answer. When OAR supplies message ids, the last nonempty message is selected; otherwise root text is concatenated. Native reasoning, tool events, and transcript history do not enter the parent Session. Native history follows the selected runtime's own persistence behavior. Provider errors retain native causes for local debugging; default logs emit only safe stage and category summaries because native causes can contain credentials.
108
+
109
+ </details>
110
+
111
+ -----
112
+
113
+ <a id="further-exploration"></a>
114
+ ## Further Exploration
115
+
116
+ - [Experimental packages](../README.md) — experimental status and optional delivery.
117
+ - [Subagent service](../../subagent/subagent/README.md) — provider lifecycle and terminal results.
118
+ - [OAR subagent tool](../tool-subagent-oar/README.md) — runtime selection and parent-facing behavior.
119
+ - [Subagent subsystem](../../../docs/subsystems/subagent.md) — parent scheduling and completion notices.
120
+ - [Architecture](../../../docs/architecture.md) — profile layer composition.
121
+
122
+ -----
123
+
124
+ <a id="model-experience"></a>
125
+ ## Model Experience
126
+
127
+ ### Child request
128
+
129
+ #### What the model sees
130
+
131
+ The selected native runtime receives the text from `prompt` with `cwd` set to the resolved child directory. Its own model, tools, configuration, and history determine the child request; instance configuration supplies any model, effort, arguments, and environment overrides.
132
+
133
+ #### Token effect
134
+
135
+ The native runtime pays for an independent context and turn. Child reasoning and tool traffic are not added to the parent context.
136
+
137
+ #### KV Cache effect
138
+
139
+ The child request is independent of the parent's cached prefix. Native runtime behavior determines child cache reuse.
140
+
141
+ ### Parent results, indirectly
142
+
143
+ #### What the model sees
144
+
145
+ Through the [external subagent tool](../tool-subagent-oar/README.md#model-experience), the parent receives this provider's selected root answer or failure notice. The consumer owns the tool schema and acknowledgement.
146
+
147
+ #### Token effect
148
+
149
+ The terminal notice adds the selected answer or failure detail to the parent context.
150
+
151
+ #### KV Cache effect
152
+
153
+ Provider results append through the shared subagent service. The [consumer](../tool-subagent-oar/README.md#model-experience) owns tool-schema changes that affect the parent's cached prefix.
154
+
155
+ ## Known Limitations and Deferred Work
156
+
157
+ <a id="known-limitations-and-deferred-work"></a>
158
+
159
+ - **Experimental runtime coverage:** only Codex and Claude Code have native e2e coverage. Other registered runtimes can be selected but have not been validated by DSH.
160
+ - **Native setup:** this provider does not install, authenticate, or upgrade native agents. Missing executables and native configuration failures surface when delegation starts.
161
+ - **Unattended permissions:** native permission modes apply without a DSH approval UI. Claude needs a CLI version that supports `--permission-prompts none`; the provider does not expose a tool-restriction feature. OAR records unexpected Codex approval or user-input requests without answering them. If the runtime waits, cancel the task or configure `timeoutMs`.
162
+ - **Startup cancellation:** OAR does not expose immediate cancellation while a session is opening. Cancellation waits for that operation and disposes a late session; an explicitly configured `timeoutMs` starts only after opening succeeds.
163
+ - **Process and history ownership:** OAR handles native processes, and native runtimes can retain transcripts. DSH does not apply its subprocess sandbox or managed descendant cleanup to those processes.
164
+ - **One-shot text:** no continuation, resume, structured output, progress stream, or side-effect rollback is provided. Native changes made before cancellation remain in place.
165
+
166
+ <a id="dev-note"></a>
167
+ ### Dev Note
168
+
169
+ <details>
170
+ <summary>Working context for maintainers — click to expand</summary>
171
+
172
+ None.
173
+
174
+ </details>
package/README.zh.md ADDED
@@ -0,0 +1,174 @@
1
+ ---
2
+ description: "通过 OAR 添加实验性单次编程智能体委派,并允许每次调用选择运行时。"
3
+ kind: "package-reference"
4
+ ---
5
+
6
+ # @deepseek-ai/dsh-experimental-subagent-oar
7
+
8
+ [English](README.md) | 中文
9
+
10
+ ## 概述
11
+
12
+ 将此实验性提供方与 `subagent_oar` 工具组合,即可在选定的工作区中向 Codex 和 Claude Code 委派独立文本任务。提供方内嵌 OAR 库,因此无需单独安装 OAR CLI。Codex 和 Claude Code 使用已安装的原生 CLI、认证和设置。
13
+
14
+ ## 目录
15
+
16
+ - [使用本包](#use-this-package)
17
+ - [理解实现](#understand-the-implementation)
18
+ - [延伸阅读](#further-exploration)
19
+ - [模型体验](#model-experience)
20
+ - [已知限制与待完善事项](#known-limitations-and-deferred-work)
21
+ - [开发备注](#dev-note)
22
+
23
+ -----
24
+
25
+ <a id="use-this-package"></a>
26
+ ## 使用本包
27
+
28
+ ### 组合 Profile
29
+
30
+ 委派前,请先安装并认证原生 Codex 和 Claude Code CLI。DSH Host 必须能访问它们的可执行文件。提供方在接受委派之前不会启动原生会话。
31
+
32
+ 在组合中将此提供方和 `@deepseek-ai/dsh-experimental-tool-subagent-oar` 声明为依赖,然后通过 Profile 补丁添加这些行:
33
+
34
+ ```yaml
35
+ - insert:
36
+ - id: experimental-subagent-oar-codex
37
+ name: '@deepseek-ai/dsh-experimental-subagent-oar'
38
+ config:
39
+ runtime: codex
40
+ providerName: oar-codex
41
+ launchArgs:
42
+ - -c
43
+ - sandbox_mode="workspace-write"
44
+ - id: experimental-subagent-oar-claude
45
+ name: '@deepseek-ai/dsh-experimental-subagent-oar'
46
+ config:
47
+ runtime: claude
48
+ providerName: oar-claude
49
+ launchArgs:
50
+ - --permission-mode
51
+ - dontAsk
52
+ - --permission-prompts
53
+ - none
54
+ - id: tool-subagent-oar
55
+ name: '@deepseek-ai/dsh-experimental-tool-subagent-oar'
56
+ config:
57
+ providers:
58
+ codex: oar-codex
59
+ claude: oar-claude
60
+ ```
61
+
62
+ 通过 `dsh` Profile 启动完成后的组合。此示例为每个提供方分配不同名称,并在模型可以委派任务之前固定原生权限参数。
63
+
64
+ ### 提供的能力
65
+
66
+ 独立的 [`subagent_oar` 工具](../tool-subagent-oar/README.zh.md)为每次调用选择已配置的运行时。其包文档定义参数和父智能体可见的通知。
67
+
68
+ | `runtime` | 提供方 | 示例中的原生权限 |
69
+ |---|---|---|
70
+ | `codex` | `oar-codex` | Codex `workspace-write` 沙箱;不弹出审批提示 |
71
+ | `claude` | `oar-claude` | Claude Code `dontAsk`;禁用权限提示 |
72
+
73
+ 每次委派都会启动一个原生会话,执行一个文本任务。父 Session 保留外部任务标识和最终结果;此提供方不创建 DSH 子 Session,也不提供后续输入或恢复操作。
74
+
75
+ ### 配置运行时实例
76
+
77
+ 每个提供方实例选择一个 OAR 运行时,并注册唯一的 `providerName`。要暴露另一个运行时,请添加提供方行并扩展[外部工具的提供方映射](../tool-subagent-oar/README.zh.md#use-this-package)。后续 Profile 层可以覆盖这些配置。未知 OAR 运行时 id 会在其提供方加载时失败。
78
+
79
+ | 字段 | 默认值 | 含义 |
80
+ |---|---|---|
81
+ | `runtime` | 必填 | OAR 默认注册表中的运行时 id |
82
+ | `providerName` | `oar` | 向 DSH 子智能体服务注册的名称 |
83
+ | `model` | 原生设置 | 可选的原生模型选择 |
84
+ | `effort` | 原生设置 | 可选的原生推理强度,由运行时决定是否支持 |
85
+ | `launchArgs` | `[]` | 原生运行时参数,包括权限设置 |
86
+ | `env` | `{}` | 清理环境中的凭据和 DSH 变量后应用的显式环境覆盖;`null` 移除变量 |
87
+ | `timeoutMs` | 无 | 可选的启动后轮次时限;省略时仅由父会话取消 |
88
+
89
+ 对于 Claude,请在 `launchArgs` 中显式选择原生权限模式,并保留 `--permission-prompts none` 以便无人值守运行。Claude 实例如果不提供权限模式参数,会继承 OAR 默认的权限绕过。替换示例的参数数组也会替换其中显式设置的权限。
90
+
91
+ [配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-experimental-subagent-oar)定义接受的字段和校验规则。如果子进程需要环境变量中的 API 凭据,必须通过 `env` 提供;原生账户文件仍可通过原生运行时设置访问。
92
+
93
+ 固定版本的 OAR 默认注册表包含 `antigravity`、`claude`、`codex`、`grok`、`kimi`、`opencode` 和 `pi`。提供方配置接受每个已注册的运行时 id。Codex 和 Claude 有原生 e2e 覆盖。其他运行时需要显式添加提供方和工具映射,且仍未经验证。
94
+
95
+ -----
96
+
97
+ <a id="understand-the-implementation"></a>
98
+ ## 理解实现
99
+
100
+ <details>
101
+ <summary>实现内部细节 — 点击展开</summary>
102
+
103
+ 此示例挂载同一提供方的两个实例和[外部委派工具](../tool-subagent-oar/README.zh.md)。[`src/index.ts`](src/index.ts)注册提供方;工具包负责运行时选择和任务展示。提供方使用 OAR 的运行时注册表和会话 API 完成启动、单次提示、答复收集、取消及释放。OAR 负责原生进程;这些会话不使用 DSH 子进程提供方。
104
+
105
+ 依赖补丁对原生安装探测应用环境覆盖,并允许 Claude 显式使用 `--permission-mode`,并在存在该参数时关闭 OAR 强制的权限绕过。示例传入 `--permission-mode dontAsk --permission-prompts none`。Codex 接收 `-c sandbox_mode="workspace-write"`。OAR 将 Codex 审批策略设为 `never`。两条路径均不将原生审批请求转发到 DSH 交互界面。Codex 启动失败时会停止 app-server 并等待其退出,包括响应中缺少线程 id 的情况。
106
+
107
+ 只有根智能体文本参与答复。当 OAR 提供消息 id 时,选择最后一条非空消息;否则拼接根文本。原生推理、工具事件和转录历史不会进入父 Session。原生历史遵循所选运行时自身的持久化行为。提供方错误保留原生原因供本地调试;默认日志仅输出安全的阶段和类别摘要,因为原生原因可能包含凭据。
108
+
109
+ </details>
110
+
111
+ -----
112
+
113
+ <a id="further-exploration"></a>
114
+ ## 延伸阅读
115
+
116
+ - [实验性包](../README.zh.md) — 实验性状态与可选交付。
117
+ - [子智能体服务](../../subagent/subagent/README.zh.md) — 提供方生命周期和最终结果。
118
+ - [OAR 子智能体工具](../tool-subagent-oar/README.zh.md) — 运行时选择和父智能体可见行为。
119
+ - [子智能体子系统](../../../docs/subsystems/subagent.zh.md) — 父智能体调度和完成通知。
120
+ - [架构](../../../docs/architecture.zh.md) — Profile 层组合。
121
+
122
+ -----
123
+
124
+ <a id="model-experience"></a>
125
+ ## 模型体验
126
+
127
+ ### 子请求
128
+
129
+ #### 模型看到什么
130
+
131
+ 所选原生运行时接收 `prompt` 中的文本,`cwd` 设为解析后的子任务目录。其自身的模型、工具、配置和历史决定子请求;实例配置提供模型、推理强度、参数和环境覆盖。
132
+
133
+ #### Token 影响
134
+
135
+ 原生运行时承担独立上下文和轮次的 token。子智能体推理和工具流量不会添加到父上下文。
136
+
137
+ #### KV Cache 影响
138
+
139
+ 子请求独立于父请求的缓存前缀。原生运行时行为决定子请求的缓存复用。
140
+
141
+ ### 父智能体结果(间接)
142
+
143
+ #### 模型看到什么
144
+
145
+ 通过[OAR 子智能体工具](../tool-subagent-oar/README.zh.md#model-experience),父智能体收到此提供方选中的根答复或失败通知。消费者负责工具 schema 和确认消息。
146
+
147
+ #### Token 影响
148
+
149
+ 最终通知将选中的答复或失败详情加入父上下文。
150
+
151
+ #### KV Cache 影响
152
+
153
+ 提供方结果通过共享子智能体服务追加。[消费者](../tool-subagent-oar/README.zh.md#model-experience)负责会影响父请求缓存前缀的工具 schema 变更。
154
+
155
+ ## 已知限制与待完善事项
156
+
157
+ <a id="known-limitations-and-deferred-work"></a>
158
+
159
+ - **实验性运行时覆盖:** 只有 Codex 和 Claude Code 有原生 e2e 覆盖。其他已注册运行时可以选择,但尚未由 DSH 验证。
160
+ - **原生配置:** 此提供方不安装、认证或升级原生智能体。缺少可执行文件和原生配置错误会在委派启动时呈现。
161
+ - **无人值守权限:** 原生权限模式生效,但没有 DSH 审批界面。Claude 需要支持 `--permission-prompts none` 的 CLI 版本;此提供方不提供工具限制功能。OAR 会记录意外的 Codex 审批或用户输入请求,但不会回答。如果运行时等待输入,请取消任务或配置 `timeoutMs`。
162
+ - **启动取消:** OAR 不提供会话打开期间的即时取消。取消操作会等待打开完成并释放迟到的会话;显式配置的 `timeoutMs` 仅在成功打开后开始计时。
163
+ - **进程与历史所有权:** OAR 处理原生进程,原生运行时可能保留转录记录。DSH 不对这些进程应用其子进程沙箱或受管理的后代进程清理。
164
+ - **单次文本:** 不提供继续、恢复、结构化输出、进度流或副作用回滚。取消前的原生更改会保留。
165
+
166
+ <a id="dev-note"></a>
167
+ ### 开发备注
168
+
169
+ <details>
170
+ <summary>维护者工作上下文 — 点击展开</summary>
171
+
172
+ 无。
173
+
174
+ </details>
package/icon.svg ADDED
@@ -0,0 +1 @@
1
+ <svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="14.9893" y="15.1877" width="12.2365" height="12.2365" rx="2" fill="url(#dsh_plugin_art_R0a)" fill-opacity="0.8"></rect><rect x="8.87109" y="9.0697" width="12.2365" height="12.2365" rx="2" fill="url(#dsh_plugin_art_R0b)" fill-opacity="0.8"></rect><defs><linearGradient id="dsh_plugin_art_R0a" x1="21.1075" y1="15.1877" x2="21.1075" y2="27.4243" gradientUnits="userSpaceOnUse"><stop stop-color="#45E7A4"></stop><stop offset="1" stop-color="#05909D"></stop></linearGradient><linearGradient id="dsh_plugin_art_R0b" x1="14.9894" y1="9.0697" x2="14.9894" y2="21.3063" gradientUnits="userSpaceOnUse"><stop stop-color="#69B9FF"></stop><stop offset="1" stop-color="#324DE2"></stop></linearGradient></defs></svg>