mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-14 14:40:52 +00:00
feat(mcp): add a dedicated MCP measurement source for write provenance
Append an MCP value to MeasurementSource (migration 0196, additive enum extension) so a row logged through the remote MCP endpoint is distinguishable from MANUAL/TELEGRAM provenance and gets an isolated idempotency namespace (userId, type, MCP, externalId). The value joins the read enum so existing read/response shapes decode the rows; the REST batch and single-POST write surfaces still reject it (server-resolved only). Regenerate the OpenAPI contract for the additive enum.
This commit is contained in:
1 parent
cfffb693c3
commit
90c8768407
4 files changed
+146
No files matched your search
@@ -184,6 +184,13 @@ export const measurementSourceEnum = z.enum([
|
||||
// decode the rows it surfaces; the client-facing write surfaces still
|
||||
// reject it (see `WRITABLE_MEASUREMENT_SOURCES` + the batch allowlist).
|
||||
"TELEGRAM",
|
||||
// v1.22.0 — measurements logged through the confirmed remote MCP write
|
||||
// surface under a `health:write`-scoped token. Server-resolved (the row is
|
||||
// written in-process over `/mcp`, never through the cookie/Bearer client
|
||||
// write path), so it is excluded from `WRITABLE_MEASUREMENT_SOURCES`; part
|
||||
// of this enum so the read/response shapes (and the iOS decoder) can decode
|
||||
// the rows it surfaces.
|
||||
"MCP",
|
||||
]);
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user