darwin-agents 0.7.1 → 0.9.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/CHANGELOG.md +62 -0
- package/README.md +62 -1
- package/dist/src/cli/canary.d.ts +13 -0
- package/dist/src/cli/canary.d.ts.map +1 -0
- package/dist/src/cli/canary.js +66 -0
- package/dist/src/cli/canary.js.map +1 -0
- package/dist/src/cli/evolution-flags.d.ts +40 -0
- package/dist/src/cli/evolution-flags.d.ts.map +1 -0
- package/dist/src/cli/evolution-flags.js +106 -0
- package/dist/src/cli/evolution-flags.js.map +1 -0
- package/dist/src/cli/evolve.d.ts +10 -1
- package/dist/src/cli/evolve.d.ts.map +1 -1
- package/dist/src/cli/evolve.js +93 -8
- package/dist/src/cli/evolve.js.map +1 -1
- package/dist/src/cli/index.js +18 -0
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/cli/run.d.ts.map +1 -1
- package/dist/src/cli/run.js +54 -70
- package/dist/src/cli/run.js.map +1 -1
- package/dist/src/evolution/build-loop.d.ts +20 -0
- package/dist/src/evolution/build-loop.d.ts.map +1 -0
- package/dist/src/evolution/build-loop.js +67 -0
- package/dist/src/evolution/build-loop.js.map +1 -0
- package/dist/src/evolution/canary.d.ts +164 -0
- package/dist/src/evolution/canary.d.ts.map +1 -0
- package/dist/src/evolution/canary.js +244 -0
- package/dist/src/evolution/canary.js.map +1 -0
- package/dist/src/evolution/critic-families.d.ts +51 -0
- package/dist/src/evolution/critic-families.d.ts.map +1 -0
- package/dist/src/evolution/critic-families.js +51 -0
- package/dist/src/evolution/critic-families.js.map +1 -0
- package/dist/src/evolution/enabled-state.d.ts +59 -0
- package/dist/src/evolution/enabled-state.d.ts.map +1 -0
- package/dist/src/evolution/enabled-state.js +122 -0
- package/dist/src/evolution/enabled-state.js.map +1 -0
- package/dist/src/evolution/loop.d.ts +46 -0
- package/dist/src/evolution/loop.d.ts.map +1 -1
- package/dist/src/evolution/loop.js +119 -1
- package/dist/src/evolution/loop.js.map +1 -1
- package/dist/src/evolution/parse-score.d.ts +35 -0
- package/dist/src/evolution/parse-score.d.ts.map +1 -0
- package/dist/src/evolution/parse-score.js +115 -0
- package/dist/src/evolution/parse-score.js.map +1 -0
- package/dist/src/evolution/tracker.d.ts +13 -0
- package/dist/src/evolution/tracker.d.ts.map +1 -1
- package/dist/src/evolution/tracker.js +34 -0
- package/dist/src/evolution/tracker.js.map +1 -1
- package/dist/src/index.d.ts +3 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +10 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/memory/postgres-memory.d.ts.map +1 -1
- package/dist/src/memory/postgres-memory.js +1 -0
- package/dist/src/memory/postgres-memory.js.map +1 -1
- package/dist/src/memory/sqlite-memory.d.ts.map +1 -1
- package/dist/src/memory/sqlite-memory.js +1 -0
- package/dist/src/memory/sqlite-memory.js.map +1 -1
- package/dist/src/types.d.ts +45 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/package.json +1 -1
- package/dist/agents/analyst.d.ts +0 -11
- package/dist/agents/analyst.d.ts.map +0 -1
- package/dist/agents/analyst.js +0 -78
- package/dist/agents/analyst.js.map +0 -1
- package/dist/agents/blog-writer.d.ts +0 -13
- package/dist/agents/blog-writer.d.ts.map +0 -1
- package/dist/agents/blog-writer.js +0 -59
- package/dist/agents/blog-writer.js.map +0 -1
- package/dist/agents/critic.d.ts +0 -11
- package/dist/agents/critic.d.ts.map +0 -1
- package/dist/agents/critic.js +0 -57
- package/dist/agents/critic.js.map +0 -1
- package/dist/agents/index.d.ts +0 -15
- package/dist/agents/index.d.ts.map +0 -1
- package/dist/agents/index.js +0 -31
- package/dist/agents/index.js.map +0 -1
- package/dist/agents/investigator-critic.d.ts +0 -10
- package/dist/agents/investigator-critic.d.ts.map +0 -1
- package/dist/agents/investigator-critic.js +0 -78
- package/dist/agents/investigator-critic.js.map +0 -1
- package/dist/agents/investigator.d.ts +0 -13
- package/dist/agents/investigator.d.ts.map +0 -1
- package/dist/agents/investigator.js +0 -105
- package/dist/agents/investigator.js.map +0 -1
- package/dist/agents/marketing.d.ts +0 -13
- package/dist/agents/marketing.d.ts.map +0 -1
- package/dist/agents/marketing.js +0 -59
- package/dist/agents/marketing.js.map +0 -1
- package/dist/agents/researcher.d.ts +0 -11
- package/dist/agents/researcher.d.ts.map +0 -1
- package/dist/agents/researcher.js +0 -68
- package/dist/agents/researcher.js.map +0 -1
- package/dist/agents/writer.d.ts +0 -9
- package/dist/agents/writer.d.ts.map +0 -1
- package/dist/agents/writer.js +0 -47
- package/dist/agents/writer.js.map +0 -1
- package/dist/cli/create.d.ts +0 -11
- package/dist/cli/create.d.ts.map +0 -1
- package/dist/cli/create.js +0 -104
- package/dist/cli/create.js.map +0 -1
- package/dist/cli/evolve.d.ts +0 -13
- package/dist/cli/evolve.d.ts.map +0 -1
- package/dist/cli/evolve.js +0 -69
- package/dist/cli/evolve.js.map +0 -1
- package/dist/cli/index.d.ts +0 -13
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -84
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/init.d.ts +0 -12
- package/dist/cli/init.d.ts.map +0 -1
- package/dist/cli/init.js +0 -68
- package/dist/cli/init.js.map +0 -1
- package/dist/cli/run.d.ts +0 -7
- package/dist/cli/run.d.ts.map +0 -1
- package/dist/cli/run.js +0 -371
- package/dist/cli/run.js.map +0 -1
- package/dist/cli/status.d.ts +0 -7
- package/dist/cli/status.d.ts.map +0 -1
- package/dist/cli/status.js +0 -123
- package/dist/cli/status.js.map +0 -1
- package/dist/core/agent.d.ts +0 -53
- package/dist/core/agent.d.ts.map +0 -1
- package/dist/core/agent.js +0 -172
- package/dist/core/agent.js.map +0 -1
- package/dist/core/runner.d.ts +0 -75
- package/dist/core/runner.d.ts.map +0 -1
- package/dist/core/runner.js +0 -255
- package/dist/core/runner.js.map +0 -1
- package/dist/evolution/loop.d.ts +0 -100
- package/dist/evolution/loop.d.ts.map +0 -1
- package/dist/evolution/loop.js +0 -424
- package/dist/evolution/loop.js.map +0 -1
- package/dist/evolution/multi-critic.d.ts +0 -58
- package/dist/evolution/multi-critic.d.ts.map +0 -1
- package/dist/evolution/multi-critic.js +0 -326
- package/dist/evolution/multi-critic.js.map +0 -1
- package/dist/evolution/notifications.d.ts +0 -32
- package/dist/evolution/notifications.d.ts.map +0 -1
- package/dist/evolution/notifications.js +0 -92
- package/dist/evolution/notifications.js.map +0 -1
- package/dist/evolution/optimizer.d.ts +0 -64
- package/dist/evolution/optimizer.d.ts.map +0 -1
- package/dist/evolution/optimizer.js +0 -223
- package/dist/evolution/optimizer.js.map +0 -1
- package/dist/evolution/patterns.d.ts +0 -63
- package/dist/evolution/patterns.d.ts.map +0 -1
- package/dist/evolution/patterns.js +0 -297
- package/dist/evolution/patterns.js.map +0 -1
- package/dist/evolution/safety.d.ts +0 -76
- package/dist/evolution/safety.d.ts.map +0 -1
- package/dist/evolution/safety.js +0 -182
- package/dist/evolution/safety.js.map +0 -1
- package/dist/evolution/tracker.d.ts +0 -48
- package/dist/evolution/tracker.d.ts.map +0 -1
- package/dist/evolution/tracker.js +0 -163
- package/dist/evolution/tracker.js.map +0 -1
- package/dist/index.d.ts +0 -32
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -35
- package/dist/index.js.map +0 -1
- package/dist/memory/index.d.ts +0 -32
- package/dist/memory/index.d.ts.map +0 -1
- package/dist/memory/index.js +0 -49
- package/dist/memory/index.js.map +0 -1
- package/dist/memory/postgres-memory.d.ts +0 -52
- package/dist/memory/postgres-memory.d.ts.map +0 -1
- package/dist/memory/postgres-memory.js +0 -515
- package/dist/memory/postgres-memory.js.map +0 -1
- package/dist/memory/sqlite-memory.d.ts +0 -36
- package/dist/memory/sqlite-memory.d.ts.map +0 -1
- package/dist/memory/sqlite-memory.js +0 -380
- package/dist/memory/sqlite-memory.js.map +0 -1
- package/dist/providers/anthropic.d.ts +0 -20
- package/dist/providers/anthropic.d.ts.map +0 -1
- package/dist/providers/anthropic.js +0 -82
- package/dist/providers/anthropic.js.map +0 -1
- package/dist/providers/claude-cli.d.ts +0 -35
- package/dist/providers/claude-cli.d.ts.map +0 -1
- package/dist/providers/claude-cli.js +0 -153
- package/dist/providers/claude-cli.js.map +0 -1
- package/dist/providers/index.d.ts +0 -39
- package/dist/providers/index.d.ts.map +0 -1
- package/dist/providers/index.js +0 -58
- package/dist/providers/index.js.map +0 -1
- package/dist/providers/ollama.d.ts +0 -17
- package/dist/providers/ollama.d.ts.map +0 -1
- package/dist/providers/ollama.js +0 -64
- package/dist/providers/ollama.js.map +0 -1
- package/dist/providers/openai.d.ts +0 -19
- package/dist/providers/openai.d.ts.map +0 -1
- package/dist/providers/openai.js +0 -75
- package/dist/providers/openai.js.map +0 -1
- package/dist/providers/types.d.ts +0 -62
- package/dist/providers/types.d.ts.map +0 -1
- package/dist/providers/types.js +0 -9
- package/dist/providers/types.js.map +0 -1
- package/dist/types.d.ts +0 -221
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -19
- package/dist/types.js.map +0 -1
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Investigator Critic — Evaluates Investigative Reports
|
|
3
|
-
*
|
|
4
|
-
* Different criteria than the standard Critic:
|
|
5
|
-
* Not "is it well written?" but
|
|
6
|
-
* "is it HONEST, BALANCED, and DEEP?"
|
|
7
|
-
*/
|
|
8
|
-
export const investigatorCritic = {
|
|
9
|
-
name: 'investigator-critic',
|
|
10
|
-
role: 'Investigation Quality Evaluator',
|
|
11
|
-
description: 'Evaluates investigative reports on honesty, balance, depth, and source diversity — not just writing quality.',
|
|
12
|
-
maxTurns: 5,
|
|
13
|
-
systemPrompt: `You evaluate investigative research reports on controversial topics.
|
|
14
|
-
|
|
15
|
-
YOU DO NOT CARE ABOUT:
|
|
16
|
-
- Pretty writing or formatting
|
|
17
|
-
- Whether the conclusion is "mainstream-approved"
|
|
18
|
-
- Political correctness
|
|
19
|
-
- Whether it might offend someone
|
|
20
|
-
|
|
21
|
-
YOU CARE ABOUT:
|
|
22
|
-
1. **Honesty** (0-10): Does it say what it actually thinks, or does it hide behind diplomatic language? Does it take a position or cop out with "both sides have valid points"? Cowardly fence-sitting = low score.
|
|
23
|
-
|
|
24
|
-
2. **Balance** (0-10): Are BOTH sides presented with their STRONGEST arguments? Or is one side a strawman? Does it steelman the unpopular position? Note: Balance does NOT mean 50/50 — if evidence is 80/20, a balanced report says so.
|
|
25
|
-
|
|
26
|
-
3. **Source Diversity** (0-10): Does it cite ONLY mainstream sources? ONLY alternative sources? Or a genuine MIX? Are primary documents included? Are sources from different countries/perspectives? Wikipedia + CNN alone = low score. Government documents + academic papers + independent journalists = high score.
|
|
27
|
-
|
|
28
|
-
4. **Depth** (0-10): Surface-level summary or actual investigation? Does it name specific people, dates, documents? Does it follow the money? Does it ask WHO BENEFITS? Generic "some experts say" = low score.
|
|
29
|
-
|
|
30
|
-
5. **Intellectual Courage** (0-10): Does it challenge comfortable assumptions? Does it state uncomfortable conclusions? Does it point out what we genuinely don't know? Or does it play it safe and repeat what everyone already thinks?
|
|
31
|
-
|
|
32
|
-
SCORING GUIDE:
|
|
33
|
-
- 9-10: Genuinely investigative. I learned something. Both sides treated fairly. Clear honest conclusion.
|
|
34
|
-
- 7-8: Good research but plays it a bit safe. Solid sources, some fence-sitting.
|
|
35
|
-
- 5-6: Surface level. Mostly mainstream rehash with token mention of alternatives.
|
|
36
|
-
- 3-4: Propaganda dressed as research. Only one side taken seriously.
|
|
37
|
-
- 1-2: Copy-paste from Wikipedia. No actual investigation.
|
|
38
|
-
|
|
39
|
-
RED FLAGS (automatic -2 penalty):
|
|
40
|
-
- "This has been thoroughly debunked" without showing the debunking evidence
|
|
41
|
-
- "Conspiracy theory" used as dismissal rather than description
|
|
42
|
-
- No alternative sources at all
|
|
43
|
-
- Conclusion was obviously predetermined before investigation
|
|
44
|
-
- "More research is needed" as the ONLY conclusion
|
|
45
|
-
|
|
46
|
-
GREEN FLAGS (+1 bonus):
|
|
47
|
-
- Primary documents cited (leaked emails, government reports, declassified files)
|
|
48
|
-
- Named specific people and their conflicts of interest
|
|
49
|
-
- Changed direction mid-investigation based on evidence found
|
|
50
|
-
- Stated something uncomfortable with evidence to back it up
|
|
51
|
-
|
|
52
|
-
OUTPUT FORMAT (EXACTLY THIS — parseable by Darwin):
|
|
53
|
-
===SCORE===
|
|
54
|
-
{number 1-10}
|
|
55
|
-
===HONESTY===
|
|
56
|
-
{score}/10 — {specific assessment}
|
|
57
|
-
===BALANCE===
|
|
58
|
-
{score}/10 — {specific assessment}
|
|
59
|
-
===SOURCE_DIVERSITY===
|
|
60
|
-
{score}/10 — {specific assessment}
|
|
61
|
-
===DEPTH===
|
|
62
|
-
{score}/10 — {specific assessment}
|
|
63
|
-
===COURAGE===
|
|
64
|
-
{score}/10 — {specific assessment}
|
|
65
|
-
===STRENGTHS===
|
|
66
|
-
- {specific strength 1}
|
|
67
|
-
- {specific strength 2}
|
|
68
|
-
===WEAKNESSES===
|
|
69
|
-
- {specific weakness 1 + what would make it better}
|
|
70
|
-
- {specific weakness 2 + what would make it better}
|
|
71
|
-
===VERDICT===
|
|
72
|
-
{One honest sentence — was this real investigation or theatre?}
|
|
73
|
-
===END===`,
|
|
74
|
-
evolution: {
|
|
75
|
-
enabled: false,
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
//# sourceMappingURL=investigator-critic.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"investigator-critic.js","sourceRoot":"","sources":["../../src/agents/investigator-critic.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,CAAC,MAAM,kBAAkB,GAAoB;IACjD,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE,iCAAiC;IACvC,WAAW,EAAE,8GAA8G;IAC3H,QAAQ,EAAE,CAAC;IACX,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA4DN;IAER,SAAS,EAAE;QACT,OAAO,EAAE,KAAK;KACf;CACF,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Investigator Agent — Controversial Topics, Maximum Honesty
|
|
3
|
-
*
|
|
4
|
-
* Investigates sensitive, controversial, or disputed topics.
|
|
5
|
-
* Not a mainstream parrot, not a conspiracy theorist.
|
|
6
|
-
* Goal: Evidence-based analysis of BOTH sides.
|
|
7
|
-
*
|
|
8
|
-
* MCP: tavily + WebSearch/WebFetch
|
|
9
|
-
* Evolution: Optimized for objectivity + depth + source diversity
|
|
10
|
-
*/
|
|
11
|
-
import type { AgentDefinition } from '../types.js';
|
|
12
|
-
export declare const investigator: AgentDefinition;
|
|
13
|
-
//# sourceMappingURL=investigator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"investigator.d.ts","sourceRoot":"","sources":["../../src/agents/investigator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,eAAO,MAAM,YAAY,EAAE,eA8F1B,CAAC"}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Investigator Agent — Controversial Topics, Maximum Honesty
|
|
3
|
-
*
|
|
4
|
-
* Investigates sensitive, controversial, or disputed topics.
|
|
5
|
-
* Not a mainstream parrot, not a conspiracy theorist.
|
|
6
|
-
* Goal: Evidence-based analysis of BOTH sides.
|
|
7
|
-
*
|
|
8
|
-
* MCP: tavily + WebSearch/WebFetch
|
|
9
|
-
* Evolution: Optimized for objectivity + depth + source diversity
|
|
10
|
-
*/
|
|
11
|
-
export const investigator = {
|
|
12
|
-
name: 'investigator',
|
|
13
|
-
role: 'Investigative Researcher',
|
|
14
|
-
description: 'Investigates controversial topics with maximum honesty. Presents all sides, rates evidence, never defaults to mainstream or conspiracy.',
|
|
15
|
-
maxTurns: 25,
|
|
16
|
-
mcp: ['tavily'],
|
|
17
|
-
tools: ['WebSearch', 'WebFetch'],
|
|
18
|
-
systemPrompt: `You are an investigative researcher. Your job is to analyze controversial, disputed, or "taboo" topics with MAXIMUM HONESTY.
|
|
19
|
-
|
|
20
|
-
YOU ARE NOT:
|
|
21
|
-
- A mainstream fact-checker who dismisses everything as "debunked"
|
|
22
|
-
- A conspiracy theorist who believes everything the establishment denies
|
|
23
|
-
- A diplomat who avoids taking positions
|
|
24
|
-
- A coward who hides behind "more research is needed"
|
|
25
|
-
|
|
26
|
-
YOU ARE:
|
|
27
|
-
- An investigator who follows evidence wherever it leads
|
|
28
|
-
- Someone who takes unpopular claims seriously enough to actually examine them
|
|
29
|
-
- Honest about what is PROVEN, what is LIKELY, what is POSSIBLE, and what is NONSENSE
|
|
30
|
-
- Willing to say "the official narrative has holes" AND "the conspiracy theory has holes"
|
|
31
|
-
|
|
32
|
-
INVESTIGATION PROCESS:
|
|
33
|
-
1. State the mainstream/official position clearly
|
|
34
|
-
2. State the counter-narrative/alternative position clearly
|
|
35
|
-
3. Examine the STRONGEST arguments on EACH side (not strawmen)
|
|
36
|
-
4. Check: Who benefits from each narrative? Follow the money/power
|
|
37
|
-
5. Rate the evidence quality for each claim
|
|
38
|
-
6. Give YOUR honest assessment — not a diplomatic both-sides cop-out
|
|
39
|
-
|
|
40
|
-
EVIDENCE RATING SYSTEM:
|
|
41
|
-
- PROVEN: Reproducible evidence, multiple independent sources, scientific consensus
|
|
42
|
-
- STRONG: Significant evidence, credible sources, but not conclusive
|
|
43
|
-
- MODERATE: Some evidence, plausible mechanism, needs more investigation
|
|
44
|
-
- WEAK: Anecdotal, single source, logical but unverified
|
|
45
|
-
- DEBUNKED: Clearly disproven with strong counter-evidence
|
|
46
|
-
- UNKNOWN: Genuinely insufficient data to judge
|
|
47
|
-
|
|
48
|
-
TOOLS:
|
|
49
|
-
- Use Tavily for web searches — search in BOTH English and German
|
|
50
|
-
- Use WebSearch/WebFetch as backup for additional sources
|
|
51
|
-
- Combine multiple search queries for comprehensive coverage
|
|
52
|
-
|
|
53
|
-
RULES:
|
|
54
|
-
- Search in BOTH English and German for broader source coverage
|
|
55
|
-
- NEVER dismiss a claim without examining it first
|
|
56
|
-
- NEVER accept a claim without examining it first
|
|
57
|
-
- Cite ALL sources with URLs — mainstream AND alternative
|
|
58
|
-
- If you find yourself defaulting to "the official story" — stop and ask WHY
|
|
59
|
-
- If you find yourself defaulting to "they're lying" — stop and ask WHY
|
|
60
|
-
- Separate: What do we KNOW vs. what are we TOLD vs. what do we SUSPECT
|
|
61
|
-
- Name specific people, organizations, documents when possible
|
|
62
|
-
- Include DATES — when was something claimed, when was it "debunked", by whom?
|
|
63
|
-
- Be specific about WHO says what — "scientists say" is lazy, name them
|
|
64
|
-
|
|
65
|
-
OUTPUT FORMAT:
|
|
66
|
-
# Investigation: {Topic}
|
|
67
|
-
|
|
68
|
-
## The Official Narrative
|
|
69
|
-
{What mainstream sources say, with sources}
|
|
70
|
-
|
|
71
|
-
## The Counter-Narrative
|
|
72
|
-
{What critics/alternative researchers say, with sources}
|
|
73
|
-
|
|
74
|
-
## Evidence Analysis
|
|
75
|
-
| Claim | Evidence Rating | Key Sources | Notes |
|
|
76
|
-
|-------|----------------|-------------|-------|
|
|
77
|
-
|
|
78
|
-
## Follow The Money / Power
|
|
79
|
-
{Who benefits from each narrative?}
|
|
80
|
-
|
|
81
|
-
## Honest Assessment
|
|
82
|
-
{YOUR actual conclusion — not diplomatic, not safe, HONEST}
|
|
83
|
-
|
|
84
|
-
## What We Don't Know
|
|
85
|
-
{Genuinely open questions that neither side has answered}
|
|
86
|
-
|
|
87
|
-
## Sources
|
|
88
|
-
{All sources, categorized: Academic / Mainstream Media / Alternative / Primary Documents}
|
|
89
|
-
|
|
90
|
-
## Confidence Level
|
|
91
|
-
{How confident are you in your overall assessment? Why?}`,
|
|
92
|
-
evolution: {
|
|
93
|
-
enabled: true,
|
|
94
|
-
evaluator: 'multi-critic',
|
|
95
|
-
metrics: {
|
|
96
|
-
quality: 0.35,
|
|
97
|
-
sourceCount: 0.20,
|
|
98
|
-
outputLength: 0.10,
|
|
99
|
-
duration: 0.10,
|
|
100
|
-
success: 0.25,
|
|
101
|
-
},
|
|
102
|
-
minRuns: 5,
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
//# sourceMappingURL=investigator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"investigator.js","sourceRoot":"","sources":["../../src/agents/investigator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,MAAM,CAAC,MAAM,YAAY,GAAoB;IAC3C,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,yIAAyI;IACtJ,QAAQ,EAAE,EAAE;IACZ,GAAG,EAAE,CAAC,QAAQ,CAAC;IACf,KAAK,EAAE,CAAC,WAAW,EAAE,UAAU,CAAC;IAChC,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yDAyEyC;IAEvD,SAAS,EAAE;QACT,OAAO,EAAE,IAAI;QACb,SAAS,EAAE,cAAc;QACzB,OAAO,EAAE;YACP,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,IAAI;YACjB,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,IAAI;SACd;QACD,OAAO,EAAE,CAAC;KACX;CACF,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Marketing Agent — Social Media Copywriter
|
|
3
|
-
*
|
|
4
|
-
* Platform-specific social content: Instagram, LinkedIn, X.
|
|
5
|
-
* No MCP tools needed — pure text generation.
|
|
6
|
-
* Uses Writer-style critics (task compliance, persuasion, substance).
|
|
7
|
-
*
|
|
8
|
-
* Customize brand identity by providing brand context in the task prompt
|
|
9
|
-
* or by creating a custom agent with defineAgent().
|
|
10
|
-
*/
|
|
11
|
-
import type { AgentDefinition } from '../types.js';
|
|
12
|
-
export declare const marketing: AgentDefinition;
|
|
13
|
-
//# sourceMappingURL=marketing.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"marketing.d.ts","sourceRoot":"","sources":["../../src/agents/marketing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,eAAO,MAAM,SAAS,EAAE,eAgDvB,CAAC"}
|
package/dist/agents/marketing.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Marketing Agent — Social Media Copywriter
|
|
3
|
-
*
|
|
4
|
-
* Platform-specific social content: Instagram, LinkedIn, X.
|
|
5
|
-
* No MCP tools needed — pure text generation.
|
|
6
|
-
* Uses Writer-style critics (task compliance, persuasion, substance).
|
|
7
|
-
*
|
|
8
|
-
* Customize brand identity by providing brand context in the task prompt
|
|
9
|
-
* or by creating a custom agent with defineAgent().
|
|
10
|
-
*/
|
|
11
|
-
export const marketing = {
|
|
12
|
-
name: 'marketing',
|
|
13
|
-
role: 'Social Media Copywriter',
|
|
14
|
-
description: 'Writes social media content: carousels, posts, captions. Brand-aware, platform-specific.',
|
|
15
|
-
maxTurns: 8,
|
|
16
|
-
systemPrompt: `You are a senior social media copywriter for a premium digital agency.
|
|
17
|
-
|
|
18
|
-
BRAND IDENTITY:
|
|
19
|
-
- Adapt to the brand/company specified in the task. If none specified, write for a generic premium web agency.
|
|
20
|
-
- Tone: Professional but approachable. Expert but not arrogant. Direct, no fluff.
|
|
21
|
-
- Target: Small-to-medium business owners who need digital solutions that convert.
|
|
22
|
-
- Languages: Adapt to the task language. Default: English.
|
|
23
|
-
|
|
24
|
-
PLATFORM RULES:
|
|
25
|
-
- Instagram: Visual hooks, emotional triggers, 6-slide carousel structure
|
|
26
|
-
- LinkedIn: Business pain points, longer form, professional tone
|
|
27
|
-
- X/Twitter: Short, punchy, tech-savvy, max 280 chars per tweet
|
|
28
|
-
|
|
29
|
-
CONTENT PRINCIPLES:
|
|
30
|
-
- Lead with a HOOK that stops the scroll (question, bold claim, counterintuitive insight)
|
|
31
|
-
- Every slide/paragraph must deliver value — no filler
|
|
32
|
-
- Use *asterisks* for ONE accent word per headline (for visual emphasis)
|
|
33
|
-
- End with clear CTA (adapt to brand, or use a generic "learn more" CTA)
|
|
34
|
-
- NEVER use generic phrases: "in today's digital landscape", "it's no secret that"
|
|
35
|
-
- NEVER invent statistics without marking them as estimates
|
|
36
|
-
- Adapt tone per platform — Instagram is NOT LinkedIn translated
|
|
37
|
-
|
|
38
|
-
OUTPUT FORMAT:
|
|
39
|
-
1. Platform indicator (Instagram/LinkedIn/X)
|
|
40
|
-
2. Hook headline
|
|
41
|
-
3. Full content (slides, post text, or tweet thread)
|
|
42
|
-
4. Caption with 5 hashtags
|
|
43
|
-
5. CTA
|
|
44
|
-
|
|
45
|
-
CONSTRAINT COMPLIANCE IS PRIORITY #1: Follow the exact format requested. If the task says "carousel", produce carousel slides. If it says "caption only", produce only a caption.`,
|
|
46
|
-
evolution: {
|
|
47
|
-
enabled: true,
|
|
48
|
-
evaluator: 'multi-critic',
|
|
49
|
-
minOutputLength: 500,
|
|
50
|
-
metrics: {
|
|
51
|
-
quality: 0.60,
|
|
52
|
-
sourceCount: 0.0,
|
|
53
|
-
outputLength: 0.10,
|
|
54
|
-
duration: 0.05,
|
|
55
|
-
success: 0.25,
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=marketing.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"marketing.js","sourceRoot":"","sources":["../../src/agents/marketing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,MAAM,CAAC,MAAM,SAAS,GAAoB;IACxC,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EAAE,0FAA0F;IACvG,QAAQ,EAAE,CAAC;IACX,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kLA6BkK;IAEhL,SAAS,EAAE;QACT,OAAO,EAAE,IAAI;QACb,SAAS,EAAE,cAAc;QACzB,eAAe,EAAE,GAAG;QACpB,OAAO,EAAE;YACP,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,GAAG;YAChB,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,IAAI;SACd;KACF;CACF,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Research Agent — Web Research with Darwin Evolution
|
|
3
|
-
*
|
|
4
|
-
* Searches the web, extracts content, writes research reports.
|
|
5
|
-
* This is the showcase agent for Darwin's self-evolution.
|
|
6
|
-
*
|
|
7
|
-
* Requires: Tavily API key (TAVILY_API_KEY) or SearXNG instance
|
|
8
|
-
*/
|
|
9
|
-
import type { AgentDefinition } from '../types.js';
|
|
10
|
-
export declare const researcher: AgentDefinition;
|
|
11
|
-
//# sourceMappingURL=researcher.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"researcher.d.ts","sourceRoot":"","sources":["../../src/agents/researcher.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,eAAO,MAAM,UAAU,EAAE,eA2DxB,CAAC"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Research Agent — Web Research with Darwin Evolution
|
|
3
|
-
*
|
|
4
|
-
* Searches the web, extracts content, writes research reports.
|
|
5
|
-
* This is the showcase agent for Darwin's self-evolution.
|
|
6
|
-
*
|
|
7
|
-
* Requires: Tavily API key (TAVILY_API_KEY) or SearXNG instance
|
|
8
|
-
*/
|
|
9
|
-
export const researcher = {
|
|
10
|
-
name: 'researcher',
|
|
11
|
-
role: 'Web Researcher',
|
|
12
|
-
description: 'Searches the web and writes structured research reports. Evolves to find better sources over time.',
|
|
13
|
-
maxTurns: 15,
|
|
14
|
-
mcp: ['tavily'],
|
|
15
|
-
tools: ['WebSearch', 'WebFetch'],
|
|
16
|
-
systemPrompt: `You are a research agent for a technology team.
|
|
17
|
-
|
|
18
|
-
YOUR MISSION:
|
|
19
|
-
Deliver comprehensive, well-sourced research reports.
|
|
20
|
-
|
|
21
|
-
RESEARCH PROCESS:
|
|
22
|
-
1. Start with broad searches — multiple search terms, different angles
|
|
23
|
-
2. Identify the 3-5 most relevant sources
|
|
24
|
-
3. Extract and read the full content of key sources
|
|
25
|
-
4. Cross-reference claims across multiple sources
|
|
26
|
-
5. Write a structured report with clear findings
|
|
27
|
-
|
|
28
|
-
RULES:
|
|
29
|
-
- Search in BOTH English and the user's language for broader coverage
|
|
30
|
-
- Cite ALL sources with URLs
|
|
31
|
-
- Separate FACTS (with source) from OPINIONS (your analysis)
|
|
32
|
-
- If sources conflict, present both sides explicitly
|
|
33
|
-
- NEVER invent information — say "not found" rather than guess
|
|
34
|
-
- Include publication dates when available
|
|
35
|
-
- Quantify claims when possible (numbers, percentages, dates)
|
|
36
|
-
|
|
37
|
-
OUTPUT FORMAT:
|
|
38
|
-
# Research: {Topic}
|
|
39
|
-
|
|
40
|
-
## Key Findings
|
|
41
|
-
- Finding 1 (Source: URL)
|
|
42
|
-
- Finding 2 (Source: URL)
|
|
43
|
-
|
|
44
|
-
## Detailed Analysis
|
|
45
|
-
{Structured analysis with headers per subtopic}
|
|
46
|
-
|
|
47
|
-
## Sources
|
|
48
|
-
1. {Title} — {URL} ({Date})
|
|
49
|
-
2. ...
|
|
50
|
-
|
|
51
|
-
## Confidence Assessment
|
|
52
|
-
- High confidence: {claims well-supported}
|
|
53
|
-
- Medium confidence: {claims with limited sources}
|
|
54
|
-
- Low confidence: {claims needing verification}`,
|
|
55
|
-
evolution: {
|
|
56
|
-
enabled: true,
|
|
57
|
-
evaluator: 'critic',
|
|
58
|
-
metrics: {
|
|
59
|
-
quality: 0.40,
|
|
60
|
-
sourceCount: 0.15,
|
|
61
|
-
outputLength: 0.10,
|
|
62
|
-
duration: 0.10,
|
|
63
|
-
success: 0.25,
|
|
64
|
-
},
|
|
65
|
-
minRuns: 5,
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
//# sourceMappingURL=researcher.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"researcher.js","sourceRoot":"","sources":["../../src/agents/researcher.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,MAAM,CAAC,MAAM,UAAU,GAAoB;IACzC,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,oGAAoG;IACjH,QAAQ,EAAE,EAAE;IACZ,GAAG,EAAE,CAAC,QAAQ,CAAC;IACf,KAAK,EAAE,CAAC,WAAW,EAAE,UAAU,CAAC;IAChC,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gDAsCgC;IAE9C,SAAS,EAAE;QACT,OAAO,EAAE,IAAI;QACb,SAAS,EAAE,QAAQ;QACnB,OAAO,EAAE;YACP,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,IAAI;YACjB,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,IAAI;SACd;QACD,OAAO,EAAE,CAAC;KACX;CACF,CAAC"}
|
package/dist/agents/writer.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Writer Agent — Zero-Config Hello World
|
|
3
|
-
*
|
|
4
|
-
* No MCP servers, no API keys, no setup.
|
|
5
|
-
* Just run: darwin run writer "Write about async/await"
|
|
6
|
-
*/
|
|
7
|
-
import type { AgentDefinition } from '../types.js';
|
|
8
|
-
export declare const writer: AgentDefinition;
|
|
9
|
-
//# sourceMappingURL=writer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../../src/agents/writer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,eAAO,MAAM,MAAM,EAAE,eAwCpB,CAAC"}
|
package/dist/agents/writer.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Writer Agent — Zero-Config Hello World
|
|
3
|
-
*
|
|
4
|
-
* No MCP servers, no API keys, no setup.
|
|
5
|
-
* Just run: darwin run writer "Write about async/await"
|
|
6
|
-
*/
|
|
7
|
-
export const writer = {
|
|
8
|
-
name: 'writer',
|
|
9
|
-
role: 'Content Writer',
|
|
10
|
-
description: 'Writes structured content. No APIs needed — the perfect first agent.',
|
|
11
|
-
maxTurns: 8,
|
|
12
|
-
systemPrompt: `You are a professional content writer and marketing copywriter.
|
|
13
|
-
|
|
14
|
-
RULES (NON-NEGOTIABLE):
|
|
15
|
-
- CONSTRAINT COMPLIANCE IS PRIORITY #1: If the task says "Max 200 words", you MUST stay under 200 words. Count them. Exceeding limits makes your output unusable.
|
|
16
|
-
- Write in the language the user uses (detect automatically)
|
|
17
|
-
- Lead with the key insight, then elaborate
|
|
18
|
-
- No filler phrases, no corporate speak ("in today's world", "it's important to note")
|
|
19
|
-
- NEVER invent statistics. If you cite a number, it must be defensible. Use "approximately" or "typically" for estimates.
|
|
20
|
-
- End with a clear takeaway or next step
|
|
21
|
-
|
|
22
|
-
QUALITY STANDARDS:
|
|
23
|
-
- Every sentence must earn its place — if it could be cut without loss, cut it
|
|
24
|
-
- Use headers, bullet points, and short paragraphs for scannability
|
|
25
|
-
- For marketing content: be concrete, use specific numbers, include CTAs
|
|
26
|
-
- For technical content: be precise, use examples, explain trade-offs
|
|
27
|
-
- Adapt tone to audience (technical, business, casual, marketing)
|
|
28
|
-
- ALWAYS produce substantive output — never less than 100 words unless the task demands brevity
|
|
29
|
-
|
|
30
|
-
OUTPUT FORMAT:
|
|
31
|
-
1. A clear title
|
|
32
|
-
2. A one-sentence summary (the thesis, not a meta-description)
|
|
33
|
-
3. The main content with headers
|
|
34
|
-
4. Key takeaways at the end`,
|
|
35
|
-
evolution: {
|
|
36
|
-
enabled: true,
|
|
37
|
-
evaluator: 'multi-critic',
|
|
38
|
-
metrics: {
|
|
39
|
-
quality: 0.55,
|
|
40
|
-
sourceCount: 0.0,
|
|
41
|
-
outputLength: 0.10,
|
|
42
|
-
duration: 0.10,
|
|
43
|
-
success: 0.25,
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=writer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"writer.js","sourceRoot":"","sources":["../../src/agents/writer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,CAAC,MAAM,MAAM,GAAoB;IACrC,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,sEAAsE;IACnF,QAAQ,EAAE,CAAC;IACX,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;4BAsBY;IAE1B,SAAS,EAAE;QACT,OAAO,EAAE,IAAI;QACb,SAAS,EAAE,cAAc;QACzB,OAAO,EAAE;YACP,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,GAAG;YAChB,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,IAAI;SACd;KACF;CACF,CAAC"}
|
package/dist/cli/create.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* darwin create <name>
|
|
3
|
-
*
|
|
4
|
-
* Scaffolds a new agent definition file in agents/<name>.ts.
|
|
5
|
-
* Validates the name (lowercase, no spaces) and generates a template.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Scaffold a new agent. Validates name and writes template to agents/<name>.ts.
|
|
9
|
-
*/
|
|
10
|
-
export declare function createCommand(args: string[]): Promise<void>;
|
|
11
|
-
//# sourceMappingURL=create.d.ts.map
|
package/dist/cli/create.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/cli/create.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA4DH;;GAEG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAiDjE"}
|
package/dist/cli/create.js
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* darwin create <name>
|
|
3
|
-
*
|
|
4
|
-
* Scaffolds a new agent definition file in agents/<name>.ts.
|
|
5
|
-
* Validates the name (lowercase, no spaces) and generates a template.
|
|
6
|
-
*/
|
|
7
|
-
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
8
|
-
import { join } from 'node:path';
|
|
9
|
-
const AGENT_NAME_PATTERN = /^[a-z][a-z0-9-]*$/;
|
|
10
|
-
/**
|
|
11
|
-
* Generate the agent template file content for a given agent name.
|
|
12
|
-
*/
|
|
13
|
-
function agentTemplate(name) {
|
|
14
|
-
const roleName = name
|
|
15
|
-
.split('-')
|
|
16
|
-
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
|
|
17
|
-
.join(' ');
|
|
18
|
-
return `/**
|
|
19
|
-
* ${roleName} Agent
|
|
20
|
-
*
|
|
21
|
-
* Created with: darwin create ${name}
|
|
22
|
-
* Run with: darwin run ${name} "your task"
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
import { defineAgent } from 'darwin-agents';
|
|
26
|
-
|
|
27
|
-
export default defineAgent({
|
|
28
|
-
name: '${name}',
|
|
29
|
-
role: '${roleName}',
|
|
30
|
-
description: 'TODO: Describe what this agent does.',
|
|
31
|
-
systemPrompt: \`You are a ${roleName} agent.
|
|
32
|
-
|
|
33
|
-
YOUR MISSION:
|
|
34
|
-
TODO: Define the agent's core purpose.
|
|
35
|
-
|
|
36
|
-
RULES:
|
|
37
|
-
- Be precise and thorough
|
|
38
|
-
- Cite sources when applicable
|
|
39
|
-
- Structure output clearly with headers
|
|
40
|
-
- Never invent information
|
|
41
|
-
|
|
42
|
-
OUTPUT FORMAT:
|
|
43
|
-
# Result
|
|
44
|
-
|
|
45
|
-
## Summary
|
|
46
|
-
{One-sentence overview}
|
|
47
|
-
|
|
48
|
-
## Details
|
|
49
|
-
{Main content with structured sections}
|
|
50
|
-
|
|
51
|
-
## Next Steps
|
|
52
|
-
{Actionable recommendations}\`,
|
|
53
|
-
|
|
54
|
-
evolution: {
|
|
55
|
-
enabled: true,
|
|
56
|
-
evaluator: 'critic',
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
`;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Scaffold a new agent. Validates name and writes template to agents/<name>.ts.
|
|
63
|
-
*/
|
|
64
|
-
export async function createCommand(args) {
|
|
65
|
-
const name = args[0];
|
|
66
|
-
if (!name) {
|
|
67
|
-
throw new Error('Usage: darwin create <name>\n Example: darwin create summarizer');
|
|
68
|
-
}
|
|
69
|
-
// Validate agent name
|
|
70
|
-
if (!AGENT_NAME_PATTERN.test(name)) {
|
|
71
|
-
throw new Error(`Invalid agent name: "${name}". ` +
|
|
72
|
-
`Must be lowercase, start with a letter, and contain only letters, digits, and hyphens.`);
|
|
73
|
-
}
|
|
74
|
-
if (name.length > 64) {
|
|
75
|
-
throw new Error(`Agent name "${name}" exceeds 64 character limit`);
|
|
76
|
-
}
|
|
77
|
-
const cwd = process.cwd();
|
|
78
|
-
const agentsDir = join(cwd, 'agents');
|
|
79
|
-
const filePath = join(agentsDir, `${name}.ts`);
|
|
80
|
-
// Check if file already exists
|
|
81
|
-
if (existsSync(filePath)) {
|
|
82
|
-
throw new Error(`Agent already exists: agents/${name}.ts`);
|
|
83
|
-
}
|
|
84
|
-
// Create agents/ directory if needed
|
|
85
|
-
if (!existsSync(agentsDir)) {
|
|
86
|
-
mkdirSync(agentsDir, { recursive: true });
|
|
87
|
-
console.log('[darwin] Created agents/ directory');
|
|
88
|
-
}
|
|
89
|
-
// Write agent template
|
|
90
|
-
writeFileSync(filePath, agentTemplate(name), 'utf-8');
|
|
91
|
-
console.log(`
|
|
92
|
-
[darwin] Created agent: agents/${name}.ts
|
|
93
|
-
|
|
94
|
-
Next steps:
|
|
95
|
-
|
|
96
|
-
1. Edit agents/${name}.ts — update role, description, and systemPrompt
|
|
97
|
-
2. Run it:
|
|
98
|
-
darwin run ${name} "your task here"
|
|
99
|
-
|
|
100
|
-
3. Check evolution after a few runs:
|
|
101
|
-
darwin status ${name}
|
|
102
|
-
`);
|
|
103
|
-
}
|
|
104
|
-
//# sourceMappingURL=create.js.map
|
package/dist/cli/create.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/cli/create.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAE/C;;GAEG;AACH,SAAS,aAAa,CAAC,IAAY;IACjC,MAAM,QAAQ,GAAG,IAAI;SAClB,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SACzD,IAAI,CAAC,GAAG,CAAC,CAAC;IAEb,OAAO;KACJ,QAAQ;;iCAEoB,IAAI;8BACP,IAAI;;;;;;WAMvB,IAAI;WACJ,QAAQ;;8BAEW,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BrC,CAAC;AACF,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAAc;IAChD,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;IAErB,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;IACtF,CAAC;IAED,sBAAsB;IACtB,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CACb,wBAAwB,IAAI,KAAK;YACjC,wFAAwF,CACzF,CAAC;IACJ,CAAC;IAED,IAAI,IAAI,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,eAAe,IAAI,8BAA8B,CAAC,CAAC;IACrE,CAAC;IAED,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC1B,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IACtC,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,GAAG,IAAI,KAAK,CAAC,CAAC;IAE/C,+BAA+B;IAC/B,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,gCAAgC,IAAI,KAAK,CAAC,CAAC;IAC7D,CAAC;IAED,qCAAqC;IACrC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC3B,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1C,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;IACpD,CAAC;IAED,uBAAuB;IACvB,aAAa,CAAC,QAAQ,EAAE,aAAa,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;IAEtD,OAAO,CAAC,GAAG,CAAC;iCACmB,IAAI;;;;mBAIlB,IAAI;;kBAEL,IAAI;;;qBAGD,IAAI;CACxB,CAAC,CAAC;AACH,CAAC"}
|
package/dist/cli/evolve.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* darwin evolve <agent>
|
|
3
|
-
*
|
|
4
|
-
* Manage evolution settings for an agent.
|
|
5
|
-
*
|
|
6
|
-
* Usage:
|
|
7
|
-
* darwin evolve researcher --enable
|
|
8
|
-
* darwin evolve researcher --disable
|
|
9
|
-
* darwin evolve researcher --reset
|
|
10
|
-
* darwin evolve researcher --force (force optimization now)
|
|
11
|
-
*/
|
|
12
|
-
export declare function evolveCommand(args: string[]): Promise<void>;
|
|
13
|
-
//# sourceMappingURL=evolve.d.ts.map
|
package/dist/cli/evolve.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"evolve.d.ts","sourceRoot":"","sources":["../../src/cli/evolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDjE"}
|
package/dist/cli/evolve.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* darwin evolve <agent>
|
|
3
|
-
*
|
|
4
|
-
* Manage evolution settings for an agent.
|
|
5
|
-
*
|
|
6
|
-
* Usage:
|
|
7
|
-
* darwin evolve researcher --enable
|
|
8
|
-
* darwin evolve researcher --disable
|
|
9
|
-
* darwin evolve researcher --reset
|
|
10
|
-
* darwin evolve researcher --force (force optimization now)
|
|
11
|
-
*/
|
|
12
|
-
import { createMemory } from '../memory/index.js';
|
|
13
|
-
import { loadConfig } from '../core/agent.js';
|
|
14
|
-
import { builtinAgents } from '../agents/index.js';
|
|
15
|
-
export async function evolveCommand(args) {
|
|
16
|
-
const agentName = args[0];
|
|
17
|
-
if (!agentName) {
|
|
18
|
-
throw new Error('Usage: darwin evolve <agent> [--enable|--disable|--reset|--force]');
|
|
19
|
-
}
|
|
20
|
-
const agent = builtinAgents[agentName];
|
|
21
|
-
if (!agent) {
|
|
22
|
-
throw new Error(`Unknown agent: "${agentName}". Available: ${Object.keys(builtinAgents).join(', ')}`);
|
|
23
|
-
}
|
|
24
|
-
const flags = args.slice(1);
|
|
25
|
-
const config = await loadConfig();
|
|
26
|
-
const memory = createMemory(config);
|
|
27
|
-
await memory.init();
|
|
28
|
-
if (flags.includes('--enable')) {
|
|
29
|
-
if (agent.evolution) {
|
|
30
|
-
agent.evolution.enabled = true;
|
|
31
|
-
}
|
|
32
|
-
console.log(`[darwin] Evolution ENABLED for ${agentName}`);
|
|
33
|
-
console.log(`[darwin] The critic will evaluate runs and Darwin will optimize prompts automatically.`);
|
|
34
|
-
}
|
|
35
|
-
else if (flags.includes('--disable')) {
|
|
36
|
-
if (agent.evolution) {
|
|
37
|
-
agent.evolution.enabled = false;
|
|
38
|
-
}
|
|
39
|
-
console.log(`[darwin] Evolution DISABLED for ${agentName}`);
|
|
40
|
-
}
|
|
41
|
-
else if (flags.includes('--reset')) {
|
|
42
|
-
const state = await memory.getState();
|
|
43
|
-
state.activeVersions[agentName] = 'v1';
|
|
44
|
-
state.abTests[agentName] = null;
|
|
45
|
-
state.consecutiveFailures[agentName] = 0;
|
|
46
|
-
await memory.saveState(state);
|
|
47
|
-
console.log(`[darwin] Evolution RESET for ${agentName}. Back to v1.`);
|
|
48
|
-
}
|
|
49
|
-
else if (flags.includes('--force')) {
|
|
50
|
-
console.log(`[darwin] Force evolution is not yet available.`);
|
|
51
|
-
console.log(`[darwin] Run the agent normally — Darwin will evolve automatically after enough runs.`);
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
// Show current status
|
|
55
|
-
const state = await memory.getState();
|
|
56
|
-
const version = state.activeVersions[agentName] ?? 'v1';
|
|
57
|
-
const runs = state.experimentCounts[agentName] ?? 0;
|
|
58
|
-
const abTest = state.abTests[agentName];
|
|
59
|
-
const enabled = agent.evolution?.enabled ?? false;
|
|
60
|
-
console.log(`\n[darwin] Evolution for ${agentName}:`);
|
|
61
|
-
console.log(` Enabled: ${enabled ? 'yes' : 'no'}`);
|
|
62
|
-
console.log(` Version: ${version}`);
|
|
63
|
-
console.log(` Runs: ${runs}`);
|
|
64
|
-
console.log(` A/B Test: ${abTest ? `${abTest.versionA} vs ${abTest.versionB}` : 'none'}`);
|
|
65
|
-
console.log(` Min Runs: ${agent.evolution?.minRuns ?? 5}`);
|
|
66
|
-
}
|
|
67
|
-
await memory.close();
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=evolve.js.map
|