@rubytech/create-maxy 1.0.704 → 1.0.706
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/__tests__/apt-resolve.test.js +179 -0
- package/dist/apt-resolve.js +73 -0
- package/dist/index.js +48 -46
- package/package.json +3 -3
- package/payload/platform/lib/graph-mcp/dist/__tests__/schema-cypher-parser.test.d.ts +2 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/schema-cypher-parser.test.d.ts.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/schema-cypher-parser.test.js +89 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/schema-cypher-parser.test.js.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/schema-cypher-parser.d.ts +42 -0
- package/payload/platform/lib/graph-mcp/dist/schema-cypher-parser.d.ts.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/schema-cypher-parser.js +87 -0
- package/payload/platform/lib/graph-mcp/dist/schema-cypher-parser.js.map +1 -0
- package/payload/platform/lib/graph-mcp/src/__tests__/schema-cypher-parser.test.ts +99 -0
- package/payload/platform/lib/graph-mcp/src/schema-cypher-parser.ts +84 -0
- package/payload/platform/neo4j/edge-annotations.json +134 -0
- package/payload/platform/package-lock.json +249 -67
- package/payload/platform/plugins/admin/PLUGIN.md +1 -0
- package/payload/platform/plugins/admin/mcp/dist/index.js +30 -0
- package/payload/platform/plugins/admin/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/admin/skills/business-profile/SKILL.md +2 -2
- package/payload/platform/plugins/admin/skills/onboarding/SKILL.md +46 -5
- package/payload/platform/plugins/memory/PLUGIN.md +3 -1
- package/payload/platform/plugins/memory/mcp/dist/index.js +56 -6
- package/payload/platform/plugins/memory/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/live-schema-source.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/live-schema-source.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/live-schema-source.test.js +92 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/live-schema-source.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-loader.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-loader.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-loader.test.js +51 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-loader.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-validator.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-validator.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-validator.test.js +222 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-validator.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-write-gate.d.ts +16 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-write-gate.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-write-gate.js +38 -11
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-write-gate.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/live-schema-source.d.ts +136 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/live-schema-source.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/live-schema-source.js +180 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/live-schema-source.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-loader.d.ts +11 -2
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-loader.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-loader.js +6 -3
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-loader.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-validator.d.ts +44 -22
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-validator.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-validator.js +94 -57
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-validator.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.d.ts +7 -5
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js +2 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js.map +1 -1
- package/payload/platform/plugins/memory/references/schema-base.md +4 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/index.d.ts +2 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/index.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/index.js +293 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/index.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/crypto.d.ts +10 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/crypto.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/crypto.js +88 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/crypto.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/loop-api.d.ts +80 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/loop-api.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/loop-api.js +355 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/loop-api.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/neo4j.d.ts +5 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/neo4j.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/neo4j.js +34 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/neo4j.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/customer-preferences.d.ts +10 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/customer-preferences.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/customer-preferences.js +24 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/customer-preferences.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/feedback-list.d.ts +6 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/feedback-list.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/feedback-list.js +18 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/feedback-list.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/feedback.d.ts +16 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/feedback.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/feedback.js +35 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/feedback.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-deregister.d.ts +5 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-deregister.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-deregister.js +19 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-deregister.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-list.d.ts +4 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-list.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-list.js +14 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-list.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-register.d.ts +9 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-register.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-register.js +60 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-register.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-enquiry.d.ts +13 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-enquiry.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-enquiry.js +41 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-enquiry.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match-batch.d.ts +9 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match-batch.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match-batch.js +16 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match-batch.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match-request.d.ts +15 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match-request.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match-request.js +11 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match-request.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match.d.ts +10 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match.js +39 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-detail.d.ts +9 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-detail.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-detail.js +125 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-detail.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-list.d.ts +7 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-list.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-list.js +16 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-list.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-search.d.ts +18 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-search.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-search.js +87 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-search.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/properties-list.d.ts +7 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/properties-list.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/properties-list.js +19 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/properties-list.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-detail.d.ts +10 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-detail.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-detail.js +82 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-detail.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-listed.d.ts +12 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-listed.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-listed.js +32 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-listed.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-request.d.ts +15 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-request.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-request.js +11 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-request.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-search.d.ts +16 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-search.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-search.js +41 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-search.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/supplier.d.ts +13 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/supplier.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/supplier.js +49 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/supplier.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/team-availability.d.ts +7 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/team-availability.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/team-availability.js +19 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/team-availability.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/team-info.d.ts +5 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/team-info.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/team-info.js +32 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/team-info.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-create.d.ts +14 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-create.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-create.js +11 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-create.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-detail.d.ts +9 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-detail.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-detail.js +85 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-detail.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-search.d.ts +13 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-search.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-search.js +44 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-search.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-update.d.ts +14 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-update.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-update.js +18 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-update.js.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewings-list.d.ts +9 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewings-list.d.ts.map +1 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewings-list.js +25 -0
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewings-list.js.map +1 -0
- package/payload/server/chunk-32ZHQJNX.js +11395 -0
- package/payload/server/chunk-3RBKKDHC.js +783 -0
- package/payload/server/chunk-3VVHVJK2.js +11405 -0
- package/payload/server/chunk-5YIXIF6C.js +726 -0
- package/payload/server/chunk-B54KBAK4.js +72 -0
- package/payload/server/chunk-IAIGB5WN.js +11406 -0
- package/payload/server/chunk-LQ5GSMEW.js +12036 -0
- package/payload/server/chunk-O2FWENOD.js +11530 -0
- package/payload/server/chunk-PE76FPYP.js +12040 -0
- package/payload/server/chunk-Q6NDXCM6.js +11448 -0
- package/payload/server/chunk-U3W5YIXU.js +11450 -0
- package/payload/server/chunk-ZL2A4ROK.js +11416 -0
- package/payload/server/maxy-edge.js +1 -1
- package/payload/server/public/assets/{Checkbox-CDUmQ1Bu.js → Checkbox-CjbS9JcG.js} +1 -1
- package/payload/server/public/assets/{admin-picYWZfn.js → admin-Ce9DbUuu.js} +30 -30
- package/payload/server/public/assets/{data-yYbcrFrc.js → data-C-SxjLC9.js} +1 -1
- package/payload/server/public/assets/{file-CzLc4Rvq.js → file-D4cbAAuo.js} +1 -1
- package/payload/server/public/assets/{graph-BRzC0ZtS.js → graph-D-Rqh0Md.js} +1 -1
- package/payload/server/public/assets/{house-lM4gLKkH.js → house-CYsVygEQ.js} +1 -1
- package/payload/server/public/assets/jsx-runtime-DPXE45W9.css +1 -0
- package/payload/server/public/assets/{public-scZadgzt.js → public-BTOF98iO.js} +1 -1
- package/payload/server/public/assets/{share-2-CNdrRWue.js → share-2-B-sbkB36.js} +1 -1
- package/payload/server/public/assets/{useVoiceRecorder-D2kfoqVB.js → useVoiceRecorder-DLVFx3ms.js} +1 -1
- package/payload/server/public/assets/{x-CsDhB6Vr.js → x-BNidzSAn.js} +1 -1
- package/payload/server/public/data.html +6 -6
- package/payload/server/public/graph.html +7 -7
- package/payload/server/public/index.html +8 -8
- package/payload/server/public/public.html +5 -5
- package/payload/server/server.js +114 -54
- package/payload/server/upgrade-progress-server.js +83 -0
- package/payload/server/public/assets/jsx-runtime-I6ZqIGn8.css +0 -1
- /package/payload/server/public/assets/{jsx-runtime-BK2hplUC.js → jsx-runtime-BUs3sHtV.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ValidatorEnv } from "../lib/schema-validator.js";
|
|
2
2
|
import { type GraphRelationship, type CreatedBy } from "../../../../../lib/graph-write/dist/index.js";
|
|
3
3
|
interface WriteParams {
|
|
4
4
|
labels: string[];
|
|
@@ -15,11 +15,13 @@ interface WriteParams {
|
|
|
15
15
|
/** Provenance stamp — sourced from the MCP server env vars (agent/session). */
|
|
16
16
|
createdBy: CreatedBy;
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* Validator environment — markdown sidecar (`schema`) plus the live
|
|
19
|
+
* recognised-label source. Required; built once at server startup by
|
|
20
|
+
* index.ts and passed through on every call. The live source's
|
|
21
|
+
* recognised-label set is read fresh on each validation, so writes after
|
|
22
|
+
* a SchemaCache refresh see the new labels without re-wiring.
|
|
21
23
|
*/
|
|
22
|
-
|
|
24
|
+
validator: ValidatorEnv;
|
|
23
25
|
}
|
|
24
26
|
interface WriteResult {
|
|
25
27
|
nodeId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-write.d.ts","sourceRoot":"","sources":["../../src/tools/memory-write.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"memory-write.d.ts","sourceRoot":"","sources":["../../src/tools/memory-write.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE9E,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACf,MAAM,8CAA8C,CAAC;AAEtD,UAAU,WAAW;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6HAA6H;IAC7H,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,aAAa,EAAE,iBAAiB,EAAE,CAAC;IACnC,+EAA+E;IAC/E,SAAS,EAAE,SAAS,CAAC;IACrB;;;;;;OAMG;IACH,SAAS,EAAE,YAAY,CAAC;CACzB;AAED,UAAU,WAAW;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wBAAsB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,CA6H3E;AAED,wFAAwF;AACxF,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,GACd;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAKhD;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EAAE,EAChB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAClC,MAAM,CAUR"}
|
|
@@ -4,7 +4,7 @@ import { validateWrite } from "../lib/schema-validator.js";
|
|
|
4
4
|
import { checkGraphWriteGate } from "../lib/graph-write-gate.js";
|
|
5
5
|
import { writeNodeWithEdges, } from "../../../../../lib/graph-write/dist/index.js";
|
|
6
6
|
export async function memoryWrite(params) {
|
|
7
|
-
const { labels, properties, accountId, scope, relationships, createdBy,
|
|
7
|
+
const { labels, properties, accountId, scope, relationships, createdBy, validator } = params;
|
|
8
8
|
if (!scope) {
|
|
9
9
|
throw new Error("scope is required — valid values: 'public', 'shared', 'admin', 'user:{identifier}'");
|
|
10
10
|
}
|
|
@@ -13,7 +13,7 @@ export async function memoryWrite(params) {
|
|
|
13
13
|
// MCP tool handler can report a descriptive message to the agent and the
|
|
14
14
|
// operator can see the rejection in server.log.
|
|
15
15
|
try {
|
|
16
|
-
validateWrite({ labels, properties, accountId },
|
|
16
|
+
validateWrite({ labels, properties, accountId }, validator);
|
|
17
17
|
}
|
|
18
18
|
catch (err) {
|
|
19
19
|
console.error(`memory-write: schema validation rejected [${labels.join(", ")}] for account ${accountId ?? "<none>"}: ${err instanceof Error ? err.message : String(err)}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-write.js","sourceRoot":"","sources":["../../src/tools/memory-write.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAi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CAAC,EAAE,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -4,6 +4,8 @@ Universal node types shared across all business verticals. Load this reference b
|
|
|
4
4
|
|
|
5
5
|
When loading this reference, confirm which schema files were consulted by noting: "Using schema-base" (and the vertical file name, if loaded).
|
|
6
6
|
|
|
7
|
+
> **Role of this file (Task 736).** This file declares **property-shape rules** — required properties, naming conventions, and relationship patterns — for documented labels. It is **not** the label-existence gate. Label existence is established by the live `db.labels()` ∪ `schema.cypher` declarations. Platform-native labels (`LocalBusiness`, `AdminUser`, `Conversation`, `KnowledgeDocument`) live in `platform/neo4j/schema.cypher` and are accepted by the validator without a markdown row here; their property shape is the agent's responsibility until a row is added. A label appearing in this file is the agent's commitment that writes carry the listed required properties. A label absent from this file is not a write blocker.
|
|
8
|
+
|
|
7
9
|
---
|
|
8
10
|
|
|
9
11
|
## Node Types
|
|
@@ -34,6 +36,8 @@ When loading this reference, confirm which schema files were consulted by noting
|
|
|
34
36
|
|
|
35
37
|
**Branding properties on LocalBusiness:** `primaryColor`, `accentColor`, `backgroundColor`, `tagline` — optional, used to brand the public chat endpoint. Written via `memory-update` on the LocalBusiness node. Hex color values must match `#[0-9a-fA-F]{3,8}`. Logo and icon are linked via `HAS_BRAND_ASSET → ImageObject` with `purpose: "logo"` or `"icon"`.
|
|
36
38
|
|
|
39
|
+
**Personal-profile role on Person (Task 704):** the optional `role` property on a `Person` node carries the value `"admin-personal"` when the node is the operator's personal-profile bootstrap (onboarding step 9 personal/employee mode). The graph-write gate accepts `Person {role: "admin-personal"}` in lieu of a `LocalBusiness` so personal-mode users can complete onboarding without registering a business. Do not set `role: "admin-personal"` on customer or staff Person nodes — it's the personal-profile discriminator and only the bootstrap node should carry it.
|
|
40
|
+
|
|
37
41
|
**CreativeWork** covers long-form textual records written by the platform: session summaries (`session-compact`), workflow digests (e.g. public chat review), and skill definitions saved by `skill-builder`. The `title` is a short identifier; the `abstract` carries the full content that drives the embedding.
|
|
38
42
|
|
|
39
43
|
**DefinedTerm** covers reusable concepts, learnings, and glossary entries — e.g. project retrospective learnings (`name` is a short handle, `description` is the full learning). Additional properties like `category` are encouraged but not required.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import { initStderrTee } from "../../../../lib/mcp-stderr-tee/dist/index.js";
|
|
2
|
+
initStderrTee("loop");
|
|
3
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { keyRegister } from "./tools/key-register.js";
|
|
7
|
+
import { keyDeregister } from "./tools/key-deregister.js";
|
|
8
|
+
import { keyList } from "./tools/key-list.js";
|
|
9
|
+
import { propertySearch } from "./tools/property-search.js";
|
|
10
|
+
import { propertyDetail } from "./tools/property-detail.js";
|
|
11
|
+
import { propertyListed } from "./tools/property-listed.js";
|
|
12
|
+
import { propertyRequest } from "./tools/property-request.js";
|
|
13
|
+
import { peopleSearch } from "./tools/people-search.js";
|
|
14
|
+
import { peopleDetail } from "./tools/people-detail.js";
|
|
15
|
+
import { viewingSearch } from "./tools/viewing-search.js";
|
|
16
|
+
import { viewingDetail } from "./tools/viewing-detail.js";
|
|
17
|
+
import { viewingCreate } from "./tools/viewing-create.js";
|
|
18
|
+
import { viewingUpdate } from "./tools/viewing-update.js";
|
|
19
|
+
import { feedbackGet, feedbackSubmit } from "./tools/feedback.js";
|
|
20
|
+
import { teamInfo } from "./tools/team-info.js";
|
|
21
|
+
import { teamAvailability } from "./tools/team-availability.js";
|
|
22
|
+
import { marketingMatchDetail } from "./tools/marketing-match.js";
|
|
23
|
+
import { marketingMatchBatch } from "./tools/marketing-match-batch.js";
|
|
24
|
+
import { marketingMatchRequest } from "./tools/marketing-match-request.js";
|
|
25
|
+
import { marketingEnquiry } from "./tools/marketing-enquiry.js";
|
|
26
|
+
import { customerPreferences } from "./tools/customer-preferences.js";
|
|
27
|
+
import { supplier } from "./tools/supplier.js";
|
|
28
|
+
import { closeDriver } from "./lib/neo4j.js";
|
|
29
|
+
const accountId = process.env.ACCOUNT_ID;
|
|
30
|
+
if (!accountId) {
|
|
31
|
+
throw new Error("ACCOUNT_ID environment variable is required");
|
|
32
|
+
}
|
|
33
|
+
const server = new McpServer({
|
|
34
|
+
name: "maxy-real-agency-loop",
|
|
35
|
+
version: "0.2.0",
|
|
36
|
+
});
|
|
37
|
+
const ALL_PERMISSIONS = z.enum([
|
|
38
|
+
"properties", "people", "viewings", "feedback", "team",
|
|
39
|
+
"marketing", "customer", "supplier",
|
|
40
|
+
]);
|
|
41
|
+
console.error(`[loop] server started, account=${accountId}`);
|
|
42
|
+
// Helper: wrap a tool function in standard error handling
|
|
43
|
+
function toolHandler(fn) {
|
|
44
|
+
return async (params) => {
|
|
45
|
+
try {
|
|
46
|
+
const text = await fn({ ...params, accountId });
|
|
47
|
+
return { content: [{ type: "text", text }] };
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
return {
|
|
51
|
+
content: [{
|
|
52
|
+
type: "text",
|
|
53
|
+
text: `Error: ${err instanceof Error ? err.message : String(err)}`,
|
|
54
|
+
}],
|
|
55
|
+
isError: true,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
// ─────────────────────────────────────────────────────────────────
|
|
61
|
+
// Key Management Tools (3)
|
|
62
|
+
// ─────────────────────────────────────────────────────────────────
|
|
63
|
+
server.tool("loop-key-register", "Register a Loop CRM API key for a team. Validates the key against Loop's API, encrypts it, and stores it in the graph. Each key maps to one team.", {
|
|
64
|
+
teamName: z.string().min(1).describe("Human-readable name for this team (e.g. 'Muvin Main Office')"),
|
|
65
|
+
apiKey: z.string().min(10).describe("Loop API key (X-Api-Key header value)"),
|
|
66
|
+
permissions: z
|
|
67
|
+
.array(ALL_PERMISSIONS)
|
|
68
|
+
.optional()
|
|
69
|
+
.describe("Endpoint groups this key can access (default: all 8 groups)"),
|
|
70
|
+
}, async (params) => {
|
|
71
|
+
try {
|
|
72
|
+
const result = await keyRegister({ ...params, accountId });
|
|
73
|
+
let text = `Team "${params.teamName}" registered successfully.`;
|
|
74
|
+
if (result.warning)
|
|
75
|
+
text += `\n\nWarning: ${result.warning}`;
|
|
76
|
+
return { content: [{ type: "text", text }] };
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
return {
|
|
80
|
+
content: [{
|
|
81
|
+
type: "text",
|
|
82
|
+
text: `Failed to register key: ${err instanceof Error ? err.message : String(err)}`,
|
|
83
|
+
}],
|
|
84
|
+
isError: true,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
server.tool("loop-key-deregister", "Remove a registered Loop CRM team key. The key is permanently deleted from the graph.", { teamName: z.string().min(1).describe("Name of the team to remove") }, async ({ teamName }) => {
|
|
89
|
+
try {
|
|
90
|
+
await keyDeregister({ teamName, accountId });
|
|
91
|
+
return { content: [{ type: "text", text: `Team "${teamName}" deregistered.` }] };
|
|
92
|
+
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
return {
|
|
95
|
+
content: [{
|
|
96
|
+
type: "text",
|
|
97
|
+
text: `Failed to deregister: ${err instanceof Error ? err.message : String(err)}`,
|
|
98
|
+
}],
|
|
99
|
+
isError: true,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
server.tool("loop-key-list", "List all registered Loop CRM teams for this account. Shows team names, addresses, and permissions. Never reveals API key values.", {}, toolHandler(async (p) => keyList({ accountId: p.accountId })));
|
|
104
|
+
// ─────────────────────────────────────────────────────────────────
|
|
105
|
+
// People Tools (2) — permission: people
|
|
106
|
+
// ─────────────────────────────────────────────────────────────────
|
|
107
|
+
server.tool("loop-people-search", "Search people in Loop CRM. Without a role, searches all contacts. With a role (buyers/sellers/renters/landlords), returns role-specific results with rich filters.", {
|
|
108
|
+
role: z.enum(["buyers", "sellers", "renters", "landlords"]).optional().describe("Role to search (omit for all people)"),
|
|
109
|
+
searchTerm: z.string().optional().describe("Name or contact search"),
|
|
110
|
+
maxPrice: z.number().optional().describe("Max price (buyers) or max price filter (sellers)"),
|
|
111
|
+
minPrice: z.number().optional().describe("Min price (sellers)"),
|
|
112
|
+
minBeds: z.number().optional().describe("Min bedrooms (buyers/renters)"),
|
|
113
|
+
maxRent: z.number().optional().describe("Max rent (renters only)"),
|
|
114
|
+
searchAreas: z.string().optional().describe("Comma-separated outcodes e.g. 'SN7,OX12' (buyers/renters)"),
|
|
115
|
+
propertyTypes: z.string().optional().describe("Comma-separated property types (buyers/renters)"),
|
|
116
|
+
startDate: z.string().optional().describe("Start date filter (sellers/landlords)"),
|
|
117
|
+
endDate: z.string().optional().describe("End date filter (sellers/landlords)"),
|
|
118
|
+
teamName: z.string().optional().describe("Query a specific team only"),
|
|
119
|
+
limit: z.number().int().optional().describe("Max results (default 200)"),
|
|
120
|
+
}, toolHandler(async (p) => peopleSearch(p)));
|
|
121
|
+
server.tool("loop-people-detail", "Get full details for a specific person by ID. Optionally specify a role (buyers/sellers/renters/landlords) for role-specific detail.", {
|
|
122
|
+
personId: z.number().int().describe("Person ID"),
|
|
123
|
+
role: z.enum(["buyers", "sellers", "renters", "landlords"]).optional().describe("Role for role-specific detail view"),
|
|
124
|
+
teamName: z.string().optional().describe("Query a specific team only"),
|
|
125
|
+
}, toolHandler(async (p) => peopleDetail(p)));
|
|
126
|
+
// ─────────────────────────────────────────────────────────────────
|
|
127
|
+
// Property Tools (4) — permission: properties
|
|
128
|
+
// ─────────────────────────────────────────────────────────────────
|
|
129
|
+
server.tool("loop-property-search", "Search properties in Loop CRM. Queries /property/residential/sales and /property/residential/lettings. Use department to narrow to one type.", {
|
|
130
|
+
department: z.enum(["sales", "lettings", "both"]).optional().describe("Department (default: both)"),
|
|
131
|
+
searchTerm: z.string().optional().describe("Address or keyword search"),
|
|
132
|
+
minPrice: z.number().optional().describe("Minimum price"),
|
|
133
|
+
maxPrice: z.number().optional().describe("Maximum price"),
|
|
134
|
+
minBedrooms: z.number().int().optional().describe("Minimum bedrooms"),
|
|
135
|
+
maxBedrooms: z.number().int().optional().describe("Maximum bedrooms"),
|
|
136
|
+
propertyStatuses: z.string().optional().describe("Comma-separated statuses (e.g. 'forSale,underOffer')"),
|
|
137
|
+
propertyTypes: z.string().optional().describe("Comma-separated property types"),
|
|
138
|
+
teamName: z.string().optional().describe("Query a specific team only"),
|
|
139
|
+
limit: z.number().int().optional().describe("Max results (default 200)"),
|
|
140
|
+
}, toolHandler(async (p) => propertySearch(p)));
|
|
141
|
+
server.tool("loop-property-detail", "Get full details for a specific property by ID and department. Optionally include a preview hash for the public preview.", {
|
|
142
|
+
propertyId: z.number().int().describe("Property ID"),
|
|
143
|
+
department: z.enum(["sales", "lettings"]).describe("sales or lettings"),
|
|
144
|
+
previewHash: z.number().int().optional().describe("Preview hash for public preview URL"),
|
|
145
|
+
teamName: z.string().optional().describe("Query a specific team only"),
|
|
146
|
+
}, toolHandler(async (p) => propertyDetail(p)));
|
|
147
|
+
server.tool("loop-property-listed", "Get properties listed on a specific channel (Rightmove, Zoopla, OnTheMarket, website). Optionally include sold properties.", {
|
|
148
|
+
channel: z.enum(["rightmove", "onTheMarket", "zoopla", "website"]).describe("Listing channel"),
|
|
149
|
+
department: z.enum(["sales", "lettings", "both"]).optional().describe("Department (default: both)"),
|
|
150
|
+
includeSold: z.boolean().optional().describe("Include sold gallery (default: false)"),
|
|
151
|
+
teamName: z.string().optional().describe("Query a specific team only"),
|
|
152
|
+
limit: z.number().int().optional().describe("Max results (default 200)"),
|
|
153
|
+
}, toolHandler(async (p) => propertyListed(p)));
|
|
154
|
+
server.tool("loop-property-request", "Submit a viewing, callback, or information request for a property. Requires a specific team.", {
|
|
155
|
+
teamName: z.string().min(1).describe("Team to submit the request through"),
|
|
156
|
+
propertyId: z.number().int().describe("Property ID"),
|
|
157
|
+
department: z.enum(["sales", "lettings"]).describe("sales or lettings"),
|
|
158
|
+
action: z.enum(["viewing", "call-back", "information"]).describe("Request type"),
|
|
159
|
+
name: z.string().optional().describe("Requester name"),
|
|
160
|
+
email: z.string().optional().describe("Requester email"),
|
|
161
|
+
phone: z.string().optional().describe("Requester phone"),
|
|
162
|
+
message: z.string().optional().describe("Additional message"),
|
|
163
|
+
}, toolHandler(async (p) => propertyRequest(p)));
|
|
164
|
+
// ─────────────────────────────────────────────────────────────────
|
|
165
|
+
// Viewing Tools (4) — permission: viewings
|
|
166
|
+
// ─────────────────────────────────────────────────────────────────
|
|
167
|
+
server.tool("loop-viewing-search", "Search viewings in Loop CRM. Queries /residential/sales/viewings and /residential/lettings/viewings.", {
|
|
168
|
+
department: z.enum(["sales", "lettings", "both"]).optional().describe("Department (default: both)"),
|
|
169
|
+
searchTerm: z.string().optional().describe("Search viewings"),
|
|
170
|
+
appointmentStartDate: z.string().optional().describe("Filter from date (ISO format)"),
|
|
171
|
+
appointmentEndDate: z.string().optional().describe("Filter to date (ISO format)"),
|
|
172
|
+
status: z.string().optional().describe("Viewing status filter"),
|
|
173
|
+
teamName: z.string().optional().describe("Query a specific team only"),
|
|
174
|
+
limit: z.number().int().optional().describe("Max results (default 200)"),
|
|
175
|
+
}, toolHandler(async (p) => viewingSearch(p)));
|
|
176
|
+
server.tool("loop-viewing-detail", "Get full details for a specific viewing by ID and department.", {
|
|
177
|
+
viewingId: z.number().int().describe("Viewing ID"),
|
|
178
|
+
department: z.enum(["sales", "lettings"]).describe("sales or lettings"),
|
|
179
|
+
teamName: z.string().optional().describe("Query a specific team only"),
|
|
180
|
+
}, toolHandler(async (p) => viewingDetail(p)));
|
|
181
|
+
server.tool("loop-viewing-create", "Create a new viewing in Loop CRM. Creates the viewing and associated buyer/renter record.", {
|
|
182
|
+
teamName: z.string().min(1).describe("Team to create the viewing for"),
|
|
183
|
+
department: z.enum(["sales", "lettings"]).describe("sales or lettings"),
|
|
184
|
+
propertyId: z.number().int().describe("Property ID"),
|
|
185
|
+
date: z.string().describe("Viewing date (YYYY-MM-DD)"),
|
|
186
|
+
time: z.string().describe("Viewing time (HH:mm)"),
|
|
187
|
+
attendeeName: z.string().describe("Attendee full name"),
|
|
188
|
+
attendeeEmail: z.string().optional().describe("Attendee email"),
|
|
189
|
+
attendeePhone: z.string().optional().describe("Attendee phone"),
|
|
190
|
+
}, toolHandler(async (p) => viewingCreate(p)));
|
|
191
|
+
server.tool("loop-viewing-update", "Add a note or record feedback for a viewing. For feedback, specify the party: buyer/seller (sales) or renter/landlord (lettings).", {
|
|
192
|
+
teamName: z.string().min(1).describe("Team that owns the viewing"),
|
|
193
|
+
viewingId: z.number().int().describe("Viewing ID"),
|
|
194
|
+
department: z.enum(["sales", "lettings"]).describe("sales or lettings"),
|
|
195
|
+
action: z.enum(["note", "feedback"]).describe("note or feedback"),
|
|
196
|
+
text: z.string().describe("Note text or feedback content"),
|
|
197
|
+
feedbackParty: z.enum(["buyer", "seller", "renter", "landlord"]).optional().describe("Required for feedback: whose feedback"),
|
|
198
|
+
}, toolHandler(async (p) => viewingUpdate(p)));
|
|
199
|
+
// ─────────────────────────────────────────────────────────────────
|
|
200
|
+
// Feedback Tools (2) — permission: feedback
|
|
201
|
+
// ─────────────────────────────────────────────────────────────────
|
|
202
|
+
server.tool("loop-feedback-get", "Get feedback for a specific viewing. Reads from /feedback/residential/{department}/viewings/{id}.", {
|
|
203
|
+
teamName: z.string().min(1).describe("Team that owns the viewing"),
|
|
204
|
+
viewingId: z.number().int().describe("Viewing ID"),
|
|
205
|
+
department: z.enum(["sales", "lettings"]).describe("sales or lettings"),
|
|
206
|
+
}, toolHandler(async (p) => feedbackGet(p)));
|
|
207
|
+
server.tool("loop-feedback-submit", "Submit feedback for a viewing. Writes to /feedback/residential/{department}/viewings/{id}/feedback.", {
|
|
208
|
+
teamName: z.string().min(1).describe("Team that owns the viewing"),
|
|
209
|
+
viewingId: z.number().int().describe("Viewing ID"),
|
|
210
|
+
department: z.enum(["sales", "lettings"]).describe("sales or lettings"),
|
|
211
|
+
feedback: z.string().describe("Feedback text"),
|
|
212
|
+
}, toolHandler(async (p) => feedbackSubmit(p)));
|
|
213
|
+
// ─────────────────────────────────────────────────────────────────
|
|
214
|
+
// Team Tools (2) — permission: team
|
|
215
|
+
// ─────────────────────────────────────────────────────────────────
|
|
216
|
+
server.tool("loop-team-info", "Get team details from Loop CRM. Returns team name, address, phone, and email.", {
|
|
217
|
+
teamName: z.string().optional().describe("Query a specific team only (omit for all teams)"),
|
|
218
|
+
}, toolHandler(async (p) => teamInfo(p)));
|
|
219
|
+
server.tool("loop-team-availability", "Get available time slots for a specific agent on a given date.", {
|
|
220
|
+
agentId: z.string().describe("Agent GUID identifier"),
|
|
221
|
+
searchDate: z.string().describe("Date to check availability (YYYY-MM-DD)"),
|
|
222
|
+
teamName: z.string().optional().describe("Query a specific team only"),
|
|
223
|
+
}, toolHandler(async (p) => teamAvailability(p)));
|
|
224
|
+
// ─────────────────────────────────────────────────────────────────
|
|
225
|
+
// Marketing Tools (4) — permission: marketing
|
|
226
|
+
// ─────────────────────────────────────────────────────────────────
|
|
227
|
+
server.tool("loop-marketing-match", "Get matching property detail and optionally the team profile for that match.", {
|
|
228
|
+
propertyId: z.number().int().describe("Property ID"),
|
|
229
|
+
department: z.enum(["sales", "lettings"]).describe("sales or lettings"),
|
|
230
|
+
includeTeamProfile: z.boolean().optional().describe("Include the team profile for this match (default: false)"),
|
|
231
|
+
teamName: z.string().optional().describe("Query a specific team only"),
|
|
232
|
+
}, toolHandler(async (p) => marketingMatchDetail(p)));
|
|
233
|
+
server.tool("loop-marketing-match-batch", "Get batch matching results for multiple property IDs.", {
|
|
234
|
+
propertyIds: z.array(z.number().int()).describe("Array of property IDs to match"),
|
|
235
|
+
department: z.enum(["sales", "lettings"]).describe("sales or lettings"),
|
|
236
|
+
teamName: z.string().optional().describe("Query a specific team only"),
|
|
237
|
+
}, toolHandler(async (p) => marketingMatchBatch(p)));
|
|
238
|
+
server.tool("loop-marketing-match-request", "Submit a viewing, information, or callback request for a matching property.", {
|
|
239
|
+
teamName: z.string().min(1).describe("Team to submit the request through"),
|
|
240
|
+
propertyId: z.number().int().describe("Matching property ID"),
|
|
241
|
+
department: z.enum(["sales", "lettings"]).describe("sales or lettings"),
|
|
242
|
+
action: z.enum(["viewing", "information", "callback"]).describe("Request type"),
|
|
243
|
+
name: z.string().optional().describe("Requester name"),
|
|
244
|
+
email: z.string().optional().describe("Requester email"),
|
|
245
|
+
phone: z.string().optional().describe("Requester phone"),
|
|
246
|
+
message: z.string().optional().describe("Additional message"),
|
|
247
|
+
}, toolHandler(async (p) => marketingMatchRequest(p)));
|
|
248
|
+
server.tool("loop-marketing-enquiry", "Marketing enquiry operations: submit seller enquiries, manage auto-responder interactions.", {
|
|
249
|
+
teamName: z.string().min(1).describe("Team to submit through"),
|
|
250
|
+
action: z.enum([
|
|
251
|
+
"seller-enquiry", "autoresponder-get", "autoresponder-answers",
|
|
252
|
+
"autoresponder-details", "autoresponder-refer",
|
|
253
|
+
]).describe("Enquiry action"),
|
|
254
|
+
sellerEnquiryData: z.record(z.string(), z.unknown()).optional().describe("Seller enquiry request body (for seller-enquiry)"),
|
|
255
|
+
autoResponderId: z.number().int().optional().describe("Auto-responder enquiry ID"),
|
|
256
|
+
autoResponderKey: z.string().optional().describe("Auto-responder key (UUID)"),
|
|
257
|
+
answers: z.array(z.unknown()).optional().describe("Auto-responder answers array"),
|
|
258
|
+
details: z.record(z.string(), z.unknown()).optional().describe("Auto-responder details object"),
|
|
259
|
+
}, toolHandler(async (p) => marketingEnquiry(p)));
|
|
260
|
+
// ─────────────────────────────────────────────────────────────────
|
|
261
|
+
// Customer Tools (1) — permission: customer
|
|
262
|
+
// ─────────────────────────────────────────────────────────────────
|
|
263
|
+
server.tool("loop-customer-preferences", "Read or write customer preferences for a person. Action 'read' returns current preferences, 'write' updates them.", {
|
|
264
|
+
teamName: z.string().min(1).describe("Team for this operation"),
|
|
265
|
+
personCode: z.number().int().describe("Person code (ID)"),
|
|
266
|
+
action: z.enum(["read", "write"]).describe("read or write"),
|
|
267
|
+
preferences: z.record(z.string(), z.unknown()).optional().describe("Preferences object (required for write)"),
|
|
268
|
+
}, toolHandler(async (p) => customerPreferences(p)));
|
|
269
|
+
// ─────────────────────────────────────────────────────────────────
|
|
270
|
+
// Supplier Tools (1) — permission: supplier
|
|
271
|
+
// ─────────────────────────────────────────────────────────────────
|
|
272
|
+
server.tool("loop-supplier", "Supplier operations: maintenance jobs, quotes, board contractor jobs. Supports listing, completing, and quoting.", {
|
|
273
|
+
teamName: z.string().min(1).describe("Team for this operation"),
|
|
274
|
+
action: z.enum([
|
|
275
|
+
"maintenance-jobs", "maintenance-complete", "maintenance-quotes",
|
|
276
|
+
"maintenance-submit-quote", "board-jobs", "board-complete",
|
|
277
|
+
]).describe("Supplier action"),
|
|
278
|
+
code: z.string().describe("Unique code assigned to the contractor"),
|
|
279
|
+
jobId: z.number().int().optional().describe("Job ID (required for all actions except maintenance-submit-quote)"),
|
|
280
|
+
quoteId: z.number().int().optional().describe("Quote ID (for maintenance-submit-quote)"),
|
|
281
|
+
quoteData: z.record(z.string(), z.unknown()).optional().describe("Quote data (for maintenance-submit-quote)"),
|
|
282
|
+
completionData: z.record(z.string(), z.unknown()).optional().describe("Completion data (for board-complete)"),
|
|
283
|
+
}, toolHandler(async (p) => supplier(p)));
|
|
284
|
+
// ─────────────────────────────────────────────────────────────────
|
|
285
|
+
// Lifecycle
|
|
286
|
+
// ─────────────────────────────────────────────────────────────────
|
|
287
|
+
process.on("SIGINT", async () => {
|
|
288
|
+
await closeDriver();
|
|
289
|
+
process.exit(0);
|
|
290
|
+
});
|
|
291
|
+
const transport = new StdioServerTransport();
|
|
292
|
+
await server.connect(transport);
|
|
293
|
+
//# sourceMappingURL=index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,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2CAA2C,CAAC;IAC7G,cAAc,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;CAC9G,EACD,WAAW,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAmC,CAAC,CAAC,CACxE,CAAC;AAEF,oEAAoE;AACpE,YAAY;AACZ,oEAAoE;AAEpE,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC9B,MAAM,WAAW,EAAE,CAAC;IACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Encrypt a plaintext string. Returns "iv:ciphertext:authTag" (hex-encoded).
|
|
3
|
+
*/
|
|
4
|
+
export declare function encrypt(plaintext: string): string;
|
|
5
|
+
/**
|
|
6
|
+
* Decrypt a value produced by encrypt(). Expects "iv:ciphertext:authTag" (hex-encoded).
|
|
7
|
+
* Throws on tampered/corrupt data or wrong key.
|
|
8
|
+
*/
|
|
9
|
+
export declare function decrypt(encryptedValue: string): string;
|
|
10
|
+
//# sourceMappingURL=crypto.d.ts.map
|
package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/crypto.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/lib/crypto.ts"],"names":[],"mappings":"AA0DA;;GAEG;AACH,wBAAgB,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAUjD;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CA2BtD"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { randomBytes, createCipheriv, createDecipheriv } from "node:crypto";
|
|
2
|
+
import { readFileSync, writeFileSync, existsSync } from "node:fs";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import { homedir } from "node:os";
|
|
5
|
+
const ALGORITHM = "aes-256-gcm";
|
|
6
|
+
const KEY_LENGTH = 32; // 256 bits
|
|
7
|
+
const IV_LENGTH = 12; // 96 bits — recommended for GCM
|
|
8
|
+
const AUTH_TAG_LENGTH = 16; // 128 bits
|
|
9
|
+
/**
|
|
10
|
+
* Resolve the config directory from brand.json (same pattern as anthropic-key, email).
|
|
11
|
+
* Falls back to ".maxy" if brand.json is unreadable.
|
|
12
|
+
*/
|
|
13
|
+
function resolveConfigDir() {
|
|
14
|
+
try {
|
|
15
|
+
const platformRoot = process.env.PLATFORM_ROOT;
|
|
16
|
+
if (platformRoot) {
|
|
17
|
+
const brandPath = resolve(platformRoot, "config/brand.json");
|
|
18
|
+
const brand = JSON.parse(readFileSync(brandPath, "utf-8"));
|
|
19
|
+
if (brand.configDir)
|
|
20
|
+
return brand.configDir;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
// Fall back to default
|
|
25
|
+
}
|
|
26
|
+
return ".maxy";
|
|
27
|
+
}
|
|
28
|
+
function keyFilePath() {
|
|
29
|
+
return resolve(homedir(), resolveConfigDir(), ".loop-encryption-key");
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Load or generate the encryption key. Generated on first use,
|
|
33
|
+
* stored at ~/.{configDir}/.loop-encryption-key with mode 0o600.
|
|
34
|
+
*/
|
|
35
|
+
function loadOrGenerateKey() {
|
|
36
|
+
const path = keyFilePath();
|
|
37
|
+
if (existsSync(path)) {
|
|
38
|
+
const hex = readFileSync(path, "utf-8").trim();
|
|
39
|
+
const buf = Buffer.from(hex, "hex");
|
|
40
|
+
if (buf.length !== KEY_LENGTH) {
|
|
41
|
+
throw new Error(`Encryption key at ${path} is ${buf.length} bytes, expected ${KEY_LENGTH}. ` +
|
|
42
|
+
`Delete the file and re-register all Loop team keys.`);
|
|
43
|
+
}
|
|
44
|
+
return buf;
|
|
45
|
+
}
|
|
46
|
+
// First use — generate a new key
|
|
47
|
+
const key = randomBytes(KEY_LENGTH);
|
|
48
|
+
writeFileSync(path, key.toString("hex"), { mode: 0o600 });
|
|
49
|
+
console.error(`[loop] encryption key generated at ${path}`);
|
|
50
|
+
return key;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Encrypt a plaintext string. Returns "iv:ciphertext:authTag" (hex-encoded).
|
|
54
|
+
*/
|
|
55
|
+
export function encrypt(plaintext) {
|
|
56
|
+
const key = loadOrGenerateKey();
|
|
57
|
+
const iv = randomBytes(IV_LENGTH);
|
|
58
|
+
const cipher = createCipheriv(ALGORITHM, key, iv, { authTagLength: AUTH_TAG_LENGTH });
|
|
59
|
+
let encrypted = cipher.update(plaintext, "utf-8", "hex");
|
|
60
|
+
encrypted += cipher.final("hex");
|
|
61
|
+
const authTag = cipher.getAuthTag().toString("hex");
|
|
62
|
+
return `${iv.toString("hex")}:${encrypted}:${authTag}`;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Decrypt a value produced by encrypt(). Expects "iv:ciphertext:authTag" (hex-encoded).
|
|
66
|
+
* Throws on tampered/corrupt data or wrong key.
|
|
67
|
+
*/
|
|
68
|
+
export function decrypt(encryptedValue) {
|
|
69
|
+
const parts = encryptedValue.split(":");
|
|
70
|
+
if (parts.length !== 3) {
|
|
71
|
+
throw new Error("Malformed encrypted value — expected iv:ciphertext:authTag");
|
|
72
|
+
}
|
|
73
|
+
const [ivHex, ciphertextHex, authTagHex] = parts;
|
|
74
|
+
const path = keyFilePath();
|
|
75
|
+
if (!existsSync(path)) {
|
|
76
|
+
throw new Error(`Encryption key not found at ${path}. ` +
|
|
77
|
+
`All stored Loop API keys are unrecoverable. Re-register keys.`);
|
|
78
|
+
}
|
|
79
|
+
const key = loadOrGenerateKey();
|
|
80
|
+
const iv = Buffer.from(ivHex, "hex");
|
|
81
|
+
const authTag = Buffer.from(authTagHex, "hex");
|
|
82
|
+
const decipher = createDecipheriv(ALGORITHM, key, iv, { authTagLength: AUTH_TAG_LENGTH });
|
|
83
|
+
decipher.setAuthTag(authTag);
|
|
84
|
+
let decrypted = decipher.update(ciphertextHex, "hex", "utf-8");
|
|
85
|
+
decrypted += decipher.final("utf-8");
|
|
86
|
+
return decrypted;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=crypto.js.map
|
package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/crypto.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src/lib/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,MAAM,SAAS,GAAG,aAAa,CAAC;AAChC,MAAM,UAAU,GAAG,EAAE,CAAC,CAAC,WAAW;AAClC,MAAM,SAAS,GAAG,EAAE,CAAC,CAAC,gCAAgC;AACtD,MAAM,eAAe,GAAG,EAAE,CAAC,CAAC,WAAW;AAEvC;;;GAGG;AACH,SAAS,gBAAgB;IACvB,IAAI,CAAC;QACH,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;QAC/C,IAAI,YAAY,EAAE,CAAC;YACjB,MAAM,SAAS,GAAG,OAAO,CA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