@rubytech/create-maxy-code 0.1.59 → 0.1.61

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 (284) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/plugins/admin/PLUGIN.md +1 -1
  3. package/payload/platform/plugins/brochures/skills/property-brochure/SKILL.md +26 -3
  4. package/payload/platform/plugins/brochures/skills/property-brochure/references/registers.md +1 -1
  5. package/payload/platform/plugins/docs/references/admin-session.md +2 -2
  6. package/payload/platform/plugins/docs/references/internals.md +1 -1
  7. package/payload/platform/plugins/docs/references/plugins-guide.md +1 -1
  8. package/payload/platform/plugins/epc/.claude-plugin/plugin.json +17 -0
  9. package/payload/platform/plugins/epc/PLUGIN.md +85 -0
  10. package/payload/platform/plugins/epc/mcp/dist/index.d.ts +2 -0
  11. package/payload/platform/plugins/epc/mcp/dist/index.d.ts.map +1 -0
  12. package/payload/platform/plugins/epc/mcp/dist/index.js +117 -0
  13. package/payload/platform/plugins/epc/mcp/dist/index.js.map +1 -0
  14. package/payload/platform/plugins/epc/mcp/dist/lib/crypto.d.ts +3 -0
  15. package/payload/platform/plugins/epc/mcp/dist/lib/crypto.d.ts.map +1 -0
  16. package/payload/platform/plugins/epc/mcp/dist/lib/crypto.js +72 -0
  17. package/payload/platform/plugins/epc/mcp/dist/lib/crypto.js.map +1 -0
  18. package/payload/platform/plugins/epc/mcp/dist/lib/epc-api.d.ts +60 -0
  19. package/payload/platform/plugins/epc/mcp/dist/lib/epc-api.d.ts.map +1 -0
  20. package/payload/platform/plugins/epc/mcp/dist/lib/epc-api.js +181 -0
  21. package/payload/platform/plugins/epc/mcp/dist/lib/epc-api.js.map +1 -0
  22. package/payload/platform/plugins/epc/mcp/dist/lib/file-crypto.d.ts +3 -0
  23. package/payload/platform/plugins/epc/mcp/dist/lib/file-crypto.d.ts.map +1 -0
  24. package/payload/platform/plugins/epc/mcp/dist/lib/file-crypto.js +49 -0
  25. package/payload/platform/plugins/epc/mcp/dist/lib/file-crypto.js.map +1 -0
  26. package/payload/platform/plugins/epc/mcp/dist/lib/key-store.d.ts +15 -0
  27. package/payload/platform/plugins/epc/mcp/dist/lib/key-store.d.ts.map +1 -0
  28. package/payload/platform/plugins/epc/mcp/dist/lib/key-store.js +130 -0
  29. package/payload/platform/plugins/epc/mcp/dist/lib/key-store.js.map +1 -0
  30. package/payload/platform/plugins/epc/mcp/dist/lib/neo4j.d.ts +5 -0
  31. package/payload/platform/plugins/epc/mcp/dist/lib/neo4j.d.ts.map +1 -0
  32. package/payload/platform/plugins/epc/mcp/dist/lib/neo4j.js +38 -0
  33. package/payload/platform/plugins/epc/mcp/dist/lib/neo4j.js.map +1 -0
  34. package/payload/platform/plugins/epc/mcp/dist/tools/key-deregister.d.ts +4 -0
  35. package/payload/platform/plugins/epc/mcp/dist/tools/key-deregister.d.ts.map +1 -0
  36. package/payload/platform/plugins/epc/mcp/dist/tools/key-deregister.js +9 -0
  37. package/payload/platform/plugins/epc/mcp/dist/tools/key-deregister.js.map +1 -0
  38. package/payload/platform/plugins/epc/mcp/dist/tools/key-list.d.ts +4 -0
  39. package/payload/platform/plugins/epc/mcp/dist/tools/key-list.d.ts.map +1 -0
  40. package/payload/platform/plugins/epc/mcp/dist/tools/key-list.js +10 -0
  41. package/payload/platform/plugins/epc/mcp/dist/tools/key-list.js.map +1 -0
  42. package/payload/platform/plugins/epc/mcp/dist/tools/key-register.d.ts +5 -0
  43. package/payload/platform/plugins/epc/mcp/dist/tools/key-register.d.ts.map +1 -0
  44. package/payload/platform/plugins/epc/mcp/dist/tools/key-register.js +36 -0
  45. package/payload/platform/plugins/epc/mcp/dist/tools/key-register.js.map +1 -0
  46. package/payload/platform/plugins/epc/mcp/dist/tools/lookup.d.ts +10 -0
  47. package/payload/platform/plugins/epc/mcp/dist/tools/lookup.d.ts.map +1 -0
  48. package/payload/platform/plugins/epc/mcp/dist/tools/lookup.js +30 -0
  49. package/payload/platform/plugins/epc/mcp/dist/tools/lookup.js.map +1 -0
  50. package/payload/platform/plugins/epc/mcp/package-lock.json +2566 -0
  51. package/payload/platform/plugins/epc/mcp/package.json +21 -0
  52. package/payload/platform/plugins/epc/mcp/src/__tests__/epc-api.test.ts +251 -0
  53. package/payload/platform/plugins/epc/mcp/src/__tests__/key-roundtrip.test.ts +113 -0
  54. package/payload/platform/plugins/epc/mcp/src/__tests__/lookup.test.ts +181 -0
  55. package/payload/platform/plugins/epc/mcp/src/__tests__/schema-parity.test.ts +54 -0
  56. package/payload/platform/plugins/epc/mcp/src/index.ts +156 -0
  57. package/payload/platform/plugins/epc/mcp/src/lib/crypto.ts +79 -0
  58. package/payload/platform/plugins/epc/mcp/src/lib/epc-api.ts +241 -0
  59. package/payload/platform/plugins/epc/mcp/src/lib/file-crypto.ts +55 -0
  60. package/payload/platform/plugins/epc/mcp/src/lib/key-store.ts +172 -0
  61. package/payload/platform/plugins/epc/mcp/src/lib/neo4j.ts +47 -0
  62. package/payload/platform/plugins/epc/mcp/src/tools/key-deregister.ts +9 -0
  63. package/payload/platform/plugins/epc/mcp/src/tools/key-list.ts +10 -0
  64. package/payload/platform/plugins/epc/mcp/src/tools/key-register.ts +44 -0
  65. package/payload/platform/plugins/epc/mcp/src/tools/lookup.ts +43 -0
  66. package/payload/platform/plugins/epc/mcp/tsconfig.json +20 -0
  67. package/payload/platform/plugins/epc/mcp/vitest.config.ts +8 -0
  68. package/payload/platform/plugins/loop/PLUGIN.md +13 -1
  69. package/payload/platform/plugins/loop/mcp/dist/index.js +8 -7
  70. package/payload/platform/plugins/loop/mcp/dist/index.js.map +1 -1
  71. package/payload/platform/plugins/loop/mcp/dist/lib/file-crypto.d.ts +3 -0
  72. package/payload/platform/plugins/loop/mcp/dist/lib/file-crypto.d.ts.map +1 -0
  73. package/payload/platform/plugins/loop/mcp/dist/lib/file-crypto.js +48 -0
  74. package/payload/platform/plugins/loop/mcp/dist/lib/file-crypto.js.map +1 -0
  75. package/payload/platform/plugins/loop/mcp/dist/lib/key-store.d.ts +22 -0
  76. package/payload/platform/plugins/loop/mcp/dist/lib/key-store.d.ts.map +1 -0
  77. package/payload/platform/plugins/loop/mcp/dist/lib/key-store.js +165 -0
  78. package/payload/platform/plugins/loop/mcp/dist/lib/key-store.js.map +1 -0
  79. package/payload/platform/plugins/loop/mcp/dist/lib/loop-api.d.ts +1 -1
  80. package/payload/platform/plugins/loop/mcp/dist/lib/loop-api.d.ts.map +1 -1
  81. package/payload/platform/plugins/loop/mcp/dist/lib/loop-api.js +4 -39
  82. package/payload/platform/plugins/loop/mcp/dist/lib/loop-api.js.map +1 -1
  83. package/payload/platform/plugins/loop/mcp/dist/tools/key-deregister.d.ts.map +1 -1
  84. package/payload/platform/plugins/loop/mcp/dist/tools/key-deregister.js +5 -15
  85. package/payload/platform/plugins/loop/mcp/dist/tools/key-deregister.js.map +1 -1
  86. package/payload/platform/plugins/loop/mcp/dist/tools/key-register.d.ts.map +1 -1
  87. package/payload/platform/plugins/loop/mcp/dist/tools/key-register.js +11 -28
  88. package/payload/platform/plugins/loop/mcp/dist/tools/key-register.js.map +1 -1
  89. package/payload/platform/plugins/loop/mcp/src/index.ts +10 -7
  90. package/payload/platform/plugins/loop/mcp/src/lib/file-crypto.ts +54 -0
  91. package/payload/platform/plugins/loop/mcp/src/lib/key-store.ts +221 -0
  92. package/payload/platform/plugins/loop/mcp/src/lib/loop-api.ts +5 -42
  93. package/payload/platform/plugins/loop/mcp/src/tools/key-deregister.ts +5 -20
  94. package/payload/platform/plugins/loop/mcp/src/tools/key-register.ts +14 -39
  95. package/payload/platform/plugins/preval/.claude-plugin/plugin.json +1 -1
  96. package/payload/platform/plugins/preval/PLUGIN.md +23 -17
  97. package/payload/platform/plugins/preval/skills/property-preval/SKILL.md +78 -38
  98. package/payload/platform/plugins/preval/skills/property-preval/references/render.py +288 -81
  99. package/payload/platform/plugins/preval/skills/property-preval/references/template-inputs.schema.json +125 -80
  100. package/payload/platform/plugins/preval/skills/property-preval/references/template.html +184 -124
  101. package/payload/platform/plugins/property-data/PLUGIN.md +14 -1
  102. package/payload/platform/plugins/property-data/mcp/dist/index.js +14 -11
  103. package/payload/platform/plugins/property-data/mcp/dist/index.js.map +1 -1
  104. package/payload/platform/plugins/property-data/mcp/dist/lib/file-crypto.d.ts +3 -0
  105. package/payload/platform/plugins/property-data/mcp/dist/lib/file-crypto.d.ts.map +1 -0
  106. package/payload/platform/plugins/property-data/mcp/dist/lib/file-crypto.js +49 -0
  107. package/payload/platform/plugins/property-data/mcp/dist/lib/file-crypto.js.map +1 -0
  108. package/payload/platform/plugins/property-data/mcp/dist/lib/key-store.d.ts +15 -0
  109. package/payload/platform/plugins/property-data/mcp/dist/lib/key-store.d.ts.map +1 -0
  110. package/payload/platform/plugins/property-data/mcp/dist/lib/key-store.js +135 -0
  111. package/payload/platform/plugins/property-data/mcp/dist/lib/key-store.js.map +1 -0
  112. package/payload/platform/plugins/property-data/mcp/dist/lib/propertydata-api.d.ts +0 -1
  113. package/payload/platform/plugins/property-data/mcp/dist/lib/propertydata-api.d.ts.map +1 -1
  114. package/payload/platform/plugins/property-data/mcp/dist/lib/propertydata-api.js +11 -22
  115. package/payload/platform/plugins/property-data/mcp/dist/lib/propertydata-api.js.map +1 -1
  116. package/payload/platform/plugins/property-data/mcp/dist/tools/endpoints.d.ts.map +1 -1
  117. package/payload/platform/plugins/property-data/mcp/dist/tools/endpoints.js +2 -2
  118. package/payload/platform/plugins/property-data/mcp/dist/tools/endpoints.js.map +1 -1
  119. package/payload/platform/plugins/property-data/mcp/dist/tools/key-deregister.d.ts.map +1 -1
  120. package/payload/platform/plugins/property-data/mcp/dist/tools/key-deregister.js +5 -15
  121. package/payload/platform/plugins/property-data/mcp/dist/tools/key-deregister.js.map +1 -1
  122. package/payload/platform/plugins/property-data/mcp/dist/tools/key-register.d.ts.map +1 -1
  123. package/payload/platform/plugins/property-data/mcp/dist/tools/key-register.js +30 -23
  124. package/payload/platform/plugins/property-data/mcp/dist/tools/key-register.js.map +1 -1
  125. package/payload/platform/plugins/property-data/mcp/src/index.ts +16 -11
  126. package/payload/platform/plugins/property-data/mcp/src/lib/file-crypto.ts +55 -0
  127. package/payload/platform/plugins/property-data/mcp/src/lib/key-store.ts +181 -0
  128. package/payload/platform/plugins/property-data/mcp/src/lib/propertydata-api.ts +9 -24
  129. package/payload/platform/plugins/property-data/mcp/src/tools/endpoints.ts +2 -2
  130. package/payload/platform/plugins/property-data/mcp/src/tools/key-deregister.ts +5 -17
  131. package/payload/platform/plugins/property-data/mcp/src/tools/key-register.ts +29 -33
  132. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
  133. package/payload/platform/services/claude-session-manager/dist/http-server.js +6 -1
  134. package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
  135. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts +7 -0
  136. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
  137. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +8 -0
  138. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
  139. package/payload/platform/templates/agents/admin/IDENTITY.md +1 -1
  140. package/payload/platform/templates/agents/admin/SOUL.md +1 -1
  141. package/payload/premium-plugins/real-agent/BUNDLE.md +4 -2
  142. package/payload/premium-plugins/real-agent/agents/valuer.md +1 -1
  143. package/payload/premium-plugins/real-agent/plugins/.claude-plugin/marketplace.json +5 -0
  144. package/payload/premium-plugins/real-agent/plugins/brochures/skills/property-brochure/SKILL.md +26 -3
  145. package/payload/premium-plugins/real-agent/plugins/brochures/skills/property-brochure/references/registers.md +1 -1
  146. package/payload/premium-plugins/real-agent/plugins/epc/.claude-plugin/plugin.json +17 -0
  147. package/payload/premium-plugins/real-agent/plugins/epc/PLUGIN.md +85 -0
  148. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/index.d.ts +2 -0
  149. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/index.d.ts.map +1 -0
  150. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/index.js +117 -0
  151. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/index.js.map +1 -0
  152. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/crypto.d.ts +3 -0
  153. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/crypto.d.ts.map +1 -0
  154. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/crypto.js +72 -0
  155. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/crypto.js.map +1 -0
  156. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/epc-api.d.ts +60 -0
  157. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/epc-api.d.ts.map +1 -0
  158. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/epc-api.js +181 -0
  159. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/epc-api.js.map +1 -0
  160. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/file-crypto.d.ts +3 -0
  161. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/file-crypto.d.ts.map +1 -0
  162. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/file-crypto.js +49 -0
  163. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/file-crypto.js.map +1 -0
  164. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/key-store.d.ts +15 -0
  165. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/key-store.d.ts.map +1 -0
  166. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/key-store.js +130 -0
  167. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/key-store.js.map +1 -0
  168. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/neo4j.d.ts +5 -0
  169. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/neo4j.d.ts.map +1 -0
  170. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/neo4j.js +38 -0
  171. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/neo4j.js.map +1 -0
  172. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-deregister.d.ts +4 -0
  173. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-deregister.d.ts.map +1 -0
  174. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-deregister.js +9 -0
  175. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-deregister.js.map +1 -0
  176. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-list.d.ts +4 -0
  177. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-list.d.ts.map +1 -0
  178. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-list.js +10 -0
  179. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-list.js.map +1 -0
  180. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-register.d.ts +5 -0
  181. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-register.d.ts.map +1 -0
  182. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-register.js +36 -0
  183. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-register.js.map +1 -0
  184. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/lookup.d.ts +10 -0
  185. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/lookup.d.ts.map +1 -0
  186. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/lookup.js +30 -0
  187. package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/lookup.js.map +1 -0
  188. package/payload/premium-plugins/real-agent/plugins/epc/mcp/package-lock.json +2566 -0
  189. package/payload/premium-plugins/real-agent/plugins/epc/mcp/package.json +21 -0
  190. package/payload/premium-plugins/real-agent/plugins/epc/mcp/src/__tests__/epc-api.test.ts +251 -0
  191. package/payload/premium-plugins/real-agent/plugins/epc/mcp/src/__tests__/key-roundtrip.test.ts +113 -0
  192. package/payload/premium-plugins/real-agent/plugins/epc/mcp/src/__tests__/lookup.test.ts +181 -0
  193. package/payload/premium-plugins/real-agent/plugins/epc/mcp/src/__tests__/schema-parity.test.ts +54 -0
  194. package/payload/premium-plugins/real-agent/plugins/epc/mcp/src/index.ts +156 -0
  195. package/payload/premium-plugins/real-agent/plugins/epc/mcp/src/lib/crypto.ts +79 -0
  196. package/payload/premium-plugins/real-agent/plugins/epc/mcp/src/lib/epc-api.ts +241 -0
  197. package/payload/premium-plugins/real-agent/plugins/epc/mcp/src/lib/file-crypto.ts +55 -0
  198. package/payload/premium-plugins/real-agent/plugins/epc/mcp/src/lib/key-store.ts +172 -0
  199. package/payload/premium-plugins/real-agent/plugins/epc/mcp/src/lib/neo4j.ts +47 -0
  200. package/payload/premium-plugins/real-agent/plugins/epc/mcp/src/tools/key-deregister.ts +9 -0
  201. package/payload/premium-plugins/real-agent/plugins/epc/mcp/src/tools/key-list.ts +10 -0
  202. package/payload/premium-plugins/real-agent/plugins/epc/mcp/src/tools/key-register.ts +44 -0
  203. package/payload/premium-plugins/real-agent/plugins/epc/mcp/src/tools/lookup.ts +43 -0
  204. package/payload/premium-plugins/real-agent/plugins/epc/mcp/tsconfig.json +20 -0
  205. package/payload/premium-plugins/real-agent/plugins/epc/mcp/vitest.config.ts +8 -0
  206. package/payload/premium-plugins/real-agent/plugins/loop/PLUGIN.md +13 -1
  207. package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/index.js +8 -7
  208. package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/index.js.map +1 -1
  209. package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/file-crypto.d.ts +3 -0
  210. package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/file-crypto.d.ts.map +1 -0
  211. package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/file-crypto.js +48 -0
  212. package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/file-crypto.js.map +1 -0
  213. package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/key-store.d.ts +22 -0
  214. package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/key-store.d.ts.map +1 -0
  215. package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/key-store.js +165 -0
  216. package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/key-store.js.map +1 -0
  217. package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/loop-api.d.ts +1 -1
  218. package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/loop-api.d.ts.map +1 -1
  219. package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/loop-api.js +4 -39
  220. package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/loop-api.js.map +1 -1
  221. package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/tools/key-deregister.d.ts.map +1 -1
  222. package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/tools/key-deregister.js +5 -15
  223. package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/tools/key-deregister.js.map +1 -1
  224. package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/tools/key-register.d.ts.map +1 -1
  225. package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/tools/key-register.js +11 -28
  226. package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/tools/key-register.js.map +1 -1
  227. package/payload/premium-plugins/real-agent/plugins/loop/mcp/src/index.ts +10 -7
  228. package/payload/premium-plugins/real-agent/plugins/loop/mcp/src/lib/file-crypto.ts +54 -0
  229. package/payload/premium-plugins/real-agent/plugins/loop/mcp/src/lib/key-store.ts +221 -0
  230. package/payload/premium-plugins/real-agent/plugins/loop/mcp/src/lib/loop-api.ts +5 -42
  231. package/payload/premium-plugins/real-agent/plugins/loop/mcp/src/tools/key-deregister.ts +5 -20
  232. package/payload/premium-plugins/real-agent/plugins/loop/mcp/src/tools/key-register.ts +14 -39
  233. package/payload/premium-plugins/real-agent/plugins/preval/.claude-plugin/plugin.json +1 -1
  234. package/payload/premium-plugins/real-agent/plugins/preval/PLUGIN.md +23 -17
  235. package/payload/premium-plugins/real-agent/plugins/preval/skills/property-preval/SKILL.md +78 -38
  236. package/payload/premium-plugins/real-agent/plugins/preval/skills/property-preval/references/render.py +288 -81
  237. package/payload/premium-plugins/real-agent/plugins/preval/skills/property-preval/references/template-inputs.schema.json +125 -80
  238. package/payload/premium-plugins/real-agent/plugins/preval/skills/property-preval/references/template.html +184 -124
  239. package/payload/premium-plugins/real-agent/plugins/property-data/PLUGIN.md +14 -1
  240. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/index.js +14 -11
  241. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/index.js.map +1 -1
  242. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/file-crypto.d.ts +3 -0
  243. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/file-crypto.d.ts.map +1 -0
  244. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/file-crypto.js +49 -0
  245. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/file-crypto.js.map +1 -0
  246. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/key-store.d.ts +15 -0
  247. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/key-store.d.ts.map +1 -0
  248. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/key-store.js +135 -0
  249. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/key-store.js.map +1 -0
  250. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/propertydata-api.d.ts +0 -1
  251. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/propertydata-api.d.ts.map +1 -1
  252. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/propertydata-api.js +11 -22
  253. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/propertydata-api.js.map +1 -1
  254. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/endpoints.d.ts.map +1 -1
  255. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/endpoints.js +2 -2
  256. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/endpoints.js.map +1 -1
  257. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-deregister.d.ts.map +1 -1
  258. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-deregister.js +5 -15
  259. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-deregister.js.map +1 -1
  260. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-register.d.ts.map +1 -1
  261. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-register.js +30 -23
  262. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-register.js.map +1 -1
  263. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/index.ts +16 -11
  264. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/lib/file-crypto.ts +55 -0
  265. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/lib/key-store.ts +181 -0
  266. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/lib/propertydata-api.ts +9 -24
  267. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/tools/endpoints.ts +2 -2
  268. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/tools/key-deregister.ts +5 -17
  269. package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/tools/key-register.ts +29 -33
  270. package/payload/server/public/assets/{admin-nqCBFiSl.js → admin-DhN3G8W7.js} +51 -51
  271. package/payload/server/public/assets/{data-BGUAGVkV.js → data-B2ZVXOcE.js} +1 -1
  272. package/payload/server/public/assets/{graph-MvYxZOBF.js → graph-BAMGPHrK.js} +1 -1
  273. package/payload/server/public/assets/{graph-labels-D865qb3K.js → graph-labels-D9eBbvxo.js} +1 -1
  274. package/payload/server/public/assets/{page-C2b1nlOc.js → page-CV27Al6Z.js} +1 -1
  275. package/payload/server/public/assets/{page--hOVRrgN.js → page-DjdVMWCz.js} +1 -1
  276. package/payload/server/public/data.html +3 -3
  277. package/payload/server/public/graph.html +3 -3
  278. package/payload/server/public/index.html +4 -4
  279. package/payload/server/server.js +7 -19
  280. package/payload/premium-plugins/real-agent/lib/mcp-stderr-tee/dist/index.d.ts +0 -51
  281. package/payload/premium-plugins/real-agent/lib/mcp-stderr-tee/dist/index.d.ts.map +0 -1
  282. package/payload/premium-plugins/real-agent/lib/mcp-stderr-tee/dist/index.js +0 -196
  283. package/payload/premium-plugins/real-agent/lib/mcp-stderr-tee/dist/index.js.map +0 -1
  284. package/payload/premium-plugins/real-agent/lib/mcp-stderr-tee/package.json +0 -7
