@opendatalabs/personal-server-ts-server 1.13.0 → 1.13.1

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.
@@ -1,15 +1,4 @@
1
- export interface AccessLogEntry {
2
- logId: string;
3
- grantId: string;
4
- builder: string;
5
- action: "read" | "write" | "delete";
6
- scope: string;
7
- timestamp: string;
8
- ipAddress: string;
9
- userAgent: string;
10
- }
11
- export interface AccessLogWriter {
12
- write(entry: AccessLogEntry): Promise<void>;
13
- }
1
+ import type { AccessLogEntry, AccessLogWriter } from "@opendatalabs/personal-server-ts-core/logging/access-log";
2
+ export type { AccessLogEntry, AccessLogWriter };
14
3
  export declare function createAccessLogWriter(logsDir: string): AccessLogWriter;
15
4
  //# sourceMappingURL=access-log.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"access-log.d.ts","sourceRoot":"","sources":["../../src/logging/access-log.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C;AAUD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAiBtE"}
1
+ {"version":3,"file":"access-log.d.ts","sourceRoot":"","sources":["../../src/logging/access-log.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EAChB,MAAM,0DAA0D,CAAC;AAElE,YAAY,EAAE,cAAc,EAAE,eAAe,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AQ,CAAC,CAAC;YAEzC,MAAM,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,CAAC,CAAC;QACpE,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -110213,6 +110213,7 @@ function parseGrantExpiresAtSeconds(value) {
110213
110213
  const millis = Date.parse(value);
110214
110214
  return Number.isNaN(millis) ? null : Math.floor(millis / 1e3);
110215
110215
  }
110216
+ var SENTINEL_GRANT_IDS = /* @__PURE__ */ new Set(["owner", "policy-bypass"]);
110216
110217
  async function verifyDataReadPolicy(input, ports) {
110217
110218
  const available = await ports.runtimeAvailability?.isAvailable();
110218
110219
  if (available === false) {
@@ -110227,6 +110228,12 @@ async function verifyDataReadPolicy(input, ports) {
110227
110228
  reason: "No grantId in authorization payload"
110228
110229
  });
110229
110230
  }
110231
+ if (SENTINEL_GRANT_IDS.has(input.grantId)) {
110232
+ throw new GrantRequiredError({
110233
+ reason: "Reserved grantId",
110234
+ grantId: input.grantId
110235
+ });
110236
+ }
110230
110237
  const grant = await ports.grantVerifier.getGrant(input.grantId);
110231
110238
  if (!grant) {
110232
110239
  throw new GrantRequiredError({
@@ -110234,6 +110241,12 @@ async function verifyDataReadPolicy(input, ports) {
110234
110241
  grantId: input.grantId
110235
110242
  });
110236
110243
  }
110244
+ if (SENTINEL_GRANT_IDS.has(grant.id)) {
110245
+ throw new GrantRequiredError({
110246
+ reason: "Grant resolved to a reserved id",
110247
+ grantId: input.grantId
110248
+ });
110249
+ }
110237
110250
  if (grant.revokedAt !== null) {
110238
110251
  throw new GrantRevokedError({ grantId: grant.id });
110239
110252
  }
@@ -111422,6 +111435,34 @@ function resolveLineageGrantView(authResult) {
111422
111435
  }
111423
111436
  return { grantId };
111424
111437
  }
111438
+ function isOwnerView(authResult) {
111439
+ return authResult === void 0 || authResult.grantId === "owner" || authResult.grantId === "policy-bypass";
111440
+ }
111441
+ function redactEnvelopeForGrantee(envelope) {
111442
+ const { [WRITER_ATTRIBUTION_KEY]: attribution, [LINEAGE_KEY]: storedLineage, ...rest } = envelope.data;
111443
+ if (attribution === void 0 && storedLineage === void 0) {
111444
+ return envelope;
111445
+ }
111446
+ let data = rest;
111447
+ if (storedLineage !== void 0) {
111448
+ if (isBinaryEnvelope(envelope)) {
111449
+ const metadata = data["metadata"];
111450
+ if (metadata !== null && typeof metadata === "object" && !Array.isArray(metadata)) {
111451
+ const { lineage: _consumed, ...metadataRest } = metadata;
111452
+ if (Object.keys(metadataRest).length === 0) {
111453
+ const { metadata: _emptied, ...dataRest } = data;
111454
+ data = dataRest;
111455
+ } else {
111456
+ data = { ...data, metadata: metadataRest };
111457
+ }
111458
+ }
111459
+ } else {
111460
+ const { lineage: _consumed, ...dataRest } = data;
111461
+ data = dataRest;
111462
+ }
111463
+ }
111464
+ return { ...envelope, data };
111465
+ }
111425
111466
  async function handlePersonalServerDataRequest(request2, deps, options = {}) {
111426
111467
  return withApiErrors(async () => {
111427
111468
  const url2 = new URL(request2.url);
@@ -111514,6 +111555,16 @@ async function handlePersonalServerDataRequest(request2, deps, options = {}) {
111514
111555
  body: result.body
111515
111556
  });
111516
111557
  }
111558
+ await deps.accessLogWriter.write({
111559
+ logId: deps.createLogId?.() ?? crypto.randomUUID(),
111560
+ grantId: authResult?.grantId ?? "owner",
111561
+ builder: authResult?.builder ?? "unknown",
111562
+ action: "lineage",
111563
+ scope: scopeResult.scope,
111564
+ timestamp: (deps.now ?? (() => /* @__PURE__ */ new Date()))().toISOString(),
111565
+ ipAddress: request2.headers.get("x-forwarded-for") ?? request2.headers.get("x-real-ip") ?? "unknown",
111566
+ userAgent: request2.headers.get("user-agent") ?? "unknown"
111567
+ });
111517
111568
  return jsonResponse({ data: result.data, proof: result.proof });
111518
111569
  }
111519
111570
  if (parts.length !== 1)
@@ -111598,6 +111649,7 @@ async function handlePersonalServerDataRequest(request2, deps, options = {}) {
111598
111649
  }
111599
111650
  return contractErrorResponse(result);
111600
111651
  }
