pi-brainstorm 0.3.1 → 0.4.0

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 CHANGED
@@ -10,7 +10,7 @@ The plugin stores each participant's full contribution in a local meeting blackb
10
10
 
11
11
  ## Features
12
12
 
13
- - Multi-model brainstorming with configurable participants (default: GPT, DeepSeek, MiniMax).
13
+ - Multi-model brainstorming with configurable participants (default: GPT, DeepSeek, MiniMax, GLM).
14
14
  - Debate / battle mode where agents prosecute, stress-test, and challenge positions.
15
15
  - Configuration-driven: add, remove, or customize participants via YAML.
16
16
  - Round-by-round summaries focused on consensus, disagreement, and next questions.
@@ -30,7 +30,7 @@ pi install npm:pi-brainstorm
30
30
  From GitHub:
31
31
 
32
32
  ```bash
33
- pi install git:github.com/Jarcis-cy/pi-brainstorm@v0.3.1
33
+ pi install git:github.com/Jarcis-cy/pi-brainstorm@v0.4.0
34
34
  ```
35
35
 
36
36
  For local development:
package/README.zh-CN.md CHANGED
@@ -10,7 +10,7 @@ English README: [README.md](./README.md).
10
10
 
11
11
  ## 功能
12
12
 
13
- - 多模型头脑风暴:参与者可配置(默认:GPT、DeepSeek、MiniMax)。
13
+ - 多模型头脑风暴:参与者可配置(默认:GPT、DeepSeek、MiniMax、GLM)。
14
14
  - 辩论 / battle 模式:Agent 会攻击、审视、反驳彼此的观点。
15
15
  - 配置驱动:通过 YAML 添加、删除或自定义参与者。
16
16
  - 每轮输出聚焦共识、分歧、关键问题和下一步方向。
@@ -30,7 +30,7 @@ pi install npm:pi-brainstorm
30
30
  通过 GitHub 安装:
31
31
 
32
32
  ```bash
33
- pi install git:github.com/Jarcis-cy/pi-brainstorm@v0.3.1
33
+ pi install git:github.com/Jarcis-cy/pi-brainstorm@v0.4.0
34
34
  ```
35
35
 
36
36
  本地开发安装:
@@ -83,7 +83,7 @@ participants:
83
83
 
84
84
  ## 前置条件
85
85
 
86
- 该扩展依赖 pi 中已有的 `subagent` 工具。命令处理器会先创建本地会议记录,然后让主 Agent 调用配置中定义的参与者(默认:`gpt-brainstormer`、`deepseek-brainstormer`、`minimax-brainstormer`)。
86
+ 该扩展依赖 pi 中已有的 `subagent` 工具。命令处理器会先创建本地会议记录,然后让主 Agent 调用配置中定义的参与者(默认:`gpt-brainstormer`、`deepseek-brainstormer`、`minimax-brainstormer`、`glm-brainstormer`)。
87
87
 
88
88
  第一次使用时,如果这些用户级 agent 不存在,扩展会询问是否写入内置默认定义。已有同名且不含托管标记的文件不会被覆盖。
89
89
 
@@ -26,7 +26,7 @@ participants:
26
26
  - displayName: DeepSeek
27
27
  agentName: deepseek-brainstormer
28
28
  description: DeepSeek brainstorming consultant. Meticulous systems thinker for multi-model discussion sessions.
29
- model: deepseek/deepseek-v4-pro:xhigh
29
+ model: opencode-go/deepseek-v4-pro:xhigh
30
30
  roleTitle: Meticulous Systems Thinker
31
31
  rolePrompt: |
32
32
  你是多模型头脑风暴中的系统思考者。分析结构、依赖、扩展上限和失败模式。用中文回答。
@@ -56,3 +56,21 @@ participants:
56
56
  prompt: |
57
57
  DEBATE MODE. You are THE CONTRARIAN. Take the opposite position from the dominant view. Expose groupthink. Propose radical alternatives. Challenge the fundamental premise if needed. Use Chinese.
58
58
  brainstormRole: Creative lateral thinker
