dsh-plugin-weapp-gateway 0.8.53 → 0.8.55
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 +40 -0
- package/PROTOCOL.md +26 -12
- package/README.en.md +410 -0
- package/README.md +16 -0
- package/README.zh-CN.md +425 -0
- package/cordis.patch.yml +2 -0
- package/docs/agent-team-app-integration.md +76 -55
- package/docs/android-connectors-alignment.md +73 -0
- package/docs/dsh-0.2.2-rc.1-mobile-integration.md +269 -0
- package/docs/dsh-0.2.2-rc.3-compatibility-audit.md +145 -0
- package/docs/file-cards-mobile-integration.md +111 -0
- package/docs/file-changes-app-integration.md +277 -0
- package/docs/generated-images-mobile-integration.md +125 -0
- package/docs/iphone-connector-actions.md +69 -0
- package/docs/iphone-map-markers.md +41 -0
- package/docs/iphone-maps-connectors.md +56 -0
- package/docs/iphone-music-cards.md +28 -0
- package/docs/map-app-adapters.md +57 -0
- package/docs/phone-connectors-implementation.md +105 -0
- package/docs/phone-connectors.md +91 -0
- package/docs/readme/README.de.md +404 -0
- package/docs/readme/README.es.md +404 -0
- package/docs/readme/README.fr.md +404 -0
- package/docs/readme/README.ja.md +404 -0
- package/docs/readme/README.ko.md +404 -0
- package/docs/readme/README.pt-BR.md +404 -0
- package/lib/client.js +82 -27
- package/lib/cloudflare-tunnel.mjs +6 -2
- package/lib/cloudflared-binary.mjs +10 -24
- package/lib/device-tool-validation.mjs +173 -0
- package/lib/device-tools.mjs +119 -0
- package/lib/devices.js +29 -7
- package/lib/dsh-host-adapter.mjs +169 -36
- package/lib/dsh-runtime-version.mjs +22 -0
- package/lib/index.mjs +253 -102
- package/lib/logging.mjs +16 -0
- package/lib/message-text.mjs +51 -0
- package/lib/phone-request-sources.mjs +91 -0
- package/lib/phone-tools.mjs +248 -0
- package/lib/plugin-management.mjs +24 -0
- package/lib/schedule-management.mjs +130 -0
- package/lib/session-target.mjs +16 -0
- package/lib/tool-images.mjs +32 -0
- package/lib/web-restart.mjs +11 -8
- package/lib/workspace-changes.mjs +162 -0
- package/package.json +8 -3
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
[English](../../README.md) · [简体中文](../../README.zh-CN.md) · **日本語** · [한국어](README.ko.md) · [Español](README.es.md) · [Français](README.fr.md) · [Deutsch](README.de.md) · [Português (Brasil)](README.pt-BR.md)
|
|
2
|
+
|
|
3
|
+
> リンク先の詳細プロトコル・接続文書の一部は現在中国語のみです。
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="../assets/whale-girl-ios-app-promo-16x9.png" alt="Whaleness と Mobile Gateway" width="100%">
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
# dsh-plugin-mobile-gateway
|
|
10
|
+
|
|
11
|
+
> **v0.12.1 · 公開準備中** — DSH 0.2.2-rc.3、Node.js 24.9+ に対応。チーム投影とサブエージェントの継続・中断を修正し、セッション単位の Team モード切り替えを追加しました。 [Changelog](../../CHANGELOG.md) · [RC.3 / App](../dsh-0.2.2-rc.3-compatibility-audit.md)
|
|
12
|
+
|
|
13
|
+
DeepSeek Harness 向けの端末認証付きサードパーティー製モバイルゲートウェイです。セッションとリアルタイムイベント、待機メッセージの同期・編集・削除・Steer、セッションの双方向アーカイブ・名前変更、生成の停止・再開、タスクと現在の Goal、サーバー提供のコマンド・スキルメニュー、ユーザーへの質問と承認、画像・ファイル転送に対応します。インストールすると WebUI に「モバイル端末」が追加され、起動、QR 生成、信頼済み端末の管理ができます。
|
|
14
|
+
|
|
15
|
+
> 現在のソースは **DSH 0.2.2-rc.1** を対象とし、Connection Peer と Session format 4 を使用します。旧履歴カーソルはベースラインの再取得が必要です。
|
|
16
|
+
>
|
|
17
|
+
> ストリームは独立した `assistant-stream` フレームになりました。[rc.2 ガイド](../dsh-rc2-mobile-integration.md)に従い購読・キャッシュ・ページングを更新してください。未公開の変更です。
|
|
18
|
+
>
|
|
19
|
+
> v0.11.1(現在のソース、未公開):ファイルの分割アップロード、SHA-256、進捗確認、キャンセル、切断時の削除。DSH 公式添付ストレージとセッション別認証情報を利用し、メッセージ送信とリアルタイム・履歴のファイル参照に対応します。`file-upload-v1` の実装は[アップロードガイド](../file-upload-app-integration.md)を参照。
|
|
20
|
+
>
|
|
21
|
+
> v0.11.0:Agent チームとサブ会話、メンバー、共有タスク、階層ディレクトリ、実行状態の同期、独立した履歴、表示切替、会話継続、画像、停止に対応。機能検出と[チームガイド](../agent-team-app-integration.md)に従ってください。
|
|
22
|
+
>
|
|
23
|
+
> v0.10.4:一覧の投影をタイトルと切点に絞り、大量セッションの公開トンネル経由タイムアウトを改善。メタ情報と完全な履歴投影は保持し、既存クライアントの変更は不要です。
|
|
24
|
+
>
|
|
25
|
+
> v0.10.3:DSH 0.2.1-rc.2 の Remote・購読に Connection Peer を渡し、`Cannot read properties of undefined (reading 'signal')` を修正。停止時に Peer を解放します。モバイルプロトコルは不変です。
|
|
26
|
+
>
|
|
27
|
+
> v0.10.2:ファイルカードイベントと安全な参照解決。既存の分割ダウンロードでカード・本文リンクをプレビュー。[カードガイド](../file-cards-mobile-integration.md)を参照。
|
|
28
|
+
>
|
|
29
|
+
> v0.10.1:公式音声入力、モデル準備・状態、文字起こし、キャンセルと切断時の後処理。公式 speech Remote を使用し、ASR モデルは同梱しません。
|
|
30
|
+
>
|
|
31
|
+
> v0.10.0:ホストのテーマに従う中央配置・可変幅の設定画面、統一メニューと接続強調、独立したアニメーション QR 画面、インスタンス別に閉じられる再起動通知。既定はオンライン端末のみでオフラインを展開でき、端末名と重複番号に対応。Tunnel 切替は即適用、名前付き設定は保存して適用します。
|
|
32
|
+
>
|
|
33
|
+
> v0.9.0:DSH 0.2.0-rc.2 プラグイン管理、専用キャッシュ内の検証済み `cloudflared` で Quick・名前付き Tunnel を操作。LAN・外部接続案内、別タブを開かない再起動・DSH Web 停止。
|
|
34
|
+
>
|
|
35
|
+
> v0.7.3:モードメニューの矢印間隔を調整。
|
|
36
|
+
>
|
|
37
|
+
> v0.7.2:会話・制御の別接続、空セッション、停止・再開、待機メッセージの編集・削除・Steer、双方向アーカイブ・名前変更。
|
|
38
|
+
|
|
39
|
+
## プロトコルと DSH 互換層
|
|
40
|
+
|
|
41
|
+
端末は DSH 内部 Remote ではなく `dsh-mobile-v1` に接続します。独立した Host Adapter が DSH 0.2.1-rc.2 Remote Gateway と通信し、Session、Workspace、Settings、Commands、Goals、Schedule、Permission Presets、Plugin Manager の名前空間と厳密な引数はその内部に限定します。フレーム・画面案は[RC2 ガイド](../dsh-0.2.0-rc.2-plugin-management-mobile-integration.md)を参照。
|
|
42
|
+
|
|
43
|
+
全 Remote 呼び出しで `peer` が必須です。`ctx.connection.createPeer()` でローカルユーザーの Peer を作成し、プラグインと同時に解放します。Adapter が要求・初回取得・購読に注入し、端末は呼出者の身元を指定できません。質問・承認は Host リスナーが継続処理します。欠落すると `Cannot read properties of undefined (reading 'signal')` が発生します。DSH 更新後は本ソースを再インストールし `dsh web` を再起動してください。端末プロトコルの変更は不要です。
|
|
44
|
+
|
|
45
|
+
ローカルの公式 DSH で検証できます。Gateway/Connection は実物、業務サービスはテスト用で、ユーザーのセッションは読み書きしません。
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
DSH_INSTALL_ROOT=/absolute/path/to/@deepseek-ai/dsh node test/host-official.test.mjs
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
認証と `dsh-mobile-v1` / `hello.protocol = 3` は不変です。ライブトークンは永続イベントの `seq` を消費しません。`assistantStream: true` を明示して不可分の `session-snapshot` と独立した差分を受信します。`event` は永続イベントのみです。新購読なしでは永続メッセージだけを受信します。
|
|
52
|
+
|
|
53
|
+
履歴は `historyFormatVersion` と `cursor` を返します。形式変更時はキャッシュを削除しベースラインを再取得します。`beforeSeq` ページングと `atSeq` fork は `historyFormatVersion: 4` が必要です。
|
|
54
|
+
接続・検証は[rc.2 ガイド](../dsh-rc2-mobile-integration.md)、旧移行記録は[Remote Gateway 計画](../remote-gateway-refactor-plan.md)を参照。
|
|
55
|
+
|
|
56
|
+
- WebSocket:`/ws/mobile`
|
|
57
|
+
- LAN:`ws://<局域网 IP>:3081/ws/mobile`
|
|
58
|
+
- Linux 公開サーバー:`wss://<公网 IP>/ws/mobile`
|
|
59
|
+
- プロトコル:[PROTOCOL.md](../../PROTOCOL.md)
|
|
60
|
+
|
|
61
|
+
空セッション作成後、最初の会話まで Agent プリセットの照会・変更が可能です。`session-agent-preset` を検出し[クライアントガイド](../session-agent-preset-app-integration.md)に従ってください。画面実装が別途必要で、未公開です。
|
|
62
|
+
|
|
63
|
+
`turn-outline-v1` は WebUI の完全なターン構成と更新を中継し、本文を全取得せず目盛り・質問応答プレビュー・ページ移動を表示できます。制御再接続・新端末はベースラインを復元し、Host が未対応なら読込済みターンに縮退できます。[ナビゲーションガイド](../turn-outline-app-integration.md)。画面実装は別途必要、未公開です。
|
|
64
|
+
|
|
65
|
+
`file-upload-v1`:ペアリング済み端末が制御接続で PDF・Office・圧縮ファイル・音声などを分割送信。SHA-256 後に公式ストレージへ保存し、セッション専用認証で送信します。進捗・キャンセル・切断処理・ライブ/履歴参照を提供し、公式 WebUI の受入規則に従い、端末指定のホストパスに書き込みません。フレーム・状態・制限・検証は[アップロードガイド](../file-upload-app-integration.md)。画面は別途、未公開です。
|
|
66
|
+
|
|
67
|
+
`agent-team-v1` と `subagent-conversations-v1`:メンバー・共有タスク、階層ディレクトリ、チーム投影・実行状態の同期、独立履歴・購読、会話継続・停止。宛先、JSON、規則、切替/再接続、エラーと検証は[チームガイド](../agent-team-app-integration.md)。ゲートウェイ機能のみで画面は別途、未公開です。
|
|
68
|
+
|
|
69
|
+
## 複数ゲートウェイ:第 1 段階(現在のソース)
|
|
70
|
+
|
|
71
|
+
安定した `gatewayId`、設定可能な `gatewayName`、候補アドレス、保存される「停止・一時・常時」モードを提供します。別のマシンに個別ペアリングできますが、アプリの管理機能は[ガイド](../multi-gateway-app-integration.md)に従い実装してください。新 npm 版は未公開です。
|
|
72
|
+
|
|
73
|
+
常時モードは再起動後も認証済み端末を受け付けます。DSH 実行・ホストの非スリープ・到達可能なネットワークが必要です。自動検出・通信中継は提供しません。
|
|
74
|
+
|
|
75
|
+
プラグインの `config` の例:
|
|
76
|
+
|
|
77
|
+
```yaml
|
|
78
|
+
gatewayMode: persistent
|
|
79
|
+
gatewayName: 家里电脑
|
|
80
|
+
requireAuth: true
|
|
81
|
+
endpoints:
|
|
82
|
+
- wss://gateway.example.com/ws/mobile
|
|
83
|
+
- ws://192.168.1.10:3081/ws/mobile
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
優先順:**保存済み UI 選択 > `gatewayMode` > 旧 `gatewayEnabled`**。選択がなければ `gatewayEnabled: true` は常時、false は停止です。
|
|
87
|
+
|
|
88
|
+
- 停止:即座に切断し、再起動後も停止。
|
|
89
|
+
- 一時:既定 5 分以内に接続成功がなければ停止して保存。成功後はその実行中維持します。再起動で待機をやり直します。`gatewayWaitTimeoutMs` は 30 秒~30 分。
|
|
90
|
+
- 常時:端末不在の停止タイマーなし。QR の既定 5 分期限や転送タイムアウトは不変。
|
|
91
|
+
|
|
92
|
+
状態は `<deviceFile>.gateway.json`、通常 `~/.dsh/mobile-gateway-devices.json.gateway.json`。`gatewayStateFile` で変更できます。UUID v4 と設定を権限 `0600` で保持し、同一ディレクトリの一時ファイルで不可分に置換します。破損時は新 ID を黙って作らず起動失敗します。各インスタンスは独自の登録・状態ファイルが必要です。
|
|
93
|
+
|
|
94
|
+
更新・移行では両ファイルを保持します。独立クローンでは元の状態・端末登録をコピーせず、新 ID とペアリングを作成します。実行中に ID を削除しないでください。起動設定を再利用するには停止・バックアップ後、`mode` のみ `null` にし、`version` と `gatewayId` を残して再起動します。
|
|
95
|
+
|
|
96
|
+
`gatewayName` は最大 80 文字、既定はホスト名。`endpoints` は最大 16 件・各 2048 文字の追加候補です。優先・公開・LAN を統合して合計 16 件を超えるとエラー。同一ゲートウェイを指し端末から到達可能である必要があります。`0.0.0.0` / `::` は不可、公開は WSS。
|
|
97
|
+
|
|
98
|
+
試験・手順は[検証報告](../multi-gateway-phase1-acceptance.md)、範囲は[チェックリスト](../multi-gateway-todo.md)を参照。
|
|
99
|
+
|
|
100
|
+
## Android・iOS の関連クライアント
|
|
101
|
+
|
|
102
|
+
[Whaleness](https://github.com/Clarklevis1995/dsh-mobile) は本ゲートウェイと連携する独立開発のサードパーティー製ネイティブクライアントです。Android 7.0+、iOS / iPadOS 16.1+ に対応し、Kotlin Multiplatform の共有ロジックと Jetpack Compose・SwiftUI/UIKit の UI を使用します。ワークスペース、会話、チーム・共有タスク、ファイル送信・プレビュー、文字選択、Markdown 表、履歴・キャッシュ、音声、承認、サーバーメニューに対応。iPhone Duo・大画面は向きと領域に適応し、効果は OS・端末に依存します。ダウンロード・設定・最新画像はクライアントのリポジトリへ。
|
|
103
|
+
|
|
104
|
+
> 最新の iOS 製品画像:1.7.10 の素材は 2026 年 10 月 22~23 日、iPhone Duo の画像は 2026 年 10 月 26 日に撮影しました。UI は中国語です。[製品画像の出典](https://github.com/Clarklevis1995/dsh-mobile/blob/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-23/SOURCES.md) · [Duo 画像の出典](https://github.com/Clarklevis1995/dsh-mobile/blob/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-26-duo/SOURCES.md)。
|
|
105
|
+
|
|
106
|
+
### iPhone Duo:横向き・縦向き・ナビゲーション
|
|
107
|
+
|
|
108
|
+
<table>
|
|
109
|
+
<tr>
|
|
110
|
+
<td width="50.00%" align="center"><a href="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-26-duo/landscape-home.webp"><img src="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-26-duo/landscape-home.webp" alt="展開時の横向きホーム" width="100%"></a></td>
|
|
111
|
+
<td width="50.00%" align="center"><a href="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-26-duo/landscape-home-alt.webp"><img src="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-26-duo/landscape-home-alt.webp" alt="横向きホームの背景" width="100%"></a></td>
|
|
112
|
+
</tr>
|
|
113
|
+
<tr>
|
|
114
|
+
<td align="center"><strong>展開時の横向きホーム</strong></td>
|
|
115
|
+
<td align="center"><strong>横向きホームの背景</strong></td>
|
|
116
|
+
</tr>
|
|
117
|
+
<tr>
|
|
118
|
+
<td width="50.00%" align="center"><a href="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-26-duo/landscape-settings.webp"><img src="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-26-duo/landscape-settings.webp" alt="横向きの設定" width="100%"></a></td>
|
|
119
|
+
<td width="50.00%" align="center"><a href="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-26-duo/landscape-conversation.webp"><img src="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-26-duo/landscape-conversation.webp" alt="横向きの会話" width="100%"></a></td>
|
|
120
|
+
</tr>
|
|
121
|
+
<tr>
|
|
122
|
+
<td align="center"><strong>横向きの設定</strong></td>
|
|
123
|
+
<td align="center"><strong>横向きの会話</strong></td>
|
|
124
|
+
</tr>
|
|
125
|
+
<tr>
|
|
126
|
+
<td width="50.00%" align="center"><a href="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-26-duo/landscape-navigation.webp"><img src="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-26-duo/landscape-navigation.webp" alt="開いたナビゲーションサイドバー" width="100%"></a></td>
|
|
127
|
+
<td width="50.00%" align="center"><a href="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-26-duo/portrait-home.webp"><img src="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-26-duo/portrait-home.webp" alt="展開時の縦向きホーム" width="100%"></a></td>
|
|
128
|
+
</tr>
|
|
129
|
+
<tr>
|
|
130
|
+
<td align="center"><strong>開いたナビゲーションサイドバー</strong></td>
|
|
131
|
+
<td align="center"><strong>展開時の縦向きホーム</strong></td>
|
|
132
|
+
</tr>
|
|
133
|
+
</table>
|
|
134
|
+
|
|
135
|
+
### チーム・添付ファイル・ローカルストレージ
|
|
136
|
+
|
|
137
|
+
<table>
|
|
138
|
+
<tr>
|
|
139
|
+
<td width="33.33%" align="center"><a href="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-23/team-members.webp"><img src="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-23/team-members.webp" alt="Agent チームのメンバー" width="100%"></a></td>
|
|
140
|
+
<td width="33.33%" align="center"><a href="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-23/team-tasks.webp"><img src="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-23/team-tasks.webp" alt="チームの共有タスク" width="100%"></a></td>
|
|
141
|
+
<td width="33.33%" align="center"><a href="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-23/attachment-picker.webp"><img src="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-23/attachment-picker.webp" alt="ファイルと画像の選択" width="100%"></a></td>
|
|
142
|
+
</tr>
|
|
143
|
+
<tr>
|
|
144
|
+
<td align="center"><strong>Agent チームのメンバー</strong></td>
|
|
145
|
+
<td align="center"><strong>チームの共有タスク</strong></td>
|
|
146
|
+
<td align="center"><strong>ファイルと画像の選択</strong></td>
|
|
147
|
+
</tr>
|
|
148
|
+
<tr>
|
|
149
|
+
<td width="33.33%" align="center"><a href="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-23/text-selection.webp"><img src="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-23/text-selection.webp" alt="独立した文字選択画面" width="100%"></a></td>
|
|
150
|
+
<td width="33.33%" align="center"><a href="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-23/conversation-files.webp"><img src="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-23/conversation-files.webp" alt="会話内のファイル" width="100%"></a></td>
|
|
151
|
+
<td width="33.33%" align="center"><a href="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-23/release-notes.webp"><img src="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-23/release-notes.webp" alt="同梱のリリースノート" width="100%"></a></td>
|
|
152
|
+
</tr>
|
|
153
|
+
<tr>
|
|
154
|
+
<td align="center"><strong>独立した文字選択画面</strong></td>
|
|
155
|
+
<td align="center"><strong>会話内のファイル</strong></td>
|
|
156
|
+
<td align="center"><strong>同梱のリリースノート</strong></td>
|
|
157
|
+
</tr>
|
|
158
|
+
<tr>
|
|
159
|
+
<td width="33.33%" align="center"><a href="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-23/storage.webp"><img src="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-23/storage.webp" alt="ローカルストレージとキャッシュ分類" width="100%"></a></td>
|
|
160
|
+
<td width="33.33%" align="center"><a href="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-23/voice-input.webp"><img src="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-23/voice-input.webp" alt="長押しで音声入力" width="100%"></a></td>
|
|
161
|
+
<td width="33.33%" align="center"><a href="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-23/file-upload.webp"><img src="https://raw.githubusercontent.com/Clarklevis1995/dsh-mobile/1fa7aa7e2d3f50379d37fba251fb6e774416703b/Docs/images/screenshots/2026-10-23/file-upload.webp" alt="入力欄の添付ファイル" width="100%"></a></td>
|
|
162
|
+
</tr>
|
|
163
|
+
<tr>
|
|
164
|
+
<td align="center"><strong>ローカルストレージとキャッシュ分類</strong></td>
|
|
165
|
+
<td align="center"><strong>長押しで音声入力</strong></td>
|
|
166
|
+
<td align="center"><strong>入力欄の添付ファイル</strong></td>
|
|
167
|
+
</tr>
|
|
168
|
+
</table>
|
|
169
|
+
|
|
170
|
+
## プラグインのインストール
|
|
171
|
+
|
|
172
|
+
`dsh` CLI と `pnpm` があり、`dsh web` を起動できることが前提です。現在のユーザーで `pnpm --version` を確認してください。 現在のユーザーから `pnpm` を呼べることを確認します。
|
|
173
|
+
|
|
174
|
+
LAN ではプラグインをインストールします。
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
dsh plugin --profile web add dsh-plugin-mobile-gateway@latest
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Linux の公開 IP では統合初期化を使用します。プラグインを導入・更新し、Helper 用に一度 sudo を要求します。
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
npx --yes dsh-plugin-mobile-gateway@latest init
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
`init` は実行中 npm パッケージと同じ厳密な版を DSH profile に入れ、その版のみ pnpm の新版待機期間を省略し、Helper と揃えます。
|
|
187
|
+
|
|
188
|
+
導入後に WebUI を停止・再起動します。
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
dsh web
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
サイドバー下部の「モバイル端末」を確認します。
|
|
195
|
+
|
|
196
|
+
## LAN ペアリング
|
|
197
|
+
|
|
198
|
+
DSH マシンと端末が相互接続できる同一 LAN にある場合。
|
|
199
|
+
|
|
200
|
+
1. WebUI のモバイル端末を開きます。
|
|
201
|
+
2. 常時モード、短時間なら一時モードを選択します。
|
|
202
|
+
3. 端末認証を有効に保ちます。
|
|
203
|
+
4. LAN 直接接続を選び `ws://<电脑局域网 IP>:3081/ws/mobile` を確認します。Tunnel は停止不要です。ヘルプは環境と用途を説明し選択を勝手に変更しません。
|
|
204
|
+
5. 端末名を入力し QR を生成します。
|
|
205
|
+
6. モバイルクライアントの端末認証からスキャンします。
|
|
206
|
+
7. WebUI がオンライン表示になれば完了です。
|
|
207
|
+
|
|
208
|
+
遮断される場合は TCP `3081` をプライベートネットワークのみ許可します。公開しないでください。
|
|
209
|
+
|
|
210
|
+
## Linux サーバーの公開 IP ペアリング
|
|
211
|
+
|
|
212
|
+
> [!NOTE]
|
|
213
|
+
> ここでの公開 IP は Linux サーバーです。`v0.6.4` 以降、固定 IPv4 の Ubuntu/Debian に対応します。Node.js、`pnpm`、`dsh` CLI の事前導入が必要です。CentOS は未対応。
|
|
214
|
+
|
|
215
|
+
### 1. 公開ポートの準備
|
|
216
|
+
|
|
217
|
+
クラウドの公開 IPv4 を取得し、セキュリティグループで TCP `80` と `443` を許可します。WebUI・TCP `3081` は公開しません。
|
|
218
|
+
|
|
219
|
+
### 2. 初期化
|
|
220
|
+
|
|
221
|
+
一般 DSH ユーザーで `pnpm` を確認します。
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
pnpm --version
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
同じ一般ユーザーで実行します。`root`・`sudo npx` は使いません。
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
npm_config_registry=https://registry.npmjs.org \
|
|
231
|
+
npx --yes dsh-plugin-mobile-gateway@latest init
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
プラグインを導入・更新し、Nginx、Certbot、Helper、証明書更新タイマー用に一度 sudo を要求します。`init` が版を揃えます。
|
|
235
|
+
|
|
236
|
+
WebUI を起動・再起動します。
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
dsh web
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### 3. リモート WebUI を開く
|
|
243
|
+
|
|
244
|
+
VS Code・Cursor のポート転送を優先するか、自分のマシンで実行します。
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
ssh -N -L <本地端口>:127.0.0.1:<DSH 实际端口> <服务器用户名>@<服务器公网 IP>
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
ローカルブラウザーで開きます。
|
|
251
|
+
|
|
252
|
+
```text
|
|
253
|
+
http://127.0.0.1:<本地端口>
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### 4. 公開入口の設定
|
|
257
|
+
|
|
258
|
+
モバイル端末の公開接続に IPv4 を入れて設定・更新します。Helper は `dsh web` の実ポートを検出し Nginx・TLS・`wss://<公网 IP>/ws/mobile` を設定します。
|
|
259
|
+
|
|
260
|
+
<p align="center">
|
|
261
|
+
<img src="../assets/public-access-ui.jpg" alt="端末パネルで公開入口を設定" width="960">
|
|
262
|
+
</p>
|
|
263
|
+
|
|
264
|
+
### 5. 端末をペアリング
|
|
265
|
+
|
|
266
|
+
1. モバイル接続と端末認証を有効にします。
|
|
267
|
+
2. 端末名と QR を生成します。
|
|
268
|
+
3. 端末の認証画面でスキャンします。
|
|
269
|
+
4. WebUI のオンラインを確認します。
|
|
270
|
+
|
|
271
|
+
QR は一度限り、5 分で失効します。必要なら再生成してください。
|
|
272
|
+
|
|
273
|
+
## 家庭の Windows / macOS へのリモート接続
|
|
274
|
+
|
|
275
|
+
固定 IP がないことが多く、ルーターのポート転送は勧めません。アカウント・ドメイン不要の Quick と固定ドメインの名前付き Tunnel を提供します。初回に公式 `cloudflared` をダウンロード・検証しユーザーのキャッシュへ保存します。手動サービス導入は不要です。
|
|
276
|
+
|
|
277
|
+
`dsh web` を起動し、マシンを起こしてネット接続と DSH 実行を維持します。スリープ・終了で切断します。
|
|
278
|
+
|
|
279
|
+
### Cloudflare Quick Tunnel(一時接続)
|
|
280
|
+
|
|
281
|
+
既定は自動・LAN 優先です。外部接続では接続・ペアリングから外部優先または Cloudflare 外部に変更します。未設定ならピンクの案内が出ます。Quick・ドメイン不要を選び起動すると `cloudflared` を取得し `wss://<名称>.trycloudflare.com/ws/mobile` を設定します。LAN では LAN 優先・直接接続へ戻し、Tunnel は維持できます。QR を生成・スキャン。オフで停止、DSH 再起動では有効な Quick を **新しいランダムアドレス**で復元します。
|
|
282
|
+
|
|
283
|
+
Cloudflare アカウント・Token・ドメインは不要ですが、再起動・再接続でアドレスが変わる場合があります。アプリは確認済みアドレスのみ信頼するため再生成・スキャンが必要です。**PC がオンラインでも旧 URL の有効性は保証されません。** Quick は試験・開発向け、同時接続制限と可用性保証なし。[公式文書](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/do-more-with-tunnels/trycloudflare/)を参照。
|
|
284
|
+
|
|
285
|
+
Tunnel 設定更新はモードと名前付き設定を保存し、同じ設定なら再接続しません。再起動は端末接続を切りトンネルだけを再構築し、DSH Web は再起動しません。Quick の URL が変われば旧 QR を消去し再スキャンが必要です。`cloudflared` の自動更新は行いません。
|
|
286
|
+
|
|
287
|
+
### Cloudflare 名前付き Tunnel(固定アドレス)
|
|
288
|
+
|
|
289
|
+
1. [リモート管理 Tunnel を作成](https://developers.cloudflare.com/tunnel/get-started/)し、`gateway.example.com` などを追加して **Service URL** を `http://127.0.0.1:3082` にします。システムサービス・ルーターの受信ポートは不要です。
|
|
290
|
+
2. Add a replica の Token をコピーし、名前付き・固定ドメインを選びホストと Token を入力して起動します。常時モード・専用リスナー・`cloudflared` を起動し、登録後にローカルから DNS・TLS・公開経路を検証します。成功後 `wss://gateway.example.com/ws/mobile` で QR を生成します。
|
|
291
|
+
3. `dsh web` で有効な Tunnel を復元します。パネルで停止すると専用プロセス・入口も停止します。ゲートウェイを手動停止すると一時停止し、再開で復元します。 管理対象の `cloudflared` も停止します。
|
|
292
|
+
|
|
293
|
+
両入口とも `/ws/mobile` WebSocket のみ受付。WebUI や `/mgw` などは 404。ローカル Debug 認証が無効でも端末認証は必須です。Token は `<deviceFile>.cloudflare.json`(既定 `~/.dsh/mobile-gateway-devices.json.cloudflare.json`)に権限 `0600` で保存しブラウザーに返しません。専用 `cloudflared-bin` を使用し他アプリ・システムの実行ファイルは参照しません。毎回検証し、欠損・破損時のみ固定版を取得して公式 SHA-256 と照合します。外部バイナリは `cloudflaredPath` 指定時のみ。`cloudflarePort` 変更時は Service URL も変更してください。 キャッシュの `cloudflared` は毎回検証します。
|
|
294
|
+
|
|
295
|
+
#### 公開入口の検証と状態
|
|
296
|
+
|
|
297
|
+
`state: online` はトンネル登録だけを示し、公開 DNS・TLS・経路の正常性は保証しません。`endpointHealth`(状態・案内・時刻・エラー)と `publicReady` を返します。接続後の自動検証と、管理認証付き `POST /mgw/cloudflare/check` による再検証があり、再起動しません。
|
|
298
|
+
|
|
299
|
+
システム DNS と厳格な証明書検証の HTTPS WebSocket を使い、認証トークン・リダイレクトは使いません。401 と新規ランダム検証印のエコーだけを成功とし、汎用 Proxy/Access の 401 は不可です。印は有効な端末認証がない拒否でのみ返し、権限を付与しません。ローカルの一時的結果で、端末ネットワーク・認証・同期は保証しません。
|
|
300
|
+
|
|
301
|
+
ローカル DNS 失敗は公開レコード不在の証明ではありません。NXDOMAIN キャッシュ、DNS、VPN、Proxy を確認し、公開ホストと Proxy 有効 CNAME を確認して再試行します。TLS 検証は無効にしません。Tunnel Token はリモート Tunnel の実行用で DNS・経路を作成しません。別権限の CLI/API による設定は本検証の対象外です。
|
|
302
|
+
|
|
303
|
+
### Tailscale(継続利用向け)
|
|
304
|
+
|
|
305
|
+
1. マシンと端末に [Tailscale](https://tailscale.com/download) を入れ、同じ Tailnet に参加します。
|
|
306
|
+
2. PowerShell または macOS ターミナルで実行します。
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
tailscale serve --bg 3081
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
3. `tailscale serve status` で `https://<设备名>.<tailnet>.ts.net` を確認します。
|
|
313
|
+
4. `wss://<设备名>.<tailnet>.ts.net/ws/mobile` を WebUI に入れて QR を生成します。
|
|
314
|
+
|
|
315
|
+
Serve は同じ Tailnet 内の許可端末のみ接続でき HTTPS を提供します。停止は `tailscale serve reset`。[公式文書](https://tailscale.com/docs/reference/tailscale-cli/serve)。
|
|
316
|
+
|
|
317
|
+
## 接続方式一覧
|
|
318
|
+
|
|
319
|
+
| 用途 | 入口 | モバイル WebSocket | 追加設定 | ポート・認証 |
|
|
320
|
+
|---|---|---|---|---|
|
|
321
|
+
| 同一 LAN | プラグイン LAN | `ws://<电脑局域网 IP>:3081/ws/mobile` | Helper/Nginx 不要、相互到達可能 | TCP `3081` は私設のみ、認証有効 |
|
|
322
|
+
| ローカル iOS シミュレーター | WebUI ローカル | `ws://127.0.0.1:<DSH WebUI 端口>/ws/mobile` | Helper/Nginx・別 `3081` 不要 | 外部ポートなし、認証無効は Debug 限定 |
|
|
323
|
+
| Linux 公開 | Helper + Nginx + TLS | `wss://<服务器公网 IPv4>/ws/mobile` | `init` 後 WebUI に IPv4 | TCP `80/443`、DSH/`3081` 非公開、認証必須 |
|
|
324
|
+
| 家庭 Windows / macOS | 名前付き Tunnel | `wss://<公开域名>/ws/mobile` | `127.0.0.1:3082` へ経路、ホスト/Token | ルーター転送不要、認証必須 |
|
|
325
|
+
| 家庭 Windows / macOS | Quick Tunnel | `wss://<随机名称>.trycloudflare.com/ws/mobile` | 起動、URL 変更後再スキャン | ドメイン/アカウント/転送不要、認証必須 |
|
|
326
|
+
| 家庭 Windows / macOS | Tailscale Serve | `wss://<Tailscale 域名>/ws/mobile` | `127.0.0.1:3081` へ転送、URL 設定 | ルーター転送不要、認証有効 |
|
|
327
|
+
|
|
328
|
+
## Linux 公開入口の管理
|
|
329
|
+
|
|
330
|
+
状態確認:
|
|
331
|
+
|
|
332
|
+
```bash
|
|
333
|
+
sudo env "PATH=$PATH" npx --yes dsh-plugin-mobile-gateway@latest status
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
公開入口削除:
|
|
337
|
+
|
|
338
|
+
```bash
|
|
339
|
+
sudo env "PATH=$PATH" npx --yes dsh-plugin-mobile-gateway@latest remove
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
## 更新
|
|
343
|
+
|
|
344
|
+
初期化を再実行してプラグインと Helper を更新します。
|
|
345
|
+
|
|
346
|
+
```bash
|
|
347
|
+
npx --yes dsh-plugin-mobile-gateway@latest init
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
その後 `dsh web` を停止・再起動します。
|
|
351
|
+
|
|
352
|
+
## アンインストール
|
|
353
|
+
|
|
354
|
+
```bash
|
|
355
|
+
dsh plugin --profile web remove dsh-plugin-mobile-gateway
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
Helper も削除する場合(既存 Nginx 公開設定は残します):
|
|
359
|
+
|
|
360
|
+
```bash
|
|
361
|
+
sudo env "PATH=$PATH" npx --yes dsh-plugin-mobile-gateway@latest remove-helper
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
## トラブルシューティング
|
|
365
|
+
|
|
366
|
+
| 症状 | 対応 |
|
|
367
|
+
|---|---|
|
|
368
|
+
| モバイル端末がない | `web` profile に導入し `dsh web` を完全再起動 |
|
|
369
|
+
| `503` | WebUI でモバイル接続を有効化 |
|
|
370
|
+
| `401` | QR を再生成してペアリング |
|
|
371
|
+
| Linux 公開接続タイムアウト | セキュリティグループ、Firewall、TCP `80/443` を確認 |
|
|
372
|
+
| 公開アドレスなし | 公開 IPv4 を入力・更新 |
|
|
373
|
+
| Cloudflare 取得失敗 | GitHub Releases 接続確認、または導入済み絶対パスを `cloudflaredPath` に指定 |
|
|
374
|
+
| Quick 再起動後接続不能 | QR 再生成・スキャン、固定 URL は名前付き Tunnel |
|
|
375
|
+
| 既存 Cloudflare 設定と競合 | `~/.cloudflared/config.yaml` を含む設定ディレクトリは Quick と共有不可。エラーと[公式説明](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/do-more-with-tunnels/trycloudflare/)を参照 |
|
|
376
|
+
| Tunnel 接続済みだが端末不可 | Service URL `http://127.0.0.1:<端口>`、DNS、認証を確認 |
|
|
377
|
+
| サーバーログ | 一時ディレクトリの `mobile-gateway.log`。Windows `%TEMP%`、macOS `$TMPDIR`、Linux 通常 `/tmp` |
|
|
378
|
+
|
|
379
|
+
## ソース開発
|
|
380
|
+
|
|
381
|
+
```bash
|
|
382
|
+
dsh plugin --profile web add file:/absolute/path/to/dsh-plugin-mobile-gateway
|
|
383
|
+
npm test
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
ツールメニューからゲートウェイ再起動・DSH Web 停止ができます。`dsh web` 起動時のみ再起動でき、元引数と `--no-open` で再実行し既存タブが復帰・更新を待ちます。新プロセスは元 Terminal の前景ジョブ外でバックグラウンド実行します。メニューまたは Web ポートの DSH に `SIGTERM` で停止します。一時切断と Quick URL 変更があり得ます。ソース変更後は再導入・再起動が必要です。 最後に `dsh web` を再起動してください。
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
## 公式音声入力の接続
|
|
390
|
+
|
|
391
|
+
DSH 0.2.0-rc.2 の公式実験プラグインに対応。認識器照会、モデル準備・進捗購読、設定、録音文字起こしが可能です。キャンセル・切断で中止し Agent には自動送信しません。
|
|
392
|
+
|
|
393
|
+
1. 音声入力(`@deepseek-ai/dsh-experimental-voice-input-bundle`)を有効にしモデルを取得・準備します。
|
|
394
|
+
2. 認証済み制御接続で `speech-catalog` を照会し、可用性と `ready`/`standby` を確認します。
|
|
395
|
+
3. 録音全体を 16 kHz・モノラル PCM16 WAV に変換し `speech-transcribe` で Base64 を送信します。
|
|
396
|
+
4. `speech-transcript` を入力欄へ入れ、確認後に既存 `message` で送信します。
|
|
397
|
+
|
|
398
|
+
モデルは DSH マシンで実行し端末には不要です。録音全体の文字起こしのみ対応し、UI・権限・変換は端末側の実装が必要です。[プロトコル](../../PROTOCOL.md#官方语音输入speech-input-v1)を参照。
|
|
399
|
+
|
|
400
|
+
公式プラグインで WAV を検証できます。認識 Provider はテスト用で、モデルを取得しません。
|
|
401
|
+
|
|
402
|
+
```bash
|
|
403
|
+
DSH_INSTALL_ROOT=/absolute/path/to/@deepseek-ai/dsh node test/speech-official.test.mjs
|
|
404
|
+
```
|