dsh-coze-home 0.1.0 → 0.2.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/README.md +47 -15
- package/lib/index.js +1 -1
- package/lib/{plugin-4CVH_b__.js → plugin-AZWfhr06.js} +1068 -86
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -6,27 +6,62 @@
|
|
|
6
6
|
|
|
7
7
|
## 安装
|
|
8
8
|
|
|
9
|
+
需要 Node.js 22.15 或更新版本。仓库已经包含构建产物 `lib/`,从 GitHub 安装不会执行任何安装脚本。
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
dsh plugin --profile web add github:jinghong993/dsh-coze-home
|
|
13
|
+
```
|
|
14
|
+
|
|
9
15
|
本地安装
|
|
10
16
|
|
|
11
17
|
```sh
|
|
12
18
|
dsh plugin --profile web add <本地仓库路径>
|
|
13
19
|
```
|
|
14
20
|
|
|
15
|
-
|
|
21
|
+
不要直接下载 GitHub 的 ZIP 压缩包:那样得不到 `node_modules`,插件无法启动官方 CLI,也就无法登录和刷新模型。
|
|
16
22
|
|
|
17
|
-
|
|
18
|
-
|
|
23
|
+
## 登录
|
|
24
|
+
|
|
25
|
+
有两种方式,任选其一。
|
|
26
|
+
|
|
27
|
+
**插件页连接按钮。** 宿主提供账号连接界面时,插件页会出现扣子账号的登录与退出按钮。
|
|
28
|
+
|
|
29
|
+
**斜杠命令。** 在没有账号界面的宿主里使用:
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
/coze login
|
|
19
33
|
```
|
|
20
34
|
|
|
21
|
-
|
|
35
|
+
命令会给出扣子官方授权网址,在浏览器确认后凭据自动落盘,模型目录随即刷新。
|
|
22
36
|
|
|
23
|
-
|
|
37
|
+
```text
|
|
38
|
+
/coze status
|
|
39
|
+
```
|
|
24
40
|
|
|
25
|
-
|
|
26
|
-
2. 选择 **扣子账号(浏览器登录)**,在扣子官方页面确认授权。
|
|
27
|
-
3. 授权完成后模型目录自动刷新。也可以在对话中执行 `/coze refresh`。
|
|
41
|
+
显示当前是否已登录、授权是否仍在等待。
|
|
28
42
|
|
|
29
|
-
|
|
43
|
+
```text
|
|
44
|
+
/coze logout
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
删除本机保存的登录凭据。
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
/coze refresh
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
重新读取账号当前可用的模型。
|
|
54
|
+
|
|
55
|
+
凭据优先保存在 DSH 的凭据服务中;宿主没有提供凭据服务时,自动回退到 `$DSH_HOME/plugins/coze-home/auth.json`,权限为仅当前用户。
|
|
56
|
+
|
|
57
|
+
## 客户端函数调用
|
|
58
|
+
|
|
59
|
+
插件支持 DSH 的工具调用:模型请求某个工具时,插件把它转成 DSH 的 `tool-call` 块,由宿主执行工具后再把结果接回对话继续推理。
|
|
60
|
+
|
|
61
|
+
- 上游返回的 `tool_calls` 按下标合并,工具参数分片到达时也能拼回完整 JSON。
|
|
62
|
+
- 模型的思考内容、回复正文和工具调用分别作为独立块发出,不会互相污染。
|
|
63
|
+
- 一轮里只要出现了工具调用,终结原因就是 `tool-calls`,不会因为没有正文而报空回复。
|
|
64
|
+
- 工具调用的用量统计会随终结块之前发出。
|
|
30
65
|
|
|
31
66
|
## 模型与限制
|
|
32
67
|
|
|
@@ -34,13 +69,11 @@ dsh plugin --profile web add github:jinghong993/dsh-coze-home
|
|
|
34
69
|
- 默认使用账号最近更新的扣子编程项目作为授权范围。
|
|
35
70
|
- 使用 `COZE_PROJECT_ID` 指定已有项目;没有项目时插件会提示创建方式,不擅自创建。
|
|
36
71
|
- 设置 `COZE_AUTO_CREATE_PROJECT=1` 可允许插件代建 `general` 类型项目。
|
|
37
|
-
- 扩展模型通过临时 Ask
|
|
72
|
+
- 扩展模型通过临时 Ask 会话提供文本对话;函数调用由插件的协议桥接补齐。
|
|
38
73
|
- 账号额度耗尽时显示明确的额度错误,不伪装成成功的空回复。
|
|
39
74
|
|
|
40
75
|
## 开发
|
|
41
76
|
|
|
42
|
-
需要 Node.js 22.15 或更新版本。
|
|
43
|
-
|
|
44
77
|
```sh
|
|
45
78
|
npm install
|
|
46
79
|
npm run build
|
|
@@ -48,7 +81,6 @@ npm run typecheck
|
|
|
48
81
|
npm test
|
|
49
82
|
```
|
|
50
83
|
|
|
51
|
-
Magpie 版本独立维护在 https://github.com/jinghong993/magpie-coze-home。
|
|
52
|
-
|
|
53
|
-
MIT License
|
|
84
|
+
原 Magpie 版本独立维护在 https://github.com/jinghong993/magpie-coze-home。
|
|
54
85
|
|
|
86
|
+
MIT License
|
package/lib/index.js
CHANGED
|
@@ -59,7 +59,7 @@ function initPeerResolution() {
|
|
|
59
59
|
}
|
|
60
60
|
// src/index.ts
|
|
61
61
|
initPeerResolution();
|
|
62
|
-
const plugin = await import("./plugin-
|
|
62
|
+
const plugin = await import("./plugin-AZWfhr06.js");
|
|
63
63
|
const name = "coze-home";
|
|
64
64
|
const inject = ["llm"];
|
|
65
65
|
const Config = plugin.Config;
|