Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,15 @@ ACP_BOUNTY_API_URL=https://bounty.virtuals.io

# Seller WebSocket / ACP socket URL
ACP_SOCKET_URL=https://acpx.virtuals.io

# Optional OpenRouter integration for ops-recovery offerings.
# If OPENROUTER_API_KEY is unset, the runtime falls back to deterministic rule-based recovery.
OPENROUTER_API_KEY=
OPENROUTER_BASE_URL=https://openrouter.ai/api/v1
OPENROUTER_MODEL=
# Recommended free default (OpenRouter free-model router):
OPENROUTER_FREE_MODEL=openrouter/free
# Optional paid model override (leave empty to keep free routing):
# OPENROUTER_MODEL=google/gemini-2.5-flash-lite
OPENROUTER_SITE_URL=https://app.virtuals.io
OPENROUTER_APP_NAME=acp-ops-recovery-router
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,24 @@ Any agent can sell services on the ACP marketplace. The workflow:

See [Seller reference](./references/seller.md) for the full guide.

### OpenRouter Free Model Daily Ops

For seller runtimes that must stay on free OpenRouter models:

- Dry-run health check and recommendation:
- `npm run openrouter:free:check`
- Apply selected free model to Railway env:
- `npm run openrouter:free:apply`
- Apply and immediately redeploy runtime:
- `npm run openrouter:free:apply:deploy`

Behavior:

- Fetches live model list from OpenRouter
- Filters to text-capable models with zero prompt/completion pricing
- Probes candidates and selects the first healthy model
- Sets `OPENROUTER_FREE_MODEL=<selected>` and removes `OPENROUTER_MODEL` (paid override)

## Registering Resources

Resources are external APIs or services that your agent can register and make available to other agents. Resources can be referenced in job offerings to indicate dependencies or capabilities your agent provides.
Expand Down
1 change: 1 addition & 0 deletions data/rapid_recovery_telegram_targets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
126 changes: 126 additions & 0 deletions docs/rapid-recovery-router-7day-sprint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
# Rapid-Recovery-Router 7일 매출 스프린트 실행 가이드

## 목표

- 핵심 KPI: `외부 유료건수/일`
- 7일 목표: 외부 유료 7건
- 가격 구조: `0.02 -> 0.05 -> 0.12`
- 모델 정책: `OPENROUTER_MODEL` unset, `OPENROUTER_FREE_MODEL`만 사용

## 오퍼 구성

- `ops_recovery_hotfix_openrouter_v1` (0.02)
- `ops_recovery_turbo_v1` (0.05)
- `ops_recovery_guardrail_v1` (0.12)

모든 오퍼 설명 첫 줄은 아래 문제 키워드 고정:

- `timeout | validation | rejected | retry payload`

## 일일 운영 명령

### 1) 무료 모델 점검 + 배포

```bash
npm run openrouter:free:apply:deploy
```

실패 시 자동 롤백:

- `OPENROUTER_FREE_MODEL=openrouter/free`
- `OPENROUTER_MODEL` 삭제

### 2) KPI 리포트 생성 (JSON/CSV)

```bash
npx tsx scripts/rapid_recovery_kpi_report.ts \
--window-hours 24 \
--output-json logs/rapid_recovery_kpi_latest.json \
--output-csv logs/rapid_recovery_kpi_latest.csv
```

포함 항목:

- `external_jobs_24h`
- `external_usdc_24h`
- offering별 전환
- 업셀 전환율
- 리드탐색 비용/성과

### 3) 프로필 자동 업데이트

```bash
npx tsx scripts/rapid_recovery_profile_daily_update.ts \
--kpi-json logs/rapid_recovery_kpi_latest.json
```

업데이트 항목 제한:

- 최근 24h 외부 유료건수
- 평균 처리시간
- 대표 성공 케이스

### 4) 리드탐색 바운티 루프

```bash
npx tsx scripts/rapid_recovery_lead_bounty_loop.ts
```

가드레일:

- 전일 외부 유료건수 `< 1`일 때만 집행
- 일일 상한 `0.10 USDC`
- 하루 최대 1건
- relevance + 가격 상한 통과 시에만 자동 선택
- 위반 시 `logs/rapid_recovery_lead_bounty_state.json`에 자동 중단 기록

### 5) Telegram 자동 아웃바운드

```bash
npx tsx scripts/rapid_recovery_telegram_outbound.ts
```

필수 환경변수:

- `TELEGRAM_BOT_TOKEN`

기본 타깃 파일:

- `data/rapid_recovery_telegram_targets.json`

가드레일:

- 일일 총 발송 상한
- 대상별 쿨다운
- 중복 메시지 차단
- 금지 키워드 필터
- 연속 실패/거부율/신고 신호 기반 즉시 중단

로그:

- `logs/rapid_recovery_telegram_send_log.jsonl`
- 필드: `who/when/template/version/result`

### 6) 일일 통합 실행

```bash
npm run rapid:daily
```

Dry-run:

```bash
npm run rapid:daily -- --dry-run
```

## ACP 노출 카피 포맷

- 입력 1줄
- 복구결과 3종(JSON)
- CTA: `0.02 진입 -> 0.05 Turbo -> 0.12 Guardrail`

## Telegram 노출 템플릿 원칙

- 단문 문제-해결-CTA 구조
- 금지: 과장, 수익보장, 스팸성 키워드
- CTA는 항상 `0.02 -> 0.05/0.12` 경로만 노출
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
"seller:run": "tsx bin/acp.ts serve start",
"seller:stop": "tsx bin/acp.ts serve stop",
"seller:check": "tsx bin/acp.ts serve status",
"openrouter:free:check": "node scripts/openrouter_free_daily_check.mjs",
"openrouter:free:apply": "node scripts/openrouter_free_daily_check.mjs --apply",
"openrouter:free:apply:deploy": "node scripts/openrouter_free_daily_check.mjs --apply --deploy",
"rapid:kpi": "tsx scripts/rapid_recovery_kpi_report.ts --window-hours 24",
"rapid:profile:update": "tsx scripts/rapid_recovery_profile_daily_update.ts",
"rapid:lead:bounty": "tsx scripts/rapid_recovery_lead_bounty_loop.ts",
"rapid:telegram:outbound": "tsx scripts/rapid_recovery_telegram_outbound.ts",
"rapid:daily": "tsx scripts/rapid_recovery_daily_ops.ts",
"test": "tsx --test tests/*.test.ts",
"format": "prettier --write .",
"format:check": "prettier --check .",
"prepare": "husky"
Expand Down
Loading