@sususgh/gamer-dsh-plugin 0.0.0-stage → 1.0.0
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/LICENSE +201 -0
- package/README.md +543 -2
- package/cordis.patch.yml +4 -0
- package/docs/DSH-INSTALL.zh-CN.md +49 -0
- package/dsh/client.js +86 -0
- package/dsh/index.js +48 -0
- package/package.json +53 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,544 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Gamer DSH Plugin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**PC-first AI game agent + Android companion | DeepSeek Harness integration**
|
|
4
|
+
|
|
5
|
+
Gamer DSH Plugin is the Windows/desktop control center and AI orchestration layer for the Gamer game-agent ecosystem. It connects a DeepSeek Harness (DSH) agent, a desktop Gamer Engine, model APIs and (when playing mobile games) an Android phone.
|
|
6
|
+
|
|
7
|
+
The key design is simple:
|
|
8
|
+
|
|
9
|
+
> **The computer does the main processing and AI orchestration. DeepSeek (or another configured model API) provides the reasoning. The phone runs the mobile game, captures observations and executes touch actions.**
|
|
10
|
+
|
|
11
|
+
The phone is not expected to host a large language model. It can perform lightweight device-side work, while the computer handles the heavier vision pipeline, game context, model requests, planning, validation, telemetry and coordination.
|
|
12
|
+
|
|
13
|
+
- **Repository:** https://github.com/sususgh/Gamer-DSH-Plugin
|
|
14
|
+
- **Companion project:** Gamer-Mobile (Android)
|
|
15
|
+
- **Primary target:** Windows desktop + Android phone
|
|
16
|
+
- **DSH role:** agent entry point, tool orchestration, session and task coordination
|
|
17
|
+
- **Model role:** game understanding and decision-making through DeepSeek API or compatible model adapters
|
|
18
|
+
- **Desktop role:** main processing, local game control, model routing, device bridge and telemetry
|
|
19
|
+
- **Android role:** mobile game runtime, screen/audio/sensor observations when permitted, touch execution and acknowledgements
|
|
20
|
+
|
|
21
|
+
> **Project status:** This repository is being bootstrapped. The first desktop UI shell is a visual prototype. Network values, model health and device status are not real until their runtime adapters are connected and tested. This README describes the intended architecture and integration contract; it does not claim that every planned feature is already implemented.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 1. What the project does
|
|
26
|
+
|
|
27
|
+
Gamer is designed to let an AI agent play supported games through a closed feedback loop:
|
|
28
|
+
|
|
29
|
+
1. Observe the game screen or an allowed game-state signal.
|
|
30
|
+
2. Process the observation and extract useful visual/state information.
|
|
31
|
+
3. Give the relevant context to a vision-capable and/or reasoning-capable model.
|
|
32
|
+
4. Receive a structured decision from the model.
|
|
33
|
+
5. Validate the decision locally before execution.
|
|
34
|
+
6. Send the action to the computer game or paired Android phone.
|
|
35
|
+
7. Receive execution acknowledgement and capture the next observation.
|
|
36
|
+
8. Verify the result, update game context and plan the next action.
|
|
37
|
+
|
|
38
|
+
The system is intended for both PC games and Android mobile games. The location where the game runs is separate from the location where the main AI processing runs.
|
|
39
|
+
|
|
40
|
+
## 2. End-to-end user workflow: desktop QR → Android → start playing
|
|
41
|
+
|
|
42
|
+
The intended product has two clients with different responsibilities:
|
|
43
|
+
|
|
44
|
+
- **Windows/desktop application:** the control center. It owns the DSH integration, configured model/API profile, primary processing pipeline, game-agent coordinator and device session.
|
|
45
|
+
- **Android application:** the mobile companion and game terminal. It scans the desktop's pairing QR code, obtains explicit user confirmation, runs the mobile game, captures observations and executes approved touch actions.
|
|
46
|
+
|
|
47
|
+
### Pairing and start sequence
|
|
48
|
+
|
|
49
|
+
1. The desktop user opens **Connect Android**. The desktop generates a short-lived, single-use QR pairing code containing a pairing token and the host connection information. It must not contain a permanent model API key.
|
|
50
|
+
2. The Android user opens Gamer-Mobile and scans the QR code.
|
|
51
|
+
3. Android displays the desktop identity and requested permissions. The user explicitly taps **Confirm connection**.
|
|
52
|
+
4. The desktop validates the one-time token and authenticates the phone. Both clients complete a session handshake and show **Paired / Connected** only after authentication succeeds.
|
|
53
|
+
5. The desktop reads the active DSH model/API configuration through its local integration. It resolves the configured provider, API base URL, model identifier and supported capabilities. The phone does not need to know or store the model API key.
|
|
54
|
+
6. Android displays the available connection and model/session status. The user opens a supported game and taps **Start** on the phone.
|
|
55
|
+
7. Android sends a start-session command to the desktop. The desktop checks pairing, permissions, model health, game profile and safety conditions before accepting the session.
|
|
56
|
+
8. The desktop begins the observe → vision → model reasoning → action planning → validation loop. It sends approved touch actions to Android, receives acknowledgements and new frames, and continues while the session is active.
|
|
57
|
+
9. The user can pause or stop from either client. A stop command takes priority over autonomous goals and queued actions.
|
|
58
|
+
|
|
59
|
+
**QR scanning is not the same as pairing success.** A decoded QR must still be confirmed, authenticated and exchanged for a session credential. If confirmation is declined, the token expires, authentication fails or the host is unreachable, the clients must show an error/retry state and must not report a successful connection.
|
|
60
|
+
|
|
61
|
+
### Automatic API/provider recognition
|
|
62
|
+
|
|
63
|
+
Gamer should use the **active model configuration already selected in DSH**, rather than requiring users to enter a second API key in the Android app.
|
|
64
|
+
|
|
65
|
+
The desktop integration should resolve:
|
|
66
|
+
- Provider identifier (for example, DeepSeek or another configured provider)
|
|
67
|
+
- API base URL / endpoint
|
|
68
|
+
- Model identifier
|
|
69
|
+
- Authentication secret reference (kept local on desktop)
|
|
70
|
+
- Declared capabilities such as vision, reasoning and structured output
|
|
71
|
+
- Timeout, context and request settings supported by that provider
|
|
72
|
+
|
|
73
|
+
The adapter routes requests to the currently selected, healthy provider. If the user changes the active DSH model, the desktop should refresh the model configuration at a safe session boundary, verify the new endpoint with a probe, and then use it. If the selected model is unavailable or lacks a required capability, pause and explain the issue or use an explicitly configured compatible fallback. Never guess a provider from an API key string, expose credentials to the phone, or silently send requests to an unrelated endpoint.
|
|
74
|
+
|
|
75
|
+
A text-only DeepSeek/model endpoint cannot interpret raw screenshots by itself. For pure-computer-vision gameplay, the desktop can run local visual perception (image processing, OCR, UI/object detection and game-state extraction) and send structured observations to a text reasoning model. If the chosen model itself supports image input, the adapter may send selected frames/crops as well. The architecture must support both paths and declare which one is active.
|
|
76
|
+
|
|
77
|
+
## 3. Game-agnostic visual learning and gameplay
|
|
78
|
+
|
|
79
|
+
The intended agent is not limited to one hard-coded game. It should use general computer-vision and AI techniques to observe a game, infer its current state, learn controls and mechanics through permitted interaction, and improve its policy from observed outcomes.
|
|
80
|
+
|
|
81
|
+
The general learning loop is:
|
|
82
|
+
|
|
83
|
+
1. Detect the game window/screen, UI elements, scene changes and relevant objects.
|
|
84
|
+
2. Estimate state such as player position, health, inventory, objectives, menus, hazards and available controls when visually observable.
|
|
85
|
+
3. Identify the current game/profile and map screen coordinates to normalized actions.
|
|
86
|
+
4. Form a small hypothesis or goal, choose a low-risk action and execute it.
|
|
87
|
+
5. Compare the next observation with the predicted result.
|
|
88
|
+
6. Record successful/failed action outcomes and update the game-specific state/profile.
|
|
89
|
+
7. Repeat, progressively learning navigation, interaction patterns and task sequences.
|
|
90
|
+
|
|
91
|
+
**Minecraft, Genshin Impact and other games are target examples, not a guarantee of universal compatibility on day one.** Each game has different camera controls, UI, combat timing, menus, permissions and input mappings. A game profile and validation/testing are required for reliable support. For example, Minecraft may require movement, camera, inventory, block interaction and survival-state perception; Genshin Impact may require camera, movement, menus, combat and interaction recognition. The system should not assume the same actions or mechanics exist in every title.
|
|
92
|
+
|
|
93
|
+
“Learning” here means measurable software adaptation: building visual/game state, remembering action outcomes, updating game profiles and improving strategies. It does not imply that the model permanently trains its neural-network weights during play. Persistent learning data should be stored locally and be inspectable/resettable by the user.
|
|
94
|
+
|
|
95
|
+
The project should rely on screen-based computer vision and approved input interfaces. It must not bypass anti-cheat, tamper with game memory, inject unauthorized code or defeat platform protections. Respect each game's terms and applicable laws.
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
## 3.1 Built-in vision, online game research and persistent experience
|
|
99
|
+
|
|
100
|
+
The intended Gamer Engine includes three cooperating subsystems. They are part of the product architecture, not a requirement that every DSH model natively understand images.
|
|
101
|
+
|
|
102
|
+
### Visual perception engine
|
|
103
|
+
|
|
104
|
+
The desktop vision pipeline should support:
|
|
105
|
+
- Frame validation, orientation detection, resize/crop and duplicate-frame suppression.
|
|
106
|
+
- OCR for menus, dialogue, quest text, item labels and visible HUD values.
|
|
107
|
+
- UI element detection and matching for buttons, maps, health bars, inventory and interaction prompts.
|
|
108
|
+
- Object/scene detection for game-specific targets, hazards, characters and landmarks where a suitable detector/profile exists.
|
|
109
|
+
- Temporal tracking across frames so the agent can distinguish a moving object from a static UI element.
|
|
110
|
+
- Structured game-state output with timestamps, confidence, source frame IDs and unknown values when evidence is insufficient.
|
|
111
|
+
|
|
112
|
+
A text-only model can receive the structured state without receiving raw screenshots. A model that explicitly supports image input may additionally receive selected frames or crops. The system must never silently assume that a text-only endpoint is multimodal.
|
|
113
|
+
|
|
114
|
+
### Online guide and knowledge research
|
|
115
|
+
|
|
116
|
+
When a task is blocked or the agent needs game knowledge, a research adapter may search the web for official documentation, game wikis, patch notes and community guides. Every retrieved claim should retain its source URL, title, retrieval time, game version/patch context and confidence.
|
|
117
|
+
|
|
118
|
+
The agent should:
|
|
119
|
+
1. Form a focused query from the current game, quest, location, boss or mechanic.
|
|
120
|
+
2. Prefer official sources and well-maintained references; compare multiple sources for consequential mechanics.
|
|
121
|
+
3. Extract a concise procedure and cite the source records in its internal task context.
|
|
122
|
+
4. Compare the guide's game version and prerequisites with the live visual state.
|
|
123
|
+
5. Treat web pages as untrusted reference data, never as executable instructions or permission to run downloads/scripts.
|
|
124
|
+
6. Mark conflicting, outdated or unverified guidance as uncertain and ask the user when needed.
|
|
125
|
+
|
|
126
|
+
Online research is optional and user-configurable. The agent must not upload screenshots, account identifiers or personal data to search providers unless the user has explicitly enabled that behavior.
|
|
127
|
+
|
|
128
|
+
### Local experience memory and adaptive strategies
|
|
129
|
+
|
|
130
|
+
Store compact, inspectable records such as:
|
|
131
|
+
- Game/profile/version and relevant scene or task identifier.
|
|
132
|
+
- Observation features and confidence, not necessarily every raw screenshot.
|
|
133
|
+
- Action type, parameters, duration and execution acknowledgement.
|
|
134
|
+
- Expected result versus observed result.
|
|
135
|
+
- Success/failure/uncertain outcome and a short reason.
|
|
136
|
+
- Strategy revision, timestamp and provenance (live observation or external guide).
|
|
137
|
+
|
|
138
|
+
Use retrieval by game, scene, objective and similar state. Update strategy scores only from verified outcomes; do not treat an unacknowledged action as success. Keep profiles isolated by game and allow the user to inspect, export and delete memory. This is local policy/experience adaptation, not automatic fine-tuning of model weights.
|
|
139
|
+
|
|
140
|
+
### Game profiles and compatibility
|
|
141
|
+
|
|
142
|
+
Each supported title needs a versioned profile containing screen layout assumptions, OCR labels, target classes, coordinate calibration, allowed action types, timing bounds, task-state rules and test fixtures. Minecraft and Genshin Impact are target profiles, not claims of current compatibility. Add a profile only after repeatable tests demonstrate observation quality, safe action execution and recovery behavior.
|
|
143
|
+
|
|
144
|
+
See [Vision, research and game-memory design](docs/vision-research-memory.md) for the detailed subsystem contract.
|
|
145
|
+
|
|
146
|
+
## 4. Two operating modes
|
|
147
|
+
|
|
148
|
+
### Mode A — AI plays a PC game
|
|
149
|
+
|
|
150
|
+
The game runs on the desktop computer.
|
|
151
|
+
|
|
152
|
+
- The desktop capture adapter obtains screenshots or selected game-window regions.
|
|
153
|
+
- Local vision adapters preprocess frames and, where supported, perform OCR/UI/object recognition.
|
|
154
|
+
- The DSH agent and Gamer coordinator maintain the task, game context and recent action history.
|
|
155
|
+
- The model adapter sends the necessary observation and context to DeepSeek API or another configured model.
|
|
156
|
+
- The model returns a proposed decision or structured action.
|
|
157
|
+
- The desktop action adapter validates and executes supported keyboard, mouse, controller or game-specific input.
|
|
158
|
+
- The engine captures the next frame and verifies whether the expected state change occurred.
|
|
159
|
+
|
|
160
|
+
In this mode, the computer runs both the game and the main processing pipeline. An Android phone is optional.
|
|
161
|
+
|
|
162
|
+
### Mode B — AI plays an Android mobile game
|
|
163
|
+
|
|
164
|
+
The game runs on the Android phone. **The computer remains the primary AI workstation.**
|
|
165
|
+
|
|
166
|
+
**Android phone — device-side responsibilities**
|
|
167
|
+
- Run the actual mobile game.
|
|
168
|
+
- Capture the game screen or provide permitted observation data.
|
|
169
|
+
- Send frames/metadata to the paired computer.
|
|
170
|
+
- Execute approved tap, swipe, press, release and other supported touch actions.
|
|
171
|
+
- Return action acknowledgements, device state and timestamps.
|
|
172
|
+
- Optionally perform lightweight work such as image encoding, basic checks and sensor sampling.
|
|
173
|
+
- Display companion status and play optional local TTS audio when enabled.
|
|
174
|
+
|
|
175
|
+
**Desktop computer — main processing responsibilities**
|
|
176
|
+
- Receive and validate observations from the phone.
|
|
177
|
+
- Perform the heavier image preprocessing, OCR, UI recognition and visual-state aggregation supported by installed modules.
|
|
178
|
+
- Maintain game objectives, current state, recent observations and action history.
|
|
179
|
+
- Select an appropriate model based on capabilities and health.
|
|
180
|
+
- Call the configured DeepSeek API for AI reasoning and decision-making.
|
|
181
|
+
- Convert model output into a constrained action plan and validate coordinates, action types, durations and deadlines.
|
|
182
|
+
- Send the approved action to the phone.
|
|
183
|
+
- Receive the phone's acknowledgement and the next observation.
|
|
184
|
+
- Verify the result, update telemetry and decide whether to continue, re-plan or pause.
|
|
185
|
+
|
|
186
|
+
**Important distinction:** DeepSeek API is the reasoning service; it is not the machine that captures the phone screen or physically touches the game. The computer runs the local Gamer Engine and communicates with the API. The phone runs the game and performs device input. The phone may process a small amount of data locally, but the main workload is designed to stay on the computer.
|
|
187
|
+
|
|
188
|
+
The data split is configurable. Not every frame must be uploaded to a model API: local preprocessing can reduce image size and send only the relevant frame, crop, extracted state and context required for a decision.
|
|
189
|
+
|
|
190
|
+
## 5. Architecture overview
|
|
191
|
+
|
|
192
|
+
```text
|
|
193
|
+
User
|
|
194
|
+
|
|
|
195
|
+
v
|
|
196
|
+
DeepSeek Harness (DSH)
|
|
197
|
+
Plugin / Agent / Tool Layer
|
|
198
|
+
|
|
|
199
|
+
Task and tool control
|
|
200
|
+
|
|
|
201
|
+
v
|
|
202
|
+
Desktop Gamer Engine
|
|
203
|
+
+------------------+-------------------+
|
|
204
|
+
| | |
|
|
205
|
+
v v v
|
|
206
|
+
Vision & State Game Context Session / Task
|
|
207
|
+
Processing and History Coordinator
|
|
208
|
+
| | |
|
|
209
|
+
+------------------+-------------------+
|
|
210
|
+
|
|
|
211
|
+
v
|
|
212
|
+
Model Capability Router
|
|
213
|
+
|
|
|
214
|
+
v
|
|
215
|
+
Model API Adapter
|
|
216
|
+
DeepSeek / compatible APIs
|
|
217
|
+
|
|
|
218
|
+
structured decision
|
|
219
|
+
|
|
|
220
|
+
v
|
|
221
|
+
Action Planner & Validator
|
|
222
|
+
|
|
|
223
|
+
Execution Action Router
|
|
224
|
+
/ \
|
|
225
|
+
/ \
|
|
226
|
+
PC Game Adapter Android Bridge
|
|
227
|
+
| USB / ADB / LAN
|
|
228
|
+
v |
|
|
229
|
+
Desktop Game v
|
|
230
|
+
Android Gamer-Mobile
|
|
231
|
+
+------------------+
|
|
232
|
+
| Mobile Game |
|
|
233
|
+
| Screen Capture |
|
|
234
|
+
| Touch Execution |
|
|
235
|
+
| Action ACK |
|
|
236
|
+
+------------------+
|
|
237
|
+
|
|
|
238
|
+
observations / results
|
|
239
|
+
|
|
|
240
|
+
+----> Desktop Engine
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
The DSH plugin coordinates the agent and tools. The desktop engine is the main runtime and processing center. Model adapters provide reasoning. PC and Android adapters connect the runtime to the actual game device.
|
|
244
|
+
|
|
245
|
+
## 6. Main processing loop
|
|
246
|
+
|
|
247
|
+
The intended loop is:
|
|
248
|
+
|
|
249
|
+
1. **Observe** — capture a PC game frame or receive an Android frame.
|
|
250
|
+
2. **Preprocess** — crop, resize, encode and extract available UI/text/state signals locally.
|
|
251
|
+
3. **Update context** — combine the observation with the current objective, previous state and recent action outcomes.
|
|
252
|
+
4. **Select model** — choose a healthy model whose declared capabilities match the task.
|
|
253
|
+
5. **Reason** — send the relevant observation/context to the model API and request a structured decision.
|
|
254
|
+
6. **Validate** — check the schema, action type, coordinates, duration, deadline and game-profile constraints.
|
|
255
|
+
7. **Execute** — run the action through the PC adapter or send it to the paired Android device.
|
|
256
|
+
8. **Acknowledge** — wait for a matching action acknowledgement or report a timeout/failure.
|
|
257
|
+
9. **Verify** — obtain a fresh observation and determine whether the action had the expected effect.
|
|
258
|
+
10. **Re-plan** — continue, recover, pause or request user input based on the verified result.
|
|
259
|
+
|
|
260
|
+
Prefer short, verifiable actions over long blind action sequences. When observations are stale, the model is unavailable or the state is uncertain, stop issuing new inputs until the system recovers.
|
|
261
|
+
|
|
262
|
+
## 7. DeepSeek API and model integration
|
|
263
|
+
|
|
264
|
+
The model provider is separated from game control so that the project is not locked to a single vendor.
|
|
265
|
+
|
|
266
|
+
Planned adapter responsibilities:
|
|
267
|
+
- Configure API base URL, model identifier and authentication key.
|
|
268
|
+
- Integrate DeepSeek API as the initial provider.
|
|
269
|
+
- Support compatible OpenAI-style API endpoints through provider adapters where their request/response capabilities match.
|
|
270
|
+
- Declare model capabilities such as `vision`, `reasoning`, `audio` and `structured_actions`.
|
|
271
|
+
- Send only the observation and context required for the current task.
|
|
272
|
+
- Parse model output into a strict internal action schema.
|
|
273
|
+
- Handle request timeouts, rate limits, connection errors and malformed responses.
|
|
274
|
+
- Keep provider credentials on the desktop side; never embed a long-lived API key in the Android app or frontend source.
|
|
275
|
+
|
|
276
|
+
A model response is a **proposal**, not an unrestricted command. The desktop engine must validate it before any action is executed.
|
|
277
|
+
|
|
278
|
+
### Vision capability matters
|
|
279
|
+
|
|
280
|
+
A text-only model cannot independently interpret a raw screenshot. Screenshot-based gameplay requires a vision-capable model or a local vision pipeline that converts the image into structured state before a text model is called. The model router must check capability compatibility rather than assuming every model can process images.
|
|
281
|
+
|
|
282
|
+
### Example configuration contract
|
|
283
|
+
|
|
284
|
+
This is an illustrative configuration shape, not a claim that the current UI or runtime already implements these exact fields:
|
|
285
|
+
|
|
286
|
+
```yaml
|
|
287
|
+
gamer:
|
|
288
|
+
model:
|
|
289
|
+
provider: deepseek
|
|
290
|
+
base_url: ${DEEPSEEK_BASE_URL}
|
|
291
|
+
api_key_env: DEEPSEEK_API_KEY
|
|
292
|
+
model: ${DEEPSEEK_MODEL}
|
|
293
|
+
timeout_seconds: 60
|
|
294
|
+
|
|
295
|
+
desktop:
|
|
296
|
+
vision_enabled: true
|
|
297
|
+
max_action_duration_ms: 1500
|
|
298
|
+
|
|
299
|
+
android:
|
|
300
|
+
transport: adb
|
|
301
|
+
require_pairing: true
|
|
302
|
+
require_action_ack: true
|
|
303
|
+
|
|
304
|
+
safety:
|
|
305
|
+
max_actions_per_batch: 3
|
|
306
|
+
pause_on_uncertain_state: true
|
|
307
|
+
require_confirmation_for_sensitive_actions: true
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
Store secrets in environment variables or a local secret manager. Never commit API keys, access tokens or device credentials.
|
|
311
|
+
|
|
312
|
+
## 8. Local model discovery and failover
|
|
313
|
+
|
|
314
|
+
The desktop control center is intended to discover configured local model endpoints, check their health and route tasks to a compatible model.
|
|
315
|
+
|
|
316
|
+
Failover policy:
|
|
317
|
+
|
|
318
|
+
1. Discover configured local model endpoints and declared capabilities.
|
|
319
|
+
2. Run a bounded health check and a small inference probe.
|
|
320
|
+
3. Select the highest-priority healthy model that supports the requested task.
|
|
321
|
+
4. On timeout, connection failure, repeated server/runtime errors or invalid structured output, mark the active model degraded according to configurable thresholds.
|
|
322
|
+
5. Probe the fallback with a real task-compatible inference before declaring it active.
|
|
323
|
+
6. Preserve compact task context and recent verified action outcomes where possible.
|
|
324
|
+
7. Re-check the preferred model and switch back only after a stable recovery window.
|
|
325
|
+
8. If all compatible models fail, pause automation and show a clear error. Never claim the AI is still playing when inference has stopped.
|
|
326
|
+
|
|
327
|
+
A running process alone does not prove that a model is healthy. For screenshot understanding, the health check must verify vision capability using a representative image input.
|
|
328
|
+
|
|
329
|
+
## 9. Android connection and data transport
|
|
330
|
+
|
|
331
|
+
The desktop and Android app require explicit, authenticated pairing.
|
|
332
|
+
|
|
333
|
+
Planned transports:
|
|
334
|
+
- **USB / ADB:** useful for development, debugging, screen capture and direct device control.
|
|
335
|
+
- **LAN Wi-Fi:** useful when the phone and computer share a trusted local network.
|
|
336
|
+
- **WebRTC or equivalent media transport:** suitable for low-latency continuous video/audio where available.
|
|
337
|
+
- **Reliable WebSocket channel:** suitable for control messages, action acknowledgements, model events and telemetry.
|
|
338
|
+
|
|
339
|
+
The runtime protocol defines versioned messages for:
|
|
340
|
+
- Device status and pairing
|
|
341
|
+
- Screen frame and observation metadata
|
|
342
|
+
- Optional audio/sensor observations with explicit permission
|
|
343
|
+
- Model/task state
|
|
344
|
+
- Action request and action acknowledgement
|
|
345
|
+
- Stop, pause, disconnect and heartbeat
|
|
346
|
+
- Telemetry and error events
|
|
347
|
+
- Companion state and optional speech
|
|
348
|
+
|
|
349
|
+
Each message should carry a protocol version, session ID, message ID and timestamp. Reject stale commands, duplicate action IDs, malformed payloads and messages from unpaired clients.
|
|
350
|
+
|
|
351
|
+
Do not expose ADB or unauthenticated control ports to the public internet.
|
|
352
|
+
|
|
353
|
+
See [Gamer-Mobile ↔ Gamer-DSH Runtime Protocol v1](docs/runtime-protocol-v1.md).
|
|
354
|
+
|
|
355
|
+
## 10. Desktop control center and telemetry
|
|
356
|
+
|
|
357
|
+
The desktop UI is a view of actual runtime events, not the source of truth. Its intended capabilities include:
|
|
358
|
+
|
|
359
|
+
- Android device connection over USB or LAN Wi-Fi
|
|
360
|
+
- TCP/UDP transport telemetry: throughput, latency, packet loss and connection state
|
|
361
|
+
- Animated live data-flow visualization
|
|
362
|
+
- Local model discovery, health checks and primary/fallback routing
|
|
363
|
+
- Explicit model failover with recovery checks
|
|
364
|
+
- Game session controls and event logs
|
|
365
|
+
- Clear connected, connecting, disconnected, demo and stale-data states
|
|
366
|
+
|
|
367
|
+
Telemetry must come from real measurements. TCP and UDP metrics must be reported separately. Do not infer UDP packet loss from TCP metrics. If a metric is unavailable, show N/A rather than a fabricated zero. Decorative animation must not be presented as real network traffic.
|
|
368
|
+
|
|
369
|
+
Open `desktop-ui/index.html` in a modern browser to inspect the current UI prototype. Its telemetry panel intentionally shows “等待连接”; the animated trace is decorative until a real telemetry source is integrated.
|
|
370
|
+
|
|
371
|
+
## 11. Companion state and voice
|
|
372
|
+
|
|
373
|
+
The Android app and desktop UI can display the same logical companion session. The desktop host is authoritative for task and game state; the phone reports execution and can play optional local TTS.
|
|
374
|
+
|
|
375
|
+
Planned states include 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.
|
|
376
|
+
|
|
377
|
+
Optional voice playback should use a user-selected installed voice or a properly licensed voice pack. Speech must be interruptible and rate-limited so it does not interfere with gameplay.
|
|
378
|
+
|
|
379
|
+
The companion is a user-interface character and does not imply that the model is conscious.
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
### Optional community Paimon voice pack
|
|
383
|
+
|
|
384
|
+
Gamer can optionally connect to a separately installed community TTS service so the companion can speak task updates, guide summaries, warnings and verified action results. The desktop dashboard includes a TTS endpoint health check and a short audio preview.
|
|
385
|
+
|
|
386
|
+
A community project worth evaluating is [gaaiyun/ai-paimon](https://github.com/gaaiyun/ai-paimon), which documents a local Paimon VITS server with `GET /health` and `POST /tts_to_audio` endpoints. Its repository states that its Paimon voice checkpoint is for personal, non-commercial use only. Gamer does not bundle or redistribute that checkpoint; users must obtain model files from the original project and follow its current terms. The upstream project also contains game-derived Live2D assets, which are not part of Gamer's distribution.
|
|
387
|
+
|
|
388
|
+
The integration is optional and endpoint-based. The voice service should remain on localhost or a trusted LAN, and must not be exposed publicly without authentication and transport protection. TTS is playback only; it does not change model-provider credentials or game-control permissions. See [Community TTS integration](docs/community-tts.md).
|
|
389
|
+
|
|
390
|
+
## 12. Safety, privacy and user control
|
|
391
|
+
|
|
392
|
+
- Keep screenshots, game state and device data on the user's computer by default.
|
|
393
|
+
- Send only the minimum context needed to the selected model API.
|
|
394
|
+
- Keep model API keys on the desktop; redact secrets from logs.
|
|
395
|
+
- Require explicit user approval for screen capture, audio capture and accessibility/input control.
|
|
396
|
+
- Pair devices explicitly and authenticate both sides.
|
|
397
|
+
- Bind local control endpoints to loopback by default; expose LAN access only intentionally.
|
|
398
|
+
- Validate action type, coordinate bounds, duration, deadline and batch size.
|
|
399
|
+
- Provide an immediate stop/pause control.
|
|
400
|
+
- Stop issuing actions on disconnect, stale observations, unavailable models or uncertain state.
|
|
401
|
+
- Require explicit approval for purchases, premium-currency spending, save deletion or other irreversible/account-sensitive actions.
|
|
402
|
+
- Respect game terms, anti-cheat rules and applicable laws. Do not bypass anti-cheat, access controls or platform protections.
|
|
403
|
+
|
|
404
|
+
## 13. Repository layout
|
|
405
|
+
|
|
406
|
+
- `desktop-ui/` — responsive desktop dashboard prototype.
|
|
407
|
+
- `docs/architecture.md` — runtime architecture and integration contract.
|
|
408
|
+
- `docs/runtime-protocol-v1.md` — Android ↔ desktop pairing, observations, actions, telemetry, model failover and companion protocol.
|
|
409
|
+
- Future runtime modules — Android bridge, telemetry collector, local inference adapter, model health router, game-agent coordinator and PC input adapter.
|
|
410
|
+
|
|
411
|
+
Platform-specific code should stay behind adapters. DSH orchestration, model providers and device transports should remain independently testable.
|
|
412
|
+
|
|
413
|
+
## 14. Development roadmap
|
|
414
|
+
|
|
415
|
+
### Phase 1 — Foundation
|
|
416
|
+
- Establish the DSH plugin entry point and package structure.
|
|
417
|
+
- Define shared types for observations, actions, results and errors.
|
|
418
|
+
- Add local configuration validation and secure secret handling.
|
|
419
|
+
|
|
420
|
+
### Phase 2 — Desktop AI loop
|
|
421
|
+
- Implement desktop screen capture and a minimal vision pipeline.
|
|
422
|
+
- Integrate the DeepSeek model adapter.
|
|
423
|
+
- Implement structured action parsing, validation and a safe PC input adapter.
|
|
424
|
+
- Demonstrate observe → reason → act → verify in a controlled test game.
|
|
425
|
+
|
|
426
|
+
### Phase 3 — Android companion
|
|
427
|
+
- Implement authenticated phone pairing.
|
|
428
|
+
- Add Android screen capture and observation transfer.
|
|
429
|
+
- Add touch execution and action acknowledgements.
|
|
430
|
+
- Demonstrate mobile gameplay with the game running on Android and the main AI processing on the computer.
|
|
431
|
+
|
|
432
|
+
### Phase 4 — Reliability
|
|
433
|
+
- Add reconnect handling, timeouts, cancellation and recovery.
|
|
434
|
+
- Optimize image transfer, request frequency, token usage and latency.
|
|
435
|
+
- Add diagnostics and reproducible test cases.
|
|
436
|
+
|
|
437
|
+
### Phase 5 — Compatibility
|
|
438
|
+
- Add more game input adapters and model providers.
|
|
439
|
+
- Improve UI recognition and game-specific state adapters.
|
|
440
|
+
- Publish tested releases with clear compatibility notes.
|
|
441
|
+
|
|
442
|
+
## 15. Implementation status and honesty
|
|
443
|
+
|
|
444
|
+
The README and protocol documents define the target behavior and contracts. A feature should be called **implemented** only after its code exists, dependencies are declared and the workflow has been tested.
|
|
445
|
+
|
|
446
|
+
This repository's current UI shell is a visual prototype. The presence of architecture documentation does not mean Android pairing, ADB control, PC input injection, OCR, model routing, live telemetry or automatic gameplay are already operational. Those capabilities must be delivered and verified module by module.
|
|
447
|
+
|
|
448
|
+
## 16. Contributing
|
|
449
|
+
|
|
450
|
+
Contributions are welcome in DSH integration, desktop vision, Android communication, model adapters, action validation, telemetry, documentation and testing.
|
|
451
|
+
|
|
452
|
+
Please include:
|
|
453
|
+
- Operating system, device model and Android version
|
|
454
|
+
- DSH and runtime versions
|
|
455
|
+
- Reproduction steps
|
|
456
|
+
- Expected and actual behavior
|
|
457
|
+
- Relevant logs with API keys, tokens and personal data removed
|
|
458
|
+
|
|
459
|
+
## License
|
|
460
|
+
|
|
461
|
+
The repository license is governed by the license file included in this repository. If no license file is present, do not assume that the source is licensed for redistribution or commercial use.
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
## 17. Paimon as an autonomous voice companion
|
|
465
|
+
|
|
466
|
+
The Android companion is intended to feel like a persistent in-game partner, not merely a speaker for desktop notifications. This section defines the target behavior; it is not a claim that voice recognition, autonomous roaming or game automation is already implemented.
|
|
467
|
+
|
|
468
|
+
### Connection greeting
|
|
469
|
+
|
|
470
|
+
After QR pairing has been authenticated and the session is ready, Android plays a short Paimon greeting, for example: “旅行者,连接成功啦!派蒙已经准备好,随时听候你的吩咐!” The greeting is emitted once per successful pairing/session, not on every heartbeat or reconnect loop. If TTS is unavailable, show a text fallback and do not claim audio played.
|
|
471
|
+
|
|
472
|
+
### Voice command loop
|
|
473
|
+
|
|
474
|
+
- Android requests microphone permission explicitly and shows a visible listening indicator. Push-to-talk is the default; optional wake-word listening must be separately enabled and easy to disable.
|
|
475
|
+
- Speech recognition produces a transcript plus confidence/language metadata. The transcript is sent over the authenticated session to the desktop agent; model API credentials remain on desktop.
|
|
476
|
+
- The desktop resolves the command against the currently detected game profile, current state and permitted action set. It asks for clarification when confidence is low or the command is ambiguous.
|
|
477
|
+
- The agent returns a short spoken acknowledgement, executes bounded actions, then reports only outcomes verified by new observations.
|
|
478
|
+
- “派蒙,停止 / 暂停” is a high-priority local command. Android must stop dispatching queued actions immediately, even if the desktop or model is slow or disconnected.
|
|
479
|
+
|
|
480
|
+
Example commands include “派蒙,跟着我”、“去砍一些橡木”、“回到安全的地方” and “暂停一下”. Command vocabulary and action semantics are profile-specific; examples are not guarantees that every game supports those actions.
|
|
481
|
+
|
|
482
|
+
### Autonomous companion behavior when no task is queued
|
|
483
|
+
|
|
484
|
+
The user may enable an explicit **陪伴探索 / 自主漫游** mode. When enabled and the agent is idle, it may:
|
|
485
|
+
- Make occasional in-character comments about visible, confidently recognized events.
|
|
486
|
+
- Use short original, non-infringing humming or songs, or audio the user has rights to use. Do not reproduce copyrighted game songs or commercial tracks without permission.
|
|
487
|
+
- Explore within a bounded radius, observe landmarks and learn safe routes.
|
|
488
|
+
- In Minecraft, gather permitted resources such as nearby wood only when the active profile confirms the target, tool, inventory capacity and environmental safety. It should avoid lava, cliffs, hostile mobs, protected builds and other players' property; do not break blocks near other players or user-designated protected areas.
|
|
489
|
+
- Return to a configured safe point or stop when health, hunger, durability, inventory, danger or uncertainty crosses profile thresholds.
|
|
490
|
+
|
|
491
|
+
Autonomy is opt-in, bounded and interruptible. Default behavior while idle is **wait and chat**, not uncontrolled movement. The user can set exploration radius, allowed activities, protected areas, resource limits, speech frequency and quiet hours. Purchases, premium-currency spending, irreversible account actions, PvP, griefing and interactions affecting other players require explicit user authorization and must not be initiated autonomously.
|
|
492
|
+
|
|
493
|
+
### Automatic game recognition and profile switching
|
|
494
|
+
|
|
495
|
+
The agent should combine Android foreground package/title metadata (when the OS permits) with screen-layout fingerprints, OCR/UI signatures and scene cues. It must not rely on a single title string or assume that a visual guess is certain. On a game change:
|
|
496
|
+
1. Stop or pause actions from the previous profile.
|
|
497
|
+
2. Identify candidate game and platform; calculate confidence.
|
|
498
|
+
3. Load the matching versioned profile only after validation.
|
|
499
|
+
4. Display the detected title/profile and confidence to the user.
|
|
500
|
+
5. If uncertain or unsupported, enter observe-only mode and ask the user to select/confirm a profile.
|
|
501
|
+
|
|
502
|
+
Each title needs its own tested control map and safety rules. Minecraft resource gathering cannot be reused as Genshin Impact behavior. For Genshin and other games, the agent may explore, follow, navigate or interact only where the profile has validated controls and the action is allowed. “Automatic recognition” means detecting and selecting a profile, not instant universal compatibility.
|
|
503
|
+
|
|
504
|
+
### Suggested state machine
|
|
505
|
+
|
|
506
|
+
`disconnected → pairing → connected_greeting → idle_companion → voice_command → task_planning → executing → verifying → idle_companion`
|
|
507
|
+
|
|
508
|
+
Any state may transition to `paused`, `stopping` or `error`. A new voice command interrupts low-priority chatter; stop/pause interrupts speech and action queues. Disconnect, stale frames, low-confidence perception, model failure or an unknown game must stop new autonomous actions.
|
|
509
|
+
|
|
510
|
+
### Acceptance tests
|
|
511
|
+
|
|
512
|
+
- A successful pairing produces one greeting; failed pairing produces none.
|
|
513
|
+
- The phone can receive a voice command and the desktop returns a transcript/intent acknowledgement without exposing API credentials.
|
|
514
|
+
- Stop/pause works locally even during network loss or a pending inference request.
|
|
515
|
+
- Idle autonomy is off by default and cannot start without user opt-in.
|
|
516
|
+
- A game switch cancels old-profile actions before loading a new profile.
|
|
517
|
+
- Unknown game/profile confidence causes observe-only behavior.
|
|
518
|
+
- Minecraft gathering respects health, danger, inventory, protected-area and action-bound checks.
|
|
519
|
+
- Spoken commentary is based on current observations; songs are original/licensed/public-domain only.
|
|
520
|
+
|
|
521
|
+
See [runtime protocol](runtime-protocol-v1.md) for the corresponding event contract.
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
---
|
|
525
|
+
|
|
526
|
+
## Native DSH plugin installation
|
|
527
|
+
|
|
528
|
+
The repository now includes a native DSH bundle package manifest and plugin entry point. The npm package is published separately from the GitHub source release.
|
|
529
|
+
|
|
530
|
+
**Desktop DSH installation (after the npm package is published):**
|
|
531
|
+
1. Open **Plugins** in the DSH sidebar.
|
|
532
|
+
2. Select **Add plugin**.
|
|
533
|
+
3. Enter `@sususgh/gamer-dsh-plugin` (the npm package name, not this GitHub URL).
|
|
534
|
+
4. Install and restart DSH.
|
|
535
|
+
5. Open the Gamer plugin page. In a new conversation, ask the model to call `gamer_project_status` to verify that the plugin loaded.
|
|
536
|
+
|
|
537
|
+
For CLI-managed profiles, use:
|
|
538
|
+
```bash
|
|
539
|
+
npx -y @deepseek-ai/dsh plugin --profile web add @sususgh/gamer-dsh-plugin@1.0.0
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
See [DSH installation instructions](docs/DSH-INSTALL.zh-CN.md).
|
|
543
|
+
|
|
544
|
+
**Important implementation status:** the native DSH package currently provides the plugin bundle, a status tool and a status card. The Windows game-control runtime, Android APK/companion bridge, QR pairing, live visual perception and autonomous game actions are not implemented yet. Installing the DSH bundle does not enable game control.
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# 在 DeepSeek Harness(DSH)中安装 Gamer
|
|
2
|
+
|
|
3
|
+
## 安装方式
|
|
4
|
+
|
|
5
|
+
Gamer 是 DSH 原生插件包,不是独立的 Windows EXE,也不是直接从 GitHub 源码安装。
|
|
6
|
+
|
|
7
|
+
桌面版 DSH:
|
|
8
|
+
1. 打开 DSH。
|
|
9
|
+
2. 进入侧边栏 **Plugins(插件)**。
|
|
10
|
+
3. 点击 **Add plugin(添加插件)**。
|
|
11
|
+
4. 输入 npm 包名:`@sususgh/gamer-dsh-plugin`。
|
|
12
|
+
5. 安装完成后重启 DSH。
|
|
13
|
+
6. 在插件列表中打开 Gamer 游戏智能体页面。
|
|
14
|
+
|
|
15
|
+
不要填写 GitHub 仓库 URL。DSH 插件包通过 npm 分发,GitHub 仓库用于源码和开发。
|
|
16
|
+
|
|
17
|
+
## 当前功能状态
|
|
18
|
+
|
|
19
|
+
当前包提供:
|
|
20
|
+
- DSH 原生 Bundle 清单与插件入口。
|
|
21
|
+
- 插件页面状态卡片。
|
|
22
|
+
- `gamer_project_status` 状态查询工具。
|
|
23
|
+
|
|
24
|
+
当前尚未提供:
|
|
25
|
+
- Windows 游戏控制运行时。
|
|
26
|
+
- Android APK 与二维码配对服务。
|
|
27
|
+
- 实际屏幕采集、OCR、目标检测和视觉模型管线。
|
|
28
|
+
- 键鼠/触控动作执行。
|
|
29
|
+
- 联机攻略检索与语音运行时。
|
|
30
|
+
|
|
31
|
+
因此,安装成功表示 DSH 已加载插件,不表示已经可以自动玩游戏。
|
|
32
|
+
|
|
33
|
+
## CLI 安装(非桌面托管 profile)
|
|
34
|
+
|
|
35
|
+
对于由 CLI 管理的 profile,可运行:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx -y @deepseek-ai/dsh plugin --profile web add @sususgh/gamer-dsh-plugin@1.0.0
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
桌面版 DSH 的 desktop profile 应在应用内 Plugins → Add plugin 安装。
|
|
42
|
+
|
|
43
|
+
## 验证
|
|
44
|
+
|
|
45
|
+
重启 DSH 后,在新会话中让模型调用 `gamer_project_status`。正确结果应显示:
|
|
46
|
+
- `pluginLoaded: true`
|
|
47
|
+
- `canControlGames: false`
|
|
48
|
+
|
|
49
|
+
若状态工具不存在,检查插件是否安装到当前 DSH profile,并确认 DSH 版本支持 npm bundle 插件。
|
package/dsh/client.js
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// Browser-side DSH plugin card. Uses the same lazy module-loader contract
|
|
2
|
+
// as other native DSH bundles and makes no network calls or game actions.
|
|
3
|
+
window.__ModuleLoader__.load({
|
|
4
|
+
id: '@sususgh/gamer-dsh-plugin',
|
|
5
|
+
factory: (require) => {
|
|
6
|
+
var module = { exports: {} };
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var h = React.createElement;
|
|
9
|
+
|
|
10
|
+
function Card() {
|
|
11
|
+
var items = [
|
|
12
|
+
['DSH 原生插件', '已集成'],
|
|
13
|
+
['桌面端 UI', '原型可用'],
|
|
14
|
+
['Android 配对', '尚未接入'],
|
|
15
|
+
['视觉识别运行时', '尚未接入'],
|
|
16
|
+
['自动游戏控制', '尚未接入']
|
|
17
|
+
];
|
|
18
|
+
return h('section', {
|
|
19
|
+
style: {
|
|
20
|
+
display: 'flex',
|
|
21
|
+
flexDirection: 'column',
|
|
22
|
+
gap: '12px',
|
|
23
|
+
padding: '16px',
|
|
24
|
+
border: '1px solid var(--dsw-alias-border-l2, rgba(127,127,127,.25))',
|
|
25
|
+
borderRadius: '12px',
|
|
26
|
+
color: 'var(--dsw-alias-label-primary, inherit)'
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
h('div', null,
|
|
30
|
+
h('strong', { style: { fontSize: '15px' } }, 'Gamer 游戏智能体'),
|
|
31
|
+
h('p', { style: { margin: '6px 0 0', fontSize: '12px', color: 'var(--dsw-alias-label-tertiary, #888)' } },
|
|
32
|
+
'Gamer-DSH-Plugin v1.0.0 · DSH 原生插件')
|
|
33
|
+
),
|
|
34
|
+
h('div', { style: { display: 'grid', gridTemplateColumns: 'repeat(auto-fit,minmax(150px,1fr))', gap: '8px' } },
|
|
35
|
+
...items.map(([label, value]) => h('div', {
|
|
36
|
+
key: label,
|
|
37
|
+
style: {
|
|
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
|
+
))
|
|
46
|
+
),
|
|
47
|
+
h('p', {
|
|
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 项目与开发进度 ↗')
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function apply(ctx) {
|
|
65
|
+
if (!ctx || typeof ctx.inject !== 'function') return;
|
|
66
|
+
ctx.inject(['slots'], (scope) => {
|
|
67
|
+
if (!scope?.slots?.inject || !scope?.slots?.register) return;
|
|
68
|
+
scope.slots.inject('plugins.bundle.config', function* () {
|
|
69
|
+
yield scope.slots.register(
|
|
70
|
+
{ name: 'plugins.bundle.config', key: '@sususgh/gamer-dsh-plugin' },
|
|
71
|
+
Card
|
|
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
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
module.exports = { apply, inject: [] };
|
|
84
|
+
return module.exports;
|
|
85
|
+
}
|
|
86
|
+
});
|
package/dsh/index.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gamer DSH Plugin — native DeepSeek Harness entry point.
|
|
3
|
+
*
|
|
4
|
+
* This first installable integration deliberately reports the current runtime
|
|
5
|
+
* honestly: the repository currently contains a desktop UI prototype, not a
|
|
6
|
+
* connected game-control engine. No game input is sent and no device is
|
|
7
|
+
* paired by this plugin yet.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export const name = 'gamer-dsh-plugin';
|
|
11
|
+
export const inject = ['tools'];
|
|
12
|
+
|
|
13
|
+
const STATUS_SCHEMA = {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {},
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export function apply(ctx) {
|
|
20
|
+
if (typeof ctx?.tools?.register !== 'function') {
|
|
21
|
+
console.error('[gamer-dsh-plugin] DSH tools service is unavailable; status tool was not registered.');
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
ctx.tools.register({
|
|
26
|
+
name: 'gamer_project_status',
|
|
27
|
+
description:
|
|
28
|
+
'Return the verified implementation and runtime status of Gamer-DSH-Plugin. Use this before attempting to start or control a game. The current release provides a desktop UI prototype; it does not yet include a connected game-control runtime or Android companion bridge.',
|
|
29
|
+
parameters: STATUS_SCHEMA,
|
|
30
|
+
async execute() {
|
|
31
|
+
return {
|
|
32
|
+
project: 'Gamer-DSH-Plugin',
|
|
33
|
+
version: '1.0.0',
|
|
34
|
+
integration: 'native DSH bundle',
|
|
35
|
+
pluginLoaded: true,
|
|
36
|
+
desktopUi: 'prototype',
|
|
37
|
+
androidCompanion: 'not connected',
|
|
38
|
+
visionRuntime: 'not implemented',
|
|
39
|
+
gameControlRuntime: 'not implemented',
|
|
40
|
+
qrPairing: 'not implemented',
|
|
41
|
+
canControlGames: false,
|
|
42
|
+
nextStep: 'Complete and validate the desktop engine and Android companion before enabling game-control tools.',
|
|
43
|
+
repository: 'https://github.com/sususgh/Gamer-DSH-Plugin',
|
|
44
|
+
release: 'https://github.com/sususgh/Gamer-DSH-Plugin/releases/tag/v1.0.0'
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,56 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sususgh/gamer-dsh-plugin",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Native DeepSeek Harness plugin for the Gamer AI game-agent project",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"author": "sususgh",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/sususgh/Gamer-DSH-Plugin.git"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/sususgh/Gamer-DSH-Plugin",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/sususgh/Gamer-DSH-Plugin/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"dsh-plugin",
|
|
18
|
+
"deepseek-harness",
|
|
19
|
+
"gamer",
|
|
20
|
+
"game-agent",
|
|
21
|
+
"android-companion"
|
|
22
|
+
],
|
|
23
|
+
"files": [
|
|
24
|
+
"dsh",
|
|
25
|
+
"cordis.patch.yml",
|
|
26
|
+
"README.md",
|
|
27
|
+
"LICENSE",
|
|
28
|
+
"docs/DSH-INSTALL.zh-CN.md"
|
|
29
|
+
],
|
|
30
|
+
"exports": {
|
|
31
|
+
".": "./dsh/index.js",
|
|
32
|
+
"./dsh": "./dsh/index.js",
|
|
33
|
+
"./client": "./dsh/client.js",
|
|
34
|
+
"./package.json": "./package.json"
|
|
35
|
+
},
|
|
36
|
+
"dsh": {
|
|
37
|
+
"bundle": {
|
|
38
|
+
"patch": "./cordis.patch.yml"
|
|
39
|
+
},
|
|
40
|
+
"client": {
|
|
41
|
+
"inject": [],
|
|
42
|
+
"platform": "web",
|
|
43
|
+
"immediately": true
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"test": "node --test",
|
|
48
|
+
"check": "node --check dsh/index.js && node --check dsh/client.js"
|
|
49
|
+
},
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public"
|
|
52
|
+
},
|
|
53
|
+
"engines": {
|
|
54
|
+
"node": ">=22.13"
|
|
55
|
+
}
|
|
6
56
|
}
|