dsh-douyin-agent 1.4.1 → 1.4.3

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/README.md CHANGED
@@ -41,10 +41,10 @@
41
41
  在 DSH Desktop 自带终端中运行:
42
42
 
43
43
  ```powershell
44
- dsh plugin --profile desktop add dsh-douyin-browser-local@1.4.0
44
+ dsh plugin --profile desktop add dsh-douyin-agent@1.4.2
45
45
  ```
46
46
 
47
- 需要 Windows、已安装 Microsoft Edge 和 DSH 0.2.0-rc.2。安装后按宿主提示重新加载,在设置中打开“刷抖音”;抖音登录和验证由使用者自行完成。市场收录与 npm 包发布分别同步,不能把发布成功当成市场已刷新。
47
+ 需要 Windows、已安装 Microsoft Edge 和 DSH 0.2.0-rc.2,以及一个独立的 **Node.js 22.13 或更高版本**(插件要用它单独起浏览器进程;装了 Node LTS 就行,没装的话点「开始自主观看」会提示下载地址,也可以用 `DOUYIN_NODE_EXECUTABLE` 指定已有的 node.exe)。安装后按宿主提示重新加载,在设置中打开“刷抖音”;抖音登录和验证由使用者自行完成。市场收录与 npm 包发布分别同步,不能把发布成功当成市场已刷新。
48
48
 
49
49
  ### 从源码安装
50
50
 
package/client.js CHANGED
@@ -1,5 +1,5 @@
1
1
  window.__ModuleLoader__.load({
2
- id: 'dsh-douyin-browser-local',
2
+ id: 'dsh-douyin-agent',
3
3
  factory: require => {
4
4
  const React = require('react');
5
5
  const primitives = require('@deepseek-ai/dsh-client-ui-primitives');
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "dsh-douyin-agent",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "type": "module",
5
5
  "description": "DSH 原生抖音工具:有限自主观看、抽帧故事板与弹幕、人格与兴趣记忆、自动问候与私信回复、观看日报",
6
6
  "license": "MIT",
7
7
  "author": "LockyBee",
8
8
  "repository": {
9
9
  "type": "git",
10
- "url": "git+https://github.com/LockyBee/dsh-douyin-agent.git"
10
+ "url": "git+https://github.com/dafeiyu1314520/dsh-douyin-agent.git"
11
11
  },
12
12
  "homepage": "https://github.com/LockyBee/dsh-douyin-agent#readme",
13
13
  "bugs": {
package/runtime-paths.mjs CHANGED
@@ -82,11 +82,32 @@ export function resolveNodeExecutable({ env = process.env, executable = process.
82
82
  if (!versions.electron) return executable;
83
83
  const nodeName = process.platform === 'win32' ? 'node.exe' : 'node';
84
84
  const searchPath = Object.entries(env).find(([key]) => key.toUpperCase() === 'PATH')?.[1] || '';
85
+ // 2026-10-30:使用者装完插件点「开始自主观看」直接失败,原因就是这里只认 PATH 和 DSH 安装目录,
86
+ // 而多数机器只是「跟着 DSH 装了运行时」,node 在 ~\.dsh\dsh-runtimes 下、不在 PATH 里。
87
+ const runtimeNodes = (() => {
88
+ const root = path.join(homedir(), '.dsh', 'dsh-runtimes');
89
+ let entries = [];
90
+ try {
91
+ entries = fs.readdirSync(root, { withFileTypes: true })
92
+ .filter(entry => entry.isDirectory() && !entry.name.endsWith('.previous'))
93
+ .map(entry => ({ file: path.join(root, entry.name, 'dependencies', 'node', 'bin', nodeName), mtime: (() => { try { return fs.statSync(path.join(root, entry.name, 'dependencies', 'node', 'bin', nodeName)).mtimeMs; } catch { return 0; } })() }))
94
+ .filter(item => item.mtime > 0)
95
+ .sort((a, b) => b.mtime - a.mtime);
96
+ } catch { /* 没有运行时目录就跳过 */ }
97
+ return entries.map(item => item.file);
98
+ })();
99
+ const fixedLocations = process.platform === 'win32'
100
+ ? ['ProgramFiles', 'ProgramFiles(x86)', 'LOCALAPPDATA'].filter(key => typeof env[key] === 'string' && path.isAbsolute(env[key])).map(key => path.join(env[key], 'Programs', 'nodejs', nodeName)).concat(['ProgramFiles', 'ProgramFiles(x86)'].filter(key => typeof env[key] === 'string' && path.isAbsolute(env[key])).map(key => path.join(env[key], 'nodejs', nodeName)))
101
+ : ['/usr/local/bin', '/usr/bin', '/opt/homebrew/bin'].map(directory => path.join(directory, nodeName));
85
102
  const candidates = [
86
103
  ...(resourcesPath && path.isAbsolute(resourcesPath) ? [path.join(resourcesPath, 'runtime', 'node', nodeName)] : []),
87
104
  path.join(sourceRoot, 'desktop', '.cache', 'generated', 'node', nodeName),
105
+ ...runtimeNodes,
106
+ ...fixedLocations,
88
107
  ...searchPath.split(path.delimiter).map(directory => directory.trim().replace(/^"(.*)"$/, '$1')).filter(directory => path.isAbsolute(directory)).map(directory => path.join(directory, nodeName)),
89
108
  ];
90
109
  for (const candidate of new Set(candidates)) if (isIndependentNode(candidate, env, executable, versions)) return candidate;
91
- throw new Error('未找到独立 Node.js 22.13 或更高版本。请安装 Node.js,或将 DOUYIN_NODE_EXECUTABLE 设置为现有 node.exe 的绝对路径后重试。');
110
+ throw new Error('没找到可用的 Node.js(需要 22.13 或更高版本)。插件要用它单独起一个浏览器进程。\n'
111
+ + '最省事的办法:装一次 Node.js LTS(https://nodejs.org/zh-cn/download ),装完重开 DSH 再试。\n'
112
+ + '已经装了但装在别处的话,把环境变量 DOUYIN_NODE_EXECUTABLE 设成那个 node.exe 的完整路径。');
92
113
  }