alibai 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.ja.md +115 -0
- package/README.ko.md +115 -0
- package/README.md +69 -105
- package/dist/report.js +7 -0
- package/dist/store.js +130 -33
- package/dist/viewer.js +66 -7
- package/package.json +5 -1
- package/viewer/evidence.js +480 -0
- package/viewer/index.html +1 -0
- package/viewer/messages.js +120 -0
- package/viewer/tokens.css +1 -1
- package/viewer/viewer.css +445 -95
- package/viewer/viewer.js +345 -88
package/README.ja.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/kut7728/alibi-for-ai/main/docs/assets/logo-dark.png">
|
|
4
|
+
<img src="https://raw.githubusercontent.com/kut7728/alibi-for-ai/main/docs/assets/logo-light.png" alt="Alibi for AI(alibai)のロゴ" width="240">
|
|
5
|
+
</picture>
|
|
6
|
+
</h1>
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="https://github.com/kut7728/alibi-for-ai/blob/main/README.md">English</a> |
|
|
10
|
+
<a href="https://github.com/kut7728/alibi-for-ai/blob/main/README.ko.md">한국어</a> |
|
|
11
|
+
<a href="https://github.com/kut7728/alibi-for-ai/blob/main/README.ja.md">日本語</a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center"><strong>AI コーディングエージェントのテスト結果を、証拠として記録・共有できます。</strong></p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<a href="https://www.npmjs.com/package/alibai"><img alt="npm の最新バージョン" src="https://img.shields.io/npm/v/alibai?color=F2C230&labelColor=14171D&label=npm%20%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3"></a>
|
|
18
|
+
<a href="https://github.com/kut7728/alibi-for-ai/releases"><img alt="GitHub の最新リリース" src="https://img.shields.io/github/v/release/kut7728/alibi-for-ai?color=F2C230&labelColor=14171D&label=GitHub%20%E3%83%AA%E3%83%AA%E3%83%BC%E3%82%B9"></a>
|
|
19
|
+
<img alt="Node.js 22 以降が必要" src="https://img.shields.io/badge/node-22%20%E4%BB%A5%E9%99%8D-4A5161?labelColor=14171D&label=Node.js">
|
|
20
|
+
<img alt="ビューアーの対応言語は英語、韓国語、日本語" src="https://img.shields.io/badge/viewer-EN%20%C2%B7%20%ED%95%9C%20%C2%B7%20%E6%97%A5-4A5161?labelColor=14171D&label=%E3%83%93%E3%83%A5%E3%83%BC%E3%82%A2%E3%83%BC">
|
|
21
|
+
<a href="https://github.com/kut7728/alibi-for-ai/blob/main/LICENSE"><img alt="MIT ライセンス" src="https://img.shields.io/badge/license-MIT-4A5161?labelColor=14171D&label=%E3%83%A9%E3%82%A4%E3%82%BB%E3%83%B3%E3%82%B9"></a>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<p align="center">
|
|
25
|
+
<img src="https://raw.githubusercontent.com/kut7728/alibi-for-ai/main/docs/assets/hero.gif" alt="失敗したカートのテストを開き、スライダーで変更前後の UI を見比べ、クーポン計算の差分を確認してビューアーの言語を切り替えるデモ" width="860">
|
|
26
|
+
</p>
|
|
27
|
+
|
|
28
|
+
<p align="center">
|
|
29
|
+
<a href="https://kut7728.github.io/alibi-for-ai/?lang=ja#case/8b37f2ac-7506-4585-9d86-4a0e21c44c12">ライブデモ</a> ·
|
|
30
|
+
<a href="https://github.com/kut7728/alibi-for-ai/blob/main/docs/assets/hero.mp4?raw=true">デモ動画をダウンロード(MP4)</a>
|
|
31
|
+
</p>
|
|
32
|
+
|
|
33
|
+
<details>
|
|
34
|
+
<summary>静止画を見る</summary>
|
|
35
|
+
|
|
36
|
+
<picture>
|
|
37
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/kut7728/alibi-for-ai/main/docs/assets/still-dark.png">
|
|
38
|
+
<img src="https://raw.githubusercontent.com/kut7728/alibi-for-ai/main/docs/assets/still-light.png" alt="カートのテストの変更前後のスクリーンショット、証拠へのコメント、HTML・PDF のエクスポートツールバー" width="860">
|
|
39
|
+
</picture>
|
|
40
|
+
|
|
41
|
+
</details>
|
|
42
|
+
|
|
43
|
+
## Alibai でできること
|
|
44
|
+
|
|
45
|
+
- スライダーで変更前後の UI を見比べ、ロジック検証の入力値、実際の結果、期待値を確認できます。
|
|
46
|
+
- テスト実行ごとにケースを作り、ローカルのブラウザービューアーで確認できます。証拠のタイムラインの上に判定と件数がまとまっており、画面は英語・韓国語・日本語に対応しています。
|
|
47
|
+
- 証拠ごとにコメントを書き、上司やクライアントに必要な証拠をレポートで共有できます。
|
|
48
|
+
|
|
49
|
+
## クイックスタート
|
|
50
|
+
|
|
51
|
+
Node.js 22 以降と Git が必要です。
|
|
52
|
+
|
|
53
|
+
1. **CLI をインストールします。**
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
npm i -g alibai
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
2. **サンプルのロジック検証を記録します。** Git 作業ツリー内で次のコマンドを実行します。
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
alibai run start --title "Cart total rounding"
|
|
63
|
+
alibai check --target calcTotal --input '[0.1,0.2]' --before 0.30000000000000004 --after 0.3 --expected 0.3 --result pass
|
|
64
|
+
alibai run end --verdict pass --summary "The cart total rounds to 0.30."
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
3. **ビューアーを開きます。** **Cart total rounding** を選ぶと、判定と記録した検証結果を確認できます。
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
alibai open
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
<a name="サンプルを試す"></a>
|
|
74
|
+
|
|
75
|
+
既存の記録をグローバルインストールなしで開くには、記録のある Git 作業ツリーで `npx alibai open` を実行します。スクリーンショット付きの記録やローカルビルドについては、[カートのサンプル](https://github.com/kut7728/alibi-for-ai/blob/main/docs/cli.md#try-the-cart-example)と[ソースからのインストール](https://github.com/kut7728/alibi-for-ai/blob/main/docs/cli.md#install-from-source)を参照してください。
|
|
76
|
+
|
|
77
|
+
## エージェントスキルの設定
|
|
78
|
+
|
|
79
|
+
Alibai をインストールしたら、[`SKILL.md`](https://github.com/kut7728/alibi-for-ai/blob/main/skills/alibai/SKILL.md) が入った `skills/alibai` ディレクトリを以下のいずれかにコピーして、エージェントに「alibai でテストして」と依頼します。
|
|
80
|
+
|
|
81
|
+
| エージェント | プロジェクト用 | ユーザー用 |
|
|
82
|
+
| --- | --- | --- |
|
|
83
|
+
| [Claude Code](https://code.claude.com/docs/en/skills) | `.claude/skills/` | `~/.claude/skills/` |
|
|
84
|
+
| [Codex](https://learn.chatgpt.com/docs/build-skills) | `.agents/skills/` | `~/.agents/skills/` |
|
|
85
|
+
| [Cursor](https://cursor.com/docs/skills) | `.cursor/skills/` または `.agents/skills/` | `~/.cursor/skills/` または `~/.agents/skills/` |
|
|
86
|
+
|
|
87
|
+
Claude Code では `/alibai` でも呼び出せます。エージェントがスキルを自動検出できない場合は、[手動設定の手順](https://github.com/kut7728/alibi-for-ai/blob/main/docs/cli.md#agent-skill-fallbacks)を参照してください。
|
|
88
|
+
|
|
89
|
+
<a name="ブラウザーで証拠を確認する"></a>
|
|
90
|
+
|
|
91
|
+
## 証拠を共有する
|
|
92
|
+
|
|
93
|
+
1. **証拠にコメントを書きます。** **コメントする** または **⌘/Ctrl+Enter** で投稿し、**⋯** メニューから編集・削除できます。コメントには**太字**、コード、リンクを使えます。
|
|
94
|
+
2. **共有する証拠を選びます。** 各証拠を個別にチェックするか、タイムラインの上にある**すべて選択**を使います。画面下部に固定されたツールバーで選択件数を確認したり、選択を解除したりできます。
|
|
95
|
+
3. **レポートをエクスポートします。** **HTML レポート**で、ケースの概要、選んだスクリーンショット、ロジック検証、コメントが 1 つのファイルにまとまります。**PDF** を選ぶとブラウザーの印刷ダイアログが開き、**PDF として保存**できます。
|
|
96
|
+
|
|
97
|
+
記録そのものを共有するには、`.alibai/runs/` からスクリーンショットとコメントを含む実行ディレクトリを丸ごとコピーします。受け取った側は Git 作業ツリーの同じ場所に置いて `alibai open` で開けます。ライブデモに投稿したコメントは、ご利用のブラウザーに保存されます。
|
|
98
|
+
|
|
99
|
+
<a name="テストの証拠を記録する"></a>
|
|
100
|
+
|
|
101
|
+
## コマンド
|
|
102
|
+
|
|
103
|
+
| コマンド | 用途 |
|
|
104
|
+
| --- | --- |
|
|
105
|
+
| `alibai run start` | テストケースの記録を開始します。 |
|
|
106
|
+
| `alibai step` | UI の操作とスクリーンショットを記録します。 |
|
|
107
|
+
| `alibai check` | ロジックの検証結果を記録します。 |
|
|
108
|
+
| `alibai run end` | 判定と概要を保存します。 |
|
|
109
|
+
| `alibai list` | 記録したケースを一覧表示します。 |
|
|
110
|
+
| `alibai open` | ローカルビューアーを開きます。 |
|
|
111
|
+
|
|
112
|
+
<a name="記録形式と-git-の比較基準"></a>
|
|
113
|
+
<a name="開発とテスト"></a>
|
|
114
|
+
|
|
115
|
+
使用例、オプション、開発環境の準備方法は [CLI リファレンス](https://github.com/kut7728/alibi-for-ai/blob/main/docs/cli.md)を参照してください。[バージョン 1 のスキーマ](https://github.com/kut7728/alibi-for-ai/blob/main/src/run.schema.json)、Git スナップショット、ハッシュ、ロックについては、[記録形式](https://github.com/kut7728/alibi-for-ai/blob/main/docs/format.md)で説明しています。バージョンごとの変更点は[変更履歴](https://github.com/kut7728/alibi-for-ai/blob/main/CHANGELOG.md)にあります。
|
package/README.ko.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/kut7728/alibi-for-ai/main/docs/assets/logo-dark.png">
|
|
4
|
+
<img src="https://raw.githubusercontent.com/kut7728/alibi-for-ai/main/docs/assets/logo-light.png" alt="Alibi for AI (alibai) 로고" width="240">
|
|
5
|
+
</picture>
|
|
6
|
+
</h1>
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="https://github.com/kut7728/alibi-for-ai/blob/main/README.md">English</a> |
|
|
10
|
+
<a href="https://github.com/kut7728/alibi-for-ai/blob/main/README.ko.md">한국어</a> |
|
|
11
|
+
<a href="https://github.com/kut7728/alibi-for-ai/blob/main/README.ja.md">日本語</a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center"><strong>AI 코딩 에이전트의 테스트 증거를 기록하고 공유하세요.</strong></p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<a href="https://www.npmjs.com/package/alibai"><img alt="npm 최신 버전" src="https://img.shields.io/npm/v/alibai?color=F2C230&labelColor=14171D&label=npm%20%EB%B2%84%EC%A0%84"></a>
|
|
18
|
+
<a href="https://github.com/kut7728/alibi-for-ai/releases"><img alt="GitHub 최신 릴리스" src="https://img.shields.io/github/v/release/kut7728/alibi-for-ai?color=F2C230&labelColor=14171D&label=GitHub%20%EB%A6%B4%EB%A6%AC%EC%8A%A4"></a>
|
|
19
|
+
<img alt="Node.js 22 이상 필요" src="https://img.shields.io/badge/node-22%20%EC%9D%B4%EC%83%81-4A5161?labelColor=14171D&label=Node.js">
|
|
20
|
+
<img alt="뷰어 지원 언어 영어, 한국어, 일본어" src="https://img.shields.io/badge/viewer-EN%20%C2%B7%20%ED%95%9C%20%C2%B7%20%E6%97%A5-4A5161?labelColor=14171D&label=%EB%B7%B0%EC%96%B4">
|
|
21
|
+
<a href="https://github.com/kut7728/alibi-for-ai/blob/main/LICENSE"><img alt="MIT 라이선스" src="https://img.shields.io/badge/license-MIT-4A5161?labelColor=14171D&label=%EB%9D%BC%EC%9D%B4%EC%84%A0%EC%8A%A4"></a>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<p align="center">
|
|
25
|
+
<img src="https://raw.githubusercontent.com/kut7728/alibi-for-ai/main/docs/assets/hero.gif" alt="실패한 장바구니 테스트를 열어 UI 전후 슬라이더와 쿠폰 계산 diff를 확인하고 뷰어 언어를 바꾸는 과정" width="860">
|
|
26
|
+
</p>
|
|
27
|
+
|
|
28
|
+
<p align="center">
|
|
29
|
+
<a href="https://kut7728.github.io/alibi-for-ai/?lang=ko#case/8b37f2ac-7506-4585-9d86-4a0e21c44c12">라이브 데모</a> ·
|
|
30
|
+
<a href="https://github.com/kut7728/alibi-for-ai/blob/main/docs/assets/hero.mp4?raw=true">데모 영상 (MP4 다운로드)</a>
|
|
31
|
+
</p>
|
|
32
|
+
|
|
33
|
+
<details>
|
|
34
|
+
<summary>정지 화면 보기</summary>
|
|
35
|
+
|
|
36
|
+
<picture>
|
|
37
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/kut7728/alibi-for-ai/main/docs/assets/still-dark.png">
|
|
38
|
+
<img src="https://raw.githubusercontent.com/kut7728/alibi-for-ai/main/docs/assets/still-light.png" alt="장바구니 테스트의 전후 스크린샷, 증거에 달린 댓글, HTML 및 PDF 내보내기 도구 모음" width="860">
|
|
39
|
+
</picture>
|
|
40
|
+
|
|
41
|
+
</details>
|
|
42
|
+
|
|
43
|
+
## Alibai로 할 수 있는 일
|
|
44
|
+
|
|
45
|
+
- 슬라이더로 변경 전후 UI 스크린샷을 비교하고, 로직 검사의 입력값과 실제 결과, 기댓값을 함께 확인합니다.
|
|
46
|
+
- 각 테스트 실행을 하나의 사건으로 기록하고 로컬 브라우저 뷰어에서 확인합니다. 증거 타임라인 위에 판정과 결과 건수가 표시되며, 영어·한국어·일본어를 지원합니다.
|
|
47
|
+
- 개별 증거에 댓글을 달고 팀 리더나 고객에게 필요한 부분만 보고서로 공유합니다.
|
|
48
|
+
|
|
49
|
+
## 빠른 시작
|
|
50
|
+
|
|
51
|
+
Node.js 22 이상과 Git이 필요합니다.
|
|
52
|
+
|
|
53
|
+
1. **CLI를 설치합니다.**
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
npm i -g alibai
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
2. **예제 로직 검사를 기록합니다.** Git 작업 트리에서 다음 명령을 실행합니다.
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
alibai run start --title "Cart total rounding"
|
|
63
|
+
alibai check --target calcTotal --input '[0.1,0.2]' --before 0.30000000000000004 --after 0.3 --expected 0.3 --result pass
|
|
64
|
+
alibai run end --verdict pass --summary "The cart total rounds to 0.30."
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
3. **뷰어를 엽니다.** **Cart total rounding**을 선택하면 판정과 기록한 검사 결과를 확인할 수 있습니다.
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
alibai open
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
<a name="예제-실행"></a>
|
|
74
|
+
|
|
75
|
+
기존 기록을 전역 설치 없이 보려면 해당 Git 작업 트리에서 `npx alibai open`을 실행합니다. 스크린샷이 있는 기록이나 로컬 빌드가 필요하면 [장바구니 예제](https://github.com/kut7728/alibi-for-ai/blob/main/docs/cli.md#try-the-cart-example)와 [소스에서 설치하기](https://github.com/kut7728/alibi-for-ai/blob/main/docs/cli.md#install-from-source)를 참고하세요.
|
|
76
|
+
|
|
77
|
+
## 에이전트 스킬 설치
|
|
78
|
+
|
|
79
|
+
Alibai를 설치한 뒤 [`SKILL.md`](https://github.com/kut7728/alibi-for-ai/blob/main/skills/alibai/SKILL.md)가 들어 있는 `skills/alibai` 디렉터리를 아래 경로 중 한 곳에 복사하고 에이전트에게 “alibai로 테스트해 줘”라고 요청합니다.
|
|
80
|
+
|
|
81
|
+
| 에이전트 | 프로젝트 경로 | 사용자 경로 |
|
|
82
|
+
| --- | --- | --- |
|
|
83
|
+
| [Claude Code](https://code.claude.com/docs/en/skills) | `.claude/skills/` | `~/.claude/skills/` |
|
|
84
|
+
| [Codex](https://learn.chatgpt.com/docs/build-skills) | `.agents/skills/` | `~/.agents/skills/` |
|
|
85
|
+
| [Cursor](https://cursor.com/docs/skills) | `.cursor/skills/` 또는 `.agents/skills/` | `~/.cursor/skills/` 또는 `~/.agents/skills/` |
|
|
86
|
+
|
|
87
|
+
Claude Code에서는 `/alibai`로도 실행할 수 있습니다. 에이전트가 스킬을 자동으로 찾지 못하면 [수동 설정 방법](https://github.com/kut7728/alibi-for-ai/blob/main/docs/cli.md#agent-skill-fallbacks)을 참고하세요.
|
|
88
|
+
|
|
89
|
+
<a name="브라우저에서-증거-보기"></a>
|
|
90
|
+
|
|
91
|
+
## 증거 공유
|
|
92
|
+
|
|
93
|
+
1. **증거에 댓글을 답니다.** **댓글 달기** 버튼이나 **⌘/Ctrl+Enter**로 등록하고, **⋯** 메뉴로 수정하거나 삭제합니다. 댓글에는 **굵은 글씨**, 코드, 링크를 넣을 수 있습니다.
|
|
94
|
+
2. **공유할 증거를 선택합니다.** 개별 증거에 체크하거나 타임라인 위에서 **전체 선택**을 누릅니다. 화면 하단에 고정된 도구 모음에서 선택 개수를 확인하거나 선택을 해제할 수 있습니다.
|
|
95
|
+
3. **보고서를 내보냅니다.** **HTML 보고서**는 사건 요약과 선택한 스크린샷, 로직 검사, 댓글을 한 파일에 담습니다. **PDF**를 누르면 브라우저의 인쇄 창에서 **PDF로 저장**을 선택할 수 있습니다.
|
|
96
|
+
|
|
97
|
+
기록 자체를 공유하려면 `.alibai/runs/`에서 스크린샷과 댓글을 포함한 실행 디렉터리 전체를 복사합니다. 받는 사람은 자신의 Git 작업 트리에서 같은 위치에 넣고 `alibai open`으로 열 수 있습니다. 라이브 데모에 작성한 댓글은 사용 중인 브라우저에 저장됩니다.
|
|
98
|
+
|
|
99
|
+
<a name="기록하기"></a>
|
|
100
|
+
|
|
101
|
+
## 명령어
|
|
102
|
+
|
|
103
|
+
| 명령어 | 기능 |
|
|
104
|
+
| --- | --- |
|
|
105
|
+
| `alibai run start` | 테스트 기록을 시작합니다. |
|
|
106
|
+
| `alibai step` | UI 단계와 스크린샷을 기록합니다. |
|
|
107
|
+
| `alibai check` | 로직 검사 결과를 기록합니다. |
|
|
108
|
+
| `alibai run end` | 판정과 요약을 저장합니다. |
|
|
109
|
+
| `alibai list` | 저장한 기록을 나열합니다. |
|
|
110
|
+
| `alibai open` | 로컬 뷰어를 엽니다. |
|
|
111
|
+
|
|
112
|
+
<a name="포맷과-git-기준"></a>
|
|
113
|
+
<a name="개발-및-테스트"></a>
|
|
114
|
+
|
|
115
|
+
예제, 옵션, 개발 환경 설정은 [CLI 레퍼런스](https://github.com/kut7728/alibi-for-ai/blob/main/docs/cli.md)를 참고하세요. [버전 1 스키마](https://github.com/kut7728/alibi-for-ai/blob/main/src/run.schema.json), Git 스냅샷, 해시와 잠금은 [기록 형식 문서](https://github.com/kut7728/alibi-for-ai/blob/main/docs/format.md)에서 설명합니다. 버전별 변경 사항은 [변경 이력](https://github.com/kut7728/alibi-for-ai/blob/main/CHANGELOG.md)에서 볼 수 있습니다.
|
package/README.md
CHANGED
|
@@ -1,151 +1,115 @@
|
|
|
1
1
|
<h1 align="center">
|
|
2
2
|
<picture>
|
|
3
|
-
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/logo-dark.png">
|
|
4
|
-
<img src="docs/assets/logo-light.png" alt="Alibi for AI (alibai)" width="240">
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/kut7728/alibi-for-ai/main/docs/assets/logo-dark.png">
|
|
4
|
+
<img src="https://raw.githubusercontent.com/kut7728/alibi-for-ai/main/docs/assets/logo-light.png" alt="Alibi for AI (alibai) logo" width="240">
|
|
5
5
|
</picture>
|
|
6
6
|
</h1>
|
|
7
7
|
|
|
8
|
-
<p align="center"
|
|
9
|
-
<
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="https://github.com/kut7728/alibi-for-ai/blob/main/README.md">English</a> |
|
|
10
|
+
<a href="https://github.com/kut7728/alibi-for-ai/blob/main/README.ko.md">한국어</a> |
|
|
11
|
+
<a href="https://github.com/kut7728/alibi-for-ai/blob/main/README.ja.md">日本語</a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center"><strong>Record and share test evidence from your AI coding agent.</strong></p>
|
|
10
15
|
|
|
11
16
|
<p align="center">
|
|
12
|
-
<a href="https://
|
|
13
|
-
<img alt="
|
|
14
|
-
<img alt="
|
|
15
|
-
<
|
|
17
|
+
<a href="https://www.npmjs.com/package/alibai"><img alt="Latest npm version" src="https://img.shields.io/npm/v/alibai?color=F2C230&labelColor=14171D&label=npm%20version"></a>
|
|
18
|
+
<a href="https://github.com/kut7728/alibi-for-ai/releases"><img alt="Latest GitHub release" src="https://img.shields.io/github/v/release/kut7728/alibi-for-ai?color=F2C230&labelColor=14171D&label=GitHub%20release"></a>
|
|
19
|
+
<img alt="Requires Node.js 22 or later" src="https://img.shields.io/badge/node-%E2%89%A522-4A5161?labelColor=14171D&label=Node.js">
|
|
20
|
+
<img alt="Viewer languages are English, Korean, and Japanese" src="https://img.shields.io/badge/viewer-EN%20%C2%B7%20%ED%95%9C%20%C2%B7%20%E6%97%A5-4A5161?labelColor=14171D&label=Viewer">
|
|
21
|
+
<a href="https://github.com/kut7728/alibi-for-ai/blob/main/LICENSE"><img alt="MIT license" src="https://img.shields.io/badge/license-MIT-4A5161?labelColor=14171D&label=License"></a>
|
|
16
22
|
</p>
|
|
17
23
|
|
|
18
24
|
<p align="center">
|
|
19
|
-
<img src="docs/assets/hero.gif" alt="
|
|
25
|
+
<img src="https://raw.githubusercontent.com/kut7728/alibi-for-ai/main/docs/assets/hero.gif" alt="Demo of a failing cart test showing the before-and-after screenshot slider, a coupon calculation diff, and the viewer language switcher" width="860">
|
|
20
26
|
</p>
|
|
21
27
|
|
|
22
28
|
<p align="center">
|
|
23
|
-
<a href="https://kut7728.github.io/alibi-for-ai/">Live demo</a> ·
|
|
24
|
-
<a href="docs/assets/hero.mp4?raw=true"
|
|
29
|
+
<a href="https://kut7728.github.io/alibi-for-ai/?lang=en#case/8b37f2ac-7506-4585-9d86-4a0e21c44c12">Live demo</a> ·
|
|
30
|
+
<a href="https://github.com/kut7728/alibi-for-ai/blob/main/docs/assets/hero.mp4?raw=true">Download demo video (MP4)</a>
|
|
25
31
|
</p>
|
|
26
32
|
|
|
27
33
|
<details>
|
|
28
|
-
<summary
|
|
34
|
+
<summary>View a still image</summary>
|
|
29
35
|
|
|
30
36
|
<picture>
|
|
31
|
-
<source media="(prefers-color-scheme: dark)" srcset="docs/assets/still-dark.png">
|
|
32
|
-
<img src="docs/assets/still-light.png" alt="
|
|
37
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/kut7728/alibi-for-ai/main/docs/assets/still-dark.png">
|
|
38
|
+
<img src="https://raw.githubusercontent.com/kut7728/alibi-for-ai/main/docs/assets/still-light.png" alt="Cart test evidence with before-and-after screenshots, an exhibit comment, and the HTML and PDF export toolbar" width="860">
|
|
33
39
|
</picture>
|
|
34
40
|
|
|
35
41
|
</details>
|
|
36
42
|
|
|
37
|
-
|
|
38
|
-
| --- | --- |
|
|
39
|
-
| `alibai step` | UI 전후 스크린샷 슬라이더 |
|
|
40
|
-
| `alibai check` | 로직 수정 전·후와 기대값 비교 |
|
|
41
|
-
| `alibai run end` | 실행별 판정과 요약 |
|
|
42
|
-
|
|
43
|
-
## 빠른 시작
|
|
44
|
-
|
|
45
|
-
Node.js 22 이상과 Git이 필요합니다. 저장소를 클론하고 패키지를 빌드해 설치합니다.
|
|
46
|
-
|
|
47
|
-
```sh
|
|
48
|
-
git clone https://github.com/kut7728/alibi-for-ai.git
|
|
49
|
-
cd alibi-for-ai
|
|
50
|
-
npm ci
|
|
51
|
-
pack_dir="$(mktemp -d)"
|
|
52
|
-
npm pack --pack-destination "$pack_dir"
|
|
53
|
-
npm install --global "$pack_dir/alibai-0.1.0.tgz"
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
같은 디렉터리에서 예제 장바구니 테스트를 엽니다. 예제는 가상의 데이터만 사용하며 임시 Git 작업 트리에 복사됩니다.
|
|
57
|
-
|
|
58
|
-
```sh
|
|
59
|
-
example_root="$(mktemp -d)"
|
|
60
|
-
git init -q "$example_root"
|
|
61
|
-
mkdir -p "$example_root/.alibai/runs"
|
|
62
|
-
cp -R examples/cart-rounding "$example_root/.alibai/runs/8b37f2ac-7506-4585-9d86-4a0e21c44c12"
|
|
63
|
-
(cd "$example_root" && alibai open)
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## 에이전트 스킬 설치
|
|
67
|
-
|
|
68
|
-
CLI를 로컬에 설치한 뒤 [공용 스킬](skills/alibai/SKILL.md)을 연결합니다. 연결 후 에이전트에 `alibai로 테스트해줘`라고 요청할 수 있습니다.
|
|
69
|
-
|
|
70
|
-
### Claude Code
|
|
43
|
+
## Why Alibai?
|
|
71
44
|
|
|
72
|
-
|
|
45
|
+
- Compare before-and-after UI screenshots with a slider. Review logic checks alongside their inputs, results, and expected values.
|
|
46
|
+
- Review each test run as a case in a local-only browser viewer with English, Korean, and Japanese interfaces. Its summary groups the verdict and counts above the evidence timeline.
|
|
47
|
+
- Comment on individual exhibits and send managers or clients a report containing the evidence they need.
|
|
73
48
|
|
|
74
|
-
|
|
49
|
+
## Quick start
|
|
75
50
|
|
|
76
|
-
|
|
51
|
+
You’ll need Node.js 22 or later and Git.
|
|
77
52
|
|
|
78
|
-
|
|
53
|
+
1. **Install the CLI.**
|
|
79
54
|
|
|
80
|
-
|
|
55
|
+
```sh
|
|
56
|
+
npm i -g alibai
|
|
57
|
+
```
|
|
81
58
|
|
|
82
|
-
|
|
59
|
+
2. **Record a sample logic check.** From any Git working tree, run the following commands.
|
|
83
60
|
|
|
84
|
-
|
|
61
|
+
```sh
|
|
62
|
+
alibai run start --title "Cart total rounding"
|
|
63
|
+
alibai check --target calcTotal --input '[0.1,0.2]' --before 0.30000000000000004 --after 0.3 --expected 0.3 --result pass
|
|
64
|
+
alibai run end --verdict pass --summary "The cart total rounds to 0.30."
|
|
65
|
+
```
|
|
85
66
|
|
|
86
|
-
|
|
67
|
+
3. **Open the viewer.** Select **Cart total rounding** to see the verdict and the recorded check.
|
|
87
68
|
|
|
88
|
-
|
|
69
|
+
```sh
|
|
70
|
+
alibai open
|
|
71
|
+
```
|
|
89
72
|
|
|
90
|
-
|
|
91
|
-
alibai run start --title "Login fix" --platform flutter --agent Codex
|
|
92
|
-
alibai step --action "Tap Sign in" --before before.png --after after.png --result pass
|
|
93
|
-
alibai check --target validateLogin --input '{"email":"a@example.com"}' \
|
|
94
|
-
--before false --after true --expected true --result pass
|
|
95
|
-
alibai run end --verdict pass --summary "Login succeeds with a valid email."
|
|
96
|
-
alibai list --json
|
|
97
|
-
```
|
|
73
|
+
<a name="try-the-example"></a>
|
|
98
74
|
|
|
99
|
-
|
|
75
|
+
To open an existing case without a global install, run `npx alibai open` in its Git working tree. For a case with screenshots or a local build, see the [cart example](https://github.com/kut7728/alibi-for-ai/blob/main/docs/cli.md#try-the-cart-example) and [source installation](https://github.com/kut7728/alibi-for-ai/blob/main/docs/cli.md#install-from-source).
|
|
100
76
|
|
|
101
|
-
|
|
102
|
-
alibai check --target parseAge --input '"invalid"' --before null --error TypeError --result fail
|
|
103
|
-
```
|
|
77
|
+
## Set up the agent skill
|
|
104
78
|
|
|
105
|
-
|
|
106
|
-
- `step`에는 `--before` 또는 `--after` 스크린샷이 하나 이상 필요합니다. 파일 확장자는 대소문자 구분 없이 `.png`, `.jpg`, `.jpeg`, `.webp`를 지원합니다. 순서는 1부터 기록하며 `--note`의 기본값은 빈 문자열입니다.
|
|
107
|
-
- `check`의 `--input`, `--before`, `--after`, 선택 항목인 `--expected`는 JSON 값입니다. `--error`에 오류 코드나 예외 이름 또는 메시지를 전달하면 `--after`를 생략할 수 있습니다. `--after null`은 JSON `null`을 기록합니다.
|
|
108
|
-
- 음수는 `--before=-1`처럼 전달할 수 있고, JSON 문자열은 `--after '"ok"'`처럼 JSON 따옴표를 포함합니다. JavaScript 안전 정수 범위(±9,007,199,254,740,991)를 벗어나는 정수는 반올림될 수 있으므로 정확한 값이 필요하면 JSON 문자열로 전달합니다.
|
|
109
|
-
- `step`과 `check`의 `--result`, `run end`의 `--verdict`에는 `pass`, `fail`, `info`를 사용합니다. 항목의 결과는 기본 `info`이며, 실행을 종료할 때는 판정을 지정합니다. `--summary`를 생략하면 판정을 담은 한 줄이 자동으로 기록됩니다.
|
|
110
|
-
- `step`, `check`, `run end`는 가장 최근에 시작한 열린 실행에 기록합니다. 특정 실행을 지정하려면 `--run <id>`를 사용합니다. 종료한 실행에는 항목을 추가할 수 없습니다.
|
|
79
|
+
After installing Alibai, copy the `skills/alibai` directory containing [`SKILL.md`](https://github.com/kut7728/alibi-for-ai/blob/main/skills/alibai/SKILL.md) to one of these locations, then ask your agent to “test this with alibai.”
|
|
111
80
|
|
|
112
|
-
|
|
81
|
+
| Agent | Project directory | User directory |
|
|
82
|
+
| --- | --- | --- |
|
|
83
|
+
| [Claude Code](https://code.claude.com/docs/en/skills) | `.claude/skills/` | `~/.claude/skills/` |
|
|
84
|
+
| [Codex](https://learn.chatgpt.com/docs/build-skills) | `.agents/skills/` | `~/.agents/skills/` |
|
|
85
|
+
| [Cursor](https://cursor.com/docs/skills) | `.cursor/skills/` or `.agents/skills/` | `~/.cursor/skills/` or `~/.agents/skills/` |
|
|
113
86
|
|
|
114
|
-
|
|
87
|
+
Claude Code also accepts `/alibai`. If your agent cannot discover the skill, see [manual setup](https://github.com/kut7728/alibi-for-ai/blob/main/docs/cli.md#agent-skill-fallbacks).
|
|
115
88
|
|
|
116
|
-
|
|
89
|
+
<a name="review-evidence-in-the-browser"></a>
|
|
117
90
|
|
|
118
|
-
|
|
91
|
+
## Share evidence
|
|
119
92
|
|
|
120
|
-
|
|
93
|
+
1. **Comment on an exhibit.** Use **Comment** or **⌘/Ctrl+Enter** to post. The **⋯** menu lets you edit or delete comments. Comments support **bold**, code, and links.
|
|
94
|
+
2. **Choose what to share.** Check individual exhibits or use **Select all** above the timeline. The sticky toolbar at the bottom shows the selection count and lets you clear it.
|
|
95
|
+
3. **Export the report.** Choose **HTML report** to download a self-contained file with the case summary, selected screenshots, logic checks, and comments. Choose **PDF**, then **Save as PDF** in the browser’s print dialog.
|
|
121
96
|
|
|
122
|
-
|
|
97
|
+
To share the case itself, copy its whole directory from `.alibai/runs/`, including screenshots and comments. The recipient can place it in the same location in their Git working tree and run `alibai open`. Comments you write in the live demo stay in your browser.
|
|
123
98
|
|
|
124
|
-
|
|
99
|
+
<a name="record-test-evidence"></a>
|
|
125
100
|
|
|
126
|
-
|
|
101
|
+
## Commands
|
|
127
102
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
미추적 항목은 루트 기준 경로의 원본 바이트 순으로 정렬합니다. 각 항목의 종류(`f` 또는 `l`), 경로의 바이트 길이와 개행, 경로의 원본 바이트, 내용의 32바이트 SHA-256을 차례로 해시에 넣습니다. 심볼릭 링크는 대상 파일 대신 링크에 저장된 경로를 해시합니다. 패치와 파일 본문은 저장하지 않습니다. Git 읽기나 미추적 파일 하나가 32 MiB를 넘거나, 입력을 읽을 수 없거나, HEAD 또는 해시할 입력이 없으면 경로는 저장하고 해시는 `null`로 기록합니다. Git 속성이나 체크아웃 설정이 바꾼 패치 내용과 실행 중 파일 읽기 사이에 일어난 변경은 해시에 영향을 줄 수 있습니다.
|
|
138
|
-
|
|
139
|
-
Git 상태 읽기가 실패하면 해당 시점의 스냅샷을 `null`로 기록하고, 시작 시점이면 `git.dirty`를 생략합니다. 변경 경로가 없으면 스냅샷 필드를 생략합니다. 기존 버전 1 기록에도 이 필드가 없을 수 있습니다. Git 작업 트리가 아닌 곳에서는 기록 명령이 기존과 같이 오류를 반환합니다.
|
|
140
|
-
|
|
141
|
-
같은 실행에 쓰는 명령은 최대 5초 동안 잠금을 기다립니다. 잠금은 시간이 지나도 자동으로 해제되지 않습니다. 강제 종료 뒤 잠금이 남아 있다면 해당 실행에 쓰거나 대기 중인 프로세스가 모두 종료됐는지 먼저 확인합니다. 그다음 오류에 표시된 `rmdir -- '<절대 경로>/.lock'` 명령으로 빈 잠금 디렉터리를 제거하고 다시 시도합니다. 기록은 임시 파일을 작성한 뒤 교체하는 방식으로 저장됩니다.
|
|
142
|
-
|
|
143
|
-
</details>
|
|
144
|
-
|
|
145
|
-
## 개발 및 테스트
|
|
103
|
+
| Command | Purpose |
|
|
104
|
+
| --- | --- |
|
|
105
|
+
| `alibai run start` | Start a test case. |
|
|
106
|
+
| `alibai step` | Record a UI step with screenshots. |
|
|
107
|
+
| `alibai check` | Record a logic check. |
|
|
108
|
+
| `alibai run end` | Save the verdict and summary. |
|
|
109
|
+
| `alibai list` | List recorded cases. |
|
|
110
|
+
| `alibai open` | Open the local viewer. |
|
|
146
111
|
|
|
147
|
-
|
|
112
|
+
<a name="evidence-format-and-git-baseline"></a>
|
|
113
|
+
<a name="development-and-testing"></a>
|
|
148
114
|
|
|
149
|
-
|
|
150
|
-
ALIBAI_TEST_CHROMIUM='/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' npm test
|
|
151
|
-
```
|
|
115
|
+
See the [CLI reference](https://github.com/kut7728/alibi-for-ai/blob/main/docs/cli.md) for examples, options, and development setup. See the [run format](https://github.com/kut7728/alibi-for-ai/blob/main/docs/format.md) for the [version 1 schema](https://github.com/kut7728/alibi-for-ai/blob/main/src/run.schema.json), Git snapshots, hashing, and locking. Changes by version are in the [changelog](https://github.com/kut7728/alibi-for-ai/blob/main/CHANGELOG.md).
|
package/dist/report.js
CHANGED
|
@@ -21,6 +21,13 @@ function assertRun(value, label) {
|
|
|
21
21
|
const error = validate.errors?.[0];
|
|
22
22
|
throw new Error(`${label}: invalid run format at ${error?.instancePath || "/"} (${error?.message}).`);
|
|
23
23
|
}
|
|
24
|
+
const { steps, checks } = value;
|
|
25
|
+
const ids = new Set();
|
|
26
|
+
for (const { id } of [...steps, ...checks]) {
|
|
27
|
+
if (ids.has(id))
|
|
28
|
+
throw new Error(`${label}: invalid run format (duplicate exhibit id ${id}).`);
|
|
29
|
+
ids.add(id);
|
|
30
|
+
}
|
|
24
31
|
}
|
|
25
32
|
function parseJson(value, label) {
|
|
26
33
|
try {
|