@kernel.chat/kbot 3.60.0 → 3.61.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/dist/cli.js CHANGED
@@ -54,6 +54,7 @@ async function main() {
54
54
  .option('--lite', 'Lightweight mode — skip heavy tools (auto-enabled on Replit)')
55
55
  .option('--safe', 'Confirm destructive operations')
56
56
  .option('--strict', 'Confirm ALL operations')
57
+ .option('--ollama-launch', 'Auto-configure for ollama launch (sets Ollama as provider)')
57
58
  .argument('[prompt...]', 'One-shot prompt')
58
59
  .helpOption('-h, --help', 'display help for command')
59
60
  .addHelpCommand(false)
@@ -3166,9 +3167,29 @@ async function main() {
3166
3167
  // If a sub-command was run, we're done
3167
3168
  if (['byok', 'auth', 'ide', 'local', 'ollama', 'kbot-local', 'pull', 'doctor', 'serve', 'agents', 'watch', 'voice', 'export', 'plugins', 'changelog', 'release', 'completions', 'automate', 'status', 'spec', 'a2a', 'init', 'email-agent', 'imessage-agent', 'consultation', 'observe', 'discovery', 'bench', 'lab', 'teach', 'sessions', 'admin', 'monitor', 'analytics', 'deploy', 'env', 'db'].includes(program.args[0]))
3168
3169
  return;
3170
+ // ── Ollama Launch Integration ──
3171
+ // Detect when kbot is started via `ollama launch kbot` or `kbot --ollama-launch`
3172
+ const isOllamaLaunch = opts.ollamaLaunch || process.env.KBOT_OLLAMA_LAUNCH === '1';
3173
+ if (isOllamaLaunch) {
3174
+ const ollamaHost = process.env.OLLAMA_HOST || 'http://localhost:11434';
3175
+ const ollamaModel = process.env.OLLAMA_MODEL || undefined;
3176
+ const ok = await setupOllama(ollamaModel);
3177
+ if (ok) {
3178
+ printSuccess(`kbot connected to Ollama at ${ollamaHost}`);
3179
+ const models = await listOllamaModels();
3180
+ if (models.length > 0)
3181
+ printInfo(`${models.length} models available. Using: ${ollamaModel || PROVIDERS.ollama.defaultModel}`);
3182
+ printInfo('670+ tools ready. Type your prompt or press Enter for interactive mode.');
3183
+ }
3184
+ else {
3185
+ printError(`Cannot reach Ollama at ${ollamaHost}. Is it running?`);
3186
+ printInfo('Start Ollama: ollama serve');
3187
+ process.exit(1);
3188
+ }
3189
+ }
3169
3190
  // Check for API key (BYOK or local provider)
3170
- let byokActive = isByokEnabled();
3171
- let localActive = byokActive && isLocalProvider(getByokProvider());
3191
+ let byokActive = isOllamaLaunch || isByokEnabled();
3192
+ let localActive = byokActive && (isOllamaLaunch || isLocalProvider(getByokProvider()));
3172
3193
  // AUTO-SETUP: If no provider configured, try to auto-detect and configure one
3173
3194
  if (!byokActive) {
3174
3195
  // Priority 1: Check environment variables (instant, no network)