dsh-monkeyai-sessions 0.1.0 → 0.1.1
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 +3 -1
- package/README.zh.md +96 -0
- package/client.js +136 -136
- package/lib/client-runtime.cjs +136 -136
- package/package.json +4 -3
- package/src/client/index.js +119 -119
- package/src/host/monkeyai-remote.js +19 -19
- package/src/shared/projection.mjs +10 -10
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# DSH MonkeyAI Sessions
|
|
2
2
|
|
|
3
|
+
English | [简体中文](README.zh.md)
|
|
4
|
+
|
|
3
5
|
Read and continue your MonkeyAI conversations inside DeepSeek Harness.
|
|
4
6
|
|
|
5
7
|
Browse the sessions on your MonkeyAI devices, open one to read its full conversation history, and send new instructions to carry on the work you started in the MonkeyAI client — no copy-pasting context, no restarting the task. Replies stream back live, and you can stop a running turn or switch models without leaving DSH.
|
|
@@ -59,7 +61,7 @@ From a checkout:
|
|
|
59
61
|
npm install
|
|
60
62
|
npm run build
|
|
61
63
|
npm pack
|
|
62
|
-
dsh plugin --profile web add ./dsh-monkeyai-sessions-0.1.
|
|
64
|
+
dsh plugin --profile web add ./dsh-monkeyai-sessions-0.1.1.tgz
|
|
63
65
|
```
|
|
64
66
|
|
|
65
67
|
Verified against a real DSH `0.2.2-rc.1` web profile and a live MonkeyAI runtime: authorization, full history loading, prompt delivery, model switching, and turn cancellation all work end to end.
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# DSH MonkeyAI 会话
|
|
2
|
+
|
|
3
|
+
[English](README.md) | 简体中文
|
|
4
|
+
|
|
5
|
+
在 DeepSeek Harness 里读取并继续你的 MonkeyAI 对话。
|
|
6
|
+
|
|
7
|
+
浏览 MonkeyAI 设备上的会话,打开任意一个查看完整对话历史,直接下发新指令接着做之前在 MonkeyAI 客户端上的工作——不用复制上下文,不用重新起任务。回复实时流式返回,还能在 DSH 里停止正在执行的回合、切换模型。
|
|
8
|
+
|
|
9
|
+
授权走 MonkeyAI 的 OAuth 授权码 + PKCE 流程,拿到的凭证由 DSH 存进自己的凭证库。
|
|
10
|
+
|
|
11
|
+
## 安装
|
|
12
|
+
|
|
13
|
+
从 npm 安装:
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
dsh plugin --profile web add dsh-monkeyai-sessions
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
从插件市场索引安装:在 **插件 → 实验性插件** 中打开 **自定义插件索引**,进入 **发现** 页添加索引源:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
https://artenx.github.io/dsh-monkeyai-sessions/index.json
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
从源码安装:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
npm install
|
|
29
|
+
npm run build
|
|
30
|
+
npm pack
|
|
31
|
+
dsh plugin --profile web add ./dsh-monkeyai-sessions-0.1.1.tgz
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
已在真实的 DSH `0.2.2-rc.1` web profile 与在线 MonkeyAI runtime 上端到端验证:授权、完整历史加载、指令下发、模型切换、回合取消均正常工作。
|
|
35
|
+
|
|
36
|
+
## 连接账号
|
|
37
|
+
|
|
38
|
+
三种方式,按便利程度排序:
|
|
39
|
+
|
|
40
|
+
- **账号登录(默认)**:在面板里填 MonkeyAI 服务器地址、账号邮箱和密码。整个 OAuth 流程由 Host 侧完成——登录、发起授权请求、批准、用返回的 code 换 token——浏览器不需要回传任何东西。**手机或任何非 Host 本机的浏览器只能用这种方式。** 密码仅用于这几次请求,不做任何存储,登录成功后面板立即清空输入框。
|
|
41
|
+
- **浏览器授权(loopback)**:Host 在 `127.0.0.1` 随机端口监听,MonkeyAI 服务器重定向到 `http://127.0.0.1:<port>/oauth/callback`。当浏览器与 Host 在同一台机器上时,回调页会把 code 通过 postMessage 发回面板,自动完成授权,无需粘贴。远程浏览器访问不到这个 loopback 地址,此时请改用账号登录。
|
|
42
|
+
- **粘贴回调(scheme)**:原始的 `monkeyai-desktop://oauth/callback` 重定向,用于 loopback 被拒绝的环境。
|
|
43
|
+
|
|
44
|
+
三种方式都通过已注册的 `monkeyai-desktop` 公共客户端申请 `device:connect`、`session:read`、`session:control` 权限。OAuth state 与 PKCE verifier 始终留在 DSH Host 进程内。
|
|
45
|
+
|
|
46
|
+
## 会话能力
|
|
47
|
+
|
|
48
|
+
完整对话历史通过 runtime 的 HTTP 读取通道加载(`POST {http_base}/read/session`,方法 `_monkeyai/session/messages`,按游标翻页),而不是 ACP `session/load` 的有界回放,因此长会话能看到每一轮内容,包括最新回复。
|
|
49
|
+
|
|
50
|
+
回合执行期间输入框旁会显示停止按钮,点击发送 `session/cancel`;模型切换在会话自己的连接上调用 `_monkeyai/session/model/set`。助手消息支持轻量 Markdown 渲染(代码块、行内代码、粗体、标题、列表)。
|
|
51
|
+
|
|
52
|
+
## 界面说明
|
|
53
|
+
|
|
54
|
+
面板采用 DSH 浅色主题,按状态切换布局:
|
|
55
|
+
|
|
56
|
+
- **未连接**:一张登录卡片(服务器地址 + 账号密码 + 主按钮),浏览器授权方式折叠收起
|
|
57
|
+
- **已连接**:会话卡片上方是紧凑工具栏(账号、设备、一个刷新按钮同时加载设备与会话、断开连接)
|
|
58
|
+
- **会话中**:紧凑会话头(返回、标题、模型切换)、审批卡片用普通选项按钮而非原始 JSON、回车发送的输入框
|
|
59
|
+
|
|
60
|
+
次要操作(按 machine ID 手动添加设备、新建会话)都收在折叠区里。
|
|
61
|
+
|
|
62
|
+
设备列表读取账号级的 endpoint 目录(`GET /api/v1/endpoints`),因此所有已注册设备都会出现,在线状态取自 `status` 字段,已撤销的条目会被跳过。选中设备后自动加载其会话。通过独立设备码授权注册的 headless runtime 可能不在该目录里,这类设备可在面板「找不到设备?」区域按 machine ID 手动添加,条目保存在浏览器本地存储并合并进设备选择器。
|
|
63
|
+
|
|
64
|
+
## 开发
|
|
65
|
+
|
|
66
|
+
插件面向 DSH `v0.2.2-rc.1` 与 Node.js `>=24.9.0`。
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
npm test
|
|
70
|
+
npm run build
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
`npm test` 会先构建 Client bundle 再跑测试。构建产出 `client.js` 与 `lib/client-runtime.cjs`,两者都随包分发。
|
|
74
|
+
|
|
75
|
+
测试会加载生成的 Client bundle,校验一元与双向流描述符,检查 `main` 与 `sidebar.panellist` 注册,验证卸载时流与 Remote 的清理,并测试 PKCE state/challenge 构造。Host 服务与 Host 流测试用凭证库、fetch、WebSocket 的替身覆盖授权交换、设备/会话作用域、连接票据、历史与实时帧、指令投递、连接中断、权限撤销、只读拒绝等场景。
|
|
76
|
+
|
|
77
|
+
Host 通过 `ctx.typert` 注册调用描述符,Client 用 `$mount()` 挂载包的 Remote 贡献。共享的 Remote 元数据使用协议包的 `remote-info` 入口,它不引入 Cordis 运行时。Client bundle 内联了该工厂的规范兼容副本(`src/shared/remote-info-lite.mjs`):DSH 只实例化 `dsh.client.inject` 中列出的模块,协议包的子路径入口不在其种子词表内。
|
|
78
|
+
|
|
79
|
+
## 发布
|
|
80
|
+
|
|
81
|
+
包声明了 DSH bundle(`dsh.bundle.patch`)、web Client(`dsh.client`)与 `engines.dsh`。Host 提供的模块通过运行中的 DSH 安装解析,因此唯一的 peer 依赖是 `@deepseek-ai/cordis`。
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
# 构建 Client bundle 与市场索引
|
|
85
|
+
npm run build
|
|
86
|
+
npm run build:market
|
|
87
|
+
|
|
88
|
+
# 发布(需要有发布权限的 npm 账号)
|
|
89
|
+
npm publish --access public
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
`scripts/build-market-index.mjs` 从 npm registry 读取已发布版本及其发布时间,首次发布前回退到当前 `package.json` 版本。生成的 `market/index.json` 遵循插件市场索引 format 1,由 `.github/workflows/market-index.yml` 部署到 GitHub Pages。设置 `MARKET_INDEX_URL` 可覆盖打印出的索引地址。
|
|
93
|
+
|
|
94
|
+
## 许可
|
|
95
|
+
|
|
96
|
+
MIT
|