@helloxiaohu/plugin-mineru 0.1.0 → 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.
@@ -1,60 +1,43 @@
1
+ import { TDocumentAsset, TDocumentTransformerConfig } from "@xpert-ai/plugin-sdk";
1
2
  export declare const MinerU = "mineru";
2
- /**
3
- * Integration provider key for MinerU API credentials.
4
- *
5
- * IMPORTANT:
6
- * Keep this different from the builtin toolset provider key (`mineru`) to avoid the platform
7
- * treating builtin toolset authorization as an "integration-backed" flow (which may read
8
- * `credentials.integration` and crash when credentials is null).
9
- */
10
- export declare const MinerUIntegration = "mineru_api";
11
- /**
12
- * Document transformer provider key (distinct from toolset key).
13
- */
14
- export declare const MinerUTransformer = "mineru_transformer";
15
3
  export declare const ENV_MINERU_API_BASE_URL = "MINERU_API_BASE_URL";
16
4
  export declare const ENV_MINERU_API_TOKEN = "MINERU_API_TOKEN";
17
5
  export declare const ENV_MINERU_SERVER_TYPE = "MINERU_SERVER_TYPE";
18
6
  export declare const icon = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M19.7238 3.86898C19.7238 4.57597 19.1502 5.1491 18.4427 5.1491C17.7352 5.1491 17.1616 4.57597 17.1616 3.86898C17.1616 3.16199 17.7352 2.58887 18.4427 2.58887C19.1502 2.58887 19.7238 3.16199 19.7238 3.86898Z\" fill=\"url(#paint0_linear_8609_1645)\"/>\n<path d=\"M19.7238 3.86898C19.7238 4.57597 19.1502 5.1491 18.4427 5.1491C17.7352 5.1491 17.1616 4.57597 17.1616 3.86898C17.1616 3.16199 17.7352 2.58887 18.4427 2.58887C19.1502 2.58887 19.7238 3.16199 19.7238 3.86898Z\" fill=\"#010101\"/>\n<path d=\"M15.3681 5.1491C15.3681 5.85609 14.7945 6.42921 14.087 6.42921C13.3794 6.42921 12.8059 5.85609 12.8059 5.1491C12.8059 4.44211 13.3794 3.86898 14.087 3.86898C14.7945 3.86898 15.3681 4.44211 15.3681 5.1491Z\" fill=\"url(#paint1_linear_8609_1645)\"/>\n<path d=\"M15.3681 5.1491C15.3681 5.85609 14.7945 6.42921 14.087 6.42921C13.3794 6.42921 12.8059 5.85609 12.8059 5.1491C12.8059 4.44211 13.3794 3.86898 14.087 3.86898C14.7945 3.86898 15.3681 4.44211 15.3681 5.1491Z\" fill=\"#010101\"/>\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M8.05175 11.2368C8.05175 13.4605 9.14375 15.4293 10.8211 16.6371C11.8241 15.7389 12.4551 14.4345 12.4551 12.9828V9.39673C12.4551 8.85661 12.8197 8.38448 13.3426 8.24757L19.8924 6.53265C20.6459 6.33534 21.3826 6.90341 21.3826 7.6818L21.3826 12.0452C21.3826 17.2179 17.1861 21.4111 12.0095 21.4111L11.9942 21.4111C6.81758 21.4111 2.62109 17.2179 2.62109 12.0452V9.03388C2.62109 8.49175 2.9884 8.01839 3.51385 7.88336L6.56677 7.09882C7.31904 6.9055 8.05175 7.47318 8.05175 8.24934V11.2368ZM3.9798 12.0452C3.9798 13.8476 4.57565 15.5108 5.58124 16.849C6.04996 17.4728 6.7655 17.8884 7.54573 17.8884V17.8884C8.28848 17.8884 8.9927 17.7236 9.62376 17.4286C7.83439 15.9596 6.69304 13.7314 6.69304 11.2368V8.46821L3.9798 9.16546V12.0452Z\" fill=\"url(#paint2_linear_8609_1645)\"/>\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M8.05175 11.2368C8.05175 13.4605 9.14375 15.4293 10.8211 16.6371C11.8241 15.7389 12.4551 14.4345 12.4551 12.9828V9.39673C12.4551 8.85661 12.8197 8.38448 13.3426 8.24757L19.8924 6.53265C20.6459 6.33534 21.3826 6.90341 21.3826 7.6818L21.3826 12.0452C21.3826 17.2179 17.1861 21.4111 12.0095 21.4111L11.9942 21.4111C6.81758 21.4111 2.62109 17.2179 2.62109 12.0452V9.03388C2.62109 8.49175 2.9884 8.01839 3.51385 7.88336L6.56677 7.09882C7.31904 6.9055 8.05175 7.47318 8.05175 8.24934V11.2368ZM3.9798 12.0452C3.9798 13.8476 4.57565 15.5108 5.58124 16.849C6.04996 17.4728 6.7655 17.8884 7.54573 17.8884V17.8884C8.28848 17.8884 8.9927 17.7236 9.62376 17.4286C7.83439 15.9596 6.69304 13.7314 6.69304 11.2368V8.46821L3.9798 9.16546V12.0452Z\" fill=\"#010101\"/>\n<defs>\n<linearGradient id=\"paint0_linear_8609_1645\" x1=\"14.3898\" y1=\"8.36821\" x2=\"13.1876\" y2=\"19.4461\" gradientUnits=\"userSpaceOnUse\">\n<stop stop-color=\"white\"/>\n<stop offset=\"1\" stop-color=\"#2E2E2E\"/>\n</linearGradient>\n<linearGradient id=\"paint1_linear_8609_1645\" x1=\"14.3898\" y1=\"8.36821\" x2=\"13.1876\" y2=\"19.4461\" gradientUnits=\"userSpaceOnUse\">\n<stop stop-color=\"white\"/>\n<stop offset=\"1\" stop-color=\"#2E2E2E\"/>\n</linearGradient>\n<linearGradient id=\"paint2_linear_8609_1645\" x1=\"14.3898\" y1=\"8.36821\" x2=\"13.1876\" y2=\"19.4461\" gradientUnits=\"userSpaceOnUse\">\n<stop stop-color=\"white\"/>\n<stop offset=\"1\" stop-color=\"#2E2E2E\"/>\n</linearGradient>\n</defs>\n</svg>\n";
