@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.
Files changed (3) hide show
  1. package/README.md +29 -25
  2. package/README.zh-CN.md +37 -33
  3. 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, same functionality 268 initialization tokens, 81% fewer than the original.**
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 token-lean Pi facade over [`@tintinweb/pi-subagents`](https://github.com/tintinweb/pi-subagents). It keeps the complete upstream subagent runtime and routes its provider-facing operations through one compact schema.
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
- ## What it keeps
10
+ ## Core Features
11
11
 
12
- - Upstream subagent discovery, spawning, background execution, result retrieval, steering, rendering, and lifecycle behavior.
13
- - The upstream `Agent`, `get_subagent_result`, and `steer_subagent` operations behind one `subagent` facade.
14
- - Full advanced parameters through on-demand `help` and JSON input.
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 **not** replace the upstream runtime with a minimal implementation. It only reduces the persistent model-facing tool surface.
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
- ## Install
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 it together with another `pi-subagents` wrapper, or subagent tools may be registered twice.
24
+ Do not load this alongside another `pi-subagents` wrapper to avoid registering duplicate tools.
25
25
 
26
- ## Use
26
+ ## Usage
27
27
 
28
- The model sees one tool:
28
+ The model interacts with a single tool:
29
29
 
30
30
  ```text
31
31
  subagent
32
32
  ```
33
33
 
34
- Supported operations are `run`, `result`, `steer`, and `help`.
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 inspect a completed run and `steer` with `agent_id` plus `message` to redirect a running agent. Use `help` for advanced upstream parameters.
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: review your agent definitions
50
+ ## Important: Review Your Agent Definitions
49
51
 
50
- The upstream runtime can discover built-in agents and custom agents from global, workspace, and project Pi locations. This repository does not ship your private agents, sessions, or memory, but it intentionally preserves that upstream discovery behavior.
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. Inspect every discovered agent definition and set its `model` to a provider/model available in your Pi environment.
55
- 2. Delete agent types you do not want.
56
- 3. Rename or modify agent types, prompts, tools, and extension lists to match your workflow.
57
- 4. Check duplicate names: a custom agent with the same name may override a built-in type depending on upstream discovery precedence.
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` definitions; your installation may expose additional custom types.
61
+ The upstream package includes built-in `general-purpose`, `Explore`, and `Plan` types. Your environment may load additional custom definitions.
60
62
 
61
- ## Measured initialization footprint
63
+ ## Context Footprint Benchmark
62
64
 
63
- With only this extension enabled, its recurring model-facing initialization contribution is:
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
- That is **1,148 fewer tokens (81.1%)** than the pinned upstream extension. The measurement used Pi 0.84.4 and `pi-context-view@0.4.3` in a fresh isolated session, excluding Pi built-in tools, skills, context files, messages, and unrelated extensions. Context View estimates text as `ceil(characters / 4)`, so these are reproducible context-footprint estimates rather than exact GPT tokenizer counts. Runtime-only UI and slash commands are not included because they are not sent to the model.
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
- The upstream runtime is pinned to `@tintinweb/pi-subagents@0.16.1`.
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 and upstream
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
- > **Lean Pi subagent 插件,功能相同:268 个初始化 tokens,较原插件减少 81%。**
4
- > **整套配置:** [查看 Pi Lean Setup](https://github.com/kunkun9527/my-lean-pi-setup)
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) token 精简版 Pi facade。它保留完整的上游 subagent 运行时,并通过一个紧凑 schema 路由面向模型的操作。
8
+ 基于 [`@tintinweb/pi-subagents`](https://github.com/tintinweb/pi-subagents) 的精简封装。在完整保留上游 Subagent 功能与运行时的同时,将所有操作收束为一个紧凑的工具接口,显著降低上下文占用。
9
9
 
10
- ## 保留的能力
10
+ ## 核心特性
11
11
 
12
- - 上游的 subagent 发现、启动、后台执行、结果获取、steering、渲染和生命周期行为。
13
- - 通过一个 `subagent` facade 提供上游 `Agent`、`get_subagent_result` `steer_subagent` 操作。
14
- - 通过按需 `help` JSON input 使用完整高级参数。
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
- 不要同时加载另一个 `pi-subagents` 包装层,否则 subagent 工具可能被重复注册。
24
+ 请勿与其它 `pi-subagents` 包装插件同时加载,以防重复注册工具。
25
25
 
26
- ## 使用
26
+ ## 使用方法
27
27
 
28
- 模型只看到一个工具:
28
+ 模型仅会看到一个工具:
29
29
 
30
30
  ```text
31
31
  subagent
32
32
  ```
33
33
 
34
- 支持的操作为 `run`、`result`、`steer` 和 `help`。
34
+ 支持的操作包括 `run`、`result`、`steer` 和 `help`。
35
35
 
36
36
  ```json
37
37
  {
@@ -43,45 +43,49 @@ subagent
43
43
  }
44
44
  ```
45
45
 
46
- 使用带 `agent_id` `result` 查看已完成任务;使用带 `agent_id` 和 `message` 的 `steer` 调整运行中的 agent。高级上游参数通过 `help` 查看。
46
+ * 使用 `result` 搭配 `agent_id` 查看已完成任务的输出结果。
47
+ * 使用 `steer` 搭配 `agent_id` 与 `message` 调整正在运行中的 Agent。
48
+ * 使用 `help` 按需查看上游高级参数配置。
47
49
 
48
- ## 重要:检查你的 agent 定义
50
+ ## 重要提醒:检查 Agent 定义配置
49
51
 
50
- 上游运行时可以从全局、workspace 和项目 Pi 位置发现内置及自定义 agents。本仓库不会携带你的私有 agents、sessions 或 memory,但会有意保留这种上游发现行为。
52
+ 上游运行时会自动扫描全局、工作区及项目目录中的内置与自定义 Agent。本仓库不包含任何私有 Agent、会话或记忆配置,但完整继承了这一发现机制。
51
53
 
52
- 安装后:
54
+ 安装完成后建议:
53
55
 
54
- 1. 检查每个被发现的 agent 定义,将其 `model` 设置为你的 Pi 环境中可用的供应商/模型。
55
- 2. 删除你不需要的 agent 类型。
56
- 3. 按工作流重命名或修改 agent 类型、提示词、工具和扩展列表。
57
- 4. 检查重名:根据上游发现优先级,同名自定义 agent 可能覆盖内置类型。
56
+ 1. 检查扫描到的所有 Agent 定义,确保其 `model` 字段指向你当前环境中可用的模型。
57
+ 2. 移除不需要的 Agent 类型。
58
+ 3. 根据个人工作流调整 Prompt、工具绑定及扩展白名单。
59
+ 4. 注意命名冲突:同名的自定义 Agent 可能会根据优先级覆盖内置类型。
58
60
 
59
- 上游包包含内置 `general-purpose`、`Explore` 和 `Plan` 定义;你的安装还可能暴露其他自定义类型。
61
+ 原版自带 `general-purpose`、`Explore` 和 `Plan` 三种预设,你的环境可能会额外加载其他自定义类型。
60
62
 
61
- ## 实测初始化上下文占用
63
+ ## 初始化上下文占用对比
62
64
 
63
- 仅启用本扩展时,它持续贡献给模型的初始化上下文为:
65
+ 单独启用本插件时,注入到模型初始上下文中的 Token 占用实测如下:
64
66
 
65
- | 模型可见工具 | Lean | 上游 `@tintinweb/pi-subagents@0.16.1` |
67
+ | 模型可见工具 | Lean 精简版 | 原版 `@tintinweb/pi-subagents@0.16.1` |
66
68
  | --- | ---: | ---: |
67
- | Facade / `Agent` | `subagent`:268 | `Agent`:1,111 |
68
- | 结果获取 | 已包含在 facade 中 | `get_subagent_result`:149 |
69
- | Steering | 已包含在 facade 中 | `steer_subagent`:156 |
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
- 相比固定版本的上游扩展,减少 **1,148 tokens(81.1%)**。测量使用 Pi 0.84.4 和 `pi-context-view@0.4.3`,在全新隔离会话中只启用目标扩展,并排除 Pi 内置工具、skills、context files、消息及无关扩展。Context View 按 `ceil(字符数 / 4)` 估算,因此这些是可复现的上下文占用估值,不是 GPT tokenizer 的精确计数。未计入不会发送给模型的纯运行时 UI 和 slash commands。
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
- 上游运行时固定为 `@tintinweb/pi-subagents@0.16.1`。
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。本项目包装了采用 MIT 许可证的 [`@tintinweb/pi-subagents`](https://github.com/tintinweb/pi-subagents)。
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.1",
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
+ }