failproofai 0.0.5-beta.0 → 0.0.6-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/.next/standalone/.failproofai/policies/workflow-policies.mjs +2 -1
  2. package/.next/standalone/.next/BUILD_ID +1 -1
  3. package/.next/standalone/.next/build-manifest.json +3 -3
  4. package/.next/standalone/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/.next/required-server-files.json +1 -1
  6. package/.next/standalone/.next/server/app/_global-error/page/server-reference-manifest.json +1 -1
  7. package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
  8. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.rsc +7 -7
  11. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +2 -2
  12. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +7 -7
  13. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +3 -3
  14. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +3 -3
  15. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/.next/standalone/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
  17. package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
  18. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/.next/standalone/.next/server/app/_not-found.html +2 -2
  20. package/.next/standalone/.next/server/app/_not-found.rsc +15 -15
  21. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +15 -15
  22. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  23. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +10 -10
  24. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +2 -2
  25. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  26. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  27. package/.next/standalone/.next/server/app/index.html +1 -1
  28. package/.next/standalone/.next/server/app/index.rsc +15 -15
  29. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  30. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +15 -15
  31. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +4 -4
  32. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +10 -10
  33. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  34. package/.next/standalone/.next/server/app/page/server-reference-manifest.json +1 -1
  35. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  37. package/.next/standalone/.next/server/app/policies/page/server-reference-manifest.json +8 -8
  38. package/.next/standalone/.next/server/app/policies/page.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/policies/page_client-reference-manifest.js +1 -1
  40. package/.next/standalone/.next/server/app/project/[name]/page/server-reference-manifest.json +1 -1
  41. package/.next/standalone/.next/server/app/project/[name]/page.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/project/[name]/page_client-reference-manifest.js +1 -1
  43. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/react-loadable-manifest.json +2 -2
  44. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page/server-reference-manifest.json +2 -2
  45. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page.js.nft.json +1 -1
  46. package/.next/standalone/.next/server/app/project/[name]/session/[sessionId]/page_client-reference-manifest.js +1 -1
  47. package/.next/standalone/.next/server/app/projects/page/server-reference-manifest.json +1 -1
  48. package/.next/standalone/.next/server/app/projects/page.js.nft.json +1 -1
  49. package/.next/standalone/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  50. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0g72weg._.js +1 -1
  51. package/.next/standalone/.next/server/chunks/package_json_[json]_cjs_0z7w.hh._.js +1 -1
  52. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0r6vvp5._.js → [root-of-the-server]__0.~fd7s._.js} +2 -2
  53. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__092s1ta._.js +2 -2
  54. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09icjsf._.js +2 -2
  55. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0z5dd-f._.js → [root-of-the-server]__0a.nuas._.js} +2 -2
  56. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0g.lg8b._.js +2 -2
  57. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0h..k-e._.js +2 -2
  58. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0okos0k._.js +2 -2
  59. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0w6l33k._.js +2 -2
  60. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__11pa2ra._.js +2 -2
  61. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12t-wym._.js +2 -2
  62. package/.next/standalone/.next/server/chunks/ssr/_10lm7or._.js +2 -2
  63. package/.next/standalone/.next/server/chunks/ssr/app_global-error_tsx_0xerkr6._.js +1 -1
  64. package/.next/standalone/.next/server/chunks/ssr/app_policies_hooks-client_tsx_0q-m0y-._.js +1 -1
  65. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  66. package/.next/standalone/.next/server/pages/404.html +2 -2
  67. package/.next/standalone/.next/server/pages/500.html +1 -1
  68. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  69. package/.next/standalone/.next/server/server-reference-manifest.json +9 -9
  70. package/.next/standalone/.next/static/chunks/{0j_ivegn3i5wt.js → 0.z51twd.0l5z.js} +1 -1
  71. package/.next/standalone/.next/static/chunks/{04fpsjft~cje..js → 0hctoh28rg838.js} +1 -1
  72. package/.next/standalone/.next/static/chunks/{0.io32u7gjgsb.js → 0hplx-8c-4vpv.js} +1 -1
  73. package/.next/standalone/.next/static/chunks/{0yf_mmdukq6up.js → 0maq.q1t.ri85.js} +2 -2
  74. package/.next/standalone/.next/static/chunks/{0x8vagatq36_7.js → 0teq8wdh3po1n.js} +1 -1
  75. package/.next/standalone/.next/static/chunks/{04mtv9jnqknn3.js → 0uc0um_uz51m_.js} +1 -1
  76. package/.next/standalone/.next/static/chunks/{0h4qcn40dunn7.js → 0ul6fk-z.6k-0.js} +1 -1
  77. package/.next/standalone/.next/static/chunks/{0kvldut6ndzyz.js → 0w9lwqy0-v1dk.js} +1 -1
  78. package/.next/standalone/CHANGELOG.md +9 -1
  79. package/.next/standalone/README.md +2 -2
  80. package/.next/standalone/dist/cli.mjs +19 -2
  81. package/.next/standalone/docs/ar/architecture.mdx +66 -65
  82. package/.next/standalone/docs/ar/configuration.mdx +42 -42
  83. package/.next/standalone/docs/ar/custom-policies.mdx +63 -68
  84. package/.next/standalone/docs/architecture.mdx +2 -2
  85. package/.next/standalone/docs/configuration.mdx +1 -1
  86. package/.next/standalone/docs/custom-policies.mdx +2 -6
  87. package/.next/standalone/docs/de/architecture.mdx +92 -92
  88. package/.next/standalone/docs/de/configuration.mdx +35 -35
  89. package/.next/standalone/docs/de/custom-policies.mdx +50 -54
  90. package/.next/standalone/docs/es/architecture.mdx +73 -73
  91. package/.next/standalone/docs/es/configuration.mdx +25 -25
  92. package/.next/standalone/docs/es/custom-policies.mdx +49 -53
  93. package/.next/standalone/docs/fr/architecture.mdx +55 -55
  94. package/.next/standalone/docs/fr/configuration.mdx +26 -26
  95. package/.next/standalone/docs/fr/custom-policies.mdx +42 -46
  96. package/.next/standalone/docs/he/architecture.mdx +67 -67
  97. package/.next/standalone/docs/he/configuration.mdx +53 -52
  98. package/.next/standalone/docs/he/custom-policies.mdx +73 -77
  99. package/.next/standalone/docs/hi/architecture.mdx +107 -107
  100. package/.next/standalone/docs/hi/configuration.mdx +39 -39
  101. package/.next/standalone/docs/hi/custom-policies.mdx +77 -81
  102. package/.next/standalone/docs/i18n/README.ar.md +66 -66
  103. package/.next/standalone/docs/i18n/README.de.md +40 -40
  104. package/.next/standalone/docs/i18n/README.es.md +40 -40
  105. package/.next/standalone/docs/i18n/README.fr.md +44 -44
  106. package/.next/standalone/docs/i18n/README.he.md +67 -67
  107. package/.next/standalone/docs/i18n/README.hi.md +71 -71
  108. package/.next/standalone/docs/i18n/README.it.md +63 -63
  109. package/.next/standalone/docs/i18n/README.ja.md +55 -55
  110. package/.next/standalone/docs/i18n/README.ko.md +59 -59
  111. package/.next/standalone/docs/i18n/README.pt-br.md +45 -45
  112. package/.next/standalone/docs/i18n/README.ru.md +71 -71
  113. package/.next/standalone/docs/i18n/README.tr.md +76 -76
  114. package/.next/standalone/docs/i18n/README.vi.md +71 -71
  115. package/.next/standalone/docs/i18n/README.zh.md +53 -53
  116. package/.next/standalone/docs/it/architecture.mdx +55 -54
  117. package/.next/standalone/docs/it/configuration.mdx +45 -46
  118. package/.next/standalone/docs/it/custom-policies.mdx +77 -82
  119. package/.next/standalone/docs/ja/architecture.mdx +93 -93
  120. package/.next/standalone/docs/ja/configuration.mdx +48 -48
  121. package/.next/standalone/docs/ja/custom-policies.mdx +63 -67
  122. package/.next/standalone/docs/ko/architecture.mdx +66 -66
  123. package/.next/standalone/docs/ko/configuration.mdx +36 -36
  124. package/.next/standalone/docs/ko/custom-policies.mdx +73 -77
  125. package/.next/standalone/docs/pt-br/architecture.mdx +55 -55
  126. package/.next/standalone/docs/pt-br/configuration.mdx +36 -36
  127. package/.next/standalone/docs/pt-br/custom-policies.mdx +62 -66
  128. package/.next/standalone/docs/ru/architecture.mdx +59 -60
  129. package/.next/standalone/docs/ru/configuration.mdx +52 -53
  130. package/.next/standalone/docs/ru/custom-policies.mdx +70 -74
  131. package/.next/standalone/docs/tr/architecture.mdx +124 -124
  132. package/.next/standalone/docs/tr/configuration.mdx +46 -47
  133. package/.next/standalone/docs/tr/custom-policies.mdx +75 -78
  134. package/.next/standalone/docs/vi/architecture.mdx +65 -64
  135. package/.next/standalone/docs/vi/configuration.mdx +42 -42
  136. package/.next/standalone/docs/vi/custom-policies.mdx +68 -72
  137. package/.next/standalone/docs/zh/architecture.mdx +67 -67
  138. package/.next/standalone/docs/zh/configuration.mdx +35 -35
  139. package/.next/standalone/docs/zh/custom-policies.mdx +54 -58
  140. package/.next/standalone/package.json +1 -1
  141. package/.next/standalone/server.js +1 -1
  142. package/.next/standalone/src/hooks/builtin-policies.ts +30 -0
  143. package/README.md +2 -2
  144. package/dist/cli.mjs +19 -2
  145. package/package.json +1 -1
  146. package/src/hooks/builtin-policies.ts +30 -0
  147. /package/.next/standalone/.next/static/{ICeMHZ-8ZR7HY5GLm7oSJ → 8mygPGI5bzrtWK36ZYO59}/_buildManifest.js +0 -0
  148. /package/.next/standalone/.next/static/{ICeMHZ-8ZR7HY5GLm7oSJ → 8mygPGI5bzrtWK36ZYO59}/_clientMiddlewareManifest.js +0 -0
  149. /package/.next/standalone/.next/static/{ICeMHZ-8ZR7HY5GLm7oSJ → 8mygPGI5bzrtWK36ZYO59}/_ssgManifest.js +0 -0
