@agent-receipts/dashboard 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/package.json +5 -6
  2. package/standalone/apps/web/.next/BUILD_ID +1 -1
  3. package/standalone/apps/web/.next/app-build-manifest.json +55 -55
  4. package/standalone/apps/web/.next/app-path-routes-manifest.json +13 -13
  5. package/standalone/apps/web/.next/build-manifest.json +2 -2
  6. package/standalone/apps/web/.next/prerender-manifest.json +34 -34
  7. package/standalone/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  8. package/standalone/apps/web/.next/server/app/_not-found.html +2 -2
  9. package/standalone/apps/web/.next/server/app/_not-found.rsc +2 -2
  10. package/standalone/apps/web/.next/server/app/agents/[id]/page_client-reference-manifest.js +1 -1
  11. package/standalone/apps/web/.next/server/app/agents/page_client-reference-manifest.js +1 -1
  12. package/standalone/apps/web/.next/server/app/agents.html +2 -2
  13. package/standalone/apps/web/.next/server/app/agents.rsc +2 -2
  14. package/standalone/apps/web/.next/server/app/api/agents/route.js +1 -1
  15. package/standalone/apps/web/.next/server/app/api/agents/route.js.nft.json +1 -1
  16. package/standalone/apps/web/.next/server/app/api/agents/route_client-reference-manifest.js +1 -1
  17. package/standalone/apps/web/.next/server/app/api/chains/[id]/route.js +1 -1
  18. package/standalone/apps/web/.next/server/app/api/chains/[id]/route.js.nft.json +1 -1
  19. package/standalone/apps/web/.next/server/app/api/chains/[id]/route_client-reference-manifest.js +1 -1
  20. package/standalone/apps/web/.next/server/app/api/cleanup/route.js +1 -1
  21. package/standalone/apps/web/.next/server/app/api/cleanup/route.js.nft.json +1 -1
  22. package/standalone/apps/web/.next/server/app/api/cleanup/route_client-reference-manifest.js +1 -1
  23. package/standalone/apps/web/.next/server/app/api/config/route.js +1 -1
  24. package/standalone/apps/web/.next/server/app/api/config/route.js.nft.json +1 -1
  25. package/standalone/apps/web/.next/server/app/api/config/route_client-reference-manifest.js +1 -1
  26. package/standalone/apps/web/.next/server/app/api/invoices/route.js +1 -1
  27. package/standalone/apps/web/.next/server/app/api/invoices/route.js.nft.json +1 -1
  28. package/standalone/apps/web/.next/server/app/api/invoices/route_client-reference-manifest.js +1 -1
  29. package/standalone/apps/web/.next/server/app/api/judgments/route.js +1 -1
  30. package/standalone/apps/web/.next/server/app/api/judgments/route.js.nft.json +1 -1
  31. package/standalone/apps/web/.next/server/app/api/judgments/route_client-reference-manifest.js +1 -1
  32. package/standalone/apps/web/.next/server/app/api/memory/audit/route.js +1 -1
  33. package/standalone/apps/web/.next/server/app/api/memory/audit/route.js.nft.json +1 -1
  34. package/standalone/apps/web/.next/server/app/api/memory/audit/route_client-reference-manifest.js +1 -1
  35. package/standalone/apps/web/.next/server/app/api/memory/entities/[id]/route.js +1 -1
  36. package/standalone/apps/web/.next/server/app/api/memory/entities/[id]/route.js.nft.json +1 -1
  37. package/standalone/apps/web/.next/server/app/api/memory/entities/[id]/route_client-reference-manifest.js +1 -1
  38. package/standalone/apps/web/.next/server/app/api/memory/entities/route.js +1 -1
  39. package/standalone/apps/web/.next/server/app/api/memory/entities/route.js.nft.json +1 -1
  40. package/standalone/apps/web/.next/server/app/api/memory/entities/route_client-reference-manifest.js +1 -1
  41. package/standalone/apps/web/.next/server/app/api/memory/forget/route.js +1 -1
  42. package/standalone/apps/web/.next/server/app/api/memory/forget/route.js.nft.json +1 -1
  43. package/standalone/apps/web/.next/server/app/api/memory/forget/route_client-reference-manifest.js +1 -1
  44. package/standalone/apps/web/.next/server/app/api/memory/observe/route.js +1 -1
  45. package/standalone/apps/web/.next/server/app/api/memory/observe/route.js.nft.json +1 -1
  46. package/standalone/apps/web/.next/server/app/api/memory/observe/route_client-reference-manifest.js +1 -1
  47. package/standalone/apps/web/.next/server/app/api/memory/provenance/[obsId]/route.js +1 -1
  48. package/standalone/apps/web/.next/server/app/api/memory/provenance/[obsId]/route.js.nft.json +1 -1
  49. package/standalone/apps/web/.next/server/app/api/memory/provenance/[obsId]/route_client-reference-manifest.js +1 -1
  50. package/standalone/apps/web/.next/server/app/api/memory/recall/route.js +1 -1
  51. package/standalone/apps/web/.next/server/app/api/memory/recall/route.js.nft.json +1 -1
  52. package/standalone/apps/web/.next/server/app/api/memory/recall/route_client-reference-manifest.js +1 -1
  53. package/standalone/apps/web/.next/server/app/api/receipts/[id]/route.js +1 -1
  54. package/standalone/apps/web/.next/server/app/api/receipts/[id]/route.js.nft.json +1 -1
  55. package/standalone/apps/web/.next/server/app/api/receipts/[id]/route_client-reference-manifest.js +1 -1
  56. package/standalone/apps/web/.next/server/app/api/receipts/route.js +1 -1
  57. package/standalone/apps/web/.next/server/app/api/receipts/route.js.nft.json +1 -1
  58. package/standalone/apps/web/.next/server/app/api/receipts/route_client-reference-manifest.js +1 -1
  59. package/standalone/apps/web/.next/server/app/api/search/route.js +1 -1
  60. package/standalone/apps/web/.next/server/app/api/search/route.js.nft.json +1 -1
  61. package/standalone/apps/web/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
  62. package/standalone/apps/web/.next/server/app/api/stats/route.js +1 -1
  63. package/standalone/apps/web/.next/server/app/api/stats/route.js.nft.json +1 -1
  64. package/standalone/apps/web/.next/server/app/api/stats/route_client-reference-manifest.js +1 -1
  65. package/standalone/apps/web/.next/server/app/api/verify/route.js +1 -1
  66. package/standalone/apps/web/.next/server/app/api/verify/route.js.nft.json +1 -1
  67. package/standalone/apps/web/.next/server/app/api/verify/route_client-reference-manifest.js +1 -1
  68. package/standalone/apps/web/.next/server/app/chains/[id]/page_client-reference-manifest.js +1 -1
  69. package/standalone/apps/web/.next/server/app/chains/page_client-reference-manifest.js +1 -1
  70. package/standalone/apps/web/.next/server/app/chains.html +2 -2
  71. package/standalone/apps/web/.next/server/app/chains.rsc +2 -2
  72. package/standalone/apps/web/.next/server/app/constraints/page_client-reference-manifest.js +1 -1
  73. package/standalone/apps/web/.next/server/app/constraints.html +2 -2
  74. package/standalone/apps/web/.next/server/app/constraints.rsc +2 -2
  75. package/standalone/apps/web/.next/server/app/get-started/page_client-reference-manifest.js +1 -1
  76. package/standalone/apps/web/.next/server/app/get-started.html +2 -2
  77. package/standalone/apps/web/.next/server/app/get-started.rsc +2 -2
  78. package/standalone/apps/web/.next/server/app/how-it-works/page_client-reference-manifest.js +1 -1
  79. package/standalone/apps/web/.next/server/app/how-it-works.html +2 -2
  80. package/standalone/apps/web/.next/server/app/how-it-works.rsc +2 -2
  81. package/standalone/apps/web/.next/server/app/index.html +2 -2
  82. package/standalone/apps/web/.next/server/app/index.rsc +2 -2
  83. package/standalone/apps/web/.next/server/app/invoices/page_client-reference-manifest.js +1 -1
  84. package/standalone/apps/web/.next/server/app/invoices.html +2 -2
  85. package/standalone/apps/web/.next/server/app/invoices.rsc +2 -2
  86. package/standalone/apps/web/.next/server/app/judgments/page_client-reference-manifest.js +1 -1
  87. package/standalone/apps/web/.next/server/app/judgments.html +2 -2
  88. package/standalone/apps/web/.next/server/app/judgments.rsc +2 -2
  89. package/standalone/apps/web/.next/server/app/memory/[entityId]/page_client-reference-manifest.js +1 -1
  90. package/standalone/apps/web/.next/server/app/memory/audit/page_client-reference-manifest.js +1 -1
  91. package/standalone/apps/web/.next/server/app/memory/audit.html +2 -2
  92. package/standalone/apps/web/.next/server/app/memory/audit.rsc +2 -2
  93. package/standalone/apps/web/.next/server/app/memory/page_client-reference-manifest.js +1 -1
  94. package/standalone/apps/web/.next/server/app/memory.html +2 -2
  95. package/standalone/apps/web/.next/server/app/memory.rsc +2 -2
  96. package/standalone/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
  97. package/standalone/apps/web/.next/server/app/receipts/[id]/page.js +1 -1
  98. package/standalone/apps/web/.next/server/app/receipts/[id]/page_client-reference-manifest.js +1 -1
  99. package/standalone/apps/web/.next/server/app/receipts/page.js +1 -1
  100. package/standalone/apps/web/.next/server/app/receipts/page_client-reference-manifest.js +1 -1
  101. package/standalone/apps/web/.next/server/app/receipts.html +2 -2
  102. package/standalone/apps/web/.next/server/app/receipts.rsc +3 -3
  103. package/standalone/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  104. package/standalone/apps/web/.next/server/app/settings.html +2 -2
  105. package/standalone/apps/web/.next/server/app/settings.rsc +2 -2
  106. package/standalone/apps/web/.next/server/app/verify/page_client-reference-manifest.js +1 -1
  107. package/standalone/apps/web/.next/server/app/verify.html +2 -2
  108. package/standalone/apps/web/.next/server/app/verify.rsc +2 -2
  109. package/standalone/apps/web/.next/server/app-paths-manifest.json +13 -13
  110. package/standalone/apps/web/.next/server/chunks/1725.js +1 -0
  111. package/standalone/apps/web/.next/server/chunks/4099.js +1 -1
  112. package/standalone/apps/web/.next/server/chunks/4886.js +1 -0
  113. package/standalone/apps/web/.next/server/chunks/6803.js +44 -6
  114. package/standalone/apps/web/.next/server/pages/404.html +2 -2
  115. package/standalone/apps/web/.next/server/pages/500.html +1 -1
  116. package/standalone/apps/web/.next/server/pages/_error.js +2 -2
  117. package/standalone/apps/web/.next/server/pages-manifest.json +1 -1
  118. package/standalone/apps/web/.next/static/chunks/app/receipts/[id]/page-3b95a98a03395684.js +1 -0
  119. package/standalone/apps/web/.next/static/chunks/app/receipts/page-665b6e374ca41d0c.js +1 -0
  120. package/standalone/apps/web/.next/static/css/90a952694ea5745a.css +5 -0
  121. package/standalone/apps/web/src/lib/demo-memory-store.ts +238 -0
  122. package/standalone/node_modules/.pnpm/postcss@8.4.31/node_modules/postcss/package.json +0 -0
  123. package/standalone/packages/crypto/package.json +1 -1
  124. package/standalone/packages/mcp-server/dist/index.js +135 -3
  125. package/standalone/packages/mcp-server/package.json +1 -1
  126. package/standalone/apps/web/.next/static/chunks/app/receipts/[id]/page-779f2c6fdc359351.js +0 -1
  127. package/standalone/apps/web/.next/static/chunks/app/receipts/page-f3df6ceecaff7cce.js +0 -1
  128. package/standalone/apps/web/.next/static/css/415fd9a8d5823143.css +0 -5
  129. /package/standalone/apps/web/.next/static/{BZdBWaTjiqh8Heg1_5h6o → 4imcQFGwcLOgYedAyPG7i}/_buildManifest.js +0 -0
  130. /package/standalone/apps/web/.next/static/{BZdBWaTjiqh8Heg1_5h6o → 4imcQFGwcLOgYedAyPG7i}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ "use strict";exports.id=4886,exports.ids=[4886],exports.modules={44886:(a,b,c)=>{c.d(b,{Ek:()=>f,kL:()=>e,q6:()=>g,qW:()=>d});let d=[{entity_id:"ent_demo_001",entity_type:"person",name:"Alex Chen",aliases:["alex","achen"],scope:"user",created_at:"2026-03-01T10:00:00Z",created_by_agent:"agent-alpha",created_by_receipt:"rcpt_mem_001",forgotten_at:null,merged_into:null,attributes:{role:"lead engineer",team:"platform"},metadata:{}},{entity_id:"ent_demo_002",entity_type:"project",name:"Horizon API",aliases:["horizon","horizon-api"],scope:"team",created_at:"2026-03-01T11:30:00Z",created_by_agent:"agent-alpha",created_by_receipt:"rcpt_mem_002",forgotten_at:null,merged_into:null,attributes:{language:"TypeScript",repo:"nebula-labs/horizon-api"},metadata:{}},{entity_id:"ent_demo_003",entity_type:"tool",name:"PostgreSQL",aliases:["postgres","pg"],scope:"team",created_at:"2026-03-02T09:15:00Z",created_by_agent:"agent-beta",created_by_receipt:"rcpt_mem_003",forgotten_at:null,merged_into:null,attributes:{version:"16.2"},metadata:{}},{entity_id:"ent_demo_004",entity_type:"preference",name:"Code Style",aliases:["coding-style","style-guide"],scope:"user",created_at:"2026-03-02T14:20:00Z",created_by_agent:"agent-alpha",created_by_receipt:"rcpt_mem_004",forgotten_at:null,merged_into:null,attributes:{},metadata:{}},{entity_id:"ent_demo_005",entity_type:"organization",name:"Nebula Labs",aliases:["nebula"],scope:"team",created_at:"2026-03-03T08:00:00Z",created_by_agent:"agent-alpha",created_by_receipt:"rcpt_mem_005",forgotten_at:null,merged_into:null,attributes:{industry:"developer-tools",size:"50-200"},metadata:{}},{entity_id:"ent_demo_006",entity_type:"tool",name:"TypeScript",aliases:["ts"],scope:"user",created_at:"2026-03-03T10:45:00Z",created_by_agent:"agent-gamma",created_by_receipt:"rcpt_mem_006",forgotten_at:null,merged_into:null,attributes:{version:"5.4"},metadata:{}},{entity_id:"ent_demo_007",entity_type:"context",name:"Q1 Sprint",aliases:["q1-sprint","sprint-q1-2026"],scope:"team",created_at:"2026-03-04T09:00:00Z",created_by_agent:"agent-alpha",created_by_receipt:"rcpt_mem_007",forgotten_at:null,merged_into:null,attributes:{quarter:"Q1",year:2026},metadata:{}},{entity_id:"ent_demo_008",entity_type:"person",name:"Sarah Kim",aliases:["sarah","skim"],scope:"team",created_at:"2026-03-05T11:00:00Z",created_by_agent:"agent-beta",created_by_receipt:"rcpt_mem_008",forgotten_at:null,merged_into:null,attributes:{role:"product manager"},metadata:{}},{entity_id:"ent_demo_009",entity_type:"tool",name:"Webpack",aliases:["wp"],scope:"user",created_at:"2026-03-06T15:00:00Z",created_by_agent:"agent-alpha",created_by_receipt:"rcpt_mem_009",forgotten_at:"2026-03-20T16:00:00Z",merged_into:null,attributes:{version:"5.90"},metadata:{}}],e=[{observation_id:"obs_demo_001",entity_id:"ent_demo_001",content:"Alex prefers functional programming patterns over OOP where possible",confidence:"high",source_receipt_id:"rcpt_mem_001",source_agent_id:"agent-alpha",source_context:"code review conversation",observed_at:"2026-03-01T10:05:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["preference","coding"],metadata:{}},{observation_id:"obs_demo_002",entity_id:"ent_demo_001",content:"Alex is the tech lead for the Horizon API project",confidence:"certain",source_receipt_id:"rcpt_mem_001",source_agent_id:"agent-alpha",source_context:"project kickoff",observed_at:"2026-03-01T10:10:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["role","project"],metadata:{}},{observation_id:"obs_demo_003",entity_id:"ent_demo_001",content:"Alex uses Neovim as primary editor with custom LSP configuration",confidence:"high",source_receipt_id:"rcpt_mem_010",source_agent_id:"agent-alpha",source_context:"pair programming session",observed_at:"2026-03-03T14:30:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["tooling"],metadata:{}},{observation_id:"obs_demo_004",entity_id:"ent_demo_001",content:"Alex prefers concise PR descriptions with bullet points",confidence:"medium",source_receipt_id:"rcpt_mem_010",source_agent_id:"agent-gamma",source_context:"PR review",observed_at:"2026-03-05T09:20:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["preference","workflow"],metadata:{}},{observation_id:"obs_demo_005",entity_id:"ent_demo_001",content:"Alex is on PTO March 25-28",confidence:"certain",source_receipt_id:"rcpt_mem_011",source_agent_id:"agent-alpha",source_context:"calendar sync",observed_at:"2026-03-10T08:00:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:"2026-03-25T00:00:00Z",tags:["schedule"],metadata:{}},{observation_id:"obs_demo_006",entity_id:"ent_demo_001",content:"Alex previously used VS Code but switched to Neovim in January 2026",confidence:"medium",source_receipt_id:"rcpt_mem_010",source_agent_id:"agent-alpha",source_context:"conversation",observed_at:"2026-03-03T14:35:00Z",forgotten_at:null,forgotten_by:null,superseded_by:"obs_demo_003",expires_at:null,tags:["tooling"],metadata:{}},{observation_id:"obs_demo_007",entity_id:"ent_demo_001",content:"Alex timezone is Pacific Time (PT)",confidence:"certain",source_receipt_id:"rcpt_mem_001",source_agent_id:"agent-beta",source_context:"team standup",observed_at:"2026-03-02T09:00:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["schedule"],metadata:{}},{observation_id:"obs_demo_008",entity_id:"ent_demo_001",content:"Alex completed the AWS Solutions Architect certification",confidence:"high",source_receipt_id:"rcpt_mem_012",source_agent_id:"agent-alpha",source_context:"slack channel",observed_at:"2026-03-12T16:00:00Z",forgotten_at:"2026-03-18T10:00:00Z",forgotten_by:"agent-alpha",superseded_by:null,expires_at:null,tags:["certification"],metadata:{}},{observation_id:"obs_demo_009",entity_id:"ent_demo_002",content:"Horizon API uses Express.js with a layered architecture pattern",confidence:"certain",source_receipt_id:"rcpt_mem_002",source_agent_id:"agent-alpha",source_context:"architecture doc",observed_at:"2026-03-01T11:35:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["architecture"],metadata:{}},{observation_id:"obs_demo_010",entity_id:"ent_demo_002",content:"Horizon API target launch date is April 15, 2026",confidence:"high",source_receipt_id:"rcpt_mem_002",source_agent_id:"agent-alpha",source_context:"roadmap review",observed_at:"2026-03-01T11:40:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["schedule","milestone"],metadata:{}},{observation_id:"obs_demo_011",entity_id:"ent_demo_002",content:"Horizon API authentication uses JWT with RS256 signing",confidence:"certain",source_receipt_id:"rcpt_mem_010",source_agent_id:"agent-alpha",source_context:"security review",observed_at:"2026-03-04T10:15:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["security","auth"],metadata:{}},{observation_id:"obs_demo_012",entity_id:"ent_demo_002",content:"Rate limiting set to 100 requests per minute per API key",confidence:"high",source_receipt_id:"rcpt_mem_011",source_agent_id:"agent-beta",source_context:"API design meeting",observed_at:"2026-03-07T15:30:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["performance","config"],metadata:{}},{observation_id:"obs_demo_013",entity_id:"ent_demo_002",content:"Horizon API staging environment at staging.horizon.nebula.dev",confidence:"medium",source_receipt_id:"rcpt_mem_011",source_agent_id:"agent-alpha",source_context:"deployment notes",observed_at:"2026-03-08T11:00:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:"2026-03-25T00:00:00Z",tags:["infra","environment"],metadata:{}},{observation_id:"obs_demo_014",entity_id:"ent_demo_003",content:"PostgreSQL primary instance runs on RDS with Multi-AZ deployment",confidence:"certain",source_receipt_id:"rcpt_mem_003",source_agent_id:"agent-beta",source_context:"infra audit",observed_at:"2026-03-02T09:20:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["infra","database"],metadata:{}},{observation_id:"obs_demo_015",entity_id:"ent_demo_003",content:"Connection pool size set to 20 for production workloads",confidence:"high",source_receipt_id:"rcpt_mem_003",source_agent_id:"agent-beta",source_context:"performance tuning",observed_at:"2026-03-02T09:25:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["config","performance"],metadata:{}},{observation_id:"obs_demo_016",entity_id:"ent_demo_003",content:"Daily backups retained for 30 days with point-in-time recovery",confidence:"certain",source_receipt_id:"rcpt_mem_010",source_agent_id:"agent-beta",source_context:"backup policy review",observed_at:"2026-03-06T14:00:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["backup","ops"],metadata:{}},{observation_id:"obs_demo_017",entity_id:"ent_demo_003",content:"Using pgvector extension for embedding similarity search",confidence:"high",source_receipt_id:"rcpt_mem_012",source_agent_id:"agent-alpha",source_context:"feature planning",observed_at:"2026-03-10T11:30:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["extension","ai"],metadata:{}},{observation_id:"obs_demo_018",entity_id:"ent_demo_004",content:"Prefer explicit return types on all exported functions",confidence:"high",source_receipt_id:"rcpt_mem_004",source_agent_id:"agent-alpha",source_context:"style guide discussion",observed_at:"2026-03-02T14:25:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["typescript","style"],metadata:{}},{observation_id:"obs_demo_019",entity_id:"ent_demo_004",content:"Use single quotes for strings, no semicolons (Prettier defaults)",confidence:"certain",source_receipt_id:"rcpt_mem_004",source_agent_id:"agent-alpha",source_context:"eslint config review",observed_at:"2026-03-02T14:30:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["formatting","style"],metadata:{}},{observation_id:"obs_demo_020",entity_id:"ent_demo_004",content:"Prefer named exports over default exports",confidence:"medium",source_receipt_id:"rcpt_mem_010",source_agent_id:"agent-gamma",source_context:"code review feedback",observed_at:"2026-03-05T16:00:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["module","style"],metadata:{}},{observation_id:"obs_demo_021",entity_id:"ent_demo_004",content:"Maximum line length 100 characters",confidence:"high",source_receipt_id:"rcpt_mem_004",source_agent_id:"agent-alpha",source_context:"prettier config",observed_at:"2026-03-02T14:35:00Z",forgotten_at:"2026-03-15T09:00:00Z",forgotten_by:"agent-alpha",superseded_by:null,expires_at:null,tags:["formatting"],metadata:{}},{observation_id:"obs_demo_022",entity_id:"ent_demo_005",content:"Nebula Labs uses a monorepo structure with Turborepo",confidence:"certain",source_receipt_id:"rcpt_mem_005",source_agent_id:"agent-alpha",source_context:"onboarding doc",observed_at:"2026-03-03T08:05:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["tooling","monorepo"],metadata:{}},{observation_id:"obs_demo_023",entity_id:"ent_demo_005",content:"Engineering team follows two-week sprint cycles with Monday standups",confidence:"high",source_receipt_id:"rcpt_mem_005",source_agent_id:"agent-alpha",source_context:"team wiki",observed_at:"2026-03-03T08:10:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["process","agile"],metadata:{}},{observation_id:"obs_demo_024",entity_id:"ent_demo_005",content:"CI/CD pipeline uses GitHub Actions with required status checks",confidence:"certain",source_receipt_id:"rcpt_mem_011",source_agent_id:"agent-beta",source_context:"pipeline review",observed_at:"2026-03-07T10:00:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["ci","devops"],metadata:{}},{observation_id:"obs_demo_025",entity_id:"ent_demo_006",content:"TypeScript strict mode enabled across all packages",confidence:"certain",source_receipt_id:"rcpt_mem_006",source_agent_id:"agent-gamma",source_context:"tsconfig review",observed_at:"2026-03-03T10:50:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["config","typescript"],metadata:{}},{observation_id:"obs_demo_026",entity_id:"ent_demo_006",content:"Using TypeScript project references for incremental builds",confidence:"high",source_receipt_id:"rcpt_mem_006",source_agent_id:"agent-gamma",source_context:"build optimization",observed_at:"2026-03-03T10:55:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["build","performance"],metadata:{}},{observation_id:"obs_demo_027",entity_id:"ent_demo_006",content:"Prefer Zod for runtime validation over io-ts",confidence:"high",source_receipt_id:"rcpt_mem_012",source_agent_id:"agent-alpha",source_context:"library selection",observed_at:"2026-03-09T13:00:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["library","validation"],metadata:{}},{observation_id:"obs_demo_028",entity_id:"ent_demo_007",content:"Sprint goal: ship Horizon API v1 endpoints for external partners",confidence:"certain",source_receipt_id:"rcpt_mem_007",source_agent_id:"agent-alpha",source_context:"sprint planning",observed_at:"2026-03-04T09:05:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["sprint","goal"],metadata:{}},{observation_id:"obs_demo_029",entity_id:"ent_demo_007",content:"Velocity averaged 42 story points per sprint in Q1",confidence:"high",source_receipt_id:"rcpt_mem_011",source_agent_id:"agent-alpha",source_context:"retrospective",observed_at:"2026-03-08T16:00:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["metrics","velocity"],metadata:{}},{observation_id:"obs_demo_030",entity_id:"ent_demo_007",content:"Three critical bugs blocking release identified in sprint review",confidence:"medium",source_receipt_id:"rcpt_mem_012",source_agent_id:"agent-beta",source_context:"sprint review",observed_at:"2026-03-11T14:00:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["bugs","blockers"],metadata:{}},{observation_id:"obs_demo_031",entity_id:"ent_demo_008",content:"Sarah is the product manager for the Horizon API project",confidence:"certain",source_receipt_id:"rcpt_mem_008",source_agent_id:"agent-beta",source_context:"team introduction",observed_at:"2026-03-05T11:05:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["role","project"],metadata:{}},{observation_id:"obs_demo_032",entity_id:"ent_demo_008",content:"Sarah prefers async communication via Slack over meetings",confidence:"medium",source_receipt_id:"rcpt_mem_008",source_agent_id:"agent-beta",source_context:"working preferences",observed_at:"2026-03-05T11:10:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["preference","communication"],metadata:{}},{observation_id:"obs_demo_033",entity_id:"ent_demo_008",content:"Sarah owns the partner onboarding workflow for Horizon API",confidence:"high",source_receipt_id:"rcpt_mem_012",source_agent_id:"agent-alpha",source_context:"responsibility matrix",observed_at:"2026-03-10T10:00:00Z",forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:null,tags:["ownership","workflow"],metadata:{}},{observation_id:"obs_demo_034",entity_id:"ent_demo_009",content:"Webpack used for legacy bundle in the dashboard app",confidence:"medium",source_receipt_id:"rcpt_mem_009",source_agent_id:"agent-alpha",source_context:"build system audit",observed_at:"2026-03-06T15:05:00Z",forgotten_at:"2026-03-20T16:00:00Z",forgotten_by:"agent-alpha",superseded_by:null,expires_at:null,tags:["build","legacy"],metadata:{}},{observation_id:"obs_demo_035",entity_id:"ent_demo_009",content:"Migration from Webpack to Vite planned for Q2 2026",confidence:"high",source_receipt_id:"rcpt_mem_009",source_agent_id:"agent-alpha",source_context:"migration plan",observed_at:"2026-03-06T15:10:00Z",forgotten_at:"2026-03-20T16:00:00Z",forgotten_by:"agent-alpha",superseded_by:null,expires_at:null,tags:["migration","build"],metadata:{}}],f=[{relationship_id:"rel_demo_001",from_entity_id:"ent_demo_001",to_entity_id:"ent_demo_002",relationship_type:"leads",strength:"certain",source_receipt_id:"rcpt_mem_001",created_at:"2026-03-01T10:15:00Z",forgotten_at:null,metadata:{}},{relationship_id:"rel_demo_002",from_entity_id:"ent_demo_002",to_entity_id:"ent_demo_003",relationship_type:"uses",strength:"certain",source_receipt_id:"rcpt_mem_003",created_at:"2026-03-02T09:30:00Z",forgotten_at:null,metadata:{}},{relationship_id:"rel_demo_003",from_entity_id:"ent_demo_001",to_entity_id:"ent_demo_005",relationship_type:"works_at",strength:"certain",source_receipt_id:"rcpt_mem_005",created_at:"2026-03-03T08:15:00Z",forgotten_at:null,metadata:{}},{relationship_id:"rel_demo_004",from_entity_id:"ent_demo_002",to_entity_id:"ent_demo_005",relationship_type:"owned_by",strength:"certain",source_receipt_id:"rcpt_mem_005",created_at:"2026-03-03T08:20:00Z",forgotten_at:null,metadata:{}},{relationship_id:"rel_demo_005",from_entity_id:"ent_demo_002",to_entity_id:"ent_demo_006",relationship_type:"built_with",strength:"high",source_receipt_id:"rcpt_mem_006",created_at:"2026-03-03T11:00:00Z",forgotten_at:null,metadata:{}},{relationship_id:"rel_demo_006",from_entity_id:"ent_demo_008",to_entity_id:"ent_demo_002",relationship_type:"manages",strength:"high",source_receipt_id:"rcpt_mem_008",created_at:"2026-03-05T11:15:00Z",forgotten_at:null,metadata:{}},{relationship_id:"rel_demo_007",from_entity_id:"ent_demo_007",to_entity_id:"ent_demo_002",relationship_type:"targets",strength:"high",source_receipt_id:"rcpt_mem_007",created_at:"2026-03-04T09:10:00Z",forgotten_at:null,metadata:{}},{relationship_id:"rel_demo_008",from_entity_id:"ent_demo_008",to_entity_id:"ent_demo_005",relationship_type:"works_at",strength:"certain",source_receipt_id:"rcpt_mem_008",created_at:"2026-03-05T11:20:00Z",forgotten_at:null,metadata:{}}],g=[{receipt_id:"rcpt_mem_001",parent_receipt_id:null,chain_id:"chain_mem_01",receipt_type:"memory",agent_id:"agent-alpha",org_id:"demo-org",action:"memory.observe",input_hash:"sha256:mem001a1b2c3d4e5f",output_hash:"sha256:mem001f6e5d4c3b2a",output_summary:"Created entity Alex Chen and recorded initial observations",model:null,tokens_in:null,tokens_out:null,cost_usd:null,latency_ms:12,tool_calls:null,timestamp:"2026-03-01T10:00:00Z",completed_at:"2026-03-01T10:00:01Z",status:"completed",error:null,environment:"production",tags:["memory","observe"],constraints:null,constraint_result:null,signature:"ed25519:demo_signature",verify_url:"local://verify/rcpt_mem_001",callback_verified:null,confidence:null,metadata:{memory_operation:"observe",entity_id:"ent_demo_001",scope:"user"}},{receipt_id:"rcpt_mem_002",parent_receipt_id:null,chain_id:"chain_mem_01",receipt_type:"memory",agent_id:"agent-alpha",org_id:"demo-org",action:"memory.observe",input_hash:"sha256:mem002a1b2c3d4e5f",output_hash:"sha256:mem002f6e5d4c3b2a",output_summary:"Created entity Horizon API with architecture observations",model:null,tokens_in:null,tokens_out:null,cost_usd:null,latency_ms:8,tool_calls:null,timestamp:"2026-03-01T11:30:00Z",completed_at:"2026-03-01T11:30:01Z",status:"completed",error:null,environment:"production",tags:["memory","observe"],constraints:null,constraint_result:null,signature:"ed25519:demo_signature",verify_url:"local://verify/rcpt_mem_002",callback_verified:null,confidence:null,metadata:{memory_operation:"observe",entity_id:"ent_demo_002",scope:"team"}},{receipt_id:"rcpt_mem_003",parent_receipt_id:null,chain_id:"chain_mem_02",receipt_type:"memory",agent_id:"agent-beta",org_id:"demo-org",action:"memory.observe",input_hash:"sha256:mem003a1b2c3d4e5f",output_hash:"sha256:mem003f6e5d4c3b2a",output_summary:"Created entity PostgreSQL with infrastructure details",model:null,tokens_in:null,tokens_out:null,cost_usd:null,latency_ms:10,tool_calls:null,timestamp:"2026-03-02T09:15:00Z",completed_at:"2026-03-02T09:15:01Z",status:"completed",error:null,environment:"production",tags:["memory","observe"],constraints:null,constraint_result:null,signature:"ed25519:demo_signature",verify_url:"local://verify/rcpt_mem_003",callback_verified:null,confidence:null,metadata:{memory_operation:"observe",entity_id:"ent_demo_003",scope:"team"}},{receipt_id:"rcpt_mem_004",parent_receipt_id:null,chain_id:"chain_mem_02",receipt_type:"memory",agent_id:"agent-alpha",org_id:"demo-org",action:"memory.observe",input_hash:"sha256:mem004a1b2c3d4e5f",output_hash:"sha256:mem004f6e5d4c3b2a",output_summary:"Recorded code style preferences",model:null,tokens_in:null,tokens_out:null,cost_usd:null,latency_ms:6,tool_calls:null,timestamp:"2026-03-02T14:20:00Z",completed_at:"2026-03-02T14:20:01Z",status:"completed",error:null,environment:"production",tags:["memory","observe"],constraints:null,constraint_result:null,signature:"ed25519:demo_signature",verify_url:"local://verify/rcpt_mem_004",callback_verified:null,confidence:null,metadata:{memory_operation:"observe",entity_id:"ent_demo_004",scope:"user"}},{receipt_id:"rcpt_mem_005",parent_receipt_id:null,chain_id:"chain_mem_03",receipt_type:"memory",agent_id:"agent-alpha",org_id:"demo-org",action:"memory.observe",input_hash:"sha256:mem005a1b2c3d4e5f",output_hash:"sha256:mem005f6e5d4c3b2a",output_summary:"Created entity Nebula Labs with org details",model:null,tokens_in:null,tokens_out:null,cost_usd:null,latency_ms:9,tool_calls:null,timestamp:"2026-03-03T08:00:00Z",completed_at:"2026-03-03T08:00:01Z",status:"completed",error:null,environment:"production",tags:["memory","observe"],constraints:null,constraint_result:null,signature:"ed25519:demo_signature",verify_url:"local://verify/rcpt_mem_005",callback_verified:null,confidence:null,metadata:{memory_operation:"observe",entity_id:"ent_demo_005",scope:"team"}},{receipt_id:"rcpt_mem_006",parent_receipt_id:null,chain_id:"chain_mem_03",receipt_type:"memory",agent_id:"agent-gamma",org_id:"demo-org",action:"memory.observe",input_hash:"sha256:mem006a1b2c3d4e5f",output_hash:"sha256:mem006f6e5d4c3b2a",output_summary:"Recorded TypeScript configuration observations",model:null,tokens_in:null,tokens_out:null,cost_usd:null,latency_ms:7,tool_calls:null,timestamp:"2026-03-03T10:45:00Z",completed_at:"2026-03-03T10:45:01Z",status:"completed",error:null,environment:"production",tags:["memory","observe"],constraints:null,constraint_result:null,signature:"ed25519:demo_signature",verify_url:"local://verify/rcpt_mem_006",callback_verified:null,confidence:null,metadata:{memory_operation:"observe",entity_id:"ent_demo_006",scope:"user"}},{receipt_id:"rcpt_mem_007",parent_receipt_id:null,chain_id:"chain_mem_04",receipt_type:"memory",agent_id:"agent-alpha",org_id:"demo-org",action:"memory.observe",input_hash:"sha256:mem007a1b2c3d4e5f",output_hash:"sha256:mem007f6e5d4c3b2a",output_summary:"Created Q1 Sprint context entity",model:null,tokens_in:null,tokens_out:null,cost_usd:null,latency_ms:5,tool_calls:null,timestamp:"2026-03-04T09:00:00Z",completed_at:"2026-03-04T09:00:01Z",status:"completed",error:null,environment:"production",tags:["memory","observe"],constraints:null,constraint_result:null,signature:"ed25519:demo_signature",verify_url:"local://verify/rcpt_mem_007",callback_verified:null,confidence:null,metadata:{memory_operation:"observe",entity_id:"ent_demo_007",scope:"team"}},{receipt_id:"rcpt_mem_008",parent_receipt_id:null,chain_id:"chain_mem_04",receipt_type:"memory",agent_id:"agent-beta",org_id:"demo-org",action:"memory.observe",input_hash:"sha256:mem008a1b2c3d4e5f",output_hash:"sha256:mem008f6e5d4c3b2a",output_summary:"Created entity Sarah Kim with role info",model:null,tokens_in:null,tokens_out:null,cost_usd:null,latency_ms:8,tool_calls:null,timestamp:"2026-03-05T11:00:00Z",completed_at:"2026-03-05T11:00:01Z",status:"completed",error:null,environment:"production",tags:["memory","observe"],constraints:null,constraint_result:null,signature:"ed25519:demo_signature",verify_url:"local://verify/rcpt_mem_008",callback_verified:null,confidence:null,metadata:{memory_operation:"observe",entity_id:"ent_demo_008",scope:"team"}},{receipt_id:"rcpt_mem_009",parent_receipt_id:null,chain_id:"chain_mem_05",receipt_type:"memory",agent_id:"agent-alpha",org_id:"demo-org",action:"memory.observe",input_hash:"sha256:mem009a1b2c3d4e5f",output_hash:"sha256:mem009f6e5d4c3b2a",output_summary:"Created entity Webpack (later forgotten)",model:null,tokens_in:null,tokens_out:null,cost_usd:null,latency_ms:7,tool_calls:null,timestamp:"2026-03-06T15:00:00Z",completed_at:"2026-03-06T15:00:01Z",status:"completed",error:null,environment:"production",tags:["memory","observe"],constraints:null,constraint_result:null,signature:"ed25519:demo_signature",verify_url:"local://verify/rcpt_mem_009",callback_verified:null,confidence:null,metadata:{memory_operation:"observe",entity_id:"ent_demo_009",scope:"user"}},{receipt_id:"rcpt_mem_010",parent_receipt_id:null,chain_id:"chain_mem_05",receipt_type:"memory",agent_id:"agent-alpha",org_id:"demo-org",action:"memory.recall",input_hash:"sha256:mem010a1b2c3d4e5f",output_hash:"sha256:mem010f6e5d4c3b2a",output_summary:"Recalled observations about Alex Chen and project context",model:null,tokens_in:null,tokens_out:null,cost_usd:null,latency_ms:3,tool_calls:null,timestamp:"2026-03-07T09:00:00Z",completed_at:"2026-03-07T09:00:01Z",status:"completed",error:null,environment:"production",tags:["memory","recall"],constraints:null,constraint_result:null,signature:"ed25519:demo_signature",verify_url:"local://verify/rcpt_mem_010",callback_verified:null,confidence:null,metadata:{memory_operation:"recall",query:"Alex Chen project",results_count:5,scope:"user"}},{receipt_id:"rcpt_mem_011",parent_receipt_id:null,chain_id:"chain_mem_06",receipt_type:"memory",agent_id:"agent-beta",org_id:"demo-org",action:"memory.recall",input_hash:"sha256:mem011a1b2c3d4e5f",output_hash:"sha256:mem011f6e5d4c3b2a",output_summary:"Recalled infrastructure and deployment observations",model:null,tokens_in:null,tokens_out:null,cost_usd:null,latency_ms:4,tool_calls:null,timestamp:"2026-03-08T14:00:00Z",completed_at:"2026-03-08T14:00:01Z",status:"completed",error:null,environment:"production",tags:["memory","recall"],constraints:null,constraint_result:null,signature:"ed25519:demo_signature",verify_url:"local://verify/rcpt_mem_011",callback_verified:null,confidence:null,metadata:{memory_operation:"recall",query:"infrastructure PostgreSQL",results_count:3,scope:"team"}},{receipt_id:"rcpt_mem_012",parent_receipt_id:null,chain_id:"chain_mem_06",receipt_type:"memory",agent_id:"agent-alpha",org_id:"demo-org",action:"memory.context",input_hash:"sha256:mem012a1b2c3d4e5f",output_hash:"sha256:mem012f6e5d4c3b2a",output_summary:"Generated full memory context for agent session",model:null,tokens_in:null,tokens_out:null,cost_usd:null,latency_ms:15,tool_calls:null,timestamp:"2026-03-10T08:00:00Z",completed_at:"2026-03-10T08:00:01Z",status:"completed",error:null,environment:"production",tags:["memory","context"],constraints:null,constraint_result:null,signature:"ed25519:demo_signature",verify_url:"local://verify/rcpt_mem_012",callback_verified:null,confidence:null,metadata:{memory_operation:"context",entities_returned:8,observations_returned:28,scope:"team"}},{receipt_id:"rcpt_mem_013",parent_receipt_id:null,chain_id:"chain_mem_07",receipt_type:"memory",agent_id:"agent-alpha",org_id:"demo-org",action:"memory.forget",input_hash:"sha256:mem013a1b2c3d4e5f",output_hash:"sha256:mem013f6e5d4c3b2a",output_summary:"Forgot observation about max line length (style preference changed)",model:null,tokens_in:null,tokens_out:null,cost_usd:null,latency_ms:4,tool_calls:null,timestamp:"2026-03-15T09:00:00Z",completed_at:"2026-03-15T09:00:01Z",status:"completed",error:null,environment:"production",tags:["memory","forget"],constraints:null,constraint_result:null,signature:"ed25519:demo_signature",verify_url:"local://verify/rcpt_mem_013",callback_verified:null,confidence:null,metadata:{memory_operation:"forget",observation_id:"obs_demo_021",entity_id:"ent_demo_004",scope:"user"}},{receipt_id:"rcpt_mem_014",parent_receipt_id:null,chain_id:"chain_mem_07",receipt_type:"memory",agent_id:"agent-alpha",org_id:"demo-org",action:"memory.forget",input_hash:"sha256:mem014a1b2c3d4e5f",output_hash:"sha256:mem014f6e5d4c3b2a",output_summary:"Forgot Webpack entity and its observations (migrated to Vite)",model:null,tokens_in:null,tokens_out:null,cost_usd:null,latency_ms:6,tool_calls:null,timestamp:"2026-03-20T16:00:00Z",completed_at:"2026-03-20T16:00:01Z",status:"completed",error:null,environment:"production",tags:["memory","forget"],constraints:null,constraint_result:null,signature:"ed25519:demo_signature",verify_url:"local://verify/rcpt_mem_014",callback_verified:null,confidence:null,metadata:{memory_operation:"forget_entity",entity_id:"ent_demo_009",scope:"user"}},{receipt_id:"rcpt_mem_015",parent_receipt_id:null,chain_id:"chain_mem_08",receipt_type:"memory",agent_id:"agent-gamma",org_id:"demo-org",action:"memory.recall",input_hash:"sha256:mem015a1b2c3d4e5f",output_hash:"sha256:mem015f6e5d4c3b2a",output_summary:"Recalled TypeScript configuration and style preferences",model:null,tokens_in:null,tokens_out:null,cost_usd:null,latency_ms:2,tool_calls:null,timestamp:"2026-03-22T10:30:00Z",completed_at:"2026-03-22T10:30:01Z",status:"completed",error:null,environment:"production",tags:["memory","recall"],constraints:null,constraint_result:null,signature:"ed25519:demo_signature",verify_url:"local://verify/rcpt_mem_015",callback_verified:null,confidence:null,metadata:{memory_operation:"recall",query:"TypeScript style",results_count:6,scope:"user"}}]}};
@@ -1,4 +1,4 @@
1
- "use strict";exports.id=6803,exports.ids=[6803],exports.modules={6170:(a,b,c)=>{c.d(b,{TZ:()=>j,W_:()=>g,XF:()=>i,o3:()=>h,sP:()=>k});var d=c(23993),e=c(38884);function f(a){let b=Object.keys(a).sort();return JSON.stringify(a,b)}function g(a){return{receipt_id:a.receipt_id,chain_id:a.chain_id,receipt_type:a.receipt_type,agent_id:a.agent_id,org_id:a.org_id,action:a.action,input_hash:a.input_hash,output_hash:a.output_hash,status:a.status,timestamp:a.timestamp,completed_at:a.completed_at,environment:a.environment}}function h(a,b){var c;let e=f(a),g=new TextEncoder().encode(e),h=d.jn.hexToBytes(b),i=(0,d._S)(g,h);return`ed25519:${c=i,Buffer.from(c).toString("base64")}`}function i(a,b,c){try{var e;if(!b.startsWith("ed25519:"))return!1;let g=f(a),h=new TextEncoder().encode(g),i=(e=b.slice(8),new Uint8Array(Buffer.from(e,"base64"))),j=d.jn.hexToBytes(c);return(0,d.MX)(i,h,j)}catch{return!1}}function j(){let a=d.Wp.randomPrivateKey(),b=(0,d.lG)(a);return{privateKey:d.jn.bytesToHex(a),publicKey:d.jn.bytesToHex(b)}}function k(a){let b=d.jn.hexToBytes(a),c=(0,d.lG)(b);return d.jn.bytesToHex(c)}d.jn.sha512Sync=(...a)=>(0,e.Zf)(d.jn.concatBytes(...a))},96803:(a,b,c)=>{c.d(b,{mf:()=>D,t5:()=>B,wT:()=>M,ny:()=>F,x:()=>L,Ap:()=>A,formatInvoiceCSV:()=>O,formatInvoiceHTML:()=>R,formatInvoiceJSON:()=>N,formatInvoiceMarkdown:()=>Q,generateInvoice:()=>K});var d=c(79748),e=c(33873),f=c(31940),g=c(55511),h=c(6170),i=c(21820),j=c(18103),k=c(68798),l=k.k5(["pending","completed","failed","timeout"]),m=k.k5(["action","verification","judgment","arbitration","memory"]),n=k.k5(["development","production","staging","test"]),o=k.k5(["UNAUTHORIZED","KEY_REVOKED","FORBIDDEN","RECEIPT_NOT_FOUND","CHAIN_NOT_FOUND","AGENT_NOT_FOUND","RECEIPT_NOT_PENDING","RECEIPT_IMMUTABLE","RATE_LIMIT_EXCEEDED","VALIDATION_ERROR","INTERNAL_ERROR"]);k.Ik({receipt_id:k.Yj(),chain_id:k.Yj(),receipt_type:m,agent_id:k.Yj(),org_id:k.Yj(),action:k.Yj(),input_hash:k.Yj(),output_hash:k.Yj().nullable(),status:l,timestamp:k.Yj().datetime(),completed_at:k.Yj().datetime().nullable(),environment:n});var p=k.Ik({receipt_id:k.Yj(),parent_receipt_id:k.Yj().nullable(),chain_id:k.Yj(),receipt_type:m,agent_id:k.Yj(),org_id:k.Yj(),action:k.Yj(),input_hash:k.Yj(),output_hash:k.Yj().nullable(),output_summary:k.Yj().nullable(),model:k.Yj().nullable(),tokens_in:k.ai().int().nonnegative().nullable(),tokens_out:k.ai().int().nonnegative().nullable(),cost_usd:k.ai().nonnegative().nullable(),latency_ms:k.ai().int().nonnegative().nullable(),tool_calls:k.YO(k.Yj()).nullable(),timestamp:k.Yj().datetime(),completed_at:k.Yj().datetime().nullable(),status:l,error:k.g1(k.L5()).nullable(),environment:n,tags:k.YO(k.Yj()).nullable(),constraints:k.g1(k.L5()).nullable(),constraint_result:k.g1(k.L5()).nullable(),signature:k.Yj(),verify_url:k.Yj().url(),callback_verified:k.zM().nullable(),confidence:k.ai().min(0).max(1).nullable(),metadata:k.g1(k.L5())}),q=k.Ik({type:k.Yj().min(1),value:k.L5(),message:k.Yj().optional()}),r=k.Ik({type:k.Yj(),passed:k.zM(),expected:k.L5(),actual:k.L5(),message:k.Yj().optional()});k.Ik({passed:k.zM(),results:k.YO(r),evaluated_at:k.Yj().datetime()}),k.YO(q);var s=k.Ik({name:k.Yj().min(1),description:k.Yj().min(1),weight:k.ai().min(0).max(1),passing_threshold:k.ai().min(0).max(1).optional(),examples:k.Ik({good:k.YO(k.Yj()).optional(),bad:k.YO(k.Yj()).optional()}).optional()});k.Ik({version:k.Yj().default("1.0"),criteria:k.YO(s).min(1),passing_threshold:k.ai().min(0).max(1).default(.7),require_all:k.zM().default(!1)});var t=k.Ik({criterion:k.Yj(),score:k.ai().min(0).max(1),passed:k.zM(),reasoning:k.Yj()});k.Ik({verdict:k.k5(["pass","fail","partial"]),score:k.ai().min(0).max(1),criteria_results:k.YO(t),overall_reasoning:k.Yj(),rubric_version:k.Yj()}),k.Ik({agent_id:k.Yj().min(1),action:k.Yj().min(1),input_hash:k.Yj().min(1),receipt_type:m.default("action"),status:l.default("pending"),environment:n.default("production"),parent_receipt_id:k.Yj().nullable().optional(),output_hash:k.Yj().nullable().optional(),output_summary:k.Yj().nullable().optional(),model:k.Yj().nullable().optional(),tokens_in:k.ai().int().nonnegative().nullable().optional(),tokens_out:k.ai().int().nonnegative().nullable().optional(),cost_usd:k.ai().nonnegative().nullable().optional(),latency_ms:k.ai().int().nonnegative().nullable().optional(),tool_calls:k.YO(k.Yj()).nullable().optional(),tags:k.YO(k.Yj()).nullable().optional(),confidence:k.ai().min(0).max(1).nullable().optional(),callback_verified:k.zM().nullable().optional(),metadata:k.g1(k.L5()).optional()}),k.Ik({status:k.k5(["completed","failed","timeout"]),output_hash:k.Yj().nullable().optional(),output_summary:k.Yj().nullable().optional(),model:k.Yj().nullable().optional(),tokens_in:k.ai().int().nonnegative().nullable().optional(),tokens_out:k.ai().int().nonnegative().nullable().optional(),cost_usd:k.ai().nonnegative().nullable().optional(),latency_ms:k.ai().int().nonnegative().nullable().optional(),tool_calls:k.YO(k.Yj()).nullable().optional(),confidence:k.ai().min(0).max(1).nullable().optional(),callback_verified:k.zM().nullable().optional(),error:k.g1(k.L5()).nullable().optional()}),k.Ik({verified:k.zM(),receipt:k.Ik({receipt_id:k.Yj(),chain_id:k.Yj(),receipt_type:m,agent_id:k.Yj(),action:k.Yj(),status:l,input_hash:k.Yj(),output_hash:k.Yj().nullable(),signature:k.Yj(),timestamp:k.Yj().datetime(),completed_at:k.Yj().datetime().nullable(),environment:n,latency_ms:k.ai().int().nonnegative().nullable()}),signature_valid:k.zM(),chain_length:k.ai().int().nonnegative(),public_key_url:k.Yj().url()}),k.Ik({page:k.au.number().int().positive().default(1),limit:k.au.number().int().positive().max(100).default(50),agent_id:k.Yj().optional(),action:k.Yj().optional(),status:l.optional(),environment:n.optional(),receipt_type:m.optional(),chain_id:k.Yj().optional(),tag:k.Yj().optional(),from:k.Yj().datetime().optional(),to:k.Yj().datetime().optional(),sort:k.Yj().regex(/^(created_at|completed_at|latency_ms|cost_usd):(asc|desc)$/).default("created_at:desc")}),k.Ik({page:k.ai().int().positive(),limit:k.ai().int().positive(),total:k.ai().int().nonnegative(),total_pages:k.ai().int().nonnegative(),has_next:k.zM(),has_prev:k.zM()}),k.Ik({error:k.Ik({code:o,message:k.Yj(),status:k.ai().int()})});var u=k.k5(["person","project","organization","preference","fact","context","tool","custom"]),v=k.k5(["observe","create","merge","forget","forget_entity","recall","update"]),w=k.k5(["agent","user","team","global"]),x=k.k5(["certain","high","medium","low","deprecated"]);k.Ik({observation_id:k.Yj(),entity_id:k.Yj(),content:k.Yj(),confidence:x.default("medium"),source_receipt_id:k.Yj(),source_agent_id:k.Yj(),source_context:k.Yj().nullable(),observed_at:k.Yj().datetime(),forgotten_at:k.Yj().datetime().nullable(),forgotten_by:k.Yj().nullable(),superseded_by:k.Yj().nullable(),tags:k.YO(k.Yj()).default([]),metadata:k.g1(k.L5()).default({})}),k.Ik({relationship_id:k.Yj(),from_entity_id:k.Yj(),to_entity_id:k.Yj(),relationship_type:k.Yj(),strength:x.default("medium"),source_receipt_id:k.Yj(),created_at:k.Yj().datetime(),forgotten_at:k.Yj().datetime().nullable(),metadata:k.g1(k.L5()).default({})}),k.Ik({entity_id:k.Yj(),entity_type:u,name:k.Yj(),aliases:k.YO(k.Yj()).default([]),scope:w.default("agent"),created_at:k.Yj().datetime(),created_by_agent:k.Yj(),created_by_receipt:k.Yj(),forgotten_at:k.Yj().datetime().nullable(),merged_into:k.Yj().nullable(),attributes:k.g1(k.L5()).default({}),metadata:k.g1(k.L5()).default({})}),k.Ik({memory_operation:v,entity_id:k.Yj().nullable(),observation_id:k.Yj().nullable(),relationship_id:k.Yj().nullable(),scope:w,query:k.Yj().nullable(),results_count:k.ai().int().nullable(),confidence:x.nullable()}),k.Ik({query:k.Yj().optional(),entity_type:u.optional(),entity_id:k.Yj().optional(),scope:w.optional(),agent_id:k.Yj().optional(),confidence_min:x.optional(),include_forgotten:k.zM().default(!1),tags:k.YO(k.Yj()).optional(),limit:k.ai().int().min(1).max(100).default(20),page:k.ai().int().min(1).default(1)});var y=(a=>"undefined"!=typeof require?require:"undefined"!=typeof Proxy?new Proxy(a,{get:(a,b)=>("undefined"!=typeof require?require:a)[b]}):a)(function(a){if("undefined"!=typeof require)return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')}),z=new Set(["timestamp","completed_at","cost_usd","latency_ms","tokens_in","tokens_out","confidence"]),A=class{constructor(a){this.dataDir=a,this.dbPath=(0,e.join)(a,"receipts.db"),this.receiptsDir=(0,e.join)(a,"receipts")}async init(){await (0,d.mkdir)(this.dataDir,{recursive:!0}),this.db=new f(this.dbPath),this.db.pragma("journal_mode = WAL"),this.db.pragma("foreign_keys = ON"),this.db.exec(`
1
+ "use strict";exports.id=6803,exports.ids=[6803],exports.modules={6170:(a,b,c)=>{c.d(b,{TZ:()=>j,W_:()=>g,XF:()=>i,o3:()=>h,sP:()=>k});var d=c(23993),e=c(38884);function f(a){let b=Object.keys(a).sort();return JSON.stringify(a,b)}function g(a){return{receipt_id:a.receipt_id,chain_id:a.chain_id,receipt_type:a.receipt_type,agent_id:a.agent_id,org_id:a.org_id,action:a.action,input_hash:a.input_hash,output_hash:a.output_hash,status:a.status,timestamp:a.timestamp,completed_at:a.completed_at,environment:a.environment}}function h(a,b){var c;let e=f(a),g=new TextEncoder().encode(e),h=d.jn.hexToBytes(b),i=(0,d._S)(g,h);return`ed25519:${c=i,Buffer.from(c).toString("base64")}`}function i(a,b,c){try{var e;if(!b.startsWith("ed25519:"))return!1;let g=f(a),h=new TextEncoder().encode(g),i=(e=b.slice(8),new Uint8Array(Buffer.from(e,"base64"))),j=d.jn.hexToBytes(c);return(0,d.MX)(i,h,j)}catch{return!1}}function j(){let a=d.Wp.randomPrivateKey(),b=(0,d.lG)(a);return{privateKey:d.jn.bytesToHex(a),publicKey:d.jn.bytesToHex(b)}}function k(a){let b=d.jn.hexToBytes(a),c=(0,d.lG)(b);return d.jn.bytesToHex(c)}d.jn.sha512Sync=(...a)=>(0,e.Zf)(d.jn.concatBytes(...a))},96803:(a,b,c)=>{c.d(b,{mf:()=>D,t5:()=>B,wT:()=>M,ny:()=>F,x:()=>L,Ap:()=>A,formatInvoiceCSV:()=>O,formatInvoiceHTML:()=>R,formatInvoiceJSON:()=>N,formatInvoiceMarkdown:()=>Q,generateInvoice:()=>K});var d=c(79748),e=c(33873),f=c(31940),g=c(55511),h=c(6170),i=c(21820),j=c(18103),k=c(68798),l=k.k5(["pending","completed","failed","timeout"]),m=k.k5(["action","verification","judgment","arbitration","memory"]),n=k.k5(["development","production","staging","test"]),o=k.k5(["UNAUTHORIZED","KEY_REVOKED","FORBIDDEN","RECEIPT_NOT_FOUND","CHAIN_NOT_FOUND","AGENT_NOT_FOUND","RECEIPT_NOT_PENDING","RECEIPT_IMMUTABLE","RATE_LIMIT_EXCEEDED","VALIDATION_ERROR","INTERNAL_ERROR"]);k.Ik({receipt_id:k.Yj(),chain_id:k.Yj(),receipt_type:m,agent_id:k.Yj(),org_id:k.Yj(),action:k.Yj(),input_hash:k.Yj(),output_hash:k.Yj().nullable(),status:l,timestamp:k.Yj().datetime(),completed_at:k.Yj().datetime().nullable(),environment:n});var p=k.Ik({receipt_id:k.Yj(),parent_receipt_id:k.Yj().nullable(),chain_id:k.Yj(),receipt_type:m,agent_id:k.Yj(),org_id:k.Yj(),action:k.Yj(),input_hash:k.Yj(),output_hash:k.Yj().nullable(),output_summary:k.Yj().nullable(),model:k.Yj().nullable(),tokens_in:k.ai().int().nonnegative().nullable(),tokens_out:k.ai().int().nonnegative().nullable(),cost_usd:k.ai().nonnegative().nullable(),latency_ms:k.ai().int().nonnegative().nullable(),tool_calls:k.YO(k.Yj()).nullable(),timestamp:k.Yj().datetime(),completed_at:k.Yj().datetime().nullable(),status:l,error:k.g1(k.L5()).nullable(),environment:n,tags:k.YO(k.Yj()).nullable(),constraints:k.g1(k.L5()).nullable(),constraint_result:k.g1(k.L5()).nullable(),signature:k.Yj(),verify_url:k.Yj().url(),callback_verified:k.zM().nullable(),confidence:k.ai().min(0).max(1).nullable(),metadata:k.g1(k.L5())}),q=k.Ik({type:k.Yj().min(1),value:k.L5(),message:k.Yj().optional()}),r=k.Ik({type:k.Yj(),passed:k.zM(),expected:k.L5(),actual:k.L5(),message:k.Yj().optional()});k.Ik({passed:k.zM(),results:k.YO(r),evaluated_at:k.Yj().datetime()}),k.YO(q);var s=k.Ik({name:k.Yj().min(1),description:k.Yj().min(1),weight:k.ai().min(0).max(1),passing_threshold:k.ai().min(0).max(1).optional(),examples:k.Ik({good:k.YO(k.Yj()).optional(),bad:k.YO(k.Yj()).optional()}).optional()});k.Ik({version:k.Yj().default("1.0"),criteria:k.YO(s).min(1),passing_threshold:k.ai().min(0).max(1).default(.7),require_all:k.zM().default(!1)});var t=k.Ik({criterion:k.Yj(),score:k.ai().min(0).max(1),passed:k.zM(),reasoning:k.Yj()});k.Ik({verdict:k.k5(["pass","fail","partial"]),score:k.ai().min(0).max(1),criteria_results:k.YO(t),overall_reasoning:k.Yj(),rubric_version:k.Yj()}),k.Ik({agent_id:k.Yj().min(1),action:k.Yj().min(1),input_hash:k.Yj().min(1),receipt_type:m.default("action"),status:l.default("pending"),environment:n.default("production"),parent_receipt_id:k.Yj().nullable().optional(),output_hash:k.Yj().nullable().optional(),output_summary:k.Yj().nullable().optional(),model:k.Yj().nullable().optional(),tokens_in:k.ai().int().nonnegative().nullable().optional(),tokens_out:k.ai().int().nonnegative().nullable().optional(),cost_usd:k.ai().nonnegative().nullable().optional(),latency_ms:k.ai().int().nonnegative().nullable().optional(),tool_calls:k.YO(k.Yj()).nullable().optional(),tags:k.YO(k.Yj()).nullable().optional(),confidence:k.ai().min(0).max(1).nullable().optional(),callback_verified:k.zM().nullable().optional(),metadata:k.g1(k.L5()).optional()}),k.Ik({status:k.k5(["completed","failed","timeout"]),output_hash:k.Yj().nullable().optional(),output_summary:k.Yj().nullable().optional(),model:k.Yj().nullable().optional(),tokens_in:k.ai().int().nonnegative().nullable().optional(),tokens_out:k.ai().int().nonnegative().nullable().optional(),cost_usd:k.ai().nonnegative().nullable().optional(),latency_ms:k.ai().int().nonnegative().nullable().optional(),tool_calls:k.YO(k.Yj()).nullable().optional(),confidence:k.ai().min(0).max(1).nullable().optional(),callback_verified:k.zM().nullable().optional(),error:k.g1(k.L5()).nullable().optional()}),k.Ik({verified:k.zM(),receipt:k.Ik({receipt_id:k.Yj(),chain_id:k.Yj(),receipt_type:m,agent_id:k.Yj(),action:k.Yj(),status:l,input_hash:k.Yj(),output_hash:k.Yj().nullable(),signature:k.Yj(),timestamp:k.Yj().datetime(),completed_at:k.Yj().datetime().nullable(),environment:n,latency_ms:k.ai().int().nonnegative().nullable()}),signature_valid:k.zM(),chain_length:k.ai().int().nonnegative(),public_key_url:k.Yj().url()}),k.Ik({page:k.au.number().int().positive().default(1),limit:k.au.number().int().positive().max(100).default(50),agent_id:k.Yj().optional(),action:k.Yj().optional(),status:l.optional(),environment:n.optional(),receipt_type:m.optional(),chain_id:k.Yj().optional(),tag:k.Yj().optional(),from:k.Yj().datetime().optional(),to:k.Yj().datetime().optional(),sort:k.Yj().regex(/^(created_at|completed_at|latency_ms|cost_usd):(asc|desc)$/).default("created_at:desc")}),k.Ik({page:k.ai().int().positive(),limit:k.ai().int().positive(),total:k.ai().int().nonnegative(),total_pages:k.ai().int().nonnegative(),has_next:k.zM(),has_prev:k.zM()}),k.Ik({error:k.Ik({code:o,message:k.Yj(),status:k.ai().int()})});var u=k.k5(["person","project","organization","preference","fact","context","tool","custom"]),v=k.k5(["observe","create","merge","forget","forget_entity","recall","update"]),w=k.k5(["agent","user","team","global"]),x=k.k5(["certain","high","medium","low","deprecated"]);k.Ik({observation_id:k.Yj(),entity_id:k.Yj(),content:k.Yj(),confidence:x.default("medium"),source_receipt_id:k.Yj(),source_agent_id:k.Yj(),source_context:k.Yj().nullable(),observed_at:k.Yj().datetime(),forgotten_at:k.Yj().datetime().nullable(),forgotten_by:k.Yj().nullable(),superseded_by:k.Yj().nullable(),expires_at:k.Yj().datetime().nullable().default(null),tags:k.YO(k.Yj()).default([]),metadata:k.g1(k.L5()).default({})}),k.Ik({relationship_id:k.Yj(),from_entity_id:k.Yj(),to_entity_id:k.Yj(),relationship_type:k.Yj(),strength:x.default("medium"),source_receipt_id:k.Yj(),created_at:k.Yj().datetime(),forgotten_at:k.Yj().datetime().nullable(),metadata:k.g1(k.L5()).default({})}),k.Ik({entity_id:k.Yj(),entity_type:u,name:k.Yj(),aliases:k.YO(k.Yj()).default([]),scope:w.default("agent"),created_at:k.Yj().datetime(),created_by_agent:k.Yj(),created_by_receipt:k.Yj(),forgotten_at:k.Yj().datetime().nullable(),merged_into:k.Yj().nullable(),attributes:k.g1(k.L5()).default({}),metadata:k.g1(k.L5()).default({})}),k.Ik({memory_operation:v,entity_id:k.Yj().nullable(),observation_id:k.Yj().nullable(),relationship_id:k.Yj().nullable(),scope:w,query:k.Yj().nullable(),results_count:k.ai().int().nullable(),confidence:x.nullable()}),k.Ik({query:k.Yj().optional(),entity_type:u.optional(),entity_id:k.Yj().optional(),scope:w.optional(),agent_id:k.Yj().optional(),confidence_min:x.optional(),include_forgotten:k.zM().default(!1),tags:k.YO(k.Yj()).optional(),limit:k.ai().int().min(1).max(100).default(20),page:k.ai().int().min(1).default(1)});var y=(a=>"undefined"!=typeof require?require:"undefined"!=typeof Proxy?new Proxy(a,{get:(a,b)=>("undefined"!=typeof require?require:a)[b]}):a)(function(a){if("undefined"!=typeof require)return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')}),z=new Set(["timestamp","completed_at","cost_usd","latency_ms","tokens_in","tokens_out","confidence"]),A=class{constructor(a){this.dataDir=a,this.dbPath=(0,e.join)(a,"receipts.db"),this.receiptsDir=(0,e.join)(a,"receipts")}async init(){await (0,d.mkdir)(this.dataDir,{recursive:!0}),this.db=new f(this.dbPath),this.db.pragma("journal_mode = WAL"),this.db.pragma("foreign_keys = ON"),this.db.exec(`
2
2
  CREATE TABLE IF NOT EXISTS receipts (
3
3
  receipt_id TEXT PRIMARY KEY,
4
4
  chain_id TEXT NOT NULL,
@@ -87,6 +87,7 @@
87
87
  forgotten_at TEXT,
88
88
  forgotten_by TEXT,
89
89
  superseded_by TEXT,
90
+ expires_at TEXT,
90
91
  tags TEXT NOT NULL DEFAULT '[]',
91
92
  metadata TEXT NOT NULL DEFAULT '{}',
92
93
  FOREIGN KEY (entity_id) REFERENCES entities(entity_id)
@@ -97,6 +98,7 @@
97
98
  CREATE INDEX IF NOT EXISTS idx_obs_confidence ON observations(confidence);
98
99
  CREATE INDEX IF NOT EXISTS idx_obs_forgotten ON observations(forgotten_at);
99
100
  CREATE INDEX IF NOT EXISTS idx_obs_receipt ON observations(source_receipt_id);
101
+ CREATE INDEX IF NOT EXISTS idx_obs_expires ON observations(expires_at);
100
102
 
101
103
  CREATE TABLE IF NOT EXISTS relationships (
102
104
  relationship_id TEXT PRIMARY KEY,
@@ -115,7 +117,7 @@
115
117
  CREATE INDEX IF NOT EXISTS idx_rel_from ON relationships(from_entity_id);
116
118
  CREATE INDEX IF NOT EXISTS idx_rel_to ON relationships(to_entity_id);
117
119
  CREATE INDEX IF NOT EXISTS idx_rel_type ON relationships(relationship_type);
118
- `);try{this.db.exec(`
120
+ `);try{this.db.exec("ALTER TABLE observations ADD COLUMN expires_at TEXT")}catch{}try{this.db.exec(`
119
121
  CREATE VIRTUAL TABLE IF NOT EXISTS observations_fts USING fts5(
120
122
  content,
121
123
  content='observations',
@@ -149,11 +151,11 @@
149
151
  `).run({entity_id:a,name:d.name,aliases:JSON.stringify(d.aliases),scope:d.scope,attributes:JSON.stringify(d.attributes),metadata:JSON.stringify(d.metadata),forgotten_at:d.forgotten_at,merged_into:d.merged_into}),this.getEntity(a)}forgetEntity(a,b){let c=new Date().toISOString();this.db.prepare("UPDATE entities SET forgotten_at = ? WHERE entity_id = ?").run(c,a),this.db.prepare("UPDATE observations SET forgotten_at = ?, forgotten_by = ? WHERE entity_id = ? AND forgotten_at IS NULL").run(c,b,a)}mergeEntities(a,b){let c=this.getEntity(a),d=this.getEntity(b);if(!c)throw Error(`Source entity not found: ${a}`);if(!d)throw Error(`Target entity not found: ${b}`);this.db.prepare("UPDATE observations SET entity_id = ? WHERE entity_id = ?").run(b,a),this.db.prepare("UPDATE relationships SET from_entity_id = ? WHERE from_entity_id = ?").run(b,a),this.db.prepare("UPDATE relationships SET to_entity_id = ? WHERE to_entity_id = ?").run(b,a);let e=[...new Set([...d.aliases,c.name,...c.aliases])];return this.db.prepare("UPDATE entities SET aliases = ? WHERE entity_id = ?").run(JSON.stringify(e),b),this.db.prepare("UPDATE entities SET merged_into = ?, forgotten_at = ? WHERE entity_id = ?").run(b,new Date().toISOString(),a),this.getEntity(b)}addObservation(a){return this.db.prepare(`
150
152
  INSERT INTO observations (observation_id, entity_id, content, confidence,
151
153
  source_receipt_id, source_agent_id, source_context, observed_at,
152
- forgotten_at, forgotten_by, superseded_by, tags, metadata)
154
+ forgotten_at, forgotten_by, superseded_by, expires_at, tags, metadata)
153
155
  VALUES (@observation_id, @entity_id, @content, @confidence,
154
156
  @source_receipt_id, @source_agent_id, @source_context, @observed_at,
155
- @forgotten_at, @forgotten_by, @superseded_by, @tags, @metadata)
156
- `).run({observation_id:a.observation_id,entity_id:a.entity_id,content:a.content,confidence:a.confidence,source_receipt_id:a.source_receipt_id,source_agent_id:a.source_agent_id,source_context:a.source_context,observed_at:a.observed_at,forgotten_at:a.forgotten_at,forgotten_by:a.forgotten_by,superseded_by:a.superseded_by,tags:JSON.stringify(a.tags),metadata:JSON.stringify(a.metadata)}),a}getObservation(a){let b=this.db.prepare("SELECT * FROM observations WHERE observation_id = ?").get(a);return b?this.rowToObservation(b):null}getObservations(a,b=!1){return this.db.prepare(`SELECT * FROM observations ${b?"WHERE entity_id = ?":"WHERE entity_id = ? AND forgotten_at IS NULL"} ORDER BY observed_at DESC`).all(a).map(a=>this.rowToObservation(a))}forgetObservation(a,b){let c=new Date().toISOString();this.db.prepare("UPDATE observations SET forgotten_at = ?, forgotten_by = ? WHERE observation_id = ?").run(c,b,a)}supersede(a,b){return this.db.prepare("UPDATE observations SET superseded_by = ? WHERE observation_id = ?").run(b.observation_id,a),this.addObservation(b)}addRelationship(a){return this.db.prepare(`
157
+ @forgotten_at, @forgotten_by, @superseded_by, @expires_at, @tags, @metadata)
158
+ `).run({observation_id:a.observation_id,entity_id:a.entity_id,content:a.content,confidence:a.confidence,source_receipt_id:a.source_receipt_id,source_agent_id:a.source_agent_id,source_context:a.source_context,observed_at:a.observed_at,forgotten_at:a.forgotten_at,forgotten_by:a.forgotten_by,superseded_by:a.superseded_by,expires_at:a.expires_at??null,tags:JSON.stringify(a.tags),metadata:JSON.stringify(a.metadata)}),a}getObservation(a){let b=this.db.prepare("SELECT * FROM observations WHERE observation_id = ?").get(a);return b?this.rowToObservation(b):null}getObservations(a,b=!1){return this.db.prepare(`SELECT * FROM observations ${b?"WHERE entity_id = ?":"WHERE entity_id = ? AND forgotten_at IS NULL AND (expires_at IS NULL OR expires_at > datetime('now'))"} ORDER BY observed_at DESC`).all(a).map(a=>this.rowToObservation(a))}forgetObservation(a,b){let c=new Date().toISOString();this.db.prepare("UPDATE observations SET forgotten_at = ?, forgotten_by = ? WHERE observation_id = ?").run(c,b,a)}supersede(a,b){return this.db.prepare("UPDATE observations SET superseded_by = ? WHERE observation_id = ?").run(b.observation_id,a),this.addObservation(b)}addRelationship(a){return this.db.prepare(`
157
159
  INSERT INTO relationships (relationship_id, from_entity_id, to_entity_id,
158
160
  relationship_type, strength, source_receipt_id, created_at, forgotten_at, metadata)
159
161
  VALUES (@relationship_id, @from_entity_id, @to_entity_id,
@@ -164,14 +166,50 @@
164
166
  JOIN observations o ON o.rowid = observations_fts.rowid
165
167
  WHERE observations_fts MATCH ?
166
168
  AND o.forgotten_at IS NULL
169
+ AND (o.expires_at IS NULL OR o.expires_at > datetime('now'))
167
170
  ORDER BY rank
168
171
  LIMIT ?
169
172
  `).all(a,d).map(a=>{let b=this.rowToObservation(a);return{entity:this.getEntity(b.entity_id),observation:b,rank:a.rank}}).filter(a=>null!==a.entity)}catch{c=this.db.prepare(`
170
173
  SELECT * FROM observations
171
174
  WHERE content LIKE ? AND forgotten_at IS NULL
175
+ AND (expires_at IS NULL OR expires_at > datetime('now'))
172
176
  ORDER BY observed_at DESC
173
177
  LIMIT ?
174
- `).all(`%${a}%`,d).map((a,b)=>{let c=this.rowToObservation(a);return{entity:this.getEntity(c.entity_id),observation:c,rank:b}}).filter(a=>null!==a.entity)}if(b?.entity_type&&(c=c.filter(a=>a.entity.entity_type===b.entity_type)),b?.scope&&(c=c.filter(a=>a.entity.scope===b.scope)),b?.confidence_min){let a=E[b.confidence_min]??0;c=c.filter(b=>(E[b.observation.confidence]??0)>=a)}return c}recall(a){if(a.query){let b=this.search(a.query,a),c=new Map,d=[];for(let a of b)c.set(a.entity.entity_id,a.entity),d.push(a.observation);return{entities:Array.from(c.values()),observations:d,total:d.length}}let b=this.findEntities(a),c=[];for(let d of b.data){let b=this.getObservations(d.entity_id,a.include_forgotten);c.push(...b)}return{entities:b.data,observations:c,total:c.length}}getEntityHistory(a){return this.db.prepare("SELECT * FROM observations WHERE entity_id = ? ORDER BY observed_at ASC").all(a).map(a=>this.rowToObservation(a))}getMemoryProvenance(a){let b=this.getObservation(a);if(!b)return null;let c=this.getEntity(b.entity_id);return c?{observation:b,entity:c,receipt_id:b.source_receipt_id,chain:[]}:null}getMemoryStats(a,b,c){let d=[],e=[];a&&(d.push("created_by_agent = ?"),e.push("source_agent_id = ?"),[].push(a));let f=d.length>0?`WHERE ${d.join(" AND ")}`:"",g=e.length>0?`WHERE ${e.join(" AND ")}`:"",h=this.db.prepare(`SELECT COUNT(*) as cnt FROM entities ${f}`).get(...a?[a]:[]).cnt,i=this.db.prepare(`SELECT COUNT(*) as cnt FROM observations ${g}`).get(...a?[a]:[]).cnt,j=this.db.prepare("SELECT COUNT(*) as cnt FROM relationships").get().cnt,k=this.db.prepare(`SELECT COUNT(*) as cnt FROM observations WHERE forgotten_at IS NOT NULL ${a?"AND source_agent_id = ?":""}`).get(...a?[a]:[]).cnt,l=this.db.prepare(`SELECT COUNT(*) as cnt FROM entities WHERE forgotten_at IS NOT NULL ${a?"AND created_by_agent = ?":""}`).get(...a?[a]:[]).cnt,m=this.db.prepare("SELECT entity_type, COUNT(*) as cnt FROM entities GROUP BY entity_type").all(),n={};for(let a of m)n[a.entity_type]=a.cnt;return{total_entities:h,total_observations:i,total_relationships:j,forgotten_observations:k,forgotten_entities:l,by_entity_type:n,by_operation:{}}}rowToEntity(a){return{entity_id:a.entity_id,entity_type:a.entity_type,name:a.name,aliases:JSON.parse(a.aliases||"[]"),scope:a.scope,created_at:a.created_at,created_by_agent:a.created_by_agent,created_by_receipt:a.created_by_receipt,forgotten_at:a.forgotten_at||null,merged_into:a.merged_into||null,attributes:JSON.parse(a.attributes||"{}"),metadata:JSON.parse(a.metadata||"{}")}}rowToObservation(a){return{observation_id:a.observation_id,entity_id:a.entity_id,content:a.content,confidence:a.confidence,source_receipt_id:a.source_receipt_id,source_agent_id:a.source_agent_id,source_context:a.source_context||null,observed_at:a.observed_at,forgotten_at:a.forgotten_at||null,forgotten_by:a.forgotten_by||null,superseded_by:a.superseded_by||null,tags:JSON.parse(a.tags||"[]"),metadata:JSON.parse(a.metadata||"{}")}}rowToRelationship(a){return{relationship_id:a.relationship_id,from_entity_id:a.from_entity_id,to_entity_id:a.to_entity_id,relationship_type:a.relationship_type,strength:a.strength,source_receipt_id:a.source_receipt_id,created_at:a.created_at,forgotten_at:a.forgotten_at||null,metadata:JSON.parse(a.metadata||"{}")}}};function G(a){let b=JSON.stringify(function a(b){if(null==b)return b;if(Array.isArray(b))return b.map(a);if("object"==typeof b){let c={};for(let d of Object.keys(b).sort())c[d]=a(b[d]);return c}return b}(a))??"null",c=(0,g.createHash)("sha256").update(b).digest("hex");return`sha256:${c}`}var H=new Set(["receipt_id","parent_receipt_id","chain_id","receipt_type","agent_id","org_id","action","input_hash","output_hash","output_summary","model","tokens_in","tokens_out","cost_usd","latency_ms","tool_calls","timestamp","completed_at","status","error","environment","tags","constraints","constraint_result","signature","verify_url","callback_verified","confidence","metadata"]);function I(a,b,c){if(0===b.length)return{passed:!0,results:[],evaluated_at:new Date().toISOString()};let d=[];for(let e of b){let b;switch(e.type){case"max_latency_ms":b=function(a,b){let c=b.value,d=a.latency_ms;return null==d?{type:b.type,passed:!1,expected:c,actual:null,message:b.message??"latency_ms is null"}:{type:b.type,passed:d<=c,expected:c,actual:d,message:b.message}}(a,e);break;case"max_cost_usd":b=function(a,b){let c=b.value,d=a.cost_usd;return null==d?{type:b.type,passed:!1,expected:c,actual:null,message:b.message??"cost_usd is null"}:{type:b.type,passed:d<=c,expected:c,actual:d,message:b.message}}(a,e);break;case"min_confidence":b=function(a,b){let c=b.value,d=a.confidence;return null==d?{type:b.type,passed:!1,expected:c,actual:null,message:b.message??"confidence is null"}:{type:b.type,passed:d>=c,expected:c,actual:d,message:b.message}}(a,e);break;case"required_fields":b=function(a,b){let c=b.value;if(!Array.isArray(c))return{type:b.type,passed:!1,expected:c,actual:null,message:b.message??"value must be an array of field names"};let d=[],e=[];for(let b of c)H.has(b)?(null===a[b]||void 0===a[b])&&d.push(b):e.push(b);return e.length>0?{type:b.type,passed:!1,expected:c,actual:e,message:b.message??`Unknown field(s): ${e.join(", ")}`}:{type:b.type,passed:0===d.length,expected:c,actual:d.length>0?d:c,message:b.message??(d.length>0?`Missing field(s): ${d.join(", ")}`:void 0)}}(a,e);break;case"status_must_be":b=function(a,b){let c=b.value,d=a.status,e=Array.isArray(c)?c:[c];return{type:b.type,passed:e.includes(d),expected:c,actual:d,message:b.message}}(a,e);break;case"output_schema":b=function(a,b){if(void 0===b)return{type:"output_schema",passed:!1,expected:a.value,actual:null,message:a.message??"output_schema requires raw output data — only available during track() or create()"};let c=a.value,d=function a(b,c,d=""){let e=[];if(0===Object.keys(c).length)return e;if(void 0!==c.type){let a=c.type;if(!function(a,b){switch(b){case"string":return"string"==typeof a;case"number":return"number"==typeof a;case"integer":return"number"==typeof a&&Number.isInteger(a);case"boolean":return"boolean"==typeof a;case"object":return"object"==typeof a&&null!==a&&!Array.isArray(a);case"array":return Array.isArray(a);case"null":return null===a;default:return!1}}(b,a)){var f;return e.push(`${d||"."}: expected type ${a}, got ${null===(f=b)?"null":Array.isArray(f)?"array":typeof f}`),e}}if(void 0!==c.enum){let a=c.enum;a.some(a=>JSON.stringify(a)===JSON.stringify(b))||e.push(`${d||"."}: value ${JSON.stringify(b)} not in enum ${JSON.stringify(a)}`)}if("string"==typeof b&&(void 0!==c.minLength&&b.length<c.minLength&&e.push(`${d||"."}: string length ${b.length} < minLength ${c.minLength}`),void 0!==c.maxLength&&b.length>c.maxLength&&e.push(`${d||"."}: string length ${b.length} > maxLength ${c.maxLength}`),void 0!==c.pattern&&(new RegExp(c.pattern).test(b)||e.push(`${d||"."}: string does not match pattern ${c.pattern}`))),"number"==typeof b&&(void 0!==c.minimum&&b<c.minimum&&e.push(`${d||"."}: ${b} < minimum ${c.minimum}`),void 0!==c.maximum&&b>c.maximum&&e.push(`${d||"."}: ${b} > maximum ${c.maximum}`)),"object"==typeof b&&null!==b&&!Array.isArray(b)){if(void 0!==c.required)for(let a of c.required)a in b||e.push(`${d||"."}: missing required property "${a}"`);if(void 0!==c.properties){for(let[f,g]of Object.entries(c.properties))if(f in b){let c=a(b[f],g,`${d}.${f}`);e.push(...c)}}if(!1===c.additionalProperties&&void 0!==c.properties){let a=new Set(Object.keys(c.properties));for(let c of Object.keys(b))a.has(c)||e.push(`${d||"."}: additional property "${c}" not allowed`)}}if(Array.isArray(b)&&(void 0!==c.minItems&&b.length<c.minItems&&e.push(`${d||"."}: array length ${b.length} < minItems ${c.minItems}`),void 0!==c.maxItems&&b.length>c.maxItems&&e.push(`${d||"."}: array length ${b.length} > maxItems ${c.maxItems}`),void 0!==c.items)){let f=c.items;for(let c=0;c<b.length;c++){let g=a(b[c],f,`${d}[${c}]`);e.push(...g)}}return e}(b,c);return{type:"output_schema",passed:0===d.length,expected:c,actual:d.length>0?d:b,message:d.length>0?a.message??`Schema validation failed: ${d.join(", ")}`:void 0}}(e,c?.rawOutput);break;default:b={type:e.type,passed:!1,expected:e.value,actual:null,message:e.message??`Unknown constraint type: ${e.type}`}}d.push(b)}return{passed:d.every(a=>a.passed),results:d,evaluated_at:new Date().toISOString()}}function J(a){let b=a.constraint_result;return{receipt_id:a.receipt_id,action:a.action,agent_id:a.agent_id,timestamp:a.timestamp,description:a.output_summary??`${a.action} by ${a.agent_id}`,cost_usd:a.cost_usd,latency_ms:a.latency_ms,model:a.model,tokens_in:a.tokens_in,tokens_out:a.tokens_out,constraints_passed:b&&"boolean"==typeof b.passed?b.passed:null,receipt:a}}async function K(a,b,c){let d=(await a.list({from:c.from,to:c.to,status:"completed"},1,1e5,"timestamp:asc")).data;if(c.agent_ids&&c.agent_ids.length>0){let a=new Set(c.agent_ids);d=d.filter(b=>a.has(b.agent_id))}if(c.actions&&c.actions.length>0){let a=new Set(c.actions);d=d.filter(b=>a.has(b.action))}c.constraints_passed_only&&(d=d.filter(a=>{let b=a.constraint_result;return!b||!1!==b.passed}));let e=d.map(J),f=function(a,b){if("none"===b){let b=a.reduce((a,b)=>a+(b.cost_usd??0),0);return[{label:"All Items",items:a,subtotal_usd:b,count:a.length}]}let c=new Map;for(let d of a){let a;a="action"===b?d.action:"agent"===b?d.agent_id:d.timestamp.slice(0,10);let e=c.get(a)??[];e.push(d),c.set(a,e)}let d=[];for(let[a,b]of c){let c=b.reduce((a,b)=>a+(b.cost_usd??0),0);d.push({label:a,items:b,subtotal_usd:c,count:b.length})}return d.sort((a,b)=>a.label.localeCompare(b.label))}(e,c.group_by??"none"),g=function(a){let b=0,c=0,d=0,e=0,f=0,g=0,h=0;for(let i of a)b+=i.cost_usd??0,c+=i.tokens_in??0,d+=i.tokens_out??0,e+=i.latency_ms??0,null!==i.constraints_passed&&(f++,i.constraints_passed?g++:h++);return{total_receipts:a.length,total_cost_usd:b,avg_cost_usd:a.length>0?b/a.length:0,total_tokens_in:c,total_tokens_out:d,total_latency_ms:e,avg_latency_ms:a.length>0?e/a.length:0,constraints_evaluated:f,constraints_passed:g,constraints_failed:h}}(e),h=b.getPublicKey();return{invoice_number:function(){let a=new Date,b=a.getFullYear(),c=String(a.getMonth()+1).padStart(2,"0"),d=String(a.getDate()).padStart(2,"0"),e="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",f="";for(let a=0;a<4;a++)f+=e[Math.floor(Math.random()*e.length)];return`AR-${b}${c}${d}-${f}`}(),generated_at:new Date().toISOString(),period:{from:c.from,to:c.to},client:c.client,provider:c.provider,groups:f,summary:g,public_key:h,notes:c.notes,payment_terms:c.payment_terms}}var L=class{constructor(a,b,c){this.store=a,this.keyManager=b,this.configManager=c}async create(a){let b=this.configManager.getConfig(),c=`rcpt_${(0,j.Ak)(12)}`,d=a.chain_id??`chain_${(0,j.Ak)(8)}`,e=new Date().toISOString(),f=a.constraints&&a.constraints.length>0?a.constraints:null,g=a.expires_at;!g&&a.ttl_ms&&(g=new Date(Date.now()+a.ttl_ms).toISOString());let i={...a.metadata??{}};g&&(i.expires_at=g);let k={receipt_id:c,parent_receipt_id:a.parent_receipt_id??null,chain_id:d,receipt_type:a.receipt_type??"action",agent_id:b.agentId,org_id:b.orgId,action:a.action,input_hash:a.input_hash,output_hash:a.output_hash??null,output_summary:a.output_summary??null,model:a.model??null,tokens_in:a.tokens_in??null,tokens_out:a.tokens_out??null,cost_usd:a.cost_usd??null,latency_ms:a.latency_ms??null,tool_calls:a.tool_calls??null,timestamp:e,completed_at:"completed"===a.status?e:null,status:a.status??"pending",error:null,environment:b.environment,tags:a.tags??null,constraints:f?{definitions:f}:null,constraint_result:null,signature:"",verify_url:`local://verify/${c}`,callback_verified:null,confidence:a.confidence??null,metadata:i};"completed"===k.status&&f&&(k.constraint_result=I(k,f,{rawOutput:a._rawOutput}));let l=(0,h.W_)(k);k.signature=(0,h.o3)(l,this.keyManager.getPrivateKey());let m=p.parse(k);return await this.store.save(m),m}async complete(a,b){let c=await this.store.get(a);if(!c)throw Error(`Receipt not found: ${a}`);if("pending"!==c.status)throw Error(`Receipt ${a} is not pending (status: ${c.status})`);let d=new Date().toISOString(),e={...c,status:b.status,completed_at:d,output_hash:b.output_hash??c.output_hash,output_summary:b.output_summary??c.output_summary,model:b.model??c.model,tokens_in:b.tokens_in??c.tokens_in,tokens_out:b.tokens_out??c.tokens_out,cost_usd:b.cost_usd??c.cost_usd,latency_ms:b.latency_ms??c.latency_ms,tool_calls:b.tool_calls??c.tool_calls,confidence:b.confidence??c.confidence,callback_verified:b.callback_verified??c.callback_verified,error:b.error??c.error,metadata:b.metadata?{...c.metadata,...b.metadata}:c.metadata,constraint_result:c.constraint_result},f=c.constraints,g=f?.definitions??null;Array.isArray(g)&&g.length>0&&(e.constraint_result=I(e,g));let i=(0,h.W_)(e);e.signature=(0,h.o3)(i,this.keyManager.getPrivateKey());let j=p.parse(e);return await this.store.save(j),j}async track(a){let b=G(a.input),c=void 0!==a.output?G(a.output):null;return this.create({action:a.action,input_hash:b,output_hash:c,output_summary:a.output_summary??null,model:a.model??null,tokens_in:a.tokens_in??null,tokens_out:a.tokens_out??null,cost_usd:a.cost_usd??null,latency_ms:a.latency_ms??null,tool_calls:a.tool_calls??null,tags:a.tags??null,confidence:a.confidence??null,metadata:a.metadata??{},parent_receipt_id:a.parent_receipt_id??null,chain_id:a.chain_id,status:"completed",constraints:a.constraints,expires_at:a.expires_at,ttl_ms:a.ttl_ms,_rawOutput:a.output})}async verify(a){let b=await this.store.get(a);if(!b)throw Error(`Receipt not found: ${a}`);let c=(0,h.W_)(b);return{verified:(0,h.XF)(c,b.signature,this.keyManager.getPublicKey()),receipt:b}}async get(a){return this.store.get(a)}async list(a,b,c,d){return this.store.list(a,b,c,d)}async getChain(a){return this.store.getChain(a)}async getJudgments(a){return(await this.store.list({parent_receipt_id:a,receipt_type:"judgment"})).data}async cleanup(){let a=await this.store.cleanup();return{deleted:a.deleted,remaining:a.total-a.deleted}}getPublicKey(){return this.keyManager.getPublicKey()}async generateInvoice(a){return K(this.store,this.keyManager,a)}},M=class{constructor(a,b){this.receiptEngine=a,this.memoryStore=b}async observe(a){let b=a.scope??"agent",c=a.confidence??"medium",d=!1,e=this.memoryStore.findEntityByName(a.entityName,a.entityType),f=await this.receiptEngine.create({action:"memory.observe",receipt_type:"memory",input_hash:G({entityName:a.entityName,content:a.content}),status:"completed",metadata:{memory:{memory_operation:"observe",entity_id:e?.entity_id??null,observation_id:null,relationship_id:null,scope:b,query:null,results_count:null,confidence:c}}});e||(e=this.memoryStore.createEntity({entity_id:`ent_${(0,j.Ak)(12)}`,entity_type:a.entityType,name:a.entityName,aliases:[],scope:b,created_at:new Date().toISOString(),created_by_agent:a.agentId,created_by_receipt:f.receipt_id,forgotten_at:null,merged_into:null,attributes:{},metadata:{}}),d=!0);let g=this.memoryStore.addObservation({observation_id:`obs_${(0,j.Ak)(12)}`,entity_id:e.entity_id,content:a.content,confidence:c,source_receipt_id:f.receipt_id,source_agent_id:a.agentId,source_context:a.context??null,observed_at:new Date().toISOString(),forgotten_at:null,forgotten_by:null,superseded_by:null,tags:a.tags??[],metadata:{}});return{entity:e,observation:g,receipt:f,created_entity:d}}async recall(a){let b={query:a.query,entity_type:a.entityType,entity_id:a.entityId,scope:a.scope,limit:a.limit??20,include_forgotten:!1,page:1},c=this.memoryStore.recall(b),d=await this.receiptEngine.create({action:"memory.recall",receipt_type:"memory",input_hash:G({query:a.query,entityType:a.entityType,entityId:a.entityId}),output_hash:G({entities:c.entities.length,observations:c.observations.length}),status:"completed",metadata:{memory:{memory_operation:"recall",entity_id:a.entityId??null,observation_id:null,relationship_id:null,scope:a.scope??"agent",query:a.query??null,results_count:c.total,confidence:null}}});return{entities:c.entities,observations:c.observations,receipt:d}}async forget(a){let b=a.entityId?"memory.forget_entity":"memory.forget";if(a.entityId)this.memoryStore.forgetEntity(a.entityId,a.agentId);else if(a.observationId)this.memoryStore.forgetObservation(a.observationId,a.agentId);else throw Error("Either entityId or observationId must be provided");return{receipt:await this.receiptEngine.create({action:b,receipt_type:"memory",input_hash:G({entityId:a.entityId,observationId:a.observationId,reason:a.reason}),status:"completed",metadata:{memory:{memory_operation:a.entityId?"forget_entity":"forget",entity_id:a.entityId??null,observation_id:a.observationId??null,relationship_id:null,scope:"agent",query:null,results_count:null,confidence:null},reason:a.reason}})}}async relate(a){let b=await this.receiptEngine.create({action:"memory.relate",receipt_type:"memory",input_hash:G({from:a.fromEntityId,to:a.toEntityId,type:a.relationshipType}),status:"completed",metadata:{memory:{memory_operation:"observe",entity_id:a.fromEntityId,observation_id:null,relationship_id:null,scope:"agent",query:null,results_count:null,confidence:a.strength??"medium"}}});return{relationship:this.memoryStore.addRelationship({relationship_id:`rel_${(0,j.Ak)(12)}`,from_entity_id:a.fromEntityId,to_entity_id:a.toEntityId,relationship_type:a.relationshipType,strength:a.strength??"medium",source_receipt_id:b.receipt_id,created_at:new Date().toISOString(),forgotten_at:null,metadata:a.context?{context:a.context}:{}}),receipt:b}}async merge(a){let b=this.memoryStore.mergeEntities(a.sourceEntityId,a.targetEntityId),c=await this.receiptEngine.create({action:"memory.merge",receipt_type:"memory",input_hash:G({source:a.sourceEntityId,target:a.targetEntityId}),output_hash:G(b),status:"completed",metadata:{memory:{memory_operation:"merge",entity_id:a.targetEntityId,observation_id:null,relationship_id:null,scope:b.scope,query:null,results_count:null,confidence:null}}});return{mergedEntity:b,receipt:c}}provenance(a){return this.memoryStore.getMemoryProvenance(a)}entityTimeline(a){let b=this.memoryStore.getEntityHistory(a),c=this.memoryStore.getRelationships(a),d=[];for(let a of b)d.push({type:a.forgotten_at?"forget":"observation",timestamp:a.observed_at,data:a});for(let a of c)d.push({type:"relationship",timestamp:a.created_at,data:a});return d.sort((a,b)=>a.timestamp.localeCompare(b.timestamp)),d}memoryAudit(a){return this.memoryStore.getMemoryStats(a.agentId,a.from,a.to)}};function N(a,b=!1){return b?JSON.stringify(a,null,2):JSON.stringify({...a,groups:a.groups.map(a=>({...a,items:a.items.map(({receipt:a,...b})=>b)}))},null,2)}function O(a){let b=[];for(let c of(b.push("receipt_id,action,agent_id,timestamp,description,cost_usd,latency_ms,model,tokens_in,tokens_out,constraints_passed,group"),a.groups))for(let a of c.items)b.push([P(a.receipt_id),P(a.action),P(a.agent_id),P(a.timestamp),P(a.description),a.cost_usd??"",a.latency_ms??"",P(a.model??""),a.tokens_in??"",a.tokens_out??"",a.constraints_passed??"",P(c.label)].join(","));return b.push(""),b.push(`# Invoice: ${a.invoice_number}`),b.push(`# Period: ${a.period.from} to ${a.period.to}`),b.push(`# Total Receipts: ${a.summary.total_receipts}`),b.push(`# Total Cost: $${a.summary.total_cost_usd.toFixed(4)}`),b.join("\n")}function P(a){return a.includes(",")||a.includes('"')||a.includes("\n")?`"${a.replace(/"/g,'""')}"`:a}function Q(a){let b=[];for(let c of(b.push(`# Invoice ${a.invoice_number}`),b.push(""),b.push(`**Generated:** ${a.generated_at}`),b.push(`**Period:** ${a.period.from} to ${a.period.to}`),b.push(""),a.provider&&(b.push("## Provider"),b.push(`**${a.provider.name}**`),a.provider.email&&b.push(`Email: ${a.provider.email}`),a.provider.address&&b.push(`Address: ${a.provider.address}`),b.push("")),a.client&&(b.push("## Bill To"),b.push(`**${a.client.name}**`),a.client.email&&b.push(`Email: ${a.client.email}`),a.client.address&&b.push(`Address: ${a.client.address}`),b.push("")),b.push("---"),b.push(""),a.groups)){for(let a of(b.push(`### ${c.label}`),b.push(""),b.push("| Receipt ID | Action | Agent | Description | Cost |"),b.push("|------------|--------|-------|-------------|------|"),c.items)){let c=null!==a.cost_usd?`$${a.cost_usd.toFixed(4)}`:"-",d=a.description.length>50?a.description.slice(0,47)+"...":a.description;b.push(`| \`${a.receipt_id}\` | ${a.action} | ${a.agent_id} | ${d} | ${c} |`)}b.push(""),b.push(`**Subtotal:** $${c.subtotal_usd.toFixed(4)} (${c.count} items)`),b.push("")}return b.push("---"),b.push(""),b.push("## Summary"),b.push(""),b.push("| Metric | Value |"),b.push("|--------|-------|"),b.push(`| Total Receipts | ${a.summary.total_receipts} |`),b.push(`| Total Cost | $${a.summary.total_cost_usd.toFixed(4)} |`),b.push(`| Avg Cost | $${a.summary.avg_cost_usd.toFixed(4)} |`),b.push(`| Total Tokens (in) | ${a.summary.total_tokens_in} |`),b.push(`| Total Tokens (out) | ${a.summary.total_tokens_out} |`),b.push(`| Avg Latency | ${Math.round(a.summary.avg_latency_ms)}ms |`),a.summary.constraints_evaluated>0&&b.push(`| Constraints Passed | ${a.summary.constraints_passed}/${a.summary.constraints_evaluated} |`),b.push(""),a.notes&&(b.push("## Notes"),b.push(""),b.push(a.notes),b.push("")),a.payment_terms&&(b.push("## Payment Terms"),b.push(""),b.push(a.payment_terms),b.push("")),b.push("---"),b.push(""),b.push("## Verification"),b.push(""),b.push("Every line item is a cryptographically signed receipt that can be independently verified."),b.push(""),b.push(`**Public Key:** \`${a.public_key}\``),b.push(""),b.join("\n")}function R(a){let b=a.provider?`
178
+ `).all(`%${a}%`,d).map((a,b)=>{let c=this.rowToObservation(a);return{entity:this.getEntity(c.entity_id),observation:c,rank:b}}).filter(a=>null!==a.entity)}if(b?.entity_type&&(c=c.filter(a=>a.entity.entity_type===b.entity_type)),b?.scope&&(c=c.filter(a=>a.entity.scope===b.scope)),b?.confidence_min){let a=E[b.confidence_min]??0;c=c.filter(b=>(E[b.observation.confidence]??0)>=a)}return c}recall(a){if(a.query){let b=this.search(a.query,a),c=new Map,d=[];for(let a of b)c.set(a.entity.entity_id,a.entity),d.push(a.observation);return{entities:Array.from(c.values()),observations:d,total:d.length}}let b=this.findEntities(a),c=[];for(let d of b.data){let b=this.getObservations(d.entity_id,a.include_forgotten);c.push(...b)}return{entities:b.data,observations:c,total:c.length}}getEntityHistory(a){return this.db.prepare("SELECT * FROM observations WHERE entity_id = ? ORDER BY observed_at ASC").all(a).map(a=>this.rowToObservation(a))}getMemoryProvenance(a){let b=this.getObservation(a);if(!b)return null;let c=this.getEntity(b.entity_id);return c?{observation:b,entity:c,receipt_id:b.source_receipt_id,chain:[]}:null}getMemoryStats(a,b,c){let d=[],e=[];a&&(d.push("created_by_agent = ?"),e.push("source_agent_id = ?"),[].push(a));let f=d.length>0?`WHERE ${d.join(" AND ")}`:"",g=e.length>0?`WHERE ${e.join(" AND ")}`:"",h=this.db.prepare(`SELECT COUNT(*) as cnt FROM entities ${f}`).get(...a?[a]:[]).cnt,i=this.db.prepare(`SELECT COUNT(*) as cnt FROM observations ${g}`).get(...a?[a]:[]).cnt,j=this.db.prepare("SELECT COUNT(*) as cnt FROM relationships").get().cnt,k=this.db.prepare(`SELECT COUNT(*) as cnt FROM observations WHERE forgotten_at IS NOT NULL ${a?"AND source_agent_id = ?":""}`).get(...a?[a]:[]).cnt,l=this.db.prepare(`SELECT COUNT(*) as cnt FROM entities WHERE forgotten_at IS NOT NULL ${a?"AND created_by_agent = ?":""}`).get(...a?[a]:[]).cnt,m=this.db.prepare("SELECT entity_type, COUNT(*) as cnt FROM entities GROUP BY entity_type").all(),n={};for(let a of m)n[a.entity_type]=a.cnt;return{total_entities:h,total_observations:i,total_relationships:j,forgotten_observations:k,forgotten_entities:l,by_entity_type:n,by_operation:{}}}findPossibleDuplicates(a){let b=this.getEntity(a);if(!b)return[];let c=b.name.toLowerCase().split(/\s+/).filter(a=>a.length>=2);if(0===c.length)return[];let d=c.map(()=>"(LOWER(name) LIKE ? OR LOWER(aliases) LIKE ?)").join(" OR "),e=[];for(let a of c)e.push(`%${a}%`,`%${a}%`);return this.db.prepare(`
179
+ SELECT * FROM entities
180
+ WHERE entity_type = ?
181
+ AND entity_id != ?
182
+ AND forgotten_at IS NULL
183
+ AND merged_into IS NULL
184
+ AND (${d})
185
+ `).all(b.entity_type,a,...e).map(a=>this.rowToEntity(a))}getTopEntities(a,b){let c=b?"AND e.scope = ?":"";return this.db.prepare(`
186
+ SELECT e.*, COUNT(o.observation_id) as obs_count, MAX(o.observed_at) as latest
187
+ FROM entities e
188
+ LEFT JOIN observations o ON o.entity_id = e.entity_id AND o.forgotten_at IS NULL
189
+ AND (o.expires_at IS NULL OR o.expires_at > datetime('now'))
190
+ WHERE e.forgotten_at IS NULL AND e.merged_into IS NULL ${c}
191
+ GROUP BY e.entity_id
192
+ ORDER BY obs_count DESC
193
+ LIMIT ?
194
+ `).all(...b?[b,a]:[a]).map(a=>({...this.rowToEntity(a),observation_count:a.obs_count,latest_observation:a.latest??""}))}getRecentObservations(a,b){let c=b?"AND source_agent_id = ?":"";return this.db.prepare(`
195
+ SELECT * FROM observations
196
+ WHERE forgotten_at IS NULL
197
+ AND (expires_at IS NULL OR expires_at > datetime('now'))
198
+ ${c}
199
+ ORDER BY observed_at DESC
200
+ LIMIT ?
201
+ `).all(...b?[b,a]:[a]).map(a=>this.rowToObservation(a))}getActiveRelationships(a){return this.db.prepare("SELECT * FROM relationships WHERE forgotten_at IS NULL ORDER BY created_at DESC LIMIT ?").all(a).map(a=>this.rowToRelationship(a))}getPreferenceObservations(a){return this.db.prepare(`
202
+ SELECT o.* FROM observations o
203
+ JOIN entities e ON e.entity_id = o.entity_id
204
+ WHERE e.entity_type = 'preference'
205
+ AND o.forgotten_at IS NULL
206
+ AND (o.expires_at IS NULL OR o.expires_at > datetime('now'))
207
+ ORDER BY o.observed_at DESC
208
+ LIMIT ?
209
+ `).all(a).map(a=>this.rowToObservation(a))}getContextStats(){let a=this.db.prepare("SELECT COUNT(*) as cnt FROM entities WHERE forgotten_at IS NULL").get().cnt,b=this.db.prepare("SELECT COUNT(*) as cnt FROM observations WHERE forgotten_at IS NULL AND (expires_at IS NULL OR expires_at > datetime('now'))").get().cnt;return{total_entities:a,total_observations:b,total_relationships:this.db.prepare("SELECT COUNT(*) as cnt FROM relationships WHERE forgotten_at IS NULL").get().cnt,agents_contributing:this.db.prepare("SELECT DISTINCT source_agent_id FROM observations WHERE forgotten_at IS NULL").all().map(a=>a.source_agent_id)}}cleanupExpiredObservations(){return this.db.prepare(`
210
+ UPDATE observations SET forgotten_at = datetime('now'), forgotten_by = 'system:cleanup'
211
+ WHERE expires_at IS NOT NULL AND expires_at <= datetime('now') AND forgotten_at IS NULL
212
+ `).run().changes}rowToEntity(a){return{entity_id:a.entity_id,entity_type:a.entity_type,name:a.name,aliases:JSON.parse(a.aliases||"[]"),scope:a.scope,created_at:a.created_at,created_by_agent:a.created_by_agent,created_by_receipt:a.created_by_receipt,forgotten_at:a.forgotten_at||null,merged_into:a.merged_into||null,attributes:JSON.parse(a.attributes||"{}"),metadata:JSON.parse(a.metadata||"{}")}}rowToObservation(a){return{observation_id:a.observation_id,entity_id:a.entity_id,content:a.content,confidence:a.confidence,source_receipt_id:a.source_receipt_id,source_agent_id:a.source_agent_id,source_context:a.source_context||null,observed_at:a.observed_at,forgotten_at:a.forgotten_at||null,forgotten_by:a.forgotten_by||null,superseded_by:a.superseded_by||null,expires_at:a.expires_at||null,tags:JSON.parse(a.tags||"[]"),metadata:JSON.parse(a.metadata||"{}")}}rowToRelationship(a){return{relationship_id:a.relationship_id,from_entity_id:a.from_entity_id,to_entity_id:a.to_entity_id,relationship_type:a.relationship_type,strength:a.strength,source_receipt_id:a.source_receipt_id,created_at:a.created_at,forgotten_at:a.forgotten_at||null,metadata:JSON.parse(a.metadata||"{}")}}};function G(a){let b=JSON.stringify(function a(b){if(null==b)return b;if(Array.isArray(b))return b.map(a);if("object"==typeof b){let c={};for(let d of Object.keys(b).sort())c[d]=a(b[d]);return c}return b}(a))??"null",c=(0,g.createHash)("sha256").update(b).digest("hex");return`sha256:${c}`}var H=new Set(["receipt_id","parent_receipt_id","chain_id","receipt_type","agent_id","org_id","action","input_hash","output_hash","output_summary","model","tokens_in","tokens_out","cost_usd","latency_ms","tool_calls","timestamp","completed_at","status","error","environment","tags","constraints","constraint_result","signature","verify_url","callback_verified","confidence","metadata"]);function I(a,b,c){if(0===b.length)return{passed:!0,results:[],evaluated_at:new Date().toISOString()};let d=[];for(let e of b){let b;switch(e.type){case"max_latency_ms":b=function(a,b){let c=b.value,d=a.latency_ms;return null==d?{type:b.type,passed:!1,expected:c,actual:null,message:b.message??"latency_ms is null"}:{type:b.type,passed:d<=c,expected:c,actual:d,message:b.message}}(a,e);break;case"max_cost_usd":b=function(a,b){let c=b.value,d=a.cost_usd;return null==d?{type:b.type,passed:!1,expected:c,actual:null,message:b.message??"cost_usd is null"}:{type:b.type,passed:d<=c,expected:c,actual:d,message:b.message}}(a,e);break;case"min_confidence":b=function(a,b){let c=b.value,d=a.confidence;return null==d?{type:b.type,passed:!1,expected:c,actual:null,message:b.message??"confidence is null"}:{type:b.type,passed:d>=c,expected:c,actual:d,message:b.message}}(a,e);break;case"required_fields":b=function(a,b){let c=b.value;if(!Array.isArray(c))return{type:b.type,passed:!1,expected:c,actual:null,message:b.message??"value must be an array of field names"};let d=[],e=[];for(let b of c)H.has(b)?(null===a[b]||void 0===a[b])&&d.push(b):e.push(b);return e.length>0?{type:b.type,passed:!1,expected:c,actual:e,message:b.message??`Unknown field(s): ${e.join(", ")}`}:{type:b.type,passed:0===d.length,expected:c,actual:d.length>0?d:c,message:b.message??(d.length>0?`Missing field(s): ${d.join(", ")}`:void 0)}}(a,e);break;case"status_must_be":b=function(a,b){let c=b.value,d=a.status,e=Array.isArray(c)?c:[c];return{type:b.type,passed:e.includes(d),expected:c,actual:d,message:b.message}}(a,e);break;case"output_schema":b=function(a,b){if(void 0===b)return{type:"output_schema",passed:!1,expected:a.value,actual:null,message:a.message??"output_schema requires raw output data — only available during track() or create()"};let c=a.value,d=function a(b,c,d=""){let e=[];if(0===Object.keys(c).length)return e;if(void 0!==c.type){let a=c.type;if(!function(a,b){switch(b){case"string":return"string"==typeof a;case"number":return"number"==typeof a;case"integer":return"number"==typeof a&&Number.isInteger(a);case"boolean":return"boolean"==typeof a;case"object":return"object"==typeof a&&null!==a&&!Array.isArray(a);case"array":return Array.isArray(a);case"null":return null===a;default:return!1}}(b,a)){var f;return e.push(`${d||"."}: expected type ${a}, got ${null===(f=b)?"null":Array.isArray(f)?"array":typeof f}`),e}}if(void 0!==c.enum){let a=c.enum;a.some(a=>JSON.stringify(a)===JSON.stringify(b))||e.push(`${d||"."}: value ${JSON.stringify(b)} not in enum ${JSON.stringify(a)}`)}if("string"==typeof b&&(void 0!==c.minLength&&b.length<c.minLength&&e.push(`${d||"."}: string length ${b.length} < minLength ${c.minLength}`),void 0!==c.maxLength&&b.length>c.maxLength&&e.push(`${d||"."}: string length ${b.length} > maxLength ${c.maxLength}`),void 0!==c.pattern&&(new RegExp(c.pattern).test(b)||e.push(`${d||"."}: string does not match pattern ${c.pattern}`))),"number"==typeof b&&(void 0!==c.minimum&&b<c.minimum&&e.push(`${d||"."}: ${b} < minimum ${c.minimum}`),void 0!==c.maximum&&b>c.maximum&&e.push(`${d||"."}: ${b} > maximum ${c.maximum}`)),"object"==typeof b&&null!==b&&!Array.isArray(b)){if(void 0!==c.required)for(let a of c.required)a in b||e.push(`${d||"."}: missing required property "${a}"`);if(void 0!==c.properties){for(let[f,g]of Object.entries(c.properties))if(f in b){let c=a(b[f],g,`${d}.${f}`);e.push(...c)}}if(!1===c.additionalProperties&&void 0!==c.properties){let a=new Set(Object.keys(c.properties));for(let c of Object.keys(b))a.has(c)||e.push(`${d||"."}: additional property "${c}" not allowed`)}}if(Array.isArray(b)&&(void 0!==c.minItems&&b.length<c.minItems&&e.push(`${d||"."}: array length ${b.length} < minItems ${c.minItems}`),void 0!==c.maxItems&&b.length>c.maxItems&&e.push(`${d||"."}: array length ${b.length} > maxItems ${c.maxItems}`),void 0!==c.items)){let f=c.items;for(let c=0;c<b.length;c++){let g=a(b[c],f,`${d}[${c}]`);e.push(...g)}}return e}(b,c);return{type:"output_schema",passed:0===d.length,expected:c,actual:d.length>0?d:b,message:d.length>0?a.message??`Schema validation failed: ${d.join(", ")}`:void 0}}(e,c?.rawOutput);break;default:b={type:e.type,passed:!1,expected:e.value,actual:null,message:e.message??`Unknown constraint type: ${e.type}`}}d.push(b)}return{passed:d.every(a=>a.passed),results:d,evaluated_at:new Date().toISOString()}}function J(a){let b=a.constraint_result;return{receipt_id:a.receipt_id,action:a.action,agent_id:a.agent_id,timestamp:a.timestamp,description:a.output_summary??`${a.action} by ${a.agent_id}`,cost_usd:a.cost_usd,latency_ms:a.latency_ms,model:a.model,tokens_in:a.tokens_in,tokens_out:a.tokens_out,constraints_passed:b&&"boolean"==typeof b.passed?b.passed:null,receipt:a}}async function K(a,b,c){let d=(await a.list({from:c.from,to:c.to,status:"completed"},1,1e5,"timestamp:asc")).data;if(c.agent_ids&&c.agent_ids.length>0){let a=new Set(c.agent_ids);d=d.filter(b=>a.has(b.agent_id))}if(c.actions&&c.actions.length>0){let a=new Set(c.actions);d=d.filter(b=>a.has(b.action))}c.constraints_passed_only&&(d=d.filter(a=>{let b=a.constraint_result;return!b||!1!==b.passed}));let e=d.map(J),f=function(a,b){if("none"===b){let b=a.reduce((a,b)=>a+(b.cost_usd??0),0);return[{label:"All Items",items:a,subtotal_usd:b,count:a.length}]}let c=new Map;for(let d of a){let a;a="action"===b?d.action:"agent"===b?d.agent_id:d.timestamp.slice(0,10);let e=c.get(a)??[];e.push(d),c.set(a,e)}let d=[];for(let[a,b]of c){let c=b.reduce((a,b)=>a+(b.cost_usd??0),0);d.push({label:a,items:b,subtotal_usd:c,count:b.length})}return d.sort((a,b)=>a.label.localeCompare(b.label))}(e,c.group_by??"none"),g=function(a){let b=0,c=0,d=0,e=0,f=0,g=0,h=0;for(let i of a)b+=i.cost_usd??0,c+=i.tokens_in??0,d+=i.tokens_out??0,e+=i.latency_ms??0,null!==i.constraints_passed&&(f++,i.constraints_passed?g++:h++);return{total_receipts:a.length,total_cost_usd:b,avg_cost_usd:a.length>0?b/a.length:0,total_tokens_in:c,total_tokens_out:d,total_latency_ms:e,avg_latency_ms:a.length>0?e/a.length:0,constraints_evaluated:f,constraints_passed:g,constraints_failed:h}}(e),h=b.getPublicKey();return{invoice_number:function(){let a=new Date,b=a.getFullYear(),c=String(a.getMonth()+1).padStart(2,"0"),d=String(a.getDate()).padStart(2,"0"),e="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",f="";for(let a=0;a<4;a++)f+=e[Math.floor(Math.random()*e.length)];return`AR-${b}${c}${d}-${f}`}(),generated_at:new Date().toISOString(),period:{from:c.from,to:c.to},client:c.client,provider:c.provider,groups:f,summary:g,public_key:h,notes:c.notes,payment_terms:c.payment_terms}}var L=class{constructor(a,b,c){this.store=a,this.keyManager=b,this.configManager=c}async create(a){let b=this.configManager.getConfig(),c=`rcpt_${(0,j.Ak)(12)}`,d=a.chain_id??`chain_${(0,j.Ak)(8)}`,e=new Date().toISOString(),f=a.constraints&&a.constraints.length>0?a.constraints:null,g=a.expires_at;!g&&a.ttl_ms&&(g=new Date(Date.now()+a.ttl_ms).toISOString());let i={...a.metadata??{}};g&&(i.expires_at=g);let k={receipt_id:c,parent_receipt_id:a.parent_receipt_id??null,chain_id:d,receipt_type:a.receipt_type??"action",agent_id:b.agentId,org_id:b.orgId,action:a.action,input_hash:a.input_hash,output_hash:a.output_hash??null,output_summary:a.output_summary??null,model:a.model??null,tokens_in:a.tokens_in??null,tokens_out:a.tokens_out??null,cost_usd:a.cost_usd??null,latency_ms:a.latency_ms??null,tool_calls:a.tool_calls??null,timestamp:e,completed_at:"completed"===a.status?e:null,status:a.status??"pending",error:null,environment:b.environment,tags:a.tags??null,constraints:f?{definitions:f}:null,constraint_result:null,signature:"",verify_url:`local://verify/${c}`,callback_verified:null,confidence:a.confidence??null,metadata:i};"completed"===k.status&&f&&(k.constraint_result=I(k,f,{rawOutput:a._rawOutput}));let l=(0,h.W_)(k);k.signature=(0,h.o3)(l,this.keyManager.getPrivateKey());let m=p.parse(k);return await this.store.save(m),m}async complete(a,b){let c=await this.store.get(a);if(!c)throw Error(`Receipt not found: ${a}`);if("pending"!==c.status)throw Error(`Receipt ${a} is not pending (status: ${c.status})`);let d=new Date().toISOString(),e={...c,status:b.status,completed_at:d,output_hash:b.output_hash??c.output_hash,output_summary:b.output_summary??c.output_summary,model:b.model??c.model,tokens_in:b.tokens_in??c.tokens_in,tokens_out:b.tokens_out??c.tokens_out,cost_usd:b.cost_usd??c.cost_usd,latency_ms:b.latency_ms??c.latency_ms,tool_calls:b.tool_calls??c.tool_calls,confidence:b.confidence??c.confidence,callback_verified:b.callback_verified??c.callback_verified,error:b.error??c.error,metadata:b.metadata?{...c.metadata,...b.metadata}:c.metadata,constraint_result:c.constraint_result},f=c.constraints,g=f?.definitions??null;Array.isArray(g)&&g.length>0&&(e.constraint_result=I(e,g));let i=(0,h.W_)(e);e.signature=(0,h.o3)(i,this.keyManager.getPrivateKey());let j=p.parse(e);return await this.store.save(j),j}async track(a){let b=G(a.input),c=void 0!==a.output?G(a.output):null;return this.create({action:a.action,input_hash:b,output_hash:c,output_summary:a.output_summary??null,model:a.model??null,tokens_in:a.tokens_in??null,tokens_out:a.tokens_out??null,cost_usd:a.cost_usd??null,latency_ms:a.latency_ms??null,tool_calls:a.tool_calls??null,tags:a.tags??null,confidence:a.confidence??null,metadata:a.metadata??{},parent_receipt_id:a.parent_receipt_id??null,chain_id:a.chain_id,status:"completed",constraints:a.constraints,expires_at:a.expires_at,ttl_ms:a.ttl_ms,_rawOutput:a.output})}async verify(a){let b=await this.store.get(a);if(!b)throw Error(`Receipt not found: ${a}`);let c=(0,h.W_)(b);return{verified:(0,h.XF)(c,b.signature,this.keyManager.getPublicKey()),receipt:b}}async get(a){return this.store.get(a)}async list(a,b,c,d){return this.store.list(a,b,c,d)}async getChain(a){return this.store.getChain(a)}async getJudgments(a){return(await this.store.list({parent_receipt_id:a,receipt_type:"judgment"})).data}async cleanup(){let a=await this.store.cleanup();return{deleted:a.deleted,remaining:a.total-a.deleted}}getPublicKey(){return this.keyManager.getPublicKey()}async generateInvoice(a){return K(this.store,this.keyManager,a)}},M=class{constructor(a,b){this.receiptEngine=a,this.memoryStore=b}async observe(a){let b=a.scope??"agent",c=a.confidence??"medium",d=!1,e=this.memoryStore.findEntityByName(a.entityName,a.entityType),f=await this.receiptEngine.create({action:"memory.observe",receipt_type:"memory",input_hash:G({entityName:a.entityName,content:a.content}),status:"completed",metadata:{memory:{memory_operation:"observe",entity_id:e?.entity_id??null,observation_id:null,relationship_id:null,scope:b,query:null,results_count:null,confidence:c}}});e||(e=this.memoryStore.createEntity({entity_id:`ent_${(0,j.Ak)(12)}`,entity_type:a.entityType,name:a.entityName,aliases:[],scope:b,created_at:new Date().toISOString(),created_by_agent:a.agentId,created_by_receipt:f.receipt_id,forgotten_at:null,merged_into:null,attributes:{},metadata:{}}),d=!0);let g=this.memoryStore.addObservation({observation_id:`obs_${(0,j.Ak)(12)}`,entity_id:e.entity_id,content:a.content,confidence:c,source_receipt_id:f.receipt_id,source_agent_id:a.agentId,source_context:a.context??null,observed_at:new Date().toISOString(),forgotten_at:null,forgotten_by:null,superseded_by:null,expires_at:a.ttlSeconds?new Date(Date.now()+1e3*a.ttlSeconds).toISOString():null,tags:a.tags??[],metadata:{}});return{entity:e,observation:g,receipt:f,created_entity:d}}async recall(a){let b={query:a.query,entity_type:a.entityType,entity_id:a.entityId,scope:a.scope,limit:a.limit??20,include_forgotten:!1,page:1},c=this.memoryStore.recall(b),d=await this.receiptEngine.create({action:"memory.recall",receipt_type:"memory",input_hash:G({query:a.query,entityType:a.entityType,entityId:a.entityId}),output_hash:G({entities:c.entities.length,observations:c.observations.length}),status:"completed",metadata:{memory:{memory_operation:"recall",entity_id:a.entityId??null,observation_id:null,relationship_id:null,scope:a.scope??"agent",query:a.query??null,results_count:c.total,confidence:null}}});return{entities:c.entities,observations:c.observations,receipt:d}}async forget(a){let b=a.entityId?"memory.forget_entity":"memory.forget";if(a.entityId)this.memoryStore.forgetEntity(a.entityId,a.agentId);else if(a.observationId)this.memoryStore.forgetObservation(a.observationId,a.agentId);else throw Error("Either entityId or observationId must be provided");return{receipt:await this.receiptEngine.create({action:b,receipt_type:"memory",input_hash:G({entityId:a.entityId,observationId:a.observationId,reason:a.reason}),status:"completed",metadata:{memory:{memory_operation:a.entityId?"forget_entity":"forget",entity_id:a.entityId??null,observation_id:a.observationId??null,relationship_id:null,scope:"agent",query:null,results_count:null,confidence:null},reason:a.reason}})}}async relate(a){let b=await this.receiptEngine.create({action:"memory.relate",receipt_type:"memory",input_hash:G({from:a.fromEntityId,to:a.toEntityId,type:a.relationshipType}),status:"completed",metadata:{memory:{memory_operation:"observe",entity_id:a.fromEntityId,observation_id:null,relationship_id:null,scope:"agent",query:null,results_count:null,confidence:a.strength??"medium"}}});return{relationship:this.memoryStore.addRelationship({relationship_id:`rel_${(0,j.Ak)(12)}`,from_entity_id:a.fromEntityId,to_entity_id:a.toEntityId,relationship_type:a.relationshipType,strength:a.strength??"medium",source_receipt_id:b.receipt_id,created_at:new Date().toISOString(),forgotten_at:null,metadata:a.context?{context:a.context}:{}}),receipt:b}}async merge(a){let b=this.memoryStore.mergeEntities(a.sourceEntityId,a.targetEntityId),c=await this.receiptEngine.create({action:"memory.merge",receipt_type:"memory",input_hash:G({source:a.sourceEntityId,target:a.targetEntityId}),output_hash:G(b),status:"completed",metadata:{memory:{memory_operation:"merge",entity_id:a.targetEntityId,observation_id:null,relationship_id:null,scope:b.scope,query:null,results_count:null,confidence:null}}});return{mergedEntity:b,receipt:c}}provenance(a){return this.memoryStore.getMemoryProvenance(a)}entityTimeline(a){let b=this.memoryStore.getEntityHistory(a),c=this.memoryStore.getRelationships(a),d=[];for(let a of b)d.push({type:a.forgotten_at?"forget":"observation",timestamp:a.observed_at,data:a});for(let a of c)d.push({type:"relationship",timestamp:a.created_at,data:a});return d.sort((a,b)=>a.timestamp.localeCompare(b.timestamp)),d}memoryAudit(a){return this.memoryStore.getMemoryStats(a.agentId,a.from,a.to)}async getContext(a){let b=Math.min(a.maxEntities??10,50),c=Math.min(a.maxObservations??20,100),d=this.memoryStore.getTopEntities(b,a.scope),e=this.memoryStore.getRecentObservations(c,a.agentId),f=this.memoryStore.getActiveRelationships(50),g=this.memoryStore.getPreferenceObservations(20),h=this.memoryStore.getContextStats(),i=await this.receiptEngine.create({action:"memory.context",receipt_type:"memory",input_hash:G({scope:a.scope,maxEntities:b,maxObservations:c}),output_hash:G({entities:d.length,observations:e.length}),status:"completed",metadata:{memory:{memory_operation:"recall",entity_id:null,observation_id:null,relationship_id:null,scope:a.scope??"agent",query:null,results_count:d.length+e.length,confidence:null}}});return{entities:d,recent_observations:e,relationships:f,preferences:g,stats:h,receipt:i}}};function N(a,b=!1){return b?JSON.stringify(a,null,2):JSON.stringify({...a,groups:a.groups.map(a=>({...a,items:a.items.map(({receipt:a,...b})=>b)}))},null,2)}function O(a){let b=[];for(let c of(b.push("receipt_id,action,agent_id,timestamp,description,cost_usd,latency_ms,model,tokens_in,tokens_out,constraints_passed,group"),a.groups))for(let a of c.items)b.push([P(a.receipt_id),P(a.action),P(a.agent_id),P(a.timestamp),P(a.description),a.cost_usd??"",a.latency_ms??"",P(a.model??""),a.tokens_in??"",a.tokens_out??"",a.constraints_passed??"",P(c.label)].join(","));return b.push(""),b.push(`# Invoice: ${a.invoice_number}`),b.push(`# Period: ${a.period.from} to ${a.period.to}`),b.push(`# Total Receipts: ${a.summary.total_receipts}`),b.push(`# Total Cost: $${a.summary.total_cost_usd.toFixed(4)}`),b.join("\n")}function P(a){return a.includes(",")||a.includes('"')||a.includes("\n")?`"${a.replace(/"/g,'""')}"`:a}function Q(a){let b=[];for(let c of(b.push(`# Invoice ${a.invoice_number}`),b.push(""),b.push(`**Generated:** ${a.generated_at}`),b.push(`**Period:** ${a.period.from} to ${a.period.to}`),b.push(""),a.provider&&(b.push("## Provider"),b.push(`**${a.provider.name}**`),a.provider.email&&b.push(`Email: ${a.provider.email}`),a.provider.address&&b.push(`Address: ${a.provider.address}`),b.push("")),a.client&&(b.push("## Bill To"),b.push(`**${a.client.name}**`),a.client.email&&b.push(`Email: ${a.client.email}`),a.client.address&&b.push(`Address: ${a.client.address}`),b.push("")),b.push("---"),b.push(""),a.groups)){for(let a of(b.push(`### ${c.label}`),b.push(""),b.push("| Receipt ID | Action | Agent | Description | Cost |"),b.push("|------------|--------|-------|-------------|------|"),c.items)){let c=null!==a.cost_usd?`$${a.cost_usd.toFixed(4)}`:"-",d=a.description.length>50?a.description.slice(0,47)+"...":a.description;b.push(`| \`${a.receipt_id}\` | ${a.action} | ${a.agent_id} | ${d} | ${c} |`)}b.push(""),b.push(`**Subtotal:** $${c.subtotal_usd.toFixed(4)} (${c.count} items)`),b.push("")}return b.push("---"),b.push(""),b.push("## Summary"),b.push(""),b.push("| Metric | Value |"),b.push("|--------|-------|"),b.push(`| Total Receipts | ${a.summary.total_receipts} |`),b.push(`| Total Cost | $${a.summary.total_cost_usd.toFixed(4)} |`),b.push(`| Avg Cost | $${a.summary.avg_cost_usd.toFixed(4)} |`),b.push(`| Total Tokens (in) | ${a.summary.total_tokens_in} |`),b.push(`| Total Tokens (out) | ${a.summary.total_tokens_out} |`),b.push(`| Avg Latency | ${Math.round(a.summary.avg_latency_ms)}ms |`),a.summary.constraints_evaluated>0&&b.push(`| Constraints Passed | ${a.summary.constraints_passed}/${a.summary.constraints_evaluated} |`),b.push(""),a.notes&&(b.push("## Notes"),b.push(""),b.push(a.notes),b.push("")),a.payment_terms&&(b.push("## Payment Terms"),b.push(""),b.push(a.payment_terms),b.push("")),b.push("---"),b.push(""),b.push("## Verification"),b.push(""),b.push("Every line item is a cryptographically signed receipt that can be independently verified."),b.push(""),b.push(`**Public Key:** \`${a.public_key}\``),b.push(""),b.join("\n")}function R(a){let b=a.provider?`
175
213
  <div class="party">
176
214
  <h3>From</h3>
177
215
  <p class="party-name">${S(a.provider.name)}</p>
@@ -1,8 +1,8 @@
1
- <!DOCTYPE html><!--BZdBWaTjiqh8Heg1_5h6o--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/415fd9a8d5823143.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-631fa6a7d974b7cd.js"/><script src="/_next/static/chunks/8e6518bb-8ba80b673620744d.js" async=""></script><script src="/_next/static/chunks/9743-b93c9a67bf15f28e.js" async=""></script><script src="/_next/static/chunks/main-app-5ae62731e5401157.js" async=""></script><script src="/_next/static/chunks/2702-4afe85cf1319178b.js" async=""></script><script src="/_next/static/chunks/5935-25e4517f9bfb3e54.js" async=""></script><script src="/_next/static/chunks/app/layout-34e5620f9fbf2601.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>Agent Receipts — Mission Control</title><meta name="description" content="Verifiable, signed, immutable proof that an autonomous action happened."/><link rel="icon" href="/icon.svg?766d04f8a781ae61" type="image/svg+xml" sizes="any"/><script>
1
+ <!DOCTYPE html><!--4imcQFGwcLOgYedAyPG7i--><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/90a952694ea5745a.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-631fa6a7d974b7cd.js"/><script src="/_next/static/chunks/8e6518bb-8ba80b673620744d.js" async=""></script><script src="/_next/static/chunks/9743-b93c9a67bf15f28e.js" async=""></script><script src="/_next/static/chunks/main-app-5ae62731e5401157.js" async=""></script><script src="/_next/static/chunks/2702-4afe85cf1319178b.js" async=""></script><script src="/_next/static/chunks/5935-25e4517f9bfb3e54.js" async=""></script><script src="/_next/static/chunks/app/layout-34e5620f9fbf2601.js" async=""></script><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>Agent Receipts — Mission Control</title><meta name="description" content="Verifiable, signed, immutable proof that an autonomous action happened."/><link rel="icon" href="/icon.svg?766d04f8a781ae61" type="image/svg+xml" sizes="any"/><script>
2
2
  try {
3
3
  const theme = localStorage.getItem('theme')
4
4
  if (theme === 'dark' || (!theme && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
5
5
  document.documentElement.classList.add('dark')
6
6
  }
7
7
  } catch {}
8
- </script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div class="flex min-h-screen"><aside class="hidden md:flex flex-col bg-bg-primary border-r border-border h-screen sticky top-0 transition-all duration-200 w-56"><div class="flex items-center h-14 border-b border-border px-4"><a class="flex items-center gap-2 min-w-0" href="/"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-database w-5 h-5 text-primary shrink-0"><ellipse cx="12" cy="5" rx="9" ry="3"></ellipse><path d="M3 5V19A9 3 0 0 0 21 19V5"></path><path d="M3 12A9 3 0 0 0 21 12"></path></svg><span class="font-semibold text-sm text-text-primary truncate">Agent Receipts</span></a></div><nav class="flex-1 py-2 overflow-y-auto"><a class="flex items-center gap-3 px-4 py-2 mx-2 rounded-md text-sm transition-colors text-text-secondary hover:bg-bg-tertiary hover:text-text-primary" href="/"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-layout-dashboard w-4 h-4 shrink-0"><rect width="7" height="9" x="3" y="3" rx="1"></rect><rect width="7" height="5" x="14" y="3" rx="1"></rect><rect width="7" height="9" x="14" y="12" rx="1"></rect><rect width="7" height="5" x="3" y="16" rx="1"></rect></svg><span>Overview</span></a><a class="flex items-center gap-3 px-4 py-2 mx-2 rounded-md text-sm transition-colors text-text-secondary hover:bg-bg-tertiary hover:text-text-primary" href="/receipts"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-receipt w-4 h-4 shrink-0"><path d="M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z"></path><path d="M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8"></path><path d="M12 17.5v-11"></path></svg><span>Receipts</span></a><a class="flex items-center gap-3 px-4 py-2 mx-2 rounded-md text-sm transition-colors text-text-secondary hover:bg-bg-tertiary hover:text-text-primary" href="/chains"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link2 w-4 h-4 shrink-0"><path d="M9 17H7A5 5 0 0 1 7 7h2"></path><path d="M15 7h2a5 5 0 1 1 0 10h-2"></path><line x1="8" x2="16" y1="12" y2="12"></line></svg><span>Chains</span></a><a class="flex items-center gap-3 px-4 py-2 mx-2 rounded-md text-sm transition-colors text-text-secondary hover:bg-bg-tertiary hover:text-text-primary" href="/agents"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bot w-4 h-4 shrink-0"><path d="M12 8V4H8"></path><rect width="16" height="12" x="4" y="8" rx="2"></rect><path d="M2 14h2"></path><path d="M20 14h2"></path><path d="M15 13v2"></path><path d="M9 13v2"></path></svg><span>Agents</span></a><a class="flex items-center gap-3 px-4 py-2 mx-2 rounded-md text-sm transition-colors text-text-secondary hover:bg-bg-tertiary hover:text-text-primary" href="/constraints"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-square-check-big w-4 h-4 shrink-0"><path d="M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5"></path><path d="m9 11 3 3L22 4"></path></svg><span>Constraints</span></a><a class="flex items-center gap-3 px-4 py-2 mx-2 rounded-md text-sm transition-colors text-text-secondary hover:bg-bg-tertiary hover:text-text-primary" href="/judgments"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-scale w-4 h-4 shrink-0"><path d="m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z"></path><path d="m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z"></path><path d="M7 21h10"></path><path d="M12 3v18"></path><path d="M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2"></path></svg><span>Judgments</span></a><a class="flex items-center gap-3 px-4 py-2 mx-2 rounded-md text-sm transition-colors text-text-secondary hover:bg-bg-tertiary hover:text-text-primary" href="/invoices"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-text w-4 h-4 shrink-0"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><path d="M10 9H8"></path><path d="M16 13H8"></path><path d="M16 17H8"></path></svg><span>Invoices</span></a><a class="flex items-center gap-3 px-4 py-2 mx-2 rounded-md text-sm transition-colors text-text-secondary hover:bg-bg-tertiary hover:text-text-primary" href="/memory"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-brain w-4 h-4 shrink-0"><path d="M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"></path><path d="M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"></path><path d="M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"></path><path d="M17.599 6.5a3 3 0 0 0 .399-1.375"></path><path d="M6.003 5.125A3 3 0 0 0 6.401 6.5"></path><path d="M3.477 10.896a4 4 0 0 1 .585-.396"></path><path d="M19.938 10.5a4 4 0 0 1 .585.396"></path><path d="M6 18a4 4 0 0 1-1.967-.516"></path><path d="M19.967 17.484A4 4 0 0 1 18 18"></path></svg><span>Memory</span></a><a class="flex items-center gap-3 px-4 py-2 mx-2 rounded-md text-sm transition-colors text-text-secondary hover:bg-bg-tertiary hover:text-text-primary" href="/verify"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-shield-check w-4 h-4 shrink-0"><path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"></path><path d="m9 12 2 2 4-4"></path></svg><span>Verify</span></a><a class="flex items-center gap-3 px-4 py-2 mx-2 rounded-md text-sm transition-colors text-text-secondary hover:bg-bg-tertiary hover:text-text-primary" href="/settings"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings w-4 h-4 shrink-0"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg><span>Settings</span></a><a class="flex items-center gap-3 px-4 py-2 mx-2 rounded-md text-sm transition-colors text-text-secondary hover:bg-bg-tertiary hover:text-text-primary" href="/how-it-works"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-open w-4 h-4 shrink-0"><path d="M12 7v14"></path><path d="M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z"></path></svg><span>How It Works</span></a></nav><button class="flex items-center justify-center h-10 border-t border-border text-text-muted hover:text-text-secondary transition-colors"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-left w-4 h-4"><path d="m15 18-6-6 6-6"></path></svg></button></aside><div class="flex-1 flex flex-col min-w-0"><div class="w-full bg-amber-500/10 dark:bg-amber-500/20 border-b border-amber-500/30 dark:border-amber-400/30 px-4 py-2 text-center text-sm text-amber-700 dark:text-amber-300">Demo mode — showing sample data.<!-- --> <a href="/get-started" class="underline font-semibold text-amber-800 dark:text-amber-200">Run locally with your own agents →</a></div><header class="h-14 border-b border-border bg-bg-primary flex items-center justify-between px-4 md:px-6 sticky top-0 z-30"><button class="flex items-center gap-2 px-3 py-1.5 rounded-md border border-border bg-bg-secondary text-text-muted text-sm hover:border-text-muted transition-colors max-w-md w-full md:w-80"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-search w-4 h-4 shrink-0"><circle cx="11" cy="11" r="8"></circle><path d="m21 21-4.3-4.3"></path></svg><span class="truncate">Search receipts, agents, chains...</span><kbd class="hidden md:inline-flex ml-auto text-xs border border-border rounded px-1.5 py-0.5 bg-bg-primary text-text-muted">⌘<!-- -->K</kbd></button><div class="flex items-center gap-2"><button class="p-2 rounded-md transition-colors text-success hover:bg-success-subtle" title="Auto-refresh on"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-refresh-cw w-4 h-4 animate-spin" style="animation-duration:3s"><path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"></path><path d="M8 16H3v5"></path></svg></button><button class="p-2 rounded-md text-text-muted hover:bg-bg-tertiary transition-colors" title="Switch to dark mode"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon w-4 h-4"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"></path></svg></button></div></header><main class="flex-1 p-4 md:p-6 pb-20 md:pb-6"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--></main></div><nav class="md:hidden fixed bottom-0 left-0 right-0 z-40 bg-bg-primary border-t border-border"><div class="flex items-center justify-around h-14"><a class="flex flex-col items-center gap-0.5 px-3 py-1 text-xs transition-colors text-text-muted" href="/"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-layout-dashboard w-5 h-5"><rect width="7" height="9" x="3" y="3" rx="1"></rect><rect width="7" height="5" x="14" y="3" rx="1"></rect><rect width="7" height="9" x="14" y="12" rx="1"></rect><rect width="7" height="5" x="3" y="16" rx="1"></rect></svg><span>Overview</span></a><a class="flex flex-col items-center gap-0.5 px-3 py-1 text-xs transition-colors text-text-muted" href="/receipts"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-receipt w-5 h-5"><path d="M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z"></path><path d="M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8"></path><path d="M12 17.5v-11"></path></svg><span>Receipts</span></a><a class="flex flex-col items-center gap-0.5 px-3 py-1 text-xs transition-colors text-text-muted" href="/agents"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bot w-5 h-5"><path d="M12 8V4H8"></path><rect width="16" height="12" x="4" y="8" rx="2"></rect><path d="M2 14h2"></path><path d="M20 14h2"></path><path d="M15 13v2"></path><path d="M9 13v2"></path></svg><span>Agents</span></a><a class="flex flex-col items-center gap-0.5 px-3 py-1 text-xs transition-colors text-text-muted" href="/verify"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-shield-check w-5 h-5"><path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"></path><path d="m9 12 2 2 4-4"></path></svg><span>Verify</span></a><a class="flex flex-col items-center gap-0.5 px-3 py-1 text-xs transition-colors text-text-muted" href="/settings"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings w-5 h-5"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg><span>Settings</span></a></div></nav></div><script src="/_next/static/chunks/webpack-631fa6a7d974b7cd.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[17703,[\"2702\",\"static/chunks/2702-4afe85cf1319178b.js\",\"5935\",\"static/chunks/5935-25e4517f9bfb3e54.js\",\"7177\",\"static/chunks/app/layout-34e5620f9fbf2601.js\"],\"LayoutShell\"]\n3:I[78954,[],\"\"]\n4:I[85640,[],\"\"]\n5:I[62051,[],\"OutletBoundary\"]\n7:I[96658,[],\"AsyncMetadataOutlet\"]\n9:I[62051,[],\"ViewportBoundary\"]\nb:I[62051,[],\"MetadataBoundary\"]\nc:\"$Sreact.suspense\"\ne:I[37698,[],\"\"]\n:HL[\"/_next/static/css/415fd9a8d5823143.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"BZdBWaTjiqh8Heg1_5h6o\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/415fd9a8d5823143.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n try {\\n const theme = localStorage.getItem('theme')\\n if (theme === 'dark' || (!theme \u0026\u0026 window.matchMedia('(prefers-color-scheme: dark)').matches)) {\\n document.documentElement.classList.add('dark')\\n }\\n } catch {}\\n \"}}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L5\",null,{\"children\":[\"$L6\",[\"$\",\"$L7\",null,{\"promise\":\"$@8\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$L9\",null,{\"children\":\"$La\"}],null],[\"$\",\"$Lb\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$c\",null,{\"fallback\":null,\"children\":\"$Ld\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$e\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n6:null\n"])</script><script>self.__next_f.push([1,"f:I[14970,[],\"IconMark\"]\n8:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"Agent Receipts — Mission Control\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Verifiable, signed, immutable proof that an autonomous action happened.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/icon.svg?766d04f8a781ae61\",\"type\":\"image/svg+xml\",\"sizes\":\"any\"}],[\"$\",\"$Lf\",\"3\",{}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"d:\"$8:metadata\"\n"])</script></body></html>
8
+ </script><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div class="flex min-h-screen"><aside class="hidden md:flex flex-col bg-bg-primary border-r border-border h-screen sticky top-0 transition-all duration-200 w-56"><div class="flex items-center h-14 border-b border-border px-4"><a class="flex items-center gap-2 min-w-0" href="/"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-database w-5 h-5 text-primary shrink-0"><ellipse cx="12" cy="5" rx="9" ry="3"></ellipse><path d="M3 5V19A9 3 0 0 0 21 19V5"></path><path d="M3 12A9 3 0 0 0 21 12"></path></svg><span class="font-semibold text-sm text-text-primary truncate">Agent Receipts</span></a></div><nav class="flex-1 py-2 overflow-y-auto"><a class="flex items-center gap-3 px-4 py-2 mx-2 rounded-md text-sm transition-colors text-text-secondary hover:bg-bg-tertiary hover:text-text-primary" href="/"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-layout-dashboard w-4 h-4 shrink-0"><rect width="7" height="9" x="3" y="3" rx="1"></rect><rect width="7" height="5" x="14" y="3" rx="1"></rect><rect width="7" height="9" x="14" y="12" rx="1"></rect><rect width="7" height="5" x="3" y="16" rx="1"></rect></svg><span>Overview</span></a><a class="flex items-center gap-3 px-4 py-2 mx-2 rounded-md text-sm transition-colors text-text-secondary hover:bg-bg-tertiary hover:text-text-primary" href="/receipts"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-receipt w-4 h-4 shrink-0"><path d="M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z"></path><path d="M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8"></path><path d="M12 17.5v-11"></path></svg><span>Receipts</span></a><a class="flex items-center gap-3 px-4 py-2 mx-2 rounded-md text-sm transition-colors text-text-secondary hover:bg-bg-tertiary hover:text-text-primary" href="/chains"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-link2 w-4 h-4 shrink-0"><path d="M9 17H7A5 5 0 0 1 7 7h2"></path><path d="M15 7h2a5 5 0 1 1 0 10h-2"></path><line x1="8" x2="16" y1="12" y2="12"></line></svg><span>Chains</span></a><a class="flex items-center gap-3 px-4 py-2 mx-2 rounded-md text-sm transition-colors text-text-secondary hover:bg-bg-tertiary hover:text-text-primary" href="/agents"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bot w-4 h-4 shrink-0"><path d="M12 8V4H8"></path><rect width="16" height="12" x="4" y="8" rx="2"></rect><path d="M2 14h2"></path><path d="M20 14h2"></path><path d="M15 13v2"></path><path d="M9 13v2"></path></svg><span>Agents</span></a><a class="flex items-center gap-3 px-4 py-2 mx-2 rounded-md text-sm transition-colors text-text-secondary hover:bg-bg-tertiary hover:text-text-primary" href="/constraints"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-square-check-big w-4 h-4 shrink-0"><path d="M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5"></path><path d="m9 11 3 3L22 4"></path></svg><span>Constraints</span></a><a class="flex items-center gap-3 px-4 py-2 mx-2 rounded-md text-sm transition-colors text-text-secondary hover:bg-bg-tertiary hover:text-text-primary" href="/judgments"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-scale w-4 h-4 shrink-0"><path d="m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z"></path><path d="m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z"></path><path d="M7 21h10"></path><path d="M12 3v18"></path><path d="M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2"></path></svg><span>Judgments</span></a><a class="flex items-center gap-3 px-4 py-2 mx-2 rounded-md text-sm transition-colors text-text-secondary hover:bg-bg-tertiary hover:text-text-primary" href="/invoices"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-text w-4 h-4 shrink-0"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><path d="M10 9H8"></path><path d="M16 13H8"></path><path d="M16 17H8"></path></svg><span>Invoices</span></a><a class="flex items-center gap-3 px-4 py-2 mx-2 rounded-md text-sm transition-colors text-text-secondary hover:bg-bg-tertiary hover:text-text-primary" href="/memory"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-brain w-4 h-4 shrink-0"><path d="M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z"></path><path d="M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z"></path><path d="M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4"></path><path d="M17.599 6.5a3 3 0 0 0 .399-1.375"></path><path d="M6.003 5.125A3 3 0 0 0 6.401 6.5"></path><path d="M3.477 10.896a4 4 0 0 1 .585-.396"></path><path d="M19.938 10.5a4 4 0 0 1 .585.396"></path><path d="M6 18a4 4 0 0 1-1.967-.516"></path><path d="M19.967 17.484A4 4 0 0 1 18 18"></path></svg><span>Memory</span></a><a class="flex items-center gap-3 px-4 py-2 mx-2 rounded-md text-sm transition-colors text-text-secondary hover:bg-bg-tertiary hover:text-text-primary" href="/verify"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-shield-check w-4 h-4 shrink-0"><path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"></path><path d="m9 12 2 2 4-4"></path></svg><span>Verify</span></a><a class="flex items-center gap-3 px-4 py-2 mx-2 rounded-md text-sm transition-colors text-text-secondary hover:bg-bg-tertiary hover:text-text-primary" href="/settings"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings w-4 h-4 shrink-0"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg><span>Settings</span></a><a class="flex items-center gap-3 px-4 py-2 mx-2 rounded-md text-sm transition-colors text-text-secondary hover:bg-bg-tertiary hover:text-text-primary" href="/how-it-works"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-open w-4 h-4 shrink-0"><path d="M12 7v14"></path><path d="M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z"></path></svg><span>How It Works</span></a></nav><button class="flex items-center justify-center h-10 border-t border-border text-text-muted hover:text-text-secondary transition-colors"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-chevron-left w-4 h-4"><path d="m15 18-6-6 6-6"></path></svg></button></aside><div class="flex-1 flex flex-col min-w-0"><div class="w-full bg-amber-500/10 dark:bg-amber-500/20 border-b border-amber-500/30 dark:border-amber-400/30 px-4 py-2 text-center text-sm text-amber-700 dark:text-amber-300">Demo mode — showing sample data.<!-- --> <a href="/get-started" class="underline font-semibold text-amber-800 dark:text-amber-200">Run locally with your own agents →</a></div><header class="h-14 border-b border-border bg-bg-primary flex items-center justify-between px-4 md:px-6 sticky top-0 z-30"><button class="flex items-center gap-2 px-3 py-1.5 rounded-md border border-border bg-bg-secondary text-text-muted text-sm hover:border-text-muted transition-colors max-w-md w-full md:w-80"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-search w-4 h-4 shrink-0"><circle cx="11" cy="11" r="8"></circle><path d="m21 21-4.3-4.3"></path></svg><span class="truncate">Search receipts, agents, chains...</span><kbd class="hidden md:inline-flex ml-auto text-xs border border-border rounded px-1.5 py-0.5 bg-bg-primary text-text-muted">⌘<!-- -->K</kbd></button><div class="flex items-center gap-2"><button class="p-2 rounded-md transition-colors text-success hover:bg-success-subtle" title="Auto-refresh on"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-refresh-cw w-4 h-4 animate-spin" style="animation-duration:3s"><path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"></path><path d="M21 3v5h-5"></path><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"></path><path d="M8 16H3v5"></path></svg></button><button class="p-2 rounded-md text-text-muted hover:bg-bg-tertiary transition-colors" title="Switch to dark mode"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon w-4 h-4"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"></path></svg></button></div></header><main class="flex-1 p-4 md:p-6 pb-20 md:pb-6"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--></main></div><nav class="md:hidden fixed bottom-0 left-0 right-0 z-40 bg-bg-primary border-t border-border"><div class="flex items-center justify-around h-14"><a class="flex flex-col items-center gap-0.5 px-3 py-1 text-xs transition-colors text-text-muted" href="/"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-layout-dashboard w-5 h-5"><rect width="7" height="9" x="3" y="3" rx="1"></rect><rect width="7" height="5" x="14" y="3" rx="1"></rect><rect width="7" height="9" x="14" y="12" rx="1"></rect><rect width="7" height="5" x="3" y="16" rx="1"></rect></svg><span>Overview</span></a><a class="flex flex-col items-center gap-0.5 px-3 py-1 text-xs transition-colors text-text-muted" href="/receipts"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-receipt w-5 h-5"><path d="M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z"></path><path d="M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8"></path><path d="M12 17.5v-11"></path></svg><span>Receipts</span></a><a class="flex flex-col items-center gap-0.5 px-3 py-1 text-xs transition-colors text-text-muted" href="/agents"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bot w-5 h-5"><path d="M12 8V4H8"></path><rect width="16" height="12" x="4" y="8" rx="2"></rect><path d="M2 14h2"></path><path d="M20 14h2"></path><path d="M15 13v2"></path><path d="M9 13v2"></path></svg><span>Agents</span></a><a class="flex flex-col items-center gap-0.5 px-3 py-1 text-xs transition-colors text-text-muted" href="/verify"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-shield-check w-5 h-5"><path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"></path><path d="m9 12 2 2 4-4"></path></svg><span>Verify</span></a><a class="flex flex-col items-center gap-0.5 px-3 py-1 text-xs transition-colors text-text-muted" href="/settings"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings w-5 h-5"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg><span>Settings</span></a></div></nav></div><script src="/_next/static/chunks/webpack-631fa6a7d974b7cd.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[17703,[\"2702\",\"static/chunks/2702-4afe85cf1319178b.js\",\"5935\",\"static/chunks/5935-25e4517f9bfb3e54.js\",\"7177\",\"static/chunks/app/layout-34e5620f9fbf2601.js\"],\"LayoutShell\"]\n3:I[78954,[],\"\"]\n4:I[85640,[],\"\"]\n5:I[62051,[],\"OutletBoundary\"]\n7:I[96658,[],\"AsyncMetadataOutlet\"]\n9:I[62051,[],\"ViewportBoundary\"]\nb:I[62051,[],\"MetadataBoundary\"]\nc:\"$Sreact.suspense\"\ne:I[37698,[],\"\"]\n:HL[\"/_next/static/css/90a952694ea5745a.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"4imcQFGwcLOgYedAyPG7i\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/90a952694ea5745a.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"suppressHydrationWarning\":true,\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"script\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"\\n try {\\n const theme = localStorage.getItem('theme')\\n if (theme === 'dark' || (!theme \u0026\u0026 window.matchMedia('(prefers-color-scheme: dark)').matches)) {\\n document.documentElement.classList.add('dark')\\n }\\n } catch {}\\n \"}}]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"children\":[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L3\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L4\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L5\",null,{\"children\":[\"$L6\",[\"$\",\"$L7\",null,{\"promise\":\"$@8\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$L9\",null,{\"children\":\"$La\"}],null],[\"$\",\"$Lb\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$c\",null,{\"fallback\":null,\"children\":\"$Ld\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$e\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"a:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n6:null\n"])</script><script>self.__next_f.push([1,"f:I[14970,[],\"IconMark\"]\n8:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"Agent Receipts — Mission Control\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Verifiable, signed, immutable proof that an autonomous action happened.\"}],[\"$\",\"link\",\"2\",{\"rel\":\"icon\",\"href\":\"/icon.svg?766d04f8a781ae61\",\"type\":\"image/svg+xml\",\"sizes\":\"any\"}],[\"$\",\"$Lf\",\"3\",{}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"d:\"$8:metadata\"\n"])</script></body></html>
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-631fa6a7d974b7cd.js" defer=""></script><script src="/_next/static/chunks/framework-6c19635498a17075.js" defer=""></script><script src="/_next/static/chunks/main-07cb75c461ef6926.js" defer=""></script><script src="/_next/static/chunks/pages/_app-b8da3f21cdb968e8.js" defer=""></script><script src="/_next/static/chunks/pages/_error-797d67047bd0e506.js" defer=""></script><script src="/_next/static/BZdBWaTjiqh8Heg1_5h6o/_buildManifest.js" defer=""></script><script src="/_next/static/BZdBWaTjiqh8Heg1_5h6o/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"BZdBWaTjiqh8Heg1_5h6o","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-631fa6a7d974b7cd.js" defer=""></script><script src="/_next/static/chunks/framework-6c19635498a17075.js" defer=""></script><script src="/_next/static/chunks/main-07cb75c461ef6926.js" defer=""></script><script src="/_next/static/chunks/pages/_app-b8da3f21cdb968e8.js" defer=""></script><script src="/_next/static/chunks/pages/_error-797d67047bd0e506.js" defer=""></script><script src="/_next/static/4imcQFGwcLOgYedAyPG7i/_buildManifest.js" defer=""></script><script src="/_next/static/4imcQFGwcLOgYedAyPG7i/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"4imcQFGwcLOgYedAyPG7i","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>