58 Commits

Author SHA1 Message Date
Виталий Никитенко
a4feeca0bb feat: индикация доступности VLESS серверов (TCP check)
При выборе Y скрипт проверяет TCP-коннект к IP:port каждого сервера
и показывает цветной статус:
- зелёный ✓ доступен
- красный ✗ недоступен

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 13:23:16 +07:00
Виталий Никитенко
a8f651056b fix: обработка последней строки без \n в servers.conf
while read ломается на последней строке без переноса — loop body не выполняется.
Добавлен || [[ -n "$line" ]] для обработки EOF без trailing newline.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 13:21:16 +07:00
Виталий Никитенко
5148ff29ca feat: новый VLESS сервер + поддержка tcp/vision flow
- Добавлен сервер 202.148.54.122 (AmneziaVPN) с flow=xtls-rprx-vision
- Парсер VLESS URL: автоопределение типа транспорта (xhttp/tcp)
  - Если flow указан → тип по умолчанию tcp
  - Если flow пустой → тип по умолчанию xhttp
- Генератор конфига: xhttpSettings только для xhttp-транспорта
- Поле flow в users теперь берётся из URL (ранее было пустым)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 13:17:59 +07:00
Виталий Никитенко
14142c0346 fix: откат настроек прокси в режиме direct (N)
При выборе N (direct mode) теперь корректно откатываются:
- Системный прокси (gsettings mode 'none')
- Firefox прокси (network.proxy.type = 0)
- IPv6 включается обратно (удаление 99-disable-ipv6.conf + sysctl)
- xray стопается и дизейблится

Раньше браузеры оставались настроенными на мёртвый прокси после переключения с Y на N.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 12:02:48 +07:00
Виталий Никитенко
a8d11a3f9f feat: multi-VLESS server selection + direct mode (stop xray)
- Добавлен home-configs/vless/servers.conf с двумя VLESS серверами
- При выборе Y: интерактивное меню выбора сервера (IP + имя)
- Парсер vless:// URL через python3 (извлекает все поля)
- Конфиг xray генерируется динамически, а не копируется статический
- При выборе N: xray стопается и дизейблится (systemctl stop+disable)
- Автоотключение IPv6 (sysctl + persist), автонастройка Firefox SOCKS5
- Автонастройка системного прокси через gsettings
- Зачистка старых drop-in оверрайдов и дефолтных конфигов xray

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 11:54:59 +07:00
8979313467 feat: optional built-in vless/xray with proxychains4 toggle
- ai-setup.sh now asks interactive Y/n prompt for vless mode
- On Y: installs xray + proxychains-ng, deploys configs, enables proxychains4 in all ai-* launchers
- On N: generates plain ai-* scripts without proxychains
- Templates moved to home-configs/xray/ and home-configs/proxychains/

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 08:38:03 +07:00
c68aff4725 fix: use _API_RET global var instead of bash return for HTTP codes > 255
bash return values are truncated to 0-255: 401 % 256 = 145, 429 % 256 = 173.
This caused _handle_api_response / _handle_openai_api_response to return 145
instead of 401, so the reauth prompt was never triggered and the script exited
silently with code 1.

Fix: use global _API_RET variable in both functions, read via ret=$_API_RET
in ai-deepseek and ai-kimi launchers.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 23:24:02 +07:00
Виталий Никитенко
81a7b024ee feat: add home-configs with auto-deployed Claude skills
- Move GLOBAL_RULES.md to home-configs/ as single source of truth
- Add el-review and el-review-heavy skills for GitLab-style branch diff review
- Update ai-setup.sh to deploy skills to ~/.claude/skills/
- Update README and tests for new paths
2026-06-04 19:02:37 +07:00
Виталий Никитенко
de7373210c fix(ai-kimi): add source fallback, simplify reauth, check claude presence
- source helpers with 2>/dev/null || true and quoted /home/nikitenko path
- remove redundant reauth flag and extra prompt
- check that claude is installed before exec
- apply same source fix to ai-deepseek for consistency
2026-06-03 10:05:45 +07:00
Виталий Никитенко
526b745cb3 refactor: switch ai-kimi to official Kimi API via Claude Code
- Replace native kimi CLI launcher with Claude Code + Kimi backend

- Update README description and permission flags

