@michengai/dsh-automation 0.1.27 → 0.1.28
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 +6 -0
- package/CHANGELOG.zh-CN.md +6 -0
- package/lib/client.js +39 -7
- package/lib/client.js.map +2 -2
- package/lib/index.js +63 -9
- package/lib/types/client/schedule-rail-model.d.ts +1 -0
- package/lib/types/recurrence.d.ts +2 -0
- package/lib/types/run-title.d.ts +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@
|
|
|
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.28 — 2026-09-04
|
|
8
|
+
|
|
9
|
+
- Compared normalized schedules semantically so property order no longer makes an unchanged overdue one-time schedule look edited.
|
|
10
|
+
- Formatted scheduled-session and execution-record titles in the task's IANA time zone. Host-local fallback formatting now follows the runtime time zone dynamically.
|
|
11
|
+
- Clarified that the unattended tool guard is layered on top of the selected permission preset, and ignored the repository-local pnpm store.
|
|
12
|
+
|
|
7
13
|
## 0.1.27 — 2026-09-03
|
|
8
14
|
|
|
9
15
|
- Fixed the scheduled execution-record list staying empty after a run until the sidebar was switched several times. New runs now stay visible even when the Host session index has not caught up yet, the snapshot refreshes immediately when the open session is a scheduled run, and polling speeds up while a run is queued or running.
|
package/CHANGELOG.zh-CN.md
CHANGED
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
以下记录最近发布的五个版本。Git 标签与 GitHub Release 现已和这些条目同步;历史条目继续保留原始发布提交链接。
|
|
6
6
|
|
|
7
|
+
## 0.1.28 — 2026-09-04
|
|
8
|
+
|
|
9
|
+
- 改用语义方式比较规范化计划,避免属性顺序不同导致未变更的过期单次计划被误判为已编辑。
|
|
10
|
+
- 定时会话与执行记录标题按任务的 IANA 时区显示;未指定时区时的宿主本地 fallback 会动态跟随运行时区。
|
|
11
|
+
- 明确无人值守工具守卫叠加于所选权限预设之上,并忽略仓库本地 pnpm 存储目录。
|
|
12
|
+
|
|
7
13
|
## 0.1.27 — 2026-09-03
|
|
8
14
|
|
|
9
15
|
- 修复定时任务已经执行、但侧栏执行记录要多次切换后才出现的问题。宿主会话簿尚未收录时仍显示新记录,当前打开的若是定时会话会立即刷新快照,排队或执行中时加快轮询。
|
package/lib/client.js
CHANGED
|
@@ -2605,12 +2605,39 @@ async function archiveScheduledGroup(sessionIds, archiveSession) {
|
|
|
2605
2605
|
}
|
|
2606
2606
|
|
|
2607
2607
|
// src/run-title.ts
|
|
2608
|
-
|
|
2608
|
+
var RUN_STAMP_OPTIONS = {
|
|
2609
|
+
year: "numeric",
|
|
2610
|
+
month: "2-digit",
|
|
2611
|
+
day: "2-digit",
|
|
2612
|
+
hour: "2-digit",
|
|
2613
|
+
minute: "2-digit",
|
|
2614
|
+
hourCycle: "h23"
|
|
2615
|
+
};
|
|
2616
|
+
var zonedRunStampFormatters = /* @__PURE__ */ new Map();
|
|
2617
|
+
function runStampFormatter(timeZone) {
|
|
2618
|
+
const cached = zonedRunStampFormatters.get(timeZone);
|
|
2619
|
+
if (cached !== void 0) return cached;
|
|
2620
|
+
const formatter = new Intl.DateTimeFormat("en-CA", { ...RUN_STAMP_OPTIONS, timeZone });
|
|
2621
|
+
zonedRunStampFormatters.set(timeZone, formatter);
|
|
2622
|
+
return formatter;
|
|
2623
|
+
}
|
|
2624
|
+
function formatRunStamp(iso, timeZone) {
|
|
2609
2625
|
const value = new Date(iso);
|
|
2610
2626
|
if (Number.isNaN(value.getTime())) return iso;
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2627
|
+
if (timeZone === void 0) {
|
|
2628
|
+
const date = `${value.getFullYear()}-${String(value.getMonth() + 1).padStart(2, "0")}-${String(value.getDate()).padStart(2, "0")}`;
|
|
2629
|
+
const time = `${String(value.getHours()).padStart(2, "0")}:${String(value.getMinutes()).padStart(2, "0")}`;
|
|
2630
|
+
return `${date} ${time}`;
|
|
2631
|
+
}
|
|
2632
|
+
try {
|
|
2633
|
+
const parts = runStampFormatter(timeZone).formatToParts(value);
|
|
2634
|
+
const part = (type) => parts.find((item) => item.type === type)?.value;
|
|
2635
|
+
const [year, month, day, hour, minute] = ["year", "month", "day", "hour", "minute"].map((type) => part(type));
|
|
2636
|
+
if ([year, month, day, hour, minute].some((item) => item === void 0)) return iso;
|
|
2637
|
+
return `${year}-${month}-${day} ${hour}:${minute}`;
|
|
2638
|
+
} catch {
|
|
2639
|
+
return iso;
|
|
2640
|
+
}
|
|
2614
2641
|
}
|
|
2615
2642
|
|
|
2616
2643
|
// src/client/schedule-rail-model.ts
|
|
@@ -2618,7 +2645,11 @@ var AUTOMATION_SESSION_PREFIX = "dsh-automation-session-";
|
|
|
2618
2645
|
var NATIVE_SIDEBAR_TAB_KEY = "dsh-automation.sidebar-tab";
|
|
2619
2646
|
function groupScheduledSessions(automations, runs) {
|
|
2620
2647
|
const nameById = /* @__PURE__ */ new Map();
|
|
2621
|
-
|
|
2648
|
+
const timeZoneById = /* @__PURE__ */ new Map();
|
|
2649
|
+
for (const item of automations) {
|
|
2650
|
+
nameById.set(item.id, item.name);
|
|
2651
|
+
if (item.timeZone !== void 0) timeZoneById.set(item.id, item.timeZone);
|
|
2652
|
+
}
|
|
2622
2653
|
for (const run of runs) {
|
|
2623
2654
|
const stored = (run.automationName || "").trim();
|
|
2624
2655
|
if (stored !== "" && stored !== run.automationId && !nameById.has(run.automationId)) {
|
|
@@ -2645,7 +2676,7 @@ function groupScheduledSessions(automations, runs) {
|
|
|
2645
2676
|
sessions: runs.filter((run) => run.automationId === id && run.sessionId !== void 0 && run.sessionId !== "").slice().sort((left, right) => Date.parse(right.startedAt ?? right.scheduledFor) - Date.parse(left.startedAt ?? left.scheduledFor)).map((run) => ({
|
|
2646
2677
|
id: run.sessionId,
|
|
2647
2678
|
running: run.status === "running" || run.status === "queued",
|
|
2648
|
-
label: formatRunStamp(run.startedAt ?? run.scheduledFor) + " - " + name2
|
|
2679
|
+
label: formatRunStamp(run.startedAt ?? run.scheduledFor, timeZoneById.get(id)) + " - " + name2
|
|
2649
2680
|
}))
|
|
2650
2681
|
};
|
|
2651
2682
|
}).filter((group) => group.sessions.length > 0);
|
|
@@ -3133,13 +3164,14 @@ function NativeScheduleSessionList(props) {
|
|
|
3133
3164
|
const groups = (0, import_react9.useMemo)(() => {
|
|
3134
3165
|
const snapshot = state.snapshot;
|
|
3135
3166
|
if (snapshot === void 0) return [];
|
|
3167
|
+
const timeZoneById = new Map(snapshot.automations.map((item) => [item.id, item.timeZone]));
|
|
3136
3168
|
return groupScheduledSessions(snapshot.automations, snapshot.runs).map((group) => ({
|
|
3137
3169
|
...group,
|
|
3138
3170
|
sessions: group.sessions.filter((session) => keepScheduledSessionLink(session.id, archived, presentIds)).map((session) => {
|
|
3139
3171
|
const run = snapshot.runs.find((item) => item.sessionId === session.id);
|
|
3140
3172
|
return {
|
|
3141
3173
|
...session,
|
|
3142
|
-
title: formatRunStamp(run && (run.startedAt || run.scheduledFor) || ""),
|
|
3174
|
+
title: formatRunStamp(run && (run.startedAt || run.scheduledFor) || "", timeZoneById.get(group.id)),
|
|
3143
3175
|
updatedAt: run && (run.startedAt || run.scheduledFor) || "",
|
|
3144
3176
|
running: session.running || sessionById[session.id]?.running === true
|
|
3145
3177
|
};
|