@sususgh/gamer-dsh-plugin 0.0.0-stage → 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/LICENSE +201 -0
- package/README.md +545 -2
- package/cordis.patch.yml +4 -0
- 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 +78 -0
- package/docs/runtime-protocol-v1.md +266 -0
- package/dsh/client.js +124 -0
- package/dsh/index.js +79 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +60 -3
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Noto+Sans+SC:wght@400;500;600;700;800&display=swap');
|
|
2
|
+
:root{--ink:#26394a;--muted:#8295a5;--blue:#6b9fc0;--cyan:#65c9d1;--violet:#a89bda;--line:#dce8ee;--glass:rgba(255,255,255,.78);--shadow:0 16px 48px rgba(71,105,128,.10)}
|
|
3
|
+
*{box-sizing:border-box}body{margin:0;min-height:100vh;background:linear-gradient(145deg,#edf5f8 0%,#e7f0f5 46%,#f4f1ec 100%);color:var(--ink);font-family:Manrope,'Noto Sans SC',sans-serif}.sky-glow{position:fixed;inset:0;pointer-events:none;background:radial-gradient(ellipse at 78% 7%,rgba(164,204,225,.42),transparent 35%),radial-gradient(ellipse at 8% 38%,rgba(209,220,246,.4),transparent 30%);z-index:-1}.topbar{height:76px;padding:0 max(calc((100vw - 1180px)/2),24px);display:flex;align-items:center;gap:22px;border-bottom:1px solid rgba(190,211,223,.65);background:rgba(250,253,254,.58);backdrop-filter:blur(18px)}.brand{display:flex;align-items:center;gap:11px;min-width:220px}.brand-mark{width:40px;height:40px;border-radius:14px;display:grid;place-items:center;background:linear-gradient(145deg,#8cc4d2,#7898c7);color:white;font-size:24px;box-shadow:0 6px 16px #91b8ca66}.brand b{display:block;letter-spacing:.18em;font-size:15px}.brand small{display:block;color:#91a5b2;font-size:9px;letter-spacing:.22em;margin-top:3px}.top-status{margin-left:auto;display:flex;align-items:center;gap:9px;color:#748a99;font-size:12px}.pulse,.waiting i{width:8px;height:8px;border-radius:50%;background:#d3a86c;box-shadow:0 0 0 4px #d3a86c22}.icon-btn,.soft,.primary,.choice{border:0;cursor:pointer;font:inherit}.icon-btn{width:38px;height:38px;border-radius:12px;background:#fff9;color:#607b8e;font-size:19px}.tag{font-size:9px;letter-spacing:.14em;border-radius:20px;padding:6px 9px;background:#e5eef3;color:#7793a5}.layout{max-width:1180px;margin:28px auto;padding:0 22px 36px}.panel{background:var(--glass);border:1px solid rgba(255,255,255,.9);border-radius:22px;box-shadow:var(--shadow);backdrop-filter:blur(16px)}.hero{min-height:260px;padding:30px 36px;position:relative;overflow:hidden;background:linear-gradient(112deg,rgba(255,255,255,.92),rgba(226,240,246,.78) 58%,rgba(227,229,245,.75))}.hero:after{content:"";position:absolute;inset:auto -8% -125px 28%;height:210px;border:1px solid #a9cbd8;border-radius:50%;transform:rotate(-8deg);opacity:.32}.hero-copy{position:relative;z-index:2}.eyebrow{font-size:9px;letter-spacing:.2em;color:#8ca9b9;font-weight:800}.hero h1{font-size:clamp(24px,3vw,35px);letter-spacing:.02em;margin:13px 0 8px;color:#30495d}.hero p{margin:0;color:#8298a7;font-size:13px}.hero-actions{display:flex;gap:10px;margin-top:24px}.primary{padding:11px 20px;border-radius:12px;color:white;background:linear-gradient(110deg,#6eaec0,#829dcc);box-shadow:0 7px 16px #86b5c544;font-weight:700;font-size:12px}.soft{padding:10px 15px;border-radius:11px;background:#edf4f7;color:#668398;font-weight:700;font-size:11px;border:1px solid #e0ebef}.soft:hover,.choice:hover{filter:brightness(.98);transform:translateY(-1px)}.orb-wrap{position:absolute;right:12%;top:15px;width:240px;height:220px;display:grid;place-items:center}.orb{width:118px;height:118px;border-radius:50%;display:grid;place-items:center;color:#fff;font-size:47px;background:radial-gradient(circle at 35% 28%,#fff 0%,#b8e0e3 22%,#91b5d4 52%,#9e9bcf 78%,#d9e4ee 100%);box-shadow:inset -12px -14px 25px #637ca533,0 0 48px #a6d6df77;animation:float 5s ease-in-out infinite}.orbit{position:absolute;border:1px solid #9bbdce88;border-radius:50%;width:210px;height:80px;transform:rotate(-25deg);animation:spin 18s linear infinite}.orbit-b{width:190px;height:110px;transform:rotate(60deg);animation-direction:reverse}.orb-caption{position:absolute;bottom:2px;color:#91a9b7;font-size:8px;letter-spacing:.18em}@keyframes float{50%{transform:translateY(-8px)}}@keyframes spin{to{rotate:360deg}}.hero-foot{position:absolute;bottom:18px;left:36px;display:flex;gap:22px;color:#8ba0ae;font-size:10px}.hero-foot b{color:#a17e52;margin-left:5px}.prototype{color:#a2aeba}.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin:16px 0}.stat{padding:17px 19px;min-height:112px;position:relative;overflow:hidden}.stat label{display:block;color:#8ba0ad;font-size:11px}.stat strong{display:block;font-size:25px;margin:8px 0 3px;color:#405d70}.stat small{font-size:9px;color:#a2b1bb}.mini-line{position:absolute;right:16px;bottom:20px;width:52px;height:19px;border-bottom:2px solid #8dc9cf;border-radius:50%;transform:rotate(-12deg);opacity:.7}.mini-line.alt{border-color:#b0a4d8}.flow-panel,.model-panel,.device-panel,.log-panel{padding:21px 23px}.section-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.section-head h2{font-size:17px;margin:5px 0 0;color:#385267}.waiting{display:flex;align-items:center;gap:8px;color:#a28a69;font-size:10px}.waiting i{background:#d3aa71}.flow-legend{display:flex;align-items:center;gap:18px;margin-top:17px;color:#8398a7;font-size:10px}.dot{display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:6px}.cyan{background:#70cbd0}.violet{background:#a99bda}.right{margin-left:auto;color:#aab7bf;font-size:9px}canvas{width:100%;height:150px;display:block;margin-top:6px}.flow-bottom{display:flex;gap:24px;border-top:1px solid #e6eef1;padding-top:12px;color:#91a3ae;font-size:9px}.flow-bottom b{color:#b18e66;margin-left:5px}.two-col{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-top:16px}.tag.pale{background:#edf1f8;color:#8d91b4}.model-active{display:flex;align-items:center;gap:12px;padding:15px 0;border-bottom:1px solid #e7eef1}.model-icon{width:43px;height:43px;border-radius:14px;background:linear-gradient(145deg,#d8eaf0,#e9e4f6);display:grid;place-items:center;font-size:22px;color:#789fba}.model-info{flex:1}.model-info small,.model-info span{display:block;color:#9aabb5;font-size:9px}.model-info b{display:block;margin:3px 0;font-size:13px}.status-pill{border-radius:20px;padding:6px 9px;font-size:9px}.neutral{background:#f4eee5;color:#a78b68}.model-row{display:flex;justify-content:space-between;padding:10px 1px;border-bottom:1px solid #edf1f3;color:#91a2ad;font-size:10px}.model-row b{color:#647f91;font-weight:700}.enabled{color:#82a99c!important}.model-actions{display:flex;gap:9px;margin-top:14px}.hint{font-size:9px;line-height:1.7;color:#9babb5;margin:13px 0 0}.device-choice{display:flex;gap:8px;margin:17px 0}.choice{flex:1;padding:10px;border-radius:10px;background:#f1f5f7;color:#8da1ad;font-size:10px}.choice.selected{background:#e2eff3;color:#5e91a3;box-shadow:inset 0 0 0 1px #c9e0e6}.device-state{display:flex;align-items:center;gap:12px;padding:11px 0 14px}.phone-icon{width:42px;height:48px;border:2px solid #b6cbd4;border-radius:10px;display:grid;place-items:center;color:#8baebc;font-size:23px}.device-state b,.device-state small{display:block}.device-state b{font-size:12px}.device-state small{font-size:9px;color:#a0b0b9;margin-top:4px}.muted{color:#a7b3bb!important}.log-panel{margin-top:16px}.text-btn{border:0;background:none;color:#8ea5b3;font-size:10px;cursor:pointer}.event-list{margin-top:13px}.event{display:flex;align-items:center;gap:11px;padding:9px 2px;border-top:1px solid #edf1f3;font-size:10px;color:#8095a4}.event time{font-variant-numeric:tabular-nums;color:#a9b6be}.event-dot{width:6px;height:6px;border-radius:50%;background:#9cc8c8}.event p{margin:0}footer{display:flex;justify-content:space-between;padding:22px 5px;color:#a6b4bd;font-size:8px;letter-spacing:.13em}footer span{letter-spacing:0}@media(max-width:760px){.layout{padding:0 13px}.topbar{padding:0 15px}.brand{min-width:0}.top-status{font-size:0}.top-status .tag{font-size:8px}.hero{padding:24px 22px;min-height:280px}.orb-wrap{right:-30px;top:30px;opacity:.38}.hero-foot{left:22px;right:16px;gap:9px;flex-wrap:wrap}.stats-grid{grid-template-columns:repeat(2,1fr);gap:9px}.two-col{grid-template-columns:1fr}.flow-panel,.model-panel,.device-panel,.log-panel{padding:18px}.right{display:none}footer{gap:12px;line-height:1.6}}
|
|
4
|
+
/* Shared mobile/desktop visual language: airy blue glass, rounded white cards */
|
|
5
|
+
.pairing-panel{padding:21px 23px;margin:16px 0;background:linear-gradient(120deg,rgba(255,255,255,.88),rgba(226,241,249,.86))}
|
|
6
|
+
.pairing-layout{display:flex;align-items:center;gap:22px;margin-top:17px}
|
|
7
|
+
.qr-placeholder{width:142px;height:142px;flex:0 0 142px;position:relative;border:1px dashed #9dbbc9;border-radius:17px;background:repeating-linear-gradient(45deg,#f7fbfd,#f7fbfd 8px,#edf5f8 8px,#edf5f8 16px);display:grid;place-items:center;color:#88a9b9}
|
|
8
|
+
.qr-center{width:54px;height:54px;border-radius:15px;background:#dcecf2;display:grid;place-content:center;text-align:center;font-size:22px;color:#6d9eb1}.qr-center small{font-size:8px;letter-spacing:.18em}
|
|
9
|
+
.qr-corner{position:absolute;width:18px;height:18px;border:3px solid #86aebd}.tl{top:10px;left:10px;border-right:0;border-bottom:0}.tr{top:10px;right:10px;border-left:0;border-bottom:0}.bl{bottom:10px;left:10px;border-right:0;border-top:0}.br{bottom:10px;right:10px;border-left:0;border-top:0}
|
|
10
|
+
.pairing-copy{flex:1}.pairing-copy h3{margin:0 0 7px;font-size:16px}.pairing-copy p{margin:0 0 12px;max-width:650px;color:#879ba9;font-size:11px;line-height:1.8}.pairing-meta{display:inline-flex;gap:8px;margin:0 17px 10px 0;font-size:10px;color:#91a4b0}.pairing-meta b{color:#66889b}.model-select-head{display:flex;justify-content:space-between;align-items:center;margin:13px 0 8px;color:#6e899a;font-size:11px}.model-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.empty-models{grid-column:1/-1;padding:13px;border:1px dashed #d3e1e8;border-radius:12px;text-align:center;color:#8da3b0;font-size:10px;line-height:1.8}.empty-models small{color:#a5b4bd}.model-select-foot{display:flex;justify-content:space-between;gap:10px;margin-top:9px;color:#9aabb5;font-size:9px}
|
|
11
|
+
@media(max-width:760px){.pairing-layout{align-items:flex-start;gap:13px}.qr-placeholder{width:104px;height:104px;flex-basis:104px}.pairing-copy h3{font-size:13px}.pairing-meta{display:flex}.model-choices{grid-template-columns:1fr}.model-select-foot{flex-direction:column}}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/* Vision, online research and learning-memory dashboard modules */
|
|
15
|
+
.intelligence-panel,.game-profile-panel{padding:21px 23px;margin-top:16px}
|
|
16
|
+
.intelligence-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:17px}
|
|
17
|
+
.intel-card{padding:16px;border:1px solid #e3edf1;border-radius:16px;background:rgba(248,252,253,.82);min-width:0}
|
|
18
|
+
.intel-icon{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:linear-gradient(145deg,#e0f0f2,#ebe8f7);color:#709eb0;font-size:21px}
|
|
19
|
+
.intel-title{font-size:13px;font-weight:800;color:#49677a;margin-top:11px}
|
|
20
|
+
.intel-card p{min-height:48px;color:#8da1ad;font-size:10px;line-height:1.8}
|
|
21
|
+
.intel-status{display:flex;align-items:center;gap:7px;color:#9c8b6d;font-size:10px}
|
|
22
|
+
.intel-status i{width:7px;height:7px;border-radius:50%;background:#d3aa71}
|
|
23
|
+
.intel-meta{font-size:9px;color:#a3b1b9;margin:8px 0 12px}
|
|
24
|
+
.profile-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:15px}
|
|
25
|
+
.profile-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:13px;border:1px solid #e5edf1;border-radius:13px;background:#fafcfd}
|
|
26
|
+
.profile-item b,.profile-item small{display:block}.profile-item b{font-size:11px;color:#526f81}.profile-item small{font-size:9px;color:#9aabb5;margin-top:4px}
|
|
27
|
+
.profile-note{margin-top:12px;padding:11px 13px;border-radius:11px;background:#f0f5f7;color:#8da1ad;font-size:9px;line-height:1.8}
|
|
28
|
+
@media(max-width:760px){.intelligence-grid,.profile-grid{grid-template-columns:1fr}.intel-card p{min-height:0}}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
/* Optional community Paimon TTS panel */
|
|
32
|
+
.voice-panel{padding:21px 23px;margin-top:16px}
|
|
33
|
+
.voice-layout{display:grid;grid-template-columns:104px minmax(0,1fr);gap:20px;margin-top:17px}
|
|
34
|
+
.voice-avatar{width:88px;height:88px;border-radius:26px;display:grid;place-items:center;background:radial-gradient(circle at 35% 25%,#fff,#d7e9f2 48%,#c9c4e7);color:#829bc6;font-size:48px;box-shadow:0 10px 24px #a5bfd033}
|
|
35
|
+
.voice-title{font-size:13px;font-weight:800;color:#49677a}
|
|
36
|
+
.voice-settings p{font-size:10px;line-height:1.8;color:#8da1ad;margin:7px 0 12px}
|
|
37
|
+
.voice-settings label{display:block;font-size:10px;color:#7e96a6;margin:10px 0 5px}
|
|
38
|
+
.voice-settings input{width:100%;padding:10px 12px;border:1px solid #dfe9ee;border-radius:10px;background:#fbfdfe;color:#526b7b;font:inherit;font-size:11px;outline:none}
|
|
39
|
+
.voice-actions{display:flex;gap:9px;flex-wrap:wrap;margin:12px 0}
|
|
40
|
+
#ttsAudio{display:block;width:min(100%,440px);height:34px;margin-top:9px}
|
|
41
|
+
.voice-source{font-size:9px;color:#9aabb5;margin:10px 0 0}.voice-source a{color:#719bb1;text-decoration:none}.voice-source a:hover{text-decoration:underline}
|
|
42
|
+
@media(max-width:600px){.voice-layout{grid-template-columns:1fr}.voice-avatar{width:64px;height:64px;font-size:34px}}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
/* Paimon-inspired starlight theme: visual styling only; no runtime capability is implied. */
|
|
46
|
+
:root{
|
|
47
|
+
--ink:#283d58;--muted:#879bb1;--blue:#77b9df;--cyan:#83d9e3;--violet:#aaa0db;
|
|
48
|
+
--line:#e6dfd1;--glass:rgba(255,253,247,.84);--shadow:0 18px 50px rgba(80,113,151,.13);
|
|
49
|
+
}
|
|
50
|
+
body{
|
|
51
|
+
background:
|
|
52
|
+
radial-gradient(ellipse at 82% 4%,rgba(255,226,158,.42),transparent 26%),
|
|
53
|
+
radial-gradient(ellipse at 8% 18%,rgba(153,213,244,.34),transparent 30%),
|
|
54
|
+
linear-gradient(145deg,#f8f6ef 0%,#eaf5fb 48%,#f2effa 100%);
|
|
55
|
+
}
|
|
56
|
+
.sky-glow{
|
|
57
|
+
background:
|
|
58
|
+
radial-gradient(circle at 14% 12%,#fff8d8 0 2px,transparent 3px),
|
|
59
|
+
radial-gradient(circle at 72% 18%,#fff 0 2px,transparent 3px),
|
|
60
|
+
radial-gradient(circle at 88% 42%,#fff1c8 0 2px,transparent 3px),
|
|
61
|
+
radial-gradient(ellipse at 78% 7%,rgba(255,218,139,.34),transparent 34%),
|
|
62
|
+
radial-gradient(ellipse at 8% 38%,rgba(183,218,249,.42),transparent 32%);
|
|
63
|
+
}
|
|
64
|
+
.topbar{
|
|
65
|
+
background:rgba(255,253,247,.72);
|
|
66
|
+
border-bottom-color:rgba(224,211,183,.72);
|
|
67
|
+
}
|
|
68
|
+
.brand-mark{
|
|
69
|
+
background:linear-gradient(145deg,#f5d98d,#8fc9e7 58%,#a9a0d8);
|
|
70
|
+
color:#fffdf5;box-shadow:0 7px 20px rgba(190,164,103,.28);
|
|
71
|
+
}
|
|
72
|
+
.brand b{color:#344c68}
|
|
73
|
+
.brand small{color:#a18e68}
|
|
74
|
+
.top-status{color:#7f91a5}
|
|
75
|
+
.pulse,.waiting i{background:#d7b76f;box-shadow:0 0 0 4px rgba(215,183,111,.18)}
|
|
76
|
+
.tag{background:#f4edda;color:#a18b5f}
|
|
77
|
+
.panel{
|
|
78
|
+
border-color:rgba(255,255,255,.94);
|
|
79
|
+
box-shadow:0 18px 50px rgba(83,111,145,.12);
|
|
80
|
+
}
|
|
81
|
+
.hero{
|
|
82
|
+
background:
|
|
83
|
+
radial-gradient(circle at 82% 26%,rgba(255,255,255,.86),transparent 22%),
|
|
84
|
+
linear-gradient(112deg,rgba(255,254,248,.96),rgba(224,243,250,.88) 58%,rgba(238,232,249,.86));
|
|
85
|
+
}
|
|
86
|
+
.hero:after{border-color:#d9bd7d;opacity:.34}
|
|
87
|
+
.eyebrow{color:#a18c63}
|
|
88
|
+
.hero h1{color:#334b68}
|
|
89
|
+
.hero p{color:#8197ad}
|
|
90
|
+
.primary{
|
|
91
|
+
background:linear-gradient(110deg,#75b9df,#8f9fd2 72%,#b5a2d8);
|
|
92
|
+
box-shadow:0 8px 18px rgba(119,167,206,.3);
|
|
93
|
+
}
|
|
94
|
+
.soft{
|
|
95
|
+
background:linear-gradient(135deg,#fffdf7,#edf6fa);
|
|
96
|
+
color:#66839c;border-color:#e8e1d3;
|
|
97
|
+
}
|
|
98
|
+
.soft:hover,.choice:hover{box-shadow:0 7px 18px rgba(120,151,183,.12)}
|
|
99
|
+
.orb{
|
|
100
|
+
background:radial-gradient(circle at 35% 25%,#fff 0%,#fff4d5 17%,#c9e8f4 43%,#8fc5e4 66%,#b6a9dc 88%,#f8e9c9 100%);
|
|
101
|
+
box-shadow:inset -12px -14px 25px rgba(86,112,151,.16),0 0 52px rgba(153,207,229,.48);
|
|
102
|
+
}
|
|
103
|
+
.orbit{border-color:rgba(210,181,115,.58)}
|
|
104
|
+
.orb-caption{color:#9a8b6c}
|
|
105
|
+
.hero-foot{color:#8c9db0}
|
|
106
|
+
.hero-foot b{color:#a8874f}
|
|
107
|
+
.stat strong{color:#425d7d}
|
|
108
|
+
.section-head h2{color:#3e5877}
|
|
109
|
+
.tag.pale{background:#f1eef8;color:#8f83b7}
|
|
110
|
+
.flow-panel,.model-panel,.device-panel,.log-panel,
|
|
111
|
+
.pairing-panel,.intelligence-panel,.game-profile-panel,.voice-panel{
|
|
112
|
+
border-color:rgba(255,255,255,.96);
|
|
113
|
+
}
|
|
114
|
+
.pairing-panel{background:linear-gradient(120deg,rgba(255,254,248,.94),rgba(226,243,250,.9))}
|
|
115
|
+
.qr-placeholder{
|
|
116
|
+
border-color:#cdb77f;
|
|
117
|
+
background:repeating-linear-gradient(45deg,#fffdf7,#fffdf7 8px,#f0f7fa 8px,#f0f7fa 16px);
|
|
118
|
+
}
|
|
119
|
+
.qr-center{background:#e5f1f5;color:#8e83b8}
|
|
120
|
+
.qr-corner{border-color:#c5a96c}
|
|
121
|
+
.intel-card{background:rgba(255,254,249,.88);border-color:#eee6d6}
|
|
122
|
+
.intel-icon,.model-icon{background:linear-gradient(145deg,#fff0ca,#dff1f7 58%,#eee8f8);color:#8d91bf}
|
|
123
|
+
.profile-item{background:#fffdf8;border-color:#eee7d9}
|
|
124
|
+
.profile-note{background:#f7f3e9}
|
|
125
|
+
.voice-avatar{
|
|
126
|
+
background:radial-gradient(circle at 35% 25%,#fffdf1,#e5f5fa 48%,#d7ccef);
|
|
127
|
+
color:#8c91c5;box-shadow:0 12px 26px rgba(165,157,205,.2);
|
|
128
|
+
}
|
|
129
|
+
.voice-settings input{background:#fffefa;border-color:#e8e2d5}
|
|
130
|
+
.choice{background:#f5f2e9;color:#8998a9}
|
|
131
|
+
.choice.selected{background:#e8f3f6;color:#648ea4;box-shadow:inset 0 0 0 1px #c9e0e6}
|
|
132
|
+
.event{border-top-color:#eee9df}
|
|
133
|
+
.event-dot{background:#d6b66e}
|
|
134
|
+
footer{color:#a69a80}
|
|
135
|
+
@media(max-width:760px){
|
|
136
|
+
.hero{background:linear-gradient(130deg,rgba(255,254,248,.96),rgba(226,243,250,.9) 62%,rgba(238,232,249,.88))}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
/* Real desktop-generated QR pairing controls */
|
|
141
|
+
.qr-frame{width:190px;flex:0 0 190px;display:flex;flex-direction:column;align-items:center;gap:8px}
|
|
142
|
+
.qr-frame .qr-placeholder{width:180px;height:180px;flex:none}
|
|
143
|
+
.pair-qr-image{width:180px;height:180px;object-fit:contain;padding:7px;border-radius:15px;background:#fff;box-shadow:0 8px 26px rgba(67,93,125,.13)}
|
|
144
|
+
.pair-qr-image[hidden],.qr-placeholder[hidden]{display:none}
|
|
145
|
+
#pairQrCaption{font-size:10px;color:#8da2b1}
|
|
146
|
+
.pair-host-label{display:block;margin:10px 0 5px;color:#8196a6;font-size:10px}
|
|
147
|
+
.pair-host-select{width:min(100%,360px);padding:9px 11px;border:1px solid #dfe9ee;border-radius:10px;background:#fffefa;color:#526b7b;font:inherit;font-size:11px}
|
|
148
|
+
.pairing-buttons{display:flex;gap:9px;flex-wrap:wrap;margin-top:12px}
|
|
149
|
+
.pair-mobile-note{margin-top:10px!important;font-size:9px!important;color:#a18b68!important}
|
|
150
|
+
@media(max-width:600px){.pairing-layout{flex-direction:column}.qr-frame{width:100%;flex-direction:row;justify-content:center}.qr-frame .qr-placeholder,.pair-qr-image{width:150px;height:150px}.qr-frame .qr-placeholder{flex-basis:150px}}
|
|
@@ -0,0 +1,78 @@
|
|
|
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. 在侧边栏打开 **插件(Plugins)**,进入 **已安装插件(Installed plugins)**,选择 **Gamer 游戏智能体**,即可看到插件配置页。页面右上角可切换简体中文和 English。
|
|
14
|
+
|
|
15
|
+
不要填写 GitHub 仓库 URL。DSH 插件包通过 npm 分发,GitHub 仓库用于源码和开发。
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## 启动电脑端二维码生成器(Windows / Linux)
|
|
19
|
+
|
|
20
|
+
要求:Node.js 22.13 或更高版本。电脑和手机需要连接同一个可信任的局域网。
|
|
21
|
+
|
|
22
|
+
**Windows PowerShell:**
|
|
23
|
+
|
|
24
|
+
```powershell
|
|
25
|
+
git clone https://github.com/sususgh/Gamer-DSH-Plugin.git
|
|
26
|
+
cd Gamer-DSH-Plugin\desktop-runtime
|
|
27
|
+
npm install
|
|
28
|
+
npm start
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Linux(Debian / Ubuntu 等):**
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
git clone https://github.com/sususgh/Gamer-DSH-Plugin.git
|
|
35
|
+
cd Gamer-DSH-Plugin/desktop-runtime
|
|
36
|
+
npm install
|
|
37
|
+
npm start
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
启动后在电脑浏览器打开 `http://127.0.0.1:8765`,选择手机能够访问的电脑局域网地址,点击 **生成二维码**。二维码有效期为 5 分钟,可手动撤销。Windows 防火墙如弹出提示,只允许在可信的专用网络中访问。
|
|
41
|
+
|
|
42
|
+
手机相机扫码后会打开电脑的配对验证页。当前阶段实现的是**电脑端真实二维码生成与扫码落地页验证**;Android Companion 尚未实现设备身份提交、双端认证和会话握手,因此扫码成功不代表设备已连接,也不能开始游戏控制。不要将该 HTTP 服务或端口映射到公网。
|
|
43
|
+
|
|
44
|
+
## 当前功能状态
|
|
45
|
+
|
|
46
|
+
当前包提供:
|
|
47
|
+
- DSH 原生 Bundle 清单与插件入口。
|
|
48
|
+
- 插件详情页配置界面(简体中文 / English 切换)。
|
|
49
|
+
- 独立电脑端配对服务:可在 Windows / Linux 上启动本地服务并生成真实二维码(见下方步骤)。
|
|
50
|
+
- `gamer_project_status` 状态查询工具。
|
|
51
|
+
|
|
52
|
+
当前尚未提供:
|
|
53
|
+
- Android Companion 的扫码客户端、设备身份提交与双端认证。
|
|
54
|
+
- Windows 游戏控制运行时。
|
|
55
|
+
- Android APK 与二维码配对服务。
|
|
56
|
+
- 实际屏幕采集、OCR、目标检测和视觉模型管线。
|
|
57
|
+
- 键鼠/触控动作执行。
|
|
58
|
+
- 联机攻略检索与语音运行时。
|
|
59
|
+
|
|
60
|
+
因此,安装成功表示 DSH 已加载插件,不表示已经可以自动玩游戏。
|
|
61
|
+
|
|
62
|
+
## CLI 安装(非桌面托管 profile)
|
|
63
|
+
|
|
64
|
+
对于由 CLI 管理的 profile,可运行:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npx -y @deepseek-ai/dsh plugin --profile web add @sususgh/gamer-dsh-plugin@1.0.1
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
桌面版 DSH 的 desktop profile 应在应用内 Plugins → Add plugin 安装。
|
|
71
|
+
|
|
72
|
+
## 验证
|
|
73
|
+
|
|
74
|
+
重启 DSH 后,在新会话中让模型调用 `gamer_project_status`。正确结果应显示:
|
|
75
|
+
- `pluginLoaded: true`
|
|
76
|
+
- `canControlGames: false`
|
|
77
|
+
|
|
78
|
+
若状态工具不存在,检查插件是否安装到当前 DSH profile,并确认 DSH 版本支持 npm bundle 插件。
|
|
@@ -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
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// Browser-side DSH plugin UI. The module is loaded by dsh-client-modules.
|
|
2
|
+
window.__ModuleLoader__.load({
|
|
3
|
+
id: '@sususgh/gamer-dsh-plugin',
|
|
4
|
+
factory: (require) => {
|
|
5
|
+
const React = require('react');
|
|
6
|
+
const h = React.createElement;
|
|
7
|
+
|
|
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: '当前版本不会控制游戏或发送键鼠/触控指令。'
|
|
24
|
+
},
|
|
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
|
+
)
|
|
101
|
+
),
|
|
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)
|
|
106
|
+
),
|
|
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 + ' ↗')
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function apply(ctx) {
|
|
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
|
+
));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return { inject: ['slots'], apply };
|
|
123
|
+
}
|
|
124
|
+
});
|