@lmzhen/dsh-evolution-merge-ui 0.37.0 → 0.38.0

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.
Files changed (2) hide show
  1. package/lib/client.js +55 -29
  2. package/package.json +3 -3
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
- if (value === null || value === void 0) return null;
316
- const ms = typeof value === "number" ? value : Date.parse(value);
317
- if (!Number.isFinite(ms)) return null;
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
@@ -403,6 +412,19 @@ window.__ModuleLoader__.load({
403
412
  ...className === void 0 ? {} : { className }
404
413
  }, (0, react.createElement)("h2", { "data-role": "empty-title" }, title), description === void 0 || description === "" ? null : (0, react.createElement)("p", { "data-role": "empty-description" }, description), actions);
405
414
  }
415
+ [
416
+ "[data-evo-table-wrap]{container-type:inline-size;}",
417
+ "@container (max-width: 700px) {",
418
+ " [data-evo-table-wrap] table{display:block;width:100%;table-layout:auto;border:0;}",
419
+ " [data-evo-table-wrap] thead{display:none;}",
420
+ " [data-evo-table-wrap] tbody{display:flex;flex-direction:column;gap:var(--evo-space-4);}",
421
+ " [data-evo-table-wrap] tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:var(--evo-space-2) var(--evo-space-8);padding:var(--evo-space-6) var(--evo-space-8);border:var(--evo-hairline-width) solid var(--dsw-alias-border-l1);border-radius:var(--evo-radius-control);}",
422
+ " [data-evo-table-wrap] td{display:block;padding:0;text-align:left;white-space:normal;overflow-wrap:anywhere;}",
423
+ " [data-evo-table-wrap] td[data-role=\"rule-name\"], [data-evo-table-wrap] td[data-role=\"name\"]{grid-column:1/-1;font-weight:500;}",
424
+ " [data-evo-table-wrap] td[data-role=\"rule-count\"], [data-evo-table-wrap] td[data-role=\"count\"]{grid-column:2;text-align:right;font-variant-numeric:tabular-nums;}",
425
+ " [data-evo-table-wrap] td[data-role=\"skills\"]{grid-column:1/-1;}",
426
+ "}"
427
+ ].join(String.fromCharCode(10));
406
428
  //#endregion
407
429
  //#region ../evolution-client-kit/src/presentation/disclosure-group.ts
408
430
  /** A native details group for normal/secondary facts. */
