shieldcortex 4.12.14 → 4.13.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.
- 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 +27 -0
- package/dist/cli/doctor.js +88 -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/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 +30 -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 +45 -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 +346 -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 → kiA_iEHG_1wWOEYFsD0Tj}/_buildManifest.js +0 -0
- /package/dashboard/.next/standalone/dashboard/.next/static/{P2sW3M-qHaW9VS9YwCEg3 → kiA_iEHG_1wWOEYFsD0Tj}/_clientMiddlewareManifest.json +0 -0
- /package/dashboard/.next/standalone/dashboard/.next/static/{P2sW3M-qHaW9VS9YwCEg3 → kiA_iEHG_1wWOEYFsD0Tj}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
import { randomUUID } from 'crypto';
|
|
5
|
+
import Database from 'better-sqlite3';
|
|
6
|
+
const DEFAULT_LEGACY_SOURCES = [
|
|
7
|
+
path.join(os.homedir(), '.claude-cortex', 'memories.db'),
|
|
8
|
+
path.join(os.homedir(), '.claude-memory', 'memories.db'),
|
|
9
|
+
];
|
|
10
|
+
const DEFAULT_TARGET = path.join(os.homedir(), '.shieldcortex', 'memories.db');
|
|
11
|
+
function migrateOne(sourcePath, target, dryRun) {
|
|
12
|
+
const report = {
|
|
13
|
+
path: sourcePath,
|
|
14
|
+
exists: false,
|
|
15
|
+
memoriesFound: 0,
|
|
16
|
+
memoriesImported: 0,
|
|
17
|
+
linksFound: 0,
|
|
18
|
+
linksImported: 0,
|
|
19
|
+
linksSkipped: 0,
|
|
20
|
+
};
|
|
21
|
+
if (!fs.existsSync(sourcePath))
|
|
22
|
+
return report;
|
|
23
|
+
report.exists = true;
|
|
24
|
+
let source;
|
|
25
|
+
try {
|
|
26
|
+
source = new Database(sourcePath, { readonly: true, fileMustExist: true });
|
|
27
|
+
const memories = source
|
|
28
|
+
.prepare(`
|
|
29
|
+
SELECT id, type, category, title, content, project, tags, salience,
|
|
30
|
+
decayed_score, access_count, last_accessed, created_at,
|
|
31
|
+
metadata, embedding, scope, transferable
|
|
32
|
+
FROM memories
|
|
33
|
+
`)
|
|
34
|
+
.all();
|
|
35
|
+
const links = source
|
|
36
|
+
.prepare(`
|
|
37
|
+
SELECT source_id, target_id, relationship, strength, created_at
|
|
38
|
+
FROM memory_links
|
|
39
|
+
`)
|
|
40
|
+
.all();
|
|
41
|
+
report.memoriesFound = memories.length;
|
|
42
|
+
report.linksFound = links.length;
|
|
43
|
+
if (dryRun)
|
|
44
|
+
return report;
|
|
45
|
+
const insertMemory = target.prepare(`
|
|
46
|
+
INSERT INTO memories (
|
|
47
|
+
uuid, type, category, title, content, project, tags, salience,
|
|
48
|
+
decayed_score, access_count, last_accessed, created_at, updated_at,
|
|
49
|
+
metadata, embedding, scope, transferable, source, source_kind, capture_method
|
|
50
|
+
) VALUES (
|
|
51
|
+
@uuid, @type, @category, @title, @content, @project, @tags, @salience,
|
|
52
|
+
@decayed_score, @access_count, @last_accessed, @created_at, @updated_at,
|
|
53
|
+
@metadata, @embedding, @scope, @transferable, @source, @source_kind, @capture_method
|
|
54
|
+
)
|
|
55
|
+
`);
|
|
56
|
+
const insertLink = target.prepare(`
|
|
57
|
+
INSERT OR IGNORE INTO memory_links (source_id, target_id, relationship, strength, created_at)
|
|
58
|
+
VALUES (?, ?, ?, ?, ?)
|
|
59
|
+
`);
|
|
60
|
+
const sourceLabel = path.basename(path.dirname(sourcePath));
|
|
61
|
+
const idMap = new Map();
|
|
62
|
+
const txn = target.transaction(() => {
|
|
63
|
+
for (const row of memories) {
|
|
64
|
+
const result = insertMemory.run({
|
|
65
|
+
uuid: randomUUID(),
|
|
66
|
+
type: row.type,
|
|
67
|
+
category: row.category,
|
|
68
|
+
title: row.title,
|
|
69
|
+
content: row.content,
|
|
70
|
+
project: row.project,
|
|
71
|
+
tags: row.tags ?? '[]',
|
|
72
|
+
salience: row.salience ?? 0.5,
|
|
73
|
+
decayed_score: row.decayed_score,
|
|
74
|
+
access_count: row.access_count ?? 0,
|
|
75
|
+
last_accessed: row.last_accessed,
|
|
76
|
+
created_at: row.created_at,
|
|
77
|
+
updated_at: row.created_at,
|
|
78
|
+
metadata: row.metadata ?? '{}',
|
|
79
|
+
embedding: row.embedding,
|
|
80
|
+
scope: row.scope ?? 'project',
|
|
81
|
+
transferable: row.transferable ?? 0,
|
|
82
|
+
source: `legacy:${sourceLabel}`,
|
|
83
|
+
source_kind: 'legacy-import',
|
|
84
|
+
capture_method: 'legacy-migrate',
|
|
85
|
+
});
|
|
86
|
+
idMap.set(row.id, Number(result.lastInsertRowid));
|
|
87
|
+
report.memoriesImported++;
|
|
88
|
+
}
|
|
89
|
+
for (const link of links) {
|
|
90
|
+
const newSource = idMap.get(link.source_id);
|
|
91
|
+
const newTarget = idMap.get(link.target_id);
|
|
92
|
+
if (newSource === undefined || newTarget === undefined) {
|
|
93
|
+
report.linksSkipped++;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
const linkResult = insertLink.run(newSource, newTarget, link.relationship, link.strength ?? 0.5, link.created_at);
|
|
97
|
+
if (linkResult.changes > 0)
|
|
98
|
+
report.linksImported++;
|
|
99
|
+
else
|
|
100
|
+
report.linksSkipped++;
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
txn();
|
|
104
|
+
}
|
|
105
|
+
catch (err) {
|
|
106
|
+
report.error = err instanceof Error ? err.message : String(err);
|
|
107
|
+
}
|
|
108
|
+
finally {
|
|
109
|
+
source?.close();
|
|
110
|
+
}
|
|
111
|
+
return report;
|
|
112
|
+
}
|
|
113
|
+
export function migrateLegacy(options = {}) {
|
|
114
|
+
const sources = options.sources ?? DEFAULT_LEGACY_SOURCES;
|
|
115
|
+
const targetPath = options.target ?? DEFAULT_TARGET;
|
|
116
|
+
const dryRun = options.dryRun === true;
|
|
117
|
+
if (!fs.existsSync(targetPath)) {
|
|
118
|
+
throw new Error(`target DB does not exist: ${targetPath} (run \`shieldcortex setup\` first)`);
|
|
119
|
+
}
|
|
120
|
+
const target = new Database(targetPath);
|
|
121
|
+
// Foreign keys on so legacy links to deleted memories fail loudly.
|
|
122
|
+
target.pragma('foreign_keys = ON');
|
|
123
|
+
// The dashboard API server holds an open connection in WAL mode; give the
|
|
124
|
+
// SQLite locking layer plenty of room to coordinate so the migration
|
|
125
|
+
// doesn't bail with SQLITE_BUSY mid-transaction.
|
|
126
|
+
target.pragma('busy_timeout = 10000');
|
|
127
|
+
const report = {
|
|
128
|
+
target: targetPath,
|
|
129
|
+
dryRun,
|
|
130
|
+
sources: [],
|
|
131
|
+
totalMemories: 0,
|
|
132
|
+
totalLinks: 0,
|
|
133
|
+
};
|
|
134
|
+
try {
|
|
135
|
+
for (const sourcePath of sources) {
|
|
136
|
+
const sourceReport = migrateOne(sourcePath, target, dryRun);
|
|
137
|
+
report.sources.push(sourceReport);
|
|
138
|
+
report.totalMemories += sourceReport.memoriesImported;
|
|
139
|
+
report.totalLinks += sourceReport.linksImported;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
finally {
|
|
143
|
+
target.close();
|
|
144
|
+
}
|
|
145
|
+
return report;
|
|
146
|
+
}
|
|
147
|
+
function printReport(report) {
|
|
148
|
+
const banner = report.dryRun ? '[DRY RUN] ' : '';
|
|
149
|
+
console.log(`${banner}Legacy memory migration → ${report.target}`);
|
|
150
|
+
console.log('');
|
|
151
|
+
for (const src of report.sources) {
|
|
152
|
+
if (!src.exists) {
|
|
153
|
+
console.log(` ${src.path}: not found, skipped`);
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
if (src.error) {
|
|
157
|
+
console.log(` ${src.path}: ERROR — ${src.error}`);
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
const verb = report.dryRun ? 'would import' : 'imported';
|
|
161
|
+
console.log(` ${src.path}:`);
|
|
162
|
+
console.log(` memories: ${src.memoriesFound} found, ${verb} ${src.memoriesImported}`);
|
|
163
|
+
console.log(` links: ${src.linksFound} found, ${verb} ${src.linksImported}, skipped ${src.linksSkipped}`);
|
|
164
|
+
}
|
|
165
|
+
console.log('');
|
|
166
|
+
console.log(report.dryRun
|
|
167
|
+
? `Total: would import ${report.totalMemories} memories + ${report.totalLinks} links.`
|
|
168
|
+
: `Total: imported ${report.totalMemories} memories + ${report.totalLinks} links.`);
|
|
169
|
+
if (!report.dryRun) {
|
|
170
|
+
console.log('');
|
|
171
|
+
console.log('Tip: back up of the target DB was your responsibility — restore from');
|
|
172
|
+
console.log(' ~/.shieldcortex/memories.db.bak.* if needed.');
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function flagValue(args, name) {
|
|
176
|
+
const idx = args.indexOf(name);
|
|
177
|
+
if (idx === -1)
|
|
178
|
+
return undefined;
|
|
179
|
+
const v = args[idx + 1];
|
|
180
|
+
if (!v || v.startsWith('--'))
|
|
181
|
+
return undefined;
|
|
182
|
+
return v;
|
|
183
|
+
}
|
|
184
|
+
async function runPrune(args) {
|
|
185
|
+
const { initDatabase } = await import('../database/init.js');
|
|
186
|
+
const { pruneMemories } = await import('../memory/prune.js');
|
|
187
|
+
initDatabase();
|
|
188
|
+
const dryRun = !args.includes('--execute');
|
|
189
|
+
const salienceLte = Number(flagValue(args, '--salience-lte') ?? 0.2);
|
|
190
|
+
const ageDaysGte = Number(flagValue(args, '--older-than') ?? 30);
|
|
191
|
+
const project = flagValue(args, '--project');
|
|
192
|
+
const includePinned = args.includes('--include-pinned');
|
|
193
|
+
const result = await pruneMemories({
|
|
194
|
+
salienceLte,
|
|
195
|
+
ageDaysGte,
|
|
196
|
+
project,
|
|
197
|
+
excludePinned: !includePinned,
|
|
198
|
+
dryRun,
|
|
199
|
+
});
|
|
200
|
+
const banner = dryRun ? '[DRY RUN] ' : '';
|
|
201
|
+
console.log(`${banner}Prune memories where salience <= ${salienceLte} AND age >= ${ageDaysGte}d`);
|
|
202
|
+
console.log(` Project: ${project ?? '(all)'} · ExcludePinned: ${!includePinned}`);
|
|
203
|
+
console.log(` Matched: ${result.matched}`);
|
|
204
|
+
if (result.sample.length > 0) {
|
|
205
|
+
console.log(' Sample:');
|
|
206
|
+
for (const s of result.sample) {
|
|
207
|
+
console.log(` #${s.id} [${s.project ?? '-'}] sal ${s.salience.toFixed(2)} · ${s.ageDays}d · ${s.title.slice(0, 60)}`);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (!dryRun) {
|
|
211
|
+
console.log(` Deleted: ${result.deleted ?? 0}`);
|
|
212
|
+
if (result.backupPath)
|
|
213
|
+
console.log(` Backup: ${result.backupPath}`);
|
|
214
|
+
}
|
|
215
|
+
else if (result.matched > 0) {
|
|
216
|
+
console.log(' Re-run with --execute to delete.');
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
async function runDedupe(args) {
|
|
220
|
+
const { initDatabase } = await import('../database/init.js');
|
|
221
|
+
const { dedupeMemories } = await import('../memory/dedupe-runner.js');
|
|
222
|
+
initDatabase();
|
|
223
|
+
const dryRun = !args.includes('--execute');
|
|
224
|
+
const project = flagValue(args, '--project');
|
|
225
|
+
const limit = Number(flagValue(args, '--limit') ?? 200);
|
|
226
|
+
const result = await dedupeMemories({ project, dryRun, limit });
|
|
227
|
+
const banner = dryRun ? '[DRY RUN] ' : '';
|
|
228
|
+
console.log(`${banner}Dedupe long-term memories${project ? ` in project ${project}` : ' (all projects)'}`);
|
|
229
|
+
console.log(` Pairs scanned: ${result.pairsFound}`);
|
|
230
|
+
console.log(` Clusters: ${result.groups.length}`);
|
|
231
|
+
const totalRemovable = result.groups.reduce((sum, g) => sum + g.removeIds.length, 0);
|
|
232
|
+
console.log(` Removable: ${totalRemovable}`);
|
|
233
|
+
if (result.groups.length > 0) {
|
|
234
|
+
console.log(' Groups:');
|
|
235
|
+
for (const g of result.groups.slice(0, 10)) {
|
|
236
|
+
console.log(` keep #${g.keepId} [${g.removeIds.length} dup] ${g.similarity} — "${g.keepTitle.slice(0, 50)}"`);
|
|
237
|
+
}
|
|
238
|
+
if (result.groups.length > 10)
|
|
239
|
+
console.log(` … and ${result.groups.length - 10} more`);
|
|
240
|
+
}
|
|
241
|
+
if (!dryRun) {
|
|
242
|
+
console.log(` Merged: ${result.merged ?? 0}`);
|
|
243
|
+
if (result.backupPath)
|
|
244
|
+
console.log(` Backup: ${result.backupPath}`);
|
|
245
|
+
}
|
|
246
|
+
else if (totalRemovable > 0) {
|
|
247
|
+
console.log(' Re-run with --execute to merge.');
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
function printUsage() {
|
|
251
|
+
console.log('Usage: shieldcortex memories <subcommand> [options]');
|
|
252
|
+
console.log('');
|
|
253
|
+
console.log('Subcommands:');
|
|
254
|
+
console.log(' migrate-legacy [--dry-run] [--source <path>]');
|
|
255
|
+
console.log(' Import memories from ~/.claude-memory/ and ~/.claude-cortex/');
|
|
256
|
+
console.log(' into the current ~/.shieldcortex/memories.db.');
|
|
257
|
+
console.log('');
|
|
258
|
+
console.log(' prune [--salience-lte 0.2] [--older-than 30] [--project X]');
|
|
259
|
+
console.log(' [--include-pinned] [--execute]');
|
|
260
|
+
console.log(' Delete memories below salience X older than N days.');
|
|
261
|
+
console.log(' DRY-RUN BY DEFAULT — pass --execute to actually delete.');
|
|
262
|
+
console.log(' Backup auto-saved before any delete.');
|
|
263
|
+
console.log('');
|
|
264
|
+
console.log(' dedupe [--project X] [--limit 200] [--execute]');
|
|
265
|
+
console.log(' Cluster near-duplicate long-term memories and keep the highest-');
|
|
266
|
+
console.log(' salience representative. DRY-RUN BY DEFAULT — pass --execute.');
|
|
267
|
+
console.log(' Backup auto-saved before any merge.');
|
|
268
|
+
}
|
|
269
|
+
export async function handleMemoriesCommand(args) {
|
|
270
|
+
const sub = args[0];
|
|
271
|
+
if (sub === 'migrate-legacy') {
|
|
272
|
+
const dryRun = args.includes('--dry-run');
|
|
273
|
+
const sourceIdx = args.indexOf('--source');
|
|
274
|
+
const sources = sourceIdx !== -1 && args[sourceIdx + 1]
|
|
275
|
+
? [args[sourceIdx + 1]]
|
|
276
|
+
: undefined;
|
|
277
|
+
const report = migrateLegacy({ sources, dryRun });
|
|
278
|
+
printReport(report);
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
if (sub === 'prune') {
|
|
282
|
+
await runPrune(args.slice(1));
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
if (sub === 'dedupe') {
|
|
286
|
+
await runDedupe(args.slice(1));
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
printUsage();
|
|
290
|
+
process.exit(1);
|
|
291
|
+
}
|
package/dist/cloud/cli.js
CHANGED
|
@@ -157,8 +157,8 @@ export function handleCloudConfig(args) {
|
|
|
157
157
|
console.log(' --cloud-enable Enable cloud sync');
|
|
158
158
|
console.log(' --cloud-disable Disable cloud sync');
|
|
159
159
|
console.log(' --cloud-status Show current configuration');
|
|
160
|
-
console.log(' --openclaw-auto-memory <true|false>
|
|
161
|
-
console.log(' --proactive-recall <true|false>
|
|
160
|
+
console.log(' --openclaw-auto-memory <true|false> Extract memories from OpenClaw LLM output (default: off)');
|
|
161
|
+
console.log(' --proactive-recall <true|false> Inject SC memory into prompts (default: off — adds latency)');
|
|
162
162
|
console.log(' --restore-4.10-defaults Restore pre-v4.11.0 defaults (recall on, strict interceptor, minimal preamble)');
|
|
163
163
|
console.log('');
|
|
164
164
|
console.log('LLM Verification:');
|
package/dist/database/init.js
CHANGED
|
@@ -31,7 +31,14 @@ function expandPath(path) {
|
|
|
31
31
|
* Get the database path with legacy fallback
|
|
32
32
|
* - New installs use ~/.shieldcortex/
|
|
33
33
|
* - Existing users with ~/.claude-memory/ continue to work
|
|
34
|
+
*
|
|
35
|
+
* DEPRECATION: the .claude-memory fallback will be removed in v5.0.0 (target
|
|
36
|
+
* Q3 2026). Existing users on the legacy path get a one-time-per-process
|
|
37
|
+
* warning pointing them at `shieldcortex migrate-legacy` so they can move to
|
|
38
|
+
* ~/.shieldcortex/ before the cut. Same applies to .claude-cortex (separate
|
|
39
|
+
* legacy DB read by the CLI migrate command).
|
|
34
40
|
*/
|
|
41
|
+
let _legacyFallbackWarned = false;
|
|
35
42
|
function getDefaultDbPath() {
|
|
36
43
|
const newPath = join(homedir(), '.shieldcortex', 'memories.db');
|
|
37
44
|
const legacyPath = join(homedir(), '.claude-memory', 'memories.db');
|
|
@@ -39,7 +46,13 @@ function getDefaultDbPath() {
|
|
|
39
46
|
if (existsSync(newPath) || !existsSync(legacyPath)) {
|
|
40
47
|
return newPath;
|
|
41
48
|
}
|
|
42
|
-
// Fall back to legacy path for existing users
|
|
49
|
+
// Fall back to legacy path for existing users — warn once.
|
|
50
|
+
if (!_legacyFallbackWarned) {
|
|
51
|
+
_legacyFallbackWarned = true;
|
|
52
|
+
console.warn('[shieldcortex] DEPRECATED: reading from ~/.claude-memory/memories.db.');
|
|
53
|
+
console.warn('[shieldcortex] This fallback will be removed in v5.0.0 (target Q3 2026).');
|
|
54
|
+
console.warn('[shieldcortex] To migrate now: shieldcortex migrate-legacy');
|
|
55
|
+
}
|
|
43
56
|
return legacyPath;
|
|
44
57
|
}
|
|
45
58
|
function resolveRuntimeInfo() {
|
|
@@ -729,6 +742,18 @@ function runMigrations(database) {
|
|
|
729
742
|
CREATE INDEX IF NOT EXISTS idx_frag_entities_memory ON fragmentation_entities(memory_id);
|
|
730
743
|
CREATE INDEX IF NOT EXISTS idx_frag_entities_text ON fragmentation_entities(entity_value);
|
|
731
744
|
CREATE INDEX IF NOT EXISTS idx_frag_entities_type ON fragmentation_entities(entity_type);
|
|
745
|
+
|
|
746
|
+
CREATE TABLE IF NOT EXISTS hook_invocations (
|
|
747
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
748
|
+
hook_name TEXT NOT NULL,
|
|
749
|
+
invoked_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
750
|
+
exit_code INTEGER,
|
|
751
|
+
duration_ms INTEGER,
|
|
752
|
+
memories_extracted INTEGER DEFAULT 0,
|
|
753
|
+
transcript_bytes INTEGER,
|
|
754
|
+
notes TEXT
|
|
755
|
+
);
|
|
756
|
+
CREATE INDEX IF NOT EXISTS idx_hook_invocations_name_time ON hook_invocations(hook_name, invoked_at DESC);
|
|
732
757
|
`);
|
|
733
758
|
}
|
|
734
759
|
catch {
|
package/dist/index.js
CHANGED
|
@@ -522,7 +522,8 @@ ${bold}DOCS${reset}
|
|
|
522
522
|
return;
|
|
523
523
|
}
|
|
524
524
|
const stopHook = process.argv.includes('--with-stop-hook');
|
|
525
|
-
|
|
525
|
+
const sessionEnd = process.argv.includes('--with-session-end');
|
|
526
|
+
await setupClaudeMd({ stopHook, sessionEnd });
|
|
526
527
|
return;
|
|
527
528
|
}
|
|
528
529
|
// Handle "migrate" subcommand
|
|
@@ -584,6 +585,12 @@ ${bold}DOCS${reset}
|
|
|
584
585
|
await handleReviewCopilotCommand(process.argv.slice(3), parsedArgs.dbPath);
|
|
585
586
|
return;
|
|
586
587
|
}
|
|
588
|
+
// Handle "memories" subcommand (memory database operations: migrate-legacy, ...)
|
|
589
|
+
if (process.argv[2] === 'memories') {
|
|
590
|
+
const { handleMemoriesCommand } = await import('./cli/migrate-legacy.js');
|
|
591
|
+
await handleMemoriesCommand(process.argv.slice(3));
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
587
594
|
// Handle "status" subcommand
|
|
588
595
|
if (process.argv[2] === 'status') {
|
|
589
596
|
const { handleStatusCommand } = await import('./setup/status.js');
|
|
@@ -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
|
+
}
|