localsbnb-mcp-server 1.0.13 → 1.0.15

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.
Files changed (72) hide show
  1. package/README.md +108 -141
  2. package/dist/auth/apiKeyManager.js +1 -1
  3. package/dist/auth/index.js +1 -1
  4. package/dist/auth/permissionChecker.js +1 -1
  5. package/dist/client/cacheManager.js +1 -1
  6. package/dist/client/httpClient.js +1 -1
  7. package/dist/client/index.js +1 -1
  8. package/dist/client/retryHandler.js +1 -1
  9. package/dist/config/index.js +1 -1
  10. package/dist/config/tools.js +1 -1
  11. package/dist/index.js +1 -1
  12. package/dist/package.json +3 -2
  13. package/dist/region/api.js +1 -0
  14. package/dist/region/dates.js +1 -0
  15. package/dist/region/i18n.js +1 -0
  16. package/dist/region/index.js +1 -0
  17. package/dist/region/money.js +1 -0
  18. package/dist/region/resolve.js +1 -0
  19. package/dist/region/timezone.js +1 -0
  20. package/dist/region/toolDescriptions.js +1 -0
  21. package/dist/region/types.js +1 -0
  22. package/dist/run.cjs +2 -2
  23. package/dist/run.sh +1 -1
  24. package/dist/server.js +1 -1
  25. package/dist/start.mjs +1 -1
  26. package/dist/tools/finance/index.js +1 -1
  27. package/dist/tools/finance/queryOperationalDataV2.js +1 -1
  28. package/dist/tools/orders/getOrderDetailsV2.js +1 -1
  29. package/dist/tools/orders/index.js +1 -1
  30. package/dist/tools/orders/ordersGetShared.js +1 -1
  31. package/dist/tools/orders/queryInHouseOrders.js +1 -1
  32. package/dist/tools/orders/queryOrdersByDateRange.js +1 -1
  33. package/dist/tools/orders/queryPreArrivalOrders.js +1 -1
  34. package/dist/tools/orders/queryPreDepartureOrders.js +1 -1
  35. package/dist/tools/orders/queryTodayOrders.js +1 -1
  36. package/dist/tools/overseas/finance.js +1 -0
  37. package/dist/tools/overseas/index.js +1 -0
  38. package/dist/tools/overseas/orders.js +1 -0
  39. package/dist/tools/overseas/prices.js +1 -0
  40. package/dist/tools/overseas/rooms.js +1 -0
  41. package/dist/tools/overseas/writes.js +1 -0
  42. package/dist/tools/rooms/index.js +1 -1
  43. package/dist/tools/rooms/queryRoomPrices.js +1 -1
  44. package/dist/tools/rooms/queryRoomStatusNew.js +1 -1
  45. package/dist/tools/rooms/queryTodayRoomStatus.js +1 -1
  46. package/dist/types/index.js +1 -1
  47. package/dist/utils/desensitize.js +1 -1
  48. package/dist/utils/errorHandler.js +1 -1
  49. package/dist/utils/index.js +1 -1
  50. package/dist/utils/logger.js +1 -1
  51. package/dist/utils/price.js +1 -1
  52. package/dist/utils/shanghaiDate.js +1 -1
  53. package/docs/readme/assets/localsbnb-confirm.png +0 -0
  54. package/docs/readme/assets/localsbnb-doors.png +0 -0
  55. package/docs/readme/assets/localsbnb-flow.png +0 -0
  56. package/docs/readme/assets/localsbnb-hero.png +0 -0
  57. package/mcp.sample.json +2 -2
  58. package/package.json +3 -2
  59. package/dist/tools/channels/getChannelDetails.js +0 -1
  60. package/dist/tools/channels/index.js +0 -1
  61. package/dist/tools/channels/listChannels.js +0 -1
  62. package/dist/tools/finance/analyzeRevenue.js +0 -1
  63. package/dist/tools/finance/queryFinancialData.js +0 -1
  64. package/dist/tools/finance/queryOperationalData.js +0 -1
  65. package/dist/tools/orders/cancelOrder.js +0 -1
  66. package/dist/tools/orders/getOrderDetails.js +0 -1
  67. package/dist/tools/orders/queryOrders.js +0 -1
  68. package/dist/tools/rooms/batchUpdatePrices.js +0 -1
  69. package/dist/tools/rooms/updateRoomPrice.js +0 -1
  70. package/dist/types/api.js +0 -1
  71. package/dist/types/tools.js +0 -1
  72. package/dist/utils/validator.js +0 -1
package/README.md CHANGED
@@ -1,203 +1,170 @@
1
- # LocalsBnb AI(路客云 MCP 服务)
1
+ # LocalsBnb
2
2
 
3
- LocalsBnb AI 将路客云 PMS 的订单、房态房价、经营分析等核心能力统一封装为 MCP,
4
- 让门店与运营团队在现有沟通入口中即可通过自然语言完成“查询 -> 判断 -> 执行”,减少系统切换、提升协同效率。
3
+ **Say it. Your property answers.**
4
+ No LocalsBnb app. No extra computer. The AI you already use **is** the front desk.
5
5
 
6
- 服务可接入 OpenClaw、Hermes Agent 及任意支持 MCP 的客户端;
7
- 其中 **OpenClaw + 微信** 是当前落地最广、转化效率最高的组合,建议优先作为推广与实施路径。
6
+ **Language:** [English](README.md) · [简体中文](docs/readme/README.zh-CN.md) · [繁體中文](docs/readme/README.zh-TW.md) · [日本語](docs/readme/README.ja.md) · [ภาษาไทย](docs/readme/README.th.md) · [Bahasa Melayu](docs/readme/README.ms.md)
8
7
 
9
- ---
10
-
11
- ## 我们是什么
12
-
13
- LocalsBnb AI 是一层“AI 到路客云 API 的标准连接层”:
14
-
15
- - 对上:提供统一 MCP 工具能力
16
- - 对下:调用路客云接口并处理鉴权、错误与权限
17
- - 对业务:让查询与操作可以直接通过自然语言完成
18
-
19
- 适用对象:门店运营、前台、店长、区域管理、技术实施团队。
8
+ ![Say it. Your property answers.](docs/readme/assets/localsbnb-hero.png)
20
9
 
21
10
  ---
22
11
 
23
- ## 我们可以做什么
12
+ ## What is this?
24
13
 
25
- ### 核心查询能力(当前可直接落地)
14
+ Your listings already live on **LocalsBnb**, connected to **Airbnb, Booking.com, Agoda, and Trip.com** — built for hosts who will not live inside another dashboard.
26
15
 
27
- - 订单看板:今日预抵 / 在住 / 预离一键汇总,快速识别当日待办
28
- - 订单详情:按订单号直达详情,减少前台和运营反复翻找
29
- - 房态与可售:支持今日快照与多日区间查询,适合排班与排房决策
30
- - 房价数据:支持按日期/自然周查看价格趋势,便于活动与调价判断
31
- - 经营分析:支持查看入住率、营收等核心指标,用于复盘与晨会
16
+ The old way: unlock the phone, open four apps, wait for calendars, copy a name into a notebook, forget who is in 302.
32
17
 
33
- ### 管理价值(对门店最直接)
18
+ The new way: open the chat you already have, and talk like you talk to a duty manager.
34
19
 
35
- - 把“查数据”从后台页面前移到对话入口,响应更快
36
- - 一线同学按自然语言提问即可获得可执行结果,培训成本低
37
- - 统一口径返回订单、房态、经营数据,减少跨角色信息偏差
20
+ > “Who’s arriving today?”
21
+ > “Is the sea-view room free Saturday?”
22
+ > “Check Anna in — wait, show me the booking first.”
38
23
 
39
- ### 能力边界说明
24
+ **Just say.** LocalsBnb sits behind your favorite AI and pulls the live store: real guests, real rooms, real money. You stay human. The clicking goes away.
40
25
 
41
- - 当前版本以查询分析能力为主,已覆盖订单、房态、房价、经营数据主链路
42
- - 写操作能力可按账号权限与部署策略逐步开放
26
+ ![You speak. Your AI asks LocalsBnb. LocalsBnb answers with your real bookings and rooms.](docs/readme/assets/localsbnb-flow.png)
43
27
 
44
28
  ---
45
29
 
46
- ## 我们可以怎么用
30
+ ## Where can I use it?
47
31
 
48
- 你可以按组织现状选择入口,能力层一致。
32
+ If the software can add a “tool” or “MCP”, LocalsBnb can live there. You install **once**. After that, any chat in that app can run your property.
49
33
 
50
- ### 路径 A(推荐): OpenClaw / Hermes Agent + IM
34
+ **Use it on the computer**
51
35
 
52
- 在 OpenClaw 或 Hermes Agent 中接入 LocalsBnb MCP 后,可打通:
36
+ | App | Who usually likes it |
37
+ |-----|----------------------|
38
+ | **Claude** (Claude Desktop) | The easiest start. Talk in plain language. |
39
+ | **ChatGPT** | If you already live in ChatGPT every day. |
40
+ | **Cursor** | If you already write or work in Cursor. |
41
+ | **Windsurf** | Same idea: an AI editor that accepts tools. |
42
+ | **VS Code + GitHub Copilot** | If your laptop is already VS Code. |
53
43
 
54
- - 微信
55
- - 企业微信
56
- - QQ
57
- - 飞书
58
- - 钉钉
59
- - iMessage
44
+ **Use it where you already chat**
60
45
 
61
- 典型对话:
46
+ Most overseas hosts stay in Claude / ChatGPT / Cursor. OpenClaw and Hermes are not the usual overseas install — they matter when you already use an assistant that lives inside a chat app.
62
47
 
63
- - 「查询今天房态」
64
- - 「查询近期房价」
65
- - 「今天预离还有几单?」
66
- - 「查看张三的订单详情」
67
- - 「看下本周入住率和营收」
68
- - 「帮我根据当前经营情况,并结合近期天气、节假日等情况给出调价建议」
69
- - 「拉取近 30 天入住率、房价、渠道占比和订单取消率,结合周末与节假日,给我一版下周调价策略(含涨降幅区间和执行优先级)」
70
- - 「基于今日预抵/预离/在住结构,识别今晚可能的满房风险与空置风险,并给出房态和价格联动建议」
71
- - 「结合最近一周经营数据与历史同周表现,输出门店晨会简报:异常指标、可能原因、今日行动项」
72
- - 「对比近 14 天不同渠道订单质量(ADR、间夜、取消率),给出渠道投放与限房建议」
48
+ | Where you talk | How LocalsBnb gets there |
49
+ |----------------|--------------------------|
50
+ | **WeChat / WeCom / Feishu / DingTalk** | China: add the same two codes to OpenClaw or Hermes, then ask while you walk. |
51
+ | **WhatsApp / LINE / Telegram / iMessage** | Overseas: only if you already run OpenClaw or Hermes as that chat’s assistant. Same two codes. If you do not have that setup, start in Claude / ChatGPT / Cursor. |
73
52
 
74
- ### 路径 B:MCP 客户端直连
53
+ ![Most hosts stay in Claude, ChatGPT, or Cursor. OpenClaw or Hermes only if that assistant already lives in WeChat or WhatsApp.](docs/readme/assets/localsbnb-doors.png)
75
54
 
76
- 适合总部运营、区域管理、店长、实施团队进行日常查询与管理:
77
-
78
- - OpenClaw
79
- - Hermes Agent
80
- - Cursor
81
- - Claude Desktop
82
- - Claude Code
83
- - 其他 MCP 客户端
55
+ Pick the app you already open in the morning. Do not download a fifth “hotel app”.
84
56
 
85
57
  ---
86
58
 
87
- ## 怎么配置
59
+ ## What can it actually do?
88
60
 
89
- ### 1) 前置条件
61
+ ### A day in the life — just ask
90
62
 
91
- - 已开通路客云相关 API 权限
92
- - 获取必填凭证:
93
- - `APP_SECRET`(访问令牌)
94
- - `APP_ID`(访问ID)
63
+ **7:10, still in bed, another city**
64
+ “What’s the board for today — arrivals, staying, leaving?”
65
+ One answer. Names, rooms, dates. You text the cleaner before coffee.
95
66
 
96
- ### 2) 通用 MCP 配置
67
+ **8:00, front desk handover**
68
+ “Who is checking out before 11? Any dirty rooms left?”
69
+ The new hire does not need a two-hour system class. They already know how to ask a question.
97
70
 
98
- ```json
99
- {
100
- "mcpServers": {
101
- "LocalsBnb MCP": {
102
- "command": "npx",
103
- "args": ["--yes", "localsbnb-mcp-server"],
104
- "env": {
105
- "APP_SECRET": "<你的 APP_SECRET>",
106
- "APP_ID": "<你的 APP_ID>"
107
- }
108
- }
109
- }
110
- }
111
- ```
71
+ **10:30, guest on the phone**
72
+ “Can the Lin family check in early? What time does the last person leave that room?”
73
+ You answer in thirty seconds, not after ‘let me open the computer’.
112
74
 
113
- ### 3) OpenClaw / Hermes Agent(优先推荐)
75
+ **12:00, thinking about the weekend**
76
+ “What’s our Airbnb price Friday to Sunday? What about Agoda?”
77
+ Compare channels in one breath. No four logins.
114
78
 
115
- 这是当前最主流、最容易规模化落地的接入方式,建议作为第一实施路径。
79
+ **15:00, housekeeper in the corridor**
80
+ “Which rooms are empty and clean right now?”
81
+ She does not need your password. You look, you tell her.
116
82
 
117
- 1. 在 OpenClaw / Hermes Agent 中注册 LocalsBnb MCP(配置 `APP_SECRET` + `APP_ID`)
118
- 2. 绑定 IM 渠道(微信、企微、QQ、飞书、钉钉、iMessage)
119
- 3. 配置角色权限与可执行边界(谁可查、谁可操作、谁需二次确认)
120
- 4. 配置常用意图路由(如:今日房态、今日订单、订单详情、经营数据)
121
- 5. 以“查询今天房态 / 查询今日订单 / 输出晨会简报”完成联调验收
83
+ **18:00, owner group chat**
84
+ “How did we do this week? Occupancy, average price, revenue.”
85
+ The number comes back in **your store’s language and currency** — the ones you already set in LocalsBnb.
122
86
 
123
- > 建议先上线查询类能力,再逐步开放写操作,保证上线稳定性与组织接受度。
87
+ **21:40, last-minute request**
88
+ “They want one more night. Can we extend?” *(overseas store)*
89
+ The AI shows **who, which room, which dates**. You say yes. Then it happens. Not before.
124
90
 
125
- #### OpenClaw 自然语言一键安装(推荐新手)
91
+ **22:15, wrong room**
92
+ “Move tonight’s guest from 201 to 305.” *(overseas store)*
93
+ Same rule: it names the booking. You confirm. Then the room changes.
126
94
 
127
- 如果你已将 MCP 发布到 GitHub 与 npm,可直接通过对话让 OpenClaw 完成安装与配置。
95
+ **Holiday / rain / a concert next door**
96
+ “How full are we this week versus last week?”
97
+ You decide whether to raise the weekend or leave it — with the week in front of you, not a gut feel.
128
98
 
129
- **步骤 1:准备凭证**
99
+ **First day of a new staff member**
100
+ They do not learn menus. They learn three sentences: *today’s arrivals, today’s rooms, this week’s numbers.*
130
101
 
131
- - 在路客云 SPMS 获取 `APP_SECRET` 与 `APP_ID`
132
- - 确认当前账号已开通对应查询权限(订单、房态、房价、经营数据)
102
+ ### Handle the stay — overseas LocalsBnb stores only
133
103
 