59
+
60
+ - displayName: GLM
61
+ agentName: glm-brainstormer
62
+ description: GLM-5.2 brainstorming consultant. Pragmatic implementer who grounds ideas in feasibility, cost, and real-world constraints.
63
+ model: opencode-go/glm-5.2:xhigh
64
+ roleTitle: Pragmatic Implementer
65
+ rolePrompt: |
66
+ 你是多模型头脑风暴中的务实执行者。当别人谈愿景、讲架构、玩创意时,你负责问:「这到底能不能做出来?」「需要多少资源?」「有什么更简单的方案?」你的价值在于把讨论拉回现实。用中文回答。
67
+ whatYouDo:
68
+ - 从可行性、成本、时间和资源角度审视每个提案
69
+ - 指出不切实际的想法——诚实、直接
70
+ - 提出更简单的替代方案,避免过度设计
71
+ - 关注执行路径和最小可行版本
72
+ debatePersona:
73
+ label: THE PRAGMATIST
74
+ prompt: |
75
+ DEBATE MODE. You are THE PRAGMATIST. Challenge every proposal on feasibility, cost, and real-world constraints. Expose impractical ideas. Push for simpler, cheaper, faster solutions. Use Chinese.
76
+ brainstormRole: Pragmatic implementer
@@ -546,6 +546,36 @@ function buildBrainstormPrompt(
546
546
  "",
547
547
  "After Round 3, present the complete structural overview and ask whether to write the final conclusion. Only write conclusion.md after the user confirms.",
548
548
  "",
549
+ "## FAILURE HANDLING",
550
+ "Subagent calls can fail (timeout, API error, model unavailable, crash). You MUST detect and handle failures:",
551
+ "",
552
+ "### Detecting failure",
553
+ "A subagent call has FAILED if:",
554
+ "- The tool result contains error text (\"error\", \"failed\", \"timeout\", \"unavailable\", \"connection\", etc.)",
555
+ "- The subagent returns no output or empty output",
556
+ "- The subagent output does NOT contain \"WROTE_ENTRY:\" (the expected success marker)",
557
+ "- The subagent produced no meeting_append_entry call (check with meeting_read_index after the parallel batch)",
558
+ "",
559
+ "### Retry strategy",
560
+ "When you detect a failure:",
561
+ "1. Wait 5-10 seconds before retrying (API rate limits may have triggered the failure)",
562
+ "2. Retry the SAME consultant with the SAME task up to 2 more times (3 attempts total)",
563
+ "3. On retry, add to the task: \"PREVIOUS ATTEMPT FAILED. This is retry N of 2. Focus only on completing your contribution and writing WROTE_ENTRY.\"",
564
+ "4. If the consultant succeeds on retry, proceed normally",
565
+ "5. If ALL retries are exhausted, treat this consultant as UNAVAILABLE for this round",
566
+ "",
567
+ "### When a consultant is UNAVAILABLE",
568
+ "- Do NOT wait indefinitely or freeze the session",
569
+ "- Proceed with the remaining consultants who succeeded",
570
+ "- In your structural overview, clearly mark the failed participant as: \"[displayName] ([agentName]): 本轮未响应 / did not respond\"",
571
+ "- Continue to the next round normally — do NOT skip the consultant in future rounds (they may recover)",
572
+ "- If the same consultant fails in 2 consecutive rounds, warn the user with the real display name, e.g.: \"DeepSeek 连续两轮失败,建议检查该模型是否可用\"",
573
+ "",
574
+ "### NEVER do this",
575
+ "- Do NOT fabricate or simulate a consultant's response",
576
+ "- Do NOT wait more than 3 minutes total per consultant (including retries)",
577
+ "- Do NOT abort the entire session because one consultant failed",
578
+ "",
549
579
  "## IMPORTANT",
550
580
  "- All responses in Chinese (中文).",
551
581
  "- Save transcript.md and (after user confirms) conclusion.md per the MEETING OUTPUT PROTOCOL.",
@@ -634,6 +664,37 @@ function buildDebatePrompt(
634
664
  "- If NOT converged: run another cycle. Keep going.",
635
665
  "- If converged: present synthesis to me.",
636
666
  "",
667
+ "## FAILURE HANDLING",
668
+ "Subagent calls can fail (timeout, API error, model unavailable, crash). You MUST detect and handle failures:",
669
+ "",
670
+ "### Detecting failure",
671
+ "A subagent call has FAILED if:",
672
+ "- The tool result contains error text (\"error\", \"failed\", \"timeout\", \"unavailable\", \"connection\", etc.)",
673
+ "- The subagent returns no output or empty output",
674
+ "- The subagent output does NOT contain \"WROTE_ENTRY:\" (the expected success marker)",
675
+ "- The subagent produced no meeting_append_entry call (check with meeting_read_index after the chain step)",
676
+ "",
677
+ "### Retry strategy",
678
+ "When you detect a failure in a chain step:",
679
+ "1. Wait 5-10 seconds before retrying (API rate limits may have triggered the failure)",
680
+ "2. Retry the SAME debater with the SAME task up to 2 more times (3 attempts total)",
681
+ "3. On retry, add to the task: \"PREVIOUS ATTEMPT FAILED. This is retry N of 2. Focus only on completing your argument and writing WROTE_ENTRY.\"",
682
+ "4. If the debater succeeds on retry, proceed to the next debater in the chain",
683
+ "5. If ALL retries are exhausted, SKIP this debater for this cycle and move to the next debater",
684
+ "",
685
+ "### When a debater is UNAVAILABLE",
686
+ "- Do NOT wait indefinitely or freeze the session",
687
+ "- Skip to the next debater in the cycle",
688
+ "- In your structural overview, clearly mark the failed participant as: \"[displayName] ([agentName]): 本轮未响应 / did not respond\"",
689
+ "- Continue the debate with remaining debaters — do NOT abort the whole debate",
690
+ "- If the same debater fails in 2 consecutive cycles, warn the user with the real display name, e.g.: \"DeepSeek 连续两轮失败,建议检查该模型是否可用\"",
691
+ "",
692
+ "### NEVER do this",
693
+ "- Do NOT fabricate or simulate a debater's argument",
694
+ "- Do NOT wait more than 3 minutes total per debater (including retries)",
695
+ "- Do NOT abort the entire debate because one debater failed",
696
+ "- Do NOT get stuck in an infinite retry loop — 3 attempts max per debater per cycle",
697
+ "",
637
698
  "## Rules",
638
699
  "- NEVER stop at a predetermined count. Only convergence or user intervention ends this debate.",
639
700
  "- All responses in Chinese (中文).",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-brainstorm",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "Multi-model brainstorming and debate sessions for pi subagents.",
5
5
  "type": "module",
6
6
  "keywords": [