@klarkxy/dsh-session-manager 0.4.1 → 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
@@ -4,7 +4,7 @@
4
4
 
5
5
  [简体中文](README.zh-CN.md)
6
6
 
7
- Find and read sessions across working directories, start a chat in a temporary workspace, continue with one tap or automatically when a reply stops early, and get a welcome-back recap after time away.
7
+ Search and read DeepSeek Harness sessions across working directories, use temporary workspaces, continue with one tap or automatically when a reply stops early, recap on return with context-compaction hints, and optionally let the agent fork the current session or message other sessions.
8
8
 
9
9
  ## Install
10
10
 
@@ -16,26 +16,30 @@ Replace `web` with your profile name and restart the profile.
16
16
 
17
17
  ## Use
18
18
 
19
- Open **Settings → Session Management** to change the Continue ghost, Auto-continue, and welcome-back options.
19
+ Open **Settings → Session Management** to change the composer suggestion, Auto-continue, welcome-back, and agent-action options. Each row saves as soon as you change it — there is no Save button.
20
+
21
+ On the new-session page, the chosen mode, permission preset, and Auto-continue all apply to the next new session automatically — the page remembers your latest successful picks, including after a restart. Sessions forked from an existing one inherit their parent's choices and never change the remembered ones; older sessions are unaffected. Permission presets stay limited to the fixed presets the host allows: **Auto** and **Custom** cannot be remembered as a default.
20
22
 
21
23
  - **Agent tools**: `list_sessions`, `search_sessions`, and `read_session` find sessions by title or content and read a conversation, its full details, or a handoff summary. Reading a conversation returns one preview per turn, newest first; page back with the returned cursor and open full content in details mode.
24
+ - **Agent actions (off by default)**: two independent switches under **Agent actions** in **Settings → Session Management**; each saves immediately. With **Allow self-fork** on, the agent may call `fork_session` on its own: it forks the current session into a new independent session and starts that branch with a prompt it supplies. The new session keeps the conversation up to the call, including a turn still in progress, and shares the same workspace files, so the two are not file-isolated. With **Allow sending messages** on, the agent may call `send_session_message` to deliver one message it writes to another session, marked as coming from the agent. Any unarchived session in any project can receive it; archived sessions cannot. A message to a running session waits for its next turn, while an idle session is woken to handle it. Neither switch asks for per-call confirmation.
22
25
  - **Session context menu**: right-click a session row or use its **⋯** button to open its actions menu while staying in the current conversation; left-click the row to open that session. The menu appears on saved session rows in the sidebar.
23
26
  - **Edit and resend**: an icon below each message opens an editor at the original message, with images and files above the text box. Change text, remove attachments, paste images, or drop files; cancelling restores the original message. Before sending, the editor explains that the conversation continues from the edited message, the previous version moves to the archive, and file, command, and external changes already made remain in place. After confirmation, the reply is regenerated in a session that keeps the chat's title and sidebar position, while the earlier version stays recoverable from the archive list. This requires a host that can read and fork sessions and read attachments; it keeps original attachments in their original order while editing text, and relies on host attachment support for new or replaced files.
24
27
  - **Temporary workspace**: pick it in the new-session workspace picker to chat in its own new folder.
