agentworkshop 0.17.4 → 0.17.5

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.
@@ -0,0 +1,629 @@
1
+ <!doctype html>
2
+ <html lang="zh-CN" data-phase="prepare" data-leaving="false">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="Content-Security-Policy" content="default-src 'none'; style-src 'unsafe-inline'; script-src 'unsafe-inline'; img-src data:; connect-src 'none'; font-src 'none'">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+ <title>AgentWorkShop · 初始化</title>
8
+ <style>
9
+ :root {
10
+ --bg: #070c14;
11
+ --top: #0a1322;
12
+ --line: #1d2a3d;
13
+ --line-strong: #2c405b;
14
+ --ink: #e9eff8;
15
+ --soft: #b6c3d5;
16
+ --faint: #93a3b8;
17
+ --dim: #6f8199;
18
+ --mint: #3fe4ab;
19
+ --mint-deep: #2fd79e;
20
+ --cyan: #2bb9e8;
21
+ --danger: #ff8b8b;
22
+ --panel: #0a1220;
23
+ }
24
+
25
+ * { box-sizing: border-box; }
26
+
27
+ [hidden] { display: none !important; }
28
+
29
+ html,
30
+ body {
31
+ height: 100%;
32
+ margin: 0;
33
+ overflow: hidden;
34
+ background: var(--bg);
35
+ }
36
+
37
+ body {
38
+ color: var(--ink);
39
+ font-family: 'Geist', 'Segoe UI Variable Text', 'Segoe UI', 'Microsoft YaHei UI', 'Noto Sans SC', system-ui, sans-serif;
40
+ -webkit-user-select: none;
41
+ user-select: none;
42
+ }
43
+
44
+ .frame {
45
+ position: relative;
46
+ display: flex;
47
+ flex-direction: column;
48
+ height: 100%;
49
+ padding: 0 26px 42px;
50
+ background:
51
+ radial-gradient(520px 260px at 14% -12%, rgb(63 228 171 / 12%), transparent 68%),
52
+ radial-gradient(420px 300px at 108% 112%, rgb(43 185 232 / 7%), transparent 72%),
53
+ linear-gradient(180deg, var(--top), var(--bg) 46%);
54
+ transition: opacity 260ms ease, transform 260ms ease;
55
+ }
56
+
57
+ /* Honest instrument texture: a faint dot grid, not a decorative gradient wash. */
58
+ .frame::before {
59
+ position: absolute;
60
+ inset: 0;
61
+ z-index: 0;
62
+ content: '';
63
+ background-image: radial-gradient(rgb(233 239 248 / 5%) 1px, transparent 1px);
64
+ background-size: 18px 18px;
65
+ mask-image: linear-gradient(180deg, rgb(0 0 0 / 55%), transparent 72%);
66
+ pointer-events: none;
67
+ }
68
+
69
+ /* Signal rule: mint segment first, then hairline, matching the title rail. */
70
+ .frame::after {
71
+ position: absolute;
72
+ top: 0;
73
+ right: 0;
74
+ left: 0;
75
+ z-index: 2;
76
+ height: 1px;
77
+ content: '';
78
+ background: linear-gradient(90deg, var(--mint) 0 64px, var(--line) 64px, var(--line) 100%);
79
+ }
80
+
81
+ html[data-leaving='true'] .frame {
82
+ opacity: 0;
83
+ transform: scale(.992);
84
+ }
85
+
86
+ .head {
87
+ position: relative;
88
+ z-index: 1;
89
+ display: flex;
90
+ flex: none;
91
+ align-items: center;
92
+ gap: 10px;
93
+ height: 56px;
94
+ -webkit-app-region: drag;
95
+ app-region: drag;
96
+ }
97
+
98
+ .mark {
99
+ flex: none;
100
+ width: 30px;
101
+ height: 30px;
102
+ filter: drop-shadow(0 1px 2px rgb(0 0 0 / 30%));
103
+ }
104
+
105
+ .wordmark {
106
+ font-size: 13px;
107
+ line-height: 1;
108
+ letter-spacing: .015em;
109
+ white-space: nowrap;
110
+ }
111
+
112
+ .wordmark .agent {
113
+ font-weight: 500;
114
+ color: var(--soft);
115
+ }
116
+
117
+ .wordmark .shop {
118
+ font-weight: 650;
119
+ color: var(--ink);
120
+ }
121
+
122
+ .drag {
123
+ flex: 1 1 auto;
124
+ align-self: stretch;
125
+ }
126
+
127
+ .version {
128
+ flex: none;
129
+ padding: 3px 8px;
130
+ font-size: 9.5px;
131
+ font-weight: 600;
132
+ color: var(--dim);
133
+ letter-spacing: .09em;
134
+ background: rgb(13 21 33 / 80%);
135
+ border: 1px solid var(--line);
136
+ border-radius: 999px;
137
+ }
138
+
139
+ .stage {
140
+ position: relative;
141
+ z-index: 1;
142
+ flex: none;
143
+ padding-top: 4px;
144
+ }
145
+
146
+ .eyebrow {
147
+ display: inline-flex;
148
+ align-items: center;
149
+ gap: 7px;
150
+ margin: 0 0 10px;
151
+ font-size: 10.5px;
152
+ font-weight: 600;
153
+ color: var(--mint);
154
+ letter-spacing: .16em;
155
+ text-transform: uppercase;
156
+ }
157
+
158
+ .pulse {
159
+ width: 6px;
160
+ height: 6px;
161
+ background: var(--mint);
162
+ border-radius: 50%;
163
+ box-shadow: 0 0 0 4px rgb(63 228 171 / 12%);
164
+ animation: pulse 1.7s ease-in-out infinite;
165
+ }
166
+
167
+ h1 {
168
+ margin: 0;
169
+ font-size: 26px;
170
+ font-weight: 650;
171
+ line-height: 1.15;
172
+ color: var(--ink);
173
+ letter-spacing: -.015em;
174
+ text-wrap: pretty;
175
+ }
176
+
177
+ .detail {
178
+ min-height: 20px;
179
+ margin: 8px 0 0;
180
+ font-size: 13px;
181
+ line-height: 1.5;
182
+ color: var(--faint);
183
+ text-wrap: pretty;
184
+ }
185
+
186
+ .meter {
187
+ position: relative;
188
+ height: 6px;
189
+ margin-top: 20px;
190
+ overflow: hidden;
191
+ background: #111c2c;
192
+ border: 1px solid #182538;
193
+ border-radius: 999px;
194
+ }
195
+
196
+ .meter-fill {
197
+ display: block;
198
+ width: 10%;
199
+ height: 100%;
200
+ background: linear-gradient(90deg, var(--mint-deep), #63ebbc 58%, #7ce0ff);
201
+ border-radius: 999px;
202
+ transition: width 420ms cubic-bezier(.22, .7, .18, 1);
203
+ }
204
+
205
+ .meter-scan {
206
+ position: absolute;
207
+ top: 0;
208
+ bottom: 0;
209
+ width: 34%;
210
+ background: linear-gradient(90deg, transparent, rgb(255 255 255 / 18%), transparent);
211
+ opacity: .45;
212
+ animation: scan 2.4s linear infinite;
213
+ }
214
+
215
+ .steps {
216
+ display: grid;
217
+ grid-template-columns: repeat(4, 1fr);
218
+ margin: 18px 0 0;
219
+ padding: 0;
220
+ list-style: none;
221
+ }
222
+
223
+ .steps li {
224
+ position: relative;
225
+ display: flex;
226
+ flex-direction: column;
227
+ gap: 7px;
228
+ font-size: 11px;
229
+ color: var(--dim);
230
+ letter-spacing: .02em;
231
+ }
232
+
233
+ .steps li::before {
234
+ position: absolute;
235
+ top: 4px;
236
+ right: 0;
237
+ left: 14px;
238
+ height: 1px;
239
+ content: '';
240
+ background: var(--line);
241
+ }
242
+
243
+ .steps li:last-child::before { display: none; }
244
+
245
+ .tick {
246
+ position: relative;
247
+ z-index: 1;
248
+ width: 9px;
249
+ height: 9px;
250
+ background: var(--bg);
251
+ border: 1px solid var(--line-strong);
252
+ border-radius: 50%;
253
+ transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
254
+ }
255
+
256
+ .steps li.done .tick {
257
+ background: var(--mint);
258
+ border-color: var(--mint);
259
+ box-shadow: 0 0 0 3px rgb(63 228 171 / 10%);
260
+ }
261
+
262
+ .steps li.active .tick {
263
+ background: #0d1b22;
264
+ border-color: var(--mint);
265
+ box-shadow: 0 0 0 3px rgb(63 228 171 / 14%);
266
+ }
267
+
268
+ .steps li.active .tick::after {
269
+ position: absolute;
270
+ inset: 2px;
271
+ content: '';
272
+ background: var(--mint);
273
+ border-radius: 50%;
274
+ animation: pulse 1.4s ease-in-out infinite;
275
+ }
276
+
277
+ .steps li.done { color: var(--soft); }
278
+
279
+ .steps li.active {
280
+ font-weight: 600;
281
+ color: var(--ink);
282
+ }
283
+
284
+ .trace {
285
+ position: relative;
286
+ z-index: 1;
287
+ display: flex;
288
+ flex: 1 1 auto;
289
+ flex-direction: column;
290
+ min-height: 0;
291
+ margin-top: 18px;
292
+ padding: 10px 12px;
293
+ background: rgb(6 12 20 / 66%);
294
+ border: 1px solid #152133;
295
+ border-radius: 10px;
296
+ }
297
+
298
+ .trace-head {
299
+ display: flex;
300
+ justify-content: space-between;
301
+ font-size: 9.5px;
302
+ color: var(--dim);
303
+ letter-spacing: .14em;
304
+ text-transform: uppercase;
305
+ }
306
+
307
+ .lines {
308
+ margin-top: 7px;
309
+ overflow: hidden;
310
+ font: 10.5px/1.55 ui-monospace, 'Cascadia Mono', 'Consolas', monospace;
311
+ }
312
+
313
+ .line {
314
+ display: flex;
315
+ gap: 8px;
316
+ overflow: hidden;
317
+ color: #7d8fa8;
318
+ white-space: nowrap;
319
+ }
320
+
321
+ .line .at {
322
+ flex: none;
323
+ color: #4f627a;
324
+ }
325
+
326
+ .line:last-child { color: var(--soft); }
327
+
328
+ .foot {
329
+ position: absolute;
330
+ right: 0;
331
+ bottom: 0;
332
+ left: 0;
333
+ display: flex;
334
+ align-items: center;
335
+ gap: 8px;
336
+ height: 40px;
337
+ padding: 0 26px;
338
+ font-size: 10.5px;
339
+ color: var(--faint);
340
+ background: rgb(7 12 20 / 64%);
341
+ border-top: 1px solid #132033;
342
+ }
343
+
344
+ .foot-dot {
345
+ width: 5px;
346
+ height: 5px;
347
+ background: var(--mint);
348
+ border-radius: 50%;
349
+ animation: pulse 1.7s ease-in-out infinite;
350
+ }
351
+
352
+ .foot-path {
353
+ margin-left: auto;
354
+ color: var(--dim);
355
+ letter-spacing: .05em;
356
+ }
357
+
358
+ .failure {
359
+ position: absolute;
360
+ inset: 56px 26px 42px;
361
+ z-index: 3;
362
+ display: flex;
363
+ flex-direction: column;
364
+ justify-content: center;
365
+ padding: 26px 30px;
366
+ background: rgb(7 12 20 / 94%);
367
+ border: 1px solid #3a2230;
368
+ border-radius: 14px;
369
+ backdrop-filter: blur(8px);
370
+ }
371
+
372
+ .failure-title {
373
+ margin: 0;
374
+ font-size: 20px;
375
+ font-weight: 650;
376
+ color: var(--danger);
377
+ letter-spacing: -.01em;
378
+ }
379
+
380
+ .failure-text {
381
+ max-height: 88px;
382
+ margin: 10px 0 0;
383
+ overflow: auto;
384
+ font-size: 12px;
385
+ line-height: 1.6;
386
+ color: #cbd5e1;
387
+ white-space: pre-wrap;
388
+ word-break: break-word;
389
+ -webkit-user-select: text;
390
+ user-select: text;
391
+ }
392
+
393
+ .actions {
394
+ display: flex;
395
+ flex-wrap: wrap;
396
+ gap: 8px;
397
+ margin-top: 18px;
398
+ }
399
+
400
+ .btn {
401
+ height: 30px;
402
+ padding: 0 14px;
403
+ font: inherit;
404
+ font-size: 11.5px;
405
+ font-weight: 600;
406
+ color: var(--soft);
407
+ cursor: pointer;
408
+ background: #101a28;
409
+ border: 1px solid var(--line-strong);
410
+ border-radius: 999px;
411
+ transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
412
+ }
413
+
414
+ .btn:hover {
415
+ color: var(--ink);
416
+ border-color: var(--mint);
417
+ }
418
+
419
+ .btn.primary {
420
+ color: #08130d;
421
+ background: var(--mint);
422
+ border-color: transparent;
423
+ }
424
+
425
+ .btn.ghost {
426
+ color: var(--faint);
427
+ background: transparent;
428
+ border-color: var(--line);
429
+ }
430
+
431
+ .btn:focus-visible {
432
+ outline: 2px solid #6fb3ff;
433
+ outline-offset: 2px;
434
+ }
435
+
436
+ html[data-phase='error'] .eyebrow { color: var(--danger); }
437
+ html[data-phase='error'] .pulse,
438
+ html[data-phase='error'] .foot-dot { background: var(--danger); box-shadow: none; animation: none; }
439
+ html[data-phase='ready'] .meter-scan,
440
+ html[data-phase='ready'] .pulse,
441
+ html[data-phase='ready'] .foot-dot { animation: none; }
442
+ html[data-phase='ready'] .tick { border-color: var(--mint); }
443
+
444
+ @keyframes pulse {
445
+ 0%, 100% { opacity: 1; }
446
+ 50% { opacity: .38; }
447
+ }
448
+
449
+ @keyframes scan {
450
+ from { left: -34%; }
451
+ to { left: 100%; }
452
+ }
453
+
454
+ @media (prefers-reduced-motion: reduce) {
455
+ .frame,
456
+ .meter-fill,
457
+ .tick,
458
+ .btn { transition: none; }
459
+
460
+ .pulse,
461
+ .meter-scan,
462
+ .foot-dot,
463
+ .steps li.active .tick::after { animation: none; }
464
+ }
465
+ </style>
466
+ </head>
467
+ <body>
468
+ <main class="frame" id="frame">
469
+ <header class="head">
470
+ <svg class="mark" viewBox="0 0 512 512" aria-hidden="true">
471
+ <defs>
472
+ <linearGradient id="badge" x1="0" y1="0" x2="0" y2="1">
473
+ <stop offset="0" stop-color="#142339" />
474
+ <stop offset=".58" stop-color="#0b1422" />
475
+ <stop offset="1" stop-color="#070c14" />
476
+ </linearGradient>
477
+ <linearGradient id="mint" x1="15" y1="51" x2="49" y2="11" gradientUnits="userSpaceOnUse">
478
+ <stop offset="0" stop-color="#2fd79e" />
479
+ <stop offset="1" stop-color="#63ebbc" />
480
+ </linearGradient>
481
+ <linearGradient id="cyan" x1="23" y1="37" x2="41" y2="37" gradientUnits="userSpaceOnUse">
482
+ <stop offset="0" stop-color="#2bb9e8" />
483
+ <stop offset="1" stop-color="#7ce0ff" />
484
+ </linearGradient>
485
+ </defs>
486
+ <rect width="512" height="512" rx="120" fill="url(#badge)" />
487
+ <rect x="2.5" y="2.5" width="507" height="507" rx="118" fill="none" stroke="#3fe4ab" stroke-opacity=".2" stroke-width="3" />
488
+ <g transform="translate(256 256) scale(8.2) translate(-32 -31.5)" fill="none" stroke-linecap="round">
489
+ <path d="M32 12 15.5 51" stroke="url(#mint)" stroke-width="6.4" />
490
+ <path d="M32 12 48.5 51" stroke="url(#mint)" stroke-width="6.4" />
491
+ <path d="M23.4 37h17.2" stroke="url(#cyan)" stroke-width="5.2" />
492
+ </g>
493
+ </svg>
494
+ <div class="wordmark"><span class="agent">Agent</span><span class="shop">WorkShop</span></div>
495
+ <span class="drag" aria-hidden="true"></span>
496
+ <span class="version" id="version"></span>
497
+ </header>
498
+
499
+ <section class="stage">
500
+ <p class="eyebrow"><span class="pulse" aria-hidden="true"></span><span id="phase-label">正在初始化</span></p>
501
+ <h1 id="title" role="status" aria-live="polite">准备运行环境</h1>
502
+ <p class="detail" id="detail" aria-live="polite">校验安装载荷与用户数据目录</p>
503
+ <div class="meter" id="meter" role="progressbar" aria-label="初始化进度" aria-valuemin="0" aria-valuemax="100" aria-valuenow="10">
504
+ <span class="meter-fill" id="fill"></span>
505
+ <span class="meter-scan" aria-hidden="true"></span>
506
+ </div>
507
+ <ol class="steps" id="steps">
508
+ <li data-step="prepare"><span class="tick" aria-hidden="true"></span><span>环境</span></li>
509
+ <li data-step="data"><span class="tick" aria-hidden="true"></span><span>数据</span></li>
510
+ <li data-step="service"><span class="tick" aria-hidden="true"></span><span>服务</span></li>
511
+ <li data-step="workshop"><span class="tick" aria-hidden="true"></span><span>工作台</span></li>
512
+ </ol>
513
+ </section>
514
+
515
+ <section class="trace" aria-label="启动记录">
516
+ <div class="trace-head"><span>启动记录</span><span id="elapsed">0.0s</span></div>
517
+ <div class="lines" id="lines"></div>
518
+ </section>
519
+
520
+ <footer class="foot">
521
+ <span class="foot-dot" aria-hidden="true"></span>
522
+ <span id="foot-text">服务就绪后自动进入工作台</span>
523
+ <span class="foot-path">本机服务 · 127.0.0.1</span>
524
+ </footer>
525
+
526
+ <section class="failure" id="failure" role="alert" hidden>
527
+ <p class="failure-title">启动失败</p>
528
+ <p class="failure-text" id="failure-text"></p>
529
+ <div class="actions">
530
+ <button type="button" class="btn primary" data-action="retry">重试</button>
531
+ <button type="button" class="btn" data-action="open-logs">打开日志</button>
532
+ <button type="button" class="btn ghost" data-action="quit">退出</button>
533
+ </div>
534
+ </section>
535
+ </main>
536
+
537
+ <script>
538
+ (() => {
539
+ const api = window.awSplash
540
+ const root = document.documentElement
541
+ const byId = id => document.getElementById(id)
542
+ const elements = {
543
+ title: byId('title'),
544
+ detail: byId('detail'),
545
+ phase: byId('phase-label'),
546
+ fill: byId('fill'),
547
+ meter: byId('meter'),
548
+ steps: byId('steps'),
549
+ lines: byId('lines'),
550
+ elapsed: byId('elapsed'),
551
+ version: byId('version'),
552
+ failure: byId('failure'),
553
+ failureText: byId('failure-text'),
554
+ foot: byId('foot-text'),
555
+ }
556
+ const phaseText = {
557
+ prepare: '正在初始化',
558
+ data: '正在初始化',
559
+ service: '正在启动服务',
560
+ workshop: '正在装配工作台',
561
+ ready: '已就绪',
562
+ error: '启动中断',
563
+ }
564
+ const order = ['prepare', 'data', 'service', 'workshop']
565
+ let startedAt = Date.now()
566
+
567
+ const elapsedText = (ms) => {
568
+ const seconds = Math.max(0, ms) / 1000
569
+ return seconds < 60 ? `${seconds.toFixed(1)}s` : `${Math.floor(seconds / 60)}m ${(seconds % 60).toFixed(0)}s`
570
+ }
571
+ const traceAt = (ms) => `+${(Math.max(0, ms) / 1000).toFixed(2).padStart(5, '0')}`
572
+
573
+ function render(state) {
574
+ if (!state) return
575
+ startedAt = Number(state.startedAt) || startedAt
576
+ root.dataset.phase = state.phase || 'prepare'
577
+ root.dataset.leaving = state.leaving ? 'true' : 'false'
578
+ elements.title.textContent = state.title || ''
579
+ elements.detail.textContent = state.detail || ''
580
+ elements.phase.textContent = phaseText[state.phase] || '正在初始化'
581
+ const progress = Math.max(0, Math.min(100, Number(state.progress) || 0))
582
+ elements.fill.style.width = `${progress}%`
583
+ elements.meter.setAttribute('aria-valuenow', String(Math.round(progress)))
584
+ elements.meter.setAttribute('aria-label', state.title || '初始化进度')
585
+ const index = order.indexOf(state.phase)
586
+ for (const item of elements.steps.querySelectorAll('[data-step]')) {
587
+ const at = order.indexOf(item.dataset.step)
588
+ item.classList.toggle('done', state.phase === 'ready' || (index >= 0 && at < index))
589
+ item.classList.toggle('active', at === index)
590
+ }
591
+ const trace = Array.isArray(state.trace) ? state.trace.slice(-4) : []
592
+ elements.lines.replaceChildren(...trace.map((entry) => {
593
+ const line = document.createElement('div')
594
+ line.className = 'line'
595
+ const at = document.createElement('span')
596
+ at.className = 'at'
597
+ at.textContent = traceAt(entry.at)
598
+ const text = document.createElement('span')
599
+ text.textContent = String(entry.text || '')
600
+ line.append(at, text)
601
+ return line
602
+ }))
603
+ elements.version.textContent = state.version ? `v${state.version}` : ''
604
+ const failed = state.phase === 'error'
605
+ elements.failure.hidden = !failed
606
+ if (failed) {
607
+ elements.failureText.textContent = `${state.error || '本机服务未能启动。'}\n日志:${state.logPath || ''}`
608
+ elements.phase.textContent = phaseText.error
609
+ }
610
+ elements.foot.textContent = failed
611
+ ? '可以重试,或打开日志查看原因'
612
+ : state.phase === 'ready' ? '工作台已就绪,正在进入' : '服务就绪后自动进入工作台'
613
+ }
614
+
615
+ setInterval(() => { elements.elapsed.textContent = elapsedText(Date.now() - startedAt) }, 100)
616
+ document.querySelectorAll('[data-action]').forEach((button) => {
617
+ button.addEventListener('click', () => api?.action(button.dataset.action))
618
+ })
619
+ if (api) {
620
+ api.onState(render)
621
+ api.hello()
622
+ }
623
+ else {
624
+ root.dataset.ready = 'missing'
625
+ }
626
+ })()
627
+ </script>
628
+ </body>
629
+ </html>
@@ -375,7 +375,7 @@
375
375
  <svg class="glyph-max" viewBox="0 0 10 10" aria-hidden="true"><rect x="1.1" y="1.1" width="7.8" height="7.8" rx="1.2" /></svg>
376
376
  <svg class="glyph-restore" viewBox="0 0 10 10" aria-hidden="true"><path d="M3.4 2.2h4.4a.9.9 0 0 1 .9.9v4.4" /><rect x="1.3" y="3.3" width="5.4" height="5.4" rx="1" /></svg>
377
377
  </button>
378
- <button class="ctl ctl-close" type="button" data-action="close" aria-label="关闭" title="关闭">
378
+ <button class="ctl ctl-close" type="button" data-action="close" aria-label="关闭到托盘" title="关闭到托盘">
379
379
  <svg viewBox="0 0 10 10" aria-hidden="true"><path d="M1.6 1.6l6.8 6.8M8.4 1.6l-6.8 6.8" /></svg>
380
380
  </button>
381
381
  </div>
@@ -390,6 +390,7 @@
390
390
  const updateLabel = document.getElementById('update-label')
391
391
  const status = document.getElementById('status')
392
392
  const statusText = document.getElementById('status-text')
393
+ const close = document.querySelector('[data-action="close"]')
393
394
  const labels = { online: '已连接', connecting: '连接中', offline: '已断开' }
394
395
  if (!api) {
395
396
  root.dataset.ready = 'missing'
@@ -439,6 +440,12 @@
439
440
  api.onTheme((value) => {
440
441
  root.dataset.theme = value === 'light' ? 'light' : 'dark'
441
442
  })
443
+ api.onPrefs((prefs) => {
444
+ const toTray = !prefs || prefs.closeToTray !== false
445
+ if (!close) return
446
+ close.title = toTray ? '关闭到托盘' : '关闭'
447
+ close.setAttribute('aria-label', close.title)
448
+ })
442
449
  api.onTitle((value) => {
443
450
  const text = typeof value === 'string' ? value.trim() : ''
444
451
  page.textContent = text