@kernel.chat/kbot 3.37.0 → 3.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +111 -7
- package/dist/agent-teams.d.ts +55 -0
- package/dist/agent-teams.d.ts.map +1 -0
- package/dist/agent-teams.js +135 -0
- package/dist/agent-teams.js.map +1 -0
- package/dist/autonomous-contributor.d.ts +88 -0
- package/dist/autonomous-contributor.d.ts.map +1 -0
- package/dist/autonomous-contributor.js +862 -0
- package/dist/autonomous-contributor.js.map +1 -0
- package/dist/collective-network.d.ts +102 -0
- package/dist/collective-network.d.ts.map +1 -0
- package/dist/collective-network.js +634 -0
- package/dist/collective-network.js.map +1 -0
- package/dist/community-autopilot.d.ts +98 -0
- package/dist/community-autopilot.d.ts.map +1 -0
- package/dist/community-autopilot.js +676 -0
- package/dist/community-autopilot.js.map +1 -0
- package/dist/cross-device-sync.d.ts +36 -0
- package/dist/cross-device-sync.d.ts.map +1 -0
- package/dist/cross-device-sync.js +532 -0
- package/dist/cross-device-sync.js.map +1 -0
- package/dist/forge-marketplace-server.d.ts +23 -0
- package/dist/forge-marketplace-server.d.ts.map +1 -0
- package/dist/forge-marketplace-server.js +457 -0
- package/dist/forge-marketplace-server.js.map +1 -0
- package/dist/hooks-integration.d.ts +89 -0
- package/dist/hooks-integration.d.ts.map +1 -0
- package/dist/hooks-integration.js +457 -0
- package/dist/hooks-integration.js.map +1 -0
- package/dist/plugin/index.d.ts +71 -0
- package/dist/plugin/index.d.ts.map +1 -0
- package/dist/plugin/index.js +133 -0
- package/dist/plugin/index.js.map +1 -0
- package/dist/voice-loop.d.ts +59 -0
- package/dist/voice-loop.d.ts.map +1 -0
- package/dist/voice-loop.js +525 -0
- package/dist/voice-loop.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
npm install -g @kernel.chat/kbot
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
**Self-defending AI agent.
|
|
22
|
+
**Self-defending AI agent. 384+ tools. 41 agents. 20 providers. Forges new tools at runtime. Built-in cybersecurity suite. $0 local AI. MIT licensed.**
|
|
23
23
|
|
|
24
24
|
> **New: [The Kernel Stack](./KERNEL_STACK.md)** — the architecture behind kbot + Claude Code. Agentic, self-improving, compound AI. Read the manifesto.
|
|
25
25
|
|
|
@@ -27,6 +27,18 @@ npm install -g @kernel.chat/kbot
|
|
|
27
27
|
|
|
28
28
|
## What's New
|
|
29
29
|
|
|
30
|
+
### v3.37 — Dream Mode, Meta-Agent, Claude Code Plugin, Voice Mode
|
|
31
|
+
|
|
32
|
+
| Feature | What it means |
|
|
33
|
+
|---------|---------------|
|
|
34
|
+
| **Dream Mode** | `kbot dream` — offline consolidation. kbot reviews recent sessions, extracts patterns, strengthens memory connections, and prunes stale knowledge. Like sleep for an AI agent. |
|
|
35
|
+
| **Meta-Agent** | Self-referential self-improvement inspired by HyperAgents ([arXiv 2603.19461](https://arxiv.org/abs/2603.19461)). A two-agent loop: task agents solve problems, the Meta-Agent watches performance and rewrites task agents to be better. Unlike HyperAgents (CC BY-NC-SA), kbot is MIT — the only self-improving agent framework companies can actually use. Run `kbot meta` to trigger a cycle. |
|
|
36
|
+
| **Claude Code Plugin** | kbot registers its 9 core specialists as Claude Code teammates via the Agent Teams integration. Delegate tasks to `coder`, `researcher`, `guardian`, etc. directly from Claude Code sessions. |
|
|
37
|
+
| **Voice Mode** | `kbot voice` — full voice loop with speech-to-text input and text-to-speech output. Hands-free agentic coding. Works with system TTS and Whisper STT. |
|
|
38
|
+
| **OpenClaw Integration** | [`@kernel.chat/kbot-openclaw`](https://www.npmjs.com/package/@kernel.chat/kbot-openclaw) — kbot as the brain for 50+ messaging channels. Discord, Slack, Telegram, WhatsApp, iMessage, email, and more. One agent, every platform. |
|
|
39
|
+
| **41 agents** | 15 new specialist and domain agents since v3.28, including meta-agent, dream agent, and expanded presets. |
|
|
40
|
+
| **384+ tools** | 34 new tools across finance, creative, build matrix, and meta-cognition categories. |
|
|
41
|
+
|
|
30
42
|
### v3.28 — Self-Defense System
|
|
31
43
|
|
|
32
44
|
kbot now protects its own integrity — and yours.
|
|
@@ -76,7 +88,7 @@ Other AI agents are static — fixed tools, single providers, no memory, no lear
|
|
|
76
88
|
- **20 providers, zero lock-in** — Claude, GPT, Gemini, Grok, DeepSeek, Groq, Mistral, and 13 more. Switch anytime.
|
|
77
89
|
- **Runs fully offline** — Embedded llama.cpp runs GGUF models directly. No Ollama needed. $0, fully private.
|
|
78
90
|
- **Learns your patterns** — Bayesian skill ratings + pattern extraction. Gets faster and smarter over time.
|
|
79
|
-
- **
|
|
91
|
+
- **41 specialist agents** — Say "fix the auth bug" and it routes to `coder`. Say "research JWT tokens" and it routes to `researcher`. Say "analyze BTC" and it routes to `trader`. Auto-routed with probabilistic confidence.
|
|
80
92
|
- **Crash-proof** — Checkpoints after every tool call. Resume interrupted sessions automatically.
|
|
81
93
|
- **Use as a library** — Clean SDK with typed exports. Build your own tools on top of kbot.
|
|
82
94
|
- **Works in your IDE** — Built-in MCP server for VS Code, Cursor, Zed, Neovim. ACP for JetBrains.
|
|
@@ -165,7 +177,7 @@ for await (const event of agent.stream("explain this code")) {
|
|
|
165
177
|
const files = await tools.execute('glob', { pattern: 'src/**/*.ts' })
|
|
166
178
|
console.log(files.result)
|
|
167
179
|
|
|
168
|
-
// List all
|
|
180
|
+
// List all 384+ tools
|
|
169
181
|
console.log(tools.list().map(t => t.name))
|
|
170
182
|
```
|
|
171
183
|
|
|
@@ -179,15 +191,16 @@ import { ResponseStream } from '@kernel.chat/kbot' // Stream
|
|
|
179
191
|
|
|
180
192
|
## Specialists
|
|
181
193
|
|
|
182
|
-
|
|
194
|
+
41 agents, auto-routed by Bayesian skill ratings, or pick one with `kbot --agent <name>`:
|
|
183
195
|
|
|
184
196
|
| | Agents |
|
|
185
197
|
|---|---|
|
|
186
198
|
| **Core** | kernel, researcher, coder, writer, analyst |
|
|
187
199
|
| **Extended** | aesthete, guardian, curator, strategist |
|
|
188
200
|
| **Domain** | infrastructure, quant, investigator, oracle, chronist, sage, communicator, adapter, trader |
|
|
189
|
-
| **System** | immune, forge |
|
|
201
|
+
| **System** | immune, forge, meta-agent, dream, codebase-guardian |
|
|
190
202
|
| **Presets** | hacker, operator, dreamer, creative, developer, gamedev, playtester |
|
|
203
|
+
| **Claude Code** | kernel, coder, researcher, writer, analyst, guardian, aesthete, curator, strategist (teammate integration) |
|
|
191
204
|
|
|
192
205
|
```bash
|
|
193
206
|
kbot --agent researcher "what papers cite Friston's Free Energy Principle?"
|
|
@@ -196,7 +209,7 @@ kbot --agent coder "refactor this into smaller functions"
|
|
|
196
209
|
kbot --agent trader "analyze BTC momentum and run a paper trade"
|
|
197
210
|
```
|
|
198
211
|
|
|
199
|
-
##
|
|
212
|
+
## 384+ Tools
|
|
200
213
|
|
|
201
214
|
| Category | Examples |
|
|
202
215
|
|----------|---------|
|
|
@@ -436,6 +449,97 @@ kbot's agent loop runs 11 always-on cognition modules based on peer-reviewed res
|
|
|
436
449
|
|
|
437
450
|
These aren't metaphors. They're TypeScript modules with paper citations in the headers. The interference between modules — not the modules themselves — is where intelligent behavior emerges. See the [research paper](../../docs/cognitive-module-interference.md).
|
|
438
451
|
|
|
452
|
+
## Dream Mode
|
|
453
|
+
|
|
454
|
+
```bash
|
|
455
|
+
kbot dream
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
Offline memory consolidation. When you run `kbot dream`, kbot reviews recent sessions, extracts recurring patterns, strengthens high-value memory connections, and prunes stale or contradictory knowledge. Think of it as sleep for an AI agent — the work that makes tomorrow's sessions faster and more accurate.
|
|
459
|
+
|
|
460
|
+
- **Pattern extraction** — identifies recurring tool sequences, user preferences, and project conventions
|
|
461
|
+
- **Memory pruning** — removes outdated facts and conflicting entries
|
|
462
|
+
- **Skill strengthening** — reinforces Bayesian skill ratings based on real outcomes
|
|
463
|
+
- **Knowledge synthesis** — connects isolated learnings into higher-level insights
|
|
464
|
+
- **Runs fully local** — no API calls, no data leaves your machine
|
|
465
|
+
|
|
466
|
+
## Meta-Agent
|
|
467
|
+
|
|
468
|
+
```bash
|
|
469
|
+
kbot meta
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
Self-referential self-improvement. Inspired by Meta's HyperAgents paper ([arXiv 2603.19461](https://arxiv.org/abs/2603.19461)), the Meta-Agent implements a two-agent architecture:
|
|
473
|
+
|
|
474
|
+
1. **Task agents** solve problems (the 41 specialists you already use)
|
|
475
|
+
2. **The Meta-Agent** observes their performance, identifies weaknesses, and improves them
|
|
476
|
+
|
|
477
|
+
The improvement loop runs automatically:
|
|
478
|
+
- **Observe** — records success/failure, duration, cost, and tool usage for every task
|
|
479
|
+
- **Analyze** — builds performance profiles per agent, identifies failure patterns
|
|
480
|
+
- **Propose** — generates targeted improvements (prompt rewrites, tool pre-selection, routing changes)
|
|
481
|
+
- **Apply** — auto-applies low-risk improvements (routing, tool selection); flags high-risk ones for review
|
|
482
|
+
- **Measure** — compares before/after performance and reverts regressions
|
|
483
|
+
|
|
484
|
+
Unlike HyperAgents (CC BY-NC-SA, non-commercial license), kbot is MIT — the only self-improving agent framework that companies can actually deploy in production.
|
|
485
|
+
|
|
486
|
+
```bash
|
|
487
|
+
kbot meta # Run one improvement cycle
|
|
488
|
+
kbot meta stats # View cycle count, observations, active improvements
|
|
489
|
+
kbot meta history # Review all past improvements
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
## Claude Code Plugin
|
|
493
|
+
|
|
494
|
+
kbot integrates directly with Claude Code as a teammate provider. Register kbot's specialists so Claude Code can delegate tasks to the right expert:
|
|
495
|
+
|
|
496
|
+
```typescript
|
|
497
|
+
import { registerTeammates, delegateToTeammate } from '@kernel.chat/kbot'
|
|
498
|
+
|
|
499
|
+
// Get teammate definitions for all 9 core specialists
|
|
500
|
+
const teammates = registerTeammates()
|
|
501
|
+
// → [{ name: 'kernel', model: 'sonnet', ... }, { name: 'coder', ... }, ...]
|
|
502
|
+
|
|
503
|
+
// Delegate a task to a specific specialist
|
|
504
|
+
const result = await delegateToTeammate('guardian', 'audit src/auth.ts for security issues')
|
|
505
|
+
console.log(result.content) // security analysis
|
|
506
|
+
console.log(result.toolCalls) // tools used (dep_audit, secret_scan, etc.)
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
Each teammate definition includes:
|
|
510
|
+
- **name** — agent identifier (`kernel`, `coder`, `researcher`, `writer`, `analyst`, `guardian`, `aesthete`, `curator`, `strategist`)
|
|
511
|
+
- **model** — `opus` for complex reasoning agents (analyst, strategist, guardian, researcher), `sonnet` for fast agents
|
|
512
|
+
- **initialPrompt** — the specialist's full system prompt
|
|
513
|
+
- **tools** — preferred tool list for the specialist's domain
|
|
514
|
+
|
|
515
|
+
## Voice Mode
|
|
516
|
+
|
|
517
|
+
```bash
|
|
518
|
+
kbot voice
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
Full voice loop — speak your tasks, hear the results. Voice mode chains speech-to-text input with text-to-speech output for hands-free agentic coding:
|
|
522
|
+
|
|
523
|
+
- **STT** — Whisper-based transcription (local or API)
|
|
524
|
+
- **TTS** — System speech synthesis (macOS `say`, Linux `espeak`, or cloud TTS)
|
|
525
|
+
- **Continuous** — voice loop stays open between turns, no re-activation needed
|
|
526
|
+
- **Tool narration** — kbot announces tool calls and results as it works
|
|
527
|
+
|
|
528
|
+
## OpenClaw Integration
|
|
529
|
+
|
|
530
|
+
```bash
|
|
531
|
+
npm install @kernel.chat/kbot-openclaw
|
|
532
|
+
```
|
|
533
|
+
|
|
534
|
+
kbot as the brain for 50+ messaging channels. OpenClaw bridges kbot's agent loop to Discord, Slack, Telegram, WhatsApp, iMessage, email, Matrix, and more — one agent, every platform.
|
|
535
|
+
|
|
536
|
+
- **Channel-agnostic** — same agent logic regardless of input source
|
|
537
|
+
- **Per-channel memory** — separate conversation contexts per channel/user
|
|
538
|
+
- **Rate limiting** — configurable per-platform rate limits
|
|
539
|
+
- **Media handling** — images, files, and voice messages routed through kbot's multimodal pipeline
|
|
540
|
+
|
|
541
|
+
See [`@kernel.chat/kbot-openclaw`](https://www.npmjs.com/package/@kernel.chat/kbot-openclaw) on npm.
|
|
542
|
+
|
|
439
543
|
## Security
|
|
440
544
|
|
|
441
545
|
kbot has two layers of security: protecting **your projects** and protecting **itself**.
|
|
@@ -514,7 +618,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, adding tools, and
|
|
|
514
618
|
</details>
|
|
515
619
|
|
|
516
620
|
<details>
|
|
517
|
-
<summary><strong>Agent Routing</strong> —
|
|
621
|
+
<summary><strong>Agent Routing</strong> — 41 specialists, auto-routed by intent</summary>
|
|
518
622
|
<img src="../../tools/video-assets/demo-agents.gif" alt="kbot agent routing" width="700">
|
|
519
623
|
</details>
|
|
520
624
|
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export interface TeammateDefinition {
|
|
2
|
+
/** Agent identifier */
|
|
3
|
+
name: string;
|
|
4
|
+
/** What this specialist focuses on */
|
|
5
|
+
description: string;
|
|
6
|
+
/** Model tier: 'sonnet' for fast agents, 'opus' for complex reasoning */
|
|
7
|
+
model: 'sonnet' | 'opus';
|
|
8
|
+
/** System prompt that defines the specialist's behavior */
|
|
9
|
+
initialPrompt: string;
|
|
10
|
+
/** Preferred tools for this specialist */
|
|
11
|
+
tools: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface DelegationResult {
|
|
14
|
+
/** The response content from the teammate */
|
|
15
|
+
content: string;
|
|
16
|
+
/** Which agent handled the task */
|
|
17
|
+
agent: string;
|
|
18
|
+
/** Model used */
|
|
19
|
+
model: string;
|
|
20
|
+
/** Number of tool calls made */
|
|
21
|
+
toolCalls: number;
|
|
22
|
+
/** Token usage, if available */
|
|
23
|
+
usage?: {
|
|
24
|
+
input_tokens: number;
|
|
25
|
+
output_tokens: number;
|
|
26
|
+
cost_usd: number;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Register kbot specialists as Claude Code teammates.
|
|
31
|
+
*
|
|
32
|
+
* Returns an array of teammate definitions — one for each of kbot's
|
|
33
|
+
* core and extended specialist agents (9 total).
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* const teammates = registerTeammates()
|
|
37
|
+
* // teammates[0] = { name: 'kernel', model: 'sonnet', ... }
|
|
38
|
+
*/
|
|
39
|
+
export declare function registerTeammates(): TeammateDefinition[];
|
|
40
|
+
/**
|
|
41
|
+
* Delegate a task to a specific kbot teammate by name.
|
|
42
|
+
*
|
|
43
|
+
* Routes the task through kbot's full agent loop (think -> plan -> execute -> learn)
|
|
44
|
+
* using a silent UI adapter so output is captured, not printed.
|
|
45
|
+
*
|
|
46
|
+
* @param name - The teammate/specialist ID (e.g. 'coder', 'researcher')
|
|
47
|
+
* @param task - The task description or prompt to execute
|
|
48
|
+
* @returns The delegation result with content, agent info, and usage stats
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* const result = await delegateToTeammate('coder', 'add input validation to auth.ts')
|
|
52
|
+
* console.log(result.content)
|
|
53
|
+
*/
|
|
54
|
+
export declare function delegateToTeammate(name: string, task: string): Promise<DelegationResult>;
|
|
55
|
+
//# sourceMappingURL=agent-teams.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-teams.d.ts","sourceRoot":"","sources":["../src/agent-teams.ts"],"names":[],"mappings":"AAiBA,MAAM,WAAW,kBAAkB;IACjC,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,sCAAsC;IACtC,WAAW,EAAE,MAAM,CAAA;IACnB,yEAAyE;IACzE,KAAK,EAAE,QAAQ,GAAG,MAAM,CAAA;IACxB,2DAA2D;IAC3D,aAAa,EAAE,MAAM,CAAA;IACrB,0CAA0C;IAC1C,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAA;IACf,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,gCAAgC;IAChC,SAAS,EAAE,MAAM,CAAA;IACjB,gCAAgC;IAChC,KAAK,CAAC,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;CAC1E;AAgED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,IAAI,kBAAkB,EAAE,CAoBxD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,gBAAgB,CAAC,CA2B3B"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
// kbot Agent Teams — Claude Code Teammate Integration
|
|
2
|
+
//
|
|
3
|
+
// Registers kbot's specialist agents as Claude Code teammates so they
|
|
4
|
+
// can be invoked collaboratively within a Claude Code session.
|
|
5
|
+
//
|
|
6
|
+
// Usage:
|
|
7
|
+
// import { registerTeammates, delegateToTeammate } from './agent-teams.js'
|
|
8
|
+
//
|
|
9
|
+
// const teammates = registerTeammates()
|
|
10
|
+
// const result = await delegateToTeammate('coder', 'refactor auth.ts into smaller functions')
|
|
11
|
+
import { SPECIALISTS } from './agents/specialists.js';
|
|
12
|
+
import { runAgent } from './agent.js';
|
|
13
|
+
import { SilentUIAdapter } from './ui-adapter.js';
|
|
14
|
+
// ── Teammate tool mappings ──────────────────────────────────────────────────
|
|
15
|
+
const TOOL_PREFERENCES = {
|
|
16
|
+
kernel: [
|
|
17
|
+
'read_file', 'write_file', 'glob', 'grep', 'bash',
|
|
18
|
+
'web_search', 'memory_save', 'memory_search',
|
|
19
|
+
],
|
|
20
|
+
coder: [
|
|
21
|
+
'read_file', 'write_file', 'edit_file', 'glob', 'grep', 'bash',
|
|
22
|
+
'git_status', 'git_diff', 'git_commit', 'lint', 'test_runner',
|
|
23
|
+
'type_check', 'format_code',
|
|
24
|
+
],
|
|
25
|
+
researcher: [
|
|
26
|
+
'web_search', 'url_fetch', 'read_file', 'grep', 'glob',
|
|
27
|
+
'arxiv_search', 'semantic_scholar', 'memory_save',
|
|
28
|
+
],
|
|
29
|
+
writer: [
|
|
30
|
+
'read_file', 'write_file', 'edit_file', 'glob', 'grep',
|
|
31
|
+
'web_search', 'url_fetch',
|
|
32
|
+
],
|
|
33
|
+
analyst: [
|
|
34
|
+
'read_file', 'glob', 'grep', 'bash', 'web_search',
|
|
35
|
+
'url_fetch', 'csv_read', 'csv_query',
|
|
36
|
+
],
|
|
37
|
+
guardian: [
|
|
38
|
+
'read_file', 'glob', 'grep', 'bash', 'dep_audit',
|
|
39
|
+
'secret_scan', 'ssl_check', 'headers_check', 'cve_lookup',
|
|
40
|
+
'port_scan', 'owasp_check',
|
|
41
|
+
],
|
|
42
|
+
aesthete: [
|
|
43
|
+
'read_file', 'write_file', 'edit_file', 'glob', 'grep',
|
|
44
|
+
'bash', 'design_variants',
|
|
45
|
+
],
|
|
46
|
+
curator: [
|
|
47
|
+
'read_file', 'write_file', 'edit_file', 'glob', 'grep',
|
|
48
|
+
'memory_save', 'memory_search', 'web_search',
|
|
49
|
+
],
|
|
50
|
+
strategist: [
|
|
51
|
+
'read_file', 'glob', 'grep', 'web_search', 'url_fetch',
|
|
52
|
+
'bash', 'csv_read', 'csv_query',
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
// Agents that benefit from complex reasoning get opus; others use sonnet for speed
|
|
56
|
+
const OPUS_AGENTS = new Set(['analyst', 'strategist', 'guardian', 'researcher']);
|
|
57
|
+
// ── Teammate descriptions ───────────────────────────────────────────────────
|
|
58
|
+
const DESCRIPTIONS = {
|
|
59
|
+
kernel: 'General-purpose assistant — handles conversation, coordination, and tasks that span multiple domains.',
|
|
60
|
+
coder: 'Programming specialist — writes, reviews, refactors, and debugs production-quality code across all major languages.',
|
|
61
|
+
researcher: 'Research specialist — finds, verifies, and synthesizes information from web, papers, and codebases.',
|
|
62
|
+
writer: 'Content specialist — writes docs, blog posts, changelogs, emails, and social media with appropriate tone and structure.',
|
|
63
|
+
analyst: 'Strategy & evaluation specialist — breaks down complex decisions with data-driven analysis and frameworks.',
|
|
64
|
+
guardian: 'Security specialist — audits code, scans dependencies, checks for vulnerabilities, and hardens systems.',
|
|
65
|
+
aesthete: 'Design specialist — evaluates and creates UI/UX, enforces design systems, and ensures accessibility.',
|
|
66
|
+
curator: 'Knowledge management specialist — organizes documentation, maintains knowledge bases, and fills information gaps.',
|
|
67
|
+
strategist: 'Business strategy specialist — connects technical decisions to business outcomes, builds roadmaps, and analyzes competitors.',
|
|
68
|
+
};
|
|
69
|
+
// ── Core API ────────────────────────────────────────────────────────────────
|
|
70
|
+
/**
|
|
71
|
+
* Register kbot specialists as Claude Code teammates.
|
|
72
|
+
*
|
|
73
|
+
* Returns an array of teammate definitions — one for each of kbot's
|
|
74
|
+
* core and extended specialist agents (9 total).
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* const teammates = registerTeammates()
|
|
78
|
+
* // teammates[0] = { name: 'kernel', model: 'sonnet', ... }
|
|
79
|
+
*/
|
|
80
|
+
export function registerTeammates() {
|
|
81
|
+
const teammateIds = [
|
|
82
|
+
'kernel', 'coder', 'researcher', 'writer', 'analyst',
|
|
83
|
+
'guardian', 'aesthete', 'curator', 'strategist',
|
|
84
|
+
];
|
|
85
|
+
return teammateIds.map((id) => {
|
|
86
|
+
const specialist = SPECIALISTS[id];
|
|
87
|
+
if (!specialist) {
|
|
88
|
+
throw new Error(`Specialist "${id}" not found in SPECIALISTS registry.`);
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
name: id,
|
|
92
|
+
description: DESCRIPTIONS[id] ?? specialist.name,
|
|
93
|
+
model: OPUS_AGENTS.has(id) ? 'opus' : 'sonnet',
|
|
94
|
+
initialPrompt: specialist.prompt,
|
|
95
|
+
tools: TOOL_PREFERENCES[id] ?? TOOL_PREFERENCES.kernel,
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Delegate a task to a specific kbot teammate by name.
|
|
101
|
+
*
|
|
102
|
+
* Routes the task through kbot's full agent loop (think -> plan -> execute -> learn)
|
|
103
|
+
* using a silent UI adapter so output is captured, not printed.
|
|
104
|
+
*
|
|
105
|
+
* @param name - The teammate/specialist ID (e.g. 'coder', 'researcher')
|
|
106
|
+
* @param task - The task description or prompt to execute
|
|
107
|
+
* @returns The delegation result with content, agent info, and usage stats
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* const result = await delegateToTeammate('coder', 'add input validation to auth.ts')
|
|
111
|
+
* console.log(result.content)
|
|
112
|
+
*/
|
|
113
|
+
export async function delegateToTeammate(name, task) {
|
|
114
|
+
// Validate the teammate exists
|
|
115
|
+
const specialist = SPECIALISTS[name];
|
|
116
|
+
if (!specialist) {
|
|
117
|
+
const available = Object.keys(SPECIALISTS).join(', ');
|
|
118
|
+
throw new Error(`Unknown teammate "${name}". Available: ${available}`);
|
|
119
|
+
}
|
|
120
|
+
const ui = new SilentUIAdapter();
|
|
121
|
+
const options = {
|
|
122
|
+
agent: name,
|
|
123
|
+
stream: false,
|
|
124
|
+
ui,
|
|
125
|
+
};
|
|
126
|
+
const response = await runAgent(task, options);
|
|
127
|
+
return {
|
|
128
|
+
content: response.content ?? ui.content ?? '',
|
|
129
|
+
agent: response.agent ?? name,
|
|
130
|
+
model: response.model ?? '',
|
|
131
|
+
toolCalls: response.toolCalls ?? 0,
|
|
132
|
+
usage: response.usage,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=agent-teams.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-teams.js","sourceRoot":"","sources":["../src/agent-teams.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,EAAE;AACF,sEAAsE;AACtE,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C,CAAC,CAAC,MAAe,CAAC,CAAC,CAAC,QAAiB;YAChE,aAAa,EAAE,UAAU,CAAC,MAAM;YAChC,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,IAAI,gBAAgB,CAAC,MAAM;SACvD,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,IAAY,EACZ,IAAY;IAEZ,+BAA+B;IAC/B,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,CAAA;IACpC,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACrD,MAAM,IAAI,KAAK,CACb,qBAAqB,IAAI,iBAAiB,SAAS,EAAE,CACtD,CAAA;IACH,CAAC;IAED,MAAM,EAAE,GAAG,IAAI,eAAe,EAAE,CAAA;IAEhC,MAAM,OAAO,GAAiB;QAC5B,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,KAAK;QACb,EAAE;KACH,CAAA;IAED,MAAM,QAAQ,GAAkB,MAAM,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAE7D,OAAO;QACL,OAAO,EAAE,QAAQ,CAAC,OAAO,IAAK,EAAU,CAAC,OAAO,IAAI,EAAE;QACtD,KAAK,EAAE,QAAQ,CAAC,KAAK,IAAI,IAAI;QAC7B,KAAK,EAAE,QAAQ,CAAC,KAAK,IAAI,EAAE;QAC3B,SAAS,EAAE,QAAQ,CAAC,SAAS,IAAI,CAAC;QAClC,KAAK,EAAE,QAAQ,CAAC,KAAK;KACtB,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export type FindingSeverity = 'info' | 'warn' | 'critical';
|
|
2
|
+
export type FindingCategory = 'todo-removal' | 'typo' | 'missing-type' | 'dead-code' | 'complexity' | 'duplicate-pattern' | 'missing-docs' | 'dependency-issue' | 'style-inconsistency' | 'other';
|
|
3
|
+
export interface ContributorFinding {
|
|
4
|
+
category: FindingCategory;
|
|
5
|
+
severity: FindingSeverity;
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
file: string;
|
|
9
|
+
line?: number;
|
|
10
|
+
/** The original code snippet */
|
|
11
|
+
original?: string;
|
|
12
|
+
/** Whether this is a simple, auto-fixable issue */
|
|
13
|
+
isSimpleFix: boolean;
|
|
14
|
+
}
|
|
15
|
+
export interface ProposedFix {
|
|
16
|
+
finding: ContributorFinding;
|
|
17
|
+
description: string;
|
|
18
|
+
/** The diff-like description of the change */
|
|
19
|
+
changeSummary: string;
|
|
20
|
+
/** Estimated review time in minutes */
|
|
21
|
+
estimatedReviewMinutes: number;
|
|
22
|
+
}
|
|
23
|
+
export interface ContributionReport {
|
|
24
|
+
repo: string;
|
|
25
|
+
clonedAt: string;
|
|
26
|
+
analyzedAt: string;
|
|
27
|
+
/** Detected primary language */
|
|
28
|
+
language: string;
|
|
29
|
+
/** Detected framework (if any) */
|
|
30
|
+
framework: string;
|
|
31
|
+
/** Total files scanned */
|
|
32
|
+
filesScanned: number;
|
|
33
|
+
findings: ContributorFinding[];
|
|
34
|
+
proposed_fixes: ProposedFix[];
|
|
35
|
+
estimated_impact: {
|
|
36
|
+
totalFindings: number;
|
|
37
|
+
simpleFixes: number;
|
|
38
|
+
complexFindings: number;
|
|
39
|
+
categories: Record<string, number>;
|
|
40
|
+
};
|
|
41
|
+
/** Bootstrap-style project health summary */
|
|
42
|
+
projectHealth: {
|
|
43
|
+
hasReadme: boolean;
|
|
44
|
+
hasLicense: boolean;
|
|
45
|
+
hasTests: boolean;
|
|
46
|
+
hasCI: boolean;
|
|
47
|
+
hasContributing: boolean;
|
|
48
|
+
hasTypeConfig: boolean;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export interface ContributorOptions {
|
|
52
|
+
/** Maximum files to scan (default: 500) */
|
|
53
|
+
maxFiles?: number;
|
|
54
|
+
/** Minimum severity to include (default: 'info') */
|
|
55
|
+
minSeverity?: FindingSeverity;
|
|
56
|
+
/** Skip cloning if a local path is provided */
|
|
57
|
+
localPath?: string;
|
|
58
|
+
/** Keep the cloned repo after analysis (default: false) */
|
|
59
|
+
keepClone?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export interface GoodFirstIssue {
|
|
62
|
+
number: number;
|
|
63
|
+
title: string;
|
|
64
|
+
url: string;
|
|
65
|
+
labels: string[];
|
|
66
|
+
created_at: string;
|
|
67
|
+
author: string;
|
|
68
|
+
comments: number;
|
|
69
|
+
body_preview: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Point at any GitHub repo, clone it, analyze it, and generate a contribution
|
|
73
|
+
* report with findings and proposed fixes.
|
|
74
|
+
*
|
|
75
|
+
* v1 is analysis-only — no automatic PR creation. The report gives you
|
|
76
|
+
* everything needed to make targeted contributions.
|
|
77
|
+
*/
|
|
78
|
+
export declare function runAutonomousContributor(repoUrl: string, options?: ContributorOptions): Promise<ContributionReport>;
|
|
79
|
+
/**
|
|
80
|
+
* Fetch open issues labeled "good first issue" or "help wanted" from a GitHub repo.
|
|
81
|
+
* Uses the public GitHub API (no auth required for public repos).
|
|
82
|
+
*/
|
|
83
|
+
export declare function listGoodFirstIssues(repoUrl: string): Promise<GoodFirstIssue[]>;
|
|
84
|
+
/**
|
|
85
|
+
* Format a ContributionReport as a readable markdown string.
|
|
86
|
+
*/
|
|
87
|
+
export declare function formatContributionReport(report: ContributionReport): string;
|
|
88
|
+
//# sourceMappingURL=autonomous-contributor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autonomous-contributor.d.ts","sourceRoot":"","sources":["../src/autonomous-contributor.ts"],"names":[],"mappings":"AAkBA,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CAAA;AAC1D,MAAM,MAAM,eAAe,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