@@ -0,0 +1,49 @@
1
+ import { randomBytes, createCipheriv, createDecipheriv } from "node:crypto";
2
+ import { readFileSync, writeFileSync, existsSync } from "node:fs";
3
+ // Standalone-mode crypto. Same AES-256-GCM envelope as crypto.ts, but the
4
+ // encryption-key file path is passed in (not derived from PLATFORM_ROOT /
5
+ // brand.json), so it can live under ~/.claude/ when the MCP is spawned by
6
+ // Claude Code natively.
7
+ const ALGORITHM = "aes-256-gcm";
8
+ const KEY_LENGTH = 32;
9
+ const IV_LENGTH = 12;
10
+ const AUTH_TAG_LENGTH = 16;
11
+ function loadOrGenerateKey(keyFilePath, label) {
12
+ if (existsSync(keyFilePath)) {
13
+ const hex = readFileSync(keyFilePath, "utf-8").trim();
14
+ const buf = Buffer.from(hex, "hex");
15
+ if (buf.length !== KEY_LENGTH) {
16
+ throw new Error(`[${label}] encryption key at ${keyFilePath} is ${buf.length} bytes, expected ${KEY_LENGTH}.`);
17
+ }
18
+ return buf;
19
+ }
20
+ const key = randomBytes(KEY_LENGTH);
21
+ writeFileSync(keyFilePath, key.toString("hex"), { mode: 0o600 });
22
+ console.error(`[${label}] encryption key generated at ${keyFilePath}`);
23
+ return key;
24
+ }
25
+ export function encryptWith(plaintext, keyFilePath, label) {
26
+ const key = loadOrGenerateKey(keyFilePath, label);
27
+ const iv = randomBytes(IV_LENGTH);
28
+ const cipher = createCipheriv(ALGORITHM, key, iv, { authTagLength: AUTH_TAG_LENGTH });
29
+ let encrypted = cipher.update(plaintext, "utf-8", "hex");
30
+ encrypted += cipher.final("hex");
31
+ const authTag = cipher.getAuthTag().toString("hex");
32
+ return `${iv.toString("hex")}:${encrypted}:${authTag}`;
33
+ }
34
+ export function decryptWith(encryptedValue, keyFilePath, label) {
35
+ const parts = encryptedValue.split(":");
36
+ if (parts.length !== 3) {
37
+ throw new Error(`[${label}] bad encrypted envelope (expected iv:ct:tag)`);
38
+ }
39
+ const key = loadOrGenerateKey(keyFilePath, label);
40
+ const iv = Buffer.from(parts[0], "hex");
41
+ const ciphertext = parts[1];
42
+ const authTag = Buffer.from(parts[2], "hex");
43
+ const decipher = createDecipheriv(ALGORITHM, key, iv, { authTagLength: AUTH_TAG_LENGTH });
44
+ decipher.setAuthTag(authTag);
45
+ let plaintext = decipher.update(ciphertext, "hex", "utf-8");
46
+ plaintext += decipher.final("utf-8");
47
+ return plaintext;
48
+ }
49
+ //# sourceMappingURL=file-crypto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-crypto.js","sourceRoot":"","sources":["../../src/lib/file-crypto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAElE,0EAA0E;AAC1E,0EAA0E;AAC1E,0EAA0E;AAC1E,wBAAwB;AAExB,MAAM,SAAS,GAAG,aAAa,CAAC;AAChC,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,SAAS,GAAG,EAAE,CAAC;A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{
7
+ readonly backendName: string;
8
+ readonly backendPath: string;
9
+ load(accountId: string): Promise<StoredKey | null>;
10
+ save(accountId: string, apiKey: string): Promise<void>;
11
+ delete(accountId: string): Promise<boolean>;
12
+ }
13
+ export declare function selectKeyStore(): KeyStore;
14
+ export declare function _resetKeyStoreForTests(): void;
15
+ //# sourceMappingURL=key-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key-store.d.ts","sourceRoot":"","sources":["../../src/lib/key-store.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IACnD,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7C;AAmJD,wBAAgB,cAAc,IAAI,QAAQ,CAIzC;AAGD,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C"}
@@ -0,0 +1,135 @@
1
+ import { readFileSync, writeFileSync, existsSync, mkdirSync } from "node:fs";
2
+ import { resolve, dirname } from "node:path";
3
+ import { homedir } from "node:os";
4
+ import { getSession } from "./neo4j.js";
5
+ import { encrypt, decrypt } from "./crypto.js";
6
+ import { encryptWith, decryptWith } from "./file-crypto.js";
7
+ class Neo4jKeyStore {
8
+ backendName = "neo4j";
9
+ backendPath = process.env.NEO4J_URI ?? "<unset>";
10
+ async load(accountId) {
11
+ const session = getSession();
12
+ try {
13
+ const result = await session.run(`MATCH (k:PropertyDataKey {accountId: $accountId})
14
+ RETURN k.encryptedKey AS encryptedKey,
15
+ k.createdAt AS createdAt,
16
+ k.updatedAt AS updatedAt`, { accountId });
17
+ if (result.records.length === 0)
18
+ return null;
19
+ const r = result.records[0];
20
+ return {
21
+ apiKey: decrypt(r.get("encryptedKey")),
22
+ createdAt: r.get("createdAt") ?? "",
23
+ updatedAt: r.get("updatedAt") ?? "",
24
+ };
25
+ }
26
+ finally {
27
+ await session.close();
28
+ }
29
+ }
30
+ async save(accountId, apiKey) {
31
+ const encryptedKey = encrypt(apiKey);
32
+ const now = new Date().toISOString();
33
+ const session = getSession();
34
+ try {
35
+ await session.run(`CREATE INDEX property_data_key_account IF NOT EXISTS
36
+ FOR (k:PropertyDataKey) ON (k.accountId)`, {});
37
+ await session.run(`MERGE (k:PropertyDataKey {accountId: $accountId})
38
+ ON CREATE SET k.encryptedKey = $encryptedKey, k.createdAt = $now, k.updatedAt = $now
39
+ ON MATCH SET k.encryptedKey = $encryptedKey, k.updatedAt = $now`, { accountId, encryptedKey, now });
40
+ }
41
+ finally {
42
+ await session.close();
43
+ }
44
+ }
45
+ async delete(accountId) {
46
+ const session = getSession();
47
+ try {
48
+ const result = await session.run(`MATCH (k:PropertyDataKey {accountId: $accountId})
49
+ DELETE k
50
+ RETURN count(k) AS deleted`, { accountId });
51
+ const deleted = result.records[0]?.get("deleted")?.toNumber?.() ?? 0;
52
+ return deleted > 0;
53
+ }
54
+ finally {
55
+ await session.close();
56
+ }
57
+ }
58
+ }
59
+ const LABEL = "property-data";
60
+ class FileKeyStore {
61
+ backendName = "file";
62
+ backendPath;
63
+ storePath;
64
+ keyFilePath;
65
+ constructor() {
66
+ const home = homedir();
67
+ this.storePath = resolve(home, ".claude/.realagent-property-data-key.enc");
68
+ this.keyFilePath = resolve(home, ".claude/.realagent-property-data-encryption-key");
69
+ this.backendPath = this.storePath;
70
+ }
71
+ ensureDir() {
72
+ mkdirSync(dirname(this.storePath), { recursive: true });
73
+ }
74
+ readAll() {
75
+ if (!existsSync(this.storePath))
76
+ return {};
77
+ const blob = readFileSync(this.storePath, "utf-8").trim();
78
+ if (!blob)
79
+ return {};
80
+ const json = decryptWith(blob, this.keyFilePath, LABEL);
81
+ return JSON.parse(json);
82
+ }
83
+ writeAll(env) {
84
+ this.ensureDir();
85
+ const blob = encryptWith(JSON.stringify(env), this.keyFilePath, LABEL);
86
+ writeFileSync(this.storePath, blob, { mode: 0o600 });
87
+ }
88
+ async load(accountId) {
89
+ const env = this.readAll();
90
+ const entry = env[accountId];
91
+ if (!entry)
92
+ return null;
93
+ // The encryptedKey field is double-encrypted: the file blob is decrypted
94
+ // above, the inner field is the original AES-GCM-wrapped key. Keep the
95
+ // inner layer so an unauthenticated read of decrypted JSON still doesn't
96
+ // expose the API key directly in process memory until decryptWith runs.
97
+ return {
98
+ apiKey: decryptWith(entry.encryptedKey, this.keyFilePath, LABEL),
99
+ createdAt: entry.createdAt,
100
+ updatedAt: entry.updatedAt,
101
+ };
102
+ }
103
+ async save(accountId, apiKey) {
104
+ const env = this.readAll();
105
+ const now = new Date().toISOString();
106
+ const encryptedKey = encryptWith(apiKey, this.keyFilePath, LABEL);
107
+ const prev = env[accountId];
108
+ env[accountId] = {
109
+ encryptedKey,
110
+ createdAt: prev?.createdAt ?? now,
111
+ updatedAt: now,
112
+ };
113
+ this.writeAll(env);
114
+ }
115
+ async delete(accountId) {
116
+ const env = this.readAll();
117
+ if (!(accountId in env))
118
+ return false;
119
+ delete env[accountId];
120
+ this.writeAll(env);
121
+ return true;
122
+ }
123
+ }
124
+ let cached = null;
125
+ export function selectKeyStore() {
126
+ if (cached)
127
+ return cached;
128
+ cached = process.env.PROPERTY_DATA_STANDALONE === "1" ? new FileKeyStore() : new Neo4jKeyStore();
129
+ return cached;
130
+ }
131
+ // Test seam — used by unit tests to reset the cached store between cases.
132
+ export function _resetKeyStoreForTests() {
133
+ cached = null;
134
+ }
135
+ //# sourceMappingURL=key-store.js.map
@@ -0,0 +1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;AAED,0EAA0E;AAC1E,MAAM,UAAU,sBAAsB;IACpC,MAAM,GAAG,IAAI,CAAC;AAChB,CAAC"}
@@ -13,7 +13,6 @@ export declare class BadResponseError extends Error {
13
13
  constructor(endpoint: string, length: number);
14
14
  }
