resuxjs 0.3.10 → 0.4.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (361) hide show
  1. package/README.md +23 -1
  2. package/dist/bin.d.ts +1 -2
  3. package/dist/bin.js +4 -0
  4. package/dist/bin.js.map +1 -1
  5. package/dist/build/index.d.ts +28 -0
  6. package/dist/build/index.js +51 -0
  7. package/dist/build/index.js.map +1 -0
  8. package/dist/cli.d.ts +15 -5
  9. package/dist/cli.js +2648 -3668
  10. package/dist/cli.js.map +1 -1
  11. package/dist/compiler/adapter.d.ts +14 -11
  12. package/dist/compiler/adapter.js +68 -93
  13. package/dist/compiler/adapter.js.map +1 -1
  14. package/dist/compiler/dev-warnings.d.ts +8 -5
  15. package/dist/compiler/dev-warnings.js +248 -321
  16. package/dist/compiler/dev-warnings.js.map +1 -1
  17. package/dist/compiler/directives.d.ts +3 -0
  18. package/dist/compiler/directives.js +124 -150
  19. package/dist/compiler/directives.js.map +1 -1
  20. package/dist/compiler/implementation.d.ts +96 -93
  21. package/dist/compiler/implementation.js +2967 -3430
  22. package/dist/compiler/index.d.ts +14 -11
  23. package/dist/compiler/index.js +68 -93
  24. package/dist/compiler/index.js.map +1 -1
  25. package/dist/core/config.d.ts +12 -5
  26. package/dist/core/config.js +42 -25
  27. package/dist/core/config.js.map +1 -1
  28. package/dist/core/hooks.d.ts +127 -126
  29. package/dist/core/hooks.js +45 -55
  30. package/dist/core/hooks.js.map +1 -1
  31. package/dist/core/index.d.ts +5 -4
  32. package/dist/core/index.js +5 -5
  33. package/dist/core/module-container.d.ts +76 -74
  34. package/dist/core/module-container.js +181 -186
  35. package/dist/core/module-container.js.map +1 -1
  36. package/dist/core/resux.d.ts +15 -12
  37. package/dist/core/resux.js +17 -13
  38. package/dist/core/resux.js.map +1 -1
  39. package/dist/create-bin.d.ts +1 -2
  40. package/dist/create-bin.js +4 -0
  41. package/dist/create-bin.js.map +1 -1
  42. package/dist/create.d.ts +3 -0
  43. package/dist/create.js +499 -638
  44. package/dist/create.js.map +1 -1
  45. package/dist/deploy/cloudflare.d.ts +4 -1
  46. package/dist/deploy/cloudflare.js +30 -34
  47. package/dist/deploy/cloudflare.js.map +1 -1
  48. package/dist/deploy/common.d.ts +6 -4
  49. package/dist/deploy/common.js +118 -188
  50. package/dist/deploy/common.js.map +1 -1
  51. package/dist/deploy/framework-runtime.d.ts +3 -0
  52. package/dist/deploy/framework-runtime.js +43 -48
  53. package/dist/deploy/framework-runtime.js.map +1 -1
  54. package/dist/deploy/index.d.ts +4 -1
  55. package/dist/deploy/index.js +58 -80
  56. package/dist/deploy/index.js.map +1 -1
  57. package/dist/deploy/netlify.d.ts +4 -1
  58. package/dist/deploy/netlify.js +40 -41
  59. package/dist/deploy/netlify.js.map +1 -1
  60. package/dist/deploy/node.d.ts +4 -1
  61. package/dist/deploy/node.js +24 -19
  62. package/dist/deploy/node.js.map +1 -1
  63. package/dist/deploy/production-report.d.ts +3 -0
  64. package/dist/deploy/production-report.js +14 -14
  65. package/dist/deploy/production-report.js.map +1 -1
  66. package/dist/deploy/runtime-dependencies.d.ts +3 -0
  67. package/dist/deploy/runtime-dependencies.js +158 -220
  68. package/dist/deploy/runtime-dependencies.js.map +1 -1
  69. package/dist/deploy/static.d.ts +4 -1
  70. package/dist/deploy/static.js +16 -14
  71. package/dist/deploy/static.js.map +1 -1
  72. package/dist/deploy/types.d.ts +25 -22
  73. package/dist/deploy/types.js +0 -1
  74. package/dist/deploy/vercel.d.ts +4 -1
  75. package/dist/deploy/vercel.js +137 -188
  76. package/dist/deploy/vercel.js.map +1 -1
  77. package/dist/fonts/index.d.ts +15 -11
  78. package/dist/fonts/index.js +114 -134
  79. package/dist/fonts/index.js.map +1 -1
  80. package/dist/globals.d.ts +79 -78
  81. package/dist/globals.js +0 -1
  82. package/dist/halal-core/ai/classifyProject.d.ts +4 -1
  83. package/dist/halal-core/ai/classifyProject.js +81 -95
  84. package/dist/halal-core/ai/classifyProject.js.map +1 -1
  85. package/dist/halal-core/ai/classifyRuntimeContent.d.ts +5 -2
  86. package/dist/halal-core/ai/classifyRuntimeContent.js +77 -95
  87. package/dist/halal-core/ai/classifyRuntimeContent.js.map +1 -1
  88. package/dist/halal-core/ai/createProjectSummary.d.ts +38 -35
  89. package/dist/halal-core/ai/createProjectSummary.js +38 -39
  90. package/dist/halal-core/ai/createProjectSummary.js.map +1 -1
  91. package/dist/halal-core/ai/halalClassifierPrompt.d.ts +3 -0
  92. package/dist/halal-core/ai/halalClassifierPrompt.js +5 -1
  93. package/dist/halal-core/ai/halalClassifierPrompt.js.map +1 -1
  94. package/dist/halal-core/ai/redactSensitiveData.d.ts +3 -0
  95. package/dist/halal-core/ai/redactSensitiveData.js +82 -110
  96. package/dist/halal-core/ai/redactSensitiveData.js.map +1 -1
  97. package/dist/halal-core/ai/validateAiResponse.d.ts +4 -1
  98. package/dist/halal-core/ai/validateAiResponse.js +58 -85
  99. package/dist/halal-core/ai/validateAiResponse.js.map +1 -1
  100. package/dist/halal-core/cli/check.d.ts +3 -0
  101. package/dist/halal-core/cli/check.js +28 -30
  102. package/dist/halal-core/cli/check.js.map +1 -1
  103. package/dist/halal-core/cli/explain.d.ts +3 -0
  104. package/dist/halal-core/cli/explain.js +27 -31
  105. package/dist/halal-core/cli/explain.js.map +1 -1
  106. package/dist/halal-core/cli/report.d.ts +3 -0
  107. package/dist/halal-core/cli/report.js +14 -10
  108. package/dist/halal-core/cli/report.js.map +1 -1
  109. package/dist/halal-core/cli/submitReview.d.ts +3 -0
  110. package/dist/halal-core/cli/submitReview.js +13 -9
  111. package/dist/halal-core/cli/submitReview.js.map +1 -1
  112. package/dist/halal-core/cli/verifyReview.d.ts +3 -0
  113. package/dist/halal-core/cli/verifyReview.js +18 -15
  114. package/dist/halal-core/cli/verifyReview.js.map +1 -1
  115. package/dist/halal-core/config.d.ts +30 -27
  116. package/dist/halal-core/config.js +76 -118
  117. package/dist/halal-core/config.js.map +1 -1
  118. package/dist/halal-core/crypto/integrity.d.ts +6 -3
  119. package/dist/halal-core/crypto/integrity.js +64 -87
  120. package/dist/halal-core/crypto/integrity.js.map +1 -1
  121. package/dist/halal-core/enforce.d.ts +3 -0
  122. package/dist/halal-core/enforce.js +92 -105
  123. package/dist/halal-core/enforce.js.map +1 -1
  124. package/dist/halal-core/index.d.ts +20 -16
  125. package/dist/halal-core/index.js +18 -19
  126. package/dist/halal-core/lifecycle.d.ts +3 -0
  127. package/dist/halal-core/lifecycle.js +15 -13
  128. package/dist/halal-core/lifecycle.js.map +1 -1
  129. package/dist/halal-core/policy.d.ts +4 -1
  130. package/dist/halal-core/policy.js +6 -2
  131. package/dist/halal-core/policy.js.map +1 -1
  132. package/dist/halal-core/report/formatBrowserOverlay.d.ts +4 -1
  133. package/dist/halal-core/report/formatBrowserOverlay.js +10 -8
  134. package/dist/halal-core/report/formatBrowserOverlay.js.map +1 -1
  135. package/dist/halal-core/report/formatTerminalReport.d.ts +4 -1
  136. package/dist/halal-core/report/formatTerminalReport.js +27 -37
  137. package/dist/halal-core/report/formatTerminalReport.js.map +1 -1
  138. package/dist/halal-core/report/generateHalalReport.d.ts +7 -4
  139. package/dist/halal-core/report/generateHalalReport.js +26 -26
  140. package/dist/halal-core/report/generateHalalReport.js.map +1 -1
  141. package/dist/halal-core/report/signReport.d.ts +4 -1
  142. package/dist/halal-core/report/signReport.js +16 -12
  143. package/dist/halal-core/report/signReport.js.map +1 -1
  144. package/dist/halal-core/report/verifyReport.d.ts +9 -6
  145. package/dist/halal-core/report/verifyReport.js +51 -41
  146. package/dist/halal-core/report/verifyReport.js.map +1 -1
  147. package/dist/halal-core/review/createReviewRequest.d.ts +4 -1
  148. package/dist/halal-core/review/createReviewRequest.js +21 -17
  149. package/dist/halal-core/review/createReviewRequest.js.map +1 -1
  150. package/dist/halal-core/review/reviewPolicy.d.ts +3 -0
  151. package/dist/halal-core/review/reviewPolicy.js +19 -17
  152. package/dist/halal-core/review/reviewPolicy.js.map +1 -1
  153. package/dist/halal-core/review/signedReviewFile.d.ts +11 -8
  154. package/dist/halal-core/review/signedReviewFile.js +24 -22
  155. package/dist/halal-core/review/signedReviewFile.js.map +1 -1
  156. package/dist/halal-core/review/verifyReviewApproval.d.ts +9 -6
  157. package/dist/halal-core/review/verifyReviewApproval.js +68 -62
  158. package/dist/halal-core/review/verifyReviewApproval.js.map +1 -1
  159. package/dist/halal-core/rules/adultContentRules.d.ts +3 -0
  160. package/dist/halal-core/rules/adultContentRules.js +23 -23
  161. package/dist/halal-core/rules/adultContentRules.js.map +1 -1
  162. package/dist/halal-core/rules/alcoholDrugVapeRules.d.ts +3 -0
  163. package/dist/halal-core/rules/alcoholDrugVapeRules.js +22 -22
  164. package/dist/halal-core/rules/alcoholDrugVapeRules.js.map +1 -1
  165. package/dist/halal-core/rules/childSafetyRules.d.ts +3 -0
  166. package/dist/halal-core/rules/childSafetyRules.js +19 -19
  167. package/dist/halal-core/rules/childSafetyRules.js.map +1 -1
  168. package/dist/halal-core/rules/coreCategories.d.ts +7 -4
  169. package/dist/halal-core/rules/coreCategories.js +237 -110
  170. package/dist/halal-core/rules/coreCategories.js.map +1 -1
  171. package/dist/halal-core/rules/cyberAbuseRules.d.ts +3 -0
  172. package/dist/halal-core/rules/cyberAbuseRules.js +27 -27
  173. package/dist/halal-core/rules/cyberAbuseRules.js.map +1 -1
  174. package/dist/halal-core/rules/defaultBlockedRules.d.ts +21 -18
  175. package/dist/halal-core/rules/defaultBlockedRules.js +158 -199
  176. package/dist/halal-core/rules/defaultBlockedRules.js.map +1 -1
  177. package/dist/halal-core/rules/dependencyRules.d.ts +8 -5
  178. package/dist/halal-core/rules/dependencyRules.js +50 -56
  179. package/dist/halal-core/rules/dependencyRules.js.map +1 -1
  180. package/dist/halal-core/rules/endpointRules.d.ts +6 -3
  181. package/dist/halal-core/rules/endpointRules.js +21 -23
  182. package/dist/halal-core/rules/endpointRules.js.map +1 -1
  183. package/dist/halal-core/rules/environmentalHarmRules.d.ts +3 -0
  184. package/dist/halal-core/rules/environmentalHarmRules.js +17 -17
  185. package/dist/halal-core/rules/environmentalHarmRules.js.map +1 -1
  186. package/dist/halal-core/rules/financeRibaRules.d.ts +3 -0
  187. package/dist/halal-core/rules/financeRibaRules.js +20 -20
  188. package/dist/halal-core/rules/financeRibaRules.js.map +1 -1
  189. package/dist/halal-core/rules/gamblingRules.d.ts +3 -0
  190. package/dist/halal-core/rules/gamblingRules.js +22 -22
  191. package/dist/halal-core/rules/gamblingRules.js.map +1 -1
  192. package/dist/halal-core/rules/generalHarmRules.d.ts +3 -0
  193. package/dist/halal-core/rules/generalHarmRules.js +15 -15
  194. package/dist/halal-core/rules/generalHarmRules.js.map +1 -1
  195. package/dist/halal-core/rules/healthHarmRules.d.ts +3 -0
  196. package/dist/halal-core/rules/healthHarmRules.js +19 -19
  197. package/dist/halal-core/rules/healthHarmRules.js.map +1 -1
  198. package/dist/halal-core/rules/keywordRules.d.ts +11 -8
  199. package/dist/halal-core/rules/keywordRules.js +90 -39
  200. package/dist/halal-core/rules/keywordRules.js.map +1 -1
  201. package/dist/halal-core/rules/privacyAbuseRules.d.ts +3 -0
  202. package/dist/halal-core/rules/privacyAbuseRules.js +21 -21
  203. package/dist/halal-core/rules/privacyAbuseRules.js.map +1 -1
  204. package/dist/halal-core/rules/scamFraudRules.d.ts +3 -0
  205. package/dist/halal-core/rules/scamFraudRules.js +29 -29
  206. package/dist/halal-core/rules/scamFraudRules.js.map +1 -1
  207. package/dist/halal-core/rules/selfHarmRules.d.ts +3 -0
  208. package/dist/halal-core/rules/selfHarmRules.js +17 -17
  209. package/dist/halal-core/rules/selfHarmRules.js.map +1 -1
  210. package/dist/halal-core/rules/violenceExtremismRules.d.ts +3 -0
  211. package/dist/halal-core/rules/violenceExtremismRules.js +30 -30
  212. package/dist/halal-core/rules/violenceExtremismRules.js.map +1 -1
  213. package/dist/halal-core/runtime/guard.d.ts +17 -14
  214. package/dist/halal-core/runtime/guard.js +162 -183
  215. package/dist/halal-core/runtime/guard.js.map +1 -1
  216. package/dist/halal-core/runtime/index.d.ts +5 -4
  217. package/dist/halal-core/runtime/index.js +4 -5
  218. package/dist/halal-core/runtime/reviewedMemory.d.ts +4 -1
  219. package/dist/halal-core/runtime/reviewedMemory.js +74 -110
  220. package/dist/halal-core/runtime/reviewedMemory.js.map +1 -1
  221. package/dist/halal-core/runtime/serializeRuntimeContent.d.ts +10 -7
  222. package/dist/halal-core/runtime/serializeRuntimeContent.js +132 -156
  223. package/dist/halal-core/runtime/serializeRuntimeContent.js.map +1 -1
  224. package/dist/halal-core/runtime/types.d.ts +44 -41
  225. package/dist/halal-core/runtime/types.js +0 -1
  226. package/dist/halal-core/scanner/scanApiRoutes.d.ts +3 -0
  227. package/dist/halal-core/scanner/scanApiRoutes.js +32 -36
  228. package/dist/halal-core/scanner/scanApiRoutes.js.map +1 -1
  229. package/dist/halal-core/scanner/scanComponents.d.ts +3 -0
  230. package/dist/halal-core/scanner/scanComponents.js +12 -13
  231. package/dist/halal-core/scanner/scanComponents.js.map +1 -1
  232. package/dist/halal-core/scanner/scanContent.d.ts +5 -2
  233. package/dist/halal-core/scanner/scanContent.js +193 -263
  234. package/dist/halal-core/scanner/scanContent.js.map +1 -1
  235. package/dist/halal-core/scanner/scanDependencies.d.ts +3 -0
  236. package/dist/halal-core/scanner/scanDependencies.js +16 -15
  237. package/dist/halal-core/scanner/scanDependencies.js.map +1 -1
  238. package/dist/halal-core/scanner/scanDomains.d.ts +5 -2
  239. package/dist/halal-core/scanner/scanDomains.js +12 -12
  240. package/dist/halal-core/scanner/scanDomains.js.map +1 -1
  241. package/dist/halal-core/scanner/scanEnvNames.d.ts +3 -0
  242. package/dist/halal-core/scanner/scanEnvNames.js +23 -26
  243. package/dist/halal-core/scanner/scanEnvNames.js.map +1 -1
  244. package/dist/halal-core/scanner/scanMetadata.d.ts +6 -3
  245. package/dist/halal-core/scanner/scanMetadata.js +20 -29
  246. package/dist/halal-core/scanner/scanMetadata.js.map +1 -1
  247. package/dist/halal-core/scanner/scanPages.d.ts +3 -0
  248. package/dist/halal-core/scanner/scanPages.js +12 -15
  249. package/dist/halal-core/scanner/scanPages.js.map +1 -1
  250. package/dist/halal-core/scanner/scanProject.d.ts +15 -10
  251. package/dist/halal-core/scanner/scanProject.js +43 -49
  252. package/dist/halal-core/scanner/scanProject.js.map +1 -1
  253. package/dist/halal-core/scanner/scanRoutes.d.ts +3 -0
  254. package/dist/halal-core/scanner/scanRoutes.js +32 -39
  255. package/dist/halal-core/scanner/scanRoutes.js.map +1 -1
  256. package/dist/halal-core/scanner/scanTranslations.d.ts +3 -0
  257. package/dist/halal-core/scanner/scanTranslations.js +21 -29
  258. package/dist/halal-core/scanner/scanTranslations.js.map +1 -1
  259. package/dist/halal-core/status.d.ts +14 -11
  260. package/dist/halal-core/status.js +0 -1
  261. package/dist/halal-core/tamper/verifyCoreIntegrity.d.ts +3 -0
  262. package/dist/halal-core/tamper/verifyCoreIntegrity.js +26 -24
  263. package/dist/halal-core/tamper/verifyCoreIntegrity.js.map +1 -1
  264. package/dist/halal-core/tamper/verifyLifecycleHooks.d.ts +3 -0
  265. package/dist/halal-core/tamper/verifyLifecycleHooks.js +13 -12
  266. package/dist/halal-core/tamper/verifyLifecycleHooks.js.map +1 -1
  267. package/dist/halal-core/tamper/verifyReportSignature.d.ts +6 -3
  268. package/dist/halal-core/tamper/verifyReportSignature.js +20 -14
  269. package/dist/halal-core/tamper/verifyReportSignature.js.map +1 -1
  270. package/dist/halal.d.ts +20 -1
  271. package/dist/halal.js +18 -2
  272. package/dist/i18n/index.d.ts +34 -31
  273. package/dist/i18n/index.js +219 -288
  274. package/dist/i18n/index.js.map +1 -1
  275. package/dist/i18n/shared.d.ts +18 -15
  276. package/dist/i18n/shared.js +204 -266
  277. package/dist/i18n/shared.js.map +1 -1
  278. package/dist/icons/index.d.ts +143 -139
  279. package/dist/icons/index.js +322 -273
  280. package/dist/icons/index.js.map +1 -1
  281. package/dist/index.d.ts +8 -1
  282. package/dist/index.js +7 -2
  283. package/dist/kit/index.d.ts +9 -6
  284. package/dist/kit/index.js +45 -43
  285. package/dist/kit/index.js.map +1 -1
  286. package/dist/nitro-server/index.d.ts +7 -4
  287. package/dist/nitro-server/index.js +6 -2
  288. package/dist/nitro-server/index.js.map +1 -1
  289. package/dist/node.d.ts +6 -3
  290. package/dist/node.js +88 -116
  291. package/dist/node.js.map +1 -1
  292. package/dist/reactivity/computed.d.ts +6 -3
  293. package/dist/reactivity/computed.js +46 -53
  294. package/dist/reactivity/computed.js.map +1 -1
  295. package/dist/reactivity/effect.d.ts +8 -5
  296. package/dist/reactivity/effect.js +105 -146
  297. package/dist/reactivity/effect.js.map +1 -1
  298. package/dist/reactivity/index.d.ts +8 -8
  299. package/dist/reactivity/index.js +7 -8
  300. package/dist/reactivity/reactive.d.ts +3 -0
  301. package/dist/reactivity/reactive.js +93 -133
  302. package/dist/reactivity/reactive.js.map +1 -1
  303. package/dist/reactivity/readonly.d.ts +2 -1
  304. package/dist/reactivity/readonly.js +2 -2
  305. package/dist/reactivity/ref.d.ts +15 -15
  306. package/dist/reactivity/ref.js +73 -81
  307. package/dist/reactivity/ref.js.map +1 -1
  308. package/dist/reactivity/scheduler.d.ts +3 -1
  309. package/dist/reactivity/scheduler.js +67 -69
  310. package/dist/reactivity/scheduler.js.map +1 -1
  311. package/dist/reactivity/types.d.ts +17 -14
  312. package/dist/reactivity/types.js +0 -1
  313. package/dist/reactivity/utils.d.ts +7 -4
  314. package/dist/reactivity/utils.js +25 -24
  315. package/dist/reactivity/utils.js.map +1 -1
  316. package/dist/reactivity/watch.d.ts +4 -2
  317. package/dist/reactivity/watch.js +75 -103
  318. package/dist/reactivity/watch.js.map +1 -1
  319. package/dist/runtime/core.d.ts +31 -0
  320. package/dist/runtime/core.js +156 -0
  321. package/dist/runtime/core.js.map +1 -0
  322. package/dist/runtime/index.d.ts +487 -461
  323. package/dist/runtime/index.js +4129 -5254
  324. package/dist/runtime/index.js.map +1 -1
  325. package/dist/runtime/reactivity.d.ts +7 -0
  326. package/dist/runtime/reactivity.js +6 -0
  327. package/dist/runtime/resume.d.ts +79 -0
  328. package/dist/runtime/resume.js +482 -0
  329. package/dist/runtime/resume.js.map +1 -0
  330. package/dist/runtime/router.d.ts +20 -0
  331. package/dist/runtime/router.js +60 -0
  332. package/dist/runtime/router.js.map +1 -0
  333. package/dist/runtime/streaming.d.ts +24 -0
  334. package/dist/runtime/streaming.js +200 -0
  335. package/dist/runtime/streaming.js.map +1 -0
  336. package/dist/security/media-fetch.d.ts +32 -0
  337. package/dist/security/media-fetch.js +301 -0
  338. package/dist/security/media-fetch.js.map +1 -0
  339. package/dist/security/path-boundary.d.ts +7 -0
  340. package/dist/security/path-boundary.js +70 -0
  341. package/dist/security/path-boundary.js.map +1 -0
  342. package/dist/ui/index.d.ts +1580 -1576
  343. package/dist/ui/index.js +975 -674
  344. package/dist/ui/index.js.map +1 -1
  345. package/dist/vite-builder/index.d.ts +6 -3
  346. package/dist/vite-builder/index.js +6 -2
  347. package/dist/vite-builder/index.js.map +1 -1
  348. package/package.json +46 -86
  349. package/dist/compiler/implementation.js.map +0 -1
  350. package/dist/core/index.js.map +0 -1
  351. package/dist/deploy/types.js.map +0 -1
  352. package/dist/globals.js.map +0 -1
  353. package/dist/halal-core/index.js.map +0 -1
  354. package/dist/halal-core/runtime/index.js.map +0 -1
  355. package/dist/halal-core/runtime/types.js.map +0 -1
  356. package/dist/halal-core/status.js.map +0 -1
  357. package/dist/halal.js.map +0 -1
  358. package/dist/index.js.map +0 -1
  359. package/dist/reactivity/index.js.map +0 -1
  360. package/dist/reactivity/readonly.js.map +0 -1
  361. package/dist/reactivity/types.js.map +0 -1
