shieldcortex 4.12.14 → 4.13.1
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.
- package/dashboard/.next/standalone/dashboard/.next/BUILD_ID +1 -1
- package/dashboard/.next/standalone/dashboard/.next/build-manifest.json +2 -2
- package/dashboard/.next/standalone/dashboard/.next/prerender-manifest.json +3 -3
- package/dashboard/.next/standalone/dashboard/.next/required-server-files.json +4 -4
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/admin/page.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/admin/page.js.nft.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/admin/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/cloud/page.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/cloud/page.js.nft.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/cloud/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/memory/capture/page.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/memory/capture/page.js.nft.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/memory/capture/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/memory/graph/page.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/memory/graph/page.js.nft.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/memory/graph/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/memory/page.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/memory/page.js.nft.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/memory/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/memory/recall/page.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/memory/recall/page.js.nft.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/memory/recall/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/memory/review/page.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/memory/review/page.js.nft.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/memory/review/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/memory/timeline/page.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/memory/timeline/page.js.nft.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/memory/timeline/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/overview/page.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/overview/page.js.nft.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/overview/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/protection/audit/page.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/protection/audit/page.js.nft.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/protection/audit/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/protection/intercepts/page.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/protection/intercepts/page.js.nft.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/protection/intercepts/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/protection/iron-dome/page.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/protection/iron-dome/page.js.nft.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/protection/iron-dome/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/protection/page.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/protection/page.js.nft.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/protection/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/protection/policies/page.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/protection/policies/page.js.nft.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/protection/policies/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/protection/quarantine/page.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/protection/quarantine/page.js.nft.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/protection/quarantine/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/settings/page.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/settings/page.js.nft.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/supply-chain/page.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/supply-chain/page.js.nft.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/supply-chain/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/supply-chain/xray/page.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/supply-chain/xray/page.js.nft.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/supply-chain/xray/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/xray/page.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/xray/page.js.nft.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/(dashboard)/xray/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.html +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/admin.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/admin.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/admin.segments/!KGRhc2hib2FyZCk/admin/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/admin.segments/!KGRhc2hib2FyZCk/admin.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/admin.segments/!KGRhc2hib2FyZCk.segment.rsc +9 -7
- package/dashboard/.next/standalone/dashboard/.next/server/app/admin.segments/_full.segment.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/admin.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/admin.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/admin.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/cloud.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/cloud.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/cloud.segments/!KGRhc2hib2FyZCk/cloud/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/cloud.segments/!KGRhc2hib2FyZCk/cloud.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/cloud.segments/!KGRhc2hib2FyZCk.segment.rsc +9 -7
- package/dashboard/.next/standalone/dashboard/.next/server/app/cloud.segments/_full.segment.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/cloud.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/cloud.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/cloud.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/capture.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/capture.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/capture.segments/!KGRhc2hib2FyZCk/memory/capture/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/capture.segments/!KGRhc2hib2FyZCk/memory/capture.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/capture.segments/!KGRhc2hib2FyZCk/memory.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/capture.segments/!KGRhc2hib2FyZCk.segment.rsc +9 -7
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/capture.segments/_full.segment.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/capture.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/capture.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/capture.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/graph.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/graph.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/graph.segments/!KGRhc2hib2FyZCk/memory/graph/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/graph.segments/!KGRhc2hib2FyZCk/memory/graph.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/graph.segments/!KGRhc2hib2FyZCk/memory.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/graph.segments/!KGRhc2hib2FyZCk.segment.rsc +9 -7
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/graph.segments/_full.segment.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/graph.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/graph.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/graph.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/recall.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/recall.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/recall.segments/!KGRhc2hib2FyZCk/memory/recall/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/recall.segments/!KGRhc2hib2FyZCk/memory/recall.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/recall.segments/!KGRhc2hib2FyZCk/memory.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/recall.segments/!KGRhc2hib2FyZCk.segment.rsc +9 -7
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/recall.segments/_full.segment.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/recall.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/recall.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/recall.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/review.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/review.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/review.segments/!KGRhc2hib2FyZCk/memory/review/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/review.segments/!KGRhc2hib2FyZCk/memory/review.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/review.segments/!KGRhc2hib2FyZCk/memory.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/review.segments/!KGRhc2hib2FyZCk.segment.rsc +9 -7
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/review.segments/_full.segment.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/review.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/review.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/review.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/timeline.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/timeline.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/timeline.segments/!KGRhc2hib2FyZCk/memory/timeline/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/timeline.segments/!KGRhc2hib2FyZCk/memory/timeline.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/timeline.segments/!KGRhc2hib2FyZCk/memory.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/timeline.segments/!KGRhc2hib2FyZCk.segment.rsc +9 -7
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/timeline.segments/_full.segment.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/timeline.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/timeline.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory/timeline.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory.rsc +21 -18
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory.segments/!KGRhc2hib2FyZCk/memory/__PAGE__.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory.segments/!KGRhc2hib2FyZCk/memory.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory.segments/!KGRhc2hib2FyZCk.segment.rsc +9 -7
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory.segments/_full.segment.rsc +21 -18
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/memory.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/overview.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/overview.rsc +20 -18
- package/dashboard/.next/standalone/dashboard/.next/server/app/overview.segments/!KGRhc2hib2FyZCk/overview/__PAGE__.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/overview.segments/!KGRhc2hib2FyZCk/overview.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/overview.segments/!KGRhc2hib2FyZCk.segment.rsc +9 -7
- package/dashboard/.next/standalone/dashboard/.next/server/app/overview.segments/_full.segment.rsc +20 -18
- package/dashboard/.next/standalone/dashboard/.next/server/app/overview.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/overview.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/overview.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/page.js.nft.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/audit.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/audit.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/audit.segments/!KGRhc2hib2FyZCk/protection/audit/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/audit.segments/!KGRhc2hib2FyZCk/protection/audit.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/audit.segments/!KGRhc2hib2FyZCk/protection.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/audit.segments/!KGRhc2hib2FyZCk.segment.rsc +9 -7
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/audit.segments/_full.segment.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/audit.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/audit.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/audit.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/intercepts.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/intercepts.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/intercepts.segments/!KGRhc2hib2FyZCk/protection/intercepts/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/intercepts.segments/!KGRhc2hib2FyZCk/protection/intercepts.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/intercepts.segments/!KGRhc2hib2FyZCk/protection.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/intercepts.segments/!KGRhc2hib2FyZCk.segment.rsc +9 -7
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/intercepts.segments/_full.segment.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/intercepts.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/intercepts.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/intercepts.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/iron-dome.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/iron-dome.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/iron-dome.segments/!KGRhc2hib2FyZCk/protection/iron-dome/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/iron-dome.segments/!KGRhc2hib2FyZCk/protection/iron-dome.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/iron-dome.segments/!KGRhc2hib2FyZCk/protection.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/iron-dome.segments/!KGRhc2hib2FyZCk.segment.rsc +9 -7
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/iron-dome.segments/_full.segment.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/iron-dome.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/iron-dome.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/iron-dome.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/policies.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/policies.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/policies.segments/!KGRhc2hib2FyZCk/protection/policies/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/policies.segments/!KGRhc2hib2FyZCk/protection/policies.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/policies.segments/!KGRhc2hib2FyZCk/protection.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/policies.segments/!KGRhc2hib2FyZCk.segment.rsc +9 -7
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/policies.segments/_full.segment.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/policies.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/policies.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/policies.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/quarantine.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/quarantine.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/quarantine.segments/!KGRhc2hib2FyZCk/protection/quarantine/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/quarantine.segments/!KGRhc2hib2FyZCk/protection/quarantine.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/quarantine.segments/!KGRhc2hib2FyZCk/protection.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/quarantine.segments/!KGRhc2hib2FyZCk.segment.rsc +9 -7
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/quarantine.segments/_full.segment.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/quarantine.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/quarantine.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection/quarantine.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection.segments/!KGRhc2hib2FyZCk/protection/__PAGE__.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection.segments/!KGRhc2hib2FyZCk/protection.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection.segments/!KGRhc2hib2FyZCk.segment.rsc +9 -7
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection.segments/_full.segment.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/protection.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/settings.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/settings.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/settings.segments/!KGRhc2hib2FyZCk/settings/__PAGE__.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/settings.segments/!KGRhc2hib2FyZCk/settings.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/settings.segments/!KGRhc2hib2FyZCk.segment.rsc +9 -7
- package/dashboard/.next/standalone/dashboard/.next/server/app/settings.segments/_full.segment.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/settings.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain/xray.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain/xray.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain/xray.segments/!KGRhc2hib2FyZCk/supply-chain/xray/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain/xray.segments/!KGRhc2hib2FyZCk/supply-chain/xray.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain/xray.segments/!KGRhc2hib2FyZCk/supply-chain.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain/xray.segments/!KGRhc2hib2FyZCk.segment.rsc +9 -7
- package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain/xray.segments/_full.segment.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain/xray.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain/xray.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain/xray.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain.segments/!KGRhc2hib2FyZCk/supply-chain/__PAGE__.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain.segments/!KGRhc2hib2FyZCk/supply-chain.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain.segments/!KGRhc2hib2FyZCk.segment.rsc +9 -7
- package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain.segments/_full.segment.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/supply-chain.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/xray.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/xray.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/xray.segments/!KGRhc2hib2FyZCk/xray/__PAGE__.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/xray.segments/!KGRhc2hib2FyZCk/xray.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/xray.segments/!KGRhc2hib2FyZCk.segment.rsc +9 -7
- package/dashboard/.next/standalone/dashboard/.next/server/app/xray.segments/_full.segment.rsc +17 -15
- package/dashboard/.next/standalone/dashboard/.next/server/app/xray.segments/_head.segment.rsc +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/app/xray.segments/_index.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/app/xray.segments/_tree.segment.rsc +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/9f1d4_@tanstack_68dcbde9._.js +3 -0
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__fb5796ae._.js → [root-of-the-server]__2de25d56._.js} +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/[root-of-the-server]__52bd7a9f._.js +3 -0
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/{[root-of-the-server]__b789489c._.js → [root-of-the-server]__6f881a23._.js} +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_01f6ceb0._.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_20c6acea._.js +3 -0
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/{9f1d4_next_c9fe89e1._.js → dashboard_25b568c3._.js} +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_2a8eef6b._.js +3 -0
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_35a9932a._.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_37f17371._.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_77cb2b63._.js +3 -0
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_91003e6d._.js +3 -0
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_9b8695d8._.js +3 -0
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_a16ef10a._.js +3 -0
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_c219bf07._.js +4 -4
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_f9cd1dc2._.js +3 -0
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_fefd3b85._.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_src_44a9f72c._.js +3 -0
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_src_components_de7ac4f9._.js +3 -0
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_src_components_protection_ProtectionOverview_tsx_54554a97._.js +3 -3
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_src_components_settings_SettingsView_tsx_16dc83a7._.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_src_components_xray_XRayOverview_tsx_ceba698e._.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/pages/404.html +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/pages/500.html +2 -2
- package/dashboard/.next/standalone/dashboard/.next/server/server-reference-manifest.js +1 -1
- package/dashboard/.next/standalone/dashboard/.next/server/server-reference-manifest.json +1 -1
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/015dc64369f26b7d.css +3 -0
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/2fe84829530e61a3.js +1 -0
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/34d0309a4e34b084.js +1 -0
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/3729c748a4361c1f.js +1 -0
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/3b7fdf1ee828254c.js +1 -0
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/{3d53807a9a943ce7.js → 4c90ebd2c08cd656.js} +4 -4
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/4d4af0cecaef56f2.js +1 -0
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/4eb86dc2f379d3ca.js +1 -0
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/6aba18b7aac42ccd.js +1 -0
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/{b4b3fb5729bead7e.js → 6ea97c8dc9e30ea5.js} +1 -1
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/74ea1a87751e93a3.js +1 -0
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/910628c23329a773.js +1 -0
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/{c288964c4c00982a.js → b308a787e8cbc2a9.js} +3 -3
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/bdb50889a1c1ab37.js +1 -0
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/d0bf5ccba09917dd.js +1 -0
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/e804a1fda2839550.js +1 -0
- package/dashboard/.next/standalone/dashboard/server.js +1 -1
- package/dist/api/routes/digest.d.ts +59 -0
- package/dist/api/routes/digest.js +305 -0
- package/dist/api/routes/memories.js +84 -15
- package/dist/api/routes/system.js +10 -2
- package/dist/api/visualization-server.js +2 -0
- package/dist/cli/doctor.d.ts +42 -0
- package/dist/cli/doctor.js +173 -0
- package/dist/cli/migrate-legacy.d.ts +28 -0
- package/dist/cli/migrate-legacy.js +291 -0
- package/dist/cloud/cli.js +2 -2
- package/dist/cloud/config.d.ts +22 -0
- package/dist/cloud/config.js +38 -0
- package/dist/database/init.js +26 -1
- package/dist/index.js +8 -1
- package/dist/memory/backup.d.ts +19 -0
- package/dist/memory/backup.js +47 -0
- package/dist/memory/dedupe-runner.d.ts +33 -0
- package/dist/memory/dedupe-runner.js +103 -0
- package/dist/memory/fts.d.ts +26 -0
- package/dist/memory/fts.js +59 -0
- package/dist/memory/lifecycle.d.ts +83 -0
- package/dist/memory/lifecycle.js +274 -0
- package/dist/memory/links.d.ts +63 -0
- package/dist/memory/links.js +232 -0
- package/dist/memory/prune.d.ts +34 -0
- package/dist/memory/prune.js +76 -0
- package/dist/memory/search-recall.d.ts +48 -0
- package/dist/memory/search-recall.js +367 -0
- package/dist/memory/store.d.ts +6 -121
- package/dist/memory/store.js +45 -854
- package/dist/setup/claude-md.d.ts +1 -0
- package/dist/setup/deep-clean.d.ts +33 -0
- package/dist/setup/deep-clean.js +26 -0
- package/dist/setup/doctor.js +7 -2
- package/dist/setup/settings-hooks.d.ts +1 -0
- package/dist/setup/settings-hooks.js +51 -5
- package/dist/setup/status.js +39 -0
- package/hooks/openclaw/cortex-memory/runtime.mjs +18 -4
- package/package.json +1 -1
- package/plugins/openclaw/dist/index.js +12 -6
- package/plugins/openclaw/dist/openclaw.plugin.json +1 -1
- package/scripts/lib/auto-memory-config.mjs +53 -0
- package/scripts/lib/telemetry.mjs +58 -0
- package/scripts/lib/transcript-reader.mjs +123 -0
- package/scripts/postinstall.mjs +47 -1
- package/scripts/pre-compact-hook.mjs +76 -124
- package/scripts/session-end-hook.mjs +102 -97
- package/scripts/stop-hook.mjs +385 -116
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/9f1d4_@tanstack_785e068c._.js +0 -3
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/[root-of-the-server]__c2b92077._.js +0 -3
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_11878109._.js +0 -3
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_35c9f22e._.js +0 -3
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_836b4a04._.js +0 -3
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_9770c429._.js +0 -3
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_9dd626ed._.js +0 -3
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_e94d2da2._.js +0 -3
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_src_564ea5ae._.js +0 -3
- package/dashboard/.next/standalone/dashboard/.next/server/chunks/ssr/dashboard_src_lib_3f1490a1._.js +0 -3
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/079a5be036130e37.js +0 -1
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/1770a8ce7abb2437.js +0 -1
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/1a074f8ddc7cd385.js +0 -1
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/24da99d1341bd573.css +0 -3
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/2aa8afb655c1c2e5.js +0 -1
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/302ad459a0e5c4ba.js +0 -1
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/385ec610bad1acc5.js +0 -1
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/4f57582c2d186438.js +0 -1
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/52843253e4b833a5.js +0 -1
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/7fca141efba9d353.js +0 -1
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/8593e1796c9d043d.js +0 -1
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/cbc2e6ffcad6e91c.js +0 -1
- package/dashboard/.next/standalone/dashboard/.next/static/chunks/fced7dd3c9874ed1.js +0 -1
- /package/dashboard/.next/standalone/dashboard/.next/static/{P2sW3M-qHaW9VS9YwCEg3 → 2JvJZkELhPQRzhTlgun1M}/_buildManifest.js +0 -0
- /package/dashboard/.next/standalone/dashboard/.next/static/{P2sW3M-qHaW9VS9YwCEg3 → 2JvJZkELhPQRzhTlgun1M}/_clientMiddlewareManifest.json +0 -0
- /package/dashboard/.next/standalone/dashboard/.next/static/{P2sW3M-qHaW9VS9YwCEg3 → 2JvJZkELhPQRzhTlgun1M}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copy the live memories DB to ~/.shieldcortex/backups/ using SQLite's
|
|
3
|
+
* backup() API (consistent snapshot even with the API server holding an
|
|
4
|
+
* open WAL connection). Returns the absolute path of the written file.
|
|
5
|
+
*
|
|
6
|
+
* Used as a safety net before any destructive maintenance op (prune /
|
|
7
|
+
* dedupe). The caller surfaces the path back to the user so they can
|
|
8
|
+
* restore manually if a maintenance run was wrong.
|
|
9
|
+
*/
|
|
10
|
+
export declare function backupMemoriesDb(label: string): Promise<string>;
|
|
11
|
+
/**
|
|
12
|
+
* List existing backups newest-first. Caller can show this in the UI so
|
|
13
|
+
* the user knows what restore points exist.
|
|
14
|
+
*/
|
|
15
|
+
export declare function listMemoriesBackups(): Array<{
|
|
16
|
+
path: string;
|
|
17
|
+
sizeBytes: number;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
import { getDatabase } from '../database/init.js';
|
|
5
|
+
/**
|
|
6
|
+
* Copy the live memories DB to ~/.shieldcortex/backups/ using SQLite's
|
|
7
|
+
* backup() API (consistent snapshot even with the API server holding an
|
|
8
|
+
* open WAL connection). Returns the absolute path of the written file.
|
|
9
|
+
*
|
|
10
|
+
* Used as a safety net before any destructive maintenance op (prune /
|
|
11
|
+
* dedupe). The caller surfaces the path back to the user so they can
|
|
12
|
+
* restore manually if a maintenance run was wrong.
|
|
13
|
+
*/
|
|
14
|
+
export async function backupMemoriesDb(label) {
|
|
15
|
+
const home = os.homedir();
|
|
16
|
+
const backupDir = path.join(home, '.shieldcortex', 'backups');
|
|
17
|
+
if (!fs.existsSync(backupDir)) {
|
|
18
|
+
fs.mkdirSync(backupDir, { recursive: true });
|
|
19
|
+
}
|
|
20
|
+
const stamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
21
|
+
const safeLabel = label.replace(/[^A-Za-z0-9_-]/g, '_').slice(0, 32) || 'backup';
|
|
22
|
+
const outPath = path.join(backupDir, `memories.${stamp}.${safeLabel}.db`);
|
|
23
|
+
const db = getDatabase();
|
|
24
|
+
// better-sqlite3's backup() returns a Promise that resolves once the
|
|
25
|
+
// page-by-page copy completes. It honours WAL mode so the snapshot is
|
|
26
|
+
// consistent without locking the API server out.
|
|
27
|
+
await db.backup(outPath);
|
|
28
|
+
return outPath;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* List existing backups newest-first. Caller can show this in the UI so
|
|
32
|
+
* the user knows what restore points exist.
|
|
33
|
+
*/
|
|
34
|
+
export function listMemoriesBackups() {
|
|
35
|
+
const home = os.homedir();
|
|
36
|
+
const backupDir = path.join(home, '.shieldcortex', 'backups');
|
|
37
|
+
if (!fs.existsSync(backupDir))
|
|
38
|
+
return [];
|
|
39
|
+
return fs.readdirSync(backupDir)
|
|
40
|
+
.filter((name) => name.startsWith('memories.') && name.endsWith('.db'))
|
|
41
|
+
.map((name) => {
|
|
42
|
+
const full = path.join(backupDir, name);
|
|
43
|
+
const stat = fs.statSync(full);
|
|
44
|
+
return { path: full, sizeBytes: stat.size, createdAt: stat.mtime.toISOString() };
|
|
45
|
+
})
|
|
46
|
+
.sort((a, b) => b.createdAt.localeCompare(a.createdAt));
|
|
47
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface DedupeOptions {
|
|
2
|
+
/** Optional project scope. */
|
|
3
|
+
project?: string;
|
|
4
|
+
/** When true (default) only count + sample pairs, no merges. */
|
|
5
|
+
dryRun?: boolean;
|
|
6
|
+
/** Cap on pairs returned/processed. Default 200. */
|
|
7
|
+
limit?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface DedupeGroupSummary {
|
|
10
|
+
keepId: number;
|
|
11
|
+
keepTitle: string;
|
|
12
|
+
removeIds: number[];
|
|
13
|
+
/** Average pairwise similarity score (text-based, 0..1). */
|
|
14
|
+
similarity: string;
|
|
15
|
+
}
|
|
16
|
+
export interface DedupeResult {
|
|
17
|
+
options: {
|
|
18
|
+
project: string | null;
|
|
19
|
+
dryRun: boolean;
|
|
20
|
+
limit: number;
|
|
21
|
+
};
|
|
22
|
+
pairsFound: number;
|
|
23
|
+
groups: DedupeGroupSummary[];
|
|
24
|
+
merged?: number;
|
|
25
|
+
backupPath?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Find near-duplicate long-term memories (text-based: title similarity +
|
|
29
|
+
* content overlap, via the existing findDuplicateMemoryPairs heuristic) and
|
|
30
|
+
* optionally merge them by keeping the highest-salience representative and
|
|
31
|
+
* deleting the rest. Backs up the live DB before any merge.
|
|
32
|
+
*/
|
|
33
|
+
export declare function dedupeMemories(rawOptions?: DedupeOptions): Promise<DedupeResult>;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { findDuplicateMemoryPairs } from './consolidate.js';
|
|
2
|
+
import { deleteMemory } from './store.js';
|
|
3
|
+
import { backupMemoriesDb } from './backup.js';
|
|
4
|
+
/**
|
|
5
|
+
* Group pairs into clusters by treating "duplicate" as a transitive
|
|
6
|
+
* relation: if A↔B and B↔C are both flagged, A,B,C cluster together. The
|
|
7
|
+
* representative of each cluster is `recommendedKeepId` (highest salience
|
|
8
|
+
* tie-broken by most recent).
|
|
9
|
+
*/
|
|
10
|
+
function clusterPairs(pairs) {
|
|
11
|
+
// Union-find over memory ids.
|
|
12
|
+
const parent = new Map();
|
|
13
|
+
const find = (id) => {
|
|
14
|
+
if (!parent.has(id))
|
|
15
|
+
parent.set(id, id);
|
|
16
|
+
let cur = id;
|
|
17
|
+
while (parent.get(cur) !== cur)
|
|
18
|
+
cur = parent.get(cur);
|
|
19
|
+
return cur;
|
|
20
|
+
};
|
|
21
|
+
const union = (a, b) => {
|
|
22
|
+
const ra = find(a);
|
|
23
|
+
const rb = find(b);
|
|
24
|
+
if (ra !== rb)
|
|
25
|
+
parent.set(ra, rb);
|
|
26
|
+
};
|
|
27
|
+
const memoryById = new Map();
|
|
28
|
+
const similarityById = new Map();
|
|
29
|
+
for (const pair of pairs) {
|
|
30
|
+
union(pair.memoryA.id, pair.memoryB.id);
|
|
31
|
+
memoryById.set(pair.memoryA.id, pair.memoryA);
|
|
32
|
+
memoryById.set(pair.memoryB.id, pair.memoryB);
|
|
33
|
+
similarityById.set(pair.memoryA.id, pair.similarity);
|
|
34
|
+
similarityById.set(pair.memoryB.id, pair.similarity);
|
|
35
|
+
}
|
|
36
|
+
const clusters = new Map();
|
|
37
|
+
for (const id of memoryById.keys()) {
|
|
38
|
+
const root = find(id);
|
|
39
|
+
if (!clusters.has(root))
|
|
40
|
+
clusters.set(root, []);
|
|
41
|
+
clusters.get(root).push(id);
|
|
42
|
+
}
|
|
43
|
+
const groups = [];
|
|
44
|
+
for (const [, ids] of clusters) {
|
|
45
|
+
if (ids.length < 2)
|
|
46
|
+
continue;
|
|
47
|
+
// Highest salience wins; tie → most recent.
|
|
48
|
+
let keepId = ids[0];
|
|
49
|
+
for (const id of ids) {
|
|
50
|
+
const a = memoryById.get(id);
|
|
51
|
+
const b = memoryById.get(keepId);
|
|
52
|
+
const aS = a.salience ?? 0;
|
|
53
|
+
const bS = b.salience ?? 0;
|
|
54
|
+
const aT = new Date(a.createdAt ?? 0).getTime();
|
|
55
|
+
const bT = new Date(b.createdAt ?? 0).getTime();
|
|
56
|
+
if (aS > bS || (aS === bS && aT > bT))
|
|
57
|
+
keepId = id;
|
|
58
|
+
}
|
|
59
|
+
const removeIds = ids.filter((id) => id !== keepId);
|
|
60
|
+
groups.push({
|
|
61
|
+
keepId,
|
|
62
|
+
keepTitle: memoryById.get(keepId).title,
|
|
63
|
+
removeIds,
|
|
64
|
+
similarity: similarityById.get(keepId) ?? '',
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return groups.sort((a, b) => b.removeIds.length - a.removeIds.length);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Find near-duplicate long-term memories (text-based: title similarity +
|
|
71
|
+
* content overlap, via the existing findDuplicateMemoryPairs heuristic) and
|
|
72
|
+
* optionally merge them by keeping the highest-salience representative and
|
|
73
|
+
* deleting the rest. Backs up the live DB before any merge.
|
|
74
|
+
*/
|
|
75
|
+
export async function dedupeMemories(rawOptions = {}) {
|
|
76
|
+
const options = {
|
|
77
|
+
project: rawOptions.project ?? null,
|
|
78
|
+
dryRun: rawOptions.dryRun ?? true,
|
|
79
|
+
limit: rawOptions.limit ?? 200,
|
|
80
|
+
};
|
|
81
|
+
const pairs = findDuplicateMemoryPairs({
|
|
82
|
+
project: options.project ?? undefined,
|
|
83
|
+
limit: options.limit,
|
|
84
|
+
});
|
|
85
|
+
const groups = clusterPairs(pairs);
|
|
86
|
+
const result = {
|
|
87
|
+
options,
|
|
88
|
+
pairsFound: pairs.length,
|
|
89
|
+
groups,
|
|
90
|
+
};
|
|
91
|
+
if (options.dryRun || groups.length === 0)
|
|
92
|
+
return result;
|
|
93
|
+
result.backupPath = await backupMemoriesDb('pre-dedupe');
|
|
94
|
+
let merged = 0;
|
|
95
|
+
for (const group of groups) {
|
|
96
|
+
for (const id of group.removeIds) {
|
|
97
|
+
if (deleteMemory(id, { type: 'cli', identifier: 'maintenance:dedupe' }))
|
|
98
|
+
merged++;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
result.merged = merged;
|
|
102
|
+
return result;
|
|
103
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared FTS5 + JSON helpers used across memory store modules.
|
|
3
|
+
*
|
|
4
|
+
* Lifted out of store.ts so the memory module split can avoid
|
|
5
|
+
* circular imports and silent helper duplication.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Escape FTS5 query to prevent syntax errors.
|
|
9
|
+
*
|
|
10
|
+
* FTS5 interprets:
|
|
11
|
+
* - "word-word" as "column:value" syntax
|
|
12
|
+
* - AND, OR, NOT as boolean operators
|
|
13
|
+
* - &, | as boolean operators
|
|
14
|
+
*
|
|
15
|
+
* We quote individual terms to search them literally. Apostrophes are
|
|
16
|
+
* split on because the porter unicode61 tokenizer treats them as word
|
|
17
|
+
* separators during indexing ("don't" → "don" + "t"); queries must
|
|
18
|
+
* split the same way to match indexed tokens.
|
|
19
|
+
*/
|
|
20
|
+
export declare function escapeFts5Query(query: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* Safely parse JSON with fallback — prevents corrupted DB values from
|
|
23
|
+
* crashing queries. Returns the fallback for null, undefined, empty
|
|
24
|
+
* string, or any parse error.
|
|
25
|
+
*/
|
|
26
|
+
export declare function safeJsonParse<T>(value: string | null | undefined, fallback: T): T;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared FTS5 + JSON helpers used across memory store modules.
|
|
3
|
+
*
|
|
4
|
+
* Lifted out of store.ts so the memory module split can avoid
|
|
5
|
+
* circular imports and silent helper duplication.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Escape FTS5 query to prevent syntax errors.
|
|
9
|
+
*
|
|
10
|
+
* FTS5 interprets:
|
|
11
|
+
* - "word-word" as "column:value" syntax
|
|
12
|
+
* - AND, OR, NOT as boolean operators
|
|
13
|
+
* - &, | as boolean operators
|
|
14
|
+
*
|
|
15
|
+
* We quote individual terms to search them literally. Apostrophes are
|
|
16
|
+
* split on because the porter unicode61 tokenizer treats them as word
|
|
17
|
+
* separators during indexing ("don't" → "don" + "t"); queries must
|
|
18
|
+
* split the same way to match indexed tokens.
|
|
19
|
+
*/
|
|
20
|
+
export function escapeFts5Query(query) {
|
|
21
|
+
return query
|
|
22
|
+
.split(/\s+/)
|
|
23
|
+
.filter((term) => term.length > 0)
|
|
24
|
+
.map((term) => {
|
|
25
|
+
if (term.includes("'")) {
|
|
26
|
+
const parts = term.split("'").filter((p) => p.length > 0);
|
|
27
|
+
return parts.map((p) => {
|
|
28
|
+
if (/[^a-zA-Z0-9_]/.test(p))
|
|
29
|
+
return `"${p.replace(/"/g, '""')}"`;
|
|
30
|
+
return p;
|
|
31
|
+
}).join(' ');
|
|
32
|
+
}
|
|
33
|
+
const upperTerm = term.toUpperCase();
|
|
34
|
+
if (upperTerm === 'AND' || upperTerm === 'OR' || upperTerm === 'NOT') {
|
|
35
|
+
return `"${term}"`;
|
|
36
|
+
}
|
|
37
|
+
if (/[^a-zA-Z0-9_]/.test(term)) {
|
|
38
|
+
return `"${term.replace(/"/g, '""')}"`;
|
|
39
|
+
}
|
|
40
|
+
return term;
|
|
41
|
+
})
|
|
42
|
+
.filter(Boolean)
|
|
43
|
+
.join(' ');
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Safely parse JSON with fallback — prevents corrupted DB values from
|
|
47
|
+
* crashing queries. Returns the fallback for null, undefined, empty
|
|
48
|
+
* string, or any parse error.
|
|
49
|
+
*/
|
|
50
|
+
export function safeJsonParse(value, fallback) {
|
|
51
|
+
if (!value)
|
|
52
|
+
return fallback;
|
|
53
|
+
try {
|
|
54
|
+
return JSON.parse(value);
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return fallback;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Memory lifecycle operations.
|
|
3
|
+
*
|
|
4
|
+
* Phase 2 of the audit-recommended store.ts split. The "lifecycle"
|
|
5
|
+
* group is the set of functions that mutate a memory's state over
|
|
6
|
+
* time *without* being CRUD: access reinforcement, search
|
|
7
|
+
* reinforcement, enrichment, decay-score persistence, STM→LTM
|
|
8
|
+
* promotion, and bulk decay cleanup. Lifted out of store.ts (still
|
|
9
|
+
* 1,800+ lines after phase 1) so each concern can be read on its
|
|
10
|
+
* own. No behaviour change vs the original implementation — exports
|
|
11
|
+
* re-emerge from store.ts via a barrel re-export so existing import
|
|
12
|
+
* paths keep working.
|
|
13
|
+
*
|
|
14
|
+
* Imports from store.ts (getMemoryById, rowToMemory, getMemoriesByType,
|
|
15
|
+
* MAX_CONTENT_SIZE) form a module cycle. Both directions only invoke
|
|
16
|
+
* the imported symbols inside function bodies — ESM live bindings
|
|
17
|
+
* handle this correctly at runtime. As of phase 3, reinforceFromSearch
|
|
18
|
+
* and enrichMemory are consumed by search-recall.ts (not store.ts);
|
|
19
|
+
* that import is non-cyclic since search-recall.ts is a leaf consumer
|
|
20
|
+
* of lifecycle.ts.
|
|
21
|
+
*/
|
|
22
|
+
import { Memory, MemoryConfig } from './types.js';
|
|
23
|
+
import type { DefenceSource } from '../defence/types.js';
|
|
24
|
+
/**
|
|
25
|
+
* Access a memory (updates access count and timestamp, returns reinforced memory)
|
|
26
|
+
*/
|
|
27
|
+
export declare function accessMemory(id: number, config?: MemoryConfig, source?: DefenceSource): Memory | null;
|
|
28
|
+
/**
|
|
29
|
+
* Reinforce a memory that appeared in search results
|
|
30
|
+
* Gives a small salience boost with diminishing returns based on access count.
|
|
31
|
+
* ORGANIC FEATURE: Searched memories get reinforced, closing the feedback loop
|
|
32
|
+
* so frequently-found memories grow stronger over time.
|
|
33
|
+
*/
|
|
34
|
+
export declare function reinforceFromSearch(memoryId: number): void;
|
|
35
|
+
/**
|
|
36
|
+
* Enrichment result indicating what happened
|
|
37
|
+
*/
|
|
38
|
+
export interface EnrichmentResult {
|
|
39
|
+
enriched: boolean;
|
|
40
|
+
reason: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Enrich a memory with additional context
|
|
44
|
+
*
|
|
45
|
+
* This adds timestamped context to a memory when:
|
|
46
|
+
* 1. The new context is sufficiently related but different (new information)
|
|
47
|
+
* 2. The memory hasn't been enriched recently (cooldown)
|
|
48
|
+
* 3. The content won't exceed the size limit
|
|
49
|
+
*
|
|
50
|
+
* ORGANIC FEATURE: Memories grow with new context over time,
|
|
51
|
+
* mimicking how human memories are reconsolidated with new information
|
|
52
|
+
*
|
|
53
|
+
* @param memoryId - ID of the memory to enrich
|
|
54
|
+
* @param newContext - New context to add
|
|
55
|
+
* @param contextType - Type of context ('search' | 'access' | 'related')
|
|
56
|
+
* @returns EnrichmentResult indicating success or failure with reason
|
|
57
|
+
*/
|
|
58
|
+
export declare function enrichMemory(memoryId: number, newContext: string, contextType?: 'search' | 'access' | 'related'): EnrichmentResult;
|
|
59
|
+
/**
|
|
60
|
+
* Clear enrichment cooldown for a memory (for testing)
|
|
61
|
+
*/
|
|
62
|
+
export declare function clearEnrichmentCooldown(memoryId: number): void;
|
|
63
|
+
/**
|
|
64
|
+
* Get enrichment cooldown status for a memory
|
|
65
|
+
*/
|
|
66
|
+
export declare function getEnrichmentCooldownStatus(memoryId: number): {
|
|
67
|
+
onCooldown: boolean;
|
|
68
|
+
remainingMs: number;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Update persisted decay scores for all memories
|
|
72
|
+
* Called during consolidation and periodically by the API server
|
|
73
|
+
* Returns the number of memories updated
|
|
74
|
+
*/
|
|
75
|
+
export declare function updateDecayScores(): number;
|
|
76
|
+
/**
|
|
77
|
+
* Promote a memory from short-term to long-term
|
|
78
|
+
*/
|
|
79
|
+
export declare function promoteMemory(id: number): Memory | null;
|
|
80
|
+
/**
|
|
81
|
+
* Bulk delete decayed memories
|
|
82
|
+
*/
|
|
83
|
+
export declare function cleanupDecayedMemories(config?: MemoryConfig): number;
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Memory lifecycle operations.
|
|
3
|
+
*
|
|
4
|
+
* Phase 2 of the audit-recommended store.ts split. The "lifecycle"
|
|
5
|
+
* group is the set of functions that mutate a memory's state over
|
|
6
|
+
* time *without* being CRUD: access reinforcement, search
|
|
7
|
+
* reinforcement, enrichment, decay-score persistence, STM→LTM
|
|
8
|
+
* promotion, and bulk decay cleanup. Lifted out of store.ts (still
|
|
9
|
+
* 1,800+ lines after phase 1) so each concern can be read on its
|
|
10
|
+
* own. No behaviour change vs the original implementation — exports
|
|
11
|
+
* re-emerge from store.ts via a barrel re-export so existing import
|
|
12
|
+
* paths keep working.
|
|
13
|
+
*
|
|
14
|
+
* Imports from store.ts (getMemoryById, rowToMemory, getMemoriesByType,
|
|
15
|
+
* MAX_CONTENT_SIZE) form a module cycle. Both directions only invoke
|
|
16
|
+
* the imported symbols inside function bodies — ESM live bindings
|
|
17
|
+
* handle this correctly at runtime. As of phase 3, reinforceFromSearch
|
|
18
|
+
* and enrichMemory are consumed by search-recall.ts (not store.ts);
|
|
19
|
+
* that import is non-cyclic since search-recall.ts is a leaf consumer
|
|
20
|
+
* of lifecycle.ts.
|
|
21
|
+
*/
|
|
22
|
+
import { getDatabase } from '../database/init.js';
|
|
23
|
+
import { DEFAULT_CONFIG, } from './types.js';
|
|
24
|
+
import { calculateReinforcementBoost, calculateDecayedScore, } from './decay.js';
|
|
25
|
+
import { activateMemory as spreadActivation } from './activation.js';
|
|
26
|
+
import { jaccardSimilarity } from './similarity.js';
|
|
27
|
+
import { emitMemoryAccessed, emitMemoryUpdated, persistEvent, } from '../api/events.js';
|
|
28
|
+
import { createMemoryLink } from './links.js';
|
|
29
|
+
// Cyclic import — see header. getMemoryById/rowToMemory/getMemoriesByType
|
|
30
|
+
// live in store.ts; MAX_CONTENT_SIZE is the per-memory content budget
|
|
31
|
+
// that both truncateContent (store.ts) and enrichMemory (here) honour.
|
|
32
|
+
import { getMemoryById, rowToMemory, getMemoriesByType, MAX_CONTENT_SIZE, } from './store.js';
|
|
33
|
+
/**
|
|
34
|
+
* Access a memory (updates access count and timestamp, returns reinforced memory)
|
|
35
|
+
*/
|
|
36
|
+
export function accessMemory(id, config = DEFAULT_CONFIG, source) {
|
|
37
|
+
const db = getDatabase();
|
|
38
|
+
const memory = getMemoryById(id, source);
|
|
39
|
+
if (!memory)
|
|
40
|
+
return null;
|
|
41
|
+
// Calculate new salience with reinforcement
|
|
42
|
+
const newSalience = calculateReinforcementBoost(memory, config);
|
|
43
|
+
db.prepare(`
|
|
44
|
+
UPDATE memories
|
|
45
|
+
SET access_count = access_count + 1,
|
|
46
|
+
last_accessed = CURRENT_TIMESTAMP,
|
|
47
|
+
salience = ?
|
|
48
|
+
WHERE id = ?
|
|
49
|
+
`).run(newSalience, id);
|
|
50
|
+
const updatedMemory = getMemoryById(id);
|
|
51
|
+
// Emit event for real-time dashboard (in-process)
|
|
52
|
+
emitMemoryAccessed(updatedMemory, newSalience);
|
|
53
|
+
// Persist event for cross-process IPC (MCP → Dashboard)
|
|
54
|
+
persistEvent('memory_accessed', { memoryId: id, memory: updatedMemory, newSalience });
|
|
55
|
+
// ORGANIC FEATURE: Link strengthening on co-access
|
|
56
|
+
// If memory A and B are both accessed within 5 minutes, strengthen their link
|
|
57
|
+
// This mimics Hebbian learning: "neurons that fire together, wire together"
|
|
58
|
+
try {
|
|
59
|
+
const recentlyAccessed = db.prepare(`
|
|
60
|
+
SELECT id FROM memories
|
|
61
|
+
WHERE last_accessed > datetime('now', '-5 minutes')
|
|
62
|
+
AND id != ?
|
|
63
|
+
LIMIT 10
|
|
64
|
+
`).all(id);
|
|
65
|
+
for (const recent of recentlyAccessed) {
|
|
66
|
+
// Check if link exists in either direction
|
|
67
|
+
const existingLink = db.prepare(`
|
|
68
|
+
SELECT id, strength FROM memory_links
|
|
69
|
+
WHERE (source_id = ? AND target_id = ?) OR (source_id = ? AND target_id = ?)
|
|
70
|
+
`).get(id, recent.id, recent.id, id);
|
|
71
|
+
if (existingLink) {
|
|
72
|
+
// Strengthen existing link (cap at 1.0)
|
|
73
|
+
const newStrength = Math.min(1.0, existingLink.strength + 0.05);
|
|
74
|
+
db.prepare('UPDATE memory_links SET strength = ? WHERE id = ?')
|
|
75
|
+
.run(newStrength, existingLink.id);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
// Create new weak link for co-accessed memories
|
|
79
|
+
createMemoryLink(id, recent.id, 'related', 0.2);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
catch (e) {
|
|
84
|
+
// Don't fail memory access if link strengthening fails
|
|
85
|
+
console.error('[shieldcortex] Link strengthening failed:', e);
|
|
86
|
+
}
|
|
87
|
+
// ORGANIC FEATURE: Spreading Activation (Phase 2)
|
|
88
|
+
// Activate this memory and spread activation to linked memories
|
|
89
|
+
// This makes related memories easier to recall in subsequent searches
|
|
90
|
+
spreadActivation(id);
|
|
91
|
+
return updatedMemory;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Reinforce a memory that appeared in search results
|
|
95
|
+
* Gives a small salience boost with diminishing returns based on access count.
|
|
96
|
+
* ORGANIC FEATURE: Searched memories get reinforced, closing the feedback loop
|
|
97
|
+
* so frequently-found memories grow stronger over time.
|
|
98
|
+
*/
|
|
99
|
+
export function reinforceFromSearch(memoryId) {
|
|
100
|
+
const db = getDatabase();
|
|
101
|
+
const memory = db.prepare('SELECT salience, access_count FROM memories WHERE id = ?').get(memoryId);
|
|
102
|
+
if (!memory)
|
|
103
|
+
return;
|
|
104
|
+
// Small salience boost per search appearance (diminishing returns)
|
|
105
|
+
const boost = Math.max(0.005, 0.02 / (1 + memory.access_count * 0.1));
|
|
106
|
+
const newSalience = Math.min(1.0, memory.salience + boost);
|
|
107
|
+
db.prepare(`
|
|
108
|
+
UPDATE memories
|
|
109
|
+
SET last_accessed = CURRENT_TIMESTAMP,
|
|
110
|
+
access_count = access_count + 1,
|
|
111
|
+
salience = ?
|
|
112
|
+
WHERE id = ?
|
|
113
|
+
`).run(newSalience, memoryId);
|
|
114
|
+
}
|
|
115
|
+
// ============================================
|
|
116
|
+
// ORGANIC FEATURE: Memory Enrichment (Phase 3)
|
|
117
|
+
// ============================================
|
|
118
|
+
// Enrichment configuration
|
|
119
|
+
const ENRICHMENT_SIMILARITY_THRESHOLD = 0.3; // Min similarity to trigger enrichment
|
|
120
|
+
const ENRICHMENT_COOLDOWN_HOURS = 1; // Don't enrich same memory within 1 hour
|
|
121
|
+
const MAX_ENRICHMENT_SIZE = 2000; // Max chars to add per enrichment
|
|
122
|
+
// Track last enrichment times (in-memory, ephemeral like activation cache)
|
|
123
|
+
const enrichmentTimestamps = new Map();
|
|
124
|
+
let enrichmentCallCount = 0;
|
|
125
|
+
function pruneEnrichmentTimestamps() {
|
|
126
|
+
const now = Date.now();
|
|
127
|
+
const cooldownMs = ENRICHMENT_COOLDOWN_HOURS * 60 * 60 * 1000;
|
|
128
|
+
for (const [memoryId, timestamp] of enrichmentTimestamps) {
|
|
129
|
+
if (now - timestamp > cooldownMs) {
|
|
130
|
+
enrichmentTimestamps.delete(memoryId);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Enrich a memory with additional context
|
|
136
|
+
*
|
|
137
|
+
* This adds timestamped context to a memory when:
|
|
138
|
+
* 1. The new context is sufficiently related but different (new information)
|
|
139
|
+
* 2. The memory hasn't been enriched recently (cooldown)
|
|
140
|
+
* 3. The content won't exceed the size limit
|
|
141
|
+
*
|
|
142
|
+
* ORGANIC FEATURE: Memories grow with new context over time,
|
|
143
|
+
* mimicking how human memories are reconsolidated with new information
|
|
144
|
+
*
|
|
145
|
+
* @param memoryId - ID of the memory to enrich
|
|
146
|
+
* @param newContext - New context to add
|
|
147
|
+
* @param contextType - Type of context ('search' | 'access' | 'related')
|
|
148
|
+
* @returns EnrichmentResult indicating success or failure with reason
|
|
149
|
+
*/
|
|
150
|
+
export function enrichMemory(memoryId, newContext, contextType = 'access') {
|
|
151
|
+
// Prune stale cooldown entries every 100 calls
|
|
152
|
+
if (++enrichmentCallCount % 100 === 0) {
|
|
153
|
+
pruneEnrichmentTimestamps();
|
|
154
|
+
}
|
|
155
|
+
const db = getDatabase();
|
|
156
|
+
const memory = getMemoryById(memoryId);
|
|
157
|
+
if (!memory) {
|
|
158
|
+
return { enriched: false, reason: 'Memory not found' };
|
|
159
|
+
}
|
|
160
|
+
// Check cooldown
|
|
161
|
+
const lastEnrichment = enrichmentTimestamps.get(memoryId);
|
|
162
|
+
const now = Date.now();
|
|
163
|
+
if (lastEnrichment && (now - lastEnrichment) < ENRICHMENT_COOLDOWN_HOURS * 60 * 60 * 1000) {
|
|
164
|
+
return { enriched: false, reason: 'Enrichment cooldown active' };
|
|
165
|
+
}
|
|
166
|
+
// Check similarity - should be related but not too similar (new info)
|
|
167
|
+
const similarity = jaccardSimilarity(memory.content, newContext);
|
|
168
|
+
if (similarity > 0.8) {
|
|
169
|
+
return { enriched: false, reason: 'Context too similar (no new information)' };
|
|
170
|
+
}
|
|
171
|
+
if (similarity < ENRICHMENT_SIMILARITY_THRESHOLD) {
|
|
172
|
+
return { enriched: false, reason: 'Context not sufficiently related' };
|
|
173
|
+
}
|
|
174
|
+
// Truncate context if needed
|
|
175
|
+
const truncatedContext = newContext.slice(0, MAX_ENRICHMENT_SIZE);
|
|
176
|
+
// Build enrichment block with timestamp
|
|
177
|
+
const timestamp = new Date().toISOString().split('T')[0]; // YYYY-MM-DD
|
|
178
|
+
const enrichmentBlock = `\n\n---\n[${timestamp}] ${contextType}: ${truncatedContext}`;
|
|
179
|
+
// Check size limit (leave 500 char buffer for future enrichments)
|
|
180
|
+
const newContent = memory.content + enrichmentBlock;
|
|
181
|
+
if (newContent.length > MAX_CONTENT_SIZE - 500) {
|
|
182
|
+
return { enriched: false, reason: 'Content size limit reached' };
|
|
183
|
+
}
|
|
184
|
+
// Update memory
|
|
185
|
+
db.prepare(`
|
|
186
|
+
UPDATE memories
|
|
187
|
+
SET content = ?,
|
|
188
|
+
last_accessed = CURRENT_TIMESTAMP
|
|
189
|
+
WHERE id = ?
|
|
190
|
+
`).run(newContent, memoryId);
|
|
191
|
+
// Update cooldown timestamp
|
|
192
|
+
enrichmentTimestamps.set(memoryId, now);
|
|
193
|
+
// Emit update event for dashboard
|
|
194
|
+
const updatedMemory = getMemoryById(memoryId);
|
|
195
|
+
emitMemoryUpdated(updatedMemory);
|
|
196
|
+
return { enriched: true, reason: `Added ${contextType} context (${truncatedContext.length} chars)` };
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Clear enrichment cooldown for a memory (for testing)
|
|
200
|
+
*/
|
|
201
|
+
export function clearEnrichmentCooldown(memoryId) {
|
|
202
|
+
enrichmentTimestamps.delete(memoryId);
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Get enrichment cooldown status for a memory
|
|
206
|
+
*/
|
|
207
|
+
export function getEnrichmentCooldownStatus(memoryId) {
|
|
208
|
+
const lastEnrichment = enrichmentTimestamps.get(memoryId);
|
|
209
|
+
if (!lastEnrichment) {
|
|
210
|
+
return { onCooldown: false, remainingMs: 0 };
|
|
211
|
+
}
|
|
212
|
+
const cooldownMs = ENRICHMENT_COOLDOWN_HOURS * 60 * 60 * 1000;
|
|
213
|
+
const elapsed = Date.now() - lastEnrichment;
|
|
214
|
+
const remaining = Math.max(0, cooldownMs - elapsed);
|
|
215
|
+
return {
|
|
216
|
+
onCooldown: remaining > 0,
|
|
217
|
+
remainingMs: remaining,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Update persisted decay scores for all memories
|
|
222
|
+
* Called during consolidation and periodically by the API server
|
|
223
|
+
* Returns the number of memories updated
|
|
224
|
+
*/
|
|
225
|
+
export function updateDecayScores() {
|
|
226
|
+
const db = getDatabase();
|
|
227
|
+
// Get all memories
|
|
228
|
+
const memories = db.prepare('SELECT * FROM memories').all();
|
|
229
|
+
let updated = 0;
|
|
230
|
+
const updateStmt = db.prepare('UPDATE memories SET decayed_score = ? WHERE id = ?');
|
|
231
|
+
for (const row of memories) {
|
|
232
|
+
const memory = rowToMemory(row);
|
|
233
|
+
const decayedScore = calculateDecayedScore(memory);
|
|
234
|
+
// Only update if score has changed significantly (saves writes)
|
|
235
|
+
const currentScore = row.decayed_score;
|
|
236
|
+
if (currentScore === null || Math.abs(currentScore - decayedScore) > 0.01) {
|
|
237
|
+
updateStmt.run(decayedScore, memory.id);
|
|
238
|
+
updated++;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return updated;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Promote a memory from short-term to long-term
|
|
245
|
+
*/
|
|
246
|
+
export function promoteMemory(id) {
|
|
247
|
+
const db = getDatabase();
|
|
248
|
+
db.prepare(`
|
|
249
|
+
UPDATE memories
|
|
250
|
+
SET type = 'long_term'
|
|
251
|
+
WHERE id = ? AND type = 'short_term'
|
|
252
|
+
`).run(id);
|
|
253
|
+
return getMemoryById(id);
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Bulk delete decayed memories
|
|
257
|
+
*/
|
|
258
|
+
export function cleanupDecayedMemories(config = DEFAULT_CONFIG) {
|
|
259
|
+
const db = getDatabase();
|
|
260
|
+
// Get all short-term memories and check decay
|
|
261
|
+
const shortTerm = getMemoriesByType('short_term', 1000);
|
|
262
|
+
const toDelete = [];
|
|
263
|
+
for (const memory of shortTerm) {
|
|
264
|
+
const decayedScore = calculateDecayedScore(memory, config);
|
|
265
|
+
if (decayedScore < config.salienceThreshold) {
|
|
266
|
+
toDelete.push(memory.id);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
if (toDelete.length > 0) {
|
|
270
|
+
const placeholders = toDelete.map(() => '?').join(',');
|
|
271
|
+
db.prepare(`DELETE FROM memories WHERE id IN (${placeholders})`).run(...toDelete);
|
|
272
|
+
}
|
|
273
|
+
return toDelete.length;
|
|
274
|
+
}
|