dsh-lark-bot 0.4.0 → 0.5.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 CHANGED
@@ -101,12 +101,36 @@ dsh-lark-bot start \
101
101
  | `/stop` | 终止当前任务 |
102
102
  | `/timeout [N\|off\|default]` | 查看或设置当前会话运行超时 |
103
103
  | `/density [compact\|standard\|detailed]` | 查看或设置卡片密度 |
104
+ | `/model` | 查看当前模型、dsh 默认模型与可用模型列表 |
105
+ | `/model use <id>` | 热切换当前会话模型(下一轮生效,无需重启) |
106
+ | `/model default <id>` | 写入 dsh 默认模型 `agent-default-model`(管理员) |
107
+ | `/model add\|remove <provider> <modelId>` | 添加 / 删除 provider 的模型(管理员) |
108
+ | `/providers` | 查看 dsh 已配置 providers、模型与凭据状态 |
109
+ | `/provider add\|update\|remove <id>` | 管理 provider(管理员;deepseek-official 与自定义 pi-ai) |
110
+ | `/key set\|remove\|list <引用名>` | 管理 dsh 凭据(set / remove 需管理员) |
104
111
  | `/ask <问题>` | 发送问答卡,回答写入会话上下文 |
105
112
  | `/invite user\|admin\|group <id>`、`/invite list`、`/invite remove user\|group <id>` | 管理访问白名单 |
106
113
  | `/help` | 查看帮助 |
107
114
 
108
115
  飞书消息中的图片会下载到本地 media 目录并传给 dsh;文本类文件会读取内容并注入任务上下文。
109
116
 
117
+ ### 模型 / Provider / 凭据管理
118
+
119
+ 模型与 provider 的配置以 dsh 官方方式持久化(与 dsh Web **Settings → Models** 页面完全相同的
120
+ 存储协议),改动在下一个请求生效,无需重启 bot:
121
+
122
+ - `/model use <id>`:按会话热切换模型,下一轮消息即用新模型。
123
+ - `/model default <id>`:写入 dsh 的 `agent-default-model`,作为新会话的默认模型。
124
+ - `/providers`:展示 dsh 已配置的 provider、模型与凭据状态(DeepSeek 官方 + 自定义 pi-ai)。
125
+ - `/provider add|update|remove`:管理自定义 provider(`llm-pi-ai`)或 `deepseek-official`;
126
+ 自定义 provider 需要 `--api`(`openai-completions` / `openai-responses` / `anthropic-messages`)、
127
+ `--base-url` 与至少一个 `--model`,与官方 schema 一致。
128
+ - `/key set|remove|list`:读写 `~/.dsh/.credentials.yaml`(0600)。settings 只保存 `apiKeyEnv`
129
+ 引用,字面密钥不进入 settings 或聊天记录。
130
+
131
+ 安全提醒:在飞书会话里输入密钥会对该会话的可见成员暴露密钥,建议仅在私聊中使用,或优先用
132
+ `--api-key-env` 引用已配置的环境变量 / dsh Web 页面录入。bot 不会在任何回复中回显密钥值。
133
+
110
134
  ### 5. 卸载
111
135
 
112
136
  ```bash
package/dist/cli.d.ts CHANGED
@@ -9,5 +9,11 @@ interface StartOptions {
9
9
  }
10
10
  declare function buildProgram(): Command;
11
11
  declare function main(argv?: readonly string[]): Promise<void>;
12
+ /**
13
+ * True when this module is being executed directly (e.g. `node dist/cli.js run`)
14
+ * rather than imported by a bin wrapper. The background service runs
15
+ * `node <package>/dist/cli.js run`, so the bundle must self-execute in that case.
16
+ */
17
+ declare function isDirectInvocation(entry?: string | undefined, metaUrl?: string): boolean;
12
18
 
13
- export { type StartOptions, buildProgram, main };
19
+ export { type StartOptions, buildProgram, isDirectInvocation, main };