@kinloom/cli 0.1.1 → 0.3.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.
Files changed (111) hide show
  1. package/dist/assets/cached-ocr.py +786 -0
  2. package/dist/assets/ocr.md +76 -0
  3. package/dist/assets/prep-scan.md +97 -0
  4. package/dist/assets/prep-scan.py +1313 -0
  5. package/dist/bundled-skills/acpl-persi/SKILL.md +103 -0
  6. package/dist/bundled-skills/acpl-persi/scripts/persi +539 -0
  7. package/dist/bundled-skills/archive-org/SKILL.md +162 -0
  8. package/dist/bundled-skills/archive-org/scripts/archive-org +1576 -0
  9. package/dist/bundled-skills/blm-glo/SKILL.md +54 -0
  10. package/dist/bundled-skills/california-archives/SKILL.md +130 -0
  11. package/dist/bundled-skills/california-archives/scripts/ca-archives +614 -0
  12. package/dist/bundled-skills/chronicling-america/SKILL.md +120 -0
  13. package/dist/bundled-skills/chronicling-america/scripts/chronam +553 -0
  14. package/dist/bundled-skills/cyndis-list/SKILL.md +53 -0
  15. package/dist/bundled-skills/findagrave/SKILL.md +129 -0
  16. package/dist/bundled-skills/findagrave/scripts/findagrave +965 -0
  17. package/dist/bundled-skills/hathitrust/SKILL.md +117 -0
  18. package/dist/bundled-skills/hathitrust/scripts/hathi +379 -0
  19. package/dist/bundled-skills/kentucky-archives/SKILL.md +124 -0
  20. package/dist/bundled-skills/kentucky-archives/scripts/ky-archives +646 -0
  21. package/dist/bundled-skills/library-of-michigan/SKILL.md +118 -0
  22. package/dist/bundled-skills/library-of-michigan/scripts/michiganology +515 -0
  23. package/dist/bundled-skills/missouri-archives/SKILL.md +109 -0
  24. package/dist/bundled-skills/missouri-archives/scripts/mo-archives +751 -0
  25. package/dist/bundled-skills/nara-catalog-search/SKILL.md +130 -0
  26. package/dist/bundled-skills/nara-catalog-search/scripts/nara +1387 -0
  27. package/dist/bundled-skills/narrative-audio/SKILL.md +103 -0
  28. package/dist/bundled-skills/narrative-audio/references/script-rules.md +109 -0
  29. package/dist/bundled-skills/narrative-audio/scripts/narrative-audio +290 -0
  30. package/dist/bundled-skills/new-jersey-archives/SKILL.md +135 -0
  31. package/dist/bundled-skills/new-jersey-archives/scripts/nj-archives +869 -0
  32. package/dist/bundled-skills/openarchieven/SKILL.md +97 -0
  33. package/dist/bundled-skills/openarchieven/scripts/openarchieven +624 -0
  34. package/dist/bundled-skills/texas-archives/SKILL.md +102 -0
  35. package/dist/bundled-skills/texas-archives/scripts/texas-archives +666 -0
  36. package/dist/bundled-skills/uk-archives/SKILL.md +110 -0
  37. package/dist/bundled-skills/uk-archives/scripts/uk-archives +631 -0
  38. package/dist/bundled-skills/usgs-gnis/SKILL.md +99 -0
  39. package/dist/bundled-skills/usgs-gnis/scripts/gnis +418 -0
  40. package/dist/bundled-skills/virginia-archives/SKILL.md +144 -0
  41. package/dist/bundled-skills/virginia-archives/scripts/va-archives +1039 -0
  42. package/dist/bundled-skills/wikitree/SKILL.md +154 -0
  43. package/dist/bundled-skills/wikitree/scripts/wikitree +455 -0
  44. package/dist/cli.d.ts +1 -1
  45. package/dist/cli.d.ts.map +1 -1
  46. package/dist/cli.js +488 -26
  47. package/dist/cli.js.map +1 -1
  48. package/dist/client.d.ts.map +1 -1
  49. package/dist/client.js +30 -5
  50. package/dist/client.js.map +1 -1
  51. package/dist/commands/ops/audit.d.ts +138 -0
  52. package/dist/commands/ops/audit.d.ts.map +1 -0
  53. package/dist/commands/ops/audit.js +872 -0
  54. package/dist/commands/ops/audit.js.map +1 -0
  55. package/dist/commands/ops/context.d.ts +100 -0
  56. package/dist/commands/ops/context.d.ts.map +1 -0
  57. package/dist/commands/ops/context.js +917 -0
  58. package/dist/commands/ops/context.js.map +1 -0
  59. package/dist/commands/ops/dates.d.ts +87 -0
  60. package/dist/commands/ops/dates.d.ts.map +1 -0
  61. package/dist/commands/ops/dates.js +228 -0
  62. package/dist/commands/ops/dates.js.map +1 -0
  63. package/dist/commands/ops/help.d.ts +8 -0
  64. package/dist/commands/ops/help.d.ts.map +1 -0
  65. package/dist/commands/ops/help.js +107 -0
  66. package/dist/commands/ops/help.js.map +1 -0
  67. package/dist/commands/ops/index.d.ts +8 -0
  68. package/dist/commands/ops/index.d.ts.map +1 -0
  69. package/dist/commands/ops/index.js +8 -0
  70. package/dist/commands/ops/index.js.map +1 -0
  71. package/dist/commands/ops/integrate.d.ts +61 -0
  72. package/dist/commands/ops/integrate.d.ts.map +1 -0
  73. package/dist/commands/ops/integrate.js +1063 -0
  74. package/dist/commands/ops/integrate.js.map +1 -0
  75. package/dist/commands/ops/sync.d.ts +194 -0
  76. package/dist/commands/ops/sync.d.ts.map +1 -0
  77. package/dist/commands/ops/sync.js +1251 -0
  78. package/dist/commands/ops/sync.js.map +1 -0
  79. package/dist/commands/ops/telemetry.d.ts +79 -0
  80. package/dist/commands/ops/telemetry.d.ts.map +1 -0
  81. package/dist/commands/ops/telemetry.js +249 -0
  82. package/dist/commands/ops/telemetry.js.map +1 -0
  83. package/dist/commands/ops/verify.d.ts +76 -0
  84. package/dist/commands/ops/verify.d.ts.map +1 -0
  85. package/dist/commands/ops/verify.js +325 -0
  86. package/dist/commands/ops/verify.js.map +1 -0
  87. package/dist/commands/records/help.d.ts +18 -0
  88. package/dist/commands/records/help.d.ts.map +1 -0
  89. package/dist/commands/records/help.js +174 -0
  90. package/dist/commands/records/help.js.map +1 -0
  91. package/dist/commands/records/index.d.ts +5 -0
  92. package/dist/commands/records/index.d.ts.map +1 -0
  93. package/dist/commands/records/index.js +5 -0
  94. package/dist/commands/records/index.js.map +1 -0
  95. package/dist/commands/records/registry.d.ts +32 -0
  96. package/dist/commands/records/registry.d.ts.map +1 -0
  97. package/dist/commands/records/registry.js +227 -0
  98. package/dist/commands/records/registry.js.map +1 -0
  99. package/dist/commands/records/resolve.d.ts +14 -0
  100. package/dist/commands/records/resolve.d.ts.map +1 -0
  101. package/dist/commands/records/resolve.js +61 -0
  102. package/dist/commands/records/resolve.js.map +1 -0
  103. package/dist/commands/records/runner.d.ts +27 -0
  104. package/dist/commands/records/runner.d.ts.map +1 -0
  105. package/dist/commands/records/runner.js +255 -0
  106. package/dist/commands/records/runner.js.map +1 -0
  107. package/dist/index.d.ts +2 -0
  108. package/dist/index.d.ts.map +1 -1
  109. package/dist/index.js +2 -0
  110. package/dist/index.js.map +1 -1
  111. package/package.json +3 -3
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: virginia-archives
3
+ description: Research historical and genealogical records at the Library of Virginia via the bundled `va-archives` CLI: Chancery Records Index search, case detail, and scanned-page download, plus the public Primo catalog API, Land Office and Dunmore's War TIFF scans from image.lva.virginia.gov, and Rosetta (IE id) file downloads, all disk-cached. Also covers Virginia Chronicle newspapers, Land Office patents and grants, Virginia Untold, and ARVAS finding aids, with an honest note on which of those are browser-only. Use when tracing ancestors through Virginia, finding chancery causes, land patents, newspaper notices, or catalog records held by the Library of Virginia, or deciding whether a Virginia record is online, orderable, or visit-only.
4
+ ---
5
+
6
+ # Virginia Archives: Library of Virginia
7
+
8
+ Portal: https://www.lva.virginia.gov/collections
9
+ Digital collections: https://www.lva.virginia.gov/collections/digital-collections
10
+ Address: 800 East Broad Street, Richmond, Virginia 23219. Phone 804-692-3500.
11
+
12
+ The Library of Virginia is both the state library and the state archives. It holds more than 130 million items.
13
+
14
+ ## Bundled CLI (`scripts/va-archives`)
15
+
16
+ Path: `skills/virginia-archives/scripts/va-archives`
17
+
18
+ A standalone executable Python CLI with a PEP 723 `#!/usr/bin/env -S uv run --script` shebang and inline dependencies (`click`, `httpx`, `pillow`). No virtualenv setup, no API key, no account. Run it from the repo root, e.g. `skills/virginia-archives/scripts/va-archives chancery search Lincoln`.
19
+
20
+ The Library of Virginia exposes real machine interfaces, verified live on 2026-11-24 (see Verification log). The CLI uses plain HTTP for everything it does; no browser automation is bundled.
21
+
22
+ ### Chancery Records Index
23
+
24
+ ```bash
25
+ # Surname search (match defaults to Starts; 20 records per page)
26
+ skills/virginia-archives/scripts/va-archives chancery search Lincoln
27
+ skills/virginia-archives/scripts/va-archives chancery search Lincoln --locality "ROCKINGHAM CO" --year-from 1800 --year-to 1850
28
+ skills/virginia-archives/scripts/va-archives chancery search Lincoln --match Includes --pages 1-3 --json
29
+
30
+ # One cause by CFN, with its scanned-page list
31
+ skills/virginia-archives/scripts/va-archives chancery case <cfn> --images
32
+
33
+ # Download scanned pages (real PDFs) plus metadata.json; --zip for the whole-case ZIP
34
+ skills/virginia-archives/scripts/va-archives chancery download <cfn> --pages 1-5 --out ./downloads/va-chancery
35
+ skills/virginia-archives/scripts/va-archives chancery download <cfn> --zip
36
+
37
+ # Per-locality coverage: region, time frame, viewing status
38
+ skills/virginia-archives/scripts/va-archives chancery localities
39
+ skills/virginia-archives/scripts/va-archives chancery localities --status Scanned --json
40
+ ```
41
+
42
+ Search options mirror the index form exactly: `--surname2`, `--plaintiff-last` / `--plaintiff-first`, `--defendant-last` / `--defendant-first`, `--index-number`, `--local-case-number`, `--enslaved`, `--free`, `--plats`, `--match Exact|Starts|Includes`. Multiple surnames on one command are ORed (one search each; totals add).
43
+
44
+ A chancery cause (equity suit: estate divisions, disputed wills, guardianships, divorces, debt suits) can name three generations at once through depositions and exhibits, making it one of the highest-value Virginia genealogical sources. The index covers over 100 of the Commonwealth's 133 localities, with a focus on pre-1913 causes. Check `chancery localities` first: it shows per locality whether indexed data exists, whether images are digitized, and whether the locality is closed for processing.
45
+
46
+ ### Library catalog (Primo PNXS API)
47
+
48
+ ```bash
49
+ skills/virginia-archives/scripts/va-archives catalog Lincoln
50
+ skills/virginia-archives/scripts/va-archives catalog Lincoln --field title --limit 5 --offset 5 --json
51
+ ```
52
+
53
+ The catalog runs on Primo (`lva.primo.exlibrisgroup.com`). The CLI queries its public, key-free PNXS JSON API (`/primaws/rest/pub/pnxs?q=<field>,contains,<query>&vid=01LVA_INST:01LVA&scope=MyInstitution`). Verified fields are `any`, `title`, and `creator`. Each hit prints title, creator, date, type, and a fulldisplay record URL built from the PNXS recordid in the standard Primo pattern. Use it for books, government publications, archives and manuscript collections, Bible and church records, and select maps. Land Office patents and grants are also discoverable here by surname; see below for the dedicated index.
54
+
55
+ ### URL builders (no search run)
56
+
57
+ ```bash
58
+ skills/virginia-archives/scripts/va-archives url --chancery-case <cfn>
59
+ skills/virginia-archives/scripts/va-archives url --catalog Lincoln
60
+ skills/virginia-archives/scripts/va-archives url --chronicle --land --arvas
61
+ ```
62
+
63
+ ### Image server scans: `grant-tif` (alias `lva-tif`) and `dunmore`
64
+
65
+ ```bash
66
+ # One Land Office patent/grant page (raw TIFF, or JPEG when --out ends in .jpg/.jpeg)
67
+ skills/virginia-archives/scripts/va-archives grant-tif /LONN/LO-3/372/372_0195.tif --out patent.tif
68
+ skills/virginia-archives/scripts/va-archives lva-tif https://image.lva.virginia.gov/LONN/LO-3/372/372_0195.tif --out patent.jpg
69
+
70
+ # Dunmore's War (1774) card -> neighbouring page TIFFs; save the card's page (or --page N)
71
+ skills/virginia-archives/scripts/va-archives dunmore <DRAWER> <CARD>
72
+ skills/virginia-archives/scripts/va-archives dunmore <DRAWER> <CARD> --page 100 --out dw-page100.jpg --json
73
+ ```
74
+
75
+ `grant-tif` fetches a single scan from `image.lva.virginia.gov` only. It accepts a full `https://image.lva.virginia.gov/...` URL or a path on that host, and it rejects any other host or scheme (including plain `http://`), credentials, ports, query strings, `.`/`..` segments (raw or percent-encoded), backslashes, and non-image suffixes. If the server redirects to another host, the download is refused. `--out *.jpg` converts TIFF to JPEG when Pillow is importable; Pillow is in the script's inline dependencies, so it is available under `uv run`. Without Pillow, the raw TIFF is written next to the requested file with a `.tif` suffix. Any other suffix gets the raw bytes. Land Office TIFF links appear in Primo catalog records (`catalog <surname> --json`).
76
+
77
+ `dunmore DRAWER CARD` takes the `dir` and `card` values from the catalog's `GetDW.pl?dir=<dddd>/W<dddd>&card=<n>` links (Dunmore's War payroll and service-claim index cards). The CGI redirects to a `/cgi-bin/drawer` page that lists neighbouring microfilm page TIFFs under `/Microfilm/DW/<reel>/<nnnnn>.tif`. The command lists those pages and marks the card's own page, which is the link with no "Page N" label. `--out` saves the card's page, or the page chosen with `--page N`, through the same validated, cached download as `grant-tif`.
78
+
79
+ ### Rosetta delivered files: `download-rosetta`
80
+
81
+ ```bash
82
+ skills/virginia-archives/scripts/va-archives download-rosetta IE3453061 --list
83
+ skills/virginia-archives/scripts/va-archives download-rosetta IE3453061 --out item.pdf # viewer's initial file
84
+ skills/virginia-archives/scripts/va-archives download-rosetta IE3453061 --file 2 --json # e.g. the Transcription
85
+ skills/virginia-archives/scripts/va-archives download-rosetta IE3453061 --fl FL3453067
86
+ ```
87
+
88
+ The Library's digital objects live in Ex Libris Rosetta at `rosetta.virginiamemory.com`. Primo records link them as `DeliveryManagerServlet?dps_pid=IE<n>`. The command validates the id with `^IE\d+$` and keeps a single cookie session while it resolves the item. It reads the delivery page's `ieViewer.do` iframe (with its `dps_dvs` token), takes the `FL<n>` file pids and their METS titles from the viewer, and streams the chosen file from `DeliveryManagerServlet?dps_pid=FL<n>&dps_func=stream`. Every hop must stay on `https://rosetta.virginiamemory.com`. If the server returns an HTML page instead of a file, the command treats the item as restricted. The output name defaults to `<IE>_<FL>.<ext>`, with the extension taken from the content type.
89
+
90
+ ### Disk cache
91
+
92
+ Every network response is cached under `$KINLOOM_VA_ARCHIVES_CACHE_DIR`. The default is `$XDG_CACHE_HOME/kinloom-va-archives`, or `~/.cache/kinloom-va-archives` when `XDG_CACHE_HOME` is unset. Writes go to a temp file that is then renamed into place, under a per-entry `fcntl.flock`.
93
+
94
+ - `http/`: chancery search/case/images/localities HTML and catalog JSON, keyed by a SHA-256 of the request. These expire after `$KINLOOM_VA_ARCHIVES_TTL_HOURS` (default 168).
95
+ - `files/`: chancery page PDFs, ZIPs, and image-server TIFFs, keyed by URL. These never expire.
96
+ - `rosetta/<IE>/`: `files.json` (the resolved file list) and `<FL>.bin` (the delivered bytes), keyed by IE id.
97
+
98
+ To refetch, put `--refresh` before the subcommand to cover the whole run (`va-archives --refresh chancery localities`), or add it to a single command (`grant-tif ... --refresh`).
99
+
100
+ Tests: `uv run --with click --with httpx python3 -m unittest skills/virginia-archives/tests/test_va_archives.py`. These are mocked-HTTP tests with synthetic fixtures. Vitest also runs them in `packages/cli/src/commands/records/records.test.ts`.
101
+
102
+ ## What is searchable online
103
+
104
+ - **Chancery Records Index:** https://www.lva.virginia.gov/collections/chancery (search itself lives at https://old.lva.virginia.gov/chancery/). See CLI above. Individual case pages use the verified pattern `case_detail.asp?CFN=<locality-code>-<year>-<number>`.
105
+ - **Virginia Chronicle:** https://www.virginiachronicle.com. Free full-text searchable archive of Virginia newspapers, over 5 million pages (the Library's own 2026 update puts the count near 7 million pages and growing). Search by keyword, title, date, or place. No account required. Use it for obituaries, marriage notices, estate sale notices, and local news. **Browser-only:** Cloudflare returns "Just a moment..." to curl and to headless Chromium (verified 2026-11-24), and the site blocks all crawlers in robots.txt. No stable GET search URL was verified; use the Search box on the site. `url --chronicle` prints the home page only.
106
+ - **Land Office patents and grants.** The collection covers Virginia land patents 1623-1774 and land grants 1779-February 2000, including Northern Neck Proprietary grants 1690-1874, with survey plats and accompanying papers. Routes: the catalog CLI above (`catalog <surname>`), the libguide https://lva-virginia.libguides.com/land-grants, and the browse-by-volume index https://image.lva.virginia.gov/LONN/LO.html (Virginia Land Office Patents and Grants Index; search is a legacy Aleph form whose host, `lva1.hosted.exlibrisgroup.com`, was unreachable on 2026-11-24, so use the browser for the name search). Early Virginia land ownership is proved here rather than in county deed books alone.
107
+ - **Virginia Untold: the African American Narrative.** Digital access to records documenting enslaved and free Black and multiracial people. Reach it through the digital-collections page; no separate machine interface was verified.
108
+ - **Bible records, church records, cemetery records, maps, and photographs** are in the digital collections, searchable through the catalog CLI. Family Bible records are a named source for birth, death, and marriage dates.
109
+ - **ARVAS finding aids:** https://arvasarchive.org (linked from the Collections page). A consolidated database of manuscripts and archival material in historical societies, libraries, museums, and colleges across Virginia and West Virginia. Use it when the record you need is not at the Library itself. **Browser-only:** plain HTTP returns an empty 202 (verified 2026-11-24); no search API was verified.
110
+
111
+ ## What is in-person or subscription-only
112
+
113
+ - Original deed books, will books, and order books stay with the clerk of the circuit court in each county or independent city. The Library holds microfilm of many older volumes and the original volumes, loose papers, and microfilm for most localities. County records lost to courthouse fires and the April 1865 Richmond evacuation fire are a known gap; the Library keeps a Lost Records Localities list, so check it before concluding a record never existed.
114
+ - Birth and death registers 1853-1896 and marriage records before 1936 survive on microfilm. The Library partners with Ancestry.com for select digital collections (births, deaths, marriages, personal property tax records), freely accessible to Virginians in their homes. A non-Virginian uses the same collections through a personal Ancestry subscription or in the Richmond reading rooms.
115
+ - Subscription databases are available in the reading rooms; Virginia residents can reach many remotely after registering for a Library of Virginia account.
116
+
117
+ ## Research workflow
118
+
119
+ Worked order for tracing a family through Virginia (for example before a westward move into Kentucky or the Midwest):
120
+
121
+ 1. Search the Chancery Records Index by surname and locality (`va-archives chancery search <surname>`).
122
+ 2. Search Land Office patents and grants by surname (`va-archives catalog <surname>` plus the LONN index).
123
+ 3. Search Virginia Chronicle in a browser by surname and county for notices and obituaries.
124
+ 4. Search the catalog for Bible records, church registers, and manuscript collections.
125
+ 5. If the chancery index shows a cause without digitized images, record the index number and locality in `data/` and check `chancery localities` before requesting copies or visiting, since active processing can temporarily close a locality.
126
+
127
+ ## Verification log (verified live 2026-11-24)
128
+
129
+ - LVA Collections page, Digital Collections page, Chancery landing page, and Chancery information page: all 200 via plain curl.
130
+ - Chancery search POST to `old.lva.virginia.gov/chancery/default.asp`: 200 with 20 records per page and `intPage=N` pagination.
131
+ - Case detail GET `case_detail.asp?CFN=<cfn>`: 200, structured locality/index/plaintiff/defendant/surname/plat/format tables.
132
+ - Case images GET `case_images.asp?CFN=<cfn>`: 200, lists page PDFs under `/ChanceryImg/...` plus a whole-case ZIP link; both individual PDFs and ZIP archives download over plain HTTP.
133
+ - Primo PNXS GET (`q=any,contains,<term>` and `q=title,contains,<term>` with `limit` and `offset`): 200 JSON, no key or auth.
134
+ - Chancery availability GET `available.asp`: 200, locality table (locality, region, time frame, viewing status, notes).
135
+ - Virginia Chronicle: curl 403 with Cloudflare "Just a moment..."; headless Chromium also returns the challenge page. Browser-only.
136
+ - ARVAS: plain HTTP returns 202 with an empty body. Browser-only.
137
+ - LONN volume index `image.lva.virginia.gov/LONN/LO.html`: 200, browse-by-volume table; its Aleph name-search host was unreachable (connection failed).
138
+ - Image server and Rosetta (verified 2026-11-26): `image.lva.virginia.gov/LONN/LO-3/372/372_0195.tif` returns `image/tiff` (CCITT G4). `cgi-bin/GetDW.pl?dir=<DRAWER>&card=<CARD>` redirects to a `cgi-bin/drawer` page listing `/Microfilm/DW/001/*.tif` pages. `rosetta.virginiamemory.com/delivery/DeliveryManagerServlet?dps_pid=IE3453061` embeds `view/action/ieViewer.do?...dps_dvs=...`, which lists `FL3453066` (Original) and `FL3453067` (Transcription). Both stream as `application/pdf` via `dps_func=stream`.
139
+ - No account or API key is needed for anything the CLI does. Fees apply only to ordering copies, noted per collection above.
140
+
141
+ ## What this skill does not cover
142
+
143
+ - Other state archive repositories (see sibling skills such as `kentucky-archives`, `missouri-archives`, `new-jersey-archives`, `california-archives`, and `texas-archives`).
144
+ - Do not invent an API endpoint, a query-string search URL, or an auth requirement for Virginia Chronicle, ARVAS, Virginia Untold, or the Aleph Land Office search. Where no machine interface was verified, the skill says so and gives the click path instead.