@morehao/dsh-github-trending 0.8.13 → 0.8.15
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/client.js +96 -37
- package/lib/{chunk-OMQY3T3V.js → chunk-6YH4NOBR.js} +3 -11
- package/lib/index.js +1 -1
- package/lib/internal.d.ts +0 -2
- package/lib/internal.js +1 -1
- package/package.json +3 -3
package/client.js
CHANGED
|
@@ -162,7 +162,6 @@ var DICT = {
|
|
|
162
162
|
"scope.weekly": "每周",
|
|
163
163
|
"scope.monthly": "每月",
|
|
164
164
|
"scope.languages": "语言",
|
|
165
|
-
"scope.topN": "每语言条数",
|
|
166
165
|
"card.schedule.title": "调度",
|
|
167
166
|
"schedule.enabled": "定时运行",
|
|
168
167
|
"schedule.periods": "自动产出周期",
|
|
@@ -359,6 +358,7 @@ var DICT = {
|
|
|
359
358
|
"runs.prUnknown": "状态未知",
|
|
360
359
|
"runs.prCreated": "PR 已创建",
|
|
361
360
|
"runs.legacy": "旧记录",
|
|
361
|
+
"runs.degraded.tag": "降级",
|
|
362
362
|
"runs.legacyHint": "旧记录没有预览副本,内容哈希使用旧算法,不能与 v2 直接比较。",
|
|
363
363
|
"runs.detail.coreModel": "核心 / 模型",
|
|
364
364
|
"runs.detail.date": "运行日期",
|
|
@@ -387,6 +387,7 @@ var DICT = {
|
|
|
387
387
|
"digest.copied": "已复制",
|
|
388
388
|
"digest.openPr": "打开 PR",
|
|
389
389
|
"digest.truncated": "已截断到 512 KB",
|
|
390
|
+
"digest.degraded.badge": "本次为降级数据:抓取或摘要存在降级,详见下方说明",
|
|
390
391
|
"digest.loading": "读取预览…",
|
|
391
392
|
"digest.tag.preview": "有预览",
|
|
392
393
|
"digest.tag.failed": "运行失败",
|
|
@@ -714,7 +715,6 @@ var DICT = {
|
|
|
714
715
|
"scope.weekly": "Weekly",
|
|
715
716
|
"scope.monthly": "Monthly",
|
|
716
717
|
"scope.languages": "Languages",
|
|
717
|
-
"scope.topN": "Per language",
|
|
718
718
|
"card.schedule.title": "Schedule",
|
|
719
719
|
"schedule.enabled": "Scheduled runs",
|
|
720
720
|
"schedule.periods": "Auto periods",
|
|
@@ -911,6 +911,7 @@ var DICT = {
|
|
|
911
911
|
"runs.prUnknown": "State unknown",
|
|
912
912
|
"runs.prCreated": "PR created",
|
|
913
913
|
"runs.legacy": "Legacy",
|
|
914
|
+
"runs.degraded.tag": "Degraded",
|
|
914
915
|
"runs.legacyHint": "Legacy records have no preview copy and use the old hash algorithm, so they cannot be compared with v2 directly.",
|
|
915
916
|
"runs.detail.coreModel": "Core / model",
|
|
916
917
|
"runs.detail.date": "Run date",
|
|
@@ -939,6 +940,7 @@ var DICT = {
|
|
|
939
940
|
"digest.copied": "Copied",
|
|
940
941
|
"digest.openPr": "Open PR",
|
|
941
942
|
"digest.truncated": "Truncated at 512 KB",
|
|
943
|
+
"digest.degraded.badge": "Degraded data: fetching or summarizing was degraded — see the note below",
|
|
942
944
|
"digest.loading": "Loading preview…",
|
|
943
945
|
"digest.tag.preview": "Preview",
|
|
944
946
|
"digest.tag.failed": "Failed",
|
|
@@ -1333,6 +1335,7 @@ var CSS = `
|
|
|
1333
1335
|
.dshgt-empty{padding:48px 0;text-align:center;color:var(--gt-muted);font-size:13px;}
|
|
1334
1336
|
.dshgt-tag{display:inline-flex;align-items:center;height:20px;padding:0 7px;border:1px solid var(--gt-border);border-radius:999px;font-size:11px;color:var(--gt-muted);background:var(--gt-bg);white-space:nowrap;}
|
|
1335
1337
|
.dshgt-inline-tag{margin-left:6px;vertical-align:1px;}
|
|
1338
|
+
.dshgt-tag-warn{color:var(--gt-warn,#c08a00);border-color:color-mix(in srgb,var(--gt-warn,#c08a00) 45%,var(--gt-border));}
|
|
1336
1339
|
|
|
1337
1340
|
/* ——— 顶部身份条(第一行):名称 / 版本 / 完整包名 / GitHub / 检查更新 ——— */
|
|
1338
1341
|
.dshgt-idbar{display:flex;align-items:center;gap:9px;height:48px;padding:0 var(--dshgt-inset);border-bottom:1px solid var(--gt-border);flex:none;background:var(--gt-bg);min-width:0;}
|
|
@@ -1343,7 +1346,7 @@ var CSS = `
|
|
|
1343
1346
|
.dshgt-id-sep{width:1px;height:16px;background:var(--gt-border);flex:none;}
|
|
1344
1347
|
.dshgt-id-pkg{appearance:none;border:0;background:none;padding:2px 4px;border-radius:5px;color:var(--gt-muted);cursor:pointer;font-size:12px;max-width:min(44vw,360px);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:0 1 auto;}
|
|
1345
1348
|
.dshgt-id-pkg:hover{color:var(--gt-fg);background:color-mix(in srgb,var(--gt-fg) 5%,var(--gt-bg));}
|
|
1346
|
-
.dshgt-idbar-
|
|
1349
|
+
.dshgt-idbar-actions{margin-left:auto;position:relative;display:flex;align-items:center;gap:10px;flex:none;min-width:0;}
|
|
1347
1350
|
.dshgt-id-gh{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:6px;color:var(--gt-muted);border:1px solid transparent;flex:none;}
|
|
1348
1351
|
.dshgt-id-gh:hover{color:var(--gt-fg);background:color-mix(in srgb,var(--gt-fg) 6%,var(--gt-bg));border-color:var(--gt-border);}
|
|
1349
1352
|
/* 更新入口:版本徽标 + 纯图标刷新,作为一个整体;与 GitHub 图标同形制 */
|
|
@@ -1355,8 +1358,14 @@ var CSS = `
|
|
|
1355
1358
|
transition:background .12s ease,border-color .12s ease;}
|
|
1356
1359
|
.dshgt-ver-badge:hover{background:color-mix(in srgb,var(--gt-warn) 12%,transparent);border-color:color-mix(in srgb,var(--gt-warn) 60%,transparent);}
|
|
1357
1360
|
.dshgt-ver-badge:focus-visible{outline:2px solid var(--gt-accent);outline-offset:1px;}
|
|
1358
|
-
/*
|
|
1359
|
-
.dshgt-
|
|
1361
|
+
/* 纯图标刷新:与 dsh-skills-console 的 .dshsc-tool 逐项一致(尺寸/圆角/无边框/hover 层2底),
|
|
1362
|
+
状态另由图标颜色 + 角标 + 旋转表达,文案走 title(tooltip)。独立成类,不再继承 .dshgt-id-gh。 */
|
|
1363
|
+
.dshgt-refresh{position:relative;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;
|
|
1364
|
+
width:26px;height:26px;padding:0;border:0;border-radius:7px;background:transparent;color:var(--gt-muted);
|
|
1365
|
+
cursor:pointer;text-decoration:none;transition:background .12s ease,color .12s ease;flex:none;}
|
|
1366
|
+
.dshgt-refresh:hover{background:var(--dsw-alias-bg-layer-2);color:var(--gt-fg);}
|
|
1367
|
+
.dshgt-refresh:focus-visible{outline:2px solid var(--gt-accent);outline-offset:1px;}
|
|
1368
|
+
.dshgt-refresh[aria-expanded="true"]{background:var(--dsw-alias-bg-layer-2);color:var(--gt-fg);}
|
|
1360
1369
|
.dshgt-refresh svg{display:block;transition:color .12s ease;}
|
|
1361
1370
|
.dshgt-refresh[data-state="available"]{color:var(--gt-warn);}
|
|
1362
1371
|
.dshgt-refresh[data-state="available"]::after{content:"";position:absolute;top:3px;right:3px;width:6px;height:6px;border-radius:50%;background:var(--gt-warn);box-shadow:0 0 0 1.5px var(--gt-bg);}
|
|
@@ -1464,6 +1473,8 @@ var CSS = `
|
|
|
1464
1473
|
.dshgt-seg button.on{background:var(--gt-card);color:var(--gt-fg);font-weight:600;white-space:nowrap;}
|
|
1465
1474
|
.dshgt-digest-doc{padding:26px 32px 22px;min-width:0;}
|
|
1466
1475
|
.dshgt-doc-meta{display:flex;gap:12px;flex-wrap:wrap;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;color:var(--gt-muted);padding-bottom:12px;border-bottom:1px solid color-mix(in srgb,var(--gt-border) 70%,transparent);}
|
|
1476
|
+
.dshgt-degraded-badge{display:flex;align-items:center;gap:8px;margin:0 0 12px;padding:9px 12px;border:1px solid color-mix(in srgb,var(--gt-warn,#c08a00) 45%,var(--gt-border));border-radius:8px;font-size:12px;line-height:1.5;color:var(--gt-fg);background:color-mix(in srgb,var(--gt-warn,#c08a00) 12%,transparent);}
|
|
1477
|
+
.dshgt-degraded-icon{font-size:14px;line-height:1;}
|
|
1467
1478
|
.dshgt-digest-raw{margin:0;padding:22px 28px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.75;white-space:pre-wrap;word-break:break-word;color:var(--gt-muted);background:color-mix(in srgb,var(--gt-fg) 2.5%,var(--gt-card));max-height:640px;overflow:auto;}
|
|
1468
1479
|
.dshgt-digest-loading{padding:40px 28px;color:var(--gt-muted);font-size:13px;}
|
|
1469
1480
|
.dshgt-digest-empty{padding:42px 36px 46px;}
|
|
@@ -2722,13 +2733,6 @@ function SettingsView(props) {
|
|
|
2722
2733
|
)
|
|
2723
2734
|
)
|
|
2724
2735
|
),
|
|
2725
|
-
h(
|
|
2726
|
-
Row,
|
|
2727
|
-
{ label: t("scope.topN") },
|
|
2728
|
-
h(Input, { mono: true, width: 70, value: String(draft.trending.topN), onInput: (value) => update((next) => {
|
|
2729
|
-
next.trending.topN = Math.round(Number(value) || 0);
|
|
2730
|
-
}) })
|
|
2731
|
-
),
|
|
2732
2736
|
h(
|
|
2733
2737
|
Row,
|
|
2734
2738
|
{ label: t("scope.languages") },
|
|
@@ -3777,6 +3781,10 @@ var FILTERS = [
|
|
|
3777
3781
|
{ id: "failed", key: "runs.filter.failed" },
|
|
3778
3782
|
{ id: "dry", key: "runs.filter.dry" }
|
|
3779
3783
|
];
|
|
3784
|
+
function isDegradedRecord(record) {
|
|
3785
|
+
if (!record.ok || record.skipped) return false;
|
|
3786
|
+
return Array.isArray(record.warnings) && record.warnings.some((w) => w.includes("降级"));
|
|
3787
|
+
}
|
|
3780
3788
|
function recordSummary(t, record) {
|
|
3781
3789
|
if (!record.ok) {
|
|
3782
3790
|
return [record.errorCode, record.errorMessage].filter((item) => item !== void 0 && item !== "").join(" · ") || t("state.failed");
|
|
@@ -3922,7 +3930,8 @@ function RunsView(props) {
|
|
|
3922
3930
|
record.kind === "dry-run" ? t("state.dry") : record.skipped ? t("state.skipped") : record.ok ? t("state.ok") : t("state.failed"),
|
|
3923
3931
|
h("span", { className: "dshgt-run-muted" }, recordSummary(t, record)),
|
|
3924
3932
|
record.legacy === true ? h("span", { className: "dshgt-tag dshgt-inline-tag" }, t("runs.legacy")) : null,
|
|
3925
|
-
record.forced === true ? h("span", { className: "dshgt-tag dshgt-inline-tag" }, t("run.forced.tag")) : null
|
|
3933
|
+
record.forced === true ? h("span", { className: "dshgt-tag dshgt-inline-tag" }, t("run.forced.tag")) : null,
|
|
3934
|
+
isDegradedRecord(record) ? h("span", { className: "dshgt-tag dshgt-inline-tag dshgt-tag-warn" }, t("runs.degraded.tag")) : null
|
|
3926
3935
|
),
|
|
3927
3936
|
h("span", { className: "dshgt-run-files" }, t("runs.files", { count: record.files })),
|
|
3928
3937
|
record.tokens === void 0 ? null : h("span", { className: "dshgt-run-tokens dshgt-mono", title: t("run.usage.tokens") }, `${formatTokens(record.tokens)} tok`),
|
|
@@ -4822,6 +4831,7 @@ function DigestView(props) {
|
|
|
4822
4831
|
rendered === null ? null : h(
|
|
4823
4832
|
import_react.default.Fragment,
|
|
4824
4833
|
null,
|
|
4834
|
+
rendered.meta.degraded === "true" ? degradedBadge(t) : null,
|
|
4825
4835
|
metaLine(rendered),
|
|
4826
4836
|
h("div", { className: "dshgt-md" }, rendered.nodes)
|
|
4827
4837
|
)
|
|
@@ -4830,6 +4840,14 @@ function DigestView(props) {
|
|
|
4830
4840
|
)
|
|
4831
4841
|
);
|
|
4832
4842
|
}
|
|
4843
|
+
function degradedBadge(t) {
|
|
4844
|
+
return h(
|
|
4845
|
+
"div",
|
|
4846
|
+
{ className: "dshgt-degraded-badge", role: "note" },
|
|
4847
|
+
h("span", { className: "dshgt-degraded-icon" }, "⚠️"),
|
|
4848
|
+
h("span", null, t("digest.degraded.badge"))
|
|
4849
|
+
);
|
|
4850
|
+
}
|
|
4833
4851
|
function metaLine(rendered) {
|
|
4834
4852
|
const entries = META_KEYS.filter((key) => rendered.meta[key] !== void 0 && rendered.meta[key] !== "");
|
|
4835
4853
|
if (entries.length === 0) return null;
|
|
@@ -5674,6 +5692,47 @@ function AboutDialog(props) {
|
|
|
5674
5692
|
|
|
5675
5693
|
// node_modules/@morehao/dsh-plugin-kit/dist/update-client.js
|
|
5676
5694
|
var IDLE = { status: "idle", view: null, error: null };
|
|
5695
|
+
function deriveUpdateUiState(state) {
|
|
5696
|
+
const { status, view } = state;
|
|
5697
|
+
const busy = status === "checking" || status === "applying";
|
|
5698
|
+
const settled = status === "restart-required" || status === "applied";
|
|
5699
|
+
const updateAvailable = view !== null && view.updateAvailable;
|
|
5700
|
+
const canApply = view !== null && view.canApply;
|
|
5701
|
+
const latestVersion = view === null ? null : view.latestVersion ?? null;
|
|
5702
|
+
let visual;
|
|
5703
|
+
if (busy) visual = "checking";
|
|
5704
|
+
else if (settled) visual = "ok-flash";
|
|
5705
|
+
else if (status === "failed" || view !== null && view.checkFailed) visual = "error";
|
|
5706
|
+
else if (updateAvailable) visual = "available";
|
|
5707
|
+
else visual = "latest";
|
|
5708
|
+
const actionable = updateAvailable && canApply && !busy && !settled;
|
|
5709
|
+
const showBadge = visual === "available" && !busy && !settled && canApply && latestVersion !== null;
|
|
5710
|
+
return {
|
|
5711
|
+
visual,
|
|
5712
|
+
busy,
|
|
5713
|
+
settled,
|
|
5714
|
+
actionable,
|
|
5715
|
+
showBadge,
|
|
5716
|
+
badgeVersion: showBadge ? latestVersion : null,
|
|
5717
|
+
canApply
|
|
5718
|
+
};
|
|
5719
|
+
}
|
|
5720
|
+
function updateStatusLabel(state) {
|
|
5721
|
+
const { status, view } = state;
|
|
5722
|
+
const latest = view?.latestVersion ?? "";
|
|
5723
|
+
const current = view?.currentVersion ?? "";
|
|
5724
|
+
if (status === "checking" || view === null || status === "idle") {
|
|
5725
|
+
return { key: "checking", params: {} };
|
|
5726
|
+
}
|
|
5727
|
+
if (status === "applying") return { key: "applying", params: { version: latest } };
|
|
5728
|
+
if (status === "restart-required" || status === "applied") return { key: "done", params: { version: latest } };
|
|
5729
|
+
if (status === "failed") {
|
|
5730
|
+
return state.error?.code === "CHECK_FAILED" ? { key: "checkFailed", params: {} } : { key: "failed", params: {} };
|
|
5731
|
+
}
|
|
5732
|
+
if (view.checkFailed) return { key: "checkFailed", params: {} };
|
|
5733
|
+
if (view.updateAvailable) return { key: "available", params: { latest } };
|
|
5734
|
+
return { key: "latest", params: { version: current } };
|
|
5735
|
+
}
|
|
5677
5736
|
function errorOf(error) {
|
|
5678
5737
|
if (error !== null && typeof error === "object") {
|
|
5679
5738
|
const value = error;
|
|
@@ -5915,26 +5974,25 @@ function IdentityBar(props) {
|
|
|
5915
5974
|
const [confirming, setConfirming] = import_react.default.useState(false);
|
|
5916
5975
|
const [updateState, controller] = usePluginUpdate();
|
|
5917
5976
|
const view = updateState.view;
|
|
5918
|
-
const status = updateState.status;
|
|
5919
|
-
const busy = status === "checking" || status === "applying";
|
|
5920
|
-
const settled = status === "restart-required" || status === "applied";
|
|
5921
5977
|
const latestVersion = view === null ? "" : view.latestVersion ?? "";
|
|
5922
|
-
const updateAvailable = view !== null && view.updateAvailable;
|
|
5923
|
-
const actionable = updateAvailable && view !== null && view.canApply && !busy && !settled;
|
|
5924
5978
|
const currentVersion = view === null ? plugin.version : view.currentVersion ?? plugin.version;
|
|
5979
|
+
const ui = deriveUpdateUiState(updateState);
|
|
5980
|
+
const label = updateStatusLabel(updateState);
|
|
5981
|
+
const busy = ui.busy;
|
|
5982
|
+
const actionable = ui.actionable;
|
|
5925
5983
|
import_react.default.useEffect(() => {
|
|
5926
|
-
if (!
|
|
5927
|
-
}, [
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
}
|
|
5937
|
-
const st =
|
|
5984
|
+
if (!actionable) setConfirming(false);
|
|
5985
|
+
}, [actionable]);
|
|
5986
|
+
const LABEL_COPY = {
|
|
5987
|
+
checking: t("shell.update.checking"),
|
|
5988
|
+
applying: t("shell.update.applying", { version: label.params.version ?? "" }),
|
|
5989
|
+
available: t("shell.update.available", { latest: label.params.latest ?? "" }),
|
|
5990
|
+
latest: t("shell.update.latest", { version: label.params.version ?? "" }),
|
|
5991
|
+
done: t("shell.update.done", { version: label.params.version ?? "" }),
|
|
5992
|
+
checkFailed: t("shell.update.checkFailed"),
|
|
5993
|
+
failed: t("shell.update.failed")
|
|
5994
|
+
};
|
|
5995
|
+
const st = { state: ui.visual, tip: LABEL_COPY[label.key] ?? t("shell.update.latest", { version: currentVersion }) };
|
|
5938
5996
|
function onRefreshClick() {
|
|
5939
5997
|
if (busy) return;
|
|
5940
5998
|
if (actionable) {
|
|
@@ -5948,7 +6006,7 @@ function IdentityBar(props) {
|
|
|
5948
6006
|
writePendingUpdate(currentVersion, latestVersion);
|
|
5949
6007
|
void controller.apply();
|
|
5950
6008
|
}
|
|
5951
|
-
const showBadge =
|
|
6009
|
+
const showBadge = ui.showBadge;
|
|
5952
6010
|
const confirmOpen = confirming && actionable;
|
|
5953
6011
|
return h(
|
|
5954
6012
|
"div",
|
|
@@ -5961,13 +6019,10 @@ function IdentityBar(props) {
|
|
|
5961
6019
|
{ type: "button", className: "dshgt-id-pkg dshgt-mono", title: t("about.title"), onClick: () => props.onOpenAbout() },
|
|
5962
6020
|
plugin.name
|
|
5963
6021
|
),
|
|
5964
|
-
|
|
5965
|
-
h("span", { key: "gh-sep", className: "dshgt-id-sep dshgt-id-sep-gh" }),
|
|
5966
|
-
h("a", { key: "gh", className: "dshgt-id-gh", href: plugin.repository, target: "_blank", rel: "noreferrer", title: t("about.repo"), "aria-label": t("about.repo") }, githubIcon())
|
|
5967
|
-
],
|
|
6022
|
+
// 更新入口:版本徽标 + 纯图标刷新,放在 GitHub 图标左侧、与之一组右对齐。
|
|
5968
6023
|
h(
|
|
5969
6024
|
"div",
|
|
5970
|
-
{ className: "dshgt-idbar-
|
|
6025
|
+
{ className: "dshgt-idbar-actions" },
|
|
5971
6026
|
h(
|
|
5972
6027
|
"div",
|
|
5973
6028
|
{ className: "dshgt-upd-unit" },
|
|
@@ -5986,7 +6041,7 @@ function IdentityBar(props) {
|
|
|
5986
6041
|
"button",
|
|
5987
6042
|
{
|
|
5988
6043
|
type: "button",
|
|
5989
|
-
className: "dshgt-
|
|
6044
|
+
className: "dshgt-refresh",
|
|
5990
6045
|
"data-state": st.state,
|
|
5991
6046
|
disabled: busy,
|
|
5992
6047
|
title: st.tip,
|
|
@@ -5997,6 +6052,10 @@ function IdentityBar(props) {
|
|
|
5997
6052
|
refreshIcon()
|
|
5998
6053
|
)
|
|
5999
6054
|
),
|
|
6055
|
+
plugin.repository === void 0 ? null : [
|
|
6056
|
+
h("span", { key: "gh-sep", className: "dshgt-id-sep dshgt-id-sep-gh" }),
|
|
6057
|
+
h("a", { key: "gh", className: "dshgt-id-gh", href: plugin.repository, target: "_blank", rel: "noreferrer", title: t("about.repo"), "aria-label": t("about.repo") }, githubIcon())
|
|
6058
|
+
],
|
|
6000
6059
|
confirmOpen ? h(
|
|
6001
6060
|
"div",
|
|
6002
6061
|
{ className: "dshgt-confirm-pop", role: "dialog", "aria-label": t("shell.update.confirmHint") },
|
|
@@ -58,7 +58,7 @@ var DEFAULT_SETTINGS = {
|
|
|
58
58
|
labels: []
|
|
59
59
|
},
|
|
60
60
|
github: { authMode: "gh", tokenRef: "GITHUB_TOKEN" },
|
|
61
|
-
trending: { since: "daily", languages: ["all", "typescript", "python", "go", "rust"]
|
|
61
|
+
trending: { since: "daily", languages: ["all", "typescript", "python", "go", "rust"] },
|
|
62
62
|
summarize: {
|
|
63
63
|
batchSize: 10,
|
|
64
64
|
maxRetries: 1,
|
|
@@ -211,8 +211,7 @@ function normalizeSettings(input) {
|
|
|
211
211
|
},
|
|
212
212
|
trending: {
|
|
213
213
|
since: isPeriod(since) ? since : "daily",
|
|
214
|
-
languages: strArray(trending.languages, DEFAULT_SETTINGS.trending.languages)
|
|
215
|
-
topN: Math.round(num(trending.topN, DEFAULT_SETTINGS.trending.topN))
|
|
214
|
+
languages: strArray(trending.languages, DEFAULT_SETTINGS.trending.languages)
|
|
216
215
|
},
|
|
217
216
|
summarize: {
|
|
218
217
|
batchSize: Math.round(num(summarize.batchSize, DEFAULT_SETTINGS.summarize.batchSize)),
|
|
@@ -308,9 +307,6 @@ function validateSettings(settings, providers = CORE_PROVIDERS) {
|
|
|
308
307
|
} else if (!path.isAbsolute(repo.path)) {
|
|
309
308
|
problems.push({ field: "repo.path", code: "CONFIG_INVALID", message: "\u4ED3\u5E93\u8DEF\u5F84\u5FC5\u987B\u662F\u7EDD\u5BF9\u8DEF\u5F84" });
|
|
310
309
|
}
|
|
311
|
-
if (!Number.isInteger(trending.topN) || trending.topN <= 0) {
|
|
312
|
-
problems.push({ field: "trending.topN", code: "CONFIG_INVALID", message: "\u6BCF\u8BED\u8A00\u6761\u6570\u5FC5\u987B\u662F\u6B63\u6574\u6570" });
|
|
313
|
-
}
|
|
314
310
|
if (!isEnrich(summarize.enrich)) {
|
|
315
311
|
problems.push({ field: "summarize.enrich", code: "CONFIG_INVALID", message: "enrich \u5FC5\u987B\u662F none / repo / readme" });
|
|
316
312
|
}
|
|
@@ -401,8 +397,7 @@ function toCoreConfig(settings, apiKey, baseURLOverride, period, repoCount = 0)
|
|
|
401
397
|
},
|
|
402
398
|
trending: {
|
|
403
399
|
languages: settings.trending.languages,
|
|
404
|
-
since: period ?? settings.trending.since
|
|
405
|
-
perLanguage: settings.trending.topN
|
|
400
|
+
since: period ?? settings.trending.since
|
|
406
401
|
},
|
|
407
402
|
summarize: {
|
|
408
403
|
batchSize: settings.summarize.batchSize,
|
|
@@ -3972,9 +3967,6 @@ function importFromCli(filePath, base = DEFAULT_SETTINGS) {
|
|
|
3972
3967
|
take(imported, "trending.since", asString(trending.since), (value) => {
|
|
3973
3968
|
patch.trending.since = value === "weekly" ? "weekly" : "daily";
|
|
3974
3969
|
});
|
|
3975
|
-
take(imported, "trending.perLanguage", asNumber(trending.perLanguage), (value) => {
|
|
3976
|
-
patch.trending.topN = Math.round(value);
|
|
3977
|
-
});
|
|
3978
3970
|
take(imported, "output.dir", asString(output.dir), (value) => {
|
|
3979
3971
|
patch.output.dir = value;
|
|
3980
3972
|
});
|
package/lib/index.js
CHANGED
package/lib/internal.d.ts
CHANGED
|
@@ -262,7 +262,6 @@ interface GithubSettings {
|
|
|
262
262
|
interface TrendingSettings {
|
|
263
263
|
since: Since;
|
|
264
264
|
languages: string[];
|
|
265
|
-
topN: number;
|
|
266
265
|
}
|
|
267
266
|
interface OutputSettings {
|
|
268
267
|
dir: string;
|
|
@@ -413,7 +412,6 @@ interface CoreConfig {
|
|
|
413
412
|
trending: {
|
|
414
413
|
languages: string[];
|
|
415
414
|
since: string;
|
|
416
|
-
perLanguage: number;
|
|
417
415
|
};
|
|
418
416
|
summarize: {
|
|
419
417
|
batchSize: number;
|
package/lib/internal.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morehao/dsh-github-trending",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.15",
|
|
4
4
|
"description": "GitHub 趋势日报的 DeepSeek Harness 插件:按日 / 周 / 月周期定时 spawn 本地 trendradar 核心,抓取 Trending、生成中文简介与周期总结,并可选把订阅仓库的新 Release 合成中文摘要,一起提交到你的仓库、自动开 PR 合并;内置概览 / 榜单 / 运行记录 / 订阅 / 设置工作台。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@morehao/dsh-plugin-kit": "^0.4.
|
|
54
|
+
"@morehao/dsh-plugin-kit": "^0.4.1",
|
|
55
55
|
"@morehao/trendradar-contract": "0.5.0"
|
|
56
56
|
},
|
|
57
57
|
"dsh": {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"core": {
|
|
62
62
|
"repo": "morehao/trendradar",
|
|
63
|
-
"version": "0.8.
|
|
63
|
+
"version": "0.8.4"
|
|
64
64
|
},
|
|
65
65
|
"client": {
|
|
66
66
|
"platform": "web",
|