failproofai 0.0.4 → 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]__0v1egkj._.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]__0lty_fo._.js → [root-of-the-server]__0qn95h3._.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/{0de3q2juhg_dr.js → 09ikntpt2-o9b.js} +1 -1
- package/.next/standalone/.next/static/chunks/{11zlh73ggln0w.js → 0_yayar~bpphd.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0b2_069x5qnxg.js → 0em7tspi4kylh.js} +2 -2
- package/.next/standalone/.next/static/chunks/{0y-bi_mp2rv4l.js → 0lgbwkfqmnsmc.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0uxpbrcv44lga.js → 0sme4lkv.tgn-.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0tw_xfxb1tto..js → 0yumumfzx_f27.js} +1 -1
- package/.next/standalone/.next/static/chunks/{0p5sfob-upg0g.js → 13juklu.vksks.js} +1 -1
- package/.next/standalone/.next/static/chunks/17manv47o-~wp.js +1 -0
- package/.next/standalone/CHANGELOG.md +9 -0
- package/.next/standalone/README.md +2 -2
- package/.next/standalone/dist/cli.mjs +52 -11
- 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/.next/standalone/src/hooks/builtin-policies.ts +40 -8
- package/.next/standalone/src/hooks/policy-evaluator.ts +15 -1
- package/README.md +2 -2
- package/dist/cli.mjs +52 -11
- package/package.json +1 -1
- package/src/hooks/builtin-policies.ts +40 -8
- package/src/hooks/policy-evaluator.ts +15 -1
- package/.next/standalone/.next/static/chunks/0xjz3w.yw5tza.js +0 -1
- /package/.next/standalone/.next/static/{LayjxQulxIcNH19Lqgjbf → hYQM6iCWnF1W5XDpsIRhV}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{LayjxQulxIcNH19Lqgjbf → hYQM6iCWnF1W5XDpsIRhV}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{LayjxQulxIcNH19Lqgjbf → hYQM6iCWnF1W5XDpsIRhV}/_ssgManifest.js +0 -0
|
@@ -39,7 +39,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
39
39
|
|
|
40
40
|
## Dos formas de cargar políticas personalizadas
|
|
41
41
|
|
|
42
|
-
### Opción 1: Basada en convención (recomendada
|
|
42
|
+
### Opción 1: Basada en convención (recomendada)
|
|
43
43
|
|
|
44
44
|
Coloca archivos `*policies.{js,mjs,ts}` en `.failproofai/policies/` y se cargarán automáticamente, sin necesidad de flags ni cambios de configuración. Funciona como los git hooks: coloca el archivo y listo.
|
|
45
45
|
|
|
@@ -125,11 +125,8 @@ customPolicies.add({
|
|
|
125
125
|
Puedes añadir orientación adicional a cualquier mensaje `deny` o `instruct` incluyendo un campo `hint` en `policyParams`, sin necesidad de cambiar el código. Esto funciona también para políticas personalizadas (`custom/`), de convención de proyecto (`.failproofai-project/`) y de convención de usuario (`.failproofai-user/`). Consulta [Configuración → hint](/es/configuration#hint-cross-cutting) para más detalles.
|
|
126
126
|
</Tip>
|
|
127
127
|
|
|
128
|
-
### Mensajes informativos en allow
|
|
128
|
+
### Mensajes informativos en allow
|
|
129
129
|
|
|
130
|
-
<Note>
|
|
131
|
-
`allow(message)` es una funcionalidad en beta disponible desde v0.0.2-beta.3. La API podría cambiar en versiones futuras. Las versiones anteriores solo admiten `allow()` sin argumentos.
|
|
132
|
-
</Note>
|
|
133
130
|
|
|
134
131
|
`allow(message)` permite la operación **y** envía un mensaje informativo a Claude. El mensaje se entrega como `additionalContext` en la respuesta stdout del manejador de hooks — el mismo mecanismo que usa `instruct`, pero con una semántica diferente: es una actualización de estado, no una advertencia.
|
|
135
132
|
|
|
@@ -102,9 +102,9 @@ Le gestionnaire impose une limite de 1 Mo sur stdin. Les payloads dépassant cet
|
|
|
102
102
|
- Code de sortie : `0`
|
|
103
103
|
- stdout vide
|
|
104
104
|
|
|
105
|
-
**Autorisation avec message
|
|
105
|
+
**Autorisation avec message :**
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
`allow(message)` permet à une politique d'envoyer un contexte informatif à Claude même lorsque l'opération est autorisée. Le gestionnaire de hooks écrit le JSON suivant sur **stdout** (pas dans un fichier de configuration — il s'agit de la réponse du gestionnaire à Claude Code, tout comme les réponses de refus et d'instruction ci-dessus) :
|
|
108
108
|
|
|
109
109
|
```json
|
|
110
110
|
// Written to stdout by the hook handler process
|
|
@@ -153,7 +153,7 @@ Chemin vers un fichier JavaScript contenant des politiques de hook personnalisé
|
|
|
153
153
|
|
|
154
154
|
Le fichier est chargé à chaque événement de hook — il n'y a pas de mise en cache. Consultez [Politiques personnalisées](/fr/custom-policies) pour les détails de création.
|
|
155
155
|
|
|
156
|
-
### Politiques basées sur les conventions
|
|
156
|
+
### Politiques basées sur les conventions
|
|
157
157
|
|
|
158
158
|
En plus du `customPoliciesPath` explicite, failproofai découvre et charge automatiquement les fichiers de politiques depuis les répertoires `.failproofai/policies/` :
|
|
159
159
|
|
|
@@ -39,7 +39,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
39
39
|
|
|
40
40
|
## Deux façons de charger des politiques personnalisées
|
|
41
41
|
|
|
42
|
-
### Option 1 : Par convention (
|
|
42
|
+
### Option 1 : Par convention (recommandé)
|
|
43
43
|
|
|
44
44
|
Déposez des fichiers `*policies.{js,mjs,ts}` dans `.failproofai/policies/` et ils sont chargés automatiquement — aucun indicateur ni changement de configuration requis. Cela fonctionne comme les git hooks : déposez un fichier, il est pris en compte immédiatement.
|
|
45
45
|
|
|
@@ -125,11 +125,8 @@ customPolicies.add({
|
|
|
125
125
|
Vous pouvez ajouter des instructions supplémentaires à n'importe quel message `deny` ou `instruct` en ajoutant un champ `hint` dans `policyParams` — sans modifier le code. Cela fonctionne également pour les politiques personnalisées (`custom/`), par convention projet (`.failproofai-project/`) et par convention utilisateur (`.failproofai-user/`). Voir [Configuration → hint](/fr/configuration#hint-cross-cutting) pour les détails.
|
|
126
126
|
</Tip>
|
|
127
127
|
|
|
128
|
-
### Messages allow informationnels
|
|
128
|
+
### Messages allow informationnels
|
|
129
129
|
|
|
130
|
-
<Note>
|
|
131
|
-
`allow(message)` est une fonctionnalité bêta disponible depuis la v0.0.2-beta.3. L'API peut changer dans les versions futures. Les versions antérieures ne prennent en charge que `allow()` sans arguments.
|
|
132
|
-
</Note>
|
|
133
130
|
|
|
134
131
|
`allow(message)` autorise l'opération **et** envoie un message informationnel à Claude. Le message est délivré en tant que `additionalContext` dans la réponse stdout du gestionnaire de hook — le même mécanisme qu'`instruct`, mais sémantiquement différent : c'est une mise à jour de statut, pas un avertissement.
|
|
135
132
|
|
|
@@ -103,9 +103,9 @@ Claude Code לאחר מכן מפעיל את `failproofai --hook PreToolUse` כת
|
|
|
103
103
|
- קוד יציאה: `0`
|
|
104
104
|
- stdout ריק
|
|
105
105
|
|
|
106
|
-
**Allow עם
|
|
106
|
+
**Allow עם הודעה:**
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
`allow(message)` מאפשר למדיניות לשלוח הקשר מידע חזור ל-Claude גם כאשר הפעולה מורשית. מטפל ה-hook כותב את ה-JSON הבא ל-**stdout** (לא קובץ הגדרות — זו תגובת המטפל ל-Claude Code, בדיוק כמו תגובות deny ו-instruct לעיל):
|
|
109
109
|
|
|
110
110
|
```json
|
|
111
111
|
// כתוב ל-stdout על ידי תהליך מטפל ה-hook
|
|
@@ -153,7 +153,7 @@ resolved: { allowPatterns: ["sudo systemctl status"] } ← נופל דרך לג
|
|
|
153
153
|
|
|
154
154
|
הקובץ נטען מחדש בכל אירוע hook - אין קשמן. ראה [Custom Policies](/he/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
|
שים קבצים `*policies.{js,mjs,ts}` בתיקייה `.failproofai/policies/` והם יוטענו באופן אוטומטי — ללא דגלים או שינויי קונפיגורציה. זה עובד כמו git hooks: שים קובץ, זה פשוט עובד.
|
|
45
45
|
|
|
@@ -125,11 +125,8 @@ customPolicies.add({
|
|
|
125
125
|
אתה יכול להצמיד הנחיות נוספות לכל הודעת `deny` או `instruct` על ידי הוספת שדה `hint` ב-`policyParams` — ללא צורך בשינוי קוד. זה עובד גם על מדיניויות custom (`custom/`), קונבנציה של פרויקט (`.failproofai-project/`), וקונבנציה של משתמש (`.failproofai-user/`). ראה [Configuration → hint](/he/configuration#hint-cross-cutting) לפרטים.
|
|
126
126
|
</Tip>
|
|
127
127
|
|
|
128
|
-
### הודעות allow מידע
|
|
128
|
+
### הודעות allow מידע
|
|
129
129
|
|
|
130
|
-
<Note>
|
|
131
|
-
`allow(message)` היא תכונת beta זמינה מ-v0.0.2-beta.3. ה-API עשוי להשתנות בגרסאות עתידיות. גרסאות קודמות תומכות רק ב-`allow()` ללא טיעונים.
|
|
132
|
-
</Note>
|
|
133
130
|
|
|
134
131
|
`allow(message)` מתיר את הפעולה **ו**שולח הודעה מידע בחזרה ל-Claude. ההודעה מועברת כ-`additionalContext` בתגובת stdout של hook handler — אותה מנגנון שבו משתמשים `instruct`, אך שונה מבחינה סמנטית: זה עדכון סטטוס, לא אזהרה.
|
|
135
132
|
|
|
@@ -104,9 +104,9 @@ Claude Code फिर प्रत्येक टूल कॉल से पह
|
|
|
104
104
|
- Exit कोड: `0`
|
|
105
105
|
- खाली stdout
|
|
106
106
|
|
|
107
|
-
**संदेश के साथ अनुमति
|
|
107
|
+
**संदेश के साथ अनुमति दें:**
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
`allow(message)` एक पॉलिसी को Claude को सूचनात्मक संदर्भ भेजने देता है भले ही ऑपरेशन की अनुमति हो। हुक हैंडलर निम्नलिखित JSON को **stdout** में लिखता है (कॉन्फ़िग फ़ाइल में नहीं — यह Claude Code को हैंडलर की प्रतिक्रिया है, अस्वीकार करें और निर्देशित करें प्रतिक्रिया की तरह):
|
|
110
110
|
|
|
111
111
|
```json
|
|
112
112
|
// हुक हैंडलर प्रक्रिया द्वारा stdout में लिखा गया
|
|
@@ -153,7 +153,7 @@ resolved: { allowPatterns: ["sudo systemctl status"] } ← falls through to glo
|
|
|
153
153
|
|
|
154
154
|
फ़ाइल प्रत्येक हुक इवेंट पर ताजी लोड की जाती है - कोई कैशिंग नहीं है। लेखन विवरण के लिए [Custom Policies](/hi/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 hooks की तरह काम करता है: एक फ़ाइल ड्रॉप करें, यह बस काम करता है।
|
|
45
45
|
|
|
@@ -125,11 +125,8 @@ customPolicies.add({
|
|
|
125
125
|
`policyParams` में `hint` फ़ील्ड जोड़कर किसी भी `deny` या `instruct` संदेश के लिए अतिरिक्त निर्देश जोड़ सकते हैं — कोई कोड परिवर्तन की आवश्यकता नहीं है। यह कस्टम (`custom/`), प्रोजेक्ट कन्वेंशन (`.failproofai-project/`), और यूजर कन्वेंशन (`.failproofai-user/`) पॉलिसीज़ के लिए भी काम करता है। विवरण के लिए [कॉन्फ़िगरेशन → hint](/hi/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
|
|
|
@@ -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
|
تدعم الخطافات المخصصة الاستيراد المحلي العابر، والانتظار غير المتزامن، والوصول إلى `process.env`. الأخطاء مفتوحة للفشل (تسجيل في `~/.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
|
| Funktion | Wirkung |
|
|
209
209
|
|----------|---------|
|
|
210
210
|
| `allow()` | Erlaubt die Operation |
|
|
211
|
-
| `allow(message)` | Erlaubt und sendet informativen Kontext an Claude
|
|
211
|
+
| `allow(message)` | Erlaubt und sendet informativen Kontext an Claude |
|
|
212
212
|
| `deny(message)` | Blockiert die Operation; Nachricht wird Claude angezeigt |
|
|
213
213
|
| `instruct(message)` | Fügt Claude's Prompt Kontext hinzu; blockiert nicht |
|
|
214
214
|
|
|
@@ -226,7 +226,7 @@ failproofai policies --install --custom ./my-policies.js
|
|
|
226
226
|
|
|
227
227
|
Benutzerdefinierte Hooks unterstützen transitive lokale Importe, async/await und Zugriff auf `process.env`. Fehler sind fail-open (werden in `~/.failproofai/hook.log` protokolliert, integrierte Richtlinien laufen weiter). Eine vollständige Anleitung finden Sie unter [docs/custom-hooks.mdx](docs/custom-hooks.mdx).
|
|
228
228
|
|
|
229
|
-
### Konventionsbasierte Richtlinien
|
|
229
|
+
### Konventionsbasierte Richtlinien
|
|
230
230
|
|
|
231
231
|
Legen Sie `*policies.{js,mjs,ts}`-Dateien in `.failproofai/policies/` ab – sie werden automatisch geladen, ohne `--custom`-Flag oder Konfigurationsänderungen. Funktioniert wie Git-Hooks: Datei ablegen, fertig.
|
|
232
232
|
|
|
@@ -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
|
|