@heripo/pdf-parser 0.1.39 → 0.1.41
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.ko.md +19 -1
- package/README.md +19 -1
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/package.json +11 -13
- package/dist/index.cjs +0 -11460
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -373
package/README.ko.md
CHANGED
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
brew install node
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
#### 2. pnpm >= 11
|
|
68
|
+
#### 2. pnpm >= 11
|
|
69
69
|
|
|
70
70
|
```bash
|
|
71
71
|
npm install -g pnpm
|
|
@@ -653,9 +653,13 @@ type PDFConvertOptions = {
|
|
|
653
653
|
interface PDFCorrectionOptions {
|
|
654
654
|
models: {
|
|
655
655
|
textCorrection: LanguageModel; // 필수: 페이지 텍스트와 표 셀 OCR 보정
|
|
656
|
+
textCorrectionFallback?: LanguageModel; // 선택: textCorrection 실패 시 fallback
|
|
656
657
|
pageGate: LanguageModel; // 필수: 구조 Review Assistance page gate
|
|
658
|
+
pageGateFallback?: LanguageModel; // 선택: pageGate 실패 시 fallback
|
|
657
659
|
reviewAssistance: LanguageModel; // 필수: 기본 구조 review 모델
|
|
660
|
+
reviewAssistanceFallback?: LanguageModel; // 선택: reviewAssistance 공통 fallback
|
|
658
661
|
tableCorrection?: LanguageModel; // 선택: 표 전용 보정 override
|
|
662
|
+
tableCorrectionFallback?: LanguageModel; // 선택: tableCorrection 실패 시 fallback
|
|
659
663
|
reviewAssistanceTasks?: Partial<
|
|
660
664
|
Record<
|
|
661
665
|
| 'text_ocr_hanja'
|
|
@@ -667,6 +671,17 @@ interface PDFCorrectionOptions {
|
|
|
667
671
|
LanguageModel
|
|
668
672
|
>
|
|
669
673
|
>;
|
|
674
|
+
reviewAssistanceTasksFallback?: Partial<
|
|
675
|
+
Record<
|
|
676
|
+
| 'text_ocr_hanja'
|
|
677
|
+
| 'text_integrity'
|
|
678
|
+
| 'text_role_footnote'
|
|
679
|
+
| 'tables'
|
|
680
|
+
| 'pictures_captions'
|
|
681
|
+
| 'layout_bbox_order',
|
|
682
|
+
LanguageModel
|
|
683
|
+
>
|
|
684
|
+
>;
|
|
670
685
|
};
|
|
671
686
|
concurrency?: {
|
|
672
687
|
pages?: number; // 페이지 단위 text correction/page gate 동시성
|
|
@@ -687,6 +702,9 @@ interface PDFCorrectionOptions {
|
|
|
687
702
|
};
|
|
688
703
|
autoApplyThreshold?: number; // 자동 적용 최소 confidence (기본값: 0.85)
|
|
689
704
|
proposalThreshold?: number; // sidecar proposal 최소 confidence (기본값: 0.5)
|
|
705
|
+
forceAutoApply?: boolean; // true일 경우, confidence 임계값에 관계없이 review-assistance 명령을 자동 적용 (기본값: false)
|
|
706
|
+
reviewAssistanceEnabled?: boolean; // false일 경우, review-assistance 단계를 완전히 건너뜀 (기본값: true)
|
|
707
|
+
tableCorrectionEnabled?: boolean; // false일 경우, table-correction 작업을 건너뜀 (기본값: true)
|
|
690
708
|
temperature?: number; // VLM 생성 temperature (기본값: 0)
|
|
691
709
|
}
|
|
692
710
|
```
|
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
brew install node
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
#### 2. pnpm >= 11
|
|
68
|
+
#### 2. pnpm >= 11
|
|
69
69
|
|
|
70
70
|
```bash
|
|
71
71
|
npm install -g pnpm
|
|
@@ -653,9 +653,13 @@ type PDFConvertOptions = {
|
|
|
653
653
|
interface PDFCorrectionOptions {
|
|
654
654
|
models: {
|
|
655
655
|
textCorrection: LanguageModel; // Required: page text and table-cell OCR correction
|
|
656
|
+
textCorrectionFallback?: LanguageModel; // Optional: fallback for text correction
|
|
656
657
|
pageGate: LanguageModel; // Required: structural Review Assistance page gate
|
|
658
|
+
pageGateFallback?: LanguageModel; // Optional: fallback for page gate
|
|
657
659
|
reviewAssistance: LanguageModel; // Required: default structural review model
|
|
660
|
+
reviewAssistanceFallback?: LanguageModel; // Optional: common fallback for review assistance
|
|
658
661
|
tableCorrection?: LanguageModel; // Optional: table-specific correction override
|
|
662
|
+
tableCorrectionFallback?: LanguageModel; // Optional: fallback for table correction
|
|
659
663
|
reviewAssistanceTasks?: Partial<
|
|
660
664
|
Record<
|
|
661
665
|
| 'text_ocr_hanja'
|
|
@@ -667,6 +671,17 @@ interface PDFCorrectionOptions {
|
|
|
667
671
|
LanguageModel
|
|
668
672
|
>
|
|
669
673
|
>;
|
|
674
|
+
reviewAssistanceTasksFallback?: Partial<
|
|
675
|
+
Record<
|
|
676
|
+
| 'text_ocr_hanja'
|
|
677
|
+
| 'text_integrity'
|
|
678
|
+
| 'text_role_footnote'
|
|
679
|
+
| 'tables'
|
|
680
|
+
| 'pictures_captions'
|
|
681
|
+
| 'layout_bbox_order',
|
|
682
|
+
LanguageModel
|
|
683
|
+
>
|
|
684
|
+
>;
|
|
670
685
|
};
|
|
671
686
|
concurrency?: {
|
|
672
687
|
pages?: number; // Page-level text correction and page gate concurrency
|
|
@@ -687,6 +702,9 @@ interface PDFCorrectionOptions {
|
|
|
687
702
|
};
|
|
688
703
|
autoApplyThreshold?: number; // Minimum confidence for direct mutation (default: 0.85)
|
|
689
704
|
proposalThreshold?: number; // Minimum confidence for sidecar proposal (default: 0.5)
|
|
705
|
+
forceAutoApply?: boolean; // When true, review-assistance commands auto-apply regardless of threshold (default: false)
|
|
706
|
+
reviewAssistanceEnabled?: boolean; // When false, review-assistance is skipped completely (default: true)
|
|
707
|
+
tableCorrectionEnabled?: boolean; // When false, table-correction is skipped (default: true)
|
|
690
708
|
temperature?: number; // VLM generation temperature (default: 0)
|
|
691
709
|
}
|
|
692
710
|
```
|
package/dist/index.js
CHANGED
|
@@ -64,7 +64,7 @@ var IMAGE_PDF_CONVERTER = {
|
|
|
64
64
|
QUALITY: 100
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
-
// ../shared/dist/index.
|
|
67
|
+
// ../shared/dist/index.js
|
|
68
68
|
import { spawn } from "child_process";
|
|
69
69
|
import {
|
|
70
70
|
NoObjectGeneratedError,
|
|
@@ -309,7 +309,7 @@ var LLMCaller = class {
|
|
|
309
309
|
return this.executeWithFallback(
|
|
310
310
|
config,
|
|
311
311
|
(model) => this.generateStructuredOutput(model, config.schema, {
|
|
312
|
-
|
|
312
|
+
instructions: config.systemPrompt,
|
|
313
313
|
prompt: config.userPrompt,
|
|
314
314
|
temperature: config.temperature,
|
|
315
315
|
maxRetries: config.maxRetries,
|
|
@@ -1328,8 +1328,8 @@ var PdfLanguageDetector = class {
|
|
|
1328
1328
|
text: KOREAN_DOCUMENT_DETECTION_PROMPT
|
|
1329
1329
|
},
|
|
1330
1330
|
{
|
|
1331
|
-
type: "
|
|
1332
|
-
|
|
1331
|
+
type: "file",
|
|
1332
|
+
data: imageData,
|
|
1333
1333
|
mediaType: "image/png"
|
|
1334
1334
|
}
|
|
1335
1335
|
]
|
|
@@ -3309,8 +3309,8 @@ var ReviewAssistancePageGate = class {
|
|
|
3309
3309
|
text: this.buildPrompt(context, options.outputLanguage)
|
|
3310
3310
|
},
|
|
3311
3311
|
{
|
|
3312
|
-
type: "
|
|
3313
|
-
image,
|
|
3312
|
+
type: "file",
|
|
3313
|
+
data: image,
|
|
3314
3314
|
mediaType: "image/png"
|
|
3315
3315
|
}
|
|
3316
3316
|
]
|
|
@@ -3582,8 +3582,8 @@ var PostDoclingPageProcessor = class {
|
|
|
3582
3582
|
text: fullPrompt
|
|
3583
3583
|
},
|
|
3584
3584
|
{
|
|
3585
|
-
type: "
|
|
3586
|
-
image,
|
|
3585
|
+
type: "file",
|
|
3586
|
+
data: image,
|
|
3587
3587
|
mediaType: "image/png"
|
|
3588
3588
|
}
|
|
3589
3589
|
]
|
|
@@ -9207,8 +9207,8 @@ var ReviewAssistanceRunner = class {
|
|
|
9207
9207
|
content: [
|
|
9208
9208
|
{ type: "text", text: prompt },
|
|
9209
9209
|
{
|
|
9210
|
-
type: "
|
|
9211
|
-
image,
|
|
9210
|
+
type: "file",
|
|
9211
|
+
data: image,
|
|
9212
9212
|
mediaType: "image/png"
|
|
9213
9213
|
}
|
|
9214
9214
|
]
|
|
@@ -10033,8 +10033,8 @@ var ReviewAssistanceRunner = class {
|
|
|
10033
10033
|
content: [
|
|
10034
10034
|
{ type: "text", text: prompt },
|
|
10035
10035
|
{
|
|
10036
|
-
type: "
|
|
10037
|
-
image,
|
|
10036
|
+
type: "file",
|
|
10037
|
+
data: image,
|
|
10038
10038
|
mediaType: "image/png"
|
|
10039
10039
|
}
|
|
10040
10040
|
]
|