failproofai 0.0.5-beta.0 → 0.0.5
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/.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]__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]__0r6vvp5._.js → [root-of-the-server]__0a~g15g._.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]__0okos0k._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0z5dd-f._.js → [root-of-the-server]__0qn95h3._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0w6l33k._.js +1 -1
- 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/{0j_ivegn3i5wt.js → 09ikntpt2-o9b.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0kvldut6ndzyz.js → 0_yayar~bpphd.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0yf_mmdukq6up.js → 0em7tspi4kylh.js} +2 -2
- package/.next/standalone/.next/static/chunks/{04mtv9jnqknn3.js → 0lgbwkfqmnsmc.js} +1 -1
- package/.next/standalone/.next/static/chunks/{04fpsjft~cje..js → 0sme4lkv.tgn-.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0h4qcn40dunn7.js → 0yumumfzx_f27.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0.io32u7gjgsb.js → 13juklu.vksks.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0x8vagatq36_7.js → 17manv47o-~wp.js} +1 -1
- package/.next/standalone/CHANGELOG.md +4 -1
- package/.next/standalone/README.md +2 -2
- package/.next/standalone/dist/cli.mjs +2 -2
- package/.next/standalone/docs/ar/architecture.mdx +2 -2
- package/.next/standalone/docs/ar/configuration.mdx +1 -1
- package/.next/standalone/docs/ar/custom-policies.mdx +2 -5
- package/.next/standalone/docs/architecture.mdx +2 -2
- package/.next/standalone/docs/configuration.mdx +1 -1
- package/.next/standalone/docs/custom-policies.mdx +2 -6
- package/.next/standalone/docs/de/architecture.mdx +2 -2
- package/.next/standalone/docs/de/configuration.mdx +1 -1
- package/.next/standalone/docs/de/custom-policies.mdx +2 -5
- package/.next/standalone/docs/es/architecture.mdx +2 -2
- package/.next/standalone/docs/es/configuration.mdx +1 -1
- package/.next/standalone/docs/es/custom-policies.mdx +2 -5
- package/.next/standalone/docs/fr/architecture.mdx +2 -2
- package/.next/standalone/docs/fr/configuration.mdx +1 -1
- package/.next/standalone/docs/fr/custom-policies.mdx +2 -5
- package/.next/standalone/docs/he/architecture.mdx +2 -2
- package/.next/standalone/docs/he/configuration.mdx +1 -1
- package/.next/standalone/docs/he/custom-policies.mdx +2 -5
- package/.next/standalone/docs/hi/architecture.mdx +2 -2
- package/.next/standalone/docs/hi/configuration.mdx +1 -1
- package/.next/standalone/docs/hi/custom-policies.mdx +2 -5
- package/.next/standalone/docs/i18n/README.ar.md +2 -2
- package/.next/standalone/docs/i18n/README.de.md +2 -2
- package/.next/standalone/docs/i18n/README.es.md +2 -2
- package/.next/standalone/docs/i18n/README.fr.md +2 -2
- package/.next/standalone/docs/i18n/README.he.md +2 -2
- package/.next/standalone/docs/i18n/README.hi.md +2 -2
- package/.next/standalone/docs/i18n/README.it.md +2 -2
- package/.next/standalone/docs/i18n/README.ja.md +2 -2
- package/.next/standalone/docs/i18n/README.ko.md +2 -2
- package/.next/standalone/docs/i18n/README.pt-br.md +2 -2
- package/.next/standalone/docs/i18n/README.ru.md +2 -2
- package/.next/standalone/docs/i18n/README.tr.md +2 -2
- package/.next/standalone/docs/i18n/README.vi.md +2 -2
- package/.next/standalone/docs/i18n/README.zh.md +2 -2
- package/.next/standalone/docs/it/architecture.mdx +2 -2
- package/.next/standalone/docs/it/configuration.mdx +1 -1
- package/.next/standalone/docs/it/custom-policies.mdx +2 -5
- package/.next/standalone/docs/ja/architecture.mdx +2 -2
- package/.next/standalone/docs/ja/configuration.mdx +1 -1
- package/.next/standalone/docs/ja/custom-policies.mdx +2 -5
- package/.next/standalone/docs/ko/architecture.mdx +2 -2
- package/.next/standalone/docs/ko/configuration.mdx +1 -1
- package/.next/standalone/docs/ko/custom-policies.mdx +2 -5
- package/.next/standalone/docs/pt-br/architecture.mdx +2 -2
- package/.next/standalone/docs/pt-br/configuration.mdx +1 -1
- package/.next/standalone/docs/pt-br/custom-policies.mdx +2 -5
- package/.next/standalone/docs/ru/architecture.mdx +2 -2
- package/.next/standalone/docs/ru/configuration.mdx +1 -1
- package/.next/standalone/docs/ru/custom-policies.mdx +2 -5
- package/.next/standalone/docs/tr/architecture.mdx +2 -2
- package/.next/standalone/docs/tr/configuration.mdx +1 -1
- package/.next/standalone/docs/tr/custom-policies.mdx +2 -5
- package/.next/standalone/docs/vi/architecture.mdx +2 -2
- package/.next/standalone/docs/vi/configuration.mdx +1 -1
- package/.next/standalone/docs/vi/custom-policies.mdx +2 -5
- package/.next/standalone/docs/zh/architecture.mdx +2 -2
- package/.next/standalone/docs/zh/configuration.mdx +1 -1
- package/.next/standalone/docs/zh/custom-policies.mdx +2 -5
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/server.js +1 -1
- package/README.md +2 -2
- package/dist/cli.mjs +2 -2
- package/package.json +1 -1
- /package/.next/standalone/.next/static/{ICeMHZ-8ZR7HY5GLm7oSJ → hYQM6iCWnF1W5XDpsIRhV}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{ICeMHZ-8ZR7HY5GLm7oSJ → hYQM6iCWnF1W5XDpsIRhV}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{ICeMHZ-8ZR7HY5GLm7oSJ → hYQM6iCWnF1W5XDpsIRhV}/_ssgManifest.js +0 -0
|
@@ -208,7 +208,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
208
208
|
| Función | Efecto |
|
|
209
209
|
|---------|--------|
|
|
210
210
|
| `allow()` | Permite la operación |
|
|
211
|
-
| `allow(message)` | Permite y envía contexto informativo a Claude
|
|
211
|
+
| `allow(message)` | Permite y envía contexto informativo a Claude |
|
|
212
212
|
| `deny(message)` | Bloquea la operación; el mensaje se muestra a Claude |
|
|
213
213
|
| `instruct(message)` | Añade contexto al prompt de Claude; no bloquea |
|
|
214
214
|
|
|
@@ -226,7 +226,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
226
226
|
|
|
227
227
|
Los hooks personalizados admiten importaciones locales transitivas, async/await y acceso a `process.env`. Los errores son fail-open (se registran en `~/.failproofai/hook.log`, las políticas integradas continúan). Consulta [docs/custom-hooks.mdx](docs/custom-hooks.mdx) para la guía completa.
|
|
228
228
|
|
|
229
|
-
### Políticas basadas en convenciones
|
|
229
|
+
### Políticas basadas en convenciones
|
|
230
230
|
|
|
231
231
|
Coloca archivos `*policies.{js,mjs,ts}` en `.failproofai/policies/` y se cargarán automáticamente — sin necesidad de usar la opción `--custom` ni modificar la configuración. Funciona como los git hooks: añade un archivo y listo.
|
|
232
232
|
|
|
@@ -208,7 +208,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
208
208
|
| Fonction | Effet |
|
|
209
209
|
|----------|--------|
|
|
210
210
|
| `allow()` | Autorise l'opération |
|
|
211
|
-
| `allow(message)` | Autorise et envoie un contexte informatif à Claude
|
|
211
|
+
| `allow(message)` | Autorise et envoie un contexte informatif à Claude |
|
|
212
212
|
| `deny(message)` | Bloque l'opération ; le message est affiché à Claude |
|
|
213
213
|
| `instruct(message)` | Ajoute du contexte au prompt de Claude ; ne bloque pas |
|
|
214
214
|
|
|
@@ -226,7 +226,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
226
226
|
|
|
227
227
|
Les hooks personnalisés prennent en charge les imports locaux transitifs, async/await et l'accès à `process.env`. Les erreurs sont en mode fail-open (journalisées dans `~/.failproofai/hook.log`, les politiques intégrées continuent). Consultez [docs/custom-hooks.mdx](docs/custom-hooks.mdx) pour le guide complet.
|
|
228
228
|
|
|
229
|
-
### Politiques basées sur les conventions
|
|
229
|
+
### Politiques basées sur les conventions
|
|
230
230
|
|
|
231
231
|
Déposez des fichiers `*policies.{js,mjs,ts}` dans `.failproofai/policies/` et ils sont chargés automatiquement — aucun indicateur `--custom` ni modification de configuration n'est nécessaire. Fonctionne comme les hooks git : déposez un fichier, ça marche tout simplement.
|
|
232
232
|
|
|
@@ -210,7 +210,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
210
210
|
| פונקציה | השפעה |
|
|
211
211
|
|----------|--------|
|
|
212
212
|
| `allow()` | אפשר את הפעולה |
|
|
213
|
-
| `allow(message)` | אפשר ושלח תיאור מידע ל-Claude
|
|
213
|
+
| `allow(message)` | אפשר ושלח תיאור מידע ל-Claude |
|
|
214
214
|
| `deny(message)` | חסום את הפעולה; ההודעה מוצגת ל-Claude |
|
|
215
215
|
| `instruct(message)` | הוסף הקשר להנמקה של Claude; לא חוסם |
|
|
216
216
|
|
|
@@ -228,7 +228,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
228
228
|
|
|
229
229
|
ווו מותאם אישית תומך בייבואים מקומיים חילופיים, async/await, וגישה ל-`process.env`. שגיאות הן fail-open (מתועדות ל-`~/.failproofai/hook.log`, מדיניויות מובנות ממשיכות). ראה [docs/custom-hooks.mdx](docs/custom-hooks.mdx) לקבלת מדריך מלא.
|
|
230
230
|
|
|
231
|
-
### מדיניויות על בסיס קונוונציה
|
|
231
|
+
### מדיניויות על בסיס קונוונציה
|
|
232
232
|
|
|
233
233
|
שחרר קבצי `*policies.{js,mjs,ts}` ל-`.failproofai/policies/` והם נטענים באופן אוטומטי — אין צורך בדגל `--custom` או שינויי הגדרה. עובד כמו git hooks: שחרור קובץ, זה פשוט עובד.
|
|
234
234
|
|
|
@@ -208,7 +208,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
208
208
|
| कार्य | प्रभाव |
|
|
209
209
|
|----------|--------|
|
|
210
210
|
| `allow()` | संचालन की अनुमति दें |
|
|
211
|
-
| `allow(message)` | अनुमति दें और Claude को सूचनात्मक संदर्भ भेजें
|
|
211
|
+
| `allow(message)` | अनुमति दें और Claude को सूचनात्मक संदर्भ भेजें |
|
|
212
212
|
| `deny(message)` | संचालन को ब्लॉक करें; संदेश Claude को दिखाया जाता है |
|
|
213
213
|
| `instruct(message)` | Claude के प्रॉम्प्ट में संदर्भ जोड़ें; ब्लॉक नहीं करता है |
|
|
214
214
|
|
|
@@ -226,7 +226,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
226
226
|
|
|
227
227
|
कस्टम हुक्स सकर्मक स्थानीय आयातों, async/await, और `process.env` के लिए पहुंच का समर्थन करते हैं। त्रुटियाँ fail-open हैं (लॉग किए गए `~/.failproofai/hook.log` में, बिल्ट-इन नीतियाँ जारी रहती हैं)। संपूर्ण गाइड के लिए [docs/custom-hooks.mdx](docs/custom-hooks.mdx) देखें।
|
|
228
228
|
|
|
229
|
-
### कन्वेंशन-आधारित नीतियाँ
|
|
229
|
+
### कन्वेंशन-आधारित नीतियाँ
|
|
230
230
|
|
|
231
231
|
`.failproofai/policies/` में `*policies.{js,mjs,ts}` फ़ाइलें छोड़ें और वे स्वचालित रूप से लोड होते हैं — कोई `--custom` फ्लैग या कॉन्फ़िगरेशन परिवर्तन की आवश्यकता नहीं। यह git हुक्स की तरह काम करता है: एक फ़ाइल छोड़ें, यह बस काम करता है।
|
|
232
232
|
|
|
@@ -208,7 +208,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
208
208
|
| Funzione | Effetto |
|
|
209
209
|
|----------|--------|
|
|
210
210
|
| `allow()` | Consenti l'operazione |
|
|
211
|
-
| `allow(message)` | Consenti e invia contesto informativo a Claude
|
|
211
|
+
| `allow(message)` | Consenti e invia contesto informativo a Claude |
|
|
212
212
|
| `deny(message)` | Blocca l'operazione; messaggio mostrato a Claude |
|
|
213
213
|
| `instruct(message)` | Aggiungi contesto al prompt di Claude; non blocca |
|
|
214
214
|
|
|
@@ -226,7 +226,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
226
226
|
|
|
227
227
|
Gli hook personalizzati supportano importazioni locali transitive, async/await e accesso a `process.env`. Gli errori sono fail-open (registrati in `~/.failproofai/hook.log`, i criteri integrati continuano). Vedi [docs/custom-hooks.mdx](docs/custom-hooks.mdx) per la guida completa.
|
|
228
228
|
|
|
229
|
-
### Criteri basati su convenzione
|
|
229
|
+
### Criteri basati su convenzione
|
|
230
230
|
|
|
231
231
|
Inserisci i file `*policies.{js,mjs,ts}` in `.failproofai/policies/` e vengono caricati automaticamente - nessun flag `--custom` o modifiche di configurazione necessarie. Funziona come i git hook: inserisci un file, funziona e basta.
|
|
232
232
|
|
|
@@ -208,7 +208,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
208
208
|
| 関数 | 効果 |
|
|
209
209
|
|------|------|
|
|
210
210
|
| `allow()` | 操作を許可 |
|
|
211
|
-
| `allow(message)` | 許可し、情報コンテキストを Claude に送信
|
|
211
|
+
| `allow(message)` | 許可し、情報コンテキストを Claude に送信 |
|
|
212
212
|
| `deny(message)` | 操作をブロック。メッセージが Claude に表示される |
|
|
213
213
|
| `instruct(message)` | Claude のプロンプトにコンテキストを追加。ブロックはしない |
|
|
214
214
|
|
|
@@ -226,7 +226,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
226
226
|
|
|
227
227
|
カスタムフックは推移的なローカルインポート、async/await、`process.env` へのアクセスをサポートしています。エラーはフェイルオープン(`~/.failproofai/hook.log` に記録され、ビルトインポリシーは継続)となります。詳細なガイドは [docs/custom-hooks.mdx](docs/custom-hooks.mdx) を参照してください。
|
|
228
228
|
|
|
229
|
-
###
|
|
229
|
+
### 規約ベースのポリシー
|
|
230
230
|
|
|
231
231
|
`*policies.{js,mjs,ts}` ファイルを `.failproofai/policies/` に配置するだけで自動的に読み込まれます — `--custom` フラグや設定変更は不要です。gitフックと同じように、ファイルを置くだけで動作します。
|
|
232
232
|
|
|
@@ -208,7 +208,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
208
208
|
| 함수 | 동작 |
|
|
209
209
|
|------|------|
|
|
210
210
|
| `allow()` | 작업 허용 |
|
|
211
|
-
| `allow(message)` | 허용하고 Claude에 정보성 컨텍스트 전달
|
|
211
|
+
| `allow(message)` | 허용하고 Claude에 정보성 컨텍스트 전달 |
|
|
212
212
|
| `deny(message)` | 작업 차단; 메시지가 Claude에 표시됨 |
|
|
213
213
|
| `instruct(message)` | Claude 프롬프트에 컨텍스트 추가; 차단하지 않음 |
|
|
214
214
|
|
|
@@ -226,7 +226,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
226
226
|
|
|
227
227
|
커스텀 훅은 전이적 로컬 임포트, async/await, `process.env` 접근을 지원합니다. 오류는 fail-open 방식으로 처리됩니다 (`~/.failproofai/hook.log`에 기록되며, 기본 제공 정책은 계속 실행됩니다). 전체 가이드는 [docs/custom-hooks.mdx](docs/custom-hooks.mdx)를 참고하세요.
|
|
228
228
|
|
|
229
|
-
### 컨벤션 기반 정책
|
|
229
|
+
### 컨벤션 기반 정책
|
|
230
230
|
|
|
231
231
|
`.failproofai/policies/` 디렉토리에 `*policies.{js,mjs,ts}` 파일을 추가하면 자동으로 로드됩니다 — `--custom` 플래그나 설정 변경이 필요 없습니다. git 훅처럼 파일을 추가하기만 하면 바로 동작합니다.
|
|
232
232
|
|
|
@@ -208,7 +208,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
208
208
|
| Função | Efeito |
|
|
209
209
|
|--------|--------|
|
|
210
210
|
| `allow()` | Permite a operação |
|
|
211
|
-
| `allow(message)` | Permite e envia contexto informativo para o Claude
|
|
211
|
+
| `allow(message)` | Permite e envia contexto informativo para o Claude |
|
|
212
212
|
| `deny(message)` | Bloqueia a operação; a mensagem é exibida para o Claude |
|
|
213
213
|
| `instruct(message)` | Adiciona contexto ao prompt do Claude; não bloqueia |
|
|
214
214
|
|
|
@@ -226,7 +226,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
226
226
|
|
|
227
227
|
Hooks personalizados suportam importações locais transitivas, async/await e acesso a `process.env`. Erros são fail-open (registrados em `~/.failproofai/hook.log`, as políticas integradas continuam funcionando). Consulte [docs/custom-hooks.mdx](docs/custom-hooks.mdx) para o guia completo.
|
|
228
228
|
|
|
229
|
-
### Políticas baseadas em convenção
|
|
229
|
+
### Políticas baseadas em convenção
|
|
230
230
|
|
|
231
231
|
Coloque arquivos `*policies.{js,mjs,ts}` na pasta `.failproofai/policies/` e eles serão carregados automaticamente — sem necessidade de flag `--custom` ou alterações de configuração. Funciona como git hooks: basta adicionar o arquivo e pronto.
|
|
232
232
|
|
|
@@ -208,7 +208,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
208
208
|
| Функция | Эффект |
|
|
209
209
|
|---------|--------|
|
|
210
210
|
| `allow()` | Разрешить операцию |
|
|
211
|
-
| `allow(message)` | Разрешить и отправить информационный контекст Claude
|
|
211
|
+
| `allow(message)` | Разрешить и отправить информационный контекст Claude |
|
|
212
212
|
| `deny(message)` | Заблокировать операцию; сообщение показано Claude |
|
|
213
213
|
| `instruct(message)` | Добавить контекст в подсказку Claude; не блокирует |
|
|
214
214
|
|
|
@@ -226,7 +226,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
226
226
|
|
|
227
227
|
Пользовательские перехватчики поддерживают переходные локальные импорты, async/await и доступ к `process.env`. Ошибки безопасны (логируются в `~/.failproofai/hook.log`, встроенные политики продолжают работу). Полное руководство см. в [docs/custom-hooks.mdx](docs/custom-hooks.mdx).
|
|
228
228
|
|
|
229
|
-
### Политики на основе соглашений
|
|
229
|
+
### Политики на основе соглашений
|
|
230
230
|
|
|
231
231
|
Поместите файлы `*policies.{js,mjs,ts}` в `.failproofai/policies/` — они будут автоматически загружены без флага `--custom` или изменения конфигурации. Работает как git-хуки: поместите файл, и всё работает.
|
|
232
232
|
|
|
@@ -208,7 +208,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
208
208
|
| İşlev | Etki |
|
|
209
209
|
|-------|------|
|
|
210
210
|
| `allow()` | İşleme izin ver |
|
|
211
|
-
| `allow(message)` | İzin ver ve bilgilendirici bağlam Claude'a gönder
|
|
211
|
+
| `allow(message)` | İzin ver ve bilgilendirici bağlam Claude'a gönder |
|
|
212
212
|
| `deny(message)` | İşlemi engelle; ileti Claude'a gösterilir |
|
|
213
213
|
| `instruct(message)` | Claude'un istemine bağlam ekle; engelleme yapmaz |
|
|
214
214
|
|
|
@@ -226,7 +226,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
226
226
|
|
|
227
227
|
Özel hooklar geçişli yerel içe aktarmaları, async/await'i ve `process.env` erişimini destekler. Hatalar açık başarısızlık modunda yapılır (günlüklenir: `~/.failproofai/hook.log`, yerleşik politikalar devam eder). Tam rehber için bkz. [docs/custom-hooks.mdx](docs/custom-hooks.mdx).
|
|
228
228
|
|
|
229
|
-
### Kural tabanlı politikalar
|
|
229
|
+
### Kural tabanlı politikalar
|
|
230
230
|
|
|
231
231
|
`*policies.{js,mjs,ts}` dosyalarını `.failproofai/policies/` klasörüne bırakın ve otomatik olarak yüklenir — `--custom` bayrağı veya yapılandırma değişiklikleri gerekmez. Git hook'ları gibi çalışır: bir dosya bırakın, her şey çalışır.
|
|
232
232
|
|
|
@@ -208,7 +208,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
208
208
|
| Hàm | Hiệu ứng |
|
|
209
209
|
|-----|---------|
|
|
210
210
|
| `allow()` | Cho phép thao tác |
|
|
211
|
-
| `allow(message)` | Cho phép và gửi ngữ cảnh thông tin tới Claude
|
|
211
|
+
| `allow(message)` | Cho phép và gửi ngữ cảnh thông tin tới Claude |
|
|
212
212
|
| `deny(message)` | Chặn thao tác; thông báo được hiển thị tới Claude |
|
|
213
213
|
| `instruct(message)` | Thêm ngữ cảnh vào yêu cầu của Claude; không chặn |
|
|
214
214
|
|
|
@@ -226,7 +226,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
226
226
|
|
|
227
227
|
Các hook tùy chỉnh hỗ trợ nhập cục bộ chuyển tiếp, async/await và truy cập `process.env`. Các lỗi là fail-open (được ghi vào `~/.failproofai/hook.log`, các chính sách tích hợp sẵn tiếp tục). Xem [docs/custom-hooks.mdx](docs/custom-hooks.mdx) để biết hướng dẫn đầy đủ.
|
|
228
228
|
|
|
229
|
-
### Chính sách dựa trên quy ước
|
|
229
|
+
### Chính sách dựa trên quy ước
|
|
230
230
|
|
|
231
231
|
Thả các tệp `*policies.{js,mjs,ts}` vào `.failproofai/policies/` và chúng sẽ được tải tự động — không cần cờ `--custom` hoặc thay đổi cấu hình. Hoạt động giống như git hooks: thả một tệp, nó hoạt động.
|
|
232
232
|
|
|
@@ -208,7 +208,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
208
208
|
| 函数 | 效果 |
|
|
209
209
|
|------|------|
|
|
210
210
|
| `allow()` | 允许该操作 |
|
|
211
|
-
| `allow(message)` | 允许并向 Claude 发送信息性上下文
|
|
211
|
+
| `allow(message)` | 允许并向 Claude 发送信息性上下文 |
|
|
212
212
|
| `deny(message)` | 阻止该操作;消息将显示给 Claude |
|
|
213
213
|
| `instruct(message)` | 向 Claude 的提示词添加上下文;不会阻止操作 |
|
|
214
214
|
|
|
@@ -226,7 +226,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
226
226
|
|
|
227
227
|
自定义 hook 支持传递性本地导入、async/await,以及访问 `process.env`。错误采用放行处理(记录到 `~/.failproofai/hook.log`,内置策略继续执行)。完整指南参见 [docs/custom-hooks.mdx](docs/custom-hooks.mdx)。
|
|
228
228
|
|
|
229
|
-
###
|
|
229
|
+
### 基于约定的策略
|
|
230
230
|
|
|
231
231
|
将 `*policies.{js,mjs,ts}` 文件放入 `.failproofai/policies/` 目录,它们将自动加载——无需 `--custom` 标志或配置变更。就像 git hooks 一样:放入文件即可生效。
|
|
232
232
|
|
|
@@ -103,9 +103,9 @@ Il gestore applica un limite di 1 MB per stdin. I payload che superano questo li
|
|
|
103
103
|
- Exit code: `0`
|
|
104
104
|
- Stdout vuoto
|
|
105
105
|
|
|
106
|
-
**Allow con messaggio
|
|
106
|
+
**Allow con messaggio:**
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
`allow(message)` consente a una politica di inviare un contesto informativo a Claude anche quando l'operazione è consentita. Il gestore di hook scrive il seguente JSON su **stdout** (non in un file di configurazione — questa è la risposta del gestore a Claude Code, proprio come le risposte deny e instruct sopra):
|
|
109
109
|
|
|
110
110
|
```json
|
|
111
111
|
// Written to stdout by the hook handler process
|
|
@@ -154,7 +154,7 @@ Percorso a un file JavaScript contenente policy hook personalizzate. Viene impos
|
|
|
154
154
|
|
|
155
155
|
Il file viene caricato nuovo su ogni evento hook - non c'è caching. Vedi [Custom Policies](/it/custom-policies) per i dettagli di authoring.
|
|
156
156
|
|
|
157
|
-
### Policy basate su convenzione
|
|
157
|
+
### Policy basate su convenzione
|
|
158
158
|
|
|
159
159
|
Oltre al `customPoliciesPath` esplicito, failproofai scopre e carica automaticamente i file di policy dalle directory `.failproofai/policies/`:
|
|
160
160
|
|
|
@@ -40,7 +40,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
40
40
|
|
|
41
41
|
## Due modi per caricare criteri personalizzati
|
|
42
42
|
|
|
43
|
-
### Opzione 1: Basata su convenzione (consigliato
|
|
43
|
+
### Opzione 1: Basata su convenzione (consigliato)
|
|
44
44
|
|
|
45
45
|
Inserisci i file `*policies.{js,mjs,ts}` in `.failproofai/policies/` e vengono caricati automaticamente — nessun flag o modifica di configurazione necessaria. Funziona come i git hook: inserisci un file e funziona.
|
|
46
46
|
|
|
@@ -126,11 +126,8 @@ customPolicies.add({
|
|
|
126
126
|
Puoi aggiungere guidance extra a qualsiasi messaggio `deny` o `instruct` aggiungendo un campo `hint` in `policyParams` — nessuna modifica di codice necessaria. Questo funziona per i criteri personalizzati (`custom/`), di convenzione di progetto (`.failproofai-project/`), e di convenzione utente (`.failproofai-user/`) anche. Vedi [Configurazione → hint](/it/configuration#hint-cross-cutting) per i dettagli.
|
|
127
127
|
</Tip>
|
|
128
128
|
|
|
129
|
-
### Messaggi di allow informativi
|
|
129
|
+
### Messaggi di allow informativi
|
|
130
130
|
|
|
131
|
-
<Note>
|
|
132
|
-
`allow(message)` è una funzione beta disponibile da v0.0.2-beta.3. L'API potrebbe cambiare nelle versioni future. Le versioni precedenti supportano solo `allow()` senza argomenti.
|
|
133
|
-
</Note>
|
|
134
131
|
|
|
135
132
|
`allow(message)` consente l'operazione **e** invia un messaggio informativo indietro a Claude. Il messaggio viene consegnato come `additionalContext` nella risposta stdout del gestore dell'evento hook — lo stesso meccanismo usato da `instruct`, ma semanticamente diverso: è un aggiornamento di stato, non un avviso.
|
|
136
133
|
|
|
@@ -102,9 +102,9 @@ Claude Code は各ツール呼び出しの前に `failproofai --hook PreToolUse`
|
|
|
102
102
|
- 終了コード: `0`
|
|
103
103
|
- stdout は空
|
|
104
104
|
|
|
105
|
-
**メッセージ付き Allow
|
|
105
|
+
**メッセージ付き Allow:**
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
`allow(message)` を使用することで、操作が許可されている場合でもポリシーが Claude に情報コンテキストを返せるようになりました。フックハンドラーは以下の JSON を **stdout** に書き込みます(設定ファイルではありません。上記の deny や instruct のレスポンスと同様に、Claude Code へのハンドラープロセスのレスポンスです)。
|
|
108
108
|
|
|
109
109
|
```json
|
|
110
110
|
// フックハンドラープロセスによって stdout に書き込まれます
|
|
@@ -153,7 +153,7 @@ resolved: { allowPatterns: ["sudo systemctl status"] } ← global にフォー
|
|
|
153
153
|
|
|
154
154
|
このファイルはフックイベントのたびに新たに読み込まれます。キャッシュは使用されません。作成方法の詳細は [Custom Policies](/ja/custom-policies) を参照してください。
|
|
155
155
|
|
|
156
|
-
###
|
|
156
|
+
### 規約ベースのポリシー
|
|
157
157
|
|
|
158
158
|
明示的な `customPoliciesPath` に加えて、failproofai は `.failproofai/policies/` ディレクトリからポリシーファイルを自動的に検出して読み込みます。
|
|
159
159
|
|
|
@@ -39,7 +39,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
39
39
|
|
|
40
40
|
## カスタムポリシーの読み込み方法(2通り)
|
|
41
41
|
|
|
42
|
-
### 方法1:
|
|
42
|
+
### 方法1: 規約ベース(推奨)
|
|
43
43
|
|
|
44
44
|
`*policies.{js,mjs,ts}` ファイルを `.failproofai/policies/` に置くだけで自動的に読み込まれます。フラグや設定変更は不要です。gitフックと同じ仕組みです。ファイルを置けばそのまま動きます。
|
|
45
45
|
|
|
@@ -125,11 +125,8 @@ customPolicies.add({
|
|
|
125
125
|
`policyParams` の `hint` フィールドを追加することで、`deny` や `instruct` のメッセージに追加のガイダンスを付け加えられます。コードの変更は不要です。これはカスタム(`custom/`)、プロジェクト規約(`.failproofai-project/`)、ユーザー規約(`.failproofai-user/`)ポリシーでも機能します。詳細は [設定 → hint](/ja/configuration#hint-cross-cutting) を参照してください。
|
|
126
126
|
</Tip>
|
|
127
127
|
|
|
128
|
-
### 情報提供用のallow
|
|
128
|
+
### 情報提供用のallowメッセージ
|
|
129
129
|
|
|
130
|
-
<Note>
|
|
131
|
-
`allow(message)` はv0.0.2-beta.3から利用できるベータ機能です。APIは将来のリリースで変更される可能性があります。それ以前のバージョンでは引数なしの `allow()` のみサポートされています。
|
|
132
|
-
</Note>
|
|
133
130
|
|
|
134
131
|
`allow(message)` は操作を許可し**つつ**、情報提供のメッセージをClaudeに送信します。メッセージはフックハンドラーのstdoutレスポンスの `additionalContext` として配信されます。これは `instruct` と同じ仕組みですが、意味的に異なります。警告ではなくステータスの更新として扱われます。
|
|
135
132
|
|
|
@@ -102,9 +102,9 @@ Claude Code는 각 툴 호출 전에 `failproofai --hook PreToolUse`를 서브
|
|
|
102
102
|
- 종료 코드: `0`
|
|
103
103
|
- stdout 출력 없음
|
|
104
104
|
|
|
105
|
-
**메시지를 포함한 allow
|
|
105
|
+
**메시지를 포함한 allow:**
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
`allow(message)`를 통해 정책이 작업을 허용하면서도 Claude에게 정보성 컨텍스트를 전달할 수 있습니다. 훅 핸들러는 다음 JSON을 **stdout**에 씁니다 (설정 파일이 아니라 deny 및 instruct 응답과 마찬가지로 Claude Code에 대한 핸들러의 응답입니다):
|
|
108
108
|
|
|
109
109
|
```json
|
|
110
110
|
// 훅 핸들러 프로세스가 stdout에 씁니다
|
|
@@ -153,7 +153,7 @@ resolved: { allowPatterns: ["sudo systemctl status"] } ← global까지 폴스
|
|
|
153
153
|
|
|
154
154
|
파일은 매 훅 이벤트마다 새로 로드됩니다. 캐싱은 없습니다. 작성 방법은 [커스텀 정책](/ko/custom-policies)을 참조하세요.
|
|
155
155
|
|
|
156
|
-
### 컨벤션 기반 정책
|
|
156
|
+
### 컨벤션 기반 정책
|
|
157
157
|
|
|
158
158
|
명시적인 `customPoliciesPath` 외에도, failproofai는 `.failproofai/policies/` 디렉터리에서 정책 파일을 자동으로 검색하여 로드합니다:
|
|
159
159
|
|
|
@@ -39,7 +39,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
39
39
|
|
|
40
40
|
## 커스텀 정책을 불러오는 두 가지 방법
|
|
41
41
|
|
|
42
|
-
### 방법 1: 컨벤션 기반 (
|
|
42
|
+
### 방법 1: 컨벤션 기반 (권장)
|
|
43
43
|
|
|
44
44
|
`.failproofai/policies/` 디렉터리에 `*policies.{js,mjs,ts}` 파일을 넣으면 자동으로 불러옵니다 — 별도의 플래그나 설정 변경이 필요 없습니다. git 훅처럼 파일을 넣으면 바로 작동합니다.
|
|
45
45
|
|
|
@@ -125,11 +125,8 @@ customPolicies.add({
|
|
|
125
125
|
`policyParams`의 `hint` 필드를 추가하면 코드 변경 없이 `deny` 또는 `instruct` 메시지에 추가 안내를 덧붙일 수 있습니다. 커스텀(`custom/`), 프로젝트 컨벤션(`.failproofai-project/`), 사용자 컨벤션(`.failproofai-user/`) 정책 모두에서 작동합니다. 자세한 내용은 [Configuration → hint](/ko/configuration#hint-cross-cutting)를 참고하세요.
|
|
126
126
|
</Tip>
|
|
127
127
|
|
|
128
|
-
### 정보성 allow 메시지
|
|
128
|
+
### 정보성 allow 메시지
|
|
129
129
|
|
|
130
|
-
<Note>
|
|
131
|
-
`allow(message)`는 v0.0.2-beta.3부터 사용 가능한 베타 기능입니다. API는 향후 릴리스에서 변경될 수 있습니다. 이전 버전은 인수 없는 `allow()`만 지원합니다.
|
|
132
|
-
</Note>
|
|
133
130
|
|
|
134
131
|
`allow(message)`는 작업을 허용하면서 **동시에** 정보성 메시지를 Claude에게 전달합니다. 메시지는 훅 핸들러의 stdout 응답에서 `additionalContext`로 전달됩니다 — `instruct`와 동일한 메커니즘이지만, 의미적으로 다릅니다. 이는 경고가 아닌 상태 업데이트입니다.
|
|
135
132
|
|
|
@@ -102,9 +102,9 @@ O handler impõe um limite de 1 MB para stdin. Payloads que excedam esse tamanho
|
|
|
102
102
|
- Código de saída: `0`
|
|
103
103
|
- stdout vazio
|
|
104
104
|
|
|
105
|
-
**Allow com mensagem
|
|
105
|
+
**Allow com mensagem:**
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
`allow(message)` permite que uma política envie contexto informativo de volta ao Claude mesmo quando a operação é permitida. O hook handler escreve o seguinte JSON em **stdout** (não em um arquivo de configuração — esta é a resposta do handler ao Claude Code, assim como as respostas de deny e instruct acima):
|
|
108
108
|
|
|
109
109
|
```json
|
|
110
110
|
// Written to stdout by the hook handler process
|
|
@@ -153,7 +153,7 @@ Caminho para um arquivo JavaScript contendo políticas de hook personalizadas. E
|
|
|
153
153
|
|
|
154
154
|
O arquivo é carregado novamente a cada evento de hook — não há cache. Consulte [Políticas personalizadas](/pt-br/custom-policies) para detalhes de autoria.
|
|
155
155
|
|
|
156
|
-
### Políticas baseadas em convenção
|
|
156
|
+
### Políticas baseadas em convenção
|
|
157
157
|
|
|
158
158
|
Além do `customPoliciesPath` explícito, failproofai descobre e carrega automaticamente arquivos de políticas dos diretórios `.failproofai/policies/`:
|
|
159
159
|
|
|
@@ -39,7 +39,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
39
39
|
|
|
40
40
|
## Duas formas de carregar políticas personalizadas
|
|
41
41
|
|
|
42
|
-
### Opção 1: Baseada em convenção (recomendada
|
|
42
|
+
### Opção 1: Baseada em convenção (recomendada)
|
|
43
43
|
|
|
44
44
|
Coloque arquivos `*policies.{js,mjs,ts}` dentro de `.failproofai/policies/` e eles serão carregados automaticamente — sem flags ou alterações de configuração. Funciona como git hooks: coloque o arquivo e pronto.
|
|
45
45
|
|
|
@@ -125,11 +125,8 @@ customPolicies.add({
|
|
|
125
125
|
Você pode adicionar orientações extras a qualquer mensagem `deny` ou `instruct` incluindo um campo `hint` em `policyParams` — sem necessidade de alteração de código. Isso funciona para políticas personalizadas (`custom/`), de convenção do projeto (`.failproofai-project/`) e de convenção do usuário (`.failproofai-user/`) também. Veja [Configuração → hint](/pt-br/configuration#hint-cross-cutting) para detalhes.
|
|
126
126
|
</Tip>
|
|
127
127
|
|
|
128
|
-
### Mensagens informativas de allow
|
|
128
|
+
### Mensagens informativas de allow
|
|
129
129
|
|
|
130
|
-
<Note>
|
|
131
|
-
`allow(message)` é um recurso beta disponível desde a v0.0.2-beta.3. A API pode mudar em versões futuras. Versões anteriores suportam apenas `allow()` sem argumentos.
|
|
132
|
-
</Note>
|
|
133
130
|
|
|
134
131
|
`allow(message)` permite a operação **e** envia uma mensagem informativa de volta para Claude. A mensagem é entregue como `additionalContext` na resposta stdout do handler de hook — o mesmo mecanismo usado por `instruct`, mas semanticamente diferente: é uma atualização de status, não um aviso.
|
|
135
132
|
|
|
@@ -104,9 +104,9 @@ failproofai состоит из двух независимых подсисте
|
|
|
104
104
|
- Код выхода: `0`
|
|
105
105
|
- Пустой stdout
|
|
106
106
|
|
|
107
|
-
**Разрешить с
|
|
107
|
+
**Разрешить с сообщением:**
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
`allow(message)` позволяет политике отправить контекстную информацию в Claude, даже если операция разрешена. Обработчик хука записывает в **stdout** следующий JSON (не в файл конфигурации — это ответ обработчика на Claude Code, как и ответы deny и instruct выше):
|
|
110
110
|
|
|
111
111
|
```json
|
|
112
112
|
// Written to stdout by the hook handler process
|
|
@@ -154,7 +154,7 @@ resolved: { allowPatterns: ["sudo systemctl status"] } ← переходит
|
|
|
154
154
|
|
|
155
155
|
Файл загружается заново при каждом события hook — кеширования нет. Детали разработки см. в разделе [Custom Policies](/ru/custom-policies).
|
|
156
156
|
|
|
157
|
-
### Политики на основе конвенций
|
|
157
|
+
### Политики на основе конвенций
|
|
158
158
|
|
|
159
159
|
В дополнение к явному `customPoliciesPath`, failproofai автоматически обнаруживает и загружает файлы политик из директорий `.failproofai/policies/`:
|
|
160
160
|
|
|
@@ -39,7 +39,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
39
39
|
|
|
40
40
|
## Два способа загрузки пользовательских политик
|
|
41
41
|
|
|
42
|
-
### Вариант 1: На основе соглашений (
|
|
42
|
+
### Вариант 1: На основе соглашений (рекомендуется)
|
|
43
43
|
|
|
44
44
|
Поместите файлы `*policies.{js,mjs,ts}` в `.failproofai/policies/` и они будут загружены автоматически — никаких флагов или изменений конфигурации не требуется. Это работает как git hooks: поместите файл, и он просто работает.
|
|
45
45
|
|
|
@@ -125,11 +125,8 @@ customPolicies.add({
|
|
|
125
125
|
Вы можете добавить дополнительные рекомендации к любому сообщению `deny` или `instruct`, добавив поле `hint` в `policyParams` — без изменения кода. Это работает для пользовательских (`custom/`), проектных (`failproofai-project/`) и пользовательских (`failproofai-user/`) политик. См. [Конфигурация → hint](/ru/configuration#hint-cross-cutting) для подробностей.
|
|
126
126
|
</Tip>
|
|
127
127
|
|
|
128
|
-
### Информационные сообщения allow
|
|
128
|
+
### Информационные сообщения allow
|
|
129
129
|
|
|
130
|
-
<Note>
|
|
131
|
-
`allow(message)` — это функция бета, доступная с v0.0.2-beta.3. API может измениться в будущих версиях. Более ранние версии поддерживают только `allow()` без аргументов.
|
|
132
|
-
</Note>
|
|
133
130
|
|
|
134
131
|
`allow(message)` разрешает операцию **и** отправляет информационное сообщение обратно Claude. Сообщение доставляется как `additionalContext` в ответе stdout обработчика перехватчика — тот же механизм, используемый `instruct`, но семантически отличается: это обновление статуса, а не предупреждение.
|
|
135
132
|
|
|
@@ -103,9 +103,9 @@ Handler 1 MB'lık stdin sınırını zorunlu kılar. Bu limiti aşan payload'lar
|
|
|
103
103
|
- Çıkış kodu: `0`
|
|
104
104
|
- Boş stdout
|
|
105
105
|
|
|
106
|
-
**İzinle mesaj
|
|
106
|
+
**İzinle mesaj:**
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
`allow(message)`, bir policy işleme izin verildiğinde bile Claude'a bilgilendirici bağlam gönderebilir. Hook handler aşağıdaki JSON'u **stdout'a** yazar (bir config dosyasına değil — bu handler'ın Claude Code'a yanıtıdır, reddet ve talimat yanıtları gibi):
|
|
109
109
|
|
|
110
110
|
```json
|
|
111
111
|
// Hook handler işlemi tarafından stdout'a yazılır
|
|
@@ -154,7 +154,7 @@ Tür: `string` (mutlak yol)
|
|
|
154
154
|
|
|
155
155
|
Dosya her hook olayında yeniden yüklenir - önbelleğe alma yoktur. Yazma ayrıntıları için [Özel Politikalar](/tr/custom-policies) bölümüne bakın.
|
|
156
156
|
|
|
157
|
-
### Kural tabanlı politikalar
|
|
157
|
+
### Kural tabanlı politikalar
|
|
158
158
|
|
|
159
159
|
Açık `customPoliciesPath` öğesine ek olarak, failproofai `.failproofai/policies/` dizinlerinden policy dosyalarını otomatik olarak keşfeder ve yükler:
|
|
160
160
|
|
|
@@ -39,7 +39,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
39
39
|
|
|
40
40
|
## Özel politikaları yüklemenin iki yolu
|
|
41
41
|
|
|
42
|
-
### Seçenek 1: Kural tabanlı (önerilen
|
|
42
|
+
### Seçenek 1: Kural tabanlı (önerilen)
|
|
43
43
|
|
|
44
44
|
`.failproofai/policies/` dizinine `*policies.{js,mjs,ts}` dosyalarını bırakın ve otomatik olarak yüklenirler — hiçbir bayrak veya yapılandırma değişikliğine gerek yoktur. Bu git hook'ları gibi çalışır: bir dosya bırakın ve çalışır.
|
|
45
45
|
|
|
@@ -125,11 +125,8 @@ customPolicies.add({
|
|
|
125
125
|
`policyParams` içinde `hint` alanı ekleyerek herhangi bir `deny` veya `instruct` iletisine ekstra rehberlik ekleyebilirsiniz — kod değişikliğine gerek yoktur. Bu özel (`custom/`), proje kural (`.failproofai-project/`) ve kullanıcı kural (`.failproofai-user/`) politikaları için de çalışır. Ayrıntılar için [Yapılandırma → hint](/tr/configuration#hint-cross-cutting) bölümüne bakın.
|
|
126
126
|
</Tip>
|
|
127
127
|
|
|
128
|
-
### Bilgilendirici izin iletileri
|
|
128
|
+
### Bilgilendirici izin iletileri
|
|
129
129
|
|
|
130
|
-
<Note>
|
|
131
|
-
`allow(message)` v0.0.2-beta.3'ten beri mevcut olan bir beta özelliğidir. API gelecek sürümlerde değişebilir. Önceki sürümler yalnızca `allow()` öğesini argümanlar olmadan destekler.
|
|
132
|
-
</Note>
|
|
133
130
|
|
|
134
131
|
`allow(message)` işleme izin verir **ve** Claude'a bilgilendirici bir ileti gönderir. İleti, hook işleyicisinin stdout yanıtında `additionalContext` olarak iletilir — `instruct` tarafından kullanılan mekanizmayla aynı, ancak anlamsal olarak farklı: bir uyarı değil, bir durum güncellemesidir.
|
|
135
132
|
|
|
@@ -103,9 +103,9 @@ Handler thực thi giới hạn 1 MB cho stdin. Các payload vượt quá giới
|
|
|
103
103
|
- Mã thoát: `0`
|
|
104
104
|
- Stdout trống
|
|
105
105
|
|
|
106
|
-
**Allow with message
|
|
106
|
+
**Allow with message:**
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
`allow(message)` cho phép một chính sách gửi context thông tin trở lại Claude ngay cả khi thao tác được cho phép. Hook handler ghi JSON sau đây vào **stdout** (không phải một tệp cấu hình — đây là phản hồi của handler process đối với Claude Code, giống như các phản hồi deny và instruct ở trên):
|
|
109
109
|
|
|
110
110
|
```json
|
|
111
111
|
// Được ghi vào stdout bởi hook handler process
|
|
@@ -153,7 +153,7 @@ Loại: `string` (đường dẫn tuyệt đối)
|
|
|
153
153
|
|
|
154
154
|
Tệp được tải mới trên mỗi sự kiện hook - không có lưu cache. Xem [Chính sách tùy chỉnh](/vi/custom-policies) để biết chi tiết tác giả.
|
|
155
155
|
|
|
156
|
-
### Chính sách dựa trên quy ước
|
|
156
|
+
### Chính sách dựa trên quy ước
|
|
157
157
|
|
|
158
158
|
Ngoài `customPoliciesPath` rõ ràng, failproofai tự động phát hiện và tải các tệp chính sách từ thư mục `.failproofai/policies/`:
|
|
159
159
|
|
|
@@ -39,7 +39,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
39
39
|
|
|
40
40
|
## Hai cách để tải chính sách tùy chỉnh
|
|
41
41
|
|
|
42
|
-
### Lựa chọn 1: Dựa trên quy ước (được khuyến
|
|
42
|
+
### Lựa chọn 1: Dựa trên quy ước (được khuyến nghị)
|
|
43
43
|
|
|
44
44
|
Thả các tệp `*policies.{js,mjs,ts}` vào `.failproofai/policies/` và chúng sẽ được tải tự động — không cần cờ hoặc thay đổi cấu hình. Cách này hoạt động giống như git hooks: thả một tệp, nó sẽ hoạt động.
|
|
45
45
|
|
|
@@ -125,11 +125,8 @@ customPolicies.add({
|
|
|
125
125
|
Bạn có thể nối thêm hướng dẫn bổ sung vào bất kỳ thông báo `deny` hoặc `instruct` nào bằng cách thêm trường `hint` trong `policyParams` — không cần thay đổi mã. Điều này hoạt động cho các chính sách tùy chỉnh (`custom/`), quy ước dự án (`.failproofai-project/`), và quy ước người dùng (`.failproofai-user/`) cũng vậy. Xem [Cấu hình → hint](/vi/configuration#hint-cross-cutting) để biết chi tiết.
|
|
126
126
|
</Tip>
|
|
127
127
|
|
|
128
|
-
### Thông báo allow thông tin
|
|
128
|
+
### Thông báo allow thông tin
|
|
129
129
|
|
|
130
|
-
<Note>
|
|
131
|
-
`allow(message)` là tính năng beta có sẵn từ v0.0.2-beta.3. API có thể thay đổi trong các phiên bản tương lai. Các phiên bản trước chỉ hỗ trợ `allow()` mà không có đối số.
|
|
132
|
-
</Note>
|
|
133
130
|
|
|
134
131
|
`allow(message)` cho phép hoạt động **và** gửi một thông báo thông tin quay lại cho Claude. Thông báo được gửi dưới dạng `additionalContext` trong phản hồi stdout của trình xử lý hook — cơ chế tương tự được sử dụng bởi `instruct`, nhưng về mặt ngữ nghĩa khác: đó là một cập nhật trạng thái, không phải cảnh báo.
|
|
135
132
|
|
|
@@ -102,9 +102,9 @@ failproofai 包含两个独立的子系统:
|
|
|
102
102
|
- 退出码:`0`
|
|
103
103
|
- stdout 为空
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
**允许并携带消息:**
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
`allow(message)` 允许策略在操作被允许时仍向 Claude 发送信息性上下文。钩子处理器将以下 JSON 写入 **stdout**(这不是配置文件——这是处理器对 Claude Code 的响应,与 deny 和 instruct 响应的方式相同):
|
|
108
108
|
|
|
109
109
|
```json
|
|
110
110
|
// Written to stdout by the hook handler process
|
|
@@ -153,7 +153,7 @@ resolved: { allowPatterns: ["sudo systemctl status"] } ← 向下回落到 glob
|
|
|
153
153
|
|
|
154
154
|
每次 hook 事件触发时都会重新加载该文件,不存在缓存机制。关于编写自定义策略的详情,请参阅[自定义策略](/zh/custom-policies)。
|
|
155
155
|
|
|
156
|
-
###
|
|
156
|
+
### 基于约定的策略
|
|
157
157
|
|
|
158
158
|
除显式指定的 `customPoliciesPath` 外,failproofai 还会自动发现并加载 `.failproofai/policies/` 目录中的策略文件:
|
|
159
159
|
|
|
@@ -39,7 +39,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
39
39
|
|
|
40
40
|
## 两种加载自定义策略的方式
|
|
41
41
|
|
|
42
|
-
###
|
|
42
|
+
### 方式一:基于约定(推荐)
|
|
43
43
|
|
|
44
44
|
将 `*policies.{js,mjs,ts}` 文件放入 `.failproofai/policies/` 目录,它们会被自动加载——无需任何标志或配置更改。这类似于 git hooks:放入文件即可生效。
|
|
45
45
|
|
|
@@ -125,11 +125,8 @@ customPolicies.add({
|
|
|
125
125
|
您可以通过在 `policyParams` 中添加 `hint` 字段,为任何 `deny` 或 `instruct` 消息追加额外指导——无需修改代码。这对自定义(`custom/`)、项目约定(`.failproofai-project/`)和用户约定(`.failproofai-user/`)策略同样适用。详情请参阅[配置 → hint](/zh/configuration#hint-cross-cutting)。
|
|
126
126
|
</Tip>
|
|
127
127
|
|
|
128
|
-
### 信息性 allow
|
|
128
|
+
### 信息性 allow 消息
|
|
129
129
|
|
|
130
|
-
<Note>
|
|
131
|
-
`allow(message)` 是自 v0.0.2-beta.3 起提供的 Beta 功能。API 可能在未来版本中发生变化。早期版本仅支持不带参数的 `allow()`。
|
|
132
|
-
</Note>
|
|
133
130
|
|
|
134
131
|
`allow(message)` 允许操作**并**向 Claude 发送一条信息性消息。该消息以 `additionalContext` 的形式通过 hook 处理器的 stdout 响应发送——与 `instruct` 使用相同的机制,但语义不同:它是状态更新,而非警告。
|
|
135
132
|
|