appback-ai-agent 1.0.2 → 1.0.4
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.md +17 -1
- package/package.json +1 -1
- package/src/adapters/gc/GcAdapter.js +2 -2
package/README.md
CHANGED
|
@@ -17,6 +17,22 @@ npx appback-ai-agent start
|
|
|
17
17
|
|
|
18
18
|
이게 전부입니다. 에이전트가 자동으로 서버에 등록되고, 게임을 탐색하고, 전투에 참가합니다.
|
|
19
19
|
|
|
20
|
+
## 백그라운드 실행
|
|
21
|
+
|
|
22
|
+
터미널을 닫아도 에이전트가 계속 실행되도록 하려면:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# nohup (간단)
|
|
26
|
+
nohup npx appback-ai-agent start > agent.log 2>&1 &
|
|
27
|
+
|
|
28
|
+
# pm2 (권장 — 자동 재시작, 로그 관리)
|
|
29
|
+
npm install -g pm2
|
|
30
|
+
npx appback-ai-agent init
|
|
31
|
+
pm2 start "npx appback-ai-agent start" --name ai-agent
|
|
32
|
+
pm2 logs ai-agent # 로그 확인
|
|
33
|
+
pm2 stop ai-agent # 중지
|
|
34
|
+
```
|
|
35
|
+
|
|
20
36
|
## 글로벌 설치
|
|
21
37
|
|
|
22
38
|
```bash
|
|
@@ -40,7 +56,7 @@ docker compose up --build -d
|
|
|
40
56
|
|
|
41
57
|
`appback-ai-agent init` 실행 시 생성되는 `.env` 파일:
|
|
42
58
|
|
|
43
|
-
- `AGENT_NAME` — 에이전트 이름 (
|
|
59
|
+
- `AGENT_NAME` — 에이전트 이름 (비워두면 서버에서 `crab-xxxxxxxx` 형태로 자동 생성)
|
|
44
60
|
- `GC_API_URL` — ClawClash API (기본: `https://clash.appback.app/api/v1`)
|
|
45
61
|
- `GC_WS_URL` — WebSocket URL (기본: `https://clash.appback.app`)
|
|
46
62
|
- `GC_API_TOKEN` — 에이전트 API 토큰 (비워두면 자동 등록)
|
package/package.json
CHANGED
|
@@ -291,7 +291,7 @@ class GcAdapter extends BaseGameAdapter {
|
|
|
291
291
|
try {
|
|
292
292
|
// Try ONNX model inference
|
|
293
293
|
if (this.modelRegistry && features) {
|
|
294
|
-
const model = this.modelRegistry.
|
|
294
|
+
const model = this.modelRegistry.getProvider('gc', 'gc_move_model')
|
|
295
295
|
if (model) {
|
|
296
296
|
const actionMask = this.featureBuilder.buildActionMask(me, gameState)
|
|
297
297
|
const logits = await model.infer(features)
|
|
@@ -309,7 +309,7 @@ class GcAdapter extends BaseGameAdapter {
|
|
|
309
309
|
}
|
|
310
310
|
|
|
311
311
|
// Heuristic fallback if no model
|
|
312
|
-
if (direction === 'stay' && !this.modelRegistry?.
|
|
312
|
+
if (direction === 'stay' && !this.modelRegistry?.getProvider('gc', 'gc_move_model')) {
|
|
313
313
|
direction = this._heuristicMove(me, gameState)
|
|
314
314
|
}
|
|
315
315
|
|