@taptap/instant-games-open-mcp 1.21.1 → 1.22.0-beta.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/README.md +9 -1
- package/dist/proxy.js +19 -7
- package/dist/server.js +160 -121
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -152,10 +152,11 @@ curl http://localhost:5002/health # RND
|
|
|
152
152
|
|
|
153
153
|
- `get_leaderboard_integration_guide` - 排行榜完整接入工作流指引
|
|
154
154
|
|
|
155
|
-
#### 信息查询 (
|
|
155
|
+
#### 信息查询 (3)
|
|
156
156
|
|
|
157
157
|
- `get_current_app_info` - 获取当前应用信息
|
|
158
158
|
- `check_environment` - 检查环境配置
|
|
159
|
+
- `get_environment_switch_guide` - 获取 production/RND 环境切换配置指引
|
|
159
160
|
|
|
160
161
|
#### 认证 (3)
|
|
161
162
|
|
|
@@ -303,6 +304,13 @@ npm test
|
|
|
303
304
|
|
|
304
305
|
详细说明请参考 [docs/LOG_SYSTEM.md](docs/LOG_SYSTEM.md)
|
|
305
306
|
|
|
307
|
+
### 环境切换帮助
|
|
308
|
+
|
|
309
|
+
如果需要在 AI 对话中切换测试环境,可以让 AI 调用
|
|
310
|
+
`get_environment_switch_guide` 查看配置示例,再更新 MCP 客户端配置中的 `env` 字段。
|
|
311
|
+
RND 环境需要显式配置 `TAPTAP_MCP_CLIENT_ID` 和 `TAPTAP_MCP_CLIENT_SECRET`,
|
|
312
|
+
production 通常使用内置 native signer,无需额外配置。
|
|
313
|
+
|
|
306
314
|
### 添加新功能
|
|
307
315
|
|
|
308
316
|
```bash
|
package/dist/proxy.js
CHANGED
|
@@ -29137,7 +29137,7 @@ var LogWriter = class {
|
|
|
29137
29137
|
};
|
|
29138
29138
|
|
|
29139
29139
|
// src/mcp-proxy/proxy.ts
|
|
29140
|
-
var VERSION = true ? "1.
|
|
29140
|
+
var VERSION = true ? "1.22.0-beta.1" : "dev";
|
|
29141
29141
|
var TapTapMCPProxy = class {
|
|
29142
29142
|
constructor(config2) {
|
|
29143
29143
|
this.connected = false;
|
|
@@ -29646,7 +29646,7 @@ var TapTapMCPProxy = class {
|
|
|
29646
29646
|
return result;
|
|
29647
29647
|
});
|
|
29648
29648
|
this.server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
|
|
29649
|
-
var _a3, _b, _c, _d, _e;
|
|
29649
|
+
var _a3, _b, _c, _d, _e, _f, _g;
|
|
29650
29650
|
const { name, arguments: args } = request.params;
|
|
29651
29651
|
const shouldInjectParams = ((_a3 = this.config.options) == null ? void 0 : _a3.inject_params_per_call) ?? true;
|
|
29652
29652
|
const finalArgs = shouldInjectParams ? this.injectPrivateParams(args) : args;
|
|
@@ -29658,6 +29658,7 @@ var TapTapMCPProxy = class {
|
|
|
29658
29658
|
timeout: ((_d = this.config.options) == null ? void 0 : _d.tool_call_timeout) ?? 3e5,
|
|
29659
29659
|
resetTimeoutOnProgress: ((_e = this.config.options) == null ? void 0 : _e.reset_timeout_on_progress) ?? true
|
|
29660
29660
|
};
|
|
29661
|
+
const forceInjectProgressToken = ((_f = this.config.options) == null ? void 0 : _f.force_inject_progress_token) ?? false;
|
|
29661
29662
|
if (progressToken !== void 0) {
|
|
29662
29663
|
callToolOptions.onprogress = (progress) => {
|
|
29663
29664
|
extra.sendNotification({
|
|
@@ -29666,6 +29667,15 @@ var TapTapMCPProxy = class {
|
|
|
29666
29667
|
}).catch(() => {
|
|
29667
29668
|
});
|
|
29668
29669
|
};
|
|
29670
|
+
} else if (forceInjectProgressToken) {
|
|
29671
|
+
callToolOptions.onprogress = () => {
|
|
29672
|
+
};
|
|
29673
|
+
if ((_g = this.config.options) == null ? void 0 : _g.verbose) {
|
|
29674
|
+
this.log(
|
|
29675
|
+
"debug",
|
|
29676
|
+
`Sentinel onprogress registered for outbound progressToken injection: tool=${name}`
|
|
29677
|
+
);
|
|
29678
|
+
}
|
|
29669
29679
|
}
|
|
29670
29680
|
if (!this.connected) {
|
|
29671
29681
|
if (this.reconnecting) {
|
|
@@ -29820,7 +29830,7 @@ function validateConfig(config2) {
|
|
|
29820
29830
|
}
|
|
29821
29831
|
var DEFAULT_LOG_ROOT = "/tmp/taptap-mcp/logs";
|
|
29822
29832
|
function applyDefaults(config2) {
|
|
29823
|
-
var _a3, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
|
29833
|
+
var _a3, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
29824
29834
|
const verbose = ((_a3 = config2.options) == null ? void 0 : _a3.verbose) ?? false;
|
|
29825
29835
|
return {
|
|
29826
29836
|
server: {
|
|
@@ -29843,12 +29853,14 @@ function applyDefaults(config2) {
|
|
|
29843
29853
|
reset_timeout_on_progress: ((_e = config2.options) == null ? void 0 : _e.reset_timeout_on_progress) ?? true,
|
|
29844
29854
|
health_check_interval: ((_f = config2.options) == null ? void 0 : _f.health_check_interval) ?? 3e4,
|
|
29845
29855
|
enable_cookie_sticky: ((_g = config2.options) == null ? void 0 : _g.enable_cookie_sticky) ?? true,
|
|
29856
|
+
inject_params_per_call: ((_h = config2.options) == null ? void 0 : _h.inject_params_per_call) ?? true,
|
|
29857
|
+
force_inject_progress_token: ((_i = config2.options) == null ? void 0 : _i.force_inject_progress_token) ?? false,
|
|
29846
29858
|
log: {
|
|
29847
|
-
root: ((
|
|
29848
|
-
enabled: ((
|
|
29859
|
+
root: ((_k = (_j = config2.options) == null ? void 0 : _j.log) == null ? void 0 : _k.root) ?? DEFAULT_LOG_ROOT,
|
|
29860
|
+
enabled: ((_m = (_l = config2.options) == null ? void 0 : _l.log) == null ? void 0 : _m.enabled) ?? false,
|
|
29849
29861
|
// verbose=true 时自动使用 debug 级别
|
|
29850
|
-
level: verbose ? "debug" : ((
|
|
29851
|
-
max_days: ((
|
|
29862
|
+
level: verbose ? "debug" : ((_o = (_n = config2.options) == null ? void 0 : _n.log) == null ? void 0 : _o.level) ?? "info",
|
|
29863
|
+
max_days: ((_q = (_p = config2.options) == null ? void 0 : _p.log) == null ? void 0 : _q.max_days) ?? 7
|
|
29852
29864
|
}
|
|
29853
29865
|
}
|
|
29854
29866
|
};
|