111652
+ const servedEnvelope = isOwnerView(authResult) ? result.envelope : redactEnvelopeForGrantee(result.envelope);
111601
111653
  const logId = deps.createLogId?.() ?? crypto.randomUUID();
111602
111654
  const timestamp = (deps.now ?? (() => /* @__PURE__ */ new Date()))().toISOString();
111603
111655
  const ipAddress = request2.headers.get("x-forwarded-for") ?? request2.headers.get("x-real-ip") ?? "unknown";
@@ -111634,13 +111686,13 @@ async function handlePersonalServerDataRequest(request2, deps, options = {}) {
111634
111686
  }
111635
111687
  const wantsRawContent = url2.searchParams.get("content") === "raw";
111636
111688
  if (wantsRawContent) {
111637
- if (!isBinaryEnvelope(result.envelope)) {
111689
+ if (!isBinaryEnvelope(servedEnvelope)) {
111638
111690
  return jsonResponse({
111639
111691
  error: "NOT_BINARY_SCOPE",
111640
111692
  message: `Scope "${scopeResult.scope}" does not expose raw binary content.`
111641
111693
  }, { status: 400, headers });
111642
111694
  }
111643
- const decoded = decodeBinaryEnvelope(result.envelope);
111695
+ const decoded = decodeBinaryEnvelope(servedEnvelope);
111644
111696
  headers["Content-Type"] = decoded.mimeType;
111645
111697
  headers["Content-Length"] = String(decoded.bytes.length);
111646
111698
  if (decoded.filename) {
@@ -111655,7 +111707,7 @@ async function handlePersonalServerDataRequest(request2, deps, options = {}) {
111655
111707
  });
111656
111708
  return response2;
111657
111709
  }
111658
- const response = jsonResponse(result.envelope, { headers });
111710
+ const response = jsonResponse(servedEnvelope, { headers });
111659
111711
  reportReadFulfillment();
111660
111712
  return response;
111661
111713
  }
