From a567f75f257a98369e517ab33ab40d75904b22a9 Mon Sep 17 00:00:00 2001 From: Marius Date: Tue, 27 Jan 2026 17:28:53 +0200 Subject: [PATCH] Reorganize oracle/ and chatbot/ into proxmox/ per LXC/VM structure - Move oracle/migration-scripts/ to proxmox/lxc108-oracle/migration/ - Move oracle/roa/ and oracle/roa-romconstruct/ to proxmox/lxc108-oracle/sql/ - Move oracle/standby-server-scripts/ to proxmox/vm109-windows-dr/ - Move chatbot/ to proxmox/lxc104-flowise/ - Update proxmox/README.md with new structure and navigation - Update all documentation with correct directory references - Remove unused input/claude-agent-sdk/ files Co-Authored-By: Claude Opus 4.5 --- input/claude-agent-sdk/README.md | 148 -- .../claude-agent-sdk-documentation.md | 1542 ----------------- proxmox/README.md | 105 +- .../lxc104-flowise/README.md | 32 +- .../lxc104-flowise/docs}/prd.md | 5 + .../lxc104-flowise/docs}/v1-arhitectura.md | 8 +- .../lxc104-flowise/docs}/v2-arhitectura.md | 8 + proxmox/lxc108-oracle/README.md | 34 +- .../migration}/00-MASTER-MIGRATION.bat | 0 .../migration}/00-MASTER-MIGRATION.sh | 0 .../migration}/00-install-oracle21c-xe.sh | 0 .../migration}/01-setup-oracle21c.sh | 0 .../migration}/02-export-oracle10g.bat | 0 .../migration}/02-export-source.sh | 0 .../migration}/03-transfer-to-oracle21c.sh | 0 .../migration}/04-import-to-oracle21c.sh | 0 .../migration}/05-create-synonyms-grants.sh | 0 .../migration}/06-finalize-migration.sh | 0 .../lxc108-oracle/migration}/README-MAIN.md | 0 .../migration}/README-UPGRADE-IN-PLACE.md | 0 .../lxc108-oracle/migration}/README.md | 9 +- .../migration}/export-sys-objects.sql | 0 .../lxc108-oracle/migration}/sys_objects.sql | 0 .../sql}/roa-romconstruct/PACK_CONTAFIN.pck | 0 .../sql}/roa/INSTRUCTIUNI_ORACLE10G.txt | 0 .../sql}/roa/README_ORACLE10G.md | 2 + .../lxc108-oracle/sql}/roa/scrie_jc_2007.sql | 0 .../sql}/roa/scrie_jc_2007_oracle10g.sql | 0 .../scrie_jc_2007_original_merge_backup.sql | 0 .../lxc108-oracle/sql}/roa/scrie_jv_2007.sql | 0 .../vm109-windows-dr}/README.md | 38 +- .../docs}/PLAN_TESTARE_MONITORIZARE.md | 5 +- .../docs}/PROXMOX_NOTIFICATIONS_README.md | 3 + .../archive/DR_UPGRADE_TO_CUMULATIVE_PLAN.md | 0 .../docs}/archive/DR_VM_MIGRATION_GUIDE.md | 0 .../DR_WINDOWS_VM_IMPLEMENTATION_PLAN.md | 0 .../DR_WINDOWS_VM_STATUS_2025-10-09.md | 0 .../scripts}/add_system_key_dr.ps1 | 0 .../scripts}/cleanup_database.ps1 | 0 .../scripts}/configure_listener_dr.ps1 | 0 .../scripts}/copy_existing_key_to_proxmox.ps1 | 0 .../scripts}/fix_ssh_via_service.ps1 | 0 .../vm109-windows-dr/scripts}/initROA.ora | 0 .../scripts}/oracle-backup-monitor-proxmox.sh | 0 .../vm109-windows-dr/scripts}/rman_backup.bat | 0 .../vm109-windows-dr/scripts}/rman_backup.txt | 0 .../scripts}/rman_backup_incremental.bat | 0 .../scripts}/rman_backup_incremental.txt | 0 .../scripts}/rman_restore_from_zero.ps1 | 0 .../scripts}/transfer_backups.ps1 | 0 .../scripts}/weekly-dr-test-proxmox.sh | 0 51 files changed, 233 insertions(+), 1706 deletions(-) delete mode 100644 input/claude-agent-sdk/README.md delete mode 100644 input/claude-agent-sdk/claude-agent-sdk-documentation.md rename chatbot/infrastructura.md => proxmox/lxc104-flowise/README.md (80%) rename {chatbot => proxmox/lxc104-flowise/docs}/prd.md (99%) rename {chatbot => proxmox/lxc104-flowise/docs}/v1-arhitectura.md (94%) rename {chatbot => proxmox/lxc104-flowise/docs}/v2-arhitectura.md (97%) rename {oracle/migration-scripts => proxmox/lxc108-oracle/migration}/00-MASTER-MIGRATION.bat (100%) rename {oracle/migration-scripts => proxmox/lxc108-oracle/migration}/00-MASTER-MIGRATION.sh (100%) rename {oracle/migration-scripts => proxmox/lxc108-oracle/migration}/00-install-oracle21c-xe.sh (100%) rename {oracle/migration-scripts => proxmox/lxc108-oracle/migration}/01-setup-oracle21c.sh (100%) rename {oracle/migration-scripts => proxmox/lxc108-oracle/migration}/02-export-oracle10g.bat (100%) rename {oracle/migration-scripts => proxmox/lxc108-oracle/migration}/02-export-source.sh (100%) rename {oracle/migration-scripts => proxmox/lxc108-oracle/migration}/03-transfer-to-oracle21c.sh (100%) rename {oracle/migration-scripts => proxmox/lxc108-oracle/migration}/04-import-to-oracle21c.sh (100%) rename {oracle/migration-scripts => proxmox/lxc108-oracle/migration}/05-create-synonyms-grants.sh (100%) rename {oracle/migration-scripts => proxmox/lxc108-oracle/migration}/06-finalize-migration.sh (100%) rename {oracle/migration-scripts => proxmox/lxc108-oracle/migration}/README-MAIN.md (100%) rename {oracle/migration-scripts => proxmox/lxc108-oracle/migration}/README-UPGRADE-IN-PLACE.md (100%) rename {oracle/migration-scripts => proxmox/lxc108-oracle/migration}/README.md (93%) rename {oracle/migration-scripts => proxmox/lxc108-oracle/migration}/export-sys-objects.sql (100%) rename {oracle/migration-scripts => proxmox/lxc108-oracle/migration}/sys_objects.sql (100%) rename {oracle => proxmox/lxc108-oracle/sql}/roa-romconstruct/PACK_CONTAFIN.pck (100%) rename {oracle => proxmox/lxc108-oracle/sql}/roa/INSTRUCTIUNI_ORACLE10G.txt (100%) rename {oracle => proxmox/lxc108-oracle/sql}/roa/README_ORACLE10G.md (94%) rename {oracle => proxmox/lxc108-oracle/sql}/roa/scrie_jc_2007.sql (100%) rename {oracle => proxmox/lxc108-oracle/sql}/roa/scrie_jc_2007_oracle10g.sql (100%) rename {oracle => proxmox/lxc108-oracle/sql}/roa/scrie_jc_2007_original_merge_backup.sql (100%) rename {oracle => proxmox/lxc108-oracle/sql}/roa/scrie_jv_2007.sql (100%) rename {oracle/standby-server-scripts => proxmox/vm109-windows-dr}/README.md (90%) rename {oracle/standby-server-scripts => proxmox/vm109-windows-dr/docs}/PLAN_TESTARE_MONITORIZARE.md (96%) rename {oracle/standby-server-scripts => proxmox/vm109-windows-dr/docs}/PROXMOX_NOTIFICATIONS_README.md (95%) rename {oracle/standby-server-scripts => proxmox/vm109-windows-dr/docs}/archive/DR_UPGRADE_TO_CUMULATIVE_PLAN.md (100%) rename {oracle/standby-server-scripts => proxmox/vm109-windows-dr/docs}/archive/DR_VM_MIGRATION_GUIDE.md (100%) rename {oracle/standby-server-scripts => proxmox/vm109-windows-dr/docs}/archive/DR_WINDOWS_VM_IMPLEMENTATION_PLAN.md (100%) rename {oracle/standby-server-scripts => proxmox/vm109-windows-dr/docs}/archive/DR_WINDOWS_VM_STATUS_2025-10-09.md (100%) rename {oracle/standby-server-scripts => proxmox/vm109-windows-dr/scripts}/add_system_key_dr.ps1 (100%) rename {oracle/standby-server-scripts => proxmox/vm109-windows-dr/scripts}/cleanup_database.ps1 (100%) rename {oracle/standby-server-scripts => proxmox/vm109-windows-dr/scripts}/configure_listener_dr.ps1 (100%) rename {oracle/standby-server-scripts => proxmox/vm109-windows-dr/scripts}/copy_existing_key_to_proxmox.ps1 (100%) rename {oracle/standby-server-scripts => proxmox/vm109-windows-dr/scripts}/fix_ssh_via_service.ps1 (100%) rename {oracle/standby-server-scripts => proxmox/vm109-windows-dr/scripts}/initROA.ora (100%) rename {oracle/standby-server-scripts => proxmox/vm109-windows-dr/scripts}/oracle-backup-monitor-proxmox.sh (100%) rename {oracle/standby-server-scripts => proxmox/vm109-windows-dr/scripts}/rman_backup.bat (100%) rename {oracle/standby-server-scripts => proxmox/vm109-windows-dr/scripts}/rman_backup.txt (100%) rename {oracle/standby-server-scripts => proxmox/vm109-windows-dr/scripts}/rman_backup_incremental.bat (100%) rename {oracle/standby-server-scripts => proxmox/vm109-windows-dr/scripts}/rman_backup_incremental.txt (100%) rename {oracle/standby-server-scripts => proxmox/vm109-windows-dr/scripts}/rman_restore_from_zero.ps1 (100%) rename {oracle/standby-server-scripts => proxmox/vm109-windows-dr/scripts}/transfer_backups.ps1 (100%) rename {oracle/standby-server-scripts => proxmox/vm109-windows-dr/scripts}/weekly-dr-test-proxmox.sh (100%) diff --git a/input/claude-agent-sdk/README.md b/input/claude-agent-sdk/README.md deleted file mode 100644 index 89c4fcb..0000000 --- a/input/claude-agent-sdk/README.md +++ /dev/null @@ -1,148 +0,0 @@ -# Claude Agent SDK - Documentație pentru Proiecte - -Acest director conține documentație despre **Claude Agent SDK** și utilizarea acestuia în diverse contexte și proiecte. - -## Fișiere Disponibile - -### 📘 [claude-agent-sdk-documentation.md](./claude-agent-sdk-documentation.md) - -Documentație completă despre Claude Agent SDK, inclusiv: - -- **Overview**: Ce este și de ce este important -- **Instalare și Setup**: Configurare pentru Python și TypeScript -- **Arhitectură**: Concepte cheie (message blocks, query function, options) -- **Features**: Tools, permissions, MCP servers, context management -- **Cazuri de Utilizare**: - - Knowledge Management (Obsidian) - - Personal Assistants - - Custom Coding Assistants - - Customer Support - - Finance & Investment Agents - - SRE & DevOps Automation - - Research & Content Creation - - Telegram/Slack Bots -- **Exemple de Cod Detaliate**: - - Simple Query - - Custom CLI - - Obsidian Integration - - Telegram Bot cu Remote Coding - - MCP Server Setup - - Session Management - - Error Handling -- **Integrări Posibile**: Development tools, communication platforms, productivity tools -- **Monitoring**: Sentry integration, custom logging -- **Best Practices**: Security, permissions, testing, deployment -- **Resurse**: Links către documentație oficială, tutorials, community - -## Quick Links - -### Documentație Oficială Anthropic -- [Agent SDK Overview](https://docs.claude.com/en/api/agent-sdk/overview) -- [GitHub Python SDK](https://github.com/anthropics/claude-agent-sdk-python) -- [Building Agents Blog Post](https://www.anthropic.com/engineering/building-agents-with-the-claude-agent-sdk) - -### Instalare Rapidă - -**Python:** -```bash -pip install claude-agent-sdk -``` - -**TypeScript:** -```bash -npm install @anthropic-ai/claude-agent-sdk -``` - -### Example Rapid - -```python -from claude_agent_sdk import query - -options = { - "systemPrompt": "You are a helpful assistant.", - "cwd": "/workspace" -} - -messages = [{"role": "user", "content": "Help me with X"}] - -for message in query(messages=messages, options=options): - print(message) -``` - -## Utilizare în Proiecte - -### Pentru Proiecte Noi - -1. **Citește documentația completă** în `claude-agent-sdk-documentation.md` -2. **Identifică use case-ul** (coding, automation, knowledge management, etc.) -3. **Configurează agent options** (system prompt, permissions, MCP servers) -4. **Setup monitoring** (Sentry pentru production) -5. **Deploy** (Docker, serverless, etc.) - -### Exemple de Aplicații - -Din documentație poți învăța să construiești: - -- 🤖 **Telegram/Slack bots** pentru remote coding -- 📓 **Obsidian/Notion integrations** pentru knowledge management -- 👨‍💻 **Custom coding assistants** pentru tech stack-ul tău -- 🔧 **DevOps automation** pentru infrastructure management -- 💬 **Customer support bots** cu acces la CRM/database -- 📊 **Finance analysis agents** cu API integrations -- 🔍 **Research assistants** pentru content creation - -## Note Importante - -### Security Best Practices - -✅ **DO:** -- Use granular permissions (`allowedTools: ["read", "glob"]`) -- Limit working directory (`cwd: "/safe/path"`) -- Use environment variables pentru secrets -- Setup monitoring (Sentry, logs) -- Test în non-production environment first - -❌ **DON'T:** -- Use `allowedTools: "*"` în production fără review -- Set `cwd: "/"` (root access) -- Hardcode API keys/tokens în code -- Deploy without monitoring -- Give bash access without command restrictions - -### Cost Management - -- Monitor token usage (vezi Sentry integration) -- Truncate conversation history când devine prea mare -- Use prompt caching (automatic în SDK) -- Consider Claude subscription vs API credits - -### Production Readiness Checklist - -- [ ] System prompt optimizat pentru use case -- [ ] Granular permissions configurate -- [ ] MCP servers necesari setup -- [ ] Error handling implementat -- [ ] Monitoring configured (Sentry/logs) -- [ ] Session management pentru conversații -- [ ] Docker/deployment configuration -- [ ] Environment variables pentru secrets -- [ ] Testing suite pentru agent behavior -- [ ] Documentation pentru team - -## Contribuții și Updates - -Documentația este bazată pe: -- **Transcript**: "Claude Code's Real Purpose (It's Bigger Than You Think)" -- **Documentație oficială**: Anthropic Claude Agent SDK (Ianuarie 2025) -- **Web research**: Tutorials, examples, community resources - -Pentru updates: -- Verifică [documentația oficială](https://docs.claude.com/en/api/agent-sdk/overview) -- Urmărește [Anthropic blog](https://www.anthropic.com/news) -- GitHub repositories: [Python SDK](https://github.com/anthropics/claude-agent-sdk-python) - ---- - -**Happy Building!** 🚀 - -*Pentru întrebări sau clarificări, consultă documentația completă sau resursele oficiale Anthropic.* diff --git a/input/claude-agent-sdk/claude-agent-sdk-documentation.md b/input/claude-agent-sdk/claude-agent-sdk-documentation.md deleted file mode 100644 index cf16c42..0000000 --- a/input/claude-agent-sdk/claude-agent-sdk-documentation.md +++ /dev/null @@ -1,1542 +0,0 @@ -# Claude Agent SDK - Documentație Completă - -## Cuprins - -1. [Overview](#overview) -2. [Ce este Claude Agent SDK](#ce-este-claude-agent-sdk) -3. [Instalare și Setup](#instalare-și-setup) -4. [Arhitectură și Concepte Cheie](#arhitectură-și-concepte-cheie) -5. [Features Principale](#features-principale) -6. [Cazuri de Utilizare](#cazuri-de-utilizare) -7. [Exemple de Cod](#exemple-de-cod) -8. [Integrări Posibile](#integrări-posibile) -9. [Monitoring și Debugging](#monitoring-și-debugging) -10. [Best Practices](#best-practices) -11. [Resurse și Referințe](#resurse-și-referințe) - ---- - -## Overview - -**Claude Agent SDK** este SDK-ul oficial de la Anthropic care permite dezvoltatorilor să construiască agenți AI custom folosind aceeași arhitectură și tooling care stau la baza **Claude Code**. - -### Insight Principal -> **Claude Code nu este doar pentru coding!** Este un "agent harness" puternic care poate fi folosit pentru orice tip de task automat: knowledge management, customer support, research, automation workflows, și mult mai mult. - -### De ce este Important? -- **Flexibility**: Construiește agenți custom pentru orice use case -- **Production-Ready**: Include context management, permissions, error handling out-of-the-box -- **Extensible**: Suport complet pentru MCP (Model Context Protocol) servers -- **Programmable**: Integrează-l în orice workflow, application sau automation - ---- - -## Ce este Claude Agent SDK - -### Evoluția Numelui -- **Înainte**: Claude Code SDK -- **Acum**: Claude Agent SDK (redenumit în 2025) -- **Motiv**: SDK-ul poate fi folosit pentru mult mai mult decât coding - -### Arhitectura Core -Claude Agent SDK este construit peste "agent harness" care alimentează Claude Code CLI. Oferă: - -``` -┌─────────────────────────────────────┐ -│ Your Custom Application/Workflow │ -│ (Telegram, Obsidian, Email, etc.) │ -└──────────────┬──────────────────────┘ - │ -┌──────────────▼──────────────────────┐ -│ Claude Agent SDK (Python/TS) │ -│ • Context Management │ -│ • Tool Execution │ -│ • Permission System │ -│ • MCP Integration │ -└──────────────┬──────────────────────┘ - │ -┌──────────────▼──────────────────────┐ -│ Claude API (Anthropic) │ -│ Claude Sonnet 4.5 / Opus │ -└─────────────────────────────────────┘ -``` - ---- - -## Instalare și Setup - -### Cerințe -- **Python**: 3.10+ -- **Node.js**: Necesar pentru unele features -- **API Key**: Anthropic API key SAU Claude subscription (Pro/Max plan) - -### Instalare Python - -```bash -# Instalare SDK -pip install claude-agent-sdk - -# Verificare instalare -python -c "from claude_agent_sdk import query; print('OK')" -``` - -### Instalare TypeScript/Node.js - -```bash -# Instalare SDK -npm install @anthropic-ai/claude-agent-sdk - -# SAU cu yarn -yarn add @anthropic-ai/claude-agent-sdk -``` - -### Autentificare - -**Opțiunea 1: Anthropic API Key** (plătești per token) -> Configurează variabila de mediu ANTHROPIC_API_KEY folosind mecanismul specific shell-ului tău (ex.: comanda `export`). - -**Opțiunea 2: Claude Subscription** (recomandat pentru development) -```bash -# Folosește Claude Pro/Max plan -claude-code login -``` - -Avantaj Opțiunea 2: Nu plătești API credits separat dacă ai deja subscription. - ---- - -## Arhitectură și Concepte Cheie - -### 1. Message Blocks - -Claude Agent SDK funcționează pe conceptul de **message blocks** - nu streamează token-by-token, ci returnează blocuri complete de acțiuni: - -``` -User Request - ↓ -[Block 1] Text: "I'll help you with that" - ↓ -[Block 2] Tool Use: Reading file xyz.py - ↓ -[Block 3] Text: "I found the issue" - ↓ -[Block 4] Tool Use: Editing file xyz.py - ↓ -[Block 5] Text: "Done! Here's what I changed..." - ↓ -[Final Block] Result: Task completed -``` - -### 2. Query Function - -Funcția centrală pentru interacțiunea cu agentul: - -```python -from claude_agent_sdk import query - -# Query returnează un iterator de message blocks -messages = query( - messages=[{"role": "user", "content": "Your request"}], - options=agent_options -) - -# Iterează prin blocks -for message in messages: - # Process each block - print(message) -``` - -### 3. Agent Options - -Configurarea agentului prin `options`: - -```python -agent_options = { - "systemPrompt": "You are a helpful assistant...", - "cwd": "/path/to/working/directory", - "allowedTools": ["read", "write", "bash", "glob"], - "mcpServers": { - "server-name": { - "command": "node", - "args": ["server.js"] - } - } -} -``` - -### 4. Context Management Automat - -SDK-ul gestionează automat: -- **Context overflow prevention**: Compactare automată când contextu devine prea mare -- **Session management**: Păstrează history-ul conversației -- **Caching**: Automatic prompt caching pentru performanță - ---- - -## Features Principale - -### 1. Rich Tool Ecosystem - -**Built-in Tools:** -- **File Operations**: Read, Write, Edit, Glob (pattern matching) -- **Code Execution**: Bash commands, Python scripts -- **Web Search**: Integrare cu search engines -- **Web Fetch**: Descarcă și procesează conținut web - -**Example:** -```python -agent_options = { - "allowedTools": [ - "read", # Citire fișiere - "write", # Scriere fișiere - "edit", # Editare fișiere (find & replace) - "glob", # Găsire fișiere prin pattern - "bash", # Execuție comenzi - "websearch", # Căutare web - "webfetch" # Fetch URL-uri - ] -} -``` - -### 2. Granular Permissions - -Control fin asupra ce poate face agentul: - -```python -# Permisiuni stricte -permissions = { - "allowedTools": ["read", "glob"], # Doar citire, fără modificări - "cwd": "/safe/directory", # Limitează la un director -} - -# Permisiuni complete -permissions = { - "allowedTools": "*", # Toate tool-urile - "bash": { - "allowedCommands": ["git", "npm", "pytest"] # Doar comenzi specifice - } -} -``` - -### 3. MCP Server Integration - -**Model Context Protocol (MCP)** permite extinderea capabilities: - -```python -mcp_config = { - "mcpServers": { - # Standard I/O server - "sequential-thinking": { - "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-sequential-thinking"] - }, - - # SSE server - "custom-api": { - "url": "http://localhost:3000/sse", - "transport": "sse" - }, - - # Asana integration (project management) - "asana": { - "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-asana"] - } - } -} -``` - -**Popular MCP Servers:** -- `sequential-thinking`: Extended thinking/reasoning -- `filesystem`: Advanced file operations -- `github`: GitHub API integration -- `slack`: Slack integration -- `google-drive`: Google Drive access -- `database`: SQL database access - -### 4. Streaming vs Single-Shot Mode - -**Streaming Mode** (default): -```python -# Primești blocks incremental pe măsură ce sunt generate -for message in query(messages, options): - print(message) # Block disponibil imediat -``` - -**Single-Shot Mode** (pentru batch processing): -```python -# Așteaptă completion complet -result = query_sync(messages, options) -all_blocks = list(result) -``` - -### 5. Custom System Prompts - -Definește comportamentul agentului: - -```python -options = { - "systemPrompt": """You are an expert DevOps engineer specializing in: - - Infrastructure as Code (Terraform, CloudFormation) - - CI/CD pipelines (GitHub Actions, GitLab CI) - - Container orchestration (Kubernetes, Docker) - - When solving problems: - 1. Always explain your reasoning - 2. Provide production-ready solutions - 3. Include error handling - 4. Follow security best practices - - Current project: Kubernetes migration for e-commerce platform - """ -} -``` - ---- - -## Cazuri de Utilizare - -### 1. Knowledge Management & Note-Taking - -**Use Case**: Automatizare work cu knowledge bases (Obsidian, Notion) - -**Exemplu din Transcript:** -- Integrare Claude în Obsidian vault -- Editare automată a note-urilor și scripturi YouTube -- Acces de pe telefon prin Telegram - -**Beneficii:** -- Search inteligent prin notes -- Organizare automată -- Generare conținut structurat -- Sync între multiple devices - -### 2. Personal AI Assistants - -**Use Case**: Asistenți personali pentru task automation - -**Capabilities:** -- 📅 Calendar management -- ✈️ Travel planning -- 📧 Email handling -- 📝 Meeting notes -- 🔍 Research și briefing - -**Exemplu:** -```python -# Personal assistant cu acces la calendar și email -options = { - "systemPrompt": "You are my personal assistant. Help with scheduling, emails, and research.", - "mcpServers": { - "google-calendar": {...}, - "gmail": {...} - } -} -``` - -### 3. Custom Coding Assistants - -**Use Case**: AI coding assistants customizați pentru proiectele tale - -**Diferențe față de Claude Code standard:** -- ✅ Custom system prompts pentru tech stack-ul tău -- ✅ Pre-configured MCP servers pentru API-urile tale -- ✅ Custom permissions și safety rules -- ✅ Integration în CI/CD pipeline -- ✅ Monitoring și logging custom - -**Exemplu:** -```python -# Coding assistant pentru Django projects -options = { - "systemPrompt": """Expert Django developer. - Tech stack: Django 5.0, PostgreSQL, Redis, Celery - Always follow: Django best practices, write tests, type hints""", - - "cwd": "/path/to/django/project", - - "allowedTools": ["read", "write", "edit", "bash", "grep"], - - "mcpServers": { - "postgres": { - "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-postgres"], - "env": {"DATABASE_URL": "postgresql://..."} - } - } -} -``` - -### 4. Customer Support Automation - -**Use Case**: Agenți pentru customer support - -**Features:** -- Handle ambiguous user requests -- Access customer data (CRM integration) -- Multi-turn conversations -- Escalation la human când e necesar -- Multi-language support - -**Exemplu Workflow:** -``` -Customer Question - → Agent retrieves order history (MCP: Database) - → Agent checks shipping status (MCP: Shipping API) - → Agent provides personalized answer - → If complex: Escalate to human + provide context -``` - -### 5. Finance & Investment Agents - -**Use Case**: Analiza financiară și investment research - -**Capabilities:** -- Portfolio analysis -- Market data retrieval -- Investment calculations -- Risk assessment -- Report generation - -**Exemplu:** -```python -options = { - "systemPrompt": "Financial analyst. Analyze portfolios and provide investment insights.", - "mcpServers": { - "alpha-vantage": {...}, # Stock data - "fred": {...} # Economic data - }, - "allowedTools": ["read", "write", "python"] # Pentru calculations -} -``` - -### 6. SRE & DevOps Automation - -**Use Case**: Site Reliability Engineering tasks - -**Applications:** -- Incident diagnosis -- Log analysis -- Infrastructure changes -- Deployment automation -- Health check monitoring - -**Exemplu:** -```python -# SRE agent pentru production troubleshooting -options = { - "systemPrompt": """SRE agent. Diagnose and fix production issues. - Access: Kubernetes cluster, logs, metrics dashboards - Never: Make destructive changes without confirmation""", - - "mcpServers": { - "kubernetes": {...}, - "datadog": {...}, - "pagerduty": {...} - } -} -``` - -### 7. Research & Content Creation - -**Use Case**: Deep research și video/content creation - -**Din Transcript:** -- Anthropic folosește Claude Code pentru video creation -- Research automation -- Content organization - -**Workflow:** -``` -Research Topic - → Web search + article fetching - → Summary generation - → Organize findings în structure - → Generate script/outline - → Export în format final (MD, PDF, etc.) -``` - -### 8. Telegram/Slack Bots - -**Use Case**: Conversational interfaces în messaging apps - -**Din Transcript:** -- Telegram bot cu Claude Code integration -- Remote code execution de pe telefon -- Real-time file editing - -**Features:** -- Multi-user support -- Persistent sessions -- Command system -- File upload/download -- Monitoring dashboard - ---- - -## Exemple de Cod - -### Exemplu 1: Simple Query (Minimal) - -```python -from claude_agent_sdk import query - -# Definire options -options = { - "systemPrompt": "You are a helpful coding assistant." -} - -# Mesaje -messages = [ - {"role": "user", "content": "What is Python list comprehension?"} -] - -# Query agent -for message in query(messages=messages, options=options): - # Fiecare message este un block - if hasattr(message, 'content'): - print(message.content) -``` - -**Output:** -``` -[System Prompt Block] -[Response Block]: Python list comprehension is a concise way to create lists... -[Final Result Block]: Task completed -``` - -### Exemplu 2: Custom CLI Agent - -```python -from claude_agent_sdk import AgentClient -import os - -# Agent options -options = { - "systemPrompt": "You are an expert Python developer.", - "cwd": os.getcwd(), - "allowedTools": ["read", "write", "edit", "bash", "glob"], -} - -# Create client (reusable pentru multiple queries) -client = AgentClient(options) - -# Conversation history -conversation = [] - -print("Custom Claude CLI - Type 'exit' to quit\n") - -while True: - # User input - user_input = input("You: ").strip() - - if user_input.lower() in ['exit', 'quit']: - break - - # Add user message - conversation.append({"role": "user", "content": user_input}) - - # Query agent - assistant_response = "" - - for message in client.query(conversation): - # Handle different message types - if message.type == "text": - print(f"Assistant: {message.content}") - assistant_response += message.content - - elif message.type == "tool_use": - print(f"[Using tool: {message.tool_name}]") - - elif message.type == "final_result": - print("[Done]\n") - - # Add assistant response to conversation - if assistant_response: - conversation.append({"role": "assistant", "content": assistant_response}) -``` - -**Usage:** -```bash -$ python custom_cli.py - -Custom Claude CLI - Type 'exit' to quit - -You: List Python files in current directory -[Using tool: bash] -Assistant: You have 3 Python files: cli.py, agent.py, utils.py -[Done] - -You: Read agent.py -[Using tool: read] -Assistant: Here's the content of agent.py... -[Done] -``` - -### Exemplu 3: Obsidian Integration - -**Use Case**: Claude Code integration în Obsidian pentru knowledge management - -```python -from fastapi import FastAPI, Request -from claude_agent_sdk import AgentClient -import json - -app = FastAPI() - -# Obsidian vault path -VAULT_PATH = "/home/user/ObsidianVault" - -# Agent configuration -agent_options = { - "systemPrompt": """You are a knowledge management assistant for Obsidian. - Help organize notes, create summaries, and maintain the knowledge base. - Always preserve markdown formatting and internal links.""", - - "cwd": VAULT_PATH, - - "allowedTools": ["read", "write", "edit", "glob", "grep"], - - # Sequential thinking MCP pentru better reasoning - "mcpServers": { - "sequential-thinking": { - "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-sequential-thinking"] - } - } -} - -# Create reusable client -agent = AgentClient(agent_options) - -# OpenAI-compatible endpoint (pentru Obsidian Copilot plugin) -@app.post("/v1/chat/completions") -async def chat_completions(request: Request): - body = await request.json() - - # Extract messages from OpenAI format - messages = body.get("messages", []) - - # Convert to Claude format - claude_messages = [ - {"role": msg["role"], "content": msg["content"]} - for msg in messages - ] - - # Query agent - response_text = "" - - for message in agent.query(claude_messages): - if message.type == "text": - response_text += message.content - - # Return în OpenAI format (pentru compatibility cu Copilot) - return { - "choices": [{ - "message": { - "role": "assistant", - "content": response_text - } - }] - } - -if __name__ == "__main__": - import uvicorn - uvicorn.run(app, host="0.0.0.0", port=8080) -``` - -**Setup Obsidian:** -1. Instalează "Copilot" community plugin -2. Settings → Copilot → Custom API -3. Base URL: `http://localhost:8080/v1` -4. Model: `claude` (orice string) - -**Usage în Obsidian:** -``` -User: My AI automations list is too long. Make it shorter. - -Agent: -[Using Glob tool to find file] -[Reading AI automations note] -[Editing file - condensing bullet points] -Done! I've shortened your list from 15 to 8 key items. -``` - -### Exemplu 4: Telegram Bot with Remote Coding - -**Use Case**: Control Claude Code remote prin Telegram (din telefon!) - -```python -import os -from telegram import Update -from telegram.ext import ApplicationBuilder, CommandHandler, MessageHandler, filters, ContextTypes -from claude_agent_sdk import AgentClient - -# Telegram bot token -BOT_TOKEN = os.getenv("TELEGRAM_BOT_TOKEN") - -# Global agent client (updated când user schimbă directory) -current_cwd = os.getcwd() -agent_client = None - -def create_agent(cwd: str, system_prompt: str = None): - """Create or update agent cu noul working directory""" - global agent_client - - options = { - "systemPrompt": system_prompt or "You are a helpful coding assistant.", - "cwd": cwd, - "allowedTools": ["read", "write", "edit", "bash", "glob", "grep"], - - # MCP servers - "mcpServers": { - "sequential-thinking": { - "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-sequential-thinking"] - } - } - } - - agent_client = AgentClient(options) - return agent_client - -# Initialize agent -create_agent(current_cwd) - -# Command: /setdir -async def set_directory(update: Update, context: ContextTypes.DEFAULT_TYPE): - """Change working directory pentru agent""" - global current_cwd - - if not context.args: - await update.message.reply_text(f"Current directory: {current_cwd}") - return - - new_dir = " ".join(context.args) - - if os.path.isdir(new_dir): - current_cwd = new_dir - create_agent(current_cwd) - await update.message.reply_text(f"✅ Working directory set to: {new_dir}") - else: - await update.message.reply_text(f"❌ Directory not found: {new_dir}") - -# Command: /status -async def status(update: Update, context: ContextTypes.DEFAULT_TYPE): - """Show agent status""" - await update.message.reply_text(f""" -📊 Agent Status: -• Working Directory: {current_cwd} -• Tools: read, write, edit, bash, glob, grep -• MCP Servers: sequential-thinking - """) - -# Handle normal messages (queries to Claude) -async def handle_message(update: Update, context: ContextTypes.DEFAULT_TYPE): - """Handle user messages - send to Claude Agent""" - user_message = update.message.text - - # Send "typing" indicator - await update.message.chat.send_action("typing") - - # Query agent - messages = [{"role": "user", "content": user_message}] - - response_blocks = [] - tool_uses = [] - - for message in agent_client.query(messages): - if message.type == "text": - response_blocks.append(message.content) - - elif message.type == "tool_use": - tool_uses.append(f"🔧 {message.tool_name}") - - # Combine response - full_response = "\n\n".join(response_blocks) - - if tool_uses: - tools_used = "\n".join(tool_uses) - full_response = f"{tools_used}\n\n{full_response}" - - # Send back to user - await update.message.reply_text(full_response) - -# Main -def main(): - app = ApplicationBuilder().token(BOT_TOKEN).build() - - # Handlers - app.add_handler(CommandHandler("setdir", set_directory)) - app.add_handler(CommandHandler("status", status)) - app.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, handle_message)) - - print("🤖 Telegram bot started!") - app.run_polling() - -if __name__ == "__main__": - main() -``` - -**Usage (din Telegram pe telefon):** - -``` -User: /status -Bot: 📊 Agent Status: - • Working Directory: /home/user/projects - • Tools: read, write, edit, bash, glob, grep - • MCP Servers: sequential-thinking - -User: /setdir /home/user/django-app -Bot: ✅ Working directory set to: /home/user/django-app - -User: Add a TODO comment in views.py to refactor the login function -Bot: 🔧 glob - 🔧 read - 🔧 edit - - Done! I've added a TODO comment in views.py at line 45 above the login function. - -User: Use sequential thinking to give me 5 ideas for improving the app -Bot: 🔧 sequential-thinking - 🔧 sequential-thinking - 🔧 read - - Here are 5 improvement ideas: - 1. Add Redis caching for database queries... - 2. Implement rate limiting on API endpoints... - ... -``` - -**Din Transcript - Self-Improving Agent:** -``` -# Agent-ul își modifică propriul cod pentru a adăuga MCP server! -User (via Telegram): Add the sequential-thinking MCP server to my Claude agent - -Agent: -[Reads current bot code] -[Finds MCP configuration section] -[Edits bot.py to add sequential-thinking config] -✅ Done! Sequential thinking MCP server added. Restart the bot to use it. -``` - -### Exemplu 5: MCP Server Setup - -**Different Types of MCP Servers:** - -```python -mcp_configs = { - # 1. Standard I/O Server (most common) - "filesystem": { - "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-filesystem", "/allowed/path"], - "transport": "stdio" - }, - - # 2. SSE (Server-Sent Events) Server - "custom-api": { - "url": "http://localhost:3000/sse", - "transport": "sse" - }, - - # 3. With Environment Variables - "github": { - "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-github"], - "env": { - "GITHUB_TOKEN": os.getenv("GITHUB_TOKEN") - } - }, - - # 4. Database Access - "postgres": { - "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-postgres"], - "env": { - "DATABASE_URL": "postgresql://:@localhost/db" - } - }, - - # 5. Custom Local Server - "my-custom-server": { - "command": "python", - "args": ["./servers/my_server.py"], - "cwd": "/path/to/project" - } -} - -# Use în agent options -options = { - "systemPrompt": "...", - "mcpServers": mcp_configs -} -``` - -**Popular MCP Servers List:** - -| Server | Purpose | Install | -|--------|---------|---------| -| `sequential-thinking` | Extended reasoning | `npx -y @modelcontextprotocol/server-sequential-thinking` | -| `filesystem` | File operations | `npx -y @modelcontextprotocol/server-filesystem` | -| `github` | GitHub API | `npx -y @modelcontextprotocol/server-github` | -| `gitlab` | GitLab API | `npx -y @modelcontextprotocol/server-gitlab` | -| `postgres` | PostgreSQL | `npx -y @modelcontextprotocol/server-postgres` | -| `mysql` | MySQL/MariaDB | `npx -y @modelcontextprotocol/server-mysql` | -| `sqlite` | SQLite | `npx -y @modelcontextprotocol/server-sqlite` | -| `slack` | Slack integration | `npx -y @modelcontextprotocol/server-slack` | -| `google-drive` | Google Drive | `npx -y @modelcontextprotocol/server-google-drive` | -| `brave-search` | Web search | `npx -y @modelcontextprotocol/server-brave-search` | - -### Exemplu 6: Session Management & Conversation History - -```python -from claude_agent_sdk import AgentClient -import json -from datetime import datetime - -class ConversationManager: - """Manage multi-turn conversations with persistent history""" - - def __init__(self, session_file="session.json"): - self.session_file = session_file - self.history = self.load_session() - - # Agent options - self.options = { - "systemPrompt": "You are a helpful assistant.", - "cwd": "/workspace", - "allowedTools": "*" - } - - self.client = AgentClient(self.options) - - def load_session(self): - """Load conversation history from file""" - try: - with open(self.session_file, 'r') as f: - return json.load(f) - except FileNotFoundError: - return [] - - def save_session(self): - """Save conversation history to file""" - with open(self.session_file, 'w') as f: - json.dump(self.history, f, indent=2) - - def chat(self, user_message: str) -> str: - """Send message and get response""" - - # Add user message to history - self.history.append({ - "role": "user", - "content": user_message, - "timestamp": datetime.now().isoformat() - }) - - # Query agent with full history - response_text = "" - - for message in self.client.query(self.history): - if message.type == "text": - response_text += message.content - - # Add assistant response to history - self.history.append({ - "role": "assistant", - "content": response_text, - "timestamp": datetime.now().isoformat() - }) - - # Persist to disk - self.save_session() - - return response_text - - def clear(self): - """Clear conversation history""" - self.history = [] - self.save_session() - -# Usage -manager = ConversationManager("my_session.json") - -# Turn 1 -print(manager.chat("What is FastAPI?")) - -# Turn 2 (remembers context!) -print(manager.chat("Show me an example endpoint")) - -# Turn 3 -print(manager.chat("Add error handling to that example")) - -# Clear when done -# manager.clear() -``` - -### Exemplu 7: Error Handling & Retries - -```python -from claude_agent_sdk import AgentClient, AgentError -import time - -def query_with_retry(client: AgentClient, messages: list, max_retries=3): - """Query agent cu retry logic pentru errors""" - - for attempt in range(max_retries): - try: - results = [] - - for message in client.query(messages): - results.append(message) - - return results - - except AgentError as e: - if "rate_limit" in str(e).lower(): - # Rate limit - wait and retry - wait_time = 2 ** attempt # Exponential backoff - print(f"Rate limited. Waiting {wait_time}s before retry...") - time.sleep(wait_time) - - elif "context_length" in str(e).lower(): - # Context too long - truncate history - print("Context too long. Truncating history...") - messages = messages[-10:] # Keep last 10 messages - - else: - # Other error - re-raise - raise - - except Exception as e: - print(f"Unexpected error: {e}") - if attempt == max_retries - 1: - raise - time.sleep(1) - - raise Exception(f"Failed after {max_retries} retries") - -# Usage -client = AgentClient({"systemPrompt": "..."}) - -messages = [{"role": "user", "content": "Help me debug this code"}] - -try: - results = query_with_retry(client, messages) - for msg in results: - print(msg) -except Exception as e: - print(f"Failed: {e}") -``` - ---- - -## Integrări Posibile - -### 1. Development Tools - -| Tool | Integration Type | Use Case | -|------|-----------------|----------| -| **VS Code** | Extension/API | Custom coding assistant în IDE | -| **JetBrains IDEs** | Plugin | IntelliJ, PyCharm, WebStorm integration | -| **Vim/Neovim** | Plugin/RPC | Terminal-based coding assistant | -| **GitHub** | Actions/Webhooks | CI/CD automation, PR reviews | -| **GitLab** | CI/CD | Pipeline automation | -| **Jira** | API | Ticket analysis, task automation | - -### 2. Communication Platforms - -| Platform | Integration | Use Case | -|----------|------------|----------| -| **Telegram** | Bot API | Remote coding, notifications | -| **Slack** | Bot/Slash Commands | Team assistant, code reviews | -| **Discord** | Bot | Community support, automation | -| **Email** | IMAP/SMTP | Email automation, summarization | -| **WhatsApp** | Business API | Customer support | - -### 3. Productivity Tools - -| Tool | Integration | Use Case | -|------|------------|----------| -| **Obsidian** | Plugin/API | Knowledge management | -| **Notion** | API | Database management, content creation | -| **Todoist** | API | Task automation | -| **Google Calendar** | API | Scheduling, reminders | -| **Trello** | API | Project management | - -### 4. Development Platforms - -| Platform | Integration | Use Case | -|----------|------------|----------| -| **Vercel** | Deploy hooks | Auto-deploy & testing | -| **Netlify** | Build plugins | CI/CD automation | -| **AWS** | Lambda | Serverless agent execution | -| **Google Cloud** | Cloud Functions | Scalable agents | -| **Docker** | Container | Isolated agent environments | - -### 5. Databases & Storage - -| Service | MCP Server | Use Case | -|---------|-----------|----------| -| **PostgreSQL** | `server-postgres` | Database queries, migrations | -| **MySQL** | `server-mysql` | Database operations | -| **MongoDB** | Custom | NoSQL operations | -| **Redis** | Custom | Cache management | -| **S3** | Custom | File storage/retrieval | - -### 6. Monitoring & Analytics - -| Tool | Integration | Use Case | -|------|------------|----------| -| **Sentry** | SDK Integration | Error tracking, performance | -| **Datadog** | API | Metrics, logs, traces | -| **Grafana** | API | Dashboard queries | -| **New Relic** | API | Performance monitoring | -| **Prometheus** | API | Metrics querying | - ---- - -## Monitoring și Debugging - -### Sentry Integration (din Transcript) - -**De ce Sentry pentru AI Agents?** -- ✅ Vezi toate deciziile pe care le-a luat agentul -- ✅ Token usage tracking -- ✅ Performance metrics (timp de execuție) -- ✅ Tool call tracing -- ✅ Error tracking - -**Setup:** - -```python -import sentry_sdk -from sentry_sdk.integrations.anthropic import AnthropicIntegration - -# Initialize Sentry cu AI monitoring -sentry_sdk.init( - dsn="your-sentry-dsn", - integrations=[ - AnthropicIntegration(), # Special pentru Claude/Anthropic - ], - traces_sample_rate=1.0, # 100% trace sampling -) - -# Use Claude Agent SDK normally -from claude_agent_sdk import AgentClient - -client = AgentClient({...}) - -# Toate queries sunt automat tracked în Sentry! -for message in client.query(messages): - print(message) -``` - -**Ce Vezi în Sentry Dashboard:** - -``` -📊 Trace: "User request - Fix authentication bug" -├─ Span: Agent Query (2.3s) -│ ├─ Input tokens: 1,234 -│ ├─ Output tokens: 567 -│ └─ Model: claude-sonnet-4.5 -│ -├─ Tool: glob (0.1s) -│ └─ Pattern: "**/*auth*.py" -│ -├─ Tool: read (0.05s) -│ └─ File: auth/views.py -│ -├─ Tool: edit (0.2s) -│ └─ Changes: +5 lines, -3 lines -│ -└─ Total: 2.65s, 1,801 tokens -``` - -**Exemplu cu Sentry (Telegram Bot):** - -```python -import sentry_sdk -from sentry_sdk.integrations.anthropic import AnthropicIntegration -from claude_agent_sdk import AgentClient -from telegram.ext import ApplicationBuilder, MessageHandler, filters - -# Sentry setup -sentry_sdk.init( - dsn=os.getenv("SENTRY_DSN"), - integrations=[AnthropicIntegration()], - traces_sample_rate=1.0, - environment="production", -) - -async def handle_message(update, context): - user_message = update.message.text - - # Sentry automatically tracks this! - with sentry_sdk.start_transaction(op="agent_query", name=user_message[:50]): - agent = AgentClient(options) - - for message in agent.query([{"role": "user", "content": user_message}]): - if message.type == "text": - await update.message.reply_text(message.content) - -# Bot setup -app = ApplicationBuilder().token(os.getenv("BOT_TOKEN")).build() -app.add_handler(MessageHandler(filters.TEXT, handle_message)) -app.run_polling() -``` - -**Beneficii în Production:** -1. **Debugging**: Vezi exact ce a făcut agentul pentru fiecare request -2. **Validation**: Verifică dacă agentul face deciziile corecte -3. **Cost Tracking**: Monitorizează token usage -4. **Performance**: Identifică bottlenecks -5. **Errors**: Catch și debug issues rapid - -### Custom Logging - -```python -import logging -from claude_agent_sdk import AgentClient - -# Setup logging -logging.basicConfig( - level=logging.INFO, - format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', - handlers=[ - logging.FileHandler('agent.log'), - logging.StreamHandler() - ] -) - -logger = logging.getLogger(__name__) - -def query_with_logging(client, messages): - """Query cu detailed logging""" - - logger.info(f"Starting query with {len(messages)} messages") - - tool_calls = [] - response_text = "" - - for message in client.query(messages): - if message.type == "text": - logger.info(f"Text response: {message.content[:100]}...") - response_text += message.content - - elif message.type == "tool_use": - logger.info(f"Tool use: {message.tool_name} with args: {message.args}") - tool_calls.append(message.tool_name) - - elif message.type == "error": - logger.error(f"Agent error: {message.error}") - - logger.info(f"Query completed. Tools used: {tool_calls}") - - return response_text -``` - ---- - -## Best Practices - -### 1. Security & Permissions - -**❌ BAD - Prea permisiv:** -```python -options = { - "allowedTools": "*", # TOT! - "cwd": "/" # ROOT ACCESS! -} -``` - -**✅ GOOD - Granular permissions:** -```python -options = { - "allowedTools": ["read", "glob"], # Doar citire - "cwd": "/safe/project/directory", # Specific directory - "bash": { - "allowedCommands": ["git status", "npm test"] # Specific commands - } -} -``` - -### 2. System Prompts - -**❌ BAD - Vague:** -```python -"systemPrompt": "You are helpful." -``` - -**✅ GOOD - Specific și contextual:** -```python -"systemPrompt": """You are an expert DevOps engineer for our e-commerce platform. - -Tech Stack: -- Backend: Django 5.0, PostgreSQL, Redis -- Frontend: Next.js 14, TypeScript -- Infrastructure: Kubernetes on AWS EKS -- CI/CD: GitHub Actions - -Guidelines: -1. Always write production-ready code with error handling -2. Include unit tests for new features -3. Follow our coding standards (Black, ESLint) -4. Document infrastructure changes -5. Never commit secrets or credentials - -Current task: Kubernetes migration from EC2 instances -""" -``` - -### 3. Error Handling - -**✅ Always wrap queries în try-catch:** -```python -try: - for message in agent.query(messages): - process(message) -except AgentError as e: - logger.error(f"Agent error: {e}") - # Fallback logic -except Exception as e: - logger.error(f"Unexpected error: {e}") - sentry_sdk.capture_exception(e) -``` - -### 4. Context Management - -**❌ BAD - Unlimited history:** -```python -# History devine prea mare! -conversation_history.append(every_single_message) -``` - -**✅ GOOD - Truncate sau summarize:** -```python -# Păstrează doar ultimele N mesaje -MAX_HISTORY = 20 - -if len(conversation_history) > MAX_HISTORY: - # Păstrează system prompt + ultimele mesaje - conversation_history = [ - conversation_history[0], # System prompt - *conversation_history[-MAX_HISTORY:] - ] -``` - -### 5. MCP Server Management - -**✅ Use environment variables pentru secrets:** -```python -"mcpServers": { - "github": { - "command": "npx", - "args": ["-y", "@modelcontextprotocol/server-github"], - "env": { - "GITHUB_TOKEN": os.getenv("GITHUB_TOKEN") # ✅ Din env - # ❌ NU: evita hardcodarea token-ului direct în configurație - } - } -} -``` - -### 6. Testing - -**✅ Test agent behavior:** -```python -import pytest -from claude_agent_sdk import AgentClient - -def test_agent_file_reading(): - """Test că agentul poate citi fișiere""" - - client = AgentClient({ - "cwd": "/test/directory", - "allowedTools": ["read"] - }) - - messages = [{"role": "user", "content": "Read test.txt"}] - - used_tools = [] - for message in client.query(messages): - if message.type == "tool_use": - used_tools.append(message.tool_name) - - assert "read" in used_tools - -def test_agent_permissions(): - """Test că permissions sunt respectate""" - - client = AgentClient({ - "allowedTools": ["read"] # Doar read - }) - - messages = [{"role": "user", "content": "Delete file.txt"}] - - with pytest.raises(PermissionError): - list(client.query(messages)) -``` - -### 7. Performance Optimization - -**✅ Use prompt caching:** -```python -# Claude Agent SDK face asta automat, dar poți optimiza prin: -# - Păstrează system prompts consistente -# - Reuse același client pentru multiple queries -# - Evită schimbări frecvente de configuration - -client = AgentClient(options) # ✅ Create once - -for user_request in requests: - # ✅ Reuse client - automatic caching! - client.query([{"role": "user", "content": user_request}]) -``` - -### 8. Monitoring în Production - -**✅ Always monitor în production:** -```python -# 1. Sentry pentru traces -sentry_sdk.init(dsn="...", integrations=[AnthropicIntegration()]) - -# 2. Custom metrics -from prometheus_client import Counter, Histogram - -agent_queries = Counter('agent_queries_total', 'Total agent queries') -agent_duration = Histogram('agent_duration_seconds', 'Agent query duration') - -@agent_duration.time() -def query_agent(messages): - agent_queries.inc() - return list(client.query(messages)) - -# 3. Logging -logger.info(f"Agent query: {user_message}") -``` - -### 9. Cost Management - -**✅ Track și optimize costs:** -```python -# Monitor token usage -total_tokens = 0 - -for message in client.query(messages): - if hasattr(message, 'usage'): - total_tokens += message.usage.get('total_tokens', 0) - -logger.info(f"Total tokens used: {total_tokens}") - -# Set limits -if total_tokens > MAX_TOKENS_PER_SESSION: - raise Exception("Token limit exceeded") -``` - -### 10. Deployment - -**✅ Containerize pentru consistency:** - -```dockerfile -# Dockerfile pentru agent deployment -FROM python:3.11-slim - -# Install Node.js (pentru MCP servers) -RUN apt-get update && apt-get install -y nodejs npm - -WORKDIR /app - -# Install dependencies -COPY requirements.txt . -RUN pip install -r requirements.txt - -# Copy agent code -COPY . . - -# Environment variables (definește-le în runtime sau pipeline) -# - ANTHROPIC_API_KEY -# - SENTRY_DSN - -CMD ["python", "agent.py"] -``` - ---- - -## Resurse și Referințe - -### Documentație Oficială - -- **Claude Agent SDK Docs**: https://docs.claude.com/en/api/agent-sdk/overview -- **GitHub Python SDK**: https://github.com/anthropics/claude-agent-sdk-python -- **GitHub TypeScript SDK**: https://github.com/anthropics/claude-agent-sdk-typescript -- **Migration Guide** (Code SDK → Agent SDK): https://docs.claude.com/en/api/agent-sdk/migration - -### Anthropic Blog Posts - -- **Building Agents with Claude Agent SDK**: https://www.anthropic.com/engineering/building-agents-with-the-claude-agent-sdk -- **Enabling Claude Code to Work More Autonomously**: https://www.anthropic.com/news/enabling-claude-code-to-work-more-autonomously -- **Agent Skills**: https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills - -### Tutorials și Guides - -- **DataCamp Tutorial**: https://www.datacamp.com/tutorial/how-to-use-claude-agent-sdk -- **Practical Guide to Custom Coding Agents**: https://www.eesel.ai/blog/custom-coding-agents-claude-code-sdk -- **Python SDK Guide 2025**: https://www.eesel.ai/blog/python-claude-code-sdk - -### MCP (Model Context Protocol) - -- **MCP Documentation**: https://modelcontextprotocol.io -- **MCP Servers List**: https://github.com/modelcontextprotocol/servers -- **Create Custom MCP Server**: https://modelcontextprotocol.io/docs/creating-servers - -### Monitoring & Observability - -- **Sentry AI Monitoring**: https://docs.sentry.io/platforms/python/integrations/anthropic/ -- **LangSmith** (alternative): https://docs.smith.langchain.com/ -- **Weights & Biases** (alternative): https://wandb.ai/ - -### Example Projects & Repositories - -- **Claude Code Examples** (din transcript): https://github.com/[repository-link-from-video] -- **Awesome Claude Agents**: https://github.com/topics/claude-agent-sdk -- **Community Examples**: https://github.com/anthropics/anthropic-cookbook - -### Community - -- **Discord**: Anthropic Discord server -- **Reddit**: r/ClaudeAI -- **Twitter**: @AnthropicAI - ---- - -## Concluzie - -**Claude Agent SDK** nu este doar pentru coding - este o platformă completă pentru a construi **orice tip de agent AI** care beneficiază de: - -✅ **File operations puternice** (read, write, edit, search) -✅ **Code execution** (bash, Python, etc.) -✅ **Extensibility** (MCP servers pentru orice API/service) -✅ **Production-ready features** (permissions, error handling, context management) -✅ **Flexibility** (integrează în orice app/workflow) - -### Key Takeaways - -1. **Beyond Coding**: Use pentru knowledge management, automation, research, support -2. **Programmable**: Controlează totul - system prompts, permissions, tools, MCP servers -3. **Integration-Friendly**: Telegram, Obsidian, Slack, Email, CI/CD, etc. -4. **Production-Ready**: Built-in monitoring (Sentry), error handling, caching -5. **Future-Proof**: Arhitectura care va fi copiată de alte AI coding tools - -### Următorii Pași - -1. **Experimentează** cu quick start examples -2. **Alege un use case** (e.g., Telegram bot, Obsidian integration) -3. **Configurează MCP servers** pentru API-urile tale -4. **Setup monitoring** (Sentry) -5. **Deploy în production** (Docker, AWS Lambda, etc.) - -**Happy Building!** 🚀 - ---- - -*Documentație generată pe baza transcriptului "Claude Code's Real Purpose" și documentației oficiale Anthropic (Ianuarie 2025)* diff --git a/proxmox/README.md b/proxmox/README.md index 9fa25e6..9964489 100644 --- a/proxmox/README.md +++ b/proxmox/README.md @@ -15,11 +15,36 @@ proxmox/ │ ├── scripts/ │ └── config/ │ +├── lxc104-flowise/ # LXC 104 - Flowise AI (Chatbot Maria) +│ ├── README.md # Infrastructură chatbot, ngrok, troubleshooting +│ └── docs/ +│ ├── prd.md # Product Requirements Document +│ ├── v1-arhitectura.md # Arhitectură v1 (Flowise + Groq) +│ └── v2-arhitectura.md # Arhitectură v2 (Claude Agent SDK) +│ ├── lxc108-oracle/ # LXC 108 - Oracle Database XE 21c │ ├── README.md # Documentație completă Oracle +│ ├── scripts/ +│ │ ├── export-roa2.sh +│ │ └── export-roa2.ps1 +│ ├── migration/ # Scripturi migrare Oracle 10g → 21c +│ │ ├── README.md +│ │ ├── 00-MASTER-MIGRATION.sh +│ │ └── ... +│ └── sql/ +│ ├── roa/ # SQL-uri Oracle 10g compatibilitate +│ └── roa-romconstruct/ # Package PACK_CONTAFIN +│ +├── vm109-windows-dr/ # VM 109 - Windows Standby (Disaster Recovery) +│ ├── README.md # Configurare DR, RMAN backup +│ ├── docs/ +│ │ ├── PLAN_TESTARE_MONITORIZARE.md +│ │ ├── PROXMOX_NOTIFICATIONS_README.md +│ │ └── archive/ # Planuri și statusuri anterioare │ └── scripts/ -│ ├── export-roa2.sh -│ └── export-roa2.ps1 +│ ├── rman_backup*.bat # Scripturi RMAN Windows +│ ├── transfer_backups.ps1 # Transfer backup-uri +│ └── *-proxmox.sh # Monitorizare din Proxmox │ ├── vm201-windows/ # VM 201 - Windows 11 (roacentral) │ ├── README.md # Informații generale VM @@ -63,6 +88,36 @@ ssh root@10.0.20.201 "upsc nutdev1" --- +### LXC 104 - Flowise AI (Chatbot Maria) +**Director:** `lxc104-flowise/` +**IP:** 10.0.20.161 | **Host:** pvemini + +| Fișier | Descriere | +|--------|-----------| +| `README.md` | Configurare Flowise, ngrok, troubleshooting CORS | +| `docs/prd.md` | Product Requirements Document chatbot | +| `docs/v1-arhitectura.md` | Arhitectură Flowise + Groq | +| `docs/v2-arhitectura.md` | Arhitectură Claude Agent SDK (planificat) | + +**Quick Start:** +```bash +# Status servicii +ssh root@10.0.20.201 "pct exec 104 -- systemctl status flowise" +ssh root@10.0.20.201 "pct exec 104 -- systemctl status ngrok" + +# Restart Flowise +ssh root@10.0.20.201 "pct exec 104 -- systemctl restart flowise" + +# Test chatbot +curl -s "https://mutual-special-koala.ngrok-free.app/api/v1/prediction/d4911620-07fe-41f8-adb4-f2f52d6ec766" \ + -X POST -H "Content-Type: application/json" -d '{"question":"test"}' +``` + +**URL Public:** https://mutual-special-koala.ngrok-free.app +**Pagina Web:** https://www.romfast.ro/chatbot_maria.html + +--- + ### LXC 108 - Oracle Database **Director:** `lxc108-oracle/` **IP:** 10.0.20.121 | **Host:** pvemini @@ -87,6 +142,31 @@ sqlplus sys/romfastsoft@10.0.20.121:1521/roa as sysdba --- +### VM 109 - Windows Standby (Disaster Recovery) +**Director:** `vm109-windows-dr/` +**Rol:** Backup Oracle database de pe server extern Windows (RMAN) + +| Fișier | Descriere | +|--------|-----------| +| `README.md` | Configurare DR, RMAN backup, scripturi transfer | +| `docs/PLAN_TESTARE_MONITORIZARE.md` | Plan testare și monitorizare DR | +| `docs/PROXMOX_NOTIFICATIONS_README.md` | Configurare notificări Proxmox | +| `docs/archive/` | Planuri implementare și statusuri anterioare | +| `scripts/rman_backup*.bat` | Scripturi RMAN pentru backup Windows | +| `scripts/transfer_backups.ps1` | Transfer backup-uri către storage | +| `scripts/*-proxmox.sh` | Scripturi monitorizare din Proxmox | + +**Quick Start:** +```bash +# Monitorizare backup Oracle DR +/mnt/e/proiecte/ROMFASTSQL/proxmox/vm109-windows-dr/scripts/oracle-backup-monitor-proxmox.sh + +# Test săptămânal DR +/mnt/e/proiecte/ROMFASTSQL/proxmox/vm109-windows-dr/scripts/weekly-dr-test-proxmox.sh +``` + +--- + ### VM 201 - Windows 11 **Director:** `vm201-windows/` **IP:** DHCP | **Host:** pvemini | **Rol:** Reverse proxy IIS, client aplicații @@ -126,13 +206,14 @@ echo | openssl s_client -connect roa.romfast.ro:443 -servername roa.romfast.ro 2 |------|------|-----|----------|--------------| | 100 | portainer | 10.0.20.170 | Docker Management | `cluster/README.md` | | 103 | dokploy | 10.0.20.167 | Deployment Platform | `cluster/README.md` | -| 104 | flowise | 10.0.20.161 | Flowise AI + Ollama | `cluster/README.md` | +| **104** | **flowise** | **10.0.20.161** | **Flowise AI (Chatbot Maria)** | **`lxc104-flowise/`** | | 106 | gitea | 10.0.20.165 | Git Server | `cluster/README.md` | | **108** | **central-oracle** | **10.0.20.121** | **Oracle XE 21c** | **`lxc108-oracle/`** | ### Virtual Machines | VMID | Nume | OS | Documentație | |------|------|----|--------------| +| **109** | **standby-dr** | **Windows Server** | **`vm109-windows-dr/`** | | **201** | **roacentral** | **Windows 11** | **`vm201-windows/`** | | 300 | Win11-Template | Windows 11 | `cluster/README.md` | @@ -146,10 +227,24 @@ echo | openssl s_client -connect roa.romfast.ro:443 -servername roa.romfast.ro 2 - **Monitorizez HA cluster** → `cluster/cluster-ha-monitor.sh` - **Gestionez UPS** → `cluster/ups/README.md` +### Flowise AI / Chatbot Maria (LXC 104) +- **Configurez chatbot** → `lxc104-flowise/README.md` +- **Troubleshooting CORS/ngrok** → `lxc104-flowise/README.md` → "Troubleshooting" +- **PRD Chatbot** → `lxc104-flowise/docs/prd.md` +- **Arhitectură viitoare** → `lxc104-flowise/docs/v2-arhitectura.md` + ### Oracle Database (LXC 108) - **Conectez la Oracle** → `lxc108-oracle/README.md` → "Conexiuni Oracle" - **Export/Import DMP** → `lxc108-oracle/README.md` → "Export și Import Data Pump" - **Restart Oracle** → `lxc108-oracle/README.md` → "Restart Oracle" +- **Scripturi migrare 10g→21c** → `lxc108-oracle/migration/README.md` +- **SQL-uri Oracle 10g** → `lxc108-oracle/sql/roa/` + +### Windows VM 109 - Disaster Recovery +- **Configurez RMAN backup** → `vm109-windows-dr/README.md` +- **Monitorizez backup-uri** → `vm109-windows-dr/scripts/oracle-backup-monitor-proxmox.sh` +- **Test DR săptămânal** → `vm109-windows-dr/scripts/weekly-dr-test-proxmox.sh` +- **Plan testare DR** → `vm109-windows-dr/docs/PLAN_TESTARE_MONITORIZARE.md` ### Windows VM 201 - **Reînnoiesc certificate SSL** → `vm201-windows/docs/vm201-certificat-letsencrypt-iis.md` @@ -168,7 +263,9 @@ echo | openssl s_client -connect roa.romfast.ro:443 -servername roa.romfast.ro 2 | Portainer Principal | http://10.0.20.170:9443 | | Gitea | http://10.0.20.165:3000 | | Dokploy | http://10.0.20.167:3000 | -| Flowise AI | http://10.0.20.161:3000 | +| Flowise AI (local) | http://10.0.20.161:3000 | +| Flowise AI (public) | https://mutual-special-koala.ngrok-free.app | +| Chatbot Maria | https://www.romfast.ro/chatbot_maria.html | --- diff --git a/chatbot/infrastructura.md b/proxmox/lxc104-flowise/README.md similarity index 80% rename from chatbot/infrastructura.md rename to proxmox/lxc104-flowise/README.md index bd4c7eb..59f43f6 100644 --- a/chatbot/infrastructura.md +++ b/proxmox/lxc104-flowise/README.md @@ -1,4 +1,22 @@ -# Infrastructura Chatbot Maria +# LXC 104 - Flowise AI (Chatbot Maria) + +**Director:** `proxmox/lxc104-flowise/` +**VMID:** 104 +**IP:** 10.0.20.161 +**Host Proxmox:** pvemini +**Servicii:** Flowise AI, ngrok tunnel, Ollama (opțional) + +--- + +## Documentație Adițională + +| Fișier | Descriere | +|--------|-----------| +| `docs/prd.md` | Product Requirements Document - Chatbot Suport Tehnic | +| `docs/v1-arhitectura.md` | Arhitectură versiunea 1 (Flowise + Groq) | +| `docs/v2-arhitectura.md` | Arhitectură versiunea 2 (Claude Agent SDK) | + +--- ## Componente @@ -139,3 +157,15 @@ Pagina încarcă widget-ul Flowise care se conectează la endpoint-ul ngrok. - **Problemă 1**: Flowise nu avea CORS configurat - **Problemă 2**: ngrok rula versiunea 3.16.0 (actualizată dar nerestartat din octombrie) - **Soluție**: Adăugat CORS_ORIGINS și restart la ambele servicii + +--- + +## Legături Utile + +- **Proxmox Index:** `../README.md` +- **Cluster Info:** `../cluster/README.md` + +--- + +**Ultima actualizare:** 2026-01-27 +**Autor:** Marius Mutu diff --git a/chatbot/prd.md b/proxmox/lxc104-flowise/docs/prd.md similarity index 99% rename from chatbot/prd.md rename to proxmox/lxc104-flowise/docs/prd.md index 21847ce..a818cc8 100644 --- a/chatbot/prd.md +++ b/proxmox/lxc104-flowise/docs/prd.md @@ -1,6 +1,11 @@ # Product Requirements Document (PRD) ## Chatbot de Suport Tehnic RAG pentru ROMFAST +**Director:** `proxmox/lxc104-flowise/docs/` +**Arhitectură:** Vezi `v1-arhitectura.md` și `v2-arhitectura.md` + +--- + ## 1. OVERVIEW ȘI OBIECTIVE ### 1.1 Problem Statement diff --git a/chatbot/v1-arhitectura.md b/proxmox/lxc104-flowise/docs/v1-arhitectura.md similarity index 94% rename from chatbot/v1-arhitectura.md rename to proxmox/lxc104-flowise/docs/v1-arhitectura.md index cfe4077..2887e70 100644 --- a/chatbot/v1-arhitectura.md +++ b/proxmox/lxc104-flowise/docs/v1-arhitectura.md @@ -1,4 +1,10 @@ -# Plan: Chatbot RAG pentru romfast.ro +# Plan: Chatbot RAG pentru romfast.ro (v1) + +**Director:** `proxmox/lxc104-flowise/docs/` +**Status:** Implementat parțial (Flowise + Groq) +**Versiune următoare:** Vezi `v2-arhitectura.md` pentru Claude Agent SDK + +--- ## ARHITECTURĂ GENERALĂ diff --git a/chatbot/v2-arhitectura.md b/proxmox/lxc104-flowise/docs/v2-arhitectura.md similarity index 97% rename from chatbot/v2-arhitectura.md rename to proxmox/lxc104-flowise/docs/v2-arhitectura.md index c402f72..3aee3c1 100644 --- a/chatbot/v2-arhitectura.md +++ b/proxmox/lxc104-flowise/docs/v2-arhitectura.md @@ -1,3 +1,11 @@ +# Arhitectură Chatbot Maria v2 - Claude Agent SDK + +**Director:** `proxmox/lxc104-flowise/docs/` +**Status:** Planificat +**Versiune anterioară:** Vezi `v1-arhitectura.md` pentru Flowise + Groq + +--- + ## 1. Introducere și Context Chatbot-ul de suport tehnic ROMFAST va oferi răspunsuri asistate de RAG și Claude Agent SDK atât pe website, cât și în Telegram. Arhitectura propusă trebuie să asigure timpul de răspuns sub 5 secunde, disponibilitate ridicată, persistența sesiunilor și integrarea cu infrastructura existentă (Docker în LXC Proxmox). diff --git a/proxmox/lxc108-oracle/README.md b/proxmox/lxc108-oracle/README.md index 9c265ce..61f9d9b 100644 --- a/proxmox/lxc108-oracle/README.md +++ b/proxmox/lxc108-oracle/README.md @@ -29,7 +29,7 @@ - **Image:** container-registry.oracle.com/database/express:21.3.0-xe - **Versiune:** Oracle Database 21c Express Edition - **Status:** Running (Up 3+ weeks, healthy) -- **Portainer:** http://10.0.20.121:9443 +- **Portainer:** http://10.0.20.121:9000 (admin / parola281234) ### Porturi Expuse | Port | Serviciu | Descriere | @@ -489,16 +489,44 @@ ssh root@10.0.20.201 "pct exec 108 -- docker exec oracle-xe tail -100 /opt/oracl --- +## 📂 Subdirectoare + +### migration/ +Scripturi pentru migrarea Oracle 10g → 21c XE: +- `00-MASTER-MIGRATION.sh` - Script master orchestrare migrare +- `01-setup-oracle21c.sh` - Setup tablespace ROA + useri +- `02-export-source.sh` - Export universal (AUTO/MANUAL/LOCAL) +- `03-transfer-to-oracle21c.sh` - Transfer fișiere DMP +- `04-import-to-oracle21c.sh` - Import scheme + SYS objects +- `05-create-synonyms-grants.sh` - Creare sinonime + grant-uri +- `06-finalize-migration.sh` - Recompilare + verificare finală + +**Documentație:** `migration/README.md` + +### sql/ +SQL-uri și packages Oracle: +- `sql/roa/` - SQL-uri compatibilitate Oracle 10g (scrie_jc_2007.sql, etc.) +- `sql/roa-romconstruct/` - Package PACK_CONTAFIN.pck + +### scripts/ +Scripturi operaționale: +- `export-roa2.sh` - Export PDB roa2 +- `export-roa2.ps1` - Export pentru Windows + +--- + ## 🔗 Legături Utile **Pentru detalii Proxmox generale (cluster, toate LXC-uri/VM-uri):** -Vezi fișierul: `proxmox/proxmox-ssh-guide.md` +Vezi fișierul: `../cluster/README.md` **Oracle Enterprise Manager Express:** http://10.0.20.121:5500/em **Portainer Docker Management:** -http://10.0.20.121:9443 +- **URL:** http://10.0.20.121:9000 +- **User:** admin +- **Parola:** parola281234 --- diff --git a/oracle/migration-scripts/00-MASTER-MIGRATION.bat b/proxmox/lxc108-oracle/migration/00-MASTER-MIGRATION.bat similarity index 100% rename from oracle/migration-scripts/00-MASTER-MIGRATION.bat rename to proxmox/lxc108-oracle/migration/00-MASTER-MIGRATION.bat diff --git a/oracle/migration-scripts/00-MASTER-MIGRATION.sh b/proxmox/lxc108-oracle/migration/00-MASTER-MIGRATION.sh similarity index 100% rename from oracle/migration-scripts/00-MASTER-MIGRATION.sh rename to proxmox/lxc108-oracle/migration/00-MASTER-MIGRATION.sh diff --git a/oracle/migration-scripts/00-install-oracle21c-xe.sh b/proxmox/lxc108-oracle/migration/00-install-oracle21c-xe.sh similarity index 100% rename from oracle/migration-scripts/00-install-oracle21c-xe.sh rename to proxmox/lxc108-oracle/migration/00-install-oracle21c-xe.sh diff --git a/oracle/migration-scripts/01-setup-oracle21c.sh b/proxmox/lxc108-oracle/migration/01-setup-oracle21c.sh similarity index 100% rename from oracle/migration-scripts/01-setup-oracle21c.sh rename to proxmox/lxc108-oracle/migration/01-setup-oracle21c.sh diff --git a/oracle/migration-scripts/02-export-oracle10g.bat b/proxmox/lxc108-oracle/migration/02-export-oracle10g.bat similarity index 100% rename from oracle/migration-scripts/02-export-oracle10g.bat rename to proxmox/lxc108-oracle/migration/02-export-oracle10g.bat diff --git a/oracle/migration-scripts/02-export-source.sh b/proxmox/lxc108-oracle/migration/02-export-source.sh similarity index 100% rename from oracle/migration-scripts/02-export-source.sh rename to proxmox/lxc108-oracle/migration/02-export-source.sh diff --git a/oracle/migration-scripts/03-transfer-to-oracle21c.sh b/proxmox/lxc108-oracle/migration/03-transfer-to-oracle21c.sh similarity index 100% rename from oracle/migration-scripts/03-transfer-to-oracle21c.sh rename to proxmox/lxc108-oracle/migration/03-transfer-to-oracle21c.sh diff --git a/oracle/migration-scripts/04-import-to-oracle21c.sh b/proxmox/lxc108-oracle/migration/04-import-to-oracle21c.sh similarity index 100% rename from oracle/migration-scripts/04-import-to-oracle21c.sh rename to proxmox/lxc108-oracle/migration/04-import-to-oracle21c.sh diff --git a/oracle/migration-scripts/05-create-synonyms-grants.sh b/proxmox/lxc108-oracle/migration/05-create-synonyms-grants.sh similarity index 100% rename from oracle/migration-scripts/05-create-synonyms-grants.sh rename to proxmox/lxc108-oracle/migration/05-create-synonyms-grants.sh diff --git a/oracle/migration-scripts/06-finalize-migration.sh b/proxmox/lxc108-oracle/migration/06-finalize-migration.sh similarity index 100% rename from oracle/migration-scripts/06-finalize-migration.sh rename to proxmox/lxc108-oracle/migration/06-finalize-migration.sh diff --git a/oracle/migration-scripts/README-MAIN.md b/proxmox/lxc108-oracle/migration/README-MAIN.md similarity index 100% rename from oracle/migration-scripts/README-MAIN.md rename to proxmox/lxc108-oracle/migration/README-MAIN.md diff --git a/oracle/migration-scripts/README-UPGRADE-IN-PLACE.md b/proxmox/lxc108-oracle/migration/README-UPGRADE-IN-PLACE.md similarity index 100% rename from oracle/migration-scripts/README-UPGRADE-IN-PLACE.md rename to proxmox/lxc108-oracle/migration/README-UPGRADE-IN-PLACE.md diff --git a/oracle/migration-scripts/README.md b/proxmox/lxc108-oracle/migration/README.md similarity index 93% rename from oracle/migration-scripts/README.md rename to proxmox/lxc108-oracle/migration/README.md index 9c63c0d..1cd23cb 100644 --- a/oracle/migration-scripts/README.md +++ b/proxmox/lxc108-oracle/migration/README.md @@ -1,5 +1,6 @@ # 🚀 SCRIPTURI AUTOMATIZARE MIGRARE ORACLE 10g → 21c XE +**Director:** `proxmox/lxc108-oracle/migration/` **Data**: 1 Octombrie 2025 **Status**: ✅ TESTAT ȘI FUNCȚIONAL **Versiune**: 2.1 - Universal Multi-platform + Export Flexibil @@ -146,7 +147,7 @@ Scriptul **02-export-source.sh** suportă 3 moduri de export pentru maxim flexib **Doar dacă nu ai Oracle 21c XE deja instalat!** ```bash -cd /mnt/e/proiecte/ROMFASTSQL/oracle/migration-scripts +cd /mnt/e/proiecte/ROMFASTSQL/proxmox/lxc108-oracle/migration chmod +x *.sh # Opțiunea 1: Rulare direct pe Proxmox host @@ -179,7 +180,7 @@ PDB: ROA (XEPDB1 șters) ### Pasul 1: Setup Oracle 21c XE (pe WSL/Linux) ```bash -cd /mnt/e/proiecte/ROMFASTSQL/oracle/migration-scripts +cd /mnt/e/proiecte/ROMFASTSQL/proxmox/lxc108-oracle/migration chmod +x *.sh ./01-setup-oracle21c.sh ``` @@ -417,8 +418,8 @@ CDB: XE ## 🔗 DOCUMENTAȚIE COMPLETĂ Pentru detalii complete, vezi: -- `../MIGRATION-COMPLETE-GUIDE.md` - Ghid manual complet -- `../MIGRATION-CONNECTION-DETAILS.md` - Detalii conexiuni +- `../README.md` - Documentație principală LXC 108 Oracle +- `../../README.md` - Index Proxmox principal --- diff --git a/oracle/migration-scripts/export-sys-objects.sql b/proxmox/lxc108-oracle/migration/export-sys-objects.sql similarity index 100% rename from oracle/migration-scripts/export-sys-objects.sql rename to proxmox/lxc108-oracle/migration/export-sys-objects.sql diff --git a/oracle/migration-scripts/sys_objects.sql b/proxmox/lxc108-oracle/migration/sys_objects.sql similarity index 100% rename from oracle/migration-scripts/sys_objects.sql rename to proxmox/lxc108-oracle/migration/sys_objects.sql diff --git a/oracle/roa-romconstruct/PACK_CONTAFIN.pck b/proxmox/lxc108-oracle/sql/roa-romconstruct/PACK_CONTAFIN.pck similarity index 100% rename from oracle/roa-romconstruct/PACK_CONTAFIN.pck rename to proxmox/lxc108-oracle/sql/roa-romconstruct/PACK_CONTAFIN.pck diff --git a/oracle/roa/INSTRUCTIUNI_ORACLE10G.txt b/proxmox/lxc108-oracle/sql/roa/INSTRUCTIUNI_ORACLE10G.txt similarity index 100% rename from oracle/roa/INSTRUCTIUNI_ORACLE10G.txt rename to proxmox/lxc108-oracle/sql/roa/INSTRUCTIUNI_ORACLE10G.txt diff --git a/oracle/roa/README_ORACLE10G.md b/proxmox/lxc108-oracle/sql/roa/README_ORACLE10G.md similarity index 94% rename from oracle/roa/README_ORACLE10G.md rename to proxmox/lxc108-oracle/sql/roa/README_ORACLE10G.md index f9908ce..79314c0 100644 --- a/oracle/roa/README_ORACLE10G.md +++ b/proxmox/lxc108-oracle/sql/roa/README_ORACLE10G.md @@ -1,5 +1,7 @@ # Oracle 10g Compatibility +**Director:** `proxmox/lxc108-oracle/sql/roa/` + ## Două versiuni disponibile pentru SCRIE_JC_2007 ### 📄 Fișiere: diff --git a/oracle/roa/scrie_jc_2007.sql b/proxmox/lxc108-oracle/sql/roa/scrie_jc_2007.sql similarity index 100% rename from oracle/roa/scrie_jc_2007.sql rename to proxmox/lxc108-oracle/sql/roa/scrie_jc_2007.sql diff --git a/oracle/roa/scrie_jc_2007_oracle10g.sql b/proxmox/lxc108-oracle/sql/roa/scrie_jc_2007_oracle10g.sql similarity index 100% rename from oracle/roa/scrie_jc_2007_oracle10g.sql rename to proxmox/lxc108-oracle/sql/roa/scrie_jc_2007_oracle10g.sql diff --git a/oracle/roa/scrie_jc_2007_original_merge_backup.sql b/proxmox/lxc108-oracle/sql/roa/scrie_jc_2007_original_merge_backup.sql similarity index 100% rename from oracle/roa/scrie_jc_2007_original_merge_backup.sql rename to proxmox/lxc108-oracle/sql/roa/scrie_jc_2007_original_merge_backup.sql diff --git a/oracle/roa/scrie_jv_2007.sql b/proxmox/lxc108-oracle/sql/roa/scrie_jv_2007.sql similarity index 100% rename from oracle/roa/scrie_jv_2007.sql rename to proxmox/lxc108-oracle/sql/roa/scrie_jv_2007.sql diff --git a/oracle/standby-server-scripts/README.md b/proxmox/vm109-windows-dr/README.md similarity index 90% rename from oracle/standby-server-scripts/README.md rename to proxmox/vm109-windows-dr/README.md index 2c2e445..8825796 100644 --- a/oracle/standby-server-scripts/README.md +++ b/proxmox/vm109-windows-dr/README.md @@ -1,3 +1,11 @@ +# VM 109 - Oracle DR System (Windows Standby) + +**Director Proxmox:** `proxmox/vm109-windows-dr/` +**VMID:** 109 +**Rol:** Disaster Recovery pentru Oracle Database (backup RMAN de pe server Windows extern) + +--- + # 🛡️ Oracle DR System - Complete Architecture ## 📊 System Overview @@ -508,13 +516,39 @@ LINUX WORKSTATION ─────────► VM 109 (10.0.20.37) ╠══════════════════════════════════════════════════════════════╣ ║ SUPPORT: ║ ║ Logs: /var/log/oracle-dr/ ║ -║ Docs: /opt/scripts/PROXMOX_NOTIFICATIONS_README.md ║ +║ Docs: proxmox/vm109-windows-dr/docs/ ║ ╚══════════════════════════════════════════════════════════════╝ ``` --- -**Last Updated:** October 31, 2025 +## 📂 Structură Director + +``` +vm109-windows-dr/ +├── README.md # Acest fișier +├── docs/ +│ ├── PLAN_TESTARE_MONITORIZARE.md # Plan testare și monitorizare DR +│ ├── PROXMOX_NOTIFICATIONS_README.md # Configurare notificări Proxmox +│ └── archive/ # Planuri și statusuri anterioare +│ ├── DR_UPGRADE_TO_CUMULATIVE_PLAN.md +│ ├── DR_VM_MIGRATION_GUIDE.md +│ ├── DR_WINDOWS_VM_IMPLEMENTATION_PLAN.md +│ └── DR_WINDOWS_VM_STATUS_2025-10-09.md +└── scripts/ + ├── oracle-backup-monitor-proxmox.sh # Monitorizare zilnică (Proxmox) + ├── weekly-dr-test-proxmox.sh # Test săptămânal DR (Proxmox) + ├── rman_backup.bat # RMAN full backup (Windows) + ├── rman_backup_incremental.bat # RMAN incremental (Windows) + ├── transfer_backups.ps1 # Transfer backup-uri (Windows) + ├── rman_restore_from_zero.ps1 # Restore complet (Windows DR) + ├── cleanup_database.ps1 # Cleanup după test (Windows DR) + └── *.ps1 # Alte scripturi configurare +``` + +--- + +**Last Updated:** 2026-01-27 **Version:** 2.2 - Unified transfer script (transfer_backups.ps1) **Status:** ✅ Production Ready diff --git a/oracle/standby-server-scripts/PLAN_TESTARE_MONITORIZARE.md b/proxmox/vm109-windows-dr/docs/PLAN_TESTARE_MONITORIZARE.md similarity index 96% rename from oracle/standby-server-scripts/PLAN_TESTARE_MONITORIZARE.md rename to proxmox/vm109-windows-dr/docs/PLAN_TESTARE_MONITORIZARE.md index a38bed6..53ebee8 100644 --- a/oracle/standby-server-scripts/PLAN_TESTARE_MONITORIZARE.md +++ b/proxmox/vm109-windows-dr/docs/PLAN_TESTARE_MONITORIZARE.md @@ -1,5 +1,8 @@ # Plan de Testare pentru Scripturile de Monitorizare Oracle DR +**Director:** `proxmox/vm109-windows-dr/docs/` +**Scripturi:** `proxmox/vm109-windows-dr/scripts/` + ## Obiective 1. Testarea funcționalității de notificări pentru scripturile de monitorizare 2. Verificarea funcționării corecte fără erori @@ -54,7 +57,7 @@ 4. Configurare cron pentru execuție automată ### Faza 5: Validare Format Notificări -1. Reinstalare template-uri compacte: `/opt/scripts/oracle-backup-monitor-proxmox.sh --install` +1. Reinstalare template-uri compacte: `scripts/oracle-backup-monitor-proxmox.sh --install` 2. Generare notificări reale din scripturi (backup monitor + DR test) și analiză în clienți email 3. Verificare afișare în client email (text + HTML) și în GUI Proxmox 4. Rulare `weekly-dr-test-proxmox.sh` în mediu controlat și validare sumar compact în email (inclusiv componente, pași, timeline) diff --git a/oracle/standby-server-scripts/PROXMOX_NOTIFICATIONS_README.md b/proxmox/vm109-windows-dr/docs/PROXMOX_NOTIFICATIONS_README.md similarity index 95% rename from oracle/standby-server-scripts/PROXMOX_NOTIFICATIONS_README.md rename to proxmox/vm109-windows-dr/docs/PROXMOX_NOTIFICATIONS_README.md index 8057238..10f57ef 100644 --- a/oracle/standby-server-scripts/PROXMOX_NOTIFICATIONS_README.md +++ b/proxmox/vm109-windows-dr/docs/PROXMOX_NOTIFICATIONS_README.md @@ -1,5 +1,8 @@ # Oracle DR Monitoring cu Notificări Proxmox Native +**Director:** `proxmox/vm109-windows-dr/docs/` +**Scripturi:** `proxmox/vm109-windows-dr/scripts/` + ## 🎯 Overview Sistem de monitorizare și alertare pentru Oracle DR care folosește **sistemul nativ de notificări Proxmox** (PVE::Notify) - același sistem folosit pentru alertele HA, backup-uri, etc. diff --git a/oracle/standby-server-scripts/archive/DR_UPGRADE_TO_CUMULATIVE_PLAN.md b/proxmox/vm109-windows-dr/docs/archive/DR_UPGRADE_TO_CUMULATIVE_PLAN.md similarity index 100% rename from oracle/standby-server-scripts/archive/DR_UPGRADE_TO_CUMULATIVE_PLAN.md rename to proxmox/vm109-windows-dr/docs/archive/DR_UPGRADE_TO_CUMULATIVE_PLAN.md diff --git a/oracle/standby-server-scripts/archive/DR_VM_MIGRATION_GUIDE.md b/proxmox/vm109-windows-dr/docs/archive/DR_VM_MIGRATION_GUIDE.md similarity index 100% rename from oracle/standby-server-scripts/archive/DR_VM_MIGRATION_GUIDE.md rename to proxmox/vm109-windows-dr/docs/archive/DR_VM_MIGRATION_GUIDE.md diff --git a/oracle/standby-server-scripts/archive/DR_WINDOWS_VM_IMPLEMENTATION_PLAN.md b/proxmox/vm109-windows-dr/docs/archive/DR_WINDOWS_VM_IMPLEMENTATION_PLAN.md similarity index 100% rename from oracle/standby-server-scripts/archive/DR_WINDOWS_VM_IMPLEMENTATION_PLAN.md rename to proxmox/vm109-windows-dr/docs/archive/DR_WINDOWS_VM_IMPLEMENTATION_PLAN.md diff --git a/oracle/standby-server-scripts/archive/DR_WINDOWS_VM_STATUS_2025-10-09.md b/proxmox/vm109-windows-dr/docs/archive/DR_WINDOWS_VM_STATUS_2025-10-09.md similarity index 100% rename from oracle/standby-server-scripts/archive/DR_WINDOWS_VM_STATUS_2025-10-09.md rename to proxmox/vm109-windows-dr/docs/archive/DR_WINDOWS_VM_STATUS_2025-10-09.md diff --git a/oracle/standby-server-scripts/add_system_key_dr.ps1 b/proxmox/vm109-windows-dr/scripts/add_system_key_dr.ps1 similarity index 100% rename from oracle/standby-server-scripts/add_system_key_dr.ps1 rename to proxmox/vm109-windows-dr/scripts/add_system_key_dr.ps1 diff --git a/oracle/standby-server-scripts/cleanup_database.ps1 b/proxmox/vm109-windows-dr/scripts/cleanup_database.ps1 similarity index 100% rename from oracle/standby-server-scripts/cleanup_database.ps1 rename to proxmox/vm109-windows-dr/scripts/cleanup_database.ps1 diff --git a/oracle/standby-server-scripts/configure_listener_dr.ps1 b/proxmox/vm109-windows-dr/scripts/configure_listener_dr.ps1 similarity index 100% rename from oracle/standby-server-scripts/configure_listener_dr.ps1 rename to proxmox/vm109-windows-dr/scripts/configure_listener_dr.ps1 diff --git a/oracle/standby-server-scripts/copy_existing_key_to_proxmox.ps1 b/proxmox/vm109-windows-dr/scripts/copy_existing_key_to_proxmox.ps1 similarity index 100% rename from oracle/standby-server-scripts/copy_existing_key_to_proxmox.ps1 rename to proxmox/vm109-windows-dr/scripts/copy_existing_key_to_proxmox.ps1 diff --git a/oracle/standby-server-scripts/fix_ssh_via_service.ps1 b/proxmox/vm109-windows-dr/scripts/fix_ssh_via_service.ps1 similarity index 100% rename from oracle/standby-server-scripts/fix_ssh_via_service.ps1 rename to proxmox/vm109-windows-dr/scripts/fix_ssh_via_service.ps1 diff --git a/oracle/standby-server-scripts/initROA.ora b/proxmox/vm109-windows-dr/scripts/initROA.ora similarity index 100% rename from oracle/standby-server-scripts/initROA.ora rename to proxmox/vm109-windows-dr/scripts/initROA.ora diff --git a/oracle/standby-server-scripts/oracle-backup-monitor-proxmox.sh b/proxmox/vm109-windows-dr/scripts/oracle-backup-monitor-proxmox.sh similarity index 100% rename from oracle/standby-server-scripts/oracle-backup-monitor-proxmox.sh rename to proxmox/vm109-windows-dr/scripts/oracle-backup-monitor-proxmox.sh diff --git a/oracle/standby-server-scripts/rman_backup.bat b/proxmox/vm109-windows-dr/scripts/rman_backup.bat similarity index 100% rename from oracle/standby-server-scripts/rman_backup.bat rename to proxmox/vm109-windows-dr/scripts/rman_backup.bat diff --git a/oracle/standby-server-scripts/rman_backup.txt b/proxmox/vm109-windows-dr/scripts/rman_backup.txt similarity index 100% rename from oracle/standby-server-scripts/rman_backup.txt rename to proxmox/vm109-windows-dr/scripts/rman_backup.txt diff --git a/oracle/standby-server-scripts/rman_backup_incremental.bat b/proxmox/vm109-windows-dr/scripts/rman_backup_incremental.bat similarity index 100% rename from oracle/standby-server-scripts/rman_backup_incremental.bat rename to proxmox/vm109-windows-dr/scripts/rman_backup_incremental.bat diff --git a/oracle/standby-server-scripts/rman_backup_incremental.txt b/proxmox/vm109-windows-dr/scripts/rman_backup_incremental.txt similarity index 100% rename from oracle/standby-server-scripts/rman_backup_incremental.txt rename to proxmox/vm109-windows-dr/scripts/rman_backup_incremental.txt diff --git a/oracle/standby-server-scripts/rman_restore_from_zero.ps1 b/proxmox/vm109-windows-dr/scripts/rman_restore_from_zero.ps1 similarity index 100% rename from oracle/standby-server-scripts/rman_restore_from_zero.ps1 rename to proxmox/vm109-windows-dr/scripts/rman_restore_from_zero.ps1 diff --git a/oracle/standby-server-scripts/transfer_backups.ps1 b/proxmox/vm109-windows-dr/scripts/transfer_backups.ps1 similarity index 100% rename from oracle/standby-server-scripts/transfer_backups.ps1 rename to proxmox/vm109-windows-dr/scripts/transfer_backups.ps1 diff --git a/oracle/standby-server-scripts/weekly-dr-test-proxmox.sh b/proxmox/vm109-windows-dr/scripts/weekly-dr-test-proxmox.sh similarity index 100% rename from oracle/standby-server-scripts/weekly-dr-test-proxmox.sh rename to proxmox/vm109-windows-dr/scripts/weekly-dr-test-proxmox.sh