@echofiles/echo-pdf 0.10.0 → 0.11.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.
package/README.md
CHANGED
|
@@ -58,17 +58,21 @@ echo-pdf page ./sample.pdf --page 1
|
|
|
58
58
|
echo-pdf render ./sample.pdf --page 1 --scale 2
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
To run
|
|
61
|
+
To run provider-required primitives, configure a provider key and model once:
|
|
62
62
|
|
|
63
63
|
```bash
|
|
64
64
|
echo-pdf provider set --provider openai --api-key "$OPENAI_API_KEY"
|
|
65
65
|
echo-pdf model set --provider openai --model gpt-4.1-mini
|
|
66
|
+
|
|
66
67
|
echo-pdf semantic ./sample.pdf
|
|
68
|
+
echo-pdf tables ./sample.pdf --page 1
|
|
69
|
+
echo-pdf formulas ./sample.pdf --page 1
|
|
70
|
+
echo-pdf understanding ./sample.pdf --page 1
|
|
67
71
|
```
|
|
68
72
|
|
|
69
|
-
|
|
73
|
+
Provider-required primitives (`semantic`, `tables`, `formulas`, `understanding`) use the CLI profile's provider/model/api-key settings. If the selected provider or model is missing, they fail early with a clear setup error.
|
|
70
74
|
|
|
71
|
-
|
|
75
|
+
The CLI ships with a built-in `ollama` provider alias pointing at `http://127.0.0.1:11434/v1`. To use a local Ollama server:
|
|
72
76
|
|
|
73
77
|
```bash
|
|
74
78
|
echo-pdf provider set --provider ollama --api-key ""
|
|
@@ -76,7 +80,7 @@ echo-pdf model set --provider ollama --model llava:13b
|
|
|
76
80
|
echo-pdf semantic ./sample.pdf --provider ollama
|
|
77
81
|
```
|
|
78
82
|
|
|
79
|
-
|
|
83
|
+
The built-in provider aliases are `openai`, `vercel_gateway`, `openrouter`, and `ollama`. Other local OpenAI-compatible servers (llama.cpp, vLLM, LM Studio, LocalAI) can be configured by overriding the config via the `ECHO_PDF_CONFIG_JSON` environment variable or by editing the bundled `echo-pdf.config.json` in a source checkout. The selected model must support vision input.
|
|
80
84
|
|
|
81
85
|
What these commands map to:
|
|
82
86
|
|
|
@@ -146,8 +150,9 @@ const understanding = await get_page_understanding({ pdfPath: "./sample.pdf", pa
|
|
|
146
150
|
Notes:
|
|
147
151
|
|
|
148
152
|
- `get_document_structure()` returns the stable page index: `document -> pages[]`
|
|
149
|
-
- `get_semantic_document_structure()` returns a
|
|
153
|
+
- `get_semantic_document_structure()` returns a heading/section tree plus optional cross-page merged `tables[]`, `formulas[]`, and `figures[]`; it does not replace `pages[]`
|
|
150
154
|
- `get_page_render()` materializes a reusable PNG plus render metadata and is the mainline visual input path
|
|
155
|
+
- `get_page_understanding()` extracts tables, formulas, and figures from a single page in one LLM call
|
|
151
156
|
|
|
152
157
|
Migration note:
|
|
153
158
|
|
package/dist/local/semantic.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference path="../node/compat.d.ts" />
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
import { resolveModelForProvider, resolveProviderAlias } from "../
|
|
4
|
+
import { resolveModelForProvider, resolveProviderAlias } from "../provider-defaults.js";
|
|
5
5
|
import { toDataUrl } from "../file-utils.js";
|
|
6
6
|
import { generateText, visionRecognize } from "../provider-client.js";
|
|
7
7
|
import { ensureRenderArtifact, indexDocumentInternal } from "./document.js";
|
package/dist/local/shared.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { mkdir, readFile, stat, writeFile } from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
import { resolveModelForProvider, resolveProviderAlias } from "../
|
|
4
|
+
import { resolveModelForProvider, resolveProviderAlias } from "../provider-defaults.js";
|
|
5
5
|
import { loadEchoPdfConfig } from "../pdf-config.js";
|
|
6
6
|
export const defaultWorkspaceDir = () => path.resolve(process.cwd(), ".echo-pdf-workspace");
|
|
7
7
|
export const resolveWorkspaceDir = (workspaceDir) => path.resolve(process.cwd(), workspaceDir?.trim() || defaultWorkspaceDir());
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@echofiles/echo-pdf",
|
|
3
3
|
"description": "Local-first PDF document component core with CLI, workspace artifacts, and reusable page primitives.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.11.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://pdf.echofile.ai/",
|
|
7
7
|
"repository": {
|
|
File without changes
|
|
File without changes
|