@tencent-ai/codebuddy-code 0.0.1-beta.9 → 1.0.0
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/CHANGELOG.md +380 -0
- package/README.md +6 -6
- package/bin/codebuddy +1 -0
- package/dist/422.codebuddy.js +1 -0
- package/dist/444.codebuddy.js +1 -0
- package/dist/566.codebuddy.js +1 -0
- package/dist/597.codebuddy.js +1 -0
- package/dist/632.codebuddy.js +1 -0
- package/dist/814.codebuddy.js +1 -0
- package/dist/889.codebuddy.js +1 -0
- package/dist/952.codebuddy.js +1 -0
- package/dist/codebuddy.js +1 -1
- package/lib/node/index.js +5 -0
- package/package.json +9 -2
- package/product.internal.json +228 -0
- package/product.ioa.json +305 -0
- package/product.json +294 -46
- package/bin/rg +0 -0
- package/dist/291.codebuddy.js +0 -1
- package/dist/298.codebuddy.js +0 -1
- package/dist/368.codebuddy.js +0 -1
- package/dist/393.codebuddy.js +0 -1
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
# 更新日志
|
|
2
|
+
|
|
3
|
+
CodeBuddy Code 的所有重要更新都会记录在这里。
|
|
4
|
+
|
|
5
|
+
我们遵循 [语义化版本](https://semver.org/spec/v2.0.0.html) 规范。
|
|
6
|
+
|
|
7
|
+
## [1.0.0] - 2025-09-05
|
|
8
|
+
|
|
9
|
+
### 🎉 正式版发布
|
|
10
|
+
- **里程碑版本**:CodeBuddy Code 正式发布 1.0.0 版本,标志着产品进入稳定阶段
|
|
11
|
+
- **功能完善**:经过多个 beta 版本的迭代,核心功能已趋于稳定和成熟
|
|
12
|
+
|
|
13
|
+
### 🐛 问题修复
|
|
14
|
+
- **请求头修复**:修复请求头 conversation-request-id 错误问题,提升 API 调用准确性
|
|
15
|
+
- **工具执行优化**:修复取消工具执行时的上报问题,改进异常处理机制
|
|
16
|
+
- **Grep 工具稳定性**:解决 grep 工具卡住问题,提升搜索体验
|
|
17
|
+
|
|
18
|
+
### ✨ 新功能
|
|
19
|
+
- **多文件选择**:选择文件支持多文件操作,优化排序方式为 fuzzy-match 算法
|
|
20
|
+
- **目录管理增强**:实现 add-dir 指令的展示和选择后逻辑处理
|
|
21
|
+
|
|
22
|
+
### 🔧 功能改进
|
|
23
|
+
- **诊断工具增强**:doctor 增加账号环境信息显示
|
|
24
|
+
- **性能监控**:cost 服务增加 API 调用耗时统计
|
|
25
|
+
- **使用统计**:统计程序启动后的模型消耗和文件变化数据
|
|
26
|
+
|
|
27
|
+
### 🏗️ 架构优化
|
|
28
|
+
- **代码质量提升**:经过多轮重构和优化,代码架构更加稳定
|
|
29
|
+
- **依赖管理**:优化依赖关系,提升应用启动和运行性能
|
|
30
|
+
- **错误处理**:完善错误处理机制,提升用户体验
|
|
31
|
+
|
|
32
|
+
## [0.0.1-beta.32] - 2025-09-04
|
|
33
|
+
|
|
34
|
+
### 🐛 问题修复
|
|
35
|
+
- **Agent 管理优化**:修复登出和重建 Agent 时的异常处理,提升系统稳定性
|
|
36
|
+
- **环境切换修复**:解决切换内外网账号后模型配置匹配失败问题
|
|
37
|
+
|
|
38
|
+
### ✨ 新功能
|
|
39
|
+
- **使用统计监控**:新增模型消耗、token 使用量和文件变化的实时统计功能
|
|
40
|
+
- **灵活认证方式**:支持通过环境变量或自定义脚本获取 API 密钥,提升集成便利性
|
|
41
|
+
|
|
42
|
+
### 🔧 架构优化
|
|
43
|
+
- **Agent 状态管理**:重构登出流程,移除冗余监听器,简化状态管理逻辑
|
|
44
|
+
- **认证服务重构**:优化环境认证提供器,支持多环境无缝切换
|
|
45
|
+
- **成本服务集成**:新增 CostService 和相关协议,实现完整的使用量监控体系
|
|
46
|
+
- **遥测功能增强**:扩展遥测服务,集成成本统计和性能监控
|
|
47
|
+
- **产品环境管理**:优化环境配置动态更新机制
|
|
48
|
+
|
|
49
|
+
## [0.0.1-beta.31] - 2025-09-03
|
|
50
|
+
|
|
51
|
+
### 🐛 问题修复
|
|
52
|
+
- **输入体验优化**:修复在 Neovim 等编辑器中的输入问题,解决多行文本丢失和字符截断
|
|
53
|
+
- **登录流程改进**:修复登录地址跳转异常,确保认证流程正常运行
|
|
54
|
+
|
|
55
|
+
### ✨ 功能改进
|
|
56
|
+
- **终端兼容性增强**:改进对复杂终端环境的适配,提升输入稳定性
|
|
57
|
+
|
|
58
|
+
## [0.0.1-beta.30] - 2025-09-02
|
|
59
|
+
|
|
60
|
+
### 🐛 问题修复
|
|
61
|
+
- **界面显示优化**:修复多工具并行执行时的界面显示问题
|
|
62
|
+
- **文本输入改进**:解决多行文本粘贴丢失和参数解析异常
|
|
63
|
+
- **消息追踪修复**:改进消息ID上报机制,确保统计准确性
|
|
64
|
+
- **导航优化**:清理多余的路由跳转逻辑,提升交互流畅性
|
|
65
|
+
|
|
66
|
+
### ✨ 新功能
|
|
67
|
+
- **Jupyter 笔记本支持**:新增 NotebookWrite 工具,支持创建和编辑笔记本文件
|
|
68
|
+
- **多区域登录**:支持国内外不同账号登录,适配全球用户需求
|
|
69
|
+
- **MCP 服务器管理**:增强服务器连接状态显示和异步重连功能
|
|
70
|
+
|
|
71
|
+
### 🔧 功能改进
|
|
72
|
+
- **命令显示优化**:改进命令执行结果的渲染效果
|
|
73
|
+
- **状态管理优化**:统一属性命名规范,提升代码一致性
|
|
74
|
+
|
|
75
|
+
## [0.0.29] - 2025-09-01
|
|
76
|
+
|
|
77
|
+
### 🔧 性能优化
|
|
78
|
+
- **消息处理优化**:简化消息ID生成机制,提升处理性能
|
|
79
|
+
- **算法改进**:重构消息查找算法,提升查找准确性和速度
|
|
80
|
+
|
|
81
|
+
## [0.0.1-beta.28] - 2025-09-01
|
|
82
|
+
|
|
83
|
+
### 🐛 问题修复
|
|
84
|
+
- **界面优化**:修复工具详情页参数展示样式问题
|
|
85
|
+
- **连接稳定性**:解决 MCP 连接配置缺失导致的连接失败
|
|
86
|
+
|
|
87
|
+
### ✨ 新功能
|
|
88
|
+
- **自定义 Header**:支持自定义 HTTP header 配置,提升 API 请求灵活性
|
|
89
|
+
- **MCP 服务器管理**:增强连接状态显示和异步重连功能
|
|
90
|
+
- **IDE 集成优化**:在模型请求中添加 IDE 信息,便于调试
|
|
91
|
+
|
|
92
|
+
### 🔧 功能改进
|
|
93
|
+
- **消息追踪优化**:改进消息ID生成机制,提升统计准确性
|
|
94
|
+
|
|
95
|
+
## [0.0.1-beta.27] - 2025-08-29
|
|
96
|
+
|
|
97
|
+
### 🐛 问题修复
|
|
98
|
+
- **任务执行优化**:改进任务工具的会话控制和计时器逻辑
|
|
99
|
+
- **会话管理改进**:优化面板退出时的会话处理,确保状态正确维护
|
|
100
|
+
- **历史记录修复**:解决空字符串处理异常问题
|
|
101
|
+
|
|
102
|
+
### ✨ 新功能
|
|
103
|
+
- **MCP 协议支持**:新增 Model Context Protocol 配置管理功能
|
|
104
|
+
- **DeepSeek v3.1**:支持最新的 DeepSeek v3.1 模型
|
|
105
|
+
- **配置文件增强**:CODEBUDDY.md 支持 @ 语法嵌套引用其他文件
|
|
106
|
+
|
|
107
|
+
### 🚀 性能提升
|
|
108
|
+
- **上下文处理**:模型输入 token 限制提升至 128k,支持更大规模对话
|
|
109
|
+
- **模型配置**:重构配置拦截器,支持更灵活的参数设置
|
|
110
|
+
|
|
111
|
+
## [0.0.1-beta.26] - 2025-08-27
|
|
112
|
+
|
|
113
|
+
### ✨ 重大更新
|
|
114
|
+
- **任务工具**:新增 TaskTool 工具,支持独立会话执行复杂任务
|
|
115
|
+
- **消息队列管理**:新增消息队列管理器,提供更好的任务状态管理
|
|
116
|
+
- **中断处理**:新增中断服务,支持工具调用审批和中断处理
|
|
117
|
+
|
|
118
|
+
### 🔧 架构优化
|
|
119
|
+
- **代理系统**:优化代理拦截器,增强输入处理和状态管理
|
|
120
|
+
- **会话管理**:改进会话管理器,添加函数调用结果处理
|
|
121
|
+
- **UI 简化**:精简 UI 架构,移除冗余代码
|
|
122
|
+
|
|
123
|
+
### 🐛 问题修复
|
|
124
|
+
- **任务执行**:修复任务工具的中断处理和资源清理问题
|
|
125
|
+
- **用户交互**:优化工具调用审批和确认对话框体验
|
|
126
|
+
|
|
127
|
+
## [0.0.1-beta.25] - 2025-08-25
|
|
128
|
+
|
|
129
|
+
### 🔧 界面优化
|
|
130
|
+
- **状态显示简化**:移除呼吸灯动画,统一使用静态图标,提升性能
|
|
131
|
+
|
|
132
|
+
### 🐛 稳定性修复
|
|
133
|
+
- **Agent 状态管理**:修复空指针异常,提升状态更新安全性
|
|
134
|
+
|
|
135
|
+
## [0.0.1-beta.24] - 2025-08-25
|
|
136
|
+
|
|
137
|
+
### ✨ 新功能
|
|
138
|
+
- **MCP 协议完善**:完善 Model Context Protocol 支持,新增 `/mcp` 指令
|
|
139
|
+
- **文件操作增强**:读写工具支持相对/绝对路径,提升操作灵活性
|
|
140
|
+
- **输出优化**:添加标准输出截断功能,防止超长输出影响性能
|
|
141
|
+
- **工具确认优化**:改进工具确认对话框,支持拒绝和继续流程
|
|
142
|
+
|
|
143
|
+
### 🔧 功能改进
|
|
144
|
+
- **界面交互**:优化 ESC 退出逻辑,提升用户体验
|
|
145
|
+
- **工具渲染**:重构工具调用渲染系统,规范组件属性
|
|
146
|
+
- **设置集成**:支持动态工具描述模板渲染
|
|
147
|
+
- **提交流程**:默认关闭 Co-Authored-By 功能,简化操作
|
|
148
|
+
|
|
149
|
+
### 🐛 问题修复
|
|
150
|
+
- **命令处理**:解决子命令参数冲突问题
|
|
151
|
+
- **状态管理**:修复工具调用状态处理和会话管理逻辑
|
|
152
|
+
- **界面显示**:修复 diff 替换错误和界面渲染问题
|
|
153
|
+
- **类型安全**:统一接口命名,修复拼写错误
|
|
154
|
+
|
|
155
|
+
## [0.0.1-beta.23] - 2025-08-22
|
|
156
|
+
|
|
157
|
+
### ✨ 界面增强
|
|
158
|
+
- **呼吸灯动画**:新增工具执行状态的动态视觉反馈
|
|
159
|
+
- **生命周期管理**:添加应用优雅关闭和资源清理功能
|
|
160
|
+
|
|
161
|
+
### 🔧 组件优化
|
|
162
|
+
- **LoadingBox 重构**:采用组合式架构,提升可维护性
|
|
163
|
+
- **状态显示优化**:根据工具执行状态动态调整显示格式
|
|
164
|
+
- **动画流畅度**:提升终端界面动画体验
|
|
165
|
+
|
|
166
|
+
### 🐛 稳定性修复
|
|
167
|
+
- **内存管理**:修复应用退出时的资源清理问题
|
|
168
|
+
- **状态管理**:优化组件状态管理和渲染逻辑
|
|
169
|
+
|
|
170
|
+
## [0.0.1-beta.22] - 2025-08-22
|
|
171
|
+
|
|
172
|
+
### ✨ 重大功能
|
|
173
|
+
- **自动更新系统**:新增完整的自动更新服务,支持后台检查和用户通知
|
|
174
|
+
- **更新偏好设置**:用户可自定义更新偏好,控制更新行为
|
|
175
|
+
|
|
176
|
+
### 🔧 系统优化
|
|
177
|
+
- **通知系统重构**:统一更新通知管理,简化显示格式
|
|
178
|
+
- **上下文优化**:调整 token 阈值,提高上下文压缩触发频率
|
|
179
|
+
- **配置管理**:集中管理配置常量,提升可维护性
|
|
180
|
+
|
|
181
|
+
### 🐛 关键修复
|
|
182
|
+
- **订阅问题**:修复更新通知订阅只执行一次的问题
|
|
183
|
+
- **内存泄漏**:解决订阅生命周期管理导致的内存问题
|
|
184
|
+
- **渲染循环**:修复无限渲染循环问题
|
|
185
|
+
|
|
186
|
+
## [0.0.1-beta.21] - 2025-08-21
|
|
187
|
+
|
|
188
|
+
### ✨ 新功能
|
|
189
|
+
- **MCP 协议支持**:新增 Model Context Protocol 模块,支持服务器配置管理
|
|
190
|
+
- **命令界面**:添加指令对应面板,提升交互体验
|
|
191
|
+
- **输出优化**:添加输出截断功能,防止超长输出影响性能
|
|
192
|
+
|
|
193
|
+
### 🔧 功能改进
|
|
194
|
+
- **跨平台体验**:改进剪贴板兼容性检查和 Agent 状态管理
|
|
195
|
+
- **界面优化**:优化窄终端下的显示效果,改进 diff 颜色显示
|
|
196
|
+
- **代码编辑**:增强编辑工具验证逻辑,提高准确性和安全性
|
|
197
|
+
|
|
198
|
+
### 🐛 关键修复
|
|
199
|
+
- **内存泄漏**:修复搜索中止时的内存泄漏问题,提升应用稳定性
|
|
200
|
+
- **文本处理**:修复 diff 文本替换错误,改进处理准确性
|
|
201
|
+
- **状态管理**:修复会话状态判断逻辑,添加缺失的 React key 属性
|
|
202
|
+
|
|
203
|
+
## [0.0.1-beta.20] - 2025-08-21
|
|
204
|
+
|
|
205
|
+
### ✨ 跨平台增强
|
|
206
|
+
- **剪贴板兼容性**:新增 macOS/Windows/Linux 三大平台剪贴板兼容性检查
|
|
207
|
+
- **错误处理优化**:新增友好的错误提示和安装指引
|
|
208
|
+
- **后备方案**:为 macOS 添加 osascript 作为 pngpaste 的后备方案
|
|
209
|
+
|
|
210
|
+
### 📊 性能优化
|
|
211
|
+
- **输出截断**:添加输出截断功能,防止超长输出影响性能
|
|
212
|
+
- **内存管理**:优化上下文管理,分离用户和项目内存
|
|
213
|
+
|
|
214
|
+
### 🐛 重大修复
|
|
215
|
+
- **界面稳定性**:修复终端界面闪动问题,极大提升用户体验
|
|
216
|
+
- **显示优化**:修复窄终端下的边框显示和 diff 颜色问题
|
|
217
|
+
- **状态管理**:重构 Agent 状态管理,优化事件处理机制
|
|
218
|
+
|
|
219
|
+
## [0.0.1-beta.19] - 2025-08-21
|
|
220
|
+
|
|
221
|
+
### Added
|
|
222
|
+
- 实现连续用户消息自动合并功能,确保不会有连续一个以上的 user message 发送给 AI
|
|
223
|
+
- 新增 useAgentState hook,提供响应式的 Agent 状态管理
|
|
224
|
+
- 在 Session 接口中添加 agentStateSubject,支持状态变化的实时通知
|
|
225
|
+
- 支持 string 和数组两种 content 类型的消息合并,兼容多媒体内容
|
|
226
|
+
|
|
227
|
+
### Changed
|
|
228
|
+
- 将 agentState 从 SessionContext 迁移到 ConversationContext,职责分离更清晰
|
|
229
|
+
- LoadingBox 现在能实时响应 agentState 变化,提升用户体验
|
|
230
|
+
- 优化工具确认对话框第3选项文本:从 "No, and tell CodeBuddy what to do differently" 改为 "No, reject this tool and continue"
|
|
231
|
+
- 统一 inConversation 逻辑判断,使用 useContextSelector 精确订阅状态
|
|
232
|
+
|
|
233
|
+
### Fixed
|
|
234
|
+
- 修复 LoadingBox 无法感知 agentState 变化的问题
|
|
235
|
+
- 改进消息合并逻辑,在不同消息间添加分隔符以区分原始内容
|
|
236
|
+
- 优化 AgentStateAgentRunInterceptor,同时更新 agentState 和 agentStateSubject
|
|
237
|
+
|
|
238
|
+
### Technical Details
|
|
239
|
+
- mergeConsecutiveUserMessages: 新增连续用户消息合并函数
|
|
240
|
+
- mergeUserMessages: 支持多种 content 格式的消息合并
|
|
241
|
+
- AgentStateAgentRunInterceptor: 增强状态更新机制,支持响应式通知
|
|
242
|
+
- SessionFactory: 初始化 agentStateSubject 用于状态监听
|
|
243
|
+
- ConversationContext: 集中管理对话相关状态,包括 agentState
|
|
244
|
+
- ConfirmBox: 优化工具确认选项文本,更符合实际业务功能
|
|
245
|
+
|
|
246
|
+
## [0.0.1-beta.18] - 2025-08-20
|
|
247
|
+
|
|
248
|
+
### Added
|
|
249
|
+
- 实现基于 Ctrl+V 的图片粘贴功能,支持跨平台图片剪贴板检测(macOS/Windows/Linux)
|
|
250
|
+
- 新增图片占位符系统 `[Image #N]`,支持多图片粘贴和自动编号
|
|
251
|
+
- 集成 InputState 提示系统,当剪贴板无图片时显示友好提示
|
|
252
|
+
- 支持图片占位符删除时自动清理对应临时文件
|
|
253
|
+
- 消息发送时保留图片占位符文本,同时发送图片数据给 AI 模型
|
|
254
|
+
|
|
255
|
+
### Changed
|
|
256
|
+
- 提高 Agent 默认最大执行轮次从 20 提升到 100
|
|
257
|
+
- 抽象化 Agent 执行常量,统一管理在 agent-protocol.ts 中
|
|
258
|
+
- 优化图片粘贴检测机制,使用事件驱动替代定时轮询
|
|
259
|
+
- 每轮对话结束后自动重置图片索引计数器
|
|
260
|
+
|
|
261
|
+
### Technical Details
|
|
262
|
+
- ClipboardUtils: 新增跨平台剪贴板工具类,支持 macOS(pngpaste)、Windows(PowerShell)、Linux(xclip)
|
|
263
|
+
- InputItemUtils: 扩展支持多图片消息创建,保留原始文本中的占位符
|
|
264
|
+
- InkTextInput: 增强 Ctrl+V 事件捕获,支持图片粘贴检测
|
|
265
|
+
- InputHintBox: 新增 NO_IMAGE_HINT 状态和对应提示组件
|
|
266
|
+
- Agent Protocol: 新增 DEFAULT_MAX_TURNS = 100 常量定义
|
|
267
|
+
|
|
268
|
+
## [0.0.1-beta.17] - 2025-08-19
|
|
269
|
+
|
|
270
|
+
### Added
|
|
271
|
+
- 重构并增强 web-fetch 工具功能,支持更复杂的内容处理
|
|
272
|
+
- 新增 web-search 工具,支持搜索引擎集成
|
|
273
|
+
- 新增 notebook-edit 工具,增强 Jupyter Notebook 编辑功能
|
|
274
|
+
- 新增内容分析器代理指令模板
|
|
275
|
+
- 为确认对话框选项添加箭头指示符,提升用户界面可用性和直观性
|
|
276
|
+
|
|
277
|
+
### Changed
|
|
278
|
+
- 简化 web-fetch-tool 和 web-search-tool 的渲染器配置
|
|
279
|
+
- 重构 use-conversation-state 钩子,改进中断处理逻辑
|
|
280
|
+
- 优化回调函数的依赖项和清理逻辑
|
|
281
|
+
|
|
282
|
+
### Fixed
|
|
283
|
+
- 优化文件排除逻辑并改进通配符转正则表达式处理
|
|
284
|
+
|
|
285
|
+
### Technical Details
|
|
286
|
+
- ConfirmBox: 为选中的选项添加 '> ' 前缀,为未选中的选项添加 ' ' 前缀保持对齐
|
|
287
|
+
- WebSearchTool: 移除未使用的权限检查逻辑,添加别名支持
|
|
288
|
+
- WebFetchTool: 重构架构,增强内容处理能力
|
|
289
|
+
- NotebookEditTool: 全新实现,支持完整的 Jupyter Notebook 编辑操作
|
|
290
|
+
|
|
291
|
+
## [0.0.1-beta.16] - 2025-08-19
|
|
292
|
+
|
|
293
|
+
### Added
|
|
294
|
+
- 新增流式响应支持,ModelProvider 现在可以正确处理 Server-Sent Events 流式数据
|
|
295
|
+
- 基于工具调用结果内容长度的 token 计算优化
|
|
296
|
+
- 支持工具并行执行
|
|
297
|
+
|
|
298
|
+
### Changed
|
|
299
|
+
- 优化 token 显示逻辑,统一展示格式(优先显示输出 token,否则显示输入 token)
|
|
300
|
+
- 改进错误处理机制,根据 result.newItems 最后一项类型智能选择返回的消息类型
|
|
301
|
+
|
|
302
|
+
### Fixed
|
|
303
|
+
- 修复 axiosToFetchAdapter 方法对流式响应的处理问题
|
|
304
|
+
- 修复输入框内存状态检查顺序问题
|
|
305
|
+
- 修复 useTokenTracking hook 中 turnInputTokens 计算逻辑
|
|
306
|
+
- 修复 Connect Error 问题
|
|
307
|
+
- 修复 memory 模型无法回车问题
|
|
308
|
+
|
|
309
|
+
### Technical Details
|
|
310
|
+
- ModelProvider: 添加流式请求检测和 ReadableStream 创建
|
|
311
|
+
- TokenTracking: 使用 function_call_result 内容字符数计算输入 token
|
|
312
|
+
- ConversationState: 智能消息类型选择和历史补偿机制
|
|
313
|
+
- LoadingBox: 简化 token 信息展示,移除条件判断
|
|
314
|
+
|
|
315
|
+
## [0.0.1-beta.15] - 2025-08-19
|
|
316
|
+
|
|
317
|
+
### Added
|
|
318
|
+
- 新增版本发布和分支管理功能
|
|
319
|
+
- 改进输入框组件的用户体验
|
|
320
|
+
|
|
321
|
+
### Changed
|
|
322
|
+
- 更新版本号到 0.0.1-beta.15
|
|
323
|
+
- 优化输入建议菜单的交互逻辑
|
|
324
|
+
|
|
325
|
+
### Fixed
|
|
326
|
+
- 修复输入框相关的UI问题
|
|
327
|
+
|
|
328
|
+
## [0.0.1-beta.14] - 2025-08-18
|
|
329
|
+
|
|
330
|
+
### ✨ 功能增强
|
|
331
|
+
- **命令优化**:优化斜杠命令拦截器和 token 跟踪显示
|
|
332
|
+
- **文本输入改进**:增强多行编辑、自动补全和快捷键导航
|
|
333
|
+
- **消息队列**:添加待发送消息队列显示功能
|
|
334
|
+
- **加载体验**:增加更友好的 loading 提示
|
|
335
|
+
|
|
336
|
+
### 🐛 问题修复
|
|
337
|
+
- **显示优化**:修复 todo 完成颜色和代码展示问题
|
|
338
|
+
- **编码问题**:修复 Windows bash 中文乱码
|
|
339
|
+
- **工具渲染**:改进工具展开和显示逻辑
|
|
340
|
+
|
|
341
|
+
### 🔧 架构改进
|
|
342
|
+
- **工具系统重构**:调整参数结构和提示模板
|
|
343
|
+
- **依赖更新**:更新核心依赖到最新版本
|
|
344
|
+
|
|
345
|
+
## [0.0.1-beta.11] - 2025-08-14
|
|
346
|
+
|
|
347
|
+
### ✨ 新功能
|
|
348
|
+
- **历史记录**:添加输入历史记录,支持上下键导航和本地存储
|
|
349
|
+
- **环境变量**:支持设置中的环境变量应用到对话
|
|
350
|
+
- **界面稳定性**:使用静态组件修复终端闪烁问题
|
|
351
|
+
|
|
352
|
+
### 🐛 问题修复
|
|
353
|
+
- **显示优化**:修复错误刷新逻辑、回复样式和重复展示问题
|
|
354
|
+
- **界面调整**:优化 hint 边距和会话 margin
|
|
355
|
+
- **工具渲染**:解决工具不渲染和 bash 模式展开问题
|
|
356
|
+
- **文本处理**:修复多行文本展示和光标位置
|
|
357
|
+
- **页面闪烁**:修复登录页面和工具详情显示问题
|
|
358
|
+
|
|
359
|
+
### 🔧 架构优化
|
|
360
|
+
- **状态管理**:重构菜单状态管理,统一使用 InputState.MENU
|
|
361
|
+
- **命名规范**:统一文件编辑工具参数命名为 snake_case 风格
|
|
362
|
+
|
|
363
|
+
## [0.0.1-beta.10] - 2025-08-13 及之前
|
|
364
|
+
|
|
365
|
+
### 🎉 初始版本
|
|
366
|
+
- **核心功能**:实现基础 agent-cli 功能
|
|
367
|
+
- **工具系统**:搭建完整的工具系统架构
|
|
368
|
+
- **会话管理**:实现基础会话管理功能
|
|
369
|
+
- **CLI 界面**:构建基础命令行界面
|
|
370
|
+
|
|
371
|
+
### 🏗️ 架构建立
|
|
372
|
+
- **初始设计**:完成初始架构设计和基础实现
|
|
373
|
+
|
|
374
|
+
---
|
|
375
|
+
|
|
376
|
+
## 📋 版本说明
|
|
377
|
+
|
|
378
|
+
本更新日志记录了 CodeBuddy Code 的所有重要功能更新和问题修复。我们持续改进产品体验,为开发者提供更好的 AI 编程助手。
|
|
379
|
+
|
|
380
|
+
如有问题或建议,请访问 [Issues 页面](https://cnb.cool/codebuddy/codebuddy-code/-/issues) 反馈。
|
package/README.md
CHANGED
|
@@ -6,21 +6,21 @@
|
|
|
6
6
|
|
|
7
7
|
1. 安装 CodeBuddy Code:
|
|
8
8
|
```bash
|
|
9
|
-
npm install -g @tencent-ai/codebuddy-code
|
|
9
|
+
npm install -g @tencent-ai/codebuddy-code
|
|
10
10
|
```
|
|
11
11
|
2. 在项目目录下运行:
|
|
12
12
|
```bash
|
|
13
13
|
codebuddy
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
##
|
|
17
|
-
-
|
|
18
|
-
-
|
|
16
|
+
## 反馈问题
|
|
17
|
+
- 在 [Issues 页面](https://cnb.cool/codebuddy/codebuddy-code/-/issues) 中提交详细问题报告
|
|
18
|
+
- 通过官方渠道联系技术支持(codebuddy@tencent.com)
|
|
19
19
|
|
|
20
20
|
## 隐私与数据收集
|
|
21
21
|
- 用户反馈仅用于产品改进,不用于模型训练
|
|
22
22
|
- 反馈数据保存 30 天,隐私有保障
|
|
23
23
|
|
|
24
24
|
## 相关链接
|
|
25
|
-
- [官方文档](https://
|
|
26
|
-
- [产品主页](https://
|
|
25
|
+
- [官方文档](https://cnb.cool/codebuddy/codebuddy-code/-/blob/main/docs)
|
|
26
|
+
- [产品主页](https://cnb.cool/codebuddy/codebuddy-code)
|
package/bin/codebuddy
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=422,exports.ids=[422],exports.modules={7422:(e,t,n)=>{n.a(e,(async(e,r)=>{try{n.r(t),n.d(t,{LoginView:()=>LoginView});var l=n(80699),a=n(80932),o=n(14083),c=n(96540),i=n(66814),s=n(79413),u=n(36249),E=n(82101),m=n(34209),d=n(53829),g=n(49034),b=n(47693),h=n(83175),y=n(42790),p=e([o,E,d,g,y]);[o,E,d,g,y]=p.then?(await p)():p;const LoginView=()=>{const e=(0,i.i7)(d.Gb,(e=>e.staticKey));return c.createElement(c.Fragment,null,c.createElement(o.jC,{key:`login-view-${e}`,items:[c.createElement(LogoBox,{key:"logo-box"}),c.createElement(NewVersionBox,{key:"new-version-box"})]},(e=>e)),c.createElement(LoginBox,null))},LogoBox=()=>{const e=`Welcome to ${m.KR}`,t=e.length+8;return c.createElement(c.Fragment,null,c.createElement(o.az,{marginBottom:1,paddingLeft:1,borderStyle:"round",borderColor:h.Q.brand,width:t},c.createElement(o.EY,{color:h.Q.brand},"✻ ",e)),c.createElement(y.H,null))},NewVersionBox=()=>{const e="cyan",t=u.CW.getCurrentPackageJson(),n=t.version.includes("beta"),r=t.version.includes("alpha"),l=n?"@beta":r?"@alpha":"";return c.createElement(o.az,{paddingX:1,flexDirection:"column",borderStyle:"round",borderColor:e},c.createElement(o.EY,{color:e},"New Version Updated v",t.version," Release! Please visit ",m.KR," website to read changelog."),c.createElement(o.EY,{color:e},"Run npm install -g ",m.JP,l))},C={iOA:"iOA",WeChat:"internal",Google:"external",Github:"external"},LoginBox=()=>{const{authSession:e,navigate:t}=(0,i.i7)(d.aO,(e=>({authSession:e.authSession,navigate:e.navigate}))),[n,r]=(0,c.useState)("idle"),[m,y]=(0,c.useState)(""),[p,f]=(0,c.useState)(""),[w,G]=(0,c.useState)("iOA"),[S,Y]=(0,c.useState)(!1),A=(0,c.useRef)(new AbortController);(0,c.useEffect)((()=>{const e=(0,b.bi)().urlSubject.subscribe(y);return()=>e.unsubscribe()}),[]),(0,c.useEffect)((()=>{m&&u.E.copyToClipboard(m)}),[m]),(0,c.useEffect)((()=>{(async()=>{try{const e=l.ContainerUtil.get(s.Oc),t=await e.isIntranet();Y(t),t||"iOA"!==w||G("Google")}catch(e){Y(!1),"iOA"===w&&G("Google")}})()}),[w]),(0,o.Ge)(((l,a)=>{if("idle"===n){if(g.Om.RETURN(a))try{r("loading"),f(""),(0,b.Yf)().login({type:C[w],abortController:A.current})}catch(e){r("error"),f(e instanceof Error?e.message:"Unknown error occurred")}else if(a.upArrow||a.downArrow){const e=S?["iOA","Google","Github","WeChat"]:["Google","Github","WeChat"],t=e.indexOf(w);let n;n=a.upArrow?t<=0?e.length-1:t-1:t>=e.length-1?0:t+1,G(e[n])}}else g.Om.ESCAPE(a)&&("loading"===n?(A.current.abort(),r("idle")):e&&t("/chat"))}));const v=S?["iOA","Google","Github","WeChat"]:["Google","Github","WeChat"];return c.createElement(o.az,{paddingX:1,flexDirection:"column",gap:1,borderStyle:"round",borderColor:"grey"},"idle"===n?c.createElement(c.Fragment,null,c.createElement(o.az,null,c.createElement(o.EY,null,"Select login method:")),v.map((e=>c.createElement(o.az,{key:e},c.createElement(o.EY,{color:w===e?"green":"grey"},w===e?a.Ay.bullet:" "," Login with ",e)))),c.createElement(o.az,{justifyContent:"space-between"},c.createElement(o.EY,{color:"grey"},"(Use ↑↓ to select, Enter to login)"))):"loading"===n?c.createElement(o.az,{paddingY:1,gap:1,flexDirection:"column"},c.createElement(o.az,null,c.createElement(o.EY,{color:"grey"},"Browser didn't open? Use the url below to sign in: (Copied link to clipboard)")),m&&c.createElement(o.az,null,c.createElement(o.EY,{color:"grey"},m)),c.createElement(o.az,{marginTop:1,gap:1},c.createElement(o.EY,{color:h.Q.brand},c.createElement(E.y$,{type:"star"})),c.createElement(o.EY,null,"Waiting for auth... (Press ESC to cancel)"))):"error"===n?c.createElement(c.Fragment,null,c.createElement(o.EY,{color:"red"},"Failed to login."),p&&c.createElement(o.EY,{color:"red"},"Message: ",p)):void 0)};r()}catch(e){r(e)}}))},42790:(e,t,n)=>{n.a(e,(async(e,r)=>{try{n.d(t,{H:()=>LogoText});var l=n(1597),a=n(14083),o=n(96540),c=n(66814),i=n(53829),s=n(83175),u=e([a,i]);[a,i]=u.then?(await u)():u;const LogoText=()=>{const e=(0,c.i7)(i.Gb,(e=>e.terminalWidth)),t=(0,o.useRef)((0,l.Ay)(s.Q.GradientColors)),n=(0,o.useCallback)((e=>t.current.multiline(e)),[t]),r=(0,o.useCallback)((()=>e>115?"\n ██████╗ ██████╗ ██████╗ ███████╗██████╗ ██╗ ██╗██████╗ ██████╗ ██╗ ██╗ ██████╗ ██████╗ ██████╗ ███████╗\n██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔══██╗██║ ██║██╔══██╗██╔══██╗╚██╗ ██╔╝ ██╔════╝██╔═══██╗██╔══██╗██╔════╝\n██║ ██║ ██║██║ ██║█████╗ ██████╔╝██║ ██║██║ ██║██║ ██║ ╚████╔╝ ██║ ██║ ██║██║ ██║█████╗ \n██║ ██║ ██║██║ ██║██╔══╝ ██╔══██╗██║ ██║██║ ██║██║ ██║ ╚██╔╝ ██║ ██║ ██║██║ ██║██╔══╝ \n╚██████╗╚██████╔╝██████╔╝███████╗██████╔╝╚██████╔╝██████╔╝██████╔╝ ██║ ╚██████╗╚██████╔╝██████╔╝███████╗\n ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝\n \n\n . * . * . *\n /\\_/\\ \n ( o.o ) * . * \n > ^ < . \n":" \n ██████╗ ██████╗ ██████╗ ███████╗██████╗ ██╗ ██╗██████╗ ██████╗ ██╗ ██╗\n██╔════╝██╔═══██╗██╔══██╗██╔════╝██╔══██╗██║ ██║██╔══██╗██╔══██╗╚██╗ ██╔╝\n██║ ██║ ██║██║ ██║█████╗ ██████╔╝██║ ██║██║ ██║██║ ██║ ╚████╔╝ \n██║ ██║ ██║██║ ██║██╔══╝ ██╔══██╗██║ ██║██║ ██║██║ ██║ ╚██╔╝ \n╚██████╗╚██████╔╝██████╔╝███████╗██████╔╝╚██████╔╝██████╔╝██████╔╝ ██║ \n ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ \n \n ██████╗ ██████╗ ██████╗ ███████╗ \n██╔════╝██╔═══██╗██╔══██╗██╔════╝ \n██║ ██║ ██║██║ ██║█████╗ \n██║ ██║ ██║██║ ██║██╔══╝ \n╚██████╗╚██████╔╝██████╔╝███████╗ \n ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝ \n "),[e]);return o.createElement(a.dL,{transform:n},o.createElement(a.EY,null,r()))};r()}catch(e){r(e)}}))}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=444,exports.ids=[444],exports.modules={84444:(e,t,r)=>{r.r(t),r.d(t,{Client:()=>Client});var s=r(76889);class Protocol{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this.setNotificationHandler(s.CancelledNotificationSchema,(e=>{const t=this._requestHandlerAbortControllers.get(e.params.requestId);null==t||t.abort(e.params.reason)})),this.setNotificationHandler(s.ProgressNotificationSchema,(e=>{this._onprogress(e)})),this.setRequestHandler(s.PingRequestSchema,(e=>({})))}_setupTimeout(e,t,r,s,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(s,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:o,onTimeout:s})}_resetTimeout(e){const t=this._timeoutInfo.get(e);if(!t)return!1;const r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new s.McpError(s.ErrorCode.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){const t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var t,r,o;this._transport=e;const i=null===(t=this.transport)||void 0===t?void 0:t.onclose;this._transport.onclose=()=>{null==i||i(),this._onclose()};const n=null===(r=this.transport)||void 0===r?void 0:r.onerror;this._transport.onerror=e=>{null==n||n(e),this._onerror(e)};const a=null===(o=this._transport)||void 0===o?void 0:o.onmessage;this._transport.onmessage=(e,t)=>{null==a||a(e,t),(0,s.isJSONRPCResponse)(e)||(0,s.isJSONRPCError)(e)?this._onresponse(e):(0,s.isJSONRPCRequest)(e)?this._onrequest(e,t):(0,s.isJSONRPCNotification)(e)?this._onnotification(e):this._onerror(new Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){var e;const t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,null===(e=this.onclose)||void 0===e||e.call(this);const r=new s.McpError(s.ErrorCode.ConnectionClosed,"Connection closed");for(const e of t.values())e(r)}_onerror(e){var t;null===(t=this.onerror)||void 0===t||t.call(this,e)}_onnotification(e){var t;const r=null!==(t=this._notificationHandlers.get(e.method))&&void 0!==t?t:this.fallbackNotificationHandler;void 0!==r&&Promise.resolve().then((()=>r(e))).catch((e=>this._onerror(new Error(`Uncaught error in notification handler: ${e}`))))}_onrequest(e,t){var r,o,i,n;const a=null!==(r=this._requestHandlers.get(e.method))&&void 0!==r?r:this.fallbackRequestHandler;if(void 0===a)return void(null===(o=this._transport)||void 0===o||o.send({jsonrpc:"2.0",id:e.id,error:{code:s.ErrorCode.MethodNotFound,message:"Method not found"}}).catch((e=>this._onerror(new Error(`Failed to send an error response: ${e}`)))));const l=new AbortController;this._requestHandlerAbortControllers.set(e.id,l);const u={signal:l.signal,sessionId:null===(i=this._transport)||void 0===i?void 0:i.sessionId,_meta:null===(n=e.params)||void 0===n?void 0:n._meta,sendNotification:t=>this.notification(t,{relatedRequestId:e.id}),sendRequest:(t,r,s)=>this.request(t,r,{...s,relatedRequestId:e.id}),authInfo:null==t?void 0:t.authInfo,requestId:e.id,requestInfo:null==t?void 0:t.requestInfo};Promise.resolve().then((()=>a(e,u))).then((t=>{var r;if(!l.signal.aborted)return null===(r=this._transport)||void 0===r?void 0:r.send({result:t,jsonrpc:"2.0",id:e.id})}),(t=>{var r,o;if(!l.signal.aborted)return null===(r=this._transport)||void 0===r?void 0:r.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:s.ErrorCode.InternalError,message:null!==(o=t.message)&&void 0!==o?o:"Internal error"}})})).catch((e=>this._onerror(new Error(`Failed to send response: ${e}`)))).finally((()=>{this._requestHandlerAbortControllers.delete(e.id)}))}_onprogress(e){const{progressToken:t,...r}=e.params,s=Number(t),o=this._progressHandlers.get(s);if(!o)return void this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));const i=this._responseHandlers.get(s),n=this._timeoutInfo.get(s);if(n&&i&&n.resetTimeoutOnProgress)try{this._resetTimeout(s)}catch(e){return void i(e)}o(r)}_onresponse(e){const t=Number(e.id),r=this._responseHandlers.get(t);if(void 0!==r)if(this._responseHandlers.delete(t),this._progressHandlers.delete(t),this._cleanupTimeout(t),(0,s.isJSONRPCResponse)(e))r(e);else{r(new s.McpError(e.error.code,e.error.message,e.error.data))}else this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`))}get transport(){return this._transport}async close(){var e;await(null===(e=this._transport)||void 0===e?void 0:e.close())}request(e,t,r){const{relatedRequestId:o,resumptionToken:i,onresumptiontoken:n}=null!=r?r:{};return new Promise(((a,l)=>{var u,c,d,h,p,m;if(!this._transport)return void l(new Error("Not connected"));!0===(null===(u=this._options)||void 0===u?void 0:u.enforceStrictCapabilities)&&this.assertCapabilityForMethod(e.method),null===(c=null==r?void 0:r.signal)||void 0===c||c.throwIfAborted();const v=this._requestMessageId++,_={...e,jsonrpc:"2.0",id:v};(null==r?void 0:r.onprogress)&&(this._progressHandlers.set(v,r.onprogress),_.params={...e.params,_meta:{...(null===(d=e.params)||void 0===d?void 0:d._meta)||{},progressToken:v}});const cancel=e=>{var t;this._responseHandlers.delete(v),this._progressHandlers.delete(v),this._cleanupTimeout(v),null===(t=this._transport)||void 0===t||t.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:v,reason:String(e)}},{relatedRequestId:o,resumptionToken:i,onresumptiontoken:n}).catch((e=>this._onerror(new Error(`Failed to send cancellation: ${e}`)))),l(e)};this._responseHandlers.set(v,(e=>{var s;if(!(null===(s=null==r?void 0:r.signal)||void 0===s?void 0:s.aborted)){if(e instanceof Error)return l(e);try{const r=t.parse(e.result);a(r)}catch(e){l(e)}}})),null===(h=null==r?void 0:r.signal)||void 0===h||h.addEventListener("abort",(()=>{var e;cancel(null===(e=null==r?void 0:r.signal)||void 0===e?void 0:e.reason)}));const f=null!==(p=null==r?void 0:r.timeout)&&void 0!==p?p:6e4;this._setupTimeout(v,f,null==r?void 0:r.maxTotalTimeout,(()=>cancel(new s.McpError(s.ErrorCode.RequestTimeout,"Request timed out",{timeout:f}))),null!==(m=null==r?void 0:r.resetTimeoutOnProgress)&&void 0!==m&&m),this._transport.send(_,{relatedRequestId:o,resumptionToken:i,onresumptiontoken:n}).catch((e=>{this._cleanupTimeout(v),l(e)}))}))}async notification(e,t){var r,s;if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);if((null!==(s=null===(r=this._options)||void 0===r?void 0:r.debouncedNotificationMethods)&&void 0!==s?s:[]).includes(e.method)&&!e.params&&!(null==t?void 0:t.relatedRequestId)){if(this._pendingDebouncedNotifications.has(e.method))return;return this._pendingDebouncedNotifications.add(e.method),void Promise.resolve().then((()=>{var r;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;const s={...e,jsonrpc:"2.0"};null===(r=this._transport)||void 0===r||r.send(s,t).catch((e=>this._onerror(e)))}))}const o={...e,jsonrpc:"2.0"};await this._transport.send(o,t)}setRequestHandler(e,t){const r=e.shape.method.value;this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,((r,s)=>Promise.resolve(t(e.parse(r),s))))}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){this._notificationHandlers.set(e.shape.method.value,(r=>Promise.resolve(t(e.parse(r)))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}}var o=r(82174);class Client extends Protocol{constructor(e,t){var r;super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._capabilities=null!==(r=null==t?void 0:t.capabilities)&&void 0!==r?r:{},this._ajv=new o}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=function mergeCapabilities(e,t){return Object.entries(t).reduce(((e,[t,r])=>(e[t]=r&&"object"==typeof r&&e[t]?{...e[t],...r}:r,e)),{...e})}(this._capabilities,e)}assertCapability(e,t){var r;if(!(null===(r=this._serverCapabilities)||void 0===r?void 0:r[e]))throw new Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),void 0===e.sessionId)try{const r=await this.request({method:"initialize",params:{protocolVersion:s.LATEST_PROTOCOL_VERSION,capabilities:this._capabilities,clientInfo:this._clientInfo}},s.InitializeResultSchema,t);if(void 0===r)throw new Error(`Server sent invalid initialize result: ${r}`);if(!s.SUPPORTED_PROTOCOL_VERSIONS.includes(r.protocolVersion))throw new Error(`Server's protocol version is not supported: ${r.protocolVersion}`);this._serverCapabilities=r.capabilities,this._serverVersion=r.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(r.protocolVersion),this._instructions=r.instructions,await this.notification({method:"notifications/initialized"})}catch(e){throw this.close(),e}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){var t,r,s,o,i;switch(e){case"logging/setLevel":if(!(null===(t=this._serverCapabilities)||void 0===t?void 0:t.logging))throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!(null===(r=this._serverCapabilities)||void 0===r?void 0:r.prompts))throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!(null===(s=this._serverCapabilities)||void 0===s?void 0:s.resources))throw new Error(`Server does not support resources (required for ${e})`);if("resources/subscribe"===e&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!(null===(o=this._serverCapabilities)||void 0===o?void 0:o.tools))throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!(null===(i=this._serverCapabilities)||void 0===i?void 0:i.completions))throw new Error(`Server does not support completions (required for ${e})`)}}assertNotificationCapability(e){var t;if("notifications/roots/list_changed"===e)if(!(null===(t=this._capabilities.roots)||void 0===t?void 0:t.listChanged))throw new Error(`Client does not support roots list changed notifications (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`)}}async ping(e){return this.request({method:"ping"},s.EmptyResultSchema,e)}async complete(e,t){return this.request({method:"completion/complete",params:e},s.CompleteResultSchema,t)}async setLoggingLevel(e,t){return this.request({method:"logging/setLevel",params:{level:e}},s.EmptyResultSchema,t)}async getPrompt(e,t){return this.request({method:"prompts/get",params:e},s.GetPromptResultSchema,t)}async listPrompts(e,t){return this.request({method:"prompts/list",params:e},s.ListPromptsResultSchema,t)}async listResources(e,t){return this.request({method:"resources/list",params:e},s.ListResourcesResultSchema,t)}async listResourceTemplates(e,t){return this.request({method:"resources/templates/list",params:e},s.ListResourceTemplatesResultSchema,t)}async readResource(e,t){return this.request({method:"resources/read",params:e},s.ReadResourceResultSchema,t)}async subscribeResource(e,t){return this.request({method:"resources/subscribe",params:e},s.EmptyResultSchema,t)}async unsubscribeResource(e,t){return this.request({method:"resources/unsubscribe",params:e},s.EmptyResultSchema,t)}async callTool(e,t=s.CallToolResultSchema,r){const o=await this.request({method:"tools/call",params:e},t,r),i=this.getToolOutputValidator(e.name);if(i){if(!o.structuredContent&&!o.isError)throw new s.McpError(s.ErrorCode.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(o.structuredContent)try{if(!i(o.structuredContent))throw new s.McpError(s.ErrorCode.InvalidParams,`Structured content does not match the tool's output schema: ${this._ajv.errorsText(i.errors)}`)}catch(e){if(e instanceof s.McpError)throw e;throw new s.McpError(s.ErrorCode.InvalidParams,`Failed to validate structured content: ${e instanceof Error?e.message:String(e)}`)}}return o}cacheToolOutputSchemas(e){this._cachedToolOutputValidators.clear();for(const t of e)if(t.outputSchema)try{const e=this._ajv.compile(t.outputSchema);this._cachedToolOutputValidators.set(t.name,e)}catch(e){}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){const r=await this.request({method:"tools/list",params:e},s.ListToolsResultSchema,t);return this.cacheToolOutputSchemas(r.tools),r}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}}}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=566,exports.ids=[566],exports.modules={19250:(e,t,a)=>{a.a(e,(async(e,n)=>{try{a.d(t,{NH:()=>i.NH,pF:()=>m.pF});var l=a(77146),s=a(89536),c=a(70790),m=a(62875),i=a(82388),r=e([l,s,c,m,i]);[l,s,c,m,i]=r.then?(await r)():r,n()}catch(e){n(e)}}))},90566:(e,t,a)=>{a.a(e,(async(e,n)=>{try{a.r(t),a.d(t,{ChatView:()=>ChatView});var l=a(14083),s=a(96540),c=a(66814),m=a(26730),i=a(53829),r=a(59505),o=a(19250),u=a(66530),h=a(92709),d=e([l,m,i,r,o,u,h]);[l,m,i,r,o,u,h]=d.then?(await d)():d;const g=2,p=2,E=s.memo((({availableHeight:e})=>{const t=(0,c.i7)(i.Gb,(e=>e.staticKey)),a=(0,c.i7)(i.rZ,(e=>e.messageGroups)),n=(0,h.A)(a),[m,r]=(0,s.useState)([]),[o,d]=(0,s.useState)([]),p=(0,s.useMemo)((()=>Math.min(g*o.length,e)),[o]);(0,s.useEffect)((()=>{const e=[],t=[];for(const n of a){if("function_call_group"===n.type){if(!n.messages.find((e=>"function_call"===e.type&&e.status&&["completed","incomplete"].includes(e.status)))){t.push(...n.messages);continue}}e.push(...n.messages)}r(e),d(t)}),[a]);const E=s.useMemo((()=>[s.createElement(u.f,{key:"chat-header-box"}),...m.map((e=>s.createElement(h.h,{key:`message-item-${e.type}-${e.id}`,msg:e,expanded:n(e.id)})))]),[m,n]);return s.createElement(s.Fragment,null,s.createElement(l.jC,{key:t,items:E},(e=>e)),o.length?s.createElement(l.az,{flexDirection:"column",height:p,overflow:"hidden"},...o.map((e=>s.createElement(h.h,{key:`message-item-${e.id}-pending`,msg:e,expanded:n(e.id)})))):s.createElement(s.Fragment,null))})),ChatContainer=()=>{const e=(0,c.i7)(i.Gb,(e=>e.terminalHeight)),[t,a]=(0,s.useState)(0);return(0,s.useEffect)((()=>{a(e-p)}),[e]),(0,m.o)(),(0,r.f)(),s.createElement(s.Fragment,null,s.createElement(E,{availableHeight:t}),s.createElement(l.az,{flexDirection:"column"},s.createElement(o.NH,null,s.createElement(o.pF,{availableHeight:t}))))},ChatView=()=>s.createElement(i.N7,null,s.createElement(i.Y5,null,s.createElement(ChatContainer,null)));n()}catch(e){n(e)}}))}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
exports.id=597,exports.ids=[597],exports.modules={1597:(t,e,o)=>{"use strict";o.d(e,{Ay:()=>P});const wrapAnsi16=(t=0)=>e=>`[${e+t}m`,wrapAnsi256=(t=0)=>e=>`[${38+t};5;${e}m`,wrapAnsi16m=(t=0)=>(e,o,r)=>`[${38+t};2;${e};${o};${r}m`,r={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(r.modifier),Object.keys(r.color),Object.keys(r.bgColor);const n=function assembleStyles(){const t=new Map;for(const[e,o]of Object.entries(r)){for(const[e,n]of Object.entries(o))r[e]={open:`[${n[0]}m`,close:`[${n[1]}m`},o[e]=r[e],t.set(n[0],n[1]);Object.defineProperty(r,e,{value:o,enumerable:!1})}return Object.defineProperty(r,"codes",{value:t,enumerable:!1}),r.color.close="[39m",r.bgColor.close="[49m",r.color.ansi=wrapAnsi16(),r.color.ansi256=wrapAnsi256(),r.color.ansi16m=wrapAnsi16m(),r.bgColor.ansi=wrapAnsi16(10),r.bgColor.ansi256=wrapAnsi256(10),r.bgColor.ansi16m=wrapAnsi16m(10),Object.defineProperties(r,{rgbToAnsi256:{value:(t,e,o)=>t===e&&e===o?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(e/255*5)+Math.round(o/255*5),enumerable:!1},hexToRgb:{value(t){const e=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!e)return[0,0,0];let[o]=e;3===o.length&&(o=[...o].map((t=>t+t)).join(""));const r=Number.parseInt(o,16);return[r>>16&255,r>>8&255,255&r]},enumerable:!1},hexToAnsi256:{value:t=>r.rgbToAnsi256(...r.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value(t){if(t<8)return 30+t;if(t<16)return t-8+90;let e,o,r;if(t>=232)e=(10*(t-232)+8)/255,o=e,r=e;else{const n=(t-=16)%36;e=Math.floor(t/36)/5,o=Math.floor(n/6)/5,r=n%6/5}const n=2*Math.max(e,o,r);if(0===n)return 30;let i=30+(Math.round(r)<<2|Math.round(o)<<1|Math.round(e));return 2===n&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(t,e,o)=>r.ansi256ToAnsi(r.rgbToAnsi256(t,e,o)),enumerable:!1},hexToAnsi:{value:t=>r.ansi256ToAnsi(r.hexToAnsi256(t)),enumerable:!1}}),r}();var i=o(1708),a=o(48161),s=o(7066);function hasFlag(t,e=(globalThis.Deno?globalThis.Deno.args:i.argv)){const o=t.startsWith("-")?"":1===t.length?"-":"--",r=e.indexOf(o+t),n=e.indexOf("--");return-1!==r&&(-1===n||r<n)}const{env:l}=i;let c;function _supportsColor(t,{streamIsTTY:e,sniffFlags:o=!0}={}){const r=function envForceColor(){if("FORCE_COLOR"in l)return"true"===l.FORCE_COLOR?1:"false"===l.FORCE_COLOR?0:0===l.FORCE_COLOR.length?1:Math.min(Number.parseInt(l.FORCE_COLOR,10),3)}();void 0!==r&&(c=r);const n=o?c:r;if(0===n)return 0;if(o){if(hasFlag("color=16m")||hasFlag("color=full")||hasFlag("color=truecolor"))return 3;if(hasFlag("color=256"))return 2}if("TF_BUILD"in l&&"AGENT_NAME"in l)return 1;if(t&&!e&&void 0===n)return 0;const s=n||0;if("dumb"===l.TERM)return s;if("win32"===i.platform){const t=a.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in l)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some((t=>t in l))?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((t=>t in l))||"codeship"===l.CI_NAME?1:s;if("TEAMCITY_VERSION"in l)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(l.TEAMCITY_VERSION)?1:0;if("truecolor"===l.COLORTERM)return 3;if("xterm-kitty"===l.TERM)return 3;if("TERM_PROGRAM"in l){const t=Number.parseInt((l.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(l.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(l.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(l.TERM)||"COLORTERM"in l?1:s}function createSupportsColor(t,e={}){return function translateLevel(t){return 0!==t&&{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}(_supportsColor(t,{streamIsTTY:t&&t.isTTY,...e}))}hasFlag("no-color")||hasFlag("no-colors")||hasFlag("color=false")||hasFlag("color=never")?c=0:(hasFlag("color")||hasFlag("colors")||hasFlag("color=true")||hasFlag("color=always"))&&(c=1);const h={stdout:createSupportsColor({isTTY:s.isatty(1)}),stderr:createSupportsColor({isTTY:s.isatty(2)})};function stringReplaceAll(t,e,o){let r=t.indexOf(e);if(-1===r)return t;const n=e.length;let i=0,a="";do{a+=t.slice(i,r)+e+o,i=r+n,r=t.indexOf(e,i)}while(-1!==r);return a+=t.slice(i),a}const{stdout:u,stderr:f}=h,g=Symbol("GENERATOR"),p=Symbol("STYLER"),d=Symbol("IS_EMPTY"),b=["ansi","ansi","ansi256","ansi16m"],m=Object.create(null);const chalkFactory=t=>{const chalk=(...t)=>t.join(" ");return((t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const o=u?u.level:0;t.level=void 0===e.level?o:e.level})(chalk,t),Object.setPrototypeOf(chalk,createChalk.prototype),chalk};function createChalk(t){return chalkFactory(t)}Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(const[t,e]of Object.entries(n))m[t]={get(){const o=createBuilder(this,createStyler(e.open,e.close,this[p]),this[d]);return Object.defineProperty(this,t,{value:o}),o}};m.visible={get(){const t=createBuilder(this,this[p],!0);return Object.defineProperty(this,"visible",{value:t}),t}};const getModelAnsi=(t,e,o,...r)=>"rgb"===t?"ansi16m"===e?n[o].ansi16m(...r):"ansi256"===e?n[o].ansi256(n.rgbToAnsi256(...r)):n[o].ansi(n.rgbToAnsi(...r)):"hex"===t?getModelAnsi("rgb",e,o,...n.hexToRgb(...r)):n[o][t](...r),y=["rgb","hex","ansi256"];for(const t of y){m[t]={get(){const{level:e}=this;return function(...o){const r=createStyler(getModelAnsi(t,b[e],"color",...o),n.color.close,this[p]);return createBuilder(this,r,this[d])}}};m["bg"+t[0].toUpperCase()+t.slice(1)]={get(){const{level:e}=this;return function(...o){const r=createStyler(getModelAnsi(t,b[e],"bgColor",...o),n.bgColor.close,this[p]);return createBuilder(this,r,this[d])}}}}const v=Object.defineProperties((()=>{}),{...m,level:{enumerable:!0,get(){return this[g].level},set(t){this[g].level=t}}}),createStyler=(t,e,o)=>{let r,n;return void 0===o?(r=t,n=e):(r=o.openAll+t,n=e+o.closeAll),{open:t,close:e,openAll:r,closeAll:n,parent:o}},createBuilder=(t,e,o)=>{const builder=(...t)=>applyStyle(builder,1===t.length?""+t[0]:t.join(" "));return Object.setPrototypeOf(builder,v),builder[g]=t,builder[p]=e,builder[d]=o,builder},applyStyle=(t,e)=>{if(t.level<=0||!e)return t[d]?"":e;let o=t[p];if(void 0===o)return e;const{openAll:r,closeAll:n}=o;if(e.includes(""))for(;void 0!==o;)e=stringReplaceAll(e,o.close,o.open),o=o.parent;const i=e.indexOf("\n");return-1!==i&&(e=function stringEncaseCRLFWithFirstIndex(t,e,o,r){let n=0,i="";do{const a="\r"===t[r-1];i+=t.slice(n,a?r-1:r)+e+(a?"\r\n":"\n")+o,n=r+1,r=t.indexOf("\n",n)}while(-1!==r);return i+=t.slice(n),i}(e,n,r,i)),r+e+n};Object.defineProperties(createChalk.prototype,m);const _=createChalk(),x=(createChalk({level:f?f.level:0}),_);var A=o(34192);const gradient=(...t)=>{let e,o;if(0===t.length)throw new Error("Missing gradient colors");if(Array.isArray(t[0]))e=A(t[0]),o=validateOptions(t[1]);else{if(1===t.length)throw new Error(`Expected an array of colors, received ${JSON.stringify(t[0])}`);e=A(...t)}const fn=(t,r)=>function applyGradient(t,e,o){const r=validateOptions(o),n=Math.max(t.replace(/\s/g,"").length,e.stops.length),i=getColors(e,r,n);let a="";for(const e of t)a+=e.match(/\s/g)?e:x.hex(i.shift()?.toHex()||"#000")(e);return a}(t?t.toString():"",e,r??o);return fn.multiline=(t,r)=>function multiline(t,e,o){const r=validateOptions(o),n=t.split("\n"),i=Math.max(...n.map((t=>t.length)),e.stops.length),a=getColors(e,r,i),s=[];for(const t of n){const e=a.slice(0);let o="";for(const r of t)o+=x.hex(e.shift()?.toHex()||"#000")(r);s.push(o)}return s.join("\n")}(t?t.toString():"",e,r??o),fn},getColors=(t,e,o)=>"hsv"===e.interpolation?.toLowerCase()?t.hsv(o,e.hsvSpin?.toLowerCase()||!1):t.rgb(o);function validateOptions(t){const e={interpolation:"rgb",hsvSpin:"short",...t};if(void 0!==t&&"object"!=typeof t)throw new TypeError(`Expected \`options\` to be an \`object\`, got \`${typeof t}\``);if("string"!=typeof e.interpolation)throw new TypeError(`Expected \`options.interpolation\` to be \`rgb\` or \`hsv\`, got \`${typeof e.interpolation}\``);if("hsv"===e.interpolation.toLowerCase()&&"string"!=typeof e.hsvSpin)throw new TypeError(`Expected \`options.hsvSpin\` to be a \`short\` or \`long\`, got \`${typeof e.hsvSpin}\``);return e}const M={colors:["#bdfff3","#4ac29a"],options:{}},T={colors:["#77a1d3","#79cbca","#e684ae"],options:{}},w={colors:["#473b7b","#3584a7","#30d2be"],options:{}},S={colors:["#ff5f6d","#ffc371"],options:{interpolation:"hsv"}},R={colors:["#5ee7df","#b490ca"],options:{interpolation:"hsv"}},C={colors:["#f43b47","#453a94"],options:{}},H={colors:["#ff4e50","#f9d423"],options:{}},O={colors:["#833ab4","#fd1d1d","#fcb045"],options:{}},k={colors:["#3f51b1","#5a55ae","#7b5fac","#8f6aae","#a86aa4","#cc6b8e","#f18271","#f3a469","#f7c978"],options:{}},E={colors:["#fdbb2d","#22c1c3"],options:{}},F={colors:["#ff0000","#ff0100"],options:{interpolation:"hsv",hsvSpin:"long"}},I={colors:["#74ebd5","#74ecd5"],options:{interpolation:"hsv",hsvSpin:"long"}};function gradientAlias(t){const result=e=>gradient(...t.colors)(e,t.options);return result.multiline=(e="")=>gradient(...t.colors).multiline(e,t.options),result}const P=gradient,N=gradientAlias({colors:["#feac5e","#c779d0","#4bc0c8"],options:{}}),j=gradientAlias(M),L=gradientAlias(T),B=gradientAlias(w),G=gradientAlias(S),$=gradientAlias(R),U=gradientAlias(C),V=gradientAlias(H),D=gradientAlias(O),Y=gradientAlias(k),z=gradientAlias(E),q=gradientAlias(F),W=gradientAlias(I);gradient.atlas=N,gradient.cristal=j,gradient.teen=L,gradient.mind=B,gradient.morning=G,gradient.vice=$,gradient.passion=U,gradient.fruit=V,gradient.instagram=D,gradient.retro=Y,gradient.summer=z,gradient.rainbow=q,gradient.pastel=W},34192:(t,e,o)=>{const r=o(45888),n={r:256,g:256,b:256,a:1},i={h:360,s:1,v:1,a:1};function stepize(t,e,o){let r={};for(let n in t)t.hasOwnProperty(n)&&(r[n]=0===o?0:(e[n]-t[n])/o);return r}function interpolate(t,e,o,r){let n={};for(let i in e)e.hasOwnProperty(i)&&(n[i]=t[i]*o+e[i],n[i]=n[i]<0?n[i]+r[i]:1!==r[i]?n[i]%r[i]:n[i]);return n}function interpolateRgb(t,e,o){const i=t.color.toRgb(),a=stepize(i,e.color.toRgb(),o);let s=[t.color];for(let t=1;t<o;t++){const e=interpolate(a,i,t,n);s.push(r(e))}return s}function interpolateHsv(t,e,o,n){const a=t.color.toHsv(),s=e.color.toHsv();if(0===a.s||0===s.s)return interpolateRgb(t,e,o);let l;if("boolean"==typeof n)l=n;else{const t=a.h<s.h&&s.h-a.h<180||a.h>s.h&&a.h-s.h>180;l="long"===n&&t||"short"===n&&!t}const c=stepize(a,s,o);let h,u=[t.color];h=a.h<=s.h&&!l||a.h>=s.h&&l?s.h-a.h:l?360-s.h+a.h:360-a.h+s.h,c.h=Math.pow(-1,l?1:0)*Math.abs(h)/o;for(let t=1;t<o;t++){const e=interpolate(c,a,t,i);u.push(r(e))}return u}function computeSubsteps(t,e){const o=t.length;if(e=parseInt(e,10),isNaN(e)||e<2)throw new Error("Invalid number of steps (< 2)");if(e<o)throw new Error("Number of steps cannot be inferior to number of stops");let r=[];for(let n=1;n<o;n++){const o=(e-1)*(t[n].pos-t[n-1].pos);r.push(Math.max(1,Math.round(o)))}let n=1;for(let t=o-1;t--;)n+=r[t];for(;n!==e;)if(n<e){const t=Math.min.apply(null,r);r[r.indexOf(t)]++,n++}else{const t=Math.max.apply(null,r);r[r.indexOf(t)]--,n--}return r}function computeAt(t,e,o,n){if(e<0||e>1)throw new Error("Position must be between 0 and 1");let i,a;for(let o=0,r=t.length;o<r-1;o++)if(e>=t[o].pos&&e<t[o+1].pos){i=t[o],a=t[o+1];break}i||(i=a=t[t.length-1]);const s=interpolate(stepize(i.color[o](),a.color[o](),100*(a.pos-i.pos)),i.color[o](),100*(e-i.pos),n);return r(s)}class TinyGradient{constructor(t){if(t.length<2)throw new Error("Invalid number of stops (< 2)");const e=void 0!==t[0].pos;let o=t.length,n=-1,i=!1;this.stops=t.map(((t,a)=>{const s=void 0!==t.pos;if(e^s)throw new Error("Cannot mix positionned and not posionned color stops");if(s){const e=void 0!==t.color;if(!e&&(i||0===a||a===o-1))throw new Error("Cannot define two consecutive position-only stops");if(i=!e,(t={color:e?r(t.color):null,colorLess:!e,pos:t.pos}).pos<0||t.pos>1)throw new Error("Color stops positions must be between 0 and 1");if(t.pos<n)throw new Error("Color stops positions are not ordered");n=t.pos}else t={color:r(void 0!==t.color?t.color:t),pos:a/(o-1)};return t})),0!==this.stops[0].pos&&(this.stops.unshift({color:this.stops[0].color,pos:0}),o++),1!==this.stops[o-1].pos&&this.stops.push({color:this.stops[o-1].color,pos:1})}reverse(){let t=[];return this.stops.forEach((function(e){t.push({color:e.color,pos:1-e.pos})})),new TinyGradient(t.reverse())}loop(){let t=[],e=[];return this.stops.forEach((e=>{t.push({color:e.color,pos:e.pos/2})})),this.stops.slice(0,-1).forEach((t=>{e.push({color:t.color,pos:1-t.pos/2})})),new TinyGradient(t.concat(e.reverse()))}rgb(t){const e=computeSubsteps(this.stops,t);let o=[];this.stops.forEach(((t,e)=>{t.colorLess&&(t.color=interpolateRgb(this.stops[e-1],this.stops[e+1],2)[1])}));for(let t=0,r=this.stops.length;t<r-1;t++){const r=interpolateRgb(this.stops[t],this.stops[t+1],e[t]);o.splice(o.length,0,...r)}return o.push(this.stops[this.stops.length-1].color),o}hsv(t,e){const o=computeSubsteps(this.stops,t);let r=[];this.stops.forEach(((t,o)=>{t.colorLess&&(t.color=interpolateHsv(this.stops[o-1],this.stops[o+1],2,e)[1])}));for(let t=0,n=this.stops.length;t<n-1;t++){const n=interpolateHsv(this.stops[t],this.stops[t+1],o[t],e);r.splice(r.length,0,...n)}return r.push(this.stops[this.stops.length-1].color),r}css(t,e){let o=(t=t||"linear")+"-gradient("+(e=e||("linear"===t?"to right":"ellipse at center"));return this.stops.forEach((function(t){o+=", "+(t.colorLess?"":t.color.toRgbString()+" ")+100*t.pos+"%"})),o+=")",o}rgbAt(t){return computeAt(this.stops,t,"toRgb",n)}hsvAt(t){return computeAt(this.stops,t,"toHsv",i)}}t.exports=function(t){if(1===arguments.length){if(!Array.isArray(arguments[0]))throw new Error('"stops" is not an array');t=arguments[0]}else t=Array.prototype.slice.call(arguments);return new TinyGradient(t)}},45888:function(t){t.exports=function(){"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}var t=/^\s+/,e=/\s+$/;function tinycolor(t,e){if(e=e||{},(t=t||"")instanceof tinycolor)return t;if(!(this instanceof tinycolor))return new tinycolor(t,e);var o=inputToRGB(t);this._originalInput=t,this._r=o.r,this._g=o.g,this._b=o.b,this._a=o.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||o.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=o.ok}function inputToRGB(t){var e={r:0,g:0,b:0},o=1,r=null,n=null,i=null,a=!1,s=!1;return"string"==typeof t&&(t=stringInputToObject(t)),"object"==_typeof(t)&&(isValidCSSUnit(t.r)&&isValidCSSUnit(t.g)&&isValidCSSUnit(t.b)?(e=rgbToRgb(t.r,t.g,t.b),a=!0,s="%"===String(t.r).substr(-1)?"prgb":"rgb"):isValidCSSUnit(t.h)&&isValidCSSUnit(t.s)&&isValidCSSUnit(t.v)?(r=convertToPercentage(t.s),n=convertToPercentage(t.v),e=hsvToRgb(t.h,r,n),a=!0,s="hsv"):isValidCSSUnit(t.h)&&isValidCSSUnit(t.s)&&isValidCSSUnit(t.l)&&(r=convertToPercentage(t.s),i=convertToPercentage(t.l),e=hslToRgb(t.h,r,i),a=!0,s="hsl"),t.hasOwnProperty("a")&&(o=t.a)),o=boundAlpha(o),{ok:a,format:t.format||s,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:o}}function rgbToRgb(t,e,o){return{r:255*bound01(t,255),g:255*bound01(e,255),b:255*bound01(o,255)}}function rgbToHsl(t,e,o){t=bound01(t,255),e=bound01(e,255),o=bound01(o,255);var r,n,i=Math.max(t,e,o),a=Math.min(t,e,o),s=(i+a)/2;if(i==a)r=n=0;else{var l=i-a;switch(n=s>.5?l/(2-i-a):l/(i+a),i){case t:r=(e-o)/l+(e<o?6:0);break;case e:r=(o-t)/l+2;break;case o:r=(t-e)/l+4}r/=6}return{h:r,s:n,l:s}}function hslToRgb(t,e,o){var r,n,i;function hue2rgb(t,e,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?t+6*(e-t)*o:o<.5?e:o<2/3?t+(e-t)*(2/3-o)*6:t}if(t=bound01(t,360),e=bound01(e,100),o=bound01(o,100),0===e)r=n=i=o;else{var a=o<.5?o*(1+e):o+e-o*e,s=2*o-a;r=hue2rgb(s,a,t+1/3),n=hue2rgb(s,a,t),i=hue2rgb(s,a,t-1/3)}return{r:255*r,g:255*n,b:255*i}}function rgbToHsv(t,e,o){t=bound01(t,255),e=bound01(e,255),o=bound01(o,255);var r,n,i=Math.max(t,e,o),a=Math.min(t,e,o),s=i,l=i-a;if(n=0===i?0:l/i,i==a)r=0;else{switch(i){case t:r=(e-o)/l+(e<o?6:0);break;case e:r=(o-t)/l+2;break;case o:r=(t-e)/l+4}r/=6}return{h:r,s:n,v:s}}function hsvToRgb(t,e,o){t=6*bound01(t,360),e=bound01(e,100),o=bound01(o,100);var r=Math.floor(t),n=t-r,i=o*(1-e),a=o*(1-n*e),s=o*(1-(1-n)*e),l=r%6;return{r:255*[o,a,i,i,s,o][l],g:255*[s,o,o,a,i,i][l],b:255*[i,i,s,o,o,a][l]}}function rgbToHex(t,e,o,r){var n=[pad2(Math.round(t).toString(16)),pad2(Math.round(e).toString(16)),pad2(Math.round(o).toString(16))];return r&&n[0].charAt(0)==n[0].charAt(1)&&n[1].charAt(0)==n[1].charAt(1)&&n[2].charAt(0)==n[2].charAt(1)?n[0].charAt(0)+n[1].charAt(0)+n[2].charAt(0):n.join("")}function rgbaToHex(t,e,o,r,n){var i=[pad2(Math.round(t).toString(16)),pad2(Math.round(e).toString(16)),pad2(Math.round(o).toString(16)),pad2(convertDecimalToHex(r))];return n&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function rgbaToArgbHex(t,e,o,r){return[pad2(convertDecimalToHex(r)),pad2(Math.round(t).toString(16)),pad2(Math.round(e).toString(16)),pad2(Math.round(o).toString(16))].join("")}function _desaturate(t,e){e=0===e?0:e||10;var o=tinycolor(t).toHsl();return o.s-=e/100,o.s=clamp01(o.s),tinycolor(o)}function _saturate(t,e){e=0===e?0:e||10;var o=tinycolor(t).toHsl();return o.s+=e/100,o.s=clamp01(o.s),tinycolor(o)}function _greyscale(t){return tinycolor(t).desaturate(100)}function _lighten(t,e){e=0===e?0:e||10;var o=tinycolor(t).toHsl();return o.l+=e/100,o.l=clamp01(o.l),tinycolor(o)}function _brighten(t,e){e=0===e?0:e||10;var o=tinycolor(t).toRgb();return o.r=Math.max(0,Math.min(255,o.r-Math.round(-e/100*255))),o.g=Math.max(0,Math.min(255,o.g-Math.round(-e/100*255))),o.b=Math.max(0,Math.min(255,o.b-Math.round(-e/100*255))),tinycolor(o)}function _darken(t,e){e=0===e?0:e||10;var o=tinycolor(t).toHsl();return o.l-=e/100,o.l=clamp01(o.l),tinycolor(o)}function _spin(t,e){var o=tinycolor(t).toHsl(),r=(o.h+e)%360;return o.h=r<0?360+r:r,tinycolor(o)}function _complement(t){var e=tinycolor(t).toHsl();return e.h=(e.h+180)%360,tinycolor(e)}function polyad(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var o=tinycolor(t).toHsl(),r=[tinycolor(t)],n=360/e,i=1;i<e;i++)r.push(tinycolor({h:(o.h+i*n)%360,s:o.s,l:o.l}));return r}function _splitcomplement(t){var e=tinycolor(t).toHsl(),o=e.h;return[tinycolor(t),tinycolor({h:(o+72)%360,s:e.s,l:e.l}),tinycolor({h:(o+216)%360,s:e.s,l:e.l})]}function _analogous(t,e,o){e=e||6,o=o||30;var r=tinycolor(t).toHsl(),n=360/o,i=[tinycolor(t)];for(r.h=(r.h-(n*e>>1)+720)%360;--e;)r.h=(r.h+n)%360,i.push(tinycolor(r));return i}function _monochromatic(t,e){e=e||6;for(var o=tinycolor(t).toHsv(),r=o.h,n=o.s,i=o.v,a=[],s=1/e;e--;)a.push(tinycolor({h:r,s:n,v:i})),i=(i+s)%1;return a}tinycolor.prototype={isDark:function isDark(){return this.getBrightness()<128},isLight:function isLight(){return!this.isDark()},isValid:function isValid(){return this._ok},getOriginalInput:function getOriginalInput(){return this._originalInput},getFormat:function getFormat(){return this._format},getAlpha:function getAlpha(){return this._a},getBrightness:function getBrightness(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function getLuminance(){var t,e,o,r=this.toRgb();return t=r.r/255,e=r.g/255,o=r.b/255,.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))},setAlpha:function setAlpha(t){return this._a=boundAlpha(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function toHsv(){var t=rgbToHsv(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function toHsvString(){var t=rgbToHsv(this._r,this._g,this._b),e=Math.round(360*t.h),o=Math.round(100*t.s),r=Math.round(100*t.v);return 1==this._a?"hsv("+e+", "+o+"%, "+r+"%)":"hsva("+e+", "+o+"%, "+r+"%, "+this._roundA+")"},toHsl:function toHsl(){var t=rgbToHsl(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function toHslString(){var t=rgbToHsl(this._r,this._g,this._b),e=Math.round(360*t.h),o=Math.round(100*t.s),r=Math.round(100*t.l);return 1==this._a?"hsl("+e+", "+o+"%, "+r+"%)":"hsla("+e+", "+o+"%, "+r+"%, "+this._roundA+")"},toHex:function toHex(t){return rgbToHex(this._r,this._g,this._b,t)},toHexString:function toHexString(t){return"#"+this.toHex(t)},toHex8:function toHex8(t){return rgbaToHex(this._r,this._g,this._b,this._a,t)},toHex8String:function toHex8String(t){return"#"+this.toHex8(t)},toRgb:function toRgb(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function toRgbString(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function toPercentageRgb(){return{r:Math.round(100*bound01(this._r,255))+"%",g:Math.round(100*bound01(this._g,255))+"%",b:Math.round(100*bound01(this._b,255))+"%",a:this._a}},toPercentageRgbString:function toPercentageRgbString(){return 1==this._a?"rgb("+Math.round(100*bound01(this._r,255))+"%, "+Math.round(100*bound01(this._g,255))+"%, "+Math.round(100*bound01(this._b,255))+"%)":"rgba("+Math.round(100*bound01(this._r,255))+"%, "+Math.round(100*bound01(this._g,255))+"%, "+Math.round(100*bound01(this._b,255))+"%, "+this._roundA+")"},toName:function toName(){return 0===this._a?"transparent":!(this._a<1)&&(r[rgbToHex(this._r,this._g,this._b,!0)]||!1)},toFilter:function toFilter(t){var e="#"+rgbaToArgbHex(this._r,this._g,this._b,this._a),o=e,r=this._gradientType?"GradientType = 1, ":"";if(t){var n=tinycolor(t);o="#"+rgbaToArgbHex(n._r,n._g,n._b,n._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+e+",endColorstr="+o+")"},toString:function toString(t){var e=!!t;t=t||this._format;var o=!1,r=this._a<1&&this._a>=0;return e||!r||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(o=this.toRgbString()),"prgb"===t&&(o=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(o=this.toHexString()),"hex3"===t&&(o=this.toHexString(!0)),"hex4"===t&&(o=this.toHex8String(!0)),"hex8"===t&&(o=this.toHex8String()),"name"===t&&(o=this.toName()),"hsl"===t&&(o=this.toHslString()),"hsv"===t&&(o=this.toHsvString()),o||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function clone(){return tinycolor(this.toString())},_applyModification:function _applyModification(t,e){var o=t.apply(null,[this].concat([].slice.call(e)));return this._r=o._r,this._g=o._g,this._b=o._b,this.setAlpha(o._a),this},lighten:function lighten(){return this._applyModification(_lighten,arguments)},brighten:function brighten(){return this._applyModification(_brighten,arguments)},darken:function darken(){return this._applyModification(_darken,arguments)},desaturate:function desaturate(){return this._applyModification(_desaturate,arguments)},saturate:function saturate(){return this._applyModification(_saturate,arguments)},greyscale:function greyscale(){return this._applyModification(_greyscale,arguments)},spin:function spin(){return this._applyModification(_spin,arguments)},_applyCombination:function _applyCombination(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function analogous(){return this._applyCombination(_analogous,arguments)},complement:function complement(){return this._applyCombination(_complement,arguments)},monochromatic:function monochromatic(){return this._applyCombination(_monochromatic,arguments)},splitcomplement:function splitcomplement(){return this._applyCombination(_splitcomplement,arguments)},triad:function triad(){return this._applyCombination(polyad,[3])},tetrad:function tetrad(){return this._applyCombination(polyad,[4])}},tinycolor.fromRatio=function(t,e){if("object"==_typeof(t)){var o={};for(var r in t)t.hasOwnProperty(r)&&(o[r]="a"===r?t[r]:convertToPercentage(t[r]));t=o}return tinycolor(t,e)},tinycolor.equals=function(t,e){return!(!t||!e)&&tinycolor(t).toRgbString()==tinycolor(e).toRgbString()},tinycolor.random=function(){return tinycolor.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},tinycolor.mix=function(t,e,o){o=0===o?0:o||50;var r=tinycolor(t).toRgb(),n=tinycolor(e).toRgb(),i=o/100;return tinycolor({r:(n.r-r.r)*i+r.r,g:(n.g-r.g)*i+r.g,b:(n.b-r.b)*i+r.b,a:(n.a-r.a)*i+r.a})},tinycolor.readability=function(t,e){var o=tinycolor(t),r=tinycolor(e);return(Math.max(o.getLuminance(),r.getLuminance())+.05)/(Math.min(o.getLuminance(),r.getLuminance())+.05)},tinycolor.isReadable=function(t,e,o){var r,n,i=tinycolor.readability(t,e);switch(n=!1,(r=validateWCAG2Parms(o)).level+r.size){case"AAsmall":case"AAAlarge":n=i>=4.5;break;case"AAlarge":n=i>=3;break;case"AAAsmall":n=i>=7}return n},tinycolor.mostReadable=function(t,e,o){var r,n,i,a,s=null,l=0;n=(o=o||{}).includeFallbackColors,i=o.level,a=o.size;for(var c=0;c<e.length;c++)(r=tinycolor.readability(t,e[c]))>l&&(l=r,s=tinycolor(e[c]));return tinycolor.isReadable(t,s,{level:i,size:a})||!n?s:(o.includeFallbackColors=!1,tinycolor.mostReadable(t,["#fff","#000"],o))};var o=tinycolor.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},r=tinycolor.hexNames=flip(o);function flip(t){var e={};for(var o in t)t.hasOwnProperty(o)&&(e[t[o]]=o);return e}function boundAlpha(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function bound01(t,e){isOnePointZero(t)&&(t="100%");var o=isPercentage(t);return t=Math.min(e,Math.max(0,parseFloat(t))),o&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function clamp01(t){return Math.min(1,Math.max(0,t))}function parseIntFromHex(t){return parseInt(t,16)}function isOnePointZero(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)}function isPercentage(t){return"string"==typeof t&&-1!=t.indexOf("%")}function pad2(t){return 1==t.length?"0"+t:""+t}function convertToPercentage(t){return t<=1&&(t=100*t+"%"),t}function convertDecimalToHex(t){return Math.round(255*parseFloat(t)).toString(16)}function convertHexToDecimal(t){return parseIntFromHex(t)/255}var n,i,a,s=(i="[\\s|\\(]+("+(n="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",a="[\\s|\\(]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")[,|\\s]+("+n+")\\s*\\)?",{CSS_UNIT:new RegExp(n),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+a),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+a),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+a),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function isValidCSSUnit(t){return!!s.CSS_UNIT.exec(t)}function stringInputToObject(r){r=r.replace(t,"").replace(e,"").toLowerCase();var n,i=!1;if(o[r])r=o[r],i=!0;else if("transparent"==r)return{r:0,g:0,b:0,a:0,format:"name"};return(n=s.rgb.exec(r))?{r:n[1],g:n[2],b:n[3]}:(n=s.rgba.exec(r))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=s.hsl.exec(r))?{h:n[1],s:n[2],l:n[3]}:(n=s.hsla.exec(r))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=s.hsv.exec(r))?{h:n[1],s:n[2],v:n[3]}:(n=s.hsva.exec(r))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=s.hex8.exec(r))?{r:parseIntFromHex(n[1]),g:parseIntFromHex(n[2]),b:parseIntFromHex(n[3]),a:convertHexToDecimal(n[4]),format:i?"name":"hex8"}:(n=s.hex6.exec(r))?{r:parseIntFromHex(n[1]),g:parseIntFromHex(n[2]),b:parseIntFromHex(n[3]),format:i?"name":"hex"}:(n=s.hex4.exec(r))?{r:parseIntFromHex(n[1]+""+n[1]),g:parseIntFromHex(n[2]+""+n[2]),b:parseIntFromHex(n[3]+""+n[3]),a:convertHexToDecimal(n[4]+""+n[4]),format:i?"name":"hex8"}:!!(n=s.hex3.exec(r))&&{r:parseIntFromHex(n[1]+""+n[1]),g:parseIntFromHex(n[2]+""+n[2]),b:parseIntFromHex(n[3]+""+n[3]),format:i?"name":"hex"}}function validateWCAG2Parms(t){var e,o;return"AA"!==(e=((t=t||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==e&&(e="AA"),"small"!==(o=(t.size||"small").toLowerCase())&&"large"!==o&&(o="small"),{level:e,size:o}}return tinycolor}()}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=632,exports.ids=[632],exports.modules={11632:(e,r,t)=>{t.a(e,(async(e,c)=>{try{t.r(r),t.d(r,{McpView:()=>McpView});var l=t(14083),a=t(96540),o=t(66814),n=t(53165),s=t(82101),i=t(34209),u=t(53829),m=t(49034),d=e([l,s,u,m]);[l,s,u,m]=d.then?(await d)():d;const McpView=()=>a.createElement(MultipleServersConfirm,{servers:[{value:"echo-server4",label:"echo-server4",checked:!0},{value:"echo-server5",label:"echo-server5",checked:!1},{value:"Github-MCP-Server6",label:"Github-MCP-Server6",checked:!0}]}),MultipleServersConfirm=({servers:e})=>{const r=(0,o.i7)(u.aO,(e=>e.navigate)),[t,c]=(0,a.useState)(e),d=(0,a.useRef)(void 0),h=(0,a.useCallback)((e=>{d.current=e}),[]);(0,l.Ge)(((e,t)=>{if(m.Om.ESCAPE(t)&&r("/chat")," "===e&&d.current){const e=d.current;c((r=>r.map((r=>r.value===e.value?{...r,checked:!r.checked}:r))))}}));const v=t.length;return a.createElement(a.Fragment,null,a.createElement(l.az,{padding:1,gap:1,flexDirection:"column",borderColor:"yellowBright",borderStyle:"round"},a.createElement(l.EY,{color:"yellowBright"},v," new MCP servers found in ",n.DZ),a.createElement(l.EY,null,"Select any you wish to enable."),a.createElement(l.EY,null,"MCP servers may execute code or access system resources. All tool calls require approval. Learn more in the MCP documentation ( ",i.Je," )."),a.createElement(s.pp,{items:t,limit:5,itemComponent:ServerItemComponent,onHighlight:h})),a.createElement(l.az,{paddingX:2},a.createElement(l.EY,{color:"grey"},"Space to select · Enter to confirm · Esc to reject all")))},ServerItemComponent=({value:e,checked:r})=>a.createElement(l.EY,{color:r?"green":void 0},e," ",r?"✓":"");c()}catch(e){c(e)}}))}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=814,exports.ids=[814],exports.modules={47814:(r,s,e)=>{e.r(s),e.d(s,{DEFAULT_INHERITED_ENV_VARS:()=>a,StdioClientTransport:()=>StdioClientTransport,getDefaultEnvironment:()=>getDefaultEnvironment});var t=e(91092),i=e(1708),o=e(57075),n=e(76889);class ReadBuffer{append(r){this._buffer=this._buffer?Buffer.concat([this._buffer,r]):r}readMessage(){if(!this._buffer)return null;const r=this._buffer.indexOf("\n");if(-1===r)return null;const s=this._buffer.toString("utf8",0,r).replace(/\r$/,"");return this._buffer=this._buffer.subarray(r+1),function deserializeMessage(r){return n.JSONRPCMessageSchema.parse(JSON.parse(r))}(s)}clear(){this._buffer=void 0}}const a="win32"===i.platform?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];function getDefaultEnvironment(){const r={};for(const s of a){const e=i.env[s];void 0!==e&&(e.startsWith("()")||(r[s]=e))}return r}class StdioClientTransport{constructor(r){this._abortController=new AbortController,this._readBuffer=new ReadBuffer,this._stderrStream=null,this._serverParams=r,"pipe"!==r.stderr&&"overlapped"!==r.stderr||(this._stderrStream=new o.PassThrough)}async start(){if(this._process)throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise(((r,s)=>{var e,o,n,a,l;this._process=t(this._serverParams.command,null!==(e=this._serverParams.args)&&void 0!==e?e:[],{env:{...getDefaultEnvironment(),...this._serverParams.env},stdio:["pipe","pipe",null!==(o=this._serverParams.stderr)&&void 0!==o?o:"inherit"],shell:!1,signal:this._abortController.signal,windowsHide:"win32"===i.platform&&"type"in i,cwd:this._serverParams.cwd}),this._process.on("error",(r=>{var e,t;"AbortError"!==r.name?(s(r),null===(t=this.onerror)||void 0===t||t.call(this,r)):null===(e=this.onclose)||void 0===e||e.call(this)})),this._process.on("spawn",(()=>{r()})),this._process.on("close",(r=>{var s;this._process=void 0,null===(s=this.onclose)||void 0===s||s.call(this)})),null===(n=this._process.stdin)||void 0===n||n.on("error",(r=>{var s;null===(s=this.onerror)||void 0===s||s.call(this,r)})),null===(a=this._process.stdout)||void 0===a||a.on("data",(r=>{this._readBuffer.append(r),this.processReadBuffer()})),null===(l=this._process.stdout)||void 0===l||l.on("error",(r=>{var s;null===(s=this.onerror)||void 0===s||s.call(this,r)})),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)}))}get stderr(){var r,s;return this._stderrStream?this._stderrStream:null!==(s=null===(r=this._process)||void 0===r?void 0:r.stderr)&&void 0!==s?s:null}get pid(){var r,s;return null!==(s=null===(r=this._process)||void 0===r?void 0:r.pid)&&void 0!==s?s:null}processReadBuffer(){for(var r,s;;)try{const s=this._readBuffer.readMessage();if(null===s)break;null===(r=this.onmessage)||void 0===r||r.call(this,s)}catch(r){null===(s=this.onerror)||void 0===s||s.call(this,r)}}async close(){this._abortController.abort(),this._process=void 0,this._readBuffer.clear()}send(r){return new Promise((s=>{var e;if(!(null===(e=this._process)||void 0===e?void 0:e.stdin))throw new Error("Not connected");const t=function serializeMessage(r){return JSON.stringify(r)+"\n"}(r);this._process.stdin.write(t)?s():this._process.stdin.once("drain",s)}))}}}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=889,exports.ids=[889],exports.modules={76889:(e,t,o)=>{o.r(t),o.d(t,{AudioContentSchema:()=>se,BaseMetadataSchema:()=>y,BlobResourceContentsSchema:()=>A,BooleanSchemaSchema:()=>Ne,CallToolRequestSchema:()=>be,CallToolResultSchema:()=>de,CancelledNotificationSchema:()=>f,ClientCapabilitiesSchema:()=>q,ClientNotificationSchema:()=>Fe,ClientRequestSchema:()=>De,ClientResultSchema:()=>Ge,CompatibilityCallToolResultSchema:()=>Se,CompleteRequestSchema:()=>we,CompleteResultSchema:()=>Ae,ContentBlockSchema:()=>ze,CreateMessageRequestSchema:()=>Te,CreateMessageResultSchema:()=>qe,CursorSchema:()=>l,DEFAULT_NEGOTIATED_PROTOCOL_VERSION:()=>s,ElicitRequestSchema:()=>ve,ElicitResultSchema:()=>Ie,EmbeddedResourceSchema:()=>ie,EmptyResultSchema:()=>P,EnumSchemaSchema:()=>Oe,ErrorCode:()=>x,GetPromptRequestSchema:()=>oe,GetPromptResultSchema:()=>ce,ImageContentSchema:()=>ne,ImplementationSchema:()=>T,InitializeRequestSchema:()=>N,InitializeResultSchema:()=>L,InitializedNotificationSchema:()=>O,JSONRPCErrorSchema:()=>j,JSONRPCMessageSchema:()=>C,JSONRPCNotificationSchema:()=>b,JSONRPCRequestSchema:()=>S,JSONRPCResponseSchema:()=>R,JSONRPC_VERSION:()=>r,LATEST_PROTOCOL_VERSION:()=>n,ListPromptsRequestSchema:()=>ee,ListPromptsResultSchema:()=>te,ListResourceTemplatesRequestSchema:()=>D,ListResourceTemplatesResultSchema:()=>F,ListResourcesRequestSchema:()=>U,ListResourcesResultSchema:()=>B,ListRootsRequestSchema:()=>He,ListRootsResultSchema:()=>Ue,ListToolsRequestSchema:()=>ue,ListToolsResultSchema:()=>ge,LoggingLevelSchema:()=>xe,LoggingMessageNotificationSchema:()=>Ce,McpError:()=>McpError,ModelHintSchema:()=>Pe,ModelPreferencesSchema:()=>fe,NotificationSchema:()=>u,NumberSchemaSchema:()=>Le,PaginatedRequestSchema:()=>M,PaginatedResultSchema:()=>k,PingRequestSchema:()=>_,PrimitiveSchemaDefinitionSchema:()=>_e,ProgressNotificationSchema:()=>I,ProgressSchema:()=>v,ProgressTokenSchema:()=>z,PromptArgumentSchema:()=>Y,PromptListChangedNotificationSchema:()=>me,PromptMessageSchema:()=>le,PromptReferenceSchema:()=>Je,PromptSchema:()=>Z,ReadResourceRequestSchema:()=>G,ReadResourceResultSchema:()=>W,RequestIdSchema:()=>d,RequestSchema:()=>p,ResourceContentsSchema:()=>J,ResourceLinkSchema:()=>re,ResourceListChangedNotificationSchema:()=>$,ResourceReferenceSchema:()=>ke,ResourceSchema:()=>V,ResourceTemplateReferenceSchema:()=>Me,ResourceTemplateSchema:()=>H,ResourceUpdatedNotificationSchema:()=>X,ResultSchema:()=>g,RootSchema:()=>Ve,RootsListChangedNotificationSchema:()=>Be,SUPPORTED_PROTOCOL_VERSIONS:()=>i,SamplingMessageSchema:()=>ye,ServerCapabilitiesSchema:()=>E,ServerNotificationSchema:()=>$e,ServerRequestSchema:()=>We,ServerResultSchema:()=>Ke,SetLevelRequestSchema:()=>je,StringSchemaSchema:()=>Ee,SubscribeRequestSchema:()=>K,TextContentSchema:()=>ae,TextResourceContentsSchema:()=>w,ToolAnnotationsSchema:()=>pe,ToolListChangedNotificationSchema:()=>Re,ToolSchema:()=>he,UnsubscribeRequestSchema:()=>Q,isInitializeRequest:()=>isInitializeRequest,isInitializedNotification:()=>isInitializedNotification,isJSONRPCError:()=>isJSONRPCError,isJSONRPCNotification:()=>isJSONRPCNotification,isJSONRPCRequest:()=>isJSONRPCRequest,isJSONRPCResponse:()=>isJSONRPCResponse});var a=o(7578);const n="2025-06-18",s="2025-03-26",i=[n,"2025-03-26","2024-11-05","2024-10-07"],r="2.0",z=a.z.union([a.z.string(),a.z.number().int()]),l=a.z.string(),c=a.z.object({progressToken:a.z.optional(z)}).passthrough(),m=a.z.object({_meta:a.z.optional(c)}).passthrough(),p=a.z.object({method:a.z.string(),params:a.z.optional(m)}),h=a.z.object({_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough(),u=a.z.object({method:a.z.string(),params:a.z.optional(h)}),g=a.z.object({_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough(),d=a.z.union([a.z.string(),a.z.number().int()]),S=a.z.object({jsonrpc:a.z.literal(r),id:d}).merge(p).strict(),isJSONRPCRequest=e=>S.safeParse(e).success,b=a.z.object({jsonrpc:a.z.literal(r)}).merge(u).strict(),isJSONRPCNotification=e=>b.safeParse(e).success,R=a.z.object({jsonrpc:a.z.literal(r),id:d,result:g}).strict(),isJSONRPCResponse=e=>R.safeParse(e).success;var x;!function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError"}(x||(x={}));const j=a.z.object({jsonrpc:a.z.literal(r),id:d,error:a.z.object({code:a.z.number().int(),message:a.z.string(),data:a.z.optional(a.z.unknown())})}).strict(),isJSONRPCError=e=>j.safeParse(e).success,C=a.z.union([S,b,R,j]),P=g.strict(),f=u.extend({method:a.z.literal("notifications/cancelled"),params:h.extend({requestId:d,reason:a.z.string().optional()})}),y=a.z.object({name:a.z.string(),title:a.z.optional(a.z.string())}).passthrough(),T=y.extend({version:a.z.string()}),q=a.z.object({experimental:a.z.optional(a.z.object({}).passthrough()),sampling:a.z.optional(a.z.object({}).passthrough()),elicitation:a.z.optional(a.z.object({}).passthrough()),roots:a.z.optional(a.z.object({listChanged:a.z.optional(a.z.boolean())}).passthrough())}).passthrough(),N=p.extend({method:a.z.literal("initialize"),params:m.extend({protocolVersion:a.z.string(),capabilities:q,clientInfo:T})}),isInitializeRequest=e=>N.safeParse(e).success,E=a.z.object({experimental:a.z.optional(a.z.object({}).passthrough()),logging:a.z.optional(a.z.object({}).passthrough()),completions:a.z.optional(a.z.object({}).passthrough()),prompts:a.z.optional(a.z.object({listChanged:a.z.optional(a.z.boolean())}).passthrough()),resources:a.z.optional(a.z.object({subscribe:a.z.optional(a.z.boolean()),listChanged:a.z.optional(a.z.boolean())}).passthrough()),tools:a.z.optional(a.z.object({listChanged:a.z.optional(a.z.boolean())}).passthrough())}).passthrough(),L=g.extend({protocolVersion:a.z.string(),capabilities:E,serverInfo:T,instructions:a.z.optional(a.z.string())}),O=u.extend({method:a.z.literal("notifications/initialized")}),isInitializedNotification=e=>O.safeParse(e).success,_=p.extend({method:a.z.literal("ping")}),v=a.z.object({progress:a.z.number(),total:a.z.optional(a.z.number()),message:a.z.optional(a.z.string())}).passthrough(),I=u.extend({method:a.z.literal("notifications/progress"),params:h.merge(v).extend({progressToken:z})}),M=p.extend({params:m.extend({cursor:a.z.optional(l)}).optional()}),k=g.extend({nextCursor:a.z.optional(l)}),J=a.z.object({uri:a.z.string(),mimeType:a.z.optional(a.z.string()),_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough(),w=J.extend({text:a.z.string()}),A=J.extend({blob:a.z.string().base64()}),V=y.extend({uri:a.z.string(),description:a.z.optional(a.z.string()),mimeType:a.z.optional(a.z.string()),_meta:a.z.optional(a.z.object({}).passthrough())}),H=y.extend({uriTemplate:a.z.string(),description:a.z.optional(a.z.string()),mimeType:a.z.optional(a.z.string()),_meta:a.z.optional(a.z.object({}).passthrough())}),U=M.extend({method:a.z.literal("resources/list")}),B=k.extend({resources:a.z.array(V)}),D=M.extend({method:a.z.literal("resources/templates/list")}),F=k.extend({resourceTemplates:a.z.array(H)}),G=p.extend({method:a.z.literal("resources/read"),params:m.extend({uri:a.z.string()})}),W=g.extend({contents:a.z.array(a.z.union([w,A]))}),$=u.extend({method:a.z.literal("notifications/resources/list_changed")}),K=p.extend({method:a.z.literal("resources/subscribe"),params:m.extend({uri:a.z.string()})}),Q=p.extend({method:a.z.literal("resources/unsubscribe"),params:m.extend({uri:a.z.string()})}),X=u.extend({method:a.z.literal("notifications/resources/updated"),params:h.extend({uri:a.z.string()})}),Y=a.z.object({name:a.z.string(),description:a.z.optional(a.z.string()),required:a.z.optional(a.z.boolean())}).passthrough(),Z=y.extend({description:a.z.optional(a.z.string()),arguments:a.z.optional(a.z.array(Y)),_meta:a.z.optional(a.z.object({}).passthrough())}),ee=M.extend({method:a.z.literal("prompts/list")}),te=k.extend({prompts:a.z.array(Z)}),oe=p.extend({method:a.z.literal("prompts/get"),params:m.extend({name:a.z.string(),arguments:a.z.optional(a.z.record(a.z.string()))})}),ae=a.z.object({type:a.z.literal("text"),text:a.z.string(),_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough(),ne=a.z.object({type:a.z.literal("image"),data:a.z.string().base64(),mimeType:a.z.string(),_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough(),se=a.z.object({type:a.z.literal("audio"),data:a.z.string().base64(),mimeType:a.z.string(),_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough(),ie=a.z.object({type:a.z.literal("resource"),resource:a.z.union([w,A]),_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough(),re=V.extend({type:a.z.literal("resource_link")}),ze=a.z.union([ae,ne,se,re,ie]),le=a.z.object({role:a.z.enum(["user","assistant"]),content:ze}).passthrough(),ce=g.extend({description:a.z.optional(a.z.string()),messages:a.z.array(le)}),me=u.extend({method:a.z.literal("notifications/prompts/list_changed")}),pe=a.z.object({title:a.z.optional(a.z.string()),readOnlyHint:a.z.optional(a.z.boolean()),destructiveHint:a.z.optional(a.z.boolean()),idempotentHint:a.z.optional(a.z.boolean()),openWorldHint:a.z.optional(a.z.boolean())}).passthrough(),he=y.extend({description:a.z.optional(a.z.string()),inputSchema:a.z.object({type:a.z.literal("object"),properties:a.z.optional(a.z.object({}).passthrough()),required:a.z.optional(a.z.array(a.z.string()))}).passthrough(),outputSchema:a.z.optional(a.z.object({type:a.z.literal("object"),properties:a.z.optional(a.z.object({}).passthrough()),required:a.z.optional(a.z.array(a.z.string()))}).passthrough()),annotations:a.z.optional(pe),_meta:a.z.optional(a.z.object({}).passthrough())}),ue=M.extend({method:a.z.literal("tools/list")}),ge=k.extend({tools:a.z.array(he)}),de=g.extend({content:a.z.array(ze).default([]),structuredContent:a.z.object({}).passthrough().optional(),isError:a.z.optional(a.z.boolean())}),Se=de.or(g.extend({toolResult:a.z.unknown()})),be=p.extend({method:a.z.literal("tools/call"),params:m.extend({name:a.z.string(),arguments:a.z.optional(a.z.record(a.z.unknown()))})}),Re=u.extend({method:a.z.literal("notifications/tools/list_changed")}),xe=a.z.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),je=p.extend({method:a.z.literal("logging/setLevel"),params:m.extend({level:xe})}),Ce=u.extend({method:a.z.literal("notifications/message"),params:h.extend({level:xe,logger:a.z.optional(a.z.string()),data:a.z.unknown()})}),Pe=a.z.object({name:a.z.string().optional()}).passthrough(),fe=a.z.object({hints:a.z.optional(a.z.array(Pe)),costPriority:a.z.optional(a.z.number().min(0).max(1)),speedPriority:a.z.optional(a.z.number().min(0).max(1)),intelligencePriority:a.z.optional(a.z.number().min(0).max(1))}).passthrough(),ye=a.z.object({role:a.z.enum(["user","assistant"]),content:a.z.union([ae,ne,se])}).passthrough(),Te=p.extend({method:a.z.literal("sampling/createMessage"),params:m.extend({messages:a.z.array(ye),systemPrompt:a.z.optional(a.z.string()),includeContext:a.z.optional(a.z.enum(["none","thisServer","allServers"])),temperature:a.z.optional(a.z.number()),maxTokens:a.z.number().int(),stopSequences:a.z.optional(a.z.array(a.z.string())),metadata:a.z.optional(a.z.object({}).passthrough()),modelPreferences:a.z.optional(fe)})}),qe=g.extend({model:a.z.string(),stopReason:a.z.optional(a.z.enum(["endTurn","stopSequence","maxTokens"]).or(a.z.string())),role:a.z.enum(["user","assistant"]),content:a.z.discriminatedUnion("type",[ae,ne,se])}),Ne=a.z.object({type:a.z.literal("boolean"),title:a.z.optional(a.z.string()),description:a.z.optional(a.z.string()),default:a.z.optional(a.z.boolean())}).passthrough(),Ee=a.z.object({type:a.z.literal("string"),title:a.z.optional(a.z.string()),description:a.z.optional(a.z.string()),minLength:a.z.optional(a.z.number()),maxLength:a.z.optional(a.z.number()),format:a.z.optional(a.z.enum(["email","uri","date","date-time"]))}).passthrough(),Le=a.z.object({type:a.z.enum(["number","integer"]),title:a.z.optional(a.z.string()),description:a.z.optional(a.z.string()),minimum:a.z.optional(a.z.number()),maximum:a.z.optional(a.z.number())}).passthrough(),Oe=a.z.object({type:a.z.literal("string"),title:a.z.optional(a.z.string()),description:a.z.optional(a.z.string()),enum:a.z.array(a.z.string()),enumNames:a.z.optional(a.z.array(a.z.string()))}).passthrough(),_e=a.z.union([Ne,Ee,Le,Oe]),ve=p.extend({method:a.z.literal("elicitation/create"),params:m.extend({message:a.z.string(),requestedSchema:a.z.object({type:a.z.literal("object"),properties:a.z.record(a.z.string(),_e),required:a.z.optional(a.z.array(a.z.string()))}).passthrough()})}),Ie=g.extend({action:a.z.enum(["accept","decline","cancel"]),content:a.z.optional(a.z.record(a.z.string(),a.z.unknown()))}),Me=a.z.object({type:a.z.literal("ref/resource"),uri:a.z.string()}).passthrough(),ke=Me,Je=a.z.object({type:a.z.literal("ref/prompt"),name:a.z.string()}).passthrough(),we=p.extend({method:a.z.literal("completion/complete"),params:m.extend({ref:a.z.union([Je,Me]),argument:a.z.object({name:a.z.string(),value:a.z.string()}).passthrough(),context:a.z.optional(a.z.object({arguments:a.z.optional(a.z.record(a.z.string(),a.z.string()))}))})}),Ae=g.extend({completion:a.z.object({values:a.z.array(a.z.string()).max(100),total:a.z.optional(a.z.number().int()),hasMore:a.z.optional(a.z.boolean())}).passthrough()}),Ve=a.z.object({uri:a.z.string().startsWith("file://"),name:a.z.optional(a.z.string()),_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough(),He=p.extend({method:a.z.literal("roots/list")}),Ue=g.extend({roots:a.z.array(Ve)}),Be=u.extend({method:a.z.literal("notifications/roots/list_changed")}),De=a.z.union([_,N,we,je,oe,ee,U,D,G,K,Q,be,ue]),Fe=a.z.union([f,I,O,Be]),Ge=a.z.union([P,qe,Ie,Ue]),We=a.z.union([_,Te,ve,He]),$e=a.z.union([f,I,Ce,X,$,Re,me]),Ke=a.z.union([P,L,Ae,ce,te,B,F,W,de,ge]);class McpError extends Error{constructor(e,t,o){super(`MCP error ${e}: ${t}`),this.code=e,this.data=o,this.name="McpError"}}}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.id=952,exports.ids=[952],exports.modules={26952:(e,t,n)=>{n.d(t,{toFormData:()=>toFormData});var a=n(48695),r=n(79814);let i=0;const o={START_BOUNDARY:i++,HEADER_FIELD_START:i++,HEADER_FIELD:i++,HEADER_VALUE_START:i++,HEADER_VALUE:i++,HEADER_VALUE_ALMOST_DONE:i++,HEADERS_ALMOST_DONE:i++,PART_DATA_START:i++,PART_DATA:i++,END:i++};let s=1;const d=s,E=s*=2,lower=e=>32|e,noop=()=>{};class MultipartParser{constructor(e){this.index=0,this.flags=0,this.onHeaderEnd=noop,this.onHeaderField=noop,this.onHeadersEnd=noop,this.onHeaderValue=noop,this.onPartBegin=noop,this.onPartData=noop,this.onPartEnd=noop,this.boundaryChars={},e="\r\n--"+e;const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n),this.boundaryChars[t[n]]=!0;this.boundary=t,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=o.START_BOUNDARY}write(e){let t=0;const n=e.length;let a=this.index,{lookbehind:r,boundary:i,boundaryChars:s,index:A,state:h,flags:l}=this;const D=this.boundary.length,c=D-1,f=e.length;let T,_;const mark=e=>{this[e+"Mark"]=t},clear=e=>{delete this[e+"Mark"]},callback=(e,t,n,a)=>{void 0!==t&&t===n||this[e](a&&a.subarray(t,n))},dataCallback=(n,a)=>{const r=n+"Mark";r in this&&(a?(callback(n,this[r],t,e),delete this[r]):(callback(n,this[r],e.length,e),this[r]=0))};for(t=0;t<n;t++)switch(T=e[t],h){case o.START_BOUNDARY:if(A===i.length-2){if(45===T)l|=E;else if(13!==T)return;A++;break}if(A-1==i.length-2){if(l&E&&45===T)h=o.END,l=0;else{if(l&E||10!==T)return;A=0,callback("onPartBegin"),h=o.HEADER_FIELD_START}break}T!==i[A+2]&&(A=-2),T===i[A+2]&&A++;break;case o.HEADER_FIELD_START:h=o.HEADER_FIELD,mark("onHeaderField"),A=0;case o.HEADER_FIELD:if(13===T){clear("onHeaderField"),h=o.HEADERS_ALMOST_DONE;break}if(A++,45===T)break;if(58===T){if(1===A)return;dataCallback("onHeaderField",!0),h=o.HEADER_VALUE_START;break}if(_=lower(T),_<97||_>122)return;break;case o.HEADER_VALUE_START:if(32===T)break;mark("onHeaderValue"),h=o.HEADER_VALUE;case o.HEADER_VALUE:13===T&&(dataCallback("onHeaderValue",!0),callback("onHeaderEnd"),h=o.HEADER_VALUE_ALMOST_DONE);break;case o.HEADER_VALUE_ALMOST_DONE:if(10!==T)return;h=o.HEADER_FIELD_START;break;case o.HEADERS_ALMOST_DONE:if(10!==T)return;callback("onHeadersEnd"),h=o.PART_DATA_START;break;case o.PART_DATA_START:h=o.PART_DATA,mark("onPartData");case o.PART_DATA:if(a=A,0===A){for(t+=c;t<f&&!(e[t]in s);)t+=D;t-=c,T=e[t]}if(A<i.length)i[A]===T?(0===A&&dataCallback("onPartData",!0),A++):A=0;else if(A===i.length)A++,13===T?l|=d:45===T?l|=E:A=0;else if(A-1===i.length)if(l&d){if(A=0,10===T){l&=~d,callback("onPartEnd"),callback("onPartBegin"),h=o.HEADER_FIELD_START;break}}else l&E&&45===T?(callback("onPartEnd"),h=o.END,l=0):A=0;if(A>0)r[A-1]=T;else if(a>0){const e=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);callback("onPartData",0,a,e),a=0,mark("onPartData"),t--}break;case o.END:break;default:throw new Error(`Unexpected state entered: ${h}`)}dataCallback("onHeaderField"),dataCallback("onHeaderValue"),dataCallback("onPartData"),this.index=A,this.state=h,this.flags=l}end(){if(this.state===o.HEADER_FIELD_START&&0===this.index||this.state===o.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==o.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}}async function toFormData(e,t){if(!/multipart/i.test(t))throw new TypeError("Failed to fetch");const n=t.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!n)throw new TypeError("no or bad content-type header, no multipart boundary");const i=new MultipartParser(n[1]||n[2]);let o,s,d,E,A,h;const l=[],D=new r.fS,onPartData=e=>{d+=c.decode(e,{stream:!0})},appendToFile=e=>{l.push(e)},appendFileToFormData=()=>{const e=new a.ZH(l,h,{type:A});D.append(E,e)},appendEntryToFormData=()=>{D.append(E,d)},c=new TextDecoder("utf-8");c.decode(),i.onPartBegin=function(){i.onPartData=onPartData,i.onPartEnd=appendEntryToFormData,o="",s="",d="",E="",A="",h=null,l.length=0},i.onHeaderField=function(e){o+=c.decode(e,{stream:!0})},i.onHeaderValue=function(e){s+=c.decode(e,{stream:!0})},i.onHeaderEnd=function(){if(s+=c.decode(),o=o.toLowerCase(),"content-disposition"===o){const e=s.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);e&&(E=e[2]||e[3]||""),h=function _fileName(e){const t=e.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!t)return;const n=t[2]||t[3]||"";let a=n.slice(n.lastIndexOf("\\")+1);return a=a.replace(/%22/g,'"'),a=a.replace(/&#(\d{4});/g,((e,t)=>String.fromCharCode(t))),a}(s),h&&(i.onPartData=appendToFile,i.onPartEnd=appendFileToFormData)}else"content-type"===o&&(A=s);s="",o=""};for await(const t of e)i.write(t);return i.end(),D}}};
|