dsh-douyin-mac 0.1.9 → 0.1.10

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,11 @@
1
1
  # 更新记录
2
2
 
3
+ ## 0.1.10(2026-11-05)
4
+
5
+ - 自检插件版本改为读取 `package.json`,不再固定显示上游 1.4.6。
6
+ - macOS 上从 Chrome 的 `Info.plist` 读取版本号,修复 `CHROME_VERSION_UNKNOWN` 警告。
7
+ - 调度自检区分“当前时段失败”和“历史时段失败”:历史回执不再误报 `SCHEDULE_START_FAILED`;自动启动关闭时明确提示不会到点启动。
8
+
3
9
  ## 0.1.9(2026-11-04)
4
10
 
5
11
  - 新增远程短信验证:身份验证时自动打开“接收短信验证码”并请求短信,经微信推送验证界面;用户把 6 位码发回微信后由 `douyin_submit_sms` 填入提交。
package/browser-host.mjs CHANGED
@@ -24,6 +24,15 @@ export function classifyBrowserLaunchError(error, { version } = {}) {
24
24
  return { code, message: (browserVersion ? `标准路径 Chrome 版本 ${browserVersion}。` : '未读取到标准路径 Chrome 版本。') + message, browserVersion, details };
25
25
  }
26
26
  async function readChromeVersion(file) {
27
+ // macOS 上运行 Chrome 二进制可能直接拉起浏览器或无输出;优先读 Info.plist。
28
+ if (process.platform === 'darwin') {
29
+ try {
30
+ const plist = path.resolve(path.dirname(file), '..', 'Info.plist');
31
+ const result = await execute('/usr/bin/plutil', ['-extract', 'CFBundleShortVersionString', 'raw', '-o', '-', plist], { timeout: 5000, maxBuffer: 2048 });
32
+ const version = versionOf(result.stdout);
33
+ if (version) return version;
34
+ } catch {}
35
+ }
27
36
  try {
28
37
  const result = await execute(file, ['--version'], { timeout: 5000, maxBuffer: 2048 });
29
38
  return versionOf(result.stdout);
package/diagnostics.mjs CHANGED
@@ -2,12 +2,13 @@ import fs from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import { randomUUID } from 'node:crypto';
4
4
  import { execFile } from 'node:child_process';
5
+ import { readFileSync } from 'node:fs';
5
6
  import { promisify } from 'node:util';
6
7
  import { resolveRuntimePaths, resolveNodeExecutable } from './runtime-paths.mjs';
7
8
  import { probeChromeInstallation, sanitizeBrowserFailure } from './browser-host.mjs';
8
9
 
9
10
  const execute = promisify(execFile);
10
- const VERSION = '1.4.6';
11
+ const VERSION = (() => { try { return JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf8')).version } catch { return '0.0.0' } })();
11
12
  const REPAIR = 'reapply_silent';
12
13
  const resolution = (kind, steps = [], action) => ({ kind, steps, ...(action ? { action } : {}) });
13
14
  const automatic = () => resolution('automatic', ['重新连接已核对归属的现有专用浏览器,重新应用已开启的静默设置,再回读窗口和媒体状态。'], REPAIR);
@@ -125,8 +126,13 @@ export async function runDiagnostics({ source = 'api', modelConfigured = false,
125
126
  });
126
127
  if (watchSchedule) await check('schedule', '允许时段自动启动', () => {
127
128
  const state = watchSchedule.state();
128
- if (state.lastError) return { warning: true, code: 'SCHEDULE_START_FAILED', message: '最近一次自动启动未完成,原调度记录已保留。', resolution: resolution('user', ['核对本报告中的模型、浏览器和运行状态;不要删除时段回执来重复启动。']) };
129
- return { message: state.policy?.enabled ? '已开启按允许时段启动;实际观看仍受轮次、模型和预算约束。' : '自动启动未开启;仅设置允许时段不会到点启动。', evidence: { enabled: Boolean(state.policy?.enabled) } };
129
+ const last = state.last;
130
+ const now = Date.now();
131
+ const inCurrentSlot = Boolean(last && Number.isFinite(last.startAt) && Number.isFinite(last.expiresAt) && last.startAt <= now && now < last.expiresAt);
132
+ if (state.policy?.enabled === false) return { message: '自动启动未开启;仅设置允许时段不会到点启动。今天额度用完后也不会自动补跑。', evidence: { enabled: false } };
133
+ if (state.lastError && inCurrentSlot) return { warning: true, code: 'SCHEDULE_START_FAILED', message: '当前允许时段内的自动启动未完成,原调度记录已保留。', resolution: resolution('user', ['核对本报告中的模型、浏览器和运行状态;不要删除时段回执来重复启动。']) };
134
+ if (state.lastError) return { message: '历史时段有一次自动启动失败,已不在当前时段,不会阻止下一次启动。', evidence: { enabled: true, lastErrorAt: last?.completedAt || null } };
135
+ return { message: '已开启按允许时段启动;实际观看仍受模型、每日额度和允许时段约束。', evidence: { enabled: true } };
130
136
  });
131
137
  if (interactionStates) await check('interactions', '好友互动与发送核对', async () => {
132
138
  const states = await interactionStates();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-douyin-mac",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "type": "module",
5
5
  "description": "macOS 版 DSH 抖音工具:Chrome 专用窗口驱动、人格记忆与自主观看",
6
6
  "license": "MIT",