darwin-agents 0.4.4
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/LICENSE +21 -0
- package/README.md +245 -0
- package/dist/agents/analyst.d.ts +11 -0
- package/dist/agents/analyst.d.ts.map +1 -0
- package/dist/agents/analyst.js +78 -0
- package/dist/agents/analyst.js.map +1 -0
- package/dist/agents/blog-writer.d.ts +13 -0
- package/dist/agents/blog-writer.d.ts.map +1 -0
- package/dist/agents/blog-writer.js +59 -0
- package/dist/agents/blog-writer.js.map +1 -0
- package/dist/agents/critic.d.ts +11 -0
- package/dist/agents/critic.d.ts.map +1 -0
- package/dist/agents/critic.js +57 -0
- package/dist/agents/critic.js.map +1 -0
- package/dist/agents/index.d.ts +15 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +31 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/investigator-critic.d.ts +10 -0
- package/dist/agents/investigator-critic.d.ts.map +1 -0
- package/dist/agents/investigator-critic.js +78 -0
- package/dist/agents/investigator-critic.js.map +1 -0
- package/dist/agents/investigator.d.ts +13 -0
- package/dist/agents/investigator.d.ts.map +1 -0
- package/dist/agents/investigator.js +105 -0
- package/dist/agents/investigator.js.map +1 -0
- package/dist/agents/marketing.d.ts +13 -0
- package/dist/agents/marketing.d.ts.map +1 -0
- package/dist/agents/marketing.js +59 -0
- package/dist/agents/marketing.js.map +1 -0
- package/dist/agents/researcher.d.ts +11 -0
- package/dist/agents/researcher.d.ts.map +1 -0
- package/dist/agents/researcher.js +68 -0
- package/dist/agents/researcher.js.map +1 -0
- package/dist/agents/writer.d.ts +9 -0
- package/dist/agents/writer.d.ts.map +1 -0
- package/dist/agents/writer.js +47 -0
- package/dist/agents/writer.js.map +1 -0
- package/dist/cli/create.d.ts +11 -0
- package/dist/cli/create.d.ts.map +1 -0
- package/dist/cli/create.js +104 -0
- package/dist/cli/create.js.map +1 -0
- package/dist/cli/evolve.d.ts +13 -0
- package/dist/cli/evolve.d.ts.map +1 -0
- package/dist/cli/evolve.js +69 -0
- package/dist/cli/evolve.js.map +1 -0
- package/dist/cli/index.d.ts +13 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +84 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init.d.ts +12 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +68 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/run.d.ts +7 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +371 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/cli/status.d.ts +7 -0
- package/dist/cli/status.d.ts.map +1 -0
- package/dist/cli/status.js +123 -0
- package/dist/cli/status.js.map +1 -0
- package/dist/core/agent.d.ts +53 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/agent.js +172 -0
- package/dist/core/agent.js.map +1 -0
- package/dist/core/runner.d.ts +64 -0
- package/dist/core/runner.d.ts.map +1 -0
- package/dist/core/runner.js +203 -0
- package/dist/core/runner.js.map +1 -0
- package/dist/evolution/loop.d.ts +100 -0
- package/dist/evolution/loop.d.ts.map +1 -0
- package/dist/evolution/loop.js +424 -0
- package/dist/evolution/loop.js.map +1 -0
- package/dist/evolution/multi-critic.d.ts +58 -0
- package/dist/evolution/multi-critic.d.ts.map +1 -0
- package/dist/evolution/multi-critic.js +324 -0
- package/dist/evolution/multi-critic.js.map +1 -0
- package/dist/evolution/notifications.d.ts +32 -0
- package/dist/evolution/notifications.d.ts.map +1 -0
- package/dist/evolution/notifications.js +92 -0
- package/dist/evolution/notifications.js.map +1 -0
- package/dist/evolution/optimizer.d.ts +64 -0
- package/dist/evolution/optimizer.d.ts.map +1 -0
- package/dist/evolution/optimizer.js +223 -0
- package/dist/evolution/optimizer.js.map +1 -0
- package/dist/evolution/patterns.d.ts +63 -0
- package/dist/evolution/patterns.d.ts.map +1 -0
- package/dist/evolution/patterns.js +297 -0
- package/dist/evolution/patterns.js.map +1 -0
- package/dist/evolution/safety.d.ts +76 -0
- package/dist/evolution/safety.d.ts.map +1 -0
- package/dist/evolution/safety.js +182 -0
- package/dist/evolution/safety.js.map +1 -0
- package/dist/evolution/tracker.d.ts +48 -0
- package/dist/evolution/tracker.d.ts.map +1 -0
- package/dist/evolution/tracker.js +163 -0
- package/dist/evolution/tracker.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/memory/index.d.ts +32 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +49 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/memory/postgres-memory.d.ts +52 -0
- package/dist/memory/postgres-memory.d.ts.map +1 -0
- package/dist/memory/postgres-memory.js +515 -0
- package/dist/memory/postgres-memory.js.map +1 -0
- package/dist/memory/sqlite-memory.d.ts +36 -0
- package/dist/memory/sqlite-memory.d.ts.map +1 -0
- package/dist/memory/sqlite-memory.js +380 -0
- package/dist/memory/sqlite-memory.js.map +1 -0
- package/dist/providers/anthropic.d.ts +20 -0
- package/dist/providers/anthropic.d.ts.map +1 -0
- package/dist/providers/anthropic.js +82 -0
- package/dist/providers/anthropic.js.map +1 -0
- package/dist/providers/claude-cli.d.ts +35 -0
- package/dist/providers/claude-cli.d.ts.map +1 -0
- package/dist/providers/claude-cli.js +143 -0
- package/dist/providers/claude-cli.js.map +1 -0
- package/dist/providers/index.d.ts +39 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +58 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/ollama.d.ts +17 -0
- package/dist/providers/ollama.d.ts.map +1 -0
- package/dist/providers/ollama.js +64 -0
- package/dist/providers/ollama.js.map +1 -0
- package/dist/providers/openai.d.ts +19 -0
- package/dist/providers/openai.d.ts.map +1 -0
- package/dist/providers/openai.js +75 -0
- package/dist/providers/openai.js.map +1 -0
- package/dist/providers/types.d.ts +62 -0
- package/dist/providers/types.d.ts.map +1 -0
- package/dist/providers/types.js +9 -0
- package/dist/providers/types.js.map +1 -0
- package/dist/types.d.ts +221 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +19 -0
- package/dist/types.js.map +1 -0
- package/package.json +81 -0
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Investigator Agent — Kontroverse Themen, maximale Ehrlichkeit
|
|
3
|
+
*
|
|
4
|
+
* Untersucht heikle, kontroverse oder umstrittene Themen.
|
|
5
|
+
* Kein Mainstream-Papagei, kein Verschwoerungstheoretiker.
|
|
6
|
+
* Ziel: Evidenz-basierte Analyse BEIDER Seiten.
|
|
7
|
+
*
|
|
8
|
+
* MCP: mcp-research (SearXNG) + WebSearch/WebFetch (Anthropic Search)
|
|
9
|
+
* Evolution: Optimiert auf Objektivitaet + Tiefe + Quellenvielfalt
|
|
10
|
+
*/
|
|
11
|
+
import type { AgentDefinition } from '../types.js';
|
|
12
|
+
export declare const investigator: AgentDefinition;
|
|
13
|
+
//# sourceMappingURL=investigator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Investigator Agent — Kontroverse Themen, maximale Ehrlichkeit
|
|
3
|
+
*
|
|
4
|
+
* Untersucht heikle, kontroverse oder umstrittene Themen.
|
|
5
|
+
* Kein Mainstream-Papagei, kein Verschwoerungstheoretiker.
|
|
6
|
+
* Ziel: Evidenz-basierte Analyse BEIDER Seiten.
|
|
7
|
+
*
|
|
8
|
+
* MCP: mcp-research (SearXNG) + WebSearch/WebFetch (Anthropic Search)
|
|
9
|
+
* Evolution: Optimiert auf Objektivitaet + Tiefe + Quellenvielfalt
|
|
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: ['mcp-research'],
|
|
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 mcp-research (SearXNG) 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
|
|
@@ -0,0 +1 @@
|
|
|
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,cAAc,CAAC;IACrB,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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,104 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/cli/create.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAA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,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"}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evolve.js","sourceRoot":"","sources":["../../src/cli/evolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAAc;IAChD,MAAM,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC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AAQ,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;QAC5F,OAAO,CAAC,GAAG,CAAC,gBAAgB,KAAK,CAAC,SAAS,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/D,CAAC;IAED,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Darwin CLI — AI agents that improve themselves.
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* darwin run <agent> "task description"
|
|
7
|
+
* darwin evolve <agent> --enable
|
|
8
|
+
* darwin status [agent]
|
|
9
|
+
* darwin create <name>
|
|
10
|
+
* darwin init
|
|
11
|
+
*/
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;GASG"}
|