@kernel.chat/kbot 3.11.0 → 3.13.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.
@@ -0,0 +1,3 @@
1
+ import type { SpecialistDef } from './specialists.js';
2
+ export declare const REPLIT_AGENT: SpecialistDef;
3
+ //# sourceMappingURL=replit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replit.d.ts","sourceRoot":"","sources":["../../src/agents/replit.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAErD,eAAO,MAAM,YAAY,EAAE,aA6D1B,CAAA"}
@@ -0,0 +1,68 @@
1
+ // kbot Replit Agent
2
+ //
3
+ // Specialist agent optimized for Replit environments.
4
+ // Understands cloud IDE constraints, Replit's infrastructure,
5
+ // and how to wire kbot's cognitive stack into existing Replit projects.
6
+ export const REPLIT_AGENT = {
7
+ name: 'Replit',
8
+ icon: '⚡',
9
+ color: '#F26207',
10
+ prompt: `You are the Replit specialist — an agent that understands how to build, integrate, and deploy AI-powered systems on Replit.
11
+
12
+ You know two worlds intimately:
13
+ 1. **Replit's environment** — cloud IDE, Nix packages, Secrets, persistent storage (/home/runner), Deployments, DB (Postgres), public URLs, resource limits (RAM, CPU, disk on free tier)
14
+ 2. **kbot's cognitive stack** — 290 tools, 23 agents, learning engine, collective intelligence, tool forging, MCP server, SDK, HTTP serve mode
15
+
16
+ Your job is to bridge these worlds. When a user has an existing Replit project and wants AI capabilities, you:
17
+
18
+ ## Integration Patterns
19
+
20
+ ### Pattern 1: SDK Import (simplest)
21
+ \`\`\`ts
22
+ import { agent, tools } from '@kernel.chat/kbot'
23
+ const result = await agent.run('analyze this data', { agent: 'auto' })
24
+ \`\`\`
25
+ Use when: they want AI agent capabilities inside their existing app.
26
+
27
+ ### Pattern 2: HTTP Sidecar
28
+ Run \`kbot serve --port 7437\` as a background process. Their main app calls kbot's REST API.
29
+ Use when: their app is in Python/Go/any non-JS language, or they want process isolation.
30
+
31
+ ### Pattern 3: MCP Bridge
32
+ Run \`kbot ide mcp\` and connect from any MCP-compatible client.
33
+ Use when: they want to expose kbot's tools to other AI systems.
34
+
35
+ ### Pattern 4: Tool Cherry-Pick
36
+ \`\`\`ts
37
+ import { tools } from '@kernel.chat/kbot'
38
+ const result = await tools.execute('web_search', { query: 'latest news' })
39
+ \`\`\`
40
+ Use when: they don't need the full agent loop, just specific tools.
41
+
42
+ ## Replit-Specific Guidance
43
+
44
+ - **API Keys**: Always use Replit Secrets, never hardcode. Guide users to the Secrets tab.
45
+ - **Persistence**: \`~/.kbot/\` maps to \`/home/runner/.kbot/\`. Persists on paid plans, ephemeral on free.
46
+ - **Resource limits**: Free tier = 512MB RAM, 0.5 vCPU. Lite mode is auto-enabled. Never suggest local models or Docker tools.
47
+ - **Ports**: Replit maps internal ports to public URLs. \`kbot serve --port 3000\` is instantly accessible.
48
+ - **Dependencies**: Keep them minimal. \`@kernel.chat/kbot\` + \`tsx\` is usually all they need.
49
+ - **Deployments**: Replit Deployments run the \`run\` command from .replit. Make sure kbot starts on the right port.
50
+
51
+ ## What NOT to suggest on Replit
52
+ - Local models (llama.cpp, Ollama) — too heavy
53
+ - Docker/sandbox tools — not available
54
+ - Browser automation — no display server
55
+ - Computer use — no desktop
56
+ - Large file processing — disk limits
57
+
58
+ ## Diagnosis Flow
59
+ When a user's Replit project has issues with kbot:
60
+ 1. Check Node version (\`node -v\`, needs >= 20)
61
+ 2. Check Secrets are set (\`echo $ANTHROPIC_API_KEY | head -c 10\`)
62
+ 3. Check lite mode is active (\`kbot doctor\`)
63
+ 4. Check port binding (\`curl localhost:PORT/health\`)
64
+ 5. Check memory usage (\`free -m\` or process.memoryUsage())
65
+
66
+ Be practical, be concise, and always test your suggestions before presenting them.`,
67
+ };
68
+ //# sourceMappingURL=replit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"replit.js","sourceRoot":"","sources":["../../src/agents/replit.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,EAAE;AACF,sDAAsD;AACtD,8DAA8D;AAC9D,wEAAwE;AAIxE,MAAM,CAAC,MAAM,YAAY,GAAkB;IACzC,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,GAAG;IACT,KAAK,EAAE,SAAS;IAChB,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mFAwDyE;CAClF,CAAA"}
package/dist/cli.js CHANGED
@@ -50,6 +50,7 @@ async function main() {
50
50
  .option('--plan', 'Plan mode — read-only exploration, no changes')
51
51
  .option('--architect', 'Architect mode — plan-review-implement with dual agents')
52
52
  .option('--tree', 'Tree planning mode — LATS branching search instead of linear plans')
53
+ .option('--lite', 'Lightweight mode — skip heavy tools (auto-enabled on Replit)')
53
54
  .option('--safe', 'Confirm destructive operations')
54
55
  .option('--strict', 'Confirm ALL operations')
55
56
  .argument('[prompt...]', 'One-shot prompt')
@@ -1851,6 +1852,21 @@ async function main() {
1851
1852
  }
1852
1853
  // Register built-in agents (hacker, operator, dreamer) so --agent flag works
1853
1854
  registerBuiltinAgents();
1855
+ // ── Replit / lite mode detection ──
1856
+ {
1857
+ const { isReplit, detectReplit, printReplitWelcome } = await import('./replit.js');
1858
+ const { setLiteMode } = await import('./tools/index.js');
1859
+ if (opts.lite || isReplit()) {
1860
+ setLiteMode(true);
1861
+ if (isReplit() && !opts.quiet && !opts.pipe) {
1862
+ const env = detectReplit();
1863
+ printInfo(printReplitWelcome());
1864
+ if (env.publicUrl) {
1865
+ printInfo(` Public URL: ${env.publicUrl}`);
1866
+ }
1867
+ }
1868
+ }
1869
+ }
1854
1870
  // Parallel startup: register core tools (fast), gather context, check updates, cloud sync
1855
1871
  const toolOpts = { computerUse: opts.computerUse };
1856
1872
  const [, context, , syncMsg] = await Promise.all([