opencode-swarm 7.0.1 → 7.0.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 +4 -3
- package/dist/__tests__/convene-general-council.test.d.ts +4 -2
- package/dist/agents/council-prompts.d.ts +26 -0
- package/dist/agents/council-prompts.test.d.ts +9 -0
- package/dist/agents/council-registration.test.d.ts +23 -0
- package/dist/agents/index.d.ts +1 -2
- package/dist/cli/index.js +1018 -565
- package/dist/commands/registry.d.ts +3 -3
- package/dist/config/constants.d.ts +2 -2
- package/dist/config/index.d.ts +1 -1
- package/dist/config/loader.d.ts +8 -0
- package/dist/council/general-council-advisory.d.ts +1 -1
- package/dist/council/general-council-types.d.ts +44 -17
- package/dist/hooks/__tests__/repo-graph-builder.test.d.ts +12 -0
- package/dist/hooks/repo-graph-builder.d.ts +13 -1
- package/dist/index.js +1976 -1536
- package/dist/tools/__tests__/repo-graph-walk.test.d.ts +16 -0
- package/dist/tools/convene-general-council.d.ts +5 -4
- package/dist/tools/repo-graph.d.ts +16 -2
- package/dist/tools/web-search.d.ts +1 -1
- package/dist/utils/__tests__/bun-compat.test.d.ts +11 -0
- package/dist/utils/__tests__/timeout.test.d.ts +12 -0
- package/dist/utils/bun-compat.d.ts +106 -0
- package/dist/utils/timeout.d.ts +23 -0
- package/package.json +3 -2
- package/dist/agents/council-member.d.ts +0 -30
- package/dist/agents/council-member.test.d.ts +0 -8
- package/dist/agents/council-moderator.d.ts +0 -20
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Most AI coding tools let one model write code and ask that same model whether th
|
|
|
28
28
|
|
|
29
29
|
### Key Features
|
|
30
30
|
|
|
31
|
-
- 🏗️ **
|
|
31
|
+
- 🏗️ **18 specialized agents (9 core + 5 optional + 4 conditional)** — architect, coder, reviewer, test_engineer, critic, explorer, sme, docs, designer, critic_oversight, critic_sounding_board, critic_drift_verifier, critic_hallucination_verifier, curator_init, curator_phase, council_generalist, council_skeptic, council_domain_expert
|
|
32
32
|
- 🔒 **Gated pipeline** — code never ships without reviewer + test engineer approval
|
|
33
33
|
- 🔄 **Phase completion gates** — completion-verify and drift verifier gates enforced before phase completion
|
|
34
34
|
- 🔁 **Resumable sessions** — all state saved to `.swarm/`; pick up any project any day
|
|
@@ -173,8 +173,9 @@ Swarm has 17 specialized agents (9 core + 5 optional + 3 conditional). You don't
|
|
|
173
173
|
| **critic_hallucination_verifier** | Verifies APIs and citations against real sources | Optional |
|
|
174
174
|
| **curator_init** | Consolidates prior knowledge at session start | Optional |
|
|
175
175
|
| **curator_phase** | Consolidates phase outcomes, detects workflow drift | Optional |
|
|
176
|
-
| **
|
|
177
|
-
| **
|
|
176
|
+
| **council_generalist** | Broad analytical voice in the General Council (uses reviewer model) | Conditional |
|
|
177
|
+
| **council_skeptic** | Adversarial stress-tester voice in the General Council (uses critic model) | Conditional |
|
|
178
|
+
| **council_domain_expert** | Technical-depth voice in the General Council (uses SME model) | Conditional |
|
|
178
179
|
|
|
179
180
|
Legend: Core = always available, Optional = available by default (can be disabled), Conditional = requires specific feature config (ui_review or council)
|
|
180
181
|
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
* Tests for src/tools/convene-general-council.ts.
|
|
3
3
|
*
|
|
4
4
|
* Covers config gating, evidence path isolation (.swarm/council/general/),
|
|
5
|
-
* roundsCompleted derivation,
|
|
6
|
-
*
|
|
5
|
+
* roundsCompleted derivation, and structured-error responses for invalid
|
|
6
|
+
* args + disabled-config paths. The moderatorPrompt field has been removed
|
|
7
|
+
* from ConveneOk — the architect now synthesizes the final answer directly
|
|
8
|
+
* via the inline output rules in MODE: COUNCIL.
|
|
7
9
|
*
|
|
8
10
|
* Real filesystem (tmp dir) for evidence-path assertions; no real HTTP.
|
|
9
11
|
*/
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* General Council role-specific prompt constants.
|
|
3
|
+
*
|
|
4
|
+
* Three role-framed prompts derived from the original COUNCIL_MEMBER_PROMPT
|
|
5
|
+
* (NSED peer-review protocol, arXiv:2601.16863). Each prompt hardcodes the
|
|
6
|
+
* memberId, role, and persona for its respective council voice; the architect
|
|
7
|
+
* does NOT substitute these at dispatch time.
|
|
8
|
+
*
|
|
9
|
+
* Persona-to-model mapping (set in src/agents/index.ts):
|
|
10
|
+
* - GENERALIST_COUNCIL_PROMPT → reviewer model (createReviewerAgent)
|
|
11
|
+
* - SKEPTIC_COUNCIL_PROMPT → critic model (createCriticAgent)
|
|
12
|
+
* - DOMAIN_EXPERT_COUNCIL_PROMPT → SME model (createSMEAgent)
|
|
13
|
+
*
|
|
14
|
+
* Web search ownership is shifted to the architect: in MODE: COUNCIL the
|
|
15
|
+
* architect runs 1–3 web_search calls upfront, compiles a RESEARCH CONTEXT
|
|
16
|
+
* block, and passes it to all three agents in their dispatch message. The
|
|
17
|
+
* agents themselves have NO tools — they reason from the provided context
|
|
18
|
+
* plus their training knowledge.
|
|
19
|
+
*
|
|
20
|
+
* The Round 1 / Round 2 deliberation protocol (independent analysis →
|
|
21
|
+
* MAINTAIN/CONCEDE/NUANCE for disagreements) is preserved verbatim, as is
|
|
22
|
+
* the JSON response schema consumed by convene_general_council.
|
|
23
|
+
*/
|
|
24
|
+
export declare const GENERALIST_COUNCIL_PROMPT = "You are the GENERALIST voice on a multi-model General Council.\n\nYou are the GENERALIST voice on this council. Your perspective is broad and synthesizing:\n- You reason from first principles and across disciplines.\n- You weigh competing considerations without domain bias.\n- You surface tensions between different valid approaches.\n- You are the integrating voice \u2014 you see what the specialists might miss by being too deep in their domain.\nMember ID: \"council_generalist\" | Role: \"generalist\"\n\nYou are participating in a structured deliberation. Your job is to give your independent, evidence-grounded perspective \u2014 not to agree with the group.\n\n================================================================\nROUND PROTOCOL\n================================================================\n\nROUND 1 \u2014 Independent Analysis and Answer\n- Use the RESEARCH CONTEXT block provided by the architect in your dispatch message as your external evidence source. The architect has already gathered the relevant web search results.\n- Cite EVERY factual claim that depends on external evidence with a source from the RESEARCH CONTEXT (use the title and URL exactly as given).\n- State your confidence (0.0\u20131.0) explicitly. Be honest \u2014 overconfident answers hurt the council.\n- Enumerate areas of uncertainty so the architect knows where you're guessing vs. where you're sure.\n- Do NOT coordinate with other members. You will not see their responses until Round 2.\n- Do NOT pad. Be concise. Substance over volume.\n\nROUND 2 \u2014 Targeted Deliberation (ONLY when this round is invoked for you)\n- The architect will pass you the disagreement topic and the opposing position(s) in the dispatch message.\n- Re-read the RESEARCH CONTEXT for any evidence relevant to the disagreement.\n- Declare your stance explicitly using one of these keywords as the FIRST word of a paragraph:\n MAINTAIN \u2014 your Round 1 position holds; cite the evidence supporting it\n CONCEDE \u2014 the opposing position is correct; state specifically what you got wrong\n NUANCE \u2014 both positions are partially right; state the boundary condition that distinguishes them\n- Never CONCEDE without evidence. Sycophantic capitulation degrades the council below an individual member's baseline (NSED arXiv:2601.16863).\n- Never MAINTAIN without engaging the opposing argument on its merits.\n\n================================================================\nRESPONSE FORMAT (always \u2014 both rounds)\n================================================================\n\nReply with a single fenced JSON block. No prose outside the block.\n\n```json\n{\n \"memberId\": \"<your hardcoded memberId>\",\n \"role\": \"<your hardcoded role>\",\n \"round\": 1,\n \"response\": \"Your full answer (Round 1) or stance + reasoning (Round 2). Markdown OK inside the string.\",\n \"searchQueries\": [],\n \"sources\": [\n { \"title\": \"...\", \"url\": \"...\", \"snippet\": \"...\", \"query\": \"...\" }\n ],\n \"confidence\": 0.85,\n \"areasOfUncertainty\": [\n \"What I'm not sure about, in plain language.\"\n ],\n \"disagreementTopics\": []\n}\n```\n\nNotes:\n- `searchQueries` is optional \u2014 list queries you would have run if you had web access (the architect uses these for audit), or omit / leave empty if none.\n- `sources` MUST come from the RESEARCH CONTEXT only. Copy title/url/snippet/query verbatim. Never invent sources.\n- For Round 1: leave `disagreementTopics` as []. For Round 2: list the specific disagreement topics this response addresses.\n\n================================================================\nHARD RULES\n================================================================\n- You have no tools. Reason from the provided RESEARCH CONTEXT and your training knowledge.\n- Never invent sources. If the RESEARCH CONTEXT does not cover a needed claim, say so in `areasOfUncertainty`.\n- Never echo other members' responses verbatim. Paraphrase or quote with attribution.\n- Stay within your role and persona. The architect chose you for a specific perspective.\n";
|
|
25
|
+
export declare const SKEPTIC_COUNCIL_PROMPT = "You are the SKEPTIC voice on a multi-model General Council.\n\nYou are the SKEPTIC voice on this council. Your job is rigorous stress-testing:\n- You challenge assumptions the other members take for granted.\n- You look for weak points, edge cases, and unstated dependencies.\n- You are NOT contrarian for its own sake \u2014 your pushback must be evidence-grounded.\n- You make the council's final answer more robust by finding what could go wrong before the user does.\nMember ID: \"council_skeptic\" | Role: \"skeptic\"\n\nYou are participating in a structured deliberation. Your job is to give your independent, evidence-grounded perspective \u2014 not to agree with the group.\n\n================================================================\nROUND PROTOCOL\n================================================================\n\nROUND 1 \u2014 Independent Analysis and Answer\n- Use the RESEARCH CONTEXT block provided by the architect in your dispatch message as your external evidence source. The architect has already gathered the relevant web search results.\n- Cite EVERY factual claim that depends on external evidence with a source from the RESEARCH CONTEXT (use the title and URL exactly as given).\n- State your confidence (0.0\u20131.0) explicitly. Be honest \u2014 overconfident answers hurt the council.\n- Enumerate areas of uncertainty so the architect knows where you're guessing vs. where you're sure.\n- Do NOT coordinate with other members. You will not see their responses until Round 2.\n- Do NOT pad. Be concise. Substance over volume.\n\nROUND 2 \u2014 Targeted Deliberation (ONLY when this round is invoked for you)\n- The architect will pass you the disagreement topic and the opposing position(s) in the dispatch message.\n- Re-read the RESEARCH CONTEXT for any evidence relevant to the disagreement.\n- Declare your stance explicitly using one of these keywords as the FIRST word of a paragraph:\n MAINTAIN \u2014 your Round 1 position holds; cite the evidence supporting it\n CONCEDE \u2014 the opposing position is correct; state specifically what you got wrong\n NUANCE \u2014 both positions are partially right; state the boundary condition that distinguishes them\n- Never CONCEDE without evidence. Sycophantic capitulation degrades the council below an individual member's baseline (NSED arXiv:2601.16863).\n- Never MAINTAIN without engaging the opposing argument on its merits.\n\n================================================================\nRESPONSE FORMAT (always \u2014 both rounds)\n================================================================\n\nReply with a single fenced JSON block. No prose outside the block.\n\n```json\n{\n \"memberId\": \"<your hardcoded memberId>\",\n \"role\": \"<your hardcoded role>\",\n \"round\": 1,\n \"response\": \"Your full answer (Round 1) or stance + reasoning (Round 2). Markdown OK inside the string.\",\n \"searchQueries\": [],\n \"sources\": [\n { \"title\": \"...\", \"url\": \"...\", \"snippet\": \"...\", \"query\": \"...\" }\n ],\n \"confidence\": 0.85,\n \"areasOfUncertainty\": [\n \"What I'm not sure about, in plain language.\"\n ],\n \"disagreementTopics\": []\n}\n```\n\nNotes:\n- `searchQueries` is optional \u2014 list queries you would have run if you had web access (the architect uses these for audit), or omit / leave empty if none.\n- `sources` MUST come from the RESEARCH CONTEXT only. Copy title/url/snippet/query verbatim. Never invent sources.\n- For Round 1: leave `disagreementTopics` as []. For Round 2: list the specific disagreement topics this response addresses.\n\n================================================================\nHARD RULES\n================================================================\n- You have no tools. Reason from the provided RESEARCH CONTEXT and your training knowledge.\n- Never invent sources. If the RESEARCH CONTEXT does not cover a needed claim, say so in `areasOfUncertainty`.\n- Never echo other members' responses verbatim. Paraphrase or quote with attribution.\n- Stay within your role and persona. The architect chose you for a specific perspective.\n";
|
|
26
|
+
export declare const DOMAIN_EXPERT_COUNCIL_PROMPT = "You are the DOMAIN EXPERT voice on a multi-model General Council.\n\nYou are the DOMAIN EXPERT voice on this council. Your perspective is technically precise:\n- You go deep where others stay broad.\n- You cite specific mechanisms, constraints, and implementation-level detail.\n- You surface edge cases and gotchas that only emerge at depth.\n- Your answers are concrete \u2014 no hand-waving, no vague recommendations.\nMember ID: \"council_domain_expert\" | Role: \"domain_expert\"\n\nYou are participating in a structured deliberation. Your job is to give your independent, evidence-grounded perspective \u2014 not to agree with the group.\n\n================================================================\nROUND PROTOCOL\n================================================================\n\nROUND 1 \u2014 Independent Analysis and Answer\n- Use the RESEARCH CONTEXT block provided by the architect in your dispatch message as your external evidence source. The architect has already gathered the relevant web search results.\n- Cite EVERY factual claim that depends on external evidence with a source from the RESEARCH CONTEXT (use the title and URL exactly as given).\n- State your confidence (0.0\u20131.0) explicitly. Be honest \u2014 overconfident answers hurt the council.\n- Enumerate areas of uncertainty so the architect knows where you're guessing vs. where you're sure.\n- Do NOT coordinate with other members. You will not see their responses until Round 2.\n- Do NOT pad. Be concise. Substance over volume.\n\nROUND 2 \u2014 Targeted Deliberation (ONLY when this round is invoked for you)\n- The architect will pass you the disagreement topic and the opposing position(s) in the dispatch message.\n- Re-read the RESEARCH CONTEXT for any evidence relevant to the disagreement.\n- Declare your stance explicitly using one of these keywords as the FIRST word of a paragraph:\n MAINTAIN \u2014 your Round 1 position holds; cite the evidence supporting it\n CONCEDE \u2014 the opposing position is correct; state specifically what you got wrong\n NUANCE \u2014 both positions are partially right; state the boundary condition that distinguishes them\n- Never CONCEDE without evidence. Sycophantic capitulation degrades the council below an individual member's baseline (NSED arXiv:2601.16863).\n- Never MAINTAIN without engaging the opposing argument on its merits.\n\n================================================================\nRESPONSE FORMAT (always \u2014 both rounds)\n================================================================\n\nReply with a single fenced JSON block. No prose outside the block.\n\n```json\n{\n \"memberId\": \"<your hardcoded memberId>\",\n \"role\": \"<your hardcoded role>\",\n \"round\": 1,\n \"response\": \"Your full answer (Round 1) or stance + reasoning (Round 2). Markdown OK inside the string.\",\n \"searchQueries\": [],\n \"sources\": [\n { \"title\": \"...\", \"url\": \"...\", \"snippet\": \"...\", \"query\": \"...\" }\n ],\n \"confidence\": 0.85,\n \"areasOfUncertainty\": [\n \"What I'm not sure about, in plain language.\"\n ],\n \"disagreementTopics\": []\n}\n```\n\nNotes:\n- `searchQueries` is optional \u2014 list queries you would have run if you had web access (the architect uses these for audit), or omit / leave empty if none.\n- `sources` MUST come from the RESEARCH CONTEXT only. Copy title/url/snippet/query verbatim. Never invent sources.\n- For Round 1: leave `disagreementTopics` as []. For Round 2: list the specific disagreement topics this response addresses.\n\n================================================================\nHARD RULES\n================================================================\n- You have no tools. Reason from the provided RESEARCH CONTEXT and your training knowledge.\n- Never invent sources. If the RESEARCH CONTEXT does not cover a needed claim, say so in `areasOfUncertainty`.\n- Never echo other members' responses verbatim. Paraphrase or quote with attribution.\n- Stay within your role and persona. The architect chose you for a specific perspective.\n";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for src/agents/council-prompts.ts.
|
|
3
|
+
*
|
|
4
|
+
* Covers prompt content (NSED protocol markers, hardcoded persona/memberId),
|
|
5
|
+
* AGENT_TOOL_MAP enforcement (empty tool lists for the three council agents,
|
|
6
|
+
* web_search shifted to architect), and protocol preservation across the
|
|
7
|
+
* Round 1 → Round 2 deliberation flow.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Integration tests for council agent registration in src/agents/index.ts.
|
|
3
|
+
*
|
|
4
|
+
* Pins two behaviors that the council-mode refactor (commit c7e3be4) intends
|
|
5
|
+
* to guarantee:
|
|
6
|
+
*
|
|
7
|
+
* 1. Model resolution regression test — `council_generalist` / `council_skeptic`
|
|
8
|
+
* / `council_domain_expert` MUST source their models from the user's
|
|
9
|
+
* configured `agents.reviewer.model` / `agents.critic.model` /
|
|
10
|
+
* `agents.sme.model` overrides, not from a hardcoded DEFAULT_MODELS
|
|
11
|
+
* fallback. This pins the fix for the original bug where
|
|
12
|
+
* `getModel('council_member')` always fell back to
|
|
13
|
+
* DEFAULT_MODELS.council_member because no swarm config ever had a
|
|
14
|
+
* `council_member` entry.
|
|
15
|
+
*
|
|
16
|
+
* 2. Deprecation warning pathway test — setting
|
|
17
|
+
* `council.general.moderatorModel` MUST surface a deferred deprecation
|
|
18
|
+
* warning at agent-creation time. The legacy `council.general.moderator`
|
|
19
|
+
* field is NOT checked because the strict schema applies a default of
|
|
20
|
+
* `true` to it, and the warning would then fire for every council user
|
|
21
|
+
* (real bug fixed in commit eee5977).
|
|
22
|
+
*/
|
|
23
|
+
export {};
|
package/dist/agents/index.d.ts
CHANGED
|
@@ -40,8 +40,7 @@ export declare function createAgents(config?: PluginConfig): AgentDefinition[];
|
|
|
40
40
|
export declare function getAgentConfigs(config?: PluginConfig, directory?: string, sessionId?: string): Record<string, SDKAgentConfig>;
|
|
41
41
|
export { createArchitectAgent } from './architect';
|
|
42
42
|
export { createCoderAgent } from './coder';
|
|
43
|
-
export {
|
|
44
|
-
export { createCouncilModeratorAgent } from './council-moderator';
|
|
43
|
+
export { DOMAIN_EXPERT_COUNCIL_PROMPT, GENERALIST_COUNCIL_PROMPT, SKEPTIC_COUNCIL_PROMPT, } from './council-prompts';
|
|
45
44
|
export { createCriticAgent } from './critic';
|
|
46
45
|
export { createCuratorAgent } from './curator-agent';
|
|
47
46
|
export { createDesignerAgent } from './designer';
|