dsh-remote-plugin 0.9.0 → 0.9.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/apk/dsh-remote.apk +0 -0
- package/gateway.cjs +58 -8
- package/package.json +1 -1
- package/public/activity.js +45 -7
- package/public/admin.html +31 -31
- package/public/announcements.json +36 -0
- package/public/app.js +370 -62
- package/public/build.json +2 -2
- package/public/desktop/desktop.html +82 -80
- package/public/desktop/desktop.js +95 -6
- package/public/e2ee-config.js +5 -0
- package/public/e2ee-transport.js +23 -4
- package/public/history.js +114 -17
- package/public/index.html +88 -86
- package/public/plan-review.js +23 -2
- package/public/plugin.html +27 -27
- package/public/relay-autopair.js +5 -0
- package/public/relay-devices.js +7 -3
- package/public/relay-settings.js +32 -12
- package/public/session-cache.js +85 -0
- package/public/skins/blue-fish/preview.html +3 -3
- package/public/skins/bocchi/preview.html +5 -5
- package/public/skins/kita/preview.html +6 -6
- package/public/skins/miku/preview.html +5 -5
- package/public/skins/nijika/preview.html +6 -6
- package/public/skins/penguin/preview.html +3 -3
- package/public/skins/ryo/preview.html +6 -6
- package/public/update.json +8 -8
- package/public/version.json +1 -1
- package/public/workflow.css +3 -3
package/apk/dsh-remote.apk
CHANGED
|
Binary file
|
package/gateway.cjs
CHANGED
|
@@ -196,7 +196,7 @@ class Registry {
|
|
|
196
196
|
byDomain(domain) { return currentGrant(this.read().grants.find(g => g.domain === domain), this.now()) }
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
module.exports = { Registry, fault, hostname, publicKey, digest, live, isEarlyTest, signingText, issueInState, occupiedSlots, reserved, holdsSlot, renewalWindow, SPONSOR_ORDER_WINDOW, SPONSOR_PACK_BYTES, RENEW_WINDOW }
|
|
199
|
+
module.exports = { Registry, fault, hostname, publicKey, digest, live, currentGrant, isEarlyTest, signingText, issueInState, occupiedSlots, reserved, holdsSlot, renewalWindow, SPONSOR_ORDER_WINDOW, SPONSOR_PACK_BYTES, RENEW_WINDOW }
|
|
200
200
|
},
|
|
201
201
|
"./wire.cjs": function(require, module, exports) {
|
|
202
202
|
'use strict'
|
|
@@ -329,7 +329,7 @@ class RelayClient extends EventEmitter {
|
|
|
329
329
|
// waiting for a fresh host->relay handshake. DSH_REMOTE_RELAY_POOL overrides (1-6; the broker
|
|
330
330
|
// parks at most 8). Explicit poolSize from callers (and tests) still wins.
|
|
331
331
|
const configuredPool = Number.isInteger(poolSize) ? poolSize : Number(process.env.DSH_REMOTE_RELAY_POOL)
|
|
332
|
-
this.poolSize = Math.min(6, Math.max(1, Number.isInteger(configuredPool) ? configuredPool :
|
|
332
|
+
this.poolSize = Math.min(6, Math.max(1, Number.isInteger(configuredPool) ? configuredPool : 4)); this.reconnectMs = reconnectMs
|
|
333
333
|
this.context = null; this.running = false; this.timer = null; this.failures = 0; this.controlSocket = null; this.epoch = 0
|
|
334
334
|
}
|
|
335
335
|
async authenticate(role, session = '', context) {
|
|
@@ -344,7 +344,11 @@ class RelayClient extends EventEmitter {
|
|
|
344
344
|
const signature = crypto.sign(null, signingText(challenge.nonce, this.grantId, role, session, capability), this.privateKey).toString('base64url')
|
|
345
345
|
send(socket, { grantId: this.grantId, role, session, signature, ...(capability ? { e2ee: capability } : {}) })
|
|
346
346
|
const accepted = await line(socket)
|
|
347
|
-
if (accepted.type === 'rejected'
|
|
347
|
+
if (accepted.type === 'rejected') {
|
|
348
|
+
const error = fault(accepted.code || 'CONNECTION_NOT_ACCEPTED', accepted.code === 'AUTHORIZATION_INACTIVE' ? 403 : 409)
|
|
349
|
+
if (Number.isFinite(accepted.retryAfterMs)) error.retryAfterMs = Math.min(60000, Math.max(0, accepted.retryAfterMs))
|
|
350
|
+
throw error
|
|
351
|
+
}
|
|
348
352
|
if (!this.running || Date.now() >= this.expiresAt || accepted.type !== (role === 'control' ? 'accepted' : 'parked')) throw fault('CONNECTION_NOT_ACCEPTED')
|
|
349
353
|
return { socket, accepted }
|
|
350
354
|
} catch (error) { socket.destroy(); throw error }
|
|
@@ -354,6 +358,7 @@ class RelayClient extends EventEmitter {
|
|
|
354
358
|
if (!this.running) return
|
|
355
359
|
if (Date.now() >= this.expiresAt) { this.stop(); this.emit('status', 'expired'); return }
|
|
356
360
|
let context
|
|
361
|
+
let retryHint = 0
|
|
357
362
|
const epoch = this.epoch
|
|
358
363
|
try {
|
|
359
364
|
const { socket, accepted } = await this.authenticate('control')
|
|
@@ -377,7 +382,10 @@ class RelayClient extends EventEmitter {
|
|
|
377
382
|
}
|
|
378
383
|
} catch (error) {
|
|
379
384
|
if (error.code === 'AUTHORIZATION_INACTIVE') { this.stop(); this.emit('status', 'authorization-inactive') }
|
|
380
|
-
else if (this.running)
|
|
385
|
+
else if (this.running) {
|
|
386
|
+
this.emit('status', 'reconnecting')
|
|
387
|
+
retryHint = error.retryAfterMs || 0
|
|
388
|
+
}
|
|
381
389
|
}
|
|
382
390
|
finally {
|
|
383
391
|
if (context) this.dispose(context)
|
|
@@ -387,7 +395,8 @@ class RelayClient extends EventEmitter {
|
|
|
387
395
|
// socket. Retry quickly for the first minute so recovery does not inherit the
|
|
388
396
|
// exponential backoff of a stale registration.
|
|
389
397
|
const failures = this.failures++
|
|
390
|
-
const
|
|
398
|
+
const fast = retryHint > 0 && failures < 24 ? retryHint : 0
|
|
399
|
+
const wait = fast || Math.min(failures < 12 ? 5000 : 60000, this.reconnectMs * 2 ** Math.min(failures, 6))
|
|
391
400
|
this.timer = setTimeout(() => this.connect(), wait)
|
|
392
401
|
}
|
|
393
402
|
}
|
|
@@ -401,6 +410,7 @@ class RelayClient extends EventEmitter {
|
|
|
401
410
|
try {
|
|
402
411
|
const accepted = await this.authenticate('work', context.session, context)
|
|
403
412
|
remote = accepted.socket
|
|
413
|
+
// Older brokers park without a deadline; keep the legacy 60s wait in that case.
|
|
404
414
|
const start = await line(remote, 60000)
|
|
405
415
|
if (start.type !== 'start' || context.closing || this.context !== context) throw fault('STALE_WORK')
|
|
406
416
|
context.pending--; pending = false
|
|
@@ -1064,9 +1074,16 @@ class RelayHost {
|
|
|
1064
1074
|
finally { try { fs.unlinkSync(temp) } catch {} }
|
|
1065
1075
|
this.config = config
|
|
1066
1076
|
}
|
|
1077
|
+
e2eeAllowed(daily = this.daily) {
|
|
1078
|
+
if (!this.config) return false
|
|
1079
|
+
// Basic monthly relay has no encrypted entry. Data packs opt in explicitly.
|
|
1080
|
+
if (this.config.quotaPeriod !== 'month') return true
|
|
1081
|
+
return daily?.fileTransfer === true || this.config.dataPack === true
|
|
1082
|
+
}
|
|
1067
1083
|
status() {
|
|
1068
1084
|
const config = this.config
|
|
1069
1085
|
let phase = this.phase
|
|
1086
|
+
const e2eeAllowed = this.e2eeAllowed()
|
|
1070
1087
|
if (config && Date.now() >= config.expiresAt) phase = 'expired'
|
|
1071
1088
|
else if (config?.enabled && this.daily?.exhausted && (this.e2eeEnabled || !this.daily.fallbackRemainingBytes)) phase = 'quota-exceeded'
|
|
1072
1089
|
else if (config?.enabled && this.daily?.unavailable) phase = 'quota-unavailable'
|
|
@@ -1077,7 +1094,7 @@ class RelayHost {
|
|
|
1077
1094
|
quotaPending: !!config?.enabled && !this.daily, error: this.error,
|
|
1078
1095
|
quotaPeriod: config?.quotaPeriod || 'day', fileTransfer: config?.quotaPeriod === 'month' ? this.daily?.fileTransfer === true : config?.fileTransfer !== false,
|
|
1079
1096
|
monthlyLimitBytes: config?.quotaPeriod === 'month' ? this.daily?.limitBytes || config.monthlyLimitBytes : null,
|
|
1080
|
-
e2ee: { enabled: this.e2eeEnabled, configured: !!this.endpoint, fingerprint: this.e2eeFingerprint, deviceCount: this.devices?.routes().length || 0 },
|
|
1097
|
+
e2ee: { allowed: e2eeAllowed, enabled: e2eeAllowed && this.e2eeEnabled, configured: e2eeAllowed && !!this.endpoint, fingerprint: e2eeAllowed ? this.e2eeFingerprint : '', deviceCount: e2eeAllowed ? this.devices?.routes().length || 0 : 0 },
|
|
1081
1098
|
server: this.origin, busy: this.busy, legacyAvailable: !config && !!this.legacy(),
|
|
1082
1099
|
activationImport: true, ...(config?.activationId ? { activationId: config.activationId } : {}) }
|
|
1083
1100
|
}
|
|
@@ -1100,7 +1117,7 @@ class RelayHost {
|
|
|
1100
1117
|
if (this.config.expiresAt <= Date.now()) { this.phase = 'expired'; return }
|
|
1101
1118
|
// Only the operator-configured service is allowed, never a target supplied by a browser.
|
|
1102
1119
|
if (this.config.tunnelOrigin !== this.origin) throw fault('RELAY_SERVER_MISMATCH', 409)
|
|
1103
|
-
this.e2eeEnabled = this.e2eeOverride ?? (this.config.e2eeEnabled === true)
|
|
1120
|
+
this.e2eeEnabled = this.e2eeAllowed() && (this.e2eeOverride ?? (this.config.e2eeEnabled === true))
|
|
1104
1121
|
let e2ee
|
|
1105
1122
|
if (this.e2eeEnabled) {
|
|
1106
1123
|
const identity = loadIdentity(this.root)
|
|
@@ -1137,6 +1154,17 @@ class RelayHost {
|
|
|
1137
1154
|
client.on('usage', daily => {
|
|
1138
1155
|
if (this.client !== client) return
|
|
1139
1156
|
this.daily = daily; this.updatedAt = Date.now()
|
|
1157
|
+
if (this.config?.quotaPeriod === 'month' && typeof daily?.fileTransfer === 'boolean' && this.config.dataPack !== daily.fileTransfer) {
|
|
1158
|
+
try { this.save({ ...this.config, dataPack: daily.fileTransfer }) } catch {}
|
|
1159
|
+
}
|
|
1160
|
+
if (this.e2eeEnabled && !this.e2eeAllowed()) {
|
|
1161
|
+
this.e2eeEnabled = false
|
|
1162
|
+
queueMicrotask(() => {
|
|
1163
|
+
if (this.client === client && this.config?.enabled) {
|
|
1164
|
+
try { this.start() } catch { this.phase = 'error'; this.error = 'LOCAL_STATE_INVALID' }
|
|
1165
|
+
}
|
|
1166
|
+
})
|
|
1167
|
+
}
|
|
1140
1168
|
})
|
|
1141
1169
|
client.start()
|
|
1142
1170
|
}
|
|
@@ -1150,6 +1178,7 @@ class RelayHost {
|
|
|
1150
1178
|
async changeDevice(value) {
|
|
1151
1179
|
if (this.busy) throw fault('RELAY_OPERATION_BUSY',409)
|
|
1152
1180
|
if (!this.config) throw fault('HOST_NOT_CONFIGURED',409)
|
|
1181
|
+
if (!this.e2eeAllowed() && ['enable-encryption','rotate-identity','create-device'].includes(value.action)) throw fault('E2EE_PLAN_REQUIRED',409)
|
|
1153
1182
|
if (this.e2eeOverride === false && ['enable-encryption','rotate-identity'].includes(value.action)) throw fault('E2EE_DISABLED_BY_POLICY',409)
|
|
1154
1183
|
this.busy = true
|
|
1155
1184
|
try {
|
|
@@ -1224,7 +1253,7 @@ class RelayHost {
|
|
|
1224
1253
|
new RelayClient({ ...config, gateway: this.gateway, privateKey: privateKey.export({ format: 'pem', type: 'pkcs8' }), ca: this.ca })
|
|
1225
1254
|
if (config.tunnelOrigin !== this.origin || new URL(config.publicUrl).protocol !== 'https:') throw fault('INVALID_SERVER_RESPONSE', 502)
|
|
1226
1255
|
this.save({ ...config, fingerprint: crypto.createHash('sha256').update(publicKey).digest('hex'), enabled: true,
|
|
1227
|
-
e2eeEnabled: this.e2eeOverride ?? (this.config ? this.e2eeEnabled :
|
|
1256
|
+
e2eeEnabled: this.e2eeOverride ?? (this.config ? this.e2eeEnabled : false),
|
|
1228
1257
|
...(imported ? { activationId, activationHash } : {}) })
|
|
1229
1258
|
this.daily = null; this.updatedAt = null; this.start()
|
|
1230
1259
|
} else if (action === 'enable') {
|
|
@@ -1819,6 +1848,7 @@ const VERSION = gatewayVersion()
|
|
|
1819
1848
|
const PROTOCOL_VERSION = 1
|
|
1820
1849
|
const CAPABILITIES = Object.freeze({
|
|
1821
1850
|
wsTicket: 1,
|
|
1851
|
+
streamContinuity: 1,
|
|
1822
1852
|
eventPolling: 1,
|
|
1823
1853
|
eventEpoch: 1,
|
|
1824
1854
|
operations: 1,
|
|
@@ -3627,6 +3657,8 @@ const eventNextSeq = { mux: 1, host: 1 }
|
|
|
3627
3657
|
const EVENT_STREAM_EPOCH = crypto.randomUUID()
|
|
3628
3658
|
const WS_CLIENT_BUFFER_MAX = durationEnv('GATEWAY_WS_CLIENT_BUFFER_MAX', 2 * 1024 * 1024, 65536, 16 * 1024 * 1024)
|
|
3629
3659
|
const collectorClients = { mux: new Set(), host: new Set() }
|
|
3660
|
+
const continuitySockets = new Map()
|
|
3661
|
+
const continuityKey = (auth, id) => JSON.stringify([auth.type, auth.id, id])
|
|
3630
3662
|
const collectorReplay = { mux: new Map(), host: new Map() }
|
|
3631
3663
|
const eventPollWaiters = { mux: new Set(), host: new Set() }
|
|
3632
3664
|
const eventCollectorState = {
|
|
@@ -4478,6 +4510,18 @@ function serveEventPoll(req, res, url) {
|
|
|
4478
4510
|
}
|
|
4479
4511
|
touchDevice(req)
|
|
4480
4512
|
const kind = url.searchParams.get('kind')
|
|
4513
|
+
if (kind === 'mux' && url.searchParams.has('wsProbe')) {
|
|
4514
|
+
const id = url.searchParams.get('stream'), nonce = url.searchParams.get('wsProbe')
|
|
4515
|
+
const socket = /^[a-f0-9]{32}$/.test(id || '') && /^[a-f0-9]{32}$/.test(nonce || '')
|
|
4516
|
+
? continuitySockets.get(continuityKey(req.dshRemoteAuth, id)) : null
|
|
4517
|
+
const frame = socket && encodeWsText(JSON.stringify({ type: 'relay/ws-probe', nonce }))
|
|
4518
|
+
const available = socket?.writable && !socket.destroyed && socket.writableLength + frame.length <= WS_CLIENT_BUFFER_MAX
|
|
4519
|
+
if (available) socket.write(frame)
|
|
4520
|
+
cors(res)
|
|
4521
|
+
res.writeHead(available ? 204 : 404, { 'cache-control': 'no-store' })
|
|
4522
|
+
res.end()
|
|
4523
|
+
return
|
|
4524
|
+
}
|
|
4481
4525
|
if (kind !== 'mux' && kind !== 'host') {
|
|
4482
4526
|
cors(res)
|
|
4483
4527
|
res.writeHead(400, { 'content-type': 'application/json; charset=utf-8' })
|
|
@@ -8607,6 +8651,12 @@ function acceptCollectorClient(req, socket, head, kind, device) {
|
|
|
8607
8651
|
if (head?.length) socket.unshift(head)
|
|
8608
8652
|
socket.setNoDelay(true)
|
|
8609
8653
|
collectorClients[kind].add(socket)
|
|
8654
|
+
const streamId = new URL(req.url, 'http://dsh-remote.local').searchParams.get('stream')
|
|
8655
|
+
if (kind === 'mux' && /^[a-f0-9]{32}$/.test(streamId || '')) {
|
|
8656
|
+
const id = continuityKey(req.dshRemoteAuth, streamId)
|
|
8657
|
+
continuitySockets.set(id, socket)
|
|
8658
|
+
socket.once('close', () => { if (continuitySockets.get(id) === socket) continuitySockets.delete(id) })
|
|
8659
|
+
}
|
|
8610
8660
|
eventCollectorState[kind].clients = collectorClients[kind].size
|
|
8611
8661
|
// 客户端(鸿蒙 lws 等严格 RFC 实现)会发掩码 Ping 并等待 Pong;
|
|
8612
8662
|
// 网关必须按 RFC6455 回 Pong(0x8A),且服务端→客户端方向不带掩码位
|
package/package.json
CHANGED
package/public/activity.js
CHANGED
|
@@ -15,8 +15,10 @@
|
|
|
15
15
|
for(const key of ['description','command','cmd','path','file_path','pattern','query','url','line'])if(typeof value[key]==='string')return brief(value[key])
|
|
16
16
|
return ''
|
|
17
17
|
}
|
|
18
|
-
function shell(kind,key,title,hint,state,body,live=false,error=false){
|
|
19
|
-
|
|
18
|
+
function shell(kind,key,title,hint,state,body,live=false,error=false,lazy=false){
|
|
19
|
+
const render=typeof body==='function'?body:()=>String(body??'')
|
|
20
|
+
const content=lazy?lazyBody(key,render):`<div class="activity-body">${render()}</div>`
|
|
21
|
+
return `<details class="chat-activity activity-${kind}${live?' is-live':''}${error?' is-error':''}" data-activity-key="${esc(key)}"><summary>${icon(kind)}<span class="activity-copy"><span class="activity-title">${esc(title)}</span>${hint?`<span class="activity-hint">${esc(hint)}</span>`:''}</span><span class="activity-state">${live?'<i aria-hidden="true"></i>':''}${esc(state)}</span><span class="activity-chevron" aria-hidden="true"></span></summary>${content}</details>`
|
|
20
22
|
}
|
|
21
23
|
function reasoning(value={}){
|
|
22
24
|
const source=String(value.text??'')
|
|
@@ -28,14 +30,49 @@
|
|
|
28
30
|
const args=value.args,returned=Object.hasOwn(value,'result'),error=!!value.error
|
|
29
31
|
const section=(title,content)=>`<section><h4>${esc(title)}</h4><pre>${esc(cut(json(content),12000))}</pre></section>`
|
|
30
32
|
const translated=returned?root.DshApprovalRecords?.feedbackHtml(value.result):''
|
|
31
|
-
const body=(args===undefined?'':section(text('参数','Arguments'),args))+(returned?(translated||section(text('结果','Result'),value.result)):`<p class="activity-note">${esc(text('当前记录中尚无对应结果。','No matching result in the loaded history.'))}</p>`)
|
|
33
|
+
const body=()=>(args===undefined?'':section(text('参数','Arguments'),args))+(returned?(translated||section(text('结果','Result'),value.result)):`<p class="activity-note">${esc(text('当前记录中尚无对应结果。','No matching result in the loaded history.'))}</p>`)
|
|
32
34
|
+(value.children?.length?`<div class="activity-nested-tools">${value.children.map(tool).join('')}</div>`:'')
|
|
33
|
-
return shell('tool',value.key,value.name||text(returned?'工具结果':'工具调用',returned?'Tool result':'Tool call'),argumentHint(args),text(error?'返回错误':returned?'已返回':'已调用',error?'Error':returned?'Returned':'Called'),body,false,error)
|
|
35
|
+
return shell('tool',value.key,value.name||text(returned?'工具结果':'工具调用',returned?'Tool result':'Tool call'),argumentHint(args),text(error?'返回错误':returned?'已返回':'已调用',error?'Error':returned?'Returned':'Called'),body,false,error,true)
|
|
34
36
|
}
|
|
35
37
|
const dataOf=entry=>entry.event?.data||{}
|
|
36
38
|
const callId=data=>data.callId||data.message?.source?.callId
|
|
37
39
|
const resultOf=data=>data.error??data.result??data.output??data.message??data.text??data.content??data
|
|
38
40
|
const isDispatch=type=>type==='tool/ptc-dispatch-start'||type==='tool/ptc-dispatch'
|
|
41
|
+
// Collapsed activity blocks keep their body out of the DOM until the user opens them.
|
|
42
|
+
// Closures capture the raw values so JSON/escape work happens on demand, not during
|
|
43
|
+
// history load or on every streamed update.
|
|
44
|
+
const lazyBodies=new Map()
|
|
45
|
+
let lazyBound=false
|
|
46
|
+
function lazyBody(key,render,className='activity-body'){
|
|
47
|
+
const id=String(key)
|
|
48
|
+
lazyBodies.delete(id)
|
|
49
|
+
lazyBodies.set(id,render)
|
|
50
|
+
if(lazyBodies.size>800)lazyBodies.delete(lazyBodies.keys().next().value)
|
|
51
|
+
return `<div class="${className}" data-activity-lazy="${esc(id)}"></div>`
|
|
52
|
+
}
|
|
53
|
+
function renderLazy(key){
|
|
54
|
+
const render=lazyBodies.get(String(key))
|
|
55
|
+
return render?render():''
|
|
56
|
+
}
|
|
57
|
+
function hydrate(details){
|
|
58
|
+
const hydrated=[]
|
|
59
|
+
if(!details||typeof details.querySelectorAll!=='function')return hydrated
|
|
60
|
+
for(const box of details.querySelectorAll('[data-activity-lazy]')){
|
|
61
|
+
if(box.closest&&box.closest('details')!==details)continue
|
|
62
|
+
if(!lazyBodies.has(box.dataset.activityLazy))continue
|
|
63
|
+
try{box.innerHTML=renderLazy(box.dataset.activityLazy)}catch{box.textContent=''}
|
|
64
|
+
delete box.dataset.activityLazy
|
|
65
|
+
hydrated.push(box)
|
|
66
|
+
}
|
|
67
|
+
return hydrated
|
|
68
|
+
}
|
|
69
|
+
function bindLazy(){
|
|
70
|
+
if(lazyBound||typeof document==='undefined'||typeof document.addEventListener!=='function')return
|
|
71
|
+
lazyBound=true
|
|
72
|
+
// Toggle does not bubble: listen in the capture phase at the document.
|
|
73
|
+
document.addEventListener('toggle',event=>{const detail=event.target;if(detail&&detail.open)hydrate(detail)},true)
|
|
74
|
+
}
|
|
75
|
+
bindLazy()
|
|
39
76
|
const pairs=new WeakMap()
|
|
40
77
|
function prepare(entries){
|
|
41
78
|
const pending=new Map(),matched=new Map(),consumed=new Set()
|
|
@@ -200,9 +237,10 @@
|
|
|
200
237
|
const failed=tools.some(item=>item.tool?.error||item.entry?.view?.toolActivity?.error||errorOf(item.entry?.event?.data))
|
|
201
238
|
const counts=[thoughts?text('思考','Reasoning'):'',tools.length?text(`${tools.length} 次工具调用`,`${tools.length} tool ${tools.length===1?'call':'calls'}`):''].filter(Boolean)
|
|
202
239
|
const title=running?text(items.at(-1).kind==='reasoning'?'思考中':'正在使用工具',items.at(-1).kind==='reasoning'?'Thinking':'Using tools'):counts.join(' · ')
|
|
203
|
-
const
|
|
240
|
+
const key='activity-group:'+(items[0].key||items[0].seq)
|
|
241
|
+
const body=()=>items.map(item=>item.kind==='reasoning'?reasoning(item):item.kind==='embedded-tool'?tool(item.tool):renderEntry(item.entry)).join('')
|
|
204
242
|
const owner=group.summaryTurn==null?'':` data-activity-turn="${esc(group.summaryTurn)}"`
|
|
205
|
-
return `<details class="chat-activity-group${failed?' is-error':''}${running?' is-running':''}" data-activity-key="
|
|
243
|
+
return `<details class="chat-activity-group${failed?' is-error':''}${running?' is-running':''}" data-activity-key="${esc(key)}"${owner}><summary><span class="activity-chevron" aria-hidden="true"></span>${icon(thoughts?'reasoning':'tool')}<span class="activity-group-title">${esc(title)}</span></summary>${lazyBody(key,body,'activity-group-body')}</details>`
|
|
206
244
|
}
|
|
207
245
|
function countToolTree(value,counted,id=value?.key){
|
|
208
246
|
if(id!=null){
|
|
@@ -326,7 +364,7 @@
|
|
|
326
364
|
return [...blocks].filter(([,value])=>value).map(([index,value])=>reasoning({text:value,key:`attempt:${event.seq}:${index}`})).join('')+failureHtml(failure(event),true)
|
|
327
365
|
}
|
|
328
366
|
const streamNotice=()=>`<div class="activity-note" role="status">${esc(text('弱网精简已隐藏实时思考,完成后可查看;可在网络设置中关闭精简。','Live reasoning is hidden in weak-network mode. View it after completion or disable trimming in network settings.'))}</div>`
|
|
329
|
-
const api={hasVisibleText,prepare,tool,toolEvent,isToolEvent,reasoning,reasoningKey,group,groupHtml,turnHtml,failure,failureHtml,groupFailures,failureGroupHtml,attemptHtml,streamNotice,withContinuation}
|
|
367
|
+
const api={hasVisibleText,prepare,tool,toolEvent,isToolEvent,reasoning,reasoningKey,group,groupHtml,turnHtml,failure,failureHtml,groupFailures,failureGroupHtml,attemptHtml,streamNotice,withContinuation,hydrate,renderLazy}
|
|
330
368
|
if(typeof module!=='undefined'&&module.exports)module.exports=api
|
|
331
369
|
else root.DshActivity=api
|
|
332
370
|
})(typeof window==='undefined'?globalThis:window)
|
package/public/admin.html
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
2
|
<html lang="zh-CN">
|
|
3
3
|
<head>
|
|
4
|
-
<meta name="dsh-remote-build" content="
|
|
4
|
+
<meta name="dsh-remote-build" content="bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
7
7
|
<meta name="theme-color" content="#0D1117">
|
|
8
8
|
<title>DSH Remote · 管理</title>
|
|
9
9
|
<script>/* 首帧前应用皮肤 */ (function(){try{var t=localStorage.getItem('dshTheme');if(t!=='default'&&t!=='dark'&&t!=='light'&&t!=='neutral'&&t!=='mono'&&t!=='fish'&&t!=='penguin'&&t!=='penguin-night'&&t!=='bocchi'&&t!=='nijika'&&t!=='ryo'&&t!=='kita'&&t!=='penguin-logistics'&&t!=='miku'){t='fish'}}catch(e){t='fish'}document.documentElement.setAttribute('data-theme',t)})()</script>
|
|
10
|
-
<link rel="stylesheet" href="../styles.css?dsr-build=
|
|
11
|
-
<link rel="stylesheet" href="../relay-settings.css?dsr-build=
|
|
12
|
-
<link rel="stylesheet" href="../insights.css?dsr-build=
|
|
13
|
-
<link rel="stylesheet" href="../setup.css?dsr-build=
|
|
14
|
-
<link rel="stylesheet" href="../doctor.css?dsr-build=
|
|
15
|
-
<link rel="stylesheet" href="../skins/blue-fish/skin.css?dsr-build=
|
|
16
|
-
<link rel="stylesheet" href="../skins/penguin/skin.css?dsr-build=
|
|
17
|
-
<link rel="stylesheet" href="../skins/bocchi/skin.css?dsr-build=
|
|
18
|
-
<link rel="stylesheet" href="../skins/kessoku/skin.css?dsr-build=
|
|
19
|
-
<link rel="stylesheet" href="../skins/nijika/skin.css?dsr-build=
|
|
20
|
-
<link rel="stylesheet" href="../skins/ryo/skin.css?dsr-build=
|
|
21
|
-
<link rel="stylesheet" href="../skins/kita/skin.css?dsr-build=
|
|
22
|
-
<link rel="stylesheet" href="../skins/penguin-logistics/skin.css?dsr-build=
|
|
23
|
-
<link rel="stylesheet" href="../skins/miku/skin.css?dsr-build=
|
|
10
|
+
<link rel="stylesheet" href="../styles.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
11
|
+
<link rel="stylesheet" href="../relay-settings.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
12
|
+
<link rel="stylesheet" href="../insights.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
13
|
+
<link rel="stylesheet" href="../setup.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
14
|
+
<link rel="stylesheet" href="../doctor.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
15
|
+
<link rel="stylesheet" href="../skins/blue-fish/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
16
|
+
<link rel="stylesheet" href="../skins/penguin/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
17
|
+
<link rel="stylesheet" href="../skins/bocchi/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
18
|
+
<link rel="stylesheet" href="../skins/kessoku/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
19
|
+
<link rel="stylesheet" href="../skins/nijika/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
20
|
+
<link rel="stylesheet" href="../skins/ryo/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
21
|
+
<link rel="stylesheet" href="../skins/kita/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
22
|
+
<link rel="stylesheet" href="../skins/penguin-logistics/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
23
|
+
<link rel="stylesheet" href="../skins/miku/skin.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
24
24
|
<style>
|
|
25
25
|
.admin-wrap { max-width: 1180px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 14px) 14px 40px; }
|
|
26
26
|
.admin-title {
|
|
@@ -350,8 +350,8 @@
|
|
|
350
350
|
.admin-title .left { gap: 7px; }
|
|
351
351
|
}
|
|
352
352
|
</style>
|
|
353
|
-
<link rel="stylesheet" href="../remote-ui.css?dsr-build=
|
|
354
|
-
<link rel="stylesheet" href="../theme-picker.css?dsr-build=
|
|
353
|
+
<link rel="stylesheet" href="../remote-ui.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
354
|
+
<link rel="stylesheet" href="../theme-picker.css?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82">
|
|
355
355
|
</head>
|
|
356
356
|
<body>
|
|
357
357
|
<div class="admin-wrap">
|
|
@@ -803,20 +803,20 @@
|
|
|
803
803
|
}
|
|
804
804
|
}
|
|
805
805
|
</script>
|
|
806
|
-
<script src="../setup.js?dsr-build=
|
|
807
|
-
<script src="../qrcode.min.js?dsr-build=
|
|
808
|
-
<script src="../i18n.js?dsr-build=
|
|
809
|
-
<script src="../theme.js?dsr-build=
|
|
810
|
-
<script src="../vendor/gsap/gsap.min.js?dsr-build=
|
|
811
|
-
<script src="../motion.js?dsr-build=
|
|
812
|
-
<script src="../remote-state.js?dsr-build=
|
|
813
|
-
<script src="../remote-ui.js?dsr-build=
|
|
814
|
-
<script src="../admin.js?dsr-build=
|
|
815
|
-
<script src="../doctor.js?dsr-build=
|
|
816
|
-
<script src="../doctor-entry.js?dsr-build=
|
|
817
|
-
<script src="../sponsor-entry.js?dsr-build=
|
|
818
|
-
<script src="../relay-devices.js?dsr-build=
|
|
819
|
-
<script src="../relay-settings.js?dsr-build=
|
|
806
|
+
<script src="../setup.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
807
|
+
<script src="../qrcode.min.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
808
|
+
<script src="../i18n.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
809
|
+
<script src="../theme.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
810
|
+
<script src="../vendor/gsap/gsap.min.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
811
|
+
<script src="../motion.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
812
|
+
<script src="../remote-state.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
813
|
+
<script src="../remote-ui.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
814
|
+
<script src="../admin.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
815
|
+
<script src="../doctor.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
816
|
+
<script src="../doctor-entry.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
817
|
+
<script src="../sponsor-entry.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
818
|
+
<script src="../relay-devices.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
819
|
+
<script src="../relay-settings.js?dsr-build=bf34185cf0d5c5081644cc64dc6d026b2f352209cea43836820bd9eff034dd82"></script>
|
|
820
820
|
<script>window.mountAdminRelaySettings?.()</script>
|
|
821
821
|
</body>
|
|
822
822
|
</html>
|
|
@@ -459,6 +459,42 @@
|
|
|
459
459
|
"minVersion": "",
|
|
460
460
|
"maxVersion": "",
|
|
461
461
|
"publishedAt": "2026-11-05T15:05:33.266Z"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"id": "2026-11-23-090-cloud-relay-update",
|
|
465
|
+
"title": "DSH Remote 0.9.0|云中转更新",
|
|
466
|
+
"content": "【务必加入 QQ 交流群 1106138825】\n首次开通、已付款待审核和正在使用云中转的用户,请都加入群。审核、激活补发、续费和加密条件更新在群内跟进。具体订单请通过原申请页留言。\n\n基础档从试运营 ¥1 起改为 ¥5/服务月。现有端到端加密连接当前服务期内照常使用。\n中转不持久保存经转发的对话正文、图片和文件内容。\n\n价格与流量包\n新版首次开通和续费均按固定价格办理。已购买的试运营服务期及已提交的旧订单,沿用原订单。\n\n¥5/服务月 · 5 GB\n支持文本对话与图片预览。\n\n¥10/服务月 · 10 GB\n基础档加 1 个包,支持文件传输。\n\n¥15/服务月 · 15 GB\n基础档加 2 个包,支持文件传输。\n\n每个流量包 ¥5,增加 5 GB。可随开通或续费购买,也可在本期生效后 72 小时内补买。每份资格绑定一台主机,上传与下载合计计入流量。每份资格每期最多 2 包,全站每月 20 包,按所购服务期的开始月份计库存。\n\n端到端加密与普通 HTTPS\n【传输内容不持久保存】\n云中转不持久保存经转发的对话正文、图片和文件内容,包括其中的敏感信息。类型判断用于执行传输规则,例如核对图片文件头与声明类型,防止通过修改类型标识将其他文件伪装成图片。运维记录包括用量、连接状态和错误码等必要信息。\n\n端到端加密时,中转收到的是加密内容。普通 HTTPS 加密网络链路。连接在中转处终止并重新转发,服务器在转发时技术上可读取内容。\n\n现有端到端加密连接在当前服务期内继续使用。购包后如需在加密连接中传输文件,请把 Android App 和主机 Remote 网关更新到 0.9.0。后续加密条件如有调整,会等现有用户的当前服务期结束后另行公告,并在 QQ 群同步。\n\n付款截图通过办理页提交。查询凭证、激活文件和中转密钥请私下保存。\n\n办理流程与续费期限\n首次开通 → 选基础档及所需流量包。\n已有主机续费 → 恢复原申请 → 选下一期。\n本期加购 → 恢复原申请 → 在本期生效后 72 小时内选包。\n\n这三类订单走同一付款流程。\n确认报价 → 领取付款编号 → 按编号付款 → 提交截图 → 人工核对到账。已付款待审核时,可用原查询凭证查看进度。\n\n提前续费通过后接在原服务期之后。新版服务到期会暂停中转,到期后 72 小时内提交有效续费申请可保留原绑定。已有试运营服务期沿用原 7 天窗口,请核对办理页显示的截止时间。\n\n审核通过后怎样激活\n首次开通从审核通过时起算服务期。Android 用户先在局域网连接要绑定的电脑,再点「开通并自动配置此主机」。App 保存申请进度,检测到审核通过后为选定主机提交激活。\n\n手机仅持有设备权限时,请在电脑端确认。也可以从站内消息领取激活、导入激活文件或手动配置。服务期仍有效但激活已过期,可在原申请下留言补发。\n\n侧栏和其他界面更新\n新版手机侧栏重新整理了最近会话、搜索和常用入口,快捷项可自行调整。云中转办理页修复顶栏遮挡,公网文件收件箱会显示下载回执,同时适配 DSH 0.2.2 和新版 GenUI 预览。\n\n感谢试用,欢迎贡献\n感谢试运营期间帮忙做真机测试、复现问题、提交日志、提出建议和赞助支持的朋友。你们的反馈帮助我们修复了公网文件接收和云中转办理页布局问题。\n\n欢迎到 GitHub 的 Blank-not-black/dsh-Remote 仓库提 Issue 或提交 PR。修复一个小问题、适配一个设备、改进一段文档或翻译,都能让其他用户受益。感谢大家一起把 DSH Remote 做得更好。",
|
|
467
|
+
"summary": "【务必加入 QQ 交流群 1106138825】\n首次开通、已付款待审核和正在使用云中转的用户,请都加入群。审核、激活补发、续费和加密条件更新在群内跟进。具体订单请通过原申请页留言。\n\n基础档从试运营 ¥1 起改为 ¥5/服务月。现有端到端加密连接当前服务期内照常使用。\n中转不持久保存经转发的对话正文、图片和文件内容。",
|
|
468
|
+
"sections": [
|
|
469
|
+
{
|
|
470
|
+
"title": "价格与流量包",
|
|
471
|
+
"content": "新版首次开通和续费均按固定价格办理。已购买的试运营服务期及已提交的旧订单,沿用原订单。\n\n¥5/服务月 · 5 GB\n支持文本对话与图片预览。\n\n¥10/服务月 · 10 GB\n基础档加 1 个包,支持文件传输。\n\n¥15/服务月 · 15 GB\n基础档加 2 个包,支持文件传输。\n\n每个流量包 ¥5,增加 5 GB。可随开通或续费购买,也可在本期生效后 72 小时内补买。每份资格绑定一台主机,上传与下载合计计入流量。每份资格每期最多 2 包,全站每月 20 包,按所购服务期的开始月份计库存。"
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
"title": "端到端加密与普通 HTTPS",
|
|
475
|
+
"content": "【传输内容不持久保存】\n云中转不持久保存经转发的对话正文、图片和文件内容,包括其中的敏感信息。类型判断用于执行传输规则,例如核对图片文件头与声明类型,防止通过修改类型标识将其他文件伪装成图片。运维记录包括用量、连接状态和错误码等必要信息。\n\n端到端加密时,中转收到的是加密内容。普通 HTTPS 加密网络链路。连接在中转处终止并重新转发,服务器在转发时技术上可读取内容。\n\n现有端到端加密连接在当前服务期内继续使用。购包后如需在加密连接中传输文件,请把 Android App 和主机 Remote 网关更新到 0.9.0。后续加密条件如有调整,会等现有用户的当前服务期结束后另行公告,并在 QQ 群同步。\n\n付款截图通过办理页提交。查询凭证、激活文件和中转密钥请私下保存。"
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"title": "办理流程与续费期限",
|
|
479
|
+
"content": "首次开通 → 选基础档及所需流量包。\n已有主机续费 → 恢复原申请 → 选下一期。\n本期加购 → 恢复原申请 → 在本期生效后 72 小时内选包。\n\n这三类订单走同一付款流程。\n确认报价 → 领取付款编号 → 按编号付款 → 提交截图 → 人工核对到账。已付款待审核时,可用原查询凭证查看进度。\n\n提前续费通过后接在原服务期之后。新版服务到期会暂停中转,到期后 72 小时内提交有效续费申请可保留原绑定。已有试运营服务期沿用原 7 天窗口,请核对办理页显示的截止时间。"
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
"title": "审核通过后怎样激活",
|
|
483
|
+
"content": "首次开通从审核通过时起算服务期。Android 用户先在局域网连接要绑定的电脑,再点「开通并自动配置此主机」。App 保存申请进度,检测到审核通过后为选定主机提交激活。\n\n手机仅持有设备权限时,请在电脑端确认。也可以从站内消息领取激活、导入激活文件或手动配置。服务期仍有效但激活已过期,可在原申请下留言补发。"
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"title": "侧栏和其他界面更新",
|
|
487
|
+
"content": "新版手机侧栏重新整理了最近会话、搜索和常用入口,快捷项可自行调整。云中转办理页修复顶栏遮挡,公网文件收件箱会显示下载回执,同时适配 DSH 0.2.2 和新版 GenUI 预览。"
|
|
488
|
+
},
|
|
489
|
+
{
|
|
490
|
+
"title": "感谢试用,欢迎贡献",
|
|
491
|
+
"content": "感谢试运营期间帮忙做真机测试、复现问题、提交日志、提出建议和赞助支持的朋友。你们的反馈帮助我们修复了公网文件接收和云中转办理页布局问题。\n\n欢迎到 GitHub 的 Blank-not-black/dsh-Remote 仓库提 Issue 或提交 PR。修复一个小问题、适配一个设备、改进一段文档或翻译,都能让其他用户受益。感谢大家一起把 DSH Remote 做得更好。"
|
|
492
|
+
}
|
|
493
|
+
],
|
|
494
|
+
"actionText": "打开云中转办理页",
|
|
495
|
+
"actionUrl": "https://relay-pilot.blankalwaysgoeson.site/sponsor/",
|
|
496
|
+
"force": false,
|
|
497
|
+
"publishedAt": "2026-11-23T20:22:23+08:00"
|
|
462
498
|
}
|
|
463
499
|
]
|
|
464
500
|
}
|