strom-research 1.32.0 → 1.33.0-beta.2

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 CHANGED
@@ -5,6 +5,30 @@
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.2. 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
+ - **Slabé a očekávané snímky:** slabý snímek se uloží ještě jednou přes `strom media save --again` jako nová kopie vedle
25
+ první, nic se neodebere a snímkem je ta nejostřejší; snímek, na který čeká úkol, řekne, kdo na něj čeká a další krok;
26
+ stahování, které se ještě zapisuje, se počká, a `strom fetch --take` vezme seznam snímků i vedle plánu stránek.
27
+ - **Indexy:** index jiné farnosti se nikdy nenabídne přes příslušnost, která neříká kterou farnost; počítají se roky
28
+ příslušnosti.
29
+ - **Příkazy, jak je agenti píší:** jiný název volby nebo příkazu se přijme, nebo se odpoví tím správným;
30
+ `strom grep --in` se začátkem názvů souborů čte tyto soubory.
31
+
8
32
  ## 1.32.0
9
33
 
10
34
  *14. 11. 2026 · patří k aplikaci Strom 3.28.0.*
package/CHANGELOG.de.md CHANGED
@@ -5,6 +5,34 @@
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.2. 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
+ - **Schwache und erwartete Bilder:** Ein schwacher Scan wird mit `strom media save --again` noch einmal als neue Kopie
28
+ neben der ersten gespeichert, nichts wird entfernt, und die schärfste Kopie ist das Bild; ein Bild, auf das eine Aufgabe
29
+ wartet, nennt, wer wartet, und den nächsten Schritt; auf einen Download, der noch geschrieben wird, wird gewartet, und
30
+ `strom fetch --take` nimmt eine Liste von Bildern auch neben einem Seitenplan.
31
+ - **Indizes:** Ein Index einer anderen Pfarrei wird nie über eine Zuständigkeit angeboten, die nicht sagt, welche
32
+ Pfarrei; die Jahre einer Zuständigkeit zählen.
33
+ - **Befehle, wie Agenten sie tippen:** Ein anderer Name für eine Option oder einen Befehl wird angenommen oder mit dem
34
+ richtigen beantwortet; `strom grep --in` mit dem Anfang von Dateinamen liest diese Dateien.
35
+
8
36
  ## 1.32.0
9
37
 
10
38
  *14.11.2026 · gehört zur Strom-App 3.28.0.*
package/CHANGELOG.md CHANGED
@@ -5,6 +5,30 @@ 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.2. 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
+ - **Weak and awaited images:** a weak scan is saved once more with `strom media save --again` as a new copy beside the
25
+ first, nothing removed, and the sharpest copy is the image; an image a task waits for says who waits and the next step;
26
+ a download still being written is waited for, and `strom fetch --take` takes a list of images even beside a page plan.
27
+ - **Indexes:** an index of another parish is never offered through a jurisdiction that does not say which parish; the
28
+ years of a jurisdiction count.
29
+ - **Commands as agents type them:** another name for an option or a command is taken, or answered with the right one;
30
+ `strom grep --in` with the start of file names reads those files.
31
+
8
32
  ## 1.32.0
9
33
 
10
34
  *2026-11-14 · goes with the Strom app 3.28.0.*
package/CHANGELOG.pl.md CHANGED
@@ -5,6 +5,33 @@
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.2. 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
+ - **Słabe i oczekiwane skany:** słaby skan zapisuje się jeszcze raz przez `strom media save --again` jako nową kopię obok
27
+ pierwszej, nic nie jest usuwane, a skanem jest najostrzejsza kopia; skan, na który czeka zadanie, podaje, kto czeka,
28
+ i następny krok; na pobieranie, które jeszcze się zapisuje, strom czeka, a `strom fetch --take` bierze listę skanów
29
+ także obok planu stron.
30
+ - **Indeksy:** indeks innej parafii nigdy nie jest proponowany przez przynależność, która nie mówi, o którą parafię
31
+ chodzi; liczą się lata przynależności.
32
+ - **Polecenia tak, jak wpisują je agenci:** inna nazwa opcji lub polecenia zostaje przyjęta albo strom odpowiada właściwą;
33
+ `strom grep --in` z początkiem nazw plików czyta te pliki.
34
+
8
35
  ## 1.32.0