19
- export interface MinerUIntegrationOptions {
7
+ export type TMinerUTransformerConfig = TDocumentTransformerConfig & {
8
+ isOcr?: boolean;
9
+ enableFormula?: boolean;
10
+ enableTable?: boolean;
11
+ language?: 'en' | 'ch';
12
+ modelVersion?: 'vlm' | 'pipeline';
13
+ pageRanges?: string;
14
+ };
15
+ export type MinerUDocumentMetadata = {
16
+ parser: 'mineru';
17
+ assets?: TDocumentAsset[];
18
+ taskId: string;
19
+ originPdfUrl?: string;
20
+ mineruBackend?: string;
21
+ mineruVersion?: string;
22
+ fullZipUrl?: string;
23
+ };
24
+ export type MinerUServerType = 'official' | 'self-hosted';
25
+ export type MinerUIntegrationOptions = {
20
26
  apiUrl?: string;
21
27
  apiKey?: string;
22
28
  serverType?: MinerUServerType;
23
- }
24
- export type MinerUServerType = 'official' | 'self-hosted';
29
+ extraFormats?: string[];
30
+ };
25
31
  export interface MineruSelfHostedImage {
26
32
  name: string;
27
33
  dataUrl: string;
28
34
  }
29
35
  export interface MineruSelfHostedTaskResult {
30
36
  mdContent: string;
31
- contentList: any;
32
- images: MineruSelfHostedImage[];
33
- raw: any;
34
- fileName?: string;
35
- }
36
- export interface MinerUDocumentMetadata {
37
- parser: string;
38
- taskId: string;
39
- mineruBackend?: string;
40
- mineruVersion?: string;
41
- originPdfUrl?: string;
42
- assets?: any[];
43
- }
44
- export interface MineruSelfHostedTaskResult {
45
- mdContent: string;
46
- contentList: any;
37
+ contentList?: any;
47
38
  images: MineruSelfHostedImage[];
48
39
  raw: any;
49
40
  fileName?: string;
50
41
  sourceUrl?: string;
51
42
  }
