@helloxiaohu/plugin-mineru 0.0.18 → 0.0.19
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/lib/integration.strategy.d.ts.map +1 -1
- package/dist/lib/integration.strategy.js +4 -4
- package/dist/lib/mineru.tool.d.ts +12 -12
- package/dist/lib/mineru.tool.d.ts.map +1 -1
- package/dist/lib/mineru.tool.js +2 -2
- package/dist/lib/transformer-mineru.strategy.d.ts.map +1 -1
- package/dist/lib/transformer-mineru.strategy.js +4 -4
- package/dist/lib/types.d.ts +13 -0
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/types.js +13 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration.strategy.d.ts","sourceRoot":"","sources":["../../src/lib/integration.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAO3E,OAAO,EACL,mBAAmB,EAGnB,0BAA0B,EAC3B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,
|
|
1
|
+
{"version":3,"file":"integration.strategy.d.ts","sourceRoot":"","sources":["../../src/lib/integration.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAO3E,OAAO,EACL,mBAAmB,EAGnB,0BAA0B,EAC3B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAA2B,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE/E,qBAEa,yBACX,YAAW,mBAAmB,CAAC,wBAAwB,CAAC;IAExD,QAAQ,CAAC,IAAI,EAAE,oBAAoB,CAsEjC;IAGF,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAExC,OAAO,CACX,WAAW,EAAE,YAAY,CAAC,wBAAwB,CAAC,EACnD,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,GAAG,CAAC;IAIT,cAAc,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;CA2BtE"}
|
|
@@ -3,11 +3,11 @@ import { forwardRef, Inject, Injectable, } from '@nestjs/common';
|
|
|
3
3
|
import { ConfigService } from '@nestjs/config';
|
|
4
4
|
import { IntegrationStrategyKey, } from '@xpert-ai/plugin-sdk';
|
|
5
5
|
import { MinerUClient } from './mineru.client.js';
|
|
6
|
-
import { icon,
|
|
6
|
+
import { icon, MinerUIntegration } from './types.js';
|
|
7
7
|
let MinerUIntegrationStrategy = class MinerUIntegrationStrategy {
|
|
8
8
|
constructor() {
|
|
9
9
|
this.meta = {
|
|
10
|
-
name:
|
|
10
|
+
name: MinerUIntegration,
|
|
11
11
|
label: {
|
|
12
12
|
en_US: 'MinerU',
|
|
13
13
|
},
|
|
@@ -80,7 +80,7 @@ let MinerUIntegrationStrategy = class MinerUIntegrationStrategy {
|
|
|
80
80
|
async validateConfig(config) {
|
|
81
81
|
const mineruClient = new MinerUClient(this.configService, {
|
|
82
82
|
integration: {
|
|
83
|
-
provider:
|
|
83
|
+
provider: MinerUIntegration,
|
|
84
84
|
options: config,
|
|
85
85
|
},
|
|
86
86
|
});
|
|
@@ -113,6 +113,6 @@ __decorate([
|
|
|
113
113
|
], MinerUIntegrationStrategy.prototype, "configService", void 0);
|
|
114
114
|
MinerUIntegrationStrategy = __decorate([
|
|
115
115
|
Injectable(),
|
|
116
|
-
IntegrationStrategyKey(
|
|
116
|
+
IntegrationStrategyKey(MinerUIntegration)
|
|
117
117
|
], MinerUIntegrationStrategy);
|
|
118
118
|
export { MinerUIntegrationStrategy };
|
|
@@ -27,41 +27,41 @@ export declare function buildMinerUTool(configService: ConfigService, resultPars
|
|
|
27
27
|
language: z.ZodNullable<z.ZodOptional<z.ZodEnum<["en", "ch"]>>>;
|
|
28
28
|
modelVersion: z.ZodNullable<z.ZodOptional<z.ZodEnum<["pipeline", "vlm"]>>>;
|
|
29
29
|
}, "strip", z.ZodTypeAny, {
|
|
30
|
-
fileUrl?: string;
|
|
31
30
|
filePath?: string;
|
|
32
|
-
|
|
31
|
+
fileUrl?: string;
|
|
33
32
|
isOcr?: boolean;
|
|
34
33
|
enableFormula?: boolean;
|
|
35
34
|
enableTable?: boolean;
|
|
36
35
|
language?: "en" | "ch";
|
|
37
|
-
modelVersion?: "
|
|
36
|
+
modelVersion?: "vlm" | "pipeline";
|
|
37
|
+
fileName?: string;
|
|
38
38
|
}, {
|
|
39
|
-
fileUrl?: string;
|
|
40
39
|
filePath?: string;
|
|
41
|
-
|
|
40
|
+
fileUrl?: string;
|
|
42
41
|
isOcr?: boolean;
|
|
43
42
|
enableFormula?: boolean;
|
|
44
43
|
enableTable?: boolean;
|
|
45
44
|
language?: "en" | "ch";
|
|
46
|
-
modelVersion?: "
|
|
45
|
+
modelVersion?: "vlm" | "pipeline";
|
|
46
|
+
fileName?: string;
|
|
47
47
|
}>, {
|
|
48
|
-
fileUrl?: string;
|
|
49
48
|
filePath?: string;
|
|
50
|
-
|
|
49
|
+
fileUrl?: string;
|
|
51
50
|
isOcr?: boolean;
|
|
52
51
|
enableFormula?: boolean;
|
|
53
52
|
enableTable?: boolean;
|
|
54
53
|
language?: "en" | "ch";
|
|
55
|
-
modelVersion?: "
|
|
54
|
+
modelVersion?: "vlm" | "pipeline";
|
|
55
|
+
fileName?: string;
|
|
56
56
|
}, {
|
|
57
|
-
fileUrl?: string;
|
|
58
57
|
filePath?: string;
|
|
59
|
-
|
|
58
|
+
fileUrl?: string;
|
|
60
59
|
isOcr?: boolean;
|
|
61
60
|
enableFormula?: boolean;
|
|
62
61
|
enableTable?: boolean;
|
|
63
62
|
language?: "en" | "ch";
|
|
64
|
-
modelVersion?: "
|
|
63
|
+
modelVersion?: "vlm" | "pipeline";
|
|
64
|
+
fileName?: string;
|
|
65
65
|
}, (string | {
|
|
66
66
|
files: any[];
|
|
67
67
|
taskId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mineru.tool.d.ts","sourceRoot":"","sources":["../../src/lib/mineru.tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,
|
|
1
|
+
{"version":3,"file":"mineru.tool.d.ts","sourceRoot":"","sources":["../../src/lib/mineru.tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAEvE,OAAO,EAAqB,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,YAAY,CAAC,EAAE,UAAU,GAAG,KAAK,CAAC;CACnC;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,yBAAyB,EACvC,OAAO,CAAC,EAAE,wBAAwB,EAClC,UAAU,CAAC,EAAE,YAAY,EACzB,QAAQ,CAAC,EAAE,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAkK9B"}
|
package/dist/lib/mineru.tool.js
CHANGED
|
@@ -3,7 +3,7 @@ import { getCurrentTaskInput } from '@langchain/langgraph';
|
|
|
3
3
|
import { getErrorMessage } from '@xpert-ai/plugin-sdk';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { MinerUClient } from './mineru.client.js';
|
|
6
|
-
import {
|
|
6
|
+
import { MinerUIntegration } from './types.js';
|
|
7
7
|
/**
|
|
8
8
|
* Build MinerU PDF parser tool
|
|
9
9
|
* This tool converts PDF files to markdown format using MinerU service
|
|
@@ -28,7 +28,7 @@ export function buildMinerUTool(configService, resultParser, options, fileSystem
|
|
|
28
28
|
// Create MinerU client with API options stored in toolset credentials
|
|
29
29
|
const integration = options
|
|
30
30
|
? {
|
|
31
|
-
provider:
|
|
31
|
+
provider: MinerUIntegration,
|
|
32
32
|
options,
|
|
33
33
|
}
|
|
34
34
|
: undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformer-mineru.strategy.d.ts","sourceRoot":"","sources":["../../src/lib/transformer-mineru.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAG/D,OAAO,EACL,aAAa,EAEb,oBAAoB,EACpB,4BAA4B,EAC5B,qBAAqB,EACtB,MAAM,sBAAsB,CAAA;AAI7B,OAAO,
|
|
1
|
+
{"version":3,"file":"transformer-mineru.strategy.d.ts","sourceRoot":"","sources":["../../src/lib/transformer-mineru.strategy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAG/D,OAAO,EACL,aAAa,EAEb,oBAAoB,EACpB,4BAA4B,EAC5B,qBAAqB,EACtB,MAAM,sBAAsB,CAAA;AAI7B,OAAO,EAA8C,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAEjG,qBAEa,yBAA0B,YAAW,4BAA4B,CAAC,wBAAwB,CAAC;IAEtG,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA2B;IAGxD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAe;IAE7C,QAAQ,CAAC,WAAW,mDAWnB;IAED,QAAQ,CAAC,IAAI;;;;;;;;;;;kBAWM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAwE1B;IAED,cAAc,CAAC,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpC,kBAAkB,CACtB,SAAS,EAAE,OAAO,CAAC,kBAAkB,CAAC,EAAE,EACxC,MAAM,EAAE,wBAAwB,GAC/B,OAAO,CAAC,OAAO,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC;CAsDzD"}
|
|
@@ -5,13 +5,13 @@ import { DocumentTransformerStrategy, } from '@xpert-ai/plugin-sdk';
|
|
|
5
5
|
import { isNil, omitBy, pick } from 'lodash-es';
|
|
6
6
|
import { MinerUClient } from './mineru.client.js';
|
|
7
7
|
import { MinerUResultParserService } from './result-parser.service.js';
|
|
8
|
-
import { icon,
|
|
8
|
+
import { icon, MinerUIntegration, MinerUTransformer } from './types.js';
|
|
9
9
|
let MinerUTransformerStrategy = class MinerUTransformerStrategy {
|
|
10
10
|
constructor() {
|
|
11
11
|
this.permissions = [
|
|
12
12
|
{
|
|
13
13
|
type: 'integration',
|
|
14
|
-
service:
|
|
14
|
+
service: MinerUIntegration,
|
|
15
15
|
description: 'Access to MinerU system integrations'
|
|
16
16
|
},
|
|
17
17
|
{
|
|
@@ -21,7 +21,7 @@ let MinerUTransformerStrategy = class MinerUTransformerStrategy {
|
|
|
21
21
|
}
|
|
22
22
|
];
|
|
23
23
|
this.meta = {
|
|
24
|
-
name:
|
|
24
|
+
name: MinerUTransformer,
|
|
25
25
|
label: {
|
|
26
26
|
en_US: 'MinerU',
|
|
27
27
|
zh_Hans: 'MinerU'
|
|
@@ -158,6 +158,6 @@ __decorate([
|
|
|
158
158
|
], MinerUTransformerStrategy.prototype, "configService", void 0);
|
|
159
159
|
MinerUTransformerStrategy = __decorate([
|
|
160
160
|
Injectable(),
|
|
161
|
-
DocumentTransformerStrategy(
|
|
161
|
+
DocumentTransformerStrategy(MinerUTransformer)
|
|
162
162
|
], MinerUTransformerStrategy);
|
|
163
163
|
export { MinerUTransformerStrategy };
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { TDocumentAsset, TDocumentTransformerConfig } from "@xpert-ai/plugin-sdk";
|
|
2
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";
|
|
3
16
|
export declare const ENV_MINERU_API_BASE_URL = "MINERU_API_BASE_URL";
|
|
4
17
|
export declare const ENV_MINERU_API_TOKEN = "MINERU_API_TOKEN";
|
|
5
18
|
export declare const ENV_MINERU_SERVER_TYPE = "MINERU_SERVER_TYPE";
|
package/dist/lib/types.d.ts.map
CHANGED
|
@@ -1 +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;
|
|
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,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AE,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,4 +1,17 @@
|
|
|
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';
|
|
2
15
|
export const ENV_MINERU_API_BASE_URL = 'MINERU_API_BASE_URL';
|
|
3
16
|
export const ENV_MINERU_API_TOKEN = 'MINERU_API_TOKEN';
|
|
4
17
|
export const ENV_MINERU_SERVER_TYPE = 'MINERU_SERVER_TYPE';
|