@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" });
@@ -32,9 +32,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
32
32
  mod
33
33
  ));
34
34
 
35
- // ../../node_modules/.pnpm/ignore@7.0.9/node_modules/ignore/index.js
35
+ // ../../node_modules/.pnpm/ignore@7.0.10/node_modules/ignore/index.js
36
36
  var require_ignore = __commonJS({
37
- "../../node_modules/.pnpm/ignore@7.0.9/node_modules/ignore/index.js"(exports, module) {
37
+ "../../node_modules/.pnpm/ignore@7.0.10/node_modules/ignore/index.js"(exports, module) {
38
38
  "use strict";
39
39
  function makeArray(subject) {
40
40
  return Array.isArray(subject) ? subject : [subject];
@@ -429,6 +429,13 @@ var require_ignore = __commonJS({
429
429
  }
430
430
  };
431
431
  var WILDCARD = "[^\\/]*";
432
+ var separatorAfter = (run, at) => {
433
+ let separator = EMPTY;
434
+ for (let index = at + 1; index < run.length && !run[index].wildcard; index++) {
435
+ separator += run[index].single;
436
+ }
437
+ return separator;
438
+ };
432
439
  var pinWildcards = (source) => {
433
440
  if (source.indexOf(WILDCARD) < 0) {
434
441
  return source;
@@ -498,7 +505,7 @@ var require_ignore = __commonJS({
498
505
  out += token.single;
499
506
  return;
500
507
  }
501
- out += at === lastWildcard ? WILDCARD : `(?:(?!${run[at + 1].single})[^\\/])*`;
508
+ out += at === lastWildcard ? WILDCARD : `(?:(?!${separatorAfter(run, at)})[^\\/])*`;
502
509
  });
503
510
  run = [];
504
511
  };
@@ -675,13 +682,13 @@ var require_ignore = __commonJS({
675
682
  const rules = this._rules;
676
683
  const { length } = rules;
677
684
  const shortcut = this._basenameCount * 2 >= length;
678
- const basename6 = shortcut ? basenameOf(path) : path;
685
+ const basename7 = shortcut ? basenameOf(path) : path;
679
686
  for (let index = 0; index < length; index++) {
680
687
  const rule = rules[index];
681
688
  const { negative } = rule;
682
689
  const skip = unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored;
683
690
  if (!skip && rule[mode].test(
684
- shortcut && rule._basenameOnly ? basename6 : path
691
+ shortcut && rule._basenameOnly ? basename7 : path
685
692
  )) {
686
693
  ignored = !negative;
687
694
  unignored = negative;
@@ -5882,7 +5889,7 @@ var recursive = /* @__PURE__ */ new WeakMap();
5882
5889
  var NONE = 0;
5883
5890
  var ASSUMED = 1;
5884
5891
  var PROVEN = 2;
5885
- function isRecursive(inst, stack, resolve2) {
5892
+ function isRecursive(inst, stack, resolve3) {
5886
5893
  const cached2 = recursive.get(inst);
5887
5894
  if (cached2 !== void 0)
5888
5895
  return cached2 ? PROVEN : NONE;
@@ -5892,7 +5899,7 @@ function isRecursive(inst, stack, resolve2) {
5892
5899
  let result = NONE;
5893
5900
  const check2 = (child) => {
5894
5901
  if (result !== PROVEN && child?._zod) {
5895
- const answer = isRecursive(child, stack, resolve2);
5902
+ const answer = isRecursive(child, stack, resolve3);
5896
5903
  if (answer > result)
5897
5904
  result = answer;
5898
5905
  }
@@ -5903,7 +5910,7 @@ function isRecursive(inst, stack, resolve2) {
5903
5910
  const desc = Object.getOwnPropertyDescriptor(sh, key);
5904
5911
  if (spread && !desc.enumerable)
5905
5912
  continue;
5906
- const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve2) : NONE;
5913
+ const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve3) : NONE;
5907
5914
  if (child > answer)
5908
5915
  answer = child;
5909
5916
  }
@@ -5967,7 +5974,7 @@ function isRecursive(inst, stack, resolve2) {
5967
5974
  break;
5968
5975
  // `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
5969
5976
  case "lazy": {
5970
- const inner = def._cachedInner ?? (resolve2 ? inst._zod.innerType : void 0);
5977
+ const inner = def._cachedInner ?? (resolve3 ? inst._zod.innerType : void 0);
5971
5978
  merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
5972
5979
  break;
5973
5980
  }
@@ -23007,7 +23014,29 @@ var StorePosturePlugin = external_exports.object({
23007
23014
  */
23008
23015
  policyBundleVersion: external_exports.string().max(200).nullable(),
23009
23016
  /** Epoch millis, on the CLIENT clock, of that fetch. */
23010
- policyFetchedAt: external_exports.number().int().min(0).max(MAX_DATE_MS).nullable()
23017
+ policyFetchedAt: external_exports.number().int().min(0).max(MAX_DATE_MS).nullable(),
23018
+ /**
23019
+ * The newest version the host's own install record holds for this plugin —
23020
+ * what is on disk. After an update it leads `version` (the running copy) by
23021
+ * one launch. Null when no usable version can be read: no install record
23022
+ * (a plugin run from a checkout), no entry with a valid version, or every
23023
+ * such entry names an `installPath` that no longer exists; OPTIONAL, not
23024
+ * required, so a build that predates the member keeps getting its 200.
23025
+ * Bounded like `version`.
23026
+ */
23027
+ installedVersion: external_exports.string().max(64).nullable().optional(),
23028
+ /**
23029
+ * The local-store schema version this running build migrates a store to:
23030
+ * the number of store migrations it carries, the count it stamps into
23031
+ * `PRAGMA user_version`. A snapshot whose `schemaVersion` is above it
23032
+ * usually describes a store a newer build migrated. It is a hint, not a
23033
+ * verdict: the stamp is write-only, so a store whose count ran past this
23034
+ * build's while this build knows every migration in its ledger reads above
23035
+ * it too, which is why describeStoreSkew decides skew on ledger tags and
23036
+ * never on the count. OPTIONAL for the same reason as `installedVersion`;
23037
+ * bounded like `schemaVersion`.
23038
+ */
23039
+ buildSchemaVersion: external_exports.number().int().min(0).max(MAX_INT4).optional()
23011
23040
  }).meta({ id: "StorePosturePlugin" });
23012
23041
  var StorePostureSnapshot = external_exports.object({
23013
23042
  deviceId: external_exports.guid(),
@@ -23986,10 +24015,15 @@ var ParsedPointer = external_exports.object({
23986
24015
  });
23987
24016
  var VaultEntry = external_exports.object({
23988
24017
  pointerId: external_exports.string(),
23989
- // The keyed HMAC of the raw value under `exception.key`, and the epoch it was
23990
- // derived under. This is what a reveal-to-model grant matches on, and it rotates
23991
- // independently of the vault encryption key below.
24018
+ // The keyed HMAC of the EXACT raw bytes under `exception.key`, and the epoch it
24019
+ // was derived under. The vault's own dedupe key: a value and its invisibly
24020
+ // padded twin are two rows. It rotates independently of the vault encryption
24021
+ // key below. Never matched against an exception or grant.
23992
24022
  valueFingerprint: external_exports.string().regex(/^[0-9a-f]{64}$/),
24023
+ // The same HMAC over the raw with invisible padding removed: the identity a
24024
+ // reveal-to-model grant and every exception match on. Shared by a value and
24025
+ // its padded twin.
24026
+ valueIdentityFingerprint: external_exports.string().regex(/^[0-9a-f]{64}$/),
23993
24027
  fingerprintKeyVersion: external_exports.number().int().positive(),
23994
24028
  // The vault-key epoch this row's ciphertext was sealed under.
23995
24029
  keyVersion: external_exports.number().int().positive(),
@@ -24440,10 +24474,18 @@ var SeveritySummaryItem = external_exports.object({
24440
24474
  count: external_exports.number().int().nonnegative(),
24441
24475
  // Resolution-aware breakdown (optional, additive). Populated once findings
24442
24476
  // carry lifecycle state: `caught` = handled in-flight (enforced); `openAtRest`
24443
- // = still open with no in-flight enforcement (needs remediation). Absent on the
24444
- // legacy count-only response until the resolution feature lands.
24477
+ // = still open with no in-flight enforcement (needs remediation); `dismissed`
24478
+ // = closed by a human judgement rather than a fix — visible, but not counted as
24479
+ // needing remediation. The three are disjoint. Absent on the legacy count-only
24480
+ // response until the resolution feature lands.
24445
24481
  caught: external_exports.number().int().nonnegative().optional(),
24446
- openAtRest: external_exports.number().int().nonnegative().optional()
24482
+ openAtRest: external_exports.number().int().nonnegative().optional(),
24483
+ dismissed: external_exports.number().int().nonnegative().optional(),
24484
+ // The two halves of `caught`, for a reader that wants them apart: `handled` =
24485
+ // in-flight findings an enforcement action already contained; `resolved` =
24486
+ // at-rest findings closed out by fixing them. `handled + resolved === caught`.
24487
+ handled: external_exports.number().int().nonnegative().optional(),
24488
+ resolved: external_exports.number().int().nonnegative().optional()
24447
24489
  }).meta({ id: "SeveritySummaryItem" });
24448
24490
  var SeveritySummaryResponse = external_exports.object({
24449
24491
  // Sum of bySeverity[].count.
@@ -24451,6 +24493,9 @@ var SeveritySummaryResponse = external_exports.object({
24451
24493
  // Findings still open at rest (sum of bySeverity[].openAtRest). Optional and
24452
24494
  // additive — absent on the legacy response until the resolution feature lands.
24453
24495
  needsRemediation: external_exports.number().int().nonnegative().optional(),
24496
+ // Findings a user dismissed (sum of bySeverity[].dismissed). Excluded from
24497
+ // needsRemediation, and kept visible here so an accepted risk is not erased.
24498
+ dismissed: external_exports.number().int().nonnegative().optional(),
24454
24499
  // All four severity levels are always present (count may be 0).
24455
24500
  bySeverity: external_exports.array(SeveritySummaryItem)
24456
24501
  }).meta({ id: "SeveritySummaryResponse" });
@@ -24931,11 +24976,11 @@ function repairOrRefuseMode(file2) {
24931
24976
  const link = lstatSync2(file2, { throwIfNoEntry: false });
24932
24977
  if (link === void 0) return "absent";
24933
24978
  if (link.isSymbolicLink()) return "untrusted";
24934
- const stat = statSync(file2, { throwIfNoEntry: false });
24935
- if (stat === void 0) return "absent";
24979
+ const stat2 = statSync(file2, { throwIfNoEntry: false });
24980
+ if (stat2 === void 0) return "absent";
24936
24981
  const uid = process.getuid?.();
24937
- if (uid !== void 0 && stat.uid !== uid) return "untrusted";
24938
- if (process.platform !== "win32" && (stat.mode & 511) !== DATA_FILE_MODE) {
24982
+ if (uid !== void 0 && stat2.uid !== uid) return "untrusted";
24983
+ if (process.platform !== "win32" && (stat2.mode & 511) !== DATA_FILE_MODE) {
24939
24984
  try {
24940
24985
  chmodSync2(file2, DATA_FILE_MODE);
24941
24986
  } catch {
@@ -25451,7 +25496,7 @@ async function send(options) {
25451
25496
  }
25452
25497
  }
25453
25498
  };
25454
- return new Promise((resolve2, reject) => {
25499
+ return new Promise((resolve3, reject) => {
25455
25500
  let settled = false;
25456
25501
  const fail = (reason, status) => {
25457
25502
  if (settled) return;
@@ -25477,7 +25522,7 @@ async function send(options) {
25477
25522
  res.on("end", () => {
25478
25523
  if (settled) return;
25479
25524
  settled = true;
25480
- resolve2({
25525
+ resolve3({
25481
25526
  status: res.statusCode ?? 0,
25482
25527
  headers: res.headers,
25483
25528
  body: Buffer.concat(chunks).toString("utf8")
@@ -25718,6 +25763,7 @@ function classifyFailure(err) {
25718
25763
  }
25719
25764
 
25720
25765
  // ../../packages/plugin-runtime/src/attached/with-timeout.ts
25766
+ var REQUEST_TIMEOUT_MS = 2e3;
25721
25767
  function withTimeout(promise2, ms) {
25722
25768
  let timer;
25723
25769
  const timeout = new Promise((_, reject) => {
@@ -26422,6 +26468,10 @@ function escapeRegExp2(value) {
26422
26468
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
26423
26469
  }
26424
26470
 
26471
+ // ../../packages/detections/src/format-chars.ts
26472
+ var HAS_FORMAT_CHAR = new RegExp("\\p{Cf}", "u");
26473
+ var FORMAT_CHAR_GLOBAL = new RegExp("\\p{Cf}", "gu");
26474
+
26425
26475
  // ../../packages/detections/src/regex-cache.ts
26426
26476
  var singles = /* @__PURE__ */ new WeakMap();
26427
26477
  var keywordLists = /* @__PURE__ */ new WeakMap();
@@ -26790,13 +26840,18 @@ import { spawn } from "child_process";
26790
26840
  import { fileURLToPath as fileURLToPath2 } from "url";
26791
26841
  var HISTORY_SYNC_THROTTLE_MS = 5 * 60 * 1e3;
26792
26842
 
26843
+ // ../../packages/plugin-runtime/src/attached/install-record.ts
26844
+ import { readFile as readFile2, stat } from "fs/promises";
26845
+ import { basename as basename6, dirname as dirname6, join as join28, resolve as resolve2 } from "path";
26846
+
26793
26847
  // ../../packages/plugin-runtime/src/attached/plugin-block.ts
26794
26848
  import { readFileSync as readFileSync18 } from "fs";
26849
+ var INSTALL_RECORD_READ_TIMEOUT_MS = REQUEST_TIMEOUT_MS / 2;
26795
26850
 
26796
26851
  // ../../packages/plugin-runtime/src/attached/policy-store.ts
26797
26852
  import { randomUUID as randomUUID16 } from "crypto";
26798
- import { readFile as readFile2, rm, writeFile as writeFile2 } from "fs/promises";
26799
- import { join as join28 } from "path";
26853
+ import { readFile as readFile3, rm, writeFile as writeFile2 } from "fs/promises";
26854
+ import { join as join29 } from "path";
26800
26855
 
26801
26856
  // ../../packages/plugin-runtime/src/attached/atomic-publish.ts
26802
26857
  import { rename as rename2 } from "fs/promises";
@@ -26804,11 +26859,11 @@ var RETRYABLE = /* @__PURE__ */ new Set(["EPERM", "EACCES", "EBUSY"]);
26804
26859
  var IMMEDIATE_RETRIES = 8;
26805
26860
  var TIMED_RETRIES = 4;
26806
26861
  var ATTEMPTS = 1 + IMMEDIATE_RETRIES + TIMED_RETRIES;
26807
- var delay = (ms) => new Promise((resolve2) => {
26808
- setTimeout(resolve2, ms);
26862
+ var delay = (ms) => new Promise((resolve3) => {
26863
+ setTimeout(resolve3, ms);
26809
26864
  });
26810
- var yieldToLoop = () => new Promise((resolve2) => {
26811
- setImmediate(resolve2);
26865
+ var yieldToLoop = () => new Promise((resolve3) => {
26866
+ setImmediate(resolve3);
26812
26867
  });
26813
26868
  async function publishByRename(tmp, file2, move = rename2) {
26814
26869
  for (let attempt = 1; ; attempt += 1) {
@@ -26825,10 +26880,10 @@ async function publishByRename(tmp, file2, move = rename2) {
26825
26880
 
26826
26881
  // ../../packages/plugin-runtime/src/attached/policy-store.ts
26827
26882
  function createPolicyStore(dir = dataDir()) {
26828
- const file2 = join28(dir, "policy-cache.json");
26883
+ const file2 = join29(dir, "policy-cache.json");
26829
26884
  async function read() {
26830
26885
  try {
26831
- const raw = await readFile2(file2, "utf8");
26886
+ const raw = await readFile3(file2, "utf8");
26832
26887
  const parsed2 = JSON.parse(raw);
26833
26888
  if (typeof parsed2 !== "object" || parsed2 === null) return null;
26834
26889
  const record2 = parsed2;
@@ -26850,7 +26905,7 @@ function createPolicyStore(dir = dataDir()) {
26850
26905
  }
26851
26906
  async function priorRecord() {
26852
26907
  try {
26853
- const parsed2 = JSON.parse(await readFile2(file2, "utf8"));
26908
+ const parsed2 = JSON.parse(await readFile3(file2, "utf8"));
26854
26909
  return typeof parsed2 === "object" && parsed2 !== null ? parsed2 : null;
26855
26910
  } catch {
26856
26911
  return null;
@@ -26945,7 +27000,7 @@ async function runPolicySync(deps) {
26945
27000
 
26946
27001
  // ../../packages/plugin-runtime/src/attached/posture-report-state.ts
26947
27002
  import { readFileSync as readFileSync19 } from "fs";
26948
- import { join as join29 } from "path";
27003
+ import { join as join30 } from "path";
26949
27004
  var OUTCOME_KEYS = {
26950
27005
  ok: true,
26951
27006
  unauthorized: true,
@@ -26967,15 +27022,15 @@ import { DatabaseSync as DatabaseSync4 } from "node:sqlite";
26967
27022
 
26968
27023
  // ../../packages/plugin-runtime/src/attached/posture-store.ts
26969
27024
  import { randomUUID as randomUUID17 } from "crypto";
26970
- import { readFile as readFile3, rm as rm2, writeFile as writeFile3 } from "fs/promises";
26971
- import { join as join30 } from "path";
27025
+ import { readFile as readFile4, rm as rm2, writeFile as writeFile3 } from "fs/promises";
27026
+ import { join as join31 } from "path";
26972
27027
 
26973
27028
  // ../../packages/plugin-runtime/src/attached/sync-state.ts
26974
27029
  import { readFileSync as readFileSync20 } from "fs";
26975
- import { join as join31 } from "path";
27030
+ import { join as join32 } from "path";
26976
27031
  var SYNC_STATE_FILENAME = ATTACHED_SYNC_STATE_FILENAME;
26977
27032
  function syncStatePath(dataDir2) {
26978
- return join31(dataDir2, SYNC_STATE_FILENAME);
27033
+ return join32(dataDir2, SYNC_STATE_FILENAME);
26979
27034
  }
26980
27035
  function writeSyncState(dataDir2, result) {
26981
27036
  try {