15
15
  export interface PropertyDataKey {
16
- encryptedKey: string;
17
16
  createdAt: string;
18
17
  updatedAt: string;
19
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"propertydata-api.d.ts","sourceRoot":"","sources":["../../src/lib/propertydata-api.ts"],"names":[],"mappings":"AAkBA,qBAAa,qBAAsB,SAAQ,KAAK;;CAK/C;AAED,qBAAa,iBAAkB,SAAQ,KAAK;aAExB,MAAM,EAAE,MAAM;aACd,QAAQ,EAAE,MAAM;aAChB,eAAe,EAAE,MAAM;gBAFvB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM;CAK1C;AAED,qBAAa,gBAAiB,SAAQ,KAAK;aACb,QAAQ,EAAE,MAAM;aAAkB,MAAM,EAAE,MAAM;gBAAhD,QAAQ,EAAE,MAAM,EAAkB,MAAM,EAAE,MAAM;CAI7E;AAED,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAoBvF;AAED,wBAAsB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAI7E;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;CACrD;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAkDzE"}
1
+ {"version":3,"file":"propertydata-api.d.ts","sourceRoot":"","sources":["../../src/lib/propertydata-api.ts"],"names":[],"mappings":"AAiBA,qBAAa,qBAAsB,SAAQ,KAAK;;CAK/C;AAED,qBAAa,iBAAkB,SAAQ,KAAK;aAExB,MAAM,EAAE,MAAM;aACd,QAAQ,EAAE,MAAM;aAChB,eAAe,EAAE,MAAM;gBAFvB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM;CAK1C;AAED,qBAAa,gBAAiB,SAAQ,KAAK;aACb,QAAQ,EAAE,MAAM;aAAkB,MAAM,EAAE,MAAM;gBAAhD,QAAQ,EAAE,MAAM,EAAkB,MAAM,EAAE,MAAM;CAI7E;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAIvF;AAED,wBAAsB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAO7E;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;CACrD;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAkDzE"}
@@ -1,5 +1,4 @@
1
- import { getSession } from "./neo4j.js";
2
- import { decrypt } from "./crypto.js";
1
+ import { selectKeyStore } from "./key-store.js";
3
2
  // PropertyData API V1 client. Every endpoint is a GET against
