@rubytech/create-maxy-code 0.1.94 → 0.1.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/payload/platform/plugins/.claude-plugin/marketplace.json +0 -5
- package/payload/platform/plugins/admin/PLUGIN.md +1 -0
- package/payload/platform/plugins/cloudflare/.claude-plugin/plugin.json +0 -9
- package/payload/platform/plugins/cloudflare/PLUGIN.md +1 -0
- package/payload/platform/plugins/contacts/PLUGIN.md +1 -0
- package/payload/platform/plugins/email/PLUGIN.md +1 -0
- package/payload/platform/plugins/memory/PLUGIN.md +1 -0
- package/payload/platform/plugins/outlook/PLUGIN.md +1 -0
- package/payload/platform/plugins/replicate/PLUGIN.md +1 -0
- package/payload/platform/plugins/scheduling/PLUGIN.md +1 -0
- package/payload/platform/plugins/telegram/PLUGIN.md +1 -0
- package/payload/platform/plugins/waitlist/PLUGIN.md +1 -0
- package/payload/platform/plugins/whatsapp/.claude-plugin/plugin.json +0 -9
- package/payload/platform/plugins/whatsapp/PLUGIN.md +1 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/__tests__/boot-without-env.test.d.ts +2 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/__tests__/boot-without-env.test.d.ts.map +1 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/__tests__/boot-without-env.test.js +58 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/__tests__/boot-without-env.test.js.map +1 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/index.js +34 -17
- package/payload/platform/plugins/whatsapp/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/whatsapp/mcp/package.json +4 -2
- package/payload/platform/plugins/whatsapp/mcp/vitest.config.ts +9 -0
- package/payload/platform/plugins/work/PLUGIN.md +1 -0
- package/payload/platform/plugins/workflows/PLUGIN.md +1 -0
- package/payload/platform/scripts/smoke-boot-services.sh +59 -0
- package/payload/platform/services/claude-session-manager/dist/fs-watcher.d.ts +1 -1
- package/payload/platform/services/claude-session-manager/dist/fs-watcher.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/fs-watcher.js +20 -9
- package/payload/platform/services/claude-session-manager/dist/fs-watcher.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.d.ts +1 -0
- package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.js +31 -4
- package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
- package/payload/premium-plugins/real-agent/plugins/.claude-plugin/marketplace.json +0 -5
- package/payload/premium-plugins/real-agent/plugins/loop/.claude-plugin/plugin.json +0 -9
- package/payload/premium-plugins/real-agent/plugins/loop/PLUGIN.md +1 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/.claude-plugin/plugin.json +0 -9
- package/payload/premium-plugins/real-agent/plugins/property-data/PLUGIN.md +1 -0
- package/payload/server/public/assets/admin-DXD9jJUJ.js +217 -0
- package/payload/server/public/assets/{data-BK4r8Dqy.js → data-z5dFDssI.js} +1 -1
- package/payload/server/public/assets/{graph-Cb6A8Hhs.js → graph-Cx_4VRyf.js} +1 -1
- package/payload/server/public/assets/graph-labels-CwGbP2gZ.js +1 -0
- package/payload/server/public/assets/{page-BeYR_GI2.js → page-CMT9_HHT.js} +1 -1
- package/payload/server/public/assets/{page-DVNp-Dfy.js → page-rWmmqIUu.js} +2 -2
- package/payload/server/public/data.html +3 -3
- package/payload/server/public/graph.html +3 -3
- package/payload/server/public/index.html +4 -4
- package/payload/platform/plugins/real-agency/plugins/.claude-plugin/marketplace.json +0 -13
- package/payload/platform/plugins/real-agency/plugins/loop/.claude-plugin/plugin.json +0 -17
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/index.d.ts +0 -2
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/index.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/index.js +0 -293
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/index.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.d.ts +0 -10
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.js +0 -88
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.d.ts +0 -82
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.js +0 -427
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.d.ts +0 -5
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.js +0 -40
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.d.ts +0 -10
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.js +0 -24
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.d.ts +0 -16
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.js +0 -35
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.d.ts +0 -5
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.js +0 -19
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.d.ts +0 -4
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.js +0 -14
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.d.ts +0 -9
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.js +0 -60
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.d.ts +0 -13
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.js +0 -41
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.d.ts +0 -9
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.js +0 -16
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.d.ts +0 -15
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.js +0 -11
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.d.ts +0 -10
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.js +0 -39
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.d.ts +0 -9
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.js +0 -125
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.d.ts +0 -18
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.js +0 -87
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.d.ts +0 -10
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.js +0 -82
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.d.ts +0 -12
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.js +0 -32
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.d.ts +0 -15
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.js +0 -11
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.d.ts +0 -16
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.js +0 -41
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.d.ts +0 -13
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.js +0 -49
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.d.ts +0 -7
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.js +0 -19
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.d.ts +0 -5
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.js +0 -32
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.d.ts +0 -14
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.js +0 -11
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.d.ts +0 -9
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.js +0 -85
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.d.ts +0 -13
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.js +0 -44
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.js.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.d.ts +0 -14
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.d.ts.map +0 -1
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.js +0 -18
- package/payload/platform/plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.js.map +0 -1
- package/payload/platform/plugins/tasks/.claude-plugin/plugin.json +0 -17
- package/payload/platform/plugins/tasks/mcp/dist/index.d.ts +0 -2
- package/payload/platform/plugins/tasks/mcp/dist/index.d.ts.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/index.js +0 -543
- package/payload/platform/plugins/tasks/mcp/dist/index.js.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/lib/embeddings.d.ts +0 -7
- package/payload/platform/plugins/tasks/mcp/dist/lib/embeddings.d.ts.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/lib/embeddings.js +0 -24
- package/payload/platform/plugins/tasks/mcp/dist/lib/embeddings.js.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/lib/neo4j.d.ts +0 -5
- package/payload/platform/plugins/tasks/mcp/dist/lib/neo4j.d.ts.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/lib/neo4j.js +0 -40
- package/payload/platform/plugins/tasks/mcp/dist/lib/neo4j.js.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/project-complete.d.ts +0 -17
- package/payload/platform/plugins/tasks/mcp/dist/tools/project-complete.d.ts.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/project-complete.js +0 -76
- package/payload/platform/plugins/tasks/mcp/dist/tools/project-complete.js.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/project-create.d.ts +0 -29
- package/payload/platform/plugins/tasks/mcp/dist/tools/project-create.d.ts.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/project-create.js +0 -235
- package/payload/platform/plugins/tasks/mcp/dist/tools/project-create.js.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/project-get.d.ts +0 -40
- package/payload/platform/plugins/tasks/mcp/dist/tools/project-get.d.ts.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/project-get.js +0 -125
- package/payload/platform/plugins/tasks/mcp/dist/tools/project-get.js.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/project-list.d.ts +0 -26
- package/payload/platform/plugins/tasks/mcp/dist/tools/project-list.d.ts.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/project-list.js +0 -81
- package/payload/platform/plugins/tasks/mcp/dist/tools/project-list.js.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/project-update.d.ts +0 -19
- package/payload/platform/plugins/tasks/mcp/dist/tools/project-update.d.ts.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/project-update.js +0 -102
- package/payload/platform/plugins/tasks/mcp/dist/tools/project-update.js.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/session-list.d.ts +0 -20
- package/payload/platform/plugins/tasks/mcp/dist/tools/session-list.d.ts.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/session-list.js +0 -37
- package/payload/platform/plugins/tasks/mcp/dist/tools/session-list.js.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/session-name.d.ts +0 -12
- package/payload/platform/plugins/tasks/mcp/dist/tools/session-name.d.ts.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/session-name.js +0 -28
- package/payload/platform/plugins/tasks/mcp/dist/tools/session-name.js.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-complete.d.ts +0 -16
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-complete.d.ts.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-complete.js +0 -33
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-complete.js.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-create.d.ts +0 -63
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-create.d.ts.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-create.js +0 -141
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-create.js.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-get.d.ts +0 -19
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-get.d.ts.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-get.js +0 -51
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-get.js.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-list.d.ts +0 -18
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-list.d.ts.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-list.js +0 -66
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-list.js.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-ready.d.ts +0 -21
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-ready.d.ts.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-ready.js +0 -54
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-ready.js.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-relate.d.ts +0 -12
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-relate.d.ts.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-relate.js +0 -59
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-relate.js.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-update.d.ts +0 -32
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-update.d.ts.map +0 -1
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-update.js +0 -112
- package/payload/platform/plugins/tasks/mcp/dist/tools/task-update.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/.claude-plugin/marketplace.json +0 -13
- package/payload/premium-plugins/real-agency/plugins/loop/.claude-plugin/plugin.json +0 -17
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/index.d.ts +0 -2
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/index.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/index.js +0 -293
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/index.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.d.ts +0 -10
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.js +0 -88
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/crypto.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.d.ts +0 -82
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.js +0 -427
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/loop-api.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.d.ts +0 -5
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.js +0 -40
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/lib/neo4j.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.d.ts +0 -10
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.js +0 -24
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/customer-preferences.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.d.ts +0 -16
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.js +0 -35
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/feedback.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.d.ts +0 -5
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.js +0 -19
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-deregister.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.d.ts +0 -4
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.js +0 -14
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-list.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.d.ts +0 -9
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.js +0 -60
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/key-register.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.d.ts +0 -13
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.js +0 -41
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-enquiry.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.d.ts +0 -9
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.js +0 -16
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-batch.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.d.ts +0 -15
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.js +0 -11
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match-request.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.d.ts +0 -10
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.js +0 -39
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/marketing-match.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.d.ts +0 -9
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.js +0 -125
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-detail.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.d.ts +0 -18
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.js +0 -87
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/people-search.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.d.ts +0 -10
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.js +0 -82
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-detail.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.d.ts +0 -12
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.js +0 -32
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-listed.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.d.ts +0 -15
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.js +0 -11
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-request.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.d.ts +0 -16
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.js +0 -41
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/property-search.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.d.ts +0 -13
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.js +0 -49
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/supplier.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.d.ts +0 -7
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.js +0 -19
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-availability.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.d.ts +0 -5
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.js +0 -32
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/team-info.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.d.ts +0 -14
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.js +0 -11
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-create.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.d.ts +0 -9
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.js +0 -85
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-detail.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.d.ts +0 -13
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.js +0 -44
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.d.ts +0 -14
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.js +0 -18
- package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.js.map +0 -1
- package/payload/premium-plugins/real-agent/plugins/epc/.claude-plugin/plugin.json +0 -17
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/index.d.ts +0 -2
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/index.d.ts.map +0 -1
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/index.js +0 -117
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/index.js.map +0 -1
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/crypto.d.ts +0 -3
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/crypto.d.ts.map +0 -1
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/crypto.js +0 -72
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/crypto.js.map +0 -1
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/epc-api.d.ts +0 -60
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/epc-api.d.ts.map +0 -1
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/epc-api.js +0 -181
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/epc-api.js.map +0 -1
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/file-crypto.d.ts +0 -3
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/file-crypto.d.ts.map +0 -1
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/file-crypto.js +0 -49
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/file-crypto.js.map +0 -1
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/key-store.d.ts +0 -15
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/key-store.d.ts.map +0 -1
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/key-store.js +0 -130
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/key-store.js.map +0 -1
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/neo4j.d.ts +0 -5
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/neo4j.d.ts.map +0 -1
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/neo4j.js +0 -38
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/lib/neo4j.js.map +0 -1
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-deregister.d.ts +0 -4
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-deregister.d.ts.map +0 -1
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-deregister.js +0 -9
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-deregister.js.map +0 -1
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-list.d.ts +0 -4
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-list.d.ts.map +0 -1
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-list.js +0 -10
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-list.js.map +0 -1
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-register.d.ts +0 -5
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-register.d.ts.map +0 -1
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-register.js +0 -36
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/key-register.js.map +0 -1
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/lookup.d.ts +0 -10
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/lookup.d.ts.map +0 -1
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/lookup.js +0 -30
- package/payload/premium-plugins/real-agent/plugins/epc/mcp/dist/tools/lookup.js.map +0 -1
- package/payload/server/public/assets/admin-ux6TKHS1.js +0 -217
- package/payload/server/public/assets/graph-labels-DCsUNtnE.js +0 -1
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { aggregateAcrossTeams, formatAggregationResult, loopGet, } from "../lib/loop-api.js";
|
|
2
|
-
export async function viewingSearch(params) {
|
|
3
|
-
const { accountId, department = "both", searchTerm, appointmentStartDate, appointmentEndDate, status, teamName, limit, } = params;
|
|
4
|
-
const result = await aggregateAcrossTeams(accountId, "viewings", "loop-viewing-search", async (apiKey, team) => {
|
|
5
|
-
const depts = department === "both" ? ["sales", "lettings"] : [department];
|
|
6
|
-
const all = [];
|
|
7
|
-
for (const dept of depts) {
|
|
8
|
-
const qp = [];
|
|
9
|
-
if (searchTerm)
|
|
10
|
-
qp.push(`SearchTerm=${encodeURIComponent(searchTerm)}`);
|
|
11
|
-
if (appointmentStartDate)
|
|
12
|
-
qp.push(`AppointmentStartDate=${encodeURIComponent(appointmentStartDate)}`);
|
|
13
|
-
if (appointmentEndDate)
|
|
14
|
-
qp.push(`AppointmentEndDate=${encodeURIComponent(appointmentEndDate)}`);
|
|
15
|
-
if (status)
|
|
16
|
-
qp.push(`Status=${encodeURIComponent(status)}`);
|
|
17
|
-
const query = qp.length > 0 ? `?${qp.join("&")}` : "";
|
|
18
|
-
const path = `/residential/${dept}/viewings${query}`;
|
|
19
|
-
const data = await loopGet(apiKey, path, "loop-viewing-search", team);
|
|
20
|
-
if (Array.isArray(data))
|
|
21
|
-
all.push(...data);
|
|
22
|
-
}
|
|
23
|
-
return all;
|
|
24
|
-
}, { teamName, limitPerTeam: limit ?? 50, limitTotal: limit ?? 200 });
|
|
25
|
-
return formatAggregationResult(result, (v) => {
|
|
26
|
-
const addr = v.propertyAddress ?? "Unknown property";
|
|
27
|
-
const id = v.id != null ? ` [ID: ${v.id}]` : "";
|
|
28
|
-
// dateOfAppointment is ISO datetime e.g. "2026-04-10T15:30:00"
|
|
29
|
-
const when = v.dateOfAppointment
|
|
30
|
-
? formatDateTime(v.dateOfAppointment)
|
|
31
|
-
: "No date";
|
|
32
|
-
const viewStatus = v.status ? ` [${v.status}]` : "";
|
|
33
|
-
const buyer = v.buyerName ? ` — ${v.buyerName}` : "";
|
|
34
|
-
const viewType = v.type ? ` (${v.type})` : "";
|
|
35
|
-
return `- ${addr}${id} — ${when}${viewType}${buyer}${viewStatus}`;
|
|
36
|
-
}, "viewings");
|
|
37
|
-
}
|
|
38
|
-
function formatDateTime(iso) {
|
|
39
|
-
const [datePart, timePart] = iso.split("T");
|
|
40
|
-
if (!timePart)
|
|
41
|
-
return datePart;
|
|
42
|
-
return `${datePart} ${timePart.slice(0, 5)}`;
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=viewing-search.js.map
|
package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-search.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"viewing-search.js","sourceRoot":"","sources":["../../src/tools/viewing-search.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,OAAO,GACR,MAAM,oBAAoB,CAAC;AAuB5B,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MASnC;IACC,MAAM,EACJ,SAAS,EAAE,UAAU,GAAG,MAAM,EAAE,UAAU,EAC1C,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,EAChD,QAAQ,EAAE,KAAK,GAChB,GAAG,MAAM,CAAC;IAEX,MAAM,MAAM,GAAG,MAAM,oBAAoB,CACvC,SAAS,EACT,UAAU,EACV,qBAAqB,EACrB,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;QACrB,MAAM,KAAK,GACT,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;QAC/D,MAAM,GAAG,GAAyB,EAAE,CAAC;QAErC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,EAAE,GAAa,EAAE,CAAC;YACxB,IAAI,UAAU;gBAAE,EAAE,CAAC,IAAI,CAAC,cAAc,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;YACxE,IAAI,oBAAoB;gBAAE,EAAE,CAAC,IAAI,CAAC,wBAAwB,kBAAkB,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC;YACtG,IAAI,kBAAkB;gBAAE,EAAE,CAAC,IAAI,CAAC,sBAAsB,kBAAkB,CAAC,kBAAkB,CAAC,EAAE,CAAC,CA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CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9C,OAAO,KAAK,IAAI,GAAG,EAAE,MAAM,IAAI,GAAG,QAAQ,GAAG,KAAK,GAAG,UAAU,EAAE,CAAC;IACpE,CAAC,EACD,UAAU,CACX,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,GAAW;IACjC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC5C,IAAI,CAAC,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC/B,OAAO,GAAG,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;AAC/C,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
type Department = "sales" | "lettings";
|
|
2
|
-
type FeedbackParty = "buyer" | "seller" | "renter" | "landlord";
|
|
3
|
-
type Action = "note" | "feedback";
|
|
4
|
-
export declare function viewingUpdate(params: {
|
|
5
|
-
accountId: string;
|
|
6
|
-
teamName: string;
|
|
7
|
-
viewingId: number;
|
|
8
|
-
department: Department;
|
|
9
|
-
action: Action;
|
|
10
|
-
text: string;
|
|
11
|
-
feedbackParty?: FeedbackParty;
|
|
12
|
-
}): Promise<string>;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=viewing-update.d.ts.map
|
package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"viewing-update.d.ts","sourceRoot":"","sources":["../../src/tools/viewing-update.ts"],"names":[],"mappings":"AAEA,KAAK,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC;AAKvC,KAAK,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAChE,KAAK,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;AAYlC,wBAAsB,aAAa,CAAC,MAAM,EAAE;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B,GAAG,OAAO,CAAC,MAAM,CAAC,CAwBlB"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { loopPost, withTeamKey } from "../lib/loop-api.js";
|
|
2
|
-
export async function viewingUpdate(params) {
|
|
3
|
-
const { accountId, teamName, viewingId, department, action, text, feedbackParty } = params;
|
|
4
|
-
if (action === "feedback" && !feedbackParty) {
|
|
5
|
-
throw new Error("feedbackParty is required when action is 'feedback'. Use: buyer, seller, renter, or landlord.");
|
|
6
|
-
}
|
|
7
|
-
await withTeamKey(accountId, teamName, "viewings", "loop-viewing-update", async (apiKey) => {
|
|
8
|
-
const suffix = action === "note"
|
|
9
|
-
? "note"
|
|
10
|
-
: `${feedbackParty}-feedback`;
|
|
11
|
-
const path = `/residential/${department}/viewings/${viewingId}/${suffix}`;
|
|
12
|
-
// Loop expects the text as a StringResponse body
|
|
13
|
-
return loopPost(apiKey, path, { result: text }, "loop-viewing-update", teamName);
|
|
14
|
-
});
|
|
15
|
-
const actionLabel = action === "note" ? "Note added" : `${feedbackParty} feedback recorded`;
|
|
16
|
-
return `${actionLabel} for viewing ${viewingId} (${department}) via team "${teamName}".`;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=viewing-update.js.map
|
package/payload/premium-plugins/real-agency/plugins/loop/mcp/dist/tools/viewing-update.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"viewing-update.js","sourceRoot":"","sources":["../../src/tools/viewing-update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAoB3D,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAQnC;IACC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC;IAE3F,IAAI,MAAM,KAAK,UAAU,IAAI,CAAC,aAAa,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,+FAA+F,CAAC,CAAC;IACnH,CAAC;IAED,MAAM,WAAW,CACf,SAAS,EACT,QAAQ,EACR,UAAU,EACV,qBAAqB,EACrB,KAAK,EAAE,MAAM,EAAE,EAAE;QACf,MAAM,MAAM,GAAG,MAAM,KAAK,MAAM;YAC9B,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,GAAG,aAAa,WAAW,CAAC;QAChC,MAAM,IAAI,GAAG,gBAAgB,UAAU,aAAa,SAAS,IAAI,MAAM,EAAE,CAAC;QAC1E,iDAAiD;QACjD,OAAO,QAAQ,CAAsB,MAAM,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,qBAAqB,EAAE,QAAQ,CAAC,CAAC;IACxG,CAAC,CACF,CAAC;IAEF,MAAM,WAAW,GAAG,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,aAAa,oBAAoB,CAAC;IAC5F,OAAO,GAAG,WAAW,gBAAgB,SAAS,KAAK,UAAU,eAAe,QAAQ,IAAI,CAAC;AAC3F,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "epc",
|
|
3
|
-
"description": "epc plugin",
|
|
4
|
-
"version": "0.1.0",
|
|
5
|
-
"author": {
|
|
6
|
-
"name": "Rubytech LLC"
|
|
7
|
-
},
|
|
8
|
-
"mcpServers": {
|
|
9
|
-
"epc": {
|
|
10
|
-
"type": "stdio",
|
|
11
|
-
"command": "node",
|
|
12
|
-
"args": [
|
|
13
|
-
"${CLAUDE_PLUGIN_ROOT}/mcp/dist/index.js"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
|
@@ -1,117 +0,0 @@
|
|
|
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.
|
|
4
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
5
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
import { keyRegister } from "./tools/key-register.js";
|
|
8
|
-
import { keyDeregister } from "./tools/key-deregister.js";
|
|
9
|
-
import { keyList } from "./tools/key-list.js";
|
|
10
|
-
import { epcLookupByAddress, epcLookupByUprn } from "./tools/lookup.js";
|
|
11
|
-
import { closeDriver } from "./lib/neo4j.js";
|
|
12
|
-
import { KeyNotRegisteredError, EpcError, BadResponseError, } from "./lib/epc-api.js";
|
|
13
|
-
import { selectKeyStore } from "./lib/key-store.js";
|
|
14
|
-
const accountId = process.env.ACCOUNT_ID ?? "local";
|
|
15
|
-
const server = new McpServer({
|
|
16
|
-
name: "maxy-epc",
|
|
17
|
-
version: "0.1.0",
|
|
18
|
-
});
|
|
19
|
-
const store = selectKeyStore();
|
|
20
|
-
console.error(`[epc] server started, account=${accountId} backend=${store.backendName} path=${store.backendPath}`);
|
|
21
|
-
function errorEnvelope(err) {
|
|
22
|
-
let text;
|
|
23
|
-
if (err instanceof KeyNotRegisteredError) {
|
|
24
|
-
text =
|
|
25
|
-
"Error: key-not-registered. Register an EPC API key with epc-key-register before calling this tool.";
|
|
26
|
-
}
|
|
27
|
-
else if (err instanceof EpcError) {
|
|
28
|
-
text = `Error: http-${err.status} from EPC register. ${err.upstreamMessage}`;
|
|
29
|
-
}
|
|
30
|
-
else if (err instanceof BadResponseError) {
|
|
31
|
-
text = `Error: bad-response from EPC register (non-JSON, length=${err.length}).`;
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
text = `Error: ${err instanceof Error ? err.message : String(err)}`;
|
|
35
|
-
}
|
|
36
|
-
return { content: [{ type: "text", text }], isError: true };
|
|
37
|
-
}
|
|
38
|
-
// ─────────────────────────────────────────────────────────────────
|
|
39
|
-
// Key management
|
|
40
|
-
// ─────────────────────────────────────────────────────────────────
|
|
41
|
-
server.tool("epc-key-register", "Register the account's EPC register credential. The credential is the email that generated the API key on the EPC dashboard, a colon, then the API key (format: email:api-key). Validates against the EPC register, encrypts with AES-256-GCM, and stores in Neo4j. One credential per account; re-registering overwrites.", {
|
|
42
|
-
apiKey: z
|
|
43
|
-
.string()
|
|
44
|
-
.min(8)
|
|
45
|
-
.describe("EPC credential in the form email:api-key. The email is the account that generated the key at epc.opendatacommunities.org."),
|
|
46
|
-
}, async ({ apiKey }) => {
|
|
47
|
-
try {
|
|
48
|
-
await keyRegister({ apiKey, accountId });
|
|
49
|
-
return {
|
|
50
|
-
content: [
|
|
51
|
-
{ type: "text", text: "EPC API key registered successfully." },
|
|
52
|
-
],
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
catch (err) {
|
|
56
|
-
return errorEnvelope(err);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
server.tool("epc-key-deregister", "Remove the account's EPC API credential. The encrypted credential is permanently deleted from Neo4j.", {}, async () => {
|
|
60
|
-
try {
|
|
61
|
-
await keyDeregister({ accountId });
|
|
62
|
-
return {
|
|
63
|
-
content: [{ type: "text", text: "EPC API key deregistered." }],
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
catch (err) {
|
|
67
|
-
return errorEnvelope(err);
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
server.tool("epc-key-list", "Show whether an EPC API credential is registered for this account. Never reveals the credential value.", {}, async () => {
|
|
71
|
-
try {
|
|
72
|
-
const text = await keyList({ accountId });
|
|
73
|
-
return { content: [{ type: "text", text }] };
|
|
74
|
-
}
|
|
75
|
-
catch (err) {
|
|
76
|
-
return errorEnvelope(err);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
// ─────────────────────────────────────────────────────────────────
|
|
80
|
-
// Lookup
|
|
81
|
-
// ─────────────────────────────────────────────────────────────────
|
|
82
|
-
server.tool("epc-lookup-by-address", "Look up the most recent Energy Performance Certificate per matched property for a UK address. Returns total_floor_area_m2, total_floor_area_sqft (m² × 10.7639), current and potential energy ratings, lodgement date, address, and UPRN. Multiple matches surface as an array. Zero matches return an empty array with status ok. Use to derive subject-property sqft for preval valuation.", {
|
|
83
|
-
address: z.string().min(2).describe("UK address line one (street and house number / name)"),
|
|
84
|
-
postcode: z
|
|
85
|
-
.string()
|
|
86
|
-
.optional()
|
|
87
|
-
.describe("Full UK postcode (optional but recommended to narrow matches)"),
|
|
88
|
-
}, async ({ address, postcode }) => {
|
|
89
|
-
try {
|
|
90
|
-
const text = await epcLookupByAddress({ accountId, address, postcode });
|
|
91
|
-
return { content: [{ type: "text", text }] };
|
|
92
|
-
}
|
|
93
|
-
catch (err) {
|
|
94
|
-
return errorEnvelope(err);
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
server.tool("epc-lookup-by-uprn", "Look up the most recent Energy Performance Certificate for a specific UPRN. Returns the same shape as epc-lookup-by-address. Use when the property's UPRN is already known from property-data-address-match-uprn or Land Registry.", {
|
|
98
|
-
uprn: z.string().min(1).describe("UK Unique Property Reference Number"),
|
|
99
|
-
}, async ({ uprn }) => {
|
|
100
|
-
try {
|
|
101
|
-
const text = await epcLookupByUprn({ accountId, uprn });
|
|
102
|
-
return { content: [{ type: "text", text }] };
|
|
103
|
-
}
|
|
104
|
-
catch (err) {
|
|
105
|
-
return errorEnvelope(err);
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
// ─────────────────────────────────────────────────────────────────
|
|
109
|
-
// Lifecycle
|
|
110
|
-
// ─────────────────────────────────────────────────────────────────
|
|
111
|
-
process.on("SIGINT", async () => {
|
|
112
|
-
await closeDriver();
|
|
113
|
-
process.exit(0);
|
|
114
|
-
});
|
|
115
|
-
const transport = new StdioServerTransport();
|
|
116
|
-
await server.connect(transport);
|
|
117
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,0EAA0E;AAC1E,6EAA6E;AAE7E,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,qBAAqB,EACrB,QAAQ,EACR,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,OAAO,CAAC;AAEpD,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AAC,CAAC;AAEH,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/lib/crypto.ts"],"names":[],"mappings":"AAgDA,wBAAgB,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAQjD;AAED,wBAAgB,OAAO,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAoBtD"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { randomBytes, createCipheriv, createDecipheriv } from "node:crypto";
|
|
2
|
-
import { readFileSync, writeFileSync, existsSync } from "node:fs";
|
|
3
|
-
import { resolve } from "node:path";
|
|
4
|
-
import { homedir } from "node:os";
|
|
5
|
-
const ALGORITHM = "aes-256-gcm";
|
|
6
|
-
const KEY_LENGTH = 32;
|
|
7
|
-
const IV_LENGTH = 12;
|
|
8
|
-
const AUTH_TAG_LENGTH = 16;
|
|
9
|
-
const KEY_FILE_NAME = ".epc-encryption-key";
|
|
10
|
-
function resolveConfigDir() {
|
|
11
|
-
try {
|
|
12
|
-
const platformRoot = process.env.PLATFORM_ROOT;
|
|
13
|
-
if (platformRoot) {
|
|
14
|
-
const brandPath = resolve(platformRoot, "config/brand.json");
|
|
15
|
-
const brand = JSON.parse(readFileSync(brandPath, "utf-8"));
|
|
16
|
-
if (brand.configDir)
|
|
17
|
-
return brand.configDir;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
catch {
|
|
21
|
-
// Fall back to default
|
|
22
|
-
}
|
|
23
|
-
return ".maxy";
|
|
24
|
-
}
|
|
25
|
-
function keyFilePath() {
|
|
26
|
-
return resolve(homedir(), resolveConfigDir(), KEY_FILE_NAME);
|
|
27
|
-
}
|
|
28
|
-
function loadOrGenerateKey() {
|
|
29
|
-
const path = keyFilePath();
|
|
30
|
-
if (existsSync(path)) {
|
|
31
|
-
const hex = readFileSync(path, "utf-8").trim();
|
|
32
|
-
const buf = Buffer.from(hex, "hex");
|
|
33
|
-
if (buf.length !== KEY_LENGTH) {
|
|
34
|
-
throw new Error(`Encryption key at ${path} is ${buf.length} bytes, expected ${KEY_LENGTH}. ` +
|
|
35
|
-
`Delete the file and re-register the EPC API key.`);
|
|
36
|
-
}
|
|
37
|
-
return buf;
|
|
38
|
-
}
|
|
39
|
-
const key = randomBytes(KEY_LENGTH);
|
|
40
|
-
writeFileSync(path, key.toString("hex"), { mode: 0o600 });
|
|
41
|
-
console.error(`[epc] encryption key generated at ${path}`);
|
|
42
|
-
return key;
|
|
43
|
-
}
|
|
44
|
-
export function encrypt(plaintext) {
|
|
45
|
-
const key = loadOrGenerateKey();
|
|
46
|
-
const iv = randomBytes(IV_LENGTH);
|
|
47
|
-
const cipher = createCipheriv(ALGORITHM, key, iv, { authTagLength: AUTH_TAG_LENGTH });
|
|
48
|
-
let encrypted = cipher.update(plaintext, "utf-8", "hex");
|
|
49
|
-
encrypted += cipher.final("hex");
|
|
50
|
-
const authTag = cipher.getAuthTag().toString("hex");
|
|
51
|
-
return `${iv.toString("hex")}:${encrypted}:${authTag}`;
|
|
52
|
-
}
|
|
53
|
-
export function decrypt(encryptedValue) {
|
|
54
|
-
const parts = encryptedValue.split(":");
|
|
55
|
-
if (parts.length !== 3) {
|
|
56
|
-
throw new Error("Malformed encrypted value — expected iv:ciphertext:authTag");
|
|
57
|
-
}
|
|
58
|
-
const [ivHex, ciphertextHex, authTagHex] = parts;
|
|
59
|
-
const path = keyFilePath();
|
|
60
|
-
if (!existsSync(path)) {
|
|
61
|
-
throw new Error(`Encryption key not found at ${path}. The stored EPC API key is unrecoverable. Re-register.`);
|
|
62
|
-
}
|
|
63
|
-
const key = loadOrGenerateKey();
|
|
64
|
-
const iv = Buffer.from(ivHex, "hex");
|
|
65
|
-
const authTag = Buffer.from(authTagHex, "hex");
|
|
66
|
-
const decipher = createDecipheriv(ALGORITHM, key, iv, { authTagLength: AUTH_TAG_LENGTH });
|
|
67
|
-
decipher.setAuthTag(authTag);
|
|
68
|
-
let decrypted = decipher.update(ciphertextHex, "hex", "utf-8");
|
|
69
|
-
decrypted += decipher.final("utf-8");
|
|
70
|
-
return decrypted;
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=crypto.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src/lib/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;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,MAAM,SAAS,GAAG,aAAa,CAAC;AAChC,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB,MAAM,eAAe,GAAG,EAAE,CAAC;AAC3B,MAAM,aAAa,GAAG,qBAAqB,CAAC;AAE5C,SAAS,gBAAgB;IACvB,IAAI,CAAC;QACH,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;QAC/C,IAAI,YAAY,EAAE,CAAC;YACjB,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,EAAE,mBAAmB,CAAC,CAAC;YAC7D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;YAC3D,IAAI,KAAK,CAAC,SAAS;gBAAE,OAAO,KAAK,CAAC,SAAS,CAAC;QAC9C,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,uBAAuB;IACzB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAA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;AACnB,CAAC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
export declare const BASE_URL = "https://epc.opendatacommunities.org/api/v1";
|
|
2
|
-
export declare const REQUEST_TIMEOUT_MS = 15000;
|
|
3
|
-
export declare const M2_TO_SQFT = 10.7639;
|
|
4
|
-
export declare class KeyNotRegisteredError extends Error {
|
|
5
|
-
constructor();
|
|
6
|
-
}
|
|
7
|
-
export declare class EpcError extends Error {
|
|
8
|
-
readonly status: number;
|
|
9
|
-
readonly endpoint: string;
|
|
10
|
-
readonly upstreamMessage: string;
|
|
11
|
-
constructor(status: number, endpoint: string, upstreamMessage: string);
|
|
12
|
-
}
|
|
13
|
-
export declare class BadResponseError extends Error {
|
|
14
|
-
readonly endpoint: string;
|
|
15
|
-
readonly length: number;
|
|
16
|
-
constructor(endpoint: string, length: number);
|
|
17
|
-
}
|
|
18
|
-
export interface EpcKeyMeta {
|
|
19
|
-
createdAt: string;
|
|
20
|
-
updatedAt: string;
|
|
21
|
-
}
|
|
22
|
-
export declare function loadAccountKey(accountId: string): Promise<EpcKeyMeta | null>;
|
|
23
|
-
export declare function resolveAccountApiKey(accountId: string): Promise<string>;
|
|
24
|
-
export interface EpcRow {
|
|
25
|
-
"lmk-key"?: string;
|
|
26
|
-
address1?: string;
|
|
27
|
-
address2?: string;
|
|
28
|
-
address3?: string;
|
|
29
|
-
posttown?: string;
|
|
30
|
-
postcode?: string;
|
|
31
|
-
uprn?: string;
|
|
32
|
-
"current-energy-rating"?: string;
|
|
33
|
-
"potential-energy-rating"?: string;
|
|
34
|
-
"lodgement-date"?: string;
|
|
35
|
-
"total-floor-area"?: string;
|
|
36
|
-
[k: string]: unknown;
|
|
37
|
-
}
|
|
38
|
-
export interface EpcSearchOptions {
|
|
39
|
-
toolName: string;
|
|
40
|
-
accountId: string;
|
|
41
|
-
identifier: string;
|
|
42
|
-
params: Record<string, string | number | undefined>;
|
|
43
|
-
}
|
|
44
|
-
interface CallResult {
|
|
45
|
-
status: number;
|
|
46
|
-
rows: EpcRow[];
|
|
47
|
-
}
|
|
48
|
-
export declare function epcSearch(opts: EpcSearchOptions): Promise<CallResult>;
|
|
49
|
-
export interface EpcMatch {
|
|
50
|
-
total_floor_area_m2: number | null;
|
|
51
|
-
total_floor_area_sqft: number | null;
|
|
52
|
-
current_energy_rating: string | null;
|
|
53
|
-
potential_energy_rating: string | null;
|
|
54
|
-
lodgement_date: string | null;
|
|
55
|
-
address: string;
|
|
56
|
-
uprn: string | null;
|
|
57
|
-
}
|
|
58
|
-
export declare function groupAndPickMostRecent(rows: EpcRow[]): EpcMatch[];
|
|
59
|
-
export {};
|
|
60
|
-
//# sourceMappingURL=epc-api.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"epc-api.d.ts","sourceRoot":"","sources":["../../src/lib/epc-api.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,QAAQ,+CAA+C,CAAC;AACrE,eAAO,MAAM,kBAAkB,QAAS,CAAC;AACzC,eAAO,MAAM,UAAU,UAAU,CAAC;AAElC,qBAAa,qBAAsB,SAAQ,KAAK;;CAK/C;AAED,qBAAa,QAAS,SAAQ,KAAK;aAEf,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,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAIlF;AAED,wBAAsB,oBAAoB,CAAC,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AAG,IAAI,CAAC;CACrB;AAsBD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAuCjE"}
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import { selectKeyStore } from "./key-store.js";
|
|
2
|
-
// gov.uk EPC register HTTP client. The register lives at
|
|
3
|
-
// epc.opendatacommunities.org and is reached via Basic auth where the
|
|
4
|
-
// credential is `<email>:<api-key>` (the email is the account that
|
|
5
|
-
// generated the key on the dashboard). We store the credential as a single
|
|
6
|
-
// colon-joined string so the key-management surface mirrors property-data
|
|
7
|
-
// exactly (one `apiKey` field per account).
|
|
8
|
-
//
|
|
9
|
-
// Response shape (domestic/search):
|
|
10
|
-
// { "column-names": [...], "rows": [ { "lmk-key": "...",
|
|
11
|
-
// "address1": "...", "address2": "...", "address3": "...",
|
|
12
|
-
// "posttown": "...", "postcode": "...", "uprn": "...",
|
|
13
|
-
// "current-energy-rating": "C", "potential-energy-rating": "B",
|
|
14
|
-
// "lodgement-date": "2023-05-15", "total-floor-area": "75.0", ... } ] }
|
|
15
|
-
//
|
|
16
|
-
// Multiple EPCs per property appear as separate rows (one per lodgement).
|
|
17
|
-
// Callers group by UPRN (or address fallback) and pick the most-recent
|
|
18
|
-
// row per property.
|
|
19
|
-
export const BASE_URL = "https://epc.opendatacommunities.org/api/v1";
|
|
20
|
-
export const REQUEST_TIMEOUT_MS = 15_000;
|
|
21
|
-
export const M2_TO_SQFT = 10.7639;
|
|
22
|
-
export class KeyNotRegisteredError extends Error {
|
|
23
|
-
constructor() {
|
|
24
|
-
super("key-not-registered");
|
|
25
|
-
this.name = "KeyNotRegisteredError";
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export class EpcError extends Error {
|
|
29
|
-
status;
|
|
30
|
-
endpoint;
|
|
31
|
-
upstreamMessage;
|
|
32
|
-
constructor(status, endpoint, upstreamMessage) {
|
|
33
|
-
super(`http-${status} from EPC endpoint=${endpoint}: ${upstreamMessage}`);
|
|
34
|
-
this.status = status;
|
|
35
|
-
this.endpoint = endpoint;
|
|
36
|
-
this.upstreamMessage = upstreamMessage;
|
|
37
|
-
this.name = "EpcError";
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
export class BadResponseError extends Error {
|
|
41
|
-
endpoint;
|
|
42
|
-
length;
|
|
43
|
-
constructor(endpoint, length) {
|
|
44
|
-
super(`bad-response from EPC endpoint=${endpoint} (non-JSON, length=${length})`);
|
|
45
|
-
this.endpoint = endpoint;
|
|
46
|
-
this.length = length;
|
|
47
|
-
this.name = "BadResponseError";
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
export async function loadAccountKey(accountId) {
|
|
51
|
-
const stored = await selectKeyStore().load(accountId);
|
|
52
|
-
if (!stored)
|
|
53
|
-
return null;
|
|
54
|
-
return { createdAt: stored.createdAt, updatedAt: stored.updatedAt };
|
|
55
|
-
}
|
|
56
|
-
export async function resolveAccountApiKey(accountId) {
|
|
57
|
-
const envKey = process.env.EPC_API_KEY;
|
|
58
|
-
if (envKey && envKey.trim())
|
|
59
|
-
return envKey.trim();
|
|
60
|
-
const stored = await selectKeyStore().load(accountId);
|
|
61
|
-
if (!stored)
|
|
62
|
-
throw new KeyNotRegisteredError();
|
|
63
|
-
return stored.apiKey;
|
|
64
|
-
}
|
|
65
|
-
function basicAuthHeader(credential) {
|
|
66
|
-
return `Basic ${Buffer.from(credential, "utf-8").toString("base64")}`;
|
|
67
|
-
}
|
|
68
|
-
export async function epcSearch(opts) {
|
|
69
|
-
const { toolName, accountId, identifier, params } = opts;
|
|
70
|
-
const credential = await resolveAccountApiKey(accountId);
|
|
71
|
-
const search = new URLSearchParams();
|
|
72
|
-
for (const [k, v] of Object.entries(params)) {
|
|
73
|
-
if (v === undefined || v === null || v === "")
|
|
74
|
-
continue;
|
|
75
|
-
search.set(k, String(v));
|
|
76
|
-
}
|
|
77
|
-
const endpoint = "domestic/search";
|
|
78
|
-
const url = `${BASE_URL}/${endpoint}?${search.toString()}`;
|
|
79
|
-
const start = Date.now();
|
|
80
|
-
const response = await fetch(url, {
|
|
81
|
-
headers: {
|
|
82
|
-
Accept: "application/json",
|
|
83
|
-
Authorization: basicAuthHeader(credential),
|
|
84
|
-
},
|
|
85
|
-
signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
|
|
86
|
-
});
|
|
87
|
-
const ms = Date.now() - start;
|
|
88
|
-
const statusTag = response.ok
|
|
89
|
-
? "ok"
|
|
90
|
-
: response.status === 404
|
|
91
|
-
? "http-404"
|
|
92
|
-
: `http-${Math.floor(response.status / 100)}xx`;
|
|
93
|
-
console.error(`[epc] tool=${toolName} account=${accountId} address="${identifier}" status=${statusTag} ms=${ms}`);
|
|
94
|
-
// 404 is a valid outcome — no EPC on file for the address. Surface to the
|
|
95
|
-
// caller as an empty result set; the wrapper turns it into ok+[].
|
|
96
|
-
if (response.status === 404) {
|
|
97
|
-
return { status: 404, rows: [] };
|
|
98
|
-
}
|
|
99
|
-
if (!response.ok) {
|
|
100
|
-
const body = await response.text().catch(() => "");
|
|
101
|
-
throw new EpcError(response.status, endpoint, body.slice(0, 200));
|
|
102
|
-
}
|
|
103
|
-
const text = await response.text();
|
|
104
|
-
let parsed;
|
|
105
|
-
try {
|
|
106
|
-
parsed = JSON.parse(text);
|
|
107
|
-
}
|
|
108
|
-
catch {
|
|
109
|
-
throw new BadResponseError(endpoint, text.length);
|
|
110
|
-
}
|
|
111
|
-
if (!parsed ||
|
|
112
|
-
typeof parsed !== "object" ||
|
|
113
|
-
Array.isArray(parsed) ||
|
|
114
|
-
!("rows" in parsed)) {
|
|
115
|
-
throw new BadResponseError(endpoint, text.length);
|
|
116
|
-
}
|
|
117
|
-
const rows = parsed.rows;
|
|
118
|
-
if (!Array.isArray(rows)) {
|
|
119
|
-
throw new BadResponseError(endpoint, text.length);
|
|
120
|
-
}
|
|
121
|
-
return { status: response.status, rows: rows };
|
|
122
|
-
}
|
|
123
|
-
// Compose the human-readable address from the upstream row's parts. Empty
|
|
124
|
-
// segments are dropped; segments are uppercase in the API and join with
|
|
125
|
-
// ", ".
|
|
126
|
-
function rowAddress(row) {
|
|
127
|
-
const parts = [row.address1, row.address2, row.address3, row.posttown, row.postcode]
|
|
128
|
-
.map((s) => (typeof s === "string" ? s.trim() : ""))
|
|
129
|
-
.filter((s) => s.length > 0);
|
|
130
|
-
return parts.join(", ");
|
|
131
|
-
}
|
|
132
|
-
function parseFloorArea(row) {
|
|
133
|
-
const raw = row["total-floor-area"];
|
|
134
|
-
if (raw == null || raw === "")
|
|
135
|
-
return null;
|
|
136
|
-
const n = Number(raw);
|
|
137
|
-
return Number.isFinite(n) ? n : null;
|
|
138
|
-
}
|
|
139
|
-
// Group rows by UPRN (or address1+postcode when UPRN is absent), then pick
|
|
140
|
-
// the most-recent EPC per group by lodgement date. Rows with no lodgement
|
|
141
|
-
// date sort last.
|
|
142
|
-
export function groupAndPickMostRecent(rows) {
|
|
143
|
-
const buckets = new Map();
|
|
144
|
-
for (const row of rows) {
|
|
145
|
-
const uprn = typeof row.uprn === "string" ? row.uprn.trim() : "";
|
|
146
|
-
const key = uprn || `${row.address1 ?? ""}|${row.postcode ?? ""}`.toLowerCase();
|
|
147
|
-
const existing = buckets.get(key);
|
|
148
|
-
if (existing)
|
|
149
|
-
existing.push(row);
|
|
150
|
-
else
|
|
151
|
-
buckets.set(key, [row]);
|
|
152
|
-
}
|
|
153
|
-
const out = [];
|
|
154
|
-
for (const bucket of buckets.values()) {
|
|
155
|
-
bucket.sort((a, b) => {
|
|
156
|
-
const da = String(a["lodgement-date"] ?? "");
|
|
157
|
-
const db = String(b["lodgement-date"] ?? "");
|
|
158
|
-
// Most-recent first: ISO dates string-sort correctly.
|
|
159
|
-
return db.localeCompare(da);
|
|
160
|
-
});
|
|
161
|
-
const winner = bucket[0];
|
|
162
|
-
const m2 = parseFloorArea(winner);
|
|
163
|
-
out.push({
|
|
164
|
-
total_floor_area_m2: m2,
|
|
165
|
-
total_floor_area_sqft: m2 == null ? null : Number((m2 * M2_TO_SQFT).toFixed(2)),
|
|
166
|
-
current_energy_rating: typeof winner["current-energy-rating"] === "string"
|
|
167
|
-
? winner["current-energy-rating"]
|
|
168
|
-
: null,
|
|
169
|
-
potential_energy_rating: typeof winner["potential-energy-rating"] === "string"
|
|
170
|
-
? winner["potential-energy-rating"]
|
|
171
|
-
: null,
|
|
172
|
-
lodgement_date: typeof winner["lodgement-date"] === "string"
|
|
173
|
-
? winner["lodgement-date"]
|
|
174
|
-
: null,
|
|
175
|
-
address: rowAddress(winner),
|
|
176
|
-
uprn: typeof winner.uprn === "string" && winner.uprn.length > 0 ? winner.uprn : null,
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
return out;
|
|
180
|
-
}
|
|
181
|
-
//# sourceMappingURL=epc-api.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"epc-api.js","sourceRoot":"","sources":["../../src/lib/epc-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,yDAAyD;AACzD,sEAAsE;AACtE,mEAAmE;AACnE,2EAA2E;AAC3E,0EAA0E;AAC1E,4CAA4C;AAC5C,EAAE;AACF,oCAAoC;AACpC,2DAA2D;AAC3D,+DAA+D;AAC/D,2DAA2D;AAC3D,oEAAoE;AACpE,4EAA4E;AAC5E,EAAE;AACF,0EAA0E;AAC1E,uEAAuE;AACvE,oBAAoB;AAEpB,MAAM,CAAC,MAAM,QAAQ,GAAG,4CAA4C,CAAC;AACrE,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC;AACzC,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC;AAElC,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAC9C;QACE,KAAK,CAAC,oBAAoB,CAAC,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF;AAED,MAAM,OAAO,QAAS,SAAQ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