@rubytech/create-maxy-code 0.1.58 → 0.1.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/payload/platform/plugins/admin/hooks/__tests__/turn-completed-graph-write.test.sh +30 -19
- package/payload/platform/plugins/admin/hooks/turn-completed-graph-write.sh +35 -90
- package/payload/platform/plugins/docs/references/admin-session.md +17 -16
- package/payload/platform/plugins/docs/references/platform.md +3 -3
- package/payload/platform/plugins/docs/references/plugins-guide.md +1 -1
- package/payload/platform/plugins/loop/PLUGIN.md +13 -1
- package/payload/platform/plugins/loop/mcp/dist/index.js +8 -7
- package/payload/platform/plugins/loop/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/loop/mcp/dist/lib/file-crypto.d.ts +3 -0
- package/payload/platform/plugins/loop/mcp/dist/lib/file-crypto.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/lib/file-crypto.js +48 -0
- package/payload/platform/plugins/loop/mcp/dist/lib/file-crypto.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/lib/key-store.d.ts +22 -0
- package/payload/platform/plugins/loop/mcp/dist/lib/key-store.d.ts.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/lib/key-store.js +165 -0
- package/payload/platform/plugins/loop/mcp/dist/lib/key-store.js.map +1 -0
- package/payload/platform/plugins/loop/mcp/dist/lib/loop-api.d.ts +1 -1
- package/payload/platform/plugins/loop/mcp/dist/lib/loop-api.d.ts.map +1 -1
- package/payload/platform/plugins/loop/mcp/dist/lib/loop-api.js +4 -39
- package/payload/platform/plugins/loop/mcp/dist/lib/loop-api.js.map +1 -1
- package/payload/platform/plugins/loop/mcp/dist/tools/key-deregister.d.ts.map +1 -1
- package/payload/platform/plugins/loop/mcp/dist/tools/key-deregister.js +5 -15
- package/payload/platform/plugins/loop/mcp/dist/tools/key-deregister.js.map +1 -1
- package/payload/platform/plugins/loop/mcp/dist/tools/key-register.d.ts.map +1 -1
- package/payload/platform/plugins/loop/mcp/dist/tools/key-register.js +11 -28
- package/payload/platform/plugins/loop/mcp/dist/tools/key-register.js.map +1 -1
- package/payload/platform/plugins/loop/mcp/src/index.ts +10 -7
- package/payload/platform/plugins/loop/mcp/src/lib/file-crypto.ts +54 -0
- package/payload/platform/plugins/loop/mcp/src/lib/key-store.ts +221 -0
- package/payload/platform/plugins/loop/mcp/src/lib/loop-api.ts +5 -42
- package/payload/platform/plugins/loop/mcp/src/tools/key-deregister.ts +5 -20
- package/payload/platform/plugins/loop/mcp/src/tools/key-register.ts +14 -39
- package/payload/platform/plugins/preval/.claude-plugin/plugin.json +8 -0
- package/payload/platform/plugins/preval/PLUGIN.md +39 -0
- package/payload/platform/plugins/preval/skills/property-preval/SKILL.md +78 -0
- package/payload/platform/plugins/preval/skills/property-preval/references/render.py +265 -0
- package/payload/platform/plugins/preval/skills/property-preval/references/template-inputs.schema.json +143 -0
- package/payload/platform/plugins/preval/skills/property-preval/references/template.html +253 -0
- package/payload/platform/plugins/property-data/.claude-plugin/plugin.json +1 -1
- package/payload/platform/plugins/property-data/PLUGIN.md +60 -2
- package/payload/platform/plugins/property-data/mcp/dist/index.js +95 -12
- package/payload/platform/plugins/property-data/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/property-data/mcp/dist/lib/file-crypto.d.ts +3 -0
- package/payload/platform/plugins/property-data/mcp/dist/lib/file-crypto.d.ts.map +1 -0
- package/payload/platform/plugins/property-data/mcp/dist/lib/file-crypto.js +49 -0
- package/payload/platform/plugins/property-data/mcp/dist/lib/file-crypto.js.map +1 -0
- package/payload/platform/plugins/property-data/mcp/dist/lib/key-store.d.ts +15 -0
- package/payload/platform/plugins/property-data/mcp/dist/lib/key-store.d.ts.map +1 -0
- package/payload/platform/plugins/property-data/mcp/dist/lib/key-store.js +135 -0
- package/payload/platform/plugins/property-data/mcp/dist/lib/key-store.js.map +1 -0
- package/payload/platform/plugins/property-data/mcp/dist/lib/propertydata-api.d.ts +0 -1
- package/payload/platform/plugins/property-data/mcp/dist/lib/propertydata-api.d.ts.map +1 -1
- package/payload/platform/plugins/property-data/mcp/dist/lib/propertydata-api.js +11 -22
- package/payload/platform/plugins/property-data/mcp/dist/lib/propertydata-api.js.map +1 -1
- package/payload/platform/plugins/property-data/mcp/dist/tools/endpoints.d.ts +10 -0
- package/payload/platform/plugins/property-data/mcp/dist/tools/endpoints.d.ts.map +1 -1
- package/payload/platform/plugins/property-data/mcp/dist/tools/endpoints.js +15 -2
- package/payload/platform/plugins/property-data/mcp/dist/tools/endpoints.js.map +1 -1
- package/payload/platform/plugins/property-data/mcp/dist/tools/key-deregister.d.ts.map +1 -1
- package/payload/platform/plugins/property-data/mcp/dist/tools/key-deregister.js +5 -15
- package/payload/platform/plugins/property-data/mcp/dist/tools/key-deregister.js.map +1 -1
- package/payload/platform/plugins/property-data/mcp/dist/tools/key-register.d.ts.map +1 -1
- package/payload/platform/plugins/property-data/mcp/dist/tools/key-register.js +30 -23
- package/payload/platform/plugins/property-data/mcp/dist/tools/key-register.js.map +1 -1
- package/payload/platform/plugins/property-data/mcp/src/__tests__/endpoints.test.ts +252 -0
- package/payload/platform/plugins/property-data/mcp/src/__tests__/schema-parity.test.ts +16 -2
- package/payload/platform/plugins/property-data/mcp/src/index.ts +171 -11
- package/payload/platform/plugins/property-data/mcp/src/lib/file-crypto.ts +55 -0
- package/payload/platform/plugins/property-data/mcp/src/lib/key-store.ts +181 -0
- package/payload/platform/plugins/property-data/mcp/src/lib/propertydata-api.ts +9 -24
- package/payload/platform/plugins/property-data/mcp/src/tools/endpoints.ts +22 -2
- package/payload/platform/plugins/property-data/mcp/src/tools/key-deregister.ts +5 -17
- package/payload/platform/plugins/property-data/mcp/src/tools/key-register.ts +29 -33
- package/payload/platform/plugins/property-data/skills/property-data/SKILL.md +19 -0
- package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.js +25 -260
- package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/jsonl-enumerator.d.ts +3 -7
- package/payload/platform/services/claude-session-manager/dist/jsonl-enumerator.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/jsonl-enumerator.js +6 -32
- package/payload/platform/services/claude-session-manager/dist/jsonl-enumerator.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts +6 -24
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +18 -91
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/reaper.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/reaper.js +0 -11
- package/payload/platform/services/claude-session-manager/dist/reaper.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/session-store.d.ts +0 -21
- package/payload/platform/services/claude-session-manager/dist/session-store.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/session-store.js.map +1 -1
- package/payload/platform/templates/agents/admin/IDENTITY.md +1 -1
- package/payload/platform/templates/agents/admin/SOUL.md +1 -1
- package/payload/premium-plugins/real-agent/BUNDLE.md +5 -3
- package/payload/premium-plugins/real-agent/agents/negotiator.md +1 -1
- package/payload/premium-plugins/real-agent/agents/valuer.md +1 -1
- package/payload/premium-plugins/real-agent/plugins/.claude-plugin/marketplace.json +5 -0
- package/payload/premium-plugins/real-agent/plugins/loop/PLUGIN.md +13 -1
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/index.js +8 -7
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/index.js.map +1 -1
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/file-crypto.d.ts +3 -0
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/file-crypto.d.ts.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/file-crypto.js +48 -0
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/file-crypto.js.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/key-store.d.ts +22 -0
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/key-store.d.ts.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/key-store.js +165 -0
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/key-store.js.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/loop-api.d.ts +1 -1
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/loop-api.d.ts.map +1 -1
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/loop-api.js +4 -39
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/lib/loop-api.js.map +1 -1
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/tools/key-deregister.d.ts.map +1 -1
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/tools/key-deregister.js +5 -15
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/tools/key-deregister.js.map +1 -1
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/tools/key-register.d.ts.map +1 -1
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/tools/key-register.js +11 -28
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/dist/tools/key-register.js.map +1 -1
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/src/index.ts +10 -7
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/src/lib/file-crypto.ts +54 -0
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/src/lib/key-store.ts +221 -0
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/src/lib/loop-api.ts +5 -42
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/src/tools/key-deregister.ts +5 -20
- package/payload/premium-plugins/real-agent/plugins/loop/mcp/src/tools/key-register.ts +14 -39
- package/payload/premium-plugins/real-agent/plugins/preval/.claude-plugin/plugin.json +8 -0
- package/payload/premium-plugins/real-agent/plugins/preval/PLUGIN.md +39 -0
- package/payload/premium-plugins/real-agent/plugins/preval/skills/property-preval/SKILL.md +78 -0
- package/payload/premium-plugins/real-agent/plugins/preval/skills/property-preval/references/render.py +265 -0
- package/payload/premium-plugins/real-agent/plugins/preval/skills/property-preval/references/template-inputs.schema.json +143 -0
- package/payload/premium-plugins/real-agent/plugins/preval/skills/property-preval/references/template.html +253 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/.claude-plugin/plugin.json +1 -1
- package/payload/premium-plugins/real-agent/plugins/property-data/PLUGIN.md +60 -2
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/index.js +95 -12
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/index.js.map +1 -1
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/file-crypto.d.ts +3 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/file-crypto.d.ts.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/file-crypto.js +49 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/file-crypto.js.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/key-store.d.ts +15 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/key-store.d.ts.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/key-store.js +135 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/key-store.js.map +1 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/propertydata-api.d.ts +0 -1
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/propertydata-api.d.ts.map +1 -1
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/propertydata-api.js +11 -22
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/propertydata-api.js.map +1 -1
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/endpoints.d.ts +10 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/endpoints.d.ts.map +1 -1
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/endpoints.js +15 -2
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/endpoints.js.map +1 -1
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-deregister.d.ts.map +1 -1
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-deregister.js +5 -15
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-deregister.js.map +1 -1
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-register.d.ts.map +1 -1
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-register.js +30 -23
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-register.js.map +1 -1
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/__tests__/endpoints.test.ts +252 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/__tests__/schema-parity.test.ts +16 -2
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/index.ts +171 -11
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/lib/file-crypto.ts +55 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/lib/key-store.ts +181 -0
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/lib/propertydata-api.ts +9 -24
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/tools/endpoints.ts +22 -2
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/tools/key-deregister.ts +5 -17
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/src/tools/key-register.ts +29 -33
- package/payload/premium-plugins/real-agent/plugins/property-data/skills/property-data/SKILL.md +19 -0
- package/payload/server/public/assets/{admin-2ZJmzJ_g.js → admin-Bp-BjBCX.js} +51 -51
- package/payload/server/public/assets/{data-DlmoKxmN.js → data-BGUAGVkV.js} +1 -1
- package/payload/server/public/assets/{graph-BVvcFSEQ.js → graph-MvYxZOBF.js} +1 -1
- package/payload/server/public/assets/{graph-labels-cCvgu38Y.js → graph-labels-D865qb3K.js} +1 -1
- package/payload/server/public/assets/{page-BnAxPkmg.js → page--hOVRrgN.js} +1 -1
- package/payload/server/public/assets/{page-BnaN3u86.js → page-C2b1nlOc.js} +1 -1
- package/payload/server/public/data.html +3 -3
- package/payload/server/public/graph.html +3 -3
- package/payload/server/public/index.html +4 -4
- package/payload/server/server.js +18 -83
- package/payload/premium-plugins/real-agent/lib/mcp-stderr-tee/dist/index.d.ts +0 -51
- package/payload/premium-plugins/real-agent/lib/mcp-stderr-tee/dist/index.d.ts.map +0 -1
- package/payload/premium-plugins/real-agent/lib/mcp-stderr-tee/dist/index.js +0 -196
- package/payload/premium-plugins/real-agent/lib/mcp-stderr-tee/dist/index.js.map +0 -1
- package/payload/premium-plugins/real-agent/lib/mcp-stderr-tee/package.json +0 -7
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface StoredKey {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
createdAt: string;
|
|
4
|
+
updatedAt: string;
|
|
5
|
+
}
|
|
6
|
+
export interface KeyStore {
|
|
7
|
+
readonly backendName: string;
|
|
8
|
+
readonly backendPath: string;
|
|
9
|
+
load(accountId: string): Promise<StoredKey | null>;
|
|
10
|
+
save(accountId: string, apiKey: string): Promise<void>;
|
|
11
|
+
delete(accountId: string): Promise<boolean>;
|
|
12
|
+
}
|
|
13
|
+
export declare function selectKeyStore(): KeyStore;
|
|
14
|
+
export declare function _resetKeyStoreForTests(): void;
|
|
15
|
+
//# sourceMappingURL=key-store.d.ts.map
|
package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/key-store.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key-store.d.ts","sourceRoot":"","sources":["../../src/lib/key-store.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IACnD,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7C;AAmJD,wBAAgB,cAAc,IAAI,QAAQ,CAIzC;AAGD,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync } from "node:fs";
|
|
2
|
+
import { resolve, dirname } from "node:path";
|
|
3
|
+
import { homedir } from "node:os";
|
|
4
|
+
import { getSession } from "./neo4j.js";
|
|
5
|
+
import { encrypt, decrypt } from "./crypto.js";
|
|
6
|
+
import { encryptWith, decryptWith } from "./file-crypto.js";
|
|
7
|
+
class Neo4jKeyStore {
|
|
8
|
+
backendName = "neo4j";
|
|
9
|
+
backendPath = process.env.NEO4J_URI ?? "<unset>";
|
|
10
|
+
async load(accountId) {
|
|
11
|
+
const session = getSession();
|
|
12
|
+
try {
|
|
13
|
+
const result = await session.run(`MATCH (k:PropertyDataKey {accountId: $accountId})
|
|
14
|
+
RETURN k.encryptedKey AS encryptedKey,
|
|
15
|
+
k.createdAt AS createdAt,
|
|
16
|
+
k.updatedAt AS updatedAt`, { accountId });
|
|
17
|
+
if (result.records.length === 0)
|
|
18
|
+
return null;
|
|
19
|
+
const r = result.records[0];
|
|
20
|
+
return {
|
|
21
|
+
apiKey: decrypt(r.get("encryptedKey")),
|
|
22
|
+
createdAt: r.get("createdAt") ?? "",
|
|
23
|
+
updatedAt: r.get("updatedAt") ?? "",
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
finally {
|
|
27
|
+
await session.close();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
async save(accountId, apiKey) {
|
|
31
|
+
const encryptedKey = encrypt(apiKey);
|
|
32
|
+
const now = new Date().toISOString();
|
|
33
|
+
const session = getSession();
|
|
34
|
+
try {
|
|
35
|
+
await session.run(`CREATE INDEX property_data_key_account IF NOT EXISTS
|
|
36
|
+
FOR (k:PropertyDataKey) ON (k.accountId)`, {});
|
|
37
|
+
await session.run(`MERGE (k:PropertyDataKey {accountId: $accountId})
|
|
38
|
+
ON CREATE SET k.encryptedKey = $encryptedKey, k.createdAt = $now, k.updatedAt = $now
|
|
39
|
+
ON MATCH SET k.encryptedKey = $encryptedKey, k.updatedAt = $now`, { accountId, encryptedKey, now });
|
|
40
|
+
}
|
|
41
|
+
finally {
|
|
42
|
+
await session.close();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async delete(accountId) {
|
|
46
|
+
const session = getSession();
|
|
47
|
+
try {
|
|
48
|
+
const result = await session.run(`MATCH (k:PropertyDataKey {accountId: $accountId})
|
|
49
|
+
DELETE k
|
|
50
|
+
RETURN count(k) AS deleted`, { accountId });
|
|
51
|
+
const deleted = result.records[0]?.get("deleted")?.toNumber?.() ?? 0;
|
|
52
|
+
return deleted > 0;
|
|
53
|
+
}
|
|
54
|
+
finally {
|
|
55
|
+
await session.close();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const LABEL = "property-data";
|
|
60
|
+
class FileKeyStore {
|
|
61
|
+
backendName = "file";
|
|
62
|
+
backendPath;
|
|
63
|
+
storePath;
|
|
64
|
+
keyFilePath;
|
|
65
|
+
constructor() {
|
|
66
|
+
const home = homedir();
|
|
67
|
+
this.storePath = resolve(home, ".claude/.realagent-property-data-key.enc");
|
|
68
|
+
this.keyFilePath = resolve(home, ".claude/.realagent-property-data-encryption-key");
|
|
69
|
+
this.backendPath = this.storePath;
|
|
70
|
+
}
|
|
71
|
+
ensureDir() {
|
|
72
|
+
mkdirSync(dirname(this.storePath), { recursive: true });
|
|
73
|
+
}
|
|
74
|
+
readAll() {
|
|
75
|
+
if (!existsSync(this.storePath))
|
|
76
|
+
return {};
|
|
77
|
+
const blob = readFileSync(this.storePath, "utf-8").trim();
|
|
78
|
+
if (!blob)
|
|
79
|
+
return {};
|
|
80
|
+
const json = decryptWith(blob, this.keyFilePath, LABEL);
|
|
81
|
+
return JSON.parse(json);
|
|
82
|
+
}
|
|
83
|
+
writeAll(env) {
|
|
84
|
+
this.ensureDir();
|
|
85
|
+
const blob = encryptWith(JSON.stringify(env), this.keyFilePath, LABEL);
|
|
86
|
+
writeFileSync(this.storePath, blob, { mode: 0o600 });
|
|
87
|
+
}
|
|
88
|
+
async load(accountId) {
|
|
89
|
+
const env = this.readAll();
|
|
90
|
+
const entry = env[accountId];
|
|
91
|
+
if (!entry)
|
|
92
|
+
return null;
|
|
93
|
+
// The encryptedKey field is double-encrypted: the file blob is decrypted
|
|
94
|
+
// above, the inner field is the original AES-GCM-wrapped key. Keep the
|
|
95
|
+
// inner layer so an unauthenticated read of decrypted JSON still doesn't
|
|
96
|
+
// expose the API key directly in process memory until decryptWith runs.
|
|
97
|
+
return {
|
|
98
|
+
apiKey: decryptWith(entry.encryptedKey, this.keyFilePath, LABEL),
|
|
99
|
+
createdAt: entry.createdAt,
|
|
100
|
+
updatedAt: entry.updatedAt,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
async save(accountId, apiKey) {
|
|
104
|
+
const env = this.readAll();
|
|
105
|
+
const now = new Date().toISOString();
|
|
106
|
+
const encryptedKey = encryptWith(apiKey, this.keyFilePath, LABEL);
|
|
107
|
+
const prev = env[accountId];
|
|
108
|
+
env[accountId] = {
|
|
109
|
+
encryptedKey,
|
|
110
|
+
createdAt: prev?.createdAt ?? now,
|
|
111
|
+
updatedAt: now,
|
|
112
|
+
};
|
|
113
|
+
this.writeAll(env);
|
|
114
|
+
}
|
|
115
|
+
async delete(accountId) {
|
|
116
|
+
const env = this.readAll();
|
|
117
|
+
if (!(accountId in env))
|
|
118
|
+
return false;
|
|
119
|
+
delete env[accountId];
|
|
120
|
+
this.writeAll(env);
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
let cached = null;
|
|
125
|
+
export function selectKeyStore() {
|
|
126
|
+
if (cached)
|
|
127
|
+
return cached;
|
|
128
|
+
cached = process.env.PROPERTY_DATA_STANDALONE === "1" ? new FileKeyStore() : new Neo4jKeyStore();
|
|
129
|
+
return cached;
|
|
130
|
+
}
|
|
131
|
+
// Test seam — used by unit tests to reset the cached store between cases.
|
|
132
|
+
export function _resetKeyStoreForTests() {
|
|
133
|
+
cached = null;
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=key-store.js.map
|
package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/key-store.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key-store.js","sourceRoot":"","sources":["../../src/lib/key-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,WAAW,EAA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,IAAI,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC;QAC5B,GAAG,CAAC,SAAS,CAAC,GAAG;YACf,YAAY;YACZ,SAAS,EAAE,IAAI,EAAE,SAAS,IAAI,GAAG;YACjC,SAAS,EAAE,GAAG;SACf,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,SAAiB;QAC5B,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;QAC3B,IAAI,CAAC,CAAC,SAAS,IAAI,GAAG,CAAC;YAAE,OAAO,KAAK,CAAC;QACtC,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC;QACtB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED,IAAI,MAAM,GAAoB,IAAI,CAAC;AAEnC,MAAM,UAAU,cAAc;IAC5B,IAAI,MAAM;QAAE,OAAO,MAAM,CAAC;IAC1B,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,wBAAwB,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,YAAY,EAAE,CAAC,CAAC,CAAC,IAAI,aAAa,EAAE,CAAC;IACjG,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,sBAAsB;IACpC,MAAM,GAAG,IAAI,CAAC;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propertydata-api.d.ts","sourceRoot":"","sources":["../../src/lib/propertydata-api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"propertydata-api.d.ts","sourceRoot":"","sources":["../../src/lib/propertydata-api.ts"],"names":[],"mappings":"AAiBA,qBAAa,qBAAsB,SAAQ,KAAK;;CAK/C;AAED,qBAAa,iBAAkB,SAAQ,KAAK;aAExB,MAAM,EAAE,MAAM;aACd,QAAQ,EAAE,MAAM;aAChB,eAAe,EAAE,MAAM;gBAFvB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM;CAK1C;AAED,qBAAa,gBAAiB,SAAQ,KAAK;aACb,QAAQ,EAAE,MAAM;aAAkB,MAAM,EAAE,MAAM;gBAAhD,QAAQ,EAAE,MAAM,EAAkB,MAAM,EAAE,MAAM;CAI7E;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAIvF;AAED,wBAAsB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAO7E;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC;CACrD;AAED,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAkDzE"}
|
package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/propertydata-api.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { decrypt } from "./crypto.js";
|
|
1
|
+
import { selectKeyStore } from "./key-store.js";
|
|
3
2
|
// PropertyData API V1 client. Every endpoint is a GET against
|
|
4
3
|
// https://api.propertydata.co.uk/<endpoint> with `key=<api-key>` plus
|
|
5
4
|
// endpoint-specific query params. Response envelope:
|
|
@@ -42,30 +41,20 @@ export class BadResponseError extends Error {
|
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
43
|
export async function loadAccountKey(accountId) {
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
k.createdAt AS createdAt,
|
|
50
|
-
k.updatedAt AS updatedAt`, { accountId });
|
|
51
|
-
if (result.records.length === 0)
|
|
52
|
-
return null;
|
|
53
|
-
const r = result.records[0];
|
|
54
|
-
return {
|
|
55
|
-
encryptedKey: r.get("encryptedKey"),
|
|
56
|
-
createdAt: r.get("createdAt") ?? "",
|
|
57
|
-
updatedAt: r.get("updatedAt") ?? "",
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
finally {
|
|
61
|
-
await session.close();
|
|
62
|
-
}
|
|
44
|
+
const stored = await selectKeyStore().load(accountId);
|
|
45
|
+
if (!stored)
|
|
46
|
+
return null;
|
|
47
|
+
return { createdAt: stored.createdAt, updatedAt: stored.updatedAt };
|
|
63
48
|
}
|
|
64
49
|
export async function resolveAccountApiKey(accountId) {
|
|
65
|
-
|
|
50
|
+
// Bypass for one-shot CLI runs: explicit env var beats stored key.
|
|
51
|
+
const envKey = process.env.PROPERTY_DATA_API_KEY;
|
|
52
|
+
if (envKey && envKey.trim())
|
|
53
|
+
return envKey.trim();
|
|
54
|
+
const stored = await selectKeyStore().load(accountId);
|
|
66
55
|
if (!stored)
|
|
67
56
|
throw new KeyNotRegisteredError();
|
|
68
|
-
return
|
|
57
|
+
return stored.apiKey;
|
|
69
58
|
}
|
|
70
59
|
export async function propertyDataCall(opts) {
|
|
71
60
|
const { endpoint, toolName, accountId, params } = opts;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propertydata-api.js","sourceRoot":"","sources":["../../src/lib/propertydata-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"propertydata-api.js","sourceRoot":"","sources":["../../src/lib/propertydata-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,8DAA8D;AAC9D,sEAAsE;AACtE,qDAAqD;AACrD,EAAE;AACF,wCAA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AClD,CAAC;QACD,MAAM,GAAG,GAAG,MAAM,CAAE,MAAgC,CAAC,OAAO,IAAI,eAAe,CAAC,CAAC;QACjF,MAAM,IAAI,iBAAiB,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACzC,CAAC"}
|
package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/endpoints.d.ts
CHANGED
|
@@ -10,5 +10,15 @@ export declare const demand: (a: Args) => Promise<string>;
|
|
|
10
10
|
export declare const yields: (a: Args) => Promise<string>;
|
|
11
11
|
export declare const growth: (a: Args) => Promise<string>;
|
|
12
12
|
export declare const nationalHpi: (a: Args) => Promise<string>;
|
|
13
|
+
export declare const pricesPerSqf: (a: Args) => Promise<string>;
|
|
14
|
+
export declare const soldPricesPerSqf: (a: Args) => Promise<string>;
|
|
15
|
+
export declare const crime: (a: Args) => Promise<string>;
|
|
16
|
+
export declare const floodRisk: (a: Args) => Promise<string>;
|
|
17
|
+
export declare const councilTax: (a: Args) => Promise<string>;
|
|
18
|
+
export declare const planningApplications: (a: Args) => Promise<string>;
|
|
19
|
+
export declare const addressMatchUprn: (a: Args) => Promise<string>;
|
|
20
|
+
export declare const growthPsf: (a: Args) => Promise<string>;
|
|
21
|
+
export declare const demandRent: (a: Args) => Promise<string>;
|
|
22
|
+
export declare const propertyTypes: (a: Args) => Promise<string>;
|
|
13
23
|
export {};
|
|
14
24
|
//# sourceMappingURL=endpoints.d.ts.map
|
package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/endpoints.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../src/tools/endpoints.ts"],"names":[],"mappings":"AAMA,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC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I,GAAG,IAAI,oBAAwD,CAAC;AAC3F,eAAO,MAAM,oBAAoB,GAAI,GAAG,IAAI,oBAC6B,CAAC;AAC1E,eAAO,MAAM,gBAAgB,GAAI,GAAG,IAAI,oBAC2B,CAAC;AACpE,eAAO,MAAM,SAAS,GAAI,GAAG,IAAI,oBAAsD,CAAC;AACxF,eAAO,MAAM,UAAU,GAAI,GAAG,IAAI,oBAAwD,CAAC;AAC3F,eAAO,MAAM,aAAa,GAAI,GAAG,IAAI,oBACsB,CAAC"}
|
package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/endpoints.js
CHANGED
|
@@ -11,10 +11,23 @@ function call(toolName, endpoint, args) {
|
|
|
11
11
|
export const valuationSale = (a) => call("property-data-valuation-sale", "valuation-sale", a);
|
|
12
12
|
export const valuationRent = (a) => call("property-data-valuation-rent", "valuation-rent", a);
|
|
13
13
|
export const prices = (a) => call("property-data-prices", "prices", a);
|
|
14
|
-
export const pricesRent = (a) => call("property-data-prices-rent", "
|
|
14
|
+
export const pricesRent = (a) => call("property-data-prices-rent", "rents", a);
|
|
15
15
|
export const soldPrices = (a) => call("property-data-sold-prices", "sold-prices", a);
|
|
16
16
|
export const demand = (a) => call("property-data-demand", "demand", a);
|
|
17
17
|
export const yields = (a) => call("property-data-yields", "yields", a);
|
|
18
18
|
export const growth = (a) => call("property-data-growth", "growth", a);
|
|
19
|
-
export const nationalHpi = (a) => call("property-data-national-hpi", "national-
|
|
19
|
+
export const nationalHpi = (a) => call("property-data-national-hpi", "national-data", a);
|
|
20
|
+
// Task 144 — 10 additional read endpoints (£/sqft, area risk,
|
|
21
|
+
// planning precedent, UPRN, demand-rent, property-type mix).
|
|
22
|
+
// All inherit the same observability + error contract as above.
|
|
23
|
+
export const pricesPerSqf = (a) => call("property-data-prices-per-sqf", "prices-per-sqf", a);
|
|
24
|
+
export const soldPricesPerSqf = (a) => call("property-data-sold-prices-per-sqf", "sold-prices-per-sqf", a);
|
|
25
|
+
export const crime = (a) => call("property-data-crime", "crime", a);
|
|
26
|
+
export const floodRisk = (a) => call("property-data-flood-risk", "flood-risk", a);
|
|
27
|
+
export const councilTax = (a) => call("property-data-council-tax", "council-tax", a);
|
|
28
|
+
export const planningApplications = (a) => call("property-data-planning-applications", "planning-applications", a);
|
|
29
|
+
export const addressMatchUprn = (a) => call("property-data-address-match-uprn", "address-match-uprn", a);
|
|
30
|
+
export const growthPsf = (a) => call("property-data-growth-psf", "growth-psf", a);
|
|
31
|
+
export const demandRent = (a) => call("property-data-demand-rent", "demand-rent", a);
|
|
32
|
+
export const propertyTypes = (a) => call("property-data-property-types", "property-types", a);
|
|
20
33
|
//# sourceMappingURL=endpoints.js.map
|
package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/endpoints.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoints.js","sourceRoot":"","sources":["../../src/tools/endpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAQ9D,SAAS,IAAI,CAAC,QAAgB,EAAE,QAAgB,EAAE,IAAU;IAC1D,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;IACpC,OAAO,gBAAgB,CAAC;QACtB,QAAQ;QACR,QAAQ;QACR,SAAS;QACT,MAAM,EAAE,IAAmD;KAC5D,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAO,EAAE,EAAE,CAAC,IAAI,CAAC,8BAA8B,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AACpG,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAO,EAAE,EAAE,CAAC,IAAI,CAAC,8BAA8B,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AACpG,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAO,EAAE,EAAE,CAAC,IAAI,CAAC,sBAAsB,EAAE,QAAQ,E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AO,EAAE,EAAE,CAC1C,IAAI,CAAC,kCAAkC,EAAE,oBAAoB,EAAE,CAAC,CAAC,CAAC;AACpE,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAO,EAAE,EAAE,CAAC,IAAI,CAAC,0BAA0B,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;AACxF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAO,EAAE,EAAE,CAAC,IAAI,CAAC,2BAA2B,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC;AAC3F,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAO,EAAE,EAAE,CACvC,IAAI,CAAC,8BAA8B,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-deregister.d.ts","sourceRoot":"","sources":["../../src/tools/key-deregister.ts"],"names":[],"mappings":"AAEA,wBAAsB,aAAa,CAAC,MAAM,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"key-deregister.d.ts","sourceRoot":"","sources":["../../src/tools/key-deregister.ts"],"names":[],"mappings":"AAEA,wBAAsB,aAAa,CAAC,MAAM,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAMhF"}
|
package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-deregister.js
CHANGED
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { selectKeyStore } from "../lib/key-store.js";
|
|
2
2
|
export async function keyDeregister(params) {
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const result = await session.run(`MATCH (k:PropertyDataKey {accountId: $accountId})
|
|
7
|
-
DELETE k
|
|
8
|
-
RETURN count(k) AS deleted`, { accountId });
|
|
9
|
-
const deleted = result.records[0]?.get("deleted")?.toNumber?.() ?? 0;
|
|
10
|
-
if (deleted === 0) {
|
|
11
|
-
throw new Error("No PropertyData API key is registered for this account.");
|
|
12
|
-
}
|
|
3
|
+
const deleted = await selectKeyStore().delete(params.accountId);
|
|
4
|
+
if (!deleted) {
|
|
5
|
+
throw new Error("No PropertyData API key is registered for this account.");
|
|
13
6
|
}
|
|
14
|
-
|
|
15
|
-
await session.close();
|
|
16
|
-
}
|
|
17
|
-
console.error(`[property-data] key-op op=deregister account=${accountId}`);
|
|
7
|
+
console.error(`[property-data] key-op op=deregister account=${params.accountId}`);
|
|
18
8
|
}
|
|
19
9
|
//# sourceMappingURL=key-deregister.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-deregister.js","sourceRoot":"","sources":["../../src/tools/key-deregister.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"key-deregister.js","sourceRoot":"","sources":["../../src/tools/key-deregister.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,MAA6B;IAC/D,MAAM,OAAO,GAAG,MAAM,cAAc,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAChE,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IACD,OAAO,CAAC,KAAK,CAAC,gDAAgD,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;AACpF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-register.d.ts","sourceRoot":"","sources":["../../src/tools/key-register.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"key-register.d.ts","sourceRoot":"","sources":["../../src/tools/key-register.ts"],"names":[],"mappings":"AA6CA,wBAAsB,WAAW,CAAC,MAAM,EAAE;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CAKhB"}
|
package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-register.js
CHANGED
|
@@ -1,43 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { encrypt } from "../lib/crypto.js";
|
|
1
|
+
import { selectKeyStore } from "../lib/key-store.js";
|
|
3
2
|
import { PropertyDataError } from "../lib/propertydata-api.js";
|
|
4
3
|
const BASE_URL = "https://api.propertydata.co.uk";
|
|
5
4
|
const REQUEST_TIMEOUT_MS = 15_000;
|
|
6
|
-
// Validate
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
// key
|
|
10
|
-
//
|
|
5
|
+
// Validate the key against PropertyData's /valuation-sale endpoint with no
|
|
6
|
+
// inputs — a valid key returns HTTP 400 + body code 701 "Missing input:
|
|
7
|
+
// property_type" (proof the key was accepted), without consuming a credit.
|
|
8
|
+
// An invalid key returns auth failure (401/403) or a different upstream code.
|
|
9
|
+
// Evidence: probing `/national-hpi` returns code X01 "Invalid API endpoint"
|
|
10
|
+
// — that path does not exist on PropertyData; `/valuation-sale` does.
|
|
11
11
|
async function validateApiKey(apiKey) {
|
|
12
|
-
|
|
12
|
+
// Probe /valuation-sale with one input. Evidence-backed envelopes:
|
|
13
|
+
// invalid key → {code:"X03", message:"Invalid input: key"}
|
|
14
|
+
// valid key → {code:"701", message:"Missing input: property_type"} (no credit)
|
|
15
|
+
// PropertyData does not charge for missing-input errors, so this is a free probe.
|
|
16
|
+
const url = `${BASE_URL}/valuation-sale?key=${encodeURIComponent(apiKey)}&postcode=SW1A1AA`;
|
|
13
17
|
const response = await fetch(url, {
|
|
14
18
|
headers: { Accept: "application/json" },
|
|
15
19
|
signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
|
|
16
20
|
});
|
|
21
|
+
const body = await response.text().catch(() => "");
|
|
17
22
|
if (response.status === 401 || response.status === 403) {
|
|
18
23
|
throw new Error(`PropertyData rejected the API key (HTTP ${response.status}).`);
|
|
19
24
|
}
|
|
25
|
+
let parsed = {};
|
|
26
|
+
try {
|
|
27
|
+
parsed = JSON.parse(body);
|
|
28
|
+
}
|
|
29
|
+
catch { /* fall through */ }
|
|
30
|
+
if (parsed.code === "X03") {
|
|
31
|
+
throw new Error(`PropertyData rejected the API key (code=X03 ${parsed.message ?? "Invalid input: key"}).`);
|
|
32
|
+
}
|
|
33
|
+
// 701 (missing-input) or status:"success" both prove the key was authenticated.
|
|
34
|
+
// Any other envelope: surface raw so the operator sees the upstream error.
|
|
35
|
+
if (parsed.status === "success" || parsed.code === "701")
|
|
36
|
+
return;
|
|
37
|
+
if (parsed.status === "error") {
|
|
38
|
+
throw new Error(`PropertyData validate probe returned unexpected envelope (code=${parsed.code ?? "?"} message=${parsed.message ?? "?"}).`);
|
|
39
|
+
}
|
|
20
40
|
if (!response.ok) {
|
|
21
|
-
|
|
22
|
-
throw new PropertyDataError(response.status, "national-hpi", body.slice(0, 200));
|
|
41
|
+
throw new PropertyDataError(response.status, "valuation-sale", body.slice(0, 200));
|
|
23
42
|
}
|
|
24
43
|
}
|
|
25
44
|
export async function keyRegister(params) {
|
|
26
45
|
const { apiKey, accountId } = params;
|
|
27
46
|
await validateApiKey(apiKey);
|
|
28
|
-
|
|
29
|
-
const now = new Date().toISOString();
|
|
30
|
-
const session = getSession();
|
|
31
|
-
try {
|
|
32
|
-
await session.run(`CREATE INDEX property_data_key_account IF NOT EXISTS
|
|
33
|
-
FOR (k:PropertyDataKey) ON (k.accountId)`, {});
|
|
34
|
-
await session.run(`MERGE (k:PropertyDataKey {accountId: $accountId})
|
|
35
|
-
ON CREATE SET k.encryptedKey = $encryptedKey, k.createdAt = $now, k.updatedAt = $now
|
|
36
|
-
ON MATCH SET k.encryptedKey = $encryptedKey, k.updatedAt = $now`, { accountId, encryptedKey, now });
|
|
37
|
-
}
|
|
38
|
-
finally {
|
|
39
|
-
await session.close();
|
|
40
|
-
}
|
|
47
|
+
await selectKeyStore().save(accountId, apiKey);
|
|
41
48
|
console.error(`[property-data] key-op op=register account=${accountId}`);
|
|
42
49
|
}
|
|
43
50
|
//# sourceMappingURL=key-register.js.map
|
package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/key-register.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key-register.js","sourceRoot":"","sources":["../../src/tools/key-register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"key-register.js","sourceRoot":"","sources":["../../src/tools/key-register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AAClD,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAElC,2EAA2E;AAC3E,wEAAwE;AACxE,2EAA2E;AAC3E,8EAA8E;AAC9E,4EAA4E;AAC5E,sEAAsE;AAEtE,KAAK,UAAU,cAAc,CAAC,MAAc;IAC1C,mEAAmE;IACnE,6DAA6D;IAC7D,mFAAmF;IACnF,kFAAkF;IAClF,MAAM,GAAG,GAAG,GAAG,QAAQ,uBAAuB,kBAAkB,CAAC,MAAM,CAAC,mBAAmB,CAAC;IAC5F,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;QAChC,OAAO,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE;QACvC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,kBAAkB,CAAC;KAChD,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;IACnD,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;Q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