@ohmykreee/dsh-remote-control 1.0.2 → 1.0.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/AGENTS.md +2 -2
- package/INSTALLATION.md +3 -3
- package/lib/util.js +1 -1
- package/package.json +1 -1
- package/scripts/check-npm-package.mjs +3 -3
- package/src/dsh/lib/util.ts +1 -1
- package/src/rust/Cargo.lock +1 -1
- package/src/rust/Cargo.toml +1 -1
package/AGENTS.md
CHANGED
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
|
|
41
41
|
## 项目形态
|
|
42
42
|
|
|
43
|
-
- 名称 `@ohmykreee/dsh-remote-control`,版本 `1.0.
|
|
43
|
+
- 名称 `@ohmykreee/dsh-remote-control`,版本 `1.0.3`,MIT;npm 包由 CI 发布,bundle 行的 `name` 与 `client.js` 的工厂 id 都必须等于这个包名。
|
|
44
44
|
- 运行形态:DSH Desktop / `dsh web` 的 Host 进程内加载的 bundle 插件。
|
|
45
45
|
- 一个进程里同时存在四层:
|
|
46
46
|
1. **Host**:`src/dsh`(TypeScript,ESM),编译为 `index.js` + `lib/`;
|
|
@@ -293,7 +293,7 @@ window.__ModuleLoader__.load({
|
|
|
293
293
|
### 架构与二进制
|
|
294
294
|
|
|
295
295
|
- 唯一 OS 探测层:媒体、音量、性能 / GPU / 温度、通知、定位。Node 不保留 PowerShell / C# / playerctl / osascript 回退。
|
|
296
|
-
- 源码 `src/rust`(crate `dsh-probe`,版本 `1.0.
|
|
296
|
+
- 源码 `src/rust`(crate `dsh-probe`,版本 `1.0.3`)。每个功能目录(`media/`、`perf/`、`notifications/`、`volume/`、`location/`)都按同一方式分层:`mod.rs` 只做命令行、JSON 外形和平台模块选择;`windows.rs` / `linux.rs` / `macos.rs` 各自实现完整平台逻辑。缺失能力由平台文件返回明确错误,不在 `mod.rs` 里写 `cfg` 分支。
|
|
297
297
|
- 媒体层在平台层之上做 vendor 调度:平台文件识别应用后调用 `vendor::resolve`,命中 vendor 进入对应客户端逻辑,未命中才回到系统 API。
|
|
298
298
|
- 产物:`native/bin/<platform>-<arch>/dsh-probe[.exe]`,例如 `win32-x64`、`linux-x64`、`darwin-arm64`。
|
|
299
299
|
- `src/dsh/lib/probe.ts` 按 `process.platform` / `process.arch` 定位,`DSH_RC_PROBE` 可覆盖;找不到时所有调用返回明确的「不可用」错误。
|
package/INSTALLATION.md
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
**方式 A-1:DSH 插件管理器**
|
|
29
29
|
|
|
30
30
|
1. 打开 DSH 设置 → 插件管理 → 安装插件。
|
|
31
|
-
2. 填包名 `@ohmykreee/dsh-remote-control`(可加版本,如 `@ohmykreee/dsh-remote-control@1.0.
|
|
31
|
+
2. 填包名 `@ohmykreee/dsh-remote-control`(可加版本,如 `@ohmykreee/dsh-remote-control@1.0.3`)。
|
|
32
32
|
3. 安装并启用,重启 DSH(或重新加载插件)。侧边栏会出现 **远程控制台**。
|
|
33
33
|
|
|
34
34
|
**方式 A-2:DSH CLI(DSH 未运行时)**
|
|
@@ -45,7 +45,7 @@ dsh plugin --profile web add @ohmykreee/dsh-remote-control
|
|
|
45
45
|
|
|
46
46
|
```json
|
|
47
47
|
{
|
|
48
|
-
"dependencies": { "@ohmykreee/dsh-remote-control": "^1.0.
|
|
48
|
+
"dependencies": { "@ohmykreee/dsh-remote-control": "^1.0.3" },
|
|
49
49
|
"dsh": { "profile": { "bundles": ["@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app", "@ohmykreee/dsh-remote-control"] } }
|
|
50
50
|
}
|
|
51
51
|
```
|
|
@@ -244,7 +244,7 @@ node scripts/build-rust.mjs
|
|
|
244
244
|
**方式 A:** 在 DSH 插件管理器里升级 **远程控制台**;没有升级入口时,用 CLI 装一次目标版本:
|
|
245
245
|
|
|
246
246
|
```powershell
|
|
247
|
-
dsh plugin --profile desktop add @ohmykreee/dsh-remote-control@1.0.
|
|
247
|
+
dsh plugin --profile desktop add @ohmykreee/dsh-remote-control@1.0.3 # 换成目标版本
|
|
248
248
|
```
|
|
249
249
|
|
|
250
250
|
更新后重启 DSH。插件目录里的 `native/bin` 不随包更新,用 `DSH_RC_PROBE` 指向外部探针时无需重建。
|
package/lib/util.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isRecord as t}from"./types.js";export const VERSION="1.0.
|
|
1
|
+
import{isRecord as t}from"./types.js";export const VERSION="1.0.3";export const PANEL_ID="remote-control";export const ROUTE_PREFIX="/dsh-remote-control";export const INFO_PATH=`${ROUTE_PREFIX}/api/info`;export const QR_PATH=`${ROUTE_PREFIX}/qr.svg`;export const SETTINGS_PATH=`${ROUTE_PREFIX}/api/settings`;export const APP_NAMES_PATH=`${ROUTE_PREFIX}/api/apps`;export const LOCATION_PATH=`${ROUTE_PREFIX}/api/location`;export const GEOCODE_PATH=`${ROUTE_PREFIX}/api/geocode`;export const THEME_PATH=`${ROUTE_PREFIX}/api/theme`;export const LOCALE_PATH=`${ROUTE_PREFIX}/api/locale`;export const TOKEN_ROTATE_PATH=`${ROUTE_PREFIX}/api/token/rotate`;export const DISCONNECT_PATH=`${ROUTE_PREFIX}/api/disconnect`;export function clamp(t,e,r){return Math.min(r,Math.max(e,t))}export function finiteNumber(t,e=null){if(null==t)return e;if("string"==typeof t&&""===t.trim())return e;const r="number"==typeof t?t:Number(t);return Number.isFinite(r)?r:e}export function safeString(t,e=500){return"string"!=typeof t?"":t.length>e?t.slice(0,e):t}export function decodeXml(t){return String(t).replace(/&#x([0-9a-f]+);/gi,(t,e)=>String.fromCodePoint(parseInt(e,16))).replace(/&#([0-9]+);/g,(t,e)=>String.fromCodePoint(parseInt(e,10))).replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}export function escapeHtml(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}export function basename(t){if("string"!=typeof t||0===t.length)return"";const e=t.replace(/[\\/]+$/,""),r=e.split(/[\\/]/);return r[r.length-1]||e}export function isObject(e){return t(e)}export function sniffImageMediaType(t){if(!t||t.length<12)return null;if(137===t[0]&&80===t[1]&&78===t[2]&&71===t[3])return"image/png";if(255===t[0]&&216===t[1]&&255===t[2])return"image/jpeg";const e=Buffer.from(t.buffer,t.byteOffset,Math.min(t.length,16)).toString("ascii");return e.startsWith("GIF8")?"image/gif":e.startsWith("RIFF")&&"WEBP"===e.slice(8,12)?"image/webp":e.slice(4,12).includes("ftyp")?"image/avif":null}export function startOfLocalDay(t=new Date){const e=new Date(t);return e.setHours(0,0,0,0),e}export function startOfLocalWeek(t=new Date){const e=startOfLocalDay(t),r=e.getDay(),n=0===r?6:r-1;return e.setDate(e.getDate()-n),e}export function localTimezoneOffsetSeconds(t=new Date){return 60*-t.getTimezoneOffset()}export function formatRelativeTime(t,e=Date.now()){if(!Number.isFinite(t)||t<=0)return"";const r=Math.max(0,Math.round((e-t)/1e3));return r<60?"刚刚":r<3600?`${Math.floor(r/60)} 分钟前`:r<86400?`${Math.floor(r/3600)} 小时前`:`${Math.floor(r/86400)} 天前`}export function serializeError(t){if(t instanceof Error)return t.message;try{return String(t)}catch{return"unknown error"}}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* Usage:
|
|
13
13
|
* node scripts/check-npm-package.mjs # manifest + artifacts + tarball
|
|
14
|
-
* node scripts/check-npm-package.mjs --tag v1.0.
|
|
14
|
+
* node scripts/check-npm-package.mjs --tag v1.0.3 # also require a matching tag
|
|
15
15
|
* node scripts/check-npm-package.mjs --no-pack # skip the tarball inspection
|
|
16
16
|
*
|
|
17
17
|
* Exit code 0 means the checkout is publishable; 1 lists every problem found.
|
|
@@ -29,7 +29,7 @@ const tag = tagIndex >= 0 ? String(args[tagIndex + 1] || '').trim() : '';
|
|
|
29
29
|
const skipPack = args.includes('--no-pack');
|
|
30
30
|
|
|
31
31
|
if (tagIndex >= 0 && !tag) {
|
|
32
|
-
console.error('--tag requires the pushed tag name, e.g. --tag v1.0.
|
|
32
|
+
console.error('--tag requires the pushed tag name, e.g. --tag v1.0.3');
|
|
33
33
|
process.exit(2);
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -225,7 +225,7 @@ if (tag) {
|
|
|
225
225
|
if (normalized !== version) {
|
|
226
226
|
fail(
|
|
227
227
|
`tag ${JSON.stringify(tag)} does not match package version ${version}`,
|
|
228
|
-
'push the tag for the version that is actually in package.json, e.g. `git tag v1.0.
|
|
228
|
+
'push the tag for the version that is actually in package.json, e.g. `git tag v1.0.3`',
|
|
229
229
|
);
|
|
230
230
|
} else {
|
|
231
231
|
pass(`tag ${tag} matches version ${version}`);
|
package/src/dsh/lib/util.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import type { JsonRecord } from './types.js';
|
|
4
4
|
import { isRecord } from './types.js';
|
|
5
5
|
|
|
6
|
-
export const VERSION = '1.0.
|
|
6
|
+
export const VERSION = '1.0.3';
|
|
7
7
|
export const PANEL_ID = 'remote-control';
|
|
8
8
|
export const ROUTE_PREFIX = '/dsh-remote-control';
|
|
9
9
|
export const INFO_PATH = `${ROUTE_PREFIX}/api/info`;
|
package/src/rust/Cargo.lock
CHANGED