@akasecurity/cli 0.9.14 → 0.9.15

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 (207) hide show
  1. package/dist/cli.js +762 -267
  2. package/extension/manifest.json +1 -1
  3. package/native-host/content-retention.js +184 -55
  4. package/native-host/history-sync.js +190 -61
  5. package/native-host/host.js +469 -120
  6. package/native-host/scan-worker.js +241 -34
  7. package/native-host/sync.js +91 -36
  8. package/package.json +9 -9
  9. package/web-ui/package.json +6 -6
  10. package/web-ui/packages/dashboard-ui/package.json +1 -1
  11. package/web-ui/packages/plugin-sdk/package.json +1 -1
  12. package/web-ui/packages/schema/package.json +2 -2
  13. package/web-ui/web-ui/.next/BUILD_ID +1 -1
  14. package/web-ui/web-ui/.next/app-build-manifest.json +254 -254
  15. package/web-ui/web-ui/.next/app-path-routes-manifest.json +7 -7
  16. package/web-ui/web-ui/.next/build-manifest.json +14 -14
  17. package/web-ui/web-ui/.next/prerender-manifest.json +14 -14
  18. package/web-ui/web-ui/.next/required-server-files.json +1 -1
  19. package/web-ui/web-ui/.next/server/app/(app)/activity/page.js +2 -2
  20. package/web-ui/web-ui/.next/server/app/(app)/activity/page.js.nft.json +1 -1
  21. package/web-ui/web-ui/.next/server/app/(app)/activity/page_client-reference-manifest.js +1 -1
  22. package/web-ui/web-ui/.next/server/app/(app)/data-shares/page.js +2 -2
  23. package/web-ui/web-ui/.next/server/app/(app)/data-shares/page.js.nft.json +1 -1
  24. package/web-ui/web-ui/.next/server/app/(app)/data-shares/page_client-reference-manifest.js +1 -1
  25. package/web-ui/web-ui/.next/server/app/(app)/detections/page.js +2 -2
  26. package/web-ui/web-ui/.next/server/app/(app)/detections/page.js.nft.json +1 -1
  27. package/web-ui/web-ui/.next/server/app/(app)/detections/page_client-reference-manifest.js +1 -1
  28. package/web-ui/web-ui/.next/server/app/(app)/exceptions/[id]/page.js +2 -2
  29. package/web-ui/web-ui/.next/server/app/(app)/exceptions/[id]/page.js.nft.json +1 -1
  30. package/web-ui/web-ui/.next/server/app/(app)/exceptions/[id]/page_client-reference-manifest.js +1 -1
  31. package/web-ui/web-ui/.next/server/app/(app)/exceptions/new/page.js +2 -2
  32. package/web-ui/web-ui/.next/server/app/(app)/exceptions/new/page.js.nft.json +1 -1
  33. package/web-ui/web-ui/.next/server/app/(app)/exceptions/new/page_client-reference-manifest.js +1 -1
  34. package/web-ui/web-ui/.next/server/app/(app)/exceptions/page.js +2 -2
  35. package/web-ui/web-ui/.next/server/app/(app)/exceptions/page.js.nft.json +1 -1
  36. package/web-ui/web-ui/.next/server/app/(app)/exceptions/page_client-reference-manifest.js +1 -1
  37. package/web-ui/web-ui/.next/server/app/(app)/findings/page.js +2 -2
  38. package/web-ui/web-ui/.next/server/app/(app)/findings/page.js.nft.json +1 -1
  39. package/web-ui/web-ui/.next/server/app/(app)/findings/page_client-reference-manifest.js +1 -1
  40. package/web-ui/web-ui/.next/server/app/(app)/inventory/page.js +2 -2
  41. package/web-ui/web-ui/.next/server/app/(app)/inventory/page.js.nft.json +1 -1
  42. package/web-ui/web-ui/.next/server/app/(app)/inventory/page_client-reference-manifest.js +1 -1
  43. package/web-ui/web-ui/.next/server/app/(app)/policies/page.js +2 -2
  44. package/web-ui/web-ui/.next/server/app/(app)/policies/page.js.nft.json +1 -1
  45. package/web-ui/web-ui/.next/server/app/(app)/policies/page_client-reference-manifest.js +1 -1
  46. package/web-ui/web-ui/.next/server/app/(app)/scan/page.js +3 -3
  47. package/web-ui/web-ui/.next/server/app/(app)/scan/page.js.nft.json +1 -1
  48. package/web-ui/web-ui/.next/server/app/(app)/scan/page_client-reference-manifest.js +1 -1
  49. package/web-ui/web-ui/.next/server/app/(app)/security/page.js +2 -2
  50. package/web-ui/web-ui/.next/server/app/(app)/security/page.js.nft.json +1 -1
  51. package/web-ui/web-ui/.next/server/app/(app)/security/page_client-reference-manifest.js +1 -1
  52. package/web-ui/web-ui/.next/server/app/(app)/settings/page.js +2 -2
  53. package/web-ui/web-ui/.next/server/app/(app)/settings/page.js.nft.json +1 -1
  54. package/web-ui/web-ui/.next/server/app/(app)/settings/page_client-reference-manifest.js +1 -1
  55. package/web-ui/web-ui/.next/server/app/(app)/updates/page.js +2 -2
  56. package/web-ui/web-ui/.next/server/app/(app)/updates/page.js.nft.json +1 -1
  57. package/web-ui/web-ui/.next/server/app/(app)/updates/page_client-reference-manifest.js +1 -1
  58. package/web-ui/web-ui/.next/server/app/(app)/vault/page.js +2 -2
  59. package/web-ui/web-ui/.next/server/app/(app)/vault/page.js.nft.json +1 -1
  60. package/web-ui/web-ui/.next/server/app/(app)/vault/page_client-reference-manifest.js +1 -1
  61. package/web-ui/web-ui/.next/server/app/_not-found/page.js +2 -2
  62. package/web-ui/web-ui/.next/server/app/_not-found/page.js.nft.json +1 -1
  63. package/web-ui/web-ui/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  64. package/web-ui/web-ui/.next/server/app/_not-found.html +1 -1
  65. package/web-ui/web-ui/.next/server/app/_not-found.rsc +10 -10
  66. package/web-ui/web-ui/.next/server/app/icon.svg/route.js +1 -1
  67. package/web-ui/web-ui/.next/server/app/icon.svg/route.js.nft.json +1 -1
  68. package/web-ui/web-ui/.next/server/app/index.html +1 -1
  69. package/web-ui/web-ui/.next/server/app/index.rsc +10 -10
  70. package/web-ui/web-ui/.next/server/app/page.js +2 -2
  71. package/web-ui/web-ui/.next/server/app/page.js.nft.json +1 -1
  72. package/web-ui/web-ui/.next/server/app/page_client-reference-manifest.js +1 -1
  73. package/web-ui/web-ui/.next/server/app-paths-manifest.json +7 -7
  74. package/web-ui/web-ui/.next/server/chunks/184.js +1039 -0
  75. package/web-ui/web-ui/.next/server/chunks/245.js +11 -0
  76. package/web-ui/web-ui/.next/server/chunks/{670.js → 250.js} +1 -1
  77. package/web-ui/web-ui/.next/server/chunks/491.js +1 -0
  78. package/web-ui/web-ui/.next/server/chunks/51.js +1 -0
  79. package/web-ui/web-ui/.next/server/chunks/511.js +66 -0
  80. package/web-ui/web-ui/.next/server/chunks/537.js +1 -0
  81. package/web-ui/web-ui/.next/server/chunks/{74.js → 586.js} +55 -38
  82. package/web-ui/web-ui/.next/server/chunks/643.js +6 -0
  83. package/web-ui/web-ui/.next/server/chunks/660.js +109 -0
  84. package/web-ui/web-ui/.next/server/chunks/662.js +1 -0
  85. package/web-ui/web-ui/.next/server/chunks/749.js +22 -0
  86. package/web-ui/web-ui/.next/server/chunks/756.js +6 -0
  87. package/web-ui/web-ui/.next/server/chunks/774.js +12 -0
  88. package/web-ui/web-ui/.next/server/functions-config-manifest.json +5 -5
  89. package/web-ui/web-ui/.next/server/middleware-build-manifest.js +1 -1
  90. package/web-ui/web-ui/.next/server/middleware-manifest.json +5 -5
  91. package/web-ui/web-ui/.next/server/middleware.js +2 -2
  92. package/web-ui/web-ui/.next/server/pages/404.html +1 -1
  93. package/web-ui/web-ui/.next/server/pages/500.html +1 -1
  94. package/web-ui/web-ui/.next/server/pages/_app.js +1 -1
  95. package/web-ui/web-ui/.next/server/pages/_app.js.nft.json +1 -1
  96. package/web-ui/web-ui/.next/server/pages/_document.js +1 -1
  97. package/web-ui/web-ui/.next/server/pages/_document.js.nft.json +1 -1
  98. package/web-ui/web-ui/.next/server/pages/_error.js +3 -3
  99. package/web-ui/web-ui/.next/server/pages/_error.js.nft.json +1 -1
  100. package/web-ui/web-ui/.next/server/server-reference-manifest.js +1 -1
  101. package/web-ui/web-ui/.next/server/server-reference-manifest.json +1 -1
  102. package/web-ui/web-ui/.next/static/chunks/394-310a18b4e4df5baf.js +1 -0
  103. package/web-ui/web-ui/.next/static/chunks/458-51313fc93031a722.js +1 -0
  104. package/web-ui/web-ui/.next/static/chunks/784-4ea191865f1d4d08.js +1 -0
  105. package/web-ui/web-ui/.next/static/chunks/800-5a959d56ff462fa5.js +1 -0
  106. package/web-ui/web-ui/.next/static/chunks/982-d4c17097640bdc58.js +55 -0
  107. package/web-ui/web-ui/.next/static/chunks/app/(app)/activity/loading-1c2f7a583c03a3ac.js +1 -0
  108. package/web-ui/web-ui/.next/static/chunks/app/(app)/activity/page-6a2b4ce7f62aa2ba.js +1 -0
  109. package/web-ui/web-ui/.next/static/chunks/app/(app)/data-shares/loading-1c2f7a583c03a3ac.js +1 -0
  110. package/web-ui/web-ui/.next/static/chunks/app/(app)/data-shares/page-3032d8c5d83ed0ae.js +1 -0
  111. package/web-ui/web-ui/.next/static/chunks/app/(app)/detections/loading-1c2f7a583c03a3ac.js +1 -0
  112. package/web-ui/web-ui/.next/static/chunks/app/(app)/detections/page-541933106e3fbbd5.js +1 -0
  113. package/web-ui/web-ui/.next/static/chunks/app/(app)/error-8db18c71ebeb633c.js +1 -0
  114. package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/[id]/loading-1c2f7a583c03a3ac.js +1 -0
  115. package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/[id]/page-b2913fd29067c1aa.js +1 -0
  116. package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/loading-1c2f7a583c03a3ac.js +1 -0
  117. package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/new/loading-1c2f7a583c03a3ac.js +1 -0
  118. package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/new/page-d71ddfb1b6a8508a.js +1 -0
  119. package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/page-db4102808bb1d7ba.js +1 -0
  120. package/web-ui/web-ui/.next/static/chunks/app/(app)/findings/loading-1c2f7a583c03a3ac.js +1 -0
  121. package/web-ui/web-ui/.next/static/chunks/app/(app)/findings/page-8fc32e776e5c8f17.js +1 -0
  122. package/web-ui/web-ui/.next/static/chunks/app/(app)/inventory/loading-1c2f7a583c03a3ac.js +1 -0
  123. package/web-ui/web-ui/.next/static/chunks/app/(app)/inventory/page-5136fa903953a1f1.js +1 -0
  124. package/web-ui/web-ui/.next/static/chunks/app/(app)/layout-0a38af585fc577fa.js +1 -0
  125. package/web-ui/web-ui/.next/static/chunks/app/(app)/policies/loading-1c2f7a583c03a3ac.js +1 -0
  126. package/web-ui/web-ui/.next/static/chunks/app/(app)/policies/page-7b0a5b76d199ec55.js +1 -0
  127. package/web-ui/web-ui/.next/static/chunks/app/(app)/scan/loading-1c2f7a583c03a3ac.js +1 -0
  128. package/web-ui/web-ui/.next/static/chunks/app/(app)/scan/page-dd238c793fc58e5b.js +1 -0
  129. package/web-ui/web-ui/.next/static/chunks/app/(app)/security/loading-1c2f7a583c03a3ac.js +1 -0
  130. package/web-ui/web-ui/.next/static/chunks/app/(app)/security/page-27448935d7ce4168.js +1 -0
  131. package/web-ui/web-ui/.next/static/chunks/app/(app)/settings/loading-1c2f7a583c03a3ac.js +1 -0
  132. package/web-ui/web-ui/.next/static/chunks/app/(app)/settings/page-e8f75d1d2a05a860.js +1 -0
  133. package/web-ui/web-ui/.next/static/chunks/app/(app)/updates/loading-1c2f7a583c03a3ac.js +1 -0
  134. package/web-ui/web-ui/.next/static/chunks/app/(app)/updates/page-34525856979b2faf.js +1 -0
  135. package/web-ui/web-ui/.next/static/chunks/app/(app)/vault/loading-1c2f7a583c03a3ac.js +1 -0
  136. package/web-ui/web-ui/.next/static/chunks/app/(app)/vault/page-90ff82a26647fc29.js +1 -0
  137. package/web-ui/web-ui/.next/static/chunks/app/_not-found/page-688942265deca357.js +1 -0
  138. package/web-ui/web-ui/.next/static/chunks/app/layout-66e4db4cb3e3b073.js +1 -0
  139. package/web-ui/web-ui/.next/static/chunks/app/page-64c3ee82a8af8ca6.js +1 -0
  140. package/web-ui/web-ui/.next/static/chunks/fc2b9f2a-dbaa334f7301101d.js +1 -0
  141. package/web-ui/web-ui/.next/static/chunks/{framework-4a8a69f5ce633b25.js → framework-f6112ebf12822e8c.js} +1 -1
  142. package/web-ui/web-ui/.next/static/chunks/main-app-9c9fe8121a92e5d6.js +1 -0
  143. package/web-ui/web-ui/.next/static/chunks/main-b1c87d0ac6039542.js +1 -0
  144. package/web-ui/web-ui/.next/static/chunks/pages/_app-3a76cb93bbdd6993.js +1 -0
  145. package/web-ui/web-ui/.next/static/chunks/pages/_error-690c2fcfe129b529.js +1 -0
  146. package/web-ui/web-ui/.next/static/chunks/{webpack-c0fb35a40828243e.js → webpack-27570aabc530cb21.js} +1 -1
  147. package/web-ui/web-ui/.next/static/css/010b6061327092dd.css +2 -0
  148. package/web-ui/web-ui/.next/static/{5Pl1KmhN7uMqXkPkq0ZmS → zCQxcf2ZbK52vQeWXgBgs}/_buildManifest.js +1 -1
  149. package/web-ui/web-ui/dist/scan-worker.js +241 -34
  150. package/web-ui/web-ui/package.json +3 -3
  151. package/web-ui/web-ui/.next/server/chunks/167.js +0 -11
  152. package/web-ui/web-ui/.next/server/chunks/197.js +0 -12
  153. package/web-ui/web-ui/.next/server/chunks/247.js +0 -66
  154. package/web-ui/web-ui/.next/server/chunks/259.js +0 -22
  155. package/web-ui/web-ui/.next/server/chunks/285.js +0 -1
  156. package/web-ui/web-ui/.next/server/chunks/293.js +0 -1022
  157. package/web-ui/web-ui/.next/server/chunks/498.js +0 -1
  158. package/web-ui/web-ui/.next/server/chunks/524.js +0 -109
  159. package/web-ui/web-ui/.next/server/chunks/618.js +0 -1
  160. package/web-ui/web-ui/.next/server/chunks/807.js +0 -6
  161. package/web-ui/web-ui/.next/server/chunks/811.js +0 -6
  162. package/web-ui/web-ui/.next/server/chunks/97.js +0 -1
  163. package/web-ui/web-ui/.next/static/chunks/333-837ec42ac57bd0f5.js +0 -1
  164. package/web-ui/web-ui/.next/static/chunks/423b6282-fc44d01f7ffd176d.js +0 -1
  165. package/web-ui/web-ui/.next/static/chunks/539-ca04468e745ed73a.js +0 -1
  166. package/web-ui/web-ui/.next/static/chunks/614-2c96a5e95ce63862.js +0 -1
  167. package/web-ui/web-ui/.next/static/chunks/639-6f64a434dce13266.js +0 -1
  168. package/web-ui/web-ui/.next/static/chunks/826-e806952dd7b636f8.js +0 -55
  169. package/web-ui/web-ui/.next/static/chunks/app/(app)/activity/loading-dd5849a39c269cf4.js +0 -1
  170. package/web-ui/web-ui/.next/static/chunks/app/(app)/activity/page-5fc18420d8d5bf62.js +0 -1
  171. package/web-ui/web-ui/.next/static/chunks/app/(app)/data-shares/loading-dd5849a39c269cf4.js +0 -1
  172. package/web-ui/web-ui/.next/static/chunks/app/(app)/data-shares/page-fe72214e54d52a14.js +0 -1
  173. package/web-ui/web-ui/.next/static/chunks/app/(app)/detections/loading-dd5849a39c269cf4.js +0 -1
  174. package/web-ui/web-ui/.next/static/chunks/app/(app)/detections/page-47e4dd015f24c04d.js +0 -1
  175. package/web-ui/web-ui/.next/static/chunks/app/(app)/error-be2032a4770a35bf.js +0 -1
  176. package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/[id]/loading-dd5849a39c269cf4.js +0 -1
  177. package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/[id]/page-f90fbb03406e4383.js +0 -1
  178. package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/loading-dd5849a39c269cf4.js +0 -1
  179. package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/new/loading-dd5849a39c269cf4.js +0 -1
  180. package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/new/page-0a1d6a3557b99750.js +0 -1
  181. package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/page-dbf32c5303140e8c.js +0 -1
  182. package/web-ui/web-ui/.next/static/chunks/app/(app)/findings/loading-dd5849a39c269cf4.js +0 -1
  183. package/web-ui/web-ui/.next/static/chunks/app/(app)/findings/page-cb1934547acde891.js +0 -1
  184. package/web-ui/web-ui/.next/static/chunks/app/(app)/inventory/loading-dd5849a39c269cf4.js +0 -1
  185. package/web-ui/web-ui/.next/static/chunks/app/(app)/inventory/page-6688bc58741c7c7d.js +0 -1
  186. package/web-ui/web-ui/.next/static/chunks/app/(app)/layout-d357a1d54c653d14.js +0 -1
  187. package/web-ui/web-ui/.next/static/chunks/app/(app)/policies/loading-dd5849a39c269cf4.js +0 -1
  188. package/web-ui/web-ui/.next/static/chunks/app/(app)/policies/page-bc95c7097cca0dfc.js +0 -1
  189. package/web-ui/web-ui/.next/static/chunks/app/(app)/scan/loading-dd5849a39c269cf4.js +0 -1
  190. package/web-ui/web-ui/.next/static/chunks/app/(app)/scan/page-5bebd818c1bb3a79.js +0 -1
  191. package/web-ui/web-ui/.next/static/chunks/app/(app)/security/loading-dd5849a39c269cf4.js +0 -1
  192. package/web-ui/web-ui/.next/static/chunks/app/(app)/security/page-42845dce0b734eeb.js +0 -1
  193. package/web-ui/web-ui/.next/static/chunks/app/(app)/settings/loading-dd5849a39c269cf4.js +0 -1
  194. package/web-ui/web-ui/.next/static/chunks/app/(app)/settings/page-d3ce8a503e8ce592.js +0 -1
  195. package/web-ui/web-ui/.next/static/chunks/app/(app)/updates/loading-dd5849a39c269cf4.js +0 -1
  196. package/web-ui/web-ui/.next/static/chunks/app/(app)/updates/page-802942c0a06fbe31.js +0 -1
  197. package/web-ui/web-ui/.next/static/chunks/app/(app)/vault/loading-dd5849a39c269cf4.js +0 -1
  198. package/web-ui/web-ui/.next/static/chunks/app/(app)/vault/page-52c8cd3a2a09a067.js +0 -1
  199. package/web-ui/web-ui/.next/static/chunks/app/_not-found/page-260d84f0d7697773.js +0 -1
  200. package/web-ui/web-ui/.next/static/chunks/app/layout-c64d57251ee073d5.js +0 -1
  201. package/web-ui/web-ui/.next/static/chunks/app/page-b7ea78b4203d219b.js +0 -1
  202. package/web-ui/web-ui/.next/static/chunks/main-89a5d50418a9a7e3.js +0 -1
  203. package/web-ui/web-ui/.next/static/chunks/main-app-4a18e3117ef3af1e.js +0 -1
  204. package/web-ui/web-ui/.next/static/chunks/pages/_app-671d04cd06b05cac.js +0 -1
  205. package/web-ui/web-ui/.next/static/chunks/pages/_error-ae172b6a97f64258.js +0 -1
  206. package/web-ui/web-ui/.next/static/css/616a1cc3e0d40480.css +0 -2
  207. /package/web-ui/web-ui/.next/static/{5Pl1KmhN7uMqXkPkq0ZmS → zCQxcf2ZbK52vQeWXgBgs}/_ssgManifest.js +0 -0
