@helm-protocol/ttt-mcp 0.1.7 → 0.1.8
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/auth.js +257 -0
- package/dist/index.js +22498 -24
- package/dist/tools.js +8 -6
- package/package.json +3 -3
package/dist/tools.js
CHANGED
|
@@ -26,9 +26,11 @@ __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");
|
|
29
31
|
var import_telemetry = require("./telemetry");
|
|
30
32
|
const timeSynth = new import_openttt.TimeSynthesis();
|
|
31
|
-
const adaptiveSwitch = new
|
|
33
|
+
const adaptiveSwitch = new import_adaptive_switch.AdaptiveSwitch();
|
|
32
34
|
const potSigner = new import_openttt.PotSigner();
|
|
33
35
|
const startedAt = Date.now();
|
|
34
36
|
const POT_LOG_MAX = 1e4;
|
|
@@ -45,7 +47,7 @@ async function potGenerate(args) {
|
|
|
45
47
|
const pot = await timeSynth.generateProofOfTime();
|
|
46
48
|
const potHash = import_openttt.TimeSynthesis.getOnChainHash(pot);
|
|
47
49
|
const txData = new TextEncoder().encode(args.txHash);
|
|
48
|
-
const grgShards =
|
|
50
|
+
const grgShards = import_grg_pipeline.GrgPipeline.processForward(txData, args.chainId, args.poolAddress);
|
|
49
51
|
const signature = potSigner.signPot(potHash);
|
|
50
52
|
const entry = {
|
|
51
53
|
potHash,
|
|
@@ -81,13 +83,13 @@ async function potVerify(args) {
|
|
|
81
83
|
let valid = false;
|
|
82
84
|
let reconstructedSize = 0;
|
|
83
85
|
try {
|
|
84
|
-
const recovered =
|
|
86
|
+
const recovered = import_grg_pipeline.GrgPipeline.processInverse(shards, 0, args.chainId, args.poolAddress);
|
|
85
87
|
valid = recovered.length > 0;
|
|
86
88
|
reconstructedSize = recovered.length;
|
|
87
89
|
} catch {
|
|
88
90
|
valid = false;
|
|
89
91
|
}
|
|
90
|
-
const mode = adaptiveSwitch.getCurrentMode() ===
|
|
92
|
+
const mode = adaptiveSwitch.getCurrentMode() === import_adaptive_switch.AdaptiveMode.TURBO ? "turbo" : "full";
|
|
91
93
|
return serialize({
|
|
92
94
|
valid,
|
|
93
95
|
mode,
|
|
@@ -150,8 +152,8 @@ async function potStats(args) {
|
|
|
150
152
|
};
|
|
151
153
|
const cutoff = now - (periodMs[args.period] ?? periodMs.day);
|
|
152
154
|
const entries = potLog.filter((e) => e.createdAt >= cutoff);
|
|
153
|
-
const turboCount = entries.filter((e) => e.mode ===
|
|
154
|
-
const fullCount = entries.filter((e) => e.mode ===
|
|
155
|
+
const turboCount = entries.filter((e) => e.mode === import_adaptive_switch.AdaptiveMode.TURBO).length;
|
|
156
|
+
const fullCount = entries.filter((e) => e.mode === import_adaptive_switch.AdaptiveMode.FULL).length;
|
|
155
157
|
const totalSwaps = entries.length;
|
|
156
158
|
return serialize({
|
|
157
159
|
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.1.8",
|
|
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 --bundle --platform=node --target=node18 --format=cjs --outfile=dist/index.js --external:@aws-sdk/client-kms --external:@turnkey/ethers --external:@turnkey/api-key-stamper --external:@google-cloud/kms --external:openttt",
|
|
15
15
|
"start": "node dist/index.js",
|
|
16
16
|
"dev": "npx ts-node index.ts"
|
|
17
17
|
},
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
39
|
-
"openttt": "^0.
|
|
39
|
+
"openttt": "^0.2.9",
|
|
40
40
|
"zod": "^3.25.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|