4
3
  // https://api.propertydata.co.uk/<endpoint> with `key=<api-key>` plus
5
4
  // endpoint-specific query params. Response envelope:
@@ -42,30 +41,20 @@ export class BadResponseError extends Error {
42
41
  }
43
42
  }
44
43
  export async function loadAccountKey(accountId) {
45
- const session = getSession();
46
- try {
47
- const result = await session.run(`MATCH (k:PropertyDataKey {accountId: $accountId})
48
- RETURN k.encryptedKey AS encryptedKey,
49
- k.createdAt AS createdAt,
50
- k.updatedAt AS updatedAt`, { accountId });
51
- if (result.records.length === 0)
52
- return null;
53
- const r = result.records[0];
54
- return {
55
- encryptedKey: r.get("encryptedKey"),
56
- createdAt: r.get("createdAt") ?? "",
57
- updatedAt: r.get("updatedAt") ?? "",
58
- };
59
- }
60
- finally {
61
- await session.close();
62
- }
44
+ const stored = await selectKeyStore().load(accountId);
45
+ if (!stored)
46
+ return null;
47
+ return { createdAt: stored.createdAt, updatedAt: stored.updatedAt };
63
48
  }
64
49
  export async function resolveAccountApiKey(accountId) {
65
- const stored = await loadAccountKey(accountId);
50
+ // Bypass for one-shot CLI runs: explicit env var beats stored key.
51
+ const envKey = process.env.PROPERTY_DATA_API_KEY;
52
+ if (envKey && envKey.trim())
53
+ return envKey.trim();
54
+ const stored = await selectKeyStore().load(accountId);
66
55
  if (!stored)
67
56
  throw new KeyNotRegisteredError();
68
- return decrypt(stored.encryptedKey);
57
+ return stored.apiKey;
69
58
  }