25
- - **Continue ghost**: after a turn ends and the composer is empty, a grey suggestion floats in the input area. Press `Tab` to fill it into the draft, or click it to send it at once. While a turn is running, the composer's own placeholder stays. **Fixed text** uses the configured text, or "Continue" when empty. **Model-generated** uses the model chosen in that same switch; it runs once after the previous turn ends and caches the line in the session. Mode, fixed text, and ghost model live under **Continue ghost** (keys: `continueMode`, `continueText`).
26
- - **Auto-continue**: on the new-session page, pick **Off**, **Cautious**, or **Bold** from the Auto-continue chip above the composer before sending the first message; the choice locks once the session starts. When a reply stops early, one judge pass decides whether the host sends a follow-up message, shown in the conversation as an "auto-continue" notice. The sent text follows the Continue ghost source: fixed text (or the "Continue" default) in **Fixed text** mode, the judge's suggested message in **Model-generated** mode. It continues at most `autoContinueMax` times (default 3) after each message you send, and stops on abort, error, a pending question or approval, no progress, or when the human is needed. The default mode, limit, and judge model live under **Auto-continue** (keys: `autoContinueMode`, `autoContinueMax`).
27
- - **Welcome back**: returning to a session whose last response is older than `recapMinutes` (default 15) shows an inline card after the last turn, recapping what you were discussing, the progress, and a suggested next step. Past `compactMinutes` (default 60), the same card adds a prompt-cache expiry note and two optional buttons: **Compact context** invokes the host's native compaction; **Continue in a new session** creates a blank session in the source session's workspace (or keeps the original directory when the source is ungrouped) and fills its draft with the recap and source session ID for you to review and send. You can also send your next message directly; compaction and session switching happen only when you click their buttons, and the card disappears once you continue the conversation. Toggle each feature and set its idle threshold under **When you return**; after **Save** is confirmed, the current conversation is rechecked against the new thresholds. Idle time is measured from the last response.
28
- - **Feature models**: the welcome-back recap, the generated ghost, the auto-continue judge, and `read_session` handoff summaries each have their own model selector in **Session Management**. Leaving one on the default follows the shared **default auxiliary model** (a row on this same page), then the current conversation or host default model. A judge choice saved before the separate judge field existed keeps applying through migration. The model menu supports provider groups and search; when the list fails to load, a message and retry button appear while keeping your unsaved settings.
28
+ - **Composer suggestion**: after a turn ends and the composer is empty, a grey suggestion floats in the input area. Press `Tab` to fill it into the draft, or click it to send it at once. While a turn is running, the composer's own placeholder stays. **Fixed text** uses the configured text, or "Continue" when empty. **Model-generated** runs the selected model once after the previous turn ends and caches the line in the session. Mode, fixed text and the generation model all live in the **Composer suggestion** row (keys: `continueMode`, `continueText`); the generation model appears only in **Model-generated** mode.
29
+ - **Auto-continue**: on the new-session page, pick **Off**, **Cautious**, or **Bold** from the Auto-continue chip above the composer before sending the first message; the choice locks once the session starts. The chip remembers your latest successful choice and applies it to the next new session automatically, including after a restart; a session forked from an existing one keeps its parent's state and does not change the remembered choice. When a reply stops early, one judge pass decides whether the host sends a follow-up message, shown in the conversation as an "auto-continue" notice. The sent text follows the Composer suggestion source: fixed text (or the "Continue" default) in **Fixed text** mode, the judge's suggested message in **Model-generated** mode. It continues at most `autoContinueMax` times (default 3) after each message you send, and stops on abort, error, a pending question or approval, no progress, or when the human is needed. The mode lives only on the new-session page; the **Auto-continue** row adjusts the limit (`autoContinueMax`) and the judge model.
30
+ - **Welcome back**: returning to a session whose last response is older than `recapMinutes` (default 15) shows an inline card after the last turn, recapping what you were discussing, the progress, and a suggested next step. Past `compactMinutes` (default 60), the same card adds a prompt-cache expiry note and two optional buttons: **Compact context** invokes the host's native compaction; **Continue in a new session** creates a blank session in the source session's workspace (or keeps the original directory when the source is ungrouped) and fills its draft with the recap and source session ID for you to review and send. You can also send your next message directly; compaction and session switching happen only when you click their buttons, and the card disappears once you continue the conversation. Toggle each feature and set its idle threshold under **When you return**; once a change is saved, the current conversation is rechecked against the new thresholds. Idle time is measured from the last response.
31
+ - **Feature models**: the welcome-back recap, the generated composer suggestion, the auto-continue judge, and `read_session` handoff summaries each have their own model selector, placed in that feature's row in **Session Management**: **Composer suggestion**, **Auto-continue**, **When you return** (enabled with **Show session recap**), and **Session handoff**. Leaving one on the default follows the shared **default auxiliary model** (a row on this same page), then the current conversation or host default model. A judge choice saved before the separate judge field existed keeps applying through migration. The model menu supports provider groups and search; when the list fails to load, a message and retry button appear. With the optional **Model Picker** plugin installed, these menus upgrade to the shared searchable picker with a reasoning-effort slider; without it they keep working as today.
29
32
 
30
33
  ## Limits
31
34
 
32
35
  - Edit and resend uses persistent storage. If sending fails after the new chat is created, sending again continues that same operation, including after a host restart. If chat creation is interrupted before its result is saved, further creation stops so you can check the session list for the new chat first.
33
36
  - Temporary workspaces remain on disk across restarts and uninstall until you remove them.
