feat(device): 可观察长命令会话与设备上下文 - #141
Merged
Merged
Conversation
会话显式绑定现有命令配置,复用可信 caller 和 realtime 通道;独立日志游标、短期启动去重与 runtime 关闭清理避免重新执行和跨 owner 读取。设备摘要沿现有 help 投影,HTTP/MCP 用真实输入输出检查契约。 升级行为变化:受限 shell allowlist 现在拒绝 LF/CR,堵住换行执行第二条命令的旁路;单值 * 仍保留显式任意命令语义。新增能力按 0.x minor 提升 app/cli/sdk/server,server 内联 app 所以产物也变化。
最终 tarball 检查发现直接导出 Zod schema 会使 neutral client 声明携带实现类型。改为结构化 parse/safeParse 接口,继续复用 core 真源,让 CLI/Dashboard 保持相同校验行为并满足干净消费者约束。
从 compact 帮助按需读取 start 契约后展示会话面板,让关闭日志与停止进程成为独立动作;保留未知启动的请求标识,避免连接中断后重复执行。同步提高 dashboard minor 并覆盖渐进发现和交互回归。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变化
设备长命令现在可以显式启动为会话,在一次请求返回后继续运行,并通过 CLI、Dashboard 或普通 HTTP/MCP 查看增量日志和停止。会话按 caller.owner 与命令节点隔离;网络重连保留,daemon 重启失效。新入口按 profile.session / --shell-session-path 选择启用,原同步命令及 Mailbox 语义保持。
设备环境摘要通过现有 ~help 的 JSON/DSL/Markdown 投影;Dashboard 从 compact 索引按需获取 start Schema。新增契约门禁从真实公开命令清单反查执行场景,并校验实际 HTTP/MCP 输出。
升级行为变化:受限 shell allowlist 现在拒绝含 LF/CR 的输入(包括引号内换行),防止第二条命令绕过白名单;单值 ["*"] 仍允许复合命令。
验证
真实 systemd user service 崩溃/重启和整机重启未在本轮实测;进程组验证不替代该部署证据。首版不支持 stdin/PTY 或跨 daemon 重启恢复。
发布
app 0.23.0、cli 0.33.0、dashboard 0.30.0、sdk 0.25.0、server 0.24.0。server 内联 app 且依赖新版 Dashboard,因此需随产物变化发布;plugin-sdk 本轮无相关公开产物契约变化。按仓库规则仅在合入 main 后逐个创建/推送 tag,server 发布需等待 dashboard 精确版本可用。