Bundle
@morlay/better-session
dsh profile bundle: assembles @morlay/session-branch, @morlay/session-rdb, @morlay/ui-conversation-message-actions, @morlay/ui-conversation-manager and @morlay/dsh-reference into a DeepSeek Harness web profile — the rewind / retry / recall / fork closed l
- weekly downloads
- 1.8k weekly downloads
- License
- MIT
- Updated
- Updated 3 days ago
Readme
# @morlay/better-session
[](https://www.npmjs.com/package/@morlay/better-session)
[](https://www.npmjs.com/package/@morlay/better-session)
[](https://www.npmjs.com/package/@morlay/better-session)
profile 聚合 bundle:一次性装配 `@morlay/session-branch`、`@morlay/session-rdb`、
`@morlay/ui-conversation-message-actions`、`@morlay/ui-conversation-manager`、`@morlay/dsh-reference` 到 DeepSeek
Harness 的 profile,提供**就地编辑 / 重试 / 撤回 / 分支**(rewind / retry / recall / fork)闭环。对话外壳走**官方
`ui-conversation` 行**,我们的扩展只注册在它的槽位上(`conversation.chat.node` / `conversation.composer.dock`)。
## 安装
```sh
dsh plugin --profile web add "@morlay/better-session"
```
安装带上全部子包,bundle patch([`cordis.patch.yml`](./cordis.patch.yml))自动装配四层服务。装了什么、为什么这么
换、边界在哪,见[设计 会话编辑闭环装配](./.agents/designs/20260917-会话编辑闭环装配.md)与
[ADR 不 fork 上游前端组件](../../../.agents/adrs/20261001-不fork上游前端组件只做插槽扩展.md)。
## 使用
装配后即可在 GUI 会话中:
- **编辑** user 消息 → 撤回该消息及其后内容到输入框(rewind,不重放),用户改后自行发送(带确认弹窗)
- **重试** 任意闭合回合 → 就地重放该回合输入(带确认弹窗)
- **分支**(fork)→ 从任意闭合边界派生**新会话**
也可以直接调用服务:
```ts
// 编排层(host)
await ctx.sessionEditor.retry({ action: "retry", sessionId, turn: 2, cascade: "truncate" });
// 数据层
await ctx.sessionBranch.rewind(sessionId, 5);
await ctx.sessionBranch.forkFrom(sourceId, { atSeq: 6, childSessionId });
```
## 配置(rdb)
默认配置为 SQLite(`$DSH_HOME/sessions/sessions.sqlite`)。改配置就是改 `session-rdb` 那一行的 config(bundle patch /
profile patch / 设置页都可)——字段、默认值与生效方式见
[`@morlay/session-rdb` 的 README](../../session/session-rdb/README.md)。
Install
dsh plugin --profile web add @morlay/better-session@0.1.10
Profile: web
With the hub plugin installed, ask your agent to install it by name — it resolves the same plan shown here.
dsh plugin --profile web add github:stvlynn/dsh.fish#path:packages/dsh-plugin-hub
install morlay-better-session from the hub