34
37
  - Content read from other sessions serves as background context rather than instructions.
38
+ - Agent actions require a host that can fork sessions and deliver session messages; without those capabilities the tools report unavailable. A forked session is an independent conversation but shares the source workspace files, so changes on either side are visible to the other. A message wakes an idle session or queues in a running session and cannot be recalled after delivery; archived sessions are refused, and the host may also refuse some subagent-owned targets.
35
39
  - Free chats, deleting chats, and editing and resending a sent message require a DSH host with those capabilities; editing after later modifications also requires host support for explicit modification confirmation. The buttons appear when the host supports them. Image understanding depends on the selected model; audio, video, and other non-image attachments are sent as ordinary files, and reading them depends on the host and model. Modification warnings reflect changes recorded by the host.
36
40
  - Each finished turn in an auto-continue session costs one extra model call.
37
41
  - The welcome-back recap is model-generated; when a model route is unavailable or the call fails, the recap section is omitted while any compaction suggestion still appears on its own. The recap call is read-only and leaves session history unchanged. Compaction uses the host's native command and reports its result in the conversation entry. A new session carries a concise recap and the source session ID for looking up full details, leaving the original session and draft untouched.
38
- - The card is checked when you return to a session (window focus, tab visibility, or switching sessions) and periodically while the page stays visible. Your next send always goes through directly. Tapping the ghost sends the ghost text, while the composer itself still requires non-empty input.
42
+ - The card is checked when you return to a session (window focus, tab visibility, or switching sessions) and periodically while the page stays visible. Your next send always goes through directly. Clicking the composer suggestion sends it directly, while the composer itself still requires non-empty input.
39
43
 
40
44
  ## License
41
45
 
package/README.zh-CN.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [English](README.md)
6
6
 
7
- 跨工作目录查找和阅读 DeepSeek Harness 会话、在临时工作区中开始对话,空输入时一键继续或在回复提前结束时自动继续,久离回来时在输入框上方显示摘要与压缩建议。
7
+ 跨工作目录搜索和阅读 DeepSeek Harness 会话,使用临时工作区;空输入一键续写或自动继续,久离回来给出摘要与上下文压缩建议;可选择让 agent 分叉当前会话或向其他会话发送消息。
8
8
 
9
9
  ## 安装
10
10
 
@@ -16,26 +16,30 @@ dsh plugin --profile web add @klarkxy/dsh-session-manager
16
16
 
17
17
  ## 使用
18
18
 
19
- 展开「设置 → 会话管理」可调整继续灰影、自动继续和欢迎回来的选项。
19
+ 展开「设置 → 会话管理」可调整输入框建议、自动继续、欢迎回来和代理操作的选项;每一项改动即时保存,无需点击保存。
20
+
21
+ 新建会话页所选的模式、权限预设与自动继续会自动用于下一次新建:页面会记住最近一次成功选择,重启后依然生效。从已有会话分叉出的会话继承父会话的选择,不影响记住的内容;旧会话不受影响。权限只限宿主允许的固定预设,Auto 与 Custom 无法被记为默认,维持宿主限制。
20
22
 
21
23
  - **智能体工具**:`list_sessions`、`search_sessions` 和 `read_session` 按标题或内容查找会话,并阅读对话、完整细节或交接摘要。阅读对话时按轮返回预览(最新在前),可用返回的游标向前翻页,并通过细节模式查看完整原文。
24
+ - **代理操作(默认关闭)**:「设置 → 会话管理」的「代理操作」行有两个独立开关,改动即时保存。开启「允许自我 fork」后,agent 可自行调用 `fork_session`:把当前会话分叉成一个独立的新会话,并用它给出的 prompt 启动该分支。新会话继承调用时的对话(含仍在进行的一轮),并与原会话共用同一份工作区文件,不做文件隔离。开启「允许发送消息」后,agent 可自行调用 `send_session_message`,向另一个会话投递一条由它撰写、标记为来自 agent 的消息。任何项目中的未归档会话都可接收,已归档会话不能;发给运行中的会话会排到其下一轮,发给空闲会话会将其唤醒。两个开关都不会逐次询问确认。
22
25
  - **会话右键菜单**:右键点击左侧会话行或它的「⋯」按钮,可在保持当前对话的同时打开该会话的操作菜单;左键点击仍直接打开对话。该菜单显示在侧栏已保存的会话行上。