@@ -1,12 +1,11 @@
1
1
  ---
2
-
3
2
  ---
4
3
  title: السياسات المخصصة
5
- description: "اكتب سياساتك الخاصة في JavaScript - فرض الاتفاقيات، منع الانجراف، الكشف عن الأعطال، التكامل مع الأنظمة الخارجية"
4
+ description: "اكتب سياساتك الخاصة بلغة JavaScript - فرض الاتفاقيات، منع الانجراف، اكتشاف الأعطال، التكامل مع الأنظمة الخارجية"
6
5
  icon: code
7
6
  ---
8
7
 
9
- تتيح لك السياسات المخصصة كتابة قواعد لأي سلوك وكيل: فرض اتفاقيات المشروع، منع الانجراف، التحكم في العمليات الضارة، الكشف عن الوكلاء المعلقة، أو التكامل مع Slack وسير العمل الموافقات والمزيد. تستخدم نفس نظام حدث الخطاف وقرارات `allow` و `deny` و `instruct` كما هو الحال في السياسات المدمجة.
8
+ تتيح لك السياسات المخصصة كتابة قواعد لأي سلوك وكيل: فرض اتفاقيات المشروع، منع الانجراف، حماية العمليات المدمرة، كشف الوكلاء العالقين، أو التكامل مع Slack وسير العمل الموافقة والمزيد. تستخدم نفس نظام أحداث الخطاف وقرارات `allow` و `deny` و `instruct` مثل السياسات المدمجة.
10
9
 
