@rubytech/create-realagent-code 0.1.24 → 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.
- package/dist/index.js +81 -17
- package/package.json +1 -1
- package/payload/platform/plugins/.claude-plugin/marketplace.json +5 -90
- package/payload/platform/plugins/admin/PLUGIN.md +46 -23
- package/payload/platform/plugins/admin/skills/onboarding/SKILL.md +111 -126
- 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/cloudflare/references/dashboard-guide.md +37 -0
- package/payload/platform/plugins/cloudflare/references/manual-setup.md +81 -1
- package/payload/platform/plugins/cloudflare/scripts/__tests__/tunnel-ingress.test.ts +241 -0
- package/payload/platform/plugins/cloudflare/scripts/setup-tunnel.sh +267 -28
- package/payload/platform/plugins/cloudflare/scripts/tunnel-ingress.ts +291 -0
- package/payload/platform/plugins/cloudflare/skills/setup-tunnel/SKILL.md +42 -0
- package/payload/platform/plugins/contacts/PLUGIN.md +18 -9
- package/payload/platform/plugins/docs/references/platform.md +2 -0
- package/payload/platform/plugins/docs/references/troubleshooting.md +12 -0
- package/payload/platform/plugins/email/PLUGIN.md +18 -9
- package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.d.ts +17 -0
- package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.d.ts.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.js +185 -0
- package/payload/platform/plugins/email/mcp/dist/lib/claude-bridge.js.map +1 -0
- package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.js +34 -111
- package/payload/platform/plugins/email/mcp/dist/scripts/email-auto-respond.js.map +1 -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/PLUGIN.md +58 -29
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.d.ts +3 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.js +105 -4
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.js +16 -3
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.js.map +1 -1
- package/payload/platform/plugins/outlook/PLUGIN.md +14 -7
- package/payload/platform/plugins/replicate/PLUGIN.md +6 -3
- package/payload/platform/plugins/scheduling/PLUGIN.md +16 -8
- package/payload/platform/plugins/tasks/PLUGIN.md +28 -14
- 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/waitlist/PLUGIN.md +12 -6
- package/payload/platform/plugins/whatsapp/PLUGIN.md +25 -13
- package/payload/platform/plugins/workflows/PLUGIN.md +16 -8
- 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/scripts/conversation-id-allowlist.txt +0 -1
- 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 +48 -2
- package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/index.js +39 -0
- package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts +22 -0
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +32 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.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
- package/payload/platform/services/claude-session-manager/dist/tool-surface.d.ts +25 -0
- package/payload/platform/services/claude-session-manager/dist/tool-surface.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/tool-surface.js +149 -0
- package/payload/platform/services/claude-session-manager/dist/tool-surface.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/estate-business/PLUGIN.md +15 -0
- package/payload/premium-plugins/real-agency/plugins/estate-sales/PLUGIN.md +5 -0
- package/payload/premium-plugins/real-agency/plugins/leads/PLUGIN.md +16 -0
- package/payload/premium-plugins/real-agency/plugins/listings/PLUGIN.md +39 -0
- package/payload/premium-plugins/real-agency/plugins/loop/PLUGIN.md +15 -0
- package/payload/server/{chunk-2ZNKHCQB.js → chunk-2MRZBQMH.js} +1 -1
- package/payload/server/{chunk-GPUCA2RQ.js → chunk-NL7QLVAD.js} +0 -192
- package/payload/server/{chunk-IDKWGLM5.js → chunk-YPZFYTYP.js} +1 -247
- package/payload/server/{cloudflare-task-tracker-LYI5BTYI.js → cloudflare-task-tracker-QVOGHKWV.js} +2 -2
- package/payload/server/maxy-edge.js +2 -2
- package/payload/server/package.json +0 -2
- package/payload/server/public/assets/{Checkbox-D1OQD43b.js → Checkbox-YIF0payo.js} +1 -1
- package/payload/server/public/assets/{admin-czNBxWor.js → admin-DW8IJcLc.js} +1 -1
- package/payload/server/public/assets/{architectureDiagram-Q4EWVU46-BcwgT80u.js → architectureDiagram-Q4EWVU46-Bz8mlxZZ.js} +1 -1
- package/payload/server/public/assets/{blockDiagram-DXYQGD6D-BMSyZUQA.js → blockDiagram-DXYQGD6D-DwV8Z8-i.js} +1 -1
- package/payload/server/public/assets/{brand-2cku8WFs.css → brand-DqiRNMlu.css} +1 -1
- package/payload/server/public/assets/{c4Diagram-AHTNJAMY-DPRGY1jJ.js → c4Diagram-AHTNJAMY-DiUTejMp.js} +1 -1
- package/payload/server/public/assets/channel-PtVtoBEL.js +1 -0
- package/payload/server/public/assets/{chunk-336JU56O-B7oQ3g1c.js → chunk-336JU56O-4mHZpBXe.js} +2 -2
- package/payload/server/public/assets/{chunk-426QAEUC-C1P0yFXw.js → chunk-426QAEUC-Cbv0vrN9.js} +1 -1
- package/payload/server/public/assets/{chunk-4TB4RGXK-LI7kOJd0.js → chunk-4TB4RGXK-BvLhId_2.js} +1 -1
- package/payload/server/public/assets/{chunk-5FUZZQ4R-CXQRGTQE.js → chunk-5FUZZQ4R-bBafOTkw.js} +1 -1
- package/payload/server/public/assets/{chunk-5PVQY5BW-NSyzpXRy.js → chunk-5PVQY5BW-B0NqBKVy.js} +1 -1
- package/payload/server/public/assets/{chunk-EDXVE4YY-voNwxbDs.js → chunk-EDXVE4YY-CFd4SqI6.js} +1 -1
- package/payload/server/public/assets/{chunk-ENJZ2VHE-CMEMPzYY.js → chunk-ENJZ2VHE-ajf2sb6c.js} +1 -1
- package/payload/server/public/assets/{chunk-ICPOFSXX-hEbwu-pe.js → chunk-ICPOFSXX-pWg6bug7.js} +1 -1
- package/payload/server/public/assets/{chunk-OYMX7WX6-DxskDrLs.js → chunk-OYMX7WX6-OjEd-17c.js} +1 -1
- package/payload/server/public/assets/{chunk-U2HBQHQK-D7TKgUo0.js → chunk-U2HBQHQK-DbEFSPoh.js} +1 -1
- package/payload/server/public/assets/{chunk-X2U36JSP-BvPUQEPm.js → chunk-X2U36JSP-COdNwrBb.js} +1 -1
- package/payload/server/public/assets/{chunk-YZCP3GAM-BY-RWQUW.js → chunk-YZCP3GAM-CHMWuY9B.js} +1 -1
- package/payload/server/public/assets/{chunk-ZZ45TVLE-DZvOYDY6.js → chunk-ZZ45TVLE-B-uDLQOB.js} +1 -1
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-RVH_SEhY.js +1 -0
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-Cm3rAb93.js +1 -0
- package/payload/server/public/assets/clone-BjY0Wzht.js +1 -0
- package/payload/server/public/assets/{dagre-KV5264BT-Cnj0mUZl.js → dagre-KV5264BT-CMEzmhIL.js} +1 -1
- package/payload/server/public/assets/{dagre-Bt-fpckL.js → dagre-bhIG_KnW.js} +1 -1
- package/payload/server/public/assets/data-K_kS__sL.js +1 -0
- package/payload/server/public/assets/{device-url-actions-Bjz3Xzbm.js → device-url-actions-AcOyLSeF.js} +1 -1
- package/payload/server/public/assets/{diagram-5BDNPKRD-DjLzvOlx.js → diagram-5BDNPKRD-6RIoQhIL.js} +1 -1
- package/payload/server/public/assets/{diagram-G4DWMVQ6-DTfuRd-T.js → diagram-G4DWMVQ6-BSp36TVv.js} +1 -1
- package/payload/server/public/assets/{diagram-MMDJMWI5-BaL2mCnx.js → diagram-MMDJMWI5-D54fo52D.js} +1 -1
- package/payload/server/public/assets/{diagram-TYMM5635-C5InWY5R.js → diagram-TYMM5635-CWL8z-Pq.js} +1 -1
- package/payload/server/public/assets/{erDiagram-SMLLAGMA-DO7BXTpn.js → erDiagram-SMLLAGMA-AnnHBo3z.js} +1 -1
- package/payload/server/public/assets/{flowDiagram-DWJPFMVM-DDdAKfLf.js → flowDiagram-DWJPFMVM-laWmBl5o.js} +1 -1
- package/payload/server/public/assets/{ganttDiagram-T4ZO3ILL-arJD8Utm.js → ganttDiagram-T4ZO3ILL-B94ko8ie.js} +1 -1
- package/payload/server/public/assets/{gitGraphDiagram-UUTBAWPF-C55GH-OS.js → gitGraphDiagram-UUTBAWPF-DxzL1fxZ.js} +1 -1
- package/payload/server/public/assets/graph-DeEigyO_.js +1 -0
- package/payload/server/public/assets/graph-labels-C7I5QvNv.js +1 -0
- package/payload/server/public/assets/{graphlib-DL9PM7Ex.js → graphlib-CY-zIElM.js} +1 -1
- package/payload/server/public/assets/{infoDiagram-42DDH7IO-BMSGqUbG.js → infoDiagram-42DDH7IO-BMTajIIr.js} +1 -1
- package/payload/server/public/assets/{ishikawaDiagram-UXIWVN3A-Dw6BZ6BG.js → ishikawaDiagram-UXIWVN3A-B_QauE5O.js} +1 -1
- package/payload/server/public/assets/{journeyDiagram-VCZTEJTY-DrywUGXw.js → journeyDiagram-VCZTEJTY-DmlqSIih.js} +1 -1
- package/payload/server/public/assets/{kanban-definition-6JOO6SKY-DuwtVBBc.js → kanban-definition-6JOO6SKY-ZGDQT7xB.js} +1 -1
- package/payload/server/public/assets/{line-JAksyKHj.js → line-D13opgep.js} +1 -1
- package/payload/server/public/assets/{mermaid-parser.core-BMq-ApBW.js → mermaid-parser.core-C650Sual.js} +1 -1
- package/payload/server/public/assets/{mermaid.core-tH4oX0Kh.js → mermaid.core-BqnQoXTp.js} +3 -3
- package/payload/server/public/assets/{mindmap-definition-QFDTVHPH-D1OiiJga.js → mindmap-definition-QFDTVHPH-BS_8y-tY.js} +1 -1
- package/payload/server/public/assets/{page-BZpoS7iR.js → page-B_rpjIRr.js} +1 -1
- package/payload/server/public/assets/{page-CkvBvezS.js → page-qSH972X0.js} +1 -1
- package/payload/server/public/assets/{pieDiagram-DEJITSTG-Ckwm69PW.js → pieDiagram-DEJITSTG-B5OmNvBO.js} +1 -1
- package/payload/server/public/assets/{public-C-dTMgXu.js → public-DDsYgotk.js} +3 -3
- package/payload/server/public/assets/{quadrantDiagram-34T5L4WZ-COw3yZ1j.js → quadrantDiagram-34T5L4WZ-DTYITdNo.js} +1 -1
- package/payload/server/public/assets/{requirementDiagram-MS252O5E-DqGzM4K-.js → requirementDiagram-MS252O5E-CRZWxH06.js} +1 -1
- package/payload/server/public/assets/{sankeyDiagram-XADWPNL6-D-l1c_Pl.js → sankeyDiagram-XADWPNL6-DazRENhe.js} +1 -1
- package/payload/server/public/assets/{sequenceDiagram-FGHM5R23-BeIi0DtJ.js → sequenceDiagram-FGHM5R23-BcHTxmPy.js} +1 -1
- package/payload/server/public/assets/{stateDiagram-FHFEXIEX-C-jgegLk.js → stateDiagram-FHFEXIEX-DYU7nbqg.js} +1 -1
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-BgljVtlp.js +1 -0
- package/payload/server/public/assets/{timeline-definition-GMOUNBTQ-BGFKkYmi.js → timeline-definition-GMOUNBTQ-BKGmqkST.js} +1 -1
- package/payload/server/public/assets/{vennDiagram-DHZGUBPP-5NuIhJLS.js → vennDiagram-DHZGUBPP-BXvLPmX7.js} +1 -1
- package/payload/server/public/assets/{wardleyDiagram-NUSXRM2D-Be9ytVut.js → wardleyDiagram-NUSXRM2D-BCclUa3Z.js} +1 -1
- package/payload/server/public/assets/{xychartDiagram-5P7HB3ND-DCyHg41R.js → xychartDiagram-5P7HB3ND-C-Xp-Eoc.js} +1 -1
- package/payload/server/public/data.html +5 -5
- package/payload/server/public/graph.html +6 -6
- package/payload/server/public/index.html +8 -8
- package/payload/server/public/public.html +5 -5
- package/payload/server/server.js +1024 -2347
- package/payload/platform/scripts/check-sdk-oauth.mjs +0 -185
- package/payload/server/public/assets/channel-fxEghWew.js +0 -1
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-BsWzGW0N.js +0 -1
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-BGVa3h90.js +0 -1
- package/payload/server/public/assets/clone-Khvocke2.js +0 -1
- package/payload/server/public/assets/data-DBd-Buhp.js +0 -1
- package/payload/server/public/assets/graph-DUtVdnZ6.js +0 -1
- package/payload/server/public/assets/graph-labels-Dxfue-fP.js +0 -1
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-BaMs8Znv.js +0 -1
- /package/payload/server/public/assets/{brand-CSQuxS9w.js → brand-Bm671owU.js} +0 -0
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
// Task 009 — Pure tunnel-ingress rendering + state I/O.
|
|
2
|
+
//
|
|
3
|
+
// Mirror of `samba-provision.ts`: pure decision functions in this file with
|
|
4
|
+
// no side effects; `setup-tunnel.sh` orchestrates I/O around them. Invoked
|
|
5
|
+
// from bash via `node --experimental-strip-types`. The CLI shim at the
|
|
6
|
+
// bottom of this file takes a JSON spec on argv and prints rendered YAML
|
|
7
|
+
// (or the requested state snippet) on stdout so the shell can `>` it into
|
|
8
|
+
// the brand's config.yml or tunnel.state.
|
|
9
|
+
//
|
|
10
|
+
// Why a pure module:
|
|
11
|
+
// - The existing setup-tunnel.sh rebuilds config.yml from scratch every
|
|
12
|
+
// run. Adding SSH and SMB conditionally inline doubles the rewrite
|
|
13
|
+
// logic and makes it untestable. Extracting to a pure function with a
|
|
14
|
+
// test grid locks the YAML shape against future drift.
|
|
15
|
+
// - tunnel.state needs additive sshHostname / smbHostname fields so a
|
|
16
|
+
// re-run with no env vars rehydrates the ingress instead of silently
|
|
17
|
+
// dropping it. The persistence shape lives here so the test grid
|
|
18
|
+
// covers round-trip parity.
|
|
19
|
+
//
|
|
20
|
+
// Out of scope:
|
|
21
|
+
// - Cloudflare API calls (banned per `feedback_cf_api_total_eradication`).
|
|
22
|
+
// - Access policy creation (operator authors it in the dashboard).
|
|
23
|
+
// - DNS routing (the bash wrapper invokes `cloudflared tunnel route dns`).
|
|
24
|
+
|
|
25
|
+
import { readFileSync, existsSync, appendFileSync } from "node:fs";
|
|
26
|
+
|
|
27
|
+
// Task 054 — STREAM_LOG_PATH writer (Task 598/600 contract). The four CLI
|
|
28
|
+
// subcommands invoked from setup-tunnel.sh (probe-samba, render-config,
|
|
29
|
+
// render-state, action-req) emit a `phase=<cmd>-start` line on entry and
|
|
30
|
+
// `phase=<cmd>-ok` / `phase=<cmd>-fail` on exit. Pattern ported verbatim
|
|
31
|
+
// from list-cf-domains.ts:94-133: sticky-flag on first write failure to
|
|
32
|
+
// avoid stderr spam if STREAM_LOG_PATH is unwritable; observability
|
|
33
|
+
// failure must not mask the subcommand's real signal.
|
|
34
|
+
let streamLogWriteFailed = false;
|
|
35
|
+
|
|
36
|
+
function logPhase(line: string): void {
|
|
37
|
+
const streamLogPath = process.env.STREAM_LOG_PATH;
|
|
38
|
+
if (!streamLogPath || streamLogWriteFailed) return;
|
|
39
|
+
try {
|
|
40
|
+
appendFileSync(
|
|
41
|
+
streamLogPath,
|
|
42
|
+
`[${new Date().toISOString()}] [script:tunnel-ingress] ${line}\n`,
|
|
43
|
+
);
|
|
44
|
+
} catch (err) {
|
|
45
|
+
streamLogWriteFailed = true;
|
|
46
|
+
const detail = (err instanceof Error ? err.message : String(err))
|
|
47
|
+
.slice(0, 200)
|
|
48
|
+
.replace(/"/g, "'");
|
|
49
|
+
process.stderr.write(
|
|
50
|
+
`[tunnel-ingress] phase=stream-log-write-failed detail="${detail}"\n`,
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
// Types
|
|
57
|
+
// ---------------------------------------------------------------------------
|
|
58
|
+
|
|
59
|
+
export interface IngressSpec {
|
|
60
|
+
tunnelId: string;
|
|
61
|
+
credentialsPath: string;
|
|
62
|
+
httpPort: number;
|
|
63
|
+
httpHostnames: string[];
|
|
64
|
+
sshHostname?: string | null;
|
|
65
|
+
smbHostname?: string | null;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface TunnelState {
|
|
69
|
+
tunnelId: string;
|
|
70
|
+
tunnelName: string;
|
|
71
|
+
domain: string;
|
|
72
|
+
configPath: string;
|
|
73
|
+
credentialsPath: string;
|
|
74
|
+
sshHostname?: string | null;
|
|
75
|
+
smbHostname?: string | null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// ---------------------------------------------------------------------------
|
|
79
|
+
// Pure renderer
|
|
80
|
+
// ---------------------------------------------------------------------------
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Render config.yml from a fully-resolved IngressSpec. Order matters:
|
|
84
|
+
* cloudflared matches ingress rules top-to-bottom, so the catch-all
|
|
85
|
+
* `http_status:404` MUST be last. SSH and SMB are inserted between the
|
|
86
|
+
* HTTPS hostnames and the catch-all — they carry non-HTTP services, so
|
|
87
|
+
* placing them after HTTPS keeps the existing HTTP routing behaviour
|
|
88
|
+
* unchanged when no SSH/SMB hostname is configured.
|
|
89
|
+
*/
|
|
90
|
+
export function renderConfigYml(spec: IngressSpec): string {
|
|
91
|
+
const lines: string[] = [];
|
|
92
|
+
lines.push(`tunnel: ${spec.tunnelId}`);
|
|
93
|
+
lines.push(`credentials-file: ${spec.credentialsPath}`);
|
|
94
|
+
lines.push(`ingress:`);
|
|
95
|
+
for (const h of spec.httpHostnames) {
|
|
96
|
+
lines.push(` - hostname: ${h}`);
|
|
97
|
+
lines.push(` service: http://localhost:${spec.httpPort}`);
|
|
98
|
+
}
|
|
99
|
+
if (spec.sshHostname) {
|
|
100
|
+
lines.push(` - hostname: ${spec.sshHostname}`);
|
|
101
|
+
lines.push(` service: ssh://localhost:22`);
|
|
102
|
+
}
|
|
103
|
+
if (spec.smbHostname) {
|
|
104
|
+
lines.push(` - hostname: ${spec.smbHostname}`);
|
|
105
|
+
lines.push(` service: tcp://localhost:445`);
|
|
106
|
+
}
|
|
107
|
+
lines.push(` - service: http_status:404`);
|
|
108
|
+
lines.push(``);
|
|
109
|
+
return lines.join("\n");
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Render the tunnel.state JSON, preserving SSH/SMB hostnames as additive
|
|
114
|
+
* fields so re-runs can rehydrate them. The shape stays a superset of the
|
|
115
|
+
* pre-Task-009 JSON (tunnelId, tunnelName, domain, configPath,
|
|
116
|
+
* credentialsPath) — consumers that don't know about ssh/smb keep working.
|
|
117
|
+
*/
|
|
118
|
+
export function renderTunnelState(state: TunnelState): string {
|
|
119
|
+
const out: Record<string, string> = {
|
|
120
|
+
tunnelId: state.tunnelId,
|
|
121
|
+
tunnelName: state.tunnelName,
|
|
122
|
+
domain: state.domain,
|
|
123
|
+
configPath: state.configPath,
|
|
124
|
+
credentialsPath: state.credentialsPath,
|
|
125
|
+
};
|
|
126
|
+
if (state.sshHostname) out.sshHostname = state.sshHostname;
|
|
127
|
+
if (state.smbHostname) out.smbHostname = state.smbHostname;
|
|
128
|
+
return JSON.stringify(out, null, 2) + "\n";
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Read an existing tunnel.state from disk, returning the persisted
|
|
133
|
+
* sshHostname / smbHostname if present. Used to rehydrate on re-runs
|
|
134
|
+
* where the operator did not pass the env vars again. Missing file or
|
|
135
|
+
* malformed JSON returns nulls — the caller decides whether to fail.
|
|
136
|
+
*/
|
|
137
|
+
export function readPersistedHostnames(statePath: string): {
|
|
138
|
+
sshHostname: string | null;
|
|
139
|
+
smbHostname: string | null;
|
|
140
|
+
} {
|
|
141
|
+
if (!existsSync(statePath)) return { sshHostname: null, smbHostname: null };
|
|
142
|
+
try {
|
|
143
|
+
const raw = readFileSync(statePath, "utf8");
|
|
144
|
+
const parsed = JSON.parse(raw) as Partial<TunnelState>;
|
|
145
|
+
return {
|
|
146
|
+
sshHostname: typeof parsed.sshHostname === "string" ? parsed.sshHostname : null,
|
|
147
|
+
smbHostname: typeof parsed.smbHostname === "string" ? parsed.smbHostname : null,
|
|
148
|
+
};
|
|
149
|
+
} catch {
|
|
150
|
+
return { sshHostname: null, smbHostname: null };
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// ---------------------------------------------------------------------------
|
|
155
|
+
// Samba presence probe
|
|
156
|
+
// ---------------------------------------------------------------------------
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Probe whether Task 034's per-brand Samba stanza exists in /etc/samba/smb.conf.
|
|
160
|
+
* The brand stanza header is `[<brand>]` at the start of a line (Task 034's
|
|
161
|
+
* `renderBrandStanza` output). Source of truth is the Pi filesystem, not
|
|
162
|
+
* brand.json — Samba is provisioned by the installer's post-install step,
|
|
163
|
+
* not declared up-front.
|
|
164
|
+
*/
|
|
165
|
+
export function probeSambaStanza(brand: string, smbConfPath = "/etc/samba/smb.conf"): boolean {
|
|
166
|
+
if (!existsSync(smbConfPath)) return false;
|
|
167
|
+
try {
|
|
168
|
+
const raw = readFileSync(smbConfPath, "utf8");
|
|
169
|
+
const re = new RegExp(`^\\[${escapeRegex(brand)}\\]\\s*$`, "m");
|
|
170
|
+
return re.test(raw);
|
|
171
|
+
} catch {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function escapeRegex(s: string): string {
|
|
177
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// ---------------------------------------------------------------------------
|
|
181
|
+
// ACTION REQUIRED block
|
|
182
|
+
// ---------------------------------------------------------------------------
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Render the dashboard click-path the operator follows to author the Access
|
|
186
|
+
* policy. Same shape as the existing apex-CNAME ACTION REQUIRED block in
|
|
187
|
+
* setup-tunnel.sh. The script does NOT create the policy — Cloudflare API
|
|
188
|
+
* is banned (`feedback_cf_api_total_eradication`) and `cloudflared` CLI
|
|
189
|
+
* has no Access-application create subcommand. The operator clicks through
|
|
190
|
+
* Zero Trust → Access → Applications → Add → Self-hosted.
|
|
191
|
+
*/
|
|
192
|
+
export function renderAccessPolicyActionRequired(input: {
|
|
193
|
+
sshHostname?: string | null;
|
|
194
|
+
smbHostname?: string | null;
|
|
195
|
+
operatorEmail: string;
|
|
196
|
+
}): string {
|
|
197
|
+
const hosts: Array<{ kind: "SSH" | "SMB"; hostname: string }> = [];
|
|
198
|
+
if (input.sshHostname) hosts.push({ kind: "SSH", hostname: input.sshHostname });
|
|
199
|
+
if (input.smbHostname) hosts.push({ kind: "SMB", hostname: input.smbHostname });
|
|
200
|
+
if (hosts.length === 0) return "";
|
|
201
|
+
|
|
202
|
+
const lines: string[] = [];
|
|
203
|
+
lines.push("");
|
|
204
|
+
lines.push("============================================================");
|
|
205
|
+
lines.push("ACTION REQUIRED — Cloudflare Zero Trust Access policy");
|
|
206
|
+
lines.push("============================================================");
|
|
207
|
+
for (const { kind, hostname } of hosts) {
|
|
208
|
+
lines.push(` ${kind}: ${hostname}`);
|
|
209
|
+
lines.push(` Cloudflare dashboard → Zero Trust → Access → Applications`);
|
|
210
|
+
lines.push(` Add → Self-hosted`);
|
|
211
|
+
lines.push(` Application name: ${hostname}`);
|
|
212
|
+
lines.push(` Application domain: ${hostname}`);
|
|
213
|
+
lines.push(` Policy → Action: Allow`);
|
|
214
|
+
lines.push(` Include → Emails: ${input.operatorEmail}`);
|
|
215
|
+
lines.push("");
|
|
216
|
+
}
|
|
217
|
+
lines.push("Until each Access application is created, off-LAN clients see");
|
|
218
|
+
lines.push("Cloudflare's identity-rejection page and bytes never reach the Pi.");
|
|
219
|
+
lines.push("============================================================");
|
|
220
|
+
return lines.join("\n");
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// ---------------------------------------------------------------------------
|
|
224
|
+
// CLI shim
|
|
225
|
+
// ---------------------------------------------------------------------------
|
|
226
|
+
|
|
227
|
+
// Bash invokes this file with one of three subcommands:
|
|
228
|
+
// render-config <spec.json> → stdout YAML
|
|
229
|
+
// render-state <state.json> → stdout JSON
|
|
230
|
+
// read-state <state-path> → stdout JSON {sshHostname,smbHostname}
|
|
231
|
+
// probe-samba <brand> [smb.conf] → exit 0 if present, 1 if absent
|
|
232
|
+
// action-req <input.json> → stdout ACTION REQUIRED block
|
|
233
|
+
|
|
234
|
+
function readJsonArg(path: string): unknown {
|
|
235
|
+
const raw = readFileSync(path, "utf8");
|
|
236
|
+
return JSON.parse(raw);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
const isCli =
|
|
240
|
+
typeof process !== "undefined" &&
|
|
241
|
+
Array.isArray(process.argv) &&
|
|
242
|
+
process.argv[1] !== undefined &&
|
|
243
|
+
/tunnel-ingress\.(ts|js|mjs|mts)$/.test(process.argv[1]);
|
|
244
|
+
|
|
245
|
+
if (isCli) {
|
|
246
|
+
const [, , cmd, ...rest] = process.argv;
|
|
247
|
+
// Track which subcommands carry the Task 054 stream-log contract — for these
|
|
248
|
+
// we emit start/ok/fail phase pairs. Unknown subcommands and read-state are
|
|
249
|
+
// out of scope per the task (read-state has no setup-tunnel.sh caller line).
|
|
250
|
+
const instrumented = new Set(["probe-samba", "render-config", "render-state", "action-req"]);
|
|
251
|
+
if (instrumented.has(cmd)) logPhase(`phase=${cmd}-start`);
|
|
252
|
+
try {
|
|
253
|
+
if (cmd === "render-config") {
|
|
254
|
+
const spec = readJsonArg(rest[0]) as IngressSpec;
|
|
255
|
+
process.stdout.write(renderConfigYml(spec));
|
|
256
|
+
logPhase(`phase=${cmd}-ok`);
|
|
257
|
+
} else if (cmd === "render-state") {
|
|
258
|
+
const state = readJsonArg(rest[0]) as TunnelState;
|
|
259
|
+
process.stdout.write(renderTunnelState(state));
|
|
260
|
+
logPhase(`phase=${cmd}-ok`);
|
|
261
|
+
} else if (cmd === "read-state") {
|
|
262
|
+
const persisted = readPersistedHostnames(rest[0]);
|
|
263
|
+
process.stdout.write(JSON.stringify(persisted));
|
|
264
|
+
} else if (cmd === "probe-samba") {
|
|
265
|
+
const brand = rest[0];
|
|
266
|
+
const smbConf = rest[1] ?? "/etc/samba/smb.conf";
|
|
267
|
+
const present = probeSambaStanza(brand, smbConf);
|
|
268
|
+
logPhase(`phase=${cmd}-ok brand=${brand} present=${present}`);
|
|
269
|
+
process.exit(present ? 0 : 1);
|
|
270
|
+
} else if (cmd === "action-req") {
|
|
271
|
+
const input = readJsonArg(rest[0]) as {
|
|
272
|
+
sshHostname?: string | null;
|
|
273
|
+
smbHostname?: string | null;
|
|
274
|
+
operatorEmail: string;
|
|
275
|
+
};
|
|
276
|
+
process.stdout.write(renderAccessPolicyActionRequired(input));
|
|
277
|
+
logPhase(`phase=${cmd}-ok`);
|
|
278
|
+
} else {
|
|
279
|
+
process.stderr.write(`tunnel-ingress: unknown subcommand: ${cmd}\n`);
|
|
280
|
+
process.exit(2);
|
|
281
|
+
}
|
|
282
|
+
} catch (err) {
|
|
283
|
+
const msg = (err as Error).message;
|
|
284
|
+
if (instrumented.has(cmd)) {
|
|
285
|
+
const detail = msg.slice(0, 200).replace(/"/g, "'");
|
|
286
|
+
logPhase(`phase=${cmd}-fail error="${detail}"`);
|
|
287
|
+
}
|
|
288
|
+
process.stderr.write(`tunnel-ingress: ${msg}\n`);
|
|
289
|
+
process.exit(1);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
@@ -46,6 +46,48 @@ Example ({{productName}} on `maxy.bot` with a public subdomain and the `maxy.cha
|
|
|
46
46
|
~/setup-tunnel.sh maxy 19200 admin.maxy.bot public.maxy.bot maxy.chat
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
+
### Optional SSH and SMB ingress (Task 009)
|
|
50
|
+
|
|
51
|
+
The same script also wires the off-LAN SSH and SMB ingress when the
|
|
52
|
+
corresponding hostnames are passed via environment variables (NOT positional
|
|
53
|
+
argv — the positional contract is preserved for the form/endpoint caller):
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
SSH_HOSTNAME=ssh.maxy.bot \
|
|
57
|
+
SMB_HOSTNAME=smb.maxy.bot \
|
|
58
|
+
OPERATOR_EMAIL=joel@example.com \
|
|
59
|
+
~/setup-tunnel.sh maxy 19200 admin.maxy.bot public.maxy.bot
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Behaviour:
|
|
63
|
+
|
|
64
|
+
- HTTPS hostnames are routed and config.yml rewritten FIRST. SSH and SMB
|
|
65
|
+
DNS routes happen in a second pass; a failure on SSH or SMB emits
|
|
66
|
+
`[tunnel-install] {ssh,smb}-ingress-deferred` and leaves the HTTPS
|
|
67
|
+
ingress durable (no rollback, no `exit 1`).
|
|
68
|
+
- `SSH_HOSTNAME` adds an ingress entry `service: ssh://localhost:22`.
|
|
69
|
+
- `SMB_HOSTNAME` adds `service: tcp://localhost:445`, gated on Task 034's
|
|
70
|
+
Samba stanza being present in `/etc/samba/smb.conf`. Absent stanza →
|
|
71
|
+
`[tunnel-install] smb-ingress-skipped reason=samba-not-provisioned` and
|
|
72
|
+
the SMB pass is skipped entirely.
|
|
73
|
+
- Re-run with env vars unset rehydrates `sshHostname` / `smbHostname` from
|
|
74
|
+
`tunnel.state` so previously configured ingress is not silently dropped.
|
|
75
|
+
- The Cloudflare Zero Trust Access policy that gates these hostnames is
|
|
76
|
+
authored by the operator in the dashboard — the script prints an
|
|
77
|
+
`ACTION REQUIRED` click-path with the resolved hostnames and operator
|
|
78
|
+
email (CF API is banned per `feedback_cf_api_total_eradication`). Phase
|
|
79
|
+
lines: `[tunnel-install] ssh-access-policy-required` and
|
|
80
|
+
`[tunnel-install] smb-access-policy-required` (named `-required`, not
|
|
81
|
+
`-set`, because the script does not create the policy).
|
|
82
|
+
- Dry-run: `SETUP_TUNNEL_DRY_RUN=1` short-circuits before any cloudflared
|
|
83
|
+
mutation and prints the rendered `config.yml` and `tunnel.state` so the
|
|
84
|
+
operator can preview changes.
|
|
85
|
+
|
|
86
|
+
The YAML and JSON rendering live in a pure Node helper at
|
|
87
|
+
`platform/plugins/cloudflare/scripts/tunnel-ingress.ts`, unit-tested under
|
|
88
|
+
`scripts/__tests__/tunnel-ingress.test.ts` and invoked from the shell via
|
|
89
|
+
`node --experimental-strip-types`.
|
|
90
|
+
|
|
49
91
|
The agent does not invoke the script directly during onboarding — the endpoint does. The agent's responsibility is to render the form and relay the endpoint's script output verbatim when `_componentDone` arrives. If an `ACTION REQUIRED` block appears, quote it exactly — the operator needs the specific dashboard instructions it contains.
|
|
50
92
|
|
|
51
93
|
### When the script exits non-zero
|
|
@@ -2,15 +2,24 @@
|
|
|
2
2
|
name: contacts
|
|
3
3
|
description: "CRM contacts plugin. Provides contact-create, contact-lookup, contact-update, contact-delete, contact-list, contact-export, contact-erase, group-create, and group-manage tools for managing the customer contact graph and group conversations."
|
|
4
4
|
tools:
|
|
5
|
-
- contact-create
|
|
6
|
-
|
|
7
|
-
- contact-
|
|
8
|
-
|
|
9
|
-
- contact-
|
|
10
|
-
|
|
11
|
-
- contact-
|
|
12
|
-
|
|
13
|
-
-
|
|
5
|
+
- name: contact-create
|
|
6
|
+
publicAllowlist: false
|
|
7
|
+
- name: contact-lookup
|
|
8
|
+
publicAllowlist: false
|
|
9
|
+
- name: contact-update
|
|
10
|
+
publicAllowlist: false
|
|
11
|
+
- name: contact-delete
|
|
12
|
+
publicAllowlist: false
|
|
13
|
+
- name: contact-list
|
|
14
|
+
publicAllowlist: false
|
|
15
|
+
- name: contact-export
|
|
16
|
+
publicAllowlist: false
|
|
17
|
+
- name: contact-erase
|
|
18
|
+
publicAllowlist: false
|
|
19
|
+
- name: group-create
|
|
20
|
+
publicAllowlist: false
|
|
21
|
+
- name: group-manage
|
|
22
|
+
publicAllowlist: false
|
|
14
23
|
always: false
|
|
15
24
|
embed: false
|
|
16
25
|
metadata: {"platform":{}}
|
|
@@ -69,6 +69,8 @@ The admin interface is a three-pane layout: a sidebar on the left with your bran
|
|
|
69
69
|
|
|
70
70
|
Page titles are brand-aware: the browser tab shows your product name (e.g. `Real Agent` instead of `Maxy`) on every shell — chat, graph, and data — so a non-default brand never leaks the default name in tab strips or browser history.
|
|
71
71
|
|
|
72
|
+
**Sidebar sessions list — 3s poll contract.** The sidebar Sessions list and the ConversationsModal share one fetch loop (`useAdminSessions`). It hits `/api/admin/claude-sessions` every 3s while the operator is signed in, but the poll path is render-quiet: `setLoading` is not toggled, and the sessions array is only re-committed when the projection `{ sessionId, displayName, lastMessageAt, status }` actually changes. Byte-identical responses do nothing visible to React. Each tick emits exactly one diagnostic line: `[admin-ui] sessions-poll outcome=<unchanged|changed|error> count=<n> cacheKey=<8>` (in the browser DevTools console; mirrored to `~/.maxy/logs/admin-ui-console.log` where the operator forwards them). The explicit operator-initiated paths — first load (`ensureLoaded`) and post-action `refetch()` (after spawn / delete) — still toggle `loading` so consumers can show a spinner. The 3s manager-truth reconciliation is unchanged; only the React-side noise was removed.
|
|
73
|
+
|
|
72
74
|
The Data search panel ranks results by combining vector similarity with keyword (BM25) matching. Each row shows a one-line score breakdown — `vector 0.NN · bm25 0.NN · combined 0.NN` — so you can tell whether a row surfaced because of meaning, exact-keyword match, or both. A bm25 column of `0.00` across every row means your search term wasn't in the keyword index, so ranking fell back to pure vector similarity (this can produce surprising results — the breakdown tells you when to interpret with caution). Above the result list, a chip row shows the unique types in your current results — click one to filter, click again to clear. Click any row to jump straight to that node's neighbourhood in the Graph; from the artefact pane the graph opens alongside chat, from the standalone Data page it opens in place.
|
|
73
75
|
|
|
74
76
|
## Software Update and Cloudflare Setup
|
|
@@ -530,3 +530,15 @@ sudo systemctl --user start maxy-ui
|
|
|
530
530
|
**Installer aborted with "identity-match FAILED":** Multi-account installs where no sibling matches `users.json[0].userId` abort loud — the installer refuses to pick one and refuses to sweep. Resolution: inspect `account.json` in each candidate dir (listed in the abort output), identify the correct owner, move the other(s) aside manually, then re-run the installer.
|
|
531
531
|
|
|
532
532
|
**A chat turn looks broken — assistant bubble never rendered:** Open `claude-agent-stream-<sessionKey>.log` and grep for `[sse-client]`. The five phases (`connected`, `event_received`, `render_complete`, `error`, `close`) tell the story in order. Missing `connected` = the chat fetch never returned 200; missing `event_received` = the server emitted nothing or the client lost the stream before the first frame; missing `render_complete` = the reducer never committed the assistant bubble (persist_ack never arrived). The operator can also click "Report this turn" in the chat menu to append a `[failure-report]` line carrying the same sessionKey + conversationId + clientSnapshot, plus copy the payload to the clipboard.
|
|
533
|
+
|
|
534
|
+
## Admin DevTools console floods with `onboarding-banner-mount` or unsorted `sessions-poll` lines
|
|
535
|
+
|
|
536
|
+
**Symptom:** Open DevTools on the admin shell at `/` with `onboardingComplete=false`, leave the page idle for a minute or two, then scroll back through the console. Pre-Task-050 you would see thousands of `[admin-ui] onboarding-banner-mount onboardingComplete=false` lines (one per AdminShell render — roughly 40/min from the 3s sessions poll alone) and no per-tick poll telemetry at all.
|
|
537
|
+
|
|
538
|
+
**Post-Task-050 invariants (steady-state idle at `/`):**
|
|
539
|
+
|
|
540
|
+
- `grep -c '\[admin-ui\] onboarding-banner-mount' ~/.maxy/logs/admin-ui-console.log` equals page-load count plus onboarding-flip count, not the render count. Sustained climb at idle ⇒ the banner mount log regressed back into the render body.
|
|
541
|
+
- `grep -c '\[admin-ui\] sessions-poll' ~/.maxy/logs/admin-ui-console.log` grows ~20/min (one per 3s tick) and `outcome=unchanged` dominates `outcome=changed` once the cache is warm. `outcome=changed` every idle tick ⇒ the `useAdminSessions` projection (`sessionId / displayName / lastMessageAt / status`) is missing a field that is churning on every fetch, or a downstream component is mutating the response in place before comparison.
|
|
542
|
+
- `outcome=error` lines name a real fetch failure — they do NOT update sidebar state and do NOT set the `error` field (the operator-initiated `refetch()` still owns that channel).
|
|
543
|
+
|
|
544
|
+
**Why this matters.** The render-body log was misleading: it read as "the admin agent is checking onboarding state continuously", when in fact `onboardingComplete` had not changed at all — it was just the sessions poll re-rendering AdminShell twice per tick. With the structured poll line in place, the console is a faithful record of what the page actually did each tick.
|
|
@@ -2,15 +2,24 @@
|
|
|
2
2
|
name: email
|
|
3
3
|
description: "Email — dedicated email account. Retrieval: email-graph-query for stored email history, recall, and search ('what emails are in memory?', 'emails about X', 'what did Y send?'); email-read / email-search for live IMAP inbox. Sending: email-send (new), email-reply (threaded). Config: email-setup, email-status, email-auto-respond-config, email-otp-extract."
|
|
4
4
|
tools:
|
|
5
|
-
- email-setup
|
|
6
|
-
|
|
7
|
-
- email-
|
|
8
|
-
|
|
9
|
-
- email-
|
|
10
|
-
|
|
11
|
-
- email-
|
|
12
|
-
|
|
13
|
-
- email-
|
|
5
|
+
- name: email-setup
|
|
6
|
+
publicAllowlist: false
|
|
7
|
+
- name: email-read
|
|
8
|
+
publicAllowlist: false
|
|
9
|
+
- name: email-send
|
|
10
|
+
publicAllowlist: false
|
|
11
|
+
- name: email-reply
|
|
12
|
+
publicAllowlist: false
|
|
13
|
+
- name: email-search
|
|
14
|
+
publicAllowlist: false
|
|
15
|
+
- name: email-graph-query
|
|
16
|
+
publicAllowlist: false
|
|
17
|
+
- name: email-otp-extract
|
|
18
|
+
publicAllowlist: false
|
|
19
|
+
- name: email-status
|
|
20
|
+
publicAllowlist: false
|
|
21
|
+
- name: email-auto-respond-config
|
|
22
|
+
publicAllowlist: false
|
|
14
23
|
always: false
|
|
15
24
|
embed: ["admin"]
|
|
16
25
|
metadata: {"platform":{}}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface DispatchInput {
|
|
2
|
+
accountId: string;
|
|
3
|
+
senderEmail: string;
|
|
4
|
+
text: string;
|
|
5
|
+
timeoutMs: number;
|
|
6
|
+
}
|
|
7
|
+
export type DispatchResult = {
|
|
8
|
+
turnText: string;
|
|
9
|
+
} | {
|
|
10
|
+
error: string;
|
|
11
|
+
};
|
|
12
|
+
/** Send an email body to the per-sender claude PTY session, await the
|
|
13
|
+
* next assistant end_turn, return the response text. Reuses the session
|
|
14
|
+
* across cron invocations via the manager's senderId index. */
|
|
15
|
+
export declare function dispatchEmailToClaude(input: DispatchInput): Promise<DispatchResult>;
|
|
16
|
+
export declare function emailTurnTimeoutMs(): number;
|
|
17
|
+
//# sourceMappingURL=claude-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-bridge.d.ts","sourceRoot":"","sources":["../../src/lib/claude-bridge.ts"],"names":[],"mappings":"AAmDA,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,cAAc,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AA8HtE;;gEAEgE;AAChE,wBAAsB,qBAAqB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAqCzF;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
// Email → claude PTY bridge.
|
|
2
|
+
//
|
|
3
|
+
// Task 004 Track B. The email-auto-respond cron script dispatches each
|
|
4
|
+
// inbound email through this module: find-or-spawn a per-sender PTY
|
|
5
|
+
// session via the loopback claude-session-manager, write the email text
|
|
6
|
+
// to the session's PTY stdin, follow claude's per-session JSONL until
|
|
7
|
+
// `stop_reason: "end_turn"`, return the assistant turn text. The cron
|
|
8
|
+
// script then SMTPs the response.
|
|
9
|
+
//
|
|
10
|
+
// This module lives inside the email plugin's MCP source (not under
|
|
11
|
+
// platform/ui/app/lib/) because the cron script is a separate Node
|
|
12
|
+
// process — it cannot share in-process state with the platform/ui
|
|
13
|
+
// channel-pty-bridge instance. Each cron invocation queries the manager
|
|
14
|
+
// for the existing session via `GET /list?senderId=...` rather than
|
|
15
|
+
// caching it in memory.
|
|
16
|
+
//
|
|
17
|
+
// Doctrine references:
|
|
18
|
+
// - Manager HTTP contract: ../../../../services/claude-session-manager/src/http-server.ts
|
|
19
|
+
// - Shared bridge core (in-process, used by whatsapp / webchat):
|
|
20
|
+
// ../../../../../ui/app/lib/channel-pty-bridge/
|
|
21
|
+
// - Task 004 brief: maxy-code/.tasks/004-channel-adaptors-rest.md
|
|
22
|
+
const TAG = "[email-adaptor]";
|
|
23
|
+
function managerBase() {
|
|
24
|
+
const port = Number(process.env.CLAUDE_SESSION_MANAGER_PORT ?? "19400");
|
|
25
|
+
return `http://127.0.0.1:${port}`;
|
|
26
|
+
}
|
|
27
|
+
// ─── Manager HTTP ─────────────────────────────────────────────────────
|
|
28
|
+
async function findExistingSession(senderId) {
|
|
29
|
+
try {
|
|
30
|
+
const res = await fetch(`${managerBase()}/list?senderId=${encodeURIComponent(senderId)}`);
|
|
31
|
+
if (!res.ok)
|
|
32
|
+
return null;
|
|
33
|
+
const sessions = (await res.json());
|
|
34
|
+
const alive = sessions.find((s) => s.status === "alive" && s.channel === "email");
|
|
35
|
+
return alive?.sessionId ?? null;
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
async function spawnSession(opts) {
|
|
42
|
+
try {
|
|
43
|
+
const res = await fetch(`${managerBase()}/spawn`, {
|
|
44
|
+
method: "POST",
|
|
45
|
+
headers: { "content-type": "application/json" },
|
|
46
|
+
body: JSON.stringify({
|
|
47
|
+
senderId: opts.senderId,
|
|
48
|
+
role: "public",
|
|
49
|
+
channel: "email",
|
|
50
|
+
accountId: opts.accountId,
|
|
51
|
+
}),
|
|
52
|
+
});
|
|
53
|
+
if (!res.ok) {
|
|
54
|
+
console.error(`${TAG} reject reason=spawn-failed senderId=${opts.senderId} status=${res.status}`);
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
const body = (await res.json());
|
|
58
|
+
return body.sessionId;
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
const m = err instanceof Error ? err.message : String(err);
|
|
62
|
+
console.error(`${TAG} reject reason=spawn-unreachable senderId=${opts.senderId} message=${m}`);
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
async function writeInput(sessionId, text) {
|
|
67
|
+
try {
|
|
68
|
+
const res = await fetch(`${managerBase()}/${sessionId}/input`, {
|
|
69
|
+
method: "POST",
|
|
70
|
+
headers: { "content-type": "application/json" },
|
|
71
|
+
body: JSON.stringify({ text }),
|
|
72
|
+
});
|
|
73
|
+
return res.ok;
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// ─── JSONL follower (one-shot, waits for next end_turn) ──────────────
|
|
80
|
+
async function awaitNextTurn(sessionId, timeoutMs) {
|
|
81
|
+
const abort = new AbortController();
|
|
82
|
+
const timeoutHandle = setTimeout(() => abort.abort(), timeoutMs);
|
|
83
|
+
try {
|
|
84
|
+
const res = await fetch(`${managerBase()}/${sessionId}/log?follow=1`, { signal: abort.signal });
|
|
85
|
+
if (!res.ok || !res.body) {
|
|
86
|
+
return { error: `follow-status-${res.status}` };
|
|
87
|
+
}
|
|
88
|
+
const reader = res.body.getReader();
|
|
89
|
+
const decoder = new TextDecoder("utf8");
|
|
90
|
+
let buffered = "";
|
|
91
|
+
let turnText = "";
|
|
92
|
+
while (!abort.signal.aborted) {
|
|
93
|
+
const { value, done } = await reader.read();
|
|
94
|
+
if (done)
|
|
95
|
+
break;
|
|
96
|
+
buffered += decoder.decode(value, { stream: true });
|
|
97
|
+
let nl = buffered.indexOf("\n");
|
|
98
|
+
while (nl !== -1) {
|
|
99
|
+
const line = buffered.slice(0, nl);
|
|
100
|
+
buffered = buffered.slice(nl + 1);
|
|
101
|
+
nl = buffered.indexOf("\n");
|
|
102
|
+
if (!line)
|
|
103
|
+
continue;
|
|
104
|
+
let event;
|
|
105
|
+
try {
|
|
106
|
+
event = JSON.parse(line);
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
if (event.type === "user") {
|
|
112
|
+
turnText = "";
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
if (event.type !== "assistant")
|
|
116
|
+
continue;
|
|
117
|
+
const msg = event.message;
|
|
118
|
+
if (!msg)
|
|
119
|
+
continue;
|
|
120
|
+
if (Array.isArray(msg.content)) {
|
|
121
|
+
for (const block of msg.content) {
|
|
122
|
+
if (block?.type === "text" && typeof block.text === "string") {
|
|
123
|
+
turnText += block.text;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (msg.stop_reason === "end_turn") {
|
|
128
|
+
if (turnText.trim()) {
|
|
129
|
+
// Abort the stream so the manager closes the follower
|
|
130
|
+
// immediately; we have our turn.
|
|
131
|
+
abort.abort();
|
|
132
|
+
return { turnText };
|
|
133
|
+
}
|
|
134
|
+
turnText = "";
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return { error: abort.signal.aborted ? "timeout" : "stream-closed" };
|
|
139
|
+
}
|
|
140
|
+
catch (err) {
|
|
141
|
+
if (abort.signal.aborted)
|
|
142
|
+
return { error: "timeout" };
|
|
143
|
+
return { error: err instanceof Error ? err.message : String(err) };
|
|
144
|
+
}
|
|
145
|
+
finally {
|
|
146
|
+
clearTimeout(timeoutHandle);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
// ─── Public dispatch ─────────────────────────────────────────────────
|
|
150
|
+
/** Send an email body to the per-sender claude PTY session, await the
|
|
151
|
+
* next assistant end_turn, return the response text. Reuses the session
|
|
152
|
+
* across cron invocations via the manager's senderId index. */
|
|
153
|
+
export async function dispatchEmailToClaude(input) {
|
|
154
|
+
if (!input.text.trim())
|
|
155
|
+
return { error: "empty-text" };
|
|
156
|
+
const bytes = Buffer.byteLength(input.text, "utf8");
|
|
157
|
+
console.error(`${TAG} inbound from=${input.senderEmail} bytes=${bytes} accountId=${input.accountId}`);
|
|
158
|
+
let sessionId = await findExistingSession(input.senderEmail);
|
|
159
|
+
let action = "reuse";
|
|
160
|
+
if (!sessionId) {
|
|
161
|
+
action = "spawn";
|
|
162
|
+
sessionId = await spawnSession({ senderId: input.senderEmail, accountId: input.accountId });
|
|
163
|
+
if (!sessionId)
|
|
164
|
+
return { error: "spawn-failed" };
|
|
165
|
+
}
|
|
166
|
+
console.error(`${TAG} session-resolved senderId=${input.senderEmail} action=${action} sessionId=${sessionId.slice(0, 8)}`);
|
|
167
|
+
const writeOk = await writeInput(sessionId, input.text);
|
|
168
|
+
if (!writeOk) {
|
|
169
|
+
console.error(`${TAG} reject reason=input-failed senderId=${input.senderEmail} sessionId=${sessionId.slice(0, 8)}`);
|
|
170
|
+
return { error: "input-failed" };
|
|
171
|
+
}
|
|
172
|
+
const startedAt = Date.now();
|
|
173
|
+
const result = await awaitNextTurn(sessionId, input.timeoutMs);
|
|
174
|
+
const idleMs = Date.now() - startedAt;
|
|
175
|
+
if ("error" in result) {
|
|
176
|
+
console.error(`${TAG} reject reason=turn-${result.error} senderId=${input.senderEmail} sessionId=${sessionId.slice(0, 8)} idle-ms=${idleMs}`);
|
|
177
|
+
return result;
|
|
178
|
+
}
|
|
179
|
+
console.error(`${TAG} outbound to=${input.senderEmail} bytes=${Buffer.byteLength(result.turnText, "utf8")} sessionId=${sessionId.slice(0, 8)} idle-ms=${idleMs}`);
|
|
180
|
+
return result;
|
|
181
|
+
}
|
|
182
|
+
export function emailTurnTimeoutMs() {
|
|
183
|
+
return Number(process.env.EMAIL_POLL_TURN_TIMEOUT_MS ?? String(10 * 60_000));
|
|
184
|
+
}
|
|
185
|
+
//# sourceMappingURL=claude-bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-bridge.js","sourceRoot":"","sources":["../../src/lib/claude-bridge.ts"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,EAAE;AACF,uEAAuE;AACvE,oEAAoE;AACpE,wEAAwE;AACxE,sEAAsE;AACtE,sEAAsE;AACtE,kCAAkC;AAClC,EAAE;AACF,oEAAoE;AACpE,mEAAmE;AACnE,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