@taptap/instant-games-open-mcp 1.24.7-beta.1 → 1.24.7
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 +23 -96
- package/dist/proxy.js +64 -7
- package/dist/server.js +85 -84
- package/package.json +7 -9
- package/bin/taptap-maker +0 -27
- package/dist/maker.js +0 -33909
- package/skills/taptap-maker-dev-kit-guide/SKILL.md +0 -55
- package/skills/taptap-maker-local/SKILL.md +0 -483
- package/skills/update-taptap-mcp/SKILL.md +0 -203
package/README.md
CHANGED
|
@@ -18,10 +18,11 @@
|
|
|
18
18
|
- **🤖 智能引导** - AI Agent 自动验证前置条件,主动询问用户选择
|
|
19
19
|
|
|
20
20
|
**NPM**: [@taptap/instant-games-open-mcp](https://www.npmjs.com/package/@taptap/instant-games-open-mcp)
|
|
21
|
+
**Maker NPM**: [@taptap/maker](https://www.npmjs.com/package/@taptap/maker)
|
|
21
22
|
|
|
22
23
|
## 🦞 OpenClaw Plugin(实验中)
|
|
23
24
|
|
|
24
|
-
|
|
25
|
+
仓库内提供了一个可独立使用的 OpenClaw plugin 子包:
|
|
25
26
|
|
|
26
27
|
- [`packages/openclaw-dc-plugin`](packages/openclaw-dc-plugin)
|
|
27
28
|
|
|
@@ -41,18 +42,17 @@
|
|
|
41
42
|
详见:
|
|
42
43
|
|
|
43
44
|
- [OpenClaw Plugin 说明](docs/OPENCLAW_PLUGIN.md)
|
|
44
|
-
- 维护者发布方式:`npm run openclaw:pack` / `npm run openclaw:publish`
|
|
45
45
|
|
|
46
46
|
## 🛠️ TapTap Maker 本地开发(CLI-first)
|
|
47
47
|
|
|
48
|
-
Maker
|
|
48
|
+
Maker 本地开发独立发布为 `@taptap/maker`。首次配置推荐直接运行:
|
|
49
49
|
|
|
50
50
|
```bash
|
|
51
|
-
npx -y
|
|
51
|
+
npx -y @taptap/maker init
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
-
CLI 负责一次性流程:Git 检查、
|
|
55
|
-
|
|
54
|
+
CLI 负责一次性流程:Git 检查、CLI 登录、TapTap token 换取、app 列表选择、Maker Git
|
|
55
|
+
clone、AI dev kit 准备、MCP 配置写入与基础验证。安装或修改 MCP 配置后,Claude Code /
|
|
56
56
|
Codex / Cursor 通常需要重启会话、刷新 MCP 或新开窗口才会出现新的 MCP tools;但当前终端
|
|
57
57
|
里的 CLI 初始化流程可以继续完成到 PAT 鉴权和项目绑定。
|
|
58
58
|
|
|
@@ -60,30 +60,26 @@ Codex / Cursor 通常需要重启会话、刷新 MCP 或新开窗口才会出现
|
|
|
60
60
|
|
|
61
61
|
```bash
|
|
62
62
|
taptap-maker init
|
|
63
|
+
taptap-maker login
|
|
63
64
|
taptap-maker doctor
|
|
64
65
|
taptap-maker apps --json
|
|
65
|
-
taptap-maker
|
|
66
|
-
taptap-maker mcp install --ide codex,cursor,claude
|
|
66
|
+
taptap-maker install --ide codex,cursor,claude
|
|
67
67
|
taptap-maker mcp verify
|
|
68
68
|
taptap-maker dev-kit update
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
`taptap-maker
|
|
72
|
-
`
|
|
73
|
-
`taptap-maker
|
|
74
|
-
|
|
75
|
-
`
|
|
76
|
-
尚未启动;这不是 PAT、app 选择或 Maker 业务接口报错。先按输出里的 command
|
|
77
|
-
在终端直接执行,再检查 `where.exe npx/node/npm`、`node -v` 和 `npm -v`。
|
|
71
|
+
`taptap-maker login` 是 CLI 登录入口;它会按需打开 Maker 授权页,CLI 轮询授权结果并完成本地鉴权配置。
|
|
72
|
+
`taptap-maker init` 缺 PAT 时会自动进入该流程。`taptap-maker pat set` 保留为兼容入口;
|
|
73
|
+
自动化场景可用 `--pat-stdin` 从标准输入读取。`taptap-maker install` 是
|
|
74
|
+
`taptap-maker mcp install` 的快捷别名,二者都会写入 AI 客户端 MCP 配置。
|
|
75
|
+
`taptap-maker dev-kit update` 会检查当前环境可用的最新 AI dev kit 并更新当前目录。
|
|
78
76
|
|
|
79
|
-
MCP 精简为开发循环里的高频能力:
|
|
77
|
+
Maker MCP 精简为开发循环里的高频能力:
|
|
80
78
|
|
|
81
79
|
```text
|
|
82
80
|
maker://status # Resource,读取本地 Maker 状态
|
|
83
81
|
maker_status_lite # Resource 不可用时的兼容 tool
|
|
84
82
|
maker_build_current_directory # commit/push/build 合并入口
|
|
85
|
-
maker_pull_runtime_logs # 单次拉取运行日志并落到本地固定路径
|
|
86
|
-
taptap-maker logs watch # CLI,构建成功后持续轮询运行日志
|
|
87
83
|
```
|
|
88
84
|
|
|
89
85
|
`maker_build_current_directory` 同时覆盖“构建 / 预览 / 跑一下 / 验证一下 / 提交 / 推送”。
|
|
@@ -93,57 +89,18 @@ build。push 失败时不会继续 build,会返回本地 commit、ahead 状态
|
|
|
93
89
|
Maker 远端但构建失败。只有用户明确说“不提交,只构建云端版本”时,才传
|
|
94
90
|
`confirm_remote_build_without_submit=true`。
|
|
95
91
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
`maker_pull_runtime_logs` 只做固定的一次性业务流:调用远端 `query_runtime_logs`,默认只拉
|
|
105
|
-
`engine`、`user_script`(客户端 Lua 脚本)和 `server_user_script`(服务端 Lua 脚本)。
|
|
106
|
-
本地只追加写入一份
|
|
107
|
-
`.maker/logs/runtime/runtime.log`,保持 server 日志行格式(`t/topic/level/msg/userId` 等),
|
|
108
|
-
但去掉无用的 `id` 字段,也不再补 `time/message` 重复字段;`.maker/logs/runtime/state.json`
|
|
109
|
-
保存下一次查询游标和 watcher 心跳状态,包括最近轮询时间、最近成功时间、最近写入条数、
|
|
110
|
-
连续失败次数和最后错误。
|
|
111
|
-
持续轮询和清理旧日志由 `taptap-maker logs watch --reset --interval 5s` 承担,不放进 MCP
|
|
112
|
-
tool 长调用;远端返回 `hasMore=true` 时会立即继续拉取,否则每 5 秒轮询一次。
|
|
113
|
-
|
|
114
|
-
`maker://status` 和 `maker_status_lite` 会在已绑定项目里检查 Maker 远端同步状态。
|
|
115
|
-
如果远端有新提交,状态输出会区分本地工作区是否干净:干净时提示可先
|
|
116
|
-
`git pull --ff-only origin main`,有本地改动时提示不要直接 pull,应让本地 Agent 先处理
|
|
117
|
-
提交、stash 或取消同步。
|
|
118
|
-
频繁轮询状态或只需要快速本地状态时,调用 `maker_status_lite` 应传
|
|
119
|
-
`skip_remote_sync=true`,避免每次状态查询都触发 `git fetch origin` 网络往返。
|
|
120
|
-
|
|
121
|
-
首次 clone/fetch 和 push 遇到 503、HTTP 5xx、超时、连接重置、RPC/HTTP2 中断等临时网络错误时会自动重试;认证、权限、仓库不存在、远端拒绝和本地目录冲突不会重试,会把错误分类交给 Agent 处理。首次 clone/fetch 前 CLI 会提示 Maker server 可能正在准备仓库,首次拉代码 20 秒以上是正常现象,建议保持命令运行等待自动重试。
|
|
92
|
+
构建成功后,Maker MCP 会刷新 Maker Web 预览,并启动本地 runtime log watcher。后续如果用户询问
|
|
93
|
+
游戏运行结果、Lua 报错或调试问题,本地 AI Agent 应优先读取构建返回中的
|
|
94
|
+
`runtime_logs.local_file`;如需判断 watcher 是否正常,读取 `runtime_logs.state_file`。
|
|
95
|
+
|
|
96
|
+
Maker MCP 也提供部分生成类能力,当前包括 `generate_image`、`batch_generate_images`、
|
|
97
|
+
`edit_image`、`create_video_task` 和 `text_to_music`;具体参数以 MCP 客户端展示的 tool
|
|
98
|
+
schema 为准。代理转发和白名单细节见 [TapTap Maker 本地开发](docs/MAKER.md)。
|
|
122
99
|
|
|
123
100
|
Windows 是默认优先级:CLI 写 MCP 配置时会在 Windows 使用 `npx.cmd`,Git 引导优先提示
|
|
124
101
|
Git for Windows,并要求安装选项允许命令行和第三方工具通过 PATH 找到 Git。macOS 用户可通过
|
|
125
102
|
`git --version` 触发 Xcode Command Line Tools,或安装官方 Git。
|
|
126
103
|
|
|
127
|
-
### Maker 本地 Workflow Skills(实验中)
|
|
128
|
-
|
|
129
|
-
Maker 现在同时内置三个工作流 skill:
|
|
130
|
-
|
|
131
|
-
- `taptap-maker-local`:把 Maker 初始化转交 CLI,并让本地 AI/Agent 按 push 失败分类处理 pull/rebase、切回 main、移除禁止路径、鉴权刷新、冲突和构建失败恢复。
|
|
132
|
-
- `taptap-maker-dev-kit-guide`:介绍 clone 时安装到项目目录的 AI dev kit,明确 `CLAUDE.md`、`examples/`、`templates/`、`urhox-libs/` 的用途。
|
|
133
|
-
- `update-taptap-mcp`:引导用户更新本地 npx 缓存里的 `@taptap/instant-games-open-mcp`,并提醒 Maker MCP 推荐安装到 user/global scope。
|
|
134
|
-
|
|
135
|
-
初始化流程里,PAT 验证通过、用户选择 app 后,`taptap-maker init` 会自动准备本地 AI dev kit。
|
|
136
|
-
|
|
137
|
-
CLI 会根据 `TAPTAP_MCP_ENV` 自动选择下载源:`production`(默认)使用 `https://urhox-demo-platform.spark.xd.com/ai-dev-kit/pd/stable/ai-dev-kit.zip`,`rnd` 使用 `https://urhox-demo-platform.spark.xd.com/ai-dev-kit/rnd/latest/ai-dev-kit.zip`,解压开发环境文档、引擎 API、demo、Lua 工具和本地 AI skills 到当前目录;解压复制完成后会自动运行 `tools/install-skills.sh all`(Linux/macOS)或 `tools/install-skills.ps1 all`(Windows),把 dev kit skills 安装到各 Agent 的发现目录。CLI 会先输出 `AI skills install started: <script>`,完成后输出 `AI skills install result: claude=N, codex=N, cursor=N, gemini=N`;脚本缺失、跳过或失败时也会输出原因,失败会带上平台、脚本、命令、stdout 和 stderr,方便 AI 与用户直接判断安装情况。流程会跳过 ZIP 里的顶层 `scripts` 目录并删除下载 ZIP,避免和 Maker 项目代码冲突。dev kit 准备成功后会刷新项目根 `.gitignore`,防止这些本地开发环境文件、Agent skill 目录和 `.maker/` 本地运行状态被提交到 Maker Git;`.gitignore` 本身是 Maker 项目必要文件,首次 init 生成后应随游戏代码提交。
|
|
138
|
-
|
|
139
|
-
`maker://status` 和 `maker_status_lite` 会输出已随包内置的 skill 名称和文档路径:`taptap-maker-local`、`taptap-maker-dev-kit-guide` 与 `update-taptap-mcp`。Maker 操作目标是用户当前项目目录;若 MCP 进程 cwd 是临时对话目录,Agent 应把用户当前项目目录作为 `target_dir` 传入,不扫描其他项目。已绑定项目会检查 `CLAUDE.md`、`examples/`、`templates/`、`urhox-libs/`,并输出 `skill_install_status` 和 `skill_install_summary` 说明 `.claude/.codex/.cursor/.gemini` 下的 skill 安装状态;缺失时用 `taptap-maker dev-kit update` 恢复本地 AI dev kit 并刷新 `.gitignore` 管理块。
|
|
140
|
-
|
|
141
|
-
Git 引导:
|
|
142
|
-
|
|
143
|
-
- macOS:用户自行执行 `git --version`,按系统提示安装 Xcode Command Line Tools,或访问 `https://git-scm.com/download/mac` 下载安装器。
|
|
144
|
-
- Windows:用户自行访问 `https://git-scm.com/download/win` 安装 Git for Windows,并确保安装选项允许命令行和第三方工具通过 PATH 找到 Git。
|
|
145
|
-
- 安装后需要重启 MCP 客户端或终端,再用 `git --version` 验证。
|
|
146
|
-
|
|
147
104
|
详见:[TapTap Maker 本地开发](docs/MAKER.md)。面向团队介绍的功能总览见
|
|
148
105
|
[Maker CLI + MCP + Skill Rework Overview](docs/MAKER_CLI_MCP_SKILL_REWORK_OVERVIEW.md)。
|
|
149
106
|
|
|
@@ -391,12 +348,10 @@ maker_status_lite
|
|
|
391
348
|
maker_build_current_directory
|
|
392
349
|
```
|
|
393
350
|
|
|
394
|
-
`taptap-maker doctor` 会检查 Git、PAT、TapTap token
|
|
351
|
+
`taptap-maker doctor` 会检查 Git、PAT、TapTap token、项目绑定、AI dev kit 版本和 MCP 配置。若 Git 不可用,clone/push 会直接停止,直到用户自行安装 Git 并通过 `git --version` 验证。
|
|
395
352
|
`taptap-maker mcp verify` 默认跑一次实际 MCP 配置使用的 npx 包命令;本地 dist 自测可用 `--mode self`。如果失败结果显示 `failure_type` 或 `status: null`,优先按本地 Node/npm/npx 启动问题处理,Maker MCP server 此时尚未启动,不要误判为 PAT 或 Maker 服务报错。
|
|
396
353
|
|
|
397
|
-
|
|
398
|
-
production 使用 `https://maker.taptap.cn/pat-tokens`,RND 使用 `https://fuping.agnt.xd.com/pat-tokens`,
|
|
399
|
-
再运行 `taptap-maker pat set` 并在 prompt 中粘贴 PAT,CLI 会同步获取 TapTap token。
|
|
354
|
+
测试时优先运行 `taptap-maker login`;CLI 会按需打开 Maker 授权页,授权完成后自动完成本地鉴权配置。
|
|
400
355
|
当前目录未绑定时,APP_ID 应通过 `taptap-maker init` 或 `taptap-maker apps` 返回的 app 列表让用户选择;当前目录已绑定时不要再次引导 clone。
|
|
401
356
|
|
|
402
357
|
```bash
|
|
@@ -535,36 +490,8 @@ graph LR
|
|
|
535
490
|
- **[docs/ARCHITECTURE.md](docs/ARCHITECTURE.md)** - 架构文档
|
|
536
491
|
- **[docs/DEPLOYMENT.md](docs/DEPLOYMENT.md)** - 部署指南(本地、Docker、开发者测试)
|
|
537
492
|
- **[docs/PROXY.md](docs/PROXY.md)** - MCP Proxy 开发指南(面向 TapCode 等平台)
|
|
538
|
-
- **[docs/CI_CD.md](docs/CI_CD.md)** - CI/CD 和自动化发布流程
|
|
539
493
|
- **[docs/PATH_RESOLUTION.md](docs/PATH_RESOLUTION.md)** - 路径解析系统
|
|
540
494
|
|
|
541
|
-
## 🔄 CI/CD
|
|
542
|
-
|
|
543
|
-
基于 Conventional Commits 的完全自动化发布:
|
|
544
|
-
|
|
545
|
-
```bash
|
|
546
|
-
# 创建功能分支
|
|
547
|
-
git checkout -b feat/awesome-feature
|
|
548
|
-
|
|
549
|
-
# 提交代码
|
|
550
|
-
git commit -m "feat: add awesome feature"
|
|
551
|
-
|
|
552
|
-
# 创建 PR 并合并
|
|
553
|
-
gh pr create && gh pr merge
|
|
554
|
-
|
|
555
|
-
# 自动发布到 npm(版本:1.4.13 → 1.5.0)
|
|
556
|
-
```
|
|
557
|
-
|
|
558
|
-
**发布流程**:
|
|
559
|
-
|
|
560
|
-
1. PR 合并 → 触发 Actions
|
|
561
|
-
2. 分析 commits 确定版本号
|
|
562
|
-
3. 发布到 npm
|
|
563
|
-
4. 自动创建版本 PR 并合并
|
|
564
|
-
5. 创建 GitHub Release
|
|
565
|
-
|
|
566
|
-
详见: [docs/CI_CD.md](docs/CI_CD.md)
|
|
567
|
-
|
|
568
495
|
## 🤝 贡献
|
|
569
496
|
|
|
570
497
|
欢迎贡献!请遵循:
|
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.24.7
|
|
29140
|
+
var VERSION = true ? "1.24.7" : "dev";
|
|
29141
29141
|
var LOCAL_PROXY_TAG = "local";
|
|
29142
29142
|
var TapTapMCPProxy = class {
|
|
29143
29143
|
constructor(config2) {
|
|
@@ -29213,6 +29213,9 @@ var TapTapMCPProxy = class {
|
|
|
29213
29213
|
if (this.config.tenant.user_id) {
|
|
29214
29214
|
this.log("info", `User ID: ${this.config.tenant.user_id}`);
|
|
29215
29215
|
}
|
|
29216
|
+
if (this.config.tenant.client_session_id) {
|
|
29217
|
+
this.log("info", `Client Session ID: ${this.config.tenant.client_session_id}`);
|
|
29218
|
+
}
|
|
29216
29219
|
if (this.config.tenant.project_id) {
|
|
29217
29220
|
this.log("info", `Project ID: ${this.config.tenant.project_id}`);
|
|
29218
29221
|
}
|
|
@@ -29240,6 +29243,7 @@ var TapTapMCPProxy = class {
|
|
|
29240
29243
|
*
|
|
29241
29244
|
* Headers:
|
|
29242
29245
|
* - X-TapTap-User-Id: 用户标识
|
|
29246
|
+
* - X-TapTap-Client-Session-Id: 业务/编辑器会话标识
|
|
29243
29247
|
* - X-TapTap-Project-Id: 项目标识
|
|
29244
29248
|
* - X-TapTap-Project-Path: 项目路径
|
|
29245
29249
|
* - X-TapTap-Mac-Token: MAC 认证令牌(JSON)
|
|
@@ -29252,6 +29256,9 @@ var TapTapMCPProxy = class {
|
|
|
29252
29256
|
if (this.config.tenant.user_id) {
|
|
29253
29257
|
headers["X-TapTap-User-Id"] = this.config.tenant.user_id;
|
|
29254
29258
|
}
|
|
29259
|
+
if (this.config.tenant.client_session_id) {
|
|
29260
|
+
headers["X-TapTap-Client-Session-Id"] = this.config.tenant.client_session_id;
|
|
29261
|
+
}
|
|
29255
29262
|
if (this.config.tenant.project_id) {
|
|
29256
29263
|
headers["X-TapTap-Project-Id"] = this.config.tenant.project_id;
|
|
29257
29264
|
}
|
|
@@ -29273,6 +29280,7 @@ var TapTapMCPProxy = class {
|
|
|
29273
29280
|
* 注入的参数(以下划线开头,表示私有):
|
|
29274
29281
|
* - _mac_token: MAC 认证令牌
|
|
29275
29282
|
* - _user_id: 用户标识(可选)
|
|
29283
|
+
* - _client_session_id: 业务/编辑器会话标识(可选)
|
|
29276
29284
|
* - _project_id: 项目标识(可选)
|
|
29277
29285
|
* - _project_path: 项目路径(可选)
|
|
29278
29286
|
* - _custom_fields: 业务自定义字段(可选)
|
|
@@ -29285,6 +29293,9 @@ var TapTapMCPProxy = class {
|
|
|
29285
29293
|
if (this.config.tenant.user_id) {
|
|
29286
29294
|
injected._user_id = this.config.tenant.user_id;
|
|
29287
29295
|
}
|
|
29296
|
+
if (this.config.tenant.client_session_id) {
|
|
29297
|
+
injected._client_session_id = this.config.tenant.client_session_id;
|
|
29298
|
+
}
|
|
29288
29299
|
if (this.config.tenant.project_id) {
|
|
29289
29300
|
injected._project_id = this.config.tenant.project_id;
|
|
29290
29301
|
}
|
|
@@ -29296,6 +29307,37 @@ var TapTapMCPProxy = class {
|
|
|
29296
29307
|
}
|
|
29297
29308
|
return injected;
|
|
29298
29309
|
}
|
|
29310
|
+
/**
|
|
29311
|
+
* Restrict the proxied tool list to the configured public surface.
|
|
29312
|
+
*
|
|
29313
|
+
* The proxy does not wrap or rewrite upstream tool definitions. It only hides tools that are not
|
|
29314
|
+
* included in options.exposed_tools. Omitting the option keeps the historical full passthrough.
|
|
29315
|
+
*/
|
|
29316
|
+
filterListedTools(result) {
|
|
29317
|
+
var _a3;
|
|
29318
|
+
const exposedTools = (_a3 = this.config.options) == null ? void 0 : _a3.exposed_tools;
|
|
29319
|
+
if (!exposedTools) {
|
|
29320
|
+
return result;
|
|
29321
|
+
}
|
|
29322
|
+
const exposedToolNames = new Set(exposedTools);
|
|
29323
|
+
return {
|
|
29324
|
+
...result,
|
|
29325
|
+
tools: result.tools.filter((tool) => exposedToolNames.has(tool.name))
|
|
29326
|
+
};
|
|
29327
|
+
}
|
|
29328
|
+
/**
|
|
29329
|
+
* Prevent callers from invoking tools hidden from tools/list.
|
|
29330
|
+
*/
|
|
29331
|
+
assertToolExposed(name) {
|
|
29332
|
+
var _a3;
|
|
29333
|
+
const exposedTools = (_a3 = this.config.options) == null ? void 0 : _a3.exposed_tools;
|
|
29334
|
+
if (!exposedTools) {
|
|
29335
|
+
return;
|
|
29336
|
+
}
|
|
29337
|
+
if (!exposedTools.includes(name)) {
|
|
29338
|
+
throw new McpError(ErrorCode.MethodNotFound, `Tool is not exposed by this proxy: ${name}`);
|
|
29339
|
+
}
|
|
29340
|
+
}
|
|
29299
29341
|
/**
|
|
29300
29342
|
* 连接到 TapTap MCP Server
|
|
29301
29343
|
*/
|
|
@@ -29628,7 +29670,7 @@ var TapTapMCPProxy = class {
|
|
|
29628
29670
|
);
|
|
29629
29671
|
}
|
|
29630
29672
|
const result = await this.client.listTools();
|
|
29631
|
-
return result;
|
|
29673
|
+
return this.filterListedTools(result);
|
|
29632
29674
|
});
|
|
29633
29675
|
this.server.setRequestHandler(ListResourcesRequestSchema, async () => {
|
|
29634
29676
|
if (!this.connected) {
|
|
@@ -29653,6 +29695,7 @@ var TapTapMCPProxy = class {
|
|
|
29653
29695
|
this.server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
|
|
29654
29696
|
var _a3, _b, _c, _d, _e, _f, _g;
|
|
29655
29697
|
const { name, arguments: args } = request.params;
|
|
29698
|
+
this.assertToolExposed(name);
|
|
29656
29699
|
const shouldInjectParams = ((_a3 = this.config.options) == null ? void 0 : _a3.inject_params_per_call) ?? true;
|
|
29657
29700
|
const finalArgs = shouldInjectParams ? this.injectPrivateParams(args) : args;
|
|
29658
29701
|
if ((_b = this.config.options) == null ? void 0 : _b.verbose) {
|
|
@@ -29790,6 +29833,7 @@ Received: ${configJson.substring(0, 100)}...`
|
|
|
29790
29833
|
return applyDefaults(config2);
|
|
29791
29834
|
}
|
|
29792
29835
|
function validateConfig(config2) {
|
|
29836
|
+
var _a3;
|
|
29793
29837
|
const errors = [];
|
|
29794
29838
|
if (!config2.server) {
|
|
29795
29839
|
errors.push("- Missing required field: server");
|
|
@@ -29804,6 +29848,9 @@ function validateConfig(config2) {
|
|
|
29804
29848
|
if (!config2.tenant) {
|
|
29805
29849
|
errors.push("- Missing required field: tenant");
|
|
29806
29850
|
} else {
|
|
29851
|
+
if (config2.tenant.client_session_id !== void 0 && typeof config2.tenant.client_session_id !== "string") {
|
|
29852
|
+
errors.push("- tenant.client_session_id must be a string");
|
|
29853
|
+
}
|
|
29807
29854
|
if (config2.tenant.custom_fields !== void 0) {
|
|
29808
29855
|
const cf = config2.tenant.custom_fields;
|
|
29809
29856
|
if (typeof cf !== "object" || cf === null || Array.isArray(cf) || Object.getPrototypeOf(cf) !== Object.prototype) {
|
|
@@ -29829,13 +29876,21 @@ function validateConfig(config2) {
|
|
|
29829
29876
|
errors.push('- Invalid auth.mac_algorithm: must be "hmac-sha-1"');
|
|
29830
29877
|
}
|
|
29831
29878
|
}
|
|
29879
|
+
if (((_a3 = config2.options) == null ? void 0 : _a3.exposed_tools) !== void 0) {
|
|
29880
|
+
const exposedTools = config2.options.exposed_tools;
|
|
29881
|
+
if (!Array.isArray(exposedTools)) {
|
|
29882
|
+
errors.push("- options.exposed_tools must be an array of tool names");
|
|
29883
|
+
} else if (!exposedTools.every((toolName) => typeof toolName === "string" && toolName.trim().length > 0)) {
|
|
29884
|
+
errors.push("- options.exposed_tools values must be non-empty strings");
|
|
29885
|
+
}
|
|
29886
|
+
}
|
|
29832
29887
|
if (errors.length > 0) {
|
|
29833
29888
|
throw new Error("Invalid configuration:\n" + errors.join("\n"));
|
|
29834
29889
|
}
|
|
29835
29890
|
}
|
|
29836
29891
|
var DEFAULT_LOG_ROOT = "/tmp/taptap-mcp/logs";
|
|
29837
29892
|
function applyDefaults(config2) {
|
|
29838
|
-
var _a3, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
29893
|
+
var _a3, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
|
|
29839
29894
|
const verbose = ((_a3 = config2.options) == null ? void 0 : _a3.verbose) ?? false;
|
|
29840
29895
|
return {
|
|
29841
29896
|
server: {
|
|
@@ -29846,6 +29901,7 @@ function applyDefaults(config2) {
|
|
|
29846
29901
|
project_path: config2.tenant.project_path || ".",
|
|
29847
29902
|
user_id: config2.tenant.user_id,
|
|
29848
29903
|
project_id: config2.tenant.project_id,
|
|
29904
|
+
client_session_id: config2.tenant.client_session_id,
|
|
29849
29905
|
custom_fields: config2.tenant.custom_fields
|
|
29850
29906
|
},
|
|
29851
29907
|
auth: config2.auth,
|
|
@@ -29860,12 +29916,13 @@ function applyDefaults(config2) {
|
|
|
29860
29916
|
enable_cookie_sticky: ((_g = config2.options) == null ? void 0 : _g.enable_cookie_sticky) ?? true,
|
|
29861
29917
|
inject_params_per_call: ((_h = config2.options) == null ? void 0 : _h.inject_params_per_call) ?? true,
|
|
29862
29918
|
force_inject_progress_token: ((_i = config2.options) == null ? void 0 : _i.force_inject_progress_token) ?? false,
|
|
29919
|
+
exposed_tools: (_j = config2.options) == null ? void 0 : _j.exposed_tools,
|
|
29863
29920
|
log: {
|
|
29864
|
-
root: ((
|
|
29865
|
-
enabled: ((
|
|
29921
|
+
root: ((_l = (_k = config2.options) == null ? void 0 : _k.log) == null ? void 0 : _l.root) ?? DEFAULT_LOG_ROOT,
|
|
29922
|
+
enabled: ((_n = (_m = config2.options) == null ? void 0 : _m.log) == null ? void 0 : _n.enabled) ?? false,
|
|
29866
29923
|
// verbose=true 时自动使用 debug 级别
|
|
29867
|
-
level: verbose ? "debug" : ((
|
|
29868
|
-
max_days: ((
|
|
29924
|
+
level: verbose ? "debug" : ((_p = (_o = config2.options) == null ? void 0 : _o.log) == null ? void 0 : _p.level) ?? "info",
|
|
29925
|
+
max_days: ((_r = (_q = config2.options) == null ? void 0 : _q.log) == null ? void 0 : _r.max_days) ?? 7
|
|
29869
29926
|
}
|
|
29870
29927
|
}
|
|
29871
29928
|
};
|