@agent-receipts/dashboard 0.2.11 → 0.3.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/package.json +6 -5
- package/standalone/apps/web/.next/BUILD_ID +1 -1
- package/standalone/apps/web/.next/app-build-manifest.json +235 -158
- package/standalone/apps/web/.next/app-path-routes-manifest.json +20 -10
- package/standalone/apps/web/.next/build-manifest.json +13 -13
- package/standalone/apps/web/.next/prerender-manifest.json +75 -27
- package/standalone/apps/web/.next/routes-manifest.json +36 -0
- package/standalone/apps/web/.next/server/app/_not-found/page.js +2 -2
- package/standalone/apps/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/_not-found.html +2 -2
- package/standalone/apps/web/.next/server/app/_not-found.rsc +3 -3
- package/standalone/apps/web/.next/server/app/agents/[id]/page.js +2 -2
- package/standalone/apps/web/.next/server/app/agents/[id]/page.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/agents/[id]/page_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/agents/page.js +2 -2
- package/standalone/apps/web/.next/server/app/agents/page.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/agents/page_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/agents.html +2 -2
- package/standalone/apps/web/.next/server/app/agents.rsc +4 -4
- package/standalone/apps/web/.next/server/app/api/agents/route.js +1 -1
- package/standalone/apps/web/.next/server/app/api/agents/route.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/api/agents/route_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/api/chains/[id]/route.js +1 -1
- package/standalone/apps/web/.next/server/app/api/chains/[id]/route.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/api/chains/[id]/route_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/api/cleanup/route.js +1 -1
- package/standalone/apps/web/.next/server/app/api/cleanup/route.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/api/config/route.js +1 -1
- package/standalone/apps/web/.next/server/app/api/config/route.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/api/config/route_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/api/invoices/route.js +1 -1
- package/standalone/apps/web/.next/server/app/api/invoices/route.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/api/invoices/route_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/api/judgments/route.js +1 -1
- package/standalone/apps/web/.next/server/app/api/judgments/route.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/api/judgments/route_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/api/memory/audit/route.js +1 -0
- package/standalone/apps/web/.next/server/app/api/memory/audit/route.js.nft.json +1 -0
- package/standalone/apps/web/.next/server/app/api/memory/audit/route_client-reference-manifest.js +1 -0
- package/standalone/apps/web/.next/server/app/api/memory/entities/[id]/route.js +1 -0
- package/standalone/apps/web/.next/server/app/api/memory/entities/[id]/route.js.nft.json +1 -0
- package/standalone/apps/web/.next/server/app/api/memory/entities/[id]/route_client-reference-manifest.js +1 -0
- package/standalone/apps/web/.next/server/app/api/memory/entities/route.js +1 -0
- package/standalone/apps/web/.next/server/app/api/memory/entities/route.js.nft.json +1 -0
- package/standalone/apps/web/.next/server/app/api/memory/entities/route_client-reference-manifest.js +1 -0
- package/standalone/apps/web/.next/server/app/api/memory/forget/route.js +1 -0
- package/standalone/apps/web/.next/server/app/api/memory/forget/route.js.nft.json +1 -0
- package/standalone/apps/web/.next/server/app/api/memory/forget/route_client-reference-manifest.js +1 -0
- package/standalone/apps/web/.next/server/app/api/memory/observe/route.js +1 -0
- package/standalone/apps/web/.next/server/app/api/memory/observe/route.js.nft.json +1 -0
- package/standalone/apps/web/.next/server/app/api/memory/observe/route_client-reference-manifest.js +1 -0
- package/standalone/apps/web/.next/server/app/api/memory/provenance/[obsId]/route.js +1 -0
- package/standalone/apps/web/.next/server/app/api/memory/provenance/[obsId]/route.js.nft.json +1 -0
- package/standalone/apps/web/.next/server/app/api/memory/provenance/[obsId]/route_client-reference-manifest.js +1 -0
- package/standalone/apps/web/.next/server/app/api/memory/recall/route.js +1 -0
- package/standalone/apps/web/.next/server/app/api/memory/recall/route.js.nft.json +1 -0
- package/standalone/apps/web/.next/server/app/api/memory/recall/route_client-reference-manifest.js +1 -0
- package/standalone/apps/web/.next/server/app/api/receipts/[id]/route.js +1 -1
- package/standalone/apps/web/.next/server/app/api/receipts/[id]/route.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/api/receipts/[id]/route_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/api/receipts/route.js +1 -1
- package/standalone/apps/web/.next/server/app/api/receipts/route.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/api/receipts/route_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/api/search/route.js +1 -1
- package/standalone/apps/web/.next/server/app/api/search/route.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/api/stats/route.js +1 -1
- package/standalone/apps/web/.next/server/app/api/stats/route.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/api/stats/route_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/api/verify/route.js +1 -1
- package/standalone/apps/web/.next/server/app/api/verify/route.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/api/verify/route_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/chains/[id]/page.js +2 -2
- package/standalone/apps/web/.next/server/app/chains/[id]/page.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/chains/[id]/page_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/chains/page.js +2 -2
- package/standalone/apps/web/.next/server/app/chains/page.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/chains/page_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/chains.html +2 -2
- package/standalone/apps/web/.next/server/app/chains.rsc +4 -4
- package/standalone/apps/web/.next/server/app/constraints/page.js +2 -2
- package/standalone/apps/web/.next/server/app/constraints/page.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/constraints/page_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/constraints.html +2 -2
- package/standalone/apps/web/.next/server/app/constraints.rsc +4 -4
- package/standalone/apps/web/.next/server/app/get-started/page.js +2 -2
- package/standalone/apps/web/.next/server/app/get-started/page.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/get-started/page_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/get-started.html +3 -3
- package/standalone/apps/web/.next/server/app/get-started.rsc +4 -4
- package/standalone/apps/web/.next/server/app/how-it-works/page.js +2 -2
- package/standalone/apps/web/.next/server/app/how-it-works/page.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/how-it-works/page_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/how-it-works.html +3 -3
- package/standalone/apps/web/.next/server/app/how-it-works.rsc +4 -4
- package/standalone/apps/web/.next/server/app/icon.svg/route.js +1 -1
- package/standalone/apps/web/.next/server/app/icon.svg/route.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/index.html +2 -2
- package/standalone/apps/web/.next/server/app/index.rsc +4 -4
- package/standalone/apps/web/.next/server/app/invoices/page.js +2 -2
- package/standalone/apps/web/.next/server/app/invoices/page.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/invoices/page_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/invoices.html +3 -3
- package/standalone/apps/web/.next/server/app/invoices.rsc +4 -4
- package/standalone/apps/web/.next/server/app/judgments/page.js +2 -2
- package/standalone/apps/web/.next/server/app/judgments/page.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/judgments/page_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/judgments.html +2 -2
- package/standalone/apps/web/.next/server/app/judgments.rsc +4 -4
- package/standalone/apps/web/.next/server/app/memory/[entityId]/page.js +2 -0
- package/standalone/apps/web/.next/server/app/memory/[entityId]/page.js.nft.json +1 -0
- package/standalone/apps/web/.next/server/app/memory/[entityId]/page_client-reference-manifest.js +1 -0
- package/standalone/apps/web/.next/server/app/memory/audit/page.js +2 -0
- package/standalone/apps/web/.next/server/app/memory/audit/page.js.nft.json +1 -0
- package/standalone/apps/web/.next/server/app/memory/audit/page_client-reference-manifest.js +1 -0
- package/standalone/apps/web/.next/server/app/memory/audit.html +9 -0
- package/standalone/apps/web/.next/server/app/memory/audit.meta +7 -0
- package/standalone/apps/web/.next/server/app/memory/audit.rsc +21 -0
- package/standalone/apps/web/.next/server/app/memory/page.js +2 -0
- package/standalone/apps/web/.next/server/app/memory/page.js.nft.json +1 -0
- package/standalone/apps/web/.next/server/app/memory/page_client-reference-manifest.js +1 -0
- package/standalone/apps/web/.next/server/app/memory.html +9 -0
- package/standalone/apps/web/.next/server/app/memory.meta +7 -0
- package/standalone/apps/web/.next/server/app/memory.rsc +21 -0
- package/standalone/apps/web/.next/server/app/page.js +2 -2
- package/standalone/apps/web/.next/server/app/page.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/receipts/[id]/page.js +2 -2
- package/standalone/apps/web/.next/server/app/receipts/[id]/page.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/receipts/[id]/page_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/receipts/page.js +2 -2
- package/standalone/apps/web/.next/server/app/receipts/page.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/receipts/page_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/receipts.html +2 -2
- package/standalone/apps/web/.next/server/app/receipts.rsc +4 -4
- package/standalone/apps/web/.next/server/app/settings/page.js +2 -2
- package/standalone/apps/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/settings.html +2 -2
- package/standalone/apps/web/.next/server/app/settings.rsc +4 -4
- package/standalone/apps/web/.next/server/app/verify/page.js +2 -2
- package/standalone/apps/web/.next/server/app/verify/page.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/app/verify/page_client-reference-manifest.js +1 -1
- package/standalone/apps/web/.next/server/app/verify.html +2 -2
- package/standalone/apps/web/.next/server/app/verify.rsc +4 -4
- package/standalone/apps/web/.next/server/app-paths-manifest.json +20 -10
- package/standalone/apps/web/.next/server/chunks/4099.js +1 -0
- package/standalone/apps/web/.next/server/chunks/4236.js +1 -0
- package/standalone/apps/web/.next/server/chunks/4319.js +1 -0
- package/standalone/apps/web/.next/server/chunks/4640.js +8 -0
- package/standalone/apps/web/.next/server/chunks/578.js +1 -1
- package/standalone/apps/web/.next/server/chunks/5783.js +6 -0
- package/standalone/apps/web/.next/server/chunks/6568.js +1 -0
- package/standalone/apps/web/.next/server/chunks/6803.js +307 -0
- package/standalone/apps/web/.next/server/chunks/6872.js +1 -0
- package/standalone/apps/web/.next/server/chunks/{955.js → 7955.js} +1 -1
- package/standalone/apps/web/.next/server/chunks/808.js +1 -0
- package/standalone/apps/web/.next/server/chunks/9295.js +9 -0
- package/standalone/apps/web/.next/server/middleware-build-manifest.js +1 -1
- package/standalone/apps/web/.next/server/pages/404.html +2 -2
- package/standalone/apps/web/.next/server/pages/500.html +1 -1
- package/standalone/apps/web/.next/server/pages/_document.js +1 -1
- package/standalone/apps/web/.next/server/pages/_document.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/pages/_error.js +2 -2
- package/standalone/apps/web/.next/server/pages/_error.js.nft.json +1 -1
- package/standalone/apps/web/.next/server/pages-manifest.json +1 -1
- package/standalone/apps/web/.next/server/webpack-runtime.js +1 -1
- package/standalone/apps/web/.next/static/BZdBWaTjiqh8Heg1_5h6o/_buildManifest.js +1 -0
- package/standalone/apps/web/.next/static/chunks/1577-52a37d87918977e4.js +1 -0
- package/standalone/apps/web/.next/static/chunks/2702-4afe85cf1319178b.js +1 -0
- package/standalone/apps/web/.next/static/chunks/5388-497db038071971af.js +1 -0
- package/standalone/apps/web/.next/static/chunks/5935-25e4517f9bfb3e54.js +1 -0
- package/standalone/apps/web/.next/static/chunks/7493-21c65d3cf41d96fa.js +1 -0
- package/standalone/apps/web/.next/static/chunks/9743-b93c9a67bf15f28e.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/_not-found/page-dfe859f15ff21004.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/agents/[id]/page-bd27daddc88ea13c.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/agents/page-67d8a1e928ffad08.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/api/agents/route-08c70580b96dfffc.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/api/chains/[id]/route-08c70580b96dfffc.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/api/cleanup/route-08c70580b96dfffc.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/api/config/route-08c70580b96dfffc.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/api/invoices/route-08c70580b96dfffc.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/api/judgments/route-08c70580b96dfffc.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/api/memory/audit/route-08c70580b96dfffc.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/api/memory/entities/[id]/route-08c70580b96dfffc.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/api/memory/entities/route-08c70580b96dfffc.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/api/memory/forget/route-08c70580b96dfffc.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/api/memory/observe/route-08c70580b96dfffc.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/api/memory/provenance/[obsId]/route-08c70580b96dfffc.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/api/memory/recall/route-08c70580b96dfffc.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/api/receipts/[id]/route-08c70580b96dfffc.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/api/receipts/route-08c70580b96dfffc.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/api/search/route-08c70580b96dfffc.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/api/stats/route-08c70580b96dfffc.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/api/verify/route-08c70580b96dfffc.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/chains/[id]/page-45d744cdd6495e6b.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/chains/page-bd595389b36e9ec3.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/constraints/page-d814c6768a5ac3cd.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/get-started/layout-08c70580b96dfffc.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/get-started/page-3f1e33bbce2134ae.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/how-it-works/page-fd39b30017b3bb8f.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/invoices/page-9923d5bbee5a89c9.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/judgments/page-dd290557c6948b22.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/layout-34e5620f9fbf2601.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/memory/[entityId]/page-6faf1a99bcc27c06.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/memory/audit/page-276a1a1a5423380f.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/memory/page-e20ae73fade64e1c.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/page-b758df33c161f189.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/receipts/[id]/page-779f2c6fdc359351.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/receipts/page-f3df6ceecaff7cce.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/settings/page-a775a2f3752a1cdd.js +1 -0
- package/standalone/apps/web/.next/static/chunks/app/verify/page-7a654fc6b29b44a8.js +1 -0
- package/standalone/apps/web/.next/static/chunks/framework-6c19635498a17075.js +1 -0
- package/standalone/apps/web/.next/static/chunks/main-07cb75c461ef6926.js +1 -0
- package/standalone/apps/web/.next/static/chunks/main-app-5ae62731e5401157.js +1 -0
- package/standalone/apps/web/.next/static/chunks/pages/{_app-0277c84f8b0dbf6c.js → _app-b8da3f21cdb968e8.js} +1 -1
- package/standalone/apps/web/.next/static/chunks/pages/_error-797d67047bd0e506.js +1 -0
- package/standalone/apps/web/.next/static/chunks/{webpack-acfef48110e09a0e.js → webpack-631fa6a7d974b7cd.js} +1 -1
- package/standalone/apps/web/.next/static/css/415fd9a8d5823143.css +5 -0
- package/standalone/apps/web/src/lib/sdk-server.ts +24 -1
- package/standalone/node_modules/.pnpm/postcss@8.4.31/node_modules/postcss/package.json +0 -0
- package/standalone/packages/crypto/package.json +1 -1
- package/standalone/packages/mcp-server/dist/index.js +695 -0
- package/standalone/packages/mcp-server/package.json +1 -1
- package/standalone/apps/web/.next/server/chunks/236.js +0 -1
- package/standalone/apps/web/.next/server/chunks/319.js +0 -1
- package/standalone/apps/web/.next/server/chunks/568.js +0 -1
- package/standalone/apps/web/.next/server/chunks/640.js +0 -8
- package/standalone/apps/web/.next/server/chunks/718.js +0 -9
- package/standalone/apps/web/.next/server/chunks/783.js +0 -6
- package/standalone/apps/web/.next/server/chunks/798.js +0 -1
- package/standalone/apps/web/.next/server/chunks/803.js +0 -189
- package/standalone/apps/web/.next/server/chunks/872.js +0 -1
- package/standalone/apps/web/.next/server/chunks/99.js +0 -1
- package/standalone/apps/web/.next/static/_nYBCMM2RKAoZB_aY16vH/_buildManifest.js +0 -1
- package/standalone/apps/web/.next/static/chunks/388-350fe7358149b937.js +0 -1
- package/standalone/apps/web/.next/static/chunks/493-829b6213ada29da8.js +0 -1
- package/standalone/apps/web/.next/static/chunks/577-d18d2ca2465d6f72.js +0 -1
- package/standalone/apps/web/.next/static/chunks/702-fda62c486b5bb5f8.js +0 -1
- package/standalone/apps/web/.next/static/chunks/743-1f01386e3a1c3b1c.js +0 -1
- package/standalone/apps/web/.next/static/chunks/935-f80c248ba99512e2.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/_not-found/page-d6caa906bf90ce7d.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/agents/[id]/page-fe1560a72adbddc7.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/agents/page-ab0dfc5113e3ab45.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/api/agents/route-3752a720184a6696.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/api/chains/[id]/route-3752a720184a6696.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/api/cleanup/route-3752a720184a6696.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/api/config/route-3752a720184a6696.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/api/invoices/route-3752a720184a6696.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/api/judgments/route-3752a720184a6696.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/api/receipts/[id]/route-3752a720184a6696.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/api/receipts/route-3752a720184a6696.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/api/search/route-3752a720184a6696.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/api/stats/route-3752a720184a6696.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/api/verify/route-3752a720184a6696.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/chains/[id]/page-ba935d4fadcbc557.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/chains/page-a3f21d8d62ffa174.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/constraints/page-ebfd1721530940c7.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/get-started/layout-3752a720184a6696.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/get-started/page-72febd5ba59689bb.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/how-it-works/page-46a028e3d817a15f.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/invoices/page-71a064dd2e94a214.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/judgments/page-5062f4bb5a918305.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/layout-43fe6d25823e2373.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/page-deece9e5e4e6c9dc.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/receipts/[id]/page-024badaf0b4aa9db.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/receipts/page-dfc039aadf7a6869.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/settings/page-1f33c77dcca141ce.js +0 -1
- package/standalone/apps/web/.next/static/chunks/app/verify/page-1631d147709caa76.js +0 -1
- package/standalone/apps/web/.next/static/chunks/framework-b712132b711b77b2.js +0 -1
- package/standalone/apps/web/.next/static/chunks/main-3cf37cd4e8f17e4b.js +0 -1
- package/standalone/apps/web/.next/static/chunks/main-app-d3c171e7aef05d2f.js +0 -1
- package/standalone/apps/web/.next/static/chunks/pages/_error-5420f4ec91760914.js +0 -1
- package/standalone/apps/web/.next/static/css/b5d5599054174bf1.css +0 -5
- /package/standalone/apps/web/.next/static/{_nYBCMM2RKAoZB_aY16vH → BZdBWaTjiqh8Heg1_5h6o}/_ssgManifest.js +0 -0
|
@@ -135,6 +135,9 @@ var SqliteReceiptStore = class {
|
|
|
135
135
|
data: JSON.stringify(receipt)
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
|
+
getDb() {
|
|
139
|
+
return this.db;
|
|
140
|
+
}
|
|
138
141
|
async save(receipt) {
|
|
139
142
|
const row = this.toRow(receipt);
|
|
140
143
|
this.db.prepare(`INSERT OR REPLACE INTO receipts (
|
|
@@ -474,6 +477,481 @@ var ConfigManager = class {
|
|
|
474
477
|
}
|
|
475
478
|
};
|
|
476
479
|
|
|
480
|
+
// src/storage/memory-store.ts
|
|
481
|
+
var CONFIDENCE_ORDER = {
|
|
482
|
+
certain: 5,
|
|
483
|
+
high: 4,
|
|
484
|
+
medium: 3,
|
|
485
|
+
low: 2,
|
|
486
|
+
deprecated: 1
|
|
487
|
+
};
|
|
488
|
+
var MemoryStore = class {
|
|
489
|
+
constructor(db) {
|
|
490
|
+
this.db = db;
|
|
491
|
+
}
|
|
492
|
+
init() {
|
|
493
|
+
this.db.exec(`
|
|
494
|
+
CREATE TABLE IF NOT EXISTS entities (
|
|
495
|
+
entity_id TEXT PRIMARY KEY,
|
|
496
|
+
entity_type TEXT NOT NULL,
|
|
497
|
+
name TEXT NOT NULL,
|
|
498
|
+
aliases TEXT NOT NULL DEFAULT '[]',
|
|
499
|
+
scope TEXT NOT NULL DEFAULT 'agent',
|
|
500
|
+
created_at TEXT NOT NULL,
|
|
501
|
+
created_by_agent TEXT NOT NULL,
|
|
502
|
+
created_by_receipt TEXT NOT NULL,
|
|
503
|
+
forgotten_at TEXT,
|
|
504
|
+
merged_into TEXT,
|
|
505
|
+
attributes TEXT NOT NULL DEFAULT '{}',
|
|
506
|
+
metadata TEXT NOT NULL DEFAULT '{}'
|
|
507
|
+
);
|
|
508
|
+
|
|
509
|
+
CREATE INDEX IF NOT EXISTS idx_entities_type ON entities(entity_type);
|
|
510
|
+
CREATE INDEX IF NOT EXISTS idx_entities_name ON entities(name);
|
|
511
|
+
CREATE INDEX IF NOT EXISTS idx_entities_scope ON entities(scope);
|
|
512
|
+
CREATE INDEX IF NOT EXISTS idx_entities_agent ON entities(created_by_agent);
|
|
513
|
+
CREATE INDEX IF NOT EXISTS idx_entities_forgotten ON entities(forgotten_at);
|
|
514
|
+
|
|
515
|
+
CREATE TABLE IF NOT EXISTS observations (
|
|
516
|
+
observation_id TEXT PRIMARY KEY,
|
|
517
|
+
entity_id TEXT NOT NULL,
|
|
518
|
+
content TEXT NOT NULL,
|
|
519
|
+
confidence TEXT NOT NULL DEFAULT 'medium',
|
|
520
|
+
source_receipt_id TEXT NOT NULL,
|
|
521
|
+
source_agent_id TEXT NOT NULL,
|
|
522
|
+
source_context TEXT,
|
|
523
|
+
observed_at TEXT NOT NULL,
|
|
524
|
+
forgotten_at TEXT,
|
|
525
|
+
forgotten_by TEXT,
|
|
526
|
+
superseded_by TEXT,
|
|
527
|
+
tags TEXT NOT NULL DEFAULT '[]',
|
|
528
|
+
metadata TEXT NOT NULL DEFAULT '{}',
|
|
529
|
+
FOREIGN KEY (entity_id) REFERENCES entities(entity_id)
|
|
530
|
+
);
|
|
531
|
+
|
|
532
|
+
CREATE INDEX IF NOT EXISTS idx_obs_entity ON observations(entity_id);
|
|
533
|
+
CREATE INDEX IF NOT EXISTS idx_obs_agent ON observations(source_agent_id);
|
|
534
|
+
CREATE INDEX IF NOT EXISTS idx_obs_confidence ON observations(confidence);
|
|
535
|
+
CREATE INDEX IF NOT EXISTS idx_obs_forgotten ON observations(forgotten_at);
|
|
536
|
+
CREATE INDEX IF NOT EXISTS idx_obs_receipt ON observations(source_receipt_id);
|
|
537
|
+
|
|
538
|
+
CREATE TABLE IF NOT EXISTS relationships (
|
|
539
|
+
relationship_id TEXT PRIMARY KEY,
|
|
540
|
+
from_entity_id TEXT NOT NULL,
|
|
541
|
+
to_entity_id TEXT NOT NULL,
|
|
542
|
+
relationship_type TEXT NOT NULL,
|
|
543
|
+
strength TEXT NOT NULL DEFAULT 'medium',
|
|
544
|
+
source_receipt_id TEXT NOT NULL,
|
|
545
|
+
created_at TEXT NOT NULL,
|
|
546
|
+
forgotten_at TEXT,
|
|
547
|
+
metadata TEXT NOT NULL DEFAULT '{}',
|
|
548
|
+
FOREIGN KEY (from_entity_id) REFERENCES entities(entity_id),
|
|
549
|
+
FOREIGN KEY (to_entity_id) REFERENCES entities(entity_id)
|
|
550
|
+
);
|
|
551
|
+
|
|
552
|
+
CREATE INDEX IF NOT EXISTS idx_rel_from ON relationships(from_entity_id);
|
|
553
|
+
CREATE INDEX IF NOT EXISTS idx_rel_to ON relationships(to_entity_id);
|
|
554
|
+
CREATE INDEX IF NOT EXISTS idx_rel_type ON relationships(relationship_type);
|
|
555
|
+
`);
|
|
556
|
+
try {
|
|
557
|
+
this.db.exec(`
|
|
558
|
+
CREATE VIRTUAL TABLE IF NOT EXISTS observations_fts USING fts5(
|
|
559
|
+
content,
|
|
560
|
+
content='observations',
|
|
561
|
+
content_rowid='rowid',
|
|
562
|
+
tokenize='porter unicode61'
|
|
563
|
+
);
|
|
564
|
+
`);
|
|
565
|
+
} catch {
|
|
566
|
+
}
|
|
567
|
+
this.db.exec(`
|
|
568
|
+
CREATE TRIGGER IF NOT EXISTS observations_ai AFTER INSERT ON observations BEGIN
|
|
569
|
+
INSERT INTO observations_fts(rowid, content) VALUES (new.rowid, new.content);
|
|
570
|
+
END;
|
|
571
|
+
|
|
572
|
+
CREATE TRIGGER IF NOT EXISTS observations_ad AFTER DELETE ON observations BEGIN
|
|
573
|
+
INSERT INTO observations_fts(observations_fts, rowid, content) VALUES('delete', old.rowid, old.content);
|
|
574
|
+
END;
|
|
575
|
+
|
|
576
|
+
CREATE TRIGGER IF NOT EXISTS observations_au AFTER UPDATE ON observations BEGIN
|
|
577
|
+
INSERT INTO observations_fts(observations_fts, rowid, content) VALUES('delete', old.rowid, old.content);
|
|
578
|
+
INSERT INTO observations_fts(rowid, content) VALUES (new.rowid, new.content);
|
|
579
|
+
END;
|
|
580
|
+
`);
|
|
581
|
+
}
|
|
582
|
+
// --- Entities ---
|
|
583
|
+
createEntity(entity) {
|
|
584
|
+
this.db.prepare(`
|
|
585
|
+
INSERT INTO entities (entity_id, entity_type, name, aliases, scope, created_at,
|
|
586
|
+
created_by_agent, created_by_receipt, forgotten_at, merged_into, attributes, metadata)
|
|
587
|
+
VALUES (@entity_id, @entity_type, @name, @aliases, @scope, @created_at,
|
|
588
|
+
@created_by_agent, @created_by_receipt, @forgotten_at, @merged_into, @attributes, @metadata)
|
|
589
|
+
`).run({
|
|
590
|
+
entity_id: entity.entity_id,
|
|
591
|
+
entity_type: entity.entity_type,
|
|
592
|
+
name: entity.name,
|
|
593
|
+
aliases: JSON.stringify(entity.aliases),
|
|
594
|
+
scope: entity.scope,
|
|
595
|
+
created_at: entity.created_at,
|
|
596
|
+
created_by_agent: entity.created_by_agent,
|
|
597
|
+
created_by_receipt: entity.created_by_receipt,
|
|
598
|
+
forgotten_at: entity.forgotten_at,
|
|
599
|
+
merged_into: entity.merged_into,
|
|
600
|
+
attributes: JSON.stringify(entity.attributes),
|
|
601
|
+
metadata: JSON.stringify(entity.metadata)
|
|
602
|
+
});
|
|
603
|
+
return entity;
|
|
604
|
+
}
|
|
605
|
+
getEntity(entityId) {
|
|
606
|
+
const row = this.db.prepare("SELECT * FROM entities WHERE entity_id = ?").get(entityId);
|
|
607
|
+
if (!row) return null;
|
|
608
|
+
return this.rowToEntity(row);
|
|
609
|
+
}
|
|
610
|
+
findEntityByName(name, entityType) {
|
|
611
|
+
const row = this.db.prepare(
|
|
612
|
+
"SELECT * FROM entities WHERE name = ? AND entity_type = ? AND forgotten_at IS NULL AND merged_into IS NULL"
|
|
613
|
+
).get(name, entityType);
|
|
614
|
+
if (!row) return null;
|
|
615
|
+
return this.rowToEntity(row);
|
|
616
|
+
}
|
|
617
|
+
findEntities(query) {
|
|
618
|
+
const conditions = [];
|
|
619
|
+
const params = [];
|
|
620
|
+
if (!query.include_forgotten) {
|
|
621
|
+
conditions.push("forgotten_at IS NULL");
|
|
622
|
+
conditions.push("merged_into IS NULL");
|
|
623
|
+
}
|
|
624
|
+
if (query.entity_type) {
|
|
625
|
+
conditions.push("entity_type = ?");
|
|
626
|
+
params.push(query.entity_type);
|
|
627
|
+
}
|
|
628
|
+
if (query.scope) {
|
|
629
|
+
conditions.push("scope = ?");
|
|
630
|
+
params.push(query.scope);
|
|
631
|
+
}
|
|
632
|
+
if (query.agent_id) {
|
|
633
|
+
conditions.push("created_by_agent = ?");
|
|
634
|
+
params.push(query.agent_id);
|
|
635
|
+
}
|
|
636
|
+
if (query.query) {
|
|
637
|
+
conditions.push("(name LIKE ? OR aliases LIKE ?)");
|
|
638
|
+
const pattern = `%${query.query}%`;
|
|
639
|
+
params.push(pattern, pattern);
|
|
640
|
+
}
|
|
641
|
+
const where = conditions.length > 0 ? `WHERE ${conditions.join(" AND ")}` : "";
|
|
642
|
+
const limit = query.limit ?? 20;
|
|
643
|
+
const page = query.page ?? 1;
|
|
644
|
+
const offset = (page - 1) * limit;
|
|
645
|
+
const countRow = this.db.prepare(`SELECT COUNT(*) as cnt FROM entities ${where}`).get(...params);
|
|
646
|
+
const total = countRow.cnt;
|
|
647
|
+
const totalPages = Math.max(1, Math.ceil(total / limit));
|
|
648
|
+
const rows = this.db.prepare(
|
|
649
|
+
`SELECT * FROM entities ${where} ORDER BY created_at DESC LIMIT ? OFFSET ?`
|
|
650
|
+
).all(...params, limit, offset);
|
|
651
|
+
return {
|
|
652
|
+
data: rows.map((r) => this.rowToEntity(r)),
|
|
653
|
+
pagination: {
|
|
654
|
+
page,
|
|
655
|
+
limit,
|
|
656
|
+
total,
|
|
657
|
+
total_pages: totalPages,
|
|
658
|
+
has_next: page < totalPages,
|
|
659
|
+
has_prev: page > 1
|
|
660
|
+
}
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
updateEntity(entityId, updates) {
|
|
664
|
+
const existing = this.getEntity(entityId);
|
|
665
|
+
if (!existing) throw new Error(`Entity not found: ${entityId}`);
|
|
666
|
+
const updated = { ...existing, ...updates };
|
|
667
|
+
this.db.prepare(`
|
|
668
|
+
UPDATE entities SET
|
|
669
|
+
name = @name, aliases = @aliases, scope = @scope,
|
|
670
|
+
attributes = @attributes, metadata = @metadata,
|
|
671
|
+
forgotten_at = @forgotten_at, merged_into = @merged_into
|
|
672
|
+
WHERE entity_id = @entity_id
|
|
673
|
+
`).run({
|
|
674
|
+
entity_id: entityId,
|
|
675
|
+
name: updated.name,
|
|
676
|
+
aliases: JSON.stringify(updated.aliases),
|
|
677
|
+
scope: updated.scope,
|
|
678
|
+
attributes: JSON.stringify(updated.attributes),
|
|
679
|
+
metadata: JSON.stringify(updated.metadata),
|
|
680
|
+
forgotten_at: updated.forgotten_at,
|
|
681
|
+
merged_into: updated.merged_into
|
|
682
|
+
});
|
|
683
|
+
return this.getEntity(entityId);
|
|
684
|
+
}
|
|
685
|
+
forgetEntity(entityId, agentId) {
|
|
686
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
687
|
+
this.db.prepare("UPDATE entities SET forgotten_at = ? WHERE entity_id = ?").run(now, entityId);
|
|
688
|
+
this.db.prepare("UPDATE observations SET forgotten_at = ?, forgotten_by = ? WHERE entity_id = ? AND forgotten_at IS NULL").run(now, agentId, entityId);
|
|
689
|
+
}
|
|
690
|
+
mergeEntities(sourceId, targetId) {
|
|
691
|
+
const source = this.getEntity(sourceId);
|
|
692
|
+
const target = this.getEntity(targetId);
|
|
693
|
+
if (!source) throw new Error(`Source entity not found: ${sourceId}`);
|
|
694
|
+
if (!target) throw new Error(`Target entity not found: ${targetId}`);
|
|
695
|
+
this.db.prepare("UPDATE observations SET entity_id = ? WHERE entity_id = ?").run(targetId, sourceId);
|
|
696
|
+
this.db.prepare("UPDATE relationships SET from_entity_id = ? WHERE from_entity_id = ?").run(targetId, sourceId);
|
|
697
|
+
this.db.prepare("UPDATE relationships SET to_entity_id = ? WHERE to_entity_id = ?").run(targetId, sourceId);
|
|
698
|
+
const mergedAliases = [.../* @__PURE__ */ new Set([...target.aliases, source.name, ...source.aliases])];
|
|
699
|
+
this.db.prepare("UPDATE entities SET aliases = ? WHERE entity_id = ?").run(JSON.stringify(mergedAliases), targetId);
|
|
700
|
+
this.db.prepare("UPDATE entities SET merged_into = ?, forgotten_at = ? WHERE entity_id = ?").run(targetId, (/* @__PURE__ */ new Date()).toISOString(), sourceId);
|
|
701
|
+
return this.getEntity(targetId);
|
|
702
|
+
}
|
|
703
|
+
// --- Observations ---
|
|
704
|
+
addObservation(obs) {
|
|
705
|
+
this.db.prepare(`
|
|
706
|
+
INSERT INTO observations (observation_id, entity_id, content, confidence,
|
|
707
|
+
source_receipt_id, source_agent_id, source_context, observed_at,
|
|
708
|
+
forgotten_at, forgotten_by, superseded_by, tags, metadata)
|
|
709
|
+
VALUES (@observation_id, @entity_id, @content, @confidence,
|
|
710
|
+
@source_receipt_id, @source_agent_id, @source_context, @observed_at,
|
|
711
|
+
@forgotten_at, @forgotten_by, @superseded_by, @tags, @metadata)
|
|
712
|
+
`).run({
|
|
713
|
+
observation_id: obs.observation_id,
|
|
714
|
+
entity_id: obs.entity_id,
|
|
715
|
+
content: obs.content,
|
|
716
|
+
confidence: obs.confidence,
|
|
717
|
+
source_receipt_id: obs.source_receipt_id,
|
|
718
|
+
source_agent_id: obs.source_agent_id,
|
|
719
|
+
source_context: obs.source_context,
|
|
720
|
+
observed_at: obs.observed_at,
|
|
721
|
+
forgotten_at: obs.forgotten_at,
|
|
722
|
+
forgotten_by: obs.forgotten_by,
|
|
723
|
+
superseded_by: obs.superseded_by,
|
|
724
|
+
tags: JSON.stringify(obs.tags),
|
|
725
|
+
metadata: JSON.stringify(obs.metadata)
|
|
726
|
+
});
|
|
727
|
+
return obs;
|
|
728
|
+
}
|
|
729
|
+
getObservation(observationId) {
|
|
730
|
+
const row = this.db.prepare("SELECT * FROM observations WHERE observation_id = ?").get(observationId);
|
|
731
|
+
if (!row) return null;
|
|
732
|
+
return this.rowToObservation(row);
|
|
733
|
+
}
|
|
734
|
+
getObservations(entityId, includeForgotten = false) {
|
|
735
|
+
const where = includeForgotten ? "WHERE entity_id = ?" : "WHERE entity_id = ? AND forgotten_at IS NULL";
|
|
736
|
+
const rows = this.db.prepare(
|
|
737
|
+
`SELECT * FROM observations ${where} ORDER BY observed_at DESC`
|
|
738
|
+
).all(entityId);
|
|
739
|
+
return rows.map((r) => this.rowToObservation(r));
|
|
740
|
+
}
|
|
741
|
+
forgetObservation(obsId, agentId) {
|
|
742
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
743
|
+
this.db.prepare("UPDATE observations SET forgotten_at = ?, forgotten_by = ? WHERE observation_id = ?").run(now, agentId, obsId);
|
|
744
|
+
}
|
|
745
|
+
supersede(oldObsId, newObs) {
|
|
746
|
+
this.db.prepare("UPDATE observations SET superseded_by = ? WHERE observation_id = ?").run(newObs.observation_id, oldObsId);
|
|
747
|
+
return this.addObservation(newObs);
|
|
748
|
+
}
|
|
749
|
+
// --- Relationships ---
|
|
750
|
+
addRelationship(rel) {
|
|
751
|
+
this.db.prepare(`
|
|
752
|
+
INSERT INTO relationships (relationship_id, from_entity_id, to_entity_id,
|
|
753
|
+
relationship_type, strength, source_receipt_id, created_at, forgotten_at, metadata)
|
|
754
|
+
VALUES (@relationship_id, @from_entity_id, @to_entity_id,
|
|
755
|
+
@relationship_type, @strength, @source_receipt_id, @created_at, @forgotten_at, @metadata)
|
|
756
|
+
`).run({
|
|
757
|
+
relationship_id: rel.relationship_id,
|
|
758
|
+
from_entity_id: rel.from_entity_id,
|
|
759
|
+
to_entity_id: rel.to_entity_id,
|
|
760
|
+
relationship_type: rel.relationship_type,
|
|
761
|
+
strength: rel.strength,
|
|
762
|
+
source_receipt_id: rel.source_receipt_id,
|
|
763
|
+
created_at: rel.created_at,
|
|
764
|
+
forgotten_at: rel.forgotten_at,
|
|
765
|
+
metadata: JSON.stringify(rel.metadata)
|
|
766
|
+
});
|
|
767
|
+
return rel;
|
|
768
|
+
}
|
|
769
|
+
getRelationships(entityId) {
|
|
770
|
+
const rows = this.db.prepare(
|
|
771
|
+
"SELECT * FROM relationships WHERE (from_entity_id = ? OR to_entity_id = ?) AND forgotten_at IS NULL ORDER BY created_at DESC"
|
|
772
|
+
).all(entityId, entityId);
|
|
773
|
+
return rows.map((r) => this.rowToRelationship(r));
|
|
774
|
+
}
|
|
775
|
+
forgetRelationship(relId) {
|
|
776
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
777
|
+
this.db.prepare("UPDATE relationships SET forgotten_at = ? WHERE relationship_id = ?").run(now, relId);
|
|
778
|
+
}
|
|
779
|
+
// --- Search ---
|
|
780
|
+
search(query, filters) {
|
|
781
|
+
const limit = filters?.limit ?? 20;
|
|
782
|
+
let results;
|
|
783
|
+
try {
|
|
784
|
+
const ftsRows = this.db.prepare(`
|
|
785
|
+
SELECT o.*, observations_fts.rank
|
|
786
|
+
FROM observations_fts
|
|
787
|
+
JOIN observations o ON o.rowid = observations_fts.rowid
|
|
788
|
+
WHERE observations_fts MATCH ?
|
|
789
|
+
AND o.forgotten_at IS NULL
|
|
790
|
+
ORDER BY rank
|
|
791
|
+
LIMIT ?
|
|
792
|
+
`).all(query, limit);
|
|
793
|
+
results = ftsRows.map((row) => {
|
|
794
|
+
const obs = this.rowToObservation(row);
|
|
795
|
+
const entity = this.getEntity(obs.entity_id);
|
|
796
|
+
return {
|
|
797
|
+
entity,
|
|
798
|
+
observation: obs,
|
|
799
|
+
rank: row.rank
|
|
800
|
+
};
|
|
801
|
+
}).filter((r) => r.entity !== null);
|
|
802
|
+
} catch {
|
|
803
|
+
const likeRows = this.db.prepare(`
|
|
804
|
+
SELECT * FROM observations
|
|
805
|
+
WHERE content LIKE ? AND forgotten_at IS NULL
|
|
806
|
+
ORDER BY observed_at DESC
|
|
807
|
+
LIMIT ?
|
|
808
|
+
`).all(`%${query}%`, limit);
|
|
809
|
+
results = likeRows.map((row, idx) => {
|
|
810
|
+
const obs = this.rowToObservation(row);
|
|
811
|
+
const entity = this.getEntity(obs.entity_id);
|
|
812
|
+
return {
|
|
813
|
+
entity,
|
|
814
|
+
observation: obs,
|
|
815
|
+
rank: idx
|
|
816
|
+
};
|
|
817
|
+
}).filter((r) => r.entity !== null);
|
|
818
|
+
}
|
|
819
|
+
if (filters?.entity_type) {
|
|
820
|
+
results = results.filter((r) => r.entity.entity_type === filters.entity_type);
|
|
821
|
+
}
|
|
822
|
+
if (filters?.scope) {
|
|
823
|
+
results = results.filter((r) => r.entity.scope === filters.scope);
|
|
824
|
+
}
|
|
825
|
+
if (filters?.confidence_min) {
|
|
826
|
+
const minOrder = CONFIDENCE_ORDER[filters.confidence_min] ?? 0;
|
|
827
|
+
results = results.filter((r) => (CONFIDENCE_ORDER[r.observation.confidence] ?? 0) >= minOrder);
|
|
828
|
+
}
|
|
829
|
+
return results;
|
|
830
|
+
}
|
|
831
|
+
recall(query) {
|
|
832
|
+
if (query.query) {
|
|
833
|
+
const results = this.search(query.query, query);
|
|
834
|
+
const entityMap = /* @__PURE__ */ new Map();
|
|
835
|
+
const observations2 = [];
|
|
836
|
+
for (const r of results) {
|
|
837
|
+
entityMap.set(r.entity.entity_id, r.entity);
|
|
838
|
+
observations2.push(r.observation);
|
|
839
|
+
}
|
|
840
|
+
return {
|
|
841
|
+
entities: Array.from(entityMap.values()),
|
|
842
|
+
observations: observations2,
|
|
843
|
+
total: observations2.length
|
|
844
|
+
};
|
|
845
|
+
}
|
|
846
|
+
const entityResult = this.findEntities(query);
|
|
847
|
+
const observations = [];
|
|
848
|
+
for (const entity of entityResult.data) {
|
|
849
|
+
const obs = this.getObservations(entity.entity_id, query.include_forgotten);
|
|
850
|
+
observations.push(...obs);
|
|
851
|
+
}
|
|
852
|
+
return {
|
|
853
|
+
entities: entityResult.data,
|
|
854
|
+
observations,
|
|
855
|
+
total: observations.length
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
// --- Audit ---
|
|
859
|
+
getEntityHistory(entityId) {
|
|
860
|
+
const rows = this.db.prepare(
|
|
861
|
+
"SELECT * FROM observations WHERE entity_id = ? ORDER BY observed_at ASC"
|
|
862
|
+
).all(entityId);
|
|
863
|
+
return rows.map((r) => this.rowToObservation(r));
|
|
864
|
+
}
|
|
865
|
+
getMemoryProvenance(observationId) {
|
|
866
|
+
const obs = this.getObservation(observationId);
|
|
867
|
+
if (!obs) return null;
|
|
868
|
+
const entity = this.getEntity(obs.entity_id);
|
|
869
|
+
if (!entity) return null;
|
|
870
|
+
return {
|
|
871
|
+
observation: obs,
|
|
872
|
+
entity,
|
|
873
|
+
receipt_id: obs.source_receipt_id,
|
|
874
|
+
chain: []
|
|
875
|
+
};
|
|
876
|
+
}
|
|
877
|
+
getMemoryStats(agentId, from, to) {
|
|
878
|
+
const entityConditions = [];
|
|
879
|
+
const obsConditions = [];
|
|
880
|
+
const params = [];
|
|
881
|
+
if (agentId) {
|
|
882
|
+
entityConditions.push("created_by_agent = ?");
|
|
883
|
+
obsConditions.push("source_agent_id = ?");
|
|
884
|
+
params.push(agentId);
|
|
885
|
+
}
|
|
886
|
+
const entityWhere = entityConditions.length > 0 ? `WHERE ${entityConditions.join(" AND ")}` : "";
|
|
887
|
+
const obsWhere = obsConditions.length > 0 ? `WHERE ${obsConditions.join(" AND ")}` : "";
|
|
888
|
+
const totalEntities = this.db.prepare(`SELECT COUNT(*) as cnt FROM entities ${entityWhere}`).get(...agentId ? [agentId] : []).cnt;
|
|
889
|
+
const totalObs = this.db.prepare(`SELECT COUNT(*) as cnt FROM observations ${obsWhere}`).get(...agentId ? [agentId] : []).cnt;
|
|
890
|
+
const totalRels = this.db.prepare("SELECT COUNT(*) as cnt FROM relationships").get().cnt;
|
|
891
|
+
const forgottenObs = this.db.prepare(`SELECT COUNT(*) as cnt FROM observations WHERE forgotten_at IS NOT NULL ${agentId ? "AND source_agent_id = ?" : ""}`).get(...agentId ? [agentId] : []).cnt;
|
|
892
|
+
const forgottenEntities = this.db.prepare(`SELECT COUNT(*) as cnt FROM entities WHERE forgotten_at IS NOT NULL ${agentId ? "AND created_by_agent = ?" : ""}`).get(...agentId ? [agentId] : []).cnt;
|
|
893
|
+
const typeRows = this.db.prepare("SELECT entity_type, COUNT(*) as cnt FROM entities GROUP BY entity_type").all();
|
|
894
|
+
const byType = {};
|
|
895
|
+
for (const r of typeRows) byType[r.entity_type] = r.cnt;
|
|
896
|
+
return {
|
|
897
|
+
total_entities: totalEntities,
|
|
898
|
+
total_observations: totalObs,
|
|
899
|
+
total_relationships: totalRels,
|
|
900
|
+
forgotten_observations: forgottenObs,
|
|
901
|
+
forgotten_entities: forgottenEntities,
|
|
902
|
+
by_entity_type: byType,
|
|
903
|
+
by_operation: {}
|
|
904
|
+
};
|
|
905
|
+
}
|
|
906
|
+
// --- Row converters ---
|
|
907
|
+
rowToEntity(row) {
|
|
908
|
+
return {
|
|
909
|
+
entity_id: row.entity_id,
|
|
910
|
+
entity_type: row.entity_type,
|
|
911
|
+
name: row.name,
|
|
912
|
+
aliases: JSON.parse(row.aliases || "[]"),
|
|
913
|
+
scope: row.scope,
|
|
914
|
+
created_at: row.created_at,
|
|
915
|
+
created_by_agent: row.created_by_agent,
|
|
916
|
+
created_by_receipt: row.created_by_receipt,
|
|
917
|
+
forgotten_at: row.forgotten_at || null,
|
|
918
|
+
merged_into: row.merged_into || null,
|
|
919
|
+
attributes: JSON.parse(row.attributes || "{}"),
|
|
920
|
+
metadata: JSON.parse(row.metadata || "{}")
|
|
921
|
+
};
|
|
922
|
+
}
|
|
923
|
+
rowToObservation(row) {
|
|
924
|
+
return {
|
|
925
|
+
observation_id: row.observation_id,
|
|
926
|
+
entity_id: row.entity_id,
|
|
927
|
+
content: row.content,
|
|
928
|
+
confidence: row.confidence,
|
|
929
|
+
source_receipt_id: row.source_receipt_id,
|
|
930
|
+
source_agent_id: row.source_agent_id,
|
|
931
|
+
source_context: row.source_context || null,
|
|
932
|
+
observed_at: row.observed_at,
|
|
933
|
+
forgotten_at: row.forgotten_at || null,
|
|
934
|
+
forgotten_by: row.forgotten_by || null,
|
|
935
|
+
superseded_by: row.superseded_by || null,
|
|
936
|
+
tags: JSON.parse(row.tags || "[]"),
|
|
937
|
+
metadata: JSON.parse(row.metadata || "{}")
|
|
938
|
+
};
|
|
939
|
+
}
|
|
940
|
+
rowToRelationship(row) {
|
|
941
|
+
return {
|
|
942
|
+
relationship_id: row.relationship_id,
|
|
943
|
+
from_entity_id: row.from_entity_id,
|
|
944
|
+
to_entity_id: row.to_entity_id,
|
|
945
|
+
relationship_type: row.relationship_type,
|
|
946
|
+
strength: row.strength,
|
|
947
|
+
source_receipt_id: row.source_receipt_id,
|
|
948
|
+
created_at: row.created_at,
|
|
949
|
+
forgotten_at: row.forgotten_at || null,
|
|
950
|
+
metadata: JSON.parse(row.metadata || "{}")
|
|
951
|
+
};
|
|
952
|
+
}
|
|
953
|
+
};
|
|
954
|
+
|
|
477
955
|
// src/engine/receipt-engine.ts
|
|
478
956
|
import { nanoid } from "nanoid";
|
|
479
957
|
import { ActionReceipt } from "@agent-receipts/schema";
|
|
@@ -1127,6 +1605,221 @@ var ReceiptEngine = class {
|
|
|
1127
1605
|
}
|
|
1128
1606
|
};
|
|
1129
1607
|
|
|
1608
|
+
// src/engine/memory-engine.ts
|
|
1609
|
+
import { nanoid as nanoid2 } from "nanoid";
|
|
1610
|
+
var MemoryEngine = class {
|
|
1611
|
+
constructor(receiptEngine, memoryStore) {
|
|
1612
|
+
this.receiptEngine = receiptEngine;
|
|
1613
|
+
this.memoryStore = memoryStore;
|
|
1614
|
+
}
|
|
1615
|
+
async observe(params) {
|
|
1616
|
+
const scope = params.scope ?? "agent";
|
|
1617
|
+
const confidence = params.confidence ?? "medium";
|
|
1618
|
+
let createdEntity = false;
|
|
1619
|
+
let entity = this.memoryStore.findEntityByName(params.entityName, params.entityType);
|
|
1620
|
+
const receipt = await this.receiptEngine.create({
|
|
1621
|
+
action: "memory.observe",
|
|
1622
|
+
receipt_type: "memory",
|
|
1623
|
+
input_hash: hashData({ entityName: params.entityName, content: params.content }),
|
|
1624
|
+
status: "completed",
|
|
1625
|
+
metadata: {
|
|
1626
|
+
memory: {
|
|
1627
|
+
memory_operation: "observe",
|
|
1628
|
+
entity_id: entity?.entity_id ?? null,
|
|
1629
|
+
observation_id: null,
|
|
1630
|
+
// Will be set below
|
|
1631
|
+
relationship_id: null,
|
|
1632
|
+
scope,
|
|
1633
|
+
query: null,
|
|
1634
|
+
results_count: null,
|
|
1635
|
+
confidence
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
});
|
|
1639
|
+
if (!entity) {
|
|
1640
|
+
entity = this.memoryStore.createEntity({
|
|
1641
|
+
entity_id: `ent_${nanoid2(12)}`,
|
|
1642
|
+
entity_type: params.entityType,
|
|
1643
|
+
name: params.entityName,
|
|
1644
|
+
aliases: [],
|
|
1645
|
+
scope,
|
|
1646
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1647
|
+
created_by_agent: params.agentId,
|
|
1648
|
+
created_by_receipt: receipt.receipt_id,
|
|
1649
|
+
forgotten_at: null,
|
|
1650
|
+
merged_into: null,
|
|
1651
|
+
attributes: {},
|
|
1652
|
+
metadata: {}
|
|
1653
|
+
});
|
|
1654
|
+
createdEntity = true;
|
|
1655
|
+
}
|
|
1656
|
+
const observation = this.memoryStore.addObservation({
|
|
1657
|
+
observation_id: `obs_${nanoid2(12)}`,
|
|
1658
|
+
entity_id: entity.entity_id,
|
|
1659
|
+
content: params.content,
|
|
1660
|
+
confidence,
|
|
1661
|
+
source_receipt_id: receipt.receipt_id,
|
|
1662
|
+
source_agent_id: params.agentId,
|
|
1663
|
+
source_context: params.context ?? null,
|
|
1664
|
+
observed_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1665
|
+
forgotten_at: null,
|
|
1666
|
+
forgotten_by: null,
|
|
1667
|
+
superseded_by: null,
|
|
1668
|
+
tags: params.tags ?? [],
|
|
1669
|
+
metadata: {}
|
|
1670
|
+
});
|
|
1671
|
+
return { entity, observation, receipt, created_entity: createdEntity };
|
|
1672
|
+
}
|
|
1673
|
+
async recall(params) {
|
|
1674
|
+
const memoryQuery = {
|
|
1675
|
+
query: params.query,
|
|
1676
|
+
entity_type: params.entityType,
|
|
1677
|
+
entity_id: params.entityId,
|
|
1678
|
+
scope: params.scope,
|
|
1679
|
+
limit: params.limit ?? 20,
|
|
1680
|
+
include_forgotten: false,
|
|
1681
|
+
page: 1
|
|
1682
|
+
};
|
|
1683
|
+
const result = this.memoryStore.recall(memoryQuery);
|
|
1684
|
+
const receipt = await this.receiptEngine.create({
|
|
1685
|
+
action: "memory.recall",
|
|
1686
|
+
receipt_type: "memory",
|
|
1687
|
+
input_hash: hashData({ query: params.query, entityType: params.entityType, entityId: params.entityId }),
|
|
1688
|
+
output_hash: hashData({ entities: result.entities.length, observations: result.observations.length }),
|
|
1689
|
+
status: "completed",
|
|
1690
|
+
metadata: {
|
|
1691
|
+
memory: {
|
|
1692
|
+
memory_operation: "recall",
|
|
1693
|
+
entity_id: params.entityId ?? null,
|
|
1694
|
+
observation_id: null,
|
|
1695
|
+
relationship_id: null,
|
|
1696
|
+
scope: params.scope ?? "agent",
|
|
1697
|
+
query: params.query ?? null,
|
|
1698
|
+
results_count: result.total,
|
|
1699
|
+
confidence: null
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
});
|
|
1703
|
+
return {
|
|
1704
|
+
entities: result.entities,
|
|
1705
|
+
observations: result.observations,
|
|
1706
|
+
receipt
|
|
1707
|
+
};
|
|
1708
|
+
}
|
|
1709
|
+
async forget(params) {
|
|
1710
|
+
const operation = params.entityId ? "memory.forget_entity" : "memory.forget";
|
|
1711
|
+
if (params.entityId) {
|
|
1712
|
+
this.memoryStore.forgetEntity(params.entityId, params.agentId);
|
|
1713
|
+
} else if (params.observationId) {
|
|
1714
|
+
this.memoryStore.forgetObservation(params.observationId, params.agentId);
|
|
1715
|
+
} else {
|
|
1716
|
+
throw new Error("Either entityId or observationId must be provided");
|
|
1717
|
+
}
|
|
1718
|
+
const receipt = await this.receiptEngine.create({
|
|
1719
|
+
action: operation,
|
|
1720
|
+
receipt_type: "memory",
|
|
1721
|
+
input_hash: hashData({ entityId: params.entityId, observationId: params.observationId, reason: params.reason }),
|
|
1722
|
+
status: "completed",
|
|
1723
|
+
metadata: {
|
|
1724
|
+
memory: {
|
|
1725
|
+
memory_operation: params.entityId ? "forget_entity" : "forget",
|
|
1726
|
+
entity_id: params.entityId ?? null,
|
|
1727
|
+
observation_id: params.observationId ?? null,
|
|
1728
|
+
relationship_id: null,
|
|
1729
|
+
scope: "agent",
|
|
1730
|
+
query: null,
|
|
1731
|
+
results_count: null,
|
|
1732
|
+
confidence: null
|
|
1733
|
+
},
|
|
1734
|
+
reason: params.reason
|
|
1735
|
+
}
|
|
1736
|
+
});
|
|
1737
|
+
return { receipt };
|
|
1738
|
+
}
|
|
1739
|
+
async relate(params) {
|
|
1740
|
+
const receipt = await this.receiptEngine.create({
|
|
1741
|
+
action: "memory.relate",
|
|
1742
|
+
receipt_type: "memory",
|
|
1743
|
+
input_hash: hashData({ from: params.fromEntityId, to: params.toEntityId, type: params.relationshipType }),
|
|
1744
|
+
status: "completed",
|
|
1745
|
+
metadata: {
|
|
1746
|
+
memory: {
|
|
1747
|
+
memory_operation: "observe",
|
|
1748
|
+
entity_id: params.fromEntityId,
|
|
1749
|
+
observation_id: null,
|
|
1750
|
+
relationship_id: null,
|
|
1751
|
+
scope: "agent",
|
|
1752
|
+
query: null,
|
|
1753
|
+
results_count: null,
|
|
1754
|
+
confidence: params.strength ?? "medium"
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
});
|
|
1758
|
+
const relationship = this.memoryStore.addRelationship({
|
|
1759
|
+
relationship_id: `rel_${nanoid2(12)}`,
|
|
1760
|
+
from_entity_id: params.fromEntityId,
|
|
1761
|
+
to_entity_id: params.toEntityId,
|
|
1762
|
+
relationship_type: params.relationshipType,
|
|
1763
|
+
strength: params.strength ?? "medium",
|
|
1764
|
+
source_receipt_id: receipt.receipt_id,
|
|
1765
|
+
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1766
|
+
forgotten_at: null,
|
|
1767
|
+
metadata: params.context ? { context: params.context } : {}
|
|
1768
|
+
});
|
|
1769
|
+
return { relationship, receipt };
|
|
1770
|
+
}
|
|
1771
|
+
async merge(params) {
|
|
1772
|
+
const mergedEntity = this.memoryStore.mergeEntities(params.sourceEntityId, params.targetEntityId);
|
|
1773
|
+
const receipt = await this.receiptEngine.create({
|
|
1774
|
+
action: "memory.merge",
|
|
1775
|
+
receipt_type: "memory",
|
|
1776
|
+
input_hash: hashData({ source: params.sourceEntityId, target: params.targetEntityId }),
|
|
1777
|
+
output_hash: hashData(mergedEntity),
|
|
1778
|
+
status: "completed",
|
|
1779
|
+
metadata: {
|
|
1780
|
+
memory: {
|
|
1781
|
+
memory_operation: "merge",
|
|
1782
|
+
entity_id: params.targetEntityId,
|
|
1783
|
+
observation_id: null,
|
|
1784
|
+
relationship_id: null,
|
|
1785
|
+
scope: mergedEntity.scope,
|
|
1786
|
+
query: null,
|
|
1787
|
+
results_count: null,
|
|
1788
|
+
confidence: null
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
});
|
|
1792
|
+
return { mergedEntity, receipt };
|
|
1793
|
+
}
|
|
1794
|
+
provenance(observationId) {
|
|
1795
|
+
return this.memoryStore.getMemoryProvenance(observationId);
|
|
1796
|
+
}
|
|
1797
|
+
entityTimeline(entityId) {
|
|
1798
|
+
const observations = this.memoryStore.getEntityHistory(entityId);
|
|
1799
|
+
const relationships = this.memoryStore.getRelationships(entityId);
|
|
1800
|
+
const entries = [];
|
|
1801
|
+
for (const obs of observations) {
|
|
1802
|
+
entries.push({
|
|
1803
|
+
type: obs.forgotten_at ? "forget" : "observation",
|
|
1804
|
+
timestamp: obs.observed_at,
|
|
1805
|
+
data: obs
|
|
1806
|
+
});
|
|
1807
|
+
}
|
|
1808
|
+
for (const rel of relationships) {
|
|
1809
|
+
entries.push({
|
|
1810
|
+
type: "relationship",
|
|
1811
|
+
timestamp: rel.created_at,
|
|
1812
|
+
data: rel
|
|
1813
|
+
});
|
|
1814
|
+
}
|
|
1815
|
+
entries.sort((a, b) => a.timestamp.localeCompare(b.timestamp));
|
|
1816
|
+
return entries;
|
|
1817
|
+
}
|
|
1818
|
+
memoryAudit(params) {
|
|
1819
|
+
return this.memoryStore.getMemoryStats(params.agentId, params.from, params.to);
|
|
1820
|
+
}
|
|
1821
|
+
};
|
|
1822
|
+
|
|
1130
1823
|
// src/engine/invoice-formatters.ts
|
|
1131
1824
|
function formatInvoiceJSON(invoice, includeReceipts = false) {
|
|
1132
1825
|
if (!includeReceipts) {
|
|
@@ -1722,6 +2415,8 @@ export {
|
|
|
1722
2415
|
ConfigManager,
|
|
1723
2416
|
ReceiptStore as JsonReceiptStore,
|
|
1724
2417
|
KeyManager,
|
|
2418
|
+
MemoryEngine,
|
|
2419
|
+
MemoryStore,
|
|
1725
2420
|
ReceiptEngine,
|
|
1726
2421
|
SqliteReceiptStore as ReceiptStore,
|
|
1727
2422
|
SqliteReceiptStore,
|