134
- **步骤 2:在 OpenClaw 或 Hermes Agent 中发送安装指令**
104
+ You can ask the AI to **check in, check out, extend, or change a room**.
135
105
 
136
- 建议使用下面这句(比口语更稳定):
106
+ It will never do it quietly. You always see the guest and the dates first. You say “that’s the one.” Only then it goes through.
137
107
 
138
- ```text
139
- 请帮我安装 localsbnb-mcp-server,并配置 MCP 服务名为 LocalsBnb MCP。
140
- 使用环境变量:
141
- APP_SECRET=<你的APP_SECRET>
142
- APP_ID=<你的APP_ID>
143
- 安装完成后请先执行“查询今天房态”和“查询今日订单”做连通性验证。
144
- ```
108
+ ![The AI shows the booking first. You confirm. Then it happens.](docs/readme/assets/localsbnb-confirm.png)
145
109
 
146
- **步骤 3:验收**
110
+ **If your store is in China:** you can ask all the “what’s going on” questions. **Check-in, check-out, extend, and room change are not available in China yet.** Cancel, change the listed price, or sync a calendar — still do that in LocalsBnb.
147
111
 
148
- - 能成功返回“今日房态”
149
- - 能成功返回“今日订单(预抵/在住/预离)”
150
- - 若失败,按错误提示检查 `APP_SECRET` / `APP_ID` 是否正确
112
+ ---
151
113
 
152
- > 安全建议:请在私聊或受控环境中发送凭证,不要在公开群聊明文发送。
114
+ ## How do I start? (three steps)
153
115
 
154
- ### 4) 其他 MCP 客户端(补充接入)
116
+ ### 1. Take two codes from LocalsBnb
155
117
 
156
- #### Cursor
118
+ Log in to LocalsBnb and copy:
157
119
 
158
- 编辑 `~/.cursor/mcp.json`,加入上面的 `mcpServers` 配置并重启 Cursor。
120
+ - **APP_SECRET** — your key
121
+ - **APP_ID** — your property
159
122
 
160
- #### Claude Desktop
123
+ Yours only. Not for the class WeChat group.
161
124
 
162
- - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
163
- - Windows: `%APPDATA%\\Claude\\claude_desktop_config.json`
164
- - Linux: `~/.config/Claude/claude_desktop_config.json`
125
+ ### 2. Drop them into the AI you picked
165
126
 
166
- #### Claude Code
127
+ Open **Claude, ChatGPT, or Cursor**. Add a tool / MCP, paste this, replace the two lines:
167
128
 
