Files
hanarang-rails/.env.example
이랑이 e4f8e6ef53 revert(bridge): discord.js 봇 전면 제거 — OpenClaw 가 봇 소유자
이전 커밋 08ea92f 은 잘못된 접근이었음. OpenClaw 가 이미 Discord 게이트웨이를
띄우고 있고 자매들의 봇 identity 는 거기 하나로 통일되어야 함. rails 가
discord.js 로 별도 봇을 등록하면 두 봇이 같은 채널에 공존하는 기이한 구조가
된다.

올바른 경로는 OpenClaw skill 의 user-invocable frontmatter 로 슬래시 커맨드를
노출하는 것이고, 이건 별도 커밋으로 ~/.openclaw/skills/hanarang-rails/ 에
반영됨.

삭제:
- src/bridge/ 전체 (discord-client, discord-commands, discord-notifier, index)
- tests/discord-notifier.test.ts
- package.json 의 discord.js 의존성
- src/cli/serve.ts 의 bridge 부트스트랩
- .env.example 의 DISCORD_* 블록

보존:
- runner.ts 의 PipelineLifecycleEvent + onEvent 훅 — 유닛 테스트/대시보드
  WebSocket 등에 재사용 가능
- POST /pipelines/start-async 엔드포인트 — skill 의 polling wrapper 가 이걸 씀
- runner opts.pipelineId 지원 — async start 가 의존함
- http.ts ServerOpts 의 onPipelineEvent/notifier 파라미터 — 추상화는 유지,
  serve.ts 가 주입을 안 할 뿐

테스트: 118 → 111 (discord-notifier 7 개 삭제), 나머지 그대로 통과.
2026-04-10 22:35:24 +09:00

131 lines
5.9 KiB
Plaintext

# ────────────────────────────────────────────────────────────────
# hanarang-rails — environment configuration
# Copy this file to `.env` and fill in the values you need.
#
# The file is grouped into:
# 1. required (must set to run any pipeline)
# 2. LLM provider (pick one)
# 3. transport / deployment topology
# 4. optional — Gitea push
# 5. optional — Discord bridge
# ────────────────────────────────────────────────────────────────
# ==== 1. REQUIRED =====================================================
# MariaDB / MySQL connection string used by Prisma.
# For docker-compose, use:
# mysql://rails:rails@mariadb:3306/hanarang_rails
DATABASE_URL="mysql://rails:CHANGE_ME@localhost:3306/hanarang_rails"
# Rails HTTP server port
RAILS_PORT=18800
RAILS_LOG_LEVEL=info
NODE_ENV=production
# ==== 2. LLM PROVIDER =================================================
#
# Pick exactly one provider for LLM_PROVIDER. Supported values:
# mock — deterministic fake responses. No network, no money.
# openai — OpenAI / OpenRouter / Azure OpenAI / any OpenAI-compatible API
# anthropic — Anthropic Messages API
# ollama — local Ollama server (https://ollama.com)
# openclaw — hanarang-internal OpenClaw runtime (most external users won't have this)
LLM_PROVIDER=mock
# Per-role model override. Leave empty to use the defaults baked into roles.ts
# (which are OpenClaw-flavored names — you probably need to set these for
# openai / anthropic / ollama).
#
# Good starting points:
# OpenAI: gpt-4o / gpt-4o-mini
# Anthropic: claude-opus-4-6 / claude-haiku-4-5
# Ollama: qwen2.5-coder:32b / qwen2.5-coder:7b
#
# LLM_MODEL_MANAGER=gpt-4o
# LLM_MODEL_PRINCIPAL=gpt-4o
# LLM_MODEL_LEAD=gpt-4o-mini
# LLM_MODEL_JUNIOR=gpt-4o-mini
# LLM_MODEL_FALLBACK=gpt-4o-mini
# ── OpenAI (and OpenAI-compatible) ────────────────────────────────────
# OPENAI_API_KEY=sk-...
# OPENAI_BASE_URL=https://api.openai.com/v1
# (also works for OpenRouter, Azure OpenAI, local llama.cpp servers, etc.)
# ── Anthropic ─────────────────────────────────────────────────────────
# ANTHROPIC_API_KEY=sk-ant-...
# ANTHROPIC_BASE_URL=https://api.anthropic.com
# ── Ollama (local) ────────────────────────────────────────────────────
# OLLAMA_BASE_URL=http://localhost:11434
# ── OpenClaw (internal) ───────────────────────────────────────────────
# OPENCLAW_BIN=/home/you/.npm-global/bin/openclaw
# ==== 3. TRANSPORT / TOPOLOGY =========================================
#
# rails supports three deployment topologies:
#
# 1. in-process — everything in one Node process. The simplest. The 4
# sister agents are just function calls inside rails.
# Requires sister-agent to be built under
# ./sister-agent/dist/.
#
# 2. http — rails calls each sister-agent over HTTP. The sister
# agents run as separate daemons (potentially on separate
# machines/containers). Production topology.
#
# 3. mock — no LLM, no files, no push. Just exercises the FSM.
#
# Set via RAILS_TRANSPORT globally, or per-stage via RAILS_TRANSPORT_PLAN etc.
RAILS_TRANSPORT=in-process
# For http mode — each sister-agent daemon's HTTP endpoint:
# SISTER_ENDPOINT_PLAN=http://harang-lxc:18801
# SISTER_ENDPOINT_IMPLEMENT=http://narang-lxc:18801
# SISTER_ENDPOINT_REVIEW=http://darang-lxc:18801
# SISTER_ENDPOINT_DEPLOY=http://erang-lxc:18801
# Loopback URL that sister-agent uses to report sub-task events back to rails.
# Usually the same as your rails HTTP URL as seen from the sister.
RAILS_API_URL=http://127.0.0.1:18800
# For in-process mode, optional override of where to load the compiled
# sister-agent core module from. Defaults to ./sister-agent/dist/core.js
# SISTER_AGENT_CORE_PATH=/app/sister-agent/dist/core.js
# Where sister-agent writes per-pipeline workspaces on disk.
# SISTER_WORKSPACE_DIR=/home/you/rails-projects
# ==== 4. OPTIONAL — Gitea auto-push ===================================
#
# When enabled, each pipeline run auto-creates a public repo and pushes its
# workspace to Gitea, giving you a shareable URL for the generated files.
# Leave GITEA_TOKEN empty to skip the push step entirely.
# GITEA_BASE_URL=https://git.example.com
# GITEA_ORG=my-org
# GITEA_TOKEN=
# GIT_USER_NAME=rails-agent
# GIT_USER_EMAIL=rails@example.com
# GIT_PUSH_ENABLED=true # force on/off; default is auto (on iff GITEA_TOKEN set)
# ==== 5. OPTIONAL — Gitea webhook receiver ============================
# GITEA_WEBHOOK_SECRET=
# ──────────────────────────────────────────────────────────────────────
# Discord integration is NOT handled inside rails. The hanarang 4-sister
# deployment uses OpenClaw's built-in Discord gateway, and the slash
# command (`/hanarang_rails ...`) is exposed via an OpenClaw skill whose
# SKILL.md frontmatter has `user-invocable: true`. The skill's handler
# script POSTs to rails HTTP API just like any other caller.
#
# See ~/.openclaw/skills/hanarang-rails/SKILL.md for the wiring.
# ──────────────────────────────────────────────────────────────────────