From 920055f73c7f22ab20a7d42ed29c08bcfa935223 Mon Sep 17 00:00:00 2001 From: ibnu yahya Date: Wed, 6 Aug 2025 22:21:41 +0700 Subject: [PATCH] Bump version to 0.3.3 with latest improvements and fixes --- .env.example | 14 +-- CHANGELOG.md | 12 +-- CONDENSE_THRESHOLD_GUIDE.md | 56 +++++----- README.md | 102 +++++++++--------- docs/CODE_REFERENCE_FEATURE.md | 12 +-- docs/CONDENSE_FEATURE.md | 6 +- docs/MCP_INTEGRATION.md | 16 +-- docs/RESPONSE_STYLE_FEATURE.md | 32 +++--- docs/STOP_CONVERSATION_FEATURE.md | 8 +- package.json | 8 +- src/agent/multi-llm-agent.ts | 10 +- src/agent/prompts/system-prompt-builder.ts | 2 +- src/index.ts | 40 +++---- src/juriko/client.ts | 2 +- src/mcp/client.ts | 2 +- src/mcp/settings-manager.ts | 12 +-- src/ui/app-with-provider.tsx | 6 +- src/ui/components/local-llm-wizard.tsx | 2 +- src/ui/components/mcp-loading.tsx | 2 +- .../multi-provider-api-key-input.tsx | 2 +- src/ui/components/settings-menu.tsx | 4 +- src/utils/condense.ts | 2 +- src/utils/custom-instructions.ts | 2 +- src/utils/logger.ts | 2 +- src/utils/user-settings.ts | 30 +++--- test/batch-execution-test.js | 6 +- test/condense-threshold-config-test.js | 6 +- test/condense.test.js | 2 +- test/response-style-test.js | 8 +- test/token-counting-fix-verification.js | 2 +- test/token-counting-issue-test.js | 2 +- test/token-display-accuracy-test.js | 2 +- 32 files changed, 207 insertions(+), 207 deletions(-) diff --git a/.env.example b/.env.example index 511ef24..c148e59 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,4 @@ -# JURIKO CLI Configuration +# KALICODE CLI Configuration # Copy this file to .env and fill in your values # Multi-LLM Provider Support @@ -14,11 +14,11 @@ OPENAI_API_KEY=your_openai_api_key_here GROK_API_KEY=your_grok_api_key_here # Alternative environment variable names (also supported) -# JURIKO_ANTHROPIC_API_KEY=your_anthropic_api_key_here -# JURIKO_OPENAI_API_KEY=your_openai_api_key_here -# JURIKO_GROK_API_KEY=your_grok_api_key_here +# KALICODE_ANTHROPIC_API_KEY=your_anthropic_api_key_here +# KALICODE_OPENAI_API_KEY=your_openai_api_key_here +# KALICODE_GROK_API_KEY=your_grok_api_key_here # Legacy support (for backward compatibility) -# JURIKO_API_KEY=your_grok_api_key_here -# JURIKO_BASE_URL=https://api.x.ai/v1 -# JURIKO_MODEL=grok-4-latest \ No newline at end of file +# KALICODE_API_KEY=your_grok_api_key_here +# KALICODE_BASE_URL=https://api.x.ai/v1 +# KALICODE_MODEL=grok-4-latest \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c149a8..28dcef3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Code Reference System**: Clickable file references with VSCode integration - `--enable-code-references`: Enable clickable file references (default: enabled) - `--disable-code-references`: Disable clickable file references - - `JURIKO_ENABLE_CODE_REFERENCES`: Environment variable to control code references + - `KALICODE_ENABLE_CODE_REFERENCES`: Environment variable to control code references - **CodeReferenceManager**: Intelligent file reference detection and link generation - **VSCode Integration**: Direct navigation to files and specific line numbers - **Automatic Enhancement**: Tool outputs automatically include clickable references @@ -35,7 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **Multi-Tool Batching**: Parallel execution of independent tools for improved performance - `--enable-batching`: Enable parallel execution of independent tools - `--disable-batching`: Disable parallel execution (use sequential execution) - - `JURIKO_ENABLE_BATCHING`: Environment variable to control batching + - `KALICODE_ENABLE_BATCHING`: Environment variable to control batching - **BatchToolExecutor**: Intelligent tool dependency analysis and parallel execution - **Performance Improvements**: Up to 40% faster execution when multiple independent tools are used - **Smart Dependency Detection**: Automatic categorization of tools by type (read/write/compute/network/bash) @@ -108,8 +108,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Markdown Enhancement: Enhanced code blocks with reference links - CLI Flag: `--enable-code-references` for beta feature control - **User Configuration System**: Persistent user settings management - - Persistent Settings: `~/.juriko/user-settings.json` for user preferences - - Settings Management: CLI commands (`juriko config show/set/reset`, `juriko settings`) + - Persistent Settings: `~/.kalicode/user-settings.json` for user preferences + - Settings Management: CLI commands (`kalicode config show/set/reset`, `kalicode settings`) - Merge Protection: Fixed critical bug preventing data loss during setting updates - Environment Overrides: Support for environment variable configuration - **Security Enhancement Framework**: Comprehensive security validation and control @@ -136,7 +136,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Enhanced - **Token Management**: Extended token counter with model-specific limits and threshold monitoring -- **Agent System**: Enhanced JurikoAgent with automatic token monitoring and condensing capabilities +- **Agent System**: Enhanced KalicodeAgent with automatic token monitoring and condensing capabilities - **Tool System**: Added condense tool with confirmation workflow integration - **User Experience**: Clear visual feedback when condensing occurs with token count reduction display @@ -170,7 +170,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Better user guidance during operations ### Enhanced -- **Input Handling**: Improved input handlers in both JurikoAgent and MultiLLMAgent modes +- **Input Handling**: Improved input handlers in both KalicodeAgent and MultiLLMAgent modes - **User Experience**: Better visual feedback and control during long-running operations - **Documentation**: Added comprehensive feature documentation in `docs/STOP_CONVERSATION_FEATURE.md` diff --git a/CONDENSE_THRESHOLD_GUIDE.md b/CONDENSE_THRESHOLD_GUIDE.md index f69d001..86d0e77 100644 --- a/CONDENSE_THRESHOLD_GUIDE.md +++ b/CONDENSE_THRESHOLD_GUIDE.md @@ -1,12 +1,12 @@ -# JURIKO CLI - Condense Threshold Guide +# KALICODE CLI - Condense Threshold Guide ## Overview -JURIKO CLI includes an automatic conversation condensing feature that helps manage token usage by summarizing older parts of conversations when they approach the token limit. The condense threshold determines when this condensing is triggered. +KALICODE CLI includes an automatic conversation condensing feature that helps manage token usage by summarizing older parts of conversations when they approach the token limit. The condense threshold determines when this condensing is triggered. ## What is the Condense Threshold? -The condense threshold is a percentage value (0-100) that determines when JURIKO should automatically condense (summarize) the conversation to reduce token usage. When the conversation reaches this percentage of the model's token limit, JURIKO will: +The condense threshold is a percentage value (0-100) that determines when KALICODE should automatically condense (summarize) the conversation to reduce token usage. When the conversation reaches this percentage of the model's token limit, KALICODE will: 1. Summarize older messages in the conversation 2. Keep recent messages intact for context @@ -22,19 +22,19 @@ The condense threshold is a percentage value (0-100) that determines when JURIKO ### 1. Environment Variable (Highest Priority) -Set the `JURIKO_CONDENSE_THRESHOLD` environment variable: +Set the `KALICODE_CONDENSE_THRESHOLD` environment variable: ```bash # Set threshold to 80% -export JURIKO_CONDENSE_THRESHOLD=80 +export KALICODE_CONDENSE_THRESHOLD=80 -# Or run JURIKO with the environment variable -JURIKO_CONDENSE_THRESHOLD=80 juriko +# Or run KALICODE with the environment variable +KALICODE_CONDENSE_THRESHOLD=80 kalicode ``` ### 2. User Settings File -The threshold is stored in `~/.juriko/user-settings.json`: +The threshold is stored in `~/.kalicode/user-settings.json`: ```json { @@ -61,10 +61,10 @@ await saveCondenseThreshold(85); // Set to 85% ## Configuration Priority -JURIKO checks for the condense threshold in this order: +KALICODE checks for the condense threshold in this order: -1. **Environment Variable**: `JURIKO_CONDENSE_THRESHOLD` (0-100) -2. **User Settings**: `~/.juriko/user-settings.json` +1. **Environment Variable**: `KALICODE_CONDENSE_THRESHOLD` (0-100) +2. **User Settings**: `~/.kalicode/user-settings.json` 3. **Default**: 75% ## Recommended Thresholds @@ -88,7 +88,7 @@ JURIKO checks for the condense threshold in this order: When the threshold is reached: -1. **Token Analysis**: JURIKO calculates current token usage vs. model limit +1. **Token Analysis**: KALICODE calculates current token usage vs. model limit 2. **Message Selection**: Identifies older messages for condensing 3. **Summarization**: Uses the AI model to create a concise summary 4. **Context Preservation**: Keeps recent messages and important context @@ -100,16 +100,16 @@ When the threshold is reached: ```bash # Terminal 1: Set for current session -export JURIKO_CONDENSE_THRESHOLD=70 -juriko +export KALICODE_CONDENSE_THRESHOLD=70 +kalicode # Terminal 2: Set for single run -JURIKO_CONDENSE_THRESHOLD=85 juriko +KALICODE_CONDENSE_THRESHOLD=85 kalicode ``` ### Manual User Settings File Edit -Edit `~/.juriko/user-settings.json`: +Edit `~/.kalicode/user-settings.json`: ```json { @@ -126,10 +126,10 @@ You can verify your current settings by examining the user settings file: ```bash # View current settings -cat ~/.juriko/user-settings.json +cat ~/.kalicode/user-settings.json # Check if environment variable is set -echo $JURIKO_CONDENSE_THRESHOLD +echo $KALICODE_CONDENSE_THRESHOLD ``` ## Model-Specific Considerations @@ -152,12 +152,12 @@ Different models have different token limits, which affects when condensing trig ### Issue: Settings not taking effect **Check**: -1. Environment variable value: `echo $JURIKO_CONDENSE_THRESHOLD` -2. User settings file: `cat ~/.juriko/user-settings.json` +1. Environment variable value: `echo $KALICODE_CONDENSE_THRESHOLD` +2. User settings file: `cat ~/.kalicode/user-settings.json` 3. Valid range (0-100) ### Issue: Invalid threshold values -**Note**: JURIKO automatically clamps values to 0-100 range. Invalid values default to 75%. +**Note**: KALICODE automatically clamps values to 0-100 range. Invalid values default to 75%. ## Best Practices @@ -178,12 +178,12 @@ You can create scripts to adjust thresholds based on context: # Set different thresholds for different projects if [[ "$PWD" == *"large-project"* ]]; then - export JURIKO_CONDENSE_THRESHOLD=85 # More context for complex projects + export KALICODE_CONDENSE_THRESHOLD=85 # More context for complex projects else - export JURIKO_CONDENSE_THRESHOLD=70 # Less context for simple tasks + export KALICODE_CONDENSE_THRESHOLD=70 # Less context for simple tasks fi -juriko +kalicode ``` ### Project-Specific Configuration @@ -192,14 +192,14 @@ Create project-specific threshold settings: ```bash # In your project directory -echo 'export JURIKO_CONDENSE_THRESHOLD=80' > .jurikorc -source .jurikorc -juriko +echo 'export KALICODE_CONDENSE_THRESHOLD=80' > .kalicoderc +source .kalicoderc +kalicode ``` ## Summary -The condense threshold is a powerful feature that helps JURIKO manage long conversations efficiently. By understanding and configuring this setting appropriately, you can optimize the balance between context preservation and token usage for your specific needs. +The condense threshold is a powerful feature that helps KALICODE manage long conversations efficiently. By understanding and configuring this setting appropriately, you can optimize the balance between context preservation and token usage for your specific needs. **Default**: 75% - Good for most users **Configuration**: Environment variable or user settings file diff --git a/README.md b/README.md index ef47b1a..1083c26 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# JURIKO CLI +# KALICODE CLI A conversational AI CLI tool with intelligent text editor capabilities and tool usage. @@ -14,7 +14,7 @@ A conversational AI CLI tool with intelligent text editor capabilities and tool - **๐Ÿ”ง Automatic Tool Selection**: AI intelligently chooses the right tools for your requests - **๐Ÿ’ฌ Interactive UI**: Beautiful terminal interface built with Ink - **โš™๏ธ Persistent Settings**: Save your preferred provider and model settings -- **๐ŸŒ Global Installation**: Install and use anywhere with `npm i -g @graphteon/juriko-cli` +- **๐ŸŒ Global Installation**: Install and use anywhere with `npm i -g @biznetgio/kalicode-cli` ## Installation @@ -28,13 +28,13 @@ A conversational AI CLI tool with intelligent text editor capabilities and tool ### Global Installation (Recommended) ```bash -npm install -g @graphteon/juriko-cli +npm install -g @biznetgio/kalicode-cli ``` ### Local Development ```bash git clone -cd juriko-cli +cd kalicode-cli npm install npm run build npm link @@ -44,7 +44,7 @@ npm link ### Multi-LLM Provider Support -JURIKO supports multiple AI providers. You can set up API keys for any or all of them: +KALICODE supports multiple AI providers. You can set up API keys for any or all of them: **Method 1: Environment Variables** ```bash @@ -70,13 +70,13 @@ cp .env.example .env **Method 3: Command Line Flags** ```bash -juriko --anthropic-key your_anthropic_key_here -juriko --openai-key your_openai_key_here -juriko --grok-key your_grok_key_here +kalicode --anthropic-key your_anthropic_key_here +kalicode --openai-key your_openai_key_here +kalicode --grok-key your_grok_key_here ``` **Method 4: User Settings File** -Create `~/.juriko/user-settings.json`: +Create `~/.kalicode/user-settings.json`: ```json { "provider": "anthropic", @@ -95,7 +95,7 @@ Create `~/.juriko/user-settings.json`: ### Local LLM Setup -JURIKO supports connecting to local LLM servers that expose OpenAI-compatible APIs. This includes popular local LLM solutions like: +KALICODE supports connecting to local LLM servers that expose OpenAI-compatible APIs. This includes popular local LLM solutions like: - **LM Studio**: Download and run models locally with a user-friendly interface - **Ollama**: Lightweight, extensible framework for running LLMs locally @@ -110,22 +110,22 @@ JURIKO supports connecting to local LLM servers that expose OpenAI-compatible AP 1. Download and install [LM Studio](https://lmstudio.ai/) 2. Download a model (e.g., Llama 2, Code Llama, Mistral) 3. Start the local server (usually runs on `http://localhost:1234/v1`) -4. Select "Local" provider in JURIKO and use the wizard +4. Select "Local" provider in KALICODE and use the wizard **Ollama:** 1. Install [Ollama](https://ollama.ai/) 2. Pull a model: `ollama pull llama2` 3. Start Ollama server: `ollama serve` (runs on `http://localhost:11434/v1`) -4. Select "Local" provider in JURIKO and configure +4. Select "Local" provider in KALICODE and configure **llama.cpp:** 1. Build llama.cpp with server support 2. Start server: `./server -m model.gguf --port 8080` -3. Use `http://localhost:8080/v1` as base URL in JURIKO +3. Use `http://localhost:8080/v1` as base URL in KALICODE #### Local LLM Configuration Wizard -When you select "Local" as your provider, JURIKO will guide you through a 4-step configuration wizard: +When you select "Local" as your provider, KALICODE will guide you through a 4-step configuration wizard: 1. **Base URL**: Enter your local server URL (e.g., `http://localhost:1234/v1`) 2. **Model Name**: Specify the model name your server uses @@ -136,7 +136,7 @@ The wizard includes helpful examples and validates your configuration before pro ### Provider Selection -When you first run JURIKO, you'll be presented with an interactive interface to: +When you first run KALICODE, you'll be presented with an interactive interface to: 1. **Select your preferred LLM provider** (Anthropic, OpenAI, Grok, or Local) 2. **Choose a model** from the available options for that provider @@ -146,7 +146,7 @@ When you first run JURIKO, you'll be presented with an interactive interface to: You can change providers anytime by: - Typing `provider` or `switch` in the chat - Pressing `Ctrl+P` for quick provider switching -- Running `juriko` again to go through the selection process +- Running `kalicode` again to go through the selection process ### Supported Models @@ -176,29 +176,29 @@ You can change providers anytime by: Start the conversational AI assistant: ```bash -juriko +kalicode ``` Or specify a working directory: ```bash -juriko -d /path/to/project +kalicode -d /path/to/project ``` ### Response Style Options -Control the verbosity and communication style of JURIKO responses: +Control the verbosity and communication style of KALICODE responses: ```bash # Concise mode - short, direct responses (< 4 lines) -juriko --concise +kalicode --concise # Verbose mode - detailed explanations and context -juriko --verbose +kalicode --verbose # Security level control -juriko --security-level high # Strict validation -juriko --security-level medium # Standard validation (default) -juriko --security-level low # Basic validation +kalicode --security-level high # Strict validation +kalicode --security-level medium # Standard validation (default) +kalicode --security-level low # Basic validation ``` **Response Style Benefits:** @@ -212,15 +212,15 @@ Enable parallel execution of independent tools for improved performance: ```bash # Enable batching (parallel execution) -juriko --enable-batching +kalicode --enable-batching # Disable batching (sequential execution) -juriko --disable-batching +kalicode --disable-batching ``` Or via environment variable: ```bash -export JURIKO_ENABLE_BATCHING=true # or 'false' +export KALICODE_ENABLE_BATCHING=true # or 'false' ``` **Performance Benefits:** @@ -241,15 +241,15 @@ Enhanced file navigation with clickable references inspired by Claude Code patte ```bash # Enable code references (enabled by default) -juriko --enable-code-references +kalicode --enable-code-references # Disable code references -juriko --disable-code-references +kalicode --disable-code-references ``` Or via environment variable: ```bash -export JURIKO_ENABLE_CODE_REFERENCES=true # or 'false' +export KALICODE_ENABLE_CODE_REFERENCES=true # or 'false' ``` **Features:** @@ -266,7 +266,7 @@ export JURIKO_ENABLE_CODE_REFERENCES=true # or 'false' ### First Run Experience -On your first run, JURIKO will guide you through: +On your first run, KALICODE will guide you through: 1. **Provider Selection**: Choose from Anthropic, OpenAI, or Grok 2. **Model Selection**: Pick the best model for your needs @@ -279,19 +279,19 @@ You can easily switch between providers and models: - Type `provider` or `switch` in the chat - Press `Ctrl+P` for quick access -- Your preferences are automatically saved to `~/.juriko/user-settings.json` +- Your preferences are automatically saved to `~/.kalicode/user-settings.json` ### Custom Instructions -You can provide custom instructions to tailor JURIKO's behavior to your project by creating a `.juriko/JURIKO.md` file in your project directory: +You can provide custom instructions to tailor KALICODE's behavior to your project by creating a `.kalicode/KALICODE.md` file in your project directory: ```bash -mkdir .juriko +mkdir .kalicode ``` -Create `.juriko/JURIKO.md` with your custom instructions: +Create `.kalicode/KALICODE.md` with your custom instructions: ```markdown -# Custom Instructions for JURIKO CLI +# Custom Instructions for KALICODE CLI Always use TypeScript for any new code files. When creating React components, use functional components with hooks. @@ -300,11 +300,11 @@ Always add JSDoc comments for public functions and interfaces. Follow the existing code style and patterns in this project. ``` -JURIKO will automatically load and follow these instructions when working in your project directory. The custom instructions are added to JURIKO's system prompt and take priority over default behavior. +KALICODE will automatically load and follow these instructions when working in your project directory. The custom instructions are added to KALICODE's system prompt and take priority over default behavior. ## Example Conversations -Instead of typing commands, just tell JURIKO what you want to do: +Instead of typing commands, just tell KALICODE what you want to do: ``` ๐Ÿ’ฌ "Show me the contents of package.json" @@ -343,19 +343,19 @@ The package.json contains your project configuration including dependencies like ### Using with Local LLMs -JURIKO works seamlessly with local LLM servers. Here are some examples: +KALICODE works seamlessly with local LLM servers. Here are some examples: ```bash # Using with LM Studio (Code Llama for coding tasks) -juriko # Select Local provider, use http://localhost:1234/v1 +kalicode # Select Local provider, use http://localhost:1234/v1 # Using with Ollama (Llama 2 for general tasks) ollama serve -juriko # Select Local provider, use http://localhost:11434/v1 +kalicode # Select Local provider, use http://localhost:11434/v1 # Using with custom llama.cpp server ./server -m codellama-7b.gguf --port 8080 -juriko # Select Local provider, use http://localhost:8080/v1 +kalicode # Select Local provider, use http://localhost:8080/v1 ``` Local LLMs are particularly useful for: @@ -366,11 +366,11 @@ Local LLMs are particularly useful for: ## MCP Integration -JURIKO supports the Model Context Protocol (MCP), allowing you to connect to external tools and resources through MCP servers. This extends JURIKO's capabilities beyond built-in tools. +KALICODE supports the Model Context Protocol (MCP), allowing you to connect to external tools and resources through MCP servers. This extends KALICODE's capabilities beyond built-in tools. ### MCP Configuration -Create `~/.juriko/mcp-settings.json` to configure MCP servers: +Create `~/.kalicode/mcp-settings.json` to configure MCP servers: ```json { @@ -450,14 +450,14 @@ Examples : ### Available MCP Tools -Once configured, MCP tools become available in JURIKO with the naming pattern `mcp_{server}_{tool}`. For example: +Once configured, MCP tools become available in KALICODE with the naming pattern `mcp_{server}_{tool}`. For example: - `mcp_filesystem_read_file` - Read files through filesystem server - `mcp_brave_search_web_search` - Search the web using Brave Search - `mcp_weather_get_forecast` - Get weather data from a weather server ### MCP Resources -MCP servers can also provide resources (data sources) that JURIKO can access for context, such as: +MCP servers can also provide resources (data sources) that KALICODE can access for context, such as: - File contents from filesystem servers - API responses from web services - Database query results @@ -469,7 +469,7 @@ For detailed MCP setup and troubleshooting, see [`docs/MCP_INTEGRATION.md`](docs ### Token Management & Conversation Condensing -JURIKO includes automatic conversation condensing to manage token usage efficiently. When conversations approach the model's token limit, JURIKO automatically summarizes older messages while preserving recent context. +KALICODE includes automatic conversation condensing to manage token usage efficiently. When conversations approach the model's token limit, KALICODE automatically summarizes older messages while preserving recent context. **Condense Threshold Configuration:** @@ -477,16 +477,16 @@ The condense threshold determines when conversation condensing is triggered (def ```bash # Set via environment variable (highest priority) -export JURIKO_CONDENSE_THRESHOLD=80 -juriko +export KALICODE_CONDENSE_THRESHOLD=80 +kalicode # Or set for single session -JURIKO_CONDENSE_THRESHOLD=85 juriko +KALICODE_CONDENSE_THRESHOLD=85 kalicode ``` **User Settings Configuration:** -Edit `~/.juriko/user-settings.json`: +Edit `~/.kalicode/user-settings.json`: ```json { "provider": "anthropic", diff --git a/docs/CODE_REFERENCE_FEATURE.md b/docs/CODE_REFERENCE_FEATURE.md index 20a4a05..b1e385e 100644 --- a/docs/CODE_REFERENCE_FEATURE.md +++ b/docs/CODE_REFERENCE_FEATURE.md @@ -2,7 +2,7 @@ ## Overview -The Code Reference System brings Claude Code-inspired clickable file references to JURIKO CLI, enabling seamless navigation between the terminal and your code editor. This feature automatically enhances tool outputs with clickable links that open directly in VSCode. +The Code Reference System brings Claude Code-inspired clickable file references to KALICODE CLI, enabling seamless navigation between the terminal and your code editor. This feature automatically enhances tool outputs with clickable links that open directly in VSCode. ## Features @@ -30,17 +30,17 @@ The Code Reference System brings Claude Code-inspired clickable file references ```bash # Enable code references (default) -juriko --enable-code-references +kalicode --enable-code-references # Disable code references -juriko --disable-code-references +kalicode --disable-code-references ``` ### Environment Variables ```bash # Enable/disable code references -export JURIKO_ENABLE_CODE_REFERENCES=true # or 'false' +export KALICODE_ENABLE_CODE_REFERENCES=true # or 'false' ``` ### Reference Formats @@ -261,7 +261,7 @@ The test suite validates: ### Debug Mode Enable debug logging for reference processing: ```bash -export JURIKO_DEBUG_REFERENCES=true +export KALICODE_DEBUG_REFERENCES=true ``` ## Future Enhancements @@ -301,4 +301,4 @@ export JURIKO_DEBUG_REFERENCES=true --- -*This feature is part of the Claude Code-inspired improvement plan for JURIKO CLI, bringing professional-grade code navigation to the terminal experience.* \ No newline at end of file +*This feature is part of the Claude Code-inspired improvement plan for KALICODE CLI, bringing professional-grade code navigation to the terminal experience.* \ No newline at end of file diff --git a/docs/CONDENSE_FEATURE.md b/docs/CONDENSE_FEATURE.md index 7334672..7f3051d 100644 --- a/docs/CONDENSE_FEATURE.md +++ b/docs/CONDENSE_FEATURE.md @@ -1,6 +1,6 @@ # Conversation Condense Feature -The JURIKO CLI includes an intelligent conversation condensing feature that automatically manages token usage to prevent hitting context window limits while preserving important conversation context. +The KALICODE CLI includes an intelligent conversation condensing feature that automatically manages token usage to prevent hitting context window limits while preserving important conversation context. ## How It Works @@ -58,7 +58,7 @@ The system automatically detects token limits for different models: - Handles user confirmation for manual condensing - Integrates with the confirmation system -3. **Agent Integration** (`src/agent/juriko-agent.ts`) +3. **Agent Integration** (`src/agent/kalicode-agent.ts`) - Automatic token monitoring in streaming responses - Seamless integration with existing conversation flow - Updates both message history and chat display @@ -107,4 +107,4 @@ The system gracefully handles various error conditions: - **API Failures**: Falls back gracefully if condensing fails - **User Cancellation**: Respects user choice to cancel condensing -This feature ensures that JURIKO CLI can handle extended conversations and complex tasks without being limited by token constraints. \ No newline at end of file +This feature ensures that KALICODE CLI can handle extended conversations and complex tasks without being limited by token constraints. \ No newline at end of file diff --git a/docs/MCP_INTEGRATION.md b/docs/MCP_INTEGRATION.md index fed82a7..0863ab7 100644 --- a/docs/MCP_INTEGRATION.md +++ b/docs/MCP_INTEGRATION.md @@ -1,6 +1,6 @@ # MCP (Model Context Protocol) Integration -JURIKO CLI now supports MCP (Model Context Protocol) integration, allowing you to connect to local and remote MCP servers to extend the AI's capabilities with additional tools and resources. +KALICODE CLI now supports MCP (Model Context Protocol) integration, allowing you to connect to local and remote MCP servers to extend the AI's capabilities with additional tools and resources. ## Overview @@ -8,17 +8,17 @@ The MCP integration provides: - Support for local (stdio), HTTP stream, and SSE MCP servers - Automatic tool discovery and integration - Resource access from MCP servers -- Configuration management through `~/.juriko/mcp-settings.json` +- Configuration management through `~/.kalicode/mcp-settings.json` - Connection status monitoring and error handling ## Configuration -MCP servers are configured through the `~/.juriko/mcp-settings.json` file. This file is automatically created with example configurations when you first run JURIKO CLI. +MCP servers are configured through the `~/.kalicode/mcp-settings.json` file. This file is automatically created with example configurations when you first run KALICODE CLI. ### Configuration File Location ``` -~/.juriko/mcp-settings.json +~/.kalicode/mcp-settings.json ``` ### Configuration Structure @@ -175,7 +175,7 @@ SSE servers communicate via Server-Sent Events over HTTP. ## Tool Usage -Once MCP servers are configured and connected, their tools become available in JURIKO with the naming pattern `mcp_{server}_{tool}`. +Once MCP servers are configured and connected, their tools become available in KALICODE with the naming pattern `mcp_{server}_{tool}`. ### Examples @@ -186,7 +186,7 @@ Once MCP servers are configured and connected, their tools become available in J ## Resource Access -MCP servers can also provide resources (data sources) that JURIKO can access for context: +MCP servers can also provide resources (data sources) that KALICODE can access for context: - File contents from filesystem servers - API responses from web services @@ -242,7 +242,7 @@ Enable debug logging by setting: ### Log Files -MCP logs are integrated with JURIKO's logging system. Check the console output for connection status and error messages. +MCP logs are integrated with KALICODE's logging system. Check the console output for connection status and error messages. ## Security Considerations @@ -300,4 +300,4 @@ MCP logs are integrated with JURIKO's logging system. Check the console output f } ``` -This configuration provides filesystem access, web search capabilities, and connection to a remote API server, giving JURIKO a comprehensive set of tools to work with. \ No newline at end of file +This configuration provides filesystem access, web search capabilities, and connection to a remote API server, giving KALICODE a comprehensive set of tools to work with. \ No newline at end of file diff --git a/docs/RESPONSE_STYLE_FEATURE.md b/docs/RESPONSE_STYLE_FEATURE.md index 8c40e09..a713559 100644 --- a/docs/RESPONSE_STYLE_FEATURE.md +++ b/docs/RESPONSE_STYLE_FEATURE.md @@ -1,10 +1,10 @@ -# Response Style Feature - JURIKO CLI +# Response Style Feature - KALICODE CLI This document describes the new response style feature that provides concise communication modes inspired by Claude Code patterns. ## Overview -The Response Style feature allows users to control the verbosity and communication style of JURIKO CLI responses, enabling more efficient interactions for different use cases. +The Response Style feature allows users to control the verbosity and communication style of KALICODE CLI responses, enabling more efficient interactions for different use cases. ## Features @@ -32,13 +32,13 @@ The Response Style feature allows users to control the verbosity and communicati ```bash # Enable concise mode -juriko --concise +kalicode --concise -# Enable verbose mode -juriko --verbose +# Enable verbose mode +kalicode --verbose # Default balanced mode -juriko +kalicode # Test response formatting npm run test:response-style @@ -48,9 +48,9 @@ npm run test:response-style ```bash # Set security validation level -juriko --security-level low # Basic validation -juriko --security-level medium # Standard validation (default) -juriko --security-level high # Strict validation with malicious code detection +kalicode --security-level low # Basic validation +kalicode --security-level medium # Standard validation (default) +kalicode --security-level high # Strict validation with malicious code detection ``` ## Implementation Details @@ -146,19 +146,19 @@ npm run build npm run typecheck # Test different modes -juriko --concise -juriko --verbose -juriko --security-level high +kalicode --concise +kalicode --verbose +kalicode --security-level high ``` ## Environment Variables ```bash # Set response style -export JURIKO_RESPONSE_STYLE=concise|verbose|balanced +export KALICODE_RESPONSE_STYLE=concise|verbose|balanced # Set security level -export JURIKO_SECURITY_LEVEL=low|medium|high +export KALICODE_SECURITY_LEVEL=low|medium|high ``` ## Benefits @@ -211,7 +211,7 @@ export JURIKO_SECURITY_LEVEL=low|medium|high ### Debug Commands ```bash # Check current configuration -juriko --help +kalicode --help # Test response formatting node examples/test-concise-mode.js @@ -220,4 +220,4 @@ node examples/test-concise-mode.js npm run build && npm run typecheck ``` -This feature brings JURIKO CLI closer to Claude Code's efficient communication patterns while maintaining flexibility for different user needs. \ No newline at end of file +This feature brings KALICODE CLI closer to Claude Code's efficient communication patterns while maintaining flexibility for different user needs. \ No newline at end of file diff --git a/docs/STOP_CONVERSATION_FEATURE.md b/docs/STOP_CONVERSATION_FEATURE.md index cb70d6f..b3e190c 100644 --- a/docs/STOP_CONVERSATION_FEATURE.md +++ b/docs/STOP_CONVERSATION_FEATURE.md @@ -1,13 +1,13 @@ # Stop Conversation Feature ## Overview -The JURIKO CLI now includes a convenient way to stop ongoing conversations and operations by pressing the 's' key. +The KALICODE CLI now includes a convenient way to stop ongoing conversations and operations by pressing the 's' key. ## Features Added ### 1. Stop Conversation with 's' Key - **Functionality**: Press 's' during any processing operation to immediately stop it -- **Scope**: Works in both JurikoAgent and MultiLLMAgent modes +- **Scope**: Works in both KalicodeAgent and MultiLLMAgent modes - **Feedback**: Shows a clear message when operation is stopped: "โน๏ธ Operation stopped by user (pressed 's')" ### 2. Enhanced Processing Animation @@ -48,13 +48,13 @@ The JURIKO CLI now includes a convenient way to stop ongoing conversations and o - Added instruction text about 's' key functionality ### Agent Integration -- Both `JurikoAgent` and `MultiLLMAgent` already had `abortCurrentOperation()` methods +- Both `KalicodeAgent` and `MultiLLMAgent` already had `abortCurrentOperation()` methods - Uses `AbortController` to properly cancel ongoing operations - Graceful handling of cancellation in streaming operations ## Usage Examples -1. **Start a long operation**: Ask JURIKO to perform a complex task +1. **Start a long operation**: Ask KALICODE to perform a complex task 2. **Stop the operation**: Press 's' while it's processing 3. **See confirmation**: The interface shows "โน๏ธ Operation stopped by user (pressed 's')" 4. **Continue normally**: You can immediately start a new conversation diff --git a/package.json b/package.json index 3adac2e..cdf7a72 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { - "name": "@graphteon/juriko-cli", + "name": "@biznetgio/kalicode-cli", "version": "0.3.3", - "description": "JURIKO - An open-source AI agent that brings the power of AI directly into your terminal.", + "description": "KALICODE - An open-source AI agent that brings the power of AI directly into your terminal.", "main": "dist/index.js", "bin": { - "juriko": "dist/index.js" + "kalicode": "dist/index.js" }, "scripts": { "build": "tsc", @@ -17,7 +17,7 @@ "cli", "agent", "text-editor", - "juriko", + "kalicode", "ai" ], "author": "anak10thn ", diff --git a/src/agent/multi-llm-agent.ts b/src/agent/multi-llm-agent.ts index 340d9fd..4c4cee8 100644 --- a/src/agent/multi-llm-agent.ts +++ b/src/agent/multi-llm-agent.ts @@ -305,7 +305,7 @@ export class MultiLLMAgent extends EventEmitter { } private getResponseStyleFromEnv(): ResponseStyle { - const styleEnv = process.env.JURIKO_RESPONSE_STYLE; + const styleEnv = process.env.KALICODE_RESPONSE_STYLE; switch (styleEnv) { case 'concise': @@ -318,7 +318,7 @@ export class MultiLLMAgent extends EventEmitter { } private getSecurityLevelFromEnv(): 'low' | 'medium' | 'high' { - const level = process.env.JURIKO_SECURITY_LEVEL; + const level = process.env.KALICODE_SECURITY_LEVEL; if (level === 'low' || level === 'medium' || level === 'high') { return level; } @@ -326,12 +326,12 @@ export class MultiLLMAgent extends EventEmitter { } private getBatchingEnabledFromEnv(): boolean { - const enabled = process.env.JURIKO_ENABLE_BATCHING?.toLowerCase(); + const enabled = process.env.KALICODE_ENABLE_BATCHING?.toLowerCase(); return enabled === 'true' || enabled === '1'; } private getCodeReferencesEnabledFromEnv(): boolean { - const enabled = process.env.JURIKO_ENABLE_CODE_REFERENCES?.toLowerCase(); + const enabled = process.env.KALICODE_ENABLE_CODE_REFERENCES?.toLowerCase(); return enabled !== 'false' && enabled !== '0'; // Default to true unless explicitly disabled } @@ -1167,7 +1167,7 @@ export class MultiLLMAgent extends EventEmitter { if (systemMsg?.content) { return typeof systemMsg.content === 'string' ? systemMsg.content : JSON.stringify(systemMsg.content); } - return "You are JURIKO CLI, an AI assistant that helps with file editing, coding tasks, and system operations."; + return "You are KALICODE CLI, an AI assistant that helps with file editing, coding tasks, and system operations."; })() } ); diff --git a/src/agent/prompts/system-prompt-builder.ts b/src/agent/prompts/system-prompt-builder.ts index d45a427..d479446 100644 --- a/src/agent/prompts/system-prompt-builder.ts +++ b/src/agent/prompts/system-prompt-builder.ts @@ -32,7 +32,7 @@ export class SystemPromptBuilder { } private static getBasePrompt(workingDirectory: string): string { - return `You are JURIKO CLI, an AI assistant that helps with file editing, coding tasks, and system operations. + return `You are KALICODE CLI, an AI assistant that helps with file editing, coding tasks, and system operations. You have access to these tools: - view_file: View file contents or directory listings diff --git a/src/index.ts b/src/index.ts index dc686c2..3ad4f68 100755 --- a/src/index.ts +++ b/src/index.ts @@ -27,13 +27,13 @@ dotenv.config(); // Load API key from user settings if not in environment function loadApiKey(): string | undefined { // First check environment variables - let apiKey = process.env.JURIKO_API_KEY; + let apiKey = process.env.KALICODE_API_KEY; if (!apiKey) { // Try to load from user settings file try { const homeDir = os.homedir(); - const settingsFile = path.join(homeDir, '.juriko', 'user-settings.json'); + const settingsFile = path.join(homeDir, '.kalicode', 'user-settings.json'); if (fs.existsSync(settingsFile)) { const settings = JSON.parse(fs.readFileSync(settingsFile, 'utf8')); @@ -50,13 +50,13 @@ function loadApiKey(): string | undefined { // Load base URL from user settings if not in environment function loadBaseURL(): string | undefined { // First check environment variables - let baseURL = process.env.JURIKO_BASE_URL; + let baseURL = process.env.KALICODE_BASE_URL; if (!baseURL) { // Try to load from user settings file try { const homeDir = os.homedir(); - const settingsFile = path.join(homeDir, '.juriko', 'user-settings.json'); + const settingsFile = path.join(homeDir, '.kalicode', 'user-settings.json'); if (fs.existsSync(settingsFile)) { const settings = JSON.parse(fs.readFileSync(settingsFile, 'utf8')); @@ -71,14 +71,14 @@ function loadBaseURL(): string | undefined { } program - .name("juriko") + .name("kalicode") .description( - "JURIKO - A conversational AI CLI tool with text editor capabilities" + "KALICODE - A conversational AI CLI tool with text editor capabilities" ) .version(packageJson.version) .option("-d, --directory ", "set working directory", process.cwd()) - .option("-k, --api-key ", "AI API key (or set JURIKO_API_KEY env var)") - .option("-u, --base-url ", "AI API base URL (or set JURIKO_BASE_URL env var)") + .option("-k, --api-key ", "AI API key (or set KALICODE_API_KEY env var)") + .option("-u, --base-url ", "AI API base URL (or set KALICODE_BASE_URL env var)") .option("--concise", "enable concise response mode (< 4 lines)") .option("--verbose", "enable verbose response mode with explanations") .option("--security-level ", "set security validation level (low|medium|high)", "medium") @@ -102,43 +102,43 @@ program try { // Set API keys from command line options if provided if (options.apiKey) { - process.env.JURIKO_API_KEY = options.apiKey; + process.env.KALICODE_API_KEY = options.apiKey; } // Set response style options if (options.concise) { - process.env.JURIKO_RESPONSE_STYLE = 'concise'; + process.env.KALICODE_RESPONSE_STYLE = 'concise'; } else if (options.verbose) { - process.env.JURIKO_RESPONSE_STYLE = 'verbose'; + process.env.KALICODE_RESPONSE_STYLE = 'verbose'; } // Set security level if (options.securityLevel) { - process.env.JURIKO_SECURITY_LEVEL = options.securityLevel; + process.env.KALICODE_SECURITY_LEVEL = options.securityLevel; } // Set batching options if (options.enableBatching) { - process.env.JURIKO_ENABLE_BATCHING = 'true'; + process.env.KALICODE_ENABLE_BATCHING = 'true'; } else if (options.disableBatching) { - process.env.JURIKO_ENABLE_BATCHING = 'false'; + process.env.KALICODE_ENABLE_BATCHING = 'false'; } // Set code reference options if (options.enableCodeReferences) { - process.env.JURIKO_ENABLE_CODE_REFERENCES = 'true'; + process.env.KALICODE_ENABLE_CODE_REFERENCES = 'true'; } else if (options.disableCodeReferences) { - process.env.JURIKO_ENABLE_CODE_REFERENCES = 'false'; + process.env.KALICODE_ENABLE_CODE_REFERENCES = 'false'; } - logger.info("๐Ÿค– Starting JURIKO CLI with Multi-LLM Provider Support...\n"); + logger.info("๐Ÿค– Starting KALICODE CLI with Multi-LLM Provider Support...\n"); const app = render(React.createElement(AppWithProvider, {})); // Handle graceful shutdown const handleShutdown = async () => { try { - logger.info("Shutting down JURIKO CLI..."); + logger.info("Shutting down KALICODE CLI..."); await mcpManager.shutdown(); process.exit(0); } catch (error: any) { @@ -156,7 +156,7 @@ program handleShutdown(); }); } catch (error: any) { - logger.error("โŒ Error initializing JURIKO CLI:", error.message); + logger.error("โŒ Error initializing KALICODE CLI:", error.message); process.exit(1); } }); @@ -190,7 +190,7 @@ settingsCmd .action(async () => { try { const settings = await getEffectiveSettings(); - console.log('\n๐Ÿ”ง Current JURIKO Settings:'); + console.log('\n๐Ÿ”ง Current KALICODE Settings:'); console.log('โ”€'.repeat(40)); console.log(`Response Style: ${settings.responseStyle}`); console.log(`Multi-Tool Batching (BETA): ${settings.enableBatching ? 'ON' : 'OFF'}`); diff --git a/src/juriko/client.ts b/src/juriko/client.ts index 7fa4717..d86bb7e 100644 --- a/src/juriko/client.ts +++ b/src/juriko/client.ts @@ -52,7 +52,7 @@ export class JurikoClient { constructor(apiKey: string, model?: string, baseURL?: string) { this.client = new OpenAI({ apiKey, - baseURL: baseURL || process.env.JURIKO_BASE_URL || "https://api.x.ai/v1", + baseURL: baseURL || process.env.KALICODE_BASE_URL || "https://api.x.ai/v1", timeout: 360000, }); if (model) { diff --git a/src/mcp/client.ts b/src/mcp/client.ts index 2d95000..cf7b33e 100644 --- a/src/mcp/client.ts +++ b/src/mcp/client.ts @@ -23,7 +23,7 @@ export class JurikoMCPClient { logger.info(`Connecting to MCP server: ${serverName} (${config.type})`); const client = new MCPClient({ - name: 'juriko-cli', + name: 'kalicode-cli', version: '1.0.0' }); diff --git a/src/mcp/settings-manager.ts b/src/mcp/settings-manager.ts index 57c406e..8471dc0 100644 --- a/src/mcp/settings-manager.ts +++ b/src/mcp/settings-manager.ts @@ -10,12 +10,12 @@ export class MCPSettingsManager { constructor() { const homeDir = os.homedir(); - const jurikoDir = path.join(homeDir, '.juriko'); - this.settingsPath = path.join(jurikoDir, 'mcp-settings.json'); - - // Ensure .juriko directory exists - if (!fs.existsSync(jurikoDir)) { - fs.mkdirSync(jurikoDir, { recursive: true }); + const kalicodeDir = path.join(homeDir, '.kalicode'); + this.settingsPath = path.join(kalicodeDir, 'mcp-settings.json'); + + // Ensure .kalicode directory exists + if (!fs.existsSync(kalicodeDir)) { + fs.mkdirSync(kalicodeDir, { recursive: true }); } } diff --git a/src/ui/app-with-provider.tsx b/src/ui/app-with-provider.tsx index 8ede33d..47f6b76 100644 --- a/src/ui/app-with-provider.tsx +++ b/src/ui/app-with-provider.tsx @@ -109,7 +109,7 @@ export default function AppWithProvider({ agent: initialAgent }: Props) { useEffect(() => { if (appState === 'ready' && !hasShownWelcome) { logger.clear(); - cfonts.say("#JURIKO", { + cfonts.say("#KALICODE", { font: "block", align: "left", colors: ["magenta", "gray"], @@ -124,7 +124,7 @@ export default function AppWithProvider({ agent: initialAgent }: Props) { logger.info("Tips for getting started:"); logger.info("1. Ask questions, edit files, or run commands."); logger.info("2. Be specific for the best results."); - logger.info("3. Create JURIKO.md files to customize your interactions with JURIKO."); + logger.info("3. Create KALICODE.md files to customize your interactions with KALICODE."); logger.info("4. /help for more information."); logger.info(""); @@ -256,7 +256,7 @@ export default function AppWithProvider({ agent: initialAgent }: Props) { if (appState === 'loading') { return ( - ๐Ÿ”ง Loading JURIKO... + ๐Ÿ”ง Loading KALICODE... ); } diff --git a/src/ui/components/local-llm-wizard.tsx b/src/ui/components/local-llm-wizard.tsx index a7e1d1f..8415310 100644 --- a/src/ui/components/local-llm-wizard.tsx +++ b/src/ui/components/local-llm-wizard.tsx @@ -285,7 +285,7 @@ export const LocalLLMWizard: React.FC = ({ - {saveConfig ? 'โœ“' : 'โ—‹'} Save configuration to ~/.juriko/user-settings.json + {saveConfig ? 'โœ“' : 'โ—‹'} Save configuration to ~/.kalicode/user-settings.json (Press Tab to toggle) diff --git a/src/ui/components/mcp-loading.tsx b/src/ui/components/mcp-loading.tsx index 5dfa806..986d535 100644 --- a/src/ui/components/mcp-loading.tsx +++ b/src/ui/components/mcp-loading.tsx @@ -149,7 +149,7 @@ export default function MCPLoading({ onComplete, onError }: MCPLoadingProps) { - ๐Ÿ”ง JURIKO - Initializing MCP System + ๐Ÿ”ง KALICODE - Initializing MCP System diff --git a/src/ui/components/multi-provider-api-key-input.tsx b/src/ui/components/multi-provider-api-key-input.tsx index 7cba537..72f0952 100644 --- a/src/ui/components/multi-provider-api-key-input.tsx +++ b/src/ui/components/multi-provider-api-key-input.tsx @@ -142,7 +142,7 @@ export const MultiProviderApiKeyInput: React.FC = - {saveKey ? 'โœ“' : 'โ—‹'} Save API key to ~/.juriko/user-settings.json + {saveKey ? 'โœ“' : 'โ—‹'} Save API key to ~/.kalicode/user-settings.json (Press Tab to toggle) diff --git a/src/ui/components/settings-menu.tsx b/src/ui/components/settings-menu.tsx index 375a372..57b273d 100644 --- a/src/ui/components/settings-menu.tsx +++ b/src/ui/components/settings-menu.tsx @@ -183,7 +183,7 @@ export const SettingsMenu: React.FC = ({ onClose }) => { return ( - โš™๏ธ JURIKO Settings + โš™๏ธ KALICODE Settings {menuItems.map((item, index) => ( @@ -217,7 +217,7 @@ export const SettingsMenu: React.FC = ({ onClose }) => { โ€ข Multi-Tool Batching: Execute multiple tools in parallel โ€ข Code References: Clickable file links in VSCode - Settings saved to: ~/.juriko/user-settings.json + Settings saved to: ~/.kalicode/user-settings.json ); diff --git a/src/utils/condense.ts b/src/utils/condense.ts index ab97ecf..0215123 100644 --- a/src/utils/condense.ts +++ b/src/utils/condense.ts @@ -33,7 +33,7 @@ export async function condenseConversation( const { maxMessagesToKeep = 3, customCondensePrompt, - systemPrompt = "You are JURIKO CLI, an AI assistant that helps with file editing, coding tasks, and system operations.", + systemPrompt = "You are KALICODE CLI, an AI assistant that helps with file editing, coding tasks, and system operations.", taskId, isAutomaticTrigger = false } = options; diff --git a/src/utils/custom-instructions.ts b/src/utils/custom-instructions.ts index 67ba3e7..2258e27 100644 --- a/src/utils/custom-instructions.ts +++ b/src/utils/custom-instructions.ts @@ -4,7 +4,7 @@ import { logger } from './logger'; export function loadCustomInstructions(workingDirectory: string = process.cwd()): string | null { try { - const instructionsPath = path.join(workingDirectory, '.juriko', 'JURIKO.md'); + const instructionsPath = path.join(workingDirectory, '.kalicode', 'KALICODE.md'); if (!fs.existsSync(instructionsPath)) { return null; diff --git a/src/utils/logger.ts b/src/utils/logger.ts index cc21895..65f2b00 100644 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -181,7 +181,7 @@ export const logger = Logger.getInstance({ level: getLogLevelFromEnv(), enableColors: true, enableTimestamp: true, - prefix: 'JURIKO', + prefix: 'KALICODE', }); // Export convenience functions diff --git a/src/utils/user-settings.ts b/src/utils/user-settings.ts index 8df30d0..83d071c 100644 --- a/src/utils/user-settings.ts +++ b/src/utils/user-settings.ts @@ -37,7 +37,7 @@ export interface UserSettings { securityLevel?: 'low' | 'medium' | 'high'; } -const SETTINGS_DIR = path.join(os.homedir(), '.juriko'); +const SETTINGS_DIR = path.join(os.homedir(), '.kalicode'); const SETTINGS_FILE = path.join(SETTINGS_DIR, 'user-settings.json'); export async function ensureSettingsDirectory(): Promise { @@ -107,13 +107,13 @@ export async function saveApiKey(provider: LLMProvider, apiKey: string): Promise export function getApiKeyFromEnv(provider: LLMProvider): string | undefined { switch (provider) { case 'anthropic': - return process.env.ANTHROPIC_API_KEY || process.env.JURIKO_ANTHROPIC_API_KEY; + return process.env.ANTHROPIC_API_KEY || process.env.KALICODE_ANTHROPIC_API_KEY; case 'openai': - return process.env.OPENAI_API_KEY || process.env.JURIKO_OPENAI_API_KEY; + return process.env.OPENAI_API_KEY || process.env.KALICODE_OPENAI_API_KEY; case 'grok': - return process.env.GROK_API_KEY || process.env.JURIKO_GROK_API_KEY; + return process.env.GROK_API_KEY || process.env.KALICODE_GROK_API_KEY; case 'local': - return process.env.LOCAL_LLM_API_KEY || process.env.JURIKO_LOCAL_LLM_API_KEY; + return process.env.LOCAL_LLM_API_KEY || process.env.KALICODE_LOCAL_LLM_API_KEY; default: return undefined; } @@ -152,13 +152,13 @@ export async function getBaseURLFromSettings(provider: LLMProvider): Promise { /** * Get condense threshold from environment variable or user settings - * Environment variable: JURIKO_CONDENSE_THRESHOLD (0-100) + * Environment variable: KALICODE_CONDENSE_THRESHOLD (0-100) */ export async function getCondenseThresholdWithEnv(): Promise { // First try environment variable - const envThreshold = process.env.JURIKO_CONDENSE_THRESHOLD; + const envThreshold = process.env.KALICODE_CONDENSE_THRESHOLD; if (envThreshold) { const parsed = parseInt(envThreshold, 10); if (!isNaN(parsed) && parsed >= 0 && parsed <= 100) { @@ -235,7 +235,7 @@ export async function getCondenseThresholdWithEnv(): Promise { */ export async function getResponseStyle(): Promise<'concise' | 'verbose' | 'balanced'> { // First try environment variable - const envStyle = process.env.JURIKO_RESPONSE_STYLE; + const envStyle = process.env.KALICODE_RESPONSE_STYLE; if (envStyle === 'concise' || envStyle === 'verbose' || envStyle === 'balanced') { return envStyle; } @@ -271,14 +271,14 @@ export async function getBetaFeatures(): Promise<{ enableBatching: boolean; enab let enableCodeReferences = userSettings.settings?.enableCodeReferences ?? false; // Environment variable overrides - const envBatching = process.env.JURIKO_ENABLE_BATCHING?.toLowerCase(); + const envBatching = process.env.KALICODE_ENABLE_BATCHING?.toLowerCase(); if (envBatching === 'true' || envBatching === '1') { enableBatching = true; } else if (envBatching === 'false' || envBatching === '0') { enableBatching = false; } - const envCodeReferences = process.env.JURIKO_ENABLE_CODE_REFERENCES?.toLowerCase(); + const envCodeReferences = process.env.KALICODE_ENABLE_CODE_REFERENCES?.toLowerCase(); if (envCodeReferences === 'true' || envCodeReferences === '1') { enableCodeReferences = true; } else if (envCodeReferences === 'false' || envCodeReferences === '0') { @@ -311,7 +311,7 @@ export async function saveBetaFeatures(enableBatching: boolean, enableCodeRefere */ export async function getSecurityLevel(): Promise<'low' | 'medium' | 'high'> { // First try environment variable - const envLevel = process.env.JURIKO_SECURITY_LEVEL; + const envLevel = process.env.KALICODE_SECURITY_LEVEL; if (envLevel === 'low' || envLevel === 'medium' || envLevel === 'high') { return envLevel; } diff --git a/test/batch-execution-test.js b/test/batch-execution-test.js index 4e91642..824ed33 100644 --- a/test/batch-execution-test.js +++ b/test/batch-execution-test.js @@ -162,9 +162,9 @@ async function runTests() { await testDependencyDetection(); console.log('\n๐ŸŽฏ All tests completed successfully!'); - console.log('\n๐Ÿ’ก To enable batching in juriko-cli, use:'); - console.log(' juriko --enable-batching'); - console.log(' or set JURIKO_ENABLE_BATCHING=true'); + console.log('\n๐Ÿ’ก To enable batching in kalicode-cli, use:'); + console.log(' kalicode --enable-batching'); + console.log(' or set KALICODE_ENABLE_BATCHING=true'); } catch (error) { console.error('\nโŒ Test suite failed:', error.message); diff --git a/test/condense-threshold-config-test.js b/test/condense-threshold-config-test.js index 6554bab..9a3affd 100644 --- a/test/condense-threshold-config-test.js +++ b/test/condense-threshold-config-test.js @@ -57,12 +57,12 @@ async function testCondenseThresholdConfig() { console.log('\n4. Testing Environment Variable Override:'); // Set environment variable - process.env.JURIKO_CONDENSE_THRESHOLD = '85'; + process.env.KALICODE_CONDENSE_THRESHOLD = '85'; const envThreshold = await getCondenseThresholdWithEnv(); console.log(` Environment variable (85%) -> Got ${envThreshold}%: ${envThreshold === 85 ? 'โœ…' : 'โŒ'}`); // Clean up environment variable - delete process.env.JURIKO_CONDENSE_THRESHOLD; + delete process.env.KALICODE_CONDENSE_THRESHOLD; // Test 5: Functional testing with different thresholds console.log('\n5. Testing Functional Behavior:'); @@ -101,7 +101,7 @@ async function testCondenseThresholdConfig() { console.log('\n7. Configuration Summary:'); console.log(' โœ… Default threshold: 75%'); console.log(' โœ… User-configurable via settings file'); - console.log(' โœ… Environment variable override (JURIKO_CONDENSE_THRESHOLD)'); + console.log(' โœ… Environment variable override (KALICODE_CONDENSE_THRESHOLD)'); console.log(' โœ… Input validation (0-100%)'); console.log(' โœ… Async and sync versions available'); console.log(' โœ… Functional behavior verified'); diff --git a/test/condense.test.js b/test/condense.test.js index a49bd17..f257584 100644 --- a/test/condense.test.js +++ b/test/condense.test.js @@ -18,7 +18,7 @@ const mockLLMConfig = { const mockMessages = [ { role: 'system', - content: 'You are JURIKO CLI, an AI assistant that helps with file editing, coding tasks, and system operations.' + content: 'You are KALICODE CLI, an AI assistant that helps with file editing, coding tasks, and system operations.' }, { role: 'user', diff --git a/test/response-style-test.js b/test/response-style-test.js index 743945d..26a1d05 100644 --- a/test/response-style-test.js +++ b/test/response-style-test.js @@ -8,7 +8,7 @@ const { spawn } = require('child_process'); const path = require('path'); -const JURIKO_PATH = path.join(__dirname, '..', 'dist', 'index.js'); +const KALICODE_PATH = path.join(__dirname, '..', 'dist', 'index.js'); async function testResponseStyle(mode, testMessage) { console.log(`\n๐Ÿงช Testing ${mode.toUpperCase()} mode:`); @@ -16,7 +16,7 @@ async function testResponseStyle(mode, testMessage) { console.log('โ”€'.repeat(50)); return new Promise((resolve, reject) => { - const args = ['node', JURIKO_PATH]; + const args = ['node', KALICODE_PATH]; if (mode === 'concise') { args.push('--concise'); @@ -30,7 +30,7 @@ async function testResponseStyle(mode, testMessage) { ...process.env, // Use a test API key or mock ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY || 'test-key', - JURIKO_TEST_MODE: 'true' + KALICODE_TEST_MODE: 'true' } }); @@ -78,7 +78,7 @@ async function testResponseStyle(mode, testMessage) { } async function runTests() { - console.log('๐Ÿš€ JURIKO CLI Response Style Testing'); + console.log('๐Ÿš€ KALICODE CLI Response Style Testing'); console.log('Testing concise vs verbose response modes...\n'); const testMessages = [ diff --git a/test/token-counting-fix-verification.js b/test/token-counting-fix-verification.js index 44309e5..c817ff7 100644 --- a/test/token-counting-fix-verification.js +++ b/test/token-counting-fix-verification.js @@ -61,7 +61,7 @@ async function testTokenCountingFixes() { // Test 4: Simulate conversation with tool calls to verify token counting console.log('\n4. Testing Conversation Token Counting:'); const mockMessages = [ - { role: 'system', content: 'You are JURIKO CLI, an AI assistant that helps with file editing, coding tasks, and system operations.' }, + { role: 'system', content: 'You are KALICODE CLI, an AI assistant that helps with file editing, coding tasks, and system operations.' }, { role: 'user', content: 'Hello, can you help me create a React component?' }, { role: 'assistant', content: 'I\'d be happy to help you create a React component! Let me first check your project structure.', tool_calls: [ { diff --git a/test/token-counting-issue-test.js b/test/token-counting-issue-test.js index 4c2c01e..49678fc 100644 --- a/test/token-counting-issue-test.js +++ b/test/token-counting-issue-test.js @@ -51,7 +51,7 @@ async function testTokenCountingIssue() { // Test 3: Simulate conversation growth console.log('\n3. Testing Conversation Growth Simulation:'); const mockMessages = [ - { role: 'system', content: 'You are JURIKO CLI, an AI assistant.' }, + { role: 'system', content: 'You are KALICODE CLI, an AI assistant.' }, { role: 'user', content: 'Hello, can you help me with a complex task?' }, { role: 'assistant', content: 'I\'d be happy to help! What do you need assistance with?' }, { role: 'user', content: 'I need to create multiple files and run several commands.' }, diff --git a/test/token-display-accuracy-test.js b/test/token-display-accuracy-test.js index 4576ec3..0fd1674 100644 --- a/test/token-display-accuracy-test.js +++ b/test/token-display-accuracy-test.js @@ -29,7 +29,7 @@ async function testTokenDisplayAccuracy() { const testMessages = [ { role: 'system', - content: 'You are JURIKO CLI, an AI assistant that helps with file editing, coding tasks, and system operations.' + content: 'You are KALICODE CLI, an AI assistant that helps with file editing, coding tasks, and system operations.' }, { role: 'user',