shieldcortex 4.15.0 → 4.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/README.md +4 -0
  2. package/dashboard/.next/standalone/dashboard/.next/BUILD_ID +1 -1
  3. package/dashboard/.next/standalone/dashboard/.next/build-manifest.json +2 -2
  4. package/dashboard/.next/standalone/dashboard/.next/prerender-manifest.json +3 -3
  5. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.html +2 -2
  6. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.rsc +1 -1
  7. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  8. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  10. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  11. package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  12. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.html +2 -2
  13. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.rsc +1 -1
  14. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  15. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  16. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  17. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  18. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  19. package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  20. package/dashboard/.next/standalone/dashboard/.next/server/app/admin.html +1 -1
  21. package/dashboard/.next/standalone/dashboard/.next/server/app/admin.rsc +1 -1
  22. package/dashboard/.next/standalone/dashboard/.next/server/app/admin.segments/!KGRhc2hib2FyZCk/admin/__PAGE__.segment.rsc +1 -1
  23. package/dashboard/.next/standalone/dashboard/.next/server/app/admin.segments/!KGRhc2hib2FyZCk/admin.segment.rsc +1 -1
  24. package/dashboard/.next/standalone/dashboard/.next/server/app/admin.segments/!KGRhc2hib2FyZCk.segment.rsc +1 -1
  25. package/dashboard/.next/standalone/dashboard/.next/server/app/admin.segments/_full.segment.rsc +1 -1
  26. package/dashboard/.next/standalone/dashboard/.next/server/app/admin.segments/_head.segment.rsc +1 -1
  27. package/dashboard/.next/standalone/dashboard/.next/server/app/admin.segments/_index.segment.rsc +1 -1
  28. package/dashboard/.next/standalone/dashboard/.next/server/app/admin.segments/_tree.segment.rsc +1 -1
  29. package/dashboard/.next/standalone/dashboard/.next/server/app/cloud.html +1 -1
  30. package/dashboard/.next/standalone/dashboard/.next/server/app/cloud.rsc +1 -1
  31. package/dashboard/.next/standalone/dashboard/.next/server/app/cloud.segments/!KGRhc2hib2FyZCk/cloud/__PAGE__.segment.rsc +1 -1
  32. package/dashboard/.next/standalone/dashboard/.next/server/app/cloud.segments/!KGRhc2hib2FyZCk/cloud.segment.rsc +1 -1
  33. package/dashboard/.next/standalone/dashboard/.next/server/app/cloud.segments/!KGRhc2hib2FyZCk.segment.rsc +1 -1
  34. package/dashboard/.next/standalone/dashboard/.next/server/app/cloud.segments/_full.segment.rsc +1 -1
  35. package/dashboard/.next/standalone/dashboard/.next/server/app/cloud.segments/_head.segment.rsc +1 -1
  36. package/dashboard/.next/standalone/dashboard/.next/server/app/cloud.segments/_index.segment.rsc +1 -1
  37. package/dashboard/.next/standalone/dashboard/.next/server/app/cloud.segments/_tree.segment.rsc +1 -1
  38. package/dashboard/.next/standalone/dashboard/.next/server/app/index.html +1 -1
  39. package/dashboard/.next/standalone/dashboard/.next/server/app/index.rsc +1 -1
  40. package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  41. package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_full.segment.rsc +1 -1
  42. package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_head.segment.rsc +1 -1
  43. package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_index.segment.rsc +1 -1
  44. package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  45. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/capture.html +1 -1
  46. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/capture.rsc +1 -1
  47. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/capture.segments/!KGRhc2hib2FyZCk/memory/capture/__PAGE__.segment.rsc +1 -1
  48. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/capture.segments/!KGRhc2hib2FyZCk/memory/capture.segment.rsc +1 -1
  49. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/capture.segments/!KGRhc2hib2FyZCk/memory.segment.rsc +1 -1
  50. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/capture.segments/!KGRhc2hib2FyZCk.segment.rsc +1 -1
  51. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/capture.segments/_full.segment.rsc +1 -1
  52. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/capture.segments/_head.segment.rsc +1 -1
  53. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/capture.segments/_index.segment.rsc +1 -1
  54. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/capture.segments/_tree.segment.rsc +1 -1
  55. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/graph.html +1 -1
  56. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/graph.rsc +1 -1
  57. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/graph.segments/!KGRhc2hib2FyZCk/memory/graph/__PAGE__.segment.rsc +1 -1
  58. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/graph.segments/!KGRhc2hib2FyZCk/memory/graph.segment.rsc +1 -1
  59. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/graph.segments/!KGRhc2hib2FyZCk/memory.segment.rsc +1 -1
  60. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/graph.segments/!KGRhc2hib2FyZCk.segment.rsc +1 -1
  61. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/graph.segments/_full.segment.rsc +1 -1
  62. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/graph.segments/_head.segment.rsc +1 -1
  63. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/graph.segments/_index.segment.rsc +1 -1
  64. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/graph.segments/_tree.segment.rsc +1 -1
  65. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/recall.html +1 -1
  66. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/recall.rsc +1 -1
  67. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/recall.segments/!KGRhc2hib2FyZCk/memory/recall/__PAGE__.segment.rsc +1 -1
  68. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/recall.segments/!KGRhc2hib2FyZCk/memory/recall.segment.rsc +1 -1
  69. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/recall.segments/!KGRhc2hib2FyZCk/memory.segment.rsc +1 -1
  70. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/recall.segments/!KGRhc2hib2FyZCk.segment.rsc +1 -1
  71. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/recall.segments/_full.segment.rsc +1 -1
  72. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/recall.segments/_head.segment.rsc +1 -1
  73. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/recall.segments/_index.segment.rsc +1 -1
  74. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/recall.segments/_tree.segment.rsc +1 -1
  75. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/review.html +1 -1
  76. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/review.rsc +1 -1
  77. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/review.segments/!KGRhc2hib2FyZCk/memory/review/__PAGE__.segment.rsc +1 -1
  78. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/review.segments/!KGRhc2hib2FyZCk/memory/review.segment.rsc +1 -1
  79. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/review.segments/!KGRhc2hib2FyZCk/memory.segment.rsc +1 -1
  80. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/review.segments/!KGRhc2hib2FyZCk.segment.rsc +1 -1
  81. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/review.segments/_full.segment.rsc +1 -1
  82. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/review.segments/_head.segment.rsc +1 -1
  83. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/review.segments/_index.segment.rsc +1 -1
  84. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/review.segments/_tree.segment.rsc +1 -1
  85. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/timeline.html +1 -1
  86. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/timeline.rsc +1 -1
  87. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/timeline.segments/!KGRhc2hib2FyZCk/memory/timeline/__PAGE__.segment.rsc +1 -1
  88. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/timeline.segments/!KGRhc2hib2FyZCk/memory/timeline.segment.rsc +1 -1
  89. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/timeline.segments/!KGRhc2hib2FyZCk/memory.segment.rsc +1 -1
  90. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/timeline.segments/!KGRhc2hib2FyZCk.segment.rsc +1 -1
  91. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/timeline.segments/_full.segment.rsc +1 -1
  92. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/timeline.segments/_head.segment.rsc +1 -1
  93. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/timeline.segments/_index.segment.rsc +1 -1
  94. package/dashboard/.next/standalone/dashboard/.next/server/app/memory/timeline.segments/_tree.segment.rsc +1 -1
  95. package/dashboard/.next/standalone/dashboard/.next/server/app/memory.html +2 -2
  96. package/dashboard/.next/standalone/dashboard/.next/server/app/memory.rsc +1 -1
  97. package/dashboard/.next/standalone/dashboard/.next/server/app/memory.segments/!KGRhc2hib2FyZCk/memory/__PAGE__.segment.rsc +1 -1
  98. package/dashboard/.next/standalone/dashboard/.next/server/app/memory.segments/!KGRhc2hib2FyZCk/memory.segment.rsc +1 -1
  99. package/dashboard/.next/standalone/dashboard/.next/server/app/memory.segments/!KGRhc2hib2FyZCk.segment.rsc +1 -1
  100. package/dashboard/.next/standalone/dashboard/.next/server/app/memory.segments/_full.segment.rsc +1 -1
  101. package/dashboard/.next/standalone/dashboard/.next/server/app/memory.segments/_head.segment.rsc +1 -1
  102. package/dashboard/.next/standalone/dashboard/.next/server/app/memory.segments/_index.segment.rsc +1 -1
  103. package/dashboard/.next/standalone/dashboard/.next/server/app/memory.segments/_tree.segment.rsc +1 -1
  104. package/dashboard/.next/standalone/dashboard/.next/server/app/overview.html +2 -2
  105. package/dashboard/.next/standalone/dashboard/.next/server/app/overview.rsc +1 -1
  106. package/dashboard/.next/standalone/dashboard/.next/server/app/overview.segments/!KGRhc2hib2FyZCk/overview/__PAGE__.segment.rsc +1 -1
  107. package/dashboard/.next/standalone/dashboard/.next/server/app/overview.segments/!KGRhc2hib2FyZCk/overview.segment.rsc +1 -1
  108. package/dashboard/.next/standalone/dashboard/.next/server/app/overview.segments/!KGRhc2hib2FyZCk.segment.rsc +1 -1
  109. package/dashboard/.next/standalone/dashboard/.next/server/app/overview.segments/_full.segment.rsc +1 -1
  110. package/dashboard/.next/standalone/dashboard/.next/server/app/overview.segments/_head.segment.rsc +1 -1
  111. package/dashboard/.next/standalone/dashboard/.next/server/app/overview.segments/_index.segment.rsc +1 -1
  112. package/dashboard/.next/standalone/dashboard/.next/server/app/overview.segments/_tree.segment.rsc +1 -1
  113. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/audit.html +1 -1
  114. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/audit.rsc +1 -1
  115. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/audit.segments/!KGRhc2hib2FyZCk/protection/audit/__PAGE__.segment.rsc +1 -1
  116. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/audit.segments/!KGRhc2hib2FyZCk/protection/audit.segment.rsc +1 -1
  117. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/audit.segments/!KGRhc2hib2FyZCk/protection.segment.rsc +1 -1
  118. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/audit.segments/!KGRhc2hib2FyZCk.segment.rsc +1 -1
  119. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/audit.segments/_full.segment.rsc +1 -1
  120. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/audit.segments/_head.segment.rsc +1 -1
  121. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/audit.segments/_index.segment.rsc +1 -1
  122. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/audit.segments/_tree.segment.rsc +1 -1
  123. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/intercepts.html +1 -1
  124. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/intercepts.rsc +1 -1
  125. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/intercepts.segments/!KGRhc2hib2FyZCk/protection/intercepts/__PAGE__.segment.rsc +1 -1
  126. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/intercepts.segments/!KGRhc2hib2FyZCk/protection/intercepts.segment.rsc +1 -1
  127. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/intercepts.segments/!KGRhc2hib2FyZCk/protection.segment.rsc +1 -1
  128. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/intercepts.segments/!KGRhc2hib2FyZCk.segment.rsc +1 -1
  129. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/intercepts.segments/_full.segment.rsc +1 -1
  130. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/intercepts.segments/_head.segment.rsc +1 -1
  131. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/intercepts.segments/_index.segment.rsc +1 -1
  132. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/intercepts.segments/_tree.segment.rsc +1 -1
  133. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/iron-dome.html +1 -1
  134. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/iron-dome.rsc +1 -1
  135. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/iron-dome.segments/!KGRhc2hib2FyZCk/protection/iron-dome/__PAGE__.segment.rsc +1 -1
  136. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/iron-dome.segments/!KGRhc2hib2FyZCk/protection/iron-dome.segment.rsc +1 -1
  137. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/iron-dome.segments/!KGRhc2hib2FyZCk/protection.segment.rsc +1 -1
  138. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/iron-dome.segments/!KGRhc2hib2FyZCk.segment.rsc +1 -1
  139. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/iron-dome.segments/_full.segment.rsc +1 -1
  140. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/iron-dome.segments/_head.segment.rsc +1 -1
  141. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/iron-dome.segments/_index.segment.rsc +1 -1
  142. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/iron-dome.segments/_tree.segment.rsc +1 -1
  143. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/policies.html +1 -1
  144. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/policies.rsc +1 -1
  145. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/policies.segments/!KGRhc2hib2FyZCk/protection/policies/__PAGE__.segment.rsc +1 -1
  146. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/policies.segments/!KGRhc2hib2FyZCk/protection/policies.segment.rsc +1 -1
  147. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/policies.segments/!KGRhc2hib2FyZCk/protection.segment.rsc +1 -1
  148. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/policies.segments/!KGRhc2hib2FyZCk.segment.rsc +1 -1
  149. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/policies.segments/_full.segment.rsc +1 -1
  150. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/policies.segments/_head.segment.rsc +1 -1
  151. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/policies.segments/_index.segment.rsc +1 -1
  152. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/policies.segments/_tree.segment.rsc +1 -1
  153. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/quarantine.html +1 -1
  154. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/quarantine.rsc +1 -1
  155. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/quarantine.segments/!KGRhc2hib2FyZCk/protection/quarantine/__PAGE__.segment.rsc +1 -1
  156. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/quarantine.segments/!KGRhc2hib2FyZCk/protection/quarantine.segment.rsc +1 -1
  157. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/quarantine.segments/!KGRhc2hib2FyZCk/protection.segment.rsc +1 -1
  158. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/quarantine.segments/!KGRhc2hib2FyZCk.segment.rsc +1 -1
  159. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/quarantine.segments/_full.segment.rsc +1 -1
  160. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/quarantine.segments/_head.segment.rsc +1 -1
  161. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/quarantine.segments/_index.segment.rsc +1 -1
  162. package/dashboard/.next/standalone/dashboard/.next/server/app/protection/quarantine.segments/_tree.segment.rsc +1 -1
  163. package/dashboard/.next/standalone/dashboard/.next/server/app/protection.html +2 -2
  164. package/dashboard/.next/standalone/dashboard/.next/server/app/protection.rsc +1 -1
  165. package/dashboard/.next/standalone/dashboard/.next/server/app/protection.segments/!KGRhc2hib2FyZCk/protection/__PAGE__.segment.rsc +1 -1
  166. package/dashboard/.next/standalone/dashboard/.next/server/app/protection.segments/!KGRhc2hib2FyZCk/protection.segment.rsc +1 -1
  167. package/dashboard/.next/standalone/dashboard/.next/server/app/protection.segments/!KGRhc2hib2FyZCk.segment.rsc +1 -1
  168. package/dashboard/.next/standalone/dashboard/.next/server/app/protection.segments/_full.segment.rsc +1 -1
  169. package/dashboard/.next/standalone/dashboard/.next/server/app/protection.segments/_head.segment.rsc +1 -1
  170. package/dashboard/.next/standalone/dashboard/.next/server/app/protection.segments/_index.segment.rsc +1 -1
  171. package/dashboard/.next/standalone/dashboard/.next/server/app/protection.segments/_tree.segment.rsc +1 -1
  172. package/dashboard/.next/standalone/dashboard/.next/server/app/settings.html +2 -2
  173. package/dashboard/.next/standalone/dashboard/.next/server/app/settings.rsc +1 -1
  174. package/dashboard/.next/standalone/dashboard/.next/server/app/settings.segments/!KGRhc2hib2FyZCk/settings/__PAGE__.segment.rsc +1 -1
  175. package/dashboard/.next/standalone/dashboard/.next/server/app/settings.segments/!KGRhc2hib2FyZCk/settings.segment.rsc +1 -1
  176. package/dashboard/.next/standalone/dashboard/.next/server/app/settings.segments/!KGRhc2hib2FyZCk.segment.rsc +1 -1
  177. package/dashboard/.next/standalone/dashboard/.next/server/app/settings.segments/_full.segment.rsc +1 -1
  178. package/dashboard/.next/standalone/dashboard/.next/server/app/settings.segments/_head.segment.rsc +1 -1
  179. package/dashboard/.next/standalone/dashboard/.next/server/app/settings.segments/_index.segment.rsc +1 -1
  180. package/dashboard/.next/standalone/dashboard/.next/server/app/settings.segments/_tree.segment.rsc +1 -1
  181. package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain/xray.html +1 -1
  182. package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain/xray.rsc +1 -1
  183. package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain/xray.segments/!KGRhc2hib2FyZCk/supply-chain/xray/__PAGE__.segment.rsc +1 -1
  184. package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain/xray.segments/!KGRhc2hib2FyZCk/supply-chain/xray.segment.rsc +1 -1
  185. package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain/xray.segments/!KGRhc2hib2FyZCk/supply-chain.segment.rsc +1 -1
  186. package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain/xray.segments/!KGRhc2hib2FyZCk.segment.rsc +1 -1
  187. package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain/xray.segments/_full.segment.rsc +1 -1
  188. package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain/xray.segments/_head.segment.rsc +1 -1
  189. package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain/xray.segments/_index.segment.rsc +1 -1
  190. package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain/xray.segments/_tree.segment.rsc +1 -1
  191. package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain.html +1 -1
  192. package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain.rsc +1 -1
  193. package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain.segments/!KGRhc2hib2FyZCk/supply-chain/__PAGE__.segment.rsc +1 -1
  194. package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain.segments/!KGRhc2hib2FyZCk/supply-chain.segment.rsc +1 -1
  195. package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain.segments/!KGRhc2hib2FyZCk.segment.rsc +1 -1
  196. package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain.segments/_full.segment.rsc +1 -1
  197. package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain.segments/_head.segment.rsc +1 -1
  198. package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain.segments/_index.segment.rsc +1 -1
  199. package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain.segments/_tree.segment.rsc +1 -1
  200. package/dashboard/.next/standalone/dashboard/.next/server/app/xray.html +2 -2
  201. package/dashboard/.next/standalone/dashboard/.next/server/app/xray.rsc +1 -1
  202. package/dashboard/.next/standalone/dashboard/.next/server/app/xray.segments/!KGRhc2hib2FyZCk/xray/__PAGE__.segment.rsc +1 -1
  203. package/dashboard/.next/standalone/dashboard/.next/server/app/xray.segments/!KGRhc2hib2FyZCk/xray.segment.rsc +1 -1
  204. package/dashboard/.next/standalone/dashboard/.next/server/app/xray.segments/!KGRhc2hib2FyZCk.segment.rsc +1 -1
  205. package/dashboard/.next/standalone/dashboard/.next/server/app/xray.segments/_full.segment.rsc +1 -1
  206. package/dashboard/.next/standalone/dashboard/.next/server/app/xray.segments/_head.segment.rsc +1 -1
  207. package/dashboard/.next/standalone/dashboard/.next/server/app/xray.segments/_index.segment.rsc +1 -1
  208. package/dashboard/.next/standalone/dashboard/.next/server/app/xray.segments/_tree.segment.rsc +1 -1
  209. package/dashboard/.next/standalone/dashboard/.next/server/pages/404.html +2 -2
  210. package/dashboard/.next/standalone/dashboard/.next/server/pages/500.html +2 -2
  211. package/dashboard/.next/standalone/dashboard/.next/server/server-reference-manifest.js +1 -1
  212. package/dashboard/.next/standalone/dashboard/.next/server/server-reference-manifest.json +1 -1
  213. package/dist/cli/migrate-legacy.d.ts +18 -0
  214. package/dist/cli/migrate-legacy.js +96 -0
  215. package/dist/database/init.js +21 -0
  216. package/dist/database/schema.sql +1 -0
  217. package/dist/database/seed-firewall-rules.d.ts +21 -0
  218. package/dist/database/seed-firewall-rules.js +105 -0
  219. package/dist/defence/custom-rules/store.d.ts +4 -1
  220. package/dist/defence/custom-rules/store.js +7 -3
  221. package/dist/defence/firewall/instruction-detector.js +15 -0
  222. package/dist/defence/pipeline.js +19 -13
  223. package/dist/defence/types.d.ts +1 -1
  224. package/hooks/openclaw/cortex-memory/HOOK.md +37 -0
  225. package/package.json +1 -1
  226. package/plugins/openclaw/dist/openclaw.plugin.json +1 -1
  227. package/scripts/lib/extract-memorable-segments.mjs +555 -0
  228. package/scripts/lib/save-memory.mjs +198 -13
  229. package/scripts/pre-compact-hook.mjs +19 -375
  230. package/scripts/session-end-hook.mjs +16 -307
  231. package/scripts/stop-hook.mjs +28 -159
  232. /package/dashboard/.next/standalone/dashboard/.next/static/{10a_MRwbHFUuDdfr86RUu → 6WjF0Utj3STrFgg7vZVPK}/_buildManifest.js +0 -0
  233. /package/dashboard/.next/standalone/dashboard/.next/static/{10a_MRwbHFUuDdfr86RUu → 6WjF0Utj3STrFgg7vZVPK}/_clientMiddlewareManifest.json +0 -0
  234. /package/dashboard/.next/standalone/dashboard/.next/static/{10a_MRwbHFUuDdfr86RUu → 6WjF0Utj3STrFgg7vZVPK}/_ssgManifest.js +0 -0
