@brain-protocol/mcp 0.2.0 → 0.2.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,5 +1,11 @@
1
1
  import type { StoreAdapter } from "../store/adapter.js";
2
2
  export declare function prove(store: StoreAdapter, args: Record<string, unknown>): Promise<import("../types.js").ProveResult | {
3
3
  error: string;
4
+ } | {
5
+ vc: import("@brain-protocol/sdk").VerifiableCredential;
6
+ contentHash: string;
7
+ txHash: string;
8
+ anchorId: number;
9
+ error?: undefined;
4
10
  }>;
5
11
  //# sourceMappingURL=prove.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prove.d.ts","sourceRoot":"","sources":["../../src/tools/prove.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAIxD,wBAAsB,KAAK,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;GAQ7E"}
1
+ {"version":3,"file":"prove.d.ts","sourceRoot":"","sources":["../../src/tools/prove.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAIxD,wBAAsB,KAAK,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;;;;;;;GA0B7E"}
@@ -1,3 +1,4 @@
1
+ import { buildVerifiableCredential } from "@brain-protocol/sdk";
1
2
  import { proveSchema } from "../schemas.js";
2
3
  const CLOUD_REQUIRED_MSG = "prove requires cloud mode. Set BRAIN_API_URL=https://brain.api.vauban.tech";
3
4
  export async function prove(store, args) {
@@ -5,6 +6,22 @@ export async function prove(store, args) {
5
6
  if (!store.prove) {
6
7
  return { error: CLOUD_REQUIRED_MSG };
7
8
  }
8
- return store.prove(input.entry_id);
9
+ const result = await store.prove(input.entry_id);
10
+ // If the store supports getById, build a VC
11
+ if (store.getById) {
12
+ const entry = await store.getById(input.entry_id);
13
+ if (entry) {
14
+ const anchor = {
15
+ txHash: result.txHash,
16
+ anchorId: result.anchorId,
17
+ contentHash: result.contentHash,
18
+ };
19
+ const vc = buildVerifiableCredential(entry, anchor, {
20
+ issuer: "brain-protocol-mcp",
21
+ });
22
+ return { ...result, vc };
23
+ }
24
+ }
25
+ return result;
9
26
  }
10
27
  //# sourceMappingURL=prove.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"prove.js","sourceRoot":"","sources":["../../src/tools/prove.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,MAAM,kBAAkB,GAAG,4EAA4E,CAAC;AAExG,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,KAAmB,EAAE,IAA6B;IAC5E,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEtC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACjB,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC;IACvC,CAAC;IAED,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AACrC,CAAC"}
1
+ {"version":3,"file":"prove.js","sourceRoot":"","sources":["../../src/tools/prove.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,MAAM,kBAAkB,GAAG,4EAA4E,CAAC;AAExG,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,KAAmB,EAAE,IAA6B;IAC5E,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAEtC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACjB,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC;IACvC,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAEjD,4CAA4C;IAC5C,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QAClB,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAClD,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,MAAM,GAAiB;gBAC3B,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,WAAW,EAAE,MAAM,CAAC,WAAW;aAChC,CAAC;YACF,MAAM,EAAE,GAAG,yBAAyB,CAAC,KAAuB,EAAE,MAAM,EAAE;gBACpE,MAAM,EAAE,oBAAoB;aAC7B,CAAC,CAAC;YACH,OAAO,EAAE,GAAG,MAAM,EAAE,EAAE,EAAE,CAAC;QAC3B,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brain-protocol/mcp",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Verifiable Memory-as-a-Service for AI Agents — MCP server with local SQLite or cloud mode",
5
5
  "type": "module",
6
6
  "license": "MIT",