@houser/edus-plugin 1.0.8 → 1.0.9

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 CHANGED
@@ -58,6 +58,16 @@ Harness 插件分为两个运行面:
58
58
 
59
59
  替换 `src/client/logo.png` 后执行 `npm run build`。构建过程会生成浏览器 bundle 使用的 data URL,无需手动编辑生成文件。
60
60
 
61
+ ## 对话模型
62
+
63
+ 对话模型强制走课成模型网关(ai-course 的 `/api/llm/v1`,OpenAI 兼容协议),由网关鉴权、路由到上游厂商并按用户计费。全部接入都在 `cordis.yml` 与登录态同步里,不改 Harness:
64
+
65
+ - 禁用 base bundle 的 `llm-deepseek` 与 `llm-deepseek-account`,不再直连 DeepSeek。
66
+ - 由 `llm-pi-ai` 声明同名路由 `deepseek-official` 指向网关。老会话和默认模型(`deepseek-official` / `deepseek-flash`)沿用这个路由名,升级后无需迁移。
67
+ - 网关以登录 token 作 Bearer 密钥。路由的 `apiKeyEnv: EDUS_LLM_TOKEN` 指向凭据存储;客户端在启动、登录、退出时调用 `setLlmToken`,Host 写入或删除该凭据,下一次模型请求即生效。未登录时请求以 `MISSING_CREDENTIAL` 失败。
68
+
69
+ 网关在 `llm_pricing` 目录里增删模型时,要同步修改 `cordis.yml` 的 `models` 列表:目录之外的模型网关会拒绝。路由是手工声明的,不会自动套用 pi-ai 内置的 DeepSeek 兼容开关,所以 `compat` 和 `reasoningEfforts` 必须写全。网关地址与 `aiEduBaseUrl` 同源,换环境时两处一起改。
70
+
61
71
  ## 构建脚本
62
72
 
63
73
  ```bash
@@ -91,7 +101,7 @@ npm run pack:dry
91
101
  npm version patch
92
102
 
93
103
  # 5. 发布,必须带 --tag
94
- npm publish --registry=https://registry.npmjs.org --tag dsh-v0.1.6-alpha.2
104
+ npm publish --registry=https://registry.npmjs.org --tag dsh-v0.2.1-rc.2
95
105
 
96
106
  # 6. 推送版本提交
97
107
  git push && git push --tags
@@ -104,12 +114,12 @@ npm login --registry=https://registry.npmjs.org/
104
114
 
105
115
  发布必须指定 npm dist-tag,用于关联对应的 DeepSeek Harness 版本(一般就是当前分支名称)。**不要**使用默认的 `latest`:不同 Harness 版本的 peerDependencies 不兼容,混用 `latest` 会让安装方拿到与自己 Harness 版本不匹配的插件。
106
116
 
107
- dist-tag 取值与 `peerDependencies` 中 `@deepseek-ai/dsh-*` 的版本保持一致,例如当前 peer 版本为 `0.1.6-alpha.2`,则 tag 为 `dsh-v0.1.6-alpha.2`。
117
+ dist-tag 取值与 `peerDependencies` 中 `@deepseek-ai/dsh-*` 的版本保持一致,例如当前 peer 版本为 `0.2.1-rc.2`,则 tag 为 `dsh-v0.2.1-rc.2`。
108
118
 
109
119
  安装方按 tag 取包:
110
120
 
111
121
  ```bash
