@qilin-agent/tool-subagent 3.1.6 → 3.1.8
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/README.i18n.yaml +40 -40
- package/README.md +20 -23
- package/README.zh.md +18 -21
- package/lib/index.js +8 -31
- package/lib/model-selection-settings.js +11 -30
- package/lib/types/index.d.ts +6 -0
- package/lib/types/model-selection-settings.d.ts +10 -0
- package/lib/types/model-selection-state.d.ts +0 -14
- package/lib/types/model-selection.d.ts +4 -19
- package/package.json +31 -31
package/README.i18n.yaml
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
en: d64c585d315ee220
|
|
10
10
|
zh: 72cf6607cdf6d31a
|
|
11
11
|
/qilin-agent-tool-subagent/summary:
|
|
12
|
-
en:
|
|
13
|
-
zh:
|
|
12
|
+
en: 230f4d9f88bb14ae
|
|
13
|
+
zh: be5cfc615c718986
|
|
14
14
|
/qilin-agent-tool-subagent/table-of-contents:
|
|
15
15
|
en: d152484eb41ac6b4
|
|
16
16
|
zh: 09388d293f9be9cb
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
en: 93f1701f5209ecb5
|
|
19
19
|
zh: 6310fd012400aead
|
|
20
20
|
/qilin-agent-tool-subagent/use-this-package/minimal-configuration:
|
|
21
|
-
en:
|
|
22
|
-
zh:
|
|
23
|
-
/qilin-agent-tool-subagent/use-this-package/
|
|
24
|
-
en:
|
|
25
|
-
zh:
|
|
21
|
+
en: 1bd01dc532c3661a
|
|
22
|
+
zh: a68184d9a39bc7c1
|
|
23
|
+
/qilin-agent-tool-subagent/use-this-package/managed-delegation:
|
|
24
|
+
en: 4163000aedc560c8
|
|
25
|
+
zh: fa4784abee9f9060
|
|
26
26
|
/qilin-agent-tool-subagent/use-this-package/selecting-a-child-llm:
|
|
27
27
|
en: 484bf4ed5996539f
|
|
28
28
|
zh: dcb461e031d435c4
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
/qilin-agent-tool-subagent/understand-the-implementation/design-concept:
|
|
33
33
|
en: 5ceacfed4ea0c648
|
|
34
34
|
zh: 005284534923d854
|
|
35
|
-
/qilin-agent-tool-subagent/understand-the-implementation/
|
|
36
|
-
en:
|
|
37
|
-
zh:
|
|
38
|
-
/qilin-agent-tool-subagent/understand-the-implementation/
|
|
39
|
-
en:
|
|
40
|
-
zh:
|
|
35
|
+
/qilin-agent-tool-subagent/understand-the-implementation/activation-ownership:
|
|
36
|
+
en: ef692c4d17290920
|
|
37
|
+
zh: 8bfb6ed9fc0d32dc
|
|
38
|
+
/qilin-agent-tool-subagent/understand-the-implementation/result-acknowledgement:
|
|
39
|
+
en: 3cdb913209febc42
|
|
40
|
+
zh: ec04477fc89a3f29
|
|
41
41
|
/qilin-agent-tool-subagent/understand-the-implementation/context-sensitive-wording:
|
|
42
42
|
en: 1733728ac5aa6bb0
|
|
43
43
|
zh: 341ffc6e21a289af
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
en: 1f52c5f5c7caf04a
|
|
46
46
|
zh: dba288fd0cf51e5d
|
|
47
47
|
/qilin-agent-tool-subagent/further-exploration:
|
|
48
|
-
en:
|
|
48
|
+
en: 6573b2ea6d847f0f
|
|
49
49
|
zh: 18c873bfec2611f5
|
|
50
50
|
/qilin-agent-tool-subagent/model-experience:
|
|
51
51
|
en: 215e7ba838619b7b
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
en: e4c7376d4f29dbd5
|
|
55
55
|
zh: 6b7a9eaf69c9ea53
|
|
56
56
|
/qilin-agent-tool-subagent/model-experience/tool-schema/what-the-model-sees:
|
|
57
|
-
en:
|
|
58
|
-
zh:
|
|
57
|
+
en: 2dc663ff455ba48e
|
|
58
|
+
zh: d2b514637e33c7e7
|
|
59
59
|
/qilin-agent-tool-subagent/model-experience/tool-schema/token-effect:
|
|
60
60
|
en: 1aa53b7a4c24cc25
|
|
61
61
|
zh: bebd5c5ce6443259
|
|
@@ -78,44 +78,44 @@
|
|
|
78
78
|
en: cf78b9dd5596495f
|
|
79
79
|
zh: bd44560f8c2435e8
|
|
80
80
|
/qilin-agent-tool-subagent/model-experience/system-prompt/what-the-model-sees:
|
|
81
|
-
en:
|
|
82
|
-
zh:
|
|
81
|
+
en: 2b69871db8584655
|
|
82
|
+
zh: 583fe191dc7ef9eb
|
|
83
83
|
/qilin-agent-tool-subagent/model-experience/system-prompt/what-the-model-sees/tool-guidance-section:
|
|
84
84
|
en: 82b3cd08b3961c98
|
|
85
85
|
zh: bdc2a34bcea16cac
|
|
86
86
|
/qilin-agent-tool-subagent/model-experience/system-prompt/token-effect:
|
|
87
|
-
en:
|
|
88
|
-
zh:
|
|
87
|
+
en: a8dfd497739788b2
|
|
88
|
+
zh: e78a9fb7baee7080
|
|
89
89
|
/qilin-agent-tool-subagent/model-experience/system-prompt/kv-cache-effect:
|
|
90
90
|
en: 5f2491d0ee8f440c
|
|
91
91
|
zh: 14c06b9fe7096e09
|
|
92
|
-
/qilin-agent-tool-subagent/model-experience/
|
|
93
|
-
en:
|
|
94
|
-
zh:
|
|
95
|
-
/qilin-agent-tool-subagent/model-experience/
|
|
96
|
-
en:
|
|
97
|
-
zh:
|
|
98
|
-
/qilin-agent-tool-subagent/model-experience/
|
|
92
|
+
/qilin-agent-tool-subagent/model-experience/start-result:
|
|
93
|
+
en: 45854c8f4da73af7
|
|
94
|
+
zh: 7a9803ca8c03c40f
|
|
95
|
+
/qilin-agent-tool-subagent/model-experience/start-result/what-the-model-sees:
|
|
96
|
+
en: 15772cb4c28bf562
|
|
97
|
+
zh: 5cf1c8d722ab78e0
|
|
98
|
+
/qilin-agent-tool-subagent/model-experience/start-result/token-effect:
|
|
99
99
|
en: 995810727b29f85f
|
|
100
100
|
zh: 4ede7b437091d6ee
|
|
101
|
-
/qilin-agent-tool-subagent/model-experience/
|
|
101
|
+
/qilin-agent-tool-subagent/model-experience/start-result/kv-cache-effect:
|
|
102
102
|
en: f5d5f97a153f7c70
|
|
103
103
|
zh: 3d6bc05b9eadfbc2
|
|
104
|
-
/qilin-agent-tool-subagent/model-experience/
|
|
105
|
-
en:
|
|
106
|
-
zh:
|
|
107
|
-
/qilin-agent-tool-subagent/model-experience/
|
|
108
|
-
en:
|
|
109
|
-
zh:
|
|
110
|
-
/qilin-agent-tool-subagent/model-experience/
|
|
111
|
-
en:
|
|
112
|
-
zh:
|
|
113
|
-
/qilin-agent-tool-subagent/model-experience/
|
|
104
|
+
/qilin-agent-tool-subagent/model-experience/completion-delivery:
|
|
105
|
+
en: b6ed0eef154aa546
|
|
106
|
+
zh: c99219ca12f8a4c4
|
|
107
|
+
/qilin-agent-tool-subagent/model-experience/completion-delivery/what-the-model-sees:
|
|
108
|
+
en: 8f5e3a083eb7f807
|
|
109
|
+
zh: 63148f555cc83967
|
|
110
|
+
/qilin-agent-tool-subagent/model-experience/completion-delivery/token-effect:
|
|
111
|
+
en: 615348e27c0c9bc0
|
|
112
|
+
zh: 5c56b78968f4ea11
|
|
113
|
+
/qilin-agent-tool-subagent/model-experience/completion-delivery/kv-cache-effect:
|
|
114
114
|
en: f5d5f97a153f7c70
|
|
115
115
|
zh: 3d6bc05b9eadfbc2
|
|
116
116
|
/qilin-agent-tool-subagent/known-limitations-and-deferred-work:
|
|
117
|
-
en:
|
|
118
|
-
zh:
|
|
117
|
+
en: 609ea9766d00bd84
|
|
118
|
+
zh: b9095aabdea53179
|
|
119
119
|
/qilin-agent-tool-subagent/known-limitations-and-deferred-work/dev-note:
|
|
120
120
|
en: e67f633dc6fe7773
|
|
121
121
|
zh: 3bb0c20c93f16f98
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
|
|
|
9
9
|
|
|
10
10
|
## Summary
|
|
11
11
|
|
|
12
|
-
Use this package to give an agent a named tool that delegates work to a configured
|
|
12
|
+
Use this package to give an agent a named tool that delegates work to a configured backend. Every call starts a managed activation and returns a child id; the runtime owns completion notices and cleanup. Local children stay resident for messages and restoration unless they are configured `one-shot`, while external backends execute one task and return their final answer through the completion notice. Supported backends can expose approved child LLM routes. Each instance can set child persona, tool access, and depth limits.
|
|
13
13
|
|
|
14
14
|
## Table of Contents
|
|
15
15
|
|
|
@@ -46,9 +46,8 @@ Load the subagent service, an in-process or remote backend, and this tool; then
|
|
|
46
46
|
|---|---|---|
|
|
47
47
|
| `provider` | required | Provider name on `ctx.subagents` (e.g. `spawn`, `fork`, `acp`) |
|
|
48
48
|
| `toolName` | `subagent` | Model-facing tool name; distinct for every loaded instance |
|
|
49
|
+
| `backgroundMode` | `continuable` | Local-child lifecycle: `continuable` keeps the child resident for follow-up turns and messages, `one-shot` tears it down when its answering turn settles. External backends are one-shot by contract. |
|
|
49
50
|
| `modelSelectionSettings` | `false` | Sample the Host's exact-route authorization preference for each top-level Session; a standing preset observes matching Sessions, while direct Agent setup passes its Session explicitly; requires provider `agentOptions` support |
|
|
50
|
-
| `enableRunInBackground` | `true` | Expose `run_in_background`; disabling also rejects forced background calls |
|
|
51
|
-
| `backgroundMode` | `one-shot` | Background policy: `one-shot` defaults calls to foreground; `continuable` defaults them to background and requires the provider's `prepareContinuable` capability |
|
|
52
51
|
| `agentOptions` | — | Configured child `provider`, `model`, adapter-owned `reasoningEffort`, and positive `maxTokens` defaults; requires provider `agentOptions` support and overlays any provider-owned route defaults |
|
|
53
52
|
| `persona` | — | Per-child persona; requires the provider's `persona` capability |
|
|
54
53
|
| `toolFilter` | — | Per-child global-tool restriction; requires the `toolFilter` capability |
|
|
@@ -56,11 +55,9 @@ Load the subagent service, an in-process or remote backend, and this tool; then
|
|
|
56
55
|
|
|
57
56
|
The generated [configuration catalog](../../../docs/config-catalog.md#qilin-agenttool-subagent) is the exhaustive source for every accepted field and its JSDoc.
|
|
58
57
|
|
|
59
|
-
###
|
|
58
|
+
### Managed delegation
|
|
60
59
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
Under `continuable` policy, an omitted or `true` `run_in_background` starts a durable child and returns `started subagent <childId>` without waiting for a result; the runtime delivers one settlement notice when the child's Activation ends, and the optional `send_message` tool sends it more work. Set `run_in_background: false` to wait for the result in the foreground.
|
|
60
|
+
Every call returns `started subagent <childId>` after the runtime accepts the child. It does not wait for the child's result. The activation owns the work independently of the completed tool call; the runtime sends a completion notice and releases execution resources.
|
|
64
61
|
|
|
65
62
|
`maxDepth` caps recursion (`0` forbids delegation); omission reads the current Host `subagent.maxDepth` setting, initially `1`, at each delegation. A numeric depth requires a provider with the `depthLimit` capability; `'provider-managed'` leaves the budget to an out-of-process provider. `persona` and `toolFilter` configure every child when the provider supports them, and the tool stays visible at the cap — each attempted start checks the calling agent's current depth and rejects with an errored result.
|
|
66
63
|
|
|
@@ -84,13 +81,13 @@ This section explains how the tool mirrors provider lifecycle and settles runs;
|
|
|
84
81
|
|
|
85
82
|
One instance is one provider plus one tool name. The plugin mirrors provider lifecycle: it registers the tool when the named provider appears and disposes it when the provider leaves, so sibling load order and HMR replacement cannot strand a dangling tool. Direct Agent setup passes its unpublished Session explicitly and awaits installation before publication. A settings-backed standing preset receives each matching Agent through `agent/created`, selects policy from its Session, and awaits installation through its Context; installation failure rejects creation. A numeric `maxDepth` or configured LLM selection the provider cannot enforce fails the mount instead of the first delegation. At most one instance in a tool scope may own model selection because `list_subagent_models` has a global name.
|
|
86
83
|
|
|
87
|
-
###
|
|
84
|
+
### Activation ownership
|
|
88
85
|
|
|
89
|
-
|
|
86
|
+
The tool calls `ctx.subagents.startActivation()` with parent delivery selected. The runtime owns startup cancellation, execution, outcome reporting, and cleanup. A startup failure is an errored tool result; failures after publication arrive through the completion notice, with diagnostics and partial output preserved by the runtime.
|
|
90
87
|
|
|
91
|
-
###
|
|
88
|
+
### Result acknowledgement
|
|
92
89
|
|
|
93
|
-
|
|
90
|
+
The canonical tool result is `{ kind: 'activation', subagentId }`. It contains no execution Promise or final output; programmatic consumers that need to await results use the subagent service directly.
|
|
94
91
|
|
|
95
92
|
### Context-sensitive wording
|
|
96
93
|
|
|
@@ -115,7 +112,7 @@ The tool's description derives from `provider.inheritsParentContext`: a fresh ch
|
|
|
115
112
|
|
|
116
113
|
Read these pages when the package-level contract is not enough; they move from the tool's runtime behavior to the seam it delegates over and the adjacent child tools.
|
|
117
114
|
|
|
118
|
-
- [Subagent subsystem](../../../docs/subsystems/subagent.md) — providers,
|
|
115
|
+
- [Subagent subsystem](../../../docs/subsystems/subagent.md) — providers, activations, results, and continuation.
|
|
119
116
|
- [qilin-tool-subagent-control](../tool-subagent-control/README.md) — messaging, interrupt, and listing tools for continuable children.
|
|
120
117
|
- [Generated tool catalog](../../../docs/tool-catalog.md#qilin-agenttool-subagent) — the default schema and per-mode wording.
|
|
121
118
|
- [Generated configuration catalog](../../../docs/config-catalog.md#qilin-agenttool-subagent) — every accepted config field.
|
|
@@ -131,7 +128,7 @@ Read these pages when the package-level contract is not enough; they move from t
|
|
|
131
128
|
|
|
132
129
|
#### What the model sees
|
|
133
130
|
|
|
134
|
-
The generated default [`subagent` schema](../../../docs/tool-catalog.md#qilin-agenttool-subagent) under this instance's configured name while its provider exists. An enabled Session policy adds `provider`, `model`, and `reasoning_effort` plus inheritance and selection guidance; the provider must support `agentOptions`. Provider context inheritance changes the tool and prompt descriptions.
|
|
131
|
+
The generated default [`subagent` schema](../../../docs/tool-catalog.md#qilin-agenttool-subagent) under this instance's configured name while its provider exists. An enabled Session policy adds `provider`, `model`, and `reasoning_effort` plus inheritance and selection guidance; the provider must support `agentOptions`. Provider context inheritance changes the tool and prompt descriptions. While the tool is visible in an assembly's scope, a `tool:<toolName>` system-prompt section tells the model to start independent continuable delegations together and keep working while they run; a tool restriction removes both its schema and this guidance.
|
|
135
132
|
|
|
136
133
|
#### Token effect
|
|
137
134
|
|
|
@@ -159,27 +156,27 @@ The schema is prefix-stable across adapter registration and catalog changes. Eac
|
|
|
159
156
|
|
|
160
157
|
#### What the model sees
|
|
161
158
|
|
|
162
|
-
|
|
159
|
+
While the tool is visible in an assembly's scope, a `tool:<toolName>` system-prompt section lists the visible delegation tool names and tells the model to start independent delegations together, continue useful work while they run, and end its turn instead of sleeping or polling when only waiting for their results remains. With the default tool name `subagent`, the section text is:
|
|
163
160
|
|
|
164
161
|
##### Tool-guidance section
|
|
165
162
|
|
|
166
163
|
```markdown
|
|
167
|
-
|
|
164
|
+
Start independent delegations with `subagent` together in one assistant message and continue useful work while they run. When only waiting for their results remains, end your turn instead of sleeping or polling; the next result starts a new turn.
|
|
168
165
|
```
|
|
169
166
|
|
|
170
167
|
#### Token effect
|
|
171
168
|
|
|
172
|
-
One short fixed section per
|
|
169
|
+
One short fixed section per delegation tool, paid on every parent request while the tool is in scope.
|
|
173
170
|
|
|
174
171
|
#### KV Cache effect
|
|
175
172
|
|
|
176
173
|
Prefix-stable while the section text and tool presence are unchanged; removing the tool or changing the section establishes a different parent prefix.
|
|
177
174
|
|
|
178
|
-
###
|
|
175
|
+
### Start result
|
|
179
176
|
|
|
180
177
|
#### What the model sees
|
|
181
178
|
|
|
182
|
-
The call retains the description and prompt. Success
|
|
179
|
+
The call retains the task description and prompt. Success returns `started subagent <childId>`; startup rejection returns an error. Child execution details are delivered separately from this acknowledgement.
|
|
183
180
|
|
|
184
181
|
#### Token effect
|
|
185
182
|
|
|
@@ -189,15 +186,15 @@ The prompt and result remain in parent history until compaction; child working c
|
|
|
189
186
|
|
|
190
187
|
Append-only; newly visible content follows the reusable request prefix and does not invalidate existing KV-cache entries.
|
|
191
188
|
|
|
192
|
-
###
|
|
189
|
+
### Completion delivery
|
|
193
190
|
|
|
194
191
|
#### What the model sees
|
|
195
192
|
|
|
196
|
-
|
|
193
|
+
Answer delivery follows the managed delegation rules above. The returned child id identifies subsequent control and catalog operations; only backends with continuation support accept follow-up messages.
|
|
197
194
|
|
|
198
195
|
#### Token effect
|
|
199
196
|
|
|
200
|
-
|
|
197
|
+
Messages and completion notices append to parent history independently of the start acknowledgement. The tool result itself contains no final output.
|
|
201
198
|
|
|
202
199
|
#### KV Cache effect
|
|
203
200
|
|
|
@@ -210,8 +207,8 @@ Append-only; newly visible content follows the reusable request prefix and does
|
|
|
210
207
|
|
|
211
208
|
These limits define what this tool does not return or enforce; they are current package constraints.
|
|
212
209
|
|
|
213
|
-
- **
|
|
214
|
-
- **Duplicate names across waiting
|
|
210
|
+
- **The start result exposes no child output through this tool** — a continuable child's output stays in its own session, read by its subagent id. The settlement notice states how that child ended and carries nonempty text from its final assistant output, but it is not this call's return value and cannot be awaited here.
|
|
211
|
+
- **Duplicate names across waiting instances are detected late** (`TODO(subagent-dup-toolname)`) — continuable instances reserve their prompt-section name during plugin application, but preventing provider-registration rollback for waiting instances requires a registry of intended names.
|
|
215
212
|
- **Shipped fork tools cannot select a child LLM route** — they inherit the parent's provider and model to keep the copied conversation prefix eligible for KV Cache reuse. Re-enable selection only when route changes preserve reuse or expose a bounded recomputation cost.
|
|
216
213
|
- **Non-routing child policy is fixed per instance** — another persona, tool filter, or depth cap requires another distinctly named tool. LLM selection requires an enabled per-Session preference and a provider that advertises `agentOptions`; both in-process providers and QILIN SDK advertise it, while ACP, Codex, and Claude Code reject it rather than ignore it.
|
|
217
214
|
|
package/README.zh.md
CHANGED
|
@@ -9,7 +9,7 @@ kind: "package-reference"
|
|
|
9
9
|
|
|
10
10
|
## 概述
|
|
11
11
|
|
|
12
|
-
使用本包可为 agent 提供一个具名工具,把工作委派给已配置的子 agent
|
|
12
|
+
使用本包可为 agent 提供一个具名工具,把工作委派给已配置的子 agent 后端。每次调用都会启动一个受管的 activation 并返回子会话 id;运行时负责完成通知与清理。本地子会话默认保留常驻以支持消息与恢复,配置为 `one-shot` 时随作答 turn 结束拆除;外部后端执行单个任务并通过完成通知返回最终结果。受支持的后端可公开获准的子级 LLM 路由;每个实例均可设置子 agent 的 persona、工具权限与深度限制。
|
|
13
13
|
|
|
14
14
|
## 目录
|
|
15
15
|
|
|
@@ -46,9 +46,8 @@ kind: "package-reference"
|
|
|
46
46
|
|---|---|---|
|
|
47
47
|
| `provider` | 必填 | `ctx.subagents` 上的提供方名称(如 `spawn`、`fork`、`acp`) |
|
|
48
48
|
| `toolName` | `subagent` | 面向模型的工具名称;每个已加载实例必须不同 |
|
|
49
|
+
| `backgroundMode` | `continuable` | 本地子代理的生命周期:`continuable` 保留常驻,供后续 turn 与消息使用;`one-shot` 在其作答 turn 结算时拆除。外部后端按契约即一次性。 |
|
|
49
50
|
| `modelSelectionSettings` | `false` | 为每个顶层 Session 读取宿主的精确路由授权偏好;常驻 preset 观察匹配 Session,直接 Agent setup 则显式传入其 Session;要求提供方支持 `agentOptions` |
|
|
50
|
-
| `enableRunInBackground` | `true` | 公开 `run_in_background`;禁用时也会拒绝强制后台调用 |
|
|
51
|
-
| `backgroundMode` | `one-shot` | 后台策略:`one-shot` 默认前台调用;`continuable` 默认后台调用,并要求提供方具备 `prepareContinuable` 能力 |
|
|
52
51
|
| `agentOptions` | — | 配置的子级 `provider`、`model`、适配器所有的 `reasoningEffort` 与正整数 `maxTokens` 默认值;要求提供方支持 `agentOptions`,并会覆盖提供方持有的路由默认值 |
|
|
53
52
|
| `persona` | — | 每个子 agent 独立的 persona;要求提供方具备 `persona` 能力 |
|
|
54
53
|
| `toolFilter` | — | 每个子 agent 独立的全局工具限制;要求提供方具备 `toolFilter` 能力 |
|
|
@@ -56,11 +55,9 @@ kind: "package-reference"
|
|
|
56
55
|
|
|
57
56
|
生成的[配置目录](../../../docs/config-catalog.zh.md#qilin-agenttool-subagent)是每个受支持字段及其 JSDoc 的穷尽式真源。
|
|
58
57
|
|
|
59
|
-
###
|
|
58
|
+
### 受管委派
|
|
60
59
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
`continuable` 策略下,省略或为 `true` 的 `run_in_background` 会启动一个持久化子 agent,并返回 `started subagent <childId>`,不等待结果;子 agent 的 Activation 结束时,运行时投递一条结算通知,可选的 `send_message` 工具会向它发送更多工作。把 `run_in_background` 设为 `false` 可在前台等待结果。
|
|
60
|
+
运行时接受子会话后,每次调用都会返回 `started subagent <childId>`,不等待子会话结果。activation 独立于已完成的工具调用持有工作;运行时发送完成通知并释放执行资源。
|
|
64
61
|
|
|
65
62
|
`maxDepth` 限制递归深度(`0` 禁止委派);省略时,每次委派读取 Host 当前的 `subagent.maxDepth` 设置,初始值为 `1`。数值深度要求提供方具备 `depthLimit` 能力;`'provider-managed'` 把预算留给进程外提供方。当提供方支持时,`persona` 与 `toolFilter` 会配置每个子 agent;工具在达到上限时仍然可见——每次尝试启动都会检查调用 agent 的当前深度,被拒绝时返回出错的工具结果。
|
|
66
63
|
|
|
@@ -84,13 +81,13 @@ kind: "package-reference"
|
|
|
84
81
|
|
|
85
82
|
一个实例就是一个提供方加一个工具名称。插件镜像提供方生命周期:具名提供方出现时注册工具,提供方离开时释放工具,因此同级加载顺序与 HMR 替换不会让工具悬空。直接 Agent setup 显式传入尚未发布的 Session,并在发布前等待安装完成。由设置控制的常驻 preset 通过 `agent/created` 接收每个匹配 Agent,从其 Session 选择策略,并等待通过其 Context 发起的安装;安装失败会拒绝创建。提供方无法执行的数值型 `maxDepth` 或已配置 LLM 选择会在挂载时失败,而不是在首次委派时失败。每个工具作用域内最多一个实例可以拥有模型选择,因为 `list_subagent_models` 使用全局名称。
|
|
86
83
|
|
|
87
|
-
###
|
|
84
|
+
### Activation 归属
|
|
88
85
|
|
|
89
|
-
|
|
86
|
+
工具以 parent 投递模式调用 `ctx.subagents.startActivation()`。运行时负责启动取消、执行、结果上报与清理。启动失败是错误工具结果;发布后的失败通过完成通知到达,诊断与部分输出由运行时保留。
|
|
90
87
|
|
|
91
|
-
###
|
|
88
|
+
### 结果确认
|
|
92
89
|
|
|
93
|
-
|
|
90
|
+
规范工具结果为 `{ kind: 'activation', subagentId }`,不包含执行 Promise 或最终输出;需要等待结果的程序化调用方直接使用 subagent 服务。
|
|
94
91
|
|
|
95
92
|
### 随上下文变化的措辞
|
|
96
93
|
|
|
@@ -131,7 +128,7 @@ kind: "package-reference"
|
|
|
131
128
|
|
|
132
129
|
#### 模型看到什么
|
|
133
130
|
|
|
134
|
-
当提供方存在时,以当前实例配置的名称公开已生成的默认 [`subagent` schema](../../../docs/tool-catalog.zh.md#qilin-agenttool-subagent)。启用的 Session 策略会添加 `provider`、`model` 与 `reasoning_effort`,以及继承和选择指引;提供方必须支持 `agentOptions
|
|
131
|
+
当提供方存在时,以当前实例配置的名称公开已生成的默认 [`subagent` schema](../../../docs/tool-catalog.zh.md#qilin-agenttool-subagent)。启用的 Session 策略会添加 `provider`、`model` 与 `reasoning_effort`,以及继承和选择指引;提供方必须支持 `agentOptions`。提供方是否继承上下文会改变工具描述和提示词描述。当工具在本次组装的作用域中可见时,一个 `tool:<toolName>` 系统提示词 section 会指示模型同时启动相互独立的可继续委派、在它们运行时继续工作;工具限制会同时移除其 schema 和这段指引。
|
|
135
132
|
|
|
136
133
|
#### Token 影响
|
|
137
134
|
|
|
@@ -159,27 +156,27 @@ Session 携带策略的 settings 控制实例会公开子级 LLM 选择字段与
|
|
|
159
156
|
|
|
160
157
|
#### 模型看到什么
|
|
161
158
|
|
|
162
|
-
|
|
159
|
+
当工具在本次组装的作用域中可见时,一个 `tool:<toolName>` 系统提示词 section 会列出可见的委派工具名,并指示模型同时启动相互独立的委派、在它们运行时继续工作,并且仅在等待结果时结束 turn,而不是睡眠或轮询。使用默认工具名 `subagent` 时,section 文本为:
|
|
163
160
|
|
|
164
161
|
##### 工具指导 section
|
|
165
162
|
|
|
166
163
|
```markdown
|
|
167
|
-
|
|
164
|
+
Start independent delegations with `subagent` together in one assistant message and continue useful work while they run. When only waiting for their results remains, end your turn instead of sleeping or polling; the next result starts a new turn.
|
|
168
165
|
```
|
|
169
166
|
|
|
170
167
|
#### Token 影响
|
|
171
168
|
|
|
172
|
-
|
|
169
|
+
每个委派工具一个简短固定 section,只要工具在作用域内,就由每个父级请求支付。
|
|
173
170
|
|
|
174
171
|
#### KV Cache 影响
|
|
175
172
|
|
|
176
173
|
只要 section 文本与工具存在性不变,前缀就保持稳定;移除工具或更改 section 会建立不同的父级前缀。
|
|
177
174
|
|
|
178
|
-
###
|
|
175
|
+
### 启动结果
|
|
179
176
|
|
|
180
177
|
#### 模型看到什么
|
|
181
178
|
|
|
182
|
-
|
|
179
|
+
调用保留任务描述与提示词。成功返回 `started subagent <childId>`;启动被拒绝则返回错误。子会话执行细节与该确认分开投递。
|
|
183
180
|
|
|
184
181
|
#### Token 影响
|
|
185
182
|
|
|
@@ -189,15 +186,15 @@ Use subagent in the background by default. Start independent delegations togethe
|
|
|
189
186
|
|
|
190
187
|
仅追加;新增可见内容位于可复用请求前缀之后,不会使现有 KV Cache 条目失效。
|
|
191
188
|
|
|
192
|
-
###
|
|
189
|
+
### 完成投递
|
|
193
190
|
|
|
194
191
|
#### 模型看到什么
|
|
195
192
|
|
|
196
|
-
|
|
193
|
+
答案投递遵循上面的受管委派规则。返回的子会话 id 用于后续控制与目录操作;只有支持继续的后端接受后续消息。
|
|
197
194
|
|
|
198
195
|
#### Token 影响
|
|
199
196
|
|
|
200
|
-
|
|
197
|
+
消息与完成通知独立于启动确认追加到父级历史;工具结果本身不含最终输出。
|
|
201
198
|
|
|
202
199
|
#### KV Cache 影响
|
|
203
200
|
|
|
@@ -210,7 +207,7 @@ Use subagent in the background by default. Start independent delegations togethe
|
|
|
210
207
|
|
|
211
208
|
这些限制说明本工具不返回或不强制执行什么;它们是当前包约束。
|
|
212
209
|
|
|
213
|
-
-
|
|
210
|
+
- **启动结果不通过本工具公开子会话输出**——可继续子 agent 的输出留在其自身会话中,按其 subagent id 读取。结算通知会说明该子 agent 如何结束,并携带其最终 assistant 输出中的非空文本,但它不是本次调用的返回值,也无法在此等待。
|
|
214
211
|
- **等待中的一次性实例较晚才发现重复名称**(`TODO(subagent-dup-toolname)`)——可继续实例会在插件应用期间预留提示词 section 名称,但若要阻止等待中的一次性实例回滚提供方注册,仍需要一份预期名称注册表。
|
|
215
212
|
- **随附 fork 工具不能选择子级 LLM 路由**——它们继承父级提供方与模型,使复制的对话前缀仍有资格复用 KV Cache。仅当路由变更能保留复用或公开有界重算成本时,才重新启用选择。
|
|
216
213
|
- **非路由子 agent 策略按实例固定**——另一个 persona、工具过滤器或深度上限需要另一个名称不同的工具。LLM 选择要求启用逐 Session 偏好,且提供方必须声明 `agentOptions`;两个进程内提供方和 QILIN SDK 会声明该能力,而 ACP、Codex 与 Claude Code 会拒绝它,而不是忽略它。
|
package/lib/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import z from "@qilin-agent/schemastery";
|
|
2
2
|
import { scopeChainOf, scopeOf } from "@qilin-agent/scope";
|
|
3
3
|
import { defineTool } from "@qilin-agent/tools";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { randomUUID } from "node:crypto";
|
|
5
|
+
import { SessionId, SessionSeq } from "@qilin-agent/session";
|
|
6
|
+
import { assertAllowedModelRoutes, assertSubagentMaxDepth, parentAgentOptionsForDelegation } from "@qilin-agent/subagent";
|
|
6
7
|
import { ReasoningEffortId } from "@qilin-agent/llm";
|
|
7
8
|
import { z as z$1 } from "zod";
|
|
8
9
|
z.object({
|
|
@@ -10,34 +11,6 @@ z.object({
|
|
|
10
11
|
model: z.string().min(1).required()
|
|
11
12
|
});
|
|
12
13
|
/**
|
|
13
|
-
* Stable identity for one provider/model pair.
|
|
14
|
-
* @param route - Exact provider/model route.
|
|
15
|
-
* @returns Opaque key for equality checks.
|
|
16
|
-
*/
|
|
17
|
-
function modelRouteKey(route) {
|
|
18
|
-
return `${route.provider}\0${route.model}`;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Reject malformed or duplicate route policy entries at a durable or configuration boundary.
|
|
22
|
-
* @param routes - Candidate exact routes to validate.
|
|
23
|
-
* @returns an assertion that the candidate is a validated exact-route array.
|
|
24
|
-
*/
|
|
25
|
-
function assertAllowedModelRoutes(routes) {
|
|
26
|
-
if (!Array.isArray(routes)) throw new Error("subagent model selection requires an array of routes");
|
|
27
|
-
const seen = /* @__PURE__ */ new Set();
|
|
28
|
-
const candidates = routes;
|
|
29
|
-
for (const candidate of candidates) {
|
|
30
|
-
if (typeof candidate !== "object" || candidate === null || Array.isArray(candidate) || !("provider" in candidate) || typeof candidate.provider !== "string" || !("model" in candidate) || typeof candidate.model !== "string" || candidate.provider.length === 0 || candidate.model.length === 0) throw new Error("subagent model selection requires non-empty provider and model ids");
|
|
31
|
-
const route = {
|
|
32
|
-
provider: candidate.provider,
|
|
33
|
-
model: candidate.model
|
|
34
|
-
};
|
|
35
|
-
const key = modelRouteKey(route);
|
|
36
|
-
if (seen.has(key)) throw new Error(`subagent model selection repeats route "${route.provider}/${route.model}"`);
|
|
37
|
-
seen.add(key);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
14
|
* Whether a call explicitly selects any child LLM value.
|
|
42
15
|
* @param request - Model-facing route fields from the tool call.
|
|
43
16
|
* @returns Whether at least one route or effort field is present.
|
|
@@ -251,6 +224,7 @@ const delegationTools = /* @__PURE__ */ new Set();
|
|
|
251
224
|
const Config = z.object({
|
|
252
225
|
provider: z.string().required(),
|
|
253
226
|
toolName: z.string().default("subagent"),
|
|
227
|
+
backgroundMode: z.union(["one-shot", "continuable"]).default("continuable"),
|
|
254
228
|
modelSelectionSettings: z.boolean().default(false),
|
|
255
229
|
agentOptions: z.object({
|
|
256
230
|
provider: z.string(),
|
|
@@ -374,6 +348,7 @@ function apply(ctx, config, session) {
|
|
|
374
348
|
},
|
|
375
349
|
isConcurrencySafe: () => true,
|
|
376
350
|
async execute(args, exec) {
|
|
351
|
+
const childId = runtimeCtx.subagents.getProvider(config.provider)?.prepareContinuable !== void 0 && (config.backgroundMode ?? "continuable") === "continuable" ? SessionId(randomUUID()) : void 0;
|
|
377
352
|
const parent = exec.agent;
|
|
378
353
|
if (!parent) throw new Error("subagent tool requires a calling agent (exec.agent was undefined)");
|
|
379
354
|
const modelRequest = args;
|
|
@@ -408,10 +383,12 @@ function apply(ctx, config, session) {
|
|
|
408
383
|
kind: "activation",
|
|
409
384
|
subagentId: (await runtimeCtx.subagents.startActivation({
|
|
410
385
|
provider: config.provider,
|
|
386
|
+
...childId === void 0 ? {} : { childId },
|
|
411
387
|
label: args.description,
|
|
412
388
|
request,
|
|
413
389
|
signal: exec.signal,
|
|
414
|
-
delivery: "parent"
|
|
390
|
+
delivery: "parent",
|
|
391
|
+
...config.backgroundMode === void 0 ? {} : { mode: config.backgroundMode }
|
|
415
392
|
})).childId
|
|
416
393
|
};
|
|
417
394
|
}
|
|
@@ -1,40 +1,13 @@
|
|
|
1
1
|
import { Service } from "@qilin-agent/kylin";
|
|
2
2
|
import z from "@qilin-agent/schemastery";
|
|
3
3
|
import "@qilin-agent/llm";
|
|
4
|
+
import { assertAllowedModelRoutes } from "@qilin-agent/subagent";
|
|
4
5
|
//#region lib/types/model-selection.js
|
|
5
6
|
/** Schema shared by the Host setting and its deployment base. */
|
|
6
7
|
const AllowedModelRouteSchema = z.object({
|
|
7
8
|
provider: z.string().min(1).required(),
|
|
8
9
|
model: z.string().min(1).required()
|
|
9
10
|
});
|
|
10
|
-
/**
|
|
11
|
-
* Stable identity for one provider/model pair.
|
|
12
|
-
* @param route - Exact provider/model route.
|
|
13
|
-
* @returns Opaque key for equality checks.
|
|
14
|
-
*/
|
|
15
|
-
function modelRouteKey(route) {
|
|
16
|
-
return `${route.provider}\0${route.model}`;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Reject malformed or duplicate route policy entries at a durable or configuration boundary.
|
|
20
|
-
* @param routes - Candidate exact routes to validate.
|
|
21
|
-
* @returns an assertion that the candidate is a validated exact-route array.
|
|
22
|
-
*/
|
|
23
|
-
function assertAllowedModelRoutes(routes) {
|
|
24
|
-
if (!Array.isArray(routes)) throw new Error("subagent model selection requires an array of routes");
|
|
25
|
-
const seen = /* @__PURE__ */ new Set();
|
|
26
|
-
const candidates = routes;
|
|
27
|
-
for (const candidate of candidates) {
|
|
28
|
-
if (typeof candidate !== "object" || candidate === null || Array.isArray(candidate) || !("provider" in candidate) || typeof candidate.provider !== "string" || !("model" in candidate) || typeof candidate.model !== "string" || candidate.provider.length === 0 || candidate.model.length === 0) throw new Error("subagent model selection requires non-empty provider and model ids");
|
|
29
|
-
const route = {
|
|
30
|
-
provider: candidate.provider,
|
|
31
|
-
model: candidate.model
|
|
32
|
-
};
|
|
33
|
-
const key = modelRouteKey(route);
|
|
34
|
-
if (seen.has(key)) throw new Error(`subagent model selection repeats route "${route.provider}/${route.model}"`);
|
|
35
|
-
seen.add(key);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
11
|
//#endregion
|
|
39
12
|
//#region lib/types/model-selection-settings.js
|
|
40
13
|
/** Singleton settings owner read when delegation tools are composed for a Session. */
|
|
@@ -42,11 +15,16 @@ var SubagentModelSelectionConfig = class extends Service {
|
|
|
42
15
|
config;
|
|
43
16
|
static Config = z.object({
|
|
44
17
|
enabled: z.boolean().default(false).volatile(),
|
|
45
|
-
allowedModels: z.array(AllowedModelRouteSchema).default([]).volatile()
|
|
18
|
+
allowedModels: z.array(AllowedModelRouteSchema).default([]).volatile(),
|
|
19
|
+
defaultRoute: AllowedModelRouteSchema.default(void 0).volatile()
|
|
46
20
|
});
|
|
47
21
|
constructor(ctx, config) {
|
|
48
22
|
super(ctx, "subagentModelSelection");
|
|
49
23
|
this.config = config;
|
|
24
|
+
ctx.inject(["subagents"], (seamCtx) => {
|
|
25
|
+
const subagents = seamCtx.subagents;
|
|
26
|
+
seamCtx.effect(() => subagents.setChildRoutePreference(() => this.current().defaultRoute));
|
|
27
|
+
});
|
|
50
28
|
}
|
|
51
29
|
/**
|
|
52
30
|
* Read a detached selection preference for the next eligible Session composition.
|
|
@@ -55,11 +33,14 @@ var SubagentModelSelectionConfig = class extends Service {
|
|
|
55
33
|
current() {
|
|
56
34
|
const enabled = this.config.enabled.get();
|
|
57
35
|
const allowedModels = this.config.allowedModels.get();
|
|
36
|
+
const defaultRoute = this.config.defaultRoute.get();
|
|
58
37
|
assertAllowedModelRoutes(allowedModels);
|
|
59
38
|
if (enabled && allowedModels.length === 0) throw new Error("enabled subagent model selection requires at least one allowed model");
|
|
39
|
+
if (defaultRoute !== void 0 && !allowedModels.some((route) => route.provider === defaultRoute.provider && route.model === defaultRoute.model)) throw new Error("the default child route must be one of the authorized routes");
|
|
60
40
|
return {
|
|
61
41
|
enabled,
|
|
62
|
-
allowedModels: allowedModels.map((route) => ({ ...route }))
|
|
42
|
+
allowedModels: allowedModels.map((route) => ({ ...route })),
|
|
43
|
+
...defaultRoute === void 0 ? {} : { defaultRoute: { ...defaultRoute } }
|
|
63
44
|
};
|
|
64
45
|
}
|
|
65
46
|
};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -56,6 +56,12 @@ export interface Config {
|
|
|
56
56
|
* the current Host subagent depth setting (default `1`) at each delegation.
|
|
57
57
|
*/
|
|
58
58
|
maxDepth?: number | 'provider-managed';
|
|
59
|
+
/**
|
|
60
|
+
* Lifecycle for this tool's children. `continuable` (default) keeps a child
|
|
61
|
+
* resident for follow-up turns; `one-shot` tears it down when its answering
|
|
62
|
+
* turn settles. External providers are one-shot by contract and ignore this.
|
|
63
|
+
*/
|
|
64
|
+
backgroundMode?: 'one-shot' | 'continuable';
|
|
59
65
|
}
|
|
60
66
|
export declare const Config: z<Config>;
|
|
61
67
|
/**
|
|
@@ -15,6 +15,12 @@ export interface SubagentModelSelectionSettings {
|
|
|
15
15
|
enabled: boolean;
|
|
16
16
|
/** Exact child LLM routes offered to newly composed top-level Sessions. */
|
|
17
17
|
allowedModels: AllowedModelRoute[];
|
|
18
|
+
/**
|
|
19
|
+
* Route every delegation starts on when its call names none. Absent leaves the
|
|
20
|
+
* child route to the provider's advertised default and the deployment's
|
|
21
|
+
* `childRouteDefaults`, so a composition without either keeps inheriting.
|
|
22
|
+
*/
|
|
23
|
+
defaultRoute?: AllowedModelRoute;
|
|
18
24
|
}
|
|
19
25
|
/** Optional deployment base for the preference. */
|
|
20
26
|
export interface Config {
|
|
@@ -22,6 +28,8 @@ export interface Config {
|
|
|
22
28
|
enabled: Volatile<boolean>;
|
|
23
29
|
/** Initial route list inherited when the user document does not override it. */
|
|
24
30
|
allowedModels: Volatile<AllowedModelRoute[]>;
|
|
31
|
+
/** Initial default route inherited when the user document does not override it. */
|
|
32
|
+
defaultRoute: Volatile<AllowedModelRoute | undefined>;
|
|
25
33
|
}
|
|
26
34
|
/** Singleton settings owner read when delegation tools are composed for a Session. */
|
|
27
35
|
export declare class SubagentModelSelectionConfig extends Service {
|
|
@@ -29,9 +37,11 @@ export declare class SubagentModelSelectionConfig extends Service {
|
|
|
29
37
|
static Config: z<Schemastery.ObjectS<NoInfer<{
|
|
30
38
|
enabled: z<boolean, boolean, "volatile-defined">;
|
|
31
39
|
allowedModels: z<NoInfer<AllowedModelRoute[]>, NoInfer<AllowedModelRoute[]>, "volatile-defined">;
|
|
40
|
+
defaultRoute: z<NoInfer<AllowedModelRoute>, NoInfer<AllowedModelRoute>, "volatile-defined">;
|
|
32
41
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
33
42
|
enabled: z<boolean, boolean, "volatile-defined">;
|
|
34
43
|
allowedModels: z<NoInfer<AllowedModelRoute[]>, NoInfer<AllowedModelRoute[]>, "volatile-defined">;
|
|
44
|
+
defaultRoute: z<NoInfer<AllowedModelRoute>, NoInfer<AllowedModelRoute>, "volatile-defined">;
|
|
35
45
|
}>>, "plain">;
|
|
36
46
|
constructor(ctx: Context, config: Config);
|
|
37
47
|
/**
|
|
@@ -3,20 +3,6 @@ import { z as zod } from 'zod';
|
|
|
3
3
|
import type { Session } from '@qilin-agent/session';
|
|
4
4
|
import type SessionProjectionRegistry from '@qilin-agent/session-projection';
|
|
5
5
|
import { type AllowedModelRoute } from './model-selection.ts';
|
|
6
|
-
declare module '@qilin-agent/session/types' {
|
|
7
|
-
interface SessionEventMap {
|
|
8
|
-
/**
|
|
9
|
-
* Records that this session's delegation tool exposes child provider,
|
|
10
|
-
* model, and reasoning-effort selection. Appended before the first model
|
|
11
|
-
* request; absence means the fixed-route definition. Log-only: it carries
|
|
12
|
-
* no `surfaceOp` and never enters model history.
|
|
13
|
-
*/
|
|
14
|
-
'subagent/model-selection-policy': {
|
|
15
|
-
/** Exact routes this Session may select explicitly for a child. */
|
|
16
|
-
allowedModels: AllowedModelRoute[];
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
6
|
declare module '@qilin-agent/session-projection/types' {
|
|
21
7
|
interface SessionProjectionStateMap {
|
|
22
8
|
/** Exact routes authorized for child LLM selection, or null when disabled. */
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
/** Child LLM route selection for the subagent tool. */
|
|
2
2
|
import type { LlmRuntime } from '@qilin-agent/llm';
|
|
3
3
|
import type { AgentOptions } from '@qilin-agent/agent';
|
|
4
|
+
import { assertAllowedModelRoutes, modelRouteKey } from '@qilin-agent/subagent';
|
|
5
|
+
import type { AllowedModelRoute } from '@qilin-agent/subagent';
|
|
4
6
|
import z from '@qilin-agent/schemastery';
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
/** Registered LLM provider id. */
|
|
8
|
-
readonly provider: string;
|
|
9
|
-
/** Provider-owned exact model id. */
|
|
10
|
-
readonly model: string;
|
|
11
|
-
}
|
|
7
|
+
export type { AllowedModelRoute };
|
|
8
|
+
export { assertAllowedModelRoutes, modelRouteKey };
|
|
12
9
|
/** Schema shared by the Host setting and its deployment base. */
|
|
13
10
|
export declare const AllowedModelRouteSchema: z<AllowedModelRoute>;
|
|
14
11
|
/** Route-selection authority captured by one delegation definition. */
|
|
@@ -16,18 +13,6 @@ export interface ModelSelectionPolicy {
|
|
|
16
13
|
/** Exact provider/model routes authorized for explicit selection. */
|
|
17
14
|
readonly routes: readonly AllowedModelRoute[];
|
|
18
15
|
}
|
|
19
|
-
/**
|
|
20
|
-
* Stable identity for one provider/model pair.
|
|
21
|
-
* @param route - Exact provider/model route.
|
|
22
|
-
* @returns Opaque key for equality checks.
|
|
23
|
-
*/
|
|
24
|
-
export declare function modelRouteKey(route: AllowedModelRoute): string;
|
|
25
|
-
/**
|
|
26
|
-
* Reject malformed or duplicate route policy entries at a durable or configuration boundary.
|
|
27
|
-
* @param routes - Candidate exact routes to validate.
|
|
28
|
-
* @returns an assertion that the candidate is a validated exact-route array.
|
|
29
|
-
*/
|
|
30
|
-
export declare function assertAllowedModelRoutes(routes: unknown): asserts routes is readonly AllowedModelRoute[];
|
|
31
16
|
/** Model-facing child LLM route fields. */
|
|
32
17
|
export interface DelegationModelRequest {
|
|
33
18
|
readonly provider?: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qilin-agent/tool-subagent",
|
|
3
3
|
"description": "Model-facing subagent delegation tool over the ctx.subagents seam",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.8",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -35,39 +35,39 @@
|
|
|
35
35
|
],
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@qilin-agent/agent": "3.1.
|
|
39
|
-
"@qilin-agent/
|
|
40
|
-
"@qilin-agent/
|
|
41
|
-
"@qilin-agent/
|
|
42
|
-
"@qilin-agent/
|
|
43
|
-
"@qilin-agent/
|
|
44
|
-
"@qilin-agent/subagent": "3.1.
|
|
45
|
-
"@qilin-agent/
|
|
46
|
-
"@qilin-agent/
|
|
47
|
-
"@qilin-agent/
|
|
48
|
-
"@qilin-agent/kylin": "~4.0.
|
|
38
|
+
"@qilin-agent/agent": "3.1.8",
|
|
39
|
+
"@qilin-agent/llm": "3.1.8",
|
|
40
|
+
"@qilin-agent/session": "3.1.8",
|
|
41
|
+
"@qilin-agent/session-projection": "3.1.8",
|
|
42
|
+
"@qilin-agent/scope": "3.1.8",
|
|
43
|
+
"@qilin-agent/settings": "3.1.8",
|
|
44
|
+
"@qilin-agent/subagent": "3.1.8",
|
|
45
|
+
"@qilin-agent/system-prompt": "3.1.8",
|
|
46
|
+
"@qilin-agent/jobs": "3.1.8",
|
|
47
|
+
"@qilin-agent/tools": "3.1.8",
|
|
48
|
+
"@qilin-agent/kylin": "~4.0.6-alpha.2"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"
|
|
52
|
-
"
|
|
51
|
+
"@qilin-agent/schemastery": "~3.18.6-alpha.2",
|
|
52
|
+
"zod": "^4.4.3"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@qilin-agent/
|
|
56
|
-
"@qilin-agent/
|
|
57
|
-
"@qilin-agent/
|
|
58
|
-
"@qilin-agent/
|
|
59
|
-
"@qilin-agent/
|
|
60
|
-
"@qilin-agent/session-persistence": "3.1.
|
|
61
|
-
"@qilin-agent/session-persistence-jsonl": "3.1.
|
|
62
|
-
"@qilin-agent/settings": "3.1.
|
|
63
|
-
"@qilin-agent/subagent": "3.1.
|
|
64
|
-
"@qilin-agent/subagent-spawn-in-process": "3.1.
|
|
65
|
-
"@qilin-agent/
|
|
66
|
-
"@qilin-agent/
|
|
67
|
-
"@qilin-agent/
|
|
68
|
-
"@qilin-agent/
|
|
69
|
-
"@qilin-agent/
|
|
70
|
-
"@qilin-agent/
|
|
71
|
-
"@qilin-agent/session-projection": "3.1.
|
|
55
|
+
"@qilin-agent/kylin-plugin-loader": "~1.0.7-alpha.2",
|
|
56
|
+
"@qilin-agent/agent": "3.1.8",
|
|
57
|
+
"@qilin-agent/llm": "3.1.8",
|
|
58
|
+
"@qilin-agent/session": "3.1.8",
|
|
59
|
+
"@qilin-agent/scope": "3.1.8",
|
|
60
|
+
"@qilin-agent/session-persistence": "3.1.8",
|
|
61
|
+
"@qilin-agent/session-persistence-jsonl": "3.1.8",
|
|
62
|
+
"@qilin-agent/settings": "3.1.8",
|
|
63
|
+
"@qilin-agent/subagent": "3.1.8",
|
|
64
|
+
"@qilin-agent/subagent-spawn-in-process": "3.1.8",
|
|
65
|
+
"@qilin-agent/system-prompt": "3.1.8",
|
|
66
|
+
"@qilin-agent/jobs": "3.1.8",
|
|
67
|
+
"@qilin-agent/jobs-local": "3.1.8",
|
|
68
|
+
"@qilin-agent/tool-jobs": "3.1.8",
|
|
69
|
+
"@qilin-agent/tools": "3.1.8",
|
|
70
|
+
"@qilin-agent/kylin": "~4.0.6-alpha.2",
|
|
71
|
+
"@qilin-agent/session-projection": "3.1.8"
|
|
72
72
|
}
|
|
73
73
|
}
|