@helm-protocol/ttt-mcp 0.1.6 → 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 +22604 -130
- package/dist/telemetry.js +52 -38
- package/dist/tools.js +199 -192
- package/package.json +4 -4
- package/dist/index.d.ts +0 -2
- package/dist/telemetry.d.ts +0 -7
- package/dist/tools.d.ts +0 -20
package/dist/telemetry.js
CHANGED
|
@@ -1,45 +1,59 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var telemetry_exports = {};
|
|
20
|
+
__export(telemetry_exports, {
|
|
21
|
+
getTelemetryCounts: () => getTelemetryCounts,
|
|
22
|
+
telemetryIncrement: () => telemetryIncrement
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(telemetry_exports);
|
|
7
25
|
const counters = {};
|
|
8
26
|
const TELEMETRY_ENDPOINT = "https://api.studio.thegraph.com/query/1744392/openttt-base-sepolia/v0.1.0";
|
|
9
|
-
/**
|
|
10
|
-
* Increment an anonymous tool-call counter.
|
|
11
|
-
* Posts to subgraph endpoint as a best-effort ping. Never throws.
|
|
12
|
-
*/
|
|
13
27
|
function telemetryIncrement(toolName) {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
catch {
|
|
39
|
-
// never block the tool call
|
|
40
|
-
}
|
|
28
|
+
counters[toolName] = (counters[toolName] ?? 0) + 1;
|
|
29
|
+
try {
|
|
30
|
+
const body = JSON.stringify({
|
|
31
|
+
query: `{ _meta { block { number } } }`,
|
|
32
|
+
extensions: {
|
|
33
|
+
telemetry: {
|
|
34
|
+
tool: toolName,
|
|
35
|
+
count: counters[toolName],
|
|
36
|
+
ts: Date.now(),
|
|
37
|
+
pkg: "@helm-protocol/ttt-mcp",
|
|
38
|
+
v: "0.1.0"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
fetch(TELEMETRY_ENDPOINT, {
|
|
43
|
+
method: "POST",
|
|
44
|
+
headers: { "Content-Type": "application/json" },
|
|
45
|
+
body,
|
|
46
|
+
signal: AbortSignal.timeout(3e3)
|
|
47
|
+
}).catch(() => {
|
|
48
|
+
});
|
|
49
|
+
} catch {
|
|
50
|
+
}
|
|
41
51
|
}
|
|
42
|
-
/** Get current session counters (for debugging) */
|
|
43
52
|
function getTelemetryCounts() {
|
|
44
|
-
|
|
53
|
+
return { ...counters };
|
|
45
54
|
}
|
|
55
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
+
0 && (module.exports = {
|
|
57
|
+
getTelemetryCounts,
|
|
58
|
+
telemetryIncrement
|
|
59
|
+
});
|
package/dist/tools.js
CHANGED
|
@@ -1,114 +1,118 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var tools_exports = {};
|
|
20
|
+
__export(tools_exports, {
|
|
21
|
+
potGenerate: () => potGenerate,
|
|
22
|
+
potHealth: () => potHealth,
|
|
23
|
+
potQuery: () => potQuery,
|
|
24
|
+
potStats: () => potStats,
|
|
25
|
+
potVerify: () => potVerify
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(tools_exports);
|
|
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
|
+
var import_telemetry = require("./telemetry");
|
|
32
|
+
const timeSynth = new import_openttt.TimeSynthesis();
|
|
33
|
+
const adaptiveSwitch = new import_adaptive_switch.AdaptiveSwitch();
|
|
34
|
+
const potSigner = new import_openttt.PotSigner();
|
|
16
35
|
const startedAt = Date.now();
|
|
17
|
-
|
|
18
|
-
const POT_LOG_MAX = 10000;
|
|
36
|
+
const POT_LOG_MAX = 1e4;
|
|
19
37
|
const potLog = [];
|
|
20
|
-
// ---------- Helpers ----------
|
|
21
38
|
function bigintReplacer(_key, value) {
|
|
22
|
-
|
|
39
|
+
return typeof value === "bigint" ? value.toString() : value;
|
|
23
40
|
}
|
|
24
41
|
function serialize(obj) {
|
|
25
|
-
|
|
42
|
+
return JSON.parse(JSON.stringify(obj, bigintReplacer));
|
|
26
43
|
}
|
|
27
44
|
const SUBGRAPH_URL = "https://api.studio.thegraph.com/query/1744392/openttt-base-sepolia/v0.1.0";
|
|
28
|
-
// ---------- Tool: pot_generate ----------
|
|
29
45
|
async function potGenerate(args) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
issuerPubKey: signature.issuerPubKey,
|
|
64
|
-
signature: signature.signature,
|
|
65
|
-
issuedAt: signature.issuedAt.toString(),
|
|
66
|
-
},
|
|
67
|
-
});
|
|
46
|
+
(0, import_telemetry.telemetryIncrement)("pot_generate");
|
|
47
|
+
const pot = await timeSynth.generateProofOfTime();
|
|
48
|
+
const potHash = import_openttt.TimeSynthesis.getOnChainHash(pot);
|
|
49
|
+
const txData = new TextEncoder().encode(args.txHash);
|
|
50
|
+
const grgShards = import_grg_pipeline.GrgPipeline.processForward(txData, args.chainId, args.poolAddress);
|
|
51
|
+
const signature = potSigner.signPot(potHash);
|
|
52
|
+
const entry = {
|
|
53
|
+
potHash,
|
|
54
|
+
timestamp: pot.timestamp.toString(),
|
|
55
|
+
stratum: pot.stratum,
|
|
56
|
+
mode: adaptiveSwitch.getCurrentMode(),
|
|
57
|
+
chainId: args.chainId,
|
|
58
|
+
poolAddress: args.poolAddress,
|
|
59
|
+
createdAt: Date.now()
|
|
60
|
+
};
|
|
61
|
+
potLog.push(entry);
|
|
62
|
+
if (potLog.length > POT_LOG_MAX) potLog.shift();
|
|
63
|
+
return serialize({
|
|
64
|
+
potHash,
|
|
65
|
+
timestamp: pot.timestamp.toString(),
|
|
66
|
+
stratum: pot.stratum,
|
|
67
|
+
uncertainty: pot.uncertainty,
|
|
68
|
+
confidence: pot.confidence,
|
|
69
|
+
sources: pot.sources,
|
|
70
|
+
nonce: pot.nonce,
|
|
71
|
+
expiresAt: pot.expiresAt.toString(),
|
|
72
|
+
grgShards: grgShards.map((s) => Buffer.from(s).toString("hex")),
|
|
73
|
+
signature: {
|
|
74
|
+
issuerPubKey: signature.issuerPubKey,
|
|
75
|
+
signature: signature.signature,
|
|
76
|
+
issuedAt: signature.issuedAt.toString()
|
|
77
|
+
}
|
|
78
|
+
});
|
|
68
79
|
}
|
|
69
|
-
// ---------- Tool: pot_verify ----------
|
|
70
80
|
async function potVerify(args) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
});
|
|
81
|
+
(0, import_telemetry.telemetryIncrement)("pot_verify");
|
|
82
|
+
const shards = args.grgShards.map((hex) => new Uint8Array(Buffer.from(hex, "hex")));
|
|
83
|
+
let valid = false;
|
|
84
|
+
let reconstructedSize = 0;
|
|
85
|
+
try {
|
|
86
|
+
const recovered = import_grg_pipeline.GrgPipeline.processInverse(shards, 0, args.chainId, args.poolAddress);
|
|
87
|
+
valid = recovered.length > 0;
|
|
88
|
+
reconstructedSize = recovered.length;
|
|
89
|
+
} catch {
|
|
90
|
+
valid = false;
|
|
91
|
+
}
|
|
92
|
+
const mode = adaptiveSwitch.getCurrentMode() === import_adaptive_switch.AdaptiveMode.TURBO ? "turbo" : "full";
|
|
93
|
+
return serialize({
|
|
94
|
+
valid,
|
|
95
|
+
mode,
|
|
96
|
+
potHash: args.potHash,
|
|
97
|
+
reconstructedBytes: reconstructedSize,
|
|
98
|
+
verifiedAt: Date.now()
|
|
99
|
+
});
|
|
91
100
|
}
|
|
92
|
-
// ---------- Tool: pot_query ----------
|
|
93
101
|
async function potQuery(args) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
// Best-effort subgraph query
|
|
104
|
-
let subgraphEntries = [];
|
|
105
|
-
try {
|
|
106
|
-
const query = `{
|
|
102
|
+
(0, import_telemetry.telemetryIncrement)("pot_query");
|
|
103
|
+
const limit = Math.min(args.limit ?? 100, 1e3);
|
|
104
|
+
const now = Date.now();
|
|
105
|
+
const startTime = args.startTime ?? now - 864e5;
|
|
106
|
+
const endTime = args.endTime ?? now;
|
|
107
|
+
const filtered = potLog.filter((e) => e.createdAt >= startTime && e.createdAt <= endTime).slice(-limit);
|
|
108
|
+
let subgraphEntries = [];
|
|
109
|
+
try {
|
|
110
|
+
const query = `{
|
|
107
111
|
potAnchors(
|
|
108
112
|
first: ${limit},
|
|
109
113
|
orderBy: blockTimestamp,
|
|
110
114
|
orderDirection: desc,
|
|
111
|
-
where: { blockTimestamp_gte: "${Math.floor(startTime /
|
|
115
|
+
where: { blockTimestamp_gte: "${Math.floor(startTime / 1e3)}", blockTimestamp_lte: "${Math.floor(endTime / 1e3)}" }
|
|
112
116
|
) {
|
|
113
117
|
id
|
|
114
118
|
potHash
|
|
@@ -116,110 +120,113 @@ async function potQuery(args) {
|
|
|
116
120
|
txHash
|
|
117
121
|
}
|
|
118
122
|
}`;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
});
|
|
127
|
-
clearTimeout(timeout);
|
|
128
|
-
if (resp.ok) {
|
|
129
|
-
const json = (await resp.json());
|
|
130
|
-
subgraphEntries = json.data?.potAnchors ?? [];
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
catch {
|
|
134
|
-
// Subgraph unavailable — local log still returned
|
|
135
|
-
}
|
|
136
|
-
return serialize({
|
|
137
|
-
local: filtered,
|
|
138
|
-
subgraph: subgraphEntries,
|
|
139
|
-
totalLocal: potLog.length,
|
|
140
|
-
query: { startTime, endTime, limit },
|
|
123
|
+
const controller = new AbortController();
|
|
124
|
+
const timeout = setTimeout(() => controller.abort(), 5e3);
|
|
125
|
+
const resp = await fetch(SUBGRAPH_URL, {
|
|
126
|
+
method: "POST",
|
|
127
|
+
headers: { "Content-Type": "application/json" },
|
|
128
|
+
body: JSON.stringify({ query }),
|
|
129
|
+
signal: controller.signal
|
|
141
130
|
});
|
|
131
|
+
clearTimeout(timeout);
|
|
132
|
+
if (resp.ok) {
|
|
133
|
+
const json = await resp.json();
|
|
134
|
+
subgraphEntries = json.data?.potAnchors ?? [];
|
|
135
|
+
}
|
|
136
|
+
} catch {
|
|
137
|
+
}
|
|
138
|
+
return serialize({
|
|
139
|
+
local: filtered,
|
|
140
|
+
subgraph: subgraphEntries,
|
|
141
|
+
totalLocal: potLog.length,
|
|
142
|
+
query: { startTime, endTime, limit }
|
|
143
|
+
});
|
|
142
144
|
}
|
|
143
|
-
// ---------- Tool: pot_stats ----------
|
|
144
145
|
async function potStats(args) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
146
|
+
(0, import_telemetry.telemetryIncrement)("pot_stats");
|
|
147
|
+
const now = Date.now();
|
|
148
|
+
const periodMs = {
|
|
149
|
+
day: 864e5,
|
|
150
|
+
week: 6048e5,
|
|
151
|
+
month: 2592e6
|
|
152
|
+
};
|
|
153
|
+
const cutoff = now - (periodMs[args.period] ?? periodMs.day);
|
|
154
|
+
const entries = potLog.filter((e) => e.createdAt >= cutoff);
|
|
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;
|
|
157
|
+
const totalSwaps = entries.length;
|
|
158
|
+
return serialize({
|
|
159
|
+
period: args.period,
|
|
160
|
+
totalSwaps,
|
|
161
|
+
turboCount,
|
|
162
|
+
fullCount,
|
|
163
|
+
turboRatio: totalSwaps > 0 ? +(turboCount / totalSwaps).toFixed(4) : 0,
|
|
164
|
+
currentMode: adaptiveSwitch.getCurrentMode(),
|
|
165
|
+
windowStart: new Date(cutoff).toISOString(),
|
|
166
|
+
windowEnd: new Date(now).toISOString()
|
|
167
|
+
});
|
|
167
168
|
}
|
|
168
|
-
// ---------- Tool: pot_health ----------
|
|
169
169
|
async function potHealth() {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
170
|
+
(0, import_telemetry.telemetryIncrement)("pot_health");
|
|
171
|
+
let timeStatus = "unknown";
|
|
172
|
+
let synthSources = 0;
|
|
173
|
+
try {
|
|
174
|
+
const synth = await Promise.race([
|
|
175
|
+
timeSynth.synthesize(),
|
|
176
|
+
new Promise(
|
|
177
|
+
(_, reject) => setTimeout(() => reject(new Error("timeout")), 5e3)
|
|
178
|
+
)
|
|
179
|
+
]);
|
|
180
|
+
if (synth && synth.sources >= 2) {
|
|
181
|
+
timeStatus = "healthy";
|
|
182
|
+
synthSources = synth.sources;
|
|
183
|
+
} else {
|
|
184
|
+
timeStatus = "degraded";
|
|
185
|
+
synthSources = synth?.sources ?? 0;
|
|
186
186
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
}
|
|
187
|
+
} catch {
|
|
188
|
+
timeStatus = "unhealthy";
|
|
189
|
+
}
|
|
190
|
+
let latestBlock = 0;
|
|
191
|
+
let syncStatus = "unknown";
|
|
192
|
+
try {
|
|
193
|
+
const query = `{ _meta { block { number } hasIndexingErrors } }`;
|
|
194
|
+
const controller = new AbortController();
|
|
195
|
+
const timeout = setTimeout(() => controller.abort(), 5e3);
|
|
196
|
+
const resp = await fetch(SUBGRAPH_URL, {
|
|
197
|
+
method: "POST",
|
|
198
|
+
headers: { "Content-Type": "application/json" },
|
|
199
|
+
body: JSON.stringify({ query }),
|
|
200
|
+
signal: controller.signal
|
|
201
|
+
});
|
|
202
|
+
clearTimeout(timeout);
|
|
203
|
+
if (resp.ok) {
|
|
204
|
+
const json = await resp.json();
|
|
205
|
+
latestBlock = json.data?._meta?.block?.number ?? 0;
|
|
206
|
+
syncStatus = json.data?._meta?.hasIndexingErrors ? "indexing_errors" : "synced";
|
|
208
207
|
}
|
|
209
|
-
|
|
210
|
-
|
|
208
|
+
} catch {
|
|
209
|
+
syncStatus = "unreachable";
|
|
210
|
+
}
|
|
211
|
+
const uptimeMs = Date.now() - startedAt;
|
|
212
|
+
return serialize({
|
|
213
|
+
status: timeStatus === "healthy" ? "ok" : timeStatus,
|
|
214
|
+
timeSources: { status: timeStatus, activeSources: synthSources },
|
|
215
|
+
subgraph: { latestBlock, syncStatus },
|
|
216
|
+
server: {
|
|
217
|
+
uptime: uptimeMs,
|
|
218
|
+
uptimeHuman: `${(uptimeMs / 36e5).toFixed(1)}h`,
|
|
219
|
+
potCount: potLog.length,
|
|
220
|
+
currentMode: adaptiveSwitch.getCurrentMode(),
|
|
221
|
+
signerPubKey: potSigner.getPubKeyHex()
|
|
211
222
|
}
|
|
212
|
-
|
|
213
|
-
return serialize({
|
|
214
|
-
status: timeStatus === "healthy" ? "ok" : timeStatus,
|
|
215
|
-
timeSources: { status: timeStatus, activeSources: synthSources },
|
|
216
|
-
subgraph: { latestBlock, syncStatus },
|
|
217
|
-
server: {
|
|
218
|
-
uptime: uptimeMs,
|
|
219
|
-
uptimeHuman: `${(uptimeMs / 3600000).toFixed(1)}h`,
|
|
220
|
-
potCount: potLog.length,
|
|
221
|
-
currentMode: adaptiveSwitch.getCurrentMode(),
|
|
222
|
-
signerPubKey: potSigner.getPubKeyHex(),
|
|
223
|
-
},
|
|
224
|
-
});
|
|
223
|
+
});
|
|
225
224
|
}
|
|
225
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
226
|
+
0 && (module.exports = {
|
|
227
|
+
potGenerate,
|
|
228
|
+
potHealth,
|
|
229
|
+
potQuery,
|
|
230
|
+
potStats,
|
|
231
|
+
potVerify
|
|
232
|
+
});
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
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
|
-
"types": "dist/index.d.ts",
|
|
7
6
|
"bin": {
|
|
8
7
|
"ttt-mcp": "./dist/index.js"
|
|
9
8
|
},
|
|
@@ -12,7 +11,7 @@
|
|
|
12
11
|
"README.md"
|
|
13
12
|
],
|
|
14
13
|
"scripts": {
|
|
15
|
-
"build": "
|
|
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",
|
|
16
15
|
"start": "node dist/index.js",
|
|
17
16
|
"dev": "npx ts-node index.ts"
|
|
18
17
|
},
|
|
@@ -37,11 +36,12 @@
|
|
|
37
36
|
},
|
|
38
37
|
"dependencies": {
|
|
39
38
|
"@modelcontextprotocol/sdk": "^1.12.1",
|
|
40
|
-
"openttt": "^0.
|
|
39
|
+
"openttt": "^0.2.9",
|
|
41
40
|
"zod": "^3.25.0"
|
|
42
41
|
},
|
|
43
42
|
"devDependencies": {
|
|
44
43
|
"@types/node": "^20.11.19",
|
|
44
|
+
"esbuild": "^0.27.4",
|
|
45
45
|
"typescript": "^5.3.3"
|
|
46
46
|
},
|
|
47
47
|
"mcpName": "io.github.Helm-Protocol/openttt-pot"
|
package/dist/index.d.ts
DELETED
package/dist/telemetry.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Increment an anonymous tool-call counter.
|
|
3
|
-
* Posts to subgraph endpoint as a best-effort ping. Never throws.
|
|
4
|
-
*/
|
|
5
|
-
export declare function telemetryIncrement(toolName: string): void;
|
|
6
|
-
/** Get current session counters (for debugging) */
|
|
7
|
-
export declare function getTelemetryCounts(): Record<string, number>;
|
package/dist/tools.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export declare function potGenerate(args: {
|
|
2
|
-
txHash: string;
|
|
3
|
-
chainId: number;
|
|
4
|
-
poolAddress: string;
|
|
5
|
-
}): Promise<unknown>;
|
|
6
|
-
export declare function potVerify(args: {
|
|
7
|
-
potHash: string;
|
|
8
|
-
grgShards: string[];
|
|
9
|
-
chainId: number;
|
|
10
|
-
poolAddress: string;
|
|
11
|
-
}): Promise<unknown>;
|
|
12
|
-
export declare function potQuery(args: {
|
|
13
|
-
startTime?: number;
|
|
14
|
-
endTime?: number;
|
|
15
|
-
limit?: number;
|
|
16
|
-
}): Promise<unknown>;
|
|
17
|
-
export declare function potStats(args: {
|
|
18
|
-
period: "day" | "week" | "month";
|
|
19
|
-
}): Promise<unknown>;
|
|
20
|
-
export declare function potHealth(): Promise<unknown>;
|