@@ -603,6 +603,82 @@ function escapeRegExp2(value) {
603
603
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
604
604
  }
605
605
 
606
+ // ../packages/detections/src/format-chars.ts
607
+ var HAS_FORMAT_CHAR = new RegExp("\\p{Cf}", "u");
608
+ var FORMAT_CHAR_GLOBAL = new RegExp("\\p{Cf}", "gu");
609
+ function normalizeFormatChars(text) {
610
+ if (!HAS_FORMAT_CHAR.test(text)) return void 0;
611
+ const normalizedParts = [];
612
+ const segments = [];
613
+ let cursor = 0;
614
+ let normLength = 0;
615
+ for (const match of text.matchAll(FORMAT_CHAR_GLOBAL)) {
616
+ const matchStart = match.index;
617
+ if (matchStart > cursor) {
618
+ const length = matchStart - cursor;
619
+ normalizedParts.push(text.slice(cursor, matchStart));
620
+ segments.push({ normStart: normLength, origStart: cursor, length });
621
+ normLength += length;
622
+ }
623
+ cursor = matchStart + match[0].length;
624
+ }
625
+ if (cursor < text.length) {
626
+ const length = text.length - cursor;
627
+ normalizedParts.push(text.slice(cursor));
628
+ segments.push({ normStart: normLength, origStart: cursor, length });
629
+ }
630
+ return { normalized: normalizedParts.join(""), segments };
631
+ }
632
+ function segmentAt(segments, normPos) {
633
+ let lo = 0;
634
+ let hi = segments.length - 1;
635
+ while (lo < hi) {
636
+ const mid = lo + hi >> 1;
637
+ const segment = segments[mid];
638
+ if (segment !== void 0 && normPos >= segment.normStart + segment.length) {
639
+ lo = mid + 1;
640
+ } else {
641
+ hi = mid;
642
+ }
643
+ }
644
+ const found = segments[lo];
645
+ if (found === void 0) {
646
+ throw new Error(`normPos ${String(normPos)} has no covering segment`);
647
+ }
648
+ return found;
649
+ }
650
+ function mapSpanToOriginal(span, normalization) {
651
+ const { segments } = normalization;
652
+ const startSegment = segmentAt(segments, span.start);
653
+ const start = startSegment.origStart + (span.start - startSegment.normStart);
654
+ const endSegment = segmentAt(segments, span.end - 1);
655
+ const end = endSegment.origStart + (span.end - 1 - endSegment.normStart) + 1;
656
+ return { start, end };
657
+ }
658
+ function normalizedOffset(origPos, segments) {
659
+ let lo = 0;
660
+ let hi = segments.length;
661
+ while (lo < hi) {
662
+ const mid = lo + hi >> 1;
663
+ const segment = segments[mid];
664
+ if (segment !== void 0 && segment.origStart + segment.length <= origPos) {
665
+ lo = mid + 1;
666
+ } else {
667
+ hi = mid;
668
+ }
669
+ }
670
+ const found = segments[Math.min(lo, segments.length - 1)];
671
+ if (found === void 0) return 0;
672
+ return found.normStart + Math.min(Math.max(0, origPos - found.origStart), found.length);
673
+ }
674
+ function mapSpanToNormalized(span, normalization) {
675
+ const { segments } = normalization;
676
+ return {
677
+ start: normalizedOffset(span.start, segments),
678
+ end: normalizedOffset(span.end, segments)
679
+ };
680
+ }
681
+
606
682
  // ../packages/detections/src/regex-cache.ts