52
- import type { XpFileSystem, TDocumentTransformerConfig } from '@xpert-ai/plugin-sdk';
53
- import type { IIntegration } from '@metad/contracts';
54
- export interface TMinerUTransformerConfig extends TDocumentTransformerConfig {
55
- permissions?: {
56
- fileSystem?: XpFileSystem;
57
- integration?: IIntegration<MinerUIntegrationOptions>;
58
- };
59
- }
60
43
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM,WAAW,CAAC;AAC/B;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAC9C;;GAEG;AACH,eAAO,MAAM,iBAAiB,uBAAuB,CAAC;AACtD,eAAO,MAAM,uBAAuB,wBAAwB,CAAC;AAC7D,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AACvD,eAAO,MAAM,sBAAsB,uBAAuB,CAAC;AAC3D,eAAO,MAAM,IAAI,m5GAsBhB,CAAC;AAEF,MAA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IACpC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,0BAA0B;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,MAAM,EAAE,qBAAqB,EAAE,CAAC;IAChC,GAAG,EAAE,GAAG,CAAC;IACT,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB"}
package/dist/lib/types.js CHANGED
@@ -1,40 +1,27 @@
1
1
  export const MinerU = 'mineru';
2
- /**
3
- * Integration provider key for MinerU API credentials.
4
- *
5
- * IMPORTANT:
6
- * Keep this different from the builtin toolset provider key (`mineru`) to avoid the platform
7
- * treating builtin toolset authorization as an "integration-backed" flow (which may read
8
- * `credentials.integration` and crash when credentials is null).
9
- */
10
- export const MinerUIntegration = 'mineru_api';
11
- /**
12
- * Document transformer provider key (distinct from toolset key).
13
- */
14
- export const MinerUTransformer = 'mineru_transformer';
15
2
  export const ENV_MINERU_API_BASE_URL = 'MINERU_API_BASE_URL';
16
3
  export const ENV_MINERU_API_TOKEN = 'MINERU_API_TOKEN';
17
4
  export const ENV_MINERU_SERVER_TYPE = 'MINERU_SERVER_TYPE';
