Repository navigation
v0.4.2
v0.4.2
中文
本版本为 Side 临时提问增加持久化记录与卡片关闭清理,支持重新打开后回看提问和输出;同时新增本地隧道模式,并支持已有隧道在本地转发与 Cloudflare 临时域名之间切换。
Side 提问记录与生命周期
- 保存 Side 的初始提问、后续追问、输出事件、运行状态和错误信息,重新打开 Side 面板或刷新页面后可恢复查看。
- 关闭 Side 面板或断开事件订阅不再停止运行中的提问;重新打开时恢复历史输出,并继续订阅运行中的 Side。
- 事件先保存再推送,历史回放与实时输出按事件 ID 去重,减少重连时的重复展示。
- 服务重启后,将此前仍在运行的 Side 标记为中断并保留已保存的记录,避免一直显示为运行中。
- 单独关闭 Side 时停止对应运行并删除记录;关闭卡片时先停止其 Side,再清理相关记录和事件,历史清理也会删除关联数据。
- 校验追问所属卡片,阻止对仍在运行的 Side 重复发起追问,以及在正在关闭或已关闭的卡片上发起 Side。
- 新增持久化恢复、订阅断开与回放、追问、重启中断及卡片关闭清理的回归测试。
本地隧道与模式切换
- 隧道管理支持选择本地模式或 CF 模式,并持久保存新建隧道的默认模式;默认仍为 CF,修改设置仅影响后续新建的隧道。
- 本地模式通过 AnyCode 地址下的
/tunnel/隧道ID/转发测试程序,无需创建 Cloudflare 临时域名;CF 模式继续使用 Cloudflare 临时域名。 - 已有运行中隧道可单独切换模式,并保留隧道身份。新通道建立成功后替换旧通道并断开原连接;失败时保留原通道。
- 概览页始终提供隧道管理入口,即使没有运行中的隧道也可设置默认模式;列表展示当前模式,概览页在模式切换后更新对应隧道信息。
- 本地转发保留隧道鉴权,移除发往测试程序的 AnyCode 访问凭据,并调整站内重定向和应用 Cookie 路径以适配预览前缀。
- PWA 导航回退排除
/tunnel/路径,避免本地预览被 AnyCode 页面接管。 - 更新
tunnel_create工具说明与 README,并新增本地转发鉴权、关闭、模式切换失败保留原通道及切换期间关闭的回归测试。
使用说明
- 本地模式转发时会移除
/tunnel/隧道ID/前缀;测试程序的资源和 WebSocket 地址需要支持该前缀。 - 本地预览与 AnyCode 同源,仅用于可信的测试程序。
- Side 记录随卡片保留,关闭卡片后清理;服务重启会保留已保存记录,但不会自动恢复被中断的 Side 运行。
English
This release adds persistent records and card-close cleanup for Side questions, allowing prompts and output to be viewed again after reopening. It also introduces local tunnels and lets existing tunnels switch between local forwarding and Cloudflare temporary URLs.
Side history and lifecycle
- Persist initial prompts, follow-up questions, output events, run status, and errors, restoring them when the Side panel is reopened or the page is refreshed.
- Keep Side questions running when the panel closes or event subscriptions disconnect. Reopening restores saved output and resubscribes to active runs.
- Save events before publishing them and deduplicate historical and live output by event ID to reduce duplicate rendering after reconnection.
- Mark previously running Sides as interrupted after a server restart while retaining saved records, instead of leaving them indefinitely marked as running.
- Closing an individual Side stops its run and deletes its records. Closing a card stops its Sides before removing their records and events; history cleanup also removes related data.
- Validate card ownership for follow-ups, reject follow-ups to an already running Side, and prevent Side questions on closing or closed cards.
- Add regression coverage for persistence and restoration, subscription disconnects and replay, follow-ups, restart interruption, and card-close cleanup.
Local tunnels and mode switching
- Choose local or CF mode in tunnel management and persist the default for new tunnels. CF remains the default, and changes apply only to subsequently created tunnels.
- Forward local previews through
/tunnel/<tunnel-id>/under the AnyCode URL without creating a Cloudflare temporary hostname. CF mode continues to use Cloudflare temporary URLs. - Switch individual running tunnels between modes while preserving tunnel identity. Replace the old channel and disconnect its connections only after the new channel starts successfully; retain the original channel if switching fails.
- Always show tunnel management on the overview page, allowing the default mode to be configured even when no tunnels are running. Display each tunnel's mode and refresh its overview entry after a mode change.
- Retain tunnel authentication for local forwarding, strip AnyCode access credentials before forwarding requests, and adapt same-site redirects and application cookie paths to the preview prefix.
- Exclude
/tunnel/routes from PWA navigation fallback so local previews are not replaced by the AnyCode page. - Update the
tunnel_createtool description and README, with regression coverage for authenticated local forwarding, closing, preserving the original channel on switch failure, and closing during a switch.
Usage notes
- Local forwarding strips the
/tunnel/<tunnel-id>/prefix before sending requests upstream. The test application's asset and WebSocket URLs must support this prefix. - Local previews share AnyCode's origin and are intended only for trusted test applications.
- Side records remain with their card and are removed when the card closes. Server restarts retain saved records but do not automatically resume interrupted Side runs.
Complete commit list / 完整提交列表
-
91f16f2— Persist Side prompts, follow-ups, output, and run status; restore history and clean up Side runs and records when cards close.持久化 Side 提问、追问、输出与运行状态,支持历史恢复,并在关闭卡片时停止运行、清理记录。
-
5697d99— Add local tunnel forwarding, persistent default-mode selection, and switching between local and Cloudflare modes for existing tunnels.新增本地隧道转发、持久化默认模式设置,以及已有隧道在本地与 Cloudflare 模式之间切换。