11
10
  ---
12
11
 
@@ -31,7 +30,7 @@ customPolicies.add({
31
30
  });
32
31
  ```
33
32
 
34
- تثبيتها:
33
+ قم بتثبيته:
35
34
 
36
35
  ```bash
37
36
  failproofai policies --install --custom ./my-policies.js
@@ -41,56 +40,56 @@ failproofai policies --install --custom ./my-policies.js
41
40
 
42
41
  ## طريقتان لتحميل السياسات المخصصة
43
42
 
44
- ### الخيار 1: المبنية على الاتفاقية (موصى به، v0.0.2-beta.7+)
43
+ ### الخيار 1: قائم على الاتفاقية (موصى به)
45
44
 
46
- أسقط ملفات `*policies.{js,mjs,ts}` في `.failproofai/policies/` وسيتم تحميلها تلقائياً - لا تحتاج إلى أعلام أو تغييرات في الإعدادات. يعمل هذا مثل خطافات git: أسقط ملفاً، وهو يعمل فقط.
45
+ ضع ملفات `*policies.{js,mjs,ts}` في `.failproofai/policies/` وسيتم تحميلها تلقائياً لا توجد علامات أو تغييرات في الإعدادات المطلوبة. يعمل هذا مثل خطافات git: ضع ملفاً، وسيعمل فقط.
47
46
 
48
47
  ```
49
- # Project levelcommitted to git, shared with the team
48
+ # مستوى المشروعيتم الالتزام به في git، مشترك مع الفريق
50
49
  .failproofai/policies/security-policies.mjs
51
50
  .failproofai/policies/workflow-policies.mjs
52
51
 
53
- # User levelpersonal, applies to all projects
52
+ # مستوى المستخدمشخصي، ينطبق على جميع المشاريع
54
53
  ~/.failproofai/policies/my-policies.mjs
55
54
  ```
56
55
 