607
683
  var singles = /* @__PURE__ */ new WeakMap();
608
684
  var keywordLists = /* @__PURE__ */ new WeakMap();
@@ -761,29 +837,35 @@ function passesPostValidators(rule, value) {
761
837
  function getLoadedRules() {
762
838
  return [...packs.values()].flatMap((p) => p.rules);
763
839
  }
764
- function isCorroborated(candidate, candidates, text) {
840
+ function spansOverlap(a, b) {
841
+ return a.start < b.end && a.end > b.start;
842
+ }
843
+ function isCorroborated(candidate, candidates, text, normalization) {
765
844
  const req = candidate.rule.requiresNearby;
766
845
  if (!req) return true;
767
846
  const halfWindow = req.windowChars;
768
- const { start, end } = candidate.match.span;
769
- const winStart = start - halfWindow;
770
- const winEnd = end + halfWindow;
847
+ const ns = candidate.normSpan;
848
+ const winStart = ns.start - halfWindow;
849
+ const winEnd = ns.end + halfWindow;
771
850
  const categories = req.categories;
772
851
  const ruleIds = req.ruleIds;
773
852
  if (categories?.length || ruleIds?.length) {
774
853
  for (const other of candidates) {
775
854
  if (other === candidate) continue;
776
- const os = other.match.span;
777
- if (os.end < winStart || os.start > winEnd) continue;
778
- if (other.match.ruleId !== candidate.match.ruleId && categories?.includes(other.match.category)) {
779
- return true;
855
+ if (other.normSpan.end < winStart || other.normSpan.start > winEnd) continue;
856
+ const relevant = other.match.ruleId !== candidate.match.ruleId && categories?.includes(other.match.category) === true || ruleIds?.includes(other.match.ruleId) === true;
857
+ if (!relevant) continue;
858
+ if (other.match.ruleId === candidate.match.ruleId && spansOverlap(other.match.span, candidate.match.span)) {
859
+ continue;
780
860
  }
781
- if (ruleIds?.includes(other.match.ruleId)) return true;
861
+ return true;
782
862
  }
783
863
  }
784
864
  const labels = req.labels;
785
865
  if (labels && labels.length > 0) {
786
- const haystack = text.slice(Math.max(0, winStart), winEnd);
866
+ const { start, end } = candidate.match.span;
867
+ const haystack = text.slice(Math.max(0, start - halfWindow), end + halfWindow);
868
+ const normalizedHaystack = normalization === void 0 ? void 0 : normalization.normalized.slice(Math.max(0, winStart), winEnd);
787
869
  for (const re of memoizedRegExpList(
788
870
  "label",
789
871
  req,
@@ -792,29 +874,20 @@ function isCorroborated(candidate, candidates, text) {
792
874
  return trimmed.length === 0 ? void 0 : new RegExp(`(?<![A-Za-z0-9])${escapeRegExp2(trimmed)}(?![A-Za-z0-9])`, "i");
793
875
  })
794
876
  )) {
795
- if (re?.test(haystack)) return true;
877
+ if (!re) continue;
878
+ if (re.test(haystack)) return true;
879
+ if (normalizedHaystack !== void 0 && re.test(normalizedHaystack)) return true;
796
880
  }
797
881
  }
798
882
  return false;
799
883
  }
800
- function extensionOf(filePath) {
801
- const base = filePath.slice(Math.max(filePath.lastIndexOf("/"), filePath.lastIndexOf("\\")) + 1);
802
- const dot = base.lastIndexOf(".");
803
- return dot > 0 ? base.slice(dot).toLowerCase() : void 0;
804
- }
805
- function ruleApplies(rule, extension) {
806
- if (!rule.appliesTo || extension === void 0) return true;
807
- return rule.appliesTo.extensions.some((e) => e.toLowerCase() === extension);
808
- }
809
- function scan(text, rules, context) {
810
- const ruleset2 = rules ?? getLoadedRules();
811
- const extension = context?.filePath ? extensionOf(context.filePath) : void 0;
884
+ function buildCandidates(matchText, ruleset2, extension) {
812
885
  const candidates = [];
813
886
  for (const rule of ruleset2) {
814
887
  if (!ruleApplies(rule, extension)) continue;
815
- const spans = MATCHERS[rule.matcher.type](text, rule);
888
+ const spans = MATCHERS[rule.matcher.type](matchText, rule);
816
889
  for (const span of spans) {
817
- const rawMatch = text.slice(span.start, span.end);
890
+ const rawMatch = matchText.slice(span.start, span.end);
818
891
  if (!passesPostValidators(rule, rawMatch)) continue;
819
892
  candidates.push({
820
893
  rule,
@@ -825,10 +898,31 @@ function scan(text, rules, context) {
825
898
  span,
826
899
  rawMatch,
827
900
  confidence: 0.9
828
- }
901
+ },
902
+ // In `matchText`'s own coordinates, which is the normalized text for
903
+ // a normalized-pass candidate and so already right; an original-pass
904
+ // candidate on the slow path is re-derived by withNormalizedSpan.
905
+ normSpan: span
829
906
  });
830
907
  }
831
908
  }
909
+ return candidates;
910
+ }
911
+ function mapCandidateToOriginal(candidate, normalization, text) {
912
+ const span = mapSpanToOriginal(candidate.match.span, normalization);
913
+ return {
914
+ rule: candidate.rule,
915
+ match: { ...candidate.match, span, rawMatch: text.slice(span.start, span.end) },
916
+ // Deliberately NOT remapped: `normSpan` is the span the primitive match
917
+ // was found at in the normalized text, which is exactly the coordinate
918
+ // space windows are measured in. See the `Candidate` comment.
919
+ normSpan: candidate.normSpan
920
+ };
921
+ }
922
+ function withNormalizedSpan(candidate, normalization) {
923
+ return { ...candidate, normSpan: mapSpanToNormalized(candidate.match.span, normalization) };
924
+ }
925
+ function gate(candidates, text, normalization) {
832
926
  const findings = [];
833
927
  for (const candidate of candidates) {
834
928
  const req = candidate.rule.requiresNearby;
@@ -836,7 +930,7 @@ function scan(text, rules, context) {
836
930
  findings.push(candidate.match);
837
931
  continue;
838
932
  }
839
- if (!isCorroborated(candidate, candidates, text)) continue;
933
+ if (!isCorroborated(candidate, candidates, text, normalization)) continue;
840
934
  const boost = req.confidenceBoost;
841
935
  findings.push(
842
936
  boost ? { ...candidate.match, confidence: Math.min(0.99, candidate.match.confidence + boost) } : candidate.match
@@ -844,6 +938,81 @@ function scan(text, rules, context) {
844
938
  }
845
939
  return findings;
846
940
  }
941
+ function closeRegion(open2, text) {
942
+ const span = { start: open2.start, end: open2.end };
943
+ return {
944
+ ruleId: open2.ruleId,
945
+ category: open2.category,
946
+ severity: open2.severity,
947
+ span,
948
+ rawMatch: text.slice(span.start, span.end),
949
+ confidence: open2.confidence
950
+ };
951
+ }
952
+ function mergeOverlappingSameRule(findings, text) {
953
+ if (findings.length === 0) return findings;
954
+ const groups = /* @__PURE__ */ new Map();
955
+ const ruleOrder = [];
956
+ for (const finding of findings) {
957
+ const group = groups.get(finding.ruleId);
958
+ if (group) {
959
+ group.push(finding);
960
+ } else {
961
+ groups.set(finding.ruleId, [finding]);
962
+ ruleOrder.push(finding.ruleId);
963
+ }
964
+ }
965
+ const merged = [];
966
+ for (const ruleId of ruleOrder) {
967
+ const group = groups.get(ruleId) ?? [];
968
+ const sorted = [...group].sort(
969
+ (a, b) => a.span.start - b.span.start || a.span.end - b.span.end
970
+ );
971
+ let open2;
972
+ for (const finding of sorted) {
973
+ if (open2 && finding.span.start < open2.end) {
974
+ open2.end = Math.max(open2.end, finding.span.end);
975
+ open2.confidence = Math.max(open2.confidence, finding.confidence);
976
+ continue;
977
+ }
978
+ if (open2) merged.push(closeRegion(open2, text));
979
+ open2 = {
980
+ start: finding.span.start,
981
+ end: finding.span.end,
982
+ confidence: finding.confidence,
983
+ ruleId: finding.ruleId,
984
+ category: finding.category,
985
+ severity: finding.severity
986
+ };
987
+ }
988
+ if (open2) merged.push(closeRegion(open2, text));
989
+ }
990
+ return merged;
991
+ }
992
+ function extensionOf(filePath) {
993
+ const base = filePath.slice(Math.max(filePath.lastIndexOf("/"), filePath.lastIndexOf("\\")) + 1);
994
+ const dot = base.lastIndexOf(".");
995
+ return dot > 0 ? base.slice(dot).toLowerCase() : void 0;
996
+ }
997
+ function ruleApplies(rule, extension) {
998
+ if (!rule.appliesTo || extension === void 0) return true;
999
+ return rule.appliesTo.extensions.some((e) => e.toLowerCase() === extension);
1000
+ }
1001
+ function scan(text, rules, context) {
1002
+ const ruleset2 = rules ?? getLoadedRules();
1003
+ const extension = context?.filePath ? extensionOf(context.filePath) : void 0;
1004
+ const normalization = normalizeFormatChars(text);
1005
+ const originalCandidates = buildCandidates(text, ruleset2, extension);
1006
+ if (!normalization) return gate(originalCandidates, text, void 0);
1007
+ const pooledOriginal = originalCandidates.map(
1008
+ (candidate) => withNormalizedSpan(candidate, normalization)
1009
+ );
1010
+ const normalizedCandidates = buildCandidates(normalization.normalized, ruleset2, extension).map(
1011
+ (candidate) => mapCandidateToOriginal(candidate, normalization, text)
1012
+ );
1013
+ const findings = gate([...pooledOriginal, ...normalizedCandidates], text, normalization);
1014
+ return mergeOverlappingSameRule(findings, text);
1015
+ }
847
1016
 
848
1017
  // ../packages/schema/src/exception-scope.ts
849
1018
  var MINUTE_MS = 6e4;
@@ -22977,7 +23146,29 @@ var StorePosturePlugin = external_exports.object({
22977
23146
  */
22978
23147
  policyBundleVersion: external_exports.string().max(200).nullable(),
22979
23148
  /** Epoch millis, on the CLIENT clock, of that fetch. */
22980
- policyFetchedAt: external_exports.number().int().min(0).max(MAX_DATE_MS).nullable()
23149
+ policyFetchedAt: external_exports.number().int().min(0).max(MAX_DATE_MS).nullable(),
23150
+ /**
23151
+ * The newest version the host's own install record holds for this plugin —
23152
+ * what is on disk. After an update it leads `version` (the running copy) by
23153
+ * one launch. Null when no usable version can be read: no install record
23154
+ * (a plugin run from a checkout), no entry with a valid version, or every
23155
+ * such entry names an `installPath` that no longer exists; OPTIONAL, not
23156
+ * required, so a build that predates the member keeps getting its 200.
23157
+ * Bounded like `version`.
23158
+ */
23159
+ installedVersion: external_exports.string().max(64).nullable().optional(),
23160
+ /**
23161
+ * The local-store schema version this running build migrates a store to:
23162
+ * the number of store migrations it carries, the count it stamps into
23163
+ * `PRAGMA user_version`. A snapshot whose `schemaVersion` is above it
23164
+ * usually describes a store a newer build migrated. It is a hint, not a
23165
+ * verdict: the stamp is write-only, so a store whose count ran past this
23166
+ * build's while this build knows every migration in its ledger reads above
23167
+ * it too, which is why describeStoreSkew decides skew on ledger tags and
23168
+ * never on the count. OPTIONAL for the same reason as `installedVersion`;
23169
+ * bounded like `schemaVersion`.
23170
+ */
23171
+ buildSchemaVersion: external_exports.number().int().min(0).max(MAX_INT4).optional()
22981
23172
  }).meta({ id: "StorePosturePlugin" });
22982
23173
  var StorePostureSnapshot = external_exports.object({
22983
23174
  deviceId: external_exports.guid(),
@@ -23956,10 +24147,15 @@ var ParsedPointer = external_exports.object({
23956
24147
  });
23957
24148
  var VaultEntry = external_exports.object({
23958
24149
  pointerId: external_exports.string(),
23959
- // The keyed HMAC of the raw value under `exception.key`, and the epoch it was
23960
- // derived under. This is what a reveal-to-model grant matches on, and it rotates
23961
- // independently of the vault encryption key below.
24150
+ // The keyed HMAC of the EXACT raw bytes under `exception.key`, and the epoch it
24151
+ // was derived under. The vault's own dedupe key: a value and its invisibly
24152
+ // padded twin are two rows. It rotates independently of the vault encryption
24153
+ // key below. Never matched against an exception or grant.
23962
24154
  valueFingerprint: external_exports.string().regex(/^[0-9a-f]{64}$/),
24155
+ // The same HMAC over the raw with invisible padding removed: the identity a
24156
+ // reveal-to-model grant and every exception match on. Shared by a value and
24157
+ // its padded twin.
24158
+ valueIdentityFingerprint: external_exports.string().regex(/^[0-9a-f]{64}$/),
23963
24159
  fingerprintKeyVersion: external_exports.number().int().positive(),
23964
24160
  // The vault-key epoch this row's ciphertext was sealed under.
23965
24161
  keyVersion: external_exports.number().int().positive(),
@@ -24401,10 +24597,18 @@ var SeveritySummaryItem = external_exports.object({
24401
24597
  count: external_exports.number().int().nonnegative(),
24402
24598
  // Resolution-aware breakdown (optional, additive). Populated once findings
24403
24599
  // carry lifecycle state: `caught` = handled in-flight (enforced); `openAtRest`
24404
- // = still open with no in-flight enforcement (needs remediation). Absent on the
24405
- // legacy count-only response until the resolution feature lands.
24600
+ // = still open with no in-flight enforcement (needs remediation); `dismissed`
24601
+ // = closed by a human judgement rather than a fix — visible, but not counted as
24602
+ // needing remediation. The three are disjoint. Absent on the legacy count-only
24603
+ // response until the resolution feature lands.
24406
24604
  caught: external_exports.number().int().nonnegative().optional(),
24407
- openAtRest: external_exports.number().int().nonnegative().optional()
24605
+ openAtRest: external_exports.number().int().nonnegative().optional(),
24606
+ dismissed: external_exports.number().int().nonnegative().optional(),
24607
+ // The two halves of `caught`, for a reader that wants them apart: `handled` =
24608
+ // in-flight findings an enforcement action already contained; `resolved` =
24609
+ // at-rest findings closed out by fixing them. `handled + resolved === caught`.
24610
+ handled: external_exports.number().int().nonnegative().optional(),
24611
+ resolved: external_exports.number().int().nonnegative().optional()
24408
24612
  }).meta({ id: "SeveritySummaryItem" });
24409
24613
  var SeveritySummaryResponse = external_exports.object({
24410
24614
  // Sum of bySeverity[].count.
@@ -24412,6 +24616,9 @@ var SeveritySummaryResponse = external_exports.object({
24412
24616
  // Findings still open at rest (sum of bySeverity[].openAtRest). Optional and
24413
24617
  // additive — absent on the legacy response until the resolution feature lands.
24414
24618
  needsRemediation: external_exports.number().int().nonnegative().optional(),
24619
+ // Findings a user dismissed (sum of bySeverity[].dismissed). Excluded from
24620
+ // needsRemediation, and kept visible here so an accepted risk is not erased.
24621
+ dismissed: external_exports.number().int().nonnegative().optional(),
24415
24622
  // All four severity levels are always present (count may be 0).
24416
24623
  bySeverity: external_exports.array(SeveritySummaryItem)
24417
24624
  }).meta({ id: "SeveritySummaryResponse" });
@@ -23,7 +23,7 @@
23
23
  "@fontsource-variable/inter": "^5.3.0",
24
24
  "@fontsource-variable/jetbrains-mono": "^5.3.0",
25
25
  "@fontsource-variable/space-grotesk": "^5.3.0",
26
- "next": "^15.5.25",
26
+ "next": "^15.5.26",
27
27
  "react": "^19.3.0",
28
28
  "react-dom": "^19.3.0",
29
29
  "server-only": "^0.0.1"
@@ -37,11 +37,11 @@
37
37
  "@types/react-dom": "^19.3.0",
38
38
  "@vitest/coverage-v8": "^4.1.11",
39
39
  "eslint": "^9.39.5",
40
- "jsdom": "~30.0.1",
40
+ "jsdom": "~30.1.1",
41
41
  "tailwindcss": "^4.3.3",
42
42
  "tsup": "^8.0.0",
43
43
  "typescript": "^5.8.0",
44
- "typescript-eslint": "^8.70.0",
44
+ "typescript-eslint": "^8.70.1",
45
45
  "vitest": "^4.1.11"
46
46
  }
47
47
  }