dsh-lite 0.0.0-stage → 0.6.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.
@@ -0,0 +1,8 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
2
+ <rect width="64" height="64" rx="16" fill="#0a0c10"/>
3
+ <rect x="8" y="8" width="48" height="48" rx="14" fill="#4d6bfe"/>
4
+ <path d="M21 24h22a5 5 0 0 1 5 5v11a5 5 0 0 1-5 5H33l-9 6v-6h-3a5 5 0 0 1-5-5V29a5 5 0 0 1 5-5z" fill="#ffffff"/>
5
+ <circle cx="27" cy="34.5" r="2.6" fill="#4d6bfe"/>
6
+ <circle cx="34" cy="34.5" r="2.6" fill="#4d6bfe"/>
7
+ <circle cx="41" cy="34.5" r="2.6" fill="#4d6bfe"/>
8
+ </svg>
package/public/i18n.js ADDED
@@ -0,0 +1,386 @@
1
+ // Chinese source strings are the lookup keys. Keep this file dependency-free so
2
+ // the browser can load it as a plain ES module and tests can import it in Node.
3
+ export const EN_TRANSLATIONS = Object.freeze({
4
+ // Shell
5
+ '会话列表': 'Sessions',
6
+ '连接中…': 'Connecting…',
7
+ '刷新': 'Refresh',
8
+ '目标': 'Goal',
9
+ '暂停': 'Pause',
10
+ '编辑': 'Edit',
11
+ '删除': 'Delete',
12
+ '输入目标': 'Enter a goal',
13
+ '保存': 'Save',
14
+ '取消': 'Cancel',
15
+ '加载上一段': 'Load earlier',
16
+ '选择一个会话,或者新建一个。': 'Select a session or create one.',
17
+ '模型正在等待你的回答或确认。可回答的提问与审批会显示为下方卡片;更复杂的操作请在': 'The model is waiting for your answer or approval. Answerable questions and approvals appear below; use the ',
18
+ '完整页面': 'full page',
19
+ '打开完整页面(打开当前会话)': 'Open the full page (with the current session)',
20
+ '处理。': ' for more complex operations.',
21
+ '运行中…': 'Running…',
22
+ '停止': 'Stop',
23
+ '回到最新': 'Back to latest',
24
+ '最新': 'Latest',
25
+ '添加图片': 'Add image',
26
+ '图': 'IMG',
27
+ '发消息…(回车换行)': 'Message… (Enter for newline)',
28
+ '发送': 'Send',
29
+ '模型': 'Model',
30
+ '思考强度': 'Reasoning effort',
31
+ '刷新模型列表': 'Refresh model list',
32
+ '通知开': 'Alerts on',
33
+ '通知关': 'Alerts off',
34
+ '切换明暗主题': 'Toggle theme',
35
+ '新建': 'New',
36
+ '新建会话': 'New session',
37
+ '关闭': 'Close',
38
+ '文件夹': 'Folders',
39
+ '平铺': 'Flat',
40
+ '列表视图': 'List view',
41
+ '列表视图选项': 'View options',
42
+ '列表视图选项:{value}': 'View options: {value}',
43
+ '分组': 'Group by',
44
+ '工作区': 'Workspace',
45
+ '按工作区': 'Workspace',
46
+ '排序': 'Sort by',
47
+ '最近更新': 'Recent',
48
+ '创建时间': 'Created',
49
+ '标题': 'Title',
50
+ '排序方式': 'Sort by',
51
+ '切换排序': 'Change sort',
52
+ '排序:{value}': 'Sort: {value}',
53
+ '归档': 'Archived',
54
+ '隐藏': 'Hide',
55
+ '显示': 'Show',
56
+ '仅归档': 'Only archived',
57
+ '含归档': 'incl. archived',
58
+ '{total} 个会话 · 含归档': '{total} sessions · with archived',
59
+ '没有活跃会话。打开视图选项查看归档。': 'No active sessions. Open view options to see archived.',
60
+ '未分组': 'Ungrouped',
61
+ '展开 {title}': 'Expand {title}',
62
+ '折叠 {title}': 'Collapse {title}',
63
+ '展开其余 {count}': 'Show {count} more',
64
+ '收起': 'Collapse',
65
+ '新会话预设': 'New session preset',
66
+ '新会话位置': 'New session location',
67
+ '会话范围': 'Session scope',
68
+ '活跃': 'Active',
69
+ '已归档': 'Archived',
70
+ '搜索标题、目录或文件夹': 'Search titles, directories, or folders',
71
+ '加载更多': 'Load more',
72
+ 'DSH Lite · 低流量模式': 'DSH Lite · Low-data mode',
73
+ '外观': 'Appearance',
74
+ '主题': 'Theme',
75
+ '模式': 'Mode',
76
+ '浅色': 'Light',
77
+ '深色': 'Dark',
78
+ '跟随系统': 'Auto',
79
+
80
+ // Transport and images
81
+ '未登录或 cookie 已过期': 'Not signed in or cookie expired',
82
+ '请求失败': 'Request failed',
83
+ '未登录或 cookie 已过期:先在手机浏览器打开一次 DSH 完整页面(启动时打印的带 token 链接),再回来刷新。': 'Not signed in or cookie expired. Open the full DSH page once in this browser (the token URL printed at startup), then refresh.',
84
+ '移除图片 {name}': 'Remove image {name}',
85
+ '最多发送 {max} 张图片': 'You can send up to {max} images',
86
+ '正在处理图片…': 'Processing images…',
87
+ '图片处理失败': 'Image processing failed',
88
+ '最多发送 {max} 张图片,已取前 {count} 张': 'Up to {max} images; using the first {count}',
89
+ '只支持图片文件': 'Only image files are supported',
90
+ '原图超过 20 MB,请先缩小': 'The original is over 20 MB; shrink it first',
91
+ '浏览器无法读取这张图片': 'The browser could not read this image',
92
+ '图片尺寸无效': 'Invalid image dimensions',
93
+ '图片压缩失败': 'Image compression failed',
94
+ '压缩后仍超过 2 MB,请选择更小的图片': 'Still over 2 MB after compression; choose a smaller image',
95
+ '图片读取失败': 'Failed to read the image',
96
+
97
+ // Session shell and notifications
98
+ '还没有会话。点左上角 ☰ → 新建。': 'No sessions yet. Tap ☰ at top left → New.',
99
+ '加载中…': 'Loading…',
100
+ '本轮结束时提醒;页面关闭后不保证提醒': 'Alert when the turn ends; not guaranteed after closing the page',
101
+ '本轮已结束': 'Turn finished',
102
+ '模型正在等待你的回答或确认': 'The model is waiting for your answer or approval',
103
+ '已关闭完成提醒': 'Completion alerts turned off',
104
+ '浏览器不支持通知授权': 'This browser does not support notification permission',
105
+ '浏览器没有授予通知权限': 'Notification permission was not granted',
106
+ '已开启完成提醒:页面在后台时可用,关闭页面后不保证': 'Completion alerts on: works while the page is in the background; not guaranteed after closing it',
107
+ '选择或新建一个会话': 'Select or create a session',
108
+ '运行中': 'Running',
109
+ '空闲': 'Idle',
110
+ '冷会话': 'Cold session',
111
+ '正在生成回复… · {elapsed}': 'Generating reply… · {elapsed}',
112
+ '正在生成回复…': 'Generating reply…',
113
+ '会话': 'Session',
114
+
115
+ // Approvals
116
+ '需要确认': 'Needs approval',
117
+ '只批准这一次,不改变权限设置': 'Approves once without changing permissions',
118
+ '工具请求执行': 'Tool requests execution',
119
+ '查看原始原因': 'View raw reason',
120
+ '拒绝': 'Reject',
121
+ '允许一次': 'Allow once',
122
+ '允许中…': 'Allowing…',
123
+ '拒绝中…': 'Rejecting…',
124
+ '已允许一次': 'Allowed once',
125
+ '已拒绝': 'Rejected',
126
+
127
+ // Questions
128
+ '待回答': 'Awaiting answer',
129
+ '回答会作为新消息发给模型': 'The answer will be sent to the model as a new message',
130
+ '回答会直接交给正在等待的模型': 'The answer will be handed to the waiting model',
131
+ '另有 {count} 个问题等待完整页面': '{count} more questions await the full page',
132
+ '查看详情': 'View details',
133
+ '其他回答(可选)': 'Other answer (optional)',
134
+ '输入回答': 'Type an answer',
135
+ '提交回答': 'Submit answers',
136
+ '全部跳过': 'Skip all',
137
+ '跳过此题': 'Skip this question',
138
+ '已跳过,点此撤销': 'Skipped — tap to undo',
139
+ '请选择或输入回答,或跳过此题:{question}': 'Choose or type an answer, or skip this question: {question}',
140
+ '请输入回答,或跳过此题:{question}': 'Type an answer, or skip this question: {question}',
141
+ '已回答的 {count} 题将被丢弃,确定全部跳过?': '{count} answered question(s) will be discarded. Skip all of them?',
142
+ '问题': 'question',
143
+ '提交中…': 'Submitting…',
144
+ '全部跳过中…': 'Skipping all…',
145
+ '已跳过': 'Skipped',
146
+ '已提交回答': 'Answers submitted',
147
+
148
+ // Goal, plan, context
149
+ '进行中': 'Active',
150
+ '已暂停': 'Paused',
151
+ '阻塞': 'Blocked',
152
+ '已完成': 'Complete',
153
+ '{rounds}/{max} 轮': 'Round {rounds}/{max}',
154
+ '{rounds} 轮': 'Round {rounds}',
155
+ '继续': 'Resume',
156
+ '阻塞:{reason}': 'Blocked: {reason}',
157
+ '计划模式切换中': 'Switching plan mode',
158
+ '计划模式已开启,点按关闭': 'Plan mode is on; tap to turn it off',
159
+ '上下文 {percent}%': 'Context {percent}%',
160
+ '上下文已用 {percent}%({used} / {window})': 'Context used {percent}% ({used} / {window})',
161
+ '此宿主没有可切换的权限预设': 'This host has no switchable permission presets',
162
+ '当前:{name}': 'Current: {name}',
163
+ '未知': 'Unknown',
164
+ '{name}:{description}': '{name}: {description}',
165
+ '(当前)': ' (current)',
166
+ '权限模式': 'Permission mode',
167
+ '已切换为 {name}': 'Switched to {name}',
168
+ '上下文:{percent}%({used} / {window})': 'Context: {percent}% ({used} / {window})',
169
+ '累计输入:{value}': 'Total input: {value}',
170
+ '累计输出:{value}': 'Total output: {value}',
171
+ '缓存:读 {read} · 写 {write}': 'Cache: read {read} · write {write}',
172
+ '上下文构成:系统 {system} · 工具 {tools} · 消息 {messages}': 'Context composition: system {system} · tools {tools} · messages {messages}',
173
+ '计划模式:{state}': 'Plan mode: {state}',
174
+ '切换中': 'Switching',
175
+ '已开启': 'On',
176
+ '已关闭': 'Off',
177
+ '暂无可用的用量数据。': 'No usage data available.',
178
+ '运行信息': 'Runtime info',
179
+
180
+ // Conversation
181
+ '等待第一条消息…': 'Waiting for the first message…',
182
+ '这个会话还没有消息。': 'This session has no messages yet.',
183
+ '中间还有更多消息,点「加载上一段」补齐': 'More messages in between; tap “Load earlier” to fill the gap',
184
+ '复制代码': 'Copy code',
185
+ '复制': 'Copy',
186
+ '已复制': 'Copied',
187
+ '复制失败': 'Copy failed',
188
+
189
+ // Session list
190
+ '已显示 {shown} / {total}': 'Showing {shown} / {total}',
191
+ '已加载 {shown} / {total}': 'Loaded {shown} / {total}',
192
+ '搜索中…': 'Searching…',
193
+ '加载已归档会话…': 'Loading archived sessions…',
194
+ '匹配 {total} 个': '{total} matches',
195
+ '{total} 个已归档会话': '{total} archived sessions',
196
+ '暂无会话': 'No sessions',
197
+ '共 {total} 个 · 已显示 {shown}': '{total} total · showing {shown}',
198
+ '最近 {total} 个': 'Latest {total}',
199
+ '没有匹配的会话。': 'No matching sessions.',
200
+ '还没有归档的会话。': 'No archived sessions yet.',
201
+ '没有活跃会话。切到「已归档」查看。': 'No active sessions. Switch to Archived to view them.',
202
+ '还没有会话。点「新建」开始。': 'No sessions yet. Tap New to start.',
203
+ '打开会话 {title}': 'Open session {title}',
204
+ '置顶': 'Pinned',
205
+ '会话设置': 'Session settings',
206
+
207
+ // Session actions
208
+ '重命名': 'Rename',
209
+ '分叉会话': 'Fork session',
210
+ '复制 Markdown': 'Copy Markdown',
211
+ '导出 ZIP': 'Export ZIP',
212
+ '取消置顶': 'Unpin',
213
+ '置顶会话': 'Pin session',
214
+ '恢复到活跃会话': 'Restore to active sessions',
215
+ '归档会话': 'Archive session',
216
+ '重命名会话': 'Rename session',
217
+ '标题会立即同步到完整页面。': 'The title syncs to the full page immediately.',
218
+ '输入新的会话标题': 'Enter a new session title',
219
+ '已重命名': 'Renamed',
220
+ '正在分叉会话…': 'Forking session…',
221
+ '已分叉为新会话': 'Forked into a new session',
222
+ '正在准备 Markdown…': 'Preparing Markdown…',
223
+ '会话不存在': 'Session not found',
224
+ '宿主未启用 Markdown 导出': 'The host does not expose Markdown export',
225
+ '已复制 Markdown': 'Markdown copied',
226
+ '已开始导出会话': 'Session export started',
227
+ '已置顶': 'Pinned',
228
+ '已取消置顶': 'Unpinned',
229
+ '该会话正在运行。归档会先停止当前回合,之后可在「仅归档」中恢复。': 'This session is running. Archiving stops the current turn; restore it later from View options → Only archived.',
230
+ '归档后可在「仅归档」中随时恢复。': 'You can restore it from View options → Only archived at any time.',
231
+ '归档': 'Archive',
232
+ '会话正在运行': 'Session is running',
233
+ '归档会停止当前回合和它启动的后台任务。继续吗?': 'Archiving stops the current turn and any background tasks it started. Continue?',
234
+ '停止并归档': 'Stop and archive',
235
+ '已恢复': 'Restored',
236
+ '没有活跃会话。打开视图选项查看已归档会话。': 'No active sessions. Open view options to see archived sessions.',
237
+
238
+ // Dialogs, models, commands, queue
239
+ '确定': 'OK',
240
+ '无可用模型': 'No models available',
241
+ '{name}(默认)': '{name} (default)',
242
+ '(不可用)': ' (unavailable)',
243
+ '自动(默认位置)': 'Automatic (default location)',
244
+ '自定义目录…': 'Custom directory…',
245
+ '切换中…': 'Switching…',
246
+ '已切换': 'Switched',
247
+ '刷新中…': 'Refreshing…',
248
+ '已刷新': 'Refreshed',
249
+ '指令执行失败': 'Command failed',
250
+ '图片不能随斜杠命令发送;请先移除图片或改为普通消息。': 'Images cannot be sent with slash commands; remove them or send a normal message.',
251
+ '正在执行 {name}…': 'Running {name}…',
252
+ '未知或不完整的指令:{name}': 'Unknown or incomplete command: {name}',
253
+ '正在停止…': 'Stopping…',
254
+ '自定义新会话目录': 'Custom new-session directory',
255
+ '输入一个已存在的绝对路径。': 'Enter an existing absolute path.',
256
+ '使用此目录': 'Use this directory',
257
+ '插话': 'Steer',
258
+ '无法关闭计划模式': 'Could not turn off plan mode',
259
+ '已关闭计划模式': 'Plan mode turned off',
260
+
261
+ // Time and theme
262
+ '刚刚': 'Just now',
263
+ '{count} 分钟前': '{count} min ago',
264
+ '{count} 小时前': '{count} h ago',
265
+ '{count} 天前': '{count} d ago',
266
+ '切换为浅色主题': 'Switch to light theme',
267
+ '切换为深色主题': 'Switch to dark theme',
268
+
269
+ // Goal deletion
270
+ '删除目标': 'Delete goal',
271
+ '删除后当前目标会从会话中移除。': 'The current goal will be removed from the session.',
272
+ })
273
+
274
+ const STORAGE_KEY = 'dsh-lite:lang'
275
+ const LANGUAGES = new Set(['zh', 'en'])
276
+ let activeLanguage = null
277
+
278
+ function readStoredLanguage() {
279
+ try {
280
+ const value = localStorage.getItem(STORAGE_KEY)
281
+ return LANGUAGES.has(value) ? value : null
282
+ } catch {
283
+ return null
284
+ }
285
+ }
286
+
287
+ function browserLanguage() {
288
+ if (typeof navigator === 'undefined') return 'en'
289
+ const candidates = [
290
+ ...Array.isArray(navigator.languages) ? navigator.languages : [],
291
+ navigator.language,
292
+ ].filter((value) => typeof value === 'string' && value.length > 0)
293
+ for (const candidate of candidates) {
294
+ const tag = candidate.toLowerCase()
295
+ if (tag.startsWith('zh')) return 'zh'
296
+ if (tag.startsWith('en')) return 'en'
297
+ }
298
+ return 'en'
299
+ }
300
+
301
+ export function detectLanguage() {
302
+ return readStoredLanguage() ?? browserLanguage()
303
+ }
304
+
305
+ export function currentLanguage() {
306
+ if (activeLanguage === null) activeLanguage = detectLanguage()
307
+ return activeLanguage
308
+ }
309
+
310
+ function syncDocumentLanguage() {
311
+ if (typeof document === 'undefined') return
312
+ document.documentElement.lang = activeLanguage === 'zh' ? 'zh-CN' : 'en'
313
+ document.documentElement.dataset.lang = activeLanguage
314
+ }
315
+
316
+ export function initLanguage() {
317
+ activeLanguage = detectLanguage()
318
+ syncDocumentLanguage()
319
+ return activeLanguage
320
+ }
321
+
322
+ export function setLanguage(language, options = {}) {
323
+ const next = LANGUAGES.has(language) ? language : 'zh'
324
+ activeLanguage = next
325
+ syncDocumentLanguage()
326
+ if (options.persist !== false) {
327
+ try {
328
+ localStorage.setItem(STORAGE_KEY, next)
329
+ } catch {
330
+ // Private mode or a refused storage write must not break the UI.
331
+ }
332
+ }
333
+ return activeLanguage
334
+ }
335
+
336
+ function interpolate(template, params) {
337
+ if (params === undefined || params === null) return template
338
+ return String(template).replace(/\{([A-Za-z0-9_]+)\}/g, (match, name) => {
339
+ const value = params[name]
340
+ return value === undefined || value === null ? match : String(value)
341
+ })
342
+ }
343
+
344
+ export function translateText(source, language, params) {
345
+ const text = String(source)
346
+ const template = language === 'en' ? EN_TRANSLATIONS[text] ?? text : text
347
+ return interpolate(template, params)
348
+ }
349
+
350
+ export function t(source, params) {
351
+ return translateText(source, currentLanguage(), params)
352
+ }
353
+
354
+ const GOAL_PHASE_KEYS = {
355
+ active: '进行中',
356
+ paused: '已暂停',
357
+ blocked: '阻塞',
358
+ complete: '已完成',
359
+ }
360
+
361
+ export function goalPhaseLabel(phase) {
362
+ return t(GOAL_PHASE_KEYS[phase] ?? (typeof phase === 'string' ? phase : ''))
363
+ }
364
+
365
+ export function languageToggleText() {
366
+ return currentLanguage() === 'zh' ? 'EN' : '中文'
367
+ }
368
+
369
+ export function languageToggleLabel() {
370
+ return currentLanguage() === 'zh' ? 'Switch to English' : '切换到中文'
371
+ }
372
+
373
+ export function applyStaticTranslations(root = document) {
374
+ for (const node of root.querySelectorAll('[data-i18n]')) {
375
+ node.textContent = t(node.dataset.i18n)
376
+ }
377
+ for (const node of root.querySelectorAll('[data-i18n-placeholder]')) {
378
+ node.setAttribute('placeholder', t(node.dataset.i18nPlaceholder))
379
+ }
380
+ for (const node of root.querySelectorAll('[data-i18n-aria-label]')) {
381
+ node.setAttribute('aria-label', t(node.dataset.i18nAriaLabel))
382
+ }
383
+ for (const node of root.querySelectorAll('[data-i18n-title]')) {
384
+ node.setAttribute('title', t(node.dataset.i18nTitle))
385
+ }
386
+ }
Binary file
Binary file
@@ -0,0 +1,195 @@
1
+ <!doctype html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
6
+ <meta name="theme-color" content="#0a0c10" media="(prefers-color-scheme: dark)">
7
+ <meta name="theme-color" content="#f4f6fb" media="(prefers-color-scheme: light)">
8
+ <meta name="color-scheme" content="dark light">
9
+ <title>DSH Lite</title>
10
+ <link rel="manifest" href="/lite/manifest.webmanifest">
11
+ <link rel="icon" href="/lite/favicon.svg" type="image/svg+xml">
12
+ <link rel="apple-touch-icon" href="/lite/icon-192.png">
13
+ <link rel="stylesheet" href="/lite/style.css?v=29">
14
+ <link rel="stylesheet" href="/lite/theme.css?v=29">
15
+ </head>
16
+ <body>
17
+ <div id="app">
18
+ <header class="topbar">
19
+ <button id="sessionsButton" class="icon-button" type="button" aria-label="会话列表" data-i18n-aria-label="会话列表">☰</button>
20
+ <div class="title-block">
21
+ <div id="sessionTitle" class="session-title">DSH Lite</div>
22
+ <div id="sessionSubtitle" class="session-subtitle" data-i18n="连接中…">连接中…</div>
23
+ </div>
24
+ <span id="planChip" class="plan-chip" hidden>Plan</span>
25
+ <button id="contextMeter" class="context-meter" type="button" hidden></button>
26
+ <button id="refreshButton" class="icon-button" type="button" aria-label="刷新" data-i18n-aria-label="刷新">↻</button>
27
+ </header>
28
+
29
+ <div id="goalBar" class="goal-bar" hidden>
30
+ <div class="goal-line">
31
+ <button id="goalToggle" class="goal-toggle" type="button" aria-expanded="false">
32
+ <span class="goal-label" data-i18n="目标">目标</span>
33
+ <span id="goalPhase" class="goal-phase" hidden></span>
34
+ <span id="goalSummary" class="goal-summary"></span>
35
+ </button>
36
+ <div class="goal-actions">
37
+ <button id="goalPause" class="goal-action" type="button" data-i18n="暂停">暂停</button>
38
+ <button id="goalEdit" class="goal-action" type="button" data-i18n="编辑">编辑</button>
39
+ <button id="goalDelete" class="goal-action" type="button" data-i18n="删除">删除</button>
40
+ </div>
41
+ </div>
42
+ <div id="goalEditor" class="goal-editor" hidden>
43
+ <textarea id="goalInput" rows="3" placeholder="输入目标" data-i18n-placeholder="输入目标"></textarea>
44
+ <div class="goal-editor-actions">
45
+ <button id="goalSave" class="text-button" type="button" data-i18n="保存">保存</button>
46
+ <button id="goalCancel" class="text-button" type="button" data-i18n="取消">取消</button>
47
+ </div>
48
+ </div>
49
+ </div>
50
+
51
+ <main id="conversation" class="conversation" aria-live="polite">
52
+ <div id="historyBar" class="history-bar" hidden>
53
+ <button id="loadEarlier" class="history-button" type="button" data-i18n="加载上一段">加载上一段</button>
54
+ </div>
55
+ <div id="emptyState" class="empty-state">
56
+ <div class="empty-art" aria-hidden="true">
57
+ <span class="empty-art-core"></span>
58
+ <span class="empty-art-dot empty-art-dot-a"></span>
59
+ <span class="empty-art-dot empty-art-dot-b"></span>
60
+ </div>
61
+ <p id="emptyText" data-i18n="选择一个会话,或者新建一个。">选择一个会话,或者新建一个。</p>
62
+ </div>
63
+ <div id="messages" class="messages"></div>
64
+ <div id="waitingBar" class="waiting-bar" hidden>
65
+ <span data-i18n="模型正在等待你的回答或确认。可回答的提问与审批会显示为下方卡片;更复杂的操作请在">模型正在等待你的回答或确认。可回答的提问与审批会显示为下方卡片;更复杂的操作请在</span>
66
+ <a href="/" target="_blank" rel="noopener noreferrer" data-i18n="完整页面">完整页面</a><span data-i18n="处理。">处理。</span>
67
+ </div>
68
+ <div id="runningBar" class="running-bar" hidden>
69
+ <span class="spinner" aria-hidden="true"></span>
70
+ <span id="runningText" data-i18n="运行中…">运行中…</span>
71
+ <button id="stopButton" class="text-button" type="button" data-i18n="停止">停止</button>
72
+ </div>
73
+ <div id="scrollBottomWrap" class="scroll-bottom-wrap" hidden>
74
+ <button id="scrollBottom" class="scroll-bottom" type="button" aria-label="回到最新" data-i18n-aria-label="回到最新"><span aria-hidden="true">↓</span> <span data-i18n="最新">最新</span></button>
75
+ </div>
76
+ </main>
77
+
78
+ <section id="approvalCard" class="question-card approval-card" aria-live="polite" hidden></section>
79
+ <section id="questionCard" class="question-card" aria-live="polite" hidden></section>
80
+
81
+ <footer class="composer">
82
+ <div id="commandMenu" class="command-menu" hidden>
83
+ <div id="commandMenuList" class="command-menu-list"></div>
84
+ </div>
85
+ <div id="queueBar" class="queue-bar" hidden></div>
86
+ <div id="banner" class="banner" role="status" hidden></div>
87
+ <div id="imageTray" class="image-tray" aria-live="polite" hidden></div>
88
+ <div class="composer-row">
89
+ <button id="imageButton" class="image-button" type="button" aria-label="添加图片" title="添加图片" data-i18n="图" data-i18n-aria-label="添加图片" data-i18n-title="添加图片">图</button>
90
+ <input id="imageInput" type="file" accept="image/png,image/jpeg,image/webp,image/gif" multiple hidden>
91
+ <textarea id="promptInput" rows="3" placeholder="发消息…(回车换行)" data-i18n-placeholder="发消息…(回车换行)" enterkeyhint="enter" autocomplete="off"></textarea>
92
+ <button id="sendButton" class="send-button" type="button" aria-label="发送" data-i18n-aria-label="发送">↑</button>
93
+ </div>
94
+ <div class="model-bar">
95
+ <label class="model-label" for="modelSelect" data-i18n="模型">模型</label>
96
+ <select id="modelSelect" class="model-select"></select>
97
+ <select id="effortSelect" class="model-select effort-select" aria-label="思考强度" data-i18n-aria-label="思考强度" data-i18n-title="思考强度" hidden></select>
98
+ <button id="modelRefresh" class="model-refresh" type="button" title="刷新模型列表" aria-label="刷新模型列表" data-i18n-title="刷新模型列表" data-i18n-aria-label="刷新模型列表">↻</button>
99
+ <span id="modelStatus" class="model-status"></span>
100
+ </div>
101
+ </footer>
102
+ </div>
103
+
104
+ <div id="sessionSheet" class="sheet" hidden>
105
+ <div class="sheet-backdrop" data-close-sheet></div>
106
+ <section class="sheet-panel" role="dialog" aria-modal="true" aria-label="会话列表" data-i18n-aria-label="会话列表">
107
+ <header class="sheet-header">
108
+ <div class="sheet-heading">
109
+ <div class="sheet-title" data-i18n="会话列表">会话列表</div>
110
+ <div id="sheetSubtitle" class="sheet-subtitle"></div>
111
+ </div>
112
+ <div class="sheet-actions">
113
+ <button id="notifyToggle" class="text-button notify-toggle" type="button" aria-label="通知关" data-i18n-aria-label="通知关" hidden><svg class="notify-icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M5.5 8a4.5 4.5 0 0 1 9 0c0 3.2 1 4.2 1.5 4.8H4c.5-.6 1.5-1.6 1.5-4.8Z" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linejoin="round"/><path d="M8.5 15a1.5 1.5 0 0 0 3 0" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg><span id="notifyLabel" data-i18n="通知关">通知关</span></button>
114
+ <button id="themeToggle" class="icon-button" type="button" aria-label="切换明暗主题" data-i18n-aria-label="切换明暗主题">◐</button>
115
+ <button id="newSessionButton" class="text-button new-session-button" type="button" aria-label="新建会话" data-i18n-aria-label="新建会话"><span class="new-session-plus" aria-hidden="true">+</span><span class="new-session-label" data-i18n="新建">新建</span></button>
116
+ <button class="icon-button" type="button" data-close-sheet aria-label="关闭" data-i18n-aria-label="关闭">×</button>
117
+ </div>
118
+ </header>
119
+ <div id="newSessionOptions" class="new-session-options">
120
+ <div id="presetBar" class="preset-bar" hidden>
121
+ <label class="preset-label" for="presetSelect" data-i18n="新会话预设">新会话预设</label>
122
+ <select id="presetSelect" class="preset-select"></select>
123
+ </div>
124
+ <div id="workspaceBar" class="preset-bar" hidden>
125
+ <label class="preset-label" for="workspaceSelect" data-i18n="新会话位置">新会话位置</label>
126
+ <select id="workspaceSelect" class="preset-select"></select>
127
+ </div>
128
+ </div>
129
+ <div id="listToolbar" class="list-toolbar" hidden>
130
+ <div id="sessionSearchBar" class="session-search-bar" hidden>
131
+ <input id="sessionSearch" class="session-search" type="search" placeholder="搜索标题、目录或文件夹" data-i18n-placeholder="搜索标题、目录或文件夹" autocomplete="off">
132
+ </div>
133
+ <button id="viewMenuButton" class="view-menu-button" type="button" aria-haspopup="menu" aria-controls="viewMenu" aria-expanded="false" aria-label="列表视图选项" data-i18n-aria-label="列表视图选项">
134
+ <svg class="view-menu-icon" viewBox="0 0 20 20" aria-hidden="true"><path d="M4 6h12M4 10h12M4 14h12" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/><circle cx="7" cy="6" r="1.8" fill="var(--bg-elevated)" stroke="currentColor" stroke-width="1.3"/><circle cx="13" cy="10" r="1.8" fill="var(--bg-elevated)" stroke="currentColor" stroke-width="1.3"/><circle cx="9" cy="14" r="1.8" fill="var(--bg-elevated)" stroke="currentColor" stroke-width="1.3"/></svg>
135
+ <span id="viewSummary" class="view-summary"></span>
136
+ <span class="view-chevron" aria-hidden="true"></span>
137
+ </button>
138
+ <div id="viewMenu" class="view-menu" role="menu" aria-label="列表视图选项" data-i18n-aria-label="列表视图选项" hidden>
139
+ <div class="view-menu-group" role="group" aria-label="分组" data-i18n-aria-label="分组">
140
+ <div class="view-menu-label" data-i18n="分组">分组</div>
141
+ <button class="view-menu-option" type="button" role="menuitemradio" aria-checked="true" data-view-group="grouped" data-i18n="按工作区">按工作区</button>
142
+ <button class="view-menu-option" type="button" role="menuitemradio" aria-checked="false" data-view-group="flat" data-i18n="平铺">平铺</button>
143
+ </div>
144
+ <div class="view-menu-group" role="group" aria-label="排序" data-i18n-aria-label="排序">
145
+ <div class="view-menu-label" data-i18n="排序">排序</div>
146
+ <button class="view-menu-option" type="button" role="menuitemradio" aria-checked="true" data-view-sort="recent" data-i18n="最近更新">最近更新</button>
147
+ <button class="view-menu-option" type="button" role="menuitemradio" aria-checked="false" data-view-sort="created" data-i18n="创建时间">创建时间</button>
148
+ <button class="view-menu-option" type="button" role="menuitemradio" aria-checked="false" data-view-sort="title" data-i18n="标题">标题</button>
149
+ </div>
150
+ <div class="view-menu-group" role="group" aria-label="归档" data-i18n-aria-label="归档">
151
+ <div class="view-menu-label" data-i18n="归档">归档</div>
152
+ <button class="view-menu-option" type="button" role="menuitemradio" aria-checked="true" data-view-archived="hide" data-i18n="隐藏">隐藏</button>
153
+ <button class="view-menu-option" type="button" role="menuitemradio" aria-checked="false" data-view-archived="show" data-i18n="显示">显示</button>
154
+ <button class="view-menu-option" type="button" role="menuitemradio" aria-checked="false" data-view-archived="only"><span data-i18n="仅归档">仅归档</span><span id="viewArchivedCount" class="view-menu-count"></span></button>
155
+ </div>
156
+ </div>
157
+ </div>
158
+ <div id="sessionList" class="session-list"></div>
159
+ <div id="listMore" class="list-more" hidden>
160
+ <button id="loadMoreButton" class="load-more-button" type="button" data-i18n="加载更多">加载更多</button>
161
+ <span id="listMoreHint" class="list-more-hint"></span>
162
+ </div>
163
+ <div class="sheet-foot">
164
+ <span data-i18n="DSH Lite · 低流量模式">DSH Lite · 低流量模式</span>
165
+ <button id="fullPageButton" class="lang-toggle" type="button" title="打开完整页面(打开当前会话)" data-i18n="完整页面" data-i18n-title="打开完整页面(打开当前会话)">完整页面</button>
166
+ <button id="appearanceButton" class="lang-toggle appearance-button" type="button" aria-haspopup="dialog" aria-controls="appearancePanel" aria-expanded="false" aria-label="外观" data-i18n-aria-label="外观"><span data-i18n="外观">外观</span></button>
167
+ <button id="langToggle" class="lang-toggle" type="button">EN</button>
168
+ </div>
169
+ <div id="appearancePanel" class="appearance-panel" role="dialog" aria-modal="false" aria-label="外观" data-i18n-aria-label="外观" hidden>
170
+ <div class="appearance-head">
171
+ <span data-i18n="外观">外观</span>
172
+ <button id="appearanceClose" class="appearance-close" type="button" aria-label="关闭" data-i18n-aria-label="关闭">×</button>
173
+ </div>
174
+ <div class="appearance-label" data-i18n="主题">主题</div>
175
+ <div id="themeFamilyOptions" class="appearance-options" role="radiogroup" aria-label="主题" data-i18n-aria-label="主题"></div>
176
+ <div class="appearance-label" data-i18n="模式">模式</div>
177
+ <div id="themeModeOptions" class="appearance-modes" role="radiogroup" aria-label="模式" data-i18n-aria-label="模式"></div>
178
+ </div>
179
+ </section>
180
+ </div>
181
+
182
+ <div id="dialog" class="dialog" hidden>
183
+ <div class="dialog-backdrop" data-dialog-cancel></div>
184
+ <div class="dialog-card" role="dialog" aria-modal="true" aria-labelledby="dialogTitle">
185
+ <div class="dialog-grip" aria-hidden="true"></div>
186
+ <h2 id="dialogTitle" class="dialog-title"></h2>
187
+ <p id="dialogMessage" class="dialog-message" hidden></p>
188
+ <input id="dialogInput" class="dialog-input" type="text" autocomplete="off" hidden>
189
+ <div id="dialogActions" class="dialog-actions"></div>
190
+ </div>
191
+ </div>
192
+
193
+ <script type="module" src="/lite/app.js?v=29"></script>
194
+ </body>
195
+ </html>
@@ -0,0 +1,28 @@
1
+ {
2
+ "id": "/lite/",
3
+ "name": "DSH Lite",
4
+ "short_name": "DSH Lite",
5
+ "description": "Minimal, low-traffic bilingual mobile surface for DeepSeek Harness",
6
+ "start_url": "/lite/",
7
+ "scope": "/lite/",
8
+ "lang": "en",
9
+ "display": "standalone",
10
+ "orientation": "portrait",
11
+ "categories": ["productivity", "developer-tools"],
12
+ "background_color": "#0a0c10",
13
+ "theme_color": "#0a0c10",
14
+ "icons": [
15
+ {
16
+ "src": "/lite/icon-192.png",
17
+ "sizes": "192x192",
18
+ "type": "image/png",
19
+ "purpose": "any"
20
+ },
21
+ {
22
+ "src": "/lite/icon-512.png",
23
+ "sizes": "512x512",
24
+ "type": "image/png",
25
+ "purpose": "any"
26
+ }
27
+ ]
28
+ }