dsh-doc-routing-guard 0.1.1 → 0.1.2

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 wang678678
3
+ Copyright (c) 2026 local
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,27 +1,15 @@
1
1
  # dsh-doc-routing-guard
2
2
 
3
- 全局文档路由提示:PDF/图片先 ocr_read,Office 用 office 技能,知识库引用标注来源。
3
+ > 可选依赖:`dsh-tool-ocr`(ocr_read)、`dsh-doc-router`(doc_route/pdf_markdown)。不装也能用,提示词会退到内置 read/office/read_document。
4
4
 
5
- Global document-routing prompt for DSH: ocr_read for PDF/images, office skills for Office files, cited knowledge snippets.
5
+ 全局文档路由提示(本地开发)。
6
6
 
7
- ## Install
7
+ ## 功能
8
+ - 在系统提示词中注册 `doc-routing` 段:
9
+ - PDF/扫描件先 `ocr_read`;
10
+ - Office 用 office 技能;
11
+ - 知识库引用标注来源。
12
+ - 与市场插件 `dsh-doc-router` 共存(后者提供 `doc_route`/`pdf_markdown` 工具)。
8
13
 
9
- ```powershell
10
- dsh plugin --profile desktop add dsh-doc-routing-guard
11
- ```
12
-
13
- Or from GitHub:
14
-
15
- ```powershell
16
- dsh plugin --profile desktop add file:C:/path/to/dsh-doc-routing-guard
17
- ```
18
-
19
- ## Files
20
-
21
- - `lib/index.js` — host side
22
- - `lib/client.js` — web client side (if present)
23
- - `cordis.patch.yml` — bundle patch
24
-
25
- ## License
26
-
27
- MIT © 2026 wang678678
14
+ ## 说明
15
+ - 只注册提示词,不提供工具;无外网请求。
package/lib/index.js CHANGED
@@ -1,11 +1,11 @@
1
- export const name = 'dsh-doc-routing-guard'
1
+ export const name = 'dsh-doc-routing-guard'
2
2
 
3
3
  export const inject = ['systemPrompt']
4
4
 
5
5
  const TEXT = `处理文档时按下面的默认路径,不要靠文件名猜内容:
6
- - PDF:先调用 ocr_read(若工具存在)。电子版读文字层,扫描件自动 OCR;不要用 read 直接读 PDF,也不要逐页 read_image。
7
- - 图片/截图:需要文字时先 ocr_read;需要看版式、颜色、界面状态时才 read_image。
8
- - docx / xlsx / pptx:用 office 技能(python-docx / openpyxl / python-pptx)或 read_document(若存在);不要手工解压 XML。
6
+ - PDF:若 ocr_read 可用(装了 dsh-tool-ocr)优先用它;若 doc_route / pdf_markdown 可用(装了 dsh-doc-router)也可以;都没有时用 read_document 或 office-render,并明确说明限制,不要假装读到了内容。
7
+ - 图片/截图:需要文字时先 ocr_read(若可用);需要看版式、颜色、界面状态时才 read_image。
8
+ - docx / xlsx / pptx:优先 office 技能;否则 read_document(若存在);不要手工解压 XML。
9
9
  - 上传文件或工作区文件:先确认类型,再选上面的路径;没有合适工具时明确说明限制,不要假装读到了内容。
10
10
  - 引用 OCR 结果时提醒用户校对数字、邮箱、上下标(OCR 常在这些地方出错)。
11
11
  - 使用 knowledge_search 检索后,回答里引用事实时在句末标注来源:(来源:<文档名> · chunk <chunkIndex>);没有检索到依据就直说,不要编。`
@@ -17,4 +17,4 @@ export function apply(ctx) {
17
17
  text: TEXT
18
18
  }), 'dsh-doc-router: document routing')
19
19
  }
20
-
20
+
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-doc-routing-guard",
3
- "version": "0.1.1",
4
- "description": "全局文档路由提示:PDF/图片先 ocr_read,Office 用 office 技能,知识库引用标注来源。 / Global document-routing prompt for DSH: ocr_read for PDF/images, office skills for Office files, cited knowledge snippets.",
3
+ "version": "0.1.2",
4
+ "description": "全局文档路由提示:PDF/图片在 ocr_read 可用时优先,Office 用 office 技能,缺失工具时退到内置 read_document/office-render 并说明限制。",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -22,7 +22,7 @@
22
22
  "ocr",
23
23
  "routing"
24
24
  ],
25
- "author": "wang678678",
25
+ "author": "local",
26
26
  "files": [
27
27
  "lib",
28
28
  "cordis.patch.yml",
@@ -31,17 +31,5 @@
31
31
  ],
32
32
  "publishConfig": {
33
33
  "access": "public"
34
- },
35
- "repository": {
36
- "type": "git",
37
- "url": "git+https://github.com/wang678678/dsh-local-plugins.git",
38
- "directory": "packages/dsh-doc-routing-guard"
39
- },
40
- "homepage": "https://github.com/wang678678/dsh-local-plugins/tree/main/packages/dsh-doc-routing-guard",
41
- "bugs": {
42
- "url": "https://github.com/wang678678/dsh-local-plugins/issues"
43
- },
44
- "engines": {
45
- "dsh": ">=0.2.0-rc.1 <0.3.0"
46
34
  }
47
35
  }