dsh-lark-bot 0.15.4 → 0.15.6

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
@@ -114,11 +114,10 @@ dsh --profile dsh-lark
114
114
  | `/retention [N\|default]` | 查看或设置保留消息条数(超出自动归档)|
115
115
  | `/archive [note]`、`/archive list [N]`、`/archive clean` | 手动归档 / 查看 / 清理会话记录|
116
116
  | `/density [compact\|standard\|detailed]` | 查看或设置卡片密度|
117
- | `/model` | 查看当前模型、dsh 默认模型与可用模型列表|
117
+ | `/model`、`/providers`、`/provider`、`/key` | 打开交互式管理卡片(BotFather 式多轮向导;选择用按钮、填写用卡片输入、写入前确认)|
118
118
  | `/model use <id>` | 热切换当前会话模型(下一轮生效,无需重启)|
119
119
  | `/model default <id>` | 写入 dsh 默认模型 `agent-default-model`(管理员)|
120
120
  | `/model add\|remove <provider> <modelId>` | 添加 / 删除 provider 的模型(管理员)|
121
- | `/providers` | 查看 dsh 已配置 providers、模型与凭据状态|
122
121
  | `/provider add\|update\|remove <id>` | 管理 provider(管理员;deepseek-official 与自定义 pi-ai)|
123
122
  | `/key set\|remove\|list <引用名>` | 管理 dsh 凭据(set / remove 需管理员)|
124
123
  | `/ask <问题>` | 发送问答卡,回答写入会话上下文|
@@ -154,9 +153,22 @@ dsh-lark-bot guardian install --dsh-profile dsh-lark
154
153
 
155
154
  配置以 dsh 官方方式持久化(与 dsh Web **Settings → Models** 同一存储协议),改动下一请求生效、无需重启:
156
155
 
156
+ - **交互式管理卡片**:`/providers`(或 `/provider`、`/model`、`/key`)打开管理卡片,按
157
+ BotFather 式的多轮向导完成增删改查——能选择的用按钮点选(API 协议、provider、模型、凭据引用),
158
+ 需要填值的用卡片输入(ID、Base URL、模型列表、密钥值),写入前有确认卡,随时可取消。
157
159
  - `/model use <id>`:按会话热切换模型(下一轮生效);`/model default <id>`:写入 dsh 默认模型。
158
- - `/providers`:查看 provider、模型与凭据状态;`/provider add|update|remove`:管理自定义 provider(需 `--api` / `--base-url` / 至少一个 `--model`,与官方 schema 一致)或 `deepseek-official`。
159
- - `/key set|remove|list`:读写 `~/.dsh/.credentials.yaml`(0600);settings 只存 `apiKeyEnv` 引用,字面密钥不进 settings / 聊天记录。
160
+ - `/providers`:查看 provider、模型与凭据状态;`/provider add|update|remove`:管理自定义 provider
161
+ (需 `--api` / `--base-url` / 至少一个 `--model`,与官方 schema 一致)或 `deepseek-official`。
162
+ - `/key set|remove|list`:读写 `~/.dsh/.credentials.yaml`(0600);settings 只存 `apiKeyEnv` 引用,
163
+ 字面密钥不进 settings / 聊天记录。
164
+ - **凭据引用必须关联**:`/key set <引用名> <值>` 只写入凭据文件;provider 要生效还须在其
165
+ `apiKeyEnv` 字段引用同一名字(`/provider add|update ... --api-key-env <引用名>`,或向导中填写)。
166
+ 引用名与 provider ID 相同且 provider 未设 `apiKeyEnv` 时,`/key set` 会自动补关联;
167
+ 已存在的老配置在下次运行时也会自动补齐。
168
+ - **热重载**:桥接在每轮运行前把模型解析为「provider + model」路由并传给 dsh runtime;SDK 适配器
169
+ 在路由变化时自动重建 runtime(下一轮生效)。pi-ai 的 Base URL 填根域名(如
170
+ `https://www.kingapi.xyz`)会自动补全为 `/v1`。dsh runtime 启动后需几百毫秒才注册
171
+ pi-ai 路由,桥接会重试握手直到注册完成(避免 “no adapter registered for provider”)。
160
172
 
161
173
  安全提醒:在飞书会话输入密钥会对可见成员暴露,建议私聊使用或 `--api-key-env` 引用环境变量;bot 不在任何回复中回显密钥值。
162
174
 
package/README_EN.md CHANGED
@@ -114,11 +114,10 @@ Send a normal message to the bot in Feishu to get started. Common commands:
114
114
  | `/retention [N\|default]` | View or set the live message retention window (overflow is archived) |
115
115
  | `/archive [note]`、`/archive list [N]`、`/archive clean` | Archive / list / clean session transcripts |
116
116
  | `/density [compact\|standard\|detailed]` | View or set card density |
117
- | `/model` | View current model, dsh default model and available models |
117
+ | `/model`、`/providers`、`/provider`、`/key` | Open the interactive management hub (BotFather-style multi-turn wizard: tap-button selections, card text inputs, confirm-before-write) |
118
118
  | `/model use <id>` | Hot-switch the current session model (effective next message, no restart) |
119
119
  | `/model default <id>` | Write the dsh default model `agent-default-model` (admin) |
120
120
  | `/model add\|remove <provider> <modelId>` | Add / remove a provider model (admin) |
121
- | `/providers` | View configured dsh providers, models and credential status |
122
121
  | `/provider add\|update\|remove <id>` | Manage providers (admin; deepseek-official and custom pi-ai) |
123
122
  | `/key set\|remove\|list <ref>` | Manage dsh credentials (set / remove require admin) |
124
123
  | `/ask <question>` | Send a Q&A card; the answer is written back to session context |
@@ -155,9 +154,17 @@ Skip it with `setup --no-guardian`; remove it later with `dsh-lark-bot guardian
155
154
 
156
155
  Configuration is persisted the official dsh way (the same storage protocol as the dsh Web **Settings → Models** page); changes take effect on the next request without restarting the bot:
157
156
 
157
+ - **Interactive management hub**: `/providers` (or bare `/provider`, `/model`, `/key`) opens a
158
+ management card. BotFather-style multi-turn wizards cover add/update/remove flows — pick
159
+ options (API protocol, provider, model, credential ref) with buttons, type values (ID, Base URL,
160
+ model list, key value) into card inputs, review on a confirm card, and cancel any time.
158
161
  - `/model use <id>`: hot-switch the model for this session (effective next message); `/model default <id>`: write the dsh default model.
159
162
  - `/providers`: show providers, models and credential status; `/provider add|update|remove`: manage custom providers (needs `--api` / `--base-url` / at least one `--model`, matching the official schema) or `deepseek-official`.
160
163
  - `/key set|remove|list`: read / write `~/.dsh/.credentials.yaml` (0600); settings keep only `apiKeyEnv` references — literal keys never enter settings or chat history.
164
+ - **Hot reload**: before each run the bridge resolves the model into a `provider + model` route and
165
+ passes it to the dsh runtime; the SDK adapter re-spawns the runtime automatically when the route
166
+ changes (effective on the next message). A bare pi-ai Base URL (e.g. `https://www.kingapi.xyz`)
167
+ is completed with `/v1` automatically.
161
168
 
162
169
  Security note: typing a key in a Feishu conversation exposes it to everyone who can see that chat; prefer private chats or `--api-key-env` references to environment variables. The bot never echoes key values in any reply.
163
170