@@ -30,6 +30,10 @@ import { readTranscriptText } from './lib/transcript-reader.mjs';
30
30
  import { getAutoMemoryConfig } from './lib/auto-memory-config.mjs';
31
31
  import { recordHookInvocation } from './lib/telemetry.mjs';
32
32
  import { deriveProjectKey } from './lib/project-key.mjs';
33
+ import {
34
+ extractMemorableSegments,
35
+ processSegments,
36
+ } from './lib/extract-memorable-segments.mjs';
33
37
 
34
38
  // Database paths (with legacy fallback)
35
39
  const NEW_DB_DIR = join(homedir(), '.shieldcortex');
@@ -49,21 +53,6 @@ const { dir: DB_DIR, path: DB_PATH } = getDbPath();
49
53
  // Memory limits
50
54
  const MAX_SHORT_TERM_MEMORIES = 100;
51
55
  const MAX_LONG_TERM_MEMORIES = 1000;
52
- const BASE_THRESHOLD = 0.35;
53
- const MAX_AUTO_MEMORIES = 5;
54
-
55
- const CATEGORY_EXTRACTION_THRESHOLDS = {
56
- architecture: 0.28,
57
- error: 0.30,
58
- context: 0.32,
59
- learning: 0.32,
60
- pattern: 0.35,
61
- preference: 0.38,
62
- note: 0.42,
63
- todo: 0.40,
64
- relationship: 0.35,
65
- custom: 0.35,
66
- };
67
56
 
