@rubytech/create-maxy-code 0.1.26 → 0.1.27

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 (449) hide show
  1. package/dist/index.js +28 -11
  2. package/package.json +1 -1
  3. package/payload/platform/plugins/.claude-plugin/marketplace.json +5 -95
  4. package/payload/platform/plugins/brochures/.claude-plugin/plugin.json +8 -0
  5. package/payload/platform/plugins/brochures/PLUGIN.md +36 -0
  6. package/payload/platform/plugins/brochures/commands/make-brochure.md +11 -0
  7. package/payload/platform/plugins/brochures/skills/a4-print-documents/SKILL.md +478 -0
  8. package/payload/platform/plugins/brochures/skills/brand-design/SKILL.md +192 -0
  9. package/payload/platform/plugins/brochures/skills/make-brochure/SKILL.md +354 -0
  10. package/payload/platform/plugins/brochures/skills/make-brochure/references/seller-brief-template.md +115 -0
  11. package/payload/platform/plugins/brochures/skills/property-brochure/SKILL.md +119 -0
  12. package/payload/platform/plugins/brochures/skills/property-brochure/references/build.md +270 -0
  13. package/payload/platform/plugins/brochures/skills/property-brochure/references/copy.md +211 -0
  14. package/payload/platform/plugins/brochures/skills/property-brochure/references/images.md +166 -0
  15. package/payload/platform/plugins/brochures/skills/property-brochure/references/index-landing.md +376 -0
  16. package/payload/platform/plugins/brochures/skills/property-brochure/references/index.html +1288 -0
  17. package/payload/platform/plugins/brochures/skills/property-brochure/references/placeholders.md +250 -0
  18. package/payload/platform/plugins/brochures/skills/property-brochure/references/registers.md +47 -0
  19. package/payload/platform/plugins/brochures/skills/property-brochure/references/seller-brief.md +56 -0
  20. package/payload/platform/plugins/brochures/skills/property-brochure/references/structure.md +249 -0
  21. package/payload/platform/plugins/brochures/skills/property-brochure/references/template.html +2370 -0
  22. package/payload/platform/plugins/brochures/skills/property-extract/SKILL.md +372 -0
  23. package/payload/platform/plugins/buyers/.claude-plugin/plugin.json +8 -0
  24. package/payload/platform/plugins/buyers/PLUGIN.md +35 -0
  25. package/payload/platform/plugins/buyers/skills/buyer-feedback/SKILL.md +109 -0
  26. package/payload/platform/plugins/buyers/skills/buyer-management/SKILL.md +42 -0
  27. package/payload/platform/plugins/buyers/skills/buyer-management/references/buyer-qualification-questions.md +16 -0
  28. package/payload/platform/plugins/buyers/skills/buyer-management/references/buyer-qualification.md +59 -0
  29. package/payload/platform/plugins/buyers/skills/buyer-management/references/buyer-scripts.md +63 -0
  30. package/payload/platform/plugins/buyers/skills/buyer-management/references/buyer-working-scripts.md +54 -0
  31. package/payload/platform/plugins/buyers/skills/buyer-management/references/feedback-collection.md +42 -0
  32. package/payload/platform/plugins/buyers/skills/buyer-management/references/offer-capture.md +38 -0
  33. package/payload/platform/plugins/buyers/skills/buyer-management/references/viewing-booking.md +32 -0
  34. package/payload/platform/plugins/buyers/skills/buyer-management/references/viewing-management.md +52 -0
  35. package/payload/platform/plugins/buyers/skills/buyer-seller-guides/SKILL.md +407 -0
  36. package/payload/platform/plugins/buyers/skills/buyer-seller-guides/references/care-fees-guide.md +68 -0
  37. package/payload/platform/plugins/buyers/skills/buyer-seller-guides/references/divorce-sales-guide.md +61 -0
  38. package/payload/platform/plugins/buyers/skills/buyer-seller-guides/references/downsizing-guide.md +45 -0
  39. package/payload/platform/plugins/buyers/skills/buyer-seller-guides/references/first-time-buyers.md +92 -0
  40. package/payload/platform/plugins/buyers/skills/buyer-seller-guides/references/first-time-sellers.md +78 -0
  41. package/payload/platform/plugins/buyers/skills/buyer-seller-guides/references/probate-guide.md +53 -0
  42. package/payload/platform/plugins/buyers/skills/buyer-seller-guides/references/upsizing-guide.md +41 -0
  43. package/payload/platform/plugins/buyers/skills/property-enquiry/SKILL.md +126 -0
  44. package/payload/platform/plugins/buyers/skills/viewing-management/SKILL.md +111 -0
  45. package/payload/platform/plugins/estate-business/.claude-plugin/plugin.json +8 -0
  46. package/payload/platform/plugins/estate-business/PLUGIN.md +65 -0
  47. package/payload/platform/plugins/estate-business/skills/business-growth/SKILL.md +133 -0
  48. package/payload/platform/plugins/estate-business/skills/business-growth/references/buy-back-your-time.md +37 -0
  49. package/payload/platform/plugins/estate-business/skills/business-growth/references/firewave-gost-scorecards.md +14 -0
  50. package/payload/platform/plugins/estate-business/skills/business-growth/references/keller-org-model.md +17 -0
  51. package/payload/platform/plugins/estate-business/skills/business-growth/references/lencioni-team-models.md +22 -0
  52. package/payload/platform/plugins/estate-business/skills/business-growth/references/listing-management-system.md +11 -0
  53. package/payload/platform/plugins/estate-business/skills/business-growth/references/net-figure-form.md +11 -0
  54. package/payload/platform/plugins/estate-business/skills/business-growth/references/serhant-bizinbox-notes.md +13 -0
  55. package/payload/platform/plugins/estate-business/skills/business-growth/references/team-roles-commission.md +14 -0
  56. package/payload/platform/plugins/estate-business/skills/business-growth/references/va-2026-ops.md +43 -0
  57. package/payload/platform/plugins/estate-business/skills/business-growth/references/wingman-structure.md +13 -0
  58. package/payload/platform/plugins/estate-business/skills/business-operations/SKILL.md +32 -0
  59. package/payload/platform/plugins/estate-business/skills/business-operations/references/crm-systems.md +57 -0
  60. package/payload/platform/plugins/estate-business/skills/business-operations/references/hiring-guide.md +59 -0
  61. package/payload/platform/plugins/estate-business/skills/business-operations/references/impact-framework.md +47 -0
  62. package/payload/platform/plugins/estate-business/skills/business-operations/references/minutes-equal-money.md +55 -0
  63. package/payload/platform/plugins/estate-business/skills/business-operations/references/team-management.md +48 -0
  64. package/payload/platform/plugins/estate-business/skills/commission-calculator/SKILL.md +40 -0
  65. package/payload/platform/plugins/estate-business/skills/exp-partnership/SKILL.md +52 -0
  66. package/payload/platform/plugins/estate-business/skills/exp-partnership/references/12-reasons.md +39 -0
  67. package/payload/platform/plugins/estate-business/skills/exp-partnership/references/95-5-system.md +66 -0
  68. package/payload/platform/plugins/estate-business/skills/exp-partnership/references/agent-attraction-scripts.md +90 -0
  69. package/payload/platform/plugins/estate-business/skills/exp-partnership/references/business-partnership.md +92 -0
  70. package/payload/platform/plugins/estate-business/skills/exp-partnership/references/exp-model-overview.md +66 -0
  71. package/payload/platform/plugins/estate-business/skills/exp-partnership/references/model-comparison.md +66 -0
  72. package/payload/platform/plugins/estate-business/skills/exp-partnership/references/revenue-share-explained.md +57 -0
  73. package/payload/platform/plugins/estate-business/skills/month-end-close/SKILL.md +69 -0
  74. package/payload/platform/plugins/estate-business/skills/payment-batch-stager/SKILL.md +42 -0
  75. package/payload/platform/plugins/estate-business/skills/period-reconciler/SKILL.md +42 -0
  76. package/payload/platform/plugins/estate-business/skills/personal-branding/SKILL.md +117 -0
  77. package/payload/platform/plugins/estate-business/skills/personal-branding/references/attraction-agent-notes.md +31 -0
  78. package/payload/platform/plugins/estate-business/skills/personal-branding/references/attraction-agent.md +58 -0
  79. package/payload/platform/plugins/estate-business/skills/personal-branding/references/authenticity-boundaries.md +28 -0
  80. package/payload/platform/plugins/estate-business/skills/personal-branding/references/become-a-brand-leader-notes.md +19 -0
  81. package/payload/platform/plugins/estate-business/skills/personal-branding/references/blast-formula.md +42 -0
  82. package/payload/platform/plugins/estate-business/skills/personal-branding/references/brand-leader.md +48 -0
  83. package/payload/platform/plugins/estate-business/skills/personal-branding/references/brand-strategy-system.md +59 -0
  84. package/payload/platform/plugins/estate-business/skills/personal-branding/references/content-engine.md +49 -0
  85. package/payload/platform/plugins/estate-business/skills/personal-branding/references/firewave-blast-and-blogging.md +23 -0
  86. package/payload/platform/plugins/estate-business/skills/personal-branding/references/gary-v-content.md +52 -0
  87. package/payload/platform/plugins/estate-business/skills/personal-branding/references/gary-v-principles.md +20 -0
  88. package/payload/platform/plugins/estate-business/skills/personal-branding/references/oversubscribed-positioning.md +18 -0
  89. package/payload/platform/plugins/estate-business/skills/personal-branding/references/platforms.md +41 -0
  90. package/payload/platform/plugins/estate-business/skills/personal-branding/references/priestley-oversubscribed.md +54 -0
  91. package/payload/platform/plugins/estate-business/skills/personal-branding/references/storeys-style-examples.md +25 -0
  92. package/payload/platform/plugins/estate-business/skills/personal-branding/references/visual-identity.md +27 -0
  93. package/payload/platform/plugins/estate-coaching/.claude-plugin/plugin.json +8 -0
  94. package/payload/platform/plugins/estate-coaching/PLUGIN.md +55 -0
  95. package/payload/platform/plugins/estate-coaching/skills/agent-performance/SKILL.md +371 -0
  96. package/payload/platform/plugins/estate-coaching/skills/agent-performance/references/atomic-habits.md +52 -0
  97. package/payload/platform/plugins/estate-coaching/skills/agent-performance/references/daily-routine-scorecard.md +104 -0
  98. package/payload/platform/plugins/estate-coaching/skills/agent-performance/references/hp6-model.md +63 -0
  99. package/payload/platform/plugins/estate-coaching/skills/agent-performance/references/twelve-week-year.md +71 -0
  100. package/payload/platform/plugins/estate-coaching/skills/bespoke-coaching/SKILL.md +36 -0
  101. package/payload/platform/plugins/estate-coaching/skills/bespoke-coaching/references/coaching-boundaries.md +56 -0
  102. package/payload/platform/plugins/estate-coaching/skills/bespoke-coaching/references/feedback-framework.md +61 -0
  103. package/payload/platform/plugins/estate-coaching/skills/bespoke-coaching/references/performance-framework.md +109 -0
  104. package/payload/platform/plugins/estate-coaching/skills/coaching-toolkit/SKILL.md +421 -0
  105. package/payload/platform/plugins/estate-coaching/skills/coaching-toolkit/references/coaching-exercises.md +86 -0
  106. package/payload/platform/plugins/estate-coaching/skills/coaching-toolkit/references/goal-setting.md +78 -0
  107. package/payload/platform/plugins/estate-coaching/skills/coaching-toolkit/references/one-to-one-framework.md +92 -0
  108. package/payload/platform/plugins/estate-coaching/skills/coaching-toolkit/references/soi-workbook.md +103 -0
  109. package/payload/platform/plugins/estate-coaching/skills/serhant-training/SKILL.md +410 -0
  110. package/payload/platform/plugins/estate-coaching/skills/serhant-training/references/agent-training-guide.md +70 -0
  111. package/payload/platform/plugins/estate-coaching/skills/serhant-training/references/business-in-a-box.md +72 -0
  112. package/payload/platform/plugins/estate-coaching/skills/serhant-training/references/buyers-guide.md +53 -0
  113. package/payload/platform/plugins/estate-coaching/skills/serhant-training/references/codo-method.md +72 -0
  114. package/payload/platform/plugins/estate-coaching/skills/serhant-training/references/website-planning-guide.md +79 -0
  115. package/payload/platform/plugins/estate-onboarding/.claude-plugin/plugin.json +8 -0
  116. package/payload/platform/plugins/estate-onboarding/PLUGIN.md +31 -0
  117. package/payload/platform/plugins/estate-onboarding/skills/bootstrap/SKILL.md +26 -0
  118. package/payload/platform/plugins/estate-onboarding/skills/bootstrap/references/onboarding-flow.md +63 -0
  119. package/payload/platform/plugins/estate-sales/.claude-plugin/plugin.json +8 -0
  120. package/payload/platform/plugins/estate-sales/PLUGIN.md +53 -0
  121. package/payload/platform/plugins/estate-sales/skills/chase-progression/SKILL.md +107 -0
  122. package/payload/platform/plugins/estate-sales/skills/negotiation/SKILL.md +35 -0
  123. package/payload/platform/plugins/estate-sales/skills/negotiation/references/deal-saving.md +47 -0
  124. package/payload/platform/plugins/estate-sales/skills/negotiation/references/negotiation-deep-guide.md +64 -0
  125. package/payload/platform/plugins/estate-sales/skills/negotiation/references/negotiation-prep-principles.md +29 -0
  126. package/payload/platform/plugins/estate-sales/skills/negotiation/references/negotiation-techniques.md +42 -0
  127. package/payload/platform/plugins/estate-sales/skills/negotiation/references/offer-presentation.md +43 -0
  128. package/payload/platform/plugins/estate-sales/skills/risk-scorer/SKILL.md +42 -0
  129. package/payload/platform/plugins/estate-sales/skills/sales-closer/SKILL.md +24 -0
  130. package/payload/platform/plugins/estate-sales/skills/sales-closer/references/serhant-emotion-stages.md +36 -0
  131. package/payload/platform/plugins/estate-sales/skills/sales-discovery/SKILL.md +30 -0
  132. package/payload/platform/plugins/estate-sales/skills/sales-discovery/references/chris-voss-discovery.md +88 -0
  133. package/payload/platform/plugins/estate-sales/skills/sales-discovery/references/firewave-gost-journey.md +68 -0
  134. package/payload/platform/plugins/estate-sales/skills/sales-discovery/references/phil-jones-openers.md +78 -0
  135. package/payload/platform/plugins/estate-sales/skills/sales-discovery/references/pre-listing-checklist.md +77 -0
  136. package/payload/platform/plugins/estate-sales/skills/sales-discovery/references/serhant-improv.md +22 -0
  137. package/payload/platform/plugins/estate-sales/skills/sales-discovery/references/tom-ferry-discovery.md +103 -0
  138. package/payload/platform/plugins/estate-sales/skills/sales-discovery/references/vendor-motivation-competitor.md +52 -0
  139. package/payload/platform/plugins/estate-sales/skills/sales-negotiation/SKILL.md +29 -0
  140. package/payload/platform/plugins/estate-sales/skills/sales-negotiation/references/chris-voss-negotiation.md +70 -0
  141. package/payload/platform/plugins/estate-sales/skills/sales-negotiation/references/phil-jones-price-words.md +40 -0
  142. package/payload/platform/plugins/estate-sales/skills/sales-negotiation/references/serhant-negotiation-plus.md +55 -0
  143. package/payload/platform/plugins/estate-sales/skills/sales-negotiation/references/tom-panos-commission-pricing.md +57 -0
  144. package/payload/platform/plugins/estate-sales/skills/sales-negotiation/references/tony-morris-questioning.md +54 -0
  145. package/payload/platform/plugins/estate-sales/skills/sales-progression/SKILL.md +27 -0
  146. package/payload/platform/plugins/estate-sales/skills/sales-progression/references/conveyancing-guide.md +54 -0
  147. package/payload/platform/plugins/estate-sales/skills/sales-progression/references/transaction-tracking.md +66 -0
  148. package/payload/platform/plugins/estate-teaching/.claude-plugin/plugin.json +8 -0
  149. package/payload/platform/plugins/estate-teaching/PLUGIN.md +31 -0
  150. package/payload/platform/plugins/estate-teaching/skills/content-directory/SKILL.md +39 -0
  151. package/payload/platform/plugins/estate-teaching/skills/content-directory/references/module-delivery.md +65 -0
  152. package/payload/platform/plugins/estate-teaching/skills/content-directory/references/progress-tracking.md +47 -0
  153. package/payload/platform/plugins/leads/.claude-plugin/plugin.json +8 -0
  154. package/payload/platform/plugins/leads/PLUGIN.md +62 -0
  155. package/payload/platform/plugins/leads/skills/chain-progression-tracker/SKILL.md +51 -0
  156. package/payload/platform/plugins/leads/skills/diary-builder/SKILL.md +38 -0
  157. package/payload/platform/plugins/leads/skills/enquiry-triage/SKILL.md +36 -0
  158. package/payload/platform/plugins/leads/skills/lead-nurturing/SKILL.md +137 -0
  159. package/payload/platform/plugins/leads/skills/lead-nurturing/references/buyer-search-letter.md +28 -0
  160. package/payload/platform/plugins/leads/skills/lead-nurturing/references/buyer-search-letters.md +37 -0
  161. package/payload/platform/plugins/leads/skills/lead-nurturing/references/database-reactivation.md +30 -0
  162. package/payload/platform/plugins/leads/skills/lead-nurturing/references/email-nurture-sequences.md +45 -0
  163. package/payload/platform/plugins/leads/skills/lead-nurturing/references/facebook-referrals.md +30 -0
  164. package/payload/platform/plugins/leads/skills/lead-nurturing/references/firewave-email-nurture-sequences.md +41 -0
  165. package/payload/platform/plugins/leads/skills/lead-nurturing/references/keller-33-touch.md +34 -0
  166. package/payload/platform/plugins/leads/skills/lead-nurturing/references/neighbour-letters.md +31 -0
  167. package/payload/platform/plugins/leads/skills/lead-nurturing/references/neighbour-notification-letter.md +20 -0
  168. package/payload/platform/plugins/leads/skills/lead-nurturing/references/ofi-follow-up-dialogue.md +22 -0
  169. package/payload/platform/plugins/leads/skills/lead-nurturing/references/ofi-follow-up.md +26 -0
  170. package/payload/platform/plugins/leads/skills/lead-nurturing/references/serhant-three-fs-plus.md +21 -0
  171. package/payload/platform/plugins/leads/skills/lead-nurturing/references/sharran-10x10x10.md +18 -0
  172. package/payload/platform/plugins/leads/skills/lead-nurturing/references/sms-templates.md +40 -0
  173. package/payload/platform/plugins/leads/skills/lead-nurturing/references/sphere-of-influence-notes.md +34 -0
  174. package/payload/platform/plugins/leads/skills/lead-nurturing/references/sphere-of-influence.md +60 -0
  175. package/payload/platform/plugins/leads/skills/lead-nurturing/references/tom-panos-sms-templates.md +59 -0
  176. package/payload/platform/plugins/leads/skills/morning-round/SKILL.md +72 -0
  177. package/payload/platform/plugins/leads/skills/prospecting/SKILL.md +33 -0
  178. package/payload/platform/plugins/leads/skills/prospecting/references/database-matching.md +30 -0
  179. package/payload/platform/plugins/leads/skills/prospecting/references/database-value.md +53 -0
  180. package/payload/platform/plugins/leads/skills/prospecting/references/prospecting-dialogues.md +24 -0
  181. package/payload/platform/plugins/leads/skills/prospecting/references/reactivation.md +34 -0
  182. package/payload/platform/plugins/listings/.claude-plugin/plugin.json +8 -0
  183. package/payload/platform/plugins/listings/PLUGIN.md +103 -0
  184. package/payload/platform/plugins/listings/skills/comparable-finder/SKILL.md +52 -0
  185. package/payload/platform/plugins/listings/skills/epc-checker/SKILL.md +38 -0
  186. package/payload/platform/plugins/listings/skills/home-preparation/SKILL.md +28 -0
  187. package/payload/platform/plugins/listings/skills/home-preparation/references/kerb-appeal.md +38 -0
  188. package/payload/platform/plugins/listings/skills/home-preparation/references/photo-day.md +59 -0
  189. package/payload/platform/plugins/listings/skills/home-preparation/references/situational-tips.md +50 -0
  190. package/payload/platform/plugins/listings/skills/home-preparation/references/staging-guide.md +52 -0
  191. package/payload/platform/plugins/listings/skills/listing-copy-writer/SKILL.md +55 -0
  192. package/payload/platform/plugins/listings/skills/listing-presentation/SKILL.md +286 -0
  193. package/payload/platform/plugins/listings/skills/listing-presentation/references/booking-script.md +51 -0
  194. package/payload/platform/plugins/listings/skills/listing-presentation/references/objection-scripts.md +193 -0
  195. package/payload/platform/plugins/listings/skills/listing-presentation/references/penhaul-presentation.md +123 -0
  196. package/payload/platform/plugins/listings/skills/listing-presentation/references/pre-listing-kit.md +139 -0
  197. package/payload/platform/plugins/listings/skills/listing-presentation/references/set-to-sell.md +55 -0
  198. package/payload/platform/plugins/listings/skills/listing-presentation/references/sharran-frameworks.md +107 -0
  199. package/payload/platform/plugins/listings/skills/local-market-stats/SKILL.md +33 -0
  200. package/payload/platform/plugins/listings/skills/new-instruction/SKILL.md +78 -0
  201. package/payload/platform/plugins/listings/skills/particulars-builder/SKILL.md +48 -0
  202. package/payload/platform/plugins/listings/skills/portal-launch-scheduler/SKILL.md +49 -0
  203. package/payload/platform/plugins/listings/skills/pricing-scenario-builder/SKILL.md +35 -0
  204. package/payload/platform/plugins/listings/skills/property-marketing/SKILL.md +337 -0
  205. package/payload/platform/plugins/listings/skills/property-marketing/references/auction-report-template.md +41 -0
  206. package/payload/platform/plugins/listings/skills/property-marketing/references/coming-soon-campaign.md +43 -0
  207. package/payload/platform/plugins/listings/skills/property-marketing/references/direct-mail-templates.md +121 -0
  208. package/payload/platform/plugins/listings/skills/property-marketing/references/eoi-form-template.md +62 -0
  209. package/payload/platform/plugins/listings/skills/property-marketing/references/monthly-scorecard.md +63 -0
  210. package/payload/platform/plugins/listings/skills/supplier-booker/SKILL.md +39 -0
  211. package/payload/platform/plugins/listings/skills/talk-track-composer/SKILL.md +36 -0
  212. package/payload/platform/plugins/listings/skills/terms-of-business-drafter/SKILL.md +54 -0
  213. package/payload/platform/plugins/listings/skills/valuation-prep/SKILL.md +69 -0
  214. package/payload/platform/plugins/loop/.claude-plugin/plugin.json +17 -0
  215. package/payload/platform/plugins/loop/PLUGIN.md +108 -0
  216. package/payload/platform/plugins/loop/mcp/dist/index.d.ts +2 -0
  217. package/payload/platform/plugins/loop/mcp/dist/index.d.ts.map +1 -0
  218. package/payload/platform/plugins/loop/mcp/dist/index.js +293 -0
  219. package/payload/platform/plugins/loop/mcp/dist/index.js.map +1 -0
  220. package/payload/platform/plugins/loop/mcp/dist/lib/crypto.d.ts +10 -0
  221. package/payload/platform/plugins/loop/mcp/dist/lib/crypto.d.ts.map +1 -0
  222. package/payload/platform/plugins/loop/mcp/dist/lib/crypto.js +88 -0
  223. package/payload/platform/plugins/loop/mcp/dist/lib/crypto.js.map +1 -0
  224. package/payload/platform/plugins/loop/mcp/dist/lib/loop-api.d.ts +82 -0
  225. package/payload/platform/plugins/loop/mcp/dist/lib/loop-api.d.ts.map +1 -0
  226. package/payload/platform/plugins/loop/mcp/dist/lib/loop-api.js +427 -0
  227. package/payload/platform/plugins/loop/mcp/dist/lib/loop-api.js.map +1 -0
  228. package/payload/platform/plugins/loop/mcp/dist/lib/neo4j.d.ts +5 -0
  229. package/payload/platform/plugins/loop/mcp/dist/lib/neo4j.d.ts.map +1 -0
  230. package/payload/platform/plugins/loop/mcp/dist/lib/neo4j.js +40 -0
  231. package/payload/platform/plugins/loop/mcp/dist/lib/neo4j.js.map +1 -0
  232. package/payload/platform/plugins/loop/mcp/dist/tools/customer-preferences.d.ts +10 -0
  233. package/payload/platform/plugins/loop/mcp/dist/tools/customer-preferences.d.ts.map +1 -0
  234. package/payload/platform/plugins/loop/mcp/dist/tools/customer-preferences.js +24 -0
  235. package/payload/platform/plugins/loop/mcp/dist/tools/customer-preferences.js.map +1 -0
  236. package/payload/platform/plugins/loop/mcp/dist/tools/feedback.d.ts +16 -0
  237. package/payload/platform/plugins/loop/mcp/dist/tools/feedback.d.ts.map +1 -0
  238. package/payload/platform/plugins/loop/mcp/dist/tools/feedback.js +35 -0
  239. package/payload/platform/plugins/loop/mcp/dist/tools/feedback.js.map +1 -0
  240. package/payload/platform/plugins/loop/mcp/dist/tools/key-deregister.d.ts +5 -0
  241. package/payload/platform/plugins/loop/mcp/dist/tools/key-deregister.d.ts.map +1 -0
  242. package/payload/platform/plugins/loop/mcp/dist/tools/key-deregister.js +19 -0
  243. package/payload/platform/plugins/loop/mcp/dist/tools/key-deregister.js.map +1 -0
  244. package/payload/platform/plugins/loop/mcp/dist/tools/key-list.d.ts +4 -0
  245. package/payload/platform/plugins/loop/mcp/dist/tools/key-list.d.ts.map +1 -0
  246. package/payload/platform/plugins/loop/mcp/dist/tools/key-list.js +14 -0
  247. package/payload/platform/plugins/loop/mcp/dist/tools/key-list.js.map +1 -0
  248. package/payload/platform/plugins/loop/mcp/dist/tools/key-register.d.ts +9 -0
  249. package/payload/platform/plugins/loop/mcp/dist/tools/key-register.d.ts.map +1 -0
  250. package/payload/platform/plugins/loop/mcp/dist/tools/key-register.js +60 -0
  251. package/payload/platform/plugins/loop/mcp/dist/tools/key-register.js.map +1 -0
  252. package/payload/platform/plugins/loop/mcp/dist/tools/marketing-enquiry.d.ts +13 -0
  253. package/payload/platform/plugins/loop/mcp/dist/tools/marketing-enquiry.d.ts.map +1 -0
  254. package/payload/platform/plugins/loop/mcp/dist/tools/marketing-enquiry.js +41 -0
  255. package/payload/platform/plugins/loop/mcp/dist/tools/marketing-enquiry.js.map +1 -0
  256. package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match-batch.d.ts +9 -0
  257. package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match-batch.d.ts.map +1 -0
  258. package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match-batch.js +16 -0
  259. package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match-batch.js.map +1 -0
  260. package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match-request.d.ts +15 -0
  261. package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match-request.d.ts.map +1 -0
  262. package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match-request.js +11 -0
  263. package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match-request.js.map +1 -0
  264. package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match.d.ts +10 -0
  265. package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match.d.ts.map +1 -0
  266. package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match.js +39 -0
  267. package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match.js.map +1 -0
  268. package/payload/platform/plugins/loop/mcp/dist/tools/people-detail.d.ts +9 -0
  269. package/payload/platform/plugins/loop/mcp/dist/tools/people-detail.d.ts.map +1 -0
  270. package/payload/platform/plugins/loop/mcp/dist/tools/people-detail.js +125 -0
  271. package/payload/platform/plugins/loop/mcp/dist/tools/people-detail.js.map +1 -0
  272. package/payload/platform/plugins/loop/mcp/dist/tools/people-search.d.ts +18 -0
  273. package/payload/platform/plugins/loop/mcp/dist/tools/people-search.d.ts.map +1 -0
  274. package/payload/platform/plugins/loop/mcp/dist/tools/people-search.js +87 -0
  275. package/payload/platform/plugins/loop/mcp/dist/tools/people-search.js.map +1 -0
  276. package/payload/platform/plugins/loop/mcp/dist/tools/property-detail.d.ts +10 -0
  277. package/payload/platform/plugins/loop/mcp/dist/tools/property-detail.d.ts.map +1 -0
  278. package/payload/platform/plugins/loop/mcp/dist/tools/property-detail.js +82 -0
  279. package/payload/platform/plugins/loop/mcp/dist/tools/property-detail.js.map +1 -0
  280. package/payload/platform/plugins/loop/mcp/dist/tools/property-listed.d.ts +12 -0
  281. package/payload/platform/plugins/loop/mcp/dist/tools/property-listed.d.ts.map +1 -0
  282. package/payload/platform/plugins/loop/mcp/dist/tools/property-listed.js +32 -0
  283. package/payload/platform/plugins/loop/mcp/dist/tools/property-listed.js.map +1 -0
  284. package/payload/platform/plugins/loop/mcp/dist/tools/property-request.d.ts +15 -0
  285. package/payload/platform/plugins/loop/mcp/dist/tools/property-request.d.ts.map +1 -0
  286. package/payload/platform/plugins/loop/mcp/dist/tools/property-request.js +11 -0
  287. package/payload/platform/plugins/loop/mcp/dist/tools/property-request.js.map +1 -0
  288. package/payload/platform/plugins/loop/mcp/dist/tools/property-search.d.ts +16 -0
  289. package/payload/platform/plugins/loop/mcp/dist/tools/property-search.d.ts.map +1 -0
  290. package/payload/platform/plugins/loop/mcp/dist/tools/property-search.js +41 -0
  291. package/payload/platform/plugins/loop/mcp/dist/tools/property-search.js.map +1 -0
  292. package/payload/platform/plugins/loop/mcp/dist/tools/supplier.d.ts +13 -0
  293. package/payload/platform/plugins/loop/mcp/dist/tools/supplier.d.ts.map +1 -0
  294. package/payload/platform/plugins/loop/mcp/dist/tools/supplier.js +49 -0
  295. package/payload/platform/plugins/loop/mcp/dist/tools/supplier.js.map +1 -0
  296. package/payload/platform/plugins/loop/mcp/dist/tools/team-availability.d.ts +7 -0
  297. package/payload/platform/plugins/loop/mcp/dist/tools/team-availability.d.ts.map +1 -0
  298. package/payload/platform/plugins/loop/mcp/dist/tools/team-availability.js +19 -0
  299. package/payload/platform/plugins/loop/mcp/dist/tools/team-availability.js.map +1 -0
  300. package/payload/platform/plugins/loop/mcp/dist/tools/team-info.d.ts +5 -0
  301. package/payload/platform/plugins/loop/mcp/dist/tools/team-info.d.ts.map +1 -0
  302. package/payload/platform/plugins/loop/mcp/dist/tools/team-info.js +32 -0
  303. package/payload/platform/plugins/loop/mcp/dist/tools/team-info.js.map +1 -0
  304. package/payload/platform/plugins/loop/mcp/dist/tools/viewing-create.d.ts +14 -0
  305. package/payload/platform/plugins/loop/mcp/dist/tools/viewing-create.d.ts.map +1 -0
  306. package/payload/platform/plugins/loop/mcp/dist/tools/viewing-create.js +11 -0
  307. package/payload/platform/plugins/loop/mcp/dist/tools/viewing-create.js.map +1 -0
  308. package/payload/platform/plugins/loop/mcp/dist/tools/viewing-detail.d.ts +9 -0
  309. package/payload/platform/plugins/loop/mcp/dist/tools/viewing-detail.d.ts.map +1 -0
  310. package/payload/platform/plugins/loop/mcp/dist/tools/viewing-detail.js +85 -0
  311. package/payload/platform/plugins/loop/mcp/dist/tools/viewing-detail.js.map +1 -0
  312. package/payload/platform/plugins/loop/mcp/dist/tools/viewing-search.d.ts +13 -0
  313. package/payload/platform/plugins/loop/mcp/dist/tools/viewing-search.d.ts.map +1 -0
  314. package/payload/platform/plugins/loop/mcp/dist/tools/viewing-search.js +44 -0
  315. package/payload/platform/plugins/loop/mcp/dist/tools/viewing-search.js.map +1 -0
  316. package/payload/platform/plugins/loop/mcp/dist/tools/viewing-update.d.ts +14 -0
  317. package/payload/platform/plugins/loop/mcp/dist/tools/viewing-update.d.ts.map +1 -0
  318. package/payload/platform/plugins/loop/mcp/dist/tools/viewing-update.js +18 -0
  319. package/payload/platform/plugins/loop/mcp/dist/tools/viewing-update.js.map +1 -0
  320. package/payload/platform/plugins/loop/mcp/package-lock.json +2549 -0
  321. package/payload/platform/plugins/loop/mcp/package.json +21 -0
  322. package/payload/platform/plugins/loop/mcp/src/__tests__/loop-swagger.snapshot.json +26467 -0
  323. package/payload/platform/plugins/loop/mcp/src/__tests__/swagger-write-coverage.test.ts +153 -0
  324. package/payload/platform/plugins/loop/mcp/src/index.ts +444 -0
  325. package/payload/platform/plugins/loop/mcp/src/lib/crypto.ts +105 -0
  326. package/payload/platform/plugins/loop/mcp/src/lib/loop-api.ts +604 -0
  327. package/payload/platform/plugins/loop/mcp/src/lib/neo4j.ts +51 -0
  328. package/payload/platform/plugins/loop/mcp/src/tools/customer-preferences.ts +66 -0
  329. package/payload/platform/plugins/loop/mcp/src/tools/feedback.ts +86 -0
  330. package/payload/platform/plugins/loop/mcp/src/tools/key-deregister.ts +27 -0
  331. package/payload/platform/plugins/loop/mcp/src/tools/key-list.ts +19 -0
  332. package/payload/platform/plugins/loop/mcp/src/tools/key-register.ts +95 -0
  333. package/payload/platform/plugins/loop/mcp/src/tools/marketing-enquiry.ts +113 -0
  334. package/payload/platform/plugins/loop/mcp/src/tools/marketing-match-batch.ts +53 -0
  335. package/payload/platform/plugins/loop/mcp/src/tools/marketing-match-request.ts +42 -0
  336. package/payload/platform/plugins/loop/mcp/src/tools/marketing-match.ts +84 -0
  337. package/payload/platform/plugins/loop/mcp/src/tools/people-detail.ts +245 -0
  338. package/payload/platform/plugins/loop/mcp/src/tools/people-search.ts +180 -0
  339. package/payload/platform/plugins/loop/mcp/src/tools/property-detail.ts +145 -0
  340. package/payload/platform/plugins/loop/mcp/src/tools/property-listed.ts +88 -0
  341. package/payload/platform/plugins/loop/mcp/src/tools/property-request.ts +42 -0
  342. package/payload/platform/plugins/loop/mcp/src/tools/property-search.ts +92 -0
  343. package/payload/platform/plugins/loop/mcp/src/tools/supplier.ts +129 -0
  344. package/payload/platform/plugins/loop/mcp/src/tools/team-availability.ts +52 -0
  345. package/payload/platform/plugins/loop/mcp/src/tools/team-info.ts +95 -0
  346. package/payload/platform/plugins/loop/mcp/src/tools/viewing-create.ts +41 -0
  347. package/payload/platform/plugins/loop/mcp/src/tools/viewing-detail.ts +171 -0
  348. package/payload/platform/plugins/loop/mcp/src/tools/viewing-search.ts +92 -0
  349. package/payload/platform/plugins/loop/mcp/src/tools/viewing-update.ts +53 -0
  350. package/payload/platform/plugins/loop/mcp/tsconfig.json +20 -0
  351. package/payload/platform/plugins/loop/mcp/vitest.config.ts +9 -0
  352. package/payload/platform/plugins/loop/skills/compliance-flag-checker/SKILL.md +53 -0
  353. package/payload/platform/plugins/loop/skills/priority-ranker/SKILL.md +40 -0
  354. package/payload/platform/plugins/loop/skills/tone-matched-drafter/SKILL.md +53 -0
  355. package/payload/platform/plugins/loop/skills/variance-narrator/SKILL.md +50 -0
  356. package/payload/platform/plugins/loop/skills/vendor-research/SKILL.md +54 -0
  357. package/payload/platform/plugins/teaching/.claude-plugin/plugin.json +8 -0
  358. package/payload/platform/plugins/teaching/PLUGIN.md +57 -0
  359. package/payload/platform/plugins/teaching/skills/interactive-tutor/SKILL.md +59 -0
  360. package/payload/platform/plugins/teaching/skills/interactive-tutor/references/assessment.md +70 -0
  361. package/payload/platform/plugins/teaching/skills/interactive-tutor/references/classroom-conduct.md +43 -0
  362. package/payload/platform/plugins/teaching/skills/interactive-tutor/references/teaching-modes.md +83 -0
  363. package/payload/platform/plugins/teaching/skills/lesson-planner/SKILL.md +48 -0
  364. package/payload/platform/plugins/teaching/skills/lesson-planner/references/context-gathering.md +41 -0
  365. package/payload/platform/plugins/teaching/skills/lesson-planner/references/plan-structure.md +94 -0
  366. package/payload/platform/plugins/teaching/skills/study-pack-builder/SKILL.md +52 -0
  367. package/payload/platform/plugins/teaching/skills/study-pack-builder/references/disaggregation.md +49 -0
  368. package/payload/platform/plugins/teaching/skills/study-pack-builder/references/materials.md +116 -0
  369. package/payload/platform/plugins/vendors/.claude-plugin/plugin.json +8 -0
  370. package/payload/platform/plugins/vendors/PLUGIN.md +34 -0
  371. package/payload/platform/plugins/vendors/skills/vendor-communication/SKILL.md +42 -0
  372. package/payload/platform/plugins/vendors/skills/vendor-communication/references/fee-protection-and-agenda.md +28 -0
  373. package/payload/platform/plugins/vendors/skills/vendor-communication/references/listing-scripts.md +44 -0
  374. package/payload/platform/plugins/vendors/skills/vendor-communication/references/negotiation-deep-guide.md +70 -0
  375. package/payload/platform/plugins/vendors/skills/vendor-communication/references/price-alignment-scripts.md +33 -0
  376. package/payload/platform/plugins/vendors/skills/vendor-communication/references/price-alignment.md +34 -0
  377. package/payload/platform/plugins/vendors/skills/vendor-communication/references/scenario-scripts.md +38 -0
  378. package/payload/platform/plugins/vendors/skills/vendor-communication/references/seller-engagement.md +51 -0
  379. package/payload/platform/plugins/vendors/skills/vendor-communication/references/valuation-booking.md +76 -0
  380. package/payload/platform/plugins/vendors/skills/vendor-communication/references/vendor-scripts.md +63 -0
  381. package/payload/platform/plugins/vendors/skills/vendor-communication/references/vendor-updates.md +41 -0
  382. package/payload/platform/plugins/vendors/skills/vendor-updates/SKILL.md +153 -0
  383. package/payload/platform/plugins/writer-craft/.claude-plugin/plugin.json +8 -0
  384. package/payload/platform/plugins/writer-craft/PLUGIN.md +87 -0
  385. package/payload/platform/plugins/writer-craft/agents/writer-craft--manuscript-reviewer.md +92 -0
  386. package/payload/platform/plugins/writer-craft/skills/citation-style/SKILL.md +94 -0
  387. package/payload/platform/plugins/writer-craft/skills/citation-style/references/book-and-chapter-models.md +77 -0
  388. package/payload/platform/plugins/writer-craft/skills/citation-style/references/citation-rules.md +103 -0
  389. package/payload/platform/plugins/writer-craft/skills/citation-style/references/journal-article-models.md +74 -0
  390. package/payload/platform/plugins/writer-craft/skills/citation-style/references/other-source-models.md +146 -0
  391. package/payload/platform/plugins/writer-craft/skills/citation-style/references/reference-list-rules.md +70 -0
  392. package/payload/platform/plugins/writer-craft/skills/editorial-practice/SKILL.md +108 -0
  393. package/payload/platform/plugins/writer-craft/skills/editorial-practice/references/copyediting.md +73 -0
  394. package/payload/platform/plugins/writer-craft/skills/editorial-practice/references/developmental-editing.md +85 -0
  395. package/payload/platform/plugins/writer-craft/skills/editorial-practice/references/genre-specific-editing.md +78 -0
  396. package/payload/platform/plugins/writer-craft/skills/editorial-practice/references/line-editing.md +55 -0
  397. package/payload/platform/plugins/writer-craft/skills/editorial-practice/references/self-editing.md +89 -0
  398. package/payload/platform/plugins/writer-craft/skills/persuasive-storytelling/SKILL.md +114 -0
  399. package/payload/platform/plugins/writer-craft/skills/persuasive-storytelling/references/audience-analysis.md +73 -0
  400. package/payload/platform/plugins/writer-craft/skills/persuasive-storytelling/references/crafting-persuasive-story.md +76 -0
  401. package/payload/platform/plugins/writer-craft/skills/persuasive-storytelling/references/persuasion-case-studies.md +67 -0
  402. package/payload/platform/plugins/writer-craft/skills/persuasive-storytelling/references/transformation-framework.md +86 -0
  403. package/payload/platform/plugins/writer-craft/skills/point-of-view/SKILL.md +97 -0
  404. package/payload/platform/plugins/writer-craft/skills/point-of-view/references/indirect-narration.md +72 -0
  405. package/payload/platform/plugins/writer-craft/skills/point-of-view/references/pov-types-and-voice.md +91 -0
  406. package/payload/platform/plugins/writer-craft/skills/point-of-view/references/protagonist-filter.md +71 -0
  407. package/payload/platform/plugins/writer-craft/skills/point-of-view/references/tense-and-person.md +85 -0
  408. package/payload/platform/plugins/writer-craft/skills/prose-craft/SKILL.md +100 -0
  409. package/payload/platform/plugins/writer-craft/skills/prose-craft/references/punctuation-and-grammar.md +72 -0
  410. package/payload/platform/plugins/writer-craft/skills/prose-craft/references/repetition.md +71 -0
  411. package/payload/platform/plugins/writer-craft/skills/prose-craft/references/sound-and-rhythm.md +64 -0
  412. package/payload/platform/plugins/writer-craft/skills/prose-craft/references/word-economy.md +93 -0
  413. package/payload/platform/plugins/writer-craft/skills/reader-engagement/SKILL.md +100 -0
  414. package/payload/platform/plugins/writer-craft/skills/reader-engagement/references/cause-effect-setup-payoff.md +79 -0
  415. package/payload/platform/plugins/writer-craft/skills/reader-engagement/references/conflict-escalation.md +81 -0
  416. package/payload/platform/plugins/writer-craft/skills/reader-engagement/references/hooking-readers.md +67 -0
  417. package/payload/platform/plugins/writer-craft/skills/reader-engagement/references/neurochemistry-of-engagement.md +94 -0
  418. package/payload/platform/plugins/writer-craft/skills/review-manuscript/SKILL.md +111 -0
  419. package/payload/platform/plugins/writer-craft/skills/review-manuscript/references/review-manuscript-checklist.md +119 -0
  420. package/payload/platform/plugins/writer-craft/skills/review-prose/SKILL.md +99 -0
  421. package/payload/platform/plugins/writer-craft/skills/review-prose/references/prose-review-checklist.md +112 -0
  422. package/payload/platform/plugins/writer-craft/skills/review-scene/SKILL.md +99 -0
  423. package/payload/platform/plugins/writer-craft/skills/review-scene/references/scene-analysis-framework.md +95 -0
  424. package/payload/platform/plugins/writer-craft/skills/story-architecture/SKILL.md +106 -0
  425. package/payload/platform/plugins/writer-craft/skills/story-architecture/references/blueprinting-and-scene-cards.md +118 -0
  426. package/payload/platform/plugins/writer-craft/skills/story-architecture/references/inner-issue-and-protagonist-goal.md +66 -0
  427. package/payload/platform/plugins/writer-craft/skills/story-architecture/references/misbelief-desire-worldview.md +87 -0
  428. package/payload/platform/plugins/writer-craft/skills/story-architecture/references/origin-scenes-and-escalation.md +82 -0
  429. package/payload/platform/plugins/writer-craft/skills/story-blueprint/SKILL.md +133 -0
  430. package/payload/platform/plugins/writer-craft/skills/story-blueprint/references/blueprinting-exercises.md +118 -0
  431. package/payload/platform/plugins/writer-craft/skills/story-blueprint/references/blueprinting-process.md +128 -0
  432. package/payload/platform/services/claude-session-manager/dist/config.d.ts +6 -0
  433. package/payload/platform/services/claude-session-manager/dist/config.d.ts.map +1 -1
  434. package/payload/platform/services/claude-session-manager/dist/config.js +60 -1
  435. package/payload/platform/services/claude-session-manager/dist/config.js.map +1 -1
  436. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts +9 -0
  437. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
  438. package/payload/platform/services/claude-session-manager/dist/http-server.js +34 -0
  439. package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
  440. package/payload/platform/services/claude-session-manager/dist/index.js +12 -0
  441. package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
  442. package/payload/platform/services/claude-session-manager/dist/public-tool-audit.d.ts +33 -0
  443. package/payload/platform/services/claude-session-manager/dist/public-tool-audit.d.ts.map +1 -0
  444. package/payload/platform/services/claude-session-manager/dist/public-tool-audit.js +149 -0
  445. package/payload/platform/services/claude-session-manager/dist/public-tool-audit.js.map +1 -0
  446. package/payload/platform/services/claude-session-manager/dist/spawn-rate-limiter.d.ts +28 -0
  447. package/payload/platform/services/claude-session-manager/dist/spawn-rate-limiter.d.ts.map +1 -0
  448. package/payload/platform/services/claude-session-manager/dist/spawn-rate-limiter.js +77 -0
  449. package/payload/platform/services/claude-session-manager/dist/spawn-rate-limiter.js.map +1 -0
