@otskit/mcp 0.1.0 → 0.1.2
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.
|
@@ -235,13 +235,14 @@ async function createTimestamp(input, db, config) {
|
|
|
235
235
|
// src/tools/upgrade-timestamp.ts
|
|
236
236
|
import { readFileSync as readFileSync2 } from "fs";
|
|
237
237
|
import { OpenTimestampsClient as OpenTimestampsClient2, UpgradeError } from "@otskit/client";
|
|
238
|
-
import {
|
|
238
|
+
import { DetachedTimestampFile } from "@otskit/core";
|
|
239
239
|
function checkBitcoinConfirmation(bytes) {
|
|
240
240
|
try {
|
|
241
|
-
const proof =
|
|
242
|
-
const
|
|
243
|
-
|
|
244
|
-
|
|
241
|
+
const proof = DetachedTimestampFile.deserialize(new Uint8Array(bytes));
|
|
242
|
+
const attestations = proof.timestamp.getAttestations();
|
|
243
|
+
const bitcoin = attestations.filter((a) => a.kind === "bitcoin");
|
|
244
|
+
if (bitcoin.length > 0) {
|
|
245
|
+
const block = Math.min(...bitcoin.map((a) => a.height));
|
|
245
246
|
return { confirmed: true, block };
|
|
246
247
|
}
|
|
247
248
|
return { confirmed: false };
|
package/dist/index.js
CHANGED
|
@@ -18,7 +18,7 @@ Commands:
|
|
|
18
18
|
}
|
|
19
19
|
switch (command) {
|
|
20
20
|
case "serve": {
|
|
21
|
-
const { runServer } = await import("./server-
|
|
21
|
+
const { runServer } = await import("./server-NCO7JIUI.js");
|
|
22
22
|
await runServer();
|
|
23
23
|
break;
|
|
24
24
|
}
|
|
@@ -29,7 +29,7 @@ switch (command) {
|
|
|
29
29
|
case "check-pending":
|
|
30
30
|
case "backup":
|
|
31
31
|
case "scheduler": {
|
|
32
|
-
const { runCli } = await import("./cli-
|
|
32
|
+
const { runCli } = await import("./cli-GQMURR5I.js");
|
|
33
33
|
await runCli(command, args);
|
|
34
34
|
break;
|
|
35
35
|
}
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
loadConfig,
|
|
8
8
|
upgradeTimestamp,
|
|
9
9
|
verifyTimestamp
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-6IPLIM6I.js";
|
|
11
11
|
import "./chunk-YFSUDT24.js";
|
|
12
12
|
|
|
13
13
|
// src/server.ts
|
|
@@ -17,7 +17,7 @@ import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprot
|
|
|
17
17
|
|
|
18
18
|
// src/tools/inspect-timestamp.ts
|
|
19
19
|
import { readFileSync, statSync } from "fs";
|
|
20
|
-
import {
|
|
20
|
+
import { DetachedTimestampFile } from "@otskit/core";
|
|
21
21
|
function inspectTimestamp(input, db, _config) {
|
|
22
22
|
const record = getStamp(db, input.id);
|
|
23
23
|
if (!record) return { error: "not_found", details: `No stamp with id ${input.id}` };
|
|
@@ -34,10 +34,14 @@ function inspectTimestamp(input, db, _config) {
|
|
|
34
34
|
let hasBitcoin = false;
|
|
35
35
|
let bitcoinBlock = null;
|
|
36
36
|
try {
|
|
37
|
-
const proof =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
const proof = DetachedTimestampFile.deserialize(new Uint8Array(proofBytes));
|
|
38
|
+
const attestations = proof.timestamp.getAttestations();
|
|
39
|
+
attestationCount = attestations.length;
|
|
40
|
+
hasBitcoin = attestations.some((a) => a.kind === "bitcoin");
|
|
41
|
+
if (hasBitcoin) {
|
|
42
|
+
const blocks = attestations.filter((a) => a.kind === "bitcoin").map((a) => a.height);
|
|
43
|
+
bitcoinBlock = blocks.length > 0 ? Math.min(...blocks) : null;
|
|
44
|
+
}
|
|
41
45
|
} catch {
|
|
42
46
|
}
|
|
43
47
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@otskit/mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "OpenTimestamps MCP server — stamp, upgrade, verify via AI agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": { "node": ">=18" },
|
|
@@ -14,12 +14,15 @@
|
|
|
14
14
|
"test:watch": "vitest"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@otskit/core": "
|
|
18
|
-
"@otskit/client": "
|
|
17
|
+
"@otskit/core": "^0.1.0",
|
|
18
|
+
"@otskit/client": "^0.1.1",
|
|
19
19
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
20
20
|
"better-sqlite3": "^12.10.0",
|
|
21
21
|
"archiver": "^7.0.0"
|
|
22
22
|
},
|
|
23
|
+
"pnpm": {
|
|
24
|
+
"onlyBuiltDependencies": ["better-sqlite3", "esbuild"]
|
|
25
|
+
},
|
|
23
26
|
"devDependencies": {
|
|
24
27
|
"@types/better-sqlite3": "^7.6.13",
|
|
25
28
|
"@types/archiver": "^6.0.3",
|