68
57
  // ==================== DYNAMIC THRESHOLD ====================
69
58
 
@@ -91,299 +80,16 @@ function getDynamicThreshold(memoryCount, maxMemories) {
91
80
  return 0.25;
92
81
  }
93
82
 
94
- function getExtractionThreshold(category, dynamicThreshold) {
95
- const categoryThreshold = CATEGORY_EXTRACTION_THRESHOLDS[category] || BASE_THRESHOLD;
96
- return Math.min(categoryThreshold, dynamicThreshold);
97
- }
98
-
99
- // ==================== SALIENCE DETECTION ====================
100
-
101
- const ARCHITECTURE_KEYWORDS = [
102
- 'architecture', 'design', 'pattern', 'structure', 'system',
103
- 'database', 'api', 'schema', 'model', 'framework', 'stack',
104
- 'microservice', 'monolith', 'serverless', 'infrastructure'
105
- ];
106
-
107
- const ERROR_KEYWORDS = [
108
- 'error', 'bug', 'fix', 'issue', 'problem', 'crash', 'fail',
109
- 'exception', 'debug', 'resolve', 'solution', 'workaround'
110
- ];
111
-
112
- const PREFERENCE_KEYWORDS = [
113
- 'prefer', 'always', 'never', 'style', 'convention', 'standard',
114
- 'like', 'want', 'should', 'must', 'require'
115
- ];
116
-
117
- const PATTERN_KEYWORDS = [
118
- 'pattern', 'practice', 'approach', 'method', 'technique',
119
- 'implementation', 'strategy', 'algorithm', 'workflow'
120
- ];
121
-
122
- const DECISION_KEYWORDS = [
123
- 'decided', 'decision', 'chose', 'chosen', 'selected', 'going with',
124
- 'will use', 'opted for', 'settled on', 'agreed'
125
- ];
126
-
127
- const LEARNING_KEYWORDS = [
128
- 'learned', 'discovered', 'realized', 'found out', 'turns out',
129
- 'TIL', 'now know', 'understand now', 'figured out'
130
- ];
131
-
132
- const EMOTIONAL_MARKERS = [
133
- 'important', 'critical', 'crucial', 'essential', 'key',
134
- 'finally', 'breakthrough', 'eureka', 'aha', 'got it',
135
- 'frustrating', 'annoying', 'tricky', 'remember'
136
- ];
137
-
138
- const CODE_REFERENCE_PATTERNS = [
139
- /\b[A-Z][a-zA-Z]*\.[a-zA-Z]+\b/,
140
- /\b[a-z_][a-zA-Z0-9_]*\.(ts|js|py|go|rs)\b/,
141
- /`[^`]+`/,
142
- /\b(function|class|interface|type|const|let|var)\s+\w+/i,
143
- /\bline\s*\d+\b/i,
144
- /\b(src|lib|app|components?)\/\S+/,
145
- ];
146
-
147
- function detectKeywords(text, keywords) {
148
- const lower = text.toLowerCase();
149
- return keywords.some(keyword => lower.includes(keyword.toLowerCase()));
150
- }
151
-
152
- function detectCodeReferences(content) {
153
- return CODE_REFERENCE_PATTERNS.some(pattern => pattern.test(content));
154
- }
155
-
156
- function detectExplicitRequest(text) {
157
- const patterns = [
158
- /\bremember\s+(this|that)\b/i,
159
- /\bdon'?t\s+forget\b/i,
160
- /\bkeep\s+(in\s+)?mind\b/i,
161
- /\bnote\s+(this|that)\b/i,
162
- /\bsave\s+(this|that)\b/i,
163
- /\bimportant[:\s]/i,
164
- /\bfor\s+future\s+reference\b/i,
165
- ];
166
- return patterns.some(pattern => pattern.test(text));
167
- }
168
-
169
- function calculateSalience(text) {
170
- let score = 0.25;
171
- if (detectExplicitRequest(text)) score += 0.5;
172
- if (detectKeywords(text, ARCHITECTURE_KEYWORDS)) score += 0.4;
173
- if (detectKeywords(text, ERROR_KEYWORDS)) score += 0.35;
174
- if (detectKeywords(text, DECISION_KEYWORDS)) score += 0.35;
175
- if (detectKeywords(text, LEARNING_KEYWORDS)) score += 0.3;
176
- if (detectKeywords(text, PATTERN_KEYWORDS)) score += 0.25;
177
- if (detectKeywords(text, PREFERENCE_KEYWORDS)) score += 0.25;
178
- if (detectCodeReferences(text)) score += 0.15;
179
- if (detectKeywords(text, EMOTIONAL_MARKERS)) score += 0.2;
180
- return Math.min(1.0, score);
181
- }
182
-
183
- function suggestCategory(text) {
184
- const lower = text.toLowerCase();
185
- if (detectKeywords(lower, ARCHITECTURE_KEYWORDS)) return 'architecture';
186
- if (detectKeywords(lower, ERROR_KEYWORDS)) return 'error';
187
- if (detectKeywords(lower, DECISION_KEYWORDS)) return 'context';
188
- if (detectKeywords(lower, LEARNING_KEYWORDS)) return 'learning';
189
- if (detectKeywords(lower, PREFERENCE_KEYWORDS)) return 'preference';
190
- if (detectKeywords(lower, PATTERN_KEYWORDS)) return 'pattern';
191
- if (/\b(todo|fixme|hack|xxx)\b/i.test(lower)) return 'todo';
192
- return 'note';
193
- }
194
-
195
- function extractTags(text, extractorName = null) {
196
- const tags = new Set();
197
- const hashtagMatches = text.match(/#[a-zA-Z][a-zA-Z0-9_-]*/g);
198
- if (hashtagMatches) {
199
- hashtagMatches.forEach(tag => tags.add(tag.slice(1).toLowerCase()));
200
- }
201
- const techTerms = [
202
- 'react', 'vue', 'angular', 'node', 'python', 'typescript', 'javascript',
203
- 'api', 'database', 'sql', 'mongodb', 'postgresql', 'mysql',
204
- 'docker', 'kubernetes', 'aws', 'git', 'testing', 'auth', 'security'
205
- ];
206
- const lowerText = text.toLowerCase();
207
- techTerms.forEach(term => {
208
- if (lowerText.includes(term)) tags.add(term);
209
- });
210
- tags.add('auto-extracted');
211
- tags.add('session-end');
212
- if (extractorName) {
213
- tags.add(`source:${extractorName}`);
214
- }
215
- return Array.from(tags).slice(0, 12);
216
- }
217
-
218
- function calculateFrequencyBoost(segment, allSegments) {
219
- const commonWords = new Set([
220
- 'about', 'after', 'before', 'being', 'between', 'could', 'during',
221
- 'every', 'found', 'through', 'would', 'should', 'which', 'where',
222
- 'there', 'these', 'their', 'other', 'using', 'because', 'without'
223
- ]);
224
- const words = segment.content.toLowerCase().split(/\s+/);
225
- const keyTerms = words.filter(w =>
226
- w.length > 5 && !commonWords.has(w) && /^[a-z]+$/.test(w)
227
- );
228
- let boost = 0;
229
- const seenTerms = new Set();
230
- for (const term of keyTerms) {
231
- if (seenTerms.has(term)) continue;
232
- seenTerms.add(term);
233
- const mentions = allSegments.filter(s =>
234
- s !== segment && s.content.toLowerCase().includes(term)
235
- ).length;
236
- if (mentions > 1) {
237
- boost += 0.03 * Math.min(mentions, 5);
238
- }
239
- }
240
- return Math.min(0.15, boost);
241
- }
242
-
243
- // ==================== CONTENT EXTRACTION ====================
244
-
245
- function extractMemorableSegments(conversationText) {
246
- const segments = [];
247
- const extractors = [
248
- {
249
- name: 'decision',
250
- patterns: [
251
- /(?:we\s+)?decided\s+(?:to\s+)?(.{15,200})/gi,
252
- /(?:going|went)\s+with\s+(.{15,150})/gi,
253
- /(?:chose|chosen|selected)\s+(.{15,150})/gi,
254
- /the\s+(?:approach|solution|fix)\s+(?:is|was)\s+(.{15,200})/gi,
255
- /(?:using|will\s+use)\s+(.{15,150})/gi,
256
- /(?:opted\s+for|settled\s+on)\s+(.{15,150})/gi,
257
- ],
258
- titlePrefix: 'Decision: ',
259
- },
260
- {
261
- name: 'error-fix',
262
- patterns: [
263
- /(?:fixed|solved|resolved)\s+(?:by\s+)?(.{15,200})/gi,
264
- /the\s+(?:fix|solution|workaround)\s+(?:is|was)\s+(.{15,200})/gi,
265
- /(?:root\s+cause|issue)\s+(?:is|was)\s+(.{15,200})/gi,
266
- /(?:error|bug)\s+(?:was\s+)?caused\s+by\s+(.{15,200})/gi,
267
- /(?:problem|issue)\s+was\s+(.{15,150})/gi,
268
- /(?:the\s+)?bug\s+(?:is|was)\s+(.{15,150})/gi,
269
- /(?:debugging|debugged)\s+(.{15,150})/gi,
270
- ],
271
- titlePrefix: 'Fix: ',
272
- },
273
- {
274
- name: 'learning',
275
- patterns: [
276
- /(?:learned|discovered|realized|found\s+out)\s+(?:that\s+)?(.{15,200})/gi,
277
- /turns\s+out\s+(?:that\s+)?(.{15,200})/gi,
278
- /(?:TIL|today\s+I\s+learned)[:\s]+(.{15,200})/gi,
279
- /(?:now\s+)?(?:understand|know)\s+(?:that\s+)?(.{15,150})/gi,
280
- /(?:figured\s+out|worked\s+out)\s+(.{15,150})/gi,
281
- ],
282
- titlePrefix: 'Learned: ',
283
- },
284
- {
285
- name: 'architecture',
286
- patterns: [
287
- /the\s+architecture\s+(?:is|uses|consists\s+of)\s+(.{15,200})/gi,
288
- /(?:design|pattern)\s+(?:is|uses)\s+(.{15,200})/gi,
289
- /(?:system|api|database)\s+(?:structure|design)\s+(?:is|uses)\s+(.{15,200})/gi,
290
- /(?:created|added|implemented|built)\s+(?:a\s+)?(.{15,200})/gi,
291
- /(?:refactored|updated|changed)\s+(?:the\s+)?(.{15,150})/gi,
292
- ],
293
- titlePrefix: 'Architecture: ',
294
- },
295
- {
296
- name: 'preference',
297
- patterns: [
298
- /(?:always|never)\s+(.{10,150})/gi,
299
- /(?:prefer|want)\s+to\s+(.{10,150})/gi,
300
- /(?:should|must)\s+(?:always\s+)?(.{10,150})/gi,
301
- ],
302
- titlePrefix: 'Preference: ',
303
- },
304
- {
305
- name: 'important-note',
306
- patterns: [
307
- /important[:\s]+(.{15,200})/gi,
308
- /(?:note|remember)[:\s]+(.{15,200})/gi,
309
- /(?:key|critical)\s+(?:point|thing)[:\s]+(.{15,200})/gi,
310
- /(?:this\s+is\s+)?(?:crucial|essential)[:\s]+(.{15,150})/gi,
311
- /(?:don't\s+forget|keep\s+in\s+mind)[:\s]+(.{15,150})/gi,
312
- ],
313
- titlePrefix: 'Note: ',
314
- },
315
- ];
316
-
317
- for (const extractor of extractors) {
318
- for (const pattern of extractor.patterns) {
319
- let match;
320
- while ((match = pattern.exec(conversationText)) !== null) {
321
- const content = match[1].trim();
322
- if (content.length >= 20) {
323
- const titleContent = content.slice(0, 50).replace(/\s+/g, ' ').trim();
324
- const title = extractor.titlePrefix + (titleContent.length < 50 ? titleContent : titleContent + '...');
325
- segments.push({
326
- title,
327
- content: content.slice(0, 500),
328
- extractorType: extractor.name,
329
- });
330
- }
331
- }
332
- }
333
- }
334
-
335
- return segments;
336
- }
337
-
338
- function processSegments(segments, dynamicThreshold = BASE_THRESHOLD) {
339
- const unique = [];
340
- for (const seg of segments) {
341
- const isDupe = unique.some(existing => {
342
- const overlap = calculateOverlap(existing.content, seg.content);
343
- return overlap > 0.8;
344
- });
345
- if (!isDupe) {
346
- const text = seg.title + ' ' + seg.content;
347
- const baseSalience = calculateSalience(text);
348
- const category = suggestCategory(text);
349
- unique.push({
350
- ...seg,
351
- baseSalience,
352
- category,
353
- tags: extractTags(text, seg.extractorType),
354
- });
355
- }
356
- }
357
-
358
- for (const seg of unique) {
359
- const frequencyBoost = calculateFrequencyBoost(seg, unique);
360
- seg.salience = Math.min(1.0, seg.baseSalience + frequencyBoost);
361
- seg.frequencyBoost = frequencyBoost;
362
- }
363
-
364
- unique.sort((a, b) => b.salience - a.salience);
365
-
366
- const filtered = unique.filter(seg => {
367
- const threshold = getExtractionThreshold(seg.category, dynamicThreshold);
368
- return seg.salience >= threshold;
369
- });
370
-
371
- return filtered.slice(0, MAX_AUTO_MEMORIES);
372
- }
373
-
374
- function calculateOverlap(text1, text2) {
375
- const words1 = new Set(text1.toLowerCase().split(/\s+/));
376
- const words2 = new Set(text2.toLowerCase().split(/\s+/));
377
- const intersection = new Set([...words1].filter(w => words2.has(w)));
378
- const union = new Set([...words1, ...words2]);
379
- return intersection.size / union.size;
380
- }
83
+ // Salience detection, content extraction, and segment processing now
84
+ // live in scripts/lib/extract-memorable-segments.mjs (imported above).
381
85
 
382
86
  // ==================== DATABASE OPERATIONS ====================
383
87
 
384
- // Thin wrapper to keep the existing call sites unchanged.
88
+ // Thin wrapper that stamps this hook's source identifier so defence_audit
89
+ // rows are attributable. saveAutoExtractedMemory is async (it loads the
90
+ // dist'd pipeline lazily and routes through it).
385
91
  function saveMemory(db, memory, project) {
386
- saveAutoExtractedMemory(db, memory, project);
92
+ return saveAutoExtractedMemory(db, memory, project, { source: 'session-end-hook' });
387
93
  }
388
94
 
389
95
  // ==================== MAIN HOOK LOGIC ====================
@@ -410,7 +116,7 @@ function looksLikeOpenClawContext() {
410
116
  return false;
411
117
  }
412
118
 
413
- process.stdin.on('end', () => {
119
+ process.stdin.on('end', async () => {
414
120
  const startedAt = Date.now();
415
121
  let db = null;
416
122
  let autoExtractedCount = 0;
@@ -479,11 +185,14 @@ process.stdin.on('end', () => {
479
185
 
480
186
  // Extract memorable segments
481
187
  const segments = extractMemorableSegments(conversationText);
482
- const processedSegments = processSegments(segments, dynamicThreshold);
188
+ const processedSegments = processSegments(segments, dynamicThreshold, {
189
+ hookTag: 'session-end',
190
+ conversationText,
191
+ });
483
192
 
484
193
  for (const memory of processedSegments) {
485
194
  try {
486
- saveMemory(db, memory, project);
195
+ await saveMemory(db, memory, project);
487
196
  autoExtractedCount++;
488
197
  const boostInfo = memory.frequencyBoost > 0 ? ` +${memory.frequencyBoost.toFixed(2)} boost` : '';
489
198
  console.error(`[session-end] Saved: ${memory.title} (salience: ${memory.salience.toFixed(2)}${boostInfo}, category: ${memory.category})`);
@@ -25,6 +25,18 @@ import { readTranscriptText } from './lib/transcript-reader.mjs';
25
25
  import { getAutoMemoryConfig } from './lib/auto-memory-config.mjs';
26
26
  import { recordHookInvocation } from './lib/telemetry.mjs';
27
27
  import { deriveProjectKey } from './lib/project-key.mjs';
28
+ import {
29
+ extractMemorableSegments,
30
+ processSegments,
31
+ PRE_COMPACT_CATEGORY_THRESHOLDS,
32
+ ARCHITECTURE_KEYWORDS,
33
+ ERROR_KEYWORDS,
34
+ DECISION_KEYWORDS,
35
+ LEARNING_KEYWORDS,
36
+ PATTERN_KEYWORDS,
37
+ detectKeywords,
38
+ detectCodeReferences,
39
+ } from './lib/extract-memorable-segments.mjs';
28
40
 
29
41
  // Sentinel directory for once-per-session "disabled" log lines. Without this
30
42
  // the stop hook bails silently on every turn when autoMemory.enableStop is
@@ -74,163 +86,14 @@ const { dir: DB_DIR, path: DB_PATH } = getDbPath();
74
86
  // Memory limits (kept in sync with pre-compact)
75
87
  const MAX_SHORT_TERM_MEMORIES = 100;
76
88
  const MAX_LONG_TERM_MEMORIES = 1000;
77
- const BASE_THRESHOLD = 0.35;
78
89
  const MAX_AUTO_MEMORIES = 2;
90
+ // Stop-hook uses pre-compact's tighter category thresholds — see
91
+ // PRE_COMPACT_CATEGORY_THRESHOLDS in scripts/lib/extract-memorable-segments.mjs.
79
92
 
80
- const CATEGORY_EXTRACTION_THRESHOLDS = {
81
- architecture: 0.38,
82
- error: 0.40,
83
- context: 0.42,
84
- learning: 0.42,
85
- pattern: 0.45,
86
- preference: 0.48,
87
- note: 0.52,
88
- todo: 0.50,
89
- relationship: 0.45,
90
- custom: 0.45,
91
- };
92
-
93
- // ==================== SALIENCE (mirrors pre-compact) ====================
94
-
95
- const ARCHITECTURE_KEYWORDS = ['architecture','design','pattern','structure','system','database','api','schema','model','framework','stack','microservice','monolith','serverless','infrastructure'];
96
- const ERROR_KEYWORDS = ['error','bug','fix','issue','problem','crash','fail','exception','debug','resolve','solution','workaround'];
97
- const PREFERENCE_KEYWORDS = ['prefer','always','never','style','convention','standard','like','want','should','must','require'];
98
- const PATTERN_KEYWORDS = ['pattern','practice','approach','method','technique','implementation','strategy','algorithm','workflow'];
99
- const DECISION_KEYWORDS = ['decided','decision','chose','chosen','selected','going with','will use','opted for','settled on','agreed'];
100
- const LEARNING_KEYWORDS = ['learned','discovered','realized','found out','turns out','TIL','now know','understand now','figured out'];
101
- const EMOTIONAL_MARKERS = ['important','critical','crucial','essential','key','finally','breakthrough','eureka','aha','got it','frustrating','annoying','tricky','remember'];
102
- const CODE_REFERENCE_PATTERNS = [
103
- /\b[A-Z][a-zA-Z]*\.[a-zA-Z]+\b/,
104
- /\b[a-z_][a-zA-Z0-9_]*\.(ts|js|py|go|rs)\b/,
105
- /`[^`]+`/,
106
- /\b(function|class|interface|type|const|let|var)\s+\w+/i,
107
- /\bline\s*\d+\b/i,
108
- /\b(src|lib|app|components?)\/\S+/,
109
- ];
110
-
111
- function detectKeywords(text, keywords) {
112
- const lower = text.toLowerCase();
113
- return keywords.some((k) => lower.includes(k.toLowerCase()));
114
- }
115
- function detectCodeReferences(c) {
116
- return CODE_REFERENCE_PATTERNS.some((p) => p.test(c));
117
- }
118
- function detectExplicitRequest(t) {
119
- const patterns = [
120
- /\bremember\s+(this|that)\b/i, /\bdon'?t\s+forget\b/i, /\bkeep\s+(in\s+)?mind\b/i,
121
- /\bnote\s+(this|that)\b/i, /\bsave\s+(this|that)\b/i, /\bimportant[:\s]/i,
122
- /\bfor\s+future\s+reference\b/i,
123
- ];
124
- return patterns.some((p) => p.test(t));
125
- }
126
- function calculateSalience(text) {
127
- let score = 0.25;
128
- if (detectExplicitRequest(text)) score += 0.5;
129
- if (detectKeywords(text, ARCHITECTURE_KEYWORDS)) score += 0.4;
130
- if (detectKeywords(text, ERROR_KEYWORDS)) score += 0.35;
131
- if (detectKeywords(text, DECISION_KEYWORDS)) score += 0.35;
132
- if (detectKeywords(text, LEARNING_KEYWORDS)) score += 0.3;
133
- if (detectKeywords(text, PATTERN_KEYWORDS)) score += 0.25;
134
- if (detectKeywords(text, PREFERENCE_KEYWORDS)) score += 0.25;
135
- if (detectCodeReferences(text)) score += 0.15;
136
- if (detectKeywords(text, EMOTIONAL_MARKERS)) score += 0.2;
137
- return Math.min(1.0, score);
138
- }
139
- function suggestCategory(text) {
140
- const lower = text.toLowerCase();
141
- if (detectKeywords(lower, ARCHITECTURE_KEYWORDS)) return 'architecture';
142
- if (detectKeywords(lower, ERROR_KEYWORDS)) return 'error';
143
- if (detectKeywords(lower, DECISION_KEYWORDS)) return 'context';
144
- if (detectKeywords(lower, LEARNING_KEYWORDS)) return 'learning';
145
- if (detectKeywords(lower, PREFERENCE_KEYWORDS)) return 'preference';
146
- if (detectKeywords(lower, PATTERN_KEYWORDS)) return 'pattern';
147
- if (/\b(todo|fixme|hack|xxx)\b/i.test(lower)) return 'todo';
148
- return 'note';
149
- }
150
- function extractTags(text, extractorName) {
151
- const tags = new Set();
152
- const hashtags = text.match(/#[a-zA-Z][a-zA-Z0-9_-]*/g);
153
- if (hashtags) hashtags.forEach((t) => tags.add(t.slice(1).toLowerCase()));
154
- ['react','vue','angular','node','python','typescript','javascript','api','database','sql','mongodb','postgresql','mysql','docker','kubernetes','aws','git','testing','auth','security']
155
- .forEach((t) => { if (text.toLowerCase().includes(t)) tags.add(t); });
156
- tags.add('auto-extracted');
157
- tags.add('source:stop-hook');
158
- if (extractorName) tags.add(`source:${extractorName}`);
159
- return Array.from(tags).slice(0, 12);
160
- }
161
-
162
- // ==================== EXTRACTORS ====================
163
-
164
- function extractMemorableSegments(text) {
165
- const segments = [];
166
- const extractors = [
167
- { name: 'decision', titlePrefix: 'Decision: ', patterns: [
168
- /(?:we\s+)?decided\s+(?:to\s+)?(.{15,200})/gi,
169
- /(?:going|went)\s+with\s+(.{15,150})/gi,
170
- /(?:chose|chosen|selected)\s+(.{15,150})/gi,
171
- /the\s+(?:approach|solution|fix)\s+(?:is|was)\s+(.{15,200})/gi,
172
- /(?:using|will\s+use)\s+(.{15,150})/gi,
173
- /(?:opted\s+for|settled\s+on)\s+(.{15,150})/gi,
174
- ]},
175
- { name: 'error-fix', titlePrefix: 'Fix: ', patterns: [
176
- /(?:fixed|solved|resolved)\s+(?:by\s+)?(.{15,200})/gi,
177
- /the\s+(?:fix|solution|workaround)\s+(?:is|was)\s+(.{15,200})/gi,
178
- /(?:root\s+cause|issue)\s+(?:is|was)\s+(.{15,200})/gi,
179
- /(?:error|bug)\s+(?:was\s+)?caused\s+by\s+(.{15,200})/gi,
180
- ]},
181
- { name: 'learning', titlePrefix: 'Learned: ', patterns: [
182
- /(?:learned|discovered|realized|found\s+out)\s+(?:that\s+)?(.{15,200})/gi,
183
- /turns\s+out\s+(?:that\s+)?(.{15,200})/gi,
184
- /(?:figured\s+out|worked\s+out)\s+(.{15,150})/gi,
185
- ]},
186
- { name: 'preference', titlePrefix: 'Preference: ', patterns: [
187
- /(?:always|never)\s+(.{10,150})/gi,
188
- /(?:prefer|want)\s+to\s+(.{10,150})/gi,
189
- ]},
190
- ];
191
- for (const ex of extractors) {
192
- for (const p of ex.patterns) {
193
- let m;
194
- while ((m = p.exec(text)) !== null) {
195
- const content = m[1].trim();
196
- if (content.length >= 20) {
197
- const titleContent = content.slice(0, 50).replace(/\s+/g, ' ').trim();
198
- const title = ex.titlePrefix + (titleContent.length < 50 ? titleContent : titleContent + '...');
199
- segments.push({ title, content: content.slice(0, 500), extractorType: ex.name });
200
- }
201
- }
202
- }
203
- }
204
- return segments;
205
- }
206
-
207
- function calculateOverlap(t1, t2) {
208
- const w1 = new Set(t1.toLowerCase().split(/\s+/));
209
- const w2 = new Set(t2.toLowerCase().split(/\s+/));
210
- const inter = new Set([...w1].filter((w) => w2.has(w)));
211
- const union = new Set([...w1, ...w2]);
212
- return inter.size / Math.max(1, union.size);
213
- }
214
-
215
- function processSegments(segments, dynamicThreshold) {
216
- const unique = [];
217
- for (const seg of segments) {
218
- if (unique.some((u) => calculateOverlap(u.content, seg.content) > 0.8)) continue;
219
- const text = seg.title + ' ' + seg.content;
220
- unique.push({
221
- ...seg,
222
- salience: calculateSalience(text),
223
- category: suggestCategory(text),
224
- tags: extractTags(text, seg.extractorType),
225
- });
226
- }
227
- unique.sort((a, b) => b.salience - a.salience);
228
- const filtered = unique.filter((s) => {
229
- const cat = CATEGORY_EXTRACTION_THRESHOLDS[s.category] ?? BASE_THRESHOLD;
230
- return s.salience >= Math.min(cat, dynamicThreshold);
231
- });
232
- return filtered.slice(0, MAX_AUTO_MEMORIES);
233
- }
93
+ // Salience detection, content extraction, and segment processing live in
94
+ // scripts/lib/extract-memorable-segments.mjs. Stop-hook uses the lighter
95
+ // 'stop' extractor set (no architecture / important-note) for backward
96
+ // compatibility with its pre-refactor behaviour.
234
97
 
235
98
  function getMemoryStats(db) {
236
99
  try {
@@ -311,7 +174,7 @@ process.stdin.on('readable', () => {
311
174
  while ((chunk = process.stdin.read()) !== null) input += chunk;
312
175
  });
313
176
 
314
- process.stdin.on('end', () => {
177
+ process.stdin.on('end', async () => {
315
178
  const startedAt = Date.now();
316
179
  let db = null;
317
180
  let extractedCount = 0;
@@ -401,12 +264,18 @@ process.stdin.on('end', () => {
401
264
  const max = MAX_SHORT_TERM_MEMORIES + MAX_LONG_TERM_MEMORIES;
402
265
  const dyn = getDynamicThreshold(total, max);
403
266
 
404
- const segments = extractMemorableSegments(transcriptOut.text);
405
- const processed = processSegments(segments, dyn);
267
+ const segments = extractMemorableSegments(transcriptOut.text, { mode: 'stop' });
268
+ const processed = processSegments(segments, dyn, {
269
+ hookTag: 'source:stop-hook',
270
+ maxMemories: MAX_AUTO_MEMORIES,
271
+ categoryThresholds: PRE_COMPACT_CATEGORY_THRESHOLDS,
272
+ applyFrequencyBoost: false,
273
+ conversationText: transcriptOut.text,
274
+ });
406
275
 
407
276
  for (const memory of processed) {
408
277
  try {
409
- saveAutoExtractedMemory(db, memory, project);
278
+ await saveAutoExtractedMemory(db, memory, project, { source: 'stop-hook' });
410
279
  extractedCount++;
411
280
  console.error(`[stop] Saved: ${memory.title} (salience: ${memory.salience.toFixed(2)}, category: ${memory.category})`);
412
281
  } catch (err) {