- Update test_isolated.sh and tests/test_fixes.sh for new ai-kimi logic
2026-06-02 20:03:15 +07:00
Виталий Никитенко
418a5ef6d5 fix: add npm fallback for Codex install when curl gets 403 from Cloudflare
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 10:05:19 +07:00
eeeab3dc2d Remove stale Claude-specific labels 2026-06-02 01:03:37 +07:00
1aff9a269f Add reusable skills global rule 2026-06-02 01:00:12 +07:00
3f9fe30cf0 Extract global rules into markdown file 2026-06-02 00:53:16 +07:00
eb5af7c62c Write native agent rules during setup 2026-06-01 17:27:45 +00:00
b1c585a34c Update AI setup rules and documentation 2026-06-01 16:56:26 +00:00
7814fdd5b2 Add global AI quality rules 2026-06-01 16:42:58 +00:00
db2af1f7c8 chore: игнорировать папку .antigravitycli целиком 2026-05-31 23:13:25 +07:00
4a3eaacfec chore: удалить .antigravitycli (битый симлинк служебного файла Antigravity CLI) 2026-05-31 23:13:05 +07:00
25a0512d34 fix: единый источник правил для всех ai-* агентов
- _build_ai_sys_prompt сохраняет в ~/.codex/AGENTS.md + ~/.kimi-code/AGENTS.md
- ai-gpt, ai-kimi: убран неработающий --system-prompt, используют нативные AGENTS.md
- ai-setup.sh: шаблоны синхронизированы под новое поведение

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 23:04:38 +07:00
2d1fc7fc67 docs: добавить глобальные правила в README.md 2026-05-31 22:42:25 +07:00
29f3b76dd2 fix: исправление проброса переменных окружения в ai-deepseek 2026-05-31 21:44:56 +07:00
93b9fbb43b feat: внедрена автогенерация глобальных правил ИИ-агентов и очистка AGENTS.md 2026-05-31 21:36:22 +07:00
2bde831f1a feat: add permission-skipping flags to all ai-* launchers
- ai-claude: --dangerously-skip-permissions
- ai-gpt: --dangerously-bypass-approvals-and-sandbox (Codex)
- ai-deepseek: --dangerously-skip-permissions
- ai-kimi: --yolo
- ai-gemini: --dangerously-skip-permissions (agy)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 20:34:34 +07:00
e50876f616 feat: configure ai-kimi with Artemox API 2026-05-31 20:02:38 +07:00
e5d6925911 Remove shell restart note from README 2026-05-31 12:36:02 +00:00
f1deb7c162 Ignore local Antigravity config 2026-05-31 12:33:33 +00:00
c888056a7a Fix: correct cleanup logic that accidentally deleted new ai-gpt and ai-kimi scripts 2026-05-31 19:22:08 +07:00
c6a1a788d4 Docs: rewrite README.md to be simple and concise 2026-05-31 19:15:26 +07:00
f38915eab2 Refactor: rename setup script to ai-setup.sh and update all references 2026-05-31 19:09:50 +07:00
9d7d51aac1 Refactor: rename alias scripts to use ai-* prefix and add ai-claude proxy 2026-05-31 19:06:50 +07:00
6aac2cb083 test: add isolated install verification scripts
- Dockerfile.test: Ubuntu 24.04 container for clean-room setup testing
- test_isolated.sh: mock-based test verifying auto-install URLs are called
2026-05-31 18:50:30 +07:00
52072a5e4c docs: update README for native CLI launchers
- claude_gpt: native OpenAI Codex with auto-install
- claude_kimi: native Kimi K2.6 with auto-install
2026-05-31 18:50:06 +07:00
47e0f5e58d refactor: migrate claude_gpt and claude_kimi to native CLIs with auto-install
claude_gpt:
- Replace proxy orchestration with direct codex binary launch
- Auto-install via curl -fsSL https://chatgpt.com/codex/install.sh | sh

claude_kimi:
- Remove openai-anthropic-proxy.py (~450 lines)
- Replace Artemox API key flow with native kimi CLI
- Auto-install via curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash

