discord-agent-bridge 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ko.md +40 -307
- package/README.md +51 -319
- package/dist/discord/notifier.js +23 -3
- package/dist/discord/notifier.js.map +1 -1
- package/dist/discord/renderers/index.js +40 -0
- package/dist/discord/renderers/index.js.map +1 -1
- package/dist/modes/claude/session.js +6 -10
- package/dist/modes/claude/session.js.map +1 -1
- package/package.json +1 -1
package/README.ko.md
CHANGED
|
@@ -4,60 +4,53 @@
|
|
|
4
4
|
|
|
5
5
|
> Self-hosted Discord bot that runs AI coding agents — Claude Code, Codex, and more — per channel. Role-based access, multi-server, extensible.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- 현재 지원: **Claude Code**, **Codex**
|
|
10
|
-
- 확장: 모드 플러그인 추가로 다른 에이전트(예: opencode) 연결 가능
|
|
11
|
-
|
|
12
|
-
> ✅ **npm에 배포되어 있습니다.** `npx discord-agent-bridge` 로 바로 실행하거나(권장), 전역 설치·소스 빌드로도 쓸 수 있습니다. **Claude Code · Codex** 두 백엔드를 지원합니다.
|
|
7
|
+
**Discord 채널 하나에 Claude Code(또는 Codex)를 붙여 쓰는 셀프호스팅 봇입니다.** 봇은 내 PC에서 돌고, npm에 배포되어 있어 `npm install -g` 한 번과 명령 세 줄이면 자동 실행까지 끝납니다.
|
|
13
8
|
|
|
14
9
|
---
|
|
15
10
|
|
|
16
|
-
##
|
|
11
|
+
## Why this?
|
|
17
12
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- **채널 =
|
|
21
|
-
-
|
|
22
|
-
-
|
|
13
|
+
- 🏠 **완전 셀프호스팅.** 봇이 내 PC에서 돕니다. 코드도, 세션도, CLI 토큰도 밖으로 안 나갑니다.
|
|
14
|
+
- 📱 **책상 앞에 없어도 됩니다.** 지하철에서 폰으로 Discord에 지시만 던져 두세요. 스트리밍 응답, 툴 실행 로그, 권한 승인 버튼이 채널에 그대로 뜹니다.
|
|
15
|
+
- 🗂️ **채널 하나 = 프로젝트 하나 = 세션 하나.** 채널마다 작업 폴더 · 백엔드 · 모델 · 권한 모드가 따로 붙습니다.
|
|
16
|
+
- 👥 **팀 관전 친화적.** 같은 채널을 보는 사람은 세션 진행을 그대로 지켜봅니다. 3단계 역할(admin / execute / read-only)로 실제 실행 권한만 통제합니다.
|
|
17
|
+
- 🔀 **Claude ⇄ Codex 즉시 전환.** `/mode` 한 방으로 백엔드를 바꿉니다.
|
|
18
|
+
- ⚙️ **터미널과 동등한 기능.** 프로젝트의 `.claude/`, `.codex/` 설정을 그대로 읽어서 서브에이전트 · 스킬 · 훅 · MCP · 플러그인 명령까지 CLI와 똑같이 동작합니다.
|
|
23
19
|
|
|
24
20
|
---
|
|
25
21
|
|
|
26
22
|
## 준비물
|
|
27
23
|
|
|
28
24
|
- **Node.js 20 이상**
|
|
29
|
-
-
|
|
30
|
-
- **Claude 모드** → [Claude Code](https://docs.anthropic.com/en/docs/claude-code)
|
|
31
|
-
- **Codex 모드** → `codex` CLI
|
|
25
|
+
- 쓰려는 백엔드에 맞춰 CLI가 **설치 + 로그인** 상태:
|
|
26
|
+
- **Claude 모드** → [Claude Code](https://docs.anthropic.com/en/docs/claude-code) (`claude` 로그인 또는 `ANTHROPIC_API_KEY`)
|
|
27
|
+
- **Codex 모드** → `codex` CLI, 로그인까지
|
|
32
28
|
- **Discord 봇 토큰** (아래 1단계에서 발급)
|
|
33
29
|
|
|
34
30
|
---
|
|
35
31
|
|
|
36
|
-
## 1단계 — Discord 봇 만들기
|
|
32
|
+
## 1단계 — Discord 봇 만들기
|
|
37
33
|
|
|
38
|
-
봇을 직접
|
|
34
|
+
봇을 하나 직접 만들어야 합니다. 5분이면 됩니다.
|
|
39
35
|
|
|
40
|
-
1. **[Discord Developer Portal](https://discord.com/developers/applications)** 접속 →
|
|
41
|
-
2. 왼쪽 메뉴 **Bot** 탭 → **Reset Token** → 나오는 **토큰을
|
|
42
|
-
- ⚠️ 이 토큰은
|
|
36
|
+
1. **[Discord Developer Portal](https://discord.com/developers/applications)** 접속 → 우측 상단 **New Application** → 이름 입력(예: `my-agent-bot`) → **Create**.
|
|
37
|
+
2. 왼쪽 메뉴 **Bot** 탭 → **Reset Token** → 나오는 **토큰을 복사**해서 안전한 곳에 보관하세요.
|
|
38
|
+
- ⚠️ 이 토큰은 비밀번호나 다름없습니다. 노출되면 즉시 **Reset Token**으로 재발급하세요.
|
|
43
39
|
3. 같은 **Bot** 탭 아래 **Privileged Gateway Intents**:
|
|
44
|
-
- ✅ **MESSAGE CONTENT INTENT** — **필수** (봇이 메시지 내용을 읽어야
|
|
45
|
-
- ✅ **SERVER MEMBERS INTENT** — 권장 (역할
|
|
40
|
+
- ✅ **MESSAGE CONTENT INTENT** — **필수** (봇이 메시지 내용을 읽어야 합니다)
|
|
41
|
+
- ✅ **SERVER MEMBERS INTENT** — 권장 (역할 확인에 사용)
|
|
46
42
|
- 켜고 **Save Changes**.
|
|
47
|
-
4. 왼쪽 **OAuth2** 탭 → **Client ID(Application ID)**
|
|
43
|
+
4. 왼쪽 **OAuth2** 탭 → **Client ID(Application ID)** 복사.
|
|
48
44
|
5. **초대 링크 만들기** — OAuth2 → **URL Generator**:
|
|
49
45
|
- **Scopes**: `bot`, `applications.commands`
|
|
50
46
|
- **Bot Permissions**: `Manage Channels`, `Send Messages`, `Embed Links`, `Attach Files`, `Read Message History`, `Create Public Threads`, `Send Messages in Threads`, `Manage Threads`, `Add Reactions`
|
|
51
|
-
- 생성된 URL을 브라우저에 붙여넣어 **내 서버에
|
|
52
|
-
- (셋업 마법사가 이 초대 링크를 자동 생성해 주기도 합니다 — 2단계 참고.)
|
|
47
|
+
- 생성된 URL을 브라우저에 붙여넣어 **내 서버에 초대**하세요.
|
|
53
48
|
|
|
54
49
|
---
|
|
55
50
|
|
|
56
51
|
## 2단계 — 설치 & 실행
|
|
57
52
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
가장 간단한 방법입니다. 아래 세 줄이면 설치부터 재부팅 자동 실행까지 끝납니다. `service install` 이 현재 OS에 맞는 자동 실행을 알아서 등록합니다 — **macOS는 launchd, Linux는 systemd, Windows는 작업 스케줄러**.
|
|
53
|
+
명령 세 줄이면 설치부터 재부팅 자동 실행까지 끝납니다. `service install` 이 현재 OS에 맞는 자동 실행을 알아서 등록합니다 — **macOS는 launchd, Linux는 systemd, Windows는 작업 스케줄러**.
|
|
61
54
|
|
|
62
55
|
```bash
|
|
63
56
|
npm install -g discord-agent-bridge # 설치
|
|
@@ -73,314 +66,54 @@ discord-agent-bridge service restart # 재시작
|
|
|
73
66
|
discord-agent-bridge service uninstall # 등록 해제
|
|
74
67
|
```
|
|
75
68
|
|
|
76
|
-
업그레이드는 최신 설치 후 재시작:
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
npm install -g discord-agent-bridge@latest
|
|
80
|
-
discord-agent-bridge service restart
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
> ⚠️ **Windows 참고**: 작업 스케줄러 로그온 트리거로 등록되어 **로그인 시 자동 시작**됩니다(관리자 권한 불필요). 단, 크래시 시 자동 재시작은 보장되지 않습니다(macOS·Linux는 보장). `service install` 이 안 되면 아래 **수동 설정 — Windows (작업 스케줄러)** 를 참고하세요.
|
|
84
|
-
|
|
85
|
-
---
|
|
86
|
-
|
|
87
|
-
아래부터는 `service install` 이 동작하지 않거나 직접 설정하고 싶을 때의 **수동 방법**입니다.
|
|
88
|
-
|
|
89
|
-
### 수동 설정 — macOS (launchd)
|
|
90
|
-
|
|
91
|
-
macOS 기본 서비스 관리자인 **launchd** 로 봇을 직접 실행합니다 — 로그인하면 자동 시작되고, 꺼지면 자동으로 되살아납니다.
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
# 1) 전역 설치 (아직이면 셋업도 한 번)
|
|
95
|
-
npm install -g discord-agent-bridge
|
|
96
|
-
discord-agent-bridge --setup # 이미 설정했으면 생략
|
|
97
|
-
|
|
98
|
-
# 2) 실행 래퍼 생성 — nvm의 default node를 자동으로 찾으므로 node 버전이 바뀌어도 그대로 동작
|
|
99
|
-
mkdir -p ~/.discord-agent-bridge
|
|
100
|
-
cat > ~/.discord-agent-bridge/run.sh <<'EOF'
|
|
101
|
-
#!/bin/bash
|
|
102
|
-
export NVM_DIR="$HOME/.nvm"
|
|
103
|
-
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
|
104
|
-
nvm use default >/dev/null 2>&1 || nvm use node >/dev/null 2>&1
|
|
105
|
-
exec discord-agent-bridge
|
|
106
|
-
EOF
|
|
107
|
-
chmod +x ~/.discord-agent-bridge/run.sh
|
|
108
|
-
# nvm을 안 쓴다면 run.sh 는 `#!/bin/bash` 와 `exec discord-agent-bridge` 두 줄이면 됩니다(PATH에 node가 있어야 함).
|
|
109
|
-
|
|
110
|
-
# 3) LaunchAgent 등록 파일 생성 ($HOME 는 파일을 만드는 시점에 절대경로로 치환됩니다)
|
|
111
|
-
cat > ~/Library/LaunchAgents/com.discord-agent-bridge.plist <<EOF
|
|
112
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
113
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
114
|
-
<plist version="1.0">
|
|
115
|
-
<dict>
|
|
116
|
-
<key>Label</key><string>com.discord-agent-bridge</string>
|
|
117
|
-
<key>ProgramArguments</key>
|
|
118
|
-
<array>
|
|
119
|
-
<string>/bin/bash</string>
|
|
120
|
-
<string>$HOME/.discord-agent-bridge/run.sh</string>
|
|
121
|
-
</array>
|
|
122
|
-
<key>EnvironmentVariables</key>
|
|
123
|
-
<dict><key>HOME</key><string>$HOME</string></dict>
|
|
124
|
-
<key>RunAtLoad</key><true/>
|
|
125
|
-
<key>KeepAlive</key><true/>
|
|
126
|
-
<key>StandardOutPath</key><string>$HOME/.discord-agent-bridge/agent.out.log</string>
|
|
127
|
-
<key>StandardErrorPath</key><string>$HOME/.discord-agent-bridge/agent.err.log</string>
|
|
128
|
-
</dict>
|
|
129
|
-
</plist>
|
|
130
|
-
EOF
|
|
131
|
-
|
|
132
|
-
# 4) 시작
|
|
133
|
-
launchctl load -w ~/Library/LaunchAgents/com.discord-agent-bridge.plist
|
|
134
|
-
|
|
135
|
-
# 5) 확인 — 'gateway ready' 가 뜨면 성공 (Ctrl+C 로 로그 보기만 빠져나옴, 봇은 계속 돎)
|
|
136
|
-
tail -f ~/.discord-agent-bridge/agent.out.log
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
관리 명령:
|
|
140
|
-
|
|
141
|
-
```bash
|
|
142
|
-
launchctl list | grep discord-agent-bridge # 상태 (1열 PID, 2열 마지막 종료코드)
|
|
143
|
-
launchctl unload ~/Library/LaunchAgents/com.discord-agent-bridge.plist # 중지
|
|
144
|
-
launchctl load -w ~/Library/LaunchAgents/com.discord-agent-bridge.plist # 시작
|
|
145
|
-
```
|
|
146
|
-
|
|
147
69
|
업그레이드:
|
|
148
70
|
|
|
149
71
|
```bash
|
|
150
72
|
npm install -g discord-agent-bridge@latest
|
|
151
|
-
|
|
152
|
-
launchctl load -w ~/Library/LaunchAgents/com.discord-agent-bridge.plist
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
> ⚠️ nvm으로 **node 버전을 바꾸면** 그 버전에서 `npm install -g discord-agent-bridge` 를 한 번 실행하세요(nvm 전역 패키지는 버전별로 분리됩니다). 래퍼가 default node를 따라가므로 plist 자체는 고칠 필요가 없습니다.
|
|
156
|
-
|
|
157
|
-
### 수동 설정 — Windows (작업 스케줄러)
|
|
158
|
-
|
|
159
|
-
`discord-agent-bridge service install` 이 안 될 때 직접 등록하는 방법입니다.
|
|
160
|
-
|
|
161
|
-
**명령어 (관리자 권한 불필요)** — 먼저 PowerShell에서 봇 실제 경로를 확인하세요:
|
|
162
|
-
|
|
163
|
-
```powershell
|
|
164
|
-
where.exe discord-agent-bridge # 예: C:\Users\<나>\AppData\Roaming\npm\discord-agent-bridge.cmd
|
|
165
|
-
|
|
166
|
-
# 위에서 확인한 경로로 로그온 시 자동 실행 등록
|
|
167
|
-
schtasks /create /tn discord-agent-bridge /sc onlogon /tr "C:\Users\<나>\AppData\Roaming\npm\discord-agent-bridge.cmd" /f
|
|
168
|
-
schtasks /query /tn discord-agent-bridge # 상태 확인
|
|
169
|
-
schtasks /run /tn discord-agent-bridge # 지금 바로 시작
|
|
170
|
-
schtasks /delete /tn discord-agent-bridge /f # 해제
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
**GUI 로 하려면**: 시작 메뉴 → **작업 스케줄러** → **기본 작업 만들기** → 이름 `discord-agent-bridge`, 트리거 **로그온할 때**, 동작 **프로그램 시작** → 위 `where.exe` 로 확인한 `.cmd` 경로 입력 → 마침.
|
|
174
|
-
|
|
175
|
-
> onlogon 작업은 **로그인 시** 실행이며 **크래시 시 자동 재시작은 보장하지 않습니다.** 크래시 자동 복구·로그인 전 실행까지 원하면 진짜 Windows 서비스가 필요합니다 — [nssm](https://nssm.cc/) 으로 등록하세요(관리자 권한 필요):
|
|
176
|
-
>
|
|
177
|
-
> ```powershell
|
|
178
|
-
> nssm install discord-agent-bridge "C:\Program Files\nodejs\node.exe" "C:\Users\<나>\AppData\Roaming\npm\node_modules\discord-agent-bridge\dist\cli.js"
|
|
179
|
-
> nssm start discord-agent-bridge
|
|
180
|
-
> ```
|
|
181
|
-
|
|
182
|
-
### 수동 설정 — PM2 (Linux · Windows 대안)
|
|
183
|
-
|
|
184
|
-
Linux·Windows에서는 [PM2](https://pm2.keymetrics.io/) 를 써도 됩니다(로그·재시작·상태 확인이 편리). **macOS에서는 PM2 대신 위 `service install`/launchd 를 쓰세요** — PM2의 fork 래퍼가 macOS에서 봇의 게이트웨이 연결을 막는 경우가 있습니다.
|
|
185
|
-
|
|
186
|
-
```bash
|
|
187
|
-
# 1) 전역 설치 (PM2가 안정적으로 실행할 커맨드가 있어야 함)
|
|
188
|
-
npm install -g discord-agent-bridge
|
|
189
|
-
|
|
190
|
-
# 2) 아직 셋업 안 했다면 한 번 실행
|
|
191
|
-
discord-agent-bridge --setup
|
|
192
|
-
|
|
193
|
-
# 3) PM2 설치
|
|
194
|
-
npm install -g pm2
|
|
195
|
-
|
|
196
|
-
# 4) PM2에 봇을 등록·실행
|
|
197
|
-
pm2 start discord-agent-bridge --name discord-agent-bridge
|
|
198
|
-
|
|
199
|
-
# 5) 현재 프로세스 목록을 스냅샷 저장 (재부팅 시 복구 대상)
|
|
200
|
-
pm2 save
|
|
201
|
-
|
|
202
|
-
# 6) 부팅 시 PM2 자동 시작 등록 (macOS는 launchd로 등록됨)
|
|
203
|
-
pm2 startup
|
|
204
|
-
# ↑ 출력되는 `sudo ...` 명령을 그대로 복사해 한 번 실행하세요.
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
일상적인 관리 명령:
|
|
208
|
-
|
|
209
|
-
```bash
|
|
210
|
-
pm2 status # 실행 상태
|
|
211
|
-
pm2 logs discord-agent-bridge # 실시간 로그
|
|
212
|
-
pm2 restart discord-agent-bridge # 재시작 (업그레이드 후에도 사용)
|
|
213
|
-
pm2 stop discord-agent-bridge # 중지
|
|
214
|
-
pm2 delete discord-agent-bridge # 등록 해제
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
PM2 상태에서 업그레이드:
|
|
218
|
-
|
|
219
|
-
```bash
|
|
220
|
-
npm install -g discord-agent-bridge@latest
|
|
221
|
-
pm2 restart discord-agent-bridge
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
> ⚠️ nvm/asdf를 쓴다면, PM2가 부팅 시점에도 셸에서 쓰는 것과 **같은 `node`** 를 찾을 수 있어야 합니다. `which node`로 확인한 경로가 부팅 환경에서도 유효해야 합니다 — 아니면 재부팅 후 PM2가 봇을 못 띄웁니다.
|
|
225
|
-
|
|
226
|
-
### npx로 실행 (빠르게 시험해보기)
|
|
227
|
-
|
|
228
|
-
설치 없이 바로 한 번 띄워보고 싶을 때 쓰세요. `npx` 가 최신 버전을 받아 실행하며, 최초 실행이면 셋업 마법사가 먼저 뜬 뒤 이어서 봇이 시작됩니다. (터미널을 닫으면 봇도 종료됩니다 — 계속 켜두려면 위 PM2 방식을 쓰세요.)
|
|
229
|
-
|
|
230
|
-
```bash
|
|
231
|
-
# 최초 실행 — 셋업 마법사가 자동으로 뜬 뒤 이어서 봇이 시작됩니다.
|
|
232
|
-
# (토큰/Client ID 입력, 인텐트 확인, 초대 링크 생성 — 기본값은 안 물어봄)
|
|
233
|
-
npx discord-agent-bridge
|
|
234
|
-
|
|
235
|
-
# 이후 실행 — 이미 설정돼 있으면 바로 봇이 시작됩니다.
|
|
236
|
-
npx discord-agent-bridge
|
|
237
|
-
|
|
238
|
-
# 다시 설정만 하고 싶을 때 (봇은 시작하지 않음)
|
|
239
|
-
npx discord-agent-bridge --setup
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
전역 설치도 가능합니다: `npm install -g discord-agent-bridge` 후 `discord-agent-bridge` / `discord-agent-bridge --setup`.
|
|
243
|
-
|
|
244
|
-
### 업그레이드
|
|
245
|
-
|
|
246
|
-
새 버전이 나오면:
|
|
247
|
-
|
|
248
|
-
```bash
|
|
249
|
-
# npx 사용자 — @latest 를 붙이면 항상 최신을 받습니다(npx는 캐시를 쓸 수 있어요).
|
|
250
|
-
npx discord-agent-bridge@latest
|
|
251
|
-
|
|
252
|
-
# 전역 설치 사용자
|
|
253
|
-
npm install -g discord-agent-bridge@latest
|
|
73
|
+
discord-agent-bridge service restart
|
|
254
74
|
```
|
|
255
75
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
**셋업 마법사(`--setup`)** 가 물어보는 것 — **토큰(비밀)만 터미널에서 입력**합니다. 그 외 값은 하나도 안 물어봅니다:
|
|
259
|
-
1. Discord 봇 **토큰** (비밀 → 터미널에서만 붙여넣기)
|
|
260
|
-
2. **Client ID**
|
|
261
|
-
3. Message Content Intent 켰는지 확인
|
|
262
|
-
4. 초대 URL 생성 → 서버에 초대
|
|
263
|
-
|
|
264
|
-
> **역할도, 기본값도 터미널에서 안 정합니다.** 봇을 서버에 초대한 뒤 Discord에서 **`/config`** 명령으로 설정하세요:
|
|
265
|
-
> - **역할 티어** — 역할 이름을 **클릭**해 지정(역할 ID 복사·개발자 모드 불필요). 지정 전에는 **모두 거부(deny-by-default)**.
|
|
266
|
-
> - **기본값** — **기본 백엔드·모델·권한 모드·언어(locale)** 는 드롭다운에서 고르면 **바로 저장**되고, **Codex 기본 경로(codexHome)** 는 "Codex 경로 설정" 버튼 → 입력창(모달)에서 지정합니다. 언어는 `한국어 (ko)` / `English (en)` 중에서 선택합니다.
|
|
267
|
-
|
|
268
|
-
설정은 `~/.discord-agent-bridge/` 에 저장됩니다(토큰 파일 권한 600). 역할·기본값은 서버별로 `servers/<guildId>.json` 에 저장됩니다.
|
|
76
|
+
> ⚠️ **Windows 참고**: 작업 스케줄러 로그온 트리거로 등록되므로 **로그인 시 자동 시작**됩니다(관리자 권한 불필요). 크래시 시 자동 재시작은 보장하지 않습니다(macOS · Linux는 보장).
|
|
269
77
|
|
|
270
78
|
---
|
|
271
79
|
|
|
272
80
|
## 3단계 — Discord에서 사용하기
|
|
273
81
|
|
|
274
|
-
봇이 서버에 들어오면 **컨트롤 채널(`#session-generator`)
|
|
82
|
+
봇이 서버에 들어오면 **컨트롤 채널(`#session-generator`), 세션 카테고리, 알림 채널(`#agent-status`)이 자동으로 생성**됩니다(봇에 채널 관리 권한이 있는 한). 이후 흐름: **`/config` → `/agent start`**.
|
|
275
83
|
|
|
276
|
-
1. **(자동)** 봇
|
|
277
|
-
2. **`/config`** (관리자)
|
|
278
|
-
3. `#session-generator` 에서 **`/agent start
|
|
279
|
-
|
|
280
|
-
4. 만들어진 세션 채널에서 **그냥 메시지로 대화**하면 됩니다. Claude 모드는 스트리밍 출력·툴 실행 스레드·권한 승인 버튼이 뜹니다.
|
|
281
|
-
5. 필요할 때 명령어 사용.
|
|
84
|
+
1. **(자동)** 봇 시작 또는 서버 초대 시점에 위 채널 구조가 생깁니다. 관리자가 **`/init`** 으로 수동 재생성해도 됩니다(기존 채널은 재사용).
|
|
85
|
+
2. **`/config`** (관리자) — 역할 티어와 기본값을 지정합니다. 서버 관리자(Administrator)는 역할 설정 없이도 항상 사용할 수 있습니다.
|
|
86
|
+
3. `#session-generator` 에서 **`/agent start`**. **마법사**가 순서대로 안내합니다: **작업 폴더 → 백엔드(Claude / Codex) → 모델 → 추론 수준 → 권한 모드**. 각 단계는 **"다음" 버튼**으로 넘어갑니다. 폴더 브라우저는 상위/다른 볼륨 이동, 새 폴더 생성, 이전 세션 재개까지 지원합니다. 확인하면 **전용 세션 채널(`proj-<폴더>`)** 이 새로 생기고 그 채널에 바인딩됩니다.
|
|
87
|
+
4. 만들어진 세션 채널에서 **일반 메시지로 그냥 대화**하면 됩니다. Claude 모드는 스트리밍 응답, 툴 실행 스레드, 권한 승인 버튼이 뜹니다.
|
|
282
88
|
|
|
283
89
|
### 주요 명령어
|
|
90
|
+
|
|
284
91
|
| 명령어 | 설명 |
|
|
285
92
|
|---|---|
|
|
286
|
-
| `/init` | (관리자) 컨트롤 채널 + 세션 카테고리 생성 (
|
|
287
|
-
| `/agent start` | 새 세션 시작 — 마법사 확인 시 전용 세션
|
|
93
|
+
| `/init` | (관리자) 컨트롤 채널 + 세션 카테고리 생성 (기존이 있으면 재사용) |
|
|
94
|
+
| `/agent start` | 새 세션 시작 — 마법사 확인 시 전용 세션 채널 생성 |
|
|
288
95
|
| `/agent resume` | 이전 세션 이어하기 |
|
|
289
96
|
| `/agent close` | 세션 종료 + 세션 채널 삭제 |
|
|
290
|
-
| `/agent stats` | 활성 세션 · 세션 통계 · Claude 사용량
|
|
97
|
+
| `/agent stats` | 활성 세션 · 세션 통계 · Claude 사용량 (본인에게만 표시) |
|
|
291
98
|
| `/mode <claude\|codex>` | 백엔드 전환 (⚠️ 새 대화로 시작 — 이전 맥락 미승계) |
|
|
292
99
|
| `/mode perm <모드\|프로필>` | 권한 모드/프로필 전환 (세션 유지) |
|
|
293
100
|
| `/stop` | 현재 세션 즉시 중단 (킬 스위치) |
|
|
294
101
|
| `/stop-all` | (관리자) 모든 세션 중단 |
|
|
295
|
-
| `/config` | (관리자) 역할 티어 + 기본값(
|
|
102
|
+
| `/config` | (관리자) 역할 티어 + 기본값(백엔드 · 모델 · 권한 모드 · 언어 · Codex 경로) 설정 |
|
|
103
|
+
|
|
104
|
+
### 권한 모드
|
|
296
105
|
|
|
297
|
-
|
|
298
|
-
- `default` — 도구 실행 전마다 **Allow/Deny 버튼**으로 확인 (가장 안전)
|
|
106
|
+
- `default` — 툴을 실행할 때마다 **Allow/Deny 버튼**으로 물어봅니다 (가장 안전)
|
|
299
107
|
- `acceptEdits` — 파일 수정은 자동 수락
|
|
300
|
-
- `plan` —
|
|
108
|
+
- `plan` — 계획만 세우고 실행은 보류
|
|
301
109
|
- `bypassPermissions` — 전부 자동 (신뢰하는 프로젝트에서만)
|
|
302
110
|
|
|
303
|
-
|
|
111
|
+
Codex는 자신의 승인/샌드박스 모드로 매핑합니다.
|
|
304
112
|
|
|
305
113
|
### 이벤트 알림 (`#agent-status`)
|
|
306
114
|
|
|
307
|
-
여러 세션의 **작업
|
|
115
|
+
여러 세션의 **작업 완료와 에러**를 `#agent-status` 채널 한 곳에 요약해 알려줍니다. `/config` → **🔔 알림 설정** 에서 켜기/끄기와 대상 채널을 바꿀 수 있습니다.
|
|
308
116
|
|
|
309
117
|
---
|
|
310
118
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
이 봇은 **당신 PC에서, 당신 계정 권한으로** 코드를 실행합니다. 즉 봇에게 명령할 수 있는 사람은 **당신 컴퓨터에서 명령을 실행할 수 있는 사람**입니다. 그래서 역할 통제가 필수입니다.
|
|
314
|
-
|
|
315
|
-
- **역할 티어 3단계** — Discord에서 **`/config`** 로 역할 이름을 **클릭**해 지정합니다(역할 ID·개발자 모드 불필요). admin ⊇ execute ⊇ read-only:
|
|
316
|
-
- **admin** — 설정/`stop-all`/`config` 등 관리
|
|
317
|
-
- **execute** — 세션 시작·명령 실행
|
|
318
|
-
- **read-only** — 읽기만
|
|
319
|
-
- > `/config` 는 처음엔 **서버 관리자(Administrator)** 권한이 있는 사람만 열 수 있고(허용 목록이 비어 있어도 부트스트랩 가능), 이후엔 admin 티어도 사용할 수 있습니다.
|
|
320
|
-
- **기본은 거부(deny-by-default)** — 허용 목록에 없는 사람은 아무것도 못 합니다. `/config` 로 지정하기 전에는 아무도 실행할 수 없습니다.
|
|
321
|
-
- **프로젝트별 접근 제어(ACL)** — 특정 프로젝트를 지정한 역할/사람만 쓰게 할 수 있습니다.
|
|
322
|
-
- **감사 로그** — 누가 언제 무엇을 했는지 `~/.discord-agent-bridge/audit/` 에 기록됩니다.
|
|
323
|
-
|
|
324
|
-
> ⚠️ **보안 주의:** 신뢰하지 않는 서버에 봇을 초대하거나 execute 역할을 너무 넓게 주지 마세요. 작업 폴더 밖(예: `~/.ssh`)은 봇이 접근하지 못하도록 기본 차단되어 있습니다.
|
|
325
|
-
|
|
326
|
-
---
|
|
327
|
-
|
|
328
|
-
## Claude 모드 vs Codex 모드
|
|
329
|
-
|
|
330
|
-
| | Claude 모드 | Codex 모드 |
|
|
331
|
-
|---|---|---|
|
|
332
|
-
| 실시간 스트리밍 | ✅ | ❌ (최종 결과 위주) |
|
|
333
|
-
| 툴 실행 스레드 | ✅ | ❌ |
|
|
334
|
-
| 권한 승인 버튼 | ✅ | ❌ (승인/샌드박스 모드로 대체) |
|
|
335
|
-
| 세션 이어하기 | ✅ | ✅ |
|
|
336
|
-
| **사용량/한도 표시** | ✅ (5시간·주간·컨텍스트) | ❌ (Codex CLI 제약) |
|
|
337
|
-
|
|
338
|
-
### 터미널에서 쓰던 거랑 똑같나요?
|
|
339
|
-
|
|
340
|
-
- **Claude 모드** — 터미널의 `claude`와 **같은 엔진**(공식 Claude Agent SDK)을 사용합니다. 프로젝트의 `.claude/` 설정을 그대로 읽어 **서브에이전트·스킬·훅·MCP가 동일하게** 동작하도록 만듭니다. 달라지는 건 입력이 Discord 메시지, 출력이 임베드/스레드라는 **표현 방식**뿐입니다. (터미널에서 타이핑하는 TUI 전용 슬래시 명령은 그대로 치는 방식이 아니라 SDK 방식으로 처리됩니다.)
|
|
341
|
-
- **Codex 모드** — `codex exec`(비대화형)로 구동합니다. 같은 Codex 엔진에 설정/MCP를 로드하며, **훅(SessionStart/UserPromptSubmit/Stop 등)도 비대화형 모드에서 정상 발동함을 실측 확인**했습니다. 다만 승인 방식은 인터랙티브 모드와 다르게 매핑됩니다(아래 권한 모드 참고).
|
|
342
|
-
|
|
343
|
-
### 커스텀 슬래시 명령 / 스킬 / 플러그인 명령
|
|
344
|
-
|
|
345
|
-
세션 채널에 보내는 메시지는 가공 없이 그대로 Claude/Codex에 전달되므로, **`.claude/commands/`·`.claude/skills/`(Claude) 또는 `.codex/skills/`(Codex)에 정의된 명령·스킬, 그리고 플러그인이 설치한 명령**도 터미널과 똑같이 `/이름` 을 그대로 타이핑하면 동작합니다(Claude/Codex 실제 CLI로 실측 검증됨). Discord 자체 슬래시 명령(`/agent`, `/config` 등)과는 충돌하지 않습니다 — 세션 채널의 일반 텍스트 메시지이기 때문입니다.
|
|
346
|
-
|
|
347
|
-
---
|
|
348
|
-
|
|
349
|
-
## 설정 파일 위치
|
|
350
|
-
|
|
351
|
-
```
|
|
352
|
-
~/.discord-agent-bridge/
|
|
353
|
-
├─ config.json # 봇 토큰·Client ID·기본값·한도 (권한 600)
|
|
354
|
-
├─ servers/<guildId>.json # 서버별 역할 티어·기본값 · 채널 구조(control/sessions/status) ID · 알림 설정 (권한 600)
|
|
355
|
-
├─ state.json # 채널↔세션 바인딩 (재시작 후 자동 복구)
|
|
356
|
-
└─ audit/audit.jsonl # 감사 로그
|
|
357
|
-
```
|
|
358
|
-
설정은 **전역 → 서버 → 프로젝트** 순으로 덮어써집니다.
|
|
359
|
-
|
|
360
|
-
---
|
|
361
|
-
|
|
362
|
-
## 문제 해결
|
|
363
|
-
|
|
364
|
-
- **봇이 메시지에 반응하지 않아요** → Developer Portal에서 **Message Content Intent**가 켜져 있는지 확인.
|
|
365
|
-
- **슬래시 명령이 안 보여요** → 초대 시 `applications.commands` 스코프를 포함했는지 확인(등록에 몇 분 걸릴 수 있음).
|
|
366
|
-
- **권한 오류로 채널 생성 실패** → 봇에게 `Manage Channels` 권한이 있는지 확인.
|
|
367
|
-
- **사용량 패널이 안 떠요** → Claude Pro/Max **구독 로그인**(`~/.claude`) 상태여야 합니다. API 키만 쓰면 이 패널은 숨겨집니다(정상).
|
|
368
|
-
- **"권한이 없습니다: No authorized role for this actor (fail-secure)."** → 접속한 계정에 허용 목록(admin/execute/read-only)에 등록된 역할이 하나도 없다는 뜻입니다. 기본이 거부(deny-by-default)라 이렇게 나옵니다. 아래 중 하나로 해결하세요:
|
|
369
|
-
1. **가장 간단** — 그 계정에 Discord **서버 관리자(Administrator)** 권한을 부여. 서버 관리자는 허용 목록과 무관하게 admin 티어로 무조건 통과됩니다.
|
|
370
|
-
2. **이미 지정된 역할 부여** — Discord 서버의 구성원 화면에서, `/config`에 티어로 이미 등록되어 있는 역할을 그 계정에 붙여줍니다.
|
|
371
|
-
3. **역할을 티어에 추가** — 관리자 계정에서 `/config` → **역할 티어** 로 들어가, 그 계정이 가진 역할을 원하는 티어(admin/execute/read-only)에 클릭해 추가합니다.
|
|
372
|
-
|
|
373
|
-
---
|
|
374
|
-
|
|
375
|
-
## 개발
|
|
376
|
-
|
|
377
|
-
```bash
|
|
378
|
-
npm install
|
|
379
|
-
npm run dev # tsx watch (개발 모드)
|
|
380
|
-
npm run typecheck # 타입 검사
|
|
381
|
-
npm run test # 테스트 (vitest)
|
|
382
|
-
```
|
|
383
|
-
|
|
384
|
-
## 라이선스
|
|
385
|
-
|
|
386
|
-
MIT
|
|
119
|
+
License: MIT
|
package/README.md
CHANGED
|
@@ -4,384 +4,116 @@
|
|
|
4
4
|
|
|
5
5
|
> Self-hosted Discord bot that runs AI coding agents — Claude Code, Codex, and more — per channel. Role-based access, multi-server, extensible.
|
|
6
6
|
|
|
7
|
-
**A self-hosted Discord bot that
|
|
8
|
-
|
|
9
|
-
- Currently supports: **Claude Code**, **Codex**
|
|
10
|
-
- Extensible: add a mode plugin to connect other agents (e.g. opencode) in the future
|
|
11
|
-
|
|
12
|
-
> ✅ **Published on npm.** Run it instantly with `npx discord-agent-bridge` (recommended), or install globally / build from source. Supports both **Claude Code** and **Codex** backends.
|
|
7
|
+
**A self-hosted Discord bot that puts Claude Code (or Codex) into a Discord channel, running on your own machine.** Published on npm — one `npm install -g` and three commands to auto-start.
|
|
13
8
|
|
|
14
9
|
---
|
|
15
10
|
|
|
16
|
-
##
|
|
11
|
+
## Why this?
|
|
17
12
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- **One channel = one
|
|
21
|
-
- **
|
|
22
|
-
- **
|
|
13
|
+
- 🏠 **Fully self-hosted.** The bot runs on your PC. Your code, your sessions, and your CLI tokens never leave your machine.
|
|
14
|
+
- 📱 **You don't need to be at your desk.** Fire off a task from Discord on your phone — streaming output, tool-run logs, and permission prompts all show up in the channel.
|
|
15
|
+
- 🗂️ **One channel = one project = one session.** Each channel is bound to its own folder, backend, model, and permission mode. Isolated by design.
|
|
16
|
+
- 👥 **Team-friendly by default.** Anyone in the channel can watch the session unfold. A 3-tier role system (admin / execute / read-only) controls who can actually run things.
|
|
17
|
+
- 🔀 **Claude ⇄ Codex on the fly.** Switch backends with a single `/mode` command.
|
|
18
|
+
- ⚙️ **Same power as the terminal.** Reads your project's `.claude/` and `.codex/` configs as-is — subagents, skills, hooks, MCP, and plugin commands all work exactly like they do in the CLI.
|
|
23
19
|
|
|
24
20
|
---
|
|
25
21
|
|
|
26
22
|
## Prerequisites
|
|
27
23
|
|
|
28
24
|
- **Node.js 20 or later**
|
|
29
|
-
- The CLI for whichever backend you use
|
|
30
|
-
- **Claude mode** → [Claude Code](https://docs.anthropic.com/en/docs/claude-code)
|
|
31
|
-
- **Codex mode** → the `codex` CLI
|
|
32
|
-
- **A Discord bot token** (
|
|
25
|
+
- The CLI for whichever backend you'll use, already **installed and logged in**:
|
|
26
|
+
- **Claude mode** → [Claude Code](https://docs.anthropic.com/en/docs/claude-code) (`claude` login, or `ANTHROPIC_API_KEY`)
|
|
27
|
+
- **Codex mode** → the `codex` CLI, logged in
|
|
28
|
+
- **A Discord bot token** (Step 1 below)
|
|
33
29
|
|
|
34
30
|
---
|
|
35
31
|
|
|
36
|
-
## Step 1 — Create a Discord bot
|
|
32
|
+
## Step 1 — Create a Discord bot
|
|
37
33
|
|
|
38
|
-
You need
|
|
34
|
+
You need your own bot. About 5 minutes.
|
|
39
35
|
|
|
40
|
-
1.
|
|
41
|
-
2. Left sidebar **Bot** tab → **Reset Token** → **copy the token** and
|
|
42
|
-
- ⚠️ This token is a password. If it
|
|
43
|
-
3. Still
|
|
44
|
-
- ✅ **MESSAGE CONTENT INTENT** — **required** (the bot
|
|
45
|
-
- ✅ **SERVER MEMBERS INTENT** — recommended (used for role
|
|
46
|
-
- Enable
|
|
47
|
-
4. Left sidebar **OAuth2** tab → copy the **Client ID (Application ID)
|
|
36
|
+
1. Open the **[Discord Developer Portal](https://discord.com/developers/applications)** → top-right **New Application** → give it a name (e.g. `my-agent-bot`) → **Create**.
|
|
37
|
+
2. Left sidebar **Bot** tab → **Reset Token** → **copy the token** and stash it somewhere safe.
|
|
38
|
+
- ⚠️ This token is a password. If it leaks, hit **Reset Token** immediately.
|
|
39
|
+
3. Still on the **Bot** tab, under **Privileged Gateway Intents**:
|
|
40
|
+
- ✅ **MESSAGE CONTENT INTENT** — **required** (the bot has to read message content)
|
|
41
|
+
- ✅ **SERVER MEMBERS INTENT** — recommended (used for role checks)
|
|
42
|
+
- Enable and **Save Changes**.
|
|
43
|
+
4. Left sidebar **OAuth2** tab → copy the **Client ID (Application ID)**.
|
|
48
44
|
5. **Build an invite link** — OAuth2 → **URL Generator**:
|
|
49
45
|
- **Scopes**: `bot`, `applications.commands`
|
|
50
46
|
- **Bot Permissions**: `Manage Channels`, `Send Messages`, `Embed Links`, `Attach Files`, `Read Message History`, `Create Public Threads`, `Send Messages in Threads`, `Manage Threads`, `Add Reactions`
|
|
51
47
|
- Paste the generated URL into your browser and **invite it to your server**.
|
|
52
|
-
- (The setup wizard can also generate this invite link for you automatically — see Step 2.)
|
|
53
48
|
|
|
54
49
|
---
|
|
55
50
|
|
|
56
51
|
## Step 2 — Install & run
|
|
57
52
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
The simplest path. These three lines take you from install to auto-start on reboot. `service install` registers the right auto-start for your OS — **launchd on macOS, systemd on Linux, Task Scheduler on Windows**.
|
|
53
|
+
Three lines take you from install to auto-start on reboot. `service install` picks the right auto-start for your OS — **launchd on macOS, systemd on Linux, Task Scheduler on Windows**.
|
|
61
54
|
|
|
62
55
|
```bash
|
|
63
56
|
npm install -g discord-agent-bridge # install
|
|
64
|
-
discord-agent-bridge --setup # first
|
|
57
|
+
discord-agent-bridge --setup # first run only (enter token, etc.)
|
|
65
58
|
discord-agent-bridge service install # register auto-start + start now
|
|
66
59
|
```
|
|
67
60
|
|
|
68
|
-
|
|
61
|
+
Manage it:
|
|
69
62
|
|
|
70
63
|
```bash
|
|
71
|
-
discord-agent-bridge service status # registered / running?
|
|
64
|
+
discord-agent-bridge service status # is it registered / running?
|
|
72
65
|
discord-agent-bridge service restart # restart
|
|
73
66
|
discord-agent-bridge service uninstall # remove
|
|
74
67
|
```
|
|
75
68
|
|
|
76
|
-
|
|
69
|
+
Upgrade:
|
|
77
70
|
|
|
78
71
|
```bash
|
|
79
72
|
npm install -g discord-agent-bridge@latest
|
|
80
73
|
discord-agent-bridge service restart
|
|
81
74
|
```
|
|
82
75
|
|
|
83
|
-
> ⚠️ **Windows note**:
|
|
84
|
-
|
|
85
|
-
---
|
|
86
|
-
|
|
87
|
-
The rest of this section is the **manual methods**, for when `service install` doesn't work or you want to set it up yourself.
|
|
88
|
-
|
|
89
|
-
### Manual setup — macOS (launchd)
|
|
90
|
-
|
|
91
|
-
Run the bot directly under **launchd**, the built-in macOS service manager — it starts at login and restarts automatically if it stops.
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
# 1) Install globally (and run setup once if you haven't)
|
|
95
|
-
npm install -g discord-agent-bridge
|
|
96
|
-
discord-agent-bridge --setup # skip if already configured
|
|
97
|
-
|
|
98
|
-
# 2) Create a launcher wrapper — it finds nvm's default node dynamically,
|
|
99
|
-
# so it keeps working even after you switch node versions.
|
|
100
|
-
mkdir -p ~/.discord-agent-bridge
|
|
101
|
-
cat > ~/.discord-agent-bridge/run.sh <<'EOF'
|
|
102
|
-
#!/bin/bash
|
|
103
|
-
export NVM_DIR="$HOME/.nvm"
|
|
104
|
-
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
|
105
|
-
nvm use default >/dev/null 2>&1 || nvm use node >/dev/null 2>&1
|
|
106
|
-
exec discord-agent-bridge
|
|
107
|
-
EOF
|
|
108
|
-
chmod +x ~/.discord-agent-bridge/run.sh
|
|
109
|
-
# Not using nvm? run.sh can just be `#!/bin/bash` + `exec discord-agent-bridge` (node must be on PATH).
|
|
110
|
-
|
|
111
|
-
# 3) Create the LaunchAgent ($HOME is expanded to an absolute path as the file is written)
|
|
112
|
-
cat > ~/Library/LaunchAgents/com.discord-agent-bridge.plist <<EOF
|
|
113
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
114
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
115
|
-
<plist version="1.0">
|
|
116
|
-
<dict>
|
|
117
|
-
<key>Label</key><string>com.discord-agent-bridge</string>
|
|
118
|
-
<key>ProgramArguments</key>
|
|
119
|
-
<array>
|
|
120
|
-
<string>/bin/bash</string>
|
|
121
|
-
<string>$HOME/.discord-agent-bridge/run.sh</string>
|
|
122
|
-
</array>
|
|
123
|
-
<key>EnvironmentVariables</key>
|
|
124
|
-
<dict><key>HOME</key><string>$HOME</string></dict>
|
|
125
|
-
<key>RunAtLoad</key><true/>
|
|
126
|
-
<key>KeepAlive</key><true/>
|
|
127
|
-
<key>StandardOutPath</key><string>$HOME/.discord-agent-bridge/agent.out.log</string>
|
|
128
|
-
<key>StandardErrorPath</key><string>$HOME/.discord-agent-bridge/agent.err.log</string>
|
|
129
|
-
</dict>
|
|
130
|
-
</plist>
|
|
131
|
-
EOF
|
|
132
|
-
|
|
133
|
-
# 4) Start it
|
|
134
|
-
launchctl load -w ~/Library/LaunchAgents/com.discord-agent-bridge.plist
|
|
135
|
-
|
|
136
|
-
# 5) Verify — seeing 'gateway ready' means success (Ctrl+C only exits the log view; the bot keeps running)
|
|
137
|
-
tail -f ~/.discord-agent-bridge/agent.out.log
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
Management:
|
|
141
|
-
|
|
142
|
-
```bash
|
|
143
|
-
launchctl list | grep discord-agent-bridge # status (col 1 = PID, col 2 = last exit code)
|
|
144
|
-
launchctl unload ~/Library/LaunchAgents/com.discord-agent-bridge.plist # stop
|
|
145
|
-
launchctl load -w ~/Library/LaunchAgents/com.discord-agent-bridge.plist # start
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
Upgrading:
|
|
149
|
-
|
|
150
|
-
```bash
|
|
151
|
-
npm install -g discord-agent-bridge@latest
|
|
152
|
-
launchctl unload ~/Library/LaunchAgents/com.discord-agent-bridge.plist
|
|
153
|
-
launchctl load -w ~/Library/LaunchAgents/com.discord-agent-bridge.plist
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
> ⚠️ If you switch node versions with nvm, run `npm install -g discord-agent-bridge` once under the new version (nvm keeps global packages per version). The wrapper follows nvm's default node, so the plist itself never needs editing.
|
|
157
|
-
|
|
158
|
-
### Manual setup — Windows (Task Scheduler)
|
|
159
|
-
|
|
160
|
-
Register it yourself when `discord-agent-bridge service install` doesn't work.
|
|
161
|
-
|
|
162
|
-
**Commands (no admin needed)** — first find the bot's real path in PowerShell:
|
|
163
|
-
|
|
164
|
-
```powershell
|
|
165
|
-
where.exe discord-agent-bridge # e.g. C:\Users\<you>\AppData\Roaming\npm\discord-agent-bridge.cmd
|
|
166
|
-
|
|
167
|
-
# Register a logon-triggered task using the path from above
|
|
168
|
-
schtasks /create /tn discord-agent-bridge /sc onlogon /tr "C:\Users\<you>\AppData\Roaming\npm\discord-agent-bridge.cmd" /f
|
|
169
|
-
schtasks /query /tn discord-agent-bridge # status
|
|
170
|
-
schtasks /run /tn discord-agent-bridge # start now
|
|
171
|
-
schtasks /delete /tn discord-agent-bridge /f # remove
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
**GUI**: Start menu → **Task Scheduler** → **Create Basic Task** → name `discord-agent-bridge`, trigger **When I log on**, action **Start a program** → the `.cmd` path from `where.exe` → Finish.
|
|
175
|
-
|
|
176
|
-
> A logon task runs **at login** and does **not** guarantee restart on crash. For crash recovery / running before login you need a real Windows service — register one with [nssm](https://nssm.cc/) (admin required):
|
|
177
|
-
>
|
|
178
|
-
> ```powershell
|
|
179
|
-
> nssm install discord-agent-bridge "C:\Program Files\nodejs\node.exe" "C:\Users\<you>\AppData\Roaming\npm\node_modules\discord-agent-bridge\dist\cli.js"
|
|
180
|
-
> nssm start discord-agent-bridge
|
|
181
|
-
> ```
|
|
182
|
-
|
|
183
|
-
### Manual setup — PM2 (Linux / Windows alternative)
|
|
184
|
-
|
|
185
|
-
On Linux/Windows you can also use [PM2](https://pm2.keymetrics.io/) (handy logs, restart, status). **On macOS, use `service install`/launchd instead** — PM2's fork wrapper can prevent the bot from opening its gateway connection on macOS.
|
|
186
|
-
|
|
187
|
-
```bash
|
|
188
|
-
# 1) Install the bot globally (so PM2 has a stable command to run)
|
|
189
|
-
npm install -g discord-agent-bridge
|
|
190
|
-
|
|
191
|
-
# 2) Run --setup once if you haven't yet
|
|
192
|
-
discord-agent-bridge --setup
|
|
193
|
-
|
|
194
|
-
# 3) Install PM2
|
|
195
|
-
npm install -g pm2
|
|
196
|
-
|
|
197
|
-
# 4) Register the bot with PM2 and start it
|
|
198
|
-
pm2 start discord-agent-bridge --name discord-agent-bridge
|
|
199
|
-
|
|
200
|
-
# 5) Snapshot the current process list (so PM2 knows what to restore on boot)
|
|
201
|
-
pm2 save
|
|
202
|
-
|
|
203
|
-
# 6) Register PM2 to start at boot (on macOS this wires up launchd)
|
|
204
|
-
pm2 startup
|
|
205
|
-
# ↑ Copy-paste the `sudo ...` command it prints and run it once.
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
Day-to-day management:
|
|
209
|
-
|
|
210
|
-
```bash
|
|
211
|
-
pm2 status # is it running?
|
|
212
|
-
pm2 logs discord-agent-bridge # tail logs
|
|
213
|
-
pm2 restart discord-agent-bridge # restart (also do this after upgrading)
|
|
214
|
-
pm2 stop discord-agent-bridge # stop
|
|
215
|
-
pm2 delete discord-agent-bridge # unregister
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
Upgrading under PM2:
|
|
219
|
-
|
|
220
|
-
```bash
|
|
221
|
-
npm install -g discord-agent-bridge@latest
|
|
222
|
-
pm2 restart discord-agent-bridge
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
> ⚠️ If you use nvm/asdf, PM2 needs to find the same `node` at boot time as it does in your shell. Verify with `which node` and make sure that path is available to the boot environment — otherwise PM2 may fail to start the bot on reboot.
|
|
226
|
-
|
|
227
|
-
### Run with npx (quick try)
|
|
228
|
-
|
|
229
|
-
Use this to spin it up once without installing. `npx` fetches the latest version and runs it; on first run, the setup wizard appears first and the bot starts right after. (Closing the terminal stops the bot — use PM2 above to keep it running.)
|
|
230
|
-
|
|
231
|
-
```bash
|
|
232
|
-
# First run — the setup wizard runs automatically, then the bot starts.
|
|
233
|
-
# (asks for your token/Client ID, checks intents, generates an invite link — no other defaults are asked)
|
|
234
|
-
npx discord-agent-bridge
|
|
235
|
-
|
|
236
|
-
# Later runs — if already configured, the bot starts directly.
|
|
237
|
-
npx discord-agent-bridge
|
|
238
|
-
|
|
239
|
-
# To reconfigure only (without starting the bot)
|
|
240
|
-
npx discord-agent-bridge --setup
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
Global install also works: `npm install -g discord-agent-bridge`, then `discord-agent-bridge` / `discord-agent-bridge --setup`.
|
|
244
|
-
|
|
245
|
-
### Upgrading
|
|
246
|
-
|
|
247
|
-
When a new version is released:
|
|
248
|
-
|
|
249
|
-
```bash
|
|
250
|
-
# npx users — appending @latest always fetches the newest version (npx can otherwise cache).
|
|
251
|
-
npx discord-agent-bridge@latest
|
|
252
|
-
|
|
253
|
-
# Global-install users
|
|
254
|
-
npm install -g discord-agent-bridge@latest
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
Check your installed version with: `discord-agent-bridge --version`.
|
|
258
|
-
|
|
259
|
-
**What the setup wizard (`--setup`) asks for** — the **token (secret) is the only thing you type into the terminal**. Nothing else is asked here:
|
|
260
|
-
1. Your Discord bot **token** (secret — paste it only in the terminal)
|
|
261
|
-
2. Your **Client ID**
|
|
262
|
-
3. Confirmation that Message Content Intent is enabled
|
|
263
|
-
4. Generates an invite URL → invite it to your server
|
|
264
|
-
|
|
265
|
-
> **Roles and defaults are never configured in the terminal.** After inviting the bot to your server, configure them in Discord with the **`/config`** command:
|
|
266
|
-
> - **Role tiers** — assign them by **clicking** a role name (no need to copy a role ID or enable Developer Mode). Until assigned, access is **deny-by-default**.
|
|
267
|
-
> - **Defaults** — **default backend, model, permission mode, and language (locale)** are saved instantly from a dropdown; the **Codex base path (codexHome)** is set via the "Set Codex Path" button → a text-input modal. Language choices are `한국어 (ko)` / `English (en)`.
|
|
268
|
-
|
|
269
|
-
Configuration is stored under `~/.discord-agent-bridge/` (token file permissions 600). Per-server roles and defaults are stored in `servers/<guildId>.json`.
|
|
76
|
+
> ⚠️ **Windows note**: registers a Task Scheduler logon trigger, so the bot **starts at login** (no admin needed). It doesn't guarantee auto-restart on crash (macOS/Linux do).
|
|
270
77
|
|
|
271
78
|
---
|
|
272
79
|
|
|
273
80
|
## Step 3 — Using it in Discord
|
|
274
81
|
|
|
275
|
-
Once the bot joins a server, it **automatically creates a control channel (`#session-generator`), a sessions category, and a notifications channel (`#agent-status`)** (as long as it has
|
|
82
|
+
Once the bot joins a server, it **automatically creates a control channel (`#session-generator`), a sessions category, and a notifications channel (`#agent-status`)** (as long as it has Manage Channels). From there: **`/config` → `/agent start`**.
|
|
276
83
|
|
|
277
|
-
1. **(Automatic)**
|
|
278
|
-
2. **`/config`** (admin)
|
|
279
|
-
3. In `#session-generator`, run **`/agent start
|
|
280
|
-
|
|
281
|
-
4. In the newly created session channel, **just chat with normal messages**. Claude mode shows streaming output, tool-execution threads, and permission approval buttons.
|
|
282
|
-
5. Use the commands below whenever you need them.
|
|
84
|
+
1. **(Automatic)** Channel structure is created on bot start / server invite. Admins can rebuild it manually with **`/init`** (existing channels are reused).
|
|
85
|
+
2. **`/config`** (admin) — set role tiers and defaults. Server Administrators can always use the bot even before roles are configured.
|
|
86
|
+
3. In `#session-generator`, run **`/agent start`**. The **wizard** walks you through: **working folder → backend (Claude / Codex) → model → reasoning effort → permission mode**. Each step advances with a **Next** button. The folder browser lets you navigate to parents/other volumes, create folders, and resume prior sessions. On confirm, a **dedicated session channel (`proj-<folder>`)** is created and bound.
|
|
87
|
+
4. In that session channel, **just send normal messages**. Claude mode gives you streaming output, tool-run threads, and permission approval buttons.
|
|
283
88
|
|
|
284
89
|
### Key commands
|
|
90
|
+
|
|
285
91
|
| Command | Description |
|
|
286
92
|
|---|---|
|
|
287
|
-
| `/init` | (admin) Create the control channel + sessions category (reuses
|
|
288
|
-
| `/agent start` | Start a new session — creates a dedicated session channel
|
|
93
|
+
| `/init` | (admin) Create the control channel + sessions category (reuses existing) |
|
|
94
|
+
| `/agent start` | Start a new session — creates a dedicated session channel on confirm |
|
|
289
95
|
| `/agent resume` | Resume a previous session |
|
|
290
|
-
| `/agent close` | End the session and delete its
|
|
291
|
-
| `/agent stats` |
|
|
292
|
-
| `/mode <claude\|codex>` | Switch backend (⚠️ starts a
|
|
96
|
+
| `/agent close` | End the session and delete its channel |
|
|
97
|
+
| `/agent stats` | Active sessions, session stats, and Claude usage (only you can see it) |
|
|
98
|
+
| `/mode <claude\|codex>` | Switch backend (⚠️ starts a fresh conversation — prior context is not carried over) |
|
|
293
99
|
| `/mode perm <mode\|profile>` | Switch permission mode/profile (session context is preserved) |
|
|
294
|
-
| `/stop` |
|
|
295
|
-
| `/stop-all` | (admin) Stop
|
|
296
|
-
| `/config` | (admin) Configure role tiers + defaults (backend, model, permission mode, language, Codex path)
|
|
297
|
-
|
|
298
|
-
### Permission modes (how autonomous a session is)
|
|
299
|
-
- `default` — confirms every tool execution with **Allow/Deny buttons** (safest)
|
|
300
|
-
- `acceptEdits` — file edits are accepted automatically
|
|
301
|
-
- `plan` — only plans first, holds off on execution
|
|
302
|
-
- `bypassPermissions` — fully automatic (only for projects you trust)
|
|
303
|
-
|
|
304
|
-
(Codex maps these to the CLI's own approval/sandbox modes.)
|
|
305
|
-
|
|
306
|
-
### Event notifications (`#agent-status`)
|
|
307
|
-
|
|
308
|
-
Summarizes **completions and errors** from all your sessions into a single `#agent-status` channel. Toggle it on/off and change the target channel from `/config` → **🔔 Notification Settings**.
|
|
100
|
+
| `/stop` | Stop the current session immediately (kill switch) |
|
|
101
|
+
| `/stop-all` | (admin) Stop every session |
|
|
102
|
+
| `/config` | (admin) Configure role tiers + defaults (backend, model, permission mode, language, Codex path) |
|
|
309
103
|
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
## Permissions & role setup (important)
|
|
313
|
-
|
|
314
|
-
This bot runs code **on your machine, with your account's permissions**. That means anyone who can command the bot is effectively **someone who can run commands on your computer** — so role-based access control is essential.
|
|
315
|
-
|
|
316
|
-
- **3 role tiers** — assign them in Discord via **`/config`** by **clicking** a role name (no role ID or Developer Mode needed). admin ⊇ execute ⊇ read-only:
|
|
317
|
-
- **admin** — manages settings/`stop-all`/`config`
|
|
318
|
-
- **execute** — can start sessions and run commands
|
|
319
|
-
- **read-only** — read access only
|
|
320
|
-
- > `/config` can initially only be opened by someone with **server Administrator** permission (bootstraps even with an empty allow-list); afterward, the admin tier can use it too.
|
|
321
|
-
- **Deny-by-default** — anyone not on the allow-list can do nothing. Until you configure it via `/config`, no one can run anything.
|
|
322
|
-
- **Per-project access control (ACL)** — restrict a specific project to only the roles/people you designate.
|
|
323
|
-
- **Audit log** — who did what and when is recorded in `~/.discord-agent-bridge/audit/`.
|
|
324
|
-
|
|
325
|
-
> ⚠️ **Security note:** Don't invite the bot to servers you don't trust, and don't grant the execute role too broadly. Access outside the working folder (e.g. `~/.ssh`) is blocked by default.
|
|
326
|
-
|
|
327
|
-
---
|
|
104
|
+
### Permission modes
|
|
328
105
|
|
|
329
|
-
|
|
106
|
+
- `default` — asks before each tool run with **Allow/Deny buttons** (safest)
|
|
107
|
+
- `acceptEdits` — file edits auto-accepted
|
|
108
|
+
- `plan` — plans only, no execution
|
|
109
|
+
- `bypassPermissions` — fully automatic (trusted projects only)
|
|
330
110
|
|
|
331
|
-
|
|
332
|
-
|---|---|---|
|
|
333
|
-
| Real-time streaming | ✅ | ❌ (final result only) |
|
|
334
|
-
| Tool-execution threads | ✅ | ❌ |
|
|
335
|
-
| Permission approval buttons | ✅ | ❌ (replaced by approval/sandbox modes) |
|
|
336
|
-
| Session resume | ✅ | ✅ |
|
|
337
|
-
| **Usage/limits display** | ✅ (5-hour · weekly · context) | ❌ (Codex CLI limitation) |
|
|
338
|
-
|
|
339
|
-
### Is this the same as using the terminal?
|
|
340
|
-
|
|
341
|
-
- **Claude mode** — uses the **same engine** as the `claude` terminal (the official Claude Agent SDK). It reads the project's `.claude/` configuration as-is, so **subagents, skills, hooks, and MCP all behave identically**. The only difference is the **presentation**: input comes from Discord messages, output renders as embeds/threads. (TUI-only slash commands you'd type in the interactive terminal are handled through the SDK's mechanism rather than the TUI's own.)
|
|
342
|
-
- **Codex mode** — runs via `codex exec` (non-interactive). It loads the same Codex engine with your config/MCP, and we've **empirically confirmed hooks (SessionStart/UserPromptSubmit/Stop, etc.) fire correctly in non-interactive mode too**. Approval flow is mapped differently than interactive mode, though (see Permission modes above).
|
|
343
|
-
|
|
344
|
-
### Custom slash commands / skills / plugin commands
|
|
345
|
-
|
|
346
|
-
Messages you send in a session channel are forwarded to Claude/Codex verbatim, so **commands/skills defined under `.claude/commands/`, `.claude/skills/` (Claude) or `.codex/skills/` (Codex), as well as commands installed by plugins**, work exactly as they do in the terminal — just type `/name` as-is (verified against the real Claude/Codex CLIs). This doesn't conflict with the bot's own Discord slash commands (`/agent`, `/config`, etc.) since it's just a plain text message in a session channel.
|
|
347
|
-
|
|
348
|
-
---
|
|
111
|
+
Codex maps these onto its own approval/sandbox modes.
|
|
349
112
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
```
|
|
353
|
-
~/.discord-agent-bridge/
|
|
354
|
-
├─ config.json # bot token · Client ID · defaults · limits (permissions 600)
|
|
355
|
-
├─ servers/<guildId>.json # per-server role tiers · defaults · channel structure (control/sessions/status) IDs · notification settings (permissions 600)
|
|
356
|
-
├─ state.json # channel↔session bindings (auto-restored after restart)
|
|
357
|
-
└─ audit/audit.jsonl # audit log
|
|
358
|
-
```
|
|
359
|
-
Configuration is overridden in the order **global → server → project**.
|
|
360
|
-
|
|
361
|
-
---
|
|
362
|
-
|
|
363
|
-
## Troubleshooting
|
|
113
|
+
### Event notifications (`#agent-status`)
|
|
364
114
|
|
|
365
|
-
|
|
366
|
-
- **Slash commands don't show up** → Check that you included the `applications.commands` scope when inviting the bot (registration can take a few minutes).
|
|
367
|
-
- **Channel creation fails with a permission error** → Check that the bot has the `Manage Channels` permission.
|
|
368
|
-
- **The usage panel doesn't appear** → You need to be **logged in with a Claude Pro/Max subscription** (`~/.claude`). This panel is hidden (as expected) if you're only using an API key.
|
|
369
|
-
- **"No authorized role for this actor (fail-secure)."** → The account you signed in with has no role on the allow-list. This is deny-by-default. Fix it with one of these:
|
|
370
|
-
1. **Simplest** — give that account Discord's **server Administrator** permission. Administrators are unconditionally treated as the admin tier and bypass the allow-list.
|
|
371
|
-
2. **Assign a listed role** — in the Discord server's member list, give the account one of the roles that's already tied to a tier under `/config`.
|
|
372
|
-
3. **Add the role to a tier** — from an admin account, open `/config` → **Role tiers** and click the account's role into the tier you want (admin/execute/read-only).
|
|
115
|
+
Completions and errors from all your sessions get summarized into a single `#agent-status` channel. Toggle it and change the target channel from `/config` → **🔔 Notification Settings**.
|
|
373
116
|
|
|
374
117
|
---
|
|
375
118
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
```bash
|
|
379
|
-
npm install
|
|
380
|
-
npm run dev # tsx watch (dev mode)
|
|
381
|
-
npm run typecheck # type checking
|
|
382
|
-
npm run test # tests (vitest)
|
|
383
|
-
```
|
|
384
|
-
|
|
385
|
-
## License
|
|
386
|
-
|
|
387
|
-
MIT
|
|
119
|
+
License: MIT
|
package/dist/discord/notifier.js
CHANGED
|
@@ -36,9 +36,29 @@ export function formatNotification(ev, sessionChannelId, events) {
|
|
|
36
36
|
case 'error': {
|
|
37
37
|
if (!events.error)
|
|
38
38
|
return null;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
return `❌ <#${sessionChannelId}> 에러: ${ev.message.slice(0, 500)}`;
|
|
40
|
+
}
|
|
41
|
+
case 'rate_limit': {
|
|
42
|
+
// Gated by events.error (per minimal-change guidance): a rate-limit update is
|
|
43
|
+
// not an error semantically, but it's operational status of the same "something
|
|
44
|
+
// to be aware of" kind, and adding a new filter here would ripple into config
|
|
45
|
+
// schema / defaults. If differentiation is needed later, split the flag.
|
|
46
|
+
if (!events.error)
|
|
47
|
+
return null;
|
|
48
|
+
let line = `📊 <#${sessionChannelId}> 사용량 한도`;
|
|
49
|
+
if (typeof ev.utilization === 'number')
|
|
50
|
+
line += ` · ${Math.round(ev.utilization)}%`;
|
|
51
|
+
if (ev.resetAt) {
|
|
52
|
+
const ms = Date.parse(ev.resetAt);
|
|
53
|
+
if (!Number.isNaN(ms)) {
|
|
54
|
+
const hhmm = new Date(ms).toLocaleTimeString('ko-KR', {
|
|
55
|
+
hour: '2-digit',
|
|
56
|
+
minute: '2-digit',
|
|
57
|
+
hour12: false,
|
|
58
|
+
});
|
|
59
|
+
line += ` · 리셋 ${hhmm}`;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
42
62
|
return line;
|
|
43
63
|
}
|
|
44
64
|
case 'tool_use': {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifier.js","sourceRoot":"","sources":["../../src/discord/notifier.ts"],"names":[],"mappings":"AAuBA,yFAAyF;AACzF,sFAAsF;AACtF,2FAA2F;AAC3F,iCAAiC;AACjC,MAAM,UAAU,oBAAoB,CAAC,MAA2B;IAC9D,MAAM,CAAC,GAAG,MAAM,EAAE,aAAa,CAAC;IAChC,MAAM,cAAc,GAAG,MAAM,EAAE,QAAQ,EAAE,eAAe,IAAI,IAAI,CAAC;IACjE,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,OAAO,IAAI,IAAI;QAC3B,SAAS,EAAE,CAAC,EAAE,SAAS,IAAI,cAAc;QACzC,MAAM,EAAE;YACN,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,IAAI,IAAI;YACjC,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,IAAI;YAC/B,OAAO,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,IAAI,KAAK;SACrC;KACF,CAAC;AACJ,CAAC;AAED,mFAAmF;AACnF,iFAAiF;AACjF,mEAAmE;AACnE,MAAM,UAAU,kBAAkB,CAChC,EAAc,EACd,gBAAwB,EACxB,MAAuC;IAEvC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;QAChB,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,IAAI,CAAC,MAAM,CAAC,MAAM;gBAAE,OAAO,IA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,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAClF,IAAI,IAAI,KAAK,IAAI;YAAE,OAAO;QAC1B,KAAK,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACvE,CAAC;CACF"}
|
|
@@ -64,6 +64,9 @@ export class RendererDispatcher {
|
|
|
64
64
|
case 'error':
|
|
65
65
|
this.renderers.error(ev);
|
|
66
66
|
break;
|
|
67
|
+
case 'rate_limit':
|
|
68
|
+
this.renderers.rateLimit(ev);
|
|
69
|
+
break;
|
|
67
70
|
}
|
|
68
71
|
}
|
|
69
72
|
}
|
|
@@ -176,6 +179,9 @@ export function createDefaultRendererSet(options) {
|
|
|
176
179
|
error(ev) {
|
|
177
180
|
swallow(channel.send({ content: `⚠️ ${ev.message}` }));
|
|
178
181
|
},
|
|
182
|
+
rateLimit(ev) {
|
|
183
|
+
swallow(channel.send({ content: formatRateLimitLine(ev) }));
|
|
184
|
+
},
|
|
179
185
|
dispose() {
|
|
180
186
|
// Cancel the streaming/thinking debounce timers so a detach mid-stream cannot
|
|
181
187
|
// fire a late edit/send against a channel that is being torn down. Ended
|
|
@@ -192,4 +198,38 @@ export function createDefaultRendererSet(options) {
|
|
|
192
198
|
// Re-export the permission handler for 7b to wire orchestrator.requestPermission
|
|
193
199
|
// and button-interaction resolution (the request/resolve round-trip lives there).
|
|
194
200
|
export { PermissionButtonsHandler } from './permissionButtons.js';
|
|
201
|
+
// Human-readable label for the SDK's rateLimitType codes. Unknown types pass through
|
|
202
|
+
// verbatim so a future SDK addition still renders something (not silently dropped).
|
|
203
|
+
function rateLimitTypeLabel(type) {
|
|
204
|
+
switch (type) {
|
|
205
|
+
case 'five_hour':
|
|
206
|
+
return '5시간 한도';
|
|
207
|
+
case 'weekly':
|
|
208
|
+
return '주간 한도';
|
|
209
|
+
default:
|
|
210
|
+
return type;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
// One-line summary of a rate_limit event: emoji + label + optional utilization %
|
|
214
|
+
// and reset time. Kept as a plain function (not on RendererSet) so the notifier
|
|
215
|
+
// path can reuse the same phrasing if desired later.
|
|
216
|
+
export function formatRateLimitLine(ev) {
|
|
217
|
+
let line = '📊 사용량 한도 알림';
|
|
218
|
+
if (ev.rateLimitType)
|
|
219
|
+
line += ` · ${rateLimitTypeLabel(ev.rateLimitType)}`;
|
|
220
|
+
if (typeof ev.utilization === 'number')
|
|
221
|
+
line += ` · 사용량 ${Math.round(ev.utilization)}%`;
|
|
222
|
+
if (ev.resetAt) {
|
|
223
|
+
const ms = Date.parse(ev.resetAt);
|
|
224
|
+
if (!Number.isNaN(ms)) {
|
|
225
|
+
const hhmm = new Date(ms).toLocaleTimeString('ko-KR', {
|
|
226
|
+
hour: '2-digit',
|
|
227
|
+
minute: '2-digit',
|
|
228
|
+
hour12: false,
|
|
229
|
+
});
|
|
230
|
+
line += ` · 리셋 ${hhmm}`;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
return line;
|
|
234
|
+
}
|
|
195
235
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/discord/renderers/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE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AI,SAAS,IAAI,EAAE,CAAC;QAC1B,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -177,16 +177,12 @@ export class ClaudeSession {
|
|
|
177
177
|
case 'rate_limit_event': {
|
|
178
178
|
const info = msg.rate_limit_info;
|
|
179
179
|
this.ctx.emit({
|
|
180
|
-
kind: '
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
: {}),
|
|
187
|
-
...(info.rateLimitType !== undefined ? { rateLimitType: info.rateLimitType } : {}),
|
|
188
|
-
...(info.utilization !== undefined ? { utilization: info.utilization } : {}),
|
|
189
|
-
},
|
|
180
|
+
kind: 'rate_limit',
|
|
181
|
+
...(info.resetsAt !== undefined
|
|
182
|
+
? { resetAt: new Date(info.resetsAt * 1000).toISOString() }
|
|
183
|
+
: {}),
|
|
184
|
+
...(info.rateLimitType !== undefined ? { rateLimitType: info.rateLimitType } : {}),
|
|
185
|
+
...(info.utilization !== undefined ? { utilization: info.utilization } : {}),
|
|
190
186
|
});
|
|
191
187
|
return;
|
|
192
188
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../../src/modes/claude/session.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,SAAS,GAKnB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAyB,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAiB9C,sFAAsF;AACtF,uFAAuF;AACvF,mFAAmF;AACnF,sFAAsF;AACtF,mFAAmF;AACnF,oEAAoE;AACpE,oFAAoF;AACpF,kDAAkD;AAClD,SAAS,mBAAmB,CAAC,QAAyB;IACpD,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,aAAa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bridge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Self-hosted Discord bot that runs AI coding agents — Claude Code, Codex, and more — per channel. Role-based access, multi-server, extensible.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|