@@ -0,0 +1,245 @@
1
+ import {
2
+ aggregateAcrossTeams,
3
+ formatAggregationResult,
4
+ loopGet,
5
+ } from "../lib/loop-api.js";
6
+
7
+ // ─── Loop API V2: /people/{id} ─────────────────────────────────
8
+ // Fields: id, title, firstName, lastName, contactNotes,
9
+ // primaryPhone, primaryPhoneType, primaryEmail, primaryEmailType,
10
+ // dateCreated, houseNameOrNumber, houseSecondaryNameOrNumber,
11
+ // street, locality, town, district, county, postcode,
12
+ // buyerProfiles[], sellerProfiles[], renterIds[], landlordIds[],
13
+ // gdpr*, communication*
14
+ // ────────────────────────────────────────────────────────────────
15
+ interface LoopPersonDetail {
16
+ id: number;
17
+ title?: string;
18
+ firstName?: string;
19
+ lastName?: string;
20
+ contactNotes?: string;
21
+ primaryPhone?: string;
22
+ primaryPhoneType?: string;
23
+ primaryEmail?: string;
24
+ primaryEmailType?: string;
25
+ dateCreated?: string;
26
+ houseNameOrNumber?: string;
27
+ houseSecondaryNameOrNumber?: string;
28
+ street?: string;
29
+ locality?: string;
30
+ town?: string;
31
+ district?: string;
32
+ county?: string;
33
+ postcode?: string;
34
+ buyerProfiles?: LoopBuyerProfileRef[];
35
+ sellerProfiles?: LoopSellerProfileRef[];
36
+ renterIds?: number[];
37
+ landlordIds?: number[];
38
+ [key: string]: unknown;
39
+ }
40
+
41
+ interface LoopBuyerProfileRef {
42
+ id: number;
43
+ buyerGroupName?: string;
44
+ maxPrice?: number | null;
45
+ minBeds?: number;
46
+ viewingCount?: number;
47
+ offerCount?: number;
48
+ [key: string]: unknown;
49
+ }
50
+
51
+ interface LoopSellerProfileRef {
52
+ id: number;
53
+ sellerGroupName?: string;
54
+ propertyId?: number;
55
+ propertyAddress?: string;
56
+ price?: number;
57
+ propertyStatus?: string;
58
+ [key: string]: unknown;
59
+ }
60
+
61
+ // ─── Loop API V2: /people/buyers/{id} ──────────────────────────
62
+ // Fields: id, buyerGroupName, buyerIsGroup, maxPrice, minBeds,
63
+ // position, requirementNotes, sellingPosition, purchaseReason,
64
+ // financiallyVerified, mortgageOffered, insuranceOffered,
65
+ // people[] (nested PersonSummary), propertyTypes[], searchAreas[],
66
+ // viewings[], offers[]
67
+ // ────────────────────────────────────────────────────────────────
68
+ interface LoopBuyerDetail {
69
+ id: number;
70
+ buyerGroupName?: string;
71
+ buyerIsGroup?: boolean;
72
+ maxPrice?: number | null;
73
+ minBeds?: number;
74
+ position?: string;
75
+ requirementNotes?: string;
76
+ sellingPosition?: string | null;
77
+ purchaseReason?: string | null;
78
+ financiallyVerified?: string | null;
79
+ mortgageOffered?: string | null;
80
+ insuranceOffered?: string | null;
81
+ people?: LoopNestedPerson[];
82
+ propertyTypes?: string[];
83
+ searchAreas?: string[];
84
+ viewings?: Record<string, unknown>[];
85
+ offers?: Record<string, unknown>[];
86
+ [key: string]: unknown;
87
+ }
88
+
89
+ // ─── Loop API V2: /people/sellers/{id} ─────────────────────────
90
+ // Fields: id, sellerGroupName, sellerIsGroup,
91
+ // people[] (nested PersonSummary), property (nested PropertySummary)
92
+ // ────────────────────────────────────────────────────────────────
93
+ interface LoopSellerDetail {
94
+ id: number;
95
+ sellerGroupName?: string;
96
+ sellerIsGroup?: boolean;
97
+ people?: LoopNestedPerson[];
98
+ property?: Record<string, unknown>;
99
+ [key: string]: unknown;
100
+ }
101
+
102
+ interface LoopNestedPerson {
103
+ id: number;
104
+ title?: string;
105
+ firstName?: string;
106
+ lastName?: string;
107
+ contactNotes?: string;
108
+ primaryPhone?: string;
109
+ primaryPhoneType?: string;
110
+ primaryEmail?: string;
111
+ primaryEmailType?: string;
112
+ [key: string]: unknown;
113
+ }
114
+
115
+ type PeopleRole = "buyers" | "sellers" | "renters" | "landlords";
116
+
117
+ export async function peopleDetail(params: {
118
+ accountId: string;
119
+ personId: number;
120
+ role?: PeopleRole;
121
+ teamName?: string;
122
+ }): Promise<string> {
123
+ const { accountId, personId, role, teamName } = params;
124
+
125
+ const result = await aggregateAcrossTeams<Record<string, unknown>>(
126
+ accountId,
127
+ "people",
128
+ "loop-people-detail",
129
+ async (apiKey, team) => {
130
+ const basePath = role ? `/people/${role}` : "/people";
131
+ const path = `${basePath}/${personId}`;
132
+ const data = await loopGet<Record<string, unknown>>(apiKey, path, "loop-people-detail", team);
133
+ if (data && typeof data === "object" && !Array.isArray(data)) {
134
+ return [data];
135
+ }
136
+ return [];
137
+ },
138
+ { teamName }
139
+ );
140
+
141
+ return formatAggregationResult(
142
+ result,
143
+ (record) => formatDetailRecord(record, role),
144
+ "person details"
145
+ );
146
+ }
147
+
148
+ function formatDetailRecord(record: Record<string, unknown>, role?: PeopleRole): string {
149
+ if (role === "buyers") {
150
+ const p = record as unknown as LoopBuyerDetail;
151
+ const lines = [`**${p.buyerGroupName ?? "Unknown"}** [ID: ${p.id}]`];
152
+ if (p.maxPrice != null) lines.push(`Max price: £${p.maxPrice.toLocaleString("en-GB")}`);
153
+ if (p.minBeds) lines.push(`Min beds: ${p.minBeds}`);
154
+ if (p.position && p.position !== "none") lines.push(`Position: ${p.position}`);
155
+ if (p.sellingPosition) lines.push(`Selling position: ${p.sellingPosition}`);
156
+ if (p.purchaseReason) lines.push(`Purchase reason: ${p.purchaseReason}`);
157
+ if (p.financiallyVerified) lines.push(`Financially verified: ${p.financiallyVerified}`);
158
+ if (p.mortgageOffered) lines.push(`Mortgage: ${p.mortgageOffered}`);
159
+ if (p.requirementNotes) lines.push(`Requirements: ${p.requirementNotes}`);
160
+ if (p.propertyTypes?.length) lines.push(`Property types: ${p.propertyTypes.join(", ")}`);
161
+ if (p.searchAreas?.length) lines.push(`Search areas: ${p.searchAreas.join(", ")}`);
162
+ if (p.viewings?.length) lines.push(`Viewings: ${p.viewings.length}`);
163
+ if (p.offers?.length) lines.push(`Offers: ${p.offers.length}`);
164
+
165
+ if (p.people?.length) {
166
+ lines.push(`\n**Contacts (${p.people.length}):**`);
167
+ for (const person of p.people) {
168
+ const name = [person.firstName, person.lastName].filter(Boolean).join(" ");
169
+ const phone = person.primaryPhone ?? "";
170
+ const email = person.primaryEmail ?? "";
171
+ const contact = [phone, email].filter(Boolean).join(" | ");
172
+ lines.push(` - ${name} [ID: ${person.id}]${contact ? ` — ${contact}` : ""}`);
173
+ }
174
+ }
175
+ return lines.join("\n");
176
+ }
177
+
178
+ if (role === "sellers" || role === "landlords") {
179
+ const p = record as unknown as LoopSellerDetail;
180
+ const lines = [`**${p.sellerGroupName ?? "Unknown"}** [ID: ${p.id}]`];
181
+
182
+ if (p.property) {
183
+ const prop = p.property;
184
+ if (prop.propertyAddress) lines.push(`Property: ${prop.propertyAddress}`);
185
+ if (prop.price != null) lines.push(`Price: £${Number(prop.price).toLocaleString("en-GB")}`);
186
+ if (prop.status) lines.push(`Status: ${prop.status}`);
187
+ if (prop.propertyType) lines.push(`Type: ${prop.propertyType}`);
188
+ if (prop.propertyId || prop.id) lines.push(`Property ID: ${prop.propertyId ?? prop.id}`);
189
+ }
190
+
191
+ if (p.people?.length) {
192
+ lines.push(`\n**Contacts (${p.people.length}):**`);
193
+ for (const person of p.people) {
194
+ const name = [person.firstName, person.lastName].filter(Boolean).join(" ");
195
+ const phone = person.primaryPhone ?? "";
196
+ const email = person.primaryEmail ?? "";
197
+ const contact = [phone, email].filter(Boolean).join(" | ");
198
+ lines.push(` - ${name} [ID: ${person.id}]${contact ? ` — ${contact}` : ""}`);
199
+ }
200
+ }
201
+ return lines.join("\n");
202
+ }
203
+
204
+ // Generic /people/{id} — PersonDetail schema
205
+ const p = record as unknown as LoopPersonDetail;
206
+ const title = p.title?.trim() ? `${p.title.trim()} ` : "";
207
+ const name = [p.firstName, p.lastName].filter(Boolean).join(" ") || "Unknown";
208
+ const lines = [`**${title}${name}** [ID: ${p.id}]`];
209
+
210
+ if (p.primaryEmail) lines.push(`Email: ${p.primaryEmail}`);
211
+ if (p.primaryPhone) lines.push(`Phone: ${p.primaryPhone}`);
212
+ if (p.dateCreated) lines.push(`Created: ${p.dateCreated.split("T")[0]}`);
213
+
214
+ // Build address from components
215
+ const addrParts = [
216
+ p.houseSecondaryNameOrNumber,
217
+ p.houseNameOrNumber,
218
+ p.street,
219
+ p.locality,
220
+ p.town,
221
+ p.postcode,
222
+ ].filter(Boolean);
223
+ if (addrParts.length) lines.push(`Address: ${addrParts.join(", ")}`);
224
+
225
+ if (p.contactNotes) lines.push(`Notes: ${p.contactNotes}`);
226
+
227
+ if (p.buyerProfiles?.length) {
228
+ lines.push(`\n**Buyer profiles (${p.buyerProfiles.length}):**`);
229
+ for (const bp of p.buyerProfiles) {
230
+ const bpName = bp.buyerGroupName ?? `Buyer ${bp.id}`;
231
+ const price = bp.maxPrice != null ? ` max £${bp.maxPrice.toLocaleString("en-GB")}` : "";
232
+ lines.push(` - ${bpName} [ID: ${bp.id}]${price}`);
233
+ }
234
+ }
235
+ if (p.sellerProfiles?.length) {
236
+ lines.push(`\n**Seller profiles (${p.sellerProfiles.length}):**`);
237
+ for (const sp of p.sellerProfiles) {
238
+ const spName = sp.sellerGroupName ?? `Seller ${sp.id}`;
239
+ const addr = sp.propertyAddress ? ` — ${sp.propertyAddress}` : "";
240
+ lines.push(` - ${spName} [ID: ${sp.id}]${addr}`);
241
+ }
242
+ }
243
+
244
+ return lines.join("\n");
245
+ }
@@ -0,0 +1,180 @@
1
+ import {
2
+ aggregateAcrossTeams,
3
+ formatAggregationResult,
4
+ loopGet,
5
+ } from "../lib/loop-api.js";
6
+
7
+ // ─── Loop API V2: /people ──────────────────────────────────────
8
+ // Fields: id, title, firstName, lastName, contactNotes,
9
+ // primaryPhone, primaryPhoneType, primaryPhoneNotes,
10
+ // primaryEmail, primaryEmailType, primaryEmailNotes,
11
+ // gdprGeneralMarketing, gdprPropertyMatching, gdprThirdParties,
12
+ // communicationCall, communicationEmail, communicationPost, communicationText
13
+ // ────────────────────────────────────────────────────────────────
14
+ interface LoopPersonSummary {
15
+ id: number;
16
+ title?: string;
17
+ firstName?: string;
18
+ lastName?: string;
19
+ contactNotes?: string;
20
+ primaryPhone?: string;
21
+ primaryPhoneType?: string;
22
+ primaryEmail?: string;
23
+ primaryEmailType?: string;
24
+ [key: string]: unknown;
25
+ }
26
+
27
+ // ─── Loop API V2: /people/buyers ───────────────────────────────
28
+ // Fields: id, buyerGroupName, buyerIsGroup, maxPrice, minBeds,
29
+ // position, sellingPosition, purchaseReason, financiallyVerified,
30
+ // mortgageOffered, insuranceOffered, offerCount, acceptedOfferCount,
31
+ // viewingCount, upcomingViewingCount
32
+ // ────────────────────────────────────────────────────────────────
33
+ interface LoopBuyerSummary {
34
+ id: number;
35
+ buyerGroupName?: string;
36
+ buyerIsGroup?: boolean;
37
+ maxPrice?: number | null;
38
+ minBeds?: number;
39
+ position?: string;
40
+ sellingPosition?: string | null;
41
+ purchaseReason?: string | null;
42
+ financiallyVerified?: string | null;
43
+ mortgageOffered?: string | null;
44
+ insuranceOffered?: string | null;
45
+ offerCount?: number;
46
+ acceptedOfferCount?: number;
47
+ viewingCount?: number;
48
+ upcomingViewingCount?: number;
49
+ [key: string]: unknown;
50
+ }
51
+
52
+ // ─── Loop API V2: /people/sellers ──────────────────────────────
53
+ // Fields: id, sellerGroupName, sellerIsGroup, propertyId,
54
+ // propertyStatus, propertyType, propertyAddress, price,
55
+ // offerCount, acceptedOfferCount, viewingCount, upcomingViewingCount
56
+ // ────────────────────────────────────────────────────────────────
57
+ interface LoopSellerSummary {
58
+ id: number;
59
+ sellerGroupName?: string;
60
+ sellerIsGroup?: boolean;
61
+ propertyId?: number;
62
+ propertyStatus?: string;
63
+ propertyType?: string;
64
+ propertyAddress?: string;
65
+ price?: number;
66
+ offerCount?: number;
67
+ acceptedOfferCount?: number;
68
+ viewingCount?: number;
69
+ upcomingViewingCount?: number;
70
+ [key: string]: unknown;
71
+ }
72
+
73
+ type PeopleRole = "buyers" | "sellers" | "renters" | "landlords";
74
+
75
+ export async function peopleSearch(params: {
76
+ accountId: string;
77
+ role?: PeopleRole;
78
+ searchTerm?: string;
79
+ // Role-specific filters (buyers)
80
+ maxPrice?: number;
81
+ minBeds?: number;
82
+ searchAreas?: string;
83
+ propertyTypes?: string;
84
+ // Role-specific filters (sellers/landlords)
85
+ startDate?: string;
86
+ endDate?: string;
87
+ minPrice?: number;
88
+ // Role-specific filters (renters)
89
+ maxRent?: number;
90
+ teamName?: string;
91
+ limit?: number;
92
+ }): Promise<string> {
93
+ const {
94
+ accountId, role, searchTerm,
95
+ maxPrice, minBeds, searchAreas, propertyTypes,
96
+ startDate, endDate, minPrice, maxRent,
97
+ teamName, limit,
98
+ } = params;
99
+
100
+ // Role-specific endpoints return different schemas — use a generic record
101
+ // type for aggregation, then cast per-role in the formatter.
102
+ const result = await aggregateAcrossTeams<Record<string, unknown>>(
103
+ accountId,
104
+ "people",
105
+ "loop-people-search",
106
+ async (apiKey, team) => {
107
+ const qp: string[] = [];
108
+ if (searchTerm) qp.push(`SearchTerm=${encodeURIComponent(searchTerm)}`);
109
+
110
+ if (role === "buyers") {
111
+ if (maxPrice != null) qp.push(`MaxPrice=${maxPrice}`);
112
+ if (minBeds != null) qp.push(`MinBeds=${minBeds}`);
113
+ if (searchAreas) qp.push(`SearchAreas=${encodeURIComponent(searchAreas)}`);
114
+ if (propertyTypes) qp.push(`PropertyTypes=${encodeURIComponent(propertyTypes)}`);
115
+ } else if (role === "sellers" || role === "landlords") {
116
+ if (startDate) qp.push(`StartDate=${encodeURIComponent(startDate)}`);
117
+ if (endDate) qp.push(`EndDate=${encodeURIComponent(endDate)}`);
118
+ if (minPrice != null) qp.push(`MinPrice=${minPrice}`);
119
+ if (maxPrice != null) qp.push(`MaxPrice=${maxPrice}`);
120
+ } else if (role === "renters") {
121
+ if (maxRent != null) qp.push(`MaxRent=${maxRent}`);
122
+ if (minBeds != null) qp.push(`MinBeds=${minBeds}`);
123
+ if (searchAreas) qp.push(`SearchAreas=${encodeURIComponent(searchAreas)}`);
124
+ if (propertyTypes) qp.push(`PropertyTypes=${encodeURIComponent(propertyTypes)}`);
125
+ } else {
126
+ // Generic /people endpoint
127
+ if (startDate) qp.push(`StartDate=${encodeURIComponent(startDate)}`);
128
+ if (endDate) qp.push(`EndDate=${encodeURIComponent(endDate)}`);
129
+ }
130
+
131
+ const query = qp.length > 0 ? `?${qp.join("&")}` : "";
132
+ const basePath = role ? `/people/${role}` : "/people";
133
+ const path = `${basePath}${query}`;
134
+ const data = await loopGet<Record<string, unknown>[]>(apiKey, path, "loop-people-search", team);
135
+ return Array.isArray(data) ? data : [];
136
+ },
137
+ { teamName, limitPerTeam: limit ?? 50, limitTotal: limit ?? 200 }
138
+ );
139
+
140
+ const entityName = role ?? "people";
141
+ return formatAggregationResult(
142
+ result,
143
+ (record) => formatPersonRecord(record, role),
144
+ entityName
145
+ );
146
+ }
147
+
148
+ function formatPersonRecord(record: Record<string, unknown>, role?: PeopleRole): string {
149
+ if (role === "buyers") {
150
+ const p = record as unknown as LoopBuyerSummary;
151
+ const name = p.buyerGroupName ?? "Unknown";
152
+ const id = p.id != null ? ` [ID: ${p.id}]` : "";
153
+ const price = p.maxPrice != null ? ` — max £${p.maxPrice.toLocaleString("en-GB")}` : "";
154
+ const beds = p.minBeds ? ` ${p.minBeds}+ beds` : "";
155
+ const position = p.position && p.position !== "none" ? ` (${p.position})` : "";
156
+ const viewings = p.viewingCount ? ` | ${p.viewingCount} viewing${p.viewingCount !== 1 ? "s" : ""}` : "";
157
+ const offers = p.offerCount ? ` | ${p.offerCount} offer${p.offerCount !== 1 ? "s" : ""}` : "";
158
+ return `- ${name}${id}${price}${beds}${position}${viewings}${offers}`;
159
+ }
160
+
161
+ if (role === "sellers" || role === "landlords") {
162
+ const p = record as unknown as LoopSellerSummary;
163
+ const name = p.sellerGroupName ?? "Unknown";
164
+ const id = p.id != null ? ` [ID: ${p.id}]` : "";
165
+ const addr = p.propertyAddress ? ` — ${p.propertyAddress}` : "";
166
+ const price = p.price != null ? ` £${p.price.toLocaleString("en-GB")}` : "";
167
+ const status = p.propertyStatus ? ` [${p.propertyStatus}]` : "";
168
+ const viewings = p.viewingCount ? ` | ${p.viewingCount} viewing${p.viewingCount !== 1 ? "s" : ""}` : "";
169
+ const offers = p.offerCount ? ` | ${p.offerCount} offer${p.offerCount !== 1 ? "s" : ""}` : "";
170
+ return `- ${name}${id}${addr}${price}${status}${viewings}${offers}`;
171
+ }
172
+
173
+ // Generic /people or /people/renters — uses PersonSummary schema
174
+ const p = record as unknown as LoopPersonSummary;
175
+ const name = [p.firstName, p.lastName].filter(Boolean).join(" ") || "Unknown";
176
+ const id = p.id != null ? ` [ID: ${p.id}]` : "";
177
+ const contact = p.primaryEmail ?? p.primaryPhone ?? "";
178
+ const title = p.title?.trim() ? `${p.title.trim()} ` : "";
179
+ return `- ${title}${name}${id}${contact ? ` <${contact}>` : ""}`;
180
+ }
@@ -0,0 +1,145 @@
1
+ import {
2
+ aggregateAcrossTeams,
3
+ formatAggregationResult,
4
+ loopGet,
5
+ } from "../lib/loop-api.js";
6
+
7
+ // ─── Loop API V2: /property/residential/{dept}/{id} ────────────
8
+ // Fields: id, refId, address_DisplayAddress, address_HouseNameOrNumber,
9
+ // address_HouseSecondaryNameOrNumber, address_Street, address_Locality,
10
+ // address_Town, address_Postcode, status, propertyType, dateCreated,
11
+ // dateInstructed, dateLaunched, dateExchanged, dateCompleted,
12
+ // dateWithdrawn, shortDescription, fullDescription, bathrooms,
13
+ // bedrooms, receptionRooms, price, priceQualifier, latitude,
14
+ // longitude, parking, outsideSpace, councilTaxBand, floorArea,
15
+ // tenure, serviceCharge, groundRent, features[], images[],
16
+ // marketingFlag_*, creatingAgentId
17
+ // ────────────────────────────────────────────────────────────────
18
+ interface LoopPropertyDetail {
19
+ id: number;
20
+ refId?: string;
21
+ address_DisplayAddress?: string | null;
22
+ address_HouseNameOrNumber?: string;
23
+ address_HouseSecondaryNameOrNumber?: string;
24
+ address_Street?: string;
25
+ address_Locality?: string | null;
26
+ address_Town?: string;
27
+ address_Postcode?: string;
28
+ status?: string;
29
+ propertyType?: string;
30
+ dateCreated?: string;
31
+ dateInstructed?: string | null;
32
+ dateLaunched?: string | null;
33
+ dateExchanged?: string | null;
34
+ dateCompleted?: string | null;
35
+ dateWithdrawn?: string | null;
36
+ shortDescription?: string;
37
+ fullDescription?: string;
38
+ bathrooms?: number;
39
+ bedrooms?: number;
40
+ receptionRooms?: number;
41
+ price?: number;
42
+ priceQualifier?: string;
43
+ latitude?: number;
44
+ longitude?: number;
45
+ parking?: string;
46
+ outsideSpace?: string;
47
+ councilTaxBand?: string;
48
+ floorArea?: number;
49
+ tenure?: string;
50
+ serviceCharge?: number;
51
+ groundRent?: number;
52
+ features?: string[];
53
+ images?: { url: string; mimeType?: string }[];
54
+ creatingAgentId?: string;
55
+ isDirectViewingsEnabled?: boolean;
56
+ [key: string]: unknown;
57
+ }
58
+
59
+ type Department = "sales" | "lettings";
60
+
61
+ export async function propertyDetail(params: {
62
+ accountId: string;
63
+ propertyId: number;
64
+ department: Department;
65
+ previewHash?: number;
66
+ teamName?: string;
67
+ }): Promise<string> {
68
+ const { accountId, propertyId, department, previewHash, teamName } = params;
69
+
70
+ const result = await aggregateAcrossTeams<LoopPropertyDetail>(
71
+ accountId,
72
+ "properties",
73
+ "loop-property-detail",
74
+ async (apiKey, team) => {
75
+ const path = previewHash
76
+ ? `/property/residential/${department}/${propertyId}/preview/${previewHash}`
77
+ : `/property/residential/${department}/${propertyId}`;
78
+ const data = await loopGet<LoopPropertyDetail>(apiKey, path, "loop-property-detail", team);
79
+ if (data && typeof data === "object" && !Array.isArray(data)) {
80
+ return [data];
81
+ }
82
+ return [];
83
+ },
84
+ { teamName }
85
+ );
86
+
87
+ return formatAggregationResult(
88
+ result,
89
+ (p) => {
90
+ // Build display address from components
91
+ const addr = p.address_DisplayAddress
92
+ ?? ([
93
+ p.address_HouseSecondaryNameOrNumber,
94
+ p.address_HouseNameOrNumber,
95
+ p.address_Street,
96
+ p.address_Town,
97
+ p.address_Postcode,
98
+ ].filter(Boolean).join(", ") || "Unknown address");
99
+
100
+ const lines = [`**${addr}** [ID: ${p.id}]`];
101
+ if (p.price != null) {
102
+ const qualifier = p.priceQualifier && p.priceQualifier !== "none" ? ` (${p.priceQualifier})` : "";
103
+ lines.push(`Price: £${p.price.toLocaleString("en-GB")}${qualifier}`);
104
+ }
105
+ if (p.status) lines.push(`Status: ${p.status}`);
106
+ if (p.propertyType) lines.push(`Type: ${p.propertyType}`);
107
+ if (p.bedrooms != null) lines.push(`Bedrooms: ${p.bedrooms}`);
108
+ if (p.bathrooms != null) lines.push(`Bathrooms: ${p.bathrooms}`);
109
+ if (p.receptionRooms != null) lines.push(`Reception rooms: ${p.receptionRooms}`);
110
+ if (p.floorArea) lines.push(`Floor area: ${p.floorArea} sq ft`);
111
+ if (p.tenure && p.tenure !== "None") lines.push(`Tenure: ${p.tenure}`);
112
+ if (p.councilTaxBand) lines.push(`Council Tax: Band ${p.councilTaxBand}`);
113
+ if (p.parking) lines.push(`Parking: ${p.parking}`);
114
+ if (p.outsideSpace) lines.push(`Outside: ${p.outsideSpace}`);
115
+ if (p.serviceCharge) lines.push(`Service charge: £${p.serviceCharge}`);
116
+ if (p.groundRent) lines.push(`Ground rent: £${p.groundRent}`);
117
+
118
+ // Key dates
119
+ const dates: string[] = [];
120
+ if (p.dateInstructed) dates.push(`Instructed: ${p.dateInstructed.split("T")[0]}`);
121
+ if (p.dateLaunched) dates.push(`Launched: ${p.dateLaunched.split("T")[0]}`);
122
+ if (p.dateExchanged) dates.push(`Exchanged: ${p.dateExchanged.split("T")[0]}`);
123
+ if (p.dateCompleted) dates.push(`Completed: ${p.dateCompleted.split("T")[0]}`);
124
+ if (p.dateWithdrawn) dates.push(`Withdrawn: ${p.dateWithdrawn.split("T")[0]}`);
125
+ if (dates.length) lines.push(dates.join(" | "));
126
+
127
+ if (p.features?.length) {
128
+ lines.push(`Features: ${p.features.join(", ")}`);
129
+ }
130
+
131
+ if (p.images?.length) {
132
+ lines.push(`Images: ${p.images.length} photo${p.images.length !== 1 ? "s" : ""}`);
133
+ }
134
+
135
+ // Short description — strip HTML tags for readability
136
+ if (p.shortDescription) {
137
+ const clean = p.shortDescription.replace(/<[^>]+>/g, "").trim();
138
+ if (clean) lines.push(`\n${clean}`);
139
+ }
140
+
141
+ return lines.join("\n");
142
+ },
143
+ "property details"
144
+ );
145
+ }
@@ -0,0 +1,88 @@
1
+ import {
2
+ aggregateAcrossTeams,
3
+ formatAggregationResult,
4
+ loopGet,
5
+ } from "../lib/loop-api.js";
6
+
7
+ // ─── Loop API V2: /property/residential/{dept}/listed/{channel} ─
8
+ // Returns full property detail enriched with listing metadata:
9
+ // listingId, propertyId, propertyRefId, channel, displayAddress,
10
+ // propertyAddress, address_* fields, status, propertyType,
11
+ // dateLaunched, price, bedrooms, bathrooms, receptionRooms,
12
+ // shortDescription, features[], images[]
13
+ // ─────────────────────────────────────────────────────────────────
14
+ interface LoopPropertyListing {
15
+ listingId?: number;
16
+ propertyId?: number;
17
+ propertyRefId?: string;
18
+ channel?: string;
19
+ propertyAddress?: string;
20
+ displayAddress?: string;
21
+ status?: string;
22
+ propertyType?: string;
23
+ dateLaunched?: string;
24
+ price?: number;
25
+ priceQualifier?: string;
26
+ bedrooms?: number;
27
+ bathrooms?: number;
28
+ receptionRooms?: number;
29
+ shortDescription?: string;
30
+ features?: string[];
31
+ images?: { url: string }[];
32
+ [key: string]: unknown;
33
+ }
34
+
35
+ type Department = "sales" | "lettings" | "both";
36
+ type Channel = "rightmove" | "onTheMarket" | "zoopla" | "website";
37
+
38
+ export async function propertyListed(params: {
39
+ accountId: string;
40
+ channel: Channel;
41
+ department?: Department;
42
+ includeSold?: boolean;
43
+ teamName?: string;
44
+ limit?: number;
45
+ }): Promise<string> {
46
+ const { accountId, channel, department = "both", includeSold = false, teamName, limit } = params;
47
+
48
+ const result = await aggregateAcrossTeams<LoopPropertyListing>(
49
+ accountId,
50
+ "properties",
51
+ "loop-property-listed",
52
+ async (apiKey, team) => {
53
+ const all: LoopPropertyListing[] = [];
54
+ const depts: string[] =
55
+ department === "both" ? ["sales", "lettings"] : [department];
56
+
57
+ for (const dept of depts) {
58
+ const path = `/property/residential/${dept}/listed/${channel}`;
59
+ const data = await loopGet<LoopPropertyListing[]>(apiKey, path, "loop-property-listed", team);
60
+ if (Array.isArray(data)) all.push(...data);
61
+ }
62
+
63
+ if (includeSold) {
64
+ const soldPath = `/property/residential/sold/${channel}`;
65
+ const soldData = await loopGet<LoopPropertyListing[]>(apiKey, soldPath, "loop-property-listed", team);
66
+ if (Array.isArray(soldData)) all.push(...soldData);
67
+ }
68
+
69
+ return all;
70
+ },
71
+ { teamName, limitPerTeam: limit ?? 50, limitTotal: limit ?? 200 }
72
+ );
73
+
74
+ return formatAggregationResult(
75
+ result,
76
+ (p) => {
77
+ const addr = p.displayAddress ?? p.propertyAddress ?? "Unknown address";
78
+ const id = p.propertyId != null ? ` [ID: ${p.propertyId}]` : "";
79
+ const price = p.price ? ` — £${p.price.toLocaleString("en-GB")}` : "";
80
+ const beds = p.bedrooms ? ` ${p.bedrooms}bed` : "";
81
+ const propType = p.propertyType ? ` (${p.propertyType})` : "";
82
+ const status = p.status ? ` [${p.status}]` : "";
83
+ const photos = p.images?.length ? ` ${p.images.length} photo${p.images.length !== 1 ? "s" : ""}` : "";
84
+ return `- ${addr}${id}${price}${beds}${propType}${status}${photos}`;
85
+ },
86
+ `${channel} listings`
87
+ );
88
+ }