168
- ```bash
169
- claude mcp add LocalsBnbMCP --scope user \
170
- -e APP_SECRET="<你的 token>" \
171
- -e APP_ID="<你的 campId>" \
172
- -- npx -y localsbnb-mcp-server
129
+ ```json
130
+ {
131
+ "mcpServers": {
132
+ "LocalsBnb MCP": {
133
+ "command": "npx",
134
+ "args": ["--yes", "localsbnb-mcp-server"],
135
+ "env": {
136
+ "APP_SECRET": "<your APP_SECRET>",
137
+ "APP_ID": "<your APP_ID>"
138
+ }
139
+ }
140
+ }
141
+ }
173
142
  ```
174
143
 
175
- ---
144
+ | You use… | Where it usually goes |
145
+ |----------|------------------------|
146
+ | Cursor | Settings → MCP, or the `mcp.json` file |
147
+ | Claude Desktop | Settings → custom tools / MCP |
148
+ | ChatGPT | Settings → apps / developer tools (when your plan allows it) |
149
+ | WeChat / Feishu (China) | Ask the person who set up OpenClaw or Hermes to add the same two codes |
150
+ | WhatsApp / LINE / iMessage | Only if OpenClaw or Hermes already talks in that chat — same two codes. Otherwise use Claude / ChatGPT / Cursor |
176
151
 
177
- ## 常见问题
152
+ Hate config? Tell the AI itself:
178
153
 
179
- | 问题 | 处理方式 |
180
- |---|---|
181
- | 连接失败 / 无权限 | 核对 `APP_SECRET`、`APP_ID`,并确认路客云侧已开通权限 |
182
- | 秘钥错误 | 当前秘钥信息错误,请前往登录路客云 SPMS 获取秘钥,或联系路客云客户经理咨询 |
183
- | 找不到 MCP 工具 | 检查 JSON 格式、命令路径并重启客户端 |
184
- | `ERR_REQUIRE_ESM` | 优先使用 `dist/run.sh` 或 `dist/run.cjs` |
154
+ > Help me install localsbnb-mcp-server. Here is my APP_SECRET and APP_ID.
185
155
 
186
- ---
156
+ ### 3. Talk like a host, not like a programmer
187
157
 
188
- ## 安全建议
158
+ - “Who arrives today?”
159
+ - “Show today’s rooms.”
160
+ - “Airbnb prices this week.”
161
+ - “How is this week going?”
162
+ - “Check Maria in — show me the booking first.” *(overseas)*
189
163
 
190
- - 凭证通过环境变量注入
191
- - 不提交真实 `APP_SECRET` 到仓库
192
- - 关键操作建议保留审核/确认流程
164
+ Answers follow the **language of the property** in LocalsBnb. You do not pick English or Japanese again here.
193
165
 
194
166
  ---
195
167
 
196
- ## 技术支持
197
-
198
- - 技术支持: [https://minsubao.localhome.cn/](https://minsubao.localhome.cn/)
199
-
200
- ---
168
+ ## Need a hand?
201
169
 
202
- **文档版本**: v2.0
203
- **最后更新**: 2026-04
170
+ [localsbnb.com](https://localsbnb.com/)
@@ -1 +1 @@
1
- function _0x5d57(_0x14c500,_0x5e5051){const _0x3d9f8a=_0x3d9f();return _0x5d57=function(_0x5d5797,_0x2860ef){_0x5d5797=_0x5d5797-0xb6;let _0x5296e4=_0x3d9f8a[_0x5d5797];return _0x5296e4;},_0x5d57(_0x14c500,_0x5e5051);}function _0x3d9f(){const _0x150c5c=['info','218521RmThTv','APP_SECRET','setAPIKey','1256Rvibcs','scopes','3138fwGHEE','campId','Hudson\x20credentials\x20loaded\x20from\x20config','getScopes','APP_ID\x20not\x20configured.\x20Please\x20set\x20APP_ID\x20environment\x20variable.','383170eMYUGb','env','APP_SECRET\x20not\x20configured.\x20Please\x20set\x20APP_SECRET\x20environment\x20variable.','includes','API\x20key\x20loaded\x20from\x20config','hasScope','length','Hudson\x20credentials\x20loaded\x20from\x20environment','hudsonAccessToken','227030Onvewg','setHudsonCredentials','getAPIKey','Hudson\x20credentials\x20set','loadFromEnv','split','getCampId','trim','apiKey','APP_SECRET\x20or\x20APP_ID\x20not\x20found\x20in\x20environment\x20variables','API\x20key\x20not\x20found\x20in\x20environment\x20variables','300kGwqwt','hasAPIKey','warn','isHudsonConfigured','APP_ID','API\x20key\x20loaded\x20from\x20environment','3115315hKlHiT','2339094BLIEQI','16623XmKOvC','isConfigured'];_0x3d9f=function(){return _0x150c5c;};return _0x3d9f();}(function(_0x1552c0,_0x1e47f6){const _0x1a210b=_0x1552c0();while(!![]){try{const _0x1b00dc=-parseInt(_0x5d57(0xb6))/0x1+parseInt(_0x5d57(0xc9))/0x2+parseInt(_0x5d57(0xbb))/0x3*(parseInt(_0x5d57(0xd4))/0x4)+-parseInt(_0x5d57(0xc0))/0x5+-parseInt(_0x5d57(0xdb))/0x6+parseInt(_0x5d57(0xda))/0x7+-parseInt(_0x5d57(0xb9))/0x8*(-parseInt(_0x5d57(0xdc))/0x9);if(_0x1b00dc===_0x1e47f6)break;else _0x1a210b['push'](_0x1a210b['shift']());}catch(_0x13d87c){_0x1a210b['push'](_0x1a210b['shift']());}}}(_0x3d9f,0x3b141));import{logger}from'../utils/logger.js';export class APIKeyManager{[_0x5d57(0xd1)]=null;[_0x5d57(0xba)]=[];[_0x5d57(0xc8)]=null;[_0x5d57(0xbc)]=null;[_0x5d57(0xcd)](){this[_0x5d57(0xd1)]=process[_0x5d57(0xc1)]['LUKEYUN_API_KEY']||null;const _0x5c9a7c=process[_0x5d57(0xc1)]['LUKEYUN_API_SCOPES'];this[_0x5d57(0xba)]=_0x5c9a7c?_0x5c9a7c[_0x5d57(0xce)](',')['map'](_0x58556e=>_0x58556e[_0x5d57(0xd0)]()):[],this[_0x5d57(0xc8)]=process[_0x5d57(0xc1)][_0x5d57(0xb7)]||null,this['campId']=process[_0x5d57(0xc1)][_0x5d57(0xd8)]||null,!this[_0x5d57(0xd1)]?logger[_0x5d57(0xd6)](_0x5d57(0xd3)):logger[_0x5d57(0xde)](_0x5d57(0xd9),{'hasScopes':this[_0x5d57(0xba)][_0x5d57(0xc6)]>0x0}),!this[_0x5d57(0xc8)]||!this[_0x5d57(0xbc)]?logger[_0x5d57(0xd6)](_0x5d57(0xd2)):logger[_0x5d57(0xde)](_0x5d57(0xc7));}['loadFromConfig'](_0x598672){this[_0x5d57(0xd1)]=_0x598672[_0x5d57(0xd1)]||null,this['scopes']=_0x598672['scopes']||[],this[_0x5d57(0xc8)]=_0x598672['hudsonAccessToken']||null,this[_0x5d57(0xbc)]=_0x598672['campId']||null,this[_0x5d57(0xd1)]&&logger['info'](_0x5d57(0xc4),{'hasScopes':this['scopes'][_0x5d57(0xc6)]>0x0}),this['hudsonAccessToken']&&this[_0x5d57(0xbc)]&&logger[_0x5d57(0xde)](_0x5d57(0xbd));}[_0x5d57(0xb8)](_0x416b23,_0x15df9a){this[_0x5d57(0xd1)]=_0x416b23,this[_0x5d57(0xba)]=_0x15df9a||[],logger['info']('API\x20key\x20set',{'hasScopes':this[_0x5d57(0xba)][_0x5d57(0xc6)]>0x0});}[_0x5d57(0xca)](_0x1abe27,_0xa375db){this[_0x5d57(0xc8)]=_0x1abe27,this[_0x5d57(0xbc)]=_0xa375db,logger[_0x5d57(0xde)](_0x5d57(0xcc));}[_0x5d57(0xcb)](){return this[_0x5d57(0xd1)]||'';}[_0x5d57(0xd5)](){return this[_0x5d57(0xd1)]!==null&&this[_0x5d57(0xd1)]!=='';}[_0x5d57(0xc5)](_0x7c001c){if(this[_0x5d57(0xba)][_0x5d57(0xc3)]('*'))return!![];return this[_0x5d57(0xba)]['includes'](_0x7c001c);}[_0x5d57(0xbe)](){return[...this[_0x5d57(0xba)]];}[_0x5d57(0xdd)](){return this[_0x5d57(0xd1)]!==null;}[_0x5d57(0xd7)](){return this[_0x5d57(0xc8)]!==null&&this[_0x5d57(0xbc)]!==null;}['getHudsonAccessToken'](){if(!this[_0x5d57(0xc8)])throw new Error(_0x5d57(0xc2));return this[_0x5d57(0xc8)];}[_0x5d57(0xcf)](){if(!this[_0x5d57(0xbc)])throw new Error(_0x5d57(0xbf));return this[_0x5d57(0xbc)];}}
1
+ function _0x5dc4(){const _0xe2033a=['getAPIKey','238prMPQH','length','860874oNTMCx','36VLbtYE','hasScope','env','HUDSON_ACCESS_TOKEN','loadFromConfig','API\x20key\x20set','11647580OnrdoI','API\x20key\x20loaded\x20from\x20config','38xrrtir','setAPIKey','Hudson\x20credentials\x20set','setHudsonCredentials','41458TpCcet','info','split','trim','1935130ljKCzt','hasAPIKey','APP_SECRET\x20or\x20APP_ID\x20not\x20found\x20in\x20environment\x20variables','136984FPWQzg','warn','scopes','172701cDVjUx','hudsonAccessToken','3041253Kfknyk','isConfigured','APP_ID\x20not\x20configured.\x20Please\x20set\x20APP_ID\x20environment\x20variable.','getScopes','campId','getHudsonAccessToken','apiKey','isHudsonConfigured','API\x20key\x20not\x20found\x20in\x20environment\x20variables','APP_SECRET','APP_SECRET\x20not\x20configured.\x20Please\x20set\x20APP_SECRET\x20environment\x20variable.'];_0x5dc4=function(){return _0xe2033a;};return _0x5dc4();}(function(_0x180a87,_0x4acd82){const _0x4f564f=_0x180a87();while(!![]){try{const _0x18175c=parseInt(_0x33be(0x203))/0x1*(parseInt(_0x33be(0x1e0))/0x2)+-parseInt(_0x33be(0x1ea))/0x3*(-parseInt(_0x33be(0x1fb))/0x4)+parseInt(_0x33be(0x1e4))/0x5+parseInt(_0x33be(0x1fa))/0x6+-parseInt(_0x33be(0x1f8))/0x7*(parseInt(_0x33be(0x1e7))/0x8)+parseInt(_0x33be(0x1ec))/0x9+-parseInt(_0x33be(0x201))/0xa;if(_0x18175c===_0x4acd82)break;else _0x4f564f['push'](_0x4f564f['shift']());}catch(_0x355e45){_0x4f564f['push'](_0x4f564f['shift']());}}}(_0x5dc4,0x68517));function _0x33be(_0x38151c,_0x5390ac){const _0x5dc4f5=_0x5dc4();return _0x33be=function(_0x33bee4,_0xc0ec65){_0x33bee4=_0x33bee4-0x1e0;let _0x475685=_0x5dc4f5[_0x33bee4];return _0x475685;},_0x33be(_0x38151c,_0x5390ac);}import{logger}from'../utils/logger.js';export class APIKeyManager{[_0x33be(0x1f2)]=null;['scopes']=[];['hudsonAccessToken']=null;[_0x33be(0x1f0)]=null;['loadFromEnv'](){this[_0x33be(0x1f2)]=process[_0x33be(0x1fd)]['LUKEYUN_API_KEY']||null;const _0x3f7d28=process[_0x33be(0x1fd)]['LUKEYUN_API_SCOPES'];this[_0x33be(0x1e9)]=_0x3f7d28?_0x3f7d28[_0x33be(0x1e2)](',')['map'](_0x2f8a82=>_0x2f8a82[_0x33be(0x1e3)]()):[],this['hudsonAccessToken']=process['env'][_0x33be(0x1f5)]||process[_0x33be(0x1fd)][_0x33be(0x1fe)]||null,this[_0x33be(0x1f0)]=process[_0x33be(0x1fd)]['APP_ID']||process['env']['CAMP_ID']||null,!this['apiKey']?logger['warn'](_0x33be(0x1f4)):logger[_0x33be(0x1e1)]('API\x20key\x20loaded\x20from\x20environment',{'hasScopes':this[_0x33be(0x1e9)]['length']>0x0}),!this[_0x33be(0x1eb)]||!this[_0x33be(0x1f0)]?logger[_0x33be(0x1e8)](_0x33be(0x1e6)):logger[_0x33be(0x1e1)]('Hudson\x20credentials\x20loaded\x20from\x20environment');}[_0x33be(0x1ff)](_0x191edc){this[_0x33be(0x1f2)]=_0x191edc[_0x33be(0x1f2)]||null,this[_0x33be(0x1e9)]=_0x191edc[_0x33be(0x1e9)]||[],this[_0x33be(0x1eb)]=_0x191edc[_0x33be(0x1eb)]||null,this[_0x33be(0x1f0)]=_0x191edc[_0x33be(0x1f0)]||null,this['apiKey']&&logger[_0x33be(0x1e1)](_0x33be(0x202),{'hasScopes':this['scopes'][_0x33be(0x1f9)]>0x0}),this['hudsonAccessToken']&&this[_0x33be(0x1f0)]&&logger[_0x33be(0x1e1)]('Hudson\x20credentials\x20loaded\x20from\x20config');}[_0x33be(0x204)](_0x213f45,_0x42f823){this[_0x33be(0x1f2)]=_0x213f45,this[_0x33be(0x1e9)]=_0x42f823||[],logger[_0x33be(0x1e1)](_0x33be(0x200),{'hasScopes':this[_0x33be(0x1e9)][_0x33be(0x1f9)]>0x0});}[_0x33be(0x206)](_0x47f25d,_0x36c12a){this[_0x33be(0x1eb)]=_0x47f25d,this[_0x33be(0x1f0)]=_0x36c12a,logger['info'](_0x33be(0x205));}[_0x33be(0x1f7)](){return this[_0x33be(0x1f2)]||'';}[_0x33be(0x1e5)](){return this['apiKey']!==null&&this['apiKey']!=='';}[_0x33be(0x1fc)](_0x275b18){if(this[_0x33be(0x1e9)]['includes']('*'))return!![];return this['scopes']['includes'](_0x275b18);}[_0x33be(0x1ef)](){return[...this[_0x33be(0x1e9)]];}[_0x33be(0x1ed)](){return this[_0x33be(0x1f2)]!==null;}[_0x33be(0x1f3)](){return this[_0x33be(0x1eb)]!==null&&this[_0x33be(0x1f0)]!==null;}[_0x33be(0x1f1)](){if(!this[_0x33be(0x1eb)])throw new Error(_0x33be(0x1f6));return this['hudsonAccessToken'];}['getCampId'](){if(!this[_0x33be(0x1f0)])throw new Error(_0x33be(0x1ee));return this[_0x33be(0x1f0)];}}
@@ -1 +1 @@
1
- function _0x4a1b(){var _0x2794c1=['4LxKRuE','1811000YRxtMn','10UyHvcj','11928862sjZSOA','8251428nweAAS','9990uNXTkP','4794EkitPP','194299rddpOw','2573406sJzYTA','35YtjDRd','212fAMgkt','7377vTKdqX'];_0x4a1b=function(){return _0x2794c1;};return _0x4a1b();}(function(_0x398a58,_0x468ca9){var _0x8f7510=_0x398a58();while(!![]){try{var _0xa65dad=parseInt(_0x1da2(0x128))/0x1*(parseInt(_0x1da2(0x121))/0x2)+parseInt(_0x1da2(0x120))/0x3*(-parseInt(_0x1da2(0x11f))/0x4)+parseInt(_0x1da2(0x126))/0x5*(parseInt(_0x1da2(0x127))/0x6)+-parseInt(_0x1da2(0x11e))/0x7*(parseInt(_0x1da2(0x122))/0x8)+-parseInt(_0x1da2(0x11d))/0x9*(parseInt(_0x1da2(0x123))/0xa)+parseInt(_0x1da2(0x124))/0xb+-parseInt(_0x1da2(0x125))/0xc;if(_0xa65dad===_0x468ca9)break;else _0x8f7510['push'](_0x8f7510['shift']());}catch(_0x209e95){_0x8f7510['push'](_0x8f7510['shift']());}}}(_0x4a1b,0xcb897));export{APIKeyManager}from'./apiKeyManager.js';function _0x1da2(_0x43090a,_0x202fdc){var _0x4a1b04=_0x4a1b();return _0x1da2=function(_0x1da2d2,_0xa69c66){_0x1da2d2=_0x1da2d2-0x11d;var _0x51b2fe=_0x4a1b04[_0x1da2d2];return _0x51b2fe;},_0x1da2(_0x43090a,_0x202fdc);}export{PermissionChecker}from'./permissionChecker.js';
1
+ function _0x3424(_0x106de7,_0x5d0ce0){var _0x34bf3d=_0x34bf();return _0x3424=function(_0x342486,_0x2ce5bf){_0x342486=_0x342486-0xb9;var _0x8e4d55=_0x34bf3d[_0x342486];return _0x8e4d55;},_0x3424(_0x106de7,_0x5d0ce0);}(function(_0xcda05,_0x5c7b5a){var _0x28195f=_0xcda05();while(!![]){try{var _0x458136=-parseInt(_0x3424(0xbf))/0x1+-parseInt(_0x3424(0xc3))/0x2*(parseInt(_0x3424(0xc2))/0x3)+-parseInt(_0x3424(0xbd))/0x4*(-parseInt(_0x3424(0xbe))/0x5)+parseInt(_0x3424(0xbc))/0x6*(-parseInt(_0x3424(0xba))/0x7)+parseInt(_0x3424(0xb9))/0x8+parseInt(_0x3424(0xbb))/0x9*(parseInt(_0x3424(0xc0))/0xa)+parseInt(_0x3424(0xc1))/0xb;if(_0x458136===_0x5c7b5a)break;else _0x28195f['push'](_0x28195f['shift']());}catch(_0x424a26){_0x28195f['push'](_0x28195f['shift']());}}}(_0x34bf,0x9d52f));function _0x34bf(){var _0x3cefd8=['4476DzlZZw','3365ITLloB','218104tmmVGp','4620zzpgFb','12170125DJcXYO','2643531jOYqwZ','2HxHWKs','4994224hMmfHX','43694ZNlClH','6498IxCeMi','1032zbUCUz'];_0x34bf=function(){return _0x3cefd8;};return _0x34bf();}export{APIKeyManager}from'./apiKeyManager.js';export{PermissionChecker}from'./permissionChecker.js';
@@ -1 +1 @@
1
- (function(_0x400610,_0x2a043c){const _0x1c8fd0=_0x400610();while(!![]){try{const _0x5414d9=-parseInt(_0x5569(0x1c1))/0x1+-parseInt(_0x5569(0x1d3))/0x2+-parseInt(_0x5569(0x1d6))/0x3+parseInt(_0x5569(0x1ca))/0x4*(-parseInt(_0x5569(0x1d8))/0x5)+parseInt(_0x5569(0x1be))/0x6*(parseInt(_0x5569(0x1c4))/0x7)+parseInt(_0x5569(0x1bc))/0x8+parseInt(_0x5569(0x1c8))/0x9;if(_0x5414d9===_0x2a043c)break;else _0x1c8fd0['push'](_0x1c8fd0['shift']());}catch(_0x3dbde0){_0x1c8fd0['push'](_0x1c8fd0['shift']());}}}(_0x5e12,0x31bfc));import{MCPError,ErrorCode,getPermissionDeniedMessage}from'../utils/errorHandler.js';import{logger}from'../utils/logger.js';function toolToPermissionDomain(_0x3f4ac1){switch(_0x3f4ac1){case'query_today_orders':case _0x5569(0x1d7):case'query_in_house_orders':case'query_pre_departure_orders':case _0x5569(0x1d2):case _0x5569(0x1da):case _0x5569(0x1d4):case _0x5569(0x1d0):return _0x5569(0x1c5);case _0x5569(0x1cd):return _0x5569(0x1c0);case _0x5569(0x1d1):case'query_room_status_new':return'room_status';case'query_room_prices':return _0x5569(0x1cf);default:return _0x5569(0x1c7);}}export class PermissionChecker{[_0x5569(0x1bf)];constructor(_0x497b5e){this[_0x5569(0x1bf)]=_0x497b5e;}[_0x5569(0x1cc)](_0x4e6575,_0x1b4d96){if(_0x1b4d96[_0x5569(0x1ce)]===0x0)return;if(!this[_0x5569(0x1bf)][_0x5569(0x1c3)]()&&this[_0x5569(0x1bf)][_0x5569(0x1d5)]()){logger[_0x5569(0x1bd)](_0x5569(0x1c6),{'tool':_0x4e6575,'requiredScopes':_0x1b4d96});return;}const _0x58d30e=_0x1b4d96[_0x5569(0x1c2)](_0xa3f5fa=>this[_0x5569(0x1bf)]['hasScope'](_0xa3f5fa));if(!_0x58d30e){const _0x48d00e=this[_0x5569(0x1bf)][_0x5569(0x1c9)](),_0x38a670=toolToPermissionDomain(_0x4e6575);logger[_0x5569(0x1d9)](_0x5569(0x1cb),{'tool':_0x4e6575,'required':_0x1b4d96,'current':_0x48d00e,'domain':_0x38a670});throw new MCPError(ErrorCode['PERMISSION_DENIED'],getPermissionDeniedMessage(_0x38a670),{'tool':_0x4e6575,'requiredScopes':_0x1b4d96,'currentScopes':_0x48d00e,'domain':_0x38a670,'source':'路客云AI'});}logger['debug']('Permission\x20check\x20passed',{'tool':_0x4e6575,'scopes':_0x1b4d96});}}function _0x5569(_0x378c9f,_0x473d8c){const _0x5e1297=_0x5e12();return _0x5569=function(_0x556923,_0x538fcf){_0x556923=_0x556923-0x1bc;let _0x495643=_0x5e1297[_0x556923];return _0x495643;},_0x5569(_0x378c9f,_0x473d8c);}function _0x5e12(){const _0x4f35e3=['query_orders','isHudsonConfigured','378219oSJTVC','query_pre_arrival_orders','5kWSiFV','warn','get_order_details_v2','2709136MjZAjv','debug','294fhXVcY','keyManager','finance','267860GtgFSf','some','hasAPIKey','29918IuIdYM','orders','Permission\x20check\x20passed\x20(Hudson\x20auth\x20only)','generic','3155310TRklnp','getScopes','1131752qNLmCu','Permission\x20denied','checkPermission','query_operational_data_v2','length','room_price','get_order_details','query_today_room_status','query_orders_by_date_range','36030kyZEDQ'];_0x5e12=function(){return _0x4f35e3;};return _0x5e12();}
1
+ (function(_0x20fb0f,_0x908c6e){const _0x4512aa=_0x20fb0f();while(!![]){try{const _0x2c4ce3=parseInt(_0x28f9(0xd1))/0x1+-parseInt(_0x28f9(0xbb))/0x2*(parseInt(_0x28f9(0xb4))/0x3)+-parseInt(_0x28f9(0xc4))/0x4+-parseInt(_0x28f9(0xc5))/0x5+parseInt(_0x28f9(0xc7))/0x6*(-parseInt(_0x28f9(0xce))/0x7)+parseInt(_0x28f9(0xb9))/0x8+parseInt(_0x28f9(0xcd))/0x9;if(_0x2c4ce3===_0x908c6e)break;else _0x4512aa['push'](_0x4512aa['shift']());}catch(_0x543db6){_0x4512aa['push'](_0x4512aa['shift']());}}}(_0x471a,0x640ef));function _0x471a(){const _0x18e7f2=['getScopes','check_in_order','2295032xLJmwp','95650SVehRO','room_status','804WBTmam','query_pre_arrival_orders','keyManager','debug','room_price','query_operational_data_v2','6215940nKVAsv','40607wuIIMu','hasAPIKey','hasScope','481075bBcDMS','isHudsonConfigured','length','query_room_prices','Permission\x20check\x20passed\x20(Hudson\x20auth\x20only)','45KOGpnT','arrange_room','get_order_details_v2','query_in_house_orders','generic','5193968vuyfAG','query_orders_by_date_range','5456MgRGLI','warn','checkPermission','query_room_status_new','finance','check_out_order','query_today_orders'];_0x471a=function(){return _0x18e7f2;};return _0x471a();}import{MCPError,ErrorCode,getPermissionDeniedMessage}from'../utils/errorHandler.js';import{logger}from'../utils/logger.js';function _0x28f9(_0x4caf13,_0x2e3abd){const _0x471a62=_0x471a();return _0x28f9=function(_0x28f99e,_0x460e39){_0x28f99e=_0x28f99e-0xb1;let _0x44361b=_0x471a62[_0x28f99e];return _0x44361b;},_0x28f9(_0x4caf13,_0x2e3abd);}function toolToPermissionDomain(_0x376ecb){switch(_0x376ecb){case _0x28f9(0xc1):case _0x28f9(0xc8):case _0x28f9(0xb7):case'query_pre_departure_orders':case _0x28f9(0xba):case _0x28f9(0xb6):case _0x28f9(0xc3):case _0x28f9(0xc0):case'extend_order':case _0x28f9(0xb5):return'orders';case _0x28f9(0xcc):return _0x28f9(0xbf);case'query_today_room_status':case _0x28f9(0xbe):return _0x28f9(0xc6);case _0x28f9(0xb2):return _0x28f9(0xcb);default:return _0x28f9(0xb8);}}export class PermissionChecker{[_0x28f9(0xc9)];constructor(_0x270e6c){this[_0x28f9(0xc9)]=_0x270e6c;}[_0x28f9(0xbd)](_0x2f30b2,_0x41ade3){if(_0x41ade3[_0x28f9(0xb1)]===0x0)return;if(!this['keyManager'][_0x28f9(0xcf)]()&&this[_0x28f9(0xc9)][_0x28f9(0xd2)]()){logger['debug'](_0x28f9(0xb3),{'tool':_0x2f30b2,'requiredScopes':_0x41ade3});return;}const _0x14ec96=_0x41ade3['some'](_0x74fb11=>this[_0x28f9(0xc9)][_0x28f9(0xd0)](_0x74fb11));if(!_0x14ec96){const _0x36de38=this['keyManager'][_0x28f9(0xc2)](),_0x83dc55=toolToPermissionDomain(_0x2f30b2);logger[_0x28f9(0xbc)]('Permission\x20denied',{'tool':_0x2f30b2,'required':_0x41ade3,'current':_0x36de38,'domain':_0x83dc55});throw new MCPError(ErrorCode['PERMISSION_DENIED'],getPermissionDeniedMessage(_0x83dc55),{'tool':_0x2f30b2,'requiredScopes':_0x41ade3,'currentScopes':_0x36de38,'domain':_0x83dc55,'source':'路客云AI'});}logger[_0x28f9(0xca)]('Permission\x20check\x20passed',{'tool':_0x2f30b2,'scopes':_0x41ade3});}}
@@ -1 +1 @@
1
- function _0x3650(){const _0x54849e=['1530982lNXJVS','sort','138gfCrwV','Cache\x20deleted','982666xSlMAj','stringify','3931690YlnIFH','set','Cache\x20cleared','get','delete','2062612HpenFN','join','enabled','map','expiresAt','cache','220565WcbXTR','data','now','generateKey','3785280jJALko','18ndaLIp','clear','905430xgsqEe','debug','Cache\x20hit'];_0x3650=function(){return _0x54849e;};return _0x3650();}(function(_0xdcbeb7,_0x4fb4d5){const _0x223608=_0xdcbeb7();while(!![]){try{const _0x457cc4=parseInt(_0x31a5(0x1db))/0x1+parseInt(_0x31a5(0x1d7))/0x2+-parseInt(_0x31a5(0x1d4))/0x3+parseInt(_0x31a5(0x1e2))/0x4+parseInt(_0x31a5(0x1cd))/0x5*(-parseInt(_0x31a5(0x1d9))/0x6)+parseInt(_0x31a5(0x1dd))/0x7+parseInt(_0x31a5(0x1d1))/0x8*(-parseInt(_0x31a5(0x1d2))/0x9);if(_0x457cc4===_0x4fb4d5)break;else _0x223608['push'](_0x223608['shift']());}catch(_0x11a5b4){_0x223608['push'](_0x223608['shift']());}}}(_0x3650,0x8963f));import{config}from'../config/index.js';function _0x31a5(_0x3fa687,_0x4e1697){const _0x36508e=_0x3650();return _0x31a5=function(_0x31a58b,_0x5d4e57){_0x31a58b=_0x31a58b-0x1cb;let _0x3d0b4e=_0x36508e[_0x31a58b];return _0x3d0b4e;},_0x31a5(_0x3fa687,_0x4e1697);}import{logger}from'../utils/logger.js';export class CacheManager{[_0x31a5(0x1cc)]=new Map();[_0x31a5(0x1e0)](_0x328869){if(!config[_0x31a5(0x1cc)][_0x31a5(0x1e4)])return null;const _0x3caffd=this[_0x31a5(0x1cc)][_0x31a5(0x1e0)](_0x328869);if(!_0x3caffd)return null;if(Date[_0x31a5(0x1cf)]()>_0x3caffd[_0x31a5(0x1cb)])return this[_0x31a5(0x1cc)][_0x31a5(0x1e1)](_0x328869),logger[_0x31a5(0x1d5)]('Cache\x20expired',{'key':_0x328869}),null;return logger['debug'](_0x31a5(0x1d6),{'key':_0x328869}),_0x3caffd[_0x31a5(0x1ce)];}[_0x31a5(0x1de)](_0x4c6d17,_0xe24246,_0x288f7f){if(!config[_0x31a5(0x1cc)][_0x31a5(0x1e4)])return;const _0x29c5d6=_0x288f7f||config['cache']['ttl'];this[_0x31a5(0x1cc)][_0x31a5(0x1de)](_0x4c6d17,{'data':_0xe24246,'expiresAt':Date[_0x31a5(0x1cf)]()+_0x29c5d6}),logger['debug']('Cache\x20set',{'key':_0x4c6d17,'ttl':_0x29c5d6});}[_0x31a5(0x1e1)](_0x2c6e94){this['cache'][_0x31a5(0x1e1)](_0x2c6e94),logger[_0x31a5(0x1d5)](_0x31a5(0x1da),{'key':_0x2c6e94});}[_0x31a5(0x1d3)](){this[_0x31a5(0x1cc)][_0x31a5(0x1d3)](),logger[_0x31a5(0x1d5)](_0x31a5(0x1df));}static[_0x31a5(0x1d0)](_0x44864d,_0x28be54){const _0xec813=Object['keys'](_0x28be54)[_0x31a5(0x1d8)]()[_0x31a5(0x1e5)](_0x34acbf=>_0x34acbf+'='+JSON[_0x31a5(0x1dc)](_0x28be54[_0x34acbf]))[_0x31a5(0x1e3)]('&');return _0x44864d+':'+_0xec813;}}
1
+ (function(_0x158d4e,_0x229bae){const _0x434e92=_0x158d4e();while(!![]){try{const _0x122f02=-parseInt(_0x2079(0x12d))/0x1*(parseInt(_0x2079(0x12f))/0x2)+-parseInt(_0x2079(0x13b))/0x3+parseInt(_0x2079(0x13c))/0x4+parseInt(_0x2079(0x130))/0x5*(parseInt(_0x2079(0x13f))/0x6)+-parseInt(_0x2079(0x141))/0x7*(parseInt(_0x2079(0x133))/0x8)+-parseInt(_0x2079(0x135))/0x9+parseInt(_0x2079(0x137))/0xa;if(_0x122f02===_0x229bae)break;else _0x434e92['push'](_0x434e92['shift']());}catch(_0xce4af4){_0x434e92['push'](_0x434e92['shift']());}}}(_0x4ea0,0x2e0f4));import{config}from'../config/index.js';import{logger}from'../utils/logger.js';function _0x2079(_0xb15a6a,_0x281c0c){const _0x4ea074=_0x4ea0();return _0x2079=function(_0x20795f,_0x4f0c4d){_0x20795f=_0x20795f-0x12c;let _0x18eca2=_0x4ea074[_0x20795f];return _0x18eca2;},_0x2079(_0xb15a6a,_0x281c0c);}export class CacheManager{[_0x2079(0x142)]=new Map();[_0x2079(0x132)](_0x3e31f4){if(!config[_0x2079(0x142)][_0x2079(0x147)])return null;const _0x38fdf4=this[_0x2079(0x142)]['get'](_0x3e31f4);if(!_0x38fdf4)return null;if(Date[_0x2079(0x138)]()>_0x38fdf4['expiresAt'])return this[_0x2079(0x142)][_0x2079(0x140)](_0x3e31f4),logger[_0x2079(0x12e)](_0x2079(0x13d),{'key':_0x3e31f4}),null;return logger['debug'](_0x2079(0x12c),{'key':_0x3e31f4}),_0x38fdf4[_0x2079(0x146)];}[_0x2079(0x143)](_0xfbc854,_0x1d875,_0x5aafa5){if(!config['cache'][_0x2079(0x147)])return;const _0x356b7c=_0x5aafa5||config[_0x2079(0x142)][_0x2079(0x13a)];this[_0x2079(0x142)][_0x2079(0x143)](_0xfbc854,{'data':_0x1d875,'expiresAt':Date[_0x2079(0x138)]()+_0x356b7c}),logger[_0x2079(0x12e)](_0x2079(0x13e),{'key':_0xfbc854,'ttl':_0x356b7c});}[_0x2079(0x140)](_0x295478){this['cache'][_0x2079(0x140)](_0x295478),logger[_0x2079(0x12e)]('Cache\x20deleted',{'key':_0x295478});}['clear'](){this[_0x2079(0x142)]['clear'](),logger[_0x2079(0x12e)](_0x2079(0x145));}static[_0x2079(0x144)](_0x337f5a,_0x40fdc5){const _0x58cbb2=Object[_0x2079(0x131)](_0x40fdc5)[_0x2079(0x136)]()['map'](_0x1ad39f=>_0x1ad39f+'='+JSON[_0x2079(0x134)](_0x40fdc5[_0x1ad39f]))[_0x2079(0x139)]('&');return _0x337f5a+':'+_0x58cbb2;}}function _0x4ea0(){const _0x3149ec=['cache','set','generateKey','Cache\x20cleared','data','enabled','Cache\x20hit','580MMxBeF','debug','1106lRTmQY','211495kqQvBp','keys','get','8tqWNsK','stringify','2738574NpRPiI','sort','6596560FGWlic','now','join','ttl','462624RVBByu','1491524FdmqqR','Cache\x20expired','Cache\x20set','24ouqcnl','delete','1636873pFODMj'];_0x4ea0=function(){return _0x3149ec;};return _0x4ea0();}
@@ -1 +1 @@
1
- (function(_0x3c2552,_0x16f62b){const _0x30f81e=_0x3c2552();while(!![]){try{const _0x5c91ca=parseInt(_0x54aa(0x1f9))/0x1+-parseInt(_0x54aa(0x200))/0x2*(-parseInt(_0x54aa(0x216))/0x3)+-parseInt(_0x54aa(0x205))/0x4+-parseInt(_0x54aa(0x20c))/0x5+-parseInt(_0x54aa(0x210))/0x6+parseInt(_0x54aa(0x214))/0x7*(parseInt(_0x54aa(0x20b))/0x8)+parseInt(_0x54aa(0x201))/0x9;if(_0x5c91ca===_0x16f62b)break;else _0x30f81e['push'](_0x30f81e['shift']());}catch(_0x5058d3){_0x30f81e['push'](_0x30f81e['shift']());}}}(_0x3b93,0x340f2));import _0xddb8b9 from'axios';import{config}from'../config/index.js';import{logger}from'../utils/logger.js';import{MCPError,ErrorCode}from'../utils/errorHandler.js';import{RetryHandler}from'./retryHandler.js';export class HTTPClient{[_0x54aa(0x218)];[_0x54aa(0x1fc)];['hudsonAccessToken'];[_0x54aa(0x1e8)];constructor(_0xd93785,_0x2656be){this[_0x54aa(0x1fc)]=_0xd93785,this[_0x54aa(0x1ea)]=_0x2656be,this[_0x54aa(0x1e8)]=new RetryHandler(config[_0x54aa(0x21e)]['maxRetries'],config[_0x54aa(0x21e)][_0x54aa(0x1f7)]),this[_0x54aa(0x218)]=_0xddb8b9[_0x54aa(0x211)]({'baseURL':config[_0x54aa(0x203)]['baseURL'],'timeout':config[_0x54aa(0x203)][_0x54aa(0x21b)],'headers':{'Content-Type':_0x54aa(0x217),'X-Client-Type':_0x54aa(0x1f0),'X-Client-Version':process['env'][_0x54aa(0x213)]||_0x54aa(0x21c)}}),this[_0x54aa(0x221)]();}[_0x54aa(0x221)](){this[_0x54aa(0x218)]['interceptors'][_0x54aa(0x1fa)][_0x54aa(0x1f4)](_0x5b5af6=>{return this[_0x54aa(0x1fc)]&&(_0x5b5af6[_0x54aa(0x1fb)]['Authorization']='Bearer\x20'+this[_0x54aa(0x1fc)]),this[_0x54aa(0x1ea)]&&(_0x5b5af6[_0x54aa(0x1fb)]['hudson-access-token']=this[_0x54aa(0x1ea)]),logger[_0x54aa(0x212)]('API\x20request',{'method':_0x5b5af6[_0x54aa(0x1f2)],'url':_0x5b5af6[_0x54aa(0x20e)],'params':_0x5b5af6['params']}),_0x5b5af6;},_0x2999e5=>{return logger[_0x54aa(0x220)](_0x54aa(0x1e9),_0x2999e5),Promise[_0x54aa(0x206)](_0x2999e5);}),this[_0x54aa(0x218)]['interceptors'][_0x54aa(0x1ef)]['use'](_0x1b36d6=>{return logger[_0x54aa(0x212)](_0x54aa(0x1eb),{'status':_0x1b36d6[_0x54aa(0x219)],'url':_0x1b36d6[_0x54aa(0x1ff)]['url']}),_0x1b36d6;},async _0x4d9f7c=>{return this[_0x54aa(0x224)](_0x4d9f7c);});}async[_0x54aa(0x224)](_0x546492){if(_0x546492[_0x54aa(0x1ef)]){const _0x37dbaf=_0x546492[_0x54aa(0x1ef)][_0x54aa(0x219)],_0x4ea5ab=_0x546492[_0x54aa(0x1ef)][_0x54aa(0x223)];logger['error'](_0x54aa(0x21f),{'status':_0x37dbaf,'url':_0x546492[_0x54aa(0x1ff)]?.['url'],'message':_0x4ea5ab[_0x54aa(0x20f)]});switch(_0x37dbaf){case 0x191:throw new MCPError(ErrorCode[_0x54aa(0x1f3)],_0x54aa(0x202),_0x4ea5ab);case 0x193:throw new MCPError(ErrorCode[_0x54aa(0x1fe)],_0x4ea5ab?.['message']||_0x54aa(0x208),{..._0x4ea5ab!=null&&typeof _0x4ea5ab===_0x54aa(0x204)?_0x4ea5ab:{},'domain':_0x54aa(0x215),'source':_0x54aa(0x207)});case 0x194:throw new MCPError(ErrorCode[_0x54aa(0x209)],'资源不存在',_0x4ea5ab);case 0x1ad:throw new MCPError(ErrorCode[_0x54aa(0x21a)],_0x54aa(0x1ec),_0x4ea5ab);case 0x1f4:case 0x1f6:case 0x1f7:case 0x1f8:throw new MCPError(ErrorCode[_0x54aa(0x21d)],_0x54aa(0x1f5),_0x4ea5ab);default:throw new MCPError(ErrorCode[_0x54aa(0x21d)],_0x4ea5ab[_0x54aa(0x20f)]||_0x54aa(0x20d)+_0x37dbaf,_0x4ea5ab);}}else{if(_0x546492[_0x54aa(0x1fa)]){logger['error'](_0x54aa(0x1f6),{'url':_0x546492[_0x54aa(0x1ff)]?.['url'],'timeout':config[_0x54aa(0x203)]['timeout']});if(_0x546492['code']===_0x54aa(0x1fd))throw new MCPError(ErrorCode[_0x54aa(0x222)],_0x54aa(0x1f1));throw new MCPError(ErrorCode[_0x54aa(0x21d)],_0x54aa(0x1ed));}else{logger[_0x54aa(0x220)](_0x54aa(0x1f8),_0x546492);throw new MCPError(ErrorCode[_0x54aa(0x1ee)],'请求配置错误');}}}async[_0x54aa(0x1fa)](_0x2d158e){const _0x516e10={'method':_0x2d158e[_0x54aa(0x1f2)],'url':_0x2d158e[_0x54aa(0x20e)],'params':_0x2d158e['params'],'data':_0x2d158e[_0x54aa(0x223)],'headers':_0x2d158e[_0x54aa(0x1fb)]};try{const _0x110351=await this[_0x54aa(0x1e8)][_0x54aa(0x20a)](()=>this[_0x54aa(0x218)][_0x54aa(0x1fa)](_0x516e10));return _0x110351[_0x54aa(0x223)];}catch(_0x15a011){throw _0x15a011;}}}function _0x54aa(_0x31d0dd,_0x509151){const _0x3b9303=_0x3b93();return _0x54aa=function(_0x54aa66,_0xf9ec7a){_0x54aa66=_0x54aa66-0x1e8;let _0x15aedb=_0x3b9303[_0x54aa66];return _0x15aedb;},_0x54aa(_0x31d0dd,_0x509151);}function _0x3b93(){const _0x5b5662=['1529290gCRsZK','API错误:','url','message','2285544FJnxZc','create','debug','npm_package_version','2317EUrwkZ','generic','331179hgddQU','application/json','client','status','API_RATE_LIMIT','timeout','1.0.0','API_ERROR','retry','API\x20error\x20response','error','setupInterceptors','API_TIMEOUT','data','handleError','retryHandler','Request\x20interceptor\x20error','hudsonAccessToken','API\x20response','请求频率过高,请稍后重试','网络错误,请检查网络连接','INTERNAL_ERROR','response','mcp','请求超时,请稍后重试','method','AUTH_INVALID','use','服务器错误,请稍后重试','API\x20request\x20timeout','delay','Request\x20configuration\x20error','369165QCQeXr','request','headers','apiKey','ECONNABORTED','PERMISSION_DENIED','config','2BzKNGy','3990276zqWhfn','API密钥无效或已过期','api','object','708608efKUgi','reject','路客云AI','权限不足','API_NOT_FOUND','execute','3728aefJEG'];_0x3b93=function(){return _0x5b5662;};return _0x3b93();}
1
+ (function(_0xac86c2,_0x40452d){const _0x28227c=_0xac86c2();while(!![]){try{const _0x4baabc=parseInt(_0x3662(0x150))/0x1+parseInt(_0x3662(0x12e))/0x2+-parseInt(_0x3662(0x168))/0x3+-parseInt(_0x3662(0x13e))/0x4+parseInt(_0x3662(0x144))/0x5*(parseInt(_0x3662(0x12b))/0x6)+-parseInt(_0x3662(0x159))/0x7+parseInt(_0x3662(0x138))/0x8;if(_0x4baabc===_0x40452d)break;else _0x28227c['push'](_0x28227c['shift']());}catch(_0x1e3d9c){_0x28227c['push'](_0x28227c['shift']());}}}(_0x5dc8,0xda837));import _0x16a971 from'axios';import{config}from'../config/index.js';function _0x3662(_0x5419c1,_0x4fe329){const _0x5dc8c3=_0x5dc8();return _0x3662=function(_0x366229,_0x2e634e){_0x366229=_0x366229-0x12a;let _0x482efd=_0x5dc8c3[_0x366229];return _0x482efd;},_0x3662(_0x5419c1,_0x4fe329);}import{logger}from'../utils/logger.js';import{MCPError,ErrorCode}from'../utils/errorHandler.js';import{RetryHandler}from'./retryHandler.js';function _0x5dc8(){const _0x32d6ff=['6KQdEMW','status','setupInterceptors','371128iDHLsz','apiKey','INTERNAL_ERROR','资源不存在','response','api','API\x20error\x20response','generic','code','Request\x20configuration\x20error','16596368WHeUOP','env','reject','路客云AI','headers','请求频率过高,请稍后重试','5219772ZRhvym','API密钥无效或已过期','maxRetries','baseURL','params','权限不足','7922945uliyrd','API\x20response','object','config','handleError','message','entries','retry','execute','data','API错误:','error','194660HfJIop','extraHeaders','url','PERMISSION_DENIED','method','use','API\x20request','retryHandler','timeout','1389227LcWUyv','请求超时,请稍后重试','网络错误,请检查网络连接','API_RATE_LIMIT','debug','client','Bearer\x20','API\x20request\x20timeout','request','Request\x20interceptor\x20error','API_ERROR','请求配置错误','1.0.0','interceptors','API_NOT_FOUND','4922772cGCdIj','delay','hudsonAccessToken','application/json'];_0x5dc8=function(){return _0x32d6ff;};return _0x5dc8();}export class HTTPClient{[_0x3662(0x15e)];['apiKey'];[_0x3662(0x16a)];[_0x3662(0x157)];[_0x3662(0x151)]={};constructor(_0x332327,_0x2f1d36){this[_0x3662(0x12f)]=_0x332327,this[_0x3662(0x16a)]=_0x2f1d36,this[_0x3662(0x157)]=new RetryHandler(config[_0x3662(0x14b)][_0x3662(0x140)],config[_0x3662(0x14b)][_0x3662(0x169)]),this[_0x3662(0x15e)]=_0x16a971['create']({'baseURL':config['api'][_0x3662(0x141)],'timeout':config[_0x3662(0x133)][_0x3662(0x158)],'headers':{'Content-Type':_0x3662(0x12a),'X-Client-Type':'mcp','X-Client-Version':process[_0x3662(0x139)]['npm_package_version']||_0x3662(0x165)}}),this[_0x3662(0x12d)]();}[_0x3662(0x12d)](){this[_0x3662(0x15e)][_0x3662(0x166)][_0x3662(0x161)][_0x3662(0x155)](_0x1ad526=>{this[_0x3662(0x12f)]&&(_0x1ad526[_0x3662(0x13c)]['Authorization']=_0x3662(0x15f)+this[_0x3662(0x12f)]);this[_0x3662(0x16a)]&&(_0x1ad526[_0x3662(0x13c)]['hudson-access-token']=this['hudsonAccessToken']);for(const [_0x2bf731,_0xd8311e]of Object[_0x3662(0x14a)](this[_0x3662(0x151)])){if(_0xd8311e)_0x1ad526[_0x3662(0x13c)][_0x2bf731]=_0xd8311e;}return logger['debug'](_0x3662(0x156),{'method':_0x1ad526[_0x3662(0x154)],'url':_0x1ad526[_0x3662(0x152)],'params':_0x1ad526[_0x3662(0x142)]}),_0x1ad526;},_0x47ae61=>{return logger[_0x3662(0x14f)](_0x3662(0x162),_0x47ae61),Promise[_0x3662(0x13a)](_0x47ae61);}),this[_0x3662(0x15e)][_0x3662(0x166)][_0x3662(0x132)][_0x3662(0x155)](_0x1de4a2=>{return logger[_0x3662(0x15d)](_0x3662(0x145),{'status':_0x1de4a2[_0x3662(0x12c)],'url':_0x1de4a2[_0x3662(0x147)]['url']}),_0x1de4a2;},async _0x333d35=>{return this[_0x3662(0x148)](_0x333d35);});}async[_0x3662(0x148)](_0xa8acb6){if(_0xa8acb6[_0x3662(0x132)]){const _0x1469bf=_0xa8acb6[_0x3662(0x132)][_0x3662(0x12c)],_0x4ca8bb=_0xa8acb6[_0x3662(0x132)]['data'];logger[_0x3662(0x14f)](_0x3662(0x134),{'status':_0x1469bf,'url':_0xa8acb6[_0x3662(0x147)]?.[_0x3662(0x152)],'message':_0x4ca8bb[_0x3662(0x149)]});switch(_0x1469bf){case 0x191:throw new MCPError(ErrorCode['AUTH_INVALID'],_0x3662(0x13f),_0x4ca8bb);case 0x193:throw new MCPError(ErrorCode[_0x3662(0x153)],_0x4ca8bb?.['message']||_0x3662(0x143),{..._0x4ca8bb!=null&&typeof _0x4ca8bb===_0x3662(0x146)?_0x4ca8bb:{},'domain':_0x3662(0x135),'source':_0x3662(0x13b)});case 0x194:throw new MCPError(ErrorCode[_0x3662(0x167)],_0x3662(0x131),_0x4ca8bb);case 0x1ad:throw new MCPError(ErrorCode[_0x3662(0x15c)],_0x3662(0x13d),_0x4ca8bb);case 0x1f4:case 0x1f6:case 0x1f7:case 0x1f8:throw new MCPError(ErrorCode['API_ERROR'],'服务器错误,请稍后重试',_0x4ca8bb);default:throw new MCPError(ErrorCode['API_ERROR'],_0x4ca8bb[_0x3662(0x149)]||_0x3662(0x14e)+_0x1469bf,_0x4ca8bb);}}else{if(_0xa8acb6[_0x3662(0x161)]){logger[_0x3662(0x14f)](_0x3662(0x160),{'url':_0xa8acb6[_0x3662(0x147)]?.[_0x3662(0x152)],'timeout':config[_0x3662(0x133)][_0x3662(0x158)]});if(_0xa8acb6[_0x3662(0x136)]==='ECONNABORTED')throw new MCPError(ErrorCode['API_TIMEOUT'],_0x3662(0x15a));throw new MCPError(ErrorCode[_0x3662(0x163)],_0x3662(0x15b));}else{logger['error'](_0x3662(0x137),_0xa8acb6);throw new MCPError(ErrorCode[_0x3662(0x130)],_0x3662(0x164));}}}['setExtraHeaders'](_0x189dec){this['extraHeaders']={..._0x189dec};}async[_0x3662(0x161)](_0x454448){const _0x43d863={'method':_0x454448['method'],'url':_0x454448[_0x3662(0x152)],'params':_0x454448[_0x3662(0x142)],'data':_0x454448[_0x3662(0x14d)],'headers':_0x454448[_0x3662(0x13c)]};try{const _0x295621=await this[_0x3662(0x157)][_0x3662(0x14c)](()=>this[_0x3662(0x15e)][_0x3662(0x161)](_0x43d863));return _0x295621['data'];}catch(_0x14beb4){throw _0x14beb4;}}}
@@ -1 +1 @@
1
- function _0x5471(){var _0x16ee36=['7qoXsPS','742312yYILVJ','1176944dXQCKt','4787037sEXwTc','110ldbLeG','112936xtbnix','4900698gSbsWu','2828724RHtFJL','984735BdVaHe','20nOksvf','30nfQzbc','39aFYKRY'];_0x5471=function(){return _0x16ee36;};return _0x5471();}(function(_0x4e0e34,_0xb40153){var _0x719a=_0x4e0e34();while(!![]){try{var _0x431500=parseInt(_0x4242(0x1e8))/0x1+parseInt(_0x4242(0x1e5))/0x2*(parseInt(_0x4242(0x1eb))/0x3)+parseInt(_0x4242(0x1ed))/0x4*(parseInt(_0x4242(0x1ea))/0x5)+-parseInt(_0x4242(0x1e6))/0x6+-parseInt(_0x4242(0x1ec))/0x7*(parseInt(_0x4242(0x1ee))/0x8)+-parseInt(_0x4242(0x1ef))/0x9*(-parseInt(_0x4242(0x1e9))/0xa)+-parseInt(_0x4242(0x1f0))/0xb*(parseInt(_0x4242(0x1e7))/0xc);if(_0x431500===_0xb40153)break;else _0x719a['push'](_0x719a['shift']());}catch(_0x35e2df){_0x719a['push'](_0x719a['shift']());}}}(_0x5471,0x8c5b6));function _0x4242(_0x30308f,_0x20196f){var _0x54714e=_0x5471();return _0x4242=function(_0x424280,_0x2d7558){_0x424280=_0x424280-0x1e5;var _0xc9586d=_0x54714e[_0x424280];return _0xc9586d;},_0x4242(_0x30308f,_0x20196f);}export{HTTPClient}from'./httpClient.js';export{RetryHandler}from'./retryHandler.js';export{CacheManager}from'./cacheManager.js';
1
+ (function(_0x33ff88,_0x320713){var _0x2b5775=_0x33ff88();while(!![]){try{var _0x434ea7=-parseInt(_0x2451(0x1c6))/0x1*(-parseInt(_0x2451(0x1c9))/0x2)+parseInt(_0x2451(0x1c4))/0x3+parseInt(_0x2451(0x1c8))/0x4+-parseInt(_0x2451(0x1cc))/0x5*(-parseInt(_0x2451(0x1c7))/0x6)+parseInt(_0x2451(0x1c5))/0x7+parseInt(_0x2451(0x1cd))/0x8*(parseInt(_0x2451(0x1cb))/0x9)+-parseInt(_0x2451(0x1ca))/0xa;if(_0x434ea7===_0x320713)break;else _0x2b5775['push'](_0x2b5775['shift']());}catch(_0x1a969c){_0x2b5775['push'](_0x2b5775['shift']());}}}(_0x2781,0x1bc20));function _0x2451(_0x924e4e,_0x5b05d0){var _0x278181=_0x2781();return _0x2451=function(_0x245189,_0x485606){_0x245189=_0x245189-0x1c4;var _0x5e013e=_0x278181[_0x245189];return _0x5e013e;},_0x2451(_0x924e4e,_0x5b05d0);}export{HTTPClient}from'./httpClient.js';export{RetryHandler}from'./retryHandler.js';function _0x2781(){var _0x3d19e2=['6925PmDctT','16biRYmv','350391gvHrjL','1041201XwsxYB','218641CWwVsd','246qnmnZu','844436KvucVs','2XRJHTo','7197370pxkBQN','366111aJRdnF'];_0x2781=function(){return _0x3d19e2;};return _0x2781();}export{CacheManager}from'./cacheManager.js';
@@ -1 +1 @@
1
- function _0x123b(_0x4c18bb,_0x548d4d){const _0xcd0ed4=_0xcd0e();return _0x123b=function(_0x123b76,_0x1995bc){_0x123b76=_0x123b76-0xaa;let _0x513d5e=_0xcd0ed4[_0x123b76];return _0x513d5e;},_0x123b(_0x4c18bb,_0x548d4d);}(function(_0x3edca9,_0x5a6e9c){const _0x4d186f=_0x3edca9();while(!![]){try{const _0xb78182=-parseInt(_0x123b(0xab))/0x1+-parseInt(_0x123b(0xbb))/0x2*(-parseInt(_0x123b(0xb3))/0x3)+parseInt(_0x123b(0xae))/0x4+parseInt(_0x123b(0xbc))/0x5+-parseInt(_0x123b(0xaa))/0x6+-parseInt(_0x123b(0xad))/0x7+-parseInt(_0x123b(0xb9))/0x8;if(_0xb78182===_0x5a6e9c)break;else _0x4d186f['push'](_0x4d186f['shift']());}catch(_0x4802b3){_0x4d186f['push'](_0x4d186f['shift']());}}}(_0xcd0e,0x2ba1a));import{logger}from'../utils/logger.js';import{AxiosError}from'axios';export class RetryHandler{[_0x123b(0xb5)];[_0x123b(0xb7)];constructor(_0x6611c8=0x3,_0x4d1d07=0x3e8){this[_0x123b(0xb5)]=_0x6611c8,this[_0x123b(0xb7)]=_0x4d1d07;}async['execute'](_0x5257c7){let _0x13238a;for(let _0x5350dc=0x0;_0x5350dc<=this[_0x123b(0xb5)];_0x5350dc++){try{return await _0x5257c7();}catch(_0xb3ad88){_0x13238a=_0xb3ad88;if(_0x5350dc===this['maxRetries'])break;if(!this['isRetryableError'](_0xb3ad88))throw _0xb3ad88;const _0xe6961a=this['baseDelay']*Math['pow'](0x2,_0x5350dc);logger[_0x123b(0xb6)](_0x123b(0xb8)+(_0x5350dc+0x1)+'/'+this[_0x123b(0xb5)]+')',{'error':_0xb3ad88 instanceof Error?_0xb3ad88['message']:String(_0xb3ad88),'delay':_0xe6961a}),await this[_0x123b(0xb2)](_0xe6961a);}}throw _0x13238a;}[_0x123b(0xb4)](_0xcdc9e7){if(_0xcdc9e7 instanceof AxiosError){if(_0xcdc9e7[_0x123b(0xbd)]===_0x123b(0xb0)||_0xcdc9e7[_0x123b(0xbd)]===_0x123b(0xb1)||_0xcdc9e7[_0x123b(0xbd)]===_0x123b(0xba))return!![];if(_0xcdc9e7[_0x123b(0xac)]&&_0xcdc9e7[_0x123b(0xac)][_0x123b(0xaf)]>=0x1f4)return!![];if(_0xcdc9e7[_0x123b(0xac)]&&_0xcdc9e7[_0x123b(0xac)][_0x123b(0xaf)]===0x1ad)return!![];}return![];}[_0x123b(0xb2)](_0x1c757c){return new Promise(_0x1150f8=>setTimeout(_0x1150f8,_0x1c757c));}}function _0xcd0e(){const _0x2dde1a=['response','80591QiRuuZ','1400452COtOgd','status','ECONNRESET','ETIMEDOUT','sleep','123iHYNyU','isRetryableError','maxRetries','warn','baseDelay','Request\x20failed,\x20retrying...\x20(attempt\x20','3587048QuucPs','ECONNABORTED','14990bDxJBa','1197020okvFVR','code','1285302qKwYwW','43987NlpdWl'];_0xcd0e=function(){return _0x2dde1a;};return _0xcd0e();}
1
+ function _0x26cb(_0x166a4b,_0x2df567){const _0x2854de=_0x2854();return _0x26cb=function(_0x26cb05,_0x50ccf6){_0x26cb05=_0x26cb05-0xc0;let _0x2da0b5=_0x2854de[_0x26cb05];return _0x2da0b5;},_0x26cb(_0x166a4b,_0x2df567);}(function(_0x2c291e,_0x18b891){const _0x19a1c7=_0x2c291e();while(!![]){try{const _0x2c9bbb=-parseInt(_0x26cb(0xc4))/0x1+-parseInt(_0x26cb(0xd4))/0x2*(parseInt(_0x26cb(0xcf))/0x3)+-parseInt(_0x26cb(0xc5))/0x4+parseInt(_0x26cb(0xd2))/0x5*(-parseInt(_0x26cb(0xd7))/0x6)+parseInt(_0x26cb(0xd6))/0x7*(parseInt(_0x26cb(0xc9))/0x8)+parseInt(_0x26cb(0xca))/0x9*(-parseInt(_0x26cb(0xcb))/0xa)+parseInt(_0x26cb(0xc0))/0xb;if(_0x2c9bbb===_0x18b891)break;else _0x19a1c7['push'](_0x19a1c7['shift']());}catch(_0x1e1bc8){_0x19a1c7['push'](_0x19a1c7['shift']());}}}(_0x2854,0x4941c));import{logger}from'../utils/logger.js';import{AxiosError}from'axios';export class RetryHandler{[_0x26cb(0xd0)];[_0x26cb(0xc2)];constructor(_0x56bc31=0x3,_0x11e80b=0x3e8){this['maxRetries']=_0x56bc31,this[_0x26cb(0xc2)]=_0x11e80b;}async[_0x26cb(0xc8)](_0x21a895){let _0x4bff1f;for(let _0xb219ad=0x0;_0xb219ad<=this[_0x26cb(0xd0)];_0xb219ad++){try{return await _0x21a895();}catch(_0x1a1995){_0x4bff1f=_0x1a1995;if(_0xb219ad===this[_0x26cb(0xd0)])break;if(!this[_0x26cb(0xd5)](_0x1a1995))throw _0x1a1995;const _0x40147f=this[_0x26cb(0xc2)]*Math['pow'](0x2,_0xb219ad);logger[_0x26cb(0xce)](_0x26cb(0xcc)+(_0xb219ad+0x1)+'/'+this[_0x26cb(0xd0)]+')',{'error':_0x1a1995 instanceof Error?_0x1a1995['message']:String(_0x1a1995),'delay':_0x40147f}),await this['sleep'](_0x40147f);}}throw _0x4bff1f;}['isRetryableError'](_0x5f5251){if(_0x5f5251 instanceof AxiosError){if(_0x5f5251[_0x26cb(0xc3)]===_0x26cb(0xc6)||_0x5f5251[_0x26cb(0xc3)]===_0x26cb(0xd3)||_0x5f5251[_0x26cb(0xc3)]===_0x26cb(0xcd))return!![];if(_0x5f5251[_0x26cb(0xc7)]&&_0x5f5251[_0x26cb(0xc7)][_0x26cb(0xc1)]>=0x1f4)return!![];if(_0x5f5251['response']&&_0x5f5251[_0x26cb(0xc7)][_0x26cb(0xc1)]===0x1ad)return!![];}return![];}[_0x26cb(0xd1)](_0x5bee5d){return new Promise(_0x59090c=>setTimeout(_0x59090c,_0x5bee5d));}}function _0x2854(){const _0x570790=['23823xBKitM','1510KBxMFG','Request\x20failed,\x20retrying...\x20(attempt\x20','ECONNABORTED','warn','72051eUbRwp','maxRetries','sleep','5yJvjqb','ETIMEDOUT','22DbloMX','isRetryableError','32795GaDaeO','2480622QWfGPT','20614198WacFJF','status','baseDelay','code','351167VKkSnp','1162820CASvQW','ECONNRESET','response','execute','248ppMBHL'];_0x2854=function(){return _0x570790;};return _0x2854();}
@@ -1 +1 @@
1
- (function(_0x50bcb8,_0x5e00f9){const _0x49415a=_0x50bcb8();while(!![]){try{const _0x3e02f5=parseInt(_0x3762(0x199))/0x1*(parseInt(_0x3762(0x1a4))/0x2)+-parseInt(_0x3762(0x1ab))/0x3*(parseInt(_0x3762(0x198))/0x4)+-parseInt(_0x3762(0x197))/0x5+parseInt(_0x3762(0x1ad))/0x6+-parseInt(_0x3762(0x1b0))/0x7*(parseInt(_0x3762(0x195))/0x8)+-parseInt(_0x3762(0x1a7))/0x9+-parseInt(_0x3762(0x19b))/0xa*(-parseInt(_0x3762(0x1a2))/0xb);if(_0x3e02f5===_0x5e00f9)break;else _0x49415a['push'](_0x49415a['shift']());}catch(_0x3bf29f){_0x49415a['push'](_0x49415a['shift']());}}}(_0x336f,0xbb041));import _0x474cc9 from'dotenv';function _0x3762(_0x44f120,_0x53d3e4){const _0x336f29=_0x336f();return _0x3762=function(_0x3762c9,_0x254f1c){_0x3762c9=_0x3762c9-0x194;let _0x31a178=_0x336f29[_0x3762c9];return _0x31a178;},_0x3762(_0x44f120,_0x53d3e4);}_0x474cc9['config']();const resolvedEnv=process[_0x3762(0x1a5)][_0x3762(0x1ac)]||_0x3762(0x19a);function _0x336f(){const _0x5d87b5=['info','24591ghyujp','develop','LUKEYUN_API_BASE_URL','1944pNAPQH','LOG_FORMAT','4345770lHfDEJ','2074984CbgvSb','11AMlWUX','production','170noQKzl','300000','json','LOCALSBNB_LOG_TO_FILES','30000','https://hudson-dev.localhome.cn','3000','1210517ILFfdY','https://hudson-prod.localhome.cn','277154AnDHdL','env','PORT','4476564rlEqXJ','CACHE_ENABLED','LOG_LEVEL','true','6rEbfMW','NODE_ENV','3771432vQXaOH','CACHE_TTL'];_0x336f=function(){return _0x5d87b5;};return _0x336f();}function resolveBaseURL(){if(process['env'][_0x3762(0x194)])return process[_0x3762(0x1a5)][_0x3762(0x194)];if(resolvedEnv===_0x3762(0x1b1)||resolvedEnv==='development')return _0x3762(0x1a0);return _0x3762(0x1a3);}export const config={'api':{'baseURL':resolveBaseURL(),'timeout':parseInt(process[_0x3762(0x1a5)]['API_TIMEOUT']||_0x3762(0x19f),0xa)},'server':{'port':parseInt(process['env'][_0x3762(0x1a6)]||_0x3762(0x1a1),0xa),'env':resolvedEnv},'cache':{'enabled':process[_0x3762(0x1a5)][_0x3762(0x1a8)]===_0x3762(0x1aa),'ttl':parseInt(process[_0x3762(0x1a5)][_0x3762(0x1ae)]||_0x3762(0x19c),0xa)},'retry':{'maxRetries':parseInt(process[_0x3762(0x1a5)]['MAX_RETRIES']||'3',0xa),'delay':parseInt(process[_0x3762(0x1a5)]['RETRY_DELAY']||'1000',0xa)},'log':{'level':process[_0x3762(0x1a5)][_0x3762(0x1a9)]||_0x3762(0x1af),'format':process[_0x3762(0x1a5)][_0x3762(0x196)]||_0x3762(0x19d),'toFiles':process['env'][_0x3762(0x19e)]==='1'||process[_0x3762(0x1a5)][_0x3762(0x19e)]==='true'}};
1
+ (function(_0x774956,_0x1066a1){const _0x1b5daa=_0x774956();while(!![]){try{const _0x34ee78=parseInt(_0x5634(0x119))/0x1+parseInt(_0x5634(0x12c))/0x2*(parseInt(_0x5634(0x122))/0x3)+-parseInt(_0x5634(0x126))/0x4*(parseInt(_0x5634(0x131))/0x5)+-parseInt(_0x5634(0x11e))/0x6+-parseInt(_0x5634(0x11f))/0x7+-parseInt(_0x5634(0x12b))/0x8*(parseInt(_0x5634(0x11c))/0x9)+parseInt(_0x5634(0x136))/0xa;if(_0x34ee78===_0x1066a1)break;else _0x1b5daa['push'](_0x1b5daa['shift']());}catch(_0xbc6e86){_0x1b5daa['push'](_0x1b5daa['shift']());}}}(_0xd8e4,0x6788a));import _0x4eddca from'dotenv';_0x4eddca[_0x5634(0x128)]();function _0x5634(_0xfc2525,_0x4359db){const _0xd8e4e9=_0xd8e4();return _0x5634=function(_0x56349d,_0x15cc3a){_0x56349d=_0x56349d-0x119;let _0x277226=_0xd8e4e9[_0x56349d];return _0x277226;},_0x5634(_0xfc2525,_0x4359db);}const resolvedEnv=process[_0x5634(0x11b)][_0x5634(0x129)]||_0x5634(0x11a);function _0xd8e4(){const _0x395032=['env','18ivnNGR','CACHE_ENABLED','3158466MESkri','4231640ZSyVVf','https://hudson-prod.localhome.cn','CACHE_TTL','9RFEabW','RETRY_DELAY','json','LOG_FORMAT','346644PMggWz','LOG_LEVEL','config','NODE_ENV','info','2303456kLrknK','346890SDDNiB','MAX_RETRIES','develop','development','LUKEYUN_API_BASE_URL','15Wvparq','3000','300000','PORT','true','15847700ewVNsi','285747aIhyGt','production'];_0xd8e4=function(){return _0x395032;};return _0xd8e4();}function resolveBaseURL(){if(process[_0x5634(0x11b)][_0x5634(0x130)])return process['env'][_0x5634(0x130)];if(resolvedEnv===_0x5634(0x12e)||resolvedEnv===_0x5634(0x12f))return'https://hudson-dev.localhome.cn';return _0x5634(0x120);}export const config={'api':{'baseURL':resolveBaseURL(),'timeout':parseInt(process['env']['API_TIMEOUT']||'30000',0xa)},'server':{'port':parseInt(process[_0x5634(0x11b)][_0x5634(0x134)]||_0x5634(0x132),0xa),'env':resolvedEnv},'cache':{'enabled':process[_0x5634(0x11b)][_0x5634(0x11d)]===_0x5634(0x135),'ttl':parseInt(process[_0x5634(0x11b)][_0x5634(0x121)]||_0x5634(0x133),0xa)},'retry':{'maxRetries':parseInt(process[_0x5634(0x11b)][_0x5634(0x12d)]||'3',0xa),'delay':parseInt(process[_0x5634(0x11b)][_0x5634(0x123)]||'1000',0xa)},'log':{'level':process[_0x5634(0x11b)][_0x5634(0x127)]||_0x5634(0x12a),'format':process['env'][_0x5634(0x125)]||_0x5634(0x124),'toFiles':process[_0x5634(0x11b)]['LOCALSBNB_LOG_TO_FILES']==='1'||process['env']['LOCALSBNB_LOG_TO_FILES']===_0x5634(0x135)}};
@@ -1 +1 @@
1
- function _0x58ce(){const _0x35b21d=['object','15wfnvwo','query_pre_arrival_orders','2iShqyy','this_week=本周自然周房价;last_week=上周自然周。与「滚动\x207\x20天」不同','query_in_house_orders','今日订单(聚合事件):同时查询预抵(orderType=11)、在住(orderType=10)、预离(orderType=12)三组,并分别返回总数与明细。支持关键词:订单、今日订单情况、待办事项、待办、今日待办、待处理订单情况、订单情况。','query_room_prices','查询开始日期\x20YYYY-MM-DD;与\x20endDate\x20配对','89656wLErNM','订单查询(日期范围事件)。支持按\x20startDate/endDate\x20或\x20timeRange(this_week/last_week)\x20查询,不与今日订单/预抵/在住/预离混用。支持关键词:订单查询、查询订单、某时间段订单。','关键字(可选)','queryOrdersByDateRangeHandler','finance:read','query_operational_data_v2','10BhpBpb','日期,格式:YYYY-MM-DD,默认为当天','渠道ID列表(可选)','根据订单ID查询订单详情信息。返回中含客人姓名字段,向用户回复时必须说明客人姓名(不得省略)。支持关键词:XXX订单详情、订单详情、订单详情查询、订单详情统计、订单详情分析、订单详情报表、订单详情展示、订单详情可视化、订单详情仪表盘、订单详情报告、订单详情图表、订单详情表格。用户可先通过今日订单获得订单号再查详情','number','1192638YLrCWQ','queryTodayRoomStatusHandler','this_week=锚定日所在自然周(周一至周日);last_week=上一完整自然周。与\x20startDate/endDate\x20二选一','4652865KKoguT','query_pre_departure_orders','12xUXgOY','rooms:read','array','每页数量,默认10','57072xLOScp','queryPreDepartureOrdersHandler','1068ExAwPU','last_week','queryTodayOrdersHandler','queryOperationalDataV2Handler','queryRoomPricesHandler','797307oXRIIZ','页码,默认1','订单ID','查询运营数据:夜审分页、首页实时、经营分析(含入住率\x20OCC、ADR、RevPAR\x20等)。「本周」「本周入住率」「本周经营」「上周收入」等必须按自然周传参:优先传\x20timeRange\x20为\x20this_week\x20或\x20last_week(周一~周日,上海时区);或显式传\x20startDate、endDate\x20为当周起止日。勿仅用单日\x20date\x20代替「本周」——否则经营分析区间错误。单日查询可只传\x20date(或\x20startDate=endDate=同一天)。支持关键词:当前运营情况、今天数据、数据、经营情况、运营数据、本周入住率、本周经营、上周数据等。若可呈现可视化表格则使用表格呈现','32539HawLCp','每页数量,默认15,最大100','string','orderId','orders:read','从\x20date\x20起连续天数;与\x20timeRange\x20互斥(传\x20timeRange\x20时固定为自然周\x207\x20天)','房源分组ID列表(可选)','this_week','queryRoomStatusNewHandler','自定义统计区间起点,需与\x20endDate\x20同时传','8974kGsPwn','date','queryPreArrivalOrdersHandler','预离订单(今日待退房)。固定调用\x20/orders/get\x20且\x20orderType=12。支持关键词:预离、预离订单、今日待退房、今日预离订单、今天待退房、剩余待退房、今日预离。','预抵订单(今日待入住)。固定调用\x20/orders/get\x20且\x20orderType=11。支持关键词:预抵、预抵订单、今日待入住、今日预订订单、今天待入住、剩余待入住、今日预抵。','73414mAXGPH','查询天数,默认30天;与\x20timeRange\x20互斥(传\x20timeRange\x20时固定为自然周\x207\x20天)','与\x20timeRange\x20联用时为锚定日(默认上海当天)','自定义统计区间终点,需与\x20startDate\x20同时传','查询结束日期\x20YYYY-MM-DD;与\x20startDate\x20配对','this_week=本周自然周;last_week=上周自然周。与\x20startDate/endDate\x20二选一','房源类型ID列表(可选)','query_room_status_new','query_today_orders','329CpDfwb','查询房价(渠道\x20RP、可配置天数价格)。用户说「本周房价」「上周房价」时必须传\x20timeRange=this_week\x20或\x20last_week(自然周周一至周日,上海时区),不要用「近7天」或默认\x20days=7\x20代替「本周」——否则日期区间错误。用户只说「近一周」「最近7天」且无「本周」字样时,可用\x20date+days(默认从当天起\x207\x20天)。支持关键词:查看房态日历价、房态日历价、日历价、房价、近期房价、本月房间、XXX天房价、今日房价查询、房价查询','开始日期\x20YYYY-MM-DD,默认当天;与\x20timeRange\x20联用时表示锚定日所在周'];_0x58ce=function(){return _0x35b21d;};return _0x58ce();}(function(_0x5ba1a7,_0x57d36b){const _0x30c70d=_0x5ba1a7();while(!![]){try{const _0x74881c=parseInt(_0x4267(0xf8))/0x1*(-parseInt(_0x4267(0x11a))/0x2)+parseInt(_0x4267(0xf1))/0x3*(-parseInt(_0x4267(0x130))/0x4)+parseInt(_0x4267(0x118))/0x5*(-parseInt(_0x4267(0x12b))/0x6)+parseInt(_0x4267(0x114))/0x7*(parseInt(_0x4267(0x120))/0x8)+-parseInt(_0x4267(0x12e))/0x9*(parseInt(_0x4267(0x126))/0xa)+-parseInt(_0x4267(0x10b))/0xb*(-parseInt(_0x4267(0xf3))/0xc)+parseInt(_0x4267(0xfc))/0xd*(parseInt(_0x4267(0x106))/0xe);if(_0x74881c===_0x57d36b)break;else _0x30c70d['push'](_0x30c70d['shift']());}catch(_0x16142a){_0x30c70d['push'](_0x30c70d['shift']());}}}(_0x58ce,0xb8ecf));function _0x4267(_0xa117ab,_0x1b2061){const _0x58ce38=_0x58ce();return _0x4267=function(_0x426782,_0x37a66b){_0x426782=_0x426782-0xef;let _0x5dd66c=_0x58ce38[_0x426782];return _0x5dd66c;},_0x4267(_0xa117ab,_0x1b2061);}import*as _0x2ddb50 from'../tools/rooms/index.js';import*as _0x4cfd89 from'../tools/orders/index.js';import*as _0x2073bc from'../tools/finance/index.js';export const toolDefinitions=[{'name':_0x4267(0x112),'description':'按房型日历查询房态、可售与库存等(新接口)。与「房价/渠道价」无关:用户说「查看房态日历价」「房态日历价」指近期/渠道房价时,必须调用\x20query_room_prices,勿选本工具。用户说「本周」「上周」房态日历时必须传\x20timeRange=this_week\x20或\x20last_week(自然周周一至周日,上海时区),勿用「从今天起连续\x2030\x20天」代替本周。','inputSchema':{'type':'object','properties':{'date':{'type':_0x4267(0xfe),'format':_0x4267(0x107),'description':'开始日期,格式:YYYY-MM-DD,默认为当天;与\x20timeRange\x20联用时表示锚定日所在周'},'days':{'type':_0x4267(0x12a),'default':0x1e,'minimum':0x1,'description':_0x4267(0x10c)},'timeRange':{'type':_0x4267(0xfe),'enum':[_0x4267(0x103),_0x4267(0xf4)],'description':'this_week=本周自然周;last_week=上周自然周。与仅按天数的「近30天」不同'},'roomCategoryIds':{'type':_0x4267(0xef),'items':{'type':_0x4267(0x12a)},'description':_0x4267(0x111)},'roomCategoryGroupIds':{'type':_0x4267(0xef),'items':{'type':'number'},'description':_0x4267(0x102)},'channelIds':{'type':_0x4267(0xef),'items':{'type':_0x4267(0x12a)},'description':_0x4267(0x128)},'searchKey':{'type':_0x4267(0xfe),'description':'模糊搜索:房源编码、房源简称、房源名称(可选)'},'pageNum':{'type':_0x4267(0x12a),'default':0x1,'minimum':0x1,'description':_0x4267(0xf9)},'pageSize':{'type':_0x4267(0x12a),'default':0xf,'minimum':0x1,'maximum':0x64,'description':_0x4267(0xfd)}},'required':[]},'handler':_0x2ddb50[_0x4267(0x104)],'requiredScopes':[_0x4267(0x131)]},{'name':'query_today_room_status','description':'查询今日(或指定日)房态汇总:房间状态、库存与保洁等,不含渠道房价。「查看房态日历价」指房价时请用\x20query_room_prices。支持关键词:今日房态、今日房态查询、今日房态统计、今日房态分析、今日房态报表、今日房态展示、今日房态可视化、今日房态仪表盘、今日房态报告、今日房态图表、今日房态表格、房态查询、房态','inputSchema':{'type':_0x4267(0x117),'properties':{'date':{'type':_0x4267(0xfe),'format':_0x4267(0x107),'description':_0x4267(0x127)}},'required':[]},'handler':_0x2ddb50[_0x4267(0x12c)],'requiredScopes':['rooms:read']},{'name':_0x4267(0x11e),'description':_0x4267(0x115),'inputSchema':{'type':_0x4267(0x117),'properties':{'date':{'type':_0x4267(0xfe),'format':_0x4267(0x107),'description':_0x4267(0x116)},'days':{'type':_0x4267(0x12a),'default':0x7,'minimum':0x1,'maximum':0x1e,'description':_0x4267(0x101)},'timeRange':{'type':_0x4267(0xfe),'enum':[_0x4267(0x103),_0x4267(0xf4)],'description':_0x4267(0x11b)}},'required':[]},'handler':_0x2ddb50[_0x4267(0xf7)],'requiredScopes':[_0x4267(0x131)]},{'name':_0x4267(0x113),'description':_0x4267(0x11d),'inputSchema':{'type':_0x4267(0x117),'properties':{'pageNum':{'type':'number','default':0x1,'minimum':0x1,'description':_0x4267(0xf9)},'pageSize':{'type':'number','default':0xa,'minimum':0x1,'maximum':0x32,'description':_0x4267(0xf0)},'keyword':{'type':_0x4267(0xfe),'description':_0x4267(0x122)}},'required':[]},'handler':_0x4cfd89[_0x4267(0xf5)],'requiredScopes':[_0x4267(0x100)]},{'name':_0x4267(0x119),'description':_0x4267(0x10a),'inputSchema':{'type':_0x4267(0x117),'properties':{'pageNum':{'type':_0x4267(0x12a),'default':0x1,'minimum':0x1,'description':_0x4267(0xf9)},'pageSize':{'type':'number','default':0xa,'minimum':0x1,'maximum':0x32,'description':'每页数量,默认10'},'keyword':{'type':_0x4267(0xfe),'description':_0x4267(0x122)}},'required':[]},'handler':_0x4cfd89[_0x4267(0x108)],'requiredScopes':[_0x4267(0x100)]},{'name':_0x4267(0x11c),'description':'在住订单(今日已入住)。固定调用\x20/orders/get\x20且\x20orderType=10。支持关键词:在住情况、在住订单、今日在住、今日已入住、已入住、今日在住订单。','inputSchema':{'type':'object','properties':{'pageNum':{'type':_0x4267(0x12a),'default':0x1,'minimum':0x1,'description':_0x4267(0xf9)},'pageSize':{'type':'number','default':0xa,'minimum':0x1,'maximum':0x32,'description':_0x4267(0xf0)},'keyword':{'type':_0x4267(0xfe),'description':_0x4267(0x122)}},'required':[]},'handler':_0x4cfd89['queryInHouseOrdersHandler'],'requiredScopes':['orders:read']},{'name':_0x4267(0x12f),'description':_0x4267(0x109),'inputSchema':{'type':_0x4267(0x117),'properties':{'pageNum':{'type':'number','default':0x1,'minimum':0x1,'description':_0x4267(0xf9)},'pageSize':{'type':_0x4267(0x12a),'default':0xa,'minimum':0x1,'maximum':0x32,'description':_0x4267(0xf0)},'keyword':{'type':_0x4267(0xfe),'description':'关键字(可选)'}},'required':[]},'handler':_0x4cfd89[_0x4267(0xf2)],'requiredScopes':[_0x4267(0x100)]},{'name':'query_orders_by_date_range','description':_0x4267(0x121),'inputSchema':{'type':'object','properties':{'startDate':{'type':_0x4267(0xfe),'description':_0x4267(0x11f)},'endDate':{'type':_0x4267(0xfe),'description':_0x4267(0x10f)},'timeRange':{'type':_0x4267(0xfe),'enum':[_0x4267(0x103),_0x4267(0xf4)],'description':_0x4267(0x110)},'date':{'type':_0x4267(0xfe),'format':_0x4267(0x107),'description':_0x4267(0x10d)},'pageNum':{'type':'number','default':0x1,'minimum':0x1,'description':_0x4267(0xf9)},'pageSize':{'type':_0x4267(0x12a),'default':0xa,'minimum':0x1,'maximum':0x32,'description':'每页数量,默认10'}},'required':[]},'handler':_0x4cfd89[_0x4267(0x123)],'requiredScopes':[_0x4267(0x100)]},{'name':'get_order_details_v2','description':_0x4267(0x129),'inputSchema':{'type':_0x4267(0x117),'properties':{'orderId':{'type':_0x4267(0xfe),'description':_0x4267(0xfa)}},'required':[_0x4267(0xff)]},'handler':_0x4cfd89['getOrderDetailsV2Handler'],'requiredScopes':['orders:read']},{'name':_0x4267(0x125),'description':_0x4267(0xfb),'inputSchema':{'type':'object','properties':{'date':{'type':_0x4267(0xfe),'format':_0x4267(0x107),'description':'锚定日期\x20YYYY-MM-DD:单日统计时即业务日;与\x20timeRange\x20联用时表示「以该日所在周」为本周/上周(默认不传则为上海当天)'},'startDate':{'type':_0x4267(0xfe),'format':_0x4267(0x107),'description':_0x4267(0x105)},'endDate':{'type':_0x4267(0xfe),'format':'date','description':_0x4267(0x10e)},'timeRange':{'type':_0x4267(0xfe),'enum':[_0x4267(0x103),_0x4267(0xf4)],'description':_0x4267(0x12d)}},'required':[]},'handler':_0x2073bc[_0x4267(0xf6)],'requiredScopes':[_0x4267(0x124)]}];
1
+ (function(_0x69395b,_0x183121){const _0x53d9b9=_0x69395b();while(!![]){try{const _0xe56167=parseInt(_0x12e1(0x17e))/0x1*(parseInt(_0x12e1(0x184))/0x2)+-parseInt(_0x12e1(0x18c))/0x3+-parseInt(_0x12e1(0x17b))/0x4*(parseInt(_0x12e1(0x18e))/0x5)+parseInt(_0x12e1(0x186))/0x6+-parseInt(_0x12e1(0x16f))/0x7+-parseInt(_0x12e1(0x1ab))/0x8*(-parseInt(_0x12e1(0x177))/0x9)+parseInt(_0x12e1(0x182))/0xa*(parseInt(_0x12e1(0x1a5))/0xb);if(_0xe56167===_0x183121)break;else _0x53d9b9['push'](_0x53d9b9['shift']());}catch(_0x55b5b9){_0x53d9b9['push'](_0x53d9b9['shift']());}}}(_0x2c2f,0xd0cab));function _0x12e1(_0x975907,_0x1ea6ca){const _0x2c2f70=_0x2c2f();return _0x12e1=function(_0x12e17f,_0x42e9d0){_0x12e17f=_0x12e17f-0x156;let _0x1e0c1f=_0x2c2f70[_0x12e17f];return _0x1e0c1f;},_0x12e1(_0x975907,_0x1ea6ca);}import*as _0x1d2ce3 from'../tools/rooms/index.js';import*as _0x1d9861 from'../tools/orders/index.js';import*as _0x2ac91b from'../tools/finance/index.js';import{getOverseasToolDescription}from'../region/index.js';import*as _0x5682b0 from'../tools/overseas/writes.js';import{handleToolError}from'../utils/errorHandler.js';export const toolDefinitions=[{'name':_0x12e1(0x160),'description':_0x12e1(0x15c),'inputSchema':{'type':_0x12e1(0x1aa),'properties':{'date':{'type':'string','format':'date','description':_0x12e1(0x170)},'days':{'type':_0x12e1(0x1b0),'default':0x1e,'minimum':0x1,'description':_0x12e1(0x16d)},'timeRange':{'type':'string','enum':[_0x12e1(0x1a0),'last_week'],'description':'this_week=本周自然周;last_week=上周自然周。与仅按天数的「近30天」不同'},'roomCategoryIds':{'type':'array','items':{'type':_0x12e1(0x1b0)},'description':_0x12e1(0x18a)},'roomCategoryGroupIds':{'type':'array','items':{'type':_0x12e1(0x1b0)},'description':_0x12e1(0x17a)},'channelIds':{'type':'array','items':{'type':'number'},'description':_0x12e1(0x15d)},'searchKey':{'type':_0x12e1(0x18b),'description':_0x12e1(0x159)},'pageNum':{'type':_0x12e1(0x1b0),'default':0x1,'minimum':0x1,'description':_0x12e1(0x15e)},'pageSize':{'type':_0x12e1(0x1b0),'default':0xf,'minimum':0x1,'maximum':0x64,'description':_0x12e1(0x180)}},'required':[]},'handler':_0x1d2ce3[_0x12e1(0x158)],'requiredScopes':[_0x12e1(0x194)]},{'name':'query_today_room_status','description':_0x12e1(0x176),'inputSchema':{'type':_0x12e1(0x1aa),'properties':{'date':{'type':'string','format':_0x12e1(0x1ad),'description':_0x12e1(0x1a6)}},'required':[]},'handler':_0x1d2ce3['queryTodayRoomStatusHandler'],'requiredScopes':[_0x12e1(0x194)]},{'name':_0x12e1(0x195),'description':'查询房价(渠道\x20RP、可配置天数价格)。用户说「本周房价」「上周房价」时必须传\x20timeRange=this_week\x20或\x20last_week(自然周周一至周日,上海时区),不要用「近7天」或默认\x20days=7\x20代替「本周」——否则日期区间错误。用户只说「近一周」「最近7天」且无「本周」字样时,可用\x20date+days(默认从当天起\x207\x20天)。支持关键词:查看房态日历价、房态日历价、日历价、房价、近期房价、本月房间、XXX天房价、今日房价查询、房价查询','inputSchema':{'type':_0x12e1(0x1aa),'properties':{'date':{'type':_0x12e1(0x18b),'format':_0x12e1(0x1ad),'description':_0x12e1(0x164)},'days':{'type':_0x12e1(0x1b0),'default':0x7,'minimum':0x1,'maximum':0x1e,'description':_0x12e1(0x163)},'timeRange':{'type':'string','enum':[_0x12e1(0x1a0),_0x12e1(0x191)],'description':_0x12e1(0x15b)}},'required':[]},'handler':_0x1d2ce3[_0x12e1(0x157)],'requiredScopes':[_0x12e1(0x194)]},{'name':_0x12e1(0x1a2),'description':_0x12e1(0x169),'inputSchema':{'type':_0x12e1(0x1aa),'properties':{'pageNum':{'type':_0x12e1(0x1b0),'default':0x1,'minimum':0x1,'description':_0x12e1(0x15e)},'pageSize':{'type':'number','default':0xa,'minimum':0x1,'maximum':0x32,'description':'每页数量,默认10'},'keyword':{'type':_0x12e1(0x18b),'description':'关键字(可选)'}},'required':[]},'handler':_0x1d9861[_0x12e1(0x171)],'requiredScopes':['orders:read']},{'name':_0x12e1(0x156),'description':_0x12e1(0x178),'inputSchema':{'type':_0x12e1(0x1aa),'properties':{'pageNum':{'type':_0x12e1(0x1b0),'default':0x1,'minimum':0x1,'description':'页码,默认1'},'pageSize':{'type':_0x12e1(0x1b0),'default':0xa,'minimum':0x1,'maximum':0x32,'description':_0x12e1(0x18d)},'keyword':{'type':'string','description':_0x12e1(0x19d)}},'required':[]},'handler':_0x1d9861[_0x12e1(0x181)],'requiredScopes':[_0x12e1(0x1ac)]},{'name':'query_in_house_orders','description':_0x12e1(0x19f),'inputSchema':{'type':_0x12e1(0x1aa),'properties':{'pageNum':{'type':'number','default':0x1,'minimum':0x1,'description':_0x12e1(0x15e)},'pageSize':{'type':_0x12e1(0x1b0),'default':0xa,'minimum':0x1,'maximum':0x32,'description':'每页数量,默认10'},'keyword':{'type':_0x12e1(0x18b),'description':_0x12e1(0x19d)}},'required':[]},'handler':_0x1d9861['queryInHouseOrdersHandler'],'requiredScopes':['orders:read']},{'name':_0x12e1(0x1a4),'description':_0x12e1(0x192),'inputSchema':{'type':'object','properties':{'pageNum':{'type':'number','default':0x1,'minimum':0x1,'description':_0x12e1(0x15e)},'pageSize':{'type':_0x12e1(0x1b0),'default':0xa,'minimum':0x1,'maximum':0x32,'description':_0x12e1(0x18d)},'keyword':{'type':'string','description':'关键字(可选)'}},'required':[]},'handler':_0x1d9861[_0x12e1(0x16e)],'requiredScopes':[_0x12e1(0x1ac)]},{'name':'query_orders_by_date_range','description':_0x12e1(0x183),'inputSchema':{'type':'object','properties':{'startDate':{'type':'string','description':_0x12e1(0x185)},'endDate':{'type':'string','description':_0x12e1(0x19e)},'timeRange':{'type':_0x12e1(0x18b),'enum':[_0x12e1(0x1a0),_0x12e1(0x191)],'description':_0x12e1(0x15a)},'date':{'type':_0x12e1(0x18b),'format':_0x12e1(0x1ad),'description':_0x12e1(0x16b)},'pageNum':{'type':'number','default':0x1,'minimum':0x1,'description':'页码,默认1'},'pageSize':{'type':_0x12e1(0x1b0),'default':0xa,'minimum':0x1,'maximum':0x32,'description':_0x12e1(0x18d)}},'required':[]},'handler':_0x1d9861['queryOrdersByDateRangeHandler'],'requiredScopes':[_0x12e1(0x1ac)]},{'name':_0x12e1(0x1b1),'description':_0x12e1(0x1ae),'inputSchema':{'type':_0x12e1(0x1aa),'properties':{'orderId':{'type':_0x12e1(0x18b),'description':'订单ID'}},'required':[_0x12e1(0x179)]},'handler':_0x1d9861[_0x12e1(0x19c)],'requiredScopes':[_0x12e1(0x1ac)]},{'name':'query_operational_data_v2','description':'查询运营数据:夜审分页、首页实时、经营分析(含入住率\x20OCC、ADR、RevPAR\x20等)。「本周」「本周入住率」「本周经营」「上周收入」等必须按自然周传参:优先传\x20timeRange\x20为\x20this_week\x20或\x20last_week(周一~周日,上海时区);或显式传\x20startDate、endDate\x20为当周起止日。勿仅用单日\x20date\x20代替「本周」——否则经营分析区间错误。单日查询可只传\x20date(或\x20startDate=endDate=同一天)。支持关键词:当前运营情况、今天数据、数据、经营情况、运营数据、本周入住率、本周经营、上周数据等。若可呈现可视化表格则使用表格呈现','inputSchema':{'type':_0x12e1(0x1aa),'properties':{'date':{'type':'string','format':_0x12e1(0x1ad),'description':'锚定日期\x20YYYY-MM-DD:单日统计时即业务日;与\x20timeRange\x20联用时表示「以该日所在周」为本周/上周(默认不传则为上海当天)'},'startDate':{'type':_0x12e1(0x18b),'format':_0x12e1(0x1ad),'description':_0x12e1(0x173)},'endDate':{'type':'string','format':_0x12e1(0x1ad),'description':'自定义统计区间终点,需与\x20startDate\x20同时传'},'timeRange':{'type':_0x12e1(0x18b),'enum':[_0x12e1(0x1a0),'last_week'],'description':_0x12e1(0x165)}},'required':[]},'handler':_0x2ac91b[_0x12e1(0x18f)],'requiredScopes':['finance:read']}];function overseasWriteTools(_0x532c66){const _0x30cfd2=_0x532c66[_0x12e1(0x196)];return[{'name':_0x12e1(0x1a1),'description':getOverseasToolDescription(_0x12e1(0x1a1),_0x30cfd2)||_0x12e1(0x190),'inputSchema':{'type':_0x12e1(0x1aa),'properties':{'orderDetailIds':{'type':'array','items':{'type':_0x12e1(0x18b)},'description':_0x12e1(0x19a)},'orderId':{'type':_0x12e1(0x18b),'description':_0x12e1(0x174)},'confirm':{'type':'boolean','description':_0x12e1(0x168)}},'required':[_0x12e1(0x199)]},'handler':async(_0x1f6494,_0x538ea5)=>{try{return _0x538ea5[_0x12e1(0x17d)]['checkPermission'](_0x12e1(0x1a1),[_0x12e1(0x198)]),await _0x5682b0[_0x12e1(0x189)](_0x1f6494,_0x538ea5);}catch(_0x3a28e1){return handleToolError(_0x3a28e1,_0x538ea5);}},'requiredScopes':[_0x12e1(0x198)]},{'name':'check_out_order','description':getOverseasToolDescription(_0x12e1(0x161),_0x30cfd2)||'Check\x20out\x20a\x20stay','inputSchema':{'type':_0x12e1(0x1aa),'properties':{'orderDetailIds':{'type':'array','items':{'type':_0x12e1(0x18b)},'description':'Stay\x20detail\x20IDs\x20to\x20check\x20out'},'orderId':{'type':_0x12e1(0x18b),'description':_0x12e1(0x174)},'confirm':{'type':'boolean','description':_0x12e1(0x168)}},'required':['orderDetailIds']},'handler':async(_0x24c524,_0x4e574f)=>{try{return _0x4e574f[_0x12e1(0x17d)][_0x12e1(0x166)]('check_out_order',['orders:write']),await _0x5682b0[_0x12e1(0x167)](_0x24c524,_0x4e574f);}catch(_0x3bdc9c){return handleToolError(_0x3bdc9c,_0x4e574f);}},'requiredScopes':['orders:write']},{'name':_0x12e1(0x16a),'description':getOverseasToolDescription(_0x12e1(0x16a),_0x30cfd2)||_0x12e1(0x187),'inputSchema':{'type':_0x12e1(0x1aa),'properties':{'previousOrderId':{'type':'string','description':'Current\x20order\x20ID\x20to\x20extend'},'nights':{'type':_0x12e1(0x1b0),'minimum':0x1,'description':_0x12e1(0x193)},'roomId':{'type':'string','description':_0x12e1(0x1a3)},'paid':{'type':_0x12e1(0x1b0),'description':'Optional\x20amount\x20already\x20paid,\x20in\x20fen'},'calcPayout':{'type':_0x12e1(0x19b),'description':_0x12e1(0x1a9)},'confirm':{'type':_0x12e1(0x19b),'description':'Execute\x20only\x20after\x20the\x20human\x20confirms\x20this\x20exact\x20booking\x20(guest\x20+\x20dates).\x20Omit\x20to\x20preview.\x20Never\x20true\x20on\x20the\x20first\x20lookup.'}},'required':[_0x12e1(0x1af),_0x12e1(0x17c),_0x12e1(0x1a8)]},'handler':async(_0x299794,_0x375a7f)=>{try{return _0x375a7f[_0x12e1(0x17d)][_0x12e1(0x166)]('extend_order',['orders:write']),await _0x5682b0[_0x12e1(0x15f)](_0x299794,_0x375a7f);}catch(_0x47daad){return handleToolError(_0x47daad,_0x375a7f);}},'requiredScopes':['orders:write']},{'name':_0x12e1(0x162),'description':getOverseasToolDescription(_0x12e1(0x162),_0x30cfd2)||_0x12e1(0x172),'inputSchema':{'type':_0x12e1(0x1aa),'properties':{'orderDetailId':{'type':_0x12e1(0x18b),'description':_0x12e1(0x175)},'roomId':{'type':'string','description':'Target\x20room\x20ID'},'orderId':{'type':_0x12e1(0x18b),'description':_0x12e1(0x174)},'confirm':{'type':'boolean','description':_0x12e1(0x168)}},'required':[_0x12e1(0x1a7),_0x12e1(0x1a8)]},'handler':async(_0x324bdb,_0x5d2bb9)=>{try{return _0x5d2bb9[_0x12e1(0x17d)][_0x12e1(0x166)](_0x12e1(0x162),[_0x12e1(0x198)]),await _0x5682b0[_0x12e1(0x17f)](_0x324bdb,_0x5d2bb9);}catch(_0x367ca6){return handleToolError(_0x367ca6,_0x5d2bb9);}},'requiredScopes':['orders:write']}];}export function getActiveToolDefinitions(_0x531561){if(_0x531561[_0x12e1(0x188)]!==_0x12e1(0x16c))return toolDefinitions;const _0x52fbf3=toolDefinitions['map'](_0x978276=>{const _0x40fe69=getOverseasToolDescription(_0x978276[_0x12e1(0x197)],_0x531561[_0x12e1(0x196)]);return _0x40fe69?{..._0x978276,'description':_0x40fe69}:_0x978276;});return[..._0x52fbf3,...overseasWriteTools(_0x531561)];}function _0x2c2f(){const _0x3f6693=['rooms:read','query_room_prices','locale','name','orders:write','orderDetailIds','Stay\x20detail\x20IDs\x20to\x20check\x20in','boolean','getOrderDetailsV2Handler','关键字(可选)','查询结束日期\x20YYYY-MM-DD;与\x20startDate\x20配对','在住订单(今日已入住)。固定调用\x20/orders/get\x20且\x20orderType=10。支持关键词:在住情况、在住订单、今日在住、今日已入住、已入住、今日在住订单。','this_week','check_in_order','query_today_orders','Room\x20ID\x20for\x20the\x20extension','query_pre_departure_orders','1474ItLQCm','日期,格式:YYYY-MM-DD,默认为当天','orderDetailId','roomId','If\x20true,\x20or\x20if\x20paid\x20is\x20omitted,\x20preview\x20calls\x20/bnbOrder/calcPayout.\x20Set\x20false\x20to\x20skip\x20quoting.','object','32msJLsI','orders:read','date','根据订单ID查询订单详情信息。返回中含客人姓名字段,向用户回复时必须说明客人姓名(不得省略)。支持关键词:XXX订单详情、订单详情、订单详情查询、订单详情统计、订单详情分析、订单详情报表、订单详情展示、订单详情可视化、订单详情仪表盘、订单详情报告、订单详情图表、订单详情表格。用户可先通过今日订单获得订单号再查详情','previousOrderId','number','get_order_details_v2','query_pre_arrival_orders','queryRoomPricesHandler','queryRoomStatusNewHandler','模糊搜索:房源编码、房源简称、房源名称(可选)','this_week=本周自然周;last_week=上周自然周。与\x20startDate/endDate\x20二选一','this_week=本周自然周房价;last_week=上周自然周。与「滚动\x207\x20天」不同','按房型日历查询房态、可售与库存等(新接口)。与「房价/渠道价」无关:用户说「查看房态日历价」「房态日历价」指近期/渠道房价时,必须调用\x20query_room_prices,勿选本工具。用户说「本周」「上周」房态日历时必须传\x20timeRange=this_week\x20或\x20last_week(自然周周一至周日,上海时区),勿用「从今天起连续\x2030\x20天」代替本周。','渠道ID列表(可选)','页码,默认1','extendOrderOverseas','query_room_status_new','check_out_order','arrange_room','从\x20date\x20起连续天数;与\x20timeRange\x20互斥(传\x20timeRange\x20时固定为自然周\x207\x20天)','开始日期\x20YYYY-MM-DD,默认当天;与\x20timeRange\x20联用时表示锚定日所在周','this_week=锚定日所在自然周(周一至周日);last_week=上一完整自然周。与\x20startDate/endDate\x20二选一','checkPermission','checkOutOrderOverseas','Execute\x20only\x20after\x20the\x20human\x20confirms\x20this\x20exact\x20booking\x20(guest\x20+\x20dates).\x20Omit\x20to\x20preview.\x20Never\x20true\x20on\x20the\x20first\x20lookup.','今日订单(聚合事件):同时查询预抵(orderType=11)、在住(orderType=10)、预离(orderType=12)三组,并分别返回总数与明细。支持关键词:订单、今日订单情况、待办事项、待办、今日待办、待处理订单情况、订单情况。','extend_order','与\x20timeRange\x20联用时为锚定日(默认上海当天)','overseas','查询天数,默认30天;与\x20timeRange\x20互斥(传\x20timeRange\x20时固定为自然周\x207\x20天)','queryPreDepartureOrdersHandler','11497997oMGVCR','开始日期,格式:YYYY-MM-DD,默认为当天;与\x20timeRange\x20联用时表示锚定日所在周','queryTodayOrdersHandler','Assign\x20or\x20change\x20room','自定义统计区间起点,需与\x20endDate\x20同时传','Optional\x20parent\x20order\x20ID\x20for\x20preview','Stay\x20detail\x20ID','查询今日(或指定日)房态汇总:房间状态、库存与保洁等,不含渠道房价。「查看房态日历价」指房价时请用\x20query_room_prices。支持关键词:今日房态、今日房态查询、今日房态统计、今日房态分析、今日房态报表、今日房态展示、今日房态可视化、今日房态仪表盘、今日房态报告、今日房态图表、今日房态表格、房态查询、房态','214416rlfySK','预抵订单(今日待入住)。固定调用\x20/orders/get\x20且\x20orderType=11。支持关键词:预抵、预抵订单、今日待入住、今日预订订单、今天待入住、剩余待入住、今日预抵。','orderId','房源分组ID列表(可选)','8fxdJLm','nights','permissionChecker','250xDKQQS','arrangeRoomOverseas','每页数量,默认15,最大100','queryPreArrivalOrdersHandler','190540iDDMen','订单查询(日期范围事件)。支持按\x20startDate/endDate\x20或\x20timeRange(this_week/last_week)\x20查询,不与今日订单/预抵/在住/预离混用。支持关键词:订单查询、查询订单、某时间段订单。','9902ZzMemF','查询开始日期\x20YYYY-MM-DD;与\x20endDate\x20配对','6979122Lecvrr','Extend\x20a\x20stay','region','checkInOrderOverseas','房源类型ID列表(可选)','string','4277529lccwWU','每页数量,默认10','2814610DwLMgz','queryOperationalDataV2Handler','Check\x20in\x20a\x20stay','last_week','预离订单(今日待退房)。固定调用\x20/orders/get\x20且\x20orderType=12。支持关键词:预离、预离订单、今日待退房、今日预离订单、今天待退房、剩余待退房、今日预离。','Nights\x20to\x20add\x20(>=1)'];_0x2c2f=function(){return _0x3f6693;};return _0x2c2f();}