23
26
  - **编辑并重发**:消息下方的图标会在原消息位置展开编辑框,图片和文件放在文本框上方。可修改文字、删除附件、粘贴图片或拖入文件,取消会恢复原消息。发送前会明确提示:对话将从这条消息继续,之前的版本会移入归档,已执行的文件、命令和外部修改保持现状。确认后新会话沿用原聊天的标题和位置并重新生成回复,之前的版本可在归档列表中找回。这需要宿主提供会话读取、会话分叉和附件读取能力;当前版本支持保留原附件及其排列顺序并编辑文字,新增或替换附件依赖宿主提供对应能力。
24
27
  - **临时工作区**:在新会话的工作区选择器中选择它,即可在一个新的独立目录中开始对话。
25
- - **继续灰影**:上一轮结束后,输入框为空时会浮现灰色建议文本。按 `Tab` 填入草稿,点击则直接发送。一轮仍在运行时保持输入框原有的占位提示。切到「固定文本」使用配置的文本,留空则用「继续」;切到「模型生成」使用所选模型,模型在上一轮结束后生成一次并缓存在会话中。模式、固定文本和灰影模型都在「继续灰影」分组中调整(配置键:`continueMode`、`continueText`)。
26
- - **自动继续**:在创建会话页,发送第一条消息前,在输入框上方的「自动继续」按钮中选择「关闭」「谨慎」或「奔放」;选择在会话开始后锁定。回复提前结束时,由判定模型判断是否自动发送一条继续消息,在对话中显示为「auto-continue」通知。发送文本沿用「继续灰影」的内容来源:「固定文本」使用配置文本(留空为「继续」),「模型生成」使用判定模型给出的消息。你每发一条消息之后最多自动继续 `autoContinueMax` 次(默认 3),遇到中止、出错、待回答问题或审批、无进展或需要人工时会停止。默认形态、次数上限与判定模型都在「自动继续」分组中调整(配置键:`autoContinueMode`、`autoContinueMax`)。
27
- - **欢迎回来**:回到距上次响应超过 `recapMinutes` 分钟(默认 15)的会话时,在最后一轮回复之后内嵌显示模型生成的摘要卡片,说明之前在聊什么、进展和建议的下一步。超过 `compactMinutes` 分钟(默认 60)时,同一卡片还会提示缓存可能已过期,并提供「压缩上下文」和「在新会话中继续」两个可选按钮:前者调用宿主原生压缩命令,后者在来源会话所属工作区内新建空白会话(来源未归属工作区时沿用原目录),把摘要和原会话 ID 填入草稿供确认后发送。你也可以直接发送下一条消息;仅在点击对应按钮时才执行压缩或切换会话,继续对话后卡片自动收起。两项开关和各自的空闲阈值在「回到会话时」分组中调整,点击「保存」并确认成功后,当前会话按新阈值重新检查。空闲时间从上次响应起算。
28
- - **各功能模型**:欢迎回来摘要、灰影生成、自动继续判定和 `read_session` 交接摘要各有独立的模型选择,都在「会话管理」页中调整。留空时使用共享的「默认辅助模型」(同在本页的全局行),再跟随当前会话或宿主默认模型。在独立的判定模型字段出现之前保存过的灰影模型选择会通过迁移继续生效。模型菜单支持按供应商分组和搜索;列表加载失败时显示原因与重试按钮,同时保留未保存的设置。
28
+ - **输入框建议**:上一轮结束后,输入框为空时会浮现灰色建议文本。按 `Tab` 填入草稿,点击则直接发送。一轮仍在运行时保持输入框原有的占位提示。切到「固定文本」使用配置的文本,留空则用「继续」;切到「模型生成」使用所选模型,模型在上一轮结束后生成一次并缓存在会话中。模式、固定文本和生成模型都在「输入框建议」行中调整(配置键:`continueMode`、`continueText`);生成模型只在「模型生成」下显示。
29
+ - **自动继续**:在创建会话页,发送第一条消息前,在输入框上方的「自动继续」按钮中选择「关闭」「谨慎」或「奔放」;选择在会话开始后锁定。按钮会记住最近一次成功选择并自动套用到之后新建的会话,重启后依然生效;从已有会话分叉出的会话继承父会话的状态,不影响记住的选择。回复提前结束时,由判定模型判断是否自动发送一条继续消息,在对话中显示为「auto-continue」通知。发送文本沿用「输入框建议」的内容来源:「固定文本」使用配置文本(留空为「继续」),「模型生成」使用判定模型给出的消息。你每发一条消息之后最多自动继续 `autoContinueMax` 次(默认 3),遇到中止、出错、待回答问题或审批、无进展或需要人工时会停止。形态只在创建会话页选择;「自动继续」行调整次数上限(`autoContinueMax`)和判断模型。
30
+ - **欢迎回来**:回到距上次响应超过 `recapMinutes` 分钟(默认 15)的会话时,在最后一轮回复之后内嵌显示模型生成的摘要卡片,说明之前在聊什么、进展和建议的下一步。超过 `compactMinutes` 分钟(默认 60)时,同一卡片还会提示缓存可能已过期,并提供「压缩上下文」和「在新会话中继续」两个可选按钮:前者调用宿主原生压缩命令,后者在来源会话所属工作区内新建空白会话(来源未归属工作区时沿用原目录),把摘要和原会话 ID 填入草稿供确认后发送。你也可以直接发送下一条消息;仅在点击对应按钮时才执行压缩或切换会话,继续对话后卡片自动收起。两项开关和各自的空闲阈值在「回到会话时」行中调整,改动保存后当前会话按新阈值重新检查。空闲时间从上次响应起算。
31
+ - **各功能模型**:欢迎回来摘要、输入框建议生成、自动继续判定和 `read_session` 交接摘要各有独立的模型选择,分别放在「会话管理」页对应功能的行里:「输入框建议」「自动继续」「回到会话时」(随「显示会话摘要」开关启用)和「会话交接」。留空时使用共享的「默认辅助模型」(同在本页的全局行),再跟随当前会话或宿主默认模型。在独立的判定模型字段出现之前保存过的输入框建议模型选择会通过迁移继续生效。模型菜单支持按供应商分组和搜索;列表加载失败时显示原因与重试按钮。安装可选的「模型选择器」插件后,这些菜单会升级为带搜索和推理等级滑杆的共享选择器;未安装时保持现有控件不变。
29
32
 
