dsh-chat-embed 0.6.9 → 0.6.11
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 +2 -0
- package/client.js +178 -82
- package/docs/architecture.md +1 -1
- package/docs/publishing.md +3 -3
- package/index.js +9 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -330,6 +330,8 @@ node scripts/release.mjs 0.6.7 --summary "..." --dry-run # 只看计划
|
|
|
330
330
|
|
|
331
331
|
| 版本 | 变化 |
|
|
332
332
|
| --- | --- |
|
|
333
|
+
| `0.6.11` | 补丁前的可写性判断从「不要尝试写入」改为「先执行,真被系统拒绝再给提权命令」:access(W_OK) 在 Windows 上可能误判,不该据此跳过尝试;并说明 DSH 授权弹窗与 Windows 提权是两条不同的闸 |
|
|
334
|
+
| `0.6.10` | 修好「重启保持登录」整条链路:开关不再因 ctx 作用域错误静默失败、变成可双向切换(开启/还原)、设置菜单两行合一、预填任务说明重写;Host 半补上 inject 依赖,探针路由与 agent 工具终于生效 |
|
|
333
335
|
| `0.6.9` | 设置菜单把「跨重启保持登录」与「检查补丁配置」合成一行(滑动开关 + 确认弹窗 + 新会话引导);发版改用 OIDC Trusted Publishing,不再保存 npm 令牌,并附带 provenance |
|
|
334
336
|
| `0.6.8` | 去掉单提交策略:发版改为普通提交 + 普通推送,不再 --orphan 重写、reflog expire、gc --prune 与强推;恢复 git log/diff/blame/bisect,发版失败可 reset 回退,并为 OIDC provenance 扫清障碍 |
|
|
335
337
|
| `0.6.7` | 发版脚本:一条命令完成 bump/gate/提交/推送/等 CI/发布/打 tag/建 release;新增 dependabot 自动维护固定 SHA 的 Action |
|
package/client.js
CHANGED
|
@@ -102,8 +102,20 @@ window.__ModuleLoader__.load({
|
|
|
102
102
|
let rightDisposers = []
|
|
103
103
|
let openRightTabImpl = () => {}
|
|
104
104
|
|
|
105
|
+
/**
|
|
106
|
+
* The context handed to apply().
|
|
107
|
+
*
|
|
108
|
+
* The components and helpers live at module scope, so they cannot close over
|
|
109
|
+
* apply's parameter. Everything that needs a service after apply has returned —
|
|
110
|
+
* the restart-login action, for one — reads it from here. A re-applied bundle
|
|
111
|
+
* overwrites it, which is what keeps a hot reload honest.
|
|
112
|
+
*
|
|
113
|
+
* @type {any}
|
|
114
|
+
*/
|
|
115
|
+
let activeCtx = undefined
|
|
116
|
+
|
|
105
117
|
/** Build identity, surfaced in the panel so a packaged app can be diagnosed. */
|
|
106
|
-
const BUILD = '0.6.
|
|
118
|
+
const BUILD = '0.6.11'
|
|
107
119
|
|
|
108
120
|
/** Where a re-applied instance finds the one it must take over from. */
|
|
109
121
|
const INSTANCE_KEY = '__DSH_CHAT_EMBED_INSTANCE__'
|
|
@@ -264,22 +276,22 @@ window.__ModuleLoader__.load({
|
|
|
264
276
|
'Experimental: the patch rewrites the app.asar of the desktop shell and needs write access to its install folder. A shell update replaces it, so the patch has to be applied again.',
|
|
265
277
|
persistCheckHint: 'Opens a new session and drafts the check for you',
|
|
266
278
|
persistConfirmTitle: 'Turn on “login across restarts”?',
|
|
267
|
-
persistConfirmNote: 'Continuing opens a new session
|
|
279
|
+
persistConfirmNote: 'Continuing opens a new session containing the task and the known facts; sending it lets the agent apply the patch and hand you the elevated command if permissions block it.',
|
|
268
280
|
persistConfirmGo: 'Continue',
|
|
269
281
|
persistConfirmCancel: 'Cancel',
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
282
|
+
persistOffTitle: 'Turn off "logins survive restarts"?',
|
|
283
|
+
persistOffBody: 'This removes the patch and puts the original app.asar back. Every restart will ask you to sign in again; flip the switch to undo.',
|
|
284
|
+
restoreTask: 'Remove the DSH desktop shell patch that keeps embedded chat logins across restarts, restoring the original app.asar.',
|
|
285
|
+
restoreStepsTitle: 'Restore steps (DSH must be fully quit first)',
|
|
286
|
+
restoreWarning: 'After this, logins no longer survive a restart.',
|
|
287
|
+
|
|
288
|
+
patchNoWorkspace: 'This composition has no Session service; the patch instructions were copied to the clipboard.',
|
|
289
|
+
patchTask: 'Apply the DSH desktop shell patch that keeps embedded chat logins across restarts.',
|
|
290
|
+
patchTaskDir: 'Install directory',
|
|
291
|
+
patchTaskCommand: 'Command',
|
|
292
|
+
patchTaskReadonly: 'The plugin reports this directory as not writable, which can be wrong: run it anyway and let the system answer. Only if the write is actually refused, hand me the command that needs administrator rights — do not work around it another way.',
|
|
293
|
+
patchTaskNoSite: 'This shell version has no patch site, so the patch does not apply — explain why and change nothing else.',
|
|
294
|
+
patchTaskVerify: 'When it is done, tell me how to verify (restart DSH, reopen the settings menu).',
|
|
283
295
|
copyDiag: 'Copy diagnostics',
|
|
284
296
|
copied: 'Copied',
|
|
285
297
|
copyFailed: 'Copy failed',
|
|
@@ -358,22 +370,21 @@ window.__ModuleLoader__.load({
|
|
|
358
370
|
persistRisk: '实验性功能:补丁会改写桌面壳的 app.asar,需要安装目录的写权限;桌面壳升级会覆盖补丁,需要重新打一次。',
|
|
359
371
|
persistCheckHint: '打开新会话,把检查内容写好,点发送即可',
|
|
360
372
|
persistConfirmTitle: '开启「重启保持登录」?',
|
|
361
|
-
persistConfirmNote: '
|
|
373
|
+
persistConfirmNote: '点击「继续」会打开一个新会话,里面是给它的任务说明和已知事实;发送后由它完成补丁操作,遇到权限问题会给出需要提权的命令。',
|
|
362
374
|
persistConfirmGo: '继续',
|
|
363
375
|
persistConfirmCancel: '取消',
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
patchDetail: '说明',
|
|
376
|
+
persistOffTitle: '关闭「重启保持登录」?',
|
|
377
|
+
persistOffBody: '会撤掉补丁、恢复原版 app.asar。之后每次重启都要重新登录;想再开启,再点一次这个开关即可。',
|
|
378
|
+
restoreTask: '把 DSH 桌面版的「重启保持登录」补丁撤掉,恢复原版 app.asar。',
|
|
379
|
+
restoreStepsTitle: '还原步骤(必须在 DSH 完全退出后)',
|
|
380
|
+
restoreWarning: '撤掉后登录态不再跨重启保留,每次重启都要重新登录。',
|
|
381
|
+
patchNoWorkspace: '当前拼装没有会话服务,补丁说明已复制到剪贴板。',
|
|
382
|
+
patchTask: '给 DSH 桌面版打上「跨重启保持登录」补丁。',
|
|
383
|
+
patchTaskDir: '安装目录',
|
|
384
|
+
patchTaskCommand: '命令',
|
|
385
|
+
patchTaskReadonly: '插件探测显示安装目录不可写(可能误判):照常执行,让系统自己回答。如果确实被拒绝写入,再把需要管理员权限的命令给我,不要用别的办法绕过。',
|
|
386
|
+
patchTaskNoSite: '当前桌面壳版本找不到补丁点,补丁不适用——说明原因即可,不要改别的。',
|
|
387
|
+
patchTaskVerify: '打好后告诉我怎么验证(重启 DSH,回设置菜单看状态)。',
|
|
377
388
|
copyDiag: '复制诊断信息',
|
|
378
389
|
copied: '已复制',
|
|
379
390
|
copyFailed: '复制失败',
|
|
@@ -2113,6 +2124,14 @@ window.__ModuleLoader__.load({
|
|
|
2113
2124
|
if (method === 'layout') {
|
|
2114
2125
|
const layout = typeof ctx.get === 'function' ? ctx.get('layout') : undefined
|
|
2115
2126
|
const out = { service: layout !== undefined && layout !== null, keys: [], hasMain: undefined, activePanelId: undefined, nav: [] }
|
|
2127
|
+
// The patch helper needs this service; report it here so a broken
|
|
2128
|
+
// composition is visible without clicking through the dialog.
|
|
2129
|
+
const workspace = typeof ctx.get === 'function' ? ctx.get('uiWorkspace') : undefined
|
|
2130
|
+
out.uiWorkspace = workspace !== undefined && workspace !== null
|
|
2131
|
+
out.uiWorkspaceStartSession = out.uiWorkspace && typeof workspace.startSession === 'function'
|
|
2132
|
+
out.patchCheckRunning = patchCheck.running
|
|
2133
|
+
out.activeCtx = activeCtx !== undefined && activeCtx !== null
|
|
2134
|
+
out.probeLoaded = patchProbe.loaded
|
|
2116
2135
|
if (out.service) {
|
|
2117
2136
|
out.keys = Object.keys(layout)
|
|
2118
2137
|
if (typeof layout.hasMainPanel === 'function') {
|
|
@@ -2522,15 +2541,25 @@ window.__ModuleLoader__.load({
|
|
|
2522
2541
|
try {
|
|
2523
2542
|
// The Host half serves this route; a relative fetch therefore works in
|
|
2524
2543
|
// both the desktop app and the Web GUI, under any deployment prefix.
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2544
|
+
// Never let a stuck request hold the click hostage: without a timeout the
|
|
2545
|
+
// whole action waits on a route that may not even exist.
|
|
2546
|
+
const controller = new AbortController()
|
|
2547
|
+
const timer = setTimeout(() => controller.abort(), 4000)
|
|
2548
|
+
let response
|
|
2549
|
+
try {
|
|
2550
|
+
response = await fetch('./dsh-chat-embed/patch-check', {
|
|
2551
|
+
method: 'GET',
|
|
2552
|
+
headers: { accept: 'application/json' },
|
|
2553
|
+
cache: 'no-store',
|
|
2554
|
+
signal: controller.signal,
|
|
2555
|
+
})
|
|
2556
|
+
} finally {
|
|
2557
|
+
clearTimeout(timer)
|
|
2558
|
+
}
|
|
2530
2559
|
patchProbe.value = response.ok ? await response.json() : undefined
|
|
2531
2560
|
} catch (error) {
|
|
2532
2561
|
patchProbe.value = undefined
|
|
2533
|
-
|
|
2562
|
+
log('warn', 'probe: the Host route did not answer: ' + messageOf(error))
|
|
2534
2563
|
}
|
|
2535
2564
|
patchProbe.loaded = true
|
|
2536
2565
|
return patchProbe.value
|
|
@@ -2548,26 +2577,81 @@ window.__ModuleLoader__.load({
|
|
|
2548
2577
|
* @param {(key: string) => string} t
|
|
2549
2578
|
* @returns {Promise<void>}
|
|
2550
2579
|
*/
|
|
2551
|
-
async function openPatchCheckSession(t) {
|
|
2552
|
-
const
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
return
|
|
2558
|
-
}
|
|
2559
|
-
patchCheck.running = true
|
|
2560
|
-
notify()
|
|
2580
|
+
async function openPatchCheckSession(t, mode) {
|
|
2581
|
+
const host = activeCtx
|
|
2582
|
+
// Nothing in here may fail silently: a click that does nothing is
|
|
2583
|
+
// indistinguishable from a broken build, so every step is logged and the
|
|
2584
|
+
// reason comes back to the dialog.
|
|
2585
|
+
let failure = ''
|
|
2561
2586
|
try {
|
|
2587
|
+
log('info', 'patch-check: entered')
|
|
2588
|
+
const workspace = host !== undefined && typeof host.get === 'function' ? host.get('uiWorkspace') : undefined
|
|
2589
|
+
log(
|
|
2590
|
+
'info',
|
|
2591
|
+
'patch-check: uiWorkspace ' +
|
|
2592
|
+
(workspace === undefined || workspace === null ? 'missing' : 'startSession=' + typeof workspace.startSession),
|
|
2593
|
+
)
|
|
2594
|
+
if (workspace === undefined || workspace === null || typeof workspace.startSession !== 'function') {
|
|
2595
|
+
void copyText(patchInstructions(t, patchProbe.value))
|
|
2596
|
+
failure = t('patchNoWorkspace')
|
|
2597
|
+
return failure
|
|
2598
|
+
}
|
|
2599
|
+
patchCheck.running = true
|
|
2600
|
+
notify()
|
|
2562
2601
|
const probe = await fetchProbe()
|
|
2563
|
-
|
|
2602
|
+
log('info', 'patch-check: probe ' + (probe === undefined || probe === null ? 'absent' : 'ok'))
|
|
2603
|
+
const prompt = mode === 'off' ? buildRestorePrompt(t, probe) : buildPatchPrompt(t, probe)
|
|
2564
2604
|
patchProbe.loaded = false
|
|
2565
|
-
|
|
2605
|
+
// A custom main panel stays selected when a Session opens, so the new
|
|
2606
|
+
// Session lands behind this panel and the click looks like a no-op.
|
|
2607
|
+
// Hand the main area back to the conversation first.
|
|
2608
|
+
const layout = host !== undefined && typeof host.get === 'function' ? host.get('layout') : undefined
|
|
2609
|
+
if (layout !== undefined && layout !== null && typeof layout.selectPanel === 'function') {
|
|
2610
|
+
log('info', 'patch-check: releasing the main panel before opening the Session')
|
|
2611
|
+
layout.selectPanel(null)
|
|
2612
|
+
}
|
|
2613
|
+
log('info', 'patch-check: opening a Session with a ' + prompt.length + '-char draft')
|
|
2614
|
+
// 'replace', not 'append': the Workspace blank can already hold a draft
|
|
2615
|
+
// from another flow (the plugin-creation template, for one), and appending
|
|
2616
|
+
// would hand the agent two unrelated instructions at once.
|
|
2617
|
+
workspace.startSession(undefined, { prompt, whenDraftExists: 'replace' })
|
|
2618
|
+
log('info', 'patch-check: startSession returned')
|
|
2566
2619
|
} catch (error) {
|
|
2567
|
-
|
|
2620
|
+
failure = messageOf(error)
|
|
2621
|
+
log('error', 'patch-check: failed', failure)
|
|
2622
|
+
void copyText(patchInstructions(t, patchProbe.value) + '\n' + t('copyFailed') + ': ' + failure)
|
|
2623
|
+
} finally {
|
|
2624
|
+
patchCheck.running = false
|
|
2625
|
+
notify()
|
|
2568
2626
|
}
|
|
2569
|
-
|
|
2570
|
-
|
|
2627
|
+
return failure
|
|
2628
|
+
}
|
|
2629
|
+
|
|
2630
|
+
/**
|
|
2631
|
+
* The draft for the other direction: put the original app.asar back.
|
|
2632
|
+
*
|
|
2633
|
+
* Turning the switch off is a real operation, not a dead end — the patch
|
|
2634
|
+
* kept a copy, so undoing it is a rename away.
|
|
2635
|
+
*
|
|
2636
|
+
* @param {(key: string) => string} t
|
|
2637
|
+
* @param {any} [probe]
|
|
2638
|
+
* @returns {string}
|
|
2639
|
+
*/
|
|
2640
|
+
function buildRestorePrompt(t, probe) {
|
|
2641
|
+
const info = probe !== undefined && probe !== null ? probe : {}
|
|
2642
|
+
const lines = [t('restoreTask')]
|
|
2643
|
+
if (typeof info.resources === 'string' && info.resources !== '') {
|
|
2644
|
+
lines.push('', t('patchTaskDir') + ': ' + info.resources)
|
|
2645
|
+
}
|
|
2646
|
+
if (typeof info.asar === 'string' && info.asar !== '') {
|
|
2647
|
+
lines.push('', t('restoreStepsTitle') + ':')
|
|
2648
|
+
lines.push(' 1. ' + info.asar + ' -> ' + info.asar + '.patched.bak')
|
|
2649
|
+
lines.push(' 2. ' + info.asar + '.orig -> ' + info.asar)
|
|
2650
|
+
}
|
|
2651
|
+
if (info.writable === false) lines.push('', t('patchTaskReadonly'))
|
|
2652
|
+
lines.push('', t('restoreWarning'))
|
|
2653
|
+
lines.push('', t('patchTaskVerify'))
|
|
2654
|
+
return lines.join('\n')
|
|
2571
2655
|
}
|
|
2572
2656
|
|
|
2573
2657
|
/**
|
|
@@ -2579,34 +2663,20 @@ window.__ModuleLoader__.load({
|
|
|
2579
2663
|
* @returns {string}
|
|
2580
2664
|
*/
|
|
2581
2665
|
function buildPatchPrompt(t, probe) {
|
|
2582
|
-
const
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
row('resources', probe.resources)
|
|
2591
|
-
row('app.asar', probe.asar)
|
|
2592
|
-
row('app.asar.orig', probe.backup === true ? t('patchYes') : t('patchNo'))
|
|
2593
|
-
row(t('patchWritable'), probe.writable === true ? t('patchYes') : t('patchNo'))
|
|
2594
|
-
row(
|
|
2595
|
-
t('patchSiteLabel'),
|
|
2596
|
-
probe.patchSite === true ? t('patchPresent') : probe.patchSite === false ? t('patchMissing') : t('patchUnknown'),
|
|
2597
|
-
)
|
|
2598
|
-
row(
|
|
2599
|
-
t('patchApplied'),
|
|
2600
|
-
probe.patched === true ? t('patchYes') : probe.patched === false ? t('patchNo') : t('patchUnknown'),
|
|
2601
|
-
)
|
|
2602
|
-
if (typeof probe.patchCommand === 'string' && probe.patchCommand !== '') {
|
|
2603
|
-
facts.push('')
|
|
2604
|
-
facts.push(t('patchCommandLabel'))
|
|
2605
|
-
facts.push(probe.patchCommand)
|
|
2606
|
-
}
|
|
2607
|
-
if (typeof probe.detail === 'string' && probe.detail !== '') facts.push(t('patchDetail') + ': ' + probe.detail)
|
|
2666
|
+
const info = probe !== undefined && probe !== null ? probe : {}
|
|
2667
|
+
// The plugin already knows the state; the draft only says what to do about
|
|
2668
|
+
// it. Anything the patch script enforces itself (byte checks, quitting
|
|
2669
|
+
// first) does not belong here — that is a manual, not an instruction.
|
|
2670
|
+
const lines = [t('patchTask')]
|
|
2671
|
+
const command = typeof info.patchCommand === 'string' && info.patchCommand !== '' ? info.patchCommand : ''
|
|
2672
|
+
if (typeof info.resources === 'string' && info.resources !== '') {
|
|
2673
|
+
lines.push('', t('patchTaskDir') + ': ' + info.resources)
|
|
2608
2674
|
}
|
|
2609
|
-
|
|
2675
|
+
if (command !== '') lines.push('', t('patchTaskCommand') + ':', ' ' + command)
|
|
2676
|
+
if (info.writable === false) lines.push('', t('patchTaskReadonly'))
|
|
2677
|
+
if (info.patchSite === false) lines.push('', t('patchTaskNoSite'))
|
|
2678
|
+
lines.push('', t('patchTaskVerify'))
|
|
2679
|
+
return lines.join('\n')
|
|
2610
2680
|
}
|
|
2611
2681
|
|
|
2612
2682
|
/** @returns {{ state: string, detail: string, seats: any[] }} */
|
|
@@ -3255,6 +3325,8 @@ window.__ModuleLoader__.load({
|
|
|
3255
3325
|
const [barOpen, setBarOpen] = React.useState(false)
|
|
3256
3326
|
const [menuOpen, setMenuOpen] = React.useState(false)
|
|
3257
3327
|
const [confirmOpen, setConfirmOpen] = React.useState(false)
|
|
3328
|
+
const [confirmError, setConfirmError] = React.useState('')
|
|
3329
|
+
const [confirmMode, setConfirmMode] = React.useState('on')
|
|
3258
3330
|
|
|
3259
3331
|
/**
|
|
3260
3332
|
* Close the settings menu.
|
|
@@ -3514,7 +3586,10 @@ window.__ModuleLoader__.load({
|
|
|
3514
3586
|
title: t('persistCheckHint'),
|
|
3515
3587
|
disabled: patchCheck.running,
|
|
3516
3588
|
onClick: () => {
|
|
3589
|
+
log('info', 'dialog: opened by the restart-login switch')
|
|
3517
3590
|
closeMenu()
|
|
3591
|
+
// The switch is a switch: on means the next click offers to undo it.
|
|
3592
|
+
setConfirmMode(persistenceState() === 'on' ? 'off' : 'on')
|
|
3518
3593
|
setConfirmOpen(true)
|
|
3519
3594
|
},
|
|
3520
3595
|
}),
|
|
@@ -3573,9 +3648,16 @@ window.__ModuleLoader__.load({
|
|
|
3573
3648
|
'data-modal': 'true',
|
|
3574
3649
|
'aria-label': t('persistConfirmTitle'),
|
|
3575
3650
|
},
|
|
3576
|
-
h(
|
|
3577
|
-
|
|
3578
|
-
|
|
3651
|
+
h(
|
|
3652
|
+
'div',
|
|
3653
|
+
{ className: 'dce-card-title' },
|
|
3654
|
+
t(confirmMode === 'off' ? 'persistOffTitle' : 'persistConfirmTitle'),
|
|
3655
|
+
),
|
|
3656
|
+
h('div', { className: 'dce-card-body' }, t(confirmMode === 'off' ? 'persistOffBody' : 'persistRisk')),
|
|
3657
|
+
confirmMode === 'off'
|
|
3658
|
+
? null
|
|
3659
|
+
: h('div', { className: 'dce-card-body' }, t('persistConfirmNote')),
|
|
3660
|
+
confirmError === '' ? null : h('div', { className: 'dce-card-detail' }, confirmError),
|
|
3579
3661
|
h(
|
|
3580
3662
|
'div',
|
|
3581
3663
|
{ className: 'dce-card-actions' },
|
|
@@ -3590,9 +3672,21 @@ window.__ModuleLoader__.load({
|
|
|
3590
3672
|
type: 'button',
|
|
3591
3673
|
className: 'dce-button dce-button-primary',
|
|
3592
3674
|
'data-persist-confirm': 'true',
|
|
3675
|
+
disabled: patchCheck.running,
|
|
3593
3676
|
onClick: () => {
|
|
3594
|
-
|
|
3595
|
-
|
|
3677
|
+
log('info', 'dialog: the confirm button was clicked')
|
|
3678
|
+
setConfirmError('')
|
|
3679
|
+
void openPatchCheckSession(t, confirmMode).then(
|
|
3680
|
+
(failure) => {
|
|
3681
|
+
if (typeof failure === 'string' && failure !== '') setConfirmError(failure)
|
|
3682
|
+
else setConfirmOpen(false)
|
|
3683
|
+
},
|
|
3684
|
+
(error) => {
|
|
3685
|
+
const reason = messageOf(error)
|
|
3686
|
+
log('error', 'dialog: openPatchCheckSession rejected', reason)
|
|
3687
|
+
setConfirmError(reason)
|
|
3688
|
+
},
|
|
3689
|
+
)
|
|
3596
3690
|
},
|
|
3597
3691
|
},
|
|
3598
3692
|
t('persistConfirmGo'),
|
|
@@ -3846,6 +3940,7 @@ window.__ModuleLoader__.load({
|
|
|
3846
3940
|
patchCheck,
|
|
3847
3941
|
openPatchCheckSession,
|
|
3848
3942
|
buildPatchPrompt,
|
|
3943
|
+
buildRestorePrompt,
|
|
3849
3944
|
setLogging,
|
|
3850
3945
|
clearLog,
|
|
3851
3946
|
readLogEntries,
|
|
@@ -3923,6 +4018,7 @@ window.__ModuleLoader__.load({
|
|
|
3923
4018
|
}
|
|
3924
4019
|
}
|
|
3925
4020
|
if (carrier !== undefined) carrier[INSTANCE_KEY] = { version: BUILD, dispose: disposeAll }
|
|
4021
|
+
activeCtx = ctx
|
|
3926
4022
|
|
|
3927
4023
|
// Locale dictionaries first: the entry label reads them.
|
|
3928
4024
|
disposers.push(ctx.effect(() => ctx.locale.register(NS, DICTS), 'dsh-chat-embed: dictionaries'))
|
package/docs/architecture.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
本文记录 `client.js` 里每一条**反直觉**的实现决策、支撑它的证据,以及升级桌面壳时必须重新验证的清单。
|
|
4
4
|
|
|
5
5
|
目标运行环境:**`@deepseek-ai/dsh-desktop 0.2.2-rc.1`(Electron / Chromium)**。
|
|
6
|
-
当前实现:**v0.6.
|
|
6
|
+
当前实现:**v0.6.11**(`client.js` 约 3985 行,85 项契约测试)。
|
|
7
7
|
|
|
8
8
|
> **架构一句话**:聊天页直接渲染在**席位的布局盒**里(`.dce-panel.dce-inline`,`width/height:100%`),几何完全交给 CSS;席位只有两个 —— 中央主面板(`main`)和右栏聊天 tab —— 二者互斥,**哪边点哪边接管**,切换时 guest 重建一次并回到上次会话。
|
|
9
9
|
|
package/docs/publishing.md
CHANGED
|
@@ -137,8 +137,8 @@ Get-FileHash $env:TEMP\check\dsh-chat-embed-<版本>.tgz -Algorithm SHA256
|
|
|
137
137
|
| --- | --- |
|
|
138
138
|
| 仓库 | <https://github.com/poluce/dsh-chat-embed> |
|
|
139
139
|
| Release | <https://github.com/poluce/dsh-chat-embed/releases> |
|
|
140
|
-
| 分发包 | `dsh-chat-embed-0.6.
|
|
141
|
-
| npm | `dsh-chat-embed@0.6.
|
|
140
|
+
| 分发包 | `dsh-chat-embed-0.6.11.tgz`(16 个文件,约 70 kB) |
|
|
141
|
+
| npm | `dsh-chat-embed@0.6.11`(<https://www.npmjs.com/package/dsh-chat-embed>,维护者 `poluce_auto`) |
|
|
142
142
|
| 商店图标 | `assets/icon-180.png`(180×180 PNG) |
|
|
143
143
|
| 商店截图 | `assets/screenshots/` + 仓库根 `screenshots.json`(6 张) |
|
|
144
144
|
|
|
@@ -157,7 +157,7 @@ dsh plugin --profile desktop add git+https://github.com/poluce/dsh-chat-embed.gi
|
|
|
157
157
|
|
|
158
158
|
1. 注册账号并完成邮箱验证:<https://www.npmjs.com/signup>;
|
|
159
159
|
2. 本机登录:`npm login`(浏览器确认或一次性密码;开了 2FA 输入验证码);
|
|
160
|
-
3. 发布:`npm publish`(`prepack` 自动跑门禁;包名 `dsh-chat-embed` 已发布 `0.6.
|
|
160
|
+
3. 发布:`npm publish`(`prepack` 自动跑门禁;包名 `dsh-chat-embed` 已发布 `0.6.11`);
|
|
161
161
|
4. 使用者随后只需:`dsh plugin --profile desktop add dsh-chat-embed`。
|
|
162
162
|
|
|
163
163
|
## 发布前后检查项
|
package/index.js
CHANGED
|
@@ -26,6 +26,15 @@ import { fileURLToPath } from 'node:url'
|
|
|
26
26
|
|
|
27
27
|
export const name = 'dsh-chat-embed'
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Wait for the two Host services before apply runs.
|
|
31
|
+
*
|
|
32
|
+
* Without this the loader calls apply while the tree is still assembling, both
|
|
33
|
+
* looksups below read undefined, and the probe route and the agent tool are
|
|
34
|
+
* silently skipped — which is exactly what happened until 0.6.10.
|
|
35
|
+
*/
|
|
36
|
+
export const inject = ['webServer', 'tools']
|
|
37
|
+
|
|
29
38
|
/** Route the panel fetches for the read-only shell probe. */
|
|
30
39
|
const PROBE_PATH = '/dsh-chat-embed/patch-check'
|
|
31
40
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-chat-embed",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.11",
|
|
4
4
|
"author": "poluce <fishsummer@126.com>",
|
|
5
5
|
"description": "Multi-tab AI chat embed for the DeepSeek Harness desktop app: DeepSeek, 豆包, ChatGPT, MiniMax, Kimi, Gemini and Grok, each signed in separately.",
|
|
6
6
|
"type": "module",
|