112
- npm install @houser/edus-plugin@dsh-v0.1.6-alpha.2
122
+ npm install @houser/edus-plugin@dsh-v0.2.1-rc.2
113
123
  ```
114
124
 
115
125
  ### 发布前检查清单
package/cordis.yml CHANGED
@@ -3,3 +3,76 @@
3
3
  name: '@houser/edus-plugin'
4
4
  config:
5
5
  aiEduBaseUrl: 'https://edus.juzhenai.cn/'
6
+
7
+ # 对话模型强制走课成模型网关(ai-course 的 /api/llm/v1),由网关鉴权、路由与计费。
8
+ #
9
+ # 关掉 base bundle 自带的两条 DeepSeek 直连路由,再由 pi-ai 以同名路由
10
+ # `deepseek-official` 接管:老会话与 agent-default-model 的默认值
11
+ # (deepseek-official / deepseek-flash)都指向这个路由名,无需迁移即可继续使用。
12
+ # 这两个插件不对外提供服务,禁用不会连带其他插件。
13
+ - id: llm-deepseek
14
+ disabled: true
15
+ - id: llm-deepseek-account
16
+ disabled: true
17
+
18
+ # 隐藏左侧栏的「插件」与「自动化任务」入口。两个入口分别由 ui-plugin-manager、
19
+ # ui-schedule 注册进 sidebar.panellist,slots 无法移除他人的条目,只能整行禁用。
20
+ # 代价:插件管理页及挂在其下的 shell / agent loop / 子智能体 / 搜索配置页一并消失
21
+ # (设置里仍保留只读插件列表);会话页头的提醒时钟、schedule_create 卡片、
22
+ # 会话行的定时任务标记也随 ui-schedule 消失。Host 侧的 Schedule 服务与提醒工具不受影响。
23
+ - id: ui-plugin-manager
24
+ disabled: true
25
+ - id: ui-schedule
26
+ disabled: true
27
+
28
+ # 网关以登录 token 作 Bearer 密钥。apiKeyEnv 指向的凭据由插件在客户端登录态
29
+ # 变化时写入 / 删除(见 src/auth.ts 的 setLlmToken),未登录时请求以
30
+ # MISSING_CREDENTIAL 失败,模型选择器也不列出该路由。
31
+ #
32
+ # 路由键不是 pi-ai 内置目录里的 provider,属于手工声明路由:协议、端点、模型
33
+ # 及兼容开关都要写全。模型 id 必须与网关 llm_pricing 目录一致,目录之外的模型
34
+ # 网关会直接拒绝;能力与兼容开关照抄 pi-ai 内置 deepseek 目录(内置目录只在
35
+ # baseURL 含 deepseek.com 时自动套用这些开关)。
36
+ - id: llm-pi-ai
37
+ config:
38
+ providers:
39
+ deepseek-official:
40
+ displayName: 课成
41
+ apiKeyEnv: EDUS_LLM_TOKEN
42
+ api: openai-completions
43
+ # 与上面的 aiEduBaseUrl 同源,换环境时两处一起改。
44
+ baseURL: 'https://edus.juzhenai.cn/api/llm/v1'
45
+ # 与原生 DeepSeek 适配器的默认强度一致;不设则未选强度时关闭思考。
46
+ reasoning: high
47
+ # 模型输出能力上限。写在模型条目的 maxTokens 会变成每次请求的默认输出
48
+ # 上限,内置目录不这样做,所以放在路由级回退值里。
49
+ defaultMaxTokens: 384000
50
+ compat:
51
+ supportsStore: false
52
+ supportsDeveloperRole: false
53
+ maxTokensField: max_tokens
54
+ # 思考模式下带工具调用的多轮对话必须回传 reasoning_content。
55
+ requiresReasoningContentOnAssistantMessages: true
56
+ thinkingFormat: deepseek
57
+ supportsStrictMode: true
58
+ # 网关从流式 usage 计费,pi-ai 默认就会请求 include_usage,这里显式锁定。
59
+ supportsUsageInStreaming: true
60
+ models:
61
+ - id: deepseek-flash
62
+ name: DeepSeek V4.1 Flash
63
+ contextWindow: 1000000
64
+ input: [text, image]
65
+ reasoningEfforts:
66
+ # 不填值表示可选「关闭」,DeepSeek 协议下发送 thinking: disabled。
67
+ off:
68
+ low: low
69
+ high: high
70
+ max: max
71
+ - id: deepseek-v4-pro
72
+ name: DeepSeek V4 Pro
73
+ contextWindow: 1000000
74
+ input: [text]
75
+ reasoningEfforts:
76
+ off:
77
+ high: high
78
+ max: max