dsh-plugin-agentdeck 0.0.0-stage → 0.1.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 +21 -0
- package/README.md +91 -2
- package/cordis.patch.yml +3 -0
- package/icon.svg +7 -0
- package/lib/client.js +1019 -0
- package/lib/index.js +233 -0
- package/lib/setup.js +1053 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +66 -4
package/lib/client.js
ADDED
|
@@ -0,0 +1,1019 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({
|
|
2
|
+
id: 'dsh-plugin-agentdeck',
|
|
3
|
+
factory: (require) => {
|
|
4
|
+
const module = { exports: {} };
|
|
5
|
+
const exports = module.exports;
|
|
6
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
7
|
+
|
|
8
|
+
const React = require('react');
|
|
9
|
+
const { useCallback, useEffect, useState } = React;
|
|
10
|
+
const h = React.createElement;
|
|
11
|
+
|
|
12
|
+
const NS = 'settings.agentdeck';
|
|
13
|
+
const STYLE_TAG_ID = 'dsh-plugin-agentdeck/styles.css';
|
|
14
|
+
|
|
15
|
+
const STORE_LINKS = {
|
|
16
|
+
appStore: 'https://apps.apple.com/app/id6821905390',
|
|
17
|
+
googlePlay:
|
|
18
|
+
'https://play.google.com/store/apps/details?id=com.mantou.agentdeck',
|
|
19
|
+
apk: 'https://github.com/mantou132/AgentDeck/releases/latest',
|
|
20
|
+
websiteEn: 'https://agentdeck.xianqiao.wang',
|
|
21
|
+
websiteZh: 'https://agentdeck.xianqiao.wang/zh',
|
|
22
|
+
pluginRepo: 'https://github.com/mantou132/dsh-plugin-agentdeck',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const DICTIONARIES = {
|
|
26
|
+
en: {
|
|
27
|
+
nav: 'AgentDeck',
|
|
28
|
+
title: 'AgentDeck Mobile Remote',
|
|
29
|
+
subtitle:
|
|
30
|
+
'Control DeepSeek Harness from your iPhone or Android via native ACP — end-to-end encrypted, with push notifications, file & terminal inspection.',
|
|
31
|
+
setupTitle: '1. One-Click Setup & Autostart',
|
|
32
|
+
setupDesc:
|
|
33
|
+
'Installs the interactive ACP adapter, syncs model & provider config, registers dsh in AgentDeck, installs agentdeckd, and enables login autostart.',
|
|
34
|
+
itemAcp: 'Interactive ACP Adapter',
|
|
35
|
+
itemModels: 'ACP Model & Provider',
|
|
36
|
+
itemCustomAgents: 'AgentDeck custom_agents.json',
|
|
37
|
+
itemDaemon: 'agentdeckd Daemon & Autostart',
|
|
38
|
+
statusReady: 'Ready',
|
|
39
|
+
statusMissing: 'Not configured',
|
|
40
|
+
statusNeedsFix: 'Needs sync',
|
|
41
|
+
statusNotInstalled: 'Not installed',
|
|
42
|
+
statusStopped: 'Stopped',
|
|
43
|
+
acpNotInstalledHint:
|
|
44
|
+
'Will install @openma/deepseek-harness-acp into the acp profile.',
|
|
45
|
+
modelNone: 'Using DSH default model',
|
|
46
|
+
modelAcpLabel: 'acp profile:',
|
|
47
|
+
modelSourceLabel: 'Current profile:',
|
|
48
|
+
modelPinWarning:
|
|
49
|
+
'Non-DeepSeek provider needs acp-plugin provider pin — click Setup to fix.',
|
|
50
|
+
daemonNotInstalledHint:
|
|
51
|
+
'Will install agentdeckd and register OS autostart automatically.',
|
|
52
|
+
daemonStoppedHint:
|
|
53
|
+
'Installed, but not running. Click Setup or Start to launch and enable autostart.',
|
|
54
|
+
syncModelsToggle: 'Sync model & provider from current profile',
|
|
55
|
+
dshNotFound:
|
|
56
|
+
'Could not locate the `dsh` binary. Install dsh CLI or add it to PATH.',
|
|
57
|
+
btnSetup: 'One-Click Setup & Start',
|
|
58
|
+
btnResync: 'Re-sync & Repair',
|
|
59
|
+
btnSettingUp: 'Installing & configuring…',
|
|
60
|
+
btnRefresh: 'Refresh',
|
|
61
|
+
btnDaemonStart: 'Start & Enable Autostart',
|
|
62
|
+
btnDaemonRestart: 'Restart',
|
|
63
|
+
btnDaemonStop: 'Stop & Disable Autostart',
|
|
64
|
+
btnWorking: 'Working…',
|
|
65
|
+
setupSuccess:
|
|
66
|
+
'All set! Open AgentDeck on your phone and scan the QR code below.',
|
|
67
|
+
pairTitle: '2. Pair with AgentDeck App',
|
|
68
|
+
daemonRunning: 'Running',
|
|
69
|
+
daemonStopped: 'Stopped',
|
|
70
|
+
daemonMissing: 'Not installed',
|
|
71
|
+
daemonStartHint:
|
|
72
|
+
'Pairing ID is ready, but agentdeckd is stopped. Click Start to bring your host online and re-enable autostart.',
|
|
73
|
+
daemonAutoHint:
|
|
74
|
+
'Click "One-Click Setup & Start" above to automatically install agentdeckd, enable autostart, and generate your pairing QR code.',
|
|
75
|
+
qrHint:
|
|
76
|
+
'Open AgentDeck on your phone and scan this QR code to pair. Keep this code private — it grants full access to your host.',
|
|
77
|
+
pairingIdLabel: 'Pairing ID',
|
|
78
|
+
customRelayLabel: 'Custom Relay',
|
|
79
|
+
downloadTitle: 'Get AgentDeck',
|
|
80
|
+
linkAppStore: 'App Store (iOS)',
|
|
81
|
+
linkGooglePlay: 'Google Play',
|
|
82
|
+
linkApk: 'Android APK',
|
|
83
|
+
linkWebsite: 'Website',
|
|
84
|
+
loading: 'Checking local environment…',
|
|
85
|
+
loadError: 'Operation failed',
|
|
86
|
+
stepInstalled: 'Installed',
|
|
87
|
+
stepSkipped: 'Already ready',
|
|
88
|
+
stepUpdated: 'Updated',
|
|
89
|
+
stepUnchanged: 'No changes needed',
|
|
90
|
+
stepStarted: 'Started with autostart',
|
|
91
|
+
isZh: '0',
|
|
92
|
+
},
|
|
93
|
+
zh: {
|
|
94
|
+
nav: 'AgentDeck 手机远控',
|
|
95
|
+
title: 'AgentDeck 手机远控',
|
|
96
|
+
subtitle:
|
|
97
|
+
'通过原生 ACP 协议在 iPhone / Android 手机上远程控制 DeepSeek Harness:端到端加密、推送通知、浏览文件与终端。',
|
|
98
|
+
setupTitle: '1. 一键配置并开启自启动',
|
|
99
|
+
setupDesc:
|
|
100
|
+
'自动完成:安装交互式 ACP 适配器、同步模型与服务商配置、写入 custom_agents.json、安装 agentdeckd 并注册开机自启动。',
|
|
101
|
+
itemAcp: '交互式 ACP 适配器',
|
|
102
|
+
itemModels: 'ACP 模型与服务商',
|
|
103
|
+
itemCustomAgents: 'AgentDeck custom_agents.json',
|
|
104
|
+
itemDaemon: 'agentdeckd 守护服务与自启',
|
|
105
|
+
statusReady: '已就绪',
|
|
106
|
+
statusMissing: '未配置',
|
|
107
|
+
statusNeedsFix: '待修复',
|
|
108
|
+
statusNotInstalled: '未安装',
|
|
109
|
+
statusStopped: '未运行',
|
|
110
|
+
acpNotInstalledHint:
|
|
111
|
+
'点击一键配置将自动为 acp profile 安装 @openma/deepseek-harness-acp。',
|
|
112
|
+
modelNone: '使用 DSH 默认模型',
|
|
113
|
+
modelAcpLabel: 'acp 配置:',
|
|
114
|
+
modelSourceLabel: '当前界面:',
|
|
115
|
+
modelPinWarning:
|
|
116
|
+
'第三方服务商需要同步 acp-plugin 的 provider 配置,点击一键配置即可自动修复。',
|
|
117
|
+
daemonNotInstalledHint:
|
|
118
|
+
'点击一键配置将自动安装 agentdeckd 并注册系统开机自启。',
|
|
119
|
+
daemonStoppedHint:
|
|
120
|
+
'已安装但未运行,点击一键配置或下方「启动并开启自启」即可上线。',
|
|
121
|
+
syncModelsToggle: '将当前界面的模型与服务商配置同步到 acp profile',
|
|
122
|
+
dshNotFound:
|
|
123
|
+
'未检测到 `dsh` 可执行文件,请先安装 DeepSeek Harness CLI 或加入 PATH。',
|
|
124
|
+
btnSetup: '一键配置并启动',
|
|
125
|
+
btnResync: '重新同步 / 修复',
|
|
126
|
+
btnSettingUp: '正在安装与配置…',
|
|
127
|
+
btnRefresh: '刷新状态',
|
|
128
|
+
btnDaemonStart: '启动并开启自启',
|
|
129
|
+
btnDaemonRestart: '重启',
|
|
130
|
+
btnDaemonStop: '停止并取消自启',
|
|
131
|
+
btnWorking: '处理中…',
|
|
132
|
+
setupSuccess: '全部配置并启动完成!打开手机上的 AgentDeck 扫描下方二维码即可连接。',
|
|
133
|
+
pairTitle: '2. 手机扫码配对',
|
|
134
|
+
daemonRunning: '运行中',
|
|
135
|
+
daemonStopped: '已停止',
|
|
136
|
+
daemonMissing: '未安装',
|
|
137
|
+
daemonStartHint:
|
|
138
|
+
'已生成配对信息,但 agentdeckd 当前未运行。点击「启动并开启自启」即可上线。',
|
|
139
|
+
daemonAutoHint:
|
|
140
|
+
'点击上方「一键配置并启动」,插件会自动安装 agentdeckd、设置开机自启,并在此生成配对二维码。',
|
|
141
|
+
qrHint:
|
|
142
|
+
'打开手机上的 AgentDeck App 扫描此二维码即可配对。请勿泄露二维码——它代表本机远程访问权限。',
|
|
143
|
+
pairingIdLabel: '配对 ID',
|
|
144
|
+
customRelayLabel: '自定义 Relay',
|
|
145
|
+
downloadTitle: '获取 AgentDeck',
|
|
146
|
+
linkAppStore: 'App Store (iOS)',
|
|
147
|
+
linkGooglePlay: 'Google Play',
|
|
148
|
+
linkApk: 'Android APK',
|
|
149
|
+
linkWebsite: '官网',
|
|
150
|
+
loading: '正在检测本机环境…',
|
|
151
|
+
loadError: '操作失败',
|
|
152
|
+
stepInstalled: '已安装',
|
|
153
|
+
stepSkipped: '已就绪',
|
|
154
|
+
stepUpdated: '已更新',
|
|
155
|
+
stepUnchanged: '无需变更',
|
|
156
|
+
stepStarted: '已启动并开启自启',
|
|
157
|
+
isZh: '1',
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
const CSS_TEXT = `
|
|
162
|
+
.adk-root {
|
|
163
|
+
display: flex;
|
|
164
|
+
flex-direction: column;
|
|
165
|
+
gap: 16px;
|
|
166
|
+
padding: 4px 0 24px;
|
|
167
|
+
color: var(--dsw-alias-label-primary, #111827);
|
|
168
|
+
font-size: 13px;
|
|
169
|
+
line-height: 1.5;
|
|
170
|
+
}
|
|
171
|
+
.adk-hero {
|
|
172
|
+
display: flex;
|
|
173
|
+
align-items: flex-start;
|
|
174
|
+
justify-content: space-between;
|
|
175
|
+
gap: 12px;
|
|
176
|
+
}
|
|
177
|
+
.adk-title {
|
|
178
|
+
margin: 0 0 4px;
|
|
179
|
+
font-size: 16px;
|
|
180
|
+
font-weight: 600;
|
|
181
|
+
color: var(--dsw-alias-label-primary, #111827);
|
|
182
|
+
}
|
|
183
|
+
.adk-subtitle {
|
|
184
|
+
margin: 0;
|
|
185
|
+
font-size: 13px;
|
|
186
|
+
color: var(--dsw-alias-label-secondary, #4b5563);
|
|
187
|
+
}
|
|
188
|
+
.adk-card {
|
|
189
|
+
border-radius: var(--dsw-radius-xl, 14px);
|
|
190
|
+
background: var(--dsw-alias-settings-card-fill, rgba(127, 127, 127, 0.06));
|
|
191
|
+
border: 1px solid var(--dsw-alias-settings-card-stroke, rgba(127, 127, 127, 0.16));
|
|
192
|
+
padding: 16px;
|
|
193
|
+
display: flex;
|
|
194
|
+
flex-direction: column;
|
|
195
|
+
gap: 12px;
|
|
196
|
+
}
|
|
197
|
+
.adk-card-head {
|
|
198
|
+
display: flex;
|
|
199
|
+
align-items: center;
|
|
200
|
+
justify-content: space-between;
|
|
201
|
+
gap: 10px;
|
|
202
|
+
flex-wrap: wrap;
|
|
203
|
+
}
|
|
204
|
+
.adk-card-title {
|
|
205
|
+
margin: 0;
|
|
206
|
+
font-size: 14px;
|
|
207
|
+
font-weight: 600;
|
|
208
|
+
color: var(--dsw-alias-label-primary, #111827);
|
|
209
|
+
}
|
|
210
|
+
.adk-card-desc {
|
|
211
|
+
margin: 0;
|
|
212
|
+
font-size: 12.5px;
|
|
213
|
+
color: var(--dsw-alias-label-tertiary, #6b7280);
|
|
214
|
+
}
|
|
215
|
+
.adk-list {
|
|
216
|
+
display: flex;
|
|
217
|
+
flex-direction: column;
|
|
218
|
+
border-top: 1px solid var(--dsw-alias-border-l2, rgba(127, 127, 127, 0.15));
|
|
219
|
+
}
|
|
220
|
+
.adk-row {
|
|
221
|
+
display: flex;
|
|
222
|
+
align-items: flex-start;
|
|
223
|
+
justify-content: space-between;
|
|
224
|
+
gap: 12px;
|
|
225
|
+
padding: 10px 0;
|
|
226
|
+
border-bottom: 1px solid var(--dsw-alias-border-l2, rgba(127, 127, 127, 0.15));
|
|
227
|
+
}
|
|
228
|
+
.adk-row:last-child {
|
|
229
|
+
border-bottom: none;
|
|
230
|
+
padding-bottom: 2px;
|
|
231
|
+
}
|
|
232
|
+
.adk-row-main {
|
|
233
|
+
display: flex;
|
|
234
|
+
flex-direction: column;
|
|
235
|
+
gap: 2px;
|
|
236
|
+
min-width: 0;
|
|
237
|
+
flex: 1;
|
|
238
|
+
}
|
|
239
|
+
.adk-row-label {
|
|
240
|
+
font-weight: 500;
|
|
241
|
+
color: var(--dsw-alias-label-primary, #111827);
|
|
242
|
+
}
|
|
243
|
+
.adk-row-detail {
|
|
244
|
+
font-size: 12px;
|
|
245
|
+
color: var(--dsw-alias-label-tertiary, #6b7280);
|
|
246
|
+
word-break: break-all;
|
|
247
|
+
}
|
|
248
|
+
.adk-badge {
|
|
249
|
+
display: inline-flex;
|
|
250
|
+
align-items: center;
|
|
251
|
+
gap: 5px;
|
|
252
|
+
padding: 2px 8px;
|
|
253
|
+
border-radius: 999px;
|
|
254
|
+
font-size: 11.5px;
|
|
255
|
+
font-weight: 500;
|
|
256
|
+
white-space: nowrap;
|
|
257
|
+
flex-shrink: 0;
|
|
258
|
+
}
|
|
259
|
+
.adk-badge-ok {
|
|
260
|
+
background: rgba(16, 185, 129, 0.14);
|
|
261
|
+
color: #10b981;
|
|
262
|
+
}
|
|
263
|
+
.adk-badge-warn {
|
|
264
|
+
background: rgba(245, 158, 11, 0.16);
|
|
265
|
+
color: #d97706;
|
|
266
|
+
}
|
|
267
|
+
.adk-badge-muted {
|
|
268
|
+
background: rgba(127, 127, 127, 0.14);
|
|
269
|
+
color: var(--dsw-alias-label-secondary, #6b7280);
|
|
270
|
+
}
|
|
271
|
+
.adk-checkbox-row {
|
|
272
|
+
display: flex;
|
|
273
|
+
align-items: center;
|
|
274
|
+
gap: 8px;
|
|
275
|
+
font-size: 12.5px;
|
|
276
|
+
color: var(--dsw-alias-label-secondary, #4b5563);
|
|
277
|
+
cursor: pointer;
|
|
278
|
+
user-select: none;
|
|
279
|
+
}
|
|
280
|
+
.adk-checkbox-row input {
|
|
281
|
+
margin: 0;
|
|
282
|
+
cursor: pointer;
|
|
283
|
+
}
|
|
284
|
+
.adk-actions {
|
|
285
|
+
display: flex;
|
|
286
|
+
align-items: center;
|
|
287
|
+
gap: 8px;
|
|
288
|
+
flex-wrap: wrap;
|
|
289
|
+
}
|
|
290
|
+
.adk-btn {
|
|
291
|
+
display: inline-flex;
|
|
292
|
+
align-items: center;
|
|
293
|
+
justify-content: center;
|
|
294
|
+
gap: 6px;
|
|
295
|
+
height: 32px;
|
|
296
|
+
padding: 0 14px;
|
|
297
|
+
border-radius: var(--dsw-radius-md, 8px);
|
|
298
|
+
font-size: 13px;
|
|
299
|
+
font-weight: 500;
|
|
300
|
+
font-family: inherit;
|
|
301
|
+
cursor: pointer;
|
|
302
|
+
border: 1px solid transparent;
|
|
303
|
+
transition: background-color 0.15s ease, opacity 0.15s ease;
|
|
304
|
+
}
|
|
305
|
+
.adk-btn:disabled {
|
|
306
|
+
opacity: 0.55;
|
|
307
|
+
cursor: not-allowed;
|
|
308
|
+
}
|
|
309
|
+
.adk-btn-primary {
|
|
310
|
+
background: var(--dsw-alias-button-primary-fill, #2563eb);
|
|
311
|
+
color: var(--dsw-alias-label-primary-foreground, #ffffff);
|
|
312
|
+
}
|
|
313
|
+
.adk-btn-primary:hover:not(:disabled) {
|
|
314
|
+
background: var(--dsw-alias-button-primary-hover, #1d4ed8);
|
|
315
|
+
}
|
|
316
|
+
.adk-btn-secondary {
|
|
317
|
+
background: transparent;
|
|
318
|
+
border-color: var(--dsw-alias-border-l3, rgba(127, 127, 127, 0.25));
|
|
319
|
+
color: var(--dsw-alias-label-primary, #111827);
|
|
320
|
+
}
|
|
321
|
+
.adk-btn-secondary:hover:not(:disabled) {
|
|
322
|
+
background: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, 0.1));
|
|
323
|
+
}
|
|
324
|
+
.adk-btn-sm {
|
|
325
|
+
height: 28px;
|
|
326
|
+
padding: 0 10px;
|
|
327
|
+
font-size: 12px;
|
|
328
|
+
}
|
|
329
|
+
.adk-banner {
|
|
330
|
+
border-radius: var(--dsw-radius-md, 8px);
|
|
331
|
+
padding: 10px 12px;
|
|
332
|
+
font-size: 12.5px;
|
|
333
|
+
line-height: 1.5;
|
|
334
|
+
}
|
|
335
|
+
.adk-banner-ok {
|
|
336
|
+
background: rgba(16, 185, 129, 0.12);
|
|
337
|
+
border: 1px solid rgba(16, 185, 129, 0.3);
|
|
338
|
+
color: var(--dsw-alias-label-primary, #065f46);
|
|
339
|
+
}
|
|
340
|
+
.adk-banner-err {
|
|
341
|
+
background: rgba(239, 68, 68, 0.12);
|
|
342
|
+
border: 1px solid rgba(239, 68, 68, 0.32);
|
|
343
|
+
color: #ef4444;
|
|
344
|
+
}
|
|
345
|
+
.adk-steps {
|
|
346
|
+
margin: 6px 0 0;
|
|
347
|
+
padding-left: 16px;
|
|
348
|
+
font-size: 12px;
|
|
349
|
+
color: var(--dsw-alias-label-secondary, #4b5563);
|
|
350
|
+
}
|
|
351
|
+
.adk-qr-layout {
|
|
352
|
+
display: flex;
|
|
353
|
+
gap: 16px;
|
|
354
|
+
align-items: flex-start;
|
|
355
|
+
flex-wrap: wrap;
|
|
356
|
+
}
|
|
357
|
+
.adk-qr-frame {
|
|
358
|
+
width: 168px;
|
|
359
|
+
height: 168px;
|
|
360
|
+
padding: 8px;
|
|
361
|
+
box-sizing: border-box;
|
|
362
|
+
border-radius: 12px;
|
|
363
|
+
background: #ffffff;
|
|
364
|
+
border: 1px solid rgba(0, 0, 0, 0.08);
|
|
365
|
+
flex-shrink: 0;
|
|
366
|
+
display: flex;
|
|
367
|
+
align-items: center;
|
|
368
|
+
justify-content: center;
|
|
369
|
+
}
|
|
370
|
+
.adk-qr-frame img {
|
|
371
|
+
width: 100%;
|
|
372
|
+
height: 100%;
|
|
373
|
+
display: block;
|
|
374
|
+
}
|
|
375
|
+
.adk-qr-info {
|
|
376
|
+
flex: 1;
|
|
377
|
+
min-width: 220px;
|
|
378
|
+
display: flex;
|
|
379
|
+
flex-direction: column;
|
|
380
|
+
gap: 8px;
|
|
381
|
+
}
|
|
382
|
+
.adk-meta-line {
|
|
383
|
+
font-size: 12px;
|
|
384
|
+
color: var(--dsw-alias-label-tertiary, #6b7280);
|
|
385
|
+
}
|
|
386
|
+
.adk-meta-line code {
|
|
387
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
388
|
+
color: var(--dsw-alias-label-primary, #111827);
|
|
389
|
+
background: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, 0.1));
|
|
390
|
+
padding: 1px 5px;
|
|
391
|
+
border-radius: 4px;
|
|
392
|
+
}
|
|
393
|
+
.adk-links {
|
|
394
|
+
display: flex;
|
|
395
|
+
align-items: center;
|
|
396
|
+
gap: 8px;
|
|
397
|
+
flex-wrap: wrap;
|
|
398
|
+
padding-top: 8px;
|
|
399
|
+
border-top: 1px solid var(--dsw-alias-border-l2, rgba(127, 127, 127, 0.15));
|
|
400
|
+
}
|
|
401
|
+
.adk-links-label {
|
|
402
|
+
font-size: 12px;
|
|
403
|
+
color: var(--dsw-alias-label-tertiary, #6b7280);
|
|
404
|
+
margin-right: 4px;
|
|
405
|
+
}
|
|
406
|
+
.adk-link {
|
|
407
|
+
display: inline-flex;
|
|
408
|
+
align-items: center;
|
|
409
|
+
height: 26px;
|
|
410
|
+
padding: 0 10px;
|
|
411
|
+
border-radius: var(--dsw-radius-md, 8px);
|
|
412
|
+
border: 1px solid var(--dsw-alias-border-l3, rgba(127, 127, 127, 0.24));
|
|
413
|
+
color: var(--dsw-alias-label-primary, #111827);
|
|
414
|
+
text-decoration: none;
|
|
415
|
+
font-size: 12px;
|
|
416
|
+
font-weight: 500;
|
|
417
|
+
}
|
|
418
|
+
.adk-link:hover {
|
|
419
|
+
background: var(--dsw-alias-interactive-bg-hover, rgba(127, 127, 127, 0.1));
|
|
420
|
+
}
|
|
421
|
+
`;
|
|
422
|
+
|
|
423
|
+
function injectStyles() {
|
|
424
|
+
if (typeof document === 'undefined') return;
|
|
425
|
+
if (
|
|
426
|
+
document.querySelector(
|
|
427
|
+
`style[data-plugin-css=${JSON.stringify(STYLE_TAG_ID)}]`,
|
|
428
|
+
) !== null
|
|
429
|
+
) {
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
const tag = document.createElement('style');
|
|
433
|
+
tag.dataset.plugin = 'dsh-plugin-agentdeck';
|
|
434
|
+
tag.dataset.pluginCss = STYLE_TAG_ID;
|
|
435
|
+
tag.textContent = CSS_TEXT;
|
|
436
|
+
document.head.appendChild(tag);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
function PhoneIcon(props) {
|
|
440
|
+
const size = props?.size ?? 16;
|
|
441
|
+
return h(
|
|
442
|
+
'svg',
|
|
443
|
+
{
|
|
444
|
+
width: size,
|
|
445
|
+
height: size,
|
|
446
|
+
viewBox: '0 0 24 24',
|
|
447
|
+
fill: 'none',
|
|
448
|
+
stroke: 'currentColor',
|
|
449
|
+
strokeWidth: 1.8,
|
|
450
|
+
strokeLinecap: 'round',
|
|
451
|
+
strokeLinejoin: 'round',
|
|
452
|
+
'aria-hidden': 'true',
|
|
453
|
+
},
|
|
454
|
+
h('rect', { x: 6, y: 2.5, width: 12, height: 19, rx: 2.5 }),
|
|
455
|
+
h('path', { d: 'M10 9.5L12.5 12L10 14.5' }),
|
|
456
|
+
h('path', { d: 'M13.5 14.5H15' }),
|
|
457
|
+
h('circle', { cx: 12, cy: 18, r: 0.7, fill: 'currentColor' }),
|
|
458
|
+
);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
function formatModel(entry) {
|
|
462
|
+
if (!entry || (!entry.provider && !entry.model)) return null;
|
|
463
|
+
return [entry.provider, entry.model].filter(Boolean).join(' / ');
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
function AgentDeckSettingsSection(props) {
|
|
467
|
+
const t = props.t || ((k) => DICTIONARIES.en[k] || k);
|
|
468
|
+
const isZh = t('isZh') === '1';
|
|
469
|
+
|
|
470
|
+
const [status, setStatus] = useState(null);
|
|
471
|
+
const [loading, setLoading] = useState(true);
|
|
472
|
+
const [error, setError] = useState(null);
|
|
473
|
+
const [busy, setBusy] = useState(false);
|
|
474
|
+
const [daemonBusy, setDaemonBusy] = useState(false);
|
|
475
|
+
const [syncModels, setSyncModels] = useState(false);
|
|
476
|
+
const [setupFeedback, setSetupFeedback] = useState(null);
|
|
477
|
+
|
|
478
|
+
const loadStatus = useCallback(async () => {
|
|
479
|
+
setLoading(true);
|
|
480
|
+
setError(null);
|
|
481
|
+
try {
|
|
482
|
+
const res = await fetch('/api/agentdeck/status', {
|
|
483
|
+
cache: 'no-store',
|
|
484
|
+
});
|
|
485
|
+
const data = await res.json();
|
|
486
|
+
if (!res.ok) {
|
|
487
|
+
throw new Error(data?.error || `HTTP ${res.status}`);
|
|
488
|
+
}
|
|
489
|
+
setStatus(data);
|
|
490
|
+
setSyncModels((prev) =>
|
|
491
|
+
prev ? true : !data?.models?.acp?.defaultModel,
|
|
492
|
+
);
|
|
493
|
+
} catch (err) {
|
|
494
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
495
|
+
} finally {
|
|
496
|
+
setLoading(false);
|
|
497
|
+
}
|
|
498
|
+
}, []);
|
|
499
|
+
|
|
500
|
+
useEffect(() => {
|
|
501
|
+
loadStatus();
|
|
502
|
+
}, [loadStatus]);
|
|
503
|
+
|
|
504
|
+
const onSetup = useCallback(async () => {
|
|
505
|
+
setBusy(true);
|
|
506
|
+
setError(null);
|
|
507
|
+
setSetupFeedback(null);
|
|
508
|
+
try {
|
|
509
|
+
const res = await fetch('/api/agentdeck/setup', {
|
|
510
|
+
method: 'POST',
|
|
511
|
+
headers: { 'content-type': 'application/json' },
|
|
512
|
+
body: JSON.stringify({ syncModels }),
|
|
513
|
+
});
|
|
514
|
+
const data = await res.json();
|
|
515
|
+
if (!res.ok || !data?.ok) {
|
|
516
|
+
throw new Error(data?.error || `HTTP ${res.status}`);
|
|
517
|
+
}
|
|
518
|
+
if (data.status) setStatus(data.status);
|
|
519
|
+
setSetupFeedback({ steps: data.steps || [] });
|
|
520
|
+
} catch (err) {
|
|
521
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
522
|
+
} finally {
|
|
523
|
+
setBusy(false);
|
|
524
|
+
}
|
|
525
|
+
}, [syncModels]);
|
|
526
|
+
|
|
527
|
+
const onDaemonAction = useCallback(async (action) => {
|
|
528
|
+
setDaemonBusy(true);
|
|
529
|
+
setError(null);
|
|
530
|
+
try {
|
|
531
|
+
const res = await fetch('/api/agentdeck/daemon', {
|
|
532
|
+
method: 'POST',
|
|
533
|
+
headers: { 'content-type': 'application/json' },
|
|
534
|
+
body: JSON.stringify({ action }),
|
|
535
|
+
});
|
|
536
|
+
const data = await res.json();
|
|
537
|
+
if (!res.ok || !data?.ok) {
|
|
538
|
+
throw new Error(data?.error || `HTTP ${res.status}`);
|
|
539
|
+
}
|
|
540
|
+
if (data.status) setStatus(data.status);
|
|
541
|
+
} catch (err) {
|
|
542
|
+
setError(err instanceof Error ? err.message : String(err));
|
|
543
|
+
} finally {
|
|
544
|
+
setDaemonBusy(false);
|
|
545
|
+
}
|
|
546
|
+
}, []);
|
|
547
|
+
|
|
548
|
+
const stepStatusLabel = (s) => {
|
|
549
|
+
if (s === 'installed') return t('stepInstalled');
|
|
550
|
+
if (s === 'skipped') return t('stepSkipped');
|
|
551
|
+
if (s === 'updated') return t('stepUpdated');
|
|
552
|
+
if (s === 'started') return t('stepStarted');
|
|
553
|
+
return t('stepUnchanged');
|
|
554
|
+
};
|
|
555
|
+
|
|
556
|
+
const acpModelText = formatModel(status?.models?.acp?.defaultModel);
|
|
557
|
+
const sourceModelText = formatModel(status?.models?.source?.defaultModel);
|
|
558
|
+
const qrDataUrl = status?.daemon?.qrSvg
|
|
559
|
+
? `data:image/svg+xml;charset=utf-8,${encodeURIComponent(status.daemon.qrSvg)}`
|
|
560
|
+
: null;
|
|
561
|
+
const anyBusy = busy || daemonBusy;
|
|
562
|
+
|
|
563
|
+
return h(
|
|
564
|
+
'div',
|
|
565
|
+
{ className: 'adk-root' },
|
|
566
|
+
h(
|
|
567
|
+
'div',
|
|
568
|
+
{ className: 'adk-hero' },
|
|
569
|
+
h(
|
|
570
|
+
'div',
|
|
571
|
+
null,
|
|
572
|
+
h('h2', { className: 'adk-title' }, t('title')),
|
|
573
|
+
h('p', { className: 'adk-subtitle' }, t('subtitle')),
|
|
574
|
+
),
|
|
575
|
+
),
|
|
576
|
+
|
|
577
|
+
loading && !status
|
|
578
|
+
? h('div', { className: 'adk-card' }, t('loading'))
|
|
579
|
+
: null,
|
|
580
|
+
|
|
581
|
+
error
|
|
582
|
+
? h(
|
|
583
|
+
'div',
|
|
584
|
+
{ className: 'adk-banner adk-banner-err' },
|
|
585
|
+
`${t('loadError')}: ${error}`,
|
|
586
|
+
)
|
|
587
|
+
: null,
|
|
588
|
+
|
|
589
|
+
status
|
|
590
|
+
? h(
|
|
591
|
+
React.Fragment,
|
|
592
|
+
null,
|
|
593
|
+
// Card 1: One-click setup + autostart
|
|
594
|
+
h(
|
|
595
|
+
'section',
|
|
596
|
+
{ className: 'adk-card' },
|
|
597
|
+
h(
|
|
598
|
+
'div',
|
|
599
|
+
{ className: 'adk-card-head' },
|
|
600
|
+
h('h3', { className: 'adk-card-title' }, t('setupTitle')),
|
|
601
|
+
h(
|
|
602
|
+
'span',
|
|
603
|
+
{
|
|
604
|
+
className: `adk-badge ${status.ready ? 'adk-badge-ok' : 'adk-badge-warn'}`,
|
|
605
|
+
},
|
|
606
|
+
status.ready ? t('statusReady') : t('statusMissing'),
|
|
607
|
+
),
|
|
608
|
+
),
|
|
609
|
+
h('p', { className: 'adk-card-desc' }, t('setupDesc')),
|
|
610
|
+
h(
|
|
611
|
+
'div',
|
|
612
|
+
{ className: 'adk-list' },
|
|
613
|
+
// Row 1: ACP adapter
|
|
614
|
+
h(
|
|
615
|
+
'div',
|
|
616
|
+
{ className: 'adk-row' },
|
|
617
|
+
h(
|
|
618
|
+
'div',
|
|
619
|
+
{ className: 'adk-row-main' },
|
|
620
|
+
h('span', { className: 'adk-row-label' }, t('itemAcp')),
|
|
621
|
+
h(
|
|
622
|
+
'span',
|
|
623
|
+
{ className: 'adk-row-detail' },
|
|
624
|
+
status.acpPlugin?.installed
|
|
625
|
+
? `${status.acpPlugin.packageName}@${status.acpPlugin.version}`
|
|
626
|
+
: t('acpNotInstalledHint'),
|
|
627
|
+
),
|
|
628
|
+
),
|
|
629
|
+
h(
|
|
630
|
+
'span',
|
|
631
|
+
{
|
|
632
|
+
className: `adk-badge ${status.acpPlugin?.installed ? 'adk-badge-ok' : 'adk-badge-warn'}`,
|
|
633
|
+
},
|
|
634
|
+
status.acpPlugin?.installed
|
|
635
|
+
? t('statusReady')
|
|
636
|
+
: t('statusNotInstalled'),
|
|
637
|
+
),
|
|
638
|
+
),
|
|
639
|
+
// Row 2: Model & provider
|
|
640
|
+
h(
|
|
641
|
+
'div',
|
|
642
|
+
{ className: 'adk-row' },
|
|
643
|
+
h(
|
|
644
|
+
'div',
|
|
645
|
+
{ className: 'adk-row-main' },
|
|
646
|
+
h('span', { className: 'adk-row-label' }, t('itemModels')),
|
|
647
|
+
h(
|
|
648
|
+
'span',
|
|
649
|
+
{ className: 'adk-row-detail' },
|
|
650
|
+
`${t('modelAcpLabel')} ${acpModelText || t('modelNone')}`,
|
|
651
|
+
),
|
|
652
|
+
sourceModelText
|
|
653
|
+
? h(
|
|
654
|
+
'span',
|
|
655
|
+
{ className: 'adk-row-detail' },
|
|
656
|
+
`${t('modelSourceLabel')} ${sourceModelText}`,
|
|
657
|
+
)
|
|
658
|
+
: null,
|
|
659
|
+
status.models?.acpNeedsProviderPin
|
|
660
|
+
? h(
|
|
661
|
+
'span',
|
|
662
|
+
{
|
|
663
|
+
className: 'adk-row-detail',
|
|
664
|
+
style: { color: '#d97706' },
|
|
665
|
+
},
|
|
666
|
+
t('modelPinWarning'),
|
|
667
|
+
)
|
|
668
|
+
: null,
|
|
669
|
+
),
|
|
670
|
+
h(
|
|
671
|
+
'span',
|
|
672
|
+
{
|
|
673
|
+
className: `adk-badge ${status.models?.acpNeedsProviderPin ? 'adk-badge-warn' : 'adk-badge-ok'}`,
|
|
674
|
+
},
|
|
675
|
+
status.models?.acpNeedsProviderPin
|
|
676
|
+
? t('statusNeedsFix')
|
|
677
|
+
: t('statusReady'),
|
|
678
|
+
),
|
|
679
|
+
),
|
|
680
|
+
// Row 3: custom_agents.json
|
|
681
|
+
h(
|
|
682
|
+
'div',
|
|
683
|
+
{ className: 'adk-row' },
|
|
684
|
+
h(
|
|
685
|
+
'div',
|
|
686
|
+
{ className: 'adk-row-main' },
|
|
687
|
+
h(
|
|
688
|
+
'span',
|
|
689
|
+
{ className: 'adk-row-label' },
|
|
690
|
+
t('itemCustomAgents'),
|
|
691
|
+
),
|
|
692
|
+
h(
|
|
693
|
+
'span',
|
|
694
|
+
{ className: 'adk-row-detail' },
|
|
695
|
+
status.customAgent?.configured
|
|
696
|
+
? `${status.customAgent.entry.command} ${(status.customAgent.entry.args || []).join(' ')}`
|
|
697
|
+
: status.dshCommand || t('dshNotFound'),
|
|
698
|
+
),
|
|
699
|
+
),
|
|
700
|
+
h(
|
|
701
|
+
'span',
|
|
702
|
+
{
|
|
703
|
+
className: `adk-badge ${status.customAgent?.configured ? 'adk-badge-ok' : 'adk-badge-warn'}`,
|
|
704
|
+
},
|
|
705
|
+
status.customAgent?.configured
|
|
706
|
+
? t('statusReady')
|
|
707
|
+
: t('statusMissing'),
|
|
708
|
+
),
|
|
709
|
+
),
|
|
710
|
+
// Row 4: agentdeckd daemon & autostart
|
|
711
|
+
h(
|
|
712
|
+
'div',
|
|
713
|
+
{ className: 'adk-row' },
|
|
714
|
+
h(
|
|
715
|
+
'div',
|
|
716
|
+
{ className: 'adk-row-main' },
|
|
717
|
+
h('span', { className: 'adk-row-label' }, t('itemDaemon')),
|
|
718
|
+
h(
|
|
719
|
+
'span',
|
|
720
|
+
{ className: 'adk-row-detail' },
|
|
721
|
+
status.daemon?.running
|
|
722
|
+
? `${status.daemon.binaryPath || 'agentdeckd'} (PID ${status.daemon.pid})`
|
|
723
|
+
: status.daemon?.installed
|
|
724
|
+
? t('daemonStoppedHint')
|
|
725
|
+
: t('daemonNotInstalledHint'),
|
|
726
|
+
),
|
|
727
|
+
),
|
|
728
|
+
h(
|
|
729
|
+
'span',
|
|
730
|
+
{
|
|
731
|
+
className: `adk-badge ${status.daemon?.running ? 'adk-badge-ok' : status.daemon?.installed ? 'adk-badge-warn' : 'adk-badge-muted'}`,
|
|
732
|
+
},
|
|
733
|
+
status.daemon?.running
|
|
734
|
+
? t('daemonRunning')
|
|
735
|
+
: status.daemon?.installed
|
|
736
|
+
? t('statusStopped')
|
|
737
|
+
: t('statusNotInstalled'),
|
|
738
|
+
),
|
|
739
|
+
),
|
|
740
|
+
),
|
|
741
|
+
|
|
742
|
+
sourceModelText
|
|
743
|
+
? h(
|
|
744
|
+
'label',
|
|
745
|
+
{ className: 'adk-checkbox-row' },
|
|
746
|
+
h('input', {
|
|
747
|
+
type: 'checkbox',
|
|
748
|
+
checked: syncModels,
|
|
749
|
+
disabled: anyBusy,
|
|
750
|
+
onChange: (e) => setSyncModels(e.target.checked),
|
|
751
|
+
}),
|
|
752
|
+
h(
|
|
753
|
+
'span',
|
|
754
|
+
null,
|
|
755
|
+
`${t('syncModelsToggle')} (${sourceModelText})`,
|
|
756
|
+
),
|
|
757
|
+
)
|
|
758
|
+
: null,
|
|
759
|
+
|
|
760
|
+
h(
|
|
761
|
+
'div',
|
|
762
|
+
{ className: 'adk-actions' },
|
|
763
|
+
h(
|
|
764
|
+
'button',
|
|
765
|
+
{
|
|
766
|
+
type: 'button',
|
|
767
|
+
className: 'adk-btn adk-btn-primary',
|
|
768
|
+
disabled: anyBusy || !status.dshCommand,
|
|
769
|
+
onClick: onSetup,
|
|
770
|
+
},
|
|
771
|
+
busy
|
|
772
|
+
? t('btnSettingUp')
|
|
773
|
+
: status.ready
|
|
774
|
+
? t('btnResync')
|
|
775
|
+
: t('btnSetup'),
|
|
776
|
+
),
|
|
777
|
+
h(
|
|
778
|
+
'button',
|
|
779
|
+
{
|
|
780
|
+
type: 'button',
|
|
781
|
+
className: 'adk-btn adk-btn-secondary',
|
|
782
|
+
disabled: anyBusy || loading,
|
|
783
|
+
onClick: loadStatus,
|
|
784
|
+
},
|
|
785
|
+
t('btnRefresh'),
|
|
786
|
+
),
|
|
787
|
+
),
|
|
788
|
+
|
|
789
|
+
setupFeedback
|
|
790
|
+
? h(
|
|
791
|
+
'div',
|
|
792
|
+
{ className: 'adk-banner adk-banner-ok' },
|
|
793
|
+
h('div', null, t('setupSuccess')),
|
|
794
|
+
setupFeedback.steps?.length
|
|
795
|
+
? h(
|
|
796
|
+
'ul',
|
|
797
|
+
{ className: 'adk-steps' },
|
|
798
|
+
...setupFeedback.steps.map((step) =>
|
|
799
|
+
h(
|
|
800
|
+
'li',
|
|
801
|
+
{ key: step.id },
|
|
802
|
+
`${step.id}: ${stepStatusLabel(step.status)}${step.detail ? ` (${step.detail})` : ''}`,
|
|
803
|
+
),
|
|
804
|
+
),
|
|
805
|
+
)
|
|
806
|
+
: null,
|
|
807
|
+
)
|
|
808
|
+
: null,
|
|
809
|
+
),
|
|
810
|
+
|
|
811
|
+
// Card 2: Pairing QR & daemon controls
|
|
812
|
+
h(
|
|
813
|
+
'section',
|
|
814
|
+
{ className: 'adk-card' },
|
|
815
|
+
h(
|
|
816
|
+
'div',
|
|
817
|
+
{ className: 'adk-card-head' },
|
|
818
|
+
h('h3', { className: 'adk-card-title' }, t('pairTitle')),
|
|
819
|
+
h(
|
|
820
|
+
'span',
|
|
821
|
+
{
|
|
822
|
+
className: `adk-badge ${status.daemon?.running ? 'adk-badge-ok' : status.daemon?.installed ? 'adk-badge-warn' : 'adk-badge-muted'}`,
|
|
823
|
+
},
|
|
824
|
+
status.daemon?.running
|
|
825
|
+
? `${t('daemonRunning')} (PID ${status.daemon.pid})`
|
|
826
|
+
: status.daemon?.installed
|
|
827
|
+
? t('daemonStopped')
|
|
828
|
+
: t('daemonMissing'),
|
|
829
|
+
),
|
|
830
|
+
),
|
|
831
|
+
|
|
832
|
+
qrDataUrl
|
|
833
|
+
? h(
|
|
834
|
+
'div',
|
|
835
|
+
{ className: 'adk-qr-layout' },
|
|
836
|
+
h(
|
|
837
|
+
'div',
|
|
838
|
+
{ className: 'adk-qr-frame' },
|
|
839
|
+
h('img', {
|
|
840
|
+
src: qrDataUrl,
|
|
841
|
+
alt: 'AgentDeck pairing QR code',
|
|
842
|
+
}),
|
|
843
|
+
),
|
|
844
|
+
h(
|
|
845
|
+
'div',
|
|
846
|
+
{ className: 'adk-qr-info' },
|
|
847
|
+
h('p', { className: 'adk-card-desc' }, t('qrHint')),
|
|
848
|
+
h(
|
|
849
|
+
'div',
|
|
850
|
+
{ className: 'adk-meta-line' },
|
|
851
|
+
`${t('pairingIdLabel')}: `,
|
|
852
|
+
h('code', null, status.daemon.maskedPairingId),
|
|
853
|
+
),
|
|
854
|
+
status.daemon.hasCustomRelay
|
|
855
|
+
? h(
|
|
856
|
+
'div',
|
|
857
|
+
{ className: 'adk-meta-line' },
|
|
858
|
+
`${t('customRelayLabel')}: `,
|
|
859
|
+
h('code', null, status.daemon.relayUrl),
|
|
860
|
+
)
|
|
861
|
+
: null,
|
|
862
|
+
!status.daemon.running
|
|
863
|
+
? h(
|
|
864
|
+
'p',
|
|
865
|
+
{ className: 'adk-card-desc' },
|
|
866
|
+
t('daemonStartHint'),
|
|
867
|
+
)
|
|
868
|
+
: null,
|
|
869
|
+
h(
|
|
870
|
+
'div',
|
|
871
|
+
{ className: 'adk-actions' },
|
|
872
|
+
!status.daemon.running
|
|
873
|
+
? h(
|
|
874
|
+
'button',
|
|
875
|
+
{
|
|
876
|
+
type: 'button',
|
|
877
|
+
className: 'adk-btn adk-btn-primary adk-btn-sm',
|
|
878
|
+
disabled: anyBusy,
|
|
879
|
+
onClick: () => onDaemonAction('start'),
|
|
880
|
+
},
|
|
881
|
+
daemonBusy
|
|
882
|
+
? t('btnWorking')
|
|
883
|
+
: t('btnDaemonStart'),
|
|
884
|
+
)
|
|
885
|
+
: status.daemon.binaryPath
|
|
886
|
+
? h(
|
|
887
|
+
React.Fragment,
|
|
888
|
+
null,
|
|
889
|
+
h(
|
|
890
|
+
'button',
|
|
891
|
+
{
|
|
892
|
+
type: 'button',
|
|
893
|
+
className:
|
|
894
|
+
'adk-btn adk-btn-secondary adk-btn-sm',
|
|
895
|
+
disabled: anyBusy,
|
|
896
|
+
onClick: () => onDaemonAction('restart'),
|
|
897
|
+
},
|
|
898
|
+
daemonBusy
|
|
899
|
+
? t('btnWorking')
|
|
900
|
+
: t('btnDaemonRestart'),
|
|
901
|
+
),
|
|
902
|
+
h(
|
|
903
|
+
'button',
|
|
904
|
+
{
|
|
905
|
+
type: 'button',
|
|
906
|
+
className:
|
|
907
|
+
'adk-btn adk-btn-secondary adk-btn-sm',
|
|
908
|
+
disabled: anyBusy,
|
|
909
|
+
onClick: () => onDaemonAction('stop'),
|
|
910
|
+
},
|
|
911
|
+
t('btnDaemonStop'),
|
|
912
|
+
),
|
|
913
|
+
)
|
|
914
|
+
: null,
|
|
915
|
+
),
|
|
916
|
+
),
|
|
917
|
+
)
|
|
918
|
+
: h('p', { className: 'adk-card-desc' }, t('daemonAutoHint')),
|
|
919
|
+
|
|
920
|
+
h(
|
|
921
|
+
'div',
|
|
922
|
+
{ className: 'adk-links' },
|
|
923
|
+
h(
|
|
924
|
+
'span',
|
|
925
|
+
{ className: 'adk-links-label' },
|
|
926
|
+
t('downloadTitle'),
|
|
927
|
+
),
|
|
928
|
+
h(
|
|
929
|
+
'a',
|
|
930
|
+
{
|
|
931
|
+
className: 'adk-link',
|
|
932
|
+
href: STORE_LINKS.appStore,
|
|
933
|
+
target: '_blank',
|
|
934
|
+
rel: 'noopener noreferrer',
|
|
935
|
+
},
|
|
936
|
+
t('linkAppStore'),
|
|
937
|
+
),
|
|
938
|
+
h(
|
|
939
|
+
'a',
|
|
940
|
+
{
|
|
941
|
+
className: 'adk-link',
|
|
942
|
+
href: STORE_LINKS.googlePlay,
|
|
943
|
+
target: '_blank',
|
|
944
|
+
rel: 'noopener noreferrer',
|
|
945
|
+
},
|
|
946
|
+
t('linkGooglePlay'),
|
|
947
|
+
),
|
|
948
|
+
h(
|
|
949
|
+
'a',
|
|
950
|
+
{
|
|
951
|
+
className: 'adk-link',
|
|
952
|
+
href: STORE_LINKS.apk,
|
|
953
|
+
target: '_blank',
|
|
954
|
+
rel: 'noopener noreferrer',
|
|
955
|
+
},
|
|
956
|
+
t('linkApk'),
|
|
957
|
+
),
|
|
958
|
+
h(
|
|
959
|
+
'a',
|
|
960
|
+
{
|
|
961
|
+
className: 'adk-link',
|
|
962
|
+
href: isZh ? STORE_LINKS.websiteZh : STORE_LINKS.websiteEn,
|
|
963
|
+
target: '_blank',
|
|
964
|
+
rel: 'noopener noreferrer',
|
|
965
|
+
},
|
|
966
|
+
t('linkWebsite'),
|
|
967
|
+
),
|
|
968
|
+
),
|
|
969
|
+
),
|
|
970
|
+
)
|
|
971
|
+
: null,
|
|
972
|
+
);
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
function apply(ctx) {
|
|
976
|
+
injectStyles();
|
|
977
|
+
const t = ctx.locale.bind(NS);
|
|
978
|
+
ctx.effect(
|
|
979
|
+
() => ctx.locale.register(NS, DICTIONARIES),
|
|
980
|
+
'agentdeck: dictionaries',
|
|
981
|
+
);
|
|
982
|
+
ctx.effect(
|
|
983
|
+
() =>
|
|
984
|
+
ctx.slots.inject('settings.section.icon', () =>
|
|
985
|
+
ctx.slots.register(
|
|
986
|
+
{
|
|
987
|
+
name: 'settings.section.icon',
|
|
988
|
+
id: 'agentdeck',
|
|
989
|
+
locale: NS,
|
|
990
|
+
},
|
|
991
|
+
PhoneIcon,
|
|
992
|
+
),
|
|
993
|
+
),
|
|
994
|
+
'agentdeck: settings section icon',
|
|
995
|
+
);
|
|
996
|
+
ctx.effect(
|
|
997
|
+
() =>
|
|
998
|
+
ctx.slots.inject('settings.section', () =>
|
|
999
|
+
ctx.slots.register(
|
|
1000
|
+
{
|
|
1001
|
+
name: 'settings.section',
|
|
1002
|
+
id: 'agentdeck',
|
|
1003
|
+
order: 65,
|
|
1004
|
+
label: () => t('nav'),
|
|
1005
|
+
locale: NS,
|
|
1006
|
+
},
|
|
1007
|
+
AgentDeckSettingsSection,
|
|
1008
|
+
),
|
|
1009
|
+
),
|
|
1010
|
+
'agentdeck: settings section',
|
|
1011
|
+
);
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
exports.name = 'agentdeck-settings';
|
|
1015
|
+
exports.inject = ['slots', 'locale'];
|
|
1016
|
+
exports.apply = apply;
|
|
1017
|
+
return module.exports;
|
|
1018
|
+
},
|
|
1019
|
+
});
|