@banaxi/banana-code 1.0.3 → 1.0.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@banaxi/banana-code",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "🍌 BananaCode",
5
5
  "type": "module",
6
6
  "bin": {
package/src/prompt.js ADDED
@@ -0,0 +1,16 @@
1
+ import os from 'os';
2
+
3
+ export function getSystemPrompt() {
4
+ const platform = os.platform();
5
+ let osDescription = 'a terminal environment';
6
+
7
+ if (platform === 'darwin') {
8
+ osDescription = 'macOS';
9
+ } else if (platform === 'linux') {
10
+ osDescription = 'Linux';
11
+ } else if (platform === 'win32') {
12
+ osDescription = 'Windows';
13
+ }
14
+
15
+ return `You are Banana Code, a terminal-based AI coding assistant running on ${osDescription}. You help users write, debug, and understand code. You have access to tools: execute_command, read_file, write_file, fetch_url, search_files, list_directory. Always use tools when they would help. Be concise but thorough. When writing or editing files, always show what you're about to change. Never perform destructive operations without clearly explaining them first. If a tool action is disallowed by the user, suggest an alternative approach.`;
16
+ }
@@ -2,8 +2,9 @@ import Anthropic from '@anthropic-ai/sdk';
2
2
  import { TOOLS, executeTool } from '../tools/registry.js';
3
3
  import chalk from 'chalk';
4
4
  import ora from 'ora';
5
+ import { getSystemPrompt } from '../prompt.js';
5
6
 
6
- const SYSTEM_PROMPT = "You are Banana Code, a terminal-based AI coding assistant running on Arch Linux with KDE Plasma 6. You help users write, debug, and understand code. You have access to tools: execute_command, read_file, write_file, fetch_url, search_files, list_directory. Always use tools when they would help. Be concise but thorough. When writing or editing files, always show what you're about to change. Never perform destructive operations without clearly explaining them first. If a tool action is disallowed by the user, suggest an alternative approach.";
7
+ const SYSTEM_PROMPT = getSystemPrompt();
7
8
 
8
9
  export class ClaudeProvider {
9
10
  constructor(config) {
@@ -1,8 +1,9 @@
1
1
  import { TOOLS, executeTool } from '../tools/registry.js';
2
2
  import chalk from 'chalk';
3
3
  import ora from 'ora';
4
+ import { getSystemPrompt } from '../prompt.js';
4
5
 
5
- const SYSTEM_PROMPT = "You are Banana Code, a terminal-based AI coding assistant running on Arch Linux with KDE Plasma 6. You help users write, debug, and understand code. You have access to tools: execute_command, read_file, write_file, fetch_url, search_files, list_directory. Always use tools when they would help. Be concise but thorough. When writing or editing files, always show what you're about to change. Never perform destructive operations without clearly explaining them first. If a tool action is disallowed by the user, suggest an alternative approach.";
6
+ const SYSTEM_PROMPT = getSystemPrompt();
6
7
 
7
8
  export class GeminiProvider {
8
9
  constructor(config) {
@@ -1,8 +1,9 @@
1
1
  import { TOOLS, executeTool } from '../tools/registry.js';
2
2
  import chalk from 'chalk';
3
3
  import ora from 'ora';
4
+ import { getSystemPrompt } from '../prompt.js';
4
5
 
5
- const SYSTEM_PROMPT = "You are Banana Code, a terminal-based AI coding assistant running on Arch Linux with KDE Plasma 6. You help users write, debug, and understand code. You have access to tools: execute_command, read_file, write_file, fetch_url, search_files, list_directory. Always use tools when they would help. Be concise but thorough. When writing or editing files, always show what you're about to change. Never perform destructive operations without clearly explaining them first. If a tool action is disallowed by the user, suggest an alternative approach.";
6
+ const SYSTEM_PROMPT = getSystemPrompt();
6
7
 
7
8
  export class OllamaProvider {
8
9
  constructor(config) {
@@ -5,8 +5,9 @@ import ora from 'ora';
5
5
  import os from 'os';
6
6
  import path from 'path';
7
7
  import fsSync from 'fs';
8
+ import { getSystemPrompt } from '../prompt.js';
8
9
 
9
- const SYSTEM_PROMPT = "You are Banana Code, a terminal-based AI coding assistant running on Arch Linux with KDE Plasma 6. You help users write, debug, and understand code. You have access to tools: execute_command, read_file, write_file, fetch_url, search_files, list_directory. Always use tools when they would help. Be concise but thorough. When writing or editing files, always show what you're about to change. Never perform destructive operations without clearly explaining them first. If a tool action is disallowed by the user, suggest an alternative approach.";
10
+ const SYSTEM_PROMPT = getSystemPrompt();
10
11
 
11
12
  export class OpenAIProvider {
12
13
  constructor(config) {