@rubytech/create-maxy-code 0.1.59 → 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/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/property-data/PLUGIN.md +14 -1
- package/payload/platform/plugins/property-data/mcp/dist/index.js +14 -11
- 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.map +1 -1
- package/payload/platform/plugins/property-data/mcp/dist/tools/endpoints.js +2 -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/index.ts +16 -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 +2 -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/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/property-data/PLUGIN.md +14 -1
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/index.js +14 -11
- 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.map +1 -1
- package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/tools/endpoints.js +2 -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/index.ts +16 -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 +2 -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/server/public/assets/{admin-nqCBFiSl.js → admin-Bp-BjBCX.js} +51 -51
- package/payload/server/public/index.html +1 -1
- package/payload/server/server.js +4 -3
- 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,221 @@
|
|
|
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
|
+
|
|
8
|
+
// Storage abstraction so the same MCP body runs against Neo4j (platform mode)
|
|
9
|
+
// or an on-disk encrypted file (standalone mode, spawned by Claude Code from
|
|
10
|
+
// ~/.claude/). Selected by LOOP_STANDALONE at boot. Loop is multi-team — each
|
|
11
|
+
// account can register many team keys — so the file backend stores a nested
|
|
12
|
+
// map and the store API mirrors that.
|
|
13
|
+
|
|
14
|
+
export interface LoopStoredKey {
|
|
15
|
+
teamName: string;
|
|
16
|
+
apiKey: string;
|
|
17
|
+
teamAddress: string;
|
|
18
|
+
agentId: string;
|
|
19
|
+
permissions: string[];
|
|
20
|
+
createdAt: string;
|
|
21
|
+
updatedAt: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type LoopKeyInput = Omit<LoopStoredKey, "createdAt" | "updatedAt">;
|
|
25
|
+
|
|
26
|
+
export interface LoopKeyStore {
|
|
27
|
+
readonly backendName: string;
|
|
28
|
+
readonly backendPath: string;
|
|
29
|
+
loadAll(accountId: string): Promise<LoopStoredKey[]>;
|
|
30
|
+
save(accountId: string, key: LoopKeyInput): Promise<{ created: boolean }>;
|
|
31
|
+
delete(accountId: string, teamName: string): Promise<boolean>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
class Neo4jLoopKeyStore implements LoopKeyStore {
|
|
35
|
+
readonly backendName = "neo4j";
|
|
36
|
+
readonly backendPath = process.env.NEO4J_URI ?? "<unset>";
|
|
37
|
+
|
|
38
|
+
async loadAll(accountId: string): Promise<LoopStoredKey[]> {
|
|
39
|
+
const session = getSession();
|
|
40
|
+
try {
|
|
41
|
+
const result = await session.run(
|
|
42
|
+
`MATCH (k:LoopTeamKey {accountId: $accountId})
|
|
43
|
+
RETURN k.teamName AS teamName, k.encryptedKey AS encryptedKey,
|
|
44
|
+
k.teamAddress AS teamAddress, k.agentId AS agentId,
|
|
45
|
+
k.permissions AS permissions, k.createdAt AS createdAt,
|
|
46
|
+
k.updatedAt AS updatedAt
|
|
47
|
+
ORDER BY k.teamName`,
|
|
48
|
+
{ accountId },
|
|
49
|
+
);
|
|
50
|
+
return result.records.map((r) => ({
|
|
51
|
+
teamName: r.get("teamName"),
|
|
52
|
+
apiKey: decrypt(r.get("encryptedKey")),
|
|
53
|
+
teamAddress: r.get("teamAddress") ?? "",
|
|
54
|
+
agentId: r.get("agentId") ?? "",
|
|
55
|
+
permissions: r.get("permissions") ?? [],
|
|
56
|
+
createdAt: r.get("createdAt") ?? "",
|
|
57
|
+
updatedAt: r.get("updatedAt") ?? "",
|
|
58
|
+
}));
|
|
59
|
+
} finally {
|
|
60
|
+
await session.close();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async save(accountId: string, key: LoopKeyInput): Promise<{ created: boolean }> {
|
|
65
|
+
const encryptedKey = encrypt(key.apiKey);
|
|
66
|
+
const now = new Date().toISOString();
|
|
67
|
+
const session = getSession();
|
|
68
|
+
try {
|
|
69
|
+
await session.run(
|
|
70
|
+
`CREATE INDEX loop_team_key_account_team IF NOT EXISTS
|
|
71
|
+
FOR (k:LoopTeamKey) ON (k.accountId, k.teamName)`,
|
|
72
|
+
{},
|
|
73
|
+
);
|
|
74
|
+
const result = await session.run(
|
|
75
|
+
`MERGE (k:LoopTeamKey {teamName: $teamName, accountId: $accountId})
|
|
76
|
+
ON CREATE SET
|
|
77
|
+
k.encryptedKey = $encryptedKey,
|
|
78
|
+
k.teamAddress = $teamAddress,
|
|
79
|
+
k.agentId = $agentId,
|
|
80
|
+
k.permissions = $permissions,
|
|
81
|
+
k.createdAt = $now,
|
|
82
|
+
k.updatedAt = $now
|
|
83
|
+
RETURN k.createdAt = $now AS created`,
|
|
84
|
+
{
|
|
85
|
+
teamName: key.teamName,
|
|
86
|
+
encryptedKey,
|
|
87
|
+
teamAddress: key.teamAddress,
|
|
88
|
+
agentId: key.agentId,
|
|
89
|
+
accountId,
|
|
90
|
+
permissions: key.permissions,
|
|
91
|
+
now,
|
|
92
|
+
},
|
|
93
|
+
);
|
|
94
|
+
return { created: Boolean(result.records[0]?.get("created")) };
|
|
95
|
+
} finally {
|
|
96
|
+
await session.close();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
async delete(accountId: string, teamName: string): Promise<boolean> {
|
|
101
|
+
const session = getSession();
|
|
102
|
+
try {
|
|
103
|
+
const result = await session.run(
|
|
104
|
+
`MATCH (k:LoopTeamKey {teamName: $teamName, accountId: $accountId})
|
|
105
|
+
DELETE k
|
|
106
|
+
RETURN count(k) AS deleted`,
|
|
107
|
+
{ teamName, accountId },
|
|
108
|
+
);
|
|
109
|
+
const deleted = result.records[0]?.get("deleted")?.toNumber?.() ?? 0;
|
|
110
|
+
return deleted > 0;
|
|
111
|
+
} finally {
|
|
112
|
+
await session.close();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const LABEL = "loop";
|
|
118
|
+
|
|
119
|
+
interface FileEnvelope {
|
|
120
|
+
[accountId: string]: {
|
|
121
|
+
[teamName: string]: {
|
|
122
|
+
encryptedKey: string;
|
|
123
|
+
teamAddress: string;
|
|
124
|
+
agentId: string;
|
|
125
|
+
permissions: string[];
|
|
126
|
+
createdAt: string;
|
|
127
|
+
updatedAt: string;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
class FileLoopKeyStore implements LoopKeyStore {
|
|
133
|
+
readonly backendName = "file";
|
|
134
|
+
readonly backendPath: string;
|
|
135
|
+
private readonly storePath: string;
|
|
136
|
+
private readonly keyFilePath: string;
|
|
137
|
+
|
|
138
|
+
constructor() {
|
|
139
|
+
const home = homedir();
|
|
140
|
+
this.storePath = resolve(home, ".claude/.realagent-loop-key.enc");
|
|
141
|
+
this.keyFilePath = resolve(home, ".claude/.realagent-loop-encryption-key");
|
|
142
|
+
this.backendPath = this.storePath;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
private ensureDir(): void {
|
|
146
|
+
mkdirSync(dirname(this.storePath), { recursive: true });
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
private readAll(): FileEnvelope {
|
|
150
|
+
if (!existsSync(this.storePath)) return {};
|
|
151
|
+
const blob = readFileSync(this.storePath, "utf-8").trim();
|
|
152
|
+
if (!blob) return {};
|
|
153
|
+
const json = decryptWith(blob, this.keyFilePath, LABEL);
|
|
154
|
+
return JSON.parse(json) as FileEnvelope;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
private writeAll(env: FileEnvelope): void {
|
|
158
|
+
this.ensureDir();
|
|
159
|
+
const blob = encryptWith(JSON.stringify(env), this.keyFilePath, LABEL);
|
|
160
|
+
writeFileSync(this.storePath, blob, { mode: 0o600 });
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
async loadAll(accountId: string): Promise<LoopStoredKey[]> {
|
|
164
|
+
const env = this.readAll();
|
|
165
|
+
const account = env[accountId];
|
|
166
|
+
if (!account) return [];
|
|
167
|
+
return Object.entries(account)
|
|
168
|
+
.map(([teamName, entry]) => ({
|
|
169
|
+
teamName,
|
|
170
|
+
apiKey: decryptWith(entry.encryptedKey, this.keyFilePath, LABEL),
|
|
171
|
+
teamAddress: entry.teamAddress,
|
|
172
|
+
agentId: entry.agentId,
|
|
173
|
+
permissions: entry.permissions,
|
|
174
|
+
createdAt: entry.createdAt,
|
|
175
|
+
updatedAt: entry.updatedAt,
|
|
176
|
+
}))
|
|
177
|
+
.sort((a, b) => a.teamName.localeCompare(b.teamName));
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
async save(accountId: string, key: LoopKeyInput): Promise<{ created: boolean }> {
|
|
181
|
+
const env = this.readAll();
|
|
182
|
+
const account = env[accountId] ?? {};
|
|
183
|
+
const prev = account[key.teamName];
|
|
184
|
+
const now = new Date().toISOString();
|
|
185
|
+
const encryptedKey = encryptWith(key.apiKey, this.keyFilePath, LABEL);
|
|
186
|
+
account[key.teamName] = {
|
|
187
|
+
encryptedKey,
|
|
188
|
+
teamAddress: key.teamAddress,
|
|
189
|
+
agentId: key.agentId,
|
|
190
|
+
permissions: key.permissions,
|
|
191
|
+
createdAt: prev?.createdAt ?? now,
|
|
192
|
+
updatedAt: now,
|
|
193
|
+
};
|
|
194
|
+
env[accountId] = account;
|
|
195
|
+
this.writeAll(env);
|
|
196
|
+
return { created: !prev };
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
async delete(accountId: string, teamName: string): Promise<boolean> {
|
|
200
|
+
const env = this.readAll();
|
|
201
|
+
const account = env[accountId];
|
|
202
|
+
if (!account || !(teamName in account)) return false;
|
|
203
|
+
delete account[teamName];
|
|
204
|
+
if (Object.keys(account).length === 0) delete env[accountId];
|
|
205
|
+
else env[accountId] = account;
|
|
206
|
+
this.writeAll(env);
|
|
207
|
+
return true;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
let cached: LoopKeyStore | null = null;
|
|
212
|
+
|
|
213
|
+
export function selectLoopKeyStore(): LoopKeyStore {
|
|
214
|
+
if (cached) return cached;
|
|
215
|
+
cached = process.env.LOOP_STANDALONE === "1" ? new FileLoopKeyStore() : new Neo4jLoopKeyStore();
|
|
216
|
+
return cached;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export function _resetKeyStoreForTests(): void {
|
|
220
|
+
cached = null;
|
|
221
|
+
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { decrypt } from "./crypto.js";
|
|
1
|
+
import { selectLoopKeyStore } from "./key-store.js";
|
|
3
2
|
|
|
4
3
|
// ─────────────────────────────────────────────────────────────────
|
|
5
4
|
// Loop API V2 HTTP Client + Cross-Team Aggregation Engine
|
|
@@ -90,7 +89,7 @@ function unwrapEnvelope<T>(parsed: unknown, toolName: string, teamName: string):
|
|
|
90
89
|
|
|
91
90
|
export interface LoopTeamKey {
|
|
92
91
|
teamName: string;
|
|
93
|
-
|
|
92
|
+
apiKey: string;
|
|
94
93
|
teamAddress: string;
|
|
95
94
|
agentId: string;
|
|
96
95
|
permissions: string[];
|
|
@@ -120,29 +119,7 @@ export interface AggregationResult<T> {
|
|
|
120
119
|
* Load all LoopTeamKey nodes for an account from Neo4j.
|
|
121
120
|
*/
|
|
122
121
|
export async function loadTeamKeys(accountId: string): Promise<LoopTeamKey[]> {
|
|
123
|
-
|
|
124
|
-
try {
|
|
125
|
-
const result = await session.run(
|
|
126
|
-
`MATCH (k:LoopTeamKey {accountId: $accountId})
|
|
127
|
-
RETURN k.teamName AS teamName, k.encryptedKey AS encryptedKey,
|
|
128
|
-
k.teamAddress AS teamAddress, k.agentId AS agentId,
|
|
129
|
-
k.permissions AS permissions, k.createdAt AS createdAt,
|
|
130
|
-
k.updatedAt AS updatedAt
|
|
131
|
-
ORDER BY k.teamName`,
|
|
132
|
-
{ accountId }
|
|
133
|
-
);
|
|
134
|
-
return result.records.map((r) => ({
|
|
135
|
-
teamName: r.get("teamName"),
|
|
136
|
-
encryptedKey: r.get("encryptedKey"),
|
|
137
|
-
teamAddress: r.get("teamAddress") ?? "",
|
|
138
|
-
agentId: r.get("agentId") ?? "",
|
|
139
|
-
permissions: r.get("permissions") ?? [],
|
|
140
|
-
createdAt: r.get("createdAt") ?? "",
|
|
141
|
-
updatedAt: r.get("updatedAt") ?? "",
|
|
142
|
-
}));
|
|
143
|
-
} finally {
|
|
144
|
-
await session.close();
|
|
145
|
-
}
|
|
122
|
+
return selectLoopKeyStore().loadAll(accountId);
|
|
146
123
|
}
|
|
147
124
|
|
|
148
125
|
// Truncate to 200 chars, escape newlines, single line — `[loop] <tool> team=<t>
|
|
@@ -396,20 +373,7 @@ export async function aggregateAcrossTeams<T>(
|
|
|
396
373
|
continue;
|
|
397
374
|
}
|
|
398
375
|
|
|
399
|
-
|
|
400
|
-
try {
|
|
401
|
-
apiKey = decrypt(key.encryptedKey);
|
|
402
|
-
} catch (err) {
|
|
403
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
404
|
-
console.error(`[loop] decrypt failed for team=${key.teamName}: ${msg}`);
|
|
405
|
-
failures.push({
|
|
406
|
-
teamName: key.teamName,
|
|
407
|
-
reason: "Decryption failed",
|
|
408
|
-
kind: "other",
|
|
409
|
-
});
|
|
410
|
-
continue;
|
|
411
|
-
}
|
|
412
|
-
|
|
376
|
+
const apiKey = key.apiKey;
|
|
413
377
|
const teamName = key.teamName;
|
|
414
378
|
tasks.push({
|
|
415
379
|
key,
|
|
@@ -512,8 +476,7 @@ export async function withTeamKey<T>(
|
|
|
512
476
|
);
|
|
513
477
|
}
|
|
514
478
|
|
|
515
|
-
|
|
516
|
-
return execute(apiKey);
|
|
479
|
+
return execute(key.apiKey);
|
|
517
480
|
}
|
|
518
481
|
|
|
519
482
|
/**
|
|
@@ -1,27 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { selectLoopKeyStore } from "../lib/key-store.js";
|
|
2
2
|
|
|
3
3
|
export async function keyDeregister(params: {
|
|
4
4
|
teamName: string;
|
|
5
5
|
accountId: string;
|
|
6
6
|
}): Promise<void> {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
try {
|
|
11
|
-
const result = await session.run(
|
|
12
|
-
`MATCH (k:LoopTeamKey {teamName: $teamName, accountId: $accountId})
|
|
13
|
-
DELETE k
|
|
14
|
-
RETURN count(k) AS deleted`,
|
|
15
|
-
{ teamName, accountId }
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
const deleted = result.records[0]?.get("deleted")?.toNumber?.() ?? 0;
|
|
19
|
-
if (deleted === 0) {
|
|
20
|
-
throw new Error(`Team "${teamName}" not found.`);
|
|
21
|
-
}
|
|
22
|
-
} finally {
|
|
23
|
-
await session.close();
|
|
7
|
+
const deleted = await selectLoopKeyStore().delete(params.accountId, params.teamName);
|
|
8
|
+
if (!deleted) {
|
|
9
|
+
throw new Error(`Team "${params.teamName}" not found.`);
|
|
24
10
|
}
|
|
25
|
-
|
|
26
|
-
console.error(`[loop] key-deregister team=${teamName} account=${accountId}`);
|
|
11
|
+
console.error(`[loop] key-deregister team=${params.teamName} account=${params.accountId}`);
|
|
27
12
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { encrypt } from "../lib/crypto.js";
|
|
1
|
+
import { selectLoopKeyStore } from "../lib/key-store.js";
|
|
3
2
|
import { loopGet, LoopApiError } from "../lib/loop-api.js";
|
|
4
3
|
|
|
5
4
|
interface LoopTeamResponse {
|
|
@@ -21,7 +20,7 @@ export async function keyRegister(params: {
|
|
|
21
20
|
const { teamName, apiKey, accountId } = params;
|
|
22
21
|
const permissions = params.permissions ?? ALL_PERMISSIONS;
|
|
23
22
|
|
|
24
|
-
// Validate key against Loop API — try /team endpoint
|
|
23
|
+
// Validate key against Loop API — try /team endpoint.
|
|
25
24
|
let teamAddress = "";
|
|
26
25
|
let agentId = "";
|
|
27
26
|
let warning: string | undefined;
|
|
@@ -31,11 +30,10 @@ export async function keyRegister(params: {
|
|
|
31
30
|
apiKey,
|
|
32
31
|
"/team",
|
|
33
32
|
"loop-key-register",
|
|
34
|
-
teamName
|
|
33
|
+
teamName,
|
|
35
34
|
);
|
|
36
35
|
|
|
37
36
|
if (Array.isArray(teamData) && teamData.length === 0) {
|
|
38
|
-
// 204 was converted to empty array — ambiguous scope
|
|
39
37
|
warning =
|
|
40
38
|
"Key accepted but Loop returned no team data (204). " +
|
|
41
39
|
"Verify the key's scope in Loop's dashboard.";
|
|
@@ -47,49 +45,26 @@ export async function keyRegister(params: {
|
|
|
47
45
|
if (err instanceof LoopApiError && err.status === 401) {
|
|
48
46
|
throw new Error(
|
|
49
47
|
`Loop API rejected the key for team "${teamName}" (HTTP 401). ` +
|
|
50
|
-
|
|
48
|
+
`Check that the key is valid and not expired.`,
|
|
51
49
|
);
|
|
52
50
|
}
|
|
53
|
-
// Network/timeout errors — still reject, key is unverified
|
|
54
51
|
throw new Error(
|
|
55
|
-
`Could not validate key against Loop API: ${err instanceof Error ? err.message : String(err)}
|
|
52
|
+
`Could not validate key against Loop API: ${err instanceof Error ? err.message : String(err)}`,
|
|
56
53
|
);
|
|
57
54
|
}
|
|
58
55
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
const { created } = await selectLoopKeyStore().save(accountId, {
|
|
57
|
+
teamName,
|
|
58
|
+
apiKey,
|
|
59
|
+
teamAddress,
|
|
60
|
+
agentId,
|
|
61
|
+
permissions,
|
|
62
|
+
});
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
await writeSession.run(
|
|
66
|
-
`CREATE INDEX loop_team_key_account_team IF NOT EXISTS
|
|
67
|
-
FOR (k:LoopTeamKey) ON (k.accountId, k.teamName)`,
|
|
68
|
-
{}
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
const mergeResult = await writeSession.run(
|
|
72
|
-
`MERGE (k:LoopTeamKey {teamName: $teamName, accountId: $accountId})
|
|
73
|
-
ON CREATE SET
|
|
74
|
-
k.encryptedKey = $encryptedKey,
|
|
75
|
-
k.teamAddress = $teamAddress,
|
|
76
|
-
k.agentId = $agentId,
|
|
77
|
-
k.permissions = $permissions,
|
|
78
|
-
k.createdAt = $now,
|
|
79
|
-
k.updatedAt = $now
|
|
80
|
-
RETURN k.createdAt = $now AS created`,
|
|
81
|
-
{ teamName, encryptedKey, teamAddress, agentId, accountId, permissions, now }
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
const created = mergeResult.records[0]?.get("created");
|
|
85
|
-
if (!created) {
|
|
86
|
-
throw new Error(`Team "${teamName}" is already registered for this account.`);
|
|
87
|
-
}
|
|
88
|
-
} finally {
|
|
89
|
-
await writeSession.close();
|
|
64
|
+
if (!created) {
|
|
65
|
+
throw new Error(`Team "${teamName}" is already registered for this account.`);
|
|
90
66
|
}
|
|
91
67
|
|
|
92
68
|
console.error(`[loop] key-register team=${teamName} account=${accountId}`);
|
|
93
|
-
|
|
94
69
|
return { warning };
|
|
95
70
|
}
|
|
@@ -87,7 +87,20 @@ Local stdio MCP that proxies the PropertyData UK market-analytics HTTP API (prop
|
|
|
87
87
|
|
|
88
88
|
## Security
|
|
89
89
|
|
|
90
|
-
The PropertyData API key is encrypted at rest with AES-256-GCM.
|
|
90
|
+
The PropertyData API key is encrypted at rest with AES-256-GCM. The encryption-key file lives at `~/<configDir>/.property-data-encryption-key` (platform mode) or `~/.claude/.realagent-property-data-encryption-key` (standalone mode), both with mode `0600`. Never include the key value in responses; identify the key by registration timestamp only. If the operator asks for the key value, explain that keys are encrypted and cannot be retrieved — they must be re-registered from the PropertyData dashboard.
|
|
91
|
+
|
|
92
|
+
## Standalone mode (`~/.claude/` spawn)
|
|
93
|
+
|
|
94
|
+
The same `mcp/dist/index.js` boots in two environments, selected by env flag:
|
|
95
|
+
|
|
96
|
+
| Env var | Platform mode | Standalone mode |
|
|
97
|
+
|---|---|---|
|
|
98
|
+
| `PROPERTY_DATA_STANDALONE` | unset | `"1"` |
|
|
99
|
+
| `ACCOUNT_ID` | platform tenant id | absent (defaults to `"local"`) |
|
|
100
|
+
| `NEO4J_URI` etc. | required | unused |
|
|
101
|
+
| `PROPERTY_DATA_API_KEY` | unused | optional one-shot bypass (skips the store entirely) |
|
|
102
|
+
|
|
103
|
+
In standalone mode keys live at `~/.claude/.realagent-property-data-key.enc`. See `.docs/realagent-mcps-standalone-mode.md` for the full contract.
|
|
91
104
|
|
|
92
105
|
## When to use these tools
|
|
93
106
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// Logging-tee was a platform-wrapper concern: the platform's mcp-spawn-tee
|
|
2
|
+
// pipes our stderr where it wants. In standalone mode (Claude Code native
|
|
3
|
+
// spawn) the host owns the stderr pipe. Either way, we just write to stderr.
|
|
3
4
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
4
5
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
5
6
|
import { z } from "zod";
|
|
@@ -9,15 +10,17 @@ import { keyList } from "./tools/key-list.js";
|
|
|
9
10
|
import { valuationSale, valuationRent, prices, pricesRent, soldPrices, demand, yields, growth, nationalHpi, pricesPerSqf, soldPricesPerSqf, crime, floodRisk, councilTax, planningApplications, addressMatchUprn, growthPsf, demandRent, propertyTypes, } from "./tools/endpoints.js";
|
|
10
11
|
import { closeDriver } from "./lib/neo4j.js";
|
|
11
12
|
import { KeyNotRegisteredError, PropertyDataError, BadResponseError, } from "./lib/propertydata-api.js";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
import { selectKeyStore } from "./lib/key-store.js";
|
|
14
|
+
// ACCOUNT_ID is the platform's tenant id; in standalone mode (Claude Code
|
|
15
|
+
// native spawn) there is no platform tenant, so "local" is the single-tenant
|
|
16
|
+
// stand-in. Same MCP body, env-selected backend.
|
|
17
|
+
const accountId = process.env.ACCOUNT_ID ?? "local";
|
|
16
18
|
const server = new McpServer({
|
|
17
19
|
name: "maxy-property-data",
|
|
18
20
|
version: "0.1.0",
|
|
19
21
|
});
|
|
20
|
-
|
|
22
|
+
const store = selectKeyStore();
|
|
23
|
+
console.error(`[property-data] server started, account=${accountId} backend=${store.backendName} path=${store.backendPath}`);
|
|
21
24
|
function errorEnvelope(err) {
|
|
22
25
|
let text;
|
|
23
26
|
if (err instanceof KeyNotRegisteredError) {
|
|
@@ -38,7 +41,7 @@ function errorEnvelope(err) {
|
|
|
38
41
|
function endpointHandler(fn) {
|
|
39
42
|
return async (params) => {
|
|
40
43
|
try {
|
|
41
|
-
const text = await fn({ ...params, accountId
|
|
44
|
+
const text = await fn({ ...params, accountId });
|
|
42
45
|
return { content: [{ type: "text", text }] };
|
|
43
46
|
}
|
|
44
47
|
catch (err) {
|
|
@@ -53,7 +56,7 @@ server.tool("property-data-key-register", "Register the account's PropertyData A
|
|
|
53
56
|
apiKey: z.string().min(8).describe("PropertyData API key from propertydata.co.uk dashboard"),
|
|
54
57
|
}, async ({ apiKey }) => {
|
|
55
58
|
try {
|
|
56
|
-
await keyRegister({ apiKey, accountId
|
|
59
|
+
await keyRegister({ apiKey, accountId });
|
|
57
60
|
return {
|
|
58
61
|
content: [
|
|
59
62
|
{
|
|
@@ -69,7 +72,7 @@ server.tool("property-data-key-register", "Register the account's PropertyData A
|
|
|
69
72
|
});
|
|
70
73
|
server.tool("property-data-key-deregister", "Remove the account's PropertyData API key. The encrypted key is permanently deleted from Neo4j.", {}, async () => {
|
|
71
74
|
try {
|
|
72
|
-
await keyDeregister({ accountId
|
|
75
|
+
await keyDeregister({ accountId });
|
|
73
76
|
return {
|
|
74
77
|
content: [{ type: "text", text: "PropertyData API key deregistered." }],
|
|
75
78
|
};
|
|
@@ -80,7 +83,7 @@ server.tool("property-data-key-deregister", "Remove the account's PropertyData A
|
|
|
80
83
|
});
|
|
81
84
|
server.tool("property-data-key-list", "Show whether a PropertyData API key is registered for this account. Never reveals the key value.", {}, async () => {
|
|
82
85
|
try {
|
|
83
|
-
const text = await keyList({ accountId
|
|
86
|
+
const text = await keyList({ accountId });
|
|
84
87
|
return { content: [{ type: "text", text }] };
|
|
85
88
|
}
|
|
86
89
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,0EAA0E;AAC1E,6EAA6E;AAE7E,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EACL,aAAa,EACb,aAAa,EACb,MAAM,EACN,UAAU,EACV,UAAU,EACV,MAAM,EACN,MAAM,EACN,MAAM,EACN,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,KAAK,EACL,SAAS,EACT,UAAU,EACV,oBAAoB,EACpB,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,aAAa,GACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,0EAA0E;AAC1E,6EAA6E;AAC7E,iDAAiD;AAC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IAAI,CACT,2BAA2B,EAC3B,oNAAoN,EACpN;IACE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,+BAA+B,CAAC;IACrE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;IAChF,IAAI,EAAE,CAAC;SACJ,IAAI,CAAC,CAAC,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;SACvD,QAAQ,EAAE;SACV,QAAQ,CAAC,yBAAyB,CAAC;CACvC,EACD,eAAe,CAAC,UAAU,CAAC,CAC5B,CAAC;AAEF,MAAM,CAAC,IAAI,CACT,8BAA8B,EAC9B,yMAAyM,EACzM;IACE,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,+BAA+B,CAAC;CACtE,EACD,eAAe,CAAC,aAAa,CAAC,CAC/B,CAAC;AAEF,oEAAoE;AACpE,YAAY;AACZ,oEAAoE;AAEpE,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC9B,MAAM,WAAW,EAAE,CAAC;IACpB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
|
package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/file-crypto.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-crypto.d.ts","sourceRoot":"","sources":["../../src/lib/file-crypto.ts"],"names":[],"mappings":"AA8BA,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQzF;AAED,wBAAgB,WAAW,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAc9F"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { randomBytes, createCipheriv, createDecipheriv } from "node:crypto";
|
|
2
|
+
import { readFileSync, writeFileSync, existsSync } from "node:fs";
|
|
3
|
+
// Standalone-mode crypto. Same AES-256-GCM envelope as crypto.ts, but the
|
|
4
|
+
// encryption-key file path is passed in (not derived from PLATFORM_ROOT /
|
|
5
|
+
// brand.json), so it can live under ~/.claude/ when the MCP is spawned by
|
|
6
|
+
// Claude Code natively.
|
|
7
|
+
const ALGORITHM = "aes-256-gcm";
|
|
8
|
+
const KEY_LENGTH = 32;
|
|
9
|
+
const IV_LENGTH = 12;
|
|
10
|
+
const AUTH_TAG_LENGTH = 16;
|
|
11
|
+
function loadOrGenerateKey(keyFilePath, label) {
|
|
12
|
+
if (existsSync(keyFilePath)) {
|
|
13
|
+
const hex = readFileSync(keyFilePath, "utf-8").trim();
|
|
14
|
+
const buf = Buffer.from(hex, "hex");
|
|
15
|
+
if (buf.length !== KEY_LENGTH) {
|
|
16
|
+
throw new Error(`[${label}] encryption key at ${keyFilePath} is ${buf.length} bytes, expected ${KEY_LENGTH}.`);
|
|
17
|
+
}
|
|
18
|
+
return buf;
|
|
19
|
+
}
|
|
20
|
+
const key = randomBytes(KEY_LENGTH);
|
|
21
|
+
writeFileSync(keyFilePath, key.toString("hex"), { mode: 0o600 });
|
|
22
|
+
console.error(`[${label}] encryption key generated at ${keyFilePath}`);
|
|
23
|
+
return key;
|
|
24
|
+
}
|
|
25
|
+
export function encryptWith(plaintext, keyFilePath, label) {
|
|
26
|
+
const key = loadOrGenerateKey(keyFilePath, label);
|
|
27
|
+
const iv = randomBytes(IV_LENGTH);
|
|
28
|
+
const cipher = createCipheriv(ALGORITHM, key, iv, { authTagLength: AUTH_TAG_LENGTH });
|
|
29
|
+
let encrypted = cipher.update(plaintext, "utf-8", "hex");
|
|
30
|
+
encrypted += cipher.final("hex");
|
|
31
|
+
const authTag = cipher.getAuthTag().toString("hex");
|
|
32
|
+
return `${iv.toString("hex")}:${encrypted}:${authTag}`;
|
|
33
|
+
}
|
|
34
|
+
export function decryptWith(encryptedValue, keyFilePath, label) {
|
|
35
|
+
const parts = encryptedValue.split(":");
|
|
36
|
+
if (parts.length !== 3) {
|
|
37
|
+
throw new Error(`[${label}] bad encrypted envelope (expected iv:ct:tag)`);
|
|
38
|
+
}
|
|
39
|
+
const key = loadOrGenerateKey(keyFilePath, label);
|
|
40
|
+
const iv = Buffer.from(parts[0], "hex");
|
|
41
|
+
const ciphertext = parts[1];
|
|
42
|
+
const authTag = Buffer.from(parts[2], "hex");
|
|
43
|
+
const decipher = createDecipheriv(ALGORITHM, key, iv, { authTagLength: AUTH_TAG_LENGTH });
|
|
44
|
+
decipher.setAuthTag(authTag);
|
|
45
|
+
let plaintext = decipher.update(ciphertext, "hex", "utf-8");
|
|
46
|
+
plaintext += decipher.final("utf-8");
|
|
47
|
+
return plaintext;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=file-crypto.js.map
|
package/payload/premium-plugins/real-agent/plugins/property-data/mcp/dist/lib/file-crypto.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-crypto.js","sourceRoot":"","sources":["../../src/lib/file-crypto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAElE,0EAA0E;AAC1E,0EAA0E;AAC1E,0EAA0E;AAC1E,wBAAwB;AAExB,MAAM,SAAS,GAAG,aAAa,CAAC;AAChC,MAAM,UAA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redKey {
|
|
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"}
|