30
33
  ## 限制
31
34
 
32
35
  - 编辑并重发使用持久化存储。新聊天创建后若发送失败,再次发送会继续同一次操作,宿主重启后也一样。若创建聊天中途中断、结果尚未保存,会暂停再次创建,请先在会话列表中检查是否已有新聊天。
33
36
  - 临时工作区在重启和卸载后仍保留在磁盘上,可按需手动清理。
34
37
  - 从其他会话读到的内容作为背景参考,而非执行指令。
38
+ - 代理操作需要宿主支持会话分叉和会话消息投递;宿主缺少对应能力时工具会报告不可用。分叉得到的是独立会话,但与原会话共用同一工作区文件,任一方的改动都彼此可见。消息会唤醒空闲会话,在运行中的会话里排队,发送后无法撤回;已归档会话不能接收,部分子代理会话也可能被宿主拒绝。
35
39
  - 自由聊天、删除聊天、编辑并重发已发送消息,需要宿主支持对应能力;后续已有修改时还需宿主支持显式修改确认。宿主支持时才会显示对应按钮。图片理解取决于所选模型;音频、视频和其他非图片附件作为普通文件发送,读取能力由宿主和模型决定。修改提示基于宿主已记录的改动。
36
40
  - 开启自动继续的会话中,每个已结束的轮次会额外消耗一次模型调用。
37
41
  - 「欢迎回来」摘要由模型生成;缺少可用模型或调用失败时仅省略摘要部分,压缩建议仍可单独显示。摘要调用为只读操作,保持会话历史不变。压缩使用宿主的原生命令,结果由对话中的压缩记录反馈。新会话携带简短摘要与原会话 ID(可凭 ID 查阅完整细节),原会话和原草稿保持不变。
38
- - 卡片在你回到会话时检查(窗口聚焦、标签页可见或切换会话),页面持续可见时也会定期检查。你的下一次发送始终直接发出。点击灰影会发送灰影文本,输入框本身仍要求非空内容。
42
+ - 卡片在你回到会话时检查(窗口聚焦、标签页可见或切换会话),页面持续可见时也会定期检查。你的下一次发送始终直接发出。点击输入框建议会直接发送建议文本,输入框本身仍要求非空内容。
39
43
 
40
44
  ## 许可证
41
45