create-evda 0.1.9 → 0.1.10
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/CHANGELOG.md +72 -0
- package/README.md +12 -5
- package/bin/evda.mjs +122 -5
- package/create-evda.mjs +11 -3
- package/lib/adopt.mjs +488 -0
- package/lib/agents.mjs +1 -1
- package/lib/attested-host.mjs +269 -0
- package/lib/clients.mjs +11 -0
- package/lib/connect.mjs +1 -1
- package/lib/connecting-apps.mjs +56 -0
- package/lib/connector-tools.mjs +85 -0
- package/lib/corrections.mjs +34 -0
- package/lib/credentials-migrate.mjs +120 -0
- package/lib/day-file.mjs +121 -12
- package/lib/day-writer.mjs +8 -1
- package/lib/doctor.mjs +32 -3
- package/lib/every-chat.mjs +7 -11
- package/lib/gather-apply.mjs +133 -24
- package/lib/gather.mjs +116 -16
- package/lib/html-notes.mjs +124 -0
- package/lib/keep-hook.mjs +61 -8
- package/lib/keychain.mjs +38 -1
- package/lib/manifest.mjs +3 -1
- package/lib/mcp-http.mjs +19 -1
- package/lib/mcp.mjs +358 -56
- package/lib/measurement-log.mjs +3 -0
- package/lib/migrate-people.mjs +54 -20
- package/lib/person-folders.mjs +89 -0
- package/lib/plugin-hook.mjs +109 -0
- package/lib/plugin.mjs +208 -0
- package/lib/presets.mjs +26 -5
- package/lib/publish.mjs +55 -10
- package/lib/record.mjs +54 -0
- package/lib/routines.mjs +13 -2
- package/lib/takeout.mjs +169 -0
- package/lib/tdx-attestation.mjs +412 -0
- package/lib/tdx-trust.json +10 -0
- package/lib/tools.mjs +669 -59
- package/lib/touches.mjs +427 -0
- package/lib/update-check.mjs +30 -0
- package/lib/yaml.mjs +8 -4
- package/package.json +2 -1
- package/templates/AGENTS.md +56 -6
- package/templates/evda-digest.md +2 -0
package/lib/mcp-http.mjs
CHANGED
|
@@ -54,6 +54,23 @@ function limiter() {
|
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
// HQ-2330: what a request carries beyond the protocol, by NAME only, so the log can show whether an
|
|
58
|
+
// app sends something that names the conversation (claude.ai reuses one Mcp-Session-Id across chats).
|
|
59
|
+
// Values are never logged: a header or a _meta value can carry anything.
|
|
60
|
+
const PLAIN_HEADERS = new Set(["host", "content-type", "content-length", "authorization", "accept", "accept-encoding", "accept-language", "user-agent", "connection", "origin", "mcp-session-id", "mcp-protocol-version", "last-event-id", "via", "forwarded", "x-real-ip", "cache-control", "pragma", "te", "keep-alive"]);
|
|
61
|
+
const clipName = (k) => String(k).replace(/[^\x21-\x7e]/g, "").slice(0, 64);
|
|
62
|
+
export function extraNames(headers, params) {
|
|
63
|
+
const out = {};
|
|
64
|
+
const h = Object.keys(headers ?? {}).map((k) => k.toLowerCase()).filter((k) => !PLAIN_HEADERS.has(k) && !k.startsWith("x-forwarded-") && !k.startsWith("tailscale-") && !k.startsWith("sec-fetch-")).map(clipName).slice(0, 20);
|
|
65
|
+
if (h.length) out.header_names = h;
|
|
66
|
+
const meta = params?._meta;
|
|
67
|
+
if (meta && typeof meta === "object" && !Array.isArray(meta)) {
|
|
68
|
+
const m = Object.keys(meta).map(clipName).slice(0, 20);
|
|
69
|
+
if (m.length) out.meta_keys = m;
|
|
70
|
+
}
|
|
71
|
+
return out;
|
|
72
|
+
}
|
|
73
|
+
|
|
57
74
|
const esc = (s) => String(s ?? "").replace(/[&<>"']/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" })[c]);
|
|
58
75
|
const shortId = (s) => auth.sha256(String(s)).slice(0, 8);
|
|
59
76
|
|
|
@@ -167,7 +184,7 @@ export function createMcpHttpServer({ dir, version, publicUrl, env = process.env
|
|
|
167
184
|
if (batch.length !== 1) return send(400, { jsonrpc: "2.0", id: null, error: { code: -32600, message: "initialize must be sent alone" } });
|
|
168
185
|
evictSessions(now);
|
|
169
186
|
newSid = randomBytes(24).toString("hex");
|
|
170
|
-
session = { family: grant.family, last: now, ctx: { version, log: (s) => log(s), clock, env: readerEnv, evda: () => openEvda(dir), session: newSession(), caller: callerFrom({ env: readerEnv }) } };
|
|
187
|
+
session = { family: grant.family, last: now, ctx: { version, log: (s) => log(s), clock, env: readerEnv, evda: () => openEvda(dir), session: newSession(), caller: callerFrom({ env: readerEnv }), keepsToolList: true } };
|
|
171
188
|
sessions.set(newSid, session);
|
|
172
189
|
} else {
|
|
173
190
|
if (!sid) return send(400, { jsonrpc: "2.0", id: null, error: { code: -32600, message: "Mcp-Session-Id header required; initialize first" } });
|
|
@@ -188,6 +205,7 @@ export function createMcpHttpServer({ dir, version, publicUrl, env = process.env
|
|
|
188
205
|
const line = { call: method === "tools/call" ? (TOOL_NAMES.has(tool) ? tool : "unknown_tool") : METHODS.has(method) ? method : "unknown_method", status: st, ms: clock() - t0, session: shortId(sid ?? newSid), conn: note.who };
|
|
189
206
|
// Which app connected (HQ-2207): initialize's clientInfo name and version, nothing else of it.
|
|
190
207
|
if (method === "initialize") { const ci = clientInfoOf(one.params); line.client_name = ci.name; line.client_version = ci.version; }
|
|
208
|
+
Object.assign(line, extraNames(req.headers, one.params));
|
|
191
209
|
if (auth.FALSIFY("log-content", env)) line.args = one.params?.arguments;
|
|
192
210
|
record(line);
|
|
193
211
|
}
|