dsh-share-chat 0.3.3 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -126
- package/client.js +5599 -522
- package/docs/DETAIL.md +8 -20
- package/index.js +342 -0
- package/package.json +9 -11
- package/CHANGELOG.md +0 -65
- package/cli/chat-mcp.mjs +0 -225
- package/cli/chat.cmd +0 -3
- package/cli/chat.mjs +0 -335
package/docs/DETAIL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 社交
|
|
2
2
|
|
|
3
|
-
在 DSH
|
|
3
|
+
在 DSH 里和好友聊天,好友发来的对话快照可以直接展开看。有两个入口,共用一份登录状态。
|
|
4
4
|
|
|
5
5
|
## 怎么用
|
|
6
6
|
|
|
@@ -20,21 +20,10 @@
|
|
|
20
20
|
- 注册、用 token 登录、退出
|
|
21
21
|
- 加好友(互相添加)
|
|
22
22
|
- 一对一发文字消息、收消息
|
|
23
|
-
- **发图片 /
|
|
23
|
+
- **发图片 / 文件**:点 📎 选文件,图片直接显示,其他文件给下载链接(单件 ≤ 8 MB)
|
|
24
24
|
- **表情**:点 😀 打开表情面板,插进输入框(unicode 表情,当普通文字发)
|
|
25
25
|
- 收到对话快照时展开查看(标题、用户消息、工具调用、回复)
|
|
26
26
|
- **一键分享当前会话**:在会话里的「社交」tab 顶部点「分享这一轮」,选好友发出去。只取**最后一轮**,每段最多 1500 字,工具调用压成一行短摘要
|
|
27
|
-
- **内置小游戏**:聊天页顶栏的 `🎮 摸鱼`,右下角浮动窗口,可拖可缩放;默认尺寸在 **设置 → 社交小游戏** 里调(340×600 / 390×760 / 480×900 或自定义)
|
|
28
|
-
|
|
29
|
-
## 界面
|
|
30
|
-
|
|
31
|
-
整套界面使用 DSH 的主题 token(`--dsw-alias-*`),亮色/暗色随宿主自动切换:
|
|
32
|
-
|
|
33
|
-
- 登录页是一张居中卡片:服务器、邀请码、账号、密码,分段 tab 切换登录 / 注册 / token
|
|
34
|
-
- 左侧好友列表带头像与最后一条消息摘要
|
|
35
|
-
- 消息是双向气泡(自己的用品牌色),下面是时间
|
|
36
|
-
- 空状态有图标和提示,不会只剩一行灰字
|
|
37
|
-
- 窄窗口(≤720px)侧栏自动收窄
|
|
38
27
|
|
|
39
28
|
## 明确的限制
|
|
40
29
|
|
|
@@ -43,13 +32,12 @@
|
|
|
43
32
|
- 会剥掉运行时注入的 `<system-reminder>` 上下文(时间戳、工作目录、权限策略那类)
|
|
44
33
|
- 分享内容按「用户 / 工具 / 回复」三类归一化,原始 Markdown 结构和附件不会带过去
|
|
45
34
|
- 过滤是黑名单,不是白名单:不保证 100% 不漏,分享前建议自己过一眼
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
- 消息 5
|
|
49
|
-
- 服务器不加密存储:消息和快照以明文 JSON 落在 relay 的 `/opt/dsh-relay/data/`,快照 7
|
|
50
|
-
- 浏览器 localStorage 里存的是 bearer token
|
|
51
|
-
- 小游戏在网页端没有微信登录、没有激励视频、没有游戏圈;视频/音频能否播放取决于浏览器编解码
|
|
35
|
+
- 没有好友申请与同意流程,双方互相添加即成立。
|
|
36
|
+
- 没有群聊、已读回执、撤回、图片、语音。
|
|
37
|
+
- 消息 5 秒轮询,不是实时推送;断线后下一次轮询自动恢复。
|
|
38
|
+
- 服务器不加密存储:消息和快照以明文 JSON 落在 relay 的 `/opt/dsh-relay/data/`,快照 7 天过期。
|
|
39
|
+
- 浏览器 localStorage 里存的是 bearer token,共用电脑时注意退出。
|
|
52
40
|
|
|
53
41
|
## 服务器地址
|
|
54
42
|
|
|
55
|
-
默认指向 `https://xdxy-pet.com/relay`,可在登录页改。relay 只存信封(谁发给谁 + 时间 +
|
|
43
|
+
默认指向 `https://xdxy-pet.com/relay`,可在登录页改。relay 只存信封(谁发给谁 + 时间 + 快照引用),不解析消息内容语义。
|
package/index.js
CHANGED
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
* 不会把已经能用的聊天一起拖下水。
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
+
import { randomBytes } from 'node:crypto'
|
|
16
|
+
|
|
15
17
|
const PREFIX = '/api/share-chat'
|
|
16
18
|
|
|
17
19
|
function json(status, body) {
|
|
@@ -46,6 +48,162 @@ function pickTitle(snap) {
|
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
export function apply(ctx) {
|
|
51
|
+
// ── 问模型:走 DSH 自己的 LLM 服务(消耗当前账号额度)──
|
|
52
|
+
// 只在 loopback 下开放,公用部署直接 403。
|
|
53
|
+
ctx.inject(['webServer', 'llm'], (scope) => {
|
|
54
|
+
scope.effect(() =>
|
|
55
|
+
scope.webServer.register({
|
|
56
|
+
path: PREFIX + '/ask',
|
|
57
|
+
kind: 'exact',
|
|
58
|
+
// 注意:resource 路由只收 GET/HEAD(其它方法由框架回 405),
|
|
59
|
+
// 这里要 POST,所以用 node 风格的 handler。
|
|
60
|
+
handler: (req, res) => {
|
|
61
|
+
const done = (status, body) => {
|
|
62
|
+
res.writeHead(status, {
|
|
63
|
+
'content-type': 'application/json; charset=utf-8',
|
|
64
|
+
'cache-control': 'no-store',
|
|
65
|
+
})
|
|
66
|
+
res.end(JSON.stringify(body))
|
|
67
|
+
}
|
|
68
|
+
if (!isLoopbackOrigin(scope)) {
|
|
69
|
+
return done(403, { error: 'not-loopback', hint: '公用部署下不开放模型调用' })
|
|
70
|
+
}
|
|
71
|
+
if (req.method !== 'POST') return done(405, { error: 'method' })
|
|
72
|
+
|
|
73
|
+
let raw = ''
|
|
74
|
+
let tooBig = false
|
|
75
|
+
req.on('data', (c) => {
|
|
76
|
+
raw += c
|
|
77
|
+
if (raw.length > 200000) {
|
|
78
|
+
tooBig = true
|
|
79
|
+
req.destroy()
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
req.on('end', async () => {
|
|
83
|
+
if (tooBig) return done(413, { error: 'too-large' })
|
|
84
|
+
let parsed = {}
|
|
85
|
+
try {
|
|
86
|
+
parsed = JSON.parse(raw || '{}') || {}
|
|
87
|
+
} catch {
|
|
88
|
+
parsed = {}
|
|
89
|
+
}
|
|
90
|
+
const prompt = String(parsed.prompt || '').slice(0, 4000)
|
|
91
|
+
|
|
92
|
+
const pickId = (v) =>
|
|
93
|
+
typeof v === 'string' ? v : (v && (v.id || v.provider || v.name || v.route)) || ''
|
|
94
|
+
|
|
95
|
+
// 探针:只报告路由/提供方/模型,不调模型,用来定位问题
|
|
96
|
+
if (parsed.probe) {
|
|
97
|
+
try {
|
|
98
|
+
const providers = (await Promise.resolve(scope.llm.listProviders())).map(pickId)
|
|
99
|
+
const table = []
|
|
100
|
+
for (const p of providers) {
|
|
101
|
+
let ms = []
|
|
102
|
+
try {
|
|
103
|
+
ms = await Promise.resolve(scope.llm.listModels(p))
|
|
104
|
+
} catch (e) {
|
|
105
|
+
ms = []
|
|
106
|
+
}
|
|
107
|
+
table.push({ provider: p, models: (ms || []).map(pickId).slice(0, 8) })
|
|
108
|
+
}
|
|
109
|
+
return done(200, { ok: true, table })
|
|
110
|
+
} catch (e) {
|
|
111
|
+
return done(500, { error: 'probe-failed', detail: String((e && e.message) || e) })
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (!prompt) return done(400, { error: 'empty' })
|
|
116
|
+
|
|
117
|
+
try {
|
|
118
|
+
const providers = (await Promise.resolve(scope.llm.listProviders())).map(pickId)
|
|
119
|
+
if (!providers.length) return done(503, { error: 'no-provider' })
|
|
120
|
+
|
|
121
|
+
// 优先官方/账号通道,其次非 web 驱动,最后才 web(要浏览器会话,容易挂)
|
|
122
|
+
const ordered = [
|
|
123
|
+
...providers.filter((p) => /official|account|api-key/i.test(p)),
|
|
124
|
+
...providers.filter(
|
|
125
|
+
(p) => !/official|account|api-key/i.test(p) && !/web/i.test(p),
|
|
126
|
+
),
|
|
127
|
+
...providers.filter((p) => /web/i.test(p) && !/official|account|api-key/i.test(p)),
|
|
128
|
+
]
|
|
129
|
+
let provider = ''
|
|
130
|
+
let model = ''
|
|
131
|
+
for (const p of ordered) {
|
|
132
|
+
let ms = []
|
|
133
|
+
try {
|
|
134
|
+
ms = await Promise.resolve(scope.llm.listModels(p))
|
|
135
|
+
} catch {
|
|
136
|
+
ms = []
|
|
137
|
+
}
|
|
138
|
+
const m = pickId((ms || [])[0])
|
|
139
|
+
if (m) {
|
|
140
|
+
provider = p
|
|
141
|
+
model = m
|
|
142
|
+
break
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (!provider) return done(503, { error: 'no-model-anywhere' })
|
|
146
|
+
|
|
147
|
+
const messages = [
|
|
148
|
+
{
|
|
149
|
+
role: 'system',
|
|
150
|
+
content: [
|
|
151
|
+
{
|
|
152
|
+
type: 'text',
|
|
153
|
+
text: '你是聊天里的助手。用简体中文回答,300 字以内,直接给结论,不要客套和重复问题。',
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
{ role: 'user', content: [{ type: 'text', text: prompt }] },
|
|
158
|
+
]
|
|
159
|
+
|
|
160
|
+
let text = ''
|
|
161
|
+
let timedOut = false
|
|
162
|
+
const ac = new AbortController()
|
|
163
|
+
const timer = setTimeout(() => {
|
|
164
|
+
timedOut = true
|
|
165
|
+
ac.abort()
|
|
166
|
+
}, 60000)
|
|
167
|
+
try {
|
|
168
|
+
for await (const chunk of scope.llm.stream({
|
|
169
|
+
provider,
|
|
170
|
+
model,
|
|
171
|
+
messages,
|
|
172
|
+
signal: ac.signal,
|
|
173
|
+
})) {
|
|
174
|
+
if (!chunk) continue
|
|
175
|
+
if (chunk.type === 'text-delta' && typeof chunk.text === 'string') {
|
|
176
|
+
text += chunk.text
|
|
177
|
+
} else if (
|
|
178
|
+
chunk.type === 'finish' &&
|
|
179
|
+
chunk.reason &&
|
|
180
|
+
chunk.reason.kind === 'error'
|
|
181
|
+
) {
|
|
182
|
+
const f = chunk.reason.failure || {}
|
|
183
|
+
clearTimeout(timer)
|
|
184
|
+
return done(502, {
|
|
185
|
+
error: 'llm-error',
|
|
186
|
+
detail: String(f.message || f.code || ''),
|
|
187
|
+
})
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
} finally {
|
|
191
|
+
clearTimeout(timer)
|
|
192
|
+
}
|
|
193
|
+
if (timedOut) return done(504, { error: 'timeout', provider, model })
|
|
194
|
+
text = String(text || '').trim()
|
|
195
|
+
if (!text) return done(502, { error: 'empty-answer', provider, model })
|
|
196
|
+
return done(200, { text, provider, model })
|
|
197
|
+
} catch (e) {
|
|
198
|
+
return done(500, { error: 'ask-failed', detail: String((e && e.message) || e) })
|
|
199
|
+
}
|
|
200
|
+
})
|
|
201
|
+
req.on('error', () => {})
|
|
202
|
+
},
|
|
203
|
+
}),
|
|
204
|
+
)
|
|
205
|
+
})
|
|
206
|
+
|
|
49
207
|
ctx.inject(['webServer', 'sessionQuery'], (scope) => {
|
|
50
208
|
// ── 会话列表 ──
|
|
51
209
|
scope.effect(
|
|
@@ -167,4 +325,188 @@ export function apply(ctx) {
|
|
|
167
325
|
'share-chat: transcript route',
|
|
168
326
|
)
|
|
169
327
|
})
|
|
328
|
+
|
|
329
|
+
// ── 营地:采集本机插件清单(给「串门」发布用,只读)──
|
|
330
|
+
ctx.inject(['webServer', 'pluginManager'], (scope) => {
|
|
331
|
+
scope.effect(
|
|
332
|
+
() =>
|
|
333
|
+
scope.webServer.register({
|
|
334
|
+
path: PREFIX + '/camp/collect',
|
|
335
|
+
kind: 'exact',
|
|
336
|
+
resource: async () => {
|
|
337
|
+
if (!isLoopbackOrigin(scope)) return json(403, { error: 'not-loopback' })
|
|
338
|
+
try {
|
|
339
|
+
const raw = await scope.pluginManager.listBundles()
|
|
340
|
+
const list = Array.isArray(raw) ? raw : raw && Array.isArray(raw.entries) ? raw.entries : []
|
|
341
|
+
const plugins = list
|
|
342
|
+
.map((b) => {
|
|
343
|
+
const name = String((b && b.name) || '')
|
|
344
|
+
const spec = String((b && b.source) || '')
|
|
345
|
+
// 本地路径来源不能分享:别人装不了,也不该知道你的磁盘布局
|
|
346
|
+
if (/^(file|link):/i.test(spec)) return null
|
|
347
|
+
const builtin = !spec
|
|
348
|
+
const source = spec.startsWith('git+') ? 'git' : builtin ? 'builtin' : 'npm'
|
|
349
|
+
return {
|
|
350
|
+
name,
|
|
351
|
+
version: String((b && b.version) || ''),
|
|
352
|
+
spec,
|
|
353
|
+
source,
|
|
354
|
+
builtin,
|
|
355
|
+
enabled: !!(b && b.enabled),
|
|
356
|
+
}
|
|
357
|
+
})
|
|
358
|
+
.filter((p) => p && p.name)
|
|
359
|
+
return json(200, { collectedAt: Date.now(), plugins })
|
|
360
|
+
} catch (e) {
|
|
361
|
+
return json(500, { error: String((e && e.message) || e) })
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
}),
|
|
365
|
+
'share-chat: camp collect route',
|
|
366
|
+
)
|
|
367
|
+
})
|
|
368
|
+
|
|
369
|
+
// ── 营地:复刻(装插件 / 撤销),仅本机 + 一次性 nonce ──
|
|
370
|
+
ctx.inject(['webServer', 'pluginManager'], (scope) => {
|
|
371
|
+
let nonceValue = ''
|
|
372
|
+
let nonceExpires = 0
|
|
373
|
+
|
|
374
|
+
/** 只放行 npm 精确版本、pinned git、https tgz;本地路径一律拒绝 */
|
|
375
|
+
const okSpec = (spec) => {
|
|
376
|
+
const v = String(spec || '').trim()
|
|
377
|
+
if (!v || /^(file|link):/i.test(v)) return false
|
|
378
|
+
if (/^git\+https?:\/\/[^\s#]+#[0-9a-f]{40}$/i.test(v)) return true
|
|
379
|
+
if (/^https:\/\/[^\s?#]+\.tgz$/i.test(v)) return true
|
|
380
|
+
if (/^(@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*@[0-9][0-9A-Za-z.+-]*$/i.test(v)) return true
|
|
381
|
+
return false
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/** handler 是 node 风格:resource 只接 GET/HEAD,POST 必须用 handler */
|
|
385
|
+
const sendJson = (res, status, body) => {
|
|
386
|
+
const text = JSON.stringify(body)
|
|
387
|
+
res.writeHead(status, {
|
|
388
|
+
'content-type': 'application/json; charset=utf-8',
|
|
389
|
+
'cache-control': 'no-store',
|
|
390
|
+
})
|
|
391
|
+
res.end(text)
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
const readJsonBody = (req) =>
|
|
395
|
+
new Promise((resolve) => {
|
|
396
|
+
let size = 0
|
|
397
|
+
const chunks = []
|
|
398
|
+
req.on('data', (c) => {
|
|
399
|
+
size += c.length
|
|
400
|
+
if (size > 256 * 1024) {
|
|
401
|
+
resolve(null)
|
|
402
|
+
req.destroy()
|
|
403
|
+
return
|
|
404
|
+
}
|
|
405
|
+
chunks.push(c)
|
|
406
|
+
})
|
|
407
|
+
req.on('end', () => {
|
|
408
|
+
try {
|
|
409
|
+
resolve(JSON.parse(Buffer.concat(chunks).toString('utf8') || '{}'))
|
|
410
|
+
} catch {
|
|
411
|
+
resolve(null)
|
|
412
|
+
}
|
|
413
|
+
})
|
|
414
|
+
req.on('error', () => resolve(null))
|
|
415
|
+
})
|
|
416
|
+
|
|
417
|
+
scope.effect(
|
|
418
|
+
() =>
|
|
419
|
+
scope.webServer.register({
|
|
420
|
+
path: PREFIX + '/camp/nonce',
|
|
421
|
+
kind: 'exact',
|
|
422
|
+
resource: async () => {
|
|
423
|
+
if (!isLoopbackOrigin(scope)) return json(403, { error: 'not-loopback' })
|
|
424
|
+
nonceValue = randomBytes(16).toString('hex')
|
|
425
|
+
nonceExpires = Date.now() + 5 * 60 * 1000
|
|
426
|
+
return json(200, { nonce: nonceValue, expiresAt: nonceExpires })
|
|
427
|
+
},
|
|
428
|
+
}),
|
|
429
|
+
'share-chat: camp nonce route',
|
|
430
|
+
)
|
|
431
|
+
|
|
432
|
+
scope.effect(
|
|
433
|
+
() =>
|
|
434
|
+
scope.webServer.register({
|
|
435
|
+
path: PREFIX + '/camp/apply',
|
|
436
|
+
kind: 'exact',
|
|
437
|
+
handler: async (req, res) => {
|
|
438
|
+
if (req.method !== 'POST') return sendJson(res, 405, { error: 'method', allow: 'POST' })
|
|
439
|
+
if (!isLoopbackOrigin(scope)) return sendJson(res, 403, { error: 'not-loopback' })
|
|
440
|
+
const body = await readJsonBody(req)
|
|
441
|
+
if (!body) return sendJson(res, 400, { error: 'bad-json' })
|
|
442
|
+
const token = String(body.nonce || '')
|
|
443
|
+
if (!nonceValue || token !== nonceValue || Date.now() > nonceExpires) {
|
|
444
|
+
return sendJson(res, 403, { error: 'bad-nonce' })
|
|
445
|
+
}
|
|
446
|
+
nonceValue = ''
|
|
447
|
+
const items = Array.isArray(body.specs) ? body.specs.slice(0, 12) : []
|
|
448
|
+
const results = []
|
|
449
|
+
for (const item of items) {
|
|
450
|
+
const spec = String((item && item.spec) || '')
|
|
451
|
+
if (!okSpec(spec)) {
|
|
452
|
+
results.push({ spec, ok: false, error: 'bad-spec' })
|
|
453
|
+
continue
|
|
454
|
+
}
|
|
455
|
+
try {
|
|
456
|
+
const r = await scope.pluginManager.installBundle(spec, { saveExact: true, enabled: true })
|
|
457
|
+
const application = String((r && r.application) || '')
|
|
458
|
+
const ok = application !== 'failed' && application !== 'cancelled'
|
|
459
|
+
const failure = r && r.error
|
|
460
|
+
const detail = failure
|
|
461
|
+
? String(failure.diagnostic || failure.message || failure.code || failure)
|
|
462
|
+
: 'install-failed'
|
|
463
|
+
results.push({
|
|
464
|
+
spec,
|
|
465
|
+
ok,
|
|
466
|
+
bundle: String((r && r.bundle) || spec.replace(/@[^@]*$/, '')),
|
|
467
|
+
version: String((r && r.version) || ''),
|
|
468
|
+
application,
|
|
469
|
+
error: ok ? '' : detail,
|
|
470
|
+
})
|
|
471
|
+
} catch (e) {
|
|
472
|
+
results.push({ spec, ok: false, error: String((e && e.message) || e) })
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
return sendJson(res, 200, { results })
|
|
476
|
+
},
|
|
477
|
+
}),
|
|
478
|
+
'share-chat: camp apply route',
|
|
479
|
+
)
|
|
480
|
+
|
|
481
|
+
scope.effect(
|
|
482
|
+
() =>
|
|
483
|
+
scope.webServer.register({
|
|
484
|
+
path: PREFIX + '/camp/remove',
|
|
485
|
+
kind: 'exact',
|
|
486
|
+
handler: async (req, res) => {
|
|
487
|
+
if (req.method !== 'POST') return sendJson(res, 405, { error: 'method', allow: 'POST' })
|
|
488
|
+
if (!isLoopbackOrigin(scope)) return sendJson(res, 403, { error: 'not-loopback' })
|
|
489
|
+
const body = await readJsonBody(req)
|
|
490
|
+
if (!body) return sendJson(res, 400, { error: 'bad-json' })
|
|
491
|
+
const targets = Array.isArray(body.targets) ? body.targets.slice(0, 12) : []
|
|
492
|
+
const results = []
|
|
493
|
+
for (const t of targets) {
|
|
494
|
+
const name = String(t || '')
|
|
495
|
+
if (!name || /\s/.test(name)) {
|
|
496
|
+
results.push({ name, ok: false, error: 'bad-name' })
|
|
497
|
+
continue
|
|
498
|
+
}
|
|
499
|
+
try {
|
|
500
|
+
const r = await scope.pluginManager.removeBundle(name)
|
|
501
|
+
results.push({ name, ok: true, application: String((r && r.application) || '') })
|
|
502
|
+
} catch (e) {
|
|
503
|
+
results.push({ name, ok: false, error: String((e && e.message) || e) })
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
return sendJson(res, 200, { results })
|
|
507
|
+
},
|
|
508
|
+
}),
|
|
509
|
+
'share-chat: camp remove route',
|
|
510
|
+
)
|
|
511
|
+
})
|
|
170
512
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-share-chat",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -11,14 +11,9 @@
|
|
|
11
11
|
"snapshot",
|
|
12
12
|
"minigame",
|
|
13
13
|
"meeting",
|
|
14
|
-
"
|
|
14
|
+
"camp"
|
|
15
15
|
],
|
|
16
|
-
"description": "Social chat, calls and shared session snapshots inside the DSH conversation view
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "git+https://gitee.com/laughing-faith/dsh-share-chat.git"
|
|
20
|
-
},
|
|
21
|
-
"homepage": "https://gitee.com/laughing-faith/dsh-share-chat#readme",
|
|
16
|
+
"description": "Social chat, calls, camps and shared session snapshots inside the DSH conversation view.",
|
|
22
17
|
"exports": {
|
|
23
18
|
".": "./index.js",
|
|
24
19
|
"./client": "./client.js",
|
|
@@ -31,9 +26,7 @@
|
|
|
31
26
|
"cordis.patch.yml",
|
|
32
27
|
"locale/*.json",
|
|
33
28
|
"docs",
|
|
34
|
-
"cli",
|
|
35
29
|
"README.md",
|
|
36
|
-
"CHANGELOG.md",
|
|
37
30
|
"LICENSE",
|
|
38
31
|
"icon.svg"
|
|
39
32
|
],
|
|
@@ -48,5 +41,10 @@
|
|
|
48
41
|
"@deepseek-ai/dsh-client-ui-conversation"
|
|
49
42
|
]
|
|
50
43
|
}
|
|
51
|
-
}
|
|
44
|
+
},
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "git+https://gitee.com/laughing-faith/dsh-share-chat.git"
|
|
48
|
+
},
|
|
49
|
+
"homepage": "https://gitee.com/laughing-faith/dsh-share-chat#readme"
|
|
52
50
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
# 更新记录
|
|
2
|
-
|
|
3
|
-
## 0.3.2
|
|
4
|
-
|
|
5
|
-
- **群聊**:侧栏改成「会话」,好友和群混排;新增「建群」按钮;群会话标题带人数,群里可「+人」拉人
|
|
6
|
-
- 群消息在气泡上方显示**发送者名字**(一对一不显示,保持干净)
|
|
7
|
-
- **真头像**:点头顶账号名上传头像;侧栏、群成员都用图片头像,没图的沿用首字母色块
|
|
8
|
-
- 群消息复用同一条消息流:`to = "g:<groupId>"`,游标 / 轮询 / 未读 / 上传 / 快照全都不用另做一套
|
|
9
|
-
- relay 端新增:`POST /api/avatar`、`POST|GET /api/groups`、`POST /api/groups/:id/members`、`/leave`、`/avatar`(仅群主)
|
|
10
|
-
- 网页版(`/chat/`)同步支持群聊与头像,并做成 PWA(可添加到主屏幕)
|
|
11
|
-
|
|
12
|
-
## 0.3.0
|
|
13
|
-
|
|
14
|
-
- 仓库整理:移除小游戏的移植层与部署脚手架(运行时动态执行模块源码的加载器、以及向本机回环发起 HTTP 的部署脚本)。
|
|
15
|
-
它们不属于插件运行时,却会被 dsh.so 的安全扫描判为 critical / warning;部署方式改为 docs/GAME.md 里的文字说明
|
|
16
|
-
|
|
17
|
-
- **包名改为 `dsh-share-chat`**(去掉 `@local/`,发布到 npm);`cordis.patch.yml` 的 row 名与 client 模块 id 一并修改
|
|
18
|
-
- 老用户从 `@local/dsh-share-chat` 迁移:先移除旧包,再 `dsh plugin add dsh-share-chat`
|
|
19
|
-
|
|
20
|
-
- **新增会议**:聊天页顶栏 `📹 开会`,新建/加入房间,最多 6 人音视频 + 屏幕共享
|
|
21
|
-
- 纯浏览器 WebRTC 网状直连,relay 只转发信令(SSE 长连接)与成员状态,**无时长限制**
|
|
22
|
-
- 工具栏:麦克风、摄像头、共享屏幕、复制房间号、离开;窗口可拖可缩放,`Esc` 离开
|
|
23
|
-
- STUN 用 Cloudflare / Google 公共节点;对称 NAT 下可能需要 TURN(后续在服务器加 coturn)
|
|
24
|
-
- relay 端:新增 `POST /api/meet/rooms`、`/join`、`/state`、`/signal`、`/leave` 与 `GET …/events`(SSE)
|
|
25
|
-
|
|
26
|
-
## 0.2.2
|
|
27
|
-
|
|
28
|
-
- 合并 0.1.6 的文件缩略图/卡片实现到 0.2 的新界面:图片、视频、音频内联,其它文件显示类型图标 + 类型 + 大小
|
|
29
|
-
- README 重写:三种不需要 Git 的安装方式(tgz / 本地文件夹 / npm),以及「为什么 git 地址必须装 Git」
|
|
30
|
-
- 新增 `docs/INSTALL.md`(安装与排错)、`docs/GAME.md`(小游戏移植与部署)、`CHANGELOG.md`
|
|
31
|
-
- 新增 `game-host/`(小游戏浏览器移植层)与 `tools/`(部署脚本 + nginx 片段)
|
|
32
|
-
- `docs/DETAIL.md` 补充小游戏、窗口尺寸设置与 50 MB 上限
|
|
33
|
-
|
|
34
|
-
## 0.2.1
|
|
35
|
-
|
|
36
|
-
- **界面重做**:整套样式改为注入一张 `<style>` + `--dsw-alias-*` 主题 token,亮色/暗色跟随 DSH
|
|
37
|
-
- 登录页:居中卡片、分段 tab、带标签输入框、聚焦光圈
|
|
38
|
-
- 聊天:头像、好友列表的最后一条摘要、双向气泡、时间戳、空状态
|
|
39
|
-
- 输入区:圆角输入框、表情/附件在框内、发送按钮禁用态
|
|
40
|
-
- 快照卡片、分享条(带预览)、设置页(预设卡片)
|
|
41
|
-
- 窄屏(≤720px)媒体查询
|
|
42
|
-
- 修复:文件消息的缩略图/卡片合并了 0.1.6 的实现(图片/视频/音频内联,其它显示类型图标)
|
|
43
|
-
|
|
44
|
-
## 0.2.0
|
|
45
|
-
|
|
46
|
-
- 首次引入 0.2 系列界面(注入 CSS、class 化组件),功能与 0.1.9 一致
|
|
47
|
-
|
|
48
|
-
## 0.1.9
|
|
49
|
-
|
|
50
|
-
- 小游戏窗口改为**原生 DOM 挂到 `document.body`**(`z-index: 2147483647`),绕开 DSH 面板的 stacking context 与裁切
|
|
51
|
-
- 窗口标题栏加点击诊断(`x,y → 命中区域`),`Esc` 关闭
|
|
52
|
-
|
|
53
|
-
## 0.1.8
|
|
54
|
-
|
|
55
|
-
- 点击问题排查版:窗口 `z-index` 提到最大、加 `pointer-events: auto`
|
|
56
|
-
|
|
57
|
-
## 0.1.7
|
|
58
|
-
|
|
59
|
-
- 小游戏窗口从全屏遮罩改为**右下角浮动窗口**:可拖标题栏、拉右下角改大小,尺寸存 localStorage
|
|
60
|
-
- 新增 **设置 → 社交小游戏**:预设(340×600 / 390×760 / 480×900)+ 自定义宽高 + 恢复默认
|
|
61
|
-
|
|
62
|
-
## 0.1.6
|
|
63
|
-
|
|
64
|
-
- 文件消息支持任意类型(≤50 MB):图片/视频/音频内联,其它文件显示类型图标与大小
|
|
65
|
-
- 上传失败文案由 8 MB 更正为 50 MB
|