aipou-mcp-server 0.4.0 → 0.5.0

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/dist/init.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ export declare const AIPOU_TOKEN_ADDRESS = "0x55f0Cc5e51A1284D20337d6cbb18938C8A1ABCbB";
2
+ export declare const AIPOU_CLAIMS_ADDRESS = "0x4ca4C98fB784D20EdC8E2A7F531dAab4c6e53058";
1
3
  export interface InitializationResult {
2
4
  mode: "persistent_identity_initialized" | "persistent_identity_already_initialized";
3
5
  wallet: string;
package/dist/init.js CHANGED
@@ -3,8 +3,8 @@ import os from "node:os";
3
3
  import path from "node:path";
4
4
  import { Wallet } from "ethers";
5
5
  import { restrictToCurrentUser } from "./secure-file.js";
6
- const TOKEN_ADDRESS = "0x55f0Cc5e51A1284D20337d6cbb18938C8A1ABCbB";
7
- const CLAIMS_ADDRESS = "0x4ca4C98fB784D20EdC8E2A7F531dAab4c6e53058";
6
+ export const AIPOU_TOKEN_ADDRESS = "0x55f0Cc5e51A1284D20337d6cbb18938C8A1ABCbB";
7
+ export const AIPOU_CLAIMS_ADDRESS = "0x4ca4C98fB784D20EdC8E2A7F531dAab4c6e53058";
8
8
  function identityPaths(dataDirInput) {
9
9
  const dataDir = path.resolve(dataDirInput || path.join(os.homedir(), ".aipou"));
10
10
  return { dataDir, keyFile: path.join(dataDir, "agent-wallet.key") };
@@ -24,8 +24,8 @@ function buildResult(mode, walletAddress, dataDir, keyFile) {
24
24
  env: {
25
25
  AIPOU_AGENT_KEY_FILE: keyFile,
26
26
  AIPOU_DATA_DIR: dataDir,
27
- AIPOU_CONTRACT_ADDRESS: TOKEN_ADDRESS,
28
- AIPOU_CLAIMS_ADDRESS: CLAIMS_ADDRESS
27
+ AIPOU_CONTRACT_ADDRESS: AIPOU_TOKEN_ADDRESS,
28
+ AIPOU_CLAIMS_ADDRESS
29
29
  }
30
30
  }
31
31
  }
@@ -0,0 +1,5 @@
1
+ export declare const AIPOU_RECEIPT_META_KEY = "io.github.0xddneto/aipou-receipt";
2
+ export declare function buildReceiptResultMeta(receipt: {
3
+ receiptId: string;
4
+ collectorPublicKey: string;
5
+ }): Record<string, unknown>;
@@ -0,0 +1,16 @@
1
+ import { collectorFingerprint } from "./collector.js";
2
+ export const AIPOU_RECEIPT_META_KEY = "io.github.0xddneto/aipou-receipt";
3
+ export function buildReceiptResultMeta(receipt) {
4
+ const digest = receipt.receiptId.replace(/^0x/, "").toLowerCase();
5
+ return {
6
+ [AIPOU_RECEIPT_META_KEY]: {
7
+ id: receipt.receiptId,
8
+ uri: `aipou://receipts/${receipt.receiptId}`,
9
+ issuer: collectorFingerprint(receipt.collectorPublicKey),
10
+ digest: `sha256:${digest}`,
11
+ evidenceClass: "issuer_asserted",
12
+ scheme: "aipou-receipt-v1",
13
+ status: "local"
14
+ }
15
+ };
16
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,22 @@
1
+ import assert from "node:assert/strict";
2
+ import { generateKeyPairSync } from "node:crypto";
3
+ import test from "node:test";
4
+ import { AIPOU_RECEIPT_META_KEY, buildReceiptResultMeta } from "./receipt-metadata.js";
5
+ test("receipt result metadata is compact, namespaced, and contains no claim authority", () => {
6
+ const pair = generateKeyPairSync("ed25519");
7
+ const collectorPublicKey = pair.publicKey.export({ format: "pem", type: "spki" }).toString();
8
+ const receiptId = `0x${"ab".repeat(32)}`;
9
+ const metadata = buildReceiptResultMeta({ receiptId, collectorPublicKey });
10
+ const projection = metadata[AIPOU_RECEIPT_META_KEY];
11
+ assert.deepEqual(Object.keys(metadata), [AIPOU_RECEIPT_META_KEY]);
12
+ assert.equal(projection.id, receiptId);
13
+ assert.equal(projection.uri, `aipou://receipts/${receiptId}`);
14
+ assert.match(String(projection.issuer), /^sha256:[0-9a-f]{64}$/);
15
+ assert.equal(projection.digest, `sha256:${"ab".repeat(32)}`);
16
+ assert.equal(projection.evidenceClass, "issuer_asserted");
17
+ assert.equal(projection.scheme, "aipou-receipt-v1");
18
+ assert.equal(projection.status, "local");
19
+ assert.equal("wallet" in projection, false);
20
+ assert.equal("reward" in projection, false);
21
+ assert.equal("claimStatus" in projection, false);
22
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aipou-mcp-server",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "mcpName": "io.github.0xddneto/ai-proof-of-us",
5
5
  "description": "MCP server for private, signed AI task receipts and optional validated AIPOU claims.",
6
6
  "author": "0xddneto",
@@ -29,14 +29,15 @@
29
29
  "files": [
30
30
  "dist",
31
31
  "README.md",
32
+ "NOTICE",
32
33
  "server.json"
33
34
  ],
34
35
  "bin": {
35
36
  "aipou-mcp": "dist/index.js"
36
37
  },
37
38
  "scripts": {
38
- "build": "tsc -p tsconfig.json",
39
- "test": "npm run build && node --test dist/protocol.test.js dist/rewards.test.js dist/canonical.test.js dist/demo.test.js dist/init.test.js dist/version.test.js",
39
+ "build": "tsc -p tsconfig.json && esbuild src/index.ts --bundle --platform=node --format=esm --target=node20 --outfile=dist/index.js --external:dotenv --external:dotenv/* --external:ethers --external:merkletreejs --external:zod --external:zod/*",
40
+ "test": "npm run build && node --test dist/protocol.test.js dist/rewards.test.js dist/canonical.test.js dist/demo.test.js dist/doctor.test.js dist/init.test.js dist/receipt-metadata.test.js dist/version.test.js",
40
41
  "pack:check": "npm test && npm pack --dry-run",
41
42
  "demo": "npm run build && node dist/index.js --demo",
42
43
  "dev": "tsx src/index.ts",
@@ -50,14 +51,15 @@
50
51
  "node": ">=20"
51
52
  },
52
53
  "dependencies": {
53
- "@modelcontextprotocol/sdk": "^1.13.0",
54
54
  "dotenv": "^16.6.1",
55
55
  "ethers": "^6.17.0",
56
56
  "merkletreejs": "^0.6.0",
57
- "zod": "^3.23.8"
57
+ "zod": "^3.25.0"
58
58
  },
59
59
  "devDependencies": {
60
+ "@modelcontextprotocol/sdk": "1.29.0",
60
61
  "@types/node": "^22.5.4",
62
+ "esbuild": "0.28.1",
61
63
  "tsx": "^4.19.0",
62
64
  "typescript": "^5.5.4"
63
65
  }
package/server.json CHANGED
@@ -9,12 +9,12 @@
9
9
  "source": "github",
10
10
  "subfolder": "mcp-server"
11
11
  },
12
- "version": "0.4.0",
12
+ "version": "0.5.0",
13
13
  "packages": [
14
14
  {
15
15
  "registryType": "npm",
16
16
  "identifier": "aipou-mcp-server",
17
- "version": "0.4.0",
17
+ "version": "0.5.0",
18
18
  "transport": {
19
19
  "type": "stdio"
20
20
  },