70
59
  export async function propertyDataCall(opts) {
71
60
  const { endpoint, toolName, accountId, params } = opts;
@@ -1 +1 @@
1
- {"version":3,"file":"propertydata-api.js","sourceRoot":"","sources":["../../src/lib/propertydata-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,8DAA8D;AAC9D,sEAAsE;AACtE,qDAAqD;AACrD,EAAE;AACF,wCAAwC;AACxC,4CAA4C;AAC5C,EAAE;AACF,uEAAuE;AACvE,yEAAyE;AACzE,wEAAwE;AAC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IAAI,oBAA8D,CAAC;AACpG,eAAO,MAAM,MAAM,GAAI,GAAG,IAAI,oBAA8C,CAAC;AAC7E,eAAO,MAAM,UAAU,GAAI,GAAG,IAAI,oBAAkD,CAAC;AACrF,eAAO,MAAM,UAAU,GAAI,GAAG,IAAI,oBAAwD,CAAC;AAC3F,eAAO,MAAM,MAAM,GAAI,GAAG,IAAI,oBAA8C,CAAC;AAC7E,eAAO,MAAM,MAAM,GAAI,GAAG,IAAI,oBAA8C,CAAC;AAC7E,eAAO,MAAM,MAAM,GAAI,GAAG,IAAI,oBAA8C,CAAC;AAC7E,eAAO,MAAM,WAAW,GAAI,GAAG,IAAI,oBAA2D,CAAC;AAM/F,eAAO,MAAM,YAAY,GAAI,GAAG,IAAI,oBACuB,CAAC;AAC5D,eAAO,MAAM,gBAAgB,GAAI,GAAG,IAAI,oBAC6B,CAAC;AACtE,eAAO,MAAM,KAAK,GAAI,GAAG,IAAI,oBAA4C,CAAC;AAC1E,eAAO,MAAM,SAAS,GAAI,GAAG,IAAI,oBAAsD,CAAC;AACxF,eAAO,MAAM,UAAU,GAAI,GAAG,IAAI,oBAAwD,CAAC;AAC3F,eAAO,MAAM,oBAAoB,GAAI,GAAG,IAAI,oBAC6B,CAAC;AAC1E,eAAO,MAAM,gBAAgB,GAAI,GAAG,IAAI,oBAC2B,CAAC;AACpE,eAAO,MAAM,SAAS,GAAI,GAAG,IAAI,oBAAsD,CAAC;AACxF,eAAO,MAAM,UAAU,GAAI,GAAG,IAAI,oBAAwD,CAAC;AAC3F,eAAO,MAAM,aAAa,GAAI,GAAG,IAAI,oBACsB,CAAC"}
@@ -11,12 +11,12 @@ function call(toolName, endpoint, args) {
11
11
  export const valuationSale = (a) => call("property-data-valuation-sale", "valuation-sale", a);
12
12
  export const valuationRent = (a) => call("property-data-valuation-rent", "valuation-rent", a);
13
13
  export const prices = (a) => call("property-data-prices", "prices", a);
14
- export const pricesRent = (a) => call("property-data-prices-rent", "prices-rent", a);
14
+ export const pricesRent = (a) => call("property-data-prices-rent", "rents", a);
15
15
  export const soldPrices = (a) => call("property-data-sold-prices", "sold-prices", a);
16
16
  export const demand = (a) => call("property-data-demand", "demand", a);
17
17
  export const yields = (a) => call("property-data-yields", "yields", a);
18
18
  export const growth = (a) => call("property-data-growth", "growth", a);
19
- export const nationalHpi = (a) => call("property-data-national-hpi", "national-hpi", a);
19
+ export const nationalHpi = (a) => call("property-data-national-hpi", "national-data", a);
20
20
  // Task 144 — 10 additional read endpoints (£/sqft, area risk,
21
21
  // planning precedent, UPRN, demand-rent, property-type mix).
22
22
  // All inherit the same observability + error contract as above.
@@ -1 +1 @@
1
- {"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../src/tools/endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAQ9D,SAAS,IAAI,CAAC,QAAgB,EAAE,QAAgB,EAAE,IAAU;IAC1D,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;IACpC,OAAO,gBAAgB,CAAC;QACtB,QAAQ;QACR,QAAQ;QACR,SAAS;QACT,MAAM,EAAE,IAAmD;KAC5D,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAO,EAAE,EAAE,CAAC,IAAI,CAAC,8BAA8B,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AACpG,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAO,EAAE,EAAE,CAAC,IAAI,CAAC,8BAA8B,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AACpG,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAO,EAAE,EAAE,CAAC,IAAI,CAAC,sBAAsB,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;AAC7E,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAO,EAAE,EAAE,CAAC,IAAI,CAAC,2BAA2B,EAAE,aAA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O,CAAC,IAAI,CAAC,CAkBhF"}
1
+ {"version":3,"file":"key-deregister.d.ts","sourceRoot":"","sources":["../../src/tools/key-deregister.ts"],"names":[],"mappings":"AAEA,wBAAsB,aAAa,CAAC,MAAM,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAMhF"}
@@ -1,19 +1,9 @@
1
- import { getSession } from "../lib/neo4j.js";
1
+ import { selectKeyStore } from "../lib/key-store.js";
2
2
  export async function keyDeregister(params) {
3
- const { accountId } = params;
4
- const session = getSession();
5
- try {
6
- const result = await session.run(`MATCH (k:PropertyDataKey {accountId: $accountId})
7
- DELETE k
8
- RETURN count(k) AS deleted`, { accountId });
9
- const deleted = result.records[0]?.get("deleted")?.toNumber?.() ?? 0;
10
- if (deleted === 0) {
11
- throw new Error("No PropertyData API key is registered for this account.");
12
- }
3
+ const deleted = await selectKeyStore().delete(params.accountId);
4
+ if (!deleted) {
5
+ throw new Error("No PropertyData API key is registered for this account.");
13
6
  }
14
- finally {
15
- await session.close();
16
- }
17
- console.error(`[property-data] key-op op=deregister account=${accountId}`);
7
+ console.error(`[property-data] key-op op=deregister account=${params.accountId}`);
18
8
  }
19
9
  //# sourceMappingURL=key-deregister.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"key-deregister.js","sourceRoot":"","sources":["../../src/tools/key-deregister.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAA6B;IAC/D,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAC7B,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAC9B;;kCAE4B,EAC5B,EAAE,SAAS,EAAE,CACd,CAAC;QACF,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,IAAI,CAAC,CAAC;QACrE,IAAI,OAAO,KAAK,CAAC,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;QAC7E,CAAC;IACH,CAAC;YAAS,CAAC;QACT,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;IACD,OAAO,CAAC,KAAK,CAAC,gDAAgD,SAAS,EAAE,CAAC,CAAC;AAC7E,CAAC"}
1
+ {"version":3,"file":"key-deregister.js","sourceRoot":"","sources":["../../src/tools/key-deregister.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAA6B;IAC/D,MAAM,OAAO,GAAG,MAAM,cAAc,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAChE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IACD,OAAO,CAAC,KAAK,CAAC,gDAAgD,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;AACpF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"key-register.d.ts","sourceRoot":"","sources":["../../src/tools/key-register.ts"],"names":[],"mappings":"AA2BA,wBAAsB,WAAW,CAAC,MAAM,EAAE;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2BhB"}
1
+ {"version":3,"file":"key-register.d.ts","sourceRoot":"","sources":["../../src/tools/key-register.ts"],"names":[],"mappings":"AA6CA,wBAAsB,WAAW,CAAC,MAAM,EAAE;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CAKhB"}
@@ -1,43 +1,50 @@
1
- import { getSession } from "../lib/neo4j.js";
2
- import { encrypt } from "../lib/crypto.js";
1
+ import { selectKeyStore } from "../lib/key-store.js";
3
2
  import { PropertyDataError } from "../lib/propertydata-api.js";
4
3
  const BASE_URL = "https://api.propertydata.co.uk";
5
4
  const REQUEST_TIMEOUT_MS = 15_000;
6
- // Validate by hitting a cheap endpoint that returns success on any valid key:
7
- // /national-hpi takes no postcode and is rate-cheap. Treat a 200 as the key
8
- // passing PropertyData's authentication check; treat 401/403 as an explicit
9
- // key rejection so the operator gets an actionable message; treat anything
10
- // else as an unverified-key error (network, upstream outage).
5
+ // Validate the key against PropertyData's /valuation-sale endpoint with no
6
+ // inputs a valid key returns HTTP 400 + body code 701 "Missing input:
7
+ // property_type" (proof the key was accepted), without consuming a credit.
8
+ // An invalid key returns auth failure (401/403) or a different upstream code.
9
+ // Evidence: probing `/national-hpi` returns code X01 "Invalid API endpoint"
10
+ // — that path does not exist on PropertyData; `/valuation-sale` does.
11
11
  async function validateApiKey(apiKey) {
12
- const url = `${BASE_URL}/national-hpi?key=${encodeURIComponent(apiKey)}`;
12
+ // Probe /valuation-sale with one input. Evidence-backed envelopes:
13
+ // invalid key → {code:"X03", message:"Invalid input: key"}
14
+ // valid key → {code:"701", message:"Missing input: property_type"} (no credit)
15
+ // PropertyData does not charge for missing-input errors, so this is a free probe.
16
+ const url = `${BASE_URL}/valuation-sale?key=${encodeURIComponent(apiKey)}&postcode=SW1A1AA`;
13
17
  const response = await fetch(url, {
14
18
  headers: { Accept: "application/json" },
15
19
  signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
16
20
  });
21
+ const body = await response.text().catch(() => "");
17
22
  if (response.status === 401 || response.status === 403) {
18
23
  throw new Error(`PropertyData rejected the API key (HTTP ${response.status}).`);
19
24
  }
25
+ let parsed = {};
26
+ try {
27
+ parsed = JSON.parse(body);
28
+ }
29
+ catch { /* fall through */ }
30
+ if (parsed.code === "X03") {
31
+ throw new Error(`PropertyData rejected the API key (code=X03 ${parsed.message ?? "Invalid input: key"}).`);
32
+ }
33
+ // 701 (missing-input) or status:"success" both prove the key was authenticated.
34
+ // Any other envelope: surface raw so the operator sees the upstream error.
35
+ if (parsed.status === "success" || parsed.code === "701")
36
+ return;
37
+ if (parsed.status === "error") {
38
+ throw new Error(`PropertyData validate probe returned unexpected envelope (code=${parsed.code ?? "?"} message=${parsed.message ?? "?"}).`);
39
+ }
20
40
  if (!response.ok) {
21
- const body = await response.text().catch(() => "");
22
- throw new PropertyDataError(response.status, "national-hpi", body.slice(0, 200));
41
+ throw new PropertyDataError(response.status, "valuation-sale", body.slice(0, 200));
23
42
  }
24
43
  }
25
44
  export async function keyRegister(params) {
26
45
  const { apiKey, accountId } = params;
27
46
  await validateApiKey(apiKey);
28
- const encryptedKey = encrypt(apiKey);
29
- const now = new Date().toISOString();
30
- const session = getSession();
31
- try {
32
- await session.run(`CREATE INDEX property_data_key_account IF NOT EXISTS
33
- FOR (k:PropertyDataKey) ON (k.accountId)`, {});
34
- await session.run(`MERGE (k:PropertyDataKey {accountId: $accountId})
35
- ON CREATE SET k.encryptedKey = $encryptedKey, k.createdAt = $now, k.updatedAt = $now
36
- ON MATCH SET k.encryptedKey = $encryptedKey, k.updatedAt = $now`, { accountId, encryptedKey, now });
37
- }
38
- finally {
39
- await session.close();
40
- }
47
+ await selectKeyStore().save(accountId, apiKey);
41
48
  console.error(`[property-data] key-op op=register account=${accountId}`);
42
49
  }
43
50
  //# sourceMappingURL=key-register.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"key-register.js","sourceRoot":"","sources":["../../src/tools/key-register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,QAAQ,GAAG,gCAAgC,CAAC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AC3E,CAAC"}
@@ -1,5 +1,6 @@
1
- import { initStderrTee } from "../../../../../../platform/lib/mcp-stderr-tee/dist/index.js";
2
- initStderrTee("property-data");
1
+ // Logging-tee was a platform-wrapper concern: the platform's mcp-spawn-tee
2
+ // pipes our stderr where it wants. In standalone mode (Claude Code native
3
+ // spawn) the host owns the stderr pipe. Either way, we just write to stderr.
3
4
 
4
5
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
5
6
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
@@ -34,18 +35,22 @@ import {
34
35
  PropertyDataError,
35
36
  BadResponseError,
36
37
  } from "./lib/propertydata-api.js";
38
+ import { selectKeyStore } from "./lib/key-store.js";
37
39
 
38
- const accountId = process.env.ACCOUNT_ID;
39
- if (!accountId) {
40
- throw new Error("ACCOUNT_ID environment variable is required");
41
- }
40
+ // ACCOUNT_ID is the platform's tenant id; in standalone mode (Claude Code
41
+ // native spawn) there is no platform tenant, so "local" is the single-tenant
42
+ // stand-in. Same MCP body, env-selected backend.
43
+ const accountId = process.env.ACCOUNT_ID ?? "local";
42
44
 
43
45
  const server = new McpServer({
44
46
  name: "maxy-property-data",
45
47
  version: "0.1.0",
46
48
  });
47
49
 
48
- console.error(`[property-data] server started, account=${accountId}`);
50
+ const store = selectKeyStore();
51
+ console.error(
52
+ `[property-data] server started, account=${accountId} backend=${store.backendName} path=${store.backendPath}`,
53
+ );
49
54
 
50
55
  function errorEnvelope(err: unknown): { content: { type: "text"; text: string }[]; isError: true } {
51
56
  let text: string;
@@ -67,7 +72,7 @@ function endpointHandler<P extends Record<string, unknown>>(
67
72
  ) {
68
73
  return async (params: P) => {
69
74
  try {
70
- const text = await fn({ ...params, accountId: accountId as string });
75
+ const text = await fn({ ...params, accountId });
71
76
  return { content: [{ type: "text" as const, text }] };
72
77
  } catch (err) {
73
78
  return errorEnvelope(err);
@@ -87,7 +92,7 @@ server.tool(
87
92
  },
88
93
  async ({ apiKey }) => {
89
94
  try {
90
- await keyRegister({ apiKey, accountId: accountId as string });
95
+ await keyRegister({ apiKey, accountId });
91
96
  return {
92
97
  content: [
93
98
  {
@@ -108,7 +113,7 @@ server.tool(
108
113
  {},
109
114
  async () => {
110
115
  try {
111
- await keyDeregister({ accountId: accountId as string });
116
+ await keyDeregister({ accountId });
112
117
  return {
113
118
  content: [{ type: "text" as const, text: "PropertyData API key deregistered." }],
114
119
  };
@@ -124,7 +129,7 @@ server.tool(
124
129
  {},
125
130
  async () => {
126
131
  try {
127
- const text = await keyList({ accountId: accountId as string });
132
+ const text = await keyList({ accountId });
128
133
  return { content: [{ type: "text" as const, text }] };
129
134
  } catch (err) {
130
135
  return errorEnvelope(err);
@@ -0,0 +1,55 @@
1
+ import { randomBytes, createCipheriv, createDecipheriv } from "node:crypto";
2
+ import { readFileSync, writeFileSync, existsSync } from "node:fs";
3
+
4
+ // Standalone-mode crypto. Same AES-256-GCM envelope as crypto.ts, but the
5
+ // encryption-key file path is passed in (not derived from PLATFORM_ROOT /
6
+ // brand.json), so it can live under ~/.claude/ when the MCP is spawned by
7
+ // Claude Code natively.
8
+
9
+ const ALGORITHM = "aes-256-gcm";
10
+ const KEY_LENGTH = 32;
11
+ const IV_LENGTH = 12;
12
+ const AUTH_TAG_LENGTH = 16;
13
+
14
+ function loadOrGenerateKey(keyFilePath: string, label: string): Buffer {
15
+ if (existsSync(keyFilePath)) {
16
+ const hex = readFileSync(keyFilePath, "utf-8").trim();
17
+ const buf = Buffer.from(hex, "hex");
18
+ if (buf.length !== KEY_LENGTH) {
19
+ throw new Error(
20
+ `[${label}] encryption key at ${keyFilePath} is ${buf.length} bytes, expected ${KEY_LENGTH}.`,
21
+ );
22
+ }
23
+ return buf;
24
+ }
25
+ const key = randomBytes(KEY_LENGTH);
26
+ writeFileSync(keyFilePath, key.toString("hex"), { mode: 0o600 });
27
+ console.error(`[${label}] encryption key generated at ${keyFilePath}`);
28
+ return key;
29
+ }
30
+
31
+ export function encryptWith(plaintext: string, keyFilePath: string, label: string): string {
32
+ const key = loadOrGenerateKey(keyFilePath, label);
33
+ const iv = randomBytes(IV_LENGTH);
34
+ const cipher = createCipheriv(ALGORITHM, key, iv, { authTagLength: AUTH_TAG_LENGTH });
35
+ let encrypted = cipher.update(plaintext, "utf-8", "hex");
36
+ encrypted += cipher.final("hex");
37
+ const authTag = cipher.getAuthTag().toString("hex");
38
+ return `${iv.toString("hex")}:${encrypted}:${authTag}`;
39
+ }
40
+
41
+ export function decryptWith(encryptedValue: string, keyFilePath: string, label: string): string {
42
+ const parts = encryptedValue.split(":");
43
+ if (parts.length !== 3) {
44
+ throw new Error(`[${label}] bad encrypted envelope (expected iv:ct:tag)`);
45
+ }
46
+ const key = loadOrGenerateKey(keyFilePath, label);
47
+ const iv = Buffer.from(parts[0], "hex");
48
+ const ciphertext = parts[1];
49
+ const authTag = Buffer.from(parts[2], "hex");
50
+ const decipher = createDecipheriv(ALGORITHM, key, iv, { authTagLength: AUTH_TAG_LENGTH });
51
+ decipher.setAuthTag(authTag);
52
+ let plaintext = decipher.update(ciphertext, "hex", "utf-8");
53
+ plaintext += decipher.final("utf-8");
54
+ return plaintext;
55
+ }