### Initial Development Setup
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/developer/development_workflow.md
Recommended initial setup involves starting the Electron app in one terminal and the development server in another.
```bash
# Terminal 1: Start Electron (leave running)
electron .
# Terminal 2: Start development server
./bin/dev_server.sh
```
--------------------------------
### Start Development Server with Rake
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/developer/development_workflow.md
Use this command for initial setup or when starting from a clean state. It automates Docker and server startup with extra logging.
```bash
rake server:debug
```
--------------------------------
### Start Services in CI/CD
Source: https://github.com/yohasebe/monadic-chat/blob/main/docker/services/ruby/spec/e2e/README.md
Example configuration for starting services before running end-to-end tests in a CI/CD pipeline, such as GitHub Actions. Includes building and starting Docker containers, and running a local server.
```yaml
# Example GitHub Actions configuration
- name: Start services
run: |
./docker/monadic.sh build
./docker/monadic.sh start
rake server &
sleep 10
```
--------------------------------
### Setup NLTK and spaCy with Common Datasets
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs/advanced-topics/advanced-configuration.md
This script installs common NLTK packages and spaCy English language models. It's recommended to place this in `~/monadic/config/pysetup.sh` for post-setup execution.
```bash
#!/usr/bin/env bash
set -euo pipefail
# NLTK packages
python - <<'PY'
import nltk
for pkg in ["punkt","stopwords","averaged_perceptron_tagger","wordnet","omw-1.4","vader_lexicon"]:
nltk.download(pkg, raise_on_error=True)
PY
# spaCy models
python -m spacy download en_core_web_sm
python -m spacy download en_core_web_lg
```
--------------------------------
### Build and Start Monadic Chat Containers
Source: https://github.com/yohasebe/monadic-chat/blob/main/docker/services/ruby/spec/integration/README.md
Build and start the necessary Docker containers for Monadic Chat. Ensure Docker is installed and running before executing these commands.
```bash
./docker/monadic.sh build
./docker/monadic.sh start
```
--------------------------------
### Check Build Log for Install Options
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/docker-build-caching.md
Use grep to find 'Install options' in the Docker build log to verify configuration.
```bash
grep "Install options" ~/monadic/log/docker_build_python.log
```
--------------------------------
### AI Prompt Path Example
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/ruby_service/path_handling_guide.md
Illustrates how AI prompt paths can be relative or user-friendly, shown in a system prompt example.
```markdown
Save generated images to the shared folder using only the filename.
Display them with:
```
--------------------------------
### Setup spaCy Japanese Models and NLTK Corpora
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs/advanced-topics/advanced-configuration.md
This script installs spaCy Japanese language models and additional NLTK corpora. Choose one Japanese model based on your needs.
```bash
#!/usr/bin/env bash
set -euo pipefail
# spaCy Japanese models (pick one)
python -m spacy download ja_core_news_sm
# or: ja_core_news_md / ja_core_news_lg
# NLTK extra corpora
python - <<'PY'
import nltk
for pkg in ["brown","reuters","movie_reviews","conll2000","wordnet_ic"]:
nltk.download(pkg, raise_on_error=True)
PY
```
--------------------------------
### Serve Ollama on Linux
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs/advanced-topics/ollama.md
Start the Ollama server manually on Linux. Ensure Ollama is running before starting Monadic Chat.
```bash
ollama serve
```
--------------------------------
### App Naming Convention Example
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs/advanced-topics/code_structure.md
Ensure your app's file name, app definition name, and Ruby class name are consistent. This example shows the required matching pattern.
```text
File: chat_assistant_openai.mdsl
App name: app "ChatAssistantOpenAI"
Class name: class ChatAssistantOpenAI < MonadicApp
```
--------------------------------
### Install OS Packages and Python Libraries
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs/docker-integration/python-container.md
This snippet shows how to update package lists, install necessary OS packages like MeCab for Japanese text processing, and then install the corresponding Python library. It includes cleanup steps to reduce image size.
```sh
apt-get update && apt-get install -y --no-install-recommends \
mecab libmecab-dev mecab-utils mecab-ipadic-utf8 \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
pip install --no-cache-dir mecab-python3
```
--------------------------------
### Install Ruby Dependencies
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/ruby_service/development.md
Installs project dependencies using Bundler. Run this after cloning the repository and navigating to the Ruby services directory.
```bash
bundle install
```
--------------------------------
### Starting the MCP Server
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/developer/claude_code_mcp_integration.md
Use `rake server:debug` for development mode, which is recommended for MCP development. For production, use `npm start` to run the Electron app.
```bash
# Development mode (recommended for MCP development)
rake server:debug
```
```bash
# Production mode
npm start # Electron app
```
--------------------------------
### Install WSL2 on Windows
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs/getting-started/installation.md
Use this command in PowerShell as administrator to install WSL2 and the Ubuntu distribution on Windows.
```shell
> wsl --install -d Ubuntu
```
--------------------------------
### GitHub Actions CI/CD Configuration for Ruby Service E2E Tests
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/ruby_service/testing/e2e.md
An example GitHub Actions workflow demonstrating how to build and start services, then execute end-to-end RSpec tests for the Ruby service within a CI environment.
```yaml
# Example GitHub Actions configuration
- name: Start services
run: |
./docker/monadic.sh build
./docker/monadic.sh start
rake server &
sleep 10
- name: Run E2E tests
run: |
cd docker/services/ruby
bundle exec rspec spec/e2e --format documentation
```
--------------------------------
### Minimal Dockerfile for a Custom Container
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs/advanced-topics/adding-containers.md
A basic Dockerfile to build a custom container. It starts from an Ubuntu base image, installs dependencies, copies necessary files, sets the working directory, and keeps the container running. Replace placeholders with your actual requirements.
```dockerfile
FROM ubuntu:22.04
# Install your dependencies
RUN apt-get update && apt-get install -y \
your-packages-here && \
rm -rf /var/lib/apt/lists/*
# Copy your files
COPY your-script.sh /usr/local/bin/
# Set working directory
WORKDIR /data
# Keep container running
CMD ["tail", "-f", "/dev/null"]
```
--------------------------------
### Install Dependencies and Run No-Mock Tests
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/frontend/no_mock/README.md
Commands to install project dependencies and execute no-mock tests. Includes options for running all tests, watching for changes, and targeting specific test files.
```bash
# Install dependencies first
npm install
# Run all no-mock tests
npm run test:no-mock
# Run in watch mode for development
npm run test:no-mock:watch
# Run a specific test file
npm run test:no-mock message-input.test.js
```
--------------------------------
### Install NLP Libraries with uv
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs/docker-integration/python-container.md
Use this snippet to install a set of common NLP libraries and models using uv for faster installation. It also includes commands to download NLTK datasets and spaCy English models.
```sh
# Example: NLP libraries and models
uv pip install --no-cache \
scikit-learn gensim librosa wordcloud nltk textblob spacy==3.7.5
python -m nltk.downloader all
python -m spacy download en_core_web_lg
```
--------------------------------
### Reset Setup Scripts using Script
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/developer/development_workflow.md
Use this script to restore the original versions of `pysetup.sh` and `rbsetup.sh` from git.
```bash
./docker/services/reset_setup_scripts.sh
```
--------------------------------
### Manually Reset Setup Scripts using Git
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/developer/development_workflow.md
Manually reset the Python and Ruby setup scripts to their original versions using `git checkout`.
```bash
git checkout -- docker/services/python/pysetup.sh docker/services/ruby/rbsetup.sh
```
--------------------------------
### Install Python Libraries with uv or pip
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs/faq.md
Use this script to permanently install Python libraries. Changes persist across container restarts.
```bash
# ~/monadic/config/pysetup.sh
# Using uv (recommended)
uv pip install --no-cache pandas numpy scikit-learn
# Or using pip
pip install pandas numpy scikit-learn
```
--------------------------------
### Initial Greeting Guidance
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/developer/tool_loop_prevention_testing.md
When starting a new session, greet the user with text only and do not call any tools.
```markdown
## Initial Greeting (Important)
When starting a new session with no prior user messages, simply greet the user.
Do NOT call any tools for the initial greeting - just respond with text.
```
--------------------------------
### Configure Install Options via Config File
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs/reference/configuration.md
Set environment variables in the `~/monadic/config/env` file to enable specific package installations. This method requires rebuilding the Python container.
```bash
# ~/monadic/config/env
INSTALL_LATEX=true
PYOPT_NLTK=true
PYOPT_LIBROSA=true
```
--------------------------------
### Start Server in Debug Mode
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/server-debug-mode.md
Use this command to start the Monadic server in debug mode. This command also provides access to the application and documentation.
```bash
# Start server in debug mode
rake server:debug
# Access the application
open http://localhost:4567/
# Access documentation (in debug mode only)
open http://localhost:4567/docs/ # External docs
open http://localhost:4567/docs_dev/ # Internal docs
```
--------------------------------
### Install NLP Libraries with pip
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs/docker-integration/python-container.md
This snippet demonstrates the traditional method of installing NLP libraries and models using pip. It includes commands for downloading NLTK datasets and spaCy English models.
```sh
# Example: NLP libraries and models
pip install --no-cache-dir --default-timeout=1000 \
scikit-learn gensim librosa wordcloud nltk textblob spacy==3.7.5
python -m nltk.downloader all
python -m spacy download en_core_web_lg
```
--------------------------------
### Example Content Generation Request
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs/getting-started/quick-start.md
Ask the AI to create a Python script for generating a Fibonacci sequence.
```text
Can you write a short Python script that generates a Fibonacci sequence?
```
--------------------------------
### Augmenting Prompt with New Options
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/system_prompt_injection.md
Example of how to pass new options to the SystemPromptInjector.augment method.
```ruby
augmented_prompt = Monadic::Utils::SystemPromptInjector.augment(
base_prompt: initial_prompt,
session: session,
options: {
websearch_enabled: websearch_enabled,
# Add your new option here
my_setting: obj["my_setting"]
}
)
```
--------------------------------
### Ruby Filesystem Path Usage
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/ruby_service/path_handling_guide.md
Example of constructing and reading a file using the environment-aware data path in Ruby.
```ruby
data_dir = Monadic::Utils::Environment.data_path
file_path = File.join(data_dir, "report.pdf")
File.read(file_path)
```
--------------------------------
### Help System Configuration Example
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs/advanced-topics/help-system.md
Set environment variables to customize chunk size, overlap, and results per search. Larger chunks provide more context but may reduce search precision.
```bash
HELP_CHUNK_SIZE=4000
HELP_OVERLAP_SIZE=600
HELP_CHUNKS_PER_RESULT=5
```
--------------------------------
### Start Development Server with Shell Script
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/developer/development_workflow.md
Recommended for day-to-day development. This script provides a fast startup assuming Docker Desktop is already running.
```bash
./bin/dev_server.sh
```
--------------------------------
### String Parameters Example
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/mdsl/mdsl_type_reference.md
Defines application display name, icon, description (single or multi-language), and system prompt. Ensure required fields like 'display_name' are provided.
```ruby
app "ChatOpenAI" do
display_name "Chat"
icon "comment"
description "A conversational AI assistant"
# Or multi-language description
description do
en "A conversational AI assistant"
ja "会話型AIアシスタント"
zh "对话型AI助手"
end
system_prompt <<~PROMPT
You are a helpful assistant.
PROMPT
llm do
provider "openai"
end
end
```
--------------------------------
### Example Web Search Query
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs/getting-started/quick-start.md
Ask a current question to trigger a web search and get up-to-date information.
```text
What are the latest developments in AI this week?
```
--------------------------------
### Build Strategy: Default Options
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/docker-build-caching.md
When no install options are selected, the system fetches a prebuilt default image instead of performing a local build. This significantly reduces build time.
```text
No install options selected — fetching the prebuilt Python image
```
--------------------------------
### Absolute Path Resolution Example
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/docs-link-checker.md
Demonstrates how absolute paths in markdown links are resolved relative to the documentation root. This applies to links starting with '/'.
```markdown
[Link](/advanced-topics/sample-foo.md)
→ Resolves to: docs/advanced-topics/sample-foo.md
[Link](/ja/frontend/)
→ Resolves to: docs_dev/ja/frontend/README.md
```
--------------------------------
### App Directory Structure Example
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs/advanced-topics/develop_apps.md
Illustrates the recommended folder structure for organizing application files, including MDSL, Ruby tools, helper modules, and service definitions.
```text
~/$
└── monadic
└── data
├── apps
│ └── my_app
│ ├── my_app_openai.mdsl
│ ├── my_app_claude.mdsl
│ ├── my_app_tools.rb
│ └── my_app_constants.rb (optional)
├── helpers
│ └── my_helper.rb
└── services
└── my_service
├── compose.yml
└── Dockerfile
```
--------------------------------
### Run E2E Tests in CI/CD
Source: https://github.com/yohasebe/monadic-chat/blob/main/docker/services/ruby/spec/e2e/README.md
Example configuration for running end-to-end RSpec tests within a CI/CD pipeline. This snippet assumes services have already been started.
```yaml
- name: Run E2E tests
run: |
cd docker/services/ruby
bundle exec rspec spec/e2e --format documentation
```
--------------------------------
### Build Help Database Dump
Source: https://github.com/yohasebe/monadic-chat/blob/main/docker/services/ruby/apps/monadic_help/README.md
Builds the help database dump from documentation files. Use `rebuild` to drop the existing dump first.
```bash
rake help:build
```
```bash
rake help:rebuild
```
--------------------------------
### Run a Single Suite with Options
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/test_runner.md
Demonstrates how to run a specific test suite with custom options such as API level, format, and Docker usage. This allows for targeted testing and configuration.
```bash
rake test:run[suite,opts]
```
--------------------------------
### Start Server Tasks
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/developer/rake_tasks.md
Tasks to start the Monadic Chat server. Use `rake start` or `rake server:start` for daemon mode, and `rake debug` or `rake server:debug` for foreground mode with extra logging.
```bash
# Start the server in daemon mode
rake start
rake server:start
```
```bash
# Start the server in debug mode (foreground, EXTRA_LOGGING=true)
rake debug
rake server:debug
```
--------------------------------
### Environment Module Usage Example
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/ruby_service/docs/environment_module.md
Demonstrates how to check if the service is running in a container and how to retrieve various paths and PostgreSQL connection parameters using the Environment module.
```ruby
# Check environment
if Monadic::Utils::Environment.in_container?
# Container-specific logic
end
# Get database connection
conn = PG.connect(Monadic::Utils::Environment.postgres_params)
# Get paths
data_path = Monadic::Utils::Environment.data_path
scripts_path = Monadic::Utils::Environment.scripts_path
apps_path = Monadic::Utils::Environment.apps_path
```
--------------------------------
### Install Python Packages
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs/docker-integration/docker-access.md
Commands to install additional Python packages within the Python container. Use `uv pip` for recommended installations.
```shell
uv pip install --no-cache package_name
```
```shell
pip install package_name
```
--------------------------------
### Install Python Packages in JupyterLab
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs/docker-integration/jupyterlab.md
Use this command within a Jupyter notebook cell to install additional Python packages. The `uv pip install` method is recommended for better performance.
```bash
!uv pip install --no-cache package_name
```
```bash
!pip install package_name
```
--------------------------------
### Rate Limit Configuration Example
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/testing.md
This Ruby code shows how to configure per-provider Query Per Second (QPS) limits, which are crucial for respecting API rate limits and ensuring stable test execution.
```ruby
# Per-provider QPS limits (see table in "Real API smoke defaults" section)
# Example: OpenAI at 0.5 QPS = ~2 second spacing between requests
API_RATE_QPS_OPENAI=0.5
API_RATE_QPS_ANTHROPIC=0.5
API_RATE_QPS_GEMINI=0.4
```
--------------------------------
### Example Chat Message
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs/getting-started/quick-start.md
Use this example message to initiate a conversation about artificial intelligence.
```text
Hello! Tell me about artificial intelligence and its applications.
```
--------------------------------
### Start Development Server, Skip Docker Check
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/developer/development_workflow.md
An advanced option for the fastest startup by skipping Docker daemon verification. Use only when certain Docker is running.
```bash
SKIP_DOCKER_CHECK=true ./bin/dev_server.sh
```
--------------------------------
### MCP Error Response Example
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs/advanced-topics/mcp-integration.md
Example of an error response from the MCP server, indicating invalid parameters.
```json
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32602,
"message": "Parameter error: missing keyword: text",
"data": "Required parameters: text\nOptional parameters: top_n\nProvided parameters: query"
}
}
```
--------------------------------
### Initialize Build Options and UI Settings
Source: https://github.com/yohasebe/monadic-chat/blob/main/app/settings.html
Initializes build options snapshots and sets the UI language based on provided data. Tracks the initial UI language for potential reverts.
```javascript
buildOptionsSnapshots = data._BUILD_OPTIONS_SNAPSHOTS || {};
recomputeRebuildBadges();
document.getElementById('ui-language').value = data.UI_LANGUAGE || 'en';
// Sync UI language and track initial value for discard revert
initialLanguage = data.UI_LANGUAGE || 'en';
settingsI18n.setLanguage(initialLanguage);
```
--------------------------------
### MCP Server Startup Logic
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/developer/claude_code_mcp_integration.md
Illustrates the core methods for handling tool lists and tool calls within the MCP server. These methods are invoked by the stdio wrapper.
```ruby
def handle_tools_list(id, params)
# Returns all tools from APPS with caching
end
def handle_tool_call(id, params)
# Executes tool_name on app_instance
# Format: AppName__tool_name
end
```
--------------------------------
### Tool Flow Example
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs/advanced-topics/monadic-mode.md
Illustrates the sequence of operations in Monadic Mode: loading context, processing the request, saving updated context with the response, and finally displaying the response.
```text
User Message
↓
load_context() → Retrieve existing state
↓
Process request (may call other tools)
↓
save_context(message, topics, people, notes) → Persist state
↓
Response displayed to user
```
--------------------------------
### Promise-Based i18n Initialization and Usage
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/developer/frontend-architecture.md
Demonstrates how to initialize the i18n system using Promises and access translations once ready. Includes a safe translation helper that works even before initialization.
```javascript
// Global Promise for i18n readiness
window.i18nReady = webUIi18n.ready();
// Wait for initialization
window.i18nReady.then(() => {
const text = webUIi18n.t('ui.messages.readyForInput');
$("#status").text(text);
});
// Safe translation helper (works before initialization)
const text = safeTranslate('ui.messages.readyForInput', 'Ready for input');
```
--------------------------------
### Install Monadic Chat on Linux
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs/getting-started/installation.md
Install the Monadic Chat package on Debian-based Linux systems using the downloaded .deb file.
```shell
$ sudo apt install ./monadic-chat-*.deb
```
--------------------------------
### Info Message Example
Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/logging.md
Example of an info message to be rendered in the #messages pane. It includes HTML formatting and an icon with specific styling.
```html
[HTML]:
Checking orchestration health . . .
``` -------------------------------- ### Manage Application State and Parameters Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/developer/frontend-architecture.md Illustrates how to set the current application, its parameters, and retrieve this information. Useful for configuring different modes or features within the application. ```javascript // Set current app and parameters SessionState.setCurrentApp('Chat', { model: 'gpt-4', temperature: 0.7 }); // Update app parameters SessionState.updateAppParams({ temperature: 0.9 }); // Get current app const app = SessionState.getCurrentApp(); // Get app parameters const params = SessionState.getAppParams(); ``` -------------------------------- ### Install Python Libraries Temporarily Source: https://github.com/yohasebe/monadic-chat/blob/main/docs/faq.md Use these commands for temporary Python library installation within the app. These changes are lost on container restart. ```python # Using uv (recommended) !uv pip install --no-cache library_name # Or using pip !pip install library_name ``` -------------------------------- ### Check Server Logs with EXTRA_LOGGING Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/server-debug-mode.md This example shows typical log output when `EXTRA_LOGGING` is enabled, which can help in diagnosing documentation 404 errors. ```text [DEBUG_MODE] Docs_dev request: requested_path='', docs_dev_root='/path/to/docs_dev' [DEBUG_MODE] Trying to serve: /path/to/docs_dev/index.html ``` -------------------------------- ### OpenAI Reasoning Effort Example Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/custom_model_configuration.md Example configuration for OpenAI's reasoning_effort parameter. This controls the reasoning intensity for supported OpenAI models. ```json ["minimal", "low", "medium", "high"], "low" ``` -------------------------------- ### Error Message Example Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/logging.md Example of an error message that will be rendered in the #messages pane with error styling. It uses a specific tag to indicate an error. ```plaintext [ERROR]: Something bad happened ``` -------------------------------- ### Run Full Test Suite with Media Tests Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/test_quickref.md Execute the complete test suite, including media tests. This is the slowest option and requires all API keys to be configured. ```bash rake test:profile[full] ``` -------------------------------- ### xAI Reasoning Effort Example Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/custom_model_configuration.md Example configuration for xAI's reasoning_effort parameter. This specifies the available options for reasoning effort in xAI models. ```json ["low", "high"], "low" ``` -------------------------------- ### Build Help Database Dump Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/ruby_service/apps/monadic_help.md Builds the help database dump from documentation files. Use `rake help:rebuild` to drop the existing dump first. ```bash rake help:build ``` ```bash rake help:rebuild ``` ```bash rake help:stats ``` -------------------------------- ### Claude Thinking Budget Example Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/custom_model_configuration.md Example configuration for Claude's thinking_budget parameter. This defines the token budget for thinking operations in Claude models. ```json {"min": 1024, "default": 10000, "max": null} ``` -------------------------------- ### Build Strategy: Option Changes Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/docker-build-caching.md When any install option is enabled or changed, a local build is performed using the prebuilt image as a cache source. This ensures that only the layers related to the changed options are rebuilt. ```text [INFO] Install options changed: INSTALL_LATEX(false→true) ``` -------------------------------- ### Detect Thinking Block Start (Claude) Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/ruby_service/thinking_reasoning_display.md Detects the start of a 'thinking' content block from Claude events. Stores and sends thinking block data to the UI. ```ruby # Detect thinking block start if event["type"] == "content_block_start" current_block_type = event.dig("content_block", "type") if current_block_type == "thinking" thinking = event.dig("content_block", "thinking") # Store and send to UI end end ``` -------------------------------- ### Start Ruby Server with Rake Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/ruby_service/testing/e2e.md Ensures the Ruby server is started using the rake task. This is a prerequisite for running end-to-end tests that rely on the server being operational. ```bash rake server ``` -------------------------------- ### Test Enabling LaTeX Build Source: https://github.com/yohasebe/monadic-chat/blob/main/docs_dev/docker-build-caching.md This snippet shows how to enable LaTeX installation during the Docker build process by setting an environment variable and verifying the installation count. ```bash # Set INSTALL_LATEX=true in config echo "INSTALL_LATEX=true" >> ~/monadic/config/env # Build via Electron menu # Verify: dpkg -l | grep -i latex | wc -l → should be 100+ ```