@kolmopdf/mcp-server 1.0.0 → 1.0.1

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.
Files changed (66) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +37 -63
  3. package/dist/index.cjs.map +1 -0
  4. package/{packages/mcp-server/dist → dist}/index.js +0 -0
  5. package/dist/index.js.map +1 -0
  6. package/package.json +58 -30
  7. package/.claude-plugin/marketplace.json +0 -25
  8. package/.github/ISSUE_TEMPLATE/bug-report.yml +0 -75
  9. package/.github/workflows/ci.yml +0 -98
  10. package/.github/workflows/release.yml +0 -52
  11. package/CHANGELOG.md +0 -12
  12. package/biome.json +0 -33
  13. package/codex-skill/kolmopdf/SKILL.md +0 -108
  14. package/codex-skill/kolmopdf/references/chain-recipes.md +0 -35
  15. package/codex-skill/kolmopdf/references/parameter-glossary.md +0 -72
  16. package/doc/apidocs/Format_Conversion_API_Guide.md +0 -117
  17. package/doc/apidocs/PDF_Layout_Translation_API_Guide.md +0 -138
  18. package/doc/apidocs/PDF_Parsing_API_Guide.md +0 -364
  19. package/doc/plan/DEVELOPMENT.md +0 -896
  20. package/doc/plan/DISTRIBUTION.md +0 -377
  21. package/doc/plan/TESTING_AND_USAGE.md +0 -370
  22. package/packages/mcp-server/LICENSE +0 -21
  23. package/packages/mcp-server/README.md +0 -37
  24. package/packages/mcp-server/dist/index.cjs.map +0 -1
  25. package/packages/mcp-server/dist/index.js.map +0 -1
  26. package/packages/mcp-server/package.json +0 -54
  27. package/packages/mcp-server/src/client.ts +0 -235
  28. package/packages/mcp-server/src/config.ts +0 -62
  29. package/packages/mcp-server/src/context.ts +0 -27
  30. package/packages/mcp-server/src/errors.ts +0 -271
  31. package/packages/mcp-server/src/extract.ts +0 -102
  32. package/packages/mcp-server/src/index.ts +0 -142
  33. package/packages/mcp-server/src/pages.ts +0 -16
  34. package/packages/mcp-server/src/polling.ts +0 -84
  35. package/packages/mcp-server/src/progress.ts +0 -48
  36. package/packages/mcp-server/src/tools/check-balance.ts +0 -33
  37. package/packages/mcp-server/src/tools/convert.ts +0 -130
  38. package/packages/mcp-server/src/tools/estimate-cost.ts +0 -82
  39. package/packages/mcp-server/src/tools/get-task-status.ts +0 -24
  40. package/packages/mcp-server/src/tools/parse-pdf.ts +0 -147
  41. package/packages/mcp-server/src/tools/translate-pdf.ts +0 -110
  42. package/packages/mcp-server/tests/integration/smoke.test.ts +0 -33
  43. package/packages/mcp-server/tests/unit/config.test.ts +0 -49
  44. package/packages/mcp-server/tests/unit/convert.test.ts +0 -28
  45. package/packages/mcp-server/tests/unit/errors.test.ts +0 -112
  46. package/packages/mcp-server/tests/unit/estimate-cost.test.ts +0 -28
  47. package/packages/mcp-server/tests/unit/polling.test.ts +0 -24
  48. package/packages/mcp-server/tsconfig.json +0 -9
  49. package/packages/mcp-server/tsup.config.ts +0 -13
  50. package/packages/mcp-server/vitest.config.ts +0 -13
  51. package/plugins/kolmopdf/.claude-plugin/plugin.json +0 -16
  52. package/plugins/kolmopdf/.mcp.json +0 -11
  53. package/plugins/kolmopdf/README.md +0 -28
  54. package/plugins/kolmopdf/commands/balance.md +0 -6
  55. package/plugins/kolmopdf/commands/convert.md +0 -14
  56. package/plugins/kolmopdf/commands/parse.md +0 -14
  57. package/plugins/kolmopdf/commands/translate.md +0 -14
  58. package/plugins/kolmopdf/skills/kolmopdf/SKILL.md +0 -108
  59. package/plugins/kolmopdf/skills/kolmopdf/references/chain-recipes.md +0 -35
  60. package/plugins/kolmopdf/skills/kolmopdf/references/parameter-glossary.md +0 -72
  61. package/pnpm-workspace.yaml +0 -2
  62. package/smithery.yaml +0 -21
  63. package/tsconfig.base.json +0 -21
  64. /package/{packages/mcp-server/dist → dist}/index.cjs +0 -0
  65. /package/{packages/mcp-server/dist → dist}/index.d.cts +0 -0
  66. /package/{packages/mcp-server/dist → dist}/index.d.ts +0 -0
