strom-research 1.32.0 → 1.33.0-beta.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.
- package/CHANGELOG.cs.md +17 -0
- package/CHANGELOG.de.md +20 -0
- package/CHANGELOG.md +17 -0
- package/CHANGELOG.pl.md +19 -0
- package/assets/archives.json +2 -2
- package/assets/lang/cs.json +1 -1
- package/assets/lang/de.json +1 -1
- package/assets/lang/pl.json +1 -1
- package/assets/method/core.md +4 -1
- package/assets/method/enrich.md +3 -1
- package/assets/method/locate.md +2 -1
- package/assets/method/waiting.md +7 -5
- package/dist/agents/files.js +3 -2
- package/dist/brief/brief.js +31 -12
- package/dist/brief/sheet.js +16 -6
- package/dist/commands/analysis.js +63 -8
- package/dist/commands/archives.js +14 -4
- package/dist/commands/connectors.js +3 -0
- package/dist/commands/history.js +53 -7
- package/dist/commands/media.js +183 -34
- package/dist/core/browser.js +112 -13
- package/dist/core/browserhelp.js +6 -1
- package/dist/core/byhand.js +18 -1
- package/dist/core/phrases.js +1 -1
- package/dist/core/sync.js +69 -3
- package/dist/core/tree.js +1 -1
- package/package.json +4 -1
package/CHANGELOG.cs.md
CHANGED
|
@@ -5,6 +5,23 @@
|
|
|
5
5
|
Změny každé verze ve zkratce. Úplné poznámky a instalační řádky jsou na
|
|
6
6
|
[GitHub Releases](https://github.com/ACiDekCZ/strom-research/releases) (anglicky).
|
|
7
7
|
|
|
8
|
+
## 1.33.0
|
|
9
|
+
|
|
10
|
+
*Připravuje se: bety do 1.33.0-beta.1. Oddíl bude úplný s vydáním.*
|
|
11
|
+
|
|
12
|
+
- **Archivy, kam smí jen prohlížeč člověka:** agent tam už nezkouší stahovač stromu ani hledání v katalogu. Jejich
|
|
13
|
+
snímky jdou po jednom přes prohlížeč agenta (`strom media save`), jakmile to člověk povolí „přes prohlížeč“, jinak je
|
|
14
|
+
člověk uloží ručně; brief i odmítnutí hned říkají tento další krok.
|
|
15
|
+
- **Snímky ukládané přes prohlížeč:** kniha se vezme z toho, na co úkol čeká, nebo ze stránky archivu; uložený soubor
|
|
16
|
+
nese značku výzkumu, takže se nikdy nevezme soubor jiného výzkumu ze sdílené složky stažených souborů. Najdou se i prohlížeče snímků vestavěné do kódu stránky (OpenSeadragon
|
|
17
|
+
uvnitř Reactu); prohlížeč, ke kterému strom nedosáhne, je ohlášen spolu s tím, co místo toho udělá člověk.
|
|
18
|
+
- **Hledání:** hledání, které něco našlo, se zapisuje až po svém zdroji a bez zdroje řekne pořadí; zdroj nalezený omylem
|
|
19
|
+
se odebere přes `strom search edit --drop-found`.
|
|
20
|
+
- **Historie:** `strom history hide|show` zkontrolují, co dostaly, dřív než se na cokoli zeptají; jedna událost se čte
|
|
21
|
+
přes `strom history list --event <id>`.
|
|
22
|
+
- **Z aplikace Strom:** údaj poslaný zpět v jiném tvaru téhož druhu (událost typu Census místo sčítání) se pozná jako
|
|
23
|
+
tentýž údaj – beze změny, když se nic nezměnilo, úprava toho údaje, když se změnilo datum.
|
|
24
|
+
|
|
8
25
|
## 1.32.0
|
|
9
26
|
|
|
10
27
|
*14. 11. 2026 · patří k aplikaci Strom 3.28.0.*
|
package/CHANGELOG.de.md
CHANGED
|
@@ -5,6 +5,26 @@
|
|
|
5
5
|
Die Änderungen jeder Version in Kürze. Die vollständigen Hinweise und die Installationszeilen stehen bei
|
|
6
6
|
[GitHub Releases](https://github.com/ACiDekCZ/strom-research/releases) (auf Englisch).
|
|
7
7
|
|
|
8
|
+
## 1.33.0
|
|
9
|
+
|
|
10
|
+
*In Vorbereitung: die Betas bis 1.33.0-beta.1. Der Abschnitt ist mit dem Release vollständig.*
|
|
11
|
+
|
|
12
|
+
- **Archive, die nur der Browser eines Menschen betreten darf:** Der Agent versucht dort weder den Downloader von strom
|
|
13
|
+
noch die Katalogsuche. Ihre Bilder kommen einzeln über den Browser des Agenten (`strom media save`), sobald der
|
|
14
|
+
Mensch „über den Browser“ erlaubt, sonst speichert der Mensch sie von Hand; Brief und Ablehnungen nennen diesen
|
|
15
|
+
nächsten Schritt sofort.
|
|
16
|
+
- **Über den Browser gespeicherte Bilder:** Das Buch wird aus dem genommen, worauf die Aufgabe wartet, oder aus der
|
|
17
|
+
Seite des Archivs; die gespeicherte Datei trägt das Zeichen der Forschung, sodass nie eine Datei einer anderen
|
|
18
|
+
Forschung aus dem gemeinsamen Download-Ordner genommen wird. Auch Bildbetrachter im eigenen Code einer Seite (OpenSeadragon in React) werden gefunden; ein Betrachter,
|
|
19
|
+
den strom nicht erreicht, wird mit dem genannt, was der Mensch stattdessen tut.
|
|
20
|
+
- **Suchen:** Eine Suche, die etwas gefunden hat, wird nach ihrer Quelle eingetragen und nennt ohne Quelle die
|
|
21
|
+
Reihenfolge; eine versehentlich gefundene Quelle wird mit `strom search edit --drop-found` entfernt.
|
|
22
|
+
- **Verlauf:** `strom history hide|show` prüfen, was sie bekommen, bevor jemand gefragt wird; ein einzelnes Ereignis
|
|
23
|
+
liest `strom history list --event <id>`.
|
|
24
|
+
- **Aus der Strom-App:** Eine Angabe, die in einer anderen Form derselben Art zurückkommt (ein Ereignis vom Typ Census
|
|
25
|
+
für eine Volkszählung), wird als dieselbe Angabe erkannt – keine Änderung, wenn sich nichts geändert hat, eine
|
|
26
|
+
Bearbeitung dieser Angabe, wenn sich ihr Datum geändert hat.
|
|
27
|
+
|
|
8
28
|
## 1.32.0
|
|
9
29
|
|
|
10
30
|
*14.11.2026 · gehört zur Strom-App 3.28.0.*
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,23 @@ English · [Čeština](CHANGELOG.cs.md) · [Deutsch](CHANGELOG.de.md) · [Polski
|
|
|
5
5
|
The changes of each version in short. The full notes and the install lines are on
|
|
6
6
|
[GitHub Releases](https://github.com/ACiDekCZ/strom-research/releases).
|
|
7
7
|
|
|
8
|
+
## 1.33.0
|
|
9
|
+
|
|
10
|
+
*In preparation: the betas up to 1.33.0-beta.1. The section is complete with the release.*
|
|
11
|
+
|
|
12
|
+
- **Archives only a person's browser may enter:** the agent no longer tries strom's downloader or catalogue search
|
|
13
|
+
there. Their images go one at a time through the agent's browser (`strom media save`) once the person allows "through
|
|
14
|
+
the browser", else the person saves them by hand; the brief and the refusals say this next step at once.
|
|
15
|
+
- **Images saved through the browser:** the book is taken from what the task waits for or from the archive's page; the
|
|
16
|
+
saved file carries the research's mark, so a file of another research in the shared downloads folder is never taken. Image viewers built into a page's own code (OpenSeadragon
|
|
17
|
+
inside React) are found too; a viewer strom cannot reach is said with what the person does instead.
|
|
18
|
+
- **Searches:** a search that found something is recorded after its source, and says the order when the source is
|
|
19
|
+
missing; a source found by mistake is taken off with `strom search edit --drop-found`.
|
|
20
|
+
- **History:** `strom history hide|show` check what they are given before anyone is asked; one event is read with
|
|
21
|
+
`strom history list --event <id>`.
|
|
22
|
+
- **From the Strom app:** a fact sent back in another shape of the same kind (an event of type Census for a census) is
|
|
23
|
+
recognized as that fact — no change when nothing changed, an edit of that fact when its date did.
|
|
24
|
+
|
|
8
25
|
## 1.32.0
|
|
9
26
|
|
|
10
27
|
*2026-11-14 · goes with the Strom app 3.28.0.*
|
package/CHANGELOG.pl.md
CHANGED
|
@@ -5,6 +5,25 @@
|
|
|
5
5
|
Zmiany każdej wersji w skrócie. Pełne informacje o wydaniach i polecenia instalacji są na
|
|
6
6
|
[GitHub Releases](https://github.com/ACiDekCZ/strom-research/releases) (po angielsku).
|
|
7
7
|
|
|
8
|
+
## 1.33.0
|
|
9
|
+
|
|
10
|
+
*W przygotowaniu: bety do 1.33.0-beta.1. Sekcja będzie kompletna z wydaniem.*
|
|
11
|
+
|
|
12
|
+
- **Archiwa, do których wolno wejść tylko przeglądarką człowieka:** agent nie próbuje już tam pobierania przez strom ani
|
|
13
|
+
wyszukiwania w katalogu. Ich skany idą pojedynczo przez przeglądarkę agenta (`strom media save`), gdy człowiek zezwoli
|
|
14
|
+
„przez przeglądarkę”, w przeciwnym razie człowiek zapisuje je ręcznie; brief i odmowy od razu podają ten następny krok.
|
|
15
|
+
- **Skany zapisywane przez przeglądarkę:** księga jest brana z tego, na co czeka zadanie, albo ze strony archiwum;
|
|
16
|
+
zapisany plik nosi znak badania, więc nigdy nie zostanie wzięty plik innego badania ze wspólnego folderu pobranych
|
|
17
|
+
plików. Znajdowane są też przeglądarki skanów wbudowane w kod
|
|
18
|
+
strony (OpenSeadragon w React); przeglądarka, do której strom nie sięga, jest zgłaszana razem z tym, co zamiast tego
|
|
19
|
+
robi człowiek.
|
|
20
|
+
- **Wyszukiwania:** wyszukiwanie, które coś znalazło, zapisuje się po swoim źródle, a bez źródła podaje kolejność;
|
|
21
|
+
źródło znalezione omyłkowo usuwa `strom search edit --drop-found`.
|
|
22
|
+
- **Historia:** `strom history hide|show` sprawdzają, co dostały, zanim o cokolwiek zapytają; jedno zdarzenie czyta
|
|
23
|
+
`strom history list --event <id>`.
|
|
24
|
+
- **Z aplikacji Strom:** fakt odesłany w innej postaci tego samego rodzaju (zdarzenie typu Census zamiast spisu) jest
|
|
25
|
+
rozpoznawany jako ten sam fakt – bez zmiany, gdy nic się nie zmieniło, jako edycja tego faktu, gdy zmieniła się data.
|
|
26
|
+
|
|
8
27
|
## 1.32.0
|
|
9
28
|
|
|
10
29
|
*14.11.2026 · współpracuje z aplikacją Strom 3.28.0.*
|
package/assets/archives.json
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"disallow": [
|
|
14
14
|
"/scitacioperaty/"
|
|
15
15
|
],
|
|
16
|
-
"scope": "a person's browser only (its terms: an image saved \"only by the standard means of web browsers\"; its ICT office, 2 November 2026: no exceptions for tools): no request straight through strom, no image through strom fetch even with a permission; the agent's browser, with the person's permission \"through the browser\", one image at a time at a person's pace (at least 4 s apart), else the person saves the image and the agent reads the saved file. Parish registers (/actapublica): for the person's own research; never a whole book; its images never published elsewhere without the owner's written consent (its Podmínky užití služeb of 20 May 2024: https://www.mza.cz/actapublica/page/view/podminky-uziti-sluzeb). Census records (/scitacioperaty, 1857–1921): for viewing only by its help — the person takes a screenshot, the agent reads the saved file",
|
|
17
|
-
"checked": "2026-11-
|
|
16
|
+
"scope": "a person's browser only (its terms: an image saved \"only by the standard means of web browsers\"; its ICT office, 2 November 2026: no exceptions for tools): no request straight through strom, no image through strom fetch even with a permission; the agent's browser, with the person's permission \"through the browser\", one image at a time at a person's pace (at least 4 s apart), else the person saves the image and the agent reads the saved file. Parish registers (/actapublica): for the person's own research; never a whole book; its images never published elsewhere without the owner's written consent (its Podmínky užití služeb of 20 May 2024: https://www.mza.cz/actapublica/page/view/podminky-uziti-sluzeb). Census records (/scitacioperaty, 1857–1921): for viewing only by its help — the person takes a screenshot, the agent reads the saved file. Archival descriptions and land registers (/aron): its Podmínky použití aplikace ARON of 20 May 2024 (https://www.mza.cz/aplikace/podminky-pouziti-aplikace-aron/) — digitized materials never published elsewhere without the owner's written consent, no interference with the site's technical nature; its viewer has a download button of its own (the person's)",
|
|
17
|
+
"checked": "2026-11-14",
|
|
18
18
|
"browserOnly": true,
|
|
19
19
|
"pace": {
|
|
20
20
|
"minIntervalMs": 4000
|
package/assets/lang/cs.json
CHANGED
|
@@ -2719,7 +2719,7 @@
|
|
|
2719
2719
|
"wait.group.connectors": "Stahovače",
|
|
2720
2720
|
"browser.wait": "snímky {images} knihy {book}, ukládá je prohlížeč agenta z {url}",
|
|
2721
2721
|
"browser.save.other": "karta prohlížeče ukazuje jiný snímek než {n} ({url}), nic se neuložilo",
|
|
2722
|
-
"browser.wait.held": "snímky {images} knihy {book}, ukládá je prohlížeč agenta z {url} — prohlížeč snímek {n} zadržel: povolit webu {host} stahování více
|
|
2722
|
+
"browser.wait.held": "snímky {images} knihy {book}, ukládá je prohlížeč agenta z {url} — prohlížeč snímek {n} zadržel: povolit webu {host} stahování více souborů v profilu prohlížeče, ve kterém agent pracuje, jednou (ikona vpravo v adresním řádku prohlížeče)",
|
|
2723
2723
|
"wait.group.app": "Aplikace Strom",
|
|
2724
2724
|
"wait.group.tune": "Čtení snímků",
|
|
2725
2725
|
"wait.group.conflicts": "K rozhodnutí – rozpory",
|
package/assets/lang/de.json
CHANGED
|
@@ -2719,7 +2719,7 @@
|
|
|
2719
2719
|
"wait.group.connectors": "Downloader",
|
|
2720
2720
|
"browser.wait": "Aufnahmen {images} des Buches {book}, vom Browser des Agenten gespeichert ({url})",
|
|
2721
2721
|
"browser.save.other": "der Tab des Browsers zeigt eine andere Aufnahme als {n} ({url}), nichts wurde gespeichert",
|
|
2722
|
-
"browser.wait.held": "Aufnahmen {images} des Buches {book}, vom Browser des Agenten gespeichert ({url}) — der Browser hat Aufnahme {n} zurückgehalten: {host} das Herunterladen mehrerer Dateien erlauben, einmal (das Symbol rechts in der Adressleiste des Browsers)",
|
|
2722
|
+
"browser.wait.held": "Aufnahmen {images} des Buches {book}, vom Browser des Agenten gespeichert ({url}) — der Browser hat Aufnahme {n} zurückgehalten: {host} das Herunterladen mehrerer Dateien erlauben, im Browserprofil, in dem der Agent arbeitet, einmal (das Symbol rechts in der Adressleiste des Browsers)",
|
|
2723
2723
|
"wait.group.app": "Die Strom-App",
|
|
2724
2724
|
"wait.group.tune": "Das Lesen der Scans",
|
|
2725
2725
|
"wait.group.conflicts": "Widersprüche zu entscheiden",
|
package/assets/lang/pl.json
CHANGED
|
@@ -2719,7 +2719,7 @@
|
|
|
2719
2719
|
"wait.group.connectors": "Programy pobierające",
|
|
2720
2720
|
"browser.wait": "skany {images} księgi {book}, zapisywane przez przeglądarkę agenta z {url}",
|
|
2721
2721
|
"browser.save.other": "karta przeglądarki pokazuje inny skan niż {n} ({url}), nic nie zostało zapisane",
|
|
2722
|
-
"browser.wait.held": "skany {images} księgi {book}, zapisywane przez przeglądarkę agenta z {url} — przeglądarka wstrzymała skan {n}: zezwolić witrynie {host} na pobieranie wielu plików, jednorazowo (ikona po prawej stronie paska adresu przeglądarki)",
|
|
2722
|
+
"browser.wait.held": "skany {images} księgi {book}, zapisywane przez przeglądarkę agenta z {url} — przeglądarka wstrzymała skan {n}: zezwolić witrynie {host} na pobieranie wielu plików w profilu przeglądarki, w którym pracuje agent, jednorazowo (ikona po prawej stronie paska adresu przeglądarki)",
|
|
2723
2723
|
"wait.group.app": "Aplikacja Strom",
|
|
2724
2724
|
"wait.group.tune": "Odczyt skanów",
|
|
2725
2725
|
"wait.group.conflicts": "Do rozstrzygnięcia – sprzeczności",
|
package/assets/method/core.md
CHANGED
|
@@ -22,7 +22,10 @@ conclusion so the next researcher can follow it.
|
|
|
22
22
|
what would decide it.
|
|
23
23
|
- **Negative results are results.** Every search is recorded (`strom search add
|
|
24
24
|
… --result negative`), with exactly what was covered. The most expensive
|
|
25
|
-
mistake is to search the same book twice.
|
|
25
|
+
mistake is to search the same book twice. A search that found something is
|
|
26
|
+
recorded after its source, in this order: `strom source add …` →
|
|
27
|
+
`strom search add … --result found --found <S…>` (in a batch the source line
|
|
28
|
+
ends `#s`, the search takes `--found @s`).
|
|
26
29
|
<!-- end -->
|
|
27
30
|
- **Check the premise first.** Before opening anything, read the brief's
|
|
28
31
|
*Already known* — the searches of the task's books, people and surnames;
|
package/assets/method/enrich.md
CHANGED
|
@@ -15,7 +15,9 @@ Before a story (the task says so), look where the registers do not:
|
|
|
15
15
|
newspapers, directories, school and society reports, military, land, court
|
|
16
16
|
and notarial records, graves, the history of the place — first which exist
|
|
17
17
|
for that country and time, and where they are digitised. Every search is
|
|
18
|
-
recorded, also in vain (`strom search add … --method web|catalog|full-text`)
|
|
18
|
+
recorded, also in vain (`strom search add … --method web|catalog|full-text`);
|
|
19
|
+
what it found after its source: `strom source add …` →
|
|
20
|
+
`strom search add … --result found --found <S…>`.
|
|
19
21
|
|
|
20
22
|
- **Within the brief's budget of pages** fetched or read; then record what
|
|
21
23
|
was searched and close. Printed pages go to the user's model for print
|
package/assets/method/locate.md
CHANGED
|
@@ -27,7 +27,8 @@ Before anything can be proven, know where the records are.
|
|
|
27
27
|
`strom task wait T… --on "…" --kind web --url <the catalogue>`.
|
|
28
28
|
5. Record where you looked, also what gave nothing: `strom search add "<what>"
|
|
29
29
|
--method web|catalog --result found|negative --task T…` — the next session
|
|
30
|
-
must not search the same catalogues again.
|
|
30
|
+
must not search the same catalogues again. Found: the source first, in this
|
|
31
|
+
order — `strom source add …` → `strom search add … --result found --found <S…>`.
|
|
31
32
|
6. Done when a record set with access (URL or call number) exists and the next
|
|
32
33
|
`link` task points at it: `strom task edit T… --where B…` for a task that
|
|
33
34
|
was written before the book was known, `strom task add … --where B…` for a
|
package/assets/method/waiting.md
CHANGED
|
@@ -22,11 +22,13 @@ An archive that allows no automation (or whose connector cannot fetch images):
|
|
|
22
22
|
the user saves the images, you guide them. You open nothing and download
|
|
23
23
|
nothing yourself — not through a browser either. The one exception, as the
|
|
24
24
|
task's brief says it: an archive only a person's browser goes to, which the
|
|
25
|
-
person allowed "through the browser"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
person allowed "through the browser" (no `strom fetch` there, `--find`
|
|
26
|
+
neither — its books are found on its own site) — Claude in Chrome saves its
|
|
27
|
+
images one at a time: `strom media save T… --image <n> --at <its page>` (the
|
|
28
|
+
script for your tab), then `strom media add --inbox --waiting`, which says
|
|
29
|
+
what came — never read the downloads folder yourself. Nothing else is opened
|
|
30
|
+
or downloaded there; a check whether a person is there is the person's to
|
|
31
|
+
pass, never yours.
|
|
30
32
|
|
|
31
33
|
1. The book: its title and its address on the archive's site (the task shows
|
|
32
34
|
them). An archive that needs an account: the user logs in with their own.
|
package/dist/agents/files.js
CHANGED
|
@@ -118,8 +118,9 @@ the researcher; \`strom\` is your only way to read and change the research.
|
|
|
118
118
|
\`strom net web --check <url> --browser\` first. An image of such an
|
|
119
119
|
archive the person allowed "through the browser", with no connector of
|
|
120
120
|
it: one at a time, \`strom media save T… --image <n> --at <its page>\`
|
|
121
|
-
(the script for your tab), then \`strom media add --inbox --waiting
|
|
122
|
-
|
|
121
|
+
(the script for your tab), then \`strom media add --inbox --waiting\`,
|
|
122
|
+
which says what came and where it is now — never read the downloads
|
|
123
|
+
folder yourself. What a task waits for (\`--on\`) is a sentence the user reads in strom's
|
|
123
124
|
menu: impersonal, what is needed and from whom, never addressed to them;
|
|
124
125
|
say its kind (\`--kind letter|family|web|other\`) and, when known,
|
|
125
126
|
\`--to\`, \`--request notes/<file>.md\`, \`--url\`.
|
package/dist/brief/brief.js
CHANGED
|
@@ -9,8 +9,8 @@ import fs from "node:fs";
|
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import { inboxFolders, inputPath } from "../core/media.js";
|
|
11
11
|
import { inboxState, inboxWaits } from "../core/inboxwait.js";
|
|
12
|
-
import { browserOnlyArchive } from "../core/byhand.js";
|
|
13
|
-
import { browserAdviceFor } from "../core/browserhelp.js";
|
|
12
|
+
import { browserOnlyArchive, browserOnlyShut } from "../core/byhand.js";
|
|
13
|
+
import { bookBrowserArchive, browserAdviceFor, browserState } from "../core/browserhelp.js";
|
|
14
14
|
import { displayName, familiesAsChild, familiesAsPartner, formatName, label, lifespan, likelyDuplicates, parentsOf, primaryName, sameFamilyName, surnameForms } from "../core/people.js";
|
|
15
15
|
import { settledClaim } from "../core/labels.js";
|
|
16
16
|
import { parseYears } from "../core/years.js";
|
|
@@ -607,8 +607,9 @@ function readyFor(tree, shared, installed) {
|
|
|
607
607
|
if (!host)
|
|
608
608
|
return [];
|
|
609
609
|
if (!byHost.has(host)) {
|
|
610
|
-
|
|
611
|
-
const
|
|
610
|
+
// never one strom fetch refuses whole: an archive only a person's browser goes to (core/byhand.ts)
|
|
611
|
+
const direct = readyConnectors(tree.env, shared, url).filter((c) => !browserOnlyShut(tree, c, shared));
|
|
612
|
+
const browser = installed(url).filter((c) => !direct.some((d) => d.name === c.name) && viaBrowser(tree, c) && !byHandOnly(c) && !missingConsents(tree.env, c).code && !missingConsents(tree.env, c).hosts.length && !browserOnlyShut(tree, c, shared));
|
|
612
613
|
byHost.set(host, [...direct, ...browser]);
|
|
613
614
|
}
|
|
614
615
|
return byHost.get(host);
|
|
@@ -626,11 +627,13 @@ function installedFor(shared) {
|
|
|
626
627
|
return [...mine.filter((c) => c.manifest.can.includes("fetch")), ...mine.filter((c) => !c.manifest.can.includes("fetch"))];
|
|
627
628
|
};
|
|
628
629
|
}
|
|
629
|
-
function bookFinder(tree, b, installed) {
|
|
630
|
+
function bookFinder(tree, b, installed, shared, save) {
|
|
630
631
|
const all = installed(b.url);
|
|
631
632
|
const c = all.find((x) => x.manifest.can.includes("fetch") || viaBrowser(tree, x)) ?? all[0];
|
|
632
633
|
if (!c)
|
|
633
634
|
return undefined;
|
|
635
|
+
if (!byHandOnly(c) && browserOnlyShut(tree, c, shared))
|
|
636
|
+
return { connector: c.name, why: "browser", ...(save ? { save } : {}) };
|
|
634
637
|
const why = byHandOnly(c) ? "manual" : c.manifest.can.includes("fetch") || viaBrowser(tree, c) ? "consent" : "search";
|
|
635
638
|
return { connector: c.name, why };
|
|
636
639
|
}
|
|
@@ -640,6 +643,8 @@ function byHandAsk(b, whole) {
|
|
|
640
643
|
}
|
|
641
644
|
/** What a finder of a record set means for its images. */
|
|
642
645
|
function finderText(f, b) {
|
|
646
|
+
if (f.why === "browser")
|
|
647
|
+
return `only a person's browser goes to this archive: its connector ${f.connector} is refused there by strom fetch, finding its books (--find) too — ${f.save ? `its images one at a time through your browser: ${f.save} (then strom media add --inbox --waiting); else the person saves them by hand` : "the person saves the images by hand"}`;
|
|
643
648
|
if (f.why === "consent")
|
|
644
649
|
return `its connector ${f.connector} fetches them once the user allows it — one strom fetch ${f.connector} <book> --images <from-to> --recordset ${b.id} asks them; once the question waits, never again until they decide`;
|
|
645
650
|
const what = f.why === "manual" ? `the archive's terms allow no automation: its connector ${f.connector} finds books and gives their links` : `its connector ${f.connector} only finds books and fetches no images`;
|
|
@@ -790,7 +795,9 @@ function repoHint(tree) {
|
|
|
790
795
|
* sets, of the other record sets of those places and of the archives the places' jurisdictions name — each with its
|
|
791
796
|
* archive; the others installed by name only.
|
|
792
797
|
*/
|
|
793
|
-
function placeConnectors(tree, sets, places, keys, ready, installed, all) {
|
|
798
|
+
function placeConnectors(tree, sets, places, keys, ready, installed, all, shared) {
|
|
799
|
+
// one strom fetch refuses whole (an archive only a person's browser goes to): named as that, never as a way to find books
|
|
800
|
+
const shut = new Set(all.filter((c) => !byHandOnly(c) && browserOnlyShut(tree, c, shared)).map((c) => c.name));
|
|
794
801
|
const urls = [];
|
|
795
802
|
const repoOf = (id) => (id ? tree.get(id) : undefined);
|
|
796
803
|
const books = [...sets, ...tree.list("recordset").filter((b) => !sets.includes(b) && (b.places ?? []).flatMap(keys).some((k) => places.has(k)))];
|
|
@@ -813,8 +820,8 @@ function placeConnectors(tree, sets, places, keys, ready, installed, all) {
|
|
|
813
820
|
if (!serving.has(c.name) || !serving.get(c.name))
|
|
814
821
|
serving.set(c.name, u.archive);
|
|
815
822
|
// the others that find or fetch, by name: an archive of another place is a command away
|
|
816
|
-
const others = all.filter((c) => !serving.has(c.name) && (c.manifest.can.includes("find") || c.manifest.can.includes("fetch"))).map((c) => ({ name: c.name, serves: false }));
|
|
817
|
-
return [...[...serving].map(([name, archive]) => ({ name, ...(archive ? { archive } : {}), serves: true })), ...others];
|
|
823
|
+
const others = all.filter((c) => !serving.has(c.name) && (c.manifest.can.includes("find") || c.manifest.can.includes("fetch"))).map((c) => ({ name: c.name, serves: false, ...(shut.has(c.name) ? { browserOnly: true } : {}) }));
|
|
824
|
+
return [...[...serving].map(([name, archive]) => ({ name, ...(archive ? { archive } : {}), serves: true, ...(shut.has(name) ? { browserOnly: true } : {}) })), ...others];
|
|
818
825
|
}
|
|
819
826
|
/**
|
|
820
827
|
* What strom keeps to at a record set's archive now (C6): its level where it is not simply allowed, the person's
|
|
@@ -889,12 +896,17 @@ function archiveLine(tree, b, repo, shared, installed, qs = []) {
|
|
|
889
896
|
if (a.level === "restricted" || a.level === "unknown")
|
|
890
897
|
parts.push(a.permission
|
|
891
898
|
? `the person's permission: ${a.permission === "slow" ? "images slowly" : a.permission === "browser" ? "through the browser" : "by hand only"}`
|
|
892
|
-
: ((q) =>
|
|
899
|
+
: ((q) => q
|
|
900
|
+
? `the person's decision on its images waits since ${q.at.slice(0, 10)}`
|
|
901
|
+
: // an archive only a person's browser goes to: no fetch there at all, so none asks — the way is the person's
|
|
902
|
+
a.browserOnly
|
|
903
|
+
? `no decision of the person's yet: its images through your browser only once they allow it (strom allow archive ${a.host} --way browser — the person's, never yours), else the person saves them by hand`
|
|
904
|
+
: "no decision of the person's yet: a fetch of its images asks them once, and the question then waits — never fetch there again until they decide")(qs.find((x) => onHost(a.host, x.host))));
|
|
893
905
|
else if (a.permission === "manual")
|
|
894
906
|
parts.push("the person: images by hand only");
|
|
895
907
|
// a restricted archive's images, allowed slowly or through the browser: sparing (the method's "Fetch only what you read")
|
|
896
908
|
if ((a.level === "restricted" || a.level === "unknown") && (a.permission === "slow" || a.permission === "browser"))
|
|
897
|
-
parts.push("fetch sparingly: an index by halving, a page to its image by 1–2 images, an entry ±1
|
|
909
|
+
parts.push(`${a.browserOnly || a.permission === "browser" ? "images sparingly through your browser" : "fetch sparingly"}: an index by halving, a page to its image by 1–2 images, an entry ±1`);
|
|
898
910
|
if (a.refused)
|
|
899
911
|
parts.push(`${a.refused.host} refused strom's client — left alone ${a.refused.until && a.refused.until < REFUSED_FOREVER ? `until ${clock(a.refused.until)}` : "until the person lifts it"}; not through your web tools or a browser either`);
|
|
900
912
|
else if (net) {
|
|
@@ -1348,7 +1360,14 @@ export function buildBrief(tree, opts) {
|
|
|
1348
1360
|
const installed = installedFor(opts.shared);
|
|
1349
1361
|
const ready = readyFor(tree, opts.shared, installed);
|
|
1350
1362
|
const routes = new Map(sets.map((b) => [b.id, bookRoute(tree, b, ready)]));
|
|
1351
|
-
|
|
1363
|
+
// an archive only a person's browser goes to, allowed "through the browser": the agent's browser saves its images one
|
|
1364
|
+
// at a time where strom keeps that browser (strom media save) — never strom fetch there
|
|
1365
|
+
const saveFor = (b) => {
|
|
1366
|
+
const repo = b.repository ? tree.get(b.repository) : undefined;
|
|
1367
|
+
const a = bookBrowserArchive(tree, [b.url, repo?.url].find((x) => !!x && URL.canParse(x)), opts.shared);
|
|
1368
|
+
return a?.permitted && browserState(tree.env, tuneAgent, tree.root).state === "ready" ? `strom media save ${task?.id ?? "T…"} --image <n> --at <the archive's page of that image>` : undefined;
|
|
1369
|
+
};
|
|
1370
|
+
const finders = new Map(sets.map((b) => [b.id, routes.get(b.id) ? undefined : bookFinder(tree, b, installed, opts.shared, saveFor(b))]));
|
|
1352
1371
|
const shapeFor = sets.find((b) => routes.get(b.id))?.id;
|
|
1353
1372
|
if (sets.length)
|
|
1354
1373
|
sections.push({
|
|
@@ -1508,7 +1527,7 @@ export function buildBrief(tree, opts) {
|
|
|
1508
1527
|
// 8b. the commands this kind of task uses, with every option and limit (K2): asking for them costs a turn each —
|
|
1509
1528
|
// and the connectors of the task's places, so that fetching needs no lookup
|
|
1510
1529
|
// (the others installed only where none serves them, or the task is to find where the records are)
|
|
1511
|
-
const connectors = placeConnectors(tree, sets, taskPlaces, placeKeys, ready, installed, listConnectors(opts.shared));
|
|
1530
|
+
const connectors = placeConnectors(tree, sets, taskPlaces, placeKeys, ready, installed, listConnectors(opts.shared), opts.shared);
|
|
1512
1531
|
const sheet = commandSheet(kind, { connectors: task?.level === "locate" || !connectors.some((c) => c.serves) ? connectors : connectors.filter((c) => c.serves), ...(sandbox || noCli ? { without: ["read"] } : {}), ...(agentDecides ? { decides: true } : {}) });
|
|
1513
1532
|
if (sheet)
|
|
1514
1533
|
sections.push({ name: "commands", first: true, pointer: "strom help <command>", text: sheet });
|
package/dist/brief/sheet.js
CHANGED
|
@@ -119,11 +119,16 @@ function citeLine(defs) {
|
|
|
119
119
|
}
|
|
120
120
|
/** The connectors, in a line after fetch: those of the task's places first, the others by name. */
|
|
121
121
|
function connectorLine(list) {
|
|
122
|
-
const serving = list.filter((c) => c.serves);
|
|
123
|
-
const others = list.filter((c) => !c.serves);
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
122
|
+
const serving = list.filter((c) => c.serves && !c.browserOnly);
|
|
123
|
+
const others = list.filter((c) => !c.serves && !c.browserOnly);
|
|
124
|
+
const shut = list.filter((c) => c.browserOnly);
|
|
125
|
+
// never a way to find books where strom fetch is refused: the archive's own site, through the agent's browser or the person's
|
|
126
|
+
const closed = shut.length
|
|
127
|
+
? `${shut.map((c) => `${c.name}${c.archive ? ` = ${c.archive}` : ""}`).join(", ")}: only a person's browser goes to ${shut.length > 1 ? "their archives" : "its archive"} — refused there by strom fetch, --find too; its books on the archive's own site (your browser where the brief allows it, else the person)`
|
|
128
|
+
: "";
|
|
129
|
+
if (!serving.length && !others.length)
|
|
130
|
+
return closed ? ` connectors: ${closed}` : " connectors: none installed — an archive's own: strom connector new <name> --url <portal>";
|
|
131
|
+
return ` connectors${serving.length ? ` of these places: ${serving.map((c) => `${c.name}${c.archive ? ` = ${c.archive}` : ""}`).join(", ")}${others.length ? ` · others: ${others.map((c) => c.name).join(", ")}` : ""}` : `: ${others.map((c) => c.name).join(", ")}`} — books of a place: strom fetch <connector> --find "<place>" --years <from-to>${closed ? ` · ${closed}` : ""}`;
|
|
127
132
|
}
|
|
128
133
|
/** The section of the brief: the commands of this level, or nothing (no level, or no registry — a unit test). */
|
|
129
134
|
export function commandSheet(level, extra = {}) {
|
|
@@ -136,6 +141,7 @@ export function commandSheet(level, extra = {}) {
|
|
|
136
141
|
if (!defs.length)
|
|
137
142
|
return "";
|
|
138
143
|
const cite = citeLine(defs);
|
|
144
|
+
const shutOnly = !!extra.connectors?.length && extra.connectors.every((c) => c.browserOnly);
|
|
139
145
|
return [
|
|
140
146
|
"## Commands for this task (≤n: at most n characters; … repeatable — all options: strom help <command>)",
|
|
141
147
|
// the mistakes that cost a turn most (N0180–N0188): words of one value not quoted, several values after one
|
|
@@ -144,6 +150,10 @@ export function commandSheet(level, extra = {}) {
|
|
|
144
150
|
// a status asked of a name or a family, proven with no primary information (N0190, N0191): refused, a turn lost
|
|
145
151
|
...(RECORDS.has(level) ? [" --status is a fact's (E…) only, never a name's or a family's; proven only with a record of the time read directly (--information primary), else probable"] : []),
|
|
146
152
|
...(cite ? [cite] : []),
|
|
147
|
-
...defs.flatMap((d) =>
|
|
153
|
+
...defs.flatMap((d) =>
|
|
154
|
+
// every connector of the task's archives one strom fetch refuses whole: no fetch line to try, only why
|
|
155
|
+
d.path.join(" ") === "fetch" && shutOnly
|
|
156
|
+
? [connectorLine(extra.connectors)]
|
|
157
|
+
: [` ${synopsis(d, true, d.path[1] === "edit" ? defs.find((x) => x.path[0] === d.path[0] && x.path[1] === "add") : undefined)}${d.sheet ? ` — ${d.sheet}` : ""}`, ...(d.path.join(" ") === "fetch" && extra.connectors ? [connectorLine(extra.connectors)] : [])]),
|
|
148
158
|
].join("\n");
|
|
149
159
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { actsAsArchive } from "../core/state.js";
|
|
3
3
|
import { register } from "../cli/registry.js";
|
|
4
4
|
import { ui } from "../cli/ui.js";
|
|
5
|
-
import { counted, lines, moreLine, paginate, table, truncate } from "../cli/format.js";
|
|
5
|
+
import { counted, lines, moreLine, paginate, shellArg, table, truncate } from "../cli/format.js";
|
|
6
6
|
import { UsageError } from "../core/errors.js";
|
|
7
7
|
import { LESSON_DETAIL_MAX, LESSON_MAX, LESSON_SCOPES, RECORD_TYPES, SEARCH_METHODS, SEARCH_RESULTS, VARIANT_LINK_KINDS, } from "../core/model.js";
|
|
8
8
|
import { create, csvOpt, listOpt, normId, requireRecord, update } from "../core/records.js";
|
|
@@ -258,13 +258,32 @@ function searchLine(s) {
|
|
|
258
258
|
}
|
|
259
259
|
/** What a found search needs before it: the source it found (N0181, N0187: the search written first). */
|
|
260
260
|
const FOUND_FIRST = "the source first, then the search: strom source add \"…\" … — in one batch the source add line first, ending #s, then search add … --found @s";
|
|
261
|
+
/** The options of strom search add, in the order the hint retypes them. */
|
|
262
|
+
const SEARCH_ADD_OPTS = ["recordset", "years", "surname", "place", "pages", "method", "result", "task", "by", "note"];
|
|
263
|
+
/**
|
|
264
|
+
* A found search typed without the source it found (1114 C10: four times in one session): the order, and this very
|
|
265
|
+
* command again with --found — the next thing to run, once the source is recorded.
|
|
266
|
+
*/
|
|
267
|
+
function foundFirst(question, opts) {
|
|
268
|
+
const said = SEARCH_ADD_OPTS.flatMap((o) => listOpt(opts[o]).flatMap((v) => [`--${o}`, shellArg(v)]));
|
|
269
|
+
return new UsageError("result found needs --found <S…>: the source it found is recorded first", {
|
|
270
|
+
code: "search.found.first",
|
|
271
|
+
hint: lines('1. strom source add "…" --kind … --recordset … --locator … (its answer names the source: S…)', `2. strom search add ${[shellArg(question), ...said, "--found", "<S…>"].join(" ")}`, "in one batch: the source add line first, ending #s, then search add … --found @s"),
|
|
272
|
+
});
|
|
273
|
+
}
|
|
261
274
|
register({
|
|
262
275
|
path: ["search", "add"],
|
|
263
276
|
summary: "Record a search — ALSO when nothing was found (negative results are results)",
|
|
264
277
|
group: "analysis",
|
|
265
|
-
sheet: "found:
|
|
278
|
+
sheet: "found: in this order — strom source add … → strom search add … --result found --found <S…> (in a batch source add … #s, then --found @s)",
|
|
266
279
|
tree: true,
|
|
267
280
|
writes: true,
|
|
281
|
+
description: "Every search is recorded, the one that found nothing too. A search that found something cites what it found, so\n" +
|
|
282
|
+
"the source comes first, in this order:\n" +
|
|
283
|
+
' 1. strom source add "…" --kind … --recordset … --locator … (its answer names the source: S…)\n' +
|
|
284
|
+
" 2. strom search add \"…\" … --result found --found <S…>\n" +
|
|
285
|
+
"In one batch: the source add line first, ending #s, then search add … --found @s. A source found later is added\n" +
|
|
286
|
+
"with strom search edit <Q…> --found <S…>.",
|
|
268
287
|
args: [{ name: "question", description: 'what was looked for: "Baptisms Novák 1903–1907"', required: true }],
|
|
269
288
|
options: [
|
|
270
289
|
{ name: "recordset", type: "string", multiple: true, value: "<B…>", description: "where (repeatable)", aliases: ["where"] },
|
|
@@ -279,7 +298,11 @@ register({
|
|
|
279
298
|
{ name: "by", type: "string", value: "<who>", description: "main (default), reader, user" },
|
|
280
299
|
{ name: "note", type: "string", value: "<text>", description: "what was illegible, what is left" },
|
|
281
300
|
],
|
|
282
|
-
examples: [
|
|
301
|
+
examples: [
|
|
302
|
+
'strom search add "Křty Novák 1903-1907" --recordset B0001 --years 1903-1907 --surname Novák --method page-by-page --result negative --task T0001',
|
|
303
|
+
'strom source add "Křest Jana Lhotáka 1905" --kind baptism --recordset B0001 --locator "fol. 12"',
|
|
304
|
+
'strom search add "Křty Lhoták 1903-1907" --recordset B0001 --years 1903-1907 --method page-by-page --result found --found S0001',
|
|
305
|
+
],
|
|
283
306
|
run(ctx, { args, opts }) {
|
|
284
307
|
const tree = ctx.tree();
|
|
285
308
|
const recordsets = csvOpt(opts.recordset).map((b) => requireRecord(tree, b, "recordset").id);
|
|
@@ -288,7 +311,7 @@ register({
|
|
|
288
311
|
const findings = csvOpt(opts.found).map((s) => requireRecord(tree, s, "source").id);
|
|
289
312
|
const result = oneOf(opts.result, SEARCH_RESULTS, "result");
|
|
290
313
|
if (result === "found" && findings.length === 0)
|
|
291
|
-
throw
|
|
314
|
+
throw foundFirst(args[0].trim(), opts);
|
|
292
315
|
// A search made in a session served that session's task, unless it says otherwise.
|
|
293
316
|
const session = currentSession(tree, ctx.env, ctx.refs);
|
|
294
317
|
const task = opts.task ? requireRecord(tree, String(opts.task), "task").id : session?.task;
|
|
@@ -348,7 +371,8 @@ register({
|
|
|
348
371
|
writes: true,
|
|
349
372
|
description: "Only the options given change; lists (--recordset, --surname, --place, --found) replace the old ones; --note adds a note.\n" +
|
|
350
373
|
"A search is evidence — a negative one above all: changing where it looked, how, or what came out needs --reason;\n" +
|
|
351
|
-
"filling in what was not recorded doesn't."
|
|
374
|
+
"filling in what was not recorded doesn't. A source attached by mistake: --drop-found <S…> takes it off, --no-found\n" +
|
|
375
|
+
"takes off every one; a search found with no source left says what it is now (--result negative|partial|inconclusive).",
|
|
352
376
|
args: [{ name: "search", description: "search ID (Q0001)", required: true }],
|
|
353
377
|
options: [
|
|
354
378
|
{ name: "question", type: "string", value: "<text>", description: "what was looked for" },
|
|
@@ -361,15 +385,37 @@ register({
|
|
|
361
385
|
{ name: "method", type: "string", value: "<m>", description: SEARCH_METHODS.join(", ") },
|
|
362
386
|
{ name: "result", type: "string", value: "<r>", description: SEARCH_RESULTS.join(", ") },
|
|
363
387
|
{ name: "found", type: "string", multiple: true, value: "<S…>", description: "sources found (repeatable; replaces)" },
|
|
388
|
+
{ name: "drop-found", type: "string", multiple: true, value: "<S…>", description: "take off a source attached by mistake (repeatable; with --reason)" },
|
|
389
|
+
{ name: "no-found", type: "boolean", description: "take off every source found (with --reason)" },
|
|
364
390
|
{ name: "task", type: "string", value: "<T…>", description: "task this search served" },
|
|
365
391
|
{ name: "note", type: "string", value: "<text>", description: "add a note" },
|
|
366
392
|
],
|
|
367
|
-
examples: [
|
|
393
|
+
examples: [
|
|
394
|
+
'strom search edit Q0001 --recordset B0002 --reason "the index belongs to the other volume"',
|
|
395
|
+
'strom search edit Q0001 --pages 95-100 --note "images 101-104 unreadable"',
|
|
396
|
+
'strom search edit Q0003 --drop-found S0002 --reason "attached to the wrong search"',
|
|
397
|
+
],
|
|
368
398
|
run(ctx, { args, opts }) {
|
|
369
399
|
const tree = ctx.tree();
|
|
370
|
-
const
|
|
400
|
+
const was = requireRecord(tree, args[0], "search");
|
|
401
|
+
const id = was.id;
|
|
371
402
|
if (opts["no-recordset"] && csvOpt(opts.recordset).length)
|
|
372
403
|
throw new UsageError("--recordset or --no-recordset, not both");
|
|
404
|
+
// the sources found: replaced (--found), one taken off (--drop-found) or every one (--no-found) — 1114 C9: --found ""
|
|
405
|
+
// read as nothing to change
|
|
406
|
+
const given = { found: opts.found !== undefined, drop: csvOpt(opts["drop-found"]).length > 0, none: !!opts["no-found"] };
|
|
407
|
+
if ([given.found, given.drop, given.none].filter(Boolean).length > 1)
|
|
408
|
+
throw new UsageError("--found, --drop-found or --no-found, one of them", { code: "search.found.which" });
|
|
409
|
+
if (given.found && !csvOpt(opts.found).length)
|
|
410
|
+
throw new UsageError("--found names no source", {
|
|
411
|
+
code: "search.found.empty",
|
|
412
|
+
hint: `a source attached by mistake: strom search edit ${id} --drop-found <S…> --reason "…" (every one: --no-found)`,
|
|
413
|
+
});
|
|
414
|
+
const dropped = csvOpt(opts["drop-found"]).map((s) => normId(s, "source"));
|
|
415
|
+
for (const s of dropped)
|
|
416
|
+
if (!was.findings.includes(s))
|
|
417
|
+
throw new UsageError(`${id} has no source found ${s}`, { code: "search.found.not", hint: was.findings.length ? `its sources found: ${was.findings.join(" ")}` : `strom search show ${id}` });
|
|
418
|
+
const findings = given.found ? csvOpt(opts.found).map((s) => requireRecord(tree, s, "source").id) : given.drop ? was.findings.filter((s) => !dropped.includes(s)) : given.none ? [] : undefined;
|
|
373
419
|
const said = [];
|
|
374
420
|
const years = yearsOption(opts.years, said);
|
|
375
421
|
const scope = {
|
|
@@ -384,7 +430,7 @@ register({
|
|
|
384
430
|
...(opts["no-recordset"] ? { recordsets: [] } : {}),
|
|
385
431
|
...(opts.method !== undefined ? { method: oneOf(opts.method, SEARCH_METHODS, "method") } : {}),
|
|
386
432
|
...(opts.result !== undefined ? { result: oneOf(opts.result, SEARCH_RESULTS, "result") } : {}),
|
|
387
|
-
...(
|
|
433
|
+
...(findings ? { findings } : {}),
|
|
388
434
|
...(opts.task ? { task: requireRecord(tree, String(opts.task), "task").id } : {}),
|
|
389
435
|
};
|
|
390
436
|
const note = typeof opts.note === "string" && opts.note.trim() ? makeNotes(tree, opts.note) : undefined;
|
|
@@ -393,6 +439,15 @@ register({
|
|
|
393
439
|
throw new UsageError("nothing to change", { hint: `strom help search edit` });
|
|
394
440
|
const reason = typeof opts.reason === "string" && opts.reason.trim() ? opts.reason.trim() : undefined;
|
|
395
441
|
const s = update(tree, id, "search", (cur) => {
|
|
442
|
+
// found with nothing left: what it is now is said in the same command (a found search cites what it found)
|
|
443
|
+
if ((given.drop || given.none) && (change.result ?? cur.result) === "found" && !change.findings.length) {
|
|
444
|
+
const taken = given.none ? "--no-found" : dropped.map((s) => `--drop-found ${s}`).join(" ");
|
|
445
|
+
throw new UsageError(`${id} would be found with no source left: say what it is now`, {
|
|
446
|
+
code: "search.found.none",
|
|
447
|
+
params: { search: id },
|
|
448
|
+
hint: `strom search edit ${id} ${taken} --result negative|partial|inconclusive --reason "…" — or --found <S…>: the source it did find`,
|
|
449
|
+
});
|
|
450
|
+
}
|
|
396
451
|
// What was recorded as searched is evidence: overwriting it needs a reason, filling it in doesn't.
|
|
397
452
|
const was = { recordsets: cur.recordsets, method: cur.method, result: cur.result, findings: cur.findings, ...cur.scope };
|
|
398
453
|
const now = { ...change, ...scope };
|
|
@@ -355,7 +355,7 @@ async function askPerson(ctx, c, missing, way) {
|
|
|
355
355
|
* permission stays as given, the direct way is never taken. Its ways for the agent, in words and in --json (details):
|
|
356
356
|
* the person's permission "through the browser" where the agent's browser could help (one strom keeps), else by hand.
|
|
357
357
|
*/
|
|
358
|
-
export function browserOnlyRefusal(ctx, c, a, images, pages = false) {
|
|
358
|
+
export function browserOnlyRefusal(ctx, c, a, images, pages = false, catalogue = false) {
|
|
359
359
|
const agent = detectAgent(ctx.env);
|
|
360
360
|
// what the agent's own browser may do there (none for an agent whose browser strom does not keep)
|
|
361
361
|
const root = ctx.hasTree() ? ctx.tree().root : undefined;
|
|
@@ -365,8 +365,17 @@ export function browserOnlyRefusal(ctx, c, a, images, pages = false) {
|
|
|
365
365
|
const allow = `strom allow archive ${a.host} --way browser`;
|
|
366
366
|
const manual = byHand(ctx, images);
|
|
367
367
|
const kept = a.permission === "slow" ? ` — the person's permission "slowly" from before is kept as given, and takes no direct request there` : "";
|
|
368
|
-
|
|
369
|
-
|
|
368
|
+
// finding a book (--find, --list): never through strom there — its catalogue on the archive's own site, page by page
|
|
369
|
+
// through the agent's browser strom keeps (the person allowed it "through the browser"), else the person's
|
|
370
|
+
const site = `https://${a.host}/`;
|
|
371
|
+
const find = !catalogue
|
|
372
|
+
? ""
|
|
373
|
+
: agent && browserHelps(a) && a.permission === "browser" && browserKept(agent, root, ctx.env)
|
|
374
|
+
? `find the book on the archive's own site through your browser instead (${site} — its catalogue page by page, at a person's pace), then record it: strom recordset add "<title>" --url <the book's page there> --places <place> --years <from-to> --kinds <kinds>; its images then one at a time: strom media save. `
|
|
375
|
+
: `the book is found on the archive's own site (${site}) by a person: strom task wait ${taskHere(ctx) ?? "T…"} --check ${site} --on "<which book: the place, the years, the kind — impersonal, in the research language>". `;
|
|
376
|
+
return new UsageError(`${a.title ?? a.host} lets automated tools in only through a person's browser (${browserWhy(a)}) — no direct request through ${c.name}, a probe or your web tools${catalogue ? ", finding its books neither" : ""}${kept}`, {
|
|
377
|
+
hint: find +
|
|
378
|
+
`go on with another way to the same records (another archive, the parish, an index, a catalogue), or the user saves what the research needs by hand: ${manual}` +
|
|
370
379
|
`${pages ? "" : " — only a connector whose pages come from the person's browser (browser.pages) goes there, with the person's permission"}` +
|
|
371
380
|
`${advice ? `; ${advice}` : browser && a.permission !== "browser" ? `; its images through the agent's browser, one at a time, only with the person's permission "through the browser" (${allow} — the person's)` : ""}`,
|
|
372
381
|
code: "archive.browser",
|
|
@@ -379,6 +388,7 @@ export function browserOnlyRefusal(ctx, c, a, images, pages = false) {
|
|
|
379
388
|
...(a.permission ? { permission: a.permission } : {}),
|
|
380
389
|
...(browser && a.permission !== "browser" ? { browser: allow } : {}),
|
|
381
390
|
manual,
|
|
391
|
+
...(find ? { find: find.trim() } : {}),
|
|
382
392
|
},
|
|
383
393
|
});
|
|
384
394
|
}
|
|
@@ -421,7 +431,7 @@ export async function gateArchive(ctx, c, o) {
|
|
|
421
431
|
// only a person's browser goes there: nothing straight through strom — a connector without the browser's pages has no way
|
|
422
432
|
const browserOnly = levels.find((a) => a.browserOnly && (!pages || !allows(a, activity, route).ok && allows(a, activity, route).why === "browser"));
|
|
423
433
|
if (browserOnly)
|
|
424
|
-
throw browserOnlyRefusal(ctx, c, browserOnly, o.images, pages);
|
|
434
|
+
throw browserOnlyRefusal(ctx, c, browserOnly, o.images, pages, activity === "catalogue");
|
|
425
435
|
if (o.closedOnly)
|
|
426
436
|
return { levels, human: new Map() };
|
|
427
437
|
const missing = levels.filter((a) => {
|
|
@@ -1322,6 +1322,9 @@ register({
|
|
|
1322
1322
|
"downloads folder, and --take, which takes them over from there, checked and registered.\n" +
|
|
1323
1323
|
"A connector whose portal answers a real browser only (browser.pages: a bot check) has every page read\n" +
|
|
1324
1324
|
"there too: each run plans the page it needs next, --take gives it to the connector and goes on.\n" +
|
|
1325
|
+
"An archive only a person's browser goes to (strom's list, its robots.txt) takes no other connector's request,\n" +
|
|
1326
|
+
"--find and --list neither: its books are found on its own site (your browser strom keeps, with the person's\n" +
|
|
1327
|
+
"permission \"through the browser\", else the person), its images saved one at a time with strom media save.\n" +
|
|
1325
1328
|
"--background (with --recordset, in a session) fetches by a strom of its own while you work on — the images\n" +
|
|
1326
1329
|
"this session reads (never for a later one): strom read of the book reads them as they come. It belongs to\n" +
|
|
1327
1330
|
"your session and the task it is for (--task T…; without it the one task this session worked on that names\n" +
|