@sparkelf/dsh-ocr 0.1.0 → 0.1.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/SKILL.md CHANGED
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  name: ocr
3
+ summary: 识别 PDF/图片/扫描件文字并输出 Markdown
3
4
  description: 把 PDF、图片、扫描件等文档识别成可读文本(Markdown)。使用管理员统一配置的 MinerU 服务,成员无需自己填写地址。适用于「识别这个 PDF 的文字」「提取这份扫描件的文字」「把图片转成文本」这类请求。
4
5
  ---
5
6
 
package/lib/client.js CHANGED
@@ -52,7 +52,8 @@ window.__ModuleLoader__.load({
52
52
  * @returns the same-origin path the Host dispatches on.
53
53
  */
54
54
  function ocrApiPath(method) {
55
- return `${OCR_API_PREFIX}/${method}`;
55
+ const base = new URL(document.baseURI);
56
+ return `${base.pathname.endsWith("/") ? base.pathname : `${base.pathname}/`}${OCR_API_PREFIX.replace(/^\/+/u, "")}/${method}`;
56
57
  }
57
58
  //#endregion
58
59
  //#region src/client/styles.ts
package/lib/index.js CHANGED
@@ -98,6 +98,8 @@ const SKILL_NAME = "ocr";
98
98
  * without touching the file.
99
99
  */
100
100
  const SKILL_DESCRIPTION = "识别 PDF、图片、扫描件等文档中的文字并输出 Markdown,使用管理员统一配置的 MinerU 服务。";
101
+ /** One-line Chinese introduction the skill center shows in place of the routing description. */
102
+ const SKILL_SUMMARY = "识别 PDF/图片/扫描件文字并输出 Markdown";
101
103
  /**
102
104
  * Display name the skill center shows for this skill.
103
105
  *
@@ -162,6 +164,7 @@ function ocrSkillProvider() {
162
164
  const candidate = {
163
165
  name: "ocr",
164
166
  description: SKILL_DESCRIPTION,
167
+ summary: SKILL_SUMMARY,
165
168
  invocation: SKILL_INVOCATION,
166
169
  source: "bundled",
167
170
  provider: SKILL_PROVIDER,
@@ -482,4 +485,4 @@ function apply(host, resolvedConfig) {
482
485
  }), "dsh-ocr: settings relay");
483
486
  }
484
487
  //#endregion
485
- export { Config, OCR_BACKEND_ROUTES, PLUGIN_NAME, PROBE_TIMEOUT_MS, SKILL_DESCRIPTION, SKILL_DISPLAY_NAME, SKILL_INVOCATION, SKILL_NAME, SKILL_PROVIDER, SKILL_RANK, answerConnectionTest, apply, bearerToken, callOcrBackend, inject, ocrSkillProvider, probeMineruAddress, readJsonBody, resolveRelayToken, skillPath, writeJson };
488
+ export { Config, OCR_BACKEND_ROUTES, PLUGIN_NAME, PROBE_TIMEOUT_MS, SKILL_DESCRIPTION, SKILL_DISPLAY_NAME, SKILL_INVOCATION, SKILL_NAME, SKILL_PROVIDER, SKILL_RANK, SKILL_SUMMARY, answerConnectionTest, apply, bearerToken, callOcrBackend, inject, ocrSkillProvider, probeMineruAddress, readJsonBody, resolveRelayToken, skillPath, writeJson };
@@ -55,6 +55,8 @@ export declare const SKILL_NAME = "ocr";
55
55
  * without touching the file.
56
56
  */
57
57
  export declare const SKILL_DESCRIPTION = "\u8BC6\u522B PDF\u3001\u56FE\u7247\u3001\u626B\u63CF\u4EF6\u7B49\u6587\u6863\u4E2D\u7684\u6587\u5B57\u5E76\u8F93\u51FA Markdown\uFF0C\u4F7F\u7528\u7BA1\u7406\u5458\u7EDF\u4E00\u914D\u7F6E\u7684 MinerU \u670D\u52A1\u3002";
58
+ /** One-line Chinese introduction the skill center shows in place of the routing description. */
59
+ export declare const SKILL_SUMMARY = "\u8BC6\u522B PDF/\u56FE\u7247/\u626B\u63CF\u4EF6\u6587\u5B57\u5E76\u8F93\u51FA Markdown";
58
60
  /**
59
61
  * Display name the skill center shows for this skill.
60
62
  *
@@ -109,6 +111,8 @@ export declare const OCR_BACKEND_ROUTES: Readonly<Record<OcrBackendMethod, {
109
111
  export interface SkillCandidateLike {
110
112
  readonly name: string;
111
113
  readonly description: string;
114
+ /** Optional one-line human-facing introduction shown by discovery UIs. */
115
+ readonly summary?: string;
112
116
  readonly invocation: {
113
117
  readonly modelInvocable: boolean;
114
118
  readonly userInvocable: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparkelf/dsh-ocr",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Document text recognition (OCR) over a shared MinerU service. Ships a skill, a host half that registers it and relays the shared address, and a settings panel where a super administrator distributes that address to every member.",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",