@rubytech/create-maxy-code 0.1.26 → 0.1.28
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/dist/index.js +38 -11
- package/package.json +1 -1
- package/payload/platform/lib/oauth-llm/dist/index.d.ts +4 -6
- package/payload/platform/lib/oauth-llm/dist/index.d.ts.map +1 -1
- package/payload/platform/lib/oauth-llm/dist/index.js +4 -6
- package/payload/platform/lib/oauth-llm/dist/index.js.map +1 -1
- package/payload/platform/lib/oauth-llm/src/index.ts +4 -6
- package/payload/platform/package-lock.json +0 -41
- package/payload/platform/plugins/.claude-plugin/marketplace.json +5 -95
- package/payload/platform/plugins/brochures/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/brochures/PLUGIN.md +36 -0
- package/payload/platform/plugins/brochures/commands/make-brochure.md +11 -0
- package/payload/platform/plugins/brochures/skills/a4-print-documents/SKILL.md +478 -0
- package/payload/platform/plugins/brochures/skills/brand-design/SKILL.md +192 -0
- package/payload/platform/plugins/brochures/skills/make-brochure/SKILL.md +354 -0
- package/payload/platform/plugins/brochures/skills/make-brochure/references/seller-brief-template.md +115 -0
- package/payload/platform/plugins/brochures/skills/property-brochure/SKILL.md +119 -0
- package/payload/platform/plugins/brochures/skills/property-brochure/references/build.md +270 -0
- package/payload/platform/plugins/brochures/skills/property-brochure/references/copy.md +211 -0
- package/payload/platform/plugins/brochures/skills/property-brochure/references/images.md +166 -0
- package/payload/platform/plugins/brochures/skills/property-brochure/references/index-landing.md +376 -0
- package/payload/platform/plugins/brochures/skills/property-brochure/references/index.html +1288 -0
- package/payload/platform/plugins/brochures/skills/property-brochure/references/placeholders.md +250 -0
- package/payload/platform/plugins/brochures/skills/property-brochure/references/registers.md +47 -0
- package/payload/platform/plugins/brochures/skills/property-brochure/references/seller-brief.md +56 -0
- package/payload/platform/plugins/brochures/skills/property-brochure/references/structure.md +249 -0
- package/payload/platform/plugins/brochures/skills/property-brochure/references/template.html +2370 -0
- package/payload/platform/plugins/brochures/skills/property-extract/SKILL.md +372 -0
- package/payload/platform/plugins/buyers/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/buyers/PLUGIN.md +35 -0
- package/payload/platform/plugins/buyers/skills/buyer-feedback/SKILL.md +109 -0
- package/payload/platform/plugins/buyers/skills/buyer-management/SKILL.md +42 -0
- package/payload/platform/plugins/buyers/skills/buyer-management/references/buyer-qualification-questions.md +16 -0
- package/payload/platform/plugins/buyers/skills/buyer-management/references/buyer-qualification.md +59 -0
- package/payload/platform/plugins/buyers/skills/buyer-management/references/buyer-scripts.md +63 -0
- package/payload/platform/plugins/buyers/skills/buyer-management/references/buyer-working-scripts.md +54 -0
- package/payload/platform/plugins/buyers/skills/buyer-management/references/feedback-collection.md +42 -0
- package/payload/platform/plugins/buyers/skills/buyer-management/references/offer-capture.md +38 -0
- package/payload/platform/plugins/buyers/skills/buyer-management/references/viewing-booking.md +32 -0
- package/payload/platform/plugins/buyers/skills/buyer-management/references/viewing-management.md +52 -0
- package/payload/platform/plugins/buyers/skills/buyer-seller-guides/SKILL.md +407 -0
- package/payload/platform/plugins/buyers/skills/buyer-seller-guides/references/care-fees-guide.md +68 -0
- package/payload/platform/plugins/buyers/skills/buyer-seller-guides/references/divorce-sales-guide.md +61 -0
- package/payload/platform/plugins/buyers/skills/buyer-seller-guides/references/downsizing-guide.md +45 -0
- package/payload/platform/plugins/buyers/skills/buyer-seller-guides/references/first-time-buyers.md +92 -0
- package/payload/platform/plugins/buyers/skills/buyer-seller-guides/references/first-time-sellers.md +78 -0
- package/payload/platform/plugins/buyers/skills/buyer-seller-guides/references/probate-guide.md +53 -0
- package/payload/platform/plugins/buyers/skills/buyer-seller-guides/references/upsizing-guide.md +41 -0
- package/payload/platform/plugins/buyers/skills/property-enquiry/SKILL.md +126 -0
- package/payload/platform/plugins/buyers/skills/viewing-management/SKILL.md +111 -0
- package/payload/platform/plugins/email/mcp/package.json +0 -1
- package/payload/platform/plugins/estate-business/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/estate-business/PLUGIN.md +65 -0
- package/payload/platform/plugins/estate-business/skills/business-growth/SKILL.md +133 -0
- package/payload/platform/plugins/estate-business/skills/business-growth/references/buy-back-your-time.md +37 -0
- package/payload/platform/plugins/estate-business/skills/business-growth/references/firewave-gost-scorecards.md +14 -0
- package/payload/platform/plugins/estate-business/skills/business-growth/references/keller-org-model.md +17 -0
- package/payload/platform/plugins/estate-business/skills/business-growth/references/lencioni-team-models.md +22 -0
- package/payload/platform/plugins/estate-business/skills/business-growth/references/listing-management-system.md +11 -0
- package/payload/platform/plugins/estate-business/skills/business-growth/references/net-figure-form.md +11 -0
- package/payload/platform/plugins/estate-business/skills/business-growth/references/serhant-bizinbox-notes.md +13 -0
- package/payload/platform/plugins/estate-business/skills/business-growth/references/team-roles-commission.md +14 -0
- package/payload/platform/plugins/estate-business/skills/business-growth/references/va-2026-ops.md +43 -0
- package/payload/platform/plugins/estate-business/skills/business-growth/references/wingman-structure.md +13 -0
- package/payload/platform/plugins/estate-business/skills/business-operations/SKILL.md +32 -0
- package/payload/platform/plugins/estate-business/skills/business-operations/references/crm-systems.md +57 -0
- package/payload/platform/plugins/estate-business/skills/business-operations/references/hiring-guide.md +59 -0
- package/payload/platform/plugins/estate-business/skills/business-operations/references/impact-framework.md +47 -0
- package/payload/platform/plugins/estate-business/skills/business-operations/references/minutes-equal-money.md +55 -0
- package/payload/platform/plugins/estate-business/skills/business-operations/references/team-management.md +48 -0
- package/payload/platform/plugins/estate-business/skills/commission-calculator/SKILL.md +40 -0
- package/payload/platform/plugins/estate-business/skills/exp-partnership/SKILL.md +52 -0
- package/payload/platform/plugins/estate-business/skills/exp-partnership/references/12-reasons.md +39 -0
- package/payload/platform/plugins/estate-business/skills/exp-partnership/references/95-5-system.md +66 -0
- package/payload/platform/plugins/estate-business/skills/exp-partnership/references/agent-attraction-scripts.md +90 -0
- package/payload/platform/plugins/estate-business/skills/exp-partnership/references/business-partnership.md +92 -0
- package/payload/platform/plugins/estate-business/skills/exp-partnership/references/exp-model-overview.md +66 -0
- package/payload/platform/plugins/estate-business/skills/exp-partnership/references/model-comparison.md +66 -0
- package/payload/platform/plugins/estate-business/skills/exp-partnership/references/revenue-share-explained.md +57 -0
- package/payload/platform/plugins/estate-business/skills/month-end-close/SKILL.md +69 -0
- package/payload/platform/plugins/estate-business/skills/payment-batch-stager/SKILL.md +42 -0
- package/payload/platform/plugins/estate-business/skills/period-reconciler/SKILL.md +42 -0
- package/payload/platform/plugins/estate-business/skills/personal-branding/SKILL.md +117 -0
- package/payload/platform/plugins/estate-business/skills/personal-branding/references/attraction-agent-notes.md +31 -0
- package/payload/platform/plugins/estate-business/skills/personal-branding/references/attraction-agent.md +58 -0
- package/payload/platform/plugins/estate-business/skills/personal-branding/references/authenticity-boundaries.md +28 -0
- package/payload/platform/plugins/estate-business/skills/personal-branding/references/become-a-brand-leader-notes.md +19 -0
- package/payload/platform/plugins/estate-business/skills/personal-branding/references/blast-formula.md +42 -0
- package/payload/platform/plugins/estate-business/skills/personal-branding/references/brand-leader.md +48 -0
- package/payload/platform/plugins/estate-business/skills/personal-branding/references/brand-strategy-system.md +59 -0
- package/payload/platform/plugins/estate-business/skills/personal-branding/references/content-engine.md +49 -0
- package/payload/platform/plugins/estate-business/skills/personal-branding/references/firewave-blast-and-blogging.md +23 -0
- package/payload/platform/plugins/estate-business/skills/personal-branding/references/gary-v-content.md +52 -0
- package/payload/platform/plugins/estate-business/skills/personal-branding/references/gary-v-principles.md +20 -0
- package/payload/platform/plugins/estate-business/skills/personal-branding/references/oversubscribed-positioning.md +18 -0
- package/payload/platform/plugins/estate-business/skills/personal-branding/references/platforms.md +41 -0
- package/payload/platform/plugins/estate-business/skills/personal-branding/references/priestley-oversubscribed.md +54 -0
- package/payload/platform/plugins/estate-business/skills/personal-branding/references/storeys-style-examples.md +25 -0
- package/payload/platform/plugins/estate-business/skills/personal-branding/references/visual-identity.md +27 -0
- package/payload/platform/plugins/estate-coaching/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/estate-coaching/PLUGIN.md +55 -0
- package/payload/platform/plugins/estate-coaching/skills/agent-performance/SKILL.md +371 -0
- package/payload/platform/plugins/estate-coaching/skills/agent-performance/references/atomic-habits.md +52 -0
- package/payload/platform/plugins/estate-coaching/skills/agent-performance/references/daily-routine-scorecard.md +104 -0
- package/payload/platform/plugins/estate-coaching/skills/agent-performance/references/hp6-model.md +63 -0
- package/payload/platform/plugins/estate-coaching/skills/agent-performance/references/twelve-week-year.md +71 -0
- package/payload/platform/plugins/estate-coaching/skills/bespoke-coaching/SKILL.md +36 -0
- package/payload/platform/plugins/estate-coaching/skills/bespoke-coaching/references/coaching-boundaries.md +56 -0
- package/payload/platform/plugins/estate-coaching/skills/bespoke-coaching/references/feedback-framework.md +61 -0
- package/payload/platform/plugins/estate-coaching/skills/bespoke-coaching/references/performance-framework.md +109 -0
- package/payload/platform/plugins/estate-coaching/skills/coaching-toolkit/SKILL.md +421 -0
- package/payload/platform/plugins/estate-coaching/skills/coaching-toolkit/references/coaching-exercises.md +86 -0
- package/payload/platform/plugins/estate-coaching/skills/coaching-toolkit/references/goal-setting.md +78 -0
- package/payload/platform/plugins/estate-coaching/skills/coaching-toolkit/references/one-to-one-framework.md +92 -0
- package/payload/platform/plugins/estate-coaching/skills/coaching-toolkit/references/soi-workbook.md +103 -0
- package/payload/platform/plugins/estate-coaching/skills/serhant-training/SKILL.md +410 -0
- package/payload/platform/plugins/estate-coaching/skills/serhant-training/references/agent-training-guide.md +70 -0
- package/payload/platform/plugins/estate-coaching/skills/serhant-training/references/business-in-a-box.md +72 -0
- package/payload/platform/plugins/estate-coaching/skills/serhant-training/references/buyers-guide.md +53 -0
- package/payload/platform/plugins/estate-coaching/skills/serhant-training/references/codo-method.md +72 -0
- package/payload/platform/plugins/estate-coaching/skills/serhant-training/references/website-planning-guide.md +79 -0
- package/payload/platform/plugins/estate-onboarding/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/estate-onboarding/PLUGIN.md +31 -0
- package/payload/platform/plugins/estate-onboarding/skills/bootstrap/SKILL.md +26 -0
- package/payload/platform/plugins/estate-onboarding/skills/bootstrap/references/onboarding-flow.md +63 -0
- package/payload/platform/plugins/estate-sales/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/estate-sales/PLUGIN.md +53 -0
- package/payload/platform/plugins/estate-sales/skills/chase-progression/SKILL.md +107 -0
- package/payload/platform/plugins/estate-sales/skills/negotiation/SKILL.md +35 -0
- package/payload/platform/plugins/estate-sales/skills/negotiation/references/deal-saving.md +47 -0
- package/payload/platform/plugins/estate-sales/skills/negotiation/references/negotiation-deep-guide.md +64 -0
- package/payload/platform/plugins/estate-sales/skills/negotiation/references/negotiation-prep-principles.md +29 -0
- package/payload/platform/plugins/estate-sales/skills/negotiation/references/negotiation-techniques.md +42 -0
- package/payload/platform/plugins/estate-sales/skills/negotiation/references/offer-presentation.md +43 -0
- package/payload/platform/plugins/estate-sales/skills/risk-scorer/SKILL.md +42 -0
- package/payload/platform/plugins/estate-sales/skills/sales-closer/SKILL.md +24 -0
- package/payload/platform/plugins/estate-sales/skills/sales-closer/references/serhant-emotion-stages.md +36 -0
- package/payload/platform/plugins/estate-sales/skills/sales-discovery/SKILL.md +30 -0
- package/payload/platform/plugins/estate-sales/skills/sales-discovery/references/chris-voss-discovery.md +88 -0
- package/payload/platform/plugins/estate-sales/skills/sales-discovery/references/firewave-gost-journey.md +68 -0
- package/payload/platform/plugins/estate-sales/skills/sales-discovery/references/phil-jones-openers.md +78 -0
- package/payload/platform/plugins/estate-sales/skills/sales-discovery/references/pre-listing-checklist.md +77 -0
- package/payload/platform/plugins/estate-sales/skills/sales-discovery/references/serhant-improv.md +22 -0
- package/payload/platform/plugins/estate-sales/skills/sales-discovery/references/tom-ferry-discovery.md +103 -0
- package/payload/platform/plugins/estate-sales/skills/sales-discovery/references/vendor-motivation-competitor.md +52 -0
- package/payload/platform/plugins/estate-sales/skills/sales-negotiation/SKILL.md +29 -0
- package/payload/platform/plugins/estate-sales/skills/sales-negotiation/references/chris-voss-negotiation.md +70 -0
- package/payload/platform/plugins/estate-sales/skills/sales-negotiation/references/phil-jones-price-words.md +40 -0
- package/payload/platform/plugins/estate-sales/skills/sales-negotiation/references/serhant-negotiation-plus.md +55 -0
- package/payload/platform/plugins/estate-sales/skills/sales-negotiation/references/tom-panos-commission-pricing.md +57 -0
- package/payload/platform/plugins/estate-sales/skills/sales-negotiation/references/tony-morris-questioning.md +54 -0
- package/payload/platform/plugins/estate-sales/skills/sales-progression/SKILL.md +27 -0
- package/payload/platform/plugins/estate-sales/skills/sales-progression/references/conveyancing-guide.md +54 -0
- package/payload/platform/plugins/estate-sales/skills/sales-progression/references/transaction-tracking.md +66 -0
- package/payload/platform/plugins/estate-teaching/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/estate-teaching/PLUGIN.md +31 -0
- package/payload/platform/plugins/estate-teaching/skills/content-directory/SKILL.md +39 -0
- package/payload/platform/plugins/estate-teaching/skills/content-directory/references/module-delivery.md +65 -0
- package/payload/platform/plugins/estate-teaching/skills/content-directory/references/progress-tracking.md +47 -0
- package/payload/platform/plugins/leads/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/leads/PLUGIN.md +62 -0
- package/payload/platform/plugins/leads/skills/chain-progression-tracker/SKILL.md +51 -0
- package/payload/platform/plugins/leads/skills/diary-builder/SKILL.md +38 -0
- package/payload/platform/plugins/leads/skills/enquiry-triage/SKILL.md +36 -0
- package/payload/platform/plugins/leads/skills/lead-nurturing/SKILL.md +137 -0
- package/payload/platform/plugins/leads/skills/lead-nurturing/references/buyer-search-letter.md +28 -0
- package/payload/platform/plugins/leads/skills/lead-nurturing/references/buyer-search-letters.md +37 -0
- package/payload/platform/plugins/leads/skills/lead-nurturing/references/database-reactivation.md +30 -0
- package/payload/platform/plugins/leads/skills/lead-nurturing/references/email-nurture-sequences.md +45 -0
- package/payload/platform/plugins/leads/skills/lead-nurturing/references/facebook-referrals.md +30 -0
- package/payload/platform/plugins/leads/skills/lead-nurturing/references/firewave-email-nurture-sequences.md +41 -0
- package/payload/platform/plugins/leads/skills/lead-nurturing/references/keller-33-touch.md +34 -0
- package/payload/platform/plugins/leads/skills/lead-nurturing/references/neighbour-letters.md +31 -0
- package/payload/platform/plugins/leads/skills/lead-nurturing/references/neighbour-notification-letter.md +20 -0
- package/payload/platform/plugins/leads/skills/lead-nurturing/references/ofi-follow-up-dialogue.md +22 -0
- package/payload/platform/plugins/leads/skills/lead-nurturing/references/ofi-follow-up.md +26 -0
- package/payload/platform/plugins/leads/skills/lead-nurturing/references/serhant-three-fs-plus.md +21 -0
- package/payload/platform/plugins/leads/skills/lead-nurturing/references/sharran-10x10x10.md +18 -0
- package/payload/platform/plugins/leads/skills/lead-nurturing/references/sms-templates.md +40 -0
- package/payload/platform/plugins/leads/skills/lead-nurturing/references/sphere-of-influence-notes.md +34 -0
- package/payload/platform/plugins/leads/skills/lead-nurturing/references/sphere-of-influence.md +60 -0
- package/payload/platform/plugins/leads/skills/lead-nurturing/references/tom-panos-sms-templates.md +59 -0
- package/payload/platform/plugins/leads/skills/morning-round/SKILL.md +72 -0
- package/payload/platform/plugins/leads/skills/prospecting/SKILL.md +33 -0
- package/payload/platform/plugins/leads/skills/prospecting/references/database-matching.md +30 -0
- package/payload/platform/plugins/leads/skills/prospecting/references/database-value.md +53 -0
- package/payload/platform/plugins/leads/skills/prospecting/references/prospecting-dialogues.md +24 -0
- package/payload/platform/plugins/leads/skills/prospecting/references/reactivation.md +34 -0
- package/payload/platform/plugins/listings/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/listings/PLUGIN.md +103 -0
- package/payload/platform/plugins/listings/skills/comparable-finder/SKILL.md +52 -0
- package/payload/platform/plugins/listings/skills/epc-checker/SKILL.md +38 -0
- package/payload/platform/plugins/listings/skills/home-preparation/SKILL.md +28 -0
- package/payload/platform/plugins/listings/skills/home-preparation/references/kerb-appeal.md +38 -0
- package/payload/platform/plugins/listings/skills/home-preparation/references/photo-day.md +59 -0
- package/payload/platform/plugins/listings/skills/home-preparation/references/situational-tips.md +50 -0
- package/payload/platform/plugins/listings/skills/home-preparation/references/staging-guide.md +52 -0
- package/payload/platform/plugins/listings/skills/listing-copy-writer/SKILL.md +55 -0
- package/payload/platform/plugins/listings/skills/listing-presentation/SKILL.md +286 -0
- package/payload/platform/plugins/listings/skills/listing-presentation/references/booking-script.md +51 -0
- package/payload/platform/plugins/listings/skills/listing-presentation/references/objection-scripts.md +193 -0
- package/payload/platform/plugins/listings/skills/listing-presentation/references/penhaul-presentation.md +123 -0
- package/payload/platform/plugins/listings/skills/listing-presentation/references/pre-listing-kit.md +139 -0
- package/payload/platform/plugins/listings/skills/listing-presentation/references/set-to-sell.md +55 -0
- package/payload/platform/plugins/listings/skills/listing-presentation/references/sharran-frameworks.md +107 -0
- package/payload/platform/plugins/listings/skills/local-market-stats/SKILL.md +33 -0
- package/payload/platform/plugins/listings/skills/new-instruction/SKILL.md +78 -0
- package/payload/platform/plugins/listings/skills/particulars-builder/SKILL.md +48 -0
- package/payload/platform/plugins/listings/skills/portal-launch-scheduler/SKILL.md +49 -0
- package/payload/platform/plugins/listings/skills/pricing-scenario-builder/SKILL.md +35 -0
- package/payload/platform/plugins/listings/skills/property-marketing/SKILL.md +337 -0
- package/payload/platform/plugins/listings/skills/property-marketing/references/auction-report-template.md +41 -0
- package/payload/platform/plugins/listings/skills/property-marketing/references/coming-soon-campaign.md +43 -0
- package/payload/platform/plugins/listings/skills/property-marketing/references/direct-mail-templates.md +121 -0
- package/payload/platform/plugins/listings/skills/property-marketing/references/eoi-form-template.md +62 -0
- package/payload/platform/plugins/listings/skills/property-marketing/references/monthly-scorecard.md +63 -0
- package/payload/platform/plugins/listings/skills/supplier-booker/SKILL.md +39 -0
- package/payload/platform/plugins/listings/skills/talk-track-composer/SKILL.md +36 -0
- package/payload/platform/plugins/listings/skills/terms-of-business-drafter/SKILL.md +54 -0
- package/payload/platform/plugins/listings/skills/valuation-prep/SKILL.md +69 -0
- package/payload/platform/plugins/loop/.claude-plugin/plugin.json +17 -0
- package/payload/platform/plugins/loop/PLUGIN.md +108 -0
- package/payload/platform/plugins/loop/mcp/dist/index.d.ts +2 -0
- package/payload/platform/plugins/loop/mcp/dist/index.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/index.js +293 -0
- package/payload/platform/plugins/loop/mcp/dist/index.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/lib/crypto.d.ts +10 -0
- package/payload/platform/plugins/loop/mcp/dist/lib/crypto.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/lib/crypto.js +88 -0
- package/payload/platform/plugins/loop/mcp/dist/lib/crypto.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/lib/loop-api.d.ts +82 -0
- package/payload/platform/plugins/loop/mcp/dist/lib/loop-api.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/lib/loop-api.js +427 -0
- package/payload/platform/plugins/loop/mcp/dist/lib/loop-api.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/lib/neo4j.d.ts +5 -0
- package/payload/platform/plugins/loop/mcp/dist/lib/neo4j.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/lib/neo4j.js +40 -0
- package/payload/platform/plugins/loop/mcp/dist/lib/neo4j.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/customer-preferences.d.ts +10 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/customer-preferences.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/customer-preferences.js +24 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/customer-preferences.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/feedback.d.ts +16 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/feedback.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/feedback.js +35 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/feedback.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/key-deregister.d.ts +5 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/key-deregister.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/key-deregister.js +19 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/key-deregister.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/key-list.d.ts +4 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/key-list.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/key-list.js +14 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/key-list.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/key-register.d.ts +9 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/key-register.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/key-register.js +60 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/key-register.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/marketing-enquiry.d.ts +13 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/marketing-enquiry.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/marketing-enquiry.js +41 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/marketing-enquiry.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match-batch.d.ts +9 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match-batch.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match-batch.js +16 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match-batch.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match-request.d.ts +15 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match-request.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match-request.js +11 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match-request.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match.d.ts +10 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match.js +39 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/marketing-match.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/people-detail.d.ts +9 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/people-detail.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/people-detail.js +125 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/people-detail.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/people-search.d.ts +18 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/people-search.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/people-search.js +87 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/people-search.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/property-detail.d.ts +10 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/property-detail.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/property-detail.js +82 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/property-detail.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/property-listed.d.ts +12 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/property-listed.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/property-listed.js +32 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/property-listed.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/property-request.d.ts +15 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/property-request.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/property-request.js +11 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/property-request.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/property-search.d.ts +16 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/property-search.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/property-search.js +41 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/property-search.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/supplier.d.ts +13 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/supplier.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/supplier.js +49 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/supplier.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/team-availability.d.ts +7 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/team-availability.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/team-availability.js +19 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/team-availability.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/team-info.d.ts +5 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/team-info.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/team-info.js +32 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/team-info.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/viewing-create.d.ts +14 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/viewing-create.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/viewing-create.js +11 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/viewing-create.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/viewing-detail.d.ts +9 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/viewing-detail.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/viewing-detail.js +85 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/viewing-detail.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/viewing-search.d.ts +13 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/viewing-search.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/viewing-search.js +44 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/viewing-search.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/viewing-update.d.ts +14 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/viewing-update.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/viewing-update.js +18 -0
- package/payload/platform/plugins/loop/mcp/dist/tools/viewing-update.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/package-lock.json +2549 -0
- package/payload/platform/plugins/loop/mcp/package.json +21 -0
- package/payload/platform/plugins/loop/mcp/src/__tests__/loop-swagger.snapshot.json +26467 -0
- package/payload/platform/plugins/loop/mcp/src/__tests__/swagger-write-coverage.test.ts +153 -0
- package/payload/platform/plugins/loop/mcp/src/index.ts +444 -0
- package/payload/platform/plugins/loop/mcp/src/lib/crypto.ts +105 -0
- package/payload/platform/plugins/loop/mcp/src/lib/loop-api.ts +604 -0
- package/payload/platform/plugins/loop/mcp/src/lib/neo4j.ts +51 -0
- package/payload/platform/plugins/loop/mcp/src/tools/customer-preferences.ts +66 -0
- package/payload/platform/plugins/loop/mcp/src/tools/feedback.ts +86 -0
- package/payload/platform/plugins/loop/mcp/src/tools/key-deregister.ts +27 -0
- package/payload/platform/plugins/loop/mcp/src/tools/key-list.ts +19 -0
- package/payload/platform/plugins/loop/mcp/src/tools/key-register.ts +95 -0
- package/payload/platform/plugins/loop/mcp/src/tools/marketing-enquiry.ts +113 -0
- package/payload/platform/plugins/loop/mcp/src/tools/marketing-match-batch.ts +53 -0
- package/payload/platform/plugins/loop/mcp/src/tools/marketing-match-request.ts +42 -0
- package/payload/platform/plugins/loop/mcp/src/tools/marketing-match.ts +84 -0
- package/payload/platform/plugins/loop/mcp/src/tools/people-detail.ts +245 -0
- package/payload/platform/plugins/loop/mcp/src/tools/people-search.ts +180 -0
- package/payload/platform/plugins/loop/mcp/src/tools/property-detail.ts +145 -0
- package/payload/platform/plugins/loop/mcp/src/tools/property-listed.ts +88 -0
- package/payload/platform/plugins/loop/mcp/src/tools/property-request.ts +42 -0
- package/payload/platform/plugins/loop/mcp/src/tools/property-search.ts +92 -0
- package/payload/platform/plugins/loop/mcp/src/tools/supplier.ts +129 -0
- package/payload/platform/plugins/loop/mcp/src/tools/team-availability.ts +52 -0
- package/payload/platform/plugins/loop/mcp/src/tools/team-info.ts +95 -0
- package/payload/platform/plugins/loop/mcp/src/tools/viewing-create.ts +41 -0
- package/payload/platform/plugins/loop/mcp/src/tools/viewing-detail.ts +171 -0
- package/payload/platform/plugins/loop/mcp/src/tools/viewing-search.ts +92 -0
- package/payload/platform/plugins/loop/mcp/src/tools/viewing-update.ts +53 -0
- package/payload/platform/plugins/loop/mcp/tsconfig.json +20 -0
- package/payload/platform/plugins/loop/mcp/vitest.config.ts +9 -0
- package/payload/platform/plugins/loop/skills/compliance-flag-checker/SKILL.md +53 -0
- package/payload/platform/plugins/loop/skills/priority-ranker/SKILL.md +40 -0
- package/payload/platform/plugins/loop/skills/tone-matched-drafter/SKILL.md +53 -0
- package/payload/platform/plugins/loop/skills/variance-narrator/SKILL.md +50 -0
- package/payload/platform/plugins/loop/skills/vendor-research/SKILL.md +54 -0
- package/payload/platform/plugins/memory/mcp/package.json +0 -1
- package/payload/platform/plugins/teaching/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/teaching/PLUGIN.md +57 -0
- package/payload/platform/plugins/teaching/skills/interactive-tutor/SKILL.md +59 -0
- package/payload/platform/plugins/teaching/skills/interactive-tutor/references/assessment.md +70 -0
- package/payload/platform/plugins/teaching/skills/interactive-tutor/references/classroom-conduct.md +43 -0
- package/payload/platform/plugins/teaching/skills/interactive-tutor/references/teaching-modes.md +83 -0
- package/payload/platform/plugins/teaching/skills/lesson-planner/SKILL.md +48 -0
- package/payload/platform/plugins/teaching/skills/lesson-planner/references/context-gathering.md +41 -0
- package/payload/platform/plugins/teaching/skills/lesson-planner/references/plan-structure.md +94 -0
- package/payload/platform/plugins/teaching/skills/study-pack-builder/SKILL.md +52 -0
- package/payload/platform/plugins/teaching/skills/study-pack-builder/references/disaggregation.md +49 -0
- package/payload/platform/plugins/teaching/skills/study-pack-builder/references/materials.md +116 -0
- package/payload/platform/plugins/vendors/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/vendors/PLUGIN.md +34 -0
- package/payload/platform/plugins/vendors/skills/vendor-communication/SKILL.md +42 -0
- package/payload/platform/plugins/vendors/skills/vendor-communication/references/fee-protection-and-agenda.md +28 -0
- package/payload/platform/plugins/vendors/skills/vendor-communication/references/listing-scripts.md +44 -0
- package/payload/platform/plugins/vendors/skills/vendor-communication/references/negotiation-deep-guide.md +70 -0
- package/payload/platform/plugins/vendors/skills/vendor-communication/references/price-alignment-scripts.md +33 -0
- package/payload/platform/plugins/vendors/skills/vendor-communication/references/price-alignment.md +34 -0
- package/payload/platform/plugins/vendors/skills/vendor-communication/references/scenario-scripts.md +38 -0
- package/payload/platform/plugins/vendors/skills/vendor-communication/references/seller-engagement.md +51 -0
- package/payload/platform/plugins/vendors/skills/vendor-communication/references/valuation-booking.md +76 -0
- package/payload/platform/plugins/vendors/skills/vendor-communication/references/vendor-scripts.md +63 -0
- package/payload/platform/plugins/vendors/skills/vendor-communication/references/vendor-updates.md +41 -0
- package/payload/platform/plugins/vendors/skills/vendor-updates/SKILL.md +153 -0
- package/payload/platform/plugins/writer-craft/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/writer-craft/PLUGIN.md +87 -0
- package/payload/platform/plugins/writer-craft/agents/writer-craft--manuscript-reviewer.md +92 -0
- package/payload/platform/plugins/writer-craft/skills/citation-style/SKILL.md +94 -0
- package/payload/platform/plugins/writer-craft/skills/citation-style/references/book-and-chapter-models.md +77 -0
- package/payload/platform/plugins/writer-craft/skills/citation-style/references/citation-rules.md +103 -0
- package/payload/platform/plugins/writer-craft/skills/citation-style/references/journal-article-models.md +74 -0
- package/payload/platform/plugins/writer-craft/skills/citation-style/references/other-source-models.md +146 -0
- package/payload/platform/plugins/writer-craft/skills/citation-style/references/reference-list-rules.md +70 -0
- package/payload/platform/plugins/writer-craft/skills/editorial-practice/SKILL.md +108 -0
- package/payload/platform/plugins/writer-craft/skills/editorial-practice/references/copyediting.md +73 -0
- package/payload/platform/plugins/writer-craft/skills/editorial-practice/references/developmental-editing.md +85 -0
- package/payload/platform/plugins/writer-craft/skills/editorial-practice/references/genre-specific-editing.md +78 -0
- package/payload/platform/plugins/writer-craft/skills/editorial-practice/references/line-editing.md +55 -0
- package/payload/platform/plugins/writer-craft/skills/editorial-practice/references/self-editing.md +89 -0
- package/payload/platform/plugins/writer-craft/skills/persuasive-storytelling/SKILL.md +114 -0
- package/payload/platform/plugins/writer-craft/skills/persuasive-storytelling/references/audience-analysis.md +73 -0
- package/payload/platform/plugins/writer-craft/skills/persuasive-storytelling/references/crafting-persuasive-story.md +76 -0
- package/payload/platform/plugins/writer-craft/skills/persuasive-storytelling/references/persuasion-case-studies.md +67 -0
- package/payload/platform/plugins/writer-craft/skills/persuasive-storytelling/references/transformation-framework.md +86 -0
- package/payload/platform/plugins/writer-craft/skills/point-of-view/SKILL.md +97 -0
- package/payload/platform/plugins/writer-craft/skills/point-of-view/references/indirect-narration.md +72 -0
- package/payload/platform/plugins/writer-craft/skills/point-of-view/references/pov-types-and-voice.md +91 -0
- package/payload/platform/plugins/writer-craft/skills/point-of-view/references/protagonist-filter.md +71 -0
- package/payload/platform/plugins/writer-craft/skills/point-of-view/references/tense-and-person.md +85 -0
- package/payload/platform/plugins/writer-craft/skills/prose-craft/SKILL.md +100 -0
- package/payload/platform/plugins/writer-craft/skills/prose-craft/references/punctuation-and-grammar.md +72 -0
- package/payload/platform/plugins/writer-craft/skills/prose-craft/references/repetition.md +71 -0
- package/payload/platform/plugins/writer-craft/skills/prose-craft/references/sound-and-rhythm.md +64 -0
- package/payload/platform/plugins/writer-craft/skills/prose-craft/references/word-economy.md +93 -0
- package/payload/platform/plugins/writer-craft/skills/reader-engagement/SKILL.md +100 -0
- package/payload/platform/plugins/writer-craft/skills/reader-engagement/references/cause-effect-setup-payoff.md +79 -0
- package/payload/platform/plugins/writer-craft/skills/reader-engagement/references/conflict-escalation.md +81 -0
- package/payload/platform/plugins/writer-craft/skills/reader-engagement/references/hooking-readers.md +67 -0
- package/payload/platform/plugins/writer-craft/skills/reader-engagement/references/neurochemistry-of-engagement.md +94 -0
- package/payload/platform/plugins/writer-craft/skills/review-manuscript/SKILL.md +111 -0
- package/payload/platform/plugins/writer-craft/skills/review-manuscript/references/review-manuscript-checklist.md +119 -0
- package/payload/platform/plugins/writer-craft/skills/review-prose/SKILL.md +99 -0
- package/payload/platform/plugins/writer-craft/skills/review-prose/references/prose-review-checklist.md +112 -0
- package/payload/platform/plugins/writer-craft/skills/review-scene/SKILL.md +99 -0
- package/payload/platform/plugins/writer-craft/skills/review-scene/references/scene-analysis-framework.md +95 -0
- package/payload/platform/plugins/writer-craft/skills/story-architecture/SKILL.md +106 -0
- package/payload/platform/plugins/writer-craft/skills/story-architecture/references/blueprinting-and-scene-cards.md +118 -0
- package/payload/platform/plugins/writer-craft/skills/story-architecture/references/inner-issue-and-protagonist-goal.md +66 -0
- package/payload/platform/plugins/writer-craft/skills/story-architecture/references/misbelief-desire-worldview.md +87 -0
- package/payload/platform/plugins/writer-craft/skills/story-architecture/references/origin-scenes-and-escalation.md +82 -0
- package/payload/platform/plugins/writer-craft/skills/story-blueprint/SKILL.md +133 -0
- package/payload/platform/plugins/writer-craft/skills/story-blueprint/references/blueprinting-exercises.md +118 -0
- package/payload/platform/plugins/writer-craft/skills/story-blueprint/references/blueprinting-process.md +128 -0
- package/payload/platform/services/claude-session-manager/dist/config.d.ts +6 -0
- package/payload/platform/services/claude-session-manager/dist/config.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/config.js +60 -1
- package/payload/platform/services/claude-session-manager/dist/config.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.d.ts +9 -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 +34 -0
- package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/index.js +12 -0
- package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/public-tool-audit.d.ts +33 -0
- package/payload/platform/services/claude-session-manager/dist/public-tool-audit.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/public-tool-audit.js +149 -0
- package/payload/platform/services/claude-session-manager/dist/public-tool-audit.js.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/spawn-rate-limiter.d.ts +28 -0
- package/payload/platform/services/claude-session-manager/dist/spawn-rate-limiter.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/spawn-rate-limiter.js +77 -0
- package/payload/platform/services/claude-session-manager/dist/spawn-rate-limiter.js.map +1 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { loopPost, withTeamKey } from "../lib/loop-api.js";
|
|
2
|
+
|
|
3
|
+
type Department = "sales" | "lettings";
|
|
4
|
+
type RequestAction = "viewing" | "call-back" | "information";
|
|
5
|
+
|
|
6
|
+
// ─── Loop API V2: POST /property/residential/{dept}/{id}/{action}
|
|
7
|
+
// Actions: viewing, call-back, information
|
|
8
|
+
// Request body: { name?, email?, phone?, message? }
|
|
9
|
+
// Response: boolean success
|
|
10
|
+
// ────────────────────────────────────────────────────────────────
|
|
11
|
+
interface LoopBooleanResponse {
|
|
12
|
+
success?: boolean;
|
|
13
|
+
[key: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export async function propertyRequest(params: {
|
|
17
|
+
accountId: string;
|
|
18
|
+
teamName: string;
|
|
19
|
+
propertyId: number;
|
|
20
|
+
department: Department;
|
|
21
|
+
action: RequestAction;
|
|
22
|
+
name?: string;
|
|
23
|
+
email?: string;
|
|
24
|
+
phone?: string;
|
|
25
|
+
message?: string;
|
|
26
|
+
}): Promise<string> {
|
|
27
|
+
const { accountId, teamName, propertyId, department, action, ...body } = params;
|
|
28
|
+
|
|
29
|
+
const result = await withTeamKey<LoopBooleanResponse>(
|
|
30
|
+
accountId,
|
|
31
|
+
teamName,
|
|
32
|
+
"properties",
|
|
33
|
+
"loop-property-request",
|
|
34
|
+
async (apiKey) => {
|
|
35
|
+
const path = `/property/residential/${department}/${propertyId}/${action}`;
|
|
36
|
+
return loopPost<LoopBooleanResponse>(apiKey, path, body, "loop-property-request", teamName);
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
const actionLabel = action === "call-back" ? "callback" : action;
|
|
41
|
+
return `${actionLabel} request submitted for property ${propertyId} (${department}) via team "${teamName}".`;
|
|
42
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import {
|
|
2
|
+
aggregateAcrossTeams,
|
|
3
|
+
formatAggregationResult,
|
|
4
|
+
loopGet,
|
|
5
|
+
} from "../lib/loop-api.js";
|
|
6
|
+
|
|
7
|
+
// ─── Loop API V2: /property/residential/{dept} ─────────────────
|
|
8
|
+
// Fields: id, refId, propertyAddress, status, propertyType,
|
|
9
|
+
// dateCreated, price, bedrooms, offerCount, viewingCount,
|
|
10
|
+
// publishedToPortals, publishedToWebsite, publishedToMatching
|
|
11
|
+
// ────────────────────────────────────────────────────────────────
|
|
12
|
+
interface LoopPropertySummary {
|
|
13
|
+
id: number;
|
|
14
|
+
refId?: string;
|
|
15
|
+
propertyAddress?: string;
|
|
16
|
+
status?: string;
|
|
17
|
+
propertyType?: string;
|
|
18
|
+
dateCreated?: string;
|
|
19
|
+
price?: number;
|
|
20
|
+
bedrooms?: number;
|
|
21
|
+
offerCount?: number;
|
|
22
|
+
viewingCount?: number;
|
|
23
|
+
publishedToPortals?: boolean;
|
|
24
|
+
publishedToWebsite?: boolean;
|
|
25
|
+
publishedToMatching?: boolean;
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
type Department = "sales" | "lettings" | "both";
|
|
30
|
+
|
|
31
|
+
export async function propertySearch(params: {
|
|
32
|
+
accountId: string;
|
|
33
|
+
department?: Department;
|
|
34
|
+
searchTerm?: string;
|
|
35
|
+
minPrice?: number;
|
|
36
|
+
maxPrice?: number;
|
|
37
|
+
minBedrooms?: number;
|
|
38
|
+
maxBedrooms?: number;
|
|
39
|
+
propertyStatuses?: string;
|
|
40
|
+
propertyTypes?: string;
|
|
41
|
+
teamName?: string;
|
|
42
|
+
limit?: number;
|
|
43
|
+
}): Promise<string> {
|
|
44
|
+
const {
|
|
45
|
+
accountId, department = "both", searchTerm, minPrice, maxPrice,
|
|
46
|
+
minBedrooms, maxBedrooms, propertyStatuses, propertyTypes,
|
|
47
|
+
teamName, limit,
|
|
48
|
+
} = params;
|
|
49
|
+
|
|
50
|
+
const result = await aggregateAcrossTeams<LoopPropertySummary>(
|
|
51
|
+
accountId,
|
|
52
|
+
"properties",
|
|
53
|
+
"loop-property-search",
|
|
54
|
+
async (apiKey, team) => {
|
|
55
|
+
const depts: string[] =
|
|
56
|
+
department === "both" ? ["sales", "lettings"] : [department];
|
|
57
|
+
const all: LoopPropertySummary[] = [];
|
|
58
|
+
|
|
59
|
+
for (const dept of depts) {
|
|
60
|
+
const qp: string[] = [];
|
|
61
|
+
if (searchTerm) qp.push(`SearchTerm=${encodeURIComponent(searchTerm)}`);
|
|
62
|
+
if (minPrice != null) qp.push(`MinPrice=${minPrice}`);
|
|
63
|
+
if (maxPrice != null) qp.push(`MaxPrice=${maxPrice}`);
|
|
64
|
+
if (minBedrooms != null) qp.push(`MinBedrooms=${minBedrooms}`);
|
|
65
|
+
if (maxBedrooms != null) qp.push(`MaxBedrooms=${maxBedrooms}`);
|
|
66
|
+
if (propertyStatuses) qp.push(`PropertyStatuses=${encodeURIComponent(propertyStatuses)}`);
|
|
67
|
+
if (propertyTypes) qp.push(`PropertyTypes=${encodeURIComponent(propertyTypes)}`);
|
|
68
|
+
|
|
69
|
+
const query = qp.length > 0 ? `?${qp.join("&")}` : "";
|
|
70
|
+
const path = `/property/residential/${dept}${query}`;
|
|
71
|
+
const data = await loopGet<LoopPropertySummary[]>(apiKey, path, "loop-property-search", team);
|
|
72
|
+
if (Array.isArray(data)) all.push(...data);
|
|
73
|
+
}
|
|
74
|
+
return all;
|
|
75
|
+
},
|
|
76
|
+
{ teamName, limitPerTeam: limit ?? 50, limitTotal: limit ?? 200 }
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
return formatAggregationResult(
|
|
80
|
+
result,
|
|
81
|
+
(p) => {
|
|
82
|
+
const id = p.id != null ? ` [ID: ${p.id}]` : "";
|
|
83
|
+
const price = p.price ? ` — £${p.price.toLocaleString("en-GB")}` : "";
|
|
84
|
+
const beds = p.bedrooms ? ` ${p.bedrooms}bed` : "";
|
|
85
|
+
const status = p.status ? ` [${p.status}]` : "";
|
|
86
|
+
const propType = p.propertyType ? ` (${p.propertyType})` : "";
|
|
87
|
+
const offers = p.offerCount ? ` ${p.offerCount} offer${p.offerCount !== 1 ? "s" : ""}` : "";
|
|
88
|
+
return `- ${p.propertyAddress ?? "Unknown address"}${id}${price}${beds}${propType}${status}${offers}`;
|
|
89
|
+
},
|
|
90
|
+
"properties"
|
|
91
|
+
);
|
|
92
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { loopGet, loopPost, loopPut, withTeamKey } from "../lib/loop-api.js";
|
|
2
|
+
|
|
3
|
+
type SupplierAction =
|
|
4
|
+
| "maintenance-jobs"
|
|
5
|
+
| "maintenance-complete"
|
|
6
|
+
| "maintenance-quotes"
|
|
7
|
+
| "maintenance-submit-quote"
|
|
8
|
+
| "board-jobs"
|
|
9
|
+
| "board-complete";
|
|
10
|
+
|
|
11
|
+
// ─── Loop API V2: Supplier Endpoints ───────────────────────────
|
|
12
|
+
// /supplier/maintenance/{code}/{jobId}/job-list — GET job list
|
|
13
|
+
// /supplier/maintenance/{code}/{jobId}/complete — POST complete
|
|
14
|
+
// /supplier/maintenance/{code}/{jobId}/quote-list — GET quotes
|
|
15
|
+
// /supplier/maintenance/{code}/{quoteId}/quote-for-job — PUT quote
|
|
16
|
+
// /supplier/board-contractor/{code}/{jobId}/job-list — GET jobs
|
|
17
|
+
// /supplier/board-contractor/{code}/{jobId}/complete — POST complete
|
|
18
|
+
// Uses quoteCode/code (string) and jobId (int64)
|
|
19
|
+
// ────────────────────────────────────────────────────────────────
|
|
20
|
+
interface LoopSupplierResult {
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface LoopBooleanResponse {
|
|
25
|
+
success?: boolean;
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export async function supplier(params: {
|
|
30
|
+
accountId: string;
|
|
31
|
+
teamName: string;
|
|
32
|
+
action: SupplierAction;
|
|
33
|
+
code: string;
|
|
34
|
+
jobId?: number;
|
|
35
|
+
// For maintenance-submit-quote
|
|
36
|
+
quoteId?: number;
|
|
37
|
+
quoteData?: Record<string, unknown>;
|
|
38
|
+
// For board-complete
|
|
39
|
+
completionData?: Record<string, unknown>;
|
|
40
|
+
}): Promise<string> {
|
|
41
|
+
const { accountId, teamName, action, code } = params;
|
|
42
|
+
|
|
43
|
+
// jobId is required for all actions except maintenance-submit-quote
|
|
44
|
+
const jobId = params.jobId;
|
|
45
|
+
if (action !== "maintenance-submit-quote" && jobId == null) {
|
|
46
|
+
throw new Error(`jobId is required for action "${action}".`);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (action === "maintenance-jobs") {
|
|
50
|
+
const result = await withTeamKey<LoopSupplierResult>(
|
|
51
|
+
accountId, teamName, "supplier", "loop-supplier",
|
|
52
|
+
async (apiKey) => {
|
|
53
|
+
return loopGet<LoopSupplierResult>(
|
|
54
|
+
apiKey, `/supplier/maintenance/${encodeURIComponent(code)}/${jobId}/job-list`,
|
|
55
|
+
"loop-supplier", teamName
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
return JSON.stringify(result, null, 2);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (action === "maintenance-complete") {
|
|
63
|
+
await withTeamKey<LoopBooleanResponse>(
|
|
64
|
+
accountId, teamName, "supplier", "loop-supplier",
|
|
65
|
+
async (apiKey) => {
|
|
66
|
+
return loopPost<LoopBooleanResponse>(
|
|
67
|
+
apiKey, `/supplier/maintenance/${encodeURIComponent(code)}/${jobId}/complete`,
|
|
68
|
+
{}, "loop-supplier", teamName
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
return `Maintenance job ${jobId} marked complete via team "${teamName}".`;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (action === "maintenance-quotes") {
|
|
76
|
+
const result = await withTeamKey<LoopSupplierResult>(
|
|
77
|
+
accountId, teamName, "supplier", "loop-supplier",
|
|
78
|
+
async (apiKey) => {
|
|
79
|
+
return loopGet<LoopSupplierResult>(
|
|
80
|
+
apiKey, `/supplier/maintenance/${encodeURIComponent(code)}/${jobId}/quote-list`,
|
|
81
|
+
"loop-supplier", teamName
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
return JSON.stringify(result, null, 2);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (action === "maintenance-submit-quote") {
|
|
89
|
+
if (!params.quoteId) throw new Error("quoteId is required for maintenance-submit-quote.");
|
|
90
|
+
await withTeamKey<LoopBooleanResponse>(
|
|
91
|
+
accountId, teamName, "supplier", "loop-supplier",
|
|
92
|
+
async (apiKey) => {
|
|
93
|
+
return loopPut<LoopBooleanResponse>(
|
|
94
|
+
apiKey, `/supplier/maintenance/${encodeURIComponent(code)}/${params.quoteId}/quote-for-job`,
|
|
95
|
+
params.quoteData ?? {}, "loop-supplier", teamName
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
return `Quote ${params.quoteId} submitted via team "${teamName}".`;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (action === "board-jobs") {
|
|
103
|
+
const result = await withTeamKey<LoopSupplierResult>(
|
|
104
|
+
accountId, teamName, "supplier", "loop-supplier",
|
|
105
|
+
async (apiKey) => {
|
|
106
|
+
return loopGet<LoopSupplierResult>(
|
|
107
|
+
apiKey, `/supplier/board-contractor/${encodeURIComponent(code)}/${jobId}/job-list`,
|
|
108
|
+
"loop-supplier", teamName
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
return JSON.stringify(result, null, 2);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (action === "board-complete") {
|
|
116
|
+
await withTeamKey<LoopBooleanResponse>(
|
|
117
|
+
accountId, teamName, "supplier", "loop-supplier",
|
|
118
|
+
async (apiKey) => {
|
|
119
|
+
return loopPost<LoopBooleanResponse>(
|
|
120
|
+
apiKey, `/supplier/board-contractor/${encodeURIComponent(code)}/${jobId}/complete`,
|
|
121
|
+
params.completionData ?? {}, "loop-supplier", teamName
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
return `Board contractor job ${jobId} marked complete via team "${teamName}".`;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
throw new Error(`Unknown supplier action: ${action}`);
|
|
129
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
aggregateAcrossTeams,
|
|
3
|
+
formatAggregationResult,
|
|
4
|
+
loopGet,
|
|
5
|
+
} from "../lib/loop-api.js";
|
|
6
|
+
|
|
7
|
+
// ─── Loop API V2: /team/{agentId}/availability/{searchDate} ────
|
|
8
|
+
// Returns array of: { agentId, start, end }
|
|
9
|
+
// Times are ISO datetime strings (e.g. "2026-04-10T06:00:00")
|
|
10
|
+
// ────────────────────────────────────────────────────────────────
|
|
11
|
+
interface LoopTimeRange {
|
|
12
|
+
agentId?: string;
|
|
13
|
+
start?: string;
|
|
14
|
+
end?: string;
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export async function teamAvailability(params: {
|
|
19
|
+
accountId: string;
|
|
20
|
+
agentId: string;
|
|
21
|
+
searchDate: string;
|
|
22
|
+
teamName?: string;
|
|
23
|
+
}): Promise<string> {
|
|
24
|
+
const { accountId, agentId, searchDate, teamName } = params;
|
|
25
|
+
|
|
26
|
+
const result = await aggregateAcrossTeams<LoopTimeRange>(
|
|
27
|
+
accountId,
|
|
28
|
+
"team",
|
|
29
|
+
"loop-team-availability",
|
|
30
|
+
async (apiKey, team) => {
|
|
31
|
+
const path = `/team/${encodeURIComponent(agentId)}/availability/${encodeURIComponent(searchDate)}`;
|
|
32
|
+
const data = await loopGet<LoopTimeRange[]>(apiKey, path, "loop-team-availability", team);
|
|
33
|
+
return Array.isArray(data) ? data : [];
|
|
34
|
+
},
|
|
35
|
+
{ teamName }
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
return formatAggregationResult(
|
|
39
|
+
result,
|
|
40
|
+
(slot) => {
|
|
41
|
+
const start = slot.start ? formatTime(slot.start) : "?";
|
|
42
|
+
const end = slot.end ? formatTime(slot.end) : "?";
|
|
43
|
+
return `- ${start} — ${end}`;
|
|
44
|
+
},
|
|
45
|
+
`availability slots for ${searchDate}`
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function formatTime(iso: string): string {
|
|
50
|
+
const timePart = iso.split("T")[1];
|
|
51
|
+
return timePart ? timePart.slice(0, 5) : iso;
|
|
52
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import {
|
|
2
|
+
aggregateAcrossTeams,
|
|
3
|
+
formatAggregationResult,
|
|
4
|
+
loopGet,
|
|
5
|
+
} from "../lib/loop-api.js";
|
|
6
|
+
|
|
7
|
+
// ─── Loop API V2: /team ────────────────────────────────────────
|
|
8
|
+
// Fields: apiKey (redacted), clientName, teamName,
|
|
9
|
+
// address1, address2, address3, email, phoneNumber, websiteUrl,
|
|
10
|
+
// primaryDarkColour, primaryLightColour, secondaryDarkColour,
|
|
11
|
+
// secondaryLightColour, legalName, websiteContactUrl,
|
|
12
|
+
// websitePropertiesUrl, dateCreated,
|
|
13
|
+
// members[] (each: id, firstName, lastName, email, mobilePhone,
|
|
14
|
+
// jobTitle, signatureImageUrl, avatarImage, avatarMedium,
|
|
15
|
+
// avatarThumbnail, biography, customUrl, twitterUrl)
|
|
16
|
+
// ────────────────────────────────────────────────────────────────
|
|
17
|
+
interface LoopTeam {
|
|
18
|
+
clientName?: string;
|
|
19
|
+
teamName?: string;
|
|
20
|
+
address1?: string;
|
|
21
|
+
address2?: string;
|
|
22
|
+
address3?: string;
|
|
23
|
+
email?: string;
|
|
24
|
+
phoneNumber?: string;
|
|
25
|
+
websiteUrl?: string;
|
|
26
|
+
legalName?: string;
|
|
27
|
+
dateCreated?: string;
|
|
28
|
+
members?: LoopTeamMember[];
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
interface LoopTeamMember {
|
|
33
|
+
id: string;
|
|
34
|
+
firstName?: string;
|
|
35
|
+
lastName?: string;
|
|
36
|
+
email?: string;
|
|
37
|
+
mobilePhone?: string;
|
|
38
|
+
jobTitle?: string;
|
|
39
|
+
biography?: string;
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export async function teamInfo(params: {
|
|
44
|
+
accountId: string;
|
|
45
|
+
teamName?: string;
|
|
46
|
+
}): Promise<string> {
|
|
47
|
+
const { accountId, teamName } = params;
|
|
48
|
+
|
|
49
|
+
const result = await aggregateAcrossTeams<LoopTeam>(
|
|
50
|
+
accountId,
|
|
51
|
+
"team",
|
|
52
|
+
"loop-team-info",
|
|
53
|
+
async (apiKey, team) => {
|
|
54
|
+
const data = await loopGet<LoopTeam>(
|
|
55
|
+
apiKey,
|
|
56
|
+
"/team",
|
|
57
|
+
"loop-team-info",
|
|
58
|
+
team
|
|
59
|
+
);
|
|
60
|
+
// /team returns a single object, not an array
|
|
61
|
+
if (data && typeof data === "object" && !Array.isArray(data)) {
|
|
62
|
+
return [data];
|
|
63
|
+
}
|
|
64
|
+
return Array.isArray(data) ? data : [];
|
|
65
|
+
},
|
|
66
|
+
{ teamName }
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
return formatAggregationResult(
|
|
70
|
+
result,
|
|
71
|
+
(t) => {
|
|
72
|
+
const name = t.teamName ?? t.clientName ?? "Unknown";
|
|
73
|
+
const client = t.clientName && t.clientName !== t.teamName ? ` (${t.clientName})` : "";
|
|
74
|
+
const addr = t.address1 ? ` — ${t.address1}` : "";
|
|
75
|
+
const phone = t.phoneNumber ? ` | ${t.phoneNumber}` : "";
|
|
76
|
+
const email = t.email ? ` | ${t.email}` : "";
|
|
77
|
+
const web = t.websiteUrl ? ` | ${t.websiteUrl}` : "";
|
|
78
|
+
|
|
79
|
+
const lines = [`- **${name}**${client}${addr}${phone}${email}${web}`];
|
|
80
|
+
|
|
81
|
+
if (t.members?.length) {
|
|
82
|
+
lines.push(` Team members (${t.members.length}):`);
|
|
83
|
+
for (const m of t.members) {
|
|
84
|
+
const mName = [m.firstName, m.lastName].filter(Boolean).join(" ");
|
|
85
|
+
const title = m.jobTitle ? ` (${m.jobTitle})` : "";
|
|
86
|
+
const mEmail = m.email ? ` — ${m.email}` : "";
|
|
87
|
+
lines.push(` - ${mName} [ID: ${m.id}]${title}${mEmail}`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return lines.join("\n");
|
|
92
|
+
},
|
|
93
|
+
"teams"
|
|
94
|
+
);
|
|
95
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { loopPost, withTeamKey } from "../lib/loop-api.js";
|
|
2
|
+
|
|
3
|
+
type Department = "sales" | "lettings";
|
|
4
|
+
|
|
5
|
+
// ─── Loop API V2: POST /residential/{dept}/viewings ────────────
|
|
6
|
+
// Request body: { propertyId, date, time, attendeeName,
|
|
7
|
+
// attendeeEmail?, attendeePhone? }
|
|
8
|
+
// Response: number (the created viewing ID) in data field
|
|
9
|
+
// ────────────────────────────────────────────────────────────────
|
|
10
|
+
interface LoopNumberResponse {
|
|
11
|
+
result?: number;
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export async function viewingCreate(params: {
|
|
16
|
+
accountId: string;
|
|
17
|
+
teamName: string;
|
|
18
|
+
department: Department;
|
|
19
|
+
propertyId: number;
|
|
20
|
+
date: string;
|
|
21
|
+
time: string;
|
|
22
|
+
attendeeName: string;
|
|
23
|
+
attendeeEmail?: string;
|
|
24
|
+
attendeePhone?: string;
|
|
25
|
+
}): Promise<string> {
|
|
26
|
+
const { accountId, teamName, department, ...body } = params;
|
|
27
|
+
|
|
28
|
+
const result = await withTeamKey<LoopNumberResponse>(
|
|
29
|
+
accountId,
|
|
30
|
+
teamName,
|
|
31
|
+
"viewings",
|
|
32
|
+
"loop-viewing-create",
|
|
33
|
+
async (apiKey) => {
|
|
34
|
+
const path = `/residential/${department}/viewings`;
|
|
35
|
+
return loopPost<LoopNumberResponse>(apiKey, path, body, "loop-viewing-create", teamName);
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
const viewingId = result.result ?? "unknown";
|
|
40
|
+
return `Viewing created (ID: ${viewingId}) for property ${params.propertyId} on ${params.date} at ${params.time} via team "${teamName}".`;
|
|
41
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import {
|
|
2
|
+
aggregateAcrossTeams,
|
|
3
|
+
formatAggregationResult,
|
|
4
|
+
loopGet,
|
|
5
|
+
} from "../lib/loop-api.js";
|
|
6
|
+
|
|
7
|
+
// ─── Loop API V2: /residential/{dept}/viewings/{id} ────────────
|
|
8
|
+
// Fields: id, dateCreated, dateOfAppointment, dateOfAppointmentEnd,
|
|
9
|
+
// dateBuyerFeedbackGiven, dateSellerFeedbackGiven, dateDone,
|
|
10
|
+
// status, type, comment, buyerFeedback, sellerFeedback,
|
|
11
|
+
// buyerConfirmed, sellerConfirmed, agentConfirmed,
|
|
12
|
+
// property (nested PropertySummary), buyer (nested BuyerSummary),
|
|
13
|
+
// seller (nested SellerSummary),
|
|
14
|
+
// attendingAgent (nested TeamMember), creatingAgent (nested TeamMember),
|
|
15
|
+
// teamId
|
|
16
|
+
// ────────────────────────────────────────────────────────────────
|
|
17
|
+
interface LoopViewingDetail {
|
|
18
|
+
id: number;
|
|
19
|
+
dateCreated?: string;
|
|
20
|
+
dateOfAppointment?: string;
|
|
21
|
+
dateOfAppointmentEnd?: string;
|
|
22
|
+
dateBuyerFeedbackGiven?: string | null;
|
|
23
|
+
dateSellerFeedbackGiven?: string | null;
|
|
24
|
+
dateDone?: string | null;
|
|
25
|
+
status?: string;
|
|
26
|
+
type?: string;
|
|
27
|
+
comment?: string | null;
|
|
28
|
+
buyerFeedback?: string | null;
|
|
29
|
+
sellerFeedback?: string | null;
|
|
30
|
+
buyerConfirmed?: boolean;
|
|
31
|
+
sellerConfirmed?: boolean;
|
|
32
|
+
agentConfirmed?: boolean;
|
|
33
|
+
property?: {
|
|
34
|
+
id: number;
|
|
35
|
+
propertyAddress?: string;
|
|
36
|
+
status?: string;
|
|
37
|
+
propertyType?: string;
|
|
38
|
+
price?: number;
|
|
39
|
+
bedrooms?: number;
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
};
|
|
42
|
+
buyer?: {
|
|
43
|
+
id: number;
|
|
44
|
+
buyerGroupName?: string;
|
|
45
|
+
maxPrice?: number | null;
|
|
46
|
+
position?: string;
|
|
47
|
+
viewingCount?: number;
|
|
48
|
+
offerCount?: number;
|
|
49
|
+
[key: string]: unknown;
|
|
50
|
+
};
|
|
51
|
+
seller?: {
|
|
52
|
+
id: number;
|
|
53
|
+
sellerGroupName?: string;
|
|
54
|
+
propertyAddress?: string;
|
|
55
|
+
price?: number;
|
|
56
|
+
[key: string]: unknown;
|
|
57
|
+
};
|
|
58
|
+
attendingAgent?: {
|
|
59
|
+
id: string;
|
|
60
|
+
firstName?: string;
|
|
61
|
+
lastName?: string;
|
|
62
|
+
email?: string;
|
|
63
|
+
mobilePhone?: string;
|
|
64
|
+
jobTitle?: string;
|
|
65
|
+
[key: string]: unknown;
|
|
66
|
+
};
|
|
67
|
+
creatingAgent?: {
|
|
68
|
+
id: string;
|
|
69
|
+
firstName?: string;
|
|
70
|
+
lastName?: string;
|
|
71
|
+
[key: string]: unknown;
|
|
72
|
+
};
|
|
73
|
+
teamId?: string;
|
|
74
|
+
[key: string]: unknown;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
type Department = "sales" | "lettings";
|
|
78
|
+
|
|
79
|
+
export async function viewingDetail(params: {
|
|
80
|
+
accountId: string;
|
|
81
|
+
viewingId: number;
|
|
82
|
+
department: Department;
|
|
83
|
+
teamName?: string;
|
|
84
|
+
}): Promise<string> {
|
|
85
|
+
const { accountId, viewingId, department, teamName } = params;
|
|
86
|
+
|
|
87
|
+
const result = await aggregateAcrossTeams<LoopViewingDetail>(
|
|
88
|
+
accountId,
|
|
89
|
+
"viewings",
|
|
90
|
+
"loop-viewing-detail",
|
|
91
|
+
async (apiKey, team) => {
|
|
92
|
+
const path = `/residential/${department}/viewings/${viewingId}`;
|
|
93
|
+
const data = await loopGet<LoopViewingDetail>(apiKey, path, "loop-viewing-detail", team);
|
|
94
|
+
if (data && typeof data === "object" && !Array.isArray(data)) {
|
|
95
|
+
return [data];
|
|
96
|
+
}
|
|
97
|
+
return [];
|
|
98
|
+
},
|
|
99
|
+
{ teamName }
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
return formatAggregationResult(
|
|
103
|
+
result,
|
|
104
|
+
(v) => {
|
|
105
|
+
const propAddr = v.property?.propertyAddress ?? "Unknown property";
|
|
106
|
+
const lines = [`**${propAddr}** [Viewing ID: ${v.id}]`];
|
|
107
|
+
|
|
108
|
+
// Appointment time
|
|
109
|
+
if (v.dateOfAppointment) {
|
|
110
|
+
const start = formatDateTime(v.dateOfAppointment);
|
|
111
|
+
const end = v.dateOfAppointmentEnd ? formatDateTime(v.dateOfAppointmentEnd) : "";
|
|
112
|
+
lines.push(`Date/Time: ${start}${end ? ` — ${end}` : ""}`);
|
|
113
|
+
}
|
|
114
|
+
if (v.status) lines.push(`Status: ${v.status}`);
|
|
115
|
+
if (v.type) lines.push(`Type: ${v.type}`);
|
|
116
|
+
|
|
117
|
+
// Confirmation status
|
|
118
|
+
const confirmParts: string[] = [];
|
|
119
|
+
if (v.buyerConfirmed != null) confirmParts.push(`Buyer: ${v.buyerConfirmed ? "yes" : "no"}`);
|
|
120
|
+
if (v.sellerConfirmed != null) confirmParts.push(`Seller: ${v.sellerConfirmed ? "yes" : "no"}`);
|
|
121
|
+
if (v.agentConfirmed != null) confirmParts.push(`Agent: ${v.agentConfirmed ? "yes" : "no"}`);
|
|
122
|
+
if (confirmParts.length) lines.push(`Confirmed — ${confirmParts.join(", ")}`);
|
|
123
|
+
|
|
124
|
+
// Property details
|
|
125
|
+
if (v.property) {
|
|
126
|
+
const prop = v.property;
|
|
127
|
+
if (prop.price != null) lines.push(`Property price: £${prop.price.toLocaleString("en-GB")}`);
|
|
128
|
+
if (prop.propertyType) lines.push(`Property type: ${prop.propertyType}`);
|
|
129
|
+
if (prop.bedrooms != null) lines.push(`Bedrooms: ${prop.bedrooms}`);
|
|
130
|
+
if (prop.id) lines.push(`Property ID: ${prop.id}`);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Buyer
|
|
134
|
+
if (v.buyer) {
|
|
135
|
+
const b = v.buyer;
|
|
136
|
+
lines.push(`\n**Buyer:** ${b.buyerGroupName ?? "Unknown"} [ID: ${b.id}]`);
|
|
137
|
+
if (b.maxPrice != null) lines.push(` Max price: £${b.maxPrice.toLocaleString("en-GB")}`);
|
|
138
|
+
if (b.position && b.position !== "none") lines.push(` Position: ${b.position}`);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Seller
|
|
142
|
+
if (v.seller) {
|
|
143
|
+
const s = v.seller;
|
|
144
|
+
lines.push(`\n**Seller:** ${s.sellerGroupName ?? "Unknown"} [ID: ${s.id}]`);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Attending agent
|
|
148
|
+
if (v.attendingAgent) {
|
|
149
|
+
const a = v.attendingAgent;
|
|
150
|
+
const agentName = [a.firstName, a.lastName].filter(Boolean).join(" ");
|
|
151
|
+
const title = a.jobTitle ? ` (${a.jobTitle})` : "";
|
|
152
|
+
const contact = a.email ?? a.mobilePhone ?? "";
|
|
153
|
+
lines.push(`\n**Attending agent:** ${agentName}${title}${contact ? ` — ${contact}` : ""}`);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Feedback
|
|
157
|
+
if (v.buyerFeedback) lines.push(`\nBuyer feedback: ${v.buyerFeedback}`);
|
|
158
|
+
if (v.sellerFeedback) lines.push(`Seller feedback: ${v.sellerFeedback}`);
|
|
159
|
+
if (v.comment) lines.push(`Notes: ${v.comment}`);
|
|
160
|
+
|
|
161
|
+
return lines.join("\n");
|
|
162
|
+
},
|
|
163
|
+
"viewing details"
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function formatDateTime(iso: string): string {
|
|
168
|
+
const [datePart, timePart] = iso.split("T");
|
|
169
|
+
if (!timePart) return datePart;
|
|
170
|
+
return `${datePart} ${timePart.slice(0, 5)}`;
|
|
171
|
+
}
|