@@ -114267,10 +114319,13 @@ function trimSourceData(data, options = {}) {
114267
114319
  if (Array.isArray(data))
114268
114320
  return trimArray(data, limit2);
114269
114321
  if (isRecord5(data)) {
114322
+ const stamped = "$lineage" in data;
114270
114323
  const out = {};
114271
114324
  for (const [key, value] of Object.entries(data)) {
114272
114325
  if (RESERVED_KEYS.has(key))
114273
114326
  continue;
114327
+ if (stamped && key === "lineage")
114328
+ continue;
114274
114329
  out[key] = Array.isArray(value) ? trimArray(value, limit2) : value;
114275
114330
  }
114276
114331
  return out;
@@ -115719,6 +115774,140 @@ function createInMemoryMcpOAuthAuthorizationStore() {
115719
115774
  }
115720
115775
 
115721
115776
  // ../core/dist/mcp/read-client.js
115777
+ var FAIL_CLOSED_CONTEXT = {
115778
+ dropTopLevelLineage: true,
115779
+ dropMetadataLineage: true
115780
+ };
115781
+ function pathUnder(path, prefix) {
115782
+ return path === prefix || path.startsWith(prefix) && /[.[{]/.test(path.charAt(prefix.length));
115783
+ }
115784
+ function groupLabelSegments(path) {
115785
+ const match = /^\$\.data(?:\.metadata)?\.\{(.+):(.+)\}$/.exec(path);
115786
+ return match ? [match[1], match[2]] : [];
115787
+ }
115788
+ function servedLineageShaped(blocks) {
115789
+ return blocks.some((block) => {
115790
+ if (pathUnder(block.path, "$.data.lineage") || pathUnder(block.path, "$.data.metadata.lineage")) {
115791
+ return true;
115792
+ }
115793
+ if (groupLabelSegments(block.path).some((segment) => segment === "lineage" || segment === LINEAGE_KEY)) {
115794
+ return true;
115795
+ }
115796
+ if (!("value" in block) || !isPlainObject3(block.value))
115797
+ return false;
115798
+ const data = block.path === "$" ? block.value["data"] ?? null : block.value;
115799
+ return isPlainObject3(data) && ("lineage" in data || isPlainObject3(data["metadata"]) && "lineage" in data["metadata"]);
115800
+ });
115801
+ }
115802
+ function visibleStampEvidence(blocks) {
115803
+ for (const block of blocks) {
115804
+ if (pathUnder(block.path, `$.data.${LINEAGE_KEY}`) || groupLabelSegments(block.path).includes(LINEAGE_KEY)) {
115805
+ return { dropTopLevelLineage: true, dropMetadataLineage: false };
115806
+ }
115807
+ if ("value" in block && isPlainObject3(block.value)) {
115808
+ const data = block.path === "$" ? block.value["data"] ?? null : block.value;
115809
+ if (isPlainObject3(data) && LINEAGE_KEY in data) {
115810
+ return { dropTopLevelLineage: true, dropMetadataLineage: false };
115811
+ }
115812
+ }
115813
+ }
115814
+ return null;
115815
+ }
115816
+ async function resolveBlockRedactionContext(storage, scope, collectedAt2, blocks) {
115817
+ if (!servedLineageShaped(blocks)) {
115818
+ return { dropTopLevelLineage: false, dropMetadataLineage: false };
115819
+ }
115820
+ const visible = visibleStampEvidence(blocks);
115821
+ if (visible)
115822
+ return visible;
115823
+ try {
115824
+ const envelope = await storage.readEnvelope(scope, collectedAt2);
115825
+ if (!(LINEAGE_KEY in envelope.data)) {
115826
+ return { dropTopLevelLineage: false, dropMetadataLineage: false };
115827
+ }
115828
+ return isBinaryEnvelope(envelope) ? { dropTopLevelLineage: false, dropMetadataLineage: true } : { dropTopLevelLineage: true, dropMetadataLineage: false };
115829
+ } catch {
115830
+ return FAIL_CLOSED_CONTEXT;
115831
+ }
115832
+ }
115833
+ function redactedBlockPathPrefixes(ctx) {
115834
+ return [
115835
+ "$.data.$writtenBy",
115836
+ "$.data.$lineage",
115837
+ ...ctx.dropTopLevelLineage ? ["$.data.lineage"] : [],
115838
+ ...ctx.dropMetadataLineage ? ["$.data.metadata.lineage"] : []
115839
+ ];
115840
+ }
115841
+ function isRedactedBlockPath(path, ctx) {
115842
+ return redactedBlockPathPrefixes(ctx).some((prefix) => path === prefix || path.startsWith(prefix) && /[.[{]/.test(path.charAt(prefix.length)));
115843
+ }
115844
+ function isPlainObject3(value) {
115845
+ return value !== null && typeof value === "object" && !Array.isArray(value);
115846
+ }
115847
+ function isRedactedKeyName(parent, key, ctx) {
115848
+ if (parent === "data") {
115849
+ return key === "$writtenBy" || key === "$lineage" || ctx.dropTopLevelLineage && key === "lineage";
115850
+ }
115851
+ return ctx.dropMetadataLineage && key === "lineage";
115852
+ }
115853
+ function sanitizeGroupLabel(path, ctx) {
115854
+ const match = /^(\$\.data(?:\.metadata)?)\.\{(.+):(.+)\}$/.exec(path);
115855
+ if (!match)
115856
+ return path;
115857
+ const parent = match[1] === "$.data" ? "data" : "metadata";
115858
+ const first = isRedactedKeyName(parent, match[2], ctx) ? "\u2026" : match[2];
115859
+ const last2 = isRedactedKeyName(parent, match[3], ctx) ? "\u2026" : match[3];
115860
+ return `${match[1]}.{${first}:${last2}}`;
115861
+ }
115862
+ function stripMetadataLineage(value, ctx) {
115863
+ if (!ctx.dropMetadataLineage || !isPlainObject3(value["metadata"])) {
115864
+ return value;
115865
+ }
115866
+ const { lineage: _metadataLineage, ...metadataRest } = value["metadata"];
115867
+ if (Object.keys(metadataRest).length === 0) {
115868
+ const { metadata: _emptied, ...rest } = value;
115869
+ return rest;
115870
+ }
115871
+ return { ...value, metadata: metadataRest };
115872
+ }
115873
+ function stripDataLevelKeys(value, ctx) {
115874
+ const { $writtenBy: _writtenBy, $lineage: _lineage, ...rest } = value;
115875
+ let data = rest;
115876
+ if (ctx.dropTopLevelLineage) {
115877
+ const { lineage: _callerLineage, ...dataRest } = data;
115878
+ data = dataRest;
115879
+ }
115880
+ return stripMetadataLineage(data, ctx);
115881
+ }
115882
+ function redactBlockValue(path, value, ctx) {
115883
+ if (!isPlainObject3(value))
115884
+ return value;
115885
+ if (path === "$.data" || /^\$\.data\.\{.*\}$/.test(path)) {
115886
+ return stripDataLevelKeys(value, ctx);
115887
+ }
115888
+ if (path === "$.data.metadata" || /^\$\.data\.metadata\.\{.*\}$/.test(path)) {
115889
+ if (!ctx.dropMetadataLineage)
115890
+ return value;
115891
+ const { lineage: _metadataLineage, ...rest } = value;
115892
+ return rest;
115893
+ }
115894
+ if (path === "$" && isPlainObject3(value["data"])) {
115895
+ return { ...value, data: stripDataLevelKeys(value["data"], ctx) };
115896
+ }
115897
+ return value;
115898
+ }
115899
+ function redactBlockRefsForGrantee(blocks, ctx) {
115900
+ return blocks.filter((block) => !isRedactedBlockPath(block.path, ctx)).map((block) => ({ ...block, path: sanitizeGroupLabel(block.path, ctx) }));
115901
+ }
115902
+ function redactBlockPayloadsForGrantee(blocks, ctx) {
115903
+ return blocks.filter((block) => !isRedactedBlockPath(block.path, ctx)).flatMap((block) => {
115904
+ const value = redactBlockValue(block.path, block.value, ctx);
115905
+ if (isPlainObject3(block.value) && Object.keys(block.value).length > 0 && isPlainObject3(value) && Object.keys(value).length === 0) {
115906
+ return [];
115907
+ }
115908
+ return [{ ...block, path: sanitizeGroupLabel(block.path, ctx), value }];
115909
+ });
115910
+ }
115722
115911
  var McpDataReadError = class extends Error {
115723
115912
  status;
115724
115913
  body;
@@ -115887,7 +116076,11 @@ function createMcpDataReadClient(options) {
115887
116076
  userAgent
115888
116077
  });
115889
116078
  }
115890
- return { status: 200, ...result };
116079
+ return isOwnerView(authResult) ? { status: 200, ...result } : {
116080
+ status: 200,
116081
+ ...result,
116082
+ blocks: redactBlockPayloadsForGrantee(result.blocks, await resolveBlockRedactionContext(storage, scope, selectedEntry.collectedAt, result.blocks))
116083
+ };
115891
116084
  } catch (err2) {
115892
116085
  if (err2 instanceof ProtocolError) {
115893
116086
  throw new McpDataReadError(err2.code, err2.toJSON());
@@ -115924,6 +116117,12 @@ function createMcpDataReadClient(options) {
115924
116117
  });
115925
116118
  const manifest = await storage.readBlockManifest(scope, selectedEntry.collectedAt);
115926
116119
  await writeReadAccessLog(request2, { scope, grantId, authResult });
116120
+ if (manifest && !isOwnerView(authResult)) {
116121
+ return {
116122
+ ...manifest,
116123
+ blocks: redactBlockRefsForGrantee(manifest.blocks, await resolveBlockRedactionContext(storage, scope, selectedEntry.collectedAt, manifest.blocks))
116124
+ };
116125
+ }
115927
116126
  return manifest;
115928
116127
  },
115929
116128
  async readRawScopeFile({ scope, grantId, at: at3, fileId, payment }) {
@@ -127072,7 +127271,7 @@ var Protocol = class {
127072
127271
  };
127073
127272
  }
127074
127273
  };
127075
- function isPlainObject3(value) {
127274
+ function isPlainObject4(value) {
127076
127275
  return value !== null && typeof value === "object" && !Array.isArray(value);
127077
127276
  }
127078
127277
  function mergeCapabilities(base, additional) {
@@ -127083,7 +127282,7 @@ function mergeCapabilities(base, additional) {
127083
127282
  if (addValue === void 0)
127084
127283
  continue;
127085
127284
  const baseValue = result[k10];
127086
- if (isPlainObject3(baseValue) && isPlainObject3(addValue)) {
127285
+ if (isPlainObject4(baseValue) && isPlainObject4(addValue)) {
127087
127286
  result[k10] = { ...baseValue, ...addValue };
127088
127287
  } else {
127089
127288
  result[k10] = addValue;
@@ -130256,6 +130455,12 @@ function createBearerTokenPsLiteAuth(options) {
130256
130455
  reason: "No grantId in request"
130257
130456
  });
130258
130457
  }
130458
+ if (input.grantId === "owner" || input.grantId === "policy-bypass") {
130459
+ throw new GrantRequiredError({
130460
+ reason: "Reserved grantId",
130461
+ grantId: input.grantId
130462
+ });
130463
+ }
130259
130464
  return { grantId: input.grantId };
130260
130465
  }
130261
130466
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opendatalabs/personal-server-ts-server",
3
- "version": "1.13.0",
3
+ "version": "1.13.1",
4
4
  "description": "Hono HTTP server for the Vana Personal Server — routes, middleware, composition root",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -44,8 +44,8 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@hono/node-server": "^1.19.13",
47
- "@opendatalabs/personal-server-ts-core": "1.13.0",
48
- "@opendatalabs/personal-server-ts-lite": "1.13.0",
47
+ "@opendatalabs/personal-server-ts-core": "1.13.1",
48
+ "@opendatalabs/personal-server-ts-lite": "1.13.1",
49
49
  "@opendatalabs/vana-sdk": "3.14.0",
50
50
  "better-sqlite3": "^12.11.1",
51
51
  "hono": "^4.12.27",