rebut-mcp 0.1.0 → 0.2.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.en.md +32 -24
- package/README.ja.md +32 -24
- package/README.md +33 -24
- package/README.zh-CN.md +32 -24
- package/bin/rebut.mjs +1 -1
- package/docs/guide/en/architecture.md +9 -0
- package/docs/guide/en/configuration.md +6 -4
- package/docs/guide/en/installation.md +25 -24
- package/docs/guide/en/operations.md +21 -0
- package/docs/guide/en/reviewer-integration.md +8 -8
- package/docs/guide/en/validation.md +13 -0
- package/docs/guide/en.md +2 -2
- package/docs/guide/ja/architecture.md +9 -0
- package/docs/guide/ja/configuration.md +6 -4
- package/docs/guide/ja/installation.md +25 -24
- package/docs/guide/ja/operations.md +21 -0
- package/docs/guide/ja/reviewer-integration.md +8 -8
- package/docs/guide/ja/validation.md +13 -0
- package/docs/guide/ja.md +2 -2
- package/docs/guide/ko/architecture.md +9 -0
- package/docs/guide/ko/configuration.md +6 -4
- package/docs/guide/ko/installation.md +25 -24
- package/docs/guide/ko/operations.md +21 -0
- package/docs/guide/ko/reviewer-integration.md +8 -8
- package/docs/guide/ko/validation.md +13 -0
- package/docs/guide/ko.md +2 -2
- package/docs/guide/zh-CN/architecture.md +9 -0
- package/docs/guide/zh-CN/configuration.md +6 -4
- package/docs/guide/zh-CN/installation.md +25 -24
- package/docs/guide/zh-CN/operations.md +21 -0
- package/docs/guide/zh-CN/reviewer-integration.md +8 -8
- package/docs/guide/zh-CN/validation.md +13 -0
- package/docs/guide/zh-CN.md +2 -2
- package/docs/releases/0.1.0.ko.md +43 -0
- package/docs/releases/0.2.0.ko.md +72 -0
- package/docs/releases/release-checklist.ko.md +35 -0
- package/lib/cli.mjs +1244 -112
- package/migrations/0001_ledger.sql +20 -0
- package/migrations/0002_profiles.sql +6 -0
- package/package.json +11 -6
- package/src/contracts.ts +19 -0
package/README.en.md
CHANGED
|
@@ -2,56 +2,64 @@
|
|
|
2
2
|
|
|
3
3
|
# Rebut
|
|
4
4
|
|
|
5
|
-
**
|
|
5
|
+
**Local-first independent code review MCP. Cloudflare Worker is optional.**
|
|
6
6
|
|
|
7
7
|
[한국어](README.md) · **English** · [简体中文](README.zh-CN.md) · [日本語](README.ja.md)
|
|
8
8
|
|
|
9
|
-
**An authenticated Cloudflare Worker MCP that reviews the frozen material you explicitly provide.**
|
|
10
|
-
|
|
11
9
|
</div>
|
|
12
10
|
|
|
13
|
-
Rebut
|
|
11
|
+
Rebut reviews code using your own OpenAI API key. New installations run a local stdio server without a Cloudflare account or a separate HTTP daemon.
|
|
12
|
+
|
|
13
|
+
Review material is sent to the OpenAI API; the local ledger stores only request and usage metadata.
|
|
14
|
+
|
|
15
|
+
The tested release targets macOS/Linux; Windows behavior and ACLs are not validated.
|
|
14
16
|
|
|
15
17
|
## Quick start
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
Use Node.js 24 or later. This example uses macOS Keychain.
|
|
18
20
|
|
|
19
21
|
```sh
|
|
20
22
|
npm install -g rebut-mcp
|
|
21
|
-
rebut set
|
|
22
|
-
rebut set token
|
|
23
|
+
rebut set api-key
|
|
23
24
|
rebut setup --client codex
|
|
24
|
-
rebut doctor
|
|
25
25
|
rebut doctor --connect
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
`rebut set api-key` accepts hidden OpenAI API key input and stores it in Keychain. On Linux and other environments, select `rebut set secret-store env` and supply `REBUT_OPENAI_API_KEY` through the actual MCP host’s secure environment. Setup records the variable name only; never put keys in arguments or tracked files.
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
## Optional Worker
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
Choose a self-hosted Worker when multiple machines need a shared budget and request ledger. `rebut set endpoint URL` selects Worker mode. On macOS, `rebut set token` stores the separate Worker access token. The OpenAI API key, Worker access token and admin token are different credentials.
|
|
33
33
|
|
|
34
34
|
```sh
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
npm run build
|
|
38
|
-
npm test
|
|
35
|
+
rebut set endpoint https://YOUR_HOST/mcp
|
|
36
|
+
rebut setup --client codex --replace
|
|
39
37
|
```
|
|
40
38
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
Choose local defaults with `rebut set model MODEL_ID`, `rebut set reasoning EFFORT`, or `rebut set profile PROFILE_ID`. Preferences resolve server-allowlisted profiles for new collection; explicit `collect --profile` wins, and `review` keeps the frozen bundle profile. With no preferences the default is `astra-medium`. `rebut profile list` reads authenticated server model/rate metadata without a provider call. Owners can manage profiles in D1 after a one-time Worker upgrade, migration `0002`, and separate admin credential setup; see [configuration](docs/guide/en/configuration.md).
|
|
39
|
+
Existing endpoint configurations remain in Worker mode. Switch explicitly with `rebut set mode local`; failures never trigger automatic backend fallback. Switching does not move existing requests or reservations.
|
|
44
40
|
|
|
45
41
|
## What it does
|
|
46
42
|
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
43
|
+
- Collect, redact and freeze explicitly supplied files, diffs and requirements, then make one provider call.
|
|
44
|
+
- Use atomic budget reservations and deduplication in local SQLite or Worker D1. Source, reviews and keys are not stored in the ledger.
|
|
45
|
+
- Return structured findings with supplied file/line evidence, model identity, usage and estimated cost.
|
|
46
|
+
- Expose review and metadata-only review_status. Keep the same ID after uncertainty and do not replay an unknown on another backend.
|
|
51
47
|
|
|
52
|
-
|
|
48
|
+
Example defaults are $6.66/day and $200/month in UTC, one pending/unknown request, and 100 new requests/day. **Local limits cover only that device’s data directory**: they do not aggregate another Mac, Worker, external API usage or the OpenAI account balance. Worker users share that deployment’s ledger. Estimates are not invoices; uncertain executions keep their reservations and slots.
|
|
49
|
+
|
|
50
|
+
The provider waiting ceiling is 30 minutes, with corresponding HTTP/MCP and Codex deadlines. Local profile changes require OS ownership; Worker changes use separate admin authentication. See [installation](docs/guide/en/installation.md) and [configuration](docs/guide/en/configuration.md) for credentials, models, budgets and optional Worker deployment.
|
|
51
|
+
|
|
52
|
+
## Developer validation
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
npm ci --ignore-scripts
|
|
56
|
+
npm run typecheck
|
|
57
|
+
npm run build
|
|
58
|
+
npm test
|
|
59
|
+
npm run test:package
|
|
60
|
+
```
|
|
53
61
|
|
|
54
|
-
|
|
62
|
+
Automated tests and package smoke tests mock the provider. Default real API tests use gpt-6-luna; production uses gpt-6-astra / medium. Luna success does not establish Astra review quality.
|
|
55
63
|
|
|
56
64
|
## Documentation
|
|
57
65
|
|
package/README.ja.md
CHANGED
|
@@ -2,56 +2,64 @@
|
|
|
2
2
|
|
|
3
3
|
# Rebut
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**ローカル実行を標準とする独立コードレビューMCP。Cloudflare Workerは任意です。**
|
|
6
6
|
|
|
7
7
|
[한국어](README.md) · [English](README.en.md) · [简体中文](README.zh-CN.md) · **日本語**
|
|
8
8
|
|
|
9
|
-
**明示的に提供された確定済みの資料をレビューする、認証付き Cloudflare Worker MCP。**
|
|
10
|
-
|
|
11
9
|
</div>
|
|
12
10
|
|
|
13
|
-
Rebut
|
|
11
|
+
Rebutは自分のOpenAI APIキーでコードをレビューします。新規インストールはローカルstdioサーバーとして動作し、Cloudflareアカウントや別のHTTPデーモンは不要です。
|
|
12
|
+
|
|
13
|
+
レビュー資料はOpenAI APIへ送信し、ローカル台帳には要求・使用量メタデータのみ保存します。
|
|
14
|
+
|
|
15
|
+
検証対象はmacOS/Linuxで、Windows動作・ACLは未検証です。
|
|
14
16
|
|
|
15
17
|
## クイックスタート
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
Node.js 24以降が必要です。以下はmacOS Keychainを使う例です。
|
|
18
20
|
|
|
19
21
|
```sh
|
|
20
22
|
npm install -g rebut-mcp
|
|
21
|
-
rebut set
|
|
22
|
-
rebut set token
|
|
23
|
+
rebut set api-key
|
|
23
24
|
rebut setup --client codex
|
|
24
|
-
rebut doctor
|
|
25
25
|
rebut doctor --connect
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
`rebut set api-key` はOpenAI APIキーを非表示入力で受け取りKeychainに保存します。Linux等では `rebut set secret-store env` を選び、実際のMCPホストの安全な環境で `REBUT_OPENAI_API_KEY` を提供してください。登録には変数名だけを記録し、キーを引数や追跡対象ファイルに書きません。
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
## 任意のWorker
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
複数端末で予算と要求台帳を共有する場合はセルフホストのWorkerを選べます。`rebut set endpoint URL` はWorkerモードを選択します。macOSでは `rebut set token` で別のWorker接続トークンを保存します。OpenAI APIキー・Worker接続トークン・管理者トークンは別の資格情報です。
|
|
33
33
|
|
|
34
34
|
```sh
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
npm run build
|
|
38
|
-
npm test
|
|
35
|
+
rebut set endpoint https://YOUR_HOST/mcp
|
|
36
|
+
rebut setup --client codex --replace
|
|
39
37
|
```
|
|
40
38
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
`rebut set model MODEL_ID`、`rebut set reasoning EFFORT`、`rebut set profile PROFILE_ID` でローカルの既定値を選びます。新しい収集ではサーバーの許可リスト内のプロファイルに解決され、明示的な `collect --profile` が優先し、`review` は確定済みバンドルのプロファイルを保持します。設定がなければ `astra-medium` です。`rebut profile list` はプロバイダーを呼ばず、認証付きでサーバーのモデルと料金のメタデータを読み取ります。所有者は一度限りの Worker 更新、マイグレーション `0002`、別の管理認証情報の設定後に D1 でプロファイルを管理できます。[設定](docs/guide/ja/configuration.md)を参照してください。
|
|
39
|
+
既存endpoint設定はWorkerモードを維持します。`rebut set mode local` で明示的に切り替え、障害時の自動切り替えはしません。切り替えても既存の要求や予約は移行されません。
|
|
44
40
|
|
|
45
41
|
## 主な機能
|
|
46
42
|
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
43
|
+
- 明示されたファイル・diff・要件だけを収集・秘匿処理・固定し、プロバイダーを1回呼び出します。
|
|
44
|
+
- ローカルSQLiteまたはWorker D1で原子的な予算予約と重複排除を行い、原文・レビュー本文・キーは台帳に保存しません。
|
|
45
|
+
- 指定ファイル・行の根拠、モデル識別、使用量、推定費用を含む構造化された指摘を返します。
|
|
46
|
+
- reviewとメタデータ専用review_statusを提供します。不確かな結果後は同じIDを維持し、unknownを別backendで再実行しません。
|
|
51
47
|
|
|
52
|
-
|
|
48
|
+
既定例はUTCで日額$6.66・月額$200、pending/unknown同時1件、日100件の新規要求です。**ローカル制限はその端末のデータディレクトリのみが対象**で、別のMac・Worker・外部API・OpenAIアカウント残高は合算しません。Worker利用者はそのデプロイの台帳を共有します。推定は請求書ではなく、不確かな実行の予約と枠は保持します。
|
|
49
|
+
|
|
50
|
+
プロバイダー待機上限は30分で、HTTP/MCP・Codexの期限も合わせます。ローカルプロファイルはOS所有者、Workerは別の管理者認証で管理します。資格情報・モデル・予算・任意のWorkerデプロイは[インストール](docs/guide/ja/installation.md)と[設定](docs/guide/ja/configuration.md)を参照してください。
|
|
51
|
+
|
|
52
|
+
## 開発者向け検証
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
npm ci --ignore-scripts
|
|
56
|
+
npm run typecheck
|
|
57
|
+
npm run build
|
|
58
|
+
npm test
|
|
59
|
+
npm run test:package
|
|
60
|
+
```
|
|
53
61
|
|
|
54
|
-
|
|
62
|
+
自動テストとパッケージsmokeはプロバイダーを模擬します。既定の実APIテストはgpt-6-luna、運用はgpt-6-astra / mediumです。Lunaの成功はAstraのレビュー品質を証明しません。
|
|
55
63
|
|
|
56
64
|
## ドキュメント
|
|
57
65
|
|
package/README.md
CHANGED
|
@@ -2,56 +2,64 @@
|
|
|
2
2
|
|
|
3
3
|
# Rebut
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**로컬에서 바로 실행하는 독립 코드 검토 MCP. Cloudflare Worker는 선택 사항입니다.**
|
|
6
6
|
|
|
7
7
|
**한국어** · [English](README.en.md) · [简体中文](README.zh-CN.md) · [日本語](README.ja.md)
|
|
8
8
|
|
|
9
|
-
**명시적으로 제공한 고정 자료를 검토하는 인증 기반 Cloudflare Worker MCP.**
|
|
10
|
-
|
|
11
9
|
</div>
|
|
12
10
|
|
|
13
|
-
Rebut은
|
|
11
|
+
Rebut은 자신의 OpenAI API 키로 실행하는 코드 검토 도구입니다. 새 설치는 로컬 stdio 서버를 사용하며 Cloudflare 계정이나 별도 HTTP 서버가 필요하지 않습니다.
|
|
12
|
+
|
|
13
|
+
검토 자료는 OpenAI API로 전송하며, 로컬 원장에는 요청·사용량 메타데이터만 저장합니다.
|
|
14
|
+
|
|
15
|
+
검증 대상은 macOS/Linux이며 Windows 동작·ACL은 확인하지 않았습니다.
|
|
14
16
|
|
|
15
17
|
## 빠른 시작
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
Node.js 24 이상이 필요합니다. 다음은 macOS Keychain을 사용하는 예입니다.
|
|
18
20
|
|
|
19
21
|
```sh
|
|
20
22
|
npm install -g rebut-mcp
|
|
21
|
-
rebut set
|
|
22
|
-
rebut set token
|
|
23
|
+
rebut set api-key
|
|
23
24
|
rebut setup --client codex
|
|
24
|
-
rebut doctor
|
|
25
25
|
rebut doctor --connect
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
`rebut set api-key`는 OpenAI API 키를 숨김 입력으로 받아 Keychain에 저장합니다. Linux 등에서는 `rebut set secret-store env`를 선택하고 실제 MCP 호스트의 안전한 환경에 `REBUT_OPENAI_API_KEY`를 제공하세요. 설정에는 변수명만 기록하며 키를 인자나 추적 파일에 넣지 않습니다.
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
## Worker 선택
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
여러 기기가 하나의 예산과 요청 장부를 공유하려면 직접 호스팅한 Worker를 선택할 수 있습니다. `rebut set endpoint URL`은 Worker 모드를 선택합니다. macOS에서는 `rebut set token`으로 별도의 Worker 접속 토큰을 저장합니다. OpenAI API 키와 접속·관리자 토큰은 서로 다른 자격증명입니다.
|
|
33
33
|
|
|
34
34
|
```sh
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
npm run build
|
|
38
|
-
npm test
|
|
35
|
+
rebut set endpoint https://YOUR_HOST/mcp
|
|
36
|
+
rebut setup --client codex --replace
|
|
39
37
|
```
|
|
40
38
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
`rebut set model MODEL_ID`, `rebut set reasoning EFFORT`, `rebut set profile PROFILE_ID`로 로컬 기본값을 선택합니다. 새 수집에서 서버 허용 목록의 프로필을 찾으며 명시적인 `collect --profile`이 우선하고 `review`는 고정 번들의 프로필을 유지합니다. 환경설정이 없으면 `astra-medium`입니다. `rebut profile list`는 공급자 호출 없이 인증된 서버 모델·요금 메타데이터를 조회합니다. 소유자는 일회성 Worker 업그레이드, 마이그레이션 `0002`, 별도 관리자 자격증명 설정 뒤 D1에서 프로필을 관리할 수 있습니다. [설정](docs/guide/ko/configuration.md)을 참고하세요.
|
|
39
|
+
기존 endpoint 설정은 Worker 모드로 유지됩니다. `rebut set mode local`로 명시적으로 전환할 수 있으며 장애 시 다른 backend로 자동 대체하지 않습니다. backend 전환은 기존 기록이나 예약을 이전하지 않습니다.
|
|
44
40
|
|
|
45
41
|
## 주요 기능
|
|
46
42
|
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
- `review`와
|
|
43
|
+
- 명시한 파일·diff·요구사항만 수집·마스킹·해시 고정하고 공급자를 한 번 호출합니다.
|
|
44
|
+
- 로컬 SQLite 또는 Worker D1에서 원자적 예산 예약과 요청 중복 방지를 적용합니다. 원문·리뷰·키는 장부에 저장하지 않습니다.
|
|
45
|
+
- 파일·행 근거, 모델 식별, 사용량, 예상 비용을 포함한 구조화된 검토 결과를 반환합니다.
|
|
46
|
+
- `review`와 메타데이터 전용 `review_status`를 제공합니다. unknown 이후 같은 ID를 유지하며 다른 backend로 우회 재실행하지 않습니다.
|
|
51
47
|
|
|
52
|
-
|
|
48
|
+
기본 예시는 UTC 하루 $6.66·월 $200, 동시 pending/unknown 한 건, 하루 신규 요청 100건입니다. **로컬 한도는 해당 기기의 데이터 디렉터리에만 적용**됩니다. 다른 Mac·Worker·외부 API 사용량이나 OpenAI 계정 잔액을 합산하지 않습니다. Worker는 해당 배포의 장부를 공유합니다. 예상 비용은 청구서가 아니며 불확실한 실행의 예약과 슬롯은 유지합니다.
|
|
49
|
+
|
|
50
|
+
공급자 대기 상한은 30분이며 HTTP/MCP·Codex의 외부 제한도 함께 조정합니다. 로컬 프로필은 OS 소유자가, Worker 프로필은 별도 관리자 인증으로 관리합니다. 자세한 키 설정·모델·예산·Worker 배포는 [설치](docs/guide/ko/installation.md)와 [설정](docs/guide/ko/configuration.md)을 참고하세요.
|
|
51
|
+
|
|
52
|
+
## 개발 검증
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
npm ci --ignore-scripts
|
|
56
|
+
npm run typecheck
|
|
57
|
+
npm run build
|
|
58
|
+
npm test
|
|
59
|
+
npm run test:package
|
|
60
|
+
```
|
|
53
61
|
|
|
54
|
-
|
|
62
|
+
자동화 테스트와 패키지 smoke는 공급자를 모의 처리합니다. 기본 실제 API 테스트는 gpt-6-luna, 운영 프로필은 gpt-6-astra / medium이며 Luna 성공으로 Astra 품질을 추론하지 않습니다.
|
|
55
63
|
|
|
56
64
|
## 문서
|
|
57
65
|
|
|
@@ -62,4 +70,5 @@ npm test
|
|
|
62
70
|
- [선택적 검토자 연동](docs/guide/ko/reviewer-integration.md)
|
|
63
71
|
- [아키텍처](docs/guide/ko/architecture.md)
|
|
64
72
|
- [검증 및 결과의 한계](docs/guide/ko/validation.md)
|
|
73
|
+
- [최초 릴리즈 기록](docs/releases/0.1.0.ko.md) · [0.2.0 릴리즈 후보](docs/releases/0.2.0.ko.md)
|
|
65
74
|
- [MIT 라이선스](LICENSE)
|
package/README.zh-CN.md
CHANGED
|
@@ -2,56 +2,64 @@
|
|
|
2
2
|
|
|
3
3
|
# Rebut
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**默认本地运行的独立代码审查 MCP,可选 Cloudflare Worker。**
|
|
6
6
|
|
|
7
7
|
[한국어](README.md) · [English](README.en.md) · **简体中文** · [日本語](README.ja.md)
|
|
8
8
|
|
|
9
|
-
**一个经过身份验证的 Cloudflare Worker MCP,仅审查您明确提供并已冻结的材料。**
|
|
10
|
-
|
|
11
9
|
</div>
|
|
12
10
|
|
|
13
|
-
Rebut
|
|
11
|
+
Rebut 使用您自己的 OpenAI API 密钥审查代码。新安装默认运行本地 stdio 服务器,无需 Cloudflare 账户或独立 HTTP 守护进程。
|
|
12
|
+
|
|
13
|
+
审查资料会发送至 OpenAI API;本地账本仅存储请求和用量元数据。
|
|
14
|
+
|
|
15
|
+
验证目标为 macOS/Linux,Windows 行为与 ACL 未验证。
|
|
14
16
|
|
|
15
17
|
## 快速开始
|
|
16
18
|
|
|
17
|
-
需要
|
|
19
|
+
需要 Node.js 24 或更高版本。以下示例使用 macOS Keychain。
|
|
18
20
|
|
|
19
21
|
```sh
|
|
20
22
|
npm install -g rebut-mcp
|
|
21
|
-
rebut set
|
|
22
|
-
rebut set token
|
|
23
|
+
rebut set api-key
|
|
23
24
|
rebut setup --client codex
|
|
24
|
-
rebut doctor
|
|
25
25
|
rebut doctor --connect
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
`rebut set api-key` 隐藏输入 OpenAI API 密钥并存入 Keychain。Linux 等环境请选择 `rebut set secret-store env`,通过实际 MCP 宿主的安全环境提供 `REBUT_OPENAI_API_KEY`。配置仅记录变量名,不要把密钥写入参数或受版本控制的文件。
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
## 可选 Worker
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
多台设备需要共享预算和请求账本时,可选择自托管 Worker。`rebut set endpoint URL` 会选择 Worker 模式。macOS 可通过 `rebut set token` 保存独立的 Worker 访问令牌。OpenAI API 密钥、Worker 访问令牌和管理员令牌是不同凭据。
|
|
33
33
|
|
|
34
34
|
```sh
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
npm run build
|
|
38
|
-
npm test
|
|
35
|
+
rebut set endpoint https://YOUR_HOST/mcp
|
|
36
|
+
rebut setup --client codex --replace
|
|
39
37
|
```
|
|
40
38
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
使用 `rebut set model MODEL_ID`、`rebut set reasoning EFFORT` 或 `rebut set profile PROFILE_ID` 选择本地默认值。新收集时偏好会匹配服务器允许列表的配置方案;显式 `collect --profile` 优先,`review` 保留冻结输入包中的配置方案。无偏好时默认为 `astra-medium`。`rebut profile list` 无需调用提供商即可读取经过身份验证的服务器模型/费率元数据。所有者完成一次 Worker 升级、迁移 `0002` 及单独管理凭据设置后,可在 D1 中管理配置方案;见[配置](docs/guide/zh-CN/configuration.md)。
|
|
39
|
+
已有 endpoint 配置继续使用 Worker 模式。通过 `rebut set mode local` 明确切换;失败不会自动切换后端。切换不会迁移已有请求或预留。
|
|
44
40
|
|
|
45
41
|
## 功能
|
|
46
42
|
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
- 提供
|
|
43
|
+
- 仅收集、脱敏并冻结明确提供的文件、diff 和要求,再调用供应商一次。
|
|
44
|
+
- 在本地 SQLite 或 Worker D1 中进行原子预算预留和去重;账本不存储源码、审查正文或密钥。
|
|
45
|
+
- 返回结构化发现、给定文件及行号证据、模型标识、用量与预估成本。
|
|
46
|
+
- 提供 review 和仅元数据的 review_status。不确定后保留同一 ID,不在另一后端重放 unknown 请求。
|
|
51
47
|
|
|
52
|
-
|
|
48
|
+
默认示例为 UTC 每日 $6.66、每月 $200、一个 pending/unknown 请求及每日 100 个新请求。**本地限额仅覆盖该设备的数据目录**,不汇总另一台 Mac、Worker、外部 API 或 OpenAI 账户余额。Worker 用户共享该部署的账本。预估不是账单;不确定的执行继续占用预留和并发槽。
|
|
49
|
+
|
|
50
|
+
供应商等待上限为 30 分钟,并配套调整 HTTP/MCP 和 Codex 期限。本地配置方案由 OS 所有者管理;Worker 变更需要独立管理员认证。凭据、模型、预算与可选部署见[安装](docs/guide/zh-CN/installation.md)和[配置](docs/guide/zh-CN/configuration.md)。
|
|
51
|
+
|
|
52
|
+
## 开发者验证
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
npm ci --ignore-scripts
|
|
56
|
+
npm run typecheck
|
|
57
|
+
npm run build
|
|
58
|
+
npm test
|
|
59
|
+
npm run test:package
|
|
60
|
+
```
|
|
53
61
|
|
|
54
|
-
|
|
62
|
+
自动化测试与包 smoke 测试模拟供应商。默认真实 API 测试使用 gpt-6-luna,生产使用 gpt-6-astra / medium。Luna 成功不证明 Astra 的审查质量。
|
|
55
63
|
|
|
56
64
|
## 文档
|
|
57
65
|
|
package/bin/rebut.mjs
CHANGED
|
@@ -4,6 +4,15 @@
|
|
|
4
4
|
|
|
5
5
|
[Rebut](../../../README.en.md) · [User guide](../en.md)
|
|
6
6
|
|
|
7
|
+
## Local and Worker execution
|
|
8
|
+
|
|
9
|
+
New installations use local stdio MCP → the shared review service → private SQLite reservation → one OpenAI Responses call → validation and metadata settlement. No Cloudflare account, local HTTP port or daemon is required. Explicit Worker mode retains authenticated HTTP MCP → D1 → the same provider adapter.
|
|
10
|
+
|
|
11
|
+
src/service.ts owns hash/profile selection, request ownership and settlement; src/review.ts owns provider and evidence validation; src/local.ts adapts Node SQLite and stdio; src/worker.ts retains HTTP authentication and D1 bindings. Local provider keys, Worker access tokens and admin tokens are separate. Neither ledger stores source, review bodies or keys. Local budgets and IDs cover only one local directory; Worker principals share one deployment. Switching backends does not migrate history or authorize replay of an uncertain request.
|
|
12
|
+
|
|
13
|
+
The existing Worker-specific path and references follow.
|
|
14
|
+
|
|
15
|
+
|
|
7
16
|
Client explicit allowlist → redact/freeze/hash → authenticated Streamable HTTP MCP → validated profile/hash → atomic D1 reservation → one bounded Responses call → schema/evidence/usage validation → metadata settlement → return review to client.
|
|
8
17
|
|
|
9
18
|
The host-independent contract and provider adapter live in `src/contracts.ts` and `src/review.ts`; `src/worker.ts` supplies MCP/authentication and `src/ledger.ts` supplies the D1 adapter. Cloudflare's per-request `createMcpHandler` uses MCP SDK v2 and supports legacy stateless clients. Stateful sessions, background tasks, OAuth, model-driven tools, repository access, and persisted review replay are outside this MVP.
|
|
@@ -4,13 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
[Rebut](../../../README.en.md) · [User guide](../en.md)
|
|
6
6
|
|
|
7
|
-
## Local CLI configuration
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
## Local profiles and budget scope
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
New settings use local mode; endpoint-only legacy settings remain Worker. `rebut set api-key` stores a local OpenAI key in Keychain, while Worker `set token` and `set admin-token` store different credentials. env uses REBUT_OPENAI_API_KEY locally, REBUT_TOKEN/REBUT_ADMIN_TOKEN for Worker. Vaultwarden local keys use vaultwarden-api-key-item. `rebut profile list/set/remove` targets the selected backend; local profile changes require no Worker admin token. Local profiles, revisions and metadata are stored in private SQLite. Limits apply to one data directory, not all devices or the OpenAI account. Use a shared Worker for a central ledger. A mode switch does not migrate uncertain requests or release reservations.
|
|
12
11
|
|
|
13
|
-
`rebut setup --client codex` uses `CODEX_HOME` or `~/.codex`; `--codex-home PATH` selects another home. It registers `rebut mcp`, preserves other MCP entries, and requires `--replace` to migrate an existing private `rebut` bridge. `rebut doctor` shows sanitized local configuration/credential availability; `rebut doctor --connect` checks remote `tools/list` for free. Neither performs a paid review. See [installation](installation.md).
|
|
14
12
|
|
|
15
13
|
## Model and reasoning preferences
|
|
16
14
|
|
|
@@ -26,6 +24,10 @@ rebut set profile PROFILE_ID
|
|
|
26
24
|
|
|
27
25
|
## Owner-managed server profiles
|
|
28
26
|
|
|
27
|
+
Worker mode only: local profile management does not require these admin credentials.
|
|
28
|
+
|
|
29
|
+
The owner/admin instructions in this section apply only to Worker mode. Local profile commands use OS ownership and the local SQLite registry.
|
|
30
|
+
|
|
29
31
|
`rebut profile list` makes an authenticated, read-only GET to list server profiles, models, reasoning settings, output limits, rates, and revisions. It does not call the provider or start a paid review.
|
|
30
32
|
|
|
31
33
|
```sh
|
|
@@ -4,53 +4,46 @@
|
|
|
4
4
|
|
|
5
5
|
[Rebut](../../../README.en.md) · [User guide](../en.md)
|
|
6
6
|
|
|
7
|
-
## npm CLI installation
|
|
8
7
|
|
|
9
|
-
Use Node.js **24 or later
|
|
8
|
+
Use Node.js **24 or later**. New installations default to a local stdio MCP server. No Cloudflare account, Worker endpoint or HTTP daemon is required.
|
|
10
9
|
|
|
11
10
|
```sh
|
|
12
11
|
npm install -g rebut-mcp
|
|
13
12
|
```
|
|
14
13
|
|
|
15
|
-
##
|
|
14
|
+
## Local setup
|
|
16
15
|
|
|
17
|
-
|
|
16
|
+
On macOS, `rebut set api-key` takes hidden OpenAI API key input and stores it in the login Keychain. The provider account is `openai-api-key` under `com.abruption.rebut`, separate from the Worker access/admin accounts. `--stdin` accepts a protected pipe; never use credential values as command arguments.
|
|
18
17
|
|
|
19
18
|
```sh
|
|
20
|
-
rebut set
|
|
21
|
-
rebut set token
|
|
19
|
+
rebut set api-key
|
|
22
20
|
```
|
|
23
21
|
|
|
24
|
-
For
|
|
22
|
+
For environment-backed credentials, select `rebut set secret-store env` and provide `REBUT_OPENAI_API_KEY` in the secure environment of the actual MCP host. Setup records only that variable name. For Vaultwarden, use `rebut set secret-store vaultwarden` and `rebut set vaultwarden-api-key-item NAME`; the default local item is `Rebut — OpenAI API Key`. Existing bw-get login is required. There is no automatic credential or backend fallback.
|
|
23
|
+
|
|
24
|
+
## Connect and verify
|
|
25
25
|
|
|
26
26
|
```sh
|
|
27
|
-
rebut
|
|
28
|
-
rebut
|
|
27
|
+
rebut setup --client codex
|
|
28
|
+
rebut doctor --connect
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
`rebut setup --client codex` registers `rebut mcp` using CODEX_HOME or ~/.codex; select another home with --codex-home PATH. The host starts the server automatically. `doctor --connect` checks local credential availability, SQLite and real MCP tool registration without making a provider call; it does not prove API account access. Local env setup forwards REBUT_OPENAI_API_KEY by name only. Preserve custom REBUT_CONFIG_DIR when replacing a registration.
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
## Optional Worker mode
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
rebut set secret-store env
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## Connect Codex and check configuration
|
|
35
|
+
Setting an endpoint explicitly selects Worker mode. Existing endpoint-only configurations keep Worker mode on upgrade. Worker mode uses its separate MCP access token, not the local OpenAI key: on macOS store it with `rebut set token`; env mode reads REBUT_TOKEN and Vaultwarden uses vaultwarden-item. Admin operations use the separate admin credential. Use the private deployment section below if you need to create a Worker.
|
|
40
36
|
|
|
41
37
|
```sh
|
|
42
|
-
rebut
|
|
43
|
-
rebut
|
|
44
|
-
rebut doctor --connect
|
|
38
|
+
rebut set endpoint https://YOUR_HOST/mcp
|
|
39
|
+
rebut setup --client codex --replace
|
|
45
40
|
```
|
|
46
41
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
`rebut doctor` reports sanitized local configuration and credential availability. `rebut doctor --connect` makes a free remote `tools/list` check; neither command starts a paid review.
|
|
42
|
+
Use `rebut set mode local` to switch explicitly. No automatic fallback occurs. Backends do not share or migrate request history, reservations or budgets: never replay an unknown against another backend. Local SQLite lives at ~/.local/share/rebut/local/ledger.sqlite, or local/ under a custom REBUT_CONFIG_DIR. Defaults are UTC $6.66/day and $200/month for this data directory only; local budget commands are `set daily-budget`, `set monthly-budget`, and `set request-budget` with decimal USD values. Worker limits remain deployment configuration.
|
|
50
43
|
|
|
51
44
|
## Source checkout and developer validation
|
|
52
45
|
|
|
53
|
-
|
|
46
|
+
This guide targets CLI 0.2.0. The npm package runs the local server and optional Worker bridge; it is not a hosted review service and grants no API credits. Only optional Worker deployment needs a Cloudflare account and source checkout. Packages contain no real endpoint, private settings, credentials or review bodies.
|
|
54
47
|
|
|
55
48
|
```sh
|
|
56
49
|
npm ci
|
|
@@ -95,8 +88,16 @@ rebut review < /protected/path/request-001.bundle.json
|
|
|
95
88
|
rebut status request-001
|
|
96
89
|
```
|
|
97
90
|
|
|
98
|
-
Save the initial response locally with restrictive permissions; the server stores only metadata and cannot replay review bodies. Keep the same request ID after timeout or uncertainty.
|
|
91
|
+
Save the initial response locally with restrictive permissions; the server stores only metadata and cannot replay review bodies. Keep the same request ID after timeout or uncertainty. The provider deadline is 1,800 seconds (30 minutes). The MCP HTTP client allows 1,830 seconds and Codex `tool_timeout_sec` is 1,860 seconds, leaving time to record and deliver the outcome. Startup and handshake limits remain short and separate. Update both the Worker and CLI, refresh existing registration with `rebut setup --client codex --replace`, and restart Codex. Editing host configuration alone does not update the older limit inside the 0.1.0 CLI. See the [opt-in reviewer workflow](reviewer-integration.md).
|
|
99
92
|
|
|
100
93
|
## Upgrade or remove
|
|
101
94
|
|
|
102
95
|
Use the [operations guide](operations.md) to preserve the D1 ledger and reconcile pending executions before upgrading or removing a deployment. Source publication and a private paid deployment are separate actions.
|
|
96
|
+
|
|
97
|
+
Upgrade in this order: **install the CLI → refresh Codex registration with existing options preserved → restart Codex/MCP → deploy the Worker**. Deploying the longer Worker deadline first can let the old CLI disconnect at 65 seconds. Preserve custom registration options such as `REBUT_CONFIG_DIR`. Node HTTP headers/body deadlines also match the MCP tool deadline. Thirty minutes is an application upper bound, not a guarantee from every network or host. Sleep, termination or disconnection can leave a request reserved or unknown; query its original ID without automatic replay or reservation release.
|
|
98
|
+
|
|
99
|
+
After changing mode, credential backend or local budgets, refresh registration with `rebut setup --client codex --replace` when needed and restart MCP hosts. Existing processes keep their startup settings; doctor does not reload them. Preserve custom `REBUT_CONFIG_DIR` (for example, provide the same environment variable when rerunning setup). The chosen secret-store backend applies to all credential roles, which use separate accounts/items.
|
|
100
|
+
|
|
101
|
+
Local env mode defaults to REBUT_OPENAI_API_KEY so a key belonging to Codex or another application is not silently reused. To deliberately share OPENAI_API_KEY, run `rebut set api-key-env OPENAI_API_KEY`, refresh registration and restart. There is no fallback between these variables. Daily, monthly and per-request ceilings are independent; changing one does not scale the others. Custom limits are retained across upgrades. Tool descriptions are startup hints; execution resolves the explicit request profile dynamically.
|
|
102
|
+
|
|
103
|
+
The tested release targets macOS/Linux; Windows behavior and ACLs are not validated.
|
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
[Rebut](../../../README.en.md) · [User guide](../en.md)
|
|
6
6
|
|
|
7
|
+
## Local operations
|
|
8
|
+
|
|
9
|
+
Stop local MCP processes before backing up the metadata-only SQLite ledger and its settings. Preserve request history and unknown reservations; do not delete or live-sync an open ledger to clear a limit. API keys are not in SQLite and stay in the selected credential backend. SIGTERM attempts to abort and record uncertain in-flight work before closing; a crash, SIGKILL or network interruption may still leave reserved state. Look up the original ID without replaying it. `rebut remove` removes registration only, not the ledger or credentials. The D1 operations below apply only to Worker mode.
|
|
10
|
+
|
|
11
|
+
## Worker
|
|
12
|
+
|
|
13
|
+
|
|
7
14
|
Back up the metadata-only D1 ledger using Cloudflare's supported export/Time Travel mechanisms. Do not delete the ledger to clear an inconvenient pending request: doing so loses spend and duplicate protection. Retain request rows for the lifetime of IDs clients may reuse; pruning permits old IDs to execute again.
|
|
8
15
|
|
|
9
16
|
Use `rebut status REQUEST_ID` for a free metadata lookup under the original principal. `rebut doctor` checks sanitized local configuration and credential availability; `rebut doctor --connect` performs a free remote `tools/list` check. None of these commands starts a paid review. Preserve the request ID and reservation after any uncertain result.
|
|
@@ -28,3 +35,17 @@ Run `npm ci`, typecheck, build, and tests. Review migration SQL first, then appl
|
|
|
28
35
|
## Rotate or remove
|
|
29
36
|
|
|
30
37
|
Rotate a token by generating a new random value and replacing that principal's digest in `AUTH_TOKENS`, then updating the authorized client's password-manager-backed configuration. Do not change the principal ID merely to rotate a token. Rotate the OpenAI key by updating only `OPENAI_API_KEY`; other consumers of a shared key need their own coordination. Delete the Worker to stop new requests. Export and review the ledger before separately removing D1; deletion is irreversible and makes deduplication history unavailable.
|
|
38
|
+
|
|
39
|
+
## Local recovery and bounded capacity
|
|
40
|
+
|
|
41
|
+
1. Stop MCP hosts and inspect the original request with `rebut status REQUEST_ID`; do not resubmit it.
|
|
42
|
+
2. Back up the closed local ledger and settings. Review provider evidence when available. `budget_reserved_microusd` and `budget_accounted_microusd` are application accounting, not confirmed invoices for unknown executions.
|
|
43
|
+
3. If the execution remains uncertain, retain its row, full accounted reservation and ID. Do not mark it unbilled, delete it or manufacture a completed result.
|
|
44
|
+
4. After explicitly accepting that retained accounting, an operator may add bounded capacity for intentionally new reviews. For one uncertain request occupying the default one slot, `rebut set max-concurrent 2` adds one slot; the range is 1–10. It does not release the old slot, refund money or authorize retry of the old input.
|
|
45
|
+
5. Restart MCP hosts. Daily/monthly/request limits still apply to the total accounted spend. Actual ledger settlement needs independent evidence and a targeted operator review; it is not automated.
|
|
46
|
+
|
|
47
|
+
If the ID is missing, start with `rebut status --pending`: it lists up to 100 local reserved/unknown metadata records without keys or provider calls, with has_more if more exist. It is a diagnostic snapshot, not authorization for a new paid invocation. If no rows are pending, a money or daily-request ceiling may still be responsible for limit_exceeded.
|
|
48
|
+
|
|
49
|
+
Capacity is capped at 10. If all slots remain uncertain, stop for evidence-based operator reconciliation rather than deleting history or mislabelling unknown as unbilled. Once independently reconciled, reduce temporary capacity back to the intended normal limit (default 1) and restart.
|
|
50
|
+
|
|
51
|
+
Choose capacity from the pending count plus the deliberately allowed new parallel requests (maximum 10), rather than copying the example 2 over an existing custom limit. Capacity/budget commands retain a complete local-limit snapshot. If the original ID is missing, run status --pending before step 1.
|