@ssk_dev/pi-subagents-lean 0.16.1 → 0.16.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/README.md +29 -25
- package/README.zh-CN.md +37 -33
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
# @ssk_dev/pi-subagents-lean
|
|
2
2
|
|
|
3
|
-
> **Lean Pi subagent plugin
|
|
3
|
+
> **Lean Pi subagent plugin with identical features: 268 initialization tokens, 81% lighter than original.**
|
|
4
4
|
> [See my full setup for Pi](https://github.com/kunkun9527/my-lean-pi-setup)
|
|
5
5
|
|
|
6
6
|
[简体中文](README.zh-CN.md)
|
|
7
7
|
|
|
8
|
-
A
|
|
8
|
+
A lightweight Pi wrapper for [`@tintinweb/pi-subagents`](https://github.com/tintinweb/pi-subagents). It preserves the full upstream subagent engine while condensing all agent operations into a single, compact tool schema.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Core Features
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
* Full upstream runtime: Keeps agent discovery, spawning, background execution, result retrieval, steering, and lifecycle handling untouched.
|
|
13
|
+
* Unified tool interface: Combines `Agent`, `get_subagent_result`, and `steer_subagent` under one `subagent` tool.
|
|
14
|
+
* Advanced options on demand: Detailed parameters and schemas remain accessible via `help` and JSON inputs without cluttering the default prompt.
|
|
15
15
|
|
|
16
|
-
This package does
|
|
16
|
+
This package does not strip down or rewrite the underlying engine; it only slims down the prompt footprint exposed to the model.
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## Installation
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
21
|
pi install npm:@ssk_dev/pi-subagents-lean
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
Do not load
|
|
24
|
+
Do not load this alongside another `pi-subagents` wrapper to avoid registering duplicate tools.
|
|
25
25
|
|
|
26
|
-
##
|
|
26
|
+
## Usage
|
|
27
27
|
|
|
28
|
-
The model
|
|
28
|
+
The model interacts with a single tool:
|
|
29
29
|
|
|
30
30
|
```text
|
|
31
31
|
subagent
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
Supported operations
|
|
34
|
+
Supported operations include `run`, `result`, `steer`, and `help`.
|
|
35
35
|
|
|
36
36
|
```json
|
|
37
37
|
{
|
|
@@ -43,24 +43,26 @@ Supported operations are `run`, `result`, `steer`, and `help`.
|
|
|
43
43
|
}
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
Use `result` with `agent_id` to
|
|
46
|
+
* Use `result` with `agent_id` to retrieve output from a finished task.
|
|
47
|
+
* Use `steer` with `agent_id` and `message` to redirect a running agent.
|
|
48
|
+
* Use `help` to inspect advanced upstream parameters when needed.
|
|
47
49
|
|
|
48
|
-
## Important:
|
|
50
|
+
## Important: Review Your Agent Definitions
|
|
49
51
|
|
|
50
|
-
The upstream runtime
|
|
52
|
+
The upstream runtime automatically discovers built-in and custom agents across global, workspace, and project directories. This repository does not package your private agents, sessions, or memory, but it intentionally preserves that discovery mechanism.
|
|
51
53
|
|
|
52
54
|
After installation:
|
|
53
55
|
|
|
54
|
-
1.
|
|
55
|
-
2.
|
|
56
|
-
3.
|
|
57
|
-
4. Check
|
|
56
|
+
1. Review all discovered agent definitions and make sure each `model` field points to a model available in your environment.
|
|
57
|
+
2. Remove any agent types you do not need.
|
|
58
|
+
3. Adjust prompts, tools, and extension allowlists to match your workflow.
|
|
59
|
+
4. Check for naming collisions: a custom agent with the same name can override a built-in type depending on discovery precedence.
|
|
58
60
|
|
|
59
|
-
The upstream package includes built-in `general-purpose`, `Explore`, and `Plan`
|
|
61
|
+
The upstream package includes built-in `general-purpose`, `Explore`, and `Plan` types. Your environment may load additional custom definitions.
|
|
60
62
|
|
|
61
|
-
##
|
|
63
|
+
## Context Footprint Benchmark
|
|
62
64
|
|
|
63
|
-
With only this extension enabled, its recurring model
|
|
65
|
+
With only this extension enabled, its recurring initialization overhead in the model context is:
|
|
64
66
|
|
|
65
67
|
| Model-facing tool | Lean | Upstream `@tintinweb/pi-subagents@0.16.1` |
|
|
66
68
|
| --- | ---: | ---: |
|
|
@@ -69,11 +71,13 @@ With only this extension enabled, its recurring model-facing initialization cont
|
|
|
69
71
|
| Steering | Included in facade | `steer_subagent`: 156 |
|
|
70
72
|
| **Total** | **268** | **1,416** |
|
|
71
73
|
|
|
72
|
-
|
|
74
|
+
This saves **1,148 tokens (81.1%)** compared to the pinned upstream package.
|
|
75
|
+
|
|
76
|
+
The benchmark was measured on Pi 0.84.4 with `pi-context-view@0.4.3` in a fresh isolated session, excluding built-in tools, skills, context files, and unrelated extensions. Context View estimates tokens as `ceil(characters / 4)`. Pure runtime UI elements and slash commands are excluded as they are not sent to the model.
|
|
73
77
|
|
|
74
78
|
## Versions
|
|
75
79
|
|
|
76
|
-
|
|
80
|
+
Upstream runtime is pinned to `@tintinweb/pi-subagents@0.16.1`.
|
|
77
81
|
|
|
78
82
|
## Development
|
|
79
83
|
|
|
@@ -82,6 +86,6 @@ npm ci
|
|
|
82
86
|
npm run check
|
|
83
87
|
```
|
|
84
88
|
|
|
85
|
-
## License
|
|
89
|
+
## License
|
|
86
90
|
|
|
87
91
|
MIT. This project wraps the MIT-licensed [`@tintinweb/pi-subagents`](https://github.com/tintinweb/pi-subagents).
|
package/README.zh-CN.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# @ssk_dev/pi-subagents-lean
|
|
2
2
|
|
|
3
|
-
> **
|
|
4
|
-
>
|
|
3
|
+
> **Pi Subagents 精简版插件,保留全部功能,仅需 268 初始化 Token,相比原版减少 81%。**
|
|
4
|
+
> **完整配置参考:** [查看 Pi Lean Setup](https://github.com/kunkun9527/my-lean-pi-setup)
|
|
5
5
|
|
|
6
6
|
[English](README.md)
|
|
7
7
|
|
|
8
|
-
[`@tintinweb/pi-subagents`](https://github.com/tintinweb/pi-subagents)
|
|
8
|
+
基于 [`@tintinweb/pi-subagents`](https://github.com/tintinweb/pi-subagents) 的精简封装。在完整保留上游 Subagent 功能与运行时的同时,将所有操作收束为一个紧凑的工具接口,显著降低上下文占用。
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## 核心特性
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
* 完整保留上游能力:包括 Agent 发现、后台派生运行、结果获取、动态引导(Steering)以及完整的生命周期管理。
|
|
13
|
+
* 统一工具入口:将原版的 `Agent`、`get_subagent_result` 与 `steer_subagent` 整合为单个 `subagent` 工具。
|
|
14
|
+
* 按需加载高级参数:复杂参数和完整 Schema 仅在调用 `help` 或传入 JSON 时展开,不再默认常驻于 Prompt 中。
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
本插件并未简化或重写核心逻辑,而是仅对提供给模型的 Prompt 工具描述进行了深度精简。
|
|
17
17
|
|
|
18
18
|
## 安装
|
|
19
19
|
|
|
@@ -21,17 +21,17 @@
|
|
|
21
21
|
pi install npm:@ssk_dev/pi-subagents-lean
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
请勿与其它 `pi-subagents` 包装插件同时加载,以防重复注册工具。
|
|
25
25
|
|
|
26
|
-
##
|
|
26
|
+
## 使用方法
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
模型仅会看到一个工具:
|
|
29
29
|
|
|
30
30
|
```text
|
|
31
31
|
subagent
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
支持的操作包括 `run`、`result`、`steer` 和 `help`。
|
|
35
35
|
|
|
36
36
|
```json
|
|
37
37
|
{
|
|
@@ -43,45 +43,49 @@ subagent
|
|
|
43
43
|
}
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
* 使用 `result` 搭配 `agent_id` 查看已完成任务的输出结果。
|
|
47
|
+
* 使用 `steer` 搭配 `agent_id` 与 `message` 调整正在运行中的 Agent。
|
|
48
|
+
* 使用 `help` 按需查看上游高级参数配置。
|
|
47
49
|
|
|
48
|
-
##
|
|
50
|
+
## 重要提醒:检查 Agent 定义配置
|
|
49
51
|
|
|
50
|
-
|
|
52
|
+
上游运行时会自动扫描全局、工作区及项目目录中的内置与自定义 Agent。本仓库不包含任何私有 Agent、会话或记忆配置,但完整继承了这一发现机制。
|
|
51
53
|
|
|
52
|
-
|
|
54
|
+
安装完成后建议:
|
|
53
55
|
|
|
54
|
-
1.
|
|
55
|
-
2.
|
|
56
|
-
3.
|
|
57
|
-
4.
|
|
56
|
+
1. 检查扫描到的所有 Agent 定义,确保其 `model` 字段指向你当前环境中可用的模型。
|
|
57
|
+
2. 移除不需要的 Agent 类型。
|
|
58
|
+
3. 根据个人工作流调整 Prompt、工具绑定及扩展白名单。
|
|
59
|
+
4. 注意命名冲突:同名的自定义 Agent 可能会根据优先级覆盖内置类型。
|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
原版自带 `general-purpose`、`Explore` 和 `Plan` 三种预设,你的环境可能会额外加载其他自定义类型。
|
|
60
62
|
|
|
61
|
-
##
|
|
63
|
+
## 初始化上下文占用对比
|
|
62
64
|
|
|
63
|
-
|
|
65
|
+
单独启用本插件时,注入到模型初始上下文中的 Token 占用实测如下:
|
|
64
66
|
|
|
65
|
-
| 模型可见工具 | Lean |
|
|
67
|
+
| 模型可见工具 | Lean 精简版 | 原版 `@tintinweb/pi-subagents@0.16.1` |
|
|
66
68
|
| --- | ---: | ---: |
|
|
67
|
-
| Facade / `Agent` | `subagent
|
|
68
|
-
| 结果获取 |
|
|
69
|
-
| Steering |
|
|
69
|
+
| Facade / `Agent` | `subagent`: 268 | `Agent`: 1,111 |
|
|
70
|
+
| 结果获取 | 已收敛至统一工具中 | `get_subagent_result`: 149 |
|
|
71
|
+
| 任务引导 (Steering) | 已收敛至统一工具中 | `steer_subagent`: 156 |
|
|
70
72
|
| **合计** | **268** | **1,416** |
|
|
71
73
|
|
|
72
|
-
|
|
74
|
+
相比固定版本的上游扩展,初始开销减少了 **1,148 tokens(81.1%)**。
|
|
73
75
|
|
|
74
|
-
|
|
76
|
+
测试环境为 Pi 0.84.4 与 `pi-context-view@0.4.3` 独立会话,排除了 Pi 内置工具、Skills、上下文文件与无关扩展。Context View 按 `ceil(字符数 / 4)` 估算。未计入不会发送给模型的纯运行时 UI 与 Slash 命令。
|
|
75
77
|
|
|
76
|
-
|
|
78
|
+
## 版本说明
|
|
77
79
|
|
|
78
|
-
|
|
80
|
+
上游运行时锁定为 `@tintinweb/pi-subagents@0.16.1`。
|
|
81
|
+
|
|
82
|
+
## 本地开发
|
|
79
83
|
|
|
80
84
|
```bash
|
|
81
85
|
npm ci
|
|
82
86
|
npm run check
|
|
83
87
|
```
|
|
84
88
|
|
|
85
|
-
##
|
|
89
|
+
## 开源协议与致谢
|
|
86
90
|
|
|
87
|
-
MIT
|
|
91
|
+
MIT 协议。本项目封装自采用 MIT 协议的 [`@tintinweb/pi-subagents`](https://github.com/tintinweb/pi-subagents)。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ssk_dev/pi-subagents-lean",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Lean Pi subagent plugin, same functionality — 268 initialization tokens, 81% fewer than the original.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -58,4 +58,4 @@
|
|
|
58
58
|
"./index.ts"
|
|
59
59
|
]
|
|
60
60
|
}
|
|
61
|
-
}
|
|
61
|
+
}
|