failproofai 0.0.6-beta.1 → 0.0.6-beta.2
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/.next/standalone/.failproofai/policies/review-policies.mjs +4 -3
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/required-server-files.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +2 -2
- package/.next/standalone/.next/server/app/_not-found.rsc +15 -15
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +15 -15
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +10 -10
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +8 -8
- package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0g72weg._.js +1 -1
- package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_0z7w.hh._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0~kmh8w._.js → [root-of-the-server]__05akje6._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__092s1ta._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09icjsf._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0g.lg8b._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h..k-e._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0rh.18_._.js → [root-of-the-server]__0i5kvry._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0okos0k._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0w6l33k._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11pa2ra._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12t-wym._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/_10lm7or._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_0xerkr6._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_0q-m0y-._.js +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/404.html +2 -2
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +9 -9
- package/.next/standalone/.next/static/chunks/{08t08igdql9yt.js → 00j0rr7rh8ef8.js} +1 -1
- package/.next/standalone/.next/static/chunks/{12~yi9oj8av8p.js → 05j1px0r8yzh6.js} +2 -2
- package/.next/standalone/.next/static/chunks/{09_k80d~cq2wg.js → 0badv41uxa56..js} +1 -1
- package/.next/standalone/.next/static/chunks/{0wlyoif4_kj_t.js → 0ijk_kek9_wyx.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0bvhsa6zva2o..js → 0ksdlt_1hucdm.js} +1 -1
- package/.next/standalone/.next/static/chunks/{03rz6ykw-a2xi.js → 0npb~873.wvg3.js} +1 -1
- package/.next/standalone/.next/static/chunks/{01b~z8f1ws0rk.js → 0xpl.oscrakvx.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0gbf4cphy8ksq.js → 1052sguyd-.ka.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0v.yd0kg_ld3r.js → 14cl9poem30dq.js} +1 -1
- package/.next/standalone/CHANGELOG.md +11 -0
- package/.next/standalone/dist/cli.mjs +3 -3
- package/.next/standalone/docs/ar/built-in-policies.mdx +124 -87
- package/.next/standalone/docs/ar/custom-policies.mdx +72 -72
- package/.next/standalone/docs/ar/examples.mdx +86 -33
- package/.next/standalone/docs/ar/getting-started.mdx +82 -29
- package/.next/standalone/docs/built-in-policies.mdx +1 -1
- package/.next/standalone/docs/de/built-in-policies.mdx +93 -56
- package/.next/standalone/docs/de/custom-policies.mdx +56 -56
- package/.next/standalone/docs/de/examples.mdx +72 -18
- package/.next/standalone/docs/de/getting-started.mdx +72 -20
- package/.next/standalone/docs/es/built-in-policies.mdx +115 -78
- package/.next/standalone/docs/es/custom-policies.mdx +55 -55
- package/.next/standalone/docs/es/examples.mdx +73 -19
- package/.next/standalone/docs/es/getting-started.mdx +72 -20
- package/.next/standalone/docs/fr/built-in-policies.mdx +83 -46
- package/.next/standalone/docs/fr/custom-policies.mdx +51 -51
- package/.next/standalone/docs/fr/examples.mdx +78 -24
- package/.next/standalone/docs/fr/getting-started.mdx +65 -13
- package/.next/standalone/docs/he/built-in-policies.mdx +156 -117
- package/.next/standalone/docs/he/custom-policies.mdx +75 -75
- package/.next/standalone/docs/he/examples.mdx +87 -33
- package/.next/standalone/docs/he/getting-started.mdx +84 -33
- package/.next/standalone/docs/hi/built-in-policies.mdx +101 -60
- package/.next/standalone/docs/hi/custom-policies.mdx +71 -70
- package/.next/standalone/docs/hi/examples.mdx +90 -36
- package/.next/standalone/docs/hi/getting-started.mdx +80 -27
- package/.next/standalone/docs/i18n/README.ar.md +69 -69
- package/.next/standalone/docs/i18n/README.de.md +46 -46
- package/.next/standalone/docs/i18n/README.es.md +42 -42
- package/.next/standalone/docs/i18n/README.fr.md +39 -39
- package/.next/standalone/docs/i18n/README.he.md +83 -83
- package/.next/standalone/docs/i18n/README.hi.md +69 -69
- package/.next/standalone/docs/i18n/README.it.md +72 -72
- package/.next/standalone/docs/i18n/README.ja.md +71 -71
- package/.next/standalone/docs/i18n/README.ko.md +52 -52
- package/.next/standalone/docs/i18n/README.pt-br.md +44 -44
- package/.next/standalone/docs/i18n/README.ru.md +66 -66
- package/.next/standalone/docs/i18n/README.tr.md +82 -83
- package/.next/standalone/docs/i18n/README.vi.md +70 -71
- package/.next/standalone/docs/i18n/README.zh.md +51 -51
- package/.next/standalone/docs/it/built-in-policies.mdx +118 -81
- package/.next/standalone/docs/it/custom-policies.mdx +69 -69
- package/.next/standalone/docs/it/examples.mdx +93 -39
- package/.next/standalone/docs/it/getting-started.mdx +73 -21
- package/.next/standalone/docs/ja/built-in-policies.mdx +98 -61
- package/.next/standalone/docs/ja/custom-policies.mdx +71 -71
- package/.next/standalone/docs/ja/examples.mdx +76 -22
- package/.next/standalone/docs/ja/getting-started.mdx +65 -13
- package/.next/standalone/docs/ko/built-in-policies.mdx +137 -100
- package/.next/standalone/docs/ko/custom-policies.mdx +67 -67
- package/.next/standalone/docs/ko/examples.mdx +87 -33
- package/.next/standalone/docs/ko/getting-started.mdx +61 -9
- package/.next/standalone/docs/pt-br/built-in-policies.mdx +94 -57
- package/.next/standalone/docs/pt-br/custom-policies.mdx +56 -56
- package/.next/standalone/docs/pt-br/examples.mdx +78 -24
- package/.next/standalone/docs/pt-br/getting-started.mdx +64 -12
- package/.next/standalone/docs/ru/built-in-policies.mdx +142 -105
- package/.next/standalone/docs/ru/custom-policies.mdx +82 -81
- package/.next/standalone/docs/ru/examples.mdx +77 -22
- package/.next/standalone/docs/ru/getting-started.mdx +74 -22
- package/.next/standalone/docs/tr/built-in-policies.mdx +104 -67
- package/.next/standalone/docs/tr/custom-policies.mdx +59 -60
- package/.next/standalone/docs/tr/examples.mdx +97 -42
- package/.next/standalone/docs/tr/getting-started.mdx +75 -23
- package/.next/standalone/docs/vi/built-in-policies.mdx +110 -72
- package/.next/standalone/docs/vi/custom-policies.mdx +68 -68
- package/.next/standalone/docs/vi/examples.mdx +93 -38
- package/.next/standalone/docs/vi/getting-started.mdx +74 -22
- package/.next/standalone/docs/zh/built-in-policies.mdx +132 -95
- package/.next/standalone/docs/zh/custom-policies.mdx +49 -49
- package/.next/standalone/docs/zh/examples.mdx +90 -36
- package/.next/standalone/docs/zh/getting-started.mdx +73 -21
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/server.js +1 -1
- package/.next/standalone/src/hooks/builtin-policies.ts +5 -1
- package/dist/cli.mjs +3 -3
- package/package.json +1 -1
- package/src/hooks/builtin-policies.ts +5 -1
- /package/.next/standalone/.next/static/{CkmOT-ZvDN-sVULinGVKT → A9pNTZdoYJTVyPAYwQMx5}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{CkmOT-ZvDN-sVULinGVKT → A9pNTZdoYJTVyPAYwQMx5}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{CkmOT-ZvDN-sVULinGVKT → A9pNTZdoYJTVyPAYwQMx5}/_ssgManifest.js +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Bắt đầu
|
|
3
|
-
description: "Cài đặt failproofai,
|
|
3
|
+
description: "Cài đặt failproofai, kích hoạt các chính sách, và để các agent của bạn chạy một cách đáng tin cậy"
|
|
4
4
|
icon: rocket
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -27,17 +27,17 @@ bun add -g failproofai
|
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
-
##
|
|
30
|
+
## Hướng dẫn nhanh
|
|
31
31
|
|
|
32
32
|
<Steps>
|
|
33
|
-
<Step title="
|
|
34
|
-
Các chính sách là
|
|
33
|
+
<Step title="Kích hoạt các chính sách">
|
|
34
|
+
Các chính sách là các quy tắc chạy trước và sau mọi lệnh gọi công cụ của agent. Chúng bắt các lệnh có tính hủy diệt, rò rỉ bí mật, và các chế độ lỗi khác trước khi gây thiệt hại.
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
37
|
failproofai policies --install
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
Lệnh này viết các mục hook vào `settings.json` của Claude Code. Bạn cũng có thể cài đặt cho một dự án duy nhất hoặc chọn các chính sách cụ thể:
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
43
|
failproofai policies --install --scope project
|
|
@@ -49,17 +49,17 @@ bun add -g failproofai
|
|
|
49
49
|
failproofai policies
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
Hiển thị mọi chính sách, liệu nó có được bật hay không và bất kỳ tham số
|
|
52
|
+
Hiển thị mọi chính sách, liệu nó có được bật hay không, và bất kỳ tham số được cấu hình nào.
|
|
53
53
|
</Step>
|
|
54
54
|
<Step title="Khởi chạy bảng điều khiển">
|
|
55
55
|
```bash
|
|
56
56
|
failproofai
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
Mở bảng điều khiển cục bộ tại `http://localhost:8020` nơi bạn có thể duyệt phiên, kiểm tra các
|
|
59
|
+
Mở một bảng điều khiển cục bộ tại `http://localhost:8020` nơi bạn có thể duyệt qua các phiên, kiểm tra các lệnh gọi công cụ, và quản lý các chính sách.
|
|
60
60
|
</Step>
|
|
61
61
|
<Step title="Chạy agent của bạn">
|
|
62
|
-
Khởi
|
|
62
|
+
Khởi chạy Claude Code như bình thường. Nếu agent cố gắng làm điều gì đó riskу, failproofai sẽ chặn nó tự động. Để nó chạy mà không cần giám sát và xem xét những gì đã xảy ra trong bảng điều khiển.
|
|
63
63
|
</Step>
|
|
64
64
|
</Steps>
|
|
65
65
|
|
|
@@ -70,33 +70,85 @@ bun add -g failproofai
|
|
|
70
70
|
Mỗi khi một agent chạy một công cụ, Claude Code gọi failproofai như một tiến trình con:
|
|
71
71
|
|
|
72
72
|
```text
|
|
73
|
-
Claude Code → failproofai --hook PreToolUse →
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
Claude Code → failproofai --hook PreToolUse → reads stdin JSON
|
|
74
|
+
evaluates policies
|
|
75
|
+
writes decision to stdout
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
Mỗi chính sách trả về một trong ba quyết định:
|
|
79
79
|
|
|
80
80
|
- **allow** - agent tiếp tục bình thường
|
|
81
81
|
- **deny** - hành động bị chặn, agent được thông báo lý do
|
|
82
|
-
- **instruct** -
|
|
82
|
+
- **instruct** - ngữ cảnh bổ sung được thêm vào prompt của agent
|
|
83
83
|
|
|
84
84
|
<Note>
|
|
85
|
-
Các chính sách chạy trong quy trình cục bộ của bạn. Không có gì được gửi đến
|
|
85
|
+
Các chính sách chạy trong quy trình cục bộ của bạn. Không có gì được gửi đến dịch vụ từ xa.
|
|
86
86
|
</Note>
|
|
87
87
|
|
|
88
88
|
---
|
|
89
89
|
|
|
90
|
+
## Thiết lập chính sách nhóm với chính sách dựa trên quy ước
|
|
91
|
+
|
|
92
|
+
Cách nhanh nhất để thiết lập tiêu chuẩn chất lượng trên toàn nhóm là quy ước `.failproofai/policies/`. Đặt các tệp chính sách vào thư mục này và chúng sẽ được tải tự động — không có cờ, không có thay đổi cấu hình, không có lệnh cài đặt.
|
|
93
|
+
|
|
94
|
+
<Steps>
|
|
95
|
+
<Step title="Tạo thư mục chính sách">
|
|
96
|
+
```bash
|
|
97
|
+
mkdir -p .failproofai/policies
|
|
98
|
+
```
|
|
99
|
+
</Step>
|
|
100
|
+
<Step title="Thêm tệp chính sách">
|
|
101
|
+
Sao chép các ví dụ khởi đầu hoặc viết của riêng bạn:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
cp node_modules/failproofai/examples/convention-policies/*.mjs .failproofai/policies/
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Hoặc tạo một cái mới:
|
|
108
|
+
|
|
109
|
+
```js
|
|
110
|
+
// .failproofai/policies/team-policies.mjs
|
|
111
|
+
import { customPolicies, allow, deny, instruct } from "failproofai";
|
|
112
|
+
|
|
113
|
+
customPolicies.add({
|
|
114
|
+
name: "test-before-commit",
|
|
115
|
+
match: { events: ["PreToolUse"] },
|
|
116
|
+
fn: async (ctx) => {
|
|
117
|
+
if (ctx.toolName !== "Bash") return allow();
|
|
118
|
+
if (/git\s+commit/.test(ctx.toolInput?.command ?? "")) {
|
|
119
|
+
return instruct("Run tests before committing.");
|
|
120
|
+
}
|
|
121
|
+
return allow();
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
```
|
|
125
|
+
</Step>
|
|
126
|
+
<Step title="Commit vào git">
|
|
127
|
+
```bash
|
|
128
|
+
git add .failproofai/policies/
|
|
129
|
+
git commit -m "Add team quality policies"
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Mỗi thành viên nhóm đã cài đặt failproofai sẽ chọn các chính sách này tự động. Không cần thiết lập cho mỗi nhà phát triển.
|
|
133
|
+
</Step>
|
|
134
|
+
</Steps>
|
|
135
|
+
|
|
136
|
+
<Tip>
|
|
137
|
+
Commit `.failproofai/policies/` vào kho lưu trữ của bạn để toàn bộ nhóm chia sẻ cùng một tiêu chuẩn. Khi nhóm của bạn phát hiện các chế độ lỗi mới, hãy thêm chính sách và đẩy — mọi người sẽ nhận bản cập nhật trên `git pull` tiếp theo của họ. Theo thời gian, những chính sách này trở thành một tiêu chuẩn chất lượng sống động tiếp tục cải thiện.
|
|
138
|
+
</Tip>
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
90
142
|
## Lưu trữ dữ liệu
|
|
91
143
|
|
|
92
|
-
Tất cả cấu hình và nhật ký
|
|
144
|
+
Tất cả cấu hình và nhật ký được giữ trên máy của bạn:
|
|
93
145
|
|
|
94
|
-
| Đường dẫn |
|
|
146
|
+
| Đường dẫn | Nội dung lưu trữ |
|
|
95
147
|
|------|----------------|
|
|
96
148
|
| `~/.failproofai/policies-config.json` | Cấu hình chính sách toàn cục |
|
|
97
149
|
| `~/.failproofai/hook-activity.jsonl` | Lịch sử thực thi hook |
|
|
98
|
-
| `~/.failproofai/hook.log` | Nhật ký gỡ lỗi cho
|
|
99
|
-
| `.failproofai/policies-config.json` | Cấu hình cho
|
|
150
|
+
| `~/.failproofai/hook.log` | Nhật ký gỡ lỗi cho lỗi hook tùy chỉnh |
|
|
151
|
+
| `.failproofai/policies-config.json` | Cấu hình cho mỗi dự án (được commit) |
|
|
100
152
|
| `.failproofai/policies-config.local.json` | Ghi đè cá nhân (gitignored) |
|
|
101
153
|
|
|
102
154
|
---
|
|
@@ -119,16 +171,16 @@ Xóa các mục hook khỏi `~/.claude/settings.json`. Các tệp cấu hình tr
|
|
|
119
171
|
Phạm vi và định dạng tệp cấu hình
|
|
120
172
|
</Card>
|
|
121
173
|
|
|
122
|
-
<Card title="Chính sách tích hợp" icon="shield" href="/vi/built-in-policies">
|
|
123
|
-
Tất cả 26 chính sách với tham số
|
|
174
|
+
<Card title="Chính sách tích hợp sẵn" icon="shield" href="/vi/built-in-policies">
|
|
175
|
+
Tất cả 26 chính sách với các tham số
|
|
124
176
|
</Card>
|
|
125
177
|
|
|
126
178
|
<Card title="Chính sách tùy chỉnh" icon="code" href="/vi/custom-policies">
|
|
127
|
-
Viết các chính sách của
|
|
179
|
+
Viết các chính sách riêng của bạn bằng JavaScript
|
|
128
180
|
</Card>
|
|
129
181
|
|
|
130
|
-
<Card title="
|
|
131
|
-
Giám sát phiên và xem
|
|
182
|
+
<Card title="Bộ giám sát agent" icon="chart-line" href="/vi/dashboard">
|
|
183
|
+
Giám sát các phiên và xem lại hoạt động chính sách
|
|
132
184
|
</Card>
|
|
133
185
|
|
|
134
186
|
</CardGroup>
|