@morehao/dsh-github-trending 0.5.0 → 0.5.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/CHANGELOG.md +11 -0
- package/README.md +4 -5
- package/client.js +73 -57
- package/lib/{chunk-WFCULY72.js → chunk-R7EUBUTS.js} +2 -3
- package/lib/index.js +1 -1
- package/lib/internal.d.ts +3 -2
- package/lib/internal.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [v0.5.1] - 2026-10-31
|
|
4
|
+
|
|
5
|
+
### 变更
|
|
6
|
+
|
|
7
|
+
- **设置页字段改用 `?` 悬浮说明**:「摘要与用量」「发版订阅」两个分区的每个字段旁加问号(鼠标悬停或键盘聚焦展开),并移除两张卡片底部的整段说明文字。
|
|
8
|
+
- **发版订阅常开**:移除 `releases.enabled` 开关(设置页不再有「启用发版订阅」),写入核心配置时恒为 `true`;是否有产出只由订阅列表决定,列表为空时不产出、榜单产物不变。「订阅」页同步去掉开关状态提示。
|
|
9
|
+
|
|
10
|
+
### 修复
|
|
11
|
+
|
|
12
|
+
- **设置页操作回执自动收起**:保存 / 导入成功提示 5 秒后自动消失;失败提示保留到下一次操作。
|
|
13
|
+
|
|
3
14
|
## [v0.5.0] - 2026-10-31
|
|
4
15
|
|
|
5
16
|
### 新增
|
package/README.md
CHANGED
|
@@ -52,12 +52,12 @@ dsh plugin --profile <profile> add @morehao/dsh-github-trending
|
|
|
52
52
|
|
|
53
53
|
## 发版订阅
|
|
54
54
|
|
|
55
|
-
- 订阅一组仓库,之后每次运行把每个仓库「**新增的 Release**(无 Release 时回退 Tag)」写成中文 changelog,渲染到 `<output.dir>/releases/`,与榜单**同分支、同 PR**
|
|
55
|
+
- 订阅一组仓库,之后每次运行把每个仓库「**新增的 Release**(无 Release 时回退 Tag)」写成中文 changelog,渲染到 `<output.dir>/releases/`,与榜单**同分支、同 PR** 一起提交。发版阶段**常开**;没有订阅时不产出,既有榜单产物逐字节不变。
|
|
56
56
|
- **订阅列表随数据仓版本化**:文件在 `<repo>/<OutputRoot(output.dir)>/subscriptions.yaml`,随产物同一次 commit / PR,可审计、可复现。
|
|
57
57
|
- **插件不直接写仓**:列表经核心 `subscribe` IPC 命令读改——`add` / `remove` 只写 `.git/trendradar-subscriptions.pending`,下一次 `run` 切分支后落盘并随 artifact 提交。插件侧的子进程只做一次 stdin 交互:`RunRequest{command:"subscribe", action, repo?, configPath}`,`list` 的仓库由核心 stdout 逐行返回后插件解析。`configPath` 由插件生成(与 `run` 同源的临时配置),保证 `subscribe` 与 `run` 解析到同一个订阅文件。
|
|
58
|
-
-
|
|
58
|
+
- 界面:「订阅」页管理列表(增删);「设置 → 发版订阅」分区放行为参数(含预发布 / 含草稿 / notes 截断,字段旁 `?` 悬浮说明),以及「管理订阅列表 →」入口。
|
|
59
59
|
- 周期独立:`releases.period` 默认 `daily`,不与 `trending.since` 联动。
|
|
60
|
-
- 历史里每条运行记录带 `releases` 摘要(仓库数 / 新发版 / 已摘要 / 降级 / 失败 / 跳过)与本次 `tokens
|
|
60
|
+
- 历史里每条运行记录带 `releases` 摘要(仓库数 / 新发版 / 已摘要 / 降级 / 失败 / 跳过)与本次 `tokens`;旧核心没有 `releases` 块时缺省。
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
|
|
@@ -115,8 +115,7 @@ dsh plugin --profile <profile> add @morehao/dsh-github-trending
|
|
|
115
115
|
| `summarize.batchSize` / `maxRetries` | `10` / `1` | 摘要批量与失败重试(映射核心 `summarize.*`) |
|
|
116
116
|
| `summarize.enrich` | `none` | `none` / `repo` / `readme`:是否抓取 GitHub topics / README 作为增强上下文;`repo`/`readme` 建议配只读 `GITHUB_READ_TOKEN` |
|
|
117
117
|
| `summarize.readmeChars` | `800` | README 摘录长度(enrich=readme 时) |
|
|
118
|
-
| `releases.
|
|
119
|
-
| `releases.includePrerelease` / `includeDrafts` | `false` / `false` | 是否含预发布 / 草稿 |
|
|
118
|
+
| `releases.includePrerelease` / `includeDrafts` | `false` / `false` | 是否含预发布 / 草稿(发版阶段常开,不提供 `enabled` 开关) |
|
|
120
119
|
| `releases.fallbackToTags` / `baselineOnFirstRun` | `true` / `true` | 无 Release 时回退 Tag / 首次只记基线 |
|
|
121
120
|
| `releases.perRepoLimit` / `maxNotesChars` | `5` / `4000` | 每仓单次上限(1–20)/ notes 截断(500–20000) |
|
|
122
121
|
| `releases.period` | `daily` | 发版摘要周期(独立,不与 `trending.since` 联动) |
|
package/client.js
CHANGED
|
@@ -393,30 +393,28 @@ var DICT = {
|
|
|
393
393
|
"card.summarize.title": "摘要与用量",
|
|
394
394
|
"card.summarize.hint": "对应核心 summarize.*(core 0.4.1+)",
|
|
395
395
|
"summarize.batchSize": "批量大小",
|
|
396
|
+
"summarize.batchSize.help": "每次模型调用处理的仓库数;批次越大速度越快,单次提示词也越长。",
|
|
396
397
|
"summarize.maxRetries": "失败重试",
|
|
398
|
+
"summarize.maxRetries.help": "单批摘要失败后的额外重试次数;0 表示不重试,仍失败按降级策略处理。",
|
|
397
399
|
"summarize.enrich": "外部增强",
|
|
400
|
+
"summarize.enrich.help": "摘要前补充外部上下文:repo 抓取 GitHub topics,readme 再摘录 README;需要只读 token。",
|
|
398
401
|
"summarize.enrich.none": "不增强",
|
|
399
402
|
"summarize.enrich.repo": "仓库(含 GitHub topics)",
|
|
400
403
|
"summarize.enrich.readme": "仓库(含 README 摘录)",
|
|
401
404
|
"summarize.readmeChars": "README 摘录长度",
|
|
405
|
+
"summarize.readmeChars.help": "enrich 为 readme 时,每个仓库 README 摘录的最大字符数(超出截断)。",
|
|
402
406
|
"summarize.enrichNote": "外部增强需要只读 token:enrich=repo/readme 建议配置 GITHUB_READ_TOKEN(独立只读);readme 模式在网络慢时可能因预算耗尽跳过部分仓库(自动降级,不影响运行)。",
|
|
403
|
-
"summarize.usageNote": "用量展示在「运行记录 + 历史」,本页只放摘要生成参数。插件不做费用估算、不内置定价表(价格随 provider/区域变动):Usage 的 token 真值直接展示在运行结果与历史。",
|
|
404
407
|
"card.releases.title": "发版订阅",
|
|
405
408
|
"card.releases.hint": "对应核心 releases.*(core 0.5.0+)",
|
|
406
|
-
"releases.enabled": "启用发版订阅",
|
|
407
|
-
"releases.enabled.hint": "保存后与 trending 合并进同一分支/PR",
|
|
408
409
|
"releases.includePrerelease": "含预发布",
|
|
410
|
+
"releases.includePrerelease.help": "GitHub 上标记为 pre-release 的版本也计入新发版。",
|
|
409
411
|
"releases.includeDrafts": "含草稿",
|
|
412
|
+
"releases.includeDrafts.help": "草稿(draft)Release 也计入;草稿只有写权限的 token 才看得到。",
|
|
410
413
|
"releases.notesChars": "notes 截断",
|
|
414
|
+
"releases.notesChars.help": "单个 Release notes 的截断长度,避免提示词过长(500–20000)。",
|
|
411
415
|
"releases.manage": "管理订阅列表 →",
|
|
412
|
-
"releases.note": "订阅列表不在此卡片编辑,跳到「订阅」页管理;列表在数据仓 <output.dir>/subscriptions.yaml,随产物版本化。",
|
|
413
416
|
"subs.title": "仓库发版订阅",
|
|
414
|
-
"subs.desc": "订阅后,每次运行会把每个仓库「新增的 Release(无 Release 时回退 Tag)」写成中文 changelog,渲染到 <output.dir>/releases/,与榜单同分支同 PR
|
|
415
|
-
"subs.enabled": "订阅开关:{state}",
|
|
416
|
-
"subs.on": "已开启",
|
|
417
|
-
"subs.off": "未开启",
|
|
418
|
-
"subs.disabled.title": "发版订阅当前关闭",
|
|
419
|
-
"subs.disabled.hint": "在设置页「发版订阅」分区打开后,订阅列表才会在运行中生效。",
|
|
417
|
+
"subs.desc": "订阅后,每次运行会把每个仓库「新增的 Release(无 Release 时回退 Tag)」写成中文 changelog,渲染到 <output.dir>/releases/,与榜单同分支同 PR;没有订阅时不产出、也不改动榜单产物。",
|
|
420
418
|
"subs.add": "添加仓库",
|
|
421
419
|
"subs.add.hint": "添加订阅(owner/repo,一个或多个,逗号/空格分隔)",
|
|
422
420
|
"subs.add.placeholder": "denoland/deno",
|
|
@@ -801,30 +799,28 @@ var DICT = {
|
|
|
801
799
|
"card.summarize.title": "Summary & usage",
|
|
802
800
|
"card.summarize.hint": "Maps to core summarize.* (core 0.4.1+)",
|
|
803
801
|
"summarize.batchSize": "Batch size",
|
|
802
|
+
"summarize.batchSize.help": "Repos per model call; larger batches run faster but make each prompt longer.",
|
|
804
803
|
"summarize.maxRetries": "Retries",
|
|
804
|
+
"summarize.maxRetries.help": "Extra retries per failed batch; 0 disables retry, and a batch that still fails follows the degrade policy.",
|
|
805
805
|
"summarize.enrich": "Enrich",
|
|
806
|
+
"summarize.enrich.help": "Adds external context before summarizing: repo fetches GitHub topics, readme also excerpts the README. Requires a read-only token.",
|
|
806
807
|
"summarize.enrich.none": "None",
|
|
807
808
|
"summarize.enrich.repo": "Repo (+GitHub topics)",
|
|
808
809
|
"summarize.enrich.readme": "Repo (+README excerpt)",
|
|
809
810
|
"summarize.readmeChars": "README excerpt chars",
|
|
811
|
+
"summarize.readmeChars.help": "Max README characters excerpted per repo when enrich=readme (longer text is truncated).",
|
|
810
812
|
"summarize.enrichNote": "Enrich needs a read-only token: enrich=repo/readme is best paired with GITHUB_READ_TOKEN (separate, read-only). In readme mode slow networks may skip some repos when the budget runs out (auto-degrades; the run is unaffected).",
|
|
811
|
-
"summarize.usageNote": "Usage is shown on Runs + History; this page only holds summary-generation parameters. The plugin does no cost estimation and ships no price list (prices vary by provider/region): the Usage token truth is shown directly in run results and history.",
|
|
812
813
|
"card.releases.title": "Releases",
|
|
813
814
|
"card.releases.hint": "Maps to core releases.* (core 0.5.0+)",
|
|
814
|
-
"releases.enabled": "Enable releases",
|
|
815
|
-
"releases.enabled.hint": "Saved alongside trending into the same branch/PR",
|
|
816
815
|
"releases.includePrerelease": "Include pre-releases",
|
|
816
|
+
"releases.includePrerelease.help": "Releases marked as pre-release on GitHub also count as new releases.",
|
|
817
817
|
"releases.includeDrafts": "Include drafts",
|
|
818
|
+
"releases.includeDrafts.help": "Draft releases also count; drafts are only visible to tokens with write access.",
|
|
818
819
|
"releases.notesChars": "Notes truncate",
|
|
820
|
+
"releases.notesChars.help": "Truncate each release notes to this length to keep prompts bounded (500–20000).",
|
|
819
821
|
"releases.manage": "Manage subscriptions →",
|
|
820
|
-
"releases.note": "The subscription list is not edited on this card; manage it on the Subscriptions page. The list lives in the data repo at <output.dir>/subscriptions.yaml, versioned with artifacts.",
|
|
821
822
|
"subs.title": "Repo release subscriptions",
|
|
822
|
-
"subs.desc": "Once subscribed, each run writes every repo's new releases (falling back to tags) as a Chinese changelog rendered under <output.dir>/releases/, in the same branch/PR as the board.
|
|
823
|
-
"subs.enabled": "Subscriptions: {state}",
|
|
824
|
-
"subs.on": "On",
|
|
825
|
-
"subs.off": "Off",
|
|
826
|
-
"subs.disabled.title": "Releases are currently off",
|
|
827
|
-
"subs.disabled.hint": "Turn on Releases in the settings page; the subscription list only takes effect during a run after that.",
|
|
823
|
+
"subs.desc": "Once subscribed, each run writes every repo's new releases (falling back to tags) as a Chinese changelog rendered under <output.dir>/releases/, in the same branch/PR as the board. With no subscriptions the stage produces nothing and leaves board artifacts untouched.",
|
|
828
824
|
"subs.add": "Add repo",
|
|
829
825
|
"subs.add.hint": "Add subscriptions (owner/repo, one or more, comma/space separated)",
|
|
830
826
|
"subs.add.placeholder": "denoland/deno",
|
|
@@ -906,7 +902,13 @@ var CSS = `
|
|
|
906
902
|
.dshgt-hint{color:var(--gt-muted);font-size:12px;}
|
|
907
903
|
.dshgt-desc{margin:0;color:var(--gt-muted);font-size:12px;}
|
|
908
904
|
.dshgt-row{display:flex;gap:10px;align-items:center;min-height:28px;flex-wrap:wrap;}
|
|
909
|
-
.dshgt-row>label.dshgt-label{width:96px;color:var(--gt-muted);flex:none;font-size:12px;}
|
|
905
|
+
.dshgt-row>label.dshgt-label{width:96px;color:var(--gt-muted);flex:none;font-size:12px;display:flex;align-items:flex-start;gap:5px;}
|
|
906
|
+
.dshgt-label-text{flex:1;min-width:0;}
|
|
907
|
+
/* 字段说明:圆问号 + 纯 CSS 悬浮气泡(::after 读 data-tip),键盘聚焦同样展开。 */
|
|
908
|
+
.dshgt-help{position:relative;flex:none;margin-top:2px;width:14px;height:14px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--gt-border);border-radius:50%;background:var(--gt-bg);color:var(--gt-muted);font-size:10px;line-height:1;font-weight:600;cursor:help;user-select:none;outline:none;}
|
|
909
|
+
.dshgt-help:hover,.dshgt-help:focus-visible{color:var(--gt-fg);border-color:color-mix(in srgb,var(--gt-accent) 55%,var(--gt-border));}
|
|
910
|
+
.dshgt-help::after{content:attr(data-tip);position:absolute;left:0;top:calc(100% + 7px);z-index:30;width:max-content;max-width:280px;padding:7px 9px;border-radius:8px;background:var(--dsw-alias-bg-layer-2,var(--gt-card));color:var(--gt-fg);border:1px solid var(--gt-border);font-size:12px;font-weight:400;line-height:1.55;letter-spacing:0;text-align:left;white-space:normal;overflow-wrap:break-word;box-shadow:0 10px 26px rgba(0,0,0,.28);opacity:0;visibility:hidden;pointer-events:none;transition:opacity .12s ease,visibility .12s;}
|
|
911
|
+
.dshgt-help:hover::after,.dshgt-help:focus-visible::after{opacity:1;visibility:visible;}
|
|
910
912
|
.dshgt-inline{display:flex;gap:8px;align-items:center;flex-wrap:wrap;}
|
|
911
913
|
.dshgt-input,.dshgt-select,.dshgt-textarea{font:inherit;color:inherit;background:var(--gt-bg);border:1px solid var(--gt-border);border-radius:7px;padding:5px 8px;min-width:0;}
|
|
912
914
|
.dshgt-input:focus,.dshgt-select:focus,.dshgt-textarea:focus{outline:2px solid color-mix(in srgb,var(--gt-accent) 35%,transparent);outline-offset:1px;}
|
|
@@ -1248,11 +1250,29 @@ function Card(props) {
|
|
|
1248
1250
|
children
|
|
1249
1251
|
);
|
|
1250
1252
|
}
|
|
1253
|
+
function Help(props) {
|
|
1254
|
+
return h(
|
|
1255
|
+
"span",
|
|
1256
|
+
{
|
|
1257
|
+
className: "dshgt-help",
|
|
1258
|
+
tabIndex: 0,
|
|
1259
|
+
role: "note",
|
|
1260
|
+
"aria-label": props.text,
|
|
1261
|
+
"data-tip": props.text
|
|
1262
|
+
},
|
|
1263
|
+
"?"
|
|
1264
|
+
);
|
|
1265
|
+
}
|
|
1251
1266
|
function Row(props) {
|
|
1252
1267
|
return h(
|
|
1253
1268
|
"div",
|
|
1254
1269
|
{ className: "dshgt-row" },
|
|
1255
|
-
props.label === void 0 ? null : h(
|
|
1270
|
+
props.label === void 0 ? null : h(
|
|
1271
|
+
"label",
|
|
1272
|
+
{ className: "dshgt-label" },
|
|
1273
|
+
h("span", { className: "dshgt-label-text" }, props.label),
|
|
1274
|
+
props.help === void 0 ? null : h(Help, { text: props.help })
|
|
1275
|
+
),
|
|
1256
1276
|
props.children
|
|
1257
1277
|
);
|
|
1258
1278
|
}
|
|
@@ -1537,6 +1557,7 @@ function sectionSlice(settings, section) {
|
|
|
1537
1557
|
return { schedule: settings.schedule };
|
|
1538
1558
|
}
|
|
1539
1559
|
}
|
|
1560
|
+
var NOTICE_TTL_MS = 5e3;
|
|
1540
1561
|
function sectionEquals(a, b, section) {
|
|
1541
1562
|
return JSON.stringify(sectionSlice(a, section)) === JSON.stringify(sectionSlice(b, section));
|
|
1542
1563
|
}
|
|
@@ -1553,7 +1574,7 @@ function SettingsView(props) {
|
|
|
1553
1574
|
const [savingSection, setSavingSection] = import_react.default.useState(null);
|
|
1554
1575
|
const [savedSection, setSavedSection] = import_react.default.useState(null);
|
|
1555
1576
|
const [problems, setProblems] = import_react.default.useState([]);
|
|
1556
|
-
const [
|
|
1577
|
+
const [notice, setNotice] = import_react.default.useState(null);
|
|
1557
1578
|
const [preflight, setPreflight] = import_react.default.useState(null);
|
|
1558
1579
|
const [preflighting, setPreflighting] = import_react.default.useState(false);
|
|
1559
1580
|
const [rechecking, setRechecking] = import_react.default.useState(false);
|
|
@@ -1572,6 +1593,14 @@ function SettingsView(props) {
|
|
|
1572
1593
|
import_react.default.useEffect(() => {
|
|
1573
1594
|
setProblems([]);
|
|
1574
1595
|
}, [section]);
|
|
1596
|
+
import_react.default.useEffect(() => {
|
|
1597
|
+
if (notice === null || notice.kind !== "ok") return void 0;
|
|
1598
|
+
const timer = setTimeout(() => {
|
|
1599
|
+
setNotice((current) => current === notice ? null : current);
|
|
1600
|
+
}, NOTICE_TTL_MS);
|
|
1601
|
+
return () => clearTimeout(timer);
|
|
1602
|
+
}, [notice]);
|
|
1603
|
+
const notify = (kind, text) => setNotice({ kind, text });
|
|
1575
1604
|
const repoPath = draft === null ? "" : draft.repo.path;
|
|
1576
1605
|
import_react.default.useEffect(() => {
|
|
1577
1606
|
if (repoPath.trim() === "") {
|
|
@@ -1622,13 +1651,13 @@ function SettingsView(props) {
|
|
|
1622
1651
|
setDraft((current) => current === null ? current : applySection(current, result.settings, section2));
|
|
1623
1652
|
setDirtySections((current) => ({ ...current, [section2]: false }));
|
|
1624
1653
|
setSavedSection(section2);
|
|
1625
|
-
|
|
1654
|
+
setNotice(null);
|
|
1626
1655
|
await store.refresh({ quiet: true });
|
|
1627
1656
|
} else {
|
|
1628
1657
|
setProblems(result.problems ?? []);
|
|
1629
1658
|
}
|
|
1630
1659
|
} catch (error) {
|
|
1631
|
-
|
|
1660
|
+
notify("err", error instanceof Error ? error.message : String(error));
|
|
1632
1661
|
} finally {
|
|
1633
1662
|
setSavingSection(null);
|
|
1634
1663
|
}
|
|
@@ -1659,13 +1688,13 @@ function SettingsView(props) {
|
|
|
1659
1688
|
const downloadCore = async () => {
|
|
1660
1689
|
setDownloading(true);
|
|
1661
1690
|
setProblems([]);
|
|
1662
|
-
|
|
1691
|
+
setNotice(null);
|
|
1663
1692
|
try {
|
|
1664
1693
|
await apiCall("POST", "/core/download", {});
|
|
1665
|
-
|
|
1694
|
+
notify("ok", t("core.downloaded"));
|
|
1666
1695
|
await store.refresh({ quiet: true });
|
|
1667
1696
|
} catch (error) {
|
|
1668
|
-
|
|
1697
|
+
notify("err", error instanceof Error ? error.message : String(error));
|
|
1669
1698
|
} finally {
|
|
1670
1699
|
setDownloading(false);
|
|
1671
1700
|
}
|
|
@@ -1695,13 +1724,13 @@ function SettingsView(props) {
|
|
|
1695
1724
|
setDraft(payload.settings);
|
|
1696
1725
|
setDirtySections({ ...EMPTY_DIRTY });
|
|
1697
1726
|
setSavedSection(null);
|
|
1698
|
-
|
|
1727
|
+
notify("ok", t("settings.import.done", { fields: payload.imported.join("、") }));
|
|
1699
1728
|
await store.refresh({ quiet: true });
|
|
1700
1729
|
} else {
|
|
1701
|
-
|
|
1730
|
+
notify("err", payload.problems[0] ?? t("settings.import.empty"));
|
|
1702
1731
|
}
|
|
1703
1732
|
} catch (error) {
|
|
1704
|
-
|
|
1733
|
+
notify("err", error instanceof Error ? error.message : String(error));
|
|
1705
1734
|
}
|
|
1706
1735
|
};
|
|
1707
1736
|
const copyConfig = () => {
|
|
@@ -1711,7 +1740,7 @@ function SettingsView(props) {
|
|
|
1711
1740
|
null,
|
|
1712
1741
|
2
|
|
1713
1742
|
);
|
|
1714
|
-
void navigator.clipboard?.writeText(redacted).then(() =>
|
|
1743
|
+
void navigator.clipboard?.writeText(redacted).then(() => notify("ok", t("settings.copied")));
|
|
1715
1744
|
};
|
|
1716
1745
|
if (state === null || draft === null) {
|
|
1717
1746
|
return h("div", { className: "dshgt-root" }, h("p", { className: "dshgt-hint" }, store.error ?? t("quickfill.loading")));
|
|
@@ -1994,21 +2023,21 @@ function SettingsView(props) {
|
|
|
1994
2023
|
{ title: t("card.summarize.title"), hint: t("card.summarize.hint") },
|
|
1995
2024
|
h(
|
|
1996
2025
|
Row,
|
|
1997
|
-
{ label: t("summarize.batchSize") },
|
|
2026
|
+
{ label: t("summarize.batchSize"), help: t("summarize.batchSize.help") },
|
|
1998
2027
|
h(Input, { mono: true, width: 90, value: String(draft.summarize.batchSize), onInput: (value) => update((next) => {
|
|
1999
2028
|
next.summarize.batchSize = Math.round(Number(value) || 0);
|
|
2000
2029
|
}) })
|
|
2001
2030
|
),
|
|
2002
2031
|
h(
|
|
2003
2032
|
Row,
|
|
2004
|
-
{ label: t("summarize.maxRetries") },
|
|
2033
|
+
{ label: t("summarize.maxRetries"), help: t("summarize.maxRetries.help") },
|
|
2005
2034
|
h(Input, { mono: true, width: 90, value: String(draft.summarize.maxRetries), onInput: (value) => update((next) => {
|
|
2006
2035
|
next.summarize.maxRetries = Math.round(Number(value) || 0);
|
|
2007
2036
|
}) })
|
|
2008
2037
|
),
|
|
2009
2038
|
h(
|
|
2010
2039
|
Row,
|
|
2011
|
-
{ label: t("summarize.enrich") },
|
|
2040
|
+
{ label: t("summarize.enrich"), help: t("summarize.enrich.help") },
|
|
2012
2041
|
h(Select, {
|
|
2013
2042
|
value: draft.summarize.enrich,
|
|
2014
2043
|
options: [
|
|
@@ -2023,13 +2052,12 @@ function SettingsView(props) {
|
|
|
2023
2052
|
),
|
|
2024
2053
|
h(
|
|
2025
2054
|
Row,
|
|
2026
|
-
{ label: t("summarize.readmeChars") },
|
|
2055
|
+
{ label: t("summarize.readmeChars"), help: t("summarize.readmeChars.help") },
|
|
2027
2056
|
h(Input, { mono: true, width: 90, value: String(draft.summarize.readmeChars), onInput: (value) => update((next) => {
|
|
2028
2057
|
next.summarize.readmeChars = Math.round(Number(value) || 0);
|
|
2029
2058
|
}) })
|
|
2030
2059
|
),
|
|
2031
|
-
draft.summarize.enrich === "none" ? null : h(Alert, { kind: "warn" }, h("div", null, t("summarize.enrichNote")))
|
|
2032
|
-
h("p", { className: "dshgt-hint" }, t("summarize.usageNote"))
|
|
2060
|
+
draft.summarize.enrich === "none" ? null : h(Alert, { kind: "warn" }, h("div", null, t("summarize.enrichNote")))
|
|
2033
2061
|
);
|
|
2034
2062
|
const releasesCard = h(
|
|
2035
2063
|
Card,
|
|
@@ -2040,34 +2068,25 @@ function SettingsView(props) {
|
|
|
2040
2068
|
},
|
|
2041
2069
|
h(
|
|
2042
2070
|
Row,
|
|
2043
|
-
{ label: t("releases.
|
|
2044
|
-
h(Toggle, { checked: draft.releases.enabled, onChange: (value) => update((next) => {
|
|
2045
|
-
next.releases.enabled = value;
|
|
2046
|
-
}) }),
|
|
2047
|
-
h("span", { className: "dshgt-hint" }, t("releases.enabled.hint"))
|
|
2048
|
-
),
|
|
2049
|
-
h(
|
|
2050
|
-
Row,
|
|
2051
|
-
{ label: t("releases.includePrerelease") },
|
|
2071
|
+
{ label: t("releases.includePrerelease"), help: t("releases.includePrerelease.help") },
|
|
2052
2072
|
h(Toggle, { checked: draft.releases.includePrerelease, onChange: (value) => update((next) => {
|
|
2053
2073
|
next.releases.includePrerelease = value;
|
|
2054
2074
|
}) })
|
|
2055
2075
|
),
|
|
2056
2076
|
h(
|
|
2057
2077
|
Row,
|
|
2058
|
-
{ label: t("releases.includeDrafts") },
|
|
2078
|
+
{ label: t("releases.includeDrafts"), help: t("releases.includeDrafts.help") },
|
|
2059
2079
|
h(Toggle, { checked: draft.releases.includeDrafts, onChange: (value) => update((next) => {
|
|
2060
2080
|
next.releases.includeDrafts = value;
|
|
2061
2081
|
}) })
|
|
2062
2082
|
),
|
|
2063
2083
|
h(
|
|
2064
2084
|
Row,
|
|
2065
|
-
{ label: t("releases.notesChars") },
|
|
2085
|
+
{ label: t("releases.notesChars"), help: t("releases.notesChars.help") },
|
|
2066
2086
|
h(Input, { mono: true, width: 90, value: String(draft.releases.maxNotesChars), onInput: (value) => update((next) => {
|
|
2067
2087
|
next.releases.maxNotesChars = Math.round(Number(value) || 0);
|
|
2068
2088
|
}) })
|
|
2069
|
-
)
|
|
2070
|
-
h("p", { className: "dshgt-hint" }, t("releases.note"))
|
|
2089
|
+
)
|
|
2071
2090
|
);
|
|
2072
2091
|
const currentCard = section === "source" ? sourceCard : section === "model" ? modelCard : section === "repo" ? repoCard : section === "auth" ? authCard : section === "scope" ? scopeCard : section === "summarize" ? summarizeCard : section === "releases" ? releasesCard : scheduleCard;
|
|
2073
2092
|
return h(
|
|
@@ -2097,7 +2116,7 @@ function SettingsView(props) {
|
|
|
2097
2116
|
{ className: "dshgt-vpanel" },
|
|
2098
2117
|
currentCard,
|
|
2099
2118
|
problems.length > 0 ? h(Alert, { kind: "err", title: t("error.prefix") }, h("ul", { style: { margin: 0, paddingLeft: 16 } }, problems.map((problem, index) => h("li", { key: index }, `${problem.field}:${problem.message}`)))) : null,
|
|
2100
|
-
|
|
2119
|
+
notice === null ? null : h(Alert, { kind: notice.kind }, notice.text),
|
|
2101
2120
|
h(
|
|
2102
2121
|
"div",
|
|
2103
2122
|
{ className: "dshgt-footer" },
|
|
@@ -3764,14 +3783,13 @@ function metaLine(rendered) {
|
|
|
3764
3783
|
// client/subscriptions.ts
|
|
3765
3784
|
var REPO_PATTERN = /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;
|
|
3766
3785
|
function SubscriptionsView(props) {
|
|
3767
|
-
const { t
|
|
3786
|
+
const { t } = props;
|
|
3768
3787
|
const [repos, setRepos] = import_react.default.useState(null);
|
|
3769
3788
|
const [error, setError] = import_react.default.useState(null);
|
|
3770
3789
|
const [busy, setBusy] = import_react.default.useState(null);
|
|
3771
3790
|
const [adding, setAdding] = import_react.default.useState(false);
|
|
3772
3791
|
const [input, setInput] = import_react.default.useState("");
|
|
3773
3792
|
const [note, setNote] = import_react.default.useState(null);
|
|
3774
|
-
const enabled = store.state?.settings.releases.enabled ?? false;
|
|
3775
3793
|
const load = import_react.default.useCallback(() => {
|
|
3776
3794
|
setError(null);
|
|
3777
3795
|
getSubscriptions().then((list2) => setRepos(list2)).catch((failure) => {
|
|
@@ -3822,12 +3840,10 @@ function SubscriptionsView(props) {
|
|
|
3822
3840
|
h(
|
|
3823
3841
|
"div",
|
|
3824
3842
|
{ className: "dshgt-subs-head-actions" },
|
|
3825
|
-
h("span", { className: "dshgt-hint" }, t("subs.enabled", { state: enabled ? t("subs.on") : t("subs.off") })),
|
|
3826
3843
|
h(Btn, { small: true, variant: "primary", onClick: () => setAdding(true), disabled: busy !== null || adding }, t("subs.add"))
|
|
3827
3844
|
)
|
|
3828
3845
|
),
|
|
3829
3846
|
h("p", { className: "dshgt-desc" }, t("subs.desc")),
|
|
3830
|
-
enabled ? null : h(Alert, { kind: "warn", title: t("subs.disabled.title") }, h("div", null, t("subs.disabled.hint"))),
|
|
3831
3847
|
error === null ? null : h(Alert, { kind: "err" }, error),
|
|
3832
3848
|
note === null ? null : h(Alert, { kind: "ok" }, note),
|
|
3833
3849
|
repos === null ? h("p", { className: "dshgt-hint" }, t("subs.loading")) : list.length === 0 ? h("div", { className: "dshgt-empty" }, t("subs.empty")) : h(
|
|
@@ -4420,7 +4436,7 @@ function apply(ctx) {
|
|
|
4420
4436
|
...digestTarget2 === void 0 ? {} : { selected: digestTarget2 },
|
|
4421
4437
|
onSelect: setDigestTarget,
|
|
4422
4438
|
onOpenRuns: openRuns
|
|
4423
|
-
}) : view === "runs" ? h(RunsView, { t, store: value, controller, onOpenDigest: openDigest }) : view === "subscriptions" ? h(SubscriptionsView, { t,
|
|
4439
|
+
}) : view === "runs" ? h(RunsView, { t, store: value, controller, onOpenDigest: openDigest }) : view === "subscriptions" ? h(SubscriptionsView, { t, onOpenSettings: openSettings }) : h(SettingsView, { t, store: value, pickDirectory, onOpenSubscriptions: openSubscriptions });
|
|
4424
4440
|
return h(
|
|
4425
4441
|
"div",
|
|
4426
4442
|
{ className: "dshgt-root dshgt-shell" },
|
|
@@ -70,7 +70,6 @@ var DEFAULT_SETTINGS = {
|
|
|
70
70
|
enrichBudgetSeconds: 8
|
|
71
71
|
},
|
|
72
72
|
releases: {
|
|
73
|
-
enabled: false,
|
|
74
73
|
includePrerelease: false,
|
|
75
74
|
includeDrafts: false,
|
|
76
75
|
fallbackToTags: true,
|
|
@@ -215,7 +214,6 @@ function normalizeSettings(input) {
|
|
|
215
214
|
enrichBudgetSeconds: Math.round(num(summarize.enrichBudgetSeconds, DEFAULT_SETTINGS.summarize.enrichBudgetSeconds))
|
|
216
215
|
},
|
|
217
216
|
releases: {
|
|
218
|
-
enabled: bool(releases.enabled, DEFAULT_SETTINGS.releases.enabled),
|
|
219
217
|
includePrerelease: bool(releases.includePrerelease, DEFAULT_SETTINGS.releases.includePrerelease),
|
|
220
218
|
includeDrafts: bool(releases.includeDrafts, DEFAULT_SETTINGS.releases.includeDrafts),
|
|
221
219
|
fallbackToTags: bool(releases.fallbackToTags, DEFAULT_SETTINGS.releases.fallbackToTags),
|
|
@@ -363,7 +361,8 @@ function toCoreConfig(settings, apiKey, baseURLOverride, period) {
|
|
|
363
361
|
enrichBudgetSeconds: settings.summarize.enrichBudgetSeconds
|
|
364
362
|
},
|
|
365
363
|
releases: {
|
|
366
|
-
|
|
364
|
+
// 发版订阅常开:插件侧不再提供开关,是否产出由订阅列表决定。
|
|
365
|
+
enabled: true,
|
|
367
366
|
includePrerelease: settings.releases.includePrerelease,
|
|
368
367
|
includeDrafts: settings.releases.includeDrafts,
|
|
369
368
|
fallbackToTags: settings.releases.fallbackToTags,
|
package/lib/index.js
CHANGED
package/lib/internal.d.ts
CHANGED
|
@@ -262,12 +262,13 @@ interface SummarizeSettings {
|
|
|
262
262
|
enrichBudgetSeconds: number;
|
|
263
263
|
}
|
|
264
264
|
/**
|
|
265
|
-
*
|
|
265
|
+
* 发版订阅阶段的行为参数(核心 `releases.*`)。
|
|
266
|
+
* 阶段**常开**(`releases.enabled` 恒为 true,不出现在设置里):有没有产出只由订阅列表决定,
|
|
267
|
+
* 列表为空时核心不产出、不改动榜单产物。
|
|
266
268
|
* **订阅列表本身不落 settings.json**:它版本化在数据仓 `<output.dir>/subscriptions.yaml`,
|
|
267
269
|
* 经核心 `subscribe` IPC 读改。这里只放全局行为旋钮。
|
|
268
270
|
*/
|
|
269
271
|
interface ReleasesSettings {
|
|
270
|
-
enabled: boolean;
|
|
271
272
|
includePrerelease: boolean;
|
|
272
273
|
includeDrafts: boolean;
|
|
273
274
|
fallbackToTags: boolean;
|
package/lib/internal.js
CHANGED