dsh-cntokenworld-kb 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/web.js CHANGED
@@ -195,9 +195,10 @@ window.__ModuleLoader__.load({
195
195
  'docs.hint': '点击文件可预览原文件内容',
196
196
  'docs.summary': '摘要',
197
197
  'docs.preview': '文件预览',
198
- 'docs.noNativePreview': '浏览器无法直接渲染该格式,下面显示的是服务端解析出的内容',
198
+ 'docs.noNativePreview': '浏览器无法直接渲染该格式,请切换到「源信息」查看服务端解析出的内容',
199
199
  'docs.content': '解析内容',
200
200
  'docs.info': '文件信息',
201
+ 'docs.sourceInfo': '源信息',
201
202
  'docs.size': '大小',
202
203
  'docs.type': '类型',
203
204
  'docs.status': '解析状态',
@@ -479,9 +480,10 @@ window.__ModuleLoader__.load({
479
480
  'docs.hint': 'Click a file to preview it',
480
481
  'docs.summary': 'Summary',
481
482
  'docs.preview': 'File preview',
482
- 'docs.noNativePreview': 'The browser cannot render this format; the content parsed by the service is shown below',
483
+ 'docs.noNativePreview': 'The browser cannot render this format; switch to "Source info" to see the content parsed by the service',
483
484
  'docs.content': 'Parsed content',
484
485
  'docs.info': 'File info',
486
+ 'docs.sourceInfo': 'Source info',
485
487
  'docs.size': 'Size',
486
488
  'docs.type': 'Type',
487
489
  'docs.status': 'Parse status',
@@ -1170,6 +1172,8 @@ window.__ModuleLoader__.load({
1170
1172
  .cwkb-tab:hover { color: var(--dsw-alias-label-primary); }
1171
1173
  .cwkb-tab[aria-selected="true"] { color: var(--dsw-alias-label-primary); font-weight: 600; }
1172
1174
  .cwkb-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--cwkb-accent); }
1175
+ .cwkb-detail-tabs { flex: none; padding: 0 20px; }
1176
+ .cwkb-detail-tab-body { padding-top: 16px; }
1173
1177
  .cwkb-panel-body { flex: 1 1 auto; min-height: 0; display: flex; }
1174
1178
  .cwkb-list-pane { width: 340px; flex: none; display: flex; flex-direction: column; min-height: 0; border-right: .5px solid var(--dsw-alias-border-l2); }
1175
1179
  .cwkb-list-pane-wide { width: 300px; }
@@ -1388,6 +1392,8 @@ window.__ModuleLoader__.load({
1388
1392
  const [detailLoading, setDetailLoading] = useState(false)
1389
1393
  const [detailError, setDetailError] = useState('')
1390
1394
  const [preview, setPreview] = useState(null)
1395
+ /** Which half of the detail pane is visible: the native preview or the source info. */
1396
+ const [detailTab, setDetailTab] = useState('preview')
1391
1397
  /** The object URL of the previewed file, so it can be released again. */
1392
1398
  const previewUrl = useRef('')
1393
1399
  /** The "add document" menu and the dialog it opens. */
@@ -1807,6 +1813,7 @@ window.__ModuleLoader__.load({
1807
1813
  setDetailError('')
1808
1814
  setDetail(null)
1809
1815
  setPreview(null)
1816
+ setDetailTab('preview')
1810
1817
  bridgeRead('document', { knowledgeId: document_.id })
1811
1818
  .then(value => {
1812
1819
  setDetail(value)
@@ -2240,53 +2247,74 @@ window.__ModuleLoader__.load({
2240
2247
  : null,
2241
2248
  ),
2242
2249
  ),
2243
- previewPane === null
2244
- ? null
2245
- : h('section', { className: 'cwkb-section' },
2246
- h('h4', { className: 'cwkb-section-title' }, t('docs.preview')),
2247
- previewPane,
2248
- ),
2249
- h('section', { className: 'cwkb-section' },
2250
- h('h4', { className: 'cwkb-section-title' }, t('docs.info')),
2251
- h('div', { className: 'cwkb-meta-grid' },
2252
- h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.type')), h('span', { className: 'cwkb-meta-value' }, (detail.document.fileType || '').toUpperCase() || '—')),
2253
- h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.size')), h('span', { className: 'cwkb-meta-value' }, formatSize(detail.document.fileSize))),
2254
- h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.status')), h('span', { className: 'cwkb-meta-value' }, statusLabel(detail.document.parseStatus))),
2255
- h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.updated')), h('span', { className: 'cwkb-meta-value' }, formatTime(detail.document.updatedAt))),
2256
- detail.document.folderPath
2257
- ? h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.folder')), h('span', { className: 'cwkb-meta-value' }, detail.document.folderPath))
2258
- : null,
2259
- detail.document.source
2260
- ? h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.source')), h('span', { className: 'cwkb-meta-value' }, detail.document.source))
2261
- : null,
2262
- detail.profile?.docType
2263
- ? h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, '类型'), h('span', { className: 'cwkb-meta-value' }, detail.profile.docType))
2264
- : null,
2265
- ),
2266
- detail.document.errorMessage
2267
- ? h(Notice, { kind: 'error' }, detail.document.errorMessage)
2268
- : null,
2269
- (detail.document.tags ?? []).length > 0
2270
- ? h('div', { className: 'cwkb-chips', style: { padding: '10px 0 0' } },
2271
- detail.document.tags.map(tag => h('span', { key: tag.id, className: 'cwkb-chip cwkb-chip-tag' }, tag.name)))
2272
- : null,
2273
- detail.profile?.topics?.length
2274
- ? h('div', { className: 'cwkb-chips', style: { padding: '10px 0 0' } },
2275
- detail.profile.topics.map(topic => h('span', { key: topic, className: 'cwkb-chip' }, topic)))
2276
- : null,
2250
+ h('div', { className: 'cwkb-tabs cwkb-detail-tabs', role: 'tablist' },
2251
+ h('button', {
2252
+ type: 'button',
2253
+ role: 'tab',
2254
+ className: 'cwkb-tab',
2255
+ 'aria-selected': detailTab === 'preview' ? 'true' : 'false',
2256
+ onClick: () => setDetailTab('preview'),
2257
+ }, t('docs.preview')),
2258
+ h('button', {
2259
+ type: 'button',
2260
+ role: 'tab',
2261
+ className: 'cwkb-tab',
2262
+ 'aria-selected': detailTab === 'sourceInfo' ? 'true' : 'false',
2263
+ onClick: () => setDetailTab('sourceInfo'),
2264
+ }, t('docs.sourceInfo')),
2277
2265
  ),
2278
- detail.document.description
2279
- ? h('section', { className: 'cwkb-section' },
2280
- h('h4', { className: 'cwkb-section-title' }, t('docs.summary')),
2281
- h('p', { className: 'cwkb-summary-text' }, detail.document.description),
2266
+ detailTab === 'preview'
2267
+ ? h('div', { className: 'cwkb-detail-tab-body' },
2268
+ previewPane === null
2269
+ ? h('div', { className: 'cwkb-center' }, t('common.loading'))
2270
+ : previewPane,
2271
+ )
2272
+ : null,
2273
+ detailTab === 'sourceInfo'
2274
+ ? h('div', { className: 'cwkb-detail-tab-body' },
2275
+ h('section', { className: 'cwkb-section' },
2276
+ h('h4', { className: 'cwkb-section-title' }, t('docs.info')),
2277
+ h('div', { className: 'cwkb-meta-grid' },
2278
+ h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.type')), h('span', { className: 'cwkb-meta-value' }, (detail.document.fileType || '').toUpperCase() || '—')),
2279
+ h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.size')), h('span', { className: 'cwkb-meta-value' }, formatSize(detail.document.fileSize))),
2280
+ h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.status')), h('span', { className: 'cwkb-meta-value' }, statusLabel(detail.document.parseStatus))),
2281
+ h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.updated')), h('span', { className: 'cwkb-meta-value' }, formatTime(detail.document.updatedAt))),
2282
+ detail.document.folderPath
2283
+ ? h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.folder')), h('span', { className: 'cwkb-meta-value' }, detail.document.folderPath))
2284
+ : null,
2285
+ detail.document.source
2286
+ ? h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.source')), h('span', { className: 'cwkb-meta-value' }, detail.document.source))
2287
+ : null,
2288
+ detail.profile?.docType
2289
+ ? h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, '类型'), h('span', { className: 'cwkb-meta-value' }, detail.profile.docType))
2290
+ : null,
2291
+ ),
2292
+ detail.document.errorMessage
2293
+ ? h(Notice, { kind: 'error' }, detail.document.errorMessage)
2294
+ : null,
2295
+ (detail.document.tags ?? []).length > 0
2296
+ ? h('div', { className: 'cwkb-chips', style: { padding: '10px 0 0' } },
2297
+ detail.document.tags.map(tag => h('span', { key: tag.id, className: 'cwkb-chip cwkb-chip-tag' }, tag.name)))
2298
+ : null,
2299
+ detail.profile?.topics?.length
2300
+ ? h('div', { className: 'cwkb-chips', style: { padding: '10px 0 0' } },
2301
+ detail.profile.topics.map(topic => h('span', { key: topic, className: 'cwkb-chip' }, topic)))
2302
+ : null,
2303
+ ),
2304
+ detail.document.description
2305
+ ? h('section', { className: 'cwkb-section' },
2306
+ h('h4', { className: 'cwkb-section-title' }, t('docs.summary')),
2307
+ h('p', { className: 'cwkb-summary-text' }, detail.document.description),
2308
+ )
2309
+ : null,
2310
+ h('section', { className: 'cwkb-section' },
2311
+ h('h4', { className: 'cwkb-section-title' }, `${t('docs.content')} · ${t('docs.segments', { count: detail.chunks?.length ?? 0 })}`),
2312
+ (detail.chunks ?? []).length === 0
2313
+ ? h(Notice, null, t('common.empty'))
2314
+ : (detail.chunks ?? []).map(chunk => h('pre', { key: chunk.id, className: 'cwkb-chunk' }, chunk.content)),
2315
+ ),
2282
2316
  )
2283
2317
  : null,
2284
- h('section', { className: 'cwkb-section' },
2285
- h('h4', { className: 'cwkb-section-title' }, `${t('docs.content')} · ${t('docs.segments', { count: detail.chunks?.length ?? 0 })}`),
2286
- (detail.chunks ?? []).length === 0
2287
- ? h(Notice, null, t('common.empty'))
2288
- : (detail.chunks ?? []).map(chunk => h('pre', { key: chunk.id, className: 'cwkb-chunk' }, chunk.content)),
2289
- ),
2290
2318
  )
2291
2319
  : null,
2292
2320
  ),
@@ -5225,12 +5253,16 @@ window.__ModuleLoader__.load({
5225
5253
  */
5226
5254
 
5227
5255
  const SCOPE_CSS = `
5228
- .cwkb-scope-trigger { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border: .5px solid var(--dsw-alias-border-l2); border-radius: 999px; background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-secondary); font: inherit; font-size: 12px; line-height: 20px; cursor: pointer; max-width: 220px; }
5229
- .cwkb-scope-trigger:hover { background: var(--dsw-alias-interactive-bg-hover); color: var(--dsw-alias-label-primary); }
5256
+ .cwkb-scope { display: inline-flex; align-items: center; }
5257
+ .cwkb-scope-trigger { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 1px solid var(--dsw-alias-state-business-primary); border-radius: 999px; background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-primary); font: inherit; font-size: 12px; font-weight: 500; line-height: 22px; cursor: pointer; max-width: 260px; }
5258
+ .cwkb-scope-trigger:hover { background: var(--dsw-alias-interactive-bg-hover); }
5230
5259
  .cwkb-scope-trigger:focus-visible { outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary)); outline-offset: 2px; }
5231
- .cwkb-scope-trigger[data-active="true"] { color: var(--dsw-alias-label-primary); border-color: var(--dsw-alias-state-business-primary); }
5260
+ .cwkb-scope-trigger[data-active="true"] { color: var(--dsw-alias-state-business-primary); }
5232
5261
  .cwkb-scope-trigger svg { flex: none; }
5233
5262
  .cwkb-scope-trigger span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
5263
+ .cwkb-scope-prefix { color: var(--dsw-alias-label-secondary); font-weight: 400; }
5264
+ .cwkb-scope-chevron { margin-left: 2px; opacity: .7; transition: transform .12s ease; }
5265
+ .cwkb-scope-trigger[aria-expanded="true"] .cwkb-scope-chevron { transform: rotate(180deg); }
5234
5266
  .cwkb-scope-popup { position: fixed; z-index: 2400; width: 300px; max-height: 60vh; overflow: auto; box-sizing: border-box; padding: 10px 12px 12px; border: .5px solid var(--dsw-alias-border-l2); border-radius: var(--dsw-radius-lg); background: var(--dsw-specific-menu, var(--dsw-alias-card-fill)); box-shadow: var(--dsw-elevation-prominent); color: var(--dsw-alias-label-primary); font-size: 13px; }
5235
5267
  .cwkb-scope-title { margin: 0 0 2px; font-size: 13px; font-weight: 600; }
5236
5268
  .cwkb-scope-hint { margin: 0 0 8px; color: var(--dsw-alias-label-secondary); font-size: 12px; line-height: 17px; }
@@ -5530,11 +5562,28 @@ window.__ModuleLoader__.load({
5530
5562
  className: 'cwkb-scope-trigger',
5531
5563
  ref: triggerRef,
5532
5564
  'data-active': scope.mode === 'all' ? 'false' : 'true',
5565
+ 'aria-expanded': open ? 'true' : 'false',
5566
+ 'aria-haspopup': 'dialog',
5533
5567
  title: tx('scope.picker', '选择本对话使用的知识库'),
5534
5568
  onClick: toggle,
5535
5569
  },
5536
- h(ScopeIcon, { size: 13 }),
5570
+ h(ScopeIcon, { size: 14 }),
5571
+ h('span', { className: 'cwkb-scope-prefix' }, tx('scope.label', '知识库')),
5537
5572
  h('span', null, label),
5573
+ h('svg', {
5574
+ className: 'cwkb-scope-chevron',
5575
+ width: 11,
5576
+ height: 11,
5577
+ viewBox: '0 0 16 16',
5578
+ fill: 'none',
5579
+ 'aria-hidden': true,
5580
+ }, h('path', {
5581
+ d: 'm4 6 4 4 4-4',
5582
+ stroke: 'currentColor',
5583
+ strokeWidth: '1.6',
5584
+ strokeLinecap: 'round',
5585
+ strokeLinejoin: 'round',
5586
+ })),
5538
5587
  ),
5539
5588
  open
5540
5589
  ? (typeof document !== 'undefined' && typeof ReactDOM !== 'undefined' && typeof ReactDOM.createPortal === 'function'
@@ -7,7 +7,7 @@
7
7
  两个脚本把「发布前检查 + 推送 + Release」和「npm 发布 + 校验」自动化了,可重复执行(幂等,已完成的步骤会跳过):
8
8
 
9
9
  ```bash
10
- GH_TOKEN=<有写权限的令牌> node scripts/publish-release.mjs # GitHub:推 main、补 topic 与描述、打 tag v1.0.0、建 Release 并附上 .tgz
10
+ GH_TOKEN=<有写权限的令牌> node scripts/publish-release.mjs # GitHub:推 main、补 topic 与描述、打 tag v1.0.1、建 Release 并附上 .tgz
11
11
  node scripts/publish-npm.mjs # npm(可选):发布并校验 dist-tags.latest / dist.tarball / 包内容
12
12
  node scripts/publish-npm.mjs --stage # npm(可选):暂存发布,staging 不弹 2FA,稍后人工审批
13
13
  ```
@@ -21,7 +21,7 @@ node scripts/publish-npm.mjs --stage # npm(可选)
21
21
  | 项目 | 状态 |
22
22
  | --- | --- |
23
23
  | 本地仓库 | GitLab `origin` 已推送;GitHub `main` 已推送 ✅ |
24
- | GitHub Release | ✅ `v1.0.0` 已发布,附件 `dsh-cntokenworld-kb-1.0.0.tgz`(788,893 B)可下载 |
24
+ | GitHub Release | ✅ `v1.0.1` 已发布,附件 `dsh-cntokenworld-kb-1.0.1.tgz`(待发布后更新)可下载 |
25
25
  | GitHub topic / 描述 | ✅ `dsh-plugin` topic 与仓库描述已设置 |
26
26
  | GitHub 令牌 | ✅ classic PAT(`repo` scope),存在 `~/.dsh/.gh-token`(600) |
27
27
  | awesome-dsh-plugin PR | ✅ [#19470](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin/pull/19470) 已提交(fork: `weber-pan/awesome-dsh-plugin`,分支 `add/dsh-cntokenworld-kb`),CI 跑完后自动转绿 |
@@ -33,7 +33,7 @@ node scripts/publish-npm.mjs --stage # npm(可选)
33
33
  | --- | --- |
34
34
  | 仓库 | `https://github.com/weber-pan/dsh-cntokenworld-kb`(public,main 分支) |
35
35
  | npm 包名 | `dsh-cntokenworld-kb`(registry: `https://registry.npmjs.org`) |
36
- | 版本 | `1.0.0`(package.json 单点定义) |
36
+ | 版本 | `1.0.1`(package.json 单点定义) |
37
37
  | 图标 | `icon.svg`(36×36,自包含 SVG)+ `assets/icon-180.png`(市场只收位图) |
38
38
  | 截图 | `assets/screenshot-*.png`,清单在 `screenshots.json` |
39
39
  | 目录条目 | `docs/awesome-dsh-plugin-entry.yml` → 复制到 awesome-dsh-plugin 的 `data/plugins/weber-pan__dsh-cntokenworld-kb.yml` |
@@ -73,14 +73,14 @@ git push github main --tags
73
73
 
74
74
  ## 3. 打正式版 Release ✅(已完成)
75
75
 
76
- tag `v1.0.0` 已创建,Release 已发布,附件 `dsh-cntokenworld-kb-1.0.0.tgz`(788,893 B)已上传:
76
+ tag `v1.0.1` 已创建,Release 已发布,附件 `dsh-cntokenworld-kb-1.0.1.tgz`(待发布后更新)已上传:
77
77
 
78
- https://github.com/weber-pan/dsh-cntokenworld-kb/releases/tag/v1.0.0
78
+ https://github.com/weber-pan/dsh-cntokenworld-kb/releases/tag/v1.0.1
79
79
 
80
80
  条目里的 `tarball:` 已指向这个固定的 tag:
81
81
 
82
82
  ```yaml
83
- tarball: https://github.com/weber-pan/dsh-cntokenworld-kb/releases/download/v1.0.0/dsh-cntokenworld-kb-1.0.0.tgz
83
+ tarball: https://github.com/weber-pan/dsh-cntokenworld-kb/releases/download/v1.0.1/dsh-cntokenworld-kb-1.0.1.tgz
84
84
  ```
85
85
 
86
86
  > 用 `.../releases/latest/download/xxx.tgz` 时,文件名里不能带版本号,否则发新版就会 404;钉住 tag 最稳。
@@ -131,10 +131,10 @@ NPM_TOKEN=<令牌> node scripts/publish-npm.mjs --stage
131
131
 
132
132
  然后二选一审批:
133
133
 
134
- - 网页:npmjs.com → 左侧 **Staged Packages** → 找到 `dsh-cntokenworld-kb@1.0.0` → **Approve**(会让你输 2FA);
134
+ - 网页:npmjs.com → 左侧 **Staged Packages** → 找到 `dsh-cntokenworld-kb@1.0.1` → **Approve**(会让你输 2FA);
135
135
  - CLI:`npm stage approve <stage-id> --otp <6 位码>`。
136
136
 
137
- > 暂存一个尚不存在的包时,npm 会先在包页面放一个公开的 `0.0.0-stage` 占位版本,审批通过后 1.0.0 才真正上架。
137
+ > 暂存一个尚不存在的包时,npm 会先在包页面放一个公开的 `0.0.0-stage` 占位版本,审批通过后 1.0.1 才真正上架。
138
138
 
139
139
  ### 4.4 长期方案:Trusted Publisher(OIDC)
140
140
 
@@ -2,7 +2,7 @@ url: https://github.com/weber-pan/dsh-cntokenworld-kb
2
2
  name: weber-pan/dsh-cntokenworld-kb
3
3
  category: memory
4
4
  icon: https://raw.githubusercontent.com/weber-pan/dsh-cntokenworld-kb/main/assets/icon-180.png
5
- tarball: https://github.com/weber-pan/dsh-cntokenworld-kb/releases/download/v1.0.0/dsh-cntokenworld-kb-1.0.0.tgz
5
+ tarball: https://github.com/weber-pan/dsh-cntokenworld-kb/releases/download/v1.0.1/dsh-cntokenworld-kb-1.0.1.tgz
6
6
  description:
7
7
  en: 'Connects DeepSeek Harness to a CntokenWorld knowledge base: a sidebar workbench for the documents, the wiki, the link graph and the gallery, plus four read-only tools for retrieval, reading the original passages and answering with references.'
8
8
  zh: '把 DeepSeek Harness 接到 CntokenWorld 知识库:侧边栏提供文档、Wiki、图谱与画廊的工作台,模型侧提供检索、读原文与带引用问答四个只读工具。'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-cntokenworld-kb",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "description": "CntokenWorld knowledge base tools for DeepSeek Harness: a sidebar knowledge base panel with documents (click to preview, upload documents, import pages and edit Markdown), wiki, an animated graph and gallery, plus semantic search, document reading and cited answers.",
6
6
  "license": "MIT",
@@ -60,8 +60,10 @@
60
60
  },
61
61
  "client": {
62
62
  "platform": "web",
63
+ "immediately": true,
63
64
  "inject": [
64
65
  "@deepseek-ai/dsh-client-locale",
66
+ "@deepseek-ai/dsh-client-ui-conversation",
65
67
  "@deepseek-ai/dsh-client-ui-layout",
66
68
  "@deepseek-ai/dsh-client-ui-plugin-manager",
67
69
  "@deepseek-ai/dsh-client-ui-renderer",
@@ -76,6 +78,7 @@
76
78
  "peerDependencies": {
77
79
  "@deepseek-ai/cordis": ">=4.0.1 <5.0.0",
78
80
  "@deepseek-ai/dsh-client-locale": ">=0.1.7-rc.1 <0.1.8-0 || >=0.2.0-rc.1 <0.2.1-0 || >=0.2.1-rc.1 <0.2.2-0 || >=0.2.2-alpha.1 <0.2.3-0 || >=0.2.3-alpha.1 <0.3.0-0",
81
+ "@deepseek-ai/dsh-client-ui-conversation": ">=0.1.7-rc.1 <0.1.8-0 || >=0.2.0-rc.1 <0.2.1-0 || >=0.2.1-rc.1 <0.2.2-0 || >=0.2.2-alpha.1 <0.2.3-0 || >=0.2.3-alpha.1 <0.3.0-0",
79
82
  "@deepseek-ai/dsh-client-ui-layout": ">=0.1.7-rc.1 <0.1.8-0 || >=0.2.0-rc.1 <0.2.1-0 || >=0.2.1-rc.1 <0.2.2-0 || >=0.2.2-alpha.1 <0.2.3-0 || >=0.2.3-alpha.1 <0.3.0-0",
80
83
  "@deepseek-ai/dsh-client-ui-plugin-manager": ">=0.1.7-rc.1 <0.1.8-0 || >=0.2.0-rc.1 <0.2.1-0 || >=0.2.1-rc.1 <0.2.2-0 || >=0.2.2-alpha.1 <0.2.3-0 || >=0.2.3-alpha.1 <0.3.0-0",
81
84
  "@deepseek-ai/dsh-client-ui-renderer": ">=0.1.7-rc.1 <0.1.8-0 || >=0.2.0-rc.1 <0.2.1-0 || >=0.2.1-rc.1 <0.2.2-0 || >=0.2.2-alpha.1 <0.2.3-0 || >=0.2.3-alpha.1 <0.3.0-0",
@@ -91,6 +94,9 @@
91
94
  "@deepseek-ai/dsh-client-locale": {
92
95
  "optional": true
93
96
  },
97
+ "@deepseek-ai/dsh-client-ui-conversation": {
98
+ "optional": true
99
+ },
94
100
  "@deepseek-ai/dsh-client-ui-layout": {
95
101
  "optional": true
96
102
  },
@@ -7,7 +7,7 @@
7
7
  // new token, not the read-only one.)
8
8
  //
9
9
  // Does: push main -> set repo description + `dsh-plugin` topic ->
10
- // tag v1.0.0 -> GitHub Release v1.0.0 with the packed .tgz asset.
10
+ // tag vX.Y.Z (from package.json) -> GitHub Release with the packed .tgz asset.
11
11
  // Idempotent: re-running after a partial success skips steps already done.
12
12
  import { execFileSync } from 'node:child_process'
13
13
  import fs from 'node:fs'
@@ -15,8 +15,10 @@ import path from 'node:path'
15
15
  import { fileURLToPath } from 'node:url'
16
16
 
17
17
  const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
18
+ const PKG = JSON.parse(fs.readFileSync(path.join(ROOT, 'package.json'), 'utf8'))
19
+ const PKG_VERSION = PKG.version
18
20
  const REPO = 'weber-pan/dsh-cntokenworld-kb'
19
- const TAG = 'v1.0.0'
21
+ const TAG = `v${PKG_VERSION}`
20
22
  const TOPIC = 'dsh-plugin'
21
23
  const DESCRIPTION =
22
24
  'CntokenWorld knowledge base for DeepSeek Harness: sidebar workbench for documents, wiki, link graph and gallery, plus read-only retrieval, read-document and cited Q&A tools. Service address and API key are configured in the plugin settings section.'
@@ -74,7 +76,7 @@ if (repo.description !== DESCRIPTION) {
74
76
  ok('description set')
75
77
  } else ok('description already set')
76
78
 
77
- // 3) tag v1.0.0
79
+ // 3) tag vX.Y.Z
78
80
  console.log('3) tag ' + TAG)
79
81
  const tagRef = api('GET', `repos/${REPO}/git/refs/tags/${TAG}`)
80
82
  if (tagRef.object) {
@@ -69,9 +69,10 @@ const DICT = {
69
69
  'docs.hint': '点击文件可预览原文件内容',
70
70
  'docs.summary': '摘要',
71
71
  'docs.preview': '文件预览',
72
- 'docs.noNativePreview': '浏览器无法直接渲染该格式,下面显示的是服务端解析出的内容',
72
+ 'docs.noNativePreview': '浏览器无法直接渲染该格式,请切换到「源信息」查看服务端解析出的内容',
73
73
  'docs.content': '解析内容',
74
74
  'docs.info': '文件信息',
75
+ 'docs.sourceInfo': '源信息',
75
76
  'docs.size': '大小',
76
77
  'docs.type': '类型',
77
78
  'docs.status': '解析状态',
@@ -353,9 +354,10 @@ const DICT = {
353
354
  'docs.hint': 'Click a file to preview it',
354
355
  'docs.summary': 'Summary',
355
356
  'docs.preview': 'File preview',
356
- 'docs.noNativePreview': 'The browser cannot render this format; the content parsed by the service is shown below',
357
+ 'docs.noNativePreview': 'The browser cannot render this format; switch to "Source info" to see the content parsed by the service',
357
358
  'docs.content': 'Parsed content',
358
359
  'docs.info': 'File info',
360
+ 'docs.sourceInfo': 'Source info',
359
361
  'docs.size': 'Size',
360
362
  'docs.type': 'Type',
361
363
  'docs.status': 'Parse status',
@@ -71,6 +71,8 @@ body[data-ds-dark-theme] .cwkb-panel {
71
71
  .cwkb-tab:hover { color: var(--dsw-alias-label-primary); }
72
72
  .cwkb-tab[aria-selected="true"] { color: var(--dsw-alias-label-primary); font-weight: 600; }
73
73
  .cwkb-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--cwkb-accent); }
74
+ .cwkb-detail-tabs { flex: none; padding: 0 20px; }
75
+ .cwkb-detail-tab-body { padding-top: 16px; }
74
76
  .cwkb-panel-body { flex: 1 1 auto; min-height: 0; display: flex; }
75
77
  .cwkb-list-pane { width: 340px; flex: none; display: flex; flex-direction: column; min-height: 0; border-right: .5px solid var(--dsw-alias-border-l2); }
76
78
  .cwkb-list-pane-wide { width: 300px; }
@@ -45,6 +45,8 @@ function DocsTab(props) {
45
45
  const [detailLoading, setDetailLoading] = useState(false)
46
46
  const [detailError, setDetailError] = useState('')
47
47
  const [preview, setPreview] = useState(null)
48
+ /** Which half of the detail pane is visible: the native preview or the source info. */
49
+ const [detailTab, setDetailTab] = useState('preview')
48
50
  /** The object URL of the previewed file, so it can be released again. */
49
51
  const previewUrl = useRef('')
50
52
  /** The "add document" menu and the dialog it opens. */
@@ -464,6 +466,7 @@ function DocsTab(props) {
464
466
  setDetailError('')
465
467
  setDetail(null)
466
468
  setPreview(null)
469
+ setDetailTab('preview')
467
470
  bridgeRead('document', { knowledgeId: document_.id })
468
471
  .then(value => {
469
472
  setDetail(value)
@@ -897,53 +900,74 @@ function DocsTab(props) {
897
900
  : null,
898
901
  ),
899
902
  ),
900
- previewPane === null
901
- ? null
902
- : h('section', { className: 'cwkb-section' },
903
- h('h4', { className: 'cwkb-section-title' }, t('docs.preview')),
904
- previewPane,
905
- ),
906
- h('section', { className: 'cwkb-section' },
907
- h('h4', { className: 'cwkb-section-title' }, t('docs.info')),
908
- h('div', { className: 'cwkb-meta-grid' },
909
- h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.type')), h('span', { className: 'cwkb-meta-value' }, (detail.document.fileType || '').toUpperCase() || '—')),
910
- h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.size')), h('span', { className: 'cwkb-meta-value' }, formatSize(detail.document.fileSize))),
911
- h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.status')), h('span', { className: 'cwkb-meta-value' }, statusLabel(detail.document.parseStatus))),
912
- h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.updated')), h('span', { className: 'cwkb-meta-value' }, formatTime(detail.document.updatedAt))),
913
- detail.document.folderPath
914
- ? h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.folder')), h('span', { className: 'cwkb-meta-value' }, detail.document.folderPath))
915
- : null,
916
- detail.document.source
917
- ? h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.source')), h('span', { className: 'cwkb-meta-value' }, detail.document.source))
918
- : null,
919
- detail.profile?.docType
920
- ? h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, '类型'), h('span', { className: 'cwkb-meta-value' }, detail.profile.docType))
921
- : null,
922
- ),
923
- detail.document.errorMessage
924
- ? h(Notice, { kind: 'error' }, detail.document.errorMessage)
925
- : null,
926
- (detail.document.tags ?? []).length > 0
927
- ? h('div', { className: 'cwkb-chips', style: { padding: '10px 0 0' } },
928
- detail.document.tags.map(tag => h('span', { key: tag.id, className: 'cwkb-chip cwkb-chip-tag' }, tag.name)))
929
- : null,
930
- detail.profile?.topics?.length
931
- ? h('div', { className: 'cwkb-chips', style: { padding: '10px 0 0' } },
932
- detail.profile.topics.map(topic => h('span', { key: topic, className: 'cwkb-chip' }, topic)))
933
- : null,
903
+ h('div', { className: 'cwkb-tabs cwkb-detail-tabs', role: 'tablist' },
904
+ h('button', {
905
+ type: 'button',
906
+ role: 'tab',
907
+ className: 'cwkb-tab',
908
+ 'aria-selected': detailTab === 'preview' ? 'true' : 'false',
909
+ onClick: () => setDetailTab('preview'),
910
+ }, t('docs.preview')),
911
+ h('button', {
912
+ type: 'button',
913
+ role: 'tab',
914
+ className: 'cwkb-tab',
915
+ 'aria-selected': detailTab === 'sourceInfo' ? 'true' : 'false',
916
+ onClick: () => setDetailTab('sourceInfo'),
917
+ }, t('docs.sourceInfo')),
934
918
  ),
935
- detail.document.description
936
- ? h('section', { className: 'cwkb-section' },
937
- h('h4', { className: 'cwkb-section-title' }, t('docs.summary')),
938
- h('p', { className: 'cwkb-summary-text' }, detail.document.description),
919
+ detailTab === 'preview'
920
+ ? h('div', { className: 'cwkb-detail-tab-body' },
921
+ previewPane === null
922
+ ? h('div', { className: 'cwkb-center' }, t('common.loading'))
923
+ : previewPane,
924
+ )
925
+ : null,
926
+ detailTab === 'sourceInfo'
927
+ ? h('div', { className: 'cwkb-detail-tab-body' },
928
+ h('section', { className: 'cwkb-section' },
929
+ h('h4', { className: 'cwkb-section-title' }, t('docs.info')),
930
+ h('div', { className: 'cwkb-meta-grid' },
931
+ h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.type')), h('span', { className: 'cwkb-meta-value' }, (detail.document.fileType || '').toUpperCase() || '—')),
932
+ h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.size')), h('span', { className: 'cwkb-meta-value' }, formatSize(detail.document.fileSize))),
933
+ h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.status')), h('span', { className: 'cwkb-meta-value' }, statusLabel(detail.document.parseStatus))),
934
+ h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.updated')), h('span', { className: 'cwkb-meta-value' }, formatTime(detail.document.updatedAt))),
935
+ detail.document.folderPath
936
+ ? h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.folder')), h('span', { className: 'cwkb-meta-value' }, detail.document.folderPath))
937
+ : null,
938
+ detail.document.source
939
+ ? h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, t('docs.source')), h('span', { className: 'cwkb-meta-value' }, detail.document.source))
940
+ : null,
941
+ detail.profile?.docType
942
+ ? h('div', { className: 'cwkb-meta-item' }, h('span', { className: 'cwkb-meta-key' }, '类型'), h('span', { className: 'cwkb-meta-value' }, detail.profile.docType))
943
+ : null,
944
+ ),
945
+ detail.document.errorMessage
946
+ ? h(Notice, { kind: 'error' }, detail.document.errorMessage)
947
+ : null,
948
+ (detail.document.tags ?? []).length > 0
949
+ ? h('div', { className: 'cwkb-chips', style: { padding: '10px 0 0' } },
950
+ detail.document.tags.map(tag => h('span', { key: tag.id, className: 'cwkb-chip cwkb-chip-tag' }, tag.name)))
951
+ : null,
952
+ detail.profile?.topics?.length
953
+ ? h('div', { className: 'cwkb-chips', style: { padding: '10px 0 0' } },
954
+ detail.profile.topics.map(topic => h('span', { key: topic, className: 'cwkb-chip' }, topic)))
955
+ : null,
956
+ ),
957
+ detail.document.description
958
+ ? h('section', { className: 'cwkb-section' },
959
+ h('h4', { className: 'cwkb-section-title' }, t('docs.summary')),
960
+ h('p', { className: 'cwkb-summary-text' }, detail.document.description),
961
+ )
962
+ : null,
963
+ h('section', { className: 'cwkb-section' },
964
+ h('h4', { className: 'cwkb-section-title' }, `${t('docs.content')} · ${t('docs.segments', { count: detail.chunks?.length ?? 0 })}`),
965
+ (detail.chunks ?? []).length === 0
966
+ ? h(Notice, null, t('common.empty'))
967
+ : (detail.chunks ?? []).map(chunk => h('pre', { key: chunk.id, className: 'cwkb-chunk' }, chunk.content)),
968
+ ),
939
969
  )
940
970
  : null,
941
- h('section', { className: 'cwkb-section' },
942
- h('h4', { className: 'cwkb-section-title' }, `${t('docs.content')} · ${t('docs.segments', { count: detail.chunks?.length ?? 0 })}`),
943
- (detail.chunks ?? []).length === 0
944
- ? h(Notice, null, t('common.empty'))
945
- : (detail.chunks ?? []).map(chunk => h('pre', { key: chunk.id, className: 'cwkb-chunk' }, chunk.content)),
946
- ),
947
971
  )
948
972
  : null,
949
973
  ),
@@ -9,12 +9,16 @@
9
9
  */
10
10
 
11
11
  const SCOPE_CSS = `
12
- .cwkb-scope-trigger { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border: .5px solid var(--dsw-alias-border-l2); border-radius: 999px; background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-secondary); font: inherit; font-size: 12px; line-height: 20px; cursor: pointer; max-width: 220px; }
13
- .cwkb-scope-trigger:hover { background: var(--dsw-alias-interactive-bg-hover); color: var(--dsw-alias-label-primary); }
12
+ .cwkb-scope { display: inline-flex; align-items: center; }
13
+ .cwkb-scope-trigger { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 1px solid var(--dsw-alias-state-business-primary); border-radius: 999px; background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-primary); font: inherit; font-size: 12px; font-weight: 500; line-height: 22px; cursor: pointer; max-width: 260px; }
14
+ .cwkb-scope-trigger:hover { background: var(--dsw-alias-interactive-bg-hover); }
14
15
  .cwkb-scope-trigger:focus-visible { outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary)); outline-offset: 2px; }
15
- .cwkb-scope-trigger[data-active="true"] { color: var(--dsw-alias-label-primary); border-color: var(--dsw-alias-state-business-primary); }
16
+ .cwkb-scope-trigger[data-active="true"] { color: var(--dsw-alias-state-business-primary); }
16
17
  .cwkb-scope-trigger svg { flex: none; }
17
18
  .cwkb-scope-trigger span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
19
+ .cwkb-scope-prefix { color: var(--dsw-alias-label-secondary); font-weight: 400; }
20
+ .cwkb-scope-chevron { margin-left: 2px; opacity: .7; transition: transform .12s ease; }
21
+ .cwkb-scope-trigger[aria-expanded="true"] .cwkb-scope-chevron { transform: rotate(180deg); }
18
22
  .cwkb-scope-popup { position: fixed; z-index: 2400; width: 300px; max-height: 60vh; overflow: auto; box-sizing: border-box; padding: 10px 12px 12px; border: .5px solid var(--dsw-alias-border-l2); border-radius: var(--dsw-radius-lg); background: var(--dsw-specific-menu, var(--dsw-alias-card-fill)); box-shadow: var(--dsw-elevation-prominent); color: var(--dsw-alias-label-primary); font-size: 13px; }
19
23
  .cwkb-scope-title { margin: 0 0 2px; font-size: 13px; font-weight: 600; }
20
24
  .cwkb-scope-hint { margin: 0 0 8px; color: var(--dsw-alias-label-secondary); font-size: 12px; line-height: 17px; }
@@ -314,11 +318,28 @@ function KnowledgeScopePicker(props) {
314
318
  className: 'cwkb-scope-trigger',
315
319
  ref: triggerRef,
316
320
  'data-active': scope.mode === 'all' ? 'false' : 'true',
321
+ 'aria-expanded': open ? 'true' : 'false',
322
+ 'aria-haspopup': 'dialog',
317
323
  title: tx('scope.picker', '选择本对话使用的知识库'),
318
324
  onClick: toggle,
319
325
  },
320
- h(ScopeIcon, { size: 13 }),
326
+ h(ScopeIcon, { size: 14 }),
327
+ h('span', { className: 'cwkb-scope-prefix' }, tx('scope.label', '知识库')),
321
328
  h('span', null, label),
329
+ h('svg', {
330
+ className: 'cwkb-scope-chevron',
331
+ width: 11,
332
+ height: 11,
333
+ viewBox: '0 0 16 16',
334
+ fill: 'none',
335
+ 'aria-hidden': true,
336
+ }, h('path', {
337
+ d: 'm4 6 4 4 4-4',
338
+ stroke: 'currentColor',
339
+ strokeWidth: '1.6',
340
+ strokeLinecap: 'round',
341
+ strokeLinejoin: 'round',
342
+ })),
322
343
  ),
323
344
  open
324
345
  ? (typeof document !== 'undefined' && typeof ReactDOM !== 'undefined' && typeof ReactDOM.createPortal === 'function'