9
36
 
10
37
  *14.11.2026 · współpracuje z aplikacją Strom 3.28.0.*
@@ -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-04",
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
@@ -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 souborů, jednou (ikona vpravo v adresním řádku prohlížeče)",
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",
@@ -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",
@@ -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",
@@ -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;
@@ -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
@@ -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
@@ -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" and which has no connector — Claude in
26
- Chrome saves its images one at a time: `strom media save T… --image <n> --at
27
- <its page>` (the script for your tab), then `strom media add --inbox
28
- --waiting`. Nothing else is opened or downloaded there; a check whether a
29
- person is there is the person's to pass, never yours.
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.
@@ -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
- What a task waits for (\`--on\`) is a sentence the user reads in strom's
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\`.
@@ -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
- const direct = readyConnectors(tree.env, shared, url);
611
- 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);
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`;
@@ -685,7 +690,7 @@ function bookRoute(tree, b, ready) {
685
690
  return { connector: c.name, ...(found.size === 1 ? { book: [...found][0] } : {}), part, browser };
686
691
  }
687
692
  /** How many images of a record set are registered, how to look at them, and how the others come. */
688
- function imagesLines(tree, b, route, shape, finder, noSharper = false, waiting, handOnly = false) {
693
+ function imagesLines(tree, b, route, shape, finder, noSharper = false, waiting, handOnly = false, saveAgain) {
689
694
  // each image once: its parts and other copies are the same image
690
695
  const nums = imagesIndex(tree).sets.get(b.id)?.images ?? [];
691
696
  const repo = b.repository ? tree.get(b.repository) : undefined;
@@ -719,7 +724,12 @@ function imagesLines(tree, b, route, shape, finder, noSharper = false, waiting,
719
724
  return [
720
725
  ` images registered (${nums.length}): ${which} · strom media view ${b.id}:<image>[-<image>] [--half left|right|both] [--grid] [--crop x,y,w,h]…`,
721
726
  weak
722
- ? ` weak scans (long side ${weak} px): a negative on them is weak — ${route?.part && !noSharper ? `a part sharper: strom fetch ${route.connector} --recordset ${b.id} --images <n> --crop x,y,w,h` : SHARPER_SCAN}`
727
+ ? ` weak scans (long side ${weak} px): a negative on them is weak — ${route?.part && !noSharper
728
+ ? `a part sharper: strom fetch ${route.connector} --recordset ${b.id} --images <n> --crop x,y,w,h`
729
+ : // an archive your own browser saves images of: the image once more, sharper — never a wait for the person
730
+ saveAgain
731
+ ? `a sharper scan through your browser: ${saveAgain} (the viewer zoomed in on the entry, or its full resolution; a new copy beside it, nothing removed — the sharpest is the image)`
732
+ : SHARPER_SCAN}`
723
733
  : "",
724
734
  // the others: through the connector, else as the archive allows (the person's decision waiting: not fetched)
725
735
  (waiting ? ` more: ${waiting}` : undefined) ??
@@ -790,7 +800,9 @@ function repoHint(tree) {
790
800
  * sets, of the other record sets of those places and of the archives the places' jurisdictions name — each with its
791
801
  * archive; the others installed by name only.
792
802
  */
793
- function placeConnectors(tree, sets, places, keys, ready, installed, all) {
803
+ function placeConnectors(tree, sets, places, keys, ready, installed, all, shared) {
804
+ // one strom fetch refuses whole (an archive only a person's browser goes to): named as that, never as a way to find books
805
+ const shut = new Set(all.filter((c) => !byHandOnly(c) && browserOnlyShut(tree, c, shared)).map((c) => c.name));
794
806
  const urls = [];
795
807
  const repoOf = (id) => (id ? tree.get(id) : undefined);
796
808
  const books = [...sets, ...tree.list("recordset").filter((b) => !sets.includes(b) && (b.places ?? []).flatMap(keys).some((k) => places.has(k)))];
@@ -813,8 +825,8 @@ function placeConnectors(tree, sets, places, keys, ready, installed, all) {
813
825
  if (!serving.has(c.name) || !serving.get(c.name))
814
826
  serving.set(c.name, u.archive);
815
827
  // 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];
828
+ 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 } : {}) }));
829
+ return [...[...serving].map(([name, archive]) => ({ name, ...(archive ? { archive } : {}), serves: true, ...(shut.has(name) ? { browserOnly: true } : {}) })), ...others];
818
830
  }
819
831
  /**
820
832
  * 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 +901,17 @@ function archiveLine(tree, b, repo, shared, installed, qs = []) {
889
901
  if (a.level === "restricted" || a.level === "unknown")
890
902
  parts.push(a.permission
891
903
  ? `the person's permission: ${a.permission === "slow" ? "images slowly" : a.permission === "browser" ? "through the browser" : "by hand only"}`
892
- : ((q) => (q ? `the person's decision on its images waits since ${q.at.slice(0, 10)}` : "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))));
904
+ : ((q) => q
905
+ ? `the person's decision on its images waits since ${q.at.slice(0, 10)}`
906
+ : // an archive only a person's browser goes to: no fetch there at all, so none asks — the way is the person's
907
+ a.browserOnly
908
+ ? `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`
909
+ : "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
910
  else if (a.permission === "manual")
894
911
  parts.push("the person: images by hand only");
895
912
  // a restricted archive's images, allowed slowly or through the browser: sparing (the method's "Fetch only what you read")
896
913
  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");
914
+ 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
915
  if (a.refused)
899
916
  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
917
  else if (net) {
@@ -1348,7 +1365,16 @@ export function buildBrief(tree, opts) {
1348
1365
  const installed = installedFor(opts.shared);
1349
1366
  const ready = readyFor(tree, opts.shared, installed);
1350
1367
  const routes = new Map(sets.map((b) => [b.id, bookRoute(tree, b, ready)]));
1351
- const finders = new Map(sets.map((b) => [b.id, routes.get(b.id) ? undefined : bookFinder(tree, b, installed)]));
1368
+ // an archive only a person's browser goes to, allowed "through the browser": the agent's browser saves its images one
1369
+ // at a time where strom keeps that browser (strom media save) — never strom fetch there
1370
+ const saveFor = (b) => {
1371
+ const repo = b.repository ? tree.get(b.repository) : undefined;
1372
+ const a = bookBrowserArchive(tree, [b.url, repo?.url].find((x) => !!x && URL.canParse(x)), opts.shared);
1373
+ 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;
1374
+ };
1375
+ const finders = new Map(sets.map((b) => [b.id, routes.get(b.id) ? undefined : bookFinder(tree, b, installed, opts.shared, saveFor(b))]));
1376
+ // a weak scan of such an archive: the image saved once more through that browser (strom media save --again)
1377
+ const saveAgainFor = (b) => (saveFor(b) ? `strom media save ${task?.id ?? "T…"} --image <n> --recordset ${b.id} --at <the archive's page of that image> --again` : undefined);
1352
1378
  const shapeFor = sets.find((b) => routes.get(b.id))?.id;
1353
1379
  if (sets.length)
1354
1380
  sections.push({
@@ -1373,7 +1399,7 @@ export function buildBrief(tree, opts) {
1373
1399
  browserLine(tree, b, repo, opts.shared, tuneAgent, task?.id),
1374
1400
  b.layout ? ` layout: ${b.layout}` : "",
1375
1401
  calibrationLine(b) ? ` ${calibrationLine(b)}` : "",
1376
- ...imagesLines(tree, b, routes.get(b.id), b.id === shapeFor, finders.get(b.id), !!(tuning && bookTuned(tuning.state, tuning.key, b.id, tuning.since).noSharper), waitsFor(b), hand),
1402
+ ...imagesLines(tree, b, routes.get(b.id), b.id === shapeFor, finders.get(b.id), !!(tuning && bookTuned(tuning.state, tuning.key, b.id, tuning.since).noSharper), waitsFor(b), hand, saveAgainFor(b)),
1377
1403
  ...tunedBookLines(tuning, b, routes.get(b.id), opts.shared),
1378
1404
  ].filter(Boolean).join("\n");
1379
1405
  }),
@@ -1508,7 +1534,7 @@ export function buildBrief(tree, opts) {
1508
1534
  // 8b. the commands this kind of task uses, with every option and limit (K2): asking for them costs a turn each —
1509
1535
  // and the connectors of the task's places, so that fetching needs no lookup
1510
1536
  // (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));
1537
+ const connectors = placeConnectors(tree, sets, taskPlaces, placeKeys, ready, installed, listConnectors(opts.shared), opts.shared);
1512
1538
  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
1539
  if (sheet)
1514
1540
  sections.push({ name: "commands", first: true, pointer: "strom help <command>", text: sheet });
@@ -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
- if (!list.length)
125
- return " connectors: none installed — an archive's own: strom connector new <name> --url <portal>";
126
- 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>`;
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) => [` ${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)] : [])]),
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
  }
@@ -95,6 +95,11 @@ export function resolveCommand(argv) {
95
95
  if (found && leftover.length === 0) {
96
96
  if (found.def.path.length === 0 && extra.length && rest[0] !== "--")
97
97
  throw unknownCommand(extra.slice(0, 2));
98
+ // a group that is a command of its own too (strom history) and takes no argument: a word after it is a subcommand
99
+ // it does not have (strom history read) — the near ones said, never "unexpected argument"
100
+ const next = rest[0];
101
+ if (found.def.path.length && !found.def.args?.length && next !== undefined && !next.startsWith("-") && subcommandsOf(found.def.path, true).length)
102
+ throw unknownCommand([...found.def.path, next], undefined, true);
98
103
  return { def: found.def, rest };
99
104
  }
100
105
  // A group ("person") with a wrong or missing subcommand.
@@ -128,17 +133,22 @@ export class GroupOnly extends Error {
128
133
  }
129
134
  /**
130
135
  * An unknown command, said as typed (`said`: another name of a group — strom book … — when `words` name the group it
131
- * stands for) with the commands near it; a group's ID after it (strom book B1) offers the group's show.
136
+ * stands for) with the commands near it; a group's ID after it (strom book B1) offers the group's show; `hidden`: the
137
+ * group's commands behind a gate are near ones too (a group that is a command of its own: strom history read).
132
138
  */
133
- function unknownCommand(words, said = words) {
139
+ function unknownCommand(words, said = words, hidden = false) {
134
140
  const typed = said.join(" ");
135
141
  const all = commands().filter((c) => c.path.length > 0).map((c) => c.path.join(" "));
136
- // A known group narrows the choice ("person ad" → "person add", not "lesson add").
137
- const inGroup = all.filter((c) => c.startsWith(`${words[0]} `));
142
+ // A known group narrows the choice ("person ad" → "person add", not "lesson add"); `hidden`: a group that is a
143
+ // command too (strom history), its commands behind a gate among them, as they run when named
144
+ const inGroup = hidden ? subcommandsOf([words[0]], true).map((c) => c.path.join(" ")) : all.filter((c) => c.startsWith(`${words[0]} `));
138
145
  const same = (inGroup.length ? inGroup : all).filter((c) => c.split(" ").length === words.length);
139
146
  const hits = suggest(words.join(" "), same.length ? same : all);
147
+ // another word for a command of the group (strom task view → task show, strom history read → history show · list),
148
+ // before the commands a few letters away (read is no redo)
149
+ const synonyms = words.length === 2 ? (SUBCOMMAND_WORDS[words[1].toLowerCase()] ?? []).map((w) => `${words[0]} ${w}`).filter((c) => inGroup.includes(c)) : [];
140
150
  const show = !hits.length && words.length === 2 && /^\p{Lu}\p{N}+$/u.test(words[1]) && inGroup.includes(`${words[0]} show`) ? `${said[0]} show ${said[1]}` : undefined;
141
- const more = show ? [show] : hits.length ? hits : suggest(words[0] ?? "", [...new Set(all.map((c) => c.split(" ")[0]))]);
151
+ const more = show ? [show] : synonyms.length ? synonyms : hits.length ? hits : suggest(words[0] ?? "", [...new Set(all.map((c) => c.split(" ")[0]))]);
142
152
  // in the words typed: the group's other name kept (strom book show, not strom recordset show)
143
153
  const asTyped = (c) => (said[0] !== words[0] && c.split(" ")[0] === words[0] ? [said[0], ...c.split(" ").slice(1)].join(" ") : c);
144
154
  const near = more.map((c) => `strom ${asTyped(c)}`).join(" · ");
@@ -147,6 +157,25 @@ function unknownCommand(words, said = words) {
147
157
  ...(more.length ? { code: "command.near", params: { cmd: typed, near } } : { code: "command.unknown", params: { cmd: typed } }),
148
158
  });
149
159
  }
160
+ /** Other words agents type for a command of a group: the commands they mean, those the group has said. */
161
+ const SUBCOMMAND_WORDS = {
162
+ view: ["show", "list"],
163
+ get: ["show", "list"],
164
+ read: ["show", "list"],
165
+ display: ["show", "list"],
166
+ open: ["show"],
167
+ print: ["show", "list"],
168
+ info: ["show"],
169
+ detail: ["show"],
170
+ details: ["show"],
171
+ ls: ["list"],
172
+ all: ["list"],
173
+ new: ["add"],
174
+ create: ["add"],
175
+ update: ["edit"],
176
+ change: ["edit"],
177
+ modify: ["edit"],
178
+ };
150
179
  /** One option as the usage under a mistake says it: --name <value>, "…" when repeatable, its limit. */
151
180
  function optionWord(o) {
152
181
  const value = o.type === "boolean" ? "" : ` ${o.value ?? "<value>"}`;
@@ -325,10 +354,12 @@ export function parseOptions(def, rest, program = "strom") {
325
354
  code: "option.unknown", hintCode: "option.unknown.status", params: { opt, cmd, options: own.join(" "), path: def.path.join(" ") }, usage,
326
355
  });
327
356
  // a name agents type meaning another option (--timeout for --minutes): that one, with what it takes
328
- const meant = optionsOf(def).find((o) => o.mistaken?.includes(opt.replace(/^-+/u, "")));
329
- if (meant) {
330
- const near = `--${meant.name}${meant.value ? ` ${meant.value}` : ""}`;
331
- throw new UsageError(`unknown option ${opt} for ${cmd}`, { hint: `meant: ${near} — ${meant.description}`, code: "option.near", params: { opt, cmd, near }, usage });
357
+ // (several of them: each, what it takes and is — strom search add --about: its task, the surnames looked for)
358
+ const meant = optionsOf(def).filter((o) => o.mistaken?.includes(opt.replace(/^-+/u, "")));
359
+ if (meant.length) {
360
+ const word = (o) => `--${o.name}${o.value ? ` ${o.value}` : ""}`;
361
+ const near = meant.map(word).join(" · ");
362
+ throw new UsageError(`unknown option ${opt} for ${cmd}`, { hint: `meant: ${meant.map((o) => `${word(o)} — ${o.description}`).join(" · ")}`, code: "option.near", params: { opt, cmd, near }, usage });
332
363
  }
333
364
  const near = suggest(opt, optionsOf(def).filter((o) => !o.hidden).map((o) => `--${o.name}`));
334
365
  const help = `strom help${def.path.length ? ` ${def.path.join(" ")}` : ""}`;
@@ -74,9 +74,9 @@ export function match(words) {
74
74
  }
75
75
  return best;
76
76
  }
77
- /** Command groups ("person") that have subcommands but no command of their own. */
78
- export function subcommandsOf(prefix) {
79
- return registry.filter((c) => !c.hidden && c.path.length > prefix.length && prefix.every((w, i) => c.path[i] === w));
77
+ /** Command groups ("person") that have subcommands but no command of their own; `hidden`: those behind a gate too. */
78
+ export function subcommandsOf(prefix, hidden = false) {
79
+ return registry.filter((c) => (hidden || !c.hidden) && c.path.length > prefix.length && prefix.every((w, i) => c.path[i] === w));
80
80
  }
81
81
  /** An alias's words that begin with these (a group of aliases only: "lesson" has "lesson show" among them). */
82
82
  export function aliasExtends(prefix) {