koishi-plugin-chatluna-studio 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/LICENSE +21 -0
- package/README.md +38 -0
- package/dist/index.js +45313 -0
- package/dist/style.css +1 -0
- package/lib/chatluna/error.d.ts +15 -0
- package/lib/chatluna/runtime.d.ts +25 -0
- package/lib/chatluna/session-tracker.d.ts +98 -0
- package/lib/chatluna/usage.d.ts +46 -0
- package/lib/console-contract.d.ts +61 -0
- package/lib/console.d.ts +39 -0
- package/lib/evidence-kind.d.ts +61 -0
- package/lib/evidence-preview-text.d.ts +13 -0
- package/lib/index.d.ts +42 -0
- package/lib/index.js +4579 -0
- package/lib/model-evidence/index.d.ts +15 -0
- package/lib/model-evidence/metrics.d.ts +11 -0
- package/lib/model-evidence/request.d.ts +7 -0
- package/lib/model-evidence/response.d.ts +7 -0
- package/lib/model-evidence/shared.d.ts +37 -0
- package/lib/model-evidence/transport.d.ts +13 -0
- package/lib/model-evidence/types.d.ts +104 -0
- package/lib/model-evidence/usage.d.ts +10 -0
- package/lib/model-request-collector.d.ts +32 -0
- package/lib/model-request-trajectory.d.ts +21 -0
- package/lib/model-request-variables.d.ts +16 -0
- package/lib/model-request.d.ts +158 -0
- package/lib/persistence.d.ts +85 -0
- package/lib/presets/evidence-match.d.ts +9 -0
- package/lib/presets/index.d.ts +6 -0
- package/lib/presets/repository.d.ts +86 -0
- package/lib/presets/runtime-correlation.d.ts +16 -0
- package/lib/presets/service.d.ts +69 -0
- package/lib/presets/source-document.d.ts +2 -0
- package/lib/presets/types.d.ts +63 -0
- package/lib/record-store.d.ts +85 -0
- package/lib/types.d.ts +270 -0
- package/package.json +110 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# koishi-plugin-chatluna-studio
|
|
2
|
+
|
|
3
|
+
在 Koishi 控制台里查看 ChatLuna 的真实模型请求,并直接编辑 ChatLuna 与 chatluna-character 的预设文件。
|
|
4
|
+
|
|
5
|
+
## 模型请求
|
|
6
|
+
|
|
7
|
+
每次真实对话触发的模型调用都会留下一条记录:请求地址与请求头、完整请求体、原样保存的响应原文(JSON / 文本 / SSE 都保留)、HTTP 状态、耗时、Token 用量与错误。
|
|
8
|
+
|
|
9
|
+
- **归属**:记录会关联到触发它的真实 OneBot 会话——机器人、群或好友、发言者,名称随请求一起快照。多轮对话同时在跑时无法判定归属,这些记录进「未归属」。
|
|
10
|
+
- **筛选**:按范围(全部 / 已归属 / 未归属)、机器人、会话、模型名与「仅错误」筛选;可选值来自记录库自身的聚合。
|
|
11
|
+
- **分析与轨迹**:请求体按共享的模型证据投影拆成请求消息、工具定义、工具调用与响应,可按单次请求或同一会话的多次请求查看轨迹账本与请求组成。
|
|
12
|
+
- **错误**:ChatLuna 的规范错误码会回填到本轮最近一条失败记录上,详情页给出错误码与可能原因。
|
|
13
|
+
- **用量**:装了 chatluna-usage 时优先读它的标准化用量,否则从响应体里取。
|
|
14
|
+
|
|
15
|
+
记录默认走 Koishi Database 持久化,重启不丢;插件配置可改为服务端内存,那种模式下重启清空。条数上限默认 500,超出后从最旧记录开始丢弃。
|
|
16
|
+
|
|
17
|
+
## 预设
|
|
18
|
+
|
|
19
|
+
直接读写 `data/chathub/presets` 与 `data/chathub/character/presets` 下的 YAML 文件,保存后由 ChatLuna 自己热重载。
|
|
20
|
+
|
|
21
|
+
- 编辑器基于 CodeMirror,模板里的表达式(`{name}`)带装饰,可以点开看它在真实请求里展开成了什么。
|
|
22
|
+
- 新建、重命名与删除都要显式确认;保存使用修订号做乐观并发,文件在别处被改动时不会被覆盖。
|
|
23
|
+
- 有未保存修改时切换页面会先问一句。
|
|
24
|
+
|
|
25
|
+
## 灵感来源
|
|
26
|
+
|
|
27
|
+
- 轨迹功能的设计灵感来源于 [DeepSeek Harness(dsh)](https://github.com/deepseek-ai/deepseek-harness)。
|
|
28
|
+
- 请求体与响应体的样式来源于 [Axonhub](https://github.com/looplj/axonhub)。
|
|
29
|
+
- 界面与领域实现从 [koishi-plugin-chatluna-sandbox](https://github.com/Sor85/koishi-plugin-chatluna-sandbox) 抽离而来;那个插件在模拟 QQ 环境里做同一件事,本插件面向真实 OneBot。
|
|
30
|
+
|
|
31
|
+
## 开发
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
yarn install
|
|
35
|
+
yarn test
|
|
36
|
+
yarn typecheck
|
|
37
|
+
yarn build
|
|
38
|
+
```
|