dsh-remote-plugin 0.7.6 → 0.8.0-rc.3

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/public/network.js CHANGED
@@ -2,6 +2,12 @@
2
2
  'use strict';
3
3
  ;(function(root){
4
4
  let measuredLatency=0
5
+ const sharedReads=new Map()
6
+ function shareRead(key,read){
7
+ if(sharedReads.has(key))return sharedReads.get(key)
8
+ const job=Promise.resolve().then(read).finally(()=>{if(sharedReads.get(key)===job)sharedReads.delete(key)})
9
+ sharedReads.set(key,job);return job
10
+ }
5
11
  function mode(){try{return ['auto','weak','normal'].includes(root.localStorage.getItem('dshNetworkModeV1'))?root.localStorage.getItem('dshNetworkModeV1'):'auto'}catch{return 'auto'}}
6
12
  function profile(){
7
13
  const selected=mode(),connection=root.navigator?.connection
@@ -9,6 +15,10 @@
9
15
  return {weak,historyPageSize:weak?20:60,readTimeout:weak?90000:45000,pingTimeout:weak?12000:6000,pollTimeout:weak?45000:30000}
10
16
  }
11
17
  function setMode(value){if(!['auto','weak','normal'].includes(value))return;try{root.localStorage.setItem('dshNetworkModeV1',value)}catch{};return profile()}
18
+ // 弱网下可选关闭流式输出:只保留已完成的消息与工具结果。
19
+ const STREAM_KEY='dshWeakStreamOff'
20
+ function streamSetting(){try{return root.localStorage.getItem(STREAM_KEY)!=='0'}catch{return true}}
21
+ function streamTrimmed(){return streamSetting()&&profile().weak}
12
22
  class PollLoop {
13
23
  constructor(options){this.options=options;this.jobs={};this.setTimer=options.setTimer||setTimeout;this.clearTimer=options.clearTimer||clearTimeout}
14
24
  stop(){for(const job of Object.values(this.jobs)){job.controller.abort();this.clearTimer(job.timer)}this.jobs={}}
@@ -36,21 +46,41 @@
36
46
  }
37
47
  function preferences(){
38
48
  const panel=root.document?.getElementById('settings-page-general');if(!panel)return
49
+ const desktop=panel.classList.contains('ds-settings')
39
50
  let row=root.document.getElementById('network-preferences')
40
51
  if(!row){
41
- row=root.document.createElement('div');row.id='network-preferences';row.className=panel.classList.contains('ds-settings')?'ds-setting-row':'setting-row'
52
+ row=root.document.createElement('div');row.id='network-preferences';row.className=desktop?'ds-setting-row':'setting-row'
42
53
  const copy=root.document.createElement('div'),title=root.document.createElement('div'),detail=root.document.createElement('div'),select=root.document.createElement('select')
43
- title.dataset.networkTitle='';detail.dataset.networkDetail='';detail.className='muted';select.id='network-mode';select.className='setting-select'
54
+ title.dataset.networkTitle='';detail.dataset.networkDetail='';title.className=desktop?'ds-setting-name':'setting-name';detail.className=desktop?'ds-setting-desc':'setting-desc';select.id='network-mode';select.className='setting-select'
44
55
  for(const value of ['auto','weak','normal']){const option=root.document.createElement('option');option.value=value;select.append(option)}
45
- copy.append(title,detail);row.append(copy,select);panel.append(row)
46
- select.addEventListener('change',()=>{setMode(select.value);root.enhanceCustomSelect?.(select)})
56
+ copy.append(title,detail);row.append(copy,select)
57
+ const target=panel.querySelector('[data-workflow-settings-slot="input"]')||panel
58
+ target.append(row)
59
+ const section=target.closest?.('.workflow-settings-section');if(section)section.hidden=false
60
+ select.addEventListener('change',()=>{setMode(select.value);root.applyStreamPreference?.();root.enhanceCustomSelect?.(select)})
61
+ }
62
+ let streamRow=root.document.getElementById('network-stream-preferences')
63
+ if(!streamRow){
64
+ streamRow=root.document.createElement('div');streamRow.id='network-stream-preferences';streamRow.className=desktop?'ds-setting-row':'setting-row'
65
+ const copy=root.document.createElement('div'),title=root.document.createElement('div'),detail=root.document.createElement('div'),label=root.document.createElement('label'),input=root.document.createElement('input'),slider=root.document.createElement('span')
66
+ title.dataset.streamTitle='';detail.dataset.streamDetail='';title.className=desktop?'ds-setting-name':'setting-name';detail.className=desktop?'ds-setting-desc':'setting-desc'
67
+ input.type='checkbox';input.id='opt-weak-stream-off';label.className=desktop?'ds-switch':'switch';slider.className=desktop?'ds-slider':'slider'
68
+ label.append(input,slider);copy.append(title,detail);streamRow.append(copy,label)
69
+ const target=panel.querySelector('[data-workflow-settings-slot="input"]')||panel
70
+ target.append(streamRow)
71
+ const section=target.closest?.('.workflow-settings-section');if(section)section.hidden=false
72
+ input.addEventListener('change',()=>{try{root.localStorage.setItem(STREAM_KEY,input.checked?'1':'0')}catch{};root.applyStreamPreference?.()})
47
73
  }
48
74
  const english=root.I18N?.lang==='en'
49
75
  row.querySelector('[data-network-title]').textContent=english?'Network mode':'网络模式'
50
76
  row.querySelector('[data-network-detail]').textContent=english?'Weak mode loads fewer history entries and allows longer read waits. Sending is never retried automatically.':'弱网模式减少每页历史条数、延长读取等待;发送操作不会自动重试。'
51
77
  const select=row.querySelector('select');select.setAttribute('aria-label',english?'Network mode':'网络模式');['auto','weak','normal'].forEach((v,i)=>select.options[i].textContent=(english?['Automatic','Weak network','Standard']:['自动判断','弱网优先','标准模式'])[i]);select.value=mode();root.enhanceCustomSelect?.(select);root.syncCustomSelect?.(select)
78
+ const streamInput=streamRow.querySelector('input');if(streamInput){streamInput.checked=streamSetting();streamInput.setAttribute('aria-label',english?'Disable streaming on weak networks':'弱网时关闭流式输出')}
79
+ const streamTitle=streamRow.querySelector('[data-stream-title]'),streamDetail=streamRow.querySelector('[data-stream-detail]')
80
+ if(streamTitle)streamTitle.textContent=english?'No streaming on weak networks':'弱网时关闭流式输出'
81
+ if(streamDetail)streamDetail.textContent=english?'Show only finished messages and tool results on weak networks; live thinking and calls that have not returned stay hidden.':'弱网下只显示已完成的消息和工具结果,隐藏流式思考和尚未返回的工具调用;标准网络不受影响。'
52
82
  }
53
- const api={profile,setMode,PollLoop,observeLatency:ms=>{if(Number.isFinite(ms))measuredLatency=ms},preferences}
83
+ const api={profile,setMode,PollLoop,shareRead,observeLatency:ms=>{if(Number.isFinite(ms))measuredLatency=ms},preferences,streamTrimmed}
54
84
  if(typeof module!=='undefined'&&module.exports)module.exports=api
55
85
  else{root.DshNetwork=api;root.document.addEventListener('DOMContentLoaded',()=>{preferences();new MutationObserver(preferences).observe(root.document.documentElement,{attributes:true,attributeFilter:['lang']})})}
56
86
  })(typeof window==='undefined'?globalThis:window)
