@kingsleyasher/dsh-knowledge-base 3.1.6 → 3.1.7
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/PROJECT-RECORD.en.md +17 -11
- package/PROJECT-RECORD.md +17 -11
- package/README.md +7 -9
- package/README.zh-CN.md +7 -7
- package/RELEASE.en.md +16 -0
- package/RELEASE.md +16 -0
- package/VERSIONING.en.md +1 -1
- package/VERSIONING.md +1 -1
- package/cordis.patch.yml +1 -1
- package/docs/client/PROJECT-RECORD.en.md +6 -2
- package/docs/client/PROJECT-RECORD.md +6 -2
- package/package.json +3 -5
- package/packages/kb-core/src/kbcore.js +50 -27
- package/packages/kb-core/src/workbench.js +20 -3
- package/packages/kb-service/desktop-files.js +23 -5
- package/packages/kb-service/host-adapter.js +6 -5
- package/packages/kb-service/host-request-auth.js +31 -0
- package/packages/kb-service/host-updates.js +21 -91
- package/packages/kb-service/legacy-ports.js +5 -1
- package/packages/kb-service/safe-update.js +104 -104
- package/packages/kb-service/service.js +8 -2
- package/packages/kb-service/tool-definitions.json +5 -0
- package/packages/kb-service/tool-router.js +13 -1
- package/src/client/index.js +18 -12
- package/src/host/index.js +29 -18
- package/src/host/updates.js +5 -5
- package/tools/kb-transactional-update.py +11 -19
- package/NPM-EDITION.md +0 -12
package/src/client/index.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// + ctx.slots.register({ name:'sidebar.panellist', id:同一个面板 id, order, label }, Icon)
|
|
10
10
|
// 行上的 id 必须指向已登记的主区面板;主区键位缺失时宿主会抛错、当前选择不变。
|
|
11
11
|
window.__ModuleLoader__.load({
|
|
12
|
-
id: '@
|
|
12
|
+
id: '@local/dsh-knowledge-base',
|
|
13
13
|
factory: (require) => {
|
|
14
14
|
const module = { exports: {} }
|
|
15
15
|
const exports = module.exports
|
|
@@ -3342,7 +3342,7 @@ body:not([data-ds-dark-theme]) .kbm option{background:#fff;color:#0f1115}
|
|
|
3342
3342
|
// A host-owned installation can outlive this module during HMR. Persist its
|
|
3343
3343
|
// request ID, then reconcile via the native manager and the active build.
|
|
3344
3344
|
function createClientUpdateFlow({ api, manager, storage, notify, clientVersion = () => null, retryLater, delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms)) }) {
|
|
3345
|
-
const key = 'dsh-kb-
|
|
3345
|
+
const key = 'dsh-kb-update-operation'
|
|
3346
3346
|
let running = null, retryQueued = false
|
|
3347
3347
|
const read = () => { try { return JSON.parse(storage.getItem(key)) } catch { return null } }
|
|
3348
3348
|
const save = (record) => { try { storage.setItem(key, JSON.stringify(record)) } catch { throw Error('无法保存更新状态,请检查客户端存储后重试') } }
|
|
@@ -3482,6 +3482,8 @@ body:not([data-ds-dark-theme]) .kbm option{background:#fff;color:#0f1115}
|
|
|
3482
3482
|
}
|
|
3483
3483
|
return
|
|
3484
3484
|
}
|
|
3485
|
+
const remote = manager()
|
|
3486
|
+
if (typeof remote?.installBundle !== 'function' || typeof remote?.waitForInstall !== 'function') throw Error('当前宿主未提供客户端安装接口,请使用宿主插件管理器')
|
|
3485
3487
|
show('正在下载并校验安装包…', { busy: true })
|
|
3486
3488
|
const prepared = await api({ op: 'updates.prepare', expectedVersion })
|
|
3487
3489
|
if (!prepared?.ok || prepared.latestVersion !== expectedVersion || !/^[a-f0-9]{16}$/.test(prepared.buildId || '') || typeof prepared.spec !== 'string') throw Error(prepared?.error || '下载结果无效')
|
|
@@ -3545,14 +3547,17 @@ body:not([data-ds-dark-theme]) .kbm option{background:#fff;color:#0f1115}
|
|
|
3545
3547
|
}
|
|
3546
3548
|
function isAutomaticUpdate(update) {
|
|
3547
3549
|
return update?.ok && update.updateAvailable === true && update.autoInstallEligible === true && update.installSupported !== false &&
|
|
3548
|
-
|
|
3550
|
+
/^[a-f0-9]{16}$/.test(update.buildId || '') && Boolean(update.latestVersion)
|
|
3549
3551
|
}
|
|
3550
3552
|
function maybeAutoInstallUpdate(update = buildBadgeState.update) {
|
|
3551
3553
|
const candidates = availableUpdates({ ...buildBadgeState, update }).map(release => ({ ...release, installSupported: update?.installSupported })).filter(isAutomaticUpdate).sort((a,b) => compareReleaseVersions(b.latestVersion,a.latestVersion))
|
|
3552
3554
|
update = candidates[0]
|
|
3553
3555
|
if (!update) return
|
|
3556
|
+
const manager = updateManager
|
|
3557
|
+
if (typeof manager?.installBundle !== 'function' || typeof manager?.waitForInstall !== 'function') return
|
|
3554
3558
|
if (updateViewState.busy || updateViewState.uncertain || updateViewState.restartRequired || updateViewState.refreshRequired) return
|
|
3555
|
-
|
|
3559
|
+
if (!/^[a-f0-9]{16}$/.test(update.buildId || '') || !update.latestVersion) return
|
|
3560
|
+
const attempt = update.latestVersion + ':' + update.buildId
|
|
3556
3561
|
if (automaticUpdateAttempts.has(attempt)) return
|
|
3557
3562
|
automaticUpdateAttempts.add(attempt)
|
|
3558
3563
|
void updateFlow.install(update.latestVersion)
|
|
@@ -3606,16 +3611,17 @@ body:not([data-ds-dark-theme]) .kbm option{background:#fff;color:#0f1115}
|
|
|
3606
3611
|
if (update.channel === 'local' || update.status === 'candidate' || update.checkSkipped) return update.message || '本机试用版尚未进行在线更新检查'
|
|
3607
3612
|
if (update.migrationRequired) return update.updateAvailable ? '发现正式版 ' + update.latestVersion + ';本机试用版需手动迁移' : '本机试用版;正式发布版本 ' + update.latestVersion
|
|
3608
3613
|
if (!update.onlineChecked && !update.sourceStatus?.some(source => source.ok)) return update.message || '尚未完成在线更新检查'
|
|
3609
|
-
if (update.updateAvailable) return '发现新版本 ' + update.latestVersion
|
|
3614
|
+
if (update.updateAvailable) return '发现新版本 ' + update.latestVersion
|
|
3610
3615
|
if (update.ahead) return '当前版本高于更新源;最新发布版本 ' + update.latestVersion
|
|
3611
3616
|
return update.currentChannel === 'preview' ? '已是最新预览版' : '已是最新正式版'
|
|
3612
3617
|
}
|
|
3613
3618
|
function BuildBadge({ passive = false } = {}) {
|
|
3614
3619
|
const { version, update, checking } = react.useSyncExternalStore(subscribeBuildBadge, getBuildBadge, getBuildBadge)
|
|
3615
3620
|
const [updating, setUpdating] = react.useState(updateViewState)
|
|
3621
|
+
const [canInstall, setCanInstall] = react.useState(Boolean(updateManager))
|
|
3616
3622
|
react.useEffect(() => {
|
|
3617
3623
|
const changed = (event) => { if (event.detail) setUpdating(event.detail) }
|
|
3618
|
-
const capability = () => { void updateFlow.recover() }
|
|
3624
|
+
const capability = () => { setCanInstall(Boolean(updateManager)); void updateFlow.recover() }
|
|
3619
3625
|
window.addEventListener('kb-plugin-update', changed)
|
|
3620
3626
|
window.addEventListener('kb-update-capability', capability)
|
|
3621
3627
|
capability()
|
|
@@ -3639,7 +3645,7 @@ body:not([data-ds-dark-theme]) .kbm option{background:#fff;color:#0f1115}
|
|
|
3639
3645
|
...(update.preview?.downloadSources || []).map(s => e('a', { key: 'preview-' + s.id, href: s.url, target: '_blank', rel: 'noopener noreferrer', style: { marginRight: 12 } }, s.name + ' 预览版下载'))) : null,
|
|
3640
3646
|
!checking && update?.preview?.updateAvailable ? e(react.Fragment, null,
|
|
3641
3647
|
e('span', { role: 'status' }, '发现可选预览版 ' + update.preview.latestVersion + '(测试版本,按需选择)'),
|
|
3642
|
-
e('button', { className: 'kbc-btn kbc-btn-ghost', disabled: update.installSupported === false || updating.busy || updating.uncertain || updating.restartRequired || updating.refreshRequired,
|
|
3648
|
+
e('button', { className: 'kbc-btn kbc-btn-ghost', disabled: !canInstall || update.installSupported === false || updating.busy || updating.uncertain || updating.restartRequired || updating.refreshRequired,
|
|
3643
3649
|
onClick: () => { void updateFlow.install(update.preview.latestVersion) } }, '安装预览版'),
|
|
3644
3650
|
e('a', { href: update.preview.notesUrl, target: '_blank', rel: 'noopener noreferrer' }, '预览版说明')) : null,
|
|
3645
3651
|
!checking && update?.preview?.available === false ? e('span', { role: 'status' }, '暂无预览版') : null,
|
|
@@ -3648,8 +3654,8 @@ body:not([data-ds-dark-theme]) .kbm option{background:#fff;color:#0f1115}
|
|
|
3648
3654
|
updating.uncertain ? e('button', { className: 'kbc-btn kbc-btn-ghost', disabled: updating.busy, onClick: () => { void updateFlow.recover() } }, '核对更新状态') : null,
|
|
3649
3655
|
updating.refreshRequired ? e('button', { className: 'kbc-btn kbc-btn-ghost', onClick: () => window.location.reload() }, '刷新界面') : null,
|
|
3650
3656
|
!checking && update && update.ok && update.updateAvailable
|
|
3651
|
-
? e('button', { className: 'kbc-btn kbc-btn-ghost', disabled: update.installSupported === false || updating.busy || updating.uncertain || updating.restartRequired || updating.refreshRequired,
|
|
3652
|
-
title: update.installSupported !== false ? '自动下载、校验并由 DSH 安装;支持时直接热加载' : '
|
|
3657
|
+
? e('button', { className: 'kbc-btn kbc-btn-ghost', disabled: !canInstall || update.installSupported === false || updating.busy || updating.uncertain || updating.restartRequired || updating.refreshRequired,
|
|
3658
|
+
title: canInstall && update.installSupported !== false ? '自动下载、校验并由 DSH 安装;支持时直接热加载' : '当前宿主未提供客户端安装接口,请使用宿主插件管理器',
|
|
3653
3659
|
onClick: () => { void updateFlow.install(update.latestVersion) } }, updating.busy ? '更新中…' : '安装新版本') : null)
|
|
3654
3660
|
}
|
|
3655
3661
|
|
|
@@ -3727,7 +3733,7 @@ body:not([data-ds-dark-theme]) .kbm option{background:#fff;color:#0f1115}
|
|
|
3727
3733
|
if((updating.manualHelp||handoffError)&&!helpClosed)return reactDom.createPortal(e('div',{className:'kb-release-backdrop'},e('section',{className:'kb-release-card',role:'alertdialog','aria-modal':'true','aria-label':'更新未完成'},
|
|
3728
3734
|
e('h2',null,'自动更新未完成'),e('p',null,handoffError?'旧服务交接暂未完成,请等待现有任务结束或按恢复说明处理。':updating.message),
|
|
3729
3735
|
e('p',null,'请勿反复安装或清空知识库与解析记录。保存工作后,可按说明核对状态并恢复安装。'),
|
|
3730
|
-
e('a',{href:'https://
|
|
3736
|
+
e('a',{href:'https://github.com/KingsleyAsher/Personal-Knowledge-Base/blob/main/docs/UPDATE-RECOVERY.md',target:'_blank',rel:'noopener noreferrer'},'打开手动更新与恢复说明'),
|
|
3731
3737
|
e('button',{className:'kb-update-install',onClick:()=>{updateFailureMemory.dismiss(failureKey);setHelpClosed(true);window.dispatchEvent(new CustomEvent('kb-update-failure-dismissed'))}},'关闭'))),document.body)
|
|
3732
3738
|
if (updating.restartRequired && !restartDeferred) return reactDom.createPortal(e('div', { className: 'kb-release-backdrop', role: 'presentation' },
|
|
3733
3739
|
e('section', { className: 'kb-release-card', role: 'alertdialog', 'aria-modal': 'true', 'aria-labelledby': 'kb-restart-title', 'aria-describedby': 'kb-restart-intro' },
|
|
@@ -4641,13 +4647,13 @@ body:not([data-ds-dark-theme]) .kbm option{background:#fff;color:#0f1115}
|
|
|
4641
4647
|
}
|
|
4642
4648
|
// END GENERATED TODO LIFECYCLE UI
|
|
4643
4649
|
|
|
4644
|
-
const RELEASE_VERSION = '3.1.
|
|
4650
|
+
const RELEASE_VERSION = '3.1.7'
|
|
4645
4651
|
const RELEASE_NOTICE_STATE_KEY = 'dsh-kb-release-state'
|
|
4646
4652
|
// Keep shipped releases for summaries of versions skipped during this upgrade.
|
|
4647
4653
|
// Patch-only installs stay quiet; unread older notes do not widen the range.
|
|
4648
4654
|
const RELEASE_NOTICES = [
|
|
4655
|
+
{version:'3.1.7',items:['修复 DSH 中 kb_search 命中正文时的 JSON 校验错误。','知识库设置和事件接口先验证 DSH 宿主身份。']},
|
|
4649
4656
|
{version:'3.1.6',items:['修复收件箱归档已完成却返回结果未知的问题,回执同时显示索引同步状态。','自检在索引降幅触发保护时报告扫描差异与原因,并保留旧索引。']},
|
|
4650
|
-
{version:'3.1.5',items:['npm 版插件可检查正式版更新,并在支持安全交接的 DSH 安装中自动升级。']},
|
|
4651
4657
|
{version:'3.1.4',items:['修复 OCR 服务保存失败时只显示 HTTP 400,显示具体的配置校验原因。']},
|
|
4652
4658
|
{version:'3.1.3',items:['文件树与目录读取改用缓存:未变化的资料库不再每次重读目录和排除策略,客户端展开目录只请求新增项。','索引巡检在内容未变化时复用已有目录,减少周期性卡顿;资料内容变化仍会重新核对。']},
|
|
4653
4659
|
{version:'3.1.2',items:['共享模式补回解析工具说明和全体 Agent 规则:当前服务设置优先于记忆。','默认 OCR/ASR 失败时说明原因并询问,未经本次明确同意不切换本机、其他云端或脚本。']},
|
package/src/host/index.js
CHANGED
|
@@ -6,6 +6,8 @@ import { readCandidateBuild } from '../../packages/kb-service/build.js'
|
|
|
6
6
|
import {publishKnowledgeMemory} from '../../packages/kb-service/memory-sync.js';
|
|
7
7
|
import {handleEmbeddedMemory} from '../../packages/kb-service/memory-channel.js';
|
|
8
8
|
import { mountServiceHost } from '../../packages/kb-service/host-adapter.js'
|
|
9
|
+
import { withHostRequestAuth } from '../../packages/kb-service/host-request-auth.js'
|
|
10
|
+
import { executeKbSearch } from '../../packages/kb-service/tool-router.js'
|
|
9
11
|
// 插件入口(host 半边)。只依赖 ctx 服务,不 import @deepseek-ai/*。
|
|
10
12
|
import { buildMap, MAP_RULES_VERSION } from './map.js'
|
|
11
13
|
import { readIndexPolicy } from './index-policy.js'
|
|
@@ -31,8 +33,7 @@ import { installCommandDescriptionFallback } from './command-description.js'
|
|
|
31
33
|
import { apply as applyTodoLifecycle } from './todo-lifecycle.js'
|
|
32
34
|
import { createFlowEngine } from './flows.js'
|
|
33
35
|
import { createFlowWorkspaceManager, prepareFlowConversation } from './flow-workspace.js'
|
|
34
|
-
import { startAutomaticChecks, downloadBrowserExtension } from './updates.js'
|
|
35
|
-
import { createNpmUpdateChecker } from '../../packages/kb-service/host-updates.js'
|
|
36
|
+
import { createUpdateChecker, createUpdateDownloader, startAutomaticChecks, downloadBrowserExtension } from './updates.js'
|
|
36
37
|
import { runSelftest } from './selftest.js'
|
|
37
38
|
import { walkTree, privateRootOf, normSegs, toPosix as toPosixFile, DEFAULT_PRIVATE_DIRS, readImportSources, derivedPrivatePartitions, effectivePrivateDirs, knowledgeCount } from './fsindex.js'
|
|
38
39
|
import { createImportService } from './import-service.js'
|
|
@@ -243,8 +244,8 @@ export function apply(ctx, config) {
|
|
|
243
244
|
if((config?.runtimeMode??'auto')==='auto'&&sharedRoot){try{autoShared=fsExists(path.join(sharedRoot,'.kbmeta/service-mode.json'))||JSON.parse(fsRead(path.join(sharedRoot,'.desktop-preview.json'),'utf8')).synthetic===true}catch{}}
|
|
244
245
|
if (config?.runtimeMode === 'service'||autoShared) {
|
|
245
246
|
const handoffApi=createHandoffApi()
|
|
246
|
-
ctx.inject(['webServer'],scope=>scope.effect(()=>scope.webServer.register({kind:'exact',path:'/kb-core/api',handler:(
|
|
247
|
-
ctx.inject(['webServer'],scope=>scope.effect(()=>scope.webServer.register({kind:'exact',path:'/kb-upgrade/status',handler:(
|
|
247
|
+
ctx.inject(['webServer'],scope=>scope.effect(()=>scope.webServer.register({kind:'exact',path:'/kb-core/api',handler:withHostRequestAuth(scope,handoffApi.handle)}),'kb: stable handoff API'))
|
|
248
|
+
ctx.inject(['webServer'],scope=>scope.effect(()=>scope.webServer.register({kind:'exact',path:'/kb-upgrade/status',handler:withHostRequestAuth(scope,(_req,res)=>{res.statusCode=200;res.setHeader('content-type','application/json');res.end(JSON.stringify(handoffApi.status()))})}),'kb: update recovery status'))
|
|
248
249
|
const sharedFlowWorkspace=createFlowWorkspaceManager({getRegistry:()=>ctx.get('workspaceRegistry')})
|
|
249
250
|
const packagedPython=path.resolve(path.dirname(fileURLToPath(import.meta.url)),'../../runtime/python/python.exe')
|
|
250
251
|
ctx.inject(['tools','agents'],scope=>scope.effect(async () => { try{await mountServiceHost(scope, config, { isLiveKnowledgeGrant, gatewayApply, createCitationGuard, getFlowWorkspace:root=>sharedFlowWorkspace.ensure(root),installApi:handler=>handoffApi.attach(handler),legacyStateDir:sharedState.stateDir,profileDir:sharedState.profileDir,library:sharedRoot,python:await resolveHostPython(path.resolve(path.dirname(fileURLToPath(import.meta.url)),'../..')), build: await readCandidateBuild(path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../..')) });}catch(error){handoffApi.fail(error);throw error} }, 'kb-service: explicit shared mode'))
|
|
@@ -281,7 +282,10 @@ export function apply(ctx, config) {
|
|
|
281
282
|
return () => { clearInterval(timer); embeddedKernel.dispose() }
|
|
282
283
|
}, 'kb-workbench: opt-in background maintenance')
|
|
283
284
|
const flowWorkspaceManager = createFlowWorkspaceManager({ getRegistry: () => ctx.get('workspaceRegistry') })
|
|
284
|
-
const updateChecker =
|
|
285
|
+
const updateChecker = createUpdateChecker({ currentVersion: PLUGIN_VERSION })
|
|
286
|
+
const updateProfile = ctx.get('profileContext')
|
|
287
|
+
const updateDownloader = createUpdateDownloader({ checker: updateChecker,
|
|
288
|
+
cacheDir: typeof updateProfile?.dir === 'string' ? path.join(updateProfile.dir, '.kb-plugin-updates') : null })
|
|
285
289
|
// 自动检查属于宿主后台机制,页面关闭后仍继续按周期检查。
|
|
286
290
|
ctx.effect(() => startAutomaticChecks(updateChecker), 'kb-core: automatic update checks')
|
|
287
291
|
// R1:UI 与工具共用的导入服务。在 install() 里创建(要等 core 就绪后才拿得到配置)。
|
|
@@ -306,7 +310,7 @@ let parsingService = null
|
|
|
306
310
|
const buildPromise = (async () => {
|
|
307
311
|
// 2026-10-18:新增 gateway.js / flows.js 两个**装载文件** —— buildId 必须覆盖它们,
|
|
308
312
|
// 否则改了流程实现而 buildId 不变,"构建=版本/buildId"这条唯一硬判据就失效了。
|
|
309
|
-
const list = ['package.json', 'cordis.patch.yml', 'src/host/index.js', 'src/host/kbcore.js', 'src/host/fsindex.js', 'src/host/importer.js', 'src/host/import-service.js', 'src/host/map.js', 'src/host/selftest.js', 'src/host/gateway.js', 'src/host/flows.js', 'src/host/parsing.js', 'src/host/updates.js', 'src/host/flow-workspace.js', 'src/client/index.js', 'src/host/parse-presets.js', 'src/host/parse-credentials.js', 'src/host/parse-native.js', 'src/host/parse-discovery.js', 'src/host/index-maintenance.js', 'tools/kb-local-model.py', 'tools/kb-pdf-pages.py', 'src/host/workbench.js', 'src/host/workbench-state.js', 'src/host/workbench-backup.js', 'src/client/workbench-ui.js', 'src/client/pdfjs/cmaps/78-EUC-H.bcmap', 'src/client/pdfjs/cmaps/78-EUC-V.bcmap', 'src/client/pdfjs/cmaps/78-H.bcmap', 'src/client/pdfjs/cmaps/78-RKSJ-H.bcmap', 'src/client/pdfjs/cmaps/78-RKSJ-V.bcmap', 'src/client/pdfjs/cmaps/78-V.bcmap', 'src/client/pdfjs/cmaps/78ms-RKSJ-H.bcmap', 'src/client/pdfjs/cmaps/78ms-RKSJ-V.bcmap', 'src/client/pdfjs/cmaps/83pv-RKSJ-H.bcmap', 'src/client/pdfjs/cmaps/90ms-RKSJ-H.bcmap', 'src/client/pdfjs/cmaps/90ms-RKSJ-V.bcmap', 'src/client/pdfjs/cmaps/90msp-RKSJ-H.bcmap', 'src/client/pdfjs/cmaps/90msp-RKSJ-V.bcmap', 'src/client/pdfjs/cmaps/90pv-RKSJ-H.bcmap', 'src/client/pdfjs/cmaps/90pv-RKSJ-V.bcmap', 'src/client/pdfjs/cmaps/Add-H.bcmap', 'src/client/pdfjs/cmaps/Add-RKSJ-H.bcmap', 'src/client/pdfjs/cmaps/Add-RKSJ-V.bcmap', 'src/client/pdfjs/cmaps/Add-V.bcmap', 'src/client/pdfjs/cmaps/Adobe-CNS1-0.bcmap', 'src/client/pdfjs/cmaps/Adobe-CNS1-1.bcmap', 'src/client/pdfjs/cmaps/Adobe-CNS1-2.bcmap', 'src/client/pdfjs/cmaps/Adobe-CNS1-3.bcmap', 'src/client/pdfjs/cmaps/Adobe-CNS1-4.bcmap', 'src/client/pdfjs/cmaps/Adobe-CNS1-5.bcmap', 'src/client/pdfjs/cmaps/Adobe-CNS1-6.bcmap', 'src/client/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap', 'src/client/pdfjs/cmaps/Adobe-GB1-0.bcmap', 'src/client/pdfjs/cmaps/Adobe-GB1-1.bcmap', 'src/client/pdfjs/cmaps/Adobe-GB1-2.bcmap', 'src/client/pdfjs/cmaps/Adobe-GB1-3.bcmap', 'src/client/pdfjs/cmaps/Adobe-GB1-4.bcmap', 'src/client/pdfjs/cmaps/Adobe-GB1-5.bcmap', 'src/client/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap', 'src/client/pdfjs/cmaps/Adobe-Japan1-0.bcmap', 'src/client/pdfjs/cmaps/Adobe-Japan1-1.bcmap', 'src/client/pdfjs/cmaps/Adobe-Japan1-2.bcmap', 'src/client/pdfjs/cmaps/Adobe-Japan1-3.bcmap', 'src/client/pdfjs/cmaps/Adobe-Japan1-4.bcmap', 'src/client/pdfjs/cmaps/Adobe-Japan1-5.bcmap', 'src/client/pdfjs/cmaps/Adobe-Japan1-6.bcmap', 'src/client/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap', 'src/client/pdfjs/cmaps/Adobe-Korea1-0.bcmap', 'src/client/pdfjs/cmaps/Adobe-Korea1-1.bcmap', 'src/client/pdfjs/cmaps/Adobe-Korea1-2.bcmap', 'src/client/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap', 'src/client/pdfjs/cmaps/B5-H.bcmap', 'src/client/pdfjs/cmaps/B5-V.bcmap', 'src/client/pdfjs/cmaps/B5pc-H.bcmap', 'src/client/pdfjs/cmaps/B5pc-V.bcmap', 'src/client/pdfjs/cmaps/CNS-EUC-H.bcmap', 'src/client/pdfjs/cmaps/CNS-EUC-V.bcmap', 'src/client/pdfjs/cmaps/CNS1-H.bcmap', 'src/client/pdfjs/cmaps/CNS1-V.bcmap', 'src/client/pdfjs/cmaps/CNS2-H.bcmap', 'src/client/pdfjs/cmaps/CNS2-V.bcmap', 'src/client/pdfjs/cmaps/ETen-B5-H.bcmap', 'src/client/pdfjs/cmaps/ETen-B5-V.bcmap', 'src/client/pdfjs/cmaps/ETenms-B5-H.bcmap', 'src/client/pdfjs/cmaps/ETenms-B5-V.bcmap', 'src/client/pdfjs/cmaps/ETHK-B5-H.bcmap', 'src/client/pdfjs/cmaps/ETHK-B5-V.bcmap', 'src/client/pdfjs/cmaps/EUC-H.bcmap', 'src/client/pdfjs/cmaps/EUC-V.bcmap', 'src/client/pdfjs/cmaps/Ext-H.bcmap', 'src/client/pdfjs/cmaps/Ext-RKSJ-H.bcmap', 'src/client/pdfjs/cmaps/Ext-RKSJ-V.bcmap', 'src/client/pdfjs/cmaps/Ext-V.bcmap', 'src/client/pdfjs/cmaps/GB-EUC-H.bcmap', 'src/client/pdfjs/cmaps/GB-EUC-V.bcmap', 'src/client/pdfjs/cmaps/GB-H.bcmap', 'src/client/pdfjs/cmaps/GB-V.bcmap', 'src/client/pdfjs/cmaps/GBK-EUC-H.bcmap', 'src/client/pdfjs/cmaps/GBK-EUC-V.bcmap', 'src/client/pdfjs/cmaps/GBK2K-H.bcmap', 'src/client/pdfjs/cmaps/GBK2K-V.bcmap', 'src/client/pdfjs/cmaps/GBKp-EUC-H.bcmap', 'src/client/pdfjs/cmaps/GBKp-EUC-V.bcmap', 'src/client/pdfjs/cmaps/GBpc-EUC-H.bcmap', 'src/client/pdfjs/cmaps/GBpc-EUC-V.bcmap', 'src/client/pdfjs/cmaps/GBT-EUC-H.bcmap', 'src/client/pdfjs/cmaps/GBT-EUC-V.bcmap', 'src/client/pdfjs/cmaps/GBT-H.bcmap', 'src/client/pdfjs/cmaps/GBT-V.bcmap', 'src/client/pdfjs/cmaps/GBTpc-EUC-H.bcmap', 'src/client/pdfjs/cmaps/GBTpc-EUC-V.bcmap', 'src/client/pdfjs/cmaps/H.bcmap', 'src/client/pdfjs/cmaps/Hankaku.bcmap', 'src/client/pdfjs/cmaps/Hiragana.bcmap', 'src/client/pdfjs/cmaps/HKdla-B5-H.bcmap', 'src/client/pdfjs/cmaps/HKdla-B5-V.bcmap', 'src/client/pdfjs/cmaps/HKdlb-B5-H.bcmap', 'src/client/pdfjs/cmaps/HKdlb-B5-V.bcmap', 'src/client/pdfjs/cmaps/HKgccs-B5-H.bcmap', 'src/client/pdfjs/cmaps/HKgccs-B5-V.bcmap', 'src/client/pdfjs/cmaps/HKm314-B5-H.bcmap', 'src/client/pdfjs/cmaps/HKm314-B5-V.bcmap', 'src/client/pdfjs/cmaps/HKm471-B5-H.bcmap', 'src/client/pdfjs/cmaps/HKm471-B5-V.bcmap', 'src/client/pdfjs/cmaps/HKscs-B5-H.bcmap', 'src/client/pdfjs/cmaps/HKscs-B5-V.bcmap', 'src/client/pdfjs/cmaps/Katakana.bcmap', 'src/client/pdfjs/cmaps/KSC-EUC-H.bcmap', 'src/client/pdfjs/cmaps/KSC-EUC-V.bcmap', 'src/client/pdfjs/cmaps/KSC-H.bcmap', 'src/client/pdfjs/cmaps/KSC-Johab-H.bcmap', 'src/client/pdfjs/cmaps/KSC-Johab-V.bcmap', 'src/client/pdfjs/cmaps/KSC-V.bcmap', 'src/client/pdfjs/cmaps/KSCms-UHC-H.bcmap', 'src/client/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap', 'src/client/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap', 'src/client/pdfjs/cmaps/KSCms-UHC-V.bcmap', 'src/client/pdfjs/cmaps/KSCpc-EUC-H.bcmap', 'src/client/pdfjs/cmaps/KSCpc-EUC-V.bcmap', 'src/client/pdfjs/cmaps/LICENSE', 'src/client/pdfjs/cmaps/NWP-H.bcmap', 'src/client/pdfjs/cmaps/NWP-V.bcmap', 'src/client/pdfjs/cmaps/RKSJ-H.bcmap', 'src/client/pdfjs/cmaps/RKSJ-V.bcmap', 'src/client/pdfjs/cmaps/Roman.bcmap', 'src/client/pdfjs/cmaps/UniCNS-UCS2-H.bcmap', 'src/client/pdfjs/cmaps/UniCNS-UCS2-V.bcmap', 'src/client/pdfjs/cmaps/UniCNS-UTF16-H.bcmap', 'src/client/pdfjs/cmaps/UniCNS-UTF16-V.bcmap', 'src/client/pdfjs/cmaps/UniCNS-UTF32-H.bcmap', 'src/client/pdfjs/cmaps/UniCNS-UTF32-V.bcmap', 'src/client/pdfjs/cmaps/UniCNS-UTF8-H.bcmap', 'src/client/pdfjs/cmaps/UniCNS-UTF8-V.bcmap', 'src/client/pdfjs/cmaps/UniGB-UCS2-H.bcmap', 'src/client/pdfjs/cmaps/UniGB-UCS2-V.bcmap', 'src/client/pdfjs/cmaps/UniGB-UTF16-H.bcmap', 'src/client/pdfjs/cmaps/UniGB-UTF16-V.bcmap', 'src/client/pdfjs/cmaps/UniGB-UTF32-H.bcmap', 'src/client/pdfjs/cmaps/UniGB-UTF32-V.bcmap', 'src/client/pdfjs/cmaps/UniGB-UTF8-H.bcmap', 'src/client/pdfjs/cmaps/UniGB-UTF8-V.bcmap', 'src/client/pdfjs/cmaps/UniJIS-UCS2-H.bcmap', 'src/client/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap', 'src/client/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap', 'src/client/pdfjs/cmaps/UniJIS-UCS2-V.bcmap', 'src/client/pdfjs/cmaps/UniJIS-UTF16-H.bcmap', 'src/client/pdfjs/cmaps/UniJIS-UTF16-V.bcmap', 'src/client/pdfjs/cmaps/UniJIS-UTF32-H.bcmap', 'src/client/pdfjs/cmaps/UniJIS-UTF32-V.bcmap', 'src/client/pdfjs/cmaps/UniJIS-UTF8-H.bcmap', 'src/client/pdfjs/cmaps/UniJIS-UTF8-V.bcmap', 'src/client/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap', 'src/client/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap', 'src/client/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap', 'src/client/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap', 'src/client/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap', 'src/client/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap', 'src/client/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap', 'src/client/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap', 'src/client/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap', 'src/client/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap', 'src/client/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap', 'src/client/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap', 'src/client/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap', 'src/client/pdfjs/cmaps/UniKS-UCS2-H.bcmap', 'src/client/pdfjs/cmaps/UniKS-UCS2-V.bcmap', 'src/client/pdfjs/cmaps/UniKS-UTF16-H.bcmap', 'src/client/pdfjs/cmaps/UniKS-UTF16-V.bcmap', 'src/client/pdfjs/cmaps/UniKS-UTF32-H.bcmap', 'src/client/pdfjs/cmaps/UniKS-UTF32-V.bcmap', 'src/client/pdfjs/cmaps/UniKS-UTF8-H.bcmap', 'src/client/pdfjs/cmaps/UniKS-UTF8-V.bcmap', 'src/client/pdfjs/cmaps/V.bcmap', 'src/client/pdfjs/cmaps/WP-Symbol.bcmap', 'src/client/pdfjs/LICENSE', 'src/client/pdfjs/pdf.mjs', 'src/client/pdfjs/pdf.worker.mjs', 'src/client/pdfjs/standard_fonts/FoxitDingbats.pfb', 'src/client/pdfjs/standard_fonts/FoxitFixed.pfb', 'src/client/pdfjs/standard_fonts/FoxitFixedBold.pfb', 'src/client/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb', 'src/client/pdfjs/standard_fonts/FoxitFixedItalic.pfb', 'src/client/pdfjs/standard_fonts/FoxitSerif.pfb', 'src/client/pdfjs/standard_fonts/FoxitSerifBold.pfb', 'src/client/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb', 'src/client/pdfjs/standard_fonts/FoxitSerifItalic.pfb', 'src/client/pdfjs/standard_fonts/FoxitSymbol.pfb', 'src/client/pdfjs/standard_fonts/LiberationSans-Bold.ttf', 'src/client/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf', 'src/client/pdfjs/standard_fonts/LiberationSans-Italic.ttf', 'src/client/pdfjs/standard_fonts/LiberationSans-Regular.ttf', 'src/client/pdfjs/standard_fonts/LICENSE_FOXIT', 'src/client/pdfjs/standard_fonts/LICENSE_LIBERATION', 'src/client/pdfjs/wasm/jbig2.wasm', 'src/client/pdfjs/wasm/LICENSE_JBIG2', 'src/client/pdfjs/wasm/LICENSE_OPENJPEG', 'src/client/pdfjs/wasm/LICENSE_PDFJS_JBIG2', 'src/client/pdfjs/wasm/LICENSE_PDFJS_OPENJPEG', 'src/client/pdfjs/wasm/LICENSE_PDFJS_QCMS', 'src/client/pdfjs/wasm/LICENSE_QCMS', 'src/client/pdfjs/wasm/openjpeg.wasm', 'src/client/pdfjs/wasm/openjpeg_nowasm_fallback.js', 'src/client/pdfjs/wasm/qcms_bg.wasm', 'browser-extension/manifest.json', 'browser-extension/options.html', 'browser-extension/options.js', 'browser-extension/popup.html', 'browser-extension/popup.js', 'browser-extension/style.css', 'src/host/capture-surface.js', 'src/client/capture.html', 'src/client/capture.js', 'src/client/capture.css', 'src/client/capture-sw.js', 'src/client/capture.webmanifest', 'src/client/capture-icon.svg', 'src/client/capture-icon-192.png', 'src/client/capture-icon-512.png', 'src/host/workbench-question.js', 'src/host/workbench-links.js', 'src/host/workbench-deliverables.js', 'src/client/workbench-theme.css', 'src/client/workbench-features.js', 'src/client/workbench-relations.js', 'src/host/workbench-files.js', 'src/host/workbench-trash.js', 'src/host/workbench-relation-index.js', 'src/host/parse-source-authority.js', 'src/host/versioning.js', 'src/host/retrieval.js', 'src/host/retrieval-api.js', 'src/host/retrieval-chunks.js', 'src/host/retrieval-worker.js', 'RETRIEVAL.md', 'src/host/retrieval-pool.js', 'src/host/managed-files.js', 'src/host/system-upgrades.js', 'presets/01-knowledge-agent.patch.yml', 'skills/personal-knowledge-base/SKILL.md', 'src/host/citation-guard.js', 'browser-extension/background.js', 'browser-extension/icons/knowledge-base-128.png', 'browser-extension/icons/knowledge-base-16.png', 'browser-extension/icons/knowledge-base-32.png', 'browser-extension/icons/knowledge-base-48.png', 'PERFORMANCE.md', 'src/host/retrieval-cache.js', 'src/host/relation-name-lookup.js', 'EXISTING-FRAMEWORK-OPTIMIZATION.md', 'src/host/runtime-resources.js', 'src/host/storage-io.js', 'src/host/index-policy.js', 'src/host/index-policy-service.js', 'src/client/knowledge-ui.css', 'src/host/workbench-inbox.js', 'packages/kb-core/index.js', 'packages/kb-core/package.json', 'packages/kb-core/src/capture-surface.js', 'packages/kb-core/src/documents.js', 'packages/kb-core/src/embedded.js', 'packages/kb-core/src/flows.js', 'packages/kb-core/src/fsindex.js', 'packages/kb-core/src/import-service.js', 'packages/kb-core/src/importer.js', 'packages/kb-core/src/index-maintenance.js', 'packages/kb-core/src/index-policy-service.js', 'packages/kb-core/src/index-policy.js', 'packages/kb-core/src/kbcore.js', 'packages/kb-core/src/library-state.js', 'packages/kb-core/src/managed-files.js', 'packages/kb-core/src/map.js', 'packages/kb-core/src/parse-credentials.js', 'packages/kb-core/src/parse-discovery.js', 'packages/kb-core/src/parse-native.js', 'packages/kb-core/src/parse-presets.js', 'packages/kb-core/src/parsing.js', 'packages/kb-core/src/relation-name-lookup.js', 'packages/kb-core/src/retrieval-api.js', 'packages/kb-core/src/retrieval-cache.js', 'packages/kb-core/src/retrieval-chunks.js', 'packages/kb-core/src/retrieval-pool.js', 'packages/kb-core/src/retrieval-worker.js', 'packages/kb-core/src/retrieval.js', 'packages/kb-core/src/runtime-resources.js', 'packages/kb-core/src/storage-io.js', 'packages/kb-core/src/system-upgrades.js', 'packages/kb-core/src/workbench-backup.js', 'packages/kb-core/src/workbench-deliverables.js', 'packages/kb-core/src/workbench-files.js', 'packages/kb-core/src/workbench-inbox.js', 'packages/kb-core/src/workbench-links.js', 'packages/kb-core/src/workbench-question.js', 'packages/kb-core/src/workbench-relation-index.js', 'packages/kb-core/src/workbench-state.js', 'packages/kb-core/src/workbench-trash.js', 'packages/kb-core/src/workbench.js', 'packages/kb-contracts/index.js', 'packages/kb-contracts/package.json', 'packages/kb-contracts/schema.js', 'packages/kb-contracts/node.js', 'packages/kb-core/src/service-ownership.js', 'packages/kb-service/auth.js', 'packages/kb-service/build.js', 'packages/kb-service/client.js', 'packages/kb-service/host-adapter.js', 'packages/kb-service/desktop-host-links.js', 'packages/kb-service/index.js', 'packages/kb-service/io.js', 'packages/kb-service/launcher.js', 'packages/kb-service/main.js', 'packages/kb-service/migration.js', 'packages/kb-service/native.py', 'packages/kb-service/package.json', 'packages/kb-service/service.js', 'packages/kb-service/tool-definitions.json', 'packages/kb-service/cli.js', 'packages/kb-core/src/flow-workspace.js', 'packages/kb-core/src/inbox-flow.js', 'packages/kb-core/src/parse-source-authority.js', 'packages/kb-contracts/desktop.js', 'packages/kb-contracts/tools.js', 'packages/kb-service/clipper.js', 'packages/kb-service/desktop-files.js', 'packages/kb-service/dsh-broker.js', 'packages/kb-service/dsh-host.js', 'packages/kb-service/dsh-stream-relay.js', 'packages/kb-service/engines.js', 'packages/kb-service/extension.js', 'packages/kb-service/host-assets.js', 'packages/kb-service/inbox-host.js', 'packages/kb-service/inbox-jobs.js', 'packages/kb-service/legacy-ports.js', 'packages/kb-service/operations.js', 'packages/kb-service/runtime.js', 'packages/kb-service/tool-router.js', 'packages/kb-service/vector-profiles.js', 'src/host/command-description.js', 'src/host/todo-lifecycle.js', 'src/client/todo-lifecycle-ui.js', 'packages/kb-service/memory-channel.js', 'packages/kb-service/memory-sync.js', 'packages/kb-contracts/version-policy.js', 'packages/kb-service/host-updates.js', 'packages/kb-service/host-python.js', 'packages/kb-core/src/source-references.js', 'packages/kb-core/src/parse-job-storage.js', 'packages/kb-service/safe-update.js', 'tools/kb-transactional-update.py', 'packages/kb-service/legacy-handoff.js', 'packages/kb-service/handoff-api.js', 'packages/kb-core/src/library-framework.js', 'packages/kb-core/src/file-catalog.js', 'packages/kb-core/src/index-architecture.js', 'packages/kb-core/src/file-classification.js', 'packages/kb-service/compatibility.js', 'packages/kb-service/launch-lock.js', 'packages/kb-service/first-library-handoff.js']
|
|
313
|
+
const list = ['package.json', 'cordis.patch.yml', 'src/host/index.js', 'src/host/kbcore.js', 'src/host/fsindex.js', 'src/host/importer.js', 'src/host/import-service.js', 'src/host/map.js', 'src/host/selftest.js', 'src/host/gateway.js', 'src/host/flows.js', 'src/host/parsing.js', 'src/host/updates.js', 'src/host/flow-workspace.js', 'src/client/index.js', 'src/host/parse-presets.js', 'src/host/parse-credentials.js', 'src/host/parse-native.js', 'src/host/parse-discovery.js', 'src/host/index-maintenance.js', 'tools/kb-local-model.py', 'tools/kb-pdf-pages.py', 'src/host/workbench.js', 'src/host/workbench-state.js', 'src/host/workbench-backup.js', 'src/client/workbench-ui.js', 'src/client/pdfjs/cmaps/78-EUC-H.bcmap', 'src/client/pdfjs/cmaps/78-EUC-V.bcmap', 'src/client/pdfjs/cmaps/78-H.bcmap', 'src/client/pdfjs/cmaps/78-RKSJ-H.bcmap', 'src/client/pdfjs/cmaps/78-RKSJ-V.bcmap', 'src/client/pdfjs/cmaps/78-V.bcmap', 'src/client/pdfjs/cmaps/78ms-RKSJ-H.bcmap', 'src/client/pdfjs/cmaps/78ms-RKSJ-V.bcmap', 'src/client/pdfjs/cmaps/83pv-RKSJ-H.bcmap', 'src/client/pdfjs/cmaps/90ms-RKSJ-H.bcmap', 'src/client/pdfjs/cmaps/90ms-RKSJ-V.bcmap', 'src/client/pdfjs/cmaps/90msp-RKSJ-H.bcmap', 'src/client/pdfjs/cmaps/90msp-RKSJ-V.bcmap', 'src/client/pdfjs/cmaps/90pv-RKSJ-H.bcmap', 'src/client/pdfjs/cmaps/90pv-RKSJ-V.bcmap', 'src/client/pdfjs/cmaps/Add-H.bcmap', 'src/client/pdfjs/cmaps/Add-RKSJ-H.bcmap', 'src/client/pdfjs/cmaps/Add-RKSJ-V.bcmap', 'src/client/pdfjs/cmaps/Add-V.bcmap', 'src/client/pdfjs/cmaps/Adobe-CNS1-0.bcmap', 'src/client/pdfjs/cmaps/Adobe-CNS1-1.bcmap', 'src/client/pdfjs/cmaps/Adobe-CNS1-2.bcmap', 'src/client/pdfjs/cmaps/Adobe-CNS1-3.bcmap', 'src/client/pdfjs/cmaps/Adobe-CNS1-4.bcmap', 'src/client/pdfjs/cmaps/Adobe-CNS1-5.bcmap', 'src/client/pdfjs/cmaps/Adobe-CNS1-6.bcmap', 'src/client/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap', 'src/client/pdfjs/cmaps/Adobe-GB1-0.bcmap', 'src/client/pdfjs/cmaps/Adobe-GB1-1.bcmap', 'src/client/pdfjs/cmaps/Adobe-GB1-2.bcmap', 'src/client/pdfjs/cmaps/Adobe-GB1-3.bcmap', 'src/client/pdfjs/cmaps/Adobe-GB1-4.bcmap', 'src/client/pdfjs/cmaps/Adobe-GB1-5.bcmap', 'src/client/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap', 'src/client/pdfjs/cmaps/Adobe-Japan1-0.bcmap', 'src/client/pdfjs/cmaps/Adobe-Japan1-1.bcmap', 'src/client/pdfjs/cmaps/Adobe-Japan1-2.bcmap', 'src/client/pdfjs/cmaps/Adobe-Japan1-3.bcmap', 'src/client/pdfjs/cmaps/Adobe-Japan1-4.bcmap', 'src/client/pdfjs/cmaps/Adobe-Japan1-5.bcmap', 'src/client/pdfjs/cmaps/Adobe-Japan1-6.bcmap', 'src/client/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap', 'src/client/pdfjs/cmaps/Adobe-Korea1-0.bcmap', 'src/client/pdfjs/cmaps/Adobe-Korea1-1.bcmap', 'src/client/pdfjs/cmaps/Adobe-Korea1-2.bcmap', 'src/client/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap', 'src/client/pdfjs/cmaps/B5-H.bcmap', 'src/client/pdfjs/cmaps/B5-V.bcmap', 'src/client/pdfjs/cmaps/B5pc-H.bcmap', 'src/client/pdfjs/cmaps/B5pc-V.bcmap', 'src/client/pdfjs/cmaps/CNS-EUC-H.bcmap', 'src/client/pdfjs/cmaps/CNS-EUC-V.bcmap', 'src/client/pdfjs/cmaps/CNS1-H.bcmap', 'src/client/pdfjs/cmaps/CNS1-V.bcmap', 'src/client/pdfjs/cmaps/CNS2-H.bcmap', 'src/client/pdfjs/cmaps/CNS2-V.bcmap', 'src/client/pdfjs/cmaps/ETen-B5-H.bcmap', 'src/client/pdfjs/cmaps/ETen-B5-V.bcmap', 'src/client/pdfjs/cmaps/ETenms-B5-H.bcmap', 'src/client/pdfjs/cmaps/ETenms-B5-V.bcmap', 'src/client/pdfjs/cmaps/ETHK-B5-H.bcmap', 'src/client/pdfjs/cmaps/ETHK-B5-V.bcmap', 'src/client/pdfjs/cmaps/EUC-H.bcmap', 'src/client/pdfjs/cmaps/EUC-V.bcmap', 'src/client/pdfjs/cmaps/Ext-H.bcmap', 'src/client/pdfjs/cmaps/Ext-RKSJ-H.bcmap', 'src/client/pdfjs/cmaps/Ext-RKSJ-V.bcmap', 'src/client/pdfjs/cmaps/Ext-V.bcmap', 'src/client/pdfjs/cmaps/GB-EUC-H.bcmap', 'src/client/pdfjs/cmaps/GB-EUC-V.bcmap', 'src/client/pdfjs/cmaps/GB-H.bcmap', 'src/client/pdfjs/cmaps/GB-V.bcmap', 'src/client/pdfjs/cmaps/GBK-EUC-H.bcmap', 'src/client/pdfjs/cmaps/GBK-EUC-V.bcmap', 'src/client/pdfjs/cmaps/GBK2K-H.bcmap', 'src/client/pdfjs/cmaps/GBK2K-V.bcmap', 'src/client/pdfjs/cmaps/GBKp-EUC-H.bcmap', 'src/client/pdfjs/cmaps/GBKp-EUC-V.bcmap', 'src/client/pdfjs/cmaps/GBpc-EUC-H.bcmap', 'src/client/pdfjs/cmaps/GBpc-EUC-V.bcmap', 'src/client/pdfjs/cmaps/GBT-EUC-H.bcmap', 'src/client/pdfjs/cmaps/GBT-EUC-V.bcmap', 'src/client/pdfjs/cmaps/GBT-H.bcmap', 'src/client/pdfjs/cmaps/GBT-V.bcmap', 'src/client/pdfjs/cmaps/GBTpc-EUC-H.bcmap', 'src/client/pdfjs/cmaps/GBTpc-EUC-V.bcmap', 'src/client/pdfjs/cmaps/H.bcmap', 'src/client/pdfjs/cmaps/Hankaku.bcmap', 'src/client/pdfjs/cmaps/Hiragana.bcmap', 'src/client/pdfjs/cmaps/HKdla-B5-H.bcmap', 'src/client/pdfjs/cmaps/HKdla-B5-V.bcmap', 'src/client/pdfjs/cmaps/HKdlb-B5-H.bcmap', 'src/client/pdfjs/cmaps/HKdlb-B5-V.bcmap', 'src/client/pdfjs/cmaps/HKgccs-B5-H.bcmap', 'src/client/pdfjs/cmaps/HKgccs-B5-V.bcmap', 'src/client/pdfjs/cmaps/HKm314-B5-H.bcmap', 'src/client/pdfjs/cmaps/HKm314-B5-V.bcmap', 'src/client/pdfjs/cmaps/HKm471-B5-H.bcmap', 'src/client/pdfjs/cmaps/HKm471-B5-V.bcmap', 'src/client/pdfjs/cmaps/HKscs-B5-H.bcmap', 'src/client/pdfjs/cmaps/HKscs-B5-V.bcmap', 'src/client/pdfjs/cmaps/Katakana.bcmap', 'src/client/pdfjs/cmaps/KSC-EUC-H.bcmap', 'src/client/pdfjs/cmaps/KSC-EUC-V.bcmap', 'src/client/pdfjs/cmaps/KSC-H.bcmap', 'src/client/pdfjs/cmaps/KSC-Johab-H.bcmap', 'src/client/pdfjs/cmaps/KSC-Johab-V.bcmap', 'src/client/pdfjs/cmaps/KSC-V.bcmap', 'src/client/pdfjs/cmaps/KSCms-UHC-H.bcmap', 'src/client/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap', 'src/client/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap', 'src/client/pdfjs/cmaps/KSCms-UHC-V.bcmap', 'src/client/pdfjs/cmaps/KSCpc-EUC-H.bcmap', 'src/client/pdfjs/cmaps/KSCpc-EUC-V.bcmap', 'src/client/pdfjs/cmaps/LICENSE', 'src/client/pdfjs/cmaps/NWP-H.bcmap', 'src/client/pdfjs/cmaps/NWP-V.bcmap', 'src/client/pdfjs/cmaps/RKSJ-H.bcmap', 'src/client/pdfjs/cmaps/RKSJ-V.bcmap', 'src/client/pdfjs/cmaps/Roman.bcmap', 'src/client/pdfjs/cmaps/UniCNS-UCS2-H.bcmap', 'src/client/pdfjs/cmaps/UniCNS-UCS2-V.bcmap', 'src/client/pdfjs/cmaps/UniCNS-UTF16-H.bcmap', 'src/client/pdfjs/cmaps/UniCNS-UTF16-V.bcmap', 'src/client/pdfjs/cmaps/UniCNS-UTF32-H.bcmap', 'src/client/pdfjs/cmaps/UniCNS-UTF32-V.bcmap', 'src/client/pdfjs/cmaps/UniCNS-UTF8-H.bcmap', 'src/client/pdfjs/cmaps/UniCNS-UTF8-V.bcmap', 'src/client/pdfjs/cmaps/UniGB-UCS2-H.bcmap', 'src/client/pdfjs/cmaps/UniGB-UCS2-V.bcmap', 'src/client/pdfjs/cmaps/UniGB-UTF16-H.bcmap', 'src/client/pdfjs/cmaps/UniGB-UTF16-V.bcmap', 'src/client/pdfjs/cmaps/UniGB-UTF32-H.bcmap', 'src/client/pdfjs/cmaps/UniGB-UTF32-V.bcmap', 'src/client/pdfjs/cmaps/UniGB-UTF8-H.bcmap', 'src/client/pdfjs/cmaps/UniGB-UTF8-V.bcmap', 'src/client/pdfjs/cmaps/UniJIS-UCS2-H.bcmap', 'src/client/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap', 'src/client/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap', 'src/client/pdfjs/cmaps/UniJIS-UCS2-V.bcmap', 'src/client/pdfjs/cmaps/UniJIS-UTF16-H.bcmap', 'src/client/pdfjs/cmaps/UniJIS-UTF16-V.bcmap', 'src/client/pdfjs/cmaps/UniJIS-UTF32-H.bcmap', 'src/client/pdfjs/cmaps/UniJIS-UTF32-V.bcmap', 'src/client/pdfjs/cmaps/UniJIS-UTF8-H.bcmap', 'src/client/pdfjs/cmaps/UniJIS-UTF8-V.bcmap', 'src/client/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap', 'src/client/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap', 'src/client/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap', 'src/client/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap', 'src/client/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap', 'src/client/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap', 'src/client/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap', 'src/client/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap', 'src/client/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap', 'src/client/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap', 'src/client/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap', 'src/client/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap', 'src/client/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap', 'src/client/pdfjs/cmaps/UniKS-UCS2-H.bcmap', 'src/client/pdfjs/cmaps/UniKS-UCS2-V.bcmap', 'src/client/pdfjs/cmaps/UniKS-UTF16-H.bcmap', 'src/client/pdfjs/cmaps/UniKS-UTF16-V.bcmap', 'src/client/pdfjs/cmaps/UniKS-UTF32-H.bcmap', 'src/client/pdfjs/cmaps/UniKS-UTF32-V.bcmap', 'src/client/pdfjs/cmaps/UniKS-UTF8-H.bcmap', 'src/client/pdfjs/cmaps/UniKS-UTF8-V.bcmap', 'src/client/pdfjs/cmaps/V.bcmap', 'src/client/pdfjs/cmaps/WP-Symbol.bcmap', 'src/client/pdfjs/LICENSE', 'src/client/pdfjs/pdf.mjs', 'src/client/pdfjs/pdf.worker.mjs', 'src/client/pdfjs/standard_fonts/FoxitDingbats.pfb', 'src/client/pdfjs/standard_fonts/FoxitFixed.pfb', 'src/client/pdfjs/standard_fonts/FoxitFixedBold.pfb', 'src/client/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb', 'src/client/pdfjs/standard_fonts/FoxitFixedItalic.pfb', 'src/client/pdfjs/standard_fonts/FoxitSerif.pfb', 'src/client/pdfjs/standard_fonts/FoxitSerifBold.pfb', 'src/client/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb', 'src/client/pdfjs/standard_fonts/FoxitSerifItalic.pfb', 'src/client/pdfjs/standard_fonts/FoxitSymbol.pfb', 'src/client/pdfjs/standard_fonts/LiberationSans-Bold.ttf', 'src/client/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf', 'src/client/pdfjs/standard_fonts/LiberationSans-Italic.ttf', 'src/client/pdfjs/standard_fonts/LiberationSans-Regular.ttf', 'src/client/pdfjs/standard_fonts/LICENSE_FOXIT', 'src/client/pdfjs/standard_fonts/LICENSE_LIBERATION', 'src/client/pdfjs/wasm/jbig2.wasm', 'src/client/pdfjs/wasm/LICENSE_JBIG2', 'src/client/pdfjs/wasm/LICENSE_OPENJPEG', 'src/client/pdfjs/wasm/LICENSE_PDFJS_JBIG2', 'src/client/pdfjs/wasm/LICENSE_PDFJS_OPENJPEG', 'src/client/pdfjs/wasm/LICENSE_PDFJS_QCMS', 'src/client/pdfjs/wasm/LICENSE_QCMS', 'src/client/pdfjs/wasm/openjpeg.wasm', 'src/client/pdfjs/wasm/openjpeg_nowasm_fallback.js', 'src/client/pdfjs/wasm/qcms_bg.wasm', 'browser-extension/manifest.json', 'browser-extension/options.html', 'browser-extension/options.js', 'browser-extension/popup.html', 'browser-extension/popup.js', 'browser-extension/style.css', 'src/host/capture-surface.js', 'src/client/capture.html', 'src/client/capture.js', 'src/client/capture.css', 'src/client/capture-sw.js', 'src/client/capture.webmanifest', 'src/client/capture-icon.svg', 'src/client/capture-icon-192.png', 'src/client/capture-icon-512.png', 'src/host/workbench-question.js', 'src/host/workbench-links.js', 'src/host/workbench-deliverables.js', 'src/client/workbench-theme.css', 'src/client/workbench-features.js', 'src/client/workbench-relations.js', 'src/host/workbench-files.js', 'src/host/workbench-trash.js', 'src/host/workbench-relation-index.js', 'src/host/parse-source-authority.js', 'src/host/versioning.js', 'src/host/retrieval.js', 'src/host/retrieval-api.js', 'src/host/retrieval-chunks.js', 'src/host/retrieval-worker.js', 'RETRIEVAL.md', 'src/host/retrieval-pool.js', 'src/host/managed-files.js', 'src/host/system-upgrades.js', 'presets/01-knowledge-agent.patch.yml', 'skills/personal-knowledge-base/SKILL.md', 'src/host/citation-guard.js', 'browser-extension/background.js', 'browser-extension/icons/knowledge-base-128.png', 'browser-extension/icons/knowledge-base-16.png', 'browser-extension/icons/knowledge-base-32.png', 'browser-extension/icons/knowledge-base-48.png', 'PERFORMANCE.md', 'src/host/retrieval-cache.js', 'src/host/relation-name-lookup.js', 'EXISTING-FRAMEWORK-OPTIMIZATION.md', 'src/host/runtime-resources.js', 'src/host/storage-io.js', 'src/host/index-policy.js', 'src/host/index-policy-service.js', 'src/client/knowledge-ui.css', 'src/host/workbench-inbox.js', 'packages/kb-core/index.js', 'packages/kb-core/package.json', 'packages/kb-core/src/capture-surface.js', 'packages/kb-core/src/documents.js', 'packages/kb-core/src/embedded.js', 'packages/kb-core/src/flows.js', 'packages/kb-core/src/fsindex.js', 'packages/kb-core/src/import-service.js', 'packages/kb-core/src/importer.js', 'packages/kb-core/src/index-maintenance.js', 'packages/kb-core/src/index-policy-service.js', 'packages/kb-core/src/index-policy.js', 'packages/kb-core/src/kbcore.js', 'packages/kb-core/src/library-state.js', 'packages/kb-core/src/managed-files.js', 'packages/kb-core/src/map.js', 'packages/kb-core/src/parse-credentials.js', 'packages/kb-core/src/parse-discovery.js', 'packages/kb-core/src/parse-native.js', 'packages/kb-core/src/parse-presets.js', 'packages/kb-core/src/parsing.js', 'packages/kb-core/src/relation-name-lookup.js', 'packages/kb-core/src/retrieval-api.js', 'packages/kb-core/src/retrieval-cache.js', 'packages/kb-core/src/retrieval-chunks.js', 'packages/kb-core/src/retrieval-pool.js', 'packages/kb-core/src/retrieval-worker.js', 'packages/kb-core/src/retrieval.js', 'packages/kb-core/src/runtime-resources.js', 'packages/kb-core/src/storage-io.js', 'packages/kb-core/src/system-upgrades.js', 'packages/kb-core/src/workbench-backup.js', 'packages/kb-core/src/workbench-deliverables.js', 'packages/kb-core/src/workbench-files.js', 'packages/kb-core/src/workbench-inbox.js', 'packages/kb-core/src/workbench-links.js', 'packages/kb-core/src/workbench-question.js', 'packages/kb-core/src/workbench-relation-index.js', 'packages/kb-core/src/workbench-state.js', 'packages/kb-core/src/workbench-trash.js', 'packages/kb-core/src/workbench.js', 'packages/kb-contracts/index.js', 'packages/kb-contracts/package.json', 'packages/kb-contracts/schema.js', 'packages/kb-contracts/node.js', 'packages/kb-core/src/service-ownership.js', 'packages/kb-service/auth.js', 'packages/kb-service/build.js', 'packages/kb-service/client.js', 'packages/kb-service/host-adapter.js', 'packages/kb-service/desktop-host-links.js', 'packages/kb-service/index.js', 'packages/kb-service/io.js', 'packages/kb-service/launcher.js', 'packages/kb-service/main.js', 'packages/kb-service/migration.js', 'packages/kb-service/native.py', 'packages/kb-service/package.json', 'packages/kb-service/service.js', 'packages/kb-service/tool-definitions.json', 'packages/kb-service/cli.js', 'packages/kb-core/src/flow-workspace.js', 'packages/kb-core/src/inbox-flow.js', 'packages/kb-core/src/parse-source-authority.js', 'packages/kb-contracts/desktop.js', 'packages/kb-contracts/tools.js', 'packages/kb-service/clipper.js', 'packages/kb-service/desktop-files.js', 'packages/kb-service/dsh-broker.js', 'packages/kb-service/dsh-host.js', 'packages/kb-service/dsh-stream-relay.js', 'packages/kb-service/engines.js', 'packages/kb-service/extension.js', 'packages/kb-service/host-assets.js', 'packages/kb-service/inbox-host.js', 'packages/kb-service/inbox-jobs.js', 'packages/kb-service/legacy-ports.js', 'packages/kb-service/operations.js', 'packages/kb-service/runtime.js', 'packages/kb-service/tool-router.js', 'packages/kb-service/vector-profiles.js', 'src/host/command-description.js', 'src/host/todo-lifecycle.js', 'src/client/todo-lifecycle-ui.js', 'packages/kb-service/memory-channel.js', 'packages/kb-service/memory-sync.js', 'packages/kb-contracts/version-policy.js', 'packages/kb-service/host-updates.js', 'packages/kb-service/host-python.js', 'packages/kb-core/src/source-references.js', 'packages/kb-core/src/parse-job-storage.js', 'packages/kb-service/safe-update.js', 'tools/kb-transactional-update.py', 'packages/kb-service/legacy-handoff.js', 'packages/kb-service/handoff-api.js', 'packages/kb-core/src/library-framework.js', 'packages/kb-core/src/file-catalog.js', 'packages/kb-core/src/index-architecture.js', 'packages/kb-core/src/file-classification.js', 'packages/kb-service/compatibility.js', 'packages/kb-service/launch-lock.js', 'packages/kb-service/first-library-handoff.js', 'packages/kb-service/host-request-auth.js']
|
|
310
314
|
const whole = crypto.createHash('sha256')
|
|
311
315
|
for (const rel of list) {
|
|
312
316
|
try {
|
|
@@ -1028,8 +1032,7 @@ let parsingService = null
|
|
|
1028
1032
|
async execute(args) {
|
|
1029
1033
|
let result
|
|
1030
1034
|
try {
|
|
1031
|
-
|
|
1032
|
-
result = { ...found,ok:true,hits:found.items.map(h=>({...h,revision:h.revision?.slice(0,12)||null})) }
|
|
1035
|
+
result = await executeKbSearch(workbench.dispatch, args)
|
|
1033
1036
|
} catch (error) {
|
|
1034
1037
|
result = {ok:false,hits:[],reason:error.code||'SEARCH_ERROR',coverageNote:'统一检索未完成,请重试;未返回过期或权限不明的结果。'}
|
|
1035
1038
|
}
|
|
@@ -1040,11 +1043,11 @@ let parsingService = null
|
|
|
1040
1043
|
},
|
|
1041
1044
|
{
|
|
1042
1045
|
name: 'kb_check',
|
|
1043
|
-
description: '
|
|
1046
|
+
description: '检查知识库并报告索引差异与缺陷。recover=true 时在成功写入索引后消费 recover-todo。如果返回 indexWriteBlocked,请向用户报告条目降幅并核对差异,用户确认后用该结果的 confirmationToken 作为 confirmDrop 重试。',
|
|
1044
1047
|
parameters: {
|
|
1045
1048
|
type: 'object',
|
|
1046
1049
|
additionalProperties: false,
|
|
1047
|
-
properties: { rebuild: { type: 'boolean' }, recover: { type: 'boolean' } },
|
|
1050
|
+
properties: { rebuild: { type: 'boolean' }, recover: { type: 'boolean' }, confirmDrop: { type: 'string', description: '用户确认本次索引降幅后,填入 indexWriteBlocked.confirmationToken' } },
|
|
1048
1051
|
},
|
|
1049
1052
|
output: {
|
|
1050
1053
|
schema: { type: 'object', additionalProperties: true, properties: { execution: { type: 'string' }, quality: { type: 'string' }, defects: { type: 'array', items: { type: 'object', additionalProperties: true } } }, required: ['execution', 'quality'] },
|
|
@@ -1053,14 +1056,20 @@ let parsingService = null
|
|
|
1053
1056
|
const head = `检查:execution=${v.execution} quality=${v.quality} healthy=${v.healthy}(${v.healthReason}) 条目=${v.counts?.entries} 缺陷=${v.defects.length}`
|
|
1054
1057
|
const diff = `差异:新增 ${v.diff?.added?.length ?? 0} / 删除 ${v.diff?.removed?.length ?? 0} / 修改 ${v.diff?.changed?.length ?? 0}`
|
|
1055
1058
|
const list = v.defects.slice(0, 12).map((d) => ` · [${d.kind}] ${d.path} — ${d.detail}`)
|
|
1056
|
-
|
|
1059
|
+
const blocked = v.indexWriteBlocked
|
|
1060
|
+
const confirmation = blocked ? [`旧索引已保留,条目从 ${blocked.oldCount} 降至 ${blocked.newCount}。核对差异并请用户确认后,重试 kb_check,confirmDrop=${blocked.confirmationToken}`] : []
|
|
1061
|
+
return text([head, diff, ...confirmation, ...list].join('\n'))
|
|
1057
1062
|
},
|
|
1058
1063
|
},
|
|
1059
1064
|
isConcurrencySafe: () => false,
|
|
1060
1065
|
async execute(args) {
|
|
1061
|
-
// 与自检共用同一条路径:recover 的前置闸门在 drainRecoverTodo 里
|
|
1062
1066
|
try {
|
|
1063
|
-
|
|
1067
|
+
const result = await core.checkEntry(args ?? {})
|
|
1068
|
+
if (result.indexWritten && args?.confirmDrop) {
|
|
1069
|
+
indexMaintainer?.resume()
|
|
1070
|
+
overviewCache.value = null
|
|
1071
|
+
}
|
|
1072
|
+
return result
|
|
1064
1073
|
} catch (error) {
|
|
1065
1074
|
return { ok: false, execution: 'error', quality: 'unknown', defects: [], reason: error.code || 'CHECK_FAILED', detail: error.message }
|
|
1066
1075
|
}
|
|
@@ -1788,7 +1797,7 @@ let parsingService = null
|
|
|
1788
1797
|
res.writeHead(200, { 'content-type': 'text/javascript; charset=utf-8', 'cache-control': 'private, max-age=3600', 'x-content-type-options': 'nosniff' })
|
|
1789
1798
|
res.end(await readFile(path.join(pkgRoot, 'src', 'client', 'pdfjs', asset)))
|
|
1790
1799
|
} }), 'kb-workbench: PDF reader ' + asset)
|
|
1791
|
-
ctx.effect(() => webServer.register({ kind: 'exact', path: '/kb-core/workbench-events', handler: (req, res) => {
|
|
1800
|
+
ctx.effect(() => webServer.register({ kind: 'exact', path: '/kb-core/workbench-events', handler: withHostRequestAuth(ctx, (req, res) => {
|
|
1792
1801
|
if (req.method !== 'GET' || req.headers['sec-fetch-site'] === 'cross-site') return kbSendJson(res, 403, { ok: false })
|
|
1793
1802
|
res.writeHead(200, { 'content-type': 'text/event-stream', 'cache-control': 'no-store', 'x-accel-buffering': 'no' })
|
|
1794
1803
|
res.write(': workbench connected\n\n')
|
|
@@ -1796,13 +1805,13 @@ let parsingService = null
|
|
|
1796
1805
|
const heartbeat = setInterval(() => res.write(': heartbeat\n\n'), 15000)
|
|
1797
1806
|
const close = () => { off(); clearInterval(heartbeat) }
|
|
1798
1807
|
res.on('close', close)
|
|
1799
|
-
} }), 'kb-workbench: shared policy events')
|
|
1808
|
+
}) }), 'kb-workbench: shared policy events')
|
|
1800
1809
|
ctx.effect(
|
|
1801
1810
|
() =>
|
|
1802
1811
|
webServer.register({
|
|
1803
1812
|
kind: 'exact',
|
|
1804
1813
|
path: SETTINGS_API,
|
|
1805
|
-
handler: async (req, res) => {
|
|
1814
|
+
handler: withHostRequestAuth(ctx, async (req, res) => {
|
|
1806
1815
|
try {
|
|
1807
1816
|
const current = core
|
|
1808
1817
|
if (!current) return kbSendJson(res, 503, { ok: false, error: 'core 尚未就绪' })
|
|
@@ -1839,7 +1848,9 @@ let parsingService = null
|
|
|
1839
1848
|
(origin && (() => { try { return new URL(origin).host !== req.headers.host } catch { return true } })())) {
|
|
1840
1849
|
return kbSendJson(res, 403, { ok: false, error: '更新请求必须来自当前客户端' })
|
|
1841
1850
|
}
|
|
1842
|
-
return kbSendJson(res,409,{ok:false,error:'
|
|
1851
|
+
return kbSendJson(res,409,{ok:false,error:'嵌入模式尚无可证明的安全停服协议,自动安装已延后,请使用过渡安装入口。'})
|
|
1852
|
+
try { return kbSendJson(res, 200, await updateDownloader.prepare({ expectedVersion: body.expectedVersion })) }
|
|
1853
|
+
catch (error) { return kbSendJson(res, 400, { ok: false, error: String(error.message || error) }) }
|
|
1843
1854
|
}
|
|
1844
1855
|
if (body.op === 'index-maintenance.status') {
|
|
1845
1856
|
const status = await current.status()
|
|
@@ -2114,7 +2125,7 @@ let parsingService = null
|
|
|
2114
2125
|
} catch (error) {
|
|
2115
2126
|
kbSendJson(res, 500, { ok: false, error: String((error && error.message) ?? error) })
|
|
2116
2127
|
}
|
|
2117
|
-
},
|
|
2128
|
+
}),
|
|
2118
2129
|
}),
|
|
2119
2130
|
'kb-core: settings api',
|
|
2120
2131
|
)
|
package/src/host/updates.js
CHANGED
|
@@ -48,7 +48,7 @@ function selectedSources(ids) {
|
|
|
48
48
|
|
|
49
49
|
// Follow only a bounded set of HTTPS redirects belonging to the selected service.
|
|
50
50
|
// No cookies, authorization, mirror-provided download URLs or user paths are sent.
|
|
51
|
-
|
|
51
|
+
async function sourceBytes(fetchFn, source, rel, limit, timeoutMs) {
|
|
52
52
|
const controller = new AbortController()
|
|
53
53
|
let timer = setTimeout(() => controller.abort(), timeoutMs)
|
|
54
54
|
// Large archives may take longer than a metadata request. Bound idle time
|
|
@@ -102,7 +102,7 @@ export function createUpdateChecker({ currentVersion, fetch: fetchFn = globalThi
|
|
|
102
102
|
async function channel(preview) {
|
|
103
103
|
const results = await Promise.all(sources.map(async source => {
|
|
104
104
|
try {
|
|
105
|
-
const raw = await
|
|
105
|
+
const raw = await sourceBytes(fetchFn, source, preview ? 'preview-manifest.json' : 'release-manifest-v2.json', 1024 * 1024, timeoutMs)
|
|
106
106
|
const m = JSON.parse(raw.toString('utf8'))
|
|
107
107
|
if (preview && m.package === '@local/dsh-knowledge-base' && m.channel === 'preview' && m.active === false) return { source, ok: true, inactive: true }
|
|
108
108
|
const parsedVersion = parseKnowledgeVersion(m.version, { allowLegacyPreview: preview })
|
|
@@ -231,7 +231,7 @@ export function createUpdateDownloader({ checker, cacheDir, fetch: fetchFn = glo
|
|
|
231
231
|
while (!failed && next < count) {
|
|
232
232
|
const index = next++, bytes = Math.min(UPDATE_PART_BYTES, release.bytes - index * UPDATE_PART_BYTES)
|
|
233
233
|
const rel = 'dist/update-parts/' + release.sha256 + '/' + String(index).padStart(4, '0') + '.b64'
|
|
234
|
-
const encoded = await
|
|
234
|
+
const encoded = await sourceBytes(fetchFn, source, rel, Math.ceil(bytes / 3) * 4 + 1, timeoutMs)
|
|
235
235
|
const text = encoded.toString('utf8').trim()
|
|
236
236
|
if (text.length % 4 || !/^[A-Za-z0-9+/]*={0,2}$/.test(text)) throw Error('更新分片编码无效')
|
|
237
237
|
const part = Buffer.from(text, 'base64')
|
|
@@ -242,7 +242,7 @@ export function createUpdateDownloader({ checker, cacheDir, fetch: fetchFn = glo
|
|
|
242
242
|
const failure = results.find(r => r.status === 'rejected')
|
|
243
243
|
if (failure) throw failure.reason
|
|
244
244
|
raw = Buffer.concat(parts)
|
|
245
|
-
} else raw = await
|
|
245
|
+
} else raw = await sourceBytes(fetchFn, source, 'dist/' + encodeURIComponent(release.tgz), release.bytes, timeoutMs)
|
|
246
246
|
verifyUpdateArchive(raw, release)
|
|
247
247
|
await writeFile(temporary, raw, { flag: 'wx', mode: 0o600 })
|
|
248
248
|
try { await unlink(target) } catch (error) { if (error.code !== 'ENOENT') throw error }
|
|
@@ -272,7 +272,7 @@ export async function downloadBrowserExtension({ fetch: fetchFn = globalThis.fet
|
|
|
272
272
|
const errors = []
|
|
273
273
|
for (const source of UPDATE_SOURCES) {
|
|
274
274
|
try {
|
|
275
|
-
const raw = await
|
|
275
|
+
const raw = await sourceBytes(fetchFn, source, 'dist/knowledge-base-browser-extension.zip', 4 * 1024 * 1024, timeoutMs)
|
|
276
276
|
if (createHash('sha256').update(raw).digest('hex') !== EXTENSION_ARCHIVE_SHA256) throw Error('扩展文件校验失败')
|
|
277
277
|
return { ok: true, filename: 'knowledge-base-browser-extension.zip', base64: raw.toString('base64') }
|
|
278
278
|
} catch (error) { errors.push(source.name + ':' + String(error.message || error)) }
|
|
@@ -7,7 +7,7 @@ from pathlib import Path
|
|
|
7
7
|
from contextlib import contextmanager
|
|
8
8
|
import argparse, base64, hashlib, json, os, re, shutil, subprocess, sys, tarfile, uuid
|
|
9
9
|
|
|
10
|
-
PACKAGE = '@
|
|
10
|
+
PACKAGE = '@local/dsh-knowledge-base'
|
|
11
11
|
METADATA = ('package.json', 'pnpm-lock.yaml')
|
|
12
12
|
|
|
13
13
|
def sha(data): return hashlib.sha256(data).hexdigest()
|
|
@@ -65,15 +65,13 @@ def profile_lock(profile):
|
|
|
65
65
|
|
|
66
66
|
def locations(profile):
|
|
67
67
|
profile = profile.resolve(strict=True)
|
|
68
|
-
plugin = profile / 'node_modules'
|
|
68
|
+
plugin = profile / 'node_modules/@local/dsh-knowledge-base'
|
|
69
69
|
if plugin.is_symlink() or plugin.is_junction(): raise RuntimeError('Linked installations require a Host-managed migration')
|
|
70
|
-
return profile, plugin, profile / '.kb-
|
|
70
|
+
return profile, plugin, profile / '.kb-safe-updates/transaction.json'
|
|
71
71
|
|
|
72
72
|
def validate_archive(archive, expected, destination):
|
|
73
73
|
raw = archive.read_bytes()
|
|
74
|
-
|
|
75
|
-
if len(raw) != expected['bytes'] or sha(raw) != expected['sha256'] or integrity != expected['integrity']:
|
|
76
|
-
raise RuntimeError('Archive digest mismatch')
|
|
74
|
+
if len(raw) != expected['bytes'] or sha(raw) != expected['sha256']: raise RuntimeError('Archive digest mismatch')
|
|
77
75
|
seen = set(); total = 0
|
|
78
76
|
with tarfile.open(archive, 'r:gz') as stream:
|
|
79
77
|
for entry in stream:
|
|
@@ -102,7 +100,8 @@ def validate_archive(archive, expected, destination):
|
|
|
102
100
|
for name in files:
|
|
103
101
|
if name not in extracted: raise RuntimeError('Build inventory path missing')
|
|
104
102
|
digest.update((name + '\0' + sha((destination / name).read_bytes()) + '\n').encode())
|
|
105
|
-
|
|
103
|
+
if digest.hexdigest()[:16] != expected['buildId']: raise RuntimeError('Build ID mismatch')
|
|
104
|
+
return pkg
|
|
106
105
|
|
|
107
106
|
def lock_entries(lines, start, end, indent):
|
|
108
107
|
rows = []
|
|
@@ -175,16 +174,13 @@ def prepare(profile, archive, expected, pnpm=None):
|
|
|
175
174
|
if not (plugin / 'package.json').is_file(): raise RuntimeError('Existing plugin is incomplete; use the recovery installer with a trusted old package')
|
|
176
175
|
work = journal.parent / ('transaction-' + uuid.uuid4().hex); work.mkdir(parents=True)
|
|
177
176
|
candidate = work / 'candidate'; candidate.mkdir()
|
|
178
|
-
|
|
179
|
-
if current.get('name') != PACKAGE or current.get('version') != expected['currentVersion']:
|
|
180
|
-
raise RuntimeError('The installed npm package changed; restart and check again')
|
|
181
|
-
pkg, build_id = validate_archive(archive, expected, candidate)
|
|
177
|
+
pkg = validate_archive(archive, expected, candidate)
|
|
182
178
|
old = {name: base64.b64encode(data).decode() if (data := read(profile / name)) is not None else None for name in METADATA}
|
|
183
179
|
shadow = work / 'profile'; shadow.mkdir()
|
|
184
180
|
for name in (*METADATA, '.npmrc', 'pnpm-workspace.yaml'):
|
|
185
181
|
if (profile / name).is_file(): shutil.copyfile(profile / name, shadow / name)
|
|
186
182
|
staged_config = json.loads(json.dumps(config))
|
|
187
|
-
staged_config['dependencies'][PACKAGE] =
|
|
183
|
+
staged_config['dependencies'][PACKAGE] = 'file:' + archive.resolve().as_posix()
|
|
188
184
|
save(shadow / 'package.json', staged_config)
|
|
189
185
|
pnpm = pnpm or Path(os.environ.get('APPDATA', str(Path.home() / 'AppData/Roaming'))) / 'npm/node_modules/pnpm/bin/pnpm.mjs'
|
|
190
186
|
node = shutil.which('node.exe') or shutil.which('node')
|
|
@@ -192,15 +188,11 @@ def prepare(profile, archive, expected, pnpm=None):
|
|
|
192
188
|
resolver = work / 'resolver'; resolver.mkdir()
|
|
193
189
|
save(resolver / 'package.json', {'private': True, 'dependencies': {PACKAGE: staged_config['dependencies'][PACKAGE]}})
|
|
194
190
|
(resolver / 'pnpm-workspace.yaml').write_text('packages:\n - .\n', encoding='utf-8')
|
|
195
|
-
command = [node, str(pnpm), 'install', '--ignore-workspace', '--lockfile-only', '--
|
|
191
|
+
command = [node, str(pnpm), 'install', '--ignore-workspace', '--lockfile-only', '--offline', '--ignore-scripts', '--no-frozen-lockfile']
|
|
196
192
|
with (work / 'prepare.log').open('wb') as log:
|
|
197
193
|
result = subprocess.run(command, cwd=resolver, stdout=log, stderr=subprocess.STDOUT, timeout=120)
|
|
198
194
|
if result.returncode: raise RuntimeError('Staging failed; live profile unchanged. ' + (work / 'prepare.log').read_text(encoding='utf-8', errors='replace')[-2000:])
|
|
199
195
|
resolved_lock = (resolver / 'pnpm-lock.yaml').read_text(encoding='utf-8')
|
|
200
|
-
lines, blocks = managed_lock_blocks(resolved_lock)
|
|
201
|
-
start, end = blocks[1]
|
|
202
|
-
if not re.search(r'\bintegrity:\s*' + re.escape(expected['integrity']) + r'(?=[,}\s])', ''.join(lines[start:end])):
|
|
203
|
-
raise RuntimeError('Registry lock integrity does not match the verified archive')
|
|
204
196
|
original_lock = read(profile / 'pnpm-lock.yaml')
|
|
205
197
|
if original_lock is None:
|
|
206
198
|
if any(name != PACKAGE for group in ('dependencies', 'devDependencies', 'optionalDependencies') for name in config.get(group, {})): raise RuntimeError('Existing lockfile required to preserve unrelated dependencies')
|
|
@@ -211,9 +203,9 @@ def prepare(profile, archive, expected, pnpm=None):
|
|
|
211
203
|
next_config = json.loads(base64.b64decode(new['package.json']))
|
|
212
204
|
check = json.loads(json.dumps(next_config)); check['dependencies'][PACKAGE] = config['dependencies'][PACKAGE]
|
|
213
205
|
if check != config: raise RuntimeError('Staged package manager changed unrelated profile configuration')
|
|
214
|
-
plan = {'phase': 'prepared', 'work': work.name, 'version': pkg['version'], 'buildId':
|
|
206
|
+
plan = {'phase': 'prepared', 'work': work.name, 'version': pkg['version'], 'buildId': expected['buildId'], 'old': old, 'new': new, 'oldTree': tree(plugin), 'newTree': tree(candidate)}
|
|
215
207
|
save(journal, plan)
|
|
216
|
-
return {'ok': True, 'phase': 'prepared', 'transactionId': work.name, 'version': pkg['version']
|
|
208
|
+
return {'ok': True, 'phase': 'prepared', 'transactionId': work.name, 'version': pkg['version']}
|
|
217
209
|
|
|
218
210
|
def restore(profile, plugin, journal, plan):
|
|
219
211
|
for name in METADATA:
|
package/NPM-EDITION.md
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# npm 发行版 / npm distribution
|
|
2
|
-
|
|
3
|
-
本包是 DeepSeek Harness(DSH)插件,包名为 `@kingsleyasher/dsh-knowledge-base`,包含 Windows Python 运行时。与 GitHub 旧版 `@local/dsh-knowledge-base` 的包身份不同。请只启用其中一份;旧版迁移尚未验证。
|
|
4
|
-
|
|
5
|
-
## 安装和更新
|
|
6
|
-
|
|
7
|
-
- 从 3.1.5 起,可在知识库版本栏检查 npm 的最新正式版。共享服务模式下,若当前包安装在 DSH 管理的配置目录,且服务支持安全交接,打开知识库界面后会自动下载安装,也可从版本栏手动操作。更新前会等待知识库任务结束,宿主如需重启会给出提示。
|
|
8
|
-
- 嵌入模式、链接安装等不能安全交接的环境显示新版信息,由 DSH 插件管理器安装。
|
|
9
|
-
- 已安装的 npm 3.1.4 需要先通过 DSH 更新一次,才能获得这套更新功能。使用 DSH 网页版时,可在关闭该 profile 的 DSH 进程后运行 `dsh plugin --profile web add @kingsleyasher/dsh-knowledge-base@latest`,再启动 DSH。桌面版在应用中管理。
|
|
10
|
-
- npm 版仅跟踪 npm 的 `latest` 正式版标签。源码和旧版发布记录见 [Personal-Knowledge-Base](https://github.com/KingsleyAsher/Personal-Knowledge-Base)。
|
|
11
|
-
|
|
12
|
-
Version 3.1.5 introduces stable npm update checks and automatic or manual installation in shared service mode where safe handoff is available. In embedded mode, use the host plugin manager to install the reported update. Existing npm 3.1.4 installations need one host-managed upgrade to acquire this feature.
|