@michengai/dsh-automation 0.1.20 → 0.1.21

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,6 +4,15 @@
4
4
 
5
5
  The five most 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
+ ## 0.1.21 — 2026-08-27
8
+
9
+ - Localized the scheduled-session more-actions accessibility label in both English and Chinese.
10
+ - Added regression coverage for opening the scheduled-task settings section, including delayed dialog mounting, cleanup, timeout handling, and cross-plugin request delivery.
11
+ - Replaced the native session and workspace hook `any` signatures with shared typed selectors and narrowed unknown Host props at the adapter boundary.
12
+ - Made legacy task-name fallback fail closed when multiple tasks share the same name, preventing the wrong task settings from opening.
13
+
14
+ Published package: [`@michengai/dsh-automation@0.1.21`](https://www.npmjs.com/package/@michengai/dsh-automation/v/0.1.21).
15
+
7
16
  ## 0.1.20 — 2026-08-27
8
17
 
9
18
  - Merged [PR #4](https://github.com/MichengAI/dsh-automation/pull/4) by [@louishzwang](https://github.com/louishzwang), adding a read-only task overview beside execution history and persistent default sorting by created or planned time.
@@ -4,6 +4,15 @@
4
4
 
5
5
  以下记录最近发布的五个版本。Git 标签与 GitHub Release 现已和这些条目同步;历史条目继续保留原始发布提交链接。
6
6
 
7
+ ## 0.1.21 — 2026-08-27
8
+
9
+ - 为定时会话的“更多操作”无障碍标签补齐中英文翻译。
10
+ - 补充打开定时任务设置分区的回归测试,覆盖弹窗延迟挂载、资源清理、超时处理和跨插件请求传递。
11
+ - 将原生会话与工作区 Hook 的 `any` 签名替换为共享强类型 Selector,并在宿主适配边界收窄未知参数。
12
+ - 旧执行记录按任务名回退时若遇到多个同名任务将安全失败,避免打开错误的任务设置。
13
+
14
+ 发布包:[`@michengai/dsh-automation@0.1.21`](https://www.npmjs.com/package/@michengai/dsh-automation/v/0.1.21)。
15
+
7
16
  ## 0.1.20 — 2026-08-27
8
17
 
9
18
  - 合并 [PR #4](https://github.com/MichengAI/dsh-automation/pull/4),感谢 [@louishzwang](https://github.com/louishzwang) 贡献:在执行记录旁增加只读任务总览,并支持按创建时间或计划时间保存默认排序。
package/lib/client.js CHANGED
@@ -1605,7 +1605,10 @@ function resolveAutomationTaskSettings(request, automations, runs) {
1605
1605
  }
1606
1606
  const sessionIds = new Set(request.sessionIds);
1607
1607
  const automationId = runs.find((run) => run.sessionId !== void 0 && sessionIds.has(run.sessionId))?.automationId;
1608
- return automations.find((item) => item.id === automationId) ?? automations.find((item) => item.name === request.name);
1608
+ const mapped = automations.find((item) => item.id === automationId);
1609
+ if (mapped !== void 0) return mapped;
1610
+ const named = automations.filter((item) => item.name === request.name);
1611
+ return named.length === 1 ? named[0] : void 0;
1609
1612
  }
1610
1613
 
1611
1614
  // src/client/AutomationView.tsx
@@ -2013,6 +2016,7 @@ var en = {
2013
2016
  "session.rename": "Rename",
2014
2017
  "session.fork": "Fork session",
2015
2018
  "session.archive": "Archive session",
2019
+ "session.moreActions": "More actions for {title}",
2016
2020
  "session.groupActions": "Actions for {name}",
2017
2021
  "session.taskSettings": "Task settings",
2018
2022
  "session.archiveGroup": "Archive all conversations",
@@ -2227,6 +2231,7 @@ var zh = {
2227
2231
  "session.rename": "\u91CD\u547D\u540D",
2228
2232
  "session.fork": "\u5206\u53C9\u4F1A\u8BDD",
2229
2233
  "session.archive": "\u5F52\u6863\u4F1A\u8BDD",
2234
+ "session.moreActions": "\u201C{title}\u201D\u7684\u66F4\u591A\u64CD\u4F5C",
2230
2235
  "session.groupActions": "\u201C{name}\u201D\u7684\u4EFB\u52A1\u64CD\u4F5C",
2231
2236
  "session.taskSettings": "\u4EFB\u52A1\u8BBE\u7F6E",
2232
2237
  "session.archiveGroup": "\u5F52\u6863\u6574\u7EC4\u4F1A\u8BDD",
@@ -3065,9 +3070,9 @@ var EMPTY_SESSION_BY_ID = {};
3065
3070
  function NativeScheduleSessionList(props) {
3066
3071
  const { t, runtime, openSession, useSessions, useWorkspaces, renameSession, archiveSession, forkSession, openTaskSettings } = props;
3067
3072
  const state = (0, import_react9.useSyncExternalStore)(runtime.source.subscribe, runtime.source.getSnapshot, runtime.source.getSnapshot);
3068
- const selectedId = useSessions ? useSessions((snap) => snap?.current ?? null) : null;
3069
- const sessionById = useSessions ? useSessions((snap) => snap?.byId ?? EMPTY_SESSION_BY_ID) : EMPTY_SESSION_BY_ID;
3070
- const archivedIds = useWorkspaces ? useWorkspaces((snap) => snap?.archivedSessionIds ?? []) : [];
3073
+ const selectedId = useSessions ? useSessions((snap) => snap.current ?? null) : null;
3074
+ const sessionById = useSessions ? useSessions((snap) => snap.byId ?? EMPTY_SESSION_BY_ID) : EMPTY_SESSION_BY_ID;
3075
+ const archivedIds = useWorkspaces ? useWorkspaces((snap) => snap.archivedSessionIds ?? []) : [];
3071
3076
  const [folded, setFolded] = (0, import_react9.useState)({});
3072
3077
  const [openMenu, setOpenMenu] = (0, import_react9.useState)(null);
3073
3078
  const [openGroupMenu, setOpenGroupMenu] = (0, import_react9.useState)();
@@ -3080,7 +3085,7 @@ function NativeScheduleSessionList(props) {
3080
3085
  const [groupMode, setGroupMode] = (0, import_react9.useState)("workspace");
3081
3086
  const [view, setView] = (0, import_react9.useState)("runs");
3082
3087
  const archived = (0, import_react9.useMemo)(() => new Set(archivedIds), [archivedIds]);
3083
- const listedIds = useSessions ? useSessions((snap) => Array.isArray(snap?.ids) ? snap.ids : void 0) : void 0;
3088
+ const listedIds = useSessions ? useSessions((snap) => Array.isArray(snap.ids) ? snap.ids : void 0) : void 0;
3084
3089
  const presentIds = (0, import_react9.useMemo)(() => {
3085
3090
  if (listedIds !== void 0) return new Set(listedIds);
3086
3091
  const keys = Object.keys(sessionById);
@@ -3418,7 +3423,7 @@ function NativeSessionRow(props) {
3418
3423
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "dsh-st-n-slot", children: running ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RunningStateDot, {}) : null }),
3419
3424
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "dsh-st-n-title", children: title }),
3420
3425
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "dsh-st-n-time", children: relativeTime(updatedAt, t) }),
3421
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "dsh-st-n-acts", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "dsh-st-n-ico", "aria-label": title + " \u66F4\u591A", onMouseDown: (event) => event.stopPropagation(), onClick: (event) => {
3426
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "dsh-st-n-acts", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "dsh-st-n-ico", "aria-label": t("session.moreActions", { title }), onMouseDown: (event) => event.stopPropagation(), onClick: (event) => {
3422
3427
  event.stopPropagation();
3423
3428
  hideHover();
3424
3429
  onToggleMenu(event);
@@ -3944,6 +3949,12 @@ function openSettingsSection(labels, onSelected, onMissing) {
3944
3949
  var name = "dsh-automation-client";
3945
3950
  var inject = ["slots", "locale", "connection", "sessions"];
3946
3951
  var SETTINGS_CLOCK_SVG = '<svg viewBox="0 0 16 16" width="16" height="16" fill="none" aria-hidden="true" data-dsh-schedule-icon="1"><path fill="currentColor" d="M8 1.15A6.85 6.85 0 1 0 8 14.85 6.85 6.85 0 0 0 8 1.15Zm0 1.4a5.45 5.45 0 1 1 0 10.9 5.45 5.45 0 0 1 0-10.9Z"/><path fill="currentColor" d="M8.62 4.35H7.28v4.2l3.02 1.78.67-1.13-2.35-1.39V4.35Z"/></svg>';
3952
+ function isSessionSelector(value) {
3953
+ return typeof value === "function";
3954
+ }
3955
+ function isWorkspaceSelector(value) {
3956
+ return typeof value === "function";
3957
+ }
3947
3958
  function installSettingsNavIcon(labels) {
3948
3959
  const wanted = new Set(labels().map((item) => item.trim()).filter((item) => item !== ""));
3949
3960
  const applyButton = (button) => {
@@ -4050,8 +4061,8 @@ function apply(ctx) {
4050
4061
  t,
4051
4062
  runtime,
4052
4063
  openSession: opener,
4053
- ...typeof props.useSessions === "function" ? { useSessions: props.useSessions } : {},
4054
- ...typeof props.useWorkspaces === "function" ? { useWorkspaces: props.useWorkspaces } : {},
4064
+ ...isSessionSelector(props.useSessions) ? { useSessions: props.useSessions } : {},
4065
+ ...isWorkspaceSelector(props.useWorkspaces) ? { useWorkspaces: props.useWorkspaces } : {},
4055
4066
  ...typeof props.renameSession === "function" ? { renameSession: props.renameSession } : {},
4056
4067
  ...typeof props.archiveSession === "function" ? { archiveSession: props.archiveSession } : {},
4057
4068
  ...typeof props.deleteSession === "function" ? { deleteSession: props.deleteSession } : {},