@@ -0,0 +1,109 @@
1
+ /* Durable write receipts. POST once, recover using GET only; zero dependencies. */
2
+ ;(function(root) {
3
+ 'use strict'
4
+ const methods = new Set(['session.create','session.prompt','session.updateQueue','session.selectModel',
5
+ 'session.rename','session.cancel','workspace.create','workspace.archiveSession',
6
+ 'goal.edit','goal.pause','goal.resume','goal.complete','goal.clear'])
7
+ const pending = new Map()
8
+ const storageKey = 'dshRemoteOperationReceiptsV1'
9
+ function saved() { try { return JSON.parse(root.localStorage?.getItem(storageKey) || '[]').filter(row => Date.now()-row.createdAt<86400000).slice(-100) } catch { return [] } }
10
+ function persist() {
11
+ const rows=new Map(saved().map(row=>[row.id,row]))
12
+ for(const row of pending.values())rows.set(row.id,{id:row.id,scope:row.scope,intent:row.intent,method:row.method,sessionId:row.sessionId,createdAt:row.createdAt})
13
+ try { root.localStorage?.setItem(storageKey,JSON.stringify([...rows.values()].slice(-100))) } catch {}
14
+ root.dispatchEvent?.(new Event('dsh-operation-change'))
15
+ }
16
+ function forget(id) {
17
+ pending.delete(id)
18
+ try { root.localStorage?.setItem(storageKey,JSON.stringify(saved().filter(row=>row.id!==id))) } catch {}
19
+ root.dispatchEvent?.(new Event('dsh-operation-change'))
20
+ }
21
+ async function digest(value) {
22
+ const input=new TextEncoder().encode(value)
23
+ if(root.crypto?.subtle) {
24
+ const bytes=await root.crypto.subtle.digest('SHA-256',input)
25
+ return [...new Uint8Array(bytes)].map(n=>n.toString(16).padStart(2,'0')).join('')
26
+ }
27
+ // LAN HTTP does not expose SubtleCrypto. Reuse the existing upload hasher.
28
+ if(typeof root.SHA256==='function')return new root.SHA256().update(input).hex()
29
+ throw new Error('SHA-256 unavailable')
30
+ }
31
+ function newId() {
32
+ if(root.crypto.randomUUID)return root.crypto.randomUUID()
33
+ return [...root.crypto.getRandomValues(new Uint8Array(16))].map(n=>n.toString(16).padStart(2,'0')).join('')
34
+ }
35
+ async function restore(config) {
36
+ const scope=await digest(config.url('/api/operations')+'\0'+config.headers.authorization)
37
+ if(!config.valid())return scope
38
+ for(const row of saved())if(row.scope===scope&&!pending.has(row.id))pending.set(row.id,{...row,phase:'unknown',config})
39
+ for(const row of pending.values())if(row.scope===scope)row.config=config
40
+ return scope
41
+ }
42
+ const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))
43
+ function unknown(id) {
44
+ const error = new Error((root.I18N?.lang === 'en' ? 'Result unconfirmed. Check the conversation before sending again. Operation: ' : '结果未确认,请核对会话后再决定是否重发。操作编号:') + id)
45
+ error.operationId = id; error.operationPending = true
46
+ return error
47
+ }
48
+ async function execute(config) {
49
+ const scope=await restore(config),intent=await digest(JSON.stringify([config.method,config.payload]))
50
+ if(!config.valid())throw unknown('connection-changed')
51
+ const existing=[...pending.values()].find(row=>row.scope===scope&&row.intent===intent)
52
+ const id = existing?.id || newId(), createdAt = Date.now()
53
+ const entry = existing || { id, scope, intent, method: config.method, sessionId: config.payload.sessionId || '', createdAt, phase: 'running', config }
54
+ pending.set(id, entry)
55
+ persist()
56
+ const statusUrl = config.url('/api/operations?id=' + encodeURIComponent(id))
57
+ const request = async (method, body) => {
58
+ const response = await root.fetch(statusUrl, { method, headers: config.headers,
59
+ ...(body ? { body: JSON.stringify(body) } : {}), signal: AbortSignal.timeout(15000) })
60
+ if (!config.valid()) throw unknown(id)
61
+ if (response.status === 401) throw Error('AUTH')
62
+ const value = await response.json()
63
+ if (!config.valid()) throw unknown(id)
64
+ if (response.status >= 400) {
65
+ if (response.status >= 500) throw unknown(id)
66
+ if (method === 'GET' && response.status === 404) throw unknown(id)
67
+ const error = new Error(value.error || ('HTTP ' + response.status)); error.rpcRejected = true; throw error
68
+ }
69
+ return value
70
+ }
71
+ let status
72
+ try {
73
+ try { status = existing ? await request('GET') : await request('POST', { method: config.method, payload: config.payload }) }
74
+ catch (error) { if (error.message === 'AUTH' || error.rpcRejected || !config.valid()) throw error }
75
+ for (let attempt = 0; config.valid() && Date.now() - createdAt < 90000; attempt++) {
76
+ if (status?.phase === 'complete' || status?.phase === 'rejected') {
77
+ entry.phase = status.phase; forget(id)
78
+ return status.result
79
+ }
80
+ if (status?.phase === 'unknown') { entry.phase = 'unknown'; throw unknown(id) }
81
+ await sleep(Math.min(3000, 400 + attempt * 250))
82
+ try { status = await request('GET') }
83
+ catch (error) { if (error.message === 'AUTH' || error.rpcRejected) throw error }
84
+ }
85
+ throw unknown(id)
86
+ } catch (error) {
87
+ if (error.rpcRejected || error.message === 'AUTH') forget(id)
88
+ else entry.phase = 'unknown'
89
+ persist()
90
+ throw error
91
+ }
92
+ }
93
+ async function check(id) {
94
+ const entry = pending.get(id)
95
+ if (!entry || !entry.config.valid()) return null
96
+ const response = await root.fetch(entry.config.url('/api/operations?id=' + encodeURIComponent(id)), {
97
+ headers: entry.config.headers, signal: AbortSignal.timeout(15000) })
98
+ if (!entry.config.valid()) return null
99
+ const value = await response.json()
100
+ if (!entry.config.valid()) return null
101
+ if (response.ok) { entry.phase = value.phase; if (['complete','rejected'].includes(value.phase)) forget(id) }
102
+ return response.ok ? value : null
103
+ }
104
+ const api = { supports: method => methods.has(method), execute, check, restore,
105
+ dismiss: id => { const row=pending.get(id);if(!row||row.phase!=='unknown'||!row.config.valid())return false;forget(id);return true },
106
+ pending: () => [...pending.values()].filter(row => row.config.valid()).map(({id,method,sessionId,createdAt,phase}) => ({id,method,sessionId,createdAt,phase})) }
107
+ root.DshOperations = api
108
+ if (typeof module !== 'undefined') module.exports = api
109
+ })(typeof window === 'undefined' ? globalThis : window)
@@ -0,0 +1,2 @@
1
+ .relay-settings{margin:18px 0;padding:20px;border:1px solid var(--dsr-line,var(--border,#ffffff20));border-radius:16px;background:var(--dsr-panel,var(--bg-card,transparent));color:inherit;min-width:0}
2
+ .relay-settings [hidden]{display:none!important}.relay-heading,.relay-address,.relay-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.relay-heading{justify-content:space-between}.relay-heading h3{font-size:16px;line-height:1.4;margin:0}.relay-badge{font-size:12px;padding:5px 9px;border-radius:20px;background:#77889920}.relay-badge[data-phase=online]{background:#36b48522;color:var(--success,#35b58a)}.relay-badge[data-phase=quota-exceeded],.relay-badge[data-phase=error]{background:#da704522;color:var(--warning,#d98758)}.relay-muted{font-size:12px;line-height:1.65;opacity:.7;margin:10px 0}.relay-status,.relay-notice,.relay-quota p{font-size:13px;line-height:1.6}.relay-address{padding:12px 0}.relay-address a{color:var(--dsr-accent,var(--accent,#6ea9e8));overflow-wrap:anywhere;flex:1;min-width:120px}.relay-form{display:grid;gap:12px;padding:12px 0}.relay-form label{display:grid;gap:7px;font-size:13px}.relay-form input{width:100%;box-sizing:border-box;min-height:44px;border:1px solid var(--dsr-line,var(--border,#ffffff25));background:transparent;color:inherit;border-radius:9px;padding:10px 12px;font:inherit}.relay-settings button{min-height:44px;border:1px solid var(--dsr-line,var(--border,#ffffff25));border-radius:9px;padding:9px 14px;font:inherit;font-size:13px;cursor:pointer;background:transparent;color:inherit}.relay-settings .relay-primary{background:var(--dsr-accent,var(--accent,#527dab));color:var(--dsr-bg,#fff);justify-self:start;border-color:transparent}.relay-settings button:disabled{opacity:.5;cursor:default}.relay-settings :focus-visible{outline:2px solid var(--dsr-accent,var(--accent,#6ea9e8));outline-offset:3px}.relay-quota progress{display:block;width:100%;height:7px;accent-color:var(--dsr-accent,var(--accent,#6ea9e8))}.relay-notice:empty{display:none}.relay-notice{padding:10px 12px;border-radius:9px;background:#71839c16}.relay-actions{margin-top:6px}@media(max-width:480px){.relay-settings{padding:16px}.relay-heading{align-items:flex-start}.relay-address{align-items:flex-start}.relay-form .relay-primary{width:100%;justify-self:stretch}}
@@ -0,0 +1,128 @@
1
+ /* Shared settings for the host-owned relay; no credentials enter browser storage. */
2
+ ;(function(root) {
3
+ 'use strict'
4
+ const text = (zh, en) => root.I18N?.lang === 'en' ? en : zh
5
+ const el = (tag, cls, value) => { const node=document.createElement(tag);if(cls)node.className=cls;if(value)node.textContent=value;return node }
6
+ const messages = {
7
+ INVALID_AUTHORIZATION:['中转密钥无效或已到期,请核对运营者发给你的密钥。','The relay key is invalid or expired.'],
8
+ HOST_ALREADY_BOUND:['此密钥已绑定其他主机,请申请新的密钥。','This key is already bound to another host.'],
9
+ RELAY_ADMIN_REQUIRED:['开通或停用需要此主机的管理令牌。','The host admin token is required.'],
10
+ ENROLLMENT_CONNECTION_FAILED:['暂时无法连接中转服务器,密钥未保存到浏览器。','The relay server is unreachable. The key was not saved in the browser.'],
11
+ GATEWAY_UNAVAILABLE:['请先在主机上启动 Remote 网关。','Start the Remote gateway on the host first.'],
12
+ RELAY_OPERATION_BUSY:['主机正在处理上一次操作,请稍后刷新状态。','The previous operation is still running. Refresh shortly.'],
13
+ unauthorized:['请先连接主机,再设置云服务器中转。','Connect to your host before configuring its relay.'],
14
+ INVALID_RESPONSE:['主机返回了无法识别的中转状态,请检查连接地址和主机 Remote 版本。','Unrecognized relay response. Check the host URL and Remote version.'],
15
+ UNSUPPORTED_GATEWAY:['此主机尚不支持云中转设置,请更新主机 Remote。','Update the host Remote to use cloud relay settings.'],
16
+ }
17
+ function mount(target, { connection, path = '/relay', credentials } = {}) {
18
+ if (!target || target.dataset.relayMounted) return
19
+ target.dataset.relayMounted='true';target.classList.add('relay-settings')
20
+ const heading=el('div','relay-heading'),title=el('h3'),badge=el('span','relay-badge')
21
+ heading.append(title,badge)
22
+ const intro=el('p','relay-muted'),status=el('p','relay-status');status.setAttribute('aria-live','polite')
23
+ const address=el('div','relay-address'),link=el('a'),copy=el('button');copy.type='button';link.target='_blank';link.rel='noopener noreferrer';address.append(link,copy)
24
+ const quota=el('div','relay-quota'),meter=el('progress'),usage=el('p'),reset=el('p','relay-muted');meter.max=100;quota.append(usage,meter,reset)
25
+ const binding=el('p','relay-muted'),form=el('form','relay-form'),keyLabel=el('label'),keyInput=el('input')
26
+ keyInput.type='password';keyInput.autocomplete='off';keyInput.spellcheck=false;keyInput.maxLength=128;keyInput.name='relay-key'
27
+ keyLabel.append(el('span'),keyInput)
28
+ const adminLabel=el('label'),adminInput=el('input');adminInput.type='password';adminInput.autocomplete='off';adminInput.name='relay-admin';adminLabel.append(el('span'),adminInput)
29
+ const submit=el('button','relay-primary');submit.type='submit';form.append(keyLabel,adminLabel,submit)
30
+ const actions=el('div','relay-actions'),toggle=el('button'),refresh=el('button'),takeover=el('button');toggle.type=refresh.type=takeover.type='button';actions.append(takeover,toggle,refresh)
31
+ const hint=el('p','relay-muted'),notice=el('p','relay-notice');notice.setAttribute('role','status')
32
+ target.append(heading,intro,status,address,quota,binding,form,actions,hint,notice)
33
+ let identity='',value=null,lastRead=0,busy=false,loading=false,controller=null,destroyed=false,readError=false,failures=0
34
+ function context() { const ctx=connection();return { ...ctx, endpoint:ctx.url(path) } }
35
+ function current(ctx) { return !destroyed && ctx.valid() && identity===JSON.stringify([ctx.endpoint,ctx.headers?.authorization||'']) }
36
+ function syncIdentity() {
37
+ const ctx=context(),next=JSON.stringify([ctx.endpoint,ctx.headers?.authorization||''])
38
+ if(next!==identity){identity=next;controller?.abort();controller=null;keyInput.value='';adminInput.value='';value=null;notice.textContent='';lastRead=0;loading=false;busy=false;readError=false;failures=0;render()}
39
+ return ctx
40
+ }
41
+ function render() {
42
+ title.textContent=text('云服务器中转','Cloud relay')
43
+ intro.textContent=text('让手机通过公网连接这台主机。每位用户使用自己的中转密钥,首次开通会绑定此主机。','Connect to this host over the internet. Your personal relay key binds to this host when activated.')
44
+ const phase=value?.phase||(readError?'unavailable':loading?'loading':'unconfigured')
45
+ const names={loading:['正在读取','Loading'],unavailable:['状态读取失败','Status unavailable'],unconfigured:['尚未开通','Not configured'],disabled:['已停用','Disabled'],connecting:['正在连接','Connecting'],online:['已连接','Connected'],reconnecting:['正在重连','Reconnecting'],expired:['授权已到期','Expired'],'authorization-inactive':['授权已撤销或到期','Authorization inactive'],'quota-exceeded':['今日流量已用完','Daily quota reached'],'quota-unavailable':['流量服务暂不可用','Quota service unavailable'],error:['连接异常','Connection error']}
46
+ badge.textContent=text(...(names[phase]||names.error));badge.dataset.phase=phase
47
+ status.textContent=busy?text('正在保存并绑定,请稍候…','Saving and binding…'):value?.error?text('请检查主机配置或刷新状态。','Check the host configuration or refresh.'):text('开通后会随 Remote 网关启动,无需单独运行工具。','Starts with the Remote gateway after activation.')
48
+ let safeUrl=''
49
+ try { const url=new URL(value?.publicUrl);if(url.protocol==='https:'&&!url.username&&!url.password)safeUrl=url.origin } catch {}
50
+ address.hidden=!safeUrl;link.textContent=safeUrl;link.href=safeUrl||'#';copy.textContent=text('复制地址','Copy URL')
51
+ const daily=value?.daily
52
+ quota.hidden=!daily
53
+ if(daily?.unavailable){usage.textContent=text('无法确认今日额度,云端暂停传输。','Quota unavailable; cloud transfer is paused.');meter.hidden=true;reset.textContent=''}
54
+ else if(daily){
55
+ meter.hidden=false;meter.value=Math.min(100,Math.max(0,Number(daily.usedBytes)/Number(daily.limitBytes)*100))
56
+ const gb=bytes=>(Math.max(0,Number(bytes)||0)/1e9).toFixed(2)
57
+ usage.textContent=text(`今日已用 ${gb(daily.usedBytes)} / ${gb(daily.limitBytes)} GB · 剩余 ${gb(daily.remainingBytes)} GB`,`Today ${gb(daily.usedBytes)} / ${gb(daily.limitBytes)} GB · ${gb(daily.remainingBytes)} GB left`)
58
+ reset.textContent=text('上传与下载合计;北京时间每天 00:00 重置。','Uploads + downloads; resets daily at 00:00 Beijing time.')
59
+ }
60
+ const expires=value?.expiresAt?new Date(value.expiresAt).toLocaleString():''
61
+ binding.textContent=value?.fingerprint?text(`已绑定此主机 · ${value.fingerprint.slice(0,12)}${expires?' · 有效期至 '+expires:''}`,`Bound to this host · ${value.fingerprint.slice(0,12)}${expires?' · Until '+expires:''}`):''
62
+ keyLabel.firstChild.textContent=text(value?.configured?'更换个人中转密钥':'个人中转密钥',value?.configured?'Replace personal relay key':'Personal relay key')
63
+ keyInput.placeholder='dsrp_…';keyInput.setAttribute('aria-label',keyLabel.firstChild.textContent)
64
+ adminLabel.hidden=value?.canManage!==false
65
+ adminLabel.firstChild.textContent=text('主机管理令牌(仅本次操作)','Host admin token (this operation only)')
66
+ adminInput.setAttribute('aria-label',adminLabel.firstChild.textContent)
67
+ submit.textContent=busy?text('正在处理…','Working…'):text(value?.configured?'绑定新密钥':'绑定并开启',value?.configured?'Bind new key':'Bind and enable')
68
+ submit.disabled=busy||!value;keyInput.disabled=busy;adminInput.disabled=busy
69
+ toggle.hidden=!value?.configured;toggle.disabled=busy;toggle.textContent=text(value?.enabled?'停用中转':'开启中转',value?.enabled?'Disable relay':'Enable relay')
70
+ refresh.textContent=text('刷新状态','Refresh');refresh.disabled=busy||loading
71
+ takeover.hidden=!value?.legacyAvailable;takeover.disabled=busy;takeover.textContent=text('接管已有试用连接','Take over existing trial')
72
+ hint.textContent=value?.quotaPending?text('等待云端确认今日额度…','Waiting for cloud quota…'):text('手机使用此公网地址和原 Remote 访问令牌。停用会断开通过此入口的连接;授权到期或用满后,请通过本地地址管理。','Use this URL and your existing Remote access token. Disabling disconnects this route; use a local address after expiry or quota exhaustion.')
73
+ }
74
+ async function load(force=false) {
75
+ const ctx=syncIdentity()
76
+ if(ctx.connected===false){notice.textContent=text('请先连接主机,再查看中转状态。','Connect to your host to read relay status.');return}
77
+ if(busy||loading||!force&&(document.hidden||!target.getClientRects().length||Date.now()-lastRead<Math.min(60000,5000*2**Math.min(failures,4))))return
78
+ loading=true;lastRead=Date.now();const abort=new AbortController();controller=abort
79
+ const timeout=Math.max(15000,root.DshNetwork?.profile().readTimeout||30000)
80
+ const timer=setTimeout(()=>abort.abort(),timeout)
81
+ render()
82
+ try {
83
+ const response=await root.fetch(ctx.endpoint,{headers:ctx.headers,credentials,cache:'no-store',signal:abort.signal})
84
+ let data
85
+ try{data=await response.json()}catch{throw Object.assign(Error('INVALID_RESPONSE'),{code:'INVALID_RESPONSE',status:response.status})}
86
+ if(!current(ctx))return
87
+ if(response.status===429&&data.daily){value={phase:'quota-exceeded',daily:data.daily,configured:false};notice.textContent=text('今日额度已用完。请用主机本地地址进入设置,或等待零点恢复。','Daily quota reached. Use the local host address or wait until reset.');return}
88
+ if(!response.ok)throw Object.assign(Error(data.error||'HTTP_'+response.status),{code:data.error,status:response.status})
89
+ if(data.supported!==true)throw Object.assign(Error('UNSUPPORTED_GATEWAY'),{code:'UNSUPPORTED_GATEWAY'})
90
+ value=data;notice.textContent='';readError=false;failures=0
91
+ }catch(error){
92
+ if(current(ctx)&&!busy&&controller===abort){
93
+ readError=true;failures++
94
+ notice.textContent=error.status===401?text('访问令牌无效,请在主机与连接中重新连接。','Invalid access token. Reconnect in Hosts and connections.'):error.status===404?text('请将此主机 Remote 升级到 0.8.0-rc.2 或更新版本后使用。','Upgrade this host Remote to 0.8.0-rc.2 or later.'):messages[error.code]?text(...messages[error.code]):abort.signal.aborted?text('读取中转状态超时,请检查网络后刷新。','Relay status timed out. Check the network and refresh.'):text('暂时无法连接主机读取中转状态,可稍后刷新。','Cannot reach the host for relay status. Refresh shortly.')
95
+ }
96
+ }finally{clearTimeout(timer);if(current(ctx)&&controller===abort){loading=false;render()}}
97
+ }
98
+ async function change(action) {
99
+ const ctx=syncIdentity();if(busy)return
100
+ const key=keyInput.value.trim(),admin=adminInput.value.trim()
101
+ if(action==='enroll'&&!/^dsrp_[a-f0-9]{16}\.[A-Za-z0-9_-]{43}$/.test(key)){notice.textContent=text('请填写完整的个人中转密钥。','Enter the complete personal relay key.');return}
102
+ busy=true;controller?.abort();loading=false;notice.textContent='';render()
103
+ const abort=new AbortController();controller=abort;const timer=setTimeout(()=>abort.abort(),20000)
104
+ // Clear immediately, including ambiguous network outcomes. Never store the key.
105
+ keyInput.value='';adminInput.value=''
106
+ try {
107
+ const response=await root.fetch(ctx.endpoint,{method:'POST',headers:{...ctx.headers,...(admin?{authorization:'Bearer '+admin}:{}),'content-type':'application/json'},credentials,body:JSON.stringify({action,...(action==='enroll'?{key}:{})}),signal:abort.signal})
108
+ const data=await response.json();if(!current(ctx))return
109
+ if(!response.ok)throw Object.assign(Error(data.error),{code:data.error})
110
+ value=data;notice.textContent=text(action==='disable'?'中转已停用。':'设置已保存,正在确认云端连接。',action==='disable'?'Relay disabled.':'Saved. Confirming the cloud connection.')
111
+ }catch(error){if(current(ctx))notice.textContent=messages[error.code]?text(...messages[error.code]):text('暂时无法确认操作结果。请刷新状态后再决定是否重试。','Result unconfirmed. Refresh status before deciding whether to retry.')}
112
+ finally{clearTimeout(timer);if(current(ctx)){busy=false;lastRead=0;render()}}
113
+ }
114
+ form.addEventListener('submit',event=>{event.preventDefault();void change('enroll')})
115
+ toggle.addEventListener('click',()=>void change(value?.enabled?'disable':'enable'))
116
+ takeover.addEventListener('click',()=>void change('import'))
117
+ refresh.addEventListener('click',()=>void load(true))
118
+ copy.addEventListener('click',async()=>{
119
+ const ctx=syncIdentity(),url=link.href
120
+ try{await root.navigator.clipboard.writeText(url);if(current(ctx))notice.textContent=text('地址已复制。','URL copied.')}
121
+ catch{if(current(ctx))notice.textContent=text('请选中上方地址复制。','Select the URL above to copy it.')}
122
+ })
123
+ function tick(){if(destroyed)return;syncIdentity();render();void load()}
124
+ const timer=setInterval(tick,1000);tick()
125
+ return { refresh:()=>load(true),destroy:()=>{destroyed=true;clearInterval(timer);controller?.abort();keyInput.value='';adminInput.value=''} }
126
+ }
127
+ root.DshRelaySettings={mount}
128
+ })(typeof window!=='undefined'?window:globalThis)
package/public/styles.css CHANGED
@@ -868,9 +868,9 @@ button.overview-attention-item, button.overview-session-item { cursor:pointer; }
868
868
  .about { text-align: center; color: var(--dsr-muted); font-size: 12px; margin-top: 16px; line-height: 1.8; }
869
869
 
870
870
  /* 多服务器列表(分组) */
871
- .group-bar { display: flex; align-items: center; gap: 8px; padding: 0 14px 10px; }
872
- .group-bar-label { font-size: 12px; color: var(--dsr-muted); white-space: nowrap; }
873
- .group-select { flex: 1; min-width: 0; position: relative; }
871
+ .group-bar { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; padding: 0 14px 10px; }
872
+ .group-bar-label { flex-shrink: 0; font-size: 12px; color: var(--dsr-muted); white-space: nowrap; }
873
+ .group-select { flex: 1 1 auto; min-width: 0; position: relative; }
874
874
  .group-select-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px; background: var(--dsr-bg-2); color: var(--dsr-text); border: 1px solid var(--dsr-line); border-radius: 10px; padding: 7px 9px; font: inherit; font-size: 13px; outline: none; cursor: pointer; }
875
875
  .group-select-btn .caret { color: var(--dsr-muted); font-size: 10px; transition: transform .15s ease; }
876
876
  .group-select-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; max-height: 220px; overflow-y: auto; background: var(--dsr-panel); border: 1px solid var(--dsr-line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.28); padding: 4px; display: flex; flex-direction: column; gap: 2px; }
@@ -880,9 +880,10 @@ button.overview-attention-item, button.overview-session-item { cursor:pointer; }
880
880
  .server-list { padding: 0 14px 10px; display: flex; flex-direction: column; gap: 6px; }
881
881
  .server-empty { font-size: 12px; color: var(--dsr-muted); }
882
882
  .srv-group { border: 1px solid var(--dsr-line); border-radius: 12px; background: var(--dsr-panel); overflow: hidden; }
883
- .srv-group-head { display: flex; align-items: center; gap: 6px; padding: 7px 9px; }
884
- .srv-group-name { flex: 1; min-width: 0; text-align: left; background: none; border: none; color: var(--dsr-text); font: inherit; font-size: 13px; font-weight: 600; padding: 2px 0; display: flex; align-items: center; gap: 6px; }
885
- .srv-group-count { font-size: 10.5px; color: var(--dsr-muted); background: var(--dsr-bg-2); border-radius: 999px; padding: 0 7px; line-height: 16px; }
883
+ .srv-group-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px; }
884
+ .srv-group-name { flex: 1 1 auto; min-width: 0; text-align: left; background: none; border: none; color: var(--dsr-text); font: inherit; font-size: 13px; font-weight: 600; padding: 2px 0; display: flex; align-items: center; gap: 6px; }
885
+ .srv-group-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
886
+ .srv-group-count { flex-shrink: 0; font-size: 10.5px; color: var(--dsr-muted); background: var(--dsr-bg-2); border-radius: 999px; padding: 0 7px; line-height: 16px; }
886
887
  .srv-group-speed { flex-shrink: 0; padding: 3px 8px; font-size: 12px; }
887
888
  .srv-group-del { flex-shrink: 0; width: 22px; height: 22px; border-radius: 7px; background: var(--dsr-panel); border: 1px solid var(--dsr-line); color: var(--dsr-muted); font-size: 11px; }
888
889
  .srv-group-del:active { color: var(--dsr-error); }
@@ -891,25 +892,24 @@ button.overview-attention-item, button.overview-session-item { cursor:pointer; }
891
892
  .switch.small .slider::before { width: 15px; height: 15px; left: 2px; top: 2px; }
892
893
  .switch.small input:checked + .slider::before { transform: translateX(15px); }
893
894
  .server-row {
894
- display: flex; align-items: center; gap: 8px;
895
+ display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 5px 6px;
895
896
  background: var(--dsr-bg-2); border: 1px solid var(--dsr-line); border-radius: 10px;
896
- padding: 8px 10px;
897
+ padding: 9px 8px 9px 11px;
897
898
  }
898
899
  .server-row.active { border-color: var(--dsr-info-line); background: var(--dsr-info-soft); }
899
- .server-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
900
- .server-note { font-size: 13px; word-break: break-all; }
901
- .server-url { flex: 1; min-width: 0; font-size: 11.5px; color: var(--dsr-muted); word-break: break-all; }
902
- .server-token-badge { color: var(--dsr-muted); font-size: 10px; }
900
+ .server-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
901
+ .server-note { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; min-width: 0; font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
902
+ .server-url { min-width: 0; font-size: 11.5px; line-height: 1.4; color: var(--dsr-muted); overflow-wrap: anywhere; }
903
903
  .server-badge {
904
- flex-shrink: 0; font-size: 11px; padding: 1px 7px; border-radius: 999px;
904
+ justify-self: end; flex-shrink: 0; min-width: 52px; text-align: center; font-size: 10.5px; padding: 1px 6px; border-radius: 999px;
905
905
  background: var(--dsr-accent-soft); color: var(--dsr-accent-strong);
906
906
  border: 1px solid var(--dsr-accent-line); white-space: nowrap;
907
907
  }
908
908
  .server-badge.good { background: var(--dsr-success-soft); color: var(--dsr-success); border-color: var(--dsr-success-line); }
909
909
  .server-badge.bad { background: var(--dsr-warning-soft); color: var(--dsr-warning); border-color: var(--dsr-warning-line); }
910
910
  .server-edit, .server-del {
911
- flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px;
912
- background: var(--dsr-panel); border: 1px solid var(--dsr-line); color: var(--dsr-muted); font-size: 12px;
911
+ flex-shrink: 0; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
912
+ background: var(--dsr-panel); border: 1px solid var(--dsr-line); color: var(--dsr-muted); font-size: 13px;
913
913
  }
914
914
  .server-edit:active { color: var(--dsr-accent-strong); }
915
915
  .server-del:active { color: var(--dsr-error); }
@@ -0,0 +1,61 @@
1
+ .subagent-page{position:fixed;inset:0;box-sizing:border-box;width:100%;height:100%;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;border-radius:0;background:var(--dsr-bg);color:var(--dsr-text);overflow:hidden}
2
+ .subagent-page[open]{display:flex;flex-direction:column}.subagent-page::backdrop{background:var(--dsr-bg)}
3
+ .subagent-page-head{flex:none;display:flex;align-items:center;gap:22px;padding:max(16px,var(--dsr-safe-top,0px)) max(24px,env(safe-area-inset-right)) 16px max(24px,env(safe-area-inset-left));border-bottom:1px solid var(--dsr-line);background:var(--dsr-panel)}
4
+ .subagent-page-heading{min-width:0}.subagent-page-head h2{margin:5px 0 0;font-size:19px;font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
5
+ .subagent-page-back,.subtree button{font:inherit;cursor:pointer;color:inherit}
6
+ .subagent-page-back{flex:none;min-height:44px;border:1px solid var(--dsr-line);border-radius:10px;background:var(--dsr-bg-2);padding:8px 13px;font-size:13px}
7
+ .subagent-page-content{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:24px max(24px,env(safe-area-inset-right)) max(24px,var(--dsr-safe-b,0px)) max(24px,env(safe-area-inset-left))}
8
+ .subtree{max-width:1280px;margin-inline:auto;font-size:13px;line-height:1.5}
9
+ .subtree-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:12px}
10
+ .subtree-search{flex:1 1 240px;min-width:0;max-width:400px;box-sizing:border-box;min-height:44px;border:1px solid var(--dsr-line);border-radius:10px;padding:10px 13px;background:var(--dsr-panel);color:var(--dsr-text);font:inherit;font-size:14px}
11
+ .subtree-search::placeholder{color:var(--dsr-muted)}
12
+ .subtree-filters{display:flex;gap:3px;padding:3px;border:1px solid var(--dsr-line);border-radius:11px;background:var(--dsr-bg-2)}
13
+ .subtree-filters button{min-height:38px;border:0;border-radius:7px;background:transparent;padding:7px 12px;color:var(--dsr-muted);font-size:12px}
14
+ .subtree-filters button[aria-pressed=true]{background:var(--dsr-accent-soft);color:var(--dsr-accent-strong);box-shadow:inset 0 0 0 1px var(--dsr-accent-line)}
15
+ .subtree-toolbar-actions{display:flex;align-items:center;gap:8px;margin-inline-start:auto}
16
+ .subtree-quiet,.subtree-action{min-height:44px;padding:9px 12px;border:1px solid var(--dsr-line);border-radius:9px;background:var(--dsr-panel);font-size:12px!important}
17
+ .subtree button:disabled{opacity:.6;cursor:default}
18
+ .subtree-summary{display:flex;flex-wrap:wrap;gap:6px 18px;margin:15px 0;color:var(--dsr-muted);font-size:12px;font-variant-numeric:tabular-nums}
19
+ .subtree-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;align-items:start;gap:24px}
20
+ .subtree-outline{min-width:0;padding:20px 16px;background:var(--dsr-bg-2);border:1px solid var(--dsr-line);border-radius:16px}
21
+ .subtree-list{list-style:none;padding:0 0 0 22px;margin:0 0 0 21px;border-inline-start:1px solid var(--dsr-divider)}
22
+ .subtree-root-list{padding:0;margin:0;border:0}.subtree-list>li{position:relative;padding-block:6px}
23
+ .subtree-list:not(.subtree-root-list)>li::before{content:'';position:absolute;inset-inline-start:-22px;top:37px;width:22px;border-top:1px solid var(--dsr-divider)}
24
+ .subtree-row{display:flex;align-items:center;gap:4px;min-width:0}
25
+ .subtree-disclosure,.subtree-leaf{flex:none;display:flex;align-items:center;justify-content:center;width:36px;min-height:44px;border:0;border-radius:8px;background:transparent;font-size:22px!important;color:var(--dsr-muted)!important}
26
+ .subtree-node{display:block;flex:1;min-width:0;width:100%;text-align:start;border:1px solid var(--dsr-line);border-radius:11px;padding:11px 13px;background:var(--dsr-panel);transition:border-color .15s,background .15s}
27
+ .subtree-node:hover{border-color:var(--dsr-accent-line);background:var(--dsr-panel-2)}
28
+ .subtree-node[aria-pressed=true]{border-color:var(--dsr-accent);background:var(--dsr-accent-soft);box-shadow:0 0 0 1px var(--dsr-accent-line)}
29
+ .subtree-node-head{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:0}
30
+ .subtree-node-head strong{min-width:0;font-size:14px;font-weight:600;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
31
+ .subtree-node-meta{display:flex;flex-wrap:wrap;gap:3px 12px;margin-top:5px;font-size:11px;color:var(--dsr-muted)}
32
+ .subtree-badge{display:inline-flex;align-items:center;gap:5px;flex:none;white-space:nowrap;border-radius:6px;padding:3px 7px;background:var(--dsr-panel-2);color:var(--dsr-muted);font-size:11px;font-weight:500}
33
+ .subtree-badge::before{content:'·';font-size:18px;line-height:10px}.subtree-badge[data-activity=running]{color:var(--dsr-accent-strong);background:var(--dsr-accent-soft)}
34
+ .subtree-badge[data-activity=waiting],.subtree-badge[data-activity=diagnostic]{color:var(--dsr-warning);background:var(--dsr-warning-soft)}
35
+ .subtree-badge[data-activity=diagnostic]::before{content:'!';font-size:11px}
36
+ .subtree-detail{position:sticky;top:0;min-width:0;padding:21px;border:1px solid var(--dsr-line);border-radius:16px;background:var(--dsr-panel)}
37
+ .subtree-eyebrow{font-size:11px;color:var(--dsr-muted);letter-spacing:.06em}.subtree-detail h3{font-size:18px;line-height:1.4;margin:9px 0 12px;overflow-wrap:anywhere}
38
+ .subtree-detail-badges{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:20px}.subtree-kind{font-size:11px;color:var(--dsr-muted)}
39
+ .subtree-field-label{margin-top:16px;font-size:11px;color:var(--dsr-muted)}.subtree-path{font-size:12px;line-height:1.7;margin:5px 0 0;overflow-wrap:anywhere}
40
+ .subtree-id{display:block;font-size:11px;line-height:1.6;margin-top:6px;padding:8px;border-radius:7px;background:var(--dsr-code-bg);overflow-wrap:anywhere;user-select:text}
41
+ .subtree-parent{max-width:100%;min-width:44px;min-height:44px;text-align:start;overflow-wrap:anywhere;padding:4px 0;border:0;background:transparent;color:var(--dsr-accent-strong)!important;font-size:12px!important}
42
+ .subtree-detail-actions{display:flex;flex-direction:column;gap:9px;margin-top:22px}.subtree-action{text-align:center}
43
+ .subtree-primary{background:var(--dsr-accent)!important;color:var(--dsr-on-accent)!important;border-color:var(--dsr-accent)!important;font-weight:650!important}
44
+ .subtree-danger{color:var(--dsr-warning)!important;border-color:var(--dsr-warning-line)!important;background:var(--dsr-warning-soft)!important}
45
+ .subtree-note{font-size:11px;color:var(--dsr-muted);line-height:1.7;margin:13px 0 0;overflow-wrap:anywhere}
46
+ .subtree-notice{padding:12px;border:1px solid var(--dsr-warning-line);border-radius:9px;background:var(--dsr-warning-soft);color:var(--dsr-warning);font-size:12px;line-height:1.65}
47
+ .subtree-reason{font-size:11px;color:var(--dsr-muted);display:block;margin-bottom:16px;overflow-wrap:anywhere}
48
+ .subtree-feedback{list-style:none;padding:18px!important;margin:8px 0;border:1px dashed var(--dsr-divider);border-radius:10px;color:var(--dsr-muted);font-size:12px;overflow-wrap:anywhere}
49
+ .subtree-feedback strong{font-size:13px;color:var(--dsr-text);font-weight:500}.subtree-feedback p{margin:7px 0 10px}.subtree-warning{border-color:var(--dsr-warning-line);background:var(--dsr-warning-soft)}
50
+ .subtree-depth{color:var(--dsr-accent-strong)}.subtree :is(button,input):focus-visible,.subagent-page-back:focus-visible{outline:2px solid var(--dsr-accent);outline-offset:3px}.subtree-detail h3:focus{outline:none}
51
+ .subtree-back-to-tree{display:none}
52
+ .subagents-entry{flex:none;font:inherit;font-size:12px;color:var(--dsr-text);background:transparent;border:1px solid var(--dsr-line);border-radius:9px;min-height:44px;padding:6px 9px;cursor:pointer}
53
+ body.viewing-subagent .composer-wrap,body.viewing-subagent .ds-composer,body.viewing-subagent #btn-session-more,body.viewing-subagent #btn-rename-session,body.viewing-subagent #btn-archive-session,body.viewing-subagent #btn-cancel,body.viewing-subagent [data-goal],body.viewing-subagent #queue-dock{display:none!important}
54
+ @media(max-width:800px){.subtree-layout{grid-template-columns:minmax(0,1fr);gap:16px}.subtree-detail{position:static}.subtree-search{max-width:none}.subtree-outline{padding:12px 8px}.subtree-disclosure,.subtree-leaf{width:32px}.subtree-node{padding:10px}.subtree-node-head{align-items:start;flex-wrap:wrap;gap:5px}.subtree-node-head strong{flex:1 1 120px}.subtree-detail-actions{flex-direction:row;flex-wrap:wrap}.subtree-detail-actions>*{flex:1 1 160px}.subtree .subtree-filters button{min-height:44px}.subtree .subtree-disclosure{min-width:44px}.subtree-list .subtree-list .subtree-list .subtree-list{padding-inline-start:0;margin-inline-start:8px;border-color:transparent}.subtree-list .subtree-list .subtree-list .subtree-list>li::before{display:none}}
55
+ @media(max-width:480px){.subagent-page-head{gap:12px;padding:max(12px,var(--dsr-safe-top,0px)) 12px 12px}.subagent-page-head h2{font-size:16px}.subagent-page-content{padding:16px 12px max(16px,var(--dsr-safe-b,0px))}.subtree-toolbar{gap:10px}.subtree-search{flex-basis:100%}.subtree-toolbar-actions{gap:4px}.subtree-quiet{padding-inline:9px}.subtree-filters button{padding-inline:10px}.subtree-summary{gap:5px 12px}.subtree-list{padding-inline-start:12px;margin-inline-start:14px}.subtree-list:not(.subtree-root-list)>li::before{inset-inline-start:-12px;width:12px}.subtree-root-list{padding:0;margin:0}.subtree-node-head strong{flex-basis:100px}.subtree-detail{padding:18px}}
56
+ @media(prefers-reduced-motion:reduce){.subtree-node{transition:none}}
57
+ @media(max-width:800px){.subtree-back-to-tree{display:block;margin-bottom:8px}}
58
+ @media(max-width:800px){.subtree-leaf{min-width:44px}}
59
+ @media(max-width:800px){.subtree-search{font-size:16px}}
60
+ .subtree-list .subtree-list .subtree-list .subtree-list .subtree-list .subtree-list{padding-inline-start:0;margin-inline-start:10px;border-color:transparent}
61
+ .subtree-list .subtree-list .subtree-list .subtree-list .subtree-list .subtree-list>li::before{display:none}