@kernel.chat/kbot 3.66.0 → 3.68.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 +26 -5
- package/dist/agent.js +13 -1
- package/dist/buddy.d.ts +77 -2
- package/dist/buddy.js +631 -6
- package/dist/cli.js +119 -1
- package/dist/dream.js +13 -0
- package/dist/tools/behavior-tools.d.ts +2 -0
- package/dist/tools/behavior-tools.js +63 -0
- package/dist/tools/buddy-tools.js +47 -4
- package/dist/tools/index.js +2 -0
- package/dist/tools/watchdog.d.ts +32 -0
- package/dist/tools/watchdog.js +356 -0
- package/dist/user-behavior.d.ts +65 -0
- package/dist/user-behavior.js +301 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
4
|
<strong>kbot</strong><br>
|
|
5
|
-
Open-source terminal AI agent.
|
|
5
|
+
Open-source terminal AI agent. 693+ tools. 35 agents. 20 providers. Dreams, learns, watches your system. $0 local.
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
@@ -30,7 +30,7 @@ Most terminal AI agents lock you into one provider, one model, one way of workin
|
|
|
30
30
|
- **Runs fully offline** — Embedded llama.cpp, Ollama, LM Studio, or Jan. $0, fully private.
|
|
31
31
|
- **Learns your patterns** — Bayesian skill ratings + pattern extraction. Gets faster over time.
|
|
32
32
|
- **35 specialist agents** — auto-routes your request to the right expert (coder, researcher, writer, guardian, quant, and 30 more).
|
|
33
|
-
- **
|
|
33
|
+
- **693+ tools** — files, bash, git, GitHub, web search, deploy, database, game dev, VFX, research, science, finance, security, and more.
|
|
34
34
|
- **Programmatic SDK** — use kbot as a library in your own apps.
|
|
35
35
|
- **MCP server built in** — plug kbot into Claude Code, Cursor, VS Code, Zed, or Neovim as a tool provider.
|
|
36
36
|
|
|
@@ -47,7 +47,23 @@ kbot dream journal # Full insight history
|
|
|
47
47
|
kbot dream search # Find specific memories
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
7-tier memory: pattern cache -> solution index -> user profile -> dream journal -> passive scanner -> music production -> desktop behavior. All tiers feed each other bidirectionally through the dream engine. Dream insights automatically evolve kbot's prompts so it gets better at being *your* specific tool.
|
|
51
|
+
|
|
52
|
+
### Always-On System Manager
|
|
53
|
+
|
|
54
|
+
kbot runs 24/7 in the background, managing your entire development environment:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
kbot watchdog # Service dashboard — CPU, RAM, disk, all services
|
|
58
|
+
kbot wd --restart email # Restart a crashed service
|
|
59
|
+
kbot dream status # What kbot learned about you
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
- **Service watchdog** — health-checks all background services, auto-restarts crashes
|
|
63
|
+
- **Morning briefing** — daily email with downloads, stars, emails, dream insights, service health
|
|
64
|
+
- **Behavior learning** — observes which apps you use and when, dreams about your workflow patterns
|
|
65
|
+
- **Companion memory** — email agent remembers every user's preferences, goals, and conversation history
|
|
66
|
+
- **Proactive follow-ups** — checks in with users who go quiet, referencing their specific context
|
|
51
67
|
|
|
52
68
|
### Audit Any Repo in One Command
|
|
53
69
|
|
|
@@ -65,9 +81,12 @@ Checks security, documentation, code quality, CI/CD, community health, and DevOp
|
|
|
65
81
|
|---|---|---|---|---|---|
|
|
66
82
|
| AI providers | 20 | 1 | 1 | 6 | 75+ |
|
|
67
83
|
| Specialist agents | 35 | 0 | 0 | 0 | 0 |
|
|
68
|
-
| Built-in tools |
|
|
84
|
+
| Built-in tools | 693+ | ~20 | ~15 | ~10 | ~15 |
|
|
69
85
|
| Science tools | 114 | 0 | 0 | 0 | 0 |
|
|
70
|
-
|
|
|
86
|
+
| Memory system | 7-tier bidirectional | File-based | No | No | No |
|
|
87
|
+
| Dream engine | Yes ($0 local) | Cloud API | No | No | No |
|
|
88
|
+
| Service watchdog | Yes | No | No | No | No |
|
|
89
|
+
| Behavior learning | Yes | No | No | No | No |
|
|
71
90
|
| Offline mode | Embedded + Ollama | No | No | Ollama | Ollama |
|
|
72
91
|
| SDK | Yes | No | Yes | No | No |
|
|
73
92
|
| MCP server | Yes | N/A | No | No | No |
|
|
@@ -248,6 +267,8 @@ Works with Claude Code, Cursor, VS Code, Windsurf, Zed, Neovim.
|
|
|
248
267
|
| `kbot dream status` | See what kbot has learned about you |
|
|
249
268
|
| `kbot dream journal` | Full insight history |
|
|
250
269
|
| `kbot dream search` | Find specific memories |
|
|
270
|
+
| `kbot watchdog` | System dashboard — services, CPU, RAM, disk, Ollama, dreams |
|
|
271
|
+
| `kbot wd --restart <svc>` | Restart a crashed background service |
|
|
251
272
|
| `kbot contribute <repo>` | Find good-first-issues and quick wins |
|
|
252
273
|
| `kbot share` | Share conversation as GitHub Gist |
|
|
253
274
|
| `kbot pair` | File watcher with auto-analysis |
|
package/dist/agent.js
CHANGED
|
@@ -17,8 +17,9 @@ import { getMatrixSystemPrompt } from './matrix.js';
|
|
|
17
17
|
import { buildFullLearningContext, findPattern, recordPattern, cacheSolution, updateProfile, classifyTask, extractKeywords, learnFromExchange, updateProjectMemory, shouldAutoTrain, selfTrain, } from './learning.js';
|
|
18
18
|
import { getMemoryPrompt, addTurn, getPreviousMessages, getHistory } from './memory.js';
|
|
19
19
|
import { getDreamPrompt, dreamAfterSession } from './dream.js';
|
|
20
|
-
import { setBuddyMood } from './buddy.js';
|
|
20
|
+
import { setBuddyMood, addBuddyXP, checkAchievements, formatAchievementUnlock } from './buddy.js';
|
|
21
21
|
import { notifyTurn, startMemoryScanner, stopMemoryScanner } from './memory-scanner.js';
|
|
22
|
+
import { captureUserBehavior } from './user-behavior.js';
|
|
22
23
|
import { autoCompact, compressToolResult } from './context-manager.js';
|
|
23
24
|
import { learnedRoute, recordRoute } from './learned-router.js';
|
|
24
25
|
import { buildCacheablePrompt, createPromptSections } from './prompt-cache.js';
|
|
@@ -1007,6 +1008,9 @@ Always quote file paths that contain spaces. Never reference internal system nam
|
|
|
1007
1008
|
setBuddyMood('thinking');
|
|
1008
1009
|
// Start passive memory scanner for this session
|
|
1009
1010
|
startMemoryScanner();
|
|
1011
|
+
// Capture a behavior snapshot (what apps are open, active window, etc.)
|
|
1012
|
+
// Non-blocking, macOS only, purely local storage
|
|
1013
|
+
captureUserBehavior();
|
|
1010
1014
|
// ── Gödel limits: detect undecidable loops and hand off to human ──
|
|
1011
1015
|
const loopDetector = new LoopDetector({
|
|
1012
1016
|
maxToolRepeats: 5,
|
|
@@ -1623,6 +1627,14 @@ Always quote file paths that contain spaces. Never reference internal system nam
|
|
|
1623
1627
|
// ── Dream Engine: consolidate session memories (non-blocking, $0 via Ollama) ──
|
|
1624
1628
|
setBuddyMood('learning');
|
|
1625
1629
|
dreamAfterSession(sessionId);
|
|
1630
|
+
// ── Buddy Evolution: award XP for completing a session ──
|
|
1631
|
+
addBuddyXP(1);
|
|
1632
|
+
// ── Achievements: check for newly unlocked milestones ──
|
|
1633
|
+
const newAchievements = checkAchievements();
|
|
1634
|
+
for (const achievement of newAchievements) {
|
|
1635
|
+
// Print to stderr so it doesn't interfere with piped output
|
|
1636
|
+
process.stderr.write('\n' + formatAchievementUnlock(achievement) + '\n\n');
|
|
1637
|
+
}
|
|
1626
1638
|
// Session complete — buddy returns to idle
|
|
1627
1639
|
setBuddyMood('idle');
|
|
1628
1640
|
const content = lastResponse?.content || 'Reached maximum tool iterations.';
|
package/dist/buddy.d.ts
CHANGED
|
@@ -1,20 +1,86 @@
|
|
|
1
1
|
export type BuddySpecies = 'fox' | 'owl' | 'cat' | 'robot' | 'ghost' | 'mushroom' | 'octopus' | 'dragon';
|
|
2
2
|
export type BuddyMood = 'idle' | 'thinking' | 'success' | 'error' | 'learning';
|
|
3
|
+
export type BuddyLevel = 0 | 1 | 2 | 3;
|
|
4
|
+
export interface BuddyEvolution {
|
|
5
|
+
level: BuddyLevel;
|
|
6
|
+
xp: number;
|
|
7
|
+
evolvedAt: string[];
|
|
8
|
+
}
|
|
3
9
|
export interface BuddyState {
|
|
4
10
|
species: BuddySpecies;
|
|
5
11
|
name: string;
|
|
6
12
|
mood: BuddyMood;
|
|
13
|
+
evolution: BuddyEvolution;
|
|
14
|
+
}
|
|
15
|
+
export interface BuddyLevelInfo {
|
|
16
|
+
level: BuddyLevel;
|
|
17
|
+
xp: number;
|
|
18
|
+
xpToNext: number | null;
|
|
19
|
+
title: string;
|
|
20
|
+
}
|
|
21
|
+
export interface Achievement {
|
|
22
|
+
/** Unique achievement ID */
|
|
23
|
+
id: string;
|
|
24
|
+
/** Display name */
|
|
25
|
+
name: string;
|
|
26
|
+
/** Description of what the user did */
|
|
27
|
+
description: string;
|
|
28
|
+
/** Single ASCII char icon (trophy, star, bolt, etc.) */
|
|
29
|
+
icon: string;
|
|
30
|
+
/** ISO timestamp when unlocked, null if locked */
|
|
31
|
+
unlockedAt: string | null;
|
|
7
32
|
}
|
|
8
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Check all achievement conditions and unlock any newly earned.
|
|
35
|
+
* Returns the list of newly unlocked achievements (empty if none).
|
|
36
|
+
* Call this at session end in agent.ts.
|
|
37
|
+
*/
|
|
38
|
+
export declare function checkAchievements(): Achievement[];
|
|
39
|
+
/**
|
|
40
|
+
* Get all achievements with their unlock status.
|
|
41
|
+
* Unlocked ones include the timestamp; locked ones show null.
|
|
42
|
+
*/
|
|
43
|
+
export declare function getAchievements(): Achievement[];
|
|
44
|
+
/**
|
|
45
|
+
* Get a progress hint for a locked achievement.
|
|
46
|
+
* Returns null if the achievement is unlocked or not found.
|
|
47
|
+
*/
|
|
48
|
+
export declare function getAchievementProgress(achievementId: string): string | null;
|
|
49
|
+
/**
|
|
50
|
+
* Format achievement unlock notification for terminal display.
|
|
51
|
+
* Shows the buddy sprite in success mood with a celebration message.
|
|
52
|
+
*/
|
|
53
|
+
export declare function formatAchievementUnlock(achievement: Achievement): string;
|
|
54
|
+
/** Get the buddy's current state (species, name, mood, evolution) */
|
|
9
55
|
export declare function getBuddy(): BuddyState;
|
|
10
56
|
/** Set the buddy's mood */
|
|
11
57
|
export declare function setBuddyMood(mood: BuddyMood): void;
|
|
12
|
-
/** Get the ASCII sprite for the buddy in the given mood (defaults to current)
|
|
58
|
+
/** Get the ASCII sprite for the buddy in the given mood (defaults to current).
|
|
59
|
+
* Applies evolution visual upgrades based on the buddy's current level. */
|
|
13
60
|
export declare function getBuddySprite(mood?: BuddyMood): string[];
|
|
14
61
|
/** Get a random greeting for the buddy */
|
|
15
62
|
export declare function getBuddyGreeting(): string;
|
|
16
63
|
/** Rename the buddy (persisted to ~/.kbot/buddy.json) */
|
|
17
64
|
export declare function renameBuddy(newName: string): void;
|
|
65
|
+
/**
|
|
66
|
+
* Add XP to the buddy. Checks for level-ups and persists to buddy.json.
|
|
67
|
+
* Returns the updated level info, and whether a level-up just occurred.
|
|
68
|
+
*
|
|
69
|
+
* XP sources:
|
|
70
|
+
* - Session complete: +1
|
|
71
|
+
* - Dream cycle: +2
|
|
72
|
+
* - Tool creation: +3
|
|
73
|
+
* - First error fix: +1
|
|
74
|
+
*/
|
|
75
|
+
export declare function addBuddyXP(amount: number): {
|
|
76
|
+
levelInfo: BuddyLevelInfo;
|
|
77
|
+
leveledUp: boolean;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Get the buddy's current level info without modifying state.
|
|
81
|
+
* Includes level, XP, XP to next level, and species-specific title.
|
|
82
|
+
*/
|
|
83
|
+
export declare function getBuddyLevel(): BuddyLevelInfo;
|
|
18
84
|
/**
|
|
19
85
|
* Format the buddy with a speech bubble and status message.
|
|
20
86
|
* Returns a multi-line string ready for terminal output.
|
|
@@ -30,4 +96,13 @@ export declare function renameBuddy(newName: string): void;
|
|
|
30
96
|
* ~ Patch the fox ~
|
|
31
97
|
*/
|
|
32
98
|
export declare function formatBuddyStatus(message?: string): string;
|
|
99
|
+
/**
|
|
100
|
+
* Get a dream narration for the buddy to tell the user at startup.
|
|
101
|
+
*
|
|
102
|
+
* Picks the highest-relevance insight that was reinforced in the last 24 hours
|
|
103
|
+
* and hasn't already been narrated. Returns `null` if there's nothing new to say.
|
|
104
|
+
*
|
|
105
|
+
* Tracks narrated insight IDs in buddy.json to avoid repeats.
|
|
106
|
+
*/
|
|
107
|
+
export declare function getBuddyDreamNarration(): string | null;
|
|
33
108
|
//# sourceMappingURL=buddy.d.ts.map
|