@@ -834,11 +856,13 @@ window.__ModuleLoader__.load({
834
856
  const NS = "evolution-merge";
835
857
  const zh = {
836
858
  "entry.label": "技能合并",
859
+ "session.missing": "没有当前会话;请打开会话后重试",
860
+ "decide.failed": "审批请求失败",
837
861
  "title": "合并建议",
838
862
  "task.pending": "条合并建议待处理",
839
- "start.scan": "复制扫描命令",
840
- "start.pair": "复制配对命令模板",
841
- "degraded": "读模型降级:",
863
+ "start.scan": "复制查找重复技能的命令",
864
+ "start.pair": "复制配对命令",
865
+ "degraded": "读取结果不完整:",
842
866
  "copied": "已复制:",
843
867
  "copyFailed": "复制失败:浏览器没有接受剪贴板写入。",
844
868
  "copyRetry": "重试复制",
@@ -853,7 +877,7 @@ window.__ModuleLoader__.load({
853
877
  "tab.fuse": "待合并",
854
878
  "tab.skipped": "无需合并",
855
879
  "empty.verify": "没有待判断的对。",
856
- "empty.scope": "这里只做两轮合成;机械追加属于 skill 管理,不进入合并队列。",
880
+ "empty.scope": "这里只处理两轮合并;单纯追加内容属于技能管理,不会进入合并队列。",
857
881
  "empty.pending": "没有待批准的合并。",
858
882
  "empty.fuse": "没有待合并的对。",
859
883
  "empty.skipped": "没有标记为无需合并的对。",
@@ -865,10 +889,10 @@ window.__ModuleLoader__.load({
865
889
  "approval.off": "审批关:合并自动执行。",
866
890
  "failed": "读取失败,保留上次结果。",
867
891
  "blocked.title": "合并状态未就绪",
868
- "blocked.hint": "迁移/备份修复后刷新;面板不会自动降级。",
892
+ "blocked.hint": "修好合并数据后再刷新;面板不会自动退回旧数据。",
869
893
  "blocked.doctor": "复制诊断命令",
870
894
  "blocked.detail": "查看原始信息",
871
- "blocked.reason.migration-blocked": "合并状态需要迁移,面板已暂停读取。",
895
+ "blocked.reason.migration-blocked": "合并数据需要升级,面板已暂停读取。",
872
896
  "blocked.reason.needs-repair": "合并状态需要修复,面板已暂停读取。",
873
897
  "blocked.reason.forward-only": "合并状态版本过新,当前面板暂不支持。",
874
898
  "blocked.reason.unknown": "合并状态未就绪,面板已暂停读取。",
@@ -912,8 +936,8 @@ window.__ModuleLoader__.load({
912
936
  "action.reject": "复制拒绝命令",
913
937
  "decision.approve": "批准",
914
938
  "decision.reject": "拒绝",
915
- "action.retry-candidates": "复制重试候选",
916
- "action.retry-resume": "复制续跑命令",
939
+ "action.retry-candidates": "复制重试命令",
940
+ "action.retry-resume": "复制继续运行命令",
917
941
  "action.discard": "复制丢弃命令",
918
942
  "action.restore": "复制恢复命令",
919
943
  "action.pair": "复制配对",
@@ -933,9 +957,9 @@ window.__ModuleLoader__.load({
933
957
  "failureServer": "读取失败",
934
958
  "failureUnauthorized": "未登录",
935
959
  "failureForbidden": "无权访问",
936
- "failureUnmounted": "宿主未挂载",
960
+ "failureUnmounted": "功能未启用",
937
961
  "failureCapability": "子代理通道不可用",
938
- "failureCapabilityHint": "先运行全局诊断,或复制下方命令继续处理。preset/host-only 形态没有面板时仍可用这些命令兜底。",
962
+ "failureCapabilityHint": "先运行全局诊断,或复制下方命令继续处理。没有面板的安装方式(preset / host-only)仍可用这些命令。",
939
963
  "failureBodyAmbiguous": "同名技能匹配到多行,无法确定读取哪一个;请用唯一名称或从具体行打开。",
940
964
  "fallbackHint": "可复制命令见下方",
941
965
  "body.missing": "正文不存在或不可读。",
@@ -1047,11 +1071,13 @@ window.__ModuleLoader__.load({
1047
1071
  });
1048
1072
  const en = {
1049
1073
  "entry.label": "Skill merge",
1074
+ "session.missing": "No current session; open a session and try again",
1075
+ "decide.failed": "The approval request failed",
1050
1076
  "title": "Merge suggestions",
1051
1077
  "task.pending": "merge suggestions need attention",
1052
- "start.scan": "Copy scan command",
1053
- "start.pair": "Copy pair command template",
1054
- "degraded": "Degraded read model:",
1078
+ "start.scan": "Copy the find-duplicate-skills command",
1079
+ "start.pair": "Copy the pair command",
1080
+ "degraded": "Incomplete read:",
1055
1081
  "copied": "Copied:",
1056
1082
  "copyFailed": "Copy failed: the browser did not accept the clipboard write.",
1057
1083
  "copyRetry": "Retry copy",
@@ -1066,7 +1092,7 @@ window.__ModuleLoader__.load({
1066
1092
  "tab.fuse": "Ready to merge",
1067
1093
  "tab.skipped": "Skipped",
1068
1094
  "empty.verify": "No pairs to judge.",
1069
- "empty.scope": "This panel only performs two-round synthesis; mechanical append belongs to skill management and does not enter the merge queue.",
1095
+ "empty.scope": "Only two-round merges are handled here; plain appends belong to skill management and never enter this queue.",
1070
1096
  "empty.pending": "No pending merges.",
1071
1097
  "empty.fuse": "No pairs ready to merge.",
1072
1098
  "empty.skipped": "No pairs marked as not worth merging.",
@@ -1078,10 +1104,10 @@ window.__ModuleLoader__.load({
1078
1104
  "approval.off": "Approval off: merges run automatically.",
1079
1105
  "failed": "Read failed; keeping the last result.",
1080
1106
  "blocked.title": "Merge state blocked",
1081
- "blocked.hint": "Fix the migration/backup, then refresh. The panel does not fall back automatically.",
1107
+ "blocked.hint": "Fix the merge data and refresh; the panel will not fall back to older data by itself.",
1082
1108
  "blocked.doctor": "Copy diagnostics command",
1083
1109
  "blocked.detail": "Show host message",
1084
- "blocked.reason.migration-blocked": "Merge state needs migration; the panel is paused.",
1110
+ "blocked.reason.migration-blocked": "The merge data needs an upgrade; reading is paused.",
1085
1111
  "blocked.reason.needs-repair": "Merge state needs repair; the panel is paused.",
1086
1112
  "blocked.reason.forward-only": "Merge state was written by a newer version; this panel cannot read it.",
1087
1113
  "blocked.reason.unknown": "Merge state is not ready; the panel is paused.",
@@ -1125,7 +1151,7 @@ window.__ModuleLoader__.load({
1125
1151
  "action.reject": "Copy reject command",
1126
1152
  "decision.approve": "Approve",
1127
1153
  "decision.reject": "Reject",
1128
- "action.retry-candidates": "Copy retry candidates",
1154
+ "action.retry-candidates": "Copy retry command",
1129
1155
  "action.retry-resume": "Copy resume command",
1130
1156
  "action.discard": "Copy discard command",
1131
1157
  "action.restore": "Copy restore command",
@@ -1146,9 +1172,9 @@ window.__ModuleLoader__.load({
1146
1172
  "failureServer": "Read failed",
1147
1173
  "failureUnauthorized": "Not signed in",
1148
1174
  "failureForbidden": "Forbidden",
1149
- "failureUnmounted": "Host not mounted",
1175
+ "failureUnmounted": "Feature not enabled",
1150
1176
  "failureCapability": "Subagent channel unavailable",
1151
- "failureCapabilityHint": "Run global diagnostics first, or copy a command below to continue. The command fallback also covers preset/host-only shapes without a panel.",
1177
+ "failureCapabilityHint": "Run the global diagnostics first, or copy a command below. Installs without the panel (preset / host-only) can still use these commands.",
1152
1178
  "failureBodyAmbiguous": "The skill name matches multiple rows, so the body is ambiguous. Use a unique name or open it from a specific row.",
1153
1179
  "fallbackHint": "Copy the command below",
1154
1180
  "body.missing": "Body missing or unreadable.",
@@ -2868,14 +2894,14 @@ window.__ModuleLoader__.load({
2868
2894
  const sessionId = currentSessionId(ctx);
2869
2895
  if (sessionId === void 0) return {
2870
2896
  ok: false,
2871
- message: "没有当前会话;请打开会话后重试"
2897
+ message: t("session.missing")
2872
2898
  };
2873
2899
  const result = await decide(rowId, verb, sessionId);
2874
2900
  if (result.ok) return result.payload;
2875
2901
  const failure = result.failure;
2876
2902
  return {
2877
2903
  ok: false,
2878
- message: "message" in failure && typeof failure.message === "string" ? failure.message : "审批请求失败"
2904
+ message: "message" in failure && typeof failure.message === "string" ? failure.message : t("decide.failed")
2879
2905
  };
2880
2906
  },
2881
2907
  ...workspaceId === void 0 ? {} : { workspaceId }
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  ]
12
12
  }
13
13
  },
14
- "version": "0.37.0",
14
+ "version": "0.38.0",
15
15
  "publishConfig": {
16
16
  "access": "public"
17
17
  },
@@ -51,9 +51,9 @@
51
51
  "react-dom": "^18.2.0"
52
52
  },
53
53
  "dependencies": {
54
- "@lmzhen/dsh-evolution-client-kit": "^0.37.0"
54
+ "@lmzhen/dsh-evolution-client-kit": "^0.38.0"
55
55
  },
56
56
  "engines": {
57
- "dsh": ">=0.2.1-rc.2 <0.2.2-0"
57
+ "dsh": ">=0.2.2-rc.0 <0.2.3-0"
58
58
  }
59
59
  }