@fenfill/mcp 0.2.3 → 0.2.4
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 +58 -47
- package/THIRD_PARTY_NOTICES +27 -1
- package/dist/index.js +1875 -182
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,8 +12,9 @@ are stamped into the PDF locally and are never sent to fenfill or anywhere else.
|
|
|
12
12
|
fields (text boxes, checkboxes, dates, character boxes, tables, signatures) and returns them
|
|
13
13
|
with ids, types and labels. The result is cached on your machine, so asking again is free.
|
|
14
14
|
2. **`fill_form`** takes the agent's answers (`field id → value`), checks them against the
|
|
15
|
-
fields, and stamps them into a new, flattened PDF. This step runs
|
|
16
|
-
|
|
15
|
+
fields, and stamps them into a new, flattened PDF. This step runs on your machine and never
|
|
16
|
+
sends your answers anywhere; the only network use is a one-time download of the public
|
|
17
|
+
Japanese font, the first time a value needs it.
|
|
17
18
|
3. Saved fenfill templates work the same way: `list_templates` → `get_template` → `fill_template`.
|
|
18
19
|
4. **`preview_page`** shows a page as an image with every field box outlined and tagged, rendered
|
|
19
20
|
on your machine. If a box is misplaced, missing or mislabeled, **`edit_template`** fixes it in a
|
|
@@ -24,15 +25,16 @@ are stamped into the PDF locally and are never sent to fenfill or anywhere else.
|
|
|
24
25
|
|
|
25
26
|
### What is sent where
|
|
26
27
|
|
|
27
|
-
| Data | Sent to fenfill?
|
|
28
|
-
| -------------------------------------------------- |
|
|
29
|
-
| The blank PDF you analyze | Yes, once (then cached locally)
|
|
30
|
-
| Your API key | Yes, as `Authorization: Bearer`
|
|
31
|
-
| The agent's answers, signatures and the filled PDF | **No, never**
|
|
32
|
-
| Saved templates (blank PDF, fields, your logo) | Downloaded from fenfill to fill locally
|
|
33
|
-
| Page previews (`preview_page`) | **No**: rendered on your machine
|
|
34
|
-
| Layout corrections (`edit_template`) | Only on `save_template`, and then only the layout and the form's own wording
|
|
35
|
-
| Re-analysis (`reanalyze_template`) | Only the template id, pages, kind and version: nothing is uploaded
|
|
28
|
+
| Data | Sent to fenfill? |
|
|
29
|
+
| -------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
30
|
+
| The blank PDF you analyze | Yes, once (then cached locally) |
|
|
31
|
+
| Your API key | Yes, as `Authorization: Bearer` |
|
|
32
|
+
| The agent's answers, signatures and the filled PDF | **No, never** |
|
|
33
|
+
| Saved templates (blank PDF, fields, your logo) | Downloaded from fenfill to fill locally |
|
|
34
|
+
| Page previews (`preview_page`) | **No**: rendered on your machine |
|
|
35
|
+
| Layout corrections (`edit_template`) | Only on `save_template`, and then only the layout and the form's own wording |
|
|
36
|
+
| Re-analysis (`reanalyze_template`) | Only the template id, pages, kind and version: nothing is uploaded |
|
|
37
|
+
| Japanese font download | `GET https://fenfill.com/fonts/NotoSansJP-Regular.ttf`, once, only when a value contains Japanese. Sends no auth and no form data, just a plain GET with a `fenfill-mcp/<version>` User-Agent. Redirects to another host are refused. Checked against a pinned sha256, then cached. |
|
|
36
38
|
|
|
37
39
|
`analyze_form` refuses PDFs whose form fields already hold answers, and PDFs this server wrote
|
|
38
40
|
itself, so a filled-in form isn't uploaded by mistake.
|
|
@@ -91,20 +93,20 @@ On native Windows, if the client can't find `npx`, use `"command": "cmd"` with
|
|
|
91
93
|
|
|
92
94
|
## Tools
|
|
93
95
|
|
|
94
|
-
| Tool | What it does
|
|
95
|
-
| ----------------------- |
|
|
96
|
-
| `analyze_form` | Uploads a **blank** PDF once and returns its fields. Cached locally afterwards.
|
|
97
|
-
| `fill_form` | Fills an analyzed PDF locally
|
|
98
|
-
| `fill_template` | Fills a saved fenfill template locally.
|
|
99
|
-
| `list_templates` | Lists the workspace's saved templates, newest first.
|
|
100
|
-
| `get_template` | Shows a template's fields (use `pages` to narrow a large form).
|
|
101
|
-
| `create_recipient_link` | Creates a personal fill link for one recipient of a restricted template.
|
|
102
|
-
| `get_recipient_status` | Shows those links' status: `pending`, `opened` or `completed`.
|
|
103
|
-
| `get_account` | Shows the plan, page scans left and limits.
|
|
104
|
-
| `preview_page` | Renders one page (PNG) with every field box outlined and tagged, locally.
|
|
105
|
-
| `edit_template` | Moves, resizes, relabels, retypes, adds, deletes or regroups fields, locally.
|
|
106
|
-
| `save_template` | Saves `edit_template`'s working copy to a saved template.
|
|
107
|
-
| `reanalyze_template` | Re-analyzes some pages of a saved template, with no upload, and shows the diff.
|
|
96
|
+
| Tool | What it does |
|
|
97
|
+
| ----------------------- | ----------------------------------------------------------------------------------------------------- |
|
|
98
|
+
| `analyze_form` | Uploads a **blank** PDF once and returns its fields. Cached locally afterwards. |
|
|
99
|
+
| `fill_form` | Fills an analyzed PDF locally (your answers never leave your machine) and writes a new flattened PDF. |
|
|
100
|
+
| `fill_template` | Fills a saved fenfill template locally. |
|
|
101
|
+
| `list_templates` | Lists the workspace's saved templates, newest first. |
|
|
102
|
+
| `get_template` | Shows a template's fields (use `pages` to narrow a large form). |
|
|
103
|
+
| `create_recipient_link` | Creates a personal fill link for one recipient of a restricted template. |
|
|
104
|
+
| `get_recipient_status` | Shows those links' status: `pending`, `opened` or `completed`. |
|
|
105
|
+
| `get_account` | Shows the plan, page scans left and limits. |
|
|
106
|
+
| `preview_page` | Renders one page (PNG) with every field box outlined and tagged, locally. |
|
|
107
|
+
| `edit_template` | Moves, resizes, relabels, retypes, adds, deletes or regroups fields, locally. |
|
|
108
|
+
| `save_template` | Saves `edit_template`'s working copy to a saved template. |
|
|
109
|
+
| `reanalyze_template` | Re-analyzes some pages of a saved template, with no upload, and shows the diff. |
|
|
108
110
|
|
|
109
111
|
`analyze_form` options: `pages` (e.g. `"1-3,5"`; long PDFs can be analyzed in chunks, and
|
|
110
112
|
`fill_form` merges them), `save_as_template` (also keep it as a fenfill template), `access`
|
|
@@ -390,6 +392,14 @@ fenfill web app for that workspace (for example, your logo if you have set one u
|
|
|
390
392
|
working copy holds the layout plus the wording the agent wrote with `edit_template`; the echo
|
|
391
393
|
guard refuses wording that repeats an answer seen in the same session before it is written,
|
|
392
394
|
unless the agent, told which property matched, confirms that it is the form's own wording.
|
|
395
|
+
- **`fonts/`** in the cache holds the Japanese font (Noto Sans JP, about 5.8 MB), downloaded the
|
|
396
|
+
first time a value needs it and never aged out. To work offline, copy
|
|
397
|
+
`NotoSansJP-Regular.ttf` (from `https://fenfill.com/fonts/NotoSansJP-Regular.ttf`) into
|
|
398
|
+
`<cache>/fonts/` (`FENFILL_CACHE_DIR` if you set it); it is used if its sha256 matches the
|
|
399
|
+
pinned value.
|
|
400
|
+
- **Supported scripts:** Latin, Cyrillic and Greek; Hebrew and Arabic (printed right to left,
|
|
401
|
+
Arabic joined); Japanese (kana, kanji and other CJK ideographs, CJK punctuation and full-width
|
|
402
|
+
forms, plus symbols such as ⑪ and 〈〉) through the on-demand font above.
|
|
393
403
|
- **Cache cleanup:** at startup and at most once a day it deletes blank PDFs and the logo after
|
|
394
404
|
1 hour, analyses and working copies unused for 90 days, stale job records after 48 hours, and
|
|
395
405
|
output hashes after a year.
|
|
@@ -402,28 +412,29 @@ fenfill web app for that workspace (for example, your logo if you have set one u
|
|
|
402
412
|
|
|
403
413
|
## Troubleshooting
|
|
404
414
|
|
|
405
|
-
| Error | What to do
|
|
406
|
-
| ------------------------------------- |
|
|
407
|
-
| `missing_api_key` / `invalid_api_key` | Set `FENFILL_API_KEY` in the client's config and restart the client.
|
|
408
|
-
| `plan_required` | The workspace needs a paid plan (Pro and up).
|
|
409
|
-
| `insufficient_scans` | Not enough page scans left; analyze fewer `pages` or check `get_account`.
|
|
410
|
-
| `prefilled_form` / `filled_output` | Only blank forms can be analyzed; use the original, empty PDF. If it is the blank form (some ship with default text in their fields), use the fenfill web app.
|
|
411
|
-
| `pdf_password_required` | Remove the open password first; owner-password PDFs work as they are.
|
|
412
|
-
| `pdf_fill_forbidden` | The PDF's author forbids form filling; fenfill won't fill it. Use a copy that allows filling.
|
|
413
|
-
| `
|
|
414
|
-
| `
|
|
415
|
-
| `
|
|
416
|
-
| `
|
|
417
|
-
| `
|
|
418
|
-
| `
|
|
419
|
-
| `
|
|
420
|
-
| `
|
|
421
|
-
| `
|
|
422
|
-
| `
|
|
423
|
-
| `
|
|
424
|
-
| `
|
|
425
|
-
| `
|
|
426
|
-
| `
|
|
415
|
+
| Error | What to do |
|
|
416
|
+
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
417
|
+
| `missing_api_key` / `invalid_api_key` | Set `FENFILL_API_KEY` in the client's config and restart the client. |
|
|
418
|
+
| `plan_required` | The workspace needs a paid plan (Pro and up). |
|
|
419
|
+
| `insufficient_scans` | Not enough page scans left; analyze fewer `pages` or check `get_account`. |
|
|
420
|
+
| `prefilled_form` / `filled_output` | Only blank forms can be analyzed; use the original, empty PDF. If it is the blank form (some ship with default text in their fields), use the fenfill web app. |
|
|
421
|
+
| `pdf_password_required` | Remove the open password first; owner-password PDFs work as they are. |
|
|
422
|
+
| `pdf_fill_forbidden` | The PDF's author forbids form filling; fenfill won't fill it. Use a copy that allows filling. |
|
|
423
|
+
| `unsupported_script` | A value needs Japanese characters (text, comb or a checkbox symbol like 〇) and the font could not be loaded; `ids` lists the fields and `details.reason` why (`network`, `http_status`, `hash_mismatch`, `timeout`, `too_large`). Connect once and retry, or pre-seed the font (see Files and privacy). The check spans the whole document, so `preview_page` refuses too. |
|
|
424
|
+
| `not_analyzed` | Run `analyze_form` on the same file (and pages) before `fill_form`. |
|
|
425
|
+
| `output_exists` | Pick a new `output_path` or pass `overwrite: true`. |
|
|
426
|
+
| `rate_limited` / `queue_full` | `analyze_form` already waited about a minute (`waited_s`); try again later. |
|
|
427
|
+
| `too_many_active_jobs` | Other analyses in the workspace (free native-field ones too) are still running; try again in a minute, or analyze fewer at once. |
|
|
428
|
+
| `template_conflict` | The template changed in fenfill since your edits began. Your local edits are kept: `edit_template` with `discard: true`, re-apply the ops, save again. |
|
|
429
|
+
| `invalid_schema` | fenfill (or the local check before it) refused the edited layout; `details` lists each item and reason. Fix them with `edit_template`. |
|
|
430
|
+
| `check_copy_failed` | `preview_page` could not build its outlined copy; `stage` and `id` say where. Fix or remove that field or group with `edit_template`, then preview again; `overlay: "none"` still shows the page meanwhile. |
|
|
431
|
+
| `request_too_large` | The edited template is too large to save in one request. |
|
|
432
|
+
| `answer_in_template` | Edited wording matches an answer from this session, so nothing was sent; `matched` lists the ids and properties. An answer: put the form's own wording back with `edit_template`. The form's own wording: `save_template` again with `confirm_wording: true`. |
|
|
433
|
+
| `confirm_wording_needed` | The working copy has wording edited in an earlier session. Review the ids and properties in `changed`, then `save_template` with `confirm_wording: true`. |
|
|
434
|
+
| `local_edits_pending` | `reanalyze_template` won't run over unsaved edits: `save_template` them first, or pass `discard: true`. |
|
|
435
|
+
| `kind_required` | The pages already have fields: pass `kind` (`find`, `relabel`, `label_missing`, or `scratch` to replace them). |
|
|
436
|
+
| `job_in_progress` | A job is already running on the template; wait and retry (call `reanalyze_template` again with the same arguments if you started it). |
|
|
437
|
+
| `upload_outcome_unknown` | An earlier upload was interrupted. To avoid charging twice, the same file isn't re-uploaded for about 10 minutes; check `get_account` meanwhile. |
|
|
427
438
|
|
|
428
439
|
## API
|
|
429
440
|
|
package/THIRD_PARTY_NOTICES
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@fenfill/mcp 0.2.
|
|
1
|
+
@fenfill/mcp 0.2.4 bundles the following third-party software.
|
|
2
2
|
|
|
3
3
|
@cantoo/pdf-lib@2.11.1 (MIT)
|
|
4
4
|
------------------------------------------------------------------------
|
|
@@ -397,6 +397,32 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
397
397
|
SOFTWARE.
|
|
398
398
|
|
|
399
399
|
|
|
400
|
+
bidi-js@1.0.3 (MIT)
|
|
401
|
+
------------------------------------------------------------------------
|
|
402
|
+
Copyright (c) 2021 Jason Johnston
|
|
403
|
+
|
|
404
|
+
MIT License
|
|
405
|
+
|
|
406
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
407
|
+
a copy of this software and associated documentation files (the
|
|
408
|
+
"Software"), to deal in the Software without restriction, including
|
|
409
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
410
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
411
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
412
|
+
the following conditions:
|
|
413
|
+
|
|
414
|
+
The above copyright notice and this permission notice shall be
|
|
415
|
+
included in all copies or substantial portions of the Software.
|
|
416
|
+
|
|
417
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
418
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
419
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
420
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
421
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
422
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
423
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
424
|
+
|
|
425
|
+
|
|
400
426
|
culori@4.0.2 (MIT)
|
|
401
427
|
------------------------------------------------------------------------
|
|
402
428
|
MIT License
|