@morehao/dsh-github-trending 0.8.4 → 0.8.5

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [v0.8.5] - 2026-11-02
4
+
5
+ ### Fixes
6
+
7
+ - **auth**: show device code with one-click copy
8
+
9
+ **Full Changelog**: https://github.com/morehao/dsh-github-trending/compare/v0.8.4...v0.8.5
10
+
3
11
  ## [v0.8.4] - 2026-11-02
4
12
 
5
13
  ### Features
package/client.js CHANGED
@@ -125,10 +125,13 @@ var DICT = {
125
125
  "auth.gh": "本机 gh",
126
126
  "auth.browser": "浏览器登录",
127
127
  "auth.gh.hint": "使用本机 gh 登录态:终端执行 `gh auth login` 完成登录,再点「测试认证」。",
128
- "auth.browser.hint": "在浏览器里完成 GitHub 授权,token 由 DSH 安全保存,无需手工粘贴。点一下会在浏览器打开授权页(验证码通常已自动填入),确认授权即可。",
128
+ "auth.browser.hint": "在浏览器里完成 GitHub 授权,token 由 DSH 安全保存,无需手工粘贴。点一下会打开 GitHub 验证页,把下方验证码输入并确认即可。",
129
129
  "auth.browser.signin": "用 GitHub 登录",
130
130
  "auth.browser.waiting": "等待浏览器授权…",
131
- "auth.browser.code": "如未自动填入,请手动输入验证码:",
131
+ "auth.browser.code": "验证码:",
132
+ "auth.browser.copyCode": "复制验证码",
133
+ "auth.browser.codeCopied": "验证码已复制",
134
+ "auth.browser.codeCopyFailed": "复制失败,请手动记下验证码",
132
135
  "auth.browser.cancel": "取消",
133
136
  "auth.browser.done": "已登录",
134
137
  "auth.browser.device": "用设备码登录",
@@ -670,10 +673,13 @@ var DICT = {
670
673
  "auth.gh": "Local gh",
671
674
  "auth.browser": "Browser login",
672
675
  "auth.gh.hint": "Uses your local gh login: run `gh auth login` in a terminal, then click Test authentication.",
673
- "auth.browser.hint": "Authorize GitHub in your browser; DSH stores the token securely, no manual paste. Clicking opens the authorization page with the code usually pre-filled — just confirm.",
676
+ "auth.browser.hint": "Authorize GitHub in your browser; DSH stores the token securely, no manual paste. Clicking opens the GitHub verification page — enter the code below and confirm.",
674
677
  "auth.browser.signin": "Sign in with GitHub",
675
678
  "auth.browser.waiting": "Waiting for browser authorization…",
676
- "auth.browser.code": "If it is not filled in automatically, enter this code:",
679
+ "auth.browser.code": "Verification code:",
680
+ "auth.browser.copyCode": "Copy code",
681
+ "auth.browser.codeCopied": "Code copied",
682
+ "auth.browser.codeCopyFailed": "Copy failed — please note the code manually",
677
683
  "auth.browser.cancel": "Cancel",
678
684
  "auth.browser.done": "Signed in",
679
685
  "auth.browser.device": "Use a device code",
@@ -2294,6 +2300,12 @@ function SettingsView(props) {
2294
2300
  if (signIn.authorizeUrl === void 0) return;
2295
2301
  void navigator.clipboard?.writeText(signIn.authorizeUrl).then(() => notify("ok", t("auth.browser.copied")));
2296
2302
  };
2303
+ const copyDeviceCode = () => {
2304
+ if (signIn.userCode === void 0) return;
2305
+ void copyText(signIn.userCode).then(
2306
+ (ok) => notify(ok ? "ok" : "err", ok ? t("auth.browser.codeCopied") : t("auth.browser.codeCopyFailed"))
2307
+ );
2308
+ };
2297
2309
  const signInActive = signIn.phase === "waiting-browser" || signIn.phase === "waiting-device" || signIn.phase === "exchanging";
2298
2310
  import_react.default.useEffect(() => {
2299
2311
  if (!signInActive) return void 0;
@@ -2598,7 +2610,13 @@ function SettingsView(props) {
2598
2610
  t("auth.browser.open")
2599
2611
  )
2600
2612
  ) : null,
2601
- signIn.userCode !== void 0 ? h("div", { className: "dshgt-mono" }, `${t("auth.browser.code")} ${signIn.userCode}`) : null
2613
+ signIn.userCode !== void 0 ? h(
2614
+ "div",
2615
+ { className: "dshgt-desc", style: { display: "flex", alignItems: "center", gap: "8px", flexWrap: "wrap" } },
2616
+ h("span", null, t("auth.browser.code")),
2617
+ h("span", { className: "dshgt-mono", style: { fontSize: "1.1em", fontWeight: "bold", letterSpacing: "1px" } }, signIn.userCode),
2618
+ h(Btn, { small: true, variant: "ghost", onClick: () => copyDeviceCode() }, t("auth.browser.copyCode"))
2619
+ ) : null
2602
2620
  ) : null,
2603
2621
  h(
2604
2622
  Row,
package/lib/internal.d.ts CHANGED
@@ -1260,7 +1260,11 @@ interface GithubAttemptView {
1260
1260
  phase: GithubAttemptPhase;
1261
1261
  authorizeUrl?: string;
1262
1262
  verificationUri?: string;
1263
- /** device flow 预填验证码的地址(GitHub 返回的 `verification_uri_complete`):打开只需点授权。 */
1263
+ /**
1264
+ * device flow 的预填验证码地址(`verification_uri_complete`),**可选**:若 provider 返回就透出,
1265
+ * 前端优先用它打开(码已预填)。注意 GitHub 官方 device flow 实测不返回该字段,此时走
1266
+ * `verificationUri` + 手动输入;保留此字段只为兼容会返回它的 provider。
1267
+ */
1264
1268
  verificationUriComplete?: string;
1265
1269
  userCode?: string;
1266
1270
  expiresAt?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morehao/dsh-github-trending",
3
- "version": "0.8.4",
3
+ "version": "0.8.5",
4
4
  "description": "GitHub 趋势日报的 DeepSeek Harness 插件:按日 / 周 / 月周期定时 spawn 本地 trendradar 核心,抓取 Trending、生成中文简介与周期总结,并可选把订阅仓库的新 Release 合成中文摘要,一起提交到你的仓库、自动开 PR 合并;内置概览 / 榜单 / 运行记录 / 订阅 / 设置工作台。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",