57
- **كيفية عمله:**
58
- - يتم فحص كلا المجلدات (المشروع والمستخدم) (الاتحاد - وليس first-scope-wins)
59
- - يتم تحميل الملفات أبجدياً في كل مجلد. اجعل البادئة `01-` أو `02-` للتحكم في الترتيب
60
- - يتم تحميل الملفات المطابقة `*policies.{js,mjs,ts}` فقط؛ يتم تجاهل الملفات الأخرى
61
- - يتم تحميل كل ملف بشكل مستقل (fail-open لكل ملف)
56
+ **كيف يعمل:**
57
+ - يتم فحص كل من مجلدات المشروع والمستخدم (الاتحاد وليس السيطرة الأولى)
58
+ - يتم تحميل الملفات أبجدياً داخل كل مجلد. البادئة مع `01-`، `02-` للتحكم في الترتيب
59
+ - يتم تحميل الملفات المطابقة فقط `*policies.{js,mjs,ts} يتم تجاهل الملفات الأخرى
60
+ - يتم تحميل كل ملف بشكل مستقل (فتح بفشل لكل ملف)
62
61
  - يعمل جنباً إلى جنب مع السياسات الصريحة `--custom` والمدمجة
63
62
 
64
63
  <Tip>
65
- سياسات الاتفاقية هي أسهل طريقة لمشاركة السياسات عبر الفريق. التزم `.failproofai/policies/` بـ git ويحصل كل عضو في الفريق عليها تلقائياً.
64
+ سياسات الاتفاقية هي أسهل طريقة لمشاركة السياسات عبر الفريق. التزم بـ `.failproofai/policies/` إلى git وسيحصل كل عضو فريق عليها تلقائياً.
66
65
  </Tip>
67
66
 
68
67
  ### الخيار 2: مسار الملف الصريح
69
68
 
70
69
  ```bash
71
- # Install with a custom policies file
70
+ # التثبيت مع ملف سياسات مخصص
72
71
  failproofai policies --install --custom ./my-policies.js
73
72
 
74
- # Replace the policies file path
73
+ # استبدل مسار ملف السياسات
75
74
  failproofai policies --install --custom ./new-policies.js
76
75
 
77
- # Remove the custom policies path from config
76
+ # إزالة مسار السياسات المخصصة من الإعدادات
78
77
  failproofai policies --uninstall --custom
79
78
  ```
80
79
 
81
- يتم حفظ المسار المطلق المُحل في `policies-config.json` كـ `customPoliciesPath`. يتم تحميل الملف بشكل جديد في كل حدث خطاف - لا يوجد تخزين مؤقت بين الأحداث.
80
+ يتم تخزين المسار المطلق المحل في `policies-config.json` كـ `customPoliciesPath`. يتم تحميل الملف بشكل جديد في كل حدث خطاف - لا يوجد تخزين مؤقت بين الأحداث.
82
81
 
83
82
  ### استخدام كليهما معاً
84
83
 
85
- يمكن لسياسات الاتفاقية والملف الصريح `--custom` أن يتعايشا. ترتيب التحميل:
84
+ يمكن أن تتعايش سياسات الاتفاقية وملف `--custom` الصريح. ترتيب التحميل:
86
85
 
87
86
  1. ملف `customPoliciesPath` الصريح (إذا تم تكوينه)
88
- 2. ملفات اتفاقية المشروع (`{cwd}/.failproofai/policies/`، أبجدياً)
89
- 3. ملفات اتفاقية المستخدم (`~/.failproofai/policies/`، أبجدياً)
87
+ 2. ملفات الاتفاقية للمشروع (`{cwd}/.failproofai/policies/`، أبجدياً)
88
+ 3. ملفات الاتفاقية للمستخدم (`~/.failproofai/policies/`، أبجدياً)
90
89
 
91
90
  ---
92
91
 
93
- ## واجهة برمجية التطبيقات
92
+ ## API
94
93
 
95
94
  ### الاستيراد
96
95
 
@@ -100,7 +99,7 @@ import { customPolicies, allow, deny, instruct } from "failproofai";
100
99
 
101
100
  ### `customPolicies.add(hook)`
102
101
 
103
- تسجيل سياسة. اتصل بها عدة مرات حسب الحاجة لسياسات متعددة في نفس الملف.
102
+ تسجيل سياسة. استدعِ هذا عدة مرات حسب الحاجة لسياسات متعددة في نفس الملف.
104
103
 
105
104
  ```ts