@@ -1,2 +1,5 @@
1
- import { type ResuxHalalPolicy } from "./config.js";
1
+ import { ResuxHalalPolicy } from "./config.js";
2
+ //#region src/halal-core/policy.d.ts
2
3
  export declare function defineResuxHalalPolicy(config: ResuxHalalPolicy): ResuxHalalPolicy;
4
+ //#endregion
5
+ //# sourceMappingURL=policy.d.ts.map
@@ -1,5 +1,9 @@
1
1
  import { validatePolicyConfig } from "./config.js";
2
- export function defineResuxHalalPolicy(config) {
3
- return validatePolicyConfig(config);
2
+ //#region src/halal-core/policy.ts
3
+ function defineResuxHalalPolicy(config) {
4
+ return validatePolicyConfig(config);
4
5
  }
6
+ //#endregion
7
+ export { defineResuxHalalPolicy };
8
+
5
9
  //# sourceMappingURL=policy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"policy.js","sourceRoot":"","sources":["../../src/halal-core/policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAyB,MAAM,aAAa,CAAC;AAE1E,MAAM,UAAU,sBAAsB,CAAC,MAAwB;IAC7D,OAAO,oBAAoB,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC"}
1
+ {"version":3,"file":"policy.js","names":[],"sources":["../../src/halal-core/policy.ts"],"sourcesContent":["import { validatePolicyConfig, type ResuxHalalPolicy } from \"./config.js\";\n\nexport function defineResuxHalalPolicy(config: ResuxHalalPolicy): ResuxHalalPolicy {\n return validatePolicyConfig(config);\n}\n"],"mappings":";;AAEA,SAAgB,uBAAuB,QAA4C;CACjF,OAAO,qBAAqB,MAAM;AACpC"}
@@ -1,2 +1,5 @@
1
- import type { HalalCheckResult } from "../status.js";
1
+ import { HalalCheckResult } from "../status.js";
2
+ //#region src/halal-core/report/formatBrowserOverlay.d.ts
2
3
  export declare function formatBrowserOverlayScript(report: HalalCheckResult): string;
4
+ //#endregion
5
+ //# sourceMappingURL=formatBrowserOverlay.d.ts.map
@@ -1,11 +1,10 @@
1
- export function formatBrowserOverlayScript(report) {
2
- if (report.status === "allowed") {
3
- return "";
4
- }
5
- const title = report.status === "blocked" ? "Resux Core Safety Block" : "Resux Core Review Required";
6
- const message = report.reasons.join("<br/>- ");
7
- const color = report.status === "blocked" ? "#EF4444" : "#F59E0B";
8
- return `
1
+ //#region src/halal-core/report/formatBrowserOverlay.ts
2
+ function formatBrowserOverlayScript(report) {
3
+ if (report.status === "allowed") return "";
4
+ const title = report.status === "blocked" ? "Resux Core Safety Block" : "Resux Core Review Required";
5
+ const message = report.reasons.join("<br/>- ");
6
+ const color = report.status === "blocked" ? "#EF4444" : "#F59E0B";
7
+ return `
9
8
  (function() {
10
9
  if (typeof window === 'undefined') return;
11
10
  const overlay = document.createElement('div');
@@ -38,4 +37,7 @@ export function formatBrowserOverlayScript(report) {
38
37
  })();
39
38
  `.trim();
40
39
  }
40
+ //#endregion
41
+ export { formatBrowserOverlayScript };
42
+
41
43
  //# sourceMappingURL=formatBrowserOverlay.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatBrowserOverlay.js","sourceRoot":"","sources":["../../../src/halal-core/report/formatBrowserOverlay.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,0BAA0B,CAAC,MAAwB;IACjE,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,4BAA4B,CAAC;IACrG,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/C,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;IAElE,OAAO;;;;;;;;;;;0CAWiC,KAAK;;;;;;;;;iFASkC,KAAK,MAAM,KAAK;;;;YAIrF,OAAO;;;sEAGmD,MAAM,CAAC,iBAAiB;;;;GAI3F,CAAC,IAAI,EAAE,CAAC;AACX,CAAC"}
1
+ {"version":3,"file":"formatBrowserOverlay.js","names":[],"sources":["../../../src/halal-core/report/formatBrowserOverlay.ts"],"sourcesContent":["import type { HalalCheckResult } from \"../status.js\";\n\nexport function formatBrowserOverlayScript(report: HalalCheckResult): string {\n if (report.status === \"allowed\") {\n return \"\";\n }\n\n const title = report.status === \"blocked\" ? \"Resux Core Safety Block\" : \"Resux Core Review Required\";\n const message = report.reasons.join(\"<br/>- \");\n const color = report.status === \"blocked\" ? \"#EF4444\" : \"#F59E0B\";\n\n return `\n(function() {\n if (typeof window === 'undefined') return;\n const overlay = document.createElement('div');\n overlay.id = 'resux-halal-overlay';\n overlay.style.position = 'fixed';\n overlay.style.bottom = '20px';\n overlay.style.right = '20px';\n overlay.style.zIndex = '999999';\n overlay.style.backgroundColor = '#1E293B';\n overlay.style.color = '#F8FAFC';\n overlay.style.borderLeft = '6px solid ${color}';\n overlay.style.borderRadius = '8px';\n overlay.style.padding = '16px';\n overlay.style.boxShadow = '0 10px 15px -3px rgba(0, 0, 0, 0.5)';\n overlay.style.fontFamily = 'system-ui, sans-serif';\n overlay.style.fontSize = '14px';\n overlay.style.maxWidth = '380px';\n \n overlay.innerHTML = \\`\n <div style=\"font-weight: bold; margin-bottom: 8px; font-size: 16px; color: ${color};\">${title}</div>\n <div style=\"margin-bottom: 12px; opacity: 0.9;\">\n This project has triggered framework-level safety alerts:<br/>\n <div style=\"margin-top: 6px; padding: 6px; background: #0F172A; border-radius: 4px; font-size: 12px; font-family: monospace; max-height: 120px; overflow-y: auto;\">\n - ${message}\n </div>\n </div>\n <div style=\"font-size: 12px; opacity: 0.7;\">Recommended Action: ${report.recommendedAction}</div>\n \\`;\n document.body.appendChild(overlay);\n})();\n `.trim();\n}\n"],"mappings":";AAEA,SAAgB,2BAA2B,QAAkC;CAC3E,IAAI,OAAO,WAAW,WACpB,OAAO;CAGT,MAAM,QAAQ,OAAO,WAAW,YAAY,4BAA4B;CACxE,MAAM,UAAU,OAAO,QAAQ,KAAK,SAAS;CAC7C,MAAM,QAAQ,OAAO,WAAW,YAAY,YAAY;CAExD,OAAO;;;;;;;;;;;0CAWiC,MAAM;;;;;;;;;iFASiC,MAAM,KAAK,MAAM;;;;YAItF,QAAQ;;;sEAGkD,OAAO,kBAAkB;;;;IAI3F,KAAK;AACT"}
@@ -1,2 +1,5 @@
1
- import type { HalalCheckResult } from "../status.js";
1
+ import { HalalCheckResult } from "../status.js";
2
+ //#region src/halal-core/report/formatTerminalReport.d.ts
2
3
  export declare function formatTerminalReport(report: HalalCheckResult): string;
4
+ //#endregion
5
+ //# sourceMappingURL=formatTerminalReport.d.ts.map
@@ -1,39 +1,29 @@
1
- export function formatTerminalReport(report) {
2
- const lines = [];
3
- if (report.status === "blocked") {
4
- lines.push("\x1b[31m\x1b[1mResux Halal Core blocked this project.\x1b[0m\n");
5
- }
6
- else if (report.status === "review_required") {
7
- lines.push("\x1b[33m\x1b[1mResux Halal Core review required for this project.\x1b[0m\n");
8
- }
9
- else if (report.status === "warning") {
10
- lines.push("\x1b[33mResux Halal Core warning issue.\x1b[0m\n");
11
- }
12
- else {
13
- lines.push("\x1b[32mResux Halal Core checks passed successfully.\x1b[0m\n");
14
- }
15
- lines.push(`Status: ${report.status}`);
16
- lines.push(`Risk Level: ${report.riskLevel}`);
17
- lines.push(`Category: ${report.categories.join(", ") || "none"}`);
18
- lines.push(`Confidence: ${(report.confidence * 100).toFixed(0)}%`);
19
- if (report.matchedFiles.length > 0) {
20
- lines.push("\nDetected:");
21
- report.matchedFiles.slice(0, 10).forEach(file => {
22
- lines.push(`- ${file}`);
23
- });
24
- if (report.matchedFiles.length > 10) {
25
- lines.push(`- ...and ${report.matchedFiles.length - 10} more files`);
26
- }
27
- }
28
- lines.push("\nReason:");
29
- if (report.reasons.length > 0) {
30
- report.reasons.forEach(r => lines.push(`- ${r}`));
31
- }
32
- else {
33
- lines.push("No policy infractions triggered.");
34
- }
35
- lines.push("\nAction:");
36
- lines.push(report.recommendedAction);
37
- return lines.join("\n");
1
+ //#region src/halal-core/report/formatTerminalReport.ts
2
+ function formatTerminalReport(report) {
3
+ const lines = [];
4
+ if (report.status === "blocked") lines.push("\x1B[31m\x1B[1mResux Halal Core blocked this project.\x1B[0m\n");
5
+ else if (report.status === "review_required") lines.push("\x1B[33m\x1B[1mResux Halal Core review required for this project.\x1B[0m\n");
6
+ else if (report.status === "warning") lines.push("\x1B[33mResux Halal Core warning issue.\x1B[0m\n");
7
+ else lines.push("\x1B[32mResux Halal Core checks passed successfully.\x1B[0m\n");
8
+ lines.push(`Status: ${report.status}`);
9
+ lines.push(`Risk Level: ${report.riskLevel}`);
10
+ lines.push(`Category: ${report.categories.join(", ") || "none"}`);
11
+ lines.push(`Confidence: ${(report.confidence * 100).toFixed(0)}%`);
12
+ if (report.matchedFiles.length > 0) {
13
+ lines.push("\nDetected:");
14
+ report.matchedFiles.slice(0, 10).forEach((file) => {
15
+ lines.push(`- ${file}`);
16
+ });
17
+ if (report.matchedFiles.length > 10) lines.push(`- ...and ${report.matchedFiles.length - 10} more files`);
18
+ }
19
+ lines.push("\nReason:");
20
+ if (report.reasons.length > 0) report.reasons.forEach((r) => lines.push(`- ${r}`));
21
+ else lines.push("No policy infractions triggered.");
22
+ lines.push("\nAction:");
23
+ lines.push(report.recommendedAction);
24
+ return lines.join("\n");
38
25
  }
26
+ //#endregion
27
+ export { formatTerminalReport };
28
+
39
29
  //# sourceMappingURL=formatTerminalReport.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatTerminalReport.js","sourceRoot":"","sources":["../../../src/halal-core/report/formatTerminalReport.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,oBAAoB,CAAC,MAAwB;IAC3D,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAChC,KAAK,CAAC,IAAI,CAAC,gEAAgE,CAAC,CAAC;IAC/E,CAAC;SAAM,IAAI,MAAM,CAAC,MAAM,KAAK,iBAAiB,EAAE,CAAC;QAC/C,KAAK,CAAC,IAAI,CAAC,4EAA4E,CAAC,CAAC;IAC3F,CAAC;SAAM,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QACvC,KAAK,CAAC,IAAI,CAAC,kDAAkD,CAAC,CAAC;IACjE,CAAC;SAAM,CAAC;QACN,KAAK,CAAC,IAAI,CAAC,+DAA+D,CAAC,CAAC;IAC9E,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,WAAW,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IACvC,KAAK,CAAC,IAAI,CAAC,eAAe,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;IAC9C,KAAK,CAAC,IAAI,CAAC,aAAa,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC;IAClE,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,UAAU,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAEnE,IAAI,MAAM,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACnC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC1B,MAAM,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC9C,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;QACH,IAAI,MAAM,CAAC,YAAY,CAAC,MAAM,GAAG,EAAE,EAAE,CAAC;YACpC,KAAK,CAAC,IAAI,CAAC,YAAY,MAAM,CAAC,YAAY,CAAC,MAAM,GAAG,EAAE,aAAa,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACxB,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;IACpD,CAAC;SAAM,CAAC;QACN,KAAK,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;IACjD,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACxB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAErC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
1
+ {"version":3,"file":"formatTerminalReport.js","names":[],"sources":["../../../src/halal-core/report/formatTerminalReport.ts"],"sourcesContent":["import type { HalalCheckResult } from \"../status.js\";\n\nexport function formatTerminalReport(report: HalalCheckResult): string {\n const lines: string[] = [];\n\n if (report.status === \"blocked\") {\n lines.push(\"\\x1b[31m\\x1b[1mResux Halal Core blocked this project.\\x1b[0m\\n\");\n } else if (report.status === \"review_required\") {\n lines.push(\"\\x1b[33m\\x1b[1mResux Halal Core review required for this project.\\x1b[0m\\n\");\n } else if (report.status === \"warning\") {\n lines.push(\"\\x1b[33mResux Halal Core warning issue.\\x1b[0m\\n\");\n } else {\n lines.push(\"\\x1b[32mResux Halal Core checks passed successfully.\\x1b[0m\\n\");\n }\n\n lines.push(`Status: ${report.status}`);\n lines.push(`Risk Level: ${report.riskLevel}`);\n lines.push(`Category: ${report.categories.join(\", \") || \"none\"}`);\n lines.push(`Confidence: ${(report.confidence * 100).toFixed(0)}%`);\n \n if (report.matchedFiles.length > 0) {\n lines.push(\"\\nDetected:\");\n report.matchedFiles.slice(0, 10).forEach(file => {\n lines.push(`- ${file}`);\n });\n if (report.matchedFiles.length > 10) {\n lines.push(`- ...and ${report.matchedFiles.length - 10} more files`);\n }\n }\n\n lines.push(\"\\nReason:\");\n if (report.reasons.length > 0) {\n report.reasons.forEach(r => lines.push(`- ${r}`));\n } else {\n lines.push(\"No policy infractions triggered.\");\n }\n\n lines.push(\"\\nAction:\");\n lines.push(report.recommendedAction);\n\n return lines.join(\"\\n\");\n}\n"],"mappings":";AAEA,SAAgB,qBAAqB,QAAkC;CACrE,MAAM,QAAkB,CAAC;CAEzB,IAAI,OAAO,WAAW,WACpB,MAAM,KAAK,gEAAgE;MACtE,IAAI,OAAO,WAAW,mBAC3B,MAAM,KAAK,4EAA4E;MAClF,IAAI,OAAO,WAAW,WAC3B,MAAM,KAAK,kDAAkD;MAE7D,MAAM,KAAK,+DAA+D;CAG5E,MAAM,KAAK,WAAW,OAAO,QAAQ;CACrC,MAAM,KAAK,eAAe,OAAO,WAAW;CAC5C,MAAM,KAAK,aAAa,OAAO,WAAW,KAAK,IAAI,KAAK,QAAQ;CAChE,MAAM,KAAK,gBAAgB,OAAO,aAAa,IAAA,CAAK,QAAQ,CAAC,EAAE,EAAE;CAEjE,IAAI,OAAO,aAAa,SAAS,GAAG;EAClC,MAAM,KAAK,aAAa;EACxB,OAAO,aAAa,MAAM,GAAG,EAAE,CAAC,CAAC,SAAQ,SAAQ;GAC/C,MAAM,KAAK,KAAK,MAAM;EACxB,CAAC;EACD,IAAI,OAAO,aAAa,SAAS,IAC/B,MAAM,KAAK,YAAY,OAAO,aAAa,SAAS,GAAG,YAAY;CAEvE;CAEA,MAAM,KAAK,WAAW;CACtB,IAAI,OAAO,QAAQ,SAAS,GAC1B,OAAO,QAAQ,SAAQ,MAAK,MAAM,KAAK,KAAK,GAAG,CAAC;MAEhD,MAAM,KAAK,kCAAkC;CAG/C,MAAM,KAAK,WAAW;CACtB,MAAM,KAAK,OAAO,iBAAiB;CAEnC,OAAO,MAAM,KAAK,IAAI;AACxB"}
@@ -1,7 +1,10 @@
1
- import type { HalalCheckResult } from "../status.js";
2
- import type { ResuxHalalPolicy } from "../config.js";
1
+ import { HalalCheckResult } from "../status.js";
2
+ import { ResuxHalalPolicy } from "../config.js";
3
+ //#region src/halal-core/report/generateHalalReport.d.ts
3
4
  export interface GenerateHalalReportOptions {
4
- requireAuthenticated?: boolean;
5
- signingSecret?: string;
5
+ requireAuthenticated?: boolean;
6
+ signingSecret?: string;
6
7
  }
7
8
  export declare function generateHalalReport(scannedData: any, policy: ResuxHalalPolicy, outDir: string, options?: GenerateHalalReportOptions): HalalCheckResult;
9
+ //#endregion
10
+ //# sourceMappingURL=generateHalalReport.d.ts.map
@@ -1,28 +1,25 @@
1
- import { existsSync, writeFileSync, mkdirSync } from "node:fs";
2
- import path from "node:path";
3
1
  import { evaluateRules } from "../rules/defaultBlockedRules.js";
4
- import { generateReportChecksum, generateReportSignature, } from "./signReport.js";
5
- export function generateHalalReport(scannedData, policy, outDir, options = {}) {
6
- const baseReport = evaluateRules(scannedData, policy);
7
- const createdDate = new Date().toISOString();
8
- const reportToSign = {
9
- ...baseReport,
10
- createdDate,
11
- };
12
- const signature = options.requireAuthenticated === true
13
- ? generateReportSignature(reportToSign, options.signingSecret)
14
- : generateReportChecksum(reportToSign);
15
- const finalReport = {
16
- ...reportToSign,
17
- signature,
18
- };
19
- if (!existsSync(outDir)) {
20
- mkdirSync(outDir, { recursive: true });
21
- }
22
- const reportPath = path.join(outDir, "halal-report.json");
23
- writeFileSync(reportPath, JSON.stringify(finalReport, null, 2), "utf8");
24
- const mdPath = path.join(outDir, "halal-report.md");
25
- const mdContent = `
2
+ import { generateReportChecksum, generateReportSignature } from "./signReport.js";
3
+ import { existsSync, mkdirSync, writeFileSync } from "node:fs";
4
+ import path from "node:path";
5
+ //#region src/halal-core/report/generateHalalReport.ts
6
+ function generateHalalReport(scannedData, policy, outDir, options = {}) {
7
+ const baseReport = evaluateRules(scannedData, policy);
8
+ const createdDate = (/* @__PURE__ */ new Date()).toISOString();
9
+ const reportToSign = {
10
+ ...baseReport,
11
+ createdDate
12
+ };
13
+ const signature = options.requireAuthenticated === true ? generateReportSignature(reportToSign, options.signingSecret) : generateReportChecksum(reportToSign);
14
+ const finalReport = {
15
+ ...reportToSign,
16
+ signature
17
+ };
18
+ if (!existsSync(outDir)) mkdirSync(outDir, { recursive: true });
19
+ const reportPath = path.join(outDir, "halal-report.json");
20
+ writeFileSync(reportPath, JSON.stringify(finalReport, null, 2), "utf8");
21
+ const mdPath = path.join(outDir, "halal-report.md");
22
+ const mdContent = `
26
23
  # ResuxJS Halal Core Security Report
27
24
 
28
25
  - **Generated At**: ${createdDate}
@@ -40,7 +37,10 @@ ${finalReport.reasons.map((reason) => `- ${reason}`).join("\n") || "No warning e
40
37
  ## Action Required
41
38
  ${finalReport.recommendedAction}
42
39
  `.trim();
43
- writeFileSync(mdPath, mdContent, "utf8");
44
- return finalReport;
40
+ writeFileSync(mdPath, mdContent, "utf8");
41
+ return finalReport;
45
42
  }
43
+ //#endregion
44
+ export { generateHalalReport };
45
+
46
46
  //# sourceMappingURL=generateHalalReport.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"generateHalalReport.js","sourceRoot":"","sources":["../../../src/halal-core/report/generateHalalReport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EACL,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AASzB,MAAM,UAAU,mBAAmB,CACjC,WAAgB,EAChB,MAAwB,EACxB,MAAc,EACd,UAAsC,EAAE;IAExC,MAAM,UAAU,GAAG,aAAa,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAEtD,MAAM,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC7C,MAAM,YAAY,GAAwC;QACxD,GAAG,UAAU;QACb,WAAW;KACZ,CAAC;IAEF,MAAM,SAAS,GAAG,OAAO,CAAC,oBAAoB,KAAK,IAAI;QACrD,CAAC,CAAC,uBAAuB,CAAC,YAAY,EAAE,OAAO,CAAC,aAAa,CAAC;QAC9D,CAAC,CAAC,sBAAsB,CAAC,YAAY,CAAC,CAAC;IACzC,MAAM,WAAW,GAAqB;QACpC,GAAG,YAAY;QACf,SAAS;KACV,CAAC;IAEF,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QACxB,SAAS,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAC1D,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAExE,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACpD,MAAM,SAAS,GAAG;;;sBAGE,WAAW;4BACL,WAAW,CAAC,MAAM,CAAC,WAAW,EAAE;sBACtC,WAAW,CAAC,SAAS,CAAC,WAAW,EAAE;oBACrC,CAAC,WAAW,CAAC,UAAU,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;qBACxC,SAAS;;;EAG5B,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,KAAK,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,gCAAgC;;;EAGxG,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,8BAA8B;;;EAG/F,WAAW,CAAC,iBAAiB;GAC5B,CAAC,IAAI,EAAE,CAAC;IAET,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAEzC,OAAO,WAAW,CAAC;AACrB,CAAC"}
1
+ {"version":3,"file":"generateHalalReport.js","names":[],"sources":["../../../src/halal-core/report/generateHalalReport.ts"],"sourcesContent":["import { existsSync, writeFileSync, mkdirSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { evaluateRules } from \"../rules/defaultBlockedRules.js\";\nimport {\n generateReportChecksum,\n generateReportSignature,\n} from \"./signReport.js\";\nimport type { HalalCheckResult } from \"../status.js\";\nimport type { ResuxHalalPolicy } from \"../config.js\";\n\nexport interface GenerateHalalReportOptions {\n requireAuthenticated?: boolean;\n signingSecret?: string;\n}\n\nexport function generateHalalReport(\n scannedData: any,\n policy: ResuxHalalPolicy,\n outDir: string,\n options: GenerateHalalReportOptions = {},\n): HalalCheckResult {\n const baseReport = evaluateRules(scannedData, policy);\n\n const createdDate = new Date().toISOString();\n const reportToSign: Omit<HalalCheckResult, \"signature\"> = {\n ...baseReport,\n createdDate,\n };\n\n const signature = options.requireAuthenticated === true\n ? generateReportSignature(reportToSign, options.signingSecret)\n : generateReportChecksum(reportToSign);\n const finalReport: HalalCheckResult = {\n ...reportToSign,\n signature,\n };\n\n if (!existsSync(outDir)) {\n mkdirSync(outDir, { recursive: true });\n }\n\n const reportPath = path.join(outDir, \"halal-report.json\");\n writeFileSync(reportPath, JSON.stringify(finalReport, null, 2), \"utf8\");\n\n const mdPath = path.join(outDir, \"halal-report.md\");\n const mdContent = `\n# ResuxJS Halal Core Security Report\n\n- **Generated At**: ${createdDate}\n- **Framework Status**: **${finalReport.status.toUpperCase()}**\n- **Risk Level**: **${finalReport.riskLevel.toUpperCase()}**\n- **Confidence**: ${(finalReport.confidence * 100).toFixed(0)}%\n- **Signature**: \\`${signature}\\`\n\n## Categories Detected\n${finalReport.categories.map((category) => `- ${category}`).join(\"\\n\") || \"No policy categories violated.\"}\n\n## Reasons\n${finalReport.reasons.map((reason) => `- ${reason}`).join(\"\\n\") || \"No warning elements flagged.\"}\n\n## Action Required\n${finalReport.recommendedAction}\n `.trim();\n\n writeFileSync(mdPath, mdContent, \"utf8\");\n\n return finalReport;\n}\n"],"mappings":";;;;;AAeA,SAAgB,oBACd,aACA,QACA,QACA,UAAsC,CAAC,GACrB;CAClB,MAAM,aAAa,cAAc,aAAa,MAAM;CAEpD,MAAM,+BAAc,IAAI,KAAK,EAAA,CAAE,YAAY;CAC3C,MAAM,eAAoD;EACxD,GAAG;EACH;CACF;CAEA,MAAM,YAAY,QAAQ,yBAAyB,OAC/C,wBAAwB,cAAc,QAAQ,aAAa,IAC3D,uBAAuB,YAAY;CACvC,MAAM,cAAgC;EACpC,GAAG;EACH;CACF;CAEA,IAAI,CAAC,WAAW,MAAM,GACpB,UAAU,QAAQ,EAAE,WAAW,KAAK,CAAC;CAGvC,MAAM,aAAa,KAAK,KAAK,QAAQ,mBAAmB;CACxD,cAAc,YAAY,KAAK,UAAU,aAAa,MAAM,CAAC,GAAG,MAAM;CAEtE,MAAM,SAAS,KAAK,KAAK,QAAQ,iBAAiB;CAClD,MAAM,YAAY;;;sBAGE,YAAY;4BACN,YAAY,OAAO,YAAY,EAAE;sBACvC,YAAY,UAAU,YAAY,EAAE;qBACrC,YAAY,aAAa,IAAA,CAAK,QAAQ,CAAC,EAAE;qBACzC,UAAU;;;EAG7B,YAAY,WAAW,KAAK,aAAa,KAAK,UAAU,CAAC,CAAC,KAAK,IAAI,KAAK,iCAAiC;;;EAGzG,YAAY,QAAQ,KAAK,WAAW,KAAK,QAAQ,CAAC,CAAC,KAAK,IAAI,KAAK,+BAA+B;;;EAGhG,YAAY,kBAAkB;IAC5B,KAAK;CAEP,cAAc,QAAQ,WAAW,MAAM;CAEvC,OAAO;AACT"}
@@ -1,3 +1,6 @@
1
- import type { HalalCheckResult } from "../status.js";
1
+ import { HalalCheckResult } from "../status.js";
2
+ //#region src/halal-core/report/signReport.d.ts
2
3
  export declare function generateReportSignature(report: Omit<HalalCheckResult, "signature">, secret?: string): string;
3
4
  export declare function generateReportChecksum(report: Omit<HalalCheckResult, "signature">): string;
5
+ //#endregion
6
+ //# sourceMappingURL=signReport.d.ts.map
@@ -1,17 +1,21 @@
1
1
  import { createIntegritySignature } from "../crypto/integrity.js";
2
+ //#region src/halal-core/report/signReport.ts
2
3
  const REPORT_SIGNING_ENV = "RESUX_HALAL_REPORT_SIGNING_SECRET";
3
- export function generateReportSignature(report, secret) {
4
- return createIntegritySignature(report, {
5
- envName: REPORT_SIGNING_ENV,
6
- secret,
7
- requireSecret: true,
8
- });
4
+ function generateReportSignature(report, secret) {
5
+ return createIntegritySignature(report, {
6
+ envName: REPORT_SIGNING_ENV,
7
+ secret,
8
+ requireSecret: true
9
+ });
9
10
  }
10
- export function generateReportChecksum(report) {
11
- return createIntegritySignature(report, {
12
- envName: REPORT_SIGNING_ENV,
13
- secret: "",
14
- requireSecret: false,
15
- });
11
+ function generateReportChecksum(report) {
12
+ return createIntegritySignature(report, {
13
+ envName: REPORT_SIGNING_ENV,
14
+ secret: "",
15
+ requireSecret: false
16
+ });
16
17
  }
18
+ //#endregion
19
+ export { generateReportChecksum, generateReportSignature };
20
+
17
21
  //# sourceMappingURL=signReport.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"signReport.js","sourceRoot":"","sources":["../../../src/halal-core/report/signReport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAElE,MAAM,kBAAkB,GAAG,mCAAmC,CAAC;AAE/D,MAAM,UAAU,uBAAuB,CACrC,MAA2C,EAC3C,MAAe;IAEf,OAAO,wBAAwB,CAAC,MAAM,EAAE;QACtC,OAAO,EAAE,kBAAkB;QAC3B,MAAM;QACN,aAAa,EAAE,IAAI;KACpB,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,MAA2C;IAE3C,OAAO,wBAAwB,CAAC,MAAM,EAAE;QACtC,OAAO,EAAE,kBAAkB;QAC3B,MAAM,EAAE,EAAE;QACV,aAAa,EAAE,KAAK;KACrB,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"signReport.js","names":[],"sources":["../../../src/halal-core/report/signReport.ts"],"sourcesContent":["import type { HalalCheckResult } from \"../status.js\";\nimport { createIntegritySignature } from \"../crypto/integrity.js\";\n\nconst REPORT_SIGNING_ENV = \"RESUX_HALAL_REPORT_SIGNING_SECRET\";\n\nexport function generateReportSignature(\n report: Omit<HalalCheckResult, \"signature\">,\n secret?: string,\n): string {\n return createIntegritySignature(report, {\n envName: REPORT_SIGNING_ENV,\n secret,\n requireSecret: true,\n });\n}\n\nexport function generateReportChecksum(\n report: Omit<HalalCheckResult, \"signature\">,\n): string {\n return createIntegritySignature(report, {\n envName: REPORT_SIGNING_ENV,\n secret: \"\",\n requireSecret: false,\n });\n}\n"],"mappings":";;AAGA,MAAM,qBAAqB;AAE3B,SAAgB,wBACd,QACA,QACQ;CACR,OAAO,yBAAyB,QAAQ;EACtC,SAAS;EACT;EACA,eAAe;CACjB,CAAC;AACH;AAEA,SAAgB,uBACd,QACQ;CACR,OAAO,yBAAyB,QAAQ;EACtC,SAAS;EACT,QAAQ;EACR,eAAe;CACjB,CAAC;AACH"}
@@ -1,11 +1,14 @@
1
- import type { HalalCheckResult } from "../status.js";
1
+ import { HalalCheckResult } from "../status.js";
2
+ //#region src/halal-core/report/verifyReport.d.ts
2
3
  export interface ReportVerificationOptions {
3
- secret?: string;
4
- requireAuthenticated?: boolean;
5
- now?: number;
4
+ secret?: string;
5
+ requireAuthenticated?: boolean;
6
+ now?: number;
6
7
  }
7
8
  export declare function verifyReportSignature(report: HalalCheckResult, options?: ReportVerificationOptions): boolean;
8
9
  export declare function isReportValid(report: HalalCheckResult, options?: ReportVerificationOptions): {
9
- valid: boolean;
10
- reason?: string;
10
+ valid: boolean;
11
+ reason?: string;
11
12
  };
13
+ //#endregion
14
+ //# sourceMappingURL=verifyReport.d.ts.map
@@ -1,45 +1,55 @@
1
- import { isAuthenticatedIntegritySignature, verifyIntegritySignature, } from "../crypto/integrity.js";
1
+ import { isAuthenticatedIntegritySignature, verifyIntegritySignature } from "../crypto/integrity.js";
2
+ //#region src/halal-core/report/verifyReport.ts
2
3
  const REPORT_SIGNING_ENV = "RESUX_HALAL_REPORT_SIGNING_SECRET";
3
- const REPORT_MAX_AGE_MS = 30 * 24 * 60 * 60 * 1000;
4
- const MAX_CLOCK_SKEW_MS = 5 * 60 * 1000;
5
- export function verifyReportSignature(report, options = {}) {
6
- if (!report || typeof report !== "object" || !report.signature) {
7
- return false;
8
- }
9
- const { signature, ...rest } = report;
10
- return verifyIntegritySignature(rest, signature, {
11
- envName: REPORT_SIGNING_ENV,
12
- secret: options.secret,
13
- requireSecret: options.requireAuthenticated === true,
14
- });
4
+ const REPORT_MAX_AGE_MS = 2592e6;
5
+ const MAX_CLOCK_SKEW_MS = 3e5;
6
+ function verifyReportSignature(report, options = {}) {
7
+ if (!report || typeof report !== "object" || !report.signature) return false;
8
+ const { signature, ...rest } = report;
9
+ return verifyIntegritySignature(rest, signature, {
10
+ envName: REPORT_SIGNING_ENV,
11
+ secret: options.secret,
12
+ requireSecret: options.requireAuthenticated === true
13
+ });
15
14
  }
16
- export function isReportValid(report, options = {}) {
17
- if (!report || typeof report !== "object") {
18
- return { valid: false, reason: "No report provided." };
19
- }
20
- if (!verifyReportSignature(report, options)) {
21
- return { valid: false, reason: "Report integrity check is invalid or the report has been modified." };
22
- }
23
- if (options.requireAuthenticated === true && !isAuthenticatedIntegritySignature(report.signature)) {
24
- return { valid: false, reason: "Report requires an authenticated HMAC signature." };
25
- }
26
- if (report.status === "blocked") {
27
- return { valid: false, reason: `Project is blocked: ${report.reasons.join(", ")}` };
28
- }
29
- if (typeof report.createdDate !== "string" || !report.createdDate.trim()) {
30
- return { valid: false, reason: "Report creation date is missing." };
31
- }
32
- const createdAt = Date.parse(report.createdDate);
33
- if (!Number.isFinite(createdAt)) {
34
- return { valid: false, reason: "Report creation date is invalid." };
35
- }
36
- const now = options.now ?? Date.now();
37
- if (createdAt > now + MAX_CLOCK_SKEW_MS) {
38
- return { valid: false, reason: "Report creation date is unexpectedly in the future." };
39
- }
40
- if (now - createdAt > REPORT_MAX_AGE_MS) {
41
- return { valid: false, reason: "Report has expired (must be re-generated within 30 days)." };
42
- }
43
- return { valid: true };
15
+ function isReportValid(report, options = {}) {
16
+ if (!report || typeof report !== "object") return {
17
+ valid: false,
18
+ reason: "No report provided."
19
+ };
20
+ if (!verifyReportSignature(report, options)) return {
21
+ valid: false,
22
+ reason: "Report integrity check is invalid or the report has been modified."
23
+ };
24
+ if (options.requireAuthenticated === true && !isAuthenticatedIntegritySignature(report.signature)) return {
25
+ valid: false,
26
+ reason: "Report requires an authenticated HMAC signature."
27
+ };
28
+ if (report.status === "blocked") return {
29
+ valid: false,
30
+ reason: `Project is blocked: ${report.reasons.join(", ")}`
31
+ };
32
+ if (typeof report.createdDate !== "string" || !report.createdDate.trim()) return {
33
+ valid: false,
34
+ reason: "Report creation date is missing."
35
+ };
36
+ const createdAt = Date.parse(report.createdDate);
37
+ if (!Number.isFinite(createdAt)) return {
38
+ valid: false,
39
+ reason: "Report creation date is invalid."
40
+ };
41
+ const now = options.now ?? Date.now();
42
+ if (createdAt > now + MAX_CLOCK_SKEW_MS) return {
43
+ valid: false,
44
+ reason: "Report creation date is unexpectedly in the future."
45
+ };
46
+ if (now - createdAt > REPORT_MAX_AGE_MS) return {
47
+ valid: false,
48
+ reason: "Report has expired (must be re-generated within 30 days)."
49
+ };
50
+ return { valid: true };
44
51
  }
52
+ //#endregion
53
+ export { isReportValid, verifyReportSignature };
54
+
45
55
  //# sourceMappingURL=verifyReport.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"verifyReport.js","sourceRoot":"","sources":["../../../src/halal-core/report/verifyReport.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iCAAiC,EACjC,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,kBAAkB,GAAG,mCAAmC,CAAC;AAC/D,MAAM,iBAAiB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AACnD,MAAM,iBAAiB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAQxC,MAAM,UAAU,qBAAqB,CACnC,MAAwB,EACxB,UAAqC,EAAE;IAEvC,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;QAC/D,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;IACtC,OAAO,wBAAwB,CAAC,IAAI,EAAE,SAAS,EAAE;QAC/C,OAAO,EAAE,kBAAkB;QAC3B,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,aAAa,EAAE,OAAO,CAAC,oBAAoB,KAAK,IAAI;KACrD,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,aAAa,CAC3B,MAAwB,EACxB,UAAqC,EAAE;IAEvC,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC1C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE,CAAC;IACzD,CAAC;IAED,IAAI,CAAC,qBAAqB,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;QAC5C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,oEAAoE,EAAE,CAAC;IACxG,CAAC;IAED,IAAI,OAAO,CAAC,oBAAoB,KAAK,IAAI,IAAI,CAAC,iCAAiC,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;QAClG,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,kDAAkD,EAAE,CAAC;IACtF,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,uBAAuB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;IACtF,CAAC;IAED,IAAI,OAAO,MAAM,CAAC,WAAW,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,EAAE,CAAC;QACzE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,kCAAkC,EAAE,CAAC;IACtE,CAAC;IAED,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACjD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QAChC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,kCAAkC,EAAE,CAAC;IACtE,CAAC;IAED,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;IACtC,IAAI,SAAS,GAAG,GAAG,GAAG,iBAAiB,EAAE,CAAC;QACxC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,qDAAqD,EAAE,CAAC;IACzF,CAAC;IACD,IAAI,GAAG,GAAG,SAAS,GAAG,iBAAiB,EAAE,CAAC;QACxC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,2DAA2D,EAAE,CAAC;IAC/F,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AACzB,CAAC"}
1
+ {"version":3,"file":"verifyReport.js","names":[],"sources":["../../../src/halal-core/report/verifyReport.ts"],"sourcesContent":["import type { HalalCheckResult } from \"../status.js\";\nimport {\n isAuthenticatedIntegritySignature,\n verifyIntegritySignature,\n} from \"../crypto/integrity.js\";\n\nconst REPORT_SIGNING_ENV = \"RESUX_HALAL_REPORT_SIGNING_SECRET\";\nconst REPORT_MAX_AGE_MS = 30 * 24 * 60 * 60 * 1000;\nconst MAX_CLOCK_SKEW_MS = 5 * 60 * 1000;\n\nexport interface ReportVerificationOptions {\n secret?: string;\n requireAuthenticated?: boolean;\n now?: number;\n}\n\nexport function verifyReportSignature(\n report: HalalCheckResult,\n options: ReportVerificationOptions = {},\n): boolean {\n if (!report || typeof report !== \"object\" || !report.signature) {\n return false;\n }\n\n const { signature, ...rest } = report;\n return verifyIntegritySignature(rest, signature, {\n envName: REPORT_SIGNING_ENV,\n secret: options.secret,\n requireSecret: options.requireAuthenticated === true,\n });\n}\n\nexport function isReportValid(\n report: HalalCheckResult,\n options: ReportVerificationOptions = {},\n): { valid: boolean; reason?: string } {\n if (!report || typeof report !== \"object\") {\n return { valid: false, reason: \"No report provided.\" };\n }\n\n if (!verifyReportSignature(report, options)) {\n return { valid: false, reason: \"Report integrity check is invalid or the report has been modified.\" };\n }\n\n if (options.requireAuthenticated === true && !isAuthenticatedIntegritySignature(report.signature)) {\n return { valid: false, reason: \"Report requires an authenticated HMAC signature.\" };\n }\n\n if (report.status === \"blocked\") {\n return { valid: false, reason: `Project is blocked: ${report.reasons.join(\", \")}` };\n }\n\n if (typeof report.createdDate !== \"string\" || !report.createdDate.trim()) {\n return { valid: false, reason: \"Report creation date is missing.\" };\n }\n\n const createdAt = Date.parse(report.createdDate);\n if (!Number.isFinite(createdAt)) {\n return { valid: false, reason: \"Report creation date is invalid.\" };\n }\n\n const now = options.now ?? Date.now();\n if (createdAt > now + MAX_CLOCK_SKEW_MS) {\n return { valid: false, reason: \"Report creation date is unexpectedly in the future.\" };\n }\n if (now - createdAt > REPORT_MAX_AGE_MS) {\n return { valid: false, reason: \"Report has expired (must be re-generated within 30 days).\" };\n }\n\n return { valid: true };\n}\n"],"mappings":";;AAMA,MAAM,qBAAqB;AAC3B,MAAM,oBAAoB;AAC1B,MAAM,oBAAoB;AAQ1B,SAAgB,sBACd,QACA,UAAqC,CAAC,GAC7B;CACT,IAAI,CAAC,UAAU,OAAO,WAAW,YAAY,CAAC,OAAO,WACnD,OAAO;CAGT,MAAM,EAAE,WAAW,GAAG,SAAS;CAC/B,OAAO,yBAAyB,MAAM,WAAW;EAC/C,SAAS;EACT,QAAQ,QAAQ;EAChB,eAAe,QAAQ,yBAAyB;CAClD,CAAC;AACH;AAEA,SAAgB,cACd,QACA,UAAqC,CAAC,GACD;CACrC,IAAI,CAAC,UAAU,OAAO,WAAW,UAC/B,OAAO;EAAE,OAAO;EAAO,QAAQ;CAAsB;CAGvD,IAAI,CAAC,sBAAsB,QAAQ,OAAO,GACxC,OAAO;EAAE,OAAO;EAAO,QAAQ;CAAqE;CAGtG,IAAI,QAAQ,yBAAyB,QAAQ,CAAC,kCAAkC,OAAO,SAAS,GAC9F,OAAO;EAAE,OAAO;EAAO,QAAQ;CAAmD;CAGpF,IAAI,OAAO,WAAW,WACpB,OAAO;EAAE,OAAO;EAAO,QAAQ,uBAAuB,OAAO,QAAQ,KAAK,IAAI;CAAI;CAGpF,IAAI,OAAO,OAAO,gBAAgB,YAAY,CAAC,OAAO,YAAY,KAAK,GACrE,OAAO;EAAE,OAAO;EAAO,QAAQ;CAAmC;CAGpE,MAAM,YAAY,KAAK,MAAM,OAAO,WAAW;CAC/C,IAAI,CAAC,OAAO,SAAS,SAAS,GAC5B,OAAO;EAAE,OAAO;EAAO,QAAQ;CAAmC;CAGpE,MAAM,MAAM,QAAQ,OAAO,KAAK,IAAI;CACpC,IAAI,YAAY,MAAM,mBACpB,OAAO;EAAE,OAAO;EAAO,QAAQ;CAAsD;CAEvF,IAAI,MAAM,YAAY,mBACpB,OAAO;EAAE,OAAO;EAAO,QAAQ;CAA4D;CAG7F,OAAO,EAAE,OAAO,KAAK;AACvB"}
@@ -1,2 +1,5 @@
1
- import type { ResuxHalalPolicy } from "../config.js";
1
+ import { ResuxHalalPolicy } from "../config.js";
2
+ //#region src/halal-core/review/createReviewRequest.d.ts
2
3
  export declare function createReviewRequest(appRoot: string, policy: ResuxHalalPolicy, outDir: string): string;
4
+ //#endregion
5
+ //# sourceMappingURL=createReviewRequest.d.ts.map
@@ -1,21 +1,25 @@
1
- import { writeFileSync } from "node:fs";
2
- import path from "node:path";
3
1
  import { scanProject } from "../scanner/scanProject.js";
4
2
  import { createProjectSummary } from "../ai/createProjectSummary.js";
5
- export function createReviewRequest(appRoot, policy, outDir) {
6
- const scanned = scanProject(appRoot);
7
- const summary = createProjectSummary(scanned);
8
- const requestPayload = {
9
- projectName: policy.projectName || summary.projectName,
10
- projectType: policy.projectType || "unknown",
11
- description: policy.description || summary.projectDescription,
12
- reviewContact: policy.reviewContact || {},
13
- evidence: policy.evidence || [],
14
- projectSummary: summary,
15
- timestamp: new Date().toISOString()
16
- };
17
- const targetPath = path.join(outDir, "halal-review-request.json");
18
- writeFileSync(targetPath, JSON.stringify(requestPayload, null, 2), "utf8");
19
- return targetPath;
3
+ import { writeFileSync } from "node:fs";
4
+ import path from "node:path";
5
+ //#region src/halal-core/review/createReviewRequest.ts
6
+ function createReviewRequest(appRoot, policy, outDir) {
7
+ const scanned = scanProject(appRoot);
8
+ const summary = createProjectSummary(scanned);
9
+ const requestPayload = {
10
+ projectName: policy.projectName || summary.projectName,
11
+ projectType: policy.projectType || "unknown",
12
+ description: policy.description || summary.projectDescription,
13
+ reviewContact: policy.reviewContact || {},
14
+ evidence: policy.evidence || [],
15
+ projectSummary: summary,
16
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
17
+ };
18
+ const targetPath = path.join(outDir, "halal-review-request.json");
19
+ writeFileSync(targetPath, JSON.stringify(requestPayload, null, 2), "utf8");
20
+ return targetPath;
20
21
  }
22
+ //#endregion
23
+ export { createReviewRequest };
24
+
21
25
  //# sourceMappingURL=createReviewRequest.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createReviewRequest.js","sourceRoot":"","sources":["../../../src/halal-core/review/createReviewRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAc,MAAM,SAAS,CAAC;AACpD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAGrE,MAAM,UAAU,mBAAmB,CACjC,OAAe,EACf,MAAwB,EACxB,MAAc;IAEd,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;IACrC,MAAM,OAAO,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAE9C,MAAM,cAAc,GAAG;QACrB,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,OAAO,CAAC,WAAW;QACtD,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,SAAS;QAC5C,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,OAAO,CAAC,kBAAkB;QAC7D,aAAa,EAAE,MAAM,CAAC,aAAa,IAAI,EAAE;QACzC,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,EAAE;QAC/B,cAAc,EAAE,OAAO;QACvB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACpC,CAAC;IAEF,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAC;IAClE,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAE3E,OAAO,UAAU,CAAC;AACpB,CAAC"}
1
+ {"version":3,"file":"createReviewRequest.js","names":[],"sources":["../../../src/halal-core/review/createReviewRequest.ts"],"sourcesContent":["import { writeFileSync, existsSync } from \"node:fs\";\nimport path from \"node:path\";\nimport { scanProject } from \"../scanner/scanProject.js\";\nimport { createProjectSummary } from \"../ai/createProjectSummary.js\";\nimport type { ResuxHalalPolicy } from \"../config.js\";\n\nexport function createReviewRequest(\n appRoot: string,\n policy: ResuxHalalPolicy,\n outDir: string\n): string {\n const scanned = scanProject(appRoot);\n const summary = createProjectSummary(scanned);\n\n const requestPayload = {\n projectName: policy.projectName || summary.projectName,\n projectType: policy.projectType || \"unknown\",\n description: policy.description || summary.projectDescription,\n reviewContact: policy.reviewContact || {},\n evidence: policy.evidence || [],\n projectSummary: summary,\n timestamp: new Date().toISOString()\n };\n\n const targetPath = path.join(outDir, \"halal-review-request.json\");\n writeFileSync(targetPath, JSON.stringify(requestPayload, null, 2), \"utf8\");\n\n return targetPath;\n}\n"],"mappings":";;;;;AAMA,SAAgB,oBACd,SACA,QACA,QACQ;CACR,MAAM,UAAU,YAAY,OAAO;CACnC,MAAM,UAAU,qBAAqB,OAAO;CAE5C,MAAM,iBAAiB;EACrB,aAAa,OAAO,eAAe,QAAQ;EAC3C,aAAa,OAAO,eAAe;EACnC,aAAa,OAAO,eAAe,QAAQ;EAC3C,eAAe,OAAO,iBAAiB,CAAC;EACxC,UAAU,OAAO,YAAY,CAAC;EAC9B,gBAAgB;EAChB,4BAAW,IAAI,KAAK,EAAA,CAAE,YAAY;CACpC;CAEA,MAAM,aAAa,KAAK,KAAK,QAAQ,2BAA2B;CAChE,cAAc,YAAY,KAAK,UAAU,gBAAgB,MAAM,CAAC,GAAG,MAAM;CAEzE,OAAO;AACT"}
@@ -1,3 +1,6 @@
1
+ //#region src/halal-core/review/reviewPolicy.d.ts
1
2
  export declare const REVIEWABLE_CATEGORIES: string[];
2
3
  export declare const NON_REVIEWABLE_CATEGORIES: string[];
3
4
  export declare function isCategoryReviewable(category: string): boolean;
5
+ //#endregion
6
+ //# sourceMappingURL=reviewPolicy.d.ts.map
@@ -1,21 +1,23 @@
1
- export const REVIEWABLE_CATEGORIES = [
2
- "haram_business",
3
- "privacy_abuse",
4
- "financial_harm",
5
- "health_safety_harm",
6
- "environmental_harm",
7
- "general_harm"
1
+ //#region src/halal-core/review/reviewPolicy.ts
2
+ const REVIEWABLE_CATEGORIES = [
3
+ "haram_business",
4
+ "privacy_abuse",
5
+ "financial_harm",
6
+ "health_safety_harm",
7
+ "environmental_harm",
8
+ "general_harm"
8
9
  ];
9
- export const NON_REVIEWABLE_CATEGORIES = [
10
- "illegal_criminal",
11
- "cyber_abuse",
12
- "sexual_harm",
13
- "violence_harm"
10
+ const NON_REVIEWABLE_CATEGORIES = [
11
+ "illegal_criminal",
12
+ "cyber_abuse",
13
+ "sexual_harm",
14
+ "violence_harm"
14
15
  ];
15
- export function isCategoryReviewable(category) {
16
- if (NON_REVIEWABLE_CATEGORIES.includes(category)) {
17
- return false;
18
- }
19
- return REVIEWABLE_CATEGORIES.includes(category);
16
+ function isCategoryReviewable(category) {
17
+ if (NON_REVIEWABLE_CATEGORIES.includes(category)) return false;
18
+ return REVIEWABLE_CATEGORIES.includes(category);
20
19
  }
20
+ //#endregion
21
+ export { NON_REVIEWABLE_CATEGORIES, REVIEWABLE_CATEGORIES, isCategoryReviewable };
22
+
21
23
  //# sourceMappingURL=reviewPolicy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reviewPolicy.js","sourceRoot":"","sources":["../../../src/halal-core/review/reviewPolicy.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,gBAAgB;IAChB,eAAe;IACf,gBAAgB;IAChB,oBAAoB;IACpB,oBAAoB;IACpB,cAAc;CACf,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,kBAAkB;IAClB,aAAa;IACb,aAAa;IACb,eAAe;CAChB,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,QAAgB;IACnD,IAAI,yBAAyB,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QACjD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,qBAAqB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAClD,CAAC"}
1
+ {"version":3,"file":"reviewPolicy.js","names":[],"sources":["../../../src/halal-core/review/reviewPolicy.ts"],"sourcesContent":["export const REVIEWABLE_CATEGORIES = [\n \"haram_business\",\n \"privacy_abuse\",\n \"financial_harm\",\n \"health_safety_harm\",\n \"environmental_harm\",\n \"general_harm\"\n];\n\nexport const NON_REVIEWABLE_CATEGORIES = [\n \"illegal_criminal\",\n \"cyber_abuse\",\n \"sexual_harm\",\n \"violence_harm\"\n];\n\nexport function isCategoryReviewable(category: string): boolean {\n if (NON_REVIEWABLE_CATEGORIES.includes(category)) {\n return false;\n }\n return REVIEWABLE_CATEGORIES.includes(category);\n}\n"],"mappings":";AAAA,MAAa,wBAAwB;CACnC;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAa,4BAA4B;CACvC;CACA;CACA;CACA;AACF;AAEA,SAAgB,qBAAqB,UAA2B;CAC9D,IAAI,0BAA0B,SAAS,QAAQ,GAC7C,OAAO;CAET,OAAO,sBAAsB,SAAS,QAAQ;AAChD"}