mirror of
https://github.com/hansjone/dsh-im-ops.git
synced 2026-10-09 03:03:24 +08:00
release: prepare dsh-im 0.5.0
This commit is contained in:
parent
44dd50216a
commit
c44340accb
7 changed files with 36 additions and 10 deletions
30
README.md
30
README.md
|
|
@ -63,7 +63,20 @@ QQ 扫码接入使用腾讯 QQBot v2 官方流程。默认腾讯授权页会把
|
||||||
|
|
||||||
飞书扫码绑定会把扫码者作为允许使用者;手动凭据同样无法识别扫码人,因此使用飞书应用的可见范围作为入站访问范围。请在飞书开放平台中只向信任的租户、群或成员开放应用。
|
飞书扫码绑定会把扫码者作为允许使用者;手动凭据同样无法识别扫码人,因此使用飞书应用的可见范围作为入站访问范围。请在飞书开放平台中只向信任的租户、群或成员开放应用。
|
||||||
|
|
||||||
每个机器人维护独立的 Harness 工作区。新接入机器人会把 Harness Host 进程当时的工作目录(`process.cwd()`)记录为默认值;该路径会持久化,不会因为以后从其他目录重启 Host 而改变。设置页的机器人卡片会显示当前路径,并可直接修改。任何已在对应平台可见范围内、能够正常向机器人发消息的用户都可以发送 `/workspace /工作区绝对路径` 切换工作区,不再区分管理员和普通用户。插件只接受存在的绝对目录;切换成功后会清除该机器人的旧 Harness 会话映射,其他机器人不受影响。切换只对后续消息生效;已经开始生成的回复会继续完成。
|
每个机器人维护独立的 Harness 工作区。新接入机器人会把 Harness Host 进程当时的工作目录(`process.cwd()`)记录为默认值;该路径会持久化,不会因为以后从其他目录重启 Host 而改变。设置页的机器人卡片会显示当前路径,并可直接修改。
|
||||||
|
|
||||||
|
## 机器人命令
|
||||||
|
|
||||||
|
| 命令 | 作用 |
|
||||||
|
| --- | --- |
|
||||||
|
| `/workspace <工作区绝对路径>` | 切换当前机器人的 Harness 工作区。 |
|
||||||
|
|
||||||
|
示例:`/workspace /Users/alice/projects/my-app`
|
||||||
|
|
||||||
|
- 只接受已经存在的绝对目录;路径无效时机器人会返回具体提示和正确用法。
|
||||||
|
- 任何已在对应平台可见范围内、能够正常向机器人发消息的用户都可以执行,不区分管理员和普通用户。
|
||||||
|
- 切换成功后只清除当前机器人的旧 Harness 会话映射,不影响其他机器人。
|
||||||
|
- 新工作区对后续消息生效;已经开始生成的回复会继续完成。
|
||||||
|
|
||||||
## 设计
|
## 设计
|
||||||
|
|
||||||
|
|
@ -152,7 +165,20 @@ QQ QR binding uses Tencent's official QQBot v2 flow. Tencent's default authoriza
|
||||||
|
|
||||||
Feishu QR binding records the scanner as an allowed user. Manual credentials cannot identify a scanner, so the Feishu application's visibility becomes its inbound access scope. Restrict the application to trusted tenants, groups, or members.
|
Feishu QR binding records the scanner as an allowed user. Manual credentials cannot identify a scanner, so the Feishu application's visibility becomes its inbound access scope. Restrict the application to trusted tenants, groups, or members.
|
||||||
|
|
||||||
Each bot maintains an independent Harness workspace. A newly connected bot records the Harness Host process's current working directory (`process.cwd()`) as its default; the path is persisted and does not change when the Host is later restarted from another directory. Every bot card shows the current path and lets it be edited. Any user who is already within that platform bot's visibility scope and can normally message the bot can send `/workspace /absolute/path` to switch it, with no additional administrator/ordinary-user distinction. Only existing absolute directories are accepted. A successful switch clears that bot's old Harness session mappings without affecting other bots. The switch applies to subsequent messages; a reply that has already started generating is allowed to finish.
|
Each bot maintains an independent Harness workspace. A newly connected bot records the Harness Host process's current working directory (`process.cwd()`) as its default; the path is persisted and does not change when the Host is later restarted from another directory. Every bot card shows the current path and lets it be edited.
|
||||||
|
|
||||||
|
## Bot commands
|
||||||
|
|
||||||
|
| Command | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| `/workspace <absolute workspace path>` | Switch the current bot's Harness workspace. |
|
||||||
|
|
||||||
|
Example: `/workspace /Users/alice/projects/my-app`
|
||||||
|
|
||||||
|
- The path must be an existing absolute directory. The bot returns an actionable error and the correct usage when validation fails.
|
||||||
|
- Any user who is already within the platform bot's visibility scope and can normally message it can run the command; there is no additional administrator/ordinary-user distinction.
|
||||||
|
- A successful switch clears only the current bot's old Harness session mappings and does not affect other bots.
|
||||||
|
- The new workspace applies to subsequent messages; a reply that has already started generating is allowed to finish.
|
||||||
|
|
||||||
## Design
|
## Design
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "@xmanrui/dsh-im",
|
"name": "@xmanrui/dsh-im",
|
||||||
"version": "0.4.0",
|
"version": "0.5.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@xmanrui/dsh-im",
|
"name": "@xmanrui/dsh-im",
|
||||||
"version": "0.4.0",
|
"version": "0.5.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tencent-connect/qqbot-connector": "1.2.0",
|
"@tencent-connect/qqbot-connector": "1.2.0",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@xmanrui/dsh-im",
|
"name": "@xmanrui/dsh-im",
|
||||||
"version": "0.4.0",
|
"version": "0.5.0",
|
||||||
"description": "通过扫码、App Manifest或机器人凭据把IM机器人接入DeepSeek Harness(支持飞书、微信、钉钉、企业微信、QQ、Slack、Telegram、Discord和WhatsApp)。",
|
"description": "通过扫码、App Manifest或机器人凭据把IM机器人接入DeepSeek Harness(支持飞书、微信、钉钉、企业微信、QQ、Slack、Telegram、Discord和WhatsApp)。",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ export class DiscordApi {
|
||||||
headers: {
|
headers: {
|
||||||
authorization: `Bot ${this.#token}`,
|
authorization: `Bot ${this.#token}`,
|
||||||
'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
'user-agent': 'DeepSeek-Harness-dsh-im (https://github.com/xmanrui/dsh-im, 0.4.0)',
|
'user-agent': 'DeepSeek-Harness-dsh-im (https://github.com/xmanrui/dsh-im, 0.5.0)',
|
||||||
},
|
},
|
||||||
...(body === undefined ? {} : { body: JSON.stringify(body) }),
|
...(body === undefined ? {} : { body: JSON.stringify(body) }),
|
||||||
signal: requestSignal(signal, timeoutMs),
|
signal: requestSignal(signal, timeoutMs),
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ function authenticatedHeaders(token) {
|
||||||
function baseInfo() {
|
function baseInfo() {
|
||||||
return {
|
return {
|
||||||
channel_version: WEIXIN_PROTOCOL_VERSION,
|
channel_version: WEIXIN_PROTOCOL_VERSION,
|
||||||
bot_agent: 'DeepSeekHarness/0.4.0',
|
bot_agent: 'DeepSeekHarness/0.5.0',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ test('sendText emits the iLink message envelope without reflecting the token in
|
||||||
assert.equal(body.msg.context_token, 'message-context');
|
assert.equal(body.msg.context_token, 'message-context');
|
||||||
assert.equal(body.msg.item_list[0].text_item.text, 'Harness reply');
|
assert.equal(body.msg.item_list[0].text_item.text, 'Harness reply');
|
||||||
assert.equal(body.base_info.channel_version, '2.4.6');
|
assert.equal(body.base_info.channel_version, '2.4.6');
|
||||||
assert.equal(body.base_info.bot_agent, 'DeepSeekHarness/0.4.0');
|
assert.equal(body.base_info.bot_agent, 'DeepSeekHarness/0.5.0');
|
||||||
assert.doesNotMatch(calls[0].init.body, /host-only-token/);
|
assert.doesNotMatch(calls[0].init.body, /host-only-token/);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue