@helloxiaohu/plugin-mineru6 0.0.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/README.md +101 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +40 -0
- package/dist/lib/integration.strategy.d.ts +10 -0
- package/dist/lib/integration.strategy.d.ts.map +1 -0
- package/dist/lib/integration.strategy.js +118 -0
- package/dist/lib/mineru-toolset.strategy.d.ts +221 -0
- package/dist/lib/mineru-toolset.strategy.d.ts.map +1 -0
- package/dist/lib/mineru-toolset.strategy.js +236 -0
- package/dist/lib/mineru.client.d.ts +120 -0
- package/dist/lib/mineru.client.d.ts.map +1 -0
- package/dist/lib/mineru.client.js +456 -0
- package/dist/lib/mineru.controller.d.ts +9 -0
- package/dist/lib/mineru.controller.d.ts.map +1 -0
- package/dist/lib/mineru.controller.js +41 -0
- package/dist/lib/mineru.plugin.d.ts +13 -0
- package/dist/lib/mineru.plugin.d.ts.map +1 -0
- package/dist/lib/mineru.plugin.js +52 -0
- package/dist/lib/mineru.tool.d.ts +75 -0
- package/dist/lib/mineru.tool.d.ts.map +1 -0
- package/dist/lib/mineru.tool.js +141 -0
- package/dist/lib/mineru.toolset.d.ts +51 -0
- package/dist/lib/mineru.toolset.d.ts.map +1 -0
- package/dist/lib/mineru.toolset.js +52 -0
- package/dist/lib/path-meta.d.ts +5 -0
- package/dist/lib/path-meta.d.ts.map +1 -0
- package/dist/lib/path-meta.js +8 -0
- package/dist/lib/result-parser.service.d.ts +18 -0
- package/dist/lib/result-parser.service.d.ts.map +1 -0
- package/dist/lib/result-parser.service.js +171 -0
- package/dist/lib/transformer-mineru.strategy.d.ts +95 -0
- package/dist/lib/transformer-mineru.strategy.d.ts.map +1 -0
- package/dist/lib/transformer-mineru.strategy.js +163 -0
- package/dist/lib/types.d.ts +53 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +40 -0
- package/package.json +62 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { forwardRef, Inject, Injectable } from '@nestjs/common';
|
|
3
|
+
import { ConfigService } from '@nestjs/config';
|
|
4
|
+
import { DocumentTransformerStrategy, } from '@xpert-ai/plugin-sdk';
|
|
5
|
+
import { isNil, omitBy, pick } from 'lodash-es';
|
|
6
|
+
import { MinerUClient } from './mineru.client.js';
|
|
7
|
+
import { MinerUResultParserService } from './result-parser.service.js';
|
|
8
|
+
import { icon, MinerUIntegration, MinerUTransformer } from './types.js';
|
|
9
|
+
let MinerUTransformerStrategy = class MinerUTransformerStrategy {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.permissions = [
|
|
12
|
+
{
|
|
13
|
+
type: 'integration',
|
|
14
|
+
service: MinerUIntegration,
|
|
15
|
+
description: 'Access to MinerU system integrations'
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
type: 'filesystem',
|
|
19
|
+
operations: ['read', 'write', 'list'],
|
|
20
|
+
scope: []
|
|
21
|
+
}
|
|
22
|
+
];
|
|
23
|
+
this.meta = {
|
|
24
|
+
name: MinerUTransformer,
|
|
25
|
+
label: {
|
|
26
|
+
en_US: 'MinerU',
|
|
27
|
+
zh_Hans: 'MinerU'
|
|
28
|
+
},
|
|
29
|
+
description: {
|
|
30
|
+
en_US: 'A high-quality tool for convert PDF to Markdown and JSON.',
|
|
31
|
+
zh_Hans: '一站式开源高质量数据提取工具,将PDF转换成Markdown和JSON格式。'
|
|
32
|
+
},
|
|
33
|
+
icon: {
|
|
34
|
+
type: 'svg',
|
|
35
|
+
value: icon,
|
|
36
|
+
color: '#14b8a6'
|
|
37
|
+
},
|
|
38
|
+
helpUrl: 'https://mineru.net/apiManage/docs',
|
|
39
|
+
configSchema: {
|
|
40
|
+
type: 'object',
|
|
41
|
+
properties: {
|
|
42
|
+
isOcr: {
|
|
43
|
+
type: 'boolean',
|
|
44
|
+
title: {
|
|
45
|
+
en_US: 'Enable OCR',
|
|
46
|
+
zh_Hans: '启用 OCR'
|
|
47
|
+
},
|
|
48
|
+
description: {
|
|
49
|
+
en_US: 'Enable OCR for image-based PDFs.',
|
|
50
|
+
zh_Hans: '对基于图像的 PDF 启用 OCR。'
|
|
51
|
+
},
|
|
52
|
+
default: true
|
|
53
|
+
},
|
|
54
|
+
enableFormula: {
|
|
55
|
+
type: 'boolean',
|
|
56
|
+
title: {
|
|
57
|
+
en_US: 'Enable Formula Recognition',
|
|
58
|
+
zh_Hans: '启用公式识别'
|
|
59
|
+
},
|
|
60
|
+
description: {
|
|
61
|
+
en_US: 'Enable recognition of mathematical formulas in documents.',
|
|
62
|
+
zh_Hans: '启用对文档中数学公式的识别。'
|
|
63
|
+
},
|
|
64
|
+
default: true
|
|
65
|
+
},
|
|
66
|
+
enableTable: {
|
|
67
|
+
type: 'boolean',
|
|
68
|
+
title: {
|
|
69
|
+
en_US: 'Enable Table Recognition',
|
|
70
|
+
zh_Hans: '启用表格识别'
|
|
71
|
+
},
|
|
72
|
+
description: {
|
|
73
|
+
en_US: 'Enable recognition of tables in documents.',
|
|
74
|
+
zh_Hans: '启用对文档中表格的识别。'
|
|
75
|
+
},
|
|
76
|
+
default: true
|
|
77
|
+
},
|
|
78
|
+
language: {
|
|
79
|
+
type: 'string',
|
|
80
|
+
title: {
|
|
81
|
+
en_US: 'Document Language',
|
|
82
|
+
zh_Hans: '文档语言'
|
|
83
|
+
},
|
|
84
|
+
description: {
|
|
85
|
+
en_US: 'The primary language of the document (e.g., "en" for English, "ch" for Chinese).',
|
|
86
|
+
zh_Hans: '文档的主要语言(例如,英文为 "en",中文为 "ch")。'
|
|
87
|
+
},
|
|
88
|
+
default: 'ch'
|
|
89
|
+
},
|
|
90
|
+
modelVersion: {
|
|
91
|
+
type: 'string',
|
|
92
|
+
title: {
|
|
93
|
+
en_US: 'Model Version',
|
|
94
|
+
zh_Hans: '模型版本'
|
|
95
|
+
},
|
|
96
|
+
description: {
|
|
97
|
+
en_US: 'The model version to use for extraction (e.g., "vlm" or "pipeline").',
|
|
98
|
+
zh_Hans: '用于提取的模型版本(例如,“vlm”或“pipeline”)。'
|
|
99
|
+
},
|
|
100
|
+
enum: ['pipeline', 'vlm'],
|
|
101
|
+
default: 'pipeline'
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
required: []
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
validateConfig(config) {
|
|
109
|
+
throw new Error('Method not implemented.');
|
|
110
|
+
}
|
|
111
|
+
async transformDocuments(documents, config) {
|
|
112
|
+
const mineru = new MinerUClient(this.configService, config.permissions);
|
|
113
|
+
const parsedResults = [];
|
|
114
|
+
for await (const document of documents) {
|
|
115
|
+
if (mineru.serverType === 'self-hosted') {
|
|
116
|
+
const { taskId } = await mineru.createTask({
|
|
117
|
+
url: document.fileUrl,
|
|
118
|
+
filePath: document.filePath,
|
|
119
|
+
fileName: document.name,
|
|
120
|
+
isOcr: true,
|
|
121
|
+
enableFormula: true,
|
|
122
|
+
enableTable: true,
|
|
123
|
+
// language: 'ch',
|
|
124
|
+
// modelVersion: 'vlm'
|
|
125
|
+
});
|
|
126
|
+
const result = mineru.getSelfHostedTask(taskId);
|
|
127
|
+
const parsedResult = await this.resultParser.parseLocalTask(result, taskId, document, config.permissions.fileSystem);
|
|
128
|
+
parsedResult.id = document.id;
|
|
129
|
+
parsedResults.push(parsedResult);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
const { taskId } = await mineru.createTask({
|
|
133
|
+
url: document.fileUrl,
|
|
134
|
+
isOcr: true,
|
|
135
|
+
enableFormula: true,
|
|
136
|
+
enableTable: true,
|
|
137
|
+
language: 'ch',
|
|
138
|
+
modelVersion: 'vlm',
|
|
139
|
+
...omitBy(pick(config, ['isOcr', 'enableFormula', 'enableTable', 'language', 'modelVersion']), isNil)
|
|
140
|
+
});
|
|
141
|
+
// Waiting for completion
|
|
142
|
+
const result = await mineru.waitForTask(taskId, 5 * 60 * 1000, 5000);
|
|
143
|
+
const parsedResult = await this.resultParser.parseFromUrl(result.full_zip_url, taskId, document, config.permissions.fileSystem);
|
|
144
|
+
parsedResult.id = document.id;
|
|
145
|
+
parsedResults.push(parsedResult);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return parsedResults;
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
__decorate([
|
|
152
|
+
Inject(MinerUResultParserService),
|
|
153
|
+
__metadata("design:type", MinerUResultParserService)
|
|
154
|
+
], MinerUTransformerStrategy.prototype, "resultParser", void 0);
|
|
155
|
+
__decorate([
|
|
156
|
+
Inject(forwardRef(() => ConfigService)),
|
|
157
|
+
__metadata("design:type", ConfigService)
|
|
158
|
+
], MinerUTransformerStrategy.prototype, "configService", void 0);
|
|
159
|
+
MinerUTransformerStrategy = __decorate([
|
|
160
|
+
Injectable(),
|
|
161
|
+
DocumentTransformerStrategy(MinerUTransformer)
|
|
162
|
+
], MinerUTransformerStrategy);
|
|
163
|
+
export { MinerUTransformerStrategy };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { TDocumentAsset, TDocumentTransformerConfig } from "@xpert-ai/plugin-sdk";
|
|
2
|
+
export declare const MinerU = "mineru";
|
|
3
|
+
/**
|
|
4
|
+
* Integration provider key for MinerU API credentials.
|
|
5
|
+
*
|
|
6
|
+
* IMPORTANT:
|
|
7
|
+
* Keep this different from the builtin toolset provider key (`mineru`) to avoid the platform
|
|
8
|
+
* treating builtin toolset authorization as an "integration-backed" flow (which may read
|
|
9
|
+
* `credentials.integration` and crash when credentials is null).
|
|
10
|
+
*/
|
|
11
|
+
export declare const MinerUIntegration = "mineru_api";
|
|
12
|
+
/**
|
|
13
|
+
* Document transformer provider key (distinct from toolset key).
|
|
14
|
+
*/
|
|
15
|
+
export declare const MinerUTransformer = "mineru_transformer";
|
|
16
|
+
export declare const ENV_MINERU_API_BASE_URL = "MINERU_API_BASE_URL";
|
|
17
|
+
export declare const ENV_MINERU_API_TOKEN = "MINERU_API_TOKEN";
|
|
18
|
+
export declare const ENV_MINERU_SERVER_TYPE = "MINERU_SERVER_TYPE";
|
|
19
|
+
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";
|
|
20
|
+
export type TMinerUTransformerConfig = TDocumentTransformerConfig & {
|
|
21
|
+
isOcr?: boolean;
|
|
22
|
+
enableFormula?: boolean;
|
|
23
|
+
enableTable?: boolean;
|
|
24
|
+
language?: 'en' | 'ch';
|
|
25
|
+
modelVersion?: 'vlm' | 'pipeline';
|
|
26
|
+
};
|
|
27
|
+
export type MinerUDocumentMetadata = {
|
|
28
|
+
parser: 'mineru';
|
|
29
|
+
assets?: TDocumentAsset[];
|
|
30
|
+
taskId: string;
|
|
31
|
+
originPdfUrl?: string;
|
|
32
|
+
mineruBackend?: string;
|
|
33
|
+
mineruVersion?: string;
|
|
34
|
+
};
|
|
35
|
+
export type MinerUServerType = 'official' | 'self-hosted';
|
|
36
|
+
export type MinerUIntegrationOptions = {
|
|
37
|
+
apiUrl?: string;
|
|
38
|
+
apiKey?: string;
|
|
39
|
+
serverType?: MinerUServerType;
|
|
40
|
+
};
|
|
41
|
+
export interface MineruSelfHostedImage {
|
|
42
|
+
name: string;
|
|
43
|
+
dataUrl: string;
|
|
44
|
+
}
|
|
45
|
+
export interface MineruSelfHostedTaskResult {
|
|
46
|
+
mdContent: string;
|
|
47
|
+
contentList?: any;
|
|
48
|
+
images: MineruSelfHostedImage[];
|
|
49
|
+
raw: any;
|
|
50
|
+
fileName?: string;
|
|
51
|
+
sourceUrl?: string;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAA;AAEjF,eAAO,MAAM,MAAM,WAAW,CAAA;AAC9B;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,eAAe,CAAA;AAE7C;;GAEG;AACH,eAAO,MAAM,iBAAiB,uBAAuB,CAAA;AAErD,eAAO,MAAM,uBAAuB,wBAAwB,CAAA;AAC5D,eAAO,MAAM,oBAAoB,qBAAqB,CAAA;AACtD,eAAO,MAAM,sBAAsB,uBAAuB,CAAA;AAE1D,eAAO,MAAM,IAAI,m5GAsBhB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,0BAA0B,GAAG;IAClE,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IACtB,YAAY,CAAC,EAAE,KAAK,GAAG,UAAU,CAAA;CAClC,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,QAAQ,CAAC;IACjB,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,aAAa,CAAA;AAEzD,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,gBAAgB,CAAA;CAC9B,CAAA;AAED,MAAM,WAAW,qBAAqB;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"}
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
export const ENV_MINERU_API_BASE_URL = 'MINERU_API_BASE_URL';
|
|
16
|
+
export const ENV_MINERU_API_TOKEN = 'MINERU_API_TOKEN';
|
|
17
|
+
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>
|
|
40
|
+
`;
|
package/package.json
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@helloxiaohu/plugin-mineru6",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"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
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/xpert-ai/xpert-plugins.git"
|
|
18
|
+
},
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/xpert-ai/xpert-plugins/issues"
|
|
21
|
+
},
|
|
22
|
+
"type": "module",
|
|
23
|
+
"main": "./dist/index.js",
|
|
24
|
+
"module": "./dist/index.js",
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"exports": {
|
|
27
|
+
"./package.json": "./package.json",
|
|
28
|
+
".": {
|
|
29
|
+
"@xpert-plugins-starter/source": "./src/index.ts",
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"import": "./dist/index.js",
|
|
32
|
+
"default": "./dist/index.js"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist",
|
|
37
|
+
"package.json",
|
|
38
|
+
"!**/*.tsbuildinfo"
|
|
39
|
+
],
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"form-data": "^4.0.0",
|
|
42
|
+
"tslib": "^2.3.0",
|
|
43
|
+
"unzipper": "0.12.3"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"@langchain/core": "0.3.72",
|
|
47
|
+
"@langchain/langgraph": "0.4.7",
|
|
48
|
+
"@nestjs/common": "^11.1.6",
|
|
49
|
+
"@nestjs/config": "^4.0.2",
|
|
50
|
+
"@xpert-ai/plugin-sdk": "^3.6.2",
|
|
51
|
+
"@metad/contracts": "^3.6.2",
|
|
52
|
+
"axios": "1.12.2",
|
|
53
|
+
"nestjs-i18n": "10.5.1",
|
|
54
|
+
"chalk": "4.1.2",
|
|
55
|
+
"lodash-es": "4.17.21",
|
|
56
|
+
"uuid": "8.3.2",
|
|
57
|
+
"zod": "3.25.67"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@types/unzipper": "^0.10.11"
|
|
61
|
+
}
|
|
62
|
+
}
|