@michengai/dsh-automation 1.0.5 → 1.0.7

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/CHANGELOG.md CHANGED
@@ -4,37 +4,27 @@
4
4
 
5
5
  Upcoming changes and recent published versions are listed below. Git tags and GitHub Releases now mirror these entries; historical sections retain links to their original release commits.
6
6
 
7
+ ## 1.0.7 - 2026-10-23
8
+
9
+ - **Dedicated Sidebar Activity Bar Entry**: Supports toggling a dedicated scheduled tasks icon on the primary activity bar from the plugin bundle configuration card. Enabled by default on new installs to seamlessly replace the built-in entry, expanding into a full 960px centered workbench for editing long prompts, recurrence rules, and audit logs.
10
+ - **Hide Official Automation Entry Toggle**: Supports toggling whether to hide the host's built-in "Automation tasks" (`ui-schedule`) entry. Enabled by default; automatically resets active panel to default conversation if official panel is open; features persistent client caching against network flicker; restores built-in entry cleanly when disabled or if this plugin is uninstalled.
11
+ - **Online Update Switch & Enterprise Lockdown**: Supports toggling update check status from the plugin card. Supports declaring `updater: false` or `onlineUpdate: false` in Cordis configuration for full lockdown (403 blocked and UI disabled with notice).
12
+ - **Reverse Proxy Subpath Support**: Resolves API endpoints against `document.baseURI` with trailing slash guards, preventing 404 errors when DSH is hosted behind reverse proxies with path prefixes.
13
+ - **Persistent Settings & Security Hardening**: Supports `stateDir` configuration; secures settings HTTP endpoints with host authentication check, CSRF marker validation, and payload size bounds.
14
+
15
+ ## 1.0.6 - 2026-10-22
16
+
17
+ - Fix sidebar rebound on collapse after searching: prevent the official workspace tree from mistakenly triggering `expandSidebar` on narrow rail mount due to historical search requests, keeping sidebar collapse stable (Issue #20).
18
+ - Fix sidebar tabs remaining in English in Chinese locale: resolve segment tab memo caching, dynamically refreshing tab labels to "任务" (Tasks) and "定时" (Scheduled) once locale dictionaries are ready (Issue #20).
19
+ - Secondary view persistence: preserve the active view selection (Records vs. Tasks) in local storage so collapsing the sidebar or remounting does not reset view state.
20
+
7
21
  ## 1.0.5 - 2026-10-20
8
22
 
9
- - Share the sidebar tab selection with IM while migrating both legacy keys; preserve selection on initial load and shell takeover, exclude session rows from new-chat detection, and verify both real shells' state effects in the composition regression. The stored key is migrated to `dsh-native-sidebar.tab` on read; only this plugin's own legacy key is removed, because older IM builds still read theirs.
10
-
11
- - Scheduled sessions are no longer hidden from the official task tree; idle scheduled sessions show the official clock icon before the row status.
12
- - Channel sessions now appear in the official task tree; opening one no longer forces the sidebar to switch to the Channels tab.
13
- - Records groups are synthesized with the automation definition's own `createdAt` (falling back to its earliest run only when the definition is gone), so the official group hover card no longer shows 1970.
14
- - Cancel a pending "new scheduled task" or "task settings" request when the settings surface never opens, so a later manual visit does not replay it.
15
- - Fix dropdown chevrons not flipping when a menu opens: host icon components only destructure `size`/`className`/`strokeWidth`, so the rotation now lives in the stylesheet under `.is-open` instead of a dropped `style` prop.
16
- - The Records view now renders the official workspace tree. It offers no add-workspace, rename, or group deletion; groups only expand and collapse.
17
- - The task group's `…` menu offers only Task settings; unrelated third-party menu items are preserved, while the host's own rename/delete rows are hidden because synthetic groups cannot be renamed or deleted. Group archiving is not offered.
18
- - Scope session-filter cache hits to their registry as well as revision, so replacing a sidebar registry cannot reuse another registry's filtered snapshot.
19
- - The Records view adds a By task grouping selected by default and can switch to By workspace, Workspace tree, or Flat. Grouping and ordering use an independent view state and no longer affect the main task tree. By workspace keeps every workspace and filters only sessions to scheduled runs.
20
- - Fix the Records view's reuse of the official WorkspaceBrowser missing the `retainAccountKeys` view action, which crashed the error boundary and removed the whole workspace header, search, and sort controls.
21
- - Restore the Records view header's create button in the old add-workspace position; it now opens the New scheduled task dialog instead of the add-workspace flow, and the incorrect add-workspace shortcut hint is removed.
22
- - Fix the Records view being 12px narrower than the Tasks tree: the official WorkspaceBrowser already reserves right padding, and the records container added it a second time, pulling the header, search, sort and group rows inward.
23
- - The Scheduled → Tasks overview now has search, sort, and create buttons; the search icon uses the same 14px size as Records, sort uses the same official sliders icon, search filters by task name, and create opens the scheduled-task dialog.
24
- - Align the Records / Tasks view switcher with the Archive Manager tabs: 32px container, 28px tabs, 6–12px adaptive horizontal padding, 13/20 typography, 6px icon gap, and matching selected states; tabs no longer wrap when the Mica skin narrows the sidebar.
25
- - The top-level Tasks / Channels / Scheduled tabs now use the same format; the indicator width follows the actual tab count and labels stay on one line.
26
- - Settings toolbar buttons, dropdown chevrons, icons injected into official workspace/view menus, task schedule rows, channel tabs, and the settings-nav icon now use host icons; only the GitHub brand mark remains custom-drawn.
27
- - Delete the self-drawn Tasks/Records fallback lists and the legacy `sidebar.schedule` slot; show an unavailable message when the official tree is missing.
28
- - Delete the empty-icon renderer, `pickHostExport`, and legacy `events` reader fallbacks that supported hosts cannot reach; a missing host icon now throws.
29
- - Fix the Tasks / Channels / Scheduled tabs disappearing after collapsing and expanding the sidebar: move the `wide === false` return in `NativeScheduleShell` below every hook to keep hook order stable (Issue #18).
30
- - Unify the sidebar wrapper protocol with `__dshNativeTabWrapped`, `__dshNativeTabOriginal`, and `__dshNativeTabOwner` while keeping legacy flags readable; name both wrappers `DshNativeTabWorkspaceShell`.
31
- - Stop filtering `im:` sessions from the official task tree; Channels and Tasks now share the same sessions. Remove `filterTaskSessionState`, `filterWorkspaceListState`, their caches, and related tests.
32
- - Unify official task-tree session filters: both automation and IM apply filters through `NativeTabRegistry.sessionFilters`, with a new `getRevision()` so adding or removing a filter recomputes immediately regardless of which plugin wrapped the sidebar first.
33
- - Unify official task-tree session opening: add `NativeTabRegistry.sessionOpeners` to match scheduled/channel openers in order and fall back to the host; scheduled sessions still adopt/refresh and channel sessions still resolve/ensure regardless of which plugin wrapped first.
34
- - Delete the custom session list, search toolbar, row menus, and hover cards; session management now reuses the official components.
35
- - Fix the Scheduled tab disappearing when a foreign sidebar host changes: distinguish automation and IM wrappers with the shared display name, and reattach the tab/opener when the foreign host changes.
36
- - Preserve the stored sidebar tab on first load; match new-session controls by their own label instead of session titles.
37
- - Reduce per-row automation subscriptions and guard menu injection and foreign opener matchers.
23
+ - Fix the session list (including pinned sessions) being cleared when collapsing the sidebar on desktop or opening the drawer on mobile (Issue #18).
24
+ - The Records view now adopts the host's native workspace tree: supporting independent grouping by task or workspace, official sorting, and direct shortcuts to Task settings from group menus, with a restored New scheduled task button in the header.
25
+ - Tasks overview enhancements: added search, sorting, and create buttons, allowing quick filtering by task name.
26
+ - Seamless sidebar tab coordination: top-level Tasks, Channels, and Scheduled tabs as well as Records/Tasks view tabs match host styling with adaptive padding that prevents label wrapping. Tab selection is shared and preserved alongside the IM plugin across reloads.
27
+ - Session integration and icon refinements: idle scheduled sessions show the official clock icon in the main task tree, and dropdown arrows now flip correctly when expanding menus.
38
28
 
39
29
  ## 1.0.4 - 2026-10-19
40
30
 
@@ -4,37 +4,27 @@
4
4
 
5
5
  以下记录待发布变更及近期已发布版本。Git 标签与 GitHub Release 现已和这些条目同步;历史条目继续保留原始发布提交链接。
6
6
 
7
+ ## 1.0.7 - 2026-10-23
8
+
9
+ - **侧边栏独立入口**:在插件扩展配置卡片中支持自主开启/关闭左侧主活动栏常驻「定时任务」快捷入口,初装默认开启,与屏蔽官方入口协同无缝平替官方活动栏入口,直达 960px 居中大版心主工作台,便于查看长指令、调度配置与运行历史;与会话树次级页签双层互补。
10
+ - **屏蔽官方自动化入口开关**:支持在插件扩展配置卡片中开启/关闭是否隐藏宿主自带的「自动化任务」(`ui-schedule`)入口,默认开启;隐藏时自动将官方 schedules 面板切回默认会话,杜绝主区孤立悬空;带有本地持久化缓存防闪烁;若关闭该项或卸载本插件,官方自带入口将自动完好无损地复现,绝无残留。
11
+ - **在线更新开关与企业合规锁定**:支持在插件卡片中随时切换在线检查更新状态;支持在 Cordis 配置中声明 `updater: false` 或 `onlineUpdate: false` 锁定更新,锁定状态下更新接口强行阻断返回 403,界面自动置灰并提示锁定。
12
+ - **反向代理部署支持**:端点路径自动按页面 `document.baseURI` 解析,彻底解决在带子路径前缀反代(如 `/app/dsh/`)部署下更新与设置端点 404 的问题。
13
+ - **配置持久化与安全性增强**:支持 `stateDir` 配置项;设置 API 补齐宿主认证门禁与跨站防御,读写端点安全可靠。
14
+
15
+ ## 1.0.6 - 2026-10-22
16
+
17
+ - 修复搜索后侧栏无法收起(收起后瞬间弹回)的缺陷:阻断官方任务树在窄轨收起状态下因历史搜索请求而误调 `expandSidebar` 导致侧栏秒弹回的问题,保障收起操作稳定执行(Issue #20)。
18
+ - 修复中文环境下侧栏页签未能汉化的问题:解决分段器页签在首帧过度缓存的问题,语言字典就绪后即时刷新为中文「任务」与「定时」(Issue #20)。
19
+ - 二级视图状态持久化:将定时界面的二级页签(记录 / 任务)选择持久化至本地存储,收起侧栏或重新挂载后稳定保留当前视图,不再被重置回「记录」。
20
+
7
21
  ## 1.0.5 - 2026-10-20
8
22
 
9
- - 与 IM 统一使用共享侧栏页签存储,兼容两边旧键;初次加载和换壳保留用户选择,会话行标题不再触发新建识别。组合回归新增双方真实外壳的状态交互验证。读取时把旧键迁移到 `dsh-native-sidebar.tab`;只清理本插件自己的旧键,旧版 IM 仍在读它自己的键。
10
-
11
- - 定时会话不再从官方任务树隐藏;空闲的定时会话在会话行前显示官方时钟图标。
12
- - 频道会话现在也出现在官方任务树里,点开时不再强制切到「频道」页签。
13
- - 合成分组改用任务定义自身的 `createdAt`(只有任务已删除时才退回最早执行时间),官方分组悬停卡片不再显示 1970。
14
- - 设置页始终没打开时撤销挂起的「新建定时任务」「任务设置」请求,避免之后手动进入设置被旧请求弹窗。
15
- - 修复菜单展开时下拉箭头不翻转:宿主图标组件只解构 `size`/`className`/`strokeWidth`,被丢弃的 `style` 改为 `.is-open` 下的样式表规则。
16
- - 「定时 → 记录」改用官方任务树渲染;记录视图不提供新增工作区、重命名或删除分组,分组只能展开/收起。
17
- - 记录视图的任务分组 `…` 菜单只提供「任务设置」;保留其它第三方菜单项,隐藏宿主自带的重命名/删除工作区(合成分组不可重命名或删除)。不提供整组归档入口。
18
- - 会话过滤缓存同时校验注册表身份和 revision,避免侧栏换壳后串用其它注册表的过滤结果。
19
- - 记录视图新增「按任务」分组并默认选中,可切换按工作区、工作区树或平铺。分组和排序使用独立视图状态,不再影响顶部任务树;按工作区模式保留全部工作区,只把会话过滤为定时会话。
20
- - 修复记录视图复用官方工作区浏览器时缺少 `retainAccountKeys` 视图操作,导致错误边界回退、工作区标题、搜索和排序按钮整块消失。
21
- - 记录视图头部恢复「新建」按钮(原添加工作区位置),点击直接打开「新建定时任务」弹窗,不再进入添加工作区流程;同时移除错误的「添加工作区」快捷键提示。
22
- - 修复记录视图工作区比任务树窄 12px:官方工作区浏览器自身已有右内边距,记录容器重复留白,导致标题、搜索、排序和分组行右缘内缩。
23
- - 「定时 → 任务」总览补齐搜索、排序、新建三个按钮;搜索图标改为 14px、排序沿用与记录视图相同的官方滑块图标,搜索按任务名称过滤,新建直接打开定时任务弹窗。
24
- - 「记录 / 任务」视图切换页签对齐归档管理页签:32px 容器、28px 页签、6–12px 自适应横向内边距、13/20 字体、6px 图标间距和相同选中态样式;云母皮肤压缩侧栏时不再换行。
25
- - 顶部「任务 / 频道 / 定时」页签同步为同一格式;页签数量变化时滑块宽度按实际数量计算,页签标签保持单行。
26
- - 设置页工具按钮、菜单下拉箭头、注入官方工作区/视图菜单的图标、任务时间、频道页签和设置导航图标改用宿主图标;仅保留 GitHub 品牌图标自绘。
27
- - 删除官方树缺失或报错时回退的自绘任务/记录列表,以及旧 `sidebar.schedule` 槽位;缺少官方树时改为显示不可用提示。
28
- - 删除受支持宿主不会触发的空图标渲染、`pickHostExport` 和旧 `events` 读取回退;缺失宿主图标改为直接报错。
29
- - 修复侧边栏折叠后展开或移动端抽屉打开时报错 React #300/#310 导致会话列表消失:`NativeScheduleShell` 的 `wide === false` 提前返回移到所有 Hook 之后,避免 React Hook 顺序错误(Issue #18)。
30
- - 统一侧栏包裹协议:新增 `__dshNativeTabWrapped`、`__dshNativeTabOriginal`、`__dshNativeTabOwner`,保留旧标记兼容;包裹组件统一命名 `DshNativeTabWorkspaceShell`。
31
- - 官方任务树不再过滤 `im:` 会话,频道与任务共享同一批会话;删除 `filterTaskSessionState`、`filterWorkspaceListState` 及相关缓存和测试。
32
- - 统一官方任务树的会话过滤器:automation 与 IM 插件都通过 `NativeTabRegistry.sessionFilters` 应用过滤,并新增 `getRevision()`,过滤器增删后立即重新计算,不再取决于哪个插件先包裹侧栏。
33
- - 统一官方任务树的会话打开:新增 `NativeTabRegistry.sessionOpeners`,按时序匹配定时/频道 opener,未匹配时回退宿主;无论谁先包裹,定时会话都会 adopt/refresh,频道会话都会 resolve/ensure。
34
- - 删除自绘会话列表、搜索工具栏、行菜单和悬停卡,会话管理统一复用官方组件。
35
- - 修复外部侧栏换壳后「定时」页签可能丢失:正确区分 automation 与 IM 的共享包裹名,并在 foreign host 变化时重新挂载页签和 opener。
36
- - 修复已保存侧栏页签在首次加载被普通会话覆盖;新建会话点击只匹配控件标签,不再误命中会话标题。
37
- - 降低每个会话行对自动化状态的订阅开销,并为菜单注入和第三方 opener 增加边界保护。
23
+ - 修复桌面端折叠侧栏或移动端打开侧栏抽屉时,整个会话列表(含置顶会话)被清空并报错 React 冲突的问题(Issue #18)。
24
+ - 「定时 → 记录」改用官方原生树视图渲染:支持按任务、按工作区等方式独立分组与排序,分组菜单提供直达「任务设置」入口;头部恢复「新建」定时任务按钮。
25
+ - 「定时 → 任务」总览完善:补齐搜索、排序与新建入口,搜索支持按任务名称快速过滤。
26
+ - 侧边栏页签深度协同:顶部「任务 / 频道 / 定时」以及记录/任务视图切换页签全面对齐宿主几何尺寸与滑块样式,自适应内边距防止窄栏折行;与 IM 插件共享侧栏选中记忆,刷新或换壳时保留当前页签。
27
+ - 会话打通与图标优化:空闲定时会话在主任务树中带官方时钟图标标识;修复任务分组下拉箭头展开时不翻转的问题。
38
28
 
39
29
  ## 1.0.4 - 2026-10-19
40
30
 
package/README.md CHANGED
@@ -103,6 +103,45 @@ dsh --profile web --dump-config
103
103
  ```
104
104
 
105
105
  Restart DSH Web and hard-refresh the browser. Pin a version with `@0.1.5` instead of `@latest` when needed.
106
+ - **Reverse Proxy Deployment**: Supports running DSH behind a reverse proxy with a path prefix (e.g. `/app/dsh/`). Plugin API and update check endpoints resolve relative to the document base URI (`document.baseURI`) to avoid 404 errors caused by stripped path prefixes.
107
+
108
+ ## Configuration & Optional Toggles
109
+
110
+ The plugin supports unified management via the host plugin configuration card:
111
+ > **Sidebar → Plugins → Click `@michengai/dsh-automation` details** (registered in the host `plugins.bundle.config` slot).
112
+
113
+ Two native toggle switches are available:
114
+
115
+ ### 1. Sidebar Entry (`sidebarEntry`)
116
+ - **Default**: Off (`false`)
117
+ - **Description**: Displays a dedicated **Scheduled Tasks** icon on the primary activity bar.
118
+ - **Effect**:
119
+ - When enabled, clicking the sidebar icon opens the full task center inside a **960px centered view** (aligned with official plugin manager conventions), providing ample room for editing multi-step prompts, schedules, and inspect runs;
120
+ - When toggled off, cleanly unregisters the slot and safely switches away if the panel was active;
121
+ - The standard Settings modal and the workspace rail tabs remain fully available and in sync regardless of this toggle.
122
+
123
+ ### 2. Online Update (`onlineUpdate` / `updater`)
124
+ - **Default**: On (`true`)
125
+ - **Description**: Controls whether the plugin checks for and installs online updates.
126
+ - **Effect**:
127
+ - **UI Integration**: Disabling the switch instantly removes update chips and check buttons from the settings header;
128
+ - **Server-Side Enforcement**: All update check and install requests return `HTTP 403` when disabled;
129
+ - **Host/Platform Lockdown**: Supports declarative lockdown in Cordis configuration (bundle patch):
130
+ ```yaml
131
+ updater: false # or onlineUpdate: false
132
+ ```
133
+ When locked, the updater is completely disabled at startup, and the UI toggle is disabled with a locked notice.
134
+
135
+ ### 3. Hide Official Automation Entry (`hideOfficialSchedule`)
136
+ - **Default**: On (`true`)
137
+ - **Description**: Controls whether to hide the host's built-in "Automation tasks" (`ui-schedule`) entry to avoid conflict.
138
+ - **Effect**:
139
+ - **Clean Sidebar**: Installed by default with the built-in entry hidden, avoiding duplicate icons;
140
+ - **Instant Response**: Toggling off immediately restores the built-in icon;
141
+ - **Zero Residual Changes**: Toggling off or uninstalling the plugin restores the built-in entry automatically.
142
+
143
+ ### 4. Storage Directory Configuration (`stateDir`)
144
+ - Supports configuring a custom state directory via `stateDir` in `cordis.patch.yml`. Settings are saved to `settings.json` within that directory, falling back to the active profile directory when omitted.
106
145
 
107
146
  ## Updates
108
147
 
package/README.zh-CN.md CHANGED
@@ -103,6 +103,46 @@ dsh --profile web --dump-config
103
103
  ```
104
104
 
105
105
  安装后重启 DSH Web,并在浏览器硬刷新。需要钉死某一版时,把 `@latest` 换成 `@0.1.5`。
106
+ - **反向代理部署**:支持将 DSH 部署在带路径前缀的反向代理后面(如 `/app/dsh/`),插件 API 与更新检查端点统一自动按页面基址(`document.baseURI`)相对解析,避免丢失代理路径前缀导致 404。
107
+
108
+ ## 插件配置与可选开关
109
+
110
+ 插件支持在 DSH 插件扩展配置中统一管理:
111
+ > **主界面侧边栏「插件」→ 点击 `@michengai/dsh-automation` 详情页**(对应宿主 `plugins.bundle.config` 插槽)。
112
+
113
+ 此处提供两个原生扁平行开关:
114
+
115
+ ### 1. 侧边栏入口 (`sidebarEntry`)
116
+ - **默认状态**:关闭(`false`)
117
+ - **功能说明**:在宿主左侧主活动栏增加常驻的 **「定时任务」** 图标入口。
118
+ - **生效效果**:
119
+ - 开启后,在侧边栏点击即可直达定时任务中心,并在主工作区以 **960px 居中版心**(对齐官方插件管理与市场规范)展开完整大面板,便于集中管理长任务指令、定时计划与执行记录;
120
+ - 关闭后安全注销侧栏槽位(若当前正停留在定时任务面板,会自动安全切回默认视图,防止悬空和白屏);
121
+ - 无论是否开启侧栏入口,DSH 原有的「设置 → 定时任务」弹窗以及会话侧栏内的「任务与定时」页签均始终保留,数据与状态 100% 实时同步。
122
+
123
+ ### 2. 在线更新 (`onlineUpdate` / `updater`)
124
+ - **默认状态**:开启(`true`)
125
+ - **功能说明**:控制是否允许在线检查并安装定时任务插件的新版本。
126
+ - **生效效果**:
127
+ - **界面联动**:关闭开关后,定时任务设置标题旁的「检查更新」按钮与版本提示将即时隐藏,无需刷新页面;开启后自动恢复展示;
128
+ - **接口安全拦截**:关闭后,服务端的更新路由对任何版本检查和安装请求均返回 `HTTP 403` 禁用状态,彻底杜绝在插件内安装未审核版本;
129
+ - **宿主/平台级锁定**:面向精选插件索引或企业安全合规环境,支持直接在 Cordis 配置文件(bundle patch)中声明,无需进入界面手动配置:
130
+ ```yaml
131
+ updater: false # 或 onlineUpdate: false
132
+ ```
133
+ 配置生效后,更新器在启动时即被完全禁用,且更新入口默认保持隐藏,前端 Switch 显示为锁定置灰状态。
134
+ - **更新模式**:发现新版后,只有检测到 DSH CLI 或 Desktop 更新服务时才可使用“自动更新”;其他环境会在弹窗中提供可复制、与当前 Profile 对应的手工更新命令。
135
+
136
+ ### 3. 屏蔽官方自动化入口 (`hideOfficialSchedule`)
137
+ - **默认状态**:开启(`true`)
138
+ - **功能说明**:控制是否隐藏宿主自带的「自动化任务」(`ui-schedule`)活动栏入口,避免与本插件功能冲突。
139
+ - **生效效果**:
140
+ - **默认清爽**:安装本插件后,宿主自带的自动化任务活动栏按钮默认隐藏,避免界面出现两个相似入口;
141
+ - **即时响应**:若手动关闭此项,官方入口立刻重新出现;
142
+ - **无损自愈与卸载复原**:关闭开关或通过标准命令卸载本插件后,官方自带的自动化入口将自动完好无损地复现,绝无残留修改。
143
+
144
+ ### 4. 存储目录配置 (`stateDir`)
145
+ - 支持在 `cordis.patch.yml` 中声明自定义存储目录(如 `stateDir: D:/Data/dsh-automation`),设置将持久化至该目录下的 `settings.json`,未指定时默认存储在当前 Profile 目录。
106
146
 
107
147
  ## 在线更新
108
148