@@ -1,25 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/claude-code-marketplace.json",
3
- "name": "kolmopdf",
4
- "description": "Official KolmoPDF plugin marketplace for Claude Code.",
5
- "owner": {
6
- "name": "KomoAI LLC",
7
- "email": "support@kolmopdf.com"
8
- },
9
- "plugins": [
10
- {
11
- "name": "kolmopdf",
12
- "displayName": "KolmoPDF",
13
- "source": "./plugins/kolmopdf",
14
- "description": "High-fidelity PDF to Markdown parsing, layout-preserving PDF translation, and Markdown format conversion.",
15
- "version": "1.0.0",
16
- "author": { "name": "KomoAI LLC", "email": "support@kolmopdf.com" },
17
- "homepage": "https://www.kolmopdf.com",
18
- "repository": "https://github.com/kolmopdf/claude-plugin",
19
- "license": "MIT",
20
- "keywords": ["pdf", "markdown", "ocr", "translation", "latex", "research"],
21
- "category": "document-processing",
22
- "tags": ["pdf", "markdown", "translation", "academic", "arxiv"]
23
- }
24
- ]
25
- }
@@ -1,75 +0,0 @@
1
- name: Bug report
2
- description: Report a problem with the KolmoPDF plugin or MCP server.
3
- title: "[bug]: "
4
- labels: [bug]
5
- body:
6
- - type: markdown
7
- attributes:
8
- value: |
9
- Please fill in the minimal diagnostic info below (TESTING_AND_USAGE.md §9).
10
- Do NOT paste your API key. Use support@kolmopdf.com for secret-bearing reports.
11
- - type: input
12
- id: client-version
13
- attributes:
14
- label: Client version
15
- description: "Claude Code: `claude --version` / Codex: `codex --version`"
16
- validations:
17
- required: true
18
- - type: input
19
- id: plugin-version
20
- attributes:
21
- label: Plugin version
22
- description: "`/plugin list` or plugin.json version"
23
- validations:
24
- required: true
25
- - type: input
26
- id: mcp-version
27
- attributes:
28
- label: MCP server version
29
- description: "`npx @kolmopdf/mcp-server --version`"
30
- validations:
31
- required: true
32
- - type: input
33
- id: node-version
34
- attributes:
35
- label: Node version
36
- description: "`node --version`"
37
- validations:
38
- required: true
39
- - type: input
40
- id: task-id
41
- attributes:
42
- label: task_id
43
- description: From the failing tool's return value (if any).
44
- validations:
45
- required: false
46
- - type: textarea
47
- id: error
48
- attributes:
49
- label: error_code + message
50
- description: The MCP tool's returned error payload.
51
- validations:
52
- required: true
53
- - type: input
54
- id: os
55
- attributes:
56
- label: Operating system
57
- description: "`uname -a` or OS + version"
58
- validations:
59
- required: true
60
- - type: dropdown
61
- id: network
62
- attributes:
63
- label: Network location
64
- description: Affects KolmoPDF upstream link quality.
65
- options:
66
- - Mainland China
67
- - Outside mainland China
68
- validations:
69
- required: true
70
- - type: textarea
71
- id: steps
72
- attributes:
73
- label: Steps to reproduce
74
- validations:
75
- required: true
@@ -1,98 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- push:
5
- branches: [master]
6
- pull_request:
7
- schedule:
8
- - cron: "0 3 * * *" # nightly integration smoke
9
- workflow_dispatch:
10
-
11
- env:
12
- PNPM_VERSION: 9.12.0
13
- NODE_VERSION: 20
14
-
15
- jobs:
16
- lint:
17
- runs-on: ubuntu-latest
18
- steps:
19
- - uses: actions/checkout@v4
20
- - uses: pnpm/action-setup@v4
21
- with:
22
- version: ${{ env.PNPM_VERSION }}
23
- - uses: actions/setup-node@v4
24
- with:
25
- node-version: ${{ env.NODE_VERSION }}
26
- cache: pnpm
27
- - run: pnpm install --frozen-lockfile
28
- - run: pnpm biome check .
29
-
30
- typecheck:
31
- runs-on: ubuntu-latest
32
- steps:
33
- - uses: actions/checkout@v4
34
- - uses: pnpm/action-setup@v4
35
- with:
36
- version: ${{ env.PNPM_VERSION }}
37
- - uses: actions/setup-node@v4
38
- with:
39
- node-version: ${{ env.NODE_VERSION }}
40
- cache: pnpm
41
- - run: pnpm install --frozen-lockfile
42
- - run: pnpm -r typecheck
43
-
44
- test-unit:
45
- runs-on: ubuntu-latest
46
- steps:
47
- - uses: actions/checkout@v4
48
- - uses: pnpm/action-setup@v4
49
- with:
50
- version: ${{ env.PNPM_VERSION }}
51
- - uses: actions/setup-node@v4
52
- with:
53
- node-version: ${{ env.NODE_VERSION }}
54
- cache: pnpm
55
- - run: pnpm install --frozen-lockfile
56
- - run: pnpm -r test:unit
57
-
58
- test-integration:
59
- if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
60
- runs-on: ubuntu-latest
61
- steps:
62
- - uses: actions/checkout@v4
63
- - uses: pnpm/action-setup@v4
64
- with:
65
- version: ${{ env.PNPM_VERSION }}
66
- - uses: actions/setup-node@v4
67
- with:
68
- node-version: ${{ env.NODE_VERSION }}
69
- cache: pnpm
70
- - run: pnpm install --frozen-lockfile
71
- - run: pnpm --filter @kolmopdf/mcp-server test:integration
72
- env:
73
- KOLMOPDF_API_KEY: ${{ secrets.KOLMOPDF_API_KEY }}
74
-
75
- validate-plugin:
76
- runs-on: ubuntu-latest
77
- steps:
78
- - uses: actions/checkout@v4
79
- - uses: actions/setup-node@v4
80
- with:
81
- node-version: ${{ env.NODE_VERSION }}
82
- # Enable once the CLI exposes plugin validation in CI:
83
- # - run: npx @anthropic-ai/claude-code plugin validate .
84
- - name: Validate marketplace & plugin JSON
85
- run: |
86
- node -e "JSON.parse(require('fs').readFileSync('.claude-plugin/marketplace.json','utf8'))"
87
- node -e "JSON.parse(require('fs').readFileSync('plugins/kolmopdf/.claude-plugin/plugin.json','utf8'))"
88
- node -e "JSON.parse(require('fs').readFileSync('plugins/kolmopdf/.mcp.json','utf8'))"
89
-
90
- mirror-codex-skill:
91
- runs-on: ubuntu-latest
92
- steps:
93
- - uses: actions/checkout@v4
94
- - name: Ensure Codex skill mirror is byte-identical
95
- run: |
96
- diff plugins/kolmopdf/skills/kolmopdf/SKILL.md codex-skill/kolmopdf/SKILL.md
97
- diff plugins/kolmopdf/skills/kolmopdf/references/parameter-glossary.md codex-skill/kolmopdf/references/parameter-glossary.md
98
- diff plugins/kolmopdf/skills/kolmopdf/references/chain-recipes.md codex-skill/kolmopdf/references/chain-recipes.md
@@ -1,52 +0,0 @@
1
- name: Release
2
-
3
- on:
4
- push:
5
- tags:
6
- - "v*.*.*"
7
-
8
- jobs:
9
- release:
10
- runs-on: ubuntu-latest
11
- permissions:
12
- contents: write
13
- id-token: write
14
- steps:
15
- - uses: actions/checkout@v4
16
- with:
17
- fetch-depth: 0
18
-
19
- - uses: pnpm/action-setup@v4
20
- with:
21
- version: 9.12.0
22
-
23
- - uses: actions/setup-node@v4
24
- with:
25
- node-version: 20
26
- cache: pnpm
27
- registry-url: "https://registry.npmjs.org"
28
-
29
- - run: pnpm install --frozen-lockfile
30
-
31
- - name: Sanity check — versions match the tag
32
- run: |
33
- TAG="${GITHUB_REF_NAME#v}"
34
- MCP=$(node -p "require('./packages/mcp-server/package.json').version")
35
- PLUGIN=$(node -p "require('./plugins/kolmopdf/.claude-plugin/plugin.json').version")
36
- MARKET=$(node -p "require('./.claude-plugin/marketplace.json').plugins[0].version")
37
- echo "tag=$TAG mcp=$MCP plugin=$PLUGIN marketplace=$MARKET"
38
- test "$TAG" = "$MCP" && test "$TAG" = "$PLUGIN" && test "$TAG" = "$MARKET" \
39
- || (echo "::error::version mismatch between tag and manifests" && exit 1)
40
-
41
- - run: pnpm -r build
42
-
43
- - name: Publish @kolmopdf/mcp-server
44
- working-directory: packages/mcp-server
45
- run: pnpm publish --access public --no-git-checks
46
- env:
47
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
48
-
49
- - name: Create GitHub Release
50
- uses: softprops/action-gh-release@v2
51
- with:
52
- generate_release_notes: true
package/CHANGELOG.md DELETED
@@ -1,12 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to this project are documented here. The format is based on
4
- [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project adheres
5
- to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
-
7
- ## [Unreleased]
8
-
9
- ### Added
10
-
11
- - Initial monorepo scaffold: `@kolmopdf/mcp-server` package, Claude Code plugin,
12
- KolmoPDF skill, marketplace entry, Codex CLI skill mirror, CI/CD workflows.
package/biome.json DELETED
@@ -1,33 +0,0 @@
1
- {
2
- "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3
- "vcs": {
4
- "enabled": true,
5
- "clientKind": "git",
6
- "useIgnoreFile": true
7
- },
8
- "files": {
9
- "ignore": ["dist", "node_modules", "coverage", "kolmopdf-output"]
10
- },
11
- "formatter": {
12
- "enabled": true,
13
- "indentStyle": "space",
14
- "indentWidth": 2,
15
- "lineWidth": 100
16
- },
17
- "organizeImports": {
18
- "enabled": true
19
- },
20
- "linter": {
21
- "enabled": true,
22
- "rules": {
23
- "recommended": true
24
- }
25
- },
26
- "javascript": {
27
- "formatter": {
28
- "quoteStyle": "double",
29
- "trailingCommas": "all",
30
- "semicolons": "always"
31
- }
32
- }
33
- }
@@ -1,108 +0,0 @@
1
- ---
2
- name: kolmopdf
3
- description: Use this skill ONLY when the user gives an explicit operational instruction to process a PDF or Markdown file. Specifically: (1) explicitly asks to parse/convert a PDF into Markdown, (2) explicitly asks for layout-preserving PDF translation to produce a new translated PDF, (3) explicitly asks to export/convert Markdown to DOCX/HTML/PDF/LaTeX, or (4) a combination of the above (e.g. "parse this PDF to Markdown, then translate it, then export to DOCX"). Do NOT trigger for general PDF reading, summarization, or Q&A unless the user explicitly requests Markdown extraction first. Triggers: "parse PDF to markdown", "convert PDF to markdown", "translate this PDF preserving layout", "export markdown to docx/html/pdf/latex", "PDF to markdown with tables as images", "parse and translate this PDF".
4
- allowed-tools: mcp__kolmopdf__kolmopdf_parse_pdf, mcp__kolmopdf__kolmopdf_translate_pdf, mcp__kolmopdf__kolmopdf_convert_markdown, mcp__kolmopdf__kolmopdf_estimate_cost, mcp__kolmopdf__kolmopdf_check_balance, Read, Write
5
- ---
6
-
7
- # KolmoPDF Skill
8
-
9
- You have access to KolmoPDF tools (prefix `kolmopdf_*`) for high-fidelity PDF parsing and translation. These tools call a paid cloud service. Always follow the rules below.
10
-
11
- ## When to use
12
-
13
- This skill triggers ONLY on explicit user instructions to perform a file operation:
14
-
15
- - User explicitly asks to parse/convert a PDF into Markdown → `kolmopdf_parse_pdf`.
16
- - User explicitly asks for layout-preserving PDF translation → `kolmopdf_translate_pdf`.
17
- - User explicitly asks to export Markdown to DOCX/HTML/PDF/LaTeX → `kolmopdf_convert_markdown`.
18
- - User requests a combination (e.g. "parse this PDF, translate it, then export to DOCX") → chain the tools in sequence.
19
-
20
- Do NOT trigger when:
21
- - User just wants to read or summarize a PDF without requesting Markdown output.
22
- - User asks general questions about a PDF's content (use built-in Read instead).
23
- - User mentions PDF in passing without an explicit processing instruction.
24
-
25
- ## Natural language parameter mapping
26
-
27
- Users may describe parameters in natural language. Map their descriptions to tool parameters:
28
-
29
- | User says | Parameter |
30
- | --- | --- |
31
- | "tables as images" / "keep table layout" | `table_mode="image"` |
32
- | "use dollar signs for formulas" / "KaTeX format" | `formula_format="dollar"` |
33
- | "use bracket notation" / "LaTeX-style delimiters" | `formula_format="bracket"` |
34
- | "translate to Chinese/Japanese/..." | `enable_translation=true`, `target_language="zh"/"ja"/...` |
35
- | "bilingual output" / "show both languages" | `output_options=["bilingual"]` |
36
- | "images as URLs" / "don't download images" | `images_as_url=true` |
37
- | "merge tables across pages" / "cross-page tables" | `enable_cross_page_merge=true` |
38
- | "side by side translation" | `layout_modes=["side_by_side"]` |
39
- | "translate images too" | `enable_image_translation=true` |
40
- | "translate tables too" | `enable_table_translation=true` |
41
- | "export to Word/DOCX/HTML/PDF/LaTeX" | `target_format` accordingly |
42
-
43
- When the user's natural language is ambiguous, use sensible defaults from `references/parameter-glossary.md`. When the user specifies multiple preferences in one request, combine all applicable parameters in a single tool call.
44
-
45
- ## Cost-awareness protocol
46
-
47
- Before running any operation that consumes credits:
48
-
49
- 1. Call `kolmopdf_estimate_cost` with the file path and intended operation.
50
- 2. If `sufficient` is false: stop and report `shortfall` and the top-up URL `https://www.kolmopdf.com/subscription` to the user. Do not proceed.
51
- 3. If `estimated_credits > 50`: tell the user the estimated cost and ask for confirmation before proceeding.
52
- 4. Otherwise: proceed.
53
-
54
- ## API key requirement
55
-
56
- Tools require `KOLMOPDF_API_KEY` in the MCP server environment. If a tool returns `invalid_api_key`:
57
-
58
- - Direct the user to https://www.kolmopdf.com/api-keys to create a key (requires Plus or Pro plan).
59
- - Tell the user to set `KOLMOPDF_API_KEY` in their environment and restart Claude Code.
60
- - Do not proceed with retries until the user confirms.
61
-
62
- ## Chained workflows
63
-
64
- ### PDF → DOCX/HTML/PDF/LaTeX (full pipeline)
65
-
66
- 1. `kolmopdf_estimate_cost(file, "parse")` → check balance.
67
- 2. `kolmopdf_parse_pdf(file)` → get `markdown_path`.
68
- 3. `kolmopdf_convert_markdown(markdown_path, target_format)` → final file.
69
-
70
- If the PDF contains many images, pass the original directory (not just the markdown file) by zipping `output_root` first using your own tools, then pass the zip to convert. See `references/chain-recipes.md`.
71
-
72
- ### Read + ask Q&A about a paper
73
-
74
- 1. `kolmopdf_parse_pdf(file)` → get `markdown_path` and `preview`.
75
- 2. Use `Read` on `markdown_path` to load the full content.
76
- 3. Answer the user's question grounded in the markdown.
77
-
78
- ### Translate then convert to bilingual deliverable
79
-
80
- Option A (PDF deliverable):
81
- - `kolmopdf_translate_pdf(file, layout_modes=["side_by_side"])` → single PDF with side-by-side layout.
82
-
83
- Option B (editable Markdown deliverable):
84
- - `kolmopdf_parse_pdf(file, enable_translation=true, output_options=["bilingual"])` → bilingual markdown.
85
-
86
- ## Parameter guidance
87
-
88
- See `references/parameter-glossary.md` for the full parameter table and defaults. Highlights:
89
-
90
- - `formula_format=dollar` is the default and works with KaTeX/MathJax. Use `bracket` for LaTeX-strict downstream renderers.
91
- - `enable_cross_page_merge=true` is recommended when the source PDF has tables spanning page breaks.
92
- - `images_as_url=true` returns a single markdown file with 30-day URL references; use this for ephemeral pipelines. Default `false` returns a self-contained ZIP.
93
-
94
- ## Output handling
95
-
96
- After successful tool calls, treat `output.markdown_path` / `output.translated_pdf_path` / `output.output_path` as the canonical local file paths and reference them in your reply to the user. Show the user the absolute path; do not re-print the entire file unless asked.
97
-
98
- ## Failure modes
99
-
100
- | error_code | Action |
101
- | --- | --- |
102
- | `invalid_api_key` | Stop; follow API key requirement section above. |
103
- | `insufficient_points` | Stop; report shortfall and top-up URL. |
104
- | `parse_page_limit_exceeded`, `parse_file_too_large` | Stop; suggest splitting the PDF locally. |
105
- | `parse_file_not_pdf`, `parse_file_invalid` | Stop; ask the user to re-export the PDF. |
106
- | `parse_error`, `parse_timeout` | Server auto-refunds points. Suggest retry with smaller page range. |
107
- | `client_polling_timeout` | Tell the user the task is still running server-side and suggest using `kolmopdf_get_task_status` with the task_id later. |
108
- | Network/5xx | Tools auto-retry up to 3 times. If still failing, suggest checking https://www.kolmopdf.com/contact. |
@@ -1,35 +0,0 @@
1
- # KolmoPDF Chain Recipes
2
-
3
- Expanded, step-by-step playbooks for the chained workflows summarized in `SKILL.md`.
4
-
5
- ## Recipe 1 — PDF → DOCX/HTML/PDF/LaTeX (full pipeline)
6
-
7
- 1. `kolmopdf_estimate_cost({ file_path, operation: "parse" })`.
8
- - If `sufficient=false` → stop; report `shortfall` + https://www.kolmopdf.com/subscription.
9
- - If `estimated_credits > 50` → ask the user to confirm.
10
- 2. `kolmopdf_parse_pdf({ file_path })` → capture `output.markdown_path` and `output.output_root`.
11
- 3. Decide the convert input:
12
- - **Markdown has no local images** (or `images_as_url=true` was used): pass `output.markdown_path` directly.
13
- - **Markdown references local images**: zip `output.output_root` with your own tools (`Write`/shell), then pass the `.zip` path so figures survive conversion.
14
- 4. `kolmopdf_convert_markdown({ file_path: <md-or-zip>, target_format })`.
15
- 5. Report `output.output_path` to the user (absolute path).
16
-
17
- Total cost ≈ `pages × 2 + 1`.
18
-
19
- ## Recipe 2 — Read + Q&A about a paper
20
-
21
- 1. `kolmopdf_parse_pdf({ file_path })` → `output.markdown_path`, `preview`.
22
- 2. `Read` the `markdown_path` to load full content into context.
23
- 3. Answer the user's question grounded strictly in the parsed markdown. Cite section headings where useful.
24
-
25
- ## Recipe 3 — Translate then deliver bilingual
26
-
27
- **Option A — PDF deliverable (layout preserved):**
28
- 1. `kolmopdf_estimate_cost({ file_path, operation: "translate" })`.
29
- 2. `kolmopdf_translate_pdf({ file_path, source_language, target_language, layout_modes: ["side_by_side"] })`.
30
- 3. Report `output.translated_pdf_path`.
31
-
32
- **Option B — editable Markdown deliverable:**
33
- 1. `kolmopdf_estimate_cost({ file_path, operation: "parse_translate" })`.
34
- 2. `kolmopdf_parse_pdf({ file_path, enable_translation: true, target_language, output_options: ["bilingual"] })`.
35
- 3. Report `output.markdown_path`. Optionally chain Recipe 1 step 4 to produce a bilingual DOCX.
@@ -1,72 +0,0 @@
1
- # KolmoPDF Parameter Glossary
2
-
3
- Full parameter reference for the KolmoPDF tools. This file is not auto-loaded; the skill reads it on demand.
4
-
5
- ## `kolmopdf_parse_pdf`
6
-
7
- | Parameter | Type | Legal values | Default | Billing impact |
8
- | --- | --- | --- | --- | --- |
9
- | `file_path` | string | local path to a `.pdf` | — | — |
10
- | `table_mode` | enum | `markdown`, `image` | `markdown` | none |
11
- | `formula_format` | enum | `dollar`, `bracket` | `dollar` | none |
12
- | `enable_translation` | boolean | `true`, `false` | `false` | `true` → 3 pts/page instead of 2 |
13
- | `target_language` | enum | `zh`, `en`, `ja`, `ko`, `fr`, `de`, `es`, `ru` | `zh` | only when `enable_translation=true` |
14
- | `output_options` | string[] | `original`, `translated`, `bilingual` | `original` | none |
15
- | `images_as_url` | boolean | `true`, `false` | `false` | none (`true` → single `.md` w/ 30-day URLs; `false` → ZIP) |
16
- | `skip_rotation_detection` | boolean | `true`, `false` | `false` | none |
17
- | `enable_cross_page_merge` | boolean | `true`, `false` | `false` | none (merges tables across ≤ 3 pages) |
18
- | `output_subdir` | string | any dir name | `<task_id>` | none |
19
-
20
- Cost: parse only = `pages × 2`; parse + translate = `pages × 3`.
21
-
22
- ## `kolmopdf_translate_pdf`
23
-
24
- | Parameter | Type | Legal values | Default |
25
- | --- | --- | --- | --- |
26
- | `file_path` | string | local path to a `.pdf` | — |
27
- | `source_language` | string | language code | `en` |
28
- | `target_language` | string | language code | `zh` |
29
- | `layout_modes` | string[] | `translated_only`, `side_by_side` | `["translated_only"]` |
30
- | `enable_image_translation` | boolean | `true`, `false` | `false` |
31
- | `enable_table_translation` | boolean | `true`, `false` | `false` |
32
- | `output_subdir` | string | any dir name | `<task_id>` |
33
-
34
- Cost: `pages × 2`.
35
-
36
- ## `kolmopdf_convert_markdown`
37
-
38
- | Parameter | Type | Legal values | Default |
39
- | --- | --- | --- | --- |
40
- | `file_path` | string | `.md`, `.markdown`, or `.zip` | — |
41
- | `target_format` | enum | `word`, `docx`, `html`, `pdf`, `latex`, `tex` | `word` |
42
- | `output_subdir` | string | any dir name | `<task_id>` |
43
-
44
- Extension mapping: `word|docx → .docx`, `html → .html`, `pdf → .pdf`, `latex|tex → .tex`.
45
-
46
- Cost: 1 credit/task.
47
-
48
- ## Language codes
49
-
50
- | Code | Language |
51
- | --- | --- |
52
- | `zh` | Chinese |
53
- | `en` | English |
54
- | `ja` | Japanese |
55
- | `ko` | Korean |
56
- | `fr` | French |
57
- | `de` | German |
58
- | `es` | Spanish |
59
- | `ru` | Russian |
60
-
61
- ## ZIP output structure (`images_as_url=false`)
62
-
63
- ```
64
- <KOLMOPDF_OUTPUT_DIR>/<task_id>/
65
- ├── <document>.md # canonical markdown_path (first *.md found)
66
- ├── images/ # extracted figures → images_dir
67
- │ ├── img-0001.png
68
- │ └── ...
69
- └── (other assets, flattened)
70
- ```
71
-
72
- When `images_as_url=true`, the result is a single `result.md` with public image URLs (cached 30 days) and `images_dir = null`.
@@ -1,117 +0,0 @@
1
- # Format Conversion API Guide
2
-
3
- ## Basic Information
4
-
5
- ### Base URL
6
-
7
- Use the following base URL for all API requests:
8
-
9
- `https://www.kolmopdf.com`
10
-
11
- ### General Notes
12
-
13
- 1. **Async workflow:** Upload the source file, poll task status, then download the converted result.
14
- 2. **Data retention:** Download results as soon as possible. Result files are retained for 7 days.
15
- 3. **File limits:** Maximum file size is **300 MB**.
16
- 4. **Input formats:** Markdown (`.md`, `.markdown`) or ZIP archive.
17
- 5. **Output formats:** Word (`docx`), HTML, PDF, or LaTeX.
18
- 6. **Points:** Format conversion costs **1 point/task**.
19
- 7. **Concurrency:** Each API Key can process up to **3 tasks concurrently**. Extra tasks are queued automatically.
20
-
21
- ---
22
-
23
- ## Authentication
24
-
25
- Send your API Key in one of these ways:
26
-
27
- | Method | Example |
28
- | :--- | :--- |
29
- | URL parameter | `?api_key=sk-xxx` |
30
- | Header | `X-API-Key: sk-xxx` |
31
- | Authorization | `Authorization: Bearer sk-xxx` |
32
-
33
- ---
34
-
35
- ## Async Processing Flow
36
-
37
- **upload and convert** -> **poll status** -> **download result**
38
-
39
- ### 1. Upload and Convert
40
-
41
- **POST /api/pdf-to-markdown-proxy/convert**
42
-
43
- #### Request Parameters
44
-
45
- | Name | Location | Type | Required | Description |
46
- | :--- | :--- | :--- | :--- | :--- |
47
- | `file` | FormData | `file` | Yes | Markdown file or ZIP archive. |
48
- | `format` / `target_format` / `targetFormat` | FormData | `string` | No | Target format. Supported: `word`, `docx`, `html`, `pdf`, `latex`, `tex`. Default: `word`. |
49
-
50
- #### Request Example
51
-
52
- ```bash
53
- curl -X POST 'https://www.kolmopdf.com/api/pdf-to-markdown-proxy/convert?api_key=sk-xxx' \
54
- -F "file=@document.md" \
55
- -F "targetFormat=pdf"
56
- ```
57
-
58
- #### Success Example: Processing Started
59
-
60
- ```json
61
- {
62
- "success": true,
63
- "task_id": "12345",
64
- "status": "processing",
65
- "message": "Format conversion task started",
66
- "points_deducted": 1,
67
- "remaining_points": 99
68
- }
69
- ```
70
-
71
- #### Success Example: Waiting in Queue
72
-
73
- ```json
74
- {
75
- "success": true,
76
- "task_id": "12345",
77
- "status": "waiting",
78
- "message": "Task queued and waiting for processing",
79
- "points_deducted": 1,
80
- "remaining_points": 99,
81
- "queue_info": {
82
- "position": 1,
83
- "ahead_tasks": 3
84
- }
85
- }
86
- ```
87
-
88
- ---
89
-
90
- ### 2. Query Task Status
91
-
92
- **GET /api/pdf-to-markdown-proxy/status/{task_id}**
93
-
94
- ```bash
95
- curl "https://www.kolmopdf.com/api/pdf-to-markdown-proxy/status/12345?api_key=sk-xxx"
96
- ```
97
-
98
- ---
99
-
100
- ### 3. Download Result
101
-
102
- **GET /api/pdf-to-markdown-proxy/download/{task_id}**
103
-
104
- ```bash
105
- curl -L "https://www.kolmopdf.com/api/pdf-to-markdown-proxy/download/12345?api_key=sk-xxx" \
106
- -o result.pdf
107
- ```
108
-
109
- ---
110
-
111
- ### 4. Query Balance
112
-
113
- **GET /api/pdf-to-markdown-proxy/balance**
114
-
115
- ```bash
116
- curl "https://www.kolmopdf.com/api/pdf-to-markdown-proxy/balance?api_key=sk-xxx"
117
- ```