pi-ocr 1.0.0

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.
@@ -0,0 +1,27 @@
1
+ /**
2
+ * pi-minimodel-ocr — shared types for OCR backends
3
+ */
4
+
5
+ export const TASKS = ["text", "formula", "table", "figure", "auto"] as const;
6
+ export type Task = (typeof TASKS)[number];
7
+
8
+ /** All supported OCR backends */
9
+ export const BACKENDS = ["ollama", "mineru", "pix2text"] as const;
10
+ export type Backend = (typeof BACKENDS)[number];
11
+
12
+ export interface OcrConfig {
13
+ backend: Backend;
14
+ ollamaHost: string;
15
+ model: string;
16
+ /** MinerU: auto-split PDFs with >20 pages into free-tier chunks */
17
+ mineruSplitPdf: boolean;
18
+ }
19
+
20
+ export interface OcrResult {
21
+ text: string;
22
+ details: Record<string, unknown>;
23
+ }
24
+
25
+ export interface OcrProgressCallback {
26
+ (msg: string): void;
27
+ }
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "pi-ocr",
3
+ "version": "1.0.0",
4
+ "description": "Pi extension: Zero-setup multi-backend OCR — MinerU (free cloud), Ollama (local GPU, LaTeX formulas), Pix2Text (local Python). Extract text, formulas, and tables from images and PDFs. Default: zero config, works out of the box.",
5
+ "keywords": [
6
+ "pi-package",
7
+ "pi-extension",
8
+ "pi",
9
+ "pi-ocr",
10
+ "coding-agent",
11
+ "ocr",
12
+ "pdf",
13
+ "pdf-to-markdown",
14
+ "latex",
15
+ "math-ocr",
16
+ "formula-recognition",
17
+ "image-to-text",
18
+ "document-ocr",
19
+ "glm-ocr",
20
+ "ollama",
21
+ "mineru",
22
+ "pix2text",
23
+ "deepseek",
24
+ "multi-backend",
25
+ "free-ocr"
26
+ ],
27
+ "license": "MIT",
28
+ "author": "",
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+https://github.com/astronautJack/pi-ocr.git"
32
+ },
33
+ "files": [
34
+ "extensions/",
35
+ "README.md"
36
+ ],
37
+ "pi": {
38
+ "extensions": [
39
+ "./extensions"
40
+ ]
41
+ },
42
+ "peerDependencies": {
43
+ "@earendil-works/pi-ai": "*",
44
+ "@earendil-works/pi-coding-agent": "*",
45
+ "typebox": "*"
46
+ },
47
+ "devDependencies": {
48
+ "@earendil-works/pi-ai": "*",
49
+ "@earendil-works/pi-coding-agent": "*",
50
+ "@types/node": "^25.9.1",
51
+ "typebox": "*",
52
+ "typescript": "^6.0.3"
53
+ }
54
+ }