@lmzhen/dsh-evolution-merge-ui 0.37.0 → 0.37.1
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/lib/client.js +42 -29
- package/package.json +2 -2
package/lib/client.js
CHANGED
|
@@ -304,6 +304,20 @@ window.__ModuleLoader__.load({
|
|
|
304
304
|
}
|
|
305
305
|
//#endregion
|
|
306
306
|
//#region ../evolution-client-kit/src/format.ts
|
|
307
|
+
/** Parse an ISO string, epoch ms, or null into a valid Date; null when absent/invalid. */
|
|
308
|
+
function toLocalDate(value) {
|
|
309
|
+
if (value === null || value === void 0) return null;
|
|
310
|
+
const ms = typeof value === "number" ? value : Date.parse(value);
|
|
311
|
+
if (!Number.isFinite(ms)) return null;
|
|
312
|
+
const date = new Date(ms);
|
|
313
|
+
return Number.isNaN(date.getTime()) ? null : date;
|
|
314
|
+
}
|
|
315
|
+
const pad = (part) => String(part).padStart(2, "0");
|
|
316
|
+
/** The local clock part, HH:MM[:SS]. */
|
|
317
|
+
function clockOf(date, options) {
|
|
318
|
+
const head = pad(date.getHours()) + ":" + pad(date.getMinutes());
|
|
319
|
+
return options.seconds === false ? head : head + ":" + pad(date.getSeconds());
|
|
320
|
+
}
|
|
307
321
|
/**
|
|
308
322
|
* Format an ISO string, epoch milliseconds, or null as local wall time.
|
|
309
323
|
* Invalid values return null; callers decide how to say "unknown".
|
|
@@ -312,14 +326,9 @@ window.__ModuleLoader__.load({
|
|
|
312
326
|
* @returns the formatted local time, or null when the value is absent/invalid.
|
|
313
327
|
*/
|
|
314
328
|
function formatLocalDateTime(value, options = {}) {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
const date = new Date(ms);
|
|
319
|
-
if (Number.isNaN(date.getTime())) return null;
|
|
320
|
-
const pad = (part) => String(part).padStart(2, "0");
|
|
321
|
-
const head = String(date.getFullYear()) + "-" + pad(date.getMonth() + 1) + "-" + pad(date.getDate()) + " " + pad(date.getHours()) + ":" + pad(date.getMinutes());
|
|
322
|
-
return options.seconds === false ? head : head + ":" + pad(date.getSeconds());
|
|
329
|
+
const date = toLocalDate(value);
|
|
330
|
+
if (date === null) return null;
|
|
331
|
+
return String(date.getFullYear()) + "-" + pad(date.getMonth() + 1) + "-" + pad(date.getDate()) + " " + clockOf(date, options);
|
|
323
332
|
}
|
|
324
333
|
//#endregion
|
|
325
334
|
//#region ../evolution-client-kit/src/notice.ts
|
|
@@ -834,11 +843,13 @@ window.__ModuleLoader__.load({
|
|
|
834
843
|
const NS = "evolution-merge";
|
|
835
844
|
const zh = {
|
|
836
845
|
"entry.label": "技能合并",
|
|
846
|
+
"session.missing": "没有当前会话;请打开会话后重试",
|
|
847
|
+
"decide.failed": "审批请求失败",
|
|
837
848
|
"title": "合并建议",
|
|
838
849
|
"task.pending": "条合并建议待处理",
|
|
839
|
-
"start.scan": "
|
|
840
|
-
"start.pair": "
|
|
841
|
-
"degraded": "
|
|
850
|
+
"start.scan": "复制查找重复技能的命令",
|
|
851
|
+
"start.pair": "复制配对命令",
|
|
852
|
+
"degraded": "读取结果不完整:",
|
|
842
853
|
"copied": "已复制:",
|
|
843
854
|
"copyFailed": "复制失败:浏览器没有接受剪贴板写入。",
|
|
844
855
|
"copyRetry": "重试复制",
|
|
@@ -853,7 +864,7 @@ window.__ModuleLoader__.load({
|
|
|
853
864
|
"tab.fuse": "待合并",
|
|
854
865
|
"tab.skipped": "无需合并",
|
|
855
866
|
"empty.verify": "没有待判断的对。",
|
|
856
|
-
"empty.scope": "
|
|
867
|
+
"empty.scope": "这里只处理两轮合并;单纯追加内容属于技能管理,不会进入合并队列。",
|
|
857
868
|
"empty.pending": "没有待批准的合并。",
|
|
858
869
|
"empty.fuse": "没有待合并的对。",
|
|
859
870
|
"empty.skipped": "没有标记为无需合并的对。",
|
|
@@ -865,10 +876,10 @@ window.__ModuleLoader__.load({
|
|
|
865
876
|
"approval.off": "审批关:合并自动执行。",
|
|
866
877
|
"failed": "读取失败,保留上次结果。",
|
|
867
878
|
"blocked.title": "合并状态未就绪",
|
|
868
|
-
"blocked.hint": "
|
|
879
|
+
"blocked.hint": "修好合并数据后再刷新;面板不会自动退回旧数据。",
|
|
869
880
|
"blocked.doctor": "复制诊断命令",
|
|
870
881
|
"blocked.detail": "查看原始信息",
|
|
871
|
-
"blocked.reason.migration-blocked": "
|
|
882
|
+
"blocked.reason.migration-blocked": "合并数据需要升级,面板已暂停读取。",
|
|
872
883
|
"blocked.reason.needs-repair": "合并状态需要修复,面板已暂停读取。",
|
|
873
884
|
"blocked.reason.forward-only": "合并状态版本过新,当前面板暂不支持。",
|
|
874
885
|
"blocked.reason.unknown": "合并状态未就绪,面板已暂停读取。",
|
|
@@ -912,8 +923,8 @@ window.__ModuleLoader__.load({
|
|
|
912
923
|
"action.reject": "复制拒绝命令",
|
|
913
924
|
"decision.approve": "批准",
|
|
914
925
|
"decision.reject": "拒绝",
|
|
915
|
-
"action.retry-candidates": "
|
|
916
|
-
"action.retry-resume": "
|
|
926
|
+
"action.retry-candidates": "复制重试命令",
|
|
927
|
+
"action.retry-resume": "复制继续运行命令",
|
|
917
928
|
"action.discard": "复制丢弃命令",
|
|
918
929
|
"action.restore": "复制恢复命令",
|
|
919
930
|
"action.pair": "复制配对",
|
|
@@ -933,9 +944,9 @@ window.__ModuleLoader__.load({
|
|
|
933
944
|
"failureServer": "读取失败",
|
|
934
945
|
"failureUnauthorized": "未登录",
|
|
935
946
|
"failureForbidden": "无权访问",
|
|
936
|
-
"failureUnmounted": "
|
|
947
|
+
"failureUnmounted": "功能未启用",
|
|
937
948
|
"failureCapability": "子代理通道不可用",
|
|
938
|
-
"failureCapabilityHint": "
|
|
949
|
+
"failureCapabilityHint": "先运行全局诊断,或复制下方命令继续处理。没有面板的安装方式(preset / host-only)仍可用这些命令。",
|
|
939
950
|
"failureBodyAmbiguous": "同名技能匹配到多行,无法确定读取哪一个;请用唯一名称或从具体行打开。",
|
|
940
951
|
"fallbackHint": "可复制命令见下方",
|
|
941
952
|
"body.missing": "正文不存在或不可读。",
|
|
@@ -1047,11 +1058,13 @@ window.__ModuleLoader__.load({
|
|
|
1047
1058
|
});
|
|
1048
1059
|
const en = {
|
|
1049
1060
|
"entry.label": "Skill merge",
|
|
1061
|
+
"session.missing": "No current session; open a session and try again",
|
|
1062
|
+
"decide.failed": "The approval request failed",
|
|
1050
1063
|
"title": "Merge suggestions",
|
|
1051
1064
|
"task.pending": "merge suggestions need attention",
|
|
1052
|
-
"start.scan": "Copy
|
|
1053
|
-
"start.pair": "Copy pair command
|
|
1054
|
-
"degraded": "
|
|
1065
|
+
"start.scan": "Copy the find-duplicate-skills command",
|
|
1066
|
+
"start.pair": "Copy the pair command",
|
|
1067
|
+
"degraded": "Incomplete read:",
|
|
1055
1068
|
"copied": "Copied:",
|
|
1056
1069
|
"copyFailed": "Copy failed: the browser did not accept the clipboard write.",
|
|
1057
1070
|
"copyRetry": "Retry copy",
|
|
@@ -1066,7 +1079,7 @@ window.__ModuleLoader__.load({
|
|
|
1066
1079
|
"tab.fuse": "Ready to merge",
|
|
1067
1080
|
"tab.skipped": "Skipped",
|
|
1068
1081
|
"empty.verify": "No pairs to judge.",
|
|
1069
|
-
"empty.scope": "
|
|
1082
|
+
"empty.scope": "Only two-round merges are handled here; plain appends belong to skill management and never enter this queue.",
|
|
1070
1083
|
"empty.pending": "No pending merges.",
|
|
1071
1084
|
"empty.fuse": "No pairs ready to merge.",
|
|
1072
1085
|
"empty.skipped": "No pairs marked as not worth merging.",
|
|
@@ -1078,10 +1091,10 @@ window.__ModuleLoader__.load({
|
|
|
1078
1091
|
"approval.off": "Approval off: merges run automatically.",
|
|
1079
1092
|
"failed": "Read failed; keeping the last result.",
|
|
1080
1093
|
"blocked.title": "Merge state blocked",
|
|
1081
|
-
"blocked.hint": "Fix the
|
|
1094
|
+
"blocked.hint": "Fix the merge data and refresh; the panel will not fall back to older data by itself.",
|
|
1082
1095
|
"blocked.doctor": "Copy diagnostics command",
|
|
1083
1096
|
"blocked.detail": "Show host message",
|
|
1084
|
-
"blocked.reason.migration-blocked": "
|
|
1097
|
+
"blocked.reason.migration-blocked": "The merge data needs an upgrade; reading is paused.",
|
|
1085
1098
|
"blocked.reason.needs-repair": "Merge state needs repair; the panel is paused.",
|
|
1086
1099
|
"blocked.reason.forward-only": "Merge state was written by a newer version; this panel cannot read it.",
|
|
1087
1100
|
"blocked.reason.unknown": "Merge state is not ready; the panel is paused.",
|
|
@@ -1125,7 +1138,7 @@ window.__ModuleLoader__.load({
|
|
|
1125
1138
|
"action.reject": "Copy reject command",
|
|
1126
1139
|
"decision.approve": "Approve",
|
|
1127
1140
|
"decision.reject": "Reject",
|
|
1128
|
-
"action.retry-candidates": "Copy retry
|
|
1141
|
+
"action.retry-candidates": "Copy retry command",
|
|
1129
1142
|
"action.retry-resume": "Copy resume command",
|
|
1130
1143
|
"action.discard": "Copy discard command",
|
|
1131
1144
|
"action.restore": "Copy restore command",
|
|
@@ -1146,9 +1159,9 @@ window.__ModuleLoader__.load({
|
|
|
1146
1159
|
"failureServer": "Read failed",
|
|
1147
1160
|
"failureUnauthorized": "Not signed in",
|
|
1148
1161
|
"failureForbidden": "Forbidden",
|
|
1149
|
-
"failureUnmounted": "
|
|
1162
|
+
"failureUnmounted": "Feature not enabled",
|
|
1150
1163
|
"failureCapability": "Subagent channel unavailable",
|
|
1151
|
-
"failureCapabilityHint": "Run global diagnostics first, or copy a command below
|
|
1164
|
+
"failureCapabilityHint": "Run the global diagnostics first, or copy a command below. Installs without the panel (preset / host-only) can still use these commands.",
|
|
1152
1165
|
"failureBodyAmbiguous": "The skill name matches multiple rows, so the body is ambiguous. Use a unique name or open it from a specific row.",
|
|
1153
1166
|
"fallbackHint": "Copy the command below",
|
|
1154
1167
|
"body.missing": "Body missing or unreadable.",
|
|
@@ -2868,14 +2881,14 @@ window.__ModuleLoader__.load({
|
|
|
2868
2881
|
const sessionId = currentSessionId(ctx);
|
|
2869
2882
|
if (sessionId === void 0) return {
|
|
2870
2883
|
ok: false,
|
|
2871
|
-
message: "
|
|
2884
|
+
message: t("session.missing")
|
|
2872
2885
|
};
|
|
2873
2886
|
const result = await decide(rowId, verb, sessionId);
|
|
2874
2887
|
if (result.ok) return result.payload;
|
|
2875
2888
|
const failure = result.failure;
|
|
2876
2889
|
return {
|
|
2877
2890
|
ok: false,
|
|
2878
|
-
message: "message" in failure && typeof failure.message === "string" ? failure.message : "
|
|
2891
|
+
message: "message" in failure && typeof failure.message === "string" ? failure.message : t("decide.failed")
|
|
2879
2892
|
};
|
|
2880
2893
|
},
|
|
2881
2894
|
...workspaceId === void 0 ? {} : { workspaceId }
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
]
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
|
-
"version": "0.37.
|
|
14
|
+
"version": "0.37.1",
|
|
15
15
|
"publishConfig": {
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"react-dom": "^18.2.0"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@lmzhen/dsh-evolution-client-kit": "^0.37.
|
|
54
|
+
"@lmzhen/dsh-evolution-client-kit": "^0.37.1"
|
|
55
55
|
},
|
|
56
56
|
"engines": {
|
|
57
57
|
"dsh": ">=0.2.1-rc.2 <0.2.2-0"
|