@helm-protocol/ttt-mcp 0.1.8 → 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.
- package/LICENSE +18 -17
- package/README.md +42 -1
- package/dist/auth.js +34 -225
- package/dist/index.js +51 -22499
- package/dist/tools.js +6 -8
- package/package.json +4 -4
package/dist/tools.js
CHANGED
|
@@ -26,11 +26,9 @@ __export(tools_exports, {
|
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(tools_exports);
|
|
28
28
|
var import_openttt = require("openttt");
|
|
29
|
-
var import_adaptive_switch = require("openttt/dist/adaptive_switch");
|
|
30
|
-
var import_grg_pipeline = require("openttt/dist/grg_pipeline");
|
|
31
29
|
var import_telemetry = require("./telemetry");
|
|
32
30
|
const timeSynth = new import_openttt.TimeSynthesis();
|
|
33
|
-
const adaptiveSwitch = new
|
|
31
|
+
const adaptiveSwitch = new import_openttt.AdaptiveSwitch();
|
|
34
32
|
const potSigner = new import_openttt.PotSigner();
|
|
35
33
|
const startedAt = Date.now();
|
|
36
34
|
const POT_LOG_MAX = 1e4;
|
|
@@ -47,7 +45,7 @@ async function potGenerate(args) {
|
|
|
47
45
|
const pot = await timeSynth.generateProofOfTime();
|
|
48
46
|
const potHash = import_openttt.TimeSynthesis.getOnChainHash(pot);
|
|
49
47
|
const txData = new TextEncoder().encode(args.txHash);
|
|
50
|
-
const grgShards =
|
|
48
|
+
const grgShards = import_openttt.GrgPipeline.processForward(txData, args.chainId, args.poolAddress);
|
|
51
49
|
const signature = potSigner.signPot(potHash);
|
|
52
50
|
const entry = {
|
|
53
51
|
potHash,
|
|
@@ -83,13 +81,13 @@ async function potVerify(args) {
|
|
|
83
81
|
let valid = false;
|
|
84
82
|
let reconstructedSize = 0;
|
|
85
83
|
try {
|
|
86
|
-
const recovered =
|
|
84
|
+
const recovered = import_openttt.GrgPipeline.processInverse(shards, 0, args.chainId, args.poolAddress);
|
|
87
85
|
valid = recovered.length > 0;
|
|
88
86
|
reconstructedSize = recovered.length;
|
|
89
87
|
} catch {
|
|
90
88
|
valid = false;
|
|
91
89
|
}
|
|
92
|
-
const mode = adaptiveSwitch.getCurrentMode() ===
|
|
90
|
+
const mode = adaptiveSwitch.getCurrentMode() === import_openttt.AdaptiveMode.TURBO ? "turbo" : "full";
|
|
93
91
|
return serialize({
|
|
94
92
|
valid,
|
|
95
93
|
mode,
|
|
@@ -152,8 +150,8 @@ async function potStats(args) {
|
|
|
152
150
|
};
|
|
153
151
|
const cutoff = now - (periodMs[args.period] ?? periodMs.day);
|
|
154
152
|
const entries = potLog.filter((e) => e.createdAt >= cutoff);
|
|
155
|
-
const turboCount = entries.filter((e) => e.mode ===
|
|
156
|
-
const fullCount = entries.filter((e) => e.mode ===
|
|
153
|
+
const turboCount = entries.filter((e) => e.mode === import_openttt.AdaptiveMode.TURBO).length;
|
|
154
|
+
const fullCount = entries.filter((e) => e.mode === import_openttt.AdaptiveMode.FULL).length;
|
|
157
155
|
const totalSwaps = entries.length;
|
|
158
156
|
return serialize({
|
|
159
157
|
period: args.period,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@helm-protocol/ttt-mcp",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "MCP Server for OpenTTT — Proof of Time tools for AI agents",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"README.md"
|
|
12
12
|
],
|
|
13
13
|
"scripts": {
|
|
14
|
-
"build": "esbuild index.ts
|
|
14
|
+
"build": "esbuild index.ts tools.ts telemetry.ts auth.ts --platform=node --target=node18 --format=cjs --outdir=dist",
|
|
15
15
|
"start": "node dist/index.js",
|
|
16
16
|
"dev": "npx ts-node index.ts"
|
|
17
17
|
},
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"mev",
|
|
26
26
|
"transaction-ordering"
|
|
27
27
|
],
|
|
28
|
-
"license": "
|
|
28
|
+
"license": "BSL-1.1",
|
|
29
29
|
"repository": {
|
|
30
30
|
"type": "git",
|
|
31
31
|
"url": "https://github.com/Helm-Protocol/openttt-mcp"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
39
|
-
"openttt": "^0.2.
|
|
39
|
+
"openttt": "^0.2.6",
|
|
40
40
|
"zod": "^3.25.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|