@kernel.chat/kbot 3.33.1 → 3.34.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-create.d.ts +14 -0
- package/dist/agent-create.d.ts.map +1 -0
- package/dist/agent-create.js +256 -0
- package/dist/agent-create.js.map +1 -0
- package/dist/cli.js +36 -0
- package/dist/cli.js.map +1 -1
- package/dist/compete.d.ts +2 -0
- package/dist/compete.d.ts.map +1 -0
- package/dist/compete.js +233 -0
- package/dist/compete.js.map +1 -0
- package/dist/dashboard.d.ts +2 -0
- package/dist/dashboard.d.ts.map +1 -0
- package/dist/dashboard.js +277 -0
- package/dist/dashboard.js.map +1 -0
- package/dist/digest.d.ts +19 -0
- package/dist/digest.d.ts.map +1 -0
- package/dist/digest.js +77 -0
- package/dist/digest.js.map +1 -0
- package/dist/forge-registry.d.ts +16 -0
- package/dist/forge-registry.d.ts.map +1 -0
- package/dist/forge-registry.js +103 -0
- package/dist/forge-registry.js.map +1 -0
- package/dist/init.d.ts +23 -0
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +143 -4
- package/dist/init.js.map +1 -1
- package/dist/init.test.js +2 -0
- package/dist/init.test.js.map +1 -1
- package/dist/openclaw-connect.d.ts +2 -0
- package/dist/openclaw-connect.d.ts.map +1 -0
- package/dist/openclaw-connect.js +196 -0
- package/dist/openclaw-connect.js.map +1 -0
- package/dist/pair.d.ts +22 -0
- package/dist/pair.d.ts.map +1 -1
- package/dist/pair.js +275 -2
- package/dist/pair.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface AgentCreateArgs {
|
|
2
|
+
name?: string;
|
|
3
|
+
specialty?: string;
|
|
4
|
+
tone?: string;
|
|
5
|
+
model?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function runAgentCreate(args?: AgentCreateArgs): Promise<void>;
|
|
8
|
+
/** List all custom agents in ~/.kbot/agents/ */
|
|
9
|
+
export declare function listCustomAgents(): {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
specialty: string;
|
|
13
|
+
}[];
|
|
14
|
+
//# sourceMappingURL=agent-create.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-create.d.ts","sourceRoot":"","sources":["../src/agent-create.ts"],"names":[],"mappings":"AA2BA,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AA4LD,wBAAsB,cAAc,CAAC,IAAI,GAAE,eAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CA6D9E;AAED,gDAAgD;AAChD,wBAAgB,gBAAgB,IAAI;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,EAAE,CA0BpF"}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
// kbot Agent Create — Interactive agent builder
|
|
2
|
+
//
|
|
3
|
+
// Creates persistent custom agent definitions saved as SOUL.md-compatible
|
|
4
|
+
// markdown files in ~/.kbot/agents/. Agents can be invoked with --agent flag.
|
|
5
|
+
//
|
|
6
|
+
// Usage:
|
|
7
|
+
// kbot agent create # Interactive mode
|
|
8
|
+
// kbot agent create --name mybot --specialty "code review" --tone professional --model auto
|
|
9
|
+
import { createInterface } from 'node:readline';
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import { mkdirSync, writeFileSync, existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
12
|
+
import chalk from 'chalk';
|
|
13
|
+
import { KBOT_DIR } from './auth.js';
|
|
14
|
+
// ── Constants ──
|
|
15
|
+
const AGENTS_DIR = join(KBOT_DIR, 'agents');
|
|
16
|
+
const VALID_TONES = ['professional', 'casual', 'technical', 'friendly'];
|
|
17
|
+
const VALID_MODELS = ['auto', 'local', 'claude', 'gpt'];
|
|
18
|
+
// ── Helpers ──
|
|
19
|
+
/** Slugify a name to a filesystem-safe ID */
|
|
20
|
+
function slugify(name) {
|
|
21
|
+
return name
|
|
22
|
+
.toLowerCase()
|
|
23
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
24
|
+
.replace(/^-|-$/g, '');
|
|
25
|
+
}
|
|
26
|
+
/** Ask a question via readline and return the answer */
|
|
27
|
+
function ask(rl, question) {
|
|
28
|
+
return new Promise(resolve => rl.question(question, resolve));
|
|
29
|
+
}
|
|
30
|
+
/** Validate tone, returning normalized value or null */
|
|
31
|
+
function validateTone(input) {
|
|
32
|
+
const normalized = input.toLowerCase().trim();
|
|
33
|
+
if (VALID_TONES.includes(normalized))
|
|
34
|
+
return normalized;
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
/** Validate model, returning normalized value or null */
|
|
38
|
+
function validateModel(input) {
|
|
39
|
+
const normalized = input.toLowerCase().trim();
|
|
40
|
+
if (VALID_MODELS.includes(normalized))
|
|
41
|
+
return normalized;
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
/** Generate a tone instruction for the system prompt */
|
|
45
|
+
function toneInstruction(tone) {
|
|
46
|
+
switch (tone) {
|
|
47
|
+
case 'professional':
|
|
48
|
+
return 'Communicate in a clear, professional manner. Be precise and thorough. Avoid slang or overly casual language.';
|
|
49
|
+
case 'casual':
|
|
50
|
+
return 'Be conversational and approachable. Use natural language, contractions, and a relaxed tone. Still be helpful and accurate.';
|
|
51
|
+
case 'technical':
|
|
52
|
+
return 'Be highly technical and detailed. Use precise terminology, include relevant technical context, and assume the user has domain expertise.';
|
|
53
|
+
case 'friendly':
|
|
54
|
+
return 'Be warm, encouraging, and supportive. Explain things clearly, celebrate progress, and make the interaction feel collaborative.';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/** Generate a model instruction for the agent definition */
|
|
58
|
+
function modelInstruction(model) {
|
|
59
|
+
switch (model) {
|
|
60
|
+
case 'auto':
|
|
61
|
+
return 'Use the best available model based on task complexity.';
|
|
62
|
+
case 'local':
|
|
63
|
+
return 'Prefer local models (Ollama, LM Studio, embedded) for $0 cost.';
|
|
64
|
+
case 'claude':
|
|
65
|
+
return 'Use Anthropic Claude models (Sonnet for speed, Opus for quality).';
|
|
66
|
+
case 'gpt':
|
|
67
|
+
return 'Use OpenAI GPT models (GPT-4o for quality, GPT-4o-mini for speed).';
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
// ── SOUL.md Generation ──
|
|
71
|
+
function generateAgentMd(def) {
|
|
72
|
+
return `# SOUL.md — ${def.name}
|
|
73
|
+
|
|
74
|
+
## Identity
|
|
75
|
+
|
|
76
|
+
- **Name**: ${def.name}
|
|
77
|
+
- **ID**: ${def.id}
|
|
78
|
+
- **Type**: Custom kbot agent
|
|
79
|
+
- **Created**: ${def.createdAt}
|
|
80
|
+
|
|
81
|
+
## Specialty
|
|
82
|
+
|
|
83
|
+
${def.specialty}
|
|
84
|
+
|
|
85
|
+
## System Prompt
|
|
86
|
+
|
|
87
|
+
You are ${def.name}, a kbot specialist agent focused on: ${def.specialty}.
|
|
88
|
+
|
|
89
|
+
${toneInstruction(def.tone)}
|
|
90
|
+
|
|
91
|
+
When working:
|
|
92
|
+
- Stay focused on your specialty area
|
|
93
|
+
- Use available tools to take action, not just advise
|
|
94
|
+
- If a task falls outside your specialty, say so clearly
|
|
95
|
+
- Build on previous context within the session
|
|
96
|
+
- Be concise — respect the user's time
|
|
97
|
+
|
|
98
|
+
## Model Preference
|
|
99
|
+
|
|
100
|
+
${modelInstruction(def.model)}
|
|
101
|
+
|
|
102
|
+
## Configuration
|
|
103
|
+
|
|
104
|
+
\`\`\`json
|
|
105
|
+
{
|
|
106
|
+
"name": "${def.name}",
|
|
107
|
+
"id": "${def.id}",
|
|
108
|
+
"specialty": "${def.specialty}",
|
|
109
|
+
"tone": "${def.tone}",
|
|
110
|
+
"model": "${def.model}",
|
|
111
|
+
"createdAt": "${def.createdAt}"
|
|
112
|
+
}
|
|
113
|
+
\`\`\`
|
|
114
|
+
`;
|
|
115
|
+
}
|
|
116
|
+
// ── Interactive Mode ──
|
|
117
|
+
async function interactiveCreate() {
|
|
118
|
+
const DIM = chalk.dim;
|
|
119
|
+
const ACCENT = chalk.hex('#A78BFA');
|
|
120
|
+
const CYAN = chalk.hex('#67E8F9');
|
|
121
|
+
console.log();
|
|
122
|
+
console.log(` ${ACCENT('◉')} ${chalk.bold('kbot Agent Builder')}`);
|
|
123
|
+
console.log(` ${DIM('─'.repeat(40))}`);
|
|
124
|
+
console.log();
|
|
125
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
126
|
+
try {
|
|
127
|
+
// Name
|
|
128
|
+
const nameRaw = await ask(rl, ` ${CYAN('Agent name:')} `);
|
|
129
|
+
const name = nameRaw.trim();
|
|
130
|
+
if (!name) {
|
|
131
|
+
console.log(` ${chalk.hex('#F87171')('✗')} Name is required.`);
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
const id = slugify(name);
|
|
135
|
+
const agentPath = join(AGENTS_DIR, `${id}.md`);
|
|
136
|
+
if (existsSync(agentPath)) {
|
|
137
|
+
console.log(` ${chalk.hex('#F87171')('✗')} Agent "${id}" already exists at ${DIM(agentPath)}`);
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
// Specialty
|
|
141
|
+
const specialty = (await ask(rl, ` ${CYAN('What should this agent specialize in?')} `)).trim();
|
|
142
|
+
if (!specialty) {
|
|
143
|
+
console.log(` ${chalk.hex('#F87171')('✗')} Specialty is required.`);
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
// Tone
|
|
147
|
+
let tone = null;
|
|
148
|
+
while (!tone) {
|
|
149
|
+
const toneRaw = await ask(rl, ` ${CYAN('What tone?')} ${DIM('(professional, casual, technical, friendly)')} `);
|
|
150
|
+
tone = validateTone(toneRaw || 'professional');
|
|
151
|
+
if (!tone) {
|
|
152
|
+
console.log(` ${chalk.hex('#FBBF24')('⚠')} Pick one: professional, casual, technical, friendly`);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
// Model
|
|
156
|
+
let model = null;
|
|
157
|
+
while (!model) {
|
|
158
|
+
const modelRaw = await ask(rl, ` ${CYAN('What model?')} ${DIM('(auto, local, claude, gpt)')} `);
|
|
159
|
+
model = validateModel(modelRaw || 'auto');
|
|
160
|
+
if (!model) {
|
|
161
|
+
console.log(` ${chalk.hex('#FBBF24')('⚠')} Pick one: auto, local, claude, gpt`);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
name,
|
|
166
|
+
id,
|
|
167
|
+
specialty,
|
|
168
|
+
tone,
|
|
169
|
+
model,
|
|
170
|
+
createdAt: new Date().toISOString(),
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
finally {
|
|
174
|
+
rl.close();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
// ── Main ──
|
|
178
|
+
export async function runAgentCreate(args = {}) {
|
|
179
|
+
const DIM = chalk.dim;
|
|
180
|
+
const GREEN = chalk.hex('#4ADE80');
|
|
181
|
+
const RED = chalk.hex('#F87171');
|
|
182
|
+
let def;
|
|
183
|
+
// If all required args provided, skip interactive mode
|
|
184
|
+
if (args.name && args.specialty) {
|
|
185
|
+
const id = slugify(args.name);
|
|
186
|
+
const agentPath = join(AGENTS_DIR, `${id}.md`);
|
|
187
|
+
if (existsSync(agentPath)) {
|
|
188
|
+
console.log(` ${RED('✗')} Agent "${id}" already exists at ${DIM(agentPath)}`);
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
const tone = validateTone(args.tone || 'professional');
|
|
192
|
+
if (!tone) {
|
|
193
|
+
console.log(` ${RED('✗')} Invalid tone "${args.tone}". Choose: ${VALID_TONES.join(', ')}`);
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
const model = validateModel(args.model || 'auto');
|
|
197
|
+
if (!model) {
|
|
198
|
+
console.log(` ${RED('✗')} Invalid model "${args.model}". Choose: ${VALID_MODELS.join(', ')}`);
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
def = {
|
|
202
|
+
name: args.name,
|
|
203
|
+
id,
|
|
204
|
+
specialty: args.specialty,
|
|
205
|
+
tone,
|
|
206
|
+
model,
|
|
207
|
+
createdAt: new Date().toISOString(),
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
// Interactive mode
|
|
212
|
+
def = await interactiveCreate();
|
|
213
|
+
}
|
|
214
|
+
if (!def)
|
|
215
|
+
return;
|
|
216
|
+
// Ensure agents directory exists
|
|
217
|
+
if (!existsSync(AGENTS_DIR)) {
|
|
218
|
+
mkdirSync(AGENTS_DIR, { recursive: true });
|
|
219
|
+
}
|
|
220
|
+
// Write agent definition
|
|
221
|
+
const agentPath = join(AGENTS_DIR, `${def.id}.md`);
|
|
222
|
+
const content = generateAgentMd(def);
|
|
223
|
+
writeFileSync(agentPath, content, 'utf-8');
|
|
224
|
+
// Print success
|
|
225
|
+
console.log();
|
|
226
|
+
console.log(` ${GREEN('✓')} Agent '${def.name}' created.`);
|
|
227
|
+
console.log(` ${DIM('Saved to:')} ${DIM(agentPath)}`);
|
|
228
|
+
console.log();
|
|
229
|
+
console.log(` ${DIM('Use with:')} ${chalk.white(`kbot --agent ${def.id}`)}`);
|
|
230
|
+
console.log();
|
|
231
|
+
}
|
|
232
|
+
/** List all custom agents in ~/.kbot/agents/ */
|
|
233
|
+
export function listCustomAgents() {
|
|
234
|
+
if (!existsSync(AGENTS_DIR))
|
|
235
|
+
return [];
|
|
236
|
+
const agents = [];
|
|
237
|
+
try {
|
|
238
|
+
const files = readdirSync(AGENTS_DIR).filter(f => f.endsWith('.md'));
|
|
239
|
+
for (const file of files) {
|
|
240
|
+
const id = file.replace(/\.md$/, '');
|
|
241
|
+
const content = readFileSync(join(AGENTS_DIR, file), 'utf-8');
|
|
242
|
+
// Extract name from "# SOUL.md — Name" header
|
|
243
|
+
const nameMatch = content.match(/^# SOUL\.md — (.+)$/m);
|
|
244
|
+
const name = nameMatch ? nameMatch[1] : id;
|
|
245
|
+
// Extract specialty from the ## Specialty section
|
|
246
|
+
const specialtyMatch = content.match(/## Specialty\n\n(.+)/m);
|
|
247
|
+
const specialty = specialtyMatch ? specialtyMatch[1] : 'custom agent';
|
|
248
|
+
agents.push({ id, name, specialty });
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
catch {
|
|
252
|
+
// Directory read failed — return empty
|
|
253
|
+
}
|
|
254
|
+
return agents;
|
|
255
|
+
}
|
|
256
|
+
//# sourceMappingURL=agent-create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-create.js","sourceRoot":"","sources":["../src/agent-create.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,EAAE;AACF,0EAA0E;AAC1E,8EAA8E;AAC9E,EAAE;AACF,SAAS;AACT,sEAAsE;AACtE,8FAA8F;AAE9F,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACzF,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEpC,kBAAkB;AAElB,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;AAE3C,MAAM,WAAW,GAAG,CAAC,cAAc,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,CAAU,CAAA;AAGhF,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAU,CAAA;AAqBhE,gBAAgB;AAEhB,6CAA6C;AAC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,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAA;QACpE,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;YACpC,MAAM,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,CAAA;YAE7D,8CAA8C;YAC9C,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAA;YACvD,MAAM,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;YAE1C,kDAAkD;YAClD,MAAM,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAA;YAC7D,MAAM,SAAS,GAAG,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAA;YAErE,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;QACtC,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,uCAAuC;IACzC,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
|
package/dist/cli.js
CHANGED
|
@@ -795,6 +795,42 @@ async function main() {
|
|
|
795
795
|
}
|
|
796
796
|
process.exit(0);
|
|
797
797
|
});
|
|
798
|
+
program
|
|
799
|
+
.command('pair [path]')
|
|
800
|
+
.description('Pair programming mode — watch files, run tests, get real-time suggestions')
|
|
801
|
+
.option('-q, --quiet', 'Only show errors, suppress suggestions')
|
|
802
|
+
.option('--auto-fix', 'Automatically apply safe fixes (trailing whitespace, unused imports)')
|
|
803
|
+
.option('--bell', 'Sound terminal bell on errors')
|
|
804
|
+
.option('--no-types', 'Disable TypeScript type checking')
|
|
805
|
+
.option('--no-lint', 'Disable ESLint checks')
|
|
806
|
+
.option('--no-tests', 'Disable missing test detection')
|
|
807
|
+
.option('--no-security', 'Disable security scanning')
|
|
808
|
+
.option('--no-style', 'Disable style checks')
|
|
809
|
+
.option('--ignore <patterns>', 'Additional ignore patterns (comma-separated)')
|
|
810
|
+
.action(async (pairPath, opts) => {
|
|
811
|
+
const { runPair } = await import('./pair.js');
|
|
812
|
+
const checks = {};
|
|
813
|
+
if (opts?.types === false)
|
|
814
|
+
checks.typeErrors = false;
|
|
815
|
+
if (opts?.lint === false)
|
|
816
|
+
checks.lint = false;
|
|
817
|
+
if (opts?.tests === false)
|
|
818
|
+
checks.missingTests = false;
|
|
819
|
+
if (opts?.security === false)
|
|
820
|
+
checks.security = false;
|
|
821
|
+
if (opts?.style === false)
|
|
822
|
+
checks.style = false;
|
|
823
|
+
const ignorePatterns = opts?.ignore
|
|
824
|
+
? opts.ignore.split(',').map((p) => p.trim())
|
|
825
|
+
: undefined;
|
|
826
|
+
await runPair(pairPath, {
|
|
827
|
+
quiet: opts?.quiet,
|
|
828
|
+
autoFix: opts?.autoFix,
|
|
829
|
+
bell: opts?.bell,
|
|
830
|
+
checks: Object.keys(checks).length > 0 ? checks : undefined,
|
|
831
|
+
ignorePatterns,
|
|
832
|
+
});
|
|
833
|
+
});
|
|
798
834
|
program
|
|
799
835
|
.command('doctor')
|
|
800
836
|
.description('Diagnose your kbot setup — check everything is working')
|