18
- export const icon = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
19
- <path d="M19.7238 3.86898C19.7238 4.57597 19.1502 5.1491 18.4427 5.1491C17.7352 5.1491 17.1616 4.57597 17.1616 3.86898C17.1616 3.16199 17.7352 2.58887 18.4427 2.58887C19.1502 2.58887 19.7238 3.16199 19.7238 3.86898Z" fill="url(#paint0_linear_8609_1645)"/>
20
- <path d="M19.7238 3.86898C19.7238 4.57597 19.1502 5.1491 18.4427 5.1491C17.7352 5.1491 17.1616 4.57597 17.1616 3.86898C17.1616 3.16199 17.7352 2.58887 18.4427 2.58887C19.1502 2.58887 19.7238 3.16199 19.7238 3.86898Z" fill="#010101"/>
21
- <path d="M15.3681 5.1491C15.3681 5.85609 14.7945 6.42921 14.087 6.42921C13.3794 6.42921 12.8059 5.85609 12.8059 5.1491C12.8059 4.44211 13.3794 3.86898 14.087 3.86898C14.7945 3.86898 15.3681 4.44211 15.3681 5.1491Z" fill="url(#paint1_linear_8609_1645)"/>
22
- <path d="M15.3681 5.1491C15.3681 5.85609 14.7945 6.42921 14.087 6.42921C13.3794 6.42921 12.8059 5.85609 12.8059 5.1491C12.8059 4.44211 13.3794 3.86898 14.087 3.86898C14.7945 3.86898 15.3681 4.44211 15.3681 5.1491Z" fill="#010101"/>
23
- <path fill-rule="evenodd" clip-rule="evenodd" d="M8.05175 11.2368C8.05175 13.4605 9.14375 15.4293 10.8211 16.6371C11.8241 15.7389 12.4551 14.4345 12.4551 12.9828V9.39673C12.4551 8.85661 12.8197 8.38448 13.3426 8.24757L19.8924 6.53265C20.6459 6.33534 21.3826 6.90341 21.3826 7.6818L21.3826 12.0452C21.3826 17.2179 17.1861 21.4111 12.0095 21.4111L11.9942 21.4111C6.81758 21.4111 2.62109 17.2179 2.62109 12.0452V9.03388C2.62109 8.49175 2.9884 8.01839 3.51385 7.88336L6.56677 7.09882C7.31904 6.9055 8.05175 7.47318 8.05175 8.24934V11.2368ZM3.9798 12.0452C3.9798 13.8476 4.57565 15.5108 5.58124 16.849C6.04996 17.4728 6.7655 17.8884 7.54573 17.8884V17.8884C8.28848 17.8884 8.9927 17.7236 9.62376 17.4286C7.83439 15.9596 6.69304 13.7314 6.69304 11.2368V8.46821L3.9798 9.16546V12.0452Z" fill="url(#paint2_linear_8609_1645)"/>
24
- <path fill-rule="evenodd" clip-rule="evenodd" d="M8.05175 11.2368C8.05175 13.4605 9.14375 15.4293 10.8211 16.6371C11.8241 15.7389 12.4551 14.4345 12.4551 12.9828V9.39673C12.4551 8.85661 12.8197 8.38448 13.3426 8.24757L19.8924 6.53265C20.6459 6.33534 21.3826 6.90341 21.3826 7.6818L21.3826 12.0452C21.3826 17.2179 17.1861 21.4111 12.0095 21.4111L11.9942 21.4111C6.81758 21.4111 2.62109 17.2179 2.62109 12.0452V9.03388C2.62109 8.49175 2.9884 8.01839 3.51385 7.88336L6.56677 7.09882C7.31904 6.9055 8.05175 7.47318 8.05175 8.24934V11.2368ZM3.9798 12.0452C3.9798 13.8476 4.57565 15.5108 5.58124 16.849C6.04996 17.4728 6.7655 17.8884 7.54573 17.8884V17.8884C8.28848 17.8884 8.9927 17.7236 9.62376 17.4286C7.83439 15.9596 6.69304 13.7314 6.69304 11.2368V8.46821L3.9798 9.16546V12.0452Z" fill="#010101"/>
25
- <defs>
26
- <linearGradient id="paint0_linear_8609_1645" x1="14.3898" y1="8.36821" x2="13.1876" y2="19.4461" gradientUnits="userSpaceOnUse">
27
- <stop stop-color="white"/>
28
- <stop offset="1" stop-color="#2E2E2E"/>
29
- </linearGradient>
30
- <linearGradient id="paint1_linear_8609_1645" x1="14.3898" y1="8.36821" x2="13.1876" y2="19.4461" gradientUnits="userSpaceOnUse">
31
- <stop stop-color="white"/>
32
- <stop offset="1" stop-color="#2E2E2E"/>
33
- </linearGradient>
34
- <linearGradient id="paint2_linear_8609_1645" x1="14.3898" y1="8.36821" x2="13.1876" y2="19.4461" gradientUnits="userSpaceOnUse">
35
- <stop stop-color="white"/>
36
- <stop offset="1" stop-color="#2E2E2E"/>
37
- </linearGradient>
38
- </defs>
39
- </svg>
5
+ export const icon = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
6
+ <path d="M19.7238 3.86898C19.7238 4.57597 19.1502 5.1491 18.4427 5.1491C17.7352 5.1491 17.1616 4.57597 17.1616 3.86898C17.1616 3.16199 17.7352 2.58887 18.4427 2.58887C19.1502 2.58887 19.7238 3.16199 19.7238 3.86898Z" fill="url(#paint0_linear_8609_1645)"/>
7
+ <path d="M19.7238 3.86898C19.7238 4.57597 19.1502 5.1491 18.4427 5.1491C17.7352 5.1491 17.1616 4.57597 17.1616 3.86898C17.1616 3.16199 17.7352 2.58887 18.4427 2.58887C19.1502 2.58887 19.7238 3.16199 19.7238 3.86898Z" fill="#010101"/>
8
+ <path d="M15.3681 5.1491C15.3681 5.85609 14.7945 6.42921 14.087 6.42921C13.3794 6.42921 12.8059 5.85609 12.8059 5.1491C12.8059 4.44211 13.3794 3.86898 14.087 3.86898C14.7945 3.86898 15.3681 4.44211 15.3681 5.1491Z" fill="url(#paint1_linear_8609_1645)"/>
9
+ <path d="M15.3681 5.1491C15.3681 5.85609 14.7945 6.42921 14.087 6.42921C13.3794 6.42921 12.8059 5.85609 12.8059 5.1491C12.8059 4.44211 13.3794 3.86898 14.087 3.86898C14.7945 3.86898 15.3681 4.44211 15.3681 5.1491Z" fill="#010101"/>
10
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M8.05175 11.2368C8.05175 13.4605 9.14375 15.4293 10.8211 16.6371C11.8241 15.7389 12.4551 14.4345 12.4551 12.9828V9.39673C12.4551 8.85661 12.8197 8.38448 13.3426 8.24757L19.8924 6.53265C20.6459 6.33534 21.3826 6.90341 21.3826 7.6818L21.3826 12.0452C21.3826 17.2179 17.1861 21.4111 12.0095 21.4111L11.9942 21.4111C6.81758 21.4111 2.62109 17.2179 2.62109 12.0452V9.03388C2.62109 8.49175 2.9884 8.01839 3.51385 7.88336L6.56677 7.09882C7.31904 6.9055 8.05175 7.47318 8.05175 8.24934V11.2368ZM3.9798 12.0452C3.9798 13.8476 4.57565 15.5108 5.58124 16.849C6.04996 17.4728 6.7655 17.8884 7.54573 17.8884V17.8884C8.28848 17.8884 8.9927 17.7236 9.62376 17.4286C7.83439 15.9596 6.69304 13.7314 6.69304 11.2368V8.46821L3.9798 9.16546V12.0452Z" fill="url(#paint2_linear_8609_1645)"/>
11
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M8.05175 11.2368C8.05175 13.4605 9.14375 15.4293 10.8211 16.6371C11.8241 15.7389 12.4551 14.4345 12.4551 12.9828V9.39673C12.4551 8.85661 12.8197 8.38448 13.3426 8.24757L19.8924 6.53265C20.6459 6.33534 21.3826 6.90341 21.3826 7.6818L21.3826 12.0452C21.3826 17.2179 17.1861 21.4111 12.0095 21.4111L11.9942 21.4111C6.81758 21.4111 2.62109 17.2179 2.62109 12.0452V9.03388C2.62109 8.49175 2.9884 8.01839 3.51385 7.88336L6.56677 7.09882C7.31904 6.9055 8.05175 7.47318 8.05175 8.24934V11.2368ZM3.9798 12.0452C3.9798 13.8476 4.57565 15.5108 5.58124 16.849C6.04996 17.4728 6.7655 17.8884 7.54573 17.8884V17.8884C8.28848 17.8884 8.9927 17.7236 9.62376 17.4286C7.83439 15.9596 6.69304 13.7314 6.69304 11.2368V8.46821L3.9798 9.16546V12.0452Z" fill="#010101"/>
12
+ <defs>
13
+ <linearGradient id="paint0_linear_8609_1645" x1="14.3898" y1="8.36821" x2="13.1876" y2="19.4461" gradientUnits="userSpaceOnUse">
14
+ <stop stop-color="white"/>
15
+ <stop offset="1" stop-color="#2E2E2E"/>
16
+ </linearGradient>
17
+ <linearGradient id="paint1_linear_8609_1645" x1="14.3898" y1="8.36821" x2="13.1876" y2="19.4461" gradientUnits="userSpaceOnUse">
18
+ <stop stop-color="white"/>
19
+ <stop offset="1" stop-color="#2E2E2E"/>
20
+ </linearGradient>
21
+ <linearGradient id="paint2_linear_8609_1645" x1="14.3898" y1="8.36821" x2="13.1876" y2="19.4461" gradientUnits="userSpaceOnUse">
22
+ <stop stop-color="white"/>
23
+ <stop offset="1" stop-color="#2E2E2E"/>
24
+ </linearGradient>
25
+ </defs>
26
+ </svg>
40
27
  `;
package/package.json CHANGED
@@ -1,24 +1,18 @@
1
1
  {
2
2
  "name": "@helloxiaohu/plugin-mineru",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
+ "description": "MinerU document converter plugin for Xpert AI platform",
4
5
  "license": "AGPL-3.0",
5
- "description": "MinerU PDF to Markdown converter plugin for XpertAI platform with toolset support",
6
- "keywords": [
7
- "xpert-ai",
8
- "plugin",
9
- "mineru",
10
- "pdf",
11
- "markdown",
12
- "ocr",
13
- "document-conversion"
14
- ],
15
6
  "repository": {
16
7
  "type": "git",
17
- "url": "git+https://github.com/xpert-ai/xpert-plugins.git"
8
+ "url": "https://github.com/xpert-ai/xpert-plugins.git"
18
9
  },
19
10
  "bugs": {
20
11
  "url": "https://github.com/xpert-ai/xpert-plugins/issues"
21
12
  },
13
+ "publishConfig": {
14
+ "access": "public"
15
+ },
22
16
  "type": "module",
23
17
  "main": "./dist/index.js",
24
18
  "module": "./dist/index.js",
@@ -34,7 +28,6 @@
34
28
  },
35
29
  "files": [
36
30
  "dist",
37
- "package.json",
38
31
  "!**/*.tsbuildinfo"
39
32
  ],
40
33
  "dependencies": {
@@ -43,18 +36,17 @@
43
36
  "unzipper": "0.12.3"
44
37
  },
45
38
  "peerDependencies": {
46
- "@langchain/core": "0.3.72",
47
- "@langchain/langgraph": "0.4.7",
48
- "@nestjs/common": "^11.1.6",
49
39
  "@nestjs/config": "^4.0.2",
40
+ "zod": "3.25.67",
50
41
  "@xpert-ai/plugin-sdk": "^3.6.2",
51
42
  "@metad/contracts": "^3.6.2",
43
+ "@nestjs/common": "^11.1.6",
52
44
  "axios": "1.12.2",
53
45
  "nestjs-i18n": "10.5.1",
54
46
  "chalk": "4.1.2",
47
+ "@langchain/core": "^0.3.72",
55
48
  "lodash-es": "4.17.21",
56
- "uuid": "8.3.2",
57
- "zod": "3.25.67"
49
+ "uuid": "8.3.2"
58
50
  },
59
51
  "devDependencies": {
60
52
  "@types/unzipper": "^0.10.11"
@@ -1,234 +0,0 @@
1
- import { ConfigService } from '@nestjs/config';
2
- import { BuiltinToolset, IToolsetStrategy, FileSystemPermission, ISchemaSecretField } from '@xpert-ai/plugin-sdk';
3
- import { MinerUResultParserService } from './result-parser.service.js';
4
- import { MinerUToolsetConfig } from './mineru.toolset.js';
5
- /**
6
- * ToolsetStrategy for MinerU PDF parser tool
7
- * Registers MinerU as a toolset that can be used in agent workflows
8
- */
9
- export declare class MinerUToolsetStrategy implements IToolsetStrategy<MinerUToolsetConfig> {
10
- private readonly configService;
11
- private readonly resultParser;
12
- /**
13
- * Metadata for MinerU toolset
14
- */
15
- meta: {
16
- author: string;
17
- tags: string[];
18
- name: string;
19
- label: {
20
- en_US: string;
21
- zh_Hans: string;
22
- };
23
- description: {
24
- en_US: string;
25
- zh_Hans: string;
26
- };
27
- icon: {
28
- type: string;
29
- value: string;
30
- svg: string;
31
- color: string;
32
- };
33
- configSchema: {
34
- type: string;
35
- properties: {
36
- /**
37
- * NOTE:
38
- * We intentionally keep MinerU as a "self-contained" toolset that stores its own API credentials,
39
- * instead of relying on the platform IntegrationPermission flow.
40
- *
41
- * Reason: during the built-in toolset authorization step, the platform may send `credentials = null`,
42
- * and backend may access `credentials.integration`, causing a 500 (`Cannot read properties of null (reading 'integration')`).
43
- * Defining API fields directly ensures the authorization UI renders fields and always submits an object.
44
- */
45
- apiUrl: {
46
- type: string;
47
- title: {
48
- en_US: string;
49
- zh_Hans: string;
50
- };
51
- description: {
52
- en_US: string;
53
- zh_Hans: string;
54
- };
55
- default: string;
56
- };
57
- apiKey: {
58
- type: string;
59
- title: {
60
- en_US: string;
61
- zh_Hans: string;
62
- };
63
- description: {
64
- en_US: string;
65
- zh_Hans: string;
66
- };
67
- 'x-ui': ISchemaSecretField;
68
- };
69
- isOcr: {
70
- type: string;
71
- title: {
72
- en_US: string;
73
- zh_Hans: string;
74
- };
75
- description: {
76
- en_US: string;
77
- zh_Hans: string;
78
- };
79
- enum: string[];
80
- default: string;
81
- 'x-ui': {
82
- enumLabels: {
83
- true: {
84
- en_US: string;
85
- zh_Hans: string;
86
- };
87
- false: {
88
- en_US: string;
89
- zh_Hans: string;
90
- };
91
- };
92
- };
93
- };
94
- enableFormula: {
95
- type: string;
96
- title: {
97
- en_US: string;
98
- zh_Hans: string;
99
- };
100
- description: {
101
- en_US: string;
102
- zh_Hans: string;
103
- };
104
- enum: string[];
105
- default: string;
106
- 'x-ui': {
107
- enumLabels: {
108
- true: {
109
- en_US: string;
110
- zh_Hans: string;
111
- };
112
- false: {
113
- en_US: string;
114
- zh_Hans: string;
115
- };
116
- };
117
- };
118
- };
119
- enableTable: {
120
- type: string;
121
- title: {
122
- en_US: string;
123
- zh_Hans: string;
124
- };
125
- description: {
126
- en_US: string;
127
- zh_Hans: string;
128
- };
129
- enum: string[];
130
- default: string;
131
- 'x-ui': {
132
- enumLabels: {
133
- true: {
134
- en_US: string;
135
- zh_Hans: string;
136
- };
137
- false: {
138
- en_US: string;
139
- zh_Hans: string;
140
- };
141
- };
142
- };
143
- };
144
- language: {
145
- type: string;
146
- title: {
147
- en_US: string;
148
- zh_Hans: string;
149
- };
150
- description: {
151
- en_US: string;
152
- zh_Hans: string;
153
- };
154
- enum: string[];
155
- default: string;
156
- 'x-ui': {
157
- enumLabels: {
158
- en: {
159
- en_US: string;
160
- zh_Hans: string;
161
- };
162
- ch: {
163
- en_US: string;
164
- zh_Hans: string;
165
- };
166
- };
167
- };
168
- };
169
- modelVersion: {
170
- type: string;
171
- title: {
172
- en_US: string;
173
- zh_Hans: string;
174
- };
175
- description: {
176
- en_US: string;
177
- zh_Hans: string;
178
- };
179
- enum: string[];
180
- default: string;
181
- 'x-ui': {
182
- enumLabels: {
183
- pipeline: {
184
- en_US: string;
185
- zh_Hans: string;
186
- };
187
- vlm: {
188
- en_US: string;
189
- zh_Hans: string;
190
- };
191
- };
192
- };
193
- };
194
- };
195
- required: string[];
196
- };
197
- };
198
- /**
199
- * Permissions required by MinerU toolset
200
- */
201
- readonly permissions: FileSystemPermission[];
202
- constructor(configService: ConfigService, resultParser: MinerUResultParserService);
203
- /**
204
- * Validate toolset configuration
205
- */
206
- validateConfig(config: MinerUToolsetConfig | null | undefined): Promise<void>;
207
- /**
208
- * Create MinerU toolset instance
209
- * Note: config may be null/undefined during authorization phase
210
- * Modified to read from toolset.credentials (like @searchapi/@email)
211
- */
212
- create(config: any): Promise<BuiltinToolset>;
213
- /**
214
- * Create tools for MinerU toolset
215
- * Tools are created dynamically in MinerUToolset.initTools()
216
- * based on the toolset credentials/configuration
217
- */
218
- createTools(): import("@langchain/core/tools").DynamicStructuredTool<import("zod").ZodObject<{
219
- doc_url: import("zod").ZodString;
220
- }, "strip", import("zod").ZodTypeAny, {
221
- doc_url?: string;
222
- }, {
223
- doc_url?: string;
224
- }>, {
225
- doc_url?: string;
226
- }, {
227
- doc_url?: string;
228
- }, (string | {
229
- files: any[];
230
- taskId: string;
231
- metadata: any;
232
- })[]>[];
233
- }
234
- //# sourceMappingURL=mineru-toolset.strategy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mineru-toolset.strategy.d.ts","sourceRoot":"","sources":["../../src/lib/mineru-toolset.strategy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EACL,cAAc,EACd,gBAAgB,EAEhB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAiB,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAYzE;;;GAGG;AACH,qBAEa,qBAAsB,YAAW,gBAAgB,CAAC,mBAAmB,CAAC;IAyN/E,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,YAAY;IA1N/B;;OAEG;IACH,IAAI;;;;;;;;;;;;;;;;;;;;;gBAyBE;;;;;;;;mBAQG;;;;;;;;;;;;;;;;;;;;;;;4BAwBQ,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA6IjC;IAEF;;OAEG;IACH,QAAQ,CAAC,WAAW,yBAMlB;gBAIiB,aAAa,EAAE,aAAa,EAE5B,YAAY,EAAE,yBAAyB;IAG1D;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAY7E;;;;OAIG;IACG,MAAM,CAAC,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,cAAc,CAAC;IAyBlD;;;;OAIG;IACH,WAAW;;;;;;;;;;;;;;;CA4BZ"}