@qilin-agent/subagent-spawn-in-process 3.1.3 → 3.1.4
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 +46 -46
- package/README.md +10 -11
- package/README.zh.md +10 -11
- package/lib/index.js +0 -4
- package/package.json +15 -17
package/README.i18n.yaml
CHANGED
|
@@ -5,75 +5,75 @@
|
|
|
5
5
|
/:
|
|
6
6
|
en: d510765ec1bebc28
|
|
7
7
|
zh: 35efb9f71f05f326
|
|
8
|
-
/qilin-subagent-spawn-in-process:
|
|
9
|
-
en:
|
|
10
|
-
zh:
|
|
11
|
-
/qilin-subagent-spawn-in-process/summary:
|
|
12
|
-
en:
|
|
13
|
-
zh:
|
|
14
|
-
/qilin-subagent-spawn-in-process/table-of-contents:
|
|
8
|
+
/qilin-agent-subagent-spawn-in-process:
|
|
9
|
+
en: 5a828c4312858f58
|
|
10
|
+
zh: 4dc2ae9cd19d3a23
|
|
11
|
+
/qilin-agent-subagent-spawn-in-process/summary:
|
|
12
|
+
en: 84d0a0acfc4251fe
|
|
13
|
+
zh: 8480ddf68e377522
|
|
14
|
+
/qilin-agent-subagent-spawn-in-process/table-of-contents:
|
|
15
15
|
en: d152484eb41ac6b4
|
|
16
16
|
zh: 09388d293f9be9cb
|
|
17
|
-
/qilin-subagent-spawn-in-process/use-this-package:
|
|
18
|
-
en:
|
|
19
|
-
zh:
|
|
20
|
-
/qilin-subagent-spawn-in-process/use-this-package/when-to-choose-it:
|
|
17
|
+
/qilin-agent-subagent-spawn-in-process/use-this-package:
|
|
18
|
+
en: ca895c3af2ec6371
|
|
19
|
+
zh: 51dbe9e2fa79de30
|
|
20
|
+
/qilin-agent-subagent-spawn-in-process/use-this-package/when-to-choose-it:
|
|
21
21
|
en: 5f14443940e59bb5
|
|
22
22
|
zh: 3e8610aec21c55e8
|
|
23
|
-
/qilin-subagent-spawn-in-process/use-this-package/minimal-configuration:
|
|
24
|
-
en:
|
|
25
|
-
zh:
|
|
26
|
-
/qilin-subagent-spawn-in-process/use-this-package/what-a-delegation-does:
|
|
27
|
-
en:
|
|
28
|
-
zh:
|
|
29
|
-
/qilin-subagent-spawn-in-process/understand-the-implementation:
|
|
30
|
-
en:
|
|
31
|
-
zh:
|
|
32
|
-
/qilin-subagent-spawn-in-process/understand-the-implementation/design-concept:
|
|
33
|
-
en:
|
|
34
|
-
zh:
|
|
35
|
-
/qilin-subagent-spawn-in-process/understand-the-implementation/source-map:
|
|
36
|
-
en:
|
|
37
|
-
zh:
|
|
38
|
-
/qilin-subagent-spawn-in-process/understand-the-implementation/run-flow:
|
|
39
|
-
en:
|
|
40
|
-
zh:
|
|
41
|
-
/qilin-subagent-spawn-in-process/understand-the-implementation/ownership-and-scope:
|
|
23
|
+
/qilin-agent-subagent-spawn-in-process/use-this-package/minimal-configuration:
|
|
24
|
+
en: 299cbcc3152ca1d6
|
|
25
|
+
zh: 4c93ea17c1502ffc
|
|
26
|
+
/qilin-agent-subagent-spawn-in-process/use-this-package/what-a-delegation-does:
|
|
27
|
+
en: eabf1d0e66fde8fa
|
|
28
|
+
zh: d6de66797060bac5
|
|
29
|
+
/qilin-agent-subagent-spawn-in-process/understand-the-implementation:
|
|
30
|
+
en: 7f34637751939818
|
|
31
|
+
zh: 2937553168e1aee5
|
|
32
|
+
/qilin-agent-subagent-spawn-in-process/understand-the-implementation/design-concept:
|
|
33
|
+
en: 67b871bbb7dcc803
|
|
34
|
+
zh: 79a8fec9117ef52a
|
|
35
|
+
/qilin-agent-subagent-spawn-in-process/understand-the-implementation/source-map:
|
|
36
|
+
en: b7c55a4bff3ae1f0
|
|
37
|
+
zh: 9d0f514f433250c6
|
|
38
|
+
/qilin-agent-subagent-spawn-in-process/understand-the-implementation/run-flow:
|
|
39
|
+
en: 5f07f1044bf7c370
|
|
40
|
+
zh: d31a485a3e333500
|
|
41
|
+
/qilin-agent-subagent-spawn-in-process/understand-the-implementation/ownership-and-scope:
|
|
42
42
|
en: 8af949dc29cb4a5c
|
|
43
43
|
zh: f4e4f9f9f4a4b7c9
|
|
44
|
-
/qilin-subagent-spawn-in-process/further-exploration:
|
|
45
|
-
en:
|
|
46
|
-
zh:
|
|
47
|
-
/qilin-subagent-spawn-in-process/model-experience:
|
|
44
|
+
/qilin-agent-subagent-spawn-in-process/further-exploration:
|
|
45
|
+
en: b275879e2b78c151
|
|
46
|
+
zh: d2fdcafcc8e99469
|
|
47
|
+
/qilin-agent-subagent-spawn-in-process/model-experience:
|
|
48
48
|
en: 215e7ba838619b7b
|
|
49
49
|
zh: a311da3843709f90
|
|
50
|
-
/qilin-subagent-spawn-in-process/model-experience/child-agent-request:
|
|
50
|
+
/qilin-agent-subagent-spawn-in-process/model-experience/child-agent-request:
|
|
51
51
|
en: 05e6180f1498fdf9
|
|
52
52
|
zh: 2b05d2b97bfa67da
|
|
53
|
-
/qilin-subagent-spawn-in-process/model-experience/child-agent-request/what-the-model-sees:
|
|
53
|
+
/qilin-agent-subagent-spawn-in-process/model-experience/child-agent-request/what-the-model-sees:
|
|
54
54
|
en: 2035bdd8640e5a8a
|
|
55
55
|
zh: 5afa645d7dbe31a5
|
|
56
|
-
/qilin-subagent-spawn-in-process/model-experience/child-agent-request/token-effect:
|
|
56
|
+
/qilin-agent-subagent-spawn-in-process/model-experience/child-agent-request/token-effect:
|
|
57
57
|
en: e74d21e38e4a53a9
|
|
58
58
|
zh: 6a5e3ef5fe0f4f14
|
|
59
|
-
/qilin-subagent-spawn-in-process/model-experience/child-agent-request/kv-cache-effect:
|
|
59
|
+
/qilin-agent-subagent-spawn-in-process/model-experience/child-agent-request/kv-cache-effect:
|
|
60
60
|
en: 78d800b26fb3b0af
|
|
61
61
|
zh: 313169b62c29af1d
|
|
62
|
-
/qilin-subagent-spawn-in-process/model-experience/parent-tool-result-indirectly:
|
|
62
|
+
/qilin-agent-subagent-spawn-in-process/model-experience/parent-tool-result-indirectly:
|
|
63
63
|
en: 75d061c2151624a7
|
|
64
64
|
zh: 71e58e020b60ff90
|
|
65
|
-
/qilin-subagent-spawn-in-process/model-experience/parent-tool-result-indirectly/what-the-model-sees:
|
|
66
|
-
en:
|
|
67
|
-
zh:
|
|
68
|
-
/qilin-subagent-spawn-in-process/model-experience/parent-tool-result-indirectly/token-effect:
|
|
65
|
+
/qilin-agent-subagent-spawn-in-process/model-experience/parent-tool-result-indirectly/what-the-model-sees:
|
|
66
|
+
en: caf11edef2516b8c
|
|
67
|
+
zh: 25bcb16cceaad06d
|
|
68
|
+
/qilin-agent-subagent-spawn-in-process/model-experience/parent-tool-result-indirectly/token-effect:
|
|
69
69
|
en: ff8045aa0f466c2a
|
|
70
70
|
zh: e38fc5c6af2ce076
|
|
71
|
-
/qilin-subagent-spawn-in-process/model-experience/parent-tool-result-indirectly/kv-cache-effect:
|
|
71
|
+
/qilin-agent-subagent-spawn-in-process/model-experience/parent-tool-result-indirectly/kv-cache-effect:
|
|
72
72
|
en: f5d5f97a153f7c70
|
|
73
73
|
zh: 3d6bc05b9eadfbc2
|
|
74
|
-
/qilin-subagent-spawn-in-process/known-limitations-and-deferred-work:
|
|
74
|
+
/qilin-agent-subagent-spawn-in-process/known-limitations-and-deferred-work:
|
|
75
75
|
en: 68720f2a663a4aad
|
|
76
76
|
zh: a472436c5cc2b801
|
|
77
|
-
/qilin-subagent-spawn-in-process/known-limitations-and-deferred-work/dev-note:
|
|
77
|
+
/qilin-agent-subagent-spawn-in-process/known-limitations-and-deferred-work/dev-note:
|
|
78
78
|
en: e67f633dc6fe7773
|
|
79
79
|
zh: 3bb0c20c93f16f98
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
|
|
|
9
9
|
|
|
10
10
|
## Summary
|
|
11
11
|
|
|
12
|
-
`
|
|
12
|
+
`dsh-subagent-spawn-in-process` is an in-process subagent backend: it runs each delegated task in a fresh child agent that shares this process and its agent factory, LLM, and tool services. The child starts with an empty conversation, so a task prompt must stand alone; it inherits the parent's working directory, session lineage, provider, model, reasoning effort, and output-token limit unless `request.agentOptions` overrides them. A delegation tool or API call reaches it under the `spawn` provider name. Choose it for the cheapest delegation transport; choose the fork backend when the child must build on the parent's completed conversation turns.
|
|
13
13
|
|
|
14
14
|
## Table of Contents
|
|
15
15
|
|
|
@@ -25,7 +25,7 @@ English | [中文](README.zh.md)
|
|
|
25
25
|
<a id="use-this-package"></a>
|
|
26
26
|
## Use this package
|
|
27
27
|
|
|
28
|
-
Mount this backend in a composition that delegates work to fresh in-process children. The common path is explicit: load the subagent service and this backend, then point a delegation tool such as `
|
|
28
|
+
Mount this backend in a composition that delegates work to fresh in-process children. The common path is explicit: load the subagent service and this backend, then point a delegation tool such as `dsh-tool-subagent` at the `spawn` provider.
|
|
29
29
|
|
|
30
30
|
### When to choose it
|
|
31
31
|
|
|
@@ -51,7 +51,7 @@ The generated [configuration catalog](../../../docs/config-catalog.md#qilin-agen
|
|
|
51
51
|
|
|
52
52
|
### What a delegation does
|
|
53
53
|
|
|
54
|
-
One tool call
|
|
54
|
+
One tool call creates a background child and returns its session id immediately. The child works in its own session; the parent receives its final answer in a completion notice. The child can also send messages through `send_message`. A rejected start leaves no published child. Programmatic callers such as workflows can await the activation result directly.
|
|
55
55
|
|
|
56
56
|
-----
|
|
57
57
|
|
|
@@ -61,21 +61,21 @@ One tool call starts one child and waits for its result: the child works in its
|
|
|
61
61
|
<details>
|
|
62
62
|
<summary>Implementation internals — click to expand</summary>
|
|
63
63
|
|
|
64
|
-
This section explains
|
|
64
|
+
This section explains provider preparation and the activation lifecycle owned by the subagent service.
|
|
65
65
|
|
|
66
66
|
### Design concept
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
This backend registers the provider and prepares a fresh child session. `dsh-subagent` owns activation depth checks, child creation, tool and persona setup, structured output, result collection, and disposal. The caller signal cancels unpublished creation; the published handle cancels and reaches quiescence through `dispose()`.
|
|
69
69
|
|
|
70
70
|
### Source map
|
|
71
71
|
|
|
72
72
|
| File | Role |
|
|
73
73
|
|---|---|
|
|
74
|
-
| [`src/index.ts`](src/index.ts) | Provider registration: `Config` schema, capability declaration, `
|
|
74
|
+
| [`src/index.ts`](src/index.ts) | Provider registration: `Config` schema, capability declaration, `prepareContinuable()` |
|
|
75
75
|
|
|
76
76
|
### Run flow
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
`startActivation()` resolves the provider and calls `prepareContinuable()`, then creates and publishes the child. Structured output is attached separately for each activation. Callers can await `result` and use `dispose()` to wait for the entire child subtree to reach quiescence.
|
|
79
79
|
|
|
80
80
|
### Ownership and scope
|
|
81
81
|
|
|
@@ -91,9 +91,8 @@ The child gets a fresh flat registration scope: parent tool restrictions and aut
|
|
|
91
91
|
Read these pages when the package-level contract is not enough; they move from the shared subagent model to the sibling backends and exhaustive configuration.
|
|
92
92
|
|
|
93
93
|
- [Subagent subsystem](../../../docs/subsystems/subagent.md) — start requests, results, live runs, and the provider contract.
|
|
94
|
-
- [
|
|
95
|
-
- [
|
|
96
|
-
- [qilin-tool-subagent](../tool-subagent/README.md) — the model-facing delegation tool that reaches this provider.
|
|
94
|
+
- [dsh-subagent-fork-in-process](../subagent-fork-in-process/README.md) — the sibling backend that seeds completed parent turns.
|
|
95
|
+
- [dsh-tool-subagent](../tool-subagent/README.md) — the model-facing delegation tool that reaches this provider.
|
|
97
96
|
- [Generated configuration catalog](../../../docs/config-catalog.md#qilin-agentsubagent-spawn-in-process) — every accepted config field and its source declaration.
|
|
98
97
|
|
|
99
98
|
-----
|
|
@@ -119,7 +118,7 @@ The child's request cache is independent of the parent's. Child history grows ap
|
|
|
119
118
|
|
|
120
119
|
#### What the model sees
|
|
121
120
|
|
|
122
|
-
Through `
|
|
121
|
+
Through `dsh-tool-subagent`, the parent first receives the child session id, then a completion notice with its final answer. Child-authored messages arrive through `send_message`. Internal child tool calls remain in the child session.
|
|
123
122
|
|
|
124
123
|
#### Token effect
|
|
125
124
|
|
package/README.zh.md
CHANGED
|
@@ -9,7 +9,7 @@ kind: "package-reference"
|
|
|
9
9
|
|
|
10
10
|
## 概述
|
|
11
11
|
|
|
12
|
-
`
|
|
12
|
+
`dsh-subagent-spawn-in-process` 是一个进程内 subagent 后端:它在当前进程中运行每个委派任务,子 agent(智能体)是一个全新子 `Agent`,复用宿主的 agent 工厂及 LLM(大语言模型)/工具服务。子 agent 以空对话开始,因此任务提示词必须自足;除非 `request.agentOptions` 覆盖,否则它继承父 agent 的工作目录、会话谱系、提供方、模型、推理强度与输出 token 上限。委派工具或 API 调用以 `spawn` 提供方名称找到它。需要成本最低的委派传输时选择它;需要子 agent 建立在父级已完成对话轮次之上时,请选择 fork 后端。
|
|
13
13
|
|
|
14
14
|
## 目录
|
|
15
15
|
|
|
@@ -25,7 +25,7 @@ kind: "package-reference"
|
|
|
25
25
|
<a id="use-this-package"></a>
|
|
26
26
|
## 使用本包
|
|
27
27
|
|
|
28
|
-
在需要把工作委派给全新进程内子 agent 的组合中挂载此后端。常用配置路径很明确:加载 subagent 服务与本后端,再把 `
|
|
28
|
+
在需要把工作委派给全新进程内子 agent 的组合中挂载此后端。常用配置路径很明确:加载 subagent 服务与本后端,再把 `dsh-tool-subagent` 之类的委派工具指向 `spawn` 提供方。
|
|
29
29
|
|
|
30
30
|
### 何时选择
|
|
31
31
|
|
|
@@ -51,7 +51,7 @@ kind: "package-reference"
|
|
|
51
51
|
|
|
52
52
|
### 一次委派会做什么
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
一次工具调用创建后台子 agent 并立即返回子会话 ID。子级在自己的会话中工作,父级通过完成通知收到其最终答案。子级也可以通过 `send_message` 发送消息。被拒绝的启动不会留下已发布的子 agent;工作流等程序调用方可以直接等待 activation 的结果。
|
|
55
55
|
|
|
56
56
|
-----
|
|
57
57
|
|
|
@@ -61,21 +61,21 @@ kind: "package-reference"
|
|
|
61
61
|
<details>
|
|
62
62
|
<summary>实现细节——点击展开</summary>
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
本节说明提供方准备工作,以及由 subagent 服务拥有的 activation 生命周期。
|
|
65
65
|
|
|
66
66
|
### 设计理念
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
本后端注册提供方并准备全新子会话。`dsh-subagent` 拥有 activation 的深度检查、子 agent 创建、工具和 persona 设置、结构化输出、结果收集及资源释放;发布前的调用方信号取消创建,发布后的句柄通过 `dispose()` 取消并等待完全停稳。
|
|
69
69
|
|
|
70
70
|
### 源码地图
|
|
71
71
|
|
|
72
72
|
| 文件 | 职责 |
|
|
73
73
|
|---|---|
|
|
74
|
-
| [`src/index.ts`](src/index.ts) | 提供方注册:`Config` schema、能力声明、`
|
|
74
|
+
| [`src/index.ts`](src/index.ts) | 提供方注册:`Config` schema、能力声明、`prepareContinuable()` |
|
|
75
75
|
|
|
76
76
|
### 运行流程
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
`startActivation()` 解析提供方并调用 `prepareContinuable()`,随后创建并发布子 agent。每次 activation 单独安装结构化输出。调用方可以等待 `result`,并通过 `dispose()` 等待整个子树完全停稳。
|
|
79
79
|
|
|
80
80
|
### 所有权与作用域
|
|
81
81
|
|
|
@@ -91,9 +91,8 @@ kind: "package-reference"
|
|
|
91
91
|
当包级约定不够用时阅读以下页面;它们从共享 subagent 模型进入兄弟后端与穷尽式配置。
|
|
92
92
|
|
|
93
93
|
- [Subagent 子系统](../../../docs/subsystems/subagent.zh.md)——启动请求、结果、实时运行与提供方约定。
|
|
94
|
-
- [
|
|
95
|
-
- [
|
|
96
|
-
- [qilin-tool-subagent](../tool-subagent/README.zh.md)——指向该提供方的面向模型委派工具。
|
|
94
|
+
- [dsh-subagent-fork-in-process](../subagent-fork-in-process/README.zh.md)——以已完成父级轮次作初始内容的兄弟后端。
|
|
95
|
+
- [dsh-tool-subagent](../tool-subagent/README.zh.md)——指向该提供方的面向模型委派工具。
|
|
97
96
|
- [生成配置目录](../../../docs/config-catalog.zh.md#qilin-agentsubagent-spawn-in-process)——每个受支持配置字段及其源声明。
|
|
98
97
|
|
|
99
98
|
-----
|
|
@@ -119,7 +118,7 @@ kind: "package-reference"
|
|
|
119
118
|
|
|
120
119
|
#### 模型看到什么
|
|
121
120
|
|
|
122
|
-
通过 `
|
|
121
|
+
通过 `dsh-tool-subagent`,父级先收到子会话 ID,随后收到包含最终答案的完成通知。子级自行编写的消息通过 `send_message` 到达。子级内部工具调用保留在子会话中。
|
|
123
122
|
|
|
124
123
|
#### Token 影响
|
|
125
124
|
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import z from "@qilin-agent/schemastery";
|
|
2
|
-
import { startInProcessRun } from "@qilin-agent/subagent-in-process-driver";
|
|
3
2
|
//#region lib/types/index.js
|
|
4
3
|
/**
|
|
5
4
|
* The in-process SPAWN subagent backend: registers a {@link SubagentProvider} on
|
|
@@ -31,9 +30,6 @@ var SpawnInProcessProvider = class {
|
|
|
31
30
|
constructor(name) {
|
|
32
31
|
this.name = name;
|
|
33
32
|
}
|
|
34
|
-
start(request) {
|
|
35
|
-
return startInProcessRun(request, {});
|
|
36
|
-
}
|
|
37
33
|
prepareContinuable() {
|
|
38
34
|
return Promise.resolve({});
|
|
39
35
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qilin-agent/subagent-spawn-in-process",
|
|
3
3
|
"description": "In-process spawn subagent backend: runs a fresh child agent on ctx.agents",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.4",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -30,8 +30,7 @@
|
|
|
30
30
|
],
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@qilin-agent/subagent": "3.1.
|
|
34
|
-
"@qilin-agent/subagent-in-process-driver": "3.1.3",
|
|
33
|
+
"@qilin-agent/subagent": "3.1.4",
|
|
35
34
|
"@qilin-agent/kylin": "~4.0.3"
|
|
36
35
|
},
|
|
37
36
|
"dependencies": {
|
|
@@ -39,20 +38,19 @@
|
|
|
39
38
|
},
|
|
40
39
|
"devDependencies": {
|
|
41
40
|
"@qilin-agent/kylin-plugin-loader": "~1.0.4",
|
|
42
|
-
"@qilin-agent/agent
|
|
43
|
-
"@qilin-agent/
|
|
44
|
-
"@qilin-agent/agent-loop-testkit": "3.1.
|
|
45
|
-
"@qilin-agent/
|
|
46
|
-
"@qilin-agent/subprocess-local": "3.1.
|
|
47
|
-
"@qilin-agent/llm": "3.1.
|
|
48
|
-
"@qilin-agent/
|
|
49
|
-
"@qilin-agent/
|
|
50
|
-
"@qilin-agent/
|
|
51
|
-
"@qilin-agent/
|
|
52
|
-
"@qilin-agent/tool-
|
|
53
|
-
"@qilin-agent/
|
|
54
|
-
"@qilin-agent/llm-deepseek": "3.1.3",
|
|
41
|
+
"@qilin-agent/agent": "3.1.4",
|
|
42
|
+
"@qilin-agent/agent-loop": "3.1.4",
|
|
43
|
+
"@qilin-agent/agent-loop-testkit": "3.1.4",
|
|
44
|
+
"@qilin-agent/bash-local": "3.1.4",
|
|
45
|
+
"@qilin-agent/subprocess-local": "3.1.4",
|
|
46
|
+
"@qilin-agent/llm": "3.1.4",
|
|
47
|
+
"@qilin-agent/session": "3.1.4",
|
|
48
|
+
"@qilin-agent/llm-deepseek": "3.1.4",
|
|
49
|
+
"@qilin-agent/subagent": "3.1.4",
|
|
50
|
+
"@qilin-agent/tool-bash": "3.1.4",
|
|
51
|
+
"@qilin-agent/tool-subagent": "3.1.4",
|
|
52
|
+
"@qilin-agent/llm-deepseek-api-key": "3.1.4",
|
|
55
53
|
"@qilin-agent/kylin": "~4.0.3",
|
|
56
|
-
"@qilin-agent/session-projection": "3.1.
|
|
54
|
+
"@qilin-agent/session-projection": "3.1.4"
|
|
57
55
|
}
|
|
58
56
|
}
|