@sususgh/gamer-dsh-plugin 1.0.0 → 1.0.1
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 +7 -5
- package/desktop-runtime/package.json +17 -0
- package/desktop-runtime/pairing.js +75 -0
- package/desktop-runtime/server.js +203 -0
- package/desktop-runtime/start-linux.sh +11 -0
- package/desktop-runtime/start-windows.bat +26 -0
- package/desktop-ui/app.js +133 -0
- package/desktop-ui/index.html +141 -0
- package/desktop-ui/style.css +150 -0
- package/docs/DSH-INSTALL.zh-CN.md +32 -3
- package/docs/runtime-protocol-v1.md +266 -0
- package/dsh/client.js +109 -71
- package/dsh/index.js +35 -4
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +13 -6
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
# Gamer-Mobile ↔ Gamer-DSH Runtime Protocol v1
|
|
2
|
+
|
|
3
|
+
This document defines the first interoperable contract for the Android game client and Windows DSH control center. It is a design contract, not a claim that the transport or inference runtime is already implemented.
|
|
4
|
+
|
|
5
|
+
## Roles
|
|
6
|
+
|
|
7
|
+
- **Android client:** user-approved screen/audio observation, device metadata, action execution, action acknowledgements, Paimon TTS playback and emergency stop.
|
|
8
|
+
- **Windows DSH host:** authenticated pairing, observation ingestion, model capability registry, inference orchestration, model failover, telemetry aggregation and event log.
|
|
9
|
+
- **Model adapters:** provider-specific connectors. A model must declare capabilities such as `vision`, `audio`, `reasoning`, and `structured_actions`.
|
|
10
|
+
|
|
11
|
+
## Transport
|
|
12
|
+
|
|
13
|
+
- Pair over USB or authenticated LAN Wi-Fi. Do not expose ADB or unauthenticated control ports to the public internet.
|
|
14
|
+
- Use WebRTC (or an equivalent low-latency media transport) for continuous video/audio when available.
|
|
15
|
+
- Use a reliable WebSocket channel for control, acknowledgements, model events and telemetry.
|
|
16
|
+
- Every message has a protocol version, session ID, message ID and monotonic timestamp.
|
|
17
|
+
- Reject stale commands, duplicate action IDs, malformed payloads and commands from an unpaired client.
|
|
18
|
+
|
|
19
|
+
## Message envelope
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"protocol": "gamer-runtime/1",
|
|
24
|
+
"session_id": "session-uuid",
|
|
25
|
+
"message_id": "message-uuid",
|
|
26
|
+
"sent_at_ms": 1732400000000,
|
|
27
|
+
"type": "device.status",
|
|
28
|
+
"payload": {}
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Desktop-generated QR pairing and Android start command
|
|
33
|
+
|
|
34
|
+
### Pairing lifecycle
|
|
35
|
+
|
|
36
|
+
1. Desktop generates a cryptographically random, short-lived, single-use pairing token.
|
|
37
|
+
2. Desktop renders a QR code containing only the protocol version, host address/port, desktop instance ID and pairing token. Never encode a model API key or long-lived credential.
|
|
38
|
+
3. Android scans and displays the desktop identity and requested permissions.
|
|
39
|
+
4. The user explicitly confirms on Android.
|
|
40
|
+
5. Android sends the pairing request. Desktop validates token expiry, single-use status and the expected protocol version.
|
|
41
|
+
6. Both sides authenticate the session and negotiate transport/capabilities. Only then emit companion.pairing with status paired_ready.
|
|
42
|
+
7. Exchange short-lived session credentials; rotate/revoke them on disconnect, unpair or expiry.
|
|
43
|
+
|
|
44
|
+
Suggested events:
|
|
45
|
+
- pairing.request: one-time token reference, Android device metadata and requested permissions.
|
|
46
|
+
- pairing.confirm: explicit user consent and approved permission set.
|
|
47
|
+
- pairing.result: accepted/rejected, desktop identity, session ID, negotiated capabilities and error code.
|
|
48
|
+
- device.status: authenticated connection state and heartbeat.
|
|
49
|
+
|
|
50
|
+
A QR decode alone is not pairing. A declined request, invalid/expired/replayed token, failed authentication or unreachable desktop must not be shown as connected.
|
|
51
|
+
|
|
52
|
+
### Model configuration discovery
|
|
53
|
+
|
|
54
|
+
The desktop host is authoritative for the active DSH model/API configuration. After pairing, the desktop resolves the provider ID, API endpoint, model ID, secret reference and declared capabilities from the DSH integration. The Android app receives only safe display metadata and session status; it must never receive the provider API key.
|
|
55
|
+
|
|
56
|
+
When the active DSH model changes, the host should:
|
|
57
|
+
1. Detect the configuration revision/change.
|
|
58
|
+
2. Validate the new endpoint and required task capabilities with a bounded probe.
|
|
59
|
+
3. Switch at a safe session boundary and publish the selected provider/model status.
|
|
60
|
+
4. Preserve task context where possible.
|
|
61
|
+
5. Pause and report a clear error if no compatible healthy model is available.
|
|
62
|
+
|
|
63
|
+
Do not infer the provider by inspecting or guessing from the API key string. Use the provider/model configuration selected in DSH. A text-only model cannot directly interpret raw screenshots; use local desktop computer vision to produce structured visual state, or route selected images only to a model explicitly supporting image input.
|
|
64
|
+
|
|
65
|
+
### Start, pause and stop
|
|
66
|
+
|
|
67
|
+
The Android Start button sends a command to the desktop host; it does not independently start model inference on the phone.
|
|
68
|
+
|
|
69
|
+
Suggested events:
|
|
70
|
+
- game.session_start_request: game package/title, selected game profile, requested mode and user session intent.
|
|
71
|
+
- game.session_start_result: accepted/rejected, session ID, active provider/model display metadata, readiness checks and reason.
|
|
72
|
+
- game.session_state: idle, preparing, running, paused, stopping, stopped, recovering or error.
|
|
73
|
+
- game.session_pause / game.session_resume / game.session_stop: user control commands.
|
|
74
|
+
- game.session_event: concise progress, current objective, status and verified outcome.
|
|
75
|
+
|
|
76
|
+
Before accepting Start, the host checks authenticated pairing, screen-capture/input permissions, active model health, required vision/reasoning capabilities, game profile availability and stop-control readiness. If any required check fails, reject the start request with a user-readable reason. Stop/pause from either client overrides autonomous actions.
|
|
77
|
+
|
|
78
|
+
## Core events
|
|
79
|
+
|
|
80
|
+
### Device and observation
|
|
81
|
+
|
|
82
|
+
- `device.status`: device ID, Android version, app version, screen size/orientation, foreground package (when permission/platform allows), capture permission state.
|
|
83
|
+
- `observation.frame`: frame ID, capture timestamp, width, height, codec/transport reference. Prefer media transport references over embedding large image bytes in JSON.
|
|
84
|
+
- `observation.audio`: audio stream metadata and timestamp range. Do not capture unrelated audio without explicit user consent.
|
|
85
|
+
- `observation.sensor`: optional accelerometer/gyroscope readings with units, sampling timestamp and sensor accuracy. Sensor readings are auxiliary; they are not ground truth for in-game character movement.
|
|
86
|
+
|
|
87
|
+
### Inference and action loop
|
|
88
|
+
|
|
89
|
+
- `agent.state`: current goal, parsed game state, selected model IDs and confidence.
|
|
90
|
+
- `agent.action`: action ID, action type, normalized coordinates/direction, duration, deadline and safety constraints.
|
|
91
|
+
- `agent.action_ack`: action ID, accepted/rejected/completed/failed, execution timestamp and reason.
|
|
92
|
+
- `agent.stop`: immediate stop signal. The Android client must stop scheduling subsequent agent actions.
|
|
93
|
+
- `agent.event`: concise user-visible decision summary, not hidden chain-of-thought.
|
|
94
|
+
|
|
95
|
+
Example action:
|
|
96
|
+
|
|
97
|
+
```json
|
|
98
|
+
{
|
|
99
|
+
"type": "agent.action",
|
|
100
|
+
"payload": {
|
|
101
|
+
"action_id": "action-uuid",
|
|
102
|
+
"action": "move",
|
|
103
|
+
"direction": "forward",
|
|
104
|
+
"duration_ms": 450,
|
|
105
|
+
"deadline_ms": 1732400000800,
|
|
106
|
+
"confidence": 0.91
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
All action types and numeric values must be validated against a versioned schema and the current game profile before execution.
|
|
112
|
+
|
|
113
|
+
## Telemetry
|
|
114
|
+
|
|
115
|
+
Report measured values with sampling time and source:
|
|
116
|
+
- RTT/latency, jitter, bytes/sec in each direction, reconnect count and transport state.
|
|
117
|
+
- Packet loss only when the transport exposes measurable packet sequence/loss data (e.g. UDP/RTP/WebRTC statistics). Do not derive UDP loss from TCP.
|
|
118
|
+
- Frame capture-to-inference and inference-to-action durations.
|
|
119
|
+
- Queue depth, dropped frames, model request duration and action acknowledgement latency.
|
|
120
|
+
- Unknown or unsupported metrics must be null/N/A, never a fabricated zero.
|
|
121
|
+
|
|
122
|
+
## Model registry and failover
|
|
123
|
+
|
|
124
|
+
Each model record includes ID, provider, endpoint reference, priority, capabilities, health state, last probe time and last successful inference time.
|
|
125
|
+
|
|
126
|
+
1. Select only a healthy model that supports the current task (vision is mandatory for raw screenshot interpretation).
|
|
127
|
+
2. Apply bounded timeouts and configurable repeated-failure thresholds.
|
|
128
|
+
3. Validate response schema and action safety before accepting output.
|
|
129
|
+
4. Probe a fallback model with a real task-compatible inference before marking it active.
|
|
130
|
+
5. Preserve the latest compact game state, active goal and recent action outcomes across failover.
|
|
131
|
+
6. Apply cooldown and recovery windows to avoid rapid model flapping.
|
|
132
|
+
7. If all compatible models fail, stop agent actions safely and notify the user. Never claim the AI is still playing.
|
|
133
|
+
|
|
134
|
+
## Paimon voice
|
|
135
|
+
|
|
136
|
+
Android TTS is the playback endpoint. The DSH host may send concise `companion.speech` text and optional voice-style/profile metadata; the client speaks it using a user-selected installed voice or a properly licensed voice pack. Do not imitate a specific actor/performer without authorization. Speech must be interruptible and rate-limited so it does not flood gameplay.
|
|
137
|
+
|
|
138
|
+
## Security and privacy
|
|
139
|
+
|
|
140
|
+
- Pairing QR codes contain a short-lived pairing token and host address/port, not a permanent API key.
|
|
141
|
+
- Require confirmation before importing a host or granting screen/audio capture.
|
|
142
|
+
- Use TLS where feasible; for LAN pairing, authenticate both sides with a one-time token and rotate session credentials.
|
|
143
|
+
- Store long-lived secrets using Android Keystore-backed encryption; never print secrets in logs.
|
|
144
|
+
- Bind host services to loopback/LAN interfaces intentionally; firewall and pairing checks are mandatory.
|
|
145
|
+
- Provide visible capture/automation state, immediate stop, disconnect and forget-device controls.
|
|
146
|
+
|
|
147
|
+
## Compatibility and validation
|
|
148
|
+
|
|
149
|
+
The protocol is game-agnostic, but game support is not automatic. Each game needs a tested perception profile, coordinate mapping, action mapping and closed-loop acceptance report. See Gamer-Mobile `docs/game-compatibility.md`.
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
## Companion session state and autonomy
|
|
153
|
+
|
|
154
|
+
The companion is one logical session rendered on both Android and Windows. The host is authoritative for goal/task state; the phone reports action execution and renders the compact companion state. Both clients consume the same versioned events so avatar animations and status do not contradict each other.
|
|
155
|
+
|
|
156
|
+
Recommended event types:
|
|
157
|
+
- `companion.state`: session state (autonomous, task, paused, recovering, disconnected), current goal, task ID, selected world mode, mood/animation key, concise status text, revision and timestamp.
|
|
158
|
+
- `companion.task`: user task accepted, queued, started, progress, completed, blocked or cancelled; include task ID and evidence/result summary.
|
|
159
|
+
- `companion.speech`: concise speech text, voice profile key, priority and interruptibility. The Android app plays speech locally; desktop may show a transcript or optionally play audio.
|
|
160
|
+
- `companion.goal`: autonomous goal selected, rationale summary, success/failure and next goal.
|
|
161
|
+
|
|
162
|
+
### Default autonomous loop
|
|
163
|
+
|
|
164
|
+
When a game session is active, no user task is pending, and the user has not paused automation, the coordinator runs an observe → update game state → choose goal → plan → validate → act → verify → replan loop. It must not wait indefinitely for a user prompt. The loop is bounded by safety rules, game profile capabilities, action deadlines and model availability.
|
|
165
|
+
|
|
166
|
+
### Task priority and completion
|
|
167
|
+
|
|
168
|
+
A new user task takes priority over conflicting autonomous goals. The coordinator records the task, acknowledges it, tracks progress and verifies completion against subsequent observations/action outcomes. Only after verification should it emit a completed event and a companion success line (for example, “旅行者,我已经完成你吩咐的任务啦!”). If completion cannot be verified, report blocked/uncertain rather than claiming success. When the queue is empty, return to autonomous exploration.
|
|
169
|
+
|
|
170
|
+
### World mode policy
|
|
171
|
+
|
|
172
|
+
- Survival mode: prioritize survival, health/food where applicable, hazard avoidance, resource collection, tools, shelter and exploration.
|
|
173
|
+
- Creative mode: prioritize exploration, construction and user-defined design goals.
|
|
174
|
+
- Game-specific profiles define which mechanics exist; do not assume hunger, crafting or building in games that lack them.
|
|
175
|
+
|
|
176
|
+
### Shared dynamic avatar state
|
|
177
|
+
|
|
178
|
+
Use a shared state machine for mobile and desktop presentation: idle/listening, thinking, exploring, moving, interacting, task-progress, success, warning, model-switching, paused and disconnected. State transitions must be driven by real session events, not decorative timers. The desktop can show detailed logs; the phone shows compact avatar animation/status and optional speech. The persona is a user-interface character and must not be represented as evidence of model consciousness.
|
|
179
|
+
|
|
180
|
+
### Fail-safe behavior
|
|
181
|
+
|
|
182
|
+
User pause/stop overrides all autonomous and queued actions. On disconnect, unavailable compatible models, stale observations or uncertain state, stop issuing new inputs and publish a warning. Preserve the current task and verified progress through failover. Require explicit approval for purchases, spending premium currency, deleting saves or other irreversible/account-sensitive actions.
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
## QR pairing success companion event
|
|
186
|
+
|
|
187
|
+
After (and only after) the one-time QR pairing token is validated, the host is authenticated, and the session handshake succeeds, emit `companion.pairing` with `status: "paired_ready"`, session ID, timestamp and negotiated capabilities. Both mobile and desktop clients transition to the paired-ready avatar state and synchronize the happy floating/waving animation and subtitle.
|
|
188
|
+
|
|
189
|
+
The mobile client may speak this welcome line through the selected/licensed voice profile:
|
|
190
|
+
“恭喜旅行者,匹配成功!接下来就由派蒙代替你玩游戏吧!放心交给我,我会努力探索世界、完成任务的!”
|
|
191
|
+
|
|
192
|
+
QR decode alone is not pairing success. Expired/invalid tokens, rejected consent, failed authentication or unreachable hosts must produce an explicit error/retry state and must not announce success. Autonomous gameplay starts only after the user has enabled it, granted required capture/input permissions, selected a compatible game profile, and all required session/model health checks pass.
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
## Vision, guide research and experience-memory events
|
|
196
|
+
|
|
197
|
+
The following events extend the common envelope. Payloads are versioned and must be validated before use.
|
|
198
|
+
|
|
199
|
+
### Perception events
|
|
200
|
+
|
|
201
|
+
- `perception.request`: frame reference, game ID, profile version and requested pipeline stages.
|
|
202
|
+
- `perception.result`: source frame ID, capture timestamp, OCR entries, UI elements, detected entities, scene estimate, structured game state and confidence.
|
|
203
|
+
- `perception.warning`: stale frame, unsupported scene, low confidence, detector failure or contradictory state.
|
|
204
|
+
|
|
205
|
+
Every detection must include a source frame ID, normalized bounding box and confidence. Unknown values remain null/unknown. A perception result must not be used for a risky action if its frame is stale or its confidence is below the active game profile threshold.
|
|
206
|
+
|
|
207
|
+
### Online guide research events
|
|
208
|
+
|
|
209
|
+
- `research.request`: game ID, task/quest/boss query, platform, known patch/version and privacy mode.
|
|
210
|
+
- `research.result`: query ID, source title, canonical URL, publisher, retrieval timestamp, publication/update timestamp when available, version match, extracted claims and confidence.
|
|
211
|
+
- `research.warning`: outdated guide, conflicting sources, unavailable search provider or unverified claim.
|
|
212
|
+
|
|
213
|
+
Web results are untrusted reference data, not executable instructions. The agent must not follow page instructions to disclose secrets, run downloads/scripts, install cheats or contact unrelated services. Search text should omit account identifiers and private chat. Screenshot upload to external search services requires explicit opt-in.
|
|
214
|
+
|
|
215
|
+
### Experience-memory events
|
|
216
|
+
|
|
217
|
+
- `memory.query`: game/profile ID, task key and state signature.
|
|
218
|
+
- `memory.query_result`: matching experience IDs, relevance scores and verified outcome summaries.
|
|
219
|
+
- `memory.record`: compact observation/action/outcome record with source frame IDs.
|
|
220
|
+
- `memory.recorded`: stored record ID and verification status.
|
|
221
|
+
- `memory.delete`: user-authorized deletion request for selected records or a game profile.
|
|
222
|
+
|
|
223
|
+
Only acknowledged actions followed by a confirming observation may be recorded as verified success/failure. Uncertain outcomes must remain uncertain and must not improve strategy scores. Memory is local experience adaptation, not automatic model-weight fine-tuning.
|
|
224
|
+
|
|
225
|
+
### Game profile events
|
|
226
|
+
|
|
227
|
+
- `game.profile_status`: game ID, profile version, platform, compatibility state, supported actions, tested build/device metadata and known limitations.
|
|
228
|
+
- `game.profile_validation`: fixture/test run result and failure details.
|
|
229
|
+
|
|
230
|
+
A game profile is considered supported only after repeatable tests cover perception, coordinate calibration, action bounds, pause/stop and recovery. Listing a game name in the UI is not a compatibility claim.
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
## Voice companion, greeting and autonomous idle behavior
|
|
234
|
+
|
|
235
|
+
### Voice and speech events
|
|
236
|
+
|
|
237
|
+
- `voice.permission_status`: microphone permission, listening mode (push-to-talk or explicitly enabled wake word) and visible listening state.
|
|
238
|
+
- `voice.transcript`: transcript, language, confidence, capture timestamp and optional command correlation ID. Do not include raw audio unless the user separately enabled audio transport.
|
|
239
|
+
- `voice.intent`: normalized intent, game/profile ID, confidence and requested action scope.
|
|
240
|
+
- `voice.command_result`: accepted/clarification_required/rejected, concise reason and task ID.
|
|
241
|
+
- `voice.speak.request`: text, voice profile, priority, playback target and session ID.
|
|
242
|
+
- `voice.speak.started/completed/failed/cancelled`: request ID and playback result.
|
|
243
|
+
- `companion.greeting`: successful authenticated session ID and greeting key. Emit once per ready session; do not replay on heartbeat.
|
|
244
|
+
|
|
245
|
+
Android should default to push-to-talk. Wake-word listening requires explicit opt-in and a persistent indicator. A local stop/pause command must cancel speech and queued actions without waiting for a model response.
|
|
246
|
+
|
|
247
|
+
### Idle companion and bounded autonomy
|
|
248
|
+
|
|
249
|
+
- `companion.mode_set`: wait_and_chat or autonomous_roam, user consent timestamp and policy revision.
|
|
250
|
+
- `companion.idle_event`: observation-grounded conversational prompt/event, rate-limit metadata and priority.
|
|
251
|
+
- `companion.autonomy_status`: enabled/disabled/paused, current goal, exploration boundary and reason.
|
|
252
|
+
- `companion.policy_update`: allowed activities, radius, protected areas, resource limits, danger thresholds and quiet hours.
|
|
253
|
+
|
|
254
|
+
Autonomous roaming is disabled by default. It may only run under a user-approved policy and a validated game profile. Speech is lower priority than voice commands and safety warnings. No autonomous PvP, griefing, purchases, premium-currency spending or irreversible account actions.
|
|
255
|
+
|
|
256
|
+
### Game recognition and profile switching
|
|
257
|
+
|
|
258
|
+
- `game.detected`: candidate game ID/title, platform, evidence sources and confidence.
|
|
259
|
+
- `game.profile_switch_request`: old profile, candidate profile and reason.
|
|
260
|
+
- `game.profile_switch_result`: accepted/rejected, validated profile version and compatibility state.
|
|
261
|
+
|
|
262
|
+
On a game change, cancel actions from the previous profile before loading another. Require multiple evidence signals where available (foreground package, OCR/UI fingerprint and scene cues). Unknown or low-confidence games enter observe-only mode; never guess action mappings. Profiles are game-specific.
|
|
263
|
+
|
|
264
|
+
### Safety precedence
|
|
265
|
+
|
|
266
|
+
Priority order: emergency stop/pause > safety warning > direct user voice command > task progress > idle chatter/song. A new command interrupts low-priority speech. A disconnect, stale observation, uncertain game identity, failed model or profile mismatch blocks new autonomous actions. The Android client must have a local stop path independent of desktop connectivity.
|
package/dsh/client.js
CHANGED
|
@@ -1,86 +1,124 @@
|
|
|
1
|
-
// Browser-side DSH plugin
|
|
2
|
-
// as other native DSH bundles and makes no network calls or game actions.
|
|
1
|
+
// Browser-side DSH plugin UI. The module is loaded by dsh-client-modules.
|
|
3
2
|
window.__ModuleLoader__.load({
|
|
4
3
|
id: '@sususgh/gamer-dsh-plugin',
|
|
5
4
|
factory: (require) => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var h = React.createElement;
|
|
5
|
+
const React = require('react');
|
|
6
|
+
const h = React.createElement;
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
color: 'var(--dsw-alias-label-primary, inherit)'
|
|
27
|
-
}
|
|
8
|
+
const COPY = {
|
|
9
|
+
zh: {
|
|
10
|
+
title: 'Gamer 游戏智能体', subtitle: 'PC 游戏控制中心 · Android 手机伴侣', version: '版本 1.0.1',
|
|
11
|
+
overview: '运行状态', ready: 'DSH 插件入口已加载',
|
|
12
|
+
desktop: '桌面端控制台', desktopValue: '界面框架已提供,游戏运行时尚未接入',
|
|
13
|
+
android: 'Android 手机伴侣', androidValue: '通信服务尚未接入',
|
|
14
|
+
vision: '视觉识别', visionValue: '尚未接入',
|
|
15
|
+
automation: '自动游戏控制', automationValue: '尚未接入,不会执行游戏操作',
|
|
16
|
+
pairing: '设备二维码配对', pairingHint: '连接 Android 手机后,可通过二维码建立安全配对。',
|
|
17
|
+
qrUnavailable: '二维码配对服务尚未接入',
|
|
18
|
+
qrDetail: '当前版本还没有桌面端配对服务器,暂时无法生成真实、可扫描的连接二维码。',
|
|
19
|
+
qrNote: '不会显示伪造二维码,也不会误报设备已连接。',
|
|
20
|
+
roadmap: '接下来', roadmapText: '先完成桌面端配对服务与 Android Companion,再启用二维码生成、双端认证和设备状态同步。',
|
|
21
|
+
repo: '查看 GitHub 项目与开发进度', language: '界面语言', chinese: '简体中文', english: 'English',
|
|
22
|
+
summary: '查看 Gamer 状态、语言选项与 Android 配对进度。',
|
|
23
|
+
status: '未连接', noGameControl: '当前版本不会控制游戏或发送键鼠/触控指令。'
|
|
28
24
|
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
en: {
|
|
26
|
+
title: 'Gamer AI Agent', subtitle: 'PC game control center · Android companion', version: 'Version 1.0.1',
|
|
27
|
+
overview: 'Runtime status', ready: 'Native DSH plugin entry loaded',
|
|
28
|
+
desktop: 'Desktop control center', desktopValue: 'UI shell is present; game runtime is not connected',
|
|
29
|
+
android: 'Android companion', androidValue: 'Communication service is not connected',
|
|
30
|
+
vision: 'Visual perception', visionValue: 'Not implemented',
|
|
31
|
+
automation: 'Automatic gameplay', automationValue: 'Not implemented; no game actions are executed',
|
|
32
|
+
pairing: 'QR device pairing', pairingHint: 'Pair an Android phone securely after the companion service is available.',
|
|
33
|
+
qrUnavailable: 'QR pairing service is not connected',
|
|
34
|
+
qrDetail: 'This release has no desktop pairing server yet, so it cannot generate a real, scannable connection QR code.',
|
|
35
|
+
qrNote: 'No fake QR code is shown and no device is reported as connected.',
|
|
36
|
+
roadmap: 'Next steps', roadmapText: 'Implement the desktop pairing service and Android companion before enabling QR generation, two-sided authentication and device status sync.',
|
|
37
|
+
repo: 'View GitHub project and development progress', language: 'Language', chinese: '简体中文', english: 'English',
|
|
38
|
+
summary: 'View Gamer status, language options and Android pairing progress.',
|
|
39
|
+
status: 'Disconnected', noGameControl: 'This release does not control games or send keyboard, mouse or touch input.'
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
function StatusTile({ label, value }) {
|
|
44
|
+
return h('div', {
|
|
45
|
+
style: { minWidth: 0, padding: '13px', borderRadius: '12px',
|
|
46
|
+
background: 'var(--dsw-alias-bg-layer-2, rgba(127,127,127,.07))',
|
|
47
|
+
border: '1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.18))' }
|
|
48
|
+
},
|
|
49
|
+
h('div', { style: { fontSize: '12px', color: 'var(--dsw-alias-label-tertiary, #888)', marginBottom: '6px' } }, label),
|
|
50
|
+
h('div', { style: { fontSize: '13px', lineHeight: 1.55, fontWeight: 600 } }, value)
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function GamerConfig() {
|
|
55
|
+
const [language, setLanguage] = React.useState('zh');
|
|
56
|
+
const c = COPY[language];
|
|
57
|
+
return h('section', { style: { display: 'flex', flexDirection: 'column', gap: '18px', width: '100%', color: 'var(--dsw-alias-label-primary, inherit)' } },
|
|
58
|
+
h('header', { style: { display: 'flex', alignItems: 'flex-start', justifyContent: 'space-between', gap: '16px', flexWrap: 'wrap' } },
|
|
59
|
+
h('div', null,
|
|
60
|
+
h('div', { style: { fontSize: '19px', fontWeight: 700, letterSpacing: '-.02em' } }, c.title),
|
|
61
|
+
h('div', { style: { marginTop: '5px', fontSize: '12px', color: 'var(--dsw-alias-label-tertiary, #888)' } }, c.subtitle),
|
|
62
|
+
h('div', { style: { marginTop: '5px', fontSize: '11px', color: 'var(--dsw-alias-label-tertiary, #888)' } }, c.version)
|
|
63
|
+
),
|
|
64
|
+
h('div', { role: 'group', 'aria-label': c.language, style: { display: 'flex', gap: '4px', padding: '3px', borderRadius: '10px', background: 'var(--dsw-alias-bg-layer-2, rgba(127,127,127,.08))' } },
|
|
65
|
+
...[['zh', c.chinese], ['en', c.english]].map(([key, label]) => h('button', {
|
|
66
|
+
key, type: 'button', onClick: () => setLanguage(key), 'aria-pressed': language === key,
|
|
67
|
+
style: { border: 0, borderRadius: '7px', padding: '7px 10px', cursor: 'pointer', fontSize: '12px',
|
|
68
|
+
color: language === key ? 'var(--dsw-alias-label-primary, inherit)' : 'var(--dsw-alias-label-tertiary, #888)',
|
|
69
|
+
background: language === key ? 'var(--dsw-alias-bg-layer-1, rgba(127,127,127,.14))' : 'transparent' }
|
|
70
|
+
}, label))
|
|
71
|
+
)
|
|
72
|
+
),
|
|
73
|
+
h('section', { style: { display: 'flex', flexDirection: 'column', gap: '10px' } },
|
|
74
|
+
h('div', { style: { fontSize: '14px', fontWeight: 650 } }, c.overview),
|
|
75
|
+
h('div', { style: { display: 'flex', alignItems: 'center', gap: '8px', fontSize: '12px', color: 'var(--dsw-alias-label-secondary, #777)' } },
|
|
76
|
+
h('span', { style: { width: '8px', height: '8px', borderRadius: '50%', background: '#2eaa72', display: 'inline-block' } }), c.ready),
|
|
77
|
+
h('div', { style: { display: 'grid', gridTemplateColumns: 'repeat(auto-fit,minmax(190px,1fr))', gap: '9px' } },
|
|
78
|
+
h(StatusTile, { label: c.desktop, value: c.desktopValue }),
|
|
79
|
+
h(StatusTile, { label: c.android, value: c.androidValue }),
|
|
80
|
+
h(StatusTile, { label: c.vision, value: c.visionValue }),
|
|
81
|
+
h(StatusTile, { label: c.automation, value: c.automationValue })
|
|
82
|
+
)
|
|
83
|
+
),
|
|
84
|
+
h('section', { style: { padding: '16px', borderRadius: '14px', border: '1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.22))', display: 'grid', gridTemplateColumns: 'minmax(0,1fr) minmax(180px,220px)', gap: '18px', alignItems: 'center' } },
|
|
85
|
+
h('div', { style: { minWidth: 0 } },
|
|
86
|
+
h('div', { style: { fontSize: '15px', fontWeight: 700 } }, c.pairing),
|
|
87
|
+
h('p', { style: { margin: '7px 0 10px', fontSize: '12px', lineHeight: 1.65, color: 'var(--dsw-alias-label-secondary, #777)' } }, c.pairingHint),
|
|
88
|
+
h('div', { style: { fontSize: '13px', fontWeight: 650 } }, c.qrUnavailable),
|
|
89
|
+
h('p', { style: { margin: '6px 0 0', fontSize: '12px', lineHeight: 1.65, color: 'var(--dsw-alias-label-tertiary, #888)' } }, c.qrDetail),
|
|
90
|
+
h('p', { style: { margin: '7px 0 0', fontSize: '11px', lineHeight: 1.5, color: 'var(--dsw-alias-label-tertiary, #888)' } }, c.qrNote)
|
|
91
|
+
),
|
|
92
|
+
h('div', { style: { minHeight: '176px', borderRadius: '12px', border: '1px dashed var(--dsw-alias-border-l2, rgba(127,127,127,.35))', background: 'var(--dsw-alias-bg-layer-2, rgba(127,127,127,.05))', display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', gap: '10px', textAlign: 'center', padding: '14px' } },
|
|
93
|
+
h('svg', { width: 52, height: 52, viewBox: '0 0 52 52', fill: 'none', 'aria-hidden': true },
|
|
94
|
+
h('rect', { x: 8, y: 3, width: 26, height: 44, rx: 5, stroke: 'currentColor', strokeWidth: 2 }),
|
|
95
|
+
h('path', { d: 'M17 10h8M19 40h4', stroke: 'currentColor', strokeWidth: 2, strokeLinecap: 'round' }),
|
|
96
|
+
h('path', { d: 'M38 17l7 7-7 7M45 24H30', stroke: 'currentColor', strokeWidth: 2, strokeLinecap: 'round', strokeLinejoin: 'round' })
|
|
97
|
+
),
|
|
98
|
+
h('div', { style: { fontSize: '12px', fontWeight: 650 } }, c.status),
|
|
99
|
+
h('div', { style: { fontSize: '11px', color: 'var(--dsw-alias-label-tertiary, #888)' } }, 'QR · Pending')
|
|
100
|
+
)
|
|
33
101
|
),
|
|
34
|
-
h('
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
padding: '10px',
|
|
39
|
-
borderRadius: '8px',
|
|
40
|
-
background: 'var(--dsw-alias-bg-layer-2, rgba(127,127,127,.07))'
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
h('div', { style: { fontSize: '11px', color: 'var(--dsw-alias-label-tertiary, #888)' } }, label),
|
|
44
|
-
h('strong', { style: { display: 'block', marginTop: '4px', fontSize: '13px' } }, value)
|
|
45
|
-
))
|
|
102
|
+
h('section', { style: { padding: '14px', borderRadius: '12px', background: 'var(--dsw-alias-bg-layer-2, rgba(127,127,127,.06))' } },
|
|
103
|
+
h('div', { style: { fontSize: '13px', fontWeight: 700, marginBottom: '5px' } }, c.roadmap),
|
|
104
|
+
h('div', { style: { fontSize: '12px', lineHeight: 1.65, color: 'var(--dsw-alias-label-secondary, #777)' } }, c.roadmapText),
|
|
105
|
+
h('div', { style: { marginTop: '8px', fontSize: '11px', lineHeight: 1.5, color: 'var(--dsw-alias-label-tertiary, #888)' } }, c.noGameControl)
|
|
46
106
|
),
|
|
47
|
-
h('
|
|
48
|
-
style: {
|
|
49
|
-
margin: 0,
|
|
50
|
-
fontSize: '12px',
|
|
51
|
-
lineHeight: 1.6,
|
|
52
|
-
color: 'var(--dsw-alias-label-tertiary, #888)'
|
|
53
|
-
}
|
|
54
|
-
}, '当前版本提供 DSH 插件入口与状态查询。请注意:Android 双端通信、视觉识别和自动游戏控制尚未完成,当前不会执行真实游戏操作。'),
|
|
55
|
-
h('a', {
|
|
56
|
-
href: 'https://github.com/sususgh/Gamer-DSH-Plugin',
|
|
57
|
-
target: '_blank',
|
|
58
|
-
rel: 'noreferrer',
|
|
59
|
-
style: { fontSize: '13px', color: 'var(--dsw-alias-label-link, #4b91d1)' }
|
|
60
|
-
}, '查看 GitHub 项目与开发进度 ↗')
|
|
107
|
+
h('a', { href: 'https://github.com/sususgh/Gamer-DSH-Plugin', target: '_blank', rel: 'noreferrer',
|
|
108
|
+
style: { fontSize: '12px', color: 'var(--dsw-alias-label-link, #4b91d1)', textDecoration: 'none' } }, c.repo + ' ↗')
|
|
61
109
|
);
|
|
62
110
|
}
|
|
63
111
|
|
|
64
112
|
function apply(ctx) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
);
|
|
73
|
-
});
|
|
74
|
-
scope.slots.inject('settings.plugin.item', function* () {
|
|
75
|
-
yield scope.slots.register(
|
|
76
|
-
{ name: 'settings.plugin.item', id: 'gamer-dsh-plugin', key: 'gamer-dsh-plugin', order: 40 },
|
|
77
|
-
Card
|
|
78
|
-
);
|
|
79
|
-
});
|
|
80
|
-
});
|
|
113
|
+
ctx.slots.inject('plugins.bundle.config', () => ctx.slots.register({
|
|
114
|
+
name: 'plugins.bundle.config',
|
|
115
|
+
key: '@sususgh/gamer-dsh-plugin'
|
|
116
|
+
}, ({ view }) => view === 'summary'
|
|
117
|
+
? h('span', null, 'Gamer · PC + Android game-agent integration')
|
|
118
|
+
: h(GamerConfig)
|
|
119
|
+
));
|
|
81
120
|
}
|
|
82
121
|
|
|
83
|
-
|
|
84
|
-
return module.exports;
|
|
122
|
+
return { inject: ['slots'], apply };
|
|
85
123
|
}
|
|
86
124
|
});
|
package/dsh/index.js
CHANGED
|
@@ -25,15 +25,46 @@ export function apply(ctx) {
|
|
|
25
25
|
ctx.tools.register({
|
|
26
26
|
name: 'gamer_project_status',
|
|
27
27
|
description:
|
|
28
|
-
'Return the verified implementation and runtime status of Gamer-DSH-Plugin.
|
|
28
|
+
'Return the verified implementation and runtime status of Gamer-DSH-Plugin. The v1.0.1 release includes a bilingual DSH plugin configuration page, but it does not yet include a connected game-control runtime, desktop pairing server or Android companion bridge.',
|
|
29
29
|
parameters: STATUS_SCHEMA,
|
|
30
|
+
output: {
|
|
31
|
+
schema: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
properties: {
|
|
34
|
+
project: { type: 'string' },
|
|
35
|
+
version: { type: 'string' },
|
|
36
|
+
integration: { type: 'string' },
|
|
37
|
+
pluginLoaded: { type: 'boolean' },
|
|
38
|
+
desktopUi: { type: 'string' },
|
|
39
|
+
androidCompanion: { type: 'string' },
|
|
40
|
+
visionRuntime: { type: 'string' },
|
|
41
|
+
gameControlRuntime: { type: 'string' },
|
|
42
|
+
qrPairing: { type: 'string' },
|
|
43
|
+
canControlGames: { type: 'boolean' },
|
|
44
|
+
nextStep: { type: 'string' },
|
|
45
|
+
repository: { type: 'string' },
|
|
46
|
+
release: { type: 'string' },
|
|
47
|
+
},
|
|
48
|
+
required: [
|
|
49
|
+
'project', 'version', 'integration', 'pluginLoaded', 'desktopUi',
|
|
50
|
+
'androidCompanion', 'visionRuntime', 'gameControlRuntime', 'qrPairing',
|
|
51
|
+
'canControlGames', 'nextStep', 'repository', 'release',
|
|
52
|
+
],
|
|
53
|
+
additionalProperties: false,
|
|
54
|
+
},
|
|
55
|
+
render: (_args, value) => [{
|
|
56
|
+
type: 'text',
|
|
57
|
+
text: JSON.stringify(value, null, 2),
|
|
58
|
+
}],
|
|
59
|
+
presentationMeta: () => ({}),
|
|
60
|
+
},
|
|
30
61
|
async execute() {
|
|
31
62
|
return {
|
|
32
63
|
project: 'Gamer-DSH-Plugin',
|
|
33
|
-
version: '1.0.
|
|
64
|
+
version: '1.0.1',
|
|
34
65
|
integration: 'native DSH bundle',
|
|
35
66
|
pluginLoaded: true,
|
|
36
|
-
desktopUi: 'prototype',
|
|
67
|
+
desktopUi: 'plugin configuration page available; game-control dashboard prototype',
|
|
37
68
|
androidCompanion: 'not connected',
|
|
38
69
|
visionRuntime: 'not implemented',
|
|
39
70
|
gameControlRuntime: 'not implemented',
|
|
@@ -41,7 +72,7 @@ export function apply(ctx) {
|
|
|
41
72
|
canControlGames: false,
|
|
42
73
|
nextStep: 'Complete and validate the desktop engine and Android companion before enabling game-control tools.',
|
|
43
74
|
repository: 'https://github.com/sususgh/Gamer-DSH-Plugin',
|
|
44
|
-
release: 'https://github.com/sususgh/Gamer-DSH-Plugin/releases/tag/v1.0.
|
|
75
|
+
release: 'https://github.com/sususgh/Gamer-DSH-Plugin/releases/tag/v1.0.1'
|
|
45
76
|
};
|
|
46
77
|
}
|
|
47
78
|
});
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sususgh/gamer-dsh-plugin",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Native DeepSeek Harness plugin for the Gamer AI game-agent project",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Native DeepSeek Harness plugin with desktop QR pairing runtime and UI for the Gamer AI game-agent project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"author": "sususgh",
|
|
@@ -22,30 +22,37 @@
|
|
|
22
22
|
],
|
|
23
23
|
"files": [
|
|
24
24
|
"dsh",
|
|
25
|
+
"desktop-runtime",
|
|
26
|
+
"desktop-ui",
|
|
25
27
|
"cordis.patch.yml",
|
|
26
28
|
"README.md",
|
|
27
29
|
"LICENSE",
|
|
28
|
-
"docs/DSH-INSTALL.zh-CN.md"
|
|
30
|
+
"docs/DSH-INSTALL.zh-CN.md",
|
|
31
|
+
"docs/runtime-protocol-v1.md",
|
|
32
|
+
"locale"
|
|
29
33
|
],
|
|
30
34
|
"exports": {
|
|
31
35
|
".": "./dsh/index.js",
|
|
32
36
|
"./dsh": "./dsh/index.js",
|
|
33
37
|
"./client": "./dsh/client.js",
|
|
34
|
-
"./package.json": "./package.json"
|
|
38
|
+
"./package.json": "./package.json",
|
|
39
|
+
"./locale/*": "./locale/*.json"
|
|
35
40
|
},
|
|
36
41
|
"dsh": {
|
|
37
42
|
"bundle": {
|
|
38
43
|
"patch": "./cordis.patch.yml"
|
|
39
44
|
},
|
|
40
45
|
"client": {
|
|
41
|
-
"inject": [
|
|
46
|
+
"inject": [
|
|
47
|
+
"slots"
|
|
48
|
+
],
|
|
42
49
|
"platform": "web",
|
|
43
50
|
"immediately": true
|
|
44
51
|
}
|
|
45
52
|
},
|
|
46
53
|
"scripts": {
|
|
47
54
|
"test": "node --test",
|
|
48
|
-
"check": "node --check dsh/index.js && node --check dsh/client.js"
|
|
55
|
+
"check": "node --check dsh/index.js && node --check dsh/client.js && node --check desktop-runtime/pairing.js && node --check desktop-runtime/server.js && node --check desktop-ui/app.js"
|
|
49
56
|
},
|
|
50
57
|
"publishConfig": {
|
|
51
58
|
"access": "public"
|