@rubytech/create-maxy 1.0.506 → 1.0.508
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/payload/platform/config/brand.json +1 -1
- package/payload/platform/lib/mcp-stderr-tee/dist/index.d.ts +18 -0
- package/payload/platform/lib/mcp-stderr-tee/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/mcp-stderr-tee/dist/index.js +45 -0
- package/payload/platform/lib/mcp-stderr-tee/dist/index.js.map +1 -0
- package/payload/platform/lib/mcp-stderr-tee/src/index.ts +51 -0
- package/payload/platform/lib/mcp-stderr-tee/tsconfig.json +8 -0
- package/payload/platform/package.json +2 -2
- package/payload/platform/plugins/admin/mcp/dist/index.js +7 -3
- package/payload/platform/plugins/admin/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/cloudflare/mcp/dist/index.js +2 -0
- package/payload/platform/plugins/cloudflare/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/contacts/mcp/dist/index.js +2 -0
- package/payload/platform/plugins/contacts/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/index.js +2 -0
- package/payload/platform/plugins/email/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/index.js +2 -0
- package/payload/platform/plugins/memory/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/replicate/mcp/dist/index.js +2 -0
- package/payload/platform/plugins/replicate/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/index.js +2 -0
- package/payload/platform/plugins/scheduling/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/tasks/mcp/dist/index.js +2 -0
- package/payload/platform/plugins/tasks/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/telegram/mcp/dist/index.js +2 -0
- package/payload/platform/plugins/telegram/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/waitlist/mcp/dist/index.js +2 -0
- package/payload/platform/plugins/waitlist/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/whatsapp/mcp/dist/index.js +5 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/workflows/mcp/dist/index.js +2 -0
- package/payload/platform/plugins/workflows/mcp/dist/index.js.map +1 -1
- package/payload/platform/scripts/logs-read.sh +4 -3
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/index.js +6 -4
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/index.js.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/loop-api.d.ts.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/loop-api.js +47 -12
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/loop-api.js.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/customer-preferences.d.ts.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/customer-preferences.js.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/feedback.d.ts.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/feedback.js.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-enquiry.d.ts.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-enquiry.js.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match-batch.d.ts.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match-batch.js.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match-request.d.ts.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match-request.js.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match.d.ts.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match.js.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-detail.d.ts.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-detail.js +110 -18
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-detail.js.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-search.d.ts.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-search.js +34 -6
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-search.js.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-detail.d.ts.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-detail.js +59 -16
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-detail.js.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-listed.d.ts.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-listed.js +5 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-listed.js.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-request.d.ts.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-request.js.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-search.d.ts.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-search.js +4 -2
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-search.js.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/supplier.d.ts.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/supplier.js.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/team-availability.d.ts.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/team-availability.js +6 -2
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/team-availability.js.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/team-info.d.ts.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/team-info.js +16 -4
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/team-info.js.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-create.d.ts.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-create.js.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-detail.d.ts.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-detail.js +63 -18
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-detail.js.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-search.d.ts.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-search.js +13 -3
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-search.js.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-update.d.ts.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-update.js.map +1 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/src/index.ts +8 -5
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/src/lib/loop-api.ts +84 -18
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/src/tools/customer-preferences.ts +6 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/src/tools/feedback.ts +6 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/src/tools/marketing-enquiry.ts +8 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/src/tools/marketing-match-batch.ts +5 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/src/tools/marketing-match-request.ts +5 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/src/tools/marketing-match.ts +6 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/src/tools/people-detail.ts +203 -21
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/src/tools/people-search.ts +99 -12
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/src/tools/property-detail.ts +95 -20
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/src/tools/property-listed.ts +27 -6
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/src/tools/property-request.ts +5 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/src/tools/property-search.ts +20 -8
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/src/tools/supplier.ts +9 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/src/tools/team-availability.ts +12 -2
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/src/tools/team-info.ts +50 -9
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/src/tools/viewing-create.ts +5 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/src/tools/viewing-detail.ts +124 -23
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/src/tools/viewing-search.ts +25 -7
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/src/tools/viewing-update.ts +5 -0
- package/payload/server/server.js +122 -14
|
@@ -10,31 +10,76 @@ export async function viewingDetail(params) {
|
|
|
10
10
|
return [];
|
|
11
11
|
}, { teamName });
|
|
12
12
|
return formatAggregationResult(result, (v) => {
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
const propAddr = v.property?.propertyAddress ?? "Unknown property";
|
|
14
|
+
const lines = [`**${propAddr}** [Viewing ID: ${v.id}]`];
|
|
15
|
+
// Appointment time
|
|
16
|
+
if (v.dateOfAppointment) {
|
|
17
|
+
const start = formatDateTime(v.dateOfAppointment);
|
|
18
|
+
const end = v.dateOfAppointmentEnd ? formatDateTime(v.dateOfAppointmentEnd) : "";
|
|
19
|
+
lines.push(`Date/Time: ${start}${end ? ` — ${end}` : ""}`);
|
|
20
|
+
}
|
|
17
21
|
if (v.status)
|
|
18
22
|
lines.push(`Status: ${v.status}`);
|
|
19
23
|
if (v.type)
|
|
20
24
|
lines.push(`Type: ${v.type}`);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (v.
|
|
24
|
-
|
|
25
|
-
if (v.
|
|
26
|
-
|
|
27
|
-
if (v.
|
|
28
|
-
|
|
25
|
+
// Confirmation status
|
|
26
|
+
const confirmParts = [];
|
|
27
|
+
if (v.buyerConfirmed != null)
|
|
28
|
+
confirmParts.push(`Buyer: ${v.buyerConfirmed ? "yes" : "no"}`);
|
|
29
|
+
if (v.sellerConfirmed != null)
|
|
30
|
+
confirmParts.push(`Seller: ${v.sellerConfirmed ? "yes" : "no"}`);
|
|
31
|
+
if (v.agentConfirmed != null)
|
|
32
|
+
confirmParts.push(`Agent: ${v.agentConfirmed ? "yes" : "no"}`);
|
|
33
|
+
if (confirmParts.length)
|
|
34
|
+
lines.push(`Confirmed — ${confirmParts.join(", ")}`);
|
|
35
|
+
// Property details
|
|
36
|
+
if (v.property) {
|
|
37
|
+
const prop = v.property;
|
|
38
|
+
if (prop.price != null)
|
|
39
|
+
lines.push(`Property price: £${prop.price.toLocaleString("en-GB")}`);
|
|
40
|
+
if (prop.propertyType)
|
|
41
|
+
lines.push(`Property type: ${prop.propertyType}`);
|
|
42
|
+
if (prop.bedrooms != null)
|
|
43
|
+
lines.push(`Bedrooms: ${prop.bedrooms}`);
|
|
44
|
+
if (prop.id)
|
|
45
|
+
lines.push(`Property ID: ${prop.id}`);
|
|
46
|
+
}
|
|
47
|
+
// Buyer
|
|
48
|
+
if (v.buyer) {
|
|
49
|
+
const b = v.buyer;
|
|
50
|
+
lines.push(`\n**Buyer:** ${b.buyerGroupName ?? "Unknown"} [ID: ${b.id}]`);
|
|
51
|
+
if (b.maxPrice != null)
|
|
52
|
+
lines.push(` Max price: £${b.maxPrice.toLocaleString("en-GB")}`);
|
|
53
|
+
if (b.position && b.position !== "none")
|
|
54
|
+
lines.push(` Position: ${b.position}`);
|
|
55
|
+
}
|
|
56
|
+
// Seller
|
|
57
|
+
if (v.seller) {
|
|
58
|
+
const s = v.seller;
|
|
59
|
+
lines.push(`\n**Seller:** ${s.sellerGroupName ?? "Unknown"} [ID: ${s.id}]`);
|
|
60
|
+
}
|
|
61
|
+
// Attending agent
|
|
62
|
+
if (v.attendingAgent) {
|
|
63
|
+
const a = v.attendingAgent;
|
|
64
|
+
const agentName = [a.firstName, a.lastName].filter(Boolean).join(" ");
|
|
65
|
+
const title = a.jobTitle ? ` (${a.jobTitle})` : "";
|
|
66
|
+
const contact = a.email ?? a.mobilePhone ?? "";
|
|
67
|
+
lines.push(`\n**Attending agent:** ${agentName}${title}${contact ? ` — ${contact}` : ""}`);
|
|
68
|
+
}
|
|
69
|
+
// Feedback
|
|
29
70
|
if (v.buyerFeedback)
|
|
30
|
-
lines.push(
|
|
71
|
+
lines.push(`\nBuyer feedback: ${v.buyerFeedback}`);
|
|
31
72
|
if (v.sellerFeedback)
|
|
32
|
-
lines.push(`Seller
|
|
33
|
-
if (v.
|
|
34
|
-
lines.push(`
|
|
35
|
-
if (v.landlordFeedback)
|
|
36
|
-
lines.push(`Landlord Feedback: ${v.landlordFeedback}`);
|
|
73
|
+
lines.push(`Seller feedback: ${v.sellerFeedback}`);
|
|
74
|
+
if (v.comment)
|
|
75
|
+
lines.push(`Notes: ${v.comment}`);
|
|
37
76
|
return lines.join("\n");
|
|
38
77
|
}, "viewing details");
|
|
39
78
|
}
|
|
79
|
+
function formatDateTime(iso) {
|
|
80
|
+
const [datePart, timePart] = iso.split("T");
|
|
81
|
+
if (!timePart)
|
|
82
|
+
return datePart;
|
|
83
|
+
return `${datePart} ${timePart.slice(0, 5)}`;
|
|
84
|
+
}
|
|
40
85
|
//# sourceMappingURL=viewing-detail.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewing-detail.js","sourceRoot":"","sources":["../../src/tools/viewing-detail.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,OAAO,GACR,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"viewing-detail.js","sourceRoot":"","sources":["../../src/tools/viewing-detail.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,OAAO,GACR,MAAM,oBAAoB,CAAC;AA0E5B,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAKnC;IACC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;IAE9D,MAAM,MAAM,GAAG,MAAM,oBAAoB,CACvC,SAAS,EACT,UAAU,EACV,qBAAqB,EACrB,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;QACrB,MAAM,IAAI,GAAG,gBAAgB,UAAU,aAAa,SAAS,EAAE,CAAC;QAChE,MAAM,IAAI,GAAG,MAAM,OAAO,CAAoB,MAAM,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,CAAC,CAAC;QACzF,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AI,CAAC,CAAC,aAAa;YAAE,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,aAAa,EAAE,CAAC,CAAC;QACxE,IAAI,CAAC,CAAC,cAAc;YAAE,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC;QACzE,IAAI,CAAC,CAAC,OAAO;YAAE,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QAEjD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1B,CAAC,EACD,iBAAiB,CAClB,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,GAAW;IACjC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC5C,IAAI,CAAC,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC/B,OAAO,GAAG,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;AAC/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewing-search.d.ts","sourceRoot":"","sources":["../../src/tools/viewing-search.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"viewing-search.d.ts","sourceRoot":"","sources":["../../src/tools/viewing-search.ts"],"names":[],"mappings":"AAyBA,KAAK,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC;AAEhD,wBAAsB,aAAa,CAAC,MAAM,EAAE;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAiDlB"}
|
|
@@ -24,11 +24,21 @@ export async function viewingSearch(params) {
|
|
|
24
24
|
}, { teamName, limitPerTeam: limit ?? 50, limitTotal: limit ?? 200 });
|
|
25
25
|
return formatAggregationResult(result, (v) => {
|
|
26
26
|
const addr = v.propertyAddress ?? "Unknown property";
|
|
27
|
-
const
|
|
27
|
+
const id = v.id != null ? ` [ID: ${v.id}]` : "";
|
|
28
|
+
// dateOfAppointment is ISO datetime e.g. "2026-04-10T15:30:00"
|
|
29
|
+
const when = v.dateOfAppointment
|
|
30
|
+
? formatDateTime(v.dateOfAppointment)
|
|
31
|
+
: "No date";
|
|
28
32
|
const viewStatus = v.status ? ` [${v.status}]` : "";
|
|
29
|
-
const
|
|
33
|
+
const buyer = v.buyerName ? ` — ${v.buyerName}` : "";
|
|
30
34
|
const viewType = v.type ? ` (${v.type})` : "";
|
|
31
|
-
return `- ${addr} — ${when
|
|
35
|
+
return `- ${addr}${id} — ${when}${viewType}${buyer}${viewStatus}`;
|
|
32
36
|
}, "viewings");
|
|
33
37
|
}
|
|
38
|
+
function formatDateTime(iso) {
|
|
39
|
+
const [datePart, timePart] = iso.split("T");
|
|
40
|
+
if (!timePart)
|
|
41
|
+
return datePart;
|
|
42
|
+
return `${datePart} ${timePart.slice(0, 5)}`;
|
|
43
|
+
}
|
|
34
44
|
//# sourceMappingURL=viewing-search.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewing-search.js","sourceRoot":"","sources":["../../src/tools/viewing-search.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,OAAO,GACR,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"viewing-search.js","sourceRoot":"","sources":["../../src/tools/viewing-search.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,uB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AE,CAAC;IACpE,CAAC,EACD,UAAU,CACX,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,GAAW;IACjC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC5C,IAAI,CAAC,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC/B,OAAO,GAAG,QAAQ,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;AAC/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewing-update.d.ts","sourceRoot":"","sources":["../../src/tools/viewing-update.ts"],"names":[],"mappings":"AAEA,KAAK,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC;AAKvC,KAAK,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAChE,KAAK,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"viewing-update.d.ts","sourceRoot":"","sources":["../../src/tools/viewing-update.ts"],"names":[],"mappings":"AAEA,KAAK,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC;AAKvC,KAAK,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAChE,KAAK,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;AAYlC,wBAAsB,aAAa,CAAC,MAAM,EAAE;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B,GAAG,OAAO,CAAC,MAAM,CAAC,CAwBlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viewing-update.js","sourceRoot":"","sources":["../../src/tools/viewing-update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"viewing-update.js","sourceRoot":"","sources":["../../src/tools/viewing-update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAoB3D,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAQnC;IACC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC;IAE3F,IAAI,MAAM,KAAK,UAAU,IAAI,CAAC,aAAa,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,+FAA+F,CAAC,CAAC;IACnH,CAAC;IAED,MAAM,WAAW,CACf,SAAS,EACT,QAAQ,EACR,UAAU,EACV,qBAAqB,EACrB,KAAK,EAAE,MAAM,EAAE,EAAE;QACf,MAAM,MAAM,GAAG,MAAM,KAAK,MAAM;YAC9B,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,GAAG,aAAa,WAAW,CAAC;QAChC,MAAM,IAAI,GAAG,gBAAgB,UAAU,aAAa,SAAS,IAAI,MAAM,EAAE,CAAC;QAC1E,iDAAiD;QACjD,OAAO,QAAQ,CAAsB,MAAM,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,qBAAqB,EAAE,QAAQ,CAAC,CAAC;IACxG,CAAC,CACF,CAAC;IAEF,MAAM,WAAW,GAAG,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,aAAa,oBAAoB,CAAC;IAC5F,OAAO,GAAG,WAAW,gBAAgB,SAAS,KAAK,UAAU,eAAe,QAAQ,IAAI,CAAC;AAC3F,CAAC"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { initStderrTee } from "../../../../../../platform/lib/mcp-stderr-tee/dist/index.js";
|
|
2
|
+
initStderrTee("loop");
|
|
3
|
+
|
|
1
4
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
5
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
6
|
import { z } from "zod";
|
|
@@ -25,16 +28,16 @@ import { customerPreferences } from "./tools/customer-preferences.js";
|
|
|
25
28
|
import { supplier } from "./tools/supplier.js";
|
|
26
29
|
import { closeDriver } from "./lib/neo4j.js";
|
|
27
30
|
|
|
28
|
-
const server = new McpServer({
|
|
29
|
-
name: "maxy-real-agency-loop",
|
|
30
|
-
version: "0.2.0",
|
|
31
|
-
});
|
|
32
|
-
|
|
33
31
|
const accountId = process.env.ACCOUNT_ID;
|
|
34
32
|
if (!accountId) {
|
|
35
33
|
throw new Error("ACCOUNT_ID environment variable is required");
|
|
36
34
|
}
|
|
37
35
|
|
|
36
|
+
const server = new McpServer({
|
|
37
|
+
name: "maxy-real-agency-loop",
|
|
38
|
+
version: "0.2.0",
|
|
39
|
+
});
|
|
40
|
+
|
|
38
41
|
const ALL_PERMISSIONS = z.enum([
|
|
39
42
|
"properties", "people", "viewings", "feedback", "team",
|
|
40
43
|
"marketing", "customer", "supplier",
|
package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/src/lib/loop-api.ts
CHANGED
|
@@ -22,6 +22,60 @@ const REQUEST_TIMEOUT_MS = 10_000;
|
|
|
22
22
|
const DEFAULT_LIMIT_PER_TEAM = 50;
|
|
23
23
|
const DEFAULT_LIMIT_TOTAL = 200;
|
|
24
24
|
|
|
25
|
+
// ─── Loop API V2 Envelope ────────────────────────────────────────
|
|
26
|
+
//
|
|
27
|
+
// Every Loop API V2 response is wrapped in a status envelope:
|
|
28
|
+
//
|
|
29
|
+
// { statusCode: "success", httpResponseCode: 200,
|
|
30
|
+
// errors: [], warnings: [], data: <payload> }
|
|
31
|
+
//
|
|
32
|
+
// unwrapEnvelope detects this shape and returns the inner `data`,
|
|
33
|
+
// so tool handlers receive bare arrays/objects — not the wrapper.
|
|
34
|
+
// Non-envelope responses (if any) pass through unchanged.
|
|
35
|
+
// ──────────────────────────────────────────────────────────────────
|
|
36
|
+
|
|
37
|
+
interface LoopEnvelope<T> {
|
|
38
|
+
statusCode: string;
|
|
39
|
+
httpResponseCode: number;
|
|
40
|
+
errors?: string[];
|
|
41
|
+
warnings?: string[];
|
|
42
|
+
data: T;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function isEnvelope(val: unknown): val is LoopEnvelope<unknown> {
|
|
46
|
+
return (
|
|
47
|
+
val !== null &&
|
|
48
|
+
typeof val === "object" &&
|
|
49
|
+
!Array.isArray(val) &&
|
|
50
|
+
"statusCode" in val &&
|
|
51
|
+
"httpResponseCode" in val &&
|
|
52
|
+
"data" in val
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function unwrapEnvelope<T>(parsed: unknown, toolName: string, teamName: string): T {
|
|
57
|
+
if (!isEnvelope(parsed)) {
|
|
58
|
+
return parsed as T;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (parsed.statusCode !== "success") {
|
|
62
|
+
const errMsg = parsed.errors?.length
|
|
63
|
+
? parsed.errors.join("; ")
|
|
64
|
+
: `statusCode=${parsed.statusCode}`;
|
|
65
|
+
throw new Error(
|
|
66
|
+
`Loop API error for team=${teamName} tool=${toolName}: ${errMsg} (httpResponseCode=${parsed.httpResponseCode})`
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (parsed.warnings?.length) {
|
|
71
|
+
console.error(
|
|
72
|
+
`[loop] ${toolName} team=${teamName} warnings: ${parsed.warnings.join("; ")}`
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return parsed.data as T;
|
|
77
|
+
}
|
|
78
|
+
|
|
25
79
|
export interface LoopTeamKey {
|
|
26
80
|
teamName: string;
|
|
27
81
|
encryptedKey: string;
|
|
@@ -105,12 +159,16 @@ export async function loopGet<T>(
|
|
|
105
159
|
|
|
106
160
|
const text = await response.text();
|
|
107
161
|
try {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
162
|
+
const parsed = JSON.parse(text);
|
|
163
|
+
return unwrapEnvelope<T>(parsed, toolName, teamName);
|
|
164
|
+
} catch (err) {
|
|
165
|
+
if (err instanceof SyntaxError) {
|
|
166
|
+
throw new Error(
|
|
167
|
+
`Loop returned non-JSON response for team=${teamName} path=${path} ` +
|
|
168
|
+
`(status=${response.status}, length=${text.length})`
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
throw err;
|
|
114
172
|
}
|
|
115
173
|
}
|
|
116
174
|
|
|
@@ -156,12 +214,16 @@ export async function loopPost<T>(
|
|
|
156
214
|
|
|
157
215
|
const text = await response.text();
|
|
158
216
|
try {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
217
|
+
const parsed = JSON.parse(text);
|
|
218
|
+
return unwrapEnvelope<T>(parsed, toolName, teamName);
|
|
219
|
+
} catch (err) {
|
|
220
|
+
if (err instanceof SyntaxError) {
|
|
221
|
+
throw new Error(
|
|
222
|
+
`Loop returned non-JSON response for team=${teamName} path=${path} ` +
|
|
223
|
+
`(status=${response.status}, length=${text.length})`
|
|
224
|
+
);
|
|
225
|
+
}
|
|
226
|
+
throw err;
|
|
165
227
|
}
|
|
166
228
|
}
|
|
167
229
|
|
|
@@ -206,12 +268,16 @@ export async function loopPut<T>(
|
|
|
206
268
|
|
|
207
269
|
const text = await response.text();
|
|
208
270
|
try {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
271
|
+
const parsed = JSON.parse(text);
|
|
272
|
+
return unwrapEnvelope<T>(parsed, toolName, teamName);
|
|
273
|
+
} catch (err) {
|
|
274
|
+
if (err instanceof SyntaxError) {
|
|
275
|
+
throw new Error(
|
|
276
|
+
`Loop returned non-JSON response for team=${teamName} path=${path} ` +
|
|
277
|
+
`(status=${response.status}, length=${text.length})`
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
throw err;
|
|
215
281
|
}
|
|
216
282
|
}
|
|
217
283
|
|
|
@@ -2,6 +2,12 @@ import { loopGet, loopPost, withTeamKey } from "../lib/loop-api.js";
|
|
|
2
2
|
|
|
3
3
|
type PreferencesAction = "read" | "write";
|
|
4
4
|
|
|
5
|
+
// ─── Loop API V2: /customer/preferences/{personCode} ───────────
|
|
6
|
+
// Uses personCode (encoded), NOT raw personId from /people.
|
|
7
|
+
// personCode is obtained from marketing context (auto-responder,
|
|
8
|
+
// matching), not from standard /people endpoints.
|
|
9
|
+
// GET returns preferences object; POST updates it.
|
|
10
|
+
// ────────────────────────────────────────────────────────────────
|
|
5
11
|
interface LoopCustomerPreferences {
|
|
6
12
|
personCode?: number;
|
|
7
13
|
preferences?: Record<string, unknown>;
|
package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/src/tools/feedback.ts
CHANGED
|
@@ -6,6 +6,12 @@ import {
|
|
|
6
6
|
|
|
7
7
|
type Department = "sales" | "lettings";
|
|
8
8
|
|
|
9
|
+
// ─── Loop API V2: /feedback/residential/{dept}/viewings/{id} ───
|
|
10
|
+
// Returns null when no feedback has been submitted. Exact schema
|
|
11
|
+
// not verified — endpoint returned null for all test viewings.
|
|
12
|
+
// Fields below are the documented schema; the [key: string]: unknown
|
|
13
|
+
// catch-all ensures any actual response fields are accessible.
|
|
14
|
+
// ────────────────────────────────────────────────────────────────
|
|
9
15
|
interface LoopViewingFeedback {
|
|
10
16
|
viewingId?: number;
|
|
11
17
|
propertyAddress?: string;
|
|
@@ -2,6 +2,14 @@ import { loopGet, loopPost, loopPut, withTeamKey } from "../lib/loop-api.js";
|
|
|
2
2
|
|
|
3
3
|
type EnquiryAction = "seller-enquiry" | "autoresponder-get" | "autoresponder-answers" | "autoresponder-details" | "autoresponder-refer";
|
|
4
4
|
|
|
5
|
+
// ─── Loop API V2: Marketing Enquiry Endpoints ──────────────────
|
|
6
|
+
// POST /marketing/enquiries/seller — submit seller enquiry
|
|
7
|
+
// GET /marketing/enquiries/auto-responder/{id}/{key} — read enquiry
|
|
8
|
+
// PUT .../auto-responder/{id}/answers/{key} — submit answers
|
|
9
|
+
// PUT .../auto-responder/{id}/details/{key} — update details
|
|
10
|
+
// PUT .../auto-responder/{id}/refer/{key} — refer enquiry
|
|
11
|
+
// Note: auto-responder uses personCode + key (UUID), not personId
|
|
12
|
+
// ────────────────────────────────────────────────────────────────
|
|
5
13
|
interface LoopBooleanResponse {
|
|
6
14
|
success?: boolean;
|
|
7
15
|
[key: string]: unknown;
|
|
@@ -4,6 +4,11 @@ import {
|
|
|
4
4
|
loopPut,
|
|
5
5
|
} from "../lib/loop-api.js";
|
|
6
6
|
|
|
7
|
+
// ─── Loop API V2: PUT /marketing/matching/other-matches ─────────
|
|
8
|
+
// Request body: array of property IDs
|
|
9
|
+
// Response: array of matching property summaries
|
|
10
|
+
// Schema not verified via curl (depends on matching state)
|
|
11
|
+
// ────────────────────────────────────────────────────────────────
|
|
7
12
|
interface LoopMatchingSummary {
|
|
8
13
|
id?: number;
|
|
9
14
|
address?: string;
|
|
@@ -3,6 +3,11 @@ import { loopPost, withTeamKey } from "../lib/loop-api.js";
|
|
|
3
3
|
type Department = "sales" | "lettings";
|
|
4
4
|
type MatchAction = "viewing" | "information" | "callback";
|
|
5
5
|
|
|
6
|
+
// ─── Loop API V2: POST /marketing/matching/{id}/{action} ────────
|
|
7
|
+
// Actions: viewing, information, callback
|
|
8
|
+
// Request body: { name?, email?, phone?, message? }
|
|
9
|
+
// Response: boolean success
|
|
10
|
+
// ────────────────────────────────────────────────────────────────
|
|
6
11
|
interface LoopBooleanResponse {
|
|
7
12
|
success?: boolean;
|
|
8
13
|
[key: string]: unknown;
|
|
@@ -4,6 +4,12 @@ import {
|
|
|
4
4
|
loopGet,
|
|
5
5
|
} from "../lib/loop-api.js";
|
|
6
6
|
|
|
7
|
+
// ─── Loop API V2: /marketing/matching/{id} ─────────────────────
|
|
8
|
+
// Returned HTTP 500 for test property 895155 — may require
|
|
9
|
+
// publishedToMatching: true. Exact response schema not verified.
|
|
10
|
+
// Fields below are from Swagger docs; [key: string]: unknown
|
|
11
|
+
// ensures any actual response fields are accessible.
|
|
12
|
+
// ────────────────────────────────────────────────────────────────
|
|
7
13
|
interface LoopMatchingProperty {
|
|
8
14
|
id?: number;
|
|
9
15
|
address?: string;
|