@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
package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/loop-api.d.ts
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export interface LoopTeamKey {
|
|
2
|
+
teamName: string;
|
|
3
|
+
encryptedKey: string;
|
|
4
|
+
teamAddress: string;
|
|
5
|
+
agentId: string;
|
|
6
|
+
permissions: string[];
|
|
7
|
+
createdAt: string;
|
|
8
|
+
updatedAt: string;
|
|
9
|
+
}
|
|
10
|
+
export interface TeamResult<T> {
|
|
11
|
+
teamName: string;
|
|
12
|
+
data: T[];
|
|
13
|
+
}
|
|
14
|
+
export interface AggregationResult<T> {
|
|
15
|
+
results: TeamResult<T>[];
|
|
16
|
+
failures: {
|
|
17
|
+
teamName: string;
|
|
18
|
+
reason: string;
|
|
19
|
+
}[];
|
|
20
|
+
skipped: {
|
|
21
|
+
teamName: string;
|
|
22
|
+
reason: string;
|
|
23
|
+
}[];
|
|
24
|
+
totalTeams: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Load all LoopTeamKey nodes for an account from Neo4j.
|
|
28
|
+
*/
|
|
29
|
+
export declare function loadTeamKeys(accountId: string): Promise<LoopTeamKey[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Make a GET request to the Loop API V2.
|
|
32
|
+
*/
|
|
33
|
+
export declare function loopGet<T>(apiKey: string, path: string, toolName: string, teamName: string): Promise<T>;
|
|
34
|
+
/**
|
|
35
|
+
* Make a POST request to the Loop API V2.
|
|
36
|
+
* For write operations: create viewings, record feedback, submit enquiries, etc.
|
|
37
|
+
* Returns parsed JSON response. Treats 204 as success with empty result.
|
|
38
|
+
*/
|
|
39
|
+
export declare function loopPost<T>(apiKey: string, path: string, body: unknown, toolName: string, teamName: string): Promise<T>;
|
|
40
|
+
/**
|
|
41
|
+
* Make a PUT request to the Loop API V2.
|
|
42
|
+
* For update operations: batch matching, submit quotes, update preferences, etc.
|
|
43
|
+
*/
|
|
44
|
+
export declare function loopPut<T>(apiKey: string, path: string, body: unknown, toolName: string, teamName: string): Promise<T>;
|
|
45
|
+
export declare class LoopApiError extends Error {
|
|
46
|
+
readonly status: number;
|
|
47
|
+
readonly teamName: string;
|
|
48
|
+
readonly path: string;
|
|
49
|
+
readonly responseBody?: string | undefined;
|
|
50
|
+
constructor(status: number, teamName: string, path: string, responseBody?: string | undefined);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Fan out a request across all registered teams for an account, merging results.
|
|
54
|
+
*
|
|
55
|
+
* Each tool provides a `buildRequest` function that takes a decrypted API key
|
|
56
|
+
* and returns the data for that team. The aggregation engine handles:
|
|
57
|
+
* - Key loading and decryption
|
|
58
|
+
* - Permission checking
|
|
59
|
+
* - Concurrent fan-out via Promise.allSettled
|
|
60
|
+
* - Result merging with teamName tags
|
|
61
|
+
* - Aggregate logging
|
|
62
|
+
*
|
|
63
|
+
* When `teamName` is provided, only that team is queried (no fan-out).
|
|
64
|
+
*/
|
|
65
|
+
export declare function aggregateAcrossTeams<T>(accountId: string, endpointGroup: string, toolName: string, buildRequest: (apiKey: string, teamName: string) => Promise<T[]>, options?: {
|
|
66
|
+
teamName?: string;
|
|
67
|
+
limitPerTeam?: number;
|
|
68
|
+
limitTotal?: number;
|
|
69
|
+
}): Promise<AggregationResult<T>>;
|
|
70
|
+
/**
|
|
71
|
+
* Resolve a single team's API key with permission checking.
|
|
72
|
+
* Handles key loading, decryption, and permission validation.
|
|
73
|
+
* Used for both reads and writes that target a specific team — no fan-out.
|
|
74
|
+
*/
|
|
75
|
+
export declare function withTeamKey<T>(accountId: string, teamName: string, endpointGroup: string, toolName: string, execute: (apiKey: string) => Promise<T>): Promise<T>;
|
|
76
|
+
/**
|
|
77
|
+
* Format an aggregation result into a human-readable text response.
|
|
78
|
+
*/
|
|
79
|
+
export declare function formatAggregationResult<T>(result: AggregationResult<T>, formatItem: (item: T, teamName: string) => string, entityName: string): string;
|
|
80
|
+
//# sourceMappingURL=loop-api.d.ts.map
|
package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/loop-api.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loop-api.d.ts","sourceRoot":"","sources":["../../src/lib/loop-api.ts"],"names":[],"mappings":"AA8EA,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACj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R"}
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
import { getSession } from "./neo4j.js";
|
|
2
|
+
import { decrypt } from "./crypto.js";
|
|
3
|
+
// ─────────────────────────────────────────────────────────────────
|
|
4
|
+
// Loop API V2 HTTP Client + Cross-Team Aggregation Engine
|
|
5
|
+
//
|
|
6
|
+
// ┌─ Load LoopTeamKey nodes (Neo4j) ─┐
|
|
7
|
+
// │ │
|
|
8
|
+
// ▼ │
|
|
9
|
+
// For each key: │
|
|
10
|
+
// 1. Decrypt API key │
|
|
11
|
+
// 2. Check permissions │
|
|
12
|
+
// 3. HTTP GET/POST/PUT → Loop API V2 │
|
|
13
|
+
// │ │
|
|
14
|
+
// ▼ │
|
|
15
|
+
// Promise.allSettled → merge results │
|
|
16
|
+
// Log aggregate summary │
|
|
17
|
+
// ─────────────────────────────────────────────────────────────────
|
|
18
|
+
const LOOP_BASE_URL = "https://api.loop.software";
|
|
19
|
+
const REQUEST_TIMEOUT_MS = 10_000;
|
|
20
|
+
const DEFAULT_LIMIT_PER_TEAM = 50;
|
|
21
|
+
const DEFAULT_LIMIT_TOTAL = 200;
|
|
22
|
+
function isEnvelope(val) {
|
|
23
|
+
return (val !== null &&
|
|
24
|
+
typeof val === "object" &&
|
|
25
|
+
!Array.isArray(val) &&
|
|
26
|
+
"statusCode" in val &&
|
|
27
|
+
"httpResponseCode" in val &&
|
|
28
|
+
"data" in val);
|
|
29
|
+
}
|
|
30
|
+
function unwrapEnvelope(parsed, toolName, teamName) {
|
|
31
|
+
if (!isEnvelope(parsed)) {
|
|
32
|
+
return parsed;
|
|
33
|
+
}
|
|
34
|
+
if (parsed.statusCode !== "success") {
|
|
35
|
+
const errMsg = parsed.errors?.length
|
|
36
|
+
? parsed.errors.join("; ")
|
|
37
|
+
: `statusCode=${parsed.statusCode}`;
|
|
38
|
+
throw new Error(`Loop API error for team=${teamName} tool=${toolName}: ${errMsg} (httpResponseCode=${parsed.httpResponseCode})`);
|
|
39
|
+
}
|
|
40
|
+
if (parsed.warnings?.length) {
|
|
41
|
+
console.error(`[loop] ${toolName} team=${teamName} warnings: ${parsed.warnings.join("; ")}`);
|
|
42
|
+
}
|
|
43
|
+
return parsed.data;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Load all LoopTeamKey nodes for an account from Neo4j.
|
|
47
|
+
*/
|
|
48
|
+
export async function loadTeamKeys(accountId) {
|
|
49
|
+
const session = getSession();
|
|
50
|
+
try {
|
|
51
|
+
const result = await session.run(`MATCH (k:LoopTeamKey {accountId: $accountId})
|
|
52
|
+
RETURN k.teamName AS teamName, k.encryptedKey AS encryptedKey,
|
|
53
|
+
k.teamAddress AS teamAddress, k.agentId AS agentId,
|
|
54
|
+
k.permissions AS permissions, k.createdAt AS createdAt,
|
|
55
|
+
k.updatedAt AS updatedAt
|
|
56
|
+
ORDER BY k.teamName`, { accountId });
|
|
57
|
+
return result.records.map((r) => ({
|
|
58
|
+
teamName: r.get("teamName"),
|
|
59
|
+
encryptedKey: r.get("encryptedKey"),
|
|
60
|
+
teamAddress: r.get("teamAddress") ?? "",
|
|
61
|
+
agentId: r.get("agentId") ?? "",
|
|
62
|
+
permissions: r.get("permissions") ?? [],
|
|
63
|
+
createdAt: r.get("createdAt") ?? "",
|
|
64
|
+
updatedAt: r.get("updatedAt") ?? "",
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
finally {
|
|
68
|
+
await session.close();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Make a GET request to the Loop API V2.
|
|
73
|
+
*/
|
|
74
|
+
export async function loopGet(apiKey, path, toolName, teamName) {
|
|
75
|
+
const url = `${LOOP_BASE_URL}${path}`;
|
|
76
|
+
const start = Date.now();
|
|
77
|
+
const response = await fetch(url, {
|
|
78
|
+
headers: { "X-Api-Key": apiKey, "Accept": "application/json" },
|
|
79
|
+
signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
|
|
80
|
+
});
|
|
81
|
+
const duration = Date.now() - start;
|
|
82
|
+
console.error(`[loop] ${toolName} team=${teamName} endpoint=GET ${path} status=${response.status} duration=${duration}ms`);
|
|
83
|
+
if (response.status === 204) {
|
|
84
|
+
return [];
|
|
85
|
+
}
|
|
86
|
+
if (!response.ok) {
|
|
87
|
+
throw new LoopApiError(response.status, teamName, path);
|
|
88
|
+
}
|
|
89
|
+
const text = await response.text();
|
|
90
|
+
try {
|
|
91
|
+
const parsed = JSON.parse(text);
|
|
92
|
+
return unwrapEnvelope(parsed, toolName, teamName);
|
|
93
|
+
}
|
|
94
|
+
catch (err) {
|
|
95
|
+
if (err instanceof SyntaxError) {
|
|
96
|
+
throw new Error(`Loop returned non-JSON response for team=${teamName} path=${path} ` +
|
|
97
|
+
`(status=${response.status}, length=${text.length})`);
|
|
98
|
+
}
|
|
99
|
+
throw err;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Make a POST request to the Loop API V2.
|
|
104
|
+
* For write operations: create viewings, record feedback, submit enquiries, etc.
|
|
105
|
+
* Returns parsed JSON response. Treats 204 as success with empty result.
|
|
106
|
+
*/
|
|
107
|
+
export async function loopPost(apiKey, path, body, toolName, teamName) {
|
|
108
|
+
const url = `${LOOP_BASE_URL}${path}`;
|
|
109
|
+
const start = Date.now();
|
|
110
|
+
const response = await fetch(url, {
|
|
111
|
+
method: "POST",
|
|
112
|
+
headers: {
|
|
113
|
+
"X-Api-Key": apiKey,
|
|
114
|
+
"Accept": "application/json",
|
|
115
|
+
"Content-Type": "application/json",
|
|
116
|
+
},
|
|
117
|
+
body: JSON.stringify(body),
|
|
118
|
+
signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
|
|
119
|
+
});
|
|
120
|
+
const duration = Date.now() - start;
|
|
121
|
+
console.error(`[loop] WRITE ${toolName} team=${teamName} endpoint=POST ${path} status=${response.status} duration=${duration}ms`);
|
|
122
|
+
if (response.status === 204) {
|
|
123
|
+
return { success: true };
|
|
124
|
+
}
|
|
125
|
+
if (!response.ok) {
|
|
126
|
+
const errorBody = await response.text().catch(() => "");
|
|
127
|
+
throw new LoopApiError(response.status, teamName, path, errorBody);
|
|
128
|
+
}
|
|
129
|
+
const text = await response.text();
|
|
130
|
+
try {
|
|
131
|
+
const parsed = JSON.parse(text);
|
|
132
|
+
return unwrapEnvelope(parsed, toolName, teamName);
|
|
133
|
+
}
|
|
134
|
+
catch (err) {
|
|
135
|
+
if (err instanceof SyntaxError) {
|
|
136
|
+
throw new Error(`Loop returned non-JSON response for team=${teamName} path=${path} ` +
|
|
137
|
+
`(status=${response.status}, length=${text.length})`);
|
|
138
|
+
}
|
|
139
|
+
throw err;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Make a PUT request to the Loop API V2.
|
|
144
|
+
* For update operations: batch matching, submit quotes, update preferences, etc.
|
|
145
|
+
*/
|
|
146
|
+
export async function loopPut(apiKey, path, body, toolName, teamName) {
|
|
147
|
+
const url = `${LOOP_BASE_URL}${path}`;
|
|
148
|
+
const start = Date.now();
|
|
149
|
+
const response = await fetch(url, {
|
|
150
|
+
method: "PUT",
|
|
151
|
+
headers: {
|
|
152
|
+
"X-Api-Key": apiKey,
|
|
153
|
+
"Accept": "application/json",
|
|
154
|
+
"Content-Type": "application/json",
|
|
155
|
+
},
|
|
156
|
+
body: JSON.stringify(body),
|
|
157
|
+
signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
|
|
158
|
+
});
|
|
159
|
+
const duration = Date.now() - start;
|
|
160
|
+
console.error(`[loop] WRITE ${toolName} team=${teamName} endpoint=PUT ${path} status=${response.status} duration=${duration}ms`);
|
|
161
|
+
if (response.status === 204) {
|
|
162
|
+
return { success: true };
|
|
163
|
+
}
|
|
164
|
+
if (!response.ok) {
|
|
165
|
+
const errorBody = await response.text().catch(() => "");
|
|
166
|
+
throw new LoopApiError(response.status, teamName, path, errorBody);
|
|
167
|
+
}
|
|
168
|
+
const text = await response.text();
|
|
169
|
+
try {
|
|
170
|
+
const parsed = JSON.parse(text);
|
|
171
|
+
return unwrapEnvelope(parsed, toolName, teamName);
|
|
172
|
+
}
|
|
173
|
+
catch (err) {
|
|
174
|
+
if (err instanceof SyntaxError) {
|
|
175
|
+
throw new Error(`Loop returned non-JSON response for team=${teamName} path=${path} ` +
|
|
176
|
+
`(status=${response.status}, length=${text.length})`);
|
|
177
|
+
}
|
|
178
|
+
throw err;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
export class LoopApiError extends Error {
|
|
182
|
+
status;
|
|
183
|
+
teamName;
|
|
184
|
+
path;
|
|
185
|
+
responseBody;
|
|
186
|
+
constructor(status, teamName, path, responseBody) {
|
|
187
|
+
const detail = responseBody ? ` — ${responseBody.slice(0, 200)}` : "";
|
|
188
|
+
super(`Loop API returned ${status} for team=${teamName} path=${path}${detail}`);
|
|
189
|
+
this.status = status;
|
|
190
|
+
this.teamName = teamName;
|
|
191
|
+
this.path = path;
|
|
192
|
+
this.responseBody = responseBody;
|
|
193
|
+
this.name = "LoopApiError";
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Fan out a request across all registered teams for an account, merging results.
|
|
198
|
+
*
|
|
199
|
+
* Each tool provides a `buildRequest` function that takes a decrypted API key
|
|
200
|
+
* and returns the data for that team. The aggregation engine handles:
|
|
201
|
+
* - Key loading and decryption
|
|
202
|
+
* - Permission checking
|
|
203
|
+
* - Concurrent fan-out via Promise.allSettled
|
|
204
|
+
* - Result merging with teamName tags
|
|
205
|
+
* - Aggregate logging
|
|
206
|
+
*
|
|
207
|
+
* When `teamName` is provided, only that team is queried (no fan-out).
|
|
208
|
+
*/
|
|
209
|
+
export async function aggregateAcrossTeams(accountId, endpointGroup, toolName, buildRequest, options) {
|
|
210
|
+
const allKeys = await loadTeamKeys(accountId);
|
|
211
|
+
if (allKeys.length === 0) {
|
|
212
|
+
return { results: [], failures: [], skipped: [], totalTeams: 0 };
|
|
213
|
+
}
|
|
214
|
+
// Filter to specific team if requested
|
|
215
|
+
const keys = options?.teamName
|
|
216
|
+
? allKeys.filter((k) => k.teamName === options.teamName)
|
|
217
|
+
: allKeys;
|
|
218
|
+
if (keys.length === 0 && options?.teamName) {
|
|
219
|
+
return {
|
|
220
|
+
results: [],
|
|
221
|
+
failures: [{ teamName: options.teamName, reason: "Team not found" }],
|
|
222
|
+
skipped: [],
|
|
223
|
+
totalTeams: allKeys.length,
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
const limitPerTeam = options?.limitPerTeam ?? DEFAULT_LIMIT_PER_TEAM;
|
|
227
|
+
const limitTotal = options?.limitTotal ?? DEFAULT_LIMIT_TOTAL;
|
|
228
|
+
const results = [];
|
|
229
|
+
const failures = [];
|
|
230
|
+
const skipped = [];
|
|
231
|
+
// Check permissions and build request promises
|
|
232
|
+
const tasks = [];
|
|
233
|
+
for (const key of keys) {
|
|
234
|
+
if (!key.permissions.includes(endpointGroup)) {
|
|
235
|
+
console.error(`[loop] ${toolName} team=${key.teamName} — permission denied (requires: ${endpointGroup})`);
|
|
236
|
+
skipped.push({
|
|
237
|
+
teamName: key.teamName,
|
|
238
|
+
reason: `No ${endpointGroup} permission`,
|
|
239
|
+
});
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
let apiKey;
|
|
243
|
+
try {
|
|
244
|
+
apiKey = decrypt(key.encryptedKey);
|
|
245
|
+
}
|
|
246
|
+
catch (err) {
|
|
247
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
248
|
+
console.error(`[loop] decrypt failed for team=${key.teamName}: ${msg}`);
|
|
249
|
+
failures.push({ teamName: key.teamName, reason: `Decryption failed` });
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
252
|
+
tasks.push({ key, promise: buildRequest(apiKey, key.teamName) });
|
|
253
|
+
}
|
|
254
|
+
// Fan out concurrent requests
|
|
255
|
+
const settled = await Promise.allSettled(tasks.map((t) => t.promise));
|
|
256
|
+
for (let i = 0; i < settled.length; i++) {
|
|
257
|
+
const outcome = settled[i];
|
|
258
|
+
const teamName = tasks[i].key.teamName;
|
|
259
|
+
if (outcome.status === "fulfilled") {
|
|
260
|
+
const data = Array.isArray(outcome.value)
|
|
261
|
+
? outcome.value.slice(0, limitPerTeam)
|
|
262
|
+
: [];
|
|
263
|
+
results.push({ teamName, data });
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
const reason = outcome.reason instanceof LoopApiError
|
|
267
|
+
? `HTTP ${outcome.reason.status}`
|
|
268
|
+
: outcome.reason instanceof Error
|
|
269
|
+
? outcome.reason.message
|
|
270
|
+
: String(outcome.reason);
|
|
271
|
+
console.error(`[loop] ${toolName} team=${teamName} failed: ${reason}`);
|
|
272
|
+
failures.push({ teamName, reason });
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
// Apply total limit across all teams
|
|
276
|
+
let totalItems = 0;
|
|
277
|
+
for (const r of results) {
|
|
278
|
+
const remaining = limitTotal - totalItems;
|
|
279
|
+
if (remaining <= 0) {
|
|
280
|
+
r.data = [];
|
|
281
|
+
}
|
|
282
|
+
else if (r.data.length > remaining) {
|
|
283
|
+
r.data = r.data.slice(0, remaining);
|
|
284
|
+
}
|
|
285
|
+
totalItems += r.data.length;
|
|
286
|
+
}
|
|
287
|
+
console.error(`[loop] aggregate tool=${toolName} teams=${keys.length} ` +
|
|
288
|
+
`succeeded=${results.length} failed=${failures.length} skipped=${skipped.length}`);
|
|
289
|
+
return { results, failures, skipped, totalTeams: allKeys.length };
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Resolve a single team's API key with permission checking.
|
|
293
|
+
* Handles key loading, decryption, and permission validation.
|
|
294
|
+
* Used for both reads and writes that target a specific team — no fan-out.
|
|
295
|
+
*/
|
|
296
|
+
export async function withTeamKey(accountId, teamName, endpointGroup, toolName, execute) {
|
|
297
|
+
const allKeys = await loadTeamKeys(accountId);
|
|
298
|
+
if (allKeys.length === 0) {
|
|
299
|
+
throw new Error("No Loop teams registered. Use loop-key-register to add team API keys.");
|
|
300
|
+
}
|
|
301
|
+
const key = allKeys.find((k) => k.teamName === teamName);
|
|
302
|
+
if (!key) {
|
|
303
|
+
const available = allKeys.map((k) => k.teamName).join(", ");
|
|
304
|
+
throw new Error(`Team "${teamName}" not found. Available teams: ${available}`);
|
|
305
|
+
}
|
|
306
|
+
if (!key.permissions.includes(endpointGroup)) {
|
|
307
|
+
throw new Error(`Team "${teamName}" does not have ${endpointGroup} permission. ` +
|
|
308
|
+
`Current permissions: ${key.permissions.join(", ")}`);
|
|
309
|
+
}
|
|
310
|
+
const apiKey = decrypt(key.encryptedKey);
|
|
311
|
+
return execute(apiKey);
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Format an aggregation result into a human-readable text response.
|
|
315
|
+
*/
|
|
316
|
+
export function formatAggregationResult(result, formatItem, entityName) {
|
|
317
|
+
if (result.totalTeams === 0) {
|
|
318
|
+
return "No Loop teams registered. Use loop-key-register to add team API keys.";
|
|
319
|
+
}
|
|
320
|
+
const allSkippedOrFailed = result.results.length === 0 && result.failures.length + result.skipped.length > 0;
|
|
321
|
+
if (allSkippedOrFailed) {
|
|
322
|
+
const reasons = [
|
|
323
|
+
...result.failures.map((f) => `${f.teamName}: ${f.reason}`),
|
|
324
|
+
...result.skipped.map((s) => `${s.teamName}: ${s.reason}`),
|
|
325
|
+
];
|
|
326
|
+
return `All teams failed or were skipped:\n${reasons.join("\n")}`;
|
|
327
|
+
}
|
|
328
|
+
const lines = [];
|
|
329
|
+
let totalItems = 0;
|
|
330
|
+
for (const teamResult of result.results) {
|
|
331
|
+
if (teamResult.data.length === 0)
|
|
332
|
+
continue;
|
|
333
|
+
totalItems += teamResult.data.length;
|
|
334
|
+
lines.push(`\n## ${teamResult.teamName}`);
|
|
335
|
+
for (const item of teamResult.data) {
|
|
336
|
+
lines.push(formatItem(item, teamResult.teamName));
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
if (totalItems === 0) {
|
|
340
|
+
const teamCount = result.results.length === 1
|
|
341
|
+
? result.results[0].teamName
|
|
342
|
+
: `${result.results.length} teams`;
|
|
343
|
+
return `No ${entityName} found across ${teamCount}.`;
|
|
344
|
+
}
|
|
345
|
+
let header = `${totalItems} ${entityName} across ${result.results.length} team(s):`;
|
|
346
|
+
const parts = [header, ...lines];
|
|
347
|
+
if (result.failures.length > 0) {
|
|
348
|
+
parts.push(`\n---\nNote: ${result.failures.length} team(s) failed — check server.log for details.`);
|
|
349
|
+
}
|
|
350
|
+
if (result.skipped.length > 0) {
|
|
351
|
+
parts.push(`Note: ${result.skipped.length} team(s) skipped (insufficient permissions).`);
|
|
352
|
+
}
|
|
353
|
+
return parts.join("\n");
|
|
354
|
+
}
|
|
355
|
+
//# sourceMappingURL=loop-api.js.map
|
package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/loop-api.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loop-api.js","sourceRoot":"","sources":["../../src/lib/loop-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,oEAAoE;AACpE,0DAA0D;AAC1D,EAAE;AACF,yCAAyC;AACzC,2CAA2C;AAC3C,2CAA2C;AAC3C,2CAA2C;AAC3C,2CAA2C;AAC3C,2CAA2C;AAC3C,2CAA2C;AAC3C,2CAA2C;AAC3C,2CAA2C;AAC3C,2CAA2C;AAC3C,2CAA2C;AAC3C,oEAAoE;AAEpE,MAAM,aAAa,GAAG,2BAA2B,CAAC;AAClD,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAClC,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAClC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAsBhC,SAAS,UAAU,CAAC,GAAY;IAC9B,OAAO,CACL,GAAG,KAAK,IAAI;QACZ,OAAO,GAAG,KAAK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,CAAC;QACvC,OAAO,MAAM,UAAU,iBAAiB,SAAS,GAAG,CAAC;IACvD,CAAC;IAED,IAAI,MAAM,GAAG,GAAG,UAAU,IAAI,UAAU,WAAW,MAAM,CAAC,OAAO,CAAC,MAAM,WAAW,CAAC;IACpF,MAAM,KAAK,GAAa,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC;IAE3C,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CACR,gBAAgB,MAAM,CAAC,QAAQ,CAAC,MAAM,iDAAiD,CACxF,CAAC;IACJ,CAAC;IACD,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,KAAK,CAAC,IAAI,CACR,SAAS,MAAM,CAAC,OAAO,CAAC,MAAM,8CAA8C,CAC7E,CAAC;IACJ,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/neo4j.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"neo4j.d.ts","sourceRoot":"","sources":["../../src/lib/neo4j.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAuBtD,wBAAgB,SAAS,IAAI,MAAM,CAQlC;AAED,wBAAgB,UAAU,IAAI,OAAO,CAEpC;AAED,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAKjD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import neo4j from "neo4j-driver";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
let driver = null;
|
|
5
|
+
function readPassword() {
|
|
6
|
+
if (process.env.NEO4J_PASSWORD)
|
|
7
|
+
return process.env.NEO4J_PASSWORD;
|
|
8
|
+
const passwordFile = resolve(process.env.PLATFORM_ROOT ?? resolve(import.meta.dirname, "../../../.."), "config/.neo4j-password");
|
|
9
|
+
try {
|
|
10
|
+
return readFileSync(passwordFile, "utf-8").trim();
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
throw new Error(`Neo4j password not found. Expected at ${passwordFile} or in NEO4J_PASSWORD env var.`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export function getDriver() {
|
|
17
|
+
if (!driver) {
|
|
18
|
+
const uri = process.env.NEO4J_URI ?? "bolt://localhost:7687";
|
|
19
|
+
const user = process.env.NEO4J_USER ?? "neo4j";
|
|
20
|
+
const password = readPassword();
|
|
21
|
+
driver = neo4j.driver(uri, neo4j.auth.basic(user, password));
|
|
22
|
+
}
|
|
23
|
+
return driver;
|
|
24
|
+
}
|
|
25
|
+
export function getSession() {
|
|
26
|
+
return getDriver().session();
|
|
27
|
+
}
|
|
28
|
+
export async function closeDriver() {
|
|
29
|
+
if (driver) {
|
|
30
|
+
await driver.close();
|
|
31
|
+
driver = null;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=neo4j.js.map
|
package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/neo4j.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"neo4j.js","sourceRoot":"","sources":["../../src/lib/neo4j.ts"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,IAAI,MAAM,GAAkB,IAAI,CAAC;AAEjC,SAAS,YAAY;IACnB,IAAI,OAAO,CAAC,GAAG,CAAC,cAAc;QAAE,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;IAElE,MAAM,YAAY,GAAG,OAAO,CAC1B,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,EACxE,wBAAwB,CACzB,CAAC;IAEF,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;IACpD,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CACb,yCAAyC,YAAY,gCAAgC,CACtF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,SAAS;IACvB,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,uBAAuB,CAAC;QAC7D,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,OAAO,CAAC;QAC/C,MAAM,QAAQ,GAAG,YAAY,EAAE,CAAC;QAChC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC/D,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,UAAU;IACxB,OAAO,SAAS,EAAE,CAAC,OAAO,EAAE,CAAC;AAC/B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW;IAC/B,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACrB,MAAM,GAAG,IAAI,CAAC;IAChB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type PreferencesAction = "read" | "write";
|
|
2
|
+
export declare function customerPreferences(params: {
|
|
3
|
+
accountId: string;
|
|
4
|
+
teamName: string;
|
|
5
|
+
personCode: number;
|
|
6
|
+
action: PreferencesAction;
|
|
7
|
+
preferences?: Record<string, unknown>;
|
|
8
|
+
}): Promise<string>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=customer-preferences.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customer-preferences.d.ts","sourceRoot":"","sources":["../../src/tools/customer-preferences.ts"],"names":[],"mappings":"AAEA,KAAK,iBAAiB,GAAG,MAAM,GAAG,OAAO,CAAC;AAmB1C,wBAAsB,mBAAmB,CAAC,MAAM,EAAE;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC,GAAG,OAAO,CAAC,MAAM,CAAC,CAsClB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { loopGet, loopPost, withTeamKey } from "../lib/loop-api.js";
|
|
2
|
+
export async function customerPreferences(params) {
|
|
3
|
+
const { accountId, teamName, personCode, action } = params;
|
|
4
|
+
if (action === "read") {
|
|
5
|
+
const result = await withTeamKey(accountId, teamName, "customer", "loop-customer-preferences", async (apiKey) => {
|
|
6
|
+
return loopGet(apiKey, `/customer/preferences/${personCode}`, "loop-customer-preferences", teamName);
|
|
7
|
+
});
|
|
8
|
+
if (!result || (Array.isArray(result) && result.length === 0)) {
|
|
9
|
+
return `No preferences found for person ${personCode} via team "${teamName}".`;
|
|
10
|
+
}
|
|
11
|
+
return JSON.stringify(result, null, 2);
|
|
12
|
+
}
|
|
13
|
+
if (action === "write") {
|
|
14
|
+
if (!params.preferences) {
|
|
15
|
+
throw new Error("preferences object is required when action is 'write'.");
|
|
16
|
+
}
|
|
17
|
+
await withTeamKey(accountId, teamName, "customer", "loop-customer-preferences", async (apiKey) => {
|
|
18
|
+
return loopPost(apiKey, `/customer/preferences/${personCode}`, params.preferences, "loop-customer-preferences", teamName);
|
|
19
|
+
});
|
|
20
|
+
return `Preferences updated for person ${personCode} via team "${teamName}".`;
|
|
21
|
+
}
|
|
22
|
+
throw new Error(`Unknown action: ${action}. Use "read" or "write".`);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=customer-preferences.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customer-preferences.js","sourceRoot":"","sources":["../../src/tools/customer-preferences.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAqBpE,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,MAMzC;IACC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAE3D,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,MAAM,MAAM,GAAG,MAAM,WAAW,CAC9B,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,2BAA2B,EAC5D,KAAK,EAAE,MAAM,EAAE,EAAE;YACf,OAAO,OAAO,CACZ,MAAM,EAAE,yBAAyB,UAAU,EAAE,EAC7C,2BAA2B,EAAE,QAAQ,CACtC,CAAC;QACJ,CAAC,CACF,CAAC;QAEF,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC;YAC9D,OAAO,mCAAmC,UAAU,cAAc,QAAQ,IAAI,CAAC;QACjF,CAAC;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;QACvB,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;QAC5E,CAAC;QAED,MAAM,WAAW,CACf,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,2BAA2B,EAC5D,KAAK,EAAE,MAAM,EAAE,EAAE;YACf,OAAO,QAAQ,CACb,MAAM,EAAE,yBAAyB,UAAU,EAAE,EAC7C,MAAM,CAAC,WAAY,EAAE,2BAA2B,EAAE,QAAQ,CAC3D,CAAC;QACJ,CAAC,CACF,CAAC;QACF,OAAO,kCAAkC,UAAU,cAAc,QAAQ,IAAI,CAAC;IAChF,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,mBAAmB,MAAM,0BAA0B,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback-list.d.ts","sourceRoot":"","sources":["../../src/tools/feedback-list.ts"],"names":[],"mappings":"AAiBA,wBAAsB,YAAY,CAAC,MAAM,EAAE;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CAgClB"}
|
package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/feedback-list.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { aggregateAcrossTeams, formatAggregationResult, loopGet, } from "../lib/loop-api.js";
|
|
2
|
+
export async function feedbackList(params) {
|
|
3
|
+
const { accountId, teamName, limit } = params;
|
|
4
|
+
const result = await aggregateAcrossTeams(accountId, "feedback", "loop-feedback-list", async (apiKey, team) => {
|
|
5
|
+
const data = await loopGet(apiKey, "/feedback", "loop-feedback-list", team);
|
|
6
|
+
return Array.isArray(data) ? data : [];
|
|
7
|
+
}, { teamName, limitPerTeam: limit ?? 50, limitTotal: limit ?? 200 });
|
|
8
|
+
return formatAggregationResult(result, (f) => {
|
|
9
|
+
const addr = f.propertyAddress ?? "Unknown property";
|
|
10
|
+
const date = f.viewingDate ?? "";
|
|
11
|
+
const attendee = f.attendeeName ? ` (${f.attendeeName})` : "";
|
|
12
|
+
const rating = f.rating != null ? ` ★${f.rating}` : "";
|
|
13
|
+
const text = f.feedback ? `: "${f.feedback}"` : "";
|
|
14
|
+
const status = f.status ? ` [${f.status}]` : "";
|
|
15
|
+
return `- ${addr} ${date}${attendee}${rating}${status}${text}`;
|
|
16
|
+
}, "feedback");
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=feedback-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback-list.js","sourceRoot":"","sources":["../../src/tools/feedback-list.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,OAAO,GACR,MAAM,oBAAoB,CAAC;AAa5B,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,MAIlC;IACC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IAE9C,MAAM,MAAM,GAAG,MAAM,oBAAoB,CACvC,SAAS,EACT,UAAU,EACV,oBAAoB,EACpB,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,OAAO,CACxB,MAAM,EACN,WAAW,EACX,oBAAoB,EACpB,IAAI,CACL,CAAC;QACF,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IACzC,CAAC,EACD,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,IAAI,EAAE,EAAE,UAAU,EAAE,KAAK,IAAI,GAAG,EAAE,CAClE,CAAC;IAEF,OAAO,uBAAuB,CAC5B,MAAM,EACN,CAAC,CAAC,EAAE,EAAE;QACJ,MAAM,IAAI,GAAG,CAAC,CAAC,eAAe,IAAI,kBAAkB,CAAC;QACrD,MAAM,IAAI,GAAG,CAAC,CAAC,WAAW,IAAI,EAAE,CAAC;QACjC,MAAM,QAAQ,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9D,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACvD,MAAM,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACnD,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QAChD,OAAO,KAAK,IAAI,IAAI,IAAI,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,CAAC;IACjE,CAAC,EACD,UAAU,CACX,CAAC;AACJ,CAAC"}
|
package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/feedback.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type Department = "sales" | "lettings";
|
|
2
|
+
export declare function feedbackGet(params: {
|
|
3
|
+
accountId: string;
|
|
4
|
+
teamName: string;
|
|
5
|
+
viewingId: number;
|
|
6
|
+
department: Department;
|
|
7
|
+
}): Promise<string>;
|
|
8
|
+
export declare function feedbackSubmit(params: {
|
|
9
|
+
accountId: string;
|
|
10
|
+
teamName: string;
|
|
11
|
+
viewingId: number;
|
|
12
|
+
department: Department;
|
|
13
|
+
feedback: string;
|
|
14
|
+
}): Promise<string>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=feedback.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../../src/tools/feedback.ts"],"names":[],"mappings":"AAMA,KAAK,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC;AAwBvC,wBAAsB,WAAW,CAAC,MAAM,EAAE;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;CACxB,GAAG,OAAO,CAAC,MAAM,CAAC,CA2BlB;AAED,wBAAsB,cAAc,CAAC,MAAM,EAAE;IAC3C,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAAC,MAAM,CAAC,CAelB"}
|