106
105
  customPolicies.add({
@@ -116,33 +115,29 @@ customPolicies.add({
116
115
  | الدالة | التأثير | استخدم عندما |
117
116
  |----------|--------|----------|
118
117
  | `allow()` | السماح بالعملية بصمت | الإجراء آمن، لا توجد رسالة مطلوبة |
119
- | `deny(message)` | حظر العملية | يجب ألا يتخذ الوكيل هذا الإجراء |
120
- | `instruct(message)` | إضافة سياق دون حظر | إعطاء الوكيل سياق إضافي للبقاء على المسار |
118
+ | `deny(message)` | منع العملية | لا يجب أن يقوم الوكيل بهذا الإجراء |
119
+ | `instruct(message)` | إضافة سياق بدون حجب | أعط الوكيل سياق إضافي للبقاء على المسار |
121
120
 
122
- `deny(message)` - تظهر الرسالة إلى Claude بسابقة `"Blocked by failproofai:"`. يقطع `deny` واحد كل تقييم آخر.
121
+ `deny(message)` - تظهر الرسالة لـ Claude مع البادئة `"Blocked by failproofai:"`. يؤدي `deny` واحد إلى اختصار جميع التقييمات الإضافية.
123
122
 
124
- `instruct(message)` - يتم إلحاق الرسالة بسياق Claude لاستدعاء الأداة الحالي. يتم تجميع جميع رسائل `instruct` وتسليمها معاً.
123
+ `instruct(message)` - يتم إلحاق الرسالة بسياق Claude للاستدعاء الحالي للأداة. يتم تجميع جميع رسائل `instruct` وتسليمها معاً.
125
124
 
126
125
  <Tip>
127
- يمكنك إلحاق إرشادات إضافية بأي رسالة `deny` أو `instruct` بإضافة حقل `hint` في `policyParams` - لا حاجة لتغيير الرمز. يعمل هذا أيضاً للسياسات المخصصة (`custom/`)، واتفاقية المشروع (`.failproofai-project/`)، واتفاقية المستخدم (`.failproofai-user/`). انظر [التكوين → hint](/ar/configuration#hint-cross-cutting) للتفاصيل.
126
+ يمكنك إلحاق إرشادات إضافية بأي رسالة `deny` أو `instruct` بإضافة حقل `hint` في `policyParams` لا يلزم تغيير الكود. يعمل هذا أيضاً مع السياسات المخصصة (`custom/`) وسياسات اتفاقية المشروع (`.failproofai-project/`) وسياسات اتفاقية المستخدم (`.failproofai-user/`). راجع [التكوين → hint](/ar/configuration#hint-cross-cutting) للتفاصيل.
128
127
  </Tip>
129
128
 
130
- ### رسائل السماح المعلوماتية (بيتا)
131
-
132
- <Note>
133
- `allow(message)` هي ميزة بيتا متاحة منذ v0.0.2-beta.3. قد تتغير واجهة برمجية التطبيقات في الإصدارات المستقبلية. الإصدارات السابقة تدعم فقط `allow()` بدون وسائط.
134
- </Note>
129
+ ### رسائل السماح المعلوماتية
135
130
 
136
- `allow(message)` يسمح بالعملية **و** يرسل رسالة معلومات مرة أخرى إلى Claude. يتم تسليم الرسالة كـ `additionalContext` في استجابة stdout لمعالج الخطاف - نفس الآلية المستخدمة من قبل `instruct`، لكن مختلفة من الناحية الدلالية: إنها تحديث حالة وليست تحذير.
131
+ `allow(message)` يسمح بالعملية **و** يرسل رسالة معلوماتية مرة أخرى إلى Claude. يتم تسليم الرسالة كـ `additionalContext` في استجابة stdout معالج الخطاف نفس الآلية المستخدمة بواسطة `instruct`، لكن بمعنى مختلف: إنها تحديث الحالة، وليست تحذيراً.
137
132
 
138
133
  | الدالة | التأثير | استخدم عندما |
139
134
  |----------|--------|----------|
140
- | `allow(message)` | السماح وإرسال السياق إلى Claude | تأكيد نجاح الفحص، أو شرح سبب تخطي الفحص |
135
+ | `allow(message)` | السماح وإرسال السياق إلى Claude | تأكيد اجتياز الفحص، أو شرح سبب تخطي الفحص |
141
136
 
142
137
  حالات الاستخدام:
143
- - **تأكيدات الحالة:** `allow("All CI checks passed.")` - يخبر Claude أن كل شيء أخضر
144
- - **شروحات fail-open:** `allow("GitHub CLI not installed, skipping CI check.")` - يخبر Claude سبب تخطي الفحص حتى يكون لديه السياق الكامل
145
- - **تراكم الرسائل المتعددة:** إذا أرجعت عدة سياسات `allow(message)`، يتم ربط جميع الرسائل بخطوط جديدة وتسليمها معاً
138
+ - **تأكيدات الحالة:** `allow("All CI checks passed.")` يخبر Claude بأن كل شيء أخضر
139
+ - **شرح الفتح الفاشل:** `allow("GitHub CLI not installed, skipping CI check.")` يخبر Claude لماذا تم تخطي الفحص حتى يكون لديه سياق كامل
140
+ - **تراكم رسائل متعددة:** إذا أرجعت عدة سياسات `allow(message)`، يتم ربط جميع الرسائل بأسطر جديدة وتسليمها معاً
146
141
 
147
142
  ```js
148
143
  customPolicies.add({
@@ -168,25 +163,25 @@ customPolicies.add({
168
163
  | `eventType` | `string` | `"PreToolUse"`، `"PostToolUse"`، `"Notification"`، `"Stop"` |
169
164
  | `toolName` | `string \| undefined` | الأداة التي يتم استدعاؤها (مثل `"Bash"`، `"Write"`، `"Read"`) |
170
165
  | `toolInput` | `Record<string, unknown> \| undefined` | معاملات إدخال الأداة |
171
- | `payload` | `Record<string, unknown>` | حمل الحدث الخام الكامل من Claude Code |
166
+ | `payload` | `Record<string, unknown>` | حمل الحدث الكامل الخام من Claude Code |
172
167
  | `session` | `SessionMetadata \| undefined` | سياق الجلسة (انظر أدناه) |
173
168
 
174
169
  ### حقول `SessionMetadata`
175
170
 
176
171
  | الحقل | النوع | الوصف |
177
172
  |-------|------|-------------|
178
- | `sessionId` | `string` | معرّف جلسة Claude Code |
173
+ | `sessionId` | `string` | معرف جلسة Claude Code |
179
174
  | `cwd` | `string` | دليل العمل لجلسة Claude Code |
180
- | `transcriptPath` | `string` | المسار إلى ملف النسخة JSONL الخاص بالجلسة |
175
+ | `transcriptPath` | `string` | المسار إلى ملف النسخة المكتوبة JSONL للجلسة |
181
176
 
182
177
  ### أنواع الأحداث
183
178
 
184
- | الحدث | متى يتم تشغيله | محتويات `toolInput` |
185
- |-------|--------------|----------------------|
179
+ | الحدث | متى يطلق | محتويات `toolInput` |
180
+ |------|--------------|----------------------|
186
181
  | `PreToolUse` | قبل تشغيل Claude لأداة | إدخال الأداة (مثل `{ command: "..." }` لـ Bash) |
187
182
  | `PostToolUse` | بعد اكتمال الأداة | إدخال الأداة + `tool_result` (الإخراج) |
188
- | `Notification` | عندما يرسل Claude إشعاراً | `{ message: "...", notification_type: "idle" \| "permission_prompt" \| ... }` - يجب أن تعيد الخطافات دائماً `allow()`، فلا يمكنها حظر الإشعارات |
189
- | `Stop` | عند انتهاء جلسة Claude | فارغة |
183
+ | `Notification` | عندما يرسل Claude إشعاراً | `{ message: "...", notification_type: "idle" \| "permission_prompt" \| ... }` - يجب أن تعيد الخطافات دائماً `allow()`، لا يمكنها حجب الإشعارات |
184
+ | `Stop` | عند انتهاء جلسة Claude | فارغ |
190
185
 
191
186
  ---
192
187
 
@@ -196,18 +191,18 @@ customPolicies.add({
196
191
 
197
192
  1. السياسات المدمجة (بترتيب التعريف)
198
193
  2. السياسات المخصصة الصريحة من `customPoliciesPath` (بترتيب `.add()`)
199
- 3. سياسات الاتفاقية من `.failproofai/policies/` للمشروع (ملفات أبجدياً، ترتيب `.add()` بداخلها)
200
- 4. سياسات الاتفاقية من `~/.failproofai/policies/` للمستخدم (ملفات أبجدياً، ترتيب `.add()` بداخلها)
194
+ 3. سياسات الاتفاقية من مشروع `.failproofai/policies/` (الملفات أبجدياً، ترتيب `.add()` بداخلها)
195
+ 4. سياسات الاتفاقية من مستخدم `~/.failproofai/policies/` (الملفات أبجدياً، ترتيب `.add()` بداخلها)
201
196
 
202
197
  <Note>
203
- يقطع أول `deny` جميع السياسات اللاحقة. يتم تجميع جميع رسائل `instruct` وتسليمها معاً.
198
+ يؤدي أول `deny` إلى اختصار جميع السياسات اللاحقة. يتم تجميع جميع رسائل `instruct` وتسليمها معاً.
204
199
  </Note>
205
200
 
206
201
  ---
207
202
 
208
203
  ## الواردات المتعدية
209
204
 
210
- يمكن لملفات السياسة المخصصة استيراد الوحدات المحلية باستخدام المسارات النسبية:
205
+ يمكن لملفات السياسات المخصصة استيراد الوحدات المحلية باستخدام المسارات النسبية:
211
206
 
212
207
  ```js
213
208
  // my-policies.js
@@ -224,13 +219,13 @@ customPolicies.add({
224
219
  });
225
220
  ```
226
221
 
227
- يتم حل جميع الواردات النسبية الممكنة من ملف الإدخال. يتم تطبيق هذا بإعادة كتابة واردات `from "failproofai"` إلى مسار dist الفعلي وإنشاء ملفات `.mjs` مؤقتة لضمان توافق ESM.
222
+ يتم حل جميع الواردات النسبية التي يمكن الوصول إليها من ملف الإدخال. يتم تنفيذ هذا بإعادة كتابة استيراد `from "failproofai"` إلى مسار dist الفعلي وإنشاء ملفات `.mjs` مؤقتة لضمان توافق ESM.
228
223
 
229
224
  ---
230
225
 
231
226
  ## تصفية نوع الحدث
232
227
 
233
- استخدم `match.events` لتحديد متى يتم تشغيل سياسة:
228
+ استخدم `match.events` لتحديد متى تطلق السياسة:
234
229
 
235
230
  ```js
236
231
  customPolicies.add({
@@ -244,26 +239,26 @@ customPolicies.add({
244
239
  });
245
240
  ```
246
241
 
247
- حذف `match` بالكامل للتشغيل في كل نوع حدث.
242
+ احذف `match` تماماً لتطلق على كل نوع حدث.
248
243
 
249
244
  ---
250
245
 
251
246
  ## معالجة الأخطاء وأوضاع الفشل
252
247
 
253
- السياسات المخصصة هي **fail-open**: الأخطاء لا تحظر السياسات المدمجة أو تعطل معالج الخطاف.
248
+ السياسات المخصصة **تفتح الفشل**: لا تحجب الأخطاء أبداً السياسات المدمجة أو تحطم معالج الخطاف.
254
249
 
255
250
  | الفشل | السلوك |
256
251
  |---------|----------|
257
- | `customPoliciesPath` لم تُعيّن | لا تعمل السياسات المخصصة الصريحة؛ سياسات الاتفاقية والمدمجة تستمر بشكل طبيعي |
258
- | ملف غير موجود | تم تسجيل تحذير في `~/.failproofai/hook.log`؛ المدمجة تستمر |
259
- | خطأ في الصيغة/الاستيراد (صريح) | تم تسجيل الخطأ في `~/.failproofai/hook.log`؛ سياسات مخصصة صريحة تم تخطيها |
260
- | خطأ في الصيغة/الاستيراد (اتفاقية) | تم تسجيل الخطأ؛ هذا الملف تم تخطيه، ملفات اتفاقية أخرى لا تزال تحمل |
261
- | `fn` رمي في وقت التشغيل | تم تسجيل الخطأ؛ تم التعامل مع الخطاف كـ `allow`؛ الخطافات الأخرى تستمر |
262
- | `fn` يستغرق أكثر من 10 ثوان | تم تسجيل المهلة الزمنية؛ تم التعامل معها كـ `allow` |
252
+ | `customPoliciesPath` لم يتم تعيينه | لا تعمل سياسات مخصصة صريحة؛ تستمر السياسات والمدمجات الاتفاقية بشكل طبيعي |
253
+ | لم يتم العثور على الملف | تحذير مسجل في `~/.failproofai/hook.log`؛ تستمر المدمجات |
254
+ | خطأ الصيغة/الاستيراد (صريح) | خطأ مسجل في `~/.failproofai/hook.log`؛ تم تخطي السياسات المخصصة الصريحة |
255
+ | خطأ الصيغة/الاستيراد (الاتفاقية) | خطأ مسجل؛ هذا الملف مخطي، لكن ملفات الاتفاقية الأخرى تحمل لا تزال |
256
+ | `fn` يرمي في وقت التشغيل | خطأ مسجل؛ يتم التعامل مع الخطاف كـ `allow`؛ تستمر الخطافات الأخرى |
257
+ | `fn` يستغرق أطول من 10 ثوانٍ | انتهاء المهلة الزمنية المسجلة؛ يتم التعامل معها كـ `allow` |
263
258
  | مجلد الاتفاقية مفقود | لا تعمل سياسات الاتفاقية؛ لا خطأ |
264
259
 
265
260
  <Tip>
266
- لتصحيح أخطاء السياسة المخصصة، راقب ملف السجل:
261
+ لتصحيح أخطاء السياسات المخصصة، شاهد ملف السجل:
267
262
 
268
263
  ```bash
269
264
  tail -f ~/.failproofai/hook.log
@@ -329,14 +324,14 @@ export { customPolicies };
329
324
 
330
325
  ## أمثلة
331
326
 
332
- يحتوي دليل `examples/` على ملفات السياسات الجاهزة للتشغيل:
327
+ يحتوي مجلد `examples/` على ملفات السياسات الجاهزة للتشغيل:
333
328
 
334
- | الملف | المحتوى |
329
+ | الملف | المحتويات |
335
330
  |------|----------|
336
- | `examples/policies-basic.js` | خمس سياسات للمبتدئين تغطي أوضاع فشل الوكيل الشائعة |
337
- | `examples/policies-advanced/index.js` | أنماط متقدمة: واردات متعدية، استدعاءات غير متزامنة، تنقية الإخراج، وخطافات نهاية الجلسة |
338
- | `examples/convention-policies/security-policies.mjs` | سياسات الأمان المبنية على الاتفاقية (حظر كتابة .env، منع إعادة كتابة سجل git) |
339
- | `examples/convention-policies/workflow-policies.mjs` | سياسات سير العمل المبنية على الاتفاقية (تذكيرات الاختبار، ملفات التدقيق) |
331
+ | `examples/policies-basic.js` | خمس سياسات للمبتدئين تغطي أنماط أعطال الوكيل الشائعة |
332
+ | `examples/policies-advanced/index.js` | أنماط متقدمة: واردات متعدية، استدعاءات غير متزامنة، كشط الإخراج، خطافات نهاية الجلسة |
333
+ | `examples/convention-policies/security-policies.mjs` | سياسات الأمان القائمة على الاتفاقية (منع كتابات .env، منع إعادة كتابة سجل git) |
334
+ | `examples/convention-policies/workflow-policies.mjs` | سياسات سير العمل القائمة على الاتفاقية (تذكيرات الاختبار، ملفات الكتابة بالتدقيق) |
340
335
 
341
336
  ### استخدام أمثلة الملفات الصريحة
342
337
 
@@ -344,7 +339,7 @@ export { customPolicies };
344
339
  failproofai policies --install --custom ./examples/policies-basic.js
345
340
  ```
346
341
 
347
- ### استخدام أمثلة الاتفاقية
342
+ ### استخدام أمثلة قائمة على الاتفاقية
348
343
 
349
344
  ```bash
350
345
  # Copy to project level
@@ -356,4 +351,4 @@ mkdir -p ~/.failproofai/policies
356
351
  cp examples/convention-policies/*.mjs ~/.failproofai/policies/
357
352
  ```
358
353
 
359
- لا حاجة لأمر التثبيت - يتم اختيار الملفات تلقائياً عند حدث الخطاف التالي.
354
+ لا يلزم أمر التثبيت يتم التقاط الملفات تلقائياً في حدث الخطاف التالي.
@@ -102,9 +102,9 @@ The handler enforces a 1 MB stdin limit. Payloads exceeding this are discarded a
102
102
  - Exit code: `0`
103
103
  - Empty stdout
104
104
 
105
- **Allow with message (beta):**
105
+ **Allow with message:**
106
106
 
107
- Since v0.0.2-beta.3, `allow(message)` lets a policy send informational context back to Claude even when the operation is permitted. The hook handler writes the following JSON to **stdout** (not a config file — this is the handler's response to Claude Code, just like deny and instruct responses above):
107
+ `allow(message)` lets a policy send informational context back to Claude even when the operation is permitted. The hook handler writes the following JSON to **stdout** (not a config file — this is the handler's response to Claude Code, just like deny and instruct responses above):
108
108
 
109
109
  ```json
110
110
  // Written to stdout by the hook handler process
@@ -153,7 +153,7 @@ Path to a JavaScript file containing custom hook policies. This is set automatic
153
153
 
154
154
  The file is loaded fresh on every hook event - there is no caching. See [Custom Policies](/custom-policies) for authoring details.
155
155
 
156
- ### Convention-based policies (v0.0.2-beta.7+)
156
+ ### Convention-based policies
157
157
 
158
158
  In addition to the explicit `customPoliciesPath`, failproofai automatically discovers and loads policy files from `.failproofai/policies/` directories:
159
159
 
@@ -39,7 +39,7 @@ failproofai policies --install --custom ./my-policies.js
39
39
 
40
40
  ## Two ways to load custom policies
41
41
 
42
- ### Option 1: Convention-based (recommended, v0.0.2-beta.7+)
42
+ ### Option 1: Convention-based (recommended)
43
43
 
44
44
  Drop `*policies.{js,mjs,ts}` files into `.failproofai/policies/` and they're automatically loaded — no flags or config changes needed. This works like git hooks: drop a file, it just works.
45
45
 
@@ -125,11 +125,7 @@ customPolicies.add({
125
125
  You can append extra guidance to any `deny` or `instruct` message by adding a `hint` field in `policyParams` — no code change needed. This works for custom (`custom/`), project convention (`.failproofai-project/`), and user convention (`.failproofai-user/`) policies too. See [Configuration → hint](/configuration#hint-cross-cutting) for details.
126
126
  </Tip>
127
127
 
128
- ### Informational allow messages (beta)
129
-
130
- <Note>
131
- `allow(message)` is a beta feature available since v0.0.2-beta.3. The API may change in future releases. Earlier versions only support `allow()` without arguments.
132
- </Note>
128
+ ### Informational allow messages
133
129
 
134
130
  `allow(message)` permits the operation **and** sends an informational message back to Claude. The message is delivered as `additionalContext` in the hook handler's stdout response — the same mechanism used by `instruct`, but semantically different: it's a status update, not a warning.
135
131