@kernel.chat/kbot 3.99.1 → 3.99.3

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.js CHANGED
@@ -638,7 +638,31 @@ const PLAN_MODE_TOOLS = new Set([
638
638
  'lsp_hover', 'lsp_diagnostics', 'lsp_symbols', 'lsp_find_references', 'lsp_goto_definition',
639
639
  ]);
640
640
  /** Detect if a message describes a complex multi-step task */
641
+ /**
642
+ * Recognize conversational / reflective prompts that should answer directly
643
+ * regardless of length. Without this, a long question like "Here's what happened…
644
+ * what does this mean?" gets flagged complex and kicks off a ceremonial planner
645
+ * that produces theatre instead of an answer.
646
+ */
647
+ function isConversational(message) {
648
+ const lower = message.toLowerCase().trim();
649
+ // Leading question/reflection word
650
+ if (/^(what|why|how|who|when|where|which|explain|describe|tell me|introduce|summarize|reflect|compare|contrast|define|list|give me one|in your own)\b/.test(lower))
651
+ return true;
652
+ // Explicit "no tool calls / plain English / one paragraph" directives
653
+ if (/\b(no tool calls?|no json|no plan|plain english|one paragraph|in first person|in your own voice)\b/.test(lower))
654
+ return true;
655
+ // Ends with ? and has no imperative action verb targeting code/files/systems
656
+ const endsWithQ = lower.endsWith('?');
657
+ const hasImperative = /\b(write|build|create|fix|refactor|migrate|deploy|ship|publish|install|run|make|set up|configure|generate|add|remove|delete|commit|push|rename|move|copy|replace)\b/.test(lower);
658
+ if (endsWithQ && !hasImperative)
659
+ return true;
660
+ return false;
661
+ }
641
662
  function isComplexTask(message) {
663
+ // Conversational prompts never enter planner mode, no matter how long.
664
+ if (isConversational(message))
665
+ return false;
642
666
  const lower = message.toLowerCase();
643
667
  const complexSignals = [
644
668
  /\b(refactor|migrate|convert|rewrite|restructure|reorganize)\b/,
@@ -18,28 +18,34 @@ let cached = null;
18
18
  export function getSelfAwarenessPrompt() {
19
19
  if (cached !== null)
20
20
  return cached;
21
- const lines = ['[kbot Ground Truth — authoritative over any model assumption]'];
21
+ const lines = [
22
+ '[kbot Ground Truth — AUTHORITATIVE. When asked about yourself (version, model, provider, architecture, what you are), answer ONLY from this block. Do NOT guess, do NOT assume GPT-4, Llama, Hermes, Claude, or any specific base model unless listed here.]',
23
+ ];
22
24
  // Version (read from package.json)
23
25
  try {
24
26
  const here = dirname(fileURLToPath(import.meta.url));
25
27
  const pkgPath = join(here, '..', 'package.json');
26
28
  const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
27
- lines.push(`- You are @kernel.chat/kbot v${pkg.version} — an open-source terminal AI agent.`);
29
+ lines.push(`- Product: @kernel.chat/kbot v${pkg.version} — MIT-licensed, open-source terminal AI agent from kernel.chat group.`);
28
30
  }
29
31
  catch {
30
- lines.push('- You are @kernel.chat/kbot — an open-source terminal AI agent.');
32
+ lines.push('- Product: @kernel.chat/kbot — MIT-licensed, open-source terminal AI agent.');
31
33
  }
32
- // Active provider + model
34
+ // Active provider + model + honest fallback note
33
35
  try {
34
36
  const provider = getByokProvider();
35
37
  const cfg = getProvider(provider);
36
38
  const model = getProviderModel(provider, 'default');
37
39
  const local = isLocalProvider(provider) ? ' (local, $0 cost)' : '';
38
- lines.push(`- Active provider: ${cfg.name}${local} — model: ${model}`);
40
+ lines.push(`- Configured provider: ${cfg.name}${local} — model: ${model}`);
41
+ lines.push(`- Runtime reality: if the configured provider is unreachable, kbot falls back through the BYOK chain (next available configured key). The model actually answering right now is whichever provider's API accepted the request — you do NOT know which without checking \`kbot doctor\`.`);
39
42
  }
40
43
  catch {
41
- // Provider not configured yet
44
+ lines.push('- Provider: not configured. Run `kbot auth` to set up a key.');
42
45
  }
46
+ // Disclaimers that correct common hallucinations
47
+ lines.push('- You are NOT GPT-4, NOT Llama, NOT Hermes, NOT a single hard-coded model. kbot is BYOK — it works with 20 providers (Anthropic, OpenAI, Google, Groq, Mistral, DeepSeek, Ollama, LM Studio, and more).');
48
+ lines.push('- You are NOT Hermes Agent. Hermes is a separate project. Some skills in the library are IMPORTED from Hermes (via `kbot skills import`) but kbot is its own agent with its own architecture.');
43
49
  // Machine
44
50
  try {
45
51
  const m = getMachineProfile();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kernel.chat/kbot",
3
- "version": "3.99.1",
3
+ "version": "3.99.3",
4
4
  "description": "Open-source terminal AI agent. 787+ tools, 35 agents, 20 providers. Dreams, learns, watches your system. Controls your phone. Fully local, fully sovereign. MIT.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: ceremony-vs-substance
3
+ description: Use every turn. Refuse ceremonial process (plans, checklists, scaffolding) when the user wants a direct answer. Never mark a step ✓ unless the step actually produced its output.
4
+ version: 1.0.0
5
+ author: kbot
6
+ license: MIT
7
+ metadata:
8
+ kbot:
9
+ tags: [planning, honesty, directness, ceremony, introspection]
10
+ related_skills: [systematic-debugging, skill-self-authorship]
11
+ ---
12
+
13
+ # Ceremony vs. Substance
14
+
15
+ kbot has a planner. The planner is powerful for real engineering work — migrations, multi-file refactors, release pipelines. It is actively harmful for conversational questions, introspection, short answers, or explanations.
16
+
17
+ When a user asks "what does this mean" and kbot responds with a 5-step plan ("read SCRATCHPAD → read module → draft → refine → typecheck") and marks every step ✓ without producing the promised output, that's theatre. The user gets a progress bar and no answer.
18
+
19
+ ## Iron Law
20
+
21
+ ```
22
+ CEREMONY IS ONLY ALLOWED WHEN IT PRODUCES OBSERVABLE OUTPUT.
23
+ A STEP MARKED ✓ MUST HAVE WRITTEN A FILE, RUN A COMMAND, OR EMITTED A VERIFIED ARTIFACT.
24
+ ```
25
+
26
+ A "✓ draft response" that didn't produce text is a lie. Don't emit it.
27
+
28
+ ## When to Skip the Plan Entirely
29
+
30
+ Direct-answer this prompt if ANY of these is true:
31
+ - Starts with what/why/how/who/when/which/explain/describe/tell me/introduce/summarize/reflect.
32
+ - Contains "no tool calls", "no plan", "plain English", "one paragraph", "in your own voice."
33
+ - Ends with `?` and has no imperative verb on code/files.
34
+ - The answer is < 500 words and requires zero tool calls.
35
+ - The user is clearly in a conversational mode (follow-ups to a previous answer).
36
+
37
+ Direct-answer means: produce prose, now, in the response body. No "Step 1: think about it." No plan dashboards. No typecheck on a nonexistent file.
38
+
39
+ ## When Planning IS Appropriate
40
+
41
+ - Multi-file refactors, migrations, schema changes.
42
+ - Deploy pipelines, release flows, multi-stage builds.
43
+ - "Ship X" / "publish Y" / "rewrite Z" — imperative verbs on code.
44
+ - Tasks the user explicitly invoked with `--plan`, `--architect`, or `/plan`.
45
+ - Investigations where the first action's output changes what the second action should be.
46
+
47
+ ## The Output Check
48
+
49
+ Before marking any step ✓, ask:
50
+ 1. What artifact did this step produce? (file path / command output / piece of text)
51
+ 2. Is that artifact real, visible, and correct?
52
+
53
+ If the answer to #1 is "I thought about it" — the step did not happen. Leave it pending, or re-run with a concrete action.
54
+
55
+ ## Anti-Patterns Observed in the Wild
56
+
57
+ - "Step 1: Read SCRATCHPAD.md — ✓" when no `read_file` tool was actually called.
58
+ - "Step 5: Run type-check to ensure no errors — ✓" when no shell command was executed.
59
+ - Writing a 5-step plan for a question that takes one paragraph to answer.
60
+ - Declaring "Plan complete: 5/5 steps succeeded" in a prompt whose only output is a progress table.
61
+ - Entering plan mode on any message > 500 chars, even if the message is a reflection or question.
62
+
63
+ ## What Emerges
64
+
65
+ When kbot stops performing ceremony, users trust the ✓ marks. When a plan runs, its steps correspond to real file writes and command runs. The planner becomes a load-bearing feature, not a progress bar that's allowed to lie.