tests/test_fixes.sh:
- Remove obsolete proxy-specific tests (trap, readiness loops, etc.)
- Add tests for auto-install URLs and absence of proxy logic
2026-05-31 18:49:38 +07:00
1e15e4b6e8 refactor(claude_gpt): switch to native OpenAI Codex CLI
Replace claude-code-proxy + effort-proxy + claude wrapper with direct
codex binary invocation. claude_gpt now behaves like a simple launcher:
- Looks for codex in ~/.npm-global/bin or PATH
- Falls back with helpful install hint if missing
- Removes all proxy orchestration, auth polling, and Anthropic env vars
2026-05-31 18:12:42 +07:00
0c6508f239 refactor(claude_kimi): restore key prompt + proxy launch for Artemox API
claude_kimi now behaves like claude_deepseek:
- Prompts for Artemox API key if missing
- Validates key via _claude_test_openai_api
- Saves key to ~/.config/claude-launcher/kimi_key
- Starts claude-openai-anthropic-proxy.py locally
- Launches claude through the proxy with Anthropic env vars
2026-05-31 18:00:41 +07:00
42546b4dc1 feat: migrate Kimi from Moonshot to Artemox OpenAI API
- Add claude-openai-anthropic-proxy.py (Anthropic ↔ OpenAI translator)
- Rewrite claude_kimi to use native kimi CLI instead of Claude wrapper
- Add OpenAI-compatible API test helpers (_claude_test_openai_api, _handle_openai_api_response)
- Replace 127.0.0.1 with localhost for broader compatibility
- Add test for query-string handling in Kimi proxy
- Update README to reflect Artemox API usage
2026-05-31 17:55:57 +07:00
a1bf8023a9 fix: исправить падение claude_gpt (effort-proxy, гонка старта, xhigh→high)
Три корневые причины и исправления:

1. effort-proxy: однопоточный HTTPServer заменён на ThreadingMixIn,
   включён маппинг xhigh→high (claude-code-proxy больше не принимает xhigh),
   добавлено логирование ошибок в /tmp/claude-gpt-effort-proxy.log

2. Стартовая логика claude_gpt: убрано гоночное условие (pkill прокси
   при отсутствии effort-proxy), effort-proxy всегда перезапускается,
   curl -s вместо curl -sf для healthcheck'а

3. localhost заменён на 127.0.0.1 во всех URL для консистентности

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 15:55:38 +07:00
3647eba494 fix: fallback на raw body при пустом _emsg в проверке RESOURCE_EXHAUSTED
Если python3 недоступен или JSON не парсится, _emsg пустой.
Теперь grep проверяет сырое тело ответа как запасной вариант.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 15:12:15 +07:00
65c15b97bc fix: сохранять новый ключ даже при исчерпании квоты (ret=429)
При вводе нового ключа ret=429 теперь обрабатывается так же, как для
сохранённого ключа: ключ сохраняется, затем предлагается продолжить всё равно.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 15:12:01 +07:00
20bbae0657 feat: добавить обработку HTTP 400 в _handle_api_response
Thinking-модели (DeepSeek, Kimi) возвращают 400 на max_tokens=1 при проверке ключа.
Новый case обрабатывает это: RESOURCE_EXHAUSTED → return 429, иначе → OK.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 15:11:30 +07:00
b3bff78977 fix: исправить заголовок авторизации для DeepSeek и Kimi
Anthropic SDK отправляет ключ в заголовке x-api-key, а не Authorization: Bearer.
Проверочные запросы теперь используют тот же заголовок, что и реальные вызовы.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 15:11:15 +07:00
7cd7feb3f0 docs: обновить правила для агентов в AGENTS.md
Правило 1 упрощено — убрана явная оговорка про git add.
Добавлено правило 3: изменения должны быть видны через plain git diff.
Добавлено правило 4: отвечать на русском языке.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 15:10:02 +07:00
2c20d4384f chore: add CLAUDE.md symlink pointing to AGENTS.md 2026-05-31 13:35:43 +07:00
c1bee1406e feat: make gemini 3.1 pro the default model for claude_gemini 2026-05-31 13:29:47 +07:00
78556245ef fix: effort-proxy mapping max→xhigh for GPT, add EFFORT_MAPPING.md
- Fix effort-proxy direction: GPT-5.5 natively supports xhigh but not max,
  so map max→xhigh (was incorrectly xhigh→max)
- Add EFFORT_MAPPING.md with full mapping table for all providers:
  Anthropic, GPT-5.5, DeepSeek V4, Kimi K2.6, Gemini 3.x
- Update proxy docstring and comments
2026-05-31 13:09:41 +07:00
a5f5c08e01 Rename CLAUDE.md -> AGENTS.md (universal agent instructions) 2026-05-31 12:59:35 +07:00
61c21fe296 Refactor architecture to use standalone scripts in ~/.local/bin/ instead of ~/.bashrc 2026-05-31 12:55:54 +07:00
4f25596867 Remove redundant claude_anthropic wrapper 2026-05-31 12:36:16 +07:00
46b7cfa798 Fix proxy handling and improve error reporting
- Add wrapper proxy for fixing effort level in claude-code-proxy
- Improve proxy cleanup trap to include wrapper
- Add credential backup and restore for ChatGPT to prevent Anthropic keys deletion on /logout
- Enhance error messages for 400 and other HTTP errors in ChatGPT and Gemini handlers
2026-05-31 12:29:51 +07:00