pi-brainstorm 0.4.0 → 0.4.2
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 +28 -2
- package/README.zh-CN.md +25 -3
- package/extensions/brainstorm.ts +4 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,13 @@ The plugin stores each participant's full contribution in a local meeting blackb
|
|
|
21
21
|
|
|
22
22
|
## Install
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
Recommended one-line install:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pi install npm:@narumitw/pi-subagents && pi install npm:pi-brainstorm
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Install only this package from npm:
|
|
25
31
|
|
|
26
32
|
```bash
|
|
27
33
|
pi install npm:pi-brainstorm
|
|
@@ -30,7 +36,7 @@ pi install npm:pi-brainstorm
|
|
|
30
36
|
From GitHub:
|
|
31
37
|
|
|
32
38
|
```bash
|
|
33
|
-
pi install git:github.com/Jarcis-cy/pi-brainstorm@v0.4.
|
|
39
|
+
pi install git:github.com/Jarcis-cy/pi-brainstorm@v0.4.2
|
|
34
40
|
```
|
|
35
41
|
|
|
36
42
|
For local development:
|
|
@@ -39,6 +45,26 @@ For local development:
|
|
|
39
45
|
pi install /Users/jarcis/Project/pi-brainstorm
|
|
40
46
|
```
|
|
41
47
|
|
|
48
|
+
## Prerequisites
|
|
49
|
+
|
|
50
|
+
`pi-brainstorm` orchestrates participants through Pi's `subagent` tool. Install the `subagent` tool separately before using `/brainstorm` or `/debate`:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pi install npm:@narumitw/pi-subagents
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`@narumitw/pi-subagents` registers the `subagent` tool used by this package to run participant agents in isolated Pi subprocesses. It is a runtime prerequisite, not bundled inside `pi-brainstorm`.
|
|
57
|
+
|
|
58
|
+
For reference, Pi's coding-agent distribution also includes an example implementation at:
|
|
59
|
+
|
|
60
|
+
```text
|
|
61
|
+
/opt/homebrew/lib/node_modules/@earendil-works/pi-coding-agent/examples/extensions/subagent/
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`pi-brainstorm` also needs participant agents such as `gpt-brainstormer`, `deepseek-brainstormer`, `minimax-brainstormer`, and `glm-brainstormer`. On first use, the extension can create or update managed user-level agent files from its YAML configuration. Existing unmanaged agent files are left untouched.
|
|
65
|
+
|
|
66
|
+
`@narumitw/pi-subagents` applies a hard subprocess timeout. If `timeoutMs` is not set, it uses `PI_SUBAGENT_TIMEOUT_MS`, or `600000` milliseconds (10 minutes) when that environment variable is unset. Long participant output is not itself a timeout condition, but generating very long output can take longer and may hit that wall-clock timeout. Participant full text is written to `.pi-meetings/...`; the main chat should only receive short `WROTE_ENTRY` summaries and facilitator synthesis.
|
|
67
|
+
|
|
42
68
|
## Configuration
|
|
43
69
|
|
|
44
70
|
Participants are defined in YAML. The extension loads config in this order (later overrides earlier):
|
package/README.zh-CN.md
CHANGED
|
@@ -21,7 +21,13 @@ English README: [README.md](./README.md).
|
|
|
21
21
|
|
|
22
22
|
## 安装
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
推荐一行安装:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pi install npm:@narumitw/pi-subagents && pi install npm:pi-brainstorm
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
只安装本包:
|
|
25
31
|
|
|
26
32
|
```bash
|
|
27
33
|
pi install npm:pi-brainstorm
|
|
@@ -30,7 +36,7 @@ pi install npm:pi-brainstorm
|
|
|
30
36
|
通过 GitHub 安装:
|
|
31
37
|
|
|
32
38
|
```bash
|
|
33
|
-
pi install git:github.com/Jarcis-cy/pi-brainstorm@v0.4.
|
|
39
|
+
pi install git:github.com/Jarcis-cy/pi-brainstorm@v0.4.2
|
|
34
40
|
```
|
|
35
41
|
|
|
36
42
|
本地开发安装:
|
|
@@ -83,10 +89,26 @@ participants:
|
|
|
83
89
|
|
|
84
90
|
## 前置条件
|
|
85
91
|
|
|
86
|
-
|
|
92
|
+
`pi-brainstorm` 通过 Pi 的 `subagent` 工具来调用各个参与者。使用 `/brainstorm` 或 `/debate` 前,请先单独安装提供 `subagent` 工具的包:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
pi install npm:@narumitw/pi-subagents
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
`@narumitw/pi-subagents` 会注册 `subagent` 工具,让 `pi-brainstorm` 能把参与者作为隔离的 Pi 子进程运行。它是运行时前置条件,不随 `pi-brainstorm` 打包。
|
|
99
|
+
|
|
100
|
+
作为参考,Pi coding-agent 发行包中也包含一个 example implementation,通常位于:
|
|
101
|
+
|
|
102
|
+
```text
|
|
103
|
+
/opt/homebrew/lib/node_modules/@earendil-works/pi-coding-agent/examples/extensions/subagent/
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
命令处理器会先创建本地会议记录,然后让主 Agent 通过 `subagent` 调用配置中定义的参与者(默认:`gpt-brainstormer`、`deepseek-brainstormer`、`minimax-brainstormer`、`glm-brainstormer`)。
|
|
87
107
|
|
|
88
108
|
第一次使用时,如果这些用户级 agent 不存在,扩展会询问是否写入内置默认定义。已有同名且不含托管标记的文件不会被覆盖。
|
|
89
109
|
|
|
110
|
+
`@narumitw/pi-subagents` 对每个子进程有 hard timeout。未设置 `timeoutMs` 时,会使用环境变量 `PI_SUBAGENT_TIMEOUT_MS`;如果环境变量也没设置,默认是 `600000` 毫秒(10 分钟)。子 agent 输出很长本身不会被判定为 timeout,但生成超长输出会增加运行时间,如果超过这个 wall-clock timeout,就会被 `subagent` 工具标记为超时。参与者全文应写入 `.pi-meetings/...`,主会话只应看到短的 `WROTE_ENTRY` 摘要和主持人综合。
|
|
111
|
+
|
|
90
112
|
## 命令
|
|
91
113
|
|
|
92
114
|
```text
|
package/extensions/brainstorm.ts
CHANGED
|
@@ -301,7 +301,6 @@ function generateAgentFile(participant: ParticipantConfig): string {
|
|
|
301
301
|
: `- 参与多模型讨论并提供${participant.displayName}视角的分析`;
|
|
302
302
|
|
|
303
303
|
return [
|
|
304
|
-
MANAGED_MARKER,
|
|
305
304
|
"---",
|
|
306
305
|
`name: ${yamlScalar(participant.agentName)}`,
|
|
307
306
|
`description: ${yamlScalar(description)}`,
|
|
@@ -309,6 +308,8 @@ function generateAgentFile(participant: ParticipantConfig): string {
|
|
|
309
308
|
`model: ${yamlScalar(participant.model)}`,
|
|
310
309
|
"---",
|
|
311
310
|
"",
|
|
311
|
+
MANAGED_MARKER,
|
|
312
|
+
"",
|
|
312
313
|
`# ${participant.displayName} Brainstormer${roleTitle}`,
|
|
313
314
|
"",
|
|
314
315
|
participant.rolePrompt,
|
|
@@ -573,7 +574,7 @@ function buildBrainstormPrompt(
|
|
|
573
574
|
"",
|
|
574
575
|
"### NEVER do this",
|
|
575
576
|
"- Do NOT fabricate or simulate a consultant's response",
|
|
576
|
-
"- Do NOT
|
|
577
|
+
"- Do NOT impose an extra manual timeout beyond the subagent tool's timeout; if the tool reports timeout, treat that attempt as failed",
|
|
577
578
|
"- Do NOT abort the entire session because one consultant failed",
|
|
578
579
|
"",
|
|
579
580
|
"## IMPORTANT",
|
|
@@ -691,7 +692,7 @@ function buildDebatePrompt(
|
|
|
691
692
|
"",
|
|
692
693
|
"### NEVER do this",
|
|
693
694
|
"- Do NOT fabricate or simulate a debater's argument",
|
|
694
|
-
"- Do NOT
|
|
695
|
+
"- Do NOT impose an extra manual timeout beyond the subagent tool's timeout; if the tool reports timeout, treat that attempt as failed",
|
|
695
696
|
"- Do NOT abort the entire debate because one debater failed",
|
|
696
697
|
"- Do NOT get stuck in an infinite retry loop — 3 attempts max per debater per cycle",
|
|
697
698
|
"",
|