@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 CHANGED
@@ -5,75 +5,75 @@
5
5
  /:
6
6
  en: d510765ec1bebc28
7
7
  zh: 35efb9f71f05f326
8
- /qilin-subagent-spawn-in-process:
9
- en: 2be56cde0ecc8599
10
- zh: 143c8e42cb2e8e42
11
- /qilin-subagent-spawn-in-process/summary:
12
- en: 77354bfb7bbb447c
13
- zh: 250fde8a163145ac
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: 8a75ad01cfe60938
19
- zh: b63a8302502d289a
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: 47275ac3ef383518
25
- zh: fae5495b7c86194a
26
- /qilin-subagent-spawn-in-process/use-this-package/what-a-delegation-does:
27
- en: 9f4e6f31ad4d86d1
28
- zh: 4ad77e0b80c6efcc
29
- /qilin-subagent-spawn-in-process/understand-the-implementation:
30
- en: 9e00b9dc2f9cf38c
31
- zh: 60ce00ce6c3b5564
32
- /qilin-subagent-spawn-in-process/understand-the-implementation/design-concept:
33
- en: 695d892574059848
34
- zh: b3acbd068cd48ffb
35
- /qilin-subagent-spawn-in-process/understand-the-implementation/source-map:
36
- en: f23771c3d213ffb1
37
- zh: c0b16b102dc26345
38
- /qilin-subagent-spawn-in-process/understand-the-implementation/run-flow:
39
- en: 7b55a5649bc38155
40
- zh: 51fe220c84ca759a
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: 023e2a87c9472ff5
46
- zh: da2a0d50eec1a8f6
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: e13dd20fc123c970
67
- zh: 031673267b742df6
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
- `qilin-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.
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 `qilin-tool-subagent` at the `spawn` provider.
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 starts one child and waits for its result: the child works in its own session and the parent receives only its final output, or an errored tool result when the run is cancelled, refused, truncated by its token limit, or rejected at startup. A rejected start leaves no published child; a completed run is disposed after its result is collected.
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 how the backend is built and where the behavior in [Use this package](#use-this-package) comes from; the shared mechanics belong to the in-process driver.
64
+ This section explains provider preparation and the activation lifecycle owned by the subagent service.
65
65
 
66
66
  ### Design concept
67
67
 
68
- One separation: this backend contributes only the provider registration and the decision to start fresh, while every run mechanic — depth checking, child creation, per-child customization, structured output, cancellation, result reading, and disposal — lives in `qilin-subagent-in-process-driver`. The agent factory's creation transaction owns the unpublished setup window and its rollback; after publication the caller owns the run.
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, `start()` |
74
+ | [`src/index.ts`](src/index.ts) | Provider registration: `Config` schema, capability declaration, `prepareContinuable()` |
75
75
 
76
76
  ### Run flow
77
77
 
78
- A start request resolves through the subagent service, then the shared driver validates depth, mints a child session id, creates the child through the host agent factory with the caller's signal, applies persona, tool filter, and structured output inside the creation window, publishes the child, drives one task, reads the child's own final output, and disposes the handle quiescently.
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
- - [qilin-subagent-in-process-driver](../subagent-in-process-driver/README.md) — the shared run driver this backend calls.
95
- - [qilin-subagent-fork-in-process](../subagent-fork-in-process/README.md) — the sibling backend that seeds completed parent turns.
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 `qilin-tool-subagent`, the parent receives only the child's final output or an errored result for a non-completed stop reason; intermediate child work never reaches it.
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
- `qilin-subagent-spawn-in-process` 是一个进程内 subagent 后端:它在当前进程中运行每个委派任务,子 agent(智能体)是一个全新子 `Agent`,复用宿主的 agent 工厂及 LLM(大语言模型)/工具服务。子 agent 以空对话开始,因此任务提示词必须自足;除非 `request.agentOptions` 覆盖,否则它继承父 agent 的工作目录、会话谱系、提供方、模型、推理强度与输出 token 上限。委派工具或 API 调用以 `spawn` 提供方名称找到它。需要成本最低的委派传输时选择它;需要子 agent 建立在父级已完成对话轮次之上时,请选择 fork 后端。
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 服务与本后端,再把 `qilin-tool-subagent` 之类的委派工具指向 `spawn` 提供方。
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
- 一次工具调用启动一个子 agent 并等待其结果:子 agent 在自有会话中工作,父级只接收其最终输出;若运行被取消、拒绝、被 token 上限截断或在启动时被拒,则收到出错的工具结果。被拒绝的启动不会留下已发布的子 agent;完成的运行在结果收集后即被 dispose(资源释放)。
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
- 本节解释后端的构建方式以及[使用本包](#use-this-package)中行为的来源;共享机制属于进程内驱动器。
64
+ 本节说明提供方准备工作,以及由 subagent 服务拥有的 activation 生命周期。
65
65
 
66
66
  ### 设计理念
67
67
 
68
- 职责划分如下:本后端只贡献提供方注册与「全新开始」的决定,其余全部运行机制——深度检查、子 agent 创建、按子 agent 定制、结构化输出、取消、结果读取与 dispose——都在 `qilin-subagent-in-process-driver` 中。agent 工厂的创建事务拥有未发布设置窗口及其回滚;发布之后,调用方拥有该运行。
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、能力声明、`start()` |
74
+ | [`src/index.ts`](src/index.ts) | 提供方注册:`Config` schema、能力声明、`prepareContinuable()` |
75
75
 
76
76
  ### 运行流程
77
77
 
78
- 启动请求先由 subagent 服务解析,然后共享驱动器校验深度、生成子会话 id、通过宿主 agent 工厂以调用方信号创建子 agent、在创建窗口内应用 persona、工具过滤器与结构化输出、发布子 agent、驱动一项任务、读取子 agent 自身的最终输出,最后完全停稳地 dispose 句柄。
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
- - [qilin-subagent-in-process-driver](../subagent-in-process-driver/README.zh.md)——本后端调用的共享运行驱动器。
95
- - [qilin-subagent-fork-in-process](../subagent-fork-in-process/README.zh.md)——以已完成父级轮次作初始内容的兄弟后端。
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
- 通过 `qilin-tool-subagent`,父级只接收子 agent 的最终输出,或非完成终止原因对应的出错结果;子 agent 的中间工作绝不会到达父级。
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.3",
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.3",
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-loop": "3.1.3",
43
- "@qilin-agent/bash-local": "3.1.3",
44
- "@qilin-agent/agent-loop-testkit": "3.1.3",
45
- "@qilin-agent/agent": "3.1.3",
46
- "@qilin-agent/subprocess-local": "3.1.3",
47
- "@qilin-agent/llm": "3.1.3",
48
- "@qilin-agent/llm-deepseek-api-key": "3.1.3",
49
- "@qilin-agent/subagent": "3.1.3",
50
- "@qilin-agent/session": "3.1.3",
51
- "@qilin-agent/subagent-in-process-driver": "3.1.3",
52
- "@qilin-agent/tool-bash": "3.1.3",
53
- "@qilin-agent/tool-subagent": "3.1.3",
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.3"
54
+ "@qilin-agent/session-projection": "3.1.4"
57
55
  }
58
56
  }