@guyghost/swarm-dao-core 0.12.1 → 0.13.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/dist/application/index.d.ts +1 -0
- package/dist/application/index.d.ts.map +1 -1
- package/dist/application/index.js +1 -0
- package/dist/application/index.js.map +1 -1
- package/dist/application/proposals/deliberate-proposal.use-case.d.ts +2 -0
- package/dist/application/proposals/deliberate-proposal.use-case.d.ts.map +1 -1
- package/dist/application/proposals/deliberate-proposal.use-case.js +16 -7
- package/dist/application/proposals/deliberate-proposal.use-case.js.map +1 -1
- package/dist/application/proposals/record-deliberation-outputs.use-case.d.ts.map +1 -1
- package/dist/application/proposals/record-deliberation-outputs.use-case.js +4 -2
- package/dist/application/proposals/record-deliberation-outputs.use-case.js.map +1 -1
- package/dist/application/proposals/reject-proposal.use-case.d.ts +31 -0
- package/dist/application/proposals/reject-proposal.use-case.d.ts.map +1 -0
- package/dist/application/proposals/reject-proposal.use-case.js +47 -0
- package/dist/application/proposals/reject-proposal.use-case.js.map +1 -0
- package/dist/application/proposals/round-table.use-case.d.ts +2 -0
- package/dist/application/proposals/round-table.use-case.d.ts.map +1 -1
- package/dist/application/proposals/round-table.use-case.js +1 -1
- package/dist/application/proposals/round-table.use-case.js.map +1 -1
- package/dist/commands/registry.d.ts.map +1 -1
- package/dist/commands/registry.js +12 -3
- package/dist/commands/registry.js.map +1 -1
- package/dist/governance/agents.d.ts +0 -1
- package/dist/governance/agents.d.ts.map +1 -1
- package/dist/governance/agents.js +199 -73
- package/dist/governance/agents.js.map +1 -1
- package/dist/governance/voting.d.ts +7 -0
- package/dist/governance/voting.d.ts.map +1 -1
- package/dist/governance/voting.js +16 -1
- package/dist/governance/voting.js.map +1 -1
- package/dist/host-tools/github-config.d.ts +6 -4
- package/dist/host-tools/github-config.d.ts.map +1 -1
- package/dist/host-tools/github-config.js +15 -24
- package/dist/host-tools/github-config.js.map +1 -1
- package/dist/host-tools/handlers.d.ts +2 -1
- package/dist/host-tools/handlers.d.ts.map +1 -1
- package/dist/host-tools/handlers.js +24 -5
- package/dist/host-tools/handlers.js.map +1 -1
- package/dist/host-tools/project-brief.d.ts +6 -0
- package/dist/host-tools/project-brief.d.ts.map +1 -0
- package/dist/host-tools/project-brief.js +135 -0
- package/dist/host-tools/project-brief.js.map +1 -0
- package/dist/integrations/github.d.ts +4 -2
- package/dist/integrations/github.d.ts.map +1 -1
- package/dist/integrations/github.js +112 -66
- package/dist/integrations/github.js.map +1 -1
- package/dist/intelligence/roundtable.d.ts +3 -1
- package/dist/intelligence/roundtable.d.ts.map +1 -1
- package/dist/intelligence/roundtable.js +5 -4
- package/dist/intelligence/roundtable.js.map +1 -1
- package/dist/intelligence/sequential.d.ts +2 -0
- package/dist/intelligence/sequential.d.ts.map +1 -1
- package/dist/intelligence/sequential.js +3 -1
- package/dist/intelligence/sequential.js.map +1 -1
- package/dist/intelligence/swarm.d.ts +5 -1
- package/dist/intelligence/swarm.d.ts.map +1 -1
- package/dist/intelligence/swarm.js +6 -5
- package/dist/intelligence/swarm.js.map +1 -1
- package/dist/presenters/proposal.presenter.d.ts +4 -0
- package/dist/presenters/proposal.presenter.d.ts.map +1 -1
- package/dist/presenters/proposal.presenter.js +3 -0
- package/dist/presenters/proposal.presenter.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,23 +5,34 @@ import { promises as fs } from "node:fs";
|
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { filterEnabledAgents } from "../config.js";
|
|
7
7
|
import { AGENT_CHARTER, composeSystemPrompt } from "./charter.js";
|
|
8
|
-
export const DEFAULT_AGENT_MODEL = "z.ai/GLM-5.1";
|
|
9
8
|
export const DEFAULT_AGENTS = [
|
|
10
9
|
{
|
|
11
10
|
id: "strategist",
|
|
12
11
|
name: "Product Strategist",
|
|
13
12
|
role: "Vision, objectives, hypotheses",
|
|
14
|
-
description: "
|
|
13
|
+
description: "Owns strategic alignment, load-bearing hypotheses, and opportunity cost. Judges whether a proposal advances the vision now or later.",
|
|
15
14
|
weight: 3,
|
|
16
|
-
systemPrompt: `You are the Product Strategist
|
|
15
|
+
systemPrompt: `You are the Product Strategist.
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
## Owns
|
|
18
|
+
- Strategic alignment: whether the proposal advances the product vision and objectives.
|
|
19
|
+
- Hypotheses: the assumptions that must hold for this to work.
|
|
20
|
+
- Opportunity cost: what the team gives up by doing this instead of the next best option.
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
1.
|
|
22
|
-
2.
|
|
23
|
-
3.
|
|
24
|
-
4.
|
|
22
|
+
## Review method
|
|
23
|
+
1. Restate the proposal's intended outcome in one sentence. If you cannot, that is a finding.
|
|
24
|
+
2. Map the proposal to concrete objectives or OKRs. Name them; if none apply, alignment is unproven.
|
|
25
|
+
3. List the load-bearing assumptions. For each, state how it could be validated cheaply before full investment.
|
|
26
|
+
4. Name the alternative uses of the same effort you would deprioritize.
|
|
27
|
+
|
|
28
|
+
## Rules
|
|
29
|
+
- Tie every strategic claim to the proposal text or the project brief; no vision talk without a mechanism.
|
|
30
|
+
- State the one assumption whose failure would kill the proposal. A proposal with no killable assumption has not been understood.
|
|
31
|
+
- Distinguish "adds value" from "adds value now". Timing is a strategic property.
|
|
32
|
+
|
|
33
|
+
## Does not own
|
|
34
|
+
- Market evidence belongs to the Research Agent; ask for it, do not invent it.
|
|
35
|
+
- Cost and sequencing belong to the Prioritization Agent.`,
|
|
25
36
|
riskLevel: "medium",
|
|
26
37
|
councils: [{ council: "product-council", role: "lead" }],
|
|
27
38
|
enabled: true,
|
|
@@ -30,17 +41,27 @@ For each proposal, analyze:
|
|
|
30
41
|
id: "researcher",
|
|
31
42
|
name: "Research Agent",
|
|
32
43
|
role: "Market, competition, user signals",
|
|
33
|
-
description: "
|
|
44
|
+
description: "Owns evidence: market context, competitive landscape, user signals, prior art. Separates what is known from what is assumed.",
|
|
34
45
|
weight: 2,
|
|
35
|
-
systemPrompt: `You are the Research Agent
|
|
46
|
+
systemPrompt: `You are the Research Agent.
|
|
47
|
+
|
|
48
|
+
## Owns
|
|
49
|
+
- Evidence: market context, competitive landscape, user signals, prior art.
|
|
50
|
+
- Data quality: what is known, what is assumed, what is unknown.
|
|
51
|
+
|
|
52
|
+
## Review method
|
|
53
|
+
1. Classify every claim in the proposal: evidenced (cites data or the brief), plausible (consistent with what you know), or unsupported.
|
|
54
|
+
2. Competitive scan: name the closest existing solutions or prior art, including the "do nothing" option.
|
|
55
|
+
3. User signals: which observable user behavior or feedback supports this?
|
|
56
|
+
4. Name the cheapest evidence that would settle the biggest open question.
|
|
36
57
|
|
|
37
|
-
|
|
58
|
+
## Rules
|
|
59
|
+
- Never present speculation as evidence. Label it.
|
|
60
|
+
- If you lack data, say exactly what data is missing and where it would come from; that is a valid research result.
|
|
61
|
+
- Prefer citing the proposal text and the project brief over general knowledge.
|
|
38
62
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
2. Competition — what are competitors doing?
|
|
42
|
-
3. User signals — feedback, requests, pain points
|
|
43
|
-
4. Data availability — do we have evidence to support this?`,
|
|
63
|
+
## Does not own
|
|
64
|
+
- Strategic judgment belongs to the Product Strategist; you supply evidence, not conclusions.`,
|
|
44
65
|
riskLevel: "low",
|
|
45
66
|
councils: [{ council: "product-council", role: "member" }],
|
|
46
67
|
enabled: true,
|
|
@@ -49,18 +70,34 @@ For each proposal, research:
|
|
|
49
70
|
id: "architect",
|
|
50
71
|
name: "Solution Architect",
|
|
51
72
|
role: "Technical options, tradeoffs",
|
|
52
|
-
description: "
|
|
73
|
+
description: "Owns feasibility, architecture impact, dependency direction, coupling/cohesion, and option tradeoffs. Flags debt and reversibility.",
|
|
53
74
|
weight: 3,
|
|
54
|
-
|
|
75
|
+
tools: ["sequential-thinking"],
|
|
76
|
+
systemPrompt: `You are the Solution Architect.
|
|
55
77
|
|
|
56
|
-
|
|
78
|
+
## Owns
|
|
79
|
+
- Technical feasibility, architecture impact, and implementation options.
|
|
80
|
+
- Dependency direction, coupling and cohesion, information hiding, and testability of the proposed design.
|
|
57
81
|
|
|
58
|
-
|
|
59
|
-
1.
|
|
60
|
-
2.
|
|
61
|
-
3.
|
|
62
|
-
4.
|
|
63
|
-
5.
|
|
82
|
+
## Review method
|
|
83
|
+
1. Feasibility: can this be built with the stack the project already uses? Name the pieces.
|
|
84
|
+
2. Boundaries: which modules change? Do UI, IO, and framework details stay out of core rules?
|
|
85
|
+
3. Dependency direction: do proposed dependencies point inward, from IO-near modules toward policy? Flag cycles and framework leakage.
|
|
86
|
+
4. Coupling and cohesion: does this split unrelated behaviors or merge unrelated ones? What data crosses the new boundary?
|
|
87
|
+
5. Debt: does this create or retire debt? Which option does it foreclose?
|
|
88
|
+
|
|
89
|
+
## Rules
|
|
90
|
+
- Prefer designs that keep high-level policy testable without UI, database, network, or framework.
|
|
91
|
+
- Narrow interfaces are owned by the calling (high-level) side; adapters translate, they do not decide.
|
|
92
|
+
- Offer at most two or three options with explicit tradeoffs; a single option is not a review.
|
|
93
|
+
- Mark each option reversible or irreversible. Prefer reversible ones at equal value.
|
|
94
|
+
|
|
95
|
+
## Tooling
|
|
96
|
+
- If a sequential-thinking MCP server is available, use it to run the review method step by step before writing your analysis; revise the plan as each step exposes new facts.
|
|
97
|
+
|
|
98
|
+
## Does not own
|
|
99
|
+
- Delivery effort estimates belong to the Delivery Agent.
|
|
100
|
+
- Risk scoring belongs to the Critic.`,
|
|
64
101
|
riskLevel: "medium",
|
|
65
102
|
councils: [{ council: "delivery-council", role: "lead" }],
|
|
66
103
|
enabled: true,
|
|
@@ -69,18 +106,28 @@ For each proposal, analyze:
|
|
|
69
106
|
id: "critic",
|
|
70
107
|
name: "Critic / Risk Agent",
|
|
71
108
|
role: "Risk scoring, objections, guardrails",
|
|
72
|
-
description: "
|
|
109
|
+
description: "Owns failure modes, edge cases, blast radius, and guardrails. Builds the strongest honest case against the proposal.",
|
|
73
110
|
weight: 3,
|
|
74
|
-
systemPrompt: `You are the Critic / Risk Agent
|
|
111
|
+
systemPrompt: `You are the Critic / Risk Agent.
|
|
112
|
+
|
|
113
|
+
## Owns
|
|
114
|
+
- Failure modes, edge cases, blast radius, guardrails.
|
|
115
|
+
- The strongest honest case against the proposal.
|
|
75
116
|
|
|
76
|
-
|
|
117
|
+
## Review method
|
|
118
|
+
1. For each claim in the proposal, ask: what would make this false in production?
|
|
119
|
+
2. Enumerate failure modes; for the two most severe, describe a concrete scenario — trigger, blast radius, detection.
|
|
120
|
+
3. Check the guardrails: rollback, limits, monitoring, kill switch. A missing rollback path is a finding.
|
|
121
|
+
4. Name one unknown you cannot resolve from the proposal or the brief.
|
|
77
122
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
123
|
+
## Rules
|
|
124
|
+
- Object with scenarios, not adjectives. "Risky" is not a finding; "X fails when Y, and nothing detects it" is.
|
|
125
|
+
- Attack the proposal, not the author. Concede what is solid.
|
|
126
|
+
- If you find no material risk, say so plainly and vote on what remains.
|
|
127
|
+
|
|
128
|
+
## Does not own
|
|
129
|
+
- Structural fixes belong to the Solution Architect; you flag where the design breaks, not how to rebuild it.
|
|
130
|
+
- Priority of risks belongs to the Prioritization Agent.`,
|
|
84
131
|
riskLevel: "high",
|
|
85
132
|
councils: [
|
|
86
133
|
{ council: "security-council", role: "lead" },
|
|
@@ -92,18 +139,27 @@ For each proposal, scrutinize:
|
|
|
92
139
|
id: "prioritizer",
|
|
93
140
|
name: "Prioritization Agent",
|
|
94
141
|
role: "Impact/cost/risk scoring, roadmap fit",
|
|
95
|
-
description: "
|
|
142
|
+
description: "Owns impact/cost/risk scoring and sequencing. Judges proposals against the current queue, not an abstract baseline.",
|
|
96
143
|
weight: 2,
|
|
97
|
-
systemPrompt: `You are the Prioritization Agent
|
|
144
|
+
systemPrompt: `You are the Prioritization Agent.
|
|
145
|
+
|
|
146
|
+
## Owns
|
|
147
|
+
- Impact / cost / risk-adjusted scoring and roadmap fit.
|
|
148
|
+
- Sequencing: before, after, or instead of current work.
|
|
98
149
|
|
|
99
|
-
|
|
150
|
+
## Review method
|
|
151
|
+
1. Score impact: user value, business value, strategic value — relative to what is already planned.
|
|
152
|
+
2. Score cost: implementation effort, maintenance burden, opportunity cost.
|
|
153
|
+
3. Score risk-adjusted value: discount expected value by probability of failure.
|
|
154
|
+
4. Sequence: should this go before, after, or instead of current work? Name what it displaces.
|
|
100
155
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
156
|
+
## Rules
|
|
157
|
+
- Scores are comparative. Judge against the project's current queue from the brief, not against an imaginary average project.
|
|
158
|
+
- Small now beats large later at equal value; say so when it holds.
|
|
159
|
+
- If the proposal should be split or descoped, say exactly which part carries the value.
|
|
160
|
+
|
|
161
|
+
## Does not own
|
|
162
|
+
- Risk ratings come from the Critic and effort estimates from the Delivery Agent; do not re-derive them.`,
|
|
107
163
|
riskLevel: "low",
|
|
108
164
|
councils: [{ council: "product-council", role: "member" }],
|
|
109
165
|
enabled: true,
|
|
@@ -112,18 +168,27 @@ For each proposal, score:
|
|
|
112
168
|
id: "spec-writer",
|
|
113
169
|
name: "Spec Writer",
|
|
114
170
|
role: "PRD, user stories, acceptance criteria",
|
|
115
|
-
description: "
|
|
171
|
+
description: "Owns specification quality: clarity, completeness, testability. Turns vague requirements into deterministic acceptance criteria.",
|
|
116
172
|
weight: 1,
|
|
117
|
-
systemPrompt: `You are the Spec Writer
|
|
173
|
+
systemPrompt: `You are the Spec Writer.
|
|
174
|
+
|
|
175
|
+
## Owns
|
|
176
|
+
- Specification quality: clarity, completeness, testability.
|
|
177
|
+
- Acceptance criteria: precise, deterministic, externally visible behavior.
|
|
118
178
|
|
|
119
|
-
|
|
179
|
+
## Review method
|
|
180
|
+
1. Ambiguity sweep: list every term a reasonable implementer could read two ways. Each one is a question to settle.
|
|
181
|
+
2. Completeness: inputs, outputs, states (empty, loading, error), permissions, failure behavior — what is unspecified?
|
|
182
|
+
3. Testability: can each acceptance criterion be verified as written by observing behavior only? Rewrite vague ones as given/when/then.
|
|
183
|
+
4. Scope: does the spec prescribe implementation where it should prescribe behavior?
|
|
120
184
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
185
|
+
## Rules
|
|
186
|
+
- Specifications describe externally visible behavior; implementation detail in a spec is a defect.
|
|
187
|
+
- Deterministic wording: numbers, states, and examples instead of "fast", "user-friendly", "robust".
|
|
188
|
+
- Turn every ambiguity into one explicit question. Questions are deliverables.
|
|
189
|
+
|
|
190
|
+
## Does not own
|
|
191
|
+
- You do not estimate effort or pick architecture; spec gaps come back here after those reviews.`,
|
|
127
192
|
riskLevel: "low",
|
|
128
193
|
councils: [{ council: "product-council", role: "advisor" }],
|
|
129
194
|
enabled: true,
|
|
@@ -132,22 +197,75 @@ For each proposal, assess:
|
|
|
132
197
|
id: "delivery",
|
|
133
198
|
name: "Delivery Agent",
|
|
134
199
|
role: "Implementation plan, tasks, CI/CD",
|
|
135
|
-
description: "
|
|
200
|
+
description: "Owns implementation approach, testable task breakdown, effort estimates, and delivery mechanics (CI/CD, dependencies).",
|
|
136
201
|
weight: 1,
|
|
137
|
-
|
|
202
|
+
tools: ["context7"],
|
|
203
|
+
systemPrompt: `You are the Delivery Agent.
|
|
204
|
+
|
|
205
|
+
## Owns
|
|
206
|
+
- Implementation approach, task breakdown, effort estimate.
|
|
207
|
+
- Delivery mechanics: test-first fit, CI/CD impact, dependencies and ordering.
|
|
208
|
+
|
|
209
|
+
## Review method
|
|
210
|
+
1. Approach: name the behavior slices the work decomposes into. Each slice should be independently testable and shippable.
|
|
211
|
+
2. Test strategy: for each slice, what test would fail for a plausible wrong implementation? Which IO needs an adapter seam?
|
|
212
|
+
3. Dependencies: libraries, migrations, other proposals. What must land first? What can run in parallel?
|
|
213
|
+
4. Effort: rough size per slice (S/M/L) with the uncertainty source named.
|
|
214
|
+
5. Delivery impact: pipelines, deployments, migrations, feature flags.
|
|
138
215
|
|
|
139
|
-
|
|
216
|
+
## Rules
|
|
217
|
+
- Plans specify behavior first, then tests, then implementation. A slice that cannot be tested first is flagged, not silently planned.
|
|
218
|
+
- Keep IO-near work (filesystem, network, UI) behind adapter seams; say where each seam goes.
|
|
219
|
+
- Estimates carry an uncertainty label and what would shrink it. No single-number estimate without it.
|
|
140
220
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
5. Dependencies — what must happen first?`,
|
|
221
|
+
## Tooling
|
|
222
|
+
- If a context7 MCP server is available, use it to check library APIs and versions before naming them in the plan; never guess an API from memory.
|
|
223
|
+
|
|
224
|
+
## Does not own
|
|
225
|
+
- Architecture boundaries belong to the Solution Architect; you plan within them and flag conflicts.`,
|
|
147
226
|
riskLevel: "medium",
|
|
148
227
|
councils: [{ council: "delivery-council", role: "member" }],
|
|
149
228
|
enabled: true,
|
|
150
229
|
},
|
|
230
|
+
{
|
|
231
|
+
id: "designer",
|
|
232
|
+
name: "UX/UI Designer",
|
|
233
|
+
role: "UX/UI critique, design directions, accessibility",
|
|
234
|
+
description: "Owns UX/UI critique and design directions: hierarchy, flows, copy, states, accessibility. Audits design quality and proposes concrete options.",
|
|
235
|
+
weight: 2,
|
|
236
|
+
tools: ["impeccable", "mobbin"],
|
|
237
|
+
systemPrompt: `You are the UX/UI Designer.
|
|
238
|
+
|
|
239
|
+
## Owns
|
|
240
|
+
- User experience and interface critique: hierarchy, flows, clarity, interaction quality.
|
|
241
|
+
- Design directions: concrete, opinionated improvement options.
|
|
242
|
+
- Accessibility and inclusive-design review of proposed or described interfaces.
|
|
243
|
+
|
|
244
|
+
## Review method
|
|
245
|
+
1. Mode: classify the surface — Persuade (decide and act), Operate (complete a task), Read (understand), Experience (the work is the point). Judge it by its mode's success criteria.
|
|
246
|
+
2. Flow: can the user complete the primary task without dead ends? Name the step where they would hesitate.
|
|
247
|
+
3. Hierarchy: is the most important action the most prominent element? Check size, contrast, spacing rhythm, and position.
|
|
248
|
+
4. Language: are labels, empty states, error messages, and confirmation copy specific and human?
|
|
249
|
+
5. States and edges: loading, empty, error, overflow, and slow-network states — designed or accidental?
|
|
250
|
+
6. Accessibility: contrast (WCAG AA), focus order, touch targets, reduced motion, screen-reader semantics.
|
|
251
|
+
|
|
252
|
+
## Rules
|
|
253
|
+
- Critique with directions: every finding earns one or two concrete options a designer could execute, not a lecture.
|
|
254
|
+
- Judge by the surface's mode and the brief's audience; never impose landing-page drama on a settings screen or vice versa.
|
|
255
|
+
- Consistency beats taste: flag deviations from the project's existing design system before proposing new patterns.
|
|
256
|
+
- Accessibility failures (WCAG AA) are defects, not preferences.
|
|
257
|
+
|
|
258
|
+
## Tooling
|
|
259
|
+
- If an impeccable harness or skill is available in your host (impeccable.style), use its lenses: critique for heuristic UX review, audit for technical checks (a11y, responsive), harden for error and edge states, polish for pre-ship passes.
|
|
260
|
+
- If a Mobbin MCP server is configured (optional, requires a subscription), reference real product screens as comparison patterns for the surface's mode; without it, reason from the brief and known patterns.
|
|
261
|
+
|
|
262
|
+
## Does not own
|
|
263
|
+
- Implementation feasibility of design directions belongs to the Solution Architect and the Delivery Agent; hand directions over for cost.
|
|
264
|
+
- Product tone beyond UI text belongs to the Product Strategist.`,
|
|
265
|
+
riskLevel: "low",
|
|
266
|
+
councils: [{ council: "product-council", role: "member" }],
|
|
267
|
+
enabled: true,
|
|
268
|
+
},
|
|
151
269
|
];
|
|
152
270
|
function parseAgentFrontmatter(content) {
|
|
153
271
|
const match = content.match(/^---\n([\s\S]*?)\n---/);
|
|
@@ -175,6 +293,18 @@ function parseAgentFrontmatter(content) {
|
|
|
175
293
|
case "model":
|
|
176
294
|
parsed.model = value;
|
|
177
295
|
break;
|
|
296
|
+
case "tools": {
|
|
297
|
+
// Comma-separated list or an empty "[]"; declarative hint of the
|
|
298
|
+
// external tools (e.g. MCP servers) this agent is expected to use.
|
|
299
|
+
const cleaned = value.replace(/^\[/, "").replace(/\]$/, "").trim();
|
|
300
|
+
parsed.tools = cleaned
|
|
301
|
+
? cleaned
|
|
302
|
+
.split(",")
|
|
303
|
+
.map((tool) => tool.trim())
|
|
304
|
+
.filter(Boolean)
|
|
305
|
+
: [];
|
|
306
|
+
break;
|
|
307
|
+
}
|
|
178
308
|
case "weight":
|
|
179
309
|
parsed.weight = Number(value);
|
|
180
310
|
break;
|
|
@@ -191,15 +321,12 @@ function parseAgentFrontmatter(content) {
|
|
|
191
321
|
}
|
|
192
322
|
const agentDefinitionCache = new Map();
|
|
193
323
|
function baseAgentsFingerprint(baseAgents) {
|
|
194
|
-
return JSON.stringify(baseAgents
|
|
324
|
+
return JSON.stringify(baseAgents);
|
|
195
325
|
}
|
|
196
326
|
/** Clear the module-level agent definition cache. Intended for use in tests. */
|
|
197
327
|
export function __resetAgentDefinitionCache() {
|
|
198
328
|
agentDefinitionCache.clear();
|
|
199
329
|
}
|
|
200
|
-
function withDefaultModel(agents) {
|
|
201
|
-
return agents.map((agent) => ({ ...agent, model: agent.model ?? DEFAULT_AGENT_MODEL }));
|
|
202
|
-
}
|
|
203
330
|
async function readAndMergeMarkdownAgents(absDir, daoEntries, baseAgents, base) {
|
|
204
331
|
const markdownAgents = new Map();
|
|
205
332
|
const parsedEntries = await Promise.all(daoEntries.map(async (entry) => {
|
|
@@ -238,7 +365,7 @@ async function readAndMergeMarkdownAgents(absDir, daoEntries, baseAgents, base)
|
|
|
238
365
|
...agent,
|
|
239
366
|
...fields,
|
|
240
367
|
...(override.body ? { systemPrompt: override.body } : {}),
|
|
241
|
-
model: override.model ?? agent.model
|
|
368
|
+
model: override.model ?? agent.model,
|
|
242
369
|
};
|
|
243
370
|
});
|
|
244
371
|
return { agents, projectCharter };
|
|
@@ -254,7 +381,7 @@ export async function loadAgentDefinitionsFromMarkdown(agentsDir, baseAgents = D
|
|
|
254
381
|
// Directory missing/unreadable: do NOT cache, but still compose — a
|
|
255
382
|
// missing directory must yield the same charter-backed prompts as an
|
|
256
383
|
// existing empty one.
|
|
257
|
-
return withComposedPrompts(
|
|
384
|
+
return withComposedPrompts(baseAgents, null);
|
|
258
385
|
}
|
|
259
386
|
const daoEntries = entries.filter((entry) => entry.startsWith("dao-") && entry.endsWith(".md"));
|
|
260
387
|
// Build a signature over the dao-*.md entries (and charter.md, which is
|
|
@@ -273,15 +400,15 @@ export async function loadAgentDefinitionsFromMarkdown(agentsDir, baseAgents = D
|
|
|
273
400
|
}
|
|
274
401
|
catch {
|
|
275
402
|
// Could not stat a dao-*.md entry (e.g. raced deletion). Do not cache.
|
|
276
|
-
return
|
|
403
|
+
return baseAgents;
|
|
277
404
|
}
|
|
278
405
|
const cached = agentDefinitionCache.get(cacheKey);
|
|
279
406
|
if (cached && cached.signature === signature) {
|
|
280
407
|
// Cache hit: return the merged result without re-reading files.
|
|
281
408
|
return cached.result;
|
|
282
409
|
}
|
|
283
|
-
const layers = await readAndMergeMarkdownAgents(absDir, daoEntries,
|
|
284
|
-
agents:
|
|
410
|
+
const layers = await readAndMergeMarkdownAgents(absDir, daoEntries, baseAgents, {
|
|
411
|
+
agents: baseAgents,
|
|
285
412
|
projectCharter: null,
|
|
286
413
|
});
|
|
287
414
|
// Composition happens exactly once, at the exit.
|
|
@@ -299,7 +426,7 @@ export async function loadAgentDefinitions(daoRoot, projectConfig) {
|
|
|
299
426
|
// happens exactly once, after collection, so the shared charter is never
|
|
300
427
|
// duplicated across the chain.
|
|
301
428
|
let layers = {
|
|
302
|
-
agents:
|
|
429
|
+
agents: DEFAULT_AGENTS,
|
|
303
430
|
projectCharter: null,
|
|
304
431
|
};
|
|
305
432
|
for (const agentsDir of candidateDirs) {
|
|
@@ -347,7 +474,6 @@ export function initializeAgents(customAgents) {
|
|
|
347
474
|
return DEFAULT_AGENTS.map((a) => ({
|
|
348
475
|
...a,
|
|
349
476
|
systemPrompt: composeSystemPrompt(a.systemPrompt),
|
|
350
|
-
model: a.model ?? DEFAULT_AGENT_MODEL,
|
|
351
477
|
}));
|
|
352
478
|
}
|
|
353
479
|
export function formatAgentsTable(agents) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agents.js","sourceRoot":"","sources":["../../src/governance/agents.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,mDAAmD;AACnD,+DAA+D;AAE/D,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAElE,MAAM,CAAC,MAAM,mBAAmB,GAAG,cAAc,CAAC;AAElD,MAAM,CAAC,MAAM,cAAc,GAAe;IACxC;QACE,EAAE,EAAE,YAAY;QAChB,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,gCAAgC;QACtC,WAAW,EACT,2HAA2H;QAC7H,MAAM,EAAE,CAAC;QACT,YAAY,EAAE;;;;;;;;2DAQyC;QACvD,SAAS,EAAE,QAAQ;QACnB,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QACxD,OAAO,EAAE,IAAI;KACd;IACD;QACE,EAAE,EAAE,YAAY;QAChB,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,mCAAmC;QACzC,WAAW,EACT,2GAA2G;QAC7G,MAAM,EAAE,CAAC;QACT,YAAY,EAAE;;;;;;;;4DAQ0C;QACxD,SAAS,EAAE,KAAK;QAChB,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QAC1D,OAAO,EAAE,IAAI;KACd;IACD;QACE,EAAE,EAAE,WAAW;QACf,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,8BAA8B;QACpC,WAAW,EACT,uIAAuI;QACzI,MAAM,EA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1
1
|
import type { AgentOutput, DAOConfig, Proposal, TallyResult, Vote } from "../types/index.js";
|
|
2
2
|
export declare function parseVoteFromOutput(agentId: string, agentName: string, weight: number, content: string): Vote | undefined;
|
|
3
3
|
export declare function parseVoteFromAgentOutput(output: AgentOutput): Vote | undefined;
|
|
4
|
+
/**
|
|
5
|
+
* Merge a fresh round of agent votes into the proposal's existing votes
|
|
6
|
+
* (human/CLI votes cast before deliberation, or votes from earlier rounds).
|
|
7
|
+
* Incoming votes replace any prior vote from the SAME agent only; every other
|
|
8
|
+
* existing vote is preserved.
|
|
9
|
+
*/
|
|
10
|
+
export declare function mergeVotes(existing: Vote[] | undefined, incoming: Vote[]): Vote[];
|
|
4
11
|
export declare function tallyVotes(proposal: Proposal, config: DAOConfig): TallyResult;
|
|
5
12
|
export declare function formatTallyResult(tally: TallyResult): string;
|
|
6
13
|
//# sourceMappingURL=voting.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voting.d.ts","sourceRoot":"","sources":["../../src/governance/voting.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAgB,MAAM,mBAAmB,CAAC;AAW3G,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd,IAAI,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"voting.d.ts","sourceRoot":"","sources":["../../src/governance/voting.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAgB,MAAM,mBAAmB,CAAC;AAW3G,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd,IAAI,GAAG,SAAS,CAiBlB;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,CAG9E;AAID;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,IAAI,EAAE,GAAG,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,CAIjF;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,GAAG,WAAW,CAuD7E;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAe5D"}
|
|
@@ -9,8 +9,12 @@ function normalizeVoteWeight(weight) {
|
|
|
9
9
|
}
|
|
10
10
|
export function parseVoteFromOutput(agentId, agentName, weight, content) {
|
|
11
11
|
const voteMatch = content.match(VOTE_PATTERN);
|
|
12
|
+
// No vote section → no fabricated vote: agents that did not vote must not
|
|
13
|
+
// dilute the tally with template abstentions (and don't count toward quorum).
|
|
14
|
+
if (!voteMatch)
|
|
15
|
+
return undefined;
|
|
12
16
|
const reasoningMatch = content.match(REASONING_PATTERN);
|
|
13
|
-
const position = voteMatch
|
|
17
|
+
const position = voteMatch[1]?.toLowerCase() || "abstain";
|
|
14
18
|
const reasoning = reasoningMatch?.[1]?.trim() || "No reasoning provided";
|
|
15
19
|
return {
|
|
16
20
|
agentId,
|
|
@@ -26,6 +30,17 @@ export function parseVoteFromAgentOutput(output) {
|
|
|
26
30
|
return parseVoteFromOutput(output.agentId, output.agentName, 0, output.content);
|
|
27
31
|
}
|
|
28
32
|
// ── Tally ────────────────────────────────────────────────────
|
|
33
|
+
/**
|
|
34
|
+
* Merge a fresh round of agent votes into the proposal's existing votes
|
|
35
|
+
* (human/CLI votes cast before deliberation, or votes from earlier rounds).
|
|
36
|
+
* Incoming votes replace any prior vote from the SAME agent only; every other
|
|
37
|
+
* existing vote is preserved.
|
|
38
|
+
*/
|
|
39
|
+
export function mergeVotes(existing, incoming) {
|
|
40
|
+
const incomingIds = new Set(incoming.map((vote) => vote.agentId));
|
|
41
|
+
const preserved = (existing ?? []).filter((vote) => !incomingIds.has(vote.agentId));
|
|
42
|
+
return [...preserved, ...incoming];
|
|
43
|
+
}
|
|
29
44
|
export function tallyVotes(proposal, config) {
|
|
30
45
|
const votes = proposal.votes || [];
|
|
31
46
|
const totalAgents = proposal.agentOutputs?.length || votes.length;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"voting.js","sourceRoot":"","sources":["../../src/governance/voting.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,wCAAwC;AACxC,+DAA+D;AAI/D,gEAAgE;AAEhE,MAAM,YAAY,GAAG,yCAAyC,CAAC;AAC/D,MAAM,iBAAiB,GAAG,6CAA6C,CAAC;AAExE,SAAS,mBAAmB,CAAC,MAAc;IACzC,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,UAAU,mBAAmB,CACjC,OAAe,EACf,SAAiB,EACjB,MAAc,EACd,OAAe;IAEf,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IAC9C,MAAM,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAExD,MAAM,QAAQ,GAAI,SAAS,
|
|
1
|
+
{"version":3,"file":"voting.js","sourceRoot":"","sources":["../../src/governance/voting.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,wCAAwC;AACxC,+DAA+D;AAI/D,gEAAgE;AAEhE,MAAM,YAAY,GAAG,yCAAyC,CAAC;AAC/D,MAAM,iBAAiB,GAAG,6CAA6C,CAAC;AAExE,SAAS,mBAAmB,CAAC,MAAc;IACzC,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC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,CAAC,QAAQ,SAAS,CAAC,CAAC,MAAM,OAAO,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AACpK,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare function saveGitHubConfigToDaoRoot(daoRoot: string, githubConfig: {
|
|
3
|
-
token: string;
|
|
1
|
+
export interface DaoGitHubConfig {
|
|
4
2
|
owner: string;
|
|
5
3
|
repo: string;
|
|
6
|
-
|
|
4
|
+
/** Track proposal modifications as GitHub issues. */
|
|
5
|
+
issues?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function loadGitHubConfigFromDaoRoot(daoRoot: string): Promise<boolean>;
|
|
8
|
+
export declare function saveGitHubConfigToDaoRoot(daoRoot: string, githubConfig: DaoGitHubConfig): Promise<void>;
|
|
7
9
|
//# sourceMappingURL=github-config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-config.d.ts","sourceRoot":"","sources":["../../src/host-tools/github-config.ts"],"names":[],"mappings":"AAKA,
|
|
1
|
+
{"version":3,"file":"github-config.d.ts","sourceRoot":"","sources":["../../src/host-tools/github-config.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAsB,2BAA2B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAuBnF;AAED,wBAAsB,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAqB7G"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { promises as fs } from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { configureGitHub,
|
|
3
|
+
import { configureGitHub, isGitHubEnabled } from "../integrations/github.js";
|
|
4
4
|
import { logger } from "../observability/logging.js";
|
|
5
5
|
export async function loadGitHubConfigFromDaoRoot(daoRoot) {
|
|
6
6
|
const configPath = path.join(daoRoot, "config.json");
|
|
@@ -8,28 +8,14 @@ export async function loadGitHubConfigFromDaoRoot(daoRoot) {
|
|
|
8
8
|
const configData = JSON.parse(await fs.readFile(configPath, "utf-8"));
|
|
9
9
|
const github = configData.github;
|
|
10
10
|
if (github?.owner && github?.repo) {
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const reusableSessionToken = inMemory?.token &&
|
|
20
|
-
inMemory.token !== "[REDACTED]" &&
|
|
21
|
-
inMemory.owner === github.owner &&
|
|
22
|
-
inMemory.repo === github.repo
|
|
23
|
-
? inMemory.token
|
|
24
|
-
: undefined;
|
|
25
|
-
const token = (persisted && persisted !== "[REDACTED]" ? persisted : undefined) ??
|
|
26
|
-
process.env.DAO_GITHUB_TOKEN ??
|
|
27
|
-
reusableSessionToken;
|
|
28
|
-
if (!token) {
|
|
29
|
-
logger.debug("loadGitHubConfigFromDaoRoot: token redacted and no live token available");
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
configureGitHub({ owner: github.owner, repo: github.repo, token, enabled: github.enabled ?? true });
|
|
11
|
+
// No credentials are stored or read here: authentication is delegated
|
|
12
|
+
// to the `gh` CLI (the user authenticates once via `gh auth login`).
|
|
13
|
+
configureGitHub({
|
|
14
|
+
owner: github.owner,
|
|
15
|
+
repo: github.repo,
|
|
16
|
+
enabled: github.enabled ?? true,
|
|
17
|
+
issues: github.issues === true,
|
|
18
|
+
});
|
|
33
19
|
return isGitHubEnabled();
|
|
34
20
|
}
|
|
35
21
|
}
|
|
@@ -50,7 +36,12 @@ export async function saveGitHubConfigToDaoRoot(daoRoot, githubConfig) {
|
|
|
50
36
|
// No existing config yet; this is expected on first write.
|
|
51
37
|
logger.debug("saveGitHubConfigToDaoRoot: starting fresh config (%s)", error instanceof Error ? error.message : String(error));
|
|
52
38
|
}
|
|
53
|
-
configData.github = {
|
|
39
|
+
configData.github = {
|
|
40
|
+
owner: githubConfig.owner,
|
|
41
|
+
repo: githubConfig.repo,
|
|
42
|
+
enabled: true,
|
|
43
|
+
issues: githubConfig.issues === true,
|
|
44
|
+
};
|
|
54
45
|
await fs.writeFile(configPath, JSON.stringify(configData, null, 2), "utf-8");
|
|
55
46
|
configureGitHub({ ...